Merge "Add ril.test.emergency system property."
diff --git a/Android.mk b/Android.mk
index 83c4b5b..5acfb86 100644
--- a/Android.mk
+++ b/Android.mk
@@ -94,6 +94,7 @@
 	core/java/android/bluetooth/IBluetoothHealthCallback.aidl \
 	core/java/android/bluetooth/IBluetoothPbap.aidl \
 	core/java/android/bluetooth/IBluetoothStateChangeCallback.aidl \
+	core/java/android/content/ICancellationSignal.aidl \
 	core/java/android/content/IClipboard.aidl \
 	core/java/android/content/IContentService.aidl \
 	core/java/android/content/IIntentReceiver.aidl \
@@ -449,8 +450,6 @@
 		            resources/samples/training/ads-and-ux "Mobile Advertisement Integration" \
 		-samplecode $(sample_dir)/MultiResolution \
 		            resources/samples/MultiResolution "Multiple Resolutions" \
-		-samplecode $(sample_dir)/NFCDemo \
-		            resources/samples/NFCDemo "NFC Demo" \
 		-samplecode $(sample_dir)/training/multiscreen/newsreader \
 		            resources/samples/newsreader "News Reader" \
 		-samplecode $(sample_dir)/NotePad \
diff --git a/CleanSpec.mk b/CleanSpec.mk
index fb334fc..d74d7b1 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -117,6 +117,8 @@
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/media/audio/)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/fonts/DroidSans*)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/media/audio/)
+$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/core/java/android/content)
+$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src/android/content)
 # ************************************************
 # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
 # ************************************************
diff --git a/api/15.txt b/api/15.txt
index ddf5baf..68fb4bc 100644
--- a/api/15.txt
+++ b/api/15.txt
@@ -6611,6 +6611,7 @@
     method public int getDimensionPixelSize(int) throws android.content.res.Resources.NotFoundException;
     method public android.util.DisplayMetrics getDisplayMetrics();
     method public android.graphics.drawable.Drawable getDrawable(int) throws android.content.res.Resources.NotFoundException;
+    method public android.graphics.drawable.Drawable getDrawableForDensity(int, int) throws android.content.res.Resources.NotFoundException;
     method public float getFraction(int, int, int);
     method public int getIdentifier(java.lang.String, java.lang.String, java.lang.String);
     method public int[] getIntArray(int) throws android.content.res.Resources.NotFoundException;
@@ -6633,6 +6634,7 @@
     method public java.lang.CharSequence[] getTextArray(int) throws android.content.res.Resources.NotFoundException;
     method public void getValue(int, android.util.TypedValue, boolean) throws android.content.res.Resources.NotFoundException;
     method public void getValue(java.lang.String, android.util.TypedValue, boolean) throws android.content.res.Resources.NotFoundException;
+    method public void getValueForDensity(int, int, android.util.TypedValue, boolean) throws android.content.res.Resources.NotFoundException;
     method public android.content.res.XmlResourceParser getXml(int) throws android.content.res.Resources.NotFoundException;
     method public final android.content.res.Resources.Theme newTheme();
     method public android.content.res.TypedArray obtainAttributes(android.util.AttributeSet, int[]);
diff --git a/api/current.txt b/api/current.txt
index 1f6ba1b..574af6b 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -436,7 +436,7 @@
     field public static final int fadeEnabled = 16843390; // 0x101027e
     field public static final int fadeOffset = 16843383; // 0x1010277
     field public static final int fadeScrollbars = 16843434; // 0x10102aa
-    field public static final deprecated int fadingEdge = 16842975; // 0x10100df
+    field public static final int fadingEdge = 16842975; // 0x10100df
     field public static final int fadingEdgeLength = 16842976; // 0x10100e0
     field public static final int fastScrollAlwaysVisible = 16843573; // 0x1010335
     field public static final int fastScrollEnabled = 16843302; // 0x1010226
@@ -1992,10 +1992,11 @@
     method public static java.lang.String feedbackTypeToString(int);
     method public static java.lang.String flagToString(int);
     method public boolean getCanRetrieveWindowContent();
-    method public java.lang.String getDescription();
+    method public deprecated java.lang.String getDescription();
     method public java.lang.String getId();
     method public android.content.pm.ResolveInfo getResolveInfo();
     method public java.lang.String getSettingsActivityName();
+    method public java.lang.String loadDescription(android.content.pm.PackageManager);
     method public void writeToParcel(android.os.Parcel, int);
     field public static final android.os.Parcelable.Creator CREATOR;
     field public static final int DEFAULT = 1; // 0x1
@@ -2287,7 +2288,8 @@
     method public long getStagger(int);
     method public long getStartDelay(int);
     method public java.util.List<android.animation.LayoutTransition.TransitionListener> getTransitionListeners();
-    method public void hideChild(android.view.ViewGroup, android.view.View);
+    method public deprecated void hideChild(android.view.ViewGroup, android.view.View);
+    method public void hideChild(android.view.ViewGroup, android.view.View, int);
     method public boolean isChangingLayout();
     method public boolean isRunning();
     method public void removeChild(android.view.ViewGroup, android.view.View);
@@ -2299,7 +2301,8 @@
     method public void setInterpolator(int, android.animation.TimeInterpolator);
     method public void setStagger(int, long);
     method public void setStartDelay(int, long);
-    method public void showChild(android.view.ViewGroup, android.view.View);
+    method public deprecated void showChild(android.view.ViewGroup, android.view.View);
+    method public void showChild(android.view.ViewGroup, android.view.View, int);
     field public static final int APPEARING = 2; // 0x2
     field public static final int CHANGE_APPEARING = 0; // 0x0
     field public static final int CHANGE_DISAPPEARING = 1; // 0x1
@@ -2346,6 +2349,15 @@
     method public void setPropertyName(java.lang.String);
   }
 
+  public class TimeAnimator extends android.animation.ValueAnimator {
+    ctor public TimeAnimator();
+    method public void setTimeListener(android.animation.TimeAnimator.TimeListener);
+  }
+
+  public static abstract interface TimeAnimator.TimeListener {
+    method public abstract void onTimeUpdate(android.animation.TimeAnimator, long, long);
+  }
+
   public abstract interface TimeInterpolator {
     method public abstract float getInterpolation(float);
   }
@@ -2399,6 +2411,16 @@
 
 }
 
+package android.annotation {
+
+  public abstract class SuppressLint implements java.lang.annotation.Annotation {
+  }
+
+  public abstract class TargetApi implements java.lang.annotation.Annotation {
+  }
+
+}
+
 package android.app {
 
   public abstract class ActionBar {
@@ -4657,7 +4679,8 @@
 
   public abstract class AsyncTaskLoader extends android.content.Loader {
     ctor public AsyncTaskLoader(android.content.Context);
-    method public boolean cancelLoad();
+    method public void cancelLoadInBackground();
+    method public boolean isLoadInBackgroundCanceled();
     method public abstract D loadInBackground();
     method public void onCanceled(D);
     method protected D onLoadInBackground();
@@ -4700,6 +4723,18 @@
     method public final void setResultExtras(android.os.Bundle);
   }
 
+  public final class CancellationSignal {
+    ctor public CancellationSignal();
+    method public void cancel();
+    method public boolean isCanceled();
+    method public void setOnCancelListener(android.content.CancellationSignal.OnCancelListener);
+    method public void throwIfCanceled();
+  }
+
+  public static abstract interface CancellationSignal.OnCancelListener {
+    method public abstract void onCancel();
+  }
+
   public class ClipData implements android.os.Parcelable {
     ctor public ClipData(java.lang.CharSequence, java.lang.String[], android.content.ClipData.Item);
     ctor public ClipData(android.content.ClipDescription, android.content.ClipData.Item);
@@ -4819,6 +4854,7 @@
     method public android.os.ParcelFileDescriptor openPipeHelper(android.net.Uri, java.lang.String, android.os.Bundle, T, android.content.ContentProvider.PipeDataWriter<T>) throws java.io.FileNotFoundException;
     method public android.content.res.AssetFileDescriptor openTypedAssetFile(android.net.Uri, java.lang.String, android.os.Bundle) throws java.io.FileNotFoundException;
     method public abstract android.database.Cursor query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String);
+    method public android.database.Cursor query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, android.content.CancellationSignal);
     method protected final void setPathPermissions(android.content.pm.PathPermission[]);
     method protected final void setReadPermission(java.lang.String);
     method protected final void setWritePermission(java.lang.String);
@@ -4842,6 +4878,7 @@
     method public android.os.ParcelFileDescriptor openFile(android.net.Uri, java.lang.String) throws java.io.FileNotFoundException, android.os.RemoteException;
     method public final android.content.res.AssetFileDescriptor openTypedAssetFileDescriptor(android.net.Uri, java.lang.String, android.os.Bundle) throws java.io.FileNotFoundException, android.os.RemoteException;
     method public android.database.Cursor query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String) throws android.os.RemoteException;
+    method public android.database.Cursor query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, android.content.CancellationSignal) throws android.os.RemoteException;
     method public boolean release();
     method public int update(android.net.Uri, android.content.ContentValues, java.lang.String, java.lang.String[]) throws android.os.RemoteException;
   }
@@ -4928,6 +4965,7 @@
     method public final java.io.OutputStream openOutputStream(android.net.Uri, java.lang.String) throws java.io.FileNotFoundException;
     method public final android.content.res.AssetFileDescriptor openTypedAssetFileDescriptor(android.net.Uri, java.lang.String, android.os.Bundle) throws java.io.FileNotFoundException;
     method public final android.database.Cursor query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String);
+    method public final android.database.Cursor query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, android.content.CancellationSignal);
     method public final void registerContentObserver(android.net.Uri, boolean, android.database.ContentObserver);
     method public static void removePeriodicSync(android.accounts.Account, java.lang.String, android.os.Bundle);
     method public static void removeStatusChangeListener(java.lang.Object);
@@ -5350,6 +5388,7 @@
     method public static android.content.Intent makeMainActivity(android.content.ComponentName);
     method public static android.content.Intent makeMainSelectorActivity(java.lang.String, java.lang.String);
     method public static android.content.Intent makeRestartActivityTask(android.content.ComponentName);
+    method public static java.lang.String normalizeMimeType(java.lang.String);
     method public static android.content.Intent parseIntent(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
     method public static android.content.Intent parseUri(java.lang.String, int) throws java.net.URISyntaxException;
     method public android.content.Intent putCharSequenceArrayListExtra(java.lang.String, java.util.ArrayList<java.lang.CharSequence>);
@@ -5398,13 +5437,16 @@
     method public android.content.Intent setClassName(java.lang.String, java.lang.String);
     method public android.content.Intent setComponent(android.content.ComponentName);
     method public android.content.Intent setData(android.net.Uri);
+    method public android.content.Intent setDataAndNormalize(android.net.Uri);
     method public android.content.Intent setDataAndType(android.net.Uri, java.lang.String);
+    method public android.content.Intent setDataAndTypeAndNormalize(android.net.Uri, java.lang.String);
     method public void setExtrasClassLoader(java.lang.ClassLoader);
     method public android.content.Intent setFlags(int);
     method public android.content.Intent setPackage(java.lang.String);
     method public void setSelector(android.content.Intent);
     method public void setSourceBounds(android.graphics.Rect);
     method public android.content.Intent setType(java.lang.String);
+    method public android.content.Intent setTypeAndNormalize(java.lang.String);
     method public deprecated java.lang.String toURI();
     method public java.lang.String toUri(int);
     method public void writeToParcel(android.os.Parcel, int);
@@ -5606,6 +5648,7 @@
     field public static final int FLAG_GRANT_READ_URI_PERMISSION = 1; // 0x1
     field public static final int FLAG_GRANT_WRITE_URI_PERMISSION = 2; // 0x2
     field public static final int FLAG_INCLUDE_STOPPED_PACKAGES = 32; // 0x20
+    field public static final int FLAG_RECEIVER_FOREGROUND = 268435456; // 0x10000000
     field public static final int FLAG_RECEIVER_REGISTERED_ONLY = 1073741824; // 0x40000000
     field public static final int FLAG_RECEIVER_REPLACE_PENDING = 536870912; // 0x20000000
     field public static final java.lang.String METADATA_DOCK_HOME = "android.dock_home";
@@ -5730,7 +5773,9 @@
   public class Loader {
     ctor public Loader(android.content.Context);
     method public void abandon();
+    method public boolean cancelLoad();
     method public java.lang.String dataToString(D);
+    method public void deliverCancellation();
     method public void deliverResult(D);
     method public void dump(java.lang.String, java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]);
     method public void forceLoad();
@@ -5740,23 +5785,30 @@
     method public boolean isReset();
     method public boolean isStarted();
     method protected void onAbandon();
+    method protected boolean onCancelLoad();
     method public void onContentChanged();
     method protected void onForceLoad();
     method protected void onReset();
     method protected void onStartLoading();
     method protected void onStopLoading();
     method public void registerListener(int, android.content.Loader.OnLoadCompleteListener<D>);
+    method public void registerOnLoadCanceledListener(android.content.Loader.OnLoadCanceledListener<D>);
     method public void reset();
     method public final void startLoading();
     method public void stopLoading();
     method public boolean takeContentChanged();
     method public void unregisterListener(android.content.Loader.OnLoadCompleteListener<D>);
+    method public void unregisterOnLoadCanceledListener(android.content.Loader.OnLoadCanceledListener<D>);
   }
 
   public final class Loader.ForceLoadContentObserver extends android.database.ContentObserver {
     ctor public Loader.ForceLoadContentObserver();
   }
 
+  public static abstract interface Loader.OnLoadCanceledListener {
+    method public abstract void onLoadCanceled(android.content.Loader<D>);
+  }
+
   public static abstract interface Loader.OnLoadCompleteListener {
     method public abstract void onLoadComplete(android.content.Loader<D>, D);
   }
@@ -5776,6 +5828,11 @@
     method public int getNumSuccessfulYieldPoints();
   }
 
+  public class OperationCanceledException extends java.lang.RuntimeException {
+    ctor public OperationCanceledException();
+    ctor public OperationCanceledException(java.lang.String);
+  }
+
   public class PeriodicSync implements android.os.Parcelable {
     ctor public PeriodicSync(android.accounts.Account, java.lang.String, android.os.Bundle, long);
     method public int describeContents();
@@ -6613,6 +6670,7 @@
     method public int getDimensionPixelSize(int) throws android.content.res.Resources.NotFoundException;
     method public android.util.DisplayMetrics getDisplayMetrics();
     method public android.graphics.drawable.Drawable getDrawable(int) throws android.content.res.Resources.NotFoundException;
+    method public android.graphics.drawable.Drawable getDrawableForDensity(int, int) throws android.content.res.Resources.NotFoundException;
     method public float getFraction(int, int, int);
     method public int getIdentifier(java.lang.String, java.lang.String, java.lang.String);
     method public int[] getIntArray(int) throws android.content.res.Resources.NotFoundException;
@@ -6635,6 +6693,7 @@
     method public java.lang.CharSequence[] getTextArray(int) throws android.content.res.Resources.NotFoundException;
     method public void getValue(int, android.util.TypedValue, boolean) throws android.content.res.Resources.NotFoundException;
     method public void getValue(java.lang.String, android.util.TypedValue, boolean) throws android.content.res.Resources.NotFoundException;
+    method public void getValueForDensity(int, int, android.util.TypedValue, boolean) throws android.content.res.Resources.NotFoundException;
     method public android.content.res.XmlResourceParser getXml(int) throws android.content.res.Resources.NotFoundException;
     method public final android.content.res.Resources.Theme newTheme();
     method public android.content.res.TypedArray obtainAttributes(android.util.AttributeSet, int[]);
@@ -6788,16 +6847,19 @@
 
   public class ContentObservable extends android.database.Observable {
     ctor public ContentObservable();
-    method public void dispatchChange(boolean);
-    method public void notifyChange(boolean);
+    method public deprecated void dispatchChange(boolean);
+    method public void dispatchChange(boolean, android.net.Uri);
+    method public deprecated void notifyChange(boolean);
     method public void registerObserver(android.database.ContentObserver);
   }
 
   public abstract class ContentObserver {
     ctor public ContentObserver(android.os.Handler);
     method public boolean deliverSelfNotifications();
-    method public final void dispatchChange(boolean);
+    method public final deprecated void dispatchChange(boolean);
+    method public final void dispatchChange(boolean, android.net.Uri);
     method public void onChange(boolean);
+    method public void onChange(boolean, android.net.Uri);
   }
 
   public abstract interface CrossProcessCursor implements android.database.Cursor {
@@ -6816,7 +6878,7 @@
   public abstract interface Cursor {
     method public abstract void close();
     method public abstract void copyStringToBuffer(int, android.database.CharArrayBuffer);
-    method public abstract void deactivate();
+    method public abstract deprecated void deactivate();
     method public abstract byte[] getBlob(int);
     method public abstract int getColumnCount();
     method public abstract int getColumnIndex(java.lang.String);
@@ -7202,7 +7264,7 @@
     method public long insertWithOnConflict(java.lang.String, java.lang.String, android.content.ContentValues, int);
     method public boolean isDatabaseIntegrityOk();
     method public boolean isDbLockedByCurrentThread();
-    method public boolean isDbLockedByOtherThreads();
+    method public deprecated boolean isDbLockedByOtherThreads();
     method public boolean isOpen();
     method public boolean isReadOnly();
     method public deprecated void markTableSyncable(java.lang.String, java.lang.String);
@@ -7215,16 +7277,20 @@
     method public static android.database.sqlite.SQLiteDatabase openOrCreateDatabase(java.lang.String, android.database.sqlite.SQLiteDatabase.CursorFactory);
     method public static android.database.sqlite.SQLiteDatabase openOrCreateDatabase(java.lang.String, android.database.sqlite.SQLiteDatabase.CursorFactory, android.database.DatabaseErrorHandler);
     method public android.database.Cursor query(boolean, java.lang.String, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String);
+    method public android.database.Cursor query(boolean, java.lang.String, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String, android.content.CancellationSignal);
     method public android.database.Cursor query(java.lang.String, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String);
     method public android.database.Cursor query(java.lang.String, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String);
     method public android.database.Cursor queryWithFactory(android.database.sqlite.SQLiteDatabase.CursorFactory, boolean, java.lang.String, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String);
+    method public android.database.Cursor queryWithFactory(android.database.sqlite.SQLiteDatabase.CursorFactory, boolean, java.lang.String, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String, android.content.CancellationSignal);
     method public android.database.Cursor rawQuery(java.lang.String, java.lang.String[]);
+    method public android.database.Cursor rawQuery(java.lang.String, java.lang.String[], android.content.CancellationSignal);
     method public android.database.Cursor rawQueryWithFactory(android.database.sqlite.SQLiteDatabase.CursorFactory, java.lang.String, java.lang.String[], java.lang.String);
+    method public android.database.Cursor rawQueryWithFactory(android.database.sqlite.SQLiteDatabase.CursorFactory, java.lang.String, java.lang.String[], java.lang.String, android.content.CancellationSignal);
     method public static int releaseMemory();
     method public long replace(java.lang.String, java.lang.String, android.content.ContentValues);
     method public long replaceOrThrow(java.lang.String, java.lang.String, android.content.ContentValues) throws android.database.SQLException;
     method public void setLocale(java.util.Locale);
-    method public void setLockingEnabled(boolean);
+    method public deprecated void setLockingEnabled(boolean);
     method public void setMaxSqlCacheSize(int);
     method public long setMaximumSize(long);
     method public void setPageSize(long);
@@ -7341,6 +7407,7 @@
     method public java.lang.String getTables();
     method public android.database.Cursor query(android.database.sqlite.SQLiteDatabase, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String);
     method public android.database.Cursor query(android.database.sqlite.SQLiteDatabase, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String);
+    method public android.database.Cursor query(android.database.sqlite.SQLiteDatabase, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String, android.content.CancellationSignal);
     method public void setCursorFactory(android.database.sqlite.SQLiteDatabase.CursorFactory);
     method public void setDistinct(boolean);
     method public void setProjectionMap(java.util.Map<java.lang.String, java.lang.String>);
@@ -7782,7 +7849,7 @@
 
 package android.graphics {
 
-  public class AvoidXfermode extends android.graphics.Xfermode {
+  public deprecated class AvoidXfermode extends android.graphics.Xfermode {
     ctor public AvoidXfermode(int, int, android.graphics.AvoidXfermode.Mode);
   }
 
@@ -7978,8 +8045,8 @@
     method public void drawPoint(float, float, android.graphics.Paint);
     method public void drawPoints(float[], int, int, android.graphics.Paint);
     method public void drawPoints(float[], android.graphics.Paint);
-    method public void drawPosText(char[], int, int, float[], android.graphics.Paint);
-    method public void drawPosText(java.lang.String, float[], android.graphics.Paint);
+    method public deprecated void drawPosText(char[], int, int, float[], android.graphics.Paint);
+    method public deprecated void drawPosText(java.lang.String, float[], android.graphics.Paint);
     method public void drawRGB(int, int, int);
     method public void drawRect(android.graphics.RectF, android.graphics.Paint);
     method public void drawRect(android.graphics.Rect, android.graphics.Paint);
@@ -7997,8 +8064,8 @@
     method public int getDensity();
     method public android.graphics.DrawFilter getDrawFilter();
     method public int getHeight();
-    method public void getMatrix(android.graphics.Matrix);
-    method public final android.graphics.Matrix getMatrix();
+    method public deprecated void getMatrix(android.graphics.Matrix);
+    method public final deprecated android.graphics.Matrix getMatrix();
     method public int getMaximumBitmapHeight();
     method public int getMaximumBitmapWidth();
     method public int getSaveCount();
@@ -8328,7 +8395,7 @@
     method public final boolean isDither();
     method public final boolean isFakeBoldText();
     method public final boolean isFilterBitmap();
-    method public final boolean isLinearText();
+    method public final deprecated boolean isLinearText();
     method public final boolean isStrikeThruText();
     method public final boolean isSubpixelText();
     method public final boolean isUnderlineText();
@@ -8348,7 +8415,7 @@
     method public void setFilterBitmap(boolean);
     method public void setFlags(int);
     method public void setHinting(int);
-    method public void setLinearText(boolean);
+    method public deprecated void setLinearText(boolean);
     method public android.graphics.MaskFilter setMaskFilter(android.graphics.MaskFilter);
     method public android.graphics.PathEffect setPathEffect(android.graphics.PathEffect);
     method public android.graphics.Rasterizer setRasterizer(android.graphics.Rasterizer);
@@ -8561,7 +8628,7 @@
     field public int bytesPerPixel;
   }
 
-  public class PixelXorXfermode extends android.graphics.Xfermode {
+  public deprecated class PixelXorXfermode extends android.graphics.Xfermode {
     ctor public PixelXorXfermode(int);
   }
 
@@ -9044,14 +9111,17 @@
     ctor public GradientDrawable(android.graphics.drawable.GradientDrawable.Orientation, int[]);
     method public void draw(android.graphics.Canvas);
     method public int getOpacity();
+    method public android.graphics.drawable.GradientDrawable.Orientation getOrientation();
     method public void setAlpha(int);
     method public void setColor(int);
     method public void setColorFilter(android.graphics.ColorFilter);
+    method public void setColors(int[]);
     method public void setCornerRadii(float[]);
     method public void setCornerRadius(float);
     method public void setGradientCenter(float, float);
     method public void setGradientRadius(float);
     method public void setGradientType(int);
+    method public void setOrientation(android.graphics.drawable.GradientDrawable.Orientation);
     method public void setShape(int);
     method public void setSize(int, int);
     method public void setStroke(int, int);
@@ -10865,11 +10935,12 @@
   }
 
   public final class MediaRecorder.OutputFormat {
+    field public static final int AAC_ADTS = 6; // 0x6
     field public static final int AMR_NB = 3; // 0x3
     field public static final int AMR_WB = 4; // 0x4
     field public static final int DEFAULT = 0; // 0x0
     field public static final int MPEG_4 = 2; // 0x2
-    field public static final int RAW_AMR = 3; // 0x3
+    field public static final deprecated int RAW_AMR = 3; // 0x3
     field public static final int THREE_GPP = 1; // 0x1
   }
 
@@ -11578,7 +11649,7 @@
     method public void setNetworkPreference(int);
     method public int startUsingNetworkFeature(int, java.lang.String);
     method public int stopUsingNetworkFeature(int, java.lang.String);
-    field public static final java.lang.String ACTION_BACKGROUND_DATA_SETTING_CHANGED = "android.net.conn.BACKGROUND_DATA_SETTING_CHANGED";
+    field public static final deprecated java.lang.String ACTION_BACKGROUND_DATA_SETTING_CHANGED = "android.net.conn.BACKGROUND_DATA_SETTING_CHANGED";
     field public static final java.lang.String CONNECTIVITY_ACTION = "android.net.conn.CONNECTIVITY_CHANGE";
     field public static final int DEFAULT_NETWORK_PREFERENCE = 1; // 0x1
     field public static final java.lang.String EXTRA_EXTRA_INFO = "extraInfo";
@@ -11828,6 +11899,7 @@
     method public abstract boolean isHierarchical();
     method public boolean isOpaque();
     method public abstract boolean isRelative();
+    method public android.net.Uri normalize();
     method public static android.net.Uri parse(java.lang.String);
     method public abstract java.lang.String toString();
     method public static android.net.Uri withAppendedPath(android.net.Uri, java.lang.String);
@@ -12610,6 +12682,7 @@
     ctor public NdefMessage(android.nfc.NdefRecord, android.nfc.NdefRecord...);
     ctor public NdefMessage(android.nfc.NdefRecord[]);
     method public int describeContents();
+    method public int getByteArrayLength();
     method public android.nfc.NdefRecord[] getRecords();
     method public byte[] toByteArray();
     method public void writeToParcel(android.os.Parcel, int);
@@ -12630,6 +12703,8 @@
     method public short getTnf();
     method public byte[] getType();
     method public deprecated byte[] toByteArray();
+    method public java.lang.String toMimeType();
+    method public android.net.Uri toUri();
     method public void writeToParcel(android.os.Parcel, int);
     field public static final android.os.Parcelable.Creator CREATOR;
     field public static final byte[] RTD_ALTERNATIVE_CARRIER;
@@ -14421,6 +14496,7 @@
     field public static final int HONEYCOMB_MR2 = 13; // 0xd
     field public static final int ICE_CREAM_SANDWICH = 14; // 0xe
     field public static final int ICE_CREAM_SANDWICH_MR1 = 15; // 0xf
+    field public static final int JELLY_BEAN = 10000; // 0x2710
   }
 
   public final class Bundle implements java.lang.Cloneable android.os.Parcelable {
@@ -17439,6 +17515,7 @@
     field public static final android.net.Uri CONTENT_URI;
     field public static final java.lang.String DATA_ROAMING = "data_roaming";
     field public static final java.lang.String DEFAULT_INPUT_METHOD = "default_input_method";
+    field public static final java.lang.String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
     field public static final java.lang.String DEVICE_PROVISIONED = "device_provisioned";
     field public static final java.lang.String ENABLED_ACCESSIBILITY_SERVICES = "enabled_accessibility_services";
     field public static final java.lang.String ENABLED_INPUT_METHODS = "enabled_input_methods";
@@ -17517,6 +17594,7 @@
     field public static final java.lang.String ALARM_ALERT = "alarm_alert";
     field public static final java.lang.String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
     field public static final deprecated java.lang.String ANDROID_ID = "android_id";
+    field public static final java.lang.String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
     field public static final java.lang.String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
     field public static final java.lang.String AUTO_TIME = "auto_time";
     field public static final java.lang.String AUTO_TIME_ZONE = "auto_time_zone";
@@ -17557,6 +17635,7 @@
     field public static final java.lang.String RADIO_NFC = "nfc";
     field public static final java.lang.String RADIO_WIFI = "wifi";
     field public static final java.lang.String RINGTONE = "ringtone";
+    field public static final java.lang.String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
     field public static final java.lang.String SCREEN_BRIGHTNESS = "screen_brightness";
     field public static final java.lang.String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
     field public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1; // 0x1
@@ -17654,7 +17733,8 @@
 
   public static class UserDictionary.Words implements android.provider.BaseColumns {
     ctor public UserDictionary.Words();
-    method public static void addWord(android.content.Context, java.lang.String, int, int);
+    method public static deprecated void addWord(android.content.Context, java.lang.String, int, int);
+    method public static void addWord(android.content.Context, java.lang.String, int, java.lang.String, java.util.Locale);
     field public static final java.lang.String APP_ID = "appid";
     field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.google.userword";
     field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.google.userword";
@@ -17662,8 +17742,9 @@
     field public static final java.lang.String DEFAULT_SORT_ORDER = "frequency DESC";
     field public static final java.lang.String FREQUENCY = "frequency";
     field public static final java.lang.String LOCALE = "locale";
-    field public static final int LOCALE_TYPE_ALL = 0; // 0x0
-    field public static final int LOCALE_TYPE_CURRENT = 1; // 0x1
+    field public static final deprecated int LOCALE_TYPE_ALL = 0; // 0x0
+    field public static final deprecated int LOCALE_TYPE_CURRENT = 1; // 0x1
+    field public static final java.lang.String SHORTCUT = "shortcut";
     field public static final java.lang.String WORD = "word";
     field public static final java.lang.String _ID = "_id";
   }
@@ -21382,6 +21463,7 @@
     field public static final int DENSITY_MEDIUM = 160; // 0xa0
     field public static final int DENSITY_TV = 213; // 0xd5
     field public static final int DENSITY_XHIGH = 320; // 0x140
+    field public static final int DENSITY_XXHIGH = 480; // 0x1e0
     field public float density;
     field public int densityDpi;
     field public int heightPixels;
@@ -23780,6 +23862,9 @@
     method public android.view.ViewPropertyAnimator translationXBy(float);
     method public android.view.ViewPropertyAnimator translationY(float);
     method public android.view.ViewPropertyAnimator translationYBy(float);
+    method public android.view.ViewPropertyAnimator withEndAction(java.lang.Runnable);
+    method public android.view.ViewPropertyAnimator withLayer();
+    method public android.view.ViewPropertyAnimator withStartAction(java.lang.Runnable);
     method public android.view.ViewPropertyAnimator x(float);
     method public android.view.ViewPropertyAnimator xBy(float);
     method public android.view.ViewPropertyAnimator y(float);
@@ -23812,8 +23897,9 @@
     method public final void dispatchOnGlobalLayout();
     method public final boolean dispatchOnPreDraw();
     method public boolean isAlive();
-    method public void removeGlobalOnLayoutListener(android.view.ViewTreeObserver.OnGlobalLayoutListener);
+    method public deprecated void removeGlobalOnLayoutListener(android.view.ViewTreeObserver.OnGlobalLayoutListener);
     method public void removeOnGlobalFocusChangeListener(android.view.ViewTreeObserver.OnGlobalFocusChangeListener);
+    method public void removeOnGlobalLayoutListener(android.view.ViewTreeObserver.OnGlobalLayoutListener);
     method public void removeOnPreDrawListener(android.view.ViewTreeObserver.OnPreDrawListener);
     method public void removeOnScrollChangedListener(android.view.ViewTreeObserver.OnScrollChangedListener);
     method public void removeOnTouchModeChangeListener(android.view.ViewTreeObserver.OnTouchModeChangeListener);
@@ -24616,6 +24702,7 @@
     field public static final int IME_ACTION_SEARCH = 3; // 0x3
     field public static final int IME_ACTION_SEND = 4; // 0x4
     field public static final int IME_ACTION_UNSPECIFIED = 0; // 0x0
+    field public static final int IME_FLAG_FORCE_ASCII = -2147483648; // 0x80000000
     field public static final int IME_FLAG_NAVIGATE_NEXT = 134217728; // 0x8000000
     field public static final int IME_FLAG_NAVIGATE_PREVIOUS = 67108864; // 0x4000000
     field public static final int IME_FLAG_NO_ACCESSORY_ACTION = 536870912; // 0x20000000
@@ -24888,9 +24975,11 @@
 
   public final class SpellCheckerSubtype implements android.os.Parcelable {
     ctor public SpellCheckerSubtype(int, java.lang.String, java.lang.String);
+    method public boolean containsExtraValueKey(java.lang.String);
     method public int describeContents();
     method public java.lang.CharSequence getDisplayName(android.content.Context, java.lang.String, android.content.pm.ApplicationInfo);
     method public java.lang.String getExtraValue();
+    method public java.lang.String getExtraValueOf(java.lang.String);
     method public java.lang.String getLocale();
     method public int getNameResId();
     method public void writeToParcel(android.os.Parcel, int);
@@ -26663,6 +26752,7 @@
     method public void setOnValueChangedListener(android.widget.NumberPicker.OnValueChangeListener);
     method public void setValue(int);
     method public void setWrapSelectorWheel(boolean);
+    field public static final int SELECTOR_WHEEL_ITEM_COUNT = 5; // 0x5
   }
 
   public static abstract interface NumberPicker.Formatter {
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java
index fddb429..3d36ebf 100644
--- a/cmds/am/src/com/android/commands/am/Am.java
+++ b/cmds/am/src/com/android/commands/am/Am.java
@@ -31,6 +31,7 @@
 import android.content.pm.IPackageManager;
 import android.content.pm.ResolveInfo;
 import android.net.Uri;
+import android.os.Binder;
 import android.os.Bundle;
 import android.os.ParcelFileDescriptor;
 import android.os.RemoteException;
@@ -135,6 +136,8 @@
             runToUri(false);
         } else if (op.equals("to-intent-uri")) {
             runToUri(true);
+        } else if (op.equals("switch-profile")) {
+            runSwitchUser();
         } else {
             throw new IllegalArgumentException("Unknown command: " + op);
         }
@@ -531,7 +534,8 @@
         Intent intent = makeIntent();
         IntentReceiver receiver = new IntentReceiver();
         System.out.println("Broadcasting: " + intent);
-        mAm.broadcastIntent(null, intent, null, receiver, 0, null, null, null, true, false);
+        mAm.broadcastIntent(null, intent, null, receiver, 0, null, null, null, true, false,
+                Binder.getOrigCallingUser());
         receiver.waitForFinish();
     }
 
@@ -722,6 +726,14 @@
         mAm.setDebugApp(null, false, true);
     }
 
+    private void runSwitchUser() throws Exception {
+        if (android.os.Process.myUid() != 0) {
+            throw new RuntimeException("switchuser can only be run as root");
+        }
+        String user = nextArgRequired();
+        mAm.switchUser(Integer.parseInt(user));
+    }
+
     class MyActivityController extends IActivityController.Stub {
         final String mGdbPort;
 
diff --git a/cmds/dumpstate/dumpstate.c b/cmds/dumpstate/dumpstate.c
index 83c881a..16dc517 100644
--- a/cmds/dumpstate/dumpstate.c
+++ b/cmds/dumpstate/dumpstate.c
@@ -122,7 +122,7 @@
     dump_file("NETWORK DEV INFO", "/proc/net/dev");
     dump_file("QTAGUID NETWORK INTERFACES INFO", "/proc/net/xt_qtaguid/iface_stat_all");
     dump_file("QTAGUID CTRL INFO", "/proc/net/xt_qtaguid/ctrl");
-    run_command("QTAGUID STATS INFO", 10, "su", "root", "cat", "/proc/net/xt_qtaguid/stats", NULL);
+    dump_file("QTAGUID STATS INFO", "/proc/net/xt_qtaguid/stats");
 
     dump_file("NETWORK ROUTES", "/proc/net/route");
     dump_file("NETWORK ROUTES IPV6", "/proc/net/ipv6_route");
@@ -334,7 +334,7 @@
         }
 
         /* switch to non-root user and group */
-        gid_t groups[] = { AID_LOG, AID_SDCARD_RW, AID_MOUNT, AID_INET };
+        gid_t groups[] = { AID_LOG, AID_SDCARD_RW, AID_MOUNT, AID_INET, AID_NET_BW_STATS };
         if (setgroups(sizeof(groups)/sizeof(groups[0]), groups) != 0) {
             ALOGE("Unable to setgroups, aborting: %s\n", strerror(errno));
             return -1;
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c
index dd92bbe..203d180 100644
--- a/cmds/installd/commands.c
+++ b/cmds/installd/commands.c
@@ -148,6 +148,48 @@
     return delete_dir_contents(pkgdir, 1, NULL);
 }
 
+int clone_persona_data(uid_t src_persona, uid_t target_persona, int copy)
+{
+    char src_data_dir[PKG_PATH_MAX];
+    char pkg_path[PKG_PATH_MAX];
+    DIR *d;
+    struct dirent *de;
+    struct stat s;
+    uid_t uid;
+
+    if (create_persona_path(src_data_dir, src_persona)) {
+        return -1;
+    }
+
+    d = opendir(src_data_dir);
+    if (d != NULL) {
+        while ((de = readdir(d))) {
+            const char *name = de->d_name;
+
+            if (de->d_type == DT_DIR) {
+                int subfd;
+                    /* always skip "." and ".." */
+                if (name[0] == '.') {
+                    if (name[1] == 0) continue;
+                    if ((name[1] == '.') && (name[2] == 0)) continue;
+                }
+                /* Create the full path to the package's data dir */
+                create_pkg_path(pkg_path, name, PKG_DIR_POSTFIX, src_persona);
+                /* Get the file stat */
+                if (stat(pkg_path, &s) < 0) continue;
+                /* Get the uid of the package */
+                ALOGI("Adding datadir for uid = %d\n", s.st_uid);
+                uid = (uid_t) s.st_uid % PER_USER_RANGE;
+                /* Create the directory for the target */
+                make_user_data(name, uid + target_persona * PER_USER_RANGE,
+                               target_persona);
+            }
+        }
+        closedir(d);
+    }
+    return 0;
+}
+
 int delete_cache(const char *pkgname)
 {
     char cachedir[PKG_PATH_MAX];
diff --git a/cmds/installd/installd.c b/cmds/installd/installd.c
index 569b491..7f94a96 100644
--- a/cmds/installd/installd.c
+++ b/cmds/installd/installd.c
@@ -107,6 +107,11 @@
     return delete_persona(atoi(arg[0])); /* userid */
 }
 
+static int do_clone_user_data(char **arg, char reply[REPLY_MAX])
+{
+    return clone_persona_data(atoi(arg[0]), atoi(arg[1]), atoi(arg[2]));
+}
+
 static int do_movefiles(char **arg, char reply[REPLY_MAX])
 {
     return movefiles();
@@ -146,6 +151,7 @@
     { "unlinklib",            1, do_unlinklib },
     { "mkuserdata",           3, do_mk_user_data },
     { "rmuser",               1, do_rm_user },
+    { "cloneuserdata",        3, do_clone_user_data },
 };
 
 static int readx(int s, void *_buf, int count)
diff --git a/cmds/installd/installd.h b/cmds/installd/installd.h
index 173cabf..78342bb 100644
--- a/cmds/installd/installd.h
+++ b/cmds/installd/installd.h
@@ -72,6 +72,9 @@
 #define PKG_NAME_MAX  128   /* largest allowed package name */
 #define PKG_PATH_MAX  256   /* max size of any path we use */
 
+#define PER_USER_RANGE ((uid_t)100000)   /* range of uids per user
+                                            uid = persona * PER_USER_RANGE + appid */
+
 /* data structures */
 
 typedef struct {
@@ -143,6 +146,7 @@
 int delete_user_data(const char *pkgname, uid_t persona);
 int make_user_data(const char *pkgname, uid_t uid, uid_t persona);
 int delete_persona(uid_t persona);
+int clone_persona_data(uid_t src_persona, uid_t target_persona, int copy);
 int delete_cache(const char *pkgname);
 int move_dex(const char *src, const char *dst);
 int rm_dex(const char *path);
diff --git a/cmds/pm/src/com/android/commands/pm/Pm.java b/cmds/pm/src/com/android/commands/pm/Pm.java
index c0ba543..f457842 100644
--- a/cmds/pm/src/com/android/commands/pm/Pm.java
+++ b/cmds/pm/src/com/android/commands/pm/Pm.java
@@ -16,8 +16,6 @@
 
 package com.android.commands.pm;
 
-import com.android.internal.content.PackageHelper;
-
 import android.app.ActivityManagerNative;
 import android.content.ComponentName;
 import android.content.pm.ApplicationInfo;
@@ -33,14 +31,17 @@
 import android.content.pm.ParceledListSlice;
 import android.content.pm.PermissionGroupInfo;
 import android.content.pm.PermissionInfo;
+import android.content.pm.UserInfo;
 import android.content.res.AssetManager;
 import android.content.res.Resources;
 import android.net.Uri;
-import android.os.Parcel;
+import android.os.Binder;
 import android.os.Process;
 import android.os.RemoteException;
 import android.os.ServiceManager;
 
+import com.android.internal.content.PackageHelper;
+
 import java.io.File;
 import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
@@ -135,13 +136,18 @@
             return;
         }
 
-        if ("createUser".equals(op)) {
-            runCreateUser();
+        if ("create-profile".equals(op)) {
+            runCreateProfile();
             return;
         }
 
-        if ("removeUser".equals(op)) {
-            runRemoveUser();
+        if ("remove-profile".equals(op)) {
+            runRemoveProfile();
+            return;
+        }
+
+        if ("list-profiles".equals(op)) {
+            runListProfiles();
             return;
         }
 
@@ -829,10 +835,10 @@
         }
     }
 
-    public void runCreateUser() {
+    public void runCreateProfile() {
         // Need to be run as root
         if (Process.myUid() != ROOT_UID) {
-            System.err.println("Error: createUser must be run as root");
+            System.err.println("Error: create-profile must be run as root");
             return;
         }
         String name;
@@ -845,7 +851,7 @@
         name = arg;
         try {
             if (mPm.createUser(name, 0) == null) {
-                System.err.println("Error: couldn't create user.");
+                System.err.println("Error: couldn't create profile.");
                 showUsage();
             }
         } catch (RemoteException e) {
@@ -855,10 +861,10 @@
 
     }
 
-    public void runRemoveUser() {
+    public void runRemoveProfile() {
         // Need to be run as root
         if (Process.myUid() != ROOT_UID) {
-            System.err.println("Error: removeUser must be run as root");
+            System.err.println("Error: remove-profile must be run as root");
             return;
         }
         int userId;
@@ -877,7 +883,7 @@
         }
         try {
             if (!mPm.removeUser(userId)) {
-                System.err.println("Error: couldn't remove user.");
+                System.err.println("Error: couldn't remove profile.");
                 showUsage();
             }
         } catch (RemoteException e) {
@@ -886,6 +892,27 @@
         }
     }
 
+    public void runListProfiles() {
+        // Need to be run as root
+        if (Process.myUid() != ROOT_UID) {
+            System.err.println("Error: list-profiles must be run as root");
+            return;
+        }
+        try {
+            List<UserInfo> users = mPm.getUsers();
+            if (users == null) {
+                System.err.println("Error: couldn't get users");
+            } else {
+                System.out.println("Users:");
+                for (int i = 0; i < users.size(); i++) {
+                    System.out.println("\t" + users.get(i).toString());
+                }
+            }
+        } catch (RemoteException e) {
+            System.err.println(e.toString());
+            System.err.println(PM_NOT_RUNNING_ERR);
+        }
+    }
     class PackageDeleteObserver extends IPackageDeleteObserver.Stub {
         boolean finished;
         boolean result;
@@ -966,7 +993,8 @@
 
         ClearDataObserver obs = new ClearDataObserver();
         try {
-            if (!ActivityManagerNative.getDefault().clearApplicationUserData(pkg, obs)) {
+            if (!ActivityManagerNative.getDefault().clearApplicationUserData(pkg, obs,
+                    Binder.getOrigCallingUser())) {
                 System.err.println("Failed");
             }
 
@@ -1132,8 +1160,8 @@
         System.err.println("       pm disable-user PACKAGE_OR_COMPONENT");
         System.err.println("       pm set-install-location [0/auto] [1/internal] [2/external]");
         System.err.println("       pm get-install-location");
-        System.err.println("       pm createUser USER_NAME");
-        System.err.println("       pm removeUser USER_ID");
+        System.err.println("       pm create-profile USER_NAME");
+        System.err.println("       pm remove-profile USER_ID");
         System.err.println("");
         System.err.println("pm list packages: prints all packages, optionally only");
         System.err.println("  those whose package name contains the text in FILTER.  Options:");
diff --git a/cmds/requestsync/Android.mk b/cmds/requestsync/Android.mk
new file mode 100644
index 0000000..fe2ffd8
--- /dev/null
+++ b/cmds/requestsync/Android.mk
@@ -0,0 +1,16 @@
+# Copyright 2012 The Android Open Source Project
+#
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-subdir-java-files)
+LOCAL_MODULE := requestsync
+LOCAL_MODULE_TAGS := optional
+include $(BUILD_JAVA_LIBRARY)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := requestsync
+LOCAL_SRC_FILES := requestsync
+LOCAL_MODULE_CLASS := EXECUTABLES
+LOCAL_MODULE_TAGS := optional
+include $(BUILD_PREBUILT)
diff --git a/cmds/requestsync/MODULE_LICENSE_APACHE2 b/cmds/requestsync/MODULE_LICENSE_APACHE2
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/cmds/requestsync/MODULE_LICENSE_APACHE2
diff --git a/cmds/requestsync/NOTICE b/cmds/requestsync/NOTICE
new file mode 100644
index 0000000..c5b1efa
--- /dev/null
+++ b/cmds/requestsync/NOTICE
@@ -0,0 +1,190 @@
+
+   Copyright (c) 2005-2008, 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.
+
+   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.
+
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
diff --git a/cmds/requestsync/requestsync b/cmds/requestsync/requestsync
new file mode 100755
index 0000000..9315675
--- /dev/null
+++ b/cmds/requestsync/requestsync
@@ -0,0 +1,6 @@
+# Script to start "requestsync" on the device
+#
+base=/system
+export CLASSPATH=$base/framework/requestsync.jar
+exec app_process $base/bin com.android.commands.requestsync.RequestSync "$@"
+
diff --git a/cmds/requestsync/src/com/android/commands/requestsync/RequestSync.java b/cmds/requestsync/src/com/android/commands/requestsync/RequestSync.java
new file mode 100644
index 0000000..808618f
--- /dev/null
+++ b/cmds/requestsync/src/com/android/commands/requestsync/RequestSync.java
@@ -0,0 +1,237 @@
+/*
+**
+** Copyright 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.commands.requestsync;
+
+import android.accounts.Account;
+import android.content.ContentResolver;
+import android.os.Bundle;
+
+import java.net.URISyntaxException;
+
+public class RequestSync {
+    // agr parsing fields
+    private String[] mArgs;
+    private int mNextArg;
+    private String mCurArgData;
+
+    // account & authority
+    private String mAccountName = null;
+    private String mAccountType = null;
+    private String mAuthority = null;
+
+    // extras
+    private Bundle mExtras = new Bundle();
+
+    /**
+     * Command-line entry point.
+     *
+     * @param args The command-line arguments
+     */
+    public static void main(String[] args) {
+        try {
+            (new RequestSync()).run(args);
+        } catch (IllegalArgumentException e) {
+            showUsage();
+            System.err.println("Error: " + e);
+            e.printStackTrace();
+        } catch (Exception e) {
+            e.printStackTrace(System.err);
+            System.exit(1);
+        }
+    }
+
+    private void run(String[] args) throws Exception {
+        mArgs = args;
+        mNextArg = 0;
+
+        final boolean ok = parseArgs();
+        if (ok) {
+            final Account account = mAccountName != null && mAccountType != null
+                    ? new Account(mAccountName, mAccountType) : null;
+
+            System.out.printf("Requesting sync for: \n");
+            if (account != null) {
+                System.out.printf("  Account: %s (%s)\n", account.name, account.type);
+            } else {
+                System.out.printf("  Account: all\n");
+            }
+
+            System.out.printf("  Authority: %s\n", mAuthority != null ? mAuthority : "All");
+
+            if (mExtras.size() > 0) {
+                System.out.printf("  Extras:\n");
+                for (String key : mExtras.keySet()) {
+                    System.out.printf("    %s: %s\n", key, mExtras.get(key));
+                }
+            }
+
+            ContentResolver.requestSync(account, mAuthority, mExtras);
+        }
+    }
+
+    private boolean parseArgs() throws URISyntaxException {
+        String opt;
+        while ((opt=nextOption()) != null) {
+            if (opt.equals("-h") || opt.equals("--help")) {
+                showUsage();
+                return false;
+            } else if (opt.equals("-n") || opt.equals("--account-name")) {
+                mAccountName = nextArgRequired();
+            } else if (opt.equals("-t") || opt.equals("--account-type")) {
+                mAccountType = nextArgRequired();
+            } else if (opt.equals("-a") || opt.equals("--authority")) {
+                mAuthority = nextArgRequired();
+            } else if (opt.equals("--is") || opt.equals("--ignore-settings")) {
+                mExtras.putBoolean(ContentResolver.SYNC_EXTRAS_IGNORE_SETTINGS, true);
+            } else if (opt.equals("--ib") || opt.equals("--ignore-backoff")) {
+                mExtras.putBoolean(ContentResolver.SYNC_EXTRAS_IGNORE_BACKOFF, true);
+            } else if (opt.equals("--dd") || opt.equals("--discard-deletions")) {
+                mExtras.putBoolean(ContentResolver.SYNC_EXTRAS_DISCARD_LOCAL_DELETIONS, true);
+            } else if (opt.equals("--nr") || opt.equals("--no-retry")) {
+                mExtras.putBoolean(ContentResolver.SYNC_EXTRAS_DO_NOT_RETRY, true);
+            } else if (opt.equals("--ex") || opt.equals("--expedited")) {
+                mExtras.putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, true);
+            } else if (opt.equals("-i") || opt.equals("--initialize")) {
+                mExtras.putBoolean(ContentResolver.SYNC_EXTRAS_INITIALIZE, true);
+            } else if (opt.equals("-m") || opt.equals("--manual")) {
+                mExtras.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);
+            } else if (opt.equals("--od") || opt.equals("--override-deletions")) {
+                mExtras.putBoolean(ContentResolver.SYNC_EXTRAS_OVERRIDE_TOO_MANY_DELETIONS, true);
+            } else if (opt.equals("-u") || opt.equals("--upload-only")) {
+                mExtras.putBoolean(ContentResolver.SYNC_EXTRAS_UPLOAD, true);
+            } else if (opt.equals("-e") || opt.equals("--es") || opt.equals("--extra-string")) {
+                final String key = nextArgRequired();
+                final String value = nextArgRequired();
+                mExtras.putString(key, value);
+            } else if (opt.equals("--esn") || opt.equals("--extra-string-null")) {
+                final String key = nextArgRequired();
+                mExtras.putString(key, null);
+            } else if (opt.equals("--ei") || opt.equals("--extra-int")) {
+                final String key = nextArgRequired();
+                final String value = nextArgRequired();
+                mExtras.putInt(key, Integer.valueOf(value));
+            } else if (opt.equals("--el") || opt.equals("--extra-long")) {
+                final String key = nextArgRequired();
+                final String value = nextArgRequired();
+                mExtras.putLong(key, Long.valueOf(value));
+            } else if (opt.equals("--ef") || opt.equals("--extra-float")) {
+                final String key = nextArgRequired();
+                final String value = nextArgRequired();
+                mExtras.putFloat(key, Long.valueOf(value));
+            } else if (opt.equals("--ed") || opt.equals("--extra-double")) {
+                final String key = nextArgRequired();
+                final String value = nextArgRequired();
+                mExtras.putFloat(key, Long.valueOf(value));
+            } else if (opt.equals("--ez") || opt.equals("--extra-bool")) {
+                final String key = nextArgRequired();
+                final String value = nextArgRequired();
+                mExtras.putBoolean(key, Boolean.valueOf(value));
+            } else {
+                System.err.println("Error: Unknown option: " + opt);
+                showUsage();
+                return false;
+            }
+        }
+
+        if (mNextArg < mArgs.length) {
+            showUsage();
+            return false;
+        }
+        return true;
+    }
+
+    private String nextOption() {
+        if (mCurArgData != null) {
+            String prev = mArgs[mNextArg - 1];
+            throw new IllegalArgumentException("No argument expected after \"" + prev + "\"");
+        }
+        if (mNextArg >= mArgs.length) {
+            return null;
+        }
+        String arg = mArgs[mNextArg];
+        if (!arg.startsWith("-")) {
+            return null;
+        }
+        mNextArg++;
+        if (arg.equals("--")) {
+            return null;
+        }
+        if (arg.length() > 1 && arg.charAt(1) != '-') {
+            if (arg.length() > 2) {
+                mCurArgData = arg.substring(2);
+                return arg.substring(0, 2);
+            } else {
+                mCurArgData = null;
+                return arg;
+            }
+        }
+        mCurArgData = null;
+        return arg;
+    }
+
+    private String nextArg() {
+        if (mCurArgData != null) {
+            String arg = mCurArgData;
+            mCurArgData = null;
+            return arg;
+        } else if (mNextArg < mArgs.length) {
+            return mArgs[mNextArg++];
+        } else {
+            return null;
+        }
+    }
+
+    private String nextArgRequired() {
+        String arg = nextArg();
+        if (arg == null) {
+            String prev = mArgs[mNextArg - 1];
+            throw new IllegalArgumentException("Argument expected after \"" + prev + "\"");
+        }
+        return arg;
+    }
+
+    private static void showUsage() {
+        System.err.println(
+                "usage: requestsync [options]\n" +
+                "With no options, a sync will be requested for all account and all sync\n" +
+                "authorities with no extras. Options can be:\n" +
+                "    -h|--help: Display this message\n" +
+                "    -n|--account-name <ACCOUNT-NAME>\n" +
+                "    -t|--account-type <ACCOUNT-TYPE>\n" +
+                "    -a|--authority <AUTHORITY>\n" +
+                "  Add ContentResolver extras:\n" +
+                "    --is|--ignore-settings: Add SYNC_EXTRAS_IGNORE_SETTINGS\n" +
+                "    --ib|--ignore-backoff: Add SYNC_EXTRAS_IGNORE_BACKOFF\n" +
+                "    --dd|--discard-deletions: Add SYNC_EXTRAS_DISCARD_LOCAL_DELETIONS\n" +
+                "    --nr|--no-retry: Add SYNC_EXTRAS_DO_NOT_RETRY\n" +
+                "    --ex|--expedited: Add SYNC_EXTRAS_EXPEDITED\n" +
+                "    --i|--initialize: Add SYNC_EXTRAS_INITIALIZE\n" +
+                "    --m|--manual: Add SYNC_EXTRAS_MANUAL\n" +
+                "    --od|--override-deletions: Add SYNC_EXTRAS_OVERRIDE_TOO_MANY_DELETIONS\n" +
+                "    --u|--upload-only: Add SYNC_EXTRAS_UPLOAD\n" +
+                "  Add custom extras:\n" +
+                "    -e|--es|--extra-string <KEY> <VALUE>\n" +
+                "    --esn|--extra-string-null <KEY>\n" +
+                "    --ei|--extra-int <KEY> <VALUE>\n" +
+                "    --el|--extra-long <KEY> <VALUE>\n" +
+                "    --ef|--extra-float <KEY> <VALUE>\n" +
+                "    --ed|--extra-double <KEY> <VALUE>\n" +
+                "    --ez|--extra-bool <KEY> <VALUE>\n"
+                );
+    }
+}
diff --git a/cmds/screencap/screencap.cpp b/cmds/screencap/screencap.cpp
index 7a599e9..bee5880 100644
--- a/cmds/screencap/screencap.cpp
+++ b/cmds/screencap/screencap.cpp
@@ -28,6 +28,7 @@
 
 #include <SkImageEncoder.h>
 #include <SkBitmap.h>
+#include <SkData.h>
 #include <SkStream.h>
 
 using namespace android;
@@ -168,7 +169,9 @@
             SkDynamicMemoryWStream stream;
             SkImageEncoder::EncodeStream(&stream, b,
                     SkImageEncoder::kPNG_Type, SkImageEncoder::kDefaultQuality);
-            write(fd, stream.getStream(), stream.getOffset());
+            SkData* streamData = stream.copyToData();
+            write(fd, streamData->data(), streamData->size());
+            streamData->unref();
         } else {
             write(fd, &w, 4);
             write(fd, &h, 4);
diff --git a/cmds/servicemanager/Android.mk b/cmds/servicemanager/Android.mk
index ea80c7d..8840867 100644
--- a/cmds/servicemanager/Android.mk
+++ b/cmds/servicemanager/Android.mk
@@ -9,7 +9,4 @@
 LOCAL_SHARED_LIBRARIES := liblog
 LOCAL_SRC_FILES := service_manager.c binder.c
 LOCAL_MODULE := servicemanager
-ifeq ($(BOARD_USE_LVMX),true)
-    LOCAL_CFLAGS += -DLVMX
-endif
 include $(BUILD_EXECUTABLE)
diff --git a/cmds/servicemanager/binder.c b/cmds/servicemanager/binder.c
index 918d4d4..1985756 100644
--- a/cmds/servicemanager/binder.c
+++ b/cmds/servicemanager/binder.c
@@ -412,7 +412,7 @@
         return;
     }
 
-    bio->data = bio->data0 = data + n;
+    bio->data = bio->data0 = (char *) data + n;
     bio->offs = bio->offs0 = data;
     bio->data_avail = maxdata - n;
     bio->offs_avail = maxoffs;
diff --git a/cmds/servicemanager/service_manager.c b/cmds/servicemanager/service_manager.c
index 42d8977..4ed2489 100644
--- a/cmds/servicemanager/service_manager.c
+++ b/cmds/servicemanager/service_manager.c
@@ -27,9 +27,6 @@
     unsigned uid;
     const char *name;
 } allowed[] = {
-#ifdef LVMX
-    { AID_MEDIA, "com.lifevibes.mx.ipc" },
-#endif
     { AID_MEDIA, "media.audio_flinger" },
     { AID_MEDIA, "media.player" },
     { AID_MEDIA, "media.camera" },
diff --git a/cmds/stagefright/record.cpp b/cmds/stagefright/record.cpp
index 613435d..7703058 100644
--- a/cmds/stagefright/record.cpp
+++ b/cmds/stagefright/record.cpp
@@ -38,7 +38,7 @@
 static const int32_t kAudioBitRate = 12200;
 static const int64_t kDurationUs = 10000000LL;  // 10 seconds
 
-#if 1
+#if 0
 class DummySource : public MediaSource {
 
 public:
@@ -318,7 +318,7 @@
 
     sp<MetaData> encMeta = new MetaData;
     encMeta->setCString(kKeyMIMEType,
-            1 ? MEDIA_MIMETYPE_AUDIO_AMR_WB : MEDIA_MIMETYPE_AUDIO_AAC);
+            0 ? MEDIA_MIMETYPE_AUDIO_AMR_WB : MEDIA_MIMETYPE_AUDIO_AAC);
     encMeta->setInt32(kKeySampleRate, kSampleRate);
     encMeta->setInt32(kKeyChannelCount, kNumChannels);
     encMeta->setInt32(kKeyMaxInputSize, 8192);
diff --git a/core/java/android/accessibilityservice/AccessibilityService.java b/core/java/android/accessibilityservice/AccessibilityService.java
index 211be52..a463a62 100644
--- a/core/java/android/accessibilityservice/AccessibilityService.java
+++ b/core/java/android/accessibilityservice/AccessibilityService.java
@@ -17,8 +17,10 @@
 package android.accessibilityservice;
 
 import android.app.Service;
+import android.content.Context;
 import android.content.Intent;
 import android.os.IBinder;
+import android.os.Looper;
 import android.os.Message;
 import android.os.RemoteException;
 import android.util.Log;
@@ -218,10 +220,17 @@
 
     private static final String LOG_TAG = "AccessibilityService";
 
-    private AccessibilityServiceInfo mInfo;
+    interface Callbacks {
+        public void onAccessibilityEvent(AccessibilityEvent event);
+        public void onInterrupt();
+        public void onServiceConnected();
+        public void onSetConnectionId(int connectionId);
+    }
 
     private int mConnectionId;
 
+    private AccessibilityServiceInfo mInfo;
+
     /**
      * Callback for {@link android.view.accessibility.AccessibilityEvent}s.
      *
@@ -282,27 +291,49 @@
      */
     @Override
     public final IBinder onBind(Intent intent) {
-        return new IEventListenerWrapper(this);
+        return new IEventListenerWrapper(this, getMainLooper(), new Callbacks() {
+            @Override
+            public void onServiceConnected() {
+                AccessibilityService.this.onServiceConnected();
+            }
+
+            @Override
+            public void onInterrupt() {
+                AccessibilityService.this.onInterrupt();
+            }
+
+            @Override
+            public void onAccessibilityEvent(AccessibilityEvent event) {
+                AccessibilityService.this.onAccessibilityEvent(event);
+            }
+
+            @Override
+            public void onSetConnectionId( int connectionId) {
+                mConnectionId = connectionId;
+            }
+        });
     }
 
     /**
      * Implements the internal {@link IEventListener} interface to convert
      * incoming calls to it back to calls on an {@link AccessibilityService}.
      */
-    class IEventListenerWrapper extends IEventListener.Stub
+    static class IEventListenerWrapper extends IEventListener.Stub
             implements HandlerCaller.Callback {
 
+        static final int NO_ID = -1;
+
         private static final int DO_SET_SET_CONNECTION = 10;
         private static final int DO_ON_INTERRUPT = 20;
         private static final int DO_ON_ACCESSIBILITY_EVENT = 30;
 
         private final HandlerCaller mCaller;
 
-        private final AccessibilityService mTarget;
+        private final Callbacks mCallback;
 
-        public IEventListenerWrapper(AccessibilityService context) {
-            mTarget = context;
-            mCaller = new HandlerCaller(context, this);
+        public IEventListenerWrapper(Context context, Looper looper, Callbacks callback) {
+            mCallback = callback;
+            mCaller = new HandlerCaller(context, looper, this);
         }
 
         public void setConnection(IAccessibilityServiceConnection connection, int connectionId) {
@@ -326,12 +357,13 @@
                 case DO_ON_ACCESSIBILITY_EVENT :
                     AccessibilityEvent event = (AccessibilityEvent) message.obj;
                     if (event != null) {
-                        mTarget.onAccessibilityEvent(event);
+                        AccessibilityInteractionClient.getInstance().onAccessibilityEvent(event);
+                        mCallback.onAccessibilityEvent(event);
                         event.recycle();
                     }
                     return;
                 case DO_ON_INTERRUPT :
-                    mTarget.onInterrupt();
+                    mCallback.onInterrupt();
                     return;
                 case DO_SET_SET_CONNECTION :
                     final int connectionId = message.arg1;
@@ -340,12 +372,11 @@
                     if (connection != null) {
                         AccessibilityInteractionClient.getInstance().addConnection(connectionId,
                                 connection);
-                        mConnectionId = connectionId;
-                        mTarget.onServiceConnected();
+                        mCallback.onSetConnectionId(connectionId);
+                        mCallback.onServiceConnected();
                     } else {
                         AccessibilityInteractionClient.getInstance().removeConnection(connectionId);
-                        mConnectionId = AccessibilityInteractionClient.NO_ID;
-                        // TODO: Do we need a onServiceDisconnected callback?
+                        mCallback.onSetConnectionId(AccessibilityInteractionClient.NO_ID);
                     }
                     return;
                 default :
diff --git a/core/java/android/accessibilityservice/AccessibilityServiceInfo.java b/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
index e5a5e98..eae0a4c 100644
--- a/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
+++ b/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
@@ -28,6 +28,7 @@
 import android.os.Parcel;
 import android.os.Parcelable;
 import android.util.AttributeSet;
+import android.util.TypedValue;
 import android.util.Xml;
 import android.view.accessibility.AccessibilityEvent;
 
@@ -182,9 +183,14 @@
     private boolean mCanRetrieveWindowContent;
 
     /**
-     * Description of the accessibility service.
+     * Resource id of the description of the accessibility service.
      */
-    private String mDescription;
+    private int mDescriptionResId;
+
+    /**
+     * Non localized description of the accessibility service.
+     */
+    private String mNonLocalizedDescription;
 
     /**
      * Creates a new instance.
@@ -256,8 +262,15 @@
             mCanRetrieveWindowContent = asAttributes.getBoolean(
                     com.android.internal.R.styleable.AccessibilityService_canRetrieveWindowContent,
                     false);
-            mDescription = asAttributes.getString(
+            TypedValue peekedValue = asAttributes.peekValue(
                     com.android.internal.R.styleable.AccessibilityService_description);
+            if (peekedValue != null) {
+                mDescriptionResId = peekedValue.resourceId;
+                CharSequence nonLocalizedDescription = peekedValue.coerceToString();
+                if (nonLocalizedDescription != null) {
+                    mNonLocalizedDescription = nonLocalizedDescription.toString().trim();
+                }
+            }
             asAttributes.recycle();
         } catch (NameNotFoundException e) {
             throw new XmlPullParserException( "Unable to create context for: "
@@ -331,15 +344,38 @@
     }
 
     /**
-     * Description of the accessibility service.
+     * Gets the non-localized description of the accessibility service.
      * <p>
      *    <strong>Statically set from
      *    {@link AccessibilityService#SERVICE_META_DATA meta-data}.</strong>
      * </p>
      * @return The description.
+     *
+     * @deprecated Use {@link #loadDescription(PackageManager)}.
      */
     public String getDescription() {
-        return mDescription;
+        return mNonLocalizedDescription;
+    }
+
+    /**
+     * The localized description of the accessibility service.
+     * <p>
+     *    <strong>Statically set from
+     *    {@link AccessibilityService#SERVICE_META_DATA meta-data}.</strong>
+     * </p>
+     * @return The localized description.
+     */
+    public String loadDescription(PackageManager packageManager) {
+        if (mDescriptionResId == 0) {
+            return mNonLocalizedDescription;
+        }
+        ServiceInfo serviceInfo = mResolveInfo.serviceInfo;
+        CharSequence description = packageManager.getText(serviceInfo.packageName,
+                mDescriptionResId, serviceInfo.applicationInfo);
+        if (description != null) {
+            return description.toString().trim();
+        }
+        return null;
     }
 
     /**
@@ -359,7 +395,8 @@
         parcel.writeParcelable(mResolveInfo, 0);
         parcel.writeString(mSettingsActivityName);
         parcel.writeInt(mCanRetrieveWindowContent ? 1 : 0);
-        parcel.writeString(mDescription);
+        parcel.writeInt(mDescriptionResId);
+        parcel.writeString(mNonLocalizedDescription);
     }
 
     private void initFromParcel(Parcel parcel) {
@@ -372,7 +409,8 @@
         mResolveInfo = parcel.readParcelable(null);
         mSettingsActivityName = parcel.readString();
         mCanRetrieveWindowContent = (parcel.readInt() == 1);
-        mDescription = parcel.readString();
+        mDescriptionResId = parcel.readInt();
+        mNonLocalizedDescription = parcel.readString();
     }
 
     @Override
diff --git a/core/java/android/accessibilityservice/IAccessibilityServiceConnection.aidl b/core/java/android/accessibilityservice/IAccessibilityServiceConnection.aidl
index e53b313..c9468eb 100644
--- a/core/java/android/accessibilityservice/IAccessibilityServiceConnection.aidl
+++ b/core/java/android/accessibilityservice/IAccessibilityServiceConnection.aidl
@@ -32,8 +32,13 @@
     /**
      * Finds an {@link AccessibilityNodeInfo} by accessibility id.
      *
-     * @param accessibilityWindowId A unique window id.
-     * @param accessibilityNodeId A unique view id or virtual descendant id.
+     * @param accessibilityWindowId A unique window id. Use
+     *     {@link com.android.server.accessibility.AccessibilityManagerService#ACTIVE_WINDOW_ID}
+     *     to query the currently active window.
+     * @param accessibilityNodeId A unique view id or virtual descendant id from
+     *     where to start the search. Use
+     *     {@link com.android.server.accessibility.AccessibilityManagerService#ROOT_NODE_ID}
+     *     to start from the root.
      * @param interactionId The id of the interaction for matching with the callback result.
      * @param callback Callback which to receive the result.
      * @param threadId The id of the calling thread.
@@ -46,57 +51,58 @@
     /**
      * Finds {@link AccessibilityNodeInfo}s by View text. The match is case
      * insensitive containment. The search is performed in the window whose
-     * id is specified and starts from the View whose accessibility id is
+     * id is specified and starts from the node whose accessibility id is
      * specified.
      *
-     * @param text The searched text.
-     * @param accessibilityWindowId A unique window id.
+     * @param accessibilityWindowId A unique window id. Use
+     *     {@link com.android.server.accessibility.AccessibilityManagerService#ACTIVE_WINDOW_ID}
+     *     to query the currently active window.
      * @param accessibilityNodeId A unique view id or virtual descendant id from
-     *        where to start the search. Use {@link android.view.View#NO_ID} to start from the root.
-     * @param interactionId The id of the interaction for matching with the callback result.
-     * @param callback Callback which to receive the result.
-     * @param threadId The id of the calling thread.
-     * @return The current window scale, where zero means a failure.
-     */
-    float findAccessibilityNodeInfosByText(String text, int accessibilityWindowId,
-        long accessibilityNodeId, int interractionId,
-        IAccessibilityInteractionConnectionCallback callback, long threadId);
-
-    /**
-     * Finds {@link AccessibilityNodeInfo}s by View text. The match is case
-     * insensitive containment. The search is performed in the currently
-     * active window and start from the root View in the window.
-     *
+     *     where to start the search. Use
+     *     {@link com.android.server.accessibility.AccessibilityManagerService#ROOT_NODE_ID}
+     *     to start from the root.
      * @param text The searched text.
-     * @param accessibilityId The id of the view from which to start searching.
-     *        Use {@link android.view.View#NO_ID} to start from the root.
      * @param interactionId The id of the interaction for matching with the callback result.
      * @param callback Callback which to receive the result.
      * @param threadId The id of the calling thread.
      * @return The current window scale, where zero means a failure.
      */
-    float findAccessibilityNodeInfosByTextInActiveWindow(String text,
-        int interactionId, IAccessibilityInteractionConnectionCallback callback,
+    float findAccessibilityNodeInfosByText(int accessibilityWindowId, long accessibilityNodeId,
+        String text, int interactionId, IAccessibilityInteractionConnectionCallback callback,
         long threadId);
 
     /**
-     * Finds an {@link AccessibilityNodeInfo} by View id. The search is performed
-     * in the currently active window and starts from the root View in the window.
+     * Finds an {@link AccessibilityNodeInfo} by View id. The search is performed in
+     * the window whose id is specified and starts from the node whose accessibility
+     * id is specified.
      *
+     * @param accessibilityWindowId A unique window id. Use
+     *     {@link com.android.server.accessibility.AccessibilityManagerService#ACTIVE_WINDOW_ID}
+     *     to query the currently active window.
+     * @param accessibilityNodeId A unique view id or virtual descendant id from
+     *     where to start the search. Use
+     *     {@link com.android.server.accessibility.AccessibilityManagerService#ROOT_NODE_ID}
+     *     to start from the root.
      * @param id The id of the node.
      * @param interactionId The id of the interaction for matching with the callback result.
      * @param callback Callback which to receive the result.
      * @param threadId The id of the calling thread.
      * @return The current window scale, where zero means a failure.
      */
-    float findAccessibilityNodeInfoByViewIdInActiveWindow(int viewId, int interactionId,
-        IAccessibilityInteractionConnectionCallback callback, long threadId);
+    float findAccessibilityNodeInfoByViewId(int accessibilityWindowId, long accessibilityNodeId,
+        int viewId, int interactionId, IAccessibilityInteractionConnectionCallback callback,
+        long threadId);
 
     /**
      * Performs an accessibility action on an {@link AccessibilityNodeInfo}.
      *
-     * @param accessibilityWindowId The id of the window.
-     * @param accessibilityNodeId A unique view id or virtual descendant id.
+     * @param accessibilityWindowId A unique window id. Use
+     *     {@link com.android.server.accessibility.AccessibilityManagerService#ACTIVE_WINDOW_ID}
+     *     to query the currently active window.
+     * @param accessibilityNodeId A unique view id or virtual descendant id from
+     *     where to start the search. Use
+     *     {@link com.android.server.accessibility.AccessibilityManagerService#ROOT_NODE_ID}
+     *     to start from the root.
      * @param action The action to perform.
      * @param interactionId The id of the interaction for matching with the callback result.
      * @param callback Callback which to receive the result.
diff --git a/core/java/android/accessibilityservice/UiTestAutomationBridge.java b/core/java/android/accessibilityservice/UiTestAutomationBridge.java
new file mode 100644
index 0000000..616b796
--- /dev/null
+++ b/core/java/android/accessibilityservice/UiTestAutomationBridge.java
@@ -0,0 +1,444 @@
+/*
+ * 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.accessibilityservice;
+
+import android.accessibilityservice.AccessibilityService.Callbacks;
+import android.accessibilityservice.AccessibilityService.IEventListenerWrapper;
+import android.content.Context;
+import android.os.HandlerThread;
+import android.os.Looper;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import android.os.SystemClock;
+import android.util.Log;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityInteractionClient;
+import android.view.accessibility.AccessibilityNodeInfo;
+import android.view.accessibility.IAccessibilityManager;
+
+import com.android.internal.util.Predicate;
+
+import java.util.List;
+import java.util.concurrent.TimeoutException;
+
+/**
+ * This class represents a bridge that can be used for UI test
+ * automation. It is responsible for connecting to the system,
+ * keeping track of the last accessibility event, and exposing
+ * window content querying APIs. This class is designed to be
+ * used from both an Android application and a Java program
+ * run from the shell.
+ *
+ * @hide
+ */
+public class UiTestAutomationBridge {
+
+    private static final String LOG_TAG = UiTestAutomationBridge.class.getSimpleName();
+
+    public static final int ACTIVE_WINDOW_ID = -1;
+
+    public static final long ROOT_NODE_ID = -1;
+
+    private static final int TIMEOUT_REGISTER_SERVICE = 5000;
+
+    private final Object mLock = new Object();
+
+    private volatile int mConnectionId = AccessibilityInteractionClient.NO_ID;
+
+    private IEventListenerWrapper mListener;
+
+    private AccessibilityEvent mLastEvent;
+
+    private AccessibilityEvent mLastWindowStateChangeEvent;
+
+    private volatile boolean mWaitingForEventDelivery;
+
+    private volatile boolean mUnprocessedEventAvailable;
+
+    /**
+     * Gets the last received {@link AccessibilityEvent}.
+     *
+     * @return The event.
+     */
+    public AccessibilityEvent getLastAccessibilityEvent() {
+        return mLastEvent; 
+    }
+
+    /**
+     * Callback for receiving an {@link AccessibilityEvent}.
+     *
+     * <strong>Note:</strong> This method is <strong>NOT</strong>
+     * executed on the application main thread. The client are
+     * responsible for proper synchronization.
+     *
+     * @param event The received event.
+     */
+    public void onAccessibilityEvent(AccessibilityEvent event) {
+        /* hook - do nothing */
+    }
+
+    /**
+     * Callback for requests to stop feedback.
+     *
+     * <strong>Note:</strong> This method is <strong>NOT</strong>
+     * executed on the application main thread. The client are
+     * responsible for proper synchronization.
+     */
+    public void onInterrupt() {
+        /* hook - do nothing */
+    }
+
+    /**
+     * Connects this service.
+     *
+     * @throws IllegalStateException If already connected.
+     */
+    public void connect() {
+        if (isConnected()) {
+            throw new IllegalStateException("Already connected.");
+        }
+
+        // Serialize binder calls to a handler on a dedicated thread
+        // different from the main since we expose APIs that block
+        // the main thread waiting for a result the deliver of which
+        // on the main thread will prevent that thread from waking up.
+        // The serialization is needed also to ensure that events are
+        // examined in delivery order. Otherwise, a fair locking
+        // is needed for making sure the binder calls are interleaved
+        // with check for the expected event and also to make sure the
+        // binder threads are allowed to proceed in the received order.
+        HandlerThread handlerThread = new HandlerThread("UiTestAutomationBridge");
+        handlerThread.start();
+        Looper looper = handlerThread.getLooper();
+
+        mListener = new IEventListenerWrapper(null, looper, new Callbacks() {
+            @Override
+            public void onServiceConnected() {
+                /* do nothing */
+            }
+
+            @Override
+            public void onInterrupt() {
+                UiTestAutomationBridge.this.onInterrupt();  
+            }
+
+            @Override
+            public void onAccessibilityEvent(AccessibilityEvent event) {
+                synchronized (mLock) {
+                    while (true) {
+                        mLastEvent = AccessibilityEvent.obtain(event);
+
+                        final int eventType = event.getEventType();
+                        if (eventType == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED
+                                || eventType == AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED) {
+                            if (mLastWindowStateChangeEvent != null) {
+                                mLastWindowStateChangeEvent.recycle();
+                            }
+                            mLastWindowStateChangeEvent = mLastEvent;
+                        }
+
+                        if (!mWaitingForEventDelivery) {
+                            break;
+                        }
+                        if (!mUnprocessedEventAvailable) {
+                            mUnprocessedEventAvailable = true;
+                            mLock.notifyAll();
+                            break;
+                        }
+                        try {
+                            mLock.wait();
+                        } catch (InterruptedException ie) {
+                            /* ignore */
+                        }
+                    }
+                }
+                UiTestAutomationBridge.this.onAccessibilityEvent(event);
+            }
+
+            @Override
+            public void onSetConnectionId(int connectionId) {
+                synchronized (mLock) {
+                    mConnectionId = connectionId;
+                    mLock.notifyAll();
+                }
+            }
+        });
+
+        final IAccessibilityManager manager = IAccessibilityManager.Stub.asInterface(
+                ServiceManager.getService(Context.ACCESSIBILITY_SERVICE));
+
+        final AccessibilityServiceInfo info = new AccessibilityServiceInfo();
+        info.eventTypes = AccessibilityEvent.TYPES_ALL_MASK;
+        info.feedbackType = AccessibilityServiceInfo.FEEDBACK_GENERIC;
+
+        try {
+            manager.registerUiTestAutomationService(mListener, info);
+        } catch (RemoteException re) {
+            throw new IllegalStateException("Cound not register UiAutomationService.", re);
+        }
+
+        synchronized (mLock) {
+            final long startTimeMillis = SystemClock.uptimeMillis();
+            while (true) {
+                if (isConnected()) {
+                    return;
+                }
+                final long elapsedTimeMillis = SystemClock.uptimeMillis() - startTimeMillis;
+                final long remainingTimeMillis = TIMEOUT_REGISTER_SERVICE - elapsedTimeMillis;
+                if (remainingTimeMillis <= 0) {
+                    throw new IllegalStateException("Cound not register UiAutomationService.");
+                }
+                try {
+                    mLock.wait(remainingTimeMillis);
+                } catch (InterruptedException ie) {
+                    /* ignore */
+                }
+            }
+        }
+    }
+
+    /**
+     * Disconnects this service.
+     *
+     * @throws IllegalStateException If already disconnected.
+     */
+    public void disconnect() {
+        if (!isConnected()) {
+            throw new IllegalStateException("Already disconnected.");
+        }
+
+        IAccessibilityManager manager = IAccessibilityManager.Stub.asInterface(
+              ServiceManager.getService(Context.ACCESSIBILITY_SERVICE));
+
+        try {
+            manager.unregisterUiTestAutomationService(mListener);
+        } catch (RemoteException re) {
+            Log.e(LOG_TAG, "Error while unregistering UiTestAutomationService", re);
+        }
+    }
+
+    /**
+     * Gets whether this service is connected.
+     *
+     * @return True if connected.
+     */
+    public boolean isConnected() {
+        return (mConnectionId != AccessibilityInteractionClient.NO_ID);
+    }
+
+    /**
+     * Executes a command and waits for a specific accessibility event type up
+     * to a given timeout.
+     *
+     * @param command The command to execute before starting to wait for the event.
+     * @param predicate Predicate for recognizing the awaited event.
+     * @param timeoutMillis The max wait time in milliseconds.
+     */
+    public AccessibilityEvent executeCommandAndWaitForAccessibilityEvent(Runnable command,
+            Predicate<AccessibilityEvent> predicate, long timeoutMillis)
+            throws TimeoutException, Exception {
+        synchronized (mLock) {
+            // Prepare to wait for an event.
+            mWaitingForEventDelivery = true;
+            mUnprocessedEventAvailable = false;
+            if (mLastEvent != null) {
+                mLastEvent.recycle();
+                mLastEvent = null;
+            }
+            // Execute the command.
+            command.run();
+            // Wait for the event.
+            final long startTimeMillis = SystemClock.uptimeMillis();
+            while (true) {
+                // If the expected event is received, that's it.
+                if ((mUnprocessedEventAvailable && predicate.apply(mLastEvent))) {
+                    mWaitingForEventDelivery = false;
+                    mUnprocessedEventAvailable = false;
+                    mLock.notifyAll();
+                    return mLastEvent;
+                }
+                // Ask for another event.
+                mWaitingForEventDelivery = true;
+                mUnprocessedEventAvailable = false;
+                mLock.notifyAll();
+                // Check if timed out and if not wait.
+                final long elapsedTimeMillis = SystemClock.uptimeMillis() - startTimeMillis;
+                final long remainingTimeMillis = timeoutMillis - elapsedTimeMillis;
+                if (remainingTimeMillis <= 0) {
+                    mWaitingForEventDelivery = false;
+                    mUnprocessedEventAvailable = false;
+                    mLock.notifyAll();
+                    throw new TimeoutException("Expacted event not received within: "
+                            + timeoutMillis + " ms.");
+                }
+                try {
+                    mLock.wait(remainingTimeMillis);
+                } catch (InterruptedException ie) {
+                    /* ignore */
+                }
+            }
+        }
+    }
+
+    /**
+     * Finds an {@link AccessibilityNodeInfo} by accessibility id in the active
+     * window. The search is performed from the root node.
+     *
+     * @param accessibilityNodeId A unique view id or virtual descendant id for
+     *     which to search.
+     * @return The current window scale, where zero means a failure.
+     */
+    public AccessibilityNodeInfo findAccessibilityNodeInfoByAccessibilityIdInActiveWindow(
+            long accessibilityNodeId) {
+        return findAccessibilityNodeInfoByAccessibilityId(ACTIVE_WINDOW_ID, accessibilityNodeId);
+    }
+
+    /**
+     * Finds an {@link AccessibilityNodeInfo} by accessibility id.
+     *
+     * @param accessibilityWindowId A unique window id. Use {@link #ACTIVE_WINDOW_ID}
+     *     to query the currently active window.
+     * @param accessibilityNodeId A unique view id or virtual descendant id for
+     *     which to search.
+     * @return The current window scale, where zero means a failure.
+     */
+    public AccessibilityNodeInfo findAccessibilityNodeInfoByAccessibilityId(
+            int accessibilityWindowId, long accessibilityNodeId) {
+        // Cache the id to avoid locking
+        final int connectionId = mConnectionId;
+        ensureValidConnection(connectionId);
+        return AccessibilityInteractionClient.getInstance()
+                .findAccessibilityNodeInfoByAccessibilityId(mConnectionId,
+                        accessibilityWindowId, accessibilityNodeId);
+    }
+
+    /**
+     * Finds an {@link AccessibilityNodeInfo} by View id in the active
+     * window. The search is performed from the root node.
+     *
+     * @return The current window scale, where zero means a failure.
+     */
+    public AccessibilityNodeInfo findAccessibilityNodeInfoByViewIdInActiveWindow(int viewId) {
+        return findAccessibilityNodeInfoByViewId(ACTIVE_WINDOW_ID, ROOT_NODE_ID, viewId);
+    }
+
+    /**
+     * Finds an {@link AccessibilityNodeInfo} by View id. The search is performed in
+     * the window whose id is specified and starts from the node whose accessibility
+     * id is specified.
+     *
+     * @param accessibilityWindowId A unique window id. Use {@link #ACTIVE_WINDOW_ID}
+     *     to query the currently active window.
+     * @param accessibilityNodeId A unique view id or virtual descendant id from
+     *     where to start the search. Use {@link #ROOT_NODE_ID} to start from the root.
+     * @return The current window scale, where zero means a failure.
+     */
+    public AccessibilityNodeInfo findAccessibilityNodeInfoByViewId(int accessibilityWindowId,
+            long accessibilityNodeId, int viewId) {
+        // Cache the id to avoid locking
+        final int connectionId = mConnectionId;
+        ensureValidConnection(connectionId);
+        return AccessibilityInteractionClient.getInstance()
+                .findAccessibilityNodeInfoByViewId(connectionId, accessibilityWindowId,
+                        accessibilityNodeId, viewId);
+    }
+
+    /**
+     * Finds {@link AccessibilityNodeInfo}s by View text in the active
+     * window. The search is performed from the root node.
+     *
+     * @param text The searched text.
+     * @return The current window scale, where zero means a failure.
+     */
+    public List<AccessibilityNodeInfo> findAccessibilityNodeInfosByTextInActiveWindow(String text) {
+        return findAccessibilityNodeInfosByText(ACTIVE_WINDOW_ID, ROOT_NODE_ID, text);
+    }
+
+    /**
+     * Finds {@link AccessibilityNodeInfo}s by View text. The match is case
+     * insensitive containment. The search is performed in the window whose
+     * id is specified and starts from the node whose accessibility id is
+     * specified.
+     *
+     * @param accessibilityWindowId A unique window id. Use {@link #ACTIVE_WINDOW_ID}
+     *     to query the currently active window.
+     * @param accessibilityNodeId A unique view id or virtual descendant id from
+     *     where to start the search. Use {@link #ROOT_NODE_ID} to start from the root.
+     * @param text The searched text.
+     * @return The current window scale, where zero means a failure.
+     */
+    public List<AccessibilityNodeInfo> findAccessibilityNodeInfosByText(int accessibilityWindowId,
+            long accessibilityNodeId, String text) {
+        // Cache the id to avoid locking
+        final int connectionId = mConnectionId;
+        ensureValidConnection(connectionId);
+        return AccessibilityInteractionClient.getInstance()
+                .findAccessibilityNodeInfosByText(connectionId, accessibilityWindowId,
+                        accessibilityNodeId, text);
+    }
+
+    /**
+     * Performs an accessibility action on an {@link AccessibilityNodeInfo}
+     * in the active window.
+     *
+     * @param accessibilityNodeId A unique node id (accessibility and virtual descendant id).
+     * @param action The action to perform.
+     * @return Whether the action was performed.
+     */
+    public boolean performAccessibilityActionInActiveWindow(long accessibilityNodeId, int action) {
+        return performAccessibilityAction(ACTIVE_WINDOW_ID, accessibilityNodeId, action);
+    }
+
+    /**
+     * Performs an accessibility action on an {@link AccessibilityNodeInfo}.
+     *
+     * @param accessibilityWindowId A unique window id. Use {@link #ACTIVE_WINDOW_ID}
+     *     to query the currently active window.
+     * @param accessibilityNodeId A unique node id (accessibility and virtual descendant id).
+     * @param action The action to perform.
+     * @return Whether the action was performed.
+     */
+    public boolean performAccessibilityAction(int accessibilityWindowId, long accessibilityNodeId,
+            int action) {
+        // Cache the id to avoid locking
+        final int connectionId = mConnectionId;
+        ensureValidConnection(connectionId);
+        return AccessibilityInteractionClient.getInstance().performAccessibilityAction(connectionId,
+                accessibilityWindowId, accessibilityNodeId, action);
+    }
+
+    /**
+     * Gets the root {@link AccessibilityNodeInfo} in the active window.
+     *
+     * @return The root info.
+     */
+    public AccessibilityNodeInfo getRootAccessibilityNodeInfoInActiveWindow() {
+        synchronized (mLock) {
+            if (mLastWindowStateChangeEvent != null) {
+                return mLastWindowStateChangeEvent.getSource();
+            }
+        }
+        return null;
+    }
+
+    private void ensureValidConnection(int connectionId) {
+        if (connectionId == AccessibilityInteractionClient.NO_ID) {
+            throw new IllegalStateException("UiAutomationService not connected."
+                    + " Did you call #register()?");
+        }
+    }
+}
diff --git a/core/java/android/accounts/AccountManagerService.java b/core/java/android/accounts/AccountManagerService.java
index 4f3405b..5fee4de 100644
--- a/core/java/android/accounts/AccountManagerService.java
+++ b/core/java/android/accounts/AccountManagerService.java
@@ -62,6 +62,7 @@
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
+import java.util.Map;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicReference;
 
@@ -275,7 +276,7 @@
                         accountNames.add(accountName);
                     }
                 }
-                for (HashMap.Entry<String, ArrayList<String>> cur
+                for (Map.Entry<String, ArrayList<String>> cur
                         : accountNamesByType.entrySet()) {
                     final String accountType = cur.getKey();
                     final ArrayList<String> accountNames = cur.getValue();
diff --git a/core/java/android/animation/LayoutTransition.java b/core/java/android/animation/LayoutTransition.java
index 894f428..634e4d8 100644
--- a/core/java/android/animation/LayoutTransition.java
+++ b/core/java/android/animation/LayoutTransition.java
@@ -960,17 +960,17 @@
         if (anim instanceof ObjectAnimator) {
             ((ObjectAnimator) anim).setCurrentPlayTime(0);
         }
-        if (mListeners != null) {
-            anim.addListener(new AnimatorListenerAdapter() {
-                @Override
-                public void onAnimationEnd(Animator anim) {
-                    currentAppearingAnimations.remove(child);
+        anim.addListener(new AnimatorListenerAdapter() {
+            @Override
+            public void onAnimationEnd(Animator anim) {
+                currentAppearingAnimations.remove(child);
+                if (mListeners != null) {
                     for (TransitionListener listener : mListeners) {
                         listener.endTransition(LayoutTransition.this, parent, child, APPEARING);
                     }
                 }
-            });
-        }
+            }
+        });
         currentAppearingAnimations.put(child, anim);
         anim.start();
     }
@@ -998,17 +998,19 @@
         anim.setStartDelay(mDisappearingDelay);
         anim.setDuration(mDisappearingDuration);
         anim.setTarget(child);
-        if (mListeners != null) {
-            anim.addListener(new AnimatorListenerAdapter() {
-                @Override
-                public void onAnimationEnd(Animator anim) {
-                    currentDisappearingAnimations.remove(child);
+        final float preAnimAlpha = child.getAlpha();
+        anim.addListener(new AnimatorListenerAdapter() {
+            @Override
+            public void onAnimationEnd(Animator anim) {
+                currentDisappearingAnimations.remove(child);
+                child.setAlpha(preAnimAlpha);
+                if (mListeners != null) {
                     for (TransitionListener listener : mListeners) {
                         listener.endTransition(LayoutTransition.this, parent, child, DISAPPEARING);
                     }
                 }
-            });
-        }
+            }
+        });
         if (anim instanceof ObjectAnimator) {
             ((ObjectAnimator) anim).setCurrentPlayTime(0);
         }
@@ -1024,18 +1026,25 @@
      *
      * @param parent The ViewGroup to which the View is being added.
      * @param child The View being added to the ViewGroup.
+     * @param changesLayout Whether the removal will cause changes in the layout of other views
+     * in the container. INVISIBLE views becoming VISIBLE will not cause changes and thus will not
+     * affect CHANGE_APPEARING or CHANGE_DISAPPEARING animations.
      */
-    public void addChild(ViewGroup parent, View child) {
+    private void addChild(ViewGroup parent, View child, boolean changesLayout) {
         // Want disappearing animations to finish up before proceeding
         cancel(DISAPPEARING);
-        // Also, cancel changing animations so that we start fresh ones from current locations
-        cancel(CHANGE_APPEARING);
+        if (changesLayout) {
+            // Also, cancel changing animations so that we start fresh ones from current locations
+            cancel(CHANGE_APPEARING);
+        }
         if (mListeners != null) {
             for (TransitionListener listener : mListeners) {
                 listener.startTransition(this, parent, child, APPEARING);
             }
         }
-        runChangeTransition(parent, child, APPEARING);
+        if (changesLayout) {
+            runChangeTransition(parent, child, APPEARING);
+        }
         runAppearingTransition(parent, child);
     }
 
@@ -1048,8 +1057,31 @@
      * @param parent The ViewGroup to which the View is being added.
      * @param child The View being added to the ViewGroup.
      */
+    public void addChild(ViewGroup parent, View child) {
+        addChild(parent, child, true);
+    }
+
+    /**
+     * @deprecated Use {@link #showChild(android.view.ViewGroup, android.view.View, int)}.
+     */
+    @Deprecated
     public void showChild(ViewGroup parent, View child) {
-        addChild(parent, child);
+        addChild(parent, child, true);
+    }
+
+    /**
+     * This method is called by ViewGroup when a child view is about to be made visible in the
+     * container. This callback starts the process of a transition; we grab the starting
+     * values, listen for changes to all of the children of the container, and start appropriate
+     * animations.
+     *
+     * @param parent The ViewGroup in which the View is being made visible.
+     * @param child The View being made visible.
+     * @param oldVisibility The previous visibility value of the child View, either
+     * {@link View#GONE} or {@link View#INVISIBLE}.
+     */
+    public void showChild(ViewGroup parent, View child, int oldVisibility) {
+        addChild(parent, child, oldVisibility == View.GONE);
     }
 
     /**
@@ -1060,18 +1092,25 @@
      *
      * @param parent The ViewGroup from which the View is being removed.
      * @param child The View being removed from the ViewGroup.
+     * @param changesLayout Whether the removal will cause changes in the layout of other views
+     * in the container. Views becoming INVISIBLE will not cause changes and thus will not
+     * affect CHANGE_APPEARING or CHANGE_DISAPPEARING animations.
      */
-    public void removeChild(ViewGroup parent, View child) {
+    private void removeChild(ViewGroup parent, View child, boolean changesLayout) {
         // Want appearing animations to finish up before proceeding
         cancel(APPEARING);
-        // Also, cancel changing animations so that we start fresh ones from current locations
-        cancel(CHANGE_DISAPPEARING);
+        if (changesLayout) {
+            // Also, cancel changing animations so that we start fresh ones from current locations
+            cancel(CHANGE_DISAPPEARING);
+        }
         if (mListeners != null) {
             for (TransitionListener listener : mListeners) {
                 listener.startTransition(this, parent, child, DISAPPEARING);
             }
         }
-        runChangeTransition(parent, child, DISAPPEARING);
+        if (changesLayout) {
+            runChangeTransition(parent, child, DISAPPEARING);
+        }
         runDisappearingTransition(parent, child);
     }
 
@@ -1084,8 +1123,31 @@
      * @param parent The ViewGroup from which the View is being removed.
      * @param child The View being removed from the ViewGroup.
      */
+    public void removeChild(ViewGroup parent, View child) {
+        removeChild(parent, child, true);
+    }
+
+    /**
+     * @deprecated Use {@link #hideChild(android.view.ViewGroup, android.view.View, int)}.
+     */
+    @Deprecated
     public void hideChild(ViewGroup parent, View child) {
-        removeChild(parent, child);
+        removeChild(parent, child, true);
+    }
+
+    /**
+     * This method is called by ViewGroup when a child view is about to be hidden in
+     * container. This callback starts the process of a transition; we grab the starting
+     * values, listen for changes to all of the children of the container, and start appropriate
+     * animations.
+     *
+     * @param parent The parent ViewGroup of the View being hidden.
+     * @param child The View being hidden.
+     * @param newVisibility The new visibility value of the child View, either
+     * {@link View#GONE} or {@link View#INVISIBLE}.
+     */
+    public void hideChild(ViewGroup parent, View child, int newVisibility) {
+        removeChild(parent, child, newVisibility == View.GONE);
     }
 
     /**
diff --git a/core/java/android/animation/TimeAnimator.java b/core/java/android/animation/TimeAnimator.java
index 0a96d59..a79f2a3 100644
--- a/core/java/android/animation/TimeAnimator.java
+++ b/core/java/android/animation/TimeAnimator.java
@@ -1,13 +1,11 @@
 package android.animation;
 
 /**
- * This class provides a simple callback mechanism to listeners that is synchronized with other
- * animators in the system. There is no duration, interpolation, or object value-setting
- * with this Animator. Instead, it is simply started and proceeds to send out events on every
- * animation frame to its TimeListener (if set), with information about this animator,
- * the total elapsed time, and the time since the last animation frame.
- *
- * @hide
+ * This class provides a simple callback mechanism to listeners that is synchronized with all
+ * other animators in the system. There is no duration, interpolation, or object value-setting
+ * with this Animator. Instead, it is simply started, after which it proceeds to send out events
+ * on every animation frame to its TimeListener (if set), with information about this animator,
+ * the total elapsed time, and the elapsed time since the previous animation frame.
  */
 public class TimeAnimator extends ValueAnimator {
 
@@ -59,10 +57,10 @@
      * Implementors of this interface can set themselves as update listeners
      * to a <code>TimeAnimator</code> instance to receive callbacks on every animation
      * frame to receive the total time since the animator started and the delta time
-     * since the last frame. The first time the listener is called, totalTime and
-     * deltaTime should both be zero.
-     *
-     * @hide
+     * since the last frame. The first time the listener is called,
+     * deltaTime will be zero. The same is true for totalTime, unless the animator was
+     * set to a specific {@link ValueAnimator#setCurrentPlayTime(long) currentPlayTime}
+     * prior to starting.
      */
     public static interface TimeListener {
         /**
@@ -70,7 +68,8 @@
          * along with information about the elapsed time.</p>
          *
          * @param animation The animator sending out the notification.
-         * @param totalTime The
+         * @param totalTime The total time elapsed since the animator started, in milliseconds.
+         * @param deltaTime The time elapsed since the previous frame, in milliseconds.
          */
         void onTimeUpdate(TimeAnimator animation, long totalTime, long deltaTime);
 
diff --git a/core/java/android/animation/ValueAnimator.java b/core/java/android/animation/ValueAnimator.java
index c7a129e..cc1efb9 100755
--- a/core/java/android/animation/ValueAnimator.java
+++ b/core/java/android/animation/ValueAnimator.java
@@ -19,6 +19,7 @@
 import android.os.Handler;
 import android.os.Looper;
 import android.os.Message;
+import android.os.SystemProperties;
 import android.util.AndroidRuntimeException;
 import android.view.Choreographer;
 import android.view.animation.AccelerateDecelerateInterpolator;
@@ -52,6 +53,7 @@
     /**
      * Internal constants
      */
+    private static float sDurationScale = 1.0f;
 
     /**
      * Messages sent to timing handler: START is sent when an animation first begins.
@@ -158,10 +160,12 @@
     //
 
     // How long the animation should last in ms
-    private long mDuration = 300;
+    private long mDuration = (long)(300 * sDurationScale);
+    private long mUnscaledDuration = 300;
 
     // The amount of time in ms to delay starting the animation after start() is called
     private long mStartDelay = 0;
+    private long mUnscaledStartDelay = 0;
 
     // The number of times the animation will repeat. The default is 0, which means the animation
     // will play only once
@@ -217,6 +221,14 @@
      */
     public static final int INFINITE = -1;
 
+
+    /**
+     * @hide
+     */
+    public static void setDurationScale(float durationScale) {
+        sDurationScale = durationScale;
+    }
+
     /**
      * Creates a new ValueAnimator object. This default constructor is primarily for
      * use internally; the factory methods which take parameters are more generally
@@ -453,7 +465,8 @@
             throw new IllegalArgumentException("Animators cannot have negative duration: " +
                     duration);
         }
-        mDuration = duration;
+        mUnscaledDuration = duration;
+        mDuration = (long)(duration * sDurationScale);
         return this;
     }
 
@@ -463,7 +476,7 @@
      * @return The length of the animation, in milliseconds.
      */
     public long getDuration() {
-        return mDuration;
+        return mUnscaledDuration;
     }
 
     /**
@@ -658,7 +671,7 @@
      * @return the number of milliseconds to delay running the animation
      */
     public long getStartDelay() {
-        return mStartDelay;
+        return mUnscaledStartDelay;
     }
 
     /**
@@ -668,7 +681,8 @@
      * @param startDelay The amount of the delay, in milliseconds
      */
     public void setStartDelay(long startDelay) {
-        this.mStartDelay = startDelay;
+        this.mStartDelay = (long)(startDelay * sDurationScale);
+        mUnscaledStartDelay = startDelay;
     }
 
     /**
diff --git a/core/java/android/annotation/SuppressLint.java b/core/java/android/annotation/SuppressLint.java
new file mode 100644
index 0000000..2d3456b
--- /dev/null
+++ b/core/java/android/annotation/SuppressLint.java
@@ -0,0 +1,38 @@
+/*
+ * 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.annotation;
+
+import static java.lang.annotation.ElementType.CONSTRUCTOR;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/** Indicates that Lint should ignore the specified warnings for the annotated element. */
+@Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE})
+@Retention(RetentionPolicy.CLASS)
+public @interface SuppressLint {
+    /**
+     * The set of warnings (identified by the lint issue id) that should be
+     * ignored by lint. It is not an error to specify an unrecognized name.
+     */
+    String[] value();
+}
diff --git a/core/java/android/annotation/TargetApi.java b/core/java/android/annotation/TargetApi.java
new file mode 100644
index 0000000..ea17890
--- /dev/null
+++ b/core/java/android/annotation/TargetApi.java
@@ -0,0 +1,35 @@
+/*
+ * 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.annotation;
+
+import static java.lang.annotation.ElementType.CONSTRUCTOR;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/** Indicates that Lint should treat this type as targeting a given API level, no matter what the
+    project target is. */
+@Target({TYPE, METHOD, CONSTRUCTOR})
+@Retention(RetentionPolicy.CLASS)
+public @interface TargetApi {
+    /**
+     * This sets the target api level for the type..
+     */
+    int value();
+}
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index 4fe9cef..d98d87b 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -30,6 +30,7 @@
 import android.content.res.Resources;
 import android.graphics.Bitmap;
 import android.graphics.Point;
+import android.os.Binder;
 import android.os.Debug;
 import android.os.Handler;
 import android.os.Parcel;
@@ -975,7 +976,7 @@
     public boolean clearApplicationUserData(String packageName, IPackageDataObserver observer) {
         try {
             return ActivityManagerNative.getDefault().clearApplicationUserData(packageName, 
-                    observer);
+                    observer, Binder.getOrigCallingUser());
         } catch (RemoteException e) {
             return false;
         }
@@ -1442,9 +1443,10 @@
     public int getLauncherLargeIconDensity() {
         final Resources res = mContext.getResources();
         final int density = res.getDisplayMetrics().densityDpi;
+        final int sw = res.getConfiguration().smallestScreenWidthDp;
 
-        if ((res.getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK)
-                != Configuration.SCREENLAYOUT_SIZE_XLARGE) {
+        if (sw < 600) {
+            // Smaller than approx 7" tablets, use the regular icon size.
             return density;
         }
 
@@ -1456,9 +1458,13 @@
             case DisplayMetrics.DENSITY_HIGH:
                 return DisplayMetrics.DENSITY_XHIGH;
             case DisplayMetrics.DENSITY_XHIGH:
-                return DisplayMetrics.DENSITY_MEDIUM * 2;
+                return DisplayMetrics.DENSITY_XXHIGH;
+            case DisplayMetrics.DENSITY_XXHIGH:
+                return DisplayMetrics.DENSITY_XHIGH * 2;
             default:
-                return density;
+                // The density is some abnormal value.  Return some other
+                // abnormal value that is a reasonable scaling of it.
+                return (int)(density*1.5f);
         }
     }
 
@@ -1471,9 +1477,10 @@
     public int getLauncherLargeIconSize() {
         final Resources res = mContext.getResources();
         final int size = res.getDimensionPixelSize(android.R.dimen.app_icon_size);
+        final int sw = res.getConfiguration().smallestScreenWidthDp;
 
-        if ((res.getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK)
-                != Configuration.SCREENLAYOUT_SIZE_XLARGE) {
+        if (sw < 600) {
+            // Smaller than approx 7" tablets, use the regular icon size.
             return size;
         }
 
@@ -1487,9 +1494,13 @@
             case DisplayMetrics.DENSITY_HIGH:
                 return (size * DisplayMetrics.DENSITY_XHIGH) / DisplayMetrics.DENSITY_HIGH;
             case DisplayMetrics.DENSITY_XHIGH:
-                return (size * DisplayMetrics.DENSITY_MEDIUM * 2) / DisplayMetrics.DENSITY_XHIGH;
+                return (size * DisplayMetrics.DENSITY_XXHIGH) / DisplayMetrics.DENSITY_XHIGH;
+            case DisplayMetrics.DENSITY_XXHIGH:
+                return (size * DisplayMetrics.DENSITY_XHIGH*2) / DisplayMetrics.DENSITY_XXHIGH;
             default:
-                return size;
+                // The density is some abnormal value.  Return some other
+                // abnormal value that is a reasonable scaling of it.
+                return (int)(size*1.5f);
         }
     }
 
diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java
index 7994d7c..d80902d 100644
--- a/core/java/android/app/ActivityManagerNative.java
+++ b/core/java/android/app/ActivityManagerNative.java
@@ -91,7 +91,7 @@
         try {
             getDefault().broadcastIntent(
                 null, intent, null, null, Activity.RESULT_OK, null, null,
-                null /*permission*/, false, true);
+                null /*permission*/, false, true, Binder.getOrigCallingUser());
         } catch (RemoteException ex) {
         }
     }
@@ -306,9 +306,10 @@
             String perm = data.readString();
             boolean serialized = data.readInt() != 0;
             boolean sticky = data.readInt() != 0;
+            int userId = data.readInt();
             int res = broadcastIntent(app, intent, resolvedType, resultTo,
                     resultCode, resultData, resultExtras, perm,
-                    serialized, sticky);
+                    serialized, sticky, userId);
             reply.writeNoException();
             reply.writeInt(res);
             return true;
@@ -320,7 +321,8 @@
             IBinder b = data.readStrongBinder();
             IApplicationThread app = b != null ? ApplicationThreadNative.asInterface(b) : null;
             Intent intent = Intent.CREATOR.createFromParcel(data);
-            unbroadcastIntent(app, intent);
+            int userId = data.readInt();
+            unbroadcastIntent(app, intent, userId);
             reply.writeNoException();
             return true;
         }
@@ -900,7 +902,8 @@
             String packageName = data.readString();
             IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface(
                     data.readStrongBinder());
-            boolean res = clearApplicationUserData(packageName, observer);
+            int userId = data.readInt();
+            boolean res = clearApplicationUserData(packageName, observer, userId);
             reply.writeNoException();
             reply.writeInt(res ? 1 : 0);
             return true;
@@ -1819,7 +1822,7 @@
             Intent intent, String resolvedType,  IIntentReceiver resultTo,
             int resultCode, String resultData, Bundle map,
             String requiredPermission, boolean serialized,
-            boolean sticky) throws RemoteException
+            boolean sticky, int userId) throws RemoteException
     {
         Parcel data = Parcel.obtain();
         Parcel reply = Parcel.obtain();
@@ -1834,6 +1837,7 @@
         data.writeString(requiredPermission);
         data.writeInt(serialized ? 1 : 0);
         data.writeInt(sticky ? 1 : 0);
+        data.writeInt(userId);
         mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0);
         reply.readException();
         int res = reply.readInt();
@@ -1841,13 +1845,15 @@
         data.recycle();
         return res;
     }
-    public void unbroadcastIntent(IApplicationThread caller, Intent intent) throws RemoteException
+    public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId)
+            throws RemoteException
     {
         Parcel data = Parcel.obtain();
         Parcel reply = Parcel.obtain();
         data.writeInterfaceToken(IActivityManager.descriptor);
         data.writeStrongBinder(caller != null ? caller.asBinder() : null);
         intent.writeToParcel(data, 0);
+        data.writeInt(userId);
         mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0);
         reply.readException();
         data.recycle();
@@ -2651,12 +2657,13 @@
         return res;
     }
     public boolean clearApplicationUserData(final String packageName,
-            final IPackageDataObserver observer) throws RemoteException {        
+            final IPackageDataObserver observer, final int userId) throws RemoteException {
         Parcel data = Parcel.obtain();
         Parcel reply = Parcel.obtain();
         data.writeInterfaceToken(IActivityManager.descriptor);
         data.writeString(packageName);
         data.writeStrongBinder(observer.asBinder());
+        data.writeInt(userId);
         mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0);
         reply.readException();
         boolean res = reply.readInt() != 0;
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index bac3c6c..e4cfc99 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -47,6 +47,7 @@
 import android.net.ProxyProperties;
 import android.opengl.GLUtils;
 import android.os.AsyncTask;
+import android.os.Binder;
 import android.os.Bundle;
 import android.os.Debug;
 import android.os.Handler;
@@ -60,6 +61,7 @@
 import android.os.ServiceManager;
 import android.os.StrictMode;
 import android.os.SystemClock;
+import android.os.UserId;
 import android.util.AndroidRuntimeException;
 import android.util.DisplayMetrics;
 import android.util.EventLog;
@@ -132,6 +134,7 @@
     private static final boolean DEBUG_RESULTS = false;
     private static final boolean DEBUG_BACKUP = true;
     private static final boolean DEBUG_CONFIGURATION = false;
+    private static final boolean DEBUG_SERVICE = true;
     private static final long MIN_TIME_BETWEEN_GCS = 5*1000;
     private static final Pattern PATTERN_SEMICOLON = Pattern.compile(";");
     private static final int SQLITE_MEM_RELEASED_EVENT_LOG_TAG = 75003;
@@ -486,7 +489,6 @@
         private static final String HEAP_COLUMN = "%13s %8s %8s %8s %8s %8s %8s";
         private static final String ONE_COUNT_COLUMN = "%21s %8d";
         private static final String TWO_COUNT_COLUMNS = "%21s %8d %21s %8d";
-        private static final String TWO_COUNT_COLUMNS_DB = "%21s %8d %21s %8d";
         private static final String DB_INFO_FORMAT = "  %8s %8s %14s %14s  %s";
 
         // Formatting for checkin service - update version if row format changes
@@ -636,6 +638,9 @@
             s.intent = intent;
             s.rebind = rebind;
 
+            if (DEBUG_SERVICE)
+                Slog.v(TAG, "scheduleBindService token=" + token + " intent=" + intent + " uid="
+                        + Binder.getCallingUid() + " pid=" + Binder.getCallingPid());
             queueOrSendMessage(H.BIND_SERVICE, s);
         }
 
@@ -867,7 +872,6 @@
             int binderProxyObjectCount = Debug.getBinderProxyObjectCount();
             int binderDeathObjectCount = Debug.getBinderDeathObjectCount();
             long openSslSocketCount = Debug.countInstancesOfClass(OpenSSLSocketImpl.class);
-            long sqliteAllocated = SQLiteDebug.getHeapAllocatedSize() / 1024;
             SQLiteDebug.PagerStats stats = SQLiteDebug.getDatabaseInfo();
 
             // For checkin, we print one long comma-separated list of values
@@ -935,9 +939,9 @@
                 pw.print(openSslSocketCount); pw.print(',');
 
                 // SQL
-                pw.print(sqliteAllocated); pw.print(',');
                 pw.print(stats.memoryUsed / 1024); pw.print(',');
-                pw.print(stats.pageCacheOverflo / 1024); pw.print(',');
+                pw.print(stats.memoryUsed / 1024); pw.print(',');
+                pw.print(stats.pageCacheOverflow / 1024); pw.print(',');
                 pw.print(stats.largestMemAlloc / 1024);
                 for (int i = 0; i < stats.dbStats.size(); i++) {
                     DbStats dbStats = stats.dbStats.get(i);
@@ -1003,10 +1007,9 @@
             // SQLite mem info
             pw.println(" ");
             pw.println(" SQL");
-            printRow(pw, TWO_COUNT_COLUMNS_DB, "heap:", sqliteAllocated, "MEMORY_USED:",
-                    stats.memoryUsed / 1024);
-            printRow(pw, TWO_COUNT_COLUMNS_DB, "PAGECACHE_OVERFLOW:",
-                    stats.pageCacheOverflo / 1024, "MALLOC_SIZE:", stats.largestMemAlloc / 1024);
+            printRow(pw, ONE_COUNT_COLUMN, "MEMORY_USED:", stats.memoryUsed / 1024);
+            printRow(pw, TWO_COUNT_COLUMNS, "PAGECACHE_OVERFLOW:",
+                    stats.pageCacheOverflow / 1024, "MALLOC_SIZE:", stats.largestMemAlloc / 1024);
             pw.println(" ");
             int N = stats.dbStats.size();
             if (N > 0) {
@@ -1595,7 +1598,8 @@
         boolean includeCode = (flags&Context.CONTEXT_INCLUDE_CODE) != 0;
         boolean securityViolation = includeCode && ai.uid != 0
                 && ai.uid != Process.SYSTEM_UID && (mBoundApplication != null
-                        ? ai.uid != mBoundApplication.appInfo.uid : true);
+                        ? !UserId.isSameApp(ai.uid, mBoundApplication.appInfo.uid)
+                        : true);
         if ((flags&(Context.CONTEXT_INCLUDE_CODE
                 |Context.CONTEXT_IGNORE_SECURITY))
                 == Context.CONTEXT_INCLUDE_CODE) {
@@ -2297,6 +2301,8 @@
 
     private void handleBindService(BindServiceData data) {
         Service s = mServices.get(data.token);
+        if (DEBUG_SERVICE)
+            Slog.v(TAG, "handleBindService s=" + s + " rebind=" + data.rebind);
         if (s != null) {
             try {
                 data.intent.setExtrasClassLoader(s.getClassLoader());
@@ -3744,7 +3750,6 @@
     }
 
     final void handleTrimMemory(int level) {
-        WindowManagerImpl.getDefault().trimMemory(level);
         ArrayList<ComponentCallbacks2> callbacks;
 
         synchronized (mPackages) {
@@ -3755,6 +3760,7 @@
         for (int i=0; i<N; i++) {
             callbacks.get(i).onTrimMemory(level);
         }
+        WindowManagerImpl.getDefault().trimMemory(level);
     }
 
     private void setupGraphicsSupport(LoadedApk info) {
@@ -3807,7 +3813,7 @@
         // implementation to use the pool executor.  Normally, we use the
         // serialized executor as the default. This has to happen in the
         // main thread so the main looper is set right.
-        if (data.appInfo.targetSdkVersion <= 12) {
+        if (data.appInfo.targetSdkVersion <= android.os.Build.VERSION_CODES.HONEYCOMB_MR1) {
             AsyncTask.setDefaultExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
         }
 
@@ -4416,7 +4422,7 @@
         });
     }
 
-    public static final ActivityThread systemMain() {
+    public static ActivityThread systemMain() {
         HardwareRenderer.disable(true);
         ActivityThread thread = new ActivityThread();
         thread.attach(true);
@@ -4457,6 +4463,8 @@
         ActivityThread thread = new ActivityThread();
         thread.attach(false);
 
+        AsyncTask.init();
+
         if (false) {
             Looper.myLooper().setMessageLogging(new
                     LogPrinter(Log.DEBUG, "ActivityThread"));
diff --git a/core/java/android/app/ApplicationPackageManager.java b/core/java/android/app/ApplicationPackageManager.java
index 180a442..fee2beb 100644
--- a/core/java/android/app/ApplicationPackageManager.java
+++ b/core/java/android/app/ApplicationPackageManager.java
@@ -1177,13 +1177,14 @@
      */
     @Override
     public List<UserInfo> getUsers() {
-        // TODO:
-        // Dummy code, always returns just the primary user
-        ArrayList<UserInfo> users = new ArrayList<UserInfo>();
-        UserInfo primary = new UserInfo(0, "Root!",
-                UserInfo.FLAG_ADMIN | UserInfo.FLAG_PRIMARY);
-        users.add(primary);
-        return users;
+        try {
+            return mPM.getUsers();
+        } catch (RemoteException re) {
+            ArrayList<UserInfo> users = new ArrayList<UserInfo>();
+            UserInfo primary = new UserInfo(0, "Root!", UserInfo.FLAG_ADMIN | UserInfo.FLAG_PRIMARY);
+            users.add(primary);
+            return users;
+        }
     }
 
     /**
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index 2bf1fb7..db5113e 100644
--- a/core/java/android/app/ContextImpl.java
+++ b/core/java/android/app/ContextImpl.java
@@ -75,6 +75,7 @@
 import android.os.Process;
 import android.os.RemoteException;
 import android.os.ServiceManager;
+import android.os.UserId;
 import android.os.Vibrator;
 import android.os.storage.StorageManager;
 import android.telephony.TelephonyManager;
@@ -896,7 +897,8 @@
             intent.setAllowFds(false);
             ActivityManagerNative.getDefault().broadcastIntent(
                 mMainThread.getApplicationThread(), intent, resolvedType, null,
-                Activity.RESULT_OK, null, null, null, false, false);
+                Activity.RESULT_OK, null, null, null, false, false,
+                Binder.getOrigCallingUser());
         } catch (RemoteException e) {
         }
     }
@@ -908,7 +910,8 @@
             intent.setAllowFds(false);
             ActivityManagerNative.getDefault().broadcastIntent(
                 mMainThread.getApplicationThread(), intent, resolvedType, null,
-                Activity.RESULT_OK, null, null, receiverPermission, false, false);
+                Activity.RESULT_OK, null, null, receiverPermission, false, false,
+                Binder.getOrigCallingUser());
         } catch (RemoteException e) {
         }
     }
@@ -921,7 +924,8 @@
             intent.setAllowFds(false);
             ActivityManagerNative.getDefault().broadcastIntent(
                 mMainThread.getApplicationThread(), intent, resolvedType, null,
-                Activity.RESULT_OK, null, null, receiverPermission, true, false);
+                Activity.RESULT_OK, null, null, receiverPermission, true, false,
+                Binder.getOrigCallingUser());
         } catch (RemoteException e) {
         }
     }
@@ -954,7 +958,7 @@
             ActivityManagerNative.getDefault().broadcastIntent(
                 mMainThread.getApplicationThread(), intent, resolvedType, rd,
                 initialCode, initialData, initialExtras, receiverPermission,
-                true, false);
+                true, false, Binder.getOrigCallingUser());
         } catch (RemoteException e) {
         }
     }
@@ -966,7 +970,8 @@
             intent.setAllowFds(false);
             ActivityManagerNative.getDefault().broadcastIntent(
                 mMainThread.getApplicationThread(), intent, resolvedType, null,
-                Activity.RESULT_OK, null, null, null, false, true);
+                Activity.RESULT_OK, null, null, null, false, true,
+                Binder.getOrigCallingUser());
         } catch (RemoteException e) {
         }
     }
@@ -999,7 +1004,7 @@
             ActivityManagerNative.getDefault().broadcastIntent(
                 mMainThread.getApplicationThread(), intent, resolvedType, rd,
                 initialCode, initialData, initialExtras, null,
-                true, true);
+                true, true, Binder.getOrigCallingUser());
         } catch (RemoteException e) {
         }
     }
@@ -1014,7 +1019,7 @@
         try {
             intent.setAllowFds(false);
             ActivityManagerNative.getDefault().unbroadcastIntent(
-                mMainThread.getApplicationThread(), intent);
+                    mMainThread.getApplicationThread(), intent, Binder.getOrigCallingUser());
         } catch (RemoteException e) {
         }
     }
@@ -1215,8 +1220,7 @@
 
         int pid = Binder.getCallingPid();
         if (pid != Process.myPid()) {
-            return checkPermission(permission, pid,
-                    Binder.getCallingUid());
+            return checkPermission(permission, pid, Binder.getCallingUid());
         }
         return PackageManager.PERMISSION_DENIED;
     }
@@ -1384,7 +1388,8 @@
             Uri uri, int modeFlags, String message) {
         enforceForUri(
                 modeFlags, checkCallingUriPermission(uri, modeFlags),
-                false, Binder.getCallingUid(), uri, message);
+                false,
+                Binder.getCallingUid(), uri, message);
     }
 
     public void enforceCallingOrSelfUriPermission(
diff --git a/core/java/android/app/IActivityManager.java b/core/java/android/app/IActivityManager.java
index 5222d37..39817ac 100644
--- a/core/java/android/app/IActivityManager.java
+++ b/core/java/android/app/IActivityManager.java
@@ -114,8 +114,8 @@
     public int broadcastIntent(IApplicationThread caller, Intent intent,
             String resolvedType, IIntentReceiver resultTo, int resultCode,
             String resultData, Bundle map, String requiredPermission,
-            boolean serialized, boolean sticky) throws RemoteException;
-    public void unbroadcastIntent(IApplicationThread caller, Intent intent) throws RemoteException;
+            boolean serialized, boolean sticky, int userId) throws RemoteException;
+    public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId) throws RemoteException;
     /* oneway */
     public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, boolean abortBroadcast) throws RemoteException;
     public void attachApplication(IApplicationThread app) throws RemoteException;
@@ -209,7 +209,7 @@
             int flags) throws RemoteException;
     public void cancelIntentSender(IIntentSender sender) throws RemoteException;
     public boolean clearApplicationUserData(final String packageName,
-            final IPackageDataObserver observer) throws RemoteException;
+            final IPackageDataObserver observer, int userId) throws RemoteException;
     public String getPackageForIntentSender(IIntentSender sender) throws RemoteException;
     
     public void setProcessLimit(int max) throws RemoteException;
diff --git a/core/java/android/app/LoadedApk.java b/core/java/android/app/LoadedApk.java
index 0c6baeb..fcbcd81 100644
--- a/core/java/android/app/LoadedApk.java
+++ b/core/java/android/app/LoadedApk.java
@@ -36,6 +36,7 @@
 import android.os.Process;
 import android.os.RemoteException;
 import android.os.StrictMode;
+import android.os.UserId;
 import android.util.AndroidRuntimeException;
 import android.util.Slog;
 import android.view.CompatibilityInfoHolder;
@@ -67,6 +68,8 @@
  */
 public final class LoadedApk {
 
+    private static final String TAG = "LoadedApk";
+
     private final ActivityThread mActivityThread;
     private final ApplicationInfo mApplicationInfo;
     final String mPackageName;
@@ -113,8 +116,13 @@
         mApplicationInfo = aInfo;
         mPackageName = aInfo.packageName;
         mAppDir = aInfo.sourceDir;
-        mResDir = aInfo.uid == Process.myUid() ? aInfo.sourceDir
+        final int myUid = Process.myUid();
+        mResDir = aInfo.uid == myUid ? aInfo.sourceDir
                 : aInfo.publicSourceDir;
+        if (!UserId.isSameUser(aInfo.uid, myUid)) {
+            aInfo.dataDir = PackageManager.getDataDirForUser(UserId.getUserId(myUid),
+                    mPackageName);
+        }
         mSharedLibraries = aInfo.sharedLibraryFiles;
         mDataDir = aInfo.dataDir;
         mDataDirFile = mDataDir != null ? new File(mDataDir) : null;
diff --git a/core/java/android/app/LoaderManager.java b/core/java/android/app/LoaderManager.java
index d83d2e6..ff71ee7 100644
--- a/core/java/android/app/LoaderManager.java
+++ b/core/java/android/app/LoaderManager.java
@@ -17,6 +17,7 @@
 package android.app;
 
 import android.content.Loader;
+import android.content.Loader.OnLoadCanceledListener;
 import android.os.Bundle;
 import android.util.DebugUtils;
 import android.util.Log;
@@ -219,7 +220,8 @@
     
     boolean mCreatingLoader;
 
-    final class LoaderInfo implements Loader.OnLoadCompleteListener<Object> {
+    final class LoaderInfo implements Loader.OnLoadCompleteListener<Object>,
+            Loader.OnLoadCanceledListener<Object> {
         final int mId;
         final Bundle mArgs;
         LoaderManager.LoaderCallbacks<Object> mCallbacks;
@@ -271,6 +273,7 @@
                 }
                 if (!mListenerRegistered) {
                     mLoader.registerListener(mId, this);
+                    mLoader.registerOnLoadCanceledListener(this);
                     mListenerRegistered = true;
                 }
                 mLoader.startLoading();
@@ -329,11 +332,21 @@
                     // Let the loader know we're done with it
                     mListenerRegistered = false;
                     mLoader.unregisterListener(this);
+                    mLoader.unregisterOnLoadCanceledListener(this);
                     mLoader.stopLoading();
                 }
             }
         }
-        
+
+        void cancel() {
+            if (DEBUG) Log.v(TAG, "  Canceling: " + this);
+            if (mStarted && mLoader != null && mListenerRegistered) {
+                if (!mLoader.cancelLoad()) {
+                    onLoadCanceled(mLoader);
+                }
+            }
+        }
+
         void destroy() {
             if (DEBUG) Log.v(TAG, "  Destroying: " + this);
             mDestroyed = true;
@@ -361,6 +374,7 @@
                 if (mListenerRegistered) {
                     mListenerRegistered = false;
                     mLoader.unregisterListener(this);
+                    mLoader.unregisterOnLoadCanceledListener(this);
                 }
                 mLoader.reset();
             }
@@ -368,8 +382,38 @@
                 mPendingLoader.destroy();
             }
         }
-        
-        @Override public void onLoadComplete(Loader<Object> loader, Object data) {
+
+        @Override
+        public void onLoadCanceled(Loader<Object> loader) {
+            if (DEBUG) Log.v(TAG, "onLoadCanceled: " + this);
+
+            if (mDestroyed) {
+                if (DEBUG) Log.v(TAG, "  Ignoring load canceled -- destroyed");
+                return;
+            }
+
+            if (mLoaders.get(mId) != this) {
+                // This cancellation message is not coming from the current active loader.
+                // We don't care about it.
+                if (DEBUG) Log.v(TAG, "  Ignoring load canceled -- not active");
+                return;
+            }
+
+            LoaderInfo pending = mPendingLoader;
+            if (pending != null) {
+                // There is a new request pending and we were just
+                // waiting for the old one to cancel or complete before starting
+                // it.  So now it is time, switch over to the new loader.
+                if (DEBUG) Log.v(TAG, "  Switching to pending loader: " + pending);
+                mPendingLoader = null;
+                mLoaders.put(mId, null);
+                destroy();
+                installLoader(pending);
+            }
+        }
+
+        @Override
+        public void onLoadComplete(Loader<Object> loader, Object data) {
             if (DEBUG) Log.v(TAG, "onLoadComplete: " + this);
             
             if (mDestroyed) {
@@ -632,7 +676,9 @@
                     } else {
                         // Now we have three active loaders... we'll queue
                         // up this request to be processed once one of the other loaders
-                        // finishes.
+                        // finishes or is canceled.
+                        if (DEBUG) Log.v(TAG, "  Current loader is running; attempting to cancel");
+                        info.cancel();
                         if (info.mPendingLoader != null) {
                             if (DEBUG) Log.v(TAG, "  Removing pending loader: " + info.mPendingLoader);
                             info.mPendingLoader.destroy();
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index f5add25..d569e20 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -113,7 +113,10 @@
      * {@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK} flag, which requires
      * that you take care of task management as described in the
      * <a href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back
-     * Stack</a> document.
+     * Stack</a> document.  In particular, make sure to read the notification section
+     * <a href="{@docRoot}guide/topics/ui/notifiers/notifications.html#HandlingNotifications">Handling
+     * Notifications</a> for the correct ways to launch an application from a
+     * notification.
      */
     public PendingIntent contentIntent;
 
@@ -765,7 +768,9 @@
          * Supply a {@link PendingIntent} to send when the notification is clicked.
          * If you do not supply an intent, you can now add PendingIntents to individual
          * views to be launched when clicked by calling {@link RemoteViews#setOnClickPendingIntent
-         * RemoteViews.setOnClickPendingIntent(int,PendingIntent)}.
+         * RemoteViews.setOnClickPendingIntent(int,PendingIntent)}.  Be sure to
+         * read {@link Notification#contentIntent Notification.contentIntent} for
+         * how to correctly use this.
          */
         public Builder setContentIntent(PendingIntent intent) {
             mContentIntent = intent;
diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java
index 8fa95b4..d04e9db 100644
--- a/core/java/android/app/SearchDialog.java
+++ b/core/java/android/app/SearchDialog.java
@@ -551,7 +551,6 @@
         try {
             // If the intent was created from a suggestion, it will always have an explicit
             // component here.
-            Log.i(LOG_TAG, "Starting (as ourselves) " + intent.toUri(0));
             getContext().startActivity(intent);
             // If the search switches to a different activity,
             // SearchDialogWrapper#performActivityResuming
diff --git a/core/java/android/app/WallpaperManager.java b/core/java/android/app/WallpaperManager.java
index b1c1f30..c1e28b0 100644
--- a/core/java/android/app/WallpaperManager.java
+++ b/core/java/android/app/WallpaperManager.java
@@ -213,10 +213,6 @@
             mHandler.sendEmptyMessage(MSG_CLEAR_WALLPAPER);
         }
 
-        public Handler getHandler() {
-            return mHandler;
-        }
-
         public Bitmap peekWallpaperBitmap(Context context, boolean returnDefault) {
             synchronized (this) {
                 if (mWallpaper != null) {
@@ -623,24 +619,14 @@
      * @param yOffset The offset along the Y dimension, from 0 to 1.
      */
     public void setWallpaperOffsets(IBinder windowToken, float xOffset, float yOffset) {
-        final IBinder fWindowToken = windowToken;
-        final float fXOffset = xOffset;
-        final float fYOffset = yOffset;
-        sGlobals.getHandler().post(new Runnable() {
-            public void run() {
-                try {
-                    //Log.v(TAG, "Sending new wallpaper offsets from app...");
-                    ViewRootImpl.getWindowSession(mContext.getMainLooper()).setWallpaperPosition(
-                            fWindowToken, fXOffset, fYOffset, mWallpaperXStep, mWallpaperYStep);
-                    //Log.v(TAG, "...app returning after sending offsets!");
-                } catch (RemoteException e) {
-                    // Ignore.
-                } catch (IllegalArgumentException e) {
-                    // Since this is being posted, it's possible that this windowToken is no longer
-                    // valid, for example, if setWallpaperOffsets is called just before rotation.
-                }
-            }
-        });
+        try {
+            //Log.v(TAG, "Sending new wallpaper offsets from app...");
+            ViewRootImpl.getWindowSession(mContext.getMainLooper()).setWallpaperPosition(
+                    windowToken, xOffset, yOffset, mWallpaperXStep, mWallpaperYStep);
+            //Log.v(TAG, "...app returning after sending offsets!");
+        } catch (RemoteException e) {
+            // Ignore.
+        }
     }
 
     /**
diff --git a/core/java/android/content/AsyncTaskLoader.java b/core/java/android/content/AsyncTaskLoader.java
index 0b54396..da51952 100644
--- a/core/java/android/content/AsyncTaskLoader.java
+++ b/core/java/android/content/AsyncTaskLoader.java
@@ -53,19 +53,33 @@
     static final boolean DEBUG = false;
 
     final class LoadTask extends AsyncTask<Void, Void, D> implements Runnable {
+        private final CountDownLatch mDone = new CountDownLatch(1);
 
-        D result;
+        // Set to true to indicate that the task has been posted to a handler for
+        // execution at a later time.  Used to throttle updates.
         boolean waiting;
 
-        private CountDownLatch done = new CountDownLatch(1);
-
         /* Runs on a worker thread */
         @Override
         protected D doInBackground(Void... params) {
             if (DEBUG) Slog.v(TAG, this + " >>> doInBackground");
-            result = AsyncTaskLoader.this.onLoadInBackground();
-            if (DEBUG) Slog.v(TAG, this + "  <<< doInBackground");
-            return result;
+            try {
+                D data = AsyncTaskLoader.this.onLoadInBackground();
+                if (DEBUG) Slog.v(TAG, this + "  <<< doInBackground");
+                return data;
+            } catch (OperationCanceledException ex) {
+                if (!isCancelled()) {
+                    // onLoadInBackground threw a canceled exception spuriously.
+                    // This is problematic because it means that the LoaderManager did not
+                    // cancel the Loader itself and still expects to receive a result.
+                    // Additionally, the Loader's own state will not have been updated to
+                    // reflect the fact that the task was being canceled.
+                    // So we treat this case as an unhandled exception.
+                    throw ex;
+                }
+                if (DEBUG) Slog.v(TAG, this + "  <<< doInBackground (was canceled)");
+                return null;
+            }
         }
 
         /* Runs on the UI thread */
@@ -75,25 +89,37 @@
             try {
                 AsyncTaskLoader.this.dispatchOnLoadComplete(this, data);
             } finally {
-                done.countDown();
+                mDone.countDown();
             }
         }
 
+        /* Runs on the UI thread */
         @Override
-        protected void onCancelled() {
+        protected void onCancelled(D data) {
             if (DEBUG) Slog.v(TAG, this + " onCancelled");
             try {
-                AsyncTaskLoader.this.dispatchOnCancelled(this, result);
+                AsyncTaskLoader.this.dispatchOnCancelled(this, data);
             } finally {
-                done.countDown();
+                mDone.countDown();
             }
         }
 
+        /* Runs on the UI thread, when the waiting task is posted to a handler.
+         * This method is only executed when task execution was deferred (waiting was true). */
         @Override
         public void run() {
             waiting = false;
             AsyncTaskLoader.this.executePendingTask();
         }
+
+        /* Used for testing purposes to wait for the task to complete. */
+        public void waitForLoader() {
+            try {
+                mDone.await();
+            } catch (InterruptedException e) {
+                // Ignore
+            }
+        }
     }
 
     volatile LoadTask mTask;
@@ -109,7 +135,7 @@
 
     /**
      * Set amount to throttle updates by.  This is the minimum time from
-     * when the last {@link #onLoadInBackground()} call has completed until
+     * when the last {@link #loadInBackground()} call has completed until
      * a new load is scheduled.
      *
      * @param delayMS Amount of delay, in milliseconds.
@@ -130,24 +156,9 @@
         executePendingTask();
     }
 
-    /**
-     * Attempt to cancel the current load task. See {@link AsyncTask#cancel(boolean)}
-     * for more info.  Must be called on the main thread of the process.
-     *
-     * <p>Cancelling is not an immediate operation, since the load is performed
-     * in a background thread.  If there is currently a load in progress, this
-     * method requests that the load be cancelled, and notes this is the case;
-     * once the background thread has completed its work its remaining state
-     * will be cleared.  If another load request comes in during this time,
-     * it will be held until the cancelled load is complete.
-     *
-     * @return Returns <tt>false</tt> if the task could not be cancelled,
-     *         typically because it has already completed normally, or
-     *         because {@link #startLoading()} hasn't been called; returns
-     *         <tt>true</tt> otherwise.
-     */
-    public boolean cancelLoad() {
-        if (DEBUG) Slog.v(TAG, "cancelLoad: mTask=" + mTask);
+    @Override
+    protected boolean onCancelLoad() {
+        if (DEBUG) Slog.v(TAG, "onCancelLoad: mTask=" + mTask);
         if (mTask != null) {
             if (mCancellingTask != null) {
                 // There was a pending task already waiting for a previous
@@ -173,6 +184,7 @@
                 if (DEBUG) Slog.v(TAG, "cancelLoad: cancelled=" + cancelled);
                 if (cancelled) {
                     mCancellingTask = mTask;
+                    cancelLoadInBackground();
                 }
                 mTask = null;
                 return cancelled;
@@ -183,7 +195,10 @@
 
     /**
      * Called if the task was canceled before it was completed.  Gives the class a chance
-     * to properly dispose of the result.
+     * to clean up post-cancellation and to properly dispose of the result.
+     *
+     * @param data The value that was returned by {@link #loadInBackground}, or null
+     * if the task threw {@link OperationCanceledException}.
      */
     public void onCanceled(D data) {
     }
@@ -217,6 +232,8 @@
             if (DEBUG) Slog.v(TAG, "Cancelled task is now canceled!");
             mLastLoadCompleteTime = SystemClock.uptimeMillis();
             mCancellingTask = null;
+            if (DEBUG) Slog.v(TAG, "Delivering cancellation");
+            deliverCancellation();
             executePendingTask();
         }
     }
@@ -239,23 +256,76 @@
     }
 
     /**
+     * Called on a worker thread to perform the actual load and to return
+     * the result of the load operation.
+     *
+     * Implementations should not deliver the result directly, but should return them
+     * from this method, which will eventually end up calling {@link #deliverResult} on
+     * the UI thread.  If implementations need to process the results on the UI thread
+     * they may override {@link #deliverResult} and do so there.
+     *
+     * To support cancellation, this method should periodically check the value of
+     * {@link #isLoadInBackgroundCanceled} and terminate when it returns true.
+     * Subclasses may also override {@link #cancelLoadInBackground} to interrupt the load
+     * directly instead of polling {@link #isLoadInBackgroundCanceled}.
+     *
+     * When the load is canceled, this method may either return normally or throw
+     * {@link OperationCanceledException}.  In either case, the {@link Loader} will
+     * call {@link #onCanceled} to perform post-cancellation cleanup and to dispose of the
+     * result object, if any.
+     *
+     * @return The result of the load operation.
+     *
+     * @throws OperationCanceledException if the load is canceled during execution.
+     *
+     * @see #isLoadInBackgroundCanceled
+     * @see #cancelLoadInBackground
+     * @see #onCanceled
      */
     public abstract D loadInBackground();
 
     /**
-     * Called on a worker thread to perform the actual load. Implementations should not deliver the
-     * result directly, but should return them from this method, which will eventually end up
-     * calling {@link #deliverResult} on the UI thread. If implementations need to process
-     * the results on the UI thread they may override {@link #deliverResult} and do so
-     * there.
+     * Calls {@link #loadInBackground()}.
      *
-     * @return Implementations must return the result of their load operation.
+     * This method is reserved for use by the loader framework.
+     * Subclasses should override {@link #loadInBackground} instead of this method.
+     *
+     * @return The result of the load operation.
+     *
+     * @throws OperationCanceledException if the load is canceled during execution.
+     *
+     * @see #loadInBackground
      */
     protected D onLoadInBackground() {
         return loadInBackground();
     }
 
     /**
+     * Called on the main thread to abort a load in progress.
+     *
+     * Override this method to abort the current invocation of {@link #loadInBackground}
+     * that is running in the background on a worker thread.
+     *
+     * This method should do nothing if {@link #loadInBackground} has not started
+     * running or if it has already finished.
+     *
+     * @see #loadInBackground
+     */
+    public void cancelLoadInBackground() {
+    }
+
+    /**
+     * Returns true if the current invocation of {@link #loadInBackground} is being canceled.
+     *
+     * @return True if the current invocation of {@link #loadInBackground} is being canceled.
+     *
+     * @see #loadInBackground
+     */
+    public boolean isLoadInBackgroundCanceled() {
+        return mCancellingTask != null;
+    }
+
+    /**
      * Locks the current thread until the loader completes the current load
      * operation. Returns immediately if there is no load operation running.
      * Should not be called from the UI thread: calling it from the UI
@@ -268,11 +338,7 @@
     public void waitForLoader() {
         LoadTask task = mTask;
         if (task != null) {
-            try {
-                task.done.await();
-            } catch (InterruptedException e) {
-                // Ignore
-            }
+            task.waitForLoader();
         }
     }
 
diff --git a/core/java/android/content/CancellationSignal.java b/core/java/android/content/CancellationSignal.java
new file mode 100644
index 0000000..2dbbe54
--- /dev/null
+++ b/core/java/android/content/CancellationSignal.java
@@ -0,0 +1,170 @@
+/*
+ * 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.content;
+
+import android.os.RemoteException;
+
+/**
+ * Provides the ability to cancel an operation in progress.
+ */
+public final class CancellationSignal {
+    private boolean mIsCanceled;
+    private OnCancelListener mOnCancelListener;
+    private ICancellationSignal mRemote;
+
+    /**
+     * Creates a cancellation signal, initially not canceled.
+     */
+    public CancellationSignal() {
+    }
+
+    /**
+     * Returns true if the operation has been canceled.
+     *
+     * @return True if the operation has been canceled.
+     */
+    public boolean isCanceled() {
+        synchronized (this) {
+            return mIsCanceled;
+        }
+    }
+
+    /**
+     * Throws {@link OperationCanceledException} if the operation has been canceled.
+     *
+     * @throws OperationCanceledException if the operation has been canceled.
+     */
+    public void throwIfCanceled() {
+        if (isCanceled()) {
+            throw new OperationCanceledException();
+        }
+    }
+
+    /**
+     * Cancels the operation and signals the cancellation listener.
+     * If the operation has not yet started, then it will be canceled as soon as it does.
+     */
+    public void cancel() {
+        synchronized (this) {
+            if (!mIsCanceled) {
+                mIsCanceled = true;
+                if (mOnCancelListener != null) {
+                    mOnCancelListener.onCancel();
+                }
+                if (mRemote != null) {
+                    try {
+                        mRemote.cancel();
+                    } catch (RemoteException ex) {
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * Sets the cancellation listener to be called when canceled.
+     *
+     * This method is intended to be used by the recipient of a cancellation signal
+     * such as a database or a content provider to handle cancellation requests
+     * while performing a long-running operation.  This method is not intended to be
+     * used by applications themselves.
+     *
+     * If {@link CancellationSignal#cancel} has already been called, then the provided
+     * listener is invoked immediately.
+     *
+     * The listener is called while holding the cancellation signal's lock which is
+     * also held while registering or unregistering the listener.  Because of the lock,
+     * it is not possible for the listener to run after it has been unregistered.
+     * This design choice makes it easier for clients of {@link CancellationSignal} to
+     * prevent race conditions related to listener registration and unregistration.
+     *
+     * @param listener The cancellation listener, or null to remove the current listener.
+     */
+    public void setOnCancelListener(OnCancelListener listener) {
+        synchronized (this) {
+            mOnCancelListener = listener;
+            if (mIsCanceled && listener != null) {
+                listener.onCancel();
+            }
+        }
+    }
+
+    /**
+     * Sets the remote transport.
+     *
+     * @param remote The remote transport, or null to remove.
+     *
+     * @hide
+     */
+    public void setRemote(ICancellationSignal remote) {
+        synchronized (this) {
+            mRemote = remote;
+            if (mIsCanceled && remote != null) {
+                try {
+                    remote.cancel();
+                } catch (RemoteException ex) {
+                }
+            }
+        }
+    }
+
+    /**
+     * Creates a transport that can be returned back to the caller of
+     * a Binder function and subsequently used to dispatch a cancellation signal.
+     *
+     * @return The new cancellation signal transport.
+     *
+     * @hide
+     */
+    public static ICancellationSignal createTransport() {
+        return new Transport();
+    }
+
+    /**
+     * Given a locally created transport, returns its associated cancellation signal.
+     *
+     * @param transport The locally created transport, or null if none.
+     * @return The associated cancellation signal, or null if none.
+     *
+     * @hide
+     */
+    public static CancellationSignal fromTransport(ICancellationSignal transport) {
+        if (transport instanceof Transport) {
+            return ((Transport)transport).mCancellationSignal;
+        }
+        return null;
+    }
+
+    /**
+     * Listens for cancellation.
+     */
+    public interface OnCancelListener {
+        /**
+         * Called when {@link CancellationSignal#cancel} is invoked.
+         */
+        void onCancel();
+    }
+
+    private static final class Transport extends ICancellationSignal.Stub {
+        final CancellationSignal mCancellationSignal = new CancellationSignal();
+
+        @Override
+        public void cancel() throws RemoteException {
+            mCancellationSignal.cancel();
+        }
+    }
+}
diff --git a/core/java/android/content/ContentProvider.java b/core/java/android/content/ContentProvider.java
index 116ca48..12e3ccf 100644
--- a/core/java/android/content/ContentProvider.java
+++ b/core/java/android/content/ContentProvider.java
@@ -29,6 +29,7 @@
 import android.os.Bundle;
 import android.os.ParcelFileDescriptor;
 import android.os.Process;
+import android.os.RemoteException;
 import android.util.Log;
 
 import java.io.File;
@@ -174,28 +175,33 @@
             return getContentProvider().getClass().getName();
         }
 
+        @Override
         public Cursor query(Uri uri, String[] projection,
-                String selection, String[] selectionArgs, String sortOrder) {
+                String selection, String[] selectionArgs, String sortOrder,
+                ICancellationSignal cancellationSignal) {
             enforceReadPermission(uri);
-            return ContentProvider.this.query(uri, projection, selection,
-                    selectionArgs, sortOrder);
+            return ContentProvider.this.query(uri, projection, selection, selectionArgs, sortOrder,
+                    CancellationSignal.fromTransport(cancellationSignal));
         }
 
+        @Override
         public String getType(Uri uri) {
             return ContentProvider.this.getType(uri);
         }
 
-
+        @Override
         public Uri insert(Uri uri, ContentValues initialValues) {
             enforceWritePermission(uri);
             return ContentProvider.this.insert(uri, initialValues);
         }
 
+        @Override
         public int bulkInsert(Uri uri, ContentValues[] initialValues) {
             enforceWritePermission(uri);
             return ContentProvider.this.bulkInsert(uri, initialValues);
         }
 
+        @Override
         public ContentProviderResult[] applyBatch(ArrayList<ContentProviderOperation> operations)
                 throws OperationApplicationException {
             for (ContentProviderOperation operation : operations) {
@@ -210,17 +216,20 @@
             return ContentProvider.this.applyBatch(operations);
         }
 
+        @Override
         public int delete(Uri uri, String selection, String[] selectionArgs) {
             enforceWritePermission(uri);
             return ContentProvider.this.delete(uri, selection, selectionArgs);
         }
 
+        @Override
         public int update(Uri uri, ContentValues values, String selection,
                 String[] selectionArgs) {
             enforceWritePermission(uri);
             return ContentProvider.this.update(uri, values, selection, selectionArgs);
         }
 
+        @Override
         public ParcelFileDescriptor openFile(Uri uri, String mode)
                 throws FileNotFoundException {
             if (mode != null && mode.startsWith("rw")) enforceWritePermission(uri);
@@ -228,6 +237,7 @@
             return ContentProvider.this.openFile(uri, mode);
         }
 
+        @Override
         public AssetFileDescriptor openAssetFile(Uri uri, String mode)
                 throws FileNotFoundException {
             if (mode != null && mode.startsWith("rw")) enforceWritePermission(uri);
@@ -235,6 +245,7 @@
             return ContentProvider.this.openAssetFile(uri, mode);
         }
 
+        @Override
         public Bundle call(String method, String arg, Bundle extras) {
             return ContentProvider.this.call(method, arg, extras);
         }
@@ -251,6 +262,11 @@
             return ContentProvider.this.openTypedAssetFile(uri, mimeType, opts);
         }
 
+        @Override
+        public ICancellationSignal createCancellationSignal() throws RemoteException {
+            return CancellationSignal.createTransport();
+        }
+
         private void enforceReadPermission(Uri uri) {
             final int uid = Binder.getCallingUid();
             if (uid == mMyUid) {
@@ -541,6 +557,75 @@
             String selection, String[] selectionArgs, String sortOrder);
 
     /**
+     * Implement this to handle query requests from clients with support for cancellation.
+     * This method can be called from multiple threads, as described in
+     * <a href="{@docRoot}guide/topics/fundamentals/processes-and-threads.html#Threads">Processes
+     * and Threads</a>.
+     * <p>
+     * Example client call:<p>
+     * <pre>// Request a specific record.
+     * Cursor managedCursor = managedQuery(
+                ContentUris.withAppendedId(Contacts.People.CONTENT_URI, 2),
+                projection,    // Which columns to return.
+                null,          // WHERE clause.
+                null,          // WHERE clause value substitution
+                People.NAME + " ASC");   // Sort order.</pre>
+     * Example implementation:<p>
+     * <pre>// SQLiteQueryBuilder is a helper class that creates the
+        // proper SQL syntax for us.
+        SQLiteQueryBuilder qBuilder = new SQLiteQueryBuilder();
+
+        // Set the table we're querying.
+        qBuilder.setTables(DATABASE_TABLE_NAME);
+
+        // If the query ends in a specific record number, we're
+        // being asked for a specific record, so set the
+        // WHERE clause in our query.
+        if((URI_MATCHER.match(uri)) == SPECIFIC_MESSAGE){
+            qBuilder.appendWhere("_id=" + uri.getPathLeafId());
+        }
+
+        // Make the query.
+        Cursor c = qBuilder.query(mDb,
+                projection,
+                selection,
+                selectionArgs,
+                groupBy,
+                having,
+                sortOrder);
+        c.setNotificationUri(getContext().getContentResolver(), uri);
+        return c;</pre>
+     * <p>
+     * If you implement this method then you must also implement the version of
+     * {@link #query(Uri, String[], String, String[], String)} that does not take a cancellation
+     * signal to ensure correct operation on older versions of the Android Framework in
+     * which the cancellation signal overload was not available.
+     *
+     * @param uri The URI to query. This will be the full URI sent by the client;
+     *      if the client is requesting a specific record, the URI will end in a record number
+     *      that the implementation should parse and add to a WHERE or HAVING clause, specifying
+     *      that _id value.
+     * @param projection The list of columns to put into the cursor. If
+     *      null all columns are included.
+     * @param selection A selection criteria to apply when filtering rows.
+     *      If null then all rows are included.
+     * @param selectionArgs You may include ?s in selection, which will be replaced by
+     *      the values from selectionArgs, in order that they appear in the selection.
+     *      The values will be bound as Strings.
+     * @param sortOrder How the rows in the cursor should be sorted.
+     *      If null then the provider is free to define the sort order.
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     * If the operation is canceled, then {@link OperationCanceledException} will be thrown
+     * when the query is executed.
+     * @return a Cursor or null.
+     */
+    public Cursor query(Uri uri, String[] projection,
+            String selection, String[] selectionArgs, String sortOrder,
+            CancellationSignal cancellationSignal) {
+        return query(uri, projection, selection, selectionArgs, sortOrder);
+    }
+
+    /**
      * Implement this to handle requests for the MIME type of the data at the
      * given URI.  The returned MIME type should start with
      * <code>vnd.android.cursor.item</code> for a single record,
diff --git a/core/java/android/content/ContentProviderClient.java b/core/java/android/content/ContentProviderClient.java
index 0540109..3ac5e07 100644
--- a/core/java/android/content/ContentProviderClient.java
+++ b/core/java/android/content/ContentProviderClient.java
@@ -47,7 +47,20 @@
     /** See {@link ContentProvider#query ContentProvider.query} */
     public Cursor query(Uri url, String[] projection, String selection,
             String[] selectionArgs, String sortOrder) throws RemoteException {
-        return mContentProvider.query(url, projection, selection,  selectionArgs, sortOrder);
+        return query(url, projection, selection,  selectionArgs, sortOrder, null);
+    }
+
+    /** See {@link ContentProvider#query ContentProvider.query} */
+    public Cursor query(Uri url, String[] projection, String selection,
+            String[] selectionArgs, String sortOrder, CancellationSignal cancellationSignal)
+                    throws RemoteException {
+        ICancellationSignal remoteCancellationSignal = null;
+        if (cancellationSignal != null) {
+            remoteCancellationSignal = mContentProvider.createCancellationSignal();
+            cancellationSignal.setRemote(remoteCancellationSignal);
+        }
+        return mContentProvider.query(url, projection, selection,  selectionArgs, sortOrder,
+                remoteCancellationSignal);
     }
 
     /** See {@link ContentProvider#getType ContentProvider.getType} */
diff --git a/core/java/android/content/ContentProviderNative.java b/core/java/android/content/ContentProviderNative.java
index b089bf2..eb83dbc 100644
--- a/core/java/android/content/ContentProviderNative.java
+++ b/core/java/android/content/ContentProviderNative.java
@@ -21,7 +21,6 @@
 import android.database.BulkCursorToCursorAdaptor;
 import android.database.Cursor;
 import android.database.CursorToBulkCursorAdaptor;
-import android.database.CursorWindow;
 import android.database.DatabaseUtils;
 import android.database.IBulkCursor;
 import android.database.IContentObserver;
@@ -41,8 +40,6 @@
  * {@hide}
  */
 abstract public class ContentProviderNative extends Binder implements IContentProvider {
-    private static final String TAG = "ContentProvider";
-
     public ContentProviderNative()
     {
         attachInterface(this, descriptor);
@@ -108,8 +105,11 @@
                     String sortOrder = data.readString();
                     IContentObserver observer = IContentObserver.Stub.asInterface(
                             data.readStrongBinder());
+                    ICancellationSignal cancellationSignal = ICancellationSignal.Stub.asInterface(
+                            data.readStrongBinder());
 
-                    Cursor cursor = query(url, projection, selection, selectionArgs, sortOrder);
+                    Cursor cursor = query(url, projection, selection, selectionArgs, sortOrder,
+                            cancellationSignal);
                     if (cursor != null) {
                         CursorToBulkCursorAdaptor adaptor = new CursorToBulkCursorAdaptor(
                                 cursor, observer, getProviderName());
@@ -295,6 +295,16 @@
                     }
                     return true;
                 }
+
+                case CREATE_CANCELATION_SIGNAL_TRANSACTION:
+                {
+                    data.enforceInterface(IContentProvider.descriptor);
+
+                    ICancellationSignal cancellationSignal = createCancellationSignal();
+                    reply.writeNoException();
+                    reply.writeStrongBinder(cancellationSignal.asBinder());
+                    return true;
+                }
             }
         } catch (Exception e) {
             DatabaseUtils.writeExceptionToParcel(reply, e);
@@ -324,7 +334,8 @@
     }
 
     public Cursor query(Uri url, String[] projection, String selection,
-            String[] selectionArgs, String sortOrder) throws RemoteException {
+            String[] selectionArgs, String sortOrder, ICancellationSignal cancellationSignal)
+                    throws RemoteException {
         BulkCursorToCursorAdaptor adaptor = new BulkCursorToCursorAdaptor();
         Parcel data = Parcel.obtain();
         Parcel reply = Parcel.obtain();
@@ -352,6 +363,7 @@
             }
             data.writeString(sortOrder);
             data.writeStrongBinder(adaptor.getObserver().asBinder());
+            data.writeStrongBinder(cancellationSignal != null ? cancellationSignal.asBinder() : null);
 
             mRemote.transact(IContentProvider.QUERY_TRANSACTION, data, reply, 0);
 
@@ -620,5 +632,24 @@
         }
     }
 
+    public ICancellationSignal createCancellationSignal() throws RemoteException {
+        Parcel data = Parcel.obtain();
+        Parcel reply = Parcel.obtain();
+        try {
+            data.writeInterfaceToken(IContentProvider.descriptor);
+
+            mRemote.transact(IContentProvider.CREATE_CANCELATION_SIGNAL_TRANSACTION,
+                    data, reply, 0);
+
+            DatabaseUtils.readExceptionFromParcel(reply);
+            ICancellationSignal cancellationSignal = ICancellationSignal.Stub.asInterface(
+                    reply.readStrongBinder());
+            return cancellationSignal;
+        } finally {
+            data.recycle();
+            reply.recycle();
+        }
+    }
+
     private IBinder mRemote;
 }
diff --git a/core/java/android/content/ContentResolver.java b/core/java/android/content/ContentResolver.java
index cc3219b..96a65da 100644
--- a/core/java/android/content/ContentResolver.java
+++ b/core/java/android/content/ContentResolver.java
@@ -22,6 +22,7 @@
 import android.app.ActivityManagerNative;
 import android.app.ActivityThread;
 import android.app.AppGlobals;
+import android.content.ContentProvider.Transport;
 import android.content.pm.PackageManager.NameNotFoundException;
 import android.content.res.AssetFileDescriptor;
 import android.content.res.Resources;
@@ -302,13 +303,62 @@
      */
     public final Cursor query(Uri uri, String[] projection,
             String selection, String[] selectionArgs, String sortOrder) {
+        return query(uri, projection, selection, selectionArgs, sortOrder, null);
+    }
+
+    /**
+     * <p>
+     * Query the given URI, returning a {@link Cursor} over the result set.
+     * </p>
+     * <p>
+     * For best performance, the caller should follow these guidelines:
+     * <ul>
+     * <li>Provide an explicit projection, to prevent
+     * reading data from storage that aren't going to be used.</li>
+     * <li>Use question mark parameter markers such as 'phone=?' instead of
+     * explicit values in the {@code selection} parameter, so that queries
+     * that differ only by those values will be recognized as the same
+     * for caching purposes.</li>
+     * </ul>
+     * </p>
+     *
+     * @param uri The URI, using the content:// scheme, for the content to
+     *         retrieve.
+     * @param projection A list of which columns to return. Passing null will
+     *         return all columns, which is inefficient.
+     * @param selection A filter declaring which rows to return, formatted as an
+     *         SQL WHERE clause (excluding the WHERE itself). Passing null will
+     *         return all rows for the given URI.
+     * @param selectionArgs You may include ?s in selection, which will be
+     *         replaced by the values from selectionArgs, in the order that they
+     *         appear in the selection. The values will be bound as Strings.
+     * @param sortOrder How to order the rows, formatted as an SQL ORDER BY
+     *         clause (excluding the ORDER BY itself). Passing null will use the
+     *         default sort order, which may be unordered.
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     * If the operation is canceled, then {@link OperationCanceledException} will be thrown
+     * when the query is executed.
+     * @return A Cursor object, which is positioned before the first entry, or null
+     * @see Cursor
+     */
+    public final Cursor query(final Uri uri, String[] projection,
+            String selection, String[] selectionArgs, String sortOrder,
+            CancellationSignal cancellationSignal) {
         IContentProvider provider = acquireProvider(uri);
         if (provider == null) {
             return null;
         }
         try {
             long startTime = SystemClock.uptimeMillis();
-            Cursor qCursor = provider.query(uri, projection, selection, selectionArgs, sortOrder);
+
+            ICancellationSignal remoteCancellationSignal = null;
+            if (cancellationSignal != null) {
+                cancellationSignal.throwIfCanceled();
+                remoteCancellationSignal = provider.createCancellationSignal();
+                cancellationSignal.setRemote(remoteCancellationSignal);
+            }
+            Cursor qCursor = provider.query(uri, projection,
+                    selection, selectionArgs, sortOrder, remoteCancellationSignal);
             if (qCursor == null) {
                 releaseProvider(provider);
                 return null;
@@ -1034,8 +1084,11 @@
      * To register, call {@link #registerContentObserver(android.net.Uri , boolean, android.database.ContentObserver) registerContentObserver()}.
      * By default, CursorAdapter objects will get this notification.
      *
-     * @param uri
-     * @param observer The observer that originated the change, may be <code>null</null>
+     * @param uri The uri of the content that was changed.
+     * @param observer The observer that originated the change, may be <code>null</null>.
+     * The observer that originated the change will only receive the notification if it
+     * has requested to receive self-change notifications by implementing
+     * {@link ContentObserver#deliverSelfNotifications()} to return true.
      */
     public void notifyChange(Uri uri, ContentObserver observer) {
         notifyChange(uri, observer, true /* sync to network */);
@@ -1046,8 +1099,11 @@
      * To register, call {@link #registerContentObserver(android.net.Uri , boolean, android.database.ContentObserver) registerContentObserver()}.
      * By default, CursorAdapter objects will get this notification.
      *
-     * @param uri
-     * @param observer The observer that originated the change, may be <code>null</null>
+     * @param uri The uri of the content that was changed.
+     * @param observer The observer that originated the change, may be <code>null</null>.
+     * The observer that originated the change will only receive the notification if it
+     * has requested to receive self-change notifications by implementing
+     * {@link ContentObserver#deliverSelfNotifications()} to return true.
      * @param syncToNetwork If true, attempt to sync the change to the network.
      */
     public void notifyChange(Uri uri, ContentObserver observer, boolean syncToNetwork) {
diff --git a/core/java/android/content/ContentService.java b/core/java/android/content/ContentService.java
index 0e83dc0..fc4c262 100644
--- a/core/java/android/content/ContentService.java
+++ b/core/java/android/content/ContentService.java
@@ -176,7 +176,7 @@
             for (int i=0; i<numCalls; i++) {
                 ObserverCall oc = calls.get(i);
                 try {
-                    oc.mObserver.onChange(oc.mSelfNotify);
+                    oc.mObserver.onChange(oc.mSelfChange, uri);
                     if (Log.isLoggable(TAG, Log.VERBOSE)) {
                         Log.v(TAG, "Notified " + oc.mObserver + " of " + "update at " + uri);
                     }
@@ -218,13 +218,12 @@
     public static final class ObserverCall {
         final ObserverNode mNode;
         final IContentObserver mObserver;
-        final boolean mSelfNotify;
+        final boolean mSelfChange;
 
-        ObserverCall(ObserverNode node, IContentObserver observer,
-                boolean selfNotify) {
+        ObserverCall(ObserverNode node, IContentObserver observer, boolean selfChange) {
             mNode = node;
             mObserver = observer;
-            mSelfNotify = selfNotify;
+            mSelfChange = selfChange;
         }
     }
 
@@ -668,7 +667,7 @@
         }
 
         private void collectMyObserversLocked(boolean leaf, IContentObserver observer,
-                boolean selfNotify, ArrayList<ObserverCall> calls) {
+                boolean observerWantsSelfNotifications, ArrayList<ObserverCall> calls) {
             int N = mObservers.size();
             IBinder observerBinder = observer == null ? null : observer.asBinder();
             for (int i = 0; i < N; i++) {
@@ -676,28 +675,29 @@
 
                 // Don't notify the observer if it sent the notification and isn't interesed
                 // in self notifications
-                if (entry.observer.asBinder() == observerBinder && !selfNotify) {
+                boolean selfChange = (entry.observer.asBinder() == observerBinder);
+                if (selfChange && !observerWantsSelfNotifications) {
                     continue;
                 }
 
                 // Make sure the observer is interested in the notification
                 if (leaf || (!leaf && entry.notifyForDescendents)) {
-                    calls.add(new ObserverCall(this, entry.observer, selfNotify));
+                    calls.add(new ObserverCall(this, entry.observer, selfChange));
                 }
             }
         }
 
         public void collectObserversLocked(Uri uri, int index, IContentObserver observer,
-                boolean selfNotify, ArrayList<ObserverCall> calls) {
+                boolean observerWantsSelfNotifications, ArrayList<ObserverCall> calls) {
             String segment = null;
             int segmentCount = countUriSegments(uri);
             if (index >= segmentCount) {
                 // This is the leaf node, notify all observers
-                collectMyObserversLocked(true, observer, selfNotify, calls);
+                collectMyObserversLocked(true, observer, observerWantsSelfNotifications, calls);
             } else if (index < segmentCount){
                 segment = getUriSegment(uri, index);
                 // Notify any observers at this level who are interested in descendents
-                collectMyObserversLocked(false, observer, selfNotify, calls);
+                collectMyObserversLocked(false, observer, observerWantsSelfNotifications, calls);
             }
 
             int N = mChildren.size();
@@ -705,7 +705,8 @@
                 ObserverNode node = mChildren.get(i);
                 if (segment == null || node.mName.equals(segment)) {
                     // We found the child,
-                    node.collectObserversLocked(uri, index + 1, observer, selfNotify, calls);
+                    node.collectObserversLocked(uri, index + 1,
+                            observer, observerWantsSelfNotifications, calls);
                     if (segment != null) {
                         break;
                     }
diff --git a/core/java/android/content/CursorLoader.java b/core/java/android/content/CursorLoader.java
index 7af535b..aed3728 100644
--- a/core/java/android/content/CursorLoader.java
+++ b/core/java/android/content/CursorLoader.java
@@ -19,7 +19,6 @@
 import android.database.ContentObserver;
 import android.database.Cursor;
 import android.net.Uri;
-import android.os.AsyncTask;
 
 import java.io.FileDescriptor;
 import java.io.PrintWriter;
@@ -49,18 +48,42 @@
     String mSortOrder;
 
     Cursor mCursor;
+    CancellationSignal mCancellationSignal;
 
     /* Runs on a worker thread */
     @Override
     public Cursor loadInBackground() {
-        Cursor cursor = getContext().getContentResolver().query(mUri, mProjection, mSelection,
-                mSelectionArgs, mSortOrder);
-        if (cursor != null) {
-            // Ensure the cursor window is filled
-            cursor.getCount();
-            registerContentObserver(cursor, mObserver);
+        synchronized (this) {
+            if (isLoadInBackgroundCanceled()) {
+                throw new OperationCanceledException();
+            }
+            mCancellationSignal = new CancellationSignal();
         }
-        return cursor;
+        try {
+            Cursor cursor = getContext().getContentResolver().query(mUri, mProjection, mSelection,
+                    mSelectionArgs, mSortOrder, mCancellationSignal);
+            if (cursor != null) {
+                // Ensure the cursor window is filled
+                cursor.getCount();
+                registerContentObserver(cursor, mObserver);
+            }
+            return cursor;
+        } finally {
+            synchronized (this) {
+                mCancellationSignal = null;
+            }
+        }
+    }
+
+    @Override
+    public void cancelLoadInBackground() {
+        super.cancelLoadInBackground();
+
+        synchronized (this) {
+            if (mCancellationSignal != null) {
+                mCancellationSignal.cancel();
+            }
+        }
     }
 
     /**
diff --git a/core/java/android/content/ICancellationSignal.aidl b/core/java/android/content/ICancellationSignal.aidl
new file mode 100644
index 0000000..cf1c5d3
--- /dev/null
+++ b/core/java/android/content/ICancellationSignal.aidl
@@ -0,0 +1,24 @@
+/*
+ * 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.content;
+
+/**
+ * @hide
+ */
+interface ICancellationSignal {
+    oneway void cancel();
+}
diff --git a/core/java/android/content/IContentProvider.java b/core/java/android/content/IContentProvider.java
index 2a67ff8..16478b7 100644
--- a/core/java/android/content/IContentProvider.java
+++ b/core/java/android/content/IContentProvider.java
@@ -34,7 +34,8 @@
  */
 public interface IContentProvider extends IInterface {
     public Cursor query(Uri url, String[] projection, String selection,
-            String[] selectionArgs, String sortOrder) throws RemoteException;
+            String[] selectionArgs, String sortOrder, ICancellationSignal cancellationSignal)
+                    throws RemoteException;
     public String getType(Uri url) throws RemoteException;
     public Uri insert(Uri url, ContentValues initialValues)
             throws RemoteException;
@@ -50,6 +51,7 @@
     public ContentProviderResult[] applyBatch(ArrayList<ContentProviderOperation> operations)
             throws RemoteException, OperationApplicationException;
     public Bundle call(String method, String arg, Bundle extras) throws RemoteException;
+    public ICancellationSignal createCancellationSignal() throws RemoteException;
 
     // Data interchange.
     public String[] getStreamTypes(Uri url, String mimeTypeFilter) throws RemoteException;
@@ -71,4 +73,5 @@
     static final int CALL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 20;
     static final int GET_STREAM_TYPES_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 21;
     static final int OPEN_TYPED_ASSET_FILE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 22;
+    static final int CREATE_CANCELATION_SIGNAL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 23;
 }
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index e3b1f54..ab62c44 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -43,6 +43,7 @@
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.Locale;
 import java.util.Set;
 
 /**
@@ -2956,6 +2957,13 @@
      */
     public static final int FLAG_RECEIVER_REPLACE_PENDING = 0x20000000;
     /**
+     * If set, when sending a broadcast the recipient is allowed to run at
+     * foreground priority, with a shorter timeout interval.  During normal
+     * broadcasts the receivers are not automatically hoisted out of the
+     * background priority class.
+     */
+    public static final int FLAG_RECEIVER_FOREGROUND = 0x10000000;
+    /**
      * If set, when sending a broadcast <i>before boot has completed</i> only
      * registered receivers will be called -- no BroadcastReceiver components
      * will be launched.  Sticky intent state will be recorded properly even
@@ -2968,14 +2976,14 @@
      *
      * @hide
      */
-    public static final int FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT = 0x10000000;
+    public static final int FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT = 0x08000000;
     /**
      * Set when this broadcast is for a boot upgrade, a special mode that
      * allows the broadcast to be sent before the system is ready and launches
      * the app process with no providers running in it.
      * @hide
      */
-    public static final int FLAG_RECEIVER_BOOT_UPGRADE = 0x08000000;
+    public static final int FLAG_RECEIVER_BOOT_UPGRADE = 0x04000000;
 
     /**
      * @hide Flags that can't be changed with PendingIntent.
@@ -4420,22 +4428,24 @@
 
     /**
      * Set the data this intent is operating on.  This method automatically
-     * clears any type that was previously set by {@link #setType}.
+     * clears any type that was previously set by {@link #setType} or
+     * {@link #setTypeAndNormalize}.
      *
-     * <p><em>Note: scheme and host name matching in the Android framework is
-     * case-sensitive, unlike the formal RFC.  As a result,
-     * you should always ensure that you write your Uri with these elements
-     * using lower case letters, and normalize any Uris you receive from
-     * outside of Android to ensure the scheme and host is lower case.</em></p>
+     * <p><em>Note: scheme matching in the Android framework is
+     * case-sensitive, unlike the formal RFC. As a result,
+     * you should always write your Uri with a lower case scheme,
+     * or use {@link Uri#normalize} or
+     * {@link #setDataAndNormalize}
+     * to ensure that the scheme is converted to lower case.</em>
      *
-     * @param data The URI of the data this intent is now targeting.
+     * @param data The Uri of the data this intent is now targeting.
      *
      * @return Returns the same Intent object, for chaining multiple calls
      * into a single statement.
      *
      * @see #getData
-     * @see #setType
-     * @see #setDataAndType
+     * @see #setDataAndNormalize
+     * @see android.net.Intent#normalize
      */
     public Intent setData(Uri data) {
         mData = data;
@@ -4444,16 +4454,45 @@
     }
 
     /**
-     * Set an explicit MIME data type.  This is used to create intents that
-     * only specify a type and not data, for example to indicate the type of
-     * data to return.  This method automatically clears any data that was
-     * previously set by {@link #setData}.
+     * Normalize and set the data this intent is operating on.
+     *
+     * <p>This method automatically clears any type that was
+     * previously set (for example, by {@link #setType}).
+     *
+     * <p>The data Uri is normalized using
+     * {@link android.net.Uri#normalize} before it is set,
+     * so really this is just a convenience method for
+     * <pre>
+     * setData(data.normalize())
+     * </pre>
+     *
+     * @param data The Uri of the data this intent is now targeting.
+     *
+     * @return Returns the same Intent object, for chaining multiple calls
+     * into a single statement.
+     *
+     * @see #getData
+     * @see #setType
+     * @see android.net.Uri#normalize
+     */
+    public Intent setDataAndNormalize(Uri data) {
+        return setData(data.normalize());
+    }
+
+    /**
+     * Set an explicit MIME data type.
+     *
+     * <p>This is used to create intents that only specify a type and not data,
+     * for example to indicate the type of data to return.
+     *
+     * <p>This method automatically clears any data that was
+     * previously set (for example by {@link #setData}).
      *
      * <p><em>Note: MIME type matching in the Android framework is
      * case-sensitive, unlike formal RFC MIME types.  As a result,
      * you should always write your MIME types with lower case letters,
-     * and any MIME types you receive from outside of Android should be
-     * converted to lower case before supplying them here.</em></p>
+     * or use {@link #normalizeMimeType} or {@link #setTypeAndNormalize}
+     * to ensure that it is converted to lower case.</em>
      *
      * @param type The MIME type of the data being handled by this intent.
      *
@@ -4461,8 +4500,9 @@
      * into a single statement.
      *
      * @see #getType
-     * @see #setData
+     * @see #setTypeAndNormalize
      * @see #setDataAndType
+     * @see #normalizeMimeType
      */
     public Intent setType(String type) {
         mData = null;
@@ -4471,26 +4511,58 @@
     }
 
     /**
-     * (Usually optional) Set the data for the intent along with an explicit
-     * MIME data type.  This method should very rarely be used -- it allows you
-     * to override the MIME type that would ordinarily be inferred from the
-     * data with your own type given here.
+     * Normalize and set an explicit MIME data type.
      *
-     * <p><em>Note: MIME type, Uri scheme, and host name matching in the
-     * Android framework is case-sensitive, unlike the formal RFC definitions.
-     * As a result, you should always write these elements with lower case letters,
-     * and normalize any MIME types or Uris you receive from
-     * outside of Android to ensure these elements are lower case before
-     * supplying them here.</em></p>
+     * <p>This is used to create intents that only specify a type and not data,
+     * for example to indicate the type of data to return.
      *
-     * @param data The URI of the data this intent is now targeting.
+     * <p>This method automatically clears any data that was
+     * previously set (for example by {@link #setData}).
+     *
+     * <p>The MIME type is normalized using
+     * {@link #normalizeMimeType} before it is set,
+     * so really this is just a convenience method for
+     * <pre>
+     * setType(Intent.normalizeMimeType(type))
+     * </pre>
+     *
      * @param type The MIME type of the data being handled by this intent.
      *
      * @return Returns the same Intent object, for chaining multiple calls
      * into a single statement.
      *
+     * @see #getType
      * @see #setData
+     * @see #normalizeMimeType
+     */
+    public Intent setTypeAndNormalize(String type) {
+        return setType(normalizeMimeType(type));
+    }
+
+    /**
+     * (Usually optional) Set the data for the intent along with an explicit
+     * MIME data type.  This method should very rarely be used -- it allows you
+     * to override the MIME type that would ordinarily be inferred from the
+     * data with your own type given here.
+     *
+     * <p><em>Note: MIME type and Uri scheme matching in the
+     * Android framework is case-sensitive, unlike the formal RFC definitions.
+     * As a result, you should always write these elements with lower case letters,
+     * or use {@link #normalizeMimeType} or {@link android.net.Uri#normalize} or
+     * {@link #setDataAndTypeAndNormalize}
+     * to ensure that they are converted to lower case.</em>
+     *
+     * @param data The Uri of the data this intent is now targeting.
+     * @param type The MIME type of the data being handled by this intent.
+     *
+     * @return Returns the same Intent object, for chaining multiple calls
+     * into a single statement.
+     *
      * @see #setType
+     * @see #setData
+     * @see #normalizeMimeType
+     * @see android.net.Uri#normalize
+     * @see #setDataAndTypeAndNormalize
      */
     public Intent setDataAndType(Uri data, String type) {
         mData = data;
@@ -4499,6 +4571,35 @@
     }
 
     /**
+     * (Usually optional) Normalize and set both the data Uri and an explicit
+     * MIME data type.  This method should very rarely be used -- it allows you
+     * to override the MIME type that would ordinarily be inferred from the
+     * data with your own type given here.
+     *
+     * <p>The data Uri and the MIME type are normalize using
+     * {@link android.net.Uri#normalize} and {@link #normalizeMimeType}
+     * before they are set, so really this is just a convenience method for
+     * <pre>
+     * setDataAndType(data.normalize(), Intent.normalizeMimeType(type))
+     * </pre>
+     *
+     * @param data The Uri of the data this intent is now targeting.
+     * @param type The MIME type of the data being handled by this intent.
+     *
+     * @return Returns the same Intent object, for chaining multiple calls
+     * into a single statement.
+     *
+     * @see #setType
+     * @see #setData
+     * @see #setDataAndType
+     * @see #normalizeMimeType
+     * @see android.net.Uri#normalize
+     */
+    public Intent setDataAndTypeAndNormalize(Uri data, String type) {
+        return setDataAndType(data.normalize(), normalizeMimeType(type));
+    }
+
+    /**
      * Add a new category to the intent.  Categories provide additional detail
      * about the action the intent is perform.  When resolving an intent, only
      * activities that provide <em>all</em> of the requested categories will be
@@ -5566,7 +5667,7 @@
      *
      * <ul>
      * <li> action, as set by {@link #setAction}.
-     * <li> data URI and MIME type, as set by {@link #setData(Uri)},
+     * <li> data Uri and MIME type, as set by {@link #setData(Uri)},
      * {@link #setType(String)}, or {@link #setDataAndType(Uri, String)}.
      * <li> categories, as set by {@link #addCategory}.
      * <li> package, as set by {@link #setPackage}.
@@ -6229,4 +6330,38 @@
 
         return intent;
     }
+
+    /**
+     * Normalize a MIME data type.
+     *
+     * <p>A normalized MIME type has white-space trimmed,
+     * content-type parameters removed, and is lower-case.
+     * This aligns the type with Android best practices for
+     * intent filtering.
+     *
+     * <p>For example, "text/plain; charset=utf-8" becomes "text/plain".
+     * "text/x-vCard" becomes "text/x-vcard".
+     *
+     * <p>All MIME types received from outside Android (such as user input,
+     * or external sources like Bluetooth, NFC, or the Internet) should
+     * be normalized before they are used to create an Intent.
+     *
+     * @param type MIME data type to normalize
+     * @return normalized MIME data type, or null if the input was null
+     * @see {@link #setType}
+     * @see {@link #setTypeAndNormalize}
+     */
+    public static String normalizeMimeType(String type) {
+        if (type == null) {
+            return null;
+        }
+
+        type = type.trim().toLowerCase(Locale.US);
+
+        final int semicolonIndex = type.indexOf(';');
+        if (semicolonIndex != -1) {
+            type = type.substring(0, semicolonIndex);
+        }
+        return type;
+    }
 }
diff --git a/core/java/android/content/Loader.java b/core/java/android/content/Loader.java
index ac05682..3052414 100644
--- a/core/java/android/content/Loader.java
+++ b/core/java/android/content/Loader.java
@@ -52,6 +52,7 @@
 public class Loader<D> {
     int mId;
     OnLoadCompleteListener<D> mListener;
+    OnLoadCanceledListener<D> mOnLoadCanceledListener;
     Context mContext;
     boolean mStarted = false;
     boolean mAbandoned = false;
@@ -100,6 +101,23 @@
     }
 
     /**
+     * Interface that is implemented to discover when a Loader has been canceled
+     * before it finished loading its data.  You do not normally need to implement
+     * this yourself; it is used in the implementation of {@link android.app.LoaderManager}
+     * to find out when a Loader it is managing has been canceled so that it
+     * can schedule the next Loader.  This interface should only be used if a
+     * Loader is not being used in conjunction with LoaderManager.
+     */
+    public interface OnLoadCanceledListener<D> {
+        /**
+         * Called on the thread that created the Loader when the load is canceled.
+         *
+         * @param loader the loader that canceled the load
+         */
+        public void onLoadCanceled(Loader<D> loader);
+    }
+
+    /**
      * Stores away the application context associated with context.
      * Since Loaders can be used across multiple activities it's dangerous to
      * store the context directly; always use {@link #getContext()} to retrieve
@@ -127,6 +145,18 @@
     }
 
     /**
+     * Informs the registered {@link OnLoadCanceledListener} that the load has been canceled.
+     * Should only be called by subclasses.
+     *
+     * Must be called from the process's main thread.
+     */
+    public void deliverCancellation() {
+        if (mOnLoadCanceledListener != null) {
+            mOnLoadCanceledListener.onLoadCanceled(this);
+        }
+    }
+
+    /**
      * @return an application context retrieved from the Context passed to the constructor.
      */
     public Context getContext() {
@@ -171,6 +201,40 @@
     }
 
     /**
+     * Registers a listener that will receive callbacks when a load is canceled.
+     * The callback will be called on the process's main thread so it's safe to
+     * pass the results to widgets.
+     *
+     * Must be called from the process's main thread.
+     *
+     * @param listener The listener to register.
+     */
+    public void registerOnLoadCanceledListener(OnLoadCanceledListener<D> listener) {
+        if (mOnLoadCanceledListener != null) {
+            throw new IllegalStateException("There is already a listener registered");
+        }
+        mOnLoadCanceledListener = listener;
+    }
+
+    /**
+     * Unregisters a listener that was previously added with
+     * {@link #registerOnLoadCanceledListener}.
+     *
+     * Must be called from the process's main thread.
+     *
+     * @param listener The listener to unregister.
+     */
+    public void unregisterOnLoadCanceledListener(OnLoadCanceledListener<D> listener) {
+        if (mOnLoadCanceledListener == null) {
+            throw new IllegalStateException("No listener register");
+        }
+        if (mOnLoadCanceledListener != listener) {
+            throw new IllegalArgumentException("Attempting to unregister the wrong listener");
+        }
+        mOnLoadCanceledListener = null;
+    }
+
+    /**
      * Return whether this load has been started.  That is, its {@link #startLoading()}
      * has been called and no calls to {@link #stopLoading()} or
      * {@link #reset()} have yet been made.
@@ -234,6 +298,43 @@
     }
 
     /**
+     * Attempt to cancel the current load task.
+     * Must be called on the main thread of the process.
+     *
+     * <p>Cancellation is not an immediate operation, since the load is performed
+     * in a background thread.  If there is currently a load in progress, this
+     * method requests that the load be canceled, and notes this is the case;
+     * once the background thread has completed its work its remaining state
+     * will be cleared.  If another load request comes in during this time,
+     * it will be held until the canceled load is complete.
+     *
+     * @return Returns <tt>false</tt> if the task could not be canceled,
+     * typically because it has already completed normally, or
+     * because {@link #startLoading()} hasn't been called; returns
+     * <tt>true</tt> otherwise.  When <tt>true</tt> is returned, the task
+     * is still running and the {@link OnLoadCanceledListener} will be called
+     * when the task completes.
+     */
+    public boolean cancelLoad() {
+        return onCancelLoad();
+    }
+
+    /**
+     * Subclasses must implement this to take care of requests to {@link #cancelLoad()}.
+     * This will always be called from the process's main thread.
+     *
+     * @return Returns <tt>false</tt> if the task could not be canceled,
+     * typically because it has already completed normally, or
+     * because {@link #startLoading()} hasn't been called; returns
+     * <tt>true</tt> otherwise.  When <tt>true</tt> is returned, the task
+     * is still running and the {@link OnLoadCanceledListener} will be called
+     * when the task completes.
+     */
+    protected boolean onCancelLoad() {
+        return false;
+    }
+
+    /**
      * Force an asynchronous load. Unlike {@link #startLoading()} this will ignore a previously
      * loaded data set and load a new one.  This simply calls through to the
      * implementation's {@link #onForceLoad()}.  You generally should only call this
diff --git a/core/java/android/content/OperationCanceledException.java b/core/java/android/content/OperationCanceledException.java
new file mode 100644
index 0000000..d783a07
--- /dev/null
+++ b/core/java/android/content/OperationCanceledException.java
@@ -0,0 +1,32 @@
+/*
+ * 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.content;
+
+/**
+ * An exception type that is thrown when an operation in progress is canceled.
+ *
+ * @see CancellationSignal
+ */
+public class OperationCanceledException extends RuntimeException {
+    public OperationCanceledException() {
+        this(null);
+    }
+
+    public OperationCanceledException(String message) {
+        super(message != null ? message : "The operation has been canceled.");
+    }
+}
diff --git a/core/java/android/content/SyncManager.java b/core/java/android/content/SyncManager.java
index 3c4e545..ba24036 100644
--- a/core/java/android/content/SyncManager.java
+++ b/core/java/android/content/SyncManager.java
@@ -1034,6 +1034,7 @@
 
     protected void dumpSyncState(PrintWriter pw) {
         pw.print("data connected: "); pw.println(mDataConnectionIsConnected);
+        pw.print("auto sync: "); pw.println(mSyncStorageEngine.getMasterSyncAutomatically());
         pw.print("memory low: "); pw.println(mStorageIsLow);
 
         final Account[] accounts = mAccounts;
@@ -1272,57 +1273,17 @@
 
             }
 
-            pw.println();
-            pw.printf("Detailed Statistics (Recent history):  %d (# of times) %ds (sync time)\n",
-                    totalTimes, totalElapsedTime / 1000);
+            if (totalElapsedTime > 0) {
+                pw.println();
+                pw.printf("Detailed Statistics (Recent history):  "
+                        + "%d (# of times) %ds (sync time)\n",
+                        totalTimes, totalElapsedTime / 1000);
 
-            final List<AuthoritySyncStats> sortedAuthorities =
-                    new ArrayList<AuthoritySyncStats>(authorityMap.values());
-            Collections.sort(sortedAuthorities, new Comparator<AuthoritySyncStats>() {
-                @Override
-                public int compare(AuthoritySyncStats lhs, AuthoritySyncStats rhs) {
-                    // reverse order
-                    int compare = Integer.compare(rhs.times, lhs.times);
-                    if (compare == 0) {
-                        compare = Long.compare(rhs.elapsedTime, lhs.elapsedTime);
-                    }
-                    return compare;
-                }
-            });
-
-            final int maxLength = Math.max(maxAuthority, maxAccount + 3);
-            final int padLength = 2 + 2 + maxLength + 2 + 10 + 11;
-            final char chars[] = new char[padLength];
-            Arrays.fill(chars, '-');
-            final String separator = new String(chars);
-
-            final String authorityFormat = String.format("  %%-%ds: %%-9s  %%-11s\n", maxLength + 2);
-            final String accountFormat = String.format("    %%-%ds:   %%-9s  %%-11s\n", maxLength);
-
-            pw.println(separator);
-            for (AuthoritySyncStats authoritySyncStats : sortedAuthorities) {
-                String name = authoritySyncStats.name;
-                long elapsedTime;
-                int times;
-                String timeStr;
-                String timesStr;
-
-                elapsedTime = authoritySyncStats.elapsedTime;
-                times = authoritySyncStats.times;
-                timeStr = String.format("%ds/%d%%",
-                        elapsedTime / 1000,
-                        elapsedTime * 100 / totalElapsedTime);
-                timesStr = String.format("%d/%d%%",
-                        times,
-                        times * 100 / totalTimes);
-                pw.printf(authorityFormat, name, timesStr, timeStr);
-
-                final List<AccountSyncStats> sortedAccounts =
-                        new ArrayList<AccountSyncStats>(
-                                authoritySyncStats.accountMap.values());
-                Collections.sort(sortedAccounts, new Comparator<AccountSyncStats>() {
+                final List<AuthoritySyncStats> sortedAuthorities =
+                        new ArrayList<AuthoritySyncStats>(authorityMap.values());
+                Collections.sort(sortedAuthorities, new Comparator<AuthoritySyncStats>() {
                     @Override
-                    public int compare(AccountSyncStats lhs, AccountSyncStats rhs) {
+                    public int compare(AuthoritySyncStats lhs, AuthoritySyncStats rhs) {
                         // reverse order
                         int compare = Integer.compare(rhs.times, lhs.times);
                         if (compare == 0) {
@@ -1331,18 +1292,63 @@
                         return compare;
                     }
                 });
-                for (AccountSyncStats stats: sortedAccounts) {
-                    elapsedTime = stats.elapsedTime;
-                    times = stats.times;
+
+                final int maxLength = Math.max(maxAuthority, maxAccount + 3);
+                final int padLength = 2 + 2 + maxLength + 2 + 10 + 11;
+                final char chars[] = new char[padLength];
+                Arrays.fill(chars, '-');
+                final String separator = new String(chars);
+
+                final String authorityFormat =
+                        String.format("  %%-%ds: %%-9s  %%-11s\n", maxLength + 2);
+                final String accountFormat =
+                        String.format("    %%-%ds:   %%-9s  %%-11s\n", maxLength);
+
+                pw.println(separator);
+                for (AuthoritySyncStats authoritySyncStats : sortedAuthorities) {
+                    String name = authoritySyncStats.name;
+                    long elapsedTime;
+                    int times;
+                    String timeStr;
+                    String timesStr;
+
+                    elapsedTime = authoritySyncStats.elapsedTime;
+                    times = authoritySyncStats.times;
                     timeStr = String.format("%ds/%d%%",
                             elapsedTime / 1000,
                             elapsedTime * 100 / totalElapsedTime);
                     timesStr = String.format("%d/%d%%",
                             times,
                             times * 100 / totalTimes);
-                    pw.printf(accountFormat, stats.name, timesStr, timeStr);
+                    pw.printf(authorityFormat, name, timesStr, timeStr);
+
+                    final List<AccountSyncStats> sortedAccounts =
+                            new ArrayList<AccountSyncStats>(
+                                    authoritySyncStats.accountMap.values());
+                    Collections.sort(sortedAccounts, new Comparator<AccountSyncStats>() {
+                        @Override
+                        public int compare(AccountSyncStats lhs, AccountSyncStats rhs) {
+                            // reverse order
+                            int compare = Integer.compare(rhs.times, lhs.times);
+                            if (compare == 0) {
+                                compare = Long.compare(rhs.elapsedTime, lhs.elapsedTime);
+                            }
+                            return compare;
+                        }
+                    });
+                    for (AccountSyncStats stats: sortedAccounts) {
+                        elapsedTime = stats.elapsedTime;
+                        times = stats.times;
+                        timeStr = String.format("%ds/%d%%",
+                                elapsedTime / 1000,
+                                elapsedTime * 100 / totalElapsedTime);
+                        timesStr = String.format("%d/%d%%",
+                                times,
+                                times * 100 / totalTimes);
+                        pw.printf(accountFormat, stats.name, timesStr, timeStr);
+                    }
+                    pw.println(separator);
                 }
-                pw.println(separator);
             }
 
             pw.println();
diff --git a/core/java/android/content/pm/IPackageManager.aidl b/core/java/android/content/pm/IPackageManager.aidl
index decb974..bb35c29 100644
--- a/core/java/android/content/pm/IPackageManager.aidl
+++ b/core/java/android/content/pm/IPackageManager.aidl
@@ -364,4 +364,6 @@
     VerifierDeviceIdentity getVerifierDeviceIdentity();
 
     boolean isFirstBoot();
+
+    List<UserInfo> getUsers();
 }
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index 8541748d..26a9181 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -28,6 +28,7 @@
 import android.content.res.XmlResourceParser;
 import android.graphics.drawable.Drawable;
 import android.net.Uri;
+import android.os.Environment;
 import android.util.AndroidException;
 import android.util.DisplayMetrics;
 
@@ -753,13 +754,6 @@
     public static final int VERIFICATION_REJECT = -1;
 
     /**
-     * Range of IDs allocated for a user.
-     *
-     * @hide
-     */
-    public static final int PER_USER_RANGE = 100000;
-
-    /**
      * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: The device's
      * audio pipeline is low-latency, more suitable for audio applications sensitive to delays or
      * lag in sound input or output.
@@ -2615,39 +2609,6 @@
     public abstract void updateUserFlags(int id, int flags);
 
     /**
-     * Checks to see if the user id is the same for the two uids, i.e., they belong to the same
-     * user.
-     * @hide
-     */
-    public static boolean isSameUser(int uid1, int uid2) {
-        return getUserId(uid1) == getUserId(uid2);
-    }
-
-    /**
-     * Returns the user id for a given uid.
-     * @hide
-     */
-    public static int getUserId(int uid) {
-        return uid / PER_USER_RANGE;
-    }
-
-    /**
-     * Returns the uid that is composed from the userId and the appId.
-     * @hide
-     */
-    public static int getUid(int userId, int appId) {
-        return userId * PER_USER_RANGE + (appId % PER_USER_RANGE);
-    }
-
-    /**
-     * Returns the app id (or base uid) for a given uid, stripping out the user id from it.
-     * @hide
-     */
-    public static int getAppId(int uid) {
-        return uid % PER_USER_RANGE;
-    }
-
-    /**
      * Returns the device identity that verifiers can use to associate their
      * scheme to a particular device. This should not be used by anything other
      * than a package verifier.
@@ -2656,4 +2617,17 @@
      * @hide
      */
     public abstract VerifierDeviceIdentity getVerifierDeviceIdentity();
+
+    /**
+     * Returns the data directory for a particular user and package, given the uid of the package.
+     * @param uid uid of the package, including the userId and appId
+     * @param packageName name of the package
+     * @return the user-specific data directory for the package
+     * @hide
+     */
+    public static String getDataDirForUser(int userId, String packageName) {
+        // TODO: This should be shared with Installer's knowledge of user directory
+        return Environment.getDataDirectory().toString() + "/user/" + userId
+                + "/" + packageName;
+    }
 }
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index e593d5b..faee873 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -24,18 +24,17 @@
 import android.content.res.Resources;
 import android.content.res.TypedArray;
 import android.content.res.XmlResourceParser;
+import android.os.Binder;
 import android.os.Build;
 import android.os.Bundle;
 import android.os.PatternMatcher;
+import android.os.UserId;
 import android.util.AttributeSet;
 import android.util.Base64;
 import android.util.DisplayMetrics;
 import android.util.Log;
 import android.util.Slog;
 import android.util.TypedValue;
-import com.android.internal.util.XmlUtils;
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
 
 import java.io.BufferedInputStream;
 import java.io.File;
@@ -59,6 +58,11 @@
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
 
+import com.android.internal.util.XmlUtils;
+
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+
 /**
  * Package archive parsing
  *
@@ -209,6 +213,8 @@
     public static PackageInfo generatePackageInfo(PackageParser.Package p,
             int gids[], int flags, long firstInstallTime, long lastUpdateTime) {
 
+        final int userId = Binder.getOrigCallingUser();
+
         PackageInfo pi = new PackageInfo();
         pi.packageName = p.packageName;
         pi.versionCode = p.mVersionCode;
@@ -250,7 +256,8 @@
                     final Activity activity = p.activities.get(i);
                     if (activity.info.enabled
                         || (flags&PackageManager.GET_DISABLED_COMPONENTS) != 0) {
-                        pi.activities[j++] = generateActivityInfo(p.activities.get(i), flags);
+                        pi.activities[j++] = generateActivityInfo(p.activities.get(i), flags,
+                                userId);
                     }
                 }
             }
@@ -271,7 +278,7 @@
                     final Activity activity = p.receivers.get(i);
                     if (activity.info.enabled
                         || (flags&PackageManager.GET_DISABLED_COMPONENTS) != 0) {
-                        pi.receivers[j++] = generateActivityInfo(p.receivers.get(i), flags);
+                        pi.receivers[j++] = generateActivityInfo(p.receivers.get(i), flags, userId);
                     }
                 }
             }
@@ -292,7 +299,7 @@
                     final Service service = p.services.get(i);
                     if (service.info.enabled
                         || (flags&PackageManager.GET_DISABLED_COMPONENTS) != 0) {
-                        pi.services[j++] = generateServiceInfo(p.services.get(i), flags);
+                        pi.services[j++] = generateServiceInfo(p.services.get(i), flags, userId);
                     }
                 }
             }
@@ -313,7 +320,7 @@
                     final Provider provider = p.providers.get(i);
                     if (provider.info.enabled
                         || (flags&PackageManager.GET_DISABLED_COMPONENTS) != 0) {
-                        pi.providers[j++] = generateProviderInfo(p.providers.get(i), flags);
+                        pi.providers[j++] = generateProviderInfo(p.providers.get(i), flags, userId);
                     }
                 }
             }
@@ -3241,8 +3248,12 @@
     }
 
     public static ApplicationInfo generateApplicationInfo(Package p, int flags) {
+        return generateApplicationInfo(p, flags, UserId.getUserId(Binder.getCallingUid()));
+    }
+
+    public static ApplicationInfo generateApplicationInfo(Package p, int flags, int userId) {
         if (p == null) return null;
-        if (!copyNeeded(flags, p, null)) {
+        if (!copyNeeded(flags, p, null) && userId == 0) {
             // CompatibilityMode is global state. It's safe to modify the instance
             // of the package.
             if (!sCompatibilityModeEnabled) {
@@ -3258,6 +3269,10 @@
 
         // Make shallow copy so we can store the metadata/libraries safely
         ApplicationInfo ai = new ApplicationInfo(p.applicationInfo);
+        if (userId != 0) {
+            ai.uid = UserId.getUid(userId, ai.uid);
+            ai.dataDir = PackageManager.getDataDirForUser(userId, ai.packageName);
+        }
         if ((flags & PackageManager.GET_META_DATA) != 0) {
             ai.metaData = p.mAppMetaData;
         }
@@ -3325,16 +3340,15 @@
         }
     }
 
-    public static final ActivityInfo generateActivityInfo(Activity a,
-            int flags) {
+    public static final ActivityInfo generateActivityInfo(Activity a, int flags, int userId) {
         if (a == null) return null;
-        if (!copyNeeded(flags, a.owner, a.metaData)) {
+        if (!copyNeeded(flags, a.owner, a.metaData) && userId == 0) {
             return a.info;
         }
         // Make shallow copies so we can store the metadata safely
         ActivityInfo ai = new ActivityInfo(a.info);
         ai.metaData = a.metaData;
-        ai.applicationInfo = generateApplicationInfo(a.owner, flags);
+        ai.applicationInfo = generateApplicationInfo(a.owner, flags, userId);
         return ai;
     }
 
@@ -3359,15 +3373,15 @@
         }
     }
 
-    public static final ServiceInfo generateServiceInfo(Service s, int flags) {
+    public static final ServiceInfo generateServiceInfo(Service s, int flags, int userId) {
         if (s == null) return null;
-        if (!copyNeeded(flags, s.owner, s.metaData)) {
+        if (!copyNeeded(flags, s.owner, s.metaData) && userId == 0) {
             return s.info;
         }
         // Make shallow copies so we can store the metadata safely
         ServiceInfo si = new ServiceInfo(s.info);
         si.metaData = s.metaData;
-        si.applicationInfo = generateApplicationInfo(s.owner, flags);
+        si.applicationInfo = generateApplicationInfo(s.owner, flags, userId);
         return si;
     }
 
@@ -3400,12 +3414,12 @@
         }
     }
 
-    public static final ProviderInfo generateProviderInfo(Provider p,
-            int flags) {
+    public static final ProviderInfo generateProviderInfo(Provider p, int flags, int userId) {
         if (p == null) return null;
         if (!copyNeeded(flags, p.owner, p.metaData)
                 && ((flags & PackageManager.GET_URI_PERMISSION_PATTERNS) != 0
-                        || p.info.uriPermissionPatterns == null)) {
+                        || p.info.uriPermissionPatterns == null)
+                && userId == 0) {
             return p.info;
         }
         // Make shallow copies so we can store the metadata safely
@@ -3414,7 +3428,7 @@
         if ((flags & PackageManager.GET_URI_PERMISSION_PATTERNS) == 0) {
             pi.uriPermissionPatterns = null;
         }
-        pi.applicationInfo = generateApplicationInfo(p.owner, flags);
+        pi.applicationInfo = generateApplicationInfo(p.owner, flags, userId);
         return pi;
     }
 
diff --git a/core/java/android/content/res/Configuration.java b/core/java/android/content/res/Configuration.java
index 6015668..e04b2f7 100644
--- a/core/java/android/content/res/Configuration.java
+++ b/core/java/android/content/res/Configuration.java
@@ -347,6 +347,7 @@
             sb.append(" (no locale)");
         }
         switch (textLayoutDirection) {
+            case LocaleUtil.TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE: /* ltr not interesting */ break;
             case LocaleUtil.TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE: sb.append(" rtl"); break;
             default: sb.append(" layoutdir="); sb.append(textLayoutDirection); break;
         }
diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java
index d38b8da..2af58be 100755
--- a/core/java/android/content/res/Resources.java
+++ b/core/java/android/content/res/Resources.java
@@ -683,7 +683,6 @@
      * @throws NotFoundException Throws NotFoundException if the given ID does
      *             not exist.
      * @return Drawable An object that can be used to draw this resource.
-     * @hide
      */
     public Drawable getDrawableForDensity(int id, int density) throws NotFoundException {
         synchronized (mTmpValue) {
@@ -1032,7 +1031,6 @@
      * @throws NotFoundException Throws NotFoundException if the given ID does
      *             not exist.
      * @see #getValue(String, TypedValue, boolean)
-     * @hide
      */
     public void getValueForDensity(int id, int density, TypedValue outValue, boolean resolveRefs)
             throws NotFoundException {
diff --git a/core/java/android/database/AbstractCursor.java b/core/java/android/database/AbstractCursor.java
index 74fef29..b28ed8d 100644
--- a/core/java/android/database/AbstractCursor.java
+++ b/core/java/android/database/AbstractCursor.java
@@ -284,23 +284,6 @@
         }
     }
 
-    /**
-     * This is hidden until the data set change model has been re-evaluated.
-     * @hide
-     */
-    protected void notifyDataSetChange() {
-        mDataSetObservable.notifyChanged();
-    }
-
-    /**
-     * This is hidden until the data set change model has been re-evaluated.
-     * @hide
-     */
-    protected DataSetObservable getDataSetObservable() {
-        return mDataSetObservable;
-
-    }
-
     public void registerDataSetObserver(DataSetObserver observer) {
         mDataSetObservable.registerObserver(observer);
     }
@@ -317,7 +300,7 @@
      */
     protected void onChange(boolean selfChange) {
         synchronized (mSelfObserverLock) {
-            mContentObservable.dispatchChange(selfChange);
+            mContentObservable.dispatchChange(selfChange, null);
             if (mNotifyUri != null && selfChange) {
                 mContentResolver.notifyChange(mNotifyUri, mSelfObserver);
             }
diff --git a/core/java/android/database/ContentObservable.java b/core/java/android/database/ContentObservable.java
index 8d7b7c5..7692bb3 100644
--- a/core/java/android/database/ContentObservable.java
+++ b/core/java/android/database/ContentObservable.java
@@ -16,40 +16,75 @@
 
 package android.database;
 
+import android.net.Uri;
+
 /**
- * A specialization of Observable for ContentObserver that provides methods for
- * invoking the various callback methods of ContentObserver.
+ * A specialization of {@link Observable} for {@link ContentObserver}
+ * that provides methods for sending notifications to a list of
+ * {@link ContentObserver} objects.
  */
 public class ContentObservable extends Observable<ContentObserver> {
-
+    // Even though the generic method defined in Observable would be perfectly
+    // fine on its own, we can't delete this overridden method because it would
+    // potentially break binary compatibility with existing applications.
     @Override
     public void registerObserver(ContentObserver observer) {
         super.registerObserver(observer);
     }
 
     /**
-     * invokes dispatchUpdate on each observer, unless the observer doesn't want
-     * self-notifications and the update is from a self-notification
-     * @param selfChange
+     * Invokes {@link ContentObserver#dispatchChange(boolean)} on each observer.
+     * <p>
+     * If <code>selfChange</code> is true, only delivers the notification
+     * to the observer if it has indicated that it wants to receive self-change
+     * notifications by implementing {@link ContentObserver#deliverSelfNotifications}
+     * to return true.
+     * </p>
+     *
+     * @param selfChange True if this is a self-change notification.
+     *
+     * @deprecated Use {@link #dispatchChange(boolean, Uri)} instead.
      */
+    @Deprecated
     public void dispatchChange(boolean selfChange) {
+        dispatchChange(selfChange, null);
+    }
+
+    /**
+     * Invokes {@link ContentObserver#dispatchChange(boolean, Uri)} on each observer.
+     * Includes the changed content Uri when available.
+     * <p>
+     * If <code>selfChange</code> is true, only delivers the notification
+     * to the observer if it has indicated that it wants to receive self-change
+     * notifications by implementing {@link ContentObserver#deliverSelfNotifications}
+     * to return true.
+     * </p>
+     *
+     * @param selfChange True if this is a self-change notification.
+     * @param uri The Uri of the changed content, or null if unknown.
+     */
+    public void dispatchChange(boolean selfChange, Uri uri) {
         synchronized(mObservers) {
             for (ContentObserver observer : mObservers) {
                 if (!selfChange || observer.deliverSelfNotifications()) {
-                    observer.dispatchChange(selfChange);
+                    observer.dispatchChange(selfChange, uri);
                 }
             }
         }
     }
 
     /**
-     * invokes onChange on each observer
-     * @param selfChange
+     * Invokes {@link ContentObserver#onChange} on each observer.
+     *
+     * @param selfChange True if this is a self-change notification.
+     *
+     * @deprecated Use {@link #dispatchChange} instead.
      */
+    @Deprecated
     public void notifyChange(boolean selfChange) {
         synchronized(mObservers) {
             for (ContentObserver observer : mObservers) {
-                observer.onChange(selfChange);
+                observer.onChange(selfChange, null);
             }
         }
     }
diff --git a/core/java/android/database/ContentObserver.java b/core/java/android/database/ContentObserver.java
index 3b829a3..e4fbc28 100644
--- a/core/java/android/database/ContentObserver.java
+++ b/core/java/android/database/ContentObserver.java
@@ -16,65 +16,23 @@
 
 package android.database;
 
+import android.net.Uri;
 import android.os.Handler;
 
 /**
- * Receives call backs for changes to content. Must be implemented by objects which are added
- * to a {@link ContentObservable}.
+ * Receives call backs for changes to content.
+ * Must be implemented by objects which are added to a {@link ContentObservable}.
  */
 public abstract class ContentObserver {
+    private final Object mLock = new Object();
+    private Transport mTransport; // guarded by mLock
 
-    private Transport mTransport;
-
-    // Protects mTransport
-    private Object lock = new Object();
-
-    /* package */ Handler mHandler;
-
-    private final class NotificationRunnable implements Runnable {
-
-        private boolean mSelf;
-
-        public NotificationRunnable(boolean self) {
-            mSelf = self;
-        }
-
-        public void run() {
-            ContentObserver.this.onChange(mSelf);
-        }
-    }
-
-    private static final class Transport extends IContentObserver.Stub {
-        ContentObserver mContentObserver;
-
-        public Transport(ContentObserver contentObserver) {
-            mContentObserver = contentObserver;
-        }
-
-        public boolean deliverSelfNotifications() {
-            ContentObserver contentObserver = mContentObserver;
-            if (contentObserver != null) {
-                return contentObserver.deliverSelfNotifications();
-            }
-            return false;
-        }
-
-        public void onChange(boolean selfChange) {
-            ContentObserver contentObserver = mContentObserver;
-            if (contentObserver != null) {
-                contentObserver.dispatchChange(selfChange);
-            }
-        }
-
-        public void releaseContentObserver() {
-            mContentObserver = null;
-        }
-    }
+    Handler mHandler;
 
     /**
-     * onChange() will happen on the provider Handler.
+     * Creates a content observer.
      *
-     * @param handler The handler to run {@link #onChange} on.
+     * @param handler The handler to run {@link #onChange} on, or null if none.
      */
     public ContentObserver(Handler handler) {
         mHandler = handler;
@@ -86,7 +44,7 @@
      * {@hide}
      */
     public IContentObserver getContentObserver() {
-        synchronized(lock) {
+        synchronized (mLock) {
             if (mTransport == null) {
                 mTransport = new Transport(this);
             }
@@ -101,8 +59,8 @@
      * {@hide}
      */
     public IContentObserver releaseContentObserver() {
-        synchronized(lock) {
-            Transport oldTransport = mTransport;
+        synchronized (mLock) {
+            final Transport oldTransport = mTransport;
             if (oldTransport != null) {
                 oldTransport.releaseContentObserver();
                 mTransport = null;
@@ -112,27 +70,134 @@
     }
 
     /**
-     * Returns true if this observer is interested in notifications for changes
-     * made through the cursor the observer is registered with.
+     * Returns true if this observer is interested receiving self-change notifications.
+     *
+     * Subclasses should override this method to indicate whether the observer
+     * is interested in receiving notifications for changes that it made to the
+     * content itself.
+     *
+     * @return True if self-change notifications should be delivered to the observer.
      */
     public boolean deliverSelfNotifications() {
         return false;
     }
 
     /**
-     * This method is called when a change occurs to the cursor that
-     * is being observed.
-     *  
-     * @param selfChange true if the update was caused by a call to <code>commit</code> on the
-     *  cursor that is being observed.
+     * This method is called when a content change occurs.
+     * <p>
+     * Subclasses should override this method to handle content changes.
+     * </p>
+     *
+     * @param selfChange True if this is a self-change notification.
      */
-    public void onChange(boolean selfChange) {}
+    public void onChange(boolean selfChange) {
+        // Do nothing.  Subclass should override.
+    }
 
+    /**
+     * This method is called when a content change occurs.
+     * Includes the changed content Uri when available.
+     * <p>
+     * Subclasses should override this method to handle content changes.
+     * To ensure correct operation on older versions of the framework that
+     * did not provide a Uri argument, applications should also implement
+     * the {@link #onChange(boolean)} overload of this method whenever they
+     * implement the {@link #onChange(boolean, Uri)} overload.
+     * </p><p>
+     * Example implementation:
+     * <pre><code>
+     * // Implement the onChange(boolean) method to delegate the change notification to
+     * // the onChange(boolean, Uri) method to ensure correct operation on older versions
+     * // of the framework that did not have the onChange(boolean, Uri) method.
+     * {@literal @Override}
+     * public void onChange(boolean selfChange) {
+     *     onChange(selfChange, null);
+     * }
+     *
+     * // Implement the onChange(boolean, Uri) method to take advantage of the new Uri argument.
+     * {@literal @Override}
+     * public void onChange(boolean selfChange, Uri uri) {
+     *     // Handle change.
+     * }
+     * </code></pre>
+     * </p>
+     *
+     * @param selfChange True if this is a self-change notification.
+     * @param uri The Uri of the changed content, or null if unknown.
+     */
+    public void onChange(boolean selfChange, Uri uri) {
+        onChange(selfChange);
+    }
+
+    /**
+     * Dispatches a change notification to the observer.
+     * <p>
+     * If a {@link Handler} was supplied to the {@link ContentObserver} constructor,
+     * then a call to the {@link #onChange} method is posted to the handler's message queue.
+     * Otherwise, the {@link #onChange} method is invoked immediately on this thread.
+     * </p>
+     *
+     * @param selfChange True if this is a self-change notification.
+     *
+     * @deprecated Use {@link #dispatchChange(boolean, Uri)} instead.
+     */
+    @Deprecated
     public final void dispatchChange(boolean selfChange) {
+        dispatchChange(selfChange, null);
+    }
+
+    /**
+     * Dispatches a change notification to the observer.
+     * Includes the changed content Uri when available.
+     * <p>
+     * If a {@link Handler} was supplied to the {@link ContentObserver} constructor,
+     * then a call to the {@link #onChange} method is posted to the handler's message queue.
+     * Otherwise, the {@link #onChange} method is invoked immediately on this thread.
+     * </p>
+     *
+     * @param selfChange True if this is a self-change notification.
+     * @param uri The Uri of the changed content, or null if unknown.
+     */
+    public final void dispatchChange(boolean selfChange, Uri uri) {
         if (mHandler == null) {
-            onChange(selfChange);
+            onChange(selfChange, uri);
         } else {
-            mHandler.post(new NotificationRunnable(selfChange));
+            mHandler.post(new NotificationRunnable(selfChange, uri));
+        }
+    }
+
+    private final class NotificationRunnable implements Runnable {
+        private final boolean mSelfChange;
+        private final Uri mUri;
+
+        public NotificationRunnable(boolean selfChange, Uri uri) {
+            mSelfChange = selfChange;
+            mUri = uri;
+        }
+
+        @Override
+        public void run() {
+            ContentObserver.this.onChange(mSelfChange, mUri);
+        }
+    }
+
+    private static final class Transport extends IContentObserver.Stub {
+        private ContentObserver mContentObserver;
+
+        public Transport(ContentObserver contentObserver) {
+            mContentObserver = contentObserver;
+        }
+
+        @Override
+        public void onChange(boolean selfChange, Uri uri) {
+            ContentObserver contentObserver = mContentObserver;
+            if (contentObserver != null) {
+                contentObserver.dispatchChange(selfChange, uri);
+            }
+        }
+
+        public void releaseContentObserver() {
+            mContentObserver = null;
         }
     }
 }
diff --git a/core/java/android/database/Cursor.java b/core/java/android/database/Cursor.java
index a9a71cf..59ec89d 100644
--- a/core/java/android/database/Cursor.java
+++ b/core/java/android/database/Cursor.java
@@ -341,6 +341,7 @@
      * Deactivates the Cursor, making all calls on it fail until {@link #requery} is called.
      * Inactive Cursors use fewer resources than active Cursors.
      * Calling {@link #requery} will make the cursor active again.
+     * @deprecated Since {@link #requery()} is deprecated, so too is this.
      */
     void deactivate();
 
diff --git a/core/java/android/database/CursorToBulkCursorAdaptor.java b/core/java/android/database/CursorToBulkCursorAdaptor.java
index aa0f61e37..167278a 100644
--- a/core/java/android/database/CursorToBulkCursorAdaptor.java
+++ b/core/java/android/database/CursorToBulkCursorAdaptor.java
@@ -16,6 +16,7 @@
 
 package android.database;
 
+import android.net.Uri;
 import android.os.Bundle;
 import android.os.IBinder;
 import android.os.RemoteException;
@@ -78,9 +79,9 @@
         }
 
         @Override
-        public void onChange(boolean selfChange) {
+        public void onChange(boolean selfChange, Uri uri) {
             try {
-                mRemote.onChange(selfChange);
+                mRemote.onChange(selfChange, uri);
             } catch (RemoteException ex) {
                 // Do nothing, the far side is dead
             }
diff --git a/core/java/android/database/CursorWindow.java b/core/java/android/database/CursorWindow.java
index e9675e8..85f570c 100644
--- a/core/java/android/database/CursorWindow.java
+++ b/core/java/android/database/CursorWindow.java
@@ -98,8 +98,8 @@
      */
     public CursorWindow(String name) {
         mStartPos = 0;
-        mName = name;
-        mWindowPtr = nativeCreate(name, sCursorWindowSize);
+        mName = name != null && name.length() != 0 ? name : "<unnamed>";
+        mWindowPtr = nativeCreate(mName, sCursorWindowSize);
         if (mWindowPtr == 0) {
             throw new CursorWindowAllocationException("Cursor window allocation of " +
                     (sCursorWindowSize / 1024) + " kb failed. " + printStats());
@@ -161,7 +161,7 @@
     }
 
     /**
-     * Gets the name of this cursor window.
+     * Gets the name of this cursor window, never null.
      * @hide
      */
     public String getName() {
diff --git a/core/java/android/database/DataSetObservable.java b/core/java/android/database/DataSetObservable.java
index 51c72c1..ca77a13 100644
--- a/core/java/android/database/DataSetObservable.java
+++ b/core/java/android/database/DataSetObservable.java
@@ -17,13 +17,15 @@
 package android.database;
 
 /**
- * A specialization of Observable for DataSetObserver that provides methods for
- * invoking the various callback methods of DataSetObserver.
+ * A specialization of {@link Observable} for {@link DataSetObserver}
+ * that provides methods for sending notifications to a list of
+ * {@link DataSetObserver} objects.
  */
 public class DataSetObservable extends Observable<DataSetObserver> {
     /**
-     * Invokes onChanged on each observer. Called when the data set being observed has
-     * changed, and which when read contains the new state of the data.
+     * Invokes {@link DataSetObserver#onChanged} on each observer.
+     * Called when the contents of the data set have changed.  The recipient
+     * will obtain the new contents the next time it queries the data set.
      */
     public void notifyChanged() {
         synchronized(mObservers) {
@@ -38,8 +40,9 @@
     }
 
     /**
-     * Invokes onInvalidated on each observer. Called when the data set being monitored
-     * has changed such that it is no longer valid.
+     * Invokes {@link DataSetObserver#onInvalidated} on each observer.
+     * Called when the data set is no longer valid and cannot be queried again,
+     * such as when the data set has been closed.
      */
     public void notifyInvalidated() {
         synchronized (mObservers) {
diff --git a/core/java/android/database/DatabaseUtils.java b/core/java/android/database/DatabaseUtils.java
index b69d9bf..0022118 100644
--- a/core/java/android/database/DatabaseUtils.java
+++ b/core/java/android/database/DatabaseUtils.java
@@ -21,6 +21,7 @@
 import android.content.ContentValues;
 import android.content.Context;
 import android.content.OperationApplicationException;
+import android.content.OperationCanceledException;
 import android.database.sqlite.SQLiteAbortException;
 import android.database.sqlite.SQLiteConstraintException;
 import android.database.sqlite.SQLiteDatabase;
@@ -107,6 +108,9 @@
             code = 9;
         } else if (e instanceof OperationApplicationException) {
             code = 10;
+        } else if (e instanceof OperationCanceledException) {
+            code = 11;
+            logException = false;
         } else {
             reply.writeException(e);
             Log.e(TAG, "Writing exception to parcel", e);
@@ -178,6 +182,8 @@
                 throw new SQLiteDiskIOException(msg);
             case 9:
                 throw new SQLiteException(msg);
+            case 11:
+                throw new OperationCanceledException(msg);
             default:
                 reply.readException(code, msg);
         }
diff --git a/core/java/android/database/IContentObserver.aidl b/core/java/android/database/IContentObserver.aidl
index ac2f975..13aff05 100755
--- a/core/java/android/database/IContentObserver.aidl
+++ b/core/java/android/database/IContentObserver.aidl
@@ -17,6 +17,8 @@
 
 package android.database;
 
+import android.net.Uri;
+
 /**
  * @hide
  */
@@ -27,5 +29,5 @@
      * observed. selfUpdate is true if the update was caused by a call to
      * commit on the cursor that is being observed.
      */
-    oneway void onChange(boolean selfUpdate);
+    oneway void onChange(boolean selfUpdate, in Uri uri);
 }
diff --git a/core/java/android/database/Observable.java b/core/java/android/database/Observable.java
index b6fecab..aff32db 100644
--- a/core/java/android/database/Observable.java
+++ b/core/java/android/database/Observable.java
@@ -19,7 +19,12 @@
 import java.util.ArrayList;
 
 /**
- * Provides methods for (un)registering arbitrary observers in an ArrayList.
+ * Provides methods for registering or unregistering arbitrary observers in an {@link ArrayList}.
+ *
+ * This abstract class is intended to be subclassed and specialized to maintain
+ * a registry of observers of specific types and dispatch notifications to them.
+ *
+ * @param T The observer type.
  */
 public abstract class Observable<T> {
     /**
@@ -66,13 +71,13 @@
             mObservers.remove(index);
         }
     }
-    
+
     /**
-     * Remove all registered observer
+     * Remove all registered observers.
      */
     public void unregisterAll() {
         synchronized(mObservers) {
             mObservers.clear();
-        }        
+        }
     }
 }
diff --git a/core/java/android/database/sqlite/DatabaseConnectionPool.java b/core/java/android/database/sqlite/DatabaseConnectionPool.java
deleted file mode 100644
index 39a9d23..0000000
--- a/core/java/android/database/sqlite/DatabaseConnectionPool.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * Copyright (C) 20010 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.database.sqlite;
-
-import android.content.res.Resources;
-import android.os.SystemClock;
-import android.util.Log;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Random;
-
-/**
- * A connection pool to be used by readers.
- * Note that each connection can be used by only one reader at a time.
- */
-/* package */ class DatabaseConnectionPool {
-
-    private static final String TAG = "DatabaseConnectionPool";
-
-    /** The default connection pool size. */
-    private volatile int mMaxPoolSize =
-        Resources.getSystem().getInteger(com.android.internal.R.integer.db_connection_pool_size);
-
-    /** The connection pool objects are stored in this member.
-     * TODO: revisit this data struct as the number of pooled connections increase beyond
-     * single-digit values.
-     */
-    private final ArrayList<PoolObj> mPool = new ArrayList<PoolObj>(mMaxPoolSize);
-
-    /** the main database connection to which this connection pool is attached */
-    private final SQLiteDatabase mParentDbObj;
-
-    /** Random number generator used to pick a free connection out of the pool */
-    private Random rand; // lazily initialized
-
-    /* package */ DatabaseConnectionPool(SQLiteDatabase db) {
-        this.mParentDbObj = db;
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            Log.d(TAG, "Max Pool Size: " + mMaxPoolSize);
-        }
-    }
-
-    /**
-     * close all database connections in the pool - even if they are in use!
-     */
-    /* package */ synchronized void close() {
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            Log.d(TAG, "Closing the connection pool on " + mParentDbObj.getPath() + toString());
-        }
-        for (int i = mPool.size() - 1; i >= 0; i--) {
-            mPool.get(i).mDb.close();
-        }
-        mPool.clear();
-    }
-
-    /**
-     * get a free connection from the pool
-     *
-     * @param sql if not null, try to find a connection inthe pool which already has cached
-     * the compiled statement for this sql.
-     * @return the Database connection that the caller can use
-     */
-    /* package */ synchronized SQLiteDatabase get(String sql) {
-        SQLiteDatabase db = null;
-        PoolObj poolObj = null;
-        int poolSize = mPool.size();
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            assert sql != null;
-            doAsserts();
-        }
-        if (getFreePoolSize() == 0) {
-            // no free ( = available) connections
-            if (mMaxPoolSize == poolSize) {
-                // maxed out. can't open any more connections.
-                // let the caller wait on one of the pooled connections
-                // preferably a connection caching the pre-compiled statement of the given SQL
-                if (mMaxPoolSize == 1) {
-                    poolObj = mPool.get(0);
-                } else {
-                    for (int i = 0; i < mMaxPoolSize; i++) {
-                        if (mPool.get(i).mDb.isInStatementCache(sql)) {
-                            poolObj = mPool.get(i);
-                            break;
-                        }
-                    }
-                    if (poolObj == null) {
-                        // there are no database connections with the given SQL pre-compiled.
-                        // ok to return any of the connections.
-                        if (rand == null) {
-                            rand = new Random(SystemClock.elapsedRealtime());
-                        }
-                        poolObj = mPool.get(rand.nextInt(mMaxPoolSize));
-                    }
-                }
-                db = poolObj.mDb;
-            } else {
-                // create a new connection and add it to the pool, since we haven't reached
-                // max pool size allowed
-                db = mParentDbObj.createPoolConnection((short)(poolSize + 1));
-                poolObj = new PoolObj(db);
-                mPool.add(poolSize, poolObj);
-            }
-        } else {
-            // there are free connections available. pick one
-            // preferably a connection caching the pre-compiled statement of the given SQL
-            for (int i = 0; i < poolSize; i++) {
-                if (mPool.get(i).isFree() && mPool.get(i).mDb.isInStatementCache(sql)) {
-                    poolObj = mPool.get(i);
-                    break;
-                }
-            }
-            if (poolObj == null) {
-                // didn't find a free database connection with the given SQL already
-                // pre-compiled. return a free connection (this means, the same SQL could be
-                // pre-compiled on more than one database connection. potential wasted memory.)
-                for (int i = 0; i < poolSize; i++) {
-                    if (mPool.get(i).isFree()) {
-                        poolObj = mPool.get(i);
-                        break;
-                    }
-                }
-            }
-            db = poolObj.mDb;
-        }
-
-        assert poolObj != null;
-        assert poolObj.mDb == db;
-
-        poolObj.acquire();
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            Log.d(TAG, "END get-connection: " + toString() + poolObj.toString());
-        }
-        return db;
-        // TODO if a thread acquires a connection and dies without releasing the connection, then
-        // there could be a connection leak.
-    }
-
-    /**
-     * release the given database connection back to the pool.
-     * @param db the connection to be released
-     */
-    /* package */ synchronized void release(SQLiteDatabase db) {
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            assert db.mConnectionNum > 0;
-            doAsserts();
-            assert mPool.get(db.mConnectionNum - 1).mDb == db;
-        }
-
-        PoolObj poolObj = mPool.get(db.mConnectionNum - 1);
-
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            Log.d(TAG, "BEGIN release-conn: " + toString() + poolObj.toString());
-        }
-
-        if (poolObj.isFree()) {
-            throw new IllegalStateException("Releasing object already freed: " +
-                    db.mConnectionNum);
-        }
-
-        poolObj.release();
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            Log.d(TAG, "END release-conn: " + toString() + poolObj.toString());
-        }
-    }
-
-    /**
-     * Returns a list of all database connections in the pool (both free and busy connections).
-     * This method is used when "adb bugreport" is done.
-     */
-    /* package */ synchronized ArrayList<SQLiteDatabase> getConnectionList() {
-        ArrayList<SQLiteDatabase> list = new ArrayList<SQLiteDatabase>();
-        for (int i = mPool.size() - 1; i >= 0; i--) {
-            list.add(mPool.get(i).mDb);
-        }
-        return list;
-    }
-
-    /**
-     * package level access for testing purposes only. otherwise, private should be sufficient.
-     */
-    /* package */ int getFreePoolSize() {
-        int count = 0;
-        for (int i = mPool.size() - 1; i >= 0; i--) {
-            if (mPool.get(i).isFree()) {
-                count++;
-            }
-        }
-        return count++;
-    }
-
-    /**
-     * only for testing purposes
-     */
-    /* package */ ArrayList<PoolObj> getPool() {
-        return mPool;
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder buff = new StringBuilder();
-        buff.append("db: ");
-        buff.append(mParentDbObj.getPath());
-        buff.append(", totalsize = ");
-        buff.append(mPool.size());
-        buff.append(", #free = ");
-        buff.append(getFreePoolSize());
-        buff.append(", maxpoolsize = ");
-        buff.append(mMaxPoolSize);
-        for (PoolObj p : mPool) {
-            buff.append("\n");
-            buff.append(p.toString());
-        }
-        return buff.toString();
-    }
-
-    private void doAsserts() {
-        for (int i = 0; i < mPool.size(); i++) {
-            mPool.get(i).verify();
-            assert mPool.get(i).mDb.mConnectionNum == (i + 1);
-        }
-    }
-
-    /** only used for testing purposes. */
-    /* package */ synchronized void setMaxPoolSize(int size) {
-        mMaxPoolSize = size;
-    }
-
-    /** only used for testing purposes. */
-    /* package */ synchronized int getMaxPoolSize() {
-        return mMaxPoolSize;
-    }
-
-    /** only used for testing purposes. */
-    /* package */ boolean isDatabaseObjFree(SQLiteDatabase db) {
-        return mPool.get(db.mConnectionNum - 1).isFree();
-    }
-
-    /** only used for testing purposes. */
-    /* package */ int getSize() {
-        return mPool.size();
-    }
-
-    /**
-     * represents objects in the connection pool.
-     * package-level access for testing purposes only.
-     */
-    /* package */ static class PoolObj {
-
-        private final SQLiteDatabase mDb;
-        private boolean mFreeBusyFlag = FREE;
-        private static final boolean FREE = true;
-        private static final boolean BUSY = false;
-
-        /** the number of threads holding this connection */
-        // @GuardedBy("this")
-        private int mNumHolders = 0;
-
-        /** contains the threadIds of the threads holding this connection.
-         * used for debugging purposes only.
-         */
-        // @GuardedBy("this")
-        private HashSet<Long> mHolderIds = new HashSet<Long>();
-
-        public PoolObj(SQLiteDatabase db) {
-            mDb = db;
-        }
-
-        private synchronized void acquire() {
-            if (Log.isLoggable(TAG, Log.DEBUG)) {
-                assert isFree();
-                long id = Thread.currentThread().getId();
-                assert !mHolderIds.contains(id);
-                mHolderIds.add(id);
-            }
-
-            mNumHolders++;
-            mFreeBusyFlag = BUSY;
-        }
-
-        private synchronized void release() {
-            if (Log.isLoggable(TAG, Log.DEBUG)) {
-                long id = Thread.currentThread().getId();
-                assert mHolderIds.size() == mNumHolders;
-                assert mHolderIds.contains(id);
-                mHolderIds.remove(id);
-            }
-
-            mNumHolders--;
-            if (mNumHolders == 0) {
-                mFreeBusyFlag = FREE;
-            }
-        }
-
-        private synchronized boolean isFree() {
-            if (Log.isLoggable(TAG, Log.DEBUG)) {
-                verify();
-            }
-            return (mFreeBusyFlag == FREE);
-        }
-
-        private synchronized void verify() {
-            if (mFreeBusyFlag == FREE) {
-                assert mNumHolders == 0;
-            } else {
-                assert mNumHolders > 0;
-            }
-        }
-
-        /**
-         * only for testing purposes
-         */
-        /* package */ synchronized int getNumHolders() {
-            return mNumHolders;
-        }
-
-        @Override
-        public String toString() {
-            StringBuilder buff = new StringBuilder();
-            buff.append(", conn # ");
-            buff.append(mDb.mConnectionNum);
-            buff.append(", mCountHolders = ");
-            synchronized(this) {
-                buff.append(mNumHolders);
-                buff.append(", freeBusyFlag = ");
-                buff.append(mFreeBusyFlag);
-                for (Long l : mHolderIds) {
-                    buff.append(", id = " + l);
-                }
-            }
-            return buff.toString();
-        }
-    }
-}
diff --git a/core/java/android/database/sqlite/SQLiteClosable.java b/core/java/android/database/sqlite/SQLiteClosable.java
index 01e9fb3..7e91a7b 100644
--- a/core/java/android/database/sqlite/SQLiteClosable.java
+++ b/core/java/android/database/sqlite/SQLiteClosable.java
@@ -16,8 +16,6 @@
 
 package android.database.sqlite;
 
-import android.database.CursorWindow;
-
 /**
  * An object created from a SQLiteDatabase that can be closed.
  */
@@ -31,7 +29,7 @@
         synchronized(this) {
             if (mReferenceCount <= 0) {
                 throw new IllegalStateException(
-                        "attempt to re-open an already-closed object: " + getObjInfo());
+                        "attempt to re-open an already-closed object: " + this);
             }
             mReferenceCount++;
         }
@@ -56,22 +54,4 @@
             onAllReferencesReleasedFromContainer();
         }
     }
-
-    private String getObjInfo() {
-        StringBuilder buff = new StringBuilder();
-        buff.append(this.getClass().getName());
-        buff.append(" (");
-        if (this instanceof SQLiteDatabase) {
-            buff.append("database = ");
-            buff.append(((SQLiteDatabase)this).getPath());
-        } else if (this instanceof SQLiteProgram) {
-            buff.append("mSql = ");
-            buff.append(((SQLiteProgram)this).mSql);
-        } else if (this instanceof CursorWindow) {
-            buff.append("mStartPos = ");
-            buff.append(((CursorWindow)this).getStartPosition());
-        }
-        buff.append(") ");
-        return buff.toString();
-    }
 }
diff --git a/core/java/android/database/sqlite/SQLiteCompiledSql.java b/core/java/android/database/sqlite/SQLiteCompiledSql.java
deleted file mode 100644
index dafbc79..0000000
--- a/core/java/android/database/sqlite/SQLiteCompiledSql.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (C) 2009 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.database.sqlite;
-
-import android.os.StrictMode;
-import android.util.Log;
-
-/**
- * This class encapsulates compilation of sql statement and release of the compiled statement obj.
- * Once a sql statement is compiled, it is cached in {@link SQLiteDatabase}
- * and it is released in one of the 2 following ways
- * 1. when {@link SQLiteDatabase} object is closed.
- * 2. if this is not cached in {@link SQLiteDatabase}, {@link android.database.Cursor#close()}
- * releaases this obj.
- */
-/* package */ class SQLiteCompiledSql {
-
-    private static final String TAG = "SQLiteCompiledSql";
-
-    /** The database this program is compiled against. */
-    /* package */ final SQLiteDatabase mDatabase;
-
-    /**
-     * Native linkage, do not modify. This comes from the database.
-     */
-    /* package */ final int nHandle;
-
-    /**
-     * Native linkage, do not modify. When non-0 this holds a reference to a valid
-     * sqlite3_statement object. It is only updated by the native code, but may be
-     * checked in this class when the database lock is held to determine if there
-     * is a valid native-side program or not.
-     */
-    /* package */ int nStatement = 0;
-
-    /** the following are for debugging purposes */
-    private String mSqlStmt = null;
-    private final Throwable mStackTrace;
-
-    /** when in cache and is in use, this member is set */
-    private boolean mInUse = false;
-
-    /* package */ SQLiteCompiledSql(SQLiteDatabase db, String sql) {
-        db.verifyDbIsOpen();
-        db.verifyLockOwner();
-        mDatabase = db;
-        mSqlStmt = sql;
-        if (StrictMode.vmSqliteObjectLeaksEnabled()) {
-            mStackTrace = new DatabaseObjectNotClosedException().fillInStackTrace();
-        } else {
-            mStackTrace = null;
-        }
-        nHandle = db.mNativeHandle;
-        native_compile(sql);
-    }
-
-    /* package */ void releaseSqlStatement() {
-        // Note that native_finalize() checks to make sure that nStatement is
-        // non-null before destroying it.
-        if (nStatement != 0) {
-            mDatabase.finalizeStatementLater(nStatement);
-            nStatement = 0;
-        }
-    }
-
-    /**
-     * returns true if acquire() succeeds. false otherwise.
-     */
-    /* package */ synchronized boolean acquire() {
-        if (mInUse) {
-            // it is already in use.
-            return false;
-        }
-        mInUse = true;
-        return true;
-    }
-
-    /* package */ synchronized void release() {
-        mInUse = false;
-    }
-
-    /* package */ synchronized void releaseIfNotInUse() {
-        // if it is not in use, release its memory from the database
-        if (!mInUse) {
-            releaseSqlStatement();
-        }
-    }
-
-    /**
-     * Make sure that the native resource is cleaned up.
-     */
-    @Override
-    protected void finalize() throws Throwable {
-        try {
-            if (nStatement == 0) return;
-            // don't worry about finalizing this object if it is ALREADY in the
-            // queue of statements to be finalized later
-            if (mDatabase.isInQueueOfStatementsToBeFinalized(nStatement)) {
-                return;
-            }
-            // finalizer should NEVER get called
-            // but if the database itself is not closed and is GC'ed, then
-            // all sub-objects attached to the database could end up getting GC'ed too.
-            // in that case, don't print any warning.
-            if (mInUse && mStackTrace != null) {
-                int len = mSqlStmt.length();
-                StrictMode.onSqliteObjectLeaked(
-                    "Releasing statement in a finalizer. Please ensure " +
-                    "that you explicitly call close() on your cursor: " +
-                    mSqlStmt.substring(0, (len > 1000) ? 1000 : len),
-                    mStackTrace);
-            }
-            releaseSqlStatement();
-        } finally {
-            super.finalize();
-        }
-    }
-
-    @Override public String toString() {
-        synchronized(this) {
-            StringBuilder buff = new StringBuilder();
-            buff.append(" nStatement=");
-            buff.append(nStatement);
-            buff.append(", mInUse=");
-            buff.append(mInUse);
-            buff.append(", db=");
-            buff.append(mDatabase.getPath());
-            buff.append(", db_connectionNum=");
-            buff.append(mDatabase.mConnectionNum);
-            buff.append(", sql=");
-            int len = mSqlStmt.length();
-            buff.append(mSqlStmt.substring(0, (len > 100) ? 100 : len));
-            return buff.toString();
-        }
-    }
-
-    /**
-     * Compiles SQL into a SQLite program.
-     *
-     * <P>The database lock must be held when calling this method.
-     * @param sql The SQL to compile.
-     */
-    private final native void native_compile(String sql);
-}
diff --git a/core/java/android/database/sqlite/SQLiteConnection.java b/core/java/android/database/sqlite/SQLiteConnection.java
new file mode 100644
index 0000000..b5cef81
--- /dev/null
+++ b/core/java/android/database/sqlite/SQLiteConnection.java
@@ -0,0 +1,1315 @@
+/*
+ * 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 android.database.sqlite;
+
+import dalvik.system.BlockGuard;
+import dalvik.system.CloseGuard;
+
+import android.content.CancellationSignal;
+import android.content.OperationCanceledException;
+import android.database.Cursor;
+import android.database.CursorWindow;
+import android.database.DatabaseUtils;
+import android.database.sqlite.SQLiteDebug.DbStats;
+import android.os.ParcelFileDescriptor;
+import android.util.Log;
+import android.util.LruCache;
+import android.util.Printer;
+
+import java.sql.Date;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+/**
+ * Represents a SQLite database connection.
+ * Each connection wraps an instance of a native <code>sqlite3</code> object.
+ * <p>
+ * When database connection pooling is enabled, there can be multiple active
+ * connections to the same database.  Otherwise there is typically only one
+ * connection per database.
+ * </p><p>
+ * When the SQLite WAL feature is enabled, multiple readers and one writer
+ * can concurrently access the database.  Without WAL, readers and writers
+ * are mutually exclusive.
+ * </p>
+ *
+ * <h2>Ownership and concurrency guarantees</h2>
+ * <p>
+ * Connection objects are not thread-safe.  They are acquired as needed to
+ * perform a database operation and are then returned to the pool.  At any
+ * given time, a connection is either owned and used by a {@link SQLiteSession}
+ * object or the {@link SQLiteConnectionPool}.  Those classes are
+ * responsible for serializing operations to guard against concurrent
+ * use of a connection.
+ * </p><p>
+ * The guarantee of having a single owner allows this class to be implemented
+ * without locks and greatly simplifies resource management.
+ * </p>
+ *
+ * <h2>Encapsulation guarantees</h2>
+ * <p>
+ * The connection object object owns *all* of the SQLite related native
+ * objects that are associated with the connection.  What's more, there are
+ * no other objects in the system that are capable of obtaining handles to
+ * those native objects.  Consequently, when the connection is closed, we do
+ * not have to worry about what other components might have references to
+ * its associated SQLite state -- there are none.
+ * </p><p>
+ * Encapsulation is what ensures that the connection object's
+ * lifecycle does not become a tortured mess of finalizers and reference
+ * queues.
+ * </p>
+ *
+ * <h2>Reentrance</h2>
+ * <p>
+ * This class must tolerate reentrant execution of SQLite operations because
+ * triggers may call custom SQLite functions that perform additional queries.
+ * </p>
+ *
+ * @hide
+ */
+public final class SQLiteConnection implements CancellationSignal.OnCancelListener {
+    private static final String TAG = "SQLiteConnection";
+    private static final boolean DEBUG = false;
+
+    private static final String[] EMPTY_STRING_ARRAY = new String[0];
+    private static final byte[] EMPTY_BYTE_ARRAY = new byte[0];
+
+    private static final Pattern TRIM_SQL_PATTERN = Pattern.compile("[\\s]*\\n+[\\s]*");
+
+    private final CloseGuard mCloseGuard = CloseGuard.get();
+
+    private final SQLiteConnectionPool mPool;
+    private final SQLiteDatabaseConfiguration mConfiguration;
+    private final int mConnectionId;
+    private final boolean mIsPrimaryConnection;
+    private final PreparedStatementCache mPreparedStatementCache;
+    private PreparedStatement mPreparedStatementPool;
+
+    // The recent operations log.
+    private final OperationLog mRecentOperations = new OperationLog();
+
+    // The native SQLiteConnection pointer.  (FOR INTERNAL USE ONLY)
+    private int mConnectionPtr;
+
+    private boolean mOnlyAllowReadOnlyOperations;
+
+    // The number of times attachCancellationSignal has been called.
+    // Because SQLite statement execution can be re-entrant, we keep track of how many
+    // times we have attempted to attach a cancellation signal to the connection so that
+    // we can ensure that we detach the signal at the right time.
+    private int mCancellationSignalAttachCount;
+
+    private static native int nativeOpen(String path, int openFlags, String label,
+            boolean enableTrace, boolean enableProfile);
+    private static native void nativeClose(int connectionPtr);
+    private static native void nativeRegisterCustomFunction(int connectionPtr,
+            SQLiteCustomFunction function);
+    private static native void nativeSetLocale(int connectionPtr, String locale);
+    private static native int nativePrepareStatement(int connectionPtr, String sql);
+    private static native void nativeFinalizeStatement(int connectionPtr, int statementPtr);
+    private static native int nativeGetParameterCount(int connectionPtr, int statementPtr);
+    private static native boolean nativeIsReadOnly(int connectionPtr, int statementPtr);
+    private static native int nativeGetColumnCount(int connectionPtr, int statementPtr);
+    private static native String nativeGetColumnName(int connectionPtr, int statementPtr,
+            int index);
+    private static native void nativeBindNull(int connectionPtr, int statementPtr,
+            int index);
+    private static native void nativeBindLong(int connectionPtr, int statementPtr,
+            int index, long value);
+    private static native void nativeBindDouble(int connectionPtr, int statementPtr,
+            int index, double value);
+    private static native void nativeBindString(int connectionPtr, int statementPtr,
+            int index, String value);
+    private static native void nativeBindBlob(int connectionPtr, int statementPtr,
+            int index, byte[] value);
+    private static native void nativeResetStatementAndClearBindings(
+            int connectionPtr, int statementPtr);
+    private static native void nativeExecute(int connectionPtr, int statementPtr);
+    private static native long nativeExecuteForLong(int connectionPtr, int statementPtr);
+    private static native String nativeExecuteForString(int connectionPtr, int statementPtr);
+    private static native int nativeExecuteForBlobFileDescriptor(
+            int connectionPtr, int statementPtr);
+    private static native int nativeExecuteForChangedRowCount(int connectionPtr, int statementPtr);
+    private static native long nativeExecuteForLastInsertedRowId(
+            int connectionPtr, int statementPtr);
+    private static native long nativeExecuteForCursorWindow(
+            int connectionPtr, int statementPtr, int windowPtr,
+            int startPos, int requiredPos, boolean countAllRows);
+    private static native int nativeGetDbLookaside(int connectionPtr);
+    private static native void nativeCancel(int connectionPtr);
+    private static native void nativeResetCancel(int connectionPtr, boolean cancelable);
+
+    private SQLiteConnection(SQLiteConnectionPool pool,
+            SQLiteDatabaseConfiguration configuration,
+            int connectionId, boolean primaryConnection) {
+        mPool = pool;
+        mConfiguration = new SQLiteDatabaseConfiguration(configuration);
+        mConnectionId = connectionId;
+        mIsPrimaryConnection = primaryConnection;
+        mPreparedStatementCache = new PreparedStatementCache(
+                mConfiguration.maxSqlCacheSize);
+        mCloseGuard.open("close");
+    }
+
+    @Override
+    protected void finalize() throws Throwable {
+        try {
+            if (mPool != null && mConnectionPtr != 0) {
+                mPool.onConnectionLeaked();
+            }
+
+            dispose(true);
+        } finally {
+            super.finalize();
+        }
+    }
+
+    // Called by SQLiteConnectionPool only.
+    static SQLiteConnection open(SQLiteConnectionPool pool,
+            SQLiteDatabaseConfiguration configuration,
+            int connectionId, boolean primaryConnection) {
+        SQLiteConnection connection = new SQLiteConnection(pool, configuration,
+                connectionId, primaryConnection);
+        try {
+            connection.open();
+            return connection;
+        } catch (SQLiteException ex) {
+            connection.dispose(false);
+            throw ex;
+        }
+    }
+
+    // Called by SQLiteConnectionPool only.
+    // Closes the database closes and releases all of its associated resources.
+    // Do not call methods on the connection after it is closed.  It will probably crash.
+    void close() {
+        dispose(false);
+    }
+
+    private void open() {
+        mConnectionPtr = nativeOpen(mConfiguration.path, mConfiguration.openFlags,
+                mConfiguration.label,
+                SQLiteDebug.DEBUG_SQL_STATEMENTS, SQLiteDebug.DEBUG_SQL_TIME);
+
+        setLocaleFromConfiguration();
+    }
+
+    private void dispose(boolean finalized) {
+        if (mCloseGuard != null) {
+            if (finalized) {
+                mCloseGuard.warnIfOpen();
+            }
+            mCloseGuard.close();
+        }
+
+        if (mConnectionPtr != 0) {
+            final int cookie = mRecentOperations.beginOperation("close", null, null);
+            try {
+                mPreparedStatementCache.evictAll();
+                nativeClose(mConnectionPtr);
+                mConnectionPtr = 0;
+            } finally {
+                mRecentOperations.endOperation(cookie);
+            }
+        }
+    }
+
+    private void setLocaleFromConfiguration() {
+        nativeSetLocale(mConnectionPtr, mConfiguration.locale.toString());
+    }
+
+    // Called by SQLiteConnectionPool only.
+    void reconfigure(SQLiteDatabaseConfiguration configuration) {
+        // Register custom functions.
+        final int functionCount = configuration.customFunctions.size();
+        for (int i = 0; i < functionCount; i++) {
+            SQLiteCustomFunction function = configuration.customFunctions.get(i);
+            if (!mConfiguration.customFunctions.contains(function)) {
+                nativeRegisterCustomFunction(mConnectionPtr, function);
+            }
+        }
+
+        // Remember whether locale has changed.
+        boolean localeChanged = !configuration.locale.equals(mConfiguration.locale);
+
+        // Update configuration parameters.
+        mConfiguration.updateParametersFrom(configuration);
+
+        // Update prepared statement cache size.
+        mPreparedStatementCache.resize(configuration.maxSqlCacheSize);
+
+        // Update locale.
+        if (localeChanged) {
+            setLocaleFromConfiguration();
+        }
+    }
+
+    // Called by SQLiteConnectionPool only.
+    // When set to true, executing write operations will throw SQLiteException.
+    // Preparing statements that might write is ok, just don't execute them.
+    void setOnlyAllowReadOnlyOperations(boolean readOnly) {
+        mOnlyAllowReadOnlyOperations = readOnly;
+    }
+
+    // Called by SQLiteConnectionPool only.
+    // Returns true if the prepared statement cache contains the specified SQL.
+    boolean isPreparedStatementInCache(String sql) {
+        return mPreparedStatementCache.get(sql) != null;
+    }
+
+    /**
+     * Gets the unique id of this connection.
+     * @return The connection id.
+     */
+    public int getConnectionId() {
+        return mConnectionId;
+    }
+
+    /**
+     * Returns true if this is the primary database connection.
+     * @return True if this is the primary database connection.
+     */
+    public boolean isPrimaryConnection() {
+        return mIsPrimaryConnection;
+    }
+
+    /**
+     * Prepares a statement for execution but does not bind its parameters or execute it.
+     * <p>
+     * This method can be used to check for syntax errors during compilation
+     * prior to execution of the statement.  If the {@code outStatementInfo} argument
+     * is not null, the provided {@link SQLiteStatementInfo} object is populated
+     * with information about the statement.
+     * </p><p>
+     * A prepared statement makes no reference to the arguments that may eventually
+     * be bound to it, consequently it it possible to cache certain prepared statements
+     * such as SELECT or INSERT/UPDATE statements.  If the statement is cacheable,
+     * then it will be stored in the cache for later.
+     * </p><p>
+     * To take advantage of this behavior as an optimization, the connection pool
+     * provides a method to acquire a connection that already has a given SQL statement
+     * in its prepared statement cache so that it is ready for execution.
+     * </p>
+     *
+     * @param sql The SQL statement to prepare.
+     * @param outStatementInfo The {@link SQLiteStatementInfo} object to populate
+     * with information about the statement, or null if none.
+     *
+     * @throws SQLiteException if an error occurs, such as a syntax error.
+     */
+    public void prepare(String sql, SQLiteStatementInfo outStatementInfo) {
+        if (sql == null) {
+            throw new IllegalArgumentException("sql must not be null.");
+        }
+
+        final int cookie = mRecentOperations.beginOperation("prepare", sql, null);
+        try {
+            final PreparedStatement statement = acquirePreparedStatement(sql);
+            try {
+                if (outStatementInfo != null) {
+                    outStatementInfo.numParameters = statement.mNumParameters;
+                    outStatementInfo.readOnly = statement.mReadOnly;
+
+                    final int columnCount = nativeGetColumnCount(
+                            mConnectionPtr, statement.mStatementPtr);
+                    if (columnCount == 0) {
+                        outStatementInfo.columnNames = EMPTY_STRING_ARRAY;
+                    } else {
+                        outStatementInfo.columnNames = new String[columnCount];
+                        for (int i = 0; i < columnCount; i++) {
+                            outStatementInfo.columnNames[i] = nativeGetColumnName(
+                                    mConnectionPtr, statement.mStatementPtr, i);
+                        }
+                    }
+                }
+            } finally {
+                releasePreparedStatement(statement);
+            }
+        } catch (RuntimeException ex) {
+            mRecentOperations.failOperation(cookie, ex);
+            throw ex;
+        } finally {
+            mRecentOperations.endOperation(cookie);
+        }
+    }
+
+    /**
+     * Executes a statement that does not return a result.
+     *
+     * @param sql The SQL statement to execute.
+     * @param bindArgs The arguments to bind, or null if none.
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     *
+     * @throws SQLiteException if an error occurs, such as a syntax error
+     * or invalid number of bind arguments.
+     * @throws OperationCanceledException if the operation was canceled.
+     */
+    public void execute(String sql, Object[] bindArgs,
+            CancellationSignal cancellationSignal) {
+        if (sql == null) {
+            throw new IllegalArgumentException("sql must not be null.");
+        }
+
+        final int cookie = mRecentOperations.beginOperation("execute", sql, bindArgs);
+        try {
+            final PreparedStatement statement = acquirePreparedStatement(sql);
+            try {
+                throwIfStatementForbidden(statement);
+                bindArguments(statement, bindArgs);
+                applyBlockGuardPolicy(statement);
+                attachCancellationSignal(cancellationSignal);
+                try {
+                    nativeExecute(mConnectionPtr, statement.mStatementPtr);
+                } finally {
+                    detachCancellationSignal(cancellationSignal);
+                }
+            } finally {
+                releasePreparedStatement(statement);
+            }
+        } catch (RuntimeException ex) {
+            mRecentOperations.failOperation(cookie, ex);
+            throw ex;
+        } finally {
+            mRecentOperations.endOperation(cookie);
+        }
+    }
+
+    /**
+     * Executes a statement that returns a single <code>long</code> result.
+     *
+     * @param sql The SQL statement to execute.
+     * @param bindArgs The arguments to bind, or null if none.
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     * @return The value of the first column in the first row of the result set
+     * as a <code>long</code>, or zero if none.
+     *
+     * @throws SQLiteException if an error occurs, such as a syntax error
+     * or invalid number of bind arguments.
+     * @throws OperationCanceledException if the operation was canceled.
+     */
+    public long executeForLong(String sql, Object[] bindArgs,
+            CancellationSignal cancellationSignal) {
+        if (sql == null) {
+            throw new IllegalArgumentException("sql must not be null.");
+        }
+
+        final int cookie = mRecentOperations.beginOperation("executeForLong", sql, bindArgs);
+        try {
+            final PreparedStatement statement = acquirePreparedStatement(sql);
+            try {
+                throwIfStatementForbidden(statement);
+                bindArguments(statement, bindArgs);
+                applyBlockGuardPolicy(statement);
+                attachCancellationSignal(cancellationSignal);
+                try {
+                    return nativeExecuteForLong(mConnectionPtr, statement.mStatementPtr);
+                } finally {
+                    detachCancellationSignal(cancellationSignal);
+                }
+            } finally {
+                releasePreparedStatement(statement);
+            }
+        } catch (RuntimeException ex) {
+            mRecentOperations.failOperation(cookie, ex);
+            throw ex;
+        } finally {
+            mRecentOperations.endOperation(cookie);
+        }
+    }
+
+    /**
+     * Executes a statement that returns a single {@link String} result.
+     *
+     * @param sql The SQL statement to execute.
+     * @param bindArgs The arguments to bind, or null if none.
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     * @return The value of the first column in the first row of the result set
+     * as a <code>String</code>, or null if none.
+     *
+     * @throws SQLiteException if an error occurs, such as a syntax error
+     * or invalid number of bind arguments.
+     * @throws OperationCanceledException if the operation was canceled.
+     */
+    public String executeForString(String sql, Object[] bindArgs,
+            CancellationSignal cancellationSignal) {
+        if (sql == null) {
+            throw new IllegalArgumentException("sql must not be null.");
+        }
+
+        final int cookie = mRecentOperations.beginOperation("executeForString", sql, bindArgs);
+        try {
+            final PreparedStatement statement = acquirePreparedStatement(sql);
+            try {
+                throwIfStatementForbidden(statement);
+                bindArguments(statement, bindArgs);
+                applyBlockGuardPolicy(statement);
+                attachCancellationSignal(cancellationSignal);
+                try {
+                    return nativeExecuteForString(mConnectionPtr, statement.mStatementPtr);
+                } finally {
+                    detachCancellationSignal(cancellationSignal);
+                }
+            } finally {
+                releasePreparedStatement(statement);
+            }
+        } catch (RuntimeException ex) {
+            mRecentOperations.failOperation(cookie, ex);
+            throw ex;
+        } finally {
+            mRecentOperations.endOperation(cookie);
+        }
+    }
+
+    /**
+     * Executes a statement that returns a single BLOB result as a
+     * file descriptor to a shared memory region.
+     *
+     * @param sql The SQL statement to execute.
+     * @param bindArgs The arguments to bind, or null if none.
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     * @return The file descriptor for a shared memory region that contains
+     * the value of the first column in the first row of the result set as a BLOB,
+     * or null if none.
+     *
+     * @throws SQLiteException if an error occurs, such as a syntax error
+     * or invalid number of bind arguments.
+     * @throws OperationCanceledException if the operation was canceled.
+     */
+    public ParcelFileDescriptor executeForBlobFileDescriptor(String sql, Object[] bindArgs,
+            CancellationSignal cancellationSignal) {
+        if (sql == null) {
+            throw new IllegalArgumentException("sql must not be null.");
+        }
+
+        final int cookie = mRecentOperations.beginOperation("executeForBlobFileDescriptor",
+                sql, bindArgs);
+        try {
+            final PreparedStatement statement = acquirePreparedStatement(sql);
+            try {
+                throwIfStatementForbidden(statement);
+                bindArguments(statement, bindArgs);
+                applyBlockGuardPolicy(statement);
+                attachCancellationSignal(cancellationSignal);
+                try {
+                    int fd = nativeExecuteForBlobFileDescriptor(
+                            mConnectionPtr, statement.mStatementPtr);
+                    return fd >= 0 ? ParcelFileDescriptor.adoptFd(fd) : null;
+                } finally {
+                    detachCancellationSignal(cancellationSignal);
+                }
+            } finally {
+                releasePreparedStatement(statement);
+            }
+        } catch (RuntimeException ex) {
+            mRecentOperations.failOperation(cookie, ex);
+            throw ex;
+        } finally {
+            mRecentOperations.endOperation(cookie);
+        }
+    }
+
+    /**
+     * Executes a statement that returns a count of the number of rows
+     * that were changed.  Use for UPDATE or DELETE SQL statements.
+     *
+     * @param sql The SQL statement to execute.
+     * @param bindArgs The arguments to bind, or null if none.
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     * @return The number of rows that were changed.
+     *
+     * @throws SQLiteException if an error occurs, such as a syntax error
+     * or invalid number of bind arguments.
+     * @throws OperationCanceledException if the operation was canceled.
+     */
+    public int executeForChangedRowCount(String sql, Object[] bindArgs,
+            CancellationSignal cancellationSignal) {
+        if (sql == null) {
+            throw new IllegalArgumentException("sql must not be null.");
+        }
+
+        final int cookie = mRecentOperations.beginOperation("executeForChangedRowCount",
+                sql, bindArgs);
+        try {
+            final PreparedStatement statement = acquirePreparedStatement(sql);
+            try {
+                throwIfStatementForbidden(statement);
+                bindArguments(statement, bindArgs);
+                applyBlockGuardPolicy(statement);
+                attachCancellationSignal(cancellationSignal);
+                try {
+                    return nativeExecuteForChangedRowCount(
+                            mConnectionPtr, statement.mStatementPtr);
+                } finally {
+                    detachCancellationSignal(cancellationSignal);
+                }
+            } finally {
+                releasePreparedStatement(statement);
+            }
+        } catch (RuntimeException ex) {
+            mRecentOperations.failOperation(cookie, ex);
+            throw ex;
+        } finally {
+            mRecentOperations.endOperation(cookie);
+        }
+    }
+
+    /**
+     * Executes a statement that returns the row id of the last row inserted
+     * by the statement.  Use for INSERT SQL statements.
+     *
+     * @param sql The SQL statement to execute.
+     * @param bindArgs The arguments to bind, or null if none.
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     * @return The row id of the last row that was inserted, or 0 if none.
+     *
+     * @throws SQLiteException if an error occurs, such as a syntax error
+     * or invalid number of bind arguments.
+     * @throws OperationCanceledException if the operation was canceled.
+     */
+    public long executeForLastInsertedRowId(String sql, Object[] bindArgs,
+            CancellationSignal cancellationSignal) {
+        if (sql == null) {
+            throw new IllegalArgumentException("sql must not be null.");
+        }
+
+        final int cookie = mRecentOperations.beginOperation("executeForLastInsertedRowId",
+                sql, bindArgs);
+        try {
+            final PreparedStatement statement = acquirePreparedStatement(sql);
+            try {
+                throwIfStatementForbidden(statement);
+                bindArguments(statement, bindArgs);
+                applyBlockGuardPolicy(statement);
+                attachCancellationSignal(cancellationSignal);
+                try {
+                    return nativeExecuteForLastInsertedRowId(
+                            mConnectionPtr, statement.mStatementPtr);
+                } finally {
+                    detachCancellationSignal(cancellationSignal);
+                }
+            } finally {
+                releasePreparedStatement(statement);
+            }
+        } catch (RuntimeException ex) {
+            mRecentOperations.failOperation(cookie, ex);
+            throw ex;
+        } finally {
+            mRecentOperations.endOperation(cookie);
+        }
+    }
+
+    /**
+     * Executes a statement and populates the specified {@link CursorWindow}
+     * with a range of results.  Returns the number of rows that were counted
+     * during query execution.
+     *
+     * @param sql The SQL statement to execute.
+     * @param bindArgs The arguments to bind, or null if none.
+     * @param window The cursor window to clear and fill.
+     * @param startPos The start position for filling the window.
+     * @param requiredPos The position of a row that MUST be in the window.
+     * If it won't fit, then the query should discard part of what it filled
+     * so that it does.  Must be greater than or equal to <code>startPos</code>.
+     * @param countAllRows True to count all rows that the query would return
+     * regagless of whether they fit in the window.
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     * @return The number of rows that were counted during query execution.  Might
+     * not be all rows in the result set unless <code>countAllRows</code> is true.
+     *
+     * @throws SQLiteException if an error occurs, such as a syntax error
+     * or invalid number of bind arguments.
+     * @throws OperationCanceledException if the operation was canceled.
+     */
+    public int executeForCursorWindow(String sql, Object[] bindArgs,
+            CursorWindow window, int startPos, int requiredPos, boolean countAllRows,
+            CancellationSignal cancellationSignal) {
+        if (sql == null) {
+            throw new IllegalArgumentException("sql must not be null.");
+        }
+        if (window == null) {
+            throw new IllegalArgumentException("window must not be null.");
+        }
+
+        int actualPos = -1;
+        int countedRows = -1;
+        int filledRows = -1;
+        final int cookie = mRecentOperations.beginOperation("executeForCursorWindow",
+                sql, bindArgs);
+        try {
+            final PreparedStatement statement = acquirePreparedStatement(sql);
+            try {
+                throwIfStatementForbidden(statement);
+                bindArguments(statement, bindArgs);
+                applyBlockGuardPolicy(statement);
+                attachCancellationSignal(cancellationSignal);
+                try {
+                    final long result = nativeExecuteForCursorWindow(
+                            mConnectionPtr, statement.mStatementPtr, window.mWindowPtr,
+                            startPos, requiredPos, countAllRows);
+                    actualPos = (int)(result >> 32);
+                    countedRows = (int)result;
+                    filledRows = window.getNumRows();
+                    window.setStartPosition(actualPos);
+                    return countedRows;
+                } finally {
+                    detachCancellationSignal(cancellationSignal);
+                }
+            } finally {
+                releasePreparedStatement(statement);
+            }
+        } catch (RuntimeException ex) {
+            mRecentOperations.failOperation(cookie, ex);
+            throw ex;
+        } finally {
+            if (mRecentOperations.endOperationDeferLog(cookie)) {
+                mRecentOperations.logOperation(cookie, "window='" + window
+                        + "', startPos=" + startPos
+                        + ", actualPos=" + actualPos
+                        + ", filledRows=" + filledRows
+                        + ", countedRows=" + countedRows);
+            }
+        }
+    }
+
+    private PreparedStatement acquirePreparedStatement(String sql) {
+        PreparedStatement statement = mPreparedStatementCache.get(sql);
+        boolean skipCache = false;
+        if (statement != null) {
+            if (!statement.mInUse) {
+                return statement;
+            }
+            // The statement is already in the cache but is in use (this statement appears
+            // to be not only re-entrant but recursive!).  So prepare a new copy of the
+            // statement but do not cache it.
+            skipCache = true;
+        }
+
+        final int statementPtr = nativePrepareStatement(mConnectionPtr, sql);
+        try {
+            final int numParameters = nativeGetParameterCount(mConnectionPtr, statementPtr);
+            final int type = DatabaseUtils.getSqlStatementType(sql);
+            final boolean readOnly = nativeIsReadOnly(mConnectionPtr, statementPtr);
+            statement = obtainPreparedStatement(sql, statementPtr, numParameters, type, readOnly);
+            if (!skipCache && isCacheable(type)) {
+                mPreparedStatementCache.put(sql, statement);
+                statement.mInCache = true;
+            }
+        } catch (RuntimeException ex) {
+            // Finalize the statement if an exception occurred and we did not add
+            // it to the cache.  If it is already in the cache, then leave it there.
+            if (statement == null || !statement.mInCache) {
+                nativeFinalizeStatement(mConnectionPtr, statementPtr);
+            }
+            throw ex;
+        }
+        statement.mInUse = true;
+        return statement;
+    }
+
+    private void releasePreparedStatement(PreparedStatement statement) {
+        statement.mInUse = false;
+        if (statement.mInCache) {
+            try {
+                nativeResetStatementAndClearBindings(mConnectionPtr, statement.mStatementPtr);
+            } catch (SQLiteException ex) {
+                // The statement could not be reset due to an error.  Remove it from the cache.
+                // When remove() is called, the cache will invoke its entryRemoved() callback,
+                // which will in turn call finalizePreparedStatement() to finalize and
+                // recycle the statement.
+                if (DEBUG) {
+                    Log.d(TAG, "Could not reset prepared statement due to an exception.  "
+                            + "Removing it from the cache.  SQL: "
+                            + trimSqlForDisplay(statement.mSql), ex);
+                }
+
+                mPreparedStatementCache.remove(statement.mSql);
+            }
+        } else {
+            finalizePreparedStatement(statement);
+        }
+    }
+
+    private void finalizePreparedStatement(PreparedStatement statement) {
+        nativeFinalizeStatement(mConnectionPtr, statement.mStatementPtr);
+        recyclePreparedStatement(statement);
+    }
+
+    private void attachCancellationSignal(CancellationSignal cancellationSignal) {
+        if (cancellationSignal != null) {
+            cancellationSignal.throwIfCanceled();
+
+            mCancellationSignalAttachCount += 1;
+            if (mCancellationSignalAttachCount == 1) {
+                // Reset cancellation flag before executing the statement.
+                nativeResetCancel(mConnectionPtr, true /*cancelable*/);
+
+                // After this point, onCancel() may be called concurrently.
+                cancellationSignal.setOnCancelListener(this);
+            }
+        }
+    }
+
+    private void detachCancellationSignal(CancellationSignal cancellationSignal) {
+        if (cancellationSignal != null) {
+            assert mCancellationSignalAttachCount > 0;
+
+            mCancellationSignalAttachCount -= 1;
+            if (mCancellationSignalAttachCount == 0) {
+                // After this point, onCancel() cannot be called concurrently.
+                cancellationSignal.setOnCancelListener(null);
+
+                // Reset cancellation flag after executing the statement.
+                nativeResetCancel(mConnectionPtr, false /*cancelable*/);
+            }
+        }
+    }
+
+    // CancellationSignal.OnCancelListener callback.
+    // This method may be called on a different thread than the executing statement.
+    // However, it will only be called between calls to attachCancellationSignal and
+    // detachCancellationSignal, while a statement is executing.  We can safely assume
+    // that the SQLite connection is still alive.
+    @Override
+    public void onCancel() {
+        nativeCancel(mConnectionPtr);
+    }
+
+    private void bindArguments(PreparedStatement statement, Object[] bindArgs) {
+        final int count = bindArgs != null ? bindArgs.length : 0;
+        if (count != statement.mNumParameters) {
+            throw new SQLiteBindOrColumnIndexOutOfRangeException(
+                    "Expected " + statement.mNumParameters + " bind arguments but "
+                    + bindArgs.length + " were provided.");
+        }
+        if (count == 0) {
+            return;
+        }
+
+        final int statementPtr = statement.mStatementPtr;
+        for (int i = 0; i < count; i++) {
+            final Object arg = bindArgs[i];
+            switch (DatabaseUtils.getTypeOfObject(arg)) {
+                case Cursor.FIELD_TYPE_NULL:
+                    nativeBindNull(mConnectionPtr, statementPtr, i + 1);
+                    break;
+                case Cursor.FIELD_TYPE_INTEGER:
+                    nativeBindLong(mConnectionPtr, statementPtr, i + 1,
+                            ((Number)arg).longValue());
+                    break;
+                case Cursor.FIELD_TYPE_FLOAT:
+                    nativeBindDouble(mConnectionPtr, statementPtr, i + 1,
+                            ((Number)arg).doubleValue());
+                    break;
+                case Cursor.FIELD_TYPE_BLOB:
+                    nativeBindBlob(mConnectionPtr, statementPtr, i + 1, (byte[])arg);
+                    break;
+                case Cursor.FIELD_TYPE_STRING:
+                default:
+                    if (arg instanceof Boolean) {
+                        // Provide compatibility with legacy applications which may pass
+                        // Boolean values in bind args.
+                        nativeBindLong(mConnectionPtr, statementPtr, i + 1,
+                                ((Boolean)arg).booleanValue() ? 1 : 0);
+                    } else {
+                        nativeBindString(mConnectionPtr, statementPtr, i + 1, arg.toString());
+                    }
+                    break;
+            }
+        }
+    }
+
+    private void throwIfStatementForbidden(PreparedStatement statement) {
+        if (mOnlyAllowReadOnlyOperations && !statement.mReadOnly) {
+            throw new SQLiteException("Cannot execute this statement because it "
+                    + "might modify the database but the connection is read-only.");
+        }
+    }
+
+    private static boolean isCacheable(int statementType) {
+        if (statementType == DatabaseUtils.STATEMENT_UPDATE
+                || statementType == DatabaseUtils.STATEMENT_SELECT) {
+            return true;
+        }
+        return false;
+    }
+
+    private void applyBlockGuardPolicy(PreparedStatement statement) {
+        if (!mConfiguration.isInMemoryDb()) {
+            if (statement.mReadOnly) {
+                BlockGuard.getThreadPolicy().onReadFromDisk();
+            } else {
+                BlockGuard.getThreadPolicy().onWriteToDisk();
+            }
+        }
+    }
+
+    /**
+     * Dumps debugging information about this connection.
+     *
+     * @param printer The printer to receive the dump, not null.
+     * @param verbose True to dump more verbose information.
+     */
+    public void dump(Printer printer, boolean verbose) {
+        dumpUnsafe(printer, verbose);
+    }
+
+    /**
+     * Dumps debugging information about this connection, in the case where the
+     * caller might not actually own the connection.
+     *
+     * This function is written so that it may be called by a thread that does not
+     * own the connection.  We need to be very careful because the connection state is
+     * not synchronized.
+     *
+     * At worst, the method may return stale or slightly wrong data, however
+     * it should not crash.  This is ok as it is only used for diagnostic purposes.
+     *
+     * @param printer The printer to receive the dump, not null.
+     * @param verbose True to dump more verbose information.
+     */
+    void dumpUnsafe(Printer printer, boolean verbose) {
+        printer.println("Connection #" + mConnectionId + ":");
+        if (verbose) {
+            printer.println("  connectionPtr: 0x" + Integer.toHexString(mConnectionPtr));
+        }
+        printer.println("  isPrimaryConnection: " + mIsPrimaryConnection);
+        printer.println("  onlyAllowReadOnlyOperations: " + mOnlyAllowReadOnlyOperations);
+
+        mRecentOperations.dump(printer);
+
+        if (verbose) {
+            mPreparedStatementCache.dump(printer);
+        }
+    }
+
+    /**
+     * Describes the currently executing operation, in the case where the
+     * caller might not actually own the connection.
+     *
+     * This function is written so that it may be called by a thread that does not
+     * own the connection.  We need to be very careful because the connection state is
+     * not synchronized.
+     *
+     * At worst, the method may return stale or slightly wrong data, however
+     * it should not crash.  This is ok as it is only used for diagnostic purposes.
+     *
+     * @return A description of the current operation including how long it has been running,
+     * or null if none.
+     */
+    String describeCurrentOperationUnsafe() {
+        return mRecentOperations.describeCurrentOperation();
+    }
+
+    /**
+     * Collects statistics about database connection memory usage.
+     *
+     * @param dbStatsList The list to populate.
+     */
+    void collectDbStats(ArrayList<DbStats> dbStatsList) {
+        // Get information about the main database.
+        int lookaside = nativeGetDbLookaside(mConnectionPtr);
+        long pageCount = 0;
+        long pageSize = 0;
+        try {
+            pageCount = executeForLong("PRAGMA page_count;", null, null);
+            pageSize = executeForLong("PRAGMA page_size;", null, null);
+        } catch (SQLiteException ex) {
+            // Ignore.
+        }
+        dbStatsList.add(getMainDbStatsUnsafe(lookaside, pageCount, pageSize));
+
+        // Get information about attached databases.
+        // We ignore the first row in the database list because it corresponds to
+        // the main database which we have already described.
+        CursorWindow window = new CursorWindow("collectDbStats");
+        try {
+            executeForCursorWindow("PRAGMA database_list;", null, window, 0, 0, false, null);
+            for (int i = 1; i < window.getNumRows(); i++) {
+                String name = window.getString(i, 1);
+                String path = window.getString(i, 2);
+                pageCount = 0;
+                pageSize = 0;
+                try {
+                    pageCount = executeForLong("PRAGMA " + name + ".page_count;", null, null);
+                    pageSize = executeForLong("PRAGMA " + name + ".page_size;", null, null);
+                } catch (SQLiteException ex) {
+                    // Ignore.
+                }
+                String label = "  (attached) " + name;
+                if (!path.isEmpty()) {
+                    label += ": " + path;
+                }
+                dbStatsList.add(new DbStats(label, pageCount, pageSize, 0, 0, 0, 0));
+            }
+        } catch (SQLiteException ex) {
+            // Ignore.
+        } finally {
+            window.close();
+        }
+    }
+
+    /**
+     * Collects statistics about database connection memory usage, in the case where the
+     * caller might not actually own the connection.
+     *
+     * @return The statistics object, never null.
+     */
+    void collectDbStatsUnsafe(ArrayList<DbStats> dbStatsList) {
+        dbStatsList.add(getMainDbStatsUnsafe(0, 0, 0));
+    }
+
+    private DbStats getMainDbStatsUnsafe(int lookaside, long pageCount, long pageSize) {
+        // The prepared statement cache is thread-safe so we can access its statistics
+        // even if we do not own the database connection.
+        String label = mConfiguration.path;
+        if (!mIsPrimaryConnection) {
+            label += " (" + mConnectionId + ")";
+        }
+        return new DbStats(label, pageCount, pageSize, lookaside,
+                mPreparedStatementCache.hitCount(),
+                mPreparedStatementCache.missCount(),
+                mPreparedStatementCache.size());
+    }
+
+    @Override
+    public String toString() {
+        return "SQLiteConnection: " + mConfiguration.path + " (" + mConnectionId + ")";
+    }
+
+    private PreparedStatement obtainPreparedStatement(String sql, int statementPtr,
+            int numParameters, int type, boolean readOnly) {
+        PreparedStatement statement = mPreparedStatementPool;
+        if (statement != null) {
+            mPreparedStatementPool = statement.mPoolNext;
+            statement.mPoolNext = null;
+            statement.mInCache = false;
+        } else {
+            statement = new PreparedStatement();
+        }
+        statement.mSql = sql;
+        statement.mStatementPtr = statementPtr;
+        statement.mNumParameters = numParameters;
+        statement.mType = type;
+        statement.mReadOnly = readOnly;
+        return statement;
+    }
+
+    private void recyclePreparedStatement(PreparedStatement statement) {
+        statement.mSql = null;
+        statement.mPoolNext = mPreparedStatementPool;
+        mPreparedStatementPool = statement;
+    }
+
+    private static String trimSqlForDisplay(String sql) {
+        return TRIM_SQL_PATTERN.matcher(sql).replaceAll(" ");
+    }
+
+    /**
+     * Holder type for a prepared statement.
+     *
+     * Although this object holds a pointer to a native statement object, it
+     * does not have a finalizer.  This is deliberate.  The {@link SQLiteConnection}
+     * owns the statement object and will take care of freeing it when needed.
+     * In particular, closing the connection requires a guarantee of deterministic
+     * resource disposal because all native statement objects must be freed before
+     * the native database object can be closed.  So no finalizers here.
+     */
+    private static final class PreparedStatement {
+        // Next item in pool.
+        public PreparedStatement mPoolNext;
+
+        // The SQL from which the statement was prepared.
+        public String mSql;
+
+        // The native sqlite3_stmt object pointer.
+        // Lifetime is managed explicitly by the connection.
+        public int mStatementPtr;
+
+        // The number of parameters that the prepared statement has.
+        public int mNumParameters;
+
+        // The statement type.
+        public int mType;
+
+        // True if the statement is read-only.
+        public boolean mReadOnly;
+
+        // True if the statement is in the cache.
+        public boolean mInCache;
+
+        // True if the statement is in use (currently executing).
+        // We need this flag because due to the use of custom functions in triggers, it's
+        // possible for SQLite calls to be re-entrant.  Consequently we need to prevent
+        // in use statements from being finalized until they are no longer in use.
+        public boolean mInUse;
+    }
+
+    private final class PreparedStatementCache
+            extends LruCache<String, PreparedStatement> {
+        public PreparedStatementCache(int size) {
+            super(size);
+        }
+
+        @Override
+        protected void entryRemoved(boolean evicted, String key,
+                PreparedStatement oldValue, PreparedStatement newValue) {
+            oldValue.mInCache = false;
+            if (!oldValue.mInUse) {
+                finalizePreparedStatement(oldValue);
+            }
+        }
+
+        public void dump(Printer printer) {
+            printer.println("  Prepared statement cache:");
+            Map<String, PreparedStatement> cache = snapshot();
+            if (!cache.isEmpty()) {
+                int i = 0;
+                for (Map.Entry<String, PreparedStatement> entry : cache.entrySet()) {
+                    PreparedStatement statement = entry.getValue();
+                    if (statement.mInCache) { // might be false due to a race with entryRemoved
+                        String sql = entry.getKey();
+                        printer.println("    " + i + ": statementPtr=0x"
+                                + Integer.toHexString(statement.mStatementPtr)
+                                + ", numParameters=" + statement.mNumParameters
+                                + ", type=" + statement.mType
+                                + ", readOnly=" + statement.mReadOnly
+                                + ", sql=\"" + trimSqlForDisplay(sql) + "\"");
+                    }
+                    i += 1;
+                }
+            } else {
+                printer.println("    <none>");
+            }
+        }
+    }
+
+    private static final class OperationLog {
+        private static final int MAX_RECENT_OPERATIONS = 20;
+        private static final int COOKIE_GENERATION_SHIFT = 8;
+        private static final int COOKIE_INDEX_MASK = 0xff;
+
+        private final Operation[] mOperations = new Operation[MAX_RECENT_OPERATIONS];
+        private int mIndex;
+        private int mGeneration;
+
+        public int beginOperation(String kind, String sql, Object[] bindArgs) {
+            synchronized (mOperations) {
+                final int index = (mIndex + 1) % MAX_RECENT_OPERATIONS;
+                Operation operation = mOperations[index];
+                if (operation == null) {
+                    operation = new Operation();
+                    mOperations[index] = operation;
+                } else {
+                    operation.mFinished = false;
+                    operation.mException = null;
+                    if (operation.mBindArgs != null) {
+                        operation.mBindArgs.clear();
+                    }
+                }
+                operation.mStartTime = System.currentTimeMillis();
+                operation.mKind = kind;
+                operation.mSql = sql;
+                if (bindArgs != null) {
+                    if (operation.mBindArgs == null) {
+                        operation.mBindArgs = new ArrayList<Object>();
+                    } else {
+                        operation.mBindArgs.clear();
+                    }
+                    for (int i = 0; i < bindArgs.length; i++) {
+                        final Object arg = bindArgs[i];
+                        if (arg != null && arg instanceof byte[]) {
+                            // Don't hold onto the real byte array longer than necessary.
+                            operation.mBindArgs.add(EMPTY_BYTE_ARRAY);
+                        } else {
+                            operation.mBindArgs.add(arg);
+                        }
+                    }
+                }
+                operation.mCookie = newOperationCookieLocked(index);
+                mIndex = index;
+                return operation.mCookie;
+            }
+        }
+
+        public void failOperation(int cookie, Exception ex) {
+            synchronized (mOperations) {
+                final Operation operation = getOperationLocked(cookie);
+                if (operation != null) {
+                    operation.mException = ex;
+                }
+            }
+        }
+
+        public void endOperation(int cookie) {
+            synchronized (mOperations) {
+                if (endOperationDeferLogLocked(cookie)) {
+                    logOperationLocked(cookie, null);
+                }
+            }
+        }
+
+        public boolean endOperationDeferLog(int cookie) {
+            synchronized (mOperations) {
+                return endOperationDeferLogLocked(cookie);
+            }
+        }
+
+        public void logOperation(int cookie, String detail) {
+            synchronized (mOperations) {
+                logOperationLocked(cookie, detail);
+            }
+        }
+
+        private boolean endOperationDeferLogLocked(int cookie) {
+            final Operation operation = getOperationLocked(cookie);
+            if (operation != null) {
+                operation.mEndTime = System.currentTimeMillis();
+                operation.mFinished = true;
+                return SQLiteDebug.DEBUG_LOG_SLOW_QUERIES && SQLiteDebug.shouldLogSlowQuery(
+                                operation.mEndTime - operation.mStartTime);
+            }
+            return false;
+        }
+
+        private void logOperationLocked(int cookie, String detail) {
+            final Operation operation = getOperationLocked(cookie);
+            StringBuilder msg = new StringBuilder();
+            operation.describe(msg);
+            if (detail != null) {
+                msg.append(", ").append(detail);
+            }
+            Log.d(TAG, msg.toString());
+        }
+
+        private int newOperationCookieLocked(int index) {
+            final int generation = mGeneration++;
+            return generation << COOKIE_GENERATION_SHIFT | index;
+        }
+
+        private Operation getOperationLocked(int cookie) {
+            final int index = cookie & COOKIE_INDEX_MASK;
+            final Operation operation = mOperations[index];
+            return operation.mCookie == cookie ? operation : null;
+        }
+
+        public String describeCurrentOperation() {
+            synchronized (mOperations) {
+                final Operation operation = mOperations[mIndex];
+                if (operation != null && !operation.mFinished) {
+                    StringBuilder msg = new StringBuilder();
+                    operation.describe(msg);
+                    return msg.toString();
+                }
+                return null;
+            }
+        }
+
+        public void dump(Printer printer) {
+            synchronized (mOperations) {
+                printer.println("  Most recently executed operations:");
+                int index = mIndex;
+                Operation operation = mOperations[index];
+                if (operation != null) {
+                    int n = 0;
+                    do {
+                        StringBuilder msg = new StringBuilder();
+                        msg.append("    ").append(n).append(": [");
+                        msg.append(operation.getFormattedStartTime());
+                        msg.append("] ");
+                        operation.describe(msg);
+                        printer.println(msg.toString());
+
+                        if (index > 0) {
+                            index -= 1;
+                        } else {
+                            index = MAX_RECENT_OPERATIONS - 1;
+                        }
+                        n += 1;
+                        operation = mOperations[index];
+                    } while (operation != null && n < MAX_RECENT_OPERATIONS);
+                } else {
+                    printer.println("    <none>");
+                }
+            }
+        }
+    }
+
+    private static final class Operation {
+        private static final SimpleDateFormat sDateFormat =
+                new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
+
+        public long mStartTime;
+        public long mEndTime;
+        public String mKind;
+        public String mSql;
+        public ArrayList<Object> mBindArgs;
+        public boolean mFinished;
+        public Exception mException;
+        public int mCookie;
+
+        public void describe(StringBuilder msg) {
+            msg.append(mKind);
+            if (mFinished) {
+                msg.append(" took ").append(mEndTime - mStartTime).append("ms");
+            } else {
+                msg.append(" started ").append(System.currentTimeMillis() - mStartTime)
+                        .append("ms ago");
+            }
+            msg.append(" - ").append(getStatus());
+            if (mSql != null) {
+                msg.append(", sql=\"").append(trimSqlForDisplay(mSql)).append("\"");
+            }
+            if (mBindArgs != null && mBindArgs.size() != 0) {
+                msg.append(", bindArgs=[");
+                final int count = mBindArgs.size();
+                for (int i = 0; i < count; i++) {
+                    final Object arg = mBindArgs.get(i);
+                    if (i != 0) {
+                        msg.append(", ");
+                    }
+                    if (arg == null) {
+                        msg.append("null");
+                    } else if (arg instanceof byte[]) {
+                        msg.append("<byte[]>");
+                    } else if (arg instanceof String) {
+                        msg.append("\"").append((String)arg).append("\"");
+                    } else {
+                        msg.append(arg);
+                    }
+                }
+                msg.append("]");
+            }
+            if (mException != null) {
+                msg.append(", exception=\"").append(mException.getMessage()).append("\"");
+            }
+        }
+
+        private String getStatus() {
+            if (!mFinished) {
+                return "running";
+            }
+            return mException != null ? "failed" : "succeeded";
+        }
+
+        private String getFormattedStartTime() {
+            return sDateFormat.format(new Date(mStartTime));
+        }
+    }
+}
diff --git a/core/java/android/database/sqlite/SQLiteConnectionPool.java b/core/java/android/database/sqlite/SQLiteConnectionPool.java
new file mode 100644
index 0000000..236948e
--- /dev/null
+++ b/core/java/android/database/sqlite/SQLiteConnectionPool.java
@@ -0,0 +1,970 @@
+/*
+ * 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 android.database.sqlite;
+
+import dalvik.system.CloseGuard;
+
+import android.content.CancellationSignal;
+import android.content.OperationCanceledException;
+import android.database.sqlite.SQLiteDebug.DbStats;
+import android.os.SystemClock;
+import android.util.Log;
+import android.util.PrefixPrinter;
+import android.util.Printer;
+
+import java.io.Closeable;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.WeakHashMap;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.locks.LockSupport;
+
+/**
+ * Maintains a pool of active SQLite database connections.
+ * <p>
+ * At any given time, a connection is either owned by the pool, or it has been
+ * acquired by a {@link SQLiteSession}.  When the {@link SQLiteSession} is
+ * finished with the connection it is using, it must return the connection
+ * back to the pool.
+ * </p><p>
+ * The pool holds strong references to the connections it owns.  However,
+ * it only holds <em>weak references</em> to the connections that sessions
+ * have acquired from it.  Using weak references in the latter case ensures
+ * that the connection pool can detect when connections have been improperly
+ * abandoned so that it can create new connections to replace them if needed.
+ * </p><p>
+ * The connection pool is thread-safe (but the connections themselves are not).
+ * </p>
+ *
+ * <h2>Exception safety</h2>
+ * <p>
+ * This code attempts to maintain the invariant that opened connections are
+ * always owned.  Unfortunately that means it needs to handle exceptions
+ * all over to ensure that broken connections get cleaned up.  Most
+ * operations invokving SQLite can throw {@link SQLiteException} or other
+ * runtime exceptions.  This is a bit of a pain to deal with because the compiler
+ * cannot help us catch missing exception handling code.
+ * </p><p>
+ * The general rule for this file: If we are making calls out to
+ * {@link SQLiteConnection} then we must be prepared to handle any
+ * runtime exceptions it might throw at us.  Note that out-of-memory
+ * is an {@link Error}, not a {@link RuntimeException}.  We don't trouble ourselves
+ * handling out of memory because it is hard to do anything at all sensible then
+ * and most likely the VM is about to crash.
+ * </p>
+ *
+ * @hide
+ */
+public final class SQLiteConnectionPool implements Closeable {
+    private static final String TAG = "SQLiteConnectionPool";
+
+    // Amount of time to wait in milliseconds before unblocking acquireConnection
+    // and logging a message about the connection pool being busy.
+    private static final long CONNECTION_POOL_BUSY_MILLIS = 30 * 1000; // 30 seconds
+
+    private final CloseGuard mCloseGuard = CloseGuard.get();
+
+    private final Object mLock = new Object();
+    private final AtomicBoolean mConnectionLeaked = new AtomicBoolean();
+    private final SQLiteDatabaseConfiguration mConfiguration;
+    private boolean mIsOpen;
+    private int mNextConnectionId;
+
+    private ConnectionWaiter mConnectionWaiterPool;
+    private ConnectionWaiter mConnectionWaiterQueue;
+
+    // Strong references to all available connections.
+    private final ArrayList<SQLiteConnection> mAvailableNonPrimaryConnections =
+            new ArrayList<SQLiteConnection>();
+    private SQLiteConnection mAvailablePrimaryConnection;
+
+    // Weak references to all acquired connections.  The associated value
+    // is a boolean that indicates whether the connection must be reconfigured
+    // before being returned to the available connection list.
+    // For example, the prepared statement cache size may have changed and
+    // need to be updated.
+    private final WeakHashMap<SQLiteConnection, Boolean> mAcquiredConnections =
+            new WeakHashMap<SQLiteConnection, Boolean>();
+
+    /**
+     * Connection flag: Read-only.
+     * <p>
+     * This flag indicates that the connection will only be used to
+     * perform read-only operations.
+     * </p>
+     */
+    public static final int CONNECTION_FLAG_READ_ONLY = 1 << 0;
+
+    /**
+     * Connection flag: Primary connection affinity.
+     * <p>
+     * This flag indicates that the primary connection is required.
+     * This flag helps support legacy applications that expect most data modifying
+     * operations to be serialized by locking the primary database connection.
+     * Setting this flag essentially implements the old "db lock" concept by preventing
+     * an operation from being performed until it can obtain exclusive access to
+     * the primary connection.
+     * </p>
+     */
+    public static final int CONNECTION_FLAG_PRIMARY_CONNECTION_AFFINITY = 1 << 1;
+
+    /**
+     * Connection flag: Connection is being used interactively.
+     * <p>
+     * This flag indicates that the connection is needed by the UI thread.
+     * The connection pool can use this flag to elevate the priority
+     * of the database connection request.
+     * </p>
+     */
+    public static final int CONNECTION_FLAG_INTERACTIVE = 1 << 2;
+
+    private SQLiteConnectionPool(SQLiteDatabaseConfiguration configuration) {
+        mConfiguration = new SQLiteDatabaseConfiguration(configuration);
+    }
+
+    @Override
+    protected void finalize() throws Throwable {
+        try {
+            dispose(true);
+        } finally {
+            super.finalize();
+        }
+    }
+
+    /**
+     * Opens a connection pool for the specified database.
+     *
+     * @param configuration The database configuration.
+     * @return The connection pool.
+     *
+     * @throws SQLiteException if a database error occurs.
+     */
+    public static SQLiteConnectionPool open(SQLiteDatabaseConfiguration configuration) {
+        if (configuration == null) {
+            throw new IllegalArgumentException("configuration must not be null.");
+        }
+
+        // Create the pool.
+        SQLiteConnectionPool pool = new SQLiteConnectionPool(configuration);
+        pool.open(); // might throw
+        return pool;
+    }
+
+    // Might throw
+    private void open() {
+        // Open the primary connection.
+        // This might throw if the database is corrupt.
+        mAvailablePrimaryConnection = openConnectionLocked(
+                true /*primaryConnection*/); // might throw
+
+        // Mark the pool as being open for business.
+        mIsOpen = true;
+        mCloseGuard.open("close");
+    }
+
+    /**
+     * Closes the connection pool.
+     * <p>
+     * When the connection pool is closed, it will refuse all further requests
+     * to acquire connections.  All connections that are currently available in
+     * the pool are closed immediately.  Any connections that are still in use
+     * will be closed as soon as they are returned to the pool.
+     * </p>
+     *
+     * @throws IllegalStateException if the pool has been closed.
+     */
+    public void close() {
+        dispose(false);
+    }
+
+    private void dispose(boolean finalized) {
+        if (mCloseGuard != null) {
+            if (finalized) {
+                mCloseGuard.warnIfOpen();
+            }
+            mCloseGuard.close();
+        }
+
+        if (!finalized) {
+            // Close all connections.  We don't need (or want) to do this
+            // when finalized because we don't know what state the connections
+            // themselves will be in.  The finalizer is really just here for CloseGuard.
+            // The connections will take care of themselves when their own finalizers run.
+            synchronized (mLock) {
+                throwIfClosedLocked();
+
+                mIsOpen = false;
+
+                final int count = mAvailableNonPrimaryConnections.size();
+                for (int i = 0; i < count; i++) {
+                    closeConnectionAndLogExceptionsLocked(mAvailableNonPrimaryConnections.get(i));
+                }
+                mAvailableNonPrimaryConnections.clear();
+
+                if (mAvailablePrimaryConnection != null) {
+                    closeConnectionAndLogExceptionsLocked(mAvailablePrimaryConnection);
+                    mAvailablePrimaryConnection = null;
+                }
+
+                final int pendingCount = mAcquiredConnections.size();
+                if (pendingCount != 0) {
+                    Log.i(TAG, "The connection pool for " + mConfiguration.label
+                            + " has been closed but there are still "
+                            + pendingCount + " connections in use.  They will be closed "
+                            + "as they are released back to the pool.");
+                }
+
+                wakeConnectionWaitersLocked();
+            }
+        }
+    }
+
+    /**
+     * Reconfigures the database configuration of the connection pool and all of its
+     * connections.
+     * <p>
+     * Configuration changes are propagated down to connections immediately if
+     * they are available or as soon as they are released.  This includes changes
+     * that affect the size of the pool.
+     * </p>
+     *
+     * @param configuration The new configuration.
+     *
+     * @throws IllegalStateException if the pool has been closed.
+     */
+    public void reconfigure(SQLiteDatabaseConfiguration configuration) {
+        if (configuration == null) {
+            throw new IllegalArgumentException("configuration must not be null.");
+        }
+
+        synchronized (mLock) {
+            throwIfClosedLocked();
+
+            final boolean poolSizeChanged = mConfiguration.maxConnectionPoolSize
+                    != configuration.maxConnectionPoolSize;
+            mConfiguration.updateParametersFrom(configuration);
+
+            if (poolSizeChanged) {
+                int availableCount = mAvailableNonPrimaryConnections.size();
+                while (availableCount-- > mConfiguration.maxConnectionPoolSize - 1) {
+                    SQLiteConnection connection =
+                            mAvailableNonPrimaryConnections.remove(availableCount);
+                    closeConnectionAndLogExceptionsLocked(connection);
+                }
+            }
+
+            reconfigureAllConnectionsLocked();
+
+            wakeConnectionWaitersLocked();
+        }
+    }
+
+    /**
+     * Acquires a connection from the pool.
+     * <p>
+     * The caller must call {@link #releaseConnection} to release the connection
+     * back to the pool when it is finished.  Failure to do so will result
+     * in much unpleasantness.
+     * </p>
+     *
+     * @param sql If not null, try to find a connection that already has
+     * the specified SQL statement in its prepared statement cache.
+     * @param connectionFlags The connection request flags.
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     * @return The connection that was acquired, never null.
+     *
+     * @throws IllegalStateException if the pool has been closed.
+     * @throws SQLiteException if a database error occurs.
+     * @throws OperationCanceledException if the operation was canceled.
+     */
+    public SQLiteConnection acquireConnection(String sql, int connectionFlags,
+            CancellationSignal cancellationSignal) {
+        return waitForConnection(sql, connectionFlags, cancellationSignal);
+    }
+
+    /**
+     * Releases a connection back to the pool.
+     * <p>
+     * It is ok to call this method after the pool has closed, to release
+     * connections that were still in use at the time of closure.
+     * </p>
+     *
+     * @param connection The connection to release.  Must not be null.
+     *
+     * @throws IllegalStateException if the connection was not acquired
+     * from this pool or if it has already been released.
+     */
+    public void releaseConnection(SQLiteConnection connection) {
+        synchronized (mLock) {
+            Boolean mustReconfigure = mAcquiredConnections.remove(connection);
+            if (mustReconfigure == null) {
+                throw new IllegalStateException("Cannot perform this operation "
+                        + "because the specified connection was not acquired "
+                        + "from this pool or has already been released.");
+            }
+
+            if (!mIsOpen) {
+                closeConnectionAndLogExceptionsLocked(connection);
+            } else if (connection.isPrimaryConnection()) {
+                assert mAvailablePrimaryConnection == null;
+                try {
+                    if (mustReconfigure == Boolean.TRUE) {
+                        connection.reconfigure(mConfiguration); // might throw
+                    }
+                } catch (RuntimeException ex) {
+                    Log.e(TAG, "Failed to reconfigure released primary connection, closing it: "
+                            + connection, ex);
+                    closeConnectionAndLogExceptionsLocked(connection);
+                    connection = null;
+                }
+                if (connection != null) {
+                    mAvailablePrimaryConnection = connection;
+                }
+                wakeConnectionWaitersLocked();
+            } else if (mAvailableNonPrimaryConnections.size() >=
+                    mConfiguration.maxConnectionPoolSize - 1) {
+                closeConnectionAndLogExceptionsLocked(connection);
+            } else {
+                try {
+                    if (mustReconfigure == Boolean.TRUE) {
+                        connection.reconfigure(mConfiguration); // might throw
+                    }
+                } catch (RuntimeException ex) {
+                    Log.e(TAG, "Failed to reconfigure released non-primary connection, "
+                            + "closing it: " + connection, ex);
+                    closeConnectionAndLogExceptionsLocked(connection);
+                    connection = null;
+                }
+                if (connection != null) {
+                    mAvailableNonPrimaryConnections.add(connection);
+                }
+                wakeConnectionWaitersLocked();
+            }
+        }
+    }
+
+    /**
+     * Returns true if the session should yield the connection due to
+     * contention over available database connections.
+     *
+     * @param connection The connection owned by the session.
+     * @param connectionFlags The connection request flags.
+     * @return True if the session should yield its connection.
+     *
+     * @throws IllegalStateException if the connection was not acquired
+     * from this pool or if it has already been released.
+     */
+    public boolean shouldYieldConnection(SQLiteConnection connection, int connectionFlags) {
+        synchronized (mLock) {
+            if (!mAcquiredConnections.containsKey(connection)) {
+                throw new IllegalStateException("Cannot perform this operation "
+                        + "because the specified connection was not acquired "
+                        + "from this pool or has already been released.");
+            }
+
+            if (!mIsOpen) {
+                return false;
+            }
+
+            return isSessionBlockingImportantConnectionWaitersLocked(
+                    connection.isPrimaryConnection(), connectionFlags);
+        }
+    }
+
+    /**
+     * Collects statistics about database connection memory usage.
+     *
+     * @param dbStatsList The list to populate.
+     */
+    public void collectDbStats(ArrayList<DbStats> dbStatsList) {
+        synchronized (mLock) {
+            if (mAvailablePrimaryConnection != null) {
+                mAvailablePrimaryConnection.collectDbStats(dbStatsList);
+            }
+
+            for (SQLiteConnection connection : mAvailableNonPrimaryConnections) {
+                connection.collectDbStats(dbStatsList);
+            }
+
+            for (SQLiteConnection connection : mAcquiredConnections.keySet()) {
+                connection.collectDbStatsUnsafe(dbStatsList);
+            }
+        }
+    }
+
+    // Might throw.
+    private SQLiteConnection openConnectionLocked(boolean primaryConnection) {
+        final int connectionId = mNextConnectionId++;
+        return SQLiteConnection.open(this, mConfiguration,
+                connectionId, primaryConnection); // might throw
+    }
+
+    void onConnectionLeaked() {
+        // This code is running inside of the SQLiteConnection finalizer.
+        //
+        // We don't know whether it is just the connection that has been finalized (and leaked)
+        // or whether the connection pool has also been or is about to be finalized.
+        // Consequently, it would be a bad idea to try to grab any locks or to
+        // do any significant work here.  So we do the simplest possible thing and
+        // set a flag.  waitForConnection() periodically checks this flag (when it
+        // times out) so that it can recover from leaked connections and wake
+        // itself or other threads up if necessary.
+        //
+        // You might still wonder why we don't try to do more to wake up the waiters
+        // immediately.  First, as explained above, it would be hard to do safely
+        // unless we started an extra Thread to function as a reference queue.  Second,
+        // this is never supposed to happen in normal operation.  Third, there is no
+        // guarantee that the GC will actually detect the leak in a timely manner so
+        // it's not all that important that we recover from the leak in a timely manner
+        // either.  Fourth, if a badly behaved application finds itself hung waiting for
+        // several seconds while waiting for a leaked connection to be detected and recreated,
+        // then perhaps its authors will have added incentive to fix the problem!
+
+        Log.w(TAG, "A SQLiteConnection object for database '"
+                + mConfiguration.label + "' was leaked!  Please fix your application "
+                + "to end transactions in progress properly and to close the database "
+                + "when it is no longer needed.");
+
+        mConnectionLeaked.set(true);
+    }
+
+    // Can't throw.
+    private void closeConnectionAndLogExceptionsLocked(SQLiteConnection connection) {
+        try {
+            connection.close(); // might throw
+        } catch (RuntimeException ex) {
+            Log.e(TAG, "Failed to close connection, its fate is now in the hands "
+                    + "of the merciful GC: " + connection, ex);
+        }
+    }
+
+    // Can't throw.
+    private void reconfigureAllConnectionsLocked() {
+        boolean wake = false;
+        if (mAvailablePrimaryConnection != null) {
+            try {
+                mAvailablePrimaryConnection.reconfigure(mConfiguration); // might throw
+            } catch (RuntimeException ex) {
+                Log.e(TAG, "Failed to reconfigure available primary connection, closing it: "
+                        + mAvailablePrimaryConnection, ex);
+                closeConnectionAndLogExceptionsLocked(mAvailablePrimaryConnection);
+                mAvailablePrimaryConnection = null;
+                wake = true;
+            }
+        }
+
+        int count = mAvailableNonPrimaryConnections.size();
+        for (int i = 0; i < count; i++) {
+            final SQLiteConnection connection = mAvailableNonPrimaryConnections.get(i);
+            try {
+                connection.reconfigure(mConfiguration); // might throw
+            } catch (RuntimeException ex) {
+                Log.e(TAG, "Failed to reconfigure available non-primary connection, closing it: "
+                        + connection, ex);
+                closeConnectionAndLogExceptionsLocked(connection);
+                mAvailableNonPrimaryConnections.remove(i--);
+                count -= 1;
+                wake = true;
+            }
+        }
+
+        if (!mAcquiredConnections.isEmpty()) {
+            ArrayList<SQLiteConnection> keysToUpdate = new ArrayList<SQLiteConnection>(
+                    mAcquiredConnections.size());
+            for (Map.Entry<SQLiteConnection, Boolean> entry : mAcquiredConnections.entrySet()) {
+                if (entry.getValue() != Boolean.TRUE) {
+                    keysToUpdate.add(entry.getKey());
+                }
+            }
+            final int updateCount = keysToUpdate.size();
+            for (int i = 0; i < updateCount; i++) {
+                mAcquiredConnections.put(keysToUpdate.get(i), Boolean.TRUE);
+            }
+        }
+
+        if (wake) {
+            wakeConnectionWaitersLocked();
+        }
+    }
+
+    // Might throw.
+    private SQLiteConnection waitForConnection(String sql, int connectionFlags,
+            CancellationSignal cancellationSignal) {
+        final boolean wantPrimaryConnection =
+                (connectionFlags & CONNECTION_FLAG_PRIMARY_CONNECTION_AFFINITY) != 0;
+
+        final ConnectionWaiter waiter;
+        synchronized (mLock) {
+            throwIfClosedLocked();
+
+            // Abort if canceled.
+            if (cancellationSignal != null) {
+                cancellationSignal.throwIfCanceled();
+            }
+
+            // Try to acquire a connection.
+            SQLiteConnection connection = null;
+            if (!wantPrimaryConnection) {
+                connection = tryAcquireNonPrimaryConnectionLocked(
+                        sql, connectionFlags); // might throw
+            }
+            if (connection == null) {
+                connection = tryAcquirePrimaryConnectionLocked(connectionFlags); // might throw
+            }
+            if (connection != null) {
+                return connection;
+            }
+
+            // No connections available.  Enqueue a waiter in priority order.
+            final int priority = getPriority(connectionFlags);
+            final long startTime = SystemClock.uptimeMillis();
+            waiter = obtainConnectionWaiterLocked(Thread.currentThread(), startTime,
+                    priority, wantPrimaryConnection, sql, connectionFlags);
+            ConnectionWaiter predecessor = null;
+            ConnectionWaiter successor = mConnectionWaiterQueue;
+            while (successor != null) {
+                if (priority > successor.mPriority) {
+                    waiter.mNext = successor;
+                    break;
+                }
+                predecessor = successor;
+                successor = successor.mNext;
+            }
+            if (predecessor != null) {
+                predecessor.mNext = waiter;
+            } else {
+                mConnectionWaiterQueue = waiter;
+            }
+
+            if (cancellationSignal != null) {
+                final int nonce = waiter.mNonce;
+                cancellationSignal.setOnCancelListener(new CancellationSignal.OnCancelListener() {
+                    @Override
+                    public void onCancel() {
+                        synchronized (mLock) {
+                            cancelConnectionWaiterLocked(waiter, nonce);
+                        }
+                    }
+                });
+            }
+        }
+
+        // Park the thread until a connection is assigned or the pool is closed.
+        // Rethrow an exception from the wait, if we got one.
+        long busyTimeoutMillis = CONNECTION_POOL_BUSY_MILLIS;
+        long nextBusyTimeoutTime = waiter.mStartTime + busyTimeoutMillis;
+        for (;;) {
+            // Detect and recover from connection leaks.
+            if (mConnectionLeaked.compareAndSet(true, false)) {
+                synchronized (mLock) {
+                    wakeConnectionWaitersLocked();
+                }
+            }
+
+            // Wait to be unparked (may already have happened), a timeout, or interruption.
+            LockSupport.parkNanos(this, busyTimeoutMillis * 1000000L);
+
+            // Clear the interrupted flag, just in case.
+            Thread.interrupted();
+
+            // Check whether we are done waiting yet.
+            synchronized (mLock) {
+                throwIfClosedLocked();
+
+                final SQLiteConnection connection = waiter.mAssignedConnection;
+                final RuntimeException ex = waiter.mException;
+                if (connection != null || ex != null) {
+                    if (cancellationSignal != null) {
+                        cancellationSignal.setOnCancelListener(null);
+                    }
+                    recycleConnectionWaiterLocked(waiter);
+                    if (connection != null) {
+                        return connection;
+                    }
+                    throw ex; // rethrow!
+                }
+
+                final long now = SystemClock.uptimeMillis();
+                if (now < nextBusyTimeoutTime) {
+                    busyTimeoutMillis = now - nextBusyTimeoutTime;
+                } else {
+                    logConnectionPoolBusyLocked(now - waiter.mStartTime, connectionFlags);
+                    busyTimeoutMillis = CONNECTION_POOL_BUSY_MILLIS;
+                    nextBusyTimeoutTime = now + busyTimeoutMillis;
+                }
+            }
+        }
+    }
+
+    // Can't throw.
+    private void cancelConnectionWaiterLocked(ConnectionWaiter waiter, int nonce) {
+        if (waiter.mNonce != nonce) {
+            // Waiter already removed and recycled.
+            return;
+        }
+
+        if (waiter.mAssignedConnection != null || waiter.mException != null) {
+            // Waiter is done waiting but has not woken up yet.
+            return;
+        }
+
+        // Waiter must still be waiting.  Dequeue it.
+        ConnectionWaiter predecessor = null;
+        ConnectionWaiter current = mConnectionWaiterQueue;
+        while (current != waiter) {
+            assert current != null;
+            predecessor = current;
+            current = current.mNext;
+        }
+        if (predecessor != null) {
+            predecessor.mNext = waiter.mNext;
+        } else {
+            mConnectionWaiterQueue = waiter.mNext;
+        }
+
+        // Send the waiter an exception and unpark it.
+        waiter.mException = new OperationCanceledException();
+        LockSupport.unpark(waiter.mThread);
+
+        // Check whether removing this waiter will enable other waiters to make progress.
+        wakeConnectionWaitersLocked();
+    }
+
+    // Can't throw.
+    private void logConnectionPoolBusyLocked(long waitMillis, int connectionFlags) {
+        final Thread thread = Thread.currentThread();
+        StringBuilder msg = new StringBuilder();
+        msg.append("The connection pool for database '").append(mConfiguration.label);
+        msg.append("' has been unable to grant a connection to thread ");
+        msg.append(thread.getId()).append(" (").append(thread.getName()).append(") ");
+        msg.append("with flags 0x").append(Integer.toHexString(connectionFlags));
+        msg.append(" for ").append(waitMillis * 0.001f).append(" seconds.\n");
+
+        ArrayList<String> requests = new ArrayList<String>();
+        int activeConnections = 0;
+        int idleConnections = 0;
+        if (!mAcquiredConnections.isEmpty()) {
+            for (Map.Entry<SQLiteConnection, Boolean> entry : mAcquiredConnections.entrySet()) {
+                final SQLiteConnection connection = entry.getKey();
+                String description = connection.describeCurrentOperationUnsafe();
+                if (description != null) {
+                    requests.add(description);
+                    activeConnections += 1;
+                } else {
+                    idleConnections += 1;
+                }
+            }
+        }
+        int availableConnections = mAvailableNonPrimaryConnections.size();
+        if (mAvailablePrimaryConnection != null) {
+            availableConnections += 1;
+        }
+
+        msg.append("Connections: ").append(activeConnections).append(" active, ");
+        msg.append(idleConnections).append(" idle, ");
+        msg.append(availableConnections).append(" available.\n");
+
+        if (!requests.isEmpty()) {
+            msg.append("\nRequests in progress:\n");
+            for (String request : requests) {
+                msg.append("  ").append(request).append("\n");
+            }
+        }
+
+        Log.w(TAG, msg.toString());
+    }
+
+    // Can't throw.
+    private void wakeConnectionWaitersLocked() {
+        // Unpark all waiters that have requests that we can fulfill.
+        // This method is designed to not throw runtime exceptions, although we might send
+        // a waiter an exception for it to rethrow.
+        ConnectionWaiter predecessor = null;
+        ConnectionWaiter waiter = mConnectionWaiterQueue;
+        boolean primaryConnectionNotAvailable = false;
+        boolean nonPrimaryConnectionNotAvailable = false;
+        while (waiter != null) {
+            boolean unpark = false;
+            if (!mIsOpen) {
+                unpark = true;
+            } else {
+                try {
+                    SQLiteConnection connection = null;
+                    if (!waiter.mWantPrimaryConnection && !nonPrimaryConnectionNotAvailable) {
+                        connection = tryAcquireNonPrimaryConnectionLocked(
+                                waiter.mSql, waiter.mConnectionFlags); // might throw
+                        if (connection == null) {
+                            nonPrimaryConnectionNotAvailable = true;
+                        }
+                    }
+                    if (connection == null && !primaryConnectionNotAvailable) {
+                        connection = tryAcquirePrimaryConnectionLocked(
+                                waiter.mConnectionFlags); // might throw
+                        if (connection == null) {
+                            primaryConnectionNotAvailable = true;
+                        }
+                    }
+                    if (connection != null) {
+                        waiter.mAssignedConnection = connection;
+                        unpark = true;
+                    } else if (nonPrimaryConnectionNotAvailable && primaryConnectionNotAvailable) {
+                        // There are no connections available and the pool is still open.
+                        // We cannot fulfill any more connection requests, so stop here.
+                        break;
+                    }
+                } catch (RuntimeException ex) {
+                    // Let the waiter handle the exception from acquiring a connection.
+                    waiter.mException = ex;
+                    unpark = true;
+                }
+            }
+
+            final ConnectionWaiter successor = waiter.mNext;
+            if (unpark) {
+                if (predecessor != null) {
+                    predecessor.mNext = successor;
+                } else {
+                    mConnectionWaiterQueue = successor;
+                }
+                waiter.mNext = null;
+
+                LockSupport.unpark(waiter.mThread);
+            } else {
+                predecessor = waiter;
+            }
+            waiter = successor;
+        }
+    }
+
+    // Might throw.
+    private SQLiteConnection tryAcquirePrimaryConnectionLocked(int connectionFlags) {
+        // If the primary connection is available, acquire it now.
+        SQLiteConnection connection = mAvailablePrimaryConnection;
+        if (connection != null) {
+            mAvailablePrimaryConnection = null;
+            finishAcquireConnectionLocked(connection, connectionFlags); // might throw
+            return connection;
+        }
+
+        // Make sure that the primary connection actually exists and has just been acquired.
+        for (SQLiteConnection acquiredConnection : mAcquiredConnections.keySet()) {
+            if (acquiredConnection.isPrimaryConnection()) {
+                return null;
+            }
+        }
+
+        // Uhoh.  No primary connection!  Either this is the first time we asked
+        // for it, or maybe it leaked?
+        connection = openConnectionLocked(true /*primaryConnection*/); // might throw
+        finishAcquireConnectionLocked(connection, connectionFlags); // might throw
+        return connection;
+    }
+
+    // Might throw.
+    private SQLiteConnection tryAcquireNonPrimaryConnectionLocked(
+            String sql, int connectionFlags) {
+        // Try to acquire the next connection in the queue.
+        SQLiteConnection connection;
+        final int availableCount = mAvailableNonPrimaryConnections.size();
+        if (availableCount > 1 && sql != null) {
+            // If we have a choice, then prefer a connection that has the
+            // prepared statement in its cache.
+            for (int i = 0; i < availableCount; i++) {
+                connection = mAvailableNonPrimaryConnections.get(i);
+                if (connection.isPreparedStatementInCache(sql)) {
+                    mAvailableNonPrimaryConnections.remove(i);
+                    finishAcquireConnectionLocked(connection, connectionFlags); // might throw
+                    return connection;
+                }
+            }
+        }
+        if (availableCount > 0) {
+            // Otherwise, just grab the next one.
+            connection = mAvailableNonPrimaryConnections.remove(availableCount - 1);
+            finishAcquireConnectionLocked(connection, connectionFlags); // might throw
+            return connection;
+        }
+
+        // Expand the pool if needed.
+        int openConnections = mAcquiredConnections.size();
+        if (mAvailablePrimaryConnection != null) {
+            openConnections += 1;
+        }
+        if (openConnections >= mConfiguration.maxConnectionPoolSize) {
+            return null;
+        }
+        connection = openConnectionLocked(false /*primaryConnection*/); // might throw
+        finishAcquireConnectionLocked(connection, connectionFlags); // might throw
+        return connection;
+    }
+
+    // Might throw.
+    private void finishAcquireConnectionLocked(SQLiteConnection connection, int connectionFlags) {
+        try {
+            final boolean readOnly = (connectionFlags & CONNECTION_FLAG_READ_ONLY) != 0;
+            connection.setOnlyAllowReadOnlyOperations(readOnly);
+
+            mAcquiredConnections.put(connection, Boolean.FALSE);
+        } catch (RuntimeException ex) {
+            Log.e(TAG, "Failed to prepare acquired connection for session, closing it: "
+                    + connection +", connectionFlags=" + connectionFlags);
+            closeConnectionAndLogExceptionsLocked(connection);
+            throw ex; // rethrow!
+        }
+    }
+
+    private boolean isSessionBlockingImportantConnectionWaitersLocked(
+            boolean holdingPrimaryConnection, int connectionFlags) {
+        ConnectionWaiter waiter = mConnectionWaiterQueue;
+        if (waiter != null) {
+            final int priority = getPriority(connectionFlags);
+            do {
+                // Only worry about blocked connections that have same or lower priority.
+                if (priority > waiter.mPriority) {
+                    break;
+                }
+
+                // If we are holding the primary connection then we are blocking the waiter.
+                // Likewise, if we are holding a non-primary connection and the waiter
+                // would accept a non-primary connection, then we are blocking the waier.
+                if (holdingPrimaryConnection || !waiter.mWantPrimaryConnection) {
+                    return true;
+                }
+
+                waiter = waiter.mNext;
+            } while (waiter != null);
+        }
+        return false;
+    }
+
+    private static int getPriority(int connectionFlags) {
+        return (connectionFlags & CONNECTION_FLAG_INTERACTIVE) != 0 ? 1 : 0;
+    }
+
+    private void throwIfClosedLocked() {
+        if (!mIsOpen) {
+            throw new IllegalStateException("Cannot perform this operation "
+                    + "because the connection pool have been closed.");
+        }
+    }
+
+    private ConnectionWaiter obtainConnectionWaiterLocked(Thread thread, long startTime,
+            int priority, boolean wantPrimaryConnection, String sql, int connectionFlags) {
+        ConnectionWaiter waiter = mConnectionWaiterPool;
+        if (waiter != null) {
+            mConnectionWaiterPool = waiter.mNext;
+            waiter.mNext = null;
+        } else {
+            waiter = new ConnectionWaiter();
+        }
+        waiter.mThread = thread;
+        waiter.mStartTime = startTime;
+        waiter.mPriority = priority;
+        waiter.mWantPrimaryConnection = wantPrimaryConnection;
+        waiter.mSql = sql;
+        waiter.mConnectionFlags = connectionFlags;
+        return waiter;
+    }
+
+    private void recycleConnectionWaiterLocked(ConnectionWaiter waiter) {
+        waiter.mNext = mConnectionWaiterPool;
+        waiter.mThread = null;
+        waiter.mSql = null;
+        waiter.mAssignedConnection = null;
+        waiter.mException = null;
+        waiter.mNonce += 1;
+        mConnectionWaiterPool = waiter;
+    }
+
+    /**
+     * Dumps debugging information about this connection pool.
+     *
+     * @param printer The printer to receive the dump, not null.
+     * @param verbose True to dump more verbose information.
+     */
+    public void dump(Printer printer, boolean verbose) {
+        Printer indentedPrinter = PrefixPrinter.create(printer, "    ");
+        synchronized (mLock) {
+            printer.println("Connection pool for " + mConfiguration.path + ":");
+            printer.println("  Open: " + mIsOpen);
+            printer.println("  Max connections: " + mConfiguration.maxConnectionPoolSize);
+
+            printer.println("  Available primary connection:");
+            if (mAvailablePrimaryConnection != null) {
+                mAvailablePrimaryConnection.dump(indentedPrinter, verbose);
+            } else {
+                indentedPrinter.println("<none>");
+            }
+
+            printer.println("  Available non-primary connections:");
+            if (!mAvailableNonPrimaryConnections.isEmpty()) {
+                final int count = mAvailableNonPrimaryConnections.size();
+                for (int i = 0; i < count; i++) {
+                    mAvailableNonPrimaryConnections.get(i).dump(indentedPrinter, verbose);
+                }
+            } else {
+                indentedPrinter.println("<none>");
+            }
+
+            printer.println("  Acquired connections:");
+            if (!mAcquiredConnections.isEmpty()) {
+                for (Map.Entry<SQLiteConnection, Boolean> entry :
+                        mAcquiredConnections.entrySet()) {
+                    final SQLiteConnection connection = entry.getKey();
+                    connection.dumpUnsafe(indentedPrinter, verbose);
+                    indentedPrinter.println("  Pending reconfiguration: " + entry.getValue());
+                }
+            } else {
+                indentedPrinter.println("<none>");
+            }
+
+            printer.println("  Connection waiters:");
+            if (mConnectionWaiterQueue != null) {
+                int i = 0;
+                final long now = SystemClock.uptimeMillis();
+                for (ConnectionWaiter waiter = mConnectionWaiterQueue; waiter != null;
+                        waiter = waiter.mNext, i++) {
+                    indentedPrinter.println(i + ": waited for "
+                            + ((now - waiter.mStartTime) * 0.001f)
+                            + " ms - thread=" + waiter.mThread
+                            + ", priority=" + waiter.mPriority
+                            + ", sql='" + waiter.mSql + "'");
+                }
+            } else {
+                indentedPrinter.println("<none>");
+            }
+        }
+    }
+
+    @Override
+    public String toString() {
+        return "SQLiteConnectionPool: " + mConfiguration.path;
+    }
+
+    private static final class ConnectionWaiter {
+        public ConnectionWaiter mNext;
+        public Thread mThread;
+        public long mStartTime;
+        public int mPriority;
+        public boolean mWantPrimaryConnection;
+        public String mSql;
+        public int mConnectionFlags;
+        public SQLiteConnection mAssignedConnection;
+        public RuntimeException mException;
+        public int mNonce;
+    }
+}
diff --git a/core/java/android/database/sqlite/SQLiteCursor.java b/core/java/android/database/sqlite/SQLiteCursor.java
index 8dcedf2..82bb23e 100644
--- a/core/java/android/database/sqlite/SQLiteCursor.java
+++ b/core/java/android/database/sqlite/SQLiteCursor.java
@@ -43,7 +43,7 @@
     private final String[] mColumns;
 
     /** The query object for the cursor */
-    private SQLiteQuery mQuery;
+    private final SQLiteQuery mQuery;
 
     /** The compiled query this cursor came from */
     private final SQLiteCursorDriver mDriver;
@@ -65,8 +65,7 @@
      * interface. For a query such as: {@code SELECT name, birth, phone FROM
      * myTable WHERE ... LIMIT 1,20 ORDER BY...} the column names (name, birth,
      * phone) would be in the projection argument and everything from
-     * {@code FROM} onward would be in the params argument. This constructor
-     * has package scope.
+     * {@code FROM} onward would be in the params argument.
      *
      * @param db a reference to a Database object that is already constructed
      *     and opened. This param is not used any longer
@@ -86,8 +85,7 @@
      * interface. For a query such as: {@code SELECT name, birth, phone FROM
      * myTable WHERE ... LIMIT 1,20 ORDER BY...} the column names (name, birth,
      * phone) would be in the projection argument and everything from
-     * {@code FROM} onward would be in the params argument. This constructor
-     * has package scope.
+     * {@code FROM} onward would be in the params argument.
      *
      * @param editTable the name of the table used for this query
      * @param query the {@link SQLiteQuery} object associated with this cursor object.
@@ -96,9 +94,6 @@
         if (query == null) {
             throw new IllegalArgumentException("query object cannot be null");
         }
-        if (query.mDatabase == null) {
-            throw new IllegalArgumentException("query.mDatabase cannot be null");
-        }
         if (StrictMode.vmSqliteObjectLeaksEnabled()) {
             mStackTrace = new DatabaseObjectNotClosedException().fillInStackTrace();
         } else {
@@ -109,38 +104,21 @@
         mColumnNameMap = null;
         mQuery = query;
 
-        query.mDatabase.lock(query.mSql);
-        try {
-            // Setup the list of columns
-            int columnCount = mQuery.columnCountLocked();
-            mColumns = new String[columnCount];
-
-            // Read in all column names
-            for (int i = 0; i < columnCount; i++) {
-                String columnName = mQuery.columnNameLocked(i);
-                mColumns[i] = columnName;
-                if (false) {
-                    Log.v("DatabaseWindow", "mColumns[" + i + "] is "
-                            + mColumns[i]);
-                }
-    
-                // Make note of the row ID column index for quick access to it
-                if ("_id".equals(columnName)) {
-                    mRowIdColumnIndex = i;
-                }
+        mColumns = query.getColumnNames();
+        for (int i = 0; i < mColumns.length; i++) {
+            // Make note of the row ID column index for quick access to it
+            if ("_id".equals(mColumns[i])) {
+                mRowIdColumnIndex = i;
             }
-        } finally {
-            query.mDatabase.unlock();
         }
     }
 
     /**
+     * Get the database that this cursor is associated with.
      * @return the SQLiteDatabase that this cursor is associated with.
      */
     public SQLiteDatabase getDatabase() {
-        synchronized (this) {
-            return mQuery.mDatabase;
-        }
+        return mQuery.getDatabase();
     }
 
     @Override
@@ -167,7 +145,7 @@
 
         if (mCount == NO_COUNT) {
             int startPos = DatabaseUtils.cursorPickFillWindowStartPosition(requiredPos, 0);
-            mCount = getQuery().fillWindow(mWindow, startPos, requiredPos, true);
+            mCount = mQuery.fillWindow(mWindow, startPos, requiredPos, true);
             mCursorWindowCapacity = mWindow.getNumRows();
             if (Log.isLoggable(TAG, Log.DEBUG)) {
                 Log.d(TAG, "received count(*) from native_fill_window: " + mCount);
@@ -175,14 +153,10 @@
         } else {
             int startPos = DatabaseUtils.cursorPickFillWindowStartPosition(requiredPos,
                     mCursorWindowCapacity);
-            getQuery().fillWindow(mWindow, startPos, requiredPos, false);
+            mQuery.fillWindow(mWindow, startPos, requiredPos, false);
         }
     }
 
-    private synchronized SQLiteQuery getQuery() {
-        return mQuery;
-    }
-
     @Override
     public int getColumnIndex(String columnName) {
         // Create mColumnNameMap on demand
@@ -237,75 +211,28 @@
         if (isClosed()) {
             return false;
         }
-        long timeStart = 0;
-        if (false) {
-            timeStart = System.currentTimeMillis();
-        }
 
         synchronized (this) {
+            if (!mQuery.getDatabase().isOpen()) {
+                return false;
+            }
+
             if (mWindow != null) {
                 mWindow.clear();
             }
             mPos = -1;
-            SQLiteDatabase db = null;
-            try {
-                db = mQuery.mDatabase.getDatabaseHandle(mQuery.mSql);
-            } catch (IllegalStateException e) {
-                // for backwards compatibility, just return false
-                Log.w(TAG, "requery() failed " + e.getMessage(), e);
-                return false;
-            }
-            if (!db.equals(mQuery.mDatabase)) {
-                // since we need to use a different database connection handle,
-                // re-compile the query
-                try {
-                    db.lock(mQuery.mSql);
-                } catch (IllegalStateException e) {
-                    // for backwards compatibility, just return false
-                    Log.w(TAG, "requery() failed " + e.getMessage(), e);
-                    return false;
-                }
-                try {
-                    // close the old mQuery object and open a new one
-                    mQuery.close();
-                    mQuery = new SQLiteQuery(db, mQuery);
-                } catch (IllegalStateException e) {
-                    // for backwards compatibility, just return false
-                    Log.w(TAG, "requery() failed " + e.getMessage(), e);
-                    return false;
-                } finally {
-                    db.unlock();
-                }
-            }
-            // This one will recreate the temp table, and get its count
-            mDriver.cursorRequeried(this);
             mCount = NO_COUNT;
-            try {
-                mQuery.requery();
-            } catch (IllegalStateException e) {
-                // for backwards compatibility, just return false
-                Log.w(TAG, "requery() failed " + e.getMessage(), e);
-                return false;
-            }
+
+            mDriver.cursorRequeried(this);
         }
 
-        if (false) {
-            Log.v("DatabaseWindow", "closing window in requery()");
-            Log.v(TAG, "--- Requery()ed cursor " + this + ": " + mQuery);
-        }
-
-        boolean result = false;
         try {
-            result = super.requery();
+            return super.requery();
         } catch (IllegalStateException e) {
             // for backwards compatibility, just return false
             Log.w(TAG, "requery() failed " + e.getMessage(), e);
+            return false;
         }
-        if (false) {
-            long timeEnd = System.currentTimeMillis();
-            Log.v(TAG, "requery (" + (timeEnd - timeStart) + " ms): " + mDriver.toString());
-        }
-        return result;
     }
 
     @Override
@@ -330,20 +257,16 @@
             // if the cursor hasn't been closed yet, close it first
             if (mWindow != null) {
                 if (mStackTrace != null) {
-                    int len = mQuery.mSql.length();
+                    String sql = mQuery.getSql();
+                    int len = sql.length();
                     StrictMode.onSqliteObjectLeaked(
                         "Finalizing a Cursor that has not been deactivated or closed. " +
-                        "database = " + mQuery.mDatabase.getPath() + ", table = " + mEditTable +
-                        ", query = " + mQuery.mSql.substring(0, (len > 1000) ? 1000 : len),
+                        "database = " + mQuery.getDatabase().getLabel() +
+                        ", table = " + mEditTable +
+                        ", query = " + sql.substring(0, (len > 1000) ? 1000 : len),
                         mStackTrace);
                 }
                 close();
-                SQLiteDebug.notifyActiveCursorFinalized();
-            } else {
-                if (false) {
-                    Log.v(TAG, "Finalizing cursor on database = " + mQuery.mDatabase.getPath() +
-                            ", table = " + mEditTable + ", query = " + mQuery.mSql);
-                }
             }
         } finally {
             super.finalize();
diff --git a/core/java/android/database/sqlite/SQLiteCursorDriver.java b/core/java/android/database/sqlite/SQLiteCursorDriver.java
index b3963f9..ad2cdd2 100644
--- a/core/java/android/database/sqlite/SQLiteCursorDriver.java
+++ b/core/java/android/database/sqlite/SQLiteCursorDriver.java
@@ -39,7 +39,7 @@
     void cursorDeactivated();
 
     /**
-     * Called by a SQLiteCursor when it is requeryed.
+     * Called by a SQLiteCursor when it is requeried.
      */
     void cursorRequeried(Cursor cursor);
 
diff --git a/core/java/android/database/sqlite/SQLiteCustomFunction.java b/core/java/android/database/sqlite/SQLiteCustomFunction.java
new file mode 100644
index 0000000..02f3284
--- /dev/null
+++ b/core/java/android/database/sqlite/SQLiteCustomFunction.java
@@ -0,0 +1,53 @@
+/*
+ * 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 android.database.sqlite;
+
+/**
+ * Describes a custom SQL function.
+ *
+ * @hide
+ */
+public final class SQLiteCustomFunction {
+    public final String name;
+    public final int numArgs;
+    public final SQLiteDatabase.CustomFunction callback;
+
+    /**
+     * Create custom function.
+     *
+     * @param name The name of the sqlite3 function.
+     * @param numArgs The number of arguments for the function, or -1 to
+     * support any number of arguments.
+     * @param callback The callback to invoke when the function is executed.
+     */
+    public SQLiteCustomFunction(String name, int numArgs,
+            SQLiteDatabase.CustomFunction callback) {
+        if (name == null) {
+            throw new IllegalArgumentException("name must not be null.");
+        }
+
+        this.name = name;
+        this.numArgs = numArgs;
+        this.callback = callback;
+    }
+
+    // Called from native.
+    @SuppressWarnings("unused")
+    private void dispatchCallback(String[] args) {
+        callback.callback(args);
+    }
+}
diff --git a/core/java/android/database/sqlite/SQLiteDatabase.java b/core/java/android/database/sqlite/SQLiteDatabase.java
index f990be6..505f83e 100644
--- a/core/java/android/database/sqlite/SQLiteDatabase.java
+++ b/core/java/android/database/sqlite/SQLiteDatabase.java
@@ -16,8 +16,9 @@
 
 package android.database.sqlite;
 
-import android.app.AppGlobals;
+import android.content.CancellationSignal;
 import android.content.ContentValues;
+import android.content.OperationCanceledException;
 import android.content.res.Resources;
 import android.database.Cursor;
 import android.database.DatabaseErrorHandler;
@@ -25,61 +26,117 @@
 import android.database.DefaultDatabaseErrorHandler;
 import android.database.SQLException;
 import android.database.sqlite.SQLiteDebug.DbStats;
-import android.os.Debug;
-import android.os.StatFs;
-import android.os.SystemClock;
-import android.os.SystemProperties;
+import android.os.Looper;
 import android.text.TextUtils;
 import android.util.EventLog;
 import android.util.Log;
-import android.util.LruCache;
 import android.util.Pair;
-import dalvik.system.BlockGuard;
+import android.util.Printer;
+
+import dalvik.system.CloseGuard;
+
 import java.io.File;
-import java.lang.ref.WeakReference;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
-import java.util.Random;
 import java.util.WeakHashMap;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.ReentrantLock;
-import java.util.regex.Pattern;
 
 /**
  * Exposes methods to manage a SQLite database.
- * <p>SQLiteDatabase has methods to create, delete, execute SQL commands, and
+ *
+ * <p>
+ * SQLiteDatabase has methods to create, delete, execute SQL commands, and
  * perform other common database management tasks.
- * <p>See the Notepad sample application in the SDK for an example of creating
+ * </p><p>
+ * See the Notepad sample application in the SDK for an example of creating
  * and managing a database.
- * <p> Database names must be unique within an application, not across all
- * applications.
+ * </p><p>
+ * Database names must be unique within an application, not across all applications.
+ * </p>
  *
  * <h3>Localized Collation - ORDER BY</h3>
- * <p>In addition to SQLite's default <code>BINARY</code> collator, Android supplies
- * two more, <code>LOCALIZED</code>, which changes with the system's current locale
- * if you wire it up correctly (XXX a link needed!), and <code>UNICODE</code>, which
- * is the Unicode Collation Algorithm and not tailored to the current locale.
+ * <p>
+ * In addition to SQLite's default <code>BINARY</code> collator, Android supplies
+ * two more, <code>LOCALIZED</code>, which changes with the system's current locale,
+ * and <code>UNICODE</code>, which is the Unicode Collation Algorithm and not tailored
+ * to the current locale.
+ * </p>
  */
 public class SQLiteDatabase extends SQLiteClosable {
     private static final String TAG = "SQLiteDatabase";
-    private static final boolean ENABLE_DB_SAMPLE = false; // true to enable stats in event log
-    private static final int EVENT_DB_OPERATION = 52000;
+
     private static final int EVENT_DB_CORRUPT = 75004;
 
+    // Stores reference to all databases opened in the current process.
+    // (The referent Object is not used at this time.)
+    // INVARIANT: Guarded by sActiveDatabases.
+    private static WeakHashMap<SQLiteDatabase, Object> sActiveDatabases =
+            new WeakHashMap<SQLiteDatabase, Object>();
+
+    // Thread-local for database sessions that belong to this database.
+    // Each thread has its own database session.
+    // INVARIANT: Immutable.
+    private final ThreadLocal<SQLiteSession> mThreadSession = new ThreadLocal<SQLiteSession>() {
+        @Override
+        protected SQLiteSession initialValue() {
+            return createSession();
+        }
+    };
+
+    // The optional factory to use when creating new Cursors.  May be null.
+    // INVARIANT: Immutable.
+    private final CursorFactory mCursorFactory;
+
+    // Error handler to be used when SQLite returns corruption errors.
+    // INVARIANT: Immutable.
+    private final DatabaseErrorHandler mErrorHandler;
+
+    // Shared database state lock.
+    // This lock guards all of the shared state of the database, such as its
+    // configuration, whether it is open or closed, and so on.  This lock should
+    // be held for as little time as possible.
+    //
+    // The lock MUST NOT be held while attempting to acquire database connections or
+    // while executing SQL statements on behalf of the client as it can lead to deadlock.
+    //
+    // It is ok to hold the lock while reconfiguring the connection pool or dumping
+    // statistics because those operations are non-reentrant and do not try to acquire
+    // connections that might be held by other threads.
+    //
+    // Basic rule: grab the lock, access or modify global state, release the lock, then
+    // do the required SQL work.
+    private final Object mLock = new Object();
+
+    // Warns if the database is finalized without being closed properly.
+    // INVARIANT: Guarded by mLock.
+    private final CloseGuard mCloseGuardLocked = CloseGuard.get();
+
+    // The database configuration.
+    // INVARIANT: Guarded by mLock.
+    private final SQLiteDatabaseConfiguration mConfigurationLocked;
+
+    // The connection pool for the database, null when closed.
+    // The pool itself is thread-safe, but the reference to it can only be acquired
+    // when the lock is held.
+    // INVARIANT: Guarded by mLock.
+    private SQLiteConnectionPool mConnectionPoolLocked;
+
+    // True if the database has attached databases.
+    // INVARIANT: Guarded by mLock.
+    private boolean mHasAttachedDbsLocked;
+
+    // True if the database is in WAL mode.
+    // INVARIANT: Guarded by mLock.
+    private boolean mIsWALEnabledLocked;
+
     /**
-     * Algorithms used in ON CONFLICT clause
-     * http://www.sqlite.org/lang_conflict.html
-     */
-    /**
-     *  When a constraint violation occurs, an immediate ROLLBACK occurs,
+     * When a constraint violation occurs, an immediate ROLLBACK occurs,
      * thus ending the current transaction, and the command aborts with a
      * return code of SQLITE_CONSTRAINT. If no transaction is active
      * (other than the implied transaction that is created on every command)
-     *  then this algorithm works the same as ABORT.
+     * then this algorithm works the same as ABORT.
      */
     public static final int CONFLICT_ROLLBACK = 1;
 
@@ -118,14 +175,15 @@
      * violation occurs then the IGNORE algorithm is used. When this conflict
      * resolution strategy deletes rows in order to satisfy a constraint,
      * it does not invoke delete triggers on those rows.
-     *  This behavior might change in a future release.
+     * This behavior might change in a future release.
      */
     public static final int CONFLICT_REPLACE = 5;
 
     /**
-     * use the following when no conflict action is specified.
+     * Use the following when no conflict action is specified.
      */
     public static final int CONFLICT_NONE = 0;
+
     private static final String[] CONFLICT_VALUES = new String[]
             {"", " OR ROLLBACK ", " OR ABORT ", " OR FAIL ", " OR IGNORE ", " OR REPLACE "};
 
@@ -146,7 +204,7 @@
     public static final int SQLITE_MAX_LIKE_PATTERN_LENGTH = 50000;
 
     /**
-     * Flag for {@link #openDatabase} to open the database for reading and writing.
+     * Open flag: Flag for {@link #openDatabase} to open the database for reading and writing.
      * If the disk is full, this may fail even before you actually write anything.
      *
      * {@more} Note that the value of this flag is 0, so it is the default.
@@ -154,7 +212,7 @@
     public static final int OPEN_READWRITE = 0x00000000;          // update native code if changing
 
     /**
-     * Flag for {@link #openDatabase} to open the database for reading only.
+     * Open flag: Flag for {@link #openDatabase} to open the database for reading only.
      * This is the only reliable way to open a database if the disk may be full.
      */
     public static final int OPEN_READONLY = 0x00000001;           // update native code if changing
@@ -162,7 +220,8 @@
     private static final int OPEN_READ_MASK = 0x00000001;         // update native code if changing
 
     /**
-     * Flag for {@link #openDatabase} to open the database without support for localized collators.
+     * Open flag: Flag for {@link #openDatabase} to open the database without support for
+     * localized collators.
      *
      * {@more} This causes the collator <code>LOCALIZED</code> not to be created.
      * You must be consistent when using this flag to use the setting the database was
@@ -171,190 +230,62 @@
     public static final int NO_LOCALIZED_COLLATORS = 0x00000010;  // update native code if changing
 
     /**
-     * Flag for {@link #openDatabase} to create the database file if it does not already exist.
+     * Open flag: Flag for {@link #openDatabase} to create the database file if it does not
+     * already exist.
      */
     public static final int CREATE_IF_NECESSARY = 0x10000000;     // update native code if changing
 
     /**
-     * Indicates whether the most-recently started transaction has been marked as successful.
-     */
-    private boolean mInnerTransactionIsSuccessful;
-
-    /**
-     * Valid during the life of a transaction, and indicates whether the entire transaction (the
-     * outer one and all of the inner ones) so far has been successful.
-     */
-    private boolean mTransactionIsSuccessful;
-
-    /**
-     * Valid during the life of a transaction.
-     */
-    private SQLiteTransactionListener mTransactionListener;
-
-    /**
-     * this member is set if {@link #execSQL(String)} is used to begin and end transactions.
-     */
-    private boolean mTransactionUsingExecSql;
-
-    /** Synchronize on this when accessing the database */
-    private final DatabaseReentrantLock mLock = new DatabaseReentrantLock(true);
-
-    private long mLockAcquiredWallTime = 0L;
-    private long mLockAcquiredThreadTime = 0L;
-
-    // limit the frequency of complaints about each database to one within 20 sec
-    // unless run command adb shell setprop log.tag.Database VERBOSE
-    private static final int LOCK_WARNING_WINDOW_IN_MS = 20000;
-    /** If the lock is held this long then a warning will be printed when it is released. */
-    private static final int LOCK_ACQUIRED_WARNING_TIME_IN_MS = 300;
-    private static final int LOCK_ACQUIRED_WARNING_THREAD_TIME_IN_MS = 100;
-    private static final int LOCK_ACQUIRED_WARNING_TIME_IN_MS_ALWAYS_PRINT = 2000;
-
-    private static final int SLEEP_AFTER_YIELD_QUANTUM = 1000;
-
-    // The pattern we remove from database filenames before
-    // potentially logging them.
-    private static final Pattern EMAIL_IN_DB_PATTERN = Pattern.compile("[\\w\\.\\-]+@[\\w\\.\\-]+");
-
-    private long mLastLockMessageTime = 0L;
-
-    // Things related to query logging/sampling for debugging
-    // slow/frequent queries during development.  Always log queries
-    // which take (by default) 500ms+; shorter queries are sampled
-    // accordingly.  Commit statements, which are typically slow, are
-    // logged together with the most recently executed SQL statement,
-    // for disambiguation.  The 500ms value is configurable via a
-    // SystemProperty, but developers actively debugging database I/O
-    // should probably use the regular log tunable,
-    // LOG_SLOW_QUERIES_PROPERTY, defined below.
-    private static int sQueryLogTimeInMillis = 0;  // lazily initialized
-    private static final int QUERY_LOG_SQL_LENGTH = 64;
-    private static final String COMMIT_SQL = "COMMIT;";
-    private static final String BEGIN_SQL = "BEGIN;";
-    private final Random mRandom = new Random();
-    /** the last non-commit/rollback sql statement in a transaction */
-    // guarded by 'this'
-    private String mLastSqlStatement = null;
-
-    synchronized String getLastSqlStatement() {
-        return mLastSqlStatement;
-    }
-
-    synchronized void setLastSqlStatement(String sql) {
-        mLastSqlStatement = sql;
-    }
-
-    /** guarded by {@link #mLock} */
-    private long mTransStartTime;
-
-    // String prefix for slow database query EventLog records that show
-    // lock acquistions of the database.
-    /* package */ static final String GET_LOCK_LOG_PREFIX = "GETLOCK:";
-
-    /** Used by native code, do not rename. make it volatile, so it is thread-safe. */
-    /* package */ volatile int mNativeHandle = 0;
-
-    /**
-     * The size, in bytes, of a block on "/data". This corresponds to the Unix
-     * statfs.f_bsize field. note that this field is lazily initialized.
-     */
-    private static int sBlockSize = 0;
-
-    /** The path for the database file */
-    private final String mPath;
-
-    /** The anonymized path for the database file for logging purposes */
-    private String mPathForLogs = null;  // lazily populated
-
-    /** The flags passed to open/create */
-    private final int mFlags;
-
-    /** The optional factory to use when creating new Cursors */
-    private final CursorFactory mFactory;
-
-    private final WeakHashMap<SQLiteClosable, Object> mPrograms;
-
-    /** Default statement-cache size per database connection ( = instance of this class) */
-    private static final int DEFAULT_SQL_CACHE_SIZE = 25;
-
-    /**
-     * for each instance of this class, a LRU cache is maintained to store
-     * the compiled query statement ids returned by sqlite database.
-     *     key = SQL statement with "?" for bind args
-     *     value = {@link SQLiteCompiledSql}
-     * If an application opens the database and keeps it open during its entire life, then
-     * there will not be an overhead of compilation of SQL statements by sqlite.
+     * Absolute max value that can be set by {@link #setMaxSqlCacheSize(int)}.
      *
-     * why is this cache NOT static? because sqlite attaches compiledsql statements to the
-     * struct created when {@link SQLiteDatabase#openDatabase(String, CursorFactory, int)} is
-     * invoked.
-     *
-     * this cache's max size is settable by calling the method
-     * (@link #setMaxSqlCacheSize(int)}.
-     */
-    // guarded by this
-    private LruCache<String, SQLiteCompiledSql> mCompiledQueries;
-
-    /**
-     * absolute max value that can be set by {@link #setMaxSqlCacheSize(int)}
-     * size of each prepared-statement is between 1K - 6K, depending on the complexity of the
-     * SQL statement & schema.
+     * Each prepared-statement is between 1K - 6K, depending on the complexity of the
+     * SQL statement & schema.  A large SQL cache may use a significant amount of memory.
      */
     public static final int MAX_SQL_CACHE_SIZE = 100;
-    private boolean mCacheFullWarning;
 
-    /** Used to find out where this object was created in case it never got closed. */
-    private final Throwable mStackTrace;
-
-    /** stores the list of statement ids that need to be finalized by sqlite */
-    private final ArrayList<Integer> mClosedStatementIds = new ArrayList<Integer>();
-
-    /** {@link DatabaseErrorHandler} to be used when SQLite returns any of the following errors
-     *    Corruption
-     * */
-    private final DatabaseErrorHandler mErrorHandler;
-
-    /** The Database connection pool {@link DatabaseConnectionPool}.
-     * Visibility is package-private for testing purposes. otherwise, private visibility is enough.
-     */
-    /* package */ volatile DatabaseConnectionPool mConnectionPool = null;
-
-    /** Each database connection handle in the pool is assigned a number 1..N, where N is the
-     * size of the connection pool.
-     * The main connection handle to which the pool is attached is assigned a value of 0.
-     */
-    /* package */ final short mConnectionNum;
-
-    /** on pooled database connections, this member points to the parent ( = main)
-     * database connection handle.
-     * package visibility only for testing purposes
-     */
-    /* package */ SQLiteDatabase mParentConnObj = null;
-
-    private static final String MEMORY_DB_PATH = ":memory:";
-
-    /** set to true if the database has attached databases */
-    private volatile boolean mHasAttachedDbs = false;
-
-    /** stores reference to all databases opened in the current process. */
-    private static ArrayList<WeakReference<SQLiteDatabase>> mActiveDatabases =
-            new ArrayList<WeakReference<SQLiteDatabase>>();
-
-    synchronized void addSQLiteClosable(SQLiteClosable closable) {
-        // mPrograms is per instance of SQLiteDatabase and it doesn't actually touch the database
-        // itself. so, there is no need to lock().
-        mPrograms.put(closable, null);
+    private SQLiteDatabase(String path, int openFlags, CursorFactory cursorFactory,
+            DatabaseErrorHandler errorHandler) {
+        mCursorFactory = cursorFactory;
+        mErrorHandler = errorHandler != null ? errorHandler : new DefaultDatabaseErrorHandler();
+        mConfigurationLocked = new SQLiteDatabaseConfiguration(path, openFlags);
     }
 
-    synchronized void removeSQLiteClosable(SQLiteClosable closable) {
-        mPrograms.remove(closable);
+    @Override
+    protected void finalize() throws Throwable {
+        try {
+            dispose(true);
+        } finally {
+            super.finalize();
+        }
     }
 
     @Override
     protected void onAllReferencesReleased() {
-        if (isOpen()) {
-            // close the database which will close all pending statements to be finalized also
-            close();
+        dispose(false);
+    }
+
+    private void dispose(boolean finalized) {
+        final SQLiteConnectionPool pool;
+        synchronized (mLock) {
+            if (mCloseGuardLocked != null) {
+                if (finalized) {
+                    mCloseGuardLocked.warnIfOpen();
+                }
+                mCloseGuardLocked.close();
+            }
+
+            pool = mConnectionPoolLocked;
+            mConnectionPoolLocked = null;
+        }
+
+        if (!finalized) {
+            synchronized (sActiveDatabases) {
+                sActiveDatabases.remove(this);
+            }
+
+            if (pool != null) {
+                pool.close();
+            }
         }
     }
 
@@ -364,7 +295,9 @@
      *
      * @return the number of bytes actually released
      */
-    static public native int releaseMemory();
+    public static int releaseMemory() {
+        return SQLiteGlobal.releaseMemory();
+    }
 
     /**
      * Control whether or not the SQLiteDatabase is made thread-safe by using locks
@@ -372,159 +305,82 @@
      * DB will only be used by a single thread then you should set this to false.
      * The default is true.
      * @param lockingEnabled set to true to enable locks, false otherwise
+     *
+     * @deprecated This method now does nothing.  Do not use.
      */
+    @Deprecated
     public void setLockingEnabled(boolean lockingEnabled) {
-        mLockingEnabled = lockingEnabled;
     }
 
     /**
-     * If set then the SQLiteDatabase is made thread-safe by using locks
-     * around critical sections
+     * Gets a label to use when describing the database in log messages.
+     * @return The label.
      */
-    private boolean mLockingEnabled = true;
+    String getLabel() {
+        synchronized (mLock) {
+            return mConfigurationLocked.label;
+        }
+    }
 
-    /* package */ void onCorruption() {
-        EventLog.writeEvent(EVENT_DB_CORRUPT, mPath);
+    /**
+     * Sends a corruption message to the database error handler.
+     */
+    void onCorruption() {
+        EventLog.writeEvent(EVENT_DB_CORRUPT, getLabel());
         mErrorHandler.onCorruption(this);
     }
 
     /**
-     * Locks the database for exclusive access. The database lock must be held when
-     * touch the native sqlite3* object since it is single threaded and uses
-     * a polling lock contention algorithm. The lock is recursive, and may be acquired
-     * multiple times by the same thread. This is a no-op if mLockingEnabled is false.
+     * Gets the {@link SQLiteSession} that belongs to this thread for this database.
+     * Once a thread has obtained a session, it will continue to obtain the same
+     * session even after the database has been closed (although the session will not
+     * be usable).  However, a thread that does not already have a session cannot
+     * obtain one after the database has been closed.
      *
-     * @see #unlock()
+     * The idea is that threads that have active connections to the database may still
+     * have work to complete even after the call to {@link #close}.  Active database
+     * connections are not actually disposed until they are released by the threads
+     * that own them.
+     *
+     * @return The session, never null.
+     *
+     * @throws IllegalStateException if the thread does not yet have a session and
+     * the database is not open.
      */
-    /* package */ void lock(String sql) {
-        lock(sql, false);
+    SQLiteSession getThreadSession() {
+        return mThreadSession.get(); // initialValue() throws if database closed
     }
 
-    /* pachage */ void lock() {
-        lock(null, false);
-    }
-
-    private static final long LOCK_WAIT_PERIOD = 30L;
-    private void lock(String sql, boolean forced) {
-        // make sure this method is NOT being called from a 'synchronized' method
-        if (Thread.holdsLock(this)) {
-            Log.w(TAG, "don't lock() while in a synchronized method");
+    SQLiteSession createSession() {
+        final SQLiteConnectionPool pool;
+        synchronized (mLock) {
+            throwIfNotOpenLocked();
+            pool = mConnectionPoolLocked;
         }
-        verifyDbIsOpen();
-        if (!forced && !mLockingEnabled) return;
-        boolean done = false;
-        long timeStart = SystemClock.uptimeMillis();
-        while (!done) {
-            try {
-                // wait for 30sec to acquire the lock
-                done = mLock.tryLock(LOCK_WAIT_PERIOD, TimeUnit.SECONDS);
-                if (!done) {
-                    // lock not acquired in NSec. print a message and stacktrace saying the lock
-                    // has not been available for 30sec.
-                    Log.w(TAG, "database lock has not been available for " + LOCK_WAIT_PERIOD +
-                            " sec. Current Owner of the lock is " + mLock.getOwnerDescription() +
-                            ". Continuing to wait in thread: " + Thread.currentThread().getId());
-                }
-            } catch (InterruptedException e) {
-                // ignore the interruption
-            }
-        }
-        if (SQLiteDebug.DEBUG_LOCK_TIME_TRACKING) {
-            if (mLock.getHoldCount() == 1) {
-                // Use elapsed real-time since the CPU may sleep when waiting for IO
-                mLockAcquiredWallTime = SystemClock.elapsedRealtime();
-                mLockAcquiredThreadTime = Debug.threadCpuTimeNanos();
-            }
-        }
-        if (sql != null) {
-            if (ENABLE_DB_SAMPLE)  {
-                logTimeStat(sql, timeStart, GET_LOCK_LOG_PREFIX);
-            }
-        }
-    }
-    private static class DatabaseReentrantLock extends ReentrantLock {
-        DatabaseReentrantLock(boolean fair) {
-            super(fair);
-        }
-        @Override
-        public Thread getOwner() {
-            return super.getOwner();
-        }
-        public String getOwnerDescription() {
-            Thread t = getOwner();
-            return (t== null) ? "none" : String.valueOf(t.getId());
-        }
+        return new SQLiteSession(pool);
     }
 
     /**
-     * Locks the database for exclusive access. The database lock must be held when
-     * touch the native sqlite3* object since it is single threaded and uses
-     * a polling lock contention algorithm. The lock is recursive, and may be acquired
-     * multiple times by the same thread.
+     * Gets default connection flags that are appropriate for this thread, taking into
+     * account whether the thread is acting on behalf of the UI.
      *
-     * @see #unlockForced()
+     * @param readOnly True if the connection should be read-only.
+     * @return The connection flags.
      */
-    private void lockForced() {
-        lock(null, true);
+    int getThreadDefaultConnectionFlags(boolean readOnly) {
+        int flags = readOnly ? SQLiteConnectionPool.CONNECTION_FLAG_READ_ONLY :
+                SQLiteConnectionPool.CONNECTION_FLAG_PRIMARY_CONNECTION_AFFINITY;
+        if (isMainThread()) {
+            flags |= SQLiteConnectionPool.CONNECTION_FLAG_INTERACTIVE;
+        }
+        return flags;
     }
 
-    private void lockForced(String sql) {
-        lock(sql, true);
-    }
-
-    /**
-     * Releases the database lock. This is a no-op if mLockingEnabled is false.
-     *
-     * @see #unlock()
-     */
-    /* package */ void unlock() {
-        if (!mLockingEnabled) return;
-        if (SQLiteDebug.DEBUG_LOCK_TIME_TRACKING) {
-            if (mLock.getHoldCount() == 1) {
-                checkLockHoldTime();
-            }
-        }
-        mLock.unlock();
-    }
-
-    /**
-     * Releases the database lock.
-     *
-     * @see #unlockForced()
-     */
-    private void unlockForced() {
-        if (SQLiteDebug.DEBUG_LOCK_TIME_TRACKING) {
-            if (mLock.getHoldCount() == 1) {
-                checkLockHoldTime();
-            }
-        }
-        mLock.unlock();
-    }
-
-    private void checkLockHoldTime() {
-        // Use elapsed real-time since the CPU may sleep when waiting for IO
-        long elapsedTime = SystemClock.elapsedRealtime();
-        long lockedTime = elapsedTime - mLockAcquiredWallTime;
-        if (lockedTime < LOCK_ACQUIRED_WARNING_TIME_IN_MS_ALWAYS_PRINT &&
-                !Log.isLoggable(TAG, Log.VERBOSE) &&
-                (elapsedTime - mLastLockMessageTime) < LOCK_WARNING_WINDOW_IN_MS) {
-            return;
-        }
-        if (lockedTime > LOCK_ACQUIRED_WARNING_TIME_IN_MS) {
-            int threadTime = (int)
-                    ((Debug.threadCpuTimeNanos() - mLockAcquiredThreadTime) / 1000000);
-            if (threadTime > LOCK_ACQUIRED_WARNING_THREAD_TIME_IN_MS ||
-                    lockedTime > LOCK_ACQUIRED_WARNING_TIME_IN_MS_ALWAYS_PRINT) {
-                mLastLockMessageTime = elapsedTime;
-                String msg = "lock held on " + mPath + " for " + lockedTime + "ms. Thread time was "
-                        + threadTime + "ms";
-                if (SQLiteDebug.DEBUG_LOCK_TIME_TRACKING_STACK_TRACE) {
-                    Log.d(TAG, msg, new Exception());
-                } else {
-                    Log.d(TAG, msg);
-                }
-            }
-        }
+    private static boolean isMainThread() {
+        // FIXME: There should be a better way to do this.
+        // Would also be nice to have something that would work across Binder calls.
+        Looper looper = Looper.myLooper();
+        return looper != null && looper == Looper.getMainLooper();
     }
 
     /**
@@ -636,50 +492,9 @@
 
     private void beginTransaction(SQLiteTransactionListener transactionListener,
             boolean exclusive) {
-        verifyDbIsOpen();
-        lockForced(BEGIN_SQL);
-        boolean ok = false;
-        try {
-            // If this thread already had the lock then get out
-            if (mLock.getHoldCount() > 1) {
-                if (mInnerTransactionIsSuccessful) {
-                    String msg = "Cannot call beginTransaction between "
-                            + "calling setTransactionSuccessful and endTransaction";
-                    IllegalStateException e = new IllegalStateException(msg);
-                    Log.e(TAG, "beginTransaction() failed", e);
-                    throw e;
-                }
-                ok = true;
-                return;
-            }
-
-            // This thread didn't already have the lock, so begin a database
-            // transaction now.
-            if (exclusive && mConnectionPool == null) {
-                execSQL("BEGIN EXCLUSIVE;");
-            } else {
-                execSQL("BEGIN IMMEDIATE;");
-            }
-            mTransStartTime = SystemClock.uptimeMillis();
-            mTransactionListener = transactionListener;
-            mTransactionIsSuccessful = true;
-            mInnerTransactionIsSuccessful = false;
-            if (transactionListener != null) {
-                try {
-                    transactionListener.onBegin();
-                } catch (RuntimeException e) {
-                    execSQL("ROLLBACK;");
-                    throw e;
-                }
-            }
-            ok = true;
-        } finally {
-            if (!ok) {
-                // beginTransaction is called before the try block so we must release the lock in
-                // the case of failure.
-                unlockForced();
-            }
-        }
+        getThreadSession().beginTransaction(exclusive ? SQLiteSession.TRANSACTION_MODE_EXCLUSIVE :
+                SQLiteSession.TRANSACTION_MODE_IMMEDIATE, transactionListener,
+                getThreadDefaultConnectionFlags(false /*readOnly*/), null);
     }
 
     /**
@@ -687,68 +502,7 @@
      * are committed and rolled back.
      */
     public void endTransaction() {
-        verifyLockOwner();
-        try {
-            if (mInnerTransactionIsSuccessful) {
-                mInnerTransactionIsSuccessful = false;
-            } else {
-                mTransactionIsSuccessful = false;
-            }
-            if (mLock.getHoldCount() != 1) {
-                return;
-            }
-            RuntimeException savedException = null;
-            if (mTransactionListener != null) {
-                try {
-                    if (mTransactionIsSuccessful) {
-                        mTransactionListener.onCommit();
-                    } else {
-                        mTransactionListener.onRollback();
-                    }
-                } catch (RuntimeException e) {
-                    savedException = e;
-                    mTransactionIsSuccessful = false;
-                }
-            }
-            if (mTransactionIsSuccessful) {
-                execSQL(COMMIT_SQL);
-                // if write-ahead logging is used, we have to take care of checkpoint.
-                // TODO: should applications be given the flexibility of choosing when to
-                // trigger checkpoint?
-                // for now, do checkpoint after every COMMIT because that is the fastest
-                // way to guarantee that readers will see latest data.
-                // but this is the slowest way to run sqlite with in write-ahead logging mode.
-                if (this.mConnectionPool != null) {
-                    execSQL("PRAGMA wal_checkpoint;");
-                    if (SQLiteDebug.DEBUG_SQL_STATEMENTS) {
-                        Log.i(TAG, "PRAGMA wal_Checkpoint done");
-                    }
-                }
-                // log the transaction time to the Eventlog.
-                if (ENABLE_DB_SAMPLE) {
-                    logTimeStat(getLastSqlStatement(), mTransStartTime, COMMIT_SQL);
-                }
-            } else {
-                try {
-                    execSQL("ROLLBACK;");
-                    if (savedException != null) {
-                        throw savedException;
-                    }
-                } catch (SQLException e) {
-                    if (false) {
-                        Log.d(TAG, "exception during rollback, maybe the DB previously "
-                                + "performed an auto-rollback");
-                    }
-                }
-            }
-        } finally {
-            mTransactionListener = null;
-            unlockForced();
-            if (false) {
-                Log.v(TAG, "unlocked " + Thread.currentThread()
-                        + ", holdCount is " + mLock.getHoldCount());
-            }
-        }
+        getThreadSession().endTransaction(null);
     }
 
     /**
@@ -761,86 +515,46 @@
      * transaction is already marked as successful.
      */
     public void setTransactionSuccessful() {
-        verifyDbIsOpen();
-        if (!mLock.isHeldByCurrentThread()) {
-            throw new IllegalStateException("no transaction pending");
-        }
-        if (mInnerTransactionIsSuccessful) {
-            throw new IllegalStateException(
-                    "setTransactionSuccessful may only be called once per call to beginTransaction");
-        }
-        mInnerTransactionIsSuccessful = true;
+        getThreadSession().setTransactionSuccessful();
     }
 
     /**
-     * return true if there is a transaction pending
+     * Returns true if the current thread has a transaction pending.
+     *
+     * @return True if the current thread is in a transaction.
      */
     public boolean inTransaction() {
-        return mLock.getHoldCount() > 0 || mTransactionUsingExecSql;
-    }
-
-    /* package */ synchronized void setTransactionUsingExecSqlFlag() {
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            Log.i(TAG, "found execSQL('begin transaction')");
-        }
-        mTransactionUsingExecSql = true;
-    }
-
-    /* package */ synchronized void resetTransactionUsingExecSqlFlag() {
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            if (mTransactionUsingExecSql) {
-                Log.i(TAG, "found execSQL('commit or end or rollback')");
-            }
-        }
-        mTransactionUsingExecSql = false;
+        return getThreadSession().hasTransaction();
     }
 
     /**
-     * Returns true if the caller is considered part of the current transaction, if any.
+     * Returns true if the current thread is holding an active connection to the database.
      * <p>
-     * Caller is part of the current transaction if either of the following is true
-     * <ol>
-     *   <li>If transaction is started by calling beginTransaction() methods AND if the caller is
-     *   in the same thread as the thread that started the transaction.
-     *   </li>
-     *   <li>If the transaction is started by calling {@link #execSQL(String)} like this:
-     *   execSQL("BEGIN transaction"). In this case, every thread in the process is considered
-     *   part of the current transaction.</li>
-     * </ol>
+     * The name of this method comes from a time when having an active connection
+     * to the database meant that the thread was holding an actual lock on the
+     * database.  Nowadays, there is no longer a true "database lock" although threads
+     * may block if they cannot acquire a database connection to perform a
+     * particular operation.
+     * </p>
      *
-     * @return true if the caller is considered part of the current transaction, if any.
-     */
-    /* package */ synchronized boolean amIInTransaction() {
-        // always do this test on the main database connection - NOT on pooled database connection
-        // since transactions always occur on the main database connections only.
-        SQLiteDatabase db = (isPooledConnection()) ? mParentConnObj : this;
-        boolean b = (!db.inTransaction()) ? false :
-                db.mTransactionUsingExecSql || db.mLock.isHeldByCurrentThread();
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            Log.i(TAG, "amIinTransaction: " + b);
-        }
-        return b;
-    }
-
-    /**
-     * Checks if the database lock is held by this thread.
-     *
-     * @return true, if this thread is holding the database lock.
+     * @return True if the current thread is holding an active connection to the database.
      */
     public boolean isDbLockedByCurrentThread() {
-        return mLock.isHeldByCurrentThread();
+        return getThreadSession().hasConnection();
     }
 
     /**
-     * Checks if the database is locked by another thread. This is
-     * just an estimate, since this status can change at any time,
-     * including after the call is made but before the result has
-     * been acted upon.
+     * Always returns false.
+     * <p>
+     * There is no longer the concept of a database lock, so this method always returns false.
+     * </p>
      *
-     * @return true, if the database is locked by another thread
+     * @return False.
+     * @deprecated Always returns false.  Do not use this method.
      */
+    @Deprecated
     public boolean isDbLockedByOtherThreads() {
-        return !mLock.isHeldByCurrentThread() && mLock.isLocked();
+        return false;
     }
 
     /**
@@ -884,46 +598,12 @@
         return yieldIfContendedHelper(true /* check yielding */, sleepAfterYieldDelay);
     }
 
-    private boolean yieldIfContendedHelper(boolean checkFullyYielded, long sleepAfterYieldDelay) {
-        if (mLock.getQueueLength() == 0) {
-            // Reset the lock acquire time since we know that the thread was willing to yield
-            // the lock at this time.
-            mLockAcquiredWallTime = SystemClock.elapsedRealtime();
-            mLockAcquiredThreadTime = Debug.threadCpuTimeNanos();
-            return false;
-        }
-        setTransactionSuccessful();
-        SQLiteTransactionListener transactionListener = mTransactionListener;
-        endTransaction();
-        if (checkFullyYielded) {
-            if (this.isDbLockedByCurrentThread()) {
-                throw new IllegalStateException(
-                        "Db locked more than once. yielfIfContended cannot yield");
-            }
-        }
-        if (sleepAfterYieldDelay > 0) {
-            // Sleep for up to sleepAfterYieldDelay milliseconds, waking up periodically to
-            // check if anyone is using the database.  If the database is not contended,
-            // retake the lock and return.
-            long remainingDelay = sleepAfterYieldDelay;
-            while (remainingDelay > 0) {
-                try {
-                    Thread.sleep(remainingDelay < SLEEP_AFTER_YIELD_QUANTUM ?
-                            remainingDelay : SLEEP_AFTER_YIELD_QUANTUM);
-                } catch (InterruptedException e) {
-                    Thread.interrupted();
-                }
-                remainingDelay -= SLEEP_AFTER_YIELD_QUANTUM;
-                if (mLock.getQueueLength() == 0) {
-                    break;
-                }
-            }
-        }
-        beginTransactionWithListener(transactionListener);
-        return true;
+    private boolean yieldIfContendedHelper(boolean throwIfUnsafe, long sleepAfterYieldDelay) {
+        return getThreadSession().yieldTransaction(sleepAfterYieldDelay, throwIfUnsafe, null);
     }
 
     /**
+     * Deprecated.
      * @deprecated This method no longer serves any useful purpose and has been deprecated.
      */
     @Deprecated
@@ -932,19 +612,6 @@
     }
 
     /**
-     * Used to allow returning sub-classes of {@link Cursor} when calling query.
-     */
-    public interface CursorFactory {
-        /**
-         * See
-         * {@link SQLiteCursor#SQLiteCursor(SQLiteCursorDriver, String, SQLiteQuery)}.
-         */
-        public Cursor newCursor(SQLiteDatabase db,
-                SQLiteCursorDriver masterQuery, String editTable,
-                SQLiteQuery query);
-    }
-
-    /**
      * Open the database according to the flags {@link #OPEN_READWRITE}
      * {@link #OPEN_READONLY} {@link #CREATE_IF_NECESSARY} and/or {@link #NO_LOCALIZED_COLLATORS}.
      *
@@ -983,50 +650,9 @@
      */
     public static SQLiteDatabase openDatabase(String path, CursorFactory factory, int flags,
             DatabaseErrorHandler errorHandler) {
-        SQLiteDatabase sqliteDatabase = openDatabase(path, factory, flags, errorHandler,
-                (short) 0 /* the main connection handle */);
-
-        // set sqlite pagesize to mBlockSize
-        if (sBlockSize == 0) {
-            // TODO: "/data" should be a static final String constant somewhere. it is hardcoded
-            // in several places right now.
-            sBlockSize = new StatFs("/data").getBlockSize();
-        }
-        sqliteDatabase.setPageSize(sBlockSize);
-        sqliteDatabase.setJournalMode(path, "TRUNCATE");
-
-        // add this database to the list of databases opened in this process
-        synchronized(mActiveDatabases) {
-            mActiveDatabases.add(new WeakReference<SQLiteDatabase>(sqliteDatabase));
-        }
-        return sqliteDatabase;
-    }
-
-    private static SQLiteDatabase openDatabase(String path, CursorFactory factory, int flags,
-            DatabaseErrorHandler errorHandler, short connectionNum) {
-        SQLiteDatabase db = new SQLiteDatabase(path, factory, flags, errorHandler, connectionNum);
-        try {
-            if (Log.isLoggable(TAG, Log.DEBUG)) {
-                Log.i(TAG, "opening the db : " + path);
-            }
-            // Open the database.
-            db.dbopen(path, flags);
-            db.setLocale(Locale.getDefault());
-            if (SQLiteDebug.DEBUG_SQL_STATEMENTS) {
-                db.enableSqlTracing(path, connectionNum);
-            }
-            if (SQLiteDebug.DEBUG_SQL_TIME) {
-                db.enableSqlProfiling(path, connectionNum);
-            }
-            return db;
-        } catch (SQLiteDatabaseCorruptException e) {
-            db.mErrorHandler.onCorruption(db);
-            return SQLiteDatabase.openDatabase(path, factory, flags, errorHandler);
-        } catch (SQLiteException e) {
-            Log.e(TAG, "Failed to open the database. closing it.", e);
-            db.close();
-            throw e;
-        }
+        SQLiteDatabase db = new SQLiteDatabase(path, flags, factory, errorHandler);
+        db.open();
+        return db;
     }
 
     /**
@@ -1051,16 +677,46 @@
         return openDatabase(path, factory, CREATE_IF_NECESSARY, errorHandler);
     }
 
-    private void setJournalMode(final String dbPath, final String mode) {
-        // journal mode can be set only for non-memory databases
+    private void open() {
+        try {
+            try {
+                openInner();
+            } catch (SQLiteDatabaseCorruptException ex) {
+                onCorruption();
+                openInner();
+            }
+
+            // Disable WAL if it was previously enabled.
+            setJournalMode("TRUNCATE");
+        } catch (SQLiteException ex) {
+            Log.e(TAG, "Failed to open database '" + getLabel() + "'.", ex);
+            close();
+            throw ex;
+        }
+    }
+
+    private void openInner() {
+        synchronized (mLock) {
+            assert mConnectionPoolLocked == null;
+            mConnectionPoolLocked = SQLiteConnectionPool.open(mConfigurationLocked);
+            mCloseGuardLocked.open("close");
+        }
+
+        synchronized (sActiveDatabases) {
+            sActiveDatabases.put(this, null);
+        }
+    }
+
+    private void setJournalMode(String mode) {
+        // Journal mode can be set only for non-memory databases
         // AND can't be set for readonly databases
-        if (dbPath.equalsIgnoreCase(MEMORY_DB_PATH) || isReadOnly()) {
+        if (isInMemoryDatabase() || isReadOnly()) {
             return;
         }
         String s = DatabaseUtils.stringForQuery(this, "PRAGMA journal_mode=" + mode, null);
         if (!s.equalsIgnoreCase(mode)) {
-            Log.e(TAG, "setting journal_mode to " + mode + " failed for db: " + dbPath +
-                    " (on pragma set journal_mode, sqlite returned:" + s);
+            Log.e(TAG, "setting journal_mode to " + mode + " failed for db: " + getLabel()
+                    + " (on pragma set journal_mode, sqlite returned:" + s);
         }
     }
 
@@ -1077,159 +733,37 @@
      */
     public static SQLiteDatabase create(CursorFactory factory) {
         // This is a magic string with special meaning for SQLite.
-        return openDatabase(MEMORY_DB_PATH, factory, CREATE_IF_NECESSARY);
+        return openDatabase(SQLiteDatabaseConfiguration.MEMORY_DB_PATH,
+                factory, CREATE_IF_NECESSARY);
     }
 
     /**
      * Close the database.
      */
     public void close() {
-        if (!isOpen()) {
-            return;
-        }
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            Log.i(TAG, "closing db: " + mPath + " (connection # " + mConnectionNum);
-        }
-        lock();
-        try {
-            // some other thread could have closed this database while I was waiting for lock.
-            // check the database state
-            if (!isOpen()) {
-                return;
-            }
-            closeClosable();
-            // finalize ALL statements queued up so far
-            closePendingStatements();
-            releaseCustomFunctions();
-            // close this database instance - regardless of its reference count value
-            closeDatabase();
-            if (mConnectionPool != null) {
-                if (Log.isLoggable(TAG, Log.DEBUG)) {
-                    assert mConnectionPool != null;
-                    Log.i(TAG, mConnectionPool.toString());
-                }
-                mConnectionPool.close();
-            }
-        } finally {
-            unlock();
-        }
-    }
-
-    private void closeClosable() {
-        /* deallocate all compiled SQL statement objects from mCompiledQueries cache.
-         * this should be done before de-referencing all {@link SQLiteClosable} objects
-         * from this database object because calling
-         * {@link SQLiteClosable#onAllReferencesReleasedFromContainer()} could cause the database
-         * to be closed. sqlite doesn't let a database close if there are
-         * any unfinalized statements - such as the compiled-sql objects in mCompiledQueries.
-         */
-        deallocCachedSqlStatements();
-
-        Iterator<Map.Entry<SQLiteClosable, Object>> iter = mPrograms.entrySet().iterator();
-        while (iter.hasNext()) {
-            Map.Entry<SQLiteClosable, Object> entry = iter.next();
-            SQLiteClosable program = entry.getKey();
-            if (program != null) {
-                program.onAllReferencesReleasedFromContainer();
-            }
-        }
-    }
-
-    /**
-     * package level access for testing purposes
-     */
-    /* package */ void closeDatabase() throws SQLiteException {
-        try {
-            dbclose();
-        } catch (SQLiteUnfinalizedObjectsException e)  {
-            String msg = e.getMessage();
-            String[] tokens = msg.split(",", 2);
-            int stmtId = Integer.parseInt(tokens[0]);
-            // get extra info about this statement, if it is still to be released by closeClosable()
-            Iterator<Map.Entry<SQLiteClosable, Object>> iter = mPrograms.entrySet().iterator();
-            boolean found = false;
-            while (iter.hasNext()) {
-                Map.Entry<SQLiteClosable, Object> entry = iter.next();
-                SQLiteClosable program = entry.getKey();
-                if (program != null && program instanceof SQLiteProgram) {
-                    SQLiteCompiledSql compiledSql = ((SQLiteProgram)program).mCompiledSql;
-                    if (compiledSql.nStatement == stmtId) {
-                        msg = compiledSql.toString();
-                        found = true;
-                    }
-                }
-            }
-            if (!found) {
-                // the statement is already released by closeClosable(). is it waiting to be
-                // finalized?
-                if (mClosedStatementIds.contains(stmtId)) {
-                    Log.w(TAG, "this shouldn't happen. finalizing the statement now: ");
-                    closePendingStatements();
-                    // try to close the database again
-                    closeDatabase();
-                }
-            } else {
-                // the statement is not yet closed. most probably programming error in the app.
-                throw new SQLiteUnfinalizedObjectsException(
-                        "close() on database: " + getPath() +
-                        " failed due to un-close()d SQL statements: " + msg);
-            }
-        }
-    }
-
-    /**
-     * Native call to close the database.
-     */
-    private native void dbclose();
-
-    /**
-     * A callback interface for a custom sqlite3 function.
-     * This can be used to create a function that can be called from
-     * sqlite3 database triggers.
-     * @hide
-     */
-    public interface CustomFunction {
-        public void callback(String[] args);
+        dispose(false);
     }
 
     /**
      * Registers a CustomFunction callback as a function that can be called from
-     * sqlite3 database triggers.
+     * SQLite database triggers.
+     *
      * @param name the name of the sqlite3 function
      * @param numArgs the number of arguments for the function
      * @param function callback to call when the function is executed
      * @hide
      */
     public void addCustomFunction(String name, int numArgs, CustomFunction function) {
-        verifyDbIsOpen();
-        synchronized (mCustomFunctions) {
-            int ref = native_addCustomFunction(name, numArgs, function);
-            if (ref != 0) {
-                // save a reference to the function for cleanup later
-                mCustomFunctions.add(new Integer(ref));
-            } else {
-                throw new SQLiteException("failed to add custom function " + name);
-            }
+        // Create wrapper (also validates arguments).
+        SQLiteCustomFunction wrapper = new SQLiteCustomFunction(name, numArgs, function);
+
+        synchronized (mLock) {
+            throwIfNotOpenLocked();
+            mConfigurationLocked.customFunctions.add(wrapper);
+            mConnectionPoolLocked.reconfigure(mConfigurationLocked);
         }
     }
 
-    private void releaseCustomFunctions() {
-        synchronized (mCustomFunctions) {
-            for (int i = 0; i < mCustomFunctions.size(); i++) {
-                Integer function = mCustomFunctions.get(i);
-                native_releaseCustomFunction(function.intValue());
-            }
-            mCustomFunctions.clear();
-        }
-    }
-
-    // list of CustomFunction references so we can clean up when the database closes
-    private final ArrayList<Integer> mCustomFunctions =
-            new ArrayList<Integer>();
-
-    private native int native_addCustomFunction(String name, int numArgs, CustomFunction function);
-    private native void native_releaseCustomFunction(int function);
-
     /**
      * Gets the database version.
      *
@@ -1364,7 +898,7 @@
      * {@link SQLiteStatement}s are not synchronized, see the documentation for more details.
      */
     public SQLiteStatement compileStatement(String sql) throws SQLException {
-        verifyDbIsOpen();
+        throwIfNotOpen(); // fail fast
         return new SQLiteStatement(this, sql, null);
     }
 
@@ -1403,7 +937,48 @@
             String selection, String[] selectionArgs, String groupBy,
             String having, String orderBy, String limit) {
         return queryWithFactory(null, distinct, table, columns, selection, selectionArgs,
-                groupBy, having, orderBy, limit);
+                groupBy, having, orderBy, limit, null);
+    }
+
+    /**
+     * Query the given URL, returning a {@link Cursor} over the result set.
+     *
+     * @param distinct true if you want each row to be unique, false otherwise.
+     * @param table The table name to compile the query against.
+     * @param columns A list of which columns to return. Passing null will
+     *            return all columns, which is discouraged to prevent reading
+     *            data from storage that isn't going to be used.
+     * @param selection A filter declaring which rows to return, formatted as an
+     *            SQL WHERE clause (excluding the WHERE itself). Passing null
+     *            will return all rows for the given table.
+     * @param selectionArgs You may include ?s in selection, which will be
+     *         replaced by the values from selectionArgs, in order that they
+     *         appear in the selection. The values will be bound as Strings.
+     * @param groupBy A filter declaring how to group rows, formatted as an SQL
+     *            GROUP BY clause (excluding the GROUP BY itself). Passing null
+     *            will cause the rows to not be grouped.
+     * @param having A filter declare which row groups to include in the cursor,
+     *            if row grouping is being used, formatted as an SQL HAVING
+     *            clause (excluding the HAVING itself). Passing null will cause
+     *            all row groups to be included, and is required when row
+     *            grouping is not being used.
+     * @param orderBy How to order the rows, formatted as an SQL ORDER BY clause
+     *            (excluding the ORDER BY itself). Passing null will use the
+     *            default sort order, which may be unordered.
+     * @param limit Limits the number of rows returned by the query,
+     *            formatted as LIMIT clause. Passing null denotes no LIMIT clause.
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     * If the operation is canceled, then {@link OperationCanceledException} will be thrown
+     * when the query is executed.
+     * @return A {@link Cursor} object, which is positioned before the first entry. Note that
+     * {@link Cursor}s are not synchronized, see the documentation for more details.
+     * @see Cursor
+     */
+    public Cursor query(boolean distinct, String table, String[] columns,
+            String selection, String[] selectionArgs, String groupBy,
+            String having, String orderBy, String limit, CancellationSignal cancellationSignal) {
+        return queryWithFactory(null, distinct, table, columns, selection, selectionArgs,
+                groupBy, having, orderBy, limit, cancellationSignal);
     }
 
     /**
@@ -1442,12 +1017,55 @@
             boolean distinct, String table, String[] columns,
             String selection, String[] selectionArgs, String groupBy,
             String having, String orderBy, String limit) {
-        verifyDbIsOpen();
+        return queryWithFactory(cursorFactory, distinct, table, columns, selection,
+                selectionArgs, groupBy, having, orderBy, limit, null);
+    }
+
+    /**
+     * Query the given URL, returning a {@link Cursor} over the result set.
+     *
+     * @param cursorFactory the cursor factory to use, or null for the default factory
+     * @param distinct true if you want each row to be unique, false otherwise.
+     * @param table The table name to compile the query against.
+     * @param columns A list of which columns to return. Passing null will
+     *            return all columns, which is discouraged to prevent reading
+     *            data from storage that isn't going to be used.
+     * @param selection A filter declaring which rows to return, formatted as an
+     *            SQL WHERE clause (excluding the WHERE itself). Passing null
+     *            will return all rows for the given table.
+     * @param selectionArgs You may include ?s in selection, which will be
+     *         replaced by the values from selectionArgs, in order that they
+     *         appear in the selection. The values will be bound as Strings.
+     * @param groupBy A filter declaring how to group rows, formatted as an SQL
+     *            GROUP BY clause (excluding the GROUP BY itself). Passing null
+     *            will cause the rows to not be grouped.
+     * @param having A filter declare which row groups to include in the cursor,
+     *            if row grouping is being used, formatted as an SQL HAVING
+     *            clause (excluding the HAVING itself). Passing null will cause
+     *            all row groups to be included, and is required when row
+     *            grouping is not being used.
+     * @param orderBy How to order the rows, formatted as an SQL ORDER BY clause
+     *            (excluding the ORDER BY itself). Passing null will use the
+     *            default sort order, which may be unordered.
+     * @param limit Limits the number of rows returned by the query,
+     *            formatted as LIMIT clause. Passing null denotes no LIMIT clause.
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     * If the operation is canceled, then {@link OperationCanceledException} will be thrown
+     * when the query is executed.
+     * @return A {@link Cursor} object, which is positioned before the first entry. Note that
+     * {@link Cursor}s are not synchronized, see the documentation for more details.
+     * @see Cursor
+     */
+    public Cursor queryWithFactory(CursorFactory cursorFactory,
+            boolean distinct, String table, String[] columns,
+            String selection, String[] selectionArgs, String groupBy,
+            String having, String orderBy, String limit, CancellationSignal cancellationSignal) {
+        throwIfNotOpen(); // fail fast
         String sql = SQLiteQueryBuilder.buildQueryString(
                 distinct, table, columns, selection, groupBy, having, orderBy, limit);
 
-        return rawQueryWithFactory(
-                cursorFactory, sql, selectionArgs, findEditTable(table));
+        return rawQueryWithFactory(cursorFactory, sql, selectionArgs,
+                findEditTable(table), cancellationSignal);
     }
 
     /**
@@ -1535,7 +1153,25 @@
      * {@link Cursor}s are not synchronized, see the documentation for more details.
      */
     public Cursor rawQuery(String sql, String[] selectionArgs) {
-        return rawQueryWithFactory(null, sql, selectionArgs, null);
+        return rawQueryWithFactory(null, sql, selectionArgs, null, null);
+    }
+
+    /**
+     * Runs the provided SQL and returns a {@link Cursor} over the result set.
+     *
+     * @param sql the SQL query. The SQL string must not be ; terminated
+     * @param selectionArgs You may include ?s in where clause in the query,
+     *     which will be replaced by the values from selectionArgs. The
+     *     values will be bound as Strings.
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     * If the operation is canceled, then {@link OperationCanceledException} will be thrown
+     * when the query is executed.
+     * @return A {@link Cursor} object, which is positioned before the first entry. Note that
+     * {@link Cursor}s are not synchronized, see the documentation for more details.
+     */
+    public Cursor rawQuery(String sql, String[] selectionArgs,
+            CancellationSignal cancellationSignal) {
+        return rawQueryWithFactory(null, sql, selectionArgs, null, cancellationSignal);
     }
 
     /**
@@ -1553,21 +1189,33 @@
     public Cursor rawQueryWithFactory(
             CursorFactory cursorFactory, String sql, String[] selectionArgs,
             String editTable) {
-        verifyDbIsOpen();
-        BlockGuard.getThreadPolicy().onReadFromDisk();
+        return rawQueryWithFactory(cursorFactory, sql, selectionArgs, editTable, null);
+    }
 
-        SQLiteDatabase db = getDbConnection(sql);
-        SQLiteCursorDriver driver = new SQLiteDirectCursorDriver(db, sql, editTable);
+    /**
+     * Runs the provided SQL and returns a cursor over the result set.
+     *
+     * @param cursorFactory the cursor factory to use, or null for the default factory
+     * @param sql the SQL query. The SQL string must not be ; terminated
+     * @param selectionArgs You may include ?s in where clause in the query,
+     *     which will be replaced by the values from selectionArgs. The
+     *     values will be bound as Strings.
+     * @param editTable the name of the first table, which is editable
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     * If the operation is canceled, then {@link OperationCanceledException} will be thrown
+     * when the query is executed.
+     * @return A {@link Cursor} object, which is positioned before the first entry. Note that
+     * {@link Cursor}s are not synchronized, see the documentation for more details.
+     */
+    public Cursor rawQueryWithFactory(
+            CursorFactory cursorFactory, String sql, String[] selectionArgs,
+            String editTable, CancellationSignal cancellationSignal) {
+        throwIfNotOpen(); // fail fast
 
-        Cursor cursor = null;
-        try {
-            cursor = driver.query(
-                    cursorFactory != null ? cursorFactory : mFactory,
-                    selectionArgs);
-        } finally {
-            releaseDbConnection(db);
-        }
-        return cursor;
+        SQLiteCursorDriver driver = new SQLiteDirectCursorDriver(this, sql, editTable,
+                cancellationSignal);
+        return driver.query(cursorFactory != null ? cursorFactory : mCursorFactory,
+                selectionArgs);
     }
 
     /**
@@ -1716,9 +1364,6 @@
         SQLiteStatement statement = new SQLiteStatement(this, sql.toString(), bindArgs);
         try {
             return statement.executeInsert();
-        } catch (SQLiteDatabaseCorruptException e) {
-            onCorruption();
-            throw e;
         } finally {
             statement.close();
         }
@@ -1739,9 +1384,6 @@
                 (!TextUtils.isEmpty(whereClause) ? " WHERE " + whereClause : ""), whereArgs);
         try {
             return statement.executeUpdateDelete();
-        } catch (SQLiteDatabaseCorruptException e) {
-            onCorruption();
-            throw e;
         } finally {
             statement.close();
         }
@@ -1808,9 +1450,6 @@
         SQLiteStatement statement = new SQLiteStatement(this, sql.toString(), bindArgs);
         try {
             return statement.executeUpdateDelete();
-        } catch (SQLiteDatabaseCorruptException e) {
-            onCorruption();
-            throw e;
         } finally {
             statement.close();
         }
@@ -1891,264 +1530,105 @@
 
     private int executeSql(String sql, Object[] bindArgs) throws SQLException {
         if (DatabaseUtils.getSqlStatementType(sql) == DatabaseUtils.STATEMENT_ATTACH) {
-            disableWriteAheadLogging();
-            mHasAttachedDbs = true;
+            boolean disableWal = false;
+            synchronized (mLock) {
+                if (!mHasAttachedDbsLocked) {
+                    mHasAttachedDbsLocked = true;
+                    disableWal = true;
+                }
+            }
+            if (disableWal) {
+                disableWriteAheadLogging();
+            }
         }
+
         SQLiteStatement statement = new SQLiteStatement(this, sql, bindArgs);
         try {
             return statement.executeUpdateDelete();
-        } catch (SQLiteDatabaseCorruptException e) {
-            onCorruption();
-            throw e;
         } finally {
             statement.close();
         }
     }
 
-    @Override
-    protected void finalize() throws Throwable {
-        try {
-            if (isOpen()) {
-                Log.e(TAG, "close() was never explicitly called on database '" +
-                        mPath + "' ", mStackTrace);
-                closeClosable();
-                onAllReferencesReleased();
-                releaseCustomFunctions();
-            }
-        } finally {
-            super.finalize();
-        }
-    }
-
     /**
-     * Private constructor.
+     * Returns true if the database is opened as read only.
      *
-     * @param path The full path to the database
-     * @param factory The factory to use when creating cursors, may be NULL.
-     * @param flags 0 or {@link #NO_LOCALIZED_COLLATORS}.  If the database file already
-     *              exists, mFlags will be updated appropriately.
-     * @param errorHandler The {@link DatabaseErrorHandler} to be used when sqlite reports database
-     * corruption. may be NULL.
-     * @param connectionNum 0 for main database connection handle. 1..N for pooled database
-     * connection handles.
-     */
-    private SQLiteDatabase(String path, CursorFactory factory, int flags,
-            DatabaseErrorHandler errorHandler, short connectionNum) {
-        if (path == null) {
-            throw new IllegalArgumentException("path should not be null");
-        }
-        setMaxSqlCacheSize(DEFAULT_SQL_CACHE_SIZE);
-        mFlags = flags;
-        mPath = path;
-        mStackTrace = new DatabaseObjectNotClosedException().fillInStackTrace();
-        mFactory = factory;
-        mPrograms = new WeakHashMap<SQLiteClosable,Object>();
-        // Set the DatabaseErrorHandler to be used when SQLite reports corruption.
-        // If the caller sets errorHandler = null, then use default errorhandler.
-        mErrorHandler = (errorHandler == null) ? new DefaultDatabaseErrorHandler() : errorHandler;
-        mConnectionNum = connectionNum;
-        /* sqlite soft heap limit http://www.sqlite.org/c3ref/soft_heap_limit64.html
-         * set it to 4 times the default cursor window size.
-         * TODO what is an appropriate value, considering the WAL feature which could burn
-         * a lot of memory with many connections to the database. needs testing to figure out
-         * optimal value for this.
-         */
-        int limit = Resources.getSystem().getInteger(
-                com.android.internal.R.integer.config_cursorWindowSize) * 1024 * 4;
-        native_setSqliteSoftHeapLimit(limit);
-    }
-
-    /**
-     * return whether the DB is opened as read only.
-     * @return true if DB is opened as read only
+     * @return True if database is opened as read only.
      */
     public boolean isReadOnly() {
-        return (mFlags & OPEN_READ_MASK) == OPEN_READONLY;
+        synchronized (mLock) {
+            return isReadOnlyLocked();
+        }
+    }
+
+    private boolean isReadOnlyLocked() {
+        return (mConfigurationLocked.openFlags & OPEN_READ_MASK) == OPEN_READONLY;
     }
 
     /**
-     * @return true if the DB is currently open (has not been closed)
+     * Returns true if the database is in-memory db.
+     *
+     * @return True if the database is in-memory.
+     * @hide
      */
-    public boolean isOpen() {
-        return mNativeHandle != 0;
+    public boolean isInMemoryDatabase() {
+        synchronized (mLock) {
+            return mConfigurationLocked.isInMemoryDb();
+        }
     }
 
+    /**
+     * Returns true if the database is currently open.
+     *
+     * @return True if the database is currently open (has not been closed).
+     */
+    public boolean isOpen() {
+        synchronized (mLock) {
+            return mConnectionPoolLocked != null;
+        }
+    }
+
+    /**
+     * Returns true if the new version code is greater than the current database version.
+     *
+     * @param newVersion The new version code.
+     * @return True if the new version code is greater than the current database version. 
+     */
     public boolean needUpgrade(int newVersion) {
         return newVersion > getVersion();
     }
 
     /**
-     * Getter for the path to the database file.
+     * Gets the path to the database file.
      *
-     * @return the path to our database file.
+     * @return The path to the database file.
      */
     public final String getPath() {
-        return mPath;
-    }
-
-    /* package */ void logTimeStat(String sql, long beginMillis) {
-        if (ENABLE_DB_SAMPLE) {
-            logTimeStat(sql, beginMillis, null);
+        synchronized (mLock) {
+            return mConfigurationLocked.path;
         }
     }
 
-    private void logTimeStat(String sql, long beginMillis, String prefix) {
-        // Sample fast queries in proportion to the time taken.
-        // Quantize the % first, so the logged sampling probability
-        // exactly equals the actual sampling rate for this query.
-
-        int samplePercent;
-        long durationMillis = SystemClock.uptimeMillis() - beginMillis;
-        if (durationMillis == 0 && prefix == GET_LOCK_LOG_PREFIX) {
-            // The common case is locks being uncontended.  Don't log those,
-            // even at 1%, which is our default below.
-            return;
-        }
-        if (sQueryLogTimeInMillis == 0) {
-            sQueryLogTimeInMillis = SystemProperties.getInt("db.db_operation.threshold_ms", 500);
-        }
-        if (durationMillis >= sQueryLogTimeInMillis) {
-            samplePercent = 100;
-        } else {
-            samplePercent = (int) (100 * durationMillis / sQueryLogTimeInMillis) + 1;
-            if (mRandom.nextInt(100) >= samplePercent) return;
-        }
-
-        // Note: the prefix will be "COMMIT;" or "GETLOCK:" when non-null.  We wait to do
-        // it here so we avoid allocating in the common case.
-        if (prefix != null) {
-            sql = prefix + sql;
-        }
-        if (sql.length() > QUERY_LOG_SQL_LENGTH) sql = sql.substring(0, QUERY_LOG_SQL_LENGTH);
-
-        // ActivityThread.currentPackageName() only returns non-null if the
-        // current thread is an application main thread.  This parameter tells
-        // us whether an event loop is blocked, and if so, which app it is.
-        //
-        // Sadly, there's no fast way to determine app name if this is *not* a
-        // main thread, or when we are invoked via Binder (e.g. ContentProvider).
-        // Hopefully the full path to the database will be informative enough.
-
-        String blockingPackage = AppGlobals.getInitialPackage();
-        if (blockingPackage == null) blockingPackage = "";
-
-        EventLog.writeEvent(
-            EVENT_DB_OPERATION,
-            getPathForLogs(),
-            sql,
-            durationMillis,
-            blockingPackage,
-            samplePercent);
-    }
-
-    /**
-     * Removes email addresses from database filenames before they're
-     * logged to the EventLog where otherwise apps could potentially
-     * read them.
-     */
-    private String getPathForLogs() {
-        if (mPathForLogs != null) {
-            return mPathForLogs;
-        }
-        if (mPath == null) {
-            return null;
-        }
-        if (mPath.indexOf('@') == -1) {
-            mPathForLogs = mPath;
-        } else {
-            mPathForLogs = EMAIL_IN_DB_PATTERN.matcher(mPath).replaceAll("XX@YY");
-        }
-        return mPathForLogs;
-    }
-
     /**
      * Sets the locale for this database.  Does nothing if this database has
      * the NO_LOCALIZED_COLLATORS flag set or was opened read only.
+     *
+     * @param locale The new locale.
+     *
      * @throws SQLException if the locale could not be set.  The most common reason
      * for this is that there is no collator available for the locale you requested.
      * In this case the database remains unchanged.
      */
     public void setLocale(Locale locale) {
-        lock();
-        try {
-            native_setLocale(locale.toString(), mFlags);
-        } finally {
-            unlock();
-        }
-    }
-
-    /* package */ void verifyDbIsOpen() {
-        if (!isOpen()) {
-            throw new IllegalStateException("database " + getPath() + " (conn# " +
-                    mConnectionNum + ") already closed");
-        }
-    }
-
-    /* package */ void verifyLockOwner() {
-        verifyDbIsOpen();
-        if (mLockingEnabled && !isDbLockedByCurrentThread()) {
-            throw new IllegalStateException("Don't have database lock!");
-        }
-    }
-
-    /**
-     * Adds the given SQL and its compiled-statement-id-returned-by-sqlite to the
-     * cache of compiledQueries attached to 'this'.
-     * <p>
-     * If there is already a {@link SQLiteCompiledSql} in compiledQueries for the given SQL,
-     * the new {@link SQLiteCompiledSql} object is NOT inserted into the cache (i.e.,the current
-     * mapping is NOT replaced with the new mapping).
-     */
-    /* package */ synchronized void addToCompiledQueries(
-            String sql, SQLiteCompiledSql compiledStatement) {
-        // don't insert the new mapping if a mapping already exists
-        if (mCompiledQueries.get(sql) != null) {
-            return;
+        if (locale == null) {
+            throw new IllegalArgumentException("locale must not be null.");
         }
 
-        int maxCacheSz = (mConnectionNum == 0) ? mCompiledQueries.maxSize() :
-                mParentConnObj.mCompiledQueries.maxSize();
-
-        if (SQLiteDebug.DEBUG_SQL_CACHE) {
-            boolean printWarning = (mConnectionNum == 0)
-                    ? (!mCacheFullWarning && mCompiledQueries.size() == maxCacheSz)
-                    : (!mParentConnObj.mCacheFullWarning &&
-                    mParentConnObj.mCompiledQueries.size() == maxCacheSz);
-            if (printWarning) {
-                /*
-                 * cache size is not enough for this app. log a warning.
-                 * chances are it is NOT using ? for bindargs - or cachesize is too small.
-                 */
-                Log.w(TAG, "Reached MAX size for compiled-sql statement cache for database " +
-                        getPath() + ". Use setMaxSqlCacheSize() to increase cachesize. ");
-                mCacheFullWarning = true;
-                Log.d(TAG, "Here are the SQL statements in Cache of database: " + mPath);
-                for (String s : mCompiledQueries.snapshot().keySet()) {
-                    Log.d(TAG, "Sql statement in Cache: " + s);
-                }
-            }
+        synchronized (mLock) {
+            throwIfNotOpenLocked();
+            mConfigurationLocked.locale = locale;
+            mConnectionPoolLocked.reconfigure(mConfigurationLocked);
         }
-        /* add the given SQLiteCompiledSql compiledStatement to cache.
-         * no need to worry about the cache size - because {@link #mCompiledQueries}
-         * self-limits its size.
-         */
-        mCompiledQueries.put(sql, compiledStatement);
-    }
-
-    /** package-level access for testing purposes */
-    /* package */ synchronized void deallocCachedSqlStatements() {
-        for (SQLiteCompiledSql compiledSql : mCompiledQueries.snapshot().values()) {
-            compiledSql.releaseSqlStatement();
-        }
-        mCompiledQueries.evictAll();
-    }
-
-    /**
-     * From the compiledQueries cache, returns the compiled-statement-id for the given SQL.
-     * Returns null, if not found in the cache.
-     */
-    /* package */ synchronized SQLiteCompiledSql getCompiledStatementForSql(String sql) {
-        return mCompiledQueries.get(sql);
     }
 
     /**
@@ -2162,115 +1642,21 @@
      * This method is thread-safe.
      *
      * @param cacheSize the size of the cache. can be (0 to {@link #MAX_SQL_CACHE_SIZE})
-     * @throws IllegalStateException if input cacheSize > {@link #MAX_SQL_CACHE_SIZE} or
-     * the value set with previous setMaxSqlCacheSize() call.
+     * @throws IllegalStateException if input cacheSize > {@link #MAX_SQL_CACHE_SIZE}.
      */
     public void setMaxSqlCacheSize(int cacheSize) {
-        synchronized (this) {
-            LruCache<String, SQLiteCompiledSql> oldCompiledQueries = mCompiledQueries;
-            if (cacheSize > MAX_SQL_CACHE_SIZE || cacheSize < 0) {
-                throw new IllegalStateException(
-                        "expected value between 0 and " + MAX_SQL_CACHE_SIZE);
-            } else if (oldCompiledQueries != null && cacheSize < oldCompiledQueries.maxSize()) {
-                throw new IllegalStateException("cannot set cacheSize to a value less than the "
-                        + "value set with previous setMaxSqlCacheSize() call.");
-            }
-            mCompiledQueries = new LruCache<String, SQLiteCompiledSql>(cacheSize) {
-                @Override
-                protected void entryRemoved(boolean evicted, String key, SQLiteCompiledSql oldValue,
-                        SQLiteCompiledSql newValue) {
-                    verifyLockOwner();
-                    oldValue.releaseIfNotInUse();
-                }
-            };
-            if (oldCompiledQueries != null) {
-                for (Map.Entry<String, SQLiteCompiledSql> entry
-                        : oldCompiledQueries.snapshot().entrySet()) {
-                    mCompiledQueries.put(entry.getKey(), entry.getValue());
-                }
-            }
+        if (cacheSize > MAX_SQL_CACHE_SIZE || cacheSize < 0) {
+            throw new IllegalStateException(
+                    "expected value between 0 and " + MAX_SQL_CACHE_SIZE);
         }
-    }
 
-    /* package */ synchronized boolean isInStatementCache(String sql) {
-        return mCompiledQueries.get(sql) != null;
-    }
-
-    /* package */ synchronized void releaseCompiledSqlObj(
-            String sql, SQLiteCompiledSql compiledSql) {
-        if (mCompiledQueries.get(sql) == compiledSql) {
-            // it is in cache - reset its inUse flag
-            compiledSql.release();
-        } else {
-            // it is NOT in cache. finalize it.
-            compiledSql.releaseSqlStatement();
+        synchronized (mLock) {
+            throwIfNotOpenLocked();
+            mConfigurationLocked.maxSqlCacheSize = cacheSize;
+            mConnectionPoolLocked.reconfigure(mConfigurationLocked);
         }
     }
 
-    private synchronized int getCacheHitNum() {
-        return mCompiledQueries.hitCount();
-    }
-
-    private synchronized int getCacheMissNum() {
-        return mCompiledQueries.missCount();
-    }
-
-    private synchronized int getCachesize() {
-        return mCompiledQueries.size();
-    }
-
-    /* package */ void finalizeStatementLater(int id) {
-        if (!isOpen()) {
-            // database already closed. this statement will already have been finalized.
-            return;
-        }
-        synchronized(mClosedStatementIds) {
-            if (mClosedStatementIds.contains(id)) {
-                // this statement id is already queued up for finalization.
-                return;
-            }
-            mClosedStatementIds.add(id);
-        }
-    }
-
-    /* package */ boolean isInQueueOfStatementsToBeFinalized(int id) {
-        if (!isOpen()) {
-            // database already closed. this statement will already have been finalized.
-            // return true so that the caller doesn't have to worry about finalizing this statement.
-            return true;
-        }
-        synchronized(mClosedStatementIds) {
-            return mClosedStatementIds.contains(id);
-        }
-    }
-
-    /* package */ void closePendingStatements() {
-        if (!isOpen()) {
-            // since this database is already closed, no need to finalize anything.
-            mClosedStatementIds.clear();
-            return;
-        }
-        verifyLockOwner();
-        /* to minimize synchronization on mClosedStatementIds, make a copy of the list */
-        ArrayList<Integer> list = new ArrayList<Integer>(mClosedStatementIds.size());
-        synchronized(mClosedStatementIds) {
-            list.addAll(mClosedStatementIds);
-            mClosedStatementIds.clear();
-        }
-        // finalize all the statements from the copied list
-        int size = list.size();
-        for (int i = 0; i < size; i++) {
-            native_finalize(list.get(i));
-        }
-    }
-
-    /**
-     * for testing only
-     */
-    /* package */ ArrayList<Integer> getQueuedUpStmtList() {
-        return mClosedStatementIds;
-    }
-
     /**
      * This method enables parallel execution of queries from multiple threads on the same database.
      * It does this by opening multiple handles to the database and using a different
@@ -2314,37 +1700,43 @@
      * @return true if write-ahead-logging is set. false otherwise
      */
     public boolean enableWriteAheadLogging() {
-        // make sure the database is not READONLY. WAL doesn't make sense for readonly-databases.
-        if (isReadOnly()) {
-            return false;
-        }
-        // acquire lock - no that no other thread is enabling WAL at the same time
-        lock();
-        try {
-            if (mConnectionPool != null) {
-                // already enabled
+        synchronized (mLock) {
+            throwIfNotOpenLocked();
+
+            if (mIsWALEnabledLocked) {
                 return true;
             }
-            if (mPath.equalsIgnoreCase(MEMORY_DB_PATH)) {
+
+            if (isReadOnlyLocked()) {
+                // WAL doesn't make sense for readonly-databases.
+                // TODO: True, but connection pooling does still make sense...
+                return false;
+            }
+
+            if (mConfigurationLocked.isInMemoryDb()) {
                 Log.i(TAG, "can't enable WAL for memory databases.");
                 return false;
             }
 
             // make sure this database has NO attached databases because sqlite's write-ahead-logging
             // doesn't work for databases with attached databases
-            if (mHasAttachedDbs) {
+            if (mHasAttachedDbsLocked) {
                 if (Log.isLoggable(TAG, Log.DEBUG)) {
-                    Log.d(TAG,
-                            "this database: " + mPath + " has attached databases. can't  enable WAL.");
+                    Log.d(TAG, "this database: " + mConfigurationLocked.label
+                            + " has attached databases. can't  enable WAL.");
                 }
                 return false;
             }
-            mConnectionPool = new DatabaseConnectionPool(this);
-            setJournalMode(mPath, "WAL");
-            return true;
-        } finally {
-            unlock();
+
+            mIsWALEnabledLocked = true;
+            mConfigurationLocked.maxConnectionPoolSize = Math.max(2,
+                    Resources.getSystem().getInteger(
+                            com.android.internal.R.integer.db_connection_pool_size));
+            mConnectionPoolLocked.reconfigure(mConfigurationLocked);
         }
+
+        setJournalMode("WAL");
+        return true;
     }
 
     /**
@@ -2352,178 +1744,68 @@
      * @hide
      */
     public void disableWriteAheadLogging() {
-        // grab database lock so that writeAheadLogging is not disabled from 2 different threads
-        // at the same time
-        lock();
-        try {
-            if (mConnectionPool == null) {
-                return; // already disabled
+        synchronized (mLock) {
+            throwIfNotOpenLocked();
+
+            if (!mIsWALEnabledLocked) {
+                return;
             }
-            mConnectionPool.close();
-            setJournalMode(mPath, "TRUNCATE");
-            mConnectionPool = null;
-        } finally {
-            unlock();
-        }
-    }
 
-    /* package */ SQLiteDatabase getDatabaseHandle(String sql) {
-        if (isPooledConnection()) {
-            // this is a pooled database connection
-            // use it if it is open AND if I am not currently part of a transaction
-            if (isOpen() && !amIInTransaction()) {
-                // TODO: use another connection from the pool
-                // if this connection is currently in use by some other thread
-                // AND if there are free connections in the pool
-                return this;
-            } else {
-                // the pooled connection is not open! could have been closed either due
-                // to corruption on this or some other connection to the database
-                // OR, maybe the connection pool is disabled after this connection has been
-                // allocated to me. try to get some other pooled or main database connection
-                return getParentDbConnObj().getDbConnection(sql);
-            }
-        } else {
-            // this is NOT a pooled connection. can we get one?
-            return getDbConnection(sql);
-        }
-    }
-
-    /* package */ SQLiteDatabase createPoolConnection(short connectionNum) {
-        SQLiteDatabase db = openDatabase(mPath, mFactory, mFlags, mErrorHandler, connectionNum);
-        db.mParentConnObj = this;
-        return db;
-    }
-
-    private synchronized SQLiteDatabase getParentDbConnObj() {
-        return mParentConnObj;
-    }
-
-    private boolean isPooledConnection() {
-        return this.mConnectionNum > 0;
-    }
-
-    /* package */ SQLiteDatabase getDbConnection(String sql) {
-        verifyDbIsOpen();
-        // this method should always be called with main database connection handle.
-        // the only time when it is called with pooled database connection handle is
-        // corruption occurs while trying to open a pooled database connection handle.
-        // in that case, simply return 'this' handle
-        if (isPooledConnection()) {
-            return this;
+            mIsWALEnabledLocked = false;
+            mConfigurationLocked.maxConnectionPoolSize = 1;
+            mConnectionPoolLocked.reconfigure(mConfigurationLocked);
         }
 
-        // use the current connection handle if
-        // 1. if the caller is part of the ongoing transaction, if any
-        // 2. OR, if there is NO connection handle pool setup
-        if (amIInTransaction() || mConnectionPool == null) {
-            return this;
-        } else {
-            // get a connection handle from the pool
-            if (Log.isLoggable(TAG, Log.DEBUG)) {
-                assert mConnectionPool != null;
-                Log.i(TAG, mConnectionPool.toString());
-            }
-            return mConnectionPool.get(sql);
-        }
-    }
-
-    private void releaseDbConnection(SQLiteDatabase db) {
-        // ignore this release call if
-        // 1. the database is closed
-        // 2. OR, if db is NOT a pooled connection handle
-        // 3. OR, if the database being released is same as 'this' (this condition means
-        //     that we should always be releasing a pooled connection handle by calling this method
-        //     from the 'main' connection handle
-        if (!isOpen() || !db.isPooledConnection() || (db == this)) {
-            return;
-        }
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            assert isPooledConnection();
-            assert mConnectionPool != null;
-            Log.d(TAG, "releaseDbConnection threadid = " + Thread.currentThread().getId() +
-                    ", releasing # " + db.mConnectionNum + ", " + getPath());
-        }
-        mConnectionPool.release(db);
+        setJournalMode("TRUNCATE");
     }
 
     /**
-     * this method is used to collect data about ALL open databases in the current process.
-     * bugreport is a user of this data.
+     * Collect statistics about all open databases in the current process.
+     * Used by bug report.
      */
-    /* package */ static ArrayList<DbStats> getDbStats() {
+    static ArrayList<DbStats> getDbStats() {
         ArrayList<DbStats> dbStatsList = new ArrayList<DbStats>();
-        // make a local copy of mActiveDatabases - so that this method is not competing
-        // for synchronization lock on mActiveDatabases
-        ArrayList<WeakReference<SQLiteDatabase>> tempList;
-        synchronized(mActiveDatabases) {
-            tempList = (ArrayList<WeakReference<SQLiteDatabase>>)mActiveDatabases.clone();
-        }
-        for (WeakReference<SQLiteDatabase> w : tempList) {
-            SQLiteDatabase db = w.get();
-            if (db == null || !db.isOpen()) {
-                continue;
-            }
-
-            try {
-                // get SQLITE_DBSTATUS_LOOKASIDE_USED for the db
-                int lookasideUsed = db.native_getDbLookaside();
-
-                // get the lastnode of the dbname
-                String path = db.getPath();
-                int indx = path.lastIndexOf("/");
-                String lastnode = path.substring((indx != -1) ? ++indx : 0);
-
-                // get list of attached dbs and for each db, get its size and pagesize
-                List<Pair<String, String>> attachedDbs = db.getAttachedDbs();
-                if (attachedDbs == null) {
-                    continue;
-                }
-                for (int i = 0; i < attachedDbs.size(); i++) {
-                    Pair<String, String> p = attachedDbs.get(i);
-                    long pageCount = DatabaseUtils.longForQuery(db, "PRAGMA " + p.first
-                            + ".page_count;", null);
-
-                    // first entry in the attached db list is always the main database
-                    // don't worry about prefixing the dbname with "main"
-                    String dbName;
-                    if (i == 0) {
-                        dbName = lastnode;
-                    } else {
-                        // lookaside is only relevant for the main db
-                        lookasideUsed = 0;
-                        dbName = "  (attached) " + p.first;
-                        // if the attached db has a path, attach the lastnode from the path to above
-                        if (p.second.trim().length() > 0) {
-                            int idx = p.second.lastIndexOf("/");
-                            dbName += " : " + p.second.substring((idx != -1) ? ++idx : 0);
-                        }
-                    }
-                    if (pageCount > 0) {
-                        dbStatsList.add(new DbStats(dbName, pageCount, db.getPageSize(),
-                                lookasideUsed, db.getCacheHitNum(), db.getCacheMissNum(),
-                                db.getCachesize()));
-                    }
-                }
-                // if there are pooled connections, return the cache stats for them also.
-                // while we are trying to query the pooled connections for stats, some other thread
-                // could be disabling conneciton pool. so, grab a reference to the connection pool.
-                DatabaseConnectionPool connPool = db.mConnectionPool;
-                if (connPool != null) {
-                    for (SQLiteDatabase pDb : connPool.getConnectionList()) {
-                        dbStatsList.add(new DbStats("(pooled # " + pDb.mConnectionNum + ") "
-                                + lastnode, 0, 0, 0, pDb.getCacheHitNum(),
-                                pDb.getCacheMissNum(), pDb.getCachesize()));
-                    }
-                }
-            } catch (SQLiteException e) {
-                // ignore. we don't care about exceptions when we are taking adb
-                // bugreport!
-            }
+        for (SQLiteDatabase db : getActiveDatabases()) {
+            db.collectDbStats(dbStatsList);
         }
         return dbStatsList;
     }
 
+    private void collectDbStats(ArrayList<DbStats> dbStatsList) {
+        synchronized (mLock) {
+            if (mConnectionPoolLocked != null) {
+                mConnectionPoolLocked.collectDbStats(dbStatsList);
+            }
+        }
+    }
+
+    private static ArrayList<SQLiteDatabase> getActiveDatabases() {
+        ArrayList<SQLiteDatabase> databases = new ArrayList<SQLiteDatabase>();
+        synchronized (sActiveDatabases) {
+            databases.addAll(sActiveDatabases.keySet());
+        }
+        return databases;
+    }
+
+    /**
+     * Dump detailed information about all open databases in the current process.
+     * Used by bug report.
+     */
+    static void dumpAll(Printer printer, boolean verbose) {
+        for (SQLiteDatabase db : getActiveDatabases()) {
+            db.dump(printer, verbose);
+        }
+    }
+
+    private void dump(Printer printer, boolean verbose) {
+        synchronized (mLock) {
+            if (mConnectionPoolLocked != null) {
+                printer.println("");
+                mConnectionPoolLocked.dump(printer, verbose);
+            }
+        }
+    }
+
     /**
      * Returns list of full pathnames of all attached databases including the main database
      * by executing 'pragma database_list' on the database.
@@ -2532,23 +1814,27 @@
      * is not open.
      */
     public List<Pair<String, String>> getAttachedDbs() {
-        if (!isOpen()) {
-            return null;
-        }
         ArrayList<Pair<String, String>> attachedDbs = new ArrayList<Pair<String, String>>();
-        if (!mHasAttachedDbs) {
-            // No attached databases.
-            // There is a small window where attached databases exist but this flag is not set yet.
-            // This can occur when this thread is in a race condition with another thread
-            // that is executing the SQL statement: "attach database <blah> as <foo>"
-            // If this thread is NOT ok with such a race condition (and thus possibly not receive
-            // the entire list of attached databases), then the caller should ensure that no thread
-            // is executing any SQL statements while a thread is calling this method.
-            // Typically, this method is called when 'adb bugreport' is done or the caller wants to
-            // collect stats on the database and all its attached databases.
-            attachedDbs.add(new Pair<String, String>("main", mPath));
-            return attachedDbs;
+        synchronized (mLock) {
+            if (mConnectionPoolLocked == null) {
+                return null; // not open
+            }
+
+            if (!mHasAttachedDbsLocked) {
+                // No attached databases.
+                // There is a small window where attached databases exist but this flag is not
+                // set yet.  This can occur when this thread is in a race condition with another
+                // thread that is executing the SQL statement: "attach database <blah> as <foo>"
+                // If this thread is NOT ok with such a race condition (and thus possibly not
+                // receivethe entire list of attached databases), then the caller should ensure
+                // that no thread is executing any SQL statements while a thread is calling this
+                // method.  Typically, this method is called when 'adb bugreport' is done or the
+                // caller wants to collect stats on the database and all its attached databases.
+                attachedDbs.add(new Pair<String, String>("main", mConfigurationLocked.path));
+                return attachedDbs;
+            }
         }
+
         // has attached databases. query sqlite to get the list of attached databases.
         Cursor c = null;
         try {
@@ -2583,7 +1869,8 @@
      * false otherwise.
      */
     public boolean isDatabaseIntegrityOk() {
-        verifyDbIsOpen();
+        throwIfNotOpen(); // fail fast
+
         List<Pair<String, String>> attachedDbs = null;
         try {
             attachedDbs = getAttachedDbs();
@@ -2594,8 +1881,9 @@
         } catch (SQLiteException e) {
             // can't get attachedDb list. do integrity check on the main database
             attachedDbs = new ArrayList<Pair<String, String>>();
-            attachedDbs.add(new Pair<String, String>("main", this.mPath));
+            attachedDbs.add(new Pair<String, String>("main", getPath()));
         }
+
         for (int i = 0; i < attachedDbs.size(); i++) {
             Pair<String, String> p = attachedDbs.get(i);
             SQLiteStatement prog = null;
@@ -2615,59 +1903,64 @@
     }
 
     /**
-     * Native call to open the database.
+     * Prevent other threads from using the database's primary connection.
      *
-     * @param path The full path to the database
-     */
-    private native void dbopen(String path, int flags);
-
-    /**
-     * Native call to setup tracing of all SQL statements
+     * This method is only used by {@link SQLiteOpenHelper} when transitioning from
+     * a readable to a writable database.  It should not be used in any other way.
      *
-     * @param path the full path to the database
-     * @param connectionNum connection number: 0 - N, where the main database
-     *            connection handle is numbered 0 and the connection handles in the connection
-     *            pool are numbered 1..N.
+     * @see #unlockPrimaryConnection()
      */
-    private native void enableSqlTracing(String path, short connectionNum);
+    void lockPrimaryConnection() {
+        getThreadSession().beginTransaction(SQLiteSession.TRANSACTION_MODE_DEFERRED,
+                null, SQLiteConnectionPool.CONNECTION_FLAG_PRIMARY_CONNECTION_AFFINITY, null);
+    }
 
     /**
-     * Native call to setup profiling of all SQL statements.
-     * currently, sqlite's profiling = printing of execution-time
-     * (wall-clock time) of each of the SQL statements, as they
-     * are executed.
+     * Allow other threads to use the database's primary connection.
      *
-     * @param path the full path to the database
-     * @param connectionNum connection number: 0 - N, where the main database
-     *            connection handle is numbered 0 and the connection handles in the connection
-     *            pool are numbered 1..N.
+     * @see #lockPrimaryConnection()
      */
-    private native void enableSqlProfiling(String path, short connectionNum);
+    void unlockPrimaryConnection() {
+        getThreadSession().endTransaction(null);
+    }
+
+    @Override
+    public String toString() {
+        return "SQLiteDatabase: " + getPath();
+    }
+
+    private void throwIfNotOpen() {
+        synchronized (mConnectionPoolLocked) {
+            throwIfNotOpenLocked();
+        }
+    }
+
+    private void throwIfNotOpenLocked() {
+        if (mConnectionPoolLocked == null) {
+            throw new IllegalStateException("The database '" + mConfigurationLocked.label
+                    + "' is not open.");
+        }
+    }
 
     /**
-     * Native call to set the locale.  {@link #lock} must be held when calling
-     * this method.
-     * @throws SQLException
+     * Used to allow returning sub-classes of {@link Cursor} when calling query.
      */
-    private native void native_setLocale(String loc, int flags);
+    public interface CursorFactory {
+        /**
+         * See {@link SQLiteCursor#SQLiteCursor(SQLiteCursorDriver, String, SQLiteQuery)}.
+         */
+        public Cursor newCursor(SQLiteDatabase db,
+                SQLiteCursorDriver masterQuery, String editTable,
+                SQLiteQuery query);
+    }
 
     /**
-     * return the SQLITE_DBSTATUS_LOOKASIDE_USED documented here
-     * http://www.sqlite.org/c3ref/c_dbstatus_lookaside_used.html
-     * @return int value of SQLITE_DBSTATUS_LOOKASIDE_USED
+     * A callback interface for a custom sqlite3 function.
+     * This can be used to create a function that can be called from
+     * sqlite3 database triggers.
+     * @hide
      */
-    private native int native_getDbLookaside();
-
-    /**
-     * finalizes the given statement id.
-     *
-     * @param statementId statement to be finzlied by sqlite
-     */
-    private final native void native_finalize(int statementId);
-
-    /**
-     * set sqlite soft heap limit
-     * http://www.sqlite.org/c3ref/soft_heap_limit64.html
-     */
-    private native void native_setSqliteSoftHeapLimit(int softHeapLimit);
+    public interface CustomFunction {
+        public void callback(String[] args);
+    }
 }
diff --git a/core/java/android/database/sqlite/SQLiteDatabaseConfiguration.java b/core/java/android/database/sqlite/SQLiteDatabaseConfiguration.java
new file mode 100644
index 0000000..bc79ad3
--- /dev/null
+++ b/core/java/android/database/sqlite/SQLiteDatabaseConfiguration.java
@@ -0,0 +1,167 @@
+/*
+ * 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 android.database.sqlite;
+
+import java.util.ArrayList;
+import java.util.Locale;
+import java.util.regex.Pattern;
+
+/**
+ * Describes how to configure a database.
+ * <p>
+ * The purpose of this object is to keep track of all of the little
+ * configuration settings that are applied to a database after it
+ * is opened so that they can be applied to all connections in the
+ * connection pool uniformly.
+ * </p><p>
+ * Each connection maintains its own copy of this object so it can
+ * keep track of which settings have already been applied.
+ * </p>
+ *
+ * @hide
+ */
+public final class SQLiteDatabaseConfiguration {
+    // The pattern we use to strip email addresses from database paths
+    // when constructing a label to use in log messages.
+    private static final Pattern EMAIL_IN_DB_PATTERN =
+            Pattern.compile("[\\w\\.\\-]+@[\\w\\.\\-]+");
+
+    /**
+     * Special path used by in-memory databases.
+     */
+    public static final String MEMORY_DB_PATH = ":memory:";
+
+    /**
+     * The database path.
+     */
+    public final String path;
+
+    /**
+     * The flags used to open the database.
+     */
+    public final int openFlags;
+
+    /**
+     * The label to use to describe the database when it appears in logs.
+     * This is derived from the path but is stripped to remove PII.
+     */
+    public final String label;
+
+    /**
+     * The maximum number of connections to retain in the connection pool.
+     * Must be at least 1.
+     *
+     * Default is 1.
+     */
+    public int maxConnectionPoolSize;
+
+    /**
+     * The maximum size of the prepared statement cache for each database connection.
+     * Must be non-negative.
+     *
+     * Default is 25.
+     */
+    public int maxSqlCacheSize;
+
+    /**
+     * The database locale.
+     *
+     * Default is the value returned by {@link Locale#getDefault()}.
+     */
+    public Locale locale;
+
+    /**
+     * The custom functions to register.
+     */
+    public final ArrayList<SQLiteCustomFunction> customFunctions =
+            new ArrayList<SQLiteCustomFunction>();
+
+    /**
+     * Creates a database configuration with the required parameters for opening a
+     * database and default values for all other parameters.
+     *
+     * @param path The database path.
+     * @param openFlags Open flags for the database, such as {@link SQLiteDatabase#OPEN_READWRITE}.
+     */
+    public SQLiteDatabaseConfiguration(String path, int openFlags) {
+        if (path == null) {
+            throw new IllegalArgumentException("path must not be null.");
+        }
+
+        this.path = path;
+        this.openFlags = openFlags;
+        label = stripPathForLogs(path);
+
+        // Set default values for optional parameters.
+        maxConnectionPoolSize = 1;
+        maxSqlCacheSize = 25;
+        locale = Locale.getDefault();
+    }
+
+    /**
+     * Creates a database configuration as a copy of another configuration.
+     *
+     * @param other The other configuration.
+     */
+    public SQLiteDatabaseConfiguration(SQLiteDatabaseConfiguration other) {
+        if (other == null) {
+            throw new IllegalArgumentException("other must not be null.");
+        }
+
+        this.path = other.path;
+        this.openFlags = other.openFlags;
+        this.label = other.label;
+        updateParametersFrom(other);
+    }
+
+    /**
+     * Updates the non-immutable parameters of this configuration object
+     * from the other configuration object.
+     *
+     * @param other The object from which to copy the parameters.
+     */
+    public void updateParametersFrom(SQLiteDatabaseConfiguration other) {
+        if (other == null) {
+            throw new IllegalArgumentException("other must not be null.");
+        }
+        if (!path.equals(other.path) || openFlags != other.openFlags) {
+            throw new IllegalArgumentException("other configuration must refer to "
+                    + "the same database.");
+        }
+
+        maxConnectionPoolSize = other.maxConnectionPoolSize;
+        maxSqlCacheSize = other.maxSqlCacheSize;
+        locale = other.locale;
+        customFunctions.clear();
+        customFunctions.addAll(other.customFunctions);
+    }
+
+    /**
+     * Returns true if the database is in-memory.
+     * @return True if the database is in-memory.
+     */
+    public boolean isInMemoryDb() {
+        return path.equalsIgnoreCase(MEMORY_DB_PATH);
+    }
+
+    private static String stripPathForLogs(String path) {
+        if (path.indexOf('@') == -1) {
+            return path;
+        }
+        return EMAIL_IN_DB_PATTERN.matcher(path).replaceAll("XX@YY");
+    }
+}
diff --git a/core/java/android/database/sqlite/SQLiteDebug.java b/core/java/android/database/sqlite/SQLiteDebug.java
index 029bb4a..204483d 100644
--- a/core/java/android/database/sqlite/SQLiteDebug.java
+++ b/core/java/android/database/sqlite/SQLiteDebug.java
@@ -29,6 +29,14 @@
  * {@hide}
  */
 public final class SQLiteDebug {
+    private static native void nativeGetPagerStats(PagerStats stats);
+
+    /**
+     * Controls the printing of informational SQL log messages.
+     */
+    public static final boolean DEBUG_SQL_LOG =
+            Log.isLoggable("SQLiteLog", Log.VERBOSE);
+
     /**
      * Controls the printing of SQL statements as they are executed.
      */
@@ -43,31 +51,6 @@
             Log.isLoggable("SQLiteTime", Log.VERBOSE);
 
     /**
-     * Controls the printing of compiled-sql-statement cache stats.
-     */
-    public static final boolean DEBUG_SQL_CACHE =
-            Log.isLoggable("SQLiteCompiledSql", Log.VERBOSE);
-
-    /**
-     * Controls the stack trace reporting of active cursors being
-     * finalized.
-     */
-    public static final boolean DEBUG_ACTIVE_CURSOR_FINALIZATION =
-            Log.isLoggable("SQLiteCursorClosing", Log.VERBOSE);
-
-    /**
-     * Controls the tracking of time spent holding the database lock.
-     */
-    public static final boolean DEBUG_LOCK_TIME_TRACKING =
-            Log.isLoggable("SQLiteLockTime", Log.VERBOSE);
-
-    /**
-     * Controls the printing of stack traces when tracking the time spent holding the database lock.
-     */
-    public static final boolean DEBUG_LOCK_TIME_TRACKING_STACK_TRACE =
-            Log.isLoggable("SQLiteLockStackTrace", Log.VERBOSE);
-
-    /**
      * True to enable database performance testing instrumentation.
      * @hide
      */
@@ -92,30 +75,9 @@
     /**
      * Contains statistics about the active pagers in the current process.
      *
-     * @see #getPagerStats(PagerStats)
+     * @see #nativeGetPagerStats(PagerStats)
      */
     public static class PagerStats {
-        /** The total number of bytes in all pagers in the current process
-         * @deprecated not used any longer
-         */
-        @Deprecated
-        public long totalBytes;
-        /** The number of bytes in referenced pages in all pagers in the current process
-         * @deprecated not used any longer
-         * */
-        @Deprecated
-        public long referencedBytes;
-        /** The number of bytes in all database files opened in the current process
-         * @deprecated not used any longer
-         */
-        @Deprecated
-        public long databaseBytes;
-        /** The number of pagers opened in the current process
-         * @deprecated not used any longer
-         */
-        @Deprecated
-        public int numPagers;
-
         /** the current amount of memory checked out by sqlite using sqlite3_malloc().
          * documented at http://www.sqlite.org/c3ref/c_status_malloc_size.html
          */
@@ -128,7 +90,7 @@
          * that overflowed because no space was left in the page cache.
          * documented at http://www.sqlite.org/c3ref/c_status_malloc_size.html
          */
-        public int pageCacheOverflo;
+        public int pageCacheOverflow;
 
         /** records the largest memory allocation request handed to sqlite3.
          * documented at http://www.sqlite.org/c3ref/c_status_malloc_size.html
@@ -176,7 +138,7 @@
      */
     public static PagerStats getDatabaseInfo() {
         PagerStats stats = new PagerStats();
-        getPagerStats(stats);
+        nativeGetPagerStats(stats);
         stats.dbStats = SQLiteDatabase.getDbStats();
         return stats;
     }
@@ -184,51 +146,16 @@
     /**
      * Dumps detailed information about all databases used by the process.
      * @param printer The printer for dumping database state.
+     * @param args Command-line arguments supplied to dumpsys dbinfo
      */
     public static void dump(Printer printer, String[] args) {
-    }
+        boolean verbose = false;
+        for (String arg : args) {
+            if (arg.equals("-v")) {
+                verbose = true;
+            }
+        }
 
-    /**
-     * Gathers statistics about all pagers in the current process.
-     */
-    public static native void getPagerStats(PagerStats stats);
-
-    /**
-     * Returns the size of the SQLite heap.
-     * @return The size of the SQLite heap in bytes.
-     */
-    public static native long getHeapSize();
-
-    /**
-     * Returns the amount of allocated memory in the SQLite heap.
-     * @return The allocated size in bytes.
-     */
-    public static native long getHeapAllocatedSize();
-
-    /**
-     * Returns the amount of free memory in the SQLite heap.
-     * @return The freed size in bytes.
-     */
-    public static native long getHeapFreeSize();
-
-    /**
-     * Determines the number of dirty belonging to the SQLite
-     * heap segments of this process.  pages[0] returns the number of
-     * shared pages, pages[1] returns the number of private pages
-     */
-    public static native void getHeapDirtyPages(int[] pages);
-
-    private static int sNumActiveCursorsFinalized = 0;
-
-    /**
-     * Returns the number of active cursors that have been finalized. This depends on the GC having
-     * run but is still useful for tests.
-     */
-    public static int getNumActiveCursorsFinalized() {
-        return sNumActiveCursorsFinalized;
-    }
-
-    static synchronized void notifyActiveCursorFinalized() {
-        sNumActiveCursorsFinalized++;
+        SQLiteDatabase.dumpAll(printer, verbose);
     }
 }
diff --git a/core/java/android/database/sqlite/SQLiteDirectCursorDriver.java b/core/java/android/database/sqlite/SQLiteDirectCursorDriver.java
index a5e762e..3375e74 100644
--- a/core/java/android/database/sqlite/SQLiteDirectCursorDriver.java
+++ b/core/java/android/database/sqlite/SQLiteDirectCursorDriver.java
@@ -16,6 +16,7 @@
 
 package android.database.sqlite;
 
+import android.content.CancellationSignal;
 import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase.CursorFactory;
 
@@ -25,46 +26,42 @@
  * @hide
  */
 public class SQLiteDirectCursorDriver implements SQLiteCursorDriver {
-    private String mEditTable; 
-    private SQLiteDatabase mDatabase;
-    private Cursor mCursor;
-    private String mSql;
+    private final SQLiteDatabase mDatabase;
+    private final String mEditTable; 
+    private final String mSql;
+    private final CancellationSignal mCancellationSignal;
     private SQLiteQuery mQuery;
 
-    public SQLiteDirectCursorDriver(SQLiteDatabase db, String sql, String editTable) {
+    public SQLiteDirectCursorDriver(SQLiteDatabase db, String sql, String editTable,
+            CancellationSignal cancellationSignal) {
         mDatabase = db;
         mEditTable = editTable;
         mSql = sql;
+        mCancellationSignal = cancellationSignal;
     }
 
     public Cursor query(CursorFactory factory, String[] selectionArgs) {
-        // Compile the query
-        SQLiteQuery query = null;
-
+        final SQLiteQuery query = new SQLiteQuery(mDatabase, mSql, mCancellationSignal);
+        final Cursor cursor;
         try {
-            mDatabase.lock(mSql);
-            mDatabase.closePendingStatements();
-            query = new SQLiteQuery(mDatabase, mSql, 0, selectionArgs);
+            query.bindAllArgsAsStrings(selectionArgs);
 
-            // Create the cursor
             if (factory == null) {
-                mCursor = new SQLiteCursor(this, mEditTable, query);
+                cursor = new SQLiteCursor(this, mEditTable, query);
             } else {
-                mCursor = factory.newCursor(mDatabase, this, mEditTable, query);
+                cursor = factory.newCursor(mDatabase, this, mEditTable, query);
             }
-
-            mQuery = query;
-            query = null;
-            return mCursor;
-        } finally {
-            // Make sure this object is cleaned up if something happens
-            if (query != null) query.close();
-            mDatabase.unlock();
+        } catch (RuntimeException ex) {
+            query.close();
+            throw ex;
         }
+
+        mQuery = query;
+        return cursor;
     }
 
     public void cursorClosed() {
-        mCursor = null;
+        // Do nothing
     }
 
     public void setBindArguments(String[] bindArgs) {
diff --git a/core/java/android/database/sqlite/SQLiteGlobal.java b/core/java/android/database/sqlite/SQLiteGlobal.java
new file mode 100644
index 0000000..dbefd63
--- /dev/null
+++ b/core/java/android/database/sqlite/SQLiteGlobal.java
@@ -0,0 +1,67 @@
+/*
+ * 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 android.database.sqlite;
+
+import android.os.StatFs;
+
+/**
+ * Provides access to SQLite functions that affect all database connection,
+ * such as memory management.
+ *
+ * The native code associated with SQLiteGlobal is also sets global configuration options
+ * using sqlite3_config() then calls sqlite3_initialize() to ensure that the SQLite
+ * library is properly initialized exactly once before any other framework or application
+ * code has a chance to run.
+ *
+ * Verbose SQLite logging is enabled if the "log.tag.SQLiteLog" property is set to "V".
+ * (per {@link SQLiteDebug#DEBUG_SQL_LOG}).
+ *
+ * @hide
+ */
+public final class SQLiteGlobal {
+    private static final String TAG = "SQLiteGlobal";
+
+    private static final Object sLock = new Object();
+    private static int sDefaultPageSize;
+
+    private static native int nativeReleaseMemory();
+
+    private SQLiteGlobal() {
+    }
+
+    /**
+     * Attempts to release memory by pruning the SQLite page cache and other
+     * internal data structures.
+     *
+     * @return The number of bytes that were freed.
+     */
+    public static int releaseMemory() {
+        return nativeReleaseMemory();
+    }
+
+    /**
+     * Gets the default page size to use when creating a database.
+     */
+    public static int getDefaultPageSize() {
+        synchronized (sLock) {
+            if (sDefaultPageSize == 0) {
+                sDefaultPageSize = new StatFs("/data").getBlockSize();
+            }
+            return sDefaultPageSize;
+        }
+    }
+}
diff --git a/core/java/android/database/sqlite/SQLiteOpenHelper.java b/core/java/android/database/sqlite/SQLiteOpenHelper.java
index 56cf948..46d9369 100644
--- a/core/java/android/database/sqlite/SQLiteOpenHelper.java
+++ b/core/java/android/database/sqlite/SQLiteOpenHelper.java
@@ -81,7 +81,8 @@
      * @param name of the database file, or null for an in-memory database
      * @param factory to use for creating cursor objects, or null for the default
      * @param version number of the database (starting at 1); if the database is older,
-     *     {@link #onUpgrade} will be used to upgrade the database
+     *     {@link #onUpgrade} will be used to upgrade the database; if the database is
+     *     newer, {@link #onDowngrade} will be used to downgrade the database
      * @param errorHandler the {@link DatabaseErrorHandler} to be used when sqlite reports database
      * corruption.
      */
@@ -100,7 +101,7 @@
     }
 
     /**
-     * Return the name of the SQLite database being opened, as given tp
+     * Return the name of the SQLite database being opened, as given to
      * the constructor.
      */
     public String getDatabaseName() {
@@ -143,12 +144,14 @@
         // If we have a read-only database open, someone could be using it
         // (though they shouldn't), which would cause a lock to be held on
         // the file, and our attempts to open the database read-write would
-        // fail waiting for the file lock.  To prevent that, we acquire the
-        // lock on the read-only database, which shuts out other users.
+        // fail waiting for the file lock.  To prevent that, we acquire a lock
+        // on the read-only database, which shuts out other users.
 
         boolean success = false;
         SQLiteDatabase db = null;
-        if (mDatabase != null) mDatabase.lock();
+        if (mDatabase != null) {
+            mDatabase.lockPrimaryConnection();
+        }
         try {
             mIsInitializing = true;
             if (mName == null) {
@@ -185,11 +188,13 @@
             if (success) {
                 if (mDatabase != null) {
                     try { mDatabase.close(); } catch (Exception e) { }
-                    mDatabase.unlock();
+                    mDatabase.unlockPrimaryConnection();
                 }
                 mDatabase = db;
             } else {
-                if (mDatabase != null) mDatabase.unlock();
+                if (mDatabase != null) {
+                    mDatabase.unlockPrimaryConnection();
+                }
                 if (db != null) db.close();
             }
         }
@@ -293,7 +298,7 @@
     public abstract void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion);
 
     /**
-     * Called when the database needs to be downgraded. This is stricly similar to
+     * Called when the database needs to be downgraded. This is strictly similar to
      * onUpgrade() method, but is called whenever current version is newer than requested one.
      * However, this method is not abstract, so it is not mandatory for a customer to
      * implement it. If not overridden, default implementation will reject downgrade and
diff --git a/core/java/android/database/sqlite/SQLiteProgram.java b/core/java/android/database/sqlite/SQLiteProgram.java
index 2bbc6d7..9f0edfb 100644
--- a/core/java/android/database/sqlite/SQLiteProgram.java
+++ b/core/java/android/database/sqlite/SQLiteProgram.java
@@ -16,226 +16,108 @@
 
 package android.database.sqlite;
 
+import android.content.CancellationSignal;
 import android.database.DatabaseUtils;
-import android.database.Cursor;
 
-import java.util.HashMap;
+import java.util.Arrays;
 
 /**
  * A base class for compiled SQLite programs.
- *<p>
- * SQLiteProgram is NOT internally synchronized so code using a SQLiteProgram from multiple
- * threads should perform its own synchronization when using the SQLiteProgram.
+ * <p>
+ * This class is not thread-safe.
+ * </p>
  */
 public abstract class SQLiteProgram extends SQLiteClosable {
+    private static final String[] EMPTY_STRING_ARRAY = new String[0];
 
-    private static final String TAG = "SQLiteProgram";
+    private final SQLiteDatabase mDatabase;
+    private final String mSql;
+    private final boolean mReadOnly;
+    private final String[] mColumnNames;
+    private final int mNumParameters;
+    private final Object[] mBindArgs;
 
-    /** The database this program is compiled against.
-     * @hide
-     */
-    protected SQLiteDatabase mDatabase;
-
-    /** The SQL used to create this query */
-    /* package */ final String mSql;
-
-    /**
-     * Native linkage, do not modify. This comes from the database and should not be modified
-     * in here or in the native code.
-     * @hide
-     */
-    protected int nHandle;
-
-    /**
-     * the SQLiteCompiledSql object for the given sql statement.
-     */
-    /* package */ SQLiteCompiledSql mCompiledSql;
-
-    /**
-     * SQLiteCompiledSql statement id is populated with the corresponding object from the above
-     * member. This member is used by the native_bind_* methods
-     * @hide
-     */
-    protected int nStatement;
-
-    /**
-     * In the case of {@link SQLiteStatement}, this member stores the bindargs passed
-     * to the following methods, instead of actually doing the binding.
-     * <ul>
-     *   <li>{@link #bindBlob(int, byte[])}</li>
-     *   <li>{@link #bindDouble(int, double)}</li>
-     *   <li>{@link #bindLong(int, long)}</li>
-     *   <li>{@link #bindNull(int)}</li>
-     *   <li>{@link #bindString(int, String)}</li>
-     * </ul>
-     * <p>
-     * Each entry in the array is a Pair of
-     * <ol>
-     *   <li>bind arg position number</li>
-     *   <li>the value to be bound to the bindarg</li>
-     * </ol>
-     * <p>
-     * It is lazily initialized in the above bind methods
-     * and it is cleared in {@link #clearBindings()} method.
-     * <p>
-     * It is protected (in multi-threaded environment) by {@link SQLiteProgram}.this
-     */
-    /* package */ HashMap<Integer, Object> mBindArgs = null;
-    /* package */ final int mStatementType;
-    /* package */ static final int STATEMENT_CACHEABLE = 16;
-    /* package */ static final int STATEMENT_DONT_PREPARE = 32;
-    /* package */ static final int STATEMENT_USE_POOLED_CONN = 64;
-    /* package */ static final int STATEMENT_TYPE_MASK = 0x0f;
-
-    /* package */ SQLiteProgram(SQLiteDatabase db, String sql) {
-        this(db, sql, null, true);
-    }
-
-    /* package */ SQLiteProgram(SQLiteDatabase db, String sql, Object[] bindArgs,
-            boolean compileFlag) {
+    SQLiteProgram(SQLiteDatabase db, String sql, Object[] bindArgs,
+            CancellationSignal cancellationSignalForPrepare) {
+        mDatabase = db;
         mSql = sql.trim();
+
         int n = DatabaseUtils.getSqlStatementType(mSql);
         switch (n) {
-            case DatabaseUtils.STATEMENT_UPDATE:
-                mStatementType = n | STATEMENT_CACHEABLE;
-                break;
-            case DatabaseUtils.STATEMENT_SELECT:
-                mStatementType = n | STATEMENT_CACHEABLE | STATEMENT_USE_POOLED_CONN;
-                break;
             case DatabaseUtils.STATEMENT_BEGIN:
             case DatabaseUtils.STATEMENT_COMMIT:
             case DatabaseUtils.STATEMENT_ABORT:
-                mStatementType = n | STATEMENT_DONT_PREPARE;
+                mReadOnly = false;
+                mColumnNames = EMPTY_STRING_ARRAY;
+                mNumParameters = 0;
                 break;
+
             default:
-                mStatementType = n;
-        }
-        db.acquireReference();
-        db.addSQLiteClosable(this);
-        mDatabase = db;
-        nHandle = db.mNativeHandle;
-        if (bindArgs != null) {
-            int size = bindArgs.length;
-            for (int i = 0; i < size; i++) {
-                this.addToBindArgs(i + 1, bindArgs[i]);
-            }
-        }
-        if (compileFlag) {
-            compileAndbindAllArgs();
-        }
-    }
-
-    private void compileSql() {
-        // only cache CRUD statements
-        if ((mStatementType & STATEMENT_CACHEABLE) == 0) {
-            mCompiledSql = new SQLiteCompiledSql(mDatabase, mSql);
-            nStatement = mCompiledSql.nStatement;
-            // since it is not in the cache, no need to acquire() it.
-            return;
+                boolean assumeReadOnly = (n == DatabaseUtils.STATEMENT_SELECT);
+                SQLiteStatementInfo info = new SQLiteStatementInfo();
+                db.getThreadSession().prepare(mSql,
+                        db.getThreadDefaultConnectionFlags(assumeReadOnly),
+                        cancellationSignalForPrepare, info);
+                mReadOnly = info.readOnly;
+                mColumnNames = info.columnNames;
+                mNumParameters = info.numParameters;
+                break;
         }
 
-        mCompiledSql = mDatabase.getCompiledStatementForSql(mSql);
-        if (mCompiledSql == null) {
-            // create a new compiled-sql obj
-            mCompiledSql = new SQLiteCompiledSql(mDatabase, mSql);
-
-            // add it to the cache of compiled-sqls
-            // but before adding it and thus making it available for anyone else to use it,
-            // make sure it is acquired by me.
-            mCompiledSql.acquire();
-            mDatabase.addToCompiledQueries(mSql, mCompiledSql);
+        if (mNumParameters != 0) {
+            mBindArgs = new Object[mNumParameters];
         } else {
-            // it is already in compiled-sql cache.
-            // try to acquire the object.
-            if (!mCompiledSql.acquire()) {
-                int last = mCompiledSql.nStatement;
-                // the SQLiteCompiledSql in cache is in use by some other SQLiteProgram object.
-                // we can't have two different SQLiteProgam objects can't share the same
-                // CompiledSql object. create a new one.
-                // finalize it when I am done with it in "this" object.
-                mCompiledSql = new SQLiteCompiledSql(mDatabase, mSql);
-                // since it is not in the cache, no need to acquire() it.
+            mBindArgs = null;
+        }
+
+        if (bindArgs != null) {
+            if (bindArgs.length > mNumParameters) {
+                throw new IllegalArgumentException("Too many bind arguments.  "
+                        + bindArgs.length + " arguments were provided but the statement needs "
+                        + mNumParameters + " arguments.");
             }
+            System.arraycopy(bindArgs, 0, mBindArgs, 0, bindArgs.length);
         }
-        nStatement = mCompiledSql.nStatement;
     }
 
-    @Override
-    protected void onAllReferencesReleased() {
-        release();
-        mDatabase.removeSQLiteClosable(this);
-        mDatabase.releaseReference();
+    final SQLiteDatabase getDatabase() {
+        return mDatabase;
     }
 
-    @Override
-    protected void onAllReferencesReleasedFromContainer() {
-        release();
-        mDatabase.releaseReference();
-    }
-
-    /* package */ void release() {
-        if (mCompiledSql == null) {
-            return;
-        }
-        mDatabase.releaseCompiledSqlObj(mSql, mCompiledSql);
-        mCompiledSql = null;
-        nStatement = 0;
-    }
-
-    /**
-     * Returns a unique identifier for this program.
-     *
-     * @return a unique identifier for this program
-     * @deprecated do not use this method. it is not guaranteed to be the same across executions of
-     * the SQL statement contained in this object.
-     */
-    @Deprecated
-    public final int getUniqueId() {
-      return -1;
-    }
-
-    /**
-     * used only for testing purposes
-     */
-    /* package */ int getSqlStatementId() {
-      synchronized(this) {
-        return (mCompiledSql == null) ? 0 : nStatement;
-      }
-    }
-
-    /* package */ String getSqlString() {
+    final String getSql() {
         return mSql;
     }
 
-    private void bind(int type, int index, Object value) {
-        mDatabase.verifyDbIsOpen();
-        addToBindArgs(index, (type == Cursor.FIELD_TYPE_NULL) ? null : value);
-        if (nStatement > 0) {
-            // bind only if the SQL statement is compiled
-            acquireReference();
-            try {
-                switch (type) {
-                    case Cursor.FIELD_TYPE_NULL:
-                        native_bind_null(index);
-                        break;
-                    case Cursor.FIELD_TYPE_BLOB:
-                        native_bind_blob(index, (byte[]) value);
-                        break;
-                    case Cursor.FIELD_TYPE_FLOAT:
-                        native_bind_double(index, (Double) value);
-                        break;
-                    case Cursor.FIELD_TYPE_INTEGER:
-                        native_bind_long(index, (Long) value);
-                        break;
-                    case Cursor.FIELD_TYPE_STRING:
-                    default:
-                        native_bind_string(index, (String) value);
-                        break;
-                }
-            } finally {
-                releaseReference();
-            }
-        }
+    final Object[] getBindArgs() {
+        return mBindArgs;
+    }
+
+    final String[] getColumnNames() {
+        return mColumnNames;
+    }
+
+    /** @hide */
+    protected final SQLiteSession getSession() {
+        return mDatabase.getThreadSession();
+    }
+
+    /** @hide */
+    protected final int getConnectionFlags() {
+        return mDatabase.getThreadDefaultConnectionFlags(mReadOnly);
+    }
+
+    /** @hide */
+    protected final void onCorruption() {
+        mDatabase.onCorruption();
+    }
+
+    /**
+     * Unimplemented.
+     * @deprecated This method is deprecated and must not be used.
+     */
+    @Deprecated
+    public final int getUniqueId() {
+        return -1;
     }
 
     /**
@@ -245,7 +127,7 @@
      * @param index The 1-based index to the parameter to bind null to
      */
     public void bindNull(int index) {
-        bind(Cursor.FIELD_TYPE_NULL, index, null);
+        bind(index, null);
     }
 
     /**
@@ -256,7 +138,7 @@
      * @param value The value to bind
      */
     public void bindLong(int index, long value) {
-        bind(Cursor.FIELD_TYPE_INTEGER, index, value);
+        bind(index, value);
     }
 
     /**
@@ -267,7 +149,7 @@
      * @param value The value to bind
      */
     public void bindDouble(int index, double value) {
-        bind(Cursor.FIELD_TYPE_FLOAT, index, value);
+        bind(index, value);
     }
 
     /**
@@ -275,13 +157,13 @@
      * {@link #clearBindings} is called.
      *
      * @param index The 1-based index to the parameter to bind
-     * @param value The value to bind
+     * @param value The value to bind, must not be null
      */
     public void bindString(int index, String value) {
         if (value == null) {
             throw new IllegalArgumentException("the bind value at index " + index + " is null");
         }
-        bind(Cursor.FIELD_TYPE_STRING, index, value);
+        bind(index, value);
     }
 
     /**
@@ -289,29 +171,21 @@
      * {@link #clearBindings} is called.
      *
      * @param index The 1-based index to the parameter to bind
-     * @param value The value to bind
+     * @param value The value to bind, must not be null
      */
     public void bindBlob(int index, byte[] value) {
         if (value == null) {
             throw new IllegalArgumentException("the bind value at index " + index + " is null");
         }
-        bind(Cursor.FIELD_TYPE_BLOB, index, value);
+        bind(index, value);
     }
 
     /**
      * Clears all existing bindings. Unset bindings are treated as NULL.
      */
     public void clearBindings() {
-        mBindArgs = null;
-        if (this.nStatement == 0) {
-            return;
-        }
-        mDatabase.verifyDbIsOpen();
-        acquireReference();
-        try {
-            native_clear_bindings();
-        } finally {
-            releaseReference();
+        if (mBindArgs != null) {
+            Arrays.fill(mBindArgs, null);
         }
     }
 
@@ -319,102 +193,33 @@
      * Release this program's resources, making it invalid.
      */
     public void close() {
-        mBindArgs = null;
-        if (nHandle == 0 || !mDatabase.isOpen()) {
-            return;
-        }
         releaseReference();
     }
 
-    private void addToBindArgs(int index, Object value) {
-        if (mBindArgs == null) {
-            mBindArgs = new HashMap<Integer, Object>();
-        }
-        mBindArgs.put(index, value);
-    }
-
-    /* package */ void compileAndbindAllArgs() {
-        if ((mStatementType & STATEMENT_DONT_PREPARE) > 0) {
-            if (mBindArgs != null) {
-                throw new IllegalArgumentException("Can't pass bindargs for this sql :" + mSql);
-            }
-            // no need to prepare this SQL statement
-            return;
-        }
-        if (nStatement == 0) {
-            // SQL statement is not compiled yet. compile it now.
-            compileSql();
-        }
-        if (mBindArgs == null) {
-            return;
-        }
-        for (int index : mBindArgs.keySet()) {
-            Object value = mBindArgs.get(index);
-            if (value == null) {
-                native_bind_null(index);
-            } else if (value instanceof Double || value instanceof Float) {
-                native_bind_double(index, ((Number) value).doubleValue());
-            } else if (value instanceof Number) {
-                native_bind_long(index, ((Number) value).longValue());
-            } else if (value instanceof Boolean) {
-                Boolean bool = (Boolean)value;
-                native_bind_long(index, (bool) ? 1 : 0);
-                if (bool) {
-                    native_bind_long(index, 1);
-                } else {
-                    native_bind_long(index, 0);
-                }
-            } else if (value instanceof byte[]){
-                native_bind_blob(index, (byte[]) value);
-            } else {
-                native_bind_string(index, value.toString());
-            }
-        }
-    }
-
     /**
      * Given an array of String bindArgs, this method binds all of them in one single call.
      *
-     * @param bindArgs the String array of bind args.
+     * @param bindArgs the String array of bind args, none of which must be null.
      */
     public void bindAllArgsAsStrings(String[] bindArgs) {
-        if (bindArgs == null) {
-            return;
-        }
-        int size = bindArgs.length;
-        for (int i = 0; i < size; i++) {
-            bindString(i + 1, bindArgs[i]);
+        if (bindArgs != null) {
+            for (int i = bindArgs.length; i != 0; i--) {
+                bindString(i, bindArgs[i - 1]);
+            }
         }
     }
 
-    /* package */ synchronized final void setNativeHandle(int nHandle) {
-        this.nHandle = nHandle;
+    @Override
+    protected void onAllReferencesReleased() {
+        clearBindings();
     }
 
-    /**
-     * @hide
-     * Compiles SQL into a SQLite program.
-     *
-     * <P>The database lock must be held when calling this method.
-     * @param sql The SQL to compile.
-     */
-    protected final native void native_compile(String sql);
-
-    /**
-     * @hide
-     */
-    protected final native void native_finalize();
-
-    /** @hide */
-    protected final native void native_bind_null(int index);
-    /** @hide */
-    protected final native void native_bind_long(int index, long value);
-    /** @hide */
-    protected final native void native_bind_double(int index, double value);
-    /** @hide */
-    protected final native void native_bind_string(int index, String value);
-    /** @hide */
-    protected final native void native_bind_blob(int index, byte[] value);
-    private final native void native_clear_bindings();
+    private void bind(int index, Object value) {
+        if (index < 1 || index > mNumParameters) {
+            throw new IllegalArgumentException("Cannot bind argument at index "
+                    + index + " because the index is out of range.  "
+                    + "The statement has " + mNumParameters + " parameters.");
+        }
+        mBindArgs[index - 1] = value;
+    }
 }
-
diff --git a/core/java/android/database/sqlite/SQLiteQuery.java b/core/java/android/database/sqlite/SQLiteQuery.java
index 6dd2539..30e77b5 100644
--- a/core/java/android/database/sqlite/SQLiteQuery.java
+++ b/core/java/android/database/sqlite/SQLiteQuery.java
@@ -16,61 +16,31 @@
 
 package android.database.sqlite;
 
+import android.content.CancellationSignal;
+import android.content.OperationCanceledException;
 import android.database.CursorWindow;
-import android.os.SystemClock;
-import android.text.TextUtils;
 import android.util.Log;
 
 /**
- * A SQLite program that represents a query that reads the resulting rows into a CursorWindow.
- * This class is used by SQLiteCursor and isn't useful itself.
- *
- * SQLiteQuery is not internally synchronized so code using a SQLiteQuery from multiple
- * threads should perform its own synchronization when using the SQLiteQuery.
+ * Represents a query that reads the resulting rows into a {@link SQLiteQuery}.
+ * This class is used by {@link SQLiteCursor} and isn't useful itself.
+ * <p>
+ * This class is not thread-safe.
+ * </p>
  */
 public final class SQLiteQuery extends SQLiteProgram {
     private static final String TAG = "SQLiteQuery";
 
-    private static native long nativeFillWindow(int databasePtr, int statementPtr, int windowPtr,
-            int offsetParam, int startPos, int requiredPos, boolean countAllRows);
+    private final CancellationSignal mCancellationSignal;
 
-    private static native int nativeColumnCount(int statementPtr);
-    private static native String nativeColumnName(int statementPtr, int columnIndex);
+    SQLiteQuery(SQLiteDatabase db, String query, CancellationSignal cancellationSignal) {
+        super(db, query, null, cancellationSignal);
 
-    /** The index of the unbound OFFSET parameter */
-    private int mOffsetIndex = 0;
-
-    private boolean mClosed = false;
-
-    /**
-     * Create a persistent query object.
-     *
-     * @param db The database that this query object is associated with
-     * @param query The SQL string for this query. 
-     * @param offsetIndex The 1-based index to the OFFSET parameter, 
-     */
-    /* package */ SQLiteQuery(SQLiteDatabase db, String query, int offsetIndex, String[] bindArgs) {
-        super(db, query);
-        mOffsetIndex = offsetIndex;
-        bindAllArgsAsStrings(bindArgs);
+        mCancellationSignal = cancellationSignal;
     }
 
     /**
-     * Constructor used to create new instance to replace a given instance of this class.
-     * This constructor is used when the current Query object is now associated with a different
-     * {@link SQLiteDatabase} object.
-     *
-     * @param db The database that this query object is associated with
-     * @param query the instance of {@link SQLiteQuery} to be replaced
-     */
-    /* package */ SQLiteQuery(SQLiteDatabase db, SQLiteQuery query) {
-        super(db, query.mSql);
-        this.mBindArgs = query.mBindArgs;
-        this.mOffsetIndex = query.mOffsetIndex;
-    }
-
-    /**
-     * Reads rows into a buffer. This method acquires the database lock.
+     * Reads rows into a buffer.
      *
      * @param window The window to fill into
      * @param startPos The start position for filling the window.
@@ -80,107 +50,35 @@
      * return regardless of whether they fit in the window.
      * @return Number of rows that were enumerated.  Might not be all rows
      * unless countAllRows is true.
+     *
+     * @throws SQLiteException if an error occurs.
+     * @throws OperationCanceledException if the operation was canceled.
      */
-    /* package */ int fillWindow(CursorWindow window,
-            int startPos, int requiredPos, boolean countAllRows) {
-        mDatabase.lock(mSql);
-        long timeStart = SystemClock.uptimeMillis();
+    int fillWindow(CursorWindow window, int startPos, int requiredPos, boolean countAllRows) {
+        acquireReference();
         try {
-            acquireReference();
+            window.acquireReference();
             try {
-                window.acquireReference();
-                long result = nativeFillWindow(nHandle, nStatement, window.mWindowPtr,
-                        mOffsetIndex, startPos, requiredPos, countAllRows);
-                int actualPos = (int)(result >> 32);
-                int countedRows = (int)result;
-                window.setStartPosition(actualPos);
-                if (SQLiteDebug.DEBUG_LOG_SLOW_QUERIES) {
-                    long elapsed = SystemClock.uptimeMillis() - timeStart;
-                    if (SQLiteDebug.shouldLogSlowQuery(elapsed)) {
-                        Log.d(TAG, "fillWindow took " + elapsed
-                                + " ms: window=\"" + window
-                                + "\", startPos=" + startPos
-                                + ", requiredPos=" + requiredPos
-                                + ", offset=" + mOffsetIndex
-                                + ", actualPos=" + actualPos
-                                + ", filledRows=" + window.getNumRows()
-                                + ", countedRows=" + countedRows
-                                + ", query=\"" + mSql + "\""
-                                + ", args=[" + (mBindArgs != null ?
-                                        TextUtils.join(", ", mBindArgs.values()) : "")
-                                + "]");
-                    }
-                }
-                mDatabase.logTimeStat(mSql, timeStart);
-                return countedRows;
-            } catch (IllegalStateException e){
-                // simply ignore it
-                return 0;
-            } catch (SQLiteDatabaseCorruptException e) {
-                mDatabase.onCorruption();
-                throw e;
-            } catch (SQLiteException e) {
-                Log.e(TAG, "exception: " + e.getMessage() + "; query: " + mSql);
-                throw e;
+                int numRows = getSession().executeForCursorWindow(getSql(), getBindArgs(),
+                        window, startPos, requiredPos, countAllRows, getConnectionFlags(),
+                        mCancellationSignal);
+                return numRows;
+            } catch (SQLiteDatabaseCorruptException ex) {
+                onCorruption();
+                throw ex;
+            } catch (SQLiteException ex) {
+                Log.e(TAG, "exception: " + ex.getMessage() + "; query: " + getSql());
+                throw ex;
             } finally {
                 window.releaseReference();
             }
         } finally {
             releaseReference();
-            mDatabase.unlock();
-        }
-    }
-
-    /**
-     * Get the column count for the statement. Only valid on query based
-     * statements. The database must be locked
-     * when calling this method.
-     * 
-     * @return The number of column in the statement's result set.
-     */
-    /* package */ int columnCountLocked() {
-        acquireReference();
-        try {
-            return nativeColumnCount(nStatement);
-        } finally {
-            releaseReference();
-        }
-    }
-
-    /**
-     * Retrieves the column name for the given column index. The database must be locked
-     * when calling this method.
-     * 
-     * @param columnIndex the index of the column to get the name for
-     * @return The requested column's name
-     */
-    /* package */ String columnNameLocked(int columnIndex) {
-        acquireReference();
-        try {
-            return nativeColumnName(nStatement, columnIndex);
-        } finally {
-            releaseReference();
         }
     }
 
     @Override
     public String toString() {
-        return "SQLiteQuery: " + mSql;
-    }
-
-    @Override
-    public void close() {
-        super.close();
-        mClosed = true;
-    }
-
-    /**
-     * Called by SQLiteCursor when it is requeried.
-     */
-    /* package */ void requery() {
-        if (mClosed) {
-            throw new IllegalStateException("requerying a closed cursor");
-        }
-        compileAndbindAllArgs();
+        return "SQLiteQuery: " + getSql();
     }
 }
diff --git a/core/java/android/database/sqlite/SQLiteQueryBuilder.java b/core/java/android/database/sqlite/SQLiteQueryBuilder.java
index 8f8eb6e..6f84b5e 100644
--- a/core/java/android/database/sqlite/SQLiteQueryBuilder.java
+++ b/core/java/android/database/sqlite/SQLiteQueryBuilder.java
@@ -16,6 +16,8 @@
 
 package android.database.sqlite;
 
+import android.content.CancellationSignal;
+import android.content.OperationCanceledException;
 import android.database.Cursor;
 import android.database.DatabaseUtils;
 import android.provider.BaseColumns;
@@ -137,8 +139,9 @@
     /**
      * Sets the cursor factory to be used for the query.  You can use
      * one factory for all queries on a database but it is normally
-     * easier to specify the factory when doing this query.  @param
-     * factory the factor to use
+     * easier to specify the factory when doing this query.
+     *
+     * @param factory the factory to use.
      */
     public void setCursorFactory(SQLiteDatabase.CursorFactory factory) {
         mFactory = factory;
@@ -289,7 +292,7 @@
             String selection, String[] selectionArgs, String groupBy,
             String having, String sortOrder) {
         return query(db, projectionIn, selection, selectionArgs, groupBy, having, sortOrder,
-                null /* limit */);
+                null /* limit */, null /* cancellationSignal */);
     }
 
     /**
@@ -327,6 +330,48 @@
     public Cursor query(SQLiteDatabase db, String[] projectionIn,
             String selection, String[] selectionArgs, String groupBy,
             String having, String sortOrder, String limit) {
+        return query(db, projectionIn, selection, selectionArgs,
+                groupBy, having, sortOrder, limit, null);
+    }
+
+    /**
+     * Perform a query by combining all current settings and the
+     * information passed into this method.
+     *
+     * @param db the database to query on
+     * @param projectionIn A list of which columns to return. Passing
+     *   null will return all columns, which is discouraged to prevent
+     *   reading data from storage that isn't going to be used.
+     * @param selection A filter declaring which rows to return,
+     *   formatted as an SQL WHERE clause (excluding the WHERE
+     *   itself). Passing null will return all rows for the given URL.
+     * @param selectionArgs You may include ?s in selection, which
+     *   will be replaced by the values from selectionArgs, in order
+     *   that they appear in the selection. The values will be bound
+     *   as Strings.
+     * @param groupBy A filter declaring how to group rows, formatted
+     *   as an SQL GROUP BY clause (excluding the GROUP BY
+     *   itself). Passing null will cause the rows to not be grouped.
+     * @param having A filter declare which row groups to include in
+     *   the cursor, if row grouping is being used, formatted as an
+     *   SQL HAVING clause (excluding the HAVING itself).  Passing
+     *   null will cause all row groups to be included, and is
+     *   required when row grouping is not being used.
+     * @param sortOrder How to order the rows, formatted as an SQL
+     *   ORDER BY clause (excluding the ORDER BY itself). Passing null
+     *   will use the default sort order, which may be unordered.
+     * @param limit Limits the number of rows returned by the query,
+     *   formatted as LIMIT clause. Passing null denotes no LIMIT clause.
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     * If the operation is canceled, then {@link OperationCanceledException} will be thrown
+     * when the query is executed.
+     * @return a cursor over the result set
+     * @see android.content.ContentResolver#query(android.net.Uri, String[],
+     *      String, String[], String)
+     */
+    public Cursor query(SQLiteDatabase db, String[] projectionIn,
+            String selection, String[] selectionArgs, String groupBy,
+            String having, String sortOrder, String limit, CancellationSignal cancellationSignal) {
         if (mTables == null) {
             return null;
         }
@@ -341,7 +386,8 @@
             // in both the wrapped and original forms.
             String sqlForValidation = buildQuery(projectionIn, "(" + selection + ")", groupBy,
                     having, sortOrder, limit);
-            validateSql(db, sqlForValidation); // will throw if query is invalid
+            validateQuerySql(db, sqlForValidation,
+                    cancellationSignal); // will throw if query is invalid
         }
 
         String sql = buildQuery(
@@ -353,20 +399,18 @@
         }
         return db.rawQueryWithFactory(
                 mFactory, sql, selectionArgs,
-                SQLiteDatabase.findEditTable(mTables)); // will throw if query is invalid
+                SQLiteDatabase.findEditTable(mTables),
+                cancellationSignal); // will throw if query is invalid
     }
 
     /**
-     * Verifies that a SQL statement is valid by compiling it.
+     * Verifies that a SQL SELECT statement is valid by compiling it.
      * If the SQL statement is not valid, this method will throw a {@link SQLiteException}.
      */
-    private void validateSql(SQLiteDatabase db, String sql) {
-        db.lock(sql);
-        try {
-            new SQLiteCompiledSql(db, sql).releaseSqlStatement();
-        } finally {
-            db.unlock();
-        }
+    private void validateQuerySql(SQLiteDatabase db, String sql,
+            CancellationSignal cancellationSignal) {
+        db.getThreadSession().prepare(sql,
+                db.getThreadDefaultConnectionFlags(true /*readOnly*/), cancellationSignal, null);
     }
 
     /**
diff --git a/core/java/android/database/sqlite/SQLiteSession.java b/core/java/android/database/sqlite/SQLiteSession.java
new file mode 100644
index 0000000..43efb03
--- /dev/null
+++ b/core/java/android/database/sqlite/SQLiteSession.java
@@ -0,0 +1,963 @@
+/*
+ * 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 android.database.sqlite;
+
+import android.content.CancellationSignal;
+import android.content.OperationCanceledException;
+import android.database.CursorWindow;
+import android.database.DatabaseUtils;
+import android.os.ParcelFileDescriptor;
+
+/**
+ * Provides a single client the ability to use a database.
+ *
+ * <h2>About database sessions</h2>
+ * <p>
+ * Database access is always performed using a session.  The session
+ * manages the lifecycle of transactions and database connections.
+ * </p><p>
+ * Sessions can be used to perform both read-only and read-write operations.
+ * There is some advantage to knowing when a session is being used for
+ * read-only purposes because the connection pool can optimize the use
+ * of the available connections to permit multiple read-only operations
+ * to execute in parallel whereas read-write operations may need to be serialized.
+ * </p><p>
+ * When <em>Write Ahead Logging (WAL)</em> is enabled, the database can
+ * execute simultaneous read-only and read-write transactions, provided that
+ * at most one read-write transaction is performed at a time.  When WAL is not
+ * enabled, read-only transactions can execute in parallel but read-write
+ * transactions are mutually exclusive.
+ * </p>
+ *
+ * <h2>Ownership and concurrency guarantees</h2>
+ * <p>
+ * Session objects are not thread-safe.  In fact, session objects are thread-bound.
+ * The {@link SQLiteDatabase} uses a thread-local variable to associate a session
+ * with each thread for the use of that thread alone.  Consequently, each thread
+ * has its own session object and therefore its own transaction state independent
+ * of other threads.
+ * </p><p>
+ * A thread has at most one session per database.  This constraint ensures that
+ * a thread can never use more than one database connection at a time for a
+ * given database.  As the number of available database connections is limited,
+ * if a single thread tried to acquire multiple connections for the same database
+ * at the same time, it might deadlock.  Therefore we allow there to be only
+ * one session (so, at most one connection) per thread per database.
+ * </p>
+ *
+ * <h2>Transactions</h2>
+ * <p>
+ * There are two kinds of transaction: implicit transactions and explicit
+ * transactions.
+ * </p><p>
+ * An implicit transaction is created whenever a database operation is requested
+ * and there is no explicit transaction currently in progress.  An implicit transaction
+ * only lasts for the duration of the database operation in question and then it
+ * is ended.  If the database operation was successful, then its changes are committed.
+ * </p><p>
+ * An explicit transaction is started by calling {@link #beginTransaction} and
+ * specifying the desired transaction mode.  Once an explicit transaction has begun,
+ * all subsequent database operations will be performed as part of that transaction.
+ * To end an explicit transaction, first call {@link #setTransactionSuccessful} if the
+ * transaction was successful, then call {@link #end}.  If the transaction was
+ * marked successful, its changes will be committed, otherwise they will be rolled back.
+ * </p><p>
+ * Explicit transactions can also be nested.  A nested explicit transaction is
+ * started with {@link #beginTransaction}, marked successful with
+ * {@link #setTransactionSuccessful}and ended with {@link #endTransaction}.
+ * If any nested transaction is not marked successful, then the entire transaction
+ * including all of its nested transactions will be rolled back
+ * when the outermost transaction is ended.
+ * </p><p>
+ * To improve concurrency, an explicit transaction can be yielded by calling
+ * {@link #yieldTransaction}.  If there is contention for use of the database,
+ * then yielding ends the current transaction, commits its changes, releases the
+ * database connection for use by another session for a little while, and starts a
+ * new transaction with the same properties as the original one.
+ * Changes committed by {@link #yieldTransaction} cannot be rolled back.
+ * </p><p>
+ * When a transaction is started, the client can provide a {@link SQLiteTransactionListener}
+ * to listen for notifications of transaction-related events.
+ * </p><p>
+ * Recommended usage:
+ * <code><pre>
+ * // First, begin the transaction.
+ * session.beginTransaction(SQLiteSession.TRANSACTION_MODE_DEFERRED, 0);
+ * try {
+ *     // Then do stuff...
+ *     session.execute("INSERT INTO ...", null, 0);
+ *
+ *     // As the very last step before ending the transaction, mark it successful.
+ *     session.setTransactionSuccessful();
+ * } finally {
+ *     // Finally, end the transaction.
+ *     // This statement will commit the transaction if it was marked successful or
+ *     // roll it back otherwise.
+ *     session.endTransaction();
+ * }
+ * </pre></code>
+ * </p>
+ *
+ * <h2>Database connections</h2>
+ * <p>
+ * A {@link SQLiteDatabase} can have multiple active sessions at the same
+ * time.  Each session acquires and releases connections to the database
+ * as needed to perform each requested database transaction.  If all connections
+ * are in use, then database transactions on some sessions will block until a
+ * connection becomes available.
+ * </p><p>
+ * The session acquires a single database connection only for the duration
+ * of a single (implicit or explicit) database transaction, then releases it.
+ * This characteristic allows a small pool of database connections to be shared
+ * efficiently by multiple sessions as long as they are not all trying to perform
+ * database transactions at the same time.
+ * </p>
+ *
+ * <h2>Responsiveness</h2>
+ * <p>
+ * Because there are a limited number of database connections and the session holds
+ * a database connection for the entire duration of a database transaction,
+ * it is important to keep transactions short.  This is especially important
+ * for read-write transactions since they may block other transactions
+ * from executing.  Consider calling {@link #yieldTransaction} periodically
+ * during long-running transactions.
+ * </p><p>
+ * Another important consideration is that transactions that take too long to
+ * run may cause the application UI to become unresponsive.  Even if the transaction
+ * is executed in a background thread, the user will get bored and
+ * frustrated if the application shows no data for several seconds while
+ * a transaction runs.
+ * </p><p>
+ * Guidelines:
+ * <ul>
+ * <li>Do not perform database transactions on the UI thread.</li>
+ * <li>Keep database transactions as short as possible.</li>
+ * <li>Simple queries often run faster than complex queries.</li>
+ * <li>Measure the performance of your database transactions.</li>
+ * <li>Consider what will happen when the size of the data set grows.
+ * A query that works well on 100 rows may struggle with 10,000.</li>
+ * </ul>
+ *
+ * <h2>Reentrance</h2>
+ * <p>
+ * This class must tolerate reentrant execution of SQLite operations because
+ * triggers may call custom SQLite functions that perform additional queries.
+ * </p>
+ *
+ * @hide
+ */
+public final class SQLiteSession {
+    private final SQLiteConnectionPool mConnectionPool;
+
+    private SQLiteConnection mConnection;
+    private int mConnectionFlags;
+    private int mConnectionUseCount;
+    private Transaction mTransactionPool;
+    private Transaction mTransactionStack;
+
+    /**
+     * Transaction mode: Deferred.
+     * <p>
+     * In a deferred transaction, no locks are acquired on the database
+     * until the first operation is performed.  If the first operation is
+     * read-only, then a <code>SHARED</code> lock is acquired, otherwise
+     * a <code>RESERVED</code> lock is acquired.
+     * </p><p>
+     * While holding a <code>SHARED</code> lock, this session is only allowed to
+     * read but other sessions are allowed to read or write.
+     * While holding a <code>RESERVED</code> lock, this session is allowed to read
+     * or write but other sessions are only allowed to read.
+     * </p><p>
+     * Because the lock is only acquired when needed in a deferred transaction,
+     * it is possible for another session to write to the database first before
+     * this session has a chance to do anything.
+     * </p><p>
+     * Corresponds to the SQLite <code>BEGIN DEFERRED</code> transaction mode.
+     * </p>
+     */
+    public static final int TRANSACTION_MODE_DEFERRED = 0;
+
+    /**
+     * Transaction mode: Immediate.
+     * <p>
+     * When an immediate transaction begins, the session acquires a
+     * <code>RESERVED</code> lock.
+     * </p><p>
+     * While holding a <code>RESERVED</code> lock, this session is allowed to read
+     * or write but other sessions are only allowed to read.
+     * </p><p>
+     * Corresponds to the SQLite <code>BEGIN IMMEDIATE</code> transaction mode.
+     * </p>
+     */
+    public static final int TRANSACTION_MODE_IMMEDIATE = 1;
+
+    /**
+     * Transaction mode: Exclusive.
+     * <p>
+     * When an exclusive transaction begins, the session acquires an
+     * <code>EXCLUSIVE</code> lock.
+     * </p><p>
+     * While holding an <code>EXCLUSIVE</code> lock, this session is allowed to read
+     * or write but no other sessions are allowed to access the database.
+     * </p><p>
+     * Corresponds to the SQLite <code>BEGIN EXCLUSIVE</code> transaction mode.
+     * </p>
+     */
+    public static final int TRANSACTION_MODE_EXCLUSIVE = 2;
+
+    /**
+     * Creates a session bound to the specified connection pool.
+     *
+     * @param connectionPool The connection pool.
+     */
+    public SQLiteSession(SQLiteConnectionPool connectionPool) {
+        if (connectionPool == null) {
+            throw new IllegalArgumentException("connectionPool must not be null");
+        }
+
+        mConnectionPool = connectionPool;
+    }
+
+    /**
+     * Returns true if the session has a transaction in progress.
+     *
+     * @return True if the session has a transaction in progress.
+     */
+    public boolean hasTransaction() {
+        return mTransactionStack != null;
+    }
+
+    /**
+     * Returns true if the session has a nested transaction in progress.
+     *
+     * @return True if the session has a nested transaction in progress.
+     */
+    public boolean hasNestedTransaction() {
+        return mTransactionStack != null && mTransactionStack.mParent != null;
+    }
+
+    /**
+     * Returns true if the session has an active database connection.
+     *
+     * @return True if the session has an active database connection.
+     */
+    public boolean hasConnection() {
+        return mConnection != null;
+    }
+
+    /**
+     * Begins a transaction.
+     * <p>
+     * Transactions may nest.  If the transaction is not in progress,
+     * then a database connection is obtained and a new transaction is started.
+     * Otherwise, a nested transaction is started.
+     * </p><p>
+     * Each call to {@link #beginTransaction} must be matched exactly by a call
+     * to {@link #endTransaction}.  To mark a transaction as successful,
+     * call {@link #setTransactionSuccessful} before calling {@link #endTransaction}.
+     * If the transaction is not successful, or if any of its nested
+     * transactions were not successful, then the entire transaction will
+     * be rolled back when the outermost transaction is ended.
+     * </p>
+     *
+     * @param transactionMode The transaction mode.  One of: {@link #TRANSACTION_MODE_DEFERRED},
+     * {@link #TRANSACTION_MODE_IMMEDIATE}, or {@link #TRANSACTION_MODE_EXCLUSIVE}.
+     * Ignored when creating a nested transaction.
+     * @param transactionListener The transaction listener, or null if none.
+     * @param connectionFlags The connection flags to use if a connection must be
+     * acquired by this operation.  Refer to {@link SQLiteConnectionPool}.
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     *
+     * @throws IllegalStateException if {@link #setTransactionSuccessful} has already been
+     * called for the current transaction.
+     * @throws SQLiteException if an error occurs.
+     * @throws OperationCanceledException if the operation was canceled.
+     *
+     * @see #setTransactionSuccessful
+     * @see #yieldTransaction
+     * @see #endTransaction
+     */
+    public void beginTransaction(int transactionMode,
+            SQLiteTransactionListener transactionListener, int connectionFlags,
+            CancellationSignal cancellationSignal) {
+        throwIfTransactionMarkedSuccessful();
+        beginTransactionUnchecked(transactionMode, transactionListener, connectionFlags,
+                cancellationSignal);
+    }
+
+    private void beginTransactionUnchecked(int transactionMode,
+            SQLiteTransactionListener transactionListener, int connectionFlags,
+            CancellationSignal cancellationSignal) {
+        if (cancellationSignal != null) {
+            cancellationSignal.throwIfCanceled();
+        }
+
+        if (mTransactionStack == null) {
+            acquireConnection(null, connectionFlags, cancellationSignal); // might throw
+        }
+        try {
+            // Set up the transaction such that we can back out safely
+            // in case we fail part way.
+            if (mTransactionStack == null) {
+                // Execute SQL might throw a runtime exception.
+                switch (transactionMode) {
+                    case TRANSACTION_MODE_IMMEDIATE:
+                        mConnection.execute("BEGIN IMMEDIATE;", null,
+                                cancellationSignal); // might throw
+                        break;
+                    case TRANSACTION_MODE_EXCLUSIVE:
+                        mConnection.execute("BEGIN EXCLUSIVE;", null,
+                                cancellationSignal); // might throw
+                        break;
+                    default:
+                        mConnection.execute("BEGIN;", null, cancellationSignal); // might throw
+                        break;
+                }
+            }
+
+            // Listener might throw a runtime exception.
+            if (transactionListener != null) {
+                try {
+                    transactionListener.onBegin(); // might throw
+                } catch (RuntimeException ex) {
+                    if (mTransactionStack == null) {
+                        mConnection.execute("ROLLBACK;", null, cancellationSignal); // might throw
+                    }
+                    throw ex;
+                }
+            }
+
+            // Bookkeeping can't throw, except an OOM, which is just too bad...
+            Transaction transaction = obtainTransaction(transactionMode, transactionListener);
+            transaction.mParent = mTransactionStack;
+            mTransactionStack = transaction;
+        } finally {
+            if (mTransactionStack == null) {
+                releaseConnection(); // might throw
+            }
+        }
+    }
+
+    /**
+     * Marks the current transaction as having completed successfully.
+     * <p>
+     * This method can be called at most once between {@link #beginTransaction} and
+     * {@link #endTransaction} to indicate that the changes made by the transaction should be
+     * committed.  If this method is not called, the changes will be rolled back
+     * when the transaction is ended.
+     * </p>
+     *
+     * @throws IllegalStateException if there is no current transaction, or if
+     * {@link #setTransactionSuccessful} has already been called for the current transaction.
+     *
+     * @see #beginTransaction
+     * @see #endTransaction
+     */
+    public void setTransactionSuccessful() {
+        throwIfNoTransaction();
+        throwIfTransactionMarkedSuccessful();
+
+        mTransactionStack.mMarkedSuccessful = true;
+    }
+
+    /**
+     * Ends the current transaction and commits or rolls back changes.
+     * <p>
+     * If this is the outermost transaction (not nested within any other
+     * transaction), then the changes are committed if {@link #setTransactionSuccessful}
+     * was called or rolled back otherwise.
+     * </p><p>
+     * This method must be called exactly once for each call to {@link #beginTransaction}.
+     * </p>
+     *
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     *
+     * @throws IllegalStateException if there is no current transaction.
+     * @throws SQLiteException if an error occurs.
+     * @throws OperationCanceledException if the operation was canceled.
+     *
+     * @see #beginTransaction
+     * @see #setTransactionSuccessful
+     * @see #yieldTransaction
+     */
+    public void endTransaction(CancellationSignal cancellationSignal) {
+        throwIfNoTransaction();
+        assert mConnection != null;
+
+        endTransactionUnchecked(cancellationSignal);
+    }
+
+    private void endTransactionUnchecked(CancellationSignal cancellationSignal) {
+        if (cancellationSignal != null) {
+            cancellationSignal.throwIfCanceled();
+        }
+
+        final Transaction top = mTransactionStack;
+        boolean successful = top.mMarkedSuccessful && !top.mChildFailed;
+
+        RuntimeException listenerException = null;
+        final SQLiteTransactionListener listener = top.mListener;
+        if (listener != null) {
+            try {
+                if (successful) {
+                    listener.onCommit(); // might throw
+                } else {
+                    listener.onRollback(); // might throw
+                }
+            } catch (RuntimeException ex) {
+                listenerException = ex;
+                successful = false;
+            }
+        }
+
+        mTransactionStack = top.mParent;
+        recycleTransaction(top);
+
+        if (mTransactionStack != null) {
+            if (!successful) {
+                mTransactionStack.mChildFailed = true;
+            }
+        } else {
+            try {
+                if (successful) {
+                    mConnection.execute("COMMIT;", null, cancellationSignal); // might throw
+                } else {
+                    mConnection.execute("ROLLBACK;", null, cancellationSignal); // might throw
+                }
+            } finally {
+                releaseConnection(); // might throw
+            }
+        }
+
+        if (listenerException != null) {
+            throw listenerException;
+        }
+    }
+
+    /**
+     * Temporarily ends a transaction to let other threads have use of
+     * the database.  Begins a new transaction after a specified delay.
+     * <p>
+     * If there are other threads waiting to acquire connections,
+     * then the current transaction is committed and the database
+     * connection is released.  After a short delay, a new transaction
+     * is started.
+     * </p><p>
+     * The transaction is assumed to be successful so far.  Do not call
+     * {@link #setTransactionSuccessful()} before calling this method.
+     * This method will fail if the transaction has already been marked
+     * successful.
+     * </p><p>
+     * The changes that were committed by a yield cannot be rolled back later.
+     * </p><p>
+     * Before this method was called, there must already have been
+     * a transaction in progress.  When this method returns, there will
+     * still be a transaction in progress, either the same one as before
+     * or a new one if the transaction was actually yielded.
+     * </p><p>
+     * This method should not be called when there is a nested transaction
+     * in progress because it is not possible to yield a nested transaction.
+     * If <code>throwIfNested</code> is true, then attempting to yield
+     * a nested transaction will throw {@link IllegalStateException}, otherwise
+     * the method will return <code>false</code> in that case.
+     * </p><p>
+     * If there is no nested transaction in progress but a previous nested
+     * transaction failed, then the transaction is not yielded (because it
+     * must be rolled back) and this method returns <code>false</code>.
+     * </p>
+     *
+     * @param sleepAfterYieldDelayMillis A delay time to wait after yielding
+     * the database connection to allow other threads some time to run.
+     * If the value is less than or equal to zero, there will be no additional
+     * delay beyond the time it will take to begin a new transaction.
+     * @param throwIfUnsafe If true, then instead of returning false when no
+     * transaction is in progress, a nested transaction is in progress, or when
+     * the transaction has already been marked successful, throws {@link IllegalStateException}.
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     * @return True if the transaction was actually yielded.
+     *
+     * @throws IllegalStateException if <code>throwIfNested</code> is true and
+     * there is no current transaction, there is a nested transaction in progress or
+     * if {@link #setTransactionSuccessful} has already been called for the current transaction.
+     * @throws SQLiteException if an error occurs.
+     * @throws OperationCanceledException if the operation was canceled.
+     *
+     * @see #beginTransaction
+     * @see #endTransaction
+     */
+    public boolean yieldTransaction(long sleepAfterYieldDelayMillis, boolean throwIfUnsafe,
+            CancellationSignal cancellationSignal) {
+        if (throwIfUnsafe) {
+            throwIfNoTransaction();
+            throwIfTransactionMarkedSuccessful();
+            throwIfNestedTransaction();
+        } else {
+            if (mTransactionStack == null || mTransactionStack.mMarkedSuccessful
+                    || mTransactionStack.mParent != null) {
+                return false;
+            }
+        }
+        assert mConnection != null;
+
+        if (mTransactionStack.mChildFailed) {
+            return false;
+        }
+
+        return yieldTransactionUnchecked(sleepAfterYieldDelayMillis,
+                cancellationSignal); // might throw
+    }
+
+    private boolean yieldTransactionUnchecked(long sleepAfterYieldDelayMillis,
+            CancellationSignal cancellationSignal) {
+        if (cancellationSignal != null) {
+            cancellationSignal.throwIfCanceled();
+        }
+
+        if (!mConnectionPool.shouldYieldConnection(mConnection, mConnectionFlags)) {
+            return false;
+        }
+
+        final int transactionMode = mTransactionStack.mMode;
+        final SQLiteTransactionListener listener = mTransactionStack.mListener;
+        final int connectionFlags = mConnectionFlags;
+        endTransactionUnchecked(cancellationSignal); // might throw
+
+        if (sleepAfterYieldDelayMillis > 0) {
+            try {
+                Thread.sleep(sleepAfterYieldDelayMillis);
+            } catch (InterruptedException ex) {
+                // we have been interrupted, that's all we need to do
+            }
+        }
+
+        beginTransactionUnchecked(transactionMode, listener, connectionFlags,
+                cancellationSignal); // might throw
+        return true;
+    }
+
+    /**
+     * Prepares a statement for execution but does not bind its parameters or execute it.
+     * <p>
+     * This method can be used to check for syntax errors during compilation
+     * prior to execution of the statement.  If the {@code outStatementInfo} argument
+     * is not null, the provided {@link SQLiteStatementInfo} object is populated
+     * with information about the statement.
+     * </p><p>
+     * A prepared statement makes no reference to the arguments that may eventually
+     * be bound to it, consequently it it possible to cache certain prepared statements
+     * such as SELECT or INSERT/UPDATE statements.  If the statement is cacheable,
+     * then it will be stored in the cache for later and reused if possible.
+     * </p>
+     *
+     * @param sql The SQL statement to prepare.
+     * @param connectionFlags The connection flags to use if a connection must be
+     * acquired by this operation.  Refer to {@link SQLiteConnectionPool}.
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     * @param outStatementInfo The {@link SQLiteStatementInfo} object to populate
+     * with information about the statement, or null if none.
+     *
+     * @throws SQLiteException if an error occurs, such as a syntax error.
+     * @throws OperationCanceledException if the operation was canceled.
+     */
+    public void prepare(String sql, int connectionFlags, CancellationSignal cancellationSignal,
+            SQLiteStatementInfo outStatementInfo) {
+        if (sql == null) {
+            throw new IllegalArgumentException("sql must not be null.");
+        }
+
+        if (cancellationSignal != null) {
+            cancellationSignal.throwIfCanceled();
+        }
+
+        acquireConnection(sql, connectionFlags, cancellationSignal); // might throw
+        try {
+            mConnection.prepare(sql, outStatementInfo); // might throw
+        } finally {
+            releaseConnection(); // might throw
+        }
+    }
+
+    /**
+     * Executes a statement that does not return a result.
+     *
+     * @param sql The SQL statement to execute.
+     * @param bindArgs The arguments to bind, or null if none.
+     * @param connectionFlags The connection flags to use if a connection must be
+     * acquired by this operation.  Refer to {@link SQLiteConnectionPool}.
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     *
+     * @throws SQLiteException if an error occurs, such as a syntax error
+     * or invalid number of bind arguments.
+     * @throws OperationCanceledException if the operation was canceled.
+     */
+    public void execute(String sql, Object[] bindArgs, int connectionFlags,
+            CancellationSignal cancellationSignal) {
+        if (sql == null) {
+            throw new IllegalArgumentException("sql must not be null.");
+        }
+
+        if (executeSpecial(sql, bindArgs, connectionFlags, cancellationSignal)) {
+            return;
+        }
+
+        acquireConnection(sql, connectionFlags, cancellationSignal); // might throw
+        try {
+            mConnection.execute(sql, bindArgs, cancellationSignal); // might throw
+        } finally {
+            releaseConnection(); // might throw
+        }
+    }
+
+    /**
+     * Executes a statement that returns a single <code>long</code> result.
+     *
+     * @param sql The SQL statement to execute.
+     * @param bindArgs The arguments to bind, or null if none.
+     * @param connectionFlags The connection flags to use if a connection must be
+     * acquired by this operation.  Refer to {@link SQLiteConnectionPool}.
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     * @return The value of the first column in the first row of the result set
+     * as a <code>long</code>, or zero if none.
+     *
+     * @throws SQLiteException if an error occurs, such as a syntax error
+     * or invalid number of bind arguments.
+     * @throws OperationCanceledException if the operation was canceled.
+     */
+    public long executeForLong(String sql, Object[] bindArgs, int connectionFlags,
+            CancellationSignal cancellationSignal) {
+        if (sql == null) {
+            throw new IllegalArgumentException("sql must not be null.");
+        }
+
+        if (executeSpecial(sql, bindArgs, connectionFlags, cancellationSignal)) {
+            return 0;
+        }
+
+        acquireConnection(sql, connectionFlags, cancellationSignal); // might throw
+        try {
+            return mConnection.executeForLong(sql, bindArgs, cancellationSignal); // might throw
+        } finally {
+            releaseConnection(); // might throw
+        }
+    }
+
+    /**
+     * Executes a statement that returns a single {@link String} result.
+     *
+     * @param sql The SQL statement to execute.
+     * @param bindArgs The arguments to bind, or null if none.
+     * @param connectionFlags The connection flags to use if a connection must be
+     * acquired by this operation.  Refer to {@link SQLiteConnectionPool}.
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     * @return The value of the first column in the first row of the result set
+     * as a <code>String</code>, or null if none.
+     *
+     * @throws SQLiteException if an error occurs, such as a syntax error
+     * or invalid number of bind arguments.
+     * @throws OperationCanceledException if the operation was canceled.
+     */
+    public String executeForString(String sql, Object[] bindArgs, int connectionFlags,
+            CancellationSignal cancellationSignal) {
+        if (sql == null) {
+            throw new IllegalArgumentException("sql must not be null.");
+        }
+
+        if (executeSpecial(sql, bindArgs, connectionFlags, cancellationSignal)) {
+            return null;
+        }
+
+        acquireConnection(sql, connectionFlags, cancellationSignal); // might throw
+        try {
+            return mConnection.executeForString(sql, bindArgs, cancellationSignal); // might throw
+        } finally {
+            releaseConnection(); // might throw
+        }
+    }
+
+    /**
+     * Executes a statement that returns a single BLOB result as a
+     * file descriptor to a shared memory region.
+     *
+     * @param sql The SQL statement to execute.
+     * @param bindArgs The arguments to bind, or null if none.
+     * @param connectionFlags The connection flags to use if a connection must be
+     * acquired by this operation.  Refer to {@link SQLiteConnectionPool}.
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     * @return The file descriptor for a shared memory region that contains
+     * the value of the first column in the first row of the result set as a BLOB,
+     * or null if none.
+     *
+     * @throws SQLiteException if an error occurs, such as a syntax error
+     * or invalid number of bind arguments.
+     * @throws OperationCanceledException if the operation was canceled.
+     */
+    public ParcelFileDescriptor executeForBlobFileDescriptor(String sql, Object[] bindArgs,
+            int connectionFlags, CancellationSignal cancellationSignal) {
+        if (sql == null) {
+            throw new IllegalArgumentException("sql must not be null.");
+        }
+
+        if (executeSpecial(sql, bindArgs, connectionFlags, cancellationSignal)) {
+            return null;
+        }
+
+        acquireConnection(sql, connectionFlags, cancellationSignal); // might throw
+        try {
+            return mConnection.executeForBlobFileDescriptor(sql, bindArgs,
+                    cancellationSignal); // might throw
+        } finally {
+            releaseConnection(); // might throw
+        }
+    }
+
+    /**
+     * Executes a statement that returns a count of the number of rows
+     * that were changed.  Use for UPDATE or DELETE SQL statements.
+     *
+     * @param sql The SQL statement to execute.
+     * @param bindArgs The arguments to bind, or null if none.
+     * @param connectionFlags The connection flags to use if a connection must be
+     * acquired by this operation.  Refer to {@link SQLiteConnectionPool}.
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     * @return The number of rows that were changed.
+     *
+     * @throws SQLiteException if an error occurs, such as a syntax error
+     * or invalid number of bind arguments.
+     * @throws OperationCanceledException if the operation was canceled.
+     */
+    public int executeForChangedRowCount(String sql, Object[] bindArgs, int connectionFlags,
+            CancellationSignal cancellationSignal) {
+        if (sql == null) {
+            throw new IllegalArgumentException("sql must not be null.");
+        }
+
+        if (executeSpecial(sql, bindArgs, connectionFlags, cancellationSignal)) {
+            return 0;
+        }
+
+        acquireConnection(sql, connectionFlags, cancellationSignal); // might throw
+        try {
+            return mConnection.executeForChangedRowCount(sql, bindArgs,
+                    cancellationSignal); // might throw
+        } finally {
+            releaseConnection(); // might throw
+        }
+    }
+
+    /**
+     * Executes a statement that returns the row id of the last row inserted
+     * by the statement.  Use for INSERT SQL statements.
+     *
+     * @param sql The SQL statement to execute.
+     * @param bindArgs The arguments to bind, or null if none.
+     * @param connectionFlags The connection flags to use if a connection must be
+     * acquired by this operation.  Refer to {@link SQLiteConnectionPool}.
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     * @return The row id of the last row that was inserted, or 0 if none.
+     *
+     * @throws SQLiteException if an error occurs, such as a syntax error
+     * or invalid number of bind arguments.
+     * @throws OperationCanceledException if the operation was canceled.
+     */
+    public long executeForLastInsertedRowId(String sql, Object[] bindArgs, int connectionFlags,
+            CancellationSignal cancellationSignal) {
+        if (sql == null) {
+            throw new IllegalArgumentException("sql must not be null.");
+        }
+
+        if (executeSpecial(sql, bindArgs, connectionFlags, cancellationSignal)) {
+            return 0;
+        }
+
+        acquireConnection(sql, connectionFlags, cancellationSignal); // might throw
+        try {
+            return mConnection.executeForLastInsertedRowId(sql, bindArgs,
+                    cancellationSignal); // might throw
+        } finally {
+            releaseConnection(); // might throw
+        }
+    }
+
+    /**
+     * Executes a statement and populates the specified {@link CursorWindow}
+     * with a range of results.  Returns the number of rows that were counted
+     * during query execution.
+     *
+     * @param sql The SQL statement to execute.
+     * @param bindArgs The arguments to bind, or null if none.
+     * @param window The cursor window to clear and fill.
+     * @param startPos The start position for filling the window.
+     * @param requiredPos The position of a row that MUST be in the window.
+     * If it won't fit, then the query should discard part of what it filled
+     * so that it does.  Must be greater than or equal to <code>startPos</code>.
+     * @param countAllRows True to count all rows that the query would return
+     * regagless of whether they fit in the window.
+     * @param connectionFlags The connection flags to use if a connection must be
+     * acquired by this operation.  Refer to {@link SQLiteConnectionPool}.
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     * @return The number of rows that were counted during query execution.  Might
+     * not be all rows in the result set unless <code>countAllRows</code> is true.
+     *
+     * @throws SQLiteException if an error occurs, such as a syntax error
+     * or invalid number of bind arguments.
+     * @throws OperationCanceledException if the operation was canceled.
+     */
+    public int executeForCursorWindow(String sql, Object[] bindArgs,
+            CursorWindow window, int startPos, int requiredPos, boolean countAllRows,
+            int connectionFlags, CancellationSignal cancellationSignal) {
+        if (sql == null) {
+            throw new IllegalArgumentException("sql must not be null.");
+        }
+        if (window == null) {
+            throw new IllegalArgumentException("window must not be null.");
+        }
+
+        if (executeSpecial(sql, bindArgs, connectionFlags, cancellationSignal)) {
+            window.clear();
+            return 0;
+        }
+
+        acquireConnection(sql, connectionFlags, cancellationSignal); // might throw
+        try {
+            return mConnection.executeForCursorWindow(sql, bindArgs,
+                    window, startPos, requiredPos, countAllRows,
+                    cancellationSignal); // might throw
+        } finally {
+            releaseConnection(); // might throw
+        }
+    }
+
+    /**
+     * Performs special reinterpretation of certain SQL statements such as "BEGIN",
+     * "COMMIT" and "ROLLBACK" to ensure that transaction state invariants are
+     * maintained.
+     *
+     * This function is mainly used to support legacy apps that perform their
+     * own transactions by executing raw SQL rather than calling {@link #beginTransaction}
+     * and the like.
+     *
+     * @param sql The SQL statement to execute.
+     * @param bindArgs The arguments to bind, or null if none.
+     * @param connectionFlags The connection flags to use if a connection must be
+     * acquired by this operation.  Refer to {@link SQLiteConnectionPool}.
+     * @param cancellationSignal A signal to cancel the operation in progress, or null if none.
+     * @return True if the statement was of a special form that was handled here,
+     * false otherwise.
+     *
+     * @throws SQLiteException if an error occurs, such as a syntax error
+     * or invalid number of bind arguments.
+     * @throws OperationCanceledException if the operation was canceled.
+     */
+    private boolean executeSpecial(String sql, Object[] bindArgs, int connectionFlags,
+            CancellationSignal cancellationSignal) {
+        if (cancellationSignal != null) {
+            cancellationSignal.throwIfCanceled();
+        }
+
+        final int type = DatabaseUtils.getSqlStatementType(sql);
+        switch (type) {
+            case DatabaseUtils.STATEMENT_BEGIN:
+                beginTransaction(TRANSACTION_MODE_EXCLUSIVE, null, connectionFlags,
+                        cancellationSignal);
+                return true;
+
+            case DatabaseUtils.STATEMENT_COMMIT:
+                setTransactionSuccessful();
+                endTransaction(cancellationSignal);
+                return true;
+
+            case DatabaseUtils.STATEMENT_ABORT:
+                endTransaction(cancellationSignal);
+                return true;
+        }
+        return false;
+    }
+
+    private void acquireConnection(String sql, int connectionFlags,
+            CancellationSignal cancellationSignal) {
+        if (mConnection == null) {
+            assert mConnectionUseCount == 0;
+            mConnection = mConnectionPool.acquireConnection(sql, connectionFlags,
+                    cancellationSignal); // might throw
+            mConnectionFlags = connectionFlags;
+        }
+        mConnectionUseCount += 1;
+    }
+
+    private void releaseConnection() {
+        assert mConnection != null;
+        assert mConnectionUseCount > 0;
+        if (--mConnectionUseCount == 0) {
+            try {
+                mConnectionPool.releaseConnection(mConnection); // might throw
+            } finally {
+                mConnection = null;
+            }
+        }
+    }
+
+    private void throwIfNoTransaction() {
+        if (mTransactionStack == null) {
+            throw new IllegalStateException("Cannot perform this operation because "
+                    + "there is no current transaction.");
+        }
+    }
+
+    private void throwIfTransactionMarkedSuccessful() {
+        if (mTransactionStack != null && mTransactionStack.mMarkedSuccessful) {
+            throw new IllegalStateException("Cannot perform this operation because "
+                    + "the transaction has already been marked successful.  The only "
+                    + "thing you can do now is call endTransaction().");
+        }
+    }
+
+    private void throwIfNestedTransaction() {
+        if (mTransactionStack == null && mTransactionStack.mParent != null) {
+            throw new IllegalStateException("Cannot perform this operation because "
+                    + "a nested transaction is in progress.");
+        }
+    }
+
+    private Transaction obtainTransaction(int mode, SQLiteTransactionListener listener) {
+        Transaction transaction = mTransactionPool;
+        if (transaction != null) {
+            mTransactionPool = transaction.mParent;
+            transaction.mParent = null;
+            transaction.mMarkedSuccessful = false;
+            transaction.mChildFailed = false;
+        } else {
+            transaction = new Transaction();
+        }
+        transaction.mMode = mode;
+        transaction.mListener = listener;
+        return transaction;
+    }
+
+    private void recycleTransaction(Transaction transaction) {
+        transaction.mParent = mTransactionPool;
+        transaction.mListener = null;
+        mTransactionPool = transaction;
+    }
+
+    private static final class Transaction {
+        public Transaction mParent;
+        public int mMode;
+        public SQLiteTransactionListener mListener;
+        public boolean mMarkedSuccessful;
+        public boolean mChildFailed;
+    }
+}
diff --git a/core/java/android/database/sqlite/SQLiteStatement.java b/core/java/android/database/sqlite/SQLiteStatement.java
index c99a6fb..b1092d76 100644
--- a/core/java/android/database/sqlite/SQLiteStatement.java
+++ b/core/java/android/database/sqlite/SQLiteStatement.java
@@ -16,47 +16,19 @@
 
 package android.database.sqlite;
 
-import android.database.DatabaseUtils;
 import android.os.ParcelFileDescriptor;
-import android.os.SystemClock;
-import android.util.Log;
-
-import java.io.IOException;
-
-import dalvik.system.BlockGuard;
 
 /**
- * A pre-compiled statement against a {@link SQLiteDatabase} that can be reused.
- * The statement cannot return multiple rows, but 1x1 result sets are allowed.
- * Don't use SQLiteStatement constructor directly, please use
- * {@link SQLiteDatabase#compileStatement(String)}
- *<p>
- * SQLiteStatement is NOT internally synchronized so code using a SQLiteStatement from multiple
- * threads should perform its own synchronization when using the SQLiteStatement.
+ * Represents a statement that can be executed against a database.  The statement
+ * cannot return multiple rows or columns, but single value (1 x 1) result sets
+ * are supported.
+ * <p>
+ * This class is not thread-safe.
+ * </p>
  */
-@SuppressWarnings("deprecation")
-public final class SQLiteStatement extends SQLiteProgram
-{
-    private static final String TAG = "SQLiteStatement";
-
-    private static final boolean READ = true;
-    private static final boolean WRITE = false;
-
-    private SQLiteDatabase mOrigDb;
-    private int mState;
-    /** possible value for {@link #mState}. indicates that a transaction is started. */
-    private static final int TRANS_STARTED = 1;
-    /** possible value for {@link #mState}. indicates that a lock is acquired. */
-    private static final int LOCK_ACQUIRED = 2;
-
-    /**
-     * Don't use SQLiteStatement constructor directly, please use
-     * {@link SQLiteDatabase#compileStatement(String)}
-     * @param db
-     * @param sql
-     */
-    /* package */ SQLiteStatement(SQLiteDatabase db, String sql, Object[] bindArgs) {
-        super(db, sql, bindArgs, false /* don't compile sql statement */);
+public final class SQLiteStatement extends SQLiteProgram {
+    SQLiteStatement(SQLiteDatabase db, String sql, Object[] bindArgs) {
+        super(db, sql, bindArgs, null);
     }
 
     /**
@@ -67,7 +39,15 @@
      *         some reason
      */
     public void execute() {
-        executeUpdateDelete();
+        acquireReference();
+        try {
+            getSession().execute(getSql(), getBindArgs(), getConnectionFlags(), null);
+        } catch (SQLiteDatabaseCorruptException ex) {
+            onCorruption();
+            throw ex;
+        } finally {
+            releaseReference();
+        }
     }
 
     /**
@@ -79,21 +59,15 @@
      *         some reason
      */
     public int executeUpdateDelete() {
+        acquireReference();
         try {
-            saveSqlAsLastSqlStatement();
-            acquireAndLock(WRITE);
-            int numChanges = 0;
-            if ((mStatementType & STATEMENT_DONT_PREPARE) > 0) {
-                // since the statement doesn't have to be prepared,
-                // call the following native method which will not prepare
-                // the query plan
-                native_executeSql(mSql);
-            } else {
-                numChanges = native_execute();
-            }
-            return numChanges;
+            return getSession().executeForChangedRowCount(
+                    getSql(), getBindArgs(), getConnectionFlags(), null);
+        } catch (SQLiteDatabaseCorruptException ex) {
+            onCorruption();
+            throw ex;
         } finally {
-            releaseAndUnlock();
+            releaseReference();
         }
     }
 
@@ -107,23 +81,18 @@
      *         some reason
      */
     public long executeInsert() {
+        acquireReference();
         try {
-            saveSqlAsLastSqlStatement();
-            acquireAndLock(WRITE);
-            return native_executeInsert();
+            return getSession().executeForLastInsertedRowId(
+                    getSql(), getBindArgs(), getConnectionFlags(), null);
+        } catch (SQLiteDatabaseCorruptException ex) {
+            onCorruption();
+            throw ex;
         } finally {
-            releaseAndUnlock();
+            releaseReference();
         }
     }
 
-    private void saveSqlAsLastSqlStatement() {
-        if (((mStatementType & SQLiteProgram.STATEMENT_TYPE_MASK) ==
-                DatabaseUtils.STATEMENT_UPDATE) ||
-                (mStatementType & SQLiteProgram.STATEMENT_TYPE_MASK) ==
-                DatabaseUtils.STATEMENT_BEGIN) {
-            mDatabase.setLastSqlStatement(mSql);
-        }
-    }
     /**
      * Execute a statement that returns a 1 by 1 table with a numeric value.
      * For example, SELECT COUNT(*) FROM table;
@@ -133,17 +102,15 @@
      * @throws android.database.sqlite.SQLiteDoneException if the query returns zero rows
      */
     public long simpleQueryForLong() {
+        acquireReference();
         try {
-            long timeStart = acquireAndLock(READ);
-            long retValue = native_1x1_long();
-            mDatabase.logTimeStat(mSql, timeStart);
-            return retValue;
-        } catch (SQLiteDoneException e) {
-            throw new SQLiteDoneException(
-                    "expected 1 row from this query but query returned no data. check the query: " +
-                    mSql);
+            return getSession().executeForLong(
+                    getSql(), getBindArgs(), getConnectionFlags(), null);
+        } catch (SQLiteDatabaseCorruptException ex) {
+            onCorruption();
+            throw ex;
         } finally {
-            releaseAndUnlock();
+            releaseReference();
         }
     }
 
@@ -156,17 +123,15 @@
      * @throws android.database.sqlite.SQLiteDoneException if the query returns zero rows
      */
     public String simpleQueryForString() {
+        acquireReference();
         try {
-            long timeStart = acquireAndLock(READ);
-            String retValue = native_1x1_string();
-            mDatabase.logTimeStat(mSql, timeStart);
-            return retValue;
-        } catch (SQLiteDoneException e) {
-            throw new SQLiteDoneException(
-                    "expected 1 row from this query but query returned no data. check the query: " +
-                    mSql);
+            return getSession().executeForString(
+                    getSql(), getBindArgs(), getConnectionFlags(), null);
+        } catch (SQLiteDatabaseCorruptException ex) {
+            onCorruption();
+            throw ex;
         } finally {
-            releaseAndUnlock();
+            releaseReference();
         }
     }
 
@@ -179,121 +144,20 @@
      * @throws android.database.sqlite.SQLiteDoneException if the query returns zero rows
      */
     public ParcelFileDescriptor simpleQueryForBlobFileDescriptor() {
-        try {
-            long timeStart = acquireAndLock(READ);
-            ParcelFileDescriptor retValue = native_1x1_blob_ashmem();
-            mDatabase.logTimeStat(mSql, timeStart);
-            return retValue;
-        } catch (IOException ex) {
-            Log.e(TAG, "simpleQueryForBlobFileDescriptor() failed", ex);
-            return null;
-        } catch (SQLiteDoneException e) {
-            throw new SQLiteDoneException(
-                    "expected 1 row from this query but query returned no data. check the query: " +
-                    mSql);
-        } finally {
-            releaseAndUnlock();
-        }
-    }
-
-    /**
-     * Called before every method in this class before executing a SQL statement,
-     * this method does the following:
-     * <ul>
-     *   <li>make sure the database is open</li>
-     *   <li>get a database connection from the connection pool,if possible</li>
-     *   <li>notifies {@link BlockGuard} of read/write</li>
-     *   <li>if the SQL statement is an update, start transaction if not already in one.
-     *   otherwise, get lock on the database</li>
-     *   <li>acquire reference on this object</li>
-     *   <li>and then return the current time _after_ the database lock was acquired</li>
-     * </ul>
-     * <p>
-     * This method removes the duplicate code from the other public
-     * methods in this class.
-     */
-    private long acquireAndLock(boolean rwFlag) {
-        mState = 0;
-        // use pooled database connection handles for SELECT SQL statements
-        mDatabase.verifyDbIsOpen();
-        SQLiteDatabase db = ((mStatementType & SQLiteProgram.STATEMENT_USE_POOLED_CONN) > 0)
-                ? mDatabase.getDbConnection(mSql) : mDatabase;
-        // use the database connection obtained above
-        mOrigDb = mDatabase;
-        mDatabase = db;
-        setNativeHandle(mDatabase.mNativeHandle);
-        if (rwFlag == WRITE) {
-            BlockGuard.getThreadPolicy().onWriteToDisk();
-        } else {
-            BlockGuard.getThreadPolicy().onReadFromDisk();
-        }
-
-        /*
-         * Special case handling of SQLiteDatabase.execSQL("BEGIN transaction").
-         * we know it is execSQL("BEGIN transaction") from the caller IF there is no lock held.
-         * beginTransaction() methods in SQLiteDatabase call lockForced() before
-         * calling execSQL("BEGIN transaction").
-         */
-        if ((mStatementType & SQLiteProgram.STATEMENT_TYPE_MASK) == DatabaseUtils.STATEMENT_BEGIN) {
-            if (!mDatabase.isDbLockedByCurrentThread()) {
-                // transaction is  NOT started by calling beginTransaction() methods in
-                // SQLiteDatabase
-                mDatabase.setTransactionUsingExecSqlFlag();
-            }
-        } else if ((mStatementType & SQLiteProgram.STATEMENT_TYPE_MASK) ==
-                DatabaseUtils.STATEMENT_UPDATE) {
-            // got update SQL statement. if there is NO pending transaction, start one
-            if (!mDatabase.inTransaction()) {
-                mDatabase.beginTransactionNonExclusive();
-                mState = TRANS_STARTED;
-            }
-        }
-        // do I have database lock? if not, grab it.
-        if (!mDatabase.isDbLockedByCurrentThread()) {
-            mDatabase.lock(mSql);
-            mState = LOCK_ACQUIRED;
-        }
-
         acquireReference();
-        long startTime = SystemClock.uptimeMillis();
-        mDatabase.closePendingStatements();
-        compileAndbindAllArgs();
-        return startTime;
+        try {
+            return getSession().executeForBlobFileDescriptor(
+                    getSql(), getBindArgs(), getConnectionFlags(), null);
+        } catch (SQLiteDatabaseCorruptException ex) {
+            onCorruption();
+            throw ex;
+        } finally {
+            releaseReference();
+        }
     }
 
-    /**
-     * this method releases locks and references acquired in {@link #acquireAndLock(boolean)}
-     */
-    private void releaseAndUnlock() {
-        releaseReference();
-        if (mState == TRANS_STARTED) {
-            try {
-                mDatabase.setTransactionSuccessful();
-            } finally {
-                mDatabase.endTransaction();
-            }
-        } else if (mState == LOCK_ACQUIRED) {
-            mDatabase.unlock();
-        }
-        if ((mStatementType & SQLiteProgram.STATEMENT_TYPE_MASK) ==
-                DatabaseUtils.STATEMENT_COMMIT ||
-                (mStatementType & SQLiteProgram.STATEMENT_TYPE_MASK) ==
-                DatabaseUtils.STATEMENT_ABORT) {
-            mDatabase.resetTransactionUsingExecSqlFlag();
-        }
-        clearBindings();
-        // release the compiled sql statement so that the caller's SQLiteStatement no longer
-        // has a hard reference to a database object that may get deallocated at any point.
-        release();
-        // restore the database connection handle to the original value
-        mDatabase = mOrigDb;
-        setNativeHandle(mDatabase.mNativeHandle);
+    @Override
+    public String toString() {
+        return "SQLiteProgram: " + getSql();
     }
-
-    private final native int native_execute();
-    private final native long native_executeInsert();
-    private final native long native_1x1_long();
-    private final native String native_1x1_string();
-    private final native ParcelFileDescriptor native_1x1_blob_ashmem() throws IOException;
-    private final native void native_executeSql(String sql);
 }
diff --git a/core/java/android/database/sqlite/SQLiteStatementInfo.java b/core/java/android/database/sqlite/SQLiteStatementInfo.java
new file mode 100644
index 0000000..3edfdb0
--- /dev/null
+++ b/core/java/android/database/sqlite/SQLiteStatementInfo.java
@@ -0,0 +1,39 @@
+/*
+ * 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 android.database.sqlite;
+
+/**
+ * Describes a SQLite statement.
+ *
+ * @hide
+ */
+public final class SQLiteStatementInfo {
+    /**
+     * The number of parameters that the statement has.
+     */
+    public int numParameters;
+
+    /**
+     * The names of all columns in the result set of the statement.
+     */
+    public String[] columnNames;
+
+    /**
+     * True if the statement is read-only.
+     */
+    public boolean readOnly;
+}
diff --git a/core/java/android/database/sqlite/SQLiteUnfinalizedObjectsException.java b/core/java/android/database/sqlite/SQLiteUnfinalizedObjectsException.java
deleted file mode 100644
index bcf95e2..0000000
--- a/core/java/android/database/sqlite/SQLiteUnfinalizedObjectsException.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2010 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.database.sqlite;
-
-/**
- * Thrown if the database can't be closed because of some un-closed
- * Cursor or SQLiteStatement objects. Could happen when a thread is trying to close
- * the database while another thread still hasn't closed a Cursor on that database.
- * @hide
- */
-public class SQLiteUnfinalizedObjectsException extends SQLiteException {
-    public SQLiteUnfinalizedObjectsException() {}
-
-    public SQLiteUnfinalizedObjectsException(String error) {
-        super(error);
-    }
-}
diff --git a/core/java/android/inputmethodservice/ExtractEditText.java b/core/java/android/inputmethodservice/ExtractEditText.java
index 10c1195..23ae21b 100644
--- a/core/java/android/inputmethodservice/ExtractEditText.java
+++ b/core/java/android/inputmethodservice/ExtractEditText.java
@@ -100,6 +100,9 @@
     
     @Override public boolean onTextContextMenuItem(int id) {
         if (mIME != null && mIME.onExtractTextContextMenuItem(id)) {
+            // Mode was started on Extracted, needs to be stopped here.
+            // Cut and paste will change the text, which stops selection mode.
+            if (id == android.R.id.copy) stopSelectionActionMode();
             return true;
         }
         return super.onTextContextMenuItem(id);
diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java
index a569317..2eef8f4 100644
--- a/core/java/android/net/ConnectivityManager.java
+++ b/core/java/android/net/ConnectivityManager.java
@@ -142,8 +142,19 @@
      * If an application uses the network in the background, it should listen
      * for this broadcast and stop using the background data if the value is
      * {@code false}.
+     * <p>
+     *
+     * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH}, availability
+     *             of background data depends on several combined factors, and
+     *             this broadcast is no longer sent. Instead, when background
+     *             data is unavailable, {@link #getActiveNetworkInfo()} will now
+     *             appear disconnected. During first boot after a platform
+     *             upgrade, this broadcast will be sent once if
+     *             {@link #getBackgroundDataSetting()} was {@code false} before
+     *             the upgrade.
      */
     @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+    @Deprecated
     public static final String ACTION_BACKGROUND_DATA_SETTING_CHANGED =
             "android.net.conn.BACKGROUND_DATA_SETTING_CHANGED";
 
diff --git a/core/java/android/net/INetworkPolicyListener.aidl b/core/java/android/net/INetworkPolicyListener.aidl
index a45ec54..31dc965a 100644
--- a/core/java/android/net/INetworkPolicyListener.aidl
+++ b/core/java/android/net/INetworkPolicyListener.aidl
@@ -21,5 +21,6 @@
 
     void onUidRulesChanged(int uid, int uidRules);
     void onMeteredIfacesChanged(in String[] meteredIfaces);
+    void onRestrictBackgroundChanged(boolean restrictBackground);
 
 }
diff --git a/core/java/android/net/INetworkPolicyManager.aidl b/core/java/android/net/INetworkPolicyManager.aidl
index 633c38e0..442535a 100644
--- a/core/java/android/net/INetworkPolicyManager.aidl
+++ b/core/java/android/net/INetworkPolicyManager.aidl
@@ -43,7 +43,7 @@
     NetworkPolicy[] getNetworkPolicies();
 
     /** Snooze limit on policy matching given template. */
-    void snoozePolicy(in NetworkTemplate template);
+    void snoozeLimit(in NetworkTemplate template);
 
     /** Control if background data is restricted system-wide. */
     void setRestrictBackground(boolean restrictBackground);
diff --git a/core/java/android/net/NetworkPolicy.java b/core/java/android/net/NetworkPolicy.java
index d9ea700..04cf1a3 100644
--- a/core/java/android/net/NetworkPolicy.java
+++ b/core/java/android/net/NetworkPolicy.java
@@ -38,18 +38,25 @@
     public int cycleDay;
     public long warningBytes;
     public long limitBytes;
-    public long lastSnooze;
+    public long lastWarningSnooze;
+    public long lastLimitSnooze;
     public boolean metered;
 
     private static final long DEFAULT_MTU = 1500;
 
-    public NetworkPolicy(NetworkTemplate template, int cycleDay, long warningBytes, long limitBytes,
-            long lastSnooze, boolean metered) {
+    public NetworkPolicy(NetworkTemplate template, int cycleDay, long warningBytes,
+            long limitBytes, boolean metered) {
+        this(template, cycleDay, warningBytes, limitBytes, SNOOZE_NEVER, SNOOZE_NEVER, metered);
+    }
+
+    public NetworkPolicy(NetworkTemplate template, int cycleDay, long warningBytes,
+            long limitBytes, long lastWarningSnooze, long lastLimitSnooze, boolean metered) {
         this.template = checkNotNull(template, "missing NetworkTemplate");
         this.cycleDay = cycleDay;
         this.warningBytes = warningBytes;
         this.limitBytes = limitBytes;
-        this.lastSnooze = lastSnooze;
+        this.lastWarningSnooze = lastWarningSnooze;
+        this.lastLimitSnooze = lastLimitSnooze;
         this.metered = metered;
     }
 
@@ -58,7 +65,8 @@
         cycleDay = in.readInt();
         warningBytes = in.readLong();
         limitBytes = in.readLong();
-        lastSnooze = in.readLong();
+        lastWarningSnooze = in.readLong();
+        lastLimitSnooze = in.readLong();
         metered = in.readInt() != 0;
     }
 
@@ -68,7 +76,8 @@
         dest.writeInt(cycleDay);
         dest.writeLong(warningBytes);
         dest.writeLong(limitBytes);
-        dest.writeLong(lastSnooze);
+        dest.writeLong(lastWarningSnooze);
+        dest.writeLong(lastLimitSnooze);
         dest.writeInt(metered ? 1 : 0);
     }
 
@@ -78,6 +87,13 @@
     }
 
     /**
+     * Test if given measurement is over {@link #warningBytes}.
+     */
+    public boolean isOverWarning(long totalBytes) {
+        return warningBytes != WARNING_DISABLED && totalBytes >= warningBytes;
+    }
+
+    /**
      * Test if given measurement is near enough to {@link #limitBytes} to be
      * considered over-limit.
      */
@@ -88,6 +104,14 @@
         return limitBytes != LIMIT_DISABLED && totalBytes >= limitBytes;
     }
 
+    /**
+     * Clear any existing snooze values, setting to {@link #SNOOZE_NEVER}.
+     */
+    public void clearSnooze() {
+        lastWarningSnooze = SNOOZE_NEVER;
+        lastLimitSnooze = SNOOZE_NEVER;
+    }
+
     /** {@inheritDoc} */
     public int compareTo(NetworkPolicy another) {
         if (another == null || another.limitBytes == LIMIT_DISABLED) {
@@ -103,7 +127,8 @@
 
     @Override
     public int hashCode() {
-        return Objects.hashCode(template, cycleDay, warningBytes, limitBytes, lastSnooze, metered);
+        return Objects.hashCode(template, cycleDay, warningBytes, limitBytes, lastWarningSnooze,
+                lastLimitSnooze, metered);
     }
 
     @Override
@@ -111,8 +136,10 @@
         if (obj instanceof NetworkPolicy) {
             final NetworkPolicy other = (NetworkPolicy) obj;
             return cycleDay == other.cycleDay && warningBytes == other.warningBytes
-                    && limitBytes == other.limitBytes && lastSnooze == other.lastSnooze
-                    && metered == other.metered && Objects.equal(template, other.template);
+                    && limitBytes == other.limitBytes
+                    && lastWarningSnooze == other.lastWarningSnooze
+                    && lastLimitSnooze == other.lastLimitSnooze && metered == other.metered
+                    && Objects.equal(template, other.template);
         }
         return false;
     }
@@ -120,8 +147,9 @@
     @Override
     public String toString() {
         return "NetworkPolicy[" + template + "]: cycleDay=" + cycleDay + ", warningBytes="
-                + warningBytes + ", limitBytes=" + limitBytes + ", lastSnooze=" + lastSnooze
-                + ", metered=" + metered;
+                + warningBytes + ", limitBytes=" + limitBytes + ", lastWarningSnooze="
+                + lastWarningSnooze + ", lastLimitSnooze=" + lastLimitSnooze + ", metered="
+                + metered;
     }
 
     public static final Creator<NetworkPolicy> CREATOR = new Creator<NetworkPolicy>() {
diff --git a/core/java/android/net/NetworkStats.java b/core/java/android/net/NetworkStats.java
index f6e627c..7a1ef66 100644
--- a/core/java/android/net/NetworkStats.java
+++ b/core/java/android/net/NetworkStats.java
@@ -16,8 +16,6 @@
 
 package android.net;
 
-import static com.android.internal.util.Preconditions.checkNotNull;
-
 import android.os.Parcel;
 import android.os.Parcelable;
 import android.os.SystemClock;
@@ -40,8 +38,6 @@
  * @hide
  */
 public class NetworkStats implements Parcelable {
-    private static final String TAG = "NetworkStats";
-
     /** {@link #iface} value when interface details unavailable. */
     public static final String IFACE_ALL = null;
     /** {@link #uid} value when UID details unavailable. */
@@ -106,6 +102,15 @@
             this.operations = operations;
         }
 
+        public boolean isNegative() {
+            return rxBytes < 0 || rxPackets < 0 || txBytes < 0 || txPackets < 0 || operations < 0;
+        }
+
+        public boolean isEmpty() {
+            return rxBytes == 0 && rxPackets == 0 && txBytes == 0 && txPackets == 0
+                    && operations == 0;
+        }
+
         @Override
         public String toString() {
             final StringBuilder builder = new StringBuilder();
@@ -347,6 +352,7 @@
      * on matching {@link #uid} and {@link #tag} rows. Ignores {@link #iface},
      * since operation counts are at data layer.
      */
+    @Deprecated
     public void spliceOperationsFrom(NetworkStats stats) {
         for (int i = 0; i < size; i++) {
             final int j = stats.findIndex(IFACE_ALL, uid[i], set[i], tag[i]);
@@ -401,7 +407,7 @@
      * Return total of all fields represented by this snapshot object.
      */
     public Entry getTotal(Entry recycle) {
-        return getTotal(recycle, null, UID_ALL);
+        return getTotal(recycle, null, UID_ALL, false);
     }
 
     /**
@@ -409,7 +415,7 @@
      * the requested {@link #uid}.
      */
     public Entry getTotal(Entry recycle, int limitUid) {
-        return getTotal(recycle, null, limitUid);
+        return getTotal(recycle, null, limitUid, false);
     }
 
     /**
@@ -417,7 +423,11 @@
      * the requested {@link #iface}.
      */
     public Entry getTotal(Entry recycle, HashSet<String> limitIface) {
-        return getTotal(recycle, limitIface, UID_ALL);
+        return getTotal(recycle, limitIface, UID_ALL, false);
+    }
+
+    public Entry getTotalIncludingTags(Entry recycle) {
+        return getTotal(recycle, null, UID_ALL, true);
     }
 
     /**
@@ -427,7 +437,8 @@
      * @param limitIface Set of {@link #iface} to include in total; or {@code
      *            null} to include all ifaces.
      */
-    private Entry getTotal(Entry recycle, HashSet<String> limitIface, int limitUid) {
+    private Entry getTotal(
+            Entry recycle, HashSet<String> limitIface, int limitUid, boolean includeTags) {
         final Entry entry = recycle != null ? recycle : new Entry();
 
         entry.iface = IFACE_ALL;
@@ -446,7 +457,7 @@
 
             if (matchesUid && matchesIface) {
                 // skip specific tags, since already counted in TAG_NONE
-                if (tag[i] != TAG_NONE) continue;
+                if (tag[i] != TAG_NONE && !includeTags) continue;
 
                 entry.rxBytes += rxBytes[i];
                 entry.rxPackets += rxPackets[i];
@@ -463,62 +474,64 @@
      * between two snapshots in time. Assumes that statistics rows collect over
      * time, and that none of them have disappeared.
      */
-    public NetworkStats subtract(NetworkStats value) throws NonMonotonicException {
-        return subtract(value, false);
+    public NetworkStats subtract(NetworkStats right) {
+        return subtract(this, right, null, null);
     }
 
     /**
-     * Subtract the given {@link NetworkStats}, effectively leaving the delta
+     * Subtract the two given {@link NetworkStats} objects, returning the delta
      * between two snapshots in time. Assumes that statistics rows collect over
      * time, and that none of them have disappeared.
-     *
-     * @param clampNonMonotonic When non-monotonic stats are found, just clamp
-     *            to 0 instead of throwing {@link NonMonotonicException}.
+     * <p>
+     * If counters have rolled backwards, they are clamped to {@code 0} and
+     * reported to the given {@link NonMonotonicObserver}.
      */
-    public NetworkStats subtract(NetworkStats value, boolean clampNonMonotonic)
-            throws NonMonotonicException {
-        final long deltaRealtime = this.elapsedRealtime - value.elapsedRealtime;
+    public static <C> NetworkStats subtract(
+            NetworkStats left, NetworkStats right, NonMonotonicObserver<C> observer, C cookie) {
+        long deltaRealtime = left.elapsedRealtime - right.elapsedRealtime;
         if (deltaRealtime < 0) {
-            throw new NonMonotonicException(this, value);
+            if (observer != null) {
+                observer.foundNonMonotonic(left, -1, right, -1, cookie);
+            }
+            deltaRealtime = 0;
         }
 
         // result will have our rows, and elapsed time between snapshots
         final Entry entry = new Entry();
-        final NetworkStats result = new NetworkStats(deltaRealtime, size);
-        for (int i = 0; i < size; i++) {
-            entry.iface = iface[i];
-            entry.uid = uid[i];
-            entry.set = set[i];
-            entry.tag = tag[i];
+        final NetworkStats result = new NetworkStats(deltaRealtime, left.size);
+        for (int i = 0; i < left.size; i++) {
+            entry.iface = left.iface[i];
+            entry.uid = left.uid[i];
+            entry.set = left.set[i];
+            entry.tag = left.tag[i];
 
             // find remote row that matches, and subtract
-            final int j = value.findIndexHinted(entry.iface, entry.uid, entry.set, entry.tag, i);
+            final int j = right.findIndexHinted(entry.iface, entry.uid, entry.set, entry.tag, i);
             if (j == -1) {
                 // newly appearing row, return entire value
-                entry.rxBytes = rxBytes[i];
-                entry.rxPackets = rxPackets[i];
-                entry.txBytes = txBytes[i];
-                entry.txPackets = txPackets[i];
-                entry.operations = operations[i];
+                entry.rxBytes = left.rxBytes[i];
+                entry.rxPackets = left.rxPackets[i];
+                entry.txBytes = left.txBytes[i];
+                entry.txPackets = left.txPackets[i];
+                entry.operations = left.operations[i];
             } else {
                 // existing row, subtract remote value
-                entry.rxBytes = rxBytes[i] - value.rxBytes[j];
-                entry.rxPackets = rxPackets[i] - value.rxPackets[j];
-                entry.txBytes = txBytes[i] - value.txBytes[j];
-                entry.txPackets = txPackets[i] - value.txPackets[j];
-                entry.operations = operations[i] - value.operations[j];
+                entry.rxBytes = left.rxBytes[i] - right.rxBytes[j];
+                entry.rxPackets = left.rxPackets[i] - right.rxPackets[j];
+                entry.txBytes = left.txBytes[i] - right.txBytes[j];
+                entry.txPackets = left.txPackets[i] - right.txPackets[j];
+                entry.operations = left.operations[i] - right.operations[j];
 
                 if (entry.rxBytes < 0 || entry.rxPackets < 0 || entry.txBytes < 0
                         || entry.txPackets < 0 || entry.operations < 0) {
-                    if (clampNonMonotonic) {
-                        entry.rxBytes = Math.max(entry.rxBytes, 0);
-                        entry.rxPackets = Math.max(entry.rxPackets, 0);
-                        entry.txBytes = Math.max(entry.txBytes, 0);
-                        entry.txPackets = Math.max(entry.txPackets, 0);
-                        entry.operations = Math.max(entry.operations, 0);
-                    } else {
-                        throw new NonMonotonicException(this, i, value, j);
+                    if (observer != null) {
+                        observer.foundNonMonotonic(left, i, right, j, cookie);
                     }
+                    entry.rxBytes = Math.max(entry.rxBytes, 0);
+                    entry.rxPackets = Math.max(entry.rxPackets, 0);
+                    entry.txBytes = Math.max(entry.txBytes, 0);
+                    entry.txPackets = Math.max(entry.txPackets, 0);
+                    entry.operations = Math.max(entry.operations, 0);
                 }
             }
 
@@ -665,22 +678,8 @@
         }
     };
 
-    public static class NonMonotonicException extends Exception {
-        public final NetworkStats left;
-        public final NetworkStats right;
-        public final int leftIndex;
-        public final int rightIndex;
-
-        public NonMonotonicException(NetworkStats left, NetworkStats right) {
-            this(left, -1, right, -1);
-        }
-
-        public NonMonotonicException(
-                NetworkStats left, int leftIndex, NetworkStats right, int rightIndex) {
-            this.left = checkNotNull(left, "missing left");
-            this.right = checkNotNull(right, "missing right");
-            this.leftIndex = leftIndex;
-            this.rightIndex = rightIndex;
-        }
+    public interface NonMonotonicObserver<C> {
+        public void foundNonMonotonic(
+                NetworkStats left, int leftIndex, NetworkStats right, int rightIndex, C cookie);
     }
 }
diff --git a/core/java/android/net/NetworkStatsHistory.java b/core/java/android/net/NetworkStatsHistory.java
index 8c01331..faf8a3f 100644
--- a/core/java/android/net/NetworkStatsHistory.java
+++ b/core/java/android/net/NetworkStatsHistory.java
@@ -26,16 +26,18 @@
 import static android.net.NetworkStatsHistory.Entry.UNKNOWN;
 import static android.net.NetworkStatsHistory.ParcelUtils.readLongArray;
 import static android.net.NetworkStatsHistory.ParcelUtils.writeLongArray;
+import static com.android.internal.util.ArrayUtils.total;
 
 import android.os.Parcel;
 import android.os.Parcelable;
 import android.util.MathUtils;
 
+import com.android.internal.util.IndentingPrintWriter;
+
 import java.io.CharArrayWriter;
 import java.io.DataInputStream;
 import java.io.DataOutputStream;
 import java.io.IOException;
-import java.io.PrintWriter;
 import java.net.ProtocolException;
 import java.util.Arrays;
 import java.util.Random;
@@ -74,6 +76,7 @@
     private long[] txBytes;
     private long[] txPackets;
     private long[] operations;
+    private long totalBytes;
 
     public static class Entry {
         public static final long UNKNOWN = -1;
@@ -106,6 +109,12 @@
         if ((fields & FIELD_TX_PACKETS) != 0) txPackets = new long[initialSize];
         if ((fields & FIELD_OPERATIONS) != 0) operations = new long[initialSize];
         bucketCount = 0;
+        totalBytes = 0;
+    }
+
+    public NetworkStatsHistory(NetworkStatsHistory existing, long bucketDuration) {
+        this(bucketDuration, existing.estimateResizeBuckets(bucketDuration));
+        recordEntireHistory(existing);
     }
 
     public NetworkStatsHistory(Parcel in) {
@@ -118,6 +127,7 @@
         txPackets = readLongArray(in);
         operations = readLongArray(in);
         bucketCount = bucketStart.length;
+        totalBytes = in.readLong();
     }
 
     /** {@inheritDoc} */
@@ -130,6 +140,7 @@
         writeLongArray(out, txBytes, bucketCount);
         writeLongArray(out, txPackets, bucketCount);
         writeLongArray(out, operations, bucketCount);
+        out.writeLong(totalBytes);
     }
 
     public NetworkStatsHistory(DataInputStream in) throws IOException {
@@ -144,6 +155,7 @@
                 txPackets = new long[bucketStart.length];
                 operations = new long[bucketStart.length];
                 bucketCount = bucketStart.length;
+                totalBytes = total(rxBytes) + total(txBytes);
                 break;
             }
             case VERSION_ADD_PACKETS:
@@ -158,6 +170,7 @@
                 txPackets = readVarLongArray(in);
                 operations = readVarLongArray(in);
                 bucketCount = bucketStart.length;
+                totalBytes = total(rxBytes) + total(txBytes);
                 break;
             }
             default: {
@@ -208,6 +221,13 @@
     }
 
     /**
+     * Return total bytes represented by this history.
+     */
+    public long getTotalBytes() {
+        return totalBytes;
+    }
+
+    /**
      * Return index of bucket that contains or is immediately before the
      * requested time.
      */
@@ -266,13 +286,16 @@
      * distribute across internal buckets, creating new buckets as needed.
      */
     public void recordData(long start, long end, NetworkStats.Entry entry) {
-        if (entry.rxBytes < 0 || entry.rxPackets < 0 || entry.txBytes < 0 || entry.txPackets < 0
-                || entry.operations < 0) {
+        long rxBytes = entry.rxBytes;
+        long rxPackets = entry.rxPackets;
+        long txBytes = entry.txBytes;
+        long txPackets = entry.txPackets;
+        long operations = entry.operations;
+
+        if (entry.isNegative()) {
             throw new IllegalArgumentException("tried recording negative data");
         }
-        if (entry.rxBytes == 0 && entry.rxPackets == 0 && entry.txBytes == 0 && entry.txPackets == 0
-                && entry.operations == 0) {
-            // nothing to record; skip
+        if (entry.isEmpty()) {
             return;
         }
 
@@ -295,21 +318,23 @@
             if (overlap <= 0) continue;
 
             // integer math each time is faster than floating point
-            final long fracRxBytes = entry.rxBytes * overlap / duration;
-            final long fracRxPackets = entry.rxPackets * overlap / duration;
-            final long fracTxBytes = entry.txBytes * overlap / duration;
-            final long fracTxPackets = entry.txPackets * overlap / duration;
-            final long fracOperations = entry.operations * overlap / duration;
+            final long fracRxBytes = rxBytes * overlap / duration;
+            final long fracRxPackets = rxPackets * overlap / duration;
+            final long fracTxBytes = txBytes * overlap / duration;
+            final long fracTxPackets = txPackets * overlap / duration;
+            final long fracOperations = operations * overlap / duration;
 
             addLong(activeTime, i, overlap);
-            addLong(rxBytes, i, fracRxBytes); entry.rxBytes -= fracRxBytes;
-            addLong(rxPackets, i, fracRxPackets); entry.rxPackets -= fracRxPackets;
-            addLong(txBytes, i, fracTxBytes); entry.txBytes -= fracTxBytes;
-            addLong(txPackets, i, fracTxPackets); entry.txPackets -= fracTxPackets;
-            addLong(operations, i, fracOperations); entry.operations -= fracOperations;
+            addLong(this.rxBytes, i, fracRxBytes); rxBytes -= fracRxBytes;
+            addLong(this.rxPackets, i, fracRxPackets); rxPackets -= fracRxPackets;
+            addLong(this.txBytes, i, fracTxBytes); txBytes -= fracTxBytes;
+            addLong(this.txPackets, i, fracTxPackets); txPackets -= fracTxPackets;
+            addLong(this.operations, i, fracOperations); operations -= fracOperations;
 
             duration -= overlap;
         }
+
+        totalBytes += entry.rxBytes + entry.txBytes;
     }
 
     /**
@@ -394,6 +419,7 @@
     /**
      * Remove buckets older than requested cutoff.
      */
+    @Deprecated
     public void removeBucketsBefore(long cutoff) {
         int i;
         for (i = 0; i < bucketCount; i++) {
@@ -415,6 +441,8 @@
             if (txPackets != null) txPackets = Arrays.copyOfRange(txPackets, i, length);
             if (operations != null) operations = Arrays.copyOfRange(operations, i, length);
             bucketCount -= i;
+
+            // TODO: subtract removed values from totalBytes
         }
     }
 
@@ -527,19 +555,17 @@
         return (long) (start + (r.nextFloat() * (end - start)));
     }
 
-    public void dump(String prefix, PrintWriter pw, boolean fullHistory) {
-        pw.print(prefix);
+    public void dump(IndentingPrintWriter pw, boolean fullHistory) {
         pw.print("NetworkStatsHistory: bucketDuration="); pw.println(bucketDuration);
+        pw.increaseIndent();
 
         final int start = fullHistory ? 0 : Math.max(0, bucketCount - 32);
         if (start > 0) {
-            pw.print(prefix);
-            pw.print("  (omitting "); pw.print(start); pw.println(" buckets)");
+            pw.print("(omitting "); pw.print(start); pw.println(" buckets)");
         }
 
         for (int i = start; i < bucketCount; i++) {
-            pw.print(prefix);
-            pw.print("  bucketStart="); pw.print(bucketStart[i]);
+            pw.print("bucketStart="); pw.print(bucketStart[i]);
             if (activeTime != null) { pw.print(" activeTime="); pw.print(activeTime[i]); }
             if (rxBytes != null) { pw.print(" rxBytes="); pw.print(rxBytes[i]); }
             if (rxPackets != null) { pw.print(" rxPackets="); pw.print(rxPackets[i]); }
@@ -548,12 +574,14 @@
             if (operations != null) { pw.print(" operations="); pw.print(operations[i]); }
             pw.println();
         }
+
+        pw.decreaseIndent();
     }
 
     @Override
     public String toString() {
         final CharArrayWriter writer = new CharArrayWriter();
-        dump("", new PrintWriter(writer), false);
+        dump(new IndentingPrintWriter(writer, "  "), false);
         return writer.toString();
     }
 
@@ -579,6 +607,10 @@
         if (array != null) array[i] += value;
     }
 
+    public int estimateResizeBuckets(long newBucketDuration) {
+        return (int) (size() * getBucketDuration() / newBucketDuration);
+    }
+
     /**
      * Utility methods for interacting with {@link DataInputStream} and
      * {@link DataOutputStream}, mostly dealing with writing partial arrays.
diff --git a/core/java/android/net/NetworkTemplate.java b/core/java/android/net/NetworkTemplate.java
index 418b82f..8ebfd8d 100644
--- a/core/java/android/net/NetworkTemplate.java
+++ b/core/java/android/net/NetworkTemplate.java
@@ -18,6 +18,7 @@
 
 import static android.net.ConnectivityManager.TYPE_ETHERNET;
 import static android.net.ConnectivityManager.TYPE_WIFI;
+import static android.net.ConnectivityManager.TYPE_WIFI_P2P;
 import static android.net.ConnectivityManager.TYPE_WIMAX;
 import static android.net.NetworkIdentity.scrubSubscriberId;
 import static android.telephony.TelephonyManager.NETWORK_CLASS_2_G;
@@ -231,10 +232,13 @@
      * Check if matches Wi-Fi network template.
      */
     private boolean matchesWifi(NetworkIdentity ident) {
-        if (ident.mType == TYPE_WIFI) {
-            return true;
+        switch (ident.mType) {
+            case TYPE_WIFI:
+            case TYPE_WIFI_P2P:
+                return true;
+            default:
+                return false;
         }
-        return false;
     }
 
     /**
diff --git a/core/java/android/net/TrafficStats.java b/core/java/android/net/TrafficStats.java
index cd585b2..973fac1 100644
--- a/core/java/android/net/TrafficStats.java
+++ b/core/java/android/net/TrafficStats.java
@@ -20,7 +20,6 @@
 import android.app.backup.BackupManager;
 import android.content.Context;
 import android.media.MediaPlayer;
-import android.net.NetworkStats.NonMonotonicException;
 import android.os.RemoteException;
 import android.os.ServiceManager;
 
@@ -45,6 +44,13 @@
      */
     public final static int UNSUPPORTED = -1;
 
+    /** @hide */
+    public static final long KB_IN_BYTES = 1024;
+    /** @hide */
+    public static final long MB_IN_BYTES = KB_IN_BYTES * 1024;
+    /** @hide */
+    public static final long GB_IN_BYTES = MB_IN_BYTES * 1024;
+
     /**
      * Special UID value used when collecting {@link NetworkStatsHistory} for
      * removed applications.
@@ -193,15 +199,12 @@
                 throw new IllegalStateException("not profiling data");
             }
 
-            try {
-                // subtract starting values and return delta
-                final NetworkStats profilingStop = getDataLayerSnapshotForUid(context);
-                final NetworkStats profilingDelta = profilingStop.subtract(sActiveProfilingStart);
-                sActiveProfilingStart = null;
-                return profilingDelta;
-            } catch (NonMonotonicException e) {
-                throw new RuntimeException(e);
-            }
+            // subtract starting values and return delta
+            final NetworkStats profilingStop = getDataLayerSnapshotForUid(context);
+            final NetworkStats profilingDelta = NetworkStats.subtract(
+                    profilingStop, sActiveProfilingStart, null, null);
+            sActiveProfilingStart = null;
+            return profilingDelta;
         }
     }
 
diff --git a/core/java/android/net/Uri.java b/core/java/android/net/Uri.java
index 0fb49bc..defe7aa 100644
--- a/core/java/android/net/Uri.java
+++ b/core/java/android/net/Uri.java
@@ -28,6 +28,7 @@
 import java.util.Collections;
 import java.util.LinkedHashSet;
 import java.util.List;
+import java.util.Locale;
 import java.util.RandomAccess;
 import java.util.Set;
 import libcore.net.UriCodec;
@@ -1716,6 +1717,38 @@
         return (!"false".equals(flag) && !"0".equals(flag));
     }
 
+    /**
+     * Return a normalized representation of this Uri.
+     *
+     * <p>A normalized Uri has a lowercase scheme component.
+     * This aligns the Uri with Android best practices for
+     * intent filtering.
+     *
+     * <p>For example, "HTTP://www.android.com" becomes
+     * "http://www.android.com"
+     *
+     * <p>All URIs received from outside Android (such as user input,
+     * or external sources like Bluetooth, NFC, or the Internet) should
+     * be normalized before they are used to create an Intent.
+     *
+     * <p class="note">This method does <em>not</em> validate bad URI's,
+     * or 'fix' poorly formatted URI's - so do not use it for input validation.
+     * A Uri will always be returned, even if the Uri is badly formatted to
+     * begin with and a scheme component cannot be found.
+     *
+     * @return normalized Uri (never null)
+     * @see {@link android.content.Intent#setData}
+     * @see {@link #setNormalizedData}
+     */
+    public Uri normalize() {
+        String scheme = getScheme();
+        if (scheme == null) return this;  // give up
+        String lowerScheme = scheme.toLowerCase(Locale.US);
+        if (scheme.equals(lowerScheme)) return this;  // no change
+
+        return buildUpon().scheme(lowerScheme).build();
+    }
+
     /** Identifies a null parcelled Uri. */
     private static final int NULL_TYPE_ID = 0;
 
diff --git a/core/java/android/nfc/INfcAdapter.aidl b/core/java/android/nfc/INfcAdapter.aidl
index 0b93ad0..61bc324 100644
--- a/core/java/android/nfc/INfcAdapter.aidl
+++ b/core/java/android/nfc/INfcAdapter.aidl
@@ -17,7 +17,6 @@
 package android.nfc;
 
 import android.app.PendingIntent;
-import android.content.ComponentName;
 import android.content.IntentFilter;
 import android.nfc.NdefMessage;
 import android.nfc.Tag;
@@ -44,4 +43,6 @@
     void setForegroundDispatch(in PendingIntent intent,
             in IntentFilter[] filters, in TechListParcel techLists);
     void setForegroundNdefPush(in NdefMessage msg, in INdefPushCallback callback);
+
+    void dispatch(in Tag tag);
 }
diff --git a/core/java/android/nfc/LlcpPacket.aidl b/core/java/android/nfc/LlcpPacket.aidl
deleted file mode 100644
index 80f424d..0000000
--- a/core/java/android/nfc/LlcpPacket.aidl
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (C) 2010 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.nfc;
-
-/**
- * @hide
- */
-parcelable LlcpPacket;
\ No newline at end of file
diff --git a/core/java/android/nfc/LlcpPacket.java b/core/java/android/nfc/LlcpPacket.java
deleted file mode 100644
index 9919dc4..0000000
--- a/core/java/android/nfc/LlcpPacket.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2010 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.nfc;
-
-import android.os.Parcel;
-import android.os.Parcelable;
-
-/**
- * Represents a LLCP packet received in a LLCP Connectionless communication;
- * @hide
- */
-public class LlcpPacket implements Parcelable {
-
-    private final int mRemoteSap;
-
-    private final byte[] mDataBuffer;
-
-    /**
-     * Creates a LlcpPacket to be sent to a remote Service Access Point number
-     * (SAP)
-     *
-     * @param sap Remote Service Access Point number
-     * @param data Data buffer
-     */
-    public LlcpPacket(int sap, byte[] data) {
-        mRemoteSap = sap;
-        mDataBuffer = data;
-    }
-
-    /**
-     * Returns the remote Service Access Point number
-     */
-    public int getRemoteSap() {
-        return mRemoteSap;
-    }
-
-    /**
-     * Returns the data buffer
-     */
-    public byte[] getDataBuffer() {
-        return mDataBuffer;
-    }
-
-    public int describeContents() {
-        return 0;
-    }
-
-    public void writeToParcel(Parcel dest, int flags) {
-        dest.writeInt(mRemoteSap);
-        dest.writeInt(mDataBuffer.length);
-        dest.writeByteArray(mDataBuffer);
-    }
-
-    public static final Parcelable.Creator<LlcpPacket> CREATOR = new Parcelable.Creator<LlcpPacket>() {
-        public LlcpPacket createFromParcel(Parcel in) {
-            // Remote SAP
-            short sap = (short)in.readInt();
-
-            // Data Buffer
-            int dataLength = in.readInt();
-            byte[] data = new byte[dataLength];
-            in.readByteArray(data);
-
-            return new LlcpPacket(sap, data);
-        }
-
-        public LlcpPacket[] newArray(int size) {
-            return new LlcpPacket[size];
-        }
-    };
-}
\ No newline at end of file
diff --git a/core/java/android/nfc/NdefMessage.java b/core/java/android/nfc/NdefMessage.java
index 38bc16d..5df9272 100644
--- a/core/java/android/nfc/NdefMessage.java
+++ b/core/java/android/nfc/NdefMessage.java
@@ -92,9 +92,7 @@
      * @throws FormatException if the data cannot be parsed
      */
     public NdefMessage(byte[] data) throws FormatException {
-        if (data == null) {
-            throw new NullPointerException("null data");
-        }
+        if (data == null) throw new NullPointerException("data is null");
         ByteBuffer buffer = ByteBuffer.wrap(data);
 
         mRecords = NdefRecord.parse(buffer, false);
@@ -112,9 +110,8 @@
      */
     public NdefMessage(NdefRecord record, NdefRecord ... records) {
         // validate
-        if (record == null) {
-            throw new NullPointerException("record cannot be null");
-        }
+        if (record == null) throw new NullPointerException("record cannot be null");
+
         for (NdefRecord r : records) {
             if (r == null) {
                 throw new NullPointerException("record cannot be null");
@@ -147,7 +144,12 @@
 
     /**
      * Get the NDEF Records inside this NDEF Message.<p>
-     * An NDEF Message always has one or more NDEF Records.
+     * An {@link NdefMessage} always has one or more NDEF Records: so the
+     * following code to retrieve the first record is always safe
+     * (no need to check for null or array length >= 1):
+     * <pre>
+     * NdefRecord firstRecord = ndefMessage.getRecords()[0];
+     * </pre>
      *
      * @return array of one or more NDEF records.
      */
@@ -156,7 +158,28 @@
     }
 
     /**
-     * Return this NDEF MEssage as raw bytes.<p>
+     * Return the length of this NDEF Message if it is written to a byte array
+     * with {@link #toByteArray}.<p>
+     * An NDEF Message can be formatted to bytes in different ways
+     * depending on chunking, SR, and ID flags, so the length returned
+     * by this method may not be equal to the length of the original
+     * byte array used to construct this NDEF Message. However it will
+     * always be equal to the length of the byte array produced by
+     * {@link #toByteArray}.
+     *
+     * @return length of this NDEF Message when written to bytes with {@link #toByteArray}
+     * @see #toByteArray
+     */
+    public int getByteArrayLength() {
+        int length = 0;
+        for (NdefRecord r : mRecords) {
+            length += r.getByteLength();
+        }
+        return length;
+    }
+
+    /**
+     * Return this NDEF Message as raw bytes.<p>
      * The NDEF Message is formatted as per the NDEF 1.0 specification,
      * and the byte array is suitable for network transmission or storage
      * in an NFC Forum NDEF compatible tag.<p>
@@ -164,13 +187,10 @@
      * short record (SR) format and omit the identifier field when possible.
      *
      * @return NDEF Message in binary format
+     * @see getByteArrayLength
      */
     public byte[] toByteArray() {
-        int length = 0;
-        for (NdefRecord r : mRecords) {
-            length += r.getByteLength();
-        }
-
+        int length = getByteArrayLength();
         ByteBuffer buffer = ByteBuffer.allocate(length);
 
         for (int i=0; i<mRecords.length; i++) {
diff --git a/core/java/android/nfc/NdefRecord.java b/core/java/android/nfc/NdefRecord.java
index b4c488b..0e9e8f4 100644
--- a/core/java/android/nfc/NdefRecord.java
+++ b/core/java/android/nfc/NdefRecord.java
@@ -16,6 +16,7 @@
 
 package android.nfc;
 
+import android.content.Intent;
 import android.net.Uri;
 import android.os.Parcel;
 import android.os.Parcelable;
@@ -25,6 +26,7 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+import java.util.Locale;
 
 /**
  * Represents an immutable NDEF Record.
@@ -305,9 +307,9 @@
      * @return Android application NDEF record
      */
     public static NdefRecord createApplicationRecord(String packageName) {
-        if (packageName.length() == 0) {
-            throw new IllegalArgumentException("empty package name");
-        }
+        if (packageName == null) throw new NullPointerException("packageName is null");
+        if (packageName.length() == 0) throw new IllegalArgumentException("packageName is empty");
+
         return new NdefRecord(TNF_EXTERNAL_TYPE, RTD_ANDROID_APP, null,
                 packageName.getBytes(Charsets.UTF_8));
     }
@@ -318,32 +320,27 @@
      * Uses the well known URI type representation: {@link #TNF_WELL_KNOWN}
      * and {@link #RTD_URI}. This is the most efficient encoding
      * of a URI into NDEF.<p>
+     * The uri parameter will be normalized with
+     * {@link Uri#normalize} to set the scheme to lower case to
+     * follow Android best practices for intent filtering.
+     * However the unchecked exception
+     * {@link IllegalArgumentException} may be thrown if the uri
+     * parameter has serious problems, for example if it is empty, so always
+     * catch this exception if you are passing user-generated data into this
+     * method.<p>
+     *
      * Reference specification: NFCForum-TS-RTD_URI_1.0
      *
      * @param uri URI to encode.
      * @return an NDEF Record containing the URI
-     * @throws IllegalArugmentException if a valid record cannot be created
+     * @throws IllegalArugmentException if the uri is empty or invalid
      */
     public static NdefRecord createUri(Uri uri) {
-        return createUri(uri.toString());
-    }
+        if (uri == null) throw new NullPointerException("uri is null");
 
-    /**
-     * Create a new NDEF Record containing a URI.<p>
-     * Use this method to encode a URI (or URL) into an NDEF Record.<p>
-     * Uses the well known URI type representation: {@link #TNF_WELL_KNOWN}
-     * and {@link #RTD_URI}. This is the most efficient encoding
-     * of a URI into NDEF.<p>
-     * Reference specification: NFCForum-TS-RTD_URI_1.0
-     *
-     * @param uriString string URI to encode.
-     * @return an NDEF Record containing the URI
-     * @throws IllegalArugmentException if a valid record cannot be created
-     */
-    public static NdefRecord createUri(String uriString) {
-        if (uriString.length() == 0) {
-            throw new IllegalArgumentException("empty uriString");
-        }
+        uri = uri.normalize();
+        String uriString = uri.toString();
+        if (uriString.length() == 0) throw new IllegalArgumentException("uri is empty");
 
         byte prefix = 0;
         for (int i = 1; i < URI_PREFIX_MAP.length; i++) {
@@ -361,28 +358,72 @@
     }
 
     /**
+     * Create a new NDEF Record containing a URI.<p>
+     * Use this method to encode a URI (or URL) into an NDEF Record.<p>
+     * Uses the well known URI type representation: {@link #TNF_WELL_KNOWN}
+     * and {@link #RTD_URI}. This is the most efficient encoding
+     * of a URI into NDEF.<p>
+      * The uriString parameter will be normalized with
+     * {@link Uri#normalize} to set the scheme to lower case to
+     * follow Android best practices for intent filtering.
+     * However the unchecked exception
+     * {@link IllegalArgumentException} may be thrown if the uriString
+     * parameter has serious problems, for example if it is empty, so always
+     * catch this exception if you are passing user-generated data into this
+     * method.<p>
+     *
+     * Reference specification: NFCForum-TS-RTD_URI_1.0
+     *
+     * @param uriString string URI to encode.
+     * @return an NDEF Record containing the URI
+     * @throws IllegalArugmentException if the uriString is empty or invalid
+     */
+    public static NdefRecord createUri(String uriString) {
+        return createUri(Uri.parse(uriString));
+    }
+
+    /**
      * Create a new NDEF Record containing MIME data.<p>
      * Use this method to encode MIME-typed data into an NDEF Record,
      * such as "text/plain", or "image/jpeg".<p>
-     * Expects US-ASCII characters in mimeType. The encoding of the
-     * mimeData depends on the mimeType.<p>
+     * The mimeType parameter will be normalized with
+     * {@link Intent#normalizeMimeType} to follow Android best
+     * practices for intent filtering, for example to force lower-case.
+     * However the unchecked exception
+     * {@link IllegalArgumentException} may be thrown
+     * if the mimeType parameter has serious problems,
+     * for example if it is empty, so always catch this
+     * exception if you are passing user-generated data into this method.
+     * <p>
      * For efficiency, This method might not make an internal copy of the
      * mimeData byte array, so take care not
-     * to re-use the mimeData byte array while still using the returned
+     * to modify the mimeData byte array while still using the returned
      * NdefRecord.
      *
-     * @param mimeType MIME type, expects US-ASCII characters only
+     * @param mimeType a valid MIME type
      * @param mimeData MIME data as bytes
      * @return an NDEF Record containing the MIME-typed data
-     * @throws IllegalArugmentException if a valid record cannot be created
+     * @throws IllegalArugmentException if the mimeType is empty or invalid
+     *
      */
     public static NdefRecord createMime(String mimeType, byte[] mimeData) {
-        if (mimeType.length() == 0) {
-            throw new IllegalArgumentException("empty mimeType");
-        }
+        if (mimeType == null) throw new NullPointerException("mimeType is null");
 
-        return new NdefRecord(TNF_MIME_MEDIA, mimeType.getBytes(Charsets.US_ASCII), null,
-                mimeData);
+        // We only do basic MIME type validation: trying to follow the
+        // RFCs strictly only ends in tears, since there are lots of MIME
+        // types in common use that are not strictly valid as per RFC rules
+        mimeType = Intent.normalizeMimeType(mimeType);
+        if (mimeType.length() == 0) throw new IllegalArgumentException("mimeType is empty");
+        int slashIndex = mimeType.indexOf('/');
+        if (slashIndex == 0) throw new IllegalArgumentException("mimeType must have major type");
+        if (slashIndex == mimeType.length() - 1) {
+            throw new IllegalArgumentException("mimeType must have minor type");
+        }
+        // missing '/' is allowed
+
+        // MIME RFCs suggest ASCII encoding for content-type
+        byte[] typeBytes = mimeType.getBytes(Charsets.US_ASCII);
+        return new NdefRecord(TNF_MIME_MEDIA, typeBytes, null, mimeData);
     }
 
     /**
@@ -391,32 +432,38 @@
      * The data is typed by a domain name (usually your Android package name) and
      * a domain-specific type. This data is packaged into a "NFC Forum External
      * Type" NDEF Record.<p>
-     * Both the domain and type used to construct an external record are case
-     * insensitive, and this implementation will encode all characters to lower
-     * case. Only a subset of ASCII characters are allowed for the domain
-     * and type. There are no restrictions on the payload data.<p>
+     * NFC Forum requires that the domain and type used in an external record
+     * are treated as case insensitive, however Android intent filtering is
+     * always case sensitive. So this method will force the domain and type to
+     * lower-case before creating the NDEF Record.<p>
+     * The unchecked exception {@link IllegalArgumentException} will be thrown
+     * if the domain and type have serious problems, for example if either field
+     * is empty, so always catch this
+     * exception if you are passing user-generated data into this method.<p>
+     * There are no such restrictions on the payload data.<p>
      * For efficiency, This method might not make an internal copy of the
      * data byte array, so take care not
-     * to re-use the data byte array while still using the returned
+     * to modify the data byte array while still using the returned
      * NdefRecord.
      *
      * Reference specification: NFCForum-TS-RTD_1.0
      * @param domain domain-name of issuing organization
      * @param type domain-specific type of data
      * @param data payload as bytes
-     * @throws IllegalArugmentException if a valid record cannot be created
+     * @throws IllegalArugmentException if either domain or type are empty or invalid
      */
     public static NdefRecord createExternal(String domain, String type, byte[] data) {
-        if (domain.length() == 0 || type.length() == 0) {
-            throw new IllegalArgumentException("empty domain or type");
-        }
-        byte[] byteDomain = domain.getBytes(Charsets.US_ASCII);
-        ensureValidDomain(byteDomain);
-        toLowerCase(byteDomain);
-        byte[] byteType = type.getBytes(Charsets.US_ASCII);
-        ensureValidWkt(byteType);
-        toLowerCase(byteType);
+        if (domain == null) throw new NullPointerException("domain is null");
+        if (type == null) throw new NullPointerException("type is null");
 
+        domain = domain.trim().toLowerCase(Locale.US);
+        type = type.trim().toLowerCase(Locale.US);
+
+        if (domain.length() == 0) throw new IllegalArgumentException("domain is empty");
+        if (type.length() == 0) throw new IllegalArgumentException("type is empty");
+
+        byte[] byteDomain = domain.getBytes(Charsets.UTF_8);
+        byte[] byteType = type.getBytes(Charsets.UTF_8);
         byte[] b = new byte[byteDomain.length + 1 + byteType.length];
         System.arraycopy(byteDomain, 0, b, 0, byteDomain.length);
         b[byteDomain.length] = ':';
@@ -574,51 +621,113 @@
     }
 
     /**
-     * Helper to return the NdefRecord as a URI.
-     * TODO: Consider making a member method instead of static
-     * TODO: Consider more validation that this is a URI record
-     * TODO: Make a public API
-     * @hide
+     * Map this record to a MIME type, or return null if it cannot be mapped.<p>
+     * Currently this method considers all {@link #TNF_MIME_MEDIA} records to
+     * be MIME records, as well as some {@link #TNF_WELL_KNOWN} records such as
+     * {@link #RTD_TEXT}. If this is a MIME record then the MIME type as string
+     * is returned, otherwise null is returned.<p>
+     * This method does not perform validation that the MIME type is
+     * actually valid. It always attempts to
+     * return a string containing the type if this is a MIME record.<p>
+     * The returned MIME type will by normalized to lower-case using
+     * {@link Intent#normalizeMimeType}.<p>
+     * The MIME payload can be obtained using {@link #getPayload}.
+     *
+     * @return MIME type as a string, or null if this is not a MIME record
      */
-    public static Uri parseWellKnownUriRecord(NdefRecord record) throws FormatException {
-        byte[] payload = record.getPayload();
-        if (payload.length < 2) {
-            throw new FormatException("Payload is not a valid URI (missing prefix)");
+    public String toMimeType() {
+        switch (mTnf) {
+            case NdefRecord.TNF_WELL_KNOWN:
+                if (Arrays.equals(mType, NdefRecord.RTD_TEXT)) {
+                    return "text/plain";
+                }
+                break;
+            case NdefRecord.TNF_MIME_MEDIA:
+                String mimeType = new String(mType, Charsets.US_ASCII);
+                return Intent.normalizeMimeType(mimeType);
         }
-
-        /*
-         * payload[0] contains the URI Identifier Code, per the
-         * NFC Forum "URI Record Type Definition" section 3.2.2.
-         *
-         * payload[1]...payload[payload.length - 1] contains the rest of
-         * the URI.
-         */
-        int prefixIndex = (payload[0] & 0xff);
-        if (prefixIndex < 0 || prefixIndex >= URI_PREFIX_MAP.length) {
-            throw new FormatException("Payload is not a valid URI (invalid prefix)");
-        }
-        String prefix = URI_PREFIX_MAP[prefixIndex];
-        byte[] fullUri = concat(prefix.getBytes(Charsets.UTF_8),
-                Arrays.copyOfRange(payload, 1, payload.length));
-        return Uri.parse(new String(fullUri, Charsets.UTF_8));
-    }
-
-    private static byte[] concat(byte[]... arrays) {
-        int length = 0;
-        for (byte[] array : arrays) {
-            length += array.length;
-        }
-        byte[] result = new byte[length];
-        int pos = 0;
-        for (byte[] array : arrays) {
-            System.arraycopy(array, 0, result, pos, array.length);
-            pos += array.length;
-        }
-        return result;
+        return null;
     }
 
     /**
-     * Main parsing method.<p>
+     * Map this record to a URI, or return null if it cannot be mapped.<p>
+     * Currently this method considers the following to be URI records:
+     * <ul>
+     * <li>{@link #TNF_ABSOLUTE_URI} records.</li>
+     * <li>{@link #TNF_WELL_KNOWN} with a type of {@link #RTD_URI}.</li>
+     * <li>{@link #TNF_WELL_KNOWN} with a type of {@link #RTD_SMART_POSTER}
+     * and containing a URI record in the NDEF message nested in the payload.
+     * </li>
+     * <li>{@link #TNF_EXTERNAL_TYPE} records.</li>
+     * </ul>
+     * If this is not a URI record by the above rules, then null is returned.<p>
+     * This method does not perform validation that the URI is
+     * actually valid: it always attempts to create and return a URI if
+     * this record appears to be a URI record by the above rules.<p>
+     * The returned URI will be normalized to have a lower case scheme
+     * using {@link Uri#normalize}.<p>
+     *
+     * @return URI, or null if this is not a URI record
+     */
+    public Uri toUri() {
+        return toUri(false);
+    }
+
+    private Uri toUri(boolean inSmartPoster) {
+        switch (mTnf) {
+            case TNF_WELL_KNOWN:
+                if (Arrays.equals(mType, RTD_SMART_POSTER) && !inSmartPoster) {
+                    try {
+                        // check payload for a nested NDEF Message containing a URI
+                        NdefMessage nestedMessage = new NdefMessage(mPayload);
+                        for (NdefRecord nestedRecord : nestedMessage.getRecords()) {
+                            Uri uri = nestedRecord.toUri(true);
+                            if (uri != null) {
+                                return uri;
+                            }
+                        }
+                    } catch (FormatException e) {  }
+                } else if (Arrays.equals(mType, RTD_URI)) {
+                    return parseWktUri().normalize();
+                }
+                break;
+
+            case TNF_ABSOLUTE_URI:
+                Uri uri = Uri.parse(new String(mType, Charsets.UTF_8));
+                return uri.normalize();
+
+            case TNF_EXTERNAL_TYPE:
+                if (inSmartPoster) {
+                    break;
+                }
+                return Uri.parse("vnd.android.nfc://ext/" + new String(mType, Charsets.US_ASCII));
+        }
+        return null;
+    }
+
+    /**
+     * Return complete URI of {@link #TNF_WELL_KNOWN}, {@link #RTD_URI} records.
+     * @return complete URI, or null if invalid
+     */
+    private Uri parseWktUri() {
+        if (mPayload.length < 2) {
+            return null;
+        }
+
+        // payload[0] contains the URI Identifier Code, as per
+        // NFC Forum "URI Record Type Definition" section 3.2.2.
+        int prefixIndex = (mPayload[0] & (byte)0xFF);
+        if (prefixIndex < 0 || prefixIndex >= URI_PREFIX_MAP.length) {
+            return null;
+        }
+        String prefix = URI_PREFIX_MAP[prefixIndex];
+        String suffix = new String(Arrays.copyOfRange(mPayload, 1, mPayload.length),
+                Charsets.UTF_8);
+        return Uri.parse(prefix + suffix);
+    }
+
+    /**
+     * Main record parsing method.<p>
      * Expects NdefMessage to begin immediately, allows trailing data.<p>
      * Currently has strict validation of all fields as per NDEF 1.0
      * specification section 2.5. We will attempt to keep this as strict as
@@ -902,42 +1011,4 @@
         }
         return s;
     }
-
-    /** Ensure valid 'DNS-char' as per RFC2234 */
-    private static void ensureValidDomain(byte[] bs) {
-        for (int i = 0; i < bs.length; i++) {
-            byte b = bs[i];
-            if ((b >= 'A' && b <= 'Z') ||
-                    (b >= 'a' && b <= 'z') ||
-                    (b >= '0' && b <= '9') ||
-                    b == '.' || b == '-') {
-                continue;
-            }
-            throw new IllegalArgumentException("invalid character in domain");
-        }
-    }
-
-    /** Ensure valid 'WKT-char' as per RFC2234 */
-    private static void ensureValidWkt(byte[] bs) {
-        for (int i = 0; i < bs.length; i++) {
-            byte b = bs[i];
-            if ((b >= 'A' && b <= 'Z') ||
-                    (b >= 'a' && b <= 'z') ||
-                    (b >= '0' && b <= '9') ||
-                    b == '(' || b == ')' || b == '+' || b == ',' || b == '-' ||
-                    b == ':' || b == '=' || b == '@' || b == ';' || b == '$' ||
-                    b == '_' || b == '!' || b == '*' || b == '\'' || b == '.') {
-                continue;
-            }
-            throw new IllegalArgumentException("invalid character in type");
-        }
-    }
-
-    private static void toLowerCase(byte[] b) {
-        for (int i = 0; i < b.length; i++) {
-            if (b[i] >= 'A' && b[i] <= 'Z') {
-                b[i] += 0x20;
-            }
-        }
-    }
 }
diff --git a/core/java/android/nfc/NfcAdapter.java b/core/java/android/nfc/NfcAdapter.java
index 53a0341..5176857 100644
--- a/core/java/android/nfc/NfcAdapter.java
+++ b/core/java/android/nfc/NfcAdapter.java
@@ -66,6 +66,9 @@
      * <p>If the tag has an NDEF payload this intent is started before
      * {@link #ACTION_TECH_DISCOVERED}. If any activities respond to this intent neither
      * {@link #ACTION_TECH_DISCOVERED} or {@link #ACTION_TAG_DISCOVERED} will be started.
+     *
+     * <p>The MIME type or data URI of this intent are normalized before dispatch -
+     * so that MIME, URI scheme and URI host are always lower-case.
      */
     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
     public static final String ACTION_NDEF_DISCOVERED = "android.nfc.action.NDEF_DISCOVERED";
@@ -151,9 +154,13 @@
     public static final String EXTRA_TAG = "android.nfc.extra.TAG";
 
     /**
-     * Optional extra containing an array of {@link NdefMessage} present on the discovered tag for
-     * the {@link #ACTION_NDEF_DISCOVERED}, {@link #ACTION_TECH_DISCOVERED}, and
-     * {@link #ACTION_TAG_DISCOVERED} intents.
+     * Extra containing an array of {@link NdefMessage} present on the discovered tag.<p>
+     * This extra is mandatory for {@link #ACTION_NDEF_DISCOVERED} intents,
+     * and optional for {@link #ACTION_TECH_DISCOVERED}, and
+     * {@link #ACTION_TAG_DISCOVERED} intents.<p>
+     * When this extra is present there will always be at least one
+     * {@link NdefMessage} element. Most NDEF tags have only one NDEF message,
+     * but we use an array for future compatibility.
      */
     public static final String EXTRA_NDEF_MESSAGES = "android.nfc.extra.NDEF_MESSAGES";
 
@@ -386,10 +393,10 @@
      */
     @Deprecated
     public static NfcAdapter getDefaultAdapter() {
-        // introduce in API version 9 (GB 2.3)
+        // introduced in API version 9 (GB 2.3)
         // deprecated in API version 10 (GB 2.3.3)
         // removed from public API in version 16 (ICS MR2)
-        // will need to maintain this as a hidden API for a while longer...
+        // should maintain as a hidden API for binary compatibility for a little longer
         Log.w(TAG, "WARNING: NfcAdapter.getDefaultAdapter() is deprecated, use " +
                 "NfcAdapter.getDefaultAdapter(Context) instead", new Exception());
 
@@ -803,6 +810,7 @@
      * @throws IllegalStateException if the Activity has already been paused
      * @deprecated use {@link #setNdefPushMessage} instead
      */
+    @Deprecated
     public void disableForegroundNdefPush(Activity activity) {
         if (activity == null) {
             throw new NullPointerException();
@@ -875,6 +883,24 @@
     }
 
     /**
+     * Inject a mock NFC tag.<p>
+     * Used for testing purposes.
+     * <p class="note">Requires the
+     * {@link android.Manifest.permission#WRITE_SECURE_SETTINGS} permission.
+     * @hide
+     */
+    public void dispatch(Tag tag) {
+        if (tag == null) {
+            throw new NullPointerException("tag cannot be null");
+        }
+        try {
+            sService.dispatch(tag);
+        } catch (RemoteException e) {
+            attemptDeadServiceRecovery(e);
+        }
+    }
+
+    /**
      * @hide
      */
     public INfcAdapterExtras getNfcAdapterExtrasInterface() {
diff --git a/core/java/android/nfc/Tag.java b/core/java/android/nfc/Tag.java
index 9fe0bed..f9b765cb 100644
--- a/core/java/android/nfc/Tag.java
+++ b/core/java/android/nfc/Tag.java
@@ -108,14 +108,14 @@
  * <p>
  */
 public final class Tag implements Parcelable {
-    /*package*/ final byte[] mId;
-    /*package*/ final int[] mTechList;
-    /*package*/ final String[] mTechStringList;
-    /*package*/ final Bundle[] mTechExtras;
-    /*package*/ final int mServiceHandle;  // for use by NFC service, 0 indicates a mock
-    /*package*/ final INfcTag mTagService; // interface to NFC service, will be null if mock tag
+    final byte[] mId;
+    final int[] mTechList;
+    final String[] mTechStringList;
+    final Bundle[] mTechExtras;
+    final int mServiceHandle;  // for use by NFC service, 0 indicates a mock
+    final INfcTag mTagService; // interface to NFC service, will be null if mock tag
 
-    /*package*/ int mConnectedTechnology;
+    int mConnectedTechnology;
 
     /**
      * Hidden constructor to be used by NFC service and internal classes.
diff --git a/core/java/android/nfc/tech/BasicTagTechnology.java b/core/java/android/nfc/tech/BasicTagTechnology.java
index 913ae0e..b6b347c 100644
--- a/core/java/android/nfc/tech/BasicTagTechnology.java
+++ b/core/java/android/nfc/tech/BasicTagTechnology.java
@@ -18,7 +18,6 @@
 
 import android.nfc.ErrorCodes;
 import android.nfc.Tag;
-import android.nfc.TagLostException;
 import android.nfc.TransceiveResult;
 import android.os.RemoteException;
 import android.util.Log;
@@ -28,12 +27,13 @@
 /**
  * A base class for tag technologies that are built on top of transceive().
  */
-/* package */ abstract class BasicTagTechnology implements TagTechnology {
+abstract class BasicTagTechnology implements TagTechnology {
     private static final String TAG = "NFC";
 
-    /*package*/ final Tag mTag;
-    /*package*/ boolean mIsConnected;
-    /*package*/ int mSelectedTechnology;
+    final Tag mTag;
+
+    boolean mIsConnected;
+    int mSelectedTechnology;
 
     BasicTagTechnology(Tag tag, int tech) throws RemoteException {
         mTag = tag;
@@ -139,7 +139,7 @@
         }
     }
     /** Internal transceive */
-    /*package*/ byte[] transceive(byte[] data, boolean raw) throws IOException {
+    byte[] transceive(byte[] data, boolean raw) throws IOException {
         checkConnected();
 
         try {
diff --git a/core/java/android/os/AsyncTask.java b/core/java/android/os/AsyncTask.java
index 5e9abb7..fd6bed7 100644
--- a/core/java/android/os/AsyncTask.java
+++ b/core/java/android/os/AsyncTask.java
@@ -135,6 +135,8 @@
  * <p>There are a few threading rules that must be followed for this class to
  * work properly:</p>
  * <ul>
+ *     <li>The AsyncTask class must be loaded on the UI thread. This is done
+ *     automatically as of {@link android.os.Build.VERSION_CODES#JELLY_BEAN}.</li>
  *     <li>The task instance must be created on the UI thread.</li>
  *     <li>{@link #execute} must be invoked on the UI thread.</li>
  *     <li>Do not call {@link #onPreExecute()}, {@link #onPostExecute},
diff --git a/core/java/android/os/Binder.java b/core/java/android/os/Binder.java
index 24569fa..577fc43 100644
--- a/core/java/android/os/Binder.java
+++ b/core/java/android/os/Binder.java
@@ -49,6 +49,7 @@
     private static final boolean FIND_POTENTIAL_LEAKS = false;
     private static final String TAG = "Binder";
 
+    /* mObject is used by native code, do not remove or rename */
     private int mObject;
     private IInterface mOwner;
     private String mDescriptor;
@@ -70,7 +71,35 @@
      * incoming transaction, then its own uid is returned.
      */
     public static final native int getCallingUid();
-    
+
+    /**
+     * Return the original ID of the user assigned to the process that sent you the current
+     * transaction that is being processed. This uid can be used with higher-level system services
+     * to determine its identity and check permissions. If the current thread is not currently
+     * executing an incoming transaction, then its own uid is returned.
+     * <p/>
+     * This value cannot be reset by calls to {@link #clearCallingIdentity()}.
+     * @hide
+     */
+    public static final int getOrigCallingUid() {
+        if (UserId.MU_ENABLED) {
+            return getOrigCallingUidNative();
+        } else {
+            return getCallingUid();
+        }
+    }
+
+    private static final native int getOrigCallingUidNative();
+
+    /**
+     * Utility function to return the user id of the calling process.
+     * @return userId of the calling process, extracted from the callingUid
+     * @hide
+     */
+    public static final int getOrigCallingUser() {
+        return UserId.getUserId(getOrigCallingUid());
+    }
+
     /**
      * Reset the identity of the incoming IPC on the current thread.  This can
      * be useful if, while handling an incoming call, you will be calling
diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java
index 88fea91..c106092 100644
--- a/core/java/android/os/Build.java
+++ b/core/java/android/os/Build.java
@@ -167,6 +167,8 @@
          * medium density normal size screens unless otherwise indicated).
          * They can still explicitly specify screen support either way with the
          * supports-screens manifest tag.
+         * <li> {@link android.widget.TabHost} will use the new dark tab
+         * background design.
          * </ul>
          */
         public static final int DONUT = 4;
@@ -208,6 +210,13 @@
         
         /**
          * November 2010: Android 2.3
+         *
+         * <p>Applications targeting this or a later release will get these
+         * new changes in behavior:</p>
+         * <ul>
+         * <li> The application's notification icons will be shown on the new
+         * dark status bar background, so must be visible in this situation.
+         * </ul>
          */
         public static final int GINGERBREAD = 9;
         
@@ -224,14 +233,34 @@
          * <ul>
          * <li> The default theme for applications is now dark holographic:
          *      {@link android.R.style#Theme_Holo}.
+         * <li> On large screen devices that do not have a physical menu
+         * button, the soft (compatibility) menu is disabled.
          * <li> The activity lifecycle has changed slightly as per
          * {@link android.app.Activity}.
+         * <li> An application will crash if it does not call through
+         * to the super implementation of its
+         * {@link android.app.Activity#onPause Activity.onPause()} method.
          * <li> When an application requires a permission to access one of
          * its components (activity, receiver, service, provider), this
          * permission is no longer enforced when the application wants to
          * access its own component.  This means it can require a permission
          * on a component that it does not itself hold and still access that
          * component.
+         * <li> {@link android.content.Context#getSharedPreferences
+         * Context.getSharedPreferences()} will not automatically reload
+         * the preferences if they have changed on storage, unless
+         * {@link android.content.Context#MODE_MULTI_PROCESS} is used.
+         * <li> {@link android.view.ViewGroup#setMotionEventSplittingEnabled}
+         * will default to true.
+         * <li> {@link android.view.WindowManager.LayoutParams#FLAG_SPLIT_TOUCH}
+         * is enabled by default on windows.
+         * <li> {@link android.widget.PopupWindow#isSplitTouchEnabled()
+         * PopupWindow.isSplitTouchEnabled()} will return true by default.
+         * <li> {@link android.widget.GridView} and {@link android.widget.ListView}
+         * will use {@link android.view.View#setActivated View.setActivated}
+         * for selected items if they do not implement {@link android.widget.Checkable}.
+         * <li> {@link android.widget.Scroller} will be constructed with
+         * "flywheel" behavior enabled by default.
          * </ul>
          */
         public static final int HONEYCOMB = 11;
@@ -266,13 +295,26 @@
          * preferred over the older screen size buckets and for older devices
          * the appropriate buckets will be inferred from them.</p>
          *
-         * <p>New {@link android.content.pm.PackageManager#FEATURE_SCREEN_PORTRAIT}
+         * <p>Applications targeting this or a later release will get these
+         * new changes in behavior:</p>
+         * <ul>
+         * <li><p>New {@link android.content.pm.PackageManager#FEATURE_SCREEN_PORTRAIT}
          * and {@link android.content.pm.PackageManager#FEATURE_SCREEN_LANDSCAPE}
-         * features are introduced in this release.  Applications that target
+         * features were introduced in this release.  Applications that target
          * previous platform versions are assumed to require both portrait and
          * landscape support in the device; when targeting Honeycomb MR1 or
          * greater the application is responsible for specifying any specific
          * orientation it requires.</p>
+         * <li><p>{@link android.os.AsyncTask} will use the serial executor
+         * by default when calling {@link android.os.AsyncTask#execute}.</p>
+         * <li><p>{@link android.content.pm.ActivityInfo#configChanges
+         * ActivityInfo.configChanges} will have the
+         * {@link android.content.pm.ActivityInfo#CONFIG_SCREEN_SIZE} and
+         * {@link android.content.pm.ActivityInfo#CONFIG_SMALLEST_SCREEN_SIZE}
+         * bits set; these need to be cleared for older applications because
+         * some developers have done absolute comparisons against this value
+         * instead of correctly masking the bits they are interested in.
+         * </ul>
          */
         public static final int HONEYCOMB_MR2 = 13;
 
@@ -306,14 +348,31 @@
          * <li> The fadingEdge attribute on views will be ignored (fading edges is no
          * longer a standard part of the UI).  A new requiresFadingEdge attribute allows
          * applications to still force fading edges on for special cases.
+         * <li> {@link android.content.Context#bindService Context.bindService()}
+         * will not automatically add in {@link android.content.Context#BIND_WAIVE_PRIORITY}.
+         * <li> App Widgets will have standard padding automatically added around
+         * them, rather than relying on the padding being baked into the widget itself.
+         * <li> An exception will be thrown if you try to change the type of a
+         * window after it has been added to the window manager.  Previously this
+         * would result in random incorrect behavior.
+         * <li> {@link android.view.animation.AnimationSet} will parse out
+         * the duration, fillBefore, fillAfter, repeatMode, and startOffset
+         * XML attributes that are defined.
+         * <li> {@link android.app.ActionBar#setHomeButtonEnabled
+         * ActionBar.setHomeButtonEnabled()} is false by default.
          * </ul>
          */
         public static final int ICE_CREAM_SANDWICH = 14;
 
         /**
-         * Android 4.0.3.
+         * December 2011: Android 4.0.3.
          */
         public static final int ICE_CREAM_SANDWICH_MR1 = 15;
+
+        /**
+         * Next up on Android!
+         */
+        public static final int JELLY_BEAN = CUR_DEVELOPMENT;
     }
     
     /** The type of build, like "user" or "eng". */
diff --git a/core/java/android/os/IPowerManager.aidl b/core/java/android/os/IPowerManager.aidl
index 9a53d76..270e9be 100644
--- a/core/java/android/os/IPowerManager.aidl
+++ b/core/java/android/os/IPowerManager.aidl
@@ -45,4 +45,5 @@
     // sets the brightness of the backlights (screen, keyboard, button) 0-255
     void setBacklightBrightness(int brightness);
     void setAttentionLight(boolean on, int color);
+    void setAutoBrightnessAdjustment(float adj);
 }
diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java
index e1bc275..cdf235d 100644
--- a/core/java/android/os/Process.java
+++ b/core/java/android/os/Process.java
@@ -219,6 +219,36 @@
     public static final int THREAD_PRIORITY_LESS_FAVORABLE = +1;
 
     /**
+     * Default scheduling policy
+     * @hide
+     */
+    public static final int SCHED_OTHER = 0;
+
+    /**
+     * First-In First-Out scheduling policy
+     * @hide
+     */
+    public static final int SCHED_FIFO = 1;
+
+    /**
+     * Round-Robin scheduling policy
+     * @hide
+     */
+    public static final int SCHED_RR = 2;
+
+    /**
+     * Batch scheduling policy
+     * @hide
+     */
+    public static final int SCHED_BATCH = 3;
+
+    /**
+     * Idle scheduling policy
+     * @hide
+     */
+    public static final int SCHED_IDLE = 5;
+
+    /**
      * Default thread group - gets a 'normal' share of the CPU
      * @hide
      */
@@ -675,6 +705,24 @@
             throws IllegalArgumentException;
     
     /**
+     * Set the scheduling policy and priority of a thread, based on Linux.
+     *
+     * @param tid The identifier of the thread/process to change.
+     * @param policy A Linux scheduling policy such as SCHED_OTHER etc.
+     * @param priority A Linux priority level in a range appropriate for the given policy.
+     *
+     * @throws IllegalArgumentException Throws IllegalArgumentException if
+     * <var>tid</var> does not exist, or if <var>priority</var> is out of range for the policy.
+     * @throws SecurityException Throws SecurityException if your process does
+     * not have permission to modify the given thread, or to use the given
+     * scheduling policy or priority.
+     *
+     * {@hide}
+     */
+    public static final native void setThreadScheduler(int tid, int policy, int priority)
+            throws IllegalArgumentException;
+
+    /**
      * Determine whether the current environment supports multiple processes.
      * 
      * @return Returns true if the system can run in multiple processes, else
diff --git a/core/java/android/os/UserId.java b/core/java/android/os/UserId.java
new file mode 100644
index 0000000..4124d51
--- /dev/null
+++ b/core/java/android/os/UserId.java
@@ -0,0 +1,90 @@
+/*
+ * 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 android.os;
+
+/**
+ * @hide
+ */
+public final class UserId {
+    /**
+     * Range of IDs allocated for a user.
+     *
+     * @hide
+     */
+    public static final int PER_USER_RANGE = 100000;
+
+    public static final int USER_ALL = -1;
+
+    /**
+     * Enable multi-user related side effects. Set this to false if there are problems with single
+     * user usecases.
+     * */
+    public static final boolean MU_ENABLED = true;
+
+    /**
+     * Checks to see if the user id is the same for the two uids, i.e., they belong to the same
+     * user.
+     * @hide
+     */
+    public static final boolean isSameUser(int uid1, int uid2) {
+        return getUserId(uid1) == getUserId(uid2);
+    }
+
+    /**
+     * Checks to see if both uids are referring to the same app id, ignoring the user id part of the
+     * uids.
+     * @param uid1 uid to compare
+     * @param uid2 other uid to compare
+     * @return whether the appId is the same for both uids
+     * @hide
+     */
+    public static final boolean isSameApp(int uid1, int uid2) {
+        return getAppId(uid1) == getAppId(uid2);
+    }
+
+    /**
+     * Returns the user id for a given uid.
+     * @hide
+     */
+    public static final int getUserId(int uid) {
+        if (MU_ENABLED) {
+            return uid / PER_USER_RANGE;
+        } else {
+            return 0;
+        }
+    }
+
+    /**
+     * Returns the uid that is composed from the userId and the appId.
+     * @hide
+     */
+    public static final int getUid(int userId, int appId) {
+        if (MU_ENABLED) {
+            return userId * PER_USER_RANGE + (appId % PER_USER_RANGE);
+        } else {
+            return appId;
+        }
+    }
+
+    /**
+     * Returns the app id (or base uid) for a given uid, stripping out the user id from it.
+     * @hide
+     */
+    public static final int getAppId(int uid) {
+        return uid % PER_USER_RANGE;
+    }
+}
diff --git a/core/java/android/provider/MediaStore.java b/core/java/android/provider/MediaStore.java
index 4e01672..d3ad63d 100644
--- a/core/java/android/provider/MediaStore.java
+++ b/core/java/android/provider/MediaStore.java
@@ -62,6 +62,26 @@
     public static final String ACTION_MTP_SESSION_END = "android.provider.action.MTP_SESSION_END";
 
     /**
+     * The method name used by the media scanner and mtp to tell the media provider to
+     * rescan and reclassify that have become unhidden because of renaming folders or
+     * removing nomedia files
+     * @hide
+     */
+    public static final String UNHIDE_CALL = "unhide";
+
+    /**
+     * This is for internal use by the media scanner only.
+     * Name of the (optional) Uri parameter that determines whether to skip deleting
+     * the file pointed to by the _data column, when deleting the database entry.
+     * The only appropriate value for this parameter is "false", in which case the
+     * delete will be skipped. Note especially that setting this to true, or omitting
+     * the parameter altogether, will perform the default action, which is different
+     * for different types of media.
+     * @hide
+     */
+    public static final String PARAM_DELETE_DATA = "deletedata";
+
+    /**
      * Activity Action: Launch a music player.
      * The activity should be able to play, browse, or manipulate music files stored on the device.
      *
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 0202c47..375e5e4 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -747,7 +747,7 @@
             Cursor c = null;
             try {
                 c = cp.query(mUri, SELECT_VALUE, NAME_EQ_PLACEHOLDER,
-                             new String[]{name}, null);
+                             new String[]{name}, null, null);
                 if (c == null) {
                     Log.w(TAG, "Can't get key " + name + " from " + mUri);
                     return null;
@@ -1401,6 +1401,12 @@
         public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
 
         /**
+         * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
+         * or less (<0.0 >-1.0) bright.
+         */
+        public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
+
+        /**
          * SCREEN_BRIGHTNESS_MODE value for manual mode.
          */
         public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
@@ -1672,6 +1678,13 @@
         public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
 
         /**
+         * Scaling factor for Animator-based animations. This affects both the start delay and
+         * duration of all such animations. Setting to 0 will cause animations to end immediately.
+         * The default value is 1.
+         */
+        public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
+
+        /**
          * Scaling factor for normal window animations. Setting to 0 will disable window
          * animations.
          * @hide
@@ -1927,6 +1940,7 @@
             SCREEN_OFF_TIMEOUT,
             SCREEN_BRIGHTNESS,
             SCREEN_BRIGHTNESS_MODE,
+            SCREEN_AUTO_BRIGHTNESS_ADJ,
             VIBRATE_ON,
             MODE_RINGER,
             MODE_RINGER_STREAMS_AFFECTED,
@@ -2468,6 +2482,11 @@
             Uri.parse("content://" + AUTHORITY + "/secure");
 
         /**
+         * Whether user has enabled development settings.
+         */
+        public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
+
+        /**
          * Whether ADB is enabled.
          */
         public static final String ADB_ENABLED = "adb_enabled";
@@ -4104,17 +4123,38 @@
         /** {@hide} */
         public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
         /** {@hide} */
-        public static final String NETSTATS_PERSIST_THRESHOLD = "netstats_persist_threshold";
+        public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
         /** {@hide} */
-        public static final String NETSTATS_NETWORK_BUCKET_DURATION = "netstats_network_bucket_duration";
+        public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
         /** {@hide} */
-        public static final String NETSTATS_NETWORK_MAX_HISTORY = "netstats_network_max_history";
+        public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
+
+        /** {@hide} */
+        public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
+        /** {@hide} */
+        public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
+        /** {@hide} */
+        public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
+        /** {@hide} */
+        public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
+
         /** {@hide} */
         public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
         /** {@hide} */
-        public static final String NETSTATS_UID_MAX_HISTORY = "netstats_uid_max_history";
+        public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
         /** {@hide} */
-        public static final String NETSTATS_TAG_MAX_HISTORY = "netstats_tag_max_history";
+        public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
+        /** {@hide} */
+        public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
+
+        /** {@hide} */
+        public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration";
+        /** {@hide} */
+        public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes";
+        /** {@hide} */
+        public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
+        /** {@hide} */
+        public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
 
         /** Preferred NTP server. {@hide} */
         public static final String NTP_SERVER = "ntp_server";
diff --git a/core/java/android/provider/UserDictionary.java b/core/java/android/provider/UserDictionary.java
index 5a7ef85..a9b106a 100644
--- a/core/java/android/provider/UserDictionary.java
+++ b/core/java/android/provider/UserDictionary.java
@@ -40,6 +40,9 @@
     public static final Uri CONTENT_URI =
         Uri.parse("content://" + AUTHORITY);
 
+    private static final int FREQUENCY_MIN = 0;
+    private static final int FREQUENCY_MAX = 255;
+
     /**
      * Contains the user defined words.
      */
@@ -87,12 +90,24 @@
          */
         public static final String APP_ID = "appid";
 
-        /** The locale type to specify that the word is common to all locales. */
+        /**
+         * An optional shortcut for this word. When the shortcut is typed, supporting IMEs should
+         * suggest the word in this row as an alternate spelling too.
+         */
+        public static final String SHORTCUT = "shortcut";
+
+        /**
+         * @deprecated Use {@link #addWord(Context, String, int, String, Locale)}.
+         */
+        @Deprecated
         public static final int LOCALE_TYPE_ALL = 0;
-        
-        /** The locale type to specify that the word is for the current locale. */
+
+        /**
+         * @deprecated Use {@link #addWord(Context, String, int, String, Locale)}.
+         */
+        @Deprecated
         public static final int LOCALE_TYPE_CURRENT = 1;
-        
+
         /**
          * Sort by descending order of frequency.
          */
@@ -100,35 +115,65 @@
 
         /** Adds a word to the dictionary, with the given frequency and the specified
          *  specified locale type.
+         *
+         *  @deprecated Please use
+         *  {@link #addWord(Context, String, int, String, Locale)} instead.
+         *
          *  @param context the current application context
          *  @param word the word to add to the dictionary. This should not be null or
          *  empty.
          *  @param localeType the locale type for this word. It should be one of
          *  {@link #LOCALE_TYPE_ALL} or {@link #LOCALE_TYPE_CURRENT}.
          */
-        public static void addWord(Context context, String word, 
+        @Deprecated
+        public static void addWord(Context context, String word,
                 int frequency, int localeType) {
-            final ContentResolver resolver = context.getContentResolver();
 
-            if (TextUtils.isEmpty(word) || localeType < 0 || localeType > 1) {
+            if (localeType != LOCALE_TYPE_ALL && localeType != LOCALE_TYPE_CURRENT) {
                 return;
             }
-            
-            if (frequency < 0) frequency = 0;
-            if (frequency > 255) frequency = 255;
 
-            String locale = null;
+            final Locale locale;
 
-            // TODO: Verify if this is the best way to get the current locale
             if (localeType == LOCALE_TYPE_CURRENT) {
-                locale = Locale.getDefault().toString();
+                locale = Locale.getDefault();
+            } else {
+                locale = null;
             }
-            ContentValues values = new ContentValues(4);
+
+            addWord(context, word, frequency, null, locale);
+        }
+
+        /** Adds a word to the dictionary, with the given frequency and the specified
+         *  locale type.
+         *
+         *  @param context the current application context
+         *  @param word the word to add to the dictionary. This should not be null or
+         *  empty.
+         *  @param shortcut optional shortcut spelling for this word. When the shortcut
+         *  is typed, the word may be suggested by applications that support it. May be null.
+         *  @param locale the locale to insert the word for, or null to insert the word
+         *  for all locales.
+         */
+        public static void addWord(Context context, String word,
+                int frequency, String shortcut, Locale locale) {
+            final ContentResolver resolver = context.getContentResolver();
+
+            if (TextUtils.isEmpty(word)) {
+                return;
+            }
+
+            if (frequency < FREQUENCY_MIN) frequency = FREQUENCY_MIN;
+            if (frequency > FREQUENCY_MAX) frequency = FREQUENCY_MAX;
+
+            final int COLUMN_COUNT = 5;
+            ContentValues values = new ContentValues(COLUMN_COUNT);
 
             values.put(WORD, word);
             values.put(FREQUENCY, frequency);
-            values.put(LOCALE, locale);
+            values.put(LOCALE, null == locale ? null : locale.toString());
             values.put(APP_ID, 0); // TODO: Get App UID
+            values.put(SHORTCUT, shortcut);
 
             Uri result = resolver.insert(CONTENT_URI, values);
             // It's ok if the insert doesn't succeed because the word
diff --git a/core/java/android/server/BluetoothAdapterStateMachine.java b/core/java/android/server/BluetoothAdapterStateMachine.java
index ed59b03..7711caa 100644
--- a/core/java/android/server/BluetoothAdapterStateMachine.java
+++ b/core/java/android/server/BluetoothAdapterStateMachine.java
@@ -539,7 +539,7 @@
                     }
 
                     // we turn all the way to PowerOff with AIRPLANE_MODE_ON
-                    if (message.what == AIRPLANE_MODE_ON) {
+                    if (message.what == AIRPLANE_MODE_ON || mBluetoothService.isAirplaneModeOn()) {
                         // We inform all the per process callbacks
                         allProcessesCallback(false);
                         deferMessage(obtainMessage(AIRPLANE_MODE_ON));
diff --git a/core/java/android/server/BluetoothService.java b/core/java/android/server/BluetoothService.java
index 94fbbc8..fecc8f9 100755
--- a/core/java/android/server/BluetoothService.java
+++ b/core/java/android/server/BluetoothService.java
@@ -1706,7 +1706,7 @@
     }
 
     /* Returns true if airplane mode is currently on */
-    private final boolean isAirplaneModeOn() {
+    /*package*/ final boolean isAirplaneModeOn() {
         return Settings.System.getInt(mContext.getContentResolver(),
                 Settings.System.AIRPLANE_MODE_ON, 0) == 1;
     }
diff --git a/core/java/android/speech/tts/TextToSpeech.java b/core/java/android/speech/tts/TextToSpeech.java
index cd065ec..7a174af 100755
--- a/core/java/android/speech/tts/TextToSpeech.java
+++ b/core/java/android/speech/tts/TextToSpeech.java
@@ -486,6 +486,11 @@
     private final Object mStartLock = new Object();
 
     private String mRequestedEngine;
+    // Whether to initialize this TTS object with the default engine,
+    // if the requested engine is not available. Valid only if mRequestedEngine
+    // is not null. Used only for testing, though potentially useful API wise
+    // too.
+    private final boolean mUseFallback;
     private final Map<String, Uri> mEarcons;
     private final Map<String, Uri> mUtterances;
     private final Bundle mParams = new Bundle();
@@ -519,7 +524,7 @@
      * @param engine Package name of the TTS engine to use.
      */
     public TextToSpeech(Context context, OnInitListener listener, String engine) {
-        this(context, listener, engine, null);
+        this(context, listener, engine, null, true);
     }
 
     /**
@@ -529,10 +534,11 @@
      * @hide
      */
     public TextToSpeech(Context context, OnInitListener listener, String engine,
-            String packageName) {
+            String packageName, boolean useFallback) {
         mContext = context;
         mInitListener = listener;
         mRequestedEngine = engine;
+        mUseFallback = useFallback;
 
         mEarcons = new HashMap<String, Uri>();
         mUtterances = new HashMap<String, Uri>();
@@ -567,10 +573,21 @@
 
     private int initTts() {
         // Step 1: Try connecting to the engine that was requested.
-        if (mRequestedEngine != null && mEnginesHelper.isEngineInstalled(mRequestedEngine)) {
-            if (connectToEngine(mRequestedEngine)) {
-                mCurrentEngine = mRequestedEngine;
-                return SUCCESS;
+        if (mRequestedEngine != null) {
+            if (mEnginesHelper.isEngineInstalled(mRequestedEngine)) {
+                if (connectToEngine(mRequestedEngine)) {
+                    mCurrentEngine = mRequestedEngine;
+                    return SUCCESS;
+                } else if (!mUseFallback) {
+                    mCurrentEngine = null;
+                    dispatchOnInit(ERROR);
+                    return ERROR;
+                }
+            } else if (!mUseFallback) {
+                Log.i(TAG, "Requested engine not installed: " + mRequestedEngine);
+                mCurrentEngine = null;
+                dispatchOnInit(ERROR);
+                return ERROR;
             }
         }
 
diff --git a/core/java/android/text/MeasuredText.java b/core/java/android/text/MeasuredText.java
index c184c11..a52e2ba 100644
--- a/core/java/android/text/MeasuredText.java
+++ b/core/java/android/text/MeasuredText.java
@@ -109,6 +109,9 @@
             for (int i = 0; i < spans.length; i++) {
                 int startInPara = spanned.getSpanStart(spans[i]) - start;
                 int endInPara = spanned.getSpanEnd(spans[i]) - start;
+                // The span interval may be larger and must be restricted to [start, end[
+                if (startInPara < 0) startInPara = 0;
+                if (endInPara > len) endInPara = len;
                 for (int j = startInPara; j < endInPara; j++) {
                     mChars[j] = '\uFFFC';
                 }
diff --git a/core/java/android/text/format/Time.java b/core/java/android/text/format/Time.java
index b4445ca..e9b0d32 100644
--- a/core/java/android/text/format/Time.java
+++ b/core/java/android/text/format/Time.java
@@ -481,6 +481,9 @@
      * @throws android.util.TimeFormatException if s cannot be parsed.
      */
      public boolean parse3339(String s) {
+         if (s == null) {
+             throw new NullPointerException("time string is null");
+         }
          if (nativeParse3339(s)) {
              timezone = TIMEZONE_UTC;
              return true;
diff --git a/core/java/android/text/method/ArrowKeyMovementMethod.java b/core/java/android/text/method/ArrowKeyMovementMethod.java
index 4ec4bc4..30bb447 100644
--- a/core/java/android/text/method/ArrowKeyMovementMethod.java
+++ b/core/java/android/text/method/ArrowKeyMovementMethod.java
@@ -280,8 +280,6 @@
                 if (isSelecting(buffer)) {
                     buffer.removeSpan(LAST_TAP_DOWN);
                     Selection.extendSelection(buffer, offset);
-                } else if (!widget.shouldIgnoreActionUpEvent()) {
-                    Selection.setSelection(buffer, offset);
                 }
 
                 MetaKeyKeyListener.adjustMetaAfterKeypress(buffer);
diff --git a/core/java/android/text/style/SuggestionSpan.java b/core/java/android/text/style/SuggestionSpan.java
index 0f26a34..5dc206f 100644
--- a/core/java/android/text/style/SuggestionSpan.java
+++ b/core/java/android/text/style/SuggestionSpan.java
@@ -25,6 +25,7 @@
 import android.text.ParcelableSpan;
 import android.text.TextPaint;
 import android.text.TextUtils;
+import android.util.Log;
 import android.widget.TextView;
 
 import java.util.Arrays;
@@ -114,7 +115,7 @@
      * @param context Context for the application
      * @param locale locale Locale of the suggestions
      * @param suggestions Suggestions for the string under the span. Only the first up to
-     * {@link SuggestionSpan#SUGGESTIONS_MAX_SIZE} will be considered.
+     * {@link SuggestionSpan#SUGGESTIONS_MAX_SIZE} will be considered. Null values not permitted.
      * @param flags Additional flags indicating how this span is handled in TextView
      * @param notificationTargetClass if not null, this class will get notified when the user
      * selects one of the suggestions.
@@ -124,10 +125,13 @@
         final int N = Math.min(SUGGESTIONS_MAX_SIZE, suggestions.length);
         mSuggestions = Arrays.copyOf(suggestions, N);
         mFlags = flags;
-        if (context != null && locale == null) {
+        if (locale != null) {
+            mLocaleString = locale.toString();
+        } else if (context != null) {
             mLocaleString = context.getResources().getConfiguration().locale.toString();
         } else {
-            mLocaleString = locale.toString();
+            Log.e("SuggestionSpan", "No locale or context specified in SuggestionSpan constructor");
+            mLocaleString = "";
         }
 
         if (notificationTargetClass != null) {
diff --git a/core/java/android/util/DisplayMetrics.java b/core/java/android/util/DisplayMetrics.java
index 519b980..a43d36c 100644
--- a/core/java/android/util/DisplayMetrics.java
+++ b/core/java/android/util/DisplayMetrics.java
@@ -57,6 +57,13 @@
     public static final int DENSITY_XHIGH = 320;
 
     /**
+     * Standard quantized DPI for extra-extra-high-density screens.  Applications
+     * should not generally worry about this density; relying on XHIGH graphics
+     * being scaled up to it should be sufficient for almost all cases.
+     */
+    public static final int DENSITY_XXHIGH = 480;
+
+    /**
      * The reference density used throughout the system.
      */
     public static final int DENSITY_DEFAULT = DENSITY_MEDIUM;
diff --git a/core/java/android/util/LocalLog.java b/core/java/android/util/LocalLog.java
new file mode 100644
index 0000000..641d1b4
--- /dev/null
+++ b/core/java/android/util/LocalLog.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2006 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;
+
+import android.text.format.Time;
+
+import java.io.FileDescriptor;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Iterator;
+import java.util.LinkedList;
+
+/**
+ * @hide
+ */
+public final class LocalLog {
+
+    private LinkedList<String> mLog;
+    private int mMaxLines;
+    private Time mNow;
+
+    public LocalLog(int maxLines) {
+        mLog = new LinkedList<String>();
+        mMaxLines = maxLines;
+        mNow = new Time();
+    }
+
+    public synchronized void log(String msg) {
+        if (mMaxLines > 0) {
+            mNow.setToNow();
+            mLog.add(mNow.format("%H:%M:%S") + " - " + msg);
+            while (mLog.size() > mMaxLines) mLog.remove();
+        }
+    }
+
+    public synchronized void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
+        Iterator<String> itr = mLog.listIterator(0);
+        while (itr.hasNext()) {
+            pw.println(itr.next());
+        }
+    }
+}
diff --git a/core/java/android/util/LruCache.java b/core/java/android/util/LruCache.java
index f1014a7..51e373c 100644
--- a/core/java/android/util/LruCache.java
+++ b/core/java/android/util/LruCache.java
@@ -86,6 +86,23 @@
     }
 
     /**
+     * Sets the size of the cache.
+     * @param maxSize The new maximum size.
+     *
+     * @hide
+     */
+    public void resize(int maxSize) {
+        if (maxSize <= 0) {
+            throw new IllegalArgumentException("maxSize <= 0");
+        }
+
+        synchronized (this) {
+            this.maxSize = maxSize;
+        }
+        trimToSize(maxSize);
+    }
+
+    /**
      * Returns the value for {@code key} if it exists in the cache or can be
      * created by {@code #create}. If a value was returned, it is moved to the
      * head of the queue. This returns null if a value is not cached and cannot
diff --git a/core/java/android/view/AccessibilityNodeInfoCache.java b/core/java/android/view/AccessibilityNodeInfoCache.java
new file mode 100644
index 0000000..244a491
--- /dev/null
+++ b/core/java/android/view/AccessibilityNodeInfoCache.java
@@ -0,0 +1,171 @@
+/*
+ * 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.view;
+
+import android.util.LongSparseArray;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
+
+/**
+ * Simple cache for AccessibilityNodeInfos. The cache is mapping an
+ * accessibility id to an info. The cache allows storing of
+ * <code>null</code> values. It also tracks accessibility events
+ * and invalidates accordingly.
+ *
+ * @hide
+ */
+public class AccessibilityNodeInfoCache {
+
+    private final boolean ENABLED = true;
+
+    /**
+     * @return A new <strong>not synchronized</strong> AccessibilityNodeInfoCache.
+     */
+    public static AccessibilityNodeInfoCache newAccessibilityNodeInfoCache() {
+        return new AccessibilityNodeInfoCache();
+    }
+
+    /**
+     * @return A new <strong>synchronized</strong> AccessibilityNodeInfoCache.
+     */
+    public static AccessibilityNodeInfoCache newSynchronizedAccessibilityNodeInfoCache() {
+        return new AccessibilityNodeInfoCache() {
+            private final Object mLock = new Object();
+
+            @Override
+            public void clear() {
+                synchronized(mLock) {
+                    super.clear();
+                }
+            }
+
+            @Override
+            public AccessibilityNodeInfo get(long accessibilityNodeId) {
+                synchronized(mLock) {
+                    return super.get(accessibilityNodeId);
+                }
+            }
+
+            @Override
+            public void put(long accessibilityNodeId, AccessibilityNodeInfo info) {
+                synchronized(mLock) {
+                   super.put(accessibilityNodeId, info);
+                }
+            }
+
+            @Override
+            public void remove(long accessibilityNodeId) {
+                synchronized(mLock) {
+                   super.remove(accessibilityNodeId);
+                }
+            }
+        };
+    }
+
+    private final LongSparseArray<AccessibilityNodeInfo> mCacheImpl;
+
+    private AccessibilityNodeInfoCache() {
+        if (ENABLED) {
+            mCacheImpl = new LongSparseArray<AccessibilityNodeInfo>();
+        } else {
+            mCacheImpl = null;
+        }
+    }
+
+    /**
+     * The cache keeps track of {@link AccessibilityEvent}s and invalidates
+     * cached nodes as appropriate.
+     *
+     * @param event An event.
+     */
+    public void onAccessibilityEvent(AccessibilityEvent event) {
+        final int eventType = event.getEventType();
+        switch (eventType) {
+            case AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED:
+            case AccessibilityEvent.TYPE_VIEW_SCROLLED:
+                clear();
+                break;
+            case AccessibilityEvent.TYPE_VIEW_FOCUSED:
+            case AccessibilityEvent.TYPE_VIEW_SELECTED:
+            case AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED:
+            case AccessibilityEvent.TYPE_VIEW_TEXT_SELECTION_CHANGED:
+                final long accessibilityNodeId = event.getSourceNodeId();
+                remove(accessibilityNodeId);
+                break;
+        }
+    }
+
+    /**
+     * Gets a cached {@link AccessibilityNodeInfo} given its accessibility node id.
+     *
+     * @param accessibilityNodeId The info accessibility node id.
+     * @return The cached {@link AccessibilityNodeInfo} or null if such not found.
+     */
+    public AccessibilityNodeInfo get(long accessibilityNodeId) {
+        if (ENABLED) {
+            return mCacheImpl.get(accessibilityNodeId);
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Caches an {@link AccessibilityNodeInfo} given its accessibility node id.
+     *
+     * @param accessibilityNodeId The info accessibility node id.
+     * @param info The {@link AccessibilityNodeInfo} to cache.
+     */
+    public void put(long accessibilityNodeId, AccessibilityNodeInfo info) {
+        if (ENABLED) {
+            mCacheImpl.put(accessibilityNodeId, info);
+        }
+    }
+
+    /**
+     * Returns whether the cache contains an accessibility node id key.
+     *
+     * @param accessibilityNodeId The key for which to check.
+     * @return True if the key is in the cache.
+     */
+    public boolean containsKey(long accessibilityNodeId) {
+        if (ENABLED) {
+            return (mCacheImpl.indexOfKey(accessibilityNodeId) >= 0);
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * Removes a cached {@link AccessibilityNodeInfo}.
+     *
+     * @param accessibilityNodeId The info accessibility node id.
+     */
+    public void remove(long accessibilityNodeId) {
+        if (ENABLED) {
+            mCacheImpl.remove(accessibilityNodeId);
+        }
+    }
+
+    /**
+     * Clears the cache.
+     */
+    public void clear() {
+        if (ENABLED) {
+            mCacheImpl.clear();
+        }
+    }
+}
diff --git a/core/java/android/view/ActionMode.java b/core/java/android/view/ActionMode.java
index 34e7d4d..0349a2b 100644
--- a/core/java/android/view/ActionMode.java
+++ b/core/java/android/view/ActionMode.java
@@ -18,9 +18,15 @@
 
 
 /**
- * Represents a contextual mode of the user interface. Action modes can be used for
- * modal interactions with content and replace parts of the normal UI until finished.
- * Examples of good action modes include selection modes, search, content editing, etc.
+ * Represents a contextual mode of the user interface. Action modes can be used to provide
+ * alternative interaction modes and replace parts of the normal UI until finished.
+ * Examples of good action modes include text selection and contextual actions.
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For information about how to provide contextual actions with {@code ActionMode},
+ * read the <a href="{@docRoot}guide/topics/ui/menu.html#context-menu">Menus</a>
+ * developer guide.</p>
+ * </div>
  */
 public abstract class ActionMode {
     private Object mTag;
diff --git a/core/java/android/view/Choreographer.java b/core/java/android/view/Choreographer.java
index 63de128..3ee275c 100644
--- a/core/java/android/view/Choreographer.java
+++ b/core/java/android/view/Choreographer.java
@@ -26,7 +26,11 @@
 import android.util.Log;
 
 /**
- * Coodinates animations and drawing for UI on a particular thread.
+ * Coordinates animations and drawing for UI on a particular thread.
+ *
+ * This object is thread-safe.  Other threads can add and remove listeners
+ * or schedule work to occur at a later time on the UI thread.
+ *
  * @hide
  */
 public final class Choreographer extends Handler {
@@ -44,7 +48,7 @@
     private static final long DEFAULT_FRAME_DELAY = 10;
 
     // The number of milliseconds between animation frames.
-    private static long sFrameDelay = DEFAULT_FRAME_DELAY;
+    private static volatile long sFrameDelay = DEFAULT_FRAME_DELAY;
 
     // Thread local storage for the choreographer.
     private static final ThreadLocal<Choreographer> sThreadInstance =
@@ -75,6 +79,8 @@
     private static final int MSG_DO_ANIMATION = 0;
     private static final int MSG_DO_DRAW = 1;
 
+    private final Object mLock = new Object();
+
     private final Looper mLooper;
 
     private OnAnimateListener[] mOnAnimateListeners;
@@ -94,8 +100,8 @@
     }
 
     /**
-     * Gets the choreographer for this thread.
-     * Must be called on the UI thread.
+     * Gets the choreographer for the calling thread.  Must be called from
+     * a thread that already has a {@link android.os.Looper} associated with it.
      *
      * @return The choreographer for this thread.
      * @throws IllegalStateException if the thread does not have a looper.
@@ -138,9 +144,14 @@
 
     /**
      * Schedules animation (and drawing) to occur on the next frame synchronization boundary.
-     * Must be called on the UI thread.
      */
     public void scheduleAnimation() {
+        synchronized (mLock) {
+            scheduleAnimationLocked();
+        }
+    }
+
+    private void scheduleAnimationLocked() {
         if (!mAnimationScheduled) {
             mAnimationScheduled = true;
             if (USE_VSYNC) {
@@ -163,23 +174,47 @@
     }
 
     /**
+     * Returns true if {@link #scheduleAnimation()} has been called but
+     * {@link OnAnimateListener#onAnimate() OnAnimateListener.onAnimate()} has
+     * not yet been called.
+     */
+    public boolean isAnimationScheduled() {
+        synchronized (mLock) {
+            return mAnimationScheduled;
+        }
+    }
+
+    /**
      * Schedules drawing to occur on the next frame synchronization boundary.
      * Must be called on the UI thread.
      */
     public void scheduleDraw() {
-        if (!mDrawScheduled) {
-            mDrawScheduled = true;
-            if (USE_ANIMATION_TIMER_FOR_DRAW) {
-                scheduleAnimation();
-            } else {
-                if (DEBUG) {
-                    Log.d(TAG, "Scheduling draw immediately.");
+        synchronized (mLock) {
+            if (!mDrawScheduled) {
+                mDrawScheduled = true;
+                if (USE_ANIMATION_TIMER_FOR_DRAW) {
+                    scheduleAnimationLocked();
+                } else {
+                    if (DEBUG) {
+                        Log.d(TAG, "Scheduling draw immediately.");
+                    }
+                    sendEmptyMessage(MSG_DO_DRAW);
                 }
-                sendEmptyMessage(MSG_DO_DRAW);
             }
         }
     }
 
+    /**
+     * Returns true if {@link #scheduleDraw()} has been called but
+     * {@link OnDrawListener#onDraw() OnDrawListener.onDraw()} has
+     * not yet been called.
+     */
+    public boolean isDrawScheduled() {
+        synchronized (mLock) {
+            return mDrawScheduled;
+        }
+    }
+
     @Override
     public void handleMessage(Message msg) {
         switch (msg.what) {
@@ -193,60 +228,75 @@
     }
 
     private void doAnimation() {
-        if (mAnimationScheduled) {
-            mAnimationScheduled = false;
-
-            final long start = SystemClock.uptimeMillis();
-            if (DEBUG) {
-                Log.d(TAG, "Performing animation: " + Math.max(0, start - mLastAnimationTime)
-                        + " ms have elapsed since previous animation.");
-            }
-            mLastAnimationTime = start;
-
-            final OnAnimateListener[] listeners = mOnAnimateListeners;
-            if (listeners != null) {
-                for (int i = 0; i < listeners.length; i++) {
-                    listeners[i].onAnimate();
-                }
-            }
-
-            if (DEBUG) {
-                Log.d(TAG, "Animation took " + (SystemClock.uptimeMillis() - start) + " ms.");
-            }
-        }
+        doAnimationInner();
 
         if (USE_ANIMATION_TIMER_FOR_DRAW) {
             doDraw();
         }
     }
 
+    private void doAnimationInner() {
+        final long start;
+        final OnAnimateListener[] listeners;
+        synchronized (mLock) {
+            if (!mAnimationScheduled) {
+                return; // no work to do
+            }
+            mAnimationScheduled = false;
+
+            start = SystemClock.uptimeMillis();
+            if (DEBUG) {
+                Log.d(TAG, "Performing animation: " + Math.max(0, start - mLastAnimationTime)
+                        + " ms have elapsed since previous animation.");
+            }
+            mLastAnimationTime = start;
+
+            listeners = mOnAnimateListeners;
+        }
+
+        if (listeners != null) {
+            for (int i = 0; i < listeners.length; i++) {
+                listeners[i].onAnimate();
+            }
+        }
+
+        if (DEBUG) {
+            Log.d(TAG, "Animation took " + (SystemClock.uptimeMillis() - start) + " ms.");
+        }
+    }
+
     private void doDraw() {
-        if (mDrawScheduled) {
+        final long start;
+        final OnDrawListener[] listeners;
+        synchronized (mLock) {
+            if (!mDrawScheduled) {
+                return; // no work to do
+            }
             mDrawScheduled = false;
 
-            final long start = SystemClock.uptimeMillis();
+            start = SystemClock.uptimeMillis();
             if (DEBUG) {
                 Log.d(TAG, "Performing draw: " + Math.max(0, start - mLastDrawTime)
                         + " ms have elapsed since previous draw.");
             }
             mLastDrawTime = start;
 
-            final OnDrawListener[] listeners = mOnDrawListeners;
-            if (listeners != null) {
-                for (int i = 0; i < listeners.length; i++) {
-                    listeners[i].onDraw();
-                }
-            }
+            listeners = mOnDrawListeners;
+        }
 
-            if (DEBUG) {
-                Log.d(TAG, "Draw took " + (SystemClock.uptimeMillis() - start) + " ms.");
+        if (listeners != null) {
+            for (int i = 0; i < listeners.length; i++) {
+                listeners[i].onDraw();
             }
         }
+
+        if (DEBUG) {
+            Log.d(TAG, "Draw took " + (SystemClock.uptimeMillis() - start) + " ms.");
+        }
     }
 
     /**
      * Adds an animation listener.
-     * Must be called on the UI thread.
      *
      * @param listener The listener to add.
      */
@@ -259,13 +309,14 @@
             Log.d(TAG, "Adding onAnimate listener: " + listener);
         }
 
-        mOnAnimateListeners = ArrayUtils.appendElement(OnAnimateListener.class,
-                mOnAnimateListeners, listener);
+        synchronized (mLock) {
+            mOnAnimateListeners = ArrayUtils.appendElement(OnAnimateListener.class,
+                    mOnAnimateListeners, listener);
+        }
     }
 
     /**
      * Removes an animation listener.
-     * Must be called on the UI thread.
      *
      * @param listener The listener to remove.
      */
@@ -278,14 +329,15 @@
             Log.d(TAG, "Removing onAnimate listener: " + listener);
         }
 
-        mOnAnimateListeners = ArrayUtils.removeElement(OnAnimateListener.class,
-                mOnAnimateListeners, listener);
-        stopTimingLoopIfNoListeners();
+        synchronized (mLock) {
+            mOnAnimateListeners = ArrayUtils.removeElement(OnAnimateListener.class,
+                    mOnAnimateListeners, listener);
+            stopTimingLoopIfNoListenersLocked();
+        }
     }
 
     /**
      * Adds a draw listener.
-     * Must be called on the UI thread.
      *
      * @param listener The listener to add.
      */
@@ -298,8 +350,10 @@
             Log.d(TAG, "Adding onDraw listener: " + listener);
         }
 
-        mOnDrawListeners = ArrayUtils.appendElement(OnDrawListener.class,
-                mOnDrawListeners, listener);
+        synchronized (mLock) {
+            mOnDrawListeners = ArrayUtils.appendElement(OnDrawListener.class,
+                    mOnDrawListeners, listener);
+        }
     }
 
     /**
@@ -317,12 +371,14 @@
             Log.d(TAG, "Removing onDraw listener: " + listener);
         }
 
-        mOnDrawListeners = ArrayUtils.removeElement(OnDrawListener.class,
-                mOnDrawListeners, listener);
-        stopTimingLoopIfNoListeners();
+        synchronized (mLock) {
+            mOnDrawListeners = ArrayUtils.removeElement(OnDrawListener.class,
+                    mOnDrawListeners, listener);
+            stopTimingLoopIfNoListenersLocked();
+        }
     }
 
-    private void stopTimingLoopIfNoListeners() {
+    private void stopTimingLoopIfNoListenersLocked() {
         if (mOnDrawListeners == null && mOnAnimateListeners == null) {
             if (DEBUG) {
                 Log.d(TAG, "Stopping timing loop.");
diff --git a/core/java/android/view/DisplayList.java b/core/java/android/view/DisplayList.java
index 8f4ece0..fec0d4b 100644
--- a/core/java/android/view/DisplayList.java
+++ b/core/java/android/view/DisplayList.java
@@ -32,20 +32,20 @@
      * 
      * @return A canvas to record drawing operations.
      */
-    abstract HardwareCanvas start();
+    public abstract HardwareCanvas start();
 
     /**
      * Ends the recording for this display list. A display list cannot be
      * replayed if recording is not finished. 
      */
-    abstract void end();
+    public abstract void end();
 
     /**
      * Invalidates the display list, indicating that it should be repopulated
      * with new drawing commands prior to being used again. Calling this method
      * causes calls to {@link #isValid()} to return <code>false</code>.
      */
-    abstract void invalidate();
+    public abstract void invalidate();
 
     /**
      * Returns whether the display list is currently usable. If this returns false,
@@ -53,12 +53,12 @@
      *
      * @return boolean true if the display list is able to be replayed, false otherwise.
      */
-    abstract boolean isValid();
+    public abstract boolean isValid();
 
     /**
      * Return the amount of memory used by this display list.
      * 
      * @return The size of this display list in bytes
      */
-    abstract int getSize();
+    public abstract int getSize();
 }
diff --git a/core/java/android/view/GLES20Canvas.java b/core/java/android/view/GLES20Canvas.java
index 43a451d..1e92b43 100644
--- a/core/java/android/view/GLES20Canvas.java
+++ b/core/java/android/view/GLES20Canvas.java
@@ -22,6 +22,7 @@
 import android.graphics.DrawFilter;
 import android.graphics.Matrix;
 import android.graphics.Paint;
+import android.graphics.PaintFlagsDrawFilter;
 import android.graphics.Path;
 import android.graphics.Picture;
 import android.graphics.PorterDuff;
@@ -61,6 +62,7 @@
     private final float[] mLine = new float[4];
     
     private final Rect mClipBounds = new Rect();
+    private final RectF mPathBounds = new RectF();
 
     private DrawFilter mFilter;
 
@@ -187,7 +189,7 @@
     }
 
     private static native int nGetMaximumTextureWidth();
-    private static native int nGetMaximumTextureHeight();    
+    private static native int nGetMaximumTextureHeight();
 
     ///////////////////////////////////////////////////////////////////////////
     // Setup
@@ -247,7 +249,7 @@
     private static native void nDisableVsync();
 
     @Override
-    void onPreDraw(Rect dirty) {
+    public void onPreDraw(Rect dirty) {
         if (dirty != null) {
             nPrepareDirty(mRenderer, dirty.left, dirty.top, dirty.right, dirty.bottom, mOpaque);
         } else {
@@ -260,12 +262,30 @@
             boolean opaque);
 
     @Override
-    void onPostDraw() {
+    public void onPostDraw() {
         nFinish(mRenderer);
     }
 
     private static native void nFinish(int renderer);
 
+    /**
+     * Returns the size of the stencil buffer required by the underlying
+     * implementation.
+     * 
+     * @return The minimum number of bits the stencil buffer must. Always >= 0.
+     * 
+     * @hide
+     */
+    public static int getStencilSize() {
+        return nGetStencilSize();
+    }
+
+    private static native int nGetStencilSize();
+
+    ///////////////////////////////////////////////////////////////////////////
+    // Functor
+    ///////////////////////////////////////////////////////////////////////////
+
     @Override
     public boolean callDrawGLFunction(int drawGLFunction) {
         return nCallDrawGLFunction(mRenderer, drawGLFunction);
@@ -273,7 +293,6 @@
 
     private static native boolean nCallDrawGLFunction(int renderer, int drawGLFunction);
 
-
     ///////////////////////////////////////////////////////////////////////////
     // Memory
     ///////////////////////////////////////////////////////////////////////////
@@ -359,6 +378,12 @@
 
     private static native int nGetDisplayListSize(int displayList);
 
+    static void setDisplayListName(int displayList, String name) {
+        nSetDisplayListName(displayList, name);
+    }
+
+    private static native void nSetDisplayListName(int displayList, String name);
+
     @Override
     public boolean drawDisplayList(DisplayList displayList, int width, int height, Rect dirty) {
         return nDrawDisplayList(mRenderer,
@@ -406,12 +431,18 @@
 
     @Override
     public boolean clipPath(Path path) {
-        throw new UnsupportedOperationException();
+        // TODO: Implement
+        path.computeBounds(mPathBounds, true);
+        return nClipRect(mRenderer, mPathBounds.left, mPathBounds.top,
+                mPathBounds.right, mPathBounds.bottom, Region.Op.INTERSECT.nativeInt);
     }
 
     @Override
     public boolean clipPath(Path path, Region.Op op) {
-        throw new UnsupportedOperationException();
+        // TODO: Implement
+        path.computeBounds(mPathBounds, true);
+        return nClipRect(mRenderer, mPathBounds.left, mPathBounds.top,
+                mPathBounds.right, mPathBounds.bottom, op.nativeInt);
     }
 
     @Override
@@ -459,12 +490,18 @@
 
     @Override
     public boolean clipRegion(Region region) {
-        throw new UnsupportedOperationException();
+        // TODO: Implement
+        region.getBounds(mClipBounds);
+        return nClipRect(mRenderer, mClipBounds.left, mClipBounds.top,
+                mClipBounds.right, mClipBounds.bottom, Region.Op.INTERSECT.nativeInt);
     }
 
     @Override
     public boolean clipRegion(Region region, Region.Op op) {
-        throw new UnsupportedOperationException();
+        // TODO: Implement
+        region.getBounds(mClipBounds);
+        return nClipRect(mRenderer, mClipBounds.left, mClipBounds.top,
+                mClipBounds.right, mClipBounds.bottom, op.nativeInt);
     }
 
     @Override
@@ -484,12 +521,14 @@
 
     @Override
     public boolean quickReject(Path path, EdgeType type) {
-        throw new UnsupportedOperationException();
+        path.computeBounds(mPathBounds, true);
+        return nQuickReject(mRenderer, mPathBounds.left, mPathBounds.top,
+                mPathBounds.right, mPathBounds.bottom, type.nativeInt);
     }
 
     @Override
     public boolean quickReject(RectF rect, EdgeType type) {
-        return quickReject(rect.left, rect.top, rect.right, rect.bottom, type);
+        return nQuickReject(mRenderer, rect.left, rect.top, rect.right, rect.bottom, type.nativeInt);
     }
 
     ///////////////////////////////////////////////////////////////////////////
@@ -531,6 +570,7 @@
     
     private static native void nSetMatrix(int renderer, int matrix);
 
+    @SuppressWarnings("deprecation")
     @Override
     public void getMatrix(Matrix matrix) {
         nGetMatrix(mRenderer, matrix.native_instance);
@@ -643,8 +683,17 @@
     @Override
     public void setDrawFilter(DrawFilter filter) {
         mFilter = filter;
+        if (filter == null) {
+            nResetPaintFilter(mRenderer);
+        } else if (filter instanceof PaintFlagsDrawFilter) {
+            PaintFlagsDrawFilter flagsFilter = (PaintFlagsDrawFilter) filter;
+            nSetupPaintFilter(mRenderer, flagsFilter.clearBits, flagsFilter.setBits);
+        }
     }
 
+    private static native void nResetPaintFilter(int renderer);
+    private static native void nSetupPaintFilter(int renderer, int clearBits, int setBits);
+
     @Override
     public DrawFilter getDrawFilter() {
         return mFilter;
@@ -674,6 +723,7 @@
 
     @Override
     public void drawPatch(Bitmap bitmap, byte[] chunks, RectF dst, Paint paint) {
+        if (bitmap.isRecycled()) throw new IllegalArgumentException("Cannot draw recycled bitmaps");
         // Shaders are ignored when drawing patches
         int modifier = paint != null ? setupColorFilter(paint) : MODIFIER_NONE;
         final int nativePaint = paint == null ? 0 : paint.mNativePaint;
@@ -687,6 +737,7 @@
 
     @Override
     public void drawBitmap(Bitmap bitmap, float left, float top, Paint paint) {
+        if (bitmap.isRecycled()) throw new IllegalArgumentException("Cannot draw recycled bitmaps");
         // Shaders are ignored when drawing bitmaps
         int modifiers = paint != null ? setupModifiers(bitmap, paint) : MODIFIER_NONE;
         final int nativePaint = paint == null ? 0 : paint.mNativePaint;
@@ -699,6 +750,7 @@
 
     @Override
     public void drawBitmap(Bitmap bitmap, Matrix matrix, Paint paint) {
+        if (bitmap.isRecycled()) throw new IllegalArgumentException("Cannot draw recycled bitmaps");
         // Shaders are ignored when drawing bitmaps
         int modifiers = paint != null ? setupModifiers(bitmap, paint) : MODIFIER_NONE;
         final int nativePaint = paint == null ? 0 : paint.mNativePaint;
@@ -712,6 +764,7 @@
 
     @Override
     public void drawBitmap(Bitmap bitmap, Rect src, Rect dst, Paint paint) {
+        if (bitmap.isRecycled()) throw new IllegalArgumentException("Cannot draw recycled bitmaps");
         // Shaders are ignored when drawing bitmaps
         int modifiers = paint != null ? setupModifiers(bitmap, paint) : MODIFIER_NONE;
         final int nativePaint = paint == null ? 0 : paint.mNativePaint;
@@ -735,6 +788,7 @@
 
     @Override
     public void drawBitmap(Bitmap bitmap, Rect src, RectF dst, Paint paint) {
+        if (bitmap.isRecycled()) throw new IllegalArgumentException("Cannot draw recycled bitmaps");
         // Shaders are ignored when drawing bitmaps
         int modifiers = paint != null ? setupModifiers(bitmap, paint) : MODIFIER_NONE;
         final int nativePaint = paint == null ? 0 : paint.mNativePaint;
@@ -783,6 +837,7 @@
     @Override
     public void drawBitmapMesh(Bitmap bitmap, int meshWidth, int meshHeight, float[] verts,
             int vertOffset, int[] colors, int colorOffset, Paint paint) {
+        if (bitmap.isRecycled()) throw new IllegalArgumentException("Cannot draw recycled bitmaps");
         if (meshWidth < 0 || meshHeight < 0 || vertOffset < 0 || colorOffset < 0) {
             throw new ArrayIndexOutOfBoundsException();
         }
@@ -893,17 +948,42 @@
 
     @Override
     public void drawPicture(Picture picture) {
-        throw new UnsupportedOperationException();
+        if (picture.createdFromStream) {
+            return;
+        }
+
+        picture.endRecording();
+        // TODO: Implement rendering
     }
 
     @Override
     public void drawPicture(Picture picture, Rect dst) {
-        throw new UnsupportedOperationException();
+        if (picture.createdFromStream) {
+            return;
+        }
+
+        save();
+        translate(dst.left, dst.top);
+        if (picture.getWidth() > 0 && picture.getHeight() > 0) {
+            scale(dst.width() / picture.getWidth(), dst.height() / picture.getHeight());
+        }
+        drawPicture(picture);
+        restore();
     }
 
     @Override
     public void drawPicture(Picture picture, RectF dst) {
-        throw new UnsupportedOperationException();
+        if (picture.createdFromStream) {
+            return;
+        }
+
+        save();
+        translate(dst.left, dst.top);
+        if (picture.getWidth() > 0 && picture.getHeight() > 0) {
+            scale(dst.width() / picture.getWidth(), dst.height() / picture.getHeight());
+        }
+        drawPicture(picture);
+        restore();
     }
 
     @Override
@@ -928,16 +1008,42 @@
     private static native void nDrawPoints(int renderer, float[] points,
             int offset, int count, int paint);
 
+    @SuppressWarnings("deprecation")
     @Override
     public void drawPosText(char[] text, int index, int count, float[] pos, Paint paint) {
-        // TODO: Implement
+        if (index < 0 || index + count > text.length || count * 2 > pos.length) {
+            throw new IndexOutOfBoundsException();
+        }
+
+        int modifiers = setupModifiers(paint);
+        try {
+            nDrawPosText(mRenderer, text, index, count, pos, paint.mNativePaint);
+        } finally {
+            if (modifiers != MODIFIER_NONE) nResetModifiers(mRenderer, modifiers);
+        }
     }
 
+    private static native void nDrawPosText(int renderer, char[] text, int index, int count,
+            float[] pos, int paint);
+
+    @SuppressWarnings("deprecation")
     @Override
     public void drawPosText(String text, float[] pos, Paint paint) {
-        // TODO: Implement
+        if (text.length() * 2 > pos.length) {
+            throw new ArrayIndexOutOfBoundsException();
+        }
+
+        int modifiers = setupModifiers(paint);
+        try {
+            nDrawPosText(mRenderer, text, 0, text.length(), pos, paint.mNativePaint);
+        } finally {
+            if (modifiers != MODIFIER_NONE) nResetModifiers(mRenderer, modifiers);
+        }
     }
 
+    private static native void nDrawPosText(int renderer, String text, int start, int end,
+            float[] pos, int paint);
+
     @Override
     public void drawRect(float left, float top, float right, float bottom, Paint paint) {
         int modifiers = setupModifiers(paint);
diff --git a/core/java/android/view/GLES20DisplayList.java b/core/java/android/view/GLES20DisplayList.java
index 4ca5e98..969c9ab 100644
--- a/core/java/android/view/GLES20DisplayList.java
+++ b/core/java/android/view/GLES20DisplayList.java
@@ -31,10 +31,17 @@
     private GLES20RecordingCanvas mCanvas;
     private boolean mValid;
 
+    // Used for debugging
+    private final String mName;
+
     // The native display list will be destroyed when this object dies.
     // DO NOT overwrite this reference once it is set.
     private DisplayListFinalizer mFinalizer;
 
+    GLES20DisplayList(String name) {
+        mName = name;
+    }
+
     int getNativeDisplayList() {
         if (!mValid || mFinalizer == null) {
             throw new IllegalStateException("The display list is not valid.");
@@ -43,7 +50,7 @@
     }
 
     @Override
-    HardwareCanvas start() {
+    public HardwareCanvas start() {
         if (mCanvas != null) {
             throw new IllegalStateException("Recording has already started");
         }
@@ -55,7 +62,7 @@
     }
 
     @Override
-    void invalidate() {
+    public void invalidate() {
         if (mCanvas != null) {
             mCanvas.recycle();
             mCanvas = null;
@@ -64,17 +71,18 @@
     }
 
     @Override
-    boolean isValid() {
+    public boolean isValid() {
         return mValid;
     }
 
     @Override
-    void end() {
+    public void end() {
         if (mCanvas != null) {
             if (mFinalizer != null) {
                 mCanvas.end(mFinalizer.mNativeDisplayList);
             } else {
                 mFinalizer = new DisplayListFinalizer(mCanvas.end(0));
+                GLES20Canvas.setDisplayListName(mFinalizer.mNativeDisplayList, mName);
             }
             mCanvas.recycle();
             mCanvas = null;
@@ -83,7 +91,7 @@
     }
 
     @Override
-    int getSize() {
+    public int getSize() {
         if (mFinalizer == null) return 0;
         return GLES20Canvas.getDisplayListSize(mFinalizer.mNativeDisplayList);
     }
diff --git a/core/java/android/view/HardwareCanvas.java b/core/java/android/view/HardwareCanvas.java
index 23b3abc..cbdbbde 100644
--- a/core/java/android/view/HardwareCanvas.java
+++ b/core/java/android/view/HardwareCanvas.java
@@ -42,12 +42,12 @@
      * 
      * @param dirty The dirty rectangle to update, can be null.
      */
-    abstract void onPreDraw(Rect dirty);
+    public abstract void onPreDraw(Rect dirty);
 
     /**
      * Invoked after all drawing operation have been performed.
      */
-    abstract void onPostDraw();
+    public abstract void onPostDraw();
     
     /**
      * Draws the specified display list onto this canvas.
@@ -61,7 +61,7 @@
      * @return True if the content of the display list requires another
      *         drawing pass (invalidate()), false otherwise
      */
-    abstract boolean drawDisplayList(DisplayList displayList, int width, int height, Rect dirty);
+    public abstract boolean drawDisplayList(DisplayList displayList, int width, int height, Rect dirty);
 
     /**
      * Outputs the specified display list to the log. This method exists for use by
diff --git a/core/java/android/view/HardwareRenderer.java b/core/java/android/view/HardwareRenderer.java
index 3f793bb..9e8a228 100644
--- a/core/java/android/view/HardwareRenderer.java
+++ b/core/java/android/view/HardwareRenderer.java
@@ -238,6 +238,15 @@
     private static native void nSetupShadersDiskCache(String cacheFile);
 
     /**
+     * Notifies EGL that the frame is about to be rendered.
+     */
+    private static void beginFrame() {
+        nBeginFrame();
+    }
+
+    private static native void nBeginFrame();
+
+    /**
      * Interface used to receive callbacks whenever a view is drawn by
      * a hardware renderer instance.
      */
@@ -274,9 +283,12 @@
      * Creates a new display list that can be used to record batches of
      * drawing operations.
      * 
+     * @param name The name of the display list, used for debugging purpose.
+     *             May be null
+     * 
      * @return A new display list.
      */
-    abstract DisplayList createDisplayList();
+    public abstract DisplayList createDisplayList(String name);
 
     /**
      * Creates a new hardware layer. A hardware layer built by calling this
@@ -316,14 +328,13 @@
      * potentially lost the hardware renderer. The hardware renderer should be
      * reinitialized and setup when the render {@link #isRequested()} and
      * {@link #isEnabled()}.
-     * 
+     *
      * @param width The width of the drawing surface.
      * @param height The height of the drawing surface.
-     * @param attachInfo The 
-     * @param holder
+     * @param holder The target surface
      */
-    void initializeIfNeeded(int width, int height, View.AttachInfo attachInfo,
-            SurfaceHolder holder) throws Surface.OutOfResourcesException {
+    void initializeIfNeeded(int width, int height, SurfaceHolder holder)
+            throws Surface.OutOfResourcesException {
         if (isRequested()) {
             // We lost the gl context, so recreate it.
             if (!isEnabled()) {
@@ -809,6 +820,7 @@
         }        
         
         void onPreDraw(Rect dirty) {
+            
         }
 
         void onPostDraw() {
@@ -833,6 +845,8 @@
                         dirty = null;
                     }
 
+                    beginFrame();
+
                     onPreDraw(dirty);
 
                     HardwareCanvas canvas = mCanvas;
@@ -1036,7 +1050,7 @@
                     EGL_BLUE_SIZE, 8,
                     EGL_ALPHA_SIZE, 8,
                     EGL_DEPTH_SIZE, 0,
-                    EGL_STENCIL_SIZE, 0,
+                    EGL_STENCIL_SIZE, GLES20Canvas.getStencilSize(),
                     EGL_SURFACE_TYPE, EGL_WINDOW_BIT |
                             (dirtyRegions ? EGL_SWAP_BEHAVIOR_PRESERVED_BIT : 0),
                     EGL_NONE
@@ -1083,8 +1097,8 @@
         }
 
         @Override
-        DisplayList createDisplayList() {
-            return new GLES20DisplayList();
+        public DisplayList createDisplayList(String name) {
+            return new GLES20DisplayList(name);
         }
 
         @Override
diff --git a/core/java/android/view/IWindowManager.aidl b/core/java/android/view/IWindowManager.aidl
index 93a9d50..c54d09e 100644
--- a/core/java/android/view/IWindowManager.aidl
+++ b/core/java/android/view/IWindowManager.aidl
@@ -229,4 +229,9 @@
      * Device has a software navigation bar (separate from the status bar).
      */
     boolean hasNavigationBar();
+
+    /**
+     * Lock the device immediately.
+     */
+    void lockNow();
 }
diff --git a/core/java/android/view/VelocityTracker.java b/core/java/android/view/VelocityTracker.java
index dfb2c32..1c35e31 100644
--- a/core/java/android/view/VelocityTracker.java
+++ b/core/java/android/view/VelocityTracker.java
@@ -29,7 +29,7 @@
  * to begin tracking.  Put the motion events you receive into it with
  * {@link #addMovement(MotionEvent)}.  When you want to determine the velocity call
  * {@link #computeCurrentVelocity(int)} and then call {@link #getXVelocity(int)}
- * and {@link #getXVelocity(int)} to retrieve the velocity for each pointer id.
+ * and {@link #getYVelocity(int)} to retrieve the velocity for each pointer id.
  */
 public final class VelocityTracker implements Poolable<VelocityTracker> {
     private static final Pool<VelocityTracker> sPool = Pools.synchronizedPool(
@@ -39,6 +39,7 @@
                 }
 
                 public void onAcquired(VelocityTracker element) {
+                    // Intentionally empty
                 }
 
                 public void onReleased(VelocityTracker element) {
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 64f862a..7658d04 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -2166,15 +2166,13 @@
         float mScaleY = 1f;
 
         /**
-         * The amount of scale in the x direction around the pivot point. A
-         * value of 1 means no scaling is applied.
+         * The x location of the point around which the view is rotated and scaled.
          */
         @ViewDebug.ExportedProperty
         float mPivotX = 0f;
 
         /**
-         * The amount of scale in the y direction around the pivot point. A
-         * value of 1 means no scaling is applied.
+         * The y location of the point around which the view is rotated and scaled.
          */
         @ViewDebug.ExportedProperty
         float mPivotY = 0f;
@@ -3761,8 +3759,14 @@
     }
 
     /**
-     * Called when this view wants to give up focus. This will cause
-     * {@link #onFocusChanged(boolean, int, android.graphics.Rect)} to be called.
+     * Called when this view wants to give up focus. If focus is cleared
+     * {@link #onFocusChanged(boolean, int, android.graphics.Rect)} is called.
+     * <p>
+     * <strong>Note:</strong> When a View clears focus the framework is trying
+     * to give focus to the first focusable View from the top. Hence, if this
+     * View is the first from the top that can take focus, then its focus will
+     * not be cleared nor will the focus change callback be invoked.
+     * </p>
      */
     public void clearFocus() {
         if (DBG) {
@@ -3770,6 +3774,14 @@
         }
 
         if ((mPrivateFlags & FOCUSED) != 0) {
+            // If this is the first focusable do not clear focus since the we
+            // try to give it focus every time a view clears its focus. Hence,
+            // the view that would gain focus already has it.
+            View firstFocusable = getFirstFocusable();
+            if (firstFocusable == this) {
+                return;
+            }
+
             mPrivateFlags &= ~FOCUSED;
 
             if (mParent != null) {
@@ -3778,9 +3790,24 @@
 
             onFocusChanged(false, 0, null);
             refreshDrawableState();
+
+            // The view cleared focus and invoked the callbacks, so  now is the
+            // time to give focus to the the first focusable to ensure that the
+            // gain focus is announced after clear focus.
+            if (firstFocusable != null) {
+                firstFocusable.requestFocus(FOCUS_FORWARD);
+            }
         }
     }
 
+    private View getFirstFocusable() {
+        ViewRootImpl viewRoot = getViewRootImpl();
+        if (viewRoot != null) {
+            return viewRoot.focusSearch(null, FOCUS_FORWARD);
+        }
+        return null;
+    }
+
     /**
      * Called to clear the focus of a view that is about to be removed.
      * Doesn't call clearChildFocus, which prevents this view from taking
@@ -4107,7 +4134,7 @@
      */
     void onInitializeAccessibilityEventInternal(AccessibilityEvent event) {
         event.setSource(this);
-        event.setClassName(getClass().getName());
+        event.setClassName(View.class.getName());
         event.setPackageName(getContext().getPackageName());
         event.setEnabled(isEnabled());
         event.setContentDescription(mContentDescription);
@@ -4212,7 +4239,7 @@
         }
 
         info.setPackageName(mContext.getPackageName());
-        info.setClassName(getClass().getName());
+        info.setClassName(View.class.getName());
         info.setContentDescription(getContentDescription());
 
         info.setEnabled(isEnabled());
@@ -6822,7 +6849,8 @@
 
         if ((changed & VISIBILITY_MASK) != 0) {
             if (mParent instanceof ViewGroup) {
-                ((ViewGroup) mParent).onChildVisibilityChanged(this, (flags & VISIBILITY_MASK));
+                ((ViewGroup) mParent).onChildVisibilityChanged(this, (changed & VISIBILITY_MASK),
+                        (flags & VISIBILITY_MASK));
                 ((View) mParent).invalidate(true);
             } else if (mParent != null) {
                 mParent.invalidateChild(this, null);
@@ -7282,6 +7310,7 @@
      * 
      * @return The degrees of rotation.
      */
+    @ViewDebug.ExportedProperty(category = "drawing")
     public float getRotation() {
         return mTransformationInfo != null ? mTransformationInfo.mRotation : 0;
     }
@@ -7323,6 +7352,7 @@
      * 
      * @return The degrees of Y rotation.
      */
+    @ViewDebug.ExportedProperty(category = "drawing")
     public float getRotationY() {
         return mTransformationInfo != null ? mTransformationInfo.mRotationY : 0;
     }
@@ -7369,6 +7399,7 @@
      * 
      * @return The degrees of X rotation.
      */
+    @ViewDebug.ExportedProperty(category = "drawing")
     public float getRotationX() {
         return mTransformationInfo != null ? mTransformationInfo.mRotationX : 0;
     }
@@ -7416,6 +7447,7 @@
      * @see #getPivotY()
      * @return The scaling factor.
      */
+    @ViewDebug.ExportedProperty(category = "drawing")
     public float getScaleX() {
         return mTransformationInfo != null ? mTransformationInfo.mScaleX : 1;
     }
@@ -7454,6 +7486,7 @@
      * @see #getPivotY()
      * @return The scaling factor.
      */
+    @ViewDebug.ExportedProperty(category = "drawing")
     public float getScaleY() {
         return mTransformationInfo != null ? mTransformationInfo.mScaleY : 1;
     }
@@ -7492,6 +7525,7 @@
      * @see #getPivotY()
      * @return The x location of the pivot point.
      */
+    @ViewDebug.ExportedProperty(category = "drawing")
     public float getPivotX() {
         return mTransformationInfo != null ? mTransformationInfo.mPivotX : 0;
     }
@@ -7536,6 +7570,7 @@
      * @see #getPivotY()
      * @return The y location of the pivot point.
      */
+    @ViewDebug.ExportedProperty(category = "drawing")
     public float getPivotY() {
         return mTransformationInfo != null ? mTransformationInfo.mPivotY : 0;
     }
@@ -7576,6 +7611,7 @@
      * <p>By default this is 1.0f.
      * @return The opacity of the view.
      */
+    @ViewDebug.ExportedProperty(category = "drawing")
     public float getAlpha() {
         return mTransformationInfo != null ? mTransformationInfo.mAlpha : 1;
     }
@@ -7589,6 +7625,10 @@
      * equivalent to calling {@link #setLayerType(int, android.graphics.Paint)} and
      * setting a hardware layer.</p>
      *
+     * <p>Note that setting alpha to a translucent value (0 < alpha < 1) may have
+     * performance implications. It is generally best to use the alpha property sparingly and
+     * transiently, as in the case of fading animations.</p>
+     *
      * @param alpha The opacity of the view.
      *
      * @see #setLayerType(int, android.graphics.Paint)
@@ -7597,15 +7637,17 @@
      */
     public void setAlpha(float alpha) {
         ensureTransformationInfo();
-        mTransformationInfo.mAlpha = alpha;
-        invalidateParentCaches();
-        if (onSetAlpha((int) (alpha * 255))) {
-            mPrivateFlags |= ALPHA_SET;
-            // subclass is handling alpha - don't optimize rendering cache invalidation
-            invalidate(true);
-        } else {
-            mPrivateFlags &= ~ALPHA_SET;
-            invalidate(false);
+        if (mTransformationInfo.mAlpha != alpha) {
+            mTransformationInfo.mAlpha = alpha;
+            invalidateParentCaches();
+            if (onSetAlpha((int) (alpha * 255))) {
+                mPrivateFlags |= ALPHA_SET;
+                // subclass is handling alpha - don't optimize rendering cache invalidation
+                invalidate(true);
+            } else {
+                mPrivateFlags &= ~ALPHA_SET;
+                invalidate(false);
+            }
         }
     }
 
@@ -7616,18 +7658,22 @@
      * alpha (the return value for onSetAlpha()).
      *
      * @param alpha The new value for the alpha property
-     * @return true if the View subclass handles alpha (the return value for onSetAlpha())
+     * @return true if the View subclass handles alpha (the return value for onSetAlpha()) and
+     *         the new value for the alpha property is different from the old value
      */
     boolean setAlphaNoInvalidation(float alpha) {
         ensureTransformationInfo();
-        mTransformationInfo.mAlpha = alpha;
-        boolean subclassHandlesAlpha = onSetAlpha((int) (alpha * 255));
-        if (subclassHandlesAlpha) {
-            mPrivateFlags |= ALPHA_SET;
-        } else {
-            mPrivateFlags &= ~ALPHA_SET;
+        if (mTransformationInfo.mAlpha != alpha) {
+            mTransformationInfo.mAlpha = alpha;
+            boolean subclassHandlesAlpha = onSetAlpha((int) (alpha * 255));
+            if (subclassHandlesAlpha) {
+                mPrivateFlags |= ALPHA_SET;
+                return true;
+            } else {
+                mPrivateFlags &= ~ALPHA_SET;
+            }
         }
-        return subclassHandlesAlpha;
+        return false;
     }
 
     /**
@@ -7880,6 +7926,7 @@
      *
      * @return The visual x position of this view, in pixels.
      */
+    @ViewDebug.ExportedProperty(category = "drawing")
     public float getX() {
         return mLeft + (mTransformationInfo != null ? mTransformationInfo.mTranslationX : 0);
     }
@@ -7902,6 +7949,7 @@
      *
      * @return The visual y position of this view, in pixels.
      */
+    @ViewDebug.ExportedProperty(category = "drawing")
     public float getY() {
         return mTop + (mTransformationInfo != null ? mTransformationInfo.mTranslationY : 0);
     }
@@ -7925,6 +7973,7 @@
      *
      * @return The horizontal position of this view relative to its left position, in pixels.
      */
+    @ViewDebug.ExportedProperty(category = "drawing")
     public float getTranslationX() {
         return mTransformationInfo != null ? mTransformationInfo.mTranslationX : 0;
     }
@@ -7961,6 +8010,7 @@
      * @return The vertical position of this view relative to its top position,
      * in pixels.
      */
+    @ViewDebug.ExportedProperty(category = "drawing")
     public float getTranslationY() {
         return mTransformationInfo != null ? mTransformationInfo.mTranslationY : 0;
     }
@@ -7990,84 +8040,6 @@
     }
 
     /**
-     * @hide
-     */
-    public void setFastTranslationX(float x) {
-        ensureTransformationInfo();
-        final TransformationInfo info = mTransformationInfo;
-        info.mTranslationX = x;
-        info.mMatrixDirty = true;
-    }
-
-    /**
-     * @hide
-     */
-    public void setFastTranslationY(float y) {
-        ensureTransformationInfo();
-        final TransformationInfo info = mTransformationInfo;
-        info.mTranslationY = y;
-        info.mMatrixDirty = true;
-    }
-
-    /**
-     * @hide
-     */
-    public void setFastX(float x) {
-        ensureTransformationInfo();
-        final TransformationInfo info = mTransformationInfo;
-        info.mTranslationX = x - mLeft;
-        info.mMatrixDirty = true;
-    }
-
-    /**
-     * @hide
-     */
-    public void setFastY(float y) {
-        ensureTransformationInfo();
-        final TransformationInfo info = mTransformationInfo;
-        info.mTranslationY = y - mTop;
-        info.mMatrixDirty = true;
-    }
-
-    /**
-     * @hide
-     */
-    public void setFastScaleX(float x) {
-        ensureTransformationInfo();
-        final TransformationInfo info = mTransformationInfo;
-        info.mScaleX = x;
-        info.mMatrixDirty = true;
-    }
-
-    /**
-     * @hide
-     */
-    public void setFastScaleY(float y) {
-        ensureTransformationInfo();
-        final TransformationInfo info = mTransformationInfo;
-        info.mScaleY = y;
-        info.mMatrixDirty = true;
-    }
-
-    /**
-     * @hide
-     */
-    public void setFastAlpha(float alpha) {
-        ensureTransformationInfo();
-        mTransformationInfo.mAlpha = alpha;
-    }
-
-    /**
-     * @hide
-     */
-    public void setFastRotationY(float y) {
-        ensureTransformationInfo();
-        final TransformationInfo info = mTransformationInfo;
-        info.mRotationY = y;
-        info.mMatrixDirty = true;
-    }
-
-    /**
      * Hit rectangle in parent's coordinates
      *
      * @param outRect The hit rectangle of the view.
@@ -8644,37 +8616,6 @@
     }
 
     /**
-     * @hide
-     */
-    public void fastInvalidate() {
-        if (skipInvalidate()) {
-            return;
-        }
-        if ((mPrivateFlags & (DRAWN | HAS_BOUNDS)) == (DRAWN | HAS_BOUNDS) ||
-            (mPrivateFlags & DRAWING_CACHE_VALID) == DRAWING_CACHE_VALID ||
-            (mPrivateFlags & INVALIDATED) != INVALIDATED) {
-            if (mParent instanceof View) {
-                ((View) mParent).mPrivateFlags |= INVALIDATED;
-            }
-            mPrivateFlags &= ~DRAWN;
-            mPrivateFlags |= DIRTY;
-            mPrivateFlags |= INVALIDATED;
-            mPrivateFlags &= ~DRAWING_CACHE_VALID;
-            if (mParent != null && mAttachInfo != null) {
-                if (mAttachInfo.mHardwareAccelerated) {
-                    mParent.invalidateChild(this, null);
-                } else {
-                    final Rect r = mAttachInfo.mTmpInvalRect;
-                    r.set(0, 0, mRight - mLeft, mBottom - mTop);
-                    // Don't call invalidate -- we don't want to internally scroll
-                    // our own bounds
-                    mParent.invalidateChild(this, r);
-                }
-            }
-        }
-    }
-
-    /**
      * Used to indicate that the parent of this view should clear its caches. This functionality
      * is used to force the parent to rebuild its display list (when hardware-accelerated),
      * which is necessary when various parent-managed properties of the view change, such as
@@ -10433,6 +10374,19 @@
     }
 
     /**
+     * @return The HardwareRenderer associated with that view or null if hardware rendering
+     * is not supported or this this has not been attached to a window.
+     *
+     * @hide
+     */
+    public HardwareRenderer getHardwareRenderer() {
+        if (mAttachInfo != null) {
+            return mAttachInfo.mHardwareRenderer;
+        }
+        return null;
+    }
+
+    /**
      * <p>Returns a display list that can be used to draw this view again
      * without executing its draw method.</p>
      *
@@ -10463,7 +10417,8 @@
             // we copy in child display lists into ours in drawChild()
             mRecreateDisplayList = true;
             if (mDisplayList == null) {
-                mDisplayList = mAttachInfo.mHardwareRenderer.createDisplayList();
+                final String name = getClass().getSimpleName();
+                mDisplayList = mAttachInfo.mHardwareRenderer.createDisplayList(name);
                 // If we're creating a new display list, make sure our parent gets invalidated
                 // since they will need to recreate their display list to account for this
                 // new child display list.
@@ -12744,6 +12699,11 @@
             ViewDebug.trace(this, ViewDebug.HierarchyTraceType.REQUEST_LAYOUT);
         }
 
+        if (getAccessibilityNodeProvider() != null) {
+            throw new IllegalStateException("Views with AccessibilityNodeProvider"
+                    + " can't have children.");
+        }
+
         mPrivateFlags |= FORCE_LAYOUT;
         mPrivateFlags |= INVALIDATED;
 
@@ -12774,9 +12734,9 @@
      * </p>
      *
      * <p>
-     * The actual mesurement work of a view is performed in
+     * The actual measurement work of a view is performed in
      * {@link #onMeasure(int, int)}, called by this method. Therefore, only
-     * {@link #onMeasure(int, int)} can and must be overriden by subclasses.
+     * {@link #onMeasure(int, int)} can and must be overridden by subclasses.
      * </p>
      *
      *
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 09901ff..d3af618 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -675,11 +675,14 @@
      */
     @Override
     public void clearFocus() {
-        super.clearFocus();
-
-        // clear any child focus if it exists
-        if (mFocused != null) {
+        if (DBG) {
+            System.out.println(this + " clearFocus()");
+        }
+        if (mFocused == null) {
+            super.clearFocus();
+        } else {
             mFocused.clearFocus();
+            mFocused = null;
         }
     }
 
@@ -691,12 +694,12 @@
         if (DBG) {
             System.out.println(this + " unFocus()");
         }
-
-        super.unFocus();
-        if (mFocused != null) {
+        if (mFocused == null) {
+            super.unFocus();
+        } else {
             mFocused.unFocus();
+            mFocused = null;
         }
-        mFocused = null;
     }
 
     /**
@@ -888,18 +891,20 @@
     }
 
     /**
+     * Called when a view's visibility has changed. Notify the parent to take any appropriate
+     * action.
+     *
+     * @param child The view whose visibility has changed
+     * @param oldVisibility The previous visibility value (GONE, INVISIBLE, or VISIBLE).
+     * @param newVisibility The new visibility value (GONE, INVISIBLE, or VISIBLE).
      * @hide
-     * @param child
-     * @param visibility
      */
-    protected void onChildVisibilityChanged(View child, int visibility) {
+    protected void onChildVisibilityChanged(View child, int oldVisibility, int newVisibility) {
         if (mTransition != null) {
-            if (visibility == VISIBLE) {
-                mTransition.showChild(this, child);
+            if (newVisibility == VISIBLE) {
+                mTransition.showChild(this, child, oldVisibility);
             } else {
-                mTransition.hideChild(this, child);
-            }
-            if (visibility != VISIBLE) {
+                mTransition.hideChild(this, child, newVisibility);
                 // Only track this on disappearing views - appearing views are already visible
                 // and don't need special handling during drawChild()
                 if (mVisibilityChangingChildren == null) {
@@ -914,7 +919,7 @@
 
         // in all cases, for drags
         if (mCurrentDrag != null) {
-            if (visibility == VISIBLE) {
+            if (newVisibility == VISIBLE) {
                 notifyChildOfDrag(child);
             }
         }
@@ -2229,6 +2234,7 @@
     @Override
     void onInitializeAccessibilityNodeInfoInternal(AccessibilityNodeInfo info) {
         super.onInitializeAccessibilityNodeInfoInternal(info);
+        info.setClassName(ViewGroup.class.getName());
         for (int i = 0, count = mChildrenCount; i < count; i++) {
             View child = mChildren[i];
             if ((child.mViewFlags & VISIBILITY_MASK) == VISIBLE
@@ -2238,6 +2244,12 @@
         }
     }
 
+    @Override
+    void onInitializeAccessibilityEventInternal(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEventInternal(event);
+        event.setClassName(ViewGroup.class.getName());
+    }
+
     /**
      * {@inheritDoc}
      */
@@ -2654,8 +2666,7 @@
                 child.onAnimationStart();
             }
 
-            more = a.getTransformation(drawingTime, mChildTransformation,
-                    scalingRequired ? mAttachInfo.mApplicationScale : 1f);
+            more = a.getTransformation(drawingTime, mChildTransformation, 1f);
             if (scalingRequired && mAttachInfo.mApplicationScale != 1f) {
                 if (mInvalidationTransformation == null) {
                     mInvalidationTransformation = new Transformation();
@@ -3345,6 +3356,11 @@
     private void addViewInner(View child, int index, LayoutParams params,
             boolean preventRequestLayout) {
 
+        if (getAccessibilityNodeProvider() != null) {
+            throw new IllegalStateException("Views with AccessibilityNodeProvider"
+                    + " can't have children.");
+        }
+
         if (mTransition != null) {
             // Don't prevent other add transitions from completing, but cancel remove
             // transitions to let them complete the process before we add to the container
diff --git a/core/java/android/view/ViewPropertyAnimator.java b/core/java/android/view/ViewPropertyAnimator.java
index 89a1ef2..0fdcd0f 100644
--- a/core/java/android/view/ViewPropertyAnimator.java
+++ b/core/java/android/view/ViewPropertyAnimator.java
@@ -113,6 +113,10 @@
      * on that list are added to the list of properties associated with that animator.
      */
     ArrayList<NameValuesHolder> mPendingAnimations = new ArrayList<NameValuesHolder>();
+    private Runnable mPendingSetupAction;
+    private Runnable mPendingCleanupAction;
+    private Runnable mPendingOnStartAction;
+    private Runnable mPendingOnEndAction;
 
     /**
      * Constants used to associate a property being requested and the mechanism used to set
@@ -199,6 +203,10 @@
      */
     private HashMap<Animator, PropertyBundle> mAnimatorMap =
             new HashMap<Animator, PropertyBundle>();
+    private HashMap<Animator, Runnable> mAnimatorSetupMap;
+    private HashMap<Animator, Runnable> mAnimatorCleanupMap;
+    private HashMap<Animator, Runnable> mAnimatorOnStartMap;
+    private HashMap<Animator, Runnable> mAnimatorOnEndMap;
 
     /**
      * This is the information we need to set each property during the animation.
@@ -614,6 +622,93 @@
     }
 
     /**
+     * The View associated with this ViewPropertyAnimator will have its
+     * {@link View#setLayerType(int, android.graphics.Paint) layer type} set to
+     * {@link View#LAYER_TYPE_HARDWARE} for the duration of the next animation. This state
+     * is not persistent, either on the View or on this ViewPropertyAnimator: the layer type
+     * of the View will be restored when the animation ends to what it was when this method was
+     * called, and this setting on ViewPropertyAnimator is only valid for the next animation.
+     * Note that calling this method and then independently setting the layer type of the View
+     * (by a direct call to {@link View#setLayerType(int, android.graphics.Paint)}) will result
+     * in some inconsistency, including having the layer type restored to its pre-withLayer()
+     * value when the animation ends.
+     *
+     * @see View#setLayerType(int, android.graphics.Paint)
+     * @return This object, allowing calls to methods in this class to be chained.
+     */
+    public ViewPropertyAnimator withLayer() {
+         mPendingSetupAction= new Runnable() {
+            @Override
+            public void run() {
+                mView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
+            }
+        };
+        final int currentLayerType = mView.getLayerType();
+        mPendingCleanupAction = new Runnable() {
+            @Override
+            public void run() {
+                mView.setLayerType(currentLayerType, null);
+            }
+        };
+        if (mAnimatorSetupMap == null) {
+            mAnimatorSetupMap = new HashMap<Animator, Runnable>();
+        }
+        if (mAnimatorCleanupMap == null) {
+            mAnimatorCleanupMap = new HashMap<Animator, Runnable>();
+        }
+
+        return this;
+    }
+
+    /**
+     * Specifies an action to take place when the next animation runs. If there is a
+     * {@link #setStartDelay(long) startDelay} set on this ViewPropertyAnimator, then the
+     * action will run after that startDelay expires, when the actual animation begins.
+     * This method, along with {@link #withEndAction(Runnable)}, is intended to help facilitate
+     * choreographing ViewPropertyAnimator animations with other animations or actions
+     * in the application.
+     *
+     * @param runnable The action to run when the next animation starts.
+     * @return This object, allowing calls to methods in this class to be chained.
+     */
+    public ViewPropertyAnimator withStartAction(Runnable runnable) {
+        mPendingOnStartAction = runnable;
+        if (runnable != null && mAnimatorOnStartMap == null) {
+            mAnimatorOnStartMap = new HashMap<Animator, Runnable>();
+        }
+        return this;
+    }
+
+    /**
+     * Specifies an action to take place when the next animation ends. The action is only
+     * run if the animation ends normally; if the ViewPropertyAnimator is canceled during
+     * that animation, the runnable will not run.
+     * This method, along with {@link #withStartAction(Runnable)}, is intended to help facilitate
+     * choreographing ViewPropertyAnimator animations with other animations or actions
+     * in the application.
+     *
+     * <p>For example, the following code animates a view to x=200 and then back to 0:</p>
+     * <pre>
+     *     Runnable endAction = new Runnable() {
+     *         public void run() {
+     *             view.animate().x(0);
+     *         }
+     *     };
+     *     view.animate().x(200).onEnd(endAction);
+     * </pre>
+     *
+     * @param runnable The action to run when the next animation ends.
+     * @return This object, allowing calls to methods in this class to be chained.
+     */
+    public ViewPropertyAnimator withEndAction(Runnable runnable) {
+        mPendingOnEndAction = runnable;
+        if (runnable != null && mAnimatorOnEndMap == null) {
+            mAnimatorOnEndMap = new HashMap<Animator, Runnable>();
+        }
+        return this;
+    }
+
+    /**
      * Starts the underlying Animator for a set of properties. We use a single animator that
      * simply runs from 0 to 1, and then use that fractional value to set each property
      * value accordingly.
@@ -630,6 +725,22 @@
             propertyMask |= nameValuesHolder.mNameConstant;
         }
         mAnimatorMap.put(animator, new PropertyBundle(propertyMask, nameValueList));
+        if (mPendingSetupAction != null) {
+            mAnimatorSetupMap.put(animator, mPendingSetupAction);
+            mPendingSetupAction = null;
+        }
+        if (mPendingCleanupAction != null) {
+            mAnimatorCleanupMap.put(animator, mPendingCleanupAction);
+            mPendingCleanupAction = null;
+        }
+        if (mPendingOnStartAction != null) {
+            mAnimatorOnStartMap.put(animator, mPendingOnStartAction);
+            mPendingOnStartAction = null;
+        }
+        if (mPendingOnEndAction != null) {
+            mAnimatorOnEndMap.put(animator, mPendingOnEndAction);
+            mPendingOnEndAction = null;
+        }
         animator.addUpdateListener(mAnimatorEventListener);
         animator.addListener(mAnimatorEventListener);
         if (mStartDelaySet) {
@@ -800,6 +911,20 @@
             implements Animator.AnimatorListener, ValueAnimator.AnimatorUpdateListener {
         @Override
         public void onAnimationStart(Animator animation) {
+            if (mAnimatorSetupMap != null) {
+                Runnable r = mAnimatorSetupMap.get(animation);
+                if (r != null) {
+                    r.run();
+                }
+                mAnimatorSetupMap.remove(animation);
+            }
+            if (mAnimatorOnStartMap != null) {
+                Runnable r = mAnimatorOnStartMap.get(animation);
+                if (r != null) {
+                    r.run();
+                }
+                mAnimatorOnStartMap.remove(animation);
+            }
             if (mListener != null) {
                 mListener.onAnimationStart(animation);
             }
@@ -810,6 +935,9 @@
             if (mListener != null) {
                 mListener.onAnimationCancel(animation);
             }
+            if (mAnimatorOnEndMap != null) {
+                mAnimatorOnEndMap.remove(animation);
+            }
         }
 
         @Override
@@ -824,6 +952,20 @@
             if (mListener != null) {
                 mListener.onAnimationEnd(animation);
             }
+            if (mAnimatorOnEndMap != null) {
+                Runnable r = mAnimatorOnEndMap.get(animation);
+                if (r != null) {
+                    r.run();
+                }
+                mAnimatorOnEndMap.remove(animation);
+            }
+            if (mAnimatorCleanupMap != null) {
+                Runnable r = mAnimatorCleanupMap.get(animation);
+                if (r != null) {
+                    r.run();
+                }
+                mAnimatorCleanupMap.remove(animation);
+            }
             mAnimatorMap.remove(animation);
         }
 
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 72966ef4..cbf4b5a 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -18,11 +18,13 @@
 
 import android.Manifest;
 import android.animation.LayoutTransition;
+import android.animation.ValueAnimator;
 import android.app.ActivityManagerNative;
 import android.content.ClipDescription;
 import android.content.ComponentCallbacks;
 import android.content.ComponentCallbacks2;
 import android.content.Context;
+import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageManager;
 import android.content.res.CompatibilityInfo;
 import android.content.res.Configuration;
@@ -52,12 +54,12 @@
 import android.util.DisplayMetrics;
 import android.util.EventLog;
 import android.util.Log;
+import android.util.LongSparseArray;
 import android.util.Pool;
 import android.util.Poolable;
 import android.util.PoolableManager;
 import android.util.Pools;
 import android.util.Slog;
-import android.util.SparseArray;
 import android.util.TypedValue;
 import android.view.View.MeasureSpec;
 import android.view.accessibility.AccessibilityEvent;
@@ -82,7 +84,6 @@
 
 import java.io.IOException;
 import java.io.OutputStream;
-import java.io.PrintWriter;
 import java.lang.ref.WeakReference;
 import java.util.ArrayList;
 import java.util.List;
@@ -140,6 +141,10 @@
     static final ArrayList<ComponentCallbacks> sConfigCallbacks
             = new ArrayList<ComponentCallbacks>();
 
+    private static boolean sUseRenderThread = false;
+    private static boolean sRenderThreadQueried = false;
+    private static final Object[] sRenderThreadQueryLock = new Object[0];
+
     long mLastTrackballTime = 0;
     final TrackballAxis mTrackballAxisX = new TrackballAxis();
     final TrackballAxis mTrackballAxisY = new TrackballAxis();
@@ -169,6 +174,7 @@
     View mView;
     View mFocusedView;
     View mRealFocusedView;  // this is not set to null in touch mode
+    View mOldFocusedView;
     int mViewVisibility;
     boolean mAppVisible = true;
     int mOrigWindowType = -1;
@@ -302,6 +308,8 @@
 
     SendWindowContentChangedAccessibilityEvent mSendWindowContentChangedAccessibilityEvent;
 
+    AccessibilityPrefetchStrategy mAccessibilityPrefetchStrategy;
+
     private final int mDensity;
 
     /**
@@ -316,8 +324,11 @@
             if (!mInitialized) {
                 try {
                     InputMethodManager imm = InputMethodManager.getInstance(mainLooper);
-                    sWindowSession = Display.getWindowManager().openSession(
+                    IWindowManager windowManager = Display.getWindowManager();
+                    sWindowSession = windowManager.openSession(
                             imm.getClient(), imm.getInputContext());
+                    float animatorScale = windowManager.getAnimationScale(2);
+                    ValueAnimator.setDurationScale(animatorScale);
                     mInitialized = true;
                 } catch (RemoteException e) {
                 }
@@ -378,6 +389,31 @@
         mChoreographer = Choreographer.getInstance();
     }
 
+    /**
+     * @return True if the application requests the use of a separate render thread,
+     *         false otherwise
+     */
+    private static boolean isRenderThreadRequested(Context context) {
+        synchronized (sRenderThreadQueryLock) {
+            if (!sRenderThreadQueried) {
+                final PackageManager packageManager = context.getPackageManager();
+                final String packageName = context.getApplicationInfo().packageName;
+                try {
+                    ApplicationInfo applicationInfo = packageManager.getApplicationInfo(packageName,
+                            PackageManager.GET_META_DATA);
+                    if (applicationInfo.metaData != null) {
+                        sUseRenderThread = applicationInfo.metaData.getBoolean(
+                                "android.graphics.renderThread", false);
+                    }
+                } catch (PackageManager.NameNotFoundException e) {
+                } finally {
+                    sRenderThreadQueried = true;
+                }
+            }
+            return sUseRenderThread;
+        }
+    }
+
     public static void addFirstDrawHandler(Runnable callback) {
         synchronized (sFirstDrawHandlers) {
             if (!sFirstDrawComplete) {
@@ -448,7 +484,7 @@
 
                 // If the application owns the surface, don't enable hardware acceleration
                 if (mSurfaceHolder == null) {
-                    enableHardwareAcceleration(attrs);
+                    enableHardwareAcceleration(mView.getContext(), attrs);
                 }
 
                 boolean restore = false;
@@ -608,7 +644,7 @@
         }
     }
 
-    private void enableHardwareAcceleration(WindowManager.LayoutParams attrs) {
+    private void enableHardwareAcceleration(Context context, WindowManager.LayoutParams attrs) {
         mAttachInfo.mHardwareAccelerated = false;
         mAttachInfo.mHardwareAccelerationRequested = false;
 
@@ -641,20 +677,27 @@
             if (!HardwareRenderer.sRendererDisabled || (HardwareRenderer.sSystemRendererDisabled
                     && forceHwAccelerated)) {
                 // Don't enable hardware acceleration when we're not on the main thread
-                if (!HardwareRenderer.sSystemRendererDisabled
-                        && Looper.getMainLooper() != Looper.myLooper()) {
-                    Log.w(HardwareRenderer.LOG_TAG, "Attempting to initialize hardware "
+                if (!HardwareRenderer.sSystemRendererDisabled &&
+                        Looper.getMainLooper() != Looper.myLooper()) {
+                    Log.w(HardwareRenderer.LOG_TAG, "Attempting to initialize hardware " 
                             + "acceleration outside of the main thread, aborting");
                     return;
                 }
 
-                final boolean translucent = attrs.format != PixelFormat.OPAQUE;
+                boolean renderThread = isRenderThreadRequested(context);
+                if (renderThread) {
+                    Log.i(HardwareRenderer.LOG_TAG, "Render threat initiated");
+                }
+
                 if (mAttachInfo.mHardwareRenderer != null) {
                     mAttachInfo.mHardwareRenderer.destroy(true);
-                }                
+                }
+
+                final boolean translucent = attrs.format != PixelFormat.OPAQUE;
                 mAttachInfo.mHardwareRenderer = HardwareRenderer.createGlRenderer(2, translucent);
                 mAttachInfo.mHardwareAccelerated = mAttachInfo.mHardwareAccelerationRequested
                         = mAttachInfo.mHardwareRenderer != null;
+
             } else if (fakeHwAccelerated) {
                 // The window had wanted to use hardware acceleration, but this
                 // is not allowed in its process.  By setting this flag, it can
@@ -2227,32 +2270,33 @@
 
     public void requestChildFocus(View child, View focused) {
         checkThread();
-        if (mFocusedView != focused) {
-            mAttachInfo.mTreeObserver.dispatchOnGlobalFocusChange(mFocusedView, focused);
-            scheduleTraversals();
+
+        if (DEBUG_INPUT_RESIZE) {
+            Log.v(TAG, "Request child focus: focus now " + focused);
         }
+
+        mAttachInfo.mTreeObserver.dispatchOnGlobalFocusChange(mOldFocusedView, focused);
+        scheduleTraversals();
+
         mFocusedView = mRealFocusedView = focused;
-        if (DEBUG_INPUT_RESIZE) Log.v(TAG, "Request child focus: focus now "
-                + mFocusedView);
     }
 
     public void clearChildFocus(View child) {
         checkThread();
 
-        View oldFocus = mFocusedView;
-
-        if (DEBUG_INPUT_RESIZE) Log.v(TAG, "Clearing child focus");
-        mFocusedView = mRealFocusedView = null;
-        if (mView != null && !mView.hasFocus()) {
-            // If a view gets the focus, the listener will be invoked from requestChildFocus()
-            if (!mView.requestFocus(View.FOCUS_FORWARD)) {
-                mAttachInfo.mTreeObserver.dispatchOnGlobalFocusChange(oldFocus, null);
-            }
-        } else if (oldFocus != null) {
-            mAttachInfo.mTreeObserver.dispatchOnGlobalFocusChange(oldFocus, null);
+        if (DEBUG_INPUT_RESIZE) {
+            Log.v(TAG, "Clearing child focus");
         }
-    }
 
+        mOldFocusedView = mFocusedView;
+
+        // Invoke the listener only if there is no view to take focus
+        if (focusSearch(null, View.FOCUS_FORWARD) == null) {
+            mAttachInfo.mTreeObserver.dispatchOnGlobalFocusChange(mOldFocusedView, null);
+        }
+
+        mFocusedView = mRealFocusedView = null;
+    }
 
     public void focusableViewAvailable(View v) {
         checkThread();
@@ -2530,7 +2574,7 @@
                         mFullRedrawNeeded = true;
                         try {
                             mAttachInfo.mHardwareRenderer.initializeIfNeeded(mWidth, mHeight,
-                                    mAttachInfo, mHolder);
+                                    mHolder);
                         } catch (Surface.OutOfResourcesException e) {
                             Log.e(TAG, "OutOfResourcesException locking surface", e);
                             try {
@@ -2725,6 +2769,7 @@
                         mView.unFocus();
                         mAttachInfo.mTreeObserver.dispatchOnGlobalFocusChange(focused, null);
                         mFocusedView = null;
+                        mOldFocusedView = null;
                         return true;
                     }
                 }
@@ -3439,11 +3484,11 @@
         if (args.localChanges != 0) {
             if (mAttachInfo != null) {
                 mAttachInfo.mSystemUiVisibility =
-                        (mAttachInfo.mSystemUiVisibility&~args.localChanges)
-                        | (args.localValue&args.localChanges);
+                        (mAttachInfo.mSystemUiVisibility & ~args.localChanges) |
+                                (args.localValue & args.localChanges);
+                mAttachInfo.mRecomputeGlobalAttributes = true;
             }
             mView.updateLocalSystemUiVisibility(args.localValue, args.localChanges);
-            mAttachInfo.mRecomputeGlobalAttributes = true;
             scheduleTraversals();            
         }
         mView.dispatchSystemUiVisibilityChanged(args.globalVisibility);
@@ -3481,6 +3526,17 @@
         return mAccessibilityInteractionController;
     }
 
+    public AccessibilityPrefetchStrategy getAccessibilityPrefetchStrategy() {
+        if (mView == null) {
+            throw new IllegalStateException("getAccessibilityPrefetchStrategy"
+                    + " called when there is no mView");
+        }
+        if (mAccessibilityPrefetchStrategy == null) {
+            mAccessibilityPrefetchStrategy = new AccessibilityPrefetchStrategy();
+        }
+        return mAccessibilityPrefetchStrategy;
+    }
+
     private int relayoutWindow(WindowManager.LayoutParams params, int viewVisibility,
             boolean insetsPending) throws RemoteException {
 
@@ -3586,7 +3642,7 @@
         mView.debug();
     }
     
-    public void dumpGfxInfo(PrintWriter pw, int[] info) {
+    public void dumpGfxInfo(int[] info) {
         if (mView != null) {
             getGfxInfo(mView, info);
         } else {
@@ -3698,7 +3754,7 @@
      * Represents a pending input event that is waiting in a queue.
      *
      * Input events are processed in serial order by the timestamp specified by
-     * {@link InputEvent#getEventTime()}.  In general, the input dispatcher delivers
+     * {@link InputEvent#getEventTimeNano()}.  In general, the input dispatcher delivers
      * one input event to the application at a time and waits for the application
      * to finish handling it before delivering the next one.
      *
@@ -3707,7 +3763,7 @@
      * needing a queue on the application's side.
      */
     private static final class QueuedInputEvent {
-        public static final int FLAG_DELIVER_POST_IME = 1 << 0;
+        public static final int FLAG_DELIVER_POST_IME = 1;
 
         public QueuedInputEvent mNext;
 
@@ -3981,6 +4037,7 @@
         if (mView == null) {
             return false;
         }
+        getAccessibilityPrefetchStrategy().onAccessibilityEvent(event);
         mAccessibilityManager.sendAccessibilityEvent(event);
         return true;
     }
@@ -4540,6 +4597,13 @@
                 viewRootImpl.getAccessibilityInteractionController()
                     .findAccessibilityNodeInfoByAccessibilityIdClientThread(accessibilityNodeId,
                         interactionId, callback, interrogatingPid, interrogatingTid);
+            } else {
+                // We cannot make the call and notify the caller so it does not wait.
+                try {
+                    callback.setFindAccessibilityNodeInfosResult(null, interactionId);
+                } catch (RemoteException re) {
+                    /* best effort - ignore */
+                }
             }
         }
 
@@ -4551,28 +4615,49 @@
                 viewRootImpl.getAccessibilityInteractionController()
                     .performAccessibilityActionClientThread(accessibilityNodeId, action,
                             interactionId, callback, interogatingPid, interrogatingTid);
+            } else {
+                // We cannot make the call and notify the caller so it does not
+                try {
+                    callback.setPerformAccessibilityActionResult(false, interactionId);
+                } catch (RemoteException re) {
+                    /* best effort - ignore */
+                }
             }
         }
 
-        public void findAccessibilityNodeInfoByViewId(int viewId,
+        public void findAccessibilityNodeInfoByViewId(long accessibilityNodeId, int viewId,
                 int interactionId, IAccessibilityInteractionConnectionCallback callback,
                 int interrogatingPid, long interrogatingTid) {
             ViewRootImpl viewRootImpl = mViewRootImpl.get();
             if (viewRootImpl != null && viewRootImpl.mView != null) {
                 viewRootImpl.getAccessibilityInteractionController()
-                    .findAccessibilityNodeInfoByViewIdClientThread(viewId, interactionId, callback,
-                            interrogatingPid, interrogatingTid);
-            }
-        }
-
-        public void findAccessibilityNodeInfosByText(String text, long accessibilityNodeId,
-                int interactionId, IAccessibilityInteractionConnectionCallback callback,
-                int interrogatingPid, long interrogatingTid) {
-            ViewRootImpl viewRootImpl = mViewRootImpl.get();
-            if (viewRootImpl != null && viewRootImpl.mView != null) {
-                viewRootImpl.getAccessibilityInteractionController()
-                    .findAccessibilityNodeInfosByTextClientThread(text, accessibilityNodeId,
+                    .findAccessibilityNodeInfoByViewIdClientThread(accessibilityNodeId, viewId,
                             interactionId, callback, interrogatingPid, interrogatingTid);
+            } else {
+                // We cannot make the call and notify the caller so it does not
+                try {
+                    callback.setFindAccessibilityNodeInfoResult(null, interactionId);
+                } catch (RemoteException re) {
+                    /* best effort - ignore */
+                }
+            }
+        }
+
+        public void findAccessibilityNodeInfosByText(long accessibilityNodeId, String text,
+                int interactionId, IAccessibilityInteractionConnectionCallback callback,
+                int interrogatingPid, long interrogatingTid) {
+            ViewRootImpl viewRootImpl = mViewRootImpl.get();
+            if (viewRootImpl != null && viewRootImpl.mView != null) {
+                viewRootImpl.getAccessibilityInteractionController()
+                    .findAccessibilityNodeInfosByTextClientThread(accessibilityNodeId, text,
+                            interactionId, callback, interrogatingPid, interrogatingTid);
+            } else {
+                // We cannot make the call and notify the caller so it does not
+                try {
+                    callback.setFindAccessibilityNodeInfosResult(null, interactionId);
+                } catch (RemoteException re) {
+                    /* best effort - ignore */
+                }
             }
         }
     }
@@ -4650,6 +4735,7 @@
                 long interrogatingTid) {
             Message message = Message.obtain();
             message.what = DO_FIND_ACCESSIBLITY_NODE_INFO_BY_ACCESSIBILITY_ID;
+            message.arg1 = interrogatingPid;
             SomeArgs args = mPool.acquire();
             args.argi1 = AccessibilityNodeInfo.getAccessibilityViewId(accessibilityNodeId);
             args.argi2 = AccessibilityNodeInfo.getVirtualDescendantId(accessibilityNodeId);
@@ -4672,40 +4758,47 @@
 
         public void findAccessibilityNodeInfoByAccessibilityIdUiThread(Message message) {
             SomeArgs args = (SomeArgs) message.obj;
+            final int interrogatingPid = message.arg1;
             final int accessibilityViewId = args.argi1;
             final int virtualDescendantId = args.argi2;
             final int interactionId = args.argi3;
             final IAccessibilityInteractionConnectionCallback callback =
                 (IAccessibilityInteractionConnectionCallback) args.arg1;
             mPool.release(args);
-            AccessibilityNodeInfo info = null;
+            List<AccessibilityNodeInfo> infos = mTempAccessibilityNodeInfoList;
+            infos.clear();
             try {
                 View target = findViewByAccessibilityId(accessibilityViewId);
                 if (target != null && target.getVisibility() == View.VISIBLE) {
                     AccessibilityNodeProvider provider = target.getAccessibilityNodeProvider();
                     if (provider != null) {
-                        info = provider.createAccessibilityNodeInfo(virtualDescendantId);
+                        infos.add(provider.createAccessibilityNodeInfo(virtualDescendantId));
                     } else if (virtualDescendantId == View.NO_ID) {
-                        info = target.createAccessibilityNodeInfo();
+                        getAccessibilityPrefetchStrategy().prefetchAccessibilityNodeInfos(
+                                interrogatingPid, target, infos);
                     }
                 }
             } finally {
                 try {
-                    callback.setFindAccessibilityNodeInfoResult(info, interactionId);
+                    callback.setFindAccessibilityNodeInfosResult(infos, interactionId);
+                    infos.clear();
                 } catch (RemoteException re) {
                     /* ignore - the other side will time out */
                 }
             }
         }
 
-        public void findAccessibilityNodeInfoByViewIdClientThread(int viewId, int interactionId,
-                IAccessibilityInteractionConnectionCallback callback, int interrogatingPid,
-                long interrogatingTid) {
+        public void findAccessibilityNodeInfoByViewIdClientThread(long accessibilityNodeId,
+                int viewId, int interactionId, IAccessibilityInteractionConnectionCallback callback,
+                int interrogatingPid, long interrogatingTid) {
             Message message = Message.obtain();
             message.what = DO_FIND_ACCESSIBLITY_NODE_INFO_BY_VIEW_ID;
-            message.arg1 = viewId;
-            message.arg2 = interactionId;
-            message.obj = callback;
+            message.arg1 = AccessibilityNodeInfo.getAccessibilityViewId(accessibilityNodeId);
+            SomeArgs args = mPool.acquire();
+            args.argi1 = viewId;
+            args.argi2 = interactionId;
+            args.arg1 = callback;
+            message.obj = args;
             // If the interrogation is performed by the same thread as the main UI
             // thread in this process, set the message as a static reference so
             // after this call completes the same thread but in the interrogating
@@ -4721,17 +4814,26 @@
         }
 
         public void findAccessibilityNodeInfoByViewIdUiThread(Message message) {
-            final int viewId = message.arg1;
-            final int interactionId = message.arg2;
+            final int accessibilityViewId = message.arg1;
+            SomeArgs args = (SomeArgs) message.obj;
+            final int viewId = args.argi1;
+            final int interactionId = args.argi2;
             final IAccessibilityInteractionConnectionCallback callback =
-                (IAccessibilityInteractionConnectionCallback) message.obj;
-
+                (IAccessibilityInteractionConnectionCallback) args.arg1;
+            mPool.release(args);
             AccessibilityNodeInfo info = null;
             try {
-                View root = ViewRootImpl.this.mView;
-                View target = root.findViewById(viewId);
-                if (target != null && target.getVisibility() == View.VISIBLE) {
-                    info = target.createAccessibilityNodeInfo();
+                View root = null;
+                if (accessibilityViewId != View.NO_ID) {
+                    root = findViewByAccessibilityId(accessibilityViewId);
+                } else {
+                    root = ViewRootImpl.this.mView;
+                }
+                if (root != null) {
+                    View target = root.findViewById(viewId);
+                    if (target != null && target.getVisibility() == View.VISIBLE) {
+                        info = target.createAccessibilityNodeInfo();
+                    }
                 }
             } finally {
                 try {
@@ -4742,8 +4844,8 @@
             }
         }
 
-        public void findAccessibilityNodeInfosByTextClientThread(String text,
-                long accessibilityNodeId, int interactionId,
+        public void findAccessibilityNodeInfosByTextClientThread(long accessibilityNodeId,
+                String text, int interactionId,
                 IAccessibilityInteractionConnectionCallback callback, int interrogatingPid,
                 long interrogatingTid) {
             Message message = Message.obtain();
@@ -4780,7 +4882,7 @@
             mPool.release(args);
             List<AccessibilityNodeInfo> infos = null;
             try {
-                View target = null;
+                View target;
                 if (accessibilityViewId != View.NO_ID) {
                     target = findViewByAccessibilityId(accessibilityViewId);
                 } else {
@@ -4935,4 +5037,88 @@
             }
         }
     }
+
+    /**
+     * This class encapsulates a prefetching strategy for the accessibility APIs for
+     * querying window content.It is responsible to prefetch a batch of
+     * AccessibilityNodeInfos in addition to the one for a requested node. It caches
+     * the ids of the prefeteched nodes such that they are fetched only once.
+     */
+    class AccessibilityPrefetchStrategy {
+        private static final int MAX_ACCESSIBILITY_NODE_INFO_BATCH_SIZE = 100;
+
+        // We need to keep track of what we have sent for each interrogating
+        // process. Usually there will be only one such process but we
+        // should support the general case. Note that the accessibility event
+        // stream will take care of clearing caches of querying processes that
+        // are not longer alive, so we do not waste memory.
+        private final LongSparseArray<AccessibilityNodeInfoCache> mAccessibilityNodeInfoCaches =
+            new LongSparseArray<AccessibilityNodeInfoCache>();
+
+        private AccessibilityNodeInfoCache getCacheForInterrogatingPid(long interrogatingPid) {
+            AccessibilityNodeInfoCache cache = mAccessibilityNodeInfoCaches.get(interrogatingPid);
+            if (cache == null) {
+                cache = AccessibilityNodeInfoCache.newAccessibilityNodeInfoCache();
+                mAccessibilityNodeInfoCaches.put(interrogatingPid, cache);
+            }
+            return cache;
+        }
+
+        public void onAccessibilityEvent(AccessibilityEvent event) {
+            final int cacheCount = mAccessibilityNodeInfoCaches.size();
+            for (int i = 0; i < cacheCount; i++) {
+                AccessibilityNodeInfoCache cache = mAccessibilityNodeInfoCaches.valueAt(i);
+                cache.onAccessibilityEvent(event);
+            }
+        }
+
+        public void prefetchAccessibilityNodeInfos(long interrogatingPid, View root,
+                List<AccessibilityNodeInfo> outInfos) {
+            addAndCacheNotCachedNodeInfo(interrogatingPid, root, outInfos);
+            addAndCacheNotCachedPredecessorInfos(interrogatingPid, root, outInfos);
+            addAndCacheNotCachedDescendantInfos(interrogatingPid, root, outInfos);
+        }
+
+        private void addAndCacheNotCachedNodeInfo(long interrogatingPid,
+                View view, List<AccessibilityNodeInfo> outInfos) {
+            final long accessibilityNodeId = AccessibilityNodeInfo.makeNodeId(
+                    view.getAccessibilityViewId(), View.NO_ID);
+            AccessibilityNodeInfoCache cache = getCacheForInterrogatingPid(interrogatingPid);
+            if (!cache.containsKey(accessibilityNodeId)) {
+                // Account for the ids of the fetched infos. The infos will be
+                // cached in the window querying process. We just need to know
+                // which infos are cached to avoid fetching a cached one again.
+                cache.put(accessibilityNodeId, null);
+                outInfos.add(view.createAccessibilityNodeInfo());
+            }
+        }
+
+        private void addAndCacheNotCachedPredecessorInfos(long interrogatingPid, View view,
+                List<AccessibilityNodeInfo> outInfos) {
+            ViewParent predecessor = view.getParent();
+            while (predecessor instanceof View
+                    && outInfos.size() < MAX_ACCESSIBILITY_NODE_INFO_BATCH_SIZE) {
+                View predecessorView = (View) predecessor;
+                addAndCacheNotCachedNodeInfo(interrogatingPid, predecessorView, outInfos);
+                predecessor = predecessor.getParent();
+            }
+        }
+
+        private void addAndCacheNotCachedDescendantInfos(long interrogatingPid, View view,
+                List<AccessibilityNodeInfo> outInfos) {
+            if (outInfos.size() > MAX_ACCESSIBILITY_NODE_INFO_BATCH_SIZE
+                    || view.getAccessibilityNodeProvider() != null) {
+                return;
+            }
+            addAndCacheNotCachedNodeInfo(interrogatingPid, view, outInfos);
+            if (view instanceof ViewGroup) {
+                ViewGroup rootGroup = (ViewGroup) view;
+                final int childCount = rootGroup.getChildCount();
+                for (int i = 0; i < childCount; i++) {
+                View child = rootGroup.getChildAt(i);
+                    addAndCacheNotCachedDescendantInfos(interrogatingPid, child, outInfos);
+                }
+            }
+        }
+    }
 }
diff --git a/core/java/android/view/ViewTreeObserver.java b/core/java/android/view/ViewTreeObserver.java
index c53fc6b..7fd3389 100644
--- a/core/java/android/view/ViewTreeObserver.java
+++ b/core/java/android/view/ViewTreeObserver.java
@@ -185,7 +185,8 @@
             mTouchableInsets = TOUCHABLE_INSETS_FRAME;
         }
         
-        @Override public boolean equals(Object o) {
+        @Override
+        public boolean equals(Object o) {
             try {
                 if (o == null) {
                     return false;
@@ -357,10 +358,26 @@
      * @param victim The callback to remove
      *
      * @throws IllegalStateException If {@link #isAlive()} returns false
+     * 
+     * @deprecated Use #removeOnGlobalLayoutListener instead
      *
      * @see #addOnGlobalLayoutListener(OnGlobalLayoutListener)
      */
+    @Deprecated
     public void removeGlobalOnLayoutListener(OnGlobalLayoutListener victim) {
+        removeOnGlobalLayoutListener(victim);
+    }
+
+    /**
+     * Remove a previously installed global layout callback
+     *
+     * @param victim The callback to remove
+     *
+     * @throws IllegalStateException If {@link #isAlive()} returns false
+     * 
+     * @see #addOnGlobalLayoutListener(OnGlobalLayoutListener)
+     */
+    public void removeOnGlobalLayoutListener(OnGlobalLayoutListener victim) {
         checkIsAlive();
         if (mOnGlobalLayoutListeners == null) {
             return;
diff --git a/core/java/android/view/WindowManagerImpl.java b/core/java/android/view/WindowManagerImpl.java
index d7113374..6bdc4e8 100644
--- a/core/java/android/view/WindowManagerImpl.java
+++ b/core/java/android/view/WindowManagerImpl.java
@@ -490,7 +490,7 @@
 
                     for (int i = 0; i < count; i++) {
                         ViewRootImpl root = mRoots[i];
-                        root.dumpGfxInfo(pw, info);
+                        root.dumpGfxInfo(info);
 
                         String name = root.getClass().getName() + '@' +
                                 Integer.toHexString(hashCode());                        
diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java
index c7cd662..75267bb 100644
--- a/core/java/android/view/WindowManagerPolicy.java
+++ b/core/java/android/view/WindowManagerPolicy.java
@@ -298,6 +298,11 @@
         boolean isDisplayedLw();
 
         /**
+         * Is this window considered to be gone for purposes of layout?
+         */
+        boolean isGoneForLayoutLw();
+
+        /**
          * Returns true if this window has been shown on screen at some time in 
          * the past.  Must be called with the window manager lock held.
          * 
@@ -531,7 +536,7 @@
     /**
      * Return the available screen width that we should report for the
      * configuration.  This must be no larger than
-     * {@link #getNonDecorDisplayWidth(int, int)}; it may be smaller than
+     * {@link #getNonDecorDisplayWidth(int, int, int)}; it may be smaller than
      * that to account for more transient decoration like a status bar.
      */
     public int getConfigDisplayWidth(int fullWidth, int fullHeight, int rotation);
@@ -539,7 +544,7 @@
     /**
      * Return the available screen height that we should report for the
      * configuration.  This must be no larger than
-     * {@link #getNonDecorDisplayHeight(int, int)}; it may be smaller than
+     * {@link #getNonDecorDisplayHeight(int, int, int)}; it may be smaller than
      * that to account for more transient decoration like a status bar.
      */
     public int getConfigDisplayHeight(int fullWidth, int fullHeight, int rotation);
@@ -749,12 +754,8 @@
      * Called when layout of the windows is finished.  After this function has
      * returned, all windows given to layoutWindow() <em>must</em> have had a
      * frame assigned.
-     *  
-     * @return Return any bit set of {@link #FINISH_LAYOUT_REDO_LAYOUT},
-     * {@link #FINISH_LAYOUT_REDO_CONFIG}, {@link #FINISH_LAYOUT_REDO_WALLPAPER},
-     * or {@link #FINISH_LAYOUT_REDO_ANIM}.
      */
-    public int finishLayoutLw();
+    public void finishLayoutLw();
 
     /** Layout state may have changed (so another layout will be performed) */
     static final int FINISH_LAYOUT_REDO_LAYOUT = 0x0001;
@@ -817,7 +818,7 @@
 
     public interface ScreenOnListener {
         void onScreenOn();
-    };
+    }
 
     /**
      * Called when the power manager would like to turn the screen on.
@@ -1024,6 +1025,11 @@
     public boolean hasNavigationBar();
 
     /**
+     * Lock the device now.
+     */
+    public void lockNow();
+
+    /**
      * Print the WindowManagerPolicy's state into the given stream.
      *
      * @param prefix Text to print at the front of each line.
diff --git a/core/java/android/view/WindowOrientationListener.java b/core/java/android/view/WindowOrientationListener.java
index c3c74a7..c28b220 100755
--- a/core/java/android/view/WindowOrientationListener.java
+++ b/core/java/android/view/WindowOrientationListener.java
@@ -21,6 +21,7 @@
 import android.hardware.SensorEvent;
 import android.hardware.SensorEventListener;
 import android.hardware.SensorManager;
+import android.util.FloatMath;
 import android.util.Log;
 import android.util.Slog;
 
@@ -48,6 +49,8 @@
     private static final boolean DEBUG = false;
     private static final boolean localLOGV = DEBUG || false;
 
+    private static final boolean USE_GRAVITY_SENSOR = false;
+
     private SensorManager mSensorManager;
     private boolean mEnabled;
     private int mRate;
@@ -79,7 +82,8 @@
     private WindowOrientationListener(Context context, int rate) {
         mSensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);
         mRate = rate;
-        mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
+        mSensor = mSensorManager.getDefaultSensor(USE_GRAVITY_SENSOR
+                ? Sensor.TYPE_GRAVITY : Sensor.TYPE_ACCELEROMETER);
         if (mSensor != null) {
             // Create listener only if sensors do exist
             mSensorEventListener = new SensorEventListenerImpl(this);
@@ -179,7 +183,7 @@
      *    cartesian space because the orientation calculations are sensitive to the
      *    absolute magnitude of the acceleration.  In particular, there are singularities
      *    in the calculation as the magnitude approaches 0.  By performing the low-pass
-     *    filtering early, we can eliminate high-frequency impulses systematically.
+     *    filtering early, we can eliminate most spurious high-frequency impulses due to noise.
      *
      *  - Convert the acceleromter vector from cartesian to spherical coordinates.
      *    Since we're dealing with rotation of the device, this is the sensible coordinate
@@ -204,11 +208,17 @@
      *    new orientation proposal.
      *
      * Details are explained inline.
+     *
+     * See http://en.wikipedia.org/wiki/Low-pass_filter#Discrete-time_realization for
+     * signal processing background.
      */
     static final class SensorEventListenerImpl implements SensorEventListener {
         // We work with all angles in degrees in this class.
         private static final float RADIANS_TO_DEGREES = (float) (180 / Math.PI);
 
+        // Number of nanoseconds per millisecond.
+        private static final long NANOS_PER_MS = 1000000;
+
         // Indices into SensorEvent.values for the accelerometer sensor.
         private static final int ACCELEROMETER_DATA_X = 0;
         private static final int ACCELEROMETER_DATA_Y = 1;
@@ -216,38 +226,41 @@
 
         private final WindowOrientationListener mOrientationListener;
 
-        /* State for first order low-pass filtering of accelerometer data.
-         * See http://en.wikipedia.org/wiki/Low-pass_filter#Discrete-time_realization for
-         * signal processing background.
-         */
+        // The minimum amount of time that a predicted rotation must be stable before it
+        // is accepted as a valid rotation proposal.  This value can be quite small because
+        // the low-pass filter already suppresses most of the noise so we're really just
+        // looking for quick confirmation that the last few samples are in agreement as to
+        // the desired orientation.
+        private static final long PROPOSAL_SETTLE_TIME_NANOS = 40 * NANOS_PER_MS;
 
-        private long mLastTimestamp = Long.MAX_VALUE; // in nanoseconds
-        private float mLastFilteredX, mLastFilteredY, mLastFilteredZ;
+        // The minimum amount of time that must have elapsed since the device last exited
+        // the flat state (time since it was picked up) before the proposed rotation
+        // can change.
+        private static final long PROPOSAL_MIN_TIME_SINCE_FLAT_ENDED_NANOS = 500 * NANOS_PER_MS;
 
-        // The current proposal.  We wait for the proposal to be stable for a
-        // certain amount of time before accepting it.
-        //
-        // The basic idea is to ignore intermediate poses of the device while the
-        // user is picking up, putting down or turning the device.
-        private int mProposalRotation;
-        private long mProposalAgeMS;
+        // The mininum amount of time that must have elapsed since the device stopped
+        // swinging (time since device appeared to be in the process of being put down
+        // or put away into a pocket) before the proposed rotation can change.
+        private static final long PROPOSAL_MIN_TIME_SINCE_SWING_ENDED_NANOS = 300 * NANOS_PER_MS;
 
-        // A historical trace of tilt and orientation angles.  Used to determine whether
-        // the device posture has settled down.
-        private static final int HISTORY_SIZE = 20;
-        private int mHistoryIndex; // index of most recent sample
-        private int mHistoryLength; // length of historical trace
-        private final long[] mHistoryTimestampMS = new long[HISTORY_SIZE];
-        private final float[] mHistoryMagnitudes = new float[HISTORY_SIZE];
-        private final int[] mHistoryTiltAngles = new int[HISTORY_SIZE];
-        private final int[] mHistoryOrientationAngles = new int[HISTORY_SIZE];
+        // If the tilt angle remains greater than the specified angle for a minimum of
+        // the specified time, then the device is deemed to be lying flat
+        // (just chillin' on a table).
+        private static final float FLAT_ANGLE = 75;
+        private static final long FLAT_TIME_NANOS = 1000 * NANOS_PER_MS;
+
+        // If the tilt angle has increased by at least delta degrees within the specified amount
+        // of time, then the device is deemed to be swinging away from the user
+        // down towards flat (tilt = 90).
+        private static final float SWING_AWAY_ANGLE_DELTA = 20;
+        private static final long SWING_TIME_NANOS = 300 * NANOS_PER_MS;
 
         // The maximum sample inter-arrival time in milliseconds.
         // If the acceleration samples are further apart than this amount in time, we reset the
         // state of the low-pass filter and orientation properties.  This helps to handle
         // boundary conditions when the device is turned on, wakes from suspend or there is
         // a significant gap in samples.
-        private static final float MAX_FILTER_DELTA_TIME_MS = 1000;
+        private static final long MAX_FILTER_DELTA_TIME_NANOS = 1000 * NANOS_PER_MS;
 
         // The acceleration filter time constant.
         //
@@ -267,8 +280,10 @@
         //
         // Filtering adds latency proportional the time constant (inversely proportional
         // to the cutoff frequency) so we don't want to make the time constant too
-        // large or we can lose responsiveness.
-        private static final float FILTER_TIME_CONSTANT_MS = 100.0f;
+        // large or we can lose responsiveness.  Likewise we don't want to make it too
+        // small or we do a poor job suppressing acceleration spikes.
+        // Empirically, 100ms seems to be too small and 500ms is too large.
+        private static final float FILTER_TIME_CONSTANT_MS = 200.0f;
 
         /* State for orientation detection. */
 
@@ -286,9 +301,9 @@
         //
         // In both cases, we postpone choosing an orientation.
         private static final float MIN_ACCELERATION_MAGNITUDE =
-                SensorManager.STANDARD_GRAVITY * 0.5f;
+                SensorManager.STANDARD_GRAVITY * 0.3f;
         private static final float MAX_ACCELERATION_MAGNITUDE =
-            SensorManager.STANDARD_GRAVITY * 1.5f;
+            SensorManager.STANDARD_GRAVITY * 1.25f;
 
         // Maximum absolute tilt angle at which to consider orientation data.  Beyond this (i.e.
         // when screen is facing the sky or ground), we completely ignore orientation data.
@@ -306,10 +321,10 @@
         // The ideal tilt angle is 0 (when the device is vertical) so the limits establish
         // how close to vertical the device must be in order to change orientation.
         private static final int[][] TILT_TOLERANCE = new int[][] {
-            /* ROTATION_0   */ { -20, 70 },
-            /* ROTATION_90  */ { -20, 60 },
-            /* ROTATION_180 */ { -20, 50 },
-            /* ROTATION_270 */ { -20, 60 }
+            /* ROTATION_0   */ { -25, 70 },
+            /* ROTATION_90  */ { -25, 65 },
+            /* ROTATION_180 */ { -25, 60 },
+            /* ROTATION_270 */ { -25, 65 }
         };
 
         // The gap angle in degrees between adjacent orientation angles for hysteresis.
@@ -319,29 +334,38 @@
         // orientation.
         private static final int ADJACENT_ORIENTATION_ANGLE_GAP = 45;
 
-        // The number of milliseconds for which the device posture must be stable
-        // before we perform an orientation change.  If the device appears to be rotating
-        // (being picked up, put down) then we keep waiting until it settles.
-        private static final int SETTLE_TIME_MS = 200;
+        // Timestamp and value of the last accelerometer sample.
+        private long mLastFilteredTimestampNanos;
+        private float mLastFilteredX, mLastFilteredY, mLastFilteredZ;
 
-        // The maximum change in magnitude that can occur during the settle time.
-        // Tuning this constant particularly helps to filter out situations where the
-        // device is being picked up or put down by the user.
-        private static final float SETTLE_MAGNITUDE_MAX_DELTA =
-                SensorManager.STANDARD_GRAVITY * 0.2f;
+        // The last proposed rotation, -1 if unknown.
+        private int mProposedRotation;
 
-        // The maximum change in tilt angle that can occur during the settle time.
-        private static final int SETTLE_TILT_ANGLE_MAX_DELTA = 5;
+        // Value of the current predicted rotation, -1 if unknown.
+        private int mPredictedRotation;
 
-        // The maximum change in orientation angle that can occur during the settle time.
-        private static final int SETTLE_ORIENTATION_ANGLE_MAX_DELTA = 5;
+        // Timestamp of when the predicted rotation most recently changed.
+        private long mPredictedRotationTimestampNanos;
+
+        // Timestamp when the device last appeared to be flat for sure (the flat delay elapsed).
+        private long mFlatTimestampNanos;
+
+        // Timestamp when the device last appeared to be swinging.
+        private long mSwingTimestampNanos;
+
+        // History of observed tilt angles.
+        private static final int TILT_HISTORY_SIZE = 40;
+        private float[] mTiltHistory = new float[TILT_HISTORY_SIZE];
+        private long[] mTiltHistoryTimestampNanos = new long[TILT_HISTORY_SIZE];
+        private int mTiltHistoryIndex;
 
         public SensorEventListenerImpl(WindowOrientationListener orientationListener) {
             mOrientationListener = orientationListener;
+            reset();
         }
 
         public int getProposedRotation() {
-            return mProposalAgeMS >= SETTLE_TIME_MS ? mProposalRotation : -1;
+            return mProposedRotation;
         }
 
         @Override
@@ -359,8 +383,9 @@
             float z = event.values[ACCELEROMETER_DATA_Z];
 
             if (log) {
-                Slog.v(TAG, "Raw acceleration vector: " +
-                        "x=" + x + ", y=" + y + ", z=" + z);
+                Slog.v(TAG, "Raw acceleration vector: "
+                        + "x=" + x + ", y=" + y + ", z=" + z
+                        + ", magnitude=" + FloatMath.sqrt(x * x + y * y + z * z));
             }
 
             // Apply a low-pass filter to the acceleration up vector in cartesian space.
@@ -368,14 +393,16 @@
             // or when we see values of (0, 0, 0) which indicates that we polled the
             // accelerometer too soon after turning it on and we don't have any data yet.
             final long now = event.timestamp;
-            final float timeDeltaMS = (now - mLastTimestamp) * 0.000001f;
-            boolean skipSample;
-            if (timeDeltaMS <= 0 || timeDeltaMS > MAX_FILTER_DELTA_TIME_MS
+            final long then = mLastFilteredTimestampNanos;
+            final float timeDeltaMS = (now - then) * 0.000001f;
+            final boolean skipSample;
+            if (now < then
+                    || now > then + MAX_FILTER_DELTA_TIME_NANOS
                     || (x == 0 && y == 0 && z == 0)) {
                 if (log) {
                     Slog.v(TAG, "Resetting orientation listener.");
                 }
-                clearProposal();
+                reset();
                 skipSample = true;
             } else {
                 final float alpha = timeDeltaMS / (FILTER_TIME_CONSTANT_MS + timeDeltaMS);
@@ -383,27 +410,28 @@
                 y = alpha * (y - mLastFilteredY) + mLastFilteredY;
                 z = alpha * (z - mLastFilteredZ) + mLastFilteredZ;
                 if (log) {
-                    Slog.v(TAG, "Filtered acceleration vector: " +
-                            "x=" + x + ", y=" + y + ", z=" + z);
+                    Slog.v(TAG, "Filtered acceleration vector: "
+                            + "x=" + x + ", y=" + y + ", z=" + z
+                            + ", magnitude=" + FloatMath.sqrt(x * x + y * y + z * z));
                 }
                 skipSample = false;
             }
-            mLastTimestamp = now;
+            mLastFilteredTimestampNanos = now;
             mLastFilteredX = x;
             mLastFilteredY = y;
             mLastFilteredZ = z;
 
-            final int oldProposedRotation = getProposedRotation();
+            boolean isFlat = false;
+            boolean isSwinging = false;
             if (!skipSample) {
                 // Calculate the magnitude of the acceleration vector.
-                final float magnitude = (float) Math.sqrt(x * x + y * y + z * z);
+                final float magnitude = FloatMath.sqrt(x * x + y * y + z * z);
                 if (magnitude < MIN_ACCELERATION_MAGNITUDE
                         || magnitude > MAX_ACCELERATION_MAGNITUDE) {
                     if (log) {
-                        Slog.v(TAG, "Ignoring sensor data, magnitude out of range: "
-                                + "magnitude=" + magnitude);
+                        Slog.v(TAG, "Ignoring sensor data, magnitude out of range.");
                     }
-                    clearProposal();
+                    clearPredictedRotation();
                 } else {
                     // Calculate the tilt angle.
                     // This is the angle between the up vector and the x-y plane (the plane of
@@ -414,14 +442,25 @@
                     final int tiltAngle = (int) Math.round(
                             Math.asin(z / magnitude) * RADIANS_TO_DEGREES);
 
+                    // Determine whether the device appears to be flat or swinging.
+                    if (isFlat(now)) {
+                        isFlat = true;
+                        mFlatTimestampNanos = now;
+                    }
+                    if (isSwinging(now, tiltAngle)) {
+                        isSwinging = true;
+                        mSwingTimestampNanos = now;
+                    }
+                    addTiltHistoryEntry(now, tiltAngle);
+
                     // If the tilt angle is too close to horizontal then we cannot determine
                     // the orientation angle of the screen.
                     if (Math.abs(tiltAngle) > MAX_TILT) {
                         if (log) {
                             Slog.v(TAG, "Ignoring sensor data, tilt angle too high: "
-                                    + "magnitude=" + magnitude + ", tiltAngle=" + tiltAngle);
+                                    + "tiltAngle=" + tiltAngle);
                         }
-                        clearProposal();
+                        clearPredictedRotation();
                     } else {
                         // Calculate the orientation angle.
                         // This is the angle between the x-y projection of the up vector onto
@@ -439,89 +478,93 @@
                             nearestRotation = 0;
                         }
 
-                        // Determine the proposed orientation.
-                        // The confidence of the proposal is 1.0 when it is ideal and it
-                        // decays exponentially as the proposal moves further from the ideal
-                        // angle, tilt and magnitude of the proposed orientation.
-                        if (!isTiltAngleAcceptable(nearestRotation, tiltAngle)
-                                || !isOrientationAngleAcceptable(nearestRotation,
+                        // Determine the predicted orientation.
+                        if (isTiltAngleAcceptable(nearestRotation, tiltAngle)
+                                && isOrientationAngleAcceptable(nearestRotation,
                                         orientationAngle)) {
+                            updatePredictedRotation(now, nearestRotation);
                             if (log) {
-                                Slog.v(TAG, "Ignoring sensor data, no proposal: "
-                                        + "magnitude=" + magnitude + ", tiltAngle=" + tiltAngle
-                                        + ", orientationAngle=" + orientationAngle);
+                                Slog.v(TAG, "Predicted: "
+                                        + "tiltAngle=" + tiltAngle
+                                        + ", orientationAngle=" + orientationAngle
+                                        + ", predictedRotation=" + mPredictedRotation
+                                        + ", predictedRotationAgeMS="
+                                                + ((now - mPredictedRotationTimestampNanos)
+                                                        * 0.000001f));
                             }
-                            clearProposal();
                         } else {
                             if (log) {
-                                Slog.v(TAG, "Proposal: "
-                                        + "magnitude=" + magnitude
-                                        + ", tiltAngle=" + tiltAngle
-                                        + ", orientationAngle=" + orientationAngle
-                                        + ", proposalRotation=" + mProposalRotation);
+                                Slog.v(TAG, "Ignoring sensor data, no predicted rotation: "
+                                        + "tiltAngle=" + tiltAngle
+                                        + ", orientationAngle=" + orientationAngle);
                             }
-                            updateProposal(nearestRotation, now / 1000000L,
-                                    magnitude, tiltAngle, orientationAngle);
+                            clearPredictedRotation();
                         }
                     }
                 }
             }
 
+            // Determine new proposed rotation.
+            final int oldProposedRotation = mProposedRotation;
+            if (mPredictedRotation < 0 || isPredictedRotationAcceptable(now)) {
+                mProposedRotation = mPredictedRotation;
+            }
+
             // Write final statistics about where we are in the orientation detection process.
-            final int proposedRotation = getProposedRotation();
             if (log) {
-                final float proposalConfidence = Math.min(
-                        mProposalAgeMS * 1.0f / SETTLE_TIME_MS, 1.0f);
                 Slog.v(TAG, "Result: currentRotation=" + mOrientationListener.mCurrentRotation
-                        + ", proposedRotation=" + proposedRotation
+                        + ", proposedRotation=" + mProposedRotation
+                        + ", predictedRotation=" + mPredictedRotation
                         + ", timeDeltaMS=" + timeDeltaMS
-                        + ", proposalRotation=" + mProposalRotation
-                        + ", proposalAgeMS=" + mProposalAgeMS
-                        + ", proposalConfidence=" + proposalConfidence);
+                        + ", isFlat=" + isFlat
+                        + ", isSwinging=" + isSwinging
+                        + ", timeUntilSettledMS=" + remainingMS(now,
+                                mPredictedRotationTimestampNanos + PROPOSAL_SETTLE_TIME_NANOS)
+                        + ", timeUntilFlatDelayExpiredMS=" + remainingMS(now,
+                                mFlatTimestampNanos + PROPOSAL_MIN_TIME_SINCE_FLAT_ENDED_NANOS)
+                        + ", timeUntilSwingDelayExpiredMS=" + remainingMS(now,
+                                mSwingTimestampNanos + PROPOSAL_MIN_TIME_SINCE_SWING_ENDED_NANOS));
             }
 
             // Tell the listener.
-            if (proposedRotation != oldProposedRotation && proposedRotation >= 0) {
+            if (mProposedRotation != oldProposedRotation && mProposedRotation >= 0) {
                 if (log) {
-                    Slog.v(TAG, "Proposed rotation changed!  proposedRotation=" + proposedRotation
+                    Slog.v(TAG, "Proposed rotation changed!  proposedRotation=" + mProposedRotation
                             + ", oldProposedRotation=" + oldProposedRotation);
                 }
-                mOrientationListener.onProposedRotationChanged(proposedRotation);
+                mOrientationListener.onProposedRotationChanged(mProposedRotation);
             }
         }
 
         /**
-         * Returns true if the tilt angle is acceptable for a proposed
-         * orientation transition.
+         * Returns true if the tilt angle is acceptable for a given predicted rotation.
          */
-        private boolean isTiltAngleAcceptable(int proposedRotation,
-                int tiltAngle) {
-            return tiltAngle >= TILT_TOLERANCE[proposedRotation][0]
-                    && tiltAngle <= TILT_TOLERANCE[proposedRotation][1];
+        private boolean isTiltAngleAcceptable(int rotation, int tiltAngle) {
+            return tiltAngle >= TILT_TOLERANCE[rotation][0]
+                    && tiltAngle <= TILT_TOLERANCE[rotation][1];
         }
 
         /**
-         * Returns true if the orientation angle is acceptable for a proposed
-         * orientation transition.
+         * Returns true if the orientation angle is acceptable for a given predicted rotation.
          *
          * This function takes into account the gap between adjacent orientations
          * for hysteresis.
          */
-        private boolean isOrientationAngleAcceptable(int proposedRotation, int orientationAngle) {
+        private boolean isOrientationAngleAcceptable(int rotation, int orientationAngle) {
             // If there is no current rotation, then there is no gap.
             // The gap is used only to introduce hysteresis among advertised orientation
             // changes to avoid flapping.
             final int currentRotation = mOrientationListener.mCurrentRotation;
             if (currentRotation >= 0) {
-                // If the proposed rotation is the same or is counter-clockwise adjacent,
-                // then we set a lower bound on the orientation angle.
+                // If the specified rotation is the same or is counter-clockwise adjacent
+                // to the current rotation, then we set a lower bound on the orientation angle.
                 // For example, if currentRotation is ROTATION_0 and proposed is ROTATION_90,
                 // then we want to check orientationAngle > 45 + GAP / 2.
-                if (proposedRotation == currentRotation
-                        || proposedRotation == (currentRotation + 1) % 4) {
-                    int lowerBound = proposedRotation * 90 - 45
+                if (rotation == currentRotation
+                        || rotation == (currentRotation + 1) % 4) {
+                    int lowerBound = rotation * 90 - 45
                             + ADJACENT_ORIENTATION_ANGLE_GAP / 2;
-                    if (proposedRotation == 0) {
+                    if (rotation == 0) {
                         if (orientationAngle >= 315 && orientationAngle < lowerBound + 360) {
                             return false;
                         }
@@ -532,15 +575,15 @@
                     }
                 }
 
-                // If the proposed rotation is the same or is clockwise adjacent,
+                // If the specified rotation is the same or is clockwise adjacent,
                 // then we set an upper bound on the orientation angle.
-                // For example, if currentRotation is ROTATION_0 and proposed is ROTATION_270,
+                // For example, if currentRotation is ROTATION_0 and rotation is ROTATION_270,
                 // then we want to check orientationAngle < 315 - GAP / 2.
-                if (proposedRotation == currentRotation
-                        || proposedRotation == (currentRotation + 3) % 4) {
-                    int upperBound = proposedRotation * 90 + 45
+                if (rotation == currentRotation
+                        || rotation == (currentRotation + 3) % 4) {
+                    int upperBound = rotation * 90 + 45
                             - ADJACENT_ORIENTATION_ANGLE_GAP / 2;
-                    if (proposedRotation == 0) {
+                    if (rotation == 0) {
                         if (orientationAngle <= 45 && orientationAngle > upperBound) {
                             return false;
                         }
@@ -554,58 +597,97 @@
             return true;
         }
 
-        private void clearProposal() {
-            mProposalRotation = -1;
-            mProposalAgeMS = 0;
+        /**
+         * Returns true if the predicted rotation is ready to be advertised as a
+         * proposed rotation.
+         */
+        private boolean isPredictedRotationAcceptable(long now) {
+            // The predicted rotation must have settled long enough.
+            if (now < mPredictedRotationTimestampNanos + PROPOSAL_SETTLE_TIME_NANOS) {
+                return false;
+            }
+
+            // The last flat state (time since picked up) must have been sufficiently long ago.
+            if (now < mFlatTimestampNanos + PROPOSAL_MIN_TIME_SINCE_FLAT_ENDED_NANOS) {
+                return false;
+            }
+
+            // The last swing state (time since last movement to put down) must have been
+            // sufficiently long ago.
+            if (now < mSwingTimestampNanos + PROPOSAL_MIN_TIME_SINCE_SWING_ENDED_NANOS) {
+                return false;
+            }
+
+            // Looks good!
+            return true;
         }
 
-        private void updateProposal(int rotation, long timestampMS,
-                float magnitude, int tiltAngle, int orientationAngle) {
-            if (mProposalRotation != rotation) {
-                mProposalRotation = rotation;
-                mHistoryIndex = 0;
-                mHistoryLength = 0;
-            }
-
-            final int index = mHistoryIndex;
-            mHistoryTimestampMS[index] = timestampMS;
-            mHistoryMagnitudes[index] = magnitude;
-            mHistoryTiltAngles[index] = tiltAngle;
-            mHistoryOrientationAngles[index] = orientationAngle;
-            mHistoryIndex = (index + 1) % HISTORY_SIZE;
-            if (mHistoryLength < HISTORY_SIZE) {
-                mHistoryLength += 1;
-            }
-
-            long age = 0;
-            for (int i = 1; i < mHistoryLength; i++) {
-                final int olderIndex = (index + HISTORY_SIZE - i) % HISTORY_SIZE;
-                if (Math.abs(mHistoryMagnitudes[olderIndex] - magnitude)
-                        > SETTLE_MAGNITUDE_MAX_DELTA) {
-                    break;
-                }
-                if (angleAbsoluteDelta(mHistoryTiltAngles[olderIndex],
-                        tiltAngle) > SETTLE_TILT_ANGLE_MAX_DELTA) {
-                    break;
-                }
-                if (angleAbsoluteDelta(mHistoryOrientationAngles[olderIndex],
-                        orientationAngle) > SETTLE_ORIENTATION_ANGLE_MAX_DELTA) {
-                    break;
-                }
-                age = timestampMS - mHistoryTimestampMS[olderIndex];
-                if (age >= SETTLE_TIME_MS) {
-                    break;
-                }
-            }
-            mProposalAgeMS = age;
+        private void reset() {
+            mLastFilteredTimestampNanos = Long.MIN_VALUE;
+            mProposedRotation = -1;
+            mFlatTimestampNanos = Long.MIN_VALUE;
+            mSwingTimestampNanos = Long.MIN_VALUE;
+            clearPredictedRotation();
+            clearTiltHistory();
         }
 
-        private static int angleAbsoluteDelta(int a, int b) {
-            int delta = Math.abs(a - b);
-            if (delta > 180) {
-                delta = 360 - delta;
+        private void clearPredictedRotation() {
+            mPredictedRotation = -1;
+            mPredictedRotationTimestampNanos = Long.MIN_VALUE;
+        }
+
+        private void updatePredictedRotation(long now, int rotation) {
+            if (mPredictedRotation != rotation) {
+                mPredictedRotation = rotation;
+                mPredictedRotationTimestampNanos = now;
             }
-            return delta;
+        }
+
+        private void clearTiltHistory() {
+            mTiltHistoryTimestampNanos[0] = Long.MIN_VALUE;
+            mTiltHistoryIndex = 1;
+        }
+
+        private void addTiltHistoryEntry(long now, float tilt) {
+            mTiltHistory[mTiltHistoryIndex] = tilt;
+            mTiltHistoryTimestampNanos[mTiltHistoryIndex] = now;
+            mTiltHistoryIndex = (mTiltHistoryIndex + 1) % TILT_HISTORY_SIZE;
+            mTiltHistoryTimestampNanos[mTiltHistoryIndex] = Long.MIN_VALUE;
+        }
+
+        private boolean isFlat(long now) {
+            for (int i = mTiltHistoryIndex; (i = nextTiltHistoryIndex(i)) >= 0; ) {
+                if (mTiltHistory[i] < FLAT_ANGLE) {
+                    break;
+                }
+                if (mTiltHistoryTimestampNanos[i] + FLAT_TIME_NANOS <= now) {
+                    // Tilt has remained greater than FLAT_TILT_ANGLE for FLAT_TIME_NANOS.
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        private boolean isSwinging(long now, float tilt) {
+            for (int i = mTiltHistoryIndex; (i = nextTiltHistoryIndex(i)) >= 0; ) {
+                if (mTiltHistoryTimestampNanos[i] + SWING_TIME_NANOS < now) {
+                    break;
+                }
+                if (mTiltHistory[i] + SWING_AWAY_ANGLE_DELTA <= tilt) {
+                    // Tilted away by SWING_AWAY_ANGLE_DELTA within SWING_TIME_NANOS.
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        private int nextTiltHistoryIndex(int index) {
+            index = (index == 0 ? TILT_HISTORY_SIZE : index) - 1;
+            return mTiltHistoryTimestampNanos[index] != Long.MIN_VALUE ? index : -1;
+        }
+
+        private static float remainingMS(long now, long until) {
+            return now >= until ? 0 : (until - now) * 0.000001f;
         }
     }
 }
diff --git a/core/java/android/view/accessibility/AccessibilityInteractionClient.java b/core/java/android/view/accessibility/AccessibilityInteractionClient.java
index 95c070c..072fdd8 100644
--- a/core/java/android/view/accessibility/AccessibilityInteractionClient.java
+++ b/core/java/android/view/accessibility/AccessibilityInteractionClient.java
@@ -24,7 +24,9 @@
 import android.util.Log;
 import android.util.LongSparseArray;
 import android.util.SparseArray;
+import android.view.AccessibilityNodeInfoCache;
 
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -97,6 +99,11 @@
     private static final SparseArray<IAccessibilityServiceConnection> sConnectionCache =
         new SparseArray<IAccessibilityServiceConnection>();
 
+    // The connection cache is shared between all interrogating threads since
+    // at any given time there is only one window allowing querying.
+    private static final AccessibilityNodeInfoCache sAccessibilityNodeInfoCache =
+        AccessibilityNodeInfoCache.newSynchronizedAccessibilityNodeInfoCache();
+
     /**
      * @return The client for the current thread.
      */
@@ -145,7 +152,9 @@
      * Finds an {@link AccessibilityNodeInfo} by accessibility id.
      *
      * @param connectionId The id of a connection for interacting with the system.
-     * @param accessibilityWindowId A unique window id.
+     * @param accessibilityWindowId A unique window id. Use
+     *     {@link com.android.server.accessibility.AccessibilityManagerService#ACTIVE_WINDOW_ID}
+     *     to query the currently active window.
      * @param accessibilityNodeId A unique node accessibility id
      *     (accessibility view and virtual descendant id).
      * @return An {@link AccessibilityNodeInfo} if found, null otherwise.
@@ -155,16 +164,22 @@
         try {
             IAccessibilityServiceConnection connection = getConnection(connectionId);
             if (connection != null) {
+                AccessibilityNodeInfo cachedInfo = sAccessibilityNodeInfoCache.get(accessibilityNodeId); 
+                if (cachedInfo != null) {
+                    return cachedInfo;
+                }
                 final int interactionId = mInteractionIdCounter.getAndIncrement();
                 final float windowScale = connection.findAccessibilityNodeInfoByAccessibilityId(
                         accessibilityWindowId, accessibilityNodeId, interactionId, this,
                         Thread.currentThread().getId());
                 // If the scale is zero the call has failed.
                 if (windowScale > 0) {
-                    AccessibilityNodeInfo info = getFindAccessibilityNodeInfoResultAndClear(
+                    List<AccessibilityNodeInfo> infos = getFindAccessibilityNodeInfosResultAndClear(
                             interactionId);
-                    finalizeAccessibilityNodeInfo(info, connectionId, windowScale);
-                    return info;
+                    finalizeAccessibilityNodeInfos(infos, connectionId, windowScale);
+                    if (infos != null && !infos.isEmpty()) {
+                        return infos.get(0);
+                    }
                 }
             } else {
                 if (DEBUG) {
@@ -181,22 +196,30 @@
     }
 
     /**
-     * Finds an {@link AccessibilityNodeInfo} by View id. The search is performed
-     * in the currently active window and starts from the root View in the window.
+     * Finds an {@link AccessibilityNodeInfo} by View id. The search is performed in
+     * the window whose id is specified and starts from the node whose accessibility
+     * id is specified.
      *
      * @param connectionId The id of a connection for interacting with the system.
+     * @param accessibilityWindowId A unique window id. Use
+     *     {@link com.android.server.accessibility.AccessibilityManagerService#ACTIVE_WINDOW_ID}
+     *     to query the currently active window.
+     * @param accessibilityNodeId A unique view id from where to start the search. Use
+     *     {@link com.android.server.accessibility.AccessibilityManagerService#ROOT_NODE_ID}
+     *     to start from the root.
      * @param viewId The id of the view.
      * @return An {@link AccessibilityNodeInfo} if found, null otherwise.
      */
-    public AccessibilityNodeInfo findAccessibilityNodeInfoByViewIdInActiveWindow(int connectionId,
-            int viewId) {
+    public AccessibilityNodeInfo findAccessibilityNodeInfoByViewId(int connectionId,
+            int accessibilityWindowId, long accessibilityNodeId, int viewId) {
         try {
             IAccessibilityServiceConnection connection = getConnection(connectionId);
             if (connection != null) {
                 final int interactionId = mInteractionIdCounter.getAndIncrement();
                 final float windowScale =
-                    connection.findAccessibilityNodeInfoByViewIdInActiveWindow(viewId,
-                            interactionId, this, Thread.currentThread().getId());
+                    connection.findAccessibilityNodeInfoByViewId(accessibilityWindowId,
+                            accessibilityNodeId, viewId, interactionId, this,
+                            Thread.currentThread().getId());
                 // If the scale is zero the call has failed.
                 if (windowScale > 0) {
                     AccessibilityNodeInfo info = getFindAccessibilityNodeInfoResultAndClear(
@@ -220,64 +243,27 @@
 
     /**
      * Finds {@link AccessibilityNodeInfo}s by View text. The match is case
-     * insensitive containment. The search is performed in the currently
-     * active window and starts from the root View in the window.
-     *
-     * @param connectionId The id of a connection for interacting with the system.
-     * @param text The searched text.
-     * @return A list of found {@link AccessibilityNodeInfo}s.
-     */
-    public List<AccessibilityNodeInfo> findAccessibilityNodeInfosByTextInActiveWindow(
-            int connectionId, String text) {
-        try {
-            IAccessibilityServiceConnection connection = getConnection(connectionId);
-            if (connection != null) {
-                final int interactionId = mInteractionIdCounter.getAndIncrement();
-                final float windowScale =
-                    connection.findAccessibilityNodeInfosByTextInActiveWindow(text,
-                            interactionId, this, Thread.currentThread().getId());
-                // If the scale is zero the call has failed.
-                if (windowScale > 0) {
-                    List<AccessibilityNodeInfo> infos = getFindAccessibilityNodeInfosResultAndClear(
-                            interactionId);
-                    finalizeAccessibilityNodeInfos(infos, connectionId, windowScale);
-                    return infos;
-                }
-            } else {
-                if (DEBUG) {
-                    Log.w(LOG_TAG, "No connection for connection id: " + connectionId);
-                }
-            }
-        } catch (RemoteException re) {
-            if (DEBUG) {
-                Log.w(LOG_TAG, "Error while calling remote"
-                        + " findAccessibilityNodeInfosByViewTextInActiveWindow", re);
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Finds {@link AccessibilityNodeInfo}s by View text. The match is case
      * insensitive containment. The search is performed in the window whose
-     * id is specified and starts from the View whose accessibility id is
+     * id is specified and starts from the node whose accessibility id is
      * specified.
      *
      * @param connectionId The id of a connection for interacting with the system.
+     * @param accessibilityWindowId A unique window id. Use
+     *     {@link com.android.server.accessibility.AccessibilityManagerService#ACTIVE_WINDOW_ID}
+     *     to query the currently active window.
+     * @param accessibilityNodeId A unique view id from where to start the search. Use
+     *     {@link com.android.server.accessibility.AccessibilityManagerService#ROOT_NODE_ID}
      * @param text The searched text.
-     * @param accessibilityWindowId A unique window id.
-     * @param accessibilityNodeId A unique node id (accessibility and virtual descendant id) from
-     *        where to start the search. Use {@link android.view.View#NO_ID} to start from the root.
      * @return A list of found {@link AccessibilityNodeInfo}s.
      */
     public List<AccessibilityNodeInfo> findAccessibilityNodeInfosByText(int connectionId,
-            String text, int accessibilityWindowId, long accessibilityNodeId) {
+            int accessibilityWindowId, long accessibilityNodeId, String text) {
         try {
             IAccessibilityServiceConnection connection = getConnection(connectionId);
             if (connection != null) {
                 final int interactionId = mInteractionIdCounter.getAndIncrement();
-                final float windowScale = connection.findAccessibilityNodeInfosByText(text,
-                        accessibilityWindowId, accessibilityNodeId, interactionId, this,
+                final float windowScale = connection.findAccessibilityNodeInfosByText(
+                        accessibilityWindowId, accessibilityNodeId, text, interactionId, this,
                         Thread.currentThread().getId());
                 // If the scale is zero the call has failed.
                 if (windowScale > 0) {
@@ -304,7 +290,9 @@
      * Performs an accessibility action on an {@link AccessibilityNodeInfo}.
      *
      * @param connectionId The id of a connection for interacting with the system.
-     * @param accessibilityWindowId The id of the window.
+     * @param accessibilityWindowId A unique window id. Use
+     *     {@link com.android.server.accessibility.AccessibilityManagerService#ACTIVE_WINDOW_ID}
+     *     to query the currently active window.
      * @param accessibilityNodeId A unique node id (accessibility and virtual descendant id).
      * @param action The action to perform.
      * @return Whether the action was performed.
@@ -319,7 +307,7 @@
                         accessibilityWindowId, accessibilityNodeId, action, interactionId, this,
                         Thread.currentThread().getId());
                 if (success) {
-                    return getPerformAccessibilityActionResult(interactionId);
+                    return getPerformAccessibilityActionResultAndClear(interactionId);
                 }
             } else {
                 if (DEBUG) {
@@ -334,6 +322,24 @@
         return false;
     }
 
+    public void clearCache() {
+        if (DEBUG) {
+            Log.w(LOG_TAG, "clearCache()");
+        }
+        sAccessibilityNodeInfoCache.clear();
+    }
+
+    public void removeCachedNode(long accessibilityNodeId) {
+        if (DEBUG) {
+            Log.w(LOG_TAG, "removeCachedNode(" + accessibilityNodeId +")");
+        }
+        sAccessibilityNodeInfoCache.remove(accessibilityNodeId);
+    }
+
+    public void onAccessibilityEvent(AccessibilityEvent event) {
+        sAccessibilityNodeInfoCache.onAccessibilityEvent(event);
+    }
+
     /**
      * Gets the the result of an async request that returns an {@link AccessibilityNodeInfo}.
      *
@@ -358,6 +364,9 @@
             if (interactionId > mInteractionId) {
                 mFindAccessibilityNodeInfoResult = info;
                 mInteractionId = interactionId;
+                if (info != null) {
+                    sAccessibilityNodeInfoCache.put(info.getSourceNodeId(), info);
+                }
             }
             mInstanceLock.notifyAll();
         }
@@ -386,8 +395,20 @@
                 int interactionId) {
         synchronized (mInstanceLock) {
             if (interactionId > mInteractionId) {
-                mFindAccessibilityNodeInfosResult = infos;
+                // If the call is not an IPC, i.e. it is made from the same process, we need to
+                // instantiate new result list to avoid passing internal instances to clients.
+                final boolean isIpcCall = (queryLocalInterface(getInterfaceDescriptor()) == null);
+                if (!isIpcCall) {
+                    mFindAccessibilityNodeInfosResult = new ArrayList<AccessibilityNodeInfo>(infos);
+                } else {
+                    mFindAccessibilityNodeInfosResult = infos;
+                }
                 mInteractionId = interactionId;
+                final int infoCount = infos.size();
+                for (int i = 0; i < infoCount; i ++) {
+                    AccessibilityNodeInfo info = infos.get(i);
+                    sAccessibilityNodeInfoCache.put(info.getSourceNodeId(), info);
+                }
             }
             mInstanceLock.notifyAll();
         }
@@ -399,7 +420,7 @@
      * @param interactionId The interaction id to match the result with the request.
      * @return Whether the action was performed.
      */
-    private boolean getPerformAccessibilityActionResult(int interactionId) {
+    private boolean getPerformAccessibilityActionResultAndClear(int interactionId) {
         synchronized (mInstanceLock) {
             final boolean success = waitForResultTimedLocked(interactionId);
             final boolean result = success ? mPerformAccessibilityActionResult : false;
diff --git a/core/java/android/view/accessibility/AccessibilityNodeInfo.java b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
index 6939c2c..d7d6792 100644
--- a/core/java/android/view/accessibility/AccessibilityNodeInfo.java
+++ b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
@@ -380,8 +380,8 @@
             return Collections.emptyList();
         }
         AccessibilityInteractionClient client = AccessibilityInteractionClient.getInstance();
-        return client.findAccessibilityNodeInfosByText(mConnectionId, text, mWindowId,
-                mSourceNodeId);
+        return client.findAccessibilityNodeInfosByText(mConnectionId, mWindowId, mSourceNodeId,
+                text);
     }
 
     /**
@@ -903,6 +903,17 @@
     }
 
     /**
+     * Gets the id of the source node.
+     *
+     * @return The id.
+     *
+     * @hide
+     */
+    public long getSourceNodeId() {
+        return mSourceNodeId;
+    }
+
+    /**
      * Sets if this instance is sealed.
      *
      * @param sealed Whether is sealed.
diff --git a/core/java/android/view/accessibility/AccessibilityRecord.java b/core/java/android/view/accessibility/AccessibilityRecord.java
index 07aeb9a..b60f50e 100644
--- a/core/java/android/view/accessibility/AccessibilityRecord.java
+++ b/core/java/android/view/accessibility/AccessibilityRecord.java
@@ -564,6 +564,17 @@
     }
 
     /**
+     * Gets the id of the source node.
+     *
+     * @return The id.
+     *
+     * @hide
+     */
+    public long getSourceNodeId() {
+        return mSourceNodeId;
+    }
+
+    /**
      * Sets the unique id of the IAccessibilityServiceConnection over which
      * this instance can send requests to the system.
      *
diff --git a/core/java/android/view/accessibility/IAccessibilityInteractionConnection.aidl b/core/java/android/view/accessibility/IAccessibilityInteractionConnection.aidl
index a90c427..ae6869c 100644
--- a/core/java/android/view/accessibility/IAccessibilityInteractionConnection.aidl
+++ b/core/java/android/view/accessibility/IAccessibilityInteractionConnection.aidl
@@ -31,13 +31,13 @@
         IAccessibilityInteractionConnectionCallback callback,
         int interrogatingPid, long interrogatingTid);
 
-    void findAccessibilityNodeInfoByViewId(int id, int interactionId,
+    void findAccessibilityNodeInfoByViewId(long accessibilityNodeId, int id, int interactionId,
         IAccessibilityInteractionConnectionCallback callback,
         int interrogatingPid, long interrogatingTid);
 
-    void findAccessibilityNodeInfosByText(String text, long accessibilityNodeId,
-        int interactionId, IAccessibilityInteractionConnectionCallback callback,
-        int interrogatingPid, long interrogatingTid);
+    void findAccessibilityNodeInfosByText(long accessibilityNodeId, String text, int interactionId,
+        IAccessibilityInteractionConnectionCallback callback, int interrogatingPid,
+        long interrogatingTid);
 
     void performAccessibilityAction(long accessibilityNodeId, int action, int interactionId,
         IAccessibilityInteractionConnectionCallback callback, int interrogatingPid,
diff --git a/core/java/android/view/accessibility/IAccessibilityManager.aidl b/core/java/android/view/accessibility/IAccessibilityManager.aidl
index c3794be..320c75d 100644
--- a/core/java/android/view/accessibility/IAccessibilityManager.aidl
+++ b/core/java/android/view/accessibility/IAccessibilityManager.aidl
@@ -49,5 +49,7 @@
 
     void removeAccessibilityInteractionConnection(IWindow windowToken);
 
-    void registerEventListener(IEventListener client);
+    void registerUiTestAutomationService(IEventListener listener, in AccessibilityServiceInfo info);
+
+    void unregisterUiTestAutomationService(IEventListener listener);
 }
diff --git a/core/java/android/view/inputmethod/BaseInputConnection.java b/core/java/android/view/inputmethod/BaseInputConnection.java
index 5ec1ec3..bd02d62 100644
--- a/core/java/android/view/inputmethod/BaseInputConnection.java
+++ b/core/java/android/view/inputmethod/BaseInputConnection.java
@@ -193,10 +193,12 @@
     /**
      * The default implementation performs the deletion around the current
      * selection position of the editable text.
+     * @param beforeLength
+     * @param afterLength
      */
-    public boolean deleteSurroundingText(int leftLength, int rightLength) {
-        if (DEBUG) Log.v(TAG, "deleteSurroundingText " + leftLength
-                + " / " + rightLength);
+    public boolean deleteSurroundingText(int beforeLength, int afterLength) {
+        if (DEBUG) Log.v(TAG, "deleteSurroundingText " + beforeLength
+                + " / " + afterLength);
         final Editable content = getEditable();
         if (content == null) return false;
 
@@ -226,17 +228,17 @@
 
         int deleted = 0;
 
-        if (leftLength > 0) {
-            int start = a - leftLength;
+        if (beforeLength > 0) {
+            int start = a - beforeLength;
             if (start < 0) start = 0;
             content.delete(start, a);
             deleted = a - start;
         }
 
-        if (rightLength > 0) {
+        if (afterLength > 0) {
             b = b - deleted;
 
-            int end = b + rightLength;
+            int end = b + afterLength;
             if (end > content.length()) end = content.length();
 
             content.delete(b, end);
diff --git a/core/java/android/view/inputmethod/EditorInfo.java b/core/java/android/view/inputmethod/EditorInfo.java
index ac378fc..5146567 100644
--- a/core/java/android/view/inputmethod/EditorInfo.java
+++ b/core/java/android/view/inputmethod/EditorInfo.java
@@ -168,6 +168,22 @@
     public static final int IME_FLAG_NO_ENTER_ACTION = 0x40000000;
 
     /**
+     * Flag of {@link #imeOptions}: used to request that the IME is capable of
+     * inputting ASCII characters.  The intention of this flag is to ensure that
+     * the user can type Roman alphabet characters in a {@link android.widget.TextView}
+     * used for, typically, account ID or password input.  It is expected that IMEs
+     * normally are able to input ASCII even without being told so (such IMEs
+     * already respect this flag in a sense), but there could be some cases they
+     * aren't when, for instance, only non-ASCII input languagaes like Arabic,
+     * Greek, Hebrew, Russian are enabled in the IME.  Applications need to be
+     * aware that the flag is not a guarantee, and not all IMEs will respect it.
+     * However, it is strongly recommended for IME authors to respect this flag
+     * especially when their IME could end up with a state that has only non-ASCII
+     * input languages enabled.
+     */
+    public static final int IME_FLAG_FORCE_ASCII = 0x80000000;
+
+    /**
      * Generic unspecified type for {@link #imeOptions}.
      */
     public static final int IME_NULL = 0x00000000;
diff --git a/core/java/android/view/inputmethod/InputConnection.java b/core/java/android/view/inputmethod/InputConnection.java
index a6639d1..3563d4d 100644
--- a/core/java/android/view/inputmethod/InputConnection.java
+++ b/core/java/android/view/inputmethod/InputConnection.java
@@ -138,19 +138,21 @@
             int flags);
 
     /**
-     * Delete <var>leftLength</var> characters of text before the current cursor
-     * position, and delete <var>rightLength</var> characters of text after the
-     * current cursor position, excluding composing text.
+     * Delete <var>beforeLength</var> characters of text before the current cursor
+     * position, and delete <var>afterLength</var> characters of text after the
+     * current cursor position, excluding composing text. Before and after refer
+     * to the order of the characters in the string, not to their visual representation.
      * 
-     * @param leftLength The number of characters to be deleted before the
+     *
+     * @param beforeLength The number of characters to be deleted before the
      *        current cursor position.
-     * @param rightLength The number of characters to be deleted after the
+     * @param afterLength The number of characters to be deleted after the
      *        current cursor position.
-     *        
+     *
      * @return Returns true on success, false if the input connection is no longer
      * valid.
      */
-    public boolean deleteSurroundingText(int leftLength, int rightLength);
+    public boolean deleteSurroundingText(int beforeLength, int afterLength);
 
     /**
      * Set composing text around the current cursor position with the given text,
diff --git a/core/java/android/view/inputmethod/InputConnectionWrapper.java b/core/java/android/view/inputmethod/InputConnectionWrapper.java
index 690ea85..a48473e 100644
--- a/core/java/android/view/inputmethod/InputConnectionWrapper.java
+++ b/core/java/android/view/inputmethod/InputConnectionWrapper.java
@@ -62,8 +62,8 @@
         return mTarget.getExtractedText(request, flags);
     }
 
-    public boolean deleteSurroundingText(int leftLength, int rightLength) {
-        return mTarget.deleteSurroundingText(leftLength, rightLength);
+    public boolean deleteSurroundingText(int beforeLength, int afterLength) {
+        return mTarget.deleteSurroundingText(beforeLength, afterLength);
     }
 
     public boolean setComposingText(CharSequence text, int newCursorPosition) {
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java
index b41e6f5..0985e14 100644
--- a/core/java/android/view/inputmethod/InputMethodManager.java
+++ b/core/java/android/view/inputmethod/InputMethodManager.java
@@ -651,19 +651,7 @@
                 }
             }
             
-            if (mServedInputConnection != null) {
-                // We need to tell the previously served view that it is no
-                // longer the input target, so it can reset its state.  Schedule
-                // this call on its window's Handler so it will be on the correct
-                // thread and outside of our lock.
-                Handler vh = mServedView.getHandler();
-                if (vh != null) {
-                    // This will result in a call to reportFinishInputConnection()
-                    // below.
-                    vh.sendMessage(vh.obtainMessage(ViewRootImpl.FINISH_INPUT_CONNECTION,
-                            mServedInputConnection));
-                }
-            }
+            notifyInputConnectionFinished();
             
             mServedView = null;
             mCompletions = null;
@@ -671,7 +659,25 @@
             clearConnectionLocked();
         }
     }
-    
+
+    /**
+     * Notifies the served view that the current InputConnection will no longer be used.
+     */
+    private void notifyInputConnectionFinished() {
+        if (mServedView != null && mServedInputConnection != null) {
+            // We need to tell the previously served view that it is no
+            // longer the input target, so it can reset its state.  Schedule
+            // this call on its window's Handler so it will be on the correct
+            // thread and outside of our lock.
+            Handler vh = mServedView.getHandler();
+            if (vh != null) {
+                // This will result in a call to reportFinishInputConnection() below.
+                vh.sendMessage(vh.obtainMessage(ViewRootImpl.FINISH_INPUT_CONNECTION,
+                        mServedInputConnection));
+            }
+        }
+    }
+
     /**
      * Called from the FINISH_INPUT_CONNECTION message above.
      * @hide
@@ -681,7 +687,7 @@
             ic.finishComposingText();
         }
     }
-    
+
     public void displayCompletions(View view, CompletionInfo[] completions) {
         checkFocus();
         synchronized (mH) {
@@ -831,7 +837,7 @@
      * shown with {@link #SHOW_FORCED}.
      */
     public static final int HIDE_NOT_ALWAYS = 0x0002;
-    
+
     /**
      * Synonym for {@link #hideSoftInputFromWindow(IBinder, int, ResultReceiver)}
      * without a result: request to hide the soft input window from the
@@ -993,7 +999,7 @@
         tba.fieldId = view.getId();
         InputConnection ic = view.onCreateInputConnection(tba);
         if (DEBUG) Log.v(TAG, "Starting input: tba=" + tba + " ic=" + ic);
-        
+
         synchronized (mH) {
             // Now that we are locked again, validate that our state hasn't
             // changed.
@@ -1012,6 +1018,8 @@
             // Hook 'em up and let 'er rip.
             mCurrentTextBoxAttribute = tba;
             mServedConnecting = false;
+            // Notify the served view that its previous input connection is finished
+            notifyInputConnectionFinished();
             mServedInputConnection = ic;
             IInputContext servedContext;
             if (ic != null) {
@@ -1115,7 +1123,7 @@
         }
     }
 
-    void scheduleCheckFocusLocked(View view) {
+    static void scheduleCheckFocusLocked(View view) {
         Handler vh = view.getHandler();
         if (vh != null && !vh.hasMessages(ViewRootImpl.CHECK_FOCUS)) {
             // This will result in a call to checkFocus() below.
diff --git a/core/java/android/view/textservice/SpellCheckerSubtype.java b/core/java/android/view/textservice/SpellCheckerSubtype.java
index 1bbaf6c..f235295 100644
--- a/core/java/android/view/textservice/SpellCheckerSubtype.java
+++ b/core/java/android/view/textservice/SpellCheckerSubtype.java
@@ -110,7 +110,6 @@
     }
 
     /**
-     * @hide
      * The string of ExtraValue in subtype should be defined as follows:
      * example: key0,key1=value1,key2,key3,key4=value4
      * @param key the key of extra value
@@ -121,7 +120,6 @@
     }
 
     /**
-     * @hide
      * The string of ExtraValue in subtype should be defined as follows:
      * example: key0,key1=value1,key2,key3,key4=value4
      * @param key the key of extra value
diff --git a/core/java/android/webkit/HTML5VideoFullScreen.java b/core/java/android/webkit/HTML5VideoFullScreen.java
index e1eff58..bc0557e 100644
--- a/core/java/android/webkit/HTML5VideoFullScreen.java
+++ b/core/java/android/webkit/HTML5VideoFullScreen.java
@@ -116,13 +116,12 @@
         return mVideoSurfaceView;
     }
 
-    HTML5VideoFullScreen(Context context, int videoLayerId, int position,
-            boolean autoStart) {
+    HTML5VideoFullScreen(Context context, int videoLayerId, int position) {
         mVideoSurfaceView = new VideoSurfaceView(context);
         mFullScreenMode = FULLSCREEN_OFF;
         mVideoWidth = 0;
         mVideoHeight = 0;
-        init(videoLayerId, position, autoStart);
+        init(videoLayerId, position);
     }
 
     private void setMediaController(MediaController m) {
@@ -186,11 +185,6 @@
         // after reading the MetaData
         if (mMediaController != null) {
             mMediaController.setEnabled(true);
-            // If paused , should show the controller for ever!
-            if (getAutostart())
-                mMediaController.show();
-            else
-                mMediaController.show(0);
         }
 
         if (mProgressView != null) {
@@ -201,6 +195,13 @@
         mVideoHeight = mp.getVideoHeight();
         // This will trigger the onMeasure to get the display size right.
         mVideoSurfaceView.getHolder().setFixedSize(mVideoWidth, mVideoHeight);
+        // Call into the native to ask for the state, if still in play mode,
+        // this will trigger the video to play.
+        mProxy.dispatchOnRestoreState();
+
+        if (getStartWhenPrepared()) {
+            mPlayer.start();
+        }
     }
 
     public boolean fullScreenExited() {
diff --git a/core/java/android/webkit/HTML5VideoInline.java b/core/java/android/webkit/HTML5VideoInline.java
index fe5908e..2d5b263 100644
--- a/core/java/android/webkit/HTML5VideoInline.java
+++ b/core/java/android/webkit/HTML5VideoInline.java
@@ -34,9 +34,8 @@
         }
     }
 
-    HTML5VideoInline(int videoLayerId, int position,
-            boolean autoStart) {
-        init(videoLayerId, position, autoStart);
+    HTML5VideoInline(int videoLayerId, int position) {
+        init(videoLayerId, position);
         mTextureNames = null;
     }
 
diff --git a/core/java/android/webkit/HTML5VideoView.java b/core/java/android/webkit/HTML5VideoView.java
index 67660b8..73166cb 100644
--- a/core/java/android/webkit/HTML5VideoView.java
+++ b/core/java/android/webkit/HTML5VideoView.java
@@ -52,10 +52,6 @@
     // Switching between inline and full screen will also create a new instance.
     protected MediaPlayer mPlayer;
 
-    // This will be set up every time we create the Video View object.
-    // Set to true only when switching into full screen while playing
-    protected boolean mAutostart;
-
     // We need to save such info.
     protected Uri mUri;
     protected Map<String, String> mHeaders;
@@ -141,22 +137,17 @@
         }
     }
 
-    public boolean getAutostart() {
-        return mAutostart;
-    }
-
     public boolean getPauseDuringPreparing() {
         return mPauseDuringPreparing;
     }
 
     // Every time we start a new Video, we create a VideoView and a MediaPlayer
-    public void init(int videoLayerId, int position, boolean autoStart) {
+    public void init(int videoLayerId, int position) {
         mPlayer = new MediaPlayer();
         mCurrentState = STATE_INITIALIZED;
         mProxy = null;
         mVideoLayerId = videoLayerId;
         mSaveSeekTime = position;
-        mAutostart = autoStart;
         mTimer = null;
         mPauseDuringPreparing = false;
     }
@@ -203,6 +194,25 @@
         mPlayer.setOnInfoListener(proxy);
     }
 
+    public void prepareDataCommon(HTML5VideoViewProxy proxy) {
+        try {
+            mPlayer.setDataSource(proxy.getContext(), mUri, mHeaders);
+            mPlayer.prepareAsync();
+        } catch (IllegalArgumentException e) {
+            e.printStackTrace();
+        } catch (IllegalStateException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        mCurrentState = STATE_NOTPREPARED;
+    }
+
+    public void reprepareData(HTML5VideoViewProxy proxy) {
+        mPlayer.reset();
+        prepareDataCommon(proxy);
+    }
+
     // Normally called immediately after setVideoURI. But for full screen,
     // this should be after surface holder created
     public void prepareDataAndDisplayMode(HTML5VideoViewProxy proxy) {
@@ -213,19 +223,8 @@
         setOnPreparedListener(proxy);
         setOnErrorListener(proxy);
         setOnInfoListener(proxy);
-        // When there is exception, we could just bail out silently.
-        // No Video will be played though. Write the stack for debug
-        try {
-            mPlayer.setDataSource(mProxy.getContext(), mUri, mHeaders);
-            mPlayer.prepareAsync();
-        } catch (IllegalArgumentException e) {
-            e.printStackTrace();
-        } catch (IllegalStateException e) {
-            e.printStackTrace();
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        mCurrentState = STATE_NOTPREPARED;
+
+        prepareDataCommon(proxy);
     }
 
 
@@ -333,4 +332,14 @@
         return false;
     }
 
+    private boolean m_startWhenPrepared = false;
+
+    public void setStartWhenPrepared(boolean willPlay) {
+        m_startWhenPrepared  = willPlay;
+    }
+
+    public boolean getStartWhenPrepared() {
+        return m_startWhenPrepared;
+    }
+
 }
diff --git a/core/java/android/webkit/HTML5VideoViewProxy.java b/core/java/android/webkit/HTML5VideoViewProxy.java
index d0237b5..d306c86 100644
--- a/core/java/android/webkit/HTML5VideoViewProxy.java
+++ b/core/java/android/webkit/HTML5VideoViewProxy.java
@@ -66,6 +66,7 @@
     private static final int POSTER_FETCHED    = 202;
     private static final int PAUSED            = 203;
     private static final int STOPFULLSCREEN    = 204;
+    private static final int RESTORESTATE      = 205;
 
     // Timer thread -> UI thread
     private static final int TIMEUPDATE = 300;
@@ -144,19 +145,16 @@
                 HTML5VideoViewProxy proxy, WebView webView) {
                 // Save the inline video info and inherit it in the full screen
                 int savePosition = 0;
-                boolean savedIsPlaying = false;
                 if (mHTML5VideoView != null) {
                     // If we are playing the same video, then it is better to
                     // save the current position.
                     if (layerId == mHTML5VideoView.getVideoLayerId()) {
                         savePosition = mHTML5VideoView.getCurrentPosition();
-                        savedIsPlaying = mHTML5VideoView.isPlaying();
                     }
-                    mHTML5VideoView.pauseAndDispatch(mCurrentProxy);
                     mHTML5VideoView.release();
                 }
                 mHTML5VideoView = new HTML5VideoFullScreen(proxy.getContext(),
-                        layerId, savePosition, savedIsPlaying);
+                        layerId, savePosition);
                 mCurrentProxy = proxy;
 
                 mHTML5VideoView.setVideoURI(url, mCurrentProxy);
@@ -164,6 +162,16 @@
                 mHTML5VideoView.enterFullScreenVideoState(layerId, proxy, webView);
         }
 
+        public static void exitFullScreenVideo(HTML5VideoViewProxy proxy,
+                WebView webView) {
+            if (!mHTML5VideoView.fullScreenExited() && mHTML5VideoView.isFullScreenMode()) {
+                WebChromeClient client = webView.getWebChromeClient();
+                if (client != null) {
+                    client.onHideCustomView();
+                }
+            }
+        }
+
         // This is on the UI thread.
         // When native tell Java to play, we need to check whether or not it is
         // still the same video by using videoLayerId and treat it differently.
@@ -174,6 +182,21 @@
             if (mHTML5VideoView != null) {
                 currentVideoLayerId = mHTML5VideoView.getVideoLayerId();
                 backFromFullScreenMode = mHTML5VideoView.fullScreenExited();
+
+                // When playing video back to back in full screen mode,
+                // javascript will switch the src and call play.
+                // In this case, we can just reuse the same full screen view,
+                // and play the video after prepared.
+                if (mHTML5VideoView.isFullScreenMode()
+                    && !backFromFullScreenMode
+                    && currentVideoLayerId != videoLayerId
+                    && mCurrentProxy != proxy) {
+                    mCurrentProxy = proxy;
+                    mHTML5VideoView.setStartWhenPrepared(true);
+                    mHTML5VideoView.setVideoURI(url, proxy);
+                    mHTML5VideoView.reprepareData(proxy);
+                    return;
+                }
             }
 
             if (backFromFullScreenMode
@@ -192,7 +215,7 @@
                     mHTML5VideoView.release();
                 }
                 mCurrentProxy = proxy;
-                mHTML5VideoView = new HTML5VideoInline(videoLayerId, time, false);
+                mHTML5VideoView = new HTML5VideoInline(videoLayerId, time);
 
                 mHTML5VideoView.setVideoURI(url, mCurrentProxy);
                 mHTML5VideoView.prepareDataAndDisplayMode(proxy);
@@ -235,7 +258,7 @@
         }
 
         public static void onPrepared() {
-            if (!mHTML5VideoView.isFullScreenMode() || mHTML5VideoView.getAutostart()) {
+            if (!mHTML5VideoView.isFullScreenMode()) {
                 mHTML5VideoView.start();
             }
             if (mBaseLayer != 0) {
@@ -297,6 +320,11 @@
         mWebCoreHandler.sendMessage(msg);
     }
 
+    public void dispatchOnRestoreState() {
+        Message msg = Message.obtain(mWebCoreHandler, RESTORESTATE);
+        mWebCoreHandler.sendMessage(msg);
+    }
+
     public void onTimeupdate() {
         sendMessage(obtainMessage(TIMEUPDATE));
     }
@@ -569,6 +597,9 @@
                     case STOPFULLSCREEN:
                         nativeOnStopFullscreen(mNativePointer);
                         break;
+                    case RESTORESTATE:
+                        nativeOnRestoreState(mNativePointer);
+                        break;
                 }
             }
         };
@@ -676,6 +707,10 @@
         VideoPlayer.enterFullScreenVideo(layerId, url, this, mWebView);
     }
 
+    public void exitFullScreenVideo() {
+        VideoPlayer.exitFullScreenVideo(this, mWebView);
+    }
+
     /**
      * The factory for HTML5VideoViewProxy instances.
      * @param webViewCore is the WebViewCore that is requesting the proxy.
@@ -696,6 +731,7 @@
     private native void nativeOnPosterFetched(Bitmap poster, int nativePointer);
     private native void nativeOnTimeupdate(int position, int nativePointer);
     private native void nativeOnStopFullscreen(int nativePointer);
+    private native void nativeOnRestoreState(int nativePointer);
     private native static boolean nativeSendSurfaceTexture(SurfaceTexture texture,
             int baseLayer, int videoLayerId, int textureName,
             int playerState);
diff --git a/core/java/android/webkit/Network.java b/core/java/android/webkit/Network.java
index 30bbb04..ee9b949 100644
--- a/core/java/android/webkit/Network.java
+++ b/core/java/android/webkit/Network.java
@@ -169,7 +169,9 @@
             if (!ConnectivityManager.CONNECTIVITY_ACTION.equals(intent.getAction()))
                 return;
 
-            NetworkInfo info = (NetworkInfo)intent.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO);
+            final ConnectivityManager connManager = (ConnectivityManager) context
+                    .getSystemService(Context.CONNECTIVITY_SERVICE);
+            final NetworkInfo info = connManager.getActiveNetworkInfo();
             if (info != null)
                 mRoaming = info.isRoaming();
         };
diff --git a/core/java/android/webkit/SelectActionModeCallback.java b/core/java/android/webkit/SelectActionModeCallback.java
index 8c174aa..cdf20f6 100644
--- a/core/java/android/webkit/SelectActionModeCallback.java
+++ b/core/java/android/webkit/SelectActionModeCallback.java
@@ -17,6 +17,7 @@
 package android.webkit;
 
 import android.app.SearchManager;
+import android.content.ClipboardManager;
 import android.content.Context;
 import android.content.Intent;
 import android.provider.Browser;
@@ -27,11 +28,16 @@
 class SelectActionModeCallback implements ActionMode.Callback {
     private WebView mWebView;
     private ActionMode mActionMode;
+    private boolean mIsTextSelected = true;
 
     void setWebView(WebView webView) {
         mWebView = webView;
     }
 
+    void setTextSelected(boolean isTextSelected) {
+        mIsTextSelected = isTextSelected;
+    }
+
     void finish() {
         // It is possible that onCreateActionMode was never called, in the case
         // where there is no ActionBar, for example.
@@ -52,17 +58,25 @@
         mode.setTitle(allowText ?
                 context.getString(com.android.internal.R.string.textSelectionCABTitle) : null);
 
-        if (!mode.isUiFocusable()) {
-            // If the action mode UI we're running in isn't capable of taking window focus
-            // the user won't be able to type into the find on page UI. Disable this functionality.
-            // (Note that this should only happen in floating dialog windows.)
-            // This can be removed once we can handle multiple focusable windows at a time
-            // in a better way.
-            final MenuItem findOnPageItem = menu.findItem(com.android.internal.R.id.find);
-            if (findOnPageItem != null) {
-                findOnPageItem.setVisible(false);
-            }
-        }
+        // If the action mode UI we're running in isn't capable of taking window focus
+        // the user won't be able to type into the find on page UI. Disable this functionality.
+        // (Note that this should only happen in floating dialog windows.)
+        // This can be removed once we can handle multiple focusable windows at a time
+        // in a better way.
+        ClipboardManager cm = (ClipboardManager)(context
+                .getSystemService(Context.CLIPBOARD_SERVICE));
+        boolean isFocusable = mode.isUiFocusable();
+        boolean isEditable = mWebView.focusCandidateIsEditableText();
+        boolean canPaste = isEditable && cm.hasPrimaryClip() && isFocusable;
+        boolean canFind = !isEditable && isFocusable;
+        boolean canCut = isEditable && mIsTextSelected && isFocusable;
+        boolean canCopy = mIsTextSelected;
+        boolean canWebSearch = mIsTextSelected;
+        setMenuVisibility(menu, canFind, com.android.internal.R.id.find);
+        setMenuVisibility(menu, canPaste, com.android.internal.R.id.paste);
+        setMenuVisibility(menu, canCut, com.android.internal.R.id.cut);
+        setMenuVisibility(menu, canCopy, com.android.internal.R.id.copy);
+        setMenuVisibility(menu, canWebSearch, com.android.internal.R.id.websearch);
         mActionMode = mode;
         return true;
     }
@@ -75,11 +89,21 @@
     @Override
     public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
         switch(item.getItemId()) {
+            case android.R.id.cut:
+                mWebView.cutSelection();
+                mode.finish();
+                break;
+
             case android.R.id.copy:
                 mWebView.copySelection();
                 mode.finish();
                 break;
 
+            case android.R.id.paste:
+                mWebView.pasteFromClipboard();
+                mode.finish();
+                break;
+
             case com.android.internal.R.id.share:
                 String selection = mWebView.getSelection();
                 Browser.sendString(mWebView.getContext(), selection);
@@ -113,4 +137,11 @@
     public void onDestroyActionMode(ActionMode mode) {
         mWebView.selectionDone();
     }
+
+    private void setMenuVisibility(Menu menu, boolean visible, int resourceId) {
+        final MenuItem item = menu.findItem(resourceId);
+        if (item != null) {
+            item.setVisible(visible);
+        }
+    }
 }
diff --git a/core/java/android/webkit/WebCoreThreadWatchdog.java b/core/java/android/webkit/WebCoreThreadWatchdog.java
index d100260..0541d5d 100644
--- a/core/java/android/webkit/WebCoreThreadWatchdog.java
+++ b/core/java/android/webkit/WebCoreThreadWatchdog.java
@@ -40,9 +40,6 @@
     // WebCore thread unresponsive.
     private static final int TIMED_OUT = 101;
 
-    // Message to tell the Watchdog thread to terminate.
-    private static final int QUIT = 102;
-
     // Wait 10s after hearing back from the WebCore thread before checking it's still alive.
     private static final int HEARTBEAT_PERIOD = 10 * 1000;
 
@@ -57,7 +54,6 @@
     private Handler mWebCoreThreadHandler;
     private Handler mHandler;
     private boolean mPaused;
-    private boolean mPendingQuit;
 
     private static WebCoreThreadWatchdog sInstance;
 
@@ -88,12 +84,6 @@
         }
     }
 
-    public synchronized static void quit() {
-        if (sInstance != null) {
-            sInstance.quitWatchdog();
-        }
-    }
-
     private void setContext(Context context) {
         mContext = context;
     }
@@ -103,19 +93,6 @@
         mWebCoreThreadHandler = webCoreThreadHandler;
     }
 
-    private void quitWatchdog() {
-        if (mHandler == null) {
-            // The thread hasn't started yet, so set a flag to stop it starting.
-            mPendingQuit = true;
-            return;
-        }
-        // Clear any pending messages, and then post a quit to the WatchDog handler.
-        mHandler.removeMessages(TIMED_OUT);
-        mHandler.removeMessages(IS_ALIVE);
-        mWebCoreThreadHandler.removeMessages(EventHub.HEARTBEAT);
-        mHandler.obtainMessage(QUIT).sendToTarget();
-    }
-
     private void pauseWatchdog() {
         mPaused = true;
 
@@ -146,12 +123,8 @@
         mHandler.sendMessageDelayed(mHandler.obtainMessage(TIMED_OUT), TIMEOUT_PERIOD);
     }
 
-    private boolean createHandler() {
+    private void createHandler() {
         synchronized (WebCoreThreadWatchdog.class) {
-            if (mPendingQuit) {
-                return false;
-            }
-
             mHandler = new Handler() {
                 @Override
                 public void handleMessage(Message msg) {
@@ -206,15 +179,9 @@
                             .setIcon(android.R.drawable.ic_dialog_alert)
                             .show();
                         break;
-
-                    case QUIT:
-                        Looper.myLooper().quit();
-                        break;
                     }
                 }
             };
-
-            return true;
         }
     }
 
@@ -222,9 +189,7 @@
     public void run() {
         Looper.prepare();
 
-        if (!createHandler()) {
-            return;
-        }
+        createHandler();
 
         // Send the initial control to WebViewCore and start the timeout timer as long as we aren't
         // paused.
diff --git a/core/java/android/webkit/WebSettings.java b/core/java/android/webkit/WebSettings.java
index 08d94e2..b4c38db 100644
--- a/core/java/android/webkit/WebSettings.java
+++ b/core/java/android/webkit/WebSettings.java
@@ -535,21 +535,6 @@
     }
 
     /**
-     * If WebView only supports touch, a different navigation model will be
-     * applied. Otherwise, the navigation to support both touch and keyboard
-     * will be used.
-     * @hide
-    public void setSupportTouchOnly(boolean touchOnly) {
-        mSupportTounchOnly = touchOnly;
-    }
-     */
-
-    boolean supportTouchOnly() {
-        // for debug only, use mLightTouchEnabled for mSupportTounchOnly
-        return mLightTouchEnabled;
-    }
-
-    /**
      * Set whether the WebView supports zoom
      */
     public void setSupportZoom(boolean support) {
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 20936e8..fbafc64 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -20,6 +20,7 @@
 import android.app.ActivityManager;
 import android.app.AlertDialog;
 import android.content.BroadcastReceiver;
+import android.content.ClipData;
 import android.content.ClipboardManager;
 import android.content.ComponentCallbacks2;
 import android.content.Context;
@@ -59,6 +60,10 @@
 import android.os.SystemClock;
 import android.provider.Settings;
 import android.speech.tts.TextToSpeech;
+import android.text.Editable;
+import android.text.InputType;
+import android.text.Selection;
+import android.text.TextUtils;
 import android.util.AttributeSet;
 import android.util.EventLog;
 import android.util.Log;
@@ -92,6 +97,7 @@
 import android.webkit.WebViewCore.EventHub;
 import android.webkit.WebViewCore.TouchEventData;
 import android.webkit.WebViewCore.TouchHighlightData;
+import android.webkit.WebViewCore.WebKitHitTest;
 import android.widget.AbsoluteLayout;
 import android.widget.Adapter;
 import android.widget.AdapterView;
@@ -123,12 +129,6 @@
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import javax.microedition.khronos.egl.EGL10;
-import javax.microedition.khronos.egl.EGLContext;
-import javax.microedition.khronos.egl.EGLDisplay;
-
-import static javax.microedition.khronos.egl.EGL10.EGL_DEFAULT_DISPLAY;
-
 /**
  * <p>A View that displays web pages. This class is the basis upon which you
  * can roll your own web browser or simply display some online content within your Activity.
@@ -326,6 +326,15 @@
  * property to {@code device-dpi}. This stops Android from performing scaling in your web page and
  * allows you to make the necessary adjustments for each density via CSS and JavaScript.</p>
  *
+ * <h3>HTML5 Video support</h3>
+ *
+ * <p>In order to support inline HTML5 video in your application, you need to have hardware
+ * acceleration turned on, and set a {@link android.webkit.WebChromeClient}. For full screen support,
+ * implementations of {@link WebChromeClient#onShowCustomView(View, WebChromeClient.CustomViewCallback)}
+ * and {@link WebChromeClient#onHideCustomView()} are required,
+ * {@link WebChromeClient#getVideoLoadingProgressView()} is optional.
+ * </p>
+ *
  *
  */
 @Widget
@@ -352,39 +361,167 @@
     }
 
     /**
-     * InputConnection used for ContentEditable. This captures the 'delete'
-     * commands and sends delete key presses.
+     * InputConnection used for ContentEditable. This captures changes
+     * to the text and sends them either as key strokes or text changes.
      */
     private class WebViewInputConnection extends BaseInputConnection {
+        // Used for mapping characters to keys typed.
+        private KeyCharacterMap mKeyCharacterMap;
+        private boolean mIsKeySentByMe;
+
         public WebViewInputConnection() {
-            super(WebView.this, false);
+            super(WebView.this, true);
         }
 
-        private void sendKeyPress(int keyCode) {
-            long eventTime = SystemClock.uptimeMillis();
-            sendKeyEvent(new KeyEvent(eventTime, eventTime,
-                    KeyEvent.ACTION_DOWN, keyCode, 0, 0,
-                    KeyCharacterMap.VIRTUAL_KEYBOARD, 0,
-                    KeyEvent.FLAG_SOFT_KEYBOARD));
-            sendKeyEvent(new KeyEvent(SystemClock.uptimeMillis(), eventTime,
-                    KeyEvent.ACTION_UP, keyCode, 0, 0,
-                    KeyCharacterMap.VIRTUAL_KEYBOARD, 0,
-                    KeyEvent.FLAG_SOFT_KEYBOARD));
+        @Override
+        public boolean sendKeyEvent(KeyEvent event) {
+            // Latin IME occasionally sends delete codes directly using
+            // sendKeyEvents. WebViewInputConnection should treat this
+            // as a deleteSurroundingText.
+            if (!mIsKeySentByMe
+                    && event.getKeyCode() == KeyEvent.KEYCODE_DEL) {
+                Editable editable = getEditable();
+                int selectionStart = Selection.getSelectionStart(editable);
+                int selectionEnd = Selection.getSelectionEnd(editable);
+                if (selectionEnd > 0 && (selectionStart == selectionEnd)) {
+                    int action = event.getAction();
+                    if (action == KeyEvent.ACTION_UP) {
+                        return deleteSurroundingText(1, 0);
+                    } else if (action == KeyEvent.ACTION_DOWN) {
+                        return true; // the delete will happen in ACTION_UP
+                    }
+                }
+            }
+            return super.sendKeyEvent(event);
+        }
+
+        public void setTextAndKeepSelection(CharSequence text) {
+            Editable editable = getEditable();
+            int selectionStart = Selection.getSelectionStart(editable);
+            int selectionEnd = Selection.getSelectionEnd(editable);
+            editable.replace(0, editable.length(), text);
+            InputMethodManager imm = InputMethodManager.peekInstance();
+            if (imm != null) {
+                // Since the text has changed, do not allow the IME to replace the
+                // existing text as though it were a completion.
+                imm.restartInput(WebView.this);
+            }
+            // Keep the previous selection.
+            selectionStart = Math.min(selectionStart, editable.length());
+            selectionEnd = Math.min(selectionEnd, editable.length());
+            setSelection(selectionStart, selectionEnd);
+        }
+
+        @Override
+        public boolean setComposingText(CharSequence text, int newCursorPosition) {
+            Editable editable = getEditable();
+            int start = getComposingSpanStart(editable);
+            int end = getComposingSpanEnd(editable);
+            if (start < 0 || end < 0) {
+                start = Selection.getSelectionStart(editable);
+                end = Selection.getSelectionEnd(editable);
+            }
+            if (end < start) {
+                int temp = end;
+                end = start;
+                start = temp;
+            }
+            setNewText(start, end, text);
+            return super.setComposingText(text, newCursorPosition);
+        }
+
+        @Override
+        public boolean commitText(CharSequence text, int newCursorPosition) {
+            setComposingText(text, newCursorPosition);
+            int cursorPosition = Selection.getSelectionEnd(getEditable());
+            setComposingRegion(cursorPosition, cursorPosition);
+            return true;
         }
 
         @Override
         public boolean deleteSurroundingText(int leftLength, int rightLength) {
-            // Look for one-character delete and send it as a key press.
-            if (leftLength == 1 && rightLength == 0) {
-                sendKeyPress(KeyEvent.KEYCODE_DEL);
-            } else if (leftLength == 0 && rightLength == 1){
-                sendKeyPress(KeyEvent.KEYCODE_FORWARD_DEL);
-            } else if (mWebViewCore != null) {
-                mWebViewCore.sendMessage(EventHub.DELETE_SURROUNDING_TEXT,
-                        leftLength, rightLength);
-            }
+            Editable editable = getEditable();
+            int cursorPosition = Selection.getSelectionEnd(editable);
+            int startDelete = Math.max(0, cursorPosition - leftLength);
+            int endDelete = Math.min(editable.length(),
+                    cursorPosition + rightLength);
+            setNewText(startDelete, endDelete, "");
             return super.deleteSurroundingText(leftLength, rightLength);
         }
+
+        /**
+         * Sends a text change to webkit indirectly. If it is a single-
+         * character add or delete, it sends it as a key stroke. If it cannot
+         * be represented as a key stroke, it sends it as a field change.
+         * @param start The start offset (inclusive) of the text being changed.
+         * @param end The end offset (exclusive) of the text being changed.
+         * @param text The new text to replace the changed text.
+         */
+        private void setNewText(int start, int end, CharSequence text) {
+            mIsKeySentByMe = true;
+            Editable editable = getEditable();
+            CharSequence original = editable.subSequence(start, end);
+            boolean isCharacterAdd = false;
+            boolean isCharacterDelete = false;
+            int textLength = text.length();
+            int originalLength = original.length();
+            if (textLength > originalLength) {
+                isCharacterAdd = (textLength == originalLength + 1)
+                        && TextUtils.regionMatches(text, 0, original, 0,
+                                originalLength);
+            } else if (originalLength > textLength) {
+                isCharacterDelete = (textLength == originalLength - 1)
+                        && TextUtils.regionMatches(text, 0, original, 0,
+                                textLength);
+            }
+            if (isCharacterAdd) {
+                sendCharacter(text.charAt(textLength - 1));
+            } else if (isCharacterDelete) {
+                sendDeleteKey();
+            } else if (textLength != originalLength ||
+                    !TextUtils.regionMatches(text, 0, original, 0,
+                            textLength)) {
+                // Send a message so that key strokes and text replacement
+                // do not come out of order.
+                Message replaceMessage = mPrivateHandler.obtainMessage(
+                        REPLACE_TEXT, start,  end, text.toString());
+                mPrivateHandler.sendMessage(replaceMessage);
+            }
+            mIsKeySentByMe = false;
+        }
+
+        /**
+         * Send a single character to the WebView as a key down and up event.
+         * @param c The character to be sent.
+         */
+        private void sendCharacter(char c) {
+            if (mKeyCharacterMap == null) {
+                mKeyCharacterMap = KeyCharacterMap.load(KeyCharacterMap.VIRTUAL_KEYBOARD);
+            }
+            char[] chars = new char[1];
+            chars[0] = c;
+            KeyEvent[] events = mKeyCharacterMap.getEvents(chars);
+            if (events != null) {
+                for (KeyEvent event : events) {
+                    sendKeyEvent(event);
+                }
+            }
+        }
+
+        /**
+         * Send the delete character as a key down and up event.
+         */
+        private void sendDeleteKey() {
+            long eventTime = SystemClock.uptimeMillis();
+            sendKeyEvent(new KeyEvent(eventTime, eventTime,
+                    KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL, 0, 0,
+                    KeyCharacterMap.VIRTUAL_KEYBOARD, 0,
+                    KeyEvent.FLAG_SOFT_KEYBOARD));
+            sendKeyEvent(new KeyEvent(SystemClock.uptimeMillis(), eventTime,
+                    KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL, 0, 0,
+                    KeyCharacterMap.VIRTUAL_KEYBOARD, 0,
+                    KeyEvent.FLAG_SOFT_KEYBOARD));
+        }
     }
 
 
@@ -412,8 +549,8 @@
     private final Rect mViewRectViewport = new Rect();
     private final RectF mVisibleContentRect = new RectF();
     private boolean mGLViewportEmpty = false;
-    WebViewInputConnection mInputConnection = new WebViewInputConnection();
-
+    WebViewInputConnection mInputConnection = null;
+    private int mFieldPointer;
 
     /**
      *  Transportation object for returning WebView across thread boundaries.
@@ -610,6 +747,7 @@
     private boolean mIsPaused;
 
     private HitTestResult mInitialHitTestResult;
+    private WebKitHitTest mFocusedNode;
 
     /**
      * Customizable constant
@@ -692,22 +830,27 @@
     // know to handle Shift and arrows natively first
     private boolean mAccessibilityScriptInjected;
 
-    static final boolean USE_JAVA_TEXT_SELECTION = true;
-    static final boolean DEBUG_TEXT_HANDLES = false;
-    private Region mTextSelectionRegion = new Region();
-    private Paint mTextSelectionPaint;
     private Drawable mSelectHandleLeft;
     private Drawable mSelectHandleRight;
+    private Rect mSelectCursorBase = new Rect();
+    private int mSelectCursorBaseLayerId;
+    private Rect mSelectCursorExtent = new Rect();
+    private int mSelectCursorExtentLayerId;
+    private Rect mSelectDraggingCursor;
+    private Point mSelectDraggingOffset = new Point();
+    static final int HANDLE_ID_START = 0;
+    static final int HANDLE_ID_END = 1;
+    static final int HANDLE_ID_BASE = 2;
+    static final int HANDLE_ID_EXTENT = 3;
 
-    static final boolean USE_WEBKIT_RINGS = false;
+    static boolean sDisableNavcache = false;
+    static boolean sEnableWebTextView = false;
     // the color used to highlight the touch rectangles
-    private static final int HIGHLIGHT_COLOR = 0x6633b5e5;
-    // the round corner for the highlight path
-    private static final float TOUCH_HIGHLIGHT_ARC = 5.0f;
+    static final int HIGHLIGHT_COLOR = 0x6633b5e5;
     // the region indicating where the user touched on the screen
     private Region mTouchHighlightRegion = new Region();
     // the paint for the touch highlight
-    private Paint mTouchHightlightPaint;
+    private Paint mTouchHightlightPaint = new Paint();
     // debug only
     private static final boolean DEBUG_TOUCH_HIGHLIGHT = true;
     private static final int TOUCH_HIGHLIGHT_ELAPSE_TIME = 2000;
@@ -775,7 +918,7 @@
     static final int REQUEST_KEYBOARD_WITH_SELECTION_MSG_ID = 128;
     static final int SET_SCROLLBAR_MODES                = 129;
     static final int SELECTION_STRING_CHANGED           = 130;
-    static final int SET_TOUCH_HIGHLIGHT_RECTS          = 131;
+    static final int HIT_TEST_RESULT                    = 131;
     static final int SAVE_WEBARCHIVE_FINISHED           = 132;
 
     static final int SET_AUTOFILLABLE                   = 133;
@@ -786,9 +929,14 @@
     static final int ENTER_FULLSCREEN_VIDEO             = 137;
     static final int UPDATE_SELECTION                   = 138;
     static final int UPDATE_ZOOM_DENSITY                = 139;
+    static final int EXIT_FULLSCREEN_VIDEO              = 140;
+
+    static final int COPY_TO_CLIPBOARD                  = 141;
+    static final int INIT_EDIT_FIELD                    = 142;
+    static final int REPLACE_TEXT                       = 143;
 
     private static final int FIRST_PACKAGE_MSG_ID = SCROLL_TO_MSG_ID;
-    private static final int LAST_PACKAGE_MSG_ID = SET_TOUCH_HIGHLIGHT_RECTS;
+    private static final int LAST_PACKAGE_MSG_ID = HIT_TEST_RESULT;
 
     static final String[] HandlerPrivateDebugString = {
         "REMEMBER_PASSWORD", //              = 1;
@@ -963,9 +1111,6 @@
     private Rect mScrollingLayerBounds = new Rect();
     private boolean mSentAutoScrollMessage = false;
 
-    // Temporary hack to work around the context removal upon memory pressure
-    private static boolean mIncrementEGLContextHack = false;
-
     // used for serializing asynchronously handled touch events.
     private final TouchEventQueue mTouchEventQueue = new TouchEventQueue();
 
@@ -1072,6 +1217,15 @@
     }
 
     /**
+     * Refer to {@link WebView#requestFocusNodeHref(Message)} for more information
+     */
+    static class FocusNodeHref {
+        static final String TITLE = "title";
+        static final String URL = "url";
+        static final String SRC = "src";
+    }
+
+    /**
      * Construct a new WebView with a Context object.
      * @param context A Context object used to access application assets.
      */
@@ -1311,7 +1465,7 @@
 
     private void init() {
         OnTrimMemoryListener.init(getContext());
-
+        sDisableNavcache = nativeDisableNavcache();
         setWillNotDraw(false);
         setFocusable(true);
         setFocusableInTouchMode(true);
@@ -1363,7 +1517,7 @@
                 final String packageName = ctx.getPackageName();
                 if (packageName != null) {
                     mTextToSpeech = new TextToSpeech(getContext(), null, null,
-                            packageName + ".**webview**");
+                            packageName + ".**webview**", true);
                     addJavascriptInterface(mTextToSpeech, ALIAS_ACCESSIBILITY_JS_INTERFACE);
                 }
             }
@@ -2500,7 +2654,7 @@
         checkThread();
         mContentWidth = 0;
         mContentHeight = 0;
-        setBaseLayer(0, null, false, false, false);
+        setBaseLayer(0, null, false, false);
         mWebViewCore.sendMessage(EventHub.CLEAR_CONTENT);
     }
 
@@ -2549,12 +2703,6 @@
         return mZoomManager.getScale();
     }
 
-    // Called by JNI. Returns the scale to apply to the text selection handles
-    /* package */ float getTextHandleScale() {
-        float density = mContext.getResources().getDisplayMetrics().density;
-        return density / getScale();
-    }
-
     /**
      * Compute the reading level scale of the WebView
      * @param scale The current scale.
@@ -2618,8 +2766,8 @@
     }
 
     private HitTestResult hitTestResult(HitTestResult fallback) {
-        if (mNativeClass == 0) {
-            return null;
+        if (mNativeClass == 0 || sDisableNavcache) {
+            return fallback;
         }
 
         HitTestResult result = new HitTestResult();
@@ -2674,6 +2822,34 @@
         return result;
     }
 
+    int getBlockLeftEdge(int x, int y, float readingScale) {
+        if (!sDisableNavcache) {
+            return nativeGetBlockLeftEdge(x, y, readingScale);
+        }
+
+        float invReadingScale = 1.0f / readingScale;
+        int readingWidth = (int) (getViewWidth() * invReadingScale);
+        int left = NO_LEFTEDGE;
+        if (mFocusedNode != null) {
+            final int length = mFocusedNode.mEnclosingParentRects.length;
+            for (int i = 0; i < length; i++) {
+                Rect rect = mFocusedNode.mEnclosingParentRects[i];
+                if (rect.width() < mFocusedNode.mHitTestSlop) {
+                    // ignore bounding boxes that are too small
+                    continue;
+                } else if (left != NO_LEFTEDGE && rect.width() > readingWidth) {
+                    // stop when bounding box doesn't fit the screen width
+                    // at reading scale
+                    break;
+                }
+
+                left = rect.left;
+            }
+        }
+
+        return left;
+    }
+
     // Called by JNI when the DOM has changed the focus.  Clear the focus so
     // that new keys will go to the newly focused field
     private void domChangedFocus() {
@@ -2702,6 +2878,14 @@
         }
         int contentX = viewToContentX(mLastTouchX + mScrollX);
         int contentY = viewToContentY(mLastTouchY + mScrollY);
+        if (mFocusedNode != null && mFocusedNode.mHitTestX == contentX
+                && mFocusedNode.mHitTestY == contentY) {
+            hrefMsg.getData().putString(FocusNodeHref.URL, mFocusedNode.mLinkUrl);
+            hrefMsg.getData().putString(FocusNodeHref.TITLE, mFocusedNode.mAnchorText);
+            hrefMsg.getData().putString(FocusNodeHref.SRC, mFocusedNode.mImageUrl);
+            hrefMsg.sendToTarget();
+            return;
+        }
         if (nativeHasCursorNode()) {
             Rect cursorBounds = nativeGetCursorRingBounds();
             if (!cursorBounds.contains(contentX, contentY)) {
@@ -3737,9 +3921,21 @@
         if (x == mScrollingLayerRect.left && y == mScrollingLayerRect.top) {
             return;
         }
+        if (mSelectingText) {
+            int dx = mScrollingLayerRect.left - x;
+            int dy = mScrollingLayerRect.top - y;
+            if (mSelectCursorBaseLayerId == mCurrentScrollingLayerId) {
+                mSelectCursorBase.offset(dx, dy);
+            }
+            if (mSelectCursorExtentLayerId == mCurrentScrollingLayerId) {
+                mSelectCursorExtent.offset(dx, dy);
+            }
+        }
         nativeScrollLayer(mCurrentScrollingLayerId, x, y);
         mScrollingLayerRect.left = x;
         mScrollingLayerRect.top = y;
+        mWebViewCore.sendMessage(WebViewCore.EventHub.SCROLL_LAYER, mCurrentScrollingLayerId,
+                mScrollingLayerRect);
         onScrollChanged(mScrollX, mScrollY, mScrollX, mScrollY);
         invalidate();
     }
@@ -4352,14 +4548,9 @@
         }
 
         if (canvas.isHardwareAccelerated()) {
-            if (mIncrementEGLContextHack == false) {
-                mIncrementEGLContextHack = true;
-                EGL10 egl = (EGL10) EGLContext.getEGL();
-                EGLDisplay eglDisplay = egl.eglGetDisplay(EGL_DEFAULT_DISPLAY);
-                int[] version = new int[2];
-                egl.eglInitialize(eglDisplay, version);
-            }
             mZoomManager.setHardwareAccelerated();
+        } else {
+            mWebViewCore.resumeWebKitDraw();
         }
 
         int saveCount = canvas.save();
@@ -4376,7 +4567,7 @@
                 || mTouchMode == TOUCH_SHORTPRESS_MODE
                 || mTouchMode == TOUCH_DONE_MODE);
         boolean drawNativeRings = !drawJavaRings;
-        if (USE_WEBKIT_RINGS) {
+        if (sDisableNavcache) {
             drawNativeRings = !drawJavaRings && !isInTouchMode();
         }
         drawContent(canvas, drawNativeRings);
@@ -4398,10 +4589,6 @@
                 Rect r = mTouchHighlightRegion.getBounds();
                 postInvalidateDelayed(delay, r.left, r.top, r.right, r.bottom);
             } else {
-                if (mTouchHightlightPaint == null) {
-                    mTouchHightlightPaint = new Paint();
-                    mTouchHightlightPaint.setColor(HIGHLIGHT_COLOR);
-                }
                 RegionIterator iter = new RegionIterator(mTouchHighlightRegion);
                 Rect r = new Rect();
                 while (iter.next(r)) {
@@ -4431,8 +4618,8 @@
     }
 
     private void removeTouchHighlight() {
-        mWebViewCore.removeMessages(EventHub.GET_TOUCH_HIGHLIGHT_RECTS);
-        mPrivateHandler.removeMessages(SET_TOUCH_HIGHLIGHT_RECTS);
+        mWebViewCore.removeMessages(EventHub.HIT_TEST);
+        mPrivateHandler.removeMessages(HIT_TEST_RESULT);
         setTouchHighlightRects(null);
     }
 
@@ -4494,6 +4681,11 @@
         final boolean isSelecting = selectText();
         if (isSelecting) {
             performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
+        } else if (focusCandidateIsEditableText()) {
+            mSelectCallback = new SelectActionModeCallback();
+            mSelectCallback.setWebView(this);
+            mSelectCallback.setTextSelected(false);
+            startActionMode(mSelectCallback);
         }
         return isSelecting;
     }
@@ -4513,12 +4705,7 @@
      * Select the word at the indicated content coordinates.
      */
     boolean selectText(int x, int y) {
-        if (!setUpSelect(true, x, y)) {
-            return false;
-        }
-        nativeSetExtendSelection();
-        mDrawSelectionPointer = false;
-        mTouchMode = TOUCH_DRAG_MODE;
+        mWebViewCore.sendMessage(EventHub.SELECT_WORD_AT, x, y);
         return true;
     }
 
@@ -4606,11 +4793,19 @@
     }
 
     void setBaseLayer(int layer, Region invalRegion, boolean showVisualIndicator,
-            boolean isPictureAfterFirstLayout, boolean registerPageSwapCallback) {
+            boolean isPictureAfterFirstLayout) {
         if (mNativeClass == 0)
             return;
-        nativeSetBaseLayer(mNativeClass, layer, invalRegion, showVisualIndicator,
-                isPictureAfterFirstLayout, registerPageSwapCallback);
+        boolean queueFull;
+        queueFull = nativeSetBaseLayer(mNativeClass, layer, invalRegion,
+                                       showVisualIndicator, isPictureAfterFirstLayout);
+
+        if (layer == 0 || isPictureAfterFirstLayout) {
+            mWebViewCore.resumeWebKitDraw();
+        } else if (queueFull) {
+            mWebViewCore.pauseWebKitDraw();
+        }
+
         if (mHTML5VideoViewProxy != null) {
             mHTML5VideoViewProxy.setBaseLayer(layer);
         }
@@ -4719,11 +4914,8 @@
         int extras = DRAW_EXTRAS_NONE;
         if (mFindIsUp) {
             extras = DRAW_EXTRAS_FIND;
-        } else if (mSelectingText && (!USE_JAVA_TEXT_SELECTION || DEBUG_TEXT_HANDLES)) {
+        } else if (mSelectingText) {
             extras = DRAW_EXTRAS_SELECTION;
-            nativeSetSelectionPointer(mNativeClass,
-                    mDrawSelectionPointer,
-                    mZoomManager.getInvScale(), mSelectX, mSelectY - getTitleHeight());
         } else if (drawCursorRing) {
             extras = DRAW_EXTRAS_CURSOR_RING;
         }
@@ -4768,7 +4960,7 @@
         }
 
         canvas.restoreToCount(saveCount);
-        if (mSelectingText && USE_JAVA_TEXT_SELECTION) {
+        if (mSelectingText) {
             drawTextSelectionHandles(canvas);
         }
 
@@ -4790,30 +4982,12 @@
     }
 
     private void drawTextSelectionHandles(Canvas canvas) {
-        if (mTextSelectionPaint == null) {
-            mTextSelectionPaint = new Paint();
-            mTextSelectionPaint.setColor(HIGHLIGHT_COLOR);
-        }
-        mTextSelectionRegion.setEmpty();
-        nativeGetTextSelectionRegion(mNativeClass, mTextSelectionRegion);
-        Rect r = new Rect();
-        RegionIterator iter = new RegionIterator(mTextSelectionRegion);
-        Rect clip = canvas.getClipBounds();
-        while (iter.next(r)) {
-            r.set(contentToViewDimension(r.left),
-                    contentToViewDimension(r.top),
-                    contentToViewDimension(r.right),
-                    contentToViewDimension(r.bottom));
-            if (r.intersect(clip)) {
-                canvas.drawRect(r, mTextSelectionPaint);
-            }
-        }
         if (mSelectHandleLeft == null) {
             mSelectHandleLeft = mContext.getResources().getDrawable(
                     com.android.internal.R.drawable.text_select_handle_left);
         }
         int[] handles = new int[4];
-        nativeGetSelectionHandles(mNativeClass, handles);
+        getSelectionHandles(handles);
         int start_x = contentToViewDimension(handles[0]);
         int start_y = contentToViewDimension(handles[1]);
         int end_x = contentToViewDimension(handles[2]);
@@ -4831,14 +5005,31 @@
         mSelectHandleRight.setBounds(end_x, end_y,
                 end_x + mSelectHandleRight.getIntrinsicWidth(),
                 end_y + mSelectHandleRight.getIntrinsicHeight());
-        if (DEBUG_TEXT_HANDLES) {
-            mSelectHandleLeft.setAlpha(125);
-            mSelectHandleRight.setAlpha(125);
-        }
         mSelectHandleLeft.draw(canvas);
         mSelectHandleRight.draw(canvas);
     }
 
+    /**
+     * Takes an int[4] array as an output param with the values being
+     * startX, startY, endX, endY
+     */
+    private void getSelectionHandles(int[] handles) {
+        handles[0] = mSelectCursorBase.right;
+        handles[1] = mSelectCursorBase.bottom -
+                (mSelectCursorBase.height() / 4);
+        handles[2] = mSelectCursorExtent.left;
+        handles[3] = mSelectCursorExtent.bottom
+                - (mSelectCursorExtent.height() / 4);
+        if (!nativeIsBaseFirst(mNativeClass)) {
+            int swap = handles[0];
+            handles[0] = handles[2];
+            handles[2] = swap;
+            swap = handles[1];
+            handles[1] = handles[3];
+            handles[3] = swap;
+        }
+    }
+
     // draw history
     private boolean mDrawHistory = false;
     private Picture mHistoryPicture = null;
@@ -4898,7 +5089,7 @@
     /* package */ void deleteSelection(int start, int end) {
         mTextGeneration++;
         WebViewCore.TextSelectionData data
-                = new WebViewCore.TextSelectionData(start, end);
+                = new WebViewCore.TextSelectionData(start, end, 0);
         mWebViewCore.sendMessage(EventHub.DELETE_SELECTION, mTextGeneration, 0,
                 data);
     }
@@ -4916,15 +5107,19 @@
     }
 
     @Override
-    public boolean onCheckIsTextEditor() {
-        return true;
-    }
-
-    @Override
     public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
-        outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN
+        outAttrs.inputType = EditorInfo.IME_FLAG_NO_FULLSCREEN
                 | EditorInfo.TYPE_CLASS_TEXT
-                | EditorInfo.TYPE_TEXT_VARIATION_NORMAL;
+                | EditorInfo.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT
+                | EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE
+                | EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT
+                | EditorInfo.TYPE_TEXT_FLAG_CAP_SENTENCES;
+        outAttrs.imeOptions = EditorInfo.IME_ACTION_NONE;
+
+        if (mInputConnection == null) {
+            mInputConnection = new WebViewInputConnection();
+        }
+        outAttrs.initialCapsMode = mInputConnection.getCursorCapsMode(InputType.TYPE_CLASS_TEXT);
         return mInputConnection;
     }
 
@@ -4975,6 +5170,9 @@
      * multiline, and what text it contains.  It also removes it if necessary.
      */
     /* package */ void rebuildWebTextView() {
+        if (!sEnableWebTextView) {
+            return; // always use WebKit's text entry
+        }
         // If the WebView does not have focus, do nothing until it gains focus.
         if (!hasFocus() && (null == mWebTextView || !mWebTextView.hasFocus())) {
             return;
@@ -5347,15 +5545,6 @@
                         return pinScrollTo(mContentWidth, mScrollY, true, 0);
                 }
             }
-            if (mSelectingText) {
-                int xRate = keyCode == KeyEvent.KEYCODE_DPAD_LEFT
-                    ? -1 : keyCode == KeyEvent.KEYCODE_DPAD_RIGHT ? 1 : 0;
-                int yRate = keyCode == KeyEvent.KEYCODE_DPAD_UP ?
-                    -1 : keyCode == KeyEvent.KEYCODE_DPAD_DOWN ? 1 : 0;
-                int multiplier = event.getRepeatCount() + 1;
-                moveSelection(xRate * multiplier, yRate * multiplier);
-                return true;
-            }
             if (navHandledKey(keyCode, 1, false, event.getEventTime())) {
                 playSoundEffect(keyCodeToSoundsEffect(keyCode));
                 return true;
@@ -5508,14 +5697,8 @@
             mGotCenterDown = false;
 
             if (mSelectingText) {
-                if (mExtendSelection) {
-                    copySelection();
-                    selectionDone();
-                } else {
-                    mExtendSelection = true;
-                    nativeSetExtendSelection();
-                    invalidate(); // draw the i-beam instead of the arrow
-                }
+                copySelection();
+                selectionDone();
                 return true; // discard press if copy in progress
             }
 
@@ -5561,21 +5744,7 @@
         return false;
     }
 
-    /*
-     * Enter selecting text mode, and see if CAB should be shown.
-     * Returns true if the WebView is now in
-     * selecting text mode (including if it was already in that mode, and this
-     * method did nothing).
-     */
-    private boolean setUpSelect(boolean selectWord, int x, int y) {
-        if (0 == mNativeClass) return false; // client isn't initialized
-        if (inFullScreenMode()) return false;
-        if (mSelectingText) return true;
-        nativeResetSelection();
-        if (selectWord && !nativeWordSelection(x, y)) {
-            selectionDone();
-            return false;
-        }
+    private boolean startSelectActionMode() {
         mSelectCallback = new SelectActionModeCallback();
         mSelectCallback.setWebView(this);
         if (startActionMode(mSelectCallback) == null) {
@@ -5584,54 +5753,43 @@
             selectionDone();
             return false;
         }
-        mExtendSelection = false;
-        mSelectingText = mDrawSelectionPointer = true;
-        if (DEBUG_TEXT_HANDLES) {
-            // Debugging text handles requires running in software mode
-            setLayerType(LAYER_TYPE_SOFTWARE, null);
-        }
-        // don't let the picture change during text selection
-        WebViewCore.pauseUpdatePicture(mWebViewCore);
-        if (nativeHasCursorNode()) {
-            Rect rect = nativeCursorNodeBounds();
-            mSelectX = contentToViewX(rect.left);
-            mSelectY = contentToViewY(rect.top);
-        } else if (mLastTouchY > getVisibleTitleHeightImpl()) {
-            mSelectX = mScrollX + mLastTouchX;
-            mSelectY = mScrollY + mLastTouchY;
-        } else {
-            mSelectX = mScrollX + getViewWidth() / 2;
-            mSelectY = mScrollY + getViewHeightWithTitle() / 2;
-        }
-        nativeHideCursor();
-        mMinAutoScrollX = 0;
-        mMaxAutoScrollX = getViewWidth();
-        mMinAutoScrollY = 0;
-        mMaxAutoScrollY = getViewHeightWithTitle();
-        mCurrentScrollingLayerId = nativeScrollableLayer(viewToContentX(mSelectX),
-                viewToContentY(mSelectY), mScrollingLayerRect,
-                mScrollingLayerBounds);
-        if (mCurrentScrollingLayerId != 0) {
-            if (mScrollingLayerRect.left != mScrollingLayerRect.right) {
-                mMinAutoScrollX = Math.max(mMinAutoScrollX,
-                        contentToViewX(mScrollingLayerBounds.left));
-                mMaxAutoScrollX = Math.min(mMaxAutoScrollX,
-                        contentToViewX(mScrollingLayerBounds.right));
-            }
-            if (mScrollingLayerRect.top != mScrollingLayerRect.bottom) {
-                mMinAutoScrollY = Math.max(mMinAutoScrollY,
-                        contentToViewY(mScrollingLayerBounds.top));
-                mMaxAutoScrollY = Math.min(mMaxAutoScrollY,
-                        contentToViewY(mScrollingLayerBounds.bottom));
-            }
-        }
-        mMinAutoScrollX += SELECT_SCROLL;
-        mMaxAutoScrollX -= SELECT_SCROLL;
-        mMinAutoScrollY += SELECT_SCROLL;
-        mMaxAutoScrollY -= SELECT_SCROLL;
+        performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
         return true;
     }
 
+    private void syncSelectionCursors() {
+        mSelectCursorBaseLayerId =
+                nativeGetHandleLayerId(mNativeClass, HANDLE_ID_BASE, mSelectCursorBase);
+        mSelectCursorExtentLayerId =
+                nativeGetHandleLayerId(mNativeClass, HANDLE_ID_EXTENT, mSelectCursorExtent);
+    }
+
+    private boolean setupWebkitSelect() {
+        syncSelectionCursors();
+        if (!startSelectActionMode()) {
+            selectionDone();
+            return false;
+        }
+        mSelectingText = true;
+        mTouchMode = TOUCH_DRAG_MODE;
+        return true;
+    }
+
+    private void updateWebkitSelection() {
+        int[] handles = null;
+        if (mSelectingText) {
+            handles = new int[4];
+            handles[0] = mSelectCursorBase.centerX();
+            handles[1] = mSelectCursorBase.centerY();
+            handles[2] = mSelectCursorExtent.centerX();
+            handles[3] = mSelectCursorExtent.centerY();
+        } else {
+            nativeSetTextSelection(mNativeClass, 0);
+        }
+        mWebViewCore.removeMessages(EventHub.SELECT_TEXT);
+        mWebViewCore.sendMessageAtFrontOfQueue(EventHub.SELECT_TEXT, handles);
+    }
+
     /**
      * Use this method to put the WebView into text selection mode.
      * Do not rely on this functionality; it will be deprecated in the future.
@@ -5640,7 +5798,6 @@
     @Deprecated
     public void emulateShiftHeld() {
         checkThread();
-        setUpSelect(false, 0, 0);
     }
 
     /**
@@ -5649,17 +5806,7 @@
      * @hide This is an implementation detail.
      */
     public void selectAll() {
-        if (0 == mNativeClass) return; // client isn't initialized
-        if (inFullScreenMode()) return;
-        if (!mSelectingText) {
-            // retrieve a point somewhere within the text
-            Point select = nativeSelectableText();
-            if (!selectText(select.x, select.y)) return;
-        }
-        nativeSelectAll();
-        mDrawSelectionPointer = false;
-        mExtendSelection = true;
-        invalidate();
+        mWebViewCore.sendMessage(EventHub.SELECT_ALL);
     }
 
     /**
@@ -5668,17 +5815,11 @@
     void selectionDone() {
         if (mSelectingText) {
             mSelectingText = false;
-            if (DEBUG_TEXT_HANDLES) {
-                // Debugging text handles required running in software mode, set
-                // back to default now
-                setLayerType(LAYER_TYPE_NONE, null);
-            }
             // finish is idempotent, so this is fine even if selectionDone was
             // called by mSelectCallback.onDestroyActionMode
             mSelectCallback.finish();
             mSelectCallback = null;
-            WebViewCore.resumePriority();
-            WebViewCore.resumeUpdatePicture(mWebViewCore);
+            updateWebkitSelection();
             invalidate(); // redraw without selection
             mAutoScrollX = 0;
             mAutoScrollY = 0;
@@ -5705,12 +5846,49 @@
             ClipboardManager cm = (ClipboardManager)getContext()
                     .getSystemService(Context.CLIPBOARD_SERVICE);
             cm.setText(selection);
+            int[] handles = new int[4];
+            getSelectionHandles(handles);
+            mWebViewCore.sendMessage(EventHub.COPY_TEXT, handles);
         }
         invalidate(); // remove selection region and pointer
         return copiedSomething;
     }
 
     /**
+     * Cut the selected text into the clipboard
+     *
+     * @hide This is an implementation detail
+     */
+    public void cutSelection() {
+        copySelection();
+        int[] handles = new int[4];
+        getSelectionHandles(handles);
+        mWebViewCore.sendMessage(EventHub.DELETE_TEXT, handles);
+    }
+
+    /**
+     * Paste text from the clipboard to the cursor position.
+     *
+     * @hide This is an implementation detail
+     */
+    public void pasteFromClipboard() {
+        ClipboardManager cm = (ClipboardManager)getContext()
+                .getSystemService(Context.CLIPBOARD_SERVICE);
+        ClipData clipData = cm.getPrimaryClip();
+        if (clipData != null) {
+            ClipData.Item clipItem = clipData.getItemAt(0);
+            CharSequence pasteText = clipItem.getText();
+            if (pasteText != null) {
+                int[] handles = new int[4];
+                getSelectionHandles(handles);
+                mWebViewCore.sendMessage(EventHub.DELETE_TEXT, handles);
+                mWebViewCore.sendMessage(EventHub.INSERT_TEXT,
+                        pasteText.toString());
+            }
+        }
+    }
+
+    /**
      * @hide This is an implementation detail.
      */
     public SearchBox getSearchBox() {
@@ -6198,7 +6376,7 @@
                     nativeSetIsScrolling(false);
                 } else if (mPrivateHandler.hasMessages(RELEASE_SINGLE_TAP)) {
                     mPrivateHandler.removeMessages(RELEASE_SINGLE_TAP);
-                    if (USE_WEBKIT_RINGS || getSettings().supportTouchOnly()) {
+                    if (sDisableNavcache) {
                         removeTouchHighlight();
                     }
                     if (deltaX * deltaX + deltaY * deltaY < mDoubleTapSlopSquare) {
@@ -6222,7 +6400,7 @@
                         mWebViewCore.sendMessage(
                                 EventHub.UPDATE_FRAME_CACHE_IF_LOADING);
                     }
-                    if (USE_WEBKIT_RINGS || getSettings().supportTouchOnly()) {
+                    if (sDisableNavcache) {
                         TouchHighlightData data = new TouchHighlightData();
                         data.mX = contentX;
                         data.mY = contentY;
@@ -6234,7 +6412,7 @@
                         if (!mBlockWebkitViewMessages) {
                             mTouchHighlightRequested = System.currentTimeMillis();
                             mWebViewCore.sendMessageAtFrontOfQueue(
-                                    EventHub.GET_TOUCH_HIGHLIGHT_RECTS, data);
+                                    EventHub.HIT_TEST, data);
                         }
                         if (DEBUG_TOUCH_HIGHLIGHT) {
                             if (getSettings().getNavDump()) {
@@ -6254,13 +6432,28 @@
                         EventLog.writeEvent(EventLogTags.BROWSER_DOUBLE_TAP_DURATION,
                                 (eventTime - mLastTouchUpTime), eventTime);
                     }
-                    if (mSelectingText) {
-                        mDrawSelectionPointer = false;
-                        mSelectionStarted = nativeStartSelection(contentX, contentY);
+                    mSelectionStarted = false;
+                    if (mSelectingText && mSelectHandleLeft != null
+                            && mSelectHandleRight != null) {
+                        int shiftedY = y - getTitleHeight() + mScrollY;
+                        int shiftedX = x + mScrollX;
+                        if (mSelectHandleLeft.getBounds()
+                                .contains(shiftedX, shiftedY)) {
+                            mSelectionStarted = true;
+                            mSelectDraggingCursor = mSelectCursorBase;
+                        } else if (mSelectHandleRight.getBounds()
+                                .contains(shiftedX, shiftedY)) {
+                            mSelectionStarted = true;
+                            mSelectDraggingCursor = mSelectCursorExtent;
+                        }
+                        if (mSelectDraggingCursor != null) {
+                            mSelectDraggingOffset.set(
+                                    mSelectDraggingCursor.left - contentX,
+                                    mSelectDraggingCursor.top - contentY);
+                        }
                         if (DebugFlags.WEB_VIEW) {
                             Log.v(LOGTAG, "select=" + contentX + "," + contentY);
                         }
-                        invalidate();
                     }
                 }
                 // Trigger the link
@@ -6322,10 +6515,30 @@
                     if (mTouchMode == TOUCH_DOUBLE_TAP_MODE) {
                         mTouchMode = TOUCH_INIT_MODE;
                     }
-                    if (USE_WEBKIT_RINGS || getSettings().supportTouchOnly()) {
+                    if (sDisableNavcache) {
                         removeTouchHighlight();
                     }
                 }
+                if (mSelectingText && mSelectionStarted) {
+                    if (DebugFlags.WEB_VIEW) {
+                        Log.v(LOGTAG, "extend=" + contentX + "," + contentY);
+                    }
+                    ViewParent parent = getParent();
+                    if (parent != null) {
+                        parent.requestDisallowInterceptTouchEvent(true);
+                    }
+                    if (deltaX != 0 || deltaY != 0) {
+                        mSelectDraggingCursor.offsetTo(
+                                contentX + mSelectDraggingOffset.x,
+                                contentY + mSelectDraggingOffset.y);
+                        updateWebkitSelection();
+                        mLastTouchX = x;
+                        mLastTouchY = y;
+                        invalidate();
+                    }
+                    break;
+                }
+
                 // pass the touch events from UI thread to WebCore thread
                 if (shouldForwardTouchEvent() && mConfirmMove && (firstMove
                         || eventTime - mLastSentTouchTime > mCurrentTouchInterval)) {
@@ -6368,30 +6581,6 @@
                 } else {
                     mVelocityTracker.addMovement(ev);
                 }
-                if (mSelectingText && mSelectionStarted) {
-                    if (DebugFlags.WEB_VIEW) {
-                        Log.v(LOGTAG, "extend=" + contentX + "," + contentY);
-                    }
-                    ViewParent parent = getParent();
-                    if (parent != null) {
-                        parent.requestDisallowInterceptTouchEvent(true);
-                    }
-                    mAutoScrollX = x <= mMinAutoScrollX ? -SELECT_SCROLL
-                            : x >= mMaxAutoScrollX ? SELECT_SCROLL : 0;
-                    mAutoScrollY = y <= mMinAutoScrollY ? -SELECT_SCROLL
-                            : y >= mMaxAutoScrollY ? SELECT_SCROLL : 0;
-                    if ((mAutoScrollX != 0 || mAutoScrollY != 0)
-                            && !mSentAutoScrollMessage) {
-                        mSentAutoScrollMessage = true;
-                        mPrivateHandler.sendEmptyMessageDelayed(
-                                SCROLL_SELECT_TEXT, SELECT_SCROLL_INTERVAL);
-                    }
-                    if (deltaX != 0 || deltaY != 0) {
-                        nativeExtendSelection(contentX, contentY);
-                        invalidate();
-                    }
-                    break;
-                }
 
                 if (mTouchMode != TOUCH_DRAG_MODE &&
                         mTouchMode != TOUCH_DRAG_LAYER_MODE) {
@@ -6606,7 +6795,7 @@
                         } else {
                             if (mSelectingText) {
                                 // tapping on selection or controls does nothing
-                                if (!nativeHitSelection(contentX, contentY)) {
+                                if (!mSelectionStarted) {
                                     selectionDone();
                                 }
                                 break;
@@ -6903,6 +7092,12 @@
         if (mOverScrollGlow != null) {
             mOverScrollGlow.releaseAll();
         }
+
+        if (mSelectingText) {
+            mSelectionStarted = false;
+            syncSelectionCursors();
+            invalidate();
+        }
     }
 
     private void cancelTouch() {
@@ -6924,7 +7119,7 @@
         mPrivateHandler.removeMessages(SWITCH_TO_LONGPRESS);
         mPrivateHandler.removeMessages(DRAG_HELD_MOTIONLESS);
         mPrivateHandler.removeMessages(AWAKEN_SCROLL_BARS);
-        if (USE_WEBKIT_RINGS || getSettings().supportTouchOnly()) {
+        if (sDisableNavcache) {
             removeTouchHighlight();
         }
         mHeldMotionless = MOTIONLESS_TRUE;
@@ -6967,8 +7162,6 @@
     private int mTrackballYMove = 0;
     private boolean mSelectingText = false;
     private boolean mSelectionStarted = false;
-    private boolean mExtendSelection = false;
-    private boolean mDrawSelectionPointer = false;
     private static final int TRACKBALL_KEY_TIMEOUT = 1000;
     private static final int TRACKBALL_TIMEOUT = 200;
     private static final int TRACKBALL_WAIT = 100;
@@ -7037,14 +7230,8 @@
             mTrackballDown = false;
             mTrackballUpTime = time;
             if (mSelectingText) {
-                if (mExtendSelection) {
-                    copySelection();
-                    selectionDone();
-                } else {
-                    mExtendSelection = true;
-                    nativeSetExtendSelection();
-                    invalidate(); // draw the i-beam instead of the arrow
-                }
+                copySelection();
+                selectionDone();
                 return true; // discard press if copy in progress
             }
             if (DebugFlags.WEB_VIEW) {
@@ -7087,42 +7274,6 @@
         return true;
     }
 
-    void moveSelection(float xRate, float yRate) {
-        if (mNativeClass == 0)
-            return;
-        int width = getViewWidth();
-        int height = getViewHeight();
-        mSelectX += xRate;
-        mSelectY += yRate;
-        int maxX = width + mScrollX;
-        int maxY = height + mScrollY;
-        mSelectX = Math.min(maxX, Math.max(mScrollX - SELECT_CURSOR_OFFSET
-                , mSelectX));
-        mSelectY = Math.min(maxY, Math.max(mScrollY - SELECT_CURSOR_OFFSET
-                , mSelectY));
-        if (DebugFlags.WEB_VIEW) {
-            Log.v(LOGTAG, "moveSelection"
-                    + " mSelectX=" + mSelectX
-                    + " mSelectY=" + mSelectY
-                    + " mScrollX=" + mScrollX
-                    + " mScrollY=" + mScrollY
-                    + " xRate=" + xRate
-                    + " yRate=" + yRate
-                    );
-        }
-        nativeMoveSelection(viewToContentX(mSelectX), viewToContentY(mSelectY));
-        int scrollX = mSelectX < mScrollX ? -SELECT_CURSOR_OFFSET
-                : mSelectX > maxX - SELECT_CURSOR_OFFSET ? SELECT_CURSOR_OFFSET
-                : 0;
-        int scrollY = mSelectY < mScrollY ? -SELECT_CURSOR_OFFSET
-                : mSelectY > maxY - SELECT_CURSOR_OFFSET ? SELECT_CURSOR_OFFSET
-                : 0;
-        pinScrollBy(scrollX, scrollY, true, 0);
-        Rect select = new Rect(mSelectX, mSelectY, mSelectX + 1, mSelectY + 1);
-        requestRectangleOnScreen(select);
-        invalidate();
-   }
-
     private int scaleTrackballX(float xRate, int width) {
         int xMove = (int) (xRate / TRACKBALL_SCALE * width);
         int nextXMove = xMove;
@@ -7176,21 +7327,6 @@
         float yRate = mTrackballRemainsY * 1000 / elapsed;
         int viewWidth = getViewWidth();
         int viewHeight = getViewHeight();
-        if (mSelectingText) {
-            if (!mDrawSelectionPointer) {
-                // The last selection was made by touch, disabling drawing the
-                // selection pointer. Allow the trackball to adjust the
-                // position of the touch control.
-                mSelectX = contentToViewX(nativeSelectionX());
-                mSelectY = contentToViewY(nativeSelectionY());
-                mDrawSelectionPointer = mExtendSelection = true;
-                nativeSetExtendSelection();
-            }
-            moveSelection(scaleTrackballX(xRate, viewWidth),
-                    scaleTrackballY(yRate, viewHeight));
-            mTrackballRemainsX = mTrackballRemainsY = 0;
-            return;
-        }
         float ax = Math.abs(xRate);
         float ay = Math.abs(yRate);
         float maxA = Math.max(ax, ay);
@@ -7481,7 +7617,7 @@
      * and calls showCursorTimed on the native side
      */
     private void updateSelection() {
-        if (mNativeClass == 0) {
+        if (mNativeClass == 0 || sDisableNavcache) {
             return;
         }
         mPrivateHandler.removeMessages(UPDATE_SELECTION);
@@ -7589,7 +7725,7 @@
         int contentX = viewToContentX(mLastTouchX + mScrollX);
         int contentY = viewToContentY(mLastTouchY + mScrollY);
         int slop = viewToContentDimension(mNavSlop);
-        if (USE_WEBKIT_RINGS && !mTouchHighlightRegion.isEmpty()) {
+        if (sDisableNavcache && !mTouchHighlightRegion.isEmpty()) {
             // set mTouchHighlightRequested to 0 to cause an immediate
             // drawing of the touch rings
             mTouchHighlightRequested = 0;
@@ -7601,8 +7737,7 @@
                 }
             }, ViewConfiguration.getPressedStateDuration());
         }
-        if (getSettings().supportTouchOnly()) {
-            removeTouchHighlight();
+        if (sDisableNavcache) {
             WebViewCore.TouchUpData touchUpData = new WebViewCore.TouchUpData();
             // use "0" as generation id to inform WebKit to use the same x/y as
             // it used when processing GET_TOUCH_HIGHLIGHT_RECTS
@@ -8487,9 +8622,8 @@
                     break;
                 }
                 case SWITCH_TO_SHORTPRESS: {
-                    mInitialHitTestResult = null; // set by updateSelection()
                     if (mTouchMode == TOUCH_INIT_MODE) {
-                        if (!getSettings().supportTouchOnly()
+                        if (!sDisableNavcache
                                 && mPreventDefault != PREVENT_DEFAULT_YES) {
                             mTouchMode = TOUCH_SHORTPRESS_START_MODE;
                             updateSelection();
@@ -8504,7 +8638,7 @@
                     break;
                 }
                 case SWITCH_TO_LONGPRESS: {
-                    if (USE_WEBKIT_RINGS || getSettings().supportTouchOnly()) {
+                    if (sDisableNavcache) {
                         removeTouchHighlight();
                     }
                     if (inFullScreenMode() || mDeferTouchProcess) {
@@ -8601,14 +8735,17 @@
                 case UPDATE_TEXTFIELD_TEXT_MSG_ID:
                     // Make sure that the textfield is currently focused
                     // and representing the same node as the pointer.
-                    if (inEditingMode() &&
-                            mWebTextView.isSameTextField(msg.arg1)) {
-                        if (msg.arg2 == mTextGeneration) {
-                            String text = (String) msg.obj;
-                            if (null == text) {
-                                text = "";
-                            }
+                    if (msg.arg2 == mTextGeneration) {
+                        String text = (String) msg.obj;
+                        if (null == text) {
+                            text = "";
+                        }
+                        if (inEditingMode() &&
+                                mWebTextView.isSameTextField(msg.arg1)) {
                             mWebTextView.setTextAndKeepSelection(text);
+                        } else if (mInputConnection != null &&
+                                mFieldPointer == msg.arg1) {
+                            mInputConnection.setTextAndKeepSelection(text);
                         }
                     }
                     break;
@@ -8743,6 +8880,12 @@
                     }
                     break;
 
+                case EXIT_FULLSCREEN_VIDEO:
+                    if (mHTML5VideoViewProxy != null) {
+                        mHTML5VideoViewProxy.exitFullScreenVideo();
+                    }
+                    break;
+
                 case SHOW_FULLSCREEN: {
                     View view = (View) msg.obj;
                     int orientation = msg.arg1;
@@ -8835,10 +8978,28 @@
                     }
                     break;
 
-                case SET_TOUCH_HIGHLIGHT_RECTS:
-                    @SuppressWarnings("unchecked")
-                    ArrayList<Rect> rects = (ArrayList<Rect>) msg.obj;
-                    setTouchHighlightRects(rects);
+                case HIT_TEST_RESULT:
+                    WebKitHitTest hit = (WebKitHitTest) msg.obj;
+                    mFocusedNode = hit;
+                    setTouchHighlightRects(hit);
+                    if (hit == null) {
+                        mInitialHitTestResult = null;
+                    } else {
+                        mInitialHitTestResult = new HitTestResult();
+                        if (hit.mLinkUrl != null) {
+                            mInitialHitTestResult.mType = HitTestResult.SRC_ANCHOR_TYPE;
+                            mInitialHitTestResult.mExtra = hit.mLinkUrl;
+                            if (hit.mImageUrl != null) {
+                                mInitialHitTestResult.mType = HitTestResult.SRC_IMAGE_ANCHOR_TYPE;
+                                mInitialHitTestResult.mExtra = hit.mImageUrl;
+                            }
+                        } else if (hit.mImageUrl != null) {
+                            mInitialHitTestResult.mType = HitTestResult.IMAGE_TYPE;
+                            mInitialHitTestResult.mExtra = hit.mImageUrl;
+                        } else if (hit.mEditable) {
+                            mInitialHitTestResult.mType = HitTestResult.EDIT_TEXT_TYPE;
+                        }
+                    }
                     break;
 
                 case SAVE_WEBARCHIVE_FINISHED:
@@ -8868,6 +9029,28 @@
                     nativeSelectAt(msg.arg1, msg.arg2);
                     break;
 
+                case COPY_TO_CLIPBOARD:
+                    copyToClipboard((String) msg.obj);
+                    break;
+
+                case INIT_EDIT_FIELD:
+                    if (mInputConnection != null) {
+                        mTextGeneration = 0;
+                        mFieldPointer = msg.arg1;
+                        mInputConnection.setTextAndKeepSelection((String) msg.obj);
+                    }
+                    break;
+
+                case REPLACE_TEXT:{
+                    String text = (String)msg.obj;
+                    int start = msg.arg1;
+                    int end = msg.arg2;
+                    int cursorPosition = start + text.length();
+                    replaceTextfieldText(start, end, text,
+                            cursorPosition, cursorPosition);
+                    break;
+                }
+
                 default:
                     super.handleMessage(msg);
                     break;
@@ -8875,10 +9058,14 @@
         }
     }
 
-    private void setTouchHighlightRects(ArrayList<Rect> rects) {
-        invalidate(mTouchHighlightRegion.getBounds());
-        mTouchHighlightRegion.setEmpty();
+    private void setTouchHighlightRects(WebKitHitTest hit) {
+        Rect[] rects = hit != null ? hit.mTouchRects : null;
+        if (!mTouchHighlightRegion.isEmpty()) {
+            invalidate(mTouchHighlightRegion.getBounds());
+            mTouchHighlightRegion.setEmpty();
+        }
         if (rects != null) {
+            mTouchHightlightPaint.setColor(hit.mTapHighlightColor);
             for (Rect rect : rects) {
                 Rect viewRect = contentToViewRect(rect);
                 // some sites, like stories in nytimes.com, set
@@ -8900,6 +9087,7 @@
     /** @hide Called by JNI when pages are swapped (only occurs with hardware
      * acceleration) */
     protected void pageSwapCallback(boolean notifyAnimationStarted) {
+        mWebViewCore.resumeWebKitDraw();
         if (inEditingMode()) {
             didUpdateWebTextViewDimensions(ANYWHERE);
         }
@@ -8922,13 +9110,9 @@
         boolean isPictureAfterFirstLayout = viewState != null;
 
         if (updateBaseLayer) {
-            // Request a callback on pageSwap (to reposition the webtextview)
-            boolean registerPageSwapCallback =
-                !mZoomManager.isFixedLengthAnimationInProgress() && inEditingMode();
-
             setBaseLayer(draw.mBaseLayer, draw.mInvalRegion,
                     getSettings().getShowVisualIndicator(),
-                    isPictureAfterFirstLayout, registerPageSwapCallback);
+                    isPictureAfterFirstLayout);
         }
         final Point viewSize = draw.mViewSize;
         // We update the layout (i.e. request a layout from the
@@ -8989,11 +9173,26 @@
      */
     private void updateTextSelectionFromMessage(int nodePointer,
             int textGeneration, WebViewCore.TextSelectionData data) {
-        if (inEditingMode()
-                && mWebTextView.isSameTextField(nodePointer)
-                && textGeneration == mTextGeneration) {
-            mWebTextView.setSelectionFromWebKit(data.mStart, data.mEnd);
+        if (textGeneration == mTextGeneration) {
+            if (inEditingMode()
+                    && mWebTextView.isSameTextField(nodePointer)) {
+                mWebTextView.setSelectionFromWebKit(data.mStart, data.mEnd);
+            } else if (mInputConnection != null && mFieldPointer == nodePointer) {
+                mInputConnection.setSelection(data.mStart, data.mEnd);
+            }
         }
+
+        nativeSetTextSelection(mNativeClass, data.mSelectTextPtr);
+        if (data.mSelectTextPtr != 0) {
+            if (!mSelectingText) {
+                setupWebkitSelect();
+            } else if (!mSelectionStarted) {
+                syncSelectionCursors();
+            }
+        } else {
+            selectionDone();
+        }
+        invalidate();
     }
 
     // Class used to use a dropdown for a <select> element
@@ -9542,6 +9741,18 @@
     }
 
     /**
+     * Copy text into the clipboard. This is called indirectly from
+     * WebViewCore.
+     * @param text The text to put into the clipboard.
+     */
+    private void copyToClipboard(String text) {
+        ClipboardManager cm = (ClipboardManager)getContext()
+                .getSystemService(Context.CLIPBOARD_SERVICE);
+        ClipData clip = ClipData.newPlainText(getTitle(), text);
+        cm.setPrimaryClip(clip);
+    }
+
+    /**
      *  Update our cache with updatedText.
      *  @param updatedText  The new text to put in our cache.
      *  @hide
@@ -9579,11 +9790,6 @@
         }
     }
 
-    /** @hide call pageSwapCallback upon next page swap */
-    protected void registerPageSwapCallback() {
-        nativeRegisterPageSwapCallback(mNativeClass);
-    }
-
     /** @hide discard all textures from tiles */
     protected void discardAllTextures() {
         nativeDiscardAllTextures();
@@ -9627,6 +9833,23 @@
         return nativeTileProfilingGetFloat(frame, tile, key);
     }
 
+    /**
+     * Checks the focused content for an editable text field. This can be
+     * text input or ContentEditable.
+     * @return true if the focused item is an editable text field.
+     */
+    boolean focusCandidateIsEditableText() {
+        boolean isEditable = false;
+        // TODO: reverse sDisableNavcache so that its name is positive
+        boolean isNavcacheEnabled = !sDisableNavcache;
+        if (isNavcacheEnabled) {
+            isEditable = nativeFocusCandidateIsEditableText(mNativeClass);
+        } else if (mFocusedNode != null) {
+            isEditable = mFocusedNode.mEditable;
+        }
+        return isEditable;
+    }
+
     private native int nativeCacheHitFramePointer();
     private native boolean  nativeCacheHitIsPlugin();
     private native Rect nativeCacheHitNodeBounds();
@@ -9672,6 +9895,7 @@
     /* package */ native boolean  nativeFocusCandidateIsPassword();
     private native boolean  nativeFocusCandidateIsRtlText();
     private native boolean  nativeFocusCandidateIsTextInput();
+    private native boolean nativeFocusCandidateIsEditableText(int nativeClass);
     /* package */ native int      nativeFocusCandidateMaxLength();
     /* package */ native boolean  nativeFocusCandidateIsAutoComplete();
     /* package */ native boolean  nativeFocusCandidateIsSpellcheck();
@@ -9712,7 +9936,6 @@
     private native boolean  nativeMoveCursor(int keyCode, int count,
             boolean noScroll);
     private native int      nativeMoveGeneration();
-    private native void     nativeMoveSelection(int x, int y);
     /**
      * @return true if the page should get the shift and arrow keys, rather
      * than select text/navigation.
@@ -9722,24 +9945,16 @@
      */
     private native boolean  nativePageShouldHandleShiftAndArrows();
     private native boolean  nativePointInNavCache(int x, int y, int slop);
-    // Like many other of our native methods, you must make sure that
-    // mNativeClass is not null before calling this method.
-    private native void     nativeResetSelection();
-    private native Point    nativeSelectableText();
-    private native void     nativeSelectAll();
     private native void     nativeSelectBestAt(Rect rect);
     private native void     nativeSelectAt(int x, int y);
-    private native int      nativeSelectionX();
-    private native int      nativeSelectionY();
     private native int      nativeFindIndex();
     private native void     nativeSetExtendSelection();
     private native void     nativeSetFindIsEmpty();
     private native void     nativeSetFindIsUp(boolean isUp);
     private native void     nativeSetHeightCanMeasure(boolean measure);
-    private native void     nativeSetBaseLayer(int nativeInstance,
+    private native boolean  nativeSetBaseLayer(int nativeInstance,
             int layer, Region invalRegion,
-            boolean showVisualIndicator, boolean isPictureAfterFirstLayout,
-            boolean registerPageSwapCallback);
+            boolean showVisualIndicator, boolean isPictureAfterFirstLayout);
     private native int      nativeGetBaseLayer();
     private native void     nativeShowCursorTimed();
     private native void     nativeReplaceBaseContent(int content);
@@ -9751,7 +9966,6 @@
     private native void     nativeStopGL();
     private native Rect     nativeSubtractLayers(Rect content);
     private native int      nativeTextGeneration();
-    private native void     nativeRegisterPageSwapCallback(int nativeInstance);
     private native void     nativeDiscardAllTextures();
     private native void     nativeTileProfilingStart();
     private native float    nativeTileProfilingStop();
@@ -9786,11 +10000,14 @@
     private native int      nativeGetBackgroundColor();
     native boolean  nativeSetProperty(String key, String value);
     native String   nativeGetProperty(String key);
-    private native void     nativeGetTextSelectionRegion(int instance, Region region);
-    private native void     nativeGetSelectionHandles(int instance, int[] handles);
     /**
      * See {@link ComponentCallbacks2} for the trim levels and descriptions
      */
     private static native void     nativeOnTrimMemory(int level);
     private static native void nativeSetPauseDrawing(int instance, boolean pause);
+    private static native boolean nativeDisableNavcache();
+    private static native void nativeSetTextSelection(int instance, int selection);
+    private static native int nativeGetHandleLayerId(int instance, int handle,
+            Rect cursorLocation);
+    private static native boolean nativeIsBaseFirst(int instance);
 }
diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java
index 70b92b2..8a9c12d 100644
--- a/core/java/android/webkit/WebViewCore.java
+++ b/core/java/android/webkit/WebViewCore.java
@@ -26,6 +26,7 @@
 import android.media.MediaFile;
 import android.net.ProxyProperties;
 import android.net.Uri;
+import android.os.Bundle;
 import android.os.Handler;
 import android.os.Looper;
 import android.os.Message;
@@ -37,6 +38,7 @@
 import android.view.MotionEvent;
 import android.view.SurfaceView;
 import android.view.View;
+import android.webkit.WebView.FocusNodeHref;
 
 import junit.framework.Assert;
 
@@ -502,6 +504,17 @@
     }
 
     /**
+     * Notify the webview that we want to exit the video fullscreen.
+     * This is called through JNI by webcore.
+     */
+    protected void exitFullscreenVideo() {
+        if (mWebView == null) return;
+        Message message = Message.obtain(mWebView.mPrivateHandler,
+                       WebView.EXIT_FULLSCREEN_VIDEO);
+        message.sendToTarget();
+    }
+
+    /**
      * Clear the picture set. To be called only on the WebCore thread.
      */
     /* package */ void clearContent() {
@@ -634,18 +647,6 @@
             int end, int textGeneration);
 
     /**
-     * Delete text near the cursor.
-     * @param nativeClass The pointer to the native class (mNativeClass)
-     * @param leftLength The number of characters to the left of the cursor to
-     * delete
-     * @param rightLength The number of characters to the right of the cursor
-     * to delete.
-     */
-    private native void nativeDeleteSurroundingText(int nativeClass,
-            int leftLength,
-            int rightLength);
-
-    /**
      *  Set the selection to (start, end) in the focused textfield. If start and
      *  end are out of order, swap them.
      * @param  nativeClass Pointer to the C++ WebViewCore object mNativeClass
@@ -834,12 +835,14 @@
     }
 
     static class TextSelectionData {
-        public TextSelectionData(int start, int end) {
+        public TextSelectionData(int start, int end, int selectTextPtr) {
             mStart = start;
             mEnd = end;
+            mSelectTextPtr = selectTextPtr;
         }
         int mStart;
         int mEnd;
+        int mSelectTextPtr;
     }
 
     static class TouchUpData {
@@ -860,6 +863,24 @@
         Rect mNativeLayerRect;
     }
 
+    static class WebKitHitTest {
+        String mLinkUrl;
+        String mAnchorText;
+        String mImageUrl;
+        String mAltDisplayString;
+        String mTitle;
+        Rect[] mTouchRects;
+        boolean mEditable;
+        int mTapHighlightColor = WebView.HIGHLIGHT_COLOR;
+        Rect[] mEnclosingParentRects;
+
+        // These are the input values that produced this hit test
+        int mHitTestX;
+        int mHitTestY;
+        int mHitTestSlop;
+        boolean mHitTestMovedMouse;
+    }
+
     static class AutoFillData {
         public AutoFillData() {
             mQueryId = WebTextView.FORM_NOT_AUTOFILLABLE;
@@ -1072,7 +1093,7 @@
         static final int ADD_PACKAGE_NAME = 185;
         static final int REMOVE_PACKAGE_NAME = 186;
 
-        static final int GET_TOUCH_HIGHLIGHT_RECTS = 187;
+        static final int HIT_TEST = 187;
 
         // accessibility support
         static final int MODIFY_SELECTION = 190;
@@ -1091,9 +1112,19 @@
 
         static final int HEARTBEAT = 197;
 
+        static final int SCROLL_LAYER = 198;
+
         // private message ids
         private static final int DESTROY =     200;
 
+        // for cut & paste
+        static final int COPY_TEXT = 210;
+        static final int DELETE_TEXT = 211;
+        static final int INSERT_TEXT = 212;
+        static final int SELECT_TEXT = 213;
+        static final int SELECT_WORD_AT = 214;
+        static final int SELECT_ALL = 215;
+
         // Private handler for WebCore messages.
         private Handler mHandler;
         // Message queue for containing messages before the WebCore thread is
@@ -1169,7 +1200,6 @@
                                 mSettings.onDestroyed();
                                 mNativeClass = 0;
                                 mWebView = null;
-                                WebCoreThreadWatchdog.quit();
                             }
                             break;
 
@@ -1506,13 +1536,12 @@
                             break;
 
                         case REQUEST_CURSOR_HREF: {
+                            WebKitHitTest hit = performHitTest(msg.arg1, msg.arg2, 1, false);
                             Message hrefMsg = (Message) msg.obj;
-                            hrefMsg.getData().putString("url",
-                                    nativeRetrieveHref(mNativeClass, msg.arg1, msg.arg2));
-                            hrefMsg.getData().putString("title",
-                                    nativeRetrieveAnchorText(mNativeClass, msg.arg1, msg.arg2));
-                            hrefMsg.getData().putString("src",
-                                    nativeRetrieveImageSource(mNativeClass, msg.arg1, msg.arg2));
+                            Bundle data = hrefMsg.getData();
+                            data.putString(FocusNodeHref.URL,hit.mLinkUrl);
+                            data.putString(FocusNodeHref.TITLE, hit.mAnchorText);
+                            data.putString(FocusNodeHref.SRC, hit.mImageUrl);
                             hrefMsg.sendToTarget();
                             break;
                         }
@@ -1540,17 +1569,12 @@
                                     deleteSelectionData.mStart, deleteSelectionData.mEnd, msg.arg1);
                             break;
 
-                        case DELETE_SURROUNDING_TEXT:
-                            nativeDeleteSurroundingText(mNativeClass,
-                                    msg.arg1, msg.arg2);
-                            break;
-
                         case SET_SELECTION:
                             nativeSetSelection(mNativeClass, msg.arg1, msg.arg2);
                             break;
 
                         case MODIFY_SELECTION:
-                            String modifiedSelectionString = 
+                            String modifiedSelectionString =
                                 nativeModifySelection(mNativeClass, msg.arg1,
                                         msg.arg2);
                             mWebView.mPrivateHandler.obtainMessage(WebView.SELECTION_STRING_CHANGED,
@@ -1671,16 +1695,15 @@
                                     (Set<String>) msg.obj);
                             break;
 
-                        case GET_TOUCH_HIGHLIGHT_RECTS:
+                        case HIT_TEST:
                             TouchHighlightData d = (TouchHighlightData) msg.obj;
                             if (d.mNativeLayer != 0) {
                                 nativeScrollLayer(mNativeClass,
                                         d.mNativeLayer, d.mNativeLayerRect);
                             }
-                            ArrayList<Rect> rects = nativeGetTouchHighlightRects
-                                    (mNativeClass, d.mX, d.mY, d.mSlop);
+                            WebKitHitTest hit = performHitTest(d.mX, d.mY, d.mSlop, true);
                             mWebView.mPrivateHandler.obtainMessage(
-                                    WebView.SET_TOUCH_HIGHLIGHT_RECTS, rects)
+                                    WebView.HIT_TEST_RESULT, hit)
                                     .sendToTarget();
                             break;
 
@@ -1702,6 +1725,52 @@
                                 mBrowserFrame.stringByEvaluatingJavaScriptFromString((String) msg.obj);
                             }
                             break;
+                        case SCROLL_LAYER:
+                            int nativeLayer = msg.arg1;
+                            Rect rect = (Rect) msg.obj;
+                            nativeScrollLayer(mNativeClass, nativeLayer,
+                                    rect);
+                            break;
+
+                        case DELETE_TEXT: {
+                            int[] handles = (int[]) msg.obj;
+                            nativeDeleteText(mNativeClass, handles[0],
+                                    handles[1], handles[2], handles[3]);
+                            break;
+                        }
+                        case COPY_TEXT: {
+                            int[] handles = (int[]) msg.obj;
+                            String copiedText = nativeGetText(mNativeClass,
+                                    handles[0], handles[1], handles[2],
+                                    handles[3]);
+                            if (copiedText != null) {
+                                mWebView.mPrivateHandler.obtainMessage(WebView.COPY_TO_CLIPBOARD, copiedText)
+                                        .sendToTarget();
+                            }
+                            break;
+                        }
+                        case INSERT_TEXT:
+                            nativeInsertText(mNativeClass, (String) msg.obj);
+                            break;
+                        case SELECT_TEXT: {
+                            int[] args = (int[]) msg.obj;
+                            if (args == null) {
+                                nativeClearTextSelection(mNativeClass);
+                            } else {
+                                nativeSelectText(mNativeClass, args[0],
+                                        args[1], args[2], args[3]);
+                            }
+                            break;
+                        }
+                        case SELECT_WORD_AT: {
+                            int x = msg.arg1;
+                            int y = msg.arg2;
+                            nativeSelectWordAt(mNativeClass, x, y);
+                            break;
+                        }
+                        case SELECT_ALL:
+                            nativeSelectAll(mNativeClass);
+                            break;
                     }
                 }
             };
@@ -1877,6 +1946,15 @@
     // WebViewCore private methods
     //-------------------------------------------------------------------------
 
+    private WebKitHitTest performHitTest(int x, int y, int slop, boolean moveMouse) {
+        WebKitHitTest hit = nativeHitTest(mNativeClass, x, y, slop, moveMouse);
+        hit.mHitTestX = x;
+        hit.mHitTestY = y;
+        hit.mHitTestSlop = slop;
+        hit.mHitTestMovedMouse = moveMouse;
+        return hit;
+    }
+
     private void clearCache(boolean includeDiskFiles) {
         mBrowserFrame.clearCache();
         if (includeDiskFiles) {
@@ -2092,7 +2170,36 @@
                 .obtainMessage(WebView.INVAL_RECT_MSG_ID));
     }
 
+    private Boolean m_skipDrawFlag = false;
+    private boolean m_drawWasSkipped = false;
+
+    void pauseWebKitDraw() {
+        synchronized (m_skipDrawFlag) {
+            if (!m_skipDrawFlag) {
+                m_skipDrawFlag = true;
+            }
+        }
+    }
+
+    void resumeWebKitDraw() {
+        synchronized (m_skipDrawFlag) {
+            if (m_skipDrawFlag && m_drawWasSkipped) {
+                // a draw was dropped, send a retry
+                m_drawWasSkipped = false;
+                mEventHub.sendMessage(Message.obtain(null, EventHub.WEBKIT_DRAW));
+            }
+            m_skipDrawFlag = false;
+        }
+    }
+
     private void webkitDraw() {
+        synchronized (m_skipDrawFlag) {
+            if (m_skipDrawFlag) {
+                m_drawWasSkipped = true;
+                return;
+            }
+        }
+
         mDrawIsScheduled = false;
         DrawData draw = new DrawData();
         if (DebugFlags.WEB_VIEW_CORE) Log.v(LOGTAG, "webkitDraw start");
@@ -2101,7 +2208,7 @@
         if (draw.mBaseLayer == 0) {
             if (mWebView != null && !mWebView.isPaused()) {
                 if (DebugFlags.WEB_VIEW_CORE) Log.v(LOGTAG, "webkitDraw abort, resending draw message");
-                mEventHub.sendMessage(Message.obtain(null, EventHub.WEBKIT_DRAW));
+                mEventHub.sendMessageDelayed(Message.obtain(null, EventHub.WEBKIT_DRAW), 10);
             } else {
                 if (DebugFlags.WEB_VIEW_CORE) Log.v(LOGTAG, "webkitDraw abort, webview paused");
             }
@@ -2335,9 +2442,9 @@
         }
 
         // remove the touch highlight when moving to a new page
-        if (WebView.USE_WEBKIT_RINGS || getSettings().supportTouchOnly()) {
+        if (WebView.sDisableNavcache) {
             mWebView.mPrivateHandler.sendEmptyMessage(
-                    WebView.SET_TOUCH_HIGHLIGHT_RECTS);
+                    WebView.HIT_TEST_RESULT);
         }
 
         // reset the scroll position, the restored offset and scales
@@ -2396,11 +2503,7 @@
         // adjust the default scale to match the densityDpi
         float adjust = 1.0f;
         if (mViewportDensityDpi == -1) {
-            // convert default zoom scale to a integer (percentage) to avoid any
-            // issues with floating point comparisons
-            if (mWebView != null && (int)(mWebView.getDefaultZoomScale() * 100) != 100) {
-                adjust = mWebView.getDefaultZoomScale();
-            }
+            adjust = mContext.getResources().getDisplayMetrics().density;
         } else if (mViewportDensityDpi > 0) {
             adjust = (float) mContext.getResources().getDisplayMetrics().densityDpi
                     / mViewportDensityDpi;
@@ -2650,11 +2753,11 @@
 
     // called by JNI
     private void updateTextSelection(int pointer, int start, int end,
-            int textGeneration) {
+            int textGeneration, int selectionPtr) {
         if (mWebView != null) {
             Message.obtain(mWebView.mPrivateHandler,
                 WebView.UPDATE_TEXT_SELECTION_MSG_ID, pointer, textGeneration,
-                new TextSelectionData(start, end)).sendToTarget();
+                new TextSelectionData(start, end, selectionPtr)).sendToTarget();
         }
     }
 
@@ -2672,6 +2775,19 @@
                 WebView.FIND_AGAIN).sendToTarget();
     }
 
+    // called by JNI
+    private void initEditField(int pointer, String text, int start, int end) {
+        if (mWebView == null) {
+            return;
+        }
+        Message.obtain(mWebView.mPrivateHandler,
+                WebView.INIT_EDIT_FIELD, pointer, 0, text).sendToTarget();
+        Message.obtain(mWebView.mPrivateHandler,
+                WebView.REQUEST_KEYBOARD_WITH_SELECTION_MSG_ID, pointer,
+                0, new TextSelectionData(start, end, 0))
+                .sendToTarget();
+    }
+
     private native void nativeUpdateFrameCacheIfLoading(int nativeClass);
     private native void nativeRevealSelection(int nativeClass);
     private native String nativeRequestLabel(int nativeClass, int framePtr,
@@ -2707,17 +2823,6 @@
     }
 
     // called by JNI
-    private void requestKeyboardWithSelection(int pointer, int selStart,
-            int selEnd, int textGeneration) {
-        if (mWebView != null) {
-            Message.obtain(mWebView.mPrivateHandler,
-                    WebView.REQUEST_KEYBOARD_WITH_SELECTION_MSG_ID, pointer,
-                    textGeneration, new TextSelectionData(selStart, selEnd))
-                    .sendToTarget();
-        }
-    }
-
-    // called by JNI
     private void requestKeyboard(boolean showKeyboard) {
         if (mWebView != null) {
             Message.obtain(mWebView.mPrivateHandler,
@@ -2931,9 +3036,45 @@
     private native boolean nativeValidNodeAndBounds(int nativeClass, int frame,
             int node, Rect bounds);
 
-    private native ArrayList<Rect> nativeGetTouchHighlightRects(int nativeClass,
-            int x, int y, int slop);
+    private native WebKitHitTest nativeHitTest(int nativeClass, int x, int y,
+            int slop, boolean moveMouse);
 
     private native void nativeAutoFillForm(int nativeClass, int queryId);
     private native void nativeScrollLayer(int nativeClass, int layer, Rect rect);
+
+    /**
+     * Deletes editable text between two points. Note that the selection may
+     * differ from the WebView's selection because the algorithms for selecting
+     * text differs for non-LTR text. Any text that isn't editable will be
+     * left unchanged.
+     * @param nativeClass The pointer to the native class (mNativeClass)
+     * @param startX The X position of the top-left selection point.
+     * @param startY The Y position of the top-left selection point.
+     * @param endX The X position of the bottom-right selection point.
+     * @param endY The Y position of the bottom-right selection point.
+     */
+    private native void nativeDeleteText(int nativeClass,
+            int startX, int startY, int endX, int endY);
+    /**
+     * Inserts text at the current cursor position. If the currently-focused
+     * node does not have a cursor position then this function does nothing.
+     */
+    private native void nativeInsertText(int nativeClass, String text);
+    /**
+     * Gets the text between two selection points. Note that the selection
+     * may differ from the WebView's selection because the algorithms for
+     * selecting text differs for non-LTR text.
+     * @param nativeClass The pointer to the native class (mNativeClass)
+     * @param startX The X position of the top-left selection point.
+     * @param startY The Y position of the top-left selection point.
+     * @param endX The X position of the bottom-right selection point.
+     * @param endY The Y position of the bottom-right selection point.
+     */
+    private native String nativeGetText(int nativeClass,
+            int startX, int startY, int endX, int endY);
+    private native void nativeSelectText(int nativeClass,
+            int startX, int startY, int endX, int endY);
+    private native void nativeClearTextSelection(int nativeClass);
+    private native void nativeSelectWordAt(int nativeClass, int x, int y);
+    private native void nativeSelectAll(int nativeClass);
 }
diff --git a/core/java/android/webkit/ZoomManager.java b/core/java/android/webkit/ZoomManager.java
index 8ffba64..ae2d617 100644
--- a/core/java/android/webkit/ZoomManager.java
+++ b/core/java/android/webkit/ZoomManager.java
@@ -717,7 +717,7 @@
     private void zoomToReadingLevel() {
         final float readingScale = getReadingLevelScale();
 
-        int left = mWebView.nativeGetBlockLeftEdge(mAnchorX, mAnchorY, mActualScale);
+        int left = mWebView.getBlockLeftEdge(mAnchorX, mAnchorY, readingScale);
         if (left != WebView.NO_LEFTEDGE) {
             // add a 5pt padding to the left edge.
             int viewLeft = mWebView.contentToViewX(left < 5 ? 0 : (left - 5))
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index 38bb2e1..e94b1cb 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -20,7 +20,6 @@
 
 import android.content.Context;
 import android.content.Intent;
-import android.content.res.Resources;
 import android.content.res.TypedArray;
 import android.graphics.Canvas;
 import android.graphics.Rect;
@@ -1297,6 +1296,18 @@
         super.sendAccessibilityEvent(eventType);
     }
 
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(AbsListView.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(AbsListView.class.getName());
+    }
+
     /**
      * Indicates whether the children's drawing cache is used during a scroll.
      * By default, the drawing cache is enabled but this will consume more memory.
@@ -5572,6 +5583,16 @@
     }
 
     /**
+     * Hints the RemoteViewsAdapter, if it exists, about which views are currently
+     * being displayed by the AbsListView.
+     */
+    void setVisibleRangeHint(int start, int end) {
+        if (mRemoteAdapter != null) {
+            mRemoteAdapter.setVisibleRangeHint(start, end);
+        }
+    }
+
+    /**
      * Sets the recycler listener to be notified whenever a View is set aside in
      * the recycler for later reuse. This listener can be used to free resources
      * associated to the View.
diff --git a/core/java/android/widget/AbsSeekBar.java b/core/java/android/widget/AbsSeekBar.java
index bdaf89e..e36afa3 100644
--- a/core/java/android/widget/AbsSeekBar.java
+++ b/core/java/android/widget/AbsSeekBar.java
@@ -25,6 +25,8 @@
 import android.view.KeyEvent;
 import android.view.MotionEvent;
 import android.view.ViewConfiguration;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 public abstract class AbsSeekBar extends ProgressBar {
     private Drawable mThumb;
@@ -464,4 +466,15 @@
         return super.onKeyDown(keyCode, event);
     }
 
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(AbsSeekBar.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(AbsSeekBar.class.getName());
+    }
 }
diff --git a/core/java/android/widget/AbsSpinner.java b/core/java/android/widget/AbsSpinner.java
index 3d79205..efdfae3 100644
--- a/core/java/android/widget/AbsSpinner.java
+++ b/core/java/android/widget/AbsSpinner.java
@@ -28,6 +28,8 @@
 import android.util.SparseArray;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 /**
  * An abstract base class for spinner widgets. SDK users will probably not
@@ -40,7 +42,6 @@
 
     int mHeightMeasureSpec;
     int mWidthMeasureSpec;
-    boolean mBlockLayoutRequests;
 
     int mSelectionLeftPadding = 0;
     int mSelectionTopPadding = 0;
@@ -463,4 +464,16 @@
             scrapHeap.clear();
         }
     }
+
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(AbsSpinner.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(AbsSpinner.class.getName());
+    }
 }
diff --git a/core/java/android/widget/ActivityChooserView.java b/core/java/android/widget/ActivityChooserView.java
index 60b24bc..be6b4e2 100644
--- a/core/java/android/widget/ActivityChooserView.java
+++ b/core/java/android/widget/ActivityChooserView.java
@@ -33,8 +33,6 @@
 import android.view.ViewGroup;
 import android.view.ViewTreeObserver;
 import android.view.ViewTreeObserver.OnGlobalLayoutListener;
-import android.view.accessibility.AccessibilityEvent;
-import android.view.accessibility.AccessibilityManager;
 import android.widget.ActivityChooserModel.ActivityChooserModelClient;
 
 /**
@@ -366,7 +364,7 @@
             getListPopupWindow().dismiss();
             ViewTreeObserver viewTreeObserver = getViewTreeObserver();
             if (viewTreeObserver.isAlive()) {
-                viewTreeObserver.removeGlobalOnLayoutListener(mOnGlobalLayoutListener);
+                viewTreeObserver.removeOnGlobalLayoutListener(mOnGlobalLayoutListener);
             }
         }
         return true;
@@ -400,7 +398,7 @@
         }
         ViewTreeObserver viewTreeObserver = getViewTreeObserver();
         if (viewTreeObserver.isAlive()) {
-            viewTreeObserver.removeGlobalOnLayoutListener(mOnGlobalLayoutListener);
+            viewTreeObserver.removeOnGlobalLayoutListener(mOnGlobalLayoutListener);
         }
         mIsAttachedToWindow = false;
     }
@@ -547,6 +545,7 @@
                         position = mAdapter.getShowDefaultActivity() ? position : position + 1;
                         Intent launchIntent = mAdapter.getDataModel().chooseActivity(position);
                         if (launchIntent != null) {
+                            launchIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
                             mContext.startActivity(launchIntent);
                         }
                     }
@@ -564,6 +563,7 @@
                 final int index = mAdapter.getDataModel().getActivityIndex(defaultActivity);
                 Intent launchIntent = mAdapter.getDataModel().chooseActivity(index);
                 if (launchIntent != null) {
+                    launchIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
                     mContext.startActivity(launchIntent);
                 }
             } else if (view == mExpandActivityOverflowButton) {
diff --git a/core/java/android/widget/AdapterView.java b/core/java/android/widget/AdapterView.java
index 40df168..97a864c 100644
--- a/core/java/android/widget/AdapterView.java
+++ b/core/java/android/widget/AdapterView.java
@@ -913,6 +913,7 @@
     @Override
     public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
         super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(AdapterView.class.getName());
         info.setScrollable(isScrollableForAccessibility());
         View selectedView = getSelectedView();
         if (selectedView != null) {
@@ -923,6 +924,7 @@
     @Override
     public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
         super.onInitializeAccessibilityEvent(event);
+        event.setClassName(AdapterView.class.getName());
         event.setScrollable(isScrollableForAccessibility());
         View selectedView = getSelectedView();
         if (selectedView != null) {
diff --git a/core/java/android/widget/AdapterViewAnimator.java b/core/java/android/widget/AdapterViewAnimator.java
index c83c780..bb00049 100644
--- a/core/java/android/widget/AdapterViewAnimator.java
+++ b/core/java/android/widget/AdapterViewAnimator.java
@@ -29,6 +29,8 @@
 import android.view.View;
 import android.view.ViewConfiguration;
 import android.view.ViewGroup;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -555,6 +557,11 @@
             mCurrentWindowStart = newWindowStart;
             mCurrentWindowEnd = newWindowEnd;
             mCurrentWindowStartUnbounded = newWindowStartUnbounded;
+            if (mRemoteViewsAdapter != null) {
+                int adapterStart = modulo(mCurrentWindowStart, adapterCount);
+                int adapterEnd = modulo(mCurrentWindowEnd, adapterCount);
+                mRemoteViewsAdapter.setVisibleRangeHint(adapterStart, adapterEnd);
+            }
         }
         requestLayout();
         invalidate();
@@ -1045,4 +1052,16 @@
      */
     public void fyiWillBeAdvancedByHostKThx() {
     }
+
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(AdapterViewAnimator.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(AdapterViewAnimator.class.getName());
+    }
 }
diff --git a/core/java/android/widget/AdapterViewFlipper.java b/core/java/android/widget/AdapterViewFlipper.java
index 4419886..5096227 100644
--- a/core/java/android/widget/AdapterViewFlipper.java
+++ b/core/java/android/widget/AdapterViewFlipper.java
@@ -16,7 +16,6 @@
 
 package android.widget;
 
-import android.animation.ObjectAnimator;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
@@ -27,7 +26,8 @@
 import android.util.AttributeSet;
 import android.util.Log;
 import android.view.RemotableViewMethod;
-import android.view.animation.AlphaAnimation;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.widget.RemoteViews.RemoteView;
 
 /**
@@ -268,4 +268,16 @@
         mAdvancedByHost = true;
         updateRunning(false);
     }
+
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(AdapterViewFlipper.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(AdapterViewFlipper.class.getName());
+    }
 }
diff --git a/core/java/android/widget/AutoCompleteTextView.java b/core/java/android/widget/AutoCompleteTextView.java
index 07523e3..f7a6b272 100644
--- a/core/java/android/widget/AutoCompleteTextView.java
+++ b/core/java/android/widget/AutoCompleteTextView.java
@@ -1085,10 +1085,11 @@
 
                 for (int i = 0; i < count; i++) {
                     if (adapter.isEnabled(i)) {
-                        realCount++;
                         Object item = adapter.getItem(i);
                         long id = adapter.getItemId(i);
-                        completions[i] = new CompletionInfo(id, i, convertSelectionToString(item));
+                        completions[realCount] = new CompletionInfo(id, realCount,
+                                convertSelectionToString(item));
+                        realCount++;
                     }
                 }
                 
diff --git a/core/java/android/widget/Button.java b/core/java/android/widget/Button.java
index 8d58a6d..99f4cae 100644
--- a/core/java/android/widget/Button.java
+++ b/core/java/android/widget/Button.java
@@ -18,9 +18,8 @@
 
 import android.content.Context;
 import android.util.AttributeSet;
-import android.util.Log;
-import android.view.MotionEvent;
-import android.view.KeyEvent;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.widget.RemoteViews.RemoteView;
 
 
@@ -107,4 +106,16 @@
     public Button(Context context, AttributeSet attrs, int defStyle) {
         super(context, attrs, defStyle);
     }
+
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(Button.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(Button.class.getName());
+    }
 }
diff --git a/core/java/android/widget/CalendarView.java b/core/java/android/widget/CalendarView.java
index e0403ff..85252af 100644
--- a/core/java/android/widget/CalendarView.java
+++ b/core/java/android/widget/CalendarView.java
@@ -39,6 +39,8 @@
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.widget.AbsListView.OnScrollListener;
 
 import com.android.internal.R;
@@ -431,6 +433,18 @@
         setCurrentLocale(newConfig.locale);
     }
 
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(CalendarView.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(CalendarView.class.getName());
+    }
+
     /**
      * Gets the minimal date supported by this {@link CalendarView} in milliseconds
      * since January 1, 1970 00:00:00 in {@link TimeZone#getDefault()} time
diff --git a/core/java/android/widget/CheckBox.java b/core/java/android/widget/CheckBox.java
index 2788846..0685eea 100644
--- a/core/java/android/widget/CheckBox.java
+++ b/core/java/android/widget/CheckBox.java
@@ -19,6 +19,7 @@
 import android.content.Context;
 import android.util.AttributeSet;
 import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 import com.android.internal.R;
 
@@ -78,4 +79,16 @@
             event.getText().add(mContext.getString(R.string.checkbox_not_checked));
         }
     }
+
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(CheckBox.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(CheckBox.class.getName());
+    }
 }
diff --git a/core/java/android/widget/CheckedTextView.java b/core/java/android/widget/CheckedTextView.java
index 0a54743..5c7e5a3 100644
--- a/core/java/android/widget/CheckedTextView.java
+++ b/core/java/android/widget/CheckedTextView.java
@@ -220,6 +220,7 @@
     @Override
     public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
         super.onInitializeAccessibilityEvent(event);
+        event.setClassName(CheckedTextView.class.getName());
         event.setChecked(mChecked);
     }
 
@@ -236,6 +237,7 @@
     @Override
     public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
         super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(CheckedTextView.class.getName());
         info.setChecked(mChecked);
     }
 }
diff --git a/core/java/android/widget/Chronometer.java b/core/java/android/widget/Chronometer.java
index 7e66722..0370049 100644
--- a/core/java/android/widget/Chronometer.java
+++ b/core/java/android/widget/Chronometer.java
@@ -25,6 +25,8 @@
 import android.text.format.DateUtils;
 import android.util.AttributeSet;
 import android.util.Log;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.widget.RemoteViews.RemoteView;
 
 import java.util.Formatter;
@@ -276,4 +278,16 @@
             mOnChronometerTickListener.onChronometerTick(this);
         }
     }
+
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(Chronometer.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(Chronometer.class.getName());
+    }
 }
diff --git a/core/java/android/widget/CompoundButton.java b/core/java/android/widget/CompoundButton.java
index d3cdad8..02c4c4f 100644
--- a/core/java/android/widget/CompoundButton.java
+++ b/core/java/android/widget/CompoundButton.java
@@ -211,12 +211,14 @@
     @Override
     public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
         super.onInitializeAccessibilityEvent(event);
+        event.setClassName(CompoundButton.class.getName());
         event.setChecked(mChecked);
     }
 
     @Override
     public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
         super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(CompoundButton.class.getName());
         info.setCheckable(true);
         info.setChecked(mChecked);
     }
diff --git a/core/java/android/widget/DatePicker.java b/core/java/android/widget/DatePicker.java
index 0f462ff..110c8f3 100644
--- a/core/java/android/widget/DatePicker.java
+++ b/core/java/android/widget/DatePicker.java
@@ -31,6 +31,7 @@
 import android.view.LayoutInflater;
 import android.view.accessibility.AccessibilityEvent;
 import android.view.accessibility.AccessibilityManager;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.view.inputmethod.EditorInfo;
 import android.view.inputmethod.InputMethodManager;
 import android.widget.NumberPicker.OnValueChangeListener;
@@ -391,6 +392,18 @@
     }
 
     @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(DatePicker.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(DatePicker.class.getName());
+    }
+
+    @Override
     protected void onConfigurationChanged(Configuration newConfig) {
         super.onConfigurationChanged(newConfig);
         setCurrentLocale(newConfig.locale);
diff --git a/core/java/android/widget/DigitalClock.java b/core/java/android/widget/DigitalClock.java
index 379883a..add9d9b 100644
--- a/core/java/android/widget/DigitalClock.java
+++ b/core/java/android/widget/DigitalClock.java
@@ -24,6 +24,8 @@
 import android.provider.Settings;
 import android.text.format.DateFormat;
 import android.util.AttributeSet;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 import java.util.Calendar;
 
@@ -126,4 +128,16 @@
             setFormat();
         }
     }
+
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(DigitalClock.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(DigitalClock.class.getName());
+    }
 }
diff --git a/core/java/android/widget/EditText.java b/core/java/android/widget/EditText.java
index 0da68a4..2fd8768 100644
--- a/core/java/android/widget/EditText.java
+++ b/core/java/android/widget/EditText.java
@@ -24,6 +24,8 @@
 import android.text.method.ArrowKeyMovementMethod;
 import android.text.method.MovementMethod;
 import android.util.AttributeSet;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 
 /*
@@ -114,4 +116,16 @@
         }
         super.setEllipsize(ellipsis);
     }
+
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(EditText.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(EditText.class.getName());
+    }
 }
diff --git a/core/java/android/widget/ExpandableListView.java b/core/java/android/widget/ExpandableListView.java
index ead9b4f..badfaa7 100644
--- a/core/java/android/widget/ExpandableListView.java
+++ b/core/java/android/widget/ExpandableListView.java
@@ -30,6 +30,8 @@
 import android.view.SoundEffectConstants;
 import android.view.View;
 import android.view.ContextMenu.ContextMenuInfo;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.widget.ExpandableListConnector.PositionMetadata;
 
 import java.util.ArrayList;
@@ -1167,4 +1169,15 @@
         }
     }
 
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(ExpandableListView.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(ExpandableListView.class.getName());
+    }
 }
diff --git a/core/java/android/widget/FrameLayout.java b/core/java/android/widget/FrameLayout.java
index 74a57b0..da98884 100644
--- a/core/java/android/widget/FrameLayout.java
+++ b/core/java/android/widget/FrameLayout.java
@@ -29,6 +29,8 @@
 import android.view.View;
 import android.view.ViewDebug;
 import android.view.ViewGroup;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.widget.RemoteViews.RemoteView;
 
 
@@ -555,6 +557,19 @@
         return new LayoutParams(p);
     }
 
+
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(FrameLayout.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(FrameLayout.class.getName());
+    }
+
     /**
      * Per-child layout information for layouts that support margins.
      * See {@link android.R.styleable#FrameLayout_Layout FrameLayout Layout Attributes}
diff --git a/core/java/android/widget/Gallery.java b/core/java/android/widget/Gallery.java
index 5e37fa8..03fdc39 100644
--- a/core/java/android/widget/Gallery.java
+++ b/core/java/android/widget/Gallery.java
@@ -32,6 +32,8 @@
 import android.view.View;
 import android.view.ViewConfiguration;
 import android.view.ViewGroup;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.view.animation.Transformation;
 
 import com.android.internal.R;
@@ -1355,6 +1357,18 @@
 
     }
 
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(Gallery.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(Gallery.class.getName());
+    }
+
     /**
      * Responsible for fling behavior. Use {@link #startUsingVelocity(int)} to
      * initiate a fling. Each frame of the fling is handled in {@link #run()}.
diff --git a/core/java/android/widget/GridLayout.java b/core/java/android/widget/GridLayout.java
index 7cf5168..984ec79 100644
--- a/core/java/android/widget/GridLayout.java
+++ b/core/java/android/widget/GridLayout.java
@@ -27,6 +27,9 @@
 import android.view.Gravity;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
+
 import com.android.internal.R;
 
 import java.lang.reflect.Array;
@@ -839,9 +842,11 @@
      * @hide
      */
     @Override
-    protected void onChildVisibilityChanged(View child, int visibility) {
-        super.onChildVisibilityChanged(child, visibility);
-        invalidateStructure();
+    protected void onChildVisibilityChanged(View child, int oldVisibility, int newVisibility) {
+        super.onChildVisibilityChanged(child, oldVisibility, newVisibility);
+        if (oldVisibility == GONE || newVisibility == GONE) {
+            invalidateStructure();
+        }
     }
 
     // Measurement
@@ -1041,6 +1046,18 @@
         }
     }
 
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(GridLayout.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(GridLayout.class.getName());
+    }
+
     // Inner classes
 
     /*
diff --git a/core/java/android/widget/GridView.java b/core/java/android/widget/GridView.java
index 5d406de..be2df8e 100644
--- a/core/java/android/widget/GridView.java
+++ b/core/java/android/widget/GridView.java
@@ -27,6 +27,8 @@
 import android.view.View;
 import android.view.ViewDebug;
 import android.view.ViewGroup;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.view.animation.GridLayoutAnimationController;
 import android.widget.RemoteViews.RemoteView;
 
@@ -290,6 +292,7 @@
             pos += mNumColumns;
         }
 
+        setVisibleRangeHint(mFirstPosition, mFirstPosition + getChildCount() - 1);
         return selectedView;
     }
 
@@ -382,6 +385,7 @@
             mFirstPosition = Math.max(0, pos + 1);
         }
 
+        setVisibleRangeHint(mFirstPosition, mFirstPosition + getChildCount() - 1);
         return selectedView;
     }
 
@@ -2116,5 +2120,16 @@
         }
         return result;
     }
-}
 
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(GridView.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(GridView.class.getName());
+    }
+}
diff --git a/core/java/android/widget/HorizontalScrollView.java b/core/java/android/widget/HorizontalScrollView.java
index 1683d20..0b4ebf4 100644
--- a/core/java/android/widget/HorizontalScrollView.java
+++ b/core/java/android/widget/HorizontalScrollView.java
@@ -721,12 +721,14 @@
     @Override
     public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
         super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(HorizontalScrollView.class.getName());
         info.setScrollable(getScrollRange() > 0);
     }
 
     @Override
     public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
         super.onInitializeAccessibilityEvent(event);
+        event.setClassName(HorizontalScrollView.class.getName());
         event.setScrollable(getScrollRange() > 0);
         event.setScrollX(mScrollX);
         event.setScrollY(mScrollY);
diff --git a/core/java/android/widget/ImageButton.java b/core/java/android/widget/ImageButton.java
index d680fad..59a8f28 100644
--- a/core/java/android/widget/ImageButton.java
+++ b/core/java/android/widget/ImageButton.java
@@ -21,6 +21,8 @@
 import android.os.Message;
 import android.util.AttributeSet;
 import android.view.MotionEvent;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.widget.RemoteViews.RemoteView;
 
 import java.util.Map;
@@ -90,4 +92,16 @@
     protected boolean onSetAlpha(int alpha) {
         return false;
     }
+
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(ImageButton.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(ImageButton.class.getName());
+    }
 }
diff --git a/core/java/android/widget/ImageSwitcher.java b/core/java/android/widget/ImageSwitcher.java
index bcb750a..c048970 100644
--- a/core/java/android/widget/ImageSwitcher.java
+++ b/core/java/android/widget/ImageSwitcher.java
@@ -16,12 +16,12 @@
 
 package android.widget;
 
-import java.util.Map;
-
 import android.content.Context;
 import android.graphics.drawable.Drawable;
 import android.net.Uri;
 import android.util.AttributeSet;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 
 public class ImageSwitcher extends ViewSwitcher
@@ -55,5 +55,16 @@
         image.setImageDrawable(drawable);
         showNext();
     }
-}
 
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(ImageSwitcher.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(ImageSwitcher.class.getName());
+    }
+}
diff --git a/core/java/android/widget/ImageView.java b/core/java/android/widget/ImageView.java
index 73e1273..07ae93b 100644
--- a/core/java/android/widget/ImageView.java
+++ b/core/java/android/widget/ImageView.java
@@ -37,6 +37,7 @@
 import android.view.View;
 import android.view.ViewDebug;
 import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.widget.RemoteViews.RemoteView;
 
 /**
@@ -1060,4 +1061,16 @@
             mDrawable.setVisible(false, false);
         }
     }
+
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(ImageView.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(ImageView.class.getName());
+    }
 }
diff --git a/core/java/android/widget/LinearLayout.java b/core/java/android/widget/LinearLayout.java
index 427fd3e..b5deec7 100644
--- a/core/java/android/widget/LinearLayout.java
+++ b/core/java/android/widget/LinearLayout.java
@@ -27,6 +27,8 @@
 import android.view.View;
 import android.view.ViewDebug;
 import android.view.ViewGroup;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.widget.RemoteViews.RemoteView;
 
 
@@ -1729,7 +1731,19 @@
     protected boolean checkLayoutParams(ViewGroup.LayoutParams p) {
         return p instanceof LinearLayout.LayoutParams;
     }
-    
+
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(LinearLayout.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(LinearLayout.class.getName());
+    }
+
     /**
      * Per-child layout information associated with ViewLinearLayout.
      * 
diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java
index 7f7a3a7..67fd059 100644
--- a/core/java/android/widget/ListView.java
+++ b/core/java/android/widget/ListView.java
@@ -32,13 +32,13 @@
 import android.util.SparseBooleanArray;
 import android.view.FocusFinder;
 import android.view.KeyEvent;
-import android.view.MotionEvent;
 import android.view.SoundEffectConstants;
 import android.view.View;
 import android.view.ViewDebug;
 import android.view.ViewGroup;
 import android.view.ViewParent;
 import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.widget.RemoteViews.RemoteView;
 
 import java.util.ArrayList;
@@ -678,6 +678,7 @@
             pos++;
         }
 
+        setVisibleRangeHint(mFirstPosition, mFirstPosition + getChildCount() - 1);
         return selectedView;
     }
 
@@ -711,7 +712,7 @@
         }
 
         mFirstPosition = pos + 1;
-
+        setVisibleRangeHint(mFirstPosition, mFirstPosition + getChildCount() - 1);
         return selectedView;
     }
 
@@ -1650,6 +1651,7 @@
                 // are focusable
                 if (mItemsCanFocus && hasFocus() && !sel.hasFocus()) {
                     final boolean focusWasTaken = (sel == focusLayoutRestoreDirectChild &&
+                            focusLayoutRestoreView != null &&
                             focusLayoutRestoreView.requestFocus()) || sel.requestFocus();
                     if (!focusWasTaken) {
                         // selected item didn't take focus, fine, but still want
@@ -3609,4 +3611,16 @@
         }
         return new long[0];
     }
+
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(ListView.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(ListView.class.getName());
+    }
 }
diff --git a/core/java/android/widget/MediaController.java b/core/java/android/widget/MediaController.java
index f2ea3fc..fc35f05 100644
--- a/core/java/android/widget/MediaController.java
+++ b/core/java/android/widget/MediaController.java
@@ -31,6 +31,8 @@
 import android.view.ViewGroup;
 import android.view.Window;
 import android.view.WindowManager;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.widget.SeekBar.OnSeekBarChangeListener;
 
 import com.android.internal.policy.PolicyManager;
@@ -592,6 +594,18 @@
         super.setEnabled(enabled);
     }
 
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(MediaController.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(MediaController.class.getName());
+    }
+
     private View.OnClickListener mRewListener = new View.OnClickListener() {
         public void onClick(View v) {
             int pos = mPlayer.getCurrentPosition();
diff --git a/core/java/android/widget/MultiAutoCompleteTextView.java b/core/java/android/widget/MultiAutoCompleteTextView.java
index 134e4c4..0b30c84 100644
--- a/core/java/android/widget/MultiAutoCompleteTextView.java
+++ b/core/java/android/widget/MultiAutoCompleteTextView.java
@@ -23,7 +23,8 @@
 import android.text.TextUtils;
 import android.text.method.QwertyKeyListener;
 import android.util.AttributeSet;
-import android.widget.MultiAutoCompleteTextView.Tokenizer;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 /**
  * An editable text view, extending {@link AutoCompleteTextView}, that
@@ -196,6 +197,18 @@
         editable.replace(start, end, mTokenizer.terminateToken(text));
     }
 
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(MultiAutoCompleteTextView.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(MultiAutoCompleteTextView.class.getName());
+    }
+
     public static interface Tokenizer {
         /**
          * Returns the start of the token that ends at offset
diff --git a/core/java/android/widget/NumberPicker.java b/core/java/android/widget/NumberPicker.java
index 7d0f98e..84e86af 100644
--- a/core/java/android/widget/NumberPicker.java
+++ b/core/java/android/widget/NumberPicker.java
@@ -47,6 +47,7 @@
 import android.view.ViewConfiguration;
 import android.view.accessibility.AccessibilityEvent;
 import android.view.accessibility.AccessibilityManager;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.view.animation.DecelerateInterpolator;
 import android.view.inputmethod.InputMethodManager;
 
@@ -54,14 +55,14 @@
 
 /**
  * A widget that enables the user to select a number form a predefined range.
- * The widget presents an input filed and up and down buttons for selecting the
- * current value. Pressing/long pressing the up and down buttons increments and
- * decrements the current value respectively. Touching the input filed shows a
- * scroll wheel, tapping on which while shown and not moving allows direct edit
- * of the current value. Sliding motions up or down hide the buttons and the
- * input filed, show the scroll wheel, and rotate the latter. Flinging is
+ * The widget presents an input field and up and down buttons for selecting the
+ * current value. Pressing/long-pressing the up and down buttons increments and
+ * decrements the current value respectively. Touching the input field shows a
+ * scroll wheel, which when touched allows direct edit
+ * of the current value. Sliding gestures up or down hide the buttons and the
+ * input filed, show and rotate the scroll wheel. Flinging is
  * also supported. The widget enables mapping from positions to strings such
- * that instead the position index the corresponding string is displayed.
+ * that, instead of the position index, the corresponding string is displayed.
  * <p>
  * For an example of using this widget, see {@link android.widget.TimePicker}.
  * </p>
@@ -70,6 +71,11 @@
 public class NumberPicker extends LinearLayout {
 
     /**
+     * The number of items show in the selector wheel.
+     */
+    public static final int SELECTOR_WHEEL_ITEM_COUNT = 5;
+
+    /**
      * The default update interval during long press.
      */
     private static final long DEFAULT_LONG_PRESS_UPDATE_INTERVAL = 300;
@@ -1136,14 +1142,17 @@
      * items shown on the selector wheel) the selector wheel wrapping is
      * enabled.
      * </p>
-     *
+     * <p>
+     * <strong>Note:</strong> If the number of items, i.e. the range
+     * ({@link #getMaxValue()} - {@link #getMinValue()}) is less than
+     * {@link #SELECTOR_WHEEL_ITEM_COUNT}, the selector wheel will not
+     * wrap. Hence, in such a case calling this method is a NOP.
+     * </p>
      * @param wrapSelectorWheel Whether to wrap.
      */
     public void setWrapSelectorWheel(boolean wrapSelectorWheel) {
-        if (wrapSelectorWheel && (mMaxValue - mMinValue) < mSelectorIndices.length) {
-            throw new IllegalStateException("Range less than selector items count.");
-        }
-        if (wrapSelectorWheel != mWrapSelectorWheel) {
+        final boolean wrappingAllowed = (mMaxValue - mMinValue) >= mSelectorIndices.length;
+        if ((!wrapSelectorWheel || wrappingAllowed) && wrapSelectorWheel != mWrapSelectorWheel) {
             mWrapSelectorWheel = wrapSelectorWheel;
             updateIncrementAndDecrementButtonsVisibilityState();
         }
@@ -1382,6 +1391,18 @@
         // perceive this widget as several controls rather as a whole.
     }
 
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(NumberPicker.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(NumberPicker.class.getName());
+    }
+
     /**
      * Makes a measure spec that tries greedily to use the max value.
      *
diff --git a/core/java/android/widget/ProgressBar.java b/core/java/android/widget/ProgressBar.java
index df88fec..ace3f60 100644
--- a/core/java/android/widget/ProgressBar.java
+++ b/core/java/android/widget/ProgressBar.java
@@ -45,6 +45,7 @@
 import android.view.ViewDebug;
 import android.view.accessibility.AccessibilityEvent;
 import android.view.accessibility.AccessibilityManager;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.view.animation.AlphaAnimation;
 import android.view.animation.Animation;
 import android.view.animation.AnimationUtils;
@@ -1124,10 +1125,17 @@
     @Override
     public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
         super.onInitializeAccessibilityEvent(event);
+        event.setClassName(ProgressBar.class.getName());
         event.setItemCount(mMax);
         event.setCurrentItemIndex(mProgress);
     }
 
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(ProgressBar.class.getName());
+    }
+
     /**
      * Schedule a command for sending an accessibility event.
      * </br>
diff --git a/core/java/android/widget/QuickContactBadge.java b/core/java/android/widget/QuickContactBadge.java
index adc0fb0..786afe2 100644
--- a/core/java/android/widget/QuickContactBadge.java
+++ b/core/java/android/widget/QuickContactBadge.java
@@ -36,6 +36,8 @@
 import android.util.AttributeSet;
 import android.view.View;
 import android.view.View.OnClickListener;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 /**
  * Widget used to show an image with the standard QuickContact badge
@@ -228,6 +230,18 @@
         }
     }
 
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(QuickContactBadge.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(QuickContactBadge.class.getName());
+    }
+
     /**
      * Set a list of specific MIME-types to exclude and not display. For
      * example, this can be used to hide the {@link Contacts#CONTENT_ITEM_TYPE}
diff --git a/core/java/android/widget/RadioButton.java b/core/java/android/widget/RadioButton.java
index 9fa649f..b6dac3e 100644
--- a/core/java/android/widget/RadioButton.java
+++ b/core/java/android/widget/RadioButton.java
@@ -19,6 +19,7 @@
 import android.content.Context;
 import android.util.AttributeSet;
 import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 import com.android.internal.R;
 
@@ -85,4 +86,16 @@
             event.getText().add(mContext.getString(R.string.radiobutton_not_selected));
         }
     }
+
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(RadioButton.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(RadioButton.class.getName());
+    }
 }
diff --git a/core/java/android/widget/RadioGroup.java b/core/java/android/widget/RadioGroup.java
index 393346a..7f53ffd 100644
--- a/core/java/android/widget/RadioGroup.java
+++ b/core/java/android/widget/RadioGroup.java
@@ -23,6 +23,8 @@
 import android.util.AttributeSet;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 
 /**
@@ -236,6 +238,18 @@
         return new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
     }
 
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(RadioGroup.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(RadioGroup.class.getName());
+    }
+
     /**
      * <p>This set of layout parameters defaults the width and the height of
      * the children to {@link #WRAP_CONTENT} when they are not specified in the
diff --git a/core/java/android/widget/RatingBar.java b/core/java/android/widget/RatingBar.java
index 9e6ff4b..e69577b 100644
--- a/core/java/android/widget/RatingBar.java
+++ b/core/java/android/widget/RatingBar.java
@@ -21,6 +21,8 @@
 import android.graphics.drawable.shapes.RectShape;
 import android.graphics.drawable.shapes.Shape;
 import android.util.AttributeSet;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 import com.android.internal.R;
 
@@ -324,4 +326,15 @@
         super.setMax(max);
     }
     
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(RatingBar.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(RatingBar.class.getName());
+    }
 }
diff --git a/core/java/android/widget/RelativeLayout.java b/core/java/android/widget/RelativeLayout.java
index a452fec..e4b8f34 100644
--- a/core/java/android/widget/RelativeLayout.java
+++ b/core/java/android/widget/RelativeLayout.java
@@ -40,6 +40,7 @@
 import android.view.ViewDebug;
 import android.view.ViewGroup;
 import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.widget.RemoteViews.RemoteView;
 
 import static android.util.Log.d;
@@ -985,6 +986,18 @@
         return false;
     }
 
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(RelativeLayout.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(RelativeLayout.class.getName());
+    }
+
     /**
      * Compares two views in left-to-right and top-to-bottom fashion.
      */
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java
index 1592061..62afd61 100644
--- a/core/java/android/widget/RemoteViews.java
+++ b/core/java/android/widget/RemoteViews.java
@@ -427,13 +427,22 @@
 
         public SetOnClickPendingIntent(Parcel parcel) {
             viewId = parcel.readInt();
-            pendingIntent = PendingIntent.readPendingIntentOrNullFromParcel(parcel);
+
+            // We check a flag to determine if the parcel contains a PendingIntent.
+            if (parcel.readInt() != 0) {
+                pendingIntent = PendingIntent.readPendingIntentOrNullFromParcel(parcel);
+            }
         }
 
         public void writeToParcel(Parcel dest, int flags) {
             dest.writeInt(TAG);
             dest.writeInt(viewId);
-            pendingIntent.writeToParcel(dest, 0 /* no flags */);
+
+            // We use a flag to indicate whether the parcel contains a valid object.
+            dest.writeInt(pendingIntent != null ? 1 : 0);
+            if (pendingIntent != null) {
+                pendingIntent.writeToParcel(dest, 0 /* no flags */);
+            }
         }
 
         @Override
@@ -445,35 +454,39 @@
             // sense, do they mean to set a PendingIntent template for the AdapterView's children?
             if (mIsWidgetCollectionChild) {
                 Log.e("RemoteViews", "Cannot setOnClickPendingIntent for collection item " +
-				"(id: " + viewId + ")");
+                        "(id: " + viewId + ")");
                 // TODO: return; We'll let this slide until apps are up to date.
             }
 
-            if (target != null && pendingIntent != null) {
-                OnClickListener listener = new OnClickListener() {
-                    public void onClick(View v) {
-                        // Find target view location in screen coordinates and
-                        // fill into PendingIntent before sending.
-                        final float appScale = v.getContext().getResources()
-                                .getCompatibilityInfo().applicationScale;
-                        final int[] pos = new int[2];
-                        v.getLocationOnScreen(pos);
-
-                        final Rect rect = new Rect();
-                        rect.left = (int) (pos[0] * appScale + 0.5f);
-                        rect.top = (int) (pos[1] * appScale + 0.5f);
-                        rect.right = (int) ((pos[0] + v.getWidth()) * appScale + 0.5f);
-                        rect.bottom = (int) ((pos[1] + v.getHeight()) * appScale + 0.5f);
-
-                        final Intent intent = new Intent();
-                        intent.setSourceBounds(rect);
-                        startIntentSafely(v.getContext(), pendingIntent, intent);
-                    }
-                };
+            if (target != null) {
+                // If the pendingIntent is null, we clear the onClickListener
+                OnClickListener listener = null;
+                if (pendingIntent != null) {
+                    listener = new OnClickListener() {
+                        public void onClick(View v) {
+                            // Find target view location in screen coordinates and
+                            // fill into PendingIntent before sending.
+                            final float appScale = v.getContext().getResources()
+                                    .getCompatibilityInfo().applicationScale;
+                            final int[] pos = new int[2];
+                            v.getLocationOnScreen(pos);
+    
+                            final Rect rect = new Rect();
+                            rect.left = (int) (pos[0] * appScale + 0.5f);
+                            rect.top = (int) (pos[1] * appScale + 0.5f);
+                            rect.right = (int) ((pos[0] + v.getWidth()) * appScale + 0.5f);
+                            rect.bottom = (int) ((pos[1] + v.getHeight()) * appScale + 0.5f);
+    
+                            final Intent intent = new Intent();
+                            intent.setSourceBounds(rect);
+                            startIntentSafely(v.getContext(), pendingIntent, intent);
+                        }
+                    };
+                }
                 target.setOnClickListener(listener);
             }
         }
-        
+
         int viewId;
         PendingIntent pendingIntent;
 
@@ -667,6 +680,9 @@
                 Log.d("RemoteViews", "read viewId=0x" + Integer.toHexString(this.viewId)
                         + " methodName=" + this.methodName + " type=" + this.type);
             }
+
+            // For some values that may have been null, we first check a flag to see if they were
+            // written to the parcel.
             switch (this.type) {
                 case BOOLEAN:
                     this.value = in.readInt() != 0;
@@ -699,16 +715,22 @@
                     this.value = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
                     break;
                 case URI:
-                    this.value = Uri.CREATOR.createFromParcel(in);
+                    if (in.readInt() != 0) {
+                        this.value = Uri.CREATOR.createFromParcel(in);
+                    }
                     break;
                 case BITMAP:
-                    this.value = Bitmap.CREATOR.createFromParcel(in);
+                    if (in.readInt() != 0) {
+                        this.value = Bitmap.CREATOR.createFromParcel(in);
+                    }
                     break;
                 case BUNDLE:
                     this.value = in.readBundle();
                     break;
                 case INTENT:
-                    this.value = Intent.CREATOR.createFromParcel(in);
+                    if (in.readInt() != 0) {
+                        this.value = Intent.CREATOR.createFromParcel(in);
+                    }
                     break;
                 default:
                     break;
@@ -725,6 +747,9 @@
                 Log.d("RemoteViews", "write viewId=0x" + Integer.toHexString(this.viewId)
                         + " methodName=" + this.methodName + " type=" + this.type);
             }
+
+            // For some values which are null, we record an integer flag to indicate whether
+            // we have written a valid value to the parcel.
             switch (this.type) {
                 case BOOLEAN:
                     out.writeInt((Boolean) this.value ? 1 : 0);
@@ -757,16 +782,25 @@
                     TextUtils.writeToParcel((CharSequence)this.value, out, flags);   
                     break;
                 case URI:
-                    ((Uri)this.value).writeToParcel(out, flags);
+                    out.writeInt(this.value != null ? 1 : 0);
+                    if (this.value != null) {
+                        ((Uri)this.value).writeToParcel(out, flags);
+                    }
                     break;
                 case BITMAP:
-                    ((Bitmap)this.value).writeToParcel(out, flags);
+                    out.writeInt(this.value != null ? 1 : 0);
+                    if (this.value != null) {
+                        ((Bitmap)this.value).writeToParcel(out, flags);
+                    }
                     break;
                 case BUNDLE:
                     out.writeBundle((Bundle) this.value);
                     break;
                 case INTENT:
-                    ((Intent)this.value).writeToParcel(out, flags);
+                    out.writeInt(this.value != null ? 1 : 0);
+                    if (this.value != null) {
+                        ((Intent)this.value).writeToParcel(out, flags);
+                    }
                     break;
                 default:
                     break;
diff --git a/core/java/android/widget/RemoteViewsAdapter.java b/core/java/android/widget/RemoteViewsAdapter.java
index 7b43032..586fdf4 100644
--- a/core/java/android/widget/RemoteViewsAdapter.java
+++ b/core/java/android/widget/RemoteViewsAdapter.java
@@ -68,6 +68,8 @@
     private RemoteViewsAdapterServiceConnection mServiceConnection;
     private WeakReference<RemoteAdapterConnectionCallback> mCallback;
     private FixedSizeRemoteViewsCache mCache;
+    private int mVisibleWindowLowerBound;
+    private int mVisibleWindowUpperBound;
 
     // A flag to determine whether we should notify data set changed after we connect
     private boolean mNotifyDataSetChangedAfterOnServiceConnected = false;
@@ -765,7 +767,7 @@
                     }
                     if (position > -1) {
                         // Load the item, and notify any existing RemoteViewsFrameLayouts
-                        updateRemoteViews(position, isRequested);
+                        updateRemoteViews(position, isRequested, true);
 
                         // Queue up for the next one to load
                         loadNextIndexInBackground();
@@ -827,8 +829,8 @@
         }
     }
 
-    private void updateRemoteViews(final int position, boolean isRequested) {
-        if (!mServiceConnection.isConnected()) return;
+    private void updateRemoteViews(final int position, boolean isRequested, boolean
+            notifyWhenLoaded) {
         IRemoteViewsFactory factory = mServiceConnection.getRemoteViewsFactory();
 
         // Load the item information from the remote service
@@ -864,12 +866,14 @@
             // there is new data for it.
             final RemoteViews rv = remoteViews;
             final int typeId = mCache.getMetaDataAt(position).typeId;
-            mMainQueue.post(new Runnable() {
-                @Override
-                public void run() {
-                    mRequestedViews.notifyOnRemoteViewsLoaded(position, rv, typeId);
-                }
-            });
+            if (notifyWhenLoaded) {
+                mMainQueue.post(new Runnable() {
+                    @Override
+                    public void run() {
+                        mRequestedViews.notifyOnRemoteViewsLoaded(position, rv, typeId);
+                    }
+                });
+            }
         }
     }
 
@@ -929,6 +933,16 @@
         return typeId;
     }
 
+    /**
+     * This method allows an AdapterView using this Adapter to provide information about which
+     * views are currently being displayed. This allows for certain optimizations and preloading
+     * which  wouldn't otherwise be possible.
+     */
+    public void setVisibleRangeHint(int lowerBound, int upperBound) {
+        mVisibleWindowLowerBound = lowerBound;
+        mVisibleWindowUpperBound = upperBound;
+    }
+
     public View getView(int position, View convertView, ViewGroup parent) {
         // "Request" an index so that we can queue it for loading, initiate subsequent
         // preloading, etc.
@@ -1059,6 +1073,13 @@
         // Re-request the new metadata (only after the notification to the factory)
         updateTemporaryMetaData();
 
+        // Pre-load (our best guess of) the views which are currently visible in the AdapterView.
+        // This mitigates flashing and flickering of loading views when a widget notifies that
+        // its data has changed.
+        for (int i = mVisibleWindowLowerBound; i <= mVisibleWindowUpperBound; i++) {
+            updateRemoteViews(i, false, false);
+        }
+
         // Propagate the notification back to the base adapter
         mMainQueue.post(new Runnable() {
             @Override
diff --git a/core/java/android/widget/ScrollView.java b/core/java/android/widget/ScrollView.java
index 767eaee..3ffc0fe 100644
--- a/core/java/android/widget/ScrollView.java
+++ b/core/java/android/widget/ScrollView.java
@@ -721,12 +721,14 @@
     @Override
     public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
         super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(ScrollView.class.getName());
         info.setScrollable(getScrollRange() > 0);
     }
 
     @Override
     public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
         super.onInitializeAccessibilityEvent(event);
+        event.setClassName(ScrollView.class.getName());
         final boolean scrollable = getScrollRange() > 0;
         event.setScrollable(scrollable);
         event.setScrollX(mScrollX);
diff --git a/core/java/android/widget/SearchView.java b/core/java/android/widget/SearchView.java
index 9d2ff2e..99cd0b8 100644
--- a/core/java/android/widget/SearchView.java
+++ b/core/java/android/widget/SearchView.java
@@ -35,7 +35,6 @@
 import android.graphics.drawable.Drawable;
 import android.net.Uri;
 import android.os.Bundle;
-import android.os.Handler;
 import android.speech.RecognizerIntent;
 import android.text.Editable;
 import android.text.InputType;
@@ -51,6 +50,8 @@
 import android.view.KeyEvent;
 import android.view.LayoutInflater;
 import android.view.View;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.view.inputmethod.EditorInfo;
 import android.view.inputmethod.InputMethodManager;
 import android.widget.AdapterView.OnItemClickListener;
@@ -1206,6 +1207,18 @@
         setIconified(false);
     }
 
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(SearchView.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(SearchView.class.getName());
+    }
+
     private void adjustDropDownSizeAndPosition() {
         if (mDropDownAnchor.getWidth() > 1) {
             Resources res = getContext().getResources();
diff --git a/core/java/android/widget/SeekBar.java b/core/java/android/widget/SeekBar.java
index c76728f..2737f94 100644
--- a/core/java/android/widget/SeekBar.java
+++ b/core/java/android/widget/SeekBar.java
@@ -18,6 +18,8 @@
 
 import android.content.Context;
 import android.util.AttributeSet;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 
 
@@ -117,5 +119,16 @@
             mOnSeekBarChangeListener.onStopTrackingTouch(this);
         }
     }
-    
+
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(SeekBar.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(SeekBar.class.getName());
+    }
 }
diff --git a/core/java/android/widget/ShareActionProvider.java b/core/java/android/widget/ShareActionProvider.java
index bb27b73..22e9ef1 100644
--- a/core/java/android/widget/ShareActionProvider.java
+++ b/core/java/android/widget/ShareActionProvider.java
@@ -279,6 +279,7 @@
             final int itemId = item.getItemId();
             Intent launchIntent = dataModel.chooseActivity(itemId);
             if (launchIntent != null) {
+                launchIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
                 mContext.startActivity(launchIntent);
             }
             return true;
diff --git a/core/java/android/widget/SlidingDrawer.java b/core/java/android/widget/SlidingDrawer.java
index bdeb5c2..14edd10 100644
--- a/core/java/android/widget/SlidingDrawer.java
+++ b/core/java/android/widget/SlidingDrawer.java
@@ -32,6 +32,7 @@
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 /**
  * SlidingDrawer hides content out of the screen and allows the user to drag a handle
@@ -810,6 +811,18 @@
         }
     }
 
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(SlidingDrawer.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(SlidingDrawer.class.getName());
+    }
+
     private void closeDrawer() {
         moveHandle(COLLAPSED_FULL_CLOSED);
         mContent.setVisibility(View.GONE);
diff --git a/core/java/android/widget/SpellChecker.java b/core/java/android/widget/SpellChecker.java
index a106159..570f0f9 100644
--- a/core/java/android/widget/SpellChecker.java
+++ b/core/java/android/widget/SpellChecker.java
@@ -102,7 +102,8 @@
 
         mTextServicesManager = (TextServicesManager) mTextView.getContext().
                 getSystemService(Context.TEXT_SERVICES_MANAGER_SERVICE);
-        if (!mTextServicesManager.isSpellCheckerEnabled()) {
+        if (!mTextServicesManager.isSpellCheckerEnabled()
+                ||  mTextServicesManager.getCurrentSpellCheckerSubtype(true) == null) {
             mSpellCheckerSession = null;
         } else {
             mSpellCheckerSession = mTextServicesManager.newSpellCheckerSession(
@@ -341,56 +342,15 @@
         final int end = editable.getSpanEnd(spellCheckSpan);
         if (start < 0 || end <= start) return; // span was removed in the meantime
 
-        // Other suggestion spans may exist on that region, with identical suggestions, filter
-        // them out to avoid duplicates.
-        SuggestionSpan[] suggestionSpans = editable.getSpans(start, end, SuggestionSpan.class);
-        final int length = suggestionSpans.length;
-        for (int i = 0; i < length; i++) {
-            final int spanStart = editable.getSpanStart(suggestionSpans[i]);
-            final int spanEnd = editable.getSpanEnd(suggestionSpans[i]);
-            if (spanStart != start || spanEnd != end) {
-                // Nulled (to avoid new array allocation) if not on that exact same region
-                suggestionSpans[i] = null;
-            }
-        }
-
         final int suggestionsCount = suggestionsInfo.getSuggestionsCount();
-        String[] suggestions;
         if (suggestionsCount <= 0) {
             // A negative suggestion count is possible
-            suggestions = ArrayUtils.emptyArray(String.class);
-        } else {
-            int numberOfSuggestions = 0;
-            suggestions = new String[suggestionsCount];
+            return;
+        }
 
-            for (int i = 0; i < suggestionsCount; i++) {
-                final String spellSuggestion = suggestionsInfo.getSuggestionAt(i);
-                if (spellSuggestion == null) break;
-                boolean suggestionFound = false;
-
-                for (int j = 0; j < length && !suggestionFound; j++) {
-                    if (suggestionSpans[j] == null) break;
-
-                    String[] suggests = suggestionSpans[j].getSuggestions();
-                    for (int k = 0; k < suggests.length; k++) {
-                        if (spellSuggestion.equals(suggests[k])) {
-                            // The suggestion is already provided by an other SuggestionSpan
-                            suggestionFound = true;
-                            break;
-                        }
-                    }
-                }
-
-                if (!suggestionFound) {
-                    suggestions[numberOfSuggestions++] = spellSuggestion;
-                }
-            }
-
-            if (numberOfSuggestions != suggestionsCount) {
-                String[] newSuggestions = new String[numberOfSuggestions];
-                System.arraycopy(suggestions, 0, newSuggestions, 0, numberOfSuggestions);
-                suggestions = newSuggestions;
-            }
+        String[] suggestions = new String[suggestionsCount];
+        for (int i = 0; i < suggestionsCount; i++) {
+            suggestions[i] = suggestionsInfo.getSuggestionAt(i);
         }
 
         SuggestionSpan suggestionSpan = new SuggestionSpan(mTextView.getContext(), suggestions,
diff --git a/core/java/android/widget/Spinner.java b/core/java/android/widget/Spinner.java
index ec3790e..ecf19b3 100644
--- a/core/java/android/widget/Spinner.java
+++ b/core/java/android/widget/Spinner.java
@@ -29,6 +29,8 @@
 import android.view.Gravity;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 
 /**
@@ -456,12 +458,24 @@
 
         return handled;
     }
-    
+
     public void onClick(DialogInterface dialog, int which) {
         setSelection(which);
         dialog.dismiss();
     }
 
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(Spinner.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(Spinner.class.getName());
+    }
+
     /**
      * Sets the prompt to display when the dialog is shown.
      * @param prompt the prompt to set
diff --git a/core/java/android/widget/StackView.java b/core/java/android/widget/StackView.java
index 03e6e99..22df3bc 100644
--- a/core/java/android/widget/StackView.java
+++ b/core/java/android/widget/StackView.java
@@ -40,6 +40,8 @@
 import android.view.View;
 import android.view.ViewConfiguration;
 import android.view.ViewGroup;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.view.animation.LinearInterpolator;
 import android.widget.RemoteViews.RemoteView;
 
@@ -1216,6 +1218,18 @@
         measureChildren();
     }
 
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(StackView.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(StackView.class.getName());
+    }
+
     class LayoutParams extends ViewGroup.LayoutParams {
         int horizontalOffset;
         int verticalOffset;
diff --git a/core/java/android/widget/Switch.java b/core/java/android/widget/Switch.java
index 02c9d03..334b9c4 100644
--- a/core/java/android/widget/Switch.java
+++ b/core/java/android/widget/Switch.java
@@ -35,6 +35,7 @@
 import android.view.VelocityTracker;
 import android.view.ViewConfiguration;
 import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 import com.android.internal.R;
 
@@ -651,4 +652,16 @@
         mThumbDrawable.jumpToCurrentState();
         mTrackDrawable.jumpToCurrentState();
     }
+
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(Switch.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(Switch.class.getName());
+    }
 }
diff --git a/core/java/android/widget/TabHost.java b/core/java/android/widget/TabHost.java
index 88d7230..9b292be 100644
--- a/core/java/android/widget/TabHost.java
+++ b/core/java/android/widget/TabHost.java
@@ -33,6 +33,8 @@
 import android.view.ViewGroup;
 import android.view.ViewTreeObserver;
 import android.view.Window;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -321,6 +323,18 @@
         }
     }
 
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(TabHost.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(TabHost.class.getName());
+    }
+
     public void setCurrentTab(int index) {
         if (index < 0 || index >= mTabSpecs.size()) {
             return;
diff --git a/core/java/android/widget/TabWidget.java b/core/java/android/widget/TabWidget.java
index 80bfe99..8901037 100644
--- a/core/java/android/widget/TabWidget.java
+++ b/core/java/android/widget/TabWidget.java
@@ -29,6 +29,7 @@
 import android.view.View.OnFocusChangeListener;
 import android.view.ViewGroup;
 import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 /**
  *
@@ -416,10 +417,28 @@
     @Override
     public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
         super.onInitializeAccessibilityEvent(event);
+        event.setClassName(TabWidget.class.getName());
         event.setItemCount(getTabCount());
         event.setCurrentItemIndex(mSelectedTab);
     }
 
+
+    @Override
+    public void sendAccessibilityEventUnchecked(AccessibilityEvent event) {
+        // this class fires events only when tabs are focused or selected
+        if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_FOCUSED && isFocused()) {
+            event.recycle();
+            return;
+        }
+        super.sendAccessibilityEventUnchecked(event);
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(TabWidget.class.getName());
+    }
+
     /**
      * Sets the current tab and focuses the UI on it.
      * This method makes sure that the focused tab matches the selected
@@ -485,16 +504,6 @@
         mSelectedTab = -1;
     }
 
-    @Override
-    public void sendAccessibilityEventUnchecked(AccessibilityEvent event) {
-        // this class fires events only when tabs are focused or selected
-        if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_FOCUSED && isFocused()) {
-            event.recycle();
-            return;
-        }
-        super.sendAccessibilityEventUnchecked(event);
-    }
-
     /**
      * Provides a way for {@link TabHost} to be notified that the user clicked on a tab indicator.
      */
diff --git a/core/java/android/widget/TableLayout.java b/core/java/android/widget/TableLayout.java
index 842b087..f5d3746 100644
--- a/core/java/android/widget/TableLayout.java
+++ b/core/java/android/widget/TableLayout.java
@@ -24,6 +24,8 @@
 import android.util.SparseBooleanArray;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 import java.util.regex.Pattern;
 
@@ -658,6 +660,18 @@
         return new LayoutParams(p);
     }
 
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(TableLayout.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(TableLayout.class.getName());
+    }
+
     /**
      * <p>This set of layout parameters enforces the width of each child to be
      * {@link #MATCH_PARENT} and the height of each child to be
diff --git a/core/java/android/widget/TableRow.java b/core/java/android/widget/TableRow.java
index 3fd4631..01c4c2c 100644
--- a/core/java/android/widget/TableRow.java
+++ b/core/java/android/widget/TableRow.java
@@ -24,6 +24,8 @@
 import android.view.View;
 import android.view.ViewDebug;
 import android.view.ViewGroup;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 
 /**
@@ -377,6 +379,18 @@
         return new LayoutParams(p);
     }
 
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(TableRow.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(TableRow.class.getName());
+    }
+
     /**
      * <p>Set of layout parameters used in table rows.</p>
      *
diff --git a/core/java/android/widget/TextSwitcher.java b/core/java/android/widget/TextSwitcher.java
index a8794a3..1aefd2b 100644
--- a/core/java/android/widget/TextSwitcher.java
+++ b/core/java/android/widget/TextSwitcher.java
@@ -21,6 +21,8 @@
 import android.util.AttributeSet;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 /**
  * Specialized {@link android.widget.ViewSwitcher} that contains
@@ -88,4 +90,16 @@
     public void setCurrentText(CharSequence text) {
         ((TextView)getCurrentView()).setText(text);
     }
+
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(TextSwitcher.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(TextSwitcher.class.getName());
+    }
 }
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 3dd7a9f..971d910 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -84,6 +84,7 @@
 import android.text.method.TransformationMethod;
 import android.text.method.TransformationMethod2;
 import android.text.method.WordIterator;
+import android.text.style.CharacterStyle;
 import android.text.style.ClickableSpan;
 import android.text.style.EasyEditSpan;
 import android.text.style.ParagraphStyle;
@@ -101,9 +102,11 @@
 import android.util.TypedValue;
 import android.view.ActionMode;
 import android.view.ActionMode.Callback;
+import android.view.DisplayList;
 import android.view.DragEvent;
 import android.view.Gravity;
 import android.view.HapticFeedbackConstants;
+import android.view.HardwareCanvas;
 import android.view.KeyCharacterMap;
 import android.view.KeyEvent;
 import android.view.LayoutInflater;
@@ -253,10 +256,7 @@
 
     private float mShadowRadius, mShadowDx, mShadowDy;
 
-    private static final int PREDRAW_NOT_REGISTERED = 0;
-    private static final int PREDRAW_PENDING = 1;
-    private static final int PREDRAW_DONE = 2;
-    private int mPreDrawState = PREDRAW_NOT_REGISTERED;
+    private boolean mPreDrawRegistered;
 
     private TextUtils.TruncateAt mEllipsize = null;
 
@@ -283,6 +283,9 @@
     }
     private Drawables mDrawables;
 
+    private DisplayList mTextDisplayList;
+    private boolean mTextDisplayListIsValid;
+
     private CharSequence mError;
     private boolean mErrorWasChanged;
     private ErrorPopup mPopup;
@@ -336,6 +339,7 @@
     private int mTextEditSuggestionItemLayout;
     private SuggestionsPopupWindow mSuggestionsPopupWindow;
     private SuggestionRangeSpan mSuggestionRangeSpan;
+    private Runnable mShowSuggestionRunnable;
 
     private int mCursorDrawableRes;
     private final Drawable[] mCursorDrawable = new Drawable[2];
@@ -351,7 +355,6 @@
     private float mLastDownPositionX, mLastDownPositionY;
     private Callback mCustomSelectionActionModeCallback;
 
-    private final int mSquaredTouchSlopDistance;
     // Set when this TextView gained focus with some text selected. Will start selection mode.
     private boolean mCreatedWithASelection = false;
 
@@ -359,8 +362,6 @@
 
     private SpellChecker mSpellChecker;
 
-    private boolean mSoftInputShownOnFocus = true;
-
     // The alignment to pass to Layout, or null if not resolved.
     private Layout.Alignment mLayoutAlignment;
 
@@ -437,15 +438,12 @@
         this(context, null);
     }
 
-    public TextView(Context context,
-                    AttributeSet attrs) {
+    public TextView(Context context, AttributeSet attrs) {
         this(context, attrs, com.android.internal.R.attr.textViewStyle);
     }
 
     @SuppressWarnings("deprecation")
-    public TextView(Context context,
-                    AttributeSet attrs,
-                    int defStyle) {
+    public TextView(Context context, AttributeSet attrs, int defStyle) {
         super(context, attrs, defStyle);
         mText = "";
 
@@ -1128,10 +1126,6 @@
         setLongClickable(longClickable);
 
         prepareCursorControllers();
-
-        final ViewConfiguration viewConfiguration = ViewConfiguration.get(context);
-        final int touchSlop = viewConfiguration.getScaledTouchSlop();
-        mSquaredTouchSlopDistance = touchSlop * touchSlop;
     }
 
     private void setTypefaceByIndex(int typefaceIndex, int styleIndex) {
@@ -2385,29 +2379,6 @@
     }
 
     /**
-     * Sets whether the soft input method will be made visible when this
-     * TextView gets focused. The default is true.
-     *
-     * @attr ref android.R.styleable#TextView_softInputShownOnFocus
-     * @hide
-     */
-    @android.view.RemotableViewMethod
-    public final void setSoftInputShownOnFocus(boolean show) {
-        mSoftInputShownOnFocus = show;
-    }
-
-    /**
-     * Returns whether the soft input method will be made visible when this
-     * TextView gets focused. The default is true.
-     *
-     * @attr ref android.R.styleable#TextView_softInputShownOnFocus
-     * @hide
-     */
-    public final boolean getSoftInputShownOnFocus() {
-        return mSoftInputShownOnFocus;
-    }
-
-    /**
      * Returns the list of URLSpans attached to the text
      * (by {@link Linkify} or otherwise) if any.  You can call
      * {@link URLSpan#getURL} on them to find where they link to
@@ -3196,8 +3167,7 @@
 
         int n = mFilters.length;
         for (int i = 0; i < n; i++) {
-            CharSequence out = mFilters[i].filter(text, 0, text.length(),
-                                                  EMPTY_SPANNED, 0, 0);
+            CharSequence out = mFilters[i].filter(text, 0, text.length(), EMPTY_SPANNED, 0, 0);
             if (out != null) {
                 text = out;
             }
@@ -4389,26 +4359,16 @@
     }
 
     private void registerForPreDraw() {
-        final ViewTreeObserver observer = getViewTreeObserver();
-
-        if (mPreDrawState == PREDRAW_NOT_REGISTERED) {
-            observer.addOnPreDrawListener(this);
-            mPreDrawState = PREDRAW_PENDING;
-        } else if (mPreDrawState == PREDRAW_DONE) {
-            mPreDrawState = PREDRAW_PENDING;
+        if (!mPreDrawRegistered) {
+            getViewTreeObserver().addOnPreDrawListener(this);
+            mPreDrawRegistered = true;
         }
-
-        // else state is PREDRAW_PENDING, so keep waiting.
     }
 
     /**
      * {@inheritDoc}
      */
     public boolean onPreDraw() {
-        if (mPreDrawState != PREDRAW_PENDING) {
-            return true;
-        }
-
         if (mLayout == null) {
             assumeLayout();
         }
@@ -4459,7 +4419,9 @@
             startSelectionActionMode();
         }
 
-        mPreDrawState = PREDRAW_DONE;
+        getViewTreeObserver().removeOnPreDrawListener(this);
+        mPreDrawRegistered = false;
+
         return !changed;
     }
 
@@ -4494,10 +4456,9 @@
     protected void onDetachedFromWindow() {
         super.onDetachedFromWindow();
 
-        final ViewTreeObserver observer = getViewTreeObserver();
-        if (mPreDrawState != PREDRAW_NOT_REGISTERED) {
-            observer.removeOnPreDrawListener(this);
-            mPreDrawState = PREDRAW_NOT_REGISTERED;
+        if (mPreDrawRegistered) {
+            getViewTreeObserver().removeOnPreDrawListener(this);
+            mPreDrawRegistered = false;
         }
 
         if (mError != null) {
@@ -4516,10 +4477,18 @@
             mSelectionModifierCursorController.onDetached();
         }
 
+        if (mShowSuggestionRunnable != null) {
+            removeCallbacks(mShowSuggestionRunnable);
+        }
+
         hideControllers();
 
         resetResolvedDrawables();
 
+        if (mTextDisplayList != null) {
+            mTextDisplayList.invalidate();
+        }
+
         if (mSpellChecker != null) {
             mSpellChecker.closeSession();
             // Forces the creation of a new SpellChecker next time this window is created.
@@ -4762,12 +4731,6 @@
 
     @Override
     protected void onDraw(Canvas canvas) {
-        if (mPreDrawState == PREDRAW_DONE) {
-            final ViewTreeObserver observer = getViewTreeObserver();
-            observer.removeOnPreDrawListener(this);
-            mPreDrawState = PREDRAW_NOT_REGISTERED;
-        }
-
         if (mCurrentAlpha <= ViewConfiguration.ALPHA_THRESHOLD_INT) return;
 
         restartMarqueeIfNeeded();
@@ -4871,10 +4834,14 @@
         int extendedPaddingTop = getExtendedPaddingTop();
         int extendedPaddingBottom = getExtendedPaddingBottom();
 
+        final int vspace = mBottom - mTop - compoundPaddingBottom - compoundPaddingTop;
+        final int maxScrollY = mLayout.getHeight() - vspace;
+
         float clipLeft = compoundPaddingLeft + scrollX;
-        float clipTop = extendedPaddingTop + scrollY;
+        float clipTop = (scrollY == 0) ? 0 : extendedPaddingTop + scrollY;
         float clipRight = right - left - compoundPaddingRight + scrollX;
-        float clipBottom = bottom - top - extendedPaddingBottom + scrollY;
+        float clipBottom = bottom - top + scrollY -
+                ((scrollY == maxScrollY) ? 0 : extendedPaddingBottom);
 
         if (mShadowRadius != 0) {
             clipLeft += Math.min(0, mShadowDx - mShadowRadius);
@@ -4970,17 +4937,6 @@
             }
         }
 
-        /*  Comment out until we decide what to do about animations
-        boolean isLinearTextOn = false;
-        if (currentTransformation != null) {
-            isLinearTextOn = mTextPaint.isLinearTextOn();
-            Matrix m = currentTransformation.getMatrix();
-            if (!m.isIdentity()) {
-                // mTextPaint.setLinearTextOn(true);
-            }
-        }
-        */
-
         final InputMethodState ims = mInputMethodState;
         final int cursorOffsetVertical = voffsetCursor - voffsetText;
         if (ims != null && ims.mBatchEditNesting == 0) {
@@ -5038,19 +4994,39 @@
             highlight = null;
         }
 
-        layout.draw(canvas, highlight, mHighlightPaint, cursorOffsetVertical);
+        if (canHaveDisplayList() && canvas.isHardwareAccelerated()) {
+            final int width = mRight - mLeft;
+            final int height = mBottom - mTop;
+
+            if (mTextDisplayList == null || !mTextDisplayList.isValid() ||
+                    !mTextDisplayListIsValid) {
+                if (mTextDisplayList == null) {
+                    mTextDisplayList = getHardwareRenderer().createDisplayList("Text");
+                }
+
+                final HardwareCanvas hardwareCanvas = mTextDisplayList.start();
+                try {
+                    hardwareCanvas.setViewport(width, height);
+                    // The dirty rect should always be null for a display list
+                    hardwareCanvas.onPreDraw(null);
+                    layout.draw(hardwareCanvas, highlight, mHighlightPaint, cursorOffsetVertical);
+                } finally {
+                    hardwareCanvas.onPostDraw();
+                    mTextDisplayList.end();
+                    mTextDisplayListIsValid = true;
+                }
+            }
+            ((HardwareCanvas) canvas).drawDisplayList(mTextDisplayList,
+                    mScrollX + width, mScrollY + height, null);
+        } else {
+            layout.draw(canvas, highlight, mHighlightPaint, cursorOffsetVertical);
+        }
 
         if (mMarquee != null && mMarquee.shouldDrawGhost()) {
             canvas.translate((int) mMarquee.getGhostOffset(), 0.0f);
             layout.draw(canvas, highlight, mHighlightPaint, cursorOffsetVertical);
         }
 
-        /*  Comment out until we decide what to do about animations
-        if (currentTransformation != null) {
-            mTextPaint.setLinearTextOn(isLinearTextOn);
-        }
-        */
-
         canvas.restore();
     }
 
@@ -5254,10 +5230,8 @@
                         state.handleUpEvent(event);
                     }
                     if (event.isTracking() && !event.isCanceled()) {
-                        if (isInSelectionMode) {
-                            stopSelectionActionMode();
-                            return true;
-                        }
+                        stopSelectionActionMode();
+                        return true;
                     }
                 }
             }
@@ -5526,7 +5500,7 @@
                                 && mLayout != null && onCheckIsTextEditor()) {
                             InputMethodManager imm = InputMethodManager.peekInstance();
                             viewClicked(imm);
-                            if (imm != null && mSoftInputShownOnFocus) {
+                            if (imm != null) {
                                 imm.showSoftInput(this, 0);
                             }
                         }
@@ -5602,11 +5576,13 @@
         return super.onKeyUp(keyCode, event);
     }
 
-    @Override public boolean onCheckIsTextEditor() {
+    @Override
+    public boolean onCheckIsTextEditor() {
         return mInputType != EditorInfo.TYPE_NULL;
     }
 
-    @Override public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
+    @Override
+    public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
         if (onCheckIsTextEditor() && isEnabled()) {
             if (mInputMethodState == null) {
                 mInputMethodState = new InputMethodState();
@@ -6780,6 +6756,12 @@
         }
     }
 
+    @Override
+    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
+        super.onLayout(changed, left, top, right, bottom);
+        if (changed) mTextDisplayListIsValid = false;
+    }
+
     /**
      * Returns true if anything changed.
      */
@@ -7562,6 +7544,7 @@
      */
     protected void onSelectionChanged(int selStart, int selEnd) {
         sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_TEXT_SELECTION_CHANGED);
+        mTextDisplayListIsValid = false;
     }
 
     /**
@@ -7641,6 +7624,7 @@
         }
 
         updateSpellCheckSpans(start, start + after, false);
+        mTextDisplayListIsValid = false;
 
         // Hide the controllers as soon as text is modified (typing, procedural...)
         // We do not hide the span controllers, since they can be added when a new text is
@@ -7743,7 +7727,8 @@
             }
         }
 
-        if (what instanceof UpdateAppearance || what instanceof ParagraphStyle) {
+        if (what instanceof UpdateAppearance || what instanceof ParagraphStyle ||
+                what instanceof CharacterStyle) {
             if (ims == null || ims.mBatchEditNesting == 0) {
                 invalidate();
                 mHighlightPathBogus = true;
@@ -7751,6 +7736,7 @@
             } else {
                 ims.mContentChanged = true;
             }
+            mTextDisplayListIsValid = false;
         }
 
         if (MetaKeyKeyListener.isMetaTracker(buf, what)) {
@@ -8316,6 +8302,10 @@
             getSelectionController().onTouchEvent(event);
         }
 
+        if (mShowSuggestionRunnable != null) {
+            removeCallbacks(mShowSuggestionRunnable);
+        }
+
         if (action == MotionEvent.ACTION_DOWN) {
             mLastDownPositionX = event.getX();
             mLastDownPositionY = event.getY();
@@ -8339,7 +8329,7 @@
         }
 
         final boolean touchIsFinished = (action == MotionEvent.ACTION_UP) &&
-                !shouldIgnoreActionUpEvent() && isFocused();
+                !mIgnoreActionUpEvent && isFocused();
 
          if ((mMovement != null || onCheckIsTextEditor()) && isEnabled()
                 && mText instanceof Spannable && mLayout != null) {
@@ -8356,7 +8346,7 @@
                 ClickableSpan[] links = ((Spannable) mText).getSpans(getSelectionStart(),
                         getSelectionEnd(), ClickableSpan.class);
 
-                if (links.length != 0) {
+                if (links.length > 0) {
                     links[0].onClick(this);
                     handled = true;
                 }
@@ -8366,20 +8356,31 @@
                 // Show the IME, except when selecting in read-only text.
                 final InputMethodManager imm = InputMethodManager.peekInstance();
                 viewClicked(imm);
-                if (!mTextIsSelectable && mSoftInputShownOnFocus) {
+                if (!mTextIsSelectable) {
                     handled |= imm != null && imm.showSoftInput(this, 0);
                 }
 
                 boolean selectAllGotFocus = mSelectAllOnFocus && didTouchFocusSelect();
                 hideControllers();
                 if (!selectAllGotFocus && mText.length() > 0) {
+                    // Move cursor
+                    final int offset = getOffsetForPosition(event.getX(), event.getY());
+                    Selection.setSelection((Spannable) mText, offset);
                     if (mSpellChecker != null) {
                         // When the cursor moves, the word that was typed may need spell check
                         mSpellChecker.onSelectionChanged();
                     }
                     if (!extractedTextModeWillBeStarted()) {
                         if (isCursorInsideEasyCorrectionSpan()) {
-                            showSuggestions();
+                            if (mShowSuggestionRunnable == null) {
+                                mShowSuggestionRunnable = new Runnable() {
+                                    public void run() {
+                                        showSuggestions();
+                                    }
+                                };
+                            }
+                            postDelayed(mShowSuggestionRunnable,
+                                    ViewConfiguration.getDoubleTapTimeout());
                         } else if (hasInsertionController()) {
                             getInsertionController().show();
                         }
@@ -8515,17 +8516,6 @@
         mIgnoreActionUpEvent = true;
     }
 
-    /**
-     * This method is only valid during a touch event.
-     *
-     * @return true when the ACTION_UP event should be ignored, false otherwise.
-     *
-     * @hide
-     */
-    public boolean shouldIgnoreActionUpEvent() {
-        return mIgnoreActionUpEvent;
-    }
-
     @Override
     public boolean onTrackballEvent(MotionEvent event) {
         if (mMovement != null && mText instanceof Spannable &&
@@ -8906,14 +8896,12 @@
             wordIterator.setCharSequence(mText, minOffset, maxOffset);
 
             selectionStart = wordIterator.getBeginning(minOffset);
-            if (selectionStart == BreakIterator.DONE) return false;
-
             selectionEnd = wordIterator.getEnd(maxOffset);
-            if (selectionEnd == BreakIterator.DONE) return false;
 
-            if (selectionStart == selectionEnd) {
+            if (selectionStart == BreakIterator.DONE || selectionEnd == BreakIterator.DONE ||
+                    selectionStart == selectionEnd) {
                 // Possible when the word iterator does not properly handle the text's language
-                long range = getCharRange(selectionStart);
+                long range = getCharRange(minOffset);
                 selectionStart = extractRangeStartFromLong(range);
                 selectionEnd = extractRangeEndFromLong(range);
             }
@@ -9006,6 +8994,7 @@
     public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
         super.onInitializeAccessibilityEvent(event);
 
+        event.setClassName(TextView.class.getName());
         final boolean isPassword = hasPasswordTransformationMethod();
         event.setPassword(isPassword);
 
@@ -9020,11 +9009,13 @@
     public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
         super.onInitializeAccessibilityNodeInfo(info);
 
+        info.setClassName(TextView.class.getName());
         final boolean isPassword = hasPasswordTransformationMethod();
+        info.setPassword(isPassword);
+
         if (!isPassword) {
             info.setText(getTextForAccessibility());
         }
-        info.setPassword(isPassword);
     }
 
     @Override
@@ -9222,7 +9213,6 @@
         boolean vibrate = true;
 
         if (super.performLongClick()) {
-            mDiscardNextActionUp = true;
             handled = true;
         }
 
@@ -9725,11 +9715,12 @@
         public void show() {
             if (!(mText instanceof Editable)) return;
 
-            updateSuggestions();
-            mCursorWasVisibleBeforeSuggestions = mCursorVisible;
-            setCursorVisible(false);
-            mIsShowingUp = true;
-            super.show();
+            if (updateSuggestions()) {
+                mCursorWasVisibleBeforeSuggestions = mCursorVisible;
+                setCursorVisible(false);
+                mIsShowingUp = true;
+                super.show();
+            }
         }
 
         @Override
@@ -9785,11 +9776,13 @@
             super.hide();
         }
 
-        private void updateSuggestions() {
+        private boolean updateSuggestions() {
             Spannable spannable = (Spannable) TextView.this.mText;
             SuggestionSpan[] suggestionSpans = getSuggestionSpans();
 
             final int nbSpans = suggestionSpans.length;
+            // Suggestions are shown after a delay: the underlying spans may have been removed
+            if (nbSpans == 0) return false;
 
             mNumberOfSuggestions = 0;
             int spanUnionStart = mText.length();
@@ -9815,17 +9808,34 @@
                 String[] suggestions = suggestionSpan.getSuggestions();
                 int nbSuggestions = suggestions.length;
                 for (int suggestionIndex = 0; suggestionIndex < nbSuggestions; suggestionIndex++) {
-                    SuggestionInfo suggestionInfo = mSuggestionInfos[mNumberOfSuggestions];
-                    suggestionInfo.suggestionSpan = suggestionSpan;
-                    suggestionInfo.suggestionIndex = suggestionIndex;
-                    suggestionInfo.text.replace(0, suggestionInfo.text.length(),
-                            suggestions[suggestionIndex]);
+                    String suggestion = suggestions[suggestionIndex];
 
-                    mNumberOfSuggestions++;
-                    if (mNumberOfSuggestions == MAX_NUMBER_SUGGESTIONS) {
-                        // Also end outer for loop
-                        spanIndex = nbSpans;
-                        break;
+                    boolean suggestionIsDuplicate = false;
+                    for (int i = 0; i < mNumberOfSuggestions; i++) {
+                        if (mSuggestionInfos[i].text.toString().equals(suggestion)) {
+                            SuggestionSpan otherSuggestionSpan = mSuggestionInfos[i].suggestionSpan;
+                            final int otherSpanStart = spannable.getSpanStart(otherSuggestionSpan);
+                            final int otherSpanEnd = spannable.getSpanEnd(otherSuggestionSpan);
+                            if (spanStart == otherSpanStart && spanEnd == otherSpanEnd) {
+                                suggestionIsDuplicate = true;
+                                break;
+                            }
+                        }
+                    }
+
+                    if (!suggestionIsDuplicate) {
+                        SuggestionInfo suggestionInfo = mSuggestionInfos[mNumberOfSuggestions];
+                        suggestionInfo.suggestionSpan = suggestionSpan;
+                        suggestionInfo.suggestionIndex = suggestionIndex;
+                        suggestionInfo.text.replace(0, suggestionInfo.text.length(), suggestion);
+
+                        mNumberOfSuggestions++;
+
+                        if (mNumberOfSuggestions == MAX_NUMBER_SUGGESTIONS) {
+                            // Also end outer for loop
+                            spanIndex = nbSpans;
+                            break;
+                        }
                     }
                 }
             }
@@ -9834,7 +9844,7 @@
                 highlightTextDifferences(mSuggestionInfos[i], spanUnionStart, spanUnionEnd);
             }
 
-            // Add to dictionary item if there is a span with the misspelled flag
+            // Add "Add to dictionary" item if there is a span with the misspelled flag
             if (misspelledSpan != null) {
                 final int misspelledStart = spannable.getSpanStart(misspelledSpan);
                 final int misspelledEnd = spannable.getSpanEnd(misspelledSpan);
@@ -9875,6 +9885,7 @@
                     Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
 
             mSuggestionsAdapter.notifyDataSetChanged();
+            return true;
         }
 
         private void highlightTextDifferences(SuggestionInfo suggestionInfo, int unionStart,
@@ -9892,8 +9903,9 @@
                     suggestionInfo.text.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
 
             // Add the text before and after the span.
-            suggestionInfo.text.insert(0, mText.toString().substring(unionStart, spanStart));
-            suggestionInfo.text.append(mText.toString().substring(spanEnd, unionEnd));
+            final String textAsString = text.toString();
+            suggestionInfo.text.insert(0, textAsString.substring(unionStart, spanStart));
+            suggestionInfo.text.append(textAsString.substring(spanEnd, unionEnd));
         }
 
         @Override
@@ -10131,15 +10143,15 @@
 
         boolean willExtract = extractedTextModeWillBeStarted();
 
-        // Do not start the action mode when extracted text will show up full screen, thus
-        // immediately hiding the newly created action bar, which would be visually distracting.
+        // Do not start the action mode when extracted text will show up full screen, which would
+        // immediately hide the newly created action bar and would be visually distracting.
         if (!willExtract) {
             ActionMode.Callback actionModeCallback = new SelectionActionModeCallback();
             mSelectionActionMode = startActionMode(actionModeCallback);
         }
 
         final boolean selectionStarted = mSelectionActionMode != null || willExtract;
-        if (selectionStarted && !mTextIsSelectable && mSoftInputShownOnFocus) {
+        if (selectionStarted && !mTextIsSelectable) {
             // Show the IME to be able to replace text, except when selecting non editable text.
             final InputMethodManager imm = InputMethodManager.peekInstance();
             if (imm != null) {
@@ -10158,7 +10170,10 @@
         return false;
     }
 
-    private void stopSelectionActionMode() {
+    /**
+     * @hide
+     */
+    protected void stopSelectionActionMode() {
         if (mSelectionActionMode != null) {
             // This will hide the mSelectionModifierCursorController
             mSelectionActionMode.finish();
@@ -10772,7 +10787,12 @@
                         final float deltaX = mDownPositionX - ev.getRawX();
                         final float deltaY = mDownPositionY - ev.getRawY();
                         final float distanceSquared = deltaX * deltaX + deltaY * deltaY;
-                        if (distanceSquared < mSquaredTouchSlopDistance) {
+
+                        final ViewConfiguration viewConfiguration = ViewConfiguration.get(
+                                TextView.this.getContext());
+                        final int touchSlop = viewConfiguration.getScaledTouchSlop();
+
+                        if (distanceSquared < touchSlop * touchSlop) {
                             if (mActionPopupWindow != null && mActionPopupWindow.isShowing()) {
                                 // Tapping on the handle dismisses the displayed action popup
                                 mActionPopupWindow.hide();
@@ -10986,7 +11006,8 @@
 
         // Double tap detection
         private long mPreviousTapUpTime = 0;
-        private float mPreviousTapPositionX, mPreviousTapPositionY;
+        private float mDownPositionX, mDownPositionY;
+        private boolean mGestureStayedInTapRegion;
 
         SelectionModifierCursorController() {
             resetTouchOffsets();
@@ -11049,20 +11070,28 @@
                     mMinTouchOffset = mMaxTouchOffset = getOffsetForPosition(x, y);
 
                     // Double tap detection
-                    long duration = SystemClock.uptimeMillis() - mPreviousTapUpTime;
-                    if (duration <= ViewConfiguration.getDoubleTapTimeout() &&
-                            isPositionOnText(x, y)) {
-                        final float deltaX = x - mPreviousTapPositionX;
-                        final float deltaY = y - mPreviousTapPositionY;
-                        final float distanceSquared = deltaX * deltaX + deltaY * deltaY;
-                        if (distanceSquared < mSquaredTouchSlopDistance) {
-                            startSelectionActionMode();
-                            mDiscardNextActionUp = true;
+                    if (mGestureStayedInTapRegion) {
+                        long duration = SystemClock.uptimeMillis() - mPreviousTapUpTime;
+                        if (duration <= ViewConfiguration.getDoubleTapTimeout()) {
+                            final float deltaX = x - mDownPositionX;
+                            final float deltaY = y - mDownPositionY;
+                            final float distanceSquared = deltaX * deltaX + deltaY * deltaY;
+
+                            ViewConfiguration viewConfiguration = ViewConfiguration.get(
+                                    TextView.this.getContext());
+                            int doubleTapSlop = viewConfiguration.getScaledDoubleTapSlop();
+                            boolean stayedInArea = distanceSquared < doubleTapSlop * doubleTapSlop;
+
+                            if (stayedInArea && isPositionOnText(x, y)) {
+                                startSelectionActionMode();
+                                mDiscardNextActionUp = true;
+                            }
                         }
                     }
 
-                    mPreviousTapPositionX = x;
-                    mPreviousTapPositionY = y;
+                    mDownPositionX = x;
+                    mDownPositionY = y;
+                    mGestureStayedInTapRegion = true;
                     break;
 
                 case MotionEvent.ACTION_POINTER_DOWN:
@@ -11075,6 +11104,22 @@
                     }
                     break;
 
+                case MotionEvent.ACTION_MOVE:
+                    if (mGestureStayedInTapRegion) {
+                        final float deltaX = event.getX() - mDownPositionX;
+                        final float deltaY = event.getY() - mDownPositionY;
+                        final float distanceSquared = deltaX * deltaX + deltaY * deltaY;
+
+                        final ViewConfiguration viewConfiguration = ViewConfiguration.get(
+                                TextView.this.getContext());
+                        int doubleTapTouchSlop = viewConfiguration.getScaledDoubleTapTouchSlop();
+
+                        if (distanceSquared > doubleTapTouchSlop * doubleTapTouchSlop) {
+                            mGestureStayedInTapRegion = false;
+                        }
+                    }
+                    break;
+
                 case MotionEvent.ACTION_UP:
                     mPreviousTapUpTime = SystemClock.uptimeMillis();
                     break;
diff --git a/core/java/android/widget/TimePicker.java b/core/java/android/widget/TimePicker.java
index afca2db..8f10fff 100644
--- a/core/java/android/widget/TimePicker.java
+++ b/core/java/android/widget/TimePicker.java
@@ -27,6 +27,7 @@
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.view.inputmethod.EditorInfo;
 import android.view.inputmethod.InputMethodManager;
 import android.widget.NumberPicker.OnValueChangeListener;
@@ -476,6 +477,18 @@
         event.getText().add(selectedDateUtterance);
     }
 
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(TimePicker.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(TimePicker.class.getName());
+    }
+
     private void updateHourControl() {
         if (is24HourView()) {
             mHourSpinner.setMinValue(0);
diff --git a/core/java/android/widget/ToggleButton.java b/core/java/android/widget/ToggleButton.java
index a754268..a0edafe 100644
--- a/core/java/android/widget/ToggleButton.java
+++ b/core/java/android/widget/ToggleButton.java
@@ -23,6 +23,7 @@
 import android.graphics.drawable.LayerDrawable;
 import android.util.AttributeSet;
 import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 import com.android.internal.R;
 
@@ -161,4 +162,16 @@
             event.getText().add(mContext.getString(R.string.togglebutton_not_pressed));
         }
     }
+
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(ToggleButton.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(ToggleButton.class.getName());
+    }
 }
diff --git a/core/java/android/widget/TwoLineListItem.java b/core/java/android/widget/TwoLineListItem.java
index eab6f2d..e707ea3 100644
--- a/core/java/android/widget/TwoLineListItem.java
+++ b/core/java/android/widget/TwoLineListItem.java
@@ -16,14 +16,12 @@
 
 package android.widget;
 
-import com.android.internal.R;
-
-
 import android.annotation.Widget;
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.util.AttributeSet;
-import android.view.View;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.widget.RelativeLayout;
 
 /**
@@ -86,4 +84,16 @@
     public TextView getText2() {
         return mText2;
     }
+
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(TwoLineListItem.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(TwoLineListItem.class.getName());
+    }
 }
diff --git a/core/java/android/widget/VideoView.java b/core/java/android/widget/VideoView.java
index 64fdf34..0fba498 100644
--- a/core/java/android/widget/VideoView.java
+++ b/core/java/android/widget/VideoView.java
@@ -34,6 +34,8 @@
 import android.view.SurfaceHolder;
 import android.view.SurfaceView;
 import android.view.View;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.widget.MediaController.MediaPlayerControl;
 
 import java.io.IOException;
@@ -124,6 +126,18 @@
         setMeasuredDimension(width, height);
     }
 
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(VideoView.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(VideoView.class.getName());
+    }
+
     public int resolveAdjustedSize(int desiredSize, int measureSpec) {
         int result = desiredSize;
         int specMode = MeasureSpec.getMode(measureSpec);
diff --git a/core/java/android/widget/ViewAnimator.java b/core/java/android/widget/ViewAnimator.java
index 71ff66b..6a68240 100644
--- a/core/java/android/widget/ViewAnimator.java
+++ b/core/java/android/widget/ViewAnimator.java
@@ -22,6 +22,8 @@
 import android.util.AttributeSet;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.view.animation.Animation;
 import android.view.animation.AnimationUtils;
 
@@ -341,4 +343,16 @@
     public int getBaseline() {
         return (getCurrentView() != null) ? getCurrentView().getBaseline() : super.getBaseline();
     }
+
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(ViewAnimator.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(ViewAnimator.class.getName());
+    }
 }
diff --git a/core/java/android/widget/ViewFlipper.java b/core/java/android/widget/ViewFlipper.java
index c6f6e81..061bb00 100644
--- a/core/java/android/widget/ViewFlipper.java
+++ b/core/java/android/widget/ViewFlipper.java
@@ -25,6 +25,8 @@
 import android.os.Message;
 import android.util.AttributeSet;
 import android.util.Log;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.widget.RemoteViews.RemoteView;
 
 /**
@@ -139,6 +141,18 @@
         updateRunning();
     }
 
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(ViewFlipper.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(ViewFlipper.class.getName());
+    }
+
     /**
      * Internal method to start or stop dispatching flip {@link Message} based
      * on {@link #mRunning} and {@link #mVisible} state.
diff --git a/core/java/android/widget/ViewSwitcher.java b/core/java/android/widget/ViewSwitcher.java
index 71ae624..0376918 100644
--- a/core/java/android/widget/ViewSwitcher.java
+++ b/core/java/android/widget/ViewSwitcher.java
@@ -20,6 +20,8 @@
 import android.util.AttributeSet;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 /**
  * {@link ViewAnimator} that switches between two views, and has a factory
@@ -66,6 +68,18 @@
         super.addView(child, index, params);
     }
 
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(ViewSwitcher.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(ViewSwitcher.class.getName());
+    }
+
     /**
      * Returns the next view to be displayed.
      *
diff --git a/core/java/android/widget/ZoomButton.java b/core/java/android/widget/ZoomButton.java
index eb372ca..af17c94 100644
--- a/core/java/android/widget/ZoomButton.java
+++ b/core/java/android/widget/ZoomButton.java
@@ -23,6 +23,8 @@
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.View.OnLongClickListener;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 public class ZoomButton extends ImageButton implements OnLongClickListener {
 
@@ -96,4 +98,16 @@
         clearFocus();
         return super.dispatchUnhandledMove(focused, direction);
     }
+
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(ZoomButton.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(ZoomButton.class.getName());
+    }
 }
diff --git a/core/java/android/widget/ZoomControls.java b/core/java/android/widget/ZoomControls.java
index a12aee5..8897875 100644
--- a/core/java/android/widget/ZoomControls.java
+++ b/core/java/android/widget/ZoomControls.java
@@ -22,6 +22,8 @@
 import android.view.LayoutInflater;
 import android.view.MotionEvent;
 import android.view.View;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.view.animation.AlphaAnimation;
 
 import com.android.internal.R;
@@ -106,4 +108,16 @@
     public boolean hasFocus() {
         return mZoomIn.hasFocus() || mZoomOut.hasFocus();
     }
+
+    @Override
+    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+        super.onInitializeAccessibilityEvent(event);
+        event.setClassName(ZoomControls.class.getName());
+    }
+
+    @Override
+    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
+        super.onInitializeAccessibilityNodeInfo(info);
+        info.setClassName(ZoomControls.class.getName());
+    }
 }
diff --git a/core/java/com/android/internal/backup/BackupConstants.java b/core/java/com/android/internal/backup/BackupConstants.java
index 906b5d5..4c276b7 100644
--- a/core/java/com/android/internal/backup/BackupConstants.java
+++ b/core/java/com/android/internal/backup/BackupConstants.java
@@ -24,4 +24,5 @@
     public static final int TRANSPORT_ERROR = 1;
     public static final int TRANSPORT_NOT_INITIALIZED = 2;
     public static final int AGENT_ERROR = 3;
+    public static final int AGENT_UNKNOWN = 4;
 }
diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java
index 9c45dc6..6a99a2b 100644
--- a/core/java/com/android/internal/os/ZygoteInit.java
+++ b/core/java/com/android/internal/os/ZygoteInit.java
@@ -243,7 +243,7 @@
     private static void preloadClasses() {
         final VMRuntime runtime = VMRuntime.getRuntime();
 
-        InputStream is = ZygoteInit.class.getClassLoader().getResourceAsStream(
+        InputStream is = ClassLoader.getSystemClassLoader().getResourceAsStream(
                 PRELOADED_CLASSES);
         if (is == null) {
             Log.e(TAG, "Couldn't find " + PRELOADED_CLASSES + ".");
diff --git a/core/java/com/android/internal/util/ArrayUtils.java b/core/java/com/android/internal/util/ArrayUtils.java
index edeb2a8..d1aa1ce 100644
--- a/core/java/com/android/internal/util/ArrayUtils.java
+++ b/core/java/com/android/internal/util/ArrayUtils.java
@@ -142,6 +142,14 @@
         return false;
     }
 
+    public static long total(long[] array) {
+        long total = 0;
+        for (long value : array) {
+            total += value;
+        }
+        return total;
+    }
+
     /**
      * Appends an element to a copy of the array and returns the copy.
      * @param array The original array, or null to represent an empty array.
diff --git a/core/java/com/android/internal/util/FastMath.java b/core/java/com/android/internal/util/FastMath.java
index efd0871..88a17e6 100644
--- a/core/java/com/android/internal/util/FastMath.java
+++ b/core/java/com/android/internal/util/FastMath.java
@@ -26,8 +26,8 @@
      * thought it may return slightly different results. It does not try to
      * handle (in any meaningful way) NaN or infinities.
      */
-    public static int round(float x) {
-        long lx = (long)(x * (65536 * 256f));
-        return (int)((lx + 0x800000) >> 24);
+    public static int round(float value) {
+        long lx = (long) (value * (65536 * 256f));
+        return (int) ((lx + 0x800000) >> 24);
     }
 }
diff --git a/core/java/com/android/internal/util/FileRotator.java b/core/java/com/android/internal/util/FileRotator.java
new file mode 100644
index 0000000..8a8f315
--- /dev/null
+++ b/core/java/com/android/internal/util/FileRotator.java
@@ -0,0 +1,421 @@
+/*
+ * 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.util;
+
+import android.os.FileUtils;
+import android.util.Slog;
+
+import com.android.internal.util.FileRotator.Rewriter;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import libcore.io.IoUtils;
+
+/**
+ * Utility that rotates files over time, similar to {@code logrotate}. There is
+ * a single "active" file, which is periodically rotated into historical files,
+ * and eventually deleted entirely. Files are stored under a specific directory
+ * with a well-known prefix.
+ * <p>
+ * Instead of manipulating files directly, users implement interfaces that
+ * perform operations on {@link InputStream} and {@link OutputStream}. This
+ * enables atomic rewriting of file contents in
+ * {@link #rewriteActive(Rewriter, long)}.
+ * <p>
+ * Users must periodically call {@link #maybeRotate(long)} to perform actual
+ * rotation. Not inherently thread safe.
+ */
+public class FileRotator {
+    private static final String TAG = "FileRotator";
+    private static final boolean LOGD = true;
+
+    private final File mBasePath;
+    private final String mPrefix;
+    private final long mRotateAgeMillis;
+    private final long mDeleteAgeMillis;
+
+    private static final String SUFFIX_BACKUP = ".backup";
+    private static final String SUFFIX_NO_BACKUP = ".no_backup";
+
+    // TODO: provide method to append to active file
+
+    /**
+     * External class that reads data from a given {@link InputStream}. May be
+     * called multiple times when reading rotated data.
+     */
+    public interface Reader {
+        public void read(InputStream in) throws IOException;
+    }
+
+    /**
+     * External class that writes data to a given {@link OutputStream}.
+     */
+    public interface Writer {
+        public void write(OutputStream out) throws IOException;
+    }
+
+    /**
+     * External class that reads existing data from given {@link InputStream},
+     * then writes any modified data to {@link OutputStream}.
+     */
+    public interface Rewriter extends Reader, Writer {
+        public void reset();
+        public boolean shouldWrite();
+    }
+
+    /**
+     * Create a file rotator.
+     *
+     * @param basePath Directory under which all files will be placed.
+     * @param prefix Filename prefix used to identify this rotator.
+     * @param rotateAgeMillis Age in milliseconds beyond which an active file
+     *            may be rotated into a historical file.
+     * @param deleteAgeMillis Age in milliseconds beyond which a rotated file
+     *            may be deleted.
+     */
+    public FileRotator(File basePath, String prefix, long rotateAgeMillis, long deleteAgeMillis) {
+        mBasePath = Preconditions.checkNotNull(basePath);
+        mPrefix = Preconditions.checkNotNull(prefix);
+        mRotateAgeMillis = rotateAgeMillis;
+        mDeleteAgeMillis = deleteAgeMillis;
+
+        // ensure that base path exists
+        mBasePath.mkdirs();
+
+        // recover any backup files
+        for (String name : mBasePath.list()) {
+            if (!name.startsWith(mPrefix)) continue;
+
+            if (name.endsWith(SUFFIX_BACKUP)) {
+                if (LOGD) Slog.d(TAG, "recovering " + name);
+
+                final File backupFile = new File(mBasePath, name);
+                final File file = new File(
+                        mBasePath, name.substring(0, name.length() - SUFFIX_BACKUP.length()));
+
+                // write failed with backup; recover last file
+                backupFile.renameTo(file);
+
+            } else if (name.endsWith(SUFFIX_NO_BACKUP)) {
+                if (LOGD) Slog.d(TAG, "recovering " + name);
+
+                final File noBackupFile = new File(mBasePath, name);
+                final File file = new File(
+                        mBasePath, name.substring(0, name.length() - SUFFIX_NO_BACKUP.length()));
+
+                // write failed without backup; delete both
+                noBackupFile.delete();
+                file.delete();
+            }
+        }
+    }
+
+    /**
+     * Delete all files managed by this rotator.
+     */
+    public void deleteAll() {
+        final FileInfo info = new FileInfo(mPrefix);
+        for (String name : mBasePath.list()) {
+            if (!info.parse(name)) continue;
+
+            // delete each file that matches parser
+            new File(mBasePath, name).delete();
+        }
+    }
+
+    /**
+     * Process currently active file, first reading any existing data, then
+     * writing modified data. Maintains a backup during write, which is restored
+     * if the write fails.
+     */
+    public void rewriteActive(Rewriter rewriter, long currentTimeMillis)
+            throws IOException {
+        final String activeName = getActiveName(currentTimeMillis);
+        rewriteSingle(rewriter, activeName);
+    }
+
+    @Deprecated
+    public void combineActive(final Reader reader, final Writer writer, long currentTimeMillis)
+            throws IOException {
+        rewriteActive(new Rewriter() {
+            /** {@inheritDoc} */
+            public void reset() {
+                // ignored
+            }
+
+            /** {@inheritDoc} */
+            public void read(InputStream in) throws IOException {
+                reader.read(in);
+            }
+
+            /** {@inheritDoc} */
+            public boolean shouldWrite() {
+                return true;
+            }
+
+            /** {@inheritDoc} */
+            public void write(OutputStream out) throws IOException {
+                writer.write(out);
+            }
+        }, currentTimeMillis);
+    }
+
+    /**
+     * Process all files managed by this rotator, usually to rewrite historical
+     * data. Each file is processed atomically.
+     */
+    public void rewriteAll(Rewriter rewriter) throws IOException {
+        final FileInfo info = new FileInfo(mPrefix);
+        for (String name : mBasePath.list()) {
+            if (!info.parse(name)) continue;
+
+            // process each file that matches parser
+            rewriteSingle(rewriter, name);
+        }
+    }
+
+    /**
+     * Process a single file atomically, first reading any existing data, then
+     * writing modified data. Maintains a backup during write, which is restored
+     * if the write fails.
+     */
+    private void rewriteSingle(Rewriter rewriter, String name) throws IOException {
+        if (LOGD) Slog.d(TAG, "rewriting " + name);
+
+        final File file = new File(mBasePath, name);
+        final File backupFile;
+
+        rewriter.reset();
+
+        if (file.exists()) {
+            // read existing data
+            readFile(file, rewriter);
+
+            // skip when rewriter has nothing to write
+            if (!rewriter.shouldWrite()) return;
+
+            // backup existing data during write
+            backupFile = new File(mBasePath, name + SUFFIX_BACKUP);
+            file.renameTo(backupFile);
+
+            try {
+                writeFile(file, rewriter);
+
+                // write success, delete backup
+                backupFile.delete();
+            } catch (IOException e) {
+                // write failed, delete file and restore backup
+                file.delete();
+                backupFile.renameTo(file);
+                throw e;
+            }
+
+        } else {
+            // create empty backup during write
+            backupFile = new File(mBasePath, name + SUFFIX_NO_BACKUP);
+            backupFile.createNewFile();
+
+            try {
+                writeFile(file, rewriter);
+
+                // write success, delete empty backup
+                backupFile.delete();
+            } catch (IOException e) {
+                // write failed, delete file and empty backup
+                file.delete();
+                backupFile.delete();
+                throw e;
+            }
+        }
+    }
+
+    /**
+     * Read any rotated data that overlap the requested time range.
+     */
+    public void readMatching(Reader reader, long matchStartMillis, long matchEndMillis)
+            throws IOException {
+        final FileInfo info = new FileInfo(mPrefix);
+        for (String name : mBasePath.list()) {
+            if (!info.parse(name)) continue;
+
+            // read file when it overlaps
+            if (info.startMillis <= matchEndMillis && matchStartMillis <= info.endMillis) {
+                if (LOGD) Slog.d(TAG, "reading matching " + name);
+
+                final File file = new File(mBasePath, name);
+                readFile(file, reader);
+            }
+        }
+    }
+
+    /**
+     * Return the currently active file, which may not exist yet.
+     */
+    private String getActiveName(long currentTimeMillis) {
+        String oldestActiveName = null;
+        long oldestActiveStart = Long.MAX_VALUE;
+
+        final FileInfo info = new FileInfo(mPrefix);
+        for (String name : mBasePath.list()) {
+            if (!info.parse(name)) continue;
+
+            // pick the oldest active file which covers current time
+            if (info.isActive() && info.startMillis < currentTimeMillis
+                    && info.startMillis < oldestActiveStart) {
+                oldestActiveName = name;
+                oldestActiveStart = info.startMillis;
+            }
+        }
+
+        if (oldestActiveName != null) {
+            return oldestActiveName;
+        } else {
+            // no active file found above; create one starting now
+            info.startMillis = currentTimeMillis;
+            info.endMillis = Long.MAX_VALUE;
+            return info.build();
+        }
+    }
+
+    /**
+     * Examine all files managed by this rotator, renaming or deleting if their
+     * age matches the configured thresholds.
+     */
+    public void maybeRotate(long currentTimeMillis) {
+        final long rotateBefore = currentTimeMillis - mRotateAgeMillis;
+        final long deleteBefore = currentTimeMillis - mDeleteAgeMillis;
+
+        final FileInfo info = new FileInfo(mPrefix);
+        for (String name : mBasePath.list()) {
+            if (!info.parse(name)) continue;
+
+            if (info.isActive()) {
+                if (info.startMillis <= rotateBefore) {
+                    // found active file; rotate if old enough
+                    if (LOGD) Slog.d(TAG, "rotating " + name);
+
+                    info.endMillis = currentTimeMillis;
+
+                    final File file = new File(mBasePath, name);
+                    final File destFile = new File(mBasePath, info.build());
+                    file.renameTo(destFile);
+                }
+            } else if (info.endMillis <= deleteBefore) {
+                // found rotated file; delete if old enough
+                if (LOGD) Slog.d(TAG, "deleting " + name);
+
+                final File file = new File(mBasePath, name);
+                file.delete();
+            }
+        }
+    }
+
+    private static void readFile(File file, Reader reader) throws IOException {
+        final FileInputStream fis = new FileInputStream(file);
+        final BufferedInputStream bis = new BufferedInputStream(fis);
+        try {
+            reader.read(bis);
+        } finally {
+            IoUtils.closeQuietly(bis);
+        }
+    }
+
+    private static void writeFile(File file, Writer writer) throws IOException {
+        final FileOutputStream fos = new FileOutputStream(file);
+        final BufferedOutputStream bos = new BufferedOutputStream(fos);
+        try {
+            writer.write(bos);
+            bos.flush();
+        } finally {
+            FileUtils.sync(fos);
+            IoUtils.closeQuietly(bos);
+        }
+    }
+
+    /**
+     * Details for a rotated file, either parsed from an existing filename, or
+     * ready to be built into a new filename.
+     */
+    private static class FileInfo {
+        public final String prefix;
+
+        public long startMillis;
+        public long endMillis;
+
+        public FileInfo(String prefix) {
+            this.prefix = Preconditions.checkNotNull(prefix);
+        }
+
+        /**
+         * Attempt parsing the given filename.
+         *
+         * @return Whether parsing was successful.
+         */
+        public boolean parse(String name) {
+            startMillis = endMillis = -1;
+
+            final int dotIndex = name.lastIndexOf('.');
+            final int dashIndex = name.lastIndexOf('-');
+
+            // skip when missing time section
+            if (dotIndex == -1 || dashIndex == -1) return false;
+
+            // skip when prefix doesn't match
+            if (!prefix.equals(name.substring(0, dotIndex))) return false;
+
+            try {
+                startMillis = Long.parseLong(name.substring(dotIndex + 1, dashIndex));
+
+                if (name.length() - dashIndex == 1) {
+                    endMillis = Long.MAX_VALUE;
+                } else {
+                    endMillis = Long.parseLong(name.substring(dashIndex + 1));
+                }
+
+                return true;
+            } catch (NumberFormatException e) {
+                return false;
+            }
+        }
+
+        /**
+         * Build current state into filename.
+         */
+        public String build() {
+            final StringBuilder name = new StringBuilder();
+            name.append(prefix).append('.').append(startMillis).append('-');
+            if (endMillis != Long.MAX_VALUE) {
+                name.append(endMillis);
+            }
+            return name.toString();
+        }
+
+        /**
+         * Test if current file is active (no end timestamp).
+         */
+        public boolean isActive() {
+            return endMillis == Long.MAX_VALUE;
+        }
+    }
+}
diff --git a/core/java/com/android/internal/util/IndentingPrintWriter.java b/core/java/com/android/internal/util/IndentingPrintWriter.java
new file mode 100644
index 0000000..3dd2284
--- /dev/null
+++ b/core/java/com/android/internal/util/IndentingPrintWriter.java
@@ -0,0 +1,63 @@
+/*
+ * 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.util;
+
+import java.io.PrintWriter;
+import java.io.Writer;
+
+/**
+ * Lightweight wrapper around {@link PrintWriter} that automatically indents
+ * newlines based on internal state. Delays writing indent until first actual
+ * write on a newline, enabling indent modification after newline.
+ */
+public class IndentingPrintWriter extends PrintWriter {
+    private final String mIndent;
+
+    private StringBuilder mBuilder = new StringBuilder();
+    private String mCurrent = new String();
+    private boolean mEmptyLine = true;
+
+    public IndentingPrintWriter(Writer writer, String indent) {
+        super(writer);
+        mIndent = indent;
+    }
+
+    public void increaseIndent() {
+        mBuilder.append(mIndent);
+        mCurrent = mBuilder.toString();
+    }
+
+    public void decreaseIndent() {
+        mBuilder.delete(0, mIndent.length());
+        mCurrent = mBuilder.toString();
+    }
+
+    @Override
+    public void println() {
+        super.println();
+        mEmptyLine = true;
+    }
+
+    @Override
+    public void write(char[] buf, int offset, int count) {
+        if (mEmptyLine) {
+            mEmptyLine = false;
+            super.print(mCurrent);
+        }
+        super.write(buf, offset, count);
+    }
+}
diff --git a/core/java/com/android/internal/view/InputConnectionWrapper.java b/core/java/com/android/internal/view/InputConnectionWrapper.java
index a235d9a..9024d8d 100644
--- a/core/java/com/android/internal/view/InputConnectionWrapper.java
+++ b/core/java/com/android/internal/view/InputConnectionWrapper.java
@@ -387,9 +387,9 @@
         }
     }
     
-    public boolean deleteSurroundingText(int leftLength, int rightLength) {
+    public boolean deleteSurroundingText(int beforeLength, int afterLength) {
         try {
-            mIInputContext.deleteSurroundingText(leftLength, rightLength);
+            mIInputContext.deleteSurroundingText(beforeLength, afterLength);
             return true;
         } catch (RemoteException e) {
             return false;
diff --git a/core/java/com/android/internal/widget/ActionBarView.java b/core/java/com/android/internal/widget/ActionBarView.java
index b689f53..517ce4e 100644
--- a/core/java/com/android/internal/widget/ActionBarView.java
+++ b/core/java/com/android/internal/widget/ActionBarView.java
@@ -300,6 +300,7 @@
         mProgressView = new ProgressBar(mContext, null, 0, mProgressStyle);
         mProgressView.setId(R.id.progress_horizontal);
         mProgressView.setMax(10000);
+        mProgressView.setVisibility(GONE);
         addView(mProgressView);
     }
 
@@ -307,6 +308,7 @@
         mIndeterminateProgressView = new ProgressBar(mContext, null, 0,
                 mIndeterminateProgressStyle);
         mIndeterminateProgressView.setId(R.id.progress_circular);
+        mIndeterminateProgressView.setVisibility(GONE);
         addView(mIndeterminateProgressView);
     }
 
diff --git a/core/java/com/android/internal/widget/DigitalClock.java b/core/java/com/android/internal/widget/DigitalClock.java
index daefc9a..af3fd42 100644
--- a/core/java/com/android/internal/widget/DigitalClock.java
+++ b/core/java/com/android/internal/widget/DigitalClock.java
@@ -228,7 +228,7 @@
         updateTime();
     }
 
-    private void updateTime() {
+    public void updateTime() {
         mCalendar.setTimeInMillis(System.currentTimeMillis());
 
         CharSequence newTime = DateFormat.format(mFormat, mCalendar);
diff --git a/core/java/com/android/internal/widget/EditableInputConnection.java b/core/java/com/android/internal/widget/EditableInputConnection.java
index 32e733b..9579bce 100644
--- a/core/java/com/android/internal/widget/EditableInputConnection.java
+++ b/core/java/com/android/internal/widget/EditableInputConnection.java
@@ -35,6 +35,11 @@
 
     private final TextView mTextView;
 
+    // Keeps track of nested begin/end batch edit to ensure this connection always has a
+    // balanced impact on its associated TextView.
+    // A negative value means that this connection has been finished by the InputMethodManager.
+    private int mBatchEditNesting;
+
     public EditableInputConnection(TextView textview) {
         super(textview, true);
         mTextView = textview;
@@ -48,19 +53,35 @@
         }
         return null;
     }
-    
+
     @Override
     public boolean beginBatchEdit() {
-        mTextView.beginBatchEdit();
-        return true;
+        synchronized(this) {
+            if (mBatchEditNesting >= 0) {
+                mTextView.beginBatchEdit();
+                mBatchEditNesting++;
+                return true;
+            }
+        }
+        return false;
     }
-    
+
     @Override
     public boolean endBatchEdit() {
-        mTextView.endBatchEdit();
-        return true;
+        synchronized(this) {
+            if (mBatchEditNesting > 0) {
+                // When the connection is reset by the InputMethodManager and finishComposingText
+                // is called, some endBatchEdit calls may still be asynchronously received from the
+                // IME. Do not take these into account, thus ensuring that this IC's final
+                // contribution to mTextView's nested batch edit count is zero.
+                mTextView.endBatchEdit();
+                mBatchEditNesting--;
+                return true;
+            }
+        }
+        return false;
     }
-    
+
     @Override
     public boolean clearMetaKeyStates(int states) {
         final Editable content = getEditable();
@@ -76,7 +97,24 @@
         }
         return true;
     }
-    
+
+    @Override
+    public boolean finishComposingText() {
+        final boolean superResult = super.finishComposingText();
+        synchronized(this) {
+            if (mBatchEditNesting < 0) {
+                // The connection was already finished
+                return false;
+            }
+            while (mBatchEditNesting > 0) {
+                endBatchEdit();
+            }
+            // Will prevent any further calls to begin or endBatchEdit
+            mBatchEditNesting = -1;
+        }
+        return superResult;
+    }
+
     @Override
     public boolean commitCompletion(CompletionInfo text) {
         if (DEBUG) Log.v(TAG, "commitCompletion " + text);
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java
index adb0ac9..6893ffb 100644
--- a/core/java/com/android/internal/widget/LockPatternUtils.java
+++ b/core/java/com/android/internal/widget/LockPatternUtils.java
@@ -117,6 +117,8 @@
             = "lockscreen.biometric_weak_fallback";
     public final static String BIOMETRIC_WEAK_EVER_CHOSEN_KEY
             = "lockscreen.biometricweakeverchosen";
+    public final static String LOCKSCREEN_POWER_BUTTON_INSTANTLY_LOCKS
+            = "lockscreen.power_button_instantly_locks";
 
     private final static String PASSWORD_HISTORY_KEY = "lockscreen.passwordhistory";
 
@@ -335,7 +337,7 @@
      * @return True if the user has ever chosen a pattern.
      */
     public boolean isPatternEverChosen() {
-        return getBoolean(PATTERN_EVER_CHOSEN_KEY);
+        return getBoolean(PATTERN_EVER_CHOSEN_KEY, false);
     }
 
     /**
@@ -345,7 +347,7 @@
      * @return True if the user has ever chosen biometric weak.
      */
     public boolean isBiometricWeakEverChosen() {
-        return getBoolean(BIOMETRIC_WEAK_EVER_CHOSEN_KEY);
+        return getBoolean(BIOMETRIC_WEAK_EVER_CHOSEN_KEY, false);
     }
 
     /**
@@ -402,7 +404,7 @@
         saveLockPassword(null, DevicePolicyManager.PASSWORD_QUALITY_SOMETHING);
         setLockPatternEnabled(false);
         saveLockPattern(null);
-        setLong(PASSWORD_TYPE_KEY, DevicePolicyManager.PASSWORD_QUALITY_SOMETHING);
+        setLong(PASSWORD_TYPE_KEY, DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED);
         setLong(PASSWORD_TYPE_ALTERNATE_KEY, DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED);
     }
 
@@ -845,7 +847,7 @@
                 getLong(PASSWORD_TYPE_ALTERNATE_KEY, DevicePolicyManager.PASSWORD_QUALITY_SOMETHING)
                 == DevicePolicyManager.PASSWORD_QUALITY_SOMETHING;
 
-        return getBoolean(Settings.Secure.LOCK_PATTERN_ENABLED)
+        return getBoolean(Settings.Secure.LOCK_PATTERN_ENABLED, false)
                 && (getLong(PASSWORD_TYPE_KEY, DevicePolicyManager.PASSWORD_QUALITY_SOMETHING)
                         == DevicePolicyManager.PASSWORD_QUALITY_SOMETHING ||
                         (usingBiometricWeak() && backupEnabled));
@@ -891,7 +893,7 @@
      * @return Whether the visible pattern is enabled.
      */
     public boolean isVisiblePatternEnabled() {
-        return getBoolean(Settings.Secure.LOCK_PATTERN_VISIBLE);
+        return getBoolean(Settings.Secure.LOCK_PATTERN_VISIBLE, false);
     }
 
     /**
@@ -905,7 +907,7 @@
      * @return Whether tactile feedback for the pattern is enabled.
      */
     public boolean isTactileFeedbackEnabled() {
-        return getBoolean(Settings.Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
+        return getBoolean(Settings.Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED, false);
     }
 
     /**
@@ -946,7 +948,7 @@
      *   attempts.
      */
     public boolean isPermanentlyLocked() {
-        return getBoolean(LOCKOUT_PERMANENT_KEY);
+        return getBoolean(LOCKOUT_PERMANENT_KEY, false);
     }
 
     /**
@@ -989,9 +991,10 @@
         return nextAlarm;
     }
 
-    private boolean getBoolean(String secureSettingKey) {
+    private boolean getBoolean(String secureSettingKey, boolean defaultValue) {
         return 1 ==
-                android.provider.Settings.Secure.getInt(mContentResolver, secureSettingKey, 0);
+                android.provider.Settings.Secure.getInt(mContentResolver, secureSettingKey,
+                        defaultValue ? 1 : 0);
     }
 
     private void setBoolean(String secureSettingKey, boolean enabled) {
@@ -1092,4 +1095,12 @@
         mContext.startActivity(intent);
     }
 
+    public void setPowerButtonInstantlyLocks(boolean enabled) {
+        setBoolean(LOCKSCREEN_POWER_BUTTON_INSTANTLY_LOCKS, enabled);
+    }
+
+    public boolean getPowerButtonInstantlyLocks() {
+        return getBoolean(LOCKSCREEN_POWER_BUTTON_INSTANTLY_LOCKS, true);
+    }
+
 }
diff --git a/core/java/com/android/internal/widget/multiwaveview/MultiWaveView.java b/core/java/com/android/internal/widget/multiwaveview/MultiWaveView.java
index ebd355a..d51ced11 100644
--- a/core/java/com/android/internal/widget/multiwaveview/MultiWaveView.java
+++ b/core/java/com/android/internal/widget/multiwaveview/MultiWaveView.java
@@ -653,6 +653,7 @@
 
             case MotionEvent.ACTION_CANCEL:
                 handleMove(event);
+                handleCancel(event);
                 handled = true;
                 break;
         }
@@ -678,6 +679,12 @@
         if (DEBUG && mDragging) Log.v(TAG, "** Handle RELEASE");
         switchToState(STATE_FINISH, event.getX(), event.getY());
     }
+    
+    private void handleCancel(MotionEvent event) {
+        if (DEBUG && mDragging) Log.v(TAG, "** Handle CANCEL");
+        mActiveTarget = -1; // Drop the active target if canceled.
+        switchToState(STATE_FINISH, event.getX(), event.getY());
+    }
 
     private void handleMove(MotionEvent event) {
         if (!mDragging) {
diff --git a/core/java/com/google/android/mms/pdu/PduPersister.java b/core/java/com/google/android/mms/pdu/PduPersister.java
index c4be513..8d57e5d 100644
--- a/core/java/com/google/android/mms/pdu/PduPersister.java
+++ b/core/java/com/google/android/mms/pdu/PduPersister.java
@@ -510,13 +510,26 @@
      * @throws MmsException Failed to load some fields of a PDU.
      */
     public GenericPdu load(Uri uri) throws MmsException {
-        PduCacheEntry cacheEntry = PDU_CACHE_INSTANCE.get(uri);
-        if (cacheEntry != null) {
-            return cacheEntry.getPdu();
+        PduCacheEntry cacheEntry;
+        synchronized(PDU_CACHE_INSTANCE) {
+            if (PDU_CACHE_INSTANCE.isUpdating(uri)) {
+                try {
+                    PDU_CACHE_INSTANCE.wait();
+                } catch (InterruptedException e) {
+                    Log.e(TAG, "load: ", e);
+                }
+                cacheEntry = PDU_CACHE_INSTANCE.get(uri);
+                if (cacheEntry != null) {
+                    return cacheEntry.getPdu();
+                }
+            }
+            // Tell the cache to indicate to other callers that this item
+            // is currently being updated.
+            PDU_CACHE_INSTANCE.setUpdating(uri, true);
         }
 
         Cursor c = SqliteWrapper.query(mContext, mContentResolver, uri,
-                        PDU_PROJECTION, null, null, null);
+                                                PDU_PROJECTION, null, null, null);
         PduHeaders headers = new PduHeaders();
         Set<Entry<Integer, Integer>> set;
         long msgId = ContentUris.parseId(uri);
@@ -634,9 +647,14 @@
                         "Unrecognized PDU type: " + Integer.toHexString(msgType));
         }
 
-        cacheEntry = new PduCacheEntry(pdu, msgBox, threadId);
-        PDU_CACHE_INSTANCE.put(uri, cacheEntry);
-        return pdu;
+        synchronized(PDU_CACHE_INSTANCE ) {
+            assert(PDU_CACHE_INSTANCE.get(uri) == null);
+            // Update the cache entry with the real info
+            cacheEntry = new PduCacheEntry(pdu, msgBox, threadId);
+            PDU_CACHE_INSTANCE.put(uri, cacheEntry);
+            PDU_CACHE_INSTANCE.notifyAll();     // tell anybody waiting on this entry to go ahead
+            return pdu;
+        }
     }
 
     private void persistAddress(
@@ -818,6 +836,17 @@
      * @throws MmsException Bad URI or updating failed.
      */
     public void updateHeaders(Uri uri, SendReq sendReq) {
+        synchronized(PDU_CACHE_INSTANCE) {
+            // If the cache item is getting updated, wait until it's done updating before
+            // purging it.
+            if (PDU_CACHE_INSTANCE.isUpdating(uri)) {
+                try {
+                    PDU_CACHE_INSTANCE.wait();
+                } catch (InterruptedException e) {
+                    Log.e(TAG, "updateHeaders: ", e);
+                }
+            }
+        }
         PDU_CACHE_INSTANCE.purge(uri);
 
         ContentValues values = new ContentValues(10);
@@ -969,52 +998,72 @@
      */
     public void updateParts(Uri uri, PduBody body)
             throws MmsException {
-        PduCacheEntry cacheEntry = PDU_CACHE_INSTANCE.get(uri);
-        if (cacheEntry != null) {
-            ((MultimediaMessagePdu) cacheEntry.getPdu()).setBody(body);
-        }
-
-        ArrayList<PduPart> toBeCreated = new ArrayList<PduPart>();
-        HashMap<Uri, PduPart> toBeUpdated = new HashMap<Uri, PduPart>();
-
-        int partsNum = body.getPartsNum();
-        StringBuilder filter = new StringBuilder().append('(');
-        for (int i = 0; i < partsNum; i++) {
-            PduPart part = body.getPart(i);
-            Uri partUri = part.getDataUri();
-            if ((partUri == null) || !partUri.getAuthority().startsWith("mms")) {
-                toBeCreated.add(part);
-            } else {
-                toBeUpdated.put(partUri, part);
-
-                // Don't use 'i > 0' to determine whether we should append
-                // 'AND' since 'i = 0' may be skipped in another branch.
-                if (filter.length() > 1) {
-                    filter.append(" AND ");
+        try {
+            PduCacheEntry cacheEntry;
+            synchronized(PDU_CACHE_INSTANCE) {
+                if (PDU_CACHE_INSTANCE.isUpdating(uri)) {
+                    try {
+                        PDU_CACHE_INSTANCE.wait();
+                    } catch (InterruptedException e) {
+                        Log.e(TAG, "updateParts: ", e);
+                    }
+                    cacheEntry = PDU_CACHE_INSTANCE.get(uri);
+                    if (cacheEntry != null) {
+                        ((MultimediaMessagePdu) cacheEntry.getPdu()).setBody(body);
+                    }
                 }
-
-                filter.append(Part._ID);
-                filter.append("!=");
-                DatabaseUtils.appendEscapedSQLString(filter, partUri.getLastPathSegment());
+                // Tell the cache to indicate to other callers that this item
+                // is currently being updated.
+                PDU_CACHE_INSTANCE.setUpdating(uri, true);
             }
-        }
-        filter.append(')');
 
-        long msgId = ContentUris.parseId(uri);
+            ArrayList<PduPart> toBeCreated = new ArrayList<PduPart>();
+            HashMap<Uri, PduPart> toBeUpdated = new HashMap<Uri, PduPart>();
 
-        // Remove the parts which doesn't exist anymore.
-        SqliteWrapper.delete(mContext, mContentResolver,
-                Uri.parse(Mms.CONTENT_URI + "/" + msgId + "/part"),
-                filter.length() > 2 ? filter.toString() : null, null);
+            int partsNum = body.getPartsNum();
+            StringBuilder filter = new StringBuilder().append('(');
+            for (int i = 0; i < partsNum; i++) {
+                PduPart part = body.getPart(i);
+                Uri partUri = part.getDataUri();
+                if ((partUri == null) || !partUri.getAuthority().startsWith("mms")) {
+                    toBeCreated.add(part);
+                } else {
+                    toBeUpdated.put(partUri, part);
 
-        // Create new parts which didn't exist before.
-        for (PduPart part : toBeCreated) {
-            persistPart(part, msgId);
-        }
+                    // Don't use 'i > 0' to determine whether we should append
+                    // 'AND' since 'i = 0' may be skipped in another branch.
+                    if (filter.length() > 1) {
+                        filter.append(" AND ");
+                    }
 
-        // Update the modified parts.
-        for (Map.Entry<Uri, PduPart> e : toBeUpdated.entrySet()) {
-            updatePart(e.getKey(), e.getValue());
+                    filter.append(Part._ID);
+                    filter.append("!=");
+                    DatabaseUtils.appendEscapedSQLString(filter, partUri.getLastPathSegment());
+                }
+            }
+            filter.append(')');
+
+            long msgId = ContentUris.parseId(uri);
+
+            // Remove the parts which doesn't exist anymore.
+            SqliteWrapper.delete(mContext, mContentResolver,
+                    Uri.parse(Mms.CONTENT_URI + "/" + msgId + "/part"),
+                    filter.length() > 2 ? filter.toString() : null, null);
+
+            // Create new parts which didn't exist before.
+            for (PduPart part : toBeCreated) {
+                persistPart(part, msgId);
+            }
+
+            // Update the modified parts.
+            for (Map.Entry<Uri, PduPart> e : toBeUpdated.entrySet()) {
+                updatePart(e.getKey(), e.getValue());
+            }
+        } finally {
+            synchronized(PDU_CACHE_INSTANCE) {
+                PDU_CACHE_INSTANCE.setUpdating(uri, false);
+                PDU_CACHE_INSTANCE.notifyAll();
+            }
         }
     }
 
@@ -1029,15 +1078,32 @@
         if (uri == null) {
             throw new MmsException("Uri may not be null.");
         }
+        long msgId = -1;
+        try {
+            msgId = ContentUris.parseId(uri);
+        } catch (NumberFormatException e) {
+            // the uri ends with "inbox" or something else like that
+        }
+        boolean existingUri = msgId != -1;
 
-        Integer msgBox = MESSAGE_BOX_MAP.get(uri);
-        if (msgBox == null) {
+        if (!existingUri && MESSAGE_BOX_MAP.get(uri) == null) {
             throw new MmsException(
                     "Bad destination, must be one of "
                     + "content://mms/inbox, content://mms/sent, "
                     + "content://mms/drafts, content://mms/outbox, "
                     + "content://mms/temp.");
         }
+        synchronized(PDU_CACHE_INSTANCE) {
+            // If the cache item is getting updated, wait until it's done updating before
+            // purging it.
+            if (PDU_CACHE_INSTANCE.isUpdating(uri)) {
+                try {
+                    PDU_CACHE_INSTANCE.wait();
+                } catch (InterruptedException e) {
+                    Log.e(TAG, "persist1: ", e);
+                }
+            }
+        }
         PDU_CACHE_INSTANCE.purge(uri);
 
         PduHeaders header = pdu.getPduHeaders();
@@ -1145,14 +1211,20 @@
             }
         }
 
-        Uri res = SqliteWrapper.insert(mContext, mContentResolver, uri, values);
-        if (res == null) {
-            throw new MmsException("persist() failed: return null.");
+        Uri res = null;
+        if (existingUri) {
+            res = uri;
+            SqliteWrapper.update(mContext, mContentResolver, res, values, null, null);
+        } else {
+            res = SqliteWrapper.insert(mContext, mContentResolver, uri, values);
+            if (res == null) {
+                throw new MmsException("persist() failed: return null.");
+            }
+            // Get the real ID of the PDU and update all parts which were
+            // saved with the dummy ID.
+            msgId = ContentUris.parseId(res);
         }
 
-        // Get the real ID of the PDU and update all parts which were
-        // saved with the dummy ID.
-        long msgId = ContentUris.parseId(res);
         values = new ContentValues(1);
         values.put(Part.MSG_ID, msgId);
         SqliteWrapper.update(mContext, mContentResolver,
@@ -1163,7 +1235,9 @@
         // persisted PDU is '8', we should return "content://mms/inbox/8"
         // instead of "content://mms/8".
         // FIXME: Should the MmsProvider be responsible for this???
-        res = Uri.parse(uri + "/" + msgId);
+        if (!existingUri) {
+            res = Uri.parse(uri + "/" + msgId);
+        }
 
         // Save address information.
         for (int addrType : ADDRESS_FIELDS) {
diff --git a/core/java/com/google/android/mms/util/PduCache.java b/core/java/com/google/android/mms/util/PduCache.java
index 059af72..87cb48e 100644
--- a/core/java/com/google/android/mms/util/PduCache.java
+++ b/core/java/com/google/android/mms/util/PduCache.java
@@ -73,10 +73,12 @@
 
     private final HashMap<Integer, HashSet<Uri>> mMessageBoxes;
     private final HashMap<Long, HashSet<Uri>> mThreads;
+    private final HashSet<Uri> mUpdating;
 
     private PduCache() {
         mMessageBoxes = new HashMap<Integer, HashSet<Uri>>();
         mThreads = new HashMap<Long, HashSet<Uri>>();
+        mUpdating = new HashSet<Uri>();
     }
 
     synchronized public static final PduCache getInstance() {
@@ -111,9 +113,22 @@
             msgBox.add(finalKey);
             thread.add(finalKey);
         }
+        setUpdating(uri, false);
         return result;
     }
 
+    synchronized public void setUpdating(Uri uri, boolean updating) {
+        if (updating) {
+            mUpdating.add(uri);
+        } else {
+            mUpdating.remove(uri);
+        }
+    }
+
+    synchronized public boolean isUpdating(Uri uri) {
+        return mUpdating.contains(uri);
+    }
+
     @Override
     synchronized public PduCacheEntry purge(Uri uri) {
         int match = URI_MATCHER.match(uri);
diff --git a/core/jni/Android.mk b/core/jni/Android.mk
index 8be1996..39b84bb 100644
--- a/core/jni/Android.mk
+++ b/core/jni/Android.mk
@@ -39,12 +39,10 @@
 	android_opengl_GLES11Ext.cpp \
 	android_opengl_GLES20.cpp \
 	android_database_CursorWindow.cpp \
-	android_database_SQLiteCompiledSql.cpp \
+	android_database_SQLiteCommon.cpp \
+	android_database_SQLiteConnection.cpp \
+	android_database_SQLiteGlobal.cpp \
 	android_database_SQLiteDebug.cpp \
-	android_database_SQLiteDatabase.cpp \
-	android_database_SQLiteProgram.cpp \
-	android_database_SQLiteQuery.cpp \
-	android_database_SQLiteStatement.cpp \
 	android_emoji_EmojiFactory.cpp \
 	android_view_Display.cpp \
 	android_view_DisplayEventReceiver.cpp \
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index c006615..8a3063f 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -121,12 +121,9 @@
 extern int register_android_view_Surface(JNIEnv* env);
 extern int register_android_view_TextureView(JNIEnv* env);
 extern int register_android_database_CursorWindow(JNIEnv* env);
-extern int register_android_database_SQLiteCompiledSql(JNIEnv* env);
-extern int register_android_database_SQLiteDatabase(JNIEnv* env);
+extern int register_android_database_SQLiteConnection(JNIEnv* env);
+extern int register_android_database_SQLiteGlobal(JNIEnv* env);
 extern int register_android_database_SQLiteDebug(JNIEnv* env);
-extern int register_android_database_SQLiteProgram(JNIEnv* env);
-extern int register_android_database_SQLiteQuery(JNIEnv* env);
-extern int register_android_database_SQLiteStatement(JNIEnv* env);
 extern int register_android_debug_JNITest(JNIEnv* env);
 extern int register_android_nio_utils(JNIEnv* env);
 extern int register_android_text_format_Time(JNIEnv* env);
@@ -1141,12 +1138,9 @@
     REG_JNI(register_android_graphics_YuvImage),
 
     REG_JNI(register_android_database_CursorWindow),
-    REG_JNI(register_android_database_SQLiteCompiledSql),
-    REG_JNI(register_android_database_SQLiteDatabase),
+    REG_JNI(register_android_database_SQLiteConnection),
+    REG_JNI(register_android_database_SQLiteGlobal),
     REG_JNI(register_android_database_SQLiteDebug),
-    REG_JNI(register_android_database_SQLiteProgram),
-    REG_JNI(register_android_database_SQLiteQuery),
-    REG_JNI(register_android_database_SQLiteStatement),
     REG_JNI(register_android_os_Debug),
     REG_JNI(register_android_os_FileObserver),
     REG_JNI(register_android_os_FileUtils),
diff --git a/core/jni/android/graphics/Canvas.cpp b/core/jni/android/graphics/Canvas.cpp
index 4aa13f9..ef6af74 100644
--- a/core/jni/android/graphics/Canvas.cpp
+++ b/core/jni/android/graphics/Canvas.cpp
@@ -67,7 +67,7 @@
     static void freeCaches(JNIEnv* env, jobject) {
         // these are called in no particular order
         SkImageRef_GlobalPool::SetRAMUsed(0);
-        SkGraphics::SetFontCacheUsed(0);
+        SkGraphics::PurgeFontCache();
     }
     
     static jboolean isOpaque(JNIEnv* env, jobject jcanvas) {
@@ -757,28 +757,16 @@
             int start, int count, int contextCount,
             jfloat x, jfloat y, int flags, SkPaint* paint) {
 
-        sp<TextLayoutCacheValue> value;
-#if USE_TEXT_LAYOUT_CACHE
-        value = TextLayoutCache::getInstance().getValue(paint, textArray, start, count,
-                contextCount, flags);
+        sp<TextLayoutValue> value = TextLayoutEngine::getInstance().getValue(paint,
+                textArray, start, count, contextCount, flags);
         if (value == NULL) {
-            ALOGE("Cannot get TextLayoutCache value for text = '%s'",
-                    String8(textArray + start, count).string());
-            return ;
+            return;
         }
-#else
-        value = new TextLayoutCacheValue(contextCount);
-        TextLayoutEngine::getInstance().computeValues(value.get(), paint,
-                reinterpret_cast<const UChar*>(textArray), start, count, contextCount, flags);
-#endif
         doDrawGlyphs(canvas, value->getGlyphs(), 0, value->getGlyphsCount(), x, y, flags, paint);
     }
 
     static void doDrawGlyphs(SkCanvas* canvas, const jchar* glyphArray, int index, int count,
             jfloat x, jfloat y, int flags, SkPaint* paint) {
-        // TODO: need to suppress this code after the GL renderer is modified for not
-        // copying the paint
-
         // Beware: this needs Glyph encoding (already done on the Paint constructor)
         canvas->drawText(glyphArray + index * 2, count * 2, x, y, *paint);
     }
@@ -820,7 +808,12 @@
             posPtr[indx].fX = SkFloatToScalar(posArray[indx << 1]);
             posPtr[indx].fY = SkFloatToScalar(posArray[(indx << 1) + 1]);
         }
+        
+        SkPaint::TextEncoding encoding = paint->getTextEncoding();
+        paint->setTextEncoding(SkPaint::kUTF16_TextEncoding);
         canvas->drawPosText(textArray + index, count << 1, posPtr, *paint);
+        paint->setTextEncoding(encoding);
+        
         if (text) {
             env->ReleaseCharArrayElements(text, textArray, 0);
         }
@@ -844,7 +837,12 @@
             posPtr[indx].fX = SkFloatToScalar(posArray[indx << 1]);
             posPtr[indx].fY = SkFloatToScalar(posArray[(indx << 1) + 1]);
         }
+
+        SkPaint::TextEncoding encoding = paint->getTextEncoding();
+        paint->setTextEncoding(SkPaint::kUTF16_TextEncoding);
         canvas->drawPosText(text_, byteLength << 1, posPtr, *paint);
+        paint->setTextEncoding(encoding);
+
         if (text) {
             env->ReleaseStringChars(text, (const jchar*) text_);
         }
diff --git a/core/jni/android/graphics/Graphics.cpp b/core/jni/android/graphics/Graphics.cpp
index 47ffd94..a1d41ee 100644
--- a/core/jni/android/graphics/Graphics.cpp
+++ b/core/jni/android/graphics/Graphics.cpp
@@ -518,12 +518,6 @@
 bool JavaPixelAllocator::allocPixelRef(SkBitmap* bitmap, SkColorTable* ctable) {
     JNIEnv* env = vm2env(fVM);
 
-    // If allocating in the Java heap, only allow a single object to be
-    // allocated for the lifetime of this object.
-    if (fStorageObj != NULL) {
-        SkDebugf("WARNING: One-shot allocator has already allocated (alloc count = %d)\n", fAllocCount);
-//        sk_throw();
-    }
     fStorageObj = GraphicsJNI::allocateJavaPixelRef(env, bitmap, ctable);
     fAllocCount += 1;
     return fStorageObj != NULL;
diff --git a/core/jni/android/graphics/Paint.cpp b/core/jni/android/graphics/Paint.cpp
index 9f3238ab..376c841 100644
--- a/core/jni/android/graphics/Paint.cpp
+++ b/core/jni/android/graphics/Paint.cpp
@@ -465,10 +465,10 @@
 
         jchar* glyphsArray = env->GetCharArrayElements(glyphs, NULL);
 
-        TextLayoutCacheValue value(contextCount);
-        TextLayoutEngine::getInstance().computeValues(&value, paint, text, start, count, contextCount, flags);
-        const jchar* shapedGlyphs = value.getGlyphs();
-        size_t glyphsCount = value.getGlyphsCount();
+        sp<TextLayoutValue> value = TextLayoutEngine::getInstance().getValue(paint,
+                text, start, count, contextCount, flags);
+        const jchar* shapedGlyphs = value->getGlyphs();
+        size_t glyphsCount = value->getGlyphsCount();
         memcpy(glyphsArray, shapedGlyphs, sizeof(jchar) * glyphsCount);
 
         env->ReleaseCharArrayElements(glyphs, glyphsArray, JNI_ABORT);
@@ -673,13 +673,16 @@
         }
     }
 
-    static int breakText(JNIEnv* env, const SkPaint& paint, const jchar text[],
+    static int breakText(JNIEnv* env, SkPaint& paint, const jchar text[],
                          int count, float maxWidth, jfloatArray jmeasured,
                          SkPaint::TextBufferDirection tbd) {
-        SkASSERT(paint.getTextEncoding() == SkPaint::kUTF16_TextEncoding);
-
+        sp<TextLayoutValue> value = TextLayoutEngine::getInstance().getValue(&paint,
+                text, 0, count, count, paint.getFlags());
+        if (value == NULL) {
+            return 0;
+        }
         SkScalar     measured;
-        size_t       bytes = paint.breakText(text, count << 1,
+        size_t       bytes = paint.breakText(value->getGlyphs(), value->getGlyphsCount() << 1,
                                    SkFloatToScalar(maxWidth), &measured, tbd);
         SkASSERT((bytes & 1) == 0);
 
@@ -743,7 +746,12 @@
         SkRect  r;
         SkIRect ir;
 
-        paint.measureText(text, count << 1, &r);
+        sp<TextLayoutValue> value = TextLayoutEngine::getInstance().getValue(&paint,
+                text, 0, count, count, paint.getFlags());
+        if (value == NULL) {
+            return;
+        }
+        paint.measureText(value->getGlyphs(), value->getGlyphsCount() << 1, &r);
         r.roundOut(&ir);
         GraphicsJNI::irect_to_jrect(ir, env, bounds);
     }
diff --git a/core/jni/android/graphics/TextLayout.cpp b/core/jni/android/graphics/TextLayout.cpp
index 2d83851..2241f60 100644
--- a/core/jni/android/graphics/TextLayout.cpp
+++ b/core/jni/android/graphics/TextLayout.cpp
@@ -53,19 +53,9 @@
 // a path representing the text that would have been drawn.
 void TextLayout::handleText(SkPaint *paint, const jchar* text, jsize len,
                             jint bidiFlags, jfloat x, jfloat y, SkPath *path) {
-    sp<TextLayoutCacheValue> value;
-#if USE_TEXT_LAYOUT_CACHE
-    // Return advances from the cache. Compute them if needed
-    value = TextLayoutCache::getInstance().getValue(paint, text, 0, len,
-            len, bidiFlags);
-#else
-    value = new TextLayoutCacheValue(len);
-    TextLayoutEngine::getInstance().computeValues(value.get(), paint,
-            reinterpret_cast<const UChar*>(text), 0, len, len, bidiFlags);
-#endif
+    sp<TextLayoutValue> value = TextLayoutEngine::getInstance().getValue(paint,
+            text, 0, len, len, bidiFlags);
     if (value == NULL) {
-        ALOGE("Cannot get TextLayoutCache value for text = '%s'",
-                String8(text, len).string());
         return ;
     }
     SkScalar x_ = SkFloatToScalar(x);
@@ -77,19 +67,9 @@
 void TextLayout::getTextRunAdvances(SkPaint* paint, const jchar* chars, jint start,
                                     jint count, jint contextCount, jint dirFlags,
                                     jfloat* resultAdvances, jfloat* resultTotalAdvance) {
-    sp<TextLayoutCacheValue> value;
-#if USE_TEXT_LAYOUT_CACHE
-    // Return advances from the cache. Compute them if needed
-    value = TextLayoutCache::getInstance().getValue(paint, chars, start, count,
-            contextCount, dirFlags);
-#else
-    value = new TextLayoutCacheValue(contextCount);
-    TextLayoutEngine::getInstance().computeValues(value.get(), paint,
-            reinterpret_cast<const UChar*>(chars), start, count, contextCount, dirFlags);
-#endif
+    sp<TextLayoutValue> value = TextLayoutEngine::getInstance().getValue(paint,
+            chars, start, count, contextCount, dirFlags);
     if (value == NULL) {
-        ALOGE("Cannot get TextLayoutCache value for text = '%s'",
-                String8(chars + start, count).string());
         return ;
     }
     if (resultAdvances) {
@@ -126,20 +106,12 @@
         return;
     }
 
-    sp<TextLayoutCacheValue> value;
-#if USE_TEXT_LAYOUT_CACHE
-    value = TextLayoutCache::getInstance().getValue(paint, text, 0, count,
-            count, bidiFlags);
-#else
-    value = new TextLayoutCacheValue(count);
-    TextLayoutEngine::getInstance().computeValues(value.get(), paint,
-            reinterpret_cast<const UChar*>(text), 0, count, count, bidiFlags);
-#endif
+    sp<TextLayoutValue> value = TextLayoutEngine::getInstance().getValue(paint,
+            text, 0, count, count, bidiFlags);
     if (value == NULL) {
-        ALOGE("Cannot get TextLayoutCache value for text = '%s'",
-                String8(text, count).string());
-        return ;
+        return;
     }
+
     // Beware: this needs Glyph encoding (already done on the Paint constructor)
     canvas->drawTextOnPathHV(value->getGlyphs(), value->getGlyphsCount() * 2, *path, h_, v_, *paint);
 }
diff --git a/core/jni/android/graphics/TextLayoutCache.cpp b/core/jni/android/graphics/TextLayoutCache.cpp
index 1b7623d..7f5d54d 100644
--- a/core/jni/android/graphics/TextLayoutCache.cpp
+++ b/core/jni/android/graphics/TextLayoutCache.cpp
@@ -29,24 +29,24 @@
 namespace android {
 
 //--------------------------------------------------------------------------------------------------
-#define TYPEFACE_ARABIC "/system/fonts/DroidNaskh-Regular.ttf"
+// Using DroidSansArabic for shaping Arabic with Harfbuzz because its metrics are more compatible
+// with the "Roboto" metrics (compared to DroidNaskh-Regular). When we will have an Arabic font
+// whose metrics are similar to the Roboto ones, then we will need to use it for shaping.
+#define TYPEFACE_ARABIC "/system/fonts/DroidSansArabic.ttf"
 #define TYPE_FACE_HEBREW_REGULAR "/system/fonts/DroidSansHebrew-Regular.ttf"
 #define TYPE_FACE_HEBREW_BOLD "/system/fonts/DroidSansHebrew-Bold.ttf"
 #define TYPEFACE_BENGALI "/system/fonts/Lohit-Bengali.ttf"
 #define TYPEFACE_THAI "/system/fonts/DroidSansThai.ttf"
 
-#if USE_TEXT_LAYOUT_CACHE
+ANDROID_SINGLETON_STATIC_INSTANCE(TextLayoutEngine);
 
-    ANDROID_SINGLETON_STATIC_INSTANCE(TextLayoutCache);
-
-#endif
-
-    ANDROID_SINGLETON_STATIC_INSTANCE(TextLayoutEngine);
+static KeyedVector<UChar, UChar> gBidiMirrored;
 
 //--------------------------------------------------------------------------------------------------
 
-TextLayoutCache::TextLayoutCache() :
-        mCache(GenerationCache<TextLayoutCacheKey, sp<TextLayoutCacheValue> >::kUnlimitedCapacity),
+TextLayoutCache::TextLayoutCache(TextLayoutShaper* shaper) :
+        mShaper(shaper),
+        mCache(GenerationCache<TextLayoutCacheKey, sp<TextLayoutValue> >::kUnlimitedCapacity),
         mSize(0), mMaxSize(MB(DEFAULT_TEXT_LAYOUT_CACHE_SIZE_IN_MB)),
         mCacheHitCount(0), mNanosecondsSaved(0) {
     init();
@@ -75,7 +75,7 @@
 /**
  *  Callbacks
  */
-void TextLayoutCache::operator()(TextLayoutCacheKey& text, sp<TextLayoutCacheValue>& desc) {
+void TextLayoutCache::operator()(TextLayoutCacheKey& text, sp<TextLayoutValue>& desc) {
     size_t totalSizeToDelete = text.getSize() + desc->getSize();
     mSize -= totalSizeToDelete;
     if (mDebugEnabled) {
@@ -93,7 +93,7 @@
 /*
  * Caching
  */
-sp<TextLayoutCacheValue> TextLayoutCache::getValue(SkPaint* paint,
+sp<TextLayoutValue> TextLayoutCache::getValue(const SkPaint* paint,
             const jchar* text, jint start, jint count, jint contextCount, jint dirFlags) {
     AutoMutex _l(mLock);
     nsecs_t startTime = 0;
@@ -105,7 +105,7 @@
     TextLayoutCacheKey key(paint, text, start, count, contextCount, dirFlags);
 
     // Get value from cache if possible
-    sp<TextLayoutCacheValue> value = mCache.get(key);
+    sp<TextLayoutValue> value = mCache.get(key);
 
     // Value not found for the key, we need to add a new value in the cache
     if (value == NULL) {
@@ -113,10 +113,10 @@
             startTime = systemTime(SYSTEM_TIME_MONOTONIC);
         }
 
-        value = new TextLayoutCacheValue(contextCount);
+        value = new TextLayoutValue(contextCount);
 
         // Compute advances and store them
-        TextLayoutEngine::getInstance().computeValues(value.get(), paint,
+        mShaper->computeValues(value.get(), paint,
                 reinterpret_cast<const UChar*>(text), start, count,
                 size_t(contextCount), int(dirFlags));
 
@@ -312,31 +312,33 @@
 /**
  * TextLayoutCacheValue
  */
-TextLayoutCacheValue::TextLayoutCacheValue(size_t contextCount) :
+TextLayoutValue::TextLayoutValue(size_t contextCount) :
         mTotalAdvance(0), mElapsedTime(0) {
     // Give a hint for advances and glyphs vectors size
     mAdvances.setCapacity(contextCount);
     mGlyphs.setCapacity(contextCount);
 }
 
-size_t TextLayoutCacheValue::getSize() const {
-    return sizeof(TextLayoutCacheValue) + sizeof(jfloat) * mAdvances.capacity() +
+size_t TextLayoutValue::getSize() const {
+    return sizeof(TextLayoutValue) + sizeof(jfloat) * mAdvances.capacity() +
             sizeof(jchar) * mGlyphs.capacity();
 }
 
-void TextLayoutCacheValue::setElapsedTime(uint32_t time) {
+void TextLayoutValue::setElapsedTime(uint32_t time) {
     mElapsedTime = time;
 }
 
-uint32_t TextLayoutCacheValue::getElapsedTime() {
+uint32_t TextLayoutValue::getElapsedTime() {
     return mElapsedTime;
 }
 
-TextLayoutEngine::TextLayoutEngine() : mShaperItemGlyphArraySize(0) {
+TextLayoutShaper::TextLayoutShaper() : mShaperItemGlyphArraySize(0) {
     mDefaultTypeface = SkFontHost::CreateTypeface(NULL, NULL, NULL, 0, SkTypeface::kNormal);
     mArabicTypeface = NULL;
     mHebrewRegularTypeface = NULL;
     mHebrewBoldTypeface = NULL;
+    mBengaliTypeface = NULL;
+    mThaiTypeface = NULL;
 
     mFontRec.klass = &harfbuzzSkiaClass;
     mFontRec.userData = 0;
@@ -353,14 +355,36 @@
 
     mShaperItem.font = &mFontRec;
     mShaperItem.font->userData = &mShapingPaint;
+
+    // Fill the BiDi mirrored chars map
+    // See: http://www.unicode.org/Public/6.0.0/ucd/extracted/DerivedBinaryProperties.txt
+    gBidiMirrored.add('(', ')');
+    gBidiMirrored.add(')', '(');
+    gBidiMirrored.add('[', ']');
+    gBidiMirrored.add(']', '[');
+    gBidiMirrored.add('{', '}');
+    gBidiMirrored.add('}', '{');
+    gBidiMirrored.add('<', '>');
+    gBidiMirrored.add('>', '<');
+    gBidiMirrored.add(0x00ab, 0x00bb); // LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+    gBidiMirrored.add(0x00bb, 0x00ab); // RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+    gBidiMirrored.add(0x2039, 0x203a); // SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+    gBidiMirrored.add(0x203a, 0x2039); // SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+    gBidiMirrored.add(0x2264, 0x2265); // LESS-THAN OR EQUAL TO
+    gBidiMirrored.add(0x2265, 0x2264); // GREATER-THAN OR EQUAL TO
 }
 
-TextLayoutEngine::~TextLayoutEngine() {
-    // FIXME should free fonts and caches but since this class is a singleton,
-    // we don't bother at the moment
+TextLayoutShaper::~TextLayoutShaper() {
+    SkSafeUnref(mDefaultTypeface);
+    SkSafeUnref(mArabicTypeface);
+    SkSafeUnref(mHebrewRegularTypeface);
+    SkSafeUnref(mHebrewBoldTypeface);
+    SkSafeUnref(mBengaliTypeface);
+    SkSafeUnref(mThaiTypeface);
+    deleteShaperItemGlyphArrays();
 }
 
-void TextLayoutEngine::computeValues(TextLayoutCacheValue* value, SkPaint* paint, const UChar* chars,
+void TextLayoutShaper::computeValues(TextLayoutValue* value, const SkPaint* paint, const UChar* chars,
         size_t start, size_t count, size_t contextCount, int dirFlags) {
 
     computeValues(paint, chars, start, count, contextCount, dirFlags,
@@ -371,7 +395,7 @@
 #endif
 }
 
-void TextLayoutEngine::computeValues(SkPaint* paint, const UChar* chars,
+void TextLayoutShaper::computeValues(const SkPaint* paint, const UChar* chars,
         size_t start, size_t count, size_t contextCount, int dirFlags,
         Vector<jfloat>* const outAdvances, jfloat* outTotalAdvance,
         Vector<jchar>* const outGlyphs) {
@@ -513,7 +537,7 @@
     }
 }
 
-void TextLayoutEngine::computeRunValues(SkPaint* paint, const UChar* chars,
+void TextLayoutShaper::computeRunValues(const SkPaint* paint, const UChar* chars,
         size_t count, bool isRTL,
         Vector<jfloat>* const outAdvances, jfloat* outTotalAdvance,
         Vector<jchar>* const outGlyphs) {
@@ -575,6 +599,31 @@
         }
     }
 
+    // Reverse "BiDi mirrored chars" in RTL mode only
+    // See: http://www.unicode.org/Public/6.0.0/ucd/extracted/DerivedBinaryProperties.txt
+    // This is a workaround because Harfbuzz is not able to do mirroring in all cases and
+    // script-run splitting with Harfbuzz is splitting on parenthesis
+    if (isRTL) {
+        for (ssize_t i = 0; i < ssize_t(count); i++) {
+            UChar ch = chars[i];
+            ssize_t index = gBidiMirrored.indexOfKey(ch);
+            // Skip non "BiDi mirrored" chars
+            if (index < 0) {
+                continue;
+            }
+            if (!useNormalizedString) {
+                useNormalizedString = true;
+                mNormalizedString.setTo(false /* not terminated*/, chars, count);
+            }
+            UChar result = gBidiMirrored.valueAt(index);
+            mNormalizedString.setCharAt(i, result);
+#if DEBUG_GLYPHS
+            ALOGD("Rewriting codepoint '%d' to '%d' at position %d",
+                    ch, mNormalizedString[i], int(i));
+#endif
+        }
+    }
+
 #if DEBUG_GLYPHS
     if (useNormalizedString) {
         ALOGD("Will use normalized string '%s', length = %d",
@@ -659,6 +708,13 @@
             continue;
         }
 
+#if DEBUG_GLYPHS
+        ALOGD("Returned logclusters");
+        for (size_t i = 0; i < mShaperItem.num_glyphs; i++) {
+            ALOGD("         -- lc[%d] = %d, hb-adv[%d] = %0.2f", i, mShaperItem.log_clusters[i],
+                    i, HBFixedToFloat(mShaperItem.advances[i]));
+        }
+#endif
         // Get Advances and their total
         jfloat currentAdvance = HBFixedToFloat(mShaperItem.advances[mShaperItem.log_clusters[0]]);
         jfloat totalFontRunAdvance = currentAdvance;
@@ -670,11 +726,14 @@
                 outAdvances->add(0);
             } else {
                 currentAdvance = HBFixedToFloat(mShaperItem.advances[mShaperItem.log_clusters[i]]);
-                totalFontRunAdvance += currentAdvance;
                 outAdvances->add(currentAdvance);
             }
         }
-
+        // TODO: can be removed and go back in the previous loop when Harfbuzz log clusters are fixed
+        for (size_t i = 1; i < mShaperItem.num_glyphs; i++) {
+            currentAdvance = HBFixedToFloat(mShaperItem.advances[i]);
+            totalFontRunAdvance += currentAdvance;
+        }
         totalAdvance += totalFontRunAdvance;
 
 #if DEBUG_ADVANCES
@@ -684,7 +743,6 @@
                     (*outAdvances)[i], mShaperItem.log_clusters[i], totalFontRunAdvance);
         }
 #endif
-
         // Get Glyphs and reverse them in place if RTL
         if (outGlyphs) {
             size_t countGlyphs = mShaperItem.num_glyphs;
@@ -710,7 +768,7 @@
 }
 
 
-size_t TextLayoutEngine::shapeFontRun(SkPaint* paint, bool isRTL) {
+size_t TextLayoutShaper::shapeFontRun(const SkPaint* paint, bool isRTL) {
     // Reset kerning
     mShaperItem.kerning_applied = false;
 
@@ -802,7 +860,7 @@
     case HB_Script_Hebrew:
     case HB_Script_Bengali:
     case HB_Script_Thai:{
-        const uint16_t* text16 = (const uint16_t*)mShaperItem.string;
+        const uint16_t* text16 = (const uint16_t*)(mShaperItem.string + mShaperItem.item.pos);
         SkUnichar firstUnichar = SkUTF16_NextUnichar(&text16);
         baseGlyphCount = paint->getBaseGlyphCount(firstUnichar);
         break;
@@ -824,14 +882,14 @@
     return baseGlyphCount;
 }
 
-void TextLayoutEngine::ensureShaperItemGlyphArrays(size_t size) {
+void TextLayoutShaper::ensureShaperItemGlyphArrays(size_t size) {
     if (size > mShaperItemGlyphArraySize) {
         deleteShaperItemGlyphArrays();
         createShaperItemGlyphArrays(size);
     }
 }
 
-void TextLayoutEngine::createShaperItemGlyphArrays(size_t size) {
+void TextLayoutShaper::createShaperItemGlyphArrays(size_t size) {
 #if DEBUG_GLYPHS
     ALOGD("Creating Glyph Arrays with size = %d", size);
 #endif
@@ -849,7 +907,7 @@
     mShaperItem.log_clusters = new unsigned short[size];
 }
 
-void TextLayoutEngine::deleteShaperItemGlyphArrays() {
+void TextLayoutShaper::deleteShaperItemGlyphArrays() {
     delete[] mShaperItem.glyphs;
     delete[] mShaperItem.attributes;
     delete[] mShaperItem.advances;
@@ -857,7 +915,7 @@
     delete[] mShaperItem.log_clusters;
 }
 
-SkTypeface* TextLayoutEngine::getCachedTypeface(SkTypeface** typeface, const char path[]) {
+SkTypeface* TextLayoutShaper::getCachedTypeface(SkTypeface** typeface, const char path[]) {
     if (!*typeface) {
         *typeface = SkTypeface::CreateFromFile(path);
         // CreateFromFile(path) can return NULL if the path is non existing
@@ -875,7 +933,7 @@
     return *typeface;
 }
 
-HB_Face TextLayoutEngine::getCachedHBFace(SkTypeface* typeface) {
+HB_Face TextLayoutShaper::getCachedHBFace(SkTypeface* typeface) {
     SkFontID fontId = typeface->uniqueID();
     ssize_t index = mCachedHBFaces.indexOfKey(fontId);
     if (index >= 0) {
@@ -891,4 +949,36 @@
     return face;
 }
 
+TextLayoutEngine::TextLayoutEngine() {
+    mShaper = new TextLayoutShaper();
+#if USE_TEXT_LAYOUT_CACHE
+    mTextLayoutCache = new TextLayoutCache(mShaper);
+#else
+    mTextLayoutCache = NULL;
+#endif
+}
+
+TextLayoutEngine::~TextLayoutEngine() {
+    delete mTextLayoutCache;
+    delete mShaper;
+}
+
+sp<TextLayoutValue> TextLayoutEngine::getValue(const SkPaint* paint, const jchar* text,
+        jint start, jint count, jint contextCount, jint dirFlags) {
+    sp<TextLayoutValue> value;
+#if USE_TEXT_LAYOUT_CACHE
+    value = mTextLayoutCache->getValue(paint, text, start, count,
+            contextCount, dirFlags);
+    if (value == NULL) {
+        ALOGE("Cannot get TextLayoutCache value for text = '%s'",
+                String8(text + start, count).string());
+    }
+#else
+    value = new TextLayoutValue(count);
+    mShaper->computeValues(value.get(), paint,
+            reinterpret_cast<const UChar*>(text), start, count, contextCount, dirFlags);
+#endif
+    return value;
+}
+
 } // namespace android
diff --git a/core/jni/android/graphics/TextLayoutCache.h b/core/jni/android/graphics/TextLayoutCache.h
index 510aa18..7ac2f18 100644
--- a/core/jni/android/graphics/TextLayoutCache.h
+++ b/core/jni/android/graphics/TextLayoutCache.h
@@ -115,11 +115,11 @@
 }
 
 /*
- * TextLayoutCacheValue is the Cache value
+ * TextLayoutValue is the Cache value
  */
-class TextLayoutCacheValue : public RefBase {
+class TextLayoutValue : public RefBase {
 public:
-    TextLayoutCacheValue(size_t contextCount);
+    TextLayoutValue(size_t contextCount);
 
     void setElapsedTime(uint32_t time);
     uint32_t getElapsedTime();
@@ -159,72 +159,14 @@
 }; // TextLayoutCacheValue
 
 /**
- * Cache of text layout information.
+ * The TextLayoutShaper is responsible for shaping (with the Harfbuzz library)
  */
-class TextLayoutCache : public OnEntryRemoved<TextLayoutCacheKey, sp<TextLayoutCacheValue> >,
-        public Singleton<TextLayoutCache>
-{
+class TextLayoutShaper {
 public:
-    TextLayoutCache();
+    TextLayoutShaper();
+    virtual ~TextLayoutShaper();
 
-    virtual ~TextLayoutCache();
-
-    bool isInitialized() {
-        return mInitialized;
-    }
-
-    /**
-     * Used as a callback when an entry is removed from the cache
-     * Do not invoke directly
-     */
-    void operator()(TextLayoutCacheKey& text, sp<TextLayoutCacheValue>& desc);
-
-    sp<TextLayoutCacheValue> getValue(SkPaint* paint, const jchar* text, jint start, jint count,
-            jint contextCount, jint dirFlags);
-
-    /**
-     * Clear the cache
-     */
-    void clear();
-
-private:
-    Mutex mLock;
-    bool mInitialized;
-
-    GenerationCache<TextLayoutCacheKey, sp<TextLayoutCacheValue> > mCache;
-
-    uint32_t mSize;
-    uint32_t mMaxSize;
-
-    uint32_t mCacheHitCount;
-    uint64_t mNanosecondsSaved;
-
-    uint64_t mCacheStartTime;
-
-    RtlDebugLevel mDebugLevel;
-    bool mDebugEnabled;
-
-    /*
-     * Class initialization
-     */
-    void init();
-
-    /**
-     * Dump Cache statistics
-     */
-    void dumpCacheStats();
-
-}; // TextLayoutCache
-
-/**
- * The TextLayoutEngine is responsible for shaping with Harfbuzz library
- */
-class TextLayoutEngine : public Singleton<TextLayoutEngine> {
-public:
-    TextLayoutEngine();
-    virtual ~TextLayoutEngine();
-
-    void computeValues(TextLayoutCacheValue* value, SkPaint* paint, const UChar* chars,
+    void computeValues(TextLayoutValue* value, const SkPaint* paint, const UChar* chars,
             size_t start, size_t count, size_t contextCount, int dirFlags);
 
 private:
@@ -273,14 +215,14 @@
      */
     UnicodeString mBuffer;
 
-    size_t shapeFontRun(SkPaint* paint, bool isRTL);
+    size_t shapeFontRun(const SkPaint* paint, bool isRTL);
 
-    void computeValues(SkPaint* paint, const UChar* chars,
+    void computeValues(const SkPaint* paint, const UChar* chars,
             size_t start, size_t count, size_t contextCount, int dirFlags,
             Vector<jfloat>* const outAdvances, jfloat* outTotalAdvance,
             Vector<jchar>* const outGlyphs);
 
-    void computeRunValues(SkPaint* paint, const UChar* chars,
+    void computeRunValues(const SkPaint* paint, const UChar* chars,
             size_t count, bool isRTL,
             Vector<jfloat>* const outAdvances, jfloat* outTotalAdvance,
             Vector<jchar>* const outGlyphs);
@@ -292,8 +234,80 @@
     void createShaperItemGlyphArrays(size_t size);
     void deleteShaperItemGlyphArrays();
 
-}; // TextLayoutEngine
+}; // TextLayoutShaper
 
+/**
+ * Cache of text layout information.
+ */
+class TextLayoutCache : private OnEntryRemoved<TextLayoutCacheKey, sp<TextLayoutValue> >
+{
+public:
+    TextLayoutCache(TextLayoutShaper* shaper);
+
+    ~TextLayoutCache();
+
+    bool isInitialized() {
+        return mInitialized;
+    }
+
+    /**
+     * Used as a callback when an entry is removed from the cache
+     * Do not invoke directly
+     */
+    void operator()(TextLayoutCacheKey& text, sp<TextLayoutValue>& desc);
+
+    sp<TextLayoutValue> getValue(const SkPaint* paint, const jchar* text, jint start,
+            jint count, jint contextCount, jint dirFlags);
+
+    /**
+     * Clear the cache
+     */
+    void clear();
+
+private:
+    TextLayoutShaper* mShaper;
+    Mutex mLock;
+    bool mInitialized;
+
+    GenerationCache<TextLayoutCacheKey, sp<TextLayoutValue> > mCache;
+
+    uint32_t mSize;
+    uint32_t mMaxSize;
+
+    uint32_t mCacheHitCount;
+    uint64_t mNanosecondsSaved;
+
+    uint64_t mCacheStartTime;
+
+    RtlDebugLevel mDebugLevel;
+    bool mDebugEnabled;
+
+    /*
+     * Class initialization
+     */
+    void init();
+
+    /**
+     * Dump Cache statistics
+     */
+    void dumpCacheStats();
+
+}; // TextLayoutCache
+
+/**
+ * The TextLayoutEngine is reponsible for computing TextLayoutValues
+ */
+class TextLayoutEngine : public Singleton<TextLayoutEngine> {
+public:
+    TextLayoutEngine();
+    virtual ~TextLayoutEngine();
+
+    sp<TextLayoutValue> getValue(const SkPaint* paint, const jchar* text, jint start,
+            jint count, jint contextCount, jint dirFlags);
+private:
+    TextLayoutCache* mTextLayoutCache;
+    TextLayoutShaper* mShaper;
+}; // TextLayoutEngine
 
 } // namespace android
 #endif /* ANDROID_TEXT_LAYOUT_CACHE_H */
diff --git a/core/jni/android_bluetooth_HeadsetBase.cpp b/core/jni/android_bluetooth_HeadsetBase.cpp
index a982182..0df211a 100644
--- a/core/jni/android_bluetooth_HeadsetBase.cpp
+++ b/core/jni/android_bluetooth_HeadsetBase.cpp
@@ -163,7 +163,7 @@
             bufit++;
     }
 
-    *bufit = NULL;
+    *bufit = 0;
 
     // According to ITU V.250 section 5.1, IA5 7 bit chars are used, 
     //   the eighth bit or higher bits are ignored if they exists
diff --git a/core/jni/android_database_CursorWindow.cpp b/core/jni/android_database_CursorWindow.cpp
index f927064..d53644d 100644
--- a/core/jni/android_database_CursorWindow.cpp
+++ b/core/jni/android_database_CursorWindow.cpp
@@ -31,8 +31,8 @@
 #include <unistd.h>
 
 #include "binder/CursorWindow.h"
-#include "sqlite3_exception.h"
 #include "android_util_Binder.h"
+#include "android_database_SQLiteCommon.h"
 
 namespace android {
 
@@ -59,14 +59,9 @@
 
 static jint nativeCreate(JNIEnv* env, jclass clazz, jstring nameObj, jint cursorWindowSize) {
     String8 name;
-    if (nameObj) {
-        const char* nameStr = env->GetStringUTFChars(nameObj, NULL);
-        name.setTo(nameStr);
-        env->ReleaseStringUTFChars(nameObj, nameStr);
-    }
-    if (name.size() == 0) {
-        name.setTo("<unnamed>");
-    }
+    const char* nameStr = env->GetStringUTFChars(nameObj, NULL);
+    name.setTo(nameStr);
+    env->ReleaseStringUTFChars(nameObj, nameStr);
 
     CursorWindow* window;
     status_t status = CursorWindow::create(name, cursorWindowSize, &window);
diff --git a/core/jni/android_database_SQLiteCommon.cpp b/core/jni/android_database_SQLiteCommon.cpp
new file mode 100644
index 0000000..3484467
--- /dev/null
+++ b/core/jni/android_database_SQLiteCommon.cpp
@@ -0,0 +1,139 @@
+/*
+ * 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.
+ */
+
+#include "android_database_SQLiteCommon.h"
+
+namespace android {
+
+/* throw a SQLiteException with a message appropriate for the error in handle */
+void throw_sqlite3_exception(JNIEnv* env, sqlite3* handle) {
+    throw_sqlite3_exception(env, handle, NULL);
+}
+
+/* throw a SQLiteException with the given message */
+void throw_sqlite3_exception(JNIEnv* env, const char* message) {
+    throw_sqlite3_exception(env, NULL, message);
+}
+
+/* throw a SQLiteException with a message appropriate for the error in handle
+   concatenated with the given message
+ */
+void throw_sqlite3_exception(JNIEnv* env, sqlite3* handle, const char* message) {
+    if (handle) {
+        throw_sqlite3_exception(env, sqlite3_errcode(handle),
+                                sqlite3_errmsg(handle), message);
+    } else {
+        // we use SQLITE_OK so that a generic SQLiteException is thrown;
+        // any code not specified in the switch statement below would do.
+        throw_sqlite3_exception(env, SQLITE_OK, "unknown error", message);
+    }
+}
+
+/* throw a SQLiteException for a given error code */
+void throw_sqlite3_exception_errcode(JNIEnv* env, int errcode, const char* message) {
+    if (errcode == SQLITE_DONE) {
+        throw_sqlite3_exception(env, errcode, NULL, message);
+    } else {
+        char temp[21];
+        sprintf(temp, "error code %d", errcode);
+        throw_sqlite3_exception(env, errcode, temp, message);
+    }
+}
+
+/* throw a SQLiteException for a given error code, sqlite3message, and
+   user message
+ */
+void throw_sqlite3_exception(JNIEnv* env, int errcode,
+                             const char* sqlite3Message, const char* message) {
+    const char* exceptionClass;
+    switch (errcode) {
+        case SQLITE_IOERR:
+            exceptionClass = "android/database/sqlite/SQLiteDiskIOException";
+            break;
+        case SQLITE_CORRUPT:
+        case SQLITE_NOTADB: // treat "unsupported file format" error as corruption also
+            exceptionClass = "android/database/sqlite/SQLiteDatabaseCorruptException";
+            break;
+        case SQLITE_CONSTRAINT:
+            exceptionClass = "android/database/sqlite/SQLiteConstraintException";
+            break;
+        case SQLITE_ABORT:
+            exceptionClass = "android/database/sqlite/SQLiteAbortException";
+            break;
+        case SQLITE_DONE:
+            exceptionClass = "android/database/sqlite/SQLiteDoneException";
+            break;
+        case SQLITE_FULL:
+            exceptionClass = "android/database/sqlite/SQLiteFullException";
+            break;
+        case SQLITE_MISUSE:
+            exceptionClass = "android/database/sqlite/SQLiteMisuseException";
+            break;
+        case SQLITE_PERM:
+            exceptionClass = "android/database/sqlite/SQLiteAccessPermException";
+            break;
+        case SQLITE_BUSY:
+            exceptionClass = "android/database/sqlite/SQLiteDatabaseLockedException";
+            break;
+        case SQLITE_LOCKED:
+            exceptionClass = "android/database/sqlite/SQLiteTableLockedException";
+            break;
+        case SQLITE_READONLY:
+            exceptionClass = "android/database/sqlite/SQLiteReadOnlyDatabaseException";
+            break;
+        case SQLITE_CANTOPEN:
+            exceptionClass = "android/database/sqlite/SQLiteCantOpenDatabaseException";
+            break;
+        case SQLITE_TOOBIG:
+            exceptionClass = "android/database/sqlite/SQLiteBlobTooBigException";
+            break;
+        case SQLITE_RANGE:
+            exceptionClass = "android/database/sqlite/SQLiteBindOrColumnIndexOutOfRangeException";
+            break;
+        case SQLITE_NOMEM:
+            exceptionClass = "android/database/sqlite/SQLiteOutOfMemoryException";
+            break;
+        case SQLITE_MISMATCH:
+            exceptionClass = "android/database/sqlite/SQLiteDatatypeMismatchException";
+            break;
+        case SQLITE_INTERRUPT:
+            exceptionClass = "android/content/OperationCanceledException";
+            break;
+        default:
+            exceptionClass = "android/database/sqlite/SQLiteException";
+            break;
+    }
+
+    if (sqlite3Message != NULL && message != NULL) {
+        char* fullMessage = (char *)malloc(strlen(sqlite3Message) + strlen(message) + 3);
+        if (fullMessage != NULL) {
+            strcpy(fullMessage, sqlite3Message);
+            strcat(fullMessage, ": ");
+            strcat(fullMessage, message);
+            jniThrowException(env, exceptionClass, fullMessage);
+            free(fullMessage);
+        } else {
+            jniThrowException(env, exceptionClass, sqlite3Message);
+        }
+    } else if (sqlite3Message != NULL) {
+        jniThrowException(env, exceptionClass, sqlite3Message);
+    } else {
+        jniThrowException(env, exceptionClass, message);
+    }
+}
+
+
+} // namespace android
diff --git a/core/jni/android_database_SQLiteCommon.h b/core/jni/android_database_SQLiteCommon.h
new file mode 100644
index 0000000..0cac176
--- /dev/null
+++ b/core/jni/android_database_SQLiteCommon.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2007 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.
+ */
+
+#ifndef _ANDROID_DATABASE_SQLITE_COMMON_H
+#define _ANDROID_DATABASE_SQLITE_COMMON_H
+
+#include <jni.h>
+#include <JNIHelp.h>
+
+#include <sqlite3.h>
+
+// Special log tags defined in SQLiteDebug.java.
+#define SQLITE_LOG_TAG "SQLiteLog"
+#define SQLITE_TRACE_TAG "SQLiteStatements"
+#define SQLITE_PROFILE_TAG "SQLiteTime"
+
+namespace android {
+
+/* throw a SQLiteException with a message appropriate for the error in handle */
+void throw_sqlite3_exception(JNIEnv* env, sqlite3* handle);
+
+/* throw a SQLiteException with the given message */
+void throw_sqlite3_exception(JNIEnv* env, const char* message);
+
+/* throw a SQLiteException with a message appropriate for the error in handle
+   concatenated with the given message
+ */
+void throw_sqlite3_exception(JNIEnv* env, sqlite3* handle, const char* message);
+
+/* throw a SQLiteException for a given error code */
+void throw_sqlite3_exception_errcode(JNIEnv* env, int errcode, const char* message);
+
+void throw_sqlite3_exception(JNIEnv* env, int errcode,
+        const char* sqlite3Message, const char* message);
+
+}
+
+#endif // _ANDROID_DATABASE_SQLITE_COMMON_H
diff --git a/core/jni/android_database_SQLiteCompiledSql.cpp b/core/jni/android_database_SQLiteCompiledSql.cpp
deleted file mode 100644
index 857267a..0000000
--- a/core/jni/android_database_SQLiteCompiledSql.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (C) 2006-2008 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.
- */
-
-#undef LOG_TAG
-#define LOG_TAG "Cursor"
-
-#include <jni.h>
-#include <JNIHelp.h>
-#include <android_runtime/AndroidRuntime.h>
-
-#include <sqlite3.h>
-
-#include <utils/Log.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "sqlite3_exception.h"
-
-
-namespace android {
-
-static jfieldID gHandleField;
-static jfieldID gStatementField;
-
-
-#define GET_STATEMENT(env, object) \
-        (sqlite3_stmt *)env->GetIntField(object, gStatementField)
-#define GET_HANDLE(env, object) \
-        (sqlite3 *)env->GetIntField(object, gHandleField)
-
-
-sqlite3_stmt * compile(JNIEnv* env, jobject object,
-                       sqlite3 * handle, jstring sqlString)
-{
-    int err;
-    jchar const * sql;
-    jsize sqlLen;
-    sqlite3_stmt * statement = GET_STATEMENT(env, object);
-
-    // Make sure not to leak the statement if it already exists
-    if (statement != NULL) {
-        sqlite3_finalize(statement);
-        env->SetIntField(object, gStatementField, 0);
-    }
-
-    // Compile the SQL
-    sql = env->GetStringChars(sqlString, NULL);
-    sqlLen = env->GetStringLength(sqlString);
-    err = sqlite3_prepare16_v2(handle, sql, sqlLen * 2, &statement, NULL);
-    env->ReleaseStringChars(sqlString, sql);
-
-    if (err == SQLITE_OK) {
-        // Store the statement in the Java object for future calls
-        ALOGV("Prepared statement %p on %p", statement, handle);
-        env->SetIntField(object, gStatementField, (int)statement);
-        return statement;
-    } else {
-        // Error messages like 'near ")": syntax error' are not
-        // always helpful enough, so construct an error string that
-        // includes the query itself.
-        const char *query = env->GetStringUTFChars(sqlString, NULL);
-        char *message = (char*) malloc(strlen(query) + 50);
-        if (message) {
-            strcpy(message, ", while compiling: "); // less than 50 chars
-            strcat(message, query);
-        }
-        env->ReleaseStringUTFChars(sqlString, query);
-        throw_sqlite3_exception(env, handle, message);
-        free(message);
-        return NULL;
-    }
-}
-
-static void native_compile(JNIEnv* env, jobject object, jstring sqlString)
-{
-    compile(env, object, GET_HANDLE(env, object), sqlString);
-}
-
-
-static JNINativeMethod sMethods[] =
-{
-     /* name, signature, funcPtr */
-    {"native_compile", "(Ljava/lang/String;)V", (void *)native_compile},
-};
-
-int register_android_database_SQLiteCompiledSql(JNIEnv * env)
-{
-    jclass clazz;
-
-    clazz = env->FindClass("android/database/sqlite/SQLiteCompiledSql");
-    if (clazz == NULL) {
-        ALOGE("Can't find android/database/sqlite/SQLiteCompiledSql");
-        return -1;
-    }
-
-    gHandleField = env->GetFieldID(clazz, "nHandle", "I");
-    gStatementField = env->GetFieldID(clazz, "nStatement", "I");
-
-    if (gHandleField == NULL || gStatementField == NULL) {
-        ALOGE("Error locating fields");
-        return -1;
-    }
-
-    return AndroidRuntime::registerNativeMethods(env,
-        "android/database/sqlite/SQLiteCompiledSql", sMethods, NELEM(sMethods));
-}
-
-} // namespace android
diff --git a/core/jni/android_database_SQLiteConnection.cpp b/core/jni/android_database_SQLiteConnection.cpp
new file mode 100644
index 0000000..e061ac3
--- /dev/null
+++ b/core/jni/android_database_SQLiteConnection.cpp
@@ -0,0 +1,989 @@
+/*
+ * 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.
+ */
+
+#define LOG_TAG "SQLiteConnection"
+
+#include <jni.h>
+#include <JNIHelp.h>
+#include <android_runtime/AndroidRuntime.h>
+
+#include <utils/Log.h>
+#include <utils/String8.h>
+#include <utils/String16.h>
+#include <cutils/ashmem.h>
+#include <sys/mman.h>
+
+#include <string.h>
+#include <unistd.h>
+
+#include "binder/CursorWindow.h"
+
+#include <sqlite3.h>
+#include <sqlite3_android.h>
+
+#include "android_database_SQLiteCommon.h"
+
+#define UTF16_STORAGE 0
+#define ANDROID_TABLE "android_metadata"
+
+namespace android {
+
+static struct {
+    jfieldID name;
+    jfieldID numArgs;
+    jmethodID dispatchCallback;
+} gSQLiteCustomFunctionClassInfo;
+
+static struct {
+    jclass clazz;
+} gStringClassInfo;
+
+struct SQLiteConnection {
+    // Open flags.
+    // Must be kept in sync with the constants defined in SQLiteDatabase.java.
+    enum {
+        OPEN_READWRITE          = 0x00000000,
+        OPEN_READONLY           = 0x00000001,
+        OPEN_READ_MASK          = 0x00000001,
+        NO_LOCALIZED_COLLATORS  = 0x00000010,
+        CREATE_IF_NECESSARY     = 0x10000000,
+    };
+
+    sqlite3* const db;
+    const int openFlags;
+    const String8 path;
+    const String8 label;
+
+    volatile bool canceled;
+
+    SQLiteConnection(sqlite3* db, int openFlags, const String8& path, const String8& label) :
+        db(db), openFlags(openFlags), path(path), label(label), canceled(false) { }
+};
+
+// Called each time a statement begins execution, when tracing is enabled.
+static void sqliteTraceCallback(void *data, const char *sql) {
+    SQLiteConnection* connection = static_cast<SQLiteConnection*>(data);
+    ALOG(LOG_VERBOSE, SQLITE_TRACE_TAG, "%s: \"%s\"\n",
+            connection->label.string(), sql);
+}
+
+// Called each time a statement finishes execution, when profiling is enabled.
+static void sqliteProfileCallback(void *data, const char *sql, sqlite3_uint64 tm) {
+    SQLiteConnection* connection = static_cast<SQLiteConnection*>(data);
+    ALOG(LOG_VERBOSE, SQLITE_PROFILE_TAG, "%s: \"%s\" took %0.3f ms\n",
+            connection->label.string(), sql, tm * 0.000001f);
+}
+
+// Called after each SQLite VM instruction when cancelation is enabled.
+static int sqliteProgressHandlerCallback(void* data) {
+    SQLiteConnection* connection = static_cast<SQLiteConnection*>(data);
+    return connection->canceled;
+}
+
+
+static jint nativeOpen(JNIEnv* env, jclass clazz, jstring pathStr, jint openFlags,
+        jstring labelStr, jboolean enableTrace, jboolean enableProfile) {
+    int sqliteFlags;
+    if (openFlags & SQLiteConnection::CREATE_IF_NECESSARY) {
+        sqliteFlags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE;
+    } else if (openFlags & SQLiteConnection::OPEN_READONLY) {
+        sqliteFlags = SQLITE_OPEN_READONLY;
+    } else {
+        sqliteFlags = SQLITE_OPEN_READWRITE;
+    }
+
+    const char* pathChars = env->GetStringUTFChars(pathStr, NULL);
+    String8 path(pathChars);
+    env->ReleaseStringUTFChars(pathStr, pathChars);
+
+    const char* labelChars = env->GetStringUTFChars(labelStr, NULL);
+    String8 label(labelChars);
+    env->ReleaseStringUTFChars(labelStr, labelChars);
+
+    sqlite3* db;
+    int err = sqlite3_open_v2(path.string(), &db, sqliteFlags, NULL);
+    if (err != SQLITE_OK) {
+        throw_sqlite3_exception_errcode(env, err, "Could not open database");
+        return 0;
+    }
+
+    // Set the default busy handler to retry for 1000ms and then return SQLITE_BUSY
+    err = sqlite3_busy_timeout(db, 1000 /* ms */);
+    if (err != SQLITE_OK) {
+        throw_sqlite3_exception(env, db, "Could not set busy timeout");
+        sqlite3_close(db);
+        return 0;
+    }
+
+    // Enable WAL auto-checkpointing after a commit whenever at least one frame is in the log.
+    // This ensures that a checkpoint will occur after each transaction if needed.
+    err = sqlite3_wal_autocheckpoint(db, 1);
+    if (err) {
+        throw_sqlite3_exception(env, db, "Could not enable auto-checkpointing.");
+        sqlite3_close(db);
+        return 0;
+    }
+
+    // Register custom Android functions.
+    err = register_android_functions(db, UTF16_STORAGE);
+    if (err) {
+        throw_sqlite3_exception(env, db, "Could not register Android SQL functions.");
+        sqlite3_close(db);
+        return 0;
+    }
+
+    // Create wrapper object.
+    SQLiteConnection* connection = new SQLiteConnection(db, openFlags, path, label);
+
+    // Enable tracing and profiling if requested.
+    if (enableTrace) {
+        sqlite3_trace(db, &sqliteTraceCallback, connection);
+    }
+    if (enableProfile) {
+        sqlite3_profile(db, &sqliteProfileCallback, connection);
+    }
+
+    ALOGV("Opened connection %p with label '%s'", db, label.string());
+    return reinterpret_cast<jint>(connection);
+}
+
+static void nativeClose(JNIEnv* env, jclass clazz, jint connectionPtr) {
+    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
+
+    if (connection) {
+        ALOGV("Closing connection %p", connection->db);
+        int err = sqlite3_close(connection->db);
+        if (err != SQLITE_OK) {
+            // This can happen if sub-objects aren't closed first.  Make sure the caller knows.
+            ALOGE("sqlite3_close(%p) failed: %d", connection->db, err);
+            throw_sqlite3_exception(env, connection->db, "Count not close db.");
+            return;
+        }
+
+        delete connection;
+    }
+}
+
+// Called each time a custom function is evaluated.
+static void sqliteCustomFunctionCallback(sqlite3_context *context,
+        int argc, sqlite3_value **argv) {
+    JNIEnv* env = AndroidRuntime::getJNIEnv();
+
+    // Get the callback function object.
+    // Create a new local reference to it in case the callback tries to do something
+    // dumb like unregister the function (thereby destroying the global ref) while it is running.
+    jobject functionObjGlobal = reinterpret_cast<jobject>(sqlite3_user_data(context));
+    jobject functionObj = env->NewLocalRef(functionObjGlobal);
+
+    jobjectArray argsArray = env->NewObjectArray(argc, gStringClassInfo.clazz, NULL);
+    if (argsArray) {
+        for (int i = 0; i < argc; i++) {
+            const jchar* arg = static_cast<const jchar*>(sqlite3_value_text16(argv[i]));
+            if (!arg) {
+                ALOGW("NULL argument in custom_function_callback.  This should not happen.");
+            } else {
+                size_t argLen = sqlite3_value_bytes16(argv[i]) / sizeof(jchar);
+                jstring argStr = env->NewString(arg, argLen);
+                if (!argStr) {
+                    goto error; // out of memory error
+                }
+                env->SetObjectArrayElement(argsArray, i, argStr);
+                env->DeleteLocalRef(argStr);
+            }
+        }
+
+        // TODO: Support functions that return values.
+        env->CallVoidMethod(functionObj,
+                gSQLiteCustomFunctionClassInfo.dispatchCallback, argsArray);
+
+error:
+        env->DeleteLocalRef(argsArray);
+    }
+
+    env->DeleteLocalRef(functionObj);
+
+    if (env->ExceptionCheck()) {
+        ALOGE("An exception was thrown by custom SQLite function.");
+        LOGE_EX(env);
+        env->ExceptionClear();
+    }
+}
+
+// Called when a custom function is destroyed.
+static void sqliteCustomFunctionDestructor(void* data) {
+    jobject functionObjGlobal = reinterpret_cast<jobject>(data);
+
+    JNIEnv* env = AndroidRuntime::getJNIEnv();
+    env->DeleteGlobalRef(functionObjGlobal);
+}
+
+static void nativeRegisterCustomFunction(JNIEnv* env, jclass clazz, jint connectionPtr,
+        jobject functionObj) {
+    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
+
+    jstring nameStr = jstring(env->GetObjectField(
+            functionObj, gSQLiteCustomFunctionClassInfo.name));
+    jint numArgs = env->GetIntField(functionObj, gSQLiteCustomFunctionClassInfo.numArgs);
+
+    jobject functionObjGlobal = env->NewGlobalRef(functionObj);
+
+    const char* name = env->GetStringUTFChars(nameStr, NULL);
+    int err = sqlite3_create_function_v2(connection->db, name, numArgs, SQLITE_UTF16,
+            reinterpret_cast<void*>(functionObjGlobal),
+            &sqliteCustomFunctionCallback, NULL, NULL, &sqliteCustomFunctionDestructor);
+    env->ReleaseStringUTFChars(nameStr, name);
+
+    if (err != SQLITE_OK) {
+        ALOGE("sqlite3_create_function returned %d", err);
+        env->DeleteGlobalRef(functionObjGlobal);
+        throw_sqlite3_exception(env, connection->db);
+        return;
+    }
+}
+
+// Set locale in the android_metadata table, install localized collators, and rebuild indexes
+static void nativeSetLocale(JNIEnv* env, jclass clazz, jint connectionPtr, jstring localeStr) {
+    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
+
+    if (connection->openFlags & SQLiteConnection::NO_LOCALIZED_COLLATORS) {
+        // We should probably throw IllegalStateException but the contract for
+        // setLocale says that we just do nothing.  Oh well.
+        return;
+    }
+
+    int err;
+    char const* locale = env->GetStringUTFChars(localeStr, NULL);
+    sqlite3_stmt* stmt = NULL;
+    char** meta = NULL;
+    int rowCount, colCount;
+    char* dbLocale = NULL;
+
+    // create the table, if necessary and possible
+    if (!(connection->openFlags & SQLiteConnection::OPEN_READONLY)) {
+        err = sqlite3_exec(connection->db,
+                "CREATE TABLE IF NOT EXISTS " ANDROID_TABLE " (locale TEXT)",
+                NULL, NULL, NULL);
+        if (err != SQLITE_OK) {
+            ALOGE("CREATE TABLE " ANDROID_TABLE " failed");
+            throw_sqlite3_exception(env, connection->db);
+            goto done;
+        }
+    }
+
+    // try to read from the table
+    err = sqlite3_get_table(connection->db,
+            "SELECT locale FROM " ANDROID_TABLE " LIMIT 1",
+            &meta, &rowCount, &colCount, NULL);
+    if (err != SQLITE_OK) {
+        ALOGE("SELECT locale FROM " ANDROID_TABLE " failed");
+        throw_sqlite3_exception(env, connection->db);
+        goto done;
+    }
+
+    dbLocale = (rowCount >= 1) ? meta[colCount] : NULL;
+
+    if (dbLocale != NULL && !strcmp(dbLocale, locale)) {
+        // database locale is the same as the desired locale; set up the collators and go
+        err = register_localized_collators(connection->db, locale, UTF16_STORAGE);
+        if (err != SQLITE_OK) {
+            throw_sqlite3_exception(env, connection->db);
+        }
+        goto done;   // no database changes needed
+    }
+
+    if (connection->openFlags & SQLiteConnection::OPEN_READONLY) {
+        // read-only database, so we're going to have to put up with whatever we got
+        // For registering new index. Not for modifing the read-only database.
+        err = register_localized_collators(connection->db, locale, UTF16_STORAGE);
+        if (err != SQLITE_OK) {
+            throw_sqlite3_exception(env, connection->db);
+        }
+        goto done;
+    }
+
+    // need to update android_metadata and indexes atomically, so use a transaction...
+    err = sqlite3_exec(connection->db, "BEGIN TRANSACTION", NULL, NULL, NULL);
+    if (err != SQLITE_OK) {
+        ALOGE("BEGIN TRANSACTION failed setting locale");
+        throw_sqlite3_exception(env, connection->db);
+        goto done;
+    }
+
+    err = register_localized_collators(connection->db, locale, UTF16_STORAGE);
+    if (err != SQLITE_OK) {
+        ALOGE("register_localized_collators() failed setting locale");
+        throw_sqlite3_exception(env, connection->db);
+        goto rollback;
+    }
+
+    err = sqlite3_exec(connection->db, "DELETE FROM " ANDROID_TABLE, NULL, NULL, NULL);
+    if (err != SQLITE_OK) {
+        ALOGE("DELETE failed setting locale");
+        throw_sqlite3_exception(env, connection->db);
+        goto rollback;
+    }
+
+    static const char *sql = "INSERT INTO " ANDROID_TABLE " (locale) VALUES(?);";
+    err = sqlite3_prepare_v2(connection->db, sql, -1, &stmt, NULL);
+    if (err != SQLITE_OK) {
+        ALOGE("sqlite3_prepare_v2(\"%s\") failed", sql);
+        throw_sqlite3_exception(env, connection->db);
+        goto rollback;
+    }
+
+    err = sqlite3_bind_text(stmt, 1, locale, -1, SQLITE_TRANSIENT);
+    if (err != SQLITE_OK) {
+        ALOGE("sqlite3_bind_text() failed setting locale");
+        throw_sqlite3_exception(env, connection->db);
+        goto rollback;
+    }
+
+    err = sqlite3_step(stmt);
+    if (err != SQLITE_OK && err != SQLITE_DONE) {
+        ALOGE("sqlite3_step(\"%s\") failed setting locale", sql);
+        throw_sqlite3_exception(env, connection->db);
+        goto rollback;
+    }
+
+    err = sqlite3_exec(connection->db, "REINDEX LOCALIZED", NULL, NULL, NULL);
+    if (err != SQLITE_OK) {
+        ALOGE("REINDEX LOCALIZED failed");
+        throw_sqlite3_exception(env, connection->db);
+        goto rollback;
+    }
+
+    // all done, yay!
+    err = sqlite3_exec(connection->db, "COMMIT TRANSACTION", NULL, NULL, NULL);
+    if (err != SQLITE_OK) {
+        ALOGE("COMMIT TRANSACTION failed setting locale");
+        throw_sqlite3_exception(env, connection->db);
+        goto done;
+    }
+
+rollback:
+    if (err != SQLITE_OK) {
+        sqlite3_exec(connection->db, "ROLLBACK TRANSACTION", NULL, NULL, NULL);
+    }
+
+done:
+    if (stmt) {
+        sqlite3_finalize(stmt);
+    }
+    if (meta) {
+        sqlite3_free_table(meta);
+    }
+    if (locale) {
+        env->ReleaseStringUTFChars(localeStr, locale);
+    }
+}
+
+static jint nativePrepareStatement(JNIEnv* env, jclass clazz, jint connectionPtr,
+        jstring sqlString) {
+    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
+
+    jsize sqlLength = env->GetStringLength(sqlString);
+    const jchar* sql = env->GetStringCritical(sqlString, NULL);
+    sqlite3_stmt* statement;
+    int err = sqlite3_prepare16_v2(connection->db,
+            sql, sqlLength * sizeof(jchar), &statement, NULL);
+    env->ReleaseStringCritical(sqlString, sql);
+
+    if (err != SQLITE_OK) {
+        // Error messages like 'near ")": syntax error' are not
+        // always helpful enough, so construct an error string that
+        // includes the query itself.
+        const char *query = env->GetStringUTFChars(sqlString, NULL);
+        char *message = (char*) malloc(strlen(query) + 50);
+        if (message) {
+            strcpy(message, ", while compiling: "); // less than 50 chars
+            strcat(message, query);
+        }
+        env->ReleaseStringUTFChars(sqlString, query);
+        throw_sqlite3_exception(env, connection->db, message);
+        free(message);
+        return 0;
+    }
+
+    ALOGV("Prepared statement %p on connection %p", statement, connection->db);
+    return reinterpret_cast<jint>(statement);
+}
+
+static void nativeFinalizeStatement(JNIEnv* env, jclass clazz, jint connectionPtr,
+        jint statementPtr) {
+    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
+    sqlite3_stmt* statement = reinterpret_cast<sqlite3_stmt*>(statementPtr);
+
+    ALOGV("Finalized statement %p on connection %p", statement, connection->db);
+    int err = sqlite3_finalize(statement);
+    if (err != SQLITE_OK) {
+        throw_sqlite3_exception(env, connection->db, NULL);
+    }
+}
+
+static jint nativeGetParameterCount(JNIEnv* env, jclass clazz, jint connectionPtr,
+        jint statementPtr) {
+    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
+    sqlite3_stmt* statement = reinterpret_cast<sqlite3_stmt*>(statementPtr);
+
+    return sqlite3_bind_parameter_count(statement);
+}
+
+static jboolean nativeIsReadOnly(JNIEnv* env, jclass clazz, jint connectionPtr,
+        jint statementPtr) {
+    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
+    sqlite3_stmt* statement = reinterpret_cast<sqlite3_stmt*>(statementPtr);
+
+    return sqlite3_stmt_readonly(statement) != 0;
+}
+
+static jint nativeGetColumnCount(JNIEnv* env, jclass clazz, jint connectionPtr,
+        jint statementPtr) {
+    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
+    sqlite3_stmt* statement = reinterpret_cast<sqlite3_stmt*>(statementPtr);
+
+    return sqlite3_column_count(statement);
+}
+
+static jstring nativeGetColumnName(JNIEnv* env, jclass clazz, jint connectionPtr,
+        jint statementPtr, jint index) {
+    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
+    sqlite3_stmt* statement = reinterpret_cast<sqlite3_stmt*>(statementPtr);
+
+    const jchar* name = static_cast<const jchar*>(sqlite3_column_name16(statement, index));
+    if (name) {
+        size_t length = 0;
+        while (name[length]) {
+            length += 1;
+        }
+        return env->NewString(name, length);
+    }
+    return NULL;
+}
+
+static void nativeBindNull(JNIEnv* env, jclass clazz, jint connectionPtr,
+        jint statementPtr, jint index) {
+    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
+    sqlite3_stmt* statement = reinterpret_cast<sqlite3_stmt*>(statementPtr);
+
+    int err = sqlite3_bind_null(statement, index);
+    if (err != SQLITE_OK) {
+        throw_sqlite3_exception(env, connection->db, NULL);
+    }
+}
+
+static void nativeBindLong(JNIEnv* env, jclass clazz, jint connectionPtr,
+        jint statementPtr, jint index, jlong value) {
+    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
+    sqlite3_stmt* statement = reinterpret_cast<sqlite3_stmt*>(statementPtr);
+
+    int err = sqlite3_bind_int64(statement, index, value);
+    if (err != SQLITE_OK) {
+        throw_sqlite3_exception(env, connection->db, NULL);
+    }
+}
+
+static void nativeBindDouble(JNIEnv* env, jclass clazz, jint connectionPtr,
+        jint statementPtr, jint index, jdouble value) {
+    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
+    sqlite3_stmt* statement = reinterpret_cast<sqlite3_stmt*>(statementPtr);
+
+    int err = sqlite3_bind_double(statement, index, value);
+    if (err != SQLITE_OK) {
+        throw_sqlite3_exception(env, connection->db, NULL);
+    }
+}
+
+static void nativeBindString(JNIEnv* env, jclass clazz, jint connectionPtr,
+        jint statementPtr, jint index, jstring valueString) {
+    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
+    sqlite3_stmt* statement = reinterpret_cast<sqlite3_stmt*>(statementPtr);
+
+    jsize valueLength = env->GetStringLength(valueString);
+    const jchar* value = env->GetStringCritical(valueString, NULL);
+    int err = sqlite3_bind_text16(statement, index, value, valueLength * sizeof(jchar),
+            SQLITE_TRANSIENT);
+    env->ReleaseStringCritical(valueString, value);
+    if (err != SQLITE_OK) {
+        throw_sqlite3_exception(env, connection->db, NULL);
+    }
+}
+
+static void nativeBindBlob(JNIEnv* env, jclass clazz, jint connectionPtr,
+        jint statementPtr, jint index, jbyteArray valueArray) {
+    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
+    sqlite3_stmt* statement = reinterpret_cast<sqlite3_stmt*>(statementPtr);
+
+    jsize valueLength = env->GetArrayLength(valueArray);
+    jbyte* value = static_cast<jbyte*>(env->GetPrimitiveArrayCritical(valueArray, NULL));
+    int err = sqlite3_bind_blob(statement, index, value, valueLength, SQLITE_TRANSIENT);
+    env->ReleasePrimitiveArrayCritical(valueArray, value, JNI_ABORT);
+    if (err != SQLITE_OK) {
+        throw_sqlite3_exception(env, connection->db, NULL);
+    }
+}
+
+static void nativeResetStatementAndClearBindings(JNIEnv* env, jclass clazz, jint connectionPtr,
+        jint statementPtr) {
+    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
+    sqlite3_stmt* statement = reinterpret_cast<sqlite3_stmt*>(statementPtr);
+
+    int err = sqlite3_reset(statement);
+    if (err == SQLITE_OK) {
+        err = sqlite3_clear_bindings(statement);
+    }
+    if (err != SQLITE_OK) {
+        throw_sqlite3_exception(env, connection->db, NULL);
+    }
+}
+
+static int executeNonQuery(JNIEnv* env, SQLiteConnection* connection, sqlite3_stmt* statement) {
+    int err = sqlite3_step(statement);
+    if (err == SQLITE_ROW) {
+        throw_sqlite3_exception(env,
+                "Queries can be performed using SQLiteDatabase query or rawQuery methods only.");
+    } else if (err != SQLITE_DONE) {
+        throw_sqlite3_exception_errcode(env, err, sqlite3_errmsg(connection->db));
+    }
+    return err;
+}
+
+static void nativeExecute(JNIEnv* env, jclass clazz, jint connectionPtr,
+        jint statementPtr) {
+    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
+    sqlite3_stmt* statement = reinterpret_cast<sqlite3_stmt*>(statementPtr);
+
+    executeNonQuery(env, connection, statement);
+}
+
+static jint nativeExecuteForChangedRowCount(JNIEnv* env, jclass clazz,
+        jint connectionPtr, jint statementPtr) {
+    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
+    sqlite3_stmt* statement = reinterpret_cast<sqlite3_stmt*>(statementPtr);
+
+    int err = executeNonQuery(env, connection, statement);
+    return err == SQLITE_DONE ? sqlite3_changes(connection->db) : -1;
+}
+
+static jlong nativeExecuteForLastInsertedRowId(JNIEnv* env, jclass clazz,
+        jint connectionPtr, jint statementPtr) {
+    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
+    sqlite3_stmt* statement = reinterpret_cast<sqlite3_stmt*>(statementPtr);
+
+    int err = executeNonQuery(env, connection, statement);
+    return err == SQLITE_DONE && sqlite3_changes(connection->db) > 0
+            ? sqlite3_last_insert_rowid(connection->db) : -1;
+}
+
+static int executeOneRowQuery(JNIEnv* env, SQLiteConnection* connection, sqlite3_stmt* statement) {
+    int err = sqlite3_step(statement);
+    if (err != SQLITE_ROW) {
+        throw_sqlite3_exception_errcode(env, err, sqlite3_errmsg(connection->db));
+    }
+    return err;
+}
+
+static jlong nativeExecuteForLong(JNIEnv* env, jclass clazz,
+        jint connectionPtr, jint statementPtr) {
+    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
+    sqlite3_stmt* statement = reinterpret_cast<sqlite3_stmt*>(statementPtr);
+
+    int err = executeOneRowQuery(env, connection, statement);
+    if (err == SQLITE_ROW && sqlite3_column_count(statement) >= 1) {
+        return sqlite3_column_int64(statement, 0);
+    }
+    return -1;
+}
+
+static jstring nativeExecuteForString(JNIEnv* env, jclass clazz,
+        jint connectionPtr, jint statementPtr) {
+    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
+    sqlite3_stmt* statement = reinterpret_cast<sqlite3_stmt*>(statementPtr);
+
+    int err = executeOneRowQuery(env, connection, statement);
+    if (err == SQLITE_ROW && sqlite3_column_count(statement) >= 1) {
+        const jchar* text = static_cast<const jchar*>(sqlite3_column_text16(statement, 0));
+        if (text) {
+            size_t length = sqlite3_column_bytes16(statement, 0) / sizeof(jchar);
+            return env->NewString(text, length);
+        }
+    }
+    return NULL;
+}
+
+static int createAshmemRegionWithData(JNIEnv* env, const void* data, size_t length) {
+    int error = 0;
+    int fd = ashmem_create_region(NULL, length);
+    if (fd < 0) {
+        error = errno;
+        ALOGE("ashmem_create_region failed: %s", strerror(error));
+    } else {
+        if (length > 0) {
+            void* ptr = mmap(NULL, length, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+            if (ptr == MAP_FAILED) {
+                error = errno;
+                ALOGE("mmap failed: %s", strerror(error));
+            } else {
+                memcpy(ptr, data, length);
+                munmap(ptr, length);
+            }
+        }
+
+        if (!error) {
+            if (ashmem_set_prot_region(fd, PROT_READ) < 0) {
+                error = errno;
+                ALOGE("ashmem_set_prot_region failed: %s", strerror(errno));
+            } else {
+                return fd;
+            }
+        }
+
+        close(fd);
+    }
+
+    jniThrowIOException(env, error);
+    return -1;
+}
+
+static jint nativeExecuteForBlobFileDescriptor(JNIEnv* env, jclass clazz,
+        jint connectionPtr, jint statementPtr) {
+    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
+    sqlite3_stmt* statement = reinterpret_cast<sqlite3_stmt*>(statementPtr);
+
+    int err = executeOneRowQuery(env, connection, statement);
+    if (err == SQLITE_ROW && sqlite3_column_count(statement) >= 1) {
+        const void* blob = sqlite3_column_blob(statement, 0);
+        if (blob) {
+            int length = sqlite3_column_bytes(statement, 0);
+            if (length >= 0) {
+                return createAshmemRegionWithData(env, blob, length);
+            }
+        }
+    }
+    return -1;
+}
+
+enum CopyRowResult {
+    CPR_OK,
+    CPR_FULL,
+    CPR_ERROR,
+};
+
+static CopyRowResult copyRow(JNIEnv* env, CursorWindow* window,
+        sqlite3_stmt* statement, int numColumns, int startPos, int addedRows) {
+    // Allocate a new field directory for the row.
+    status_t status = window->allocRow();
+    if (status) {
+        LOG_WINDOW("Failed allocating fieldDir at startPos %d row %d, error=%d",
+                startPos, addedRows, status);
+        return CPR_FULL;
+    }
+
+    // Pack the row into the window.
+    CopyRowResult result = CPR_OK;
+    for (int i = 0; i < numColumns; i++) {
+        int type = sqlite3_column_type(statement, i);
+        if (type == SQLITE_TEXT) {
+            // TEXT data
+            const char* text = reinterpret_cast<const char*>(
+                    sqlite3_column_text(statement, i));
+            // SQLite does not include the NULL terminator in size, but does
+            // ensure all strings are NULL terminated, so increase size by
+            // one to make sure we store the terminator.
+            size_t sizeIncludingNull = sqlite3_column_bytes(statement, i) + 1;
+            status = window->putString(addedRows, i, text, sizeIncludingNull);
+            if (status) {
+                LOG_WINDOW("Failed allocating %u bytes for text at %d,%d, error=%d",
+                        sizeIncludingNull, startPos + addedRows, i, status);
+                result = CPR_FULL;
+                break;
+            }
+            LOG_WINDOW("%d,%d is TEXT with %u bytes",
+                    startPos + addedRows, i, sizeIncludingNull);
+        } else if (type == SQLITE_INTEGER) {
+            // INTEGER data
+            int64_t value = sqlite3_column_int64(statement, i);
+            status = window->putLong(addedRows, i, value);
+            if (status) {
+                LOG_WINDOW("Failed allocating space for a long in column %d, error=%d",
+                        i, status);
+                result = CPR_FULL;
+                break;
+            }
+            LOG_WINDOW("%d,%d is INTEGER 0x%016llx", startPos + addedRows, i, value);
+        } else if (type == SQLITE_FLOAT) {
+            // FLOAT data
+            double value = sqlite3_column_double(statement, i);
+            status = window->putDouble(addedRows, i, value);
+            if (status) {
+                LOG_WINDOW("Failed allocating space for a double in column %d, error=%d",
+                        i, status);
+                result = CPR_FULL;
+                break;
+            }
+            LOG_WINDOW("%d,%d is FLOAT %lf", startPos + addedRows, i, value);
+        } else if (type == SQLITE_BLOB) {
+            // BLOB data
+            const void* blob = sqlite3_column_blob(statement, i);
+            size_t size = sqlite3_column_bytes(statement, i);
+            status = window->putBlob(addedRows, i, blob, size);
+            if (status) {
+                LOG_WINDOW("Failed allocating %u bytes for blob at %d,%d, error=%d",
+                        size, startPos + addedRows, i, status);
+                result = CPR_FULL;
+                break;
+            }
+            LOG_WINDOW("%d,%d is Blob with %u bytes",
+                    startPos + addedRows, i, size);
+        } else if (type == SQLITE_NULL) {
+            // NULL field
+            status = window->putNull(addedRows, i);
+            if (status) {
+                LOG_WINDOW("Failed allocating space for a null in column %d, error=%d",
+                        i, status);
+                result = CPR_FULL;
+                break;
+            }
+
+            LOG_WINDOW("%d,%d is NULL", startPos + addedRows, i);
+        } else {
+            // Unknown data
+            ALOGE("Unknown column type when filling database window");
+            throw_sqlite3_exception(env, "Unknown column type when filling window");
+            result = CPR_ERROR;
+            break;
+        }
+    }
+
+    // Free the last row if if was not successfully copied.
+    if (result != CPR_OK) {
+        window->freeLastRow();
+    }
+    return result;
+}
+
+static jlong nativeExecuteForCursorWindow(JNIEnv* env, jclass clazz,
+        jint connectionPtr, jint statementPtr, jint windowPtr,
+        jint startPos, jint requiredPos, jboolean countAllRows) {
+    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
+    sqlite3_stmt* statement = reinterpret_cast<sqlite3_stmt*>(statementPtr);
+    CursorWindow* window = reinterpret_cast<CursorWindow*>(windowPtr);
+
+    status_t status = window->clear();
+    if (status) {
+        String8 msg;
+        msg.appendFormat("Failed to clear the cursor window, status=%d", status);
+        throw_sqlite3_exception(env, connection->db, msg.string());
+        return 0;
+    }
+
+    int numColumns = sqlite3_column_count(statement);
+    status = window->setNumColumns(numColumns);
+    if (status) {
+        String8 msg;
+        msg.appendFormat("Failed to set the cursor window column count to %d, status=%d",
+                numColumns, status);
+        throw_sqlite3_exception(env, connection->db, msg.string());
+        return 0;
+    }
+
+    int retryCount = 0;
+    int totalRows = 0;
+    int addedRows = 0;
+    bool windowFull = false;
+    bool gotException = false;
+    while (!gotException && (!windowFull || countAllRows)) {
+        int err = sqlite3_step(statement);
+        if (err == SQLITE_ROW) {
+            LOG_WINDOW("Stepped statement %p to row %d", statement, totalRows);
+            retryCount = 0;
+            totalRows += 1;
+
+            // Skip the row if the window is full or we haven't reached the start position yet.
+            if (startPos >= totalRows || windowFull) {
+                continue;
+            }
+
+            CopyRowResult cpr = copyRow(env, window, statement, numColumns, startPos, addedRows);
+            if (cpr == CPR_FULL && addedRows && startPos + addedRows < requiredPos) {
+                // We filled the window before we got to the one row that we really wanted.
+                // Clear the window and start filling it again from here.
+                // TODO: Would be nicer if we could progressively replace earlier rows.
+                window->clear();
+                window->setNumColumns(numColumns);
+                startPos += addedRows;
+                addedRows = 0;
+                cpr = copyRow(env, window, statement, numColumns, startPos, addedRows);
+            }
+
+            if (cpr == CPR_OK) {
+                addedRows += 1;
+            } else if (cpr == CPR_FULL) {
+                windowFull = true;
+            } else {
+                gotException = true;
+            }
+        } else if (err == SQLITE_DONE) {
+            // All rows processed, bail
+            LOG_WINDOW("Processed all rows");
+            break;
+        } else if (err == SQLITE_LOCKED || err == SQLITE_BUSY) {
+            // The table is locked, retry
+            LOG_WINDOW("Database locked, retrying");
+            if (retryCount > 50) {
+                ALOGE("Bailing on database busy retry");
+                throw_sqlite3_exception(env, connection->db, "retrycount exceeded");
+                gotException = true;
+            } else {
+                // Sleep to give the thread holding the lock a chance to finish
+                usleep(1000);
+                retryCount++;
+            }
+        } else {
+            throw_sqlite3_exception(env, connection->db);
+            gotException = true;
+        }
+    }
+
+    LOG_WINDOW("Resetting statement %p after fetching %d rows and adding %d rows"
+            "to the window in %d bytes",
+            statement, totalRows, addedRows, window->size() - window->freeSpace());
+    sqlite3_reset(statement);
+
+    // Report the total number of rows on request.
+    if (startPos > totalRows) {
+        ALOGE("startPos %d > actual rows %d", startPos, totalRows);
+    }
+    jlong result = jlong(startPos) << 32 | jlong(totalRows);
+    return result;
+}
+
+static jint nativeGetDbLookaside(JNIEnv* env, jobject clazz, jint connectionPtr) {
+    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
+
+    int cur = -1;
+    int unused;
+    sqlite3_db_status(connection->db, SQLITE_DBSTATUS_LOOKASIDE_USED, &cur, &unused, 0);
+    return cur;
+}
+
+static void nativeCancel(JNIEnv* env, jobject clazz, jint connectionPtr) {
+    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
+    connection->canceled = true;
+}
+
+static void nativeResetCancel(JNIEnv* env, jobject clazz, jint connectionPtr,
+        jboolean cancelable) {
+    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
+    connection->canceled = false;
+
+    if (cancelable) {
+        sqlite3_progress_handler(connection->db, 4, sqliteProgressHandlerCallback,
+                connection);
+    } else {
+        sqlite3_progress_handler(connection->db, 0, NULL, NULL);
+    }
+}
+
+
+static JNINativeMethod sMethods[] =
+{
+    /* name, signature, funcPtr */
+    { "nativeOpen", "(Ljava/lang/String;ILjava/lang/String;ZZ)I",
+            (void*)nativeOpen },
+    { "nativeClose", "(I)V",
+            (void*)nativeClose },
+    { "nativeRegisterCustomFunction", "(ILandroid/database/sqlite/SQLiteCustomFunction;)V",
+            (void*)nativeRegisterCustomFunction },
+    { "nativeSetLocale", "(ILjava/lang/String;)V",
+            (void*)nativeSetLocale },
+    { "nativePrepareStatement", "(ILjava/lang/String;)I",
+            (void*)nativePrepareStatement },
+    { "nativeFinalizeStatement", "(II)V",
+            (void*)nativeFinalizeStatement },
+    { "nativeGetParameterCount", "(II)I",
+            (void*)nativeGetParameterCount },
+    { "nativeIsReadOnly", "(II)Z",
+            (void*)nativeIsReadOnly },
+    { "nativeGetColumnCount", "(II)I",
+            (void*)nativeGetColumnCount },
+    { "nativeGetColumnName", "(III)Ljava/lang/String;",
+            (void*)nativeGetColumnName },
+    { "nativeBindNull", "(III)V",
+            (void*)nativeBindNull },
+    { "nativeBindLong", "(IIIJ)V",
+            (void*)nativeBindLong },
+    { "nativeBindDouble", "(IIID)V",
+            (void*)nativeBindDouble },
+    { "nativeBindString", "(IIILjava/lang/String;)V",
+            (void*)nativeBindString },
+    { "nativeBindBlob", "(III[B)V",
+            (void*)nativeBindBlob },
+    { "nativeResetStatementAndClearBindings", "(II)V",
+            (void*)nativeResetStatementAndClearBindings },
+    { "nativeExecute", "(II)V",
+            (void*)nativeExecute },
+    { "nativeExecuteForLong", "(II)J",
+            (void*)nativeExecuteForLong },
+    { "nativeExecuteForString", "(II)Ljava/lang/String;",
+            (void*)nativeExecuteForString },
+    { "nativeExecuteForBlobFileDescriptor", "(II)I",
+            (void*)nativeExecuteForBlobFileDescriptor },
+    { "nativeExecuteForChangedRowCount", "(II)I",
+            (void*)nativeExecuteForChangedRowCount },
+    { "nativeExecuteForLastInsertedRowId", "(II)J",
+            (void*)nativeExecuteForLastInsertedRowId },
+    { "nativeExecuteForCursorWindow", "(IIIIIZ)J",
+            (void*)nativeExecuteForCursorWindow },
+    { "nativeGetDbLookaside", "(I)I",
+            (void*)nativeGetDbLookaside },
+    { "nativeCancel", "(I)V",
+            (void*)nativeCancel },
+    { "nativeResetCancel", "(IZ)V",
+            (void*)nativeResetCancel },
+};
+
+#define FIND_CLASS(var, className) \
+        var = env->FindClass(className); \
+        LOG_FATAL_IF(! var, "Unable to find class " className);
+
+#define GET_METHOD_ID(var, clazz, methodName, fieldDescriptor) \
+        var = env->GetMethodID(clazz, methodName, fieldDescriptor); \
+        LOG_FATAL_IF(! var, "Unable to find method" methodName);
+
+#define GET_FIELD_ID(var, clazz, fieldName, fieldDescriptor) \
+        var = env->GetFieldID(clazz, fieldName, fieldDescriptor); \
+        LOG_FATAL_IF(! var, "Unable to find field " fieldName);
+
+int register_android_database_SQLiteConnection(JNIEnv *env)
+{
+    jclass clazz;
+    FIND_CLASS(clazz, "android/database/sqlite/SQLiteCustomFunction");
+
+    GET_FIELD_ID(gSQLiteCustomFunctionClassInfo.name, clazz,
+            "name", "Ljava/lang/String;");
+    GET_FIELD_ID(gSQLiteCustomFunctionClassInfo.numArgs, clazz,
+            "numArgs", "I");
+    GET_METHOD_ID(gSQLiteCustomFunctionClassInfo.dispatchCallback,
+            clazz, "dispatchCallback", "([Ljava/lang/String;)V");
+
+    FIND_CLASS(clazz, "java/lang/String");
+    gStringClassInfo.clazz = jclass(env->NewGlobalRef(clazz));
+
+    return AndroidRuntime::registerNativeMethods(env, "android/database/sqlite/SQLiteConnection",
+            sMethods, NELEM(sMethods));
+}
+
+} // namespace android
diff --git a/core/jni/android_database_SQLiteDatabase.cpp b/core/jni/android_database_SQLiteDatabase.cpp
deleted file mode 100644
index 28c421d..0000000
--- a/core/jni/android_database_SQLiteDatabase.cpp
+++ /dev/null
@@ -1,636 +0,0 @@
-/*
- * Copyright (C) 2006-2007 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.
- */
-
-#undef LOG_TAG
-#define LOG_TAG "SqliteDatabaseCpp"
-
-#include <utils/Log.h>
-#include <utils/String8.h>
-#include <utils/String16.h>
-
-#include <jni.h>
-#include <JNIHelp.h>
-#include <android_runtime/AndroidRuntime.h>
-
-#include <sqlite3.h>
-#include <sqlite3_android.h>
-#include <string.h>
-#include <utils/Log.h>
-#include <utils/threads.h>
-#include <utils/List.h>
-#include <utils/Errors.h>
-#include <ctype.h>
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <string.h>
-#include <netdb.h>
-#include <sys/ioctl.h>
-
-#include "sqlite3_exception.h"
-
-#define UTF16_STORAGE 0
-#define INVALID_VERSION -1
-#define ANDROID_TABLE "android_metadata"
-/* uncomment the next line to force-enable logging of all statements */
-// #define DB_LOG_STATEMENTS
-
-#define DEBUG_JNI 0
-
-namespace android {
-
-enum {
-    OPEN_READWRITE          = 0x00000000,
-    OPEN_READONLY           = 0x00000001,
-    OPEN_READ_MASK          = 0x00000001,
-    NO_LOCALIZED_COLLATORS  = 0x00000010,
-    CREATE_IF_NECESSARY     = 0x10000000
-};
-
-static jfieldID offset_db_handle;
-static jmethodID method_custom_function_callback;
-static jclass string_class;
-static jint sSqliteSoftHeapLimit = 0;
-
-static char *createStr(const char *path, short extra) {
-    int len = strlen(path) + extra;
-    char *str = (char *)malloc(len + 1);
-    strncpy(str, path, len);
-    str[len] = NULL;
-    return str;
-}
-
-static void sqlLogger(void *databaseName, int iErrCode, const char *zMsg) {
-    // skip printing this message if it is due to certain types of errors
-    if (iErrCode == 0 || iErrCode == SQLITE_CONSTRAINT) return;
-    // print databasename, errorcode and msg
-    ALOGI("sqlite returned: error code = %d, msg = %s, db=%s\n", iErrCode, zMsg, databaseName);
-}
-
-// register the logging func on sqlite. needs to be done BEFORE any sqlite3 func is called.
-static void registerLoggingFunc(const char *path) {
-    static bool loggingFuncSet = false;
-    if (loggingFuncSet) {
-        return;
-    }
-
-    ALOGV("Registering sqlite logging func \n");
-    int err = sqlite3_config(SQLITE_CONFIG_LOG, &sqlLogger, (void *)createStr(path, 0));
-    if (err != SQLITE_OK) {
-        ALOGW("sqlite returned error = %d when trying to register logging func.\n", err);
-        return;
-    }
-    loggingFuncSet = true;
-}
-
-/* public native void dbopen(String path, int flags, String locale); */
-static void dbopen(JNIEnv* env, jobject object, jstring pathString, jint flags)
-{
-    int err;
-    sqlite3 * handle = NULL;
-    sqlite3_stmt * statement = NULL;
-    char const * path8 = env->GetStringUTFChars(pathString, NULL);
-    int sqliteFlags;
-
-    // register the logging func on sqlite. needs to be done BEFORE any sqlite3 func is called.
-    registerLoggingFunc(path8);
-
-    // convert our flags into the sqlite flags
-    if (flags & CREATE_IF_NECESSARY) {
-        sqliteFlags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE;
-    } else if (flags & OPEN_READONLY) {
-        sqliteFlags = SQLITE_OPEN_READONLY;
-    } else {
-        sqliteFlags = SQLITE_OPEN_READWRITE;
-    }
-
-    err = sqlite3_open_v2(path8, &handle, sqliteFlags, NULL);
-    if (err != SQLITE_OK) {
-        ALOGE("sqlite3_open_v2(\"%s\", &handle, %d, NULL) failed\n", path8, sqliteFlags);
-        throw_sqlite3_exception(env, handle);
-        goto done;
-    }
-
-    // The soft heap limit prevents the page cache allocations from growing
-    // beyond the given limit, no matter what the max page cache sizes are
-    // set to. The limit does not, as of 3.5.0, affect any other allocations.
-    sqlite3_soft_heap_limit(sSqliteSoftHeapLimit);
-
-    // Set the default busy handler to retry for 1000ms and then return SQLITE_BUSY
-    err = sqlite3_busy_timeout(handle, 1000 /* ms */);
-    if (err != SQLITE_OK) {
-        ALOGE("sqlite3_busy_timeout(handle, 1000) failed for \"%s\"\n", path8);
-        throw_sqlite3_exception(env, handle);
-        goto done;
-    }
-
-#ifdef DB_INTEGRITY_CHECK
-    static const char* integritySql = "pragma integrity_check(1);";
-    err = sqlite3_prepare_v2(handle, integritySql, -1, &statement, NULL);
-    if (err != SQLITE_OK) {
-        ALOGE("sqlite_prepare_v2(handle, \"%s\") failed for \"%s\"\n", integritySql, path8);
-        throw_sqlite3_exception(env, handle);
-        goto done;
-    }
-
-    // first is OK or error message
-    err = sqlite3_step(statement);
-    if (err != SQLITE_ROW) {
-        ALOGE("integrity check failed for \"%s\"\n", integritySql, path8);
-        throw_sqlite3_exception(env, handle);
-        goto done;
-    } else {
-        const char *text = (const char*)sqlite3_column_text(statement, 0);
-        if (strcmp(text, "ok") != 0) {
-            ALOGE("integrity check failed for \"%s\": %s\n", integritySql, path8, text);
-            jniThrowException(env, "android/database/sqlite/SQLiteDatabaseCorruptException", text);
-            goto done;
-        }
-    }
-#endif
-
-    err = register_android_functions(handle, UTF16_STORAGE);
-    if (err) {
-        throw_sqlite3_exception(env, handle);
-        goto done;
-    }
-
-    ALOGV("Opened '%s' - %p\n", path8, handle);
-    env->SetIntField(object, offset_db_handle, (int) handle);
-    handle = NULL;  // The caller owns the handle now.
-
-done:
-    // Release allocated resources
-    if (path8 != NULL) env->ReleaseStringUTFChars(pathString, path8);
-    if (statement != NULL) sqlite3_finalize(statement);
-    if (handle != NULL) sqlite3_close(handle);
-}
-
-static char *getDatabaseName(JNIEnv* env, sqlite3 * handle, jstring databaseName, short connNum) {
-    char const *path = env->GetStringUTFChars(databaseName, NULL);
-    if (path == NULL) {
-        ALOGE("Failure in getDatabaseName(). VM ran out of memory?\n");
-        return NULL; // VM would have thrown OutOfMemoryError
-    }
-    char *dbNameStr = createStr(path, 4);
-    if (connNum > 999) { // TODO: if number of pooled connections > 999, fix this line.
-      connNum = -1;
-    }
-    sprintf(dbNameStr + strlen(path), "|%03d", connNum);
-    env->ReleaseStringUTFChars(databaseName, path);
-    return dbNameStr;
-}
-
-static void sqlTrace(void *databaseName, const char *sql) {
-    ALOGI("sql_statement|%s|%s\n", (char *)databaseName, sql);
-}
-
-/* public native void enableSqlTracing(); */
-static void enableSqlTracing(JNIEnv* env, jobject object, jstring databaseName, jshort connType)
-{
-    sqlite3 * handle = (sqlite3 *)env->GetIntField(object, offset_db_handle);
-    sqlite3_trace(handle, &sqlTrace, (void *)getDatabaseName(env, handle, databaseName, connType));
-}
-
-static void sqlProfile(void *databaseName, const char *sql, sqlite3_uint64 tm) {
-    double d = tm/1000000.0;
-    ALOGI("elapsedTime4Sql|%s|%.3f ms|%s\n", (char *)databaseName, d, sql);
-}
-
-/* public native void enableSqlProfiling(); */
-static void enableSqlProfiling(JNIEnv* env, jobject object, jstring databaseName, jshort connType)
-{
-    sqlite3 * handle = (sqlite3 *)env->GetIntField(object, offset_db_handle);
-    sqlite3_profile(handle, &sqlProfile, (void *)getDatabaseName(env, handle, databaseName,
-            connType));
-}
-
-/* public native void close(); */
-static void dbclose(JNIEnv* env, jobject object)
-{
-    sqlite3 * handle = (sqlite3 *)env->GetIntField(object, offset_db_handle);
-
-    if (handle != NULL) {
-        // release the memory associated with the traceFuncArg in enableSqlTracing function
-        void *traceFuncArg = sqlite3_trace(handle, &sqlTrace, NULL);
-        if (traceFuncArg != NULL) {
-            free(traceFuncArg);
-        }
-        // release the memory associated with the traceFuncArg in enableSqlProfiling function
-        traceFuncArg = sqlite3_profile(handle, &sqlProfile, NULL);
-        if (traceFuncArg != NULL) {
-            free(traceFuncArg);
-        }
-        ALOGV("Closing database: handle=%p\n", handle);
-        int result = sqlite3_close(handle);
-        if (result == SQLITE_OK) {
-            ALOGV("Closed %p\n", handle);
-            env->SetIntField(object, offset_db_handle, 0);
-        } else {
-            // This can happen if sub-objects aren't closed first.  Make sure the caller knows.
-            throw_sqlite3_exception(env, handle);
-            ALOGE("sqlite3_close(%p) failed: %d\n", handle, result);
-        }
-    }
-}
-
-/* native int native_getDbLookaside(); */
-static jint native_getDbLookaside(JNIEnv* env, jobject object)
-{
-    sqlite3 * handle = (sqlite3 *)env->GetIntField(object, offset_db_handle);
-    int pCur = -1;
-    int unused;
-    sqlite3_db_status(handle, SQLITE_DBSTATUS_LOOKASIDE_USED, &pCur, &unused, 0);
-    return pCur;
-}
-
-/* set locale in the android_metadata table, install localized collators, and rebuild indexes */
-static void native_setLocale(JNIEnv* env, jobject object, jstring localeString, jint flags)
-{
-    if ((flags & NO_LOCALIZED_COLLATORS)) return;
-
-    int err;
-    char const* locale8 = env->GetStringUTFChars(localeString, NULL);
-    sqlite3 * handle = (sqlite3 *)env->GetIntField(object, offset_db_handle);
-    sqlite3_stmt* stmt = NULL;
-    char** meta = NULL;
-    int rowCount, colCount;
-    char* dbLocale = NULL;
-
-    // create the table, if necessary and possible
-    if (!(flags & OPEN_READONLY)) {
-        static const char *createSql ="CREATE TABLE IF NOT EXISTS " ANDROID_TABLE " (locale TEXT)";
-        err = sqlite3_exec(handle, createSql, NULL, NULL, NULL);
-        if (err != SQLITE_OK) {
-            ALOGE("CREATE TABLE " ANDROID_TABLE " failed\n");
-            throw_sqlite3_exception(env, handle);
-            goto done;
-        }
-    }
-
-    // try to read from the table
-    static const char *selectSql = "SELECT locale FROM " ANDROID_TABLE " LIMIT 1";
-    err = sqlite3_get_table(handle, selectSql, &meta, &rowCount, &colCount, NULL);
-    if (err != SQLITE_OK) {
-        ALOGE("SELECT locale FROM " ANDROID_TABLE " failed\n");
-        throw_sqlite3_exception(env, handle);
-        goto done;
-    }
-
-    dbLocale = (rowCount >= 1) ? meta[colCount] : NULL;
-
-    if (dbLocale != NULL && !strcmp(dbLocale, locale8)) {
-        // database locale is the same as the desired locale; set up the collators and go
-        err = register_localized_collators(handle, locale8, UTF16_STORAGE);
-        if (err != SQLITE_OK) throw_sqlite3_exception(env, handle);
-        goto done;   // no database changes needed
-    }
-
-    if ((flags & OPEN_READONLY)) {
-        // read-only database, so we're going to have to put up with whatever we got
-        // For registering new index. Not for modifing the read-only database.
-        err = register_localized_collators(handle, locale8, UTF16_STORAGE);
-        if (err != SQLITE_OK) throw_sqlite3_exception(env, handle);
-        goto done;
-    }
-
-    // need to update android_metadata and indexes atomically, so use a transaction...
-    err = sqlite3_exec(handle, "BEGIN TRANSACTION", NULL, NULL, NULL);
-    if (err != SQLITE_OK) {
-        ALOGE("BEGIN TRANSACTION failed setting locale\n");
-        throw_sqlite3_exception(env, handle);
-        goto done;
-    }
-
-    err = register_localized_collators(handle, locale8, UTF16_STORAGE);
-    if (err != SQLITE_OK) {
-        ALOGE("register_localized_collators() failed setting locale\n");
-        throw_sqlite3_exception(env, handle);
-        goto rollback;
-    }
-
-    err = sqlite3_exec(handle, "DELETE FROM " ANDROID_TABLE, NULL, NULL, NULL);
-    if (err != SQLITE_OK) {
-        ALOGE("DELETE failed setting locale\n");
-        throw_sqlite3_exception(env, handle);
-        goto rollback;
-    }
-
-    static const char *sql = "INSERT INTO " ANDROID_TABLE " (locale) VALUES(?);";
-    err = sqlite3_prepare_v2(handle, sql, -1, &stmt, NULL);
-    if (err != SQLITE_OK) {
-        ALOGE("sqlite3_prepare_v2(\"%s\") failed\n", sql);
-        throw_sqlite3_exception(env, handle);
-        goto rollback;
-    }
-
-    err = sqlite3_bind_text(stmt, 1, locale8, -1, SQLITE_TRANSIENT);
-    if (err != SQLITE_OK) {
-        ALOGE("sqlite3_bind_text() failed setting locale\n");
-        throw_sqlite3_exception(env, handle);
-        goto rollback;
-    }
-
-    err = sqlite3_step(stmt);
-    if (err != SQLITE_OK && err != SQLITE_DONE) {
-        ALOGE("sqlite3_step(\"%s\") failed setting locale\n", sql);
-        throw_sqlite3_exception(env, handle);
-        goto rollback;
-    }
-
-    err = sqlite3_exec(handle, "REINDEX LOCALIZED", NULL, NULL, NULL);
-    if (err != SQLITE_OK) {
-        ALOGE("REINDEX LOCALIZED failed\n");
-        throw_sqlite3_exception(env, handle);
-        goto rollback;
-    }
-
-    // all done, yay!
-    err = sqlite3_exec(handle, "COMMIT TRANSACTION", NULL, NULL, NULL);
-    if (err != SQLITE_OK) {
-        ALOGE("COMMIT TRANSACTION failed setting locale\n");
-        throw_sqlite3_exception(env, handle);
-        goto done;
-    }
-
-rollback:
-    if (err != SQLITE_OK) {
-        sqlite3_exec(handle, "ROLLBACK TRANSACTION", NULL, NULL, NULL);
-    }
-
-done:
-    if (locale8 != NULL) env->ReleaseStringUTFChars(localeString, locale8);
-    if (stmt != NULL) sqlite3_finalize(stmt);
-    if (meta != NULL) sqlite3_free_table(meta);
-}
-
-static void native_setSqliteSoftHeapLimit(JNIEnv* env, jobject clazz, jint limit) {
-    sSqliteSoftHeapLimit = limit;
-}
-
-static jint native_releaseMemory(JNIEnv *env, jobject clazz)
-{
-    // Attempt to release as much memory from the
-    return sqlite3_release_memory(sSqliteSoftHeapLimit);
-}
-
-static void native_finalize(JNIEnv* env, jobject object, jint statementId)
-{
-    if (statementId > 0) {
-        sqlite3_finalize((sqlite3_stmt *)statementId);
-    }
-}
-
-static void custom_function_callback(sqlite3_context * context, int argc, sqlite3_value ** argv) {
-    JNIEnv* env = AndroidRuntime::getJNIEnv();
-    if (!env) {
-        ALOGE("custom_function_callback cannot call into Java on this thread");
-        return;
-    }
-    // get global ref to CustomFunction object from our user data
-    jobject function = (jobject)sqlite3_user_data(context);
-
-    // pack up the arguments into a string array
-    jobjectArray strArray = env->NewObjectArray(argc, string_class, NULL);
-    if (!strArray)
-        goto done;
-    for (int i = 0; i < argc; i++) {
-        char* arg = (char *)sqlite3_value_text(argv[i]);
-        if (!arg) {
-            ALOGE("NULL argument in custom_function_callback.  This should not happen.");
-            return;
-        }
-        jobject obj = env->NewStringUTF(arg);
-        if (!obj)
-            goto done;
-        env->SetObjectArrayElement(strArray, i, obj);
-        env->DeleteLocalRef(obj);
-    }
-
-    env->CallVoidMethod(function, method_custom_function_callback, strArray);
-    env->DeleteLocalRef(strArray);
-
-done:
-    if (env->ExceptionCheck()) {
-        ALOGE("An exception was thrown by custom sqlite3 function.");
-        LOGE_EX(env);
-        env->ExceptionClear();
-    }
-}
-
-static jint native_addCustomFunction(JNIEnv* env, jobject object,
-        jstring name, jint numArgs, jobject function)
-{
-    sqlite3 * handle = (sqlite3 *)env->GetIntField(object, offset_db_handle);
-    char const *nameStr = env->GetStringUTFChars(name, NULL);
-    jobject ref = env->NewGlobalRef(function);
-    ALOGD_IF(DEBUG_JNI, "native_addCustomFunction %s ref: %p", nameStr, ref);
-    int err = sqlite3_create_function(handle, nameStr, numArgs, SQLITE_UTF8,
-            (void *)ref, custom_function_callback, NULL, NULL);
-    env->ReleaseStringUTFChars(name, nameStr);
-
-    if (err == SQLITE_OK)
-        return (int)ref;
-    else {
-        ALOGE("sqlite3_create_function returned %d", err);
-        env->DeleteGlobalRef(ref);
-        throw_sqlite3_exception(env, handle);
-        return 0;
-     }
-}
-
-static void native_releaseCustomFunction(JNIEnv* env, jobject object, jint ref)
-{
-    ALOGD_IF(DEBUG_JNI, "native_releaseCustomFunction %d", ref);
-    env->DeleteGlobalRef((jobject)ref);
-}
-
-static JNINativeMethod sMethods[] =
-{
-    /* name, signature, funcPtr */
-    {"dbopen", "(Ljava/lang/String;I)V", (void *)dbopen},
-    {"dbclose", "()V", (void *)dbclose},
-    {"enableSqlTracing", "(Ljava/lang/String;S)V", (void *)enableSqlTracing},
-    {"enableSqlProfiling", "(Ljava/lang/String;S)V", (void *)enableSqlProfiling},
-    {"native_setLocale", "(Ljava/lang/String;I)V", (void *)native_setLocale},
-    {"native_getDbLookaside", "()I", (void *)native_getDbLookaside},
-    {"native_setSqliteSoftHeapLimit", "(I)V", (void *)native_setSqliteSoftHeapLimit},
-    {"releaseMemory", "()I", (void *)native_releaseMemory},
-    {"native_finalize", "(I)V", (void *)native_finalize},
-    {"native_addCustomFunction",
-                    "(Ljava/lang/String;ILandroid/database/sqlite/SQLiteDatabase$CustomFunction;)I",
-                    (void *)native_addCustomFunction},
-    {"native_releaseCustomFunction", "(I)V", (void *)native_releaseCustomFunction},
-};
-
-int register_android_database_SQLiteDatabase(JNIEnv *env)
-{
-    jclass clazz;
-
-    clazz = env->FindClass("android/database/sqlite/SQLiteDatabase");
-    if (clazz == NULL) {
-        ALOGE("Can't find android/database/sqlite/SQLiteDatabase\n");
-        return -1;
-    }
-
-    string_class = (jclass)env->NewGlobalRef(env->FindClass("java/lang/String"));
-    if (string_class == NULL) {
-        ALOGE("Can't find java/lang/String\n");
-        return -1;
-    }
-
-    offset_db_handle = env->GetFieldID(clazz, "mNativeHandle", "I");
-    if (offset_db_handle == NULL) {
-        ALOGE("Can't find SQLiteDatabase.mNativeHandle\n");
-        return -1;
-    }
-
-    clazz = env->FindClass("android/database/sqlite/SQLiteDatabase$CustomFunction");
-    if (clazz == NULL) {
-        ALOGE("Can't find android/database/sqlite/SQLiteDatabase$CustomFunction\n");
-        return -1;
-    }
-    method_custom_function_callback = env->GetMethodID(clazz, "callback", "([Ljava/lang/String;)V");
-    if (method_custom_function_callback == NULL) {
-        ALOGE("Can't find method SQLiteDatabase.CustomFunction.callback\n");
-        return -1;
-    }
-
-    return AndroidRuntime::registerNativeMethods(env, "android/database/sqlite/SQLiteDatabase",
-            sMethods, NELEM(sMethods));
-}
-
-/* throw a SQLiteException with a message appropriate for the error in handle */
-void throw_sqlite3_exception(JNIEnv* env, sqlite3* handle) {
-    throw_sqlite3_exception(env, handle, NULL);
-}
-
-/* throw a SQLiteException with the given message */
-void throw_sqlite3_exception(JNIEnv* env, const char* message) {
-    throw_sqlite3_exception(env, NULL, message);
-}
-
-/* throw a SQLiteException with a message appropriate for the error in handle
-   concatenated with the given message
- */
-void throw_sqlite3_exception(JNIEnv* env, sqlite3* handle, const char* message) {
-    if (handle) {
-        throw_sqlite3_exception(env, sqlite3_errcode(handle),
-                                sqlite3_errmsg(handle), message);
-    } else {
-        // we use SQLITE_OK so that a generic SQLiteException is thrown;
-        // any code not specified in the switch statement below would do.
-        throw_sqlite3_exception(env, SQLITE_OK, "unknown error", message);
-    }
-}
-
-/* throw a SQLiteException for a given error code */
-void throw_sqlite3_exception_errcode(JNIEnv* env, int errcode, const char* message) {
-    if (errcode == SQLITE_DONE) {
-        throw_sqlite3_exception(env, errcode, NULL, message);
-    } else {
-        char temp[21];
-        sprintf(temp, "error code %d", errcode);
-        throw_sqlite3_exception(env, errcode, temp, message);
-    }
-}
-
-/* throw a SQLiteException for a given error code, sqlite3message, and
-   user message
- */
-void throw_sqlite3_exception(JNIEnv* env, int errcode,
-                             const char* sqlite3Message, const char* message) {
-    const char* exceptionClass;
-    switch (errcode) {
-        case SQLITE_IOERR:
-            exceptionClass = "android/database/sqlite/SQLiteDiskIOException";
-            break;
-        case SQLITE_CORRUPT:
-        case SQLITE_NOTADB: // treat "unsupported file format" error as corruption also
-            exceptionClass = "android/database/sqlite/SQLiteDatabaseCorruptException";
-            break;
-        case SQLITE_CONSTRAINT:
-           exceptionClass = "android/database/sqlite/SQLiteConstraintException";
-           break;
-        case SQLITE_ABORT:
-           exceptionClass = "android/database/sqlite/SQLiteAbortException";
-           break;
-        case SQLITE_DONE:
-           exceptionClass = "android/database/sqlite/SQLiteDoneException";
-           break;
-        case SQLITE_FULL:
-           exceptionClass = "android/database/sqlite/SQLiteFullException";
-           break;
-        case SQLITE_MISUSE:
-           exceptionClass = "android/database/sqlite/SQLiteMisuseException";
-           break;
-        case SQLITE_PERM:
-           exceptionClass = "android/database/sqlite/SQLiteAccessPermException";
-           break;
-        case SQLITE_BUSY:
-           exceptionClass = "android/database/sqlite/SQLiteDatabaseLockedException";
-           break;
-        case SQLITE_LOCKED:
-           exceptionClass = "android/database/sqlite/SQLiteTableLockedException";
-           break;
-        case SQLITE_READONLY:
-           exceptionClass = "android/database/sqlite/SQLiteReadOnlyDatabaseException";
-           break;
-        case SQLITE_CANTOPEN:
-           exceptionClass = "android/database/sqlite/SQLiteCantOpenDatabaseException";
-           break;
-        case SQLITE_TOOBIG:
-           exceptionClass = "android/database/sqlite/SQLiteBlobTooBigException";
-           break;
-        case SQLITE_RANGE:
-           exceptionClass = "android/database/sqlite/SQLiteBindOrColumnIndexOutOfRangeException";
-           break;
-        case SQLITE_NOMEM:
-           exceptionClass = "android/database/sqlite/SQLiteOutOfMemoryException";
-           break;
-        case SQLITE_MISMATCH:
-           exceptionClass = "android/database/sqlite/SQLiteDatatypeMismatchException";
-           break;
-        case SQLITE_UNCLOSED:
-           exceptionClass = "android/database/sqlite/SQLiteUnfinalizedObjectsException";
-           break;
-        default:
-           exceptionClass = "android/database/sqlite/SQLiteException";
-           break;
-    }
-
-    if (sqlite3Message != NULL && message != NULL) {
-        char* fullMessage = (char *)malloc(strlen(sqlite3Message) + strlen(message) + 3);
-        if (fullMessage != NULL) {
-            strcpy(fullMessage, sqlite3Message);
-            strcat(fullMessage, ": ");
-            strcat(fullMessage, message);
-            jniThrowException(env, exceptionClass, fullMessage);
-            free(fullMessage);
-        } else {
-            jniThrowException(env, exceptionClass, sqlite3Message);
-        }
-    } else if (sqlite3Message != NULL) {
-        jniThrowException(env, exceptionClass, sqlite3Message);
-    } else {
-        jniThrowException(env, exceptionClass, message);
-    }
-}
-
-
-} // namespace android
diff --git a/core/jni/android_database_SQLiteDebug.cpp b/core/jni/android_database_SQLiteDebug.cpp
index 20ff00b..c1e7305 100644
--- a/core/jni/android_database_SQLiteDebug.cpp
+++ b/core/jni/android_database_SQLiteDebug.cpp
@@ -14,171 +14,42 @@
  * limitations under the License.
  */
 
-#include <JNIHelp.h>
+#define LOG_TAG "SQLiteDebug"
+
 #include <jni.h>
-#include <utils/misc.h>
+#include <JNIHelp.h>
+#include <android_runtime/AndroidRuntime.h>
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <cutils/mspace.h>
 #include <utils/Log.h>
 
 #include <sqlite3.h>
 
-// From mem_mspace.c in libsqlite
-extern "C" mspace sqlite3_get_mspace();
-
 namespace android {
 
-static jfieldID gMemoryUsedField;
-static jfieldID gPageCacheOverfloField;
-static jfieldID gLargestMemAllocField;
+static struct {
+    jfieldID memoryUsed;
+    jfieldID pageCacheOverflow;
+    jfieldID largestMemAlloc;
+} gSQLiteDebugPagerStatsClassInfo;
 
-
-#define USE_MSPACE 0
-
-static void getPagerStats(JNIEnv *env, jobject clazz, jobject statsObj)
+static void nativeGetPagerStats(JNIEnv *env, jobject clazz, jobject statsObj)
 {
     int memoryUsed;
-    int pageCacheOverflo;
+    int pageCacheOverflow;
     int largestMemAlloc;
     int unused;
 
     sqlite3_status(SQLITE_STATUS_MEMORY_USED, &memoryUsed, &unused, 0);
     sqlite3_status(SQLITE_STATUS_MALLOC_SIZE, &unused, &largestMemAlloc, 0);
-    sqlite3_status(SQLITE_STATUS_PAGECACHE_OVERFLOW, &pageCacheOverflo, &unused, 0);
-    env->SetIntField(statsObj, gMemoryUsedField, memoryUsed);
-    env->SetIntField(statsObj, gPageCacheOverfloField, pageCacheOverflo);
-    env->SetIntField(statsObj, gLargestMemAllocField, largestMemAlloc);
-}
-
-static jlong getHeapSize(JNIEnv *env, jobject clazz)
-{
-#if !NO_MALLINFO
-    struct mallinfo info = mspace_mallinfo(sqlite3_get_mspace());
-    struct mallinfo info = dlmallinfo();
-    return (jlong) info.usmblks;
-#elif USE_MSPACE
-    mspace space = sqlite3_get_mspace();
-    if (space != 0) {
-        return mspace_footprint(space);
-    } else {
-        return 0;
-    }
-#else
-    return 0;
-#endif
-}
-
-static jlong getHeapAllocatedSize(JNIEnv *env, jobject clazz)
-{
-#if !NO_MALLINFO
-    struct mallinfo info = mspace_mallinfo(sqlite3_get_mspace());
-    return (jlong) info.uordblks;
-#else
-    return sqlite3_memory_used();
-#endif
-}
-
-static jlong getHeapFreeSize(JNIEnv *env, jobject clazz)
-{
-#if !NO_MALLINFO
-    struct mallinfo info = mspace_mallinfo(sqlite3_get_mspace());
-    return (jlong) info.fordblks;
-#else
-    return getHeapSize(env, clazz) - sqlite3_memory_used();
-#endif
-}
-
-static int read_mapinfo(FILE *fp,
-        int *sharedPages, int *privatePages)
-{
-    char line[1024];
-    int len;
-    int skip;
-
-    unsigned start = 0, size = 0, resident = 0;
-    unsigned shared_clean = 0, shared_dirty = 0;
-    unsigned private_clean = 0, private_dirty = 0;
-    unsigned referenced = 0;
-
-    int isAnon = 0;
-    int isHeap = 0;
-
-again:
-    skip = 0;
-    
-    if(fgets(line, 1024, fp) == 0) return 0;
-
-    len = strlen(line);
-    if (len < 1) return 0;
-    line[--len] = 0;
-
-    /* ignore guard pages */
-    if (line[18] == '-') skip = 1;
-
-    start = strtoul(line, 0, 16);
-
-    if (len > 50 && !strncmp(line + 49, "/tmp/sqlite-heap", strlen("/tmp/sqlite-heap"))) {
-        isHeap = 1;
-    }
-
-    if (fgets(line, 1024, fp) == 0) return 0;
-    if (sscanf(line, "Size: %d kB", &size) != 1) return 0;
-    if (fgets(line, 1024, fp) == 0) return 0;
-    if (sscanf(line, "Rss: %d kB", &resident) != 1) return 0;
-    if (fgets(line, 1024, fp) == 0) return 0;
-    if (sscanf(line, "Shared_Clean: %d kB", &shared_clean) != 1) return 0;
-    if (fgets(line, 1024, fp) == 0) return 0;
-    if (sscanf(line, "Shared_Dirty: %d kB", &shared_dirty) != 1) return 0;
-    if (fgets(line, 1024, fp) == 0) return 0;
-    if (sscanf(line, "Private_Clean: %d kB", &private_clean) != 1) return 0;
-    if (fgets(line, 1024, fp) == 0) return 0;
-    if (sscanf(line, "Private_Dirty: %d kB", &private_dirty) != 1) return 0;
-    if (fgets(line, 1024, fp) == 0) return 0;
-    if (sscanf(line, "Referenced: %d kB", &referenced) != 1) return 0;
-    
-    if (skip) {
-        goto again;
-    }
-
-    if (isHeap) {
-        *sharedPages += shared_dirty;
-        *privatePages += private_dirty;
-    }
-    return 1;
-}
-
-static void load_maps(int pid, int *sharedPages, int *privatePages)
-{
-    char tmp[128];
-    FILE *fp;
-    
-    sprintf(tmp, "/proc/%d/smaps", pid);
-    fp = fopen(tmp, "r");
-    if (fp == 0) return;
-    
-    while (read_mapinfo(fp, sharedPages, privatePages) != 0) {
-        // Do nothing
-    }
-    fclose(fp);
-}
-
-static void getHeapDirtyPages(JNIEnv *env, jobject clazz, jintArray pages)
-{
-    int _pages[2];
-
-    _pages[0] = 0;
-    _pages[1] = 0;
-
-    load_maps(getpid(), &_pages[0], &_pages[1]);
-
-    // Convert from kbytes to 4K pages
-    _pages[0] /= 4;
-    _pages[1] /= 4;
-
-    env->SetIntArrayRegion(pages, 0, 2, _pages);
+    sqlite3_status(SQLITE_STATUS_PAGECACHE_OVERFLOW, &pageCacheOverflow, &unused, 0);
+    env->SetIntField(statsObj, gSQLiteDebugPagerStatsClassInfo.memoryUsed, memoryUsed);
+    env->SetIntField(statsObj, gSQLiteDebugPagerStatsClassInfo.pageCacheOverflow,
+            pageCacheOverflow);
+    env->SetIntField(statsObj, gSQLiteDebugPagerStatsClassInfo.largestMemAlloc, largestMemAlloc);
 }
 
 /*
@@ -187,43 +58,31 @@
 
 static JNINativeMethod gMethods[] =
 {
-    { "getPagerStats", "(Landroid/database/sqlite/SQLiteDebug$PagerStats;)V",
-            (void*) getPagerStats },
-    { "getHeapSize", "()J", (void*) getHeapSize },
-    { "getHeapAllocatedSize", "()J", (void*) getHeapAllocatedSize },
-    { "getHeapFreeSize", "()J", (void*) getHeapFreeSize },
-    { "getHeapDirtyPages", "([I)V", (void*) getHeapDirtyPages },
+    { "nativeGetPagerStats", "(Landroid/database/sqlite/SQLiteDebug$PagerStats;)V",
+            (void*) nativeGetPagerStats },
 };
 
+#define FIND_CLASS(var, className) \
+        var = env->FindClass(className); \
+        LOG_FATAL_IF(! var, "Unable to find class " className);
+
+#define GET_FIELD_ID(var, clazz, fieldName, fieldDescriptor) \
+        var = env->GetFieldID(clazz, fieldName, fieldDescriptor); \
+        LOG_FATAL_IF(! var, "Unable to find field " fieldName);
+
 int register_android_database_SQLiteDebug(JNIEnv *env)
 {
     jclass clazz;
+    FIND_CLASS(clazz, "android/database/sqlite/SQLiteDebug$PagerStats");
 
-    clazz = env->FindClass("android/database/sqlite/SQLiteDebug$PagerStats");
-    if (clazz == NULL) {
-        ALOGE("Can't find android/database/sqlite/SQLiteDebug$PagerStats");
-        return -1;
-    }
+    GET_FIELD_ID(gSQLiteDebugPagerStatsClassInfo.memoryUsed, clazz,
+            "memoryUsed", "I");
+    GET_FIELD_ID(gSQLiteDebugPagerStatsClassInfo.largestMemAlloc, clazz,
+            "largestMemAlloc", "I");
+    GET_FIELD_ID(gSQLiteDebugPagerStatsClassInfo.pageCacheOverflow, clazz,
+            "pageCacheOverflow", "I");
 
-    gMemoryUsedField = env->GetFieldID(clazz, "memoryUsed", "I");
-    if (gMemoryUsedField == NULL) {
-        ALOGE("Can't find memoryUsed");
-        return -1;
-    }
-
-    gLargestMemAllocField = env->GetFieldID(clazz, "largestMemAlloc", "I");
-    if (gLargestMemAllocField == NULL) {
-        ALOGE("Can't find largestMemAlloc");
-        return -1;
-    }
-
-    gPageCacheOverfloField = env->GetFieldID(clazz, "pageCacheOverflo", "I");
-    if (gPageCacheOverfloField == NULL) {
-        ALOGE("Can't find pageCacheOverflo");
-        return -1;
-    }
-
-    return jniRegisterNativeMethods(env, "android/database/sqlite/SQLiteDebug",
+    return AndroidRuntime::registerNativeMethods(env, "android/database/sqlite/SQLiteDebug",
             gMethods, NELEM(gMethods));
 }
 
diff --git a/core/jni/android_database_SQLiteGlobal.cpp b/core/jni/android_database_SQLiteGlobal.cpp
new file mode 100644
index 0000000..9301183
--- /dev/null
+++ b/core/jni/android_database_SQLiteGlobal.cpp
@@ -0,0 +1,89 @@
+/*
+ * 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.
+ */
+
+#define LOG_TAG "SQLiteGlobal"
+
+#include <jni.h>
+#include <JNIHelp.h>
+#include <android_runtime/AndroidRuntime.h>
+
+#include <sqlite3.h>
+#include <sqlite3_android.h>
+
+#include "android_database_SQLiteCommon.h"
+#include "android_util_Log.h"
+
+namespace android {
+
+// Limit heap to 8MB for now.  This is 4 times the maximum cursor window
+// size, as has been used by the original code in SQLiteDatabase for
+// a long time.
+static const int SOFT_HEAP_LIMIT = 8 * 1024 * 1024;
+
+
+// Called each time a message is logged.
+static void sqliteLogCallback(void* data, int iErrCode, const char* zMsg) {
+    bool verboseLog = !!data;
+    if (iErrCode == 0 || iErrCode == SQLITE_CONSTRAINT) {
+        if (verboseLog) {
+            ALOGV(LOG_VERBOSE, SQLITE_LOG_TAG, "(%d) %s\n", iErrCode, zMsg);
+        }
+    } else {
+        ALOG(LOG_ERROR, SQLITE_LOG_TAG, "(%d) %s\n", iErrCode, zMsg);
+    }
+}
+
+// Sets the global SQLite configuration.
+// This must be called before any other SQLite functions are called.
+static void sqliteInitialize() {
+    // Enable multi-threaded mode.  In this mode, SQLite is safe to use by multiple
+    // threads as long as no two threads use the same database connection at the same
+    // time (which we guarantee in the SQLite database wrappers).
+    sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
+
+    // Redirect SQLite log messages to the Android log.
+    bool verboseLog = android_util_Log_isVerboseLogEnabled(SQLITE_LOG_TAG);
+    sqlite3_config(SQLITE_CONFIG_LOG, &sqliteLogCallback, verboseLog ? (void*)1 : NULL);
+
+    // The soft heap limit prevents the page cache allocations from growing
+    // beyond the given limit, no matter what the max page cache sizes are
+    // set to. The limit does not, as of 3.5.0, affect any other allocations.
+    sqlite3_soft_heap_limit(SOFT_HEAP_LIMIT);
+
+    // Initialize SQLite.
+    sqlite3_initialize();
+}
+
+static jint nativeReleaseMemory(JNIEnv* env, jclass clazz) {
+    return sqlite3_release_memory(SOFT_HEAP_LIMIT);
+}
+
+static JNINativeMethod sMethods[] =
+{
+    /* name, signature, funcPtr */
+    { "nativeReleaseMemory", "()I",
+            (void*)nativeReleaseMemory },
+};
+
+int register_android_database_SQLiteGlobal(JNIEnv *env)
+{
+    sqliteInitialize();
+
+    return AndroidRuntime::registerNativeMethods(env, "android/database/sqlite/SQLiteGlobal",
+            sMethods, NELEM(sMethods));
+}
+
+} // namespace android
diff --git a/core/jni/android_database_SQLiteProgram.cpp b/core/jni/android_database_SQLiteProgram.cpp
deleted file mode 100644
index 2e34c00..0000000
--- a/core/jni/android_database_SQLiteProgram.cpp
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Copyright (C) 2006-2008 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.
- */
-
-#undef LOG_TAG
-#define LOG_TAG "Cursor"
-
-#include <jni.h>
-#include <JNIHelp.h>
-#include <android_runtime/AndroidRuntime.h>
-
-#include <sqlite3.h>
-
-#include <utils/Log.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "sqlite3_exception.h"
-
-
-namespace android {
-
-static jfieldID gHandleField;
-static jfieldID gStatementField;
-
-
-#define GET_STATEMENT(env, object) \
-        (sqlite3_stmt *)env->GetIntField(object, gStatementField)
-#define GET_HANDLE(env, object) \
-        (sqlite3 *)env->GetIntField(object, gHandleField)
-
-static void native_compile(JNIEnv* env, jobject object, jstring sqlString)
-{
-    char buf[65];
-    strcpy(buf, "android_database_SQLiteProgram->native_compile() not implemented");
-    throw_sqlite3_exception(env, GET_HANDLE(env, object), buf);
-    return;
-}
-
-static void native_bind_null(JNIEnv* env, jobject object,
-                             jint index)
-{
-    int err;
-    sqlite3_stmt * statement = GET_STATEMENT(env, object);
-
-    err = sqlite3_bind_null(statement, index);
-    if (err != SQLITE_OK) {
-        char buf[32];
-        sprintf(buf, "handle %p", statement);
-        throw_sqlite3_exception(env, GET_HANDLE(env, object), buf);
-        return;
-    }
-}
-
-static void native_bind_long(JNIEnv* env, jobject object,
-                             jint index, jlong value)
-{
-    int err;
-    sqlite3_stmt * statement = GET_STATEMENT(env, object);
-
-    err = sqlite3_bind_int64(statement, index, value);
-    if (err != SQLITE_OK) {
-        char buf[32];
-        sprintf(buf, "handle %p", statement);
-        throw_sqlite3_exception(env, GET_HANDLE(env, object), buf);
-        return;
-    }
-}
-
-static void native_bind_double(JNIEnv* env, jobject object,
-                             jint index, jdouble value)
-{
-    int err;
-    sqlite3_stmt * statement = GET_STATEMENT(env, object);
-
-    err = sqlite3_bind_double(statement, index, value);
-    if (err != SQLITE_OK) {
-        char buf[32];
-        sprintf(buf, "handle %p", statement);
-        throw_sqlite3_exception(env, GET_HANDLE(env, object), buf);
-        return;
-    }
-}
-
-static void native_bind_string(JNIEnv* env, jobject object,
-                               jint index, jstring sqlString)
-{
-    int err;
-    jchar const * sql;
-    jsize sqlLen;
-    sqlite3_stmt * statement= GET_STATEMENT(env, object);
-
-    sql = env->GetStringChars(sqlString, NULL);
-    sqlLen = env->GetStringLength(sqlString);
-    err = sqlite3_bind_text16(statement, index, sql, sqlLen * 2, SQLITE_TRANSIENT);
-    env->ReleaseStringChars(sqlString, sql);
-    if (err != SQLITE_OK) {
-        char buf[32];
-        sprintf(buf, "handle %p", statement);
-        throw_sqlite3_exception(env, GET_HANDLE(env, object), buf);
-        return;
-    }
-}
-
-static void native_bind_blob(JNIEnv* env, jobject object,
-                               jint index, jbyteArray value)
-{
-    int err;
-    jchar const * sql;
-    jsize sqlLen;
-    sqlite3_stmt * statement= GET_STATEMENT(env, object);
-
-    jint len = env->GetArrayLength(value);
-    jbyte * bytes = env->GetByteArrayElements(value, NULL);
-
-    err = sqlite3_bind_blob(statement, index, bytes, len, SQLITE_TRANSIENT);
-    env->ReleaseByteArrayElements(value, bytes, JNI_ABORT);
-
-    if (err != SQLITE_OK) {
-        char buf[32];
-        sprintf(buf, "statement %p", statement);
-        throw_sqlite3_exception(env, GET_HANDLE(env, object), buf);
-        return;
-    }
-}
-
-static void native_clear_bindings(JNIEnv* env, jobject object)
-{
-    int err;
-    sqlite3_stmt * statement = GET_STATEMENT(env, object);
-
-    err = sqlite3_clear_bindings(statement);
-    if (err != SQLITE_OK) {
-        throw_sqlite3_exception(env, GET_HANDLE(env, object));
-        return;
-    }
-}
-
-static void native_finalize(JNIEnv* env, jobject object)
-{
-    char buf[66];
-    strcpy(buf, "android_database_SQLiteProgram->native_finalize() not implemented");
-    throw_sqlite3_exception(env, GET_HANDLE(env, object), buf);
-    return;
-}
-
-
-static JNINativeMethod sMethods[] =
-{
-     /* name, signature, funcPtr */
-    {"native_bind_null", "(I)V", (void *)native_bind_null},
-    {"native_bind_long", "(IJ)V", (void *)native_bind_long},
-    {"native_bind_double", "(ID)V", (void *)native_bind_double},
-    {"native_bind_string", "(ILjava/lang/String;)V", (void *)native_bind_string},
-    {"native_bind_blob", "(I[B)V", (void *)native_bind_blob},
-    {"native_clear_bindings", "()V", (void *)native_clear_bindings},
-};
-
-int register_android_database_SQLiteProgram(JNIEnv * env)
-{
-    jclass clazz;
-
-    clazz = env->FindClass("android/database/sqlite/SQLiteProgram");
-    if (clazz == NULL) {
-        ALOGE("Can't find android/database/sqlite/SQLiteProgram");
-        return -1;
-    }
-
-    gHandleField = env->GetFieldID(clazz, "nHandle", "I");
-    gStatementField = env->GetFieldID(clazz, "nStatement", "I");
-
-    if (gHandleField == NULL || gStatementField == NULL) {
-        ALOGE("Error locating fields");
-        return -1;
-    }
-
-    return AndroidRuntime::registerNativeMethods(env,
-        "android/database/sqlite/SQLiteProgram", sMethods, NELEM(sMethods));
-}
-
-} // namespace android
diff --git a/core/jni/android_database_SQLiteQuery.cpp b/core/jni/android_database_SQLiteQuery.cpp
deleted file mode 100644
index da7ccf0..0000000
--- a/core/jni/android_database_SQLiteQuery.cpp
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- * Copyright (C) 2006 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.
- */
-
-#undef LOG_TAG
-#define LOG_TAG "SqliteCursor.cpp"
-
-#include <jni.h>
-#include <JNIHelp.h>
-#include <android_runtime/AndroidRuntime.h>
-
-#include <sqlite3.h>
-
-#include <utils/Log.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "binder/CursorWindow.h"
-#include "sqlite3_exception.h"
-
-
-namespace android {
-
-enum CopyRowResult {
-    CPR_OK,
-    CPR_FULL,
-    CPR_ERROR,
-};
-
-static CopyRowResult copyRow(JNIEnv* env, CursorWindow* window,
-        sqlite3_stmt* statement, int numColumns, int startPos, int addedRows) {
-    // Allocate a new field directory for the row. This pointer is not reused
-    // since it may be possible for it to be relocated on a call to alloc() when
-    // the field data is being allocated.
-    status_t status = window->allocRow();
-    if (status) {
-        LOG_WINDOW("Failed allocating fieldDir at startPos %d row %d, error=%d",
-                startPos, addedRows, status);
-        return CPR_FULL;
-    }
-
-    // Pack the row into the window.
-    CopyRowResult result = CPR_OK;
-    for (int i = 0; i < numColumns; i++) {
-        int type = sqlite3_column_type(statement, i);
-        if (type == SQLITE_TEXT) {
-            // TEXT data
-            const char* text = reinterpret_cast<const char*>(
-                    sqlite3_column_text(statement, i));
-            // SQLite does not include the NULL terminator in size, but does
-            // ensure all strings are NULL terminated, so increase size by
-            // one to make sure we store the terminator.
-            size_t sizeIncludingNull = sqlite3_column_bytes(statement, i) + 1;
-            status = window->putString(addedRows, i, text, sizeIncludingNull);
-            if (status) {
-                LOG_WINDOW("Failed allocating %u bytes for text at %d,%d, error=%d",
-                        sizeIncludingNull, startPos + addedRows, i, status);
-                result = CPR_FULL;
-                break;
-            }
-            LOG_WINDOW("%d,%d is TEXT with %u bytes",
-                    startPos + addedRows, i, sizeIncludingNull);
-        } else if (type == SQLITE_INTEGER) {
-            // INTEGER data
-            int64_t value = sqlite3_column_int64(statement, i);
-            status = window->putLong(addedRows, i, value);
-            if (status) {
-                LOG_WINDOW("Failed allocating space for a long in column %d, error=%d",
-                        i, status);
-                result = CPR_FULL;
-                break;
-            }
-            LOG_WINDOW("%d,%d is INTEGER 0x%016llx", startPos + addedRows, i, value);
-        } else if (type == SQLITE_FLOAT) {
-            // FLOAT data
-            double value = sqlite3_column_double(statement, i);
-            status = window->putDouble(addedRows, i, value);
-            if (status) {
-                LOG_WINDOW("Failed allocating space for a double in column %d, error=%d",
-                        i, status);
-                result = CPR_FULL;
-                break;
-            }
-            LOG_WINDOW("%d,%d is FLOAT %lf", startPos + addedRows, i, value);
-        } else if (type == SQLITE_BLOB) {
-            // BLOB data
-            const void* blob = sqlite3_column_blob(statement, i);
-            size_t size = sqlite3_column_bytes(statement, i);
-            status = window->putBlob(addedRows, i, blob, size);
-            if (status) {
-                LOG_WINDOW("Failed allocating %u bytes for blob at %d,%d, error=%d",
-                        size, startPos + addedRows, i, status);
-                result = CPR_FULL;
-                break;
-            }
-            LOG_WINDOW("%d,%d is Blob with %u bytes",
-                    startPos + addedRows, i, size);
-        } else if (type == SQLITE_NULL) {
-            // NULL field
-            status = window->putNull(addedRows, i);
-            if (status) {
-                LOG_WINDOW("Failed allocating space for a null in column %d, error=%d",
-                        i, status);
-                result = CPR_FULL;
-                break;
-            }
-
-            LOG_WINDOW("%d,%d is NULL", startPos + addedRows, i);
-        } else {
-            // Unknown data
-            ALOGE("Unknown column type when filling database window");
-            throw_sqlite3_exception(env, "Unknown column type when filling window");
-            result = CPR_ERROR;
-            break;
-        }
-    }
-
-    // Free the last row if if was not successfully copied.
-    if (result != CPR_OK) {
-        window->freeLastRow();
-    }
-    return result;
-}
-
-static jlong nativeFillWindow(JNIEnv* env, jclass clazz, jint databasePtr,
-        jint statementPtr, jint windowPtr, jint offsetParam,
-        jint startPos, jint requiredPos, jboolean countAllRows) {
-    sqlite3* database = reinterpret_cast<sqlite3*>(databasePtr);
-    sqlite3_stmt* statement = reinterpret_cast<sqlite3_stmt*>(statementPtr);
-    CursorWindow* window = reinterpret_cast<CursorWindow*>(windowPtr);
-
-    // Only do the binding if there is a valid offsetParam. If no binding needs to be done
-    // offsetParam will be set to 0, an invalid value.
-    if (offsetParam > 0) {
-        // Bind the offset parameter, telling the program which row to start with
-        // If an offset parameter is used, we cannot simply clear the window if it
-        // turns out that the requiredPos won't fit because the result set may
-        // depend on startPos, so we set startPos to requiredPos.
-        startPos = requiredPos;
-        int err = sqlite3_bind_int(statement, offsetParam, startPos);
-        if (err != SQLITE_OK) {
-            ALOGE("Unable to bind offset position, offsetParam = %d", offsetParam);
-            throw_sqlite3_exception(env, database);
-            return 0;
-        }
-        LOG_WINDOW("Bound offset position to startPos %d", startPos);
-    }
-
-    // We assume numRows is initially 0.
-    LOG_WINDOW("Window: numRows = %d, size = %d, freeSpace = %d",
-            window->getNumRows(), window->size(), window->freeSpace());
-
-    int numColumns = sqlite3_column_count(statement);
-    status_t status = window->setNumColumns(numColumns);
-    if (status) {
-        ALOGE("Failed to change column count from %d to %d", window->getNumColumns(), numColumns);
-        jniThrowException(env, "java/lang/IllegalStateException", "numColumns mismatch");
-        return 0;
-    }
-
-    int retryCount = 0;
-    int totalRows = 0;
-    int addedRows = 0;
-    bool windowFull = false;
-    bool gotException = false;
-    while (!gotException && (!windowFull || countAllRows)) {
-        int err = sqlite3_step(statement);
-        if (err == SQLITE_ROW) {
-            LOG_WINDOW("Stepped statement %p to row %d", statement, totalRows);
-            retryCount = 0;
-            totalRows += 1;
-
-            // Skip the row if the window is full or we haven't reached the start position yet.
-            if (startPos >= totalRows || windowFull) {
-                continue;
-            }
-
-            CopyRowResult cpr = copyRow(env, window, statement, numColumns, startPos, addedRows);
-            if (cpr == CPR_FULL && addedRows && startPos + addedRows < requiredPos) {
-                // We filled the window before we got to the one row that we really wanted.
-                // Clear the window and start filling it again from here.
-                // TODO: Would be nicer if we could progressively replace earlier rows.
-                window->clear();
-                window->setNumColumns(numColumns);
-                startPos += addedRows;
-                addedRows = 0;
-                cpr = copyRow(env, window, statement, numColumns, startPos, addedRows);
-            }
-
-            if (cpr == CPR_OK) {
-                addedRows += 1;
-            } else if (cpr == CPR_FULL) {
-                windowFull = true;
-            } else {
-                gotException = true;
-            }
-        } else if (err == SQLITE_DONE) {
-            // All rows processed, bail
-            LOG_WINDOW("Processed all rows");
-            break;
-        } else if (err == SQLITE_LOCKED || err == SQLITE_BUSY) {
-            // The table is locked, retry
-            LOG_WINDOW("Database locked, retrying");
-            if (retryCount > 50) {
-                ALOGE("Bailing on database busy retry");
-                throw_sqlite3_exception(env, database, "retrycount exceeded");
-                gotException = true;
-            } else {
-                // Sleep to give the thread holding the lock a chance to finish
-                usleep(1000);
-                retryCount++;
-            }
-        } else {
-            throw_sqlite3_exception(env, database);
-            gotException = true;
-        }
-    }
-
-    LOG_WINDOW("Resetting statement %p after fetching %d rows and adding %d rows"
-            "to the window in %d bytes",
-            statement, totalRows, addedRows, window->size() - window->freeSpace());
-    sqlite3_reset(statement);
-
-    // Report the total number of rows on request.
-    if (startPos > totalRows) {
-        ALOGE("startPos %d > actual rows %d", startPos, totalRows);
-    }
-    jlong result = jlong(startPos) << 32 | jlong(totalRows);
-    return result;
-}
-
-static jint nativeColumnCount(JNIEnv* env, jclass clazz, jint statementPtr) {
-    sqlite3_stmt* statement = reinterpret_cast<sqlite3_stmt*>(statementPtr);
-    return sqlite3_column_count(statement);
-}
-
-static jstring nativeColumnName(JNIEnv* env, jclass clazz, jint statementPtr,
-        jint columnIndex) {
-    sqlite3_stmt* statement = reinterpret_cast<sqlite3_stmt*>(statementPtr);
-    const char* name = sqlite3_column_name(statement, columnIndex);
-    return env->NewStringUTF(name);
-}
-
-
-static JNINativeMethod sMethods[] =
-{
-     /* name, signature, funcPtr */
-    { "nativeFillWindow", "(IIIIIIZ)J",
-            (void*)nativeFillWindow },
-    { "nativeColumnCount", "(I)I",
-            (void*)nativeColumnCount},
-    { "nativeColumnName", "(II)Ljava/lang/String;",
-            (void*)nativeColumnName},
-};
-
-int register_android_database_SQLiteQuery(JNIEnv * env)
-{
-    return AndroidRuntime::registerNativeMethods(env,
-        "android/database/sqlite/SQLiteQuery", sMethods, NELEM(sMethods));
-}
-
-} // namespace android
diff --git a/core/jni/android_database_SQLiteStatement.cpp b/core/jni/android_database_SQLiteStatement.cpp
deleted file mode 100644
index e376258..0000000
--- a/core/jni/android_database_SQLiteStatement.cpp
+++ /dev/null
@@ -1,286 +0,0 @@
-/* //device/libs/android_runtime/android_database_SQLiteCursor.cpp
-**
-** Copyright 2006, 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.
-*/
-
-#undef LOG_TAG
-#define LOG_TAG "SQLiteStatementCpp"
-
-#include "android_util_Binder.h"
-
-#include <jni.h>
-#include <JNIHelp.h>
-#include <android_runtime/AndroidRuntime.h>
-
-#include <sqlite3.h>
-
-#include <cutils/ashmem.h>
-#include <utils/Log.h>
-
-#include <fcntl.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/mman.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include "sqlite3_exception.h"
-
-namespace android {
-
-
-sqlite3_stmt * compile(JNIEnv* env, jobject object,
-                       sqlite3 * handle, jstring sqlString);
-
-static jfieldID gHandleField;
-static jfieldID gStatementField;
-
-
-#define GET_STATEMENT(env, object) \
-        (sqlite3_stmt *)env->GetIntField(object, gStatementField)
-#define GET_HANDLE(env, object) \
-        (sqlite3 *)env->GetIntField(object, gHandleField)
-
-
-static jint native_execute(JNIEnv* env, jobject object)
-{
-    int err;
-    sqlite3 * handle = GET_HANDLE(env, object);
-    sqlite3_stmt * statement = GET_STATEMENT(env, object);
-    int numChanges = -1;
-
-    // Execute the statement
-    err = sqlite3_step(statement);
-
-    // Throw an exception if an error occurred
-    if (err == SQLITE_ROW) {
-        throw_sqlite3_exception(env,
-                "Queries can be performed using SQLiteDatabase query or rawQuery methods only.");
-    } else if (err != SQLITE_DONE) {
-        throw_sqlite3_exception_errcode(env, err, sqlite3_errmsg(handle));
-    } else {
-        numChanges = sqlite3_changes(handle);
-    }
-
-    // Reset the statement so it's ready to use again
-    sqlite3_reset(statement);
-    return numChanges;
-}
-
-static jlong native_executeInsert(JNIEnv* env, jobject object)
-{
-    sqlite3 * handle = GET_HANDLE(env, object);
-    jint numChanges = native_execute(env, object);
-    if (numChanges > 0) {
-        return sqlite3_last_insert_rowid(handle);
-    } else {
-        return -1;
-    }
-}
-
-static jlong native_1x1_long(JNIEnv* env, jobject object)
-{
-    int err;
-    sqlite3 * handle = GET_HANDLE(env, object);
-    sqlite3_stmt * statement = GET_STATEMENT(env, object);
-    jlong value = -1;
-
-    // Execute the statement
-    err = sqlite3_step(statement);
-
-    // Handle the result
-    if (err == SQLITE_ROW) {
-        // No errors, read the data and return it
-        value = sqlite3_column_int64(statement, 0);
-    } else {
-        throw_sqlite3_exception_errcode(env, err, sqlite3_errmsg(handle));
-    }
-
-    // Reset the statment so it's ready to use again
-    sqlite3_reset(statement);
-
-    return value;
-}
-
-static jstring native_1x1_string(JNIEnv* env, jobject object)
-{
-    int err;
-    sqlite3 * handle = GET_HANDLE(env, object);
-    sqlite3_stmt * statement = GET_STATEMENT(env, object);
-    jstring value = NULL;
-
-    // Execute the statement
-    err = sqlite3_step(statement);
-
-    // Handle the result
-    if (err == SQLITE_ROW) {
-        // No errors, read the data and return it
-        char const * text = (char const *)sqlite3_column_text(statement, 0);
-        value = env->NewStringUTF(text);
-    } else {
-        throw_sqlite3_exception_errcode(env, err, sqlite3_errmsg(handle));
-    }
-
-    // Reset the statment so it's ready to use again
-    sqlite3_reset(statement);
-
-    return value;
-}
-
-static jobject createParcelFileDescriptor(JNIEnv * env, int fd)
-{
-    // Create FileDescriptor object
-    jobject fileDesc = jniCreateFileDescriptor(env, fd);
-    if (fileDesc == NULL) {
-        // FileDescriptor constructor has thrown an exception
-        close(fd);
-        return NULL;
-    }
-
-    // Wrap it in a ParcelFileDescriptor
-    jobject parcelFileDesc = newParcelFileDescriptor(env, fileDesc);
-    if (parcelFileDesc == NULL) {
-        // ParcelFileDescriptor constructor has thrown an exception
-        close(fd);
-        return NULL;
-    }
-
-    return parcelFileDesc;
-}
-
-// Creates an ashmem area, copies some data into it, and returns
-// a ParcelFileDescriptor for the ashmem area.
-static jobject create_ashmem_region_with_data(JNIEnv * env,
-                                              const void * data, int length)
-{
-    // Create ashmem area
-    int fd = ashmem_create_region(NULL, length);
-    if (fd < 0) {
-        ALOGE("ashmem_create_region failed: %s", strerror(errno));
-        jniThrowIOException(env, errno);
-        return NULL;
-    }
-
-    if (length > 0) {
-        // mmap the ashmem area
-        void * ashmem_ptr =
-                mmap(NULL, length, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
-        if (ashmem_ptr == MAP_FAILED) {
-            ALOGE("mmap failed: %s", strerror(errno));
-            jniThrowIOException(env, errno);
-            close(fd);
-            return NULL;
-        }
-
-        // Copy data to ashmem area
-        memcpy(ashmem_ptr, data, length);
-
-        // munmap ashmem area
-        if (munmap(ashmem_ptr, length) < 0) {
-            ALOGE("munmap failed: %s", strerror(errno));
-            jniThrowIOException(env, errno);
-            close(fd);
-            return NULL;
-        }
-    }
-
-    // Make ashmem area read-only
-    if (ashmem_set_prot_region(fd, PROT_READ) < 0) {
-        ALOGE("ashmem_set_prot_region failed: %s", strerror(errno));
-        jniThrowIOException(env, errno);
-        close(fd);
-        return NULL;
-    }
-
-    // Wrap it in a ParcelFileDescriptor
-    return createParcelFileDescriptor(env, fd);
-}
-
-static jobject native_1x1_blob_ashmem(JNIEnv* env, jobject object)
-{
-    int err;
-    sqlite3 * handle = GET_HANDLE(env, object);
-    sqlite3_stmt * statement = GET_STATEMENT(env, object);
-    jobject value = NULL;
-
-    // Execute the statement
-    err = sqlite3_step(statement);
-
-    // Handle the result
-    if (err == SQLITE_ROW) {
-        // No errors, read the data and return it
-        const void * blob = sqlite3_column_blob(statement, 0);
-        if (blob != NULL) {
-            int len = sqlite3_column_bytes(statement, 0);
-            if (len >= 0) {
-                value = create_ashmem_region_with_data(env, blob, len);
-            }
-        }
-    } else {
-        throw_sqlite3_exception_errcode(env, err, sqlite3_errmsg(handle));
-    }
-
-    // Reset the statment so it's ready to use again
-    sqlite3_reset(statement);
-
-    return value;
-}
-
-static void native_executeSql(JNIEnv* env, jobject object, jstring sql)
-{
-    char const* sqlString = env->GetStringUTFChars(sql, NULL);
-    sqlite3 * handle = GET_HANDLE(env, object);
-    int err = sqlite3_exec(handle, sqlString, NULL, NULL, NULL);
-    if (err != SQLITE_OK) {
-        throw_sqlite3_exception(env, handle);
-    }
-    env->ReleaseStringUTFChars(sql, sqlString);
-}
-
-static JNINativeMethod sMethods[] =
-{
-     /* name, signature, funcPtr */
-    {"native_execute", "()I", (void *)native_execute},
-    {"native_executeInsert", "()J", (void *)native_executeInsert},
-    {"native_1x1_long", "()J", (void *)native_1x1_long},
-    {"native_1x1_string", "()Ljava/lang/String;", (void *)native_1x1_string},
-    {"native_1x1_blob_ashmem", "()Landroid/os/ParcelFileDescriptor;", (void *)native_1x1_blob_ashmem},
-    {"native_executeSql", "(Ljava/lang/String;)V", (void *)native_executeSql},
-};
-
-int register_android_database_SQLiteStatement(JNIEnv * env)
-{
-    jclass clazz;
-
-    clazz = env->FindClass("android/database/sqlite/SQLiteStatement");
-    if (clazz == NULL) {
-        ALOGE("Can't find android/database/sqlite/SQLiteStatement");
-        return -1;
-    }
-
-    gHandleField = env->GetFieldID(clazz, "nHandle", "I");
-    gStatementField = env->GetFieldID(clazz, "nStatement", "I");
-
-    if (gHandleField == NULL || gStatementField == NULL) {
-        ALOGE("Error locating fields");
-        return -1;
-    }
-
-    return AndroidRuntime::registerNativeMethods(env,
-        "android/database/sqlite/SQLiteStatement", sMethods, NELEM(sMethods));
-}
-
-} // namespace android
diff --git a/core/jni/android_media_AudioRecord.cpp b/core/jni/android_media_AudioRecord.cpp
index 3052553..547607e 100644
--- a/core/jni/android_media_AudioRecord.cpp
+++ b/core/jni/android_media_AudioRecord.cpp
@@ -147,7 +147,7 @@
     }
 
     int bytesPerSample = audioFormat==javaAudioRecordFields.PCM16 ? 2 : 1;
-    int format = audioFormat==javaAudioRecordFields.PCM16 ? 
+    audio_format_t format = audioFormat==javaAudioRecordFields.PCM16 ?
             AUDIO_FORMAT_PCM_16_BIT : AUDIO_FORMAT_PCM_8_BIT;
 
     if (buffSizeInBytes == 0) {
@@ -157,7 +157,7 @@
     int frameSize = nbChannels * bytesPerSample;
     size_t frameCount = buffSizeInBytes / frameSize;
     
-    if (source >= AUDIO_SOURCE_CNT) {
+    if (uint32_t(source) >= AUDIO_SOURCE_CNT) {
         ALOGE("Error creating AudioRecord: unknown source.");
         return AUDIORECORD_ERROR_SETUP_INVALIDSOURCE;
     }
@@ -198,7 +198,7 @@
     // we use a weak reference so the AudioRecord object can be garbage collected.
     lpCallbackData->audioRecord_ref = env->NewGlobalRef(weak_this);
     
-    lpRecorder->set(source,
+    lpRecorder->set((audio_source_t) source,
         sampleRateInHertz,
         format,        // word length, PCM
         channels,
diff --git a/core/jni/android_media_AudioSystem.cpp b/core/jni/android_media_AudioSystem.cpp
index 0c5101f..6b4c5e8 100644
--- a/core/jni/android_media_AudioSystem.cpp
+++ b/core/jni/android_media_AudioSystem.cpp
@@ -28,7 +28,6 @@
 #include "android_runtime/AndroidRuntime.h"
 
 #include <media/AudioSystem.h>
-#include <media/AudioTrack.h>
 
 #include <system/audio.h>
 #include <system/audio_policy.h>
@@ -72,7 +71,7 @@
 android_media_AudioSystem_isStreamActive(JNIEnv *env, jobject thiz, jint stream, jint inPastMs)
 {
     bool state = false;
-    AudioSystem::isStreamActive(stream, &state, inPastMs);
+    AudioSystem::isStreamActive((audio_stream_type_t) stream, &state, inPastMs);
     return state;
 }
 
@@ -152,13 +151,7 @@
 static int
 android_media_AudioSystem_setPhoneState(JNIEnv *env, jobject thiz, jint state)
 {
-    return check_AudioSystem_Command(AudioSystem::setPhoneState(state));
-}
-
-static int
-android_media_AudioSystem_setRingerMode(JNIEnv *env, jobject thiz, jint mode, jint mask)
-{
-    return check_AudioSystem_Command(AudioSystem::setRingerMode(mode, mask));
+    return check_AudioSystem_Command(AudioSystem::setPhoneState((audio_mode_t) state));
 }
 
 static int
@@ -183,16 +176,29 @@
 }
 
 static int
-android_media_AudioSystem_setStreamVolumeIndex(JNIEnv *env, jobject thiz, jint stream, jint index)
+android_media_AudioSystem_setStreamVolumeIndex(JNIEnv *env,
+                                               jobject thiz,
+                                               jint stream,
+                                               jint index,
+                                               jint device)
 {
-    return check_AudioSystem_Command(AudioSystem::setStreamVolumeIndex(static_cast <audio_stream_type_t>(stream), index));
+    return check_AudioSystem_Command(
+            AudioSystem::setStreamVolumeIndex(static_cast <audio_stream_type_t>(stream),
+                                              index,
+                                              (audio_devices_t)device));
 }
 
 static int
-android_media_AudioSystem_getStreamVolumeIndex(JNIEnv *env, jobject thiz, jint stream)
+android_media_AudioSystem_getStreamVolumeIndex(JNIEnv *env,
+                                               jobject thiz,
+                                               jint stream,
+                                               jint device)
 {
     int index;
-    if (AudioSystem::getStreamVolumeIndex(static_cast <audio_stream_type_t>(stream), &index) != NO_ERROR) {
+    if (AudioSystem::getStreamVolumeIndex(static_cast <audio_stream_type_t>(stream),
+                                          &index,
+                                          (audio_devices_t)device)
+            != NO_ERROR) {
         index = -1;
     }
     return index;
@@ -215,12 +221,11 @@
     {"setDeviceConnectionState", "(IILjava/lang/String;)I", (void *)android_media_AudioSystem_setDeviceConnectionState},
     {"getDeviceConnectionState", "(ILjava/lang/String;)I",  (void *)android_media_AudioSystem_getDeviceConnectionState},
     {"setPhoneState",       "(I)I",     (void *)android_media_AudioSystem_setPhoneState},
-    {"setRingerMode",       "(II)I",    (void *)android_media_AudioSystem_setRingerMode},
     {"setForceUse",         "(II)I",    (void *)android_media_AudioSystem_setForceUse},
     {"getForceUse",         "(I)I",     (void *)android_media_AudioSystem_getForceUse},
     {"initStreamVolume",    "(III)I",   (void *)android_media_AudioSystem_initStreamVolume},
-    {"setStreamVolumeIndex","(II)I",    (void *)android_media_AudioSystem_setStreamVolumeIndex},
-    {"getStreamVolumeIndex","(I)I",     (void *)android_media_AudioSystem_getStreamVolumeIndex},
+    {"setStreamVolumeIndex","(III)I",   (void *)android_media_AudioSystem_setStreamVolumeIndex},
+    {"getStreamVolumeIndex","(II)I",    (void *)android_media_AudioSystem_getStreamVolumeIndex},
     {"getDevicesForStream", "(I)I",     (void *)android_media_AudioSystem_getDevicesForStream},
 };
 
diff --git a/core/jni/android_media_AudioTrack.cpp b/core/jni/android_media_AudioTrack.cpp
index 4067324..26c9435 100644
--- a/core/jni/android_media_AudioTrack.cpp
+++ b/core/jni/android_media_AudioTrack.cpp
@@ -49,14 +49,6 @@
     jmethodID postNativeEventInJava; //... event post callback method
     int       PCM16;                 //...  format constants
     int       PCM8;                  //...  format constants
-    int       STREAM_VOICE_CALL;     //...  stream type constants
-    int       STREAM_SYSTEM;         //...  stream type constants
-    int       STREAM_RING;           //...  stream type constants
-    int       STREAM_MUSIC;          //...  stream type constants
-    int       STREAM_ALARM;          //...  stream type constants
-    int       STREAM_NOTIFICATION;   //...  stream type constants
-    int       STREAM_BLUETOOTH_SCO;  //...  stream type constants
-    int       STREAM_DTMF;           //...  stream type constants
     int       MODE_STREAM;           //...  memory mode
     int       MODE_STATIC;           //...  memory mode
     jfieldID  nativeTrackInJavaObj;  // stores in Java the native AudioTrack object
@@ -75,7 +67,7 @@
         sp<MemoryHeapBase>         mMemHeap;
         sp<MemoryBase>             mMemBase;
         audiotrack_callback_cookie mCallbackData;
-        int                        mStreamType;
+        audio_stream_type_t        mStreamType;
 
     AudioTrackJniStorage() {
         mCallbackData.audioTrack_class = 0;
@@ -175,11 +167,11 @@
     int afSampleRate;
     int afFrameCount;
 
-    if (AudioSystem::getOutputFrameCount(&afFrameCount, streamType) != NO_ERROR) {
+    if (AudioSystem::getOutputFrameCount(&afFrameCount, (audio_stream_type_t) streamType) != NO_ERROR) {
         ALOGE("Error creating AudioTrack: Could not get AudioSystem frame count.");
         return AUDIOTRACK_ERROR_SETUP_AUDIOSYSTEM;
     }
-    if (AudioSystem::getOutputSamplingRate(&afSampleRate, streamType) != NO_ERROR) {
+    if (AudioSystem::getOutputSamplingRate(&afSampleRate, (audio_stream_type_t) streamType) != NO_ERROR) {
         ALOGE("Error creating AudioTrack: Could not get AudioSystem sampling rate.");
         return AUDIOTRACK_ERROR_SETUP_AUDIOSYSTEM;
     }
@@ -197,23 +189,18 @@
     
     // check the stream type
     audio_stream_type_t atStreamType;
-    if (streamType == javaAudioTrackFields.STREAM_VOICE_CALL) {
-        atStreamType = AUDIO_STREAM_VOICE_CALL;
-    } else if (streamType == javaAudioTrackFields.STREAM_SYSTEM) {
-        atStreamType = AUDIO_STREAM_SYSTEM;
-    } else if (streamType == javaAudioTrackFields.STREAM_RING) {
-        atStreamType = AUDIO_STREAM_RING;
-    } else if (streamType == javaAudioTrackFields.STREAM_MUSIC) {
-        atStreamType = AUDIO_STREAM_MUSIC;
-    } else if (streamType == javaAudioTrackFields.STREAM_ALARM) {
-        atStreamType = AUDIO_STREAM_ALARM;
-    } else if (streamType == javaAudioTrackFields.STREAM_NOTIFICATION) {
-        atStreamType = AUDIO_STREAM_NOTIFICATION;
-    } else if (streamType == javaAudioTrackFields.STREAM_BLUETOOTH_SCO) {
-        atStreamType = AUDIO_STREAM_BLUETOOTH_SCO;
-    } else if (streamType == javaAudioTrackFields.STREAM_DTMF) {
-        atStreamType = AUDIO_STREAM_DTMF;
-    } else {
+    switch (streamType) {
+    case AUDIO_STREAM_VOICE_CALL:
+    case AUDIO_STREAM_SYSTEM:
+    case AUDIO_STREAM_RING:
+    case AUDIO_STREAM_MUSIC:
+    case AUDIO_STREAM_ALARM:
+    case AUDIO_STREAM_NOTIFICATION:
+    case AUDIO_STREAM_BLUETOOTH_SCO:
+    case AUDIO_STREAM_DTMF:
+        atStreamType = (audio_stream_type_t) streamType;
+        break;
+    default:
         ALOGE("Error creating AudioTrack: unknown stream type.");
         return AUDIOTRACK_ERROR_SETUP_INVALIDSTREAMTYPE;
     }
@@ -227,7 +214,7 @@
 
     // for the moment 8bitPCM in MODE_STATIC is not supported natively in the AudioTrack C++ class
     // so we declare everything as 16bitPCM, the 8->16bit conversion for MODE_STATIC will be handled
-    // in android_media_AudioTrack_native_write()
+    // in android_media_AudioTrack_native_write_byte()
     if ((audioFormat == javaAudioTrackFields.PCM8) 
         && (memoryMode == javaAudioTrackFields.MODE_STATIC)) {
         ALOGV("android_media_AudioTrack_native_setup(): requesting MODE_STATIC for 8bit \
@@ -240,7 +227,7 @@
 
     // compute the frame count
     int bytesPerSample = audioFormat == javaAudioTrackFields.PCM16 ? 2 : 1;
-    int format = audioFormat == javaAudioTrackFields.PCM16 ? 
+    audio_format_t format = audioFormat == javaAudioTrackFields.PCM16 ?
             AUDIO_FORMAT_PCM_16_BIT : AUDIO_FORMAT_PCM_8_BIT;
     int frameCount = buffSizeInBytes / (nbChannels * bytesPerSample);
     
@@ -519,13 +506,13 @@
 }
 
 // ----------------------------------------------------------------------------
-static jint android_media_AudioTrack_native_write(JNIEnv *env,  jobject thiz,
+static jint android_media_AudioTrack_native_write_byte(JNIEnv *env,  jobject thiz,
                                                   jbyteArray javaAudioData,
                                                   jint offsetInBytes, jint sizeInBytes,
                                                   jint javaAudioFormat) {
     jbyte* cAudioData = NULL;
     AudioTrack *lpTrack = NULL;
-    //ALOGV("android_media_AudioTrack_native_write(offset=%d, sizeInBytes=%d) called",
+    //ALOGV("android_media_AudioTrack_native_write_byte(offset=%d, sizeInBytes=%d) called",
     //    offsetInBytes, sizeInBytes);
     
     // get the audio track to load with samples
@@ -567,7 +554,7 @@
                                                   jshortArray javaAudioData,
                                                   jint offsetInShorts, jint sizeInShorts,
                                                   jint javaAudioFormat) {
-    return (android_media_AudioTrack_native_write(env, thiz,
+    return (android_media_AudioTrack_native_write_byte(env, thiz,
                                                  (jbyteArray) javaAudioData,
                                                  offsetInShorts*2, sizeInShorts*2,
                                                  javaAudioFormat)
@@ -764,24 +751,20 @@
     // convert the stream type from Java to native value
     // FIXME: code duplication with android_media_AudioTrack_native_setup()
     audio_stream_type_t nativeStreamType;
-    if (javaStreamType == javaAudioTrackFields.STREAM_VOICE_CALL) {
-        nativeStreamType = AUDIO_STREAM_VOICE_CALL;
-    } else if (javaStreamType == javaAudioTrackFields.STREAM_SYSTEM) {
-        nativeStreamType = AUDIO_STREAM_SYSTEM;
-    } else if (javaStreamType == javaAudioTrackFields.STREAM_RING) {
-        nativeStreamType = AUDIO_STREAM_RING;
-    } else if (javaStreamType == javaAudioTrackFields.STREAM_MUSIC) {
-        nativeStreamType = AUDIO_STREAM_MUSIC;
-    } else if (javaStreamType == javaAudioTrackFields.STREAM_ALARM) {
-        nativeStreamType = AUDIO_STREAM_ALARM;
-    } else if (javaStreamType == javaAudioTrackFields.STREAM_NOTIFICATION) {
-        nativeStreamType = AUDIO_STREAM_NOTIFICATION;
-    } else if (javaStreamType == javaAudioTrackFields.STREAM_BLUETOOTH_SCO) {
-        nativeStreamType = AUDIO_STREAM_BLUETOOTH_SCO;
-    } else if (javaStreamType == javaAudioTrackFields.STREAM_DTMF) {
-        nativeStreamType = AUDIO_STREAM_DTMF;
-    } else {
+    switch (javaStreamType) {
+    case AUDIO_STREAM_VOICE_CALL:
+    case AUDIO_STREAM_SYSTEM:
+    case AUDIO_STREAM_RING:
+    case AUDIO_STREAM_MUSIC:
+    case AUDIO_STREAM_ALARM:
+    case AUDIO_STREAM_NOTIFICATION:
+    case AUDIO_STREAM_BLUETOOTH_SCO:
+    case AUDIO_STREAM_DTMF:
+        nativeStreamType = (audio_stream_type_t) javaStreamType;
+        break;
+    default:
         nativeStreamType = AUDIO_STREAM_DEFAULT;
+        break;
     }
 
     if (AudioSystem::getOutputSamplingRate(&afSamplingRate, nativeStreamType) != NO_ERROR) {
@@ -851,7 +834,7 @@
                                          (void *)android_media_AudioTrack_native_setup},
     {"native_finalize",      "()V",      (void *)android_media_AudioTrack_native_finalize},
     {"native_release",       "()V",      (void *)android_media_AudioTrack_native_release},
-    {"native_write_byte",    "([BIII)I", (void *)android_media_AudioTrack_native_write},
+    {"native_write_byte",    "([BIII)I", (void *)android_media_AudioTrack_native_write_byte},
     {"native_write_short",   "([SIII)I", (void *)android_media_AudioTrack_native_write_short},
     {"native_setVolume",     "(FF)V",    (void *)android_media_AudioTrack_set_volume},
     {"native_get_native_frame_count",
@@ -987,41 +970,6 @@
         return -1;
     }
  
-    // Get the stream types from the AudioManager class
-    jclass audioManagerClass = NULL;
-    audioManagerClass = env->FindClass(JAVA_AUDIOMANAGER_CLASS_NAME);
-    if (audioManagerClass == NULL) {
-       ALOGE("Can't find %s", JAVA_AUDIOMANAGER_CLASS_NAME);
-       return -1;
-    }
-    if ( !android_media_getIntConstantFromClass(env, audioManagerClass,
-               JAVA_AUDIOMANAGER_CLASS_NAME,
-               JAVA_CONST_STREAM_VOICE_CALL_NAME, &(javaAudioTrackFields.STREAM_VOICE_CALL))
-          || !android_media_getIntConstantFromClass(env, audioManagerClass,
-               JAVA_AUDIOMANAGER_CLASS_NAME,
-               JAVA_CONST_STREAM_MUSIC_NAME, &(javaAudioTrackFields.STREAM_MUSIC))
-          || !android_media_getIntConstantFromClass(env, audioManagerClass,
-               JAVA_AUDIOMANAGER_CLASS_NAME,
-               JAVA_CONST_STREAM_SYSTEM_NAME, &(javaAudioTrackFields.STREAM_SYSTEM))
-          || !android_media_getIntConstantFromClass(env, audioManagerClass,
-               JAVA_AUDIOMANAGER_CLASS_NAME,
-               JAVA_CONST_STREAM_RING_NAME, &(javaAudioTrackFields.STREAM_RING))
-          || !android_media_getIntConstantFromClass(env, audioManagerClass,
-               JAVA_AUDIOMANAGER_CLASS_NAME,
-               JAVA_CONST_STREAM_ALARM_NAME, &(javaAudioTrackFields.STREAM_ALARM))
-          || !android_media_getIntConstantFromClass(env, audioManagerClass,
-               JAVA_AUDIOMANAGER_CLASS_NAME,
-               JAVA_CONST_STREAM_NOTIFICATION_NAME, &(javaAudioTrackFields.STREAM_NOTIFICATION))
-          || !android_media_getIntConstantFromClass(env, audioManagerClass,
-               JAVA_AUDIOMANAGER_CLASS_NAME,
-               JAVA_CONST_STREAM_BLUETOOTH_SCO_NAME, &(javaAudioTrackFields.STREAM_BLUETOOTH_SCO))
-          || !android_media_getIntConstantFromClass(env, audioManagerClass,
-               JAVA_AUDIOMANAGER_CLASS_NAME,
-               JAVA_CONST_STREAM_DTMF_NAME, &(javaAudioTrackFields.STREAM_DTMF))) {
-       // error log performed in android_media_getIntConstantFromClass()
-       return -1;
-    }
-
     return AndroidRuntime::registerNativeMethods(env, kClassPathName, gMethods, NELEM(gMethods));
 }
 
diff --git a/core/jni/android_media_JetPlayer.cpp b/core/jni/android_media_JetPlayer.cpp
index 85c0a9c..9f9bedb 100644
--- a/core/jni/android_media_JetPlayer.cpp
+++ b/core/jni/android_media_JetPlayer.cpp
@@ -523,7 +523,7 @@
             jetPlayerClass,
             JAVA_NATIVEJETPLAYERINJAVAOBJ_FIELD_NAME, "I");
     if (javaJetPlayerFields.nativePlayerInJavaObj == NULL) {
-        ALOGE("Can't find AudioTrack.%s", JAVA_NATIVEJETPLAYERINJAVAOBJ_FIELD_NAME);
+        ALOGE("Can't find JetPlayer.%s", JAVA_NATIVEJETPLAYERINJAVAOBJ_FIELD_NAME);
         return -1;
     }
 
diff --git a/core/jni/android_media_ToneGenerator.cpp b/core/jni/android_media_ToneGenerator.cpp
index 49be1c7..26e82aa 100644
--- a/core/jni/android_media_ToneGenerator.cpp
+++ b/core/jni/android_media_ToneGenerator.cpp
@@ -48,7 +48,7 @@
         return false;
     }
 
-    return lpToneGen->startTone(toneType, durationMs);
+    return lpToneGen->startTone((ToneGenerator::tone_type) toneType, durationMs);
 }
 
 static void android_media_ToneGenerator_stopTone(JNIEnv *env, jobject thiz) {
@@ -79,7 +79,7 @@
 
 static void android_media_ToneGenerator_native_setup(JNIEnv *env, jobject thiz,
         jint streamType, jint volume) {
-    ToneGenerator *lpToneGen = new ToneGenerator(streamType, AudioSystem::linearToLog(volume), true);
+    ToneGenerator *lpToneGen = new ToneGenerator((audio_stream_type_t) streamType, AudioSystem::linearToLog(volume), true);
 
     env->SetIntField(thiz, fields.context, 0);
 
diff --git a/core/jni/android_server_BluetoothService.cpp b/core/jni/android_server_BluetoothService.cpp
index c475261..6c11121 100644
--- a/core/jni/android_server_BluetoothService.cpp
+++ b/core/jni/android_server_BluetoothService.cpp
@@ -1035,7 +1035,7 @@
                             DBUS_ADAPTER_IFACE, "RemoveReservedServiceRecords",
                             DBUS_TYPE_ARRAY, DBUS_TYPE_UINT32,
                             &values, len, DBUS_TYPE_INVALID);
-    env->ReleaseIntArrayElements(handles, values, NULL);
+    env->ReleaseIntArrayElements(handles, values, 0);
     return reply ? JNI_TRUE : JNI_FALSE;
 #endif
     return JNI_FALSE;
diff --git a/core/jni/android_util_AssetManager.cpp b/core/jni/android_util_AssetManager.cpp
index 6ecee35..17130af 100644
--- a/core/jni/android_util_AssetManager.cpp
+++ b/core/jni/android_util_AssetManager.cpp
@@ -434,12 +434,12 @@
 {
     ScopedUtfChars path8(env, path);
     if (path8.c_str() == NULL) {
-        return NULL;
+        return 0;
     }
 
     AssetManager* am = assetManagerForJavaObject(env, clazz);
     if (am == NULL) {
-        return JNI_FALSE;
+        return 0;
     }
 
     void* cookie;
diff --git a/core/jni/android_util_Binder.cpp b/core/jni/android_util_Binder.cpp
index 990a617..e00970a 100644
--- a/core/jni/android_util_Binder.cpp
+++ b/core/jni/android_util_Binder.cpp
@@ -739,6 +739,11 @@
     return IPCThreadState::self()->getCallingUid();
 }
 
+static jint android_os_Binder_getOrigCallingUid(JNIEnv* env, jobject clazz)
+{
+    return IPCThreadState::self()->getOrigCallingUid();
+}
+
 static jlong android_os_Binder_clearCallingIdentity(JNIEnv* env, jobject clazz)
 {
     return IPCThreadState::self()->clearCallingIdentity();
@@ -810,6 +815,7 @@
      /* name, signature, funcPtr */
     { "getCallingPid", "()I", (void*)android_os_Binder_getCallingPid },
     { "getCallingUid", "()I", (void*)android_os_Binder_getCallingUid },
+    { "getOrigCallingUidNative", "()I", (void*)android_os_Binder_getOrigCallingUid },
     { "clearCallingIdentity", "()J", (void*)android_os_Binder_clearCallingIdentity },
     { "restoreCallingIdentity", "(J)V", (void*)android_os_Binder_restoreCallingIdentity },
     { "setThreadStrictModePolicy", "(I)V", (void*)android_os_Binder_setThreadStrictModePolicy },
diff --git a/core/jni/android_util_Log.cpp b/core/jni/android_util_Log.cpp
index a57aad7..2895171 100644
--- a/core/jni/android_util_Log.cpp
+++ b/core/jni/android_util_Log.cpp
@@ -27,6 +27,7 @@
 #include "JNIHelp.h"
 #include "utils/misc.h"
 #include "android_runtime/AndroidRuntime.h"
+#include "android_util_Log.h"
 
 #define MIN(a,b) ((a<b)?a:b)
 
@@ -56,40 +57,48 @@
     return levels.info;
 }
 
+static jboolean isLoggable(const char* tag, jint level) {
+    String8 key;
+    key.append(LOG_NAMESPACE);
+    key.append(tag);
+
+    char buf[PROPERTY_VALUE_MAX];
+    if (property_get(key.string(), buf, "") <= 0) {
+        return false;
+    }
+
+    int logLevel = toLevel(buf);
+    return logLevel >= 0 && level >= logLevel;
+}
+
 static jboolean android_util_Log_isLoggable(JNIEnv* env, jobject clazz, jstring tag, jint level)
 {
-    int len;
-    char key[PROPERTY_KEY_MAX];
-    char buf[PROPERTY_VALUE_MAX];
-
     if (tag == NULL) {
         return false;
     }
 
-    jboolean result = false;
-
     const char* chars = env->GetStringUTFChars(tag, NULL);
+    if (!chars) {
+        return false;
+    }
 
+    jboolean result = false;
     if ((strlen(chars)+sizeof(LOG_NAMESPACE)) > PROPERTY_KEY_MAX) {
         char buf2[200];
         snprintf(buf2, sizeof(buf2), "Log tag \"%s\" exceeds limit of %d characters\n",
                 chars, PROPERTY_KEY_MAX - sizeof(LOG_NAMESPACE));
 
-        // release the chars!
-        env->ReleaseStringUTFChars(tag, chars);
-
         jniThrowException(env, "java/lang/IllegalArgumentException", buf2);
-        return false;
     } else {
-        strncpy(key, LOG_NAMESPACE, sizeof(LOG_NAMESPACE)-1);
-        strcpy(key + sizeof(LOG_NAMESPACE) - 1, chars);
+        result = isLoggable(chars, level);
     }
 
     env->ReleaseStringUTFChars(tag, chars);
+    return result;
+}
 
-    len = property_get(key, buf, "");
-    int logLevel = toLevel(buf);
-    return (logLevel >= 0 && level >= logLevel) ? true : false;
+bool android_util_Log_isVerboseLogEnabled(const char* tag) {
+    return isLoggable(tag, levels.verbose);
 }
 
 /*
diff --git a/core/jni/android_util_Log.h b/core/jni/android_util_Log.h
new file mode 100644
index 0000000..4804a854
--- /dev/null
+++ b/core/jni/android_util_Log.h
@@ -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.
+ */
+
+#ifndef _ANDROID_UTIL_LOG_H
+#define _ANDROID_UTIL_LOG_H
+
+#include <jni.h>
+#include <JNIHelp.h>
+
+
+namespace android {
+
+bool android_util_Log_isVerboseLogEnabled(const char* tag);
+
+}
+
+#endif // _ANDROID_UTIL_LOG_H
diff --git a/core/jni/android_util_Process.cpp b/core/jni/android_util_Process.cpp
index 2c494ac..07a7f22 100644
--- a/core/jni/android_util_Process.cpp
+++ b/core/jni/android_util_Process.cpp
@@ -50,7 +50,7 @@
 static pthread_key_t gBgKey = -1;
 #endif
 
-static void signalExceptionForPriorityError(JNIEnv* env, jobject obj, int err)
+static void signalExceptionForPriorityError(JNIEnv* env, int err)
 {
     switch (err) {
         case EINVAL:
@@ -71,7 +71,7 @@
     }
 }
 
-static void signalExceptionForGroupError(JNIEnv* env, jobject obj, int err)
+static void signalExceptionForGroupError(JNIEnv* env, int err)
 {
     switch (err) {
         case EINVAL:
@@ -173,7 +173,7 @@
 {
     int res = androidSetThreadSchedulingGroup(pid, grp);
     if (res != NO_ERROR) {
-        signalExceptionForGroupError(env, clazz, res == BAD_VALUE ? EINVAL : errno);
+        signalExceptionForGroupError(env, res == BAD_VALUE ? EINVAL : errno);
         return;
     }
 }
@@ -186,7 +186,7 @@
     struct dirent *de;
 
     if (grp > ANDROID_TGROUP_MAX || grp < 0) {
-        signalExceptionForGroupError(env, clazz, EINVAL);
+        signalExceptionForGroupError(env, EINVAL);
         return;
     }
 
@@ -214,7 +214,7 @@
     if (!(d = opendir(proc_path))) {
         // If the process exited on us, don't generate an exception
         if (errno != ENOENT)
-            signalExceptionForGroupError(env, clazz, errno);
+            signalExceptionForGroupError(env, errno);
         return;
     }
 
@@ -240,7 +240,7 @@
         }
 
         if (androidSetThreadSchedulingGroup(t_pid, grp) != NO_ERROR) {
-            signalExceptionForGroupError(env, clazz, errno);
+            signalExceptionForGroupError(env, errno);
             break;
         }
     }
@@ -264,6 +264,21 @@
 #endif
 }
 
+void android_os_Process_setThreadScheduler(JNIEnv* env, jclass clazz,
+                                              jint tid, jint policy, jint pri)
+{
+#ifdef HAVE_SCHED_SETSCHEDULER
+    struct sched_param param;
+    param.sched_priority = pri;
+    int rc = sched_setscheduler(tid, policy, &param);
+    if (rc) {
+        signalExceptionForPriorityError(env, errno);
+    }
+#else
+    signalExceptionForPriorityError(env, ENOSYS);
+#endif
+}
+
 void android_os_Process_setThreadPriority(JNIEnv* env, jobject clazz,
                                               jint pid, jint pri)
 {
@@ -285,9 +300,9 @@
     int rc = androidSetThreadPriority(pid, pri);
     if (rc != 0) {
         if (rc == INVALID_OPERATION) {
-            signalExceptionForPriorityError(env, clazz, errno);
+            signalExceptionForPriorityError(env, errno);
         } else {
-            signalExceptionForGroupError(env, clazz, errno);
+            signalExceptionForGroupError(env, errno);
         }
     }
 
@@ -308,7 +323,7 @@
     errno = 0;
     jint pri = getpriority(PRIO_PROCESS, pid);
     if (errno != 0) {
-        signalExceptionForPriorityError(env, clazz, errno);
+        signalExceptionForPriorityError(env, errno);
     }
     //ALOGI("Returning priority of %d: %d\n", pid, pri);
     return pri;
@@ -389,7 +404,7 @@
     jlong mem = 0;
 
     static const char* const sums[] = { "MemFree:", "Cached:", NULL };
-    static const int sumsLen[] = { strlen("MemFree:"), strlen("Cached:"), NULL };
+    static const int sumsLen[] = { strlen("MemFree:"), strlen("Cached:"), 0 };
 
     char* p = buffer;
     while (*p && numFound < 2) {
@@ -852,6 +867,7 @@
     {"getUidForName",       "(Ljava/lang/String;)I", (void*)android_os_Process_getUidForName},
     {"getGidForName",       "(Ljava/lang/String;)I", (void*)android_os_Process_getGidForName},
     {"setThreadPriority",   "(II)V", (void*)android_os_Process_setThreadPriority},
+    {"setThreadScheduler",  "(III)V", (void*)android_os_Process_setThreadScheduler},
     {"setCanSelfBackground", "(Z)V", (void*)android_os_Process_setCanSelfBackground},
     {"setThreadPriority",   "(I)V", (void*)android_os_Process_setCallingThreadPriority},
     {"getThreadPriority",   "(I)I", (void*)android_os_Process_getThreadPriority},
diff --git a/core/jni/android_view_GLES20Canvas.cpp b/core/jni/android_view_GLES20Canvas.cpp
index 23ad154..e19bb38 100644
--- a/core/jni/android_view_GLES20Canvas.cpp
+++ b/core/jni/android_view_GLES20Canvas.cpp
@@ -44,6 +44,7 @@
 #include <SkiaColorFilter.h>
 #include <Rect.h>
 
+#include <TextLayout.h>
 #include <TextLayoutCache.h>
 
 namespace android {
@@ -187,6 +188,14 @@
     renderer->finish();
 }
 
+static jint android_view_GLES20Canvas_getStencilSize(JNIEnv* env, jobject clazz) {
+    return OpenGLRenderer::getStencilSize();
+}
+
+// ----------------------------------------------------------------------------
+// Functor
+// ----------------------------------------------------------------------------
+
 static bool android_view_GLES20Canvas_callDrawGLFunction(JNIEnv* env, jobject clazz,
         OpenGLRenderer* renderer, Functor *functor) {
     android::uirenderer::Rect dirty;
@@ -482,24 +491,30 @@
 }
 
 // ----------------------------------------------------------------------------
+// Draw filters
+// ----------------------------------------------------------------------------
+
+static void android_view_GLES20Canvas_setupPaintFilter(JNIEnv* env, jobject clazz,
+        OpenGLRenderer* renderer, jint clearBits, jint setBits) {
+    renderer->setupPaintFilter(clearBits, setBits);
+}
+
+static void android_view_GLES20Canvas_resetPaintFilter(JNIEnv* env, jobject clazz,
+        OpenGLRenderer* renderer) {
+    renderer->resetPaintFilter();
+}
+
+// ----------------------------------------------------------------------------
 // Text
 // ----------------------------------------------------------------------------
 
 static void renderText(OpenGLRenderer* renderer, const jchar* text, int count,
         jfloat x, jfloat y, int flags, SkPaint* paint) {
-    sp<TextLayoutCacheValue> value;
-#if USE_TEXT_LAYOUT_CACHE
-    value = TextLayoutCache::getInstance().getValue(paint, text, 0, count, count, flags);
+    sp<TextLayoutValue> value = TextLayoutEngine::getInstance().getValue(paint,
+            text, 0, count, count, flags);
     if (value == NULL) {
-        ALOGE("Cannot get TextLayoutCache value for text = '%s'",
-                String8(text, count).string());
         return;
     }
-#else
-    value = new TextLayoutCacheValue(count);
-    TextLayoutEngine::getInstance().computeValues(value.get(), paint,
-            text, 0, count, count, flags);
-#endif
     const jchar* glyphs = value->getGlyphs();
     size_t glyphsCount = value->getGlyphsCount();
     int bytesCount = glyphsCount * sizeof(jchar);
@@ -509,19 +524,11 @@
 static void renderTextRun(OpenGLRenderer* renderer, const jchar* text,
         jint start, jint count, jint contextCount, jfloat x, jfloat y,
         int flags, SkPaint* paint) {
-    sp<TextLayoutCacheValue> value;
-#if USE_TEXT_LAYOUT_CACHE
-    value = TextLayoutCache::getInstance().getValue(paint, text, start, count, contextCount, flags);
+    sp<TextLayoutValue> value = TextLayoutEngine::getInstance().getValue(paint,
+            text, start, count, contextCount, flags);
     if (value == NULL) {
-        ALOGE("Cannot get TextLayoutCache value for text = '%s'",
-                String8(text + start, count).string());
         return;
     }
-#else
-    value = new TextLayoutCacheValue(count);
-    TextLayoutEngine::getInstance().computeValues(value.get(), paint,
-            text, start, count, contextCount, flags);
-#endif
     const jchar* glyphs = value->getGlyphs();
     size_t glyphsCount = value->getGlyphsCount();
     int bytesCount = glyphsCount * sizeof(jchar);
@@ -566,6 +573,45 @@
     env->ReleaseStringChars(text, textArray);
 }
 
+static void renderPosText(OpenGLRenderer* renderer, const jchar* text, int count,
+        const jfloat* positions, jint dirFlags, SkPaint* paint) {
+    sp<TextLayoutValue> value = TextLayoutEngine::getInstance().getValue(paint,
+            text, 0, count, count, dirFlags);
+    if (value == NULL) {
+        return;
+    }
+    const jchar* glyphs = value->getGlyphs();
+    size_t glyphsCount = value->getGlyphsCount();
+    if (count < int(glyphsCount)) glyphsCount = count;
+    int bytesCount = glyphsCount * sizeof(jchar);
+
+    renderer->drawPosText((const char*) glyphs, bytesCount, glyphsCount, positions, paint);
+}
+
+static void android_view_GLES20Canvas_drawPosTextArray(JNIEnv* env, jobject clazz,
+        OpenGLRenderer* renderer, jcharArray text, jint index, jint count,
+        jfloatArray pos, SkPaint* paint) {
+    jchar* textArray = env->GetCharArrayElements(text, NULL);
+    jfloat* positions = env->GetFloatArrayElements(pos, NULL);
+
+    renderPosText(renderer, textArray + index, count, positions, kBidi_LTR, paint);
+
+    env->ReleaseFloatArrayElements(pos, positions, JNI_ABORT);
+    env->ReleaseCharArrayElements(text, textArray, JNI_ABORT);
+}
+
+static void android_view_GLES20Canvas_drawPosText(JNIEnv* env, jobject clazz,
+        OpenGLRenderer* renderer, jstring text, jint start, jint end,
+        jfloatArray pos, SkPaint* paint) {
+    const jchar* textArray = env->GetStringChars(text, NULL);
+    jfloat* positions = env->GetFloatArrayElements(pos, NULL);
+
+    renderPosText(renderer, textArray + start, end - start, positions, kBidi_LTR, paint);
+
+    env->ReleaseFloatArrayElements(pos, positions, JNI_ABORT);
+    env->ReleaseStringChars(text, textArray);
+}
+
 // ----------------------------------------------------------------------------
 // Display lists
 // ----------------------------------------------------------------------------
@@ -580,6 +626,15 @@
     return displayList->getSize();
 }
 
+static void android_view_GLES20Canvas_setDisplayListName(JNIEnv* env,
+        jobject clazz, DisplayList* displayList, jstring name) {
+    if (name != NULL) {
+        const char* textArray = env->GetStringUTFChars(name, NULL);
+        displayList->setName(textArray);
+        env->ReleaseStringUTFChars(name, textArray);
+    }
+}
+
 static OpenGLRenderer* android_view_GLES20Canvas_createDisplayListRenderer(JNIEnv* env,
         jobject clazz) {
     return new DisplayListRenderer;
@@ -770,6 +825,8 @@
     { "nPrepareDirty",      "(IIIIIZ)V",       (void*) android_view_GLES20Canvas_prepareDirty },
     { "nFinish",            "(I)V",            (void*) android_view_GLES20Canvas_finish },
 
+    { "nGetStencilSize",    "()I",             (void*) android_view_GLES20Canvas_getStencilSize },
+
     { "nCallDrawGLFunction", "(II)Z",
             (void*) android_view_GLES20Canvas_callDrawGLFunction },
 
@@ -821,6 +878,9 @@
     { "nSetupColorFilter",  "(II)V",           (void*) android_view_GLES20Canvas_setupColorFilter },
     { "nSetupShadow",       "(IFFFI)V",        (void*) android_view_GLES20Canvas_setupShadow },
 
+    { "nSetupPaintFilter",  "(III)V",          (void*) android_view_GLES20Canvas_setupPaintFilter },
+    { "nResetPaintFilter",  "(I)V",            (void*) android_view_GLES20Canvas_resetPaintFilter },
+
     { "nDrawText",          "(I[CIIFFII)V",    (void*) android_view_GLES20Canvas_drawTextArray },
     { "nDrawText",          "(ILjava/lang/String;IIFFII)V",
             (void*) android_view_GLES20Canvas_drawText },
@@ -829,16 +889,24 @@
     { "nDrawTextRun",       "(ILjava/lang/String;IIIIFFII)V",
             (void*) android_view_GLES20Canvas_drawTextRun },
 
+    { "nDrawPosText",       "(I[CII[FI)V",     (void*) android_view_GLES20Canvas_drawPosTextArray },
+    { "nDrawPosText",       "(ILjava/lang/String;II[FI)V",
+            (void*) android_view_GLES20Canvas_drawPosText },
+
     { "nGetClipBounds",     "(ILandroid/graphics/Rect;)Z",
             (void*) android_view_GLES20Canvas_getClipBounds },
 
     { "nGetDisplayList",         "(II)I",      (void*) android_view_GLES20Canvas_getDisplayList },
     { "nDestroyDisplayList",     "(I)V",       (void*) android_view_GLES20Canvas_destroyDisplayList },
     { "nGetDisplayListSize",     "(I)I",       (void*) android_view_GLES20Canvas_getDisplayListSize },
-    { "nCreateDisplayListRenderer", "()I",     (void*) android_view_GLES20Canvas_createDisplayListRenderer },
-    { "nResetDisplayListRenderer", "(I)V",     (void*) android_view_GLES20Canvas_resetDisplayListRenderer },
+    { "nSetDisplayListName",     "(ILjava/lang/String;)V",
+                                               (void*) android_view_GLES20Canvas_setDisplayListName },
     { "nDrawDisplayList",        "(IIIILandroid/graphics/Rect;)Z",
                                                (void*) android_view_GLES20Canvas_drawDisplayList },
+
+    { "nCreateDisplayListRenderer", "()I",     (void*) android_view_GLES20Canvas_createDisplayListRenderer },
+    { "nResetDisplayListRenderer",  "(I)V",    (void*) android_view_GLES20Canvas_resetDisplayListRenderer },
+
     { "nOutputDisplayList",      "(II)V",      (void*) android_view_GLES20Canvas_outputDisplayList },
     { "nInterrupt",              "(I)V",       (void*) android_view_GLES20Canvas_interrupt },
     { "nResume",                 "(I)V",       (void*) android_view_GLES20Canvas_resume },
diff --git a/core/jni/android_view_HardwareRenderer.cpp b/core/jni/android_view_HardwareRenderer.cpp
index 09809ec..cdcde51 100644
--- a/core/jni/android_view_HardwareRenderer.cpp
+++ b/core/jni/android_view_HardwareRenderer.cpp
@@ -22,6 +22,8 @@
 
 #include <EGL/egl_cache.h>
 
+EGLAPI void EGLAPIENTRY eglBeginFrame(EGLDisplay dpy, EGLSurface surface);
+
 namespace android {
 
 // ----------------------------------------------------------------------------
@@ -36,6 +38,12 @@
     env->ReleaseStringUTFChars(diskCachePath, cacheArray);
 }
 
+static void android_view_HardwareRenderer_beginFrame(JNIEnv* env, jobject clazz) {
+    EGLDisplay dpy = eglGetCurrentDisplay();
+    EGLSurface surf = eglGetCurrentSurface(EGL_DRAW);
+    eglBeginFrame(dpy, surf);
+}
+
 // ----------------------------------------------------------------------------
 // JNI Glue
 // ----------------------------------------------------------------------------
@@ -45,6 +53,8 @@
 static JNINativeMethod gMethods[] = {
     { "nSetupShadersDiskCache", "(Ljava/lang/String;)V",
             (void*) android_view_HardwareRenderer_setupShadersDiskCache },
+    { "nBeginFrame", "()V",
+            (void*) android_view_HardwareRenderer_beginFrame },
 };
 
 int register_android_view_HardwareRenderer(JNIEnv* env) {
diff --git a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp
index 79be2b2..b68c97a 100644
--- a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp
+++ b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp
@@ -283,6 +283,7 @@
     const int N = zipFile.getNumEntries();
 
     char fileName[PATH_MAX];
+    bool hasPrimaryAbi = false;
 
     for (int i = 0; i < N; i++) {
         const ZipEntryRO entry = zipFile.findEntryByIndex(i);
@@ -308,7 +309,7 @@
         }
 
         const char* lastSlash = strrchr(fileName, '/');
-        LOG_ASSERT(lastSlash != NULL, "last slash was null somehow for %s\n", fileName);
+        ALOG_ASSERT(lastSlash != NULL, "last slash was null somehow for %s\n", fileName);
 
         // Check to make sure the CPU ABI of this file is one we support.
         const char* cpuAbiOffset = fileName + APK_LIB_LEN;
@@ -318,11 +319,22 @@
         if (cpuAbi.size() == cpuAbiRegionSize
                 && *(cpuAbiOffset + cpuAbi.size()) == '/'
                 && !strncmp(cpuAbiOffset, cpuAbi.c_str(), cpuAbiRegionSize)) {
-            ALOGV("Using ABI %s\n", cpuAbi.c_str());
+            ALOGV("Using primary ABI %s\n", cpuAbi.c_str());
+            hasPrimaryAbi = true;
         } else if (cpuAbi2.size() == cpuAbiRegionSize
                 && *(cpuAbiOffset + cpuAbi2.size()) == '/'
                 && !strncmp(cpuAbiOffset, cpuAbi2.c_str(), cpuAbiRegionSize)) {
-            ALOGV("Using ABI %s\n", cpuAbi2.c_str());
+
+            /*
+             * If this library matches both the primary and secondary ABIs,
+             * only use the primary ABI.
+             */
+            if (hasPrimaryAbi) {
+                ALOGV("Already saw primary ABI, skipping secondary ABI %s\n", cpuAbi2.c_str());
+                continue;
+            } else {
+                ALOGV("Using secondary ABI %s\n", cpuAbi2.c_str());
+            }
         } else {
             ALOGV("abi didn't match anything: %s (end at %zd)\n", cpuAbiOffset, cpuAbiRegionSize);
             continue;
diff --git a/core/jni/sqlite3_exception.h b/core/jni/sqlite3_exception.h
deleted file mode 100644
index 13735a1..0000000
--- a/core/jni/sqlite3_exception.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* //device/libs/include/android_runtime/sqlite3_exception.h
-**
-** Copyright 2007, 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.
-*/
-
-#ifndef _SQLITE3_EXCEPTION_H
-#define _SQLITE3_EXCEPTION_H 1
-
-#include <jni.h>
-#include <JNIHelp.h>
-//#include <android_runtime/AndroidRuntime.h>
-
-#include <sqlite3.h>
-
-namespace android {
-
-/* throw a SQLiteException with a message appropriate for the error in handle */
-void throw_sqlite3_exception(JNIEnv* env, sqlite3* handle);
-
-/* throw a SQLiteException with the given message */
-void throw_sqlite3_exception(JNIEnv* env, const char* message);
-
-/* throw a SQLiteException with a message appropriate for the error in handle
-   concatenated with the given message
- */
-void throw_sqlite3_exception(JNIEnv* env, sqlite3* handle, const char* message);
-
-/* throw a SQLiteException for a given error code */
-void throw_sqlite3_exception_errcode(JNIEnv* env, int errcode, const char* message);
-
-void throw_sqlite3_exception(JNIEnv* env, int errcode,
-                             const char* sqlite3Message, const char* message);
-}
-
-#endif // _SQLITE3_EXCEPTION_H
diff --git a/core/res/MakeJavaSymbols.sed b/core/res/MakeJavaSymbols.sed
new file mode 100644
index 0000000..d02fffa
--- /dev/null
+++ b/core/res/MakeJavaSymbols.sed
@@ -0,0 +1,25 @@
+# Run this on the errors output by javac of missing resource symbols,
+# to generate the set of <java-symbol> commands to have aapt generate
+# the symbol for them.
+#
+# For example: make framework 2>&1 | sed -n -f MakeJavaSymbols.sed | sort -u
+
+s|.*R.id.\([a-zA-Z0-9_]*\).*|  <java-symbol type="id" name="\1" />|gp
+s|.*R.attr.\([a-zA-Z0-9_]*\).*|  <java-symbol type="attr" name="\1" />|gp
+s|.*R.bool.\([a-zA-Z0-9_]*\).*|  <java-symbol type="bool" name="\1" />|gp
+s|.*R.integer.\([a-zA-Z0-9_]*\).*|  <java-symbol type="integer" name="\1" />|gp
+s|.*R.color.\([a-zA-Z0-9_]*\).*|  <java-symbol type="color" name="\1" />|gp
+s|.*R.dimen.\([a-zA-Z0-9_]*\).*|  <java-symbol type="dimen" name="\1" />|gp
+s|.*R.fraction.\([a-zA-Z0-9_]*\).*|  <java-symbol type="fraction" name="\1" />|gp
+s|.*R.string.\([a-zA-Z0-9_]*\).*|  <java-symbol type="string" name="\1" />|gp
+s|.*R.plurals.\([a-zA-Z0-9_]*\).*|  <java-symbol type="plurals" name="\1" />|gp
+s|.*R.array.\([a-zA-Z0-9_]*\).*|  <java-symbol type="array" name="\1" />|gp
+s|.*R.drawable.\([a-zA-Z0-9_]*\).*|  <java-symbol type="drawable" name="\1" />|gp
+s|.*R.layout.\([a-zA-Z0-9_]*\).*|  <java-symbol type="layout" name="\1" />|gp
+s|.*R.anim.\([a-zA-Z0-9_]*\).*|  <java-symbol type="anim" name="\1" />|gp
+s|.*R.animator.\([a-zA-Z0-9_]*\).*|  <java-symbol type="animator" name="\1" />|gp
+s|.*R.interpolator.\([a-zA-Z0-9_]*\).*|  <java-symbol type="interpolator" name="\1" />|gp
+s|.*R.menu.\([a-zA-Z0-9_]*\).*|  <java-symbol type="menu" name="\1" />|gp
+s|.*R.xml.\([a-zA-Z0-9_]*\).*|  <java-symbol type="xml" name="\1" />|gp
+s|.*R.raw.\([a-zA-Z0-9_]*\).*|  <java-symbol type="raw" name="\1" />|gp
+s|.*R.style.\([a-zA-Z0-9_]*\).*|  <java-symbol type="style" name="\1" />|gp
diff --git a/core/res/lint.xml b/core/res/lint.xml
new file mode 100644
index 0000000..822cdd7
--- /dev/null
+++ b/core/res/lint.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<lint>
+    <!-- temporary until we add frameworks support -->
+    <issue id="UnusedResources" severity="ignore" />
+
+    <issue id="PrivateResource" severity="ignore" />
+</lint>
\ No newline at end of file
diff --git a/core/res/res/anim/screen_rotate_180_enter.xml b/core/res/res/anim/screen_rotate_180_enter.xml
index 95cc562..470416b 100644
--- a/core/res/res/anim/screen_rotate_180_enter.xml
+++ b/core/res/res/anim/screen_rotate_180_enter.xml
@@ -19,16 +19,10 @@
 
 <set xmlns:android="http://schemas.android.com/apk/res/android"
         android:shareInterpolator="false">
-    <scale android:fromXScale="1.0" android:toXScale="1.0"
-            android:fromYScale=".9" android:toYScale="1.0"
-            android:pivotX="50%p" android:pivotY="50%p"
-            android:fillEnabled="true" android:fillBefore="true"
+    <rotate android:fromDegrees="180" android:toDegrees="0"
+            android:pivotX="50%" android:pivotY="50%"
             android:interpolator="@interpolator/decelerate_quint"
-            android:startOffset="160"
-            android:duration="300" />
-    <alpha android:fromAlpha="0" android:toAlpha="1.0"
-            android:fillEnabled="true" android:fillBefore="true"
-            android:interpolator="@interpolator/decelerate_quint"
-            android:startOffset="160"
-            android:duration="300"/>
+            android:fillEnabled="true"
+            android:fillBefore="true" android:fillAfter="true"
+            android:duration="@android:integer/config_mediumAnimTime" />
 </set>
\ No newline at end of file
diff --git a/core/res/res/anim/screen_rotate_180_exit.xml b/core/res/res/anim/screen_rotate_180_exit.xml
index d3dd4c0..58a1868 100644
--- a/core/res/res/anim/screen_rotate_180_exit.xml
+++ b/core/res/res/anim/screen_rotate_180_exit.xml
@@ -19,12 +19,10 @@
 
 <set xmlns:android="http://schemas.android.com/apk/res/android"
         android:shareInterpolator="false">
-    <scale android:fromXScale="1.0" android:toXScale="1.0"
-            android:fromYScale="1.0" android:toYScale="0.0"
-            android:pivotX="50%p" android:pivotY="50%p"
-            android:interpolator="@interpolator/accelerate_cubic"
-            android:duration="160" />
-    <alpha android:fromAlpha="1.0" android:toAlpha="0"
-            android:interpolator="@interpolator/decelerate_cubic"
-            android:duration="160"/>
+    <rotate android:fromDegrees="0" android:toDegrees="-180"
+            android:pivotX="50%" android:pivotY="50%"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="true" android:fillAfter="true"
+            android:duration="@android:integer/config_mediumAnimTime" />
 </set>
\ No newline at end of file
diff --git a/core/res/res/anim/screen_rotate_finish_enter.xml b/core/res/res/anim/screen_rotate_finish_enter.xml
new file mode 100644
index 0000000..849aa66
--- /dev/null
+++ b/core/res/res/anim/screen_rotate_finish_enter.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 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.
+*/
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+        android:shareInterpolator="false">
+    <scale android:fromXScale="1.0" android:toXScale="1.25"
+            android:fromYScale="1.0" android:toYScale="1.25"
+            android:pivotX="50%" android:pivotY="50%"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="true" android:fillAfter="true"
+            android:duration="@android:integer/config_mediumAnimTime"/>
+    <scale android:fromXScale="100%p" android:toXScale="100%"
+            android:fromYScale="100%p" android:toYScale="100%"
+            android:pivotX="50%" android:pivotY="50%"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="true" android:fillAfter="true"
+            android:duration="@android:integer/config_mediumAnimTime" />
+</set>
diff --git a/core/res/res/anim/screen_rotate_finish_exit.xml b/core/res/res/anim/screen_rotate_finish_exit.xml
new file mode 100644
index 0000000..7f70dbc
--- /dev/null
+++ b/core/res/res/anim/screen_rotate_finish_exit.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 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.
+*/
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+        android:shareInterpolator="false">
+    <scale android:fromXScale="1.0" android:toXScale="1.25"
+            android:fromYScale="1.0" android:toYScale="1.25"
+            android:pivotX="50%" android:pivotY="50%"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="false" android:fillAfter="true"
+            android:duration="@android:integer/config_mediumAnimTime"/>
+    <!--
+    <scale android:fromXScale="100%" android:toXScale="100%p"
+            android:fromYScale="100%" android:toYScale="100%p"
+            android:pivotX="50%" android:pivotY="50%"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:duration="@android:integer/config_mediumAnimTime" />
+    -->
+    <alpha android:fromAlpha="1.0" android:toAlpha="0"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="true" android:fillAfter="true"
+            android:duration="@android:integer/config_mediumAnimTime" />
+</set>
diff --git a/core/res/res/anim/screen_rotate_minus_90_enter.xml b/core/res/res/anim/screen_rotate_minus_90_enter.xml
index 61aa72a..d2aebc9 100644
--- a/core/res/res/anim/screen_rotate_minus_90_enter.xml
+++ b/core/res/res/anim/screen_rotate_minus_90_enter.xml
@@ -19,8 +19,44 @@
 
 <set xmlns:android="http://schemas.android.com/apk/res/android"
         android:shareInterpolator="false">
+    <!--
+    <scale android:fromXScale="1.0" android:toXScale="0.565"
+            android:fromYScale="1.0" android:toYScale="0.565"
+            android:pivotX="50%" android:pivotY="50%"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="false" android:fillAfter="true"
+            android:duration="@android:integer/config_mediumAnimTime"/>
+    <scale android:fromXScale="1.0" android:toXScale="1.777777777"
+            android:fromYScale="1.0" android:toYScale="1.777777777"
+            android:pivotX="50%" android:pivotY="50%"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="false" android:fillAfter="true"
+            android:startOffset="@android:integer/config_longAnimTime"
+            android:duration="@android:integer/config_mediumAnimTime"/>
+    <scale android:fromXScale="100%p" android:toXScale="100%"
+            android:fromYScale="100%p" android:toYScale="100%"
+            android:pivotX="50%" android:pivotY="50%"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="true" android:fillAfter="true"
+            android:startOffset="@android:integer/config_longAnimTime"
+            android:duration="@android:integer/config_mediumAnimTime" />
+    -->
+    <!--
+    <scale android:fromXScale="100%p" android:toXScale="100%"
+            android:fromYScale="100%p" android:toYScale="100%"
+            android:pivotX="50%" android:pivotY="50%"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="true" android:fillAfter="true"
+            android:duration="@android:integer/config_mediumAnimTime" />
+    -->
     <rotate android:fromDegrees="-90" android:toDegrees="0"
             android:pivotX="50%" android:pivotY="50%"
             android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="true" android:fillAfter="true"
             android:duration="@android:integer/config_mediumAnimTime" />
 </set>
diff --git a/core/res/res/anim/screen_rotate_minus_90_exit.xml b/core/res/res/anim/screen_rotate_minus_90_exit.xml
index 65294f6..c7c38cd 100644
--- a/core/res/res/anim/screen_rotate_minus_90_exit.xml
+++ b/core/res/res/anim/screen_rotate_minus_90_exit.xml
@@ -19,16 +19,51 @@
 
 <set xmlns:android="http://schemas.android.com/apk/res/android"
         android:shareInterpolator="false">
+    <!--
+    <scale android:fromXScale="1.0" android:toXScale="0.565"
+            android:fromYScale="1.0" android:toYScale="0.565"
+            android:pivotX="50%" android:pivotY="50%"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="false" android:fillAfter="true"
+            android:duration="@android:integer/config_mediumAnimTime"/>
+    <scale android:fromXScale="1.0" android:toXScale="1.777777777"
+            android:fromYScale="1.0" android:toYScale="1.777777777"
+            android:pivotX="50%" android:pivotY="50%"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="false" android:fillAfter="true"
+            android:startOffset="@android:integer/config_longAnimTime"
+            android:duration="@android:integer/config_mediumAnimTime"/>
+    <scale android:fromXScale="100%" android:toXScale="100%p"
+            android:fromYScale="100%" android:toYScale="100%p"
+            android:pivotX="50%" android:pivotY="50%"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:startOffset="@android:integer/config_longAnimTime"
+            android:duration="@android:integer/config_mediumAnimTime" />
+    <alpha android:fromAlpha="1.0" android:toAlpha="0"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="false" android:fillAfter="true"
+            android:startOffset="@android:integer/config_longAnimTime"
+            android:duration="@android:integer/config_mediumAnimTime" />
+    -->
+    <!--
     <scale android:fromXScale="100%" android:toXScale="100%p"
             android:fromYScale="100%" android:toYScale="100%p"
             android:pivotX="50%" android:pivotY="50%"
             android:interpolator="@interpolator/decelerate_quint"
             android:duration="@android:integer/config_mediumAnimTime" />
+    <alpha android:fromAlpha="1.0" android:toAlpha="0"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="false" android:fillAfter="true"
+            android:duration="@android:integer/config_mediumAnimTime" />
+    -->
     <rotate android:fromDegrees="0" android:toDegrees="90"
             android:pivotX="50%" android:pivotY="50%"
             android:interpolator="@interpolator/decelerate_quint"
-            android:duration="@android:integer/config_mediumAnimTime" />
-    <alpha android:fromAlpha="1.0" android:toAlpha="0"
-            android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="true" android:fillAfter="true"
             android:duration="@android:integer/config_mediumAnimTime" />
 </set>
diff --git a/core/res/res/anim/screen_rotate_plus_90_enter.xml b/core/res/res/anim/screen_rotate_plus_90_enter.xml
index 53b0ccd..63d7043 100644
--- a/core/res/res/anim/screen_rotate_plus_90_enter.xml
+++ b/core/res/res/anim/screen_rotate_plus_90_enter.xml
@@ -19,8 +19,44 @@
 
 <set xmlns:android="http://schemas.android.com/apk/res/android"
         android:shareInterpolator="false">
+    <!--
+    <scale android:fromXScale="1.0" android:toXScale="0.565"
+            android:fromYScale="1.0" android:toYScale="0.565"
+            android:pivotX="50%" android:pivotY="50%"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="false" android:fillAfter="true"
+            android:duration="@android:integer/config_mediumAnimTime"/>
+    <scale android:fromXScale="1.0" android:toXScale="1.777777777"
+            android:fromYScale="1.0" android:toYScale="1.777777777"
+            android:pivotX="50%" android:pivotY="50%"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="false" android:fillAfter="true"
+            android:startOffset="75"
+            android:duration="@android:integer/config_mediumAnimTime"/>
+    <scale android:fromXScale="100%p" android:toXScale="100%"
+            android:fromYScale="100%p" android:toYScale="100%"
+            android:pivotX="50%" android:pivotY="50%"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="true" android:fillAfter="true"
+            android:startOffset="75"
+            android:duration="@android:integer/config_mediumAnimTime" />
+    -->
+    <!--
+    <scale android:fromXScale="100%p" android:toXScale="100%"
+            android:fromYScale="100%p" android:toYScale="100%"
+            android:pivotX="50%" android:pivotY="50%"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="true" android:fillAfter="true"
+            android:duration="@android:integer/config_mediumAnimTime" />
+    -->
     <rotate android:fromDegrees="90" android:toDegrees="0"
             android:pivotX="50%" android:pivotY="50%"
             android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="true" android:fillAfter="true"
             android:duration="@android:integer/config_mediumAnimTime" />
 </set>
diff --git a/core/res/res/anim/screen_rotate_plus_90_exit.xml b/core/res/res/anim/screen_rotate_plus_90_exit.xml
index 63c0b09..ea48c81 100644
--- a/core/res/res/anim/screen_rotate_plus_90_exit.xml
+++ b/core/res/res/anim/screen_rotate_plus_90_exit.xml
@@ -19,16 +19,51 @@
 
 <set xmlns:android="http://schemas.android.com/apk/res/android"
         android:shareInterpolator="false">
+    <!--
+    <scale android:fromXScale="1.0" android:toXScale="0.565"
+            android:fromYScale="1.0" android:toYScale="0.565"
+            android:pivotX="50%" android:pivotY="50%"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="false" android:fillAfter="true"
+            android:duration="@android:integer/config_mediumAnimTime"/>
+    <scale android:fromXScale="1.0" android:toXScale="1.777777777"
+            android:fromYScale="1.0" android:toYScale="1.777777777"
+            android:pivotX="50%" android:pivotY="50%"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="false" android:fillAfter="true"
+            android:startOffset="75"
+            android:duration="@android:integer/config_mediumAnimTime"/>
+    <scale android:fromXScale="100%" android:toXScale="100%p"
+            android:fromYScale="100%" android:toYScale="100%p"
+            android:pivotX="50%" android:pivotY="50%"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:startOffset="75"
+            android:duration="@android:integer/config_mediumAnimTime" />
+    <alpha android:fromAlpha="1.0" android:toAlpha="0"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="false" android:fillAfter="true"
+            android:startOffset="75"
+            android:duration="@android:integer/config_mediumAnimTime" />
+    -->
+    <!--
     <scale android:fromXScale="100%" android:toXScale="100%p"
             android:fromYScale="100%" android:toYScale="100%p"
             android:pivotX="50%" android:pivotY="50%"
             android:interpolator="@interpolator/decelerate_quint"
             android:duration="@android:integer/config_mediumAnimTime" />
+    <alpha android:fromAlpha="1.0" android:toAlpha="0"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="false" android:fillAfter="true"
+            android:duration="@android:integer/config_mediumAnimTime" />
+    -->
     <rotate android:fromDegrees="0" android:toDegrees="-90"
             android:pivotX="50%" android:pivotY="50%"
             android:interpolator="@interpolator/decelerate_quint"
-            android:duration="@android:integer/config_mediumAnimTime" />
-    <alpha android:fromAlpha="1.0" android:toAlpha="0"
-            android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="true" android:fillAfter="true"
             android:duration="@android:integer/config_mediumAnimTime" />
 </set>
diff --git a/core/res/res/anim/screen_rotate_start_enter.xml b/core/res/res/anim/screen_rotate_start_enter.xml
new file mode 100644
index 0000000..e3f48e4d
--- /dev/null
+++ b/core/res/res/anim/screen_rotate_start_enter.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 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.
+*/
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+        android:shareInterpolator="false">
+    <scale android:fromXScale="1.0" android:toXScale="0.8"
+            android:fromYScale="1.0" android:toYScale="0.8"
+            android:pivotX="50%" android:pivotY="50%"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="true" android:fillAfter="true"
+            android:duration="@android:integer/config_mediumAnimTime"/>
+</set>
diff --git a/core/res/res/anim/screen_rotate_start_exit.xml b/core/res/res/anim/screen_rotate_start_exit.xml
new file mode 100644
index 0000000..e3f48e4d
--- /dev/null
+++ b/core/res/res/anim/screen_rotate_start_exit.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 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.
+*/
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+        android:shareInterpolator="false">
+    <scale android:fromXScale="1.0" android:toXScale="0.8"
+            android:fromYScale="1.0" android:toYScale="0.8"
+            android:pivotX="50%" android:pivotY="50%"
+            android:interpolator="@interpolator/decelerate_quint"
+            android:fillEnabled="true"
+            android:fillBefore="true" android:fillAfter="true"
+            android:duration="@android:integer/config_mediumAnimTime"/>
+</set>
diff --git a/core/res/res/layout-sw600dp/keyguard_screen_password_landscape.xml b/core/res/res/layout-sw600dp/keyguard_screen_password_landscape.xml
index 568933c..43d0a2c 100644
--- a/core/res/res/layout-sw600dp/keyguard_screen_password_landscape.xml
+++ b/core/res/res/layout-sw600dp/keyguard_screen_password_landscape.xml
@@ -97,8 +97,7 @@
                     android:textAppearance="?android:attr/textAppearanceMedium"
                     android:background="@null"
                     android:textColor="#ffffffff"
-                    android:imeOptions="flagNoFullscreen|actionDone"
-                    android:privateImeOptions="com.google.android.inputmethod.latin.forceAscii"
+                    android:imeOptions="flagForceAscii|flagNoFullscreen|actionDone"
                     />
 
                 <!-- This delete button is only visible for numeric PIN entry -->
diff --git a/core/res/res/layout-sw600dp/keyguard_screen_password_portrait.xml b/core/res/res/layout-sw600dp/keyguard_screen_password_portrait.xml
index 335a641..8c02888 100644
--- a/core/res/res/layout-sw600dp/keyguard_screen_password_portrait.xml
+++ b/core/res/res/layout-sw600dp/keyguard_screen_password_portrait.xml
@@ -98,7 +98,7 @@
                     android:textAppearance="?android:attr/textAppearanceMedium"
                     android:background="@null"
                     android:textColor="#ffffffff"
-                    android:privateImeOptions="com.google.android.inputmethod.latin.forceAscii"
+                    android:imeOptions="flagForceAscii"
                 />
 
                 <!-- This delete button is only visible for numeric PIN entry -->
diff --git a/core/res/res/layout/keyguard_screen_password_landscape.xml b/core/res/res/layout/keyguard_screen_password_landscape.xml
index e95553f..66d7fd7 100644
--- a/core/res/res/layout/keyguard_screen_password_landscape.xml
+++ b/core/res/res/layout/keyguard_screen_password_landscape.xml
@@ -153,8 +153,7 @@
             android:textAppearance="?android:attr/textAppearanceMedium"
             android:background="@null"
             android:textColor="?android:attr/textColorPrimary"
-            android:imeOptions="flagNoFullscreen|actionDone"
-            android:privateImeOptions="com.google.android.inputmethod.latin.forceAscii"
+            android:imeOptions="flagForceAscii|flagNoFullscreen|actionDone"
             />
 
         <!-- This delete button is only visible for numeric PIN entry -->
diff --git a/core/res/res/layout/keyguard_screen_password_portrait.xml b/core/res/res/layout/keyguard_screen_password_portrait.xml
index cfcc794..426b2f7 100644
--- a/core/res/res/layout/keyguard_screen_password_portrait.xml
+++ b/core/res/res/layout/keyguard_screen_password_portrait.xml
@@ -119,8 +119,7 @@
             android:background="@null"
             android:textAppearance="?android:attr/textAppearanceMedium"
             android:textColor="#ffffffff"
-            android:imeOptions="actionDone"
-            android:privateImeOptions="com.google.android.inputmethod.latin.forceAscii"
+            android:imeOptions="flagForceAscii|actionDone"
             />
 
         <!-- This delete button is only visible for numeric PIN entry -->
diff --git a/core/res/res/menu/webview_copy.xml b/core/res/res/menu/webview_copy.xml
index 31bcec5..6a1aa51 100644
--- a/core/res/res/menu/webview_copy.xml
+++ b/core/res/res/menu/webview_copy.xml
@@ -19,11 +19,21 @@
         android:title="@string/selectAll"
         android:showAsAction="ifRoom|withText"
         />
+    <item android:id="@+id/cut"
+        android:icon="?android:attr/actionModeCutDrawable"
+        android:title="@string/cut"
+        android:showAsAction="ifRoom|withText"
+        />
     <item android:id="@+id/copy"
         android:icon="?android:attr/actionModeCopyDrawable"
         android:title="@string/copy"
         android:showAsAction="ifRoom|withText"
         />
+    <item android:id="@+id/paste"
+        android:icon="?android:attr/actionModePasteDrawable"
+        android:title="@string/paste"
+        android:showAsAction="ifRoom|withText"
+        />
     <item android:id="@+id/share"
         android:icon="?android:attr/actionModeShareDrawable"
         android:title="@string/share"
diff --git a/core/res/res/values-af/strings.xml b/core/res/res/values-af/strings.xml
index 6ffda04..f21c6b8 100644
--- a/core/res/res/values-af/strings.xml
+++ b/core/res/res/values-af/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"OK"</string>
     <string name="report" msgid="4060218260984795706">"Verslag"</string>
     <string name="wait" msgid="7147118217226317732">"Wag"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"Die bladsy reageer nie meer nie."\n\n"Wil jy dit toemaak?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Program herlei"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> loop nou."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"<xliff:g id="APP_NAME">%1$s</xliff:g> is oorspronklik laat loop."</string>
diff --git a/core/res/res/values-am/strings.xml b/core/res/res/values-am/strings.xml
index 2452a4a..9b32c0d 100644
--- a/core/res/res/values-am/strings.xml
+++ b/core/res/res/values-am/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"ይሁን"</string>
     <string name="report" msgid="4060218260984795706">"ሪፖርት"</string>
     <string name="wait" msgid="7147118217226317732">"ቆይ"</string>
+    <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>
diff --git a/core/res/res/values-ar/strings.xml b/core/res/res/values-ar/strings.xml
index 4c7a316..b8cd094 100644
--- a/core/res/res/values-ar/strings.xml
+++ b/core/res/res/values-ar/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"موافق"</string>
     <string name="report" msgid="4060218260984795706">"إرسال تقرير"</string>
     <string name="wait" msgid="7147118217226317732">"انتظار"</string>
+    <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>
diff --git a/core/res/res/values-be/strings.xml b/core/res/res/values-be/strings.xml
index 0b40992..8479324 100644
--- a/core/res/res/values-be/strings.xml
+++ b/core/res/res/values-be/strings.xml
@@ -27,7 +27,7 @@
     <string name="terabyteShort" msgid="231613018159186962">"Тб"</string>
     <string name="petabyteShort" msgid="5637816680144990219">"Пб"</string>
     <string name="fileSizeSuffix" msgid="7670819340156489359">"запаўняльнік<xliff:g id="NUMBER">%1$s</xliff:g><xliff:g id="UNIT">%2$s</xliff:g>"</string>
-    <!-- outdated translation 6071602020171759109 -->     <string name="untitled" msgid="4638956954852782576">"Безназоўны"</string>
+    <string name="untitled" msgid="4638956954852782576">"&lt;Без назвы&gt;"</string>
     <string name="ellipsis" msgid="7899829516048813237">"..."</string>
     <string name="ellipsis_two_dots" msgid="1228078994866030736">".."</string>
     <string name="emptyPhoneNumber" msgid="7694063042079676517">"(Няма нумара тэлефона)"</string>
@@ -43,9 +43,9 @@
     <string name="serviceErased" msgid="1288584695297200972">"Паспяхова выдалена."</string>
     <string name="passwordIncorrect" msgid="7612208839450128715">"Няправільны пароль."</string>
     <string name="mmiComplete" msgid="8232527495411698359">"MMI завершаны."</string>
-    <!-- outdated translation 5085454289896032547 -->     <string name="badPin" msgid="9015277645546710014">"Стары PIN-код уведзены няправільна."</string>
-    <!-- outdated translation 5702522162746042460 -->     <string name="badPuk" msgid="5487257647081132201">"Няправiльны PUK-код."</string>
-    <!-- outdated translation 3695902225843339274 -->     <string name="mismatchPin" msgid="609379054496863419">"Уведзеныя PIN-коды не супадаюць."</string>
+    <string name="badPin" msgid="9015277645546710014">"Стары PIN-код уведзены няправільна."</string>
+    <string name="badPuk" msgid="5487257647081132201">"Няправільны PUK-код."</string>
+    <string name="mismatchPin" msgid="609379054496863419">"Уведзеныя PIN-коды не супадаюць."</string>
     <string name="invalidPin" msgid="3850018445187475377">"Увядзіце PIN-код, які змяшчае ад 4 да 8 лічбаў."</string>
     <string name="invalidPuk" msgid="8761456210898036513">"Увядзіце PUK з 8 лічбаў ці больш."</string>
     <string name="needPuk" msgid="919668385956251611">"Ваша SIM-карта заблакавана PUK-кодам. Увядзіце PUK, каб разблакаваць карту."</string>
@@ -68,16 +68,16 @@
     <string name="CLIRDefaultOffNextCallOn" msgid="6179425182856418465">"Па змаўчанні ідэнтыфікатар АВН не абмежаваны. Наступны выклік: абмежаваны"</string>
     <string name="CLIRDefaultOffNextCallOff" msgid="2567998633124408552">"Налады ідэнтыфікатару АВН па змаўчанні: не абмяжавана. Наступны выклік: не абмежавана"</string>
     <string name="serviceNotProvisioned" msgid="8614830180508686666">"Служба не прадастаўляецца."</string>
-    <!-- outdated translation 5460892159398802465 -->     <string name="CLIRPermanent" msgid="3377371145926835671">"Налада ідэнтыфікатару АВН не можа быць зменена."</string>
+    <string name="CLIRPermanent" msgid="3377371145926835671">"Вы не можаце змяніць налады ідэнтыфікатара абанента, якi тэлефануе."</string>
     <string name="RestrictedChangedTitle" msgid="5592189398956187498">"Абмежаваны доступ змяніўся"</string>
     <string name="RestrictedOnData" msgid="8653794784690065540">"Служба дадзеных блакуецца."</string>
     <string name="RestrictedOnEmergency" msgid="6581163779072833665">"Аварыйная служба блакуецца."</string>
     <string name="RestrictedOnNormal" msgid="4953867011389750673">"Галасавая служба заблакаваная."</string>
-    <string name="RestrictedOnAllVoice" msgid="1459318899842232234">"Усе галасавыя службы заблакаваныя."</string>
+    <string name="RestrictedOnAllVoice" msgid="3396963652108151260">"Усе галасавыя службы заблакаваны."</string>
     <string name="RestrictedOnSms" msgid="8314352327461638897">"Служба SMS заблакаваная."</string>
-    <string name="RestrictedOnVoiceData" msgid="8244438624660371717">"Службы перадачы голаса і дадзеных заблакаваныя."</string>
+    <string name="RestrictedOnVoiceData" msgid="996636487106171320">"Службы перадачы голаса/дадзеных заблакаваны."</string>
     <string name="RestrictedOnVoiceSms" msgid="1888588152792023873">"Службы перадачы голаса і SMS заблакаваныя."</string>
-    <string name="RestrictedOnAll" msgid="2714924667937117304">"Усе службы дадзеных, галасавыя і SMS-службы заблакаваныя."</string>
+    <string name="RestrictedOnAll" msgid="5643028264466092821">"Усе службы перадачы дадзеных, галасавыя і SMS-службы заблакаваны."</string>
     <string name="serviceClassVoice" msgid="1258393812335258019">"Голас"</string>
     <string name="serviceClassData" msgid="872456782077937893">"Дадзеныя"</string>
     <string name="serviceClassFAX" msgid="5566624998840486475">"Факс"</string>
@@ -108,27 +108,27 @@
     <string name="fcComplete" msgid="3118848230966886575">"Код аб\'екта завершаны."</string>
     <string name="fcError" msgid="3327560126588500777">"Праблема падлучэння ці няправільны код функцыі."</string>
     <string name="httpErrorOk" msgid="1191919378083472204">"ОК"</string>
-    <string name="httpError" msgid="6603022914760066338">"Памылка сеткі."</string>
-    <string name="httpErrorLookup" msgid="4517085806977851374">"URL не знойдзены."</string>
-    <!-- outdated translation 2781440683514730227 -->     <string name="httpErrorUnsupportedAuthScheme" msgid="6299980280442076799">"Схема аўтэнтыфікацыі сайта не падтрымліваецца."</string>
-    <string name="httpErrorAuth" msgid="7293960746955020542">"Няўдалая праверка на сапраўднасць."</string>
+    <string name="httpError" msgid="7956392511146698522">"Адбылася памылка сеткі."</string>
+    <string name="httpErrorLookup" msgid="4711687456111963163">"Не атрымалася знайсці URL."</string>
+    <string name="httpErrorUnsupportedAuthScheme" msgid="6299980280442076799">"Схема аўтэнтыфікацыі сайта не падтрымліваецца."</string>
+    <string name="httpErrorAuth" msgid="1435065629438044534">"Памылка аўтэнтыфікацыі."</string>
     <string name="httpErrorProxyAuth" msgid="1788207010559081331">"Праверка сапраўднасці праз проксі-сервер скончылася няўдала."</string>
-    <string name="httpErrorConnect" msgid="7623096283505770433">"Падключэнне да сервера не ўдалося."</string>
-    <string name="httpErrorIO" msgid="4270874999047767599">"Сервер не можа ўсталяваць сувязь. Паспрабуйце пазней."</string>
+    <string name="httpErrorConnect" msgid="8714273236364640549">"Немагчыма падлучыцца да сервера."</string>
+    <string name="httpErrorIO" msgid="2340558197489302188">"Немагчыма звязацца з серверам. Паўтарыце спробу пазней."</string>
     <string name="httpErrorTimeout" msgid="4743403703762883954">"Час чакання злучэння з серверам скончыўся."</string>
     <string name="httpErrorRedirectLoop" msgid="8679596090392779516">"Старонка змяшчае зашмат перанакіраванняў сервера."</string>
-    <!-- outdated translation 5257172771607996054 -->     <string name="httpErrorUnsupportedScheme" msgid="5015730812906192208">"Пратакол не падтрымліваецца."</string>
-    <string name="httpErrorFailedSslHandshake" msgid="3088290300440289771">"Бяспечнае злучэнне ўсталяваць не ўдалося."</string>
-    <string name="httpErrorBadUrl" msgid="6088183159988619736">"Старонка не можа быць адкрыта: несапраўдны URL."</string>
-    <string name="httpErrorFile" msgid="8250549644091165175">"Немагчыма атрымаць доступ да файла."</string>
-    <string name="httpErrorFileNotFound" msgid="5588380756326017105">"Запатрабаваны файл не знойдзены."</string>
+    <string name="httpErrorUnsupportedScheme" msgid="5015730812906192208">"Пратакол не падтрымліваецца."</string>
+    <string name="httpErrorFailedSslHandshake" msgid="96549606000658641">"Немагчыма ўсталяваць бяспечнае злучэнне."</string>
+    <string name="httpErrorBadUrl" msgid="3636929722728881972">"Немагчыма адкрыць старонку, таму што URL несапраўдны."</string>
+    <string name="httpErrorFile" msgid="2170788515052558676">"Немагчыма атрымаць доступ да файла."</string>
+    <string name="httpErrorFileNotFound" msgid="6203856612042655084">"Немагчыма знайсці патрабаваны файл."</string>
     <string name="httpErrorTooManyRequests" msgid="1235396927087188253">"Апрацоўваецца занадта шмат запытаў. Паспрабуйце яшчэ раз пазней."</string>
-    <string name="notification_title" msgid="1259940370369187045">"Памылка ўваходу ў сістэму для ўліковага запісу <xliff:g id="ACCOUNT">%1$s</xliff:g>"</string>
+    <string name="notification_title" msgid="8967710025036163822">"Памылка ўваходу ва ўлiковы запiс <xliff:g id="ACCOUNT">%1$s</xliff:g>"</string>
     <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="2292820184396262278">"Памяць планшэта поўная! Выдаліце ​​некаторыя файлы, каб вызваліць месца."</string>
-    <string name="low_memory" product="default" msgid="6632412458436461203">"Памяць тэлефона поўная! Выдаліце ​​некаторыя файлы, каб вызваліць прастору."</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="default" msgid="1319919075463988638">"Параметры тэлефона"</string>
@@ -137,12 +137,15 @@
     <string name="turn_off_radio" msgid="8198784949987062346">"Адключыць бесправадную сетку"</string>
     <string name="screen_lock" msgid="799094655496098153">"Блакіроўка экрана"</string>
     <string name="power_off" msgid="4266614107412865048">"Выключыць"</string>
+    <string name="silent_mode_silent" msgid="319298163018473078">"Званок выкл."</string>
+    <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="default" msgid="649792175242821353">"Ваш тэлефон будзе выключаны."</string>
-    <!-- outdated translation 6656441286856415014 -->     <string name="shutdown_confirm_question" msgid="2906544768881136183">"Адключыць прыладу?"</string>
+    <string name="shutdown_confirm_question" msgid="2906544768881136183">"Закрыць?"</string>
     <string name="recent_tasks_title" msgid="3691764623638127888">"Апошнія"</string>
-    <!-- outdated translation 279702952298056674 -->     <string name="no_recent_tasks" msgid="8794906658732193473">"Няма апошніх прыкладанняў."</string>
+    <string name="no_recent_tasks" msgid="8794906658732193473">"Няма апошніх прыкладанняў."</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>
@@ -157,16 +160,16 @@
     <string name="safeMode" msgid="2788228061547930246">"Бяспечны рэжым"</string>
     <string name="android_system_label" msgid="6577375335728551336">"Сістэма Android"</string>
     <string name="permgrouplab_costMoney" msgid="5429808217861460401">"Платныя паслугі"</string>
-    <!-- outdated translation 8193824940620517189 -->     <string name="permgroupdesc_costMoney" msgid="8596717365335027057">"Дазволіць прыкладанням рабіць рэчы, якія могуць каштаваць вам грошай."</string>
+    <string name="permgroupdesc_costMoney" msgid="3293301903409869495">"Рабіць справы, якія могуць каштаваць вам грошай."</string>
     <string name="permgrouplab_messages" msgid="7521249148445456662">"Вашыя паведамленні"</string>
-    <!-- outdated translation 7045736972019211994 -->     <string name="permgroupdesc_messages" msgid="7821999071003699236">"Чытайце і пішыце вашыя паведамленні электроннай пошты, SMS і г. д."</string>
+    <string name="permgroupdesc_messages" msgid="7821999071003699236">"Счытваць і запісваць вашы SMS-паведамленні, паведамленні электроннай пошты і іншыя паведамленні."</string>
     <string name="permgrouplab_personalInfo" msgid="3519163141070533474">"Вашая персанальная інфармацыя"</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="2430258821648348660">"Кантралюйце сваё фізічнае месцазнаходжанне"</string>
+    <string name="permgroupdesc_location" msgid="5704679763124170100">"Кантраляваць сваё фізічнае месцазнаходжанне."</string>
     <string name="permgrouplab_network" msgid="5808983377727109831">"Сеткавая сувязь"</string>
-    <!-- outdated translation 5035763698958415998 -->     <string name="permgroupdesc_network" msgid="4917593670797570584">"Дазволіць прыкладанням атрымліваць доступ да розных функцый сеткі."</string>
+    <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>
@@ -176,352 +179,358 @@
     <string name="permgrouplab_systemTools" msgid="4652191644082714048">"Сістэмныя інструменты"</string>
     <string name="permgroupdesc_systemTools" msgid="8162102602190734305">"Ніжні ўзровень доступу і кіравання сістэмай."</string>
     <string name="permgrouplab_developmentTools" msgid="3446164584710596513">"Сродкі распрацоўкі"</string>
-    <!-- outdated translation 9056431193893809814 -->     <string name="permgroupdesc_developmentTools" msgid="7058828032358142018">"Функцыі, патрэбныя толькі для распрацоўшчыкаў прыкладанняў."</string>
+    <string name="permgroupdesc_developmentTools" msgid="7058828032358142018">"Функцыi, патрэбныя толькі для распрацоўшчыкаў прыкладанняў."</string>
     <string name="permgrouplab_storage" msgid="1971118770546336966">"Сховішча"</string>
     <string name="permgroupdesc_storage" product="nosdcard" msgid="7442318502446874999">"Атрымаць доступ да USB-назапашвальнiка."</string>
     <string name="permgroupdesc_storage" product="default" msgid="9203302214915355774">"Доступ да SD-карты."</string>
     <string name="permlab_statusBar" msgid="7417192629601890791">"адключаць ці змяняць радок стану"</string>
-    <!-- outdated translation 1365473595331989732 -->     <string name="permdesc_statusBar" msgid="8434669549504290975">"Дазваляе прыкладанням адключаць радок стану або дадаваць і выдаляць сістэмныя значкі."</string>
+    <string name="permdesc_statusBar" msgid="8434669549504290975">"Дазваляе прыкладанням адключаць радок стану або дадаваць і выдаляць сістэмныя значкі."</string>
     <string name="permlab_statusBarService" msgid="7247281911387931485">"радок стану"</string>
-    <!-- outdated translation 4097605867643520920 -->     <string name="permdesc_statusBarService" msgid="716113660795976060">"Дазваляе прыкладанням быць радком стану."</string>
+    <string name="permdesc_statusBarService" msgid="716113660795976060">"Дазваляе прыкладанням быць радком стану."</string>
     <string name="permlab_expandStatusBar" msgid="1148198785937489264">"разгарнуць/згарнуць радок стану"</string>
-    <!-- outdated translation 7088604400110768665 -->     <string name="permdesc_expandStatusBar" msgid="6917549437129401132">"Дазваляе прыкладанням разгортваць або згортваць панэль стану."</string>
+    <string name="permdesc_expandStatusBar" msgid="6917549437129401132">"Дазваляе прыкладанню разгортваць ці згортваць радок стану."</string>
     <string name="permlab_processOutgoingCalls" msgid="1136262550878335980">"перахапляць выходныя выклікі"</string>
-    <!-- outdated translation 2228988201852654461 -->     <string name="permdesc_processOutgoingCalls" msgid="1152111671618301044">"Дазваляе прыкладанням апрацоўваць выходныя выклікі і змяняць набіраны нумар. Шкоднасныя прыкладанні могуць адсочваць, перанакіроўваць ці забараняць выходныя выклікі."</string>
+    <string name="permdesc_processOutgoingCalls" msgid="1152111671618301044">"Дазваляе прыкладанням апрацоўваць выходныя выклікі і змяняць набіраны нумар. Шкоднасныя прыкладаннi могуць адсочваць, перанакіроўваць ці прадухіляць выходныя выклікі."</string>
     <string name="permlab_receiveSms" msgid="2697628268086208535">"атрымліваць SMS"</string>
-    <!-- outdated translation 6298292335965966117 -->     <string name="permdesc_receiveSms" msgid="8107887121893611793">"Дазваляе прыкладанням атрымліваць і апрацоўваць SMS. Шкоднасныя прыкладанні могуць адсочваць вашыя паведамленні або выдаляць іх, не паказваючы вам."</string>
+    <string name="permdesc_receiveSms" msgid="8107887121893611793">"Дазваляе прыкладанням атрымліваць і апрацоўваць SMS-паведамленні. Шкоднасныя прыкладанні могуць адсочваць вашыя паведамленні або выдаляць іх, не паказваючы вам."</string>
     <string name="permlab_receiveMms" msgid="8894700916188083287">"атрымліваць MMS"</string>
-    <!-- outdated translation 4563346832000174373 -->     <string name="permdesc_receiveMms" msgid="1424805308566612086">"Дазваляе прыкладанням атрымліваць і апрацоўваць паведамленні MMS. Шкоднасныя прыкладанні могуць адсочваць вашыя паведамленні або выдаляць іх без вашага ведама."</string>
+    <string name="permdesc_receiveMms" msgid="1424805308566612086">"Дазваляе прыкладанням атрымліваць і апрацоўваць MMS-паведамленні. Шкоднасныя прыкладанні могуць адсочваць вашы паведамленні або выдаляць іх, не паказваючы вам."</string>
     <string name="permlab_receiveEmergencyBroadcast" msgid="1803477660846288089">"атрымліваць экстраныя трансляцыі"</string>
-    <!-- outdated translation 7118393393716546131 -->     <string name="permdesc_receiveEmergencyBroadcast" msgid="848524070262431974">"Дазваляе прыкладанням атрымліваць і апрацоўваць экстраныя шырокавяшчальныя паведамленні. Гэты дазвол даступны толькі для сістэмных прыкладанняў."</string>
+    <string name="permdesc_receiveEmergencyBroadcast" msgid="848524070262431974">"Дазваляе прыкладанням атрымліваць і апрацоўваць экстраныя паведамленні. Гэты дазвол даступны толькі для сістэмных прыкладанняў."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"адпраўляць SMS"</string>
-    <!-- outdated translation 1946540351763502120 -->     <string name="permdesc_sendSms" msgid="906546667507626156">"Дазваляе прыкладанням адпраўляць SMS. Шкоднасныя прыкладанні могуць траціць вашыя грошы шляхам адпраўкі паведамленняў без пацверджання карыстальніка."</string>
+    <string name="permdesc_sendSms" msgid="906546667507626156">"Дазваляе прыкладанням дасылаць SMS-паведамленні. Шкоднасныя прыкладанні могуць каштаваць вам грошай з-за адпраўкі паведамленняў без вашага пацвярджэння."</string>
     <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"адпраўляць SMS-паведамленні без пацверджання"</string>
-    <!-- outdated translation 4477752891276276168 -->     <string name="permdesc_sendSmsNoConfirmation" msgid="3437759207020400204">"Дазваляе прыкладанням адпраўляць SMS. Шкоднасныя прыкладанні могуць спісваць вашыя грошы, адпраўляючы паведамленні без вашага пацверджання."</string>
+    <string name="permdesc_sendSmsNoConfirmation" msgid="3437759207020400204">"Дазваляе прыкладанню дасылаць SMS-паведамленні. Шкоднасныя прыкладанні могуць каштаваць вам грошай з-за адпраўкі паведамленняў без вашага пацверджання."</string>
     <string name="permlab_readSms" msgid="4085333708122372256">"чытаць SMS або MMS"</string>
-    <!-- outdated translation 5836710350295631545 -->     <string name="permdesc_readSms" product="tablet" msgid="2341692916884515613">"Дазваляе прыкладанням чытаць SMS, якія захоўваюцца на планшэце ці на SIM-карце. Шкоднасныя прыкладанні могуць чытаць вашыя канфідэнцыйныя паведамленні."</string>
-    <!-- outdated translation 5836710350295631545 -->     <string name="permdesc_readSms" product="default" msgid="5653850482025875493">"Дазваляе прыкладанням чытаць SMS, якія захоўваюцца на планшэце ці на SIM-карце. Шкоднасныя прыкладанні могуць чытаць вашыя канфідэнцыйныя паведамленні."</string>
+    <string name="permdesc_readSms" product="tablet" msgid="2341692916884515613">"Дазваляе прыкладанням чытаць SMS-паведамленні, якія захоўваюцца на планшэце ці SIM-карце. Шкоднасныя прыкладанні могуць чытаць вашы канфідэнцыйныя паведамленні."</string>
+    <string name="permdesc_readSms" product="default" msgid="5653850482025875493">"Дазваляе прыкладанню счытваць SMS-паведамленні, якія захоўваюцца ў тэлефоне або на SIM-карце. Шкоднасныя прыкладанні могуць чытаць вашы канфідэнцыйныя паведамленні."</string>
     <string name="permlab_writeSms" msgid="6881122575154940744">"рэдагаваць SMS ці MMS"</string>
-    <!-- outdated translation 5332124772918835437 -->     <string name="permdesc_writeSms" product="tablet" msgid="5160413947794501538">"Дазваляе прыкладанню запіс ў SMS паведамленнях, якія захоўваюцца на планшэце ці на SIM-карце. Шкоднасныя прыкладанні могуць выдаляць вашыя паведамленні."</string>
-    <!-- outdated translation 5332124772918835437 -->     <string name="permdesc_writeSms" product="default" msgid="7268668709052328567">"Дазваляе прыкладанню запіс ў SMS паведамленнях, якія захоўваюцца на планшэце ці на SIM-карце. Шкоднасныя прыкладанні могуць выдаляць вашыя паведамленні."</string>
+    <string name="permdesc_writeSms" product="tablet" msgid="5160413947794501538">"Дазваляе прыкладанню запісваць дадзеныя ў SMS-паведамленні, якія захоўваюцца на планшэце або на SIM-карце. Шкоднасныя прыкладанні могуць выдаляць вашы паведамленні."</string>
+    <string name="permdesc_writeSms" product="default" msgid="7268668709052328567">"Дазваляе прыкладанням запісваць дадзеныя ў SMS-паведамленні, якія захоўваюцца ў тэлефоне або на SIM-карце. Шкоднасныя прыкладанні могуць выдаляць вашы паведамленні."</string>
     <string name="permlab_receiveWapPush" msgid="8258226427716551388">"атрымліваць WAP"</string>
-    <!-- outdated translation 5979623826128082171 -->     <string name="permdesc_receiveWapPush" msgid="7983455145335316872">"Дазваляе прыкладанням атрымліваць і апрацоўваць WAP-паведамленні. Шкоднасныя прыкладанні могуць адсочваць вашыя паведамленні або выдаляць іх, не паказваючы вам."</string>
-    <!-- outdated translation 5005277531132573353 -->     <string name="permlab_getTasks" msgid="6466095396623933906">"атрымліваць запушчаныя прыкладанні"</string>
-    <!-- outdated translation 7048711358713443341 -->     <string name="permdesc_getTasks" msgid="6608159250520381359">"Дазваляе прыкладанням атрымліваць інфармацыю аб бягучых і нядаўна запушчаных задачах. Можа дазволіць шкоднасным прыкладаннм выяўляць асабістую інфармацыю аб іншых прыкладаннях."</string>
-    <!-- outdated translation 5669588525059921549 -->     <string name="permlab_reorderTasks" msgid="2018575526934422779">"змяняць парадак запуску прыкладанняў"</string>
-    <!-- outdated translation 126252774270522835 -->     <string name="permdesc_reorderTasks" msgid="4175137612205663399">"Дазваляе прыкладанням перамяшчаць задачы на ​​пярэдні план і ў фон. Шкоднасныя прыкладанні могуць прымусова перамясціць сябе на ​​пярэдні план без вашага кантролю."</string>
-    <!-- outdated translation 4802740047161700683 -->     <string name="permlab_removeTasks" msgid="6821513401870377403">"спыненне запушчаных прыкладанняў"</string>
-    <!-- outdated translation 2000332928514575461 -->     <string name="permdesc_removeTasks" msgid="1000226123143185094">"Дазваляе прыкладанням выдаляць задачы і спыняць адпаведныя прыкладанні. Шкоднасныя прыкладаннi могуць паўплываць на функцыянаванне іншых прыкладанняў."</string>
-    <!-- outdated translation 4339730312925176742 -->     <string name="permlab_setDebugApp" msgid="3022107198686584052">"уключаць адладку прыкладанняў"</string>
-    <!-- outdated translation 5584310661711990702 -->     <string name="permdesc_setDebugApp" msgid="6215654419903651172">"Дазваляе прыкладанням уключаць адладку іншых прыкладанняў. Шкоднасныя прыкладаннi могуць карыстацца гэтым, каб спыняць іншыя прыкладанні."</string>
+    <string name="permdesc_receiveWapPush" msgid="7983455145335316872">"Дазваляе прыкладанням атрымліваць і апрацоўваць WAP-паведамленні. Шкоднасныя прыкладанні могуць адсочваць вашы паведамленні або выдаляць іх, не паказваючы вам."</string>
+    <string name="permlab_getTasks" msgid="6466095396623933906">"атрымаць запушчаныя прыкладанні"</string>
+    <string name="permdesc_getTasks" msgid="6608159250520381359">"Дазваляе прыкладанням атрымліваць інфармацыю пра бягучыя і нядаўна запушчаныя заданнi. Шкоднасныя прыкладанні могуць атрымліваць асабістую інфармацыю пра іншыя прыкладаннi."</string>
+    <string name="permlab_reorderTasks" msgid="2018575526934422779">"змяніць парадак запушчаных прыкладанняў"</string>
+    <string name="permdesc_reorderTasks" msgid="4175137612205663399">"Дазваляе прыкладанням перамяшчаць заданні на ​​пярэдні план і фон. Шкоднасныя прыкладанні могуць прымусова рабіць сябе асноўнымі без вашага ведама."</string>
+    <string name="permlab_removeTasks" msgid="6821513401870377403">"спыніць запушчаныя прыкладанні"</string>
+    <string name="permdesc_removeTasks" msgid="1394714352062635493">"Дазваляе прыкладанням выдаляць заданні і спыняць прыкладанні, якія іх выкарыстоўваюць. Шкоднасныя прыкладаннi могуць перашкодзiць працы іншых прыкладанняў."</string>
+    <string name="permlab_setDebugApp" msgid="3022107198686584052">"уключыць адладку прыкладання"</string>
+    <string name="permdesc_setDebugApp" msgid="4474512416299013256">"Дазваляе прыкладанням уключаць адладку для іншага прыкладання. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб спыняць іншыя прыкладанні."</string>
     <string name="permlab_changeConfiguration" msgid="8214475779521218295">"змяняць налады карыстальніцкага інтэрфейса"</string>
-    <!-- outdated translation 3465121501528064399 -->     <string name="permdesc_changeConfiguration" msgid="4104052649900380324">"Дазваляе прыкладанням змяняць бягучую канфігурацыю, напрыклад мову i агульны памер шрыфта."</string>
+    <string name="permdesc_changeConfiguration" msgid="4372223873154296076">"Дазваляе прыкладанням змяняць бягучую канфігурацыю, напрыклад мову цi агульны памер шрыфта."</string>
     <string name="permlab_enableCarMode" msgid="5684504058192921098">"дазваляць рэжым \"У аўтамабілі\""</string>
-    <!-- outdated translation 5673461159384850628 -->     <string name="permdesc_enableCarMode" msgid="4853187425751419467">"Дазваляе прыкладанням уключаць рэжым \"У аўтамабілі\"."</string>
+    <string name="permdesc_enableCarMode" msgid="4853187425751419467">"Дазваляе прыкладанню ўключаць рэжым гучнай сувязi."</string>
     <string name="permlab_killBackgroundProcesses" msgid="8373714752793061963">"выдаліць фонавыя працэсы"</string>
-    <!-- outdated translation 2908829602869383753 -->     <string name="permdesc_killBackgroundProcesses" msgid="931129103262126617">"Дазваляе прыкладанням спыняць фонавыя працэсы іншых прыкладанняў, нават калі памяці дастаткова."</string>
-    <!-- outdated translation 1447830113260156236 -->     <string name="permlab_forceStopPackages" msgid="2329627428832067700">"прымусова спыняць іншыя прыкладанні"</string>
-    <!-- outdated translation 7263036616161367402 -->     <string name="permdesc_forceStopPackages" msgid="5253157296183940812">"Дазваляе прыкладанню прымусова спыняць іншыя прыкладанні."</string>
-    <!-- outdated translation 1804196839880393631 -->     <string name="permlab_forceBack" msgid="652935204072584616">"прымусова закрываць прыкладанні"</string>
-    <!-- outdated translation 6534109744159919013 -->     <string name="permdesc_forceBack" msgid="3892295830419513623">"Дазваляе прыкладанням прымусова спыняць усе актыўныя працэсы і працягваць працу. Ніколі не патрабуецца для звычайных прыкладанняў."</string>
+    <string name="permdesc_killBackgroundProcesses" msgid="931129103262126617">"Дазваляе прыкладанням спыняць фонавыя працэсы іншых прыкладанняў, нават калі памяці дастаткова."</string>
+    <string name="permlab_forceStopPackages" msgid="2329627428832067700">"прымусова спыніць іншыя прыкладанні"</string>
+    <string name="permdesc_forceStopPackages" msgid="5253157296183940812">"Дазваляе прыкладанням прымусова спыняць іншыя прыкладанні."</string>
+    <string name="permlab_forceBack" msgid="652935204072584616">"прымусова закрыць прыкладанне"</string>
+    <string name="permdesc_forceBack" msgid="3892295830419513623">"Дазваляе прыкладанням прымусова закрываць любы асноўны працэс. Не патрабуецца для звычайных прыкладанняў."</string>
     <string name="permlab_dump" msgid="1681799862438954752">"атрымліваць унутраны стан сістэмы"</string>
-    <!-- outdated translation 2198776174276275220 -->     <string name="permdesc_dump" msgid="1778299088692290329">"Дазваляе прыкладанням атрымліваць інфармацыю аб унутраным стане сістэмы. Шкодныя прыкладанні могуць атрымлiваць шырокі спектр прыватнай і абараняемай інфармацыі, якая звычайна ніколі ім не патрабуецца."</string>
+    <string name="permdesc_dump" msgid="1778299088692290329">"Дазваляе прыкладанням атрымліваць інфармацыю аб унутраным стане сістэмы. Шкоднасныя прыкладанні могуць атрымліваць шырокі спектр прыватных дадзеных і дадзеных, прызначаных для забеспячэння бяспекі інфармацыі, якія звычайна ім не патрэбны."</string>
     <string name="permlab_retrieve_window_content" msgid="8022588608994589938">"атрыманне зместу экрана"</string>
-    <!-- outdated translation 3390962289797156152 -->     <string name="permdesc_retrieve_window_content" msgid="3193269069469700265">"Дазваляе прыкладанням атрымліваць змест актыўнага акна. Шкоднасныя прыкладаннi могуць атрымаць увесь змест акна і вывучыць увесь яго тэкст, акрамя пароляў."</string>
+    <string name="permdesc_retrieve_window_content" msgid="3193269069469700265">"Дазваляе прыкладанням атрымліваць змесціва актыўнага акна. Шкоднасныя прыкладанні могуць атрымліваць усё змесціва акна і разглядаць увесь яго тэкст, акрамя пароляў."</string>
     <string name="permlab_shutdown" msgid="7185747824038909016">"частковае адключэнне"</string>
     <string name="permdesc_shutdown" msgid="7046500838746291775">"Спыняе дзейнасць менеджэра. Не выконвае поўнае адключэнне."</string>
     <string name="permlab_stopAppSwitches" msgid="4138608610717425573">"прадухіляць пераключэнне прыкладанняў"</string>
-    <!-- outdated translation 3857886086919033794 -->     <string name="permdesc_stopAppSwitches" msgid="8262195802582255021">"Прадухіляе карыстальнікаў ад пераходу на іншае прыкладанне."</string>
-    <!-- outdated translation 7811586187574696296 -->     <string name="permlab_runSetActivityWatcher" msgid="892239094867182656">"адсочваць усе запускі прыкладанняў і кіраваць iмi"</string>
-    <!-- outdated translation 2149363027173451218 -->     <string name="permdesc_runSetActivityWatcher" msgid="6003603162578577406">"Дазваляе прыкладанню сачыць за тым, як сістэма запускае працэсы, i кiраваць гэтым дзеяннем. Шкоднасныя прыкладанні могуць цалкам негатыўна паўсплываць на сістэму. Гэты дазвол неабходны толькі для распрацоўкі, не для звычайнага выкарыстання."</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_broadcastPackageRemoved" msgid="2576333434893532475">"трансляваць паведамленні аб выдаленні пакетаў"</string>
-    <!-- outdated translation 3453286591439891260 -->     <string name="permdesc_broadcastPackageRemoved" msgid="6621901216207931089">"Дазваляе прыкладанням трансліраваць апавяшчэнне аб тым, што пакет прыкладання быў выдалены. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб спыніць любое іншае запушчанае прыкладанне."</string>
+    <string name="permdesc_broadcastPackageRemoved" msgid="6621901216207931089">"Дазваляе прыкладанням перадаваць апавяшчэнне, што пакет прыкладанняў быў выдалены. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб спыняць любыя іншыя запушчаныя прыкладанні."</string>
     <string name="permlab_broadcastSmsReceived" msgid="5689095009030336593">"перасылаць трансляцыі, атрыманыя па SMS"</string>
-    <!-- outdated translation 9122419277306740155 -->     <string name="permdesc_broadcastSmsReceived" msgid="4152037720034365492">"Дазваляе прыкладанню трансляваць апавяшчэнне, што паведамленне SMS атрыманае. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб падрабляць уваходныя паведамленні SMS."</string>
+    <string name="permdesc_broadcastSmsReceived" msgid="4152037720034365492">"Дазваляе прыкладанням перадаваць апавяшчэнне пра атрыманне SMS-паведамлення. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб падрабляць уваходныя SMS-паведамленні."</string>
     <string name="permlab_broadcastWapPush" msgid="3145347413028582371">"пасылаць сігнал WAP-PUSH-received"</string>
-    <!-- outdated translation 3955303669461378091 -->     <string name="permdesc_broadcastWapPush" msgid="4783402525039442729">"Дазваляе прыкладанням трансляваць апавяшчэнне аб атрыманні паведамлення WAP PUSH. Шкоднасныя прыкладаннi могуць карыстацца гэтым, каб падрабляць атрыманне MMS-паведамленняў ці моўчкі мяняць змест любых вэб-старонак на шкодны."</string>
+    <string name="permdesc_broadcastWapPush" msgid="4783402525039442729">"Дазваляе прыкладанням перадаваць апавяшчэнне, што паведамленне WAP PUSH не было атрымана. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб падрабляць атрыманне MMS-паведамлення або непрыкметна замяняць змесціва любой вэб-старонкі на шкоднасную версiю."</string>
     <string name="permlab_setProcessLimit" msgid="2451873664363662666">"абмяжоўваць колькасць запушчаных працэсаў"</string>
-    <!-- outdated translation 7824786028557379539 -->     <string name="permdesc_setProcessLimit" msgid="7318061314040879542">"Дазваляе прыкладанням кантраляваць максімальную колькасць працэсаў, якія будуць працаваць. Ніколі не патрабуецца для звычайных прыкладанняў."</string>
-    <!-- outdated translation 5342837862439543783 -->     <string name="permlab_setAlwaysFinish" msgid="238828158465736054">"закрываць усе фонавыя прыкладанні"</string>
-    <!-- outdated translation 8773936403987091620 -->     <string name="permdesc_setAlwaysFinish" msgid="7471310652868841499">"Дазваляе прыкладанню кантраляваць завяршэнне дзеянняў падчас іх пераходу ў фон. Ніколі не патрабуецца для звычайных прыкладанняў."</string>
+    <string name="permdesc_setProcessLimit" msgid="7318061314040879542">"Дазваляе прыкладанням кантраляваць максімальную колькасць запушчаных працэсаў. Не патрабуецца для звычайных прыкладанняў."</string>
+    <string name="permlab_setAlwaysFinish" msgid="238828158465736054">"закрывае ўсе фонавыя прыкладанні"</string>
+    <string name="permdesc_setAlwaysFinish" msgid="7471310652868841499">"Дазваляе прыкладанням кантраляваць, ці будуць працэсы заўсёды завяршацца, як толькі яны пераходзяць у фонавы рэжым. Не патрабуецца для звычайных прыкладанняў."</string>
     <string name="permlab_batteryStats" msgid="7863923071360031652">"змяняць статыстыку батарэі"</string>
-    <!-- outdated translation 5847319823772230560 -->     <string name="permdesc_batteryStats" msgid="6835186932305744068">"Дазваляе мяняць сабраную статыстыку акумулятара. Не выкарыстоўваецца звычайнымі прыкладаннямі."</string>
+    <string name="permdesc_batteryStats" msgid="6835186932305744068">"Дазваляе прыкладанням змяняць сабраную статыстыку акумулятара. Не для выкарыстання звычайнымі прыкладаннямі."</string>
     <string name="permlab_backup" msgid="470013022865453920">"кантраляваць рэзервовае капіяванне і аднаўленне сістэмы"</string>
-    <!-- outdated translation 4837493065154256525 -->     <string name="permdesc_backup" msgid="6912230525140589891">"Дазваляе прыкладанням кантраляваць механізм рэзервовага капіявання і аднаўлення сістэмы. Не выкарыстоўваецца звычайнымі прыкладаннямі."</string>
+    <string name="permdesc_backup" msgid="6912230525140589891">"Дазваляе прыкладанням кантраляваць рэзервовае капіяванне сістэмы і механізм аднаўлення. Не патрабуецца для звычайных прыкладанняў."</string>
     <string name="permlab_confirm_full_backup" msgid="5557071325804469102">"пацверджанне поўнага рэзервовага капіявання або аднаўлення"</string>
-    <!-- outdated translation 9005017754175897954 -->     <string name="permdesc_confirm_full_backup" msgid="1748762171637699562">"Дазваляе прыкладанням запускаць інтэрфейс пацверджання поўнага рэзервовага капіявання. Выкарыстоўваецца не ўсімі прыкладаннямі."</string>
+    <string name="permdesc_confirm_full_backup" msgid="1748762171637699562">"Дазваляе прыкладанням запускаць поўны інтэрфейс карыстальніка пацвярджэння рэзервавання. Не для выкарыстання звычайнымі прыкладаннямі."</string>
     <string name="permlab_internalSystemWindow" msgid="2148563628140193231">"паказваць несанкцыянаваныя вокны"</string>
-    <!-- outdated translation 5895082268284998469 -->     <string name="permdesc_internalSystemWindow" msgid="6510907081810231374">"Дазваляе ствараць вокны, прызначаныя для ўнутранай сістэмы карыстальніцкага інтэрфейса. Не выкарыстоўваецца звычайнымі прыкладаннямі."</string>
+    <string name="permdesc_internalSystemWindow" msgid="7458387759461466397">"Дазваляе прыкладанням ствараць вокны, прызначаныя для выкарыстання ўнутраным інтэрфейсам карыстальніка сістэмы. Не для выкарыстання звычайнымі прыкладаннямі."</string>
     <string name="permlab_systemAlertWindow" msgid="3372321942941168324">"паказваць абвесткі стану сістэмы"</string>
-    <!-- outdated translation 2884149573672821318 -->     <string name="permdesc_systemAlertWindow" msgid="8507863469978066409">"Дазваляе прыкладанню паказваць вокны сiстэмных паведамленняў. Шкоднасныя прыкладанні могуць заняць увесь экран."</string>
+    <string name="permdesc_systemAlertWindow" msgid="8507863469978066409">"Дазваляе прыкладанням паказваць вокны апавяшчэння сістэмы. Шкоднасныя прыкладанні могуць захоплiваць увесь экран."</string>
     <string name="permlab_setAnimationScale" msgid="2805103241153907174">"зменяць агульную хуткасць анімацыі"</string>
-    <!-- outdated translation 7181522138912391988 -->     <string name="permdesc_setAnimationScale" msgid="6505093307223395456">"Дазваляе прыкладанням у любы час мяняць агульную хуткасць анімацыі (хутчэй ці павольней)."</string>
-    <!-- outdated translation 17124341698093865 -->     <string name="permlab_manageAppTokens" msgid="1286505717050121370">"кіраваць меткамі прыкладанняў"</string>
-    <!-- outdated translation 977127907524195988 -->     <string name="permdesc_manageAppTokens" msgid="8043431713014395671">"Дазваляе прыкладанням ствараць уласныя квіткі і кіраваць імі, у абыход нармальнага Z-упарадкавання. Не патрабуецца для звычайных прыкладанняў."</string>
+    <string name="permdesc_setAnimationScale" msgid="7690063428924343571">"Дазваляе прыкладанням у любы час змяняць агульную хуткасць анімацыі (хутчэй ці павольней)."</string>
+    <string name="permlab_manageAppTokens" msgid="1286505717050121370">"кіраваць ключамі прыкладання"</string>
+    <string name="permdesc_manageAppTokens" msgid="8043431713014395671">"Дазваляе прыкладанням ствараць  сваімі ўласнымі ключамі, абыходзячы іх звычайны Z-парадак. Не патрабуецца для звычайных прыкладанняў."</string>
     <string name="permlab_injectEvents" msgid="1378746584023586600">"націскаць клавішы і кнопкі кіравання"</string>
-    <!-- outdated translation 7200014808195664505 -->     <string name="permdesc_injectEvents" product="tablet" msgid="206352565599968632">"Дазваляе прыкладанням ажыццяўляць свае ўласныя працэсы ўводу (націску клавіш і г. д.) для іншых прыкладанняў. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб атрымаць кантроль над планшэтам."</string>
-    <!-- outdated translation 7200014808195664505 -->     <string name="permdesc_injectEvents" product="default" msgid="653128057572326253">"Дазваляе прыкладанням ажыццяўляць свае ўласныя працэсы ўводу (націску клавіш і г. д.) для іншых прыкладанняў. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб атрымаць кантроль над планшэтам."</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>
-    <!-- outdated translation 5132879321450325445 -->     <string name="permdesc_readInputState" msgid="8387754901688728043">"Дазваляе прыкладанням праглядаць клавішы, якія вы націскаеце, нават пры ўзаемадзеянні з іншым прыкладаннем (напрыклад, пры ўводзе пароля). Не патрабуецца для звычайных прыкладанняў."</string>
+    <string name="permdesc_readInputState" msgid="8387754901688728043">"Дазваляе прыкладанням адсочваць клавішы, якія вы націскаеце, нават падчас узаемадзеяння з іншым прыкладаннем (напрыклад, пры ўводзе пароля). Не патрабуецца для звычайных прыкладанняў."</string>
     <string name="permlab_bindInputMethod" msgid="3360064620230515776">"звязацца з метадам уводу"</string>
-    <!-- outdated translation 3734838321027317228 -->     <string name="permdesc_bindInputMethod" msgid="3250440322807286331">"Дазваляе ўладальніку звязвацца з інтэрфейсам верхняга ўзроўню метадам уводу. Не патрабуецца для звычайных прыкладанняў."</string>
+    <string name="permdesc_bindInputMethod" msgid="3250440322807286331">"Дазваляе ўладальніку прывязвацца да інтэрфейсу верхняга ўзроўню метада ўводу. Не патрабуецца для звычайных прыкладанняў."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"звязаць з тэкставай службай"</string>
-    <!-- outdated translation 172508880651909350 -->     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Дазваляе ўладальніку звязвацца з інтэрфейсам верхняга ўзроўню тэкставай паслугі (напрыклад, SpellCheckerService). Ніколі не патрабуецца звычайным прыкладанням."</string>
+    <string name="permdesc_bindTextService" msgid="8151968910973998670">"Дазваляе ўладальніку прывязвацца да інтэрфейсу верхняга ўзроўню тэкставай паслугі (напрыклад, SpellCheckerService). Ніколі не патрабуецца для звычайных прыкладанняў."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"звязвацца з VPN сэрвісам"</string>
-    <!-- outdated translation 6011554199384584151 -->     <string name="permdesc_bindVpnService" msgid="2067845564581693905">"Дазваляе ўладальніку звязвацца з інтэрфейсам VPN службы вышэйшага ўзроўню. Не патрэбна для звычайных праграм."</string>
+    <string name="permdesc_bindVpnService" msgid="2067845564581693905">"Дазваляе ўладальніку звязвацца з інтэрфейсам службы VPN вышэйшага ўзроўню. Не патрэбна для звычайных прыкладанняў."</string>
     <string name="permlab_bindWallpaper" msgid="8716400279937856462">"прывязаць да шпалер"</string>
-    <!-- outdated translation 5287754520361915347 -->     <string name="permdesc_bindWallpaper" msgid="7108428692595491668">"Дазваляе ўладальніку ўсталёўваць прывязку да інтэрфейсу шпалер верхняга ўзроўню. Не патрабуецца для звычайных прыкладанняў."</string>
+    <string name="permdesc_bindWallpaper" msgid="7108428692595491668">"Дазваляе ўладальніку ўсталёўваць прывязку да інтэрфейсу шпалер верхняга ўзроўню. Не патрабуецца для звычайных прыкладанняў."</string>
     <string name="permlab_bindRemoteViews" msgid="5697987759897367099">"прывязаць да службы віджэту"</string>
-    <!-- outdated translation 2930855984822926963 -->     <string name="permdesc_bindRemoteViews" msgid="4717987810137692572">"Дазваляе ўладальніку прывязаць верхні ўзровень інтэрфейсу службы віджэта. Не патрабуецца для звычайных прыкладанняў."</string>
+    <string name="permdesc_bindRemoteViews" msgid="4717987810137692572">"Дазваляе ўладальніку прывязвацца да інтэрфейсу верхняга ўзроўню службы віджэта. Не патрабуецца для звычайных прыкладанняў."</string>
     <string name="permlab_bindDeviceAdmin" msgid="8704986163711455010">"узаемадзейнічаць з адміністратарам прылады"</string>
-    <!-- outdated translation 8714424333082216979 -->     <string name="permdesc_bindDeviceAdmin" msgid="569715419543907930">"Дазваляе ўладальніку адпраўляць намеры да адміністратара прылады. Не патрабуецца для звычайных прыкладанняў."</string>
+    <string name="permdesc_bindDeviceAdmin" msgid="569715419543907930">"Дазваляе ўладальніку адпраўляць намеры да адміністратара прылады. Не патрабуецца для звычайных прыкладанняў."</string>
     <string name="permlab_setOrientation" msgid="3365947717163866844">"змяняць арыентацыю экрана"</string>
-    <!-- outdated translation 6335814461615851863 -->     <string name="permdesc_setOrientation" msgid="3046126619316671476">"Дазваляе прыкладанням мяняць арыентацыю экрана ў любы час. Не патрабуецца для звычайных прыкладанняў."</string>
+    <string name="permdesc_setOrientation" msgid="3046126619316671476">"Дазваляе прыкладанням змяняць паварот экрана ў любы час. Не патрабуецца для звычайных прыкладанняў."</string>
     <string name="permlab_setPointerSpeed" msgid="9175371613322562934">"змена хутк. перамяшч. ўказ."</string>
-    <!-- outdated translation 137436038503379864 -->     <string name="permdesc_setPointerSpeed" msgid="6866563234274104233">"Дазваляе прыкладанням у любы момант мяняць хуткасць перамяшчэння ўказальніка мышы ці трэкпаду. Не патрабуецца для звычайных прыкладанняў."</string>
-    <!-- outdated translation 4255467255488653854 -->     <string name="permlab_signalPersistentProcesses" msgid="4539002991947376659">"адпраўляць сігналы Linux да прыкладанняў"</string>
-    <!-- outdated translation 3565530463215015289 -->     <string name="permdesc_signalPersistentProcesses" msgid="4896992079182649141">"Дазваляе прыкладанням запытваць адпраўку прадстаўленага сігналу да ўсіх пастаянных працэсаў."</string>
-    <!-- outdated translation 8659652042401085862 -->     <string name="permlab_persistentActivity" msgid="8841113627955563938">"прымусіць прыкладанне працаваць заўсёды"</string>
-    <!-- outdated translation 5037199778265006008 -->     <string name="permdesc_persistentActivity" msgid="4909910271316074418">"Дазваляе прыкладанням рабіць свае часткі ўстойлівымі, каб сістэма не магла выкарыстоўваць іх для іншых прыкладанняў."</string>
-    <!-- outdated translation 3343439331576348805 -->     <string name="permlab_deletePackages" msgid="184385129537705938">"выдаляць прыкладанні"</string>
-    <!-- outdated translation 3634943677518723314 -->     <string name="permdesc_deletePackages" msgid="7411480275167205081">"Дазваляе прыкладанням выдаляць пакеты Android. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб выдаляць важныя прыкладанні."</string>
-    <!-- outdated translation 2192134353540277878 -->     <string name="permlab_clearAppUserData" msgid="274109191845842756">"выдаляць дадзеныя іншых прыкладанняў"</string>
-    <!-- outdated translation 7546345080434325456 -->     <string name="permdesc_clearAppUserData" msgid="4625323684125459488">"Дазваляе прыкладанням выдаляць дадзеныя карыстальніка."</string>
-    <!-- outdated translation 1518556602634276725 -->     <string name="permlab_deleteCacheFiles" msgid="3128665571837408675">"выдаляць кэш іншых прыкладанняў"</string>
-    <!-- outdated translation 2283074077168165971 -->     <string name="permdesc_deleteCacheFiles" msgid="3812998599006730196">"Дазваляе прыкладанням выдаляць файлы кэша."</string>
-    <!-- outdated translation 4799785352306641460 -->     <string name="permlab_getPackageSize" msgid="7472921768357981986">"мераць месца для захоўвання прыкладання"</string>
-    <!-- outdated translation 5557253039670753437 -->     <string name="permdesc_getPackageSize" msgid="3921068154420738296">"Дазваляе прыкладанням атрымліваць свой код, дадзеныя і аб\'ём кэш-памяці"</string>
-    <!-- outdated translation 335800214119051089 -->     <string name="permlab_installPackages" msgid="2199128482820306924">"непасрэдна ўсталёўваць прыкладанні"</string>
-    <!-- outdated translation 526669220850066132 -->     <string name="permdesc_installPackages" msgid="5628530972548071284">"Дазваляе прыкладанням усталёўваць новыя або абноўленыя пакеты Android. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб дадаваць новыя прыкладанні з дазволамі высокага ўзроўню."</string>
-    <!-- outdated translation 4747698311163766540 -->     <string name="permlab_clearAppCache" msgid="7487279391723526815">"выдаляць усе дадзеныя кэша прыкладання"</string>
-    <!-- outdated translation 3097119797652477973 -->     <string name="permdesc_clearAppCache" product="tablet" msgid="3523396284474042284">"Дазваляе прыкладанню вызваліць прастору на планшэце, выдаліўшы файлы з каталогу кэша прыкладання. Доступ да сістэмных працэсаў звычайна вельмі абмежаваны."</string>
-    <!-- outdated translation 3097119797652477973 -->     <string name="permdesc_clearAppCache" product="default" msgid="5067988373366292186">"Дазваляе прыкладанню вызваліць прастору на планшэце, выдаліўшы файлы з каталогу кэша прыкладання. Доступ да сістэмных працэсаў звычайна вельмі абмежаваны."</string>
-    <!-- outdated translation 728454979946503926 -->     <string name="permlab_movePackage" msgid="3289890271645921411">"Перамяшчэнне рэсурсаў прыкладання"</string>
-    <!-- outdated translation 6323049291923925277 -->     <string name="permdesc_movePackage" msgid="319562217778244524">"Дазваляе прыкладанню перамяшчаць рэсурсы прыкладання з унутранай памяці на знешні носьбіт і наадварот."</string>
+    <string name="permdesc_setPointerSpeed" msgid="6866563234274104233">"Дазваляе прыкладанням змяняць хуткасць курсору мышы або трэкпада ў любы час. Не патрабуецца для звычайных прыкладанняў."</string>
+    <string name="permlab_signalPersistentProcesses" msgid="4539002991947376659">"адправіць сігналы Linux да прыкладанняў"</string>
+    <string name="permdesc_signalPersistentProcesses" msgid="4896992079182649141">"Дазваляе прыкладанням запытваць адпраўку падаваемага сігнала для ўсiх пастаянных працэсаў."</string>
+    <string name="permlab_persistentActivity" msgid="8841113627955563938">"прымусіць прыкладанне працаваць заўсёды"</string>
+    <string name="permdesc_persistentActivity" msgid="4909910271316074418">"Дазваляе прыкладанням рабіць свае часткі пастаяннымі, каб сістэма не магла выкарыстоўваць iх для іншых прыкладанняў."</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_getPackageSize" msgid="7472921768357981986">"вымерыць прастору для захоўвання прыкладання"</string>
+    <string name="permdesc_getPackageSize" msgid="3921068154420738296">"Дазваляе прыкладанням атрымліваць яго код, дадзеныя і аб\'ём кэш-памяці"</string>
+    <string name="permlab_installPackages" msgid="2199128482820306924">"усталяваць прыкладанні непасрэдна"</string>
+    <string name="permdesc_installPackages" msgid="5628530972548071284">"Дазваляе прыкладанням ксталёўваць новыя або абноўленыя пакеты Android. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб дадаваць новыя прыкладаннi з дазволамі адвольнай ступені."</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">"чытаць канфідэнцыйныя дадзеныя дзённiка"</string>
-    <!-- outdated translation 4077356893924755294 -->     <string name="permdesc_readLogs" product="tablet" msgid="82061313293455151">"Дазваляе прыкладанням чытаць розныя файлы журналаў сістэмы. Такiм чынам можна выявiць агульную інфармацыю аб тым, што вы робіце з планшэтам, якая патэнцыйна змяшчае асабістыя або канфiдэнцыйныя звесткi."</string>
-    <!-- outdated translation 4077356893924755294 -->     <string name="permdesc_readLogs" product="default" msgid="2063438140241560443">"Дазваляе прыкладанням чытаць розныя файлы журналаў сістэмы. Такiм чынам можна выявiць агульную інфармацыю аб тым, што вы робіце з планшэтам, якая патэнцыйна змяшчае асабістыя або канфiдэнцыйныя звесткi."</string>
+    <string name="permdesc_readLogs" product="tablet" msgid="82061313293455151">"Дазваляе прыкладанням счытваць розныя файлы сiстэмнай гiсторыi. Такiм чынам, можна выявiць агульную інфармацыю пра тое, што вы робіце з планшэтам, у тым ліку, магчыма, асабістыя або канфiдэнцыйныя звесткi."</string>
+    <string name="permdesc_readLogs" product="default" msgid="2063438140241560443">"Дазваляе прыкладанню счытваць розныя сістэмныя файлы гiсторый. Гэта дазваляе атрымліваць агульную інфармацыю аб тым, як выкарыстоўваецца тэлефон, у тым ліку, магчыма, асабістую або прыватную інфармацыю."</string>
+    <string name="permlab_anyCodecForPlayback" msgid="715805555823881818">"для прайгравання выкарыстоўваць любы мультымедыйны дэкодэр"</string>
+    <string name="permdesc_anyCodecForPlayback" msgid="8283912488433189010">"Дазваляе прыкладанням выкарыстоўваць любы ўсталяваны iнструмент для мультымедыйнага дэкадавання, каб прайграць."</string>
     <string name="permlab_diagnostic" msgid="8076743953908000342">"чытаць/запісваць на дыягнастычныя рэсурсы"</string>
-    <!-- outdated translation 3121238373951637049 -->     <string name="permdesc_diagnostic" msgid="6608295692002452283">"Дазваляе прыкладанням счытваць і запісваць любы рэсурс, які належыць дыягнастычнай групе, напрыклад файлы распрацоўшчыка. Патэнцыйна гэта можа паўплываць на стабільнасць і бяспеку сістэмы. Гэта павінна выкарыстоўвацца ТОЛЬКІ для апаратнай дыягностыкі вытворцам або аператарам."</string>
-    <!-- outdated translation 79425198834329406 -->     <string name="permlab_changeComponentState" msgid="6335576775711095931">"уключаць або адключаць кампаненты прыкладання"</string>
-    <!-- outdated translation 4647419365510068321 -->     <string name="permdesc_changeComponentState" product="tablet" msgid="8887435740982237294">"Дазваляе прыкладанню ўключаць ці адключаць кампанент іншага прыкладання. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта для адключэння важных магчымасцяў тэлефона. Трэба захоўваць асцярожнасць з гэтым дазволам, таму што гэта можа прывесці кампаненты прыкладання да непрыдатнасці, непаслядоўнасці або няўстойлівасці."</string>
-    <!-- outdated translation 4647419365510068321 -->     <string name="permdesc_changeComponentState" product="default" msgid="1827232484416505615">"Дазваляе прыкладанню ўключаць ці адключаць кампанент іншага прыкладання. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта для адключэння важных магчымасцяў тэлефона. Трэба захоўваць асцярожнасць з гэтым дазволам, таму што гэта можа прывесці кампаненты прыкладання да непрыдатнасці, непаслядоўнасці або няўстойлівасці."</string>
-    <!-- outdated translation 3393305202145172005 -->     <string name="permlab_setPreferredApplications" msgid="8463181628695396391">"выбіраць пажаданыя праграмы"</string>
-    <!-- outdated translation 760008293501937546 -->     <string name="permdesc_setPreferredApplications" msgid="4973986762241783712">"Дазваляе прыкладанням змяняць вашы выбраныя прыкладанні. Гэта можа дазволіць шкоднасным прыкладанням незаўважна мяняць прыкладанні, якія запускаюцца, падмяняць існуючыя прыкладанні для збору вашых канфідэнцыйных дадзеных."</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="default" msgid="1827232484416505615">"Дазваляе прыкладанням змяняць вызначэнне таго, будзе ўключаны кампанент іншага прыкладання ці не. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта для адключэння важных магчымасцяў тэлефона. З гэтым дазволам трэба быць уважлівым, бо можна прывесці кампаненты прыкладання ў непрыдатны, супярэчлівы або няўстойлівы стан."</string>
+    <string name="permlab_setPreferredApplications" msgid="8463181628695396391">"усталяваць пажаданыя прыкладанні"</string>
+    <string name="permdesc_setPreferredApplications" msgid="4973986762241783712">"Дазваляе прыкладанням змяняць вашы пажаданыя прыкладанні. Шкоднасныя прыкладанні могуць непрыкметна змяняць запушчаныя прыкладанні, падмяняючы існуючыя прыкладанні, каб збiраць вашы асабістыя дадзеныя."</string>
     <string name="permlab_writeSettings" msgid="1365523497395143704">"змена глабальных параметраў сістэмы"</string>
-    <!-- outdated translation 838789419871034696 -->     <string name="permdesc_writeSettings" msgid="7775723441558907181">"Дазваляе прыкладанням змяняць налады сістэмы. Шкодныя прыкладанні могуць пашкодзіць канфігурацыю сістэмы."</string>
+    <string name="permdesc_writeSettings" msgid="7775723441558907181">"Дазваляе прыкладаннем змяняць дадзеныя налад сістэмы. Шкоднасныя прыкладанні могуць пашкодзіць канфігурацыю вашай сістэмы."</string>
     <string name="permlab_writeSecureSettings" msgid="204676251876718288">"змяняць параметры бяспекі сістэмы"</string>
-    <!-- outdated translation 5497873143539034724 -->     <string name="permdesc_writeSecureSettings" msgid="8159535613020137391">"Дазваляе прыкладанням мяняць параметры бяспекі сістэмы. Не выкарыстоўваецца звычайнымі прыкладаннямі."</string>
+    <string name="permdesc_writeSecureSettings" msgid="8159535613020137391">"Дазваляе прыкладанням змяняць дадзеныя параметраў бяспекі сістэмы. Не для выкарыстання звычайнымі прыкладаннямі."</string>
     <string name="permlab_writeGservices" msgid="2149426664226152185">"змяняць карту службаў Google"</string>
-    <!-- outdated translation 6602362746516676175 -->     <string name="permdesc_writeGservices" msgid="1287309437638380229">"Дазваляе прыкладанням змяняць карту службаў Google. Не для выкарыстання звычайнымі прыкладаннямі."</string>
+    <string name="permdesc_writeGservices" msgid="1287309437638380229">"Дазваляе прыкладанням змяняць карту службаў Google. Не для выкарыстання звычайнымі прыкладаннямі."</string>
     <string name="permlab_receiveBootCompleted" msgid="7776779842866993377">"аўтаматычна запускаць пры загрузцы"</string>
-    <!-- outdated translation 7530977064379338199 -->     <string name="permdesc_receiveBootCompleted" product="tablet" msgid="7390304664116880704">"Дазваляе прыкладанням запускаць саміх сябе, як толькі сістэма цалкам загрузіцца. Гэта можа зрабіць загрузку планшэта больш павольнай і дазволіць прыкладанню запаволіць увесь планшэт, заўсёды працуючы."</string>
-    <!-- outdated translation 7530977064379338199 -->     <string name="permdesc_receiveBootCompleted" product="default" msgid="513950589102617504">"Дазваляе прыкладанням запускаць саміх сябе, як толькі сістэма цалкам загрузіцца. Гэта можа зрабіць загрузку планшэта больш павольнай і дазволіць прыкладанню запаволіць увесь планшэт, заўсёды працуючы."</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">"адпраўляць нетэрмiновую рассылку"</string>
-    <!-- outdated translation 6322249605930062595 -->     <string name="permdesc_broadcastSticky" product="tablet" msgid="1181582512022829259">"Дазваляе прыкладанням адпраўляць прыдаткі да трансляцый, якія застаюцца пасля заканчэння трансляцыі. Шкоднасныя прыкладанні могуць зрабіць работу планшэта павольнай або нестабільнай, прымушаючы яго выкарыстоўваць занадта вялікі аб\'ём памяці."</string>
-    <!-- outdated translation 6322249605930062595 -->     <string name="permdesc_broadcastSticky" product="default" msgid="3287869131621514325">"Дазваляе прыкладанням адпраўляць прыдаткі да трансляцый, якія застаюцца пасля заканчэння трансляцыі. Шкоднасныя прыкладанні могуць зрабіць работу планшэта павольнай або нестабільнай, прымушаючы яго выкарыстоўваць занадта вялікі аб\'ём памяці."</string>
+    <string name="permdesc_broadcastSticky" product="tablet" msgid="1181582512022829259">"Дазваляе прыкладанням дасылаць далейшыя звязаныя перадачы, якія застаюцца пасля заканчэння асноўнай перадачы. Шкоднасныя прыкладанні могуць зрабіць працу планшэта павольнай або няўстойлівай, прымушаючы яго выкарыстоўваць занадта шмат памяці."</string>
+    <string name="permdesc_broadcastSticky" product="default" msgid="3287869131621514325">"Дазваляе прыкладанню дасылаць далейшыя звязаныя перадачы, якія застаюцца пасля заканчэння асноўнай перадачы. Шкоднасныя прыкладанні могуць зрабіць працу тэлефона павольнай або няўстойлівай, прымушаючы яго выкарыстоўваць занадта шмат памяці."</string>
     <string name="permlab_readContacts" msgid="6219652189510218240">"чытаць кантактныя дадзеныя"</string>
-    <!-- outdated translation 7596158687301157686 -->     <string name="permdesc_readContacts" product="tablet" msgid="4028657556924039119">"Дазваляе прыкладанням счытваць усе кантакты (адрасы), якія захоўваюцца на планшэце. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб адпраўляць вашыя дадзеныя іншым асобам."</string>
-    <!-- outdated translation 7596158687301157686 -->     <string name="permdesc_readContacts" product="default" msgid="2032222056456498547">"Дазваляе прыкладанням счытваць усе кантакты (адрасы), якія захоўваюцца на планшэце. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб адпраўляць вашыя дадзеныя іншым асобам."</string>
+    <string name="permdesc_readContacts" product="tablet" msgid="4028657556924039119">"Дазваляе прыкладанням счытваць усе кантакты (адрасы), якія захоўваюцца на планшэце. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб адпраўляць дадзеныя іншым людзям."</string>
+    <string name="permdesc_readContacts" product="default" msgid="2032222056456498547">"Дазваляе прыкладанням счытваць усе кантакты (адрасы), якія захоўваюцца на вашым тэлефоне. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб адпраўляць дадзеныя іншым людзям."</string>
     <string name="permlab_writeContacts" msgid="644616215860933284">"запісваць кантактныя дадзеныя"</string>
-    <!-- outdated translation 7782689510038568495 -->     <string name="permdesc_writeContacts" product="tablet" msgid="988969759110632978">"Дазваляе прыкладанням змяняць кантакты (адрасы), якія захоўваюцца на планшэце. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб сцерці або змяніць вашыя кантактныя дадзеныя."</string>
-    <!-- outdated translation 7782689510038568495 -->     <string name="permdesc_writeContacts" product="default" msgid="5075164818647934067">"Дазваляе прыкладанням змяняць кантакты (адрасы), якія захоўваюцца на планшэце. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб сцерці або змяніць вашыя кантактныя дадзеныя."</string>
+    <string name="permdesc_writeContacts" product="tablet" msgid="988969759110632978">"Дазваляе прыкладанням змяняць кантакты (адрасы), якія захоўваюцца на планшэце. Шкоднасныя прыкладанні могуць выкарыстоўваць гэтую магчымасць для выдалення або змены кантактных дадзеных."</string>
+    <string name="permdesc_writeContacts" product="default" msgid="5075164818647934067">"Дазваляе прыкладанням змяняць кантакты (адрасы), якія захоўваюцца на вашым тэлефоне. Шкоднасныя прыкладанні могуць выкарыстоўваць гэту магчымасць для выдалення або змены кантактных дадзеных."</string>
     <string name="permlab_readProfile" msgid="6824681438529842282">"чытаць дадзеныя вашага профілю"</string>
-    <!-- outdated translation 6335739730324727203 -->     <string name="permdesc_readProfile" product="default" msgid="94520753797630679">"Дазваляе прыкладанням счытваць персанальныя дадзеныя профілю, якія захоўваюцца на вашай прыладзе (напрыклад, вашыя імя і кантактную інфармацыю). Гэта азначае, што прыкладанне можа ідэнтыфікаваць вас і адправіць інфармацыю аб вашым профілі іншым асобам."</string>
+    <string name="permdesc_readProfile" product="default" msgid="94520753797630679">"Дазваляе прыкладанням счытваць асабістую інфармацыю ў профілях, якая захоўваецца на вашай прыладзе, напрыклад, ваша імя і кантактную інфармацыю. Гэта азначае, што прыкладанне можа ідэнтыфікаваць вас і адправіць інфармацыю вашага профілю трэцім асобам."</string>
     <string name="permlab_writeProfile" msgid="4679878325177177400">"увядзіце дадзеныя вашага профілю"</string>
-    <!-- outdated translation 6431297330378229453 -->     <string name="permdesc_writeProfile" product="default" msgid="4637366723793045603">"Дазваляе прыкладанням змяняць або дадаваць персанальныя дадзеныя профілю, якія захоўваюцца на вашай прыладзе (напрыклад, вашыя імя і кантактную інфармацыю). Гэта азначае, што іншыя прыкладанні могуць ідэнтыфікаваць вас і адправіць інфармацыю аб вашым профілі іншым асобам."</string>
+    <string name="permdesc_writeProfile" product="default" msgid="4637366723793045603">"Дазваляе прыкладанням змяняць ці дадаваць асабістую інфармацыю профіляў, захаваных на прыладзе, напрыклад ваша імя і кантактную інфармацыю. Такім чынам, іншыя прыкладанні могуць ідэнтыфікаваць вас і адпраўляць інфармацыю вашага профіля трэцім асобам."</string>
     <string name="permlab_readSocialStream" product="default" msgid="1268920956152419170">"чытаць мой паток абнаўленняў"</string>
-    <!-- outdated translation 1300659548047580769 -->     <string name="permdesc_readSocialStream" product="default" msgid="3419050808547335320">"Дазваляе прыкладанням атрымліваць доступ да абнаўленняў вашых сяброў i сiнхранiзаваць гэтыя звесткi. З дапамогай шкоднасных прыкладанняў хтосьцi можа атрымаць доступ да вашай асабiстай перапiскi з сябрамi ў сацыяльных сетках."</string>
+    <string name="permdesc_readSocialStream" product="default" msgid="3419050808547335320">"Дазваляе прыкладанням атрымліваць доступ і сінхранізаваць абнаўленнi ад вас i вашых сяброў у сацыяльных сетках. З дапамогай шкоднасных прыкладанняў хтосьцi можа чытаць вашу асабiстую перапiску з сябрамі ў сацыяльных сетках."</string>
     <string name="permlab_writeSocialStream" product="default" msgid="3504179222493235645">"запісаць у мой паток абнаўленняў"</string>
-    <!-- outdated translation 8649864102944627446 -->     <string name="permdesc_writeSocialStream" product="default" msgid="3496277176955721451">"Дазваляе прыкладанням публiкаваць абнаўленнi вашых сяброў з сацыяльных сетак. З дапамогай шкоднасных прыкладанняў хтосьцi можа падрабляць абнаўленнi ад вашых сяброў i, напрыклад, збiраць вашы канфiдэнцыйныя звесткi."</string>
+    <string name="permdesc_writeSocialStream" product="default" msgid="3496277176955721451">"Дазваляе прыкладанням адлюстроўваць абнаўленнi ад вашых сяброў у сацыяльных сетках. З дапамогай шкоднасных прыкладанняў хтосьцi можа прыкінуцца вашым сябрам, каб выкрасцi паролi i iншыя канфiдэнцыйныя звесткi."</string>
     <string name="permlab_readCalendar" msgid="5972727560257612398">"чытаць падзеі календара, а таксама прыватную інфармацыю"</string>
-    <!-- outdated translation 5665520896961671949 -->     <string name="permdesc_readCalendar" product="tablet" msgid="2338414551004122687">"Дазваляе прыкладанням счытваць усе падзеі календара, захаваныя на планшэце, у тым ліку падзеі сяброў і калегаў. З дапамогай гэтага дазволу шкоднасныя прыкладанні могуць здабываць персанальную інфармацыю з гэтых календароў без ведама ўладальнікаў."</string>
-    <!-- outdated translation 5665520896961671949 -->     <string name="permdesc_readCalendar" product="default" msgid="5693933067751827753">"Дазваляе прыкладанням счытваць усе падзеі календара, захаваныя на планшэце, у тым ліку падзеі сяброў і калегаў. З дапамогай гэтага дазволу шкоднасныя прыкладанні могуць здабываць персанальную інфармацыю з гэтых календароў без ведама ўладальнікаў."</string>
+    <string name="permdesc_readCalendar" product="tablet" msgid="2338414551004122687">"Дазваляе прыкладанню счытваць усе мерапрыемствы календара, захаваныя на планшэце, у тым ліку мерапрыемствы сяброў і калег. Шкоднасныя прыкладанні могуць атрымліваць асабістую інфармацыю з гэтых календароў без ведама ўладальнікаў."</string>
+    <string name="permdesc_readCalendar" product="default" msgid="5693933067751827753">"Дазваляе прыкладанню счытваць усе мерапрыемствы календара, захаваныя на вашым тэлефоне, у тым ліку мерапрыемствы сяброў і калег. Шкоднасныя прыкладаннi могуць атрымліваць асабістую інфармацыю з гэтых календароў без ведама ўладальнікаў."</string>
     <string name="permlab_writeCalendar" msgid="8438874755193825647">"дадаваць ці змяняць падзеі календара і адпраўляць электронную пошту да гасцей без ведама ўладальнікаў"</string>
-    <!-- outdated translation 5368129321997977226 -->     <string name="permdesc_writeCalendar" msgid="2243771395254848873">"Дазваляе прыкладанням адпраўляць запрашэнні на мерапрыемствы ад iмя ўладальніка календара і дадаваць, выдаляць, змяняць падзеі, якія можна змяняць на прыладзе, у тым ліку падзеі сяброў або калегаў. З дапамогай гэтага дазволу шкоднасныя прыкладанні могуць рассылаць спам , які выглядае як прыбыўшы ад уладальніка календара, змяняць падзеі без ведама ўладальнікаў або дадаваць падробленыя падзеі."</string>
+    <string name="permdesc_writeCalendar" msgid="2243771395254848873">"Дазваляе прыкладанням адпраўляць запрашэнні на мерапрыемствы ў якасці ўладальніка календара і дадаваць, выдаляць, рэдагаваць мерапрыемствы, якія можна змяняць на прыладзе, у тым ліку мерапрыемствы сяброў або калег. Шкоднасныя прыкладанні могуць адпраўляць паведамленні-спам, якія зыходзяць ад уладальніка календара, змяняць мерапрыемствы без ведама ўладальнікаў або дадаваць падробленыя мерапрыемствы."</string>
     <string name="permlab_accessMockLocation" msgid="8688334974036823330">"макет крыніц месцазнаходжання для тэставання"</string>
-    <!-- outdated translation 7648286063459727252 -->     <string name="permdesc_accessMockLocation" msgid="7577931556422993949">"Стварыць макет крыніц месцазнаходжанняў для тэставання. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта для змены месцазнаходжання і/або статусу, атрыманых з рэальных сістэм пазіцыявання, напрыклад з GPS або сеткі правайдэраў мабільнай сувязі."</string>
+    <string name="permdesc_accessMockLocation" msgid="7577931556422993949">"Дазваляе прыкладанням ствараць макет крыніц месцазнаходжання для тэставання. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб змяняць месцазнаходжанне і/або статус, паведамляемы рэальнымі крыніцамі месцазнаходжання, напрыклад, GPS або правайдэрамі сеткі."</string>
     <string name="permlab_accessLocationExtraCommands" msgid="2836308076720553837">"доступ да дадатковых камандаў пастаўшчыка месцазнаходжання"</string>
-    <!-- outdated translation 1948144701382451721 -->     <string name="permdesc_accessLocationExtraCommands" msgid="6737736970602176133">"Доступ да дадатковых каманд пастаўшчыка месцазнаходжання. Шкоднасныя прыкладанні могуць карыстацца гэтым, каб умешвацца ў працу GPS і іншых крыніц месцазнаходжання."</string>
+    <string name="permdesc_accessLocationExtraCommands" msgid="6737736970602176133">"Дазваляе прыкладанням атрымліваць доступ да дадатковых каманд пастаўшчыка месца. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб умешвацца ў працу GPS або іншых крыніц месцазнаходжання."</string>
     <string name="permlab_installLocationProvider" msgid="6578101199825193873">"дазвол на ўсталяванне пастаўшчыка месцазнаходжання"</string>
-    <!-- outdated translation 5449175116732002106 -->     <string name="permdesc_installLocationProvider" msgid="1742577679350078373">"Стварыць макет крыніц месца для тэставання. Шкоднае праграмнае забеспячэнне можа выкарыстаць гэта, каб змяніць месцазнаходжанне і/або статус, атрыманы з рэальных сістэм пазіцыянавання, напрыклад з GPS або сеткі правайдэраў мабільнай сувязі, або можа вызначаць ваша месцазнаходжанне і перадаваць звесткі на вонкавыя прылады."</string>
+    <string name="permdesc_installLocationProvider" msgid="1742577679350078373">"Стварае макет крыніц месцазнаходжання для тэставання. Шкоднасныя прыкладаннi могуць выкарыстоўваць гэта, каб змяняць месцазнаходжанне і/або статус, які перадаюць рэальныя крыніцы месцазнаходжання, напрыклад GPS або пастаўшчыкі паслуг сеткі, ці кантраляваць вашае месцазнаходжанне і перадаваць яго на знешнюю крыніцу."</string>
     <string name="permlab_accessFineLocation" msgid="8116127007541369477">"дакладнае (GPS) месцазнаходжанне"</string>
-    <!-- outdated translation 243973693233359681 -->     <string name="permdesc_accessFineLocation" product="tablet" msgid="5326423948268164934">"Доступ да дакладных крыніц месцаў (напрыклад, да глабальнай сістэмы пазіцыянавання на планшэце), калі такія маюцца. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб вызначыць, дзе вы знаходзіцеся, і могуць спажываць дадатковую магутнасць батарэі."</string>
-    <!-- outdated translation 243973693233359681 -->     <string name="permdesc_accessFineLocation" product="default" msgid="7130267914433890869">"Доступ да дакладных крыніц месцаў (напрыклад, да глабальнай сістэмы пазіцыянавання на планшэце), калі такія маюцца. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб вызначыць, дзе вы знаходзіцеся, і могуць спажываць дадатковую магутнасць батарэі."</string>
+    <string name="permdesc_accessFineLocation" product="tablet" msgid="5326423948268164934">"Дазволіць доступ да сістэм дакладнага пазіцыянавання на планшэце, напрыклад да GPS, там, дзе гэта магчыма. Шкоднасныя прыкладаннi могуць выкарыстоўваць гэта для вызначэння вашага месцазнаходжання, а таксама могуць дадаткова спажываць магутнасць акумулятару."</string>
+    <string name="permdesc_accessFineLocation" product="default" msgid="7130267914433890869">"Дазволіць доступ да сістэм дакладнага пазіцыянавання на тэлефоне, напрыклад да GPS, там, дзе гэта магчыма. Шкоднасныя прыкладаннi могуць выкарыстоўваць гэта для вызначэння вашага месцазнаходжання, а таксама могуць дадаткова спажываць магутнасць акумулятару."</string>
     <string name="permlab_accessCoarseLocation" msgid="4642255009181975828">"прыблізнае (заснаванае на дадзеных сеткі) месцазнаходжанне"</string>
-    <!-- outdated translation 3704633168985466045 -->     <string name="permdesc_accessCoarseLocation" product="tablet" msgid="5460726396318105483">"Доступ да грубых крыніц месца (напрыклад, да базы дадзеных сотавай сеткі), каб вызначыць прыблізнае месцазнаходжанне планшэту, калі такія маюцца. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб прыкладна вызначыць, дзе вы знаходзіцеся."</string>
-    <!-- outdated translation 3704633168985466045 -->     <string name="permdesc_accessCoarseLocation" product="default" msgid="8900795778057579522">"Доступ да грубых крыніц месца (напрыклад, да базы дадзеных сотавай сеткі), каб вызначыць прыблізнае месцазнаходжанне планшэту, калі такія маюцца. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб прыкладна вызначыць, дзе вы знаходзіцеся."</string>
+    <string name="permdesc_accessCoarseLocation" product="tablet" msgid="5460726396318105483">"Атрымаць доступ да прыблізных крыніц месцазнаходжання (напрыклад, да базы дадзеных сотавай сеткі), каб вызначыць прыблізнае месцазнаходжанне планшэта, калі такія маюцца. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб прыкладна вызначаць, дзе вы знаходзіцеся."</string>
+    <string name="permdesc_accessCoarseLocation" product="default" msgid="8900795778057579522">"Каб вызначыць прыблізнае месцазнаходжанне тэлефона, атрымайце доступ да прыблізных крыніц месцазнаходжання (напрыклад, да базы дадзеных сотавай сеткі), калі такія маюцца. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб прыкладна вызначаць, дзе вы."</string>
     <string name="permlab_accessSurfaceFlinger" msgid="2363969641792388947">"доступ да SurfaceFlinger"</string>
-    <!-- outdated translation 6805241830020733025 -->     <string name="permdesc_accessSurfaceFlinger" msgid="1041619516733293551">"Дазваляе прыкладанням выкарыстоўваць нізкаўзроўневыя функцыі SurfaceFlinger."</string>
+    <string name="permdesc_accessSurfaceFlinger" msgid="1041619516733293551">"Дазваляе прыкладанням выкарыстоўваць нізкаўзроўневыя функцыі SurfaceFlinger."</string>
     <string name="permlab_readFrameBuffer" msgid="6690504248178498136">"чытаць буфер кадраў"</string>
-    <!-- outdated translation 7530020370469942528 -->     <string name="permdesc_readFrameBuffer" msgid="4937405521809454680">"Дазваляе прыкладанню чытаць змесціва буфера кадраў."</string>
+    <string name="permdesc_readFrameBuffer" msgid="4937405521809454680">"Дазваляе прыкладанням счытваць змесціва буферу кадра."</string>
     <string name="permlab_modifyAudioSettings" msgid="6095859937069146086">"змяняць налады аудыё"</string>
-    <!-- outdated translation 5793461287365991922 -->     <string name="permdesc_modifyAudioSettings" msgid="7343951185408396919">"Дазваляе прыкладанням змяняць глабальныя налады аудыё, напрыклад гучнасць і маршрутызацыю."</string>
+    <string name="permdesc_modifyAudioSettings" msgid="7343951185408396919">"Дазваляе прыкладанням змяняць глабальныя налады аудыё, напрыклад гук і маршрутызацыю."</string>
     <string name="permlab_recordAudio" msgid="3876049771427466323">"запісваць аўдыё"</string>
-    <!-- outdated translation 6493228261176552356 -->     <string name="permdesc_recordAudio" msgid="2387462233976248635">"Дае прыкладанням доступ да шляха запісу аўдыё."</string>
+    <string name="permdesc_recordAudio" msgid="2387462233976248635">"Дазваляе прыкладанням атрымліваць доступ да шляху аудыёзапісу."</string>
     <string name="permlab_camera" msgid="3616391919559751192">"рабіць фатаграфіі і відэа"</string>
-    <!-- outdated translation 6004878235852154239 -->     <string name="permdesc_camera" msgid="1507407407002492176">"Дазваляе прыкладанням здымаць фатаграфіі і відэа з дапамогай камеры. Гэта дазваляе прыкладанням ў любы час збіраць выявы, якія бачыць камера."</string>
+    <string name="permdesc_camera" msgid="1507407407002492176">"Дазваляе прыкладанням рабiць фатаграфіі і відэа з камеры. Гэта дазваляе прыкладанням у любы час збіраць выявы, якія \"бачыць\" камера."</string>
     <string name="permlab_brick" product="tablet" msgid="2961292205764488304">"цалкам адключыць планшэт"</string>
     <string name="permlab_brick" product="default" msgid="8337817093326370537">"цалкам адключаць тэлефон"</string>
-    <!-- outdated translation 7379164636920817963 -->     <string name="permdesc_brick" product="tablet" msgid="4334818808001699530">"Дазваляе прыкладанням цалкам адключаць планшэт. Гэта вельмі небяспечна."</string>
-    <!-- outdated translation 7379164636920817963 -->     <string name="permdesc_brick" product="default" msgid="5788903297627283099">"Дазваляе прыкладанням цалкам адключаць планшэт. Гэта вельмі небяспечна."</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>
-    <!-- outdated translation 4555793623560701557 -->     <string name="permdesc_reboot" product="tablet" msgid="8172056180063700741">"Дазваляе прыкладанню прымусова перазагрузіць планшэт."</string>
-    <!-- outdated translation 4555793623560701557 -->     <string name="permdesc_reboot" product="default" msgid="5326008124289989969">"Дазваляе прыкладанню прымусова перазагрузіць планшэт."</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" msgid="1761023272170956541">"уключэнне і адключэнне файлавых сістэм"</string>
-    <!-- outdated translation 6253263792535859767 -->     <string name="permdesc_mount_unmount_filesystems" msgid="1829290701658992347">"Дазваляе прыкладанням уключаць і адключаць файлавыя сістэмы для падлучэння зменных назапашвальнікаў."</string>
+    <string name="permdesc_mount_unmount_filesystems" msgid="1829290701658992347">"Дазваляе прыкладанням падключаць і адключаць файлавыя сістэмы для здымных назапашвальнікаў."</string>
     <string name="permlab_mount_format_filesystems" msgid="5523285143576718981">"фарматаваць знешнія назапашвальнікі"</string>
-    <!-- outdated translation 574060044906047386 -->     <string name="permdesc_mount_format_filesystems" msgid="8784268246779198627">"Дазваляе прыкладанням фарматаваць здымныя назапашвальнiкi."</string>
+    <string name="permdesc_mount_format_filesystems" msgid="8784268246779198627">"Дазваляе прыкладанням фарматаваць здымны назапашвальнiк."</string>
     <string name="permlab_asec_access" msgid="3411338632002193846">"атрымаць інфармацыю аб унутранай памяці"</string>
-    <!-- outdated translation 8820326551687285439 -->     <string name="permdesc_asec_access" msgid="3094563844593878548">"Дазваляе прыкладанню атрымліваць інфармацыю аб унутранай памяці."</string>
+    <string name="permdesc_asec_access" msgid="3094563844593878548">"Дазваляе прыкладанню атрымліваць інфармацыю пра ўнутраную памяць."</string>
     <string name="permlab_asec_create" msgid="6414757234789336327">"стварыць унутраную памяць"</string>
-    <!-- outdated translation 2621346764995731250 -->     <string name="permdesc_asec_create" msgid="4558869273585856876">"Дазваляе прыкладанню ствараць унутраную памяць."</string>
+    <string name="permdesc_asec_create" msgid="4558869273585856876">"Дазваляе прыкладанням ствараць унутраную памяць."</string>
     <string name="permlab_asec_destroy" msgid="526928328301618022">"знішчыць унутраную памяць"</string>
-    <!-- outdated translation 2746706889208066256 -->     <string name="permdesc_asec_destroy" msgid="7218749286145526537">"Дазваляе прыкладанню знішчаць унутраную памяць."</string>
-    <!-- outdated translation 2456287623689029744 -->     <string name="permlab_asec_mount_unmount" msgid="8877998101944999386">"падключыць/адключыць унутраную памяць"</string>
-    <!-- outdated translation 5934375590189368200 -->     <string name="permdesc_asec_mount_unmount" msgid="3451360114902490929">"Дазваляе прыкладанню падключаць/адключаць унутраную памяць."</string>
+    <string name="permdesc_asec_destroy" msgid="7218749286145526537">"Дазваляе прыкладанням выдаляць унутраную памяць."</string>
+    <string name="permlab_asec_mount_unmount" msgid="8877998101944999386">"падключэнне/адключэнне ўнутранай памяці"</string>
+    <string name="permdesc_asec_mount_unmount" msgid="3451360114902490929">"Дазваляе прыкладанням падлучаць i адлучаць унутраную памяць."</string>
     <string name="permlab_asec_rename" msgid="7496633954080472417">"перайменаваць унутраную памяць"</string>
-    <!-- outdated translation 2152829985238876790 -->     <string name="permdesc_asec_rename" msgid="1794757588472127675">"Дазваляе праграмам змяняць імя ўнутранай памяці."</string>
+    <string name="permdesc_asec_rename" msgid="1794757588472127675">"Дазваляе прыкладанням змяняць імя ўнутранай памяці."</string>
     <string name="permlab_vibrate" msgid="7768356019980849603">"кіраваць вібрацыяй"</string>
-    <!-- outdated translation 2886677177257789187 -->     <string name="permdesc_vibrate" msgid="6284989245902300945">"Дазваляе прыкладанням кіраваць вібрацыяй."</string>
+    <string name="permdesc_vibrate" msgid="6284989245902300945">"Дазваляе прыкладанням кіраваць вібрацыяй."</string>
     <string name="permlab_flashlight" msgid="2155920810121984215">"кіраваць ўспышкай"</string>
-    <!-- outdated translation 6433045942283802309 -->     <string name="permdesc_flashlight" msgid="6522284794568368310">"Дазваляе прыкладанню кіраваць ліхтарыкам."</string>
+    <string name="permdesc_flashlight" msgid="6522284794568368310">"Дазваляе прыкладанню кіраваць ліхтарыкам."</string>
     <string name="permlab_manageUsb" msgid="1113453430645402723">"кіраваць спісам пажаданых і дазволеных USB-прылад"</string>
-    <!-- outdated translation 6148489202092166164 -->     <string name="permdesc_manageUsb" msgid="7776155430218239833">"Дазваляе выкарыстоўваць праграму для кіравання спісам пажаданых і дазволеных USB-прылад."</string>
+    <string name="permdesc_manageUsb" msgid="7776155430218239833">"Дазваляе прыкладанням кіраваць наладамі і дазволамі USB-прылад."</string>
     <string name="permlab_accessMtp" msgid="4953468676795917042">"рэалізаваць пратакол MTP"</string>
     <string name="permdesc_accessMtp" msgid="6532961200486791570">"Дазваляе атрымаць доступ да драйвер ядра MTP, каб рэалізаваць USB-пратакол MTP."</string>
     <string name="permlab_hardware_test" msgid="4148290860400659146">"тэставаць апаратнае забеспячэнне"</string>
-    <!-- outdated translation 3668894686500081699 -->     <string name="permdesc_hardware_test" msgid="6597964191208016605">"Дазваляе прыкладанням кіраваць рознымі перыферыйнымі прыладамі для тэставання абсталявання."</string>
+    <string name="permdesc_hardware_test" msgid="6597964191208016605">"Дазваляе прыкладанням кіраваць рознымі перыферыйнымі прыладамі для тэставання апаратнага абсталявання."</string>
     <string name="permlab_callPhone" msgid="3925836347681847954">"непасрэдна набіраць тэлефонныя нумары"</string>
-    <!-- outdated translation 3369867353692722456 -->     <string name="permdesc_callPhone" msgid="6396463004110544744">"Дазваляе прыкладанням выклікаць тэлефонныя нумары без вашага ўмяшальніцтва. Шкодныя праграмы могуць рабіць непрадугледжаныя званкі за ваш кошт. Звярніце ўвагу: гэта не дазваляе прыкладанням выклікаць нумары экстраных службаў."</string>
+    <string name="permdesc_callPhone" msgid="6396463004110544744">"Дазваляе прыкладанням выклікаць тэлефонныя нумары без вашага ведама. Шкоднасныя прыкладанні могуць прывесці да з\'яўлення нечаканых выклікаў у вашым рахунку за паслугі тэлефоннай сувязі. Звярніце ўвагу, што гэты дазвол не дазваляе прыкладанню выклікаць экстраныя нумары."</string>
     <string name="permlab_callPrivileged" msgid="4198349211108497879">"непасрэдна выклікаць любыя тэлефонныя нумары"</string>
-    <!-- outdated translation 244405067160028452 -->     <string name="permdesc_callPrivileged" msgid="1689024901509996810">"Дазваляе прыкладанням тэлефанаваць на любы нумар, у тым лiку на нумары экстраных служб, без вашага ўмяшальніцтва. Шкодныя праграмы могуць рабіць непатрэбныя і незаконныя выклікі аварыйных службаў."</string>
+    <string name="permdesc_callPrivileged" msgid="1689024901509996810">"Дазваляе прыкладанню тэлефанаваць на любы тэлефонны нумар, у тым лiку на экстраныя нумары, без вашага ведама. Шкоднасныя прыкладанні могуць рабіць непатрэбныя і незаконныя экстраныя выклікі."</string>
     <string name="permlab_performCdmaProvisioning" product="tablet" msgid="4842576994144604821">"непасрэдна пачаць наладу CDMA-планшэта"</string>
     <string name="permlab_performCdmaProvisioning" product="default" msgid="5604848095315421425">"непасрэдна запускаць налады тэлефона CDMA"</string>
-    <!-- outdated translation 6457447676108355905 -->     <string name="permdesc_performCdmaProvisioning" msgid="1994193538802314186">"Дазваляе прыкладанням запускаць падрыхтоўку CDMA. Шкоднасныя прыкладанні могуць без неабходнасці пачаць падрыхтоўку CDMA"</string>
+    <string name="permdesc_performCdmaProvisioning" msgid="1994193538802314186">"Дазваляе прыкладанням запускаць рэзервы CDMA. Шкоднасныя прыкладанні могуць запускаць залішнія рэзервы CDMA."</string>
     <string name="permlab_locationUpdates" msgid="7785408253364335740">"кіраваць абвесткамі абнаўлення месцазнаходжання"</string>
-    <!-- outdated translation 2300018303720930256 -->     <string name="permdesc_locationUpdates" msgid="1120741557891438876">"Дазваляе ўключаць/выключаць абнаўленнi апавяшчэнняў аб месцазнаходжанні праз радыё. Не для выкарыстання звычайнымі прыкладаннямі."</string>
+    <string name="permdesc_locationUpdates" msgid="1120741557891438876">"Дазваляе прыкладанням уключаць i адключаць апавяшчэннi аб абнаўленні месцазнаходжання ад радыё. Не для выкарыстання звычайнымі прыкладаннямі."</string>
     <string name="permlab_checkinProperties" msgid="7855259461268734914">"атрымліваць доступ да ўласцівасцяў праверкі"</string>
-    <!-- outdated translation 7150307006141883832 -->     <string name="permdesc_checkinProperties" msgid="4024526968630194128">"Дазваляе счытваць і запісваць уласцівасці, загружаныя службай рэгістрацыі. Не выкарыстоўваецца звычайнымі прыкладаннямі."</string>
+    <string name="permdesc_checkinProperties" msgid="4024526968630194128">"Дазваляе прыкладанням сытваць/запісваць доступ да ўласцівасцяў, запампаваных службай праверкі. Не для выкарыстання звычайнымі прыкладаннямі."</string>
     <string name="permlab_bindGadget" msgid="776905339015863471">"выбіраць віджэты"</string>
-    <!-- outdated translation 2098697834497452046 -->     <string name="permdesc_bindGadget" msgid="8261326938599049290">"Дазваляе прыкладанням паведамляць сістэме, якія прыкладанні могуць выкарыстоўваць віджэты. З гэтым дазволам яны могуць даваць іншым прыкладанням доступ да персанальных дадзеных. Не выкарыстоўваецца звычайнымі прыкладаннямі."</string>
+    <string name="permdesc_bindGadget" msgid="8261326938599049290">"Дазваляе прыкладанням паведамляць сістэме, якая віджэты могуць быць выкарыстаны пэўнымі прыкладаннямі. Прыкладанне з гэтым дазволам можа прадастаўляць доступ да персанальных дадзеных іншым прыкладанням. Не для выкарыстання звычайнымі прыкладаннямі."</string>
     <string name="permlab_modifyPhoneState" msgid="8423923777659292228">"змяняць стан тэлефона"</string>
-    <!-- outdated translation 3302284561346956587 -->     <string name="permdesc_modifyPhoneState" msgid="1029877529007686732">"Дазваляе прыкладанням кіраваць тэлефоннымі функцыямі прылады. Прыкладанні з гэтым дазволам могуць пераключаць сеткі, уключаць і адключаць радыё на тэлефоне і г. д., нават не паведамляючы пра гэта."</string>
+    <string name="permdesc_modifyPhoneState" msgid="1029877529007686732">"Дазваляе прыкладанням кіраваць тэлефоннымі функцыямі прылады. Прыкладанне з гэтым дазволам можа пераключаць сеткі, уключаць і выключаць радыё на тэлефоне і г. д., нават не паведамляючы пра гэта."</string>
     <string name="permlab_readPhoneState" msgid="2326172951448691631">"чытаць стан тэлефона і ідэнтыфікацыйныя дадзеныя"</string>
-    <!-- outdated translation 188877305147626781 -->     <string name="permdesc_readPhoneState" msgid="5127767618743602782">"Дазваляе прыкладанням атрымліваць доступ да функцый тэлефона прылады. Прыкладанні з гэтым дазволам могуць вызначыць нумар тэлефона і серыйны нумар гэтага тэлефона, актыўнасць выкліка, нумар выкліканага абанента і таму падобнае."</string>
+    <string name="permdesc_readPhoneState" msgid="5127767618743602782">"Дазваляе прыкладанням атрымліваць доступ да тэлефонных функцый прылады. Прыкладанне з гэтым дазволам можа вызначаць нумар тэлефона і серыйны нумар гэтага тэлефона ці актыўны выклік, нумар выкліканага абанента і г. д."</string>
     <string name="permlab_wakeLock" product="tablet" msgid="1531731435011495015">"прадухіліць планшэт ад пераходу ў рэжым сну"</string>
     <string name="permlab_wakeLock" product="default" msgid="573480187941496130">"забараняць тэлефону пераходзіць ў рэжым сну"</string>
-    <!-- outdated translation 4032181488045338551 -->     <string name="permdesc_wakeLock" product="tablet" msgid="7311319824400447868">"Дазваляе прыкладанню прадухіліць планшэт ад пераходу ў рэжым сну."</string>
-    <!-- outdated translation 4032181488045338551 -->     <string name="permdesc_wakeLock" product="default" msgid="8559100677372928754">"Дазваляе прыкладанню прадухіліць планшэт ад пераходу ў рэжым сну."</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="default" msgid="4928622470980943206">"уключаць або выключаць тэлефон"</string>
-    <!-- outdated translation 3853773100100451905 -->     <string name="permdesc_devicePower" product="tablet" msgid="6689862878984631831">"Дазваляе прыкладанням уключаць або выключаць планшэт"</string>
-    <!-- outdated translation 3853773100100451905 -->     <string name="permdesc_devicePower" product="default" msgid="6037057348463131032">"Дазваляе прыкладанням уключаць або выключаць планшэт"</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="permlab_setWallpaper" msgid="6627192333373465143">"усталёўваць шпалеры"</string>
-    <!-- outdated translation 6417041752170585837 -->     <string name="permdesc_setWallpaper" msgid="7373447920977624745">"Дазваляе прыкладанням усталёўваць сiстэмныя шпалеры."</string>
+    <string name="permdesc_setWallpaper" msgid="7373447920977624745">"Дазваляе прыкладанням ксталёўваць сiстэмныя шпалеры."</string>
     <string name="permlab_setWallpaperHints" msgid="3600721069353106851">"усталёўваць падказкі памераў шпалер"</string>
-    <!-- outdated translation 6019479164008079626 -->     <string name="permdesc_setWallpaperHints" msgid="8235784384223730091">"Дазваляе прыкладанням задаваць падказкі па памеру сістэмных шпалераў."</string>
+    <string name="permdesc_setWallpaperHints" msgid="8235784384223730091">"Дазваляе прыкладанням задаваць падказкі па памеры сістэмных шпалер."</string>
     <string name="permlab_masterClear" msgid="2315750423139697397">"скідаць сістэму да завадскіх наладаў"</string>
-    <!-- outdated translation 5033465107545174514 -->     <string name="permdesc_masterClear" msgid="3665380492633910226">"Дазваляе прыкладанням рабіць поўнае скіданне да завадскіх налад. Пры гэтым выдаляюцца ўсе дадзеныя, канфігурацыя і ўсталяваныя прыкладанні."</string>
+    <string name="permdesc_masterClear" msgid="3665380492633910226">"Дазваляе прыкладанню цалкам скідваць сістэму да заводскіх налад, выдаляючы ўсе дадзеныя, налады і ўсталяваныя прыкладанні."</string>
     <string name="permlab_setTime" msgid="2021614829591775646">"задаць час"</string>
-    <!-- outdated translation 209693136361006073 -->     <string name="permdesc_setTime" product="tablet" msgid="1896341438151152881">"Дазваляе прыкладанню змяняць час на планшэце."</string>
-    <!-- outdated translation 209693136361006073 -->     <string name="permdesc_setTime" product="default" msgid="1855702730738020">"Дазваляе прыкладанню змяняць час на планшэце."</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>
-    <!-- outdated translation 2522877107613885139 -->     <string name="permdesc_setTimeZone" product="tablet" msgid="1676983712315827645">"Дазваляе прыкладанню змяняць гадзінны пояс планшэта."</string>
-    <!-- outdated translation 2522877107613885139 -->     <string name="permdesc_setTimeZone" product="default" msgid="4499943488436633398">"Дазваляе прыкладанню змяняць гадзінны пояс планшэта."</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>
-    <!-- outdated translation 6056903274106394752 -->     <string name="permdesc_accountManagerService" msgid="2684502137670299915">"Дазваляе прыкладанням тэлефанаваць на AccountAuthenticators"</string>
+    <string name="permdesc_accountManagerService" msgid="1948455552333615954">"Дазваляе прыкладанням тэлефанаваць на AccountAuthenticators."</string>
     <string name="permlab_getAccounts" msgid="4549918644233460103">"выяўляць вядомыя ўліковыя запісы"</string>
-    <!-- outdated translation 857622793935544694 -->     <string name="permdesc_getAccounts" product="tablet" msgid="3238360555257773358">"Дазваляе прыкладанням атрымліваць спіс уліковых запісаў, якія ёсць на планшэце."</string>
-    <!-- outdated translation 857622793935544694 -->     <string name="permdesc_getAccounts" product="default" msgid="2735689364629830348">"Дазваляе прыкладанням атрымліваць спіс уліковых запісаў, якія ёсць на планшэце."</string>
+    <string name="permdesc_getAccounts" product="tablet" msgid="3238360555257773358">"Дазваляе прыкладанню атрымліваць спіс уліковых запісаў, вядомых планшэту."</string>
+    <string name="permdesc_getAccounts" product="default" msgid="2735689364629830348">"Дазваляе прыкладанню атрымліваць спіс уліковых запісаў, вядомых тэлефону."</string>
     <string name="permlab_authenticateAccounts" msgid="3940505577982882450">"выступаць у якасці аўтэнтыфікатара ўліковага запісу"</string>
-    <!-- outdated translation 4006839406474208874 -->     <string name="permdesc_authenticateAccounts" msgid="5472124296908977260">"Дазваляе прыкладанню выкарыстоўваць магчымасці сродку праверкі сапраўднасці ўліковых запісаў AccountManager, у тым ліку ствараць уліковыя запісы, атрымліваць і наладжваць паролі для іх."</string>
+    <string name="permdesc_authenticateAccounts" msgid="5472124296908977260">"Дазваляе прыкладанням выкарыстоўваць магчымасці сродку праверкі сапраўднасці ўліковых запісаў AccountManager, у тым ліку ствараць уліковыя запісы, атрымліваць і наладжваць паролі для іх."</string>
     <string name="permlab_manageAccounts" msgid="4440380488312204365">"кіраванне спісам уліковых запісаў"</string>
-    <!-- outdated translation 8804114016661104517 -->     <string name="permdesc_manageAccounts" msgid="8698295625488292506">"Дазваляе прыкладанням выконваць такія аперацыі, як дадаванне і выдаленне ўліковых запісаў альбо выдаленне іх пароляў."</string>
+    <string name="permdesc_manageAccounts" msgid="8698295625488292506">"Дазваляе прыкладанням выконваць даданне і выдаленне ўліковых запісаў або выдаленне іх пароляў."</string>
     <string name="permlab_useCredentials" msgid="6401886092818819856">"выкарыстоўваць уліковыя дадзеныя ўліковага запісу"</string>
-    <!-- outdated translation 7416570544619546974 -->     <string name="permdesc_useCredentials" msgid="7984227147403346422">"Дазваляе прыкладанню запытваць ключы аўтэнтыфікацыі."</string>
+    <string name="permdesc_useCredentials" msgid="7984227147403346422">"Дазваляе прыкладанням запытваць ключы аўтэнтыфікаціі."</string>
     <string name="permlab_accessNetworkState" msgid="6865575199464405769">"праглядаць стан сеткі"</string>
-    <!-- outdated translation 558721128707712766 -->     <string name="permdesc_accessNetworkState" msgid="479772796952547198">"Дазваляе прыкладанням праглядаць стан усіх сетак."</string>
+    <string name="permdesc_accessNetworkState" msgid="479772796952547198">"Дазваляе прыкладанню праглядаць стан усіх сетак."</string>
     <string name="permlab_createNetworkSockets" msgid="9121633680349549585">"поўны доступ да інтэрнэту"</string>
-    <!-- outdated translation 4593339106921772192 -->     <string name="permdesc_createNetworkSockets" msgid="5963922297444265950">"Дазваляе прыкладанням ствараць сеткавыя злучальнікі."</string>
+    <string name="permdesc_createNetworkSockets" msgid="5963922297444265950">"Дазваляе прыкладанню ствараць сеткавыя сокеты."</string>
     <string name="permlab_writeApnSettings" msgid="505660159675751896">"змяняць/перахопліваць сеткавыя налады і трафік"</string>
-    <!-- outdated translation 2369786339323021771 -->     <string name="permdesc_writeApnSettings" msgid="5333798886412714193">"Дазваляе прыкладанням змяняць налады сеткі, перахапляць і правяраць увесь сеткавы трафік, напрыклад для змены проксі і порта любога APN. Шкоднасныя прыкладанні могуць адсочваць, перанакіроўваць або змяняць сеткавыя пакеты без вашага ведама."</string>
+    <string name="permdesc_writeApnSettings" msgid="5333798886412714193">"Дазваляе прыкладанням змяняць налады сеткі, перахапляць і правяраць увесь сеткавы трафік, напрыклад для змены проксі-сервера і порта любога APN. Шкоднасныя прыкладанні могуць адсочваць, перанакіроўваць або змяняць сеткавыя пакеты без вашага ведама."</string>
     <string name="permlab_changeNetworkState" msgid="958884291454327309">"змяніць падлучэнне да сеткі"</string>
-    <!-- outdated translation 4199958910396387075 -->     <string name="permdesc_changeNetworkState" msgid="6789123912476416214">"Дазваляе прыкладанням змяняць стан сеткавага падключэння."</string>
-    <!-- outdated translation 2702121155761140799 -->     <string name="permlab_changeTetherState" msgid="5952584964373017960">"Змяняць падлучэнне да мадэму"</string>
-    <!-- outdated translation 8905815579146349568 -->     <string name="permdesc_changeTetherState" msgid="1524441344412319780">"Дазваляе прыкладанню змяняць стан прывязанага сеткавага падключэння."</string>
+    <string name="permdesc_changeNetworkState" msgid="6789123912476416214">"Дазваляе прыкладанням змяняць стан сеткавага падключэння."</string>
+    <string name="permlab_changeTetherState" msgid="5952584964373017960">"змяніць прывязку да падлучэння"</string>
+    <string name="permdesc_changeTetherState" msgid="1524441344412319780">"Дазваляе прыкладанням змяняць стан прывязкі да сеткі."</string>
     <string name="permlab_changeBackgroundDataSetting" msgid="1400666012671648741">"змяняць налады выкарыстання фонавых дадзеных"</string>
-    <!-- outdated translation 1001482853266638864 -->     <string name="permdesc_changeBackgroundDataSetting" msgid="5347729578468744379">"Дазваляе прыкладанням мяняць налады фонавай перадачы дадзеных."</string>
+    <string name="permdesc_changeBackgroundDataSetting" msgid="5347729578468744379">"Дазваляе прыкладанням змяняць налады выкарыстання зыходных дадзеных."</string>
     <string name="permlab_accessWifiState" msgid="8100926650211034400">"праглядаць стан Wi-Fi"</string>
-    <!-- outdated translation 485796529139236346 -->     <string name="permdesc_accessWifiState" msgid="7770452658226256831">"Дазваляе прыкладанням праглядаць інфармацыю аб стане Wi-Fi."</string>
+    <string name="permdesc_accessWifiState" msgid="7770452658226256831">"Дазваляе прыкладанням праглядаць інфармацыю аб стане Wi-Fi."</string>
     <string name="permlab_changeWifiState" msgid="7280632711057112137">"змяняць стан Wi-Fi"</string>
-    <!-- outdated translation 2950383153656873267 -->     <string name="permdesc_changeWifiState" msgid="7399961004537946240">"Дазваляе прыкладанням падключацца да кропак доступу Wi-Fi і адключацца ад іх, а таксама ўносіць змены ў наладжаныя сеткі Wi-Fi."</string>
+    <string name="permdesc_changeWifiState" msgid="7399961004537946240">"Дазваляе прыкладанням падлучацца і адключацца ад кропак доступу Wi-Fi і ўносіць змяненні ў наладжаныя сеткі Wi-Fi."</string>
     <string name="permlab_changeWifiMulticastState" msgid="1368253871483254784">"дазваляе прыём Wi-Fi Multicast"</string>
-    <!-- outdated translation 8199464507656067553 -->     <string name="permdesc_changeWifiMulticastState" msgid="7633598524564320817">"Дазваляе прыкладанням атрымліваць пакеты, не напраўленыя непасрэдна на прыладу. Гэта можа быць карысна пры выяўленні блізкіх паслуг. Гэта выкарыстоўвае больш магутнасцяў, чым рэжым нешматадрасных перадач."</string>
-    <!-- outdated translation 1092209628459341292 -->     <string name="permlab_bluetoothAdmin" msgid="3606576270792236062">"кіраванне bluetooth"</string>
-    <!-- outdated translation 3511795757324345837 -->     <string name="permdesc_bluetoothAdmin" product="tablet" msgid="6921177471748882137">"Дазваляе прыкладанню наладжваць лакальны планшэт Bluetooth, а таксама вызначаць і падключацца да выдаленых прылад."</string>
-    <!-- outdated translation 3511795757324345837 -->     <string name="permdesc_bluetoothAdmin" product="default" msgid="8931682159331542137">"Дазваляе прыкладанню наладжваць лакальны планшэт Bluetooth, а таксама вызначаць і падключацца да выдаленых прылад."</string>
+    <string name="permdesc_changeWifiMulticastState" msgid="7633598524564320817">"Дазваляе прыкладаннямм атрымліваць пакеты, якія не былі адрасаваня непасрэдна вашай прыладзе. Гэта можа быць карысна пры выяўленні службаў, даступных побач. У гэтым рэжыме выкарыстоўваецца больш энергіі, чым у рэжыме аднаадраснай перадачы."</string>
+    <string name="permlab_bluetoothAdmin" msgid="3606576270792236062">"адмiнiстраванне Bluetooth"</string>
+    <string name="permdesc_bluetoothAdmin" product="tablet" msgid="6921177471748882137">"Дазваляе прыкладанням наладжваць лакальны планшэт Bluetooth, выяўляць і падлучаць выдаленыя прылады."</string>
+    <string name="permdesc_bluetoothAdmin" product="default" msgid="8931682159331542137">"Дазваляе прыкладанням наладжваць лакальны тэлефон Bluetooth, а таксама знаходзіць выдаленыя прылады i падлучацца да ix."</string>
+    <string name="permlab_accessWimaxState" msgid="1232061307208861588">"Прагляд стану WiMAX"</string>
+    <string name="permdesc_accessWimaxState" msgid="5914958077555177749">"Дазваляе прыкладанням праглядаць інфармацыю пра стан WiMAX."</string>
+    <string name="permlab_changeWimaxState" msgid="2405042267131496579">"Змяніць стан WiMAX"</string>
+    <string name="permdesc_changeWimaxState" msgid="3328853825006455912">"Дазваляе прыкладанням падключацца і адключацца ад сеткі WiMAX."</string>
     <string name="permlab_bluetooth" msgid="8361038707857018732">"ствараць злучэнні Bluetooth"</string>
-    <!-- outdated translation 4191941825910543803 -->     <string name="permdesc_bluetooth" product="tablet" msgid="7007851048416363446">"Дазваляе прыкладанню праглядаць канфігурацыю лакальнага планшэта Bluetooth, а таксама ствараць і прымаць падключэнні да спалучаных прылад."</string>
-    <!-- outdated translation 4191941825910543803 -->     <string name="permdesc_bluetooth" product="default" msgid="31846362767164948">"Дазваляе прыкладанню праглядаць канфігурацыю лакальнага планшэта Bluetooth, а таксама ствараць і прымаць падключэнні да спалучаных прылад."</string>
+    <string name="permdesc_bluetooth" product="tablet" msgid="7007851048416363446">"Дазваляе прыкладанню праглядаць канфігурацыю лакальнага планшэту Bluetooth, а таксама здзяйсняць і прымаць злучэнні са спалучанымі прыладамі."</string>
+    <string name="permdesc_bluetooth" product="default" msgid="31846362767164948">"Дазваляе прыкладанню праглядаць канфігурацыю лакальнага тэлефона Bluetooth, а таксама здзяйсняць і прымаць злучэнні са спалучанымі прыладамі."</string>
     <string name="permlab_nfc" msgid="4423351274757876953">"кантроль Near Field Communication"</string>
-    <!-- outdated translation 9171401851954407226 -->     <string name="permdesc_nfc" msgid="7120611819401789907">"Дазваляе прыкладанню звязвацца з тэгамі, карткамі і чытачамі Near Field Communication (NFC)."</string>
+    <string name="permdesc_nfc" msgid="7120611819401789907">"Дазваляе прыкладаннzv спалучацца з тэгамі, картамі і счытваючымі прыладамі Near Field Communication (NFC)."</string>
     <string name="permlab_disableKeyguard" msgid="4977406164311535092">"адключаць блакаванне клавіятуры"</string>
-    <!-- outdated translation 3189763479326302017 -->     <string name="permdesc_disableKeyguard" msgid="6231611286892232626">"Дазваляе прыкладанням адключаць блакіроўку клавіятуры і абарону паролем. Добры прыклад гэтага — адключэнне блакіроўкі тэлефона пры атрыманні ўваходнага выкліка тэлефона, паўторнае ўключэнне блакіроўкі клавіятуры, калі выклік завершаны."</string>
+    <string name="permdesc_disableKeyguard" msgid="6231611286892232626">"Дазваляе прыкладанням адключаць блакаванне клавіятуры і любыя сродкі абароны, звязаныя з паролем. Прыкладам гэтага з\'яўляецца адключэнне тэлефонам блакавання клавіятуры пры атрыманні ўваходнага выкліку і паўторнае ўключэнне блакавання клавіятуры, калі выклік завершаны."</string>
     <string name="permlab_readSyncSettings" msgid="6201810008230503052">"чытаць параметры сінхранізацыі"</string>
-    <!-- outdated translation 5315925706353341823 -->     <string name="permdesc_readSyncSettings" msgid="5464056785274229278">"Дазваляе прыкладанням счытваць налады сінхранізацыі (напрыклад, ці ўключана сінхранізацыя для кантактаў)."</string>
+    <string name="permdesc_readSyncSettings" msgid="5464056785274229278">"Дазваляе прыкладанням змяняць налады сінхранізацыі, напрыклад, ці будзе сінхранізацыя ўключана для прыкладання People."</string>
     <string name="permlab_writeSyncSettings" msgid="6297138566442486462">"запісваць параметры сінхранізацыі"</string>
-    <!-- outdated translation 2498201614431360044 -->     <string name="permdesc_writeSyncSettings" msgid="1466056564502117130">"Дазваляе прыкладанням мяняць налады сінхранізацыі, напрыклад дазвол сінхранізацыі для Кантактаў."</string>
+    <string name="permdesc_writeSyncSettings" msgid="1466056564502117130">"Дазваляе прыкладанню змяняць налады сінхранізацыі, напрыклад, ці будзе сінхранізацыя ўключана для прыкладання People."</string>
     <string name="permlab_readSyncStats" msgid="7396577451360202448">"чытаць статыстыку сінхранізацыі"</string>
-    <!-- outdated translation 7511448343374465000 -->     <string name="permdesc_readSyncStats" msgid="3801971839939951678">"Дазваляе прыкладанням счытваць статыстыку сінхранізацыі, напрыклад гісторыю здзейсненых сінхранізацый."</string>
+    <string name="permdesc_readSyncStats" msgid="3801971839939951678">"Дазваляе прыкладанню счытваць статыстыку сінхранізацыі, напрыклад гісторыю здзейсненых сінхранізацый."</string>
     <string name="permlab_subscribedFeedsRead" msgid="4756609637053353318">"чытаць падпісаныя каналы"</string>
-    <!-- outdated translation 3622200625634207660 -->     <string name="permdesc_subscribedFeedsRead" msgid="5557058907906144505">"Дазваляе прыкладанням атрымліваць інфармацыю аб сінхранізацыі бягучых каналаў."</string>
+    <string name="permdesc_subscribedFeedsRead" msgid="5557058907906144505">"Дазваляе прыкладанням атрымліваць інфармацыю пра каналы, якія сінхранізуюцца ў бягучы момант."</string>
     <string name="permlab_subscribedFeedsWrite" msgid="9015246325408209296">"запісваць каналы, на якія ёсць падпіска"</string>
-    <!-- outdated translation 8121607099326533878 -->     <string name="permdesc_subscribedFeedsWrite" msgid="6928930188826089413">"Дазваляе прыкладанням змяняць бягучыя сінхранізуемыя каналы. Гэта можа дазволіць шкоднасным прыкладанням змяняць сінхранізаваныя каналы."</string>
-    <!-- outdated translation 432535716804748781 -->     <string name="permlab_readDictionary" msgid="8410247960433376352">"чытаць карыстальніцкі слоўнік"</string>
-    <!-- outdated translation 1082972603576360690 -->     <string name="permdesc_readDictionary" msgid="8977815988329283705">"Дазваляе прыкладанням счытваць любыя прыватныя словы, імёны і фразы, якія карыстальнік можа захоўваць у карыстальніцкім слоўніку."</string>
-    <!-- outdated translation 6703109511836343341 -->     <string name="permlab_writeDictionary" msgid="2296383164914812772">"пісаць у карыстальніцкі слоўнік"</string>
-    <!-- outdated translation 2241256206524082880 -->     <string name="permdesc_writeDictionary" msgid="8185385716255065291">"Дазваляе прыкладанням запісваць новыя словы ў слоўнік карыстальніка."</string>
+    <string name="permdesc_subscribedFeedsWrite" msgid="6928930188826089413">"Дазваляе прыкладанням змяняць бягучыя каналы сінхранізавання. Шкоднасныя прыкладанні могуць змяняць вашы каналы сінхранізацыi."</string>
+    <string name="permlab_readDictionary" msgid="8410247960433376352">"чытаць карыстальніцкі слоўнік"</string>
+    <string name="permdesc_readDictionary" msgid="8977815988329283705">"Дазваляе прыкладанню счытваць любыя прыватныя словы, імёны і фразы, якія карыстальнік можа захоўваць у карыстальніцкім слоўніку."</string>
+    <string name="permlab_writeDictionary" msgid="2296383164914812772">"запісаць у карыстальніцкі слоўнік"</string>
+    <string name="permdesc_writeDictionary" msgid="8185385716255065291">"Дазваляе прыкладанням запісваць новыя словы ў карыстальніцкі слоўнік."</string>
     <string name="permlab_sdcardWrite" product="nosdcard" msgid="85430876310764752">"змяніць/выдаліць змесціва USB-назапашвальнiка"</string>
     <string name="permlab_sdcardWrite" product="default" msgid="8079403759001777291">"змяняць/выдаляць змесціва SD-карты"</string>
-    <!-- outdated translation 6594393334785738252 -->     <string name="permdesc_sdcardWrite" product="nosdcard" msgid="6175406299445710888">"Дазваляе прыкладанню запісваць дадзеныя на USB-назапашвальнiк."</string>
-    <!-- outdated translation 6594393334785738252 -->     <string name="permdesc_sdcardWrite" product="default" msgid="4337417790936632090">"Дазваляе прыкладанню запісваць дадзеныя на USB-назапашвальнiк."</string>
+    <string name="permdesc_sdcardWrite" product="nosdcard" msgid="6175406299445710888">"Дазваляе прыкладаням выконваць запіс ва USB-назапашвальнік."</string>
+    <string name="permdesc_sdcardWrite" product="default" msgid="4337417790936632090">"Дазваляе прыкладанням запісваць на SD-карту."</string>
     <string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"змяніць/выдаліць унутраныя носьбіты змесціва"</string>
-    <!-- outdated translation 8232008512478316233 -->     <string name="permdesc_mediaStorageWrite" product="default" msgid="8189160597698529185">"Дазваляе прыкладанням змяняць змесціва ўнутранага сховішча інфармацыі."</string>
+    <string name="permdesc_mediaStorageWrite" product="default" msgid="8189160597698529185">"Дазваляе прыкладанням змяняць змесціва ўнутранай памяці."</string>
     <string name="permlab_cache_filesystem" msgid="5656487264819669824">"доступ да файлавай сістэмы кэша"</string>
-    <!-- outdated translation 1624734528435659906 -->     <string name="permdesc_cache_filesystem" msgid="5578967642265550955">"Дазваляе прыкладанням чытаць і запісваць дадзеныя ў файлавую сістэму кэша."</string>
+    <string name="permdesc_cache_filesystem" msgid="5578967642265550955">"Дазваляе прыкладанню счытваць і выконваць запіс у файлавую сістэму кэш-памяці."</string>
     <string name="permlab_use_sip" msgid="5986952362795870502">"рабіць/прымаць iнтэрнэт-выклікі"</string>
-    <!-- outdated translation 6320376185606661843 -->     <string name="permdesc_use_sip" msgid="4717632000062674294">"Дазваляе прыкладанню выкарыстоўваць службу SIP, каб рабіць/прымаць iнтэрнэт-выклікі."</string>
+    <string name="permdesc_use_sip" msgid="4717632000062674294">"Дазваляе прыкладанням выкарыстоўваць службу SIP, каб прымаць/рабіць Інтэрнэт-выклікі."</string>
     <string name="permlab_readNetworkUsageHistory" msgid="7862593283611493232">"чытаць дадзеныя выкарыстання сеткі"</string>
-    <!-- outdated translation 6040738474779135653 -->     <string name="permdesc_readNetworkUsageHistory" msgid="7689060749819126472">"Дазваляе прыкладанням чытаць дадзеныя дзённiка выкарыстання для пэўных сетак і прыкладанняў."</string>
+    <string name="permdesc_readNetworkUsageHistory" msgid="7689060749819126472">"Дазваляе прыкладанню счытваць дадзеныя аб гісторыі выкарыстання сеткі для пэўных сетак і прыкладанняў."</string>
     <string name="permlab_manageNetworkPolicy" msgid="2562053592339859990">"кіраванне палітыкай сеткі"</string>
-    <!-- outdated translation 3723795285132803958 -->     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Дазваляе прыкладанням кіраваць сеткавымі палітыкамі і вызначаць правілы для прыкладанняў."</string>
+    <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Дазваляе прыкладаннм кіраваць сеткавымі палітыкамі і вызначаць правілы пэўных прыкладанняў."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"змяніць улік выкарыстання сеткі"</string>
-    <!-- outdated translation 8702285686629184404 -->     <string name="permdesc_modifyNetworkAccounting" msgid="8553240749784321765">"Дазваляе мадыфікаваць улік выкарыстання сеткі прыкладаннямі. Не для выкарыстання звычайнымі прыкладаннямі."</string>
+    <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Дазваляе прыкладанням змяняць метад уліку выкарыстання сеткі прыкладаннямі. Не для выкарыстання звычайнымі прыкладаннямі."</string>
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Устанавіць правілы паролю"</string>
-    <string name="policydesc_limitPassword" msgid="9083400080861728056">"Кіраванне даўжынёй і колькасцю знакаў на экране разблакоўкі пароляў"</string>
+    <string name="policydesc_limitPassword" msgid="3252114203919510394">"Кіраванне даўжынёй і колькасцю знакаў у паролі разблакоўкі экрана."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Сачыць за спробамі разблакоўкі экрана"</string>
-    <!-- outdated translation 933601759466308092 -->     <string name="policydesc_watchLogin" product="tablet" msgid="3215729294215070072">"Сачыць за колькасцю няправільных спроб уводу пароляў пры разблакоўцы экрана і блакаваць планшэт або сціраць ўсе дадзеныя на планшэце, калі ўводзіцца занадта шмат няправільных пароляў"</string>
-    <!-- outdated translation 933601759466308092 -->     <string name="policydesc_watchLogin" product="default" msgid="5712323091846761073">"Сачыць за колькасцю няправільных спроб уводу пароляў пры разблакоўцы экрана і блакаваць планшэт або сціраць ўсе дадзеныя на планшэце, калі ўводзіцца занадта шмат няправільных пароляў"</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="5391240616981297361">"Змяненне паролю разблакоўкі экрана"</string>
+    <string name="policydesc_resetPassword" msgid="605963962301904458">"Змяніць пароль разблакоўкі экрана."</string>
     <string name="policylab_forceLock" msgid="2274085384704248431">"Заблакаваць экран"</string>
-    <string name="policydesc_forceLock" msgid="5696964126226028442">"Кіраванне часам і спосабам блакоўкі экрана"</string>
+    <string name="policydesc_forceLock" msgid="1141797588403827138">"Кіраванне часам і спосабам блакавання экрана"</string>
     <string name="policylab_wipeData" msgid="3910545446758639713">"Сцерці ўсе дадзеныя"</string>
-    <string name="policydesc_wipeData" product="tablet" msgid="314455232799486222">"Сцерці дадзеныя планшэта без папярэджання, выканаўшы скід налад дадзеных"</string>
-    <string name="policydesc_wipeData" product="default" msgid="7669895333814222586">"Сцерці дадзеныя тэлефона без папярэджання, выканаўшы скід налад дадзеных"</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">"Усталяваць глабальны проксі-cервер прылады, які будзе выкарыстоўвацца, калі палітыка актыўная. Толькі першы адміністратар прылады ўсталёўвае эфектыўныя глабальныя проксі-серверы."</string>
     <string name="policylab_expirePassword" msgid="885279151847254056">"Нал. тэрм. дз. пар. блак. экр."</string>
-    <string name="policydesc_expirePassword" msgid="4844430354224822074">"Кантраляваць, як часта трэба мяняць пароль для блакавання экрана"</string>
+    <string name="policydesc_expirePassword" msgid="1729725226314691591">"Кіраваць частатой змены паролю для блакавання экрана."</string>
     <string name="policylab_encryptedStorage" msgid="8901326199909132915">"Усталяваць шыфраванне сховішча."</string>
-    <!-- outdated translation 2504984732631479399 -->     <string name="policydesc_encryptedStorage" msgid="8877192718681120469">"Патрабаваць шыфраванне захаваных дадзеных прыкладання"</string>
+    <string name="policydesc_encryptedStorage" msgid="2637732115325316992">"Запыт на шыфраванне захаваных дадзеных прыкладанняў."</string>
     <string name="policylab_disableCamera" msgid="6395301023152297826">"Адключыць камеры"</string>
-    <string name="policydesc_disableCamera" msgid="5680054212889413366">"Забарона выкарыстання ўсіх камер прылады"</string>
+    <string name="policydesc_disableCamera" msgid="2306349042834754597">"Забараніць выкарыстанне ўсіх камер прылады."</string>
   <string-array name="phoneTypes">
     <item msgid="8901098336658710359">"Галоўная старонка"</item>
     <item msgid="869923650527136615">"Мабільны"</item>
@@ -635,14 +644,14 @@
     <string name="sipAddressTypeHome" msgid="6093598181069359295">"Галоўная старонка"</string>
     <string name="sipAddressTypeWork" msgid="6920725730797099047">"Працоўны"</string>
     <string name="sipAddressTypeOther" msgid="4408436162950119849">"Іншае"</string>
-    <!-- outdated translation 3731488827218876115 -->     <string name="keyguard_password_enter_pin_code" msgid="3037685796058495017">"Увядзіце PIN-код"</string>
-    <!-- outdated translation 5965173481572346878 -->     <string name="keyguard_password_enter_puk_code" msgid="4800725266925845333">"Увядзіце PUK і новы PIN-код"</string>
+    <string name="keyguard_password_enter_pin_code" msgid="3037685796058495017">"Увядзіце PIN-код"</string>
+    <string name="keyguard_password_enter_puk_code" msgid="4800725266925845333">"Увядзіце PUK-код і новы PIN-код"</string>
     <string name="keyguard_password_enter_puk_prompt" msgid="1341112146710087048">"PUK"</string>
-    <!-- outdated translation 2987350144349051286 -->     <string name="keyguard_password_enter_pin_prompt" msgid="8027680321614196258">"Новы PIN-код"</string>
-    <!-- outdated translation 7906561917570259833 -->     <string name="keyguard_password_entry_touch_hint" msgid="7858547464982981384"><font size="17">"Дакраніцеся, каб увесці пароль"</font></string>
-    <!-- outdated translation 9138158344813213754 -->     <string name="keyguard_password_enter_password_code" msgid="1054721668279049780">"Увядзіце пароль для разблакавання"</string>
-    <!-- outdated translation 638347075625491514 -->     <string name="keyguard_password_enter_pin_password_code" msgid="6391755146112503443">"Увядзіце PIN-код для разблакоўкі"</string>
-    <string name="keyguard_password_wrong_pin_code" msgid="1295984114338107718">"Няправільны PIN-код"</string>
+    <string name="keyguard_password_enter_pin_prompt" msgid="8027680321614196258">"Новы PIN-код"</string>
+    <string name="keyguard_password_entry_touch_hint" msgid="7858547464982981384"><font size="17">"Дакраніцеся, каб увесці пароль"</font></string>
+    <string name="keyguard_password_enter_password_code" msgid="1054721668279049780">"Увядзіце пароль для разблакавання"</string>
+    <string name="keyguard_password_enter_pin_password_code" msgid="6391755146112503443">"Каб разблакаваць, увядзіце PIN-код"</string>
+    <string name="keyguard_password_wrong_pin_code" msgid="2422225591006134936">"Няправільны PIN-код."</string>
     <string name="keyguard_label_text" msgid="861796461028298424">"Каб разблакаваць, націсніце \"Меню\", затым 0."</string>
     <string name="emergency_call_dialog_number_for_display" msgid="696192103195090970">"Нумар экстранай службы"</string>
     <string name="lockscreen_carrier_default" msgid="8963839242565653192">"Не абслугоўваецца"</string>
@@ -653,8 +662,9 @@
     <string name="lockscreen_emergency_call" msgid="5347633784401285225">"Экстраны выклік"</string>
     <string name="lockscreen_return_to_call" msgid="5244259785500040021">"Вярнуцца да выкліку"</string>
     <string name="lockscreen_pattern_correct" msgid="9039008650362261237">"Правільна!"</string>
-    <!-- outdated translation 4817583279053112312 -->     <string name="lockscreen_pattern_wrong" msgid="4317955014948108794">"Паспрабуйце яшчэ раз"</string>
-    <!-- outdated translation 6237443657358168819 -->     <string name="lockscreen_password_wrong" msgid="5737815393253165301">"Паспрабуйце яшчэ раз"</string>
+    <string name="lockscreen_pattern_wrong" msgid="4317955014948108794">"Паспрабуйце яшчэ раз"</string>
+    <string name="lockscreen_password_wrong" msgid="5737815393253165301">"Паўтарыце спробу"</string>
+    <string name="faceunlock_multiple_failures" msgid="754137583022792429">"Перавышана максімальная колькасць спроб разблакоўкі праз Фэйскантроль"</string>
     <string name="lockscreen_plugged_in" msgid="8057762828355572315">"Зарадка, <xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
     <string name="lockscreen_charged" msgid="4938930459620989972">"Зараджаны."</string>
     <string name="lockscreen_battery_short" msgid="3617549178603354656">"<xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
@@ -662,9 +672,9 @@
     <string name="lockscreen_missing_sim_message_short" msgid="7381499217732227295">"Няма SIM-карты."</string>
     <string name="lockscreen_missing_sim_message" product="tablet" msgid="151659196095791474">"Няма SIM-карты ў планшэце."</string>
     <string name="lockscreen_missing_sim_message" product="default" msgid="2186920585695169078">"У тэлефоне няма SIM-карты."</string>
-    <!-- outdated translation 8874620818937719067 -->     <string name="lockscreen_missing_sim_instructions" msgid="5372787138023272615">"Устаўце SIM-карту."</string>
-    <!-- outdated translation 7138450788301444298 -->     <string name="lockscreen_missing_sim_instructions_long" msgid="3526573099019319472">"SIM-карта адсутнічае ці не чытаецца. Устаўце SIM-карту."</string>
-    <!-- outdated translation 1631853574702335453 -->     <string name="lockscreen_permanent_disabled_sim_instructions" msgid="910904643433151371">"Вашая SIM-картка поўнасцю адключаная."\n"Звярніцеся да пастаўшчыка паслуг мабільнай сувязі, каб атрымаць іншую SIM-карту."</string>
+    <string name="lockscreen_missing_sim_instructions" msgid="5372787138023272615">"Усталюйце SIM-карту."</string>
+    <string name="lockscreen_missing_sim_instructions_long" msgid="3526573099019319472">"SIM-карта адсутнічае ці не чытаецца. Устаўце SIM-карту."</string>
+    <string name="lockscreen_permanent_disabled_sim_instructions" msgid="910904643433151371">"Ваша SIM-карта была адключана назаўсёды."\n" Звяжыцеся з аператарам бесправадной сувязі, каб атрымаць іншую SIM-карту."</string>
     <string name="lockscreen_transport_prev_description" msgid="201594905152746886">"Кнопка папярэдняй кампазiцыi"</string>
     <string name="lockscreen_transport_next_description" msgid="6089297650481292363">"Кнопка наступнай кампазiцыi"</string>
     <string name="lockscreen_transport_pause_description" msgid="7659088786780128001">"Кнопка паўзы"</string>
@@ -673,19 +683,14 @@
     <string name="emergency_calls_only" msgid="6733978304386365407">"Толькі экстраныя выклікі"</string>
     <string name="lockscreen_network_locked_message" msgid="143389224986028501">"Сетка заблакаваная"</string>
     <string name="lockscreen_sim_puk_locked_message" msgid="7441797339976230">"SIM-карта заблакавана PUK-кодам."</string>
-    <!-- outdated translation 635967534992394321 -->     <string name="lockscreen_sim_puk_locked_instructions" msgid="8127916255245181063">"Глядзіце Інструкцыю карыстальніка або звяжыцеся са службай падтрымкі."</string>
+    <string name="lockscreen_sim_puk_locked_instructions" msgid="8127916255245181063">"Глядзіце \"Інструкцыю для карыстальніка\" або звяжыцеся са службай тэхнiчнай падтрымкі."</string>
     <string name="lockscreen_sim_locked_message" msgid="8066660129206001039">"SIM-карта заблакаваная."</string>
     <string name="lockscreen_sim_unlock_progress_dialog_message" msgid="595323214052881264">"Разблакаванне SIM-карты..."</string>
-    <!-- no translation found for lockscreen_too_many_failed_attempts_dialog_message (6481623830344107222) -->
-    <skip />
-    <!-- no translation found for lockscreen_too_many_failed_password_attempts_dialog_message (2725973286239344555) -->
-    <skip />
-    <!-- no translation found for lockscreen_too_many_failed_pin_attempts_dialog_message (6216672706545696955) -->
-    <skip />
-    <!-- no translation found for lockscreen_failed_attempts_almost_glogin (9191611984625460820) -->
-    <skip />
-    <!-- no translation found for lockscreen_failed_attempts_almost_glogin (2590227559763762751) -->
-    <skip />
+    <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_pin_attempts_dialog_message" msgid="6216672706545696955">"Вы няправільна ўвялі PIN-код пэўную колькасць разоў: <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>. Пасля яшчэ некалькiх няўдалых спроб (<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>. Пасля яшчэ некалькiх няўдалых спроб (<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">"Вы няправільна спрабавалі разблакаваць планшэт некалькi разоў (<xliff:g id="NUMBER_0">%d</xliff:g>). Пасля яшчэ некалькiх спробаў (<xliff:g id="NUMBER_1">%d</xliff:g>) ён будзе скінуты да заводскіх налад i карыстальнiцкiя дадзеныя будуць згубленыя."</string>
     <string name="lockscreen_failed_attempts_almost_at_wipe" product="default" msgid="8603565142156826565">"Вы няправільна спрабавалі разблакаваць планшэт некалькi разоў (<xliff:g id="NUMBER_0">%d</xliff:g>). Пасля яшчэ некалькiх спробаў (<xliff:g id="NUMBER_1">%d</xliff:g>) ён будзе скінуты да заводскіх налад i карыстальнiцкiя дадзеныя будуць згубленыя."</string>
     <string name="lockscreen_failed_attempts_now_wiping" product="tablet" msgid="280873516493934365">"Вы няправільна спрабавалі разблакаваць планшэт некалькi разоў (<xliff:g id="NUMBER">%d</xliff:g>). Цяпер ён будзе скінуты да заводскіх налад."</string>
@@ -693,14 +698,14 @@
     <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>
     <string name="lockscreen_glogin_forgot_pattern" msgid="2588521501166032747">"Разблакаванне ўліковага запісу"</string>
-    <string name="lockscreen_glogin_too_many_attempts" msgid="2446246026221678244">"Занадта шмат спробаў узору!"</string>
-    <string name="lockscreen_glogin_instructions" msgid="1816635201812207709">"Каб разблакаваць, увайдзіце праз уліковы запіс Google"</string>
+    <string name="lockscreen_glogin_too_many_attempts" msgid="2751368605287288808">"Занадта шмат спроб паўтарыць шаблон!"</string>
+    <string name="lockscreen_glogin_instructions" msgid="3931816256100707784">"Каб разблакаваць, увайдзіце ў свой уліковы запіс Google."</string>
     <string name="lockscreen_glogin_username_hint" msgid="8846881424106484447">"Імя карыстальніка (электронная пошта)"</string>
     <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="8253152905532900548">"Забыліся на імя карыстальніка або пароль?"\n"Наведайце"<b>"google.com/accounts/recovery"</b></string>
-    <string name="lockscreen_glogin_checking_password" msgid="6758890536332363322">"Праверка..."</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>
     <string name="lockscreen_sound_off_label" msgid="996822825154319026">"Гук выключаны"</string>
@@ -717,14 +722,13 @@
     <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="js_dialog_title" msgid="8143918455087008109">"Старонка з адрасам \"<xliff:g id="TITLE">%s</xliff:g>\" кажа:"</string>
+    <string name="js_dialog_title" msgid="1987483977834603872">"На старонцы з адрасам <xliff:g id="TITLE">%s</xliff:g> вызначана:"</string>
     <string name="js_dialog_title_default" msgid="6961903213729667573">"JavaScript"</string>
-    <!-- no translation found for js_dialog_before_unload (730366588032430474) -->
-    <skip />
+    <string name="js_dialog_before_unload" msgid="730366588032430474">"Пакiнуць гэту старонку?"\n\n"<xliff:g id="MESSAGE">%s</xliff:g>"\n\n"Націсніце \"OK\", каб працягнуць, або \"Адмена\", каб застацца на бягучай старонцы."</string>
     <string name="save_password_label" msgid="6860261758665825069">"Пацвердзіць"</string>
-    <!-- outdated translation 1068216937244567247 -->     <string name="double_tap_toast" msgid="2729045387923870404">"Падказка: націсніце двойчы, каб павялічыць або паменшыць."</string>
-    <string name="autofill_this_form" msgid="1272247532604569872">"Аўтазапаўненне"</string>
-    <string name="setup_autofill" msgid="8154593408885654044">"Усталёўка аўтазапаўнення"</string>
+    <string name="double_tap_toast" msgid="4595046515400268881">"Падказка: двойчы націсніце, каб павялічыць або паменшыць."</string>
+    <string name="autofill_this_form" msgid="4616758841157816676">"Аўтазапаўненне"</string>
+    <string name="setup_autofill" msgid="7103495070180590814">"Усталяванне аўтазапаўнення"</string>
     <string name="autofill_address_name_separator" msgid="2504700673286691795">" "</string>
     <string name="autofill_address_summary_name_format" msgid="3268041054899214945">"$1$2$3"</string>
     <string name="autofill_address_summary_separator" msgid="7483307893170324129">", "</string>
@@ -742,25 +746,25 @@
     <string name="autofill_area" msgid="3547409050889952423">"Плошча"</string>
     <string name="autofill_emirate" msgid="2893880978835698818">"Эмірат"</string>
     <string name="permlab_readHistoryBookmarks" msgid="1284843728203412135">"чытаць гісторыю браўзэра і закладак"</string>
-    <!-- outdated translation 4981489815467617191 -->     <string name="permdesc_readHistoryBookmarks" msgid="4577476392604595921">"Дазваляе прыкладанням счытваць усе URL, якія наведвалiся з браўзэра, а таксама ўсе закладкi."</string>
+    <string name="permdesc_readHistoryBookmarks" msgid="4577476392604595921">"Дазваляе прыкладанням счытваць усе URL, якія наведвалiся з браўзэра, а таксама ўсе закладкi браўзэра."</string>
     <string name="permlab_writeHistoryBookmarks" msgid="9009434109836280374">"пісаць гісторыю браўзэра і закладак"</string>
-    <!-- outdated translation 7193514090469945307 -->     <string name="permdesc_writeHistoryBookmarks" product="tablet" msgid="1757103804824209530">"Дазваляе прыкладанням змяняць гісторыю браўзэра або закладкі, якія захоўваюцца на планшэце. Шкоднасныя прыкладанні могуць выкарыстоўваць гэтую магчымасць, каб выдаляць або змяняць дадзеныя вашага браўзэра."</string>
-    <!-- outdated translation 7193514090469945307 -->     <string name="permdesc_writeHistoryBookmarks" product="default" msgid="6693764355720719197">"Дазваляе прыкладанням змяняць гісторыю браўзэра або закладкі, якія захоўваюцца на планшэце. Шкоднасныя прыкладанні могуць выкарыстоўваць гэтую магчымасць, каб выдаляць або змяняць дадзеныя вашага браўзэра."</string>
+    <string name="permdesc_writeHistoryBookmarks" product="tablet" msgid="1757103804824209530">"Дазваляе прыкладанням змяняць гісторыю браўзэра або закладкі, якія захоўваюцца на планшэце. Шкоднасныя прыкладанні могуць выкарыстоўваць гэту магчымасць для выдалення або змены дадзеных вашага браўзэра."</string>
+    <string name="permdesc_writeHistoryBookmarks" product="default" msgid="6693764355720719197">"Дазваляе прыкладанням змяняць гісторыю браўзэра або закладак, захаваных у тэлефоне. Шкоднасныя прыкладанні могуць выкарыстоўваць гэту магчымасць для выдалення або змены дадзеных вашага браўзэра."</string>
     <string name="permlab_setAlarm" msgid="5924401328803615165">"Усталяваць сігнал у будзільніку"</string>
-    <!-- outdated translation 5966966598149875082 -->     <string name="permdesc_setAlarm" msgid="316392039157473848">"Дазваляе прыкладанням задаваць сігнал усталяванага прыкладання будзільніка. Пэўныя прыкладанні будзільніка не могуць рэалізаваць гэтую функцыю."</string>
+    <string name="permdesc_setAlarm" msgid="316392039157473848">"Дазваляе прыкладанню ўсталёўваць сігнал на ўсталяваным прыкладанні будзільніка. Пэўныя прыкладанні будзільніка не могуць рэалізоўваць гэтую магчымасць."</string>
     <string name="permlab_addVoicemail" msgid="5525660026090959044">"дадаць галасавое паведамленне"</string>
-    <!-- outdated translation 4828507394878206682 -->     <string name="permdesc_addVoicemail" msgid="6604508651428252437">"Дазваляе праграме дадаваць паведамленні ў паштовую скрыню галасавых паведамленняў."</string>
-    <!-- outdated translation 4715212655598275532 -->     <string name="permlab_writeGeolocationPermissions" msgid="5962224158955273932">"Змяніць дазволы геапазіцыянавання для браўзэра"</string>
-    <!-- outdated translation 4011908282980861679 -->     <string name="permdesc_writeGeolocationPermissions" msgid="1083743234522638747">"Дазваляе прыкладанням змяняць дазволы геалакацыі браўзэра. Шкодныя прыкладанні могуць карыстацца гэтым, каб дазваляць адпраўку інфармацыі аб месцазнаходжанні адвольным вэб-сайтам."</string>
+    <string name="permdesc_addVoicemail" msgid="6604508651428252437">"Дазваляе прыкладанням дадаваць паведамленні ў вашу скрыню галасавой пошты."</string>
+    <string name="permlab_writeGeolocationPermissions" msgid="5962224158955273932">"змяніць дазволы геапазіцыянавання для браўзэра"</string>
+    <string name="permdesc_writeGeolocationPermissions" msgid="1083743234522638747">"Дазваляе прыкладанням змяняць дазволы геалакацыі браўзэра. Шкоднасныя прыкладанні могуць выкарыстоўваць гэта, каб дазваляць адпраўку інфармацыі аб месцазнаходжанні выпадковым вэб-сайтам."</string>
     <string name="permlab_packageVerificationAgent" msgid="5568139100645829117">"верыфікаваць пакеты"</string>
-    <!-- outdated translation 6033195477325381106 -->     <string name="permdesc_packageVerificationAgent" msgid="8437590190990843381">"Дазваляе прыкладанням правяраць магчымасць усталёўкі пакету."</string>
+    <string name="permdesc_packageVerificationAgent" msgid="8437590190990843381">"Дазваляе прыкладанням правяраць магчымасць усталявання пакету."</string>
     <string name="permlab_bindPackageVerifier" msgid="4187786793360326654">"прывязаць да верыфікатару пакету"</string>
-    <!-- outdated translation 2409521927385789318 -->     <string name="permdesc_bindPackageVerifier" msgid="3180741773233862126">"Дазваляе ўладальніку рабіць запыты верыфікатараў пакету. Не патрабуецца для звычайных прыкладанняў."</string>
+    <string name="permdesc_bindPackageVerifier" msgid="3180741773233862126">"Дазваляе ўладальніку рабіць запыты верыфікатараў пакету. Не патрабуецца для звычайных прыкладанняў."</string>
     <string name="save_password_message" msgid="767344687139195790">"Вы хочаце, каб браўзэр запомніў гэты пароль?"</string>
     <string name="save_password_notnow" msgid="6389675316706699758">"Не цяпер"</string>
     <string name="save_password_remember" msgid="6491879678996749466">"Запомніць"</string>
     <string name="save_password_never" msgid="8274330296785855105">"Ніколі"</string>
-    <!-- outdated translation 5661861460947222274 -->     <string name="open_permission_deny" msgid="7374036708316629800">"У вас няма дазволу адкрываць гэтую старонку."</string>
+    <string name="open_permission_deny" msgid="7374036708316629800">"У вас няма дазволу на адкрыццё гэтай старонкі."</string>
     <string name="text_copied" msgid="4985729524670131385">"Тэкст скапіяваны ў буфер абмену."</string>
     <string name="more_item_label" msgid="4650918923083320495">"Больш"</string>
     <string name="prepend_shortcut_label" msgid="2572214461676015642">"Меню+"</string>
@@ -859,9 +863,9 @@
     <string name="weeks" msgid="6509623834583944518">"тыд."</string>
     <string name="year" msgid="4001118221013892076">"год"</string>
     <string name="years" msgid="6881577717993213522">"г."</string>
-    <!-- outdated translation 3359437293118172396 -->     <string name="VideoView_error_title" msgid="5927895235831021723">"Немагчыма прайграць відэа"</string>
-    <!-- outdated translation 897920883624437033 -->     <string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Гэтае відэа не падыходзіць для патокавай перадачы на ​​гэтую прыладу."</string>
-    <!-- outdated translation 710301040038083944 -->     <string name="VideoView_error_text_unknown" msgid="4309847331399592194">"На жаль, гэтае відэа не можа быць прайграна."</string>
+    <string name="VideoView_error_title" msgid="3534509135438353077">"Праблема з відэа"</string>
+    <string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Відэа не падыходзіць для патокавай перадачы на ​​гэту прыладу."</string>
+    <string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Немагчыма прайграць гэта відэа."</string>
     <string name="VideoView_error_button" msgid="2822238215100679592">"ОК"</string>
     <string name="relative_time" msgid="1818557177829411417">"<xliff:g id="DATE">%1$s</xliff:g>, <xliff:g id="TIME">%2$s</xliff:g>"</string>
     <string name="noon" msgid="7245353528818587908">"апоўдні"</string>
@@ -877,7 +881,7 @@
     <string name="replace" msgid="5781686059063148930">"Замяніць..."</string>
     <string name="delete" msgid="6098684844021697789">"Выдаліць"</string>
     <string name="copyUrl" msgid="2538211579596067402">"Скапіяваць URL"</string>
-    <!-- outdated translation 6738556348861347240 -->     <string name="selectTextMode" msgid="1018691815143165326">"Вылучыць тэкст..."</string>
+    <string name="selectTextMode" msgid="1018691815143165326">"Выбраць тэкст"</string>
     <string name="textSelectionCABTitle" msgid="5236850394370820357">"Вылучэнне тэксту"</string>
     <string name="addToDictionary" msgid="9090375111134433012">"дадаць у слоўнік"</string>
     <string name="deleteText" msgid="7070985395199629156">"выдаліць"</string>
@@ -891,57 +895,52 @@
     <string name="yes" msgid="5362982303337969312">"ОК"</string>
     <string name="no" msgid="5141531044935541497">"Адмяніць"</string>
     <string name="dialog_alert_title" msgid="2049658708609043103">"Увага"</string>
-    <!-- outdated translation 1760724998928255250 -->     <string name="loading" msgid="7933681260296021180">"Загрузка..."</string>
+    <string name="loading" msgid="7933681260296021180">"Загрузка..."</string>
     <string name="capital_on" msgid="1544682755514494298">"Уключыць"</string>
     <string name="capital_off" msgid="6815870386972805832">"Адключана"</string>
     <string name="whichApplication" msgid="4533185947064773386">"Завяршыць дзеянне з дапамогай"</string>
     <string name="alwaysUse" msgid="4583018368000610438">"Выкарыстоўваць па змаўчанні для гэтага дзеяння."</string>
-    <!-- outdated translation 4815455344600932173 -->     <string name="clearDefaultHintMsg" msgid="3252584689512077257">"Ачысціць налады па змаўчанні ў меню \"Налады &gt; Прыкладанні &gt; Кіраванне прыкладаннямі."</string>
-    <string name="chooseActivity" msgid="1009246475582238425">"Выберыце дзеянне."</string>
-    <!-- outdated translation 7892597146032121735 -->     <string name="chooseUsbActivity" msgid="6894748416073583509">"Выберыце праграму для USB-прылады"</string>
-    <!-- outdated translation 1691104391758345586 -->     <string name="noApplications" msgid="2991814273936504689">"Ніякае прыкладанне не можа выканаць гэтае дзеянне."</string>
+    <string name="clearDefaultHintMsg" msgid="3252584689512077257">"Ачысціць па змаўчанні ў раздзеле \"Налады сістэмы &gt; Прыкладанні &gt; Спампаваныя\"."</string>
+    <string name="chooseActivity" msgid="7486876147751803333">"Выберыце дзеянне"</string>
+    <string name="chooseUsbActivity" msgid="6894748416073583509">"Выберыце прыкладанне для USB-прылады"</string>
+    <string name="noApplications" msgid="2991814273936504689">"Няма прыкладанняў, якія могуць выконваць гэты працэс."</string>
     <string name="aerr_title" msgid="1905800560317137752"></string>
     <string name="aerr_application" msgid="932628488013092776">"На жаль, прыкладанне <xliff:g id="APPLICATION">%1$s</xliff:g> спынілася."</string>
     <string name="aerr_process" msgid="4507058997035697579">"На жаль, працэс <xliff:g id="PROCESS">%1$s</xliff:g> спыніўся."</string>
     <string name="anr_title" msgid="4351948481459135709"></string>
-    <!-- no translation found for anr_activity_application (1904477189057199066) -->
-    <skip />
-    <!-- no translation found for anr_activity_process (5776209883299089767) -->
-    <skip />
-    <!-- no translation found for anr_application_process (8941757607340481057) -->
-    <skip />
-    <!-- no translation found for anr_process (6513209874880517125) -->
-    <skip />
+    <string name="anr_activity_application" msgid="1904477189057199066">"Прыкладанне <xliff:g id="APPLICATION">%2$s</xliff:g> не адказвае."\n\n"Закрыць яго?"</string>
+    <string name="anr_activity_process" msgid="5776209883299089767">"Працэс <xliff:g id="ACTIVITY">%1$s</xliff:g> не адказвае."\n\n"Закрыць яго?"</string>
+    <string name="anr_application_process" msgid="8941757607340481057">"Прыкладанне <xliff:g id="APPLICATION">%1$s</xliff:g> не адказвае. Закрыць яго?"</string>
+    <string name="anr_process" msgid="6513209874880517125">"Працэс <xliff:g id="PROCESS">%1$s</xliff:g> не адказвае."\n\n"Закрыць яго?"</string>
     <string name="force_close" msgid="8346072094521265605">"ОК"</string>
     <string name="report" msgid="4060218260984795706">"Справаздача"</string>
     <string name="wait" msgid="7147118217226317732">"Чакаць"</string>
-    <!-- outdated translation 8323761616052121936 -->     <string name="launch_warning_title" msgid="1547997780506713581">"Прыкладанне перанакіраванае"</string>
+    <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="screen_compat_mode_scale" msgid="3202955667675944499">"Шкала"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Заўсёды паказваць"</string>
-    <!-- outdated translation 2953716574198046484 -->     <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Каб зноў уключыць, перайдзіце ў Налады &gt; Прыкладанні &gt; Кіраванне прыкладаннямі."</string>
-    <!-- no translation found for smv_application (3307209192155442829) -->
-    <skip />
+    <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Зноў уключыце гэта ў раздзеле \"Сістэмныя налады &gt; Прыкладанні &gt; Спампаваныя\"."</string>
+    <string name="smv_application" msgid="3307209192155442829">"Прыкладанне <xliff:g id="APPLICATION">%1$s</xliff:g> (працэс <xliff:g id="PROCESS">%2$s</xliff:g>) парушыла ўласную палітыку StrictMode."</string>
     <string name="smv_process" msgid="5120397012047462446">"Працэс <xliff:g id="PROCESS">%1$s</xliff:g> парушыў уласную палітыку StrictMode."</string>
-    <!-- outdated translation 378740715658358071 -->     <string name="android_upgrading_title" msgid="1584192285441405746">"Абнаўленне Android..."</string>
-    <!-- no translation found for android_upgrading_apk (7904042682111526169) -->
-    <skip />
-    <!-- outdated translation 7959542881906488763 -->     <string name="android_upgrading_starting_apps" msgid="451464516346926713">"Запуск прыкладанняў."</string>
+    <string name="android_upgrading_title" msgid="1584192285441405746">"Абнаўленне Android..."</string>
+    <string name="android_upgrading_apk" msgid="7904042682111526169">"Аптымізацыя прыкладання <xliff:g id="NUMBER_0">%1$d</xliff:g> з <xliff:g id="NUMBER_1">%2$d</xliff:g>."</string>
+    <string name="android_upgrading_starting_apps" msgid="451464516346926713">"Запуск прыкладанняў."</string>
     <string name="android_upgrading_complete" msgid="1405954754112999229">"Завяршэнне загрузкі."</string>
     <string name="heavy_weight_notification" msgid="9087063985776626166">"Прыкладанне \"<xliff:g id="APP">%1$s</xliff:g>\" запушчанае"</string>
-    <!-- outdated translation 2423977499339403402 -->     <string name="heavy_weight_notification_detail" msgid="1721681741617898865">"Выберыце, каб пераключыцца да прыкладання"</string>
-    <!-- outdated translation 1135403633766694316 -->     <string name="heavy_weight_switcher_title" msgid="7153167085403298169">"Пераключыць прыкладанні?"</string>
-    <!-- outdated translation 4592075610079319667 -->     <string name="heavy_weight_switcher_text" msgid="7022631924534406403">"Ужо запушчана іншае прыкладанне, якое павінна быць спыненае перад запускам новага."</string>
+    <string name="heavy_weight_notification_detail" msgid="1721681741617898865">"Націсніце, каб перайсці да прыкладання"</string>
+    <string name="heavy_weight_switcher_title" msgid="7153167085403298169">"Пераключыць прыкладанні?"</string>
+    <string name="heavy_weight_switcher_text" msgid="7022631924534406403">"Ужо запушчана іншае прыкладанне, якое павінна быць спынена перад запускам новага."</string>
     <string name="old_app_action" msgid="493129172238566282">"Вярнуцца да <xliff:g id="OLD_APP">%1$s</xliff:g>"</string>
-    <!-- outdated translation 942967900237208466 -->     <string name="old_app_description" msgid="2082094275580358049">"Не запускайце новае прыкладанне."</string>
+    <string name="old_app_description" msgid="2082094275580358049">"Не запускайце новыя прыкладанні."</string>
     <string name="new_app_action" msgid="5472756926945440706">"Запусціць <xliff:g id="OLD_APP">%1$s</xliff:g>"</string>
-    <!-- outdated translation 6830398339826789493 -->     <string name="new_app_description" msgid="1932143598371537340">"Спыніць старое прыкладанне, не захоўваючы яго."</string>
-    <string name="sendText" msgid="5132506121645618310">"Выберыце дзеянне для тэксту"</string>
+    <string name="new_app_description" msgid="1932143598371537340">"Спыніць старыя прыкладанні без захавання."</string>
+    <string name="sendText" msgid="5209874571959469142">"Выберыце дзеянне для тэкста"</string>
     <string name="volume_ringtone" msgid="6885421406845734650">"Гучнасць званка"</string>
     <string name="volume_music" msgid="5421651157138628171">"Гучнасць прайгравальніка"</string>
     <string name="volume_music_hint_playing_through_bluetooth" msgid="9165984379394601533">"Прайграваецца праз Bluetooth"</string>
-    <string name="volume_music_hint_silent_ringtone_selected" msgid="6158339745293431194">"Выбрана ціхая мелодыя"</string>
+    <string name="volume_music_hint_silent_ringtone_selected" msgid="8310739960973156272">"Усталяваны ціхі рэжым"</string>
     <string name="volume_call" msgid="3941680041282788711">"Гучнасць падчас размовы"</string>
     <string name="volume_bluetooth_call" msgid="2002891926351151534">"Гучнасць Bluetooth падчас выкліку"</string>
     <string name="volume_alarm" msgid="1985191616042689100">"Гучнасць будзільніка"</string>
@@ -965,30 +964,35 @@
     <item quantity="one" msgid="1634101450343277345">"Адкрытая сетка Wi-Fi даступная"</item>
     <item quantity="other" msgid="7915895323644292768">"Даступны адкрытыя сеткі Wi-Fi"</item>
   </plurals>
-    <string name="wifi_available_sign_in" msgid="9157196203958866662">"Уваход у сетку Wi-Fi"</string>
+    <string name="wifi_available_sign_in" msgid="4029489716605255386">"Увайдзіце ў сетку Wi-Fi"</string>
     <!-- no translation found for wifi_available_sign_in_detailed (6797764740339907572) -->
     <skip />
     <string name="wifi_watchdog_network_disabled" msgid="7904214231651546347">"Немагчыма падключыцца да Wi-Fi"</string>
-    <string name="wifi_watchdog_network_disabled_detailed" msgid="4917472096696322767">" дрэннае падключэнне да Інтэрнэту."</string>
+    <string name="wifi_watchdog_network_disabled_detailed" msgid="5548780776418332675">" дрэннае падключэнне да Інтэрнэту."</string>
     <string name="wifi_p2p_dialog_title" msgid="97611782659324517">"Wi-Fi Direct"</string>
-    <string name="wifi_p2p_turnon_message" msgid="2804722042556269129">"Пачаць работу Wi-Fi Direct. Гэта адключыць Wi-Fi кліента/кропку доступу."</string>
-    <string name="wifi_p2p_failed_message" msgid="1820097493844848281">"Немагчыма запусціць Wi-Fi Direct"</string>
-    <string name="wifi_p2p_pbc_go_negotiation_request_message" msgid="3170321684621420428">"Запыт злучэння Wi-Fi Direct ад <xliff:g id="P2P_DEVICE_ADDRESS">%1$s</xliff:g>. Націсніце \"ОК\", каб прыняць."</string>
-    <string name="wifi_p2p_pin_go_negotiation_request_message" msgid="5177412094633377308">"Запыт злучэння Wi-Fi Direct ад <xliff:g id="P2P_DEVICE_ADDRESS">%1$s</xliff:g>. Увядзіце PIN-код для працягу."</string>
-    <string name="wifi_p2p_pin_display_message" msgid="2834049169114922902">"Для працягу настройкі злучэння неабходна ўвесці PIN-код WPS <xliff:g id="P2P_WPS_PIN">%1$s</xliff:g> на аднарангавай прыладзе <xliff:g id="P2P_CLIENT_ADDRESS">%2$s</xliff:g>"</string>
+    <string name="wifi_p2p_turnon_message" msgid="2909250942299627244">"Пачаць работу Wi-Fi Direct. Гэта адключыць кліента або кропку доступу Wi-Fi."</string>
+    <string name="wifi_p2p_failed_message" msgid="3763669677935623084">"Немагчыма запусціць Wi-Fi Direct."</string>
+    <string name="accept" msgid="1645267259272829559">"Прыняць"</string>
+    <string name="decline" msgid="2112225451706137894">"Адхіліць"</string>
+    <string name="wifi_p2p_invitation_sent_title" msgid="1318975185112070734">"Запрашэнне адпраўлена"</string>
+    <string name="wifi_p2p_invitation_to_connect_title" msgid="4958803948658533637">"Запрашэнне далучыцца"</string>
+    <string name="wifi_p2p_from_message" msgid="570389174731951769">"Ад:"</string>
+    <string name="wifi_p2p_to_message" msgid="248968974522044099">"Каму:"</string>
+    <string name="wifi_p2p_enter_pin_message" msgid="5920929550367828970">"Увядзіце патрэбны PIN-код:"</string>
+    <string name="wifi_p2p_show_pin_message" msgid="8530563323880921094">"PIN-код"</string>
     <string name="wifi_p2p_enabled_notification_title" msgid="2068321881673734886">"Wi-Fi Direct уключаны"</string>
     <string name="wifi_p2p_enabled_notification_message" msgid="1638949953993894335">"Дакраніцеся, каб наладзіць"</string>
     <string name="select_character" msgid="3365550120617701745">"Уставіць сімвал"</string>
-    <!-- outdated translation 7630529934366549163 -->     <string name="sms_control_default_app_name" msgid="3058577482636640465">"Невядомае прыкладанне"</string>
+    <string name="sms_control_default_app_name" msgid="3058577482636640465">"Невядомае прыкладанне"</string>
     <string name="sms_control_title" msgid="7296612781128917719">"Адпраўка SMS"</string>
-    <!-- outdated translation 1289331457999236205 -->     <string name="sms_control_message" msgid="4073755190243093924">"Адпраўляецца вялікая колькасць SMS. Выберыце \"OK\", каб працягнуць, ці \"Адмена\", каб спыніць адпраўку."</string>
+    <string name="sms_control_message" msgid="4073755190243093924">"Адпраўляецца вялікая колькасць SMS-паведамленняў. Націсніце \"OK\", каб працягнуць, ці \"Адмена\", каб спыніць адпраўку."</string>
     <string name="sms_control_yes" msgid="2532062172402615953">"ОК"</string>
     <string name="sms_control_no" msgid="1715320703137199869">"Адмяніць"</string>
     <string name="sim_removed_title" msgid="6227712319223226185">"SIM-карта выдаленая"</string>
     <string name="sim_removed_message" msgid="2333164559970958645">"Мабільная сетка будзе недаступная да перазагрузкі з дзеючай SIM-картай."</string>
     <string name="sim_done_button" msgid="827949989369963775">"Гатова"</string>
     <string name="sim_added_title" msgid="3719670512889674693">"SIM-карта дадазеная"</string>
-    <string name="sim_added_message" msgid="1209265974048554242">"Для доступу да мабільнай сеткі неабходна перазагрузіць прыладу."</string>
+    <string name="sim_added_message" msgid="6599945301141050216">"Перазагрузіце прыладу, каб атрымаць доступ да мабільнай сеткі."</string>
     <string name="sim_restart_button" msgid="4722407842815232347">"Перазапусціць"</string>
     <string name="time_picker_dialog_title" msgid="8349362623068819295">"Усталяваць час"</string>
     <string name="date_picker_dialog_title" msgid="5879450659453782278">"Усталяваць дату"</string>
@@ -997,40 +1001,40 @@
     <string name="no_permissions" msgid="7283357728219338112">"Дазволу не патрабуецца"</string>
     <string name="perms_hide" msgid="7283915391320676226"><b>"Не паказваць"</b></string>
     <string name="perms_show_all" msgid="2671791163933091180"><b>"Паказаць усе"</b></string>
-    <string name="usb_storage_activity_title" msgid="2399289999608900443">"USB-назапашвальнік"</string>
+    <string name="usb_storage_activity_title" msgid="4465055157209648641">"Унiверсальны USB-назапашвальнік"</string>
     <string name="usb_storage_title" msgid="5901459041398751495">"USB падлучаны"</string>
-    <string name="usb_storage_message" product="nosdcard" msgid="6631094834151575841">"Вы падключыліся да кампутара праз USB. Націсніце кнопку ніжэй, калі вы хочаце капіраваць файлы з кампутара і USB-назапашвальнiка Android."</string>
-    <string name="usb_storage_message" product="default" msgid="4510858346516069238">"Вы падключыліся да кампутара праз 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-назапашвальнiк"</string>
-    <string name="usb_storage_error_message" product="nosdcard" msgid="3276413764430468454">"Праблема з выкарыстаннем USB-назапашвальнiка для прылады захоўвання дадзеных USB."</string>
-    <string name="usb_storage_error_message" product="default" msgid="120810397713773275">"Праблема з выкарыстаннем SD-карты для USB-назапашвальнiка дадзеных."</string>
+    <string name="usb_storage_error_message" product="nosdcard" msgid="3017045217365540658">"Паўстала праблема з выкарыстаннем USB-назапашвальнiка ва ўнiверсальным USB-назапашвальнiку."</string>
+    <string name="usb_storage_error_message" product="default" msgid="2876018512716970313">"Паўстала праблема выкарыстання SD-карты ва ўнiверсальным USB-назапашвальнiку."</string>
     <string name="usb_storage_notification_title" msgid="8175892554757216525">"USB падключаны"</string>
-    <string name="usb_storage_notification_message" msgid="7380082404288219341">"Выберыце файлы для капіявання паміж тэлефонам і кампутарам."</string>
+    <string name="usb_storage_notification_message" msgid="939822783828183763">"Дакраніцеся, каб капіяваць файлы з камп\'ютара цi на яго."</string>
     <string name="usb_storage_stop_notification_title" msgid="2336058396663516017">"Выключыць USB-назапашвальнiк"</string>
-    <string name="usb_storage_stop_notification_message" msgid="2591813490269841539">"Выберыце, каб адключыць гэты USB-назапашвальнiк."</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="1368842269463745067">"Перш чым адключыць USB-назпашвальнiк, пераканайцеся, што вы адключылі (...выцягнулі...) USB-назапашвальнiк Android з кампутара."</string>
-    <string name="usb_storage_stop_message" product="default" msgid="3613713396426604104">"Перш чым адключыць USB-назапашвальнік, пераканайцеся, што SD-карта Android адключана ад кампутара."</string>
+    <string name="usb_storage_stop_message" product="nosdcard" msgid="4264025280777219521">"Перш чым адключыць USB-назапашвальнік, адключыце(\"вымiце\") USB-назапашвальнік прылады Android ад камп\'ютара."</string>
+    <string name="usb_storage_stop_message" product="default" msgid="8043969782460613114">"Перш чым адключыць USB-назапашвальнік, адключыце(\"вымiце\") SD-карту вашай прылады Android з камп\'ютара."</string>
     <string name="usb_storage_stop_button_mount" msgid="7060218034900696029">"Адключыць USB-назапашвальнiк"</string>
-    <string name="usb_storage_stop_error_message" msgid="143881914840412108">"Праблема адключэння USB-назапашвальнiка. Пераканайцеся ў тым, што вы адлучылі хост USB, а затым паўтарыце спробу."</string>
+    <string name="usb_storage_stop_error_message" msgid="1970374898263063836">"Памылка адключэння USB-назапашвальніка. Пераканайцеся, што вы адключылі хост USB, а потым паўтарыце спробу."</string>
     <string name="dlg_confirm_kill_storage_users_title" msgid="963039033470478697">"Падключыць USB-назапашвальнiк"</string>
-    <!-- outdated translation 3202838234780505886 -->     <string name="dlg_confirm_kill_storage_users_text" msgid="6206212680430268343">"Калі вы падлучыце USB-назапашвальнік, некаторыя прыкладанні, якія вы выкарыстоўваеце, спыняцца і могуць быць недаступныя, пакуль USB-назапашвальнік не будзе адключаны."</string>
+    <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_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>
-    <string name="usb_notification_message" msgid="4447869605109736382">"Націсніце, каб убачыць параметры USB"</string>
-    <!-- outdated translation 7980995592595097841 -->     <string name="extmedia_format_title" product="nosdcard" msgid="9020092196061007262">"Фарматаваць USB-назапашвальнiк"</string>
-    <!-- outdated translation 7980995592595097841 -->     <string name="extmedia_format_title" product="default" msgid="3648415921526526069">"Фарматаваць USB-назапашвальнiк"</string>
-    <!-- outdated translation 8296908079722897772 -->     <string name="extmedia_format_message" product="nosdcard" msgid="3934016853425761078">"Фарматаваць USB-назапашвальнiк, выдаліўшы ўсе файлы, якія захоўваюцца там? Адмянiць нельга"</string>
-    <!-- outdated translation 8296908079722897772 -->     <string name="extmedia_format_message" product="default" msgid="14131895027543830">"Фарматаваць USB-назапашвальнiк, выдаліўшы ўсе файлы, якія захоўваюцца там? Адмянiць нельга"</string>
+    <string name="usb_notification_message" msgid="2290859399983720271">"Націсніце, каб убачыць іншыя параметры USB."</string>
+    <string name="extmedia_format_title" product="nosdcard" msgid="9020092196061007262">"Фарматаваць USB-назапашвальнiк?"</string>
+    <string name="extmedia_format_title" product="default" msgid="3648415921526526069">"Фарматаваць SD-карту?"</string>
+    <string name="extmedia_format_message" product="nosdcard" msgid="3934016853425761078">"Усе файлы, якія захоўваюцца на вашым USB-назапашвальніку, будуць выдалены. Гэта дзеянне не можа быць адменена."</string>
+    <string name="extmedia_format_message" product="default" msgid="14131895027543830">"Усе дадзеныя на карце будуць страчаны."</string>
     <string name="extmedia_format_button_format" msgid="4131064560127478695">"Фармат"</string>
     <string name="adb_active_notification_title" msgid="6729044778949189918">"Прылада адладкі USB падключана"</string>
-    <!-- outdated translation 8592219392855947984 -->     <string name="adb_active_notification_message" msgid="1016654627626476142">"Гэты кіёск абсталяваны Nexus S."</string>
-    <!-- outdated translation 6865512749462072765 -->     <string name="select_input_method" msgid="4653387336791222978">"Выберыце метад уводу"</string>
-    <!-- outdated translation 6324843080254191535 -->     <string name="configure_input_methods" msgid="9091652157722495116">"Налада метадаў уводу"</string>
+    <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="fast_scroll_alphabet" msgid="5433275485499039199">" АБВГДЕЁЖЗІЙКЛМНОПРСТУЎФХЦЧШ\'ЫЬЭЮЯ"</string>
     <string name="fast_scroll_numeric_alphabet" msgid="4030170524595123610">" 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"</string>
     <string name="candidates_style" msgid="4333913089637062257"><u>"кандыдат."</u></string>
@@ -1039,12 +1043,12 @@
     <string name="ext_media_checking_notification_message" msgid="8287319882926737053">"Праверка на наяўнасць памылак."</string>
     <string name="ext_media_nofs_notification_title" product="nosdcard" msgid="7788040745686229307">"Пусты USB-назапашвальнiк"</string>
     <string name="ext_media_nofs_notification_title" product="default" msgid="780477838241212997">"Пустая SD-карта"</string>
-    <string name="ext_media_nofs_notification_message" product="nosdcard" msgid="8623130522556087311">"USB-назапашвальнiк пусты або файлавая сістэма не падтрымліваецца."</string>
-    <string name="ext_media_nofs_notification_message" product="default" msgid="3817704088027829380">"SD-карта пустая, або файлавая сістэма не падтрымліваецца."</string>
+    <string name="ext_media_nofs_notification_message" product="nosdcard" msgid="7840121067427269500">"USB-назапашвальнік пусты або мае файлавую сістэму, якая не падтрымліваецца."</string>
+    <string name="ext_media_nofs_notification_message" product="default" msgid="8641065641786923604">"SD-карта пустая або мае файлавую сістэму, якая не падтрымліваецца."</string>
     <string name="ext_media_unmountable_notification_title" product="nosdcard" msgid="2090046769532713563">"Пашкоджаны USB-назапашвальнiк"</string>
     <string name="ext_media_unmountable_notification_title" product="default" msgid="6410723906019100189">"SD-карта пашкоджаная"</string>
-    <string name="ext_media_unmountable_notification_message" product="nosdcard" msgid="529021299294450667">"USB-назапашвальнiк пашкоджаны. Магчыма, вам прыйдзецца яго перафарматаваць."</string>
-    <string name="ext_media_unmountable_notification_message" product="default" msgid="6902531775948238989">"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-назапашвальнiк нечакана быў выдалены"</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-назапашвальнiк, перш чым выцягваць яго, каб пазбегнуць страты дадзеных."</string>
@@ -1057,13 +1061,13 @@
     <string name="ext_media_nomedia_notification_title" product="default" msgid="8902518030404381318">"SD-карта выдаленая"</string>
     <string name="ext_media_nomedia_notification_message" product="nosdcard" msgid="6921126162580574143">"USB-назапашвальнiк выдалены. Уставіць новыя носьбіты."</string>
     <string name="ext_media_nomedia_notification_message" product="default" msgid="3870120652983659641">"SD-карта выдаленая. Устаўце новую."</string>
-    <string name="activity_list_empty" msgid="4168820609403385789">"Няма адпаведных дзеянняў"</string>
+    <string name="activity_list_empty" msgid="1675388330786841066">"Адпаведныя дзеянні не знойдзены."</string>
     <string name="permlab_pkgUsageStats" msgid="8787352074326748892">"абнавіць статыстыку выкарыстання кампанентаў"</string>
-    <!-- outdated translation 891553695716752835 -->     <string name="permdesc_pkgUsageStats" msgid="1106612424254277630">"Дазваляе мяняць сабраную статыстыку выкарыстання кампанента. Не выкарыстоўваецца звычайнымі прыкладаннямі."</string>
-    <!-- outdated translation 1660908117394854464 -->     <string name="permlab_copyProtectedData" msgid="4341036311211406692">"Дазваляе выклікаць службы кантэйнера па змаўчанні для капіявання змесціва. Не выкарыстоўваецца звычайнымi прыкладаннямi."</string>
-    <!-- outdated translation 537780957633976401 -->     <string name="permdesc_copyProtectedData" msgid="4390697124288317831">"Дазваляе выклікаць службы кантэйнера па змаўчанні для капіявання змесціва. Не выкарыстоўваецца звычайнымi прыкладаннямi."</string>
-    <!-- outdated translation 1311810005957319690 -->     <string name="tutorial_double_tap_to_zoom_message_short" msgid="4070433208160063538">"Націсніце двойчы, каб кіраваць маштабаваннем"</string>
-    <string name="gadget_host_error_inflating" msgid="2613287218853846830">"Памылка ўключэння віджэту"</string>
+    <string name="permdesc_pkgUsageStats" msgid="1106612424254277630">"Дазваляе прыкладанням змяняць сабраную статыстыку выкарыстання кампанентаў. Не для выкарыстання звычайнымі прыкладаннямі."</string>
+    <string name="permlab_copyProtectedData" msgid="4341036311211406692">"капіяваць змесціва"</string>
+    <string name="permdesc_copyProtectedData" msgid="4390697124288317831">"Дазваляе прыкладанням выклікаць службу захавання па змаўчанні для капіявання змесціва. Не выкарыстоўваецца звычайнымі прыкладаннямі."</string>
+    <string name="tutorial_double_tap_to_zoom_message_short" msgid="4070433208160063538">"Двойчы дакраніцеся, каб змянiць маштаб"</string>
+    <string name="gadget_host_error_inflating" msgid="4882004314906466162">"Немагчыма дадаць віджэт."</string>
     <string name="ime_action_go" msgid="8320845651737369027">"Пачаць"</string>
     <string name="ime_action_search" msgid="658110271822807811">"Пошук"</string>
     <string name="ime_action_send" msgid="2316166556349314424">"Адправіць"</string>
@@ -1073,37 +1077,37 @@
     <string name="ime_action_default" msgid="2840921885558045721">"Выканаць"</string>
     <string name="dial_number_using" msgid="5789176425167573586">"Набраць нумар"\n"з выкарыстаннем <xliff:g id="NUMBER">%s</xliff:g>"</string>
     <string name="create_contact_using" msgid="4947405226788104538">"Стварыць кантакт"\n"з дапамогай<xliff:g id="NUMBER">%s</xliff:g>"</string>
-    <!-- outdated translation 6824538733852821001 -->     <string name="grant_credentials_permission_message_header" msgid="2106103817937859662">"Гэтыя адно або некалькі прыкладанняў пытаюцца дазволу на доступ да вашага ўліковага запісу цяпер і ў будучыні."</string>
+    <string name="grant_credentials_permission_message_header" msgid="2106103817937859662">"Гэтыя адно або некалькі прыкладанняў запытваюць дазвол на доступ да вашага ўліковага запісу цяпер і ў будучыні."</string>
     <string name="grant_credentials_permission_message_footer" msgid="3125211343379376561">"Дазволіць гэты запыт?"</string>
-    <string name="grant_permissions_header_text" msgid="2722567482180797717">"Запыт на доступ"</string>
+    <string name="grant_permissions_header_text" msgid="6874497408201826708">"Запыт на доступ"</string>
     <string name="allow" msgid="7225948811296386551">"Дазволіць"</string>
     <string name="deny" msgid="2081879885755434506">"Забараніць"</string>
-    <string name="permission_request_notification_title" msgid="5390555465778213840">"Запытаны дазвол"</string>
-    <string name="permission_request_notification_with_subtitle" msgid="4325409589686688000">"Запытаны дазвол"\n"для ўліковага запісу<xliff:g id="ACCOUNT">%s</xliff:g>"</string>
+    <string name="permission_request_notification_title" msgid="6486759795926237907">"Дазвол запытаны"</string>
+    <string name="permission_request_notification_with_subtitle" msgid="8530393139639560189">"Запытаны дазвол"\n"для ўліковага запісу <xliff:g id="ACCOUNT">%s</xliff:g>"</string>
     <string name="input_method_binding_label" msgid="1283557179944992649">"Метад уводу"</string>
     <string name="sync_binding_label" msgid="3687969138375092423">"Сінхранізацыя"</string>
     <string name="accessibility_binding_label" msgid="4148120742096474641">"Спецыяльныя магчымасці"</string>
     <string name="wallpaper_binding_label" msgid="1240087844304687662">"Шпалеры"</string>
     <string name="chooser_wallpaper" msgid="7873476199295190279">"Змена шпалер"</string>
-    <string name="vpn_title" msgid="8219003246858087489">"VPN актываваны."</string>
+    <string name="vpn_title" msgid="19615213552042827">"VPN актываваны"</string>
     <string name="vpn_title_long" msgid="6400714798049252294">"VPN актывуецца прыкладаннем <xliff:g id="APP">%s</xliff:g>"</string>
-    <string name="vpn_text" msgid="1610714069627824309">"Націсніце, каб кіраваць сеткай."</string>
-    <string name="vpn_text_long" msgid="4907843483284977618">"Падлучаны да <xliff:g id="SESSION">%s</xliff:g>. Націсніце, каб кiраваць сеткай."</string>
+    <string name="vpn_text" msgid="3011306607126450322">"Дакраніцеся, каб кіраваць сеткай."</string>
+    <string name="vpn_text_long" msgid="6407351006249174473">"Падлучаны да сеанса \"<xliff:g id="SESSION">%s</xliff:g>\". Дакраніцеся, каб кiраваць сеткай."</string>
     <string name="upload_file" msgid="2897957172366730416">"Выберыце файл"</string>
     <string name="no_file_chosen" msgid="6363648562170759465">"Файл не выбраны"</string>
     <string name="reset" msgid="2448168080964209908">"Скінуць"</string>
     <string name="submit" msgid="1602335572089911941">"Перадаць"</string>
     <string name="car_mode_disable_notification_title" msgid="3164768212003864316">"Рэжым \"У машыне\" ўключаны"</string>
-    <string name="car_mode_disable_notification_message" msgid="668663626721675614">"Выберыце, каб выйсці з рэжыму \"Ў аўтамабілі\"."</string>
+    <string name="car_mode_disable_notification_message" msgid="8035230537563503262">"Дакраніцеся, каб выйсці з рэжыму \"Штурман\"."</string>
     <string name="tethered_notification_title" msgid="3146694234398202601">"USB-мадэм або кропка доступу Wi-Fi актыўныя"</string>
-    <string name="tethered_notification_message" msgid="3067108323903048927">"Націсніце, каб змяніць налады"</string>
+    <string name="tethered_notification_message" msgid="6857031760103062982">"Націсніце, каб наладзіць."</string>
     <string name="back_button_label" msgid="2300470004503343439">"Назад"</string>
     <string name="next_button_label" msgid="1080555104677992408">"Далей"</string>
     <string name="skip_button_label" msgid="1275362299471631819">"Прапусціць"</string>
     <string name="throttle_warning_notification_title" msgid="4890894267454867276">"Інтэнсіўнае выкарыстанне перадачы дадзеных праз мабільную сетку"</string>
-    <string name="throttle_warning_notification_message" msgid="2609734763845705708">"Націсніце, каб даведацца больш аб выкарыстанні перадачы дадзеных праз мабільную сетку"</string>
+    <string name="throttle_warning_notification_message" msgid="3340822228599337743">"Націсніце, каб атрымаць дадатковыя звесткі аб выкарыстанні мабiльнай перадачы дадзеных."</string>
     <string name="throttled_notification_title" msgid="6269541897729781332">"Ліміт мабільнай перадачы дадзеных перавышаны"</string>
-    <string name="throttled_notification_message" msgid="4712369856601275146">"Націсніце, каб даведацца больш аб выкарыстанні перадачы дадзеных праз мабільную сетку"</string>
+    <string name="throttled_notification_message" msgid="5443457321354907181">"Націсніце, каб атрымаць дадатковыя звесткі аб выкарыстанні мабiльнай перадачы дадзеных."</string>
     <string name="no_matches" msgid="8129421908915840737">"Няма супадзенняў"</string>
     <string name="find_on_page" msgid="1946799233822820384">"Знайсці на старонцы"</string>
   <plurals name="matches_found">
@@ -1111,10 +1115,10 @@
     <item quantity="other" msgid="4641872797067609177">"<xliff:g id="INDEX">%d</xliff:g> з <xliff:g id="TOTAL">%d</xliff:g>"</item>
   </plurals>
     <string name="action_mode_done" msgid="7217581640461922289">"Гатова"</string>
-    <string name="progress_unmounting" product="nosdcard" msgid="535863554318797377">"Адключэнне USB-назапашвальнiка..."</string>
-    <string name="progress_unmounting" product="default" msgid="5556813978958789471">"Адключэнне SD-карты..."</string>
-    <string name="progress_erasing" product="nosdcard" msgid="4183664626203056915">"Ачышчэнне USB-назапашвальнiка..."</string>
-    <string name="progress_erasing" product="default" msgid="2115214724367534095">"Ачышчэнне SD-карты..."</string>
+    <string name="progress_unmounting" product="nosdcard" msgid="3923810448507612746">"Адключэнне USB-назапашвальнiка..."</string>
+    <string name="progress_unmounting" product="default" msgid="1327894998409537190">"Адключэнне SD-карты..."</string>
+    <string name="progress_erasing" product="nosdcard" msgid="4521573321524340058">"Выдаленне дадзеных з USB-назапашвальнiка..."</string>
+    <string name="progress_erasing" product="default" msgid="6596988875507043042">"Выдаленне дадзеных з SD-карты..."</string>
     <string name="format_error" product="nosdcard" msgid="6299769563624776948">"Немагчыма ачысцiць USB-назапашвальнік."</string>
     <string name="format_error" product="default" msgid="7315248696644510935">"Немагчыма ачысцiць SD-карту."</string>
     <string name="media_bad_removal" msgid="7960864061016603281">"SD-карта была вынутая да адключэння"</string>
@@ -1133,17 +1137,17 @@
     <string name="gpsVerifYes" msgid="2346566072867213563">"Так"</string>
     <string name="gpsVerifNo" msgid="1146564937346454865">"Не"</string>
     <string name="sync_too_many_deletes" msgid="5296321850662746890">"Выдаліць перавышаны ліміт"</string>
-    <string name="sync_too_many_deletes_desc" msgid="7030265992955132593">"Ёсць выдаленыя элементы (<xliff:g id="NUMBER_OF_DELETED_ITEMS">%1$d</xliff:g>) для тыпу сiнхранiзацыi <xliff:g id="TYPE_OF_SYNC">%2$s</xliff:g>, уліковы запіс <xliff:g id="ACCOUNT_NAME">%3$s</xliff:g>. Што вы хочаце зрабіць?"</string>
-    <string name="sync_really_delete" msgid="8933566316059338692">"Выдаліць элементы."</string>
-    <string name="sync_undo_deletes" msgid="8610996708225006328">"Скасаваць выдаленне."</string>
-    <string name="sync_do_nothing" msgid="8717589462945226869">"Нічога зараз не рабіць."</string>
-    <!-- outdated translation 4191313562041125787 -->     <string name="choose_account_label" msgid="5655203089746423927">"Выберыце ўліковы запіс"</string>
+    <string name="sync_too_many_deletes_desc" msgid="496551671008694245">"Выдалена элементаў для тыпу сінхранiзацыi \"<xliff:g id="TYPE_OF_SYNC">%2$s</xliff:g>\": <xliff:g id="NUMBER_OF_DELETED_ITEMS">%1$d</xliff:g>. Уліковы запіс <xliff:g id="ACCOUNT_NAME">%3$s</xliff:g>. Што вы жадаеце зрабіць?"</string>
+    <string name="sync_really_delete" msgid="2572600103122596243">"Выдаліць элементы."</string>
+    <string name="sync_undo_deletes" msgid="2941317360600338602">"Скасаваць выдаленні"</string>
+    <string name="sync_do_nothing" msgid="3743764740430821845">"Нічога зараз не рабіць"</string>
+    <string name="choose_account_label" msgid="5655203089746423927">"Выберыце ўліковы запіс"</string>
     <string name="add_account_label" msgid="2935267344849993553">"Дадаць уліковы запіс"</string>
-    <string name="choose_account_text" msgid="6891230675141555481">"Які ўліковы запіс вы хацелі б выкарыстоўваць?"</string>
+    <string name="choose_account_text" msgid="6303348737197849675">"Які ўліковы запіс вы жадаеце выкарыстоўваць?"</string>
     <string name="add_account_button_label" msgid="3611982894853435874">"Дадаць уліковы запіс"</string>
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Інкрэмент"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Дэкрэмент"</string>
-    <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"Націсніце і ўтрымлівайце кнопку <xliff:g id="VALUE">%s</xliff:g>."</string>
+    <string name="number_picker_increment_scroll_mode" msgid="3073101067441638428">"Націсніце і ўтрымлівайце <xliff:g id="VALUE">%s</xliff:g>."</string>
     <string name="number_picker_increment_scroll_action" msgid="4628981789985093179">"Перасуньце палец уверх, каб павялiчыць адрэзак, або ўніз, каб паменшыць."</string>
     <string name="time_picker_increment_minute_button" msgid="2843066823236250329">"На хвiлiну больш"</string>
     <string name="time_picker_decrement_minute_button" msgid="4357907223628449595">"На хвiлiну менш"</string>
@@ -1172,10 +1176,10 @@
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"Змена рэжыму"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shift"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enter"</string>
-    <!-- outdated translation 4540794444768613567 -->     <string name="activitychooserview_choose_application" msgid="2125168057199941199">"Выберыце прыкладанне"</string>
+    <string name="activitychooserview_choose_application" msgid="2125168057199941199">"Выберыце прыкладанне"</string>
     <string name="shareactionprovider_share_with" msgid="806688056141131819">"Апублікаваць з дапамогай"</string>
     <string name="shareactionprovider_share_with_application" msgid="5627411384638389738">"Адправiць з дапамогай прыкладання <xliff:g id="APPLICATION_NAME">%s</xliff:g>"</string>
-    <!-- outdated translation 7311938669217173870 -->     <string name="content_description_sliding_handle" msgid="415975056159262248">"Ручка для перасоўвання. Націсніце і ўтрымлівайце."</string>
+    <string name="content_description_sliding_handle" msgid="415975056159262248">"Ручка для перасоўвання. Націсніце і ўтрымлівайце."</string>
     <string name="description_direction_up" msgid="1983114130441878529">"Уверх да <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_down" msgid="4294993639091088240">"Уніз да <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
     <string name="description_direction_left" msgid="6814008463839915747">"Улева да <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
@@ -1185,29 +1189,29 @@
     <string name="description_target_silent" msgid="893551287746522182">"Ціхі рэжым"</string>
     <string name="description_target_soundon" msgid="30052466675500172">"Гук уключаны"</string>
     <string name="description_target_unlock_tablet" msgid="3833195335629795055">"Прагартайце, каб разблакаваць."</string>
-    <string name="keyboard_headset_required_to_hear_password" msgid="5913502399391940888">"Каб праслухаць паролi, падключыце гарнiтуру."</string>
+    <string name="keyboard_headset_required_to_hear_password" msgid="7011927352267668657">"Каб праслухаць паролi, падключыце гарнiтуру."</string>
     <string name="keyboard_password_character_no_headset" msgid="2859873770886153678">"Кропка."</string>
     <string name="action_bar_home_description" msgid="5293600496601490216">"Перайсці да пачатковай старонкі"</string>
     <string name="action_bar_up_description" msgid="2237496562952152589">"Перайсці ўверх"</string>
     <string name="action_menu_overflow_description" msgid="2295659037509008453">"Больш налад"</string>
-    <string name="storage_internal" msgid="7556050805474115618">"Унутраная памяць"</string>
-    <string name="storage_sd_card" msgid="8921771478629812343">"SD-карта"</string>
+    <string name="storage_internal" msgid="4891916833657929263">"Унутраная памяць"</string>
+    <string name="storage_sd_card" msgid="3282948861378286745">"SD-карта"</string>
     <string name="storage_usb" msgid="3017954059538517278">"USB-назапашвальнік"</string>
-    <string name="extract_edit_menu_button" msgid="302060189057163906">"Рэдагаваць..."</string>
+    <string name="extract_edit_menu_button" msgid="8940478730496610137">"Рэдагаваць"</string>
     <string name="data_usage_warning_title" msgid="1955638862122232342">"Папярэджанне выкарыстання дадзеных"</string>
-    <string name="data_usage_warning_body" msgid="7217480745540055170">"Дакраніцеся, каб прагледзець выкарыстанне і налады"</string>
+    <string name="data_usage_warning_body" msgid="2814673551471969954">"Дакраніцеся, каб прагледзець гісторыю выкарыстання і налады."</string>
     <string name="data_usage_3g_limit_title" msgid="7093334419518706686">"Перадача дадз. 2G-3G выключана"</string>
     <string name="data_usage_4g_limit_title" msgid="7636489436819470761">"Перадача дадзеных 4G выключана"</string>
     <string name="data_usage_mobile_limit_title" msgid="7869402519391631884">"Мабільная перадача дадз. выкл."</string>
     <string name="data_usage_wifi_limit_title" msgid="8992154736441284865">"Перад. дадз. Wi-Fi адключаная"</string>
-    <string name="data_usage_limit_body" msgid="4313857592916426843">"Націсніце, каб уключыць"</string>
+    <string name="data_usage_limit_body" msgid="3317964706973601386">"Націсніце, каб уключыць."</string>
     <string name="data_usage_3g_limit_snoozed_title" msgid="7026739121138005231">"Перавышаны ліміт 2G-3G"</string>
     <string name="data_usage_4g_limit_snoozed_title" msgid="1106562779311209039">"Перавышаны ліміт дадзеных 4G"</string>
     <string name="data_usage_mobile_limit_snoozed_title" msgid="279240572165412168">"Перавышаны ліміт мабільных дадзеных"</string>
     <string name="data_usage_wifi_limit_snoozed_title" msgid="8743856006384825974">"Перав. ліміт па дадзеным Wi-Fi"</string>
-    <string name="data_usage_limit_snoozed_body" msgid="2932736326652880660">"<xliff:g id="SIZE">%s</xliff:g> звыш устаноўленай мяжы"</string>
+    <string name="data_usage_limit_snoozed_body" msgid="7035490278298441767">"Аб\'ём <xliff:g id="SIZE">%s</xliff:g> перавышае устаноўл. мяжу."</string>
     <string name="data_usage_restricted_title" msgid="5965157361036321914">"Зыходныя дадзеныя абмежаваныя"</string>
-    <string name="data_usage_restricted_body" msgid="5087354814839059798">"Націсніце, каб зняць абмежаванне"</string>
+    <string name="data_usage_restricted_body" msgid="6741521330997452990">"Націсніце, каб зняць абмежаванне."</string>
     <string name="ssl_certificate" msgid="6510040486049237639">"Сертыфікат бяспекі"</string>
     <string name="ssl_certificate_is_valid" msgid="6825263250774569373">"Гэты сертыфікат сапраўдны."</string>
     <string name="issued_to" msgid="454239480274921032">"Выдадзены:"</string>
@@ -1222,9 +1226,12 @@
     <string name="fingerprints" msgid="4516019619850763049">"Адбіткі пальцаў:"</string>
     <string name="sha256_fingerprint" msgid="4391271286477279263">"Адбітак пальцаў SHA-256:"</string>
     <string name="sha1_fingerprint" msgid="7930330235269404581">"Адбіткі пальцаў SHA-1:"</string>
-    <!-- outdated translation 180268188117163072 -->     <string name="activity_chooser_view_see_all" msgid="4292569383976636200">"Глядзець усе..."</string>
-    <!-- outdated translation 3325054276356556835 -->     <string name="activity_chooser_view_dialog_title_default" msgid="4710013864974040615">"Выберыце дзеянне"</string>
-    <!-- outdated translation 1791316789651185229 -->     <string name="share_action_provider_share_with" msgid="5247684435979149216">"Апублікаваць праз..."</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>
     <string name="list_delimeter" msgid="3975117572185494152">", "</string>
+    <string name="sending" msgid="3245653681008218030">"Адпраўка..."</string>
+    <string name="launchBrowserDefault" msgid="2057951947297614725">"Запусцiць браўзер?"</string>
+    <string name="SetupCallDefault" msgid="5834948469253758575">"Прыняць выклік?"</string>
 </resources>
diff --git a/core/res/res/values-bg/strings.xml b/core/res/res/values-bg/strings.xml
index 8cc9ba3..6bec103 100644
--- a/core/res/res/values-bg/strings.xml
+++ b/core/res/res/values-bg/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"OK"</string>
     <string name="report" msgid="4060218260984795706">"Подаване на сигнал"</string>
     <string name="wait" msgid="7147118217226317732">"Изчакване"</string>
+    <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>
diff --git a/core/res/res/values-ca/strings.xml b/core/res/res/values-ca/strings.xml
index 4f2aef8..8dced70 100644
--- a/core/res/res/values-ca/strings.xml
+++ b/core/res/res/values-ca/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"D\'acord"</string>
     <string name="report" msgid="4060218260984795706">"Informe"</string>
     <string name="wait" msgid="7147118217226317732">"Espera"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"La pàgina ha deixat de respondre."\n\n"Vols tancar-la?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Aplicació redirigida"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> s\'està executant."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"<xliff:g id="APP_NAME">%1$s</xliff:g> es va iniciar originalment."</string>
diff --git a/core/res/res/values-cs/strings.xml b/core/res/res/values-cs/strings.xml
index bfcf23f..e21de4b 100644
--- a/core/res/res/values-cs/strings.xml
+++ b/core/res/res/values-cs/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"OK"</string>
     <string name="report" msgid="4060218260984795706">"Nahlásit"</string>
     <string name="wait" msgid="7147118217226317732">"Počkat"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"Stránka nereaguje."\n\n"Chcete ji zavřít?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Přesměrování aplikace"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"Je spuštěna aplikace <xliff:g id="APP_NAME">%1$s</xliff:g>."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"Původně byla spuštěna aplikace <xliff:g id="APP_NAME">%1$s</xliff:g>."</string>
diff --git a/core/res/res/values-da/strings.xml b/core/res/res/values-da/strings.xml
index 67b24bc..1175cbb 100644
--- a/core/res/res/values-da/strings.xml
+++ b/core/res/res/values-da/strings.xml
@@ -140,7 +140,7 @@
     <string name="silent_mode_silent" msgid="319298163018473078">"Ringeren er deaktiveret"</string>
     <string name="silent_mode_vibrate" msgid="7072043388581551395">"Ringervibrering"</string>
     <string name="silent_mode_ring" msgid="8592241816194074353">"Ringeren er aktiveret"</string>
-    <string name="shutdown_progress" msgid="2281079257329981203">"Lukker ned ..."</string>
+    <string name="shutdown_progress" msgid="2281079257329981203">"Lukker ned..."</string>
     <string name="shutdown_confirm" product="tablet" msgid="3385745179555731470">"Din tabletcomputer slukkes nu."</string>
     <string name="shutdown_confirm" product="default" msgid="649792175242821353">"Din telefon slukkes nu."</string>
     <string name="shutdown_confirm_question" msgid="2906544768881136183">"Vil du slukke?"</string>
@@ -881,7 +881,7 @@
     <string name="replace" msgid="5781686059063148930">"Erstat..."</string>
     <string name="delete" msgid="6098684844021697789">"Slet"</string>
     <string name="copyUrl" msgid="2538211579596067402">"Kopier webadresse"</string>
-    <string name="selectTextMode" msgid="1018691815143165326">"Marker tekst"</string>
+    <string name="selectTextMode" msgid="1018691815143165326">"Markér tekst"</string>
     <string name="textSelectionCABTitle" msgid="5236850394370820357">"Tekstmarkering"</string>
     <string name="addToDictionary" msgid="9090375111134433012">"føj til ordbog"</string>
     <string name="deleteText" msgid="7070985395199629156">"slet"</string>
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"OK"</string>
     <string name="report" msgid="4060218260984795706">"Rapporter"</string>
     <string name="wait" msgid="7147118217226317732">"Vent"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"Siden svarer ikke."\n\n"Vil du lukke den?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Appen er omdirigeret"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> kører nu."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"<xliff:g id="APP_NAME">%1$s</xliff:g> blev oprindeligt åbnet."</string>
diff --git a/core/res/res/values-de/strings.xml b/core/res/res/values-de/strings.xml
index 7c85323..953897c 100644
--- a/core/res/res/values-de/strings.xml
+++ b/core/res/res/values-de/strings.xml
@@ -684,7 +684,7 @@
     <string name="lockscreen_network_locked_message" msgid="143389224986028501">"Netzwerk gesperrt"</string>
     <string name="lockscreen_sim_puk_locked_message" msgid="7441797339976230">"PUK-Sperre auf SIM"</string>
     <string name="lockscreen_sim_puk_locked_instructions" msgid="8127916255245181063">"Weitere Informationen erhalten Sie im Nutzerhandbuch oder beim Kundendienst."</string>
-    <string name="lockscreen_sim_locked_message" msgid="8066660129206001039">"Bitte PIN eingeben"</string>
+    <string name="lockscreen_sim_locked_message" msgid="8066660129206001039">"PIN eingeben"</string>
     <string name="lockscreen_sim_unlock_progress_dialog_message" msgid="595323214052881264">"SIM-Karte wird entsperrt..."</string>
     <string name="lockscreen_too_many_failed_attempts_dialog_message" msgid="6481623830344107222">"Sie haben Ihr Entsperrungsmuster <xliff:g id="NUMBER_0">%d</xliff:g>-mal falsch gezeichnet. "\n\n"Bitte versuchen Sie es in <xliff:g id="NUMBER_1">%d</xliff:g> Sekunden noch einmal."</string>
     <string name="lockscreen_too_many_failed_password_attempts_dialog_message" msgid="2725973286239344555">"Sie haben Ihr Passwort <xliff:g id="NUMBER_0">%d</xliff:g>-mal falsch eingegeben."\n\n"Bitte versuchen Sie es in <xliff:g id="NUMBER_1">%d</xliff:g> Sekunden noch einmal."</string>
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"OK"</string>
     <string name="report" msgid="4060218260984795706">"Bericht"</string>
     <string name="wait" msgid="7147118217226317732">"Warten"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"Die Seite reagiert nicht mehr."\n\n"Möchten Sie die Seite schließen?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"App umgeleitet"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> wird jetzt ausgeführt."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"<xliff:g id="APP_NAME">%1$s</xliff:g> wurde ursprünglich gestartet."</string>
diff --git a/core/res/res/values-el/strings.xml b/core/res/res/values-el/strings.xml
index aa07f3b..458517c 100644
--- a/core/res/res/values-el/strings.xml
+++ b/core/res/res/values-el/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"ΟΚ"</string>
     <string name="report" msgid="4060218260984795706">"Αναφορά"</string>
     <string name="wait" msgid="7147118217226317732">"Αναμονή"</string>
+    <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>
diff --git a/core/res/res/values-en-rGB/strings.xml b/core/res/res/values-en-rGB/strings.xml
index c1f1b40..d48f544 100644
--- a/core/res/res/values-en-rGB/strings.xml
+++ b/core/res/res/values-en-rGB/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"OK"</string>
     <string name="report" msgid="4060218260984795706">"Report"</string>
     <string name="wait" msgid="7147118217226317732">"Wait"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"The page has become unresponsive."\n\n"Do you want to close it?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"App redirected"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> is now running."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"<xliff:g id="APP_NAME">%1$s</xliff:g> was originally launched."</string>
diff --git a/core/res/res/values-es-rUS/strings.xml b/core/res/res/values-es-rUS/strings.xml
index c7f86d0..c66dc8e 100644
--- a/core/res/res/values-es-rUS/strings.xml
+++ b/core/res/res/values-es-rUS/strings.xml
@@ -86,8 +86,8 @@
     <string name="serviceClassDataSync" msgid="7530000519646054776">"Sincronización"</string>
     <string name="serviceClassPacket" msgid="6991006557993423453">"Paquete"</string>
     <string name="serviceClassPAD" msgid="3235259085648271037">"PAD"</string>
-    <string name="roamingText0" msgid="7170335472198694945">"Indicador de roaming encendido"</string>
-    <string name="roamingText1" msgid="5314861519752538922">"Indicador de roaming apagado"</string>
+    <string name="roamingText0" msgid="7170335472198694945">"Indicador de roaming activado"</string>
+    <string name="roamingText1" msgid="5314861519752538922">"Indicador de roaming desactivado"</string>
     <string name="roamingText2" msgid="8969929049081268115">"Indicador de roaming titilando"</string>
     <string name="roamingText3" msgid="5148255027043943317">"Fuera del vecindario"</string>
     <string name="roamingText4" msgid="8808456682550796530">"Fuera de construcción"</string>
@@ -97,8 +97,8 @@
     <string name="roamingText8" msgid="5989569778604089291">"Roaming: socio premium"</string>
     <string name="roamingText9" msgid="7969296811355152491">"Roaming: funcionalidad de servicio completa"</string>
     <string name="roamingText10" msgid="3992906999815316417">"Roaming: funcionalidad de servicio parcial"</string>
-    <string name="roamingText11" msgid="4154476854426920970">"Banner de roaming encendido"</string>
-    <string name="roamingText12" msgid="1189071119992726320">"Banner de roaming apagado"</string>
+    <string name="roamingText11" msgid="4154476854426920970">"Banner de roaming activado"</string>
+    <string name="roamingText12" msgid="1189071119992726320">"Banner de roaming desactivado"</string>
     <string name="roamingTextSearching" msgid="8360141885972279963">"Buscando servicio"</string>
     <string name="cfTemplateNotForwarded" msgid="1683685883841272560">"<xliff:g id="BEARER_SERVICE_CODE">{0}</xliff:g>: no se ha remitido"</string>
     <string name="cfTemplateForwarded" msgid="1302922117498590521">"<xliff:g id="BEARER_SERVICE_CODE">{0}</xliff:g>: <xliff:g id="DIALING_NUMBER">{1}</xliff:g>"</string>
@@ -128,13 +128,13 @@
     <string name="contentServiceSyncNotificationTitle" msgid="397743349191901458">"Sincronización"</string>
     <string name="contentServiceTooManyDeletesNotificationDesc" msgid="8100981435080696431">"Demasiadas eliminaciones de <xliff:g id="CONTENT_TYPE">%s</xliff:g>"</string>
     <string name="low_memory" product="tablet" msgid="6494019234102154896">"Se ha agotado el espacio de almacenamiento de la tableta. Elimina algunos archivos para liberar espacio."</string>
-    <string name="low_memory" product="default" msgid="3475999286680000541">"Se ha agotado el espacio de almacenamiento del teléfono. Elimina algunos archivos para liberar espacio."</string>
+    <string name="low_memory" product="default" msgid="3475999286680000541">"Se ha agotado el espacio de almacenamiento del dispositivo. Elimina algunos archivos para liberar espacio."</string>
     <string name="me" msgid="6545696007631404292">"Yo"</string>
     <string name="power_dialog" product="tablet" msgid="8545351420865202853">"Opciones de tablet"</string>
-    <string name="power_dialog" product="default" msgid="1319919075463988638">"Opciones de teléfono"</string>
+    <string name="power_dialog" product="default" msgid="1319919075463988638">"Opciones de dispositivo"</string>
     <string name="silent_mode" msgid="7167703389802618663">"Modo silencioso"</string>
-    <string name="turn_on_radio" msgid="3912793092339962371">"Encender el teléfono inalámbrico"</string>
-    <string name="turn_off_radio" msgid="8198784949987062346">"Apagar el teléfono inalámbrico"</string>
+    <string name="turn_on_radio" msgid="3912793092339962371">"Activar conexión inalámbrica"</string>
+    <string name="turn_off_radio" msgid="8198784949987062346">"Desactivar conexión inalámbrica"</string>
     <string name="screen_lock" msgid="799094655496098153">"Bloqueo de pantalla"</string>
     <string name="power_off" msgid="4266614107412865048">"Apagar"</string>
     <string name="silent_mode_silent" msgid="319298163018473078">"Timbre desactivado"</string>
@@ -142,30 +142,30 @@
     <string name="silent_mode_ring" msgid="8592241816194074353">"Timbre activado"</string>
     <string name="shutdown_progress" msgid="2281079257329981203">"Apagando…"</string>
     <string name="shutdown_confirm" product="tablet" msgid="3385745179555731470">"Tu tablet se apagará."</string>
-    <string name="shutdown_confirm" product="default" msgid="649792175242821353">"Tu teléfono se apagará."</string>
+    <string name="shutdown_confirm" product="default" msgid="649792175242821353">"Tu dispositivo se apagará."</string>
     <string name="shutdown_confirm_question" msgid="2906544768881136183">"¿Deseas apagarlo?"</string>
     <string name="recent_tasks_title" msgid="3691764623638127888">"Reciente"</string>
     <string name="no_recent_tasks" msgid="8794906658732193473">"No hay aplicaciones recientes."</string>
     <string name="global_actions" product="tablet" msgid="408477140088053665">"Opciones de tablet"</string>
-    <string name="global_actions" product="default" msgid="2406416831541615258">"Opciones de teléfono"</string>
+    <string name="global_actions" product="default" msgid="2406416831541615258">"Opciones de dispositivo"</string>
     <string name="global_action_lock" msgid="2844945191792119712">"Bloqueo de pantalla"</string>
     <string name="global_action_power_off" msgid="4471879440839879722">"Apagar"</string>
     <string name="global_action_toggle_silent_mode" msgid="8219525344246810925">"Modo silencioso"</string>
-    <string name="global_action_silent_mode_on_status" msgid="3289841937003758806">"El sonido está Apagado"</string>
-    <string name="global_action_silent_mode_off_status" msgid="1506046579177066419">"El sonido está Encendido"</string>
+    <string name="global_action_silent_mode_on_status" msgid="3289841937003758806">"El sonido está Desactivado"</string>
+    <string name="global_action_silent_mode_off_status" msgid="1506046579177066419">"El sonido está Activado"</string>
     <string name="global_actions_toggle_airplane_mode" msgid="5884330306926307456">"Modo avión"</string>
-    <string name="global_actions_airplane_mode_on_status" msgid="2719557982608919750">"El modo avión está Encendido"</string>
-    <string name="global_actions_airplane_mode_off_status" msgid="5075070442854490296">"El modo avión está Apagado"</string>
+    <string name="global_actions_airplane_mode_on_status" msgid="2719557982608919750">"El modo avión está Activado"</string>
+    <string name="global_actions_airplane_mode_off_status" msgid="5075070442854490296">"El modo avión está Desactivado"</string>
     <string name="status_bar_notification_info_overflow" msgid="5301981741705354993">"999+"</string>
     <string name="safeMode" msgid="2788228061547930246">"Modo seguro"</string>
     <string name="android_system_label" msgid="6577375335728551336">"Sistema Android"</string>
     <string name="permgrouplab_costMoney" msgid="5429808217861460401">"Servicios que te cuestan dinero"</string>
     <string name="permgroupdesc_costMoney" msgid="3293301903409869495">"Permite que las aplicaciones realicen actividades con cargo."</string>
     <string name="permgrouplab_messages" msgid="7521249148445456662">"Tus mensajes"</string>
-    <string name="permgroupdesc_messages" msgid="7821999071003699236">"Lee y escribe tus SMS, mensajes de correo electrónico y otros mensajes."</string>
+    <string name="permgroupdesc_messages" msgid="7821999071003699236">"Lee y escribe tus SMS, mensajes de correo y otros mensajes."</string>
     <string name="permgrouplab_personalInfo" msgid="3519163141070533474">"Tu información personal"</string>
-    <string name="permgroupdesc_personalInfo" product="tablet" msgid="6975389054186265786">"Acceso directo a los contactos y calendario guardados en tu teléfono."</string>
-    <string name="permgroupdesc_personalInfo" product="default" msgid="5488050357388806068">"Acceso directo a tus contactos y calendario guardado en el teléfono."</string>
+    <string name="permgroupdesc_personalInfo" product="tablet" msgid="6975389054186265786">"Acceso directo a los contactos y calendario guardados en tu dispositivo."</string>
+    <string name="permgroupdesc_personalInfo" product="default" msgid="5488050357388806068">"Acceso directo a tus contactos y calendario guardado en el dispositivo."</string>
     <string name="permgrouplab_location" msgid="635149742436692049">"Tu ubicación"</string>
     <string name="permgroupdesc_location" msgid="5704679763124170100">"Controlar tu ubicación física"</string>
     <string name="permgrouplab_network" msgid="5808983377727109831">"Comunicación de red"</string>
@@ -173,7 +173,7 @@
     <string name="permgrouplab_accounts" msgid="3359646291125325519">"Tus cuentas"</string>
     <string name="permgroupdesc_accounts" msgid="4948732641827091312">"Acceder a las cuentas disponibles."</string>
     <string name="permgrouplab_hardwareControls" msgid="7998214968791599326">"Controles de hardware"</string>
-    <string name="permgroupdesc_hardwareControls" msgid="4357057861225462702">"Acceso directo al hardware en el teléfono."</string>
+    <string name="permgroupdesc_hardwareControls" msgid="4357057861225462702">"Acceso directo al hardware en el dispositivo."</string>
     <string name="permgrouplab_phoneCalls" msgid="9067173988325865923">"Llamadas telefónicas"</string>
     <string name="permgroupdesc_phoneCalls" msgid="7489701620446183770">"Controlar, grabar y procesar llamadas telefónicas."</string>
     <string name="permgrouplab_systemTools" msgid="4652191644082714048">"Herramientas del sistema"</string>
@@ -203,10 +203,10 @@
     <string name="permdesc_sendSmsNoConfirmation" msgid="3437759207020400204">"Permite que la aplicación envíe mensajes SMS. Las aplicaciones maliciosas pueden generar gastos a causa del envío de mensajes sin tu confirmación."</string>
     <string name="permlab_readSms" msgid="4085333708122372256">"leer SMS o MMS"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2341692916884515613">"Permite que la aplicación lea mensajes SMS almacenados en tu tableta o tarjeta SIM. Las aplicaciones maliciosas pueden leer tus mensajes confidenciales."</string>
-    <string name="permdesc_readSms" product="default" msgid="5653850482025875493">"Permite que la aplicación lea mensajes SMS almacenados en tu teléfono o tarjeta SIM. Las aplicaciones maliciosas pueden leer tus mensajes confidenciales."</string>
+    <string name="permdesc_readSms" product="default" msgid="5653850482025875493">"Permite que la aplicación lea mensajes SMS almacenados en tu dispositivo o tarjeta SIM. Las aplicaciones maliciosas pueden leer tus mensajes confidenciales."</string>
     <string name="permlab_writeSms" msgid="6881122575154940744">"editar SMS o MMS"</string>
     <string name="permdesc_writeSms" product="tablet" msgid="5160413947794501538">"Permite que la aplicación escriba en mensajes SMS almacenados en tu tableta o tarjeta SIM. Las aplicaciones maliciosas pueden eliminar tus mensajes."</string>
-    <string name="permdesc_writeSms" product="default" msgid="7268668709052328567">"Permite que la aplicación escriba en mensajes SMS almacenados en tu teléfono o tarjeta SIM. Las aplicaciones maliciosas pueden eliminar tus mensajes."</string>
+    <string name="permdesc_writeSms" product="default" msgid="7268668709052328567">"Permite que la aplicación escriba en mensajes SMS almacenados en tu dispositivo o tarjeta SIM. Las aplicaciones maliciosas pueden eliminar tus mensajes."</string>
     <string name="permlab_receiveWapPush" msgid="8258226427716551388">"recibir WAP"</string>
     <string name="permdesc_receiveWapPush" msgid="7983455145335316872">"Permite que la aplicación reciba y procese mensajes WAP. Las aplicaciones maliciosas pueden controlar tus mensajes o eliminarlos sin mostrártelos."</string>
     <string name="permlab_getTasks" msgid="6466095396623933906">"recuperar aplicaciones en ejecución"</string>
@@ -215,11 +215,11 @@
     <string name="permdesc_reorderTasks" msgid="4175137612205663399">"Permite que la aplicación mueva tareas al primero o segundo plano. Las aplicaciones maliciosas pueden forzar su paso al primer plano sin que tú las controles."</string>
     <string name="permlab_removeTasks" msgid="6821513401870377403">"detener las aplicaciones en ejecución"</string>
     <string name="permdesc_removeTasks" msgid="1394714352062635493">"Permite que la aplicación elimine tareas y cierre sus aplicaciones. Las aplicaciones malintencionadas pueden usar este permiso para interferir en el comportamiento de otras aplicaciones."</string>
-    <string name="permlab_setDebugApp" msgid="3022107198686584052">"habilitar depuración de aplicación"</string>
+    <string name="permlab_setDebugApp" msgid="3022107198686584052">"activar depuración de aplicación"</string>
     <string name="permdesc_setDebugApp" msgid="4474512416299013256">"Permite que la aplicación active la depuración de otra aplicación. Las aplicaciones malintencionadas pueden usar este permiso para interrumpir la ejecución de otras aplicaciones."</string>
     <string name="permlab_changeConfiguration" msgid="8214475779521218295">"cambiar tu configuración de la interfaz de usuario"</string>
     <string name="permdesc_changeConfiguration" msgid="4372223873154296076">"Permite que la aplicación cambie la configuración actual como, por ejemplo, la configuración regional o el tamaño de fuente general."</string>
-    <string name="permlab_enableCarMode" msgid="5684504058192921098">"habilitar el modo de auto"</string>
+    <string name="permlab_enableCarMode" msgid="5684504058192921098">"activar el modo de auto"</string>
     <string name="permdesc_enableCarMode" msgid="4853187425751419467">"Permite que la aplicación habilite el modo coche."</string>
     <string name="permlab_killBackgroundProcesses" msgid="8373714752793061963">"eliminar los procesos de fondo"</string>
     <string name="permdesc_killBackgroundProcesses" msgid="931129103262126617">"Permite que la aplicación elimine procesos de otras aplicaciones que se ejecutan en segundo plano, aunque haya suficiente memoria."</string>
@@ -263,7 +263,7 @@
     <string name="permdesc_manageAppTokens" msgid="8043431713014395671">"Permite que la aplicación cree y administre sus propios tokens al ignorar su orden z normal. Las aplicaciones normales no deben utilizar este permiso."</string>
     <string name="permlab_injectEvents" msgid="1378746584023586600">"presionar teclas y botones de control"</string>
     <string name="permdesc_injectEvents" product="tablet" msgid="206352565599968632">"Permite que la aplicación ofrezca sus propios eventos de entrada (pulsaciones de teclas, etc.) a otras aplicaciones. Las aplicaciones maliciosas pueden utilizar este permiso para controlar la tableta."</string>
-    <string name="permdesc_injectEvents" product="default" msgid="653128057572326253">"Permite que la aplicación ofrezca sus propios eventos de entrada (pulsaciones de teclas, etc.) a otras aplicaciones. Las aplicaciones maliciosas pueden utilizar este permiso para controlar el teléfono."</string>
+    <string name="permdesc_injectEvents" product="default" msgid="653128057572326253">"Permite que la aplicación ofrezca sus propios eventos de entrada (pulsaciones de teclas, etc.) a otras aplicaciones. Las aplicaciones maliciosas pueden utilizar este permiso para controlar el dispositivo."</string>
     <string name="permlab_readInputState" msgid="469428900041249234">"grabar tu tipo y las medidas que tomes"</string>
     <string name="permdesc_readInputState" msgid="8387754901688728043">"Permite que la aplicación observe las teclas que presionas, incluso al interactuar con otra aplicación (como cuando escribes una contraseña). Las aplicaciones normales no deberían necesitar este permiso."</string>
     <string name="permlab_bindInputMethod" msgid="3360064620230515776">"vincular a un método de entrada"</string>
@@ -298,19 +298,19 @@
     <string name="permdesc_installPackages" msgid="5628530972548071284">"Permite que la aplicación instale paquetes de Android nuevos o actualizados. Las aplicaciones maliciosas pueden utilizar este permiso para agregar nuevas aplicaciones con permisos arbitrarios potentes."</string>
     <string name="permlab_clearAppCache" msgid="7487279391723526815">"eliminar todos los datos de caché de la aplicación"</string>
     <string name="permdesc_clearAppCache" product="tablet" msgid="3523396284474042284">"Permite que la aplicación libere almacenamiento en la tableta al eliminar archivos en el directorio caché de la aplicación. El acceso al proceso del sistema suele ser muy restringido."</string>
-    <string name="permdesc_clearAppCache" product="default" msgid="5067988373366292186">"Permite que la aplicación libere espacio de almacenamiento en el teléfono al eliminar archivos en el directorio caché de la aplicación. El acceso al proceso del sistema suele ser muy restringido."</string>
+    <string name="permdesc_clearAppCache" product="default" msgid="5067988373366292186">"Permite que la aplicación libere espacio de almacenamiento en el dispositivo al eliminar archivos en el directorio caché de la aplicación. El acceso al proceso del sistema suele ser muy restringido."</string>
     <string name="permlab_movePackage" msgid="3289890271645921411">"mover recursos de la aplicación"</string>
     <string name="permdesc_movePackage" msgid="319562217778244524">"Permite que la aplicación traslade recursos de la aplicación de medios internos a medios externos y viceversa."</string>
     <string name="permlab_readLogs" msgid="6615778543198967614">"lee los datos confidenciales del registro"</string>
     <string name="permdesc_readLogs" product="tablet" msgid="82061313293455151">"Permite que la aplicación lea diversos archivos de registro del sistema. Esto le permite descubrir información general acerca de lo que haces con la tableta, lo que podría incluir información personal o privada."</string>
-    <string name="permdesc_readLogs" product="default" msgid="2063438140241560443">"Permite que la aplicación lea los diversos archivos de registro del sistema. Esto le permite descubrir información general acerca de lo que haces con el teléfono, que puede incluir información personal o privada."</string>
+    <string name="permdesc_readLogs" product="default" msgid="2063438140241560443">"Permite que la aplicación lea los diversos archivos de registro del sistema. Esto le permite descubrir información general acerca de lo que haces con el dispositivo, que puede incluir información personal o privada."</string>
     <string name="permlab_anyCodecForPlayback" msgid="715805555823881818">"Usar cualquier decodificador de medios para la reproducción"</string>
     <string name="permdesc_anyCodecForPlayback" msgid="8283912488433189010">"Permite que la aplicación use cualquier decodificador de archivos multimedia instalado para la reproducción."</string>
     <string name="permlab_diagnostic" msgid="8076743953908000342">"leer y escribir a recursos dentro del grupo de diagnóstico"</string>
     <string name="permdesc_diagnostic" msgid="6608295692002452283">"Permite que la aplicación lea y escriba en cualquier recurso propiedad del grupo de diagnóstico como, por ejemplo, archivos in/dev. Este permiso podría afectar la seguridad y estabilidad del sistema. SOLO se debe utilizar para diagnósticos específicos de hardware realizados por el fabricante o el operador."</string>
     <string name="permlab_changeComponentState" msgid="6335576775711095931">"activar o desactivar componentes de la aplicación"</string>
-    <string name="permdesc_changeComponentState" product="tablet" msgid="8887435740982237294">"Permite que la aplicación determine si un componente de otra aplicación está habilitado o no. Las aplicaciones maliciosas pueden utilizar este permiso para inhabilitar funciones importantes de la tableta. Es necesario ser precavido con este permiso, ya que es posible que los componentes de la aplicación queden inservibles, incoherentes o inestables."</string>
-    <string name="permdesc_changeComponentState" product="default" msgid="1827232484416505615">"Permite que la aplicación determine si un componente de otra aplicación está habilitado o no. Las aplicaciones maliciosas pueden utilizar este permiso para inhabilitar funciones importantes del teléfono. Es necesario ser precavido con este permiso, ya que es posible que los componentes de la aplicación queden inservibles, incoherentes o inestables."</string>
+    <string name="permdesc_changeComponentState" product="tablet" msgid="8887435740982237294">"Permite que la aplicación determine si un componente de otra aplicación está habilitado o no. Las aplicaciones maliciosas pueden utilizar este permiso para desactivar funciones importantes de la tableta. Es necesario ser precavido con este permiso, ya que es posible que los componentes de la aplicación queden inservibles, incoherentes o inestables."</string>
+    <string name="permdesc_changeComponentState" product="default" msgid="1827232484416505615">"Permite que la aplicación determine si un componente de otra aplicación está habilitado o no. Las aplicaciones maliciosas pueden utilizar este permiso para desactivar funciones importantes del dispositivo. Es necesario ser precavido con este permiso, ya que es posible que los componentes de la aplicación queden inservibles, incoherentes o inestables."</string>
     <string name="permlab_setPreferredApplications" msgid="8463181628695396391">"establecer aplicaciones preferidas"</string>
     <string name="permdesc_setPreferredApplications" msgid="4973986762241783712">"Permite que la aplicación modifique tus aplicaciones preferidas. Las aplicaciones maliciosas pueden modificar sin aviso las aplicaciones que se ejecutan y así engañar a tus aplicaciones existentes para que recopilen tu información privada."</string>
     <string name="permlab_writeSettings" msgid="1365523497395143704">"modificar la configuración global del sistema"</string>
@@ -321,16 +321,16 @@
     <string name="permdesc_writeGservices" msgid="1287309437638380229">"Permite que la aplicación modifique el mapa de servicios de Google. Las aplicaciones normales no deben utilizar este permiso."</string>
     <string name="permlab_receiveBootCompleted" msgid="7776779842866993377">"ejecutar automáticamente al iniciar"</string>
     <string name="permdesc_receiveBootCompleted" product="tablet" msgid="7390304664116880704">"Permite que la aplicación se inicie en cuanto el sistema haya finalizado la inicialización. Esto puede ocasionar que la tableta tarde más en inicializarse y que la aplicación ralentice el funcionamiento general de la tableta al estar en ejecución constante."</string>
-    <string name="permdesc_receiveBootCompleted" product="default" msgid="513950589102617504">"Permite que la aplicación se inicie en cuanto el sistema haya finalizado la inicialización. Esto puede ocasionar que el teléfono tarde más en inicializarse y que la aplicación ralentice el funcionamiento general del teléfono al estar en ejecución constante."</string>
+    <string name="permdesc_receiveBootCompleted" product="default" msgid="513950589102617504">"Permite que la aplicación se inicie en cuanto el sistema haya finalizado la inicialización. Esto puede ocasionar que el dispositivo tarde más en inicializarse y que la aplicación ralentice el funcionamiento general del dispositivo al estar en ejecución constante."</string>
     <string name="permlab_broadcastSticky" msgid="7919126372606881614">"enviar emisiones pegajosas"</string>
     <string name="permdesc_broadcastSticky" product="tablet" msgid="1181582512022829259">"Permite que la aplicación envíe transmisiones persistentes que permanecen luego de que finaliza la transmisión. Las aplicaciones maliciosas pueden hacer que la tableta funcione más lentamente o de manera inestable al forzarla a utilizar mucha memoria."</string>
-    <string name="permdesc_broadcastSticky" product="default" msgid="3287869131621514325">"Permite que la aplicación envíe transmisiones persistentes que permanecen luego de que finaliza la transmisión. Las aplicaciones maliciosas pueden hacer que el teléfono funcione más lento o de manera inestable al forzarlo a utilizar mucha memoria."</string>
+    <string name="permdesc_broadcastSticky" product="default" msgid="3287869131621514325">"Permite que la aplicación envíe transmisiones persistentes que permanecen luego de que finaliza la transmisión. Las aplicaciones maliciosas pueden hacer que el dispositivo funcione más lento o de manera inestable al forzarlo a utilizar mucha memoria."</string>
     <string name="permlab_readContacts" msgid="6219652189510218240">"leer datos de contacto"</string>
     <string name="permdesc_readContacts" product="tablet" msgid="4028657556924039119">"Permite que la aplicación lea todos los datos de contacto (direcciones) almacenados en tu tableta. Las aplicaciones maliciosas pueden usar este permiso para enviar tus datos a otras personas."</string>
-    <string name="permdesc_readContacts" product="default" msgid="2032222056456498547">"Permite que la aplicación lea todos los datos de contacto (direcciones) almacenados en tu teléfono. Las aplicaciones maliciosas pueden utilizar este permiso para enviar tus datos a otro teléfono."</string>
+    <string name="permdesc_readContacts" product="default" msgid="2032222056456498547">"Permite que la aplicación lea todos los datos de contacto (direcciones) almacenados en tu dispositivo. Las aplicaciones maliciosas pueden utilizar este permiso para enviar tus datos a otro dispositivo."</string>
     <string name="permlab_writeContacts" msgid="644616215860933284">"escribir datos de contacto"</string>
     <string name="permdesc_writeContacts" product="tablet" msgid="988969759110632978">"Permite que la aplicación modifique la información de contacto (dirección) almacenada en tu tableta. Las aplicaciones maliciosas pueden utilizar este permiso para borrar o modificar tu información de contacto."</string>
-    <string name="permdesc_writeContacts" product="default" msgid="5075164818647934067">"Permite que la aplicación modifique la información de contacto (dirección) almacenada en tu teléfono. Las aplicaciones maliciosas pueden utilizar este permiso para borrar o modificar tu información de contacto."</string>
+    <string name="permdesc_writeContacts" product="default" msgid="5075164818647934067">"Permite que la aplicación modifique la información de contacto (dirección) almacenada en tu dispositivo. Las aplicaciones maliciosas pueden utilizar este permiso para borrar o modificar tu información de contacto."</string>
     <string name="permlab_readProfile" msgid="6824681438529842282">"Leer tus datos de perfil"</string>
     <string name="permdesc_readProfile" product="default" msgid="94520753797630679">"Permite que la aplicación lea la información de perfil almacenada en tu dispositivo, como tu nombre e información de contacto. Esto significa que la aplicación puede identificarte y enviar tu información de perfil a otros."</string>
     <string name="permlab_writeProfile" msgid="4679878325177177400">"Escrib. en datos de tu perfil"</string>
@@ -341,8 +341,8 @@
     <string name="permdesc_writeSocialStream" product="default" msgid="3496277176955721451">"Permite que la aplicación muestre las actualizaciones sociales de tus amigos. Las aplicaciones maliciosas pueden usar este permiso para hacerse pasar por un amigo y engañarte para que reveles contraseñas u otros datos confidenciales."</string>
     <string name="permlab_readCalendar" msgid="5972727560257612398">"Leer eventos de calendario e información confidencial"</string>
     <string name="permdesc_readCalendar" product="tablet" msgid="2338414551004122687">"Permite que la aplicación lea todos los eventos del calendario almacenados en tu tableta, incluidos los de amigos o compañeros de trabajo. Las aplicaciones maliciosas pueden extraer información personal de esos calendarios sin que los propietarios lo sepan."</string>
-    <string name="permdesc_readCalendar" product="default" msgid="5693933067751827753">"Permite que la aplicación lea todos los eventos del calendario almacenados en tu teléfono, incluidos los de amigos o compañeros de trabajo. Las aplicaciones maliciosas pueden extraer información personal de esos calendarios sin que los propietarios lo sepan."</string>
-    <string name="permlab_writeCalendar" msgid="8438874755193825647">"Agregar o modificar los eventos de calendario y enviar un correo electrónico a los invitados sin que los propietarios lo sepan"</string>
+    <string name="permdesc_readCalendar" product="default" msgid="5693933067751827753">"Permite que la aplicación lea todos los eventos del calendario almacenados en tu dispositivo, incluidos los de amigos o compañeros de trabajo. Las aplicaciones maliciosas pueden extraer información personal de esos calendarios sin que los propietarios lo sepan."</string>
+    <string name="permlab_writeCalendar" msgid="8438874755193825647">"Agregar o modificar los eventos de calendario y enviar un correo a los invitados sin que los propietarios lo sepan"</string>
     <string name="permdesc_writeCalendar" msgid="2243771395254848873">"Permite que la aplicación envíe invitaciones a eventos como propietario del calendario, y que agregue, elimine y cambie eventos que puedes modificar en tu dispositivo, incluidos los de tus amigos o compañeros de trabajo. Las aplicaciones maliciosas pueden enviar correos electrónicos de spam que aparenten provenir de propietarios de calendarios, modificar eventos sin que el propietario lo sepa o agregar eventos falsos."</string>
     <string name="permlab_accessMockLocation" msgid="8688334974036823330">"crear fuentes de ubicación de prueba"</string>
     <string name="permdesc_accessMockLocation" msgid="7577931556422993949">"Permite que la aplicación cree fuentes de ubicación simuladas para pruebas. Las aplicaciones maliciosas pueden utilizar este permiso para anular la ubicación o el estado que devuelven las fuentes de ubicación actuales, como los proveedores de GPS o redes."</string>
@@ -352,10 +352,10 @@
     <string name="permdesc_installLocationProvider" msgid="1742577679350078373">"Crear fuentes de ubicación simuladas para pruebas. Las aplicaciones maliciosas pueden utilizar esta opción para anular la ubicación o el estado que devuelven las fuentes de ubicación reales, como los proveedores de GPS o redes, o para monitorear e informar tu ubicación a una fuente externa."</string>
     <string name="permlab_accessFineLocation" msgid="8116127007541369477">"ubicación precisa (GPS)"</string>
     <string name="permdesc_accessFineLocation" product="tablet" msgid="5326423948268164934">"Permite acceder a las fuentes de ubicación precisas, como el sistema de posicionamiento global en la tableta, si está disponible. Las aplicaciones maliciosas pueden utilizar este permiso para determinar dónde te encuentras y pueden consumir batería adicional."</string>
-    <string name="permdesc_accessFineLocation" product="default" msgid="7130267914433890869">"Permite acceder a las fuentes de ubicación precisa, como el sistema de posicionamiento global del teléfono, si está disponible. Las aplicaciones maliciosas pueden utilizar este permiso para determinar dónde te encuentras y pueden consumir batería adicional."</string>
+    <string name="permdesc_accessFineLocation" product="default" msgid="7130267914433890869">"Permite acceder a las fuentes de ubicación precisa, como el sistema de posicionamiento global del dispositivo, si está disponible. Las aplicaciones maliciosas pueden utilizar este permiso para determinar dónde te encuentras y pueden consumir batería adicional."</string>
     <string name="permlab_accessCoarseLocation" msgid="4642255009181975828">"ubicación aproximada (basada en la red)"</string>
     <string name="permdesc_accessCoarseLocation" product="tablet" msgid="5460726396318105483">"Permite acceder a las fuentes de ubicación aproximada, como la base de datos de la red para celulares, para determinar la ubicación aproximada de una tableta, si está disponible. Las aplicaciones maliciosas pueden utilizar este permiso para determinar tu ubicación aproximada."</string>
-    <string name="permdesc_accessCoarseLocation" product="default" msgid="8900795778057579522">"Permite acceder a fuentes de ubicación aproximada como, por ejemplo, la base de datos de la red para celulares, para determinar la ubicación aproximada de un teléfono, si está disponible. Las aplicaciones maliciosas pueden utilizar este permiso para determinar tu ubicación aproximada."</string>
+    <string name="permdesc_accessCoarseLocation" product="default" msgid="8900795778057579522">"Permite acceder a fuentes de ubicación aproximada como, por ejemplo, la base de datos de la red para celulares, para determinar la ubicación aproximada de un dispositivo, si está disponible. Las aplicaciones maliciosas pueden utilizar este permiso para determinar tu ubicación aproximada."</string>
     <string name="permlab_accessSurfaceFlinger" msgid="2363969641792388947">"acceder a SurfaceFlinger"</string>
     <string name="permdesc_accessSurfaceFlinger" msgid="1041619516733293551">"Permite que la aplicación utilice funciones de SurfaceFlinger de bajo nivel."</string>
     <string name="permlab_readFrameBuffer" msgid="6690504248178498136">"leer el búfer de tramas"</string>
@@ -366,14 +366,14 @@
     <string name="permdesc_recordAudio" msgid="2387462233976248635">"Permite que la aplicación acceda a la ruta de grabación de audio."</string>
     <string name="permlab_camera" msgid="3616391919559751192">"tomar fotografías y grabar videos"</string>
     <string name="permdesc_camera" msgid="1507407407002492176">"Permite que la aplicación tome fotografías y grabe videos con la cámara. De este modo, la aplicación puede obtener las imágenes que capta la cámara en cualquier momento."</string>
-    <string name="permlab_brick" product="tablet" msgid="2961292205764488304">"inhabilitar tablet de forma permanente"</string>
-    <string name="permlab_brick" product="default" msgid="8337817093326370537">"desactivar teléfono de manera permanente"</string>
+    <string name="permlab_brick" product="tablet" msgid="2961292205764488304">"desactivar tablet de forma permanente"</string>
+    <string name="permlab_brick" product="default" msgid="8337817093326370537">"desactivar dispositivo de manera permanente"</string>
     <string name="permdesc_brick" product="tablet" msgid="4334818808001699530">"Permite que la aplicación inhabilite toda la tableta de manera permanente. Esto es muy peligroso."</string>
-    <string name="permdesc_brick" product="default" msgid="5788903297627283099">"Permite que la aplicación inhabilite el teléfono de forma permanente. Este permiso es muy peligroso."</string>
+    <string name="permdesc_brick" product="default" msgid="5788903297627283099">"Permite que la aplicación inhabilite el dispositivo de forma permanente. Este permiso es muy peligroso."</string>
     <string name="permlab_reboot" product="tablet" msgid="3436634972561795002">"forzar reinicio del tablet"</string>
-    <string name="permlab_reboot" product="default" msgid="2898560872462638242">"forzar reinicio del teléfono"</string>
+    <string name="permlab_reboot" product="default" msgid="2898560872462638242">"forzar reinicio del dispositivo"</string>
     <string name="permdesc_reboot" product="tablet" msgid="8172056180063700741">"Permite que la aplicación provoque el reinicio de la tableta."</string>
-    <string name="permdesc_reboot" product="default" msgid="5326008124289989969">"Permite que la aplicación fuerce el reinicio del teléfono."</string>
+    <string name="permdesc_reboot" product="default" msgid="5326008124289989969">"Permite que la aplicación fuerce el reinicio del dispositivo."</string>
     <string name="permlab_mount_unmount_filesystems" msgid="1761023272170956541">"montar y desmontar filesystems"</string>
     <string name="permdesc_mount_unmount_filesystems" msgid="1829290701658992347">"Permite que la aplicación active y desactive sistemas de archivos para un almacenamiento extraíble."</string>
     <string name="permlab_mount_format_filesystems" msgid="5523285143576718981">"espacio de almacenamiento externo del formato"</string>
@@ -403,7 +403,7 @@
     <string name="permlab_callPrivileged" msgid="4198349211108497879">"llamar directamente a cualquier número de teléfono"</string>
     <string name="permdesc_callPrivileged" msgid="1689024901509996810">"Permite que la aplicación llame a cualquier número de teléfono, incluidos números de emergencia, sin tu intervención. Las aplicaciones maliciosas pueden realizar llamadas innecesarias e ilegales a servicios de emergencia."</string>
     <string name="permlab_performCdmaProvisioning" product="tablet" msgid="4842576994144604821">"iniciar directamente la configuración CDMA del tablet"</string>
-    <string name="permlab_performCdmaProvisioning" product="default" msgid="5604848095315421425">"iniciar directamente la configuración CDMA del teléfono"</string>
+    <string name="permlab_performCdmaProvisioning" product="default" msgid="5604848095315421425">"iniciar directamente la configuración CDMA del dispositivo"</string>
     <string name="permdesc_performCdmaProvisioning" msgid="1994193538802314186">"Permite que la aplicación inicie el método de acceso CDMA. Las aplicaciones maliciosas pueden iniciar el método CDMA de forma innecesaria."</string>
     <string name="permlab_locationUpdates" msgid="7785408253364335740">"controlar las notificaciones de actualización de ubicación"</string>
     <string name="permdesc_locationUpdates" msgid="1120741557891438876">"Permite que la aplicación habilite/deshabilite notificaciones de actualización de ubicación de la radio. Las aplicaciones normales no deben utilizar este permiso."</string>
@@ -411,21 +411,21 @@
     <string name="permdesc_checkinProperties" msgid="4024526968630194128">"Permite que la aplicación lea/escriba el acceso a propiedades subidas por el servicio de registro. Las aplicaciones normales no deben usar este permiso."</string>
     <string name="permlab_bindGadget" msgid="776905339015863471">"elegir widgets"</string>
     <string name="permdesc_bindGadget" msgid="8261326938599049290">"Permite que la aplicación le indique al sistema qué widgets se pueden utilizar con cada aplicación. Una aplicación con este permiso puede proporcionar acceso a información personal por parte de otras aplicaciones. Las aplicaciones normales no deben utilizar este permiso."</string>
-    <string name="permlab_modifyPhoneState" msgid="8423923777659292228">"modificar el estado del teléfono"</string>
+    <string name="permlab_modifyPhoneState" msgid="8423923777659292228">"modificar el estado del dispositivo"</string>
     <string name="permdesc_modifyPhoneState" msgid="1029877529007686732">"Permite que la aplicación controle las funciones de teléfono del dispositivo. Una aplicación con este permiso puede cambiar redes, encender y apagar la radio del teléfono y tareas similares sin siquiera notificártelo."</string>
-    <string name="permlab_readPhoneState" msgid="2326172951448691631">"leer el estado del teléfono y la identidad"</string>
+    <string name="permlab_readPhoneState" msgid="2326172951448691631">"leer el estado del dispositivo y la identidad"</string>
     <string name="permdesc_readPhoneState" msgid="5127767618743602782">"Permite que la aplicación acceda a las funciones de teléfono del dispositivo. Una aplicación con este permiso puede determinar el número de teléfono y el número de serie del teléfono, si hay una llamada activa, el número al que esa llamada está conectada, etc."</string>
     <string name="permlab_wakeLock" product="tablet" msgid="1531731435011495015">"evitar que el tablet entre en estado de inactividad"</string>
-    <string name="permlab_wakeLock" product="default" msgid="573480187941496130">"evitar que el teléfono entre en estado de inactividad"</string>
+    <string name="permlab_wakeLock" product="default" msgid="573480187941496130">"evitar que el dispositivo entre en estado de inactividad"</string>
     <string name="permdesc_wakeLock" product="tablet" msgid="7311319824400447868">"Permite que la aplicación evite que la tableta entre en estado de inactividad."</string>
-    <string name="permdesc_wakeLock" product="default" msgid="8559100677372928754">"Permite que la aplicación evite que el teléfono entre en estado de inactividad."</string>
+    <string name="permdesc_wakeLock" product="default" msgid="8559100677372928754">"Permite que la aplicación evite que el dispositivo entre en estado de inactividad."</string>
     <string name="permlab_devicePower" product="tablet" msgid="2787034722616350417">"apagar o encender el tablet"</string>
-    <string name="permlab_devicePower" product="default" msgid="4928622470980943206">"apagar o encender el teléfono"</string>
+    <string name="permlab_devicePower" product="default" msgid="4928622470980943206">"apagar o encender el dispositivo"</string>
     <string name="permdesc_devicePower" product="tablet" msgid="6689862878984631831">"Permite que la aplicación encienda o apague la tableta."</string>
-    <string name="permdesc_devicePower" product="default" msgid="6037057348463131032">"Permite que la aplicación encienda o apague el teléfono."</string>
+    <string name="permdesc_devicePower" product="default" msgid="6037057348463131032">"Permite que la aplicación encienda o apague el dispositivo."</string>
     <string name="permlab_factoryTest" msgid="3715225492696416187">"ejecutar en el modo de prueba de fábrica"</string>
     <string name="permdesc_factoryTest" product="tablet" msgid="3952059318359653091">"Se ejecuta como una prueba de fábrica de bajo nivel que permite un acceso completo al hardware del tablet. Sólo disponible cuando el tablet se ejecuta en el modo de prueba de fábrica."</string>
-    <string name="permdesc_factoryTest" product="default" msgid="8136644990319244802">"Se ejecuta como una prueba de fábrica de bajo nivel que permite un acceso completo al hardware del teléfono. Sólo disponible cuando un teléfono se ejecuta en el modo de prueba de fábrica."</string>
+    <string name="permdesc_factoryTest" product="default" msgid="8136644990319244802">"Se ejecuta como una prueba de fábrica de bajo nivel que permite un acceso completo al hardware del dispositivo. Sólo disponible cuando un dispositivo se ejecuta en el modo de prueba de fábrica."</string>
     <string name="permlab_setWallpaper" msgid="6627192333373465143">"establecer papel tapiz"</string>
     <string name="permdesc_setWallpaper" msgid="7373447920977624745">"Permite que la aplicación establezca el fondo de pantalla del sistema."</string>
     <string name="permlab_setWallpaperHints" msgid="3600721069353106851">"establecer sugerencias de tamaño del papel tapiz"</string>
@@ -434,15 +434,15 @@
     <string name="permdesc_masterClear" msgid="3665380492633910226">"Permite que la aplicación restablezca por completo el sistema a su configuración de fábrica al eliminar todos los datos, la configuración y las aplicaciones instaladas."</string>
     <string name="permlab_setTime" msgid="2021614829591775646">"establecer la hora"</string>
     <string name="permdesc_setTime" product="tablet" msgid="1896341438151152881">"Permite que la aplicación cambie la hora del reloj de la tableta."</string>
-    <string name="permdesc_setTime" product="default" msgid="1855702730738020">"Permite que la aplicación cambie la hora del reloj del teléfono."</string>
+    <string name="permdesc_setTime" product="default" msgid="1855702730738020">"Permite que la aplicación cambie la hora del reloj del dispositivo."</string>
     <string name="permlab_setTimeZone" msgid="2945079801013077340">"establecer zona horaria"</string>
     <string name="permdesc_setTimeZone" product="tablet" msgid="1676983712315827645">"Permite que la aplicación cambie la zona horaria de la tableta."</string>
-    <string name="permdesc_setTimeZone" product="default" msgid="4499943488436633398">"Permite que la aplicación cambie la zona horaria del teléfono."</string>
+    <string name="permdesc_setTimeZone" product="default" msgid="4499943488436633398">"Permite que la aplicación cambie la zona horaria del dispositivo."</string>
     <string name="permlab_accountManagerService" msgid="4829262349691386986">"actuar como cuenta, administrador o servicio"</string>
     <string name="permdesc_accountManagerService" msgid="1948455552333615954">"Permite que la aplicación haga llamadas a los autenticadores de cuentas."</string>
     <string name="permlab_getAccounts" msgid="4549918644233460103">"descubrir cuentas conocidas"</string>
     <string name="permdesc_getAccounts" product="tablet" msgid="3238360555257773358">"Permite que la aplicación obtenga una lista de cuentas reconocidas por la tableta."</string>
-    <string name="permdesc_getAccounts" product="default" msgid="2735689364629830348">"Permite que la aplicación obtenga una lista de cuentas reconocidas por el teléfono."</string>
+    <string name="permdesc_getAccounts" product="default" msgid="2735689364629830348">"Permite que la aplicación obtenga una lista de cuentas reconocidas por el dispositivo."</string>
     <string name="permlab_authenticateAccounts" msgid="3940505577982882450">"actuar como autenticador de cuenta"</string>
     <string name="permdesc_authenticateAccounts" msgid="5472124296908977260">"Permite que la aplicación utilice las capacidades del autenticador de cuentas del administrador de cuentas, incluida la creación de cuentas y la obtención y configuración de sus contraseñas."</string>
     <string name="permlab_manageAccounts" msgid="4440380488312204365">"administrar la lista de cuentas"</string>
@@ -469,18 +469,18 @@
     <string name="permdesc_changeWifiMulticastState" msgid="7633598524564320817">"Permite que la aplicación reciba paquetes que no están dirigidos directamente a tu dispositivo. Esto puede ser útil para descubrir servicios cercanos. Utiliza más energia que el modo que no es de multidifusión."</string>
     <string name="permlab_bluetoothAdmin" msgid="3606576270792236062">"Administración de Bluetooth"</string>
     <string name="permdesc_bluetoothAdmin" product="tablet" msgid="6921177471748882137">"Permite que la aplicación configure la tableta Bluetooth local y descubra y se sincronice con dispositivos remotos."</string>
-    <string name="permdesc_bluetoothAdmin" product="default" msgid="8931682159331542137">"Permite que la aplicación configure el teléfono Bluetooth local y descubra y se sincronice con dispositivos remotos."</string>
+    <string name="permdesc_bluetoothAdmin" product="default" msgid="8931682159331542137">"Permite que la aplicación configure el dispositivo Bluetooth local y descubra y se sincronice con dispositivos remotos."</string>
     <string name="permlab_accessWimaxState" msgid="1232061307208861588">"Ver el estado de WiMAX"</string>
     <string name="permdesc_accessWimaxState" msgid="5914958077555177749">"Permite que la aplicación consulte la información sobre el estado de WiMAX."</string>
     <string name="permlab_changeWimaxState" msgid="2405042267131496579">"Cambiar el estado de WiMAX"</string>
     <string name="permdesc_changeWimaxState" msgid="3328853825006455912">"Permite que la aplicación se conecte a una red WiMAX y se desconecte de ella."</string>
     <string name="permlab_bluetooth" msgid="8361038707857018732">"crear conexiones de Bluetooth"</string>
     <string name="permdesc_bluetooth" product="tablet" msgid="7007851048416363446">"Permite que la aplicación vea la configuración de la tableta Bluetooth local, y que cree y acepte conexiones con los dispositivos sincronizados."</string>
-    <string name="permdesc_bluetooth" product="default" msgid="31846362767164948">"Permite que la aplicación vea la configuración del teléfono Bluetooth local, y que cree y acepte conexiones con los dispositivos sincronizados."</string>
+    <string name="permdesc_bluetooth" product="default" msgid="31846362767164948">"Permite que la aplicación vea la configuración del dispositivo Bluetooth local, y que cree y acepte conexiones con los dispositivos sincronizados."</string>
     <string name="permlab_nfc" msgid="4423351274757876953">"controlar la Transmisión de datos en proximidad"</string>
     <string name="permdesc_nfc" msgid="7120611819401789907">"Permite que la aplicación se comunique con lectores, tarjetas y etiquetas de Comunicación de campo cercano (NFC)."</string>
     <string name="permlab_disableKeyguard" msgid="4977406164311535092">"desactivar el bloqueo"</string>
-    <string name="permdesc_disableKeyguard" msgid="6231611286892232626">"Permite que la aplicación inhabilite el bloqueo del teclado y cualquier protección con contraseña asociada. Un ejemplo de este permiso es la inhabilitación por parte del teléfono del bloqueo del teclado al recibir una llamada telefónica entrante y su posterior habilitación cuando finaliza la llamada."</string>
+    <string name="permdesc_disableKeyguard" msgid="6231611286892232626">"Permite que la aplicación inhabilite el bloqueo del teclado y cualquier protección con contraseña asociada. Un ejemplo de este permiso es la inhabilitación por parte del dispositivo del bloqueo del teclado al recibir una llamada telefónica entrante y su posterior habilitación cuando finaliza la llamada."</string>
     <string name="permlab_readSyncSettings" msgid="6201810008230503052">"leer la configuración de sincronización"</string>
     <string name="permdesc_readSyncSettings" msgid="5464056785274229278">"Permite que la aplicación lea la configuración de sincronización; por ejemplo, si está habilitada la sincronización para la aplicación Personas."</string>
     <string name="permlab_writeSyncSettings" msgid="6297138566442486462">"escribir configuración de sincronización"</string>
@@ -515,14 +515,14 @@
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Controlar la longitud y los caracteres permitidos en las contraseñas para desbloquear la pantalla"</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Supervisa los intentos para desbloquear la pantalla"</string>
     <string name="policydesc_watchLogin" product="tablet" msgid="3215729294215070072">"Controla la cantidad de contraseñas incorrectas ingresadas al desbloquear la pantalla y bloquea la tableta o borra todos los datos de la tableta si se ingresaron demasiadas contraseñas incorrectas."</string>
-    <string name="policydesc_watchLogin" product="default" msgid="5712323091846761073">"Controla la cantidad de contraseñas ingresadas incorrectamente al desbloquear la pantalla y bloquea el teléfono o borra todos sus datos si se ingresan demasiadas contraseñas incorrectas."</string>
+    <string name="policydesc_watchLogin" product="default" msgid="5712323091846761073">"Controla la cantidad de contraseñas ingresadas incorrectamente al desbloquear la pantalla y bloquea el dispositivo o borra todos sus datos si se ingresan demasiadas contraseñas incorrectas."</string>
     <string name="policylab_resetPassword" msgid="2620077191242688955">"Cambiar la contraseña para desbloquear la pantalla"</string>
     <string name="policydesc_resetPassword" msgid="605963962301904458">"Cambiar la contraseña para desbloquear la pantalla"</string>
     <string name="policylab_forceLock" msgid="2274085384704248431">"Bloquear la pantalla"</string>
     <string name="policydesc_forceLock" msgid="1141797588403827138">"Controlar cómo y cuándo se bloquea la pantalla"</string>
-    <string name="policylab_wipeData" msgid="3910545446758639713">"Borrar todos los datos"</string>
-    <string name="policydesc_wipeData" product="tablet" msgid="4306184096067756876">"Borrar los datos de la tableta sin avisar y restablecer la configuración de fábrica"</string>
-    <string name="policydesc_wipeData" product="default" msgid="5096895604574188391">"Borrar los datos del teléfono sin avisar y restablecer la configuración de fábrica"</string>
+    <string name="policylab_wipeData" msgid="3910545446758639713">"Eliminar todos los datos"</string>
+    <string name="policydesc_wipeData" product="tablet" msgid="4306184096067756876">"Eliminar los datos de la tableta sin avisar y restablecer la configuración de fábrica"</string>
+    <string name="policydesc_wipeData" product="default" msgid="5096895604574188391">"Eliminar los datos del dispositivo sin avisar y restablecer la configuración de fábrica"</string>
     <string name="policylab_setGlobalProxy" msgid="2784828293747791446">"Configura el proxy global de dispositivo"</string>
     <string name="policydesc_setGlobalProxy" msgid="6387497466660154931">"Configuración del proxy global de dispositivo que se utilizará mientras se habilita la política. Sólo la primera administración de dispositivo configura el proxy global efectivo."</string>
     <string name="policylab_expirePassword" msgid="885279151847254056">"Establecer la caducidad del bloqueo de pantalla"</string>
@@ -629,7 +629,7 @@
     <string name="relationTypeAssistant" msgid="6274334825195379076">"Asistente"</string>
     <string name="relationTypeBrother" msgid="8757913506784067713">"Hermano"</string>
     <string name="relationTypeChild" msgid="1890746277276881626">"Hijo"</string>
-    <string name="relationTypeDomesticPartner" msgid="6904807112121122133">"Conviviente"</string>
+    <string name="relationTypeDomesticPartner" msgid="6904807112121122133">"Pareja de hecho"</string>
     <string name="relationTypeFather" msgid="5228034687082050725">"Padre"</string>
     <string name="relationTypeFriend" msgid="7313106762483391262">"Amigo"</string>
     <string name="relationTypeManager" msgid="6365677861610137895">"Gerente"</string>
@@ -671,7 +671,7 @@
     <string name="lockscreen_low_battery" msgid="1482873981919249740">"Conecta tu cargador."</string>
     <string name="lockscreen_missing_sim_message_short" msgid="7381499217732227295">"No hay tarjeta SIM."</string>
     <string name="lockscreen_missing_sim_message" product="tablet" msgid="151659196095791474">"No hay tarjeta SIM en el tablet."</string>
-    <string name="lockscreen_missing_sim_message" product="default" msgid="2186920585695169078">"No hay tarjeta SIM en el teléfono."</string>
+    <string name="lockscreen_missing_sim_message" product="default" msgid="2186920585695169078">"No hay tarjeta SIM en el dispositivo."</string>
     <string name="lockscreen_missing_sim_instructions" msgid="5372787138023272615">"Inserta una tarjeta SIM."</string>
     <string name="lockscreen_missing_sim_instructions_long" msgid="3526573099019319472">"Falta la tarjeta SIM o no se puede leer. Introduce una tarjeta SIM."</string>
     <string name="lockscreen_permanent_disabled_sim_instructions" msgid="910904643433151371">"Tu tarjeta SIM se ha inhabilitado de forma permanente."\n" Ponte en contacto con tu proveedor de servicios inalámbricos para obtener otra tarjeta SIM."</string>
@@ -690,27 +690,27 @@
     <string name="lockscreen_too_many_failed_password_attempts_dialog_message" msgid="2725973286239344555">"Escribiste incorrectamente tu contraseña <xliff:g id="NUMBER_0">%d</xliff:g> veces. "\n\n"Vuelve a intentarlo en <xliff:g id="NUMBER_1">%d</xliff:g> segundos."</string>
     <string name="lockscreen_too_many_failed_pin_attempts_dialog_message" msgid="6216672706545696955">"Escribiste incorrectamente tu PIN <xliff:g id="NUMBER_0">%d</xliff:g> veces. "\n\n"Vuelve a intentarlo en <xliff:g id="NUMBER_1">%d</xliff:g> segundos."</string>
     <string name="lockscreen_failed_attempts_almost_glogin" product="tablet" msgid="9191611984625460820">"Has establecido incorrectamente tu patrón de desbloqueo <xliff:g id="NUMBER_0">%d</xliff:g> veces. Luego de <xliff:g id="NUMBER_1">%d</xliff:g> intentos incorrectos, se te solicitará que desbloquees tu tableta mediante el uso de tu información de acceso de Google."\n\n" Vuelve a intentarlo en <xliff:g id="NUMBER_2">%d</xliff:g> segundos."</string>
-    <string name="lockscreen_failed_attempts_almost_glogin" product="default" msgid="2590227559763762751">"Has establecido incorrectamente tu patrón de desbloqueo <xliff:g id="NUMBER_0">%d</xliff:g> veces. Luego de <xliff:g id="NUMBER_1">%d</xliff:g> intentos incorrectos, se te solicitará que desbloquees tu teléfono mediante el uso de tu información de acceso de Google."\n\n" Vuelve a intentarlo en <xliff:g id="NUMBER_2">%d</xliff:g> segundos."</string>
+    <string name="lockscreen_failed_attempts_almost_glogin" product="default" msgid="2590227559763762751">"Has establecido incorrectamente tu patrón de desbloqueo <xliff:g id="NUMBER_0">%d</xliff:g> veces. Luego de <xliff:g id="NUMBER_1">%d</xliff:g> intentos incorrectos, se te solicitará que desbloquees tu dispositivo mediante el uso de tu información de acceso de Google."\n\n" Vuelve a intentarlo en <xliff:g id="NUMBER_2">%d</xliff:g> segundos."</string>
     <string name="lockscreen_failed_attempts_almost_at_wipe" product="tablet" msgid="6128106399745755604">"Intentaste desbloquear la tableta <xliff:g id="NUMBER_0">%d</xliff:g> veces, pero no lo lograste. Puedes intentarlo <xliff:g id="NUMBER_1">%d</xliff:g> veces más antes de que se restablezcan los valores predeterminados de fábrica de la tableta y se pierdan todos los datos de usuario."</string>
-    <string name="lockscreen_failed_attempts_almost_at_wipe" product="default" msgid="8603565142156826565">"Intentaste desbloquear el teléfono <xliff:g id="NUMBER_0">%d</xliff:g> veces, pero no lo lograste. Puedes intentarlo <xliff:g id="NUMBER_1">%d</xliff:g> veces más antes de que se restablezcan los valores predeterminados de fábrica del teléfono y se pierdan todos los datos de usuario."</string>
+    <string name="lockscreen_failed_attempts_almost_at_wipe" product="default" msgid="8603565142156826565">"Intentaste desbloquear el dispositivo <xliff:g id="NUMBER_0">%d</xliff:g> veces, pero no lo lograste. Puedes intentarlo <xliff:g id="NUMBER_1">%d</xliff:g> veces más antes de que se restablezcan los valores predeterminados de fábrica del dispositivo y se pierdan todos los datos de usuario."</string>
     <string name="lockscreen_failed_attempts_now_wiping" product="tablet" msgid="280873516493934365">"Intentaste desbloquear la tableta <xliff:g id="NUMBER">%d</xliff:g> veces, pero no lo lograste. Se restablecerán los valores predeterminados de fábrica de la tableta."</string>
-    <string name="lockscreen_failed_attempts_now_wiping" product="default" msgid="3025504721764922246">"Intentaste desbloquear el teléfono <xliff:g id="NUMBER">%d</xliff:g> veces, pero no lo lograste. Se restablecerán los valores predeterminados de fábrica del teléfono."</string>
+    <string name="lockscreen_failed_attempts_now_wiping" product="default" msgid="3025504721764922246">"Intentaste desbloquear el dispositivo <xliff:g id="NUMBER">%d</xliff:g> veces, pero no lo lograste. Se restablecerán los valores predeterminados de fábrica del dispositivo."</string>
     <string name="lockscreen_too_many_failed_attempts_countdown" msgid="6251480343394389665">"Vuelve a intentarlo en <xliff:g id="NUMBER">%d</xliff:g> segundos."</string>
     <string name="lockscreen_forgot_pattern_button_text" msgid="2626999449610695930">"¿Olvidaste el patrón?"</string>
     <string name="lockscreen_glogin_forgot_pattern" msgid="2588521501166032747">"Desbloquear cuenta"</string>
     <string name="lockscreen_glogin_too_many_attempts" msgid="2751368605287288808">"Demasiados intentos incorrectos de creación del patrón"</string>
     <string name="lockscreen_glogin_instructions" msgid="3931816256100707784">"Para desbloquear, accede con tu cuenta de Google."</string>
-    <string name="lockscreen_glogin_username_hint" msgid="8846881424106484447">"Nombre de usuario (correo electrónico)"</string>
+    <string name="lockscreen_glogin_username_hint" msgid="8846881424106484447">"Nombre de usuario (correo)"</string>
     <string name="lockscreen_glogin_password_hint" msgid="5958028383954738528">"Contraseña"</string>
     <string name="lockscreen_glogin_submit_button" msgid="7130893694795786300">"Inicia sesión"</string>
     <string name="lockscreen_glogin_invalid_input" msgid="1364051473347485908">"Nombre de usuario o contraseña incorrecta."</string>
     <string name="lockscreen_glogin_account_recovery_hint" msgid="1696924763690379073">"¿Olvidaste tu nombre de usuario o contraseña?"\n"Accede a "<b>"google.com/accounts/recovery"</b>"."</string>
     <string name="lockscreen_glogin_checking_password" msgid="7114627351286933867">"Comprobando..."</string>
     <string name="lockscreen_unlock_label" msgid="737440483220667054">"Desbloquear"</string>
-    <string name="lockscreen_sound_on_label" msgid="9068877576513425970">"Sonido encendido"</string>
-    <string name="lockscreen_sound_off_label" msgid="996822825154319026">"Sonido apagado"</string>
+    <string name="lockscreen_sound_on_label" msgid="9068877576513425970">"Sonido activado"</string>
+    <string name="lockscreen_sound_off_label" msgid="996822825154319026">"Sonido desactivado"</string>
     <string name="lockscreen_access_pattern_start" msgid="3941045502933142847">"Se inició el patrón"</string>
-    <string name="lockscreen_access_pattern_cleared" msgid="5583479721001639579">"Se borró el patrón"</string>
+    <string name="lockscreen_access_pattern_cleared" msgid="5583479721001639579">"Se eliminó el patrón"</string>
     <string name="lockscreen_access_pattern_cell_added" msgid="6756031208359292487">"Se agregó una celda."</string>
     <string name="lockscreen_access_pattern_detected" msgid="4988730895554057058">"Se completó el patrón"</string>
     <string name="password_keyboard_label_symbol_key" msgid="992280756256536042">"?123"</string>
@@ -749,7 +749,7 @@
     <string name="permdesc_readHistoryBookmarks" msgid="4577476392604595921">"Permite que la aplicación consulte todos los marcadores del navegador y todas las URL que haya visitado."</string>
     <string name="permlab_writeHistoryBookmarks" msgid="9009434109836280374">"escribir historial y marcadores del navegador"</string>
     <string name="permdesc_writeHistoryBookmarks" product="tablet" msgid="1757103804824209530">"Permite que la aplicación modifique el historial o los marcadores del navegador guardados en tu tableta. Las aplicaciones maliciosas pueden utilizar este permiso para borrar o modificar los datos de tu navegador."</string>
-    <string name="permdesc_writeHistoryBookmarks" product="default" msgid="6693764355720719197">"Permite que la aplicación modifique el historial o los marcadores del navegador guardados en tu teléfono. Las aplicaciones maliciosas pueden utilizar este permiso para borrar o modificar los datos de tu navegador."</string>
+    <string name="permdesc_writeHistoryBookmarks" product="default" msgid="6693764355720719197">"Permite que la aplicación modifique el historial o los marcadores del navegador guardados en tu dispositivo. Las aplicaciones maliciosas pueden utilizar este permiso para borrar o modificar los datos de tu navegador."</string>
     <string name="permlab_setAlarm" msgid="5924401328803615165">"configurar alarma en reloj alarma"</string>
     <string name="permdesc_setAlarm" msgid="316392039157473848">"Permite que la aplicación establezca una alarma en una aplicación de alarma instalada. Es posible que algunas aplicaciones de alarma no incluyan esta función."</string>
     <string name="permlab_addVoicemail" msgid="5525660026090959044">"agregar correo de voz"</string>
@@ -774,7 +774,7 @@
     <string name="search_go" msgid="8298016669822141719">"Buscar"</string>
     <string name="searchview_description_search" msgid="6749826639098512120">"Buscar"</string>
     <string name="searchview_description_query" msgid="5911778593125355124">"Consulta de búsqueda"</string>
-    <string name="searchview_description_clear" msgid="1330281990951833033">"Borrar la consulta"</string>
+    <string name="searchview_description_clear" msgid="1330281990951833033">"Eliminar la consulta"</string>
     <string name="searchview_description_submit" msgid="2688450133297983542">"Enviar consulta"</string>
     <string name="searchview_description_voice" msgid="2453203695674994440">"Búsqueda por voz"</string>
     <string name="oneMonthDurationPast" msgid="7396384508953779925">"hace 1 mes"</string>
@@ -848,7 +848,7 @@
     <item quantity="one" msgid="2178576254385739855">"mañana"</item>
     <item quantity="other" msgid="2973062968038355991">"en <xliff:g id="COUNT">%d</xliff:g> días"</item>
   </plurals>
-    <string name="preposition_for_date" msgid="9093949757757445117">"encendido <xliff:g id="DATE">%s</xliff:g>"</string>
+    <string name="preposition_for_date" msgid="9093949757757445117">"activado <xliff:g id="DATE">%s</xliff:g>"</string>
     <string name="preposition_for_time" msgid="5506831244263083793">"a las <xliff:g id="TIME">%s</xliff:g>"</string>
     <string name="preposition_for_year" msgid="5040395640711867177">"en <xliff:g id="YEAR">%s</xliff:g>"</string>
     <string name="day" msgid="8144195776058119424">"día"</string>
@@ -889,7 +889,7 @@
     <string name="editTextMenuTitle" msgid="4909135564941815494">"Acciones de texto"</string>
     <string name="low_internal_storage_view_title" msgid="1399732408701697546">"Poco espacio de almacenamiento"</string>
     <string name="low_internal_storage_view_text" product="tablet" msgid="4231085657068852042">"Está quedando poco espacio de almacenamiento en el tablet."</string>
-    <string name="low_internal_storage_view_text" product="default" msgid="635106544616378836">"Hay poco espacio de almacenamiento en el teléfono."</string>
+    <string name="low_internal_storage_view_text" product="default" msgid="635106544616378836">"Hay poco espacio de almacenamiento en el dispositivo."</string>
     <string name="ok" msgid="5970060430562524910">"Aceptar"</string>
     <string name="cancel" msgid="6442560571259935130">"Cancelar"</string>
     <string name="yes" msgid="5362982303337969312">"Aceptar"</string>
@@ -900,7 +900,7 @@
     <string name="capital_off" msgid="6815870386972805832">"No"</string>
     <string name="whichApplication" msgid="4533185947064773386">"Completar la acción mediante"</string>
     <string name="alwaysUse" msgid="4583018368000610438">"Utilizar de manera predeterminada en esta acción."</string>
-    <string name="clearDefaultHintMsg" msgid="3252584689512077257">"Borrar valores predeterminados en Configuración del sistema &gt; Aplicaciones &gt; Descargas."</string>
+    <string name="clearDefaultHintMsg" msgid="3252584689512077257">"Eliminar valores predeterminados en Configuración del sistema &gt; Aplicaciones &gt; Descargas."</string>
     <string name="chooseActivity" msgid="7486876147751803333">"Seleccionar una acción"</string>
     <string name="chooseUsbActivity" msgid="6894748416073583509">"Selecciona una aplicación para el dispositivo USB."</string>
     <string name="noApplications" msgid="2991814273936504689">"Ninguna aplicación puede realizar esta acción."</string>
@@ -915,12 +915,13 @@
     <string name="force_close" msgid="8346072094521265605">"Aceptar"</string>
     <string name="report" msgid="4060218260984795706">"Notificar"</string>
     <string name="wait" msgid="7147118217226317732">"Esperar"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"La página no responde."\n\n"¿Deseas cerrarla?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Aplicación redireccionada"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> se está ejecutando ahora."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"<xliff:g id="APP_NAME">%1$s</xliff:g> se inició originalmente."</string>
     <string name="screen_compat_mode_scale" msgid="3202955667675944499">"Escala"</string>
     <string name="screen_compat_mode_show" msgid="4013878876486655892">"Mostrar siempre"</string>
-    <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Volver a habilitar Configuración del sistema &gt; Aplicaciones &gt; Descargas"</string>
+    <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Volver a activar Configuración del sistema &gt; Aplicaciones &gt; Descargas"</string>
     <string name="smv_application" msgid="3307209192155442829">"La aplicación <xliff:g id="APPLICATION">%1$s</xliff:g> (proceso <xliff:g id="PROCESS">%2$s</xliff:g>) ha infringido su política StrictMode de aplicación automática."</string>
     <string name="smv_process" msgid="5120397012047462446">"El proceso <xliff:g id="PROCESS">%1$s</xliff:g> ha violado su política StrictMode autoimpuesta."</string>
     <string name="android_upgrading_title" msgid="1584192285441405746">"Android se está actualizando..."</string>
@@ -1031,7 +1032,7 @@
     <string name="extmedia_format_message" product="default" msgid="14131895027543830">"Se perderán todos los datos de tu tarjeta."</string>
     <string name="extmedia_format_button_format" msgid="4131064560127478695">"Formato"</string>
     <string name="adb_active_notification_title" msgid="6729044778949189918">"Depuración de USB conectada"</string>
-    <string name="adb_active_notification_message" msgid="1016654627626476142">"Toca para inhabilitar la depuración de USB."</string>
+    <string name="adb_active_notification_message" msgid="1016654627626476142">"Toca para desactivar la depuración de USB."</string>
     <string name="select_input_method" msgid="4653387336791222978">"Selecciona el método de introducción"</string>
     <string name="configure_input_methods" msgid="9091652157722495116">"Configurar métodos de introducción"</string>
     <string name="fast_scroll_alphabet" msgid="5433275485499039199">" ABCDEFGHIJKLMNOPQRSTUVWXYZ"</string>
@@ -1203,7 +1204,7 @@
     <string name="data_usage_4g_limit_title" msgid="7636489436819470761">"Datos de 4 GB desactivados"</string>
     <string name="data_usage_mobile_limit_title" msgid="7869402519391631884">"Datos móviles desactivados"</string>
     <string name="data_usage_wifi_limit_title" msgid="8992154736441284865">"Datos Wi-Fi desactivados"</string>
-    <string name="data_usage_limit_body" msgid="3317964706973601386">"Toca para habilitar."</string>
+    <string name="data_usage_limit_body" msgid="3317964706973601386">"Toca para activar."</string>
     <string name="data_usage_3g_limit_snoozed_title" msgid="7026739121138005231">"Supera límite de datos de 2G-3G"</string>
     <string name="data_usage_4g_limit_snoozed_title" msgid="1106562779311209039">"Límite de datos de 4G superado"</string>
     <string name="data_usage_mobile_limit_snoozed_title" msgid="279240572165412168">"Límite de datos móviles superado"</string>
diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml
index fe6c704..0c526ff 100644
--- a/core/res/res/values-es/strings.xml
+++ b/core/res/res/values-es/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"Aceptar"</string>
     <string name="report" msgid="4060218260984795706">"Informar"</string>
     <string name="wait" msgid="7147118217226317732">"Esperar"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"La página no responde."\n\n"¿Quieres cerrarla?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Aplicación redireccionada"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> se está ejecutando."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"Inicialmente, se inició la aplicación <xliff:g id="APP_NAME">%1$s</xliff:g>."</string>
diff --git a/core/res/res/values-et/strings.xml b/core/res/res/values-et/strings.xml
index 1a86b9d..5591289 100644
--- a/core/res/res/values-et/strings.xml
+++ b/core/res/res/values-et/strings.xml
@@ -73,11 +73,11 @@
     <string name="RestrictedOnData" msgid="8653794784690065540">"Andmesideteenus on blokeeritud."</string>
     <string name="RestrictedOnEmergency" msgid="6581163779072833665">"Hädaabiteenus on blokeeritud."</string>
     <string name="RestrictedOnNormal" msgid="4953867011389750673">"Häälteenus on blokeeritud."</string>
-    <string name="RestrictedOnAllVoice" msgid="1459318899842232234">"Kõik häälteenused on blokeeritud."</string>
+    <string name="RestrictedOnAllVoice" msgid="3396963652108151260">"Kõik häälteenused on blokeeritud."</string>
     <string name="RestrictedOnSms" msgid="8314352327461638897">"SMS-teenus on blokeeritud."</string>
-    <string name="RestrictedOnVoiceData" msgid="8244438624660371717">"Hääl-/andmeteenused on blokeeritud."</string>
+    <string name="RestrictedOnVoiceData" msgid="996636487106171320">"Hääl-/andmeteenused on blokeeritud."</string>
     <string name="RestrictedOnVoiceSms" msgid="1888588152792023873">"Hääl-/SMS-teenused on blokeeritud."</string>
-    <string name="RestrictedOnAll" msgid="2714924667937117304">"Kõik hääl-/andme-/SMS-teenused on blokeeritud."</string>
+    <string name="RestrictedOnAll" msgid="5643028264466092821">"Kõik hääl-/andme-/SMS-teenused on blokeeritud."</string>
     <string name="serviceClassVoice" msgid="1258393812335258019">"Hääl"</string>
     <string name="serviceClassData" msgid="872456782077937893">"Andmed"</string>
     <string name="serviceClassFAX" msgid="5566624998840486475">"FAKS"</string>
@@ -108,27 +108,27 @@
     <string name="fcComplete" msgid="3118848230966886575">"Funktsioonikood valmis."</string>
     <string name="fcError" msgid="3327560126588500777">"Ühendusprobleem või kehtetu funktsioonikood."</string>
     <string name="httpErrorOk" msgid="1191919378083472204">"OK"</string>
-    <string name="httpError" msgid="6603022914760066338">"Ilmnes võrgu viga."</string>
-    <string name="httpErrorLookup" msgid="4517085806977851374">"URL-i ei leitud."</string>
+    <string name="httpError" msgid="7956392511146698522">"Ilmnes võrgu viga."</string>
+    <string name="httpErrorLookup" msgid="4711687456111963163">"URL-i ei leita."</string>
     <string name="httpErrorUnsupportedAuthScheme" msgid="6299980280442076799">"Saidi autentimise skeemi ei toetata."</string>
-    <string name="httpErrorAuth" msgid="7293960746955020542">"Autentimine ebaõnnestus."</string>
+    <string name="httpErrorAuth" msgid="1435065629438044534">"Autentimine ebaõnnestus."</string>
     <string name="httpErrorProxyAuth" msgid="1788207010559081331">"Puhverserveri kaudu autentimine ebaõnnestus."</string>
-    <string name="httpErrorConnect" msgid="7623096283505770433">"Ühendus serveriga ebaõnnestus."</string>
-    <string name="httpErrorIO" msgid="4270874999047767599">"Serveril ei õnnestunud sidet luua. Proovige hiljem uuesti."</string>
+    <string name="httpErrorConnect" msgid="8714273236364640549">"Serveriga ei saanud ühendust."</string>
+    <string name="httpErrorIO" msgid="2340558197489302188">"Serveriga ei saanud ühendust. Proovige hiljem uuesti."</string>
     <string name="httpErrorTimeout" msgid="4743403703762883954">"Ühendus serveriga aegunud."</string>
     <string name="httpErrorRedirectLoop" msgid="8679596090392779516">"Leht sisaldab liiga palju serveri ümbersuunamisi."</string>
     <string name="httpErrorUnsupportedScheme" msgid="5015730812906192208">"Protokolli ei toetata."</string>
-    <string name="httpErrorFailedSslHandshake" msgid="3088290300440289771">"Turvalist ühendust ei saanud luua."</string>
-    <string name="httpErrorBadUrl" msgid="6088183159988619736">"Lehte ei saa avada, kuna URL on vale."</string>
-    <string name="httpErrorFile" msgid="8250549644091165175">"Faili ei saa avada."</string>
-    <string name="httpErrorFileNotFound" msgid="5588380756326017105">"Nõutud faili ei leitud."</string>
+    <string name="httpErrorFailedSslHandshake" msgid="96549606000658641">"Turvalist ühendust ei saanud luua."</string>
+    <string name="httpErrorBadUrl" msgid="3636929722728881972">"Lehte pole võimalik avada, kuna URL on vale."</string>
+    <string name="httpErrorFile" msgid="2170788515052558676">"Failile ei pääse juurde."</string>
+    <string name="httpErrorFileNotFound" msgid="6203856612042655084">"Soovitud faili ei leitud."</string>
     <string name="httpErrorTooManyRequests" msgid="1235396927087188253">"Töötlemisel on liiga palju taotlusi. Proovige hiljem uuesti."</string>
-    <string name="notification_title" msgid="1259940370369187045">"Viga kontole <xliff:g id="ACCOUNT">%1$s</xliff:g> sisselogimisel"</string>
+    <string name="notification_title" msgid="8967710025036163822">"Viga kontole <xliff:g id="ACCOUNT">%1$s</xliff:g> sisselogimisel"</string>
     <string name="contentServiceSync" msgid="8353523060269335667">"Sünkroonimine"</string>
     <string name="contentServiceSyncNotificationTitle" msgid="397743349191901458">"Sünkroonimine"</string>
     <string name="contentServiceTooManyDeletesNotificationDesc" msgid="8100981435080696431">"Liiga palju üksuse <xliff:g id="CONTENT_TYPE">%s</xliff:g> kustutusi."</string>
-    <string name="low_memory" product="tablet" msgid="2292820184396262278">"Tahvelarvuti mälu on täis. Ruumi vabastamiseks kustutage mõned failid."</string>
-    <string name="low_memory" product="default" msgid="6632412458436461203">"Telefonimälu on täis. Ruumi vabastamiseks kustutage mõned failid."</string>
+    <string name="low_memory" product="tablet" msgid="6494019234102154896">"Tahvelarvuti mäluruum on täis. Ruumi vabastamiseks kustutage mõned failid."</string>
+    <string name="low_memory" product="default" msgid="3475999286680000541">"Telefonimälu on täis. Ruumi vabastamiseks kustutage mõned failid."</string>
     <string name="me" msgid="6545696007631404292">"Mina"</string>
     <string name="power_dialog" product="tablet" msgid="8545351420865202853">"Tahvelarvuti valikud"</string>
     <string name="power_dialog" product="default" msgid="1319919075463988638">"Telefonivalikud"</string>
@@ -137,6 +137,9 @@
     <string name="turn_off_radio" msgid="8198784949987062346">"Lülitage raadioside välja"</string>
     <string name="screen_lock" msgid="799094655496098153">"Ekraanilukk"</string>
     <string name="power_off" msgid="4266614107412865048">"Lülita välja"</string>
+    <string name="silent_mode_silent" msgid="319298163018473078">"Helin on väljas"</string>
+    <string name="silent_mode_vibrate" msgid="7072043388581551395">"Vibreeriv helin"</string>
+    <string name="silent_mode_ring" msgid="8592241816194074353">"Helin on sees"</string>
     <string name="shutdown_progress" msgid="2281079257329981203">"Väljalülitamine ..."</string>
     <string name="shutdown_confirm" product="tablet" msgid="3385745179555731470">"Teie tahvelarvuti lülitub välja."</string>
     <string name="shutdown_confirm" product="default" msgid="649792175242821353">"Teie telefon lülitub välja."</string>
@@ -157,16 +160,16 @@
     <string name="safeMode" msgid="2788228061547930246">"Turvarežiim"</string>
     <string name="android_system_label" msgid="6577375335728551336">"Android-süsteem"</string>
     <string name="permgrouplab_costMoney" msgid="5429808217861460401">"Tasulised teenused"</string>
-    <string name="permgroupdesc_costMoney" msgid="8596717365335027057">"Võimaldab rakendustel teha tasulisi toiminguid."</string>
+    <string name="permgroupdesc_costMoney" msgid="3293301903409869495">"Tasuliste toimingute tegemine."</string>
     <string name="permgrouplab_messages" msgid="7521249148445456662">"Teie sõnumid"</string>
     <string name="permgroupdesc_messages" msgid="7821999071003699236">"Teie SMS-, meili- ja muude sõnumite lugemine ja kirjutamine."</string>
     <string name="permgrouplab_personalInfo" msgid="3519163141070533474">"Teie isiklikud andmed"</string>
     <string name="permgroupdesc_personalInfo" product="tablet" msgid="6975389054186265786">"Otsene juurdepääs tahvelarvutisse salvestatud kontaktidele ja kalendrile."</string>
     <string name="permgroupdesc_personalInfo" product="default" msgid="5488050357388806068">"Otsene juurdepääs telefoni salvestatud kontaktidele ja kalendrile."</string>
     <string name="permgrouplab_location" msgid="635149742436692049">"Teie asukoht"</string>
-    <string name="permgroupdesc_location" msgid="2430258821648348660">"Jälgige oma füüsilist asukohta"</string>
+    <string name="permgroupdesc_location" msgid="5704679763124170100">"Jälgige oma füüsilist asukohta."</string>
     <string name="permgrouplab_network" msgid="5808983377727109831">"Võrgusuhtlus"</string>
-    <string name="permgroupdesc_network" msgid="4917593670797570584">"Võimaldab rakendustel pääseda juurde erinevatele võrgufunktsioonidele."</string>
+    <string name="permgroupdesc_network" msgid="4478299413241861987">"Juurdepääs erinevatele võrgufunktsioonidele."</string>
     <string name="permgrouplab_accounts" msgid="3359646291125325519">"Teie kontod"</string>
     <string name="permgroupdesc_accounts" msgid="4948732641827091312">"Juurdepääs saadaolevatele kontodele."</string>
     <string name="permgrouplab_hardwareControls" msgid="7998214968791599326">"Riistvara juhtelemendid"</string>
@@ -206,16 +209,16 @@
     <string name="permdesc_writeSms" product="default" msgid="7268668709052328567">"Võimaldab rakendusel kirjutada teie telefoni või SIM-kaardile salvestatud SMS-sõnumitesse. Pahatahtlikud rakendused võivad teie sõnumid kustutada."</string>
     <string name="permlab_receiveWapPush" msgid="8258226427716551388">"võta WAP vastu"</string>
     <string name="permdesc_receiveWapPush" msgid="7983455145335316872">"Võimaldab rakendusel vastu võtta ja töödelda WAP-sõnumeid. Pahatahtlikud rakendused võivad teie sõnumeid jälgida või neid kustutada teile näitamata."</string>
-    <string name="permlab_getTasks" msgid="6466095396623933906">"käitatud rakenduste toomine"</string>
+    <string name="permlab_getTasks" msgid="6466095396623933906">"Käitatud rakenduste toomine"</string>
     <string name="permdesc_getTasks" msgid="6608159250520381359">"Võimaldab rakendusel hankida teavet praegu töötavate ja hiljuti töötanud ülesannete kohta. Pahatahtlikud rakendused võivad avastada privaatset teavet teiste rakenduste kohta."</string>
     <string name="permlab_reorderTasks" msgid="2018575526934422779">"käitatud rakenduste ümberjärjestamine"</string>
     <string name="permdesc_reorderTasks" msgid="4175137612205663399">"Võimaldab rakendusel teisaldada ülesanded esiplaanile ja taustale. Pahatahtlikud rakendused võivad sundida end esiplaanile tulema teie loata."</string>
     <string name="permlab_removeTasks" msgid="6821513401870377403">"käitatud rakenduste peatamine"</string>
-    <string name="permdesc_removeTasks" msgid="1000226123143185094">"Võimaldab rakendusel eemaldada ülesandeid ja peatada nende rakendused. Pahatahtlikud rakendused võivad häirida teiste rakenduste käitumist."</string>
+    <string name="permdesc_removeTasks" msgid="1394714352062635493">"Võimaldab rakendusel eemaldada ülesanded ja peatada nende rakendused. Pahatahtlikud rakendused võivad häirida teiste rakenduste käitumist."</string>
     <string name="permlab_setDebugApp" msgid="3022107198686584052">"Rakenduse silumise lubamine"</string>
-    <string name="permdesc_setDebugApp" msgid="6215654419903651172">"Võimaldab rakendusel lülitada sisse teise rakenduse silumise. Pahatahtlikud rakendused võivad seda kasutada teiste rakenduste peatamiseks."</string>
+    <string name="permdesc_setDebugApp" msgid="4474512416299013256">"Võimaldab rakendusel lülitada sisse teise rakenduse silumise. Pahatahtlikud rakendused võivad seda kasutada teiste rakenduste peatamiseks."</string>
     <string name="permlab_changeConfiguration" msgid="8214475779521218295">"muuda UI-seadeid"</string>
-    <string name="permdesc_changeConfiguration" msgid="4104052649900380324">"Võimaldab rakendusel muuta praegust konfiguratsiooni, näiteks lokaati või üldist kirjasuurust."</string>
+    <string name="permdesc_changeConfiguration" msgid="4372223873154296076">"Võimaldab rakendusel muuta praegust konfiguratsiooni, näiteks lokaati või üldist kirjasuurust."</string>
     <string name="permlab_enableCarMode" msgid="5684504058192921098">"autorežiimi lubamine"</string>
     <string name="permdesc_enableCarMode" msgid="4853187425751419467">"Võimaldab rakendusel autorežiimi lubada."</string>
     <string name="permlab_killBackgroundProcesses" msgid="8373714752793061963">"taustaprotsesside peatamine"</string>
@@ -251,11 +254,11 @@
     <string name="permlab_confirm_full_backup" msgid="5557071325804469102">"täieliku varukoopia kinnitamine või toimingu taastamine"</string>
     <string name="permdesc_confirm_full_backup" msgid="1748762171637699562">"Võimaldab rakendusel käivitada täieliku varukoopia kinnitusliidese. Mitte kasutada üheski rakenduses."</string>
     <string name="permlab_internalSystemWindow" msgid="2148563628140193231">"kuva volituseta aknad"</string>
-    <string name="permdesc_internalSystemWindow" msgid="6510907081810231374">"Võimaldab rakendusel luua aknaid, mis on mõeldud süsteemisisesele kasutajaliidesele. Mitte kasutada tavarakenduste puhul."</string>
+    <string name="permdesc_internalSystemWindow" msgid="7458387759461466397">"Võimaldab rakendusel luua aknaid, mis on mõeldud kasutamiseks süsteemisisesele kasutajaliidesele. Mitte kasutada tavarakenduste puhul."</string>
     <string name="permlab_systemAlertWindow" msgid="3372321942941168324">"kuva süsteemitasemel märguandeid"</string>
     <string name="permdesc_systemAlertWindow" msgid="8507863469978066409">"Võimaldab rakendusel kuvada süsteemihoiatuste aknaid. Pahatahtlikud rakendused võivad hõlmata kogu ekraani."</string>
     <string name="permlab_setAnimationScale" msgid="2805103241153907174">"muuda üldist animatsioonikiirust"</string>
-    <string name="permdesc_setAnimationScale" msgid="6505093307223395456">"Võimaldab rakendusel muuta igal ajal üldist animatsiooni kiirust (animatsioone kiirendada või aeglustada)."</string>
+    <string name="permdesc_setAnimationScale" msgid="7690063428924343571">"Võimaldab rakendusel muuta animatsiooni üldist kiirust (animatsioone kiirendada või aeglustada) ükskõik millal."</string>
     <string name="permlab_manageAppTokens" msgid="1286505717050121370">"Rakenduse lubade haldamine"</string>
     <string name="permdesc_manageAppTokens" msgid="8043431713014395671">"Võimaldab rakendusel luua ja hallata tema enda lube, möödudes tavapärasest Z-järjekorrast. Tavarakenduste puhul ei peaks seda kunagi vaja minema."</string>
     <string name="permlab_injectEvents" msgid="1378746584023586600">"vajuta klahve ja juhtnuppe"</string>
@@ -266,9 +269,9 @@
     <string name="permlab_bindInputMethod" msgid="3360064620230515776">"seo sisestusmeetodiga"</string>
     <string name="permdesc_bindInputMethod" msgid="3250440322807286331">"Lubab omanikul siduda sisestusmeetodi ülataseme liidesega. Tavarakenduste puhul ei peaks seda kunagi vaja minema."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"tekstiteenusega sidumine"</string>
-    <string name="permdesc_bindTextService" msgid="8151968910973998670">"Võimaldab omanikul siduda tekstiteenuse (nt SpellCheckerService) ülataseme liidest. Tavarakenduste puhul ei peaks seda kunagi vaja minema."</string>
+    <string name="permdesc_bindTextService" msgid="8151968910973998670">"Võimaldab omanikul siduda tekstiteenuse (nt SpellCheckerService) ülataseme liidesega. Tavarakenduste puhul ei peaks seda kunagi vaja minema."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"seo VPN-teenusega"</string>
-    <string name="permdesc_bindVpnService" msgid="2067845564581693905">"Võimaldab omanikul siduda vidina teenuse ülataseme liidesega. Tavarakenduste puhul ei peaks seda kunagi vaja minema."</string>
+    <string name="permdesc_bindVpnService" msgid="2067845564581693905">"Võimaldab omanikul siduda VPN-teenuse ülataseme liidesega. Tavarakenduste puhul ei peaks seda kunagi vaja minema."</string>
     <string name="permlab_bindWallpaper" msgid="8716400279937856462">"taustapildiga sidumine"</string>
     <string name="permdesc_bindWallpaper" msgid="7108428692595491668">"Lubab omanikul siduda taustapildi ülataseme liidesega. Tavarakenduste puhul ei peaks seda kunagi vaja minema."</string>
     <string name="permlab_bindRemoteViews" msgid="5697987759897367099">"vidinateenusega sidumine"</string>
@@ -292,7 +295,7 @@
     <string name="permlab_getPackageSize" msgid="7472921768357981986">"Rakenduse mäluruumi mõõtmine"</string>
     <string name="permdesc_getPackageSize" msgid="3921068154420738296">"Võimaldab rakendusel tuua oma koodi, andmed ja vahemälu suurused"</string>
     <string name="permlab_installPackages" msgid="2199128482820306924">"Rakenduste otse installimine"</string>
-    <string name="permdesc_installPackages" msgid="5628530972548071284">"Võimaldab rakendusel installida uusi või värskendatud Android-pakette. Pahatahtlikud rakendused võivad seda kasutada uute rakenduste lisamiseks omavoliliselt võimsate õigustega."</string>
+    <string name="permdesc_installPackages" msgid="5628530972548071284">"Võimaldab rakendusel installida uusi või värskendatud Android-pakette. Pahatahtlikud rakendused võivad selle abil lisada uusi meelevaldse tegevuse lubadega rakendusi."</string>
     <string name="permlab_clearAppCache" msgid="7487279391723526815">"Kõigi rakenduse vahemäluandmete kustutamine"</string>
     <string name="permdesc_clearAppCache" product="tablet" msgid="3523396284474042284">"Võimaldab rakendusel vabastada tahvelarvuti mälu, kustutades faile otse rakenduse kataloogist. Süsteem on juurdepääsu sellele harilikult väga piiranud."</string>
     <string name="permdesc_clearAppCache" product="default" msgid="5067988373366292186">"Võimaldab rakendusel vabastada telefoni mälu, kustutades faile otse rakenduse kataloogist. Süsteem on juurdepääsu sellele harilikult väga piiranud."</string>
@@ -301,6 +304,8 @@
     <string name="permlab_readLogs" msgid="6615778543198967614">"tundlike logiandmete lugemine"</string>
     <string name="permdesc_readLogs" product="tablet" msgid="82061313293455151">"Võimaldab rakendusel lugeda süsteemi erinevaid logifaile. Nii on võimalik avastada üldist teavet selle kohta, mida te tahvelarvutiga teete, sh isiklikku või privaatset teavet."</string>
     <string name="permdesc_readLogs" product="default" msgid="2063438140241560443">"Võimaldab rakendusel lugeda süsteemi erinevaid logifaile. Nii on võimalik avastada üldist teavet selle kohta, mida te telefoniga teete, mis võib kaasata ka isiklikku või privaatset teavet."</string>
+    <string name="permlab_anyCodecForPlayback" msgid="715805555823881818">"Mis tahes meediumidekooderi kasutamine taasesituseks"</string>
+    <string name="permdesc_anyCodecForPlayback" msgid="8283912488433189010">"Võimaldab rakendusel taasesituseks kasutada mis tahes installitud meediumidekooderit."</string>
     <string name="permlab_diagnostic" msgid="8076743953908000342">"loe/kirjuta valija allikaid"</string>
     <string name="permdesc_diagnostic" msgid="6608295692002452283">"Võimaldab rakendusel lugeda valimisrühma mis tahes ressurssi ja sellesse kirjutada (näiteks kaustas /dev olevad failid). See võib mõjutada süsteemi stabiilsust ja turvet. Seda tohiks kasutada tootja või operaator AINULT riistvaraspetsiifiliseks diagnostikaks."</string>
     <string name="permlab_changeComponentState" msgid="6335576775711095931">"Rakenduse komponentide lubamine või keelamine"</string>
@@ -335,7 +340,7 @@
     <string name="permlab_writeSocialStream" product="default" msgid="3504179222493235645">"Sotsiaalvoogu kirjutamine"</string>
     <string name="permdesc_writeSocialStream" product="default" msgid="3496277176955721451">"Võimaldab rakendusel kuvada sõprade suhtlusuudiseid. Pahatahtlikud rakendused saavad selle abil teie sõpra teeselda ja meelitada teid avaldama paroole või muud konfidentsiaalset teavet."</string>
     <string name="permlab_readCalendar" msgid="5972727560257612398">"kalendrisündmuste lugemine ja konfidentsiaalne teave"</string>
-    <string name="permdesc_readCalendar" product="tablet" msgid="2338414551004122687">"Võimaldab rakendusel lugeda kõiki teie tahvelarvutisse salvestatud kalendrisündmusi, sh teie sõprade või töökaaslaste omi. Pahatahtlikud rakendused võivad nendest kalendritest välja võtta isiklikku teavet ilma teadmiseta."</string>
+    <string name="permdesc_readCalendar" product="tablet" msgid="2338414551004122687">"Võimaldab rakendusel lugeda kõiki teie tahvelarvutisse salvestatud kalendrisündmusi, sh teie sõprade või töökaaslaste omi. Pahatahtlikud rakendused võivad nendest kalendritest välja võtta isiklikku teavet ilma omanike teadmata."</string>
     <string name="permdesc_readCalendar" product="default" msgid="5693933067751827753">"Võimaldab rakendusel lugeda kõiki teie telefoni salvestatud kalendrisündmusi, sh teie sõprade või töökaaslaste omi. Pahatahtlikud rakendused võivad nendest kalendritest välja võtta isiklikku teavet omaniku teadmiseta."</string>
     <string name="permlab_writeCalendar" msgid="8438874755193825647">"kalendrisündmuste lisamine või muutmine ja külalistele omanike teadmata meili saatmine"</string>
     <string name="permdesc_writeCalendar" msgid="2243771395254848873">"Võimaldab rakendusel saata sündmusekutseid kalendri omanikuna ning lisada, eemaldada või muuta sündmusi, mida saate oma seadmel muuta, sh oma sõprade või töökaaslaste omi. Pahatahtlikud rakendused võivad saata rämpsposti, mis näib olevat tulnud kalendriomanikelt, muuta sündmusi omanike teadmata või lisada võltssündmusi."</string>
@@ -434,7 +439,7 @@
     <string name="permdesc_setTimeZone" product="tablet" msgid="1676983712315827645">"Võimaldab rakendusel muuta tahvelarvuti ajavööndit."</string>
     <string name="permdesc_setTimeZone" product="default" msgid="4499943488436633398">"Võimaldab rakendusel muuta telefoni ajavööndit."</string>
     <string name="permlab_accountManagerService" msgid="4829262349691386986">"AccountManagerService\'ina tegutsemine"</string>
-    <string name="permdesc_accountManagerService" msgid="2684502137670299915">"Võimaldab rakendusel helistada konto autentijatele."</string>
+    <string name="permdesc_accountManagerService" msgid="1948455552333615954">"Võimaldab rakendusel helistada konto autentijatele."</string>
     <string name="permlab_getAccounts" msgid="4549918644233460103">"leia teadaolevad kontod"</string>
     <string name="permdesc_getAccounts" product="tablet" msgid="3238360555257773358">"Võimaldab rakendusel hankida tahvelarvutile teadaolevate kontode loendi."</string>
     <string name="permdesc_getAccounts" product="default" msgid="2735689364629830348">"Võimaldab rakendusel saada telefonile teadaolevate kontode loendi."</string>
@@ -465,6 +470,10 @@
     <string name="permlab_bluetoothAdmin" msgid="3606576270792236062">"Bluetoothi haldamine"</string>
     <string name="permdesc_bluetoothAdmin" product="tablet" msgid="6921177471748882137">"Võimaldab rakendusel seadistada kohalikku Bluetooth-tahvelarvutit ning leida ja siduda seda kaugseadmetega."</string>
     <string name="permdesc_bluetoothAdmin" product="default" msgid="8931682159331542137">"Võimaldab rakendusel seadistada kohalikku Bluetooth-telefoni ning leida ja siduda seda kaugseadmetega."</string>
+    <string name="permlab_accessWimaxState" msgid="1232061307208861588">"WiMAX-i oleku kuvamine"</string>
+    <string name="permdesc_accessWimaxState" msgid="5914958077555177749">"Võimaldab rakendusel vaadata WiMAX-i olekuteavet."</string>
+    <string name="permlab_changeWimaxState" msgid="2405042267131496579">"WiMAX-i oleku muutmine"</string>
+    <string name="permdesc_changeWimaxState" msgid="3328853825006455912">"Võimaldab rakendusel luua ja katkestada ühenduse WiMAX-i võrguga."</string>
     <string name="permlab_bluetooth" msgid="8361038707857018732">"loo Bluetooth-ühendusi"</string>
     <string name="permdesc_bluetooth" product="tablet" msgid="7007851048416363446">"Võimaldab rakendusel vaadata kohaliku Bluetooth-tahvelarvuti konfiguratsiooni ning luua ja heaks kiita ühendusi seotud seadmetega."</string>
     <string name="permdesc_bluetooth" product="default" msgid="31846362767164948">"Võimaldab rakendusel vaadata kohaliku Bluetooth-telefoni konfiguratsiooni ning luua ja heaks kiita ühendusi seotud seadmetega."</string>
@@ -501,27 +510,27 @@
     <string name="permlab_manageNetworkPolicy" msgid="2562053592339859990">"võrgueeskirjade haldamine"</string>
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Võimaldab rakendusel hallata võrgueeskirju ja määratleda rakendusespetsiifilisi reegleid."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"võrgukasutuse arvestamise muutmine"</string>
-    <string name="permdesc_modifyNetworkAccounting" msgid="8553240749784321765">"Võimaldab rakendusel muuta võrgukasutuse loendamist rakenduste suhtes. Mitte kasutada tavarakenduste puhul."</string>
+    <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Võimaldab rakendusel muuta võrgukasutuse loendamist rakenduste suhtes. Mitte kasutada tavarakenduste puhul."</string>
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Parooli reeglite määramine"</string>
-    <string name="policydesc_limitPassword" msgid="9083400080861728056">"Ekraaniluku paroolide lubatud pikkuse ja tähemärkide kontrollimine"</string>
+    <string name="policydesc_limitPassword" msgid="3252114203919510394">"Kontrollige ekraaniluku avamise paroolide pikkust ja tähemärke."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Ekraani avamiskatsed"</string>
     <string name="policydesc_watchLogin" product="tablet" msgid="3215729294215070072">"Jälgib ekraani avamisel valesti sisestatud paroolide arvu ja lukustab tahvelarvuti või kustutab kõik selle andmed, kui vale parool sisestatakse liiga palju kordi."</string>
     <string name="policydesc_watchLogin" product="default" msgid="5712323091846761073">"Jälgib ekraani avamisel valesti sisestatud paroolide arvu ja lukustab telefoni või kustutab kõik selle andmed, kui vale parool sisestatakse liiga palju kordi."</string>
     <string name="policylab_resetPassword" msgid="2620077191242688955">"Ekraaniluku parooli muutmine"</string>
-    <string name="policydesc_resetPassword" msgid="5391240616981297361">"Ekraaniluku parooli muutmine"</string>
+    <string name="policydesc_resetPassword" msgid="605963962301904458">"Ekraaniluku parooli muutmine."</string>
     <string name="policylab_forceLock" msgid="2274085384704248431">"Ekraani lukustamine"</string>
-    <string name="policydesc_forceLock" msgid="5696964126226028442">"Juhtige, kuidas ja millal ekraan lukustub"</string>
+    <string name="policydesc_forceLock" msgid="1141797588403827138">"Määrake, kuidas ja millal ekraan lukustub."</string>
     <string name="policylab_wipeData" msgid="3910545446758639713">"Kõikide andmete kustutamine"</string>
-    <string name="policydesc_wipeData" product="tablet" msgid="314455232799486222">"Tahvelarvuti andmete hoiatuseta kustutamine, lähtestades tehaseandmed"</string>
-    <string name="policydesc_wipeData" product="default" msgid="7669895333814222586">"Telefoniandmete hoiatuseta kustutamine, lähtestades tehaseandmed"</string>
+    <string name="policydesc_wipeData" product="tablet" msgid="4306184096067756876">"Kustutage tahvelarvuti andmed hoiatamata, lähtestades arvuti tehaseandmetele."</string>
+    <string name="policydesc_wipeData" product="default" msgid="5096895604574188391">"Kustuta telefoniandmed hoiatuseta, lähtestades telefoni tehaseandmetele."</string>
     <string name="policylab_setGlobalProxy" msgid="2784828293747791446">"Määra seadme globaalne puhverserver"</string>
     <string name="policydesc_setGlobalProxy" msgid="6387497466660154931">"Eeskirjade lubamise ajal kasutatava seadme globaalse puhverserveri määramine. Ainult esimese seadme administraator määrab tõhusa globaalse puhverserveri."</string>
     <string name="policylab_expirePassword" msgid="885279151847254056">"Ekraaniluku parooli aegumise määramine"</string>
-    <string name="policydesc_expirePassword" msgid="4844430354224822074">"Juhib, kui sageli ekraaniluku parooli tuleb muuta"</string>
+    <string name="policydesc_expirePassword" msgid="1729725226314691591">"Määrake ekraaniluku parooli muutmissagedus."</string>
     <string name="policylab_encryptedStorage" msgid="8901326199909132915">"Salvestamise krüpt. määramine"</string>
-    <string name="policydesc_encryptedStorage" msgid="8877192718681120469">"Nõue, et salvestatud rakenduse andmed krüpteeritakse"</string>
+    <string name="policydesc_encryptedStorage" msgid="2637732115325316992">"Nõua salvestatud rakenduse andmete krüpteerimist."</string>
     <string name="policylab_disableCamera" msgid="6395301023152297826">"Keela kaamerad"</string>
-    <string name="policydesc_disableCamera" msgid="5680054212889413366">"Väldi kõigi seadme kaamerate kasutamist"</string>
+    <string name="policydesc_disableCamera" msgid="2306349042834754597">"Vältige seadme kõigi kaamerate kasutamist."</string>
   <string-array name="phoneTypes">
     <item msgid="8901098336658710359">"Kodu"</item>
     <item msgid="869923650527136615">"Mobiil"</item>
@@ -642,7 +651,7 @@
     <string name="keyguard_password_entry_touch_hint" msgid="7858547464982981384"><font size="17">"Puudutage parooli sisestamiseks"</font></string>
     <string name="keyguard_password_enter_password_code" msgid="1054721668279049780">"Avamiseks sisestage parool"</string>
     <string name="keyguard_password_enter_pin_password_code" msgid="6391755146112503443">"Avamiseks sisestage PIN-kood"</string>
-    <string name="keyguard_password_wrong_pin_code" msgid="1295984114338107718">"Vale PIN-kood."</string>
+    <string name="keyguard_password_wrong_pin_code" msgid="2422225591006134936">"Vale PIN-kood."</string>
     <string name="keyguard_label_text" msgid="861796461028298424">"Avamiseks vajutage menüüklahvi, seejärel klahvi 0."</string>
     <string name="emergency_call_dialog_number_for_display" msgid="696192103195090970">"Hädaabinumber"</string>
     <string name="lockscreen_carrier_default" msgid="8963839242565653192">"Teenus puudub."</string>
@@ -655,6 +664,7 @@
     <string name="lockscreen_pattern_correct" msgid="9039008650362261237">"Õige."</string>
     <string name="lockscreen_pattern_wrong" msgid="4317955014948108794">"Proovige uuesti"</string>
     <string name="lockscreen_password_wrong" msgid="5737815393253165301">"Proovige uuesti"</string>
+    <string name="faceunlock_multiple_failures" msgid="754137583022792429">"Maksimaalne teenusega Face Unlock avamise katsete arv on ületatud"</string>
     <string name="lockscreen_plugged_in" msgid="8057762828355572315">"Laadimine, <xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
     <string name="lockscreen_charged" msgid="4938930459620989972">"Laetud."</string>
     <string name="lockscreen_battery_short" msgid="3617549178603354656">"<xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
@@ -688,14 +698,14 @@
     <string name="lockscreen_too_many_failed_attempts_countdown" msgid="6251480343394389665">"Proovige uuesti <xliff:g id="NUMBER">%d</xliff:g> sekundi pärast."</string>
     <string name="lockscreen_forgot_pattern_button_text" msgid="2626999449610695930">"Kas unustasite mustri?"</string>
     <string name="lockscreen_glogin_forgot_pattern" msgid="2588521501166032747">"Konto avamine"</string>
-    <string name="lockscreen_glogin_too_many_attempts" msgid="2446246026221678244">"Liiga palju mustrikatseid."</string>
-    <string name="lockscreen_glogin_instructions" msgid="1816635201812207709">"Avamiseks logige sisse oma Google\'i kontoga"</string>
+    <string name="lockscreen_glogin_too_many_attempts" msgid="2751368605287288808">"Liiga palju mustrikatseid"</string>
+    <string name="lockscreen_glogin_instructions" msgid="3931816256100707784">"Avamiseks logige sisse oma Google\'i kontoga."</string>
     <string name="lockscreen_glogin_username_hint" msgid="8846881424106484447">"Kasutajanimi (e-post)"</string>
     <string name="lockscreen_glogin_password_hint" msgid="5958028383954738528">"Parool"</string>
     <string name="lockscreen_glogin_submit_button" msgid="7130893694795786300">"Logi sisse"</string>
     <string name="lockscreen_glogin_invalid_input" msgid="1364051473347485908">"Vale kasutajanimi või parool."</string>
-    <string name="lockscreen_glogin_account_recovery_hint" msgid="8253152905532900548">"Kas unustasite oma kasutajanime või parooli?"\n"Külastage aadressi "<b>"google.com/accounts/recovery"</b></string>
-    <string name="lockscreen_glogin_checking_password" msgid="6758890536332363322">"Kontrollimine ..."</string>
+    <string name="lockscreen_glogin_account_recovery_hint" msgid="1696924763690379073">"Kas unustasite oma kasutajanime või parooli?"\n"Külastage aadressi "<b>"google.com/accounts/recovery"</b>"."</string>
+    <string name="lockscreen_glogin_checking_password" msgid="7114627351286933867">"Kontrollimine ..."</string>
     <string name="lockscreen_unlock_label" msgid="737440483220667054">"Ava"</string>
     <string name="lockscreen_sound_on_label" msgid="9068877576513425970">"Heli sisse"</string>
     <string name="lockscreen_sound_off_label" msgid="996822825154319026">"Heli välja"</string>
@@ -712,13 +722,13 @@
     <string name="factorytest_not_system" msgid="4435201656767276723">"Toimingut FACTORY_TEST toetatakse ainult kausta \\system\\app installitud pakettide puhul."</string>
     <string name="factorytest_no_action" msgid="872991874799998561">"Ei leitud ühtegi paketti, mis võimaldaks toimingut FACTORY_TEST."</string>
     <string name="factorytest_reboot" msgid="6320168203050791643">"Taaskäivita"</string>
-    <string name="js_dialog_title" msgid="8143918455087008109">"Veebileht aadressil <xliff:g id="TITLE">%s</xliff:g> ütleb:"</string>
+    <string name="js_dialog_title" msgid="1987483977834603872">"Leht  „<xliff:g id="TITLE">%s</xliff:g>” ütleb järgmist."</string>
     <string name="js_dialog_title_default" msgid="6961903213729667573">"JavaScript"</string>
-    <string name="js_dialog_before_unload" msgid="730366588032430474">"Kas soovite sellelt lehelt lahkuda?"\n\n"<xliff:g id="MESSAGE">%s</xliff:g>"\n\n"Jätkamiseks puudutage OK, praegusele lehele jäämiseks valikut Tühista."</string>
+    <string name="js_dialog_before_unload" msgid="730366588032430474">"Kas soovite sellelt lehelt lahkuda?"\n\n"<xliff:g id="MESSAGE">%s</xliff:g>"\n\n"Jätkamiseks puudutage valikut OK, praegusele lehele jäämiseks valikut Tühista."</string>
     <string name="save_password_label" msgid="6860261758665825069">"Kinnita"</string>
-    <string name="double_tap_toast" msgid="2729045387923870404">"Vihje: suurendamiseks ja vähendamiseks puudutage kaks korda."</string>
-    <string name="autofill_this_form" msgid="1272247532604569872">"Autom."</string>
-    <string name="setup_autofill" msgid="8154593408885654044">"Aut. täit. sead."</string>
+    <string name="double_tap_toast" msgid="4595046515400268881">"Vihje: suurendamiseks ja vähendamiseks puudutage kaks korda."</string>
+    <string name="autofill_this_form" msgid="4616758841157816676">"Automaatne täitmine"</string>
+    <string name="setup_autofill" msgid="7103495070180590814">"Automaatse täitmise seadistamine"</string>
     <string name="autofill_address_name_separator" msgid="2504700673286691795">" "</string>
     <string name="autofill_address_summary_name_format" msgid="3268041054899214945">"$1$2$3"</string>
     <string name="autofill_address_summary_separator" msgid="7483307893170324129">", "</string>
@@ -853,9 +863,9 @@
     <string name="weeks" msgid="6509623834583944518">"nädalat"</string>
     <string name="year" msgid="4001118221013892076">"aasta"</string>
     <string name="years" msgid="6881577717993213522">"aastat"</string>
-    <string name="VideoView_error_title" msgid="5927895235831021723">"Videot ei saa esitada"</string>
+    <string name="VideoView_error_title" msgid="3534509135438353077">"Probleem videoga"</string>
     <string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"See video ei sobi voogesituseks selles seadmes."</string>
-    <string name="VideoView_error_text_unknown" msgid="4309847331399592194">"Seda videot ei saa esitada."</string>
+    <string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Videot ei saa esitada."</string>
     <string name="VideoView_error_button" msgid="2822238215100679592">"OK"</string>
     <string name="relative_time" msgid="1818557177829411417">"<xliff:g id="DATE">%1$s</xliff:g>, <xliff:g id="TIME">%2$s</xliff:g>"</string>
     <string name="noon" msgid="7245353528818587908">"keskpäev"</string>
@@ -891,7 +901,7 @@
     <string name="whichApplication" msgid="4533185947064773386">"Lõpetage toiming rakendusega"</string>
     <string name="alwaysUse" msgid="4583018368000610438">"Kasuta vaikimisi selleks toiminguks."</string>
     <string name="clearDefaultHintMsg" msgid="3252584689512077257">"Tühjendage vaikeandmed valikutes Süsteemiseaded &gt; Rakendused &gt; Allalaaditud."</string>
-    <string name="chooseActivity" msgid="1009246475582238425">"Valige toiming"</string>
+    <string name="chooseActivity" msgid="7486876147751803333">"Toimingu valimine"</string>
     <string name="chooseUsbActivity" msgid="6894748416073583509">"USB-seadme jaoks rakenduse valimine"</string>
     <string name="noApplications" msgid="2991814273936504689">"Ükski rakendus ei saa seda toimingut teostada."</string>
     <string name="aerr_title" msgid="1905800560317137752"></string>
@@ -905,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"OK"</string>
     <string name="report" msgid="4060218260984795706">"Teata"</string>
     <string name="wait" msgid="7147118217226317732">"Oodake"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"Leht ei reageeri."\n\n"Kas soovite selle sulgeda?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Rakendus on ümber suunatud"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> on nüüd käivitunud."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"Algselt käivitati rakendus <xliff:g id="APP_NAME">%1$s</xliff:g>."</string>
@@ -925,11 +936,11 @@
     <string name="old_app_description" msgid="2082094275580358049">"Ärge käivitage uut rakendust."</string>
     <string name="new_app_action" msgid="5472756926945440706">"Käivitage rakendus <xliff:g id="OLD_APP">%1$s</xliff:g>"</string>
     <string name="new_app_description" msgid="1932143598371537340">"Peatage vana rakendus salvestamata."</string>
-    <string name="sendText" msgid="5132506121645618310">"Valige teksti jaoks toiming"</string>
+    <string name="sendText" msgid="5209874571959469142">"Valige teksti jaoks toiming"</string>
     <string name="volume_ringtone" msgid="6885421406845734650">"Helina helitugevus"</string>
     <string name="volume_music" msgid="5421651157138628171">"Meediumi helitugevus"</string>
     <string name="volume_music_hint_playing_through_bluetooth" msgid="9165984379394601533">"Esitatakse Bluetoothi kaudu"</string>
-    <string name="volume_music_hint_silent_ringtone_selected" msgid="6158339745293431194">"Valitud on hääletu helin"</string>
+    <string name="volume_music_hint_silent_ringtone_selected" msgid="8310739960973156272">"Valitud on hääletu märguanne"</string>
     <string name="volume_call" msgid="3941680041282788711">"Kõne helitugevus"</string>
     <string name="volume_bluetooth_call" msgid="2002891926351151534">"Bluetoothi kõne helitugevus"</string>
     <string name="volume_alarm" msgid="1985191616042689100">"Alarmi helitugevus"</string>
@@ -953,17 +964,22 @@
     <item quantity="one" msgid="1634101450343277345">"Avatud WiFi võrk on saadaval"</item>
     <item quantity="other" msgid="7915895323644292768">"Avatud WiFi-võrgud on saadaval"</item>
   </plurals>
-    <string name="wifi_available_sign_in" msgid="9157196203958866662">"Logi sisse WiFi-võrku"</string>
+    <string name="wifi_available_sign_in" msgid="4029489716605255386">"Logige sisse WiFi-võrku"</string>
     <!-- no translation found for wifi_available_sign_in_detailed (6797764740339907572) -->
     <skip />
     <string name="wifi_watchdog_network_disabled" msgid="7904214231651546347">"Ei saanud WiFi-ga ühendust"</string>
-    <string name="wifi_watchdog_network_disabled_detailed" msgid="4917472096696322767">" on halb Interneti-ühendus."</string>
+    <string name="wifi_watchdog_network_disabled_detailed" msgid="5548780776418332675">" on halb Interneti-ühendus."</string>
     <string name="wifi_p2p_dialog_title" msgid="97611782659324517">"WiFi Direct"</string>
-    <string name="wifi_p2p_turnon_message" msgid="2804722042556269129">"Käivitage WiFi Directi töö. See lülitab WiFi-kliendi/-tööpunkti töö välja."</string>
-    <string name="wifi_p2p_failed_message" msgid="1820097493844848281">"Otsese WiFi-ühenduse käivitamine ebaõnnestus"</string>
-    <string name="wifi_p2p_pbc_go_negotiation_request_message" msgid="3170321684621420428">"WiFi Directi ühenduse seadistamise taotlus seadmelt <xliff:g id="P2P_DEVICE_ADDRESS">%1$s</xliff:g>. Nõustumiseks klõpsake OK."</string>
-    <string name="wifi_p2p_pin_go_negotiation_request_message" msgid="5177412094633377308">"WiFi Directi ühenduse seadistuse taotlus seadmelt <xliff:g id="P2P_DEVICE_ADDRESS">%1$s</xliff:g>. Jätkamiseks sisestage PIN-kood."</string>
-    <string name="wifi_p2p_pin_display_message" msgid="2834049169114922902">"Jätkamiseks tuleb ühenduse seadistamise eesmärgil sisestada partnerseadmesse <xliff:g id="P2P_CLIENT_ADDRESS">%2$s</xliff:g> WPS-i PIN-kood <xliff:g id="P2P_WPS_PIN">%1$s</xliff:g>."</string>
+    <string name="wifi_p2p_turnon_message" msgid="2909250942299627244">"Käivitage WiFi otseühendus. See lülitab välja WiFi kliendi/leviala."</string>
+    <string name="wifi_p2p_failed_message" msgid="3763669677935623084">"WiFi otseühenduse käivitamine ebaõnnestus."</string>
+    <string name="accept" msgid="1645267259272829559">"Nõustu"</string>
+    <string name="decline" msgid="2112225451706137894">"Keeldu"</string>
+    <string name="wifi_p2p_invitation_sent_title" msgid="1318975185112070734">"Kutse on saadetud"</string>
+    <string name="wifi_p2p_invitation_to_connect_title" msgid="4958803948658533637">"Kutse ühendamiseks"</string>
+    <string name="wifi_p2p_from_message" msgid="570389174731951769">"Saatja:"</string>
+    <string name="wifi_p2p_to_message" msgid="248968974522044099">"Saaja:"</string>
+    <string name="wifi_p2p_enter_pin_message" msgid="5920929550367828970">"Sisestage nõutav PIN-kood:"</string>
+    <string name="wifi_p2p_show_pin_message" msgid="8530563323880921094">"PIN-kood:"</string>
     <string name="wifi_p2p_enabled_notification_title" msgid="2068321881673734886">"WiFi Direct on sees"</string>
     <string name="wifi_p2p_enabled_notification_message" msgid="1638949953993894335">"Puuted seadete jaoks"</string>
     <string name="select_character" msgid="3365550120617701745">"Sisesta tähemärk"</string>
@@ -976,7 +992,7 @@
     <string name="sim_removed_message" msgid="2333164559970958645">"Mobiilsidevõrk ei ole saadaval, kuni sisestate kehtiva SIM-kaardi ja taaskäivitate seadme."</string>
     <string name="sim_done_button" msgid="827949989369963775">"Valmis"</string>
     <string name="sim_added_title" msgid="3719670512889674693">"SIM-kaart lisatud"</string>
-    <string name="sim_added_message" msgid="1209265974048554242">"Mobiilsidevõrku pääsemiseks peate oma seadme taaskäivitama."</string>
+    <string name="sim_added_message" msgid="6599945301141050216">"Mobiilsidevõrku pääsemiseks taaskäivitage seade."</string>
     <string name="sim_restart_button" msgid="4722407842815232347">"Taaskäivita"</string>
     <string name="time_picker_dialog_title" msgid="8349362623068819295">"Kellaaja määramine"</string>
     <string name="date_picker_dialog_title" msgid="5879450659453782278">"Kuupäeva määramine"</string>
@@ -985,31 +1001,31 @@
     <string name="no_permissions" msgid="7283357728219338112">"Lube pole vaja"</string>
     <string name="perms_hide" msgid="7283915391320676226"><b>"Peida"</b></string>
     <string name="perms_show_all" msgid="2671791163933091180"><b>"Näita kõiki"</b></string>
-    <string name="usb_storage_activity_title" msgid="2399289999608900443">"USB-massmälu"</string>
+    <string name="usb_storage_activity_title" msgid="4465055157209648641">"USB-massmälu"</string>
     <string name="usb_storage_title" msgid="5901459041398751495">"USB ühendatud"</string>
-    <string name="usb_storage_message" product="nosdcard" msgid="6631094834151575841">"Olete arvutiga USB kaudu ühendatud. Puudutage allolevat nuppu, kui soovite faile arvuti ja Androidi USB-mäluseadme vahel kopeerida."</string>
-    <string name="usb_storage_message" product="default" msgid="4510858346516069238">"Olete arvutiga USB kaudu ühendatud. Puudutage allolevat nuppu, kui soovite faile arvuti ja Androidi SD-kaardi vahel kopeerida."</string>
+    <string name="usb_storage_message" product="nosdcard" msgid="3308538094316477839">"Teil on arvutiga ühendus USB kaudu. Puudutage allolevat nuppu, kui soovite faile arvuti ja Androidi USB-salvestusruumi vahel kopeerida."</string>
+    <string name="usb_storage_message" product="default" msgid="805351000446037811">"Olete arvutiga ühendatud USB kaudu. Puudutage allolevat nuppu, kui soovite faile arvuti ja Androidi SD-kaardi vahel kopeerida."</string>
     <string name="usb_storage_button_mount" msgid="1052259930369508235">"Lülita USB-mäluseade sisse"</string>
-    <string name="usb_storage_error_message" product="nosdcard" msgid="3276413764430468454">"Probleem USB-mäluseadme kasutamisel USB-mäluseadmena."</string>
-    <string name="usb_storage_error_message" product="default" msgid="120810397713773275">"Probleem SD-kaardi kasutamisel USB-mäluseadmena."</string>
+    <string name="usb_storage_error_message" product="nosdcard" msgid="3017045217365540658">"Probleem USB-salvestusruumi kasutamisel USB-mäluseadmena."</string>
+    <string name="usb_storage_error_message" product="default" msgid="2876018512716970313">"Probleem SD-kaardi kasutamisel USB-mäluseadmena."</string>
     <string name="usb_storage_notification_title" msgid="8175892554757216525">"USB ühendatud"</string>
-    <string name="usb_storage_notification_message" msgid="7380082404288219341">"Valige failide kopeerimiseks arvutist/arvutisse."</string>
+    <string name="usb_storage_notification_message" msgid="939822783828183763">"Puudutage, et kopeerida faile arvutist/arvutisse."</string>
     <string name="usb_storage_stop_notification_title" msgid="2336058396663516017">"Lülita USB-mäluseade välja"</string>
-    <string name="usb_storage_stop_notification_message" msgid="2591813490269841539">"Valige USB-mäluseadme väljalülitamiseks."</string>
+    <string name="usb_storage_stop_notification_message" msgid="1656852098555623822">"USB-salvestusruumi väljalülitamiseks puudutage."</string>
     <string name="usb_storage_stop_title" msgid="660129851708775853">"USB kasutusel"</string>
-    <string name="usb_storage_stop_message" product="nosdcard" msgid="1368842269463745067">"Enne USB-mäluseadme väljalülitamist veenduge, et olete oma Androidi USB-mäluseadme arvutist eemaldanud (väljutanud)."</string>
-    <string name="usb_storage_stop_message" product="default" msgid="3613713396426604104">"Enne USB-seadme väljalülitamist veenduge, et olete oma Androidi SD-kaardi arvutist eemaldanud (“väljutanud“)."</string>
+    <string name="usb_storage_stop_message" product="nosdcard" msgid="4264025280777219521">"Enne USB-salvestusruumi väljalülitamist eraldage (väljutage) Androidi USB-salvestusruum arvutist."</string>
+    <string name="usb_storage_stop_message" product="default" msgid="8043969782460613114">"Enne USB-salvestusruumi väljalülitamist eemaldage (väljutage) Androidi SD-kaart arvutist."</string>
     <string name="usb_storage_stop_button_mount" msgid="7060218034900696029">"Lülita USB-mäluseade välja"</string>
-    <string name="usb_storage_stop_error_message" msgid="143881914840412108">"USB-mäluseadme väljalülitamisel ilmnes probleem. Veenduge, et olete USB-hosti eemaldanud ja proovige siis uuesti."</string>
+    <string name="usb_storage_stop_error_message" msgid="1970374898263063836">"Tekkis probleem USB-salvestusruumi väljalülitamisega. Kontrollige, kas olete USB-hosti eemaldanud, ja proovige seejärel uuesti."</string>
     <string name="dlg_confirm_kill_storage_users_title" msgid="963039033470478697">"Lülita USB-mäluseade sisse"</string>
-    <string name="dlg_confirm_kill_storage_users_text" msgid="6206212680430268343">"USB-seadme sisselülitamisel peatuvad mõned teie kasutatavad rakendused ja on võimalik, et neid ei saa kasutada seni, kuni USB-seadme välja lülitate."</string>
+    <string name="dlg_confirm_kill_storage_users_text" msgid="5100428757107469454">"Kui lülitate USB-salvestusruumi sisse, võivad mõned kasutatavad rakendused peatuda ega pruugi olla saadaval enne USB-salvestusruumi väljalülitamist."</string>
     <string name="dlg_error_title" msgid="7323658469626514207">"USB toiming ebaõnnestus"</string>
     <string name="dlg_ok" msgid="7376953167039865701">"OK"</string>
     <string name="usb_mtp_notification_title" msgid="3699913097391550394">"Ühendatud meediumiseadmena"</string>
     <string name="usb_ptp_notification_title" msgid="1960817192216064833">"Ühendatud kaamerana"</string>
     <string name="usb_cd_installer_notification_title" msgid="6774712827892090754">"Ühendatud installijana"</string>
     <string name="usb_accessory_notification_title" msgid="7848236974087653666">"Ühendatud USB-lisaseadmega"</string>
-    <string name="usb_notification_message" msgid="4447869605109736382">"Puudutage teiste USB-valikute kuvamiseks"</string>
+    <string name="usb_notification_message" msgid="2290859399983720271">"Puudutage teisi USB valikuid."</string>
     <string name="extmedia_format_title" product="nosdcard" msgid="9020092196061007262">"Vormind. USB-seade?"</string>
     <string name="extmedia_format_title" product="default" msgid="3648415921526526069">"Kas vormindada SD-kaart?"</string>
     <string name="extmedia_format_message" product="nosdcard" msgid="3934016853425761078">"Kõik USB-mäluseadmele salvestatud failid kustutatakse. Seda toimingut ei saa tagasi võtta."</string>
@@ -1027,12 +1043,12 @@
     <string name="ext_media_checking_notification_message" msgid="8287319882926737053">"Vigade kontrollimine."</string>
     <string name="ext_media_nofs_notification_title" product="nosdcard" msgid="7788040745686229307">"Tühi USB-mäluseade"</string>
     <string name="ext_media_nofs_notification_title" product="default" msgid="780477838241212997">"Tühi SD-kaart"</string>
-    <string name="ext_media_nofs_notification_message" product="nosdcard" msgid="8623130522556087311">"USB-mäluseade on tühi või toetuseta failisüsteemiga."</string>
-    <string name="ext_media_nofs_notification_message" product="default" msgid="3817704088027829380">"SD-kaart on tühi või toetuseta failisüsteemiga."</string>
+    <string name="ext_media_nofs_notification_message" product="nosdcard" msgid="7840121067427269500">"USB-salvestusruum on tühi või ei toeta failisüsteemi."</string>
+    <string name="ext_media_nofs_notification_message" product="default" msgid="8641065641786923604">"SD-kaart on tühi või ei toetata selle failisüsteemi."</string>
     <string name="ext_media_unmountable_notification_title" product="nosdcard" msgid="2090046769532713563">"Kahjustatud USB-mäluseade"</string>
     <string name="ext_media_unmountable_notification_title" product="default" msgid="6410723906019100189">"Kahjustatud SD-kaart"</string>
-    <string name="ext_media_unmountable_notification_message" product="nosdcard" msgid="529021299294450667">"USB-mäluseade on kahjustatud. Võib-olla peate selle uuesti vormindama."</string>
-    <string name="ext_media_unmountable_notification_message" product="default" msgid="6902531775948238989">"SD-kaart on kahjustatud. Võib-olla peale selle uuesti vormindama."</string>
+    <string name="ext_media_unmountable_notification_message" product="nosdcard" msgid="1795917578395333280">"USB-salvestusruum on kahjustatud. Proovige uuesti vormindada."</string>
+    <string name="ext_media_unmountable_notification_message" product="default" msgid="1753898567525568253">"SD-kaart on kahjustatud. Proovige uuesti vormindada."</string>
     <string name="ext_media_badremoval_notification_title" product="nosdcard" msgid="1661683031330951073">"USB-seade eemaldati ootamatult"</string>
     <string name="ext_media_badremoval_notification_title" product="default" msgid="6872152882604407837">"SD-kaart on ootamatult eemaldatud"</string>
     <string name="ext_media_badremoval_notification_message" product="nosdcard" msgid="4329848819865594241">"Andmekao vältimiseks lahutage USB-mäluseade enne eemaldamist."</string>
@@ -1045,13 +1061,13 @@
     <string name="ext_media_nomedia_notification_title" product="default" msgid="8902518030404381318">"Eemaldatud SD-kaart"</string>
     <string name="ext_media_nomedia_notification_message" product="nosdcard" msgid="6921126162580574143">"USB-mäluseade eemaldatud. Sisestage uus meedium."</string>
     <string name="ext_media_nomedia_notification_message" product="default" msgid="3870120652983659641">"SD-kaart on eemaldatud. Sisestage uus."</string>
-    <string name="activity_list_empty" msgid="4168820609403385789">"Sobivat tegevust ei leitud"</string>
+    <string name="activity_list_empty" msgid="1675388330786841066">"Sobivat tegevust ei leitud"</string>
     <string name="permlab_pkgUsageStats" msgid="8787352074326748892">"värskenda komponentide kasutusstatistikat"</string>
     <string name="permdesc_pkgUsageStats" msgid="1106612424254277630">"Võimaldab rakendusel muuta komponendi kohta kogutud kasutusstatistikat. Mitte kasutada tavarakenduste puhul."</string>
     <string name="permlab_copyProtectedData" msgid="4341036311211406692">"Sisu kopeerimine"</string>
     <string name="permdesc_copyProtectedData" msgid="4390697124288317831">"Võimaldab rakendusel võtta sisu kopeerimiseks appi vaikekonteinerteenuse. Mitte kasutada tavarakenduste puhul."</string>
     <string name="tutorial_double_tap_to_zoom_message_short" msgid="4070433208160063538">"Suumi juhtimiseks puudutage kaks korda"</string>
-    <string name="gadget_host_error_inflating" msgid="2613287218853846830">"Viga vidina täitmisel"</string>
+    <string name="gadget_host_error_inflating" msgid="4882004314906466162">"Vidinat ei saanud lisada."</string>
     <string name="ime_action_go" msgid="8320845651737369027">"Mine"</string>
     <string name="ime_action_search" msgid="658110271822807811">"Otsing"</string>
     <string name="ime_action_send" msgid="2316166556349314424">"Saada"</string>
@@ -1063,35 +1079,35 @@
     <string name="create_contact_using" msgid="4947405226788104538">"Loo kontakt"\n"numbriga <xliff:g id="NUMBER">%s</xliff:g>"</string>
     <string name="grant_credentials_permission_message_header" msgid="2106103817937859662">"Üks või mitu rakendust taotlevad luba pääseda nüüd ja edaspidi teie kontole juurde."</string>
     <string name="grant_credentials_permission_message_footer" msgid="3125211343379376561">"Kas soovite taotluse lubada?"</string>
-    <string name="grant_permissions_header_text" msgid="2722567482180797717">"Juurdepääsutaotlus"</string>
+    <string name="grant_permissions_header_text" msgid="6874497408201826708">"Juurdepääsutaotlus"</string>
     <string name="allow" msgid="7225948811296386551">"Luba"</string>
     <string name="deny" msgid="2081879885755434506">"Keela"</string>
-    <string name="permission_request_notification_title" msgid="5390555465778213840">"Luba taotletud"</string>
-    <string name="permission_request_notification_with_subtitle" msgid="4325409589686688000">"Luba taotletud"\n"kontole <xliff:g id="ACCOUNT">%s</xliff:g>"</string>
+    <string name="permission_request_notification_title" msgid="6486759795926237907">"Taotletud luba"</string>
+    <string name="permission_request_notification_with_subtitle" msgid="8530393139639560189">"Luba on taotletud"\n"kontole <xliff:g id="ACCOUNT">%s</xliff:g>."</string>
     <string name="input_method_binding_label" msgid="1283557179944992649">"Sisestusmeetod"</string>
     <string name="sync_binding_label" msgid="3687969138375092423">"Sünkroonimine"</string>
     <string name="accessibility_binding_label" msgid="4148120742096474641">"Juurdepääsetavus"</string>
     <string name="wallpaper_binding_label" msgid="1240087844304687662">"Taustapilt"</string>
     <string name="chooser_wallpaper" msgid="7873476199295190279">"Muutke taustapilti"</string>
-    <string name="vpn_title" msgid="8219003246858087489">"VPN on aktiveeritud."</string>
+    <string name="vpn_title" msgid="19615213552042827">"VPN on aktiveeritud"</string>
     <string name="vpn_title_long" msgid="6400714798049252294">"VPN-i aktiveeris <xliff:g id="APP">%s</xliff:g>"</string>
-    <string name="vpn_text" msgid="1610714069627824309">"Koputage võrgu haldamiseks."</string>
-    <string name="vpn_text_long" msgid="4907843483284977618">"Ühendatud seansiga <xliff:g id="SESSION">%s</xliff:g>. Koputage võrgu haldamiseks"</string>
+    <string name="vpn_text" msgid="3011306607126450322">"Võrgu haldamiseks puudutage."</string>
+    <string name="vpn_text_long" msgid="6407351006249174473">"Ühendatud seansiga <xliff:g id="SESSION">%s</xliff:g>. Võrgu haldamiseks puudutage."</string>
     <string name="upload_file" msgid="2897957172366730416">"Valige fail"</string>
     <string name="no_file_chosen" msgid="6363648562170759465">"Ühtegi faili pole valitud"</string>
     <string name="reset" msgid="2448168080964209908">"Lähtesta"</string>
     <string name="submit" msgid="1602335572089911941">"Saada"</string>
     <string name="car_mode_disable_notification_title" msgid="3164768212003864316">"Autorežiim lubatud"</string>
-    <string name="car_mode_disable_notification_message" msgid="668663626721675614">"Valige autorežiimist väljumiseks."</string>
+    <string name="car_mode_disable_notification_message" msgid="8035230537563503262">"Autorežiimist väljumiseks puudutage."</string>
     <string name="tethered_notification_title" msgid="3146694234398202601">"Jagamine või tööpunkt on aktiivne"</string>
-    <string name="tethered_notification_message" msgid="3067108323903048927">"Puudutage seadistamiseks"</string>
+    <string name="tethered_notification_message" msgid="6857031760103062982">"Seadistamiseks puudutage."</string>
     <string name="back_button_label" msgid="2300470004503343439">"Tagasi"</string>
     <string name="next_button_label" msgid="1080555104677992408">"Järgmine"</string>
     <string name="skip_button_label" msgid="1275362299471631819">"Jäta vahele"</string>
     <string name="throttle_warning_notification_title" msgid="4890894267454867276">"Kõrge mobiilse andmeside kasutus"</string>
-    <string name="throttle_warning_notification_message" msgid="2609734763845705708">"Puudutage, et saada lisateavet mobiilse andmeside kasutamise kohta"</string>
+    <string name="throttle_warning_notification_message" msgid="3340822228599337743">"Mobiilse andmeside kasutamise kohta lisateabe saamiseks puudutage."</string>
     <string name="throttled_notification_title" msgid="6269541897729781332">"Mobiili andmemahupiirang ületatud"</string>
-    <string name="throttled_notification_message" msgid="4712369856601275146">"Puudutage, et saada lisateavet mobiilse andmeside kasutamise kohta"</string>
+    <string name="throttled_notification_message" msgid="5443457321354907181">"Mobiilse andmeside kasutamise kohta lisateabe saamiseks puudutage."</string>
     <string name="no_matches" msgid="8129421908915840737">"Vasted puuduvad"</string>
     <string name="find_on_page" msgid="1946799233822820384">"Otsige lehelt"</string>
   <plurals name="matches_found">
@@ -1099,10 +1115,10 @@
     <item quantity="other" msgid="4641872797067609177">"<xliff:g id="INDEX">%d</xliff:g>/<xliff:g id="TOTAL">%d</xliff:g>"</item>
   </plurals>
     <string name="action_mode_done" msgid="7217581640461922289">"Valmis"</string>
-    <string name="progress_unmounting" product="nosdcard" msgid="535863554318797377">"USB-mäluseadme lahutamine ..."</string>
-    <string name="progress_unmounting" product="default" msgid="5556813978958789471">"SD-kaardi lahutamine ..."</string>
-    <string name="progress_erasing" product="nosdcard" msgid="4183664626203056915">"USB-mäluseadme kustutamine ..."</string>
-    <string name="progress_erasing" product="default" msgid="2115214724367534095">"SD-kaardi kustutamine ..."</string>
+    <string name="progress_unmounting" product="nosdcard" msgid="3923810448507612746">"USB-salvestusruumi eemaldamine ..."</string>
+    <string name="progress_unmounting" product="default" msgid="1327894998409537190">"SD-kaardi eemaldamine ..."</string>
+    <string name="progress_erasing" product="nosdcard" msgid="4521573321524340058">"USB-salvestusruumi kustutamine ..."</string>
+    <string name="progress_erasing" product="default" msgid="6596988875507043042">"SD-kaardi kustutamine ..."</string>
     <string name="format_error" product="nosdcard" msgid="6299769563624776948">"USB-mäluseadme tühjendamine ebaõnnestus."</string>
     <string name="format_error" product="default" msgid="7315248696644510935">"SD-kaardi kustutamine ebaõnnestus."</string>
     <string name="media_bad_removal" msgid="7960864061016603281">"SD-kaart eemaldati enne lahutamist."</string>
@@ -1121,17 +1137,17 @@
     <string name="gpsVerifYes" msgid="2346566072867213563">"Jah"</string>
     <string name="gpsVerifNo" msgid="1146564937346454865">"Ei"</string>
     <string name="sync_too_many_deletes" msgid="5296321850662746890">"Kustutamiste piirarv on ületatud"</string>
-    <string name="sync_too_many_deletes_desc" msgid="7030265992955132593">"Sünkroonimise tüübi <xliff:g id="TYPE_OF_SYNC">%2$s</xliff:g> konto <xliff:g id="ACCOUNT_NAME">%3$s</xliff:g> kohta on <xliff:g id="NUMBER_OF_DELETED_ITEMS">%1$d</xliff:g> kustutatud üksust. Mida te teha sooviksite?"</string>
-    <string name="sync_really_delete" msgid="8933566316059338692">"Kustuta üksused."</string>
-    <string name="sync_undo_deletes" msgid="8610996708225006328">"Kustutamiste tagasivõtmine"</string>
-    <string name="sync_do_nothing" msgid="8717589462945226869">"Ära tee praegu midagi."</string>
+    <string name="sync_too_many_deletes_desc" msgid="496551671008694245">"Kustutatavad üksused kontol <xliff:g id="ACCOUNT_NAME">%3$s</xliff:g> sünkroonimistüübi <xliff:g id="TYPE_OF_SYNC">%2$s</xliff:g> jaoks: <xliff:g id="NUMBER_OF_DELETED_ITEMS">%1$d</xliff:g>. Mida soovite teha?"</string>
+    <string name="sync_really_delete" msgid="2572600103122596243">"Kustuta üksused"</string>
+    <string name="sync_undo_deletes" msgid="2941317360600338602">"Võtke kustutamised tagasi"</string>
+    <string name="sync_do_nothing" msgid="3743764740430821845">"Ära tee praegu midagi"</string>
     <string name="choose_account_label" msgid="5655203089746423927">"Konto valimine"</string>
     <string name="add_account_label" msgid="2935267344849993553">"Konto lisamine"</string>
-    <string name="choose_account_text" msgid="6891230675141555481">"Millist kontot sooviksite kasutada?"</string>
+    <string name="choose_account_text" msgid="6303348737197849675">"Millist kontot soovite kasutada?"</string>
     <string name="add_account_button_label" msgid="3611982894853435874">"Lisa konto"</string>
     <string name="number_picker_increment_button" msgid="4830170763103463443">"Suurenda"</string>
     <string name="number_picker_decrement_button" msgid="2576606679160067262">"Vähenda"</string>
-    <string name="number_picker_increment_scroll_mode" msgid="1343063395404990189">"<xliff:g id="VALUE">%s</xliff:g> – puudutage ja hoidke all."</string>
+    <string name="number_picker_increment_scroll_mode" msgid="3073101067441638428">"<xliff:g id="VALUE">%s</xliff:g> puudutage ja hoidke."</string>
     <string name="number_picker_increment_scroll_action" msgid="4628981789985093179">"Suurendamiseks lohistage üles, vähendamiseks alla."</string>
     <string name="time_picker_increment_minute_button" msgid="2843066823236250329">"Minutite arvu suurendamine"</string>
     <string name="time_picker_decrement_minute_button" msgid="4357907223628449595">"Minutite arvu vähendamine"</string>
@@ -1173,29 +1189,29 @@
     <string name="description_target_silent" msgid="893551287746522182">"Hääletu"</string>
     <string name="description_target_soundon" msgid="30052466675500172">"Heli on sees"</string>
     <string name="description_target_unlock_tablet" msgid="3833195335629795055">"Avamiseks tõmmake sõrmega."</string>
-    <string name="keyboard_headset_required_to_hear_password" msgid="5913502399391940888">"Ühendage peakomplekt, et kuulata paroole."</string>
+    <string name="keyboard_headset_required_to_hear_password" msgid="7011927352267668657">"Paroolide kuulamiseks ühendage peakomplekt."</string>
     <string name="keyboard_password_character_no_headset" msgid="2859873770886153678">"Punkt."</string>
     <string name="action_bar_home_description" msgid="5293600496601490216">"Liigu avalehele"</string>
     <string name="action_bar_up_description" msgid="2237496562952152589">"Liigu üles"</string>
     <string name="action_menu_overflow_description" msgid="2295659037509008453">"Rohkem valikuid"</string>
-    <string name="storage_internal" msgid="7556050805474115618">"Sisemälu"</string>
-    <string name="storage_sd_card" msgid="8921771478629812343">"SD-kaart"</string>
+    <string name="storage_internal" msgid="4891916833657929263">"Sisemine salvestusruum"</string>
+    <string name="storage_sd_card" msgid="3282948861378286745">"SD-kaart"</string>
     <string name="storage_usb" msgid="3017954059538517278">"USB-mäluseade"</string>
-    <string name="extract_edit_menu_button" msgid="302060189057163906">"Muuda ..."</string>
+    <string name="extract_edit_menu_button" msgid="8940478730496610137">"Muuda"</string>
     <string name="data_usage_warning_title" msgid="1955638862122232342">"Andmete kasutamise hoiatus"</string>
-    <string name="data_usage_warning_body" msgid="7217480745540055170">"Kas./sätete vaatamiseks puud.-ge"</string>
+    <string name="data_usage_warning_body" msgid="2814673551471969954">"Kasutuse/sätete vaat. puudutage."</string>
     <string name="data_usage_3g_limit_title" msgid="7093334419518706686">"2G–3G-andmeside on keelatud"</string>
     <string name="data_usage_4g_limit_title" msgid="7636489436819470761">"4G-andmeside on keelatud"</string>
     <string name="data_usage_mobile_limit_title" msgid="7869402519391631884">"Mobiilne andmeside on keelatud"</string>
     <string name="data_usage_wifi_limit_title" msgid="8992154736441284865">"WiFi-andmed on keelatud"</string>
-    <string name="data_usage_limit_body" msgid="4313857592916426843">"Puudutage lubamiseks"</string>
+    <string name="data_usage_limit_body" msgid="3317964706973601386">"Lubamiseks puudutage."</string>
     <string name="data_usage_3g_limit_snoozed_title" msgid="7026739121138005231">"2G-3G andmemahupiirang ületatud"</string>
     <string name="data_usage_4g_limit_snoozed_title" msgid="1106562779311209039">"4G andmemahupiirang ületatud"</string>
     <string name="data_usage_mobile_limit_snoozed_title" msgid="279240572165412168">"Mobiilne andmemahupiirang ületatud"</string>
     <string name="data_usage_wifi_limit_snoozed_title" msgid="8743856006384825974">"WiFi-andmete piir on ületatud"</string>
-    <string name="data_usage_limit_snoozed_body" msgid="2932736326652880660">"<xliff:g id="SIZE">%s</xliff:g> üle kindlaksmääratud piirmäära"</string>
+    <string name="data_usage_limit_snoozed_body" msgid="7035490278298441767">"<xliff:g id="SIZE">%s</xliff:g> üle määratud piirmäära."</string>
     <string name="data_usage_restricted_title" msgid="5965157361036321914">"Taustandmed on piiratud"</string>
-    <string name="data_usage_restricted_body" msgid="5087354814839059798">"Puudutage piirangu eemaldamiseks"</string>
+    <string name="data_usage_restricted_body" msgid="6741521330997452990">"Piirangu eemaldamiseks puudut."</string>
     <string name="ssl_certificate" msgid="6510040486049237639">"Turvasertifikaat"</string>
     <string name="ssl_certificate_is_valid" msgid="6825263250774569373">"See sertifikaat on kehtiv."</string>
     <string name="issued_to" msgid="454239480274921032">"Väljastatud subjektile:"</string>
@@ -1212,7 +1228,10 @@
     <string name="sha1_fingerprint" msgid="7930330235269404581">"SHA-1 sõrmejälg:"</string>
     <string name="activity_chooser_view_see_all" msgid="4292569383976636200">"Kuva kõik"</string>
     <string name="activity_chooser_view_dialog_title_default" msgid="4710013864974040615">"Tegevuse valimine"</string>
-    <string name="share_action_provider_share_with" msgid="5247684435979149216">"Jagamine kasutajaga"</string>
+    <string name="share_action_provider_share_with" msgid="5247684435979149216">"Jagamine rakendusega:"</string>
     <string name="status_bar_device_locked" msgid="3092703448690669768">"Seade lukustatud."</string>
     <string name="list_delimeter" msgid="3975117572185494152">", "</string>
+    <string name="sending" msgid="3245653681008218030">"Saatmine ..."</string>
+    <string name="launchBrowserDefault" msgid="2057951947297614725">"Kas käivitada brauser?"</string>
+    <string name="SetupCallDefault" msgid="5834948469253758575">"Kas vastata kõnele?"</string>
 </resources>
diff --git a/core/res/res/values-fa/strings.xml b/core/res/res/values-fa/strings.xml
index e2448f9..7097e43 100644
--- a/core/res/res/values-fa/strings.xml
+++ b/core/res/res/values-fa/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"تأیید"</string>
     <string name="report" msgid="4060218260984795706">"گزارش"</string>
     <string name="wait" msgid="7147118217226317732">"منتظر بمانید"</string>
+    <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>
diff --git a/core/res/res/values-fi/strings.xml b/core/res/res/values-fi/strings.xml
index 27a9bf4..0a60adb 100644
--- a/core/res/res/values-fi/strings.xml
+++ b/core/res/res/values-fi/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"OK"</string>
     <string name="report" msgid="4060218260984795706">"Ilmoita"</string>
     <string name="wait" msgid="7147118217226317732">"Odota"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"Sivu ei vastaa."\n\n"Haluatko sulkea sen?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Sovelluksen uud.ohjaus"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> on nyt käynnissä."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"<xliff:g id="APP_NAME">%1$s</xliff:g> käynnistettiin alun perin."</string>
diff --git a/core/res/res/values-fr/strings.xml b/core/res/res/values-fr/strings.xml
index c647570..d32f487 100644
--- a/core/res/res/values-fr/strings.xml
+++ b/core/res/res/values-fr/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"OK"</string>
     <string name="report" msgid="4060218260984795706">"Rapport"</string>
     <string name="wait" msgid="7147118217226317732">"Attendre"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"La page ne répond pas."\n" "\n"Voulez-vous la fermer ?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Application redirigée"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> est maintenant lancée."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"Application lancée initialement : <xliff:g id="APP_NAME">%1$s</xliff:g>."</string>
diff --git a/core/res/res/values-hi/strings.xml b/core/res/res/values-hi/strings.xml
index 3e440ca..7a4f706 100644
--- a/core/res/res/values-hi/strings.xml
+++ b/core/res/res/values-hi/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"ठीक"</string>
     <string name="report" msgid="4060218260984795706">"रिपोर्ट करें"</string>
     <string name="wait" msgid="7147118217226317732">"प्रतीक्षा करें"</string>
+    <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>
diff --git a/core/res/res/values-hr/strings.xml b/core/res/res/values-hr/strings.xml
index 460ec88..e37be22 100644
--- a/core/res/res/values-hr/strings.xml
+++ b/core/res/res/values-hr/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"U redu"</string>
     <string name="report" msgid="4060218260984795706">"Izvješće"</string>
     <string name="wait" msgid="7147118217226317732">"Pričekaj"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"Stranica ne reagira."\n\n"Želite li ju zatvoriti?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Aplikacija preusmjerena"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> se izvodi sada."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"Aplikacija <xliff:g id="APP_NAME">%1$s</xliff:g> pokrenuta je prva."</string>
diff --git a/core/res/res/values-hu/strings.xml b/core/res/res/values-hu/strings.xml
index 9278bde..9b3eb54 100644
--- a/core/res/res/values-hu/strings.xml
+++ b/core/res/res/values-hu/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"OK"</string>
     <string name="report" msgid="4060218260984795706">"Jelentés"</string>
     <string name="wait" msgid="7147118217226317732">"Várakozás"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"Az oldal nem válaszol."\n\n"Szeretné bezárni?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Alkalmazás átirányítva"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> éppen fut."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"<xliff:g id="APP_NAME">%1$s</xliff:g> volt eredetileg elindítva."</string>
diff --git a/core/res/res/values-in/strings.xml b/core/res/res/values-in/strings.xml
index 30fb875..b61fb42 100644
--- a/core/res/res/values-in/strings.xml
+++ b/core/res/res/values-in/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"OK"</string>
     <string name="report" msgid="4060218260984795706">"Laporkan"</string>
     <string name="wait" msgid="7147118217226317732">"Tunggu"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"Laman ini tidak menanggapi."\n\n"Apakah Anda ingin menutupnya?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Apl dialihkan"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> sedang berjalan."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"<xliff:g id="APP_NAME">%1$s</xliff:g> telah diluncurkan aslinya."</string>
diff --git a/core/res/res/values-it/strings.xml b/core/res/res/values-it/strings.xml
index 2cc182f..ebf7223 100644
--- a/core/res/res/values-it/strings.xml
+++ b/core/res/res/values-it/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"OK"</string>
     <string name="report" msgid="4060218260984795706">"Segnala"</string>
     <string name="wait" msgid="7147118217226317732">"Attendi"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"La pagina non risponde più."\n\n"Vuoi chiuderla?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Applicazione reindirizzata"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> è ora in esecuzione."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"<xliff:g id="APP_NAME">%1$s</xliff:g> già avviata."</string>
diff --git a/core/res/res/values-iw/strings.xml b/core/res/res/values-iw/strings.xml
index e9dd004..69d506e 100644
--- a/core/res/res/values-iw/strings.xml
+++ b/core/res/res/values-iw/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"אישור"</string>
     <string name="report" msgid="4060218260984795706">"שלח דוח"</string>
     <string name="wait" msgid="7147118217226317732">"המתן"</string>
+    <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>
diff --git a/core/res/res/values-ja/strings.xml b/core/res/res/values-ja/strings.xml
index 234f64c..cb958e4 100644
--- a/core/res/res/values-ja/strings.xml
+++ b/core/res/res/values-ja/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"OK"</string>
     <string name="report" msgid="4060218260984795706">"レポート"</string>
     <string name="wait" msgid="7147118217226317732">"待機"</string>
+    <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>
diff --git a/core/res/res/values-ko/strings.xml b/core/res/res/values-ko/strings.xml
index 804110c..216ac76 100644
--- a/core/res/res/values-ko/strings.xml
+++ b/core/res/res/values-ko/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"확인"</string>
     <string name="report" msgid="4060218260984795706">"신고"</string>
     <string name="wait" msgid="7147118217226317732">"대기"</string>
+    <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>
diff --git a/core/res/res/values-lt/strings.xml b/core/res/res/values-lt/strings.xml
index 9d6bd77..7f0370f 100644
--- a/core/res/res/values-lt/strings.xml
+++ b/core/res/res/values-lt/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"Gerai"</string>
     <string name="report" msgid="4060218260984795706">"Ataskaita"</string>
     <string name="wait" msgid="7147118217226317732">"Palaukti"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"Puslapis neatsako."\n\n"Ar norite jį uždaryti?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Programa peradresuota"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"„<xliff:g id="APP_NAME">%1$s</xliff:g>“ dabar vykdoma."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"„<xliff:g id="APP_NAME">%1$s</xliff:g>“ buvo iš pradžių paleista."</string>
diff --git a/core/res/res/values-lv/strings.xml b/core/res/res/values-lv/strings.xml
index 195059c..a052481 100644
--- a/core/res/res/values-lv/strings.xml
+++ b/core/res/res/values-lv/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"Labi"</string>
     <string name="report" msgid="4060218260984795706">"Pārskats"</string>
     <string name="wait" msgid="7147118217226317732">"Gaidīt"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"No lapas netiek saņemta atbilde."\n\n"Vai vēlaties to aizvērt?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Lietotne ir novirzīta"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> tagad darbojas."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"Sākotnēji tika palaista lietojumprogramma <xliff:g id="APP_NAME">%1$s</xliff:g>."</string>
diff --git a/core/res/res/values-ms/strings.xml b/core/res/res/values-ms/strings.xml
index a8e733f..f6189f2 100644
--- a/core/res/res/values-ms/strings.xml
+++ b/core/res/res/values-ms/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"OK"</string>
     <string name="report" msgid="4060218260984795706">"Laporkan"</string>
     <string name="wait" msgid="7147118217226317732">"Tunggu"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"Laman ini tidak bertindak balas. "\n\n"Adakah anda mahu menutupnya?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Apl diubah hala"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> kini sedang berjalan."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"<xliff:g id="APP_NAME">%1$s</xliff:g> pada asalnya telah dilancarkan."</string>
diff --git a/core/res/res/values-nb/strings.xml b/core/res/res/values-nb/strings.xml
index 7e3fb86..e03b735 100644
--- a/core/res/res/values-nb/strings.xml
+++ b/core/res/res/values-nb/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"OK"</string>
     <string name="report" msgid="4060218260984795706">"Rapportér"</string>
     <string name="wait" msgid="7147118217226317732">"Vent"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"Siden svarer ikke."\n\n"Vil du lukke den?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Appen er viderekoblet"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> kjører nå."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"<xliff:g id="APP_NAME">%1$s</xliff:g> ble opprinnelig startet."</string>
diff --git a/core/res/res/values-nl/strings.xml b/core/res/res/values-nl/strings.xml
index b956433..3a43b8e 100644
--- a/core/res/res/values-nl/strings.xml
+++ b/core/res/res/values-nl/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"OK"</string>
     <string name="report" msgid="4060218260984795706">"Rapport"</string>
     <string name="wait" msgid="7147118217226317732">"Wachten"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"De pagina reageert niet meer."\n\n"Wilt u de pagina sluiten?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"App verplaatst"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> is nu actief."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"<xliff:g id="APP_NAME">%1$s</xliff:g> was het eerst gestart."</string>
diff --git a/core/res/res/values-pl/strings.xml b/core/res/res/values-pl/strings.xml
index 9c713aa..e73f7d6 100644
--- a/core/res/res/values-pl/strings.xml
+++ b/core/res/res/values-pl/strings.xml
@@ -908,13 +908,14 @@
     <string name="aerr_application" msgid="932628488013092776">"Niestety, aplikacja <xliff:g id="APPLICATION">%1$s</xliff:g> została zatrzymana."</string>
     <string name="aerr_process" msgid="4507058997035697579">"Niestety, proces <xliff:g id="PROCESS">%1$s</xliff:g> został zatrzymany."</string>
     <string name="anr_title" msgid="4351948481459135709"></string>
-    <string name="anr_activity_application" msgid="1904477189057199066">"Aplikacja <xliff:g id="APPLICATION">%2$s</xliff:g> nie odpowiada."\n\n"Czy chcesz ją zamknąć?"</string>
+    <string name="anr_activity_application" msgid="1904477189057199066">"Aplikacja <xliff:g id="APPLICATION">%2$s</xliff:g> nie reaguje."\n\n"Czy chcesz ją zamknąć?"</string>
     <string name="anr_activity_process" msgid="5776209883299089767">"Działanie <xliff:g id="ACTIVITY">%1$s</xliff:g> nie odpowiada."\n\n"Czy chcesz je zakończyć?"</string>
-    <string name="anr_application_process" msgid="8941757607340481057">"Aplikacja <xliff:g id="APPLICATION">%1$s</xliff:g> nie odpowiada. Czy chcesz ją zamknąć?"</string>
+    <string name="anr_application_process" msgid="8941757607340481057">"Aplikacja <xliff:g id="APPLICATION">%1$s</xliff:g> nie reaguje. Czy chcesz ją zamknąć?"</string>
     <string name="anr_process" msgid="6513209874880517125">"Proces <xliff:g id="PROCESS">%1$s</xliff:g> nie odpowiada."\n\n"Czy chcesz go zakończyć?"</string>
     <string name="force_close" msgid="8346072094521265605">"OK"</string>
     <string name="report" msgid="4060218260984795706">"Zgłoś"</string>
     <string name="wait" msgid="7147118217226317732">"Czekaj"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"Strona nie odpowiada na żądania."\n\n"Zamknąć ją?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Aplikacja przekierowana"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"Aplikacja <xliff:g id="APP_NAME">%1$s</xliff:g> jest uruchomiona."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"Aplikacja <xliff:g id="APP_NAME">%1$s</xliff:g> została pierwotnie uruchomiona."</string>
@@ -1214,12 +1215,12 @@
     <string name="ssl_certificate" msgid="6510040486049237639">"Certyfikat zabezpieczeń"</string>
     <string name="ssl_certificate_is_valid" msgid="6825263250774569373">"Certyfikat jest ważny."</string>
     <string name="issued_to" msgid="454239480274921032">"Wystawiony dla:"</string>
-    <string name="common_name" msgid="2233209299434172646">"Nazwa pospolita (CN):"</string>
+    <string name="common_name" msgid="2233209299434172646">"Nazwa (CN):"</string>
     <string name="org_name" msgid="6973561190762085236">"Organizacja:"</string>
     <string name="org_unit" msgid="7265981890422070383">"Jednostka organizacyjna:"</string>
     <string name="issued_by" msgid="2647584988057481566">"Wystawca:"</string>
     <string name="validity_period" msgid="8818886137545983110">"Ważność:"</string>
-    <string name="issued_on" msgid="5895017404361397232">"Data wystawienia:"</string>
+    <string name="issued_on" msgid="5895017404361397232">"Wystawiony:"</string>
     <string name="expires_on" msgid="3676242949915959821">"Wygasa:"</string>
     <string name="serial_number" msgid="758814067660862493">"Numer seryjny:"</string>
     <string name="fingerprints" msgid="4516019619850763049">"Odciski cyfrowe:"</string>
diff --git a/core/res/res/values-pt-rPT/strings.xml b/core/res/res/values-pt-rPT/strings.xml
index c5e470c..800013d 100644
--- a/core/res/res/values-pt-rPT/strings.xml
+++ b/core/res/res/values-pt-rPT/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"OK"</string>
     <string name="report" msgid="4060218260984795706">"Relatório"</string>
     <string name="wait" msgid="7147118217226317732">"Esperar"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"A página deixou de responder. "\n" "\n" Pretende fechá-la?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Aplicação redirecionada"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> está agora a ser executado."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"<xliff:g id="APP_NAME">%1$s</xliff:g> foi originalmente iniciado."</string>
diff --git a/core/res/res/values-pt/strings.xml b/core/res/res/values-pt/strings.xml
index 10ac03f..c907929 100644
--- a/core/res/res/values-pt/strings.xml
+++ b/core/res/res/values-pt/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"OK"</string>
     <string name="report" msgid="4060218260984795706">"Informar"</string>
     <string name="wait" msgid="7147118217226317732">"Aguardar"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"A página não responde."\n\n"Deseja fechá-la?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Aplicativo redirecionado"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> não está em execução."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"<xliff:g id="APP_NAME">%1$s</xliff:g> foi iniciado."</string>
diff --git a/core/res/res/values-rm/strings.xml b/core/res/res/values-rm/strings.xml
index 4d40ddc..bc8d4fb 100644
--- a/core/res/res/values-rm/strings.xml
+++ b/core/res/res/values-rm/strings.xml
@@ -27,7 +27,8 @@
     <string name="terabyteShort" msgid="231613018159186962">"TB"</string>
     <string name="petabyteShort" msgid="5637816680144990219">"PB"</string>
     <string name="fileSizeSuffix" msgid="7670819340156489359">"<xliff:g id="NUMBER">%1$s</xliff:g><xliff:g id="UNIT">%2$s</xliff:g>"</string>
-    <!-- outdated translation 6071602020171759109 -->     <string name="untitled" msgid="4638956954852782576">"&lt;senza titel&gt;"</string>
+    <!-- no translation found for untitled (4638956954852782576) -->
+    <skip />
     <string name="ellipsis" msgid="7899829516048813237">"…"</string>
     <!-- no translation found for ellipsis_two_dots (1228078994866030736) -->
     <skip />
@@ -44,9 +45,12 @@
     <string name="serviceErased" msgid="1288584695297200972">"Stizzà cun success."</string>
     <string name="passwordIncorrect" msgid="7612208839450128715">"Il pled-clav è nuncorrect."</string>
     <string name="mmiComplete" msgid="8232527495411698359">"MMI terminà."</string>
-    <!-- outdated translation 5085454289896032547 -->     <string name="badPin" msgid="9015277645546710014">"Il code PIN vegl che Vus avais endatà è nuncorrect."</string>
-    <!-- outdated translation 5702522162746042460 -->     <string name="badPuk" msgid="5487257647081132201">"Il PUK che Vus avais tippà è nuncorrect."</string>
-    <!-- outdated translation 3695902225843339274 -->     <string name="mismatchPin" msgid="609379054496863419">"Ils codes PIN che Vus avais endatà n\'èn betg identics."</string>
+    <!-- no translation found for badPin (9015277645546710014) -->
+    <skip />
+    <!-- no translation found for badPuk (5487257647081132201) -->
+    <skip />
+    <!-- no translation found for mismatchPin (609379054496863419) -->
+    <skip />
     <string name="invalidPin" msgid="3850018445187475377">"Endatai in code PIN che cuntegna 4 fin 8 cifras."</string>
     <!-- no translation found for invalidPuk (8761456210898036513) -->
     <skip />
@@ -70,16 +74,20 @@
     <string name="CLIRDefaultOffNextCallOn" msgid="6179425182856418465">"La ID dal telefonader n\'è betg limitada tenor configuraziun predefinida. Proxim clom: limitada."</string>
     <string name="CLIRDefaultOffNextCallOff" msgid="2567998633124408552">"La ID dal telefonader n\'è betg limitada tenor configuraziun predefinida. Proxim clom: betg limitada."</string>
     <string name="serviceNotProvisioned" msgid="8614830180508686666">"Quest servetsch na vegn betg sustegnì."</string>
-    <!-- outdated translation 5460892159398802465 -->     <string name="CLIRPermanent" msgid="3377371145926835671">"Il parameter per la ID dal telefonader na po betg vegnir modifitgà."</string>
+    <!-- no translation found for CLIRPermanent (3377371145926835671) -->
+    <skip />
     <string name="RestrictedChangedTitle" msgid="5592189398956187498">"L\'access limità è vegnì modifitgà."</string>
     <string name="RestrictedOnData" msgid="8653794784690065540">"Il servetsch da datas è bloccà."</string>
     <string name="RestrictedOnEmergency" msgid="6581163779072833665">"Il servetsch da cloms d\'urgenza è bloccà."</string>
     <string name="RestrictedOnNormal" msgid="4953867011389750673">"Il servetsch vocal è bloccà."</string>
-    <string name="RestrictedOnAllVoice" msgid="1459318899842232234">"Tut ils servetschs vocals èn bloccads."</string>
+    <!-- no translation found for RestrictedOnAllVoice (3396963652108151260) -->
+    <skip />
     <string name="RestrictedOnSms" msgid="8314352327461638897">"Il servetsch SMS è bloccà."</string>
-    <string name="RestrictedOnVoiceData" msgid="8244438624660371717">"Ils servetschs vocals/da datas èn bloccads."</string>
+    <!-- no translation found for RestrictedOnVoiceData (996636487106171320) -->
+    <skip />
     <string name="RestrictedOnVoiceSms" msgid="1888588152792023873">"Ils servetschs vocals/dad SMS èn bloccads."</string>
-    <string name="RestrictedOnAll" msgid="2714924667937117304">"Tut ils servetschs vocals/da datas/da SMS èn bloccads."</string>
+    <!-- no translation found for RestrictedOnAll (5643028264466092821) -->
+    <skip />
     <string name="serviceClassVoice" msgid="1258393812335258019">"Vusch"</string>
     <string name="serviceClassData" msgid="872456782077937893">"Datas"</string>
     <string name="serviceClassFAX" msgid="5566624998840486475">"FAX"</string>
@@ -110,35 +118,56 @@
     <string name="fcComplete" msgid="3118848230966886575">"Code da servetsch terminà"</string>
     <string name="fcError" msgid="3327560126588500777">"Problem da connexiun u code da funcziun nunvalid"</string>
     <string name="httpErrorOk" msgid="1191919378083472204">"OK"</string>
-    <!-- outdated translation 2567300624552921790 -->     <string name="httpError" msgid="6603022914760066338">"La pagina d\'internet cuntegna ina errur."</string>
-    <string name="httpErrorLookup" msgid="4517085806977851374">"Impussibel da chattar la URL."</string>
-    <!-- outdated translation 2781440683514730227 -->     <string name="httpErrorUnsupportedAuthScheme" msgid="6299980280442076799">"Il schema d\'autentificaziun da la site na vegn betg sustegnì."</string>
-    <string name="httpErrorAuth" msgid="7293960746955020542">"L\'autentificaziun n\'è betg reussida."</string>
+    <!-- no translation found for httpError (7956392511146698522) -->
+    <skip />
+    <!-- no translation found for httpErrorLookup (4711687456111963163) -->
+    <skip />
+    <!-- no translation found for httpErrorUnsupportedAuthScheme (6299980280442076799) -->
+    <skip />
+    <!-- no translation found for httpErrorAuth (1435065629438044534) -->
+    <skip />
     <string name="httpErrorProxyAuth" msgid="1788207010559081331">"L\'autentificaziun cun agid dad in proxy server n\'è betg reussida."</string>
-    <string name="httpErrorConnect" msgid="7623096283505770433">"Betg reussì da connectar cun il server."</string>
-    <!-- outdated translation 5047872902739125260 -->     <string name="httpErrorIO" msgid="4270874999047767599">"La communicaziun cun il server n\'è betg reussida. Empruvai pli tard anc ina giada."</string>
+    <!-- no translation found for httpErrorConnect (8714273236364640549) -->
+    <skip />
+    <!-- no translation found for httpErrorIO (2340558197489302188) -->
+    <skip />
     <string name="httpErrorTimeout" msgid="4743403703762883954">"Surpassà il temp cun connectar al server."</string>
     <string name="httpErrorRedirectLoop" msgid="8679596090392779516">"Questa pagina cuntegna memia blers renviaments da server."</string>
-    <!-- outdated translation 5257172771607996054 -->     <string name="httpErrorUnsupportedScheme" msgid="5015730812906192208">"Quest protocol na vegn betg sustegnì."</string>
-    <string name="httpErrorFailedSslHandshake" msgid="3088290300440289771">"Impussibel da stabilir ina connexiun segira."</string>
-    <string name="httpErrorBadUrl" msgid="6088183159988619736">"Impussibel dad avrir la pagina. La URL è nunvalida."</string>
-    <string name="httpErrorFile" msgid="8250549644091165175">"Impussibel d\'acceder a la datoteca."</string>
-    <string name="httpErrorFileNotFound" msgid="5588380756326017105">"La datoteca dumandada n\'è betg vegnida chattada."</string>
+    <!-- no translation found for httpErrorUnsupportedScheme (5015730812906192208) -->
+    <skip />
+    <!-- no translation found for httpErrorFailedSslHandshake (96549606000658641) -->
+    <skip />
+    <!-- no translation found for httpErrorBadUrl (3636929722728881972) -->
+    <skip />
+    <!-- no translation found for httpErrorFile (2170788515052558676) -->
+    <skip />
+    <!-- no translation found for httpErrorFileNotFound (6203856612042655084) -->
+    <skip />
     <string name="httpErrorTooManyRequests" msgid="1235396927087188253">"Actualmain vegnan memia bleras dumondas elavuradas. Empruvai pli tard anc ina giada."</string>
-    <string name="notification_title" msgid="1259940370369187045">"Errur cun connectar al conto <xliff:g id="ACCOUNT">%1$s</xliff:g>"</string>
+    <!-- no translation found for notification_title (8967710025036163822) -->
+    <skip />
     <string name="contentServiceSync" msgid="8353523060269335667">"Sincronisar"</string>
     <string name="contentServiceSyncNotificationTitle" msgid="397743349191901458">"Sincronisar"</string>
     <string name="contentServiceTooManyDeletesNotificationDesc" msgid="8100981435080696431">"Memia blers cuntegns stizzads (<xliff:g id="CONTENT_TYPE">%s</xliff:g>)."</string>
-    <!-- outdated translation 6632412458436461203 -->     <string name="low_memory" product="tablet" msgid="2292820184396262278">"La memoria dal telefon è occupada! Stizzai datotecas per crear capacitad da memorisar."</string>
-    <string name="low_memory" product="default" msgid="6632412458436461203">"La memoria dal telefon è occupada! Stizzai datotecas per crear capacitad da memorisar."</string>
+    <!-- no translation found for low_memory (6494019234102154896) -->
+    <skip />
+    <!-- no translation found for low_memory (3475999286680000541) -->
+    <skip />
     <string name="me" msgid="6545696007631404292">"Jau"</string>
-    <!-- outdated translation 1319919075463988638 -->     <string name="power_dialog" product="tablet" msgid="8545351420865202853">"Opziuns dal telefon"</string>
+    <!-- no translation found for power_dialog (8545351420865202853) -->
+    <skip />
     <string name="power_dialog" product="default" msgid="1319919075463988638">"Opziuns dal telefon"</string>
     <string name="silent_mode" msgid="7167703389802618663">"Modus silenzius"</string>
     <string name="turn_on_radio" msgid="3912793092339962371">"Activar il modus senza fil"</string>
     <string name="turn_off_radio" msgid="8198784949987062346">"Deactivar il modus senza fil"</string>
     <string name="screen_lock" msgid="799094655496098153">"Bloccaziun dal visur"</string>
     <string name="power_off" msgid="4266614107412865048">"Serrar"</string>
+    <!-- no translation found for silent_mode_silent (319298163018473078) -->
+    <skip />
+    <!-- no translation found for silent_mode_vibrate (7072043388581551395) -->
+    <skip />
+    <!-- no translation found for silent_mode_ring (8592241816194074353) -->
+    <skip />
     <string name="shutdown_progress" msgid="2281079257329981203">"Vegn serrà..."</string>
     <!-- no translation found for shutdown_confirm (3385745179555731470) -->
     <skip />
@@ -147,8 +176,10 @@
     <!-- no translation found for shutdown_confirm_question (2906544768881136183) -->
     <skip />
     <string name="recent_tasks_title" msgid="3691764623638127888">"Utilisà sco ultim"</string>
-    <!-- outdated translation 279702952298056674 -->     <string name="no_recent_tasks" msgid="8794906658732193473">"Naginas applicaziuns utilisadas dacurt"</string>
-    <!-- outdated translation 2406416831541615258 -->     <string name="global_actions" product="tablet" msgid="408477140088053665">"Opziuns dal telefon"</string>
+    <!-- no translation found for no_recent_tasks (8794906658732193473) -->
+    <skip />
+    <!-- no translation found for global_actions (408477140088053665) -->
+    <skip />
     <string name="global_actions" product="default" msgid="2406416831541615258">"Opziuns dal telefon"</string>
     <string name="global_action_lock" msgid="2844945191792119712">"Bloccaziun dal visur"</string>
     <string name="global_action_power_off" msgid="4471879440839879722">"Metter ord funcziun"</string>
@@ -163,16 +194,21 @@
     <string name="safeMode" msgid="2788228061547930246">"Modus segirà"</string>
     <string name="android_system_label" msgid="6577375335728551336">"Sistem Android"</string>
     <string name="permgrouplab_costMoney" msgid="5429808217861460401">"Servetschs che custan"</string>
-    <!-- outdated translation 8193824940620517189 -->     <string name="permgroupdesc_costMoney" msgid="8596717365335027057">"Permetta ad applicaziuns dad exequir acziuns che custan eventualmain."</string>
+    <!-- no translation found for permgroupdesc_costMoney (3293301903409869495) -->
+    <skip />
     <string name="permgrouplab_messages" msgid="7521249148445456662">"Voss messadis"</string>
-    <!-- outdated translation 7045736972019211994 -->     <string name="permgroupdesc_messages" msgid="7821999071003699236">"\"Leger e scriver Voss SMS, e-mails ed auters messadis.\""</string>
+    <!-- no translation found for permgroupdesc_messages (7821999071003699236) -->
+    <skip />
     <string name="permgrouplab_personalInfo" msgid="3519163141070533474">"Vossas infurmaziuns persunalas"</string>
-    <!-- outdated translation 5488050357388806068 -->     <string name="permgroupdesc_personalInfo" product="tablet" msgid="6975389054186265786">"Acceder directamain als contacts ed al chalender memorisà sin il telefonin."</string>
+    <!-- no translation found for permgroupdesc_personalInfo (6975389054186265786) -->
+    <skip />
     <string name="permgroupdesc_personalInfo" product="default" msgid="5488050357388806068">"Acceder directamain als contacts ed al chalender memorisà sin il telefonin."</string>
     <string name="permgrouplab_location" msgid="635149742436692049">"Vossa posiziun"</string>
-    <string name="permgroupdesc_location" msgid="2430258821648348660">"suandar Vossa posiziun geografica"</string>
+    <!-- no translation found for permgroupdesc_location (5704679763124170100) -->
+    <skip />
     <string name="permgrouplab_network" msgid="5808983377727109831">"Communicaziun rait"</string>
-    <!-- outdated translation 5035763698958415998 -->     <string name="permgroupdesc_network" msgid="4917593670797570584">"Permetta ad applicaziuns l\'access a differentas funcziuns da la rait."</string>
+    <!-- no translation found for permgroupdesc_network (4478299413241861987) -->
+    <skip />
     <string name="permgrouplab_accounts" msgid="3359646291125325519">"Voss contos"</string>
     <string name="permgroupdesc_accounts" msgid="4948732641827091312">"Access als contos disponibels"</string>
     <string name="permgrouplab_hardwareControls" msgid="7998214968791599326">"Cumonds da la hardware"</string>
@@ -182,62 +218,90 @@
     <string name="permgrouplab_systemTools" msgid="4652191644082714048">"Utensils da sistem"</string>
     <string name="permgroupdesc_systemTools" msgid="8162102602190734305">"Access e controlla sin nivel datiers al sistem."</string>
     <string name="permgrouplab_developmentTools" msgid="3446164584710596513">"Utensils per sviluppaders"</string>
-    <!-- outdated translation 9056431193893809814 -->     <string name="permgroupdesc_developmentTools" msgid="7058828032358142018">"Questas funcziunalitads èn mo previsas per ils sviluppaders dad applicaziuns."</string>
+    <!-- no translation found for permgroupdesc_developmentTools (7058828032358142018) -->
+    <skip />
     <string name="permgrouplab_storage" msgid="1971118770546336966">"Memoria"</string>
-    <!-- outdated translation 9203302214915355774 -->     <string name="permgroupdesc_storage" product="nosdcard" msgid="7442318502446874999">"Access a la carta SD."</string>
+    <!-- no translation found for permgroupdesc_storage (7442318502446874999) -->
+    <skip />
     <string name="permgroupdesc_storage" product="default" msgid="9203302214915355774">"Access a la carta SD."</string>
     <string name="permlab_statusBar" msgid="7417192629601890791">"deactivar u modifitgar la trav da status"</string>
-    <!-- outdated translation 1365473595331989732 -->     <string name="permdesc_statusBar" msgid="8434669549504290975">"Permetta a l\'applicaziun da deactivar l\'indicatur da status u agiuntar ed allontanar simbols dal sistem."</string>
+    <!-- no translation found for permdesc_statusBar (8434669549504290975) -->
+    <skip />
     <string name="permlab_statusBarService" msgid="7247281911387931485">"trav da status"</string>
-    <!-- outdated translation 4097605867643520920 -->     <string name="permdesc_statusBarService" msgid="716113660795976060">"Permetta a l\'applicaziun dad esser la trav da status."</string>
+    <!-- no translation found for permdesc_statusBarService (716113660795976060) -->
+    <skip />
     <string name="permlab_expandStatusBar" msgid="1148198785937489264">"expander/reducir la trav da status"</string>
-    <!-- outdated translation 7088604400110768665 -->     <string name="permdesc_expandStatusBar" msgid="6917549437129401132">"Permetta a l\'applicaziun da mussar u zuppentar la trav da status."</string>
+    <!-- no translation found for permdesc_expandStatusBar (6917549437129401132) -->
+    <skip />
     <string name="permlab_processOutgoingCalls" msgid="1136262550878335980">"interceptar cloms sortints"</string>
-    <!-- outdated translation 2228988201852654461 -->     <string name="permdesc_processOutgoingCalls" msgid="1152111671618301044">"\"Permetta ad ina applicaziun dad elavurar ils cloms sortints e da modifitgar il numer che duai vegnir cumponì. Applicaziuns donnegiusas pon uschia eventualmain survegliar, renviar u evitar cloms sortints.\""</string>
+    <!-- no translation found for permdesc_processOutgoingCalls (1152111671618301044) -->
+    <skip />
     <string name="permlab_receiveSms" msgid="2697628268086208535">"retschaiver SMS"</string>
-    <!-- outdated translation 6298292335965966117 -->     <string name="permdesc_receiveSms" msgid="8107887121893611793">"Permetta a l\'applicaziun da retschaiver ed elavurar SMS. Applicaziuns donnegiusas pon uschia survegliar Voss messadis u als stizzar avant ch\'els vegnan mussads."</string>
+    <!-- no translation found for permdesc_receiveSms (8107887121893611793) -->
+    <skip />
     <string name="permlab_receiveMms" msgid="8894700916188083287">"retschaiver MMS"</string>
-    <!-- outdated translation 4563346832000174373 -->     <string name="permdesc_receiveMms" msgid="1424805308566612086">"Permetta a l\'applicaziun da retschaiver ed elavurar MMS. Applicaziuns donnegiusas pon uschia survegliar Voss messadis u als stizzar avant ch\'els vegnan mussads."</string>
+    <!-- no translation found for permdesc_receiveMms (1424805308566612086) -->
+    <skip />
     <!-- no translation found for permlab_receiveEmergencyBroadcast (1803477660846288089) -->
     <skip />
     <!-- no translation found for permdesc_receiveEmergencyBroadcast (848524070262431974) -->
     <skip />
     <string name="permlab_sendSms" msgid="5600830612147671529">"trametter messadis SMS"</string>
-    <!-- outdated translation 1946540351763502120 -->     <string name="permdesc_sendSms" msgid="906546667507626156">"Permetta ad applicaziuns da trametter messadis SMS. Applicaziuns donnegiusas pon chaschunar custs cun trametter messadis senza As dumandar."</string>
+    <!-- no translation found for permdesc_sendSms (906546667507626156) -->
+    <skip />
     <!-- no translation found for permlab_sendSmsNoConfirmation (4781483105951730228) -->
     <skip />
     <!-- no translation found for permdesc_sendSmsNoConfirmation (3437759207020400204) -->
     <skip />
     <string name="permlab_readSms" msgid="4085333708122372256">"leger SMS u MMS"</string>
-    <!-- outdated translation 3002170087197294591 -->     <string name="permdesc_readSms" product="tablet" msgid="2341692916884515613">"Permetta ad ina applicaziun da leger ils SMS memorisads sin Voss telefonin u sin Vossa carta SIM. Applicaziuns donnegiusas legian uschia eventualmain Voss messadis confidenzials."</string>
-    <!-- outdated translation 3002170087197294591 -->     <string name="permdesc_readSms" product="default" msgid="5653850482025875493">"Permetta ad ina applicaziun da leger ils SMS memorisads sin Voss telefonin u sin Vossa carta SIM. Applicaziuns donnegiusas legian uschia eventualmain Voss messadis confidenzials."</string>
+    <!-- no translation found for permdesc_readSms (2341692916884515613) -->
+    <skip />
+    <!-- no translation found for permdesc_readSms (5653850482025875493) -->
+    <skip />
     <string name="permlab_writeSms" msgid="6881122575154940744">"modifitgar SMS u MMS"</string>
-    <!-- outdated translation 6299398896177548095 -->     <string name="permdesc_writeSms" product="tablet" msgid="5160413947794501538">"Permetta ad ina applicaziun da modifitgar SMS memorisads sin Voss telefonin u Vossa carta SIM. Applicaziuns donnegiusas stizzan uschia eventualmain Voss messadis."</string>
-    <!-- outdated translation 6299398896177548095 -->     <string name="permdesc_writeSms" product="default" msgid="7268668709052328567">"Permetta ad ina applicaziun da modifitgar SMS memorisads sin Voss telefonin u Vossa carta SIM. Applicaziuns donnegiusas stizzan uschia eventualmain Voss messadis."</string>
+    <!-- no translation found for permdesc_writeSms (5160413947794501538) -->
+    <skip />
+    <!-- no translation found for permdesc_writeSms (7268668709052328567) -->
+    <skip />
     <string name="permlab_receiveWapPush" msgid="8258226427716551388">"retschaiver messadis WAP"</string>
-    <!-- outdated translation 5979623826128082171 -->     <string name="permdesc_receiveWapPush" msgid="7983455145335316872">"Permetta a l\'applicaziun da retschaiver ed elavurar messadis WAP. Applicaziuns donnegiusas pon uschia survegliar Voss messadis u als stizzar avant ch\'els vegnan mussads."</string>
-    <!-- outdated translation 5005277531132573353 -->     <string name="permlab_getTasks" msgid="6466095396623933906">"recuperaziun da las applicaziuns exequidas"</string>
-    <!-- outdated translation 7048711358713443341 -->     <string name="permdesc_getTasks" msgid="6608159250520381359">"Permetta a l\'applicaziun da recuperar infurmaziuns davart incumbensas che vegnan exequidas u èn gist vegnidas exequidas. Applicaziuns donnegiusas pon uschia obtegnair infurmaziuns privatas concernent autras applicaziuns."</string>
-    <!-- outdated translation 5669588525059921549 -->     <string name="permlab_reorderTasks" msgid="2018575526934422779">"reorganisar las applicaziuns che vegnan exequidas"</string>
-    <!-- outdated translation 126252774270522835 -->     <string name="permdesc_reorderTasks" msgid="4175137612205663399">"Permetta ad ina applicaziun da spustar las incumbensas en il fund davant u en il fund davos. Applicaziuns donnegiusas pon sa mussar en il fund davant senza Vossa autorisaziun."</string>
+    <!-- no translation found for permdesc_receiveWapPush (7983455145335316872) -->
+    <skip />
+    <!-- no translation found for permlab_getTasks (6466095396623933906) -->
+    <skip />
+    <!-- no translation found for permdesc_getTasks (6608159250520381359) -->
+    <skip />
+    <!-- no translation found for permlab_reorderTasks (2018575526934422779) -->
+    <skip />
+    <!-- no translation found for permdesc_reorderTasks (4175137612205663399) -->
+    <skip />
     <!-- no translation found for permlab_removeTasks (6821513401870377403) -->
     <skip />
-    <!-- no translation found for permdesc_removeTasks (1000226123143185094) -->
+    <!-- no translation found for permdesc_removeTasks (1394714352062635493) -->
     <skip />
-    <!-- outdated translation 4339730312925176742 -->     <string name="permlab_setDebugApp" msgid="3022107198686584052">"activar il debugging da l\'applicaziun"</string>
-    <!-- outdated translation 5584310661711990702 -->     <string name="permdesc_setDebugApp" msgid="6215654419903651172">"Permetta ad ina applicaziun dad activar il debugging per autras applicaziuns. Applicaziuns donnegiusas pon uschia serrar autras applicaziuns."</string>
+    <!-- no translation found for permlab_setDebugApp (3022107198686584052) -->
+    <skip />
+    <!-- no translation found for permdesc_setDebugApp (4474512416299013256) -->
+    <skip />
     <string name="permlab_changeConfiguration" msgid="8214475779521218295">"modifitgar ils parameters da la UI"</string>
-    <!-- outdated translation 3465121501528064399 -->     <string name="permdesc_changeConfiguration" msgid="4104052649900380324">"Permetta ad ina applicaziun da modifitgar la configuraziun actuala (per exempel la grondezza da la scrittira ed ils parameters regiunals)."</string>
+    <!-- no translation found for permdesc_changeConfiguration (4372223873154296076) -->
+    <skip />
     <string name="permlab_enableCarMode" msgid="5684504058192921098">"activar il modus dad auto"</string>
-    <!-- outdated translation 5673461159384850628 -->     <string name="permdesc_enableCarMode" msgid="4853187425751419467">"Permetta ad ina applicaziun dad activar il modus dad auto."</string>
+    <!-- no translation found for permdesc_enableCarMode (4853187425751419467) -->
+    <skip />
     <string name="permlab_killBackgroundProcesses" msgid="8373714752793061963">"interrumper ils process en il fund davos"</string>
-    <!-- outdated translation 2908829602869383753 -->     <string name="permdesc_killBackgroundProcesses" msgid="931129103262126617">"Permetta ad ina applicaziun da serrar process en il fund davos dad autras applicaziuns era en cas da memoria suffizienta."</string>
-    <!-- outdated translation 1447830113260156236 -->     <string name="permlab_forceStopPackages" msgid="2329627428832067700">"serrar autras applicaziuns cun forza"</string>
-    <!-- outdated translation 7263036616161367402 -->     <string name="permdesc_forceStopPackages" msgid="5253157296183940812">"Permetta ad ina applicaziun da sfurzar autras applicaziuns da serrar."</string>
-    <!-- outdated translation 1804196839880393631 -->     <string name="permlab_forceBack" msgid="652935204072584616">"serrar l\'applicaziun cun forza"</string>
-    <!-- outdated translation 6534109744159919013 -->     <string name="permdesc_forceBack" msgid="3892295830419513623">"Permetta ad ina applicaziun da serrar tut las activitads che vegnan exequidas en il fund davant e da las spustar en il fund davos. Betg previs per applicaziuns normalas."</string>
+    <!-- no translation found for permdesc_killBackgroundProcesses (931129103262126617) -->
+    <skip />
+    <!-- no translation found for permlab_forceStopPackages (2329627428832067700) -->
+    <skip />
+    <!-- no translation found for permdesc_forceStopPackages (5253157296183940812) -->
+    <skip />
+    <!-- no translation found for permlab_forceBack (652935204072584616) -->
+    <skip />
+    <!-- no translation found for permdesc_forceBack (3892295830419513623) -->
+    <skip />
     <string name="permlab_dump" msgid="1681799862438954752">"verifitgar il status intern dal sistem"</string>
-    <!-- outdated translation 2198776174276275220 -->     <string name="permdesc_dump" msgid="1778299088692290329">"\"Permetta ad ina applicaziun da vesair il status intern dal sistem. Applicaziuns donnegiusas pon uschia obtegnair numerusas infurmaziuns privatas u segiradas, a las qualas ellas na dastgassan normalmain mai acceder.\""</string>
+    <!-- no translation found for permdesc_dump (1778299088692290329) -->
+    <skip />
     <!-- no translation found for permlab_retrieve_window_content (8022588608994589938) -->
     <skip />
     <!-- no translation found for permdesc_retrieve_window_content (3193269069469700265) -->
@@ -245,42 +309,62 @@
     <string name="permlab_shutdown" msgid="7185747824038909016">"serrar parzialmain"</string>
     <string name="permdesc_shutdown" msgid="7046500838746291775">"Metta l\'administratur dad activitads en in stadi da pausa. El na vegn betg serrà dal tut."</string>
     <string name="permlab_stopAppSwitches" msgid="4138608610717425573">"evitar il midar tranter applicaziuns"</string>
-    <!-- outdated translation 3857886086919033794 -->     <string name="permdesc_stopAppSwitches" msgid="8262195802582255021">"Impedescha che l\'utilisader midia ad ina autra applicaziun."</string>
-    <!-- outdated translation 7811586187574696296 -->     <string name="permlab_runSetActivityWatcher" msgid="892239094867182656">"survegliar e controllar l\'aviar dad applicaziuns"</string>
-    <!-- outdated translation 3228701938345388092 -->     <string name="permdesc_runSetActivityWatcher" msgid="6003603162578577406">"Permetta ad ina applicaziun da survegliar e controllar l\'aviar dad activitads dal sistem. Applicaziuns donnegiusas pon uschia periclitar l\'entir sistem. Questa permissiun è mo previsa per process da svilup e mai per il diever normal dal telefonin."</string>
+    <!-- no translation found for permdesc_stopAppSwitches (8262195802582255021) -->
+    <skip />
+    <!-- no translation found for permlab_runSetActivityWatcher (892239094867182656) -->
+    <skip />
+    <!-- no translation found for permdesc_runSetActivityWatcher (6003603162578577406) -->
+    <skip />
     <string name="permlab_broadcastPackageRemoved" msgid="2576333434893532475">"trametter in broadcast senza pachet"</string>
-    <!-- outdated translation 3453286591439891260 -->     <string name="permdesc_broadcastPackageRemoved" msgid="6621901216207931089">"Permetta ad ina applicaziun da trametter in avis cura ch\'in pachet d\'applicaziun è vegnì stizzà. Applicaziuns donnegiusas pon utilisar questa funcziunalitad per interrumper l\'execuziun dad autras applicaziuns."</string>
+    <!-- no translation found for permdesc_broadcastPackageRemoved (6621901216207931089) -->
+    <skip />
     <string name="permlab_broadcastSmsReceived" msgid="5689095009030336593">"trametter in broadcast retschavì per SMS"</string>
-    <!-- outdated translation 9122419277306740155 -->     <string name="permdesc_broadcastSmsReceived" msgid="4152037720034365492">"Permetta ad ina applicaziun da trametter in avis cura ch\'in messadi vegn retschavì. Applicaziuns donnegiusas pon utilisar questa funcziunalitad per dar da crair ch\'in messadi saja arrivà."</string>
+    <!-- no translation found for permdesc_broadcastSmsReceived (4152037720034365492) -->
+    <skip />
     <string name="permlab_broadcastWapPush" msgid="3145347413028582371">"trametter in broadcast retschavì da WAP-PUSH"</string>
-    <!-- outdated translation 3955303669461378091 -->     <string name="permdesc_broadcastWapPush" msgid="4783402525039442729">"Permetta ad ina applicaziun da trametter in avis cura ch\'in messadi WAP PUSH vegn retschavì. Applicaziuns donnegiusas pon utilisar questa funcziunalitad per dar da crair ch\'in MMS saja arrivà u per remplazzar il cuntegn da mintga pagina d\'internet cun datas donnegiusas."</string>
+    <!-- no translation found for permdesc_broadcastWapPush (4783402525039442729) -->
+    <skip />
     <string name="permlab_setProcessLimit" msgid="2451873664363662666">"limitar il dumber maximal da process exequids"</string>
-    <!-- outdated translation 7824786028557379539 -->     <string name="permdesc_setProcessLimit" msgid="7318061314040879542">"Permetta ad ina applicaziun da controllar il dumber maximal da process che pon vegnir exequids a medem temp. Betg previs per applicaziuns normalas."</string>
-    <!-- outdated translation 5342837862439543783 -->     <string name="permlab_setAlwaysFinish" msgid="238828158465736054">"serrar tut las applicaziuns en il fund davos"</string>
-    <!-- outdated translation 8773936403987091620 -->     <string name="permdesc_setAlwaysFinish" msgid="7471310652868841499">"Permetta ad ina applicaziun da controllar schebain activitads vegnan adina terminadas sch\'ellas vegnan stuschadas en il fund davos. Betg previs per applicaziuns normalas."</string>
+    <!-- no translation found for permdesc_setProcessLimit (7318061314040879542) -->
+    <skip />
+    <!-- no translation found for permlab_setAlwaysFinish (238828158465736054) -->
+    <skip />
+    <!-- no translation found for permdesc_setAlwaysFinish (7471310652868841499) -->
+    <skip />
     <string name="permlab_batteryStats" msgid="7863923071360031652">"modifitgar las datas da l\'accu"</string>
-    <!-- outdated translation 5847319823772230560 -->     <string name="permdesc_batteryStats" msgid="6835186932305744068">"Permetta da modifitgar las datas statisticas da l\'accu. Betg previs per applicaziuns normalas."</string>
+    <!-- no translation found for permdesc_batteryStats (6835186932305744068) -->
+    <skip />
     <string name="permlab_backup" msgid="470013022865453920">"controllar las copias da segirezza e la restauraziun dal sistem"</string>
-    <!-- outdated translation 4837493065154256525 -->     <string name="permdesc_backup" msgid="6912230525140589891">"Permetta a l\'applicaziun da controllar il mecanissem da copias da segirezza e da restauraziun dal sistem. Betg previs per applicaziuns normalas."</string>
+    <!-- no translation found for permdesc_backup (6912230525140589891) -->
+    <skip />
     <!-- no translation found for permlab_confirm_full_backup (5557071325804469102) -->
     <skip />
     <!-- no translation found for permdesc_confirm_full_backup (1748762171637699562) -->
     <skip />
     <string name="permlab_internalSystemWindow" msgid="2148563628140193231">"mussar fanestras betg autorisadas"</string>
-    <!-- outdated translation 5895082268284998469 -->     <string name="permdesc_internalSystemWindow" msgid="6510907081810231374">"Permetta da crear fanestras destinadas per l\'utilisaziun da l\'interfatscha d\'utilisader interna dal sistem. Questa funcziun n\'è betg previsa per applicaziuns normalas."</string>
+    <!-- no translation found for permdesc_internalSystemWindow (7458387759461466397) -->
+    <skip />
     <string name="permlab_systemAlertWindow" msgid="3372321942941168324">"mussar avertiments dal sistem"</string>
-    <!-- outdated translation 5109622689323490558 -->     <string name="permdesc_systemAlertWindow" msgid="8507863469978066409">"Permetta ad ina applicaziun da mussar fanestras cun avertiments dal sistem. Applicaziuns donnegiusas pon uschia occupar l\'entir visur dal telefonin."</string>
+    <!-- no translation found for permdesc_systemAlertWindow (8507863469978066409) -->
+    <skip />
     <string name="permlab_setAnimationScale" msgid="2805103241153907174">"modifitgar la sveltezza globala da las animaziuns"</string>
-    <!-- outdated translation 7181522138912391988 -->     <string name="permdesc_setAnimationScale" msgid="6505093307223395456">"Permetta ad ina applicaziun da modifitgar da tut temp la sveltezza generala da las animaziuns (per las pudair far ir pli svelt u pli plaun)."</string>
-    <!-- outdated translation 17124341698093865 -->     <string name="permlab_manageAppTokens" msgid="1286505717050121370">"administrar tokens dad applicaziuns"</string>
-    <!-- outdated translation 977127907524195988 -->     <string name="permdesc_manageAppTokens" msgid="8043431713014395671">"Permetta ad applicaziuns da crear ed administrar lur agens tokens cun ignorar lur urden da zavrar Z normal. Betg previs per applicaziuns normalas."</string>
+    <!-- no translation found for permdesc_setAnimationScale (7690063428924343571) -->
+    <skip />
+    <!-- no translation found for permlab_manageAppTokens (1286505717050121370) -->
+    <skip />
+    <!-- no translation found for permdesc_manageAppTokens (8043431713014395671) -->
+    <skip />
     <string name="permlab_injectEvents" msgid="1378746584023586600">"smatgar tastas e tastas da controlla"</string>
-    <!-- outdated translation 3946098050410874715 -->     <string name="permdesc_injectEvents" product="tablet" msgid="206352565599968632">"Permetta ad ina applicaziun da furnir ses agens cumonds (tastas smatgadas etc.) ad autras applicaziuns. Applicaziuns donnegiusas pon utilisar questa funcziunalitad per surpigliar la controlla da Voss telefonin."</string>
-    <!-- outdated translation 3946098050410874715 -->     <string name="permdesc_injectEvents" product="default" msgid="653128057572326253">"Permetta ad ina applicaziun da furnir ses agens cumonds (tastas smatgadas etc.) ad autras applicaziuns. Applicaziuns donnegiusas pon utilisar questa funcziunalitad per surpigliar la controlla da Voss telefonin."</string>
+    <!-- no translation found for permdesc_injectEvents (206352565599968632) -->
+    <skip />
+    <!-- no translation found for permdesc_injectEvents (653128057572326253) -->
+    <skip />
     <string name="permlab_readInputState" msgid="469428900041249234">"registrar endataziuns sur la tastatura ed acziuns"</string>
-    <!-- outdated translation 5132879321450325445 -->     <string name="permdesc_readInputState" msgid="8387754901688728043">"\"Permetta ad ina applicaziun dad identifitgar las tastas che Vus smatgais, era durant l\'utilisaziun dad in auter program (durant l\'endataziun dad in pled-clav, per exempel). Applicaziuns normalas na duessan betg avair access a questa funcziun.\""</string>
+    <!-- no translation found for permdesc_readInputState (8387754901688728043) -->
+    <skip />
     <string name="permlab_bindInputMethod" msgid="3360064620230515776">"associar cun ina metoda d\'endataziun"</string>
-    <!-- outdated translation 3734838321027317228 -->     <string name="permdesc_bindInputMethod" msgid="3250440322807286331">"Permetta da sa fixar al nivel d\'interfatscha pli aut dad ina metoda d\'endataziun. Betg previs per applicaziuns normalas."</string>
+    <!-- no translation found for permdesc_bindInputMethod (3250440322807286331) -->
+    <skip />
     <!-- no translation found for permlab_bindTextService (7358378401915287938) -->
     <skip />
     <!-- no translation found for permdesc_bindTextService (8151968910973998670) -->
@@ -290,66 +374,112 @@
     <!-- no translation found for permdesc_bindVpnService (2067845564581693905) -->
     <skip />
     <string name="permlab_bindWallpaper" msgid="8716400279937856462">"sa fixar vid in fund davos"</string>
-    <!-- outdated translation 5287754520361915347 -->     <string name="permdesc_bindWallpaper" msgid="7108428692595491668">"Permetta da sa fixar al nivel d\'interfatscha pli aut dad ina metoda d\'endataziun. Betg previs per applicaziuns normalas."</string>
+    <!-- no translation found for permdesc_bindWallpaper (7108428692595491668) -->
+    <skip />
     <!-- no translation found for permlab_bindRemoteViews (5697987759897367099) -->
     <skip />
     <!-- no translation found for permdesc_bindRemoteViews (4717987810137692572) -->
     <skip />
     <string name="permlab_bindDeviceAdmin" msgid="8704986163711455010">"interacziun cun in administratur dad apparats"</string>
-    <!-- outdated translation 8714424333082216979 -->     <string name="permdesc_bindDeviceAdmin" msgid="569715419543907930">"Permetta al possessur da trametter intenziuns a l\'administratur dal apparat periferic. Betg previs per applicaziuns normalas."</string>
+    <!-- no translation found for permdesc_bindDeviceAdmin (569715419543907930) -->
+    <skip />
     <string name="permlab_setOrientation" msgid="3365947717163866844">"midar l\'orientaziun dal visur"</string>
-    <!-- outdated translation 6335814461615851863 -->     <string name="permdesc_setOrientation" msgid="3046126619316671476">"Permetta a l\'applicaziun da midar da tut temp la orientaziun dal visur. Betg previs per applicaziuns normalas."</string>
+    <!-- no translation found for permdesc_setOrientation (3046126619316671476) -->
+    <skip />
     <!-- no translation found for permlab_setPointerSpeed (9175371613322562934) -->
     <skip />
     <!-- no translation found for permdesc_setPointerSpeed (6866563234274104233) -->
     <skip />
-    <!-- outdated translation 4255467255488653854 -->     <string name="permlab_signalPersistentProcesses" msgid="4539002991947376659">"trametter signals Linux a las applicaziuns"</string>
-    <!-- outdated translation 3565530463215015289 -->     <string name="permdesc_signalPersistentProcesses" msgid="4896992079182649141">"Permetta a l\'applicaziun da pretender ch\'il signal furnì vegnia tramess a tut ils process persistents."</string>
-    <!-- outdated translation 8659652042401085862 -->     <string name="permlab_persistentActivity" msgid="8841113627955563938">"exequir permanentamain applicaziuns"</string>
-    <!-- outdated translation 5037199778265006008 -->     <string name="permdesc_persistentActivity" msgid="4909910271316074418">"Permetta ad ina applicaziun da render persistent atgnas cumponentas per ch\'il sistem na po betg utilisar questas per autras applicaziuns."</string>
-    <!-- outdated translation 3343439331576348805 -->     <string name="permlab_deletePackages" msgid="184385129537705938">"stizzar applicaziuns"</string>
-    <!-- outdated translation 3634943677518723314 -->     <string name="permdesc_deletePackages" msgid="7411480275167205081">"Permetta ad ina applicaziun da stizzar pachets da datas Android. Applicaziuns donnegiusas pon utilisar questa funcziun per stizzar applicaziuns impurtantas."</string>
-    <!-- outdated translation 2192134353540277878 -->     <string name="permlab_clearAppUserData" msgid="274109191845842756">"stizzar datas dad ina autra applicaziun"</string>
-    <!-- outdated translation 7546345080434325456 -->     <string name="permdesc_clearAppUserData" msgid="4625323684125459488">"Permetta ad ina applicaziun da stizzar las datas da l\'utilisader."</string>
-    <!-- outdated translation 1518556602634276725 -->     <string name="permlab_deleteCacheFiles" msgid="3128665571837408675">"stizzar ils caches dad autras applicaziuns"</string>
-    <!-- outdated translation 2283074077168165971 -->     <string name="permdesc_deleteCacheFiles" msgid="3812998599006730196">"Permetta ad ina applicaziun da stizzar las datotecas en il cache."</string>
-    <!-- outdated translation 4799785352306641460 -->     <string name="permlab_getPackageSize" msgid="7472921768357981986">"evaluar la capacitad da memoria occupada da l\'applicaziun"</string>
-    <!-- outdated translation 5557253039670753437 -->     <string name="permdesc_getPackageSize" msgid="3921068154420738296">"\"Permetta ad ina applicaziun dad obtegnair la grondezza dal code, da las datas e dal cache.\""</string>
-    <!-- outdated translation 335800214119051089 -->     <string name="permlab_installPackages" msgid="2199128482820306924">"installar directamain applicaziuns"</string>
-    <!-- outdated translation 526669220850066132 -->     <string name="permdesc_installPackages" msgid="5628530972548071284">"Permetta ad ina applicaziun dad installar pachets novs u actualisads dad Android. Applicaziuns donnegiusas pon utilisar questa funcziunalitad per agiuntar novas applicaziuns che han tut las permissiuns pussaivlas."</string>
-    <!-- outdated translation 4747698311163766540 -->     <string name="permlab_clearAppCache" msgid="7487279391723526815">"stizzar las datas dal cache da tut las applicaziuns"</string>
-    <!-- outdated translation 7740465694193671402 -->     <string name="permdesc_clearAppCache" product="tablet" msgid="3523396284474042284">"Permetta ad ina applicaziun da dar liber capacitad da memorisar dal telefonin cun stizzar datotecas en l\'ordinatur da cache da l\'applicaziun. L\'access è per regla limità a process da sistem."</string>
-    <!-- outdated translation 7740465694193671402 -->     <string name="permdesc_clearAppCache" product="default" msgid="5067988373366292186">"Permetta ad ina applicaziun da dar liber capacitad da memorisar dal telefonin cun stizzar datotecas en l\'ordinatur da cache da l\'applicaziun. L\'access è per regla limità a process da sistem."</string>
-    <!-- outdated translation 728454979946503926 -->     <string name="permlab_movePackage" msgid="3289890271645921411">"Spustar resursas d\'applicaziun"</string>
-    <!-- outdated translation 6323049291923925277 -->     <string name="permdesc_movePackage" msgid="319562217778244524">"Permetta ad ina applicaziun da spustar resursas d\'applicaziun dad in medium intern ad in medium extern e viceversa."</string>
-    <!-- outdated translation 4811921703882532070 -->     <string name="permlab_readLogs" msgid="6615778543198967614">"leger datotecas da protocol dal sistem"</string>
-    <!-- outdated translation 2257937955580475902 -->     <string name="permdesc_readLogs" product="tablet" msgid="82061313293455151">"Permetta ad ina applicaziun da leger las differentas datotecas da protocol dal sistem. Quai pussibilitescha dad obtegnair infurmaziuns generalas davart il diever da Voss telefon che na duessan betg cuntegnair datas persunalas u privatas."</string>
-    <!-- outdated translation 2257937955580475902 -->     <string name="permdesc_readLogs" product="default" msgid="2063438140241560443">"Permetta ad ina applicaziun da leger las differentas datotecas da protocol dal sistem. Quai pussibilitescha dad obtegnair infurmaziuns generalas davart il diever da Voss telefon che na duessan betg cuntegnair datas persunalas u privatas."</string>
+    <!-- no translation found for permlab_signalPersistentProcesses (4539002991947376659) -->
+    <skip />
+    <!-- no translation found for permdesc_signalPersistentProcesses (4896992079182649141) -->
+    <skip />
+    <!-- no translation found for permlab_persistentActivity (8841113627955563938) -->
+    <skip />
+    <!-- no translation found for permdesc_persistentActivity (4909910271316074418) -->
+    <skip />
+    <!-- no translation found for permlab_deletePackages (184385129537705938) -->
+    <skip />
+    <!-- no translation found for permdesc_deletePackages (7411480275167205081) -->
+    <skip />
+    <!-- no translation found for permlab_clearAppUserData (274109191845842756) -->
+    <skip />
+    <!-- no translation found for permdesc_clearAppUserData (4625323684125459488) -->
+    <skip />
+    <!-- no translation found for permlab_deleteCacheFiles (3128665571837408675) -->
+    <skip />
+    <!-- no translation found for permdesc_deleteCacheFiles (3812998599006730196) -->
+    <skip />
+    <!-- no translation found for permlab_getPackageSize (7472921768357981986) -->
+    <skip />
+    <!-- no translation found for permdesc_getPackageSize (3921068154420738296) -->
+    <skip />
+    <!-- no translation found for permlab_installPackages (2199128482820306924) -->
+    <skip />
+    <!-- no translation found for permdesc_installPackages (5628530972548071284) -->
+    <skip />
+    <!-- no translation found for permlab_clearAppCache (7487279391723526815) -->
+    <skip />
+    <!-- no translation found for permdesc_clearAppCache (3523396284474042284) -->
+    <skip />
+    <!-- no translation found for permdesc_clearAppCache (5067988373366292186) -->
+    <skip />
+    <!-- no translation found for permlab_movePackage (3289890271645921411) -->
+    <skip />
+    <!-- no translation found for permdesc_movePackage (319562217778244524) -->
+    <skip />
+    <!-- no translation found for permlab_readLogs (6615778543198967614) -->
+    <skip />
+    <!-- no translation found for permdesc_readLogs (82061313293455151) -->
+    <skip />
+    <!-- no translation found for permdesc_readLogs (2063438140241560443) -->
+    <skip />
+    <!-- no translation found for permlab_anyCodecForPlayback (715805555823881818) -->
+    <skip />
+    <!-- no translation found for permdesc_anyCodecForPlayback (8283912488433189010) -->
+    <skip />
     <string name="permlab_diagnostic" msgid="8076743953908000342">"leger/scriver en resursas che appartegnan a diagnostics"</string>
-    <!-- outdated translation 3121238373951637049 -->     <string name="permdesc_diagnostic" msgid="6608295692002452283">"Permetta ad ina applicaziun da leger e modifitgar tut ils elements ella gruppa da diagnosa (per exempel las datotecas en /dev). Quai po avair consequenzas negativas per la stabilitad e la segirezza dal sistem e duess vegnir permess mo a programs da diagnosa specifics per la hardware mess a disposiziun dal producider u dal gestiunari da la rait."</string>
-    <!-- outdated translation 79425198834329406 -->     <string name="permlab_changeComponentState" msgid="6335576775711095931">"activar u deactivar cumponentas dad applicaziuns"</string>
-    <!-- outdated translation 4569107043246700630 -->     <string name="permdesc_changeComponentState" product="tablet" msgid="8887435740982237294">"\"Permetta ad ina applicaziun dad activar u deactivar cumponentas dad autras applicaziuns. Applicaziuns donnegiusas pon uschia deactivar funcziuns impurtantas dal telefonin. Faschai attenziun cun permetter l\'access a questa funcziun perquai ch\'ella permetta da render nunduvrablas, incoerentas ed instabilas las cumponentas da las applicaziuns.\""</string>
-    <!-- outdated translation 4569107043246700630 -->     <string name="permdesc_changeComponentState" product="default" msgid="1827232484416505615">"\"Permetta ad ina applicaziun dad activar u deactivar cumponentas dad autras applicaziuns. Applicaziuns donnegiusas pon uschia deactivar funcziuns impurtantas dal telefonin. Faschai attenziun cun permetter l\'access a questa funcziun perquai ch\'ella permetta da render nunduvrablas, incoerentas ed instabilas las cumponentas da las applicaziuns.\""</string>
-    <!-- outdated translation 3393305202145172005 -->     <string name="permlab_setPreferredApplications" msgid="8463181628695396391">"definir las applicaziuns preferidas"</string>
-    <!-- outdated translation 760008293501937546 -->     <string name="permdesc_setPreferredApplications" msgid="4973986762241783712">"Permetta ad ina applicaziun da modifitgar Vossas applicaziuns preferidas. Applicaziuns donnegiusas pon uschia remplazzar en il zuppà applicaziuns che vegnan gist exequidas ed imitar Vossas applicaziuns existentas cun la finamira da rimnar datas persunalas da Vus."</string>
+    <!-- no translation found for permdesc_diagnostic (6608295692002452283) -->
+    <skip />
+    <!-- no translation found for permlab_changeComponentState (6335576775711095931) -->
+    <skip />
+    <!-- no translation found for permdesc_changeComponentState (8887435740982237294) -->
+    <skip />
+    <!-- no translation found for permdesc_changeComponentState (1827232484416505615) -->
+    <skip />
+    <!-- no translation found for permlab_setPreferredApplications (8463181628695396391) -->
+    <skip />
+    <!-- no translation found for permdesc_setPreferredApplications (4973986762241783712) -->
+    <skip />
     <string name="permlab_writeSettings" msgid="1365523497395143704">"modifitgar parameters generals dal sistem"</string>
-    <!-- outdated translation 838789419871034696 -->     <string name="permdesc_writeSettings" msgid="7775723441558907181">"Permetta ad ina applicaziun da modifitgar las datas dals parameters dal sistem. Applicaziuns donnegiusas pon utilisar questa funcziun per donnegiar la configuraziun da Voss sistem."</string>
+    <!-- no translation found for permdesc_writeSettings (7775723441558907181) -->
+    <skip />
     <string name="permlab_writeSecureSettings" msgid="204676251876718288">"modifitgar ils parameters da segirezza dal sistem"</string>
-    <!-- outdated translation 5497873143539034724 -->     <string name="permdesc_writeSecureSettings" msgid="8159535613020137391">"Permetta ad ina applicaziun da modifitgar las datas da configuraziun da segirezza dal sistem. Betg previs per applicaziuns normalas."</string>
+    <!-- no translation found for permdesc_writeSecureSettings (8159535613020137391) -->
+    <skip />
     <string name="permlab_writeGservices" msgid="2149426664226152185">"modifitgar Google Services Map"</string>
-    <!-- outdated translation 6602362746516676175 -->     <string name="permdesc_writeGservices" msgid="1287309437638380229">"Permetta ad ina applicaziun da modifitgar la charta da servetschs Google. Betg previs per applicaziuns normalas."</string>
+    <!-- no translation found for permdesc_writeGservices (1287309437638380229) -->
+    <skip />
     <string name="permlab_receiveBootCompleted" msgid="7776779842866993377">"aviar automaticamain suenter ch\'il sistem è avià"</string>
-    <!-- outdated translation 698336728415008796 -->     <string name="permdesc_receiveBootCompleted" product="tablet" msgid="7390304664116880704">"\"Permetta ad ina applicaziun dad aviar sasez suenter ch\'il sistem è vegnì avià. Qua tras po l\'aviar dal telefonin durar pli ditg, ultra da quai po l\'entir sistem vegnir retardà cun l\'activitad permanenta da l\'applicaziun.\""</string>
-    <!-- outdated translation 698336728415008796 -->     <string name="permdesc_receiveBootCompleted" product="default" msgid="513950589102617504">"\"Permetta ad ina applicaziun dad aviar sasez suenter ch\'il sistem è vegnì avià. Qua tras po l\'aviar dal telefonin durar pli ditg, ultra da quai po l\'entir sistem vegnir retardà cun l\'activitad permanenta da l\'applicaziun.\""</string>
+    <!-- no translation found for permdesc_receiveBootCompleted (7390304664116880704) -->
+    <skip />
+    <!-- no translation found for permdesc_receiveBootCompleted (513950589102617504) -->
+    <skip />
     <string name="permlab_broadcastSticky" msgid="7919126372606881614">"trametter in broadcast permanent"</string>
-    <!-- outdated translation 1920045289234052219 -->     <string name="permdesc_broadcastSticky" product="tablet" msgid="1181582512022829259">"Permetta ad ina applicaziun da trametter broadcasts persistents che na sa serran betg a la fin dal broadcast. Applicaziuns donnegiusas pon uschia render plaun ed instabil il telefonin cun occupar memia blera memoria."</string>
-    <!-- outdated translation 1920045289234052219 -->     <string name="permdesc_broadcastSticky" product="default" msgid="3287869131621514325">"Permetta ad ina applicaziun da trametter broadcasts persistents che na sa serran betg a la fin dal broadcast. Applicaziuns donnegiusas pon uschia render plaun ed instabil il telefonin cun occupar memia blera memoria."</string>
+    <!-- no translation found for permdesc_broadcastSticky (1181582512022829259) -->
+    <skip />
+    <!-- no translation found for permdesc_broadcastSticky (3287869131621514325) -->
+    <skip />
     <string name="permlab_readContacts" msgid="6219652189510218240">"leger las datas da contact"</string>
-    <!-- outdated translation 3371591512896545975 -->     <string name="permdesc_readContacts" product="tablet" msgid="4028657556924039119">"Permetta ad ina applicaziun da leger tut las datas da contacts (adressas) memorisadas sin Voss telefonin. Applicaziuns donnegiusas pon utilisar questa funcziun per trametter Vossas datas ad autras persunas."</string>
-    <!-- outdated translation 3371591512896545975 -->     <string name="permdesc_readContacts" product="default" msgid="2032222056456498547">"Permetta ad ina applicaziun da leger tut las datas da contacts (adressas) memorisadas sin Voss telefonin. Applicaziuns donnegiusas pon utilisar questa funcziun per trametter Vossas datas ad autras persunas."</string>
+    <!-- no translation found for permdesc_readContacts (4028657556924039119) -->
+    <skip />
+    <!-- no translation found for permdesc_readContacts (2032222056456498547) -->
+    <skip />
     <string name="permlab_writeContacts" msgid="644616215860933284">"scriver datas da contact"</string>
-    <!-- outdated translation 3924383579108183601 -->     <string name="permdesc_writeContacts" product="tablet" msgid="988969759110632978">"Permetta ad ina applicaziun da modifitgar tut las datas da contact (adressas) memorisadas sin Voss telefonin. Applicaziuns donnegiusas pon utilisar questa funcziun per stizzar u modifitgar Vossas datas da contact."</string>
-    <!-- outdated translation 3924383579108183601 -->     <string name="permdesc_writeContacts" product="default" msgid="5075164818647934067">"Permetta ad ina applicaziun da modifitgar tut las datas da contact (adressas) memorisadas sin Voss telefonin. Applicaziuns donnegiusas pon utilisar questa funcziun per stizzar u modifitgar Vossas datas da contact."</string>
+    <!-- no translation found for permdesc_writeContacts (988969759110632978) -->
+    <skip />
+    <!-- no translation found for permdesc_writeContacts (5075164818647934067) -->
+    <skip />
     <!-- no translation found for permlab_readProfile (6824681438529842282) -->
     <skip />
     <!-- no translation found for permdesc_readProfile (94520753797630679) -->
@@ -366,59 +496,96 @@
     <skip />
     <!-- no translation found for permdesc_writeSocialStream (3496277176955721451) -->
     <skip />
-    <!-- outdated translation 6898987798303840534 -->     <string name="permlab_readCalendar" msgid="5972727560257612398">"leger eveniments da chalender"</string>
-    <!-- outdated translation 5533029139652095734 -->     <string name="permdesc_readCalendar" product="tablet" msgid="2338414551004122687">"Permetta ad ina applicaziun da leger tut ils eveniments da chalender memorisads sin Voss telefonin. Applicaziuns donnegiusas pon uschia trametter Voss eveniments da chalender ad autras persunas."</string>
-    <!-- outdated translation 5533029139652095734 -->     <string name="permdesc_readCalendar" product="default" msgid="5693933067751827753">"Permetta ad ina applicaziun da leger tut ils eveniments da chalender memorisads sin Voss telefonin. Applicaziuns donnegiusas pon uschia trametter Voss eveniments da chalender ad autras persunas."</string>
-    <!-- outdated translation 3894879352594904361 -->     <string name="permlab_writeCalendar" msgid="8438874755193825647">"agiuntar u modifitgar eveniments en il chalender e trametter e-mails als envidads"</string>
-    <!-- outdated translation 2988871373544154221 -->     <string name="permdesc_writeCalendar" msgid="2243771395254848873">"Permetta ad ina applicaziun dad agiuntar u modifitgar eveniments en Voss chalender che pon trametter e-mails ad envidads. Applicaziuns donnegiusas pon uschia stizzar u modifitgar las datas en Voss chalender u trametter e-mails ad envidads."</string>
+    <!-- no translation found for permlab_readCalendar (5972727560257612398) -->
+    <skip />
+    <!-- no translation found for permdesc_readCalendar (2338414551004122687) -->
+    <skip />
+    <!-- no translation found for permdesc_readCalendar (5693933067751827753) -->
+    <skip />
+    <!-- no translation found for permlab_writeCalendar (8438874755193825647) -->
+    <skip />
+    <!-- no translation found for permdesc_writeCalendar (2243771395254848873) -->
+    <skip />
     <string name="permlab_accessMockLocation" msgid="8688334974036823330">"creaziun da funtaunas da posiziun fictivas per motivs da test"</string>
-    <!-- outdated translation 7648286063459727252 -->     <string name="permdesc_accessMockLocation" msgid="7577931556422993949">"Permetta da crear funtaunas da localisaziun fictivas per motivs da test. Applicaziuns donnegiusas pon uschia remplazzar la posiziun ed il status returnà da las vairas funtaunas sco GPS u Voss gestiunari da la rait."</string>
+    <!-- no translation found for permdesc_accessMockLocation (7577931556422993949) -->
+    <skip />
     <string name="permlab_accessLocationExtraCommands" msgid="2836308076720553837">"access als cumonds supplementars da purschiders da posiziuns geograficas"</string>
-    <!-- outdated translation 1948144701382451721 -->     <string name="permdesc_accessLocationExtraCommands" msgid="6737736970602176133">"Permetta d\'acceder a cumonds supplementars da purschiders da posiziuns geograficas. Applicaziuns donnegiusas pon uschia eventualmain disturbar il funcziunament da GPS u autras funtaunas da localisaziun geografica."</string>
+    <!-- no translation found for permdesc_accessLocationExtraCommands (6737736970602176133) -->
+    <skip />
     <string name="permlab_installLocationProvider" msgid="6578101199825193873">"permetter l\'installaziun d\'in purschider da servetschs da localisaziun"</string>
-    <!-- outdated translation 5449175116732002106 -->     <string name="permdesc_installLocationProvider" msgid="1742577679350078373">"Crear funtaunas da localisaziun fictivas per motivs da test. Applicaziuns donnegiusas pon uschia remplazzar la posiziun ed il status returnads da las funtaunas vairas sco GPS u Voss gestiunari da la rait u survegliar Vossa posiziun geografica e la transmetter ad ina funtauna externa."</string>
+    <!-- no translation found for permdesc_installLocationProvider (1742577679350078373) -->
+    <skip />
     <string name="permlab_accessFineLocation" msgid="8116127007541369477">"posiziun exacta (GPS)"</string>
-    <!-- outdated translation 7411213317434337331 -->     <string name="permdesc_accessFineLocation" product="tablet" msgid="5326423948268164934">"Permetta d\'acceder a funtaunas da localisaziun exactas sco GPS (Global Positioning System) sche in tal è disponibel. Applicaziuns donnegiusas pon uschia identifitgar Vossa posiziun geografica e consumar energia supplementara da l\'accu."</string>
-    <!-- outdated translation 7411213317434337331 -->     <string name="permdesc_accessFineLocation" product="default" msgid="7130267914433890869">"Permetta d\'acceder a funtaunas da localisaziun exactas sco GPS (Global Positioning System) sche in tal è disponibel. Applicaziuns donnegiusas pon uschia identifitgar Vossa posiziun geografica e consumar energia supplementara da l\'accu."</string>
+    <!-- no translation found for permdesc_accessFineLocation (5326423948268164934) -->
+    <skip />
+    <!-- no translation found for permdesc_accessFineLocation (7130267914433890869) -->
+    <skip />
     <string name="permlab_accessCoarseLocation" msgid="4642255009181975828">"Posiziun geografica approximativa (sin basa da la rait)"</string>
-    <!-- outdated translation 8235655958070862293 -->     <string name="permdesc_accessCoarseLocation" product="tablet" msgid="5460726396318105483">"\"Acceda a funtaunas approximativas da localisaziun (per exempel bancas da datas da raits mobilas) per determinar la posiziun geografica dal telefonin, sche questa opziun è disponibla. Applicaziuns donnegiusas pon utilisar questa funcziun per vegnir a savair nua che Vus sa chattais circa.\""</string>
-    <!-- outdated translation 8235655958070862293 -->     <string name="permdesc_accessCoarseLocation" product="default" msgid="8900795778057579522">"\"Acceda a funtaunas approximativas da localisaziun (per exempel bancas da datas da raits mobilas) per determinar la posiziun geografica dal telefonin, sche questa opziun è disponibla. Applicaziuns donnegiusas pon utilisar questa funcziun per vegnir a savair nua che Vus sa chattais circa.\""</string>
+    <!-- no translation found for permdesc_accessCoarseLocation (5460726396318105483) -->
+    <skip />
+    <!-- no translation found for permdesc_accessCoarseLocation (8900795778057579522) -->
+    <skip />
     <string name="permlab_accessSurfaceFlinger" msgid="2363969641792388947">"access a SurfaceFlinger"</string>
-    <!-- outdated translation 6805241830020733025 -->     <string name="permdesc_accessSurfaceFlinger" msgid="1041619516733293551">"Permetta ad ina applicaziun dad utilisar las funcziuns SurfaceFlinger datiers al nivel dal sistem."</string>
+    <!-- no translation found for permdesc_accessSurfaceFlinger (1041619516733293551) -->
+    <skip />
     <string name="permlab_readFrameBuffer" msgid="6690504248178498136">"leger il paraculp da frame"</string>
-    <!-- outdated translation 5777679658669057819 -->     <string name="permdesc_readFrameBuffer" msgid="4937405521809454680">"Permetta ad ina applicaziun da leger il cuntegn dal paraculp da frame."</string>
+    <!-- no translation found for permdesc_readFrameBuffer (4937405521809454680) -->
+    <skip />
     <string name="permlab_modifyAudioSettings" msgid="6095859937069146086">"modifitgar Voss parameters audio"</string>
-    <!-- outdated translation 5793461287365991922 -->     <string name="permdesc_modifyAudioSettings" msgid="7343951185408396919">"Permetta a l\'applicaziun da modifitgar ils parameters generals dad audio (per exempel il volumen e routing)."</string>
+    <!-- no translation found for permdesc_modifyAudioSettings (7343951185408396919) -->
+    <skip />
     <string name="permlab_recordAudio" msgid="3876049771427466323">"registrar audio"</string>
-    <!-- outdated translation 6493228261176552356 -->     <string name="permdesc_recordAudio" msgid="2387462233976248635">"Permetta a l\'applicaziun dad acceder a la via d\'access per registraziuns dad audio."</string>
+    <!-- no translation found for permdesc_recordAudio (2387462233976248635) -->
+    <skip />
     <string name="permlab_camera" msgid="3616391919559751192">"fotografar e registrar videos"</string>
-    <!-- outdated translation 6004878235852154239 -->     <string name="permdesc_camera" msgid="1507407407002492176">"Permetta a l\'applicaziun da fotografar e da registrar videos cun la camera. Uschia po l\'applicaziun rimnar da tut temp maletgs fatgs cun la camera."</string>
-    <!-- outdated translation 8337817093326370537 -->     <string name="permlab_brick" product="tablet" msgid="2961292205764488304">"deactivar permanentamain il telefonin"</string>
+    <!-- no translation found for permdesc_camera (1507407407002492176) -->
+    <skip />
+    <!-- no translation found for permlab_brick (2961292205764488304) -->
+    <skip />
     <string name="permlab_brick" product="default" msgid="8337817093326370537">"deactivar permanentamain il telefonin"</string>
-    <!-- outdated translation 5569526552607599221 -->     <string name="permdesc_brick" product="tablet" msgid="4334818808001699530">"Permetta ad ina applicaziun da deactivar definitivamain il telefon. Questa autorisaziun è fitg privlusa."</string>
-    <!-- outdated translation 5569526552607599221 -->     <string name="permdesc_brick" product="default" msgid="5788903297627283099">"Permetta ad ina applicaziun da deactivar definitivamain il telefon. Questa autorisaziun è fitg privlusa."</string>
-    <!-- outdated translation 2898560872462638242 -->     <string name="permlab_reboot" product="tablet" msgid="3436634972561795002">"sfurzar il telefonin da reaviar"</string>
+    <!-- no translation found for permdesc_brick (4334818808001699530) -->
+    <skip />
+    <!-- no translation found for permdesc_brick (5788903297627283099) -->
+    <skip />
+    <!-- no translation found for permlab_reboot (3436634972561795002) -->
+    <skip />
     <string name="permlab_reboot" product="default" msgid="2898560872462638242">"sfurzar il telefonin da reaviar"</string>
-    <!-- outdated translation 7914933292815491782 -->     <string name="permdesc_reboot" product="tablet" msgid="8172056180063700741">"Permetta a l\'applicaziun da sfurzar il telefonin da reaviar."</string>
-    <!-- outdated translation 7914933292815491782 -->     <string name="permdesc_reboot" product="default" msgid="5326008124289989969">"Permetta a l\'applicaziun da sfurzar il telefonin da reaviar."</string>
+    <!-- no translation found for permdesc_reboot (8172056180063700741) -->
+    <skip />
+    <!-- no translation found for permdesc_reboot (5326008124289989969) -->
+    <skip />
     <string name="permlab_mount_unmount_filesystems" msgid="1761023272170956541">"montar e demontar sistems da datotecas"</string>
-    <!-- outdated translation 6253263792535859767 -->     <string name="permdesc_mount_unmount_filesystems" msgid="1829290701658992347">"Permetta a l\'applicaziun da montar e demontar sistems da datotecas per apparats periferics da memoria mobila."</string>
+    <!-- no translation found for permdesc_mount_unmount_filesystems (1829290701658992347) -->
+    <skip />
     <string name="permlab_mount_format_filesystems" msgid="5523285143576718981">"formataziun da la memoria externa"</string>
-    <!-- outdated translation 574060044906047386 -->     <string name="permdesc_mount_format_filesystems" msgid="8784268246779198627">"Permetta a l\'applicaziun da formatar memoria mobila."</string>
-    <!-- outdated translation 1070364079249834666 -->     <string name="permlab_asec_access" msgid="3411338632002193846">"obtegnair infurmaziuns davart la memoria segira"</string>
-    <!-- outdated translation 7691616292170590244 -->     <string name="permdesc_asec_access" msgid="3094563844593878548">"Permetta a l\'applicaziun dad obtegnair infurmaziuns davart la memoria segira."</string>
-    <!-- outdated translation 7312078032326928899 -->     <string name="permlab_asec_create" msgid="6414757234789336327">"crear ina memoria segira"</string>
-    <!-- outdated translation 7041802322759014035 -->     <string name="permdesc_asec_create" msgid="4558869273585856876">"Permetta a l\'applicaziun da crear ina memoria segira."</string>
-    <!-- outdated translation 7787322878955261006 -->     <string name="permlab_asec_destroy" msgid="526928328301618022">"allontanar la memoria segira"</string>
-    <!-- outdated translation 5740754114967893169 -->     <string name="permdesc_asec_destroy" msgid="7218749286145526537">"Permetta a l\'applicaziun dad allontanar la memoria segira."</string>
-    <!-- outdated translation 7517449694667828592 -->     <string name="permlab_asec_mount_unmount" msgid="8877998101944999386">"montar/demontar la memoria segira"</string>
-    <!-- outdated translation 5438078121718738625 -->     <string name="permdesc_asec_mount_unmount" msgid="3451360114902490929">"Permetta a l\'applicaziun da montar/demontar la memoria segira."</string>
-    <!-- outdated translation 5685344390439934495 -->     <string name="permlab_asec_rename" msgid="7496633954080472417">"renumnar la memoria segira"</string>
-    <!-- outdated translation 1387881770708872470 -->     <string name="permdesc_asec_rename" msgid="1794757588472127675">"Permetta a l\'applicaziun da renumnar la memoria segira."</string>
+    <!-- no translation found for permdesc_mount_format_filesystems (8784268246779198627) -->
+    <skip />
+    <!-- no translation found for permlab_asec_access (3411338632002193846) -->
+    <skip />
+    <!-- no translation found for permdesc_asec_access (3094563844593878548) -->
+    <skip />
+    <!-- no translation found for permlab_asec_create (6414757234789336327) -->
+    <skip />
+    <!-- no translation found for permdesc_asec_create (4558869273585856876) -->
+    <skip />
+    <!-- no translation found for permlab_asec_destroy (526928328301618022) -->
+    <skip />
+    <!-- no translation found for permdesc_asec_destroy (7218749286145526537) -->
+    <skip />
+    <!-- no translation found for permlab_asec_mount_unmount (8877998101944999386) -->
+    <skip />
+    <!-- no translation found for permdesc_asec_mount_unmount (3451360114902490929) -->
+    <skip />
+    <!-- no translation found for permlab_asec_rename (7496633954080472417) -->
+    <skip />
+    <!-- no translation found for permdesc_asec_rename (1794757588472127675) -->
+    <skip />
     <string name="permlab_vibrate" msgid="7768356019980849603">"controllar la vibraziun"</string>
-    <!-- outdated translation 2886677177257789187 -->     <string name="permdesc_vibrate" msgid="6284989245902300945">"Permetta a l\'applicaziun da controllar la vibraziun."</string>
+    <!-- no translation found for permdesc_vibrate (6284989245902300945) -->
+    <skip />
     <string name="permlab_flashlight" msgid="2155920810121984215">"controllar la glischina"</string>
-    <!-- outdated translation 6433045942283802309 -->     <string name="permdesc_flashlight" msgid="6522284794568368310">"Permetta a l\'applicaziun da controllar la glischina."</string>
+    <!-- no translation found for permdesc_flashlight (6522284794568368310) -->
+    <skip />
     <!-- no translation found for permlab_manageUsb (1113453430645402723) -->
     <skip />
     <!-- no translation found for permdesc_manageUsb (7776155430218239833) -->
@@ -428,112 +595,180 @@
     <!-- no translation found for permdesc_accessMtp (6532961200486791570) -->
     <skip />
     <string name="permlab_hardware_test" msgid="4148290860400659146">"testar la hardware"</string>
-    <!-- outdated translation 3668894686500081699 -->     <string name="permdesc_hardware_test" msgid="6597964191208016605">"Permetta ad ina applicaziun da controllar differents apparats periferics per motivs da test da hardware."</string>
+    <!-- no translation found for permdesc_hardware_test (6597964191208016605) -->
+    <skip />
     <string name="permlab_callPhone" msgid="3925836347681847954">"telefonar directamain a numers da telefon"</string>
-    <!-- outdated translation 3369867353692722456 -->     <string name="permdesc_callPhone" msgid="6396463004110544744">"Permetta a l\'applicaziun da far telefons senza Vossa intervenziun. Applicaziuns donnegiusas pon uschia chaschunar telefons nunspetgads sin Voss quint da telefon. Questa funcziun permetta dentant betg da telefonar a numers d\'urgenza."</string>
+    <!-- no translation found for permdesc_callPhone (6396463004110544744) -->
+    <skip />
     <string name="permlab_callPrivileged" msgid="4198349211108497879">"telefonar directamain a mintga numer"</string>
-    <!-- outdated translation 244405067160028452 -->     <string name="permdesc_callPrivileged" msgid="1689024901509996810">"Permetta a l\'applicaziun da cumponer mintga numer (inclus numers d\'urgenza) senza Vossa intervenziun. Applicaziuns donnegiusas pon uschia far telefons nunnecessaris ed illegals a numers d\'urgenza."</string>
-    <!-- outdated translation 5604848095315421425 -->     <string name="permlab_performCdmaProvisioning" product="tablet" msgid="4842576994144604821">"aviar directamain la configuraziun dal telefonin CDMA"</string>
+    <!-- no translation found for permdesc_callPrivileged (1689024901509996810) -->
+    <skip />
+    <!-- no translation found for permlab_performCdmaProvisioning (4842576994144604821) -->
+    <skip />
     <string name="permlab_performCdmaProvisioning" product="default" msgid="5604848095315421425">"aviar directamain la configuraziun dal telefonin CDMA"</string>
-    <!-- outdated translation 6457447676108355905 -->     <string name="permdesc_performCdmaProvisioning" msgid="1994193538802314186">"Permetta a l\'applicaziun dad aviar il provediment CDMA. Applicaziuns donnegiusas pon uschia aviar inutilmain il provediment CDMA."</string>
+    <!-- no translation found for permdesc_performCdmaProvisioning (1994193538802314186) -->
+    <skip />
     <string name="permlab_locationUpdates" msgid="7785408253364335740">"controllar ils avis ad actualisaziuns da la posiziun geografica"</string>
-    <!-- outdated translation 2300018303720930256 -->     <string name="permdesc_locationUpdates" msgid="1120741557891438876">"Permetta l\'activaziun/deactivaziun dad avis ad actualisaziuns da la posiziun geografica che derivan dal signal da radio. Betg previs per applicaziuns normalas."</string>
+    <!-- no translation found for permdesc_locationUpdates (1120741557891438876) -->
+    <skip />
     <string name="permlab_checkinProperties" msgid="7855259461268734914">"access a las caracteristicas check-in"</string>
-    <!-- outdated translation 7150307006141883832 -->     <string name="permdesc_checkinProperties" msgid="4024526968630194128">"Permetta l\'access (leger e scriver) ad elements transmess dal servetsch check-in. Betg previs per applicaziuns normalas."</string>
+    <!-- no translation found for permdesc_checkinProperties (4024526968630194128) -->
+    <skip />
     <string name="permlab_bindGadget" msgid="776905339015863471">"tscherner ils widgets"</string>
-    <!-- outdated translation 2098697834497452046 -->     <string name="permdesc_bindGadget" msgid="8261326938599049290">"Permetta a l\'applicaziun dad annunziar al sistem tge widgets che pon vegnir utilisads da tge applicaziun. Cun questa permissiun pon applicaziuns autorisar l\'access a datas persunalas per autras applicaziuns. Questa opziun n\'è betg previsa per applicaziuns normalas."</string>
+    <!-- no translation found for permdesc_bindGadget (8261326938599049290) -->
+    <skip />
     <string name="permlab_modifyPhoneState" msgid="8423923777659292228">"modifitgar il status dal telefon"</string>
-    <!-- outdated translation 3302284561346956587 -->     <string name="permdesc_modifyPhoneState" msgid="1029877529007686732">"\"Permetta ad ina applicaziun da controllar las funcziunalitads telefonicas da l\'apparat. Ina applicaziun po uschia midar la rait, deactivar ed activar il signal radiofonic dal telefon etc. senza As avertir.\""</string>
+    <!-- no translation found for permdesc_modifyPhoneState (1029877529007686732) -->
+    <skip />
     <string name="permlab_readPhoneState" msgid="2326172951448691631">"leger il status e l\'identitad dal telefon"</string>
-    <!-- outdated translation 8987653603298258459 -->     <string name="permdesc_readPhoneState" msgid="5127767618743602782">"\"Permetta a l\'applicaziun dad acceder a las funcziuns da clom dal telefonin. Ina applicaziun cun questas permissiuns po eruir il numer che quest telefonin utilisescha, schebain i vegn telefonà ed identifitgar il numer clamà etc.\""</string>
-    <!-- outdated translation 573480187941496130 -->     <string name="permlab_wakeLock" product="tablet" msgid="1531731435011495015">"evitar ch\'il telefon midia en il modus stand-by"</string>
+    <!-- no translation found for permdesc_readPhoneState (5127767618743602782) -->
+    <skip />
+    <!-- no translation found for permlab_wakeLock (1531731435011495015) -->
+    <skip />
     <string name="permlab_wakeLock" product="default" msgid="573480187941496130">"evitar ch\'il telefon midia en il modus stand-by"</string>
-    <!-- outdated translation 7584036471227467099 -->     <string name="permdesc_wakeLock" product="tablet" msgid="7311319824400447868">"Permetta ad ina applicaziun dad evitar ch\'il telefon midia en il modus standby."</string>
-    <!-- outdated translation 7584036471227467099 -->     <string name="permdesc_wakeLock" product="default" msgid="8559100677372928754">"Permetta ad ina applicaziun dad evitar ch\'il telefon midia en il modus standby."</string>
-    <!-- outdated translation 4928622470980943206 -->     <string name="permlab_devicePower" product="tablet" msgid="2787034722616350417">"metter en/ord funcziun l\'apparat"</string>
+    <!-- no translation found for permdesc_wakeLock (7311319824400447868) -->
+    <skip />
+    <!-- no translation found for permdesc_wakeLock (8559100677372928754) -->
+    <skip />
+    <!-- no translation found for permlab_devicePower (2787034722616350417) -->
+    <skip />
     <string name="permlab_devicePower" product="default" msgid="4928622470980943206">"metter en/ord funcziun l\'apparat"</string>
-    <!-- outdated translation 4577331933252444818 -->     <string name="permdesc_devicePower" product="tablet" msgid="6689862878984631831">"Permetta ad ina applicaziun dad activar u deactivar il telefonin."</string>
-    <!-- outdated translation 4577331933252444818 -->     <string name="permdesc_devicePower" product="default" msgid="6037057348463131032">"Permetta ad ina applicaziun dad activar u deactivar il telefonin."</string>
+    <!-- no translation found for permdesc_devicePower (6689862878984631831) -->
+    <skip />
+    <!-- no translation found for permdesc_devicePower (6037057348463131032) -->
+    <skip />
     <string name="permlab_factoryTest" msgid="3715225492696416187">"exequir en il modus da test da fabrica"</string>
-    <!-- outdated translation 8136644990319244802 -->     <string name="permdesc_factoryTest" product="tablet" msgid="3952059318359653091">"Permetta d\'exequir sco test da fabrica datiers al nivel dal sistem cun autorisar l\'access a la hardware dal telefonin. Questa funcziunalitad è mo disponibla sch\'il telefonin sa chatta en il modus da test da fabrica."</string>
+    <!-- no translation found for permdesc_factoryTest (3952059318359653091) -->
+    <skip />
     <string name="permdesc_factoryTest" product="default" msgid="8136644990319244802">"Permetta d\'exequir sco test da fabrica datiers al nivel dal sistem cun autorisar l\'access a la hardware dal telefonin. Questa funcziunalitad è mo disponibla sch\'il telefonin sa chatta en il modus da test da fabrica."</string>
     <string name="permlab_setWallpaper" msgid="6627192333373465143">"definir la culissa"</string>
-    <!-- outdated translation 6417041752170585837 -->     <string name="permdesc_setWallpaper" msgid="7373447920977624745">"Permetta a l\'applicaziun da definir il fund davos dal sistem."</string>
+    <!-- no translation found for permdesc_setWallpaper (7373447920977624745) -->
+    <skip />
     <string name="permlab_setWallpaperHints" msgid="3600721069353106851">"definir ils indicaturs da grondezza per il fund davos"</string>
-    <!-- outdated translation 6019479164008079626 -->     <string name="permdesc_setWallpaperHints" msgid="8235784384223730091">"Permetta a l\'applicaziun da definir la grondezza dal fund dal visur."</string>
+    <!-- no translation found for permdesc_setWallpaperHints (8235784384223730091) -->
+    <skip />
     <string name="permlab_masterClear" msgid="2315750423139697397">"reinizialisar il sistem cun ses parameters originals"</string>
-    <!-- outdated translation 5033465107545174514 -->     <string name="permdesc_masterClear" msgid="3665380492633910226">"\"Permetta ad ina applicaziun da restaurar il stadi original dal sistem. Qua tras vegnan tut las datas, las configuraziuns e las applicaziuns installadas stizzadas.\""</string>
+    <!-- no translation found for permdesc_masterClear (3665380492633910226) -->
+    <skip />
     <string name="permlab_setTime" msgid="2021614829591775646">"drizzar l\'ura"</string>
-    <!-- outdated translation 667294309287080045 -->     <string name="permdesc_setTime" product="tablet" msgid="1896341438151152881">"Permetta ad ina applicaziun da drizzar l\'ura dal telefonin."</string>
-    <!-- outdated translation 667294309287080045 -->     <string name="permdesc_setTime" product="default" msgid="1855702730738020">"Permetta ad ina applicaziun da drizzar l\'ura dal telefonin."</string>
+    <!-- no translation found for permdesc_setTime (1896341438151152881) -->
+    <skip />
+    <!-- no translation found for permdesc_setTime (1855702730738020) -->
+    <skip />
     <string name="permlab_setTimeZone" msgid="2945079801013077340">"definir la zona d\'urari"</string>
-    <!-- outdated translation 1902540227418179364 -->     <string name="permdesc_setTimeZone" product="tablet" msgid="1676983712315827645">"Permetta ad ina applicaziun da modifitgar la zona d\'urari dal telefonin."</string>
-    <!-- outdated translation 1902540227418179364 -->     <string name="permdesc_setTimeZone" product="default" msgid="4499943488436633398">"Permetta ad ina applicaziun da modifitgar la zona d\'urari dal telefonin."</string>
+    <!-- no translation found for permdesc_setTimeZone (1676983712315827645) -->
+    <skip />
+    <!-- no translation found for permdesc_setTimeZone (4499943488436633398) -->
+    <skip />
     <string name="permlab_accountManagerService" msgid="4829262349691386986">"agir sco administratur da contos"</string>
-    <!-- outdated translation 6056903274106394752 -->     <string name="permdesc_accountManagerService" msgid="2684502137670299915">"Permetta ad ina applicaziun da telefonar ad autentificaturs da contos."</string>
+    <!-- no translation found for permdesc_accountManagerService (1948455552333615954) -->
+    <skip />
     <string name="permlab_getAccounts" msgid="4549918644233460103">"tschertgar contos enconuschents"</string>
-    <!-- outdated translation 6839262446413155394 -->     <string name="permdesc_getAccounts" product="tablet" msgid="3238360555257773358">"Permetta ad ina applicaziun da consultar la glista dals contos enconuschents al telefonin."</string>
-    <!-- outdated translation 6839262446413155394 -->     <string name="permdesc_getAccounts" product="default" msgid="2735689364629830348">"Permetta ad ina applicaziun da consultar la glista dals contos enconuschents al telefonin."</string>
+    <!-- no translation found for permdesc_getAccounts (3238360555257773358) -->
+    <skip />
+    <!-- no translation found for permdesc_getAccounts (2735689364629830348) -->
+    <skip />
     <string name="permlab_authenticateAccounts" msgid="3940505577982882450">"agir sco autentificatur da contos"</string>
-    <!-- outdated translation 4006839406474208874 -->     <string name="permdesc_authenticateAccounts" msgid="5472124296908977260">"\"Permetta ad ina applicaziun dad utilisar las funcziuns d\'autentificaziun da conto da l\'administratur da contos, inclus funcziuns per crear contos ed obtegnair e definir lur pleds-clav.\""</string>
+    <!-- no translation found for permdesc_authenticateAccounts (5472124296908977260) -->
+    <skip />
     <string name="permlab_manageAccounts" msgid="4440380488312204365">"administrar la glista da contos"</string>
-    <!-- outdated translation 8804114016661104517 -->     <string name="permdesc_manageAccounts" msgid="8698295625488292506">"Permetta ad ina applicaziun dad agiuntar ed allontanar contos e stizzar lur pleds-clav."</string>
+    <!-- no translation found for permdesc_manageAccounts (8698295625488292506) -->
+    <skip />
     <string name="permlab_useCredentials" msgid="6401886092818819856">"utilisar las infurmaziuns dad autentificaziun dad in conto"</string>
-    <!-- outdated translation 7416570544619546974 -->     <string name="permdesc_useCredentials" msgid="7984227147403346422">"Permetta ad ina applicaziun da dumandar tokens d\'autentificaziun."</string>
+    <!-- no translation found for permdesc_useCredentials (7984227147403346422) -->
+    <skip />
     <string name="permlab_accessNetworkState" msgid="6865575199464405769">"mussar il status da la rait"</string>
-    <!-- outdated translation 558721128707712766 -->     <string name="permdesc_accessNetworkState" msgid="479772796952547198">"Permetta ad ina applicaziun da vesair ils status da tut las raits."</string>
+    <!-- no translation found for permdesc_accessNetworkState (479772796952547198) -->
+    <skip />
     <string name="permlab_createNetworkSockets" msgid="9121633680349549585">"access cumplet a l\'internet"</string>
-    <!-- outdated translation 4593339106921772192 -->     <string name="permdesc_createNetworkSockets" msgid="5963922297444265950">"Permetta ad ina applicaziun da crear sockets da rait."</string>
-    <!-- outdated translation 7823599210086622545 -->     <string name="permlab_writeApnSettings" msgid="505660159675751896">"scriver parameters per nums da puncts d\'access"</string>
-    <!-- outdated translation 7443433457842966680 -->     <string name="permdesc_writeApnSettings" msgid="5333798886412714193">"\"Permetta ad ina applicaziun da modifitgar ils parameters APN (num dals puncts d\'access), sco proxy ni port da mintga APN.\""</string>
+    <!-- no translation found for permdesc_createNetworkSockets (5963922297444265950) -->
+    <skip />
+    <!-- no translation found for permlab_writeApnSettings (505660159675751896) -->
+    <skip />
+    <!-- no translation found for permdesc_writeApnSettings (5333798886412714193) -->
+    <skip />
     <string name="permlab_changeNetworkState" msgid="958884291454327309">"modifitgar la connectivitad da la rait"</string>
-    <!-- outdated translation 4199958910396387075 -->     <string name="permdesc_changeNetworkState" msgid="6789123912476416214">"Permetta ad ina applicaziun da modifitgar il status da connectivitad da la rait."</string>
-    <!-- outdated translation 2702121155761140799 -->     <string name="permlab_changeTetherState" msgid="5952584964373017960">"midar la connectivitad da tethering"</string>
-    <!-- outdated translation 8905815579146349568 -->     <string name="permdesc_changeTetherState" msgid="1524441344412319780">"Permetta ad ina applicaziun da modifitgar il status da connectivitad dal tethering."</string>
+    <!-- no translation found for permdesc_changeNetworkState (6789123912476416214) -->
+    <skip />
+    <!-- no translation found for permlab_changeTetherState (5952584964373017960) -->
+    <skip />
+    <!-- no translation found for permdesc_changeTetherState (1524441344412319780) -->
+    <skip />
     <string name="permlab_changeBackgroundDataSetting" msgid="1400666012671648741">"modifitgar il parameter d\'utilisaziun da datas dal fund davos"</string>
-    <!-- outdated translation 1001482853266638864 -->     <string name="permdesc_changeBackgroundDataSetting" msgid="5347729578468744379">"Permetta ad ina applicaziun da modifitgar il parameters d\'utilisaziun da las datas dal fund davos."</string>
+    <!-- no translation found for permdesc_changeBackgroundDataSetting (5347729578468744379) -->
+    <skip />
     <string name="permlab_accessWifiState" msgid="8100926650211034400">"mussar il status WLAN"</string>
-    <!-- outdated translation 485796529139236346 -->     <string name="permdesc_accessWifiState" msgid="7770452658226256831">"Permetta ad ina applicaziun da vesair las infurmaziuns concernent il status WLAN."</string>
+    <!-- no translation found for permdesc_accessWifiState (7770452658226256831) -->
+    <skip />
     <string name="permlab_changeWifiState" msgid="7280632711057112137">"modifitgar il status WLAN"</string>
-    <!-- outdated translation 2950383153656873267 -->     <string name="permdesc_changeWifiState" msgid="7399961004537946240">"\"Permetta ad ina applicaziun da stabilir ina connexiun a puncts d\'access WLAN, da sa deconnectar da quels e da modifitgar ils parameters da raits WLAN configuradas.\""</string>
+    <!-- no translation found for permdesc_changeWifiState (7399961004537946240) -->
+    <skip />
     <string name="permlab_changeWifiMulticastState" msgid="1368253871483254784">"permetter la recepziun da multicast WLAN"</string>
-    <!-- outdated translation 8199464507656067553 -->     <string name="permdesc_changeWifiMulticastState" msgid="7633598524564320817">"Permetta ad ina applicaziun da retschaiver pachets da datas che n\'èn betg adressads directamain a Voss apparat. Quai po esser nizzaivel per tschertgar servetschs che vegnan mess a disposiziun en il conturn. Consumescha dapli energia ch\'il modus betg-multicast."</string>
-    <!-- outdated translation 1092209628459341292 -->     <string name="permlab_bluetoothAdmin" msgid="3606576270792236062">"administraziun bluetooth"</string>
-    <!-- outdated translation 7256289774667054555 -->     <string name="permdesc_bluetoothAdmin" product="tablet" msgid="6921177471748882137">"\"Permetta ad ina applicaziun da configurar il telefon bluetooth local, dad identifitgar apparats periferics a distanza e d\'als associar cun il telefon.\""</string>
-    <!-- outdated translation 7256289774667054555 -->     <string name="permdesc_bluetoothAdmin" product="default" msgid="8931682159331542137">"\"Permetta ad ina applicaziun da configurar il telefon bluetooth local, dad identifitgar apparats periferics a distanza e d\'als associar cun il telefon.\""</string>
+    <!-- no translation found for permdesc_changeWifiMulticastState (7633598524564320817) -->
+    <skip />
+    <!-- no translation found for permlab_bluetoothAdmin (3606576270792236062) -->
+    <skip />
+    <!-- no translation found for permdesc_bluetoothAdmin (6921177471748882137) -->
+    <skip />
+    <!-- no translation found for permdesc_bluetoothAdmin (8931682159331542137) -->
+    <skip />
+    <!-- no translation found for permlab_accessWimaxState (1232061307208861588) -->
+    <skip />
+    <!-- no translation found for permdesc_accessWimaxState (5914958077555177749) -->
+    <skip />
+    <!-- no translation found for permlab_changeWimaxState (2405042267131496579) -->
+    <skip />
+    <!-- no translation found for permdesc_changeWimaxState (3328853825006455912) -->
+    <skip />
     <string name="permlab_bluetooth" msgid="8361038707857018732">"stabilir connexiuns bluetooth"</string>
-    <!-- outdated translation 762515380679392945 -->     <string name="permdesc_bluetooth" product="tablet" msgid="7007851048416363446">"Permetta ad ina applicaziun dad obtegnair la configuraziun dal telefon bluetooth local e da crear ed acceptar connexiuns ad apparats associads."</string>
-    <!-- outdated translation 762515380679392945 -->     <string name="permdesc_bluetooth" product="default" msgid="31846362767164948">"Permetta ad ina applicaziun dad obtegnair la configuraziun dal telefon bluetooth local e da crear ed acceptar connexiuns ad apparats associads."</string>
+    <!-- no translation found for permdesc_bluetooth (7007851048416363446) -->
+    <skip />
+    <!-- no translation found for permdesc_bluetooth (31846362767164948) -->
+    <skip />
     <!-- no translation found for permlab_nfc (4423351274757876953) -->
     <skip />
     <!-- no translation found for permdesc_nfc (7120611819401789907) -->
     <skip />
     <string name="permlab_disableKeyguard" msgid="4977406164311535092">"deactivar la bloccaziun da la tastatura"</string>
-    <!-- outdated translation 3189763479326302017 -->     <string name="permdesc_disableKeyguard" msgid="6231611286892232626">"Permetta ad ina applicaziun da deactivar la bloccaziun da la tastatura e la protecziun cun il pled-clav associada. In exempel dad ina utilisaziun legitima: La bloccaziun da la tastatura vegn deactivada sche Vus retschavais in clom ed ella vegn reactivada sche Vus finis il telefon."</string>
+    <!-- no translation found for permdesc_disableKeyguard (6231611286892232626) -->
+    <skip />
     <string name="permlab_readSyncSettings" msgid="6201810008230503052">"leger ils parameters da sincronisaziun"</string>
-    <!-- outdated translation 5315925706353341823 -->     <string name="permdesc_readSyncSettings" msgid="5464056785274229278">"Permetta ad ina applicaziun da leger ils parameters da sincronisaziun (per exempel per savair sche la sincronisaziun da contacts è activà u betg)."</string>
+    <!-- no translation found for permdesc_readSyncSettings (5464056785274229278) -->
+    <skip />
     <string name="permlab_writeSyncSettings" msgid="6297138566442486462">"scriver configuraziuns da sincronisaziun"</string>
-    <!-- outdated translation 2498201614431360044 -->     <string name="permdesc_writeSyncSettings" msgid="1466056564502117130">"Permetta ad ina applicaziun da modifitgar ils parameters da sincronisaziun. Uschia po ella per exempel activar e deactivar la sincronisaziun da contacts."</string>
+    <!-- no translation found for permdesc_writeSyncSettings (1466056564502117130) -->
+    <skip />
     <string name="permlab_readSyncStats" msgid="7396577451360202448">"leger las statisticas da sincronisaziun"</string>
-    <!-- outdated translation 7511448343374465000 -->     <string name="permdesc_readSyncStats" msgid="3801971839939951678">"Permetta ad ina applicaziun da leger las statisticas da sincronisaziun (per exempel la cronologia da las sincronisaziuns exequidas)."</string>
+    <!-- no translation found for permdesc_readSyncStats (3801971839939951678) -->
+    <skip />
     <string name="permlab_subscribedFeedsRead" msgid="4756609637053353318">"leger feeds abunads"</string>
-    <!-- outdated translation 3622200625634207660 -->     <string name="permdesc_subscribedFeedsRead" msgid="5557058907906144505">"Permetta ad ina applicaziun dad obtegnair infurmaziuns davart ils feeds actualisads dacurt."</string>
+    <!-- no translation found for permdesc_subscribedFeedsRead (5557058907906144505) -->
+    <skip />
     <string name="permlab_subscribedFeedsWrite" msgid="9015246325408209296">"scriver feeds abunads"</string>
-    <!-- outdated translation 8121607099326533878 -->     <string name="permdesc_subscribedFeedsWrite" msgid="6928930188826089413">"Permetta ad ina applicaziun da modifitgar Voss feeds sincronisads dacurt. Applicaziuns donnegiusas pudessan uschia modifitgar Voss feeds sincronisads."</string>
-    <!-- outdated translation 432535716804748781 -->     <string name="permlab_readDictionary" msgid="8410247960433376352">"leger il dicziunari definì da l\'utilisader"</string>
-    <!-- outdated translation 1082972603576360690 -->     <string name="permdesc_readDictionary" msgid="8977815988329283705">"Permetta ad ina applicaziun da leger tut ils pleds e nums privats e las expressiuns privatas che in utilisader ha memorisà en ses dicziunari."</string>
-    <!-- outdated translation 6703109511836343341 -->     <string name="permlab_writeDictionary" msgid="2296383164914812772">"scriver en il dicziunari definì da l\'utilisader"</string>
-    <!-- outdated translation 2241256206524082880 -->     <string name="permdesc_writeDictionary" msgid="8185385716255065291">"Permetta ad ina applicaziun da scriver novs pleds en il dicziunari dal utilisader."</string>
-    <!-- outdated translation 8079403759001777291 -->     <string name="permlab_sdcardWrite" product="nosdcard" msgid="85430876310764752">"modifitgar/stizzar cuntegns da la carta SD"</string>
+    <!-- no translation found for permdesc_subscribedFeedsWrite (6928930188826089413) -->
+    <skip />
+    <!-- no translation found for permlab_readDictionary (8410247960433376352) -->
+    <skip />
+    <!-- no translation found for permdesc_readDictionary (8977815988329283705) -->
+    <skip />
+    <!-- no translation found for permlab_writeDictionary (2296383164914812772) -->
+    <skip />
+    <!-- no translation found for permdesc_writeDictionary (8185385716255065291) -->
+    <skip />
+    <!-- no translation found for permlab_sdcardWrite (85430876310764752) -->
+    <skip />
     <string name="permlab_sdcardWrite" product="default" msgid="8079403759001777291">"modifitgar/stizzar cuntegns da la carta SD"</string>
-    <!-- outdated translation 6643963204976471878 -->     <string name="permdesc_sdcardWrite" product="nosdcard" msgid="6175406299445710888">"Permetta ad ina applicaziun da scriver sin la carta SD."</string>
-    <!-- outdated translation 6643963204976471878 -->     <string name="permdesc_sdcardWrite" product="default" msgid="4337417790936632090">"Permetta ad ina applicaziun da scriver sin la carta SD."</string>
+    <!-- no translation found for permdesc_sdcardWrite (6175406299445710888) -->
+    <skip />
+    <!-- no translation found for permdesc_sdcardWrite (4337417790936632090) -->
+    <skip />
     <!-- no translation found for permlab_mediaStorageWrite (6859839199706879015) -->
     <skip />
     <!-- no translation found for permdesc_mediaStorageWrite (8189160597698529185) -->
     <skip />
     <string name="permlab_cache_filesystem" msgid="5656487264819669824">"access al sistem da datotecas da cache"</string>
-    <!-- outdated translation 1624734528435659906 -->     <string name="permdesc_cache_filesystem" msgid="5578967642265550955">"Permetta ad ina applicaziun da leger e da scriver en il sistem da datotecas dal cache."</string>
+    <!-- no translation found for permdesc_cache_filesystem (5578967642265550955) -->
+    <skip />
     <!-- no translation found for permlab_use_sip (5986952362795870502) -->
     <skip />
     <!-- no translation found for permdesc_use_sip (4717632000062674294) -->
@@ -548,33 +783,44 @@
     <skip />
     <!-- no translation found for permlab_modifyNetworkAccounting (5088217309088729650) -->
     <skip />
-    <!-- no translation found for permdesc_modifyNetworkAccounting (8553240749784321765) -->
+    <!-- no translation found for permdesc_modifyNetworkAccounting (5443412866746198123) -->
     <skip />
-    <!-- outdated translation 4307861496302850201 -->     <string name="policylab_limitPassword" msgid="4497420728857585791">"Limitar il pled-clav"</string>
-    <!-- outdated translation 1719877245692318299 -->     <string name="policydesc_limitPassword" msgid="9083400080861728056">"Restrenscher ils tips da pleds-clav che Vus pudais utilisar."</string>
-    <!-- outdated translation 7374780712664285321 -->     <string name="policylab_watchLogin" msgid="914130646942199503">"Survegliar las emprovas da s\'annunziar"</string>
-    <!-- outdated translation 1961251179624843483 -->     <string name="policydesc_watchLogin" product="tablet" msgid="3215729294215070072">"Survegliar las emprovas betg reussidas da s\'annunziar ad in apparat periferic / dad exequir ina acziun."</string>
-    <!-- outdated translation 1961251179624843483 -->     <string name="policydesc_watchLogin" product="default" msgid="5712323091846761073">"Survegliar las emprovas betg reussidas da s\'annunziar ad in apparat periferic / dad exequir ina acziun."</string>
-    <!-- outdated translation 9084772090797485420 -->     <string name="policylab_resetPassword" msgid="2620077191242688955">"Reinizialisar il pled-clav"</string>
-    <!-- outdated translation 3332167600331799991 -->     <string name="policydesc_resetPassword" msgid="5391240616981297361">"\"Definir ina nova valur per Voss pled-clav, uschia che l\'administratur As sto dar il pled-clav avant che Vus pudais s\'annunziar.\""</string>
-    <!-- outdated translation 5760466025247634488 -->     <string name="policylab_forceLock" msgid="2274085384704248431">"Sfurzar da bloccar"</string>
-    <!-- outdated translation 2819868664946089740 -->     <string name="policydesc_forceLock" msgid="5696964126226028442">"Controlla da la bloccaziun dad apparats periferics cun l\'obligaziun dad endatar danovamain il pled-clav."</string>
+    <!-- no translation found for policylab_limitPassword (4497420728857585791) -->
+    <skip />
+    <!-- no translation found for policydesc_limitPassword (3252114203919510394) -->
+    <skip />
+    <!-- no translation found for policylab_watchLogin (914130646942199503) -->
+    <skip />
+    <!-- no translation found for policydesc_watchLogin (3215729294215070072) -->
+    <skip />
+    <!-- no translation found for policydesc_watchLogin (5712323091846761073) -->
+    <skip />
+    <!-- no translation found for policylab_resetPassword (2620077191242688955) -->
+    <skip />
+    <!-- no translation found for policydesc_resetPassword (605963962301904458) -->
+    <skip />
+    <!-- no translation found for policylab_forceLock (2274085384704248431) -->
+    <skip />
+    <!-- no translation found for policydesc_forceLock (1141797588403827138) -->
+    <skip />
     <string name="policylab_wipeData" msgid="3910545446758639713">"Stizzar tut las datas"</string>
-    <!-- outdated translation 2314060933796396205 -->     <string name="policydesc_wipeData" product="tablet" msgid="314455232799486222">"Restaurar ils parameters originals dal telefonin. Qua tras vegnan tut Vossas datas stizzadas senza dumonda da conferma."</string>
-    <!-- outdated translation 2314060933796396205 -->     <string name="policydesc_wipeData" product="default" msgid="7669895333814222586">"Restaurar ils parameters originals dal telefonin. Qua tras vegnan tut Vossas datas stizzadas senza dumonda da conferma."</string>
+    <!-- no translation found for policydesc_wipeData (4306184096067756876) -->
+    <skip />
+    <!-- no translation found for policydesc_wipeData (5096895604574188391) -->
+    <skip />
     <string name="policylab_setGlobalProxy" msgid="2784828293747791446">"Definir il proxy global da l\'apparat"</string>
     <string name="policydesc_setGlobalProxy" msgid="6387497466660154931">"Definir il proxy global da l\'apparat che duai vegnir utilisà sche la directiva è activada. Mo l\'emprim administratur dad apparats definescha il vair proxy global."</string>
     <!-- no translation found for policylab_expirePassword (885279151847254056) -->
     <skip />
-    <!-- no translation found for policydesc_expirePassword (4844430354224822074) -->
+    <!-- no translation found for policydesc_expirePassword (1729725226314691591) -->
     <skip />
     <!-- no translation found for policylab_encryptedStorage (8901326199909132915) -->
     <skip />
-    <!-- no translation found for policydesc_encryptedStorage (8877192718681120469) -->
+    <!-- no translation found for policydesc_encryptedStorage (2637732115325316992) -->
     <skip />
     <!-- no translation found for policylab_disableCamera (6395301023152297826) -->
     <skip />
-    <!-- no translation found for policydesc_disableCamera (5680054212889413366) -->
+    <!-- no translation found for policydesc_disableCamera (2306349042834754597) -->
     <skip />
   <string-array name="phoneTypes">
     <item msgid="8901098336658710359">"Privat"</item>
@@ -644,7 +890,8 @@
     <skip />
     <string name="eventTypeBirthday" msgid="2813379844211390740">"Anniversari"</string>
     <string name="eventTypeAnniversary" msgid="3876779744518284000">"Anniversari"</string>
-    <!-- outdated translation 5834288791948564594 -->     <string name="eventTypeOther" msgid="7388178939010143077">"Termin"</string>
+    <!-- no translation found for eventTypeOther (7388178939010143077) -->
+    <skip />
     <string name="emailTypeCustom" msgid="8525960257804213846">"Persunalisà"</string>
     <string name="emailTypeHome" msgid="449227236140433919">"Privat"</string>
     <string name="emailTypeWork" msgid="3548058059601149973">"Lavur"</string>
@@ -709,7 +956,8 @@
     <skip />
     <!-- no translation found for sipAddressTypeOther (4408436162950119849) -->
     <skip />
-    <!-- outdated translation 3731488827218876115 -->     <string name="keyguard_password_enter_pin_code" msgid="3037685796058495017">"Endatar il code PIN"</string>
+    <!-- no translation found for keyguard_password_enter_pin_code (3037685796058495017) -->
+    <skip />
     <!-- no translation found for keyguard_password_enter_puk_code (4800725266925845333) -->
     <skip />
     <!-- no translation found for keyguard_password_enter_puk_prompt (1341112146710087048) -->
@@ -718,12 +966,16 @@
     <skip />
     <!-- no translation found for keyguard_password_entry_touch_hint (7858547464982981384) -->
     <skip />
-    <!-- outdated translation 9138158344813213754 -->     <string name="keyguard_password_enter_password_code" msgid="1054721668279049780">"Endatai il pled-clav per debloccar."</string>
-    <!-- outdated translation 638347075625491514 -->     <string name="keyguard_password_enter_pin_password_code" msgid="6391755146112503443">"Endatar il PIN per debloccar"</string>
-    <string name="keyguard_password_wrong_pin_code" msgid="1295984114338107718">"Code PIN nuncorrect!"</string>
+    <!-- no translation found for keyguard_password_enter_password_code (1054721668279049780) -->
+    <skip />
+    <!-- no translation found for keyguard_password_enter_pin_password_code (6391755146112503443) -->
+    <skip />
+    <!-- no translation found for keyguard_password_wrong_pin_code (2422225591006134936) -->
+    <skip />
     <string name="keyguard_label_text" msgid="861796461028298424">"Smatgai per debloccar sin la tasta Menu e lura sin 0."</string>
     <string name="emergency_call_dialog_number_for_display" msgid="696192103195090970">"Numer d\'urgenza"</string>
-    <!-- outdated translation 8812714795156374435 -->     <string name="lockscreen_carrier_default" msgid="8963839242565653192">"(nagin servetsch)"</string>
+    <!-- no translation found for lockscreen_carrier_default (8963839242565653192) -->
+    <skip />
     <string name="lockscreen_screen_locked" msgid="7288443074806832904">"Visur bloccà."</string>
     <string name="lockscreen_instructions_when_pattern_enabled" msgid="46154051614126049">"Smatgai la tasta Menu per debloccar il telefonin u telefonar sin in numer d\'urgenza."</string>
     <string name="lockscreen_instructions_when_pattern_disabled" msgid="686260028797158364">"Smatgar la tasta da menu per debloccar."</string>
@@ -731,17 +983,23 @@
     <string name="lockscreen_emergency_call" msgid="5347633784401285225">"Numer d\'urgenza"</string>
     <string name="lockscreen_return_to_call" msgid="5244259785500040021">"Enavos al clom"</string>
     <string name="lockscreen_pattern_correct" msgid="9039008650362261237">"Correct!"</string>
-    <!-- outdated translation 4817583279053112312 -->     <string name="lockscreen_pattern_wrong" msgid="4317955014948108794">"Quai ans displascha. Empruvai anc ina giada."</string>
-    <!-- outdated translation 6237443657358168819 -->     <string name="lockscreen_password_wrong" msgid="5737815393253165301">"\"Perstgisai, empruvai anc ina giada.\""</string>
+    <!-- no translation found for lockscreen_pattern_wrong (4317955014948108794) -->
+    <skip />
+    <!-- no translation found for lockscreen_password_wrong (5737815393253165301) -->
+    <skip />
+    <!-- no translation found for faceunlock_multiple_failures (754137583022792429) -->
+    <skip />
     <!-- no translation found for lockscreen_plugged_in (8057762828355572315) -->
     <skip />
     <string name="lockscreen_charged" msgid="4938930459620989972">"Chargià"</string>
     <string name="lockscreen_battery_short" msgid="3617549178603354656">"<xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
     <string name="lockscreen_low_battery" msgid="1482873981919249740">"Connectai Voss chargiader."</string>
     <string name="lockscreen_missing_sim_message_short" msgid="7381499217732227295">"Nagina carta SIM."</string>
-    <!-- outdated translation 2186920585695169078 -->     <string name="lockscreen_missing_sim_message" product="tablet" msgid="151659196095791474">"En il telefon na sa chatta nagina carta SIM."</string>
+    <!-- no translation found for lockscreen_missing_sim_message (151659196095791474) -->
+    <skip />
     <string name="lockscreen_missing_sim_message" product="default" msgid="2186920585695169078">"En il telefon na sa chatta nagina carta SIM."</string>
-    <!-- outdated translation 8874620818937719067 -->     <string name="lockscreen_missing_sim_instructions" msgid="5372787138023272615">"Inseri per plaschair ina carta SIM."</string>
+    <!-- no translation found for lockscreen_missing_sim_instructions (5372787138023272615) -->
+    <skip />
     <!-- no translation found for lockscreen_missing_sim_instructions_long (3526573099019319472) -->
     <skip />
     <!-- no translation found for lockscreen_permanent_disabled_sim_instructions (910904643433151371) -->
@@ -760,7 +1018,8 @@
     <string name="lockscreen_network_locked_message" msgid="143389224986028501">"Rait bloccada"</string>
     <!-- no translation found for lockscreen_sim_puk_locked_message (7441797339976230) -->
     <skip />
-    <!-- outdated translation 635967534992394321 -->     <string name="lockscreen_sim_puk_locked_instructions" msgid="8127916255245181063">"Ulteriuras infurmaziuns chattais Vus en il manual u che Vus pudais contactar il servetsch da clientella."</string>
+    <!-- no translation found for lockscreen_sim_puk_locked_instructions (8127916255245181063) -->
+    <skip />
     <string name="lockscreen_sim_locked_message" msgid="8066660129206001039">"La carta SIM è bloccada."</string>
     <string name="lockscreen_sim_unlock_progress_dialog_message" msgid="595323214052881264">"Debloccar la carta SIM..."</string>
     <!-- no translation found for lockscreen_too_many_failed_attempts_dialog_message (6481623830344107222) -->
@@ -784,15 +1043,18 @@
     <string name="lockscreen_too_many_failed_attempts_countdown" msgid="6251480343394389665">"Empruvar anc ina giada en <xliff:g id="NUMBER">%d</xliff:g> secundas."</string>
     <string name="lockscreen_forgot_pattern_button_text" msgid="2626999449610695930">"Emblidà il schema?"</string>
     <string name="lockscreen_glogin_forgot_pattern" msgid="2588521501166032747">"Debloccaziun dal conto"</string>
-    <string name="lockscreen_glogin_too_many_attempts" msgid="2446246026221678244">"Memia bleras tentativas!"</string>
-    <string name="lockscreen_glogin_instructions" msgid="1816635201812207709">"S\'annunziai cun Voss conto Google per debloccar il telefonin."</string>
+    <!-- no translation found for lockscreen_glogin_too_many_attempts (2751368605287288808) -->
+    <skip />
+    <!-- no translation found for lockscreen_glogin_instructions (3931816256100707784) -->
+    <skip />
     <string name="lockscreen_glogin_username_hint" msgid="8846881424106484447">"Num d\'utilisader (e-mail)"</string>
     <string name="lockscreen_glogin_password_hint" msgid="5958028383954738528">"Pled-clav"</string>
     <string name="lockscreen_glogin_submit_button" msgid="7130893694795786300">"S\'annunziar"</string>
     <string name="lockscreen_glogin_invalid_input" msgid="1364051473347485908">"Num d\'utilisader u pled-clav nunvalid."</string>
-    <!-- no translation found for lockscreen_glogin_account_recovery_hint (8253152905532900548) -->
+    <!-- no translation found for lockscreen_glogin_account_recovery_hint (1696924763690379073) -->
     <skip />
-    <string name="lockscreen_glogin_checking_password" msgid="6758890536332363322">"Verifitgar..."</string>
+    <!-- no translation found for lockscreen_glogin_checking_password (7114627351286933867) -->
+    <skip />
     <string name="lockscreen_unlock_label" msgid="737440483220667054">"Debloccar"</string>
     <string name="lockscreen_sound_on_label" msgid="9068877576513425970">"Tun activà"</string>
     <string name="lockscreen_sound_off_label" msgid="996822825154319026">"Tun deactivà"</string>
@@ -813,15 +1075,17 @@
     <string name="factorytest_not_system" msgid="4435201656767276723">"L\'acziun FACTORY_TEST vegn mo sustegnida per pachets installads en /system/app."</string>
     <string name="factorytest_no_action" msgid="872991874799998561">"Betg chattà in pachet che porscha l\'acziun FACTORY_TEST."</string>
     <string name="factorytest_reboot" msgid="6320168203050791643">"Reaviar il sistem"</string>
-    <string name="js_dialog_title" msgid="8143918455087008109">"La pagina \'<xliff:g id="TITLE">%s</xliff:g>\' annunzia:"</string>
+    <!-- no translation found for js_dialog_title (1987483977834603872) -->
+    <skip />
     <string name="js_dialog_title_default" msgid="6961903213729667573">"JavaScript"</string>
     <!-- no translation found for js_dialog_before_unload (730366588032430474) -->
     <skip />
     <string name="save_password_label" msgid="6860261758665825069">"Confermar"</string>
-    <!-- outdated translation 1068216937244567247 -->     <string name="double_tap_toast" msgid="2729045387923870404">"Tip: Smatgar duas giadas per zoomar pli datiers u zoomar pli lontan."</string>
-    <!-- no translation found for autofill_this_form (1272247532604569872) -->
+    <!-- no translation found for double_tap_toast (4595046515400268881) -->
     <skip />
-    <!-- no translation found for setup_autofill (8154593408885654044) -->
+    <!-- no translation found for autofill_this_form (4616758841157816676) -->
+    <skip />
+    <!-- no translation found for setup_autofill (7103495070180590814) -->
     <skip />
     <!-- no translation found for autofill_address_name_separator (2504700673286691795) -->
     <skip />
@@ -856,10 +1120,13 @@
     <!-- no translation found for autofill_emirate (2893880978835698818) -->
     <skip />
     <string name="permlab_readHistoryBookmarks" msgid="1284843728203412135">"leger la cronologia ed ils segnapaginas dal navigatur"</string>
-    <!-- outdated translation 4981489815467617191 -->     <string name="permdesc_readHistoryBookmarks" msgid="4577476392604595921">"\"Permetta a l\'applicaziun da leger tut las URLs visitadas, sco era ils segnapaginas dal navigatur.\""</string>
+    <!-- no translation found for permdesc_readHistoryBookmarks (4577476392604595921) -->
+    <skip />
     <string name="permlab_writeHistoryBookmarks" msgid="9009434109836280374">"scriver en la cronologia ed en ils segnapaginas dal navigatur"</string>
-    <!-- outdated translation 945571990357114950 -->     <string name="permdesc_writeHistoryBookmarks" product="tablet" msgid="1757103804824209530">"\"Permetta ad ina applicaziun da modifitgar la cronologia u ils segnapaginas dal navigatur, memorisads sin Voss telefonin. Applicaziuns donnegiusas pon uschia stizzar u modifitgar las datas da Voss navigatur.\""</string>
-    <!-- outdated translation 945571990357114950 -->     <string name="permdesc_writeHistoryBookmarks" product="default" msgid="6693764355720719197">"\"Permetta ad ina applicaziun da modifitgar la cronologia u ils segnapaginas dal navigatur, memorisads sin Voss telefonin. Applicaziuns donnegiusas pon uschia stizzar u modifitgar las datas da Voss navigatur.\""</string>
+    <!-- no translation found for permdesc_writeHistoryBookmarks (1757103804824209530) -->
+    <skip />
+    <!-- no translation found for permdesc_writeHistoryBookmarks (6693764355720719197) -->
+    <skip />
     <!-- no translation found for permlab_setAlarm (5924401328803615165) -->
     <skip />
     <!-- no translation found for permdesc_setAlarm (316392039157473848) -->
@@ -868,8 +1135,10 @@
     <skip />
     <!-- no translation found for permdesc_addVoicemail (6604508651428252437) -->
     <skip />
-    <!-- outdated translation 4715212655598275532 -->     <string name="permlab_writeGeolocationPermissions" msgid="5962224158955273932">"Modifitgar las autorisaziuns da geolocalisaziun dal navigatur"</string>
-    <!-- outdated translation 4011908282980861679 -->     <string name="permdesc_writeGeolocationPermissions" msgid="1083743234522638747">"Permetta ad ina applicaziun da modifitgar las permissiuns da geolocalisaziun dal navigatur. Applicaziuns donnegiusas pon utilisar questa funcziun per trametter datas da posiziun a websites arbitraras."</string>
+    <!-- no translation found for permlab_writeGeolocationPermissions (5962224158955273932) -->
+    <skip />
+    <!-- no translation found for permdesc_writeGeolocationPermissions (1083743234522638747) -->
+    <skip />
     <!-- no translation found for permlab_packageVerificationAgent (5568139100645829117) -->
     <skip />
     <!-- no translation found for permdesc_packageVerificationAgent (8437590190990843381) -->
@@ -882,7 +1151,8 @@
     <string name="save_password_notnow" msgid="6389675316706699758">"Betg ussa"</string>
     <string name="save_password_remember" msgid="6491879678996749466">"Memorisar"</string>
     <string name="save_password_never" msgid="8274330296785855105">"Mai"</string>
-    <!-- outdated translation 5661861460947222274 -->     <string name="open_permission_deny" msgid="7374036708316629800">"Vus n\'avais betg las permissiuns necessarias per avrir questa pagina."</string>
+    <!-- no translation found for open_permission_deny (7374036708316629800) -->
+    <skip />
     <string name="text_copied" msgid="4985729524670131385">"Il text è vegnì copià en l\'archiv provisoric."</string>
     <string name="more_item_label" msgid="4650918923083320495">"Dapli"</string>
     <string name="prepend_shortcut_label" msgid="2572214461676015642">"Menu+"</string>
@@ -986,9 +1256,12 @@
     <string name="weeks" msgid="6509623834583944518">"emnas"</string>
     <string name="year" msgid="4001118221013892076">"onn"</string>
     <string name="years" msgid="6881577717993213522">"onns"</string>
-    <!-- outdated translation 3359437293118172396 -->     <string name="VideoView_error_title" msgid="5927895235831021723">"Betg reussì da reproducir il video."</string>
-    <!-- outdated translation 897920883624437033 -->     <string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"\"Perstgisai, deplorablamain n\'è quest video betg valid per il streaming sin quest apparat.\""</string>
-    <!-- outdated translation 710301040038083944 -->     <string name="VideoView_error_text_unknown" msgid="4309847331399592194">"\"Perstgisai, impussibel da leger quest video.\""</string>
+    <!-- no translation found for VideoView_error_title (3534509135438353077) -->
+    <skip />
+    <!-- no translation found for VideoView_error_text_invalid_progressive_playback (3186670335938670444) -->
+    <skip />
+    <!-- no translation found for VideoView_error_text_unknown (3450439155187810085) -->
+    <skip />
     <string name="VideoView_error_button" msgid="2822238215100679592">"OK"</string>
     <string name="relative_time" msgid="1818557177829411417">"\"<xliff:g id="DATE">%1$s</xliff:g>, <xliff:g id="TIME">%2$s</xliff:g>\""</string>
     <string name="noon" msgid="7245353528818587908">"mezdi"</string>
@@ -1006,10 +1279,9 @@
     <!-- no translation found for delete (6098684844021697789) -->
     <skip />
     <string name="copyUrl" msgid="2538211579596067402">"Copiar l\'URL"</string>
-    <!-- outdated translation 6738556348861347240 -->     <string name="selectTextMode" msgid="1018691815143165326">"Selecziunar text…"</string>
-    <string name="textSelectionCABTitle" msgid="5236850394370820357">"Selecziun da text"</string>
-    <!-- unknown placeholder WORD in addToDictionary -->
+    <!-- no translation found for selectTextMode (1018691815143165326) -->
     <skip />
+    <string name="textSelectionCABTitle" msgid="5236850394370820357">"Selecziun da text"</string>
     <!-- no translation found for addToDictionary (9090375111134433012) -->
     <skip />
     <!-- no translation found for deleteText (7070985395199629156) -->
@@ -1017,23 +1289,28 @@
     <string name="inputMethod" msgid="1653630062304567879">"Metoda d\'endataziun"</string>
     <string name="editTextMenuTitle" msgid="4909135564941815494">"Acziuns da text"</string>
     <string name="low_internal_storage_view_title" msgid="1399732408701697546">"Pauca capacitad da memorisar"</string>
-    <!-- outdated translation 635106544616378836 -->     <string name="low_internal_storage_view_text" product="tablet" msgid="4231085657068852042">"Mo pli pauca capacitad da memorisar."</string>
+    <!-- no translation found for low_internal_storage_view_text (4231085657068852042) -->
+    <skip />
     <string name="low_internal_storage_view_text" product="default" msgid="635106544616378836">"Mo pli pauca capacitad da memorisar."</string>
     <string name="ok" msgid="5970060430562524910">"OK"</string>
     <string name="cancel" msgid="6442560571259935130">"Interrumper"</string>
     <string name="yes" msgid="5362982303337969312">"OK"</string>
     <string name="no" msgid="5141531044935541497">"Interrumper"</string>
     <string name="dialog_alert_title" msgid="2049658708609043103">"Attenziun"</string>
-    <!-- outdated translation 1760724998928255250 -->     <string name="loading" msgid="7933681260296021180">"Chargiar…"</string>
+    <!-- no translation found for loading (7933681260296021180) -->
+    <skip />
     <string name="capital_on" msgid="1544682755514494298">"ACTIVÀ"</string>
     <string name="capital_off" msgid="6815870386972805832">"DEACTIVÀ"</string>
     <string name="whichApplication" msgid="4533185947064773386">"Cumplettar l\'acziun cun"</string>
     <string name="alwaysUse" msgid="4583018368000610438">"Utilisar questa applicaziun sco standard per questa acziun."</string>
-    <!-- outdated translation 4815455344600932173 -->     <string name="clearDefaultHintMsg" msgid="3252584689512077257">"Stizzar ils parameters da standard en Parameters da la pagina da partenza &gt; Applicaziuns &gt; Administrar las applicaziuns."</string>
-    <string name="chooseActivity" msgid="1009246475582238425">"Tscherner ina acziun"</string>
+    <!-- no translation found for clearDefaultHintMsg (3252584689512077257) -->
+    <skip />
+    <!-- no translation found for chooseActivity (7486876147751803333) -->
+    <skip />
     <!-- no translation found for chooseUsbActivity (6894748416073583509) -->
     <skip />
-    <!-- outdated translation 1691104391758345586 -->     <string name="noApplications" msgid="2991814273936504689">"Nagina applicaziun po exequir questa acziun."</string>
+    <!-- no translation found for noApplications (2991814273936504689) -->
+    <skip />
     <string name="aerr_title" msgid="1905800560317137752"></string>
     <!-- no translation found for aerr_application (932628488013092776) -->
     <skip />
@@ -1048,9 +1325,12 @@
     <skip />
     <!-- no translation found for anr_process (6513209874880517125) -->
     <skip />
-    <!-- outdated translation 3653416315450806396 -->     <string name="force_close" msgid="8346072094521265605">"Sfurzar da serrar"</string>
+    <!-- no translation found for force_close (8346072094521265605) -->
+    <skip />
     <string name="report" msgid="4060218260984795706">"Rapport"</string>
     <string name="wait" msgid="7147118217226317732">"Spetgar"</string>
+    <!-- no translation found for webpage_unresponsive (3272758351138122503) -->
+    <skip />
     <!-- no translation found for launch_warning_title (1547997780506713581) -->
     <skip />
     <!-- no translation found for launch_warning_replace (6202498949970281412) -->
@@ -1075,18 +1355,25 @@
     <!-- no translation found for android_upgrading_complete (1405954754112999229) -->
     <skip />
     <string name="heavy_weight_notification" msgid="9087063985776626166">"<xliff:g id="APP">%1$s</xliff:g> vegn exequida"</string>
-    <!-- outdated translation 2423977499339403402 -->     <string name="heavy_weight_notification_detail" msgid="1721681741617898865">"Tscherner per midar a l\'applicaziun"</string>
-    <!-- outdated translation 1135403633766694316 -->     <string name="heavy_weight_switcher_title" msgid="7153167085403298169">"Midar dad ina applicaziun a l\'autra?"</string>
-    <!-- outdated translation 4592075610079319667 -->     <string name="heavy_weight_switcher_text" msgid="7022631924534406403">"Ina autra applicaziun vegn gia exequida e sto vegnir serrada avant ch\'ina nova po vegnir aviada."</string>
+    <!-- no translation found for heavy_weight_notification_detail (1721681741617898865) -->
+    <skip />
+    <!-- no translation found for heavy_weight_switcher_title (7153167085403298169) -->
+    <skip />
+    <!-- no translation found for heavy_weight_switcher_text (7022631924534406403) -->
+    <skip />
     <string name="old_app_action" msgid="493129172238566282">"Turnar a <xliff:g id="OLD_APP">%1$s</xliff:g>"</string>
-    <!-- outdated translation 942967900237208466 -->     <string name="old_app_description" msgid="2082094275580358049">"Betg aviai la nova applicaziun."</string>
+    <!-- no translation found for old_app_description (2082094275580358049) -->
+    <skip />
     <string name="new_app_action" msgid="5472756926945440706">"Aviar <xliff:g id="OLD_APP">%1$s</xliff:g>"</string>
-    <!-- outdated translation 6830398339826789493 -->     <string name="new_app_description" msgid="1932143598371537340">"Fermai l\'applicaziun veglia senza memorisar."</string>
-    <string name="sendText" msgid="5132506121645618310">"Tscherner ina acziun per il text"</string>
+    <!-- no translation found for new_app_description (1932143598371537340) -->
+    <skip />
+    <!-- no translation found for sendText (5209874571959469142) -->
+    <skip />
     <string name="volume_ringtone" msgid="6885421406845734650">"Volumen dal tun da scalin"</string>
     <string name="volume_music" msgid="5421651157138628171">"Volumen da medias"</string>
     <string name="volume_music_hint_playing_through_bluetooth" msgid="9165984379394601533">"Reproducir tras bluetooth"</string>
-    <string name="volume_music_hint_silent_ringtone_selected" msgid="6158339745293431194">"Tschernì il modus silenzius per il tun da scalin"</string>
+    <!-- no translation found for volume_music_hint_silent_ringtone_selected (8310739960973156272) -->
+    <skip />
     <string name="volume_call" msgid="3941680041282788711">"Volumen dals cloms entrants"</string>
     <string name="volume_bluetooth_call" msgid="2002891926351151534">"Volumen da cloms entrants da bluetooth"</string>
     <string name="volume_alarm" msgid="1985191616042689100">"Volumen dal svegliarin"</string>
@@ -1115,34 +1402,46 @@
     <item quantity="one" msgid="1634101450343277345">"Rait WLAN averta disponibla"</item>
     <item quantity="other" msgid="7915895323644292768">"Raits WLAN avertas disponiblas"</item>
   </plurals>
-    <!-- no translation found for wifi_available_sign_in (9157196203958866662) -->
+    <!-- no translation found for wifi_available_sign_in (4029489716605255386) -->
     <skip />
     <!-- no translation found for wifi_available_sign_in_detailed (6797764740339907572) -->
     <skip />
     <!-- no translation found for wifi_watchdog_network_disabled (7904214231651546347) -->
     <skip />
-    <!-- no translation found for wifi_watchdog_network_disabled_detailed (4917472096696322767) -->
+    <!-- no translation found for wifi_watchdog_network_disabled_detailed (5548780776418332675) -->
     <skip />
     <!-- no translation found for wifi_p2p_dialog_title (97611782659324517) -->
     <skip />
-    <!-- no translation found for wifi_p2p_turnon_message (2804722042556269129) -->
+    <!-- no translation found for wifi_p2p_turnon_message (2909250942299627244) -->
     <skip />
-    <!-- no translation found for wifi_p2p_failed_message (1820097493844848281) -->
+    <!-- no translation found for wifi_p2p_failed_message (3763669677935623084) -->
     <skip />
-    <!-- no translation found for wifi_p2p_pbc_go_negotiation_request_message (3170321684621420428) -->
+    <!-- no translation found for accept (1645267259272829559) -->
     <skip />
-    <!-- no translation found for wifi_p2p_pin_go_negotiation_request_message (5177412094633377308) -->
+    <!-- no translation found for decline (2112225451706137894) -->
     <skip />
-    <!-- no translation found for wifi_p2p_pin_display_message (2834049169114922902) -->
+    <!-- no translation found for wifi_p2p_invitation_sent_title (1318975185112070734) -->
+    <skip />
+    <!-- no translation found for wifi_p2p_invitation_to_connect_title (4958803948658533637) -->
+    <skip />
+    <!-- no translation found for wifi_p2p_from_message (570389174731951769) -->
+    <skip />
+    <!-- no translation found for wifi_p2p_to_message (248968974522044099) -->
+    <skip />
+    <!-- no translation found for wifi_p2p_enter_pin_message (5920929550367828970) -->
+    <skip />
+    <!-- no translation found for wifi_p2p_show_pin_message (8530563323880921094) -->
     <skip />
     <!-- no translation found for wifi_p2p_enabled_notification_title (2068321881673734886) -->
     <skip />
     <!-- no translation found for wifi_p2p_enabled_notification_message (1638949953993894335) -->
     <skip />
     <string name="select_character" msgid="3365550120617701745">"Inserir in caracter"</string>
-    <!-- outdated translation 7630529934366549163 -->     <string name="sms_control_default_app_name" msgid="3058577482636640465">"Applicaziun nunenconuschenta"</string>
+    <!-- no translation found for sms_control_default_app_name (3058577482636640465) -->
+    <skip />
     <string name="sms_control_title" msgid="7296612781128917719">"Trametter messadis SMS"</string>
-    <!-- outdated translation 1289331457999236205 -->     <string name="sms_control_message" msgid="4073755190243093924">"Vulais Vus trametter in grond dumber da messadis SMS? Tschernì OK per cuntinuar u Interrumper per annullar la spediziun."</string>
+    <!-- no translation found for sms_control_message (4073755190243093924) -->
+    <skip />
     <string name="sms_control_yes" msgid="2532062172402615953">"OK"</string>
     <string name="sms_control_no" msgid="1715320703137199869">"Interrumper"</string>
     <!-- no translation found for sim_removed_title (6227712319223226185) -->
@@ -1153,7 +1452,7 @@
     <skip />
     <!-- no translation found for sim_added_title (3719670512889674693) -->
     <skip />
-    <!-- no translation found for sim_added_message (1209265974048554242) -->
+    <!-- no translation found for sim_added_message (6599945301141050216) -->
     <skip />
     <!-- no translation found for sim_restart_button (4722407842815232347) -->
     <skip />
@@ -1166,25 +1465,37 @@
     <string name="no_permissions" msgid="7283357728219338112">"Naginas permissiuns obligatoricas"</string>
     <string name="perms_hide" msgid="7283915391320676226"><b>"Zuppentar"</b></string>
     <string name="perms_show_all" msgid="2671791163933091180"><b>"Mussar tut"</b></string>
-    <string name="usb_storage_activity_title" msgid="2399289999608900443">"Memoria da massa USB"</string>
+    <!-- no translation found for usb_storage_activity_title (4465055157209648641) -->
+    <skip />
     <string name="usb_storage_title" msgid="5901459041398751495">"Connectà cun agid d\'in cabel USB"</string>
-    <!-- outdated translation 4796759646167247178 -->     <string name="usb_storage_message" product="nosdcard" msgid="6631094834151575841">"\"Vus avais connectà Voss telefonin cun Voss computer cun agid dad in cabel USB. Tscherni il buttun sutvart per copiar datotecas da Voss computer sin la carta SD da Voss Android, u viceversa.\""</string>
-    <!-- outdated translation 4796759646167247178 -->     <string name="usb_storage_message" product="default" msgid="4510858346516069238">"\"Vus avais connectà Voss telefonin cun Voss computer cun agid dad in cabel USB. Tscherni il buttun sutvart per copiar datotecas da Voss computer sin la carta SD da Voss Android, u viceversa.\""</string>
+    <!-- no translation found for usb_storage_message (3308538094316477839) -->
+    <skip />
+    <!-- no translation found for usb_storage_message (805351000446037811) -->
+    <skip />
     <string name="usb_storage_button_mount" msgid="1052259930369508235">"Activar la memoria USB"</string>
-    <!-- outdated translation 2534784751603345363 -->     <string name="usb_storage_error_message" product="nosdcard" msgid="3276413764430468454">"Cun l\'utilisaziun da Vossa carta SD sco memoria USB è cumparì in problem."</string>
-    <!-- outdated translation 2534784751603345363 -->     <string name="usb_storage_error_message" product="default" msgid="120810397713773275">"Cun l\'utilisaziun da Vossa carta SD sco memoria USB è cumparì in problem."</string>
+    <!-- no translation found for usb_storage_error_message (3017045217365540658) -->
+    <skip />
+    <!-- no translation found for usb_storage_error_message (2876018512716970313) -->
+    <skip />
     <string name="usb_storage_notification_title" msgid="8175892554757216525">"Connectà cun in cabel USB"</string>
-    <string name="usb_storage_notification_message" msgid="7380082404288219341">"Tscherni las datotecas che duain vegnir copiadas da/sin Voss computer."</string>
+    <!-- no translation found for usb_storage_notification_message (939822783828183763) -->
+    <skip />
     <string name="usb_storage_stop_notification_title" msgid="2336058396663516017">"Deactivar la memoria USB"</string>
-    <string name="usb_storage_stop_notification_message" msgid="2591813490269841539">"Tscherner per deactivar la memoria USB."</string>
+    <!-- no translation found for usb_storage_stop_notification_message (1656852098555623822) -->
+    <skip />
     <string name="usb_storage_stop_title" msgid="660129851708775853">"La memoria USB vegn gest utilisada"</string>
-    <!-- outdated translation 3613713396426604104 -->     <string name="usb_storage_stop_message" product="nosdcard" msgid="1368842269463745067">"Verifitgai avant che deactivar la memoria USB che Vus avais demontà la carta SD Android da Voss computer."</string>
-    <string name="usb_storage_stop_message" product="default" msgid="3613713396426604104">"Verifitgai avant che deactivar la memoria USB che Vus avais demontà la carta SD Android da Voss computer."</string>
+    <!-- no translation found for usb_storage_stop_message (4264025280777219521) -->
+    <skip />
+    <!-- no translation found for usb_storage_stop_message (8043969782460613114) -->
+    <skip />
     <string name="usb_storage_stop_button_mount" msgid="7060218034900696029">"Deactivar l\'apparat periferic da memoria USB"</string>
-    <string name="usb_storage_stop_error_message" msgid="143881914840412108">"Cun deactivar la memoria USB è in problem cumparì. Verifitgai che Vus avais demontà il host USB ed empruvai anc ina giada."</string>
+    <!-- no translation found for usb_storage_stop_error_message (1970374898263063836) -->
+    <skip />
     <string name="dlg_confirm_kill_storage_users_title" msgid="963039033470478697">"Activar la memoria USB"</string>
-    <!-- outdated translation 3202838234780505886 -->     <string name="dlg_confirm_kill_storage_users_text" msgid="6206212680430268343">"Sche Vus activais l\'apparat periferic da memoria USB sa ferman tschertas applicaziuns che Vus utilisais. Ellas n\'èn probablamain betg disponiblas enfin che l\'apparat periferic vegn puspè deactivà."</string>
-    <!-- outdated translation 8048999973837339174 -->     <string name="dlg_error_title" msgid="7323658469626514207">"Operaziun USB betg reussida"</string>
+    <!-- no translation found for dlg_confirm_kill_storage_users_text (5100428757107469454) -->
+    <skip />
+    <!-- no translation found for dlg_error_title (7323658469626514207) -->
+    <skip />
     <string name="dlg_ok" msgid="7376953167039865701">"OK"</string>
     <!-- no translation found for usb_mtp_notification_title (3699913097391550394) -->
     <skip />
@@ -1194,51 +1505,76 @@
     <skip />
     <!-- no translation found for usb_accessory_notification_title (7848236974087653666) -->
     <skip />
-    <!-- no translation found for usb_notification_message (4447869605109736382) -->
+    <!-- no translation found for usb_notification_message (2290859399983720271) -->
     <skip />
-    <!-- outdated translation 8663247929551095854 -->     <string name="extmedia_format_title" product="nosdcard" msgid="9020092196061007262">"Formatar la carta SD"</string>
-    <!-- outdated translation 8663247929551095854 -->     <string name="extmedia_format_title" product="default" msgid="3648415921526526069">"Formatar la carta SD"</string>
-    <!-- outdated translation 3621369962433523619 -->     <string name="extmedia_format_message" product="nosdcard" msgid="3934016853425761078">"Vulais Vus propi formatar la carta SD? En quest cas van tut las datas sin Vossa carta a perder."</string>
-    <!-- outdated translation 3621369962433523619 -->     <string name="extmedia_format_message" product="default" msgid="14131895027543830">"Vulais Vus propi formatar la carta SD? En quest cas van tut las datas sin Vossa carta a perder."</string>
+    <!-- no translation found for extmedia_format_title (9020092196061007262) -->
+    <skip />
+    <!-- no translation found for extmedia_format_title (3648415921526526069) -->
+    <skip />
+    <!-- no translation found for extmedia_format_message (3934016853425761078) -->
+    <skip />
+    <!-- no translation found for extmedia_format_message (14131895027543830) -->
+    <skip />
     <string name="extmedia_format_button_format" msgid="4131064560127478695">"Format"</string>
     <string name="adb_active_notification_title" msgid="6729044778949189918">"Debugging USB connectà"</string>
-    <!-- outdated translation 8470296818270110396 -->     <string name="adb_active_notification_message" msgid="1016654627626476142">"Tscherner per deactivar il debugging USB."</string>
-    <!-- outdated translation 6865512749462072765 -->     <string name="select_input_method" msgid="4653387336791222978">"Tscherner ina metoda d\'endataziun"</string>
+    <!-- no translation found for adb_active_notification_message (1016654627626476142) -->
+    <skip />
+    <!-- no translation found for select_input_method (4653387336791222978) -->
+    <skip />
     <!-- no translation found for configure_input_methods (9091652157722495116) -->
     <skip />
     <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>"candidats"</u></string>
-    <!-- outdated translation 5457603418970994050 -->     <string name="ext_media_checking_notification_title" product="nosdcard" msgid="3449816005351468560">"Preparaziun da la carta SD"</string>
+    <!-- no translation found for ext_media_checking_notification_title (3449816005351468560) -->
+    <skip />
     <string name="ext_media_checking_notification_title" product="default" msgid="5457603418970994050">"Preparaziun da la carta SD"</string>
     <string name="ext_media_checking_notification_message" msgid="8287319882926737053">"Tschertgar errurs"</string>
-    <!-- outdated translation 780477838241212997 -->     <string name="ext_media_nofs_notification_title" product="nosdcard" msgid="7788040745686229307">"Carta SD vida"</string>
+    <!-- no translation found for ext_media_nofs_notification_title (7788040745686229307) -->
+    <skip />
     <string name="ext_media_nofs_notification_title" product="default" msgid="780477838241212997">"Carta SD vida"</string>
-    <!-- outdated translation 1312266820092958014 -->     <string name="ext_media_nofs_notification_message" product="nosdcard" msgid="8623130522556087311">"La carta SD è vida u ch\'ella utilisescha in sistem da datotecas che na vegn betg sustegnì."</string>
-    <string name="ext_media_nofs_notification_message" product="default" msgid="3817704088027829380">"La carta SD è vida ubain che ses sistem da datotecas na vegn betg sustegnì."</string>
-    <!-- outdated translation 6410723906019100189 -->     <string name="ext_media_unmountable_notification_title" product="nosdcard" msgid="2090046769532713563">"Carta SD donnegiada"</string>
+    <!-- no translation found for ext_media_nofs_notification_message (7840121067427269500) -->
+    <skip />
+    <!-- no translation found for ext_media_nofs_notification_message (8641065641786923604) -->
+    <skip />
+    <!-- no translation found for ext_media_unmountable_notification_title (2090046769532713563) -->
+    <skip />
     <string name="ext_media_unmountable_notification_title" product="default" msgid="6410723906019100189">"Carta SD donnegiada"</string>
-    <!-- outdated translation 2679412884290061775 -->     <string name="ext_media_unmountable_notification_message" product="nosdcard" msgid="529021299294450667">"La carta SD è donnegiada. Vus stuais eventualmain reformatar Vossa carta."</string>
-    <string name="ext_media_unmountable_notification_message" product="default" msgid="6902531775948238989">"La carta SD è donnegiada. Vus stuais eventualmain reformatar la carta."</string>
-    <!-- outdated translation 6872152882604407837 -->     <string name="ext_media_badremoval_notification_title" product="nosdcard" msgid="1661683031330951073">"Allontanà la carta SD nunspetgadamain"</string>
+    <!-- no translation found for ext_media_unmountable_notification_message (1795917578395333280) -->
+    <skip />
+    <!-- no translation found for ext_media_unmountable_notification_message (1753898567525568253) -->
+    <skip />
+    <!-- no translation found for ext_media_badremoval_notification_title (1661683031330951073) -->
+    <skip />
     <string name="ext_media_badremoval_notification_title" product="default" msgid="6872152882604407837">"Allontanà la carta SD nunspetgadamain"</string>
-    <!-- outdated translation 7260183293747448241 -->     <string name="ext_media_badremoval_notification_message" product="nosdcard" msgid="4329848819865594241">"Demontar la carta SD avant che retrair ella per evitar ina sperdita da datas."</string>
+    <!-- no translation found for ext_media_badremoval_notification_message (4329848819865594241) -->
+    <skip />
     <string name="ext_media_badremoval_notification_message" product="default" msgid="7260183293747448241">"Demontar la carta SD avant che retrair ella per evitar ina sperdita da datas."</string>
-    <!-- outdated translation 6729801130790616200 -->     <string name="ext_media_safe_unmount_notification_title" product="nosdcard" msgid="3967973893270360230">"La carta SD po vegnir allontanada a moda segira"</string>
+    <!-- no translation found for ext_media_safe_unmount_notification_title (3967973893270360230) -->
+    <skip />
     <string name="ext_media_safe_unmount_notification_title" product="default" msgid="6729801130790616200">"La carta SD po vegnir allontanada a moda segira"</string>
-    <!-- outdated translation 7613960686747592770 -->     <string name="ext_media_safe_unmount_notification_message" product="nosdcard" msgid="6142195361606493530">"La carta SD po ussa vegnir allontanada."</string>
+    <!-- no translation found for ext_media_safe_unmount_notification_message (6142195361606493530) -->
+    <skip />
     <string name="ext_media_safe_unmount_notification_message" product="default" msgid="568841278138377604">"La carta SD po vegnir retratga a moda segira."</string>
-    <!-- outdated translation 8902518030404381318 -->     <string name="ext_media_nomedia_notification_title" product="nosdcard" msgid="4486377230140227651">"Allontanà la carta SD"</string>
+    <!-- no translation found for ext_media_nomedia_notification_title (4486377230140227651) -->
+    <skip />
     <string name="ext_media_nomedia_notification_title" product="default" msgid="8902518030404381318">"Allontanà la carta SD"</string>
-    <!-- outdated translation 4205117227342822275 -->     <string name="ext_media_nomedia_notification_message" product="nosdcard" msgid="6921126162580574143">"La carta SD è vegnida allontanada. Inseri ina carta SD nova per engrondir la capacitad da memorisar da Voss apparat."</string>
+    <!-- no translation found for ext_media_nomedia_notification_message (6921126162580574143) -->
+    <skip />
     <string name="ext_media_nomedia_notification_message" product="default" msgid="3870120652983659641">"Allontanà la carta SD. Inseri ina nova."</string>
-    <string name="activity_list_empty" msgid="4168820609403385789">"Betg chattà activitads correspundentas"</string>
+    <!-- no translation found for activity_list_empty (1675388330786841066) -->
+    <skip />
     <string name="permlab_pkgUsageStats" msgid="8787352074326748892">"actualisar las datas statisticas da la cumponenta"</string>
-    <!-- outdated translation 891553695716752835 -->     <string name="permdesc_pkgUsageStats" msgid="1106612424254277630">"Permetta da modifitgar las datas statisticas rimnadas da la cumponenta. Betg previs per applicaziuns normalas."</string>
-    <!-- outdated translation 1660908117394854464 -->     <string name="permlab_copyProtectedData" msgid="4341036311211406692">"Permetta da clamar il servetsch da container predefinì per copiar il cuntegn. Betg previs per applicaziuns normalas."</string>
-    <!-- outdated translation 537780957633976401 -->     <string name="permdesc_copyProtectedData" msgid="4390697124288317831">"Permetta da clamar il servetsch da container predefinì per copiar il cuntegn. Betg previs per applicaziuns normalas."</string>
-    <!-- outdated translation 1311810005957319690 -->     <string name="tutorial_double_tap_to_zoom_message_short" msgid="4070433208160063538">"Tutgar duas giadas per reglar il zoom"</string>
-    <string name="gadget_host_error_inflating" msgid="2613287218853846830">"Errur cun engrondir il widget"</string>
+    <!-- no translation found for permdesc_pkgUsageStats (1106612424254277630) -->
+    <skip />
+    <!-- no translation found for permlab_copyProtectedData (4341036311211406692) -->
+    <skip />
+    <!-- no translation found for permdesc_copyProtectedData (4390697124288317831) -->
+    <skip />
+    <!-- no translation found for tutorial_double_tap_to_zoom_message_short (4070433208160063538) -->
+    <skip />
+    <!-- no translation found for gadget_host_error_inflating (4882004314906466162) -->
+    <skip />
     <string name="ime_action_go" msgid="8320845651737369027">"Dai"</string>
     <string name="ime_action_search" msgid="658110271822807811">"Tschertgar"</string>
     <string name="ime_action_send" msgid="2316166556349314424">"Trametter"</string>
@@ -1249,41 +1585,49 @@
     <string name="ime_action_default" msgid="2840921885558045721">"Exequir"</string>
     <string name="dial_number_using" msgid="5789176425167573586">"Cumponer il numer"\n"cun utilisar <xliff:g id="NUMBER">%s</xliff:g>"</string>
     <string name="create_contact_using" msgid="4947405226788104538">"Agiuntar in contact"\n"cun il numer <xliff:g id="NUMBER">%s</xliff:g>"</string>
-    <!-- outdated translation 6824538733852821001 -->     <string name="grant_credentials_permission_message_header" msgid="2106103817937859662">"Las suandantas applicaziuns dumondan l\'autorisaziun dad acceder a partir dad ussa a Voss conto."</string>
+    <!-- no translation found for grant_credentials_permission_message_header (2106103817937859662) -->
+    <skip />
     <string name="grant_credentials_permission_message_footer" msgid="3125211343379376561">"Vulais Vus autorisar questa dumonda?"</string>
-    <string name="grant_permissions_header_text" msgid="2722567482180797717">"Dumonda d\'access"</string>
+    <!-- no translation found for grant_permissions_header_text (6874497408201826708) -->
+    <skip />
     <string name="allow" msgid="7225948811296386551">"Permetter"</string>
     <string name="deny" msgid="2081879885755434506">"Refusar"</string>
-    <string name="permission_request_notification_title" msgid="5390555465778213840">"Autorisaziun dumandada"</string>
-    <string name="permission_request_notification_with_subtitle" msgid="4325409589686688000">"Autorisaziun dumandada"\n"per il conto <xliff:g id="ACCOUNT">%s</xliff:g>"</string>
+    <!-- no translation found for permission_request_notification_title (6486759795926237907) -->
+    <skip />
+    <!-- no translation found for permission_request_notification_with_subtitle (8530393139639560189) -->
+    <skip />
     <string name="input_method_binding_label" msgid="1283557179944992649">"Metoda d\'endataziun"</string>
     <string name="sync_binding_label" msgid="3687969138375092423">"Sincronisar"</string>
     <string name="accessibility_binding_label" msgid="4148120742096474641">"Agids d\'access"</string>
     <string name="wallpaper_binding_label" msgid="1240087844304687662">"Fund davos"</string>
     <string name="chooser_wallpaper" msgid="7873476199295190279">"Midar il fund davos"</string>
-    <!-- no translation found for vpn_title (8219003246858087489) -->
+    <!-- no translation found for vpn_title (19615213552042827) -->
     <skip />
     <!-- no translation found for vpn_title_long (6400714798049252294) -->
     <skip />
-    <!-- no translation found for vpn_text (1610714069627824309) -->
+    <!-- no translation found for vpn_text (3011306607126450322) -->
     <skip />
-    <!-- no translation found for vpn_text_long (4907843483284977618) -->
+    <!-- no translation found for vpn_text_long (6407351006249174473) -->
     <skip />
     <string name="upload_file" msgid="2897957172366730416">"Tscherner ina datoteca"</string>
     <string name="no_file_chosen" msgid="6363648562170759465">"Nagina datoteca tschernida"</string>
     <string name="reset" msgid="2448168080964209908">"Reinizialisar"</string>
     <string name="submit" msgid="1602335572089911941">"Trametter"</string>
     <string name="car_mode_disable_notification_title" msgid="3164768212003864316">"Modus dad auto activà"</string>
-    <string name="car_mode_disable_notification_message" msgid="668663626721675614">"Tscherner per serrar il modus dad auto."</string>
+    <!-- no translation found for car_mode_disable_notification_message (8035230537563503262) -->
+    <skip />
     <string name="tethered_notification_title" msgid="3146694234398202601">"Tethering u hotspot activ"</string>
-    <string name="tethered_notification_message" msgid="3067108323903048927">"Tutgar per configurar"</string>
+    <!-- no translation found for tethered_notification_message (6857031760103062982) -->
+    <skip />
     <string name="back_button_label" msgid="2300470004503343439">"Enavos"</string>
     <string name="next_button_label" msgid="1080555104677992408">"Vinavant"</string>
     <string name="skip_button_label" msgid="1275362299471631819">"Sursiglir"</string>
     <string name="throttle_warning_notification_title" msgid="4890894267454867276">"Grond diever da datas mobilas"</string>
-    <string name="throttle_warning_notification_message" msgid="2609734763845705708">"Tutgar per vegnir a savair dapli davart l\'utilisaziun da datas mobilas"</string>
+    <!-- no translation found for throttle_warning_notification_message (3340822228599337743) -->
+    <skip />
     <string name="throttled_notification_title" msgid="6269541897729781332">"Surpassà la limita da datas mobilas"</string>
-    <string name="throttled_notification_message" msgid="4712369856601275146">"Tutgar per vegnir a savair dapli davart l\'utilisaziun da datas mobilas"</string>
+    <!-- no translation found for throttled_notification_message (5443457321354907181) -->
+    <skip />
     <!-- no translation found for no_matches (8129421908915840737) -->
     <skip />
     <!-- no translation found for find_on_page (1946799233822820384) -->
@@ -1292,13 +1636,13 @@
     <!-- no translation found for matches_found:other (4641872797067609177) -->
     <!-- no translation found for action_mode_done (7217581640461922289) -->
     <skip />
-    <!-- no translation found for progress_unmounting (535863554318797377) -->
+    <!-- no translation found for progress_unmounting (3923810448507612746) -->
     <skip />
-    <!-- no translation found for progress_unmounting (5556813978958789471) -->
+    <!-- no translation found for progress_unmounting (1327894998409537190) -->
     <skip />
-    <!-- no translation found for progress_erasing (4183664626203056915) -->
+    <!-- no translation found for progress_erasing (4521573321524340058) -->
     <skip />
-    <!-- no translation found for progress_erasing (2115214724367534095) -->
+    <!-- no translation found for progress_erasing (6596988875507043042) -->
     <skip />
     <!-- no translation found for format_error (6299769563624776948) -->
     <skip />
@@ -1336,19 +1680,19 @@
     <skip />
     <!-- no translation found for sync_too_many_deletes (5296321850662746890) -->
     <skip />
-    <!-- no translation found for sync_too_many_deletes_desc (7030265992955132593) -->
+    <!-- no translation found for sync_too_many_deletes_desc (496551671008694245) -->
     <skip />
-    <!-- no translation found for sync_really_delete (8933566316059338692) -->
+    <!-- no translation found for sync_really_delete (2572600103122596243) -->
     <skip />
-    <!-- no translation found for sync_undo_deletes (8610996708225006328) -->
+    <!-- no translation found for sync_undo_deletes (2941317360600338602) -->
     <skip />
-    <!-- no translation found for sync_do_nothing (8717589462945226869) -->
+    <!-- no translation found for sync_do_nothing (3743764740430821845) -->
     <skip />
     <!-- no translation found for choose_account_label (5655203089746423927) -->
     <skip />
     <!-- no translation found for add_account_label (2935267344849993553) -->
     <skip />
-    <!-- no translation found for choose_account_text (6891230675141555481) -->
+    <!-- no translation found for choose_account_text (6303348737197849675) -->
     <skip />
     <!-- no translation found for add_account_button_label (3611982894853435874) -->
     <skip />
@@ -1356,7 +1700,7 @@
     <skip />
     <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
     <skip />
-    <!-- no translation found for number_picker_increment_scroll_mode (1343063395404990189) -->
+    <!-- no translation found for number_picker_increment_scroll_mode (3073101067441638428) -->
     <skip />
     <!-- no translation found for number_picker_increment_scroll_action (4628981789985093179) -->
     <skip />
@@ -1440,7 +1784,7 @@
     <skip />
     <!-- no translation found for description_target_unlock_tablet (3833195335629795055) -->
     <skip />
-    <!-- no translation found for keyboard_headset_required_to_hear_password (5913502399391940888) -->
+    <!-- no translation found for keyboard_headset_required_to_hear_password (7011927352267668657) -->
     <skip />
     <!-- no translation found for keyboard_password_character_no_headset (2859873770886153678) -->
     <skip />
@@ -1450,17 +1794,17 @@
     <skip />
     <!-- no translation found for action_menu_overflow_description (2295659037509008453) -->
     <skip />
-    <!-- no translation found for storage_internal (7556050805474115618) -->
+    <!-- no translation found for storage_internal (4891916833657929263) -->
     <skip />
-    <!-- no translation found for storage_sd_card (8921771478629812343) -->
+    <!-- no translation found for storage_sd_card (3282948861378286745) -->
     <skip />
     <!-- no translation found for storage_usb (3017954059538517278) -->
     <skip />
-    <!-- no translation found for extract_edit_menu_button (302060189057163906) -->
+    <!-- no translation found for extract_edit_menu_button (8940478730496610137) -->
     <skip />
     <!-- no translation found for data_usage_warning_title (1955638862122232342) -->
     <skip />
-    <!-- no translation found for data_usage_warning_body (7217480745540055170) -->
+    <!-- no translation found for data_usage_warning_body (2814673551471969954) -->
     <skip />
     <!-- no translation found for data_usage_3g_limit_title (7093334419518706686) -->
     <skip />
@@ -1470,7 +1814,7 @@
     <skip />
     <!-- no translation found for data_usage_wifi_limit_title (8992154736441284865) -->
     <skip />
-    <!-- no translation found for data_usage_limit_body (4313857592916426843) -->
+    <!-- no translation found for data_usage_limit_body (3317964706973601386) -->
     <skip />
     <!-- no translation found for data_usage_3g_limit_snoozed_title (7026739121138005231) -->
     <skip />
@@ -1480,11 +1824,11 @@
     <skip />
     <!-- no translation found for data_usage_wifi_limit_snoozed_title (8743856006384825974) -->
     <skip />
-    <!-- no translation found for data_usage_limit_snoozed_body (2932736326652880660) -->
+    <!-- no translation found for data_usage_limit_snoozed_body (7035490278298441767) -->
     <skip />
     <!-- no translation found for data_usage_restricted_title (5965157361036321914) -->
     <skip />
-    <!-- no translation found for data_usage_restricted_body (5087354814839059798) -->
+    <!-- no translation found for data_usage_restricted_body (6741521330997452990) -->
     <skip />
     <!-- no translation found for ssl_certificate (6510040486049237639) -->
     <skip />
@@ -1524,4 +1868,10 @@
     <skip />
     <!-- no translation found for list_delimeter (3975117572185494152) -->
     <skip />
+    <!-- no translation found for sending (3245653681008218030) -->
+    <skip />
+    <!-- no translation found for launchBrowserDefault (2057951947297614725) -->
+    <skip />
+    <!-- no translation found for SetupCallDefault (5834948469253758575) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-ro/strings.xml b/core/res/res/values-ro/strings.xml
index bc7f619..ecee96d 100644
--- a/core/res/res/values-ro/strings.xml
+++ b/core/res/res/values-ro/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"OK"</string>
     <string name="report" msgid="4060218260984795706">"Raportaţi"</string>
     <string name="wait" msgid="7147118217226317732">"Aşteptaţi"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"Pagina a devenit inactivă."\n\n"Doriţi să o închideţi?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Aplicaţie redirecţionată"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> funcţionează acum."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"<xliff:g id="APP_NAME">%1$s</xliff:g> a fost lansată iniţial."</string>
diff --git a/core/res/res/values-ru/strings.xml b/core/res/res/values-ru/strings.xml
index 1d71fd6..7b95291 100644
--- a/core/res/res/values-ru/strings.xml
+++ b/core/res/res/values-ru/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"ОК"</string>
     <string name="report" msgid="4060218260984795706">"Отзыв"</string>
     <string name="wait" msgid="7147118217226317732">"Подождать"</string>
+    <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>
diff --git a/core/res/res/values-sk/strings.xml b/core/res/res/values-sk/strings.xml
index cb2e764..aafaa9e 100644
--- a/core/res/res/values-sk/strings.xml
+++ b/core/res/res/values-sk/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"OK"</string>
     <string name="report" msgid="4060218260984795706">"Prehľad"</string>
     <string name="wait" msgid="7147118217226317732">"Čakajte"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"Stránka nereaguje."\n\n"Chcete ju zavrieť?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Presmerovaná aplikácia"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"Je spustená aplikácia <xliff:g id="APP_NAME">%1$s</xliff:g>."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"Pôvodne bola spustená aplikácia <xliff:g id="APP_NAME">%1$s</xliff:g>."</string>
diff --git a/core/res/res/values-sl/strings.xml b/core/res/res/values-sl/strings.xml
index 5e7c136..aa98c80 100644
--- a/core/res/res/values-sl/strings.xml
+++ b/core/res/res/values-sl/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"V redu"</string>
     <string name="report" msgid="4060218260984795706">"Poročaj"</string>
     <string name="wait" msgid="7147118217226317732">"Čakaj"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"Stran se ne odziva."\n" "\n"Ali jo želite zapreti?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Program preusmerjen"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> se izvaja."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"Prvotno je bil zagnan program <xliff:g id="APP_NAME">%1$s</xliff:g>."</string>
diff --git a/core/res/res/values-sr/strings.xml b/core/res/res/values-sr/strings.xml
index bea78ce..7ba8503 100644
--- a/core/res/res/values-sr/strings.xml
+++ b/core/res/res/values-sr/strings.xml
@@ -50,7 +50,7 @@
     <string name="invalidPuk" msgid="8761456210898036513">"Унесите PUK који се састоји од 8 цифара или више."</string>
     <string name="needPuk" msgid="919668385956251611">"SIM картица је закључана PUK кодом. Унесите PUK кôд да бисте је откључали."</string>
     <string name="needPuk2" msgid="4526033371987193070">"Унесите PUK2 да бисте деблокирали SIM картицу."</string>
-    <string name="ClipMmi" msgid="6952821216480289285">"Долазећи ИД позиваоца"</string>
+    <string name="ClipMmi" msgid="6952821216480289285">"Долазни ИД позиваоца"</string>
     <string name="ClirMmi" msgid="7784673673446833091">"Одлазни ИД позиваоца"</string>
     <string name="CfMmi" msgid="5123218989141573515">"Преусмеравање позива"</string>
     <string name="CwMmi" msgid="9129678056795016867">"Позив на чекању"</string>
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"Потврди"</string>
     <string name="report" msgid="4060218260984795706">"Пријави"</string>
     <string name="wait" msgid="7147118217226317732">"Сачекај"</string>
+    <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>
diff --git a/core/res/res/values-sv/strings.xml b/core/res/res/values-sv/strings.xml
index bc59298..4d3cea5 100644
--- a/core/res/res/values-sv/strings.xml
+++ b/core/res/res/values-sv/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"OK"</string>
     <string name="report" msgid="4060218260984795706">"Rapportera"</string>
     <string name="wait" msgid="7147118217226317732">"Vänta"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"Sidan har slutat svara."\n\n"Vill du stänga sidan?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Appen omdirigeras"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> körs."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"<xliff:g id="APP_NAME">%1$s</xliff:g> startades först."</string>
diff --git a/core/res/res/values-sw/strings.xml b/core/res/res/values-sw/strings.xml
index 5077d1f..a9a8679 100644
--- a/core/res/res/values-sw/strings.xml
+++ b/core/res/res/values-sw/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"Sawa"</string>
     <string name="report" msgid="4060218260984795706">"Ripoti"</string>
     <string name="wait" msgid="7147118217226317732">"Subiri"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"Ukurasa umekwama. "\n" "\n" Je, unataka kuufunga?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Programu imeelekezwa kwingine"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g>inaendesha sasa."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"<xliff:g id="APP_NAME">%1$s</xliff:g> ilizinduliwa mwanzoni."</string>
diff --git a/core/res/res/values-th/strings.xml b/core/res/res/values-th/strings.xml
index 0babb00..6a8431c 100644
--- a/core/res/res/values-th/strings.xml
+++ b/core/res/res/values-th/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"ตกลง"</string>
     <string name="report" msgid="4060218260984795706">"รายงาน"</string>
     <string name="wait" msgid="7147118217226317732">"รอ"</string>
+    <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>
diff --git a/core/res/res/values-tl/strings.xml b/core/res/res/values-tl/strings.xml
index b31fbf7..04635c8 100644
--- a/core/res/res/values-tl/strings.xml
+++ b/core/res/res/values-tl/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"OK"</string>
     <string name="report" msgid="4060218260984795706">"Ulat"</string>
     <string name="wait" msgid="7147118217226317732">"Maghintay"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"Hindi na tumutugon ang pahina."\n\n"Nais mo ba itong isara?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Na-redirect ang app"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"Tumatakbo na ngayon ang <xliff:g id="APP_NAME">%1$s</xliff:g>."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"Orihinal na nalunsad ang <xliff:g id="APP_NAME">%1$s</xliff:g>."</string>
diff --git a/core/res/res/values-tr/strings.xml b/core/res/res/values-tr/strings.xml
index ebade95..bfe9c0a 100644
--- a/core/res/res/values-tr/strings.xml
+++ b/core/res/res/values-tr/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"Tamam"</string>
     <string name="report" msgid="4060218260984795706">"Bildir"</string>
     <string name="wait" msgid="7147118217226317732">"Bekle"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"Sayfa yanıt vermiyor."\n\n"Kapatmak ister misiniz?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Uygulama yönlendirildi"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> şimdi çalışıyor."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"İlk olarak <xliff:g id="APP_NAME">%1$s</xliff:g> başlatıldı."</string>
diff --git a/core/res/res/values-uk/strings.xml b/core/res/res/values-uk/strings.xml
index bc5456b..6708893 100644
--- a/core/res/res/values-uk/strings.xml
+++ b/core/res/res/values-uk/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"OK"</string>
     <string name="report" msgid="4060218260984795706">"Повідом."</string>
     <string name="wait" msgid="7147118217226317732">"Чекати"</string>
+    <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>
diff --git a/core/res/res/values-vi/strings.xml b/core/res/res/values-vi/strings.xml
index 177c474..6da402c 100644
--- a/core/res/res/values-vi/strings.xml
+++ b/core/res/res/values-vi/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"OK"</string>
     <string name="report" msgid="4060218260984795706">"Báo cáo"</string>
     <string name="wait" msgid="7147118217226317732">"Đợi"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"Trang không phản hồi."\n\n"Bạn có muốn đóng trang không?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Đã chuyển hướng ứng dụng"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> hiện đang chạy."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"<xliff:g id="APP_NAME">%1$s</xliff:g> được khởi chạy trước tiên."</string>
diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml
index b682eac..6c40202 100644
--- a/core/res/res/values-zh-rCN/strings.xml
+++ b/core/res/res/values-zh-rCN/strings.xml
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"确定"</string>
     <string name="report" msgid="4060218260984795706">"报告"</string>
     <string name="wait" msgid="7147118217226317732">"等待"</string>
+    <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>
diff --git a/core/res/res/values-zh-rTW/strings.xml b/core/res/res/values-zh-rTW/strings.xml
index 0928de8..131c2f7 100644
--- a/core/res/res/values-zh-rTW/strings.xml
+++ b/core/res/res/values-zh-rTW/strings.xml
@@ -697,7 +697,7 @@
     <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>
-    <string name="lockscreen_glogin_forgot_pattern" msgid="2588521501166032747">"解除封鎖帳戶"</string>
+    <string name="lockscreen_glogin_forgot_pattern" msgid="2588521501166032747">"帳戶解鎖"</string>
     <string name="lockscreen_glogin_too_many_attempts" msgid="2751368605287288808">"圖形嘗試次數過多"</string>
     <string name="lockscreen_glogin_instructions" msgid="3931816256100707784">"如要解除鎖定,請使用 Google 帳戶登入。"</string>
     <string name="lockscreen_glogin_username_hint" msgid="8846881424106484447">"使用者名稱 (電子郵件)"</string>
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"確定"</string>
     <string name="report" msgid="4060218260984795706">"回報"</string>
     <string name="wait" msgid="7147118217226317732">"等待"</string>
+    <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>
diff --git a/core/res/res/values-zu/strings.xml b/core/res/res/values-zu/strings.xml
index fc01c1d..56af9aa 100644
--- a/core/res/res/values-zu/strings.xml
+++ b/core/res/res/values-zu/strings.xml
@@ -785,7 +785,7 @@
   </plurals>
   <plurals name="num_minutes_ago">
     <item quantity="one" msgid="3306787433088810191">"iminithi elingu-1 edlule"</item>
-    <item quantity="other" msgid="2176942008915455116">"amaminithi angu-<xliff:g id="COUNT">%d</xliff:g> adlule.."</item>
+    <item quantity="other" msgid="2176942008915455116">"<xliff:g id="COUNT">%d</xliff:g> amaminithi adlule.."</item>
   </plurals>
   <plurals name="num_hours_ago">
     <item quantity="one" msgid="9150797944610821849">"ihora elingu-1 elidlule"</item>
@@ -822,7 +822,7 @@
   </plurals>
   <plurals name="abbrev_num_minutes_ago">
     <item quantity="one" msgid="6361490147113871545">"iminithi elingu-1 edlule"</item>
-    <item quantity="other" msgid="851164968597150710">"amaminithi angu-<xliff:g id="COUNT">%d</xliff:g> adlule"</item>
+    <item quantity="other" msgid="851164968597150710">"<xliff:g id="COUNT">%d</xliff:g> amaminithi adlule"</item>
   </plurals>
   <plurals name="abbrev_num_hours_ago">
     <item quantity="one" msgid="4796212039724722116">"ihora elingu-1 elidlule"</item>
@@ -915,6 +915,7 @@
     <string name="force_close" msgid="8346072094521265605">"KULUNGILE"</string>
     <string name="report" msgid="4060218260984795706">"Umbiko"</string>
     <string name="wait" msgid="7147118217226317732">"Linda"</string>
+    <string name="webpage_unresponsive" msgid="3272758351138122503">"Leli khasi alisaphenduli."\n\n"Ingabe ufuna ukulivala na?"</string>
     <string name="launch_warning_title" msgid="1547997780506713581">"Insiza idluliselwe phambili"</string>
     <string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> iyasebenza."</string>
     <string name="launch_warning_original" msgid="188102023021668683">"<xliff:g id="APP_NAME">%1$s</xliff:g> iqalisiwe."</string>
@@ -1110,7 +1111,7 @@
     <string name="no_matches" msgid="8129421908915840737">"Akukho okufanayo"</string>
     <string name="find_on_page" msgid="1946799233822820384">"Thola ekhasini"</string>
   <plurals name="matches_found">
-    <item quantity="one" msgid="8167147081136579439">"okufanayo okungu-1"</item>
+    <item quantity="one" msgid="8167147081136579439">"1 okufanayo"</item>
     <item quantity="other" msgid="4641872797067609177">"<xliff:g id="INDEX">%d</xliff:g> ku-<xliff:g id="TOTAL">%d</xliff:g>"</item>
   </plurals>
     <string name="action_mode_done" msgid="7217581640461922289">"Kwenziwe"</string>
diff --git a/core/res/res/values/arrays.xml b/core/res/res/values/arrays.xml
index f9e1f5b..ce734fc 100644
--- a/core/res/res/values/arrays.xml
+++ b/core/res/res/values/arrays.xml
@@ -22,19 +22,9 @@
     <!-- Do not translate. These are all of the drawable resources that should be preloaded by
          the zygote process before it starts forking application processes. -->
     <array name="preloaded_drawables">
-       <item>@drawable/spinner_black_16</item>
-       <item>@drawable/spinner_black_20</item>
-       <item>@drawable/spinner_black_48</item>
-       <item>@drawable/spinner_black_76</item>
-       <item>@drawable/spinner_white_16</item>
-       <item>@drawable/spinner_white_48</item>
-       <item>@drawable/spinner_white_76</item>
-       <item>@drawable/toast_frame</item>
        <item>@drawable/toast_frame_holo</item>
-       <item>@drawable/btn_check_on_selected</item>
        <item>@drawable/btn_check_on_pressed_holo_light</item>
        <item>@drawable/btn_check_on_pressed_holo_dark</item>
-       <item>@drawable/btn_check_on_pressed</item>
        <item>@drawable/btn_check_on_holo_light</item>
        <item>@drawable/btn_check_on_holo_dark</item>
        <item>@drawable/btn_check_on_focused_holo_light</item>
@@ -43,13 +33,8 @@
        <item>@drawable/btn_check_on_disabled_holo_dark</item>
        <item>@drawable/btn_check_on_disabled_focused_holo_light</item>
        <item>@drawable/btn_check_on_disabled_focused_holo_dark</item>
-       <item>@drawable/btn_check_on_disable_focused</item>
-       <item>@drawable/btn_check_on_disable</item>
-       <item>@drawable/btn_check_on</item>
-       <item>@drawable/btn_check_off_selected</item>
        <item>@drawable/btn_check_off_pressed_holo_light</item>
        <item>@drawable/btn_check_off_pressed_holo_dark</item>
-       <item>@drawable/btn_check_off_pressed</item>
        <item>@drawable/btn_check_off_holo_light</item>
        <item>@drawable/btn_check_off_holo_dark</item>
        <item>@drawable/btn_check_off_focused_holo_light</item>
@@ -58,16 +43,10 @@
        <item>@drawable/btn_check_off_disabled_holo_dark</item>
        <item>@drawable/btn_check_off_disabled_focused_holo_light</item>
        <item>@drawable/btn_check_off_disabled_focused_holo_dark</item>
-       <item>@drawable/btn_check_off_disable_focused</item>
-       <item>@drawable/btn_check_off_disable</item>
-       <item>@drawable/btn_check_label_background</item>
        <item>@drawable/btn_check_holo_light</item>
        <item>@drawable/btn_check_holo_dark</item>
-       <item>@drawable/btn_check</item>
-       <item>@drawable/btn_radio_on_selected</item>
        <item>@drawable/btn_radio_on_pressed_holo_light</item>
        <item>@drawable/btn_radio_on_pressed_holo_dark</item>
-       <item>@drawable/btn_radio_on_pressed</item>
        <item>@drawable/btn_radio_on_holo_light</item>
        <item>@drawable/btn_radio_on_holo_dark</item>
        <item>@drawable/btn_radio_on_focused_holo_light</item>
@@ -76,11 +55,8 @@
        <item>@drawable/btn_radio_on_disabled_holo_dark</item>
        <item>@drawable/btn_radio_on_disabled_focused_holo_light</item>
        <item>@drawable/btn_radio_on_disabled_focused_holo_dark</item>
-       <item>@drawable/btn_radio_on</item>
-       <item>@drawable/btn_radio_off_selected</item>
        <item>@drawable/btn_radio_off_pressed_holo_light</item>
        <item>@drawable/btn_radio_off_pressed_holo_dark</item>
-       <item>@drawable/btn_radio_off_pressed</item>
        <item>@drawable/btn_radio_off_holo_light</item>
        <item>@drawable/btn_radio_off_holo_dark</item>
        <item>@drawable/btn_radio_off_focused_holo_light</item>
@@ -89,23 +65,10 @@
        <item>@drawable/btn_radio_off_disabled_holo_dark</item>
        <item>@drawable/btn_radio_off_disabled_focused_holo_light</item>
        <item>@drawable/btn_radio_off_disabled_focused_holo_dark</item>
-       <item>@drawable/btn_radio_label_background</item>
-       <item>@drawable/btn_radio</item>
-       <item>@drawable/btn_default_transparent_normal</item>
-       <item>@drawable/btn_default_small_selected</item>
-       <item>@drawable/btn_default_small_pressed</item>
-       <item>@drawable/btn_default_small_normal_disable_focused</item>
-       <item>@drawable/btn_default_small_normal_disable</item>
-       <item>@drawable/btn_default_small_normal</item>
-       <item>@drawable/btn_default_selected</item>
        <item>@drawable/btn_default_pressed_holo_light</item>
        <item>@drawable/btn_default_pressed_holo_dark</item>
-       <item>@drawable/btn_default_pressed</item>
        <item>@drawable/btn_default_normal_holo_light</item>
        <item>@drawable/btn_default_normal_holo_dark</item>
-       <item>@drawable/btn_default_normal_disable_focused</item>
-       <item>@drawable/btn_default_normal_disable</item>
-       <item>@drawable/btn_default_normal</item>
        <item>@drawable/btn_default_focused_holo_light</item>
        <item>@drawable/btn_default_focused_holo_dark</item>
        <item>@drawable/btn_default_disabled_holo_light</item>
@@ -114,24 +77,6 @@
        <item>@drawable/btn_default_disabled_focused_holo_dark</item>
        <item>@drawable/btn_default_holo_dark</item>
        <item>@drawable/btn_default_holo_light</item>
-       <item>@drawable/btn_default</item>
-       <item>@drawable/btn_default_small</item>
-       <item>@drawable/btn_dropdown_disabled</item>
-       <item>@drawable/btn_dropdown_disabled_focused</item>
-       <item>@drawable/btn_dropdown_normal</item>
-       <item>@drawable/btn_dropdown_pressed</item>
-       <item>@drawable/btn_dropdown_selected</item>
-       <item>@drawable/btn_star_label_background</item>
-       <item>@drawable/btn_star_big_off</item>
-       <item>@drawable/btn_star_big_on</item>
-       <item>@drawable/btn_star_big_on_disable</item>
-       <item>@drawable/btn_star_big_off_disable</item>
-       <item>@drawable/btn_star_big_on_pressed</item>
-       <item>@drawable/btn_star_big_off_pressed</item>
-       <item>@drawable/btn_star_big_on_selected</item>
-       <item>@drawable/btn_star_big_off_selected</item>
-       <item>@drawable/btn_star_big_on_disable_focused</item>
-       <item>@drawable/btn_star_big_off_disable_focused</item>
        <item>@drawable/btn_star_off_normal_holo_light</item>
        <item>@drawable/btn_star_on_normal_holo_light</item>
        <item>@drawable/btn_star_on_disabled_holo_light</item>
@@ -154,7 +99,6 @@
        <item>@drawable/btn_star_on_disabled_focused_holo_dark</item>
        <item>@drawable/btn_star_off_disabled_focused_holo_dark</item>
        <item>@drawable/btn_star_holo_dark</item>
-       <item>@drawable/btn_star</item>
        <item>@drawable/btn_toggle_on_pressed_holo_light</item>
        <item>@drawable/btn_toggle_on_pressed_holo_dark</item>
        <item>@drawable/btn_toggle_on_normal_holo_light</item>
@@ -165,7 +109,6 @@
        <item>@drawable/btn_toggle_on_disabled_holo_dark</item>
        <item>@drawable/btn_toggle_on_disabled_focused_holo_light</item>
        <item>@drawable/btn_toggle_on_disabled_focused_holo_dark</item>
-       <item>@drawable/btn_toggle_on</item>
        <item>@drawable/btn_toggle_off_pressed_holo_light</item>
        <item>@drawable/btn_toggle_off_pressed_holo_dark</item>
        <item>@drawable/btn_toggle_off_normal_holo_light</item>
@@ -176,23 +119,10 @@
        <item>@drawable/btn_toggle_off_disabled_holo_dark</item>
        <item>@drawable/btn_toggle_off_disabled_focused_holo_light</item>
        <item>@drawable/btn_toggle_off_disabled_focused_holo_dark</item>
-       <item>@drawable/btn_toggle_off</item>
        <item>@drawable/btn_toggle_holo_light</item>
        <item>@drawable/btn_toggle_holo_dark</item>
-       <item>@drawable/btn_toggle</item>
-       <item>@drawable/btn_toggle_bg</item>
-       <item>@drawable/btn_dropdown</item>
-       <item>@drawable/btn_dropdown</item>
-       <item>@drawable/light_header_dither</item>
-       <item>@drawable/divider_horizontal_textfield</item>
-       <item>@drawable/divider_horizontal_dark_opaque</item>
-       <item>@drawable/divider_horizontal_dark</item>
-       <item>@drawable/divider_horizontal_bright_opaque</item>
-       <item>@drawable/divider_horizontal_bright</item>
-       <item>@drawable/divider_vertical_dark</item>
        <item>@drawable/edit_text_holo_light</item>
        <item>@drawable/edit_text_holo_dark</item>
-       <item>@drawable/edit_text</item>
        <item>@drawable/text_cursor_holo_light</item>
        <item>@drawable/text_cursor_holo_dark</item>
        <item>@drawable/text_select_handle_left</item>
@@ -200,70 +130,45 @@
        <item>@drawable/text_edit_paste_window</item>
        <item>@drawable/expander_close_holo_dark</item>
        <item>@drawable/expander_close_holo_light</item>
-       <item>@drawable/expander_ic_maximized</item>
-       <item>@drawable/expander_ic_minimized</item>
-       <item>@drawable/expander_group</item>
        <item>@drawable/expander_group_holo_dark</item>
        <item>@drawable/expander_group_holo_light</item>
-       <item>@drawable/list_selector_background</item>
-       <item>@drawable/list_selector_background_light</item>
-       <item>@drawable/list_selector_background_longpress</item>
-       <item>@drawable/list_selector_background_longpress_light</item>
-       <item>@drawable/list_selector_background_pressed</item>
-       <item>@drawable/list_selector_background_pressed_light</item>
-       <item>@drawable/list_selector_background_selected</item>
        <item>@drawable/list_selector_holo_dark</item>
        <item>@drawable/list_selector_holo_light</item>
        <item>@drawable/list_section_divider_holo_light</item>
        <item>@drawable/list_section_divider_holo_dark</item>
-       <item>@drawable/menu_background</item>
-       <item>@drawable/menu_background_fill_parent_width</item>
        <item>@drawable/menu_hardkey_panel_holo_dark</item>
        <item>@drawable/menu_hardkey_panel_holo_light</item>
        <item>@drawable/menu_submenu_background</item>
-       <item>@drawable/menu_selector</item>
        <item>@drawable/menu_dropdown_panel_holo_light</item>
        <item>@drawable/menu_dropdown_panel_holo_dark</item>
        <item>@drawable/overscroll_edge</item>
        <item>@drawable/overscroll_glow</item>
-       <item>@drawable/panel_background</item>
-       <item>@drawable/popup_bottom_bright</item>
-       <item>@drawable/popup_bottom_dark</item>
-       <item>@drawable/popup_bottom_medium</item>
-       <item>@drawable/popup_center_bright</item>
-       <item>@drawable/popup_center_dark</item>
-       <item>@drawable/popup_center_medium</item>
-       <item>@drawable/popup_full_bright</item>
-       <item>@drawable/popup_full_dark</item>
-       <item>@drawable/popup_top_bright</item>
-       <item>@drawable/popup_top_dark</item>
        <item>@drawable/popup_inline_error_above_holo_dark</item>
        <item>@drawable/popup_inline_error_above_holo_light</item>
        <item>@drawable/popup_inline_error_holo_dark</item>
        <item>@drawable/popup_inline_error_holo_light</item>
+       <item>@drawable/spinner_16_outer_holo</item>
+       <item>@drawable/spinner_16_inner_holo</item>
+       <item>@drawable/spinner_48_outer_holo</item>
+       <item>@drawable/spinner_48_inner_holo</item>
+       <item>@drawable/spinner_76_outer_holo</item>
+       <item>@drawable/spinner_76_inner_holo</item>
        <item>@drawable/progress_bg_holo_dark</item>
        <item>@drawable/progress_bg_holo_light</item>
-       <item>@drawable/progress_horizontal</item>
        <item>@drawable/progress_horizontal_holo_dark</item>
        <item>@drawable/progress_horizontal_holo_light</item>
-       <item>@drawable/progress_indeterminate_horizontal</item>
        <item>@drawable/progress_indeterminate_horizontal_holo</item>
-       <item>@drawable/progress_large</item>
        <item>@drawable/progress_large_holo</item>
-       <item>@drawable/progress_large_white</item>
-       <item>@drawable/progress_medium</item>
        <item>@drawable/progress_medium_holo</item>
-       <item>@drawable/progress_medium_white</item>
        <item>@drawable/progress_primary_holo_dark</item>
        <item>@drawable/progress_primary_holo_light</item>
        <item>@drawable/progress_secondary_holo_dark</item>
        <item>@drawable/progress_secondary_holo_light</item>
-       <item>@drawable/progress_small</item>
        <item>@drawable/progress_small_holo</item>
-       <item>@drawable/progress_small_titlebar</item>
-       <item>@drawable/progress_small_white</item>
        <item>@drawable/scrubber_progress_horizontal_holo_dark</item>
        <item>@drawable/scrubber_progress_horizontal_holo_light</item>
+       <item>@drawable/background_holo_light</item>
+       <item>@drawable/background_holo_dark</item>
        <item>@drawable/screen_background_dark</item>
        <item>@drawable/screen_background_dark_transparent</item>
        <item>@drawable/screen_background_light</item>
@@ -272,8 +177,6 @@
        <item>@drawable/screen_background_selector_light</item>
        <item>@drawable/scrollbar_handle_holo_dark</item>
        <item>@drawable/scrollbar_handle_holo_light</item>
-       <item>@drawable/scrollbar_handle_horizontal</item>
-       <item>@drawable/scrollbar_handle_vertical</item>
        <item>@drawable/spinner_background_holo_dark</item>
        <item>@drawable/spinner_background_holo_light</item>
        <item>@drawable/spinner_ab_default_holo_dark</item>
@@ -290,9 +193,6 @@
        <item>@drawable/spinner_default_holo_light</item>
        <item>@drawable/spinner_disabled_holo_dark</item>
        <item>@drawable/spinner_disabled_holo_light</item>
-       <item>@drawable/spinner_dropdown_background</item>
-       <item>@drawable/spinner_dropdown_background_down</item>
-       <item>@drawable/spinner_dropdown_background_up</item>
        <item>@drawable/spinner_focused_holo_dark</item>
        <item>@drawable/spinner_focused_holo_light</item>
        <item>@drawable/spinner_pressed_holo_dark</item>
@@ -337,7 +237,6 @@
        <item>@drawable/dialog_middle_holo_light</item>
        <item>@drawable/dialog_top_holo_dark</item>
        <item>@drawable/dialog_top_holo_light</item>
-       <item>@drawable/ic_dialog_alert</item>
        <item>@drawable/ic_dialog_alert_holo_dark</item>
        <item>@drawable/ic_dialog_alert_holo_light</item>
        <item>@drawable/list_divider_holo_dark</item>
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index fea8523..16b7ff3 100755
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -1154,6 +1154,21 @@
              <p>Corresponds to
              {@link android.view.inputmethod.EditorInfo#IME_FLAG_NO_ENTER_ACTION}. -->
         <flag name="flagNoEnterAction" value="0x40000000" />
+        <!-- Used to request that the IME should be capable of inputting ASCII
+             characters.  The intention of this flag is to ensure that the user
+             can type Roman alphabet characters in a {@link android.widget.TextView}
+             used for, typically, account ID or password input.  It is expected that IMEs
+             normally are able to input ASCII even without being told so (such IMEs
+             already respect this flag in a sense), but there could be some cases they
+             aren't when, for instance, only non-ASCII input languagaes like Arabic,
+             Greek, Hebrew, Russian are enabled in the IME.  Applications need to be
+             aware that the flag is not a guarantee, and not all IMEs will respect it.
+             However, it is strongly recommended for IME authors to respect this flag
+             especially when their IME could end up with a state that has only non-ASCII
+             input languages enabled.
+             <p>Corresponds to
+             {@link android.view.inputmethod.EditorInfo#IME_FLAG_FORCE_ASCII}. -->
+        <flag name="flagForceAscii" value="0x80000000" />
     </attr>
 
     <!-- A coordinate in the X dimension. -->
@@ -1815,13 +1830,12 @@
         <!-- Defines whether the vertical scrollbar track should always be drawn. -->
         <attr name="scrollbarAlwaysDrawVerticalTrack" format="boolean" />
 
-        <!-- {@deprecated This attribute is deprecated and will be ignored as of
-             API level {@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH}.
+        <!-- This attribute is deprecated and will be ignored as of
+             API level 14 ({@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH}).
              Using fading edges may introduce noticeable performance
              degradations and should be used only when required by the application's
-             visual design. To request fading edges with API level
-             {@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH} and above,
-             use the <code>requiresFadingEdge</code> attribute instead.} -->
+             visual design. To request fading edges with API level 14 and above,
+             use the <code>android:requiresFadingEdge</code> attribute instead. -->
         <attr name="fadingEdge">
             <!-- No edge is faded. -->
             <flag name="none" value="0x00000000" />
@@ -2047,7 +2061,7 @@
         </attr>
         <!-- Direction of the text. A heuristic is used to determine the resolved text direction
              of paragraphs. -->
-        <attr name="textDirection" format="integer">
+         <attr name="textDirection" format="integer">
             <!-- Default -->
             <enum name="inherit" value="0" />
             <!-- Default for the root view. The first strong directional character determines the
@@ -2058,16 +2072,12 @@
                  it is LTR if it contains any strong LTR characters.  If there are neither, the
                  paragraph direction is the view’s resolved layout direction. -->
             <enum name="anyRtl" value="2" />
-            <!-- The paragraph direction is the same as the one held by a 60% majority of the
-                 characters. If there is no majority then the paragraph direction is the resolved
-                 layout direction of the View. -->
-            <enum name="charCount" value="3" />
             <!-- The paragraph direction is left to right. -->
-            <enum name="ltr" value="4" />
+            <enum name="ltr" value="3" />
             <!-- The paragraph direction is right to left. -->
-            <enum name="rtl" value="5" />
+            <enum name="rtl" value="4" />
             <!-- The paragraph direction is coming from the system Locale. -->
-            <enum name="locale" value="6" />
+            <enum name="locale" value="5" />
         </attr>
     </declare-styleable>
 
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index bc132eb..0511b75 100755
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -361,7 +361,7 @@
          with the modem or some other restricted hardware, add "/dev/bus/usb/001/"
          to this list.  If this is empty, no parts of the host USB bus will be excluded.
     -->
-    <string-array name="config_usbHostBlacklist">
+    <string-array name="config_usbHostBlacklist" translatable="false">
     </string-array>
 
     <!-- Vibrator pattern for feedback about a long screen/key press -->
@@ -533,13 +533,13 @@
 
     <!-- Component name of the default wallpaper. This will be ImageWallpaper if not
          specified -->
-    <string name="default_wallpaper_component">@null</string>
+    <string name="default_wallpaper_component" translatable="false">@null</string>
 
     <!-- Component name of the service providing network location support. -->
-    <string name="config_networkLocationProvider">@null</string>
+    <string name="config_networkLocationProvider" translatable="false">@null</string>
 
     <!-- Component name of the service providing geocoder API support. -->
-    <string name="config_geocodeProvider">@null</string>
+    <string name="config_geocodeProvider" translatable="false">@null</string>
 
     <!-- Boolean indicating if current platform supports bluetooth SCO for off call
     use cases -->
@@ -563,7 +563,7 @@
     <integer name="config_datause_throttle_kbitsps">300</integer>
 
     <!-- The default iface on which to monitor data use -->
-    <string name="config_datause_iface">rmnet0</string>
+    <string name="config_datause_iface" translatable="false">rmnet0</string>
 
     <!-- The default reduced-datarate notification mask -->
     <!-- 2 means give warning -->
@@ -593,11 +593,11 @@
     <bool name="config_sms_capable">true</bool>
 
     <!-- IP address of the dns server to use if nobody else suggests one -->
-    <string name="config_default_dns_server">8.8.8.8</string>
+    <string name="config_default_dns_server" translatable="false">8.8.8.8</string>
 
     <!-- The default character set for GsmAlphabet -->
     <!-- Empty string means MBCS is not considered -->
-    <string name="gsm_alphabet_default_charset"></string>
+    <string name="gsm_alphabet_default_charset" translatable="false"></string>
 
     <!-- Enables SIP on WIFI only -->
     <bool name="config_sip_wifi_only">false</bool>
@@ -632,7 +632,7 @@
          OMA-TS-UAProf-V2_0-20060206-A Section 8.1.1.1. If the URL contains a '%s'
          format string then that substring will be replaced with the value of
          Build.MODEL. The format string shall not be escaped. -->
-    <string name="config_useragentprofile_url"></string>
+    <string name="config_useragentprofile_url" translatable="false"></string>
 
     <!-- When a database query is executed, the results retuned are paginated
          in pages of size (in KB) indicated by this value -->
@@ -643,7 +643,7 @@
     <bool name="config_showMenuShortcutsWhenKeyboardPresent">false</bool>
 
     <!-- Do not translate. Defines the slots is Two Digit Number for dialing normally not USSD -->
-    <string-array name="config_twoDigitNumberPattern">
+    <string-array name="config_twoDigitNumberPattern" translatable="false">
     </string-array>
 
     <!-- The VoiceMail default value is displayed to my own number if it is true -->
@@ -743,18 +743,18 @@
     <!-- Set and Unsets WiMAX -->
     <bool name="config_wimaxEnabled">false</bool>
     <!-- Location of the wimax framwork jar location -->
-    <string name="config_wimaxServiceJarLocation"></string>
+    <string name="config_wimaxServiceJarLocation" translatable="false"></string>
     <!-- Location of the wimax native library locaiton -->
-    <string name="config_wimaxNativeLibLocation"></string>
+    <string name="config_wimaxNativeLibLocation" translatable="false"></string>
     <!-- Name of the wimax manager class -->
-    <string name="config_wimaxManagerClassname"></string>
+    <string name="config_wimaxManagerClassname" translatable="false"></string>
     <!-- Name of the wimax service class -->
-    <string name="config_wimaxServiceClassname"></string>
+    <string name="config_wimaxServiceClassname" translatable="false"></string>
     <!-- Name of the wimax state tracker clas -->
-    <string name="config_wimaxStateTrackerClassname"></string>
+    <string name="config_wimaxStateTrackerClassname" translatable="false"></string>
 
     <!-- Name of screensaver components to look for if none has been chosen by the user -->
-    <string name="config_defaultDreamComponent">com.google.android.deskclock/com.android.deskclock.Screensaver</string>
+    <string name="config_defaultDreamComponent" translatable="false">com.google.android.deskclock/com.android.deskclock.Screensaver</string>
 
     <!-- Base "touch slop" value used by ViewConfiguration as a
          movement threshold where scrolling should begin. -->
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 4d97ad2..e3c2bd8 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -23,6 +23,1514 @@
        SDK.  Instead, put them here. -->
   <private-symbols package="com.android.internal" />
 
+  <!-- Private symbols that we need to reference from framework code.  See
+       frameworks/base/core/res/MakeJavaSymbols.sed for how to easily generate
+       this.
+  -->
+  <java-symbol type="id" name="account_name" />
+  <java-symbol type="id" name="account_row_checkmark" />
+  <java-symbol type="id" name="account_row_icon" />
+  <java-symbol type="id" name="account_row_text" />
+  <java-symbol type="id" name="account_type" />
+  <java-symbol type="id" name="action_bar" />
+  <java-symbol type="id" name="action_bar_container" />
+  <java-symbol type="id" name="action_bar_title" />
+  <java-symbol type="id" name="action_bar_subtitle" />
+  <java-symbol type="id" name="action_context_bar" />
+  <java-symbol type="id" name="action_menu_presenter" />
+  <java-symbol type="id" name="action_mode_close_button" />
+  <java-symbol type="id" name="activity_chooser_view_content" />
+  <java-symbol type="id" name="addAccount" />
+  <java-symbol type="id" name="albumart" />
+  <java-symbol type="id" name="alertTitle" />
+  <java-symbol type="id" name="allow_button" />
+  <java-symbol type="id" name="alwaysUse" />
+  <java-symbol type="id" name="amPm" />
+  <java-symbol type="id" name="authtoken_type" />
+  <java-symbol type="id" name="back_button" />
+  <java-symbol type="id" name="btn_next" />
+  <java-symbol type="id" name="btn_play" />
+  <java-symbol type="id" name="btn_prev" />
+  <java-symbol type="id" name="button_bar" />
+  <java-symbol type="id" name="buttonPanel" />
+  <java-symbol type="id" name="by_common" />
+  <java-symbol type="id" name="by_org" />
+  <java-symbol type="id" name="by_org_unit" />
+  <java-symbol type="id" name="calendar_view" />
+  <java-symbol type="id" name="cancel" />
+  <java-symbol type="id" name="characterPicker" />
+  <java-symbol type="id" name="clearDefaultHint" />
+  <java-symbol type="id" name="contentPanel" />
+  <java-symbol type="id" name="customPanel" />
+  <java-symbol type="id" name="dangerous_perms_list" />
+  <java-symbol type="id" name="datePicker" />
+  <java-symbol type="id" name="day" />
+  <java-symbol type="id" name="day_names" />
+  <java-symbol type="id" name="decrement" />
+  <java-symbol type="id" name="default_activity_button" />
+  <java-symbol type="id" name="deny_button" />
+  <java-symbol type="id" name="description" />
+  <java-symbol type="id" name="divider" />
+  <java-symbol type="id" name="edit_query" />
+  <java-symbol type="id" name="edittext_container" />
+  <java-symbol type="id" name="enter_pin_section" />
+  <java-symbol type="id" name="expand_activities_button" />
+  <java-symbol type="id" name="expand_button" />
+  <java-symbol type="id" name="expand_button_divider" />
+  <java-symbol type="id" name="expires_on" />
+  <java-symbol type="id" name="find_next" />
+  <java-symbol type="id" name="find_prev" />
+  <java-symbol type="id" name="ffwd" />
+  <java-symbol type="id" name="fillInIntent" />
+  <java-symbol type="id" name="find" />
+  <java-symbol type="id" name="fullscreenArea" />
+  <java-symbol type="id" name="headers" />
+  <java-symbol type="id" name="hour" />
+  <java-symbol type="id" name="icon" />
+  <java-symbol type="id" name="image" />
+  <java-symbol type="id" name="imageButton" />
+  <java-symbol type="id" name="increment" />
+  <java-symbol type="id" name="internalEmpty" />
+  <java-symbol type="id" name="info" />
+  <java-symbol type="id" name="inputExtractAccessories" />
+  <java-symbol type="id" name="inputExtractAction" />
+  <java-symbol type="id" name="inputExtractEditButton" />
+  <java-symbol type="id" name="issued_on" />
+  <java-symbol type="id" name="left_icon" />
+  <java-symbol type="id" name="leftSpacer" />
+  <java-symbol type="id" name="line3" />
+  <java-symbol type="id" name="list_footer" />
+  <java-symbol type="id" name="list_item" />
+  <java-symbol type="id" name="listContainer" />
+  <java-symbol type="id" name="locale" />
+  <java-symbol type="id" name="matches" />
+  <java-symbol type="id" name="mediacontroller_progress" />
+  <java-symbol type="id" name="minute" />
+  <java-symbol type="id" name="mode_normal" />
+  <java-symbol type="id" name="month" />
+  <java-symbol type="id" name="month_name" />
+  <java-symbol type="id" name="name" />
+  <java-symbol type="id" name="next" />
+  <java-symbol type="id" name="next_button" />
+  <java-symbol type="id" name="new_app_action" />
+  <java-symbol type="id" name="new_app_description" />
+  <java-symbol type="id" name="new_app_icon" />
+  <java-symbol type="id" name="no_permissions" />
+  <java-symbol type="id" name="non_dangerous_perms_list" />
+  <java-symbol type="id" name="numberpicker_input" />
+  <java-symbol type="id" name="old_app_action" />
+  <java-symbol type="id" name="old_app_description" />
+  <java-symbol type="id" name="old_app_icon" />
+  <java-symbol type="id" name="package_label" />
+  <java-symbol type="id" name="packages_list" />
+  <java-symbol type="id" name="pause" />
+  <java-symbol type="id" name="perm_icon" />
+  <java-symbol type="id" name="permission_group" />
+  <java-symbol type="id" name="permission_list" />
+  <java-symbol type="id" name="pickers" />
+  <java-symbol type="id" name="prefs" />
+  <java-symbol type="id" name="prefs_frame" />
+  <java-symbol type="id" name="prev" />
+  <java-symbol type="id" name="progress" />
+  <java-symbol type="id" name="progress_circular" />
+  <java-symbol type="id" name="progress_horizontal" />
+  <java-symbol type="id" name="progress_number" />
+  <java-symbol type="id" name="progress_percent" />
+  <java-symbol type="id" name="progressContainer" />
+  <java-symbol type="id" name="rew" />
+  <java-symbol type="id" name="rightSpacer" />
+  <java-symbol type="id" name="rowTypeId" />
+  <java-symbol type="id" name="scrollView" />
+  <java-symbol type="id" name="search_app_icon" />
+  <java-symbol type="id" name="search_badge" />
+  <java-symbol type="id" name="search_bar" />
+  <java-symbol type="id" name="search_button" />
+  <java-symbol type="id" name="search_close_btn" />
+  <java-symbol type="id" name="search_edit_frame" />
+  <java-symbol type="id" name="search_go_btn" />
+  <java-symbol type="id" name="search_mag_icon" />
+  <java-symbol type="id" name="search_plate" />
+  <java-symbol type="id" name="search_src_text" />
+  <java-symbol type="id" name="search_view" />
+  <java-symbol type="id" name="search_voice_btn" />
+  <java-symbol type="id" name="select_all" />
+  <java-symbol type="id" name="serial_number" />
+  <java-symbol type="id" name="seekbar" />
+  <java-symbol type="id" name="sha1_fingerprint" />
+  <java-symbol type="id" name="sha256_fingerprint" />
+  <java-symbol type="id" name="share" />
+  <java-symbol type="id" name="shortcut" />
+  <java-symbol type="id" name="show_more" />
+  <java-symbol type="id" name="show_more_icon" />
+  <java-symbol type="id" name="show_more_text" />
+  <java-symbol type="id" name="skip_button" />
+  <java-symbol type="id" name="slider_group" />
+  <java-symbol type="id" name="split_action_bar" />
+  <java-symbol type="id" name="stream_icon" />
+  <java-symbol type="id" name="submit_area" />
+  <java-symbol type="id" name="switch_new" />
+  <java-symbol type="id" name="switch_old" />
+  <java-symbol type="id" name="switchWidget" />
+  <java-symbol type="id" name="text" />
+  <java-symbol type="id" name="textButton" />
+  <java-symbol type="id" name="time" />
+  <java-symbol type="id" name="time_current" />
+  <java-symbol type="id" name="timeDisplayBackground" />
+  <java-symbol type="id" name="timeDisplayForeground" />
+  <java-symbol type="id" name="titleDivider" />
+  <java-symbol type="id" name="titleDividerTop" />
+  <java-symbol type="id" name="timePicker" />
+  <java-symbol type="id" name="title_template" />
+  <java-symbol type="id" name="to_common" />
+  <java-symbol type="id" name="to_org" />
+  <java-symbol type="id" name="to_org_unit" />
+  <java-symbol type="id" name="topPanel" />
+  <java-symbol type="id" name="up" />
+  <java-symbol type="id" name="value" />
+  <java-symbol type="id" name="visible_panel" />
+  <java-symbol type="id" name="websearch" />
+  <java-symbol type="id" name="wifi_p2p_wps_pin" />
+  <java-symbol type="id" name="year" />
+  <java-symbol type="id" name="zoomControls" />
+  <java-symbol type="id" name="zoomIn" />
+  <java-symbol type="id" name="zoomMagnify" />
+  <java-symbol type="id" name="zoomOut" />
+
+  <java-symbol type="attr" name="actionModeShareDrawable" />
+  <java-symbol type="attr" name="alertDialogCenterButtons" />
+  <java-symbol type="attr" name="gestureOverlayViewStyle" />
+  <java-symbol type="attr" name="keyboardViewStyle" />
+  <java-symbol type="attr" name="numberPickerStyle" />
+  <java-symbol type="attr" name="pointerStyle" />
+  <java-symbol type="attr" name="preferenceFrameLayoutStyle" />
+  <java-symbol type="attr" name="searchDialogTheme" />
+  <java-symbol type="attr" name="searchViewSearchIcon" />
+  <java-symbol type="attr" name="stackViewStyle" />
+  <java-symbol type="attr" name="switchStyle" />
+  <java-symbol type="attr" name="textAppearanceAutoCorrectionSuggestion" />
+  <java-symbol type="attr" name="textAppearanceEasyCorrectSuggestion" />
+  <java-symbol type="attr" name="textAppearanceMisspelledSuggestion" />
+  <java-symbol type="attr" name="textColorSearchUrl" />
+  <java-symbol type="attr" name="timePickerStyle" />
+
+  <java-symbol type="bool" name="action_bar_embed_tabs" />
+  <java-symbol type="bool" name="action_bar_expanded_action_views_exclusive" />
+  <java-symbol type="bool" name="config_allowActionMenuItemTextWithIcon" />
+  <java-symbol type="bool" name="config_bluetooth_adapter_quick_switch" />
+  <java-symbol type="bool" name="config_bluetooth_sco_off_call" />
+  <java-symbol type="bool" name="config_duplicate_port_omadm_wappush" />
+  <java-symbol type="bool" name="config_enable_emergency_call_while_sim_locked" />
+  <java-symbol type="bool" name="config_enable_puk_unlock_screen" />
+  <java-symbol type="bool" name="config_mms_content_disposition_support" />
+  <java-symbol type="bool" name="config_showMenuShortcutsWhenKeyboardPresent" />
+  <java-symbol type="bool" name="config_sip_wifi_only" />
+  <java-symbol type="bool" name="config_sms_capable" />
+  <java-symbol type="bool" name="config_sms_utf8_support" />
+  <java-symbol type="bool" name="config_swipeDisambiguation" />
+  <java-symbol type="bool" name="config_telephony_use_own_number_for_voicemail" />
+  <java-symbol type="bool" name="config_ui_enableFadingMarquee" />
+  <java-symbol type="bool" name="config_use_strict_phone_number_comparation" />
+  <java-symbol type="bool" name="config_voice_capable" />
+  <java-symbol type="bool" name="preferences_prefer_dual_pane" />
+  <java-symbol type="bool" name="skip_restoring_network_selection" />
+  <java-symbol type="bool" name="split_action_bar_is_narrow" />
+
+  <java-symbol type="integer" name="config_cursorWindowSize" />
+  <java-symbol type="integer" name="config_longPressOnPowerBehavior" />
+  <java-symbol type="integer" name="config_max_pan_devices" />
+  <java-symbol type="integer" name="config_ntpTimeout" />
+  <java-symbol type="integer" name="config_wifi_framework_scan_interval" />
+  <java-symbol type="integer" name="config_wifi_supplicant_scan_interval" />
+  <java-symbol type="integer" name="db_connection_pool_size" />
+  <java-symbol type="integer" name="max_action_buttons" />
+
+  <java-symbol type="color" name="tab_indicator_text_v4" />
+
+  <java-symbol type="dimen" name="config_prefDialogWidth" />
+  <java-symbol type="dimen" name="config_viewConfigurationTouchSlop" />
+  <java-symbol type="dimen" name="default_app_widget_padding_bottom" />
+  <java-symbol type="dimen" name="default_app_widget_padding_left" />
+  <java-symbol type="dimen" name="default_app_widget_padding_right" />
+  <java-symbol type="dimen" name="default_app_widget_padding_top" />
+  <java-symbol type="dimen" name="default_gap" />
+  <java-symbol type="dimen" name="dropdownitem_icon_width" />
+  <java-symbol type="dimen" name="dropdownitem_text_padding_left" />
+  <java-symbol type="dimen" name="fastscroll_overlay_size" />
+  <java-symbol type="dimen" name="fastscroll_thumb_height" />
+  <java-symbol type="dimen" name="fastscroll_thumb_width" />
+  <java-symbol type="dimen" name="fastscroll_thumb_width" />
+  <java-symbol type="dimen" name="password_keyboard_spacebar_vertical_correction" />
+  <java-symbol type="dimen" name="search_view_preferred_width" />
+  <java-symbol type="dimen" name="textview_error_popup_default_width" />
+  <java-symbol type="dimen" name="toast_y_offset" />
+  <java-symbol type="dimen" name="volume_panel_top" />
+
+  <java-symbol type="string" name="addToDictionary" />
+  <java-symbol type="string" name="action_bar_home_description" />
+  <java-symbol type="string" name="action_bar_up_description" />
+  <java-symbol type="string" name="delete" />
+  <java-symbol type="string" name="deleteText" />
+  <java-symbol type="string" name="ellipsis_two_dots" />
+  <java-symbol type="string" name="ellipsis" />
+  <java-symbol type="string" name="grant_permissions_header_text" />
+  <java-symbol type="string" name="list_delimeter" />
+  <java-symbol type="string" name="menu_delete_shortcut_label" />
+  <java-symbol type="string" name="menu_enter_shortcut_label" />
+  <java-symbol type="string" name="menu_space_shortcut_label" />
+  <java-symbol type="string" name="notification_title" />
+  <java-symbol type="string" name="permission_request_notification_with_subtitle" />
+  <java-symbol type="string" name="prepend_shortcut_label" />
+  <java-symbol type="string" name="replace" />
+  <java-symbol type="string" name="textSelectionCABTitle" />
+  <java-symbol type="string" name="BaMmi" />
+  <java-symbol type="string" name="CLIRDefaultOffNextCallOff" />
+  <java-symbol type="string" name="CLIRDefaultOffNextCallOn" />
+  <java-symbol type="string" name="CLIRDefaultOnNextCallOff" />
+  <java-symbol type="string" name="CLIRDefaultOnNextCallOn" />
+  <java-symbol type="string" name="CLIRPermanent" />
+  <java-symbol type="string" name="CfMmi" />
+  <java-symbol type="string" name="ClipMmi" />
+  <java-symbol type="string" name="ClirMmi" />
+  <java-symbol type="string" name="CwMmi" />
+  <java-symbol type="string" name="Midnight" />
+  <java-symbol type="string" name="Noon" />
+  <java-symbol type="string" name="PinMmi" />
+  <java-symbol type="string" name="PwdMmi" />
+  <java-symbol type="string" name="RestrictedChangedTitle" />
+  <java-symbol type="string" name="RestrictedOnAllVoice" />
+  <java-symbol type="string" name="RestrictedOnData" />
+  <java-symbol type="string" name="RestrictedOnEmergency" />
+  <java-symbol type="string" name="RestrictedOnNormal" />
+  <java-symbol type="string" name="SetupCallDefault" />
+  <java-symbol type="string" name="abbrev_month" />
+  <java-symbol type="string" name="abbrev_month_day" />
+  <java-symbol type="string" name="abbrev_month_day_year" />
+  <java-symbol type="string" name="abbrev_month_year" />
+  <java-symbol type="string" name="accept" />
+  <java-symbol type="string" name="activity_chooser_view_see_all" />
+  <java-symbol type="string" name="activitychooserview_choose_application" />
+  <java-symbol type="string" name="alternate_eri_file" />
+  <java-symbol type="string" name="alwaysUse" />
+  <java-symbol type="string" name="am" />
+  <java-symbol type="string" name="autofill_address_line_1_label_re" />
+  <java-symbol type="string" name="autofill_address_line_1_re" />
+  <java-symbol type="string" name="autofill_address_line_2_re" />
+  <java-symbol type="string" name="autofill_address_line_3_re" />
+  <java-symbol type="string" name="autofill_address_name_separator" />
+  <java-symbol type="string" name="autofill_address_summary_format" />
+  <java-symbol type="string" name="autofill_address_summary_name_format" />
+  <java-symbol type="string" name="autofill_address_summary_separator" />
+  <java-symbol type="string" name="autofill_address_type_same_as_re" />
+  <java-symbol type="string" name="autofill_address_type_use_my_re" />
+  <java-symbol type="string" name="autofill_area" />
+  <java-symbol type="string" name="autofill_area_code_notext_re" />
+  <java-symbol type="string" name="autofill_area_code_re" />
+  <java-symbol type="string" name="autofill_attention_ignored_re" />
+  <java-symbol type="string" name="autofill_billing_designator_re" />
+  <java-symbol type="string" name="autofill_card_cvc_re" />
+  <java-symbol type="string" name="autofill_card_ignored_re" />
+  <java-symbol type="string" name="autofill_card_number_re" />
+  <java-symbol type="string" name="autofill_city_re" />
+  <java-symbol type="string" name="autofill_company_re" />
+  <java-symbol type="string" name="autofill_country_code_re" />
+  <java-symbol type="string" name="autofill_country_re" />
+  <java-symbol type="string" name="autofill_county" />
+  <java-symbol type="string" name="autofill_department" />
+  <java-symbol type="string" name="autofill_district" />
+  <java-symbol type="string" name="autofill_email_re" />
+  <java-symbol type="string" name="autofill_emirate" />
+  <java-symbol type="string" name="autofill_expiration_date_re" />
+  <java-symbol type="string" name="autofill_expiration_month_re" />
+  <java-symbol type="string" name="autofill_fax_re" />
+  <java-symbol type="string" name="autofill_first_name_re" />
+  <java-symbol type="string" name="autofill_island" />
+  <java-symbol type="string" name="autofill_last_name_re" />
+  <java-symbol type="string" name="autofill_middle_initial_re" />
+  <java-symbol type="string" name="autofill_middle_name_re" />
+  <java-symbol type="string" name="autofill_name_on_card_contextual_re" />
+  <java-symbol type="string" name="autofill_name_on_card_re" />
+  <java-symbol type="string" name="autofill_name_re" />
+  <java-symbol type="string" name="autofill_name_specific_re" />
+  <java-symbol type="string" name="autofill_parish" />
+  <java-symbol type="string" name="autofill_phone_extension_re" />
+  <java-symbol type="string" name="autofill_phone_prefix_re" />
+  <java-symbol type="string" name="autofill_phone_prefix_separator_re" />
+  <java-symbol type="string" name="autofill_phone_re" />
+  <java-symbol type="string" name="autofill_phone_suffix_re" />
+  <java-symbol type="string" name="autofill_phone_suffix_separator_re" />
+  <java-symbol type="string" name="autofill_postal_code" />
+  <java-symbol type="string" name="autofill_prefecture" />
+  <java-symbol type="string" name="autofill_province" />
+  <java-symbol type="string" name="autofill_region_ignored_re" />
+  <java-symbol type="string" name="autofill_shipping_designator_re" />
+  <java-symbol type="string" name="autofill_state" />
+  <java-symbol type="string" name="autofill_state_re" />
+  <java-symbol type="string" name="autofill_this_form" />
+  <java-symbol type="string" name="autofill_username_re" />
+  <java-symbol type="string" name="autofill_zip_4_re" />
+  <java-symbol type="string" name="autofill_zip_code" />
+  <java-symbol type="string" name="autofill_zip_code_re" />
+  <java-symbol type="string" name="badPin" />
+  <java-symbol type="string" name="badPuk" />
+  <java-symbol type="string" name="byteShort" />
+  <java-symbol type="string" name="cfTemplateForwarded" />
+  <java-symbol type="string" name="cfTemplateForwardedTime" />
+  <java-symbol type="string" name="cfTemplateNotForwarded" />
+  <java-symbol type="string" name="cfTemplateRegistered" />
+  <java-symbol type="string" name="cfTemplateRegisteredTime" />
+  <java-symbol type="string" name="checkbox_checked" />
+  <java-symbol type="string" name="checkbox_not_checked" />
+  <java-symbol type="string" name="chooseActivity" />
+  <java-symbol type="string" name="config_default_dns_server" />
+  <java-symbol type="string" name="config_ethernet_iface_regex" />
+  <java-symbol type="string" name="config_ntpServer" />
+  <java-symbol type="string" name="config_tether_apndata" />
+  <java-symbol type="string" name="config_useragentprofile_url" />
+  <java-symbol type="string" name="config_wifi_p2p_device_type" />
+  <java-symbol type="string" name="contentServiceSync" />
+  <java-symbol type="string" name="contentServiceSyncNotificationTitle" />
+  <java-symbol type="string" name="contentServiceTooManyDeletesNotificationDesc" />
+  <java-symbol type="string" name="date1_date2" />
+  <java-symbol type="string" name="date1_time1_date2_time2" />
+  <java-symbol type="string" name="date_and_time" />
+  <java-symbol type="string" name="date_picker_decrement_day_button" />
+  <java-symbol type="string" name="date_picker_decrement_month_button" />
+  <java-symbol type="string" name="date_picker_decrement_year_button" />
+  <java-symbol type="string" name="date_picker_dialog_title" />
+  <java-symbol type="string" name="date_picker_increment_day_button" />
+  <java-symbol type="string" name="date_picker_increment_month_button" />
+  <java-symbol type="string" name="date_picker_increment_year_button" />
+  <java-symbol type="string" name="date_time" />
+  <java-symbol type="string" name="date_time_set" />
+  <java-symbol type="string" name="day_of_week_long_friday" />
+  <java-symbol type="string" name="day_of_week_long_monday" />
+  <java-symbol type="string" name="day_of_week_long_saturday" />
+  <java-symbol type="string" name="day_of_week_long_sunday" />
+  <java-symbol type="string" name="day_of_week_long_thursday" />
+  <java-symbol type="string" name="day_of_week_long_tuesday" />
+  <java-symbol type="string" name="day_of_week_long_wednesday" />
+  <java-symbol type="string" name="day_of_week_medium_friday" />
+  <java-symbol type="string" name="day_of_week_medium_monday" />
+  <java-symbol type="string" name="day_of_week_medium_saturday" />
+  <java-symbol type="string" name="day_of_week_medium_sunday" />
+  <java-symbol type="string" name="day_of_week_medium_thursday" />
+  <java-symbol type="string" name="day_of_week_medium_tuesday" />
+  <java-symbol type="string" name="day_of_week_medium_wednesday" />
+  <java-symbol type="string" name="day_of_week_short_friday" />
+  <java-symbol type="string" name="day_of_week_short_monday" />
+  <java-symbol type="string" name="day_of_week_short_saturday" />
+  <java-symbol type="string" name="day_of_week_short_sunday" />
+  <java-symbol type="string" name="day_of_week_short_thursday" />
+  <java-symbol type="string" name="day_of_week_short_tuesday" />
+  <java-symbol type="string" name="day_of_week_short_wednesday" />
+  <java-symbol type="string" name="day_of_week_shortest_friday" />
+  <java-symbol type="string" name="day_of_week_shortest_monday" />
+  <java-symbol type="string" name="day_of_week_shortest_saturday" />
+  <java-symbol type="string" name="day_of_week_shortest_sunday" />
+  <java-symbol type="string" name="day_of_week_shortest_thursday" />
+  <java-symbol type="string" name="day_of_week_shortest_tuesday" />
+  <java-symbol type="string" name="day_of_week_shortest_wednesday" />
+  <java-symbol type="string" name="decline" />
+  <java-symbol type="string" name="default_permission_group" />
+  <java-symbol type="string" name="default_text_encoding" />
+  <java-symbol type="string" name="description_target_unlock_tablet" />
+  <java-symbol type="string" name="double_tap_toast" />
+  <java-symbol type="string" name="elapsed_time_short_format_h_mm_ss" />
+  <java-symbol type="string" name="elapsed_time_short_format_mm_ss" />
+  <java-symbol type="string" name="emailTypeCustom" />
+  <java-symbol type="string" name="emailTypeHome" />
+  <java-symbol type="string" name="emailTypeMobile" />
+  <java-symbol type="string" name="emailTypeOther" />
+  <java-symbol type="string" name="emailTypeWork" />
+  <java-symbol type="string" name="emergency_call_dialog_number_for_display" />
+  <java-symbol type="string" name="emergency_calls_only" />
+  <java-symbol type="string" name="eventTypeAnniversary" />
+  <java-symbol type="string" name="eventTypeBirthday" />
+  <java-symbol type="string" name="eventTypeCustom" />
+  <java-symbol type="string" name="eventTypeOther" />
+  <java-symbol type="string" name="extmedia_format_button_format" />
+  <java-symbol type="string" name="extmedia_format_message" />
+  <java-symbol type="string" name="extmedia_format_title" />
+  <java-symbol type="string" name="fileSizeSuffix" />
+  <java-symbol type="string" name="force_close" />
+  <java-symbol type="string" name="format_error" />
+  <java-symbol type="string" name="gadget_host_error_inflating" />
+  <java-symbol type="string" name="gigabyteShort" />
+  <java-symbol type="string" name="gpsNotifMessage" />
+  <java-symbol type="string" name="gpsNotifTicker" />
+  <java-symbol type="string" name="gpsNotifTitle" />
+  <java-symbol type="string" name="gpsVerifNo" />
+  <java-symbol type="string" name="gpsVerifYes" />
+  <java-symbol type="string" name="gsm_alphabet_default_charset" />
+  <java-symbol type="string" name="hour_ampm" />
+  <java-symbol type="string" name="hour_cap_ampm" />
+  <java-symbol type="string" name="hour_minute_24" />
+  <java-symbol type="string" name="hour_minute_ampm" />
+  <java-symbol type="string" name="hour_minute_cap_ampm" />
+  <java-symbol type="string" name="httpError" />
+  <java-symbol type="string" name="httpErrorAuth" />
+  <java-symbol type="string" name="httpErrorConnect" />
+  <java-symbol type="string" name="httpErrorFailedSslHandshake" />
+  <java-symbol type="string" name="httpErrorFile" />
+  <java-symbol type="string" name="httpErrorFileNotFound" />
+  <java-symbol type="string" name="httpErrorIO" />
+  <java-symbol type="string" name="httpErrorLookup" />
+  <java-symbol type="string" name="httpErrorOk" />
+  <java-symbol type="string" name="httpErrorProxyAuth" />
+  <java-symbol type="string" name="httpErrorRedirectLoop" />
+  <java-symbol type="string" name="httpErrorTimeout" />
+  <java-symbol type="string" name="httpErrorTooManyRequests" />
+  <java-symbol type="string" name="httpErrorUnsupportedAuthScheme" />
+  <java-symbol type="string" name="imProtocolAim" />
+  <java-symbol type="string" name="imProtocolCustom" />
+  <java-symbol type="string" name="imProtocolGoogleTalk" />
+  <java-symbol type="string" name="imProtocolIcq" />
+  <java-symbol type="string" name="imProtocolJabber" />
+  <java-symbol type="string" name="imProtocolMsn" />
+  <java-symbol type="string" name="imProtocolNetMeeting" />
+  <java-symbol type="string" name="imProtocolQq" />
+  <java-symbol type="string" name="imProtocolSkype" />
+  <java-symbol type="string" name="imProtocolYahoo" />
+  <java-symbol type="string" name="imTypeCustom" />
+  <java-symbol type="string" name="imTypeHome" />
+  <java-symbol type="string" name="imTypeOther" />
+  <java-symbol type="string" name="imTypeWork" />
+  <java-symbol type="string" name="ime_action_default" />
+  <java-symbol type="string" name="ime_action_done" />
+  <java-symbol type="string" name="ime_action_go" />
+  <java-symbol type="string" name="ime_action_next" />
+  <java-symbol type="string" name="ime_action_previous" />
+  <java-symbol type="string" name="ime_action_search" />
+  <java-symbol type="string" name="ime_action_send" />
+  <java-symbol type="string" name="invalidPin" />
+  <java-symbol type="string" name="js_dialog_before_unload" />
+  <java-symbol type="string" name="js_dialog_title" />
+  <java-symbol type="string" name="js_dialog_title_default" />
+  <java-symbol type="string" name="keyboard_headset_required_to_hear_password" />
+  <java-symbol type="string" name="keyboard_password_character_no_headset" />
+  <java-symbol type="string" name="keyboardview_keycode_alt" />
+  <java-symbol type="string" name="keyboardview_keycode_cancel" />
+  <java-symbol type="string" name="keyboardview_keycode_delete" />
+  <java-symbol type="string" name="keyboardview_keycode_done" />
+  <java-symbol type="string" name="keyboardview_keycode_enter" />
+  <java-symbol type="string" name="keyboardview_keycode_mode_change" />
+  <java-symbol type="string" name="keyboardview_keycode_shift" />
+  <java-symbol type="string" name="kilobyteShort" />
+  <java-symbol type="string" name="last_month" />
+  <java-symbol type="string" name="launchBrowserDefault" />
+  <java-symbol type="string" name="lockscreen_access_pattern_cell_added" />
+  <java-symbol type="string" name="lockscreen_access_pattern_cleared" />
+  <java-symbol type="string" name="lockscreen_access_pattern_detected" />
+  <java-symbol type="string" name="lockscreen_access_pattern_start" />
+  <java-symbol type="string" name="lockscreen_emergency_call" />
+  <java-symbol type="string" name="lockscreen_return_to_call" />
+  <java-symbol type="string" name="lockscreen_transport_pause_description" />
+  <java-symbol type="string" name="lockscreen_transport_play_description" />
+  <java-symbol type="string" name="lockscreen_transport_stop_description" />
+  <java-symbol type="string" name="low_memory" />
+  <java-symbol type="string" name="media_bad_removal" />
+  <java-symbol type="string" name="media_checking" />
+  <java-symbol type="string" name="media_removed" />
+  <java-symbol type="string" name="media_shared" />
+  <java-symbol type="string" name="media_unknown_state" />
+  <java-symbol type="string" name="megabyteShort" />
+  <java-symbol type="string" name="midnight" />
+  <java-symbol type="string" name="mismatchPin" />
+  <java-symbol type="string" name="mmiComplete" />
+  <java-symbol type="string" name="mmiError" />
+  <java-symbol type="string" name="mmiFdnError" />
+  <java-symbol type="string" name="month" />
+  <java-symbol type="string" name="month_day" />
+  <java-symbol type="string" name="month_day_year" />
+  <java-symbol type="string" name="month_long_april" />
+  <java-symbol type="string" name="month_long_august" />
+  <java-symbol type="string" name="month_long_december" />
+  <java-symbol type="string" name="month_long_february" />
+  <java-symbol type="string" name="month_long_january" />
+  <java-symbol type="string" name="month_long_july" />
+  <java-symbol type="string" name="month_long_june" />
+  <java-symbol type="string" name="month_long_march" />
+  <java-symbol type="string" name="month_long_may" />
+  <java-symbol type="string" name="month_long_november" />
+  <java-symbol type="string" name="month_long_october" />
+  <java-symbol type="string" name="month_long_september" />
+  <java-symbol type="string" name="month_long_standalone_april" />
+  <java-symbol type="string" name="month_long_standalone_august" />
+  <java-symbol type="string" name="month_long_standalone_december" />
+  <java-symbol type="string" name="month_long_standalone_february" />
+  <java-symbol type="string" name="month_long_standalone_january" />
+  <java-symbol type="string" name="month_long_standalone_july" />
+  <java-symbol type="string" name="month_long_standalone_june" />
+  <java-symbol type="string" name="month_long_standalone_march" />
+  <java-symbol type="string" name="month_long_standalone_may" />
+  <java-symbol type="string" name="month_long_standalone_november" />
+  <java-symbol type="string" name="month_long_standalone_october" />
+  <java-symbol type="string" name="month_long_standalone_september" />
+  <java-symbol type="string" name="month_medium_april" />
+  <java-symbol type="string" name="month_medium_august" />
+  <java-symbol type="string" name="month_medium_december" />
+  <java-symbol type="string" name="month_medium_february" />
+  <java-symbol type="string" name="month_medium_january" />
+  <java-symbol type="string" name="month_medium_july" />
+  <java-symbol type="string" name="month_medium_june" />
+  <java-symbol type="string" name="month_medium_march" />
+  <java-symbol type="string" name="month_medium_may" />
+  <java-symbol type="string" name="month_medium_november" />
+  <java-symbol type="string" name="month_medium_october" />
+  <java-symbol type="string" name="month_medium_september" />
+  <java-symbol type="string" name="month_shortest_april" />
+  <java-symbol type="string" name="month_shortest_august" />
+  <java-symbol type="string" name="month_shortest_december" />
+  <java-symbol type="string" name="month_shortest_february" />
+  <java-symbol type="string" name="month_shortest_january" />
+  <java-symbol type="string" name="month_shortest_july" />
+  <java-symbol type="string" name="month_shortest_june" />
+  <java-symbol type="string" name="month_shortest_march" />
+  <java-symbol type="string" name="month_shortest_may" />
+  <java-symbol type="string" name="month_shortest_november" />
+  <java-symbol type="string" name="month_shortest_october" />
+  <java-symbol type="string" name="month_shortest_september" />
+  <java-symbol type="string" name="month_year" />
+  <java-symbol type="string" name="more_item_label" />
+  <java-symbol type="string" name="needPuk" />
+  <java-symbol type="string" name="needPuk2" />
+  <java-symbol type="string" name="new_app_action" />
+  <java-symbol type="string" name="new_app_description" />
+  <java-symbol type="string" name="noApplications" />
+  <java-symbol type="string" name="no_file_chosen" />
+  <java-symbol type="string" name="no_matches" />
+  <java-symbol type="string" name="noon" />
+  <java-symbol type="string" name="number_picker_increment_scroll_action" />
+  <java-symbol type="string" name="number_picker_increment_scroll_mode" />
+  <java-symbol type="string" name="numeric_date" />
+  <java-symbol type="string" name="numeric_date_format" />
+  <java-symbol type="string" name="numeric_date_template" />
+  <java-symbol type="string" name="numeric_md1_md2" />
+  <java-symbol type="string" name="numeric_md1_time1_md2_time2" />
+  <java-symbol type="string" name="numeric_mdy1_mdy2" />
+  <java-symbol type="string" name="numeric_mdy1_time1_mdy2_time2" />
+  <java-symbol type="string" name="numeric_wday1_md1_time1_wday2_md2_time2" />
+  <java-symbol type="string" name="numeric_wday1_md1_wday2_md2" />
+  <java-symbol type="string" name="numeric_wday1_mdy1_time1_wday2_mdy2_time2" />
+  <java-symbol type="string" name="numeric_wday1_mdy1_wday2_mdy2" />
+  <java-symbol type="string" name="old_app_action" />
+  <java-symbol type="string" name="old_app_description" />
+  <java-symbol type="string" name="older" />
+  <java-symbol type="string" name="open_permission_deny" />
+  <java-symbol type="string" name="orgTypeCustom" />
+  <java-symbol type="string" name="orgTypeOther" />
+  <java-symbol type="string" name="orgTypeWork" />
+  <java-symbol type="string" name="passwordIncorrect" />
+  <java-symbol type="string" name="permissions_format" />
+  <java-symbol type="string" name="perms_hide" />
+  <java-symbol type="string" name="perms_show_all" />
+  <java-symbol type="string" name="petabyteShort" />
+  <java-symbol type="string" name="phoneTypeAssistant" />
+  <java-symbol type="string" name="phoneTypeCallback" />
+  <java-symbol type="string" name="phoneTypeCar" />
+  <java-symbol type="string" name="phoneTypeCompanyMain" />
+  <java-symbol type="string" name="phoneTypeCustom" />
+  <java-symbol type="string" name="phoneTypeFaxHome" />
+  <java-symbol type="string" name="phoneTypeFaxWork" />
+  <java-symbol type="string" name="phoneTypeHome" />
+  <java-symbol type="string" name="phoneTypeIsdn" />
+  <java-symbol type="string" name="phoneTypeMain" />
+  <java-symbol type="string" name="phoneTypeMms" />
+  <java-symbol type="string" name="phoneTypeMobile" />
+  <java-symbol type="string" name="phoneTypeOther" />
+  <java-symbol type="string" name="phoneTypeOtherFax" />
+  <java-symbol type="string" name="phoneTypePager" />
+  <java-symbol type="string" name="phoneTypeRadio" />
+  <java-symbol type="string" name="phoneTypeTelex" />
+  <java-symbol type="string" name="phoneTypeTtyTdd" />
+  <java-symbol type="string" name="phoneTypeWork" />
+  <java-symbol type="string" name="phoneTypeWorkMobile" />
+  <java-symbol type="string" name="phoneTypeWorkPager" />
+  <java-symbol type="string" name="pm" />
+  <java-symbol type="string" name="policydesc_disableCamera" />
+  <java-symbol type="string" name="policydesc_encryptedStorage" />
+  <java-symbol type="string" name="policydesc_expirePassword" />
+  <java-symbol type="string" name="policydesc_forceLock" />
+  <java-symbol type="string" name="policydesc_limitPassword" />
+  <java-symbol type="string" name="policydesc_resetPassword" />
+  <java-symbol type="string" name="policydesc_setGlobalProxy" />
+  <java-symbol type="string" name="policydesc_watchLogin" />
+  <java-symbol type="string" name="policydesc_wipeData" />
+  <java-symbol type="string" name="policylab_disableCamera" />
+  <java-symbol type="string" name="policylab_encryptedStorage" />
+  <java-symbol type="string" name="policylab_expirePassword" />
+  <java-symbol type="string" name="policylab_forceLock" />
+  <java-symbol type="string" name="policylab_limitPassword" />
+  <java-symbol type="string" name="policylab_resetPassword" />
+  <java-symbol type="string" name="policylab_setGlobalProxy" />
+  <java-symbol type="string" name="policylab_watchLogin" />
+  <java-symbol type="string" name="policylab_wipeData" />
+  <java-symbol type="string" name="postalTypeCustom" />
+  <java-symbol type="string" name="postalTypeHome" />
+  <java-symbol type="string" name="postalTypeOther" />
+  <java-symbol type="string" name="postalTypeWork" />
+  <java-symbol type="string" name="power_off" />
+  <java-symbol type="string" name="preposition_for_date" />
+  <java-symbol type="string" name="preposition_for_time" />
+  <java-symbol type="string" name="progress_erasing" />
+  <java-symbol type="string" name="progress_unmounting" />
+  <java-symbol type="string" name="radiobutton_not_selected" />
+  <java-symbol type="string" name="radiobutton_selected" />
+  <java-symbol type="string" name="relationTypeAssistant" />
+  <java-symbol type="string" name="relationTypeBrother" />
+  <java-symbol type="string" name="relationTypeChild" />
+  <java-symbol type="string" name="relationTypeDomesticPartner" />
+  <java-symbol type="string" name="relationTypeFather" />
+  <java-symbol type="string" name="relationTypeFriend" />
+  <java-symbol type="string" name="relationTypeManager" />
+  <java-symbol type="string" name="relationTypeMother" />
+  <java-symbol type="string" name="relationTypeParent" />
+  <java-symbol type="string" name="relationTypePartner" />
+  <java-symbol type="string" name="relationTypeReferredBy" />
+  <java-symbol type="string" name="relationTypeRelative" />
+  <java-symbol type="string" name="relationTypeSister" />
+  <java-symbol type="string" name="relationTypeSpouse" />
+  <java-symbol type="string" name="relative_time" />
+  <java-symbol type="string" name="reset" />
+  <java-symbol type="string" name="ringtone_default" />
+  <java-symbol type="string" name="ringtone_default_with_actual" />
+  <java-symbol type="string" name="ringtone_picker_title" />
+  <java-symbol type="string" name="ringtone_silent" />
+  <java-symbol type="string" name="ringtone_unknown" />
+  <java-symbol type="string" name="roamingText0" />
+  <java-symbol type="string" name="roamingText1" />
+  <java-symbol type="string" name="roamingText10" />
+  <java-symbol type="string" name="roamingText11" />
+  <java-symbol type="string" name="roamingText12" />
+  <java-symbol type="string" name="roamingText2" />
+  <java-symbol type="string" name="roamingText3" />
+  <java-symbol type="string" name="roamingText4" />
+  <java-symbol type="string" name="roamingText5" />
+  <java-symbol type="string" name="roamingText6" />
+  <java-symbol type="string" name="roamingText7" />
+  <java-symbol type="string" name="roamingText8" />
+  <java-symbol type="string" name="roamingText9" />
+  <java-symbol type="string" name="roamingTextSearching" />
+  <java-symbol type="string" name="same_month_md1_md2" />
+  <java-symbol type="string" name="same_month_md1_time1_md2_time2" />
+  <java-symbol type="string" name="same_month_mdy1_mdy2" />
+  <java-symbol type="string" name="same_month_mdy1_time1_mdy2_time2" />
+  <java-symbol type="string" name="same_month_wday1_md1_time1_wday2_md2_time2" />
+  <java-symbol type="string" name="same_month_wday1_md1_wday2_md2" />
+  <java-symbol type="string" name="same_month_wday1_mdy1_time1_wday2_mdy2_time2" />
+  <java-symbol type="string" name="same_month_wday1_mdy1_wday2_mdy2" />
+  <java-symbol type="string" name="same_year_md1_md2" />
+  <java-symbol type="string" name="same_year_md1_time1_md2_time2" />
+  <java-symbol type="string" name="same_year_mdy1_mdy2" />
+  <java-symbol type="string" name="same_year_mdy1_time1_mdy2_time2" />
+  <java-symbol type="string" name="same_year_wday1_md1_time1_wday2_md2_time2" />
+  <java-symbol type="string" name="same_year_wday1_md1_wday2_md2" />
+  <java-symbol type="string" name="same_year_wday1_mdy1_time1_wday2_mdy2_time2" />
+  <java-symbol type="string" name="same_year_wday1_mdy1_wday2_mdy2" />
+  <java-symbol type="string" name="save_password_label" />
+  <java-symbol type="string" name="save_password_message" />
+  <java-symbol type="string" name="save_password_never" />
+  <java-symbol type="string" name="save_password_notnow" />
+  <java-symbol type="string" name="save_password_remember" />
+  <java-symbol type="string" name="sendText" />
+  <java-symbol type="string" name="sending" />
+  <java-symbol type="string" name="serviceClassData" />
+  <java-symbol type="string" name="serviceClassDataAsync" />
+  <java-symbol type="string" name="serviceClassDataSync" />
+  <java-symbol type="string" name="serviceClassFAX" />
+  <java-symbol type="string" name="serviceClassPAD" />
+  <java-symbol type="string" name="serviceClassPacket" />
+  <java-symbol type="string" name="serviceClassSMS" />
+  <java-symbol type="string" name="serviceClassVoice" />
+  <java-symbol type="string" name="serviceDisabled" />
+  <java-symbol type="string" name="serviceEnabled" />
+  <java-symbol type="string" name="serviceEnabledFor" />
+  <java-symbol type="string" name="serviceErased" />
+  <java-symbol type="string" name="serviceNotProvisioned" />
+  <java-symbol type="string" name="serviceRegistered" />
+  <java-symbol type="string" name="setup_autofill" />
+  <java-symbol type="string" name="shareactionprovider_share_with" />
+  <java-symbol type="string" name="shareactionprovider_share_with_application" />
+  <java-symbol type="string" name="short_format_month" />
+  <java-symbol type="string" name="shutdown_confirm" />
+  <java-symbol type="string" name="shutdown_confirm_question" />
+  <java-symbol type="string" name="shutdown_progress" />
+  <java-symbol type="string" name="sim_added_message" />
+  <java-symbol type="string" name="sim_added_title" />
+  <java-symbol type="string" name="sim_removed_message" />
+  <java-symbol type="string" name="sim_removed_title" />
+  <java-symbol type="string" name="sim_restart_button" />
+  <java-symbol type="string" name="sipAddressTypeCustom" />
+  <java-symbol type="string" name="sipAddressTypeHome" />
+  <java-symbol type="string" name="sipAddressTypeOther" />
+  <java-symbol type="string" name="sipAddressTypeWork" />
+  <java-symbol type="string" name="sms_control_default_app_name" />
+  <java-symbol type="string" name="sms_control_message" />
+  <java-symbol type="string" name="sms_control_no" />
+  <java-symbol type="string" name="sms_control_title" />
+  <java-symbol type="string" name="sms_control_yes" />
+  <java-symbol type="string" name="submit" />
+  <java-symbol type="string" name="switch_off" />
+  <java-symbol type="string" name="switch_on" />
+  <java-symbol type="string" name="sync_binding_label" />
+  <java-symbol type="string" name="sync_do_nothing" />
+  <java-symbol type="string" name="sync_really_delete" />
+  <java-symbol type="string" name="sync_too_many_deletes_desc" />
+  <java-symbol type="string" name="sync_undo_deletes" />
+  <java-symbol type="string" name="terabyteShort" />
+  <java-symbol type="string" name="text_copied" />
+  <java-symbol type="string" name="time1_time2" />
+  <java-symbol type="string" name="time_date" />
+  <java-symbol type="string" name="time_of_day" />
+  <java-symbol type="string" name="time_picker_decrement_hour_button" />
+  <java-symbol type="string" name="time_picker_decrement_minute_button" />
+  <java-symbol type="string" name="time_picker_decrement_set_am_button" />
+  <java-symbol type="string" name="time_picker_dialog_title" />
+  <java-symbol type="string" name="time_picker_increment_hour_button" />
+  <java-symbol type="string" name="time_picker_increment_minute_button" />
+  <java-symbol type="string" name="time_picker_increment_set_pm_button" />
+  <java-symbol type="string" name="time_picker_separator" />
+  <java-symbol type="string" name="time_wday" />
+  <java-symbol type="string" name="time_wday_date" />
+  <java-symbol type="string" name="today" />
+  <java-symbol type="string" name="togglebutton_not_pressed" />
+  <java-symbol type="string" name="togglebutton_pressed" />
+  <java-symbol type="string" name="tomorrow" />
+  <java-symbol type="string" name="twelve_hour_time_format" />
+  <java-symbol type="string" name="twenty_four_hour_time_format" />
+  <java-symbol type="string" name="upload_file" />
+  <java-symbol type="string" name="volume_alarm" />
+  <java-symbol type="string" name="volume_icon_description_bluetooth" />
+  <java-symbol type="string" name="volume_icon_description_incall" />
+  <java-symbol type="string" name="volume_icon_description_media" />
+  <java-symbol type="string" name="volume_icon_description_notification" />
+  <java-symbol type="string" name="volume_icon_description_ringer" />
+  <java-symbol type="string" name="wait" />
+  <java-symbol type="string" name="wday1_date1_time1_wday2_date2_time2" />
+  <java-symbol type="string" name="wday1_date1_wday2_date2" />
+  <java-symbol type="string" name="wday_date" />
+  <java-symbol type="string" name="web_user_agent" />
+  <java-symbol type="string" name="web_user_agent_target_content" />
+  <java-symbol type="string" name="webpage_unresponsive" />
+  <java-symbol type="string" name="whichApplication" />
+  <java-symbol type="string" name="wifi_available_sign_in" />
+  <java-symbol type="string" name="wifi_available_sign_in_detailed" />
+  <java-symbol type="string" name="wifi_p2p_dialog_title" />
+  <java-symbol type="string" name="wifi_p2p_enabled_notification_message" />
+  <java-symbol type="string" name="wifi_p2p_enabled_notification_title" />
+  <java-symbol type="string" name="wifi_p2p_failed_message" />
+  <java-symbol type="string" name="wifi_p2p_from_message" />
+  <java-symbol type="string" name="wifi_p2p_invitation_sent_title" />
+  <java-symbol type="string" name="wifi_p2p_invitation_to_connect_title" />
+  <java-symbol type="string" name="wifi_p2p_show_pin_message" />
+  <java-symbol type="string" name="wifi_p2p_to_message" />
+  <java-symbol type="string" name="wifi_p2p_turnon_message" />
+  <java-symbol type="string" name="wifi_tether_configure_ssid_default" />
+  <java-symbol type="string" name="wifi_watchdog_network_disabled" />
+  <java-symbol type="string" name="wifi_watchdog_network_disabled_detailed" />
+  <java-symbol type="string" name="yesterday" />
+
+  <java-symbol type="plurals" name="abbrev_in_num_days" />
+  <java-symbol type="plurals" name="abbrev_in_num_hours" />
+  <java-symbol type="plurals" name="abbrev_in_num_minutes" />
+  <java-symbol type="plurals" name="abbrev_in_num_seconds" />
+  <java-symbol type="plurals" name="abbrev_num_days_ago" />
+  <java-symbol type="plurals" name="abbrev_num_hours_ago" />
+  <java-symbol type="plurals" name="abbrev_num_minutes_ago" />
+  <java-symbol type="plurals" name="abbrev_num_seconds_ago" />
+  <java-symbol type="plurals" name="in_num_days" />
+  <java-symbol type="plurals" name="in_num_hours" />
+  <java-symbol type="plurals" name="in_num_minutes" />
+  <java-symbol type="plurals" name="in_num_seconds" />
+  <java-symbol type="plurals" name="last_num_days" />
+  <java-symbol type="plurals" name="matches_found" />
+  <java-symbol type="plurals" name="num_days_ago" />
+  <java-symbol type="plurals" name="num_hours_ago" />
+  <java-symbol type="plurals" name="num_minutes_ago" />
+  <java-symbol type="plurals" name="num_seconds_ago" />
+
+  <java-symbol type="array" name="carrier_properties" />
+  <java-symbol type="array" name="config_data_usage_network_types" />
+  <java-symbol type="array" name="config_sms_enabled_locking_shift_tables" />
+  <java-symbol type="array" name="config_sms_enabled_single_shift_tables" />
+  <java-symbol type="array" name="config_twoDigitNumberPattern" />
+  <java-symbol type="array" name="networkAttributes" />
+  <java-symbol type="array" name="preloaded_color_state_lists" />
+  <java-symbol type="array" name="preloaded_drawables" />
+  <java-symbol type="array" name="special_locale_codes" />
+  <java-symbol type="array" name="special_locale_names" />
+
+  <java-symbol type="drawable" name="default_wallpaper" />
+  <java-symbol type="drawable" name="ic_suggestions_add" />
+  <java-symbol type="drawable" name="ic_suggestions_delete" />
+  <java-symbol type="drawable" name="indicator_input_error" />
+  <java-symbol type="drawable" name="overscroll_edge" />
+  <java-symbol type="drawable" name="overscroll_glow" />
+  <java-symbol type="drawable" name="popup_bottom_dark" />
+  <java-symbol type="drawable" name="popup_bottom_bright" />
+  <java-symbol type="drawable" name="popup_bottom_medium" />
+  <java-symbol type="drawable" name="popup_center_dark" />
+  <java-symbol type="drawable" name="popup_center_bright" />
+  <java-symbol type="drawable" name="popup_full_dark" />
+  <java-symbol type="drawable" name="popup_full_bright" />
+  <java-symbol type="drawable" name="popup_top_dark" />
+  <java-symbol type="drawable" name="popup_top_bright" />
+  <java-symbol type="drawable" name="search_spinner" />
+  <java-symbol type="drawable" name="sym_app_on_sd_unavailable_icon" />
+  <java-symbol type="drawable" name="text_edit_side_paste_window" />
+  <java-symbol type="drawable" name="text_edit_paste_window" />
+  <java-symbol type="drawable" name="btn_check_off" />
+  <java-symbol type="drawable" name="btn_code_lock_default_holo" />
+  <java-symbol type="drawable" name="btn_code_lock_touched_holo" />
+  <java-symbol type="drawable" name="clock_dial" />
+  <java-symbol type="drawable" name="clock_hand_hour" />
+  <java-symbol type="drawable" name="clock_hand_minute" />
+  <java-symbol type="drawable" name="emo_im_angel" />
+  <java-symbol type="drawable" name="emo_im_cool" />
+  <java-symbol type="drawable" name="emo_im_crying" />
+  <java-symbol type="drawable" name="emo_im_embarrassed" />
+  <java-symbol type="drawable" name="emo_im_foot_in_mouth" />
+  <java-symbol type="drawable" name="emo_im_happy" />
+  <java-symbol type="drawable" name="emo_im_kissing" />
+  <java-symbol type="drawable" name="emo_im_laughing" />
+  <java-symbol type="drawable" name="emo_im_lips_are_sealed" />
+  <java-symbol type="drawable" name="emo_im_money_mouth" />
+  <java-symbol type="drawable" name="emo_im_sad" />
+  <java-symbol type="drawable" name="emo_im_surprised" />
+  <java-symbol type="drawable" name="emo_im_tongue_sticking_out" />
+  <java-symbol type="drawable" name="emo_im_undecided" />
+  <java-symbol type="drawable" name="emo_im_winking" />
+  <java-symbol type="drawable" name="emo_im_wtf" />
+  <java-symbol type="drawable" name="emo_im_yelling" />
+  <java-symbol type="drawable" name="expander_close_holo_dark" />
+  <java-symbol type="drawable" name="expander_open_holo_dark" />
+  <java-symbol type="drawable" name="ic_audio_alarm" />
+  <java-symbol type="drawable" name="ic_audio_alarm_mute" />
+  <java-symbol type="drawable" name="ic_audio_bt" />
+  <java-symbol type="drawable" name="ic_audio_bt_mute" />
+  <java-symbol type="drawable" name="ic_audio_notification" />
+  <java-symbol type="drawable" name="ic_audio_notification_mute" />
+  <java-symbol type="drawable" name="ic_audio_phone" />
+  <java-symbol type="drawable" name="ic_audio_ring_notif" />
+  <java-symbol type="drawable" name="ic_audio_ring_notif_mute" />
+  <java-symbol type="drawable" name="ic_audio_ring_notif_vibrate" />
+  <java-symbol type="drawable" name="ic_audio_vol" />
+  <java-symbol type="drawable" name="ic_audio_vol_mute" />
+  <java-symbol type="drawable" name="ic_bullet_key_permission" />
+  <java-symbol type="drawable" name="ic_contact_picture" />
+  <java-symbol type="drawable" name="ic_dialog_usb" />
+  <java-symbol type="drawable" name="ic_emergency" />
+  <java-symbol type="drawable" name="ic_media_stop" />
+  <java-symbol type="drawable" name="ic_text_dot" />
+  <java-symbol type="drawable" name="indicator_code_lock_drag_direction_green_up" />
+  <java-symbol type="drawable" name="indicator_code_lock_drag_direction_red_up" />
+  <java-symbol type="drawable" name="indicator_code_lock_point_area_default_holo" />
+  <java-symbol type="drawable" name="indicator_code_lock_point_area_green_holo" />
+  <java-symbol type="drawable" name="indicator_code_lock_point_area_red_holo" />
+  <java-symbol type="drawable" name="jog_dial_arrow_long_left_green" />
+  <java-symbol type="drawable" name="jog_dial_arrow_long_right_red" />
+  <java-symbol type="drawable" name="jog_dial_arrow_short_left_and_right" />
+  <java-symbol type="drawable" name="jog_dial_bg" />
+  <java-symbol type="drawable" name="jog_dial_dimple" />
+  <java-symbol type="drawable" name="jog_dial_dimple_dim" />
+  <java-symbol type="drawable" name="jog_tab_bar_left_generic" />
+  <java-symbol type="drawable" name="jog_tab_bar_right_generic" />
+  <java-symbol type="drawable" name="jog_tab_left_generic" />
+  <java-symbol type="drawable" name="jog_tab_right_generic" />
+  <java-symbol type="drawable" name="jog_tab_target_gray" />
+  <java-symbol type="drawable" name="picture_emergency" />
+  <java-symbol type="drawable" name="platlogo" />
+  <java-symbol type="drawable" name="stat_notify_sync_error" />
+  <java-symbol type="drawable" name="stat_notify_wifi_in_range" />
+  <java-symbol type="drawable" name="stat_sys_gps_on" />
+  <java-symbol type="drawable" name="stat_sys_tether_wifi" />
+  <java-symbol type="drawable" name="status_bar_background" />
+  <java-symbol type="drawable" name="sym_keyboard_shift" />
+  <java-symbol type="drawable" name="sym_keyboard_shift_locked" />
+  <java-symbol type="drawable" name="tab_bottom_left" />
+  <java-symbol type="drawable" name="tab_bottom_left_v4" />
+  <java-symbol type="drawable" name="tab_bottom_right" />
+  <java-symbol type="drawable" name="tab_bottom_right_v4" />
+  <java-symbol type="drawable" name="tab_indicator_v4" />
+  <java-symbol type="drawable" name="text_select_handle_left" />
+  <java-symbol type="drawable" name="text_select_handle_right" />
+  <java-symbol type="drawable" name="unknown_image" />
+  <java-symbol type="drawable" name="unlock_default" />
+  <java-symbol type="drawable" name="unlock_halo" />
+  <java-symbol type="drawable" name="unlock_ring" />
+  <java-symbol type="drawable" name="unlock_wave" />
+
+  <java-symbol type="layout" name="action_bar_home" />
+  <java-symbol type="layout" name="action_bar_title_item" />
+  <java-symbol type="layout" name="action_menu_item_layout" />
+  <java-symbol type="layout" name="action_menu_layout" />
+  <java-symbol type="layout" name="action_mode_close_item" />
+  <java-symbol type="layout" name="alert_dialog" />
+  <java-symbol type="layout" name="choose_account" />
+  <java-symbol type="layout" name="choose_account_row" />
+  <java-symbol type="layout" name="choose_account_type" />
+  <java-symbol type="layout" name="choose_selected_account_row" />
+  <java-symbol type="layout" name="choose_type_and_account" />
+  <java-symbol type="layout" name="grant_credentials_permission" />
+  <java-symbol type="layout" name="number_picker" />
+  <java-symbol type="layout" name="permissions_package_list_item" />
+  <java-symbol type="layout" name="popup_menu_item_layout" />
+  <java-symbol type="layout" name="remote_views_adapter_default_loading_view" />
+  <java-symbol type="layout" name="search_bar" />
+  <java-symbol type="layout" name="search_dropdown_item_icons_2line" />
+  <java-symbol type="layout" name="search_view" />
+  <java-symbol type="layout" name="select_dialog" />
+  <java-symbol type="layout" name="simple_dropdown_hint" />
+  <java-symbol type="layout" name="status_bar_latest_event_content" />
+  <java-symbol type="layout" name="status_bar_latest_event_content_large_icon" />
+  <java-symbol type="layout" name="status_bar_latest_event_ticker" />
+  <java-symbol type="layout" name="status_bar_latest_event_ticker_large_icon" />
+  <java-symbol type="layout" name="text_edit_action_popup_text" />
+  <java-symbol type="layout" name="text_drag_thumbnail" />
+  <java-symbol type="layout" name="typing_filter" />
+  <java-symbol type="layout" name="activity_chooser_view" />
+  <java-symbol type="layout" name="activity_chooser_view_list_item" />
+  <java-symbol type="layout" name="activity_list" />
+  <java-symbol type="layout" name="activity_list_item_2" />
+  <java-symbol type="layout" name="alert_dialog_progress" />
+  <java-symbol type="layout" name="always_use_checkbox" />
+  <java-symbol type="layout" name="app_permission_item" />
+  <java-symbol type="layout" name="app_perms_summary" />
+  <java-symbol type="layout" name="calendar_view" />
+  <java-symbol type="layout" name="character_picker" />
+  <java-symbol type="layout" name="character_picker_button" />
+  <java-symbol type="layout" name="date_picker" />
+  <java-symbol type="layout" name="date_picker_dialog" />
+  <java-symbol type="layout" name="expanded_menu_layout" />
+  <java-symbol type="layout" name="fragment_bread_crumb_item" />
+  <java-symbol type="layout" name="fragment_bread_crumbs" />
+  <java-symbol type="layout" name="heavy_weight_switcher" />
+  <java-symbol type="layout" name="icon_menu_item_layout" />
+  <java-symbol type="layout" name="icon_menu_layout" />
+  <java-symbol type="layout" name="input_method" />
+  <java-symbol type="layout" name="input_method_extract_view" />
+  <java-symbol type="layout" name="js_prompt" />
+  <java-symbol type="layout" name="list_content_simple" />
+  <java-symbol type="layout" name="list_menu_item_checkbox" />
+  <java-symbol type="layout" name="list_menu_item_icon" />
+  <java-symbol type="layout" name="list_menu_item_layout" />
+  <java-symbol type="layout" name="list_menu_item_radio" />
+  <java-symbol type="layout" name="locale_picker_item" />
+  <java-symbol type="layout" name="media_controller" />
+  <java-symbol type="layout" name="preference" />
+  <java-symbol type="layout" name="preference_header_item" />
+  <java-symbol type="layout" name="preference_list_content" />
+  <java-symbol type="layout" name="preference_list_content_single" />
+  <java-symbol type="layout" name="preference_list_fragment" />
+  <java-symbol type="layout" name="preference_widget_seekbar" />
+  <java-symbol type="layout" name="progress_dialog" />
+  <java-symbol type="layout" name="resolve_list_item" />
+  <java-symbol type="layout" name="seekbar_dialog" />
+  <java-symbol type="layout" name="select_dialog_singlechoice_holo" />
+  <java-symbol type="layout" name="ssl_certificate" />
+  <java-symbol type="layout" name="tab_content" />
+  <java-symbol type="layout" name="tab_indicator_holo" />
+  <java-symbol type="layout" name="textview_hint" />
+  <java-symbol type="layout" name="time_picker" />
+  <java-symbol type="layout" name="time_picker_dialog" />
+  <java-symbol type="layout" name="transient_notification" />
+  <java-symbol type="layout" name="volume_adjust" />
+  <java-symbol type="layout" name="volume_adjust_item" />
+  <java-symbol type="layout" name="web_text_view_dropdown" />
+  <java-symbol type="layout" name="webview_find" />
+  <java-symbol type="layout" name="webview_select_singlechoice" />
+  <java-symbol type="layout" name="wifi_p2p_dialog" />
+  <java-symbol type="layout" name="wifi_p2p_dialog_row" />
+  <java-symbol type="layout" name="zoom_container" />
+  <java-symbol type="layout" name="zoom_controls" />
+  <java-symbol type="layout" name="zoom_magnify" />
+
+  <java-symbol type="anim" name="slide_in_child_bottom" />
+  <java-symbol type="anim" name="slide_in_right" />
+  <java-symbol type="anim" name="slide_out_left" />
+
+  <java-symbol type="menu" name="webview_copy" />
+  <java-symbol type="menu" name="webview_find" />
+
+  <java-symbol type="xml" name="password_kbd_qwerty" />
+  <java-symbol type="xml" name="autotext" />
+  <java-symbol type="xml" name="eri" />
+  <java-symbol type="xml" name="password_kbd_numeric" />
+  <java-symbol type="xml" name="password_kbd_qwerty_shifted" />
+  <java-symbol type="xml" name="password_kbd_symbols" />
+  <java-symbol type="xml" name="password_kbd_symbols_shift" />
+  <java-symbol type="xml" name="power_profile" />
+  <java-symbol type="xml" name="time_zones_by_country" />
+
+  <java-symbol type="raw" name="incognito_mode_start_page" />
+  <java-symbol type="raw" name="loaderror" />
+  <java-symbol type="raw" name="nodomain" />
+
+  <java-symbol type="style" name="Animation.DropDownUp" />
+  <java-symbol type="style" name="Animation.DropDownDown" />
+  <java-symbol type="style" name="Animation.PopupWindow" />
+  <java-symbol type="style" name="Animation.TypingFilter" />
+  <java-symbol type="style" name="Animation.TypingFilterRestore" />
+  <java-symbol type="style" name="Theme.DeviceDefault.Dialog.Alert" />
+  <java-symbol type="style" name="Theme.DeviceDefault.Light.Dialog.Alert" />
+  <java-symbol type="style" name="Theme.Dialog.Alert" />
+  <java-symbol type="style" name="Theme.Holo.Dialog.Alert" />
+  <java-symbol type="style" name="Theme.Holo.Light.Dialog.Alert" />
+  <java-symbol type="style" name="ActiveWallpaperSettings" />
+  <java-symbol type="style" name="Animation.InputMethodFancy" />
+  <java-symbol type="style" name="Animation.Wallpaper" />
+  <java-symbol type="style" name="Animation.ZoomButtons" />
+  <java-symbol type="style" name="PreviewWallpaperSettings" />
+  <java-symbol type="style" name="TextAppearance.SlidingTabActive" />
+  <java-symbol type="style" name="TextAppearance.SlidingTabNormal" />
+  <java-symbol type="style" name="Theme.DeviceDefault.Dialog.NoFrame" />
+  <java-symbol type="style" name="Theme.IconMenu" />
+  <java-symbol type="style" name="Theme.Panel.Volume" />
+
+  <!-- From android.policy -->
+  <java-symbol type="anim" name="app_starting_exit" />
+  <java-symbol type="anim" name="lock_screen_behind_enter" />
+  <java-symbol type="array" name="config_keyboardTapVibePattern" />
+  <java-symbol type="array" name="config_longPressVibePattern" />
+  <java-symbol type="array" name="config_safeModeDisabledVibePattern" />
+  <java-symbol type="array" name="config_safeModeEnabledVibePattern" />
+  <java-symbol type="array" name="config_virtualKeyVibePattern" />
+  <java-symbol type="array" name="lockscreen_targets_when_silent" />
+  <java-symbol type="array" name="lockscreen_targets_when_soundon" />
+  <java-symbol type="array" name="lockscreen_targets_with_camera" />
+  <java-symbol type="attr" name="actionModePopupWindowStyle" />
+  <java-symbol type="attr" name="dialogCustomTitleDecorLayout" />
+  <java-symbol type="attr" name="dialogTitleDecorLayout" />
+  <java-symbol type="attr" name="dialogTitleIconsDecorLayout" />
+  <java-symbol type="bool" name="config_allowAllRotations" />
+  <java-symbol type="bool" name="config_bypass_keyguard_if_slider_open" />
+  <java-symbol type="bool" name="config_carDockEnablesAccelerometer" />
+  <java-symbol type="bool" name="config_deskDockEnablesAccelerometer" />
+  <java-symbol type="bool" name="config_disableMenuKeyInLockScreen" />
+  <java-symbol type="bool" name="config_enableLockBeforeUnlockScreen" />
+  <java-symbol type="bool" name="config_enableLockScreenRotation" />
+  <java-symbol type="bool" name="config_reverseDefaultRotation" />
+  <java-symbol type="bool" name="config_showNavigationBar" />
+  <java-symbol type="bool" name="target_honeycomb_needs_options_menu" />
+  <java-symbol type="dimen" name="navigation_bar_height" />
+  <java-symbol type="dimen" name="navigation_bar_width" />
+  <java-symbol type="dimen" name="status_bar_height" />
+  <java-symbol type="dimen" name="system_bar_height" />
+  <java-symbol type="drawable" name="ic_jog_dial_sound_off" />
+  <java-symbol type="drawable" name="ic_jog_dial_sound_on" />
+  <java-symbol type="drawable" name="ic_jog_dial_unlock" />
+  <java-symbol type="drawable" name="ic_jog_dial_vibrate_on" />
+  <java-symbol type="drawable" name="ic_lock_airplane_mode" />
+  <java-symbol type="drawable" name="ic_lock_airplane_mode_off" />
+  <java-symbol type="drawable" name="ic_menu_cc" />
+  <java-symbol type="drawable" name="jog_tab_bar_left_unlock" />
+  <java-symbol type="drawable" name="jog_tab_bar_right_sound_off" />
+  <java-symbol type="drawable" name="jog_tab_bar_right_sound_on" />
+  <java-symbol type="drawable" name="jog_tab_left_unlock" />
+  <java-symbol type="drawable" name="jog_tab_right_sound_off" />
+  <java-symbol type="drawable" name="jog_tab_right_sound_on" />
+  <java-symbol type="drawable" name="jog_tab_target_green" />
+  <java-symbol type="drawable" name="jog_tab_target_yellow" />
+  <java-symbol type="drawable" name="menu_background" />
+  <java-symbol type="drawable" name="stat_sys_secure" />
+  <java-symbol type="id" name="action_mode_bar_stub" />
+  <java-symbol type="id" name="alarm_status" />
+  <java-symbol type="id" name="backspace" />
+  <java-symbol type="id" name="button0" />
+  <java-symbol type="id" name="button4" />
+  <java-symbol type="id" name="button5" />
+  <java-symbol type="id" name="button6" />
+  <java-symbol type="id" name="button7" />
+  <java-symbol type="id" name="carrier" />
+  <java-symbol type="id" name="date" />
+  <java-symbol type="id" name="eight" />
+  <java-symbol type="id" name="emergencyCallButton" />
+  <java-symbol type="id" name="faceLockAreaView" />
+  <java-symbol type="id" name="five" />
+  <java-symbol type="id" name="forgotPatternButton" />
+  <java-symbol type="id" name="four" />
+  <java-symbol type="id" name="headerText" />
+  <java-symbol type="id" name="icon_menu_presenter" />
+  <java-symbol type="id" name="instructions" />
+  <java-symbol type="id" name="keyboard" />
+  <java-symbol type="id" name="list_menu_presenter" />
+  <java-symbol type="id" name="lockPattern" />
+  <java-symbol type="id" name="lock_screen" />
+  <java-symbol type="id" name="login" />
+  <java-symbol type="id" name="nine" />
+  <java-symbol type="id" name="no_applications_message" />
+  <java-symbol type="id" name="ok" />
+  <java-symbol type="id" name="one" />
+  <java-symbol type="id" name="option1" />
+  <java-symbol type="id" name="option2" />
+  <java-symbol type="id" name="option3" />
+  <java-symbol type="id" name="password" />
+  <java-symbol type="id" name="passwordEntry" />
+  <java-symbol type="id" name="pinDel" />
+  <java-symbol type="id" name="pinDisplay" />
+  <java-symbol type="id" name="propertyOf" />
+  <java-symbol type="id" name="pukDel" />
+  <java-symbol type="id" name="pukDisplay" />
+  <java-symbol type="id" name="right_icon" />
+  <java-symbol type="id" name="seven" />
+  <java-symbol type="id" name="six" />
+  <java-symbol type="id" name="status" />
+  <java-symbol type="id" name="status1" />
+  <java-symbol type="id" name="switch_ime_button" />
+  <java-symbol type="id" name="three" />
+  <java-symbol type="id" name="title_container" />
+  <java-symbol type="id" name="topHeader" />
+  <java-symbol type="id" name="transport" />
+  <java-symbol type="id" name="transport_bg_protect" />
+  <java-symbol type="id" name="two" />
+  <java-symbol type="id" name="unlock_widget" />
+  <java-symbol type="id" name="zero" />
+  <java-symbol type="integer" name="config_carDockRotation" />
+  <java-symbol type="integer" name="config_defaultUiModeType" />
+  <java-symbol type="integer" name="config_deskDockRotation" />
+  <java-symbol type="integer" name="config_lidKeyboardAccessibility" />
+  <java-symbol type="integer" name="config_lidNavigationAccessibility" />
+  <java-symbol type="integer" name="config_lidOpenRotation" />
+  <java-symbol type="integer" name="config_longPressOnHomeBehavior" />
+  <java-symbol type="layout" name="global_actions_item" />
+  <java-symbol type="layout" name="global_actions_silent_mode" />
+  <java-symbol type="layout" name="keyguard_screen_glogin_unlock" />
+  <java-symbol type="layout" name="keyguard_screen_password_landscape" />
+  <java-symbol type="layout" name="keyguard_screen_password_portrait" />
+  <java-symbol type="layout" name="keyguard_screen_sim_pin_landscape" />
+  <java-symbol type="layout" name="keyguard_screen_sim_pin_portrait" />
+  <java-symbol type="layout" name="keyguard_screen_sim_puk_landscape" />
+  <java-symbol type="layout" name="keyguard_screen_sim_puk_portrait" />
+  <java-symbol type="layout" name="keyguard_screen_tab_unlock" />
+  <java-symbol type="layout" name="keyguard_screen_tab_unlock_land" />
+  <java-symbol type="layout" name="keyguard_screen_unlock_landscape" />
+  <java-symbol type="layout" name="keyguard_screen_unlock_portrait" />
+  <java-symbol type="layout" name="recent_apps_dialog" />
+  <java-symbol type="layout" name="screen_action_bar" />
+  <java-symbol type="layout" name="screen_action_bar_overlay" />
+  <java-symbol type="layout" name="screen_custom_title" />
+  <java-symbol type="layout" name="screen_progress" />
+  <java-symbol type="layout" name="screen_simple" />
+  <java-symbol type="layout" name="screen_simple_overlay_action_mode" />
+  <java-symbol type="layout" name="screen_title" />
+  <java-symbol type="layout" name="screen_title_icons" />
+  <java-symbol type="string" name="abbrev_wday_month_day_no_year" />
+  <java-symbol type="string" name="android_upgrading_title" />
+  <java-symbol type="string" name="config_defaultDreamComponent" />
+  <java-symbol type="string" name="faceunlock_multiple_failures" />
+  <java-symbol type="string" name="global_action_power_off" />
+  <java-symbol type="string" name="global_actions_airplane_mode_off_status" />
+  <java-symbol type="string" name="global_actions_airplane_mode_on_status" />
+  <java-symbol type="string" name="global_actions_toggle_airplane_mode" />
+  <java-symbol type="string" name="invalidPuk" />
+  <java-symbol type="string" name="keyguard_password_enter_pin_code" />
+  <java-symbol type="string" name="keyguard_password_enter_puk_code" />
+  <java-symbol type="string" name="keyguard_password_wrong_pin_code" />
+  <java-symbol type="string" name="lockscreen_carrier_default" />
+  <java-symbol type="string" name="lockscreen_charged" />
+  <java-symbol type="string" name="lockscreen_failed_attempts_almost_at_wipe" />
+  <java-symbol type="string" name="lockscreen_failed_attempts_almost_glogin" />
+  <java-symbol type="string" name="lockscreen_failed_attempts_now_wiping" />
+  <java-symbol type="string" name="lockscreen_forgot_pattern_button_text" />
+  <java-symbol type="string" name="lockscreen_glogin_checking_password" />
+  <java-symbol type="string" name="lockscreen_glogin_forgot_pattern" />
+  <java-symbol type="string" name="lockscreen_glogin_invalid_input" />
+  <java-symbol type="string" name="lockscreen_glogin_too_many_attempts" />
+  <java-symbol type="string" name="lockscreen_instructions_when_pattern_disabled" />
+  <java-symbol type="string" name="lockscreen_low_battery" />
+  <java-symbol type="string" name="lockscreen_missing_sim_instructions" />
+  <java-symbol type="string" name="lockscreen_missing_sim_instructions_long" />
+  <java-symbol type="string" name="lockscreen_missing_sim_message_short" />
+  <java-symbol type="string" name="lockscreen_network_locked_message" />
+  <java-symbol type="string" name="lockscreen_password_wrong" />
+  <java-symbol type="string" name="lockscreen_pattern_instructions" />
+  <java-symbol type="string" name="lockscreen_pattern_wrong" />
+  <java-symbol type="string" name="lockscreen_permanent_disabled_sim_instructions" />
+  <java-symbol type="string" name="lockscreen_plugged_in" />
+  <java-symbol type="string" name="lockscreen_sim_locked_message" />
+  <java-symbol type="string" name="lockscreen_sim_puk_locked_message" />
+  <java-symbol type="string" name="lockscreen_sim_unlock_progress_dialog_message" />
+  <java-symbol type="string" name="lockscreen_sound_off_label" />
+  <java-symbol type="string" name="lockscreen_sound_on_label" />
+  <java-symbol type="string" name="lockscreen_too_many_failed_attempts_countdown" />
+  <java-symbol type="string" name="lockscreen_too_many_failed_attempts_dialog_message" />
+  <java-symbol type="string" name="lockscreen_too_many_failed_password_attempts_dialog_message" />
+  <java-symbol type="string" name="lockscreen_too_many_failed_pin_attempts_dialog_message" />
+  <java-symbol type="string" name="lockscreen_unlock_label" />
+  <java-symbol type="string" name="status_bar_device_locked" />
+  <java-symbol type="style" name="Animation.LockScreen" />
+  <java-symbol type="style" name="Theme.Dialog.RecentApplications" />
+  <java-symbol type="style" name="Theme.ExpandedMenu" />
+
+  <!-- From services -->
+  <java-symbol type="anim" name="screen_rotate_0_enter" />
+  <java-symbol type="anim" name="screen_rotate_0_exit" />
+  <java-symbol type="anim" name="screen_rotate_180_enter" />
+  <java-symbol type="anim" name="screen_rotate_180_exit" />
+  <java-symbol type="anim" name="screen_rotate_finish_enter" />
+  <java-symbol type="anim" name="screen_rotate_finish_exit" />
+  <java-symbol type="anim" name="screen_rotate_minus_90_enter" />
+  <java-symbol type="anim" name="screen_rotate_minus_90_exit" />
+  <java-symbol type="anim" name="screen_rotate_plus_90_enter" />
+  <java-symbol type="anim" name="screen_rotate_plus_90_exit" />
+  <java-symbol type="anim" name="screen_rotate_start_enter" />
+  <java-symbol type="anim" name="screen_rotate_start_exit" />
+  <java-symbol type="anim" name="window_move_from_decor" />
+  <java-symbol type="array" name="config_autoBrightnessButtonBacklightValues" />
+  <java-symbol type="array" name="config_autoBrightnessKeyboardBacklightValues" />
+  <java-symbol type="array" name="config_autoBrightnessLcdBacklightValues" />
+  <java-symbol type="array" name="config_autoBrightnessLevels" />
+  <java-symbol type="array" name="config_protectedNetworks" />
+  <java-symbol type="array" name="config_statusBarIcons" />
+  <java-symbol type="array" name="config_tether_bluetooth_regexs" />
+  <java-symbol type="array" name="config_tether_dhcp_range" />
+  <java-symbol type="array" name="config_tether_upstream_types" />
+  <java-symbol type="array" name="config_tether_usb_regexs" />
+  <java-symbol type="array" name="config_tether_wifi_regexs" />
+  <java-symbol type="array" name="config_usbHostBlacklist" />
+  <java-symbol type="array" name="radioAttributes" />
+  <java-symbol type="bool" name="config_animateScreenLights" />
+  <java-symbol type="bool" name="config_automatic_brightness_available" />
+  <java-symbol type="bool" name="config_sf_limitedAlpha" />
+  <java-symbol type="bool" name="config_unplugTurnsOnScreen" />
+  <java-symbol type="bool" name="config_wifi_background_scan_support" />
+  <java-symbol type="bool" name="config_wifi_dual_band_support" />
+  <java-symbol type="bool" name="config_wimaxEnabled" />
+  <java-symbol type="bool" name="show_ongoing_ime_switcher" />
+  <java-symbol type="color" name="config_defaultNotificationColor" />
+  <java-symbol type="drawable" name="ic_notification_ime_default" />
+  <java-symbol type="drawable" name="stat_notify_car_mode" />
+  <java-symbol type="drawable" name="stat_notify_disabled" />
+  <java-symbol type="drawable" name="stat_notify_disk_full" />
+  <java-symbol type="drawable" name="stat_sys_adb" />
+  <java-symbol type="drawable" name="stat_sys_battery" />
+  <java-symbol type="drawable" name="stat_sys_battery_charge" />
+  <java-symbol type="drawable" name="stat_sys_battery_unknown" />
+  <java-symbol type="drawable" name="stat_sys_data_usb" />
+  <java-symbol type="drawable" name="stat_sys_tether_bluetooth" />
+  <java-symbol type="drawable" name="stat_sys_tether_general" />
+  <java-symbol type="drawable" name="stat_sys_tether_usb" />
+  <java-symbol type="drawable" name="stat_sys_throttled" />
+  <java-symbol type="drawable" name="vpn_connected" />
+  <java-symbol type="id" name="ask_checkbox" />
+  <java-symbol type="id" name="compat_checkbox" />
+  <java-symbol type="id" name="original_app_icon" />
+  <java-symbol type="id" name="original_message" />
+  <java-symbol type="id" name="radio" />
+  <java-symbol type="id" name="reask_hint" />
+  <java-symbol type="id" name="replace_app_icon" />
+  <java-symbol type="id" name="replace_message" />
+  <java-symbol type="fraction" name="config_dimBehindFadeDuration" />
+  <java-symbol type="integer" name="config_carDockKeepsScreenOn" />
+  <java-symbol type="integer" name="config_criticalBatteryWarningLevel" />
+  <java-symbol type="integer" name="config_datause_notification_type" />
+  <java-symbol type="integer" name="config_datause_polling_period_sec" />
+  <java-symbol type="integer" name="config_datause_threshold_bytes" />
+  <java-symbol type="integer" name="config_datause_throttle_kbitsps" />
+  <java-symbol type="integer" name="config_defaultNotificationLedOff" />
+  <java-symbol type="integer" name="config_defaultNotificationLedOn" />
+  <java-symbol type="integer" name="config_deskDockKeepsScreenOn" />
+  <java-symbol type="integer" name="config_lightSensorWarmupTime" />
+  <java-symbol type="integer" name="config_lowBatteryCloseWarningLevel" />
+  <java-symbol type="integer" name="config_lowBatteryWarningLevel" />
+  <java-symbol type="integer" name="config_networkPolicyDefaultWarning" />
+  <java-symbol type="integer" name="config_networkTransitionTimeout" />
+  <java-symbol type="integer" name="config_notificationsBatteryFullARGB" />
+  <java-symbol type="integer" name="config_notificationsBatteryLedOff" />
+  <java-symbol type="integer" name="config_notificationsBatteryLedOn" />
+  <java-symbol type="integer" name="config_notificationsBatteryLowARGB" />
+  <java-symbol type="integer" name="config_notificationsBatteryMediumARGB" />
+  <java-symbol type="integer" name="config_radioScanningTimeout" />
+  <java-symbol type="integer" name="config_screenBrightnessDim" />
+  <java-symbol type="integer" name="config_virtualKeyQuietTimeMillis" />
+  <java-symbol type="layout" name="am_compat_mode_dialog" />
+  <java-symbol type="layout" name="launch_warning" />
+  <java-symbol type="layout" name="safe_mode" />
+  <java-symbol type="layout" name="simple_list_item_2_single_choice" />
+  <java-symbol type="plurals" name="wifi_available" />
+  <java-symbol type="plurals" name="wifi_available_detailed" />
+  <java-symbol type="string" name="accessibility_binding_label" />
+  <java-symbol type="string" name="adb_active_notification_message" />
+  <java-symbol type="string" name="adb_active_notification_title" />
+  <java-symbol type="string" name="aerr_application" />
+  <java-symbol type="string" name="aerr_process" />
+  <java-symbol type="string" name="aerr_title" />
+  <java-symbol type="string" name="android_upgrading_apk" />
+  <java-symbol type="string" name="android_upgrading_complete" />
+  <java-symbol type="string" name="android_upgrading_starting_apps" />
+  <java-symbol type="string" name="anr_activity_application" />
+  <java-symbol type="string" name="anr_activity_process" />
+  <java-symbol type="string" name="anr_application_process" />
+  <java-symbol type="string" name="anr_process" />
+  <java-symbol type="string" name="anr_title" />
+  <java-symbol type="string" name="car_mode_disable_notification_message" />
+  <java-symbol type="string" name="car_mode_disable_notification_title" />
+  <java-symbol type="string" name="chooser_wallpaper" />
+  <java-symbol type="string" name="config_datause_iface" />
+  <java-symbol type="string" name="config_geocodeProvider" />
+  <java-symbol type="string" name="config_networkLocationProvider" />
+  <java-symbol type="string" name="config_wimaxManagerClassname" />
+  <java-symbol type="string" name="config_wimaxNativeLibLocation" />
+  <java-symbol type="string" name="config_wimaxServiceClassname" />
+  <java-symbol type="string" name="config_wimaxServiceJarLocation" />
+  <java-symbol type="string" name="config_wimaxStateTrackerClassname" />
+  <java-symbol type="string" name="configure_input_methods" />
+  <java-symbol type="string" name="data_usage_3g_limit_snoozed_title" />
+  <java-symbol type="string" name="data_usage_3g_limit_title" />
+  <java-symbol type="string" name="data_usage_4g_limit_snoozed_title" />
+  <java-symbol type="string" name="data_usage_4g_limit_title" />
+  <java-symbol type="string" name="data_usage_limit_body" />
+  <java-symbol type="string" name="data_usage_limit_snoozed_body" />
+  <java-symbol type="string" name="data_usage_mobile_limit_snoozed_title" />
+  <java-symbol type="string" name="data_usage_mobile_limit_title" />
+  <java-symbol type="string" name="data_usage_restricted_body" />
+  <java-symbol type="string" name="data_usage_restricted_title" />
+  <java-symbol type="string" name="data_usage_warning_body" />
+  <java-symbol type="string" name="data_usage_warning_title" />
+  <java-symbol type="string" name="data_usage_wifi_limit_snoozed_title" />
+  <java-symbol type="string" name="data_usage_wifi_limit_title" />
+  <java-symbol type="string" name="default_wallpaper_component" />
+  <java-symbol type="string" name="dlg_ok" />
+  <java-symbol type="string" name="factorytest_failed" />
+  <java-symbol type="string" name="factorytest_no_action" />
+  <java-symbol type="string" name="factorytest_not_system" />
+  <java-symbol type="string" name="factorytest_reboot" />
+  <java-symbol type="string" name="heavy_weight_notification" />
+  <java-symbol type="string" name="heavy_weight_notification_detail" />
+  <java-symbol type="string" name="input_method_binding_label" />
+  <java-symbol type="string" name="launch_warning_original" />
+  <java-symbol type="string" name="launch_warning_replace" />
+  <java-symbol type="string" name="launch_warning_title" />
+  <java-symbol type="string" name="low_internal_storage_view_text" />
+  <java-symbol type="string" name="low_internal_storage_view_title" />
+  <java-symbol type="string" name="report" />
+  <java-symbol type="string" name="select_input_method" />
+  <java-symbol type="string" name="smv_application" />
+  <java-symbol type="string" name="smv_process" />
+  <java-symbol type="string" name="tethered_notification_message" />
+  <java-symbol type="string" name="tethered_notification_title" />
+  <java-symbol type="string" name="throttle_warning_notification_message" />
+  <java-symbol type="string" name="throttle_warning_notification_title" />
+  <java-symbol type="string" name="throttled_notification_message" />
+  <java-symbol type="string" name="throttled_notification_title" />
+  <java-symbol type="string" name="usb_accessory_notification_title" />
+  <java-symbol type="string" name="usb_cd_installer_notification_title" />
+  <java-symbol type="string" name="usb_mtp_notification_title" />
+  <java-symbol type="string" name="usb_notification_message" />
+  <java-symbol type="string" name="usb_ptp_notification_title" />
+  <java-symbol type="string" name="vpn_text" />
+  <java-symbol type="string" name="vpn_text_long" />
+  <java-symbol type="string" name="vpn_title" />
+  <java-symbol type="string" name="vpn_title_long" />
+  <java-symbol type="string" name="wallpaper_binding_label" />
+  <java-symbol type="style" name="Theme.Dialog.AppError" />
+  <java-symbol type="style" name="Theme.Toast" />
+  <java-symbol type="xml" name="storage_list" />
+
+  <!-- From SystemUI -->
+  <java-symbol type="anim" name="push_down_in" />
+  <java-symbol type="anim" name="push_down_out" />
+  <java-symbol type="anim" name="push_up_in" />
+  <java-symbol type="anim" name="push_up_out" />
+  <java-symbol type="dimen" name="status_bar_icon_size" />
+  <java-symbol type="dimen" name="system_bar_icon_size" />
+  <java-symbol type="drawable" name="list_selector_pressed_holo_dark" />
+  <java-symbol type="drawable" name="scrubber_control_disabled_holo" />
+  <java-symbol type="drawable" name="scrubber_control_selector_holo" />
+  <java-symbol type="drawable" name="scrubber_progress_horizontal_holo_dark" />
+  <java-symbol type="drawable" name="usb_android" />
+  <java-symbol type="drawable" name="usb_android_connected" />
+  <java-symbol type="id" name="banner" />
+  <java-symbol type="id" name="mount_button" />
+  <java-symbol type="id" name="unmount_button" />
+  <java-symbol type="layout" name="usb_storage_activity" />
+  <java-symbol type="string" name="chooseUsbActivity" />
+  <java-symbol type="string" name="dlg_confirm_kill_storage_users_text" />
+  <java-symbol type="string" name="dlg_confirm_kill_storage_users_title" />
+  <java-symbol type="string" name="dlg_error_title" />
+  <java-symbol type="string" name="ext_media_badremoval_notification_message" />
+  <java-symbol type="string" name="ext_media_badremoval_notification_title" />
+  <java-symbol type="string" name="ext_media_checking_notification_message" />
+  <java-symbol type="string" name="ext_media_checking_notification_title" />
+  <java-symbol type="string" name="ext_media_nofs_notification_message" />
+  <java-symbol type="string" name="ext_media_nofs_notification_title" />
+  <java-symbol type="string" name="ext_media_nomedia_notification_message" />
+  <java-symbol type="string" name="ext_media_nomedia_notification_title" />
+  <java-symbol type="string" name="ext_media_safe_unmount_notification_message" />
+  <java-symbol type="string" name="ext_media_safe_unmount_notification_title" />
+  <java-symbol type="string" name="ext_media_unmountable_notification_message" />
+  <java-symbol type="string" name="ext_media_unmountable_notification_title" />
+  <java-symbol type="string" name="usb_storage_error_message" />
+  <java-symbol type="string" name="usb_storage_message" />
+  <java-symbol type="string" name="usb_storage_notification_message" />
+  <java-symbol type="string" name="usb_storage_notification_title" />
+  <java-symbol type="string" name="usb_storage_stop_message" />
+  <java-symbol type="string" name="usb_storage_stop_notification_message" />
+  <java-symbol type="string" name="usb_storage_stop_notification_title" />
+  <java-symbol type="string" name="usb_storage_stop_title" />
+  <java-symbol type="string" name="usb_storage_title" />
+
+  <!-- ImfTest -->
+  <java-symbol type="layout" name="auto_complete_list" />
+
+  <!-- From SettingsProvider -->
+  <java-symbol type="raw" name="fallbackring" />
+
+  <!-- From Settings -->
+  <java-symbol type="array" name="config_mobile_hotspot_provision_app" />
+  <java-symbol type="bool" name="config_intrusiveNotificationLed" />
+  <java-symbol type="dimen" name="preference_fragment_padding_bottom" />
+  <java-symbol type="dimen" name="preference_fragment_padding_side" />
+  <java-symbol type="drawable" name="expander_ic_maximized" />
+  <java-symbol type="drawable" name="expander_ic_minimized" />
+  <java-symbol type="drawable" name="ic_menu_archive" />
+  <java-symbol type="drawable" name="ic_menu_goto" />
+  <java-symbol type="drawable" name="title_bar_medium" />
+  <java-symbol type="id" name="body" />
+  <java-symbol type="string" name="fast_scroll_alphabet" />
+  <java-symbol type="string" name="ssl_certificate" />
+
+  <!-- From Phone -->
+  <java-symbol type="bool" name="config_built_in_sip_phone" />
+
+  <!-- From TelephonyProvider -->
+  <java-symbol type="xml" name="apns" />
+
+  <!-- From ContactsProvider -->
+  <java-symbol type="array" name="common_nicknames" />
+  <java-symbol type="drawable" name="call_contact" />
+  <java-symbol type="drawable" name="create_contact" />
+  <java-symbol type="string" name="common_name_prefixes" />
+  <java-symbol type="string" name="common_last_name_prefixes" />
+  <java-symbol type="string" name="common_name_suffixes" />
+  <java-symbol type="string" name="common_name_conjunctions" />
+  <java-symbol type="string" name="dial_number_using" />
+  <java-symbol type="string" name="create_contact_using" />
+
+  <!-- From DownloadProvider -->
+  <java-symbol type="integer" name="config_MaxConcurrentDownloadsAllowed" />
+  <java-symbol type="integer" name="config_downloadDataDirSize" />
+  <java-symbol type="integer" name="config_downloadDataDirLowSpaceThreshold" />
+
+  <!-- From Contacts -->
+  <java-symbol type="drawable" name="quickcontact_badge_overlay_dark" />
+
+  <!-- From Browser -->
+  <java-symbol type="drawable" name="ic_menu_moreoverflow_normal_holo_dark" />
+  <java-symbol type="id" name="placeholder" />
+  <java-symbol type="string" name="ssl_certificate_is_valid" />
+
+  <!-- From Mms -->
+  <java-symbol type="drawable" name="ic_menu_play_clip" />
+
+  <!-- From Stk -->
+  <java-symbol type="bool" name="config_sf_slowBlur" />
+  <java-symbol type="drawable" name="ic_volume" />
+  <java-symbol type="drawable" name="stat_notify_sim_toolkit" />
+
+  <!-- From PinyinIME(!!!) -->
+  <java-symbol type="string" name="inputMethod" />
+
   <!-- AndroidManifest.xml attributes. -->
   <eat-comment />
 
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index 3b6d6f1..571c4ad 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -112,7 +112,7 @@
     </style>
 
     <!-- Standard animations for a translucent window or activity.  This
-         style is <em>not<em> used by default for the translucent theme
+         style is <em>not</em> used by default for the translucent theme
          (since translucent activities are a special case that have no
          clear UI paradigm), but you can make your own specialized theme
          with this animation style if you would like to have the standard
diff --git a/core/res/res/values/styles_device_defaults.xml b/core/res/res/values/styles_device_defaults.xml
index 7f1891e..6419872 100644
--- a/core/res/res/values/styles_device_defaults.xml
+++ b/core/res/res/values/styles_device_defaults.xml
@@ -687,7 +687,7 @@
     <style name="AlertDialog.DeviceDefault" parent="AlertDialog.Holo">
 
     </style>
-    <style name="AlertDialog.DeviceDefault.Light" parent="AlertDialog.DeviceDefault.Light" >
+    <style name="AlertDialog.DeviceDefault.Light" parent="AlertDialog.Holo.Light" >
 
     </style>
 
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index fe5388b..7046fc5 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -29,15 +29,16 @@
 ===============================================================
  -->
 <resources>
-    <!-- The default system theme. This is the theme used for activities
-         that have not explicitly set their own theme.
-         
+    <!-- The default theme for apps on API level 10 and lower. This is the theme used for
+         activities that have not explicitly set their own theme.
          <p>You can count on this being a dark
          background with light text on top, but should try to make no
          other assumptions about its appearance. In particular, the text
          inside of widgets using this theme may be completely different,
          with the widget container being a light color and the text on top
          of it a dark color.
+         <p>If you're developing for API level 11 and higher, you should instead use {@link
+         #Theme_Holo} or {@link #Theme_DeviceDefault}.</p>
     -->
     <style name="Theme">
 
@@ -370,13 +371,12 @@
         <item name="pointerStyle">@android:style/Pointer</item>
     </style>
 
-    <!-- Variant of the default (dark) theme with no title bar -->
+    <!-- Variant of {@link #Theme} with no title bar -->
     <style name="Theme.NoTitleBar">
         <item name="android:windowNoTitle">true</item>
     </style>
 
-    <!-- Variant of the default (dark) theme that has no title bar and
-         fills the entire screen -->
+    <!-- Variant of {@link #Theme} that has no title bar and no status bar -->
     <style name="Theme.NoTitleBar.Fullscreen">
         <item name="android:windowFullscreen">true</item>
         <item name="android:windowContentOverlay">@null</item>
@@ -385,7 +385,8 @@
     <!-- Theme for a light background with dark text on top.  Set your activity
          to this theme if you would like such an appearance.  As with the
          default theme, you should try to assume little more than that the
-         background will be a light color. -->
+         background will be a light color.
+         <p>This is designed for API level 10 and lower.</p>-->
     <style name="Theme.Light">
         <item name="windowBackground">@android:drawable/screen_background_selector_light</item>
         <item name="colorBackground">@android:color/background_light</item>
@@ -457,19 +458,19 @@
         <item name="detailsElementBackground">@android:drawable/panel_bg_holo_light</item>
     </style>
 
-    <!-- Variant of the light theme with no title bar -->
+    <!-- Variant of {@link #Theme_Light} with no title bar -->
     <style name="Theme.Light.NoTitleBar">
         <item name="android:windowNoTitle">true</item>
     </style>
 
-    <!-- Variant of the light theme that has no title bar and
-         fills the entire screen -->
+    <!-- Variant of {@link #Theme_Light} that has no title bar and
+         no status bar -->
     <style name="Theme.Light.NoTitleBar.Fullscreen">
         <item name="android:windowFullscreen">true</item>
         <item name="android:windowContentOverlay">@null</item>
     </style>
     
-    <!-- Special variation on the default theme that ensures the background is
+    <!-- Variant on {@link #Theme} that ensures the background is
          completely black.  This is useful for things like image viewers and
          media players.   If you want the normal (dark background) theme
          do <em>not</em> use this, use {@link #Theme}. -->
@@ -478,40 +479,40 @@
         <item name="android:colorBackground">@android:color/black</item>
     </style>
     
-    <!-- Variant of the black theme with no title bar -->
+    <!-- Variant of {@link #Theme_Black} with no title bar -->
     <style name="Theme.Black.NoTitleBar">
         <item name="android:windowNoTitle">true</item>
     </style>
 
-    <!-- Variant of the black theme that has no title bar and
-         fills the entire screen -->
+    <!-- Variant of {@link #Theme_Black} that has no title bar and
+         no status bar -->
     <style name="Theme.Black.NoTitleBar.Fullscreen">
         <item name="android:windowFullscreen">true</item>
         <item name="android:windowContentOverlay">@null</item>
     </style>
     
-    <!-- Default theme for windows that want to have the user's selected
-         wallpaper appear behind them.  -->
+    <!-- Theme for windows that want to have the user's selected
+         wallpaper appear behind them (for API level 10 and lower).  -->
     <style name="Theme.Wallpaper">
         <item name="android:windowBackground">@android:color/transparent</item>
         <item name="android:colorBackgroundCacheHint">@null</item>
         <item name="android:windowShowWallpaper">true</item>
     </style>
 
-    <!-- Variant of the translucent theme with no title bar -->
+    <!-- Variant of {@link #Theme_Wallpaper} that has no title bar -->
     <style name="Theme.Wallpaper.NoTitleBar">
         <item name="android:windowNoTitle">true</item>
     </style>
 
-    <!-- Variant of the translucent theme that has no title bar and
-         fills the entire screen -->
+    <!-- Variant of {@link #Theme_Wallpaper} that
+         has no title bar or status bar. -->
     <style name="Theme.Wallpaper.NoTitleBar.Fullscreen">
         <item name="android:windowFullscreen">true</item>
         <item name="android:windowContentOverlay">@null</item>
     </style>
 
-    <!-- Theme for a wallpaper's setting activity that is designed to be on
-         top of a dark background. -->
+    <!-- Theme for a wallpaper's setting activity, which is designed to be a transparent
+         background with a dark shade, so the previous Activity is visible in the background. -->
     <style name="Theme.WallpaperSettings">
         <item name="android:windowBackground">@android:drawable/screen_background_dark_transparent</item>
         <item name="android:colorBackgroundCacheHint">@null</item>
@@ -519,8 +520,8 @@
         <item name="android:windowAnimationStyle">@android:style/Animation.Translucent</item>
     </style>
 
-    <!-- Theme for a wallpaper's setting activity that is designed to be on
-         top of a light background. -->
+    <!-- Theme for a wallpaper's setting activity, which is designed to be a transparent
+         background with a light shade, so the previous Activity is visible in the background. -->
     <style name="Theme.Light.WallpaperSettings">
         <item name="android:windowBackground">@android:drawable/screen_background_light_transparent</item>
         <item name="android:colorBackgroundCacheHint">@null</item>
@@ -538,8 +539,8 @@
     <style name="PreviewWallpaperSettings">
     </style>
     
-    <!-- Default theme for translucent activities, that is windows that allow you
-         to see through them to the windows behind.  This sets up the translucent
+    <!-- Theme for translucent activities (on API level 10 and lower). That is, windows
+         that allow you to see through them to the windows behind.  This sets up the translucent
          flag and appropriate animations for your windows.  -->
     <style name="Theme.Translucent">
         <item name="android:windowBackground">@android:color/transparent</item>
@@ -551,14 +552,14 @@
         <item name="android:windowAnimationStyle">@android:style/Animation</item>
     </style>
 
-    <!-- Variant of the translucent theme with no title bar -->
+    <!-- Variant of {@link #Theme_Translucent} with no title bar -->
     <style name="Theme.Translucent.NoTitleBar">
         <item name="android:windowNoTitle">true</item>
         <item name="android:windowContentOverlay">@null</item>
     </style>
 
-    <!-- Variant of the translucent theme that has no title bar and
-         fills the entire screen -->
+    <!-- Variant of {@link #Theme_Translucent} that has no title bar and
+         no status bar -->
     <style name="Theme.Translucent.NoTitleBar.Fullscreen">
         <item name="android:windowFullscreen">true</item>
     </style>
@@ -574,7 +575,8 @@
         <item name="android:windowNoDisplay">true</item>
     </style>
 
-    <!-- Default theme for dialog windows and activities, which is used by the
+    <!-- Default theme for dialog windows and activities (on API level 10 and lower),
+         which is used by the
          {@link android.app.Dialog} class.  This changes the window to be
          floating (not fill the entire screen), and puts a frame around its
          contents.  You can set this theme on an activity if you would like to
@@ -622,7 +624,7 @@
         <item name="listPreferredItemPaddingRight">10dip</item>
     </style>
 
-    <!-- Variation of Theme.Dialog that does not include a frame (or background).
+    <!-- Variant of {@link Theme_Dialog} that does not include a frame (or background).
          The view hierarchy of the dialog is responsible for drawing all of
          its pixels. -->
     <style name="Theme.Dialog.NoFrame">
@@ -636,7 +638,7 @@
         <item name="android:windowCloseOnTouchOutside">false</item>
     </style>
 
-    <!-- Default theme for alert dialog windows, which is used by the
+    <!-- Default theme for alert dialog windows (on API level 10 and lower), which is used by the
          {@link android.app.AlertDialog} class.  This is basically a dialog
          but sets the background to empty so it can do two-tone backgrounds. -->
     <style name="Theme.Dialog.Alert">
@@ -648,8 +650,8 @@
         <item name="textAppearanceListItemSmall">@android:style/TextAppearance.Large.Inverse</item>
     </style>
     
-    <!-- Default dark theme for panel windows.  This removes all extraneous
-         window decorations, so you basically have an empty rectangle in which
+    <!-- Default dark theme for panel windows (on API level 10 and lower).  This removes all
+         extraneous window decorations, so you basically have an empty rectangle in which
          to place your content.  It makes the window floating, with a transparent
          background, and turns off dimming behind the window. -->
     <style name="Theme.Panel">
@@ -664,8 +666,8 @@
         <item name="android:windowNoTitle">true</item>
     </style>
 
-    <!-- Default light theme for panel windows.  This removes all extraneous
-         window decorations, so you basically have an empty rectangle in which
+    <!-- Default light theme for panel windows (on API level 10 and lower).  This removes all
+         extraneous window decorations, so you basically have an empty rectangle in which
          to place your content.  It makes the window floating, with a transparent
          background, and turns off dimming behind the window. -->
     <style name="Theme.Light.Panel">
@@ -712,7 +714,7 @@
         <item name="android:windowNoTitle">true</item>
     </style>
 
-    <!-- Default theme for input methods, which is used by the
+    <!-- Default theme for input methods (on API level 10 and lower), which is used by the
          {@link android.inputmethodservice.InputMethodService} class.
          this inherits from Theme.Panel, but sets up IME appropriate animations
          and a few custom attributes. -->
@@ -723,7 +725,7 @@
         <item name="android:imeExtractExitAnimation">@android:anim/input_method_extract_exit</item>
     </style>
 
-    <!-- Default theme for modern holo style input methods, which is used by the
+    <!-- Default theme for holo style input methods, which is used by the
          {@link android.inputmethodservice.InputMethodService} class.
          this inherits from Theme.Panel, but sets up IME appropriate animations
          and a few custom attributes. -->
@@ -842,14 +844,23 @@
         <item name="android:windowActionModeOverlay">true</item>
     </style>
     
-    <!-- New Honeycomb holographic theme. Dark version.  The widgets in the
-         holographic theme are translucent on their brackground, so applications
-         must ensure that any background they use with this theme is itself
-         dark; otherwise, it will be difficult to see the widgets.  The new
-         UI style also includes a full action bar by default.
+    <!-- Honeycomb holographic theme (dark version).
+         <p>This is the default system theme for apps that target API level 11 - 13. Starting
+         with API level 14, the default system theme is supplied by {@link #Theme_DeviceDefault},
+         which might apply a different style on different devices. If you want to ensure that your
+         app consistenly uses the Holo theme at all times, you must explicitly declare it in your
+         manifest. For example, {@code &lt;application android:theme="@android:style/Theme.Holo"&gt;}.
+         For more information, read <a
+         href="http://android-developers.blogspot.com/2012/01/holo-everywhere.html">Holo
+         Everywhere</a>.</p>
+         <p>The widgets in the holographic theme are translucent on their brackground, so
+         applications must ensure that any background they use with this theme is itself
+         dark; otherwise, it will be difficult to see the widgets. This UI style also includes a
+         full action bar by default.</p>
 
-         Styles used by the Holo theme are named using the convention Type.Holo.Etc.
-         (For example, Widget.Holo.Button, TextAppearance.Holo.Widget.PopupMenu.Large.)
+         <p>Styles used by the Holo theme are named using the convention Type.Holo.Etc
+         (for example, {@code Widget.Holo.Button} and {@code
+         TextAppearance.Holo.Widget.PopupMenu.Large}).
          Specific resources used by Holo are named using the convention @type/foo_bar_baz_holo
          with trailing _dark or _light specifiers if they are not shared between both light and
          dark versions of the theme. -->
@@ -951,15 +962,12 @@
         <item name="listDividerAlertDialog">@android:drawable/list_divider_holo_dark</item>
 
         <item name="expandableListPreferredItemPaddingLeft">40dip</item>
-        <item name="expandableListPreferredChildPaddingLeft">
-                ?android:attr/expandableListPreferredItemPaddingLeft</item>
+        <item name="expandableListPreferredChildPaddingLeft">?android:attr/expandableListPreferredItemPaddingLeft</item>
 
         <item name="expandableListPreferredItemIndicatorLeft">3dip</item>
         <item name="expandableListPreferredItemIndicatorRight">0dip</item>
-        <item name="expandableListPreferredChildIndicatorLeft">
-                ?android:attr/expandableListPreferredItemIndicatorLeft</item>
-        <item name="expandableListPreferredChildIndicatorRight">
-                ?android:attr/expandableListPreferredItemIndicatorRight</item>
+        <item name="expandableListPreferredChildIndicatorLeft">?android:attr/expandableListPreferredItemIndicatorLeft</item>
+        <item name="expandableListPreferredChildIndicatorRight">?android:attr/expandableListPreferredItemIndicatorRight</item>
 
         <!-- Gallery attributes -->
         <item name="galleryItemBackground">@android:drawable/gallery_item_background</item>
@@ -1156,10 +1164,10 @@
 
     </style>
 
-    <!-- New Honeycomb holographic theme. Light version.  The widgets in the
+    <!-- Honeycomb holographic theme (light version).  The widgets in the
          holographic theme are translucent on their brackground, so applications
          must ensure that any background they use with this theme is itself
-         light; otherwise, it will be difficult to see the widgets.  The new
+         light; otherwise, it will be difficult to see the widgets.  This
          UI style also includes a full action bar by default. -->
     <style name="Theme.Holo.Light" parent="Theme.Light">
         <item name="colorForeground">@android:color/bright_foreground_holo_light</item>
@@ -1257,15 +1265,12 @@
         <item name="activatedBackgroundIndicator">@android:drawable/activated_background_holo_light</item>
 
         <item name="expandableListPreferredItemPaddingLeft">40dip</item>
-        <item name="expandableListPreferredChildPaddingLeft">
-                ?android:attr/expandableListPreferredItemPaddingLeft</item>
+        <item name="expandableListPreferredChildPaddingLeft">?android:attr/expandableListPreferredItemPaddingLeft</item>
 
         <item name="expandableListPreferredItemIndicatorLeft">3dip</item>
         <item name="expandableListPreferredItemIndicatorRight">0dip</item>
-        <item name="expandableListPreferredChildIndicatorLeft">
-                ?android:attr/expandableListPreferredItemIndicatorLeft</item>
-        <item name="expandableListPreferredChildIndicatorRight">
-                ?android:attr/expandableListPreferredItemIndicatorRight</item>
+        <item name="expandableListPreferredChildIndicatorLeft">?android:attr/expandableListPreferredItemIndicatorLeft</item>
+        <item name="expandableListPreferredChildIndicatorRight">?android:attr/expandableListPreferredItemIndicatorRight</item>
 
         <item name="listDividerAlertDialog">@android:drawable/list_divider_holo_light</item>
 
@@ -1522,6 +1527,7 @@
     </style>
  
     <!-- Dialog themes for Holo -->
+    <eat-comment />
 
     <!-- Holo theme for dialog windows and activities, which is used by the
          {@link android.app.Dialog} class.  This changes the window to be
@@ -1554,27 +1560,27 @@
         <item name="listPreferredItemPaddingRight">16dip</item>
     </style>
 
-    <!-- Variation of Theme.Holo.Dialog that has a nice minumum width for
+    <!-- Variant of Theme.Holo.Dialog that has a nice minimum width for
          a regular dialog. -->
     <style name="Theme.Holo.Dialog.MinWidth">
         <item name="android:windowMinWidthMajor">@android:dimen/dialog_min_width_major</item>
         <item name="android:windowMinWidthMinor">@android:dimen/dialog_min_width_minor</item>
     </style>
 
-    <!-- Variation of Theme.Holo.Dialog that does not include a title bar. -->
+    <!-- Variant of Theme.Holo.Dialog that does not include a title bar. -->
     <style name="Theme.Holo.Dialog.NoActionBar">
         <item name="android:windowActionBar">false</item>
         <item name="android:windowNoTitle">true</item>
     </style>
 
-    <!-- Variation of Theme.Holo.Dialog.NoActionVar that has a nice minumum width for
+    <!-- Variant of Theme.Holo.Dialog.NoActionBar that has a nice minimum width for
          a regular dialog. -->
     <style name="Theme.Holo.Dialog.NoActionBar.MinWidth">
         <item name="android:windowMinWidthMajor">@android:dimen/dialog_min_width_major</item>
         <item name="android:windowMinWidthMinor">@android:dimen/dialog_min_width_minor</item>
     </style>
 
-    <!-- Variation of Theme.Holo.Dialog that does not include a frame (or background).
+    <!-- Variant of Theme.Holo.Dialog that does not include a frame (or background).
          The view hierarchy of the dialog is responsible for drawing all of
          its pixels. -->
     <style name="Theme.Holo.Dialog.NoFrame">
@@ -1646,20 +1652,20 @@
         <item name="listPreferredItemPaddingRight">16dip</item>
     </style>
 
-    <!-- Variation of Theme.Holo.Light.Dialog that has a nice minumum width for
+    <!-- Variant of Theme.Holo.Light.Dialog that has a nice minimum width for
          a regular dialog. -->
     <style name="Theme.Holo.Light.Dialog.MinWidth">
         <item name="android:windowMinWidthMajor">@android:dimen/dialog_min_width_major</item>
         <item name="android:windowMinWidthMinor">@android:dimen/dialog_min_width_minor</item>
     </style>
 
-    <!-- Variation of Theme.Holo.Light.Dialog that does not include a title bar. -->
+    <!-- Variant of Theme.Holo.Light.Dialog that does not include a title bar. -->
     <style name="Theme.Holo.Light.Dialog.NoActionBar">
         <item name="android:windowActionBar">false</item>
         <item name="android:windowNoTitle">true</item>
     </style>
 
-    <!-- Variation of Theme.Holo.Light.Dialog.NoActionBar that has a nice minumum width for
+    <!-- Variant of Theme.Holo.Light.Dialog.NoActionBar that has a nice minimum width for
          a regular dialog. -->
     <style name="Theme.Holo.Light.Dialog.NoActionBar.MinWidth">
         <item name="android:windowMinWidthMajor">@android:dimen/dialog_min_width_major</item>
@@ -1700,7 +1706,8 @@
         <item name="android:windowShowWallpaper">true</item>
     </style>
 
-    <!-- Variant of the holographic (dark) theme with no title bar -->
+    <!--Default holographic (dark) for windows that want to have the user's selected
+         wallpaper appear behind them and without an action bar. -->
     <style name="Theme.Holo.Wallpaper.NoTitleBar">
         <item name="android:windowNoTitle">true</item>
     </style>
diff --git a/core/res/res/values/themes_device_defaults.xml b/core/res/res/values/themes_device_defaults.xml
index 94d2c38..abe4aad 100644
--- a/core/res/res/values/themes_device_defaults.xml
+++ b/core/res/res/values/themes_device_defaults.xml
@@ -31,6 +31,24 @@
 ===============================================================
  -->
 <resources>
+
+    <!-- The default theme for apps that target API level 14 and higher.
+         <p>The DeviceDefault themes are aliases for a specific device’s native look and feel. The
+         DeviceDefault theme family and widget style family offer ways for you to target your app
+         to a device’s native theme with all device customizations intact.</p>
+         <p>For example, when you set your app's {@code targetSdkVersion} to 14 or higher, this
+         theme is applied to your application by default. As such, your app might appear with the
+         {@link #Theme_Holo Holo} styles on one device, but with a different set of styles on
+         another device. This is great if you want your app to fit with the device's native look and
+         feel. If, however, you prefer to keep your UI style the same across all devices, you should
+         apply a specific theme such as {@link #Theme_Holo Holo} or one of your own design. For more
+         information, read <a
+         href="http://android-developers.blogspot.com/2012/01/holo-everywhere.html">Holo
+         Everywhere</a>.</p>
+         <p>Styles used by the DeviceDefault theme are named using the convention
+         Type.DeviceDefault.Etc (for example, {@code Widget.DeviceDefault.Button} and
+         {@code TextAppearance.DeviceDefault.Widget.PopupMenu.Large}).</p>
+          -->
     <style name="Theme.DeviceDefault" parent="Theme.Holo" >
         <!-- Text styles -->
         <item name="textAppearance">@android:style/TextAppearance.DeviceDefault</item>
@@ -176,12 +194,16 @@
         <!-- DatePicker style -->
         <item name="datePickerStyle">@style/Widget.DeviceDefault.DatePicker</item>
     </style>
+
+    <!-- Variant of {@link #Theme_DeviceDefault} with no action bar -->
     <style name="Theme.DeviceDefault.NoActionBar" parent="Theme.Holo.NoActionBar" >
 
     </style>
+    <!-- Variant of {@link #Theme_DeviceDefault} with no action bar and no status bar -->
     <style name="Theme.DeviceDefault.NoActionBar.Fullscreen" parent="Theme.Holo.NoActionBar.Fullscreen" >
 
     </style>
+    <!-- Variant of {@link #Theme_DeviceDefault} with a light-colored style -->
     <style name="Theme.DeviceDefault.Light" parent="Theme.Holo.Light" >
         <!-- Text styles -->
         <item name="textAppearance">@android:style/TextAppearance.DeviceDefault.Light</item>
@@ -322,12 +344,17 @@
         <!-- DatePicker style -->
         <item name="datePickerStyle">@style/Widget.DeviceDefault.Light.DatePicker</item>
     </style>
+    <!-- Variant of {@link #Theme_DeviceDefault_Light} with no action bar -->
     <style name="Theme.DeviceDefault.Light.NoActionBar" parent="Theme.Holo.Light.NoActionBar" >
 
     </style>
+    <!-- Variant of {@link #Theme_DeviceDefault_Light} with no action bar and no status bar -->
     <style name="Theme.DeviceDefault.Light.NoActionBar.Fullscreen" parent="Theme.Holo.Light.NoActionBar.Fullscreen" >
 
     </style>
+    <!-- DeviceDefault theme for dialog windows and activities. This changes the window to be
+    floating (not fill the entire screen), and puts a frame around its contents. You can set this
+    theme on an activity if you would like to make an activity that looks like a Dialog. -->
     <style name="Theme.DeviceDefault.Dialog" parent="Theme.Holo.Dialog" >
         <item name="android:windowTitleStyle">@android:style/DialogWindowTitle.DeviceDefault</item>
         <item name="android:windowAnimationStyle">@android:style/Animation.DeviceDefault.Dialog</item>
@@ -338,15 +365,23 @@
         <item name="textAppearance">@android:style/TextAppearance.DeviceDefault</item>
         <item name="textAppearanceInverse">@android:style/TextAppearance.DeviceDefault.Inverse</item>
     </style>
+    <!-- Variant of {@link #Theme_DeviceDefault_Dialog} that has a nice minimum width for a
+    regular dialog. -->
     <style name="Theme.DeviceDefault.Dialog.MinWidth" parent="Theme.Holo.Dialog.MinWidth" >
 
     </style>
+    <!-- Variant of {@link #Theme_DeviceDefault_Dialog} without an action bar -->
     <style name="Theme.DeviceDefault.Dialog.NoActionBar" parent="Theme.Holo.Dialog.NoActionBar" >
 
     </style>
+    <!-- Variant of {@link #Theme_DeviceDefault_Dialog_NoActionBar} that has a nice minimum width
+    for a regular dialog. -->
     <style name="Theme.DeviceDefault.Dialog.NoActionBar.MinWidth" parent="Theme.Holo.Dialog.NoActionBar.MinWidth" >
 
     </style>
+    <!-- DeviceDefault light theme for dialog windows and activities. This changes the window to be
+    floating (not fill the entire screen), and puts a frame around its contents. You can set this
+    theme on an activity if you would like to make an activity that looks like a Dialog.-->
     <style name="Theme.DeviceDefault.Light.Dialog" parent="Theme.Holo.Light.Dialog" >
         <item name="android:windowTitleStyle">@android:style/DialogWindowTitle.DeviceDefault.Light</item>
         <item name="android:windowAnimationStyle">@android:style/Animation.DeviceDefault.Dialog</item>
@@ -357,42 +392,71 @@
         <item name="textAppearance">@android:style/TextAppearance.DeviceDefault.Light</item>
         <item name="textAppearanceInverse">@android:style/TextAppearance.DeviceDefault.Light.Inverse</item>
     </style>
+    <!-- Variant of {@link #Theme_DeviceDefault_Light_Dialog} that has a nice minimum width for a
+    regular dialog. -->
     <style name="Theme.DeviceDefault.Light.Dialog.MinWidth" parent="Theme.Holo.Light.Dialog.MinWidth" >
 
     </style>
+     <!-- Variant of {@link #Theme_DeviceDefault_Light_Dialog} without an action bar -->
     <style name="Theme.DeviceDefault.Light.Dialog.NoActionBar" parent="Theme.Holo.Light.Dialog.NoActionBar" >
 
     </style>
+    <!-- Variant of {@link #Theme_DeviceDefault_Light_Dialog_NoActionBar} that has a nice minimum
+    width for a regular dialog. -->
     <style name="Theme.DeviceDefault.Light.Dialog.NoActionBar.MinWidth" parent="Theme.Holo.Light.Dialog.NoActionBar.MinWidth" >
 
     </style>
+    <!-- DeviceDefault theme for a window that will be displayed either full-screen on smaller
+    screens (small, normal) or as a dialog on larger screens (large, xlarge). -->
     <style name="Theme.DeviceDefault.DialogWhenLarge" parent="Theme.Holo.DialogWhenLarge" >
 
     </style>
+    <!-- DeviceDefault theme for a window without an action bar that will be displayed either
+    full-screen on smaller screens (small, normal) or as a dialog on larger screens (large,
+    xlarge). -->
     <style name="Theme.DeviceDefault.DialogWhenLarge.NoActionBar" parent="Theme.Holo.DialogWhenLarge.NoActionBar" >
 
     </style>
+    <!-- DeviceDefault light theme for a window that will be displayed either full-screen on smaller
+    screens (small, normal) or as a dialog on larger screens (large, xlarge). -->
     <style name="Theme.DeviceDefault.Light.DialogWhenLarge" parent="Theme.Holo.Light.DialogWhenLarge" >
 
     </style>
+    <!-- DeviceDefault light theme for a window without an action bar that will be displayed either
+    full-screen on smaller screens (small, normal) or as a dialog on larger screens (large,
+    xlarge). -->
     <style name="Theme.DeviceDefault.Light.DialogWhenLarge.NoActionBar" parent="Theme.Holo.Light.DialogWhenLarge.NoActionBar" >
 
     </style>
+    <!-- DeviceDefault theme for panel windows. This removes all extraneous window
+    decorations, so you basically have an empty rectangle in which to place your content. It makes
+    the window floating, with a transparent background, and turns off dimming behind the window. -->
     <style name="Theme.DeviceDefault.Panel" parent="Theme.Holo.Panel" >
 
     </style>
+    <!-- DeviceDefault light theme for panel windows. This removes all extraneous window
+    decorations, so you basically have an empty rectangle in which to place your content. It makes
+    the window floating, with a transparent background, and turns off dimming behind the window. -->
     <style name="Theme.DeviceDefault.Light.Panel" parent="Theme.Holo.Light.Panel" >
 
     </style>
+    <!-- DeviceDefault theme for windows that want to have the user's selected wallpaper appear
+    behind them. -->
     <style name="Theme.DeviceDefault.Wallpaper" parent="Theme.Holo.Wallpaper" >
 
     </style>
+    <!-- DeviceDefault theme for windows that want to have the user's selected wallpaper appear
+    behind them and without an action bar. -->
     <style name="Theme.DeviceDefault.Wallpaper.NoTitleBar" parent="Theme.Holo.Wallpaper.NoTitleBar" >
 
     </style>
+    <!-- DeviceDefault style for input methods, which is used by the
+         {@link android.inputmethodservice.InputMethodService} class.-->
     <style name="Theme.DeviceDefault.InputMethod" parent="Theme.Holo.InputMethod" >
 
     </style>
+    <!-- Variant of the DeviceDefault (light) theme that has a solid (opaque) action bar with an
+    inverse color profile. -->
     <style name="Theme.DeviceDefault.Light.DarkActionBar" parent="Theme.Holo.Light.DarkActionBar" >
         <item name="android:actionBarStyle">@android:style/Widget.DeviceDefault.Light.ActionBar.Solid.Inverse</item>
 
@@ -411,13 +475,13 @@
     <style name="Theme.DeviceDefault.Dialog.Alert" parent="Theme.Holo.Dialog.Alert">
         <item name="windowTitleStyle">@android:style/DialogWindowTitle.DeviceDefault</item>
     </style>
-    <style name="Theme.DeviceDefault.Light.Dialog.Alert" parent="Theme.DeviceDefault.Light.Dialog.Alert">
+    <style name="Theme.DeviceDefault.Light.Dialog.Alert" parent="Theme.Holo.Light.Dialog.Alert">
         <item name="windowTitleStyle">@android:style/DialogWindowTitle.DeviceDefault.Light</item>
     </style>
-    <style name="Theme.DeviceDefault.SearchBar" parent="Theme.DeviceDefault.SearchBar">
+    <style name="Theme.DeviceDefault.SearchBar" parent="Theme.Holo.SearchBar">
 
     </style>
-    <style name="Theme.DeviceDefault.Light.SearchBar" parent="Theme.DeviceDefault.Light.SearchBar">
+    <style name="Theme.DeviceDefault.Light.SearchBar" parent="Theme.Holo.Light.SearchBar">
 
     </style>
 
diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerStressTestRunner.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerStressTestRunner.java
index 3ffa085..7233e7f 100644
--- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerStressTestRunner.java
+++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerStressTestRunner.java
@@ -46,7 +46,7 @@
     @Override
     public TestSuite getAllTests() {
         TestSuite suite = new InstrumentationTestSuite(this);
-        if (!UtilHelper.isWifiOnly()) {
+        if (!UtilHelper.isWifiOnly(getContext())) {
             suite.addTestSuite(WifiApStress.class);
             suite.addTestSuite(WifiStressTest.class);
         } else {
@@ -64,7 +64,7 @@
     @Override
     public void onCreate(Bundle icicle) {
         super.onCreate(icicle);
-        if (!UtilHelper.isWifiOnly()) {
+        if (!UtilHelper.isWifiOnly(getContext())) {
             String valueStr = (String) icicle.get("softap_iterations");
             if (valueStr != null) {
                 int iteration = Integer.parseInt(valueStr);
diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java
index 0580ebc..d375d4c 100644
--- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java
+++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java
@@ -249,8 +249,6 @@
         sleep(SHORT_TIMEOUT);
         removeConfiguredNetworksAndDisableWifi();
         mWifiRegexs = mCM.getTetherableWifiRegexs();
-        // after wifi is shutdown, wait for 2 minute to enable wifi
-        sleep(WIFI_STOP_START_INTERVAL);
      }
 
     public List<WifiConfiguration> loadNetworkConfigurations() throws Exception {
diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestRunner.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestRunner.java
index 20aae47..9819c54 100644
--- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestRunner.java
+++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestRunner.java
@@ -40,7 +40,7 @@
     @Override
     public TestSuite getAllTests() {
         TestSuite suite = new InstrumentationTestSuite(this);
-        if (!UtilHelper.isWifiOnly()) {
+        if (!UtilHelper.isWifiOnly(getContext())) {
             suite.addTestSuite(ConnectivityManagerMobileTest.class);
         } else {
             // create a new test suite
diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/UtilHelper.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/UtilHelper.java
index 1b966bf..b9fe6ed 100644
--- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/UtilHelper.java
+++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/UtilHelper.java
@@ -16,12 +16,31 @@
 
 package com.android.connectivitymanagertest;
 
-import android.os.SystemProperties;
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.util.Log;
 
 public class UtilHelper {
-    public static boolean isWifiOnly() {
-        return "wifi-only".equals(SystemProperties.get("ro.carrier"));
+
+    private static Boolean mIsWifiOnly = null;
+    private static final Object sLock = new Object();
+
+    /**
+     * Return true if device is a wifi only device.
+     */
+    public static boolean isWifiOnly(Context context) {
+        synchronized (sLock) {
+            // cache the result from pkgMgr statically. It will never change, since its a
+            // device configuration setting
+            if (mIsWifiOnly == null) {
+                PackageManager pkgMgr = context.getPackageManager();
+                mIsWifiOnly = Boolean.valueOf(!pkgMgr
+                        .hasSystemFeature(PackageManager.FEATURE_TELEPHONY)
+                        && pkgMgr.hasSystemFeature(PackageManager.FEATURE_WIFI));
+                String deviceType = mIsWifiOnly ? "wifi-only" : "telephony";
+                Log.d("ConnectivityManagerTest", String.format("detected a %s device", deviceType));
+            }
+        }
+        return mIsWifiOnly;
     }
-
-
 }
diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/functional/ConnectivityManagerMobileTest.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/functional/ConnectivityManagerMobileTest.java
index b1f4bf1..52326d5 100644
--- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/functional/ConnectivityManagerMobileTest.java
+++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/functional/ConnectivityManagerMobileTest.java
@@ -16,37 +16,31 @@
 
 package com.android.connectivitymanagertest.functional;
 
-import com.android.connectivitymanagertest.ConnectivityManagerTestActivity;
-import com.android.connectivitymanagertest.UtilHelper;
-
-import android.content.Intent;
 import android.content.Context;
-import android.os.PowerManager;
-import android.os.PowerManager.WakeLock;
-import android.app.Instrumentation;
-import android.os.Handler;
-import android.os.Message;
-import android.provider.Settings;
 import android.net.ConnectivityManager;
 import android.net.NetworkInfo;
 import android.net.NetworkInfo.State;
-import android.net.NetworkInfo.DetailedState;
 import android.net.wifi.WifiManager;
-
-import android.test.suitebuilder.annotation.LargeTest;
+import android.os.PowerManager;
+import android.os.PowerManager.WakeLock;
+import android.provider.Settings;
 import android.test.ActivityInstrumentationTestCase2;
-import com.android.connectivitymanagertest.ConnectivityManagerTestRunner;
-import com.android.connectivitymanagertest.NetworkState;
+import android.test.suitebuilder.annotation.LargeTest;
 import android.util.Log;
 
-public class ConnectivityManagerMobileTest
-    extends ActivityInstrumentationTestCase2<ConnectivityManagerTestActivity> {
+import com.android.connectivitymanagertest.ConnectivityManagerTestActivity;
+import com.android.connectivitymanagertest.ConnectivityManagerTestRunner;
+import com.android.connectivitymanagertest.NetworkState;
+import com.android.connectivitymanagertest.UtilHelper;
+
+public class ConnectivityManagerMobileTest extends
+        ActivityInstrumentationTestCase2<ConnectivityManagerTestActivity> {
     private static final String LOG_TAG = "ConnectivityManagerMobileTest";
-    private static final String PKG_NAME = "com.android.connectivitymanagertest";
 
     private String TEST_ACCESS_POINT;
     private ConnectivityManagerTestActivity cmActivity;
     private WakeLock wl;
+    private boolean mIsWifiOnlyDevice;
 
     public ConnectivityManagerMobileTest() {
         super(ConnectivityManagerTestActivity.class);
@@ -69,7 +63,8 @@
             log("airplane is not disabled, disable it.");
             cmActivity.setAirplaneMode(getInstrumentation().getContext(), false);
         }
-        if (!UtilHelper.isWifiOnly()) {
+        mIsWifiOnlyDevice = UtilHelper.isWifiOnly(mRunner.getTargetContext());
+        if (!mIsWifiOnlyDevice) {
             if (!cmActivity.waitForNetworkState(ConnectivityManager.TYPE_MOBILE, State.CONNECTED,
                     ConnectivityManagerTestActivity.LONG_TIMEOUT)) {
                 // Note: When the test fails in setUp(), tearDown is not called. In that case,
@@ -166,7 +161,7 @@
     public void testConnectToWifi() {
         assertNotNull("SSID is null", TEST_ACCESS_POINT);
         NetworkInfo networkInfo;
-        if (!UtilHelper.isWifiOnly()) {
+        if (!mIsWifiOnlyDevice) {
             //Prepare for connectivity verification
             networkInfo = cmActivity.mCM.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
             cmActivity.setStateTransitionCriteria(ConnectivityManager.TYPE_MOBILE,
@@ -185,7 +180,7 @@
         log("wifi state is enabled");
         assertTrue(cmActivity.waitForNetworkState(ConnectivityManager.TYPE_WIFI, State.CONNECTED,
                 ConnectivityManagerTestActivity.LONG_TIMEOUT));
-        if (!UtilHelper.isWifiOnly()) {
+        if (!mIsWifiOnlyDevice) {
             assertTrue(cmActivity.waitForNetworkState(ConnectivityManager.TYPE_MOBILE,
                     State.DISCONNECTED, ConnectivityManagerTestActivity.LONG_TIMEOUT));
         }
@@ -197,7 +192,7 @@
                     cmActivity.getTransitionFailureReason(ConnectivityManager.TYPE_WIFI));
             assertTrue(false);
         }
-        if (!UtilHelper.isWifiOnly()) {
+        if (!mIsWifiOnlyDevice) {
             if (!cmActivity.validateNetworkStates(ConnectivityManager.TYPE_MOBILE)) {
                 log("Mobile state transition validation failed.");
                 log("reason: " +
@@ -232,13 +227,13 @@
                 ConnectivityManagerTestActivity.LONG_TIMEOUT));
         assertTrue(cmActivity.waitForNetworkState(ConnectivityManager.TYPE_WIFI,
                 State.DISCONNECTED, ConnectivityManagerTestActivity.LONG_TIMEOUT));
-        if (!UtilHelper.isWifiOnly()) {
+        if (!mIsWifiOnlyDevice) {
             assertTrue(cmActivity.waitForNetworkState(ConnectivityManager.TYPE_MOBILE,
                     State.CONNECTED, ConnectivityManagerTestActivity.LONG_TIMEOUT));
         }
 
         NetworkInfo networkInfo;
-        if (!UtilHelper.isWifiOnly()) {
+        if (!mIsWifiOnlyDevice) {
             //Prepare for connectivity state verification
             networkInfo = cmActivity.mCM.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
             cmActivity.setStateTransitionCriteria(ConnectivityManager.TYPE_MOBILE,
@@ -258,7 +253,7 @@
         // Wait for Wifi to be connected and mobile to be disconnected
         assertTrue(cmActivity.waitForNetworkState(ConnectivityManager.TYPE_WIFI, State.CONNECTED,
                 ConnectivityManagerTestActivity.LONG_TIMEOUT));
-        if (!UtilHelper.isWifiOnly()) {
+        if (!mIsWifiOnlyDevice) {
             assertTrue(cmActivity.waitForNetworkState(ConnectivityManager.TYPE_MOBILE,
                     State.DISCONNECTED, ConnectivityManagerTestActivity.LONG_TIMEOUT));
         }
@@ -288,7 +283,7 @@
         sleep(ConnectivityManagerTestActivity.SHORT_TIMEOUT);
 
         NetworkInfo networkInfo;
-        if (!UtilHelper.isWifiOnly()) {
+        if (!mIsWifiOnlyDevice) {
             networkInfo = cmActivity.mCM.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
             cmActivity.setStateTransitionCriteria(ConnectivityManager.TYPE_MOBILE,
                                                   networkInfo.getState(),
@@ -304,7 +299,7 @@
 
         assertTrue(cmActivity.waitForNetworkState(ConnectivityManager.TYPE_WIFI, State.DISCONNECTED,
                 ConnectivityManagerTestActivity.LONG_TIMEOUT));
-        if (!UtilHelper.isWifiOnly()) {
+        if (!mIsWifiOnlyDevice) {
             assertTrue(cmActivity.waitForNetworkState(ConnectivityManager.TYPE_MOBILE,
                     State.CONNECTED, ConnectivityManagerTestActivity.LONG_TIMEOUT));
         }
@@ -316,7 +311,7 @@
                     cmActivity.getTransitionFailureReason(ConnectivityManager.TYPE_WIFI));
             assertTrue(false);
         }
-        if (!UtilHelper.isWifiOnly()) {
+        if (!mIsWifiOnlyDevice) {
             if (!cmActivity.validateNetworkStates(ConnectivityManager.TYPE_MOBILE)) {
                 log("Mobile state transition validation failed.");
                 log("reason: " +
@@ -393,7 +388,7 @@
         cmActivity.setAirplaneMode(getInstrumentation().getContext(), true);
 
         NetworkInfo networkInfo;
-        if (!UtilHelper.isWifiOnly()) {
+        if (!mIsWifiOnlyDevice) {
             assertTrue(cmActivity.waitForNetworkState(ConnectivityManager.TYPE_MOBILE,
                     State.DISCONNECTED, ConnectivityManagerTestActivity.LONG_TIMEOUT));
             networkInfo = cmActivity.mCM.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
@@ -419,7 +414,7 @@
                     cmActivity.getTransitionFailureReason(ConnectivityManager.TYPE_WIFI));
             assertTrue("State validation failed", false);
         }
-        if (!UtilHelper.isWifiOnly()) {
+        if (!mIsWifiOnlyDevice) {
             if (!cmActivity.validateNetworkStates(ConnectivityManager.TYPE_MOBILE)) {
                 log("state validation for Mobile failed");
                 log("reason: " +
@@ -471,7 +466,7 @@
 
         assertTrue(cmActivity.waitForNetworkState(ConnectivityManager.TYPE_WIFI, State.CONNECTED,
                             ConnectivityManagerTestActivity.LONG_TIMEOUT));
-        if (!UtilHelper.isWifiOnly()) {
+        if (!mIsWifiOnlyDevice) {
             assertTrue(cmActivity.waitForNetworkState(ConnectivityManager.TYPE_MOBILE,
                     State.DISCONNECTED, ConnectivityManagerTestActivity.LONG_TIMEOUT));
         }
diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java
index 2069789..feb63cd 100644
--- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java
+++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java
@@ -16,10 +16,6 @@
 
 package com.android.connectivitymanagertest.stress;
 
-import com.android.connectivitymanagertest.ConnectivityManagerStressTestRunner;
-import com.android.connectivitymanagertest.ConnectivityManagerTestActivity;
-import com.android.connectivitymanagertest.UtilHelper;
-
 import android.content.Context;
 import android.net.ConnectivityManager;
 import android.net.NetworkInfo.State;
@@ -31,15 +27,15 @@
 import android.net.wifi.WifiManager;
 import android.os.Environment;
 import android.os.PowerManager;
-import android.os.IPowerManager;
-import android.os.SystemClock;
-import android.os.ServiceManager;
 import android.provider.Settings;
 import android.test.ActivityInstrumentationTestCase2;
 import android.test.suitebuilder.annotation.LargeTest;
-
 import android.util.Log;
 
+import com.android.connectivitymanagertest.ConnectivityManagerStressTestRunner;
+import com.android.connectivitymanagertest.ConnectivityManagerTestActivity;
+import com.android.connectivitymanagertest.UtilHelper;
+
 import java.io.BufferedWriter;
 import java.io.File;
 import java.io.FileWriter;
@@ -79,6 +75,7 @@
     private String mPassword;
     private ConnectivityManagerStressTestRunner mRunner;
     private BufferedWriter mOutputWriter = null;
+    private boolean mIsWifiOnlyDevice;
 
     public WifiStressTest() {
         super(ConnectivityManagerTestActivity.class);
@@ -100,6 +97,7 @@
         mOutputWriter = new BufferedWriter(new FileWriter(new File(
                 Environment.getExternalStorageDirectory(), OUTPUT_FILE), true));
         mAct.turnScreenOn();
+        mIsWifiOnlyDevice = UtilHelper.isWifiOnly(mRunner.getTargetContext());
         if (!mAct.mWifiManager.isWifiEnabled()) {
             log("Enable wi-fi before stress tests.");
             if (!mAct.enableWifi()) {
@@ -271,7 +269,7 @@
             assertTrue("Wait for Wi-Fi to idle timeout",
                     mAct.waitForNetworkState(ConnectivityManager.TYPE_WIFI, State.DISCONNECTED,
                     6 * ConnectivityManagerTestActivity.SHORT_TIMEOUT));
-            if (!UtilHelper.isWifiOnly()) {
+            if (!mIsWifiOnlyDevice) {
                 // use long timeout as the pppd startup may take several retries.
                 assertTrue("Wait for cellular connection timeout",
                         mAct.waitForNetworkState(ConnectivityManager.TYPE_MOBILE, State.CONNECTED,
@@ -282,7 +280,7 @@
             assertEquals("Wi-Fi is reconnected", State.DISCONNECTED,
                     mAct.mCM.getNetworkInfo(ConnectivityManager.TYPE_WIFI).getState());
 
-            if (!UtilHelper.isWifiOnly()) {
+            if (!mIsWifiOnlyDevice) {
                 assertEquals("Cellular connection is down", State.CONNECTED,
                              mAct.mCM.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).getState());
                 assertTrue("Mobile is connected, but no data connection.", mAct.pingTest(null));
diff --git a/core/tests/bandwidthtests/src/com/android/bandwidthtest/util/ConnectionUtil.java b/core/tests/bandwidthtests/src/com/android/bandwidthtest/util/ConnectionUtil.java
index a5e5ab0e..dfcbba9 100644
--- a/core/tests/bandwidthtests/src/com/android/bandwidthtest/util/ConnectionUtil.java
+++ b/core/tests/bandwidthtests/src/com/android/bandwidthtest/util/ConnectionUtil.java
@@ -146,10 +146,10 @@
                 Log.v("ConnectivityReceiver", "onReceive() called with " + intent);
                 return;
             }
-            if (intent.hasExtra(ConnectivityManager.EXTRA_NETWORK_INFO)) {
-                mNetworkInfo = (NetworkInfo)
-                        intent.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO);
-            }
+
+            final ConnectivityManager connManager = (ConnectivityManager) context
+                    .getSystemService(Context.CONNECTIVITY_SERVICE);
+            mNetworkInfo = connManager.getActiveNetworkInfo();
 
             if (intent.hasExtra(ConnectivityManager.EXTRA_OTHER_NETWORK_INFO)) {
                 mOtherNetworkInfo = (NetworkInfo)
diff --git a/core/tests/coretests/Android.mk b/core/tests/coretests/Android.mk
index b2ebb08..b81f774 100644
--- a/core/tests/coretests/Android.mk
+++ b/core/tests/coretests/Android.mk
@@ -1,4 +1,14 @@
-LOCAL_PATH:= $(call my-dir)
+ACTUAL_LOCAL_PATH := $(call my-dir)
+
+# this var will hold all the test apk module names later.
+FrameworkCoreTests_all_apks :=
+
+# We have to include the subdir makefiles first
+# so that FrameworkCoreTests_all_apks will be populated correctly.
+include $(call all-makefiles-under,$(ACTUAL_LOCAL_PATH))
+
+LOCAL_PATH := $(ACTUAL_LOCAL_PATH)
+
 include $(CLEAR_VARS)
 
 # We only want this apk build for tests.
@@ -18,6 +28,21 @@
 
 LOCAL_CERTIFICATE := platform
 
-include $(BUILD_PACKAGE)
+# intermediate dir to include all the test apks as raw resource
+FrameworkCoreTests_intermediates := $(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME))/test_apks/res
+LOCAL_RESOURCE_DIR := $(FrameworkCoreTests_intermediates) $(LOCAL_PATH)/res
 
-include $(call all-makefiles-under,$(LOCAL_PATH))
+include $(BUILD_PACKAGE)
+# Rules to copy all the test apks to the intermediate raw resource directory
+FrameworkCoreTests_all_apks_res := $(addprefix $(FrameworkCoreTests_intermediates)/raw/, \
+    $(foreach a, $(FrameworkCoreTests_all_apks), $(patsubst FrameworkCoreTests_%,%,$(a))))
+
+$(FrameworkCoreTests_all_apks_res): $(FrameworkCoreTests_intermediates)/raw/%: $(call intermediates-dir-for,APPS,FrameworkCoreTests_%)/package.apk | $(ACP)
+	$(call copy-file-to-new-target)
+
+# Use R_file_stamp as dependency because we want the test apks in place before the R.java is generated.
+$(R_file_stamp) : $(FrameworkCoreTests_all_apks_res)
+
+FrameworkCoreTests_all_apks :=
+FrameworkCoreTests_intermediates :=
+FrameworkCoreTests_all_apks_res :=
diff --git a/core/tests/coretests/apks/Android.mk b/core/tests/coretests/apks/Android.mk
index 4670e21..98c0c2a 100644
--- a/core/tests/coretests/apks/Android.mk
+++ b/core/tests/coretests/apks/Android.mk
@@ -1,5 +1,7 @@
 LOCAL_PATH:= $(call my-dir)
 include $(CLEAR_VARS)
 
+FrameworkCoreTests_BUILD_PACKAGE := $(LOCAL_PATH)/FrameworkCoreTests_apk.mk
+
 # build sub packages
 include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/core/tests/coretests/apks/FrameworkCoreTests_apk.mk b/core/tests/coretests/apks/FrameworkCoreTests_apk.mk
new file mode 100644
index 0000000..ac545ca
--- /dev/null
+++ b/core/tests/coretests/apks/FrameworkCoreTests_apk.mk
@@ -0,0 +1,12 @@
+
+LOCAL_MODULE_TAGS := tests
+
+# Disable dexpreopt.
+LOCAL_DEX_PREOPT := false
+
+# Make sure every package name gets the FrameworkCoreTests_ prefix.
+LOCAL_PACKAGE_NAME := FrameworkCoreTests_$(LOCAL_PACKAGE_NAME)
+
+FrameworkCoreTests_all_apks += $(LOCAL_PACKAGE_NAME)
+
+include $(BUILD_PACKAGE)
diff --git a/core/tests/coretests/apks/install_decl_perm/Android.mk b/core/tests/coretests/apks/install_decl_perm/Android.mk
index c38e981..86370c8 100644
--- a/core/tests/coretests/apks/install_decl_perm/Android.mk
+++ b/core/tests/coretests/apks/install_decl_perm/Android.mk
@@ -1,11 +1,8 @@
 LOCAL_PATH:= $(call my-dir)
 include $(CLEAR_VARS)
 
-LOCAL_MODULE_TAGS := tests
-
 LOCAL_SRC_FILES := $(call all-subdir-java-files)
 
-LOCAL_PACKAGE_NAME := FrameworkCoreTests_install_decl_perm
+LOCAL_PACKAGE_NAME := install_decl_perm
 
-include $(BUILD_PACKAGE)
-
+include $(FrameworkCoreTests_BUILD_PACKAGE)
diff --git a/core/tests/coretests/apks/install_loc_auto/Android.mk b/core/tests/coretests/apks/install_loc_auto/Android.mk
index 2deb978..6435f36 100644
--- a/core/tests/coretests/apks/install_loc_auto/Android.mk
+++ b/core/tests/coretests/apks/install_loc_auto/Android.mk
@@ -1,11 +1,8 @@
 LOCAL_PATH:= $(call my-dir)
 include $(CLEAR_VARS)
 
-LOCAL_MODULE_TAGS := tests
-
 LOCAL_SRC_FILES := $(call all-subdir-java-files)
 
-LOCAL_PACKAGE_NAME := FrameworkCoreTests_install_loc_auto
+LOCAL_PACKAGE_NAME := install_loc_auto
 
-include $(BUILD_PACKAGE)
-
+include $(FrameworkCoreTests_BUILD_PACKAGE)
diff --git a/core/tests/coretests/apks/install_loc_internal/Android.mk b/core/tests/coretests/apks/install_loc_internal/Android.mk
index 784bf0a..8cc8b8e 100644
--- a/core/tests/coretests/apks/install_loc_internal/Android.mk
+++ b/core/tests/coretests/apks/install_loc_internal/Android.mk
@@ -1,11 +1,8 @@
 LOCAL_PATH:= $(call my-dir)
 include $(CLEAR_VARS)
 
-LOCAL_MODULE_TAGS := tests
-
 LOCAL_SRC_FILES := $(call all-subdir-java-files)
 
-LOCAL_PACKAGE_NAME := FrameworkCoreTests_install_loc_internal
+LOCAL_PACKAGE_NAME := install_loc_internal
 
-include $(BUILD_PACKAGE)
-
+include $(FrameworkCoreTests_BUILD_PACKAGE)
diff --git a/core/tests/coretests/apks/install_loc_sdcard/Android.mk b/core/tests/coretests/apks/install_loc_sdcard/Android.mk
index 4eea322..e1411c2 100644
--- a/core/tests/coretests/apks/install_loc_sdcard/Android.mk
+++ b/core/tests/coretests/apks/install_loc_sdcard/Android.mk
@@ -1,11 +1,8 @@
 LOCAL_PATH:= $(call my-dir)
 include $(CLEAR_VARS)
 
-LOCAL_MODULE_TAGS := tests
-
 LOCAL_SRC_FILES := $(call all-subdir-java-files)
 
-LOCAL_PACKAGE_NAME := FrameworkCoreTests_install_loc_sdcard
+LOCAL_PACKAGE_NAME := install_loc_sdcard
 
-include $(BUILD_PACKAGE)
-
+include $(FrameworkCoreTests_BUILD_PACKAGE)
diff --git a/core/tests/coretests/apks/install_loc_unspecified/Android.mk b/core/tests/coretests/apks/install_loc_unspecified/Android.mk
index 206c99f..0741d04 100644
--- a/core/tests/coretests/apks/install_loc_unspecified/Android.mk
+++ b/core/tests/coretests/apks/install_loc_unspecified/Android.mk
@@ -1,11 +1,8 @@
 LOCAL_PATH:= $(call my-dir)
 include $(CLEAR_VARS)
 
-LOCAL_MODULE_TAGS := tests
-
 LOCAL_SRC_FILES := $(call all-subdir-java-files)
 
-LOCAL_PACKAGE_NAME := FrameworkCoreTests_install_loc_unspecified
+LOCAL_PACKAGE_NAME := install_loc_unspecified
 
-include $(BUILD_PACKAGE)
-
+include $(FrameworkCoreTests_BUILD_PACKAGE)
diff --git a/core/tests/coretests/apks/install_use_perm_good/Android.mk b/core/tests/coretests/apks/install_use_perm_good/Android.mk
index 1a07fc8..e2661a1 100644
--- a/core/tests/coretests/apks/install_use_perm_good/Android.mk
+++ b/core/tests/coretests/apks/install_use_perm_good/Android.mk
@@ -1,11 +1,8 @@
 LOCAL_PATH:= $(call my-dir)
 include $(CLEAR_VARS)
 
-LOCAL_MODULE_TAGS := tests
-
 LOCAL_SRC_FILES := $(call all-subdir-java-files)
 
-LOCAL_PACKAGE_NAME := FrameworkCoreTests_install_use_perm_good
+LOCAL_PACKAGE_NAME := install_use_perm_good
 
-include $(BUILD_PACKAGE)
-
+include $(FrameworkCoreTests_BUILD_PACKAGE)
diff --git a/core/tests/coretests/apks/install_uses_feature/Android.mk b/core/tests/coretests/apks/install_uses_feature/Android.mk
index c0a5067..b60d734 100644
--- a/core/tests/coretests/apks/install_uses_feature/Android.mk
+++ b/core/tests/coretests/apks/install_uses_feature/Android.mk
@@ -1,11 +1,8 @@
 LOCAL_PATH:= $(call my-dir)
 include $(CLEAR_VARS)
 
-LOCAL_MODULE_TAGS := tests
-
 LOCAL_SRC_FILES := $(call all-subdir-java-files)
 
-LOCAL_PACKAGE_NAME := FrameworkCoreTests_install_uses_feature
+LOCAL_PACKAGE_NAME := install_uses_feature
 
-include $(BUILD_PACKAGE)
-
+include $(FrameworkCoreTests_BUILD_PACKAGE)
diff --git a/core/tests/coretests/apks/install_verifier_bad/Android.mk b/core/tests/coretests/apks/install_verifier_bad/Android.mk
index b50cfd04..a6f9d5b 100644
--- a/core/tests/coretests/apks/install_verifier_bad/Android.mk
+++ b/core/tests/coretests/apks/install_verifier_bad/Android.mk
@@ -1,11 +1,8 @@
 LOCAL_PATH:= $(call my-dir)
 include $(CLEAR_VARS)
 
-LOCAL_MODULE_TAGS := tests
-
 LOCAL_SRC_FILES := $(call all-subdir-java-files)
 
-LOCAL_PACKAGE_NAME := FrameworkCoreTests_install_verifier_bad
+LOCAL_PACKAGE_NAME := install_verifier_bad
 
-include $(BUILD_PACKAGE)
-
+include $(FrameworkCoreTests_BUILD_PACKAGE)
diff --git a/core/tests/coretests/apks/install_verifier_good/Android.mk b/core/tests/coretests/apks/install_verifier_good/Android.mk
index a48a80e..6f2d44f 100644
--- a/core/tests/coretests/apks/install_verifier_good/Android.mk
+++ b/core/tests/coretests/apks/install_verifier_good/Android.mk
@@ -1,10 +1,8 @@
 LOCAL_PATH:= $(call my-dir)
 include $(CLEAR_VARS)
 
-LOCAL_MODULE_TAGS := tests
-
 LOCAL_SRC_FILES := $(call all-subdir-java-files)
 
-LOCAL_PACKAGE_NAME := FrameworkCoreTests_install_verifier_good
+LOCAL_PACKAGE_NAME := install_verifier_good
 
-include $(BUILD_PACKAGE)
+include $(FrameworkCoreTests_BUILD_PACKAGE)
diff --git a/core/tests/coretests/res/raw/install_decl_perm b/core/tests/coretests/res/raw/install_decl_perm
deleted file mode 100644
index af05d81..0000000
--- a/core/tests/coretests/res/raw/install_decl_perm
+++ /dev/null
Binary files differ
diff --git a/core/tests/coretests/res/raw/install_loc_auto b/core/tests/coretests/res/raw/install_loc_auto
deleted file mode 100644
index 63bf35c..0000000
--- a/core/tests/coretests/res/raw/install_loc_auto
+++ /dev/null
Binary files differ
diff --git a/core/tests/coretests/res/raw/install_loc_internal b/core/tests/coretests/res/raw/install_loc_internal
deleted file mode 100644
index 5178803..0000000
--- a/core/tests/coretests/res/raw/install_loc_internal
+++ /dev/null
Binary files differ
diff --git a/core/tests/coretests/res/raw/install_loc_sdcard b/core/tests/coretests/res/raw/install_loc_sdcard
deleted file mode 100644
index 013a414..0000000
--- a/core/tests/coretests/res/raw/install_loc_sdcard
+++ /dev/null
Binary files differ
diff --git a/core/tests/coretests/res/raw/install_loc_unspecified b/core/tests/coretests/res/raw/install_loc_unspecified
deleted file mode 100644
index 06981f4..0000000
--- a/core/tests/coretests/res/raw/install_loc_unspecified
+++ /dev/null
Binary files differ
diff --git a/core/tests/coretests/res/raw/install_use_perm_good b/core/tests/coretests/res/raw/install_use_perm_good
deleted file mode 100644
index a7eb32f..0000000
--- a/core/tests/coretests/res/raw/install_use_perm_good
+++ /dev/null
Binary files differ
diff --git a/core/tests/coretests/res/raw/install_uses_feature b/core/tests/coretests/res/raw/install_uses_feature
deleted file mode 100644
index eeeb309..0000000
--- a/core/tests/coretests/res/raw/install_uses_feature
+++ /dev/null
Binary files differ
diff --git a/core/tests/coretests/src/android/accessibilityservice/InterrogationActivity.java b/core/tests/coretests/src/android/accessibilityservice/InterrogationActivity.java
index b4a0581..a9f144b 100644
--- a/core/tests/coretests/src/android/accessibilityservice/InterrogationActivity.java
+++ b/core/tests/coretests/src/android/accessibilityservice/InterrogationActivity.java
@@ -14,12 +14,12 @@
 
 package android.accessibilityservice;
 
-import com.android.frameworks.coretests.R;
-
 import android.app.Activity;
 import android.os.Bundle;
 import android.view.View;
 
+import com.android.frameworks.coretests.R;
+
 /**
  * Activity for testing the accessibility APIs for "interrogation" of
  * the screen content. These APIs allow exploring the screen and
diff --git a/core/tests/coretests/src/android/accessibilityservice/InterrogationActivityTest.java b/core/tests/coretests/src/android/accessibilityservice/InterrogationActivityTest.java
index 259a094..2fb4237 100644
--- a/core/tests/coretests/src/android/accessibilityservice/InterrogationActivityTest.java
+++ b/core/tests/coretests/src/android/accessibilityservice/InterrogationActivityTest.java
@@ -14,26 +14,21 @@
 
 package android.accessibilityservice;
 
-import static android.view.accessibility.AccessibilityNodeInfo.ACTION_CLEAR_FOCUS;
-import static android.view.accessibility.AccessibilityNodeInfo.ACTION_CLEAR_SELECTION;
 import static android.view.accessibility.AccessibilityNodeInfo.ACTION_FOCUS;
+import static android.view.accessibility.AccessibilityNodeInfo.ACTION_CLEAR_FOCUS;
 import static android.view.accessibility.AccessibilityNodeInfo.ACTION_SELECT;
+import static android.view.accessibility.AccessibilityNodeInfo.ACTION_CLEAR_SELECTION;
 
-import android.content.Context;
 import android.graphics.Rect;
-import android.os.ServiceManager;
 import android.os.SystemClock;
 import android.test.ActivityInstrumentationTestCase2;
 import android.test.suitebuilder.annotation.LargeTest;
 import android.util.Log;
-import android.view.View;
 import android.view.accessibility.AccessibilityEvent;
-import android.view.accessibility.AccessibilityInteractionClient;
-import android.view.accessibility.AccessibilityManager;
 import android.view.accessibility.AccessibilityNodeInfo;
-import android.view.accessibility.IAccessibilityManager;
 
 import com.android.frameworks.coretests.R;
+import com.android.internal.util.Predicate;
 
 import java.util.ArrayList;
 import java.util.LinkedList;
@@ -48,21 +43,15 @@
  */
 public class InterrogationActivityTest
         extends ActivityInstrumentationTestCase2<InterrogationActivity> {
-    private static final boolean DEBUG = true;
+    private static final boolean DEBUG = false;
 
     private static String LOG_TAG = "InterrogationActivityTest";
 
-    // Timeout before give up wait for the system to process an accessibility setting change.       
-    private static final int TIMEOUT_PROPAGATE_ACCESSIBLITY_SETTING = 2000;
-
     // Timeout for the accessibility state of an Activity to be fully initialized.
-    private static final int TIMEOUT_ACCESSIBLITY_STATE_INITIALIZED_MILLIS = 100;
+    private static final int TIMEOUT_PROPAGATE_ACCESSIBILITY_EVENT_MILLIS = 5000;
 
     // Handle to a connection to the AccessibilityManagerService
-    private static int sConnectionId = View.NO_ID;
-
-    // The last received accessibility event
-    private volatile AccessibilityEvent mLastAccessibilityEvent;
+    private UiTestAutomationBridge mUiTestAutomationBridge;
 
     public InterrogationActivityTest() {
         super(InterrogationActivity.class);
@@ -70,16 +59,39 @@
 
     @Override
     public void setUp() throws Exception {
-        ensureConnection();
-        bringUpActivityWithInitalizedAccessbility();
+        super.setUp();
+        mUiTestAutomationBridge = new UiTestAutomationBridge();
+        mUiTestAutomationBridge.connect();
+        mUiTestAutomationBridge.executeCommandAndWaitForAccessibilityEvent(new Runnable() {
+                // wait for the first accessibility event
+                @Override
+                public void run() {
+                    // bring up the activity
+                    getActivity();
+                }
+            },
+            new Predicate<AccessibilityEvent>() {
+                @Override
+                public boolean apply(AccessibilityEvent event) {
+                    return (event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED
+                            && event.getPackageName().equals(getActivity().getPackageName()));
+                }
+            },
+            TIMEOUT_PROPAGATE_ACCESSIBILITY_EVENT_MILLIS);
+    }
+
+    @Override
+    public void tearDown() throws Exception {
+        mUiTestAutomationBridge.disconnect();
+        super.tearDown();
     }
 
     @LargeTest
     public void testFindAccessibilityNodeInfoByViewId() throws Exception {
         final long startTimeMillis = SystemClock.uptimeMillis();
         try {
-            AccessibilityNodeInfo button = AccessibilityInteractionClient.getInstance()
-                .findAccessibilityNodeInfoByViewIdInActiveWindow(sConnectionId, R.id.button5);
+            AccessibilityNodeInfo button = mUiTestAutomationBridge
+                .findAccessibilityNodeInfoByViewIdInActiveWindow(R.id.button5);
             assertNotNull(button);
             assertEquals(0, button.getChildCount());
 
@@ -125,8 +137,8 @@
         final long startTimeMillis = SystemClock.uptimeMillis();
         try {
             // find a view by text
-            List<AccessibilityNodeInfo> buttons =  AccessibilityInteractionClient.getInstance()
-                .findAccessibilityNodeInfosByTextInActiveWindow(sConnectionId, "butto");
+            List<AccessibilityNodeInfo> buttons = mUiTestAutomationBridge
+                .findAccessibilityNodeInfosByTextInActiveWindow("butto");
             assertEquals(9, buttons.size());
         } finally {
             if (DEBUG) {
@@ -141,12 +153,9 @@
     public void testFindAccessibilityNodeInfoByViewTextContentDescription() throws Exception {
         final long startTimeMillis = SystemClock.uptimeMillis();
         try {
-            bringUpActivityWithInitalizedAccessbility();
-
             // find a view by text
-            List<AccessibilityNodeInfo> buttons =  AccessibilityInteractionClient.getInstance()
-                .findAccessibilityNodeInfosByTextInActiveWindow(sConnectionId,
-                        "contentDescription");
+            List<AccessibilityNodeInfo> buttons = mUiTestAutomationBridge
+                .findAccessibilityNodeInfosByTextInActiveWindow("contentDescription");
             assertEquals(1, buttons.size());
         } finally {
             if (DEBUG) {
@@ -177,8 +186,8 @@
             classNameAndTextList.add("android.widget.ButtonButton8");
             classNameAndTextList.add("android.widget.ButtonButton9");
 
-            AccessibilityNodeInfo root = AccessibilityInteractionClient.getInstance()
-                .findAccessibilityNodeInfoByViewIdInActiveWindow(sConnectionId, R.id.root);
+            AccessibilityNodeInfo root = mUiTestAutomationBridge
+                .findAccessibilityNodeInfoByViewIdInActiveWindow(R.id.root);
             assertNotNull("We must find the existing root.", root);
 
             Queue<AccessibilityNodeInfo> fringe = new LinkedList<AccessibilityNodeInfo>();
@@ -216,16 +225,16 @@
         final long startTimeMillis = SystemClock.uptimeMillis();
         try {
             // find a view and make sure it is not focused
-            AccessibilityNodeInfo button = AccessibilityInteractionClient.getInstance()
-                .findAccessibilityNodeInfoByViewIdInActiveWindow(sConnectionId, R.id.button5);
+            AccessibilityNodeInfo button = mUiTestAutomationBridge
+                .findAccessibilityNodeInfoByViewIdInActiveWindow(R.id.button5);
             assertFalse(button.isFocused());
 
             // focus the view
             assertTrue(button.performAction(ACTION_FOCUS));
 
             // find the view again and make sure it is focused
-            button = AccessibilityInteractionClient.getInstance()
-                .findAccessibilityNodeInfoByViewIdInActiveWindow(sConnectionId, R.id.button5);
+            button = mUiTestAutomationBridge
+                    .findAccessibilityNodeInfoByViewIdInActiveWindow(R.id.button5);
             assertTrue(button.isFocused());
         } finally {
             if (DEBUG) {
@@ -240,24 +249,24 @@
         final long startTimeMillis = SystemClock.uptimeMillis();
         try {
             // find a view and make sure it is not focused
-            AccessibilityNodeInfo button = AccessibilityInteractionClient.getInstance()
-                .findAccessibilityNodeInfoByViewIdInActiveWindow(sConnectionId, R.id.button5);
+            AccessibilityNodeInfo button = mUiTestAutomationBridge
+                .findAccessibilityNodeInfoByViewIdInActiveWindow(R.id.button5);
             assertFalse(button.isFocused());
 
             // focus the view
             assertTrue(button.performAction(ACTION_FOCUS));
 
             // find the view again and make sure it is focused
-            button = AccessibilityInteractionClient.getInstance()
-                .findAccessibilityNodeInfoByViewIdInActiveWindow(sConnectionId, R.id.button5);
+            button = mUiTestAutomationBridge
+                .findAccessibilityNodeInfoByViewIdInActiveWindow(R.id.button5);
             assertTrue(button.isFocused());
 
             // unfocus the view
             assertTrue(button.performAction(ACTION_CLEAR_FOCUS));
 
             // find the view again and make sure it is not focused
-            button = AccessibilityInteractionClient.getInstance()
-                .findAccessibilityNodeInfoByViewIdInActiveWindow(sConnectionId, R.id.button5);
+            button = mUiTestAutomationBridge
+                .findAccessibilityNodeInfoByViewIdInActiveWindow(R.id.button5);
             assertFalse(button.isFocused());
         } finally {
             if (DEBUG) {
@@ -273,16 +282,16 @@
         final long startTimeMillis = SystemClock.uptimeMillis();
         try {
             // find a view and make sure it is not selected
-            AccessibilityNodeInfo button = AccessibilityInteractionClient.getInstance()
-                .findAccessibilityNodeInfoByViewIdInActiveWindow(sConnectionId, R.id.button5);
+            AccessibilityNodeInfo button = mUiTestAutomationBridge
+                .findAccessibilityNodeInfoByViewIdInActiveWindow(R.id.button5);
             assertFalse(button.isSelected());
 
             // select the view
             assertTrue(button.performAction(ACTION_SELECT));
 
             // find the view again and make sure it is selected
-            button = AccessibilityInteractionClient.getInstance()
-                .findAccessibilityNodeInfoByViewIdInActiveWindow(sConnectionId, R.id.button5);
+            button = mUiTestAutomationBridge
+                .findAccessibilityNodeInfoByViewIdInActiveWindow(R.id.button5);
             assertTrue(button.isSelected());
         } finally {
             if (DEBUG) {
@@ -297,24 +306,24 @@
         final long startTimeMillis = SystemClock.uptimeMillis();
         try {
             // find a view and make sure it is not selected
-            AccessibilityNodeInfo button = AccessibilityInteractionClient.getInstance()
-                .findAccessibilityNodeInfoByViewIdInActiveWindow(sConnectionId, R.id.button5);
+            AccessibilityNodeInfo button = mUiTestAutomationBridge
+                .findAccessibilityNodeInfoByViewIdInActiveWindow(R.id.button5);
             assertFalse(button.isSelected());
 
             // select the view
             assertTrue(button.performAction(ACTION_SELECT));
 
             // find the view again and make sure it is selected
-            button = AccessibilityInteractionClient.getInstance()
-                .findAccessibilityNodeInfoByViewIdInActiveWindow(sConnectionId, R.id.button5);
+            button = mUiTestAutomationBridge
+                .findAccessibilityNodeInfoByViewIdInActiveWindow(R.id.button5);
             assertTrue(button.isSelected());
 
             // unselect the view
             assertTrue(button.performAction(ACTION_CLEAR_SELECTION));
 
             // find the view again and make sure it is not selected
-            button = AccessibilityInteractionClient.getInstance()
-                .findAccessibilityNodeInfoByViewIdInActiveWindow(sConnectionId, R.id.button5);
+            button = mUiTestAutomationBridge
+                .findAccessibilityNodeInfoByViewIdInActiveWindow(R.id.button5);
             assertFalse(button.isSelected());
         } finally {
             if (DEBUG) {
@@ -330,23 +339,33 @@
         final long startTimeMillis = SystemClock.uptimeMillis();
         try {
             // find a view and make sure it is not focused
-            AccessibilityNodeInfo button = AccessibilityInteractionClient.getInstance()
-                .findAccessibilityNodeInfoByViewIdInActiveWindow(sConnectionId, R.id.button5);
-            assertFalse(button.isSelected());
+            final AccessibilityNodeInfo button = mUiTestAutomationBridge
+                .findAccessibilityNodeInfoByViewIdInActiveWindow(R.id.button5);
+            assertFalse(button.isFocused());
 
-            // focus the view
-            assertTrue(button.performAction(ACTION_FOCUS));
-
-            synchronized (this) {
-                try {
-                    wait(TIMEOUT_ACCESSIBLITY_STATE_INITIALIZED_MILLIS);
-                } catch (InterruptedException ie) {
-                    /* ignore */
+            AccessibilityEvent event = mUiTestAutomationBridge
+                    .executeCommandAndWaitForAccessibilityEvent(new Runnable() {
+                @Override
+                public void run() {
+                    // focus the view
+                    assertTrue(button.performAction(ACTION_FOCUS));
                 }
-            }
+            },
+            new Predicate<AccessibilityEvent>() {
+                @Override
+                public boolean apply(AccessibilityEvent event) {
+                    return (event.getEventType() == AccessibilityEvent.TYPE_VIEW_FOCUSED
+                            && event.getPackageName().equals(getActivity().getPackageName())
+                            && event.getText().get(0).equals(button.getText()));
+                }
+            },
+            TIMEOUT_PROPAGATE_ACCESSIBILITY_EVENT_MILLIS);
+
+            // check the last event
+            assertNotNull(event);
 
             // check that last event source
-            AccessibilityNodeInfo source = mLastAccessibilityEvent.getSource();
+            AccessibilityNodeInfo source = event.getSource();
             assertNotNull(source);
 
             // bounds
@@ -389,8 +408,9 @@
         final long startTimeMillis = SystemClock.uptimeMillis();
         try {
             // find a view and make sure it is not focused
-            AccessibilityNodeInfo button = AccessibilityInteractionClient.getInstance()
-                .findAccessibilityNodeInfoByViewIdInActiveWindow(sConnectionId, R.id.button5);
+            AccessibilityNodeInfo button = mUiTestAutomationBridge
+                .findAccessibilityNodeInfoByViewIdInActiveWindow(R.id.button5);
+            assertNotNull(button);
             AccessibilityNodeInfo parent = button.getParent();
             final int childCount = parent.getChildCount();
             for (int i = 0; i < childCount; i++) {
@@ -411,69 +431,33 @@
         }
     }
 
-    private void bringUpActivityWithInitalizedAccessbility() {
-        mLastAccessibilityEvent = null;
-        // bring up the activity
-        getActivity();
-
+    @LargeTest
+    public void testGetRootAccessibilityNodeInfoInActiveWindow() throws Exception {
         final long startTimeMillis = SystemClock.uptimeMillis();
-        while (true) {
-            if (mLastAccessibilityEvent != null) {
-                final int eventType = mLastAccessibilityEvent.getEventType();
-                if (eventType == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {
-                    return;
+        try {
+            // get the root via the designated API
+            AccessibilityNodeInfo fetched = mUiTestAutomationBridge
+                    .getRootAccessibilityNodeInfoInActiveWindow();
+            assertNotNull(fetched);
+
+            // get the root via traversal
+            AccessibilityNodeInfo expected = mUiTestAutomationBridge
+                    .findAccessibilityNodeInfoByViewIdInActiveWindow(R.id.root);
+            while (true) {
+                AccessibilityNodeInfo parent = expected.getParent();
+                if (parent == null) {
+                    break;
                 }
+                expected = parent;
             }
-            final long remainingTimeMillis = TIMEOUT_ACCESSIBLITY_STATE_INITIALIZED_MILLIS
-                    - (SystemClock.uptimeMillis() - startTimeMillis);
-            if (remainingTimeMillis <= 0) {
-                return;
-            }
-            synchronized (this) {
-                try {
-                    wait(remainingTimeMillis);
-                } catch (InterruptedException e) {
-                    /* ignore */
-                }
-            }
-        }
-    }
+            assertNotNull(expected);
 
-    private void ensureConnection() throws Exception {
-        if (sConnectionId == View.NO_ID) {
-            IEventListener listener = new IEventListener.Stub() {
-                public void setConnection(IAccessibilityServiceConnection connection,
-                        int connectionId) {
-                    sConnectionId = connectionId;
-                    if (connection != null) {
-                        AccessibilityInteractionClient.getInstance().addConnection(connectionId,
-                                connection);
-                    } else {
-                        AccessibilityInteractionClient.getInstance().removeConnection(connectionId);
-                    }
-                    synchronized (this) {
-                        notifyAll();
-                    }
-                }
-
-                public void onInterrupt() {}
-
-                public void onAccessibilityEvent(AccessibilityEvent event) {
-                    mLastAccessibilityEvent = AccessibilityEvent.obtain(event);
-                    synchronized (this) {
-                        notifyAll();
-                    }
-                }
-            };
-
-            AccessibilityManager accessibilityManager =
-                AccessibilityManager.getInstance(getInstrumentation().getContext());
-
-            synchronized (this) {
-                IAccessibilityManager manager = IAccessibilityManager.Stub.asInterface(
-                        ServiceManager.getService(Context.ACCESSIBILITY_SERVICE));
-                manager.registerEventListener(listener);
-                wait(TIMEOUT_PROPAGATE_ACCESSIBLITY_SETTING);
+            assertEquals("The node with id \"root\" should be the root.", expected, fetched);
+        } finally {
+            if (DEBUG) {
+                final long elapsedTimeMillis = SystemClock.uptimeMillis() - startTimeMillis;
+                Log.i(LOG_TAG, "testGetRootAccessibilityNodeInfoInActiveWindow: "
+                        + elapsedTimeMillis + "ms");
             }
         }
     }
diff --git a/core/tests/coretests/src/android/app/activity/BroadcastTest.java b/core/tests/coretests/src/android/app/activity/BroadcastTest.java
index 4b1f9fd..d527c0d 100644
--- a/core/tests/coretests/src/android/app/activity/BroadcastTest.java
+++ b/core/tests/coretests/src/android/app/activity/BroadcastTest.java
@@ -303,7 +303,8 @@
     public void testSetSticky() throws Exception {
         Intent intent = new Intent(LaunchpadActivity.BROADCAST_STICKY1, null);
         intent.putExtra("test", LaunchpadActivity.DATA_1);
-        ActivityManagerNative.getDefault().unbroadcastIntent(null, intent);
+        ActivityManagerNative.getDefault().unbroadcastIntent(null, intent,
+                Binder.getOrigCallingUser());
 
         ActivityManagerNative.broadcastStickyIntent(intent, null);
         addIntermediate("finished-broadcast");
@@ -320,7 +321,8 @@
         ActivityManagerNative.broadcastStickyIntent(intent, null);
 
         ActivityManagerNative.getDefault().unbroadcastIntent(
-                null, new Intent(LaunchpadActivity.BROADCAST_STICKY1, null));
+                null, new Intent(LaunchpadActivity.BROADCAST_STICKY1, null),
+                Binder.getOrigCallingUser());
         addIntermediate("finished-unbroadcast");
 
         IntentFilter filter = new IntentFilter(LaunchpadActivity.BROADCAST_STICKY1);
diff --git a/core/tests/coretests/src/android/database/CursorWindowTest.java b/core/tests/coretests/src/android/database/CursorWindowTest.java
index 8c8081c..075f5b7 100644
--- a/core/tests/coretests/src/android/database/CursorWindowTest.java
+++ b/core/tests/coretests/src/android/database/CursorWindowTest.java
@@ -35,15 +35,45 @@
     }
 
     @SmallTest
-    public void testValuesLocalWindow() {
-        doTestValues(new CursorWindow(true));
+    public void testConstructor_WithName() {
+        CursorWindow window = new CursorWindow("MyWindow");
+        assertEquals("MyWindow", window.getName());
+        assertEquals(0, window.getStartPosition());
+        window.close();
     }
-    
+
     @SmallTest
-    public void testValuesRemoteWindow() {
-        doTestValues(new CursorWindow(false));
+    public void testConstructorWithEmptyName() {
+        CursorWindow window = new CursorWindow("");
+        assertEquals("<unnamed>", window.getName());
+        assertEquals(0, window.getStartPosition());
+        window.close();
     }
-    
+
+    @SmallTest
+    public void testConstructorWithNullName() {
+        CursorWindow window = new CursorWindow(null);
+        assertEquals("<unnamed>", window.getName());
+        assertEquals(0, window.getStartPosition());
+        window.close();
+    }
+
+    @SmallTest
+    public void testDeprecatedConstructor() {
+        @SuppressWarnings("deprecation")
+        CursorWindow window = new CursorWindow(true /*this argument is ignored*/);
+        assertEquals("<unnamed>", window.getName());
+        assertEquals(0, window.getStartPosition());
+        window.close();
+    }
+
+    @SmallTest
+    public void testValues() {
+        CursorWindow window = new CursorWindow("MyWindow");
+        doTestValues(window);
+        window.close();
+    }
+
     private void doTestValues(CursorWindow window) {
         assertTrue(window.setNumColumns(7));
         assertTrue(window.allocRow());
diff --git a/core/tests/coretests/src/android/database/DatabaseCursorTest.java b/core/tests/coretests/src/android/database/DatabaseCursorTest.java
index 179338d..36f0f4b 100644
--- a/core/tests/coretests/src/android/database/DatabaseCursorTest.java
+++ b/core/tests/coretests/src/android/database/DatabaseCursorTest.java
@@ -16,7 +16,6 @@
 
 package android.database;
 
-import dalvik.annotation.BrokenTest;
 import android.content.ContentValues;
 import android.content.Context;
 import android.database.Cursor;
@@ -27,13 +26,11 @@
 import android.database.sqlite.SQLiteCursorDriver;
 import android.database.sqlite.SQLiteDatabase;
 import android.database.sqlite.SQLiteQuery;
-import android.database.sqlite.SQLiteStatement;
 import android.os.Looper;
 import android.test.AndroidTestCase;
 import android.test.PerformanceTestCase;
 import android.test.suitebuilder.annotation.LargeTest;
 import android.test.suitebuilder.annotation.MediumTest;
-import android.test.suitebuilder.annotation.Suppress;
 import android.util.Log;
 
 import java.io.File;
diff --git a/core/tests/coretests/src/android/database/DatabaseErrorHandlerTest.java b/core/tests/coretests/src/android/database/DatabaseErrorHandlerTest.java
index 1cfd960..91c7687 100644
--- a/core/tests/coretests/src/android/database/DatabaseErrorHandlerTest.java
+++ b/core/tests/coretests/src/android/database/DatabaseErrorHandlerTest.java
@@ -21,7 +21,6 @@
 import android.database.sqlite.SQLiteDiskIOException;
 import android.database.sqlite.SQLiteException;
 import android.test.AndroidTestCase;
-import android.test.suitebuilder.annotation.Suppress;
 import android.util.Log;
 
 import java.io.BufferedWriter;
diff --git a/core/tests/coretests/src/android/database/DatabaseGeneralTest.java b/core/tests/coretests/src/android/database/DatabaseGeneralTest.java
index 6786700..c7cb43d 100644
--- a/core/tests/coretests/src/android/database/DatabaseGeneralTest.java
+++ b/core/tests/coretests/src/android/database/DatabaseGeneralTest.java
@@ -410,40 +410,6 @@
         }
     }
 
-    private class ChangeObserver extends ContentObserver {
-        private int mCursorNotificationCount = 0;
-        private int mNotificationCount = 0;
-
-        public int getCursorNotificationCount() {
-            return mCursorNotificationCount;
-        }
-
-        public int getNotificationCount() {
-            return mNotificationCount;
-        }
-
-        public ChangeObserver(boolean cursor) {
-            super(new Handler());
-            mCursor = cursor;
-        }
-
-        @Override
-        public boolean deliverSelfNotifications() {
-            return true;
-        }
-
-        @Override
-        public void onChange(boolean selfChange) {
-            if (mCursor) {
-                mCursorNotificationCount++;
-            } else {
-                mNotificationCount++;
-            }
-        }
-
-        boolean mCursor;
-    }
-
     @MediumTest
     public void testSelectionArgs() throws Exception {
         mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data TEXT);");
diff --git a/core/tests/coretests/src/android/database/DatabaseLockTest.java b/core/tests/coretests/src/android/database/DatabaseLockTest.java
index f7a9f8a..8d3cf5a 100644
--- a/core/tests/coretests/src/android/database/DatabaseLockTest.java
+++ b/core/tests/coretests/src/android/database/DatabaseLockTest.java
@@ -16,18 +16,13 @@
 
 package android.database;
 
-import android.app.Activity;
-import android.content.Context;
 import android.database.sqlite.SQLiteDatabase;
-import android.test.suitebuilder.annotation.LargeTest;
 import android.test.suitebuilder.annotation.Suppress;
 import android.util.Log;
 import java.io.File;
 import java.util.concurrent.atomic.AtomicInteger;
 import android.test.AndroidTestCase;
 
-import junit.framework.TestCase;
-
 /* 
  * This is a series of unit tests for database locks.
  *
@@ -104,9 +99,9 @@
         public void run() {
             for (int i = 0; i < NUM_ITERATIONS; i++) {
                 mDatabase.beginTransaction();
-                int val = mCounter.incrementAndGet();
+                mCounter.incrementAndGet();
                 try {
-                    Thread.currentThread().sleep(SLEEP_TIME);
+                    Thread.sleep(SLEEP_TIME);
                 } catch (InterruptedException e) {
                     // ignore
                 }
@@ -124,7 +119,6 @@
     @Suppress
     public void testLockLatency() {
         startDatabaseLatencyThread();
-        int previous = 0;
         long sumTime = 0;
         long maxTime = 0;
         for (int i = 0; i < NUM_ITERATIONS; i++) { 
@@ -137,7 +131,7 @@
             }
             sumTime += elapsedTime;
             try {
-                Thread.currentThread().sleep(SLEEP_TIME); 
+                Thread.sleep(SLEEP_TIME); 
             } catch (InterruptedException e) {
                 // ignore
             }   
@@ -164,7 +158,7 @@
             {
                 mDatabase.beginTransaction();
                 try {
-                    Thread.currentThread().sleep(SLEEP_TIME);
+                    Thread.sleep(SLEEP_TIME);
                 } catch (InterruptedException e) {
                     // ignore
                 } 
diff --git a/core/tests/coretests/src/android/database/DatabasePerformanceTests.java b/core/tests/coretests/src/android/database/DatabasePerformanceTests.java
index b8ebcc4..d0e739b 100644
--- a/core/tests/coretests/src/android/database/DatabasePerformanceTests.java
+++ b/core/tests/coretests/src/android/database/DatabasePerformanceTests.java
@@ -35,6 +35,7 @@
  * 
  */
 
+@SuppressWarnings("deprecation")
 public class DatabasePerformanceTests {
 
     public static String[] children() {
diff --git a/core/tests/coretests/src/android/database/DatabaseStatementTest.java b/core/tests/coretests/src/android/database/DatabaseStatementTest.java
index 71dc3ae..512d5cd 100644
--- a/core/tests/coretests/src/android/database/DatabaseStatementTest.java
+++ b/core/tests/coretests/src/android/database/DatabaseStatementTest.java
@@ -25,8 +25,6 @@
 import android.test.AndroidTestCase;
 import android.test.PerformanceTestCase;
 import android.test.suitebuilder.annotation.MediumTest;
-import android.test.suitebuilder.annotation.SmallTest;
-import junit.framework.TestCase;
 
 import java.io.File;
 
diff --git a/core/tests/coretests/src/android/database/NewDatabasePerformanceTests.java b/core/tests/coretests/src/android/database/NewDatabasePerformanceTests.java
index 0dca90b..adf88d2 100644
--- a/core/tests/coretests/src/android/database/NewDatabasePerformanceTests.java
+++ b/core/tests/coretests/src/android/database/NewDatabasePerformanceTests.java
@@ -20,7 +20,6 @@
 import android.database.sqlite.SQLiteDatabase;
 import android.test.PerformanceTestCase;
 
-import junit.framework.Assert;
 import junit.framework.TestCase;
 
 import java.io.File;
@@ -33,1202 +32,1196 @@
 
 public class NewDatabasePerformanceTests {
 
-  // Edit this to change the test run times.  The original is 100.
-  final static int kMultiplier = 1;
-  
-  public static class PerformanceBase extends TestCase
-          implements PerformanceTestCase {
-    protected static final int CURRENT_DATABASE_VERSION = 42;
-    protected SQLiteDatabase mDatabase;
-    protected File mDatabaseFile;
+    // Edit this to change the test run times.  The original is 100.
+    final static int kMultiplier = 1;
 
-    public void setUp() {
-      mDatabaseFile = new File("/sdcard", "perf_database_test.db");
-      if (mDatabaseFile.exists()) {
-        mDatabaseFile.delete();
-      }
-      mDatabase =
-        SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(),
-            null);
-      assertTrue(mDatabase != null);
-      mDatabase.setVersion(CURRENT_DATABASE_VERSION);
+    public static class PerformanceBase extends TestCase
+    implements PerformanceTestCase {
+        protected static final int CURRENT_DATABASE_VERSION = 42;
+        protected SQLiteDatabase mDatabase;
+        protected File mDatabaseFile;
+
+        public void setUp() {
+            mDatabaseFile = new File("/sdcard", "perf_database_test.db");
+            if (mDatabaseFile.exists()) {
+                mDatabaseFile.delete();
+            }
+            mDatabase =
+                    SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(),
+                            null);
+            assertTrue(mDatabase != null);
+            mDatabase.setVersion(CURRENT_DATABASE_VERSION);
+        }
+
+        public void tearDown() {
+            mDatabase.close();
+            mDatabaseFile.delete();
+        }
+
+        public boolean isPerformanceOnly() {
+            return true;
+        }
+
+        // These tests can only be run once.
+        public int startPerformance(Intermediates intermediates) {
+            return 0;
+        }
+
+        public String numberName(int number) {
+            String result = "";
+
+            if (number >= 1000) {
+                result += numberName((number / 1000)) + " thousand";
+                number = (number % 1000);
+
+                if (number > 0) result += " ";
+            }
+
+            if (number >= 100) {
+                result += ONES[(number / 100)] + " hundred";
+                number = (number % 100);
+
+                if (number > 0) result += " ";
+            }
+
+            if (number >= 20) {
+                result += TENS[(number / 10)];
+                number = (number % 10);
+
+                if (number > 0) result += " ";
+            }
+
+            if (number > 0) {
+                result += ONES[number];
+            }
+
+            return result;
+        }
     }
 
-    public void tearDown() {
-      mDatabase.close();
-      mDatabaseFile.delete();
+    /**
+     * Test 1000 inserts.
+     */
+
+    public static class Insert1000 extends PerformanceBase {
+        private static final int SIZE = 10 * kMultiplier;
+
+        private String[] statements = new String[SIZE];
+
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
+
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                statements[i] =
+                        "INSERT INTO t1 VALUES(" + i + "," + r + ",'"
+                                + numberName(r) + "')";
+            }
+
+            mDatabase
+            .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
+        }
+
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase.execSQL(statements[i]);
+            }
+        }
     }
 
-    public boolean isPerformanceOnly() {
-      return true;
+    /**
+     * Test 1000 inserts into an indexed table.
+     */
+
+    public static class InsertIndexed1000 extends PerformanceBase {
+        private static final int SIZE = 10 * kMultiplier;
+
+        private String[] statements = new String[SIZE];
+
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
+
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                statements[i] =
+                        "INSERT INTO t1 VALUES(" + i + "," + r + ",'"
+                                + numberName(r) + "')";
+            }
+
+            mDatabase
+            .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
+            mDatabase.execSQL("CREATE INDEX i1c ON t1(c)");
+        }
+
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase.execSQL(statements[i]);
+            }
+        }
     }
 
-    // These tests can only be run once.
-    public int startPerformance(Intermediates intermediates) {
-      return 0;
+    /**
+     * 100 SELECTs without an index
+     */
+
+    public static class Select100 extends PerformanceBase {
+        private static final int SIZE = 1 * kMultiplier;
+        private static final String[] COLUMNS = {"count(*)", "avg(b)"};
+
+        private String[] where = new String[SIZE];
+
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
+
+            mDatabase
+            .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
+
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
+                        + numberName(r) + "')");
+            }
+
+            for (int i = 0; i < SIZE; i++) {
+                int lower = i * 100;
+                int upper = (i + 10) * 100;
+                where[i] = "b >= " + lower + " AND b < " + upper;
+            }
+        }
+
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase
+                .query("t1", COLUMNS, where[i], null, null, null, null);
+            }
+        }
     }
 
-    public String numberName(int number) {
-      String result = "";
+    /**
+     * 100 SELECTs on a string comparison
+     */
 
-      if (number >= 1000) {
-        result += numberName((number / 1000)) + " thousand";
-        number = (number % 1000);
+    public static class SelectStringComparison100 extends PerformanceBase {
+        private static final int SIZE = 1 * kMultiplier;
+        private static final String[] COLUMNS = {"count(*)", "avg(b)"};
 
-        if (number > 0) result += " ";
-      }
+        private String[] where = new String[SIZE];
 
-      if (number >= 100) {
-        result += ONES[(number / 100)] + " hundred";
-        number = (number % 100);
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-        if (number > 0) result += " ";
-      }
+            mDatabase
+            .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
 
-      if (number >= 20) {
-        result += TENS[(number / 10)];
-        number = (number % 10);
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
+                        + numberName(r) + "')");
+            }
 
-        if (number > 0) result += " ";
-      }
+            for (int i = 0; i < SIZE; i++) {
+                where[i] = "c LIKE '" + numberName(i) + "'";
+            }
+        }
 
-      if (number > 0) {
-        result += ONES[number];
-      }
-
-      return result;
-    }
-  }
-
-  /**
-   * Test 1000 inserts.
-   */
-
-  public static class Insert1000 extends PerformanceBase {
-    private static final int SIZE = 10 * kMultiplier;
-
-    private String[] statements = new String[SIZE];
-
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
-
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        statements[i] =
-          "INSERT INTO t1 VALUES(" + i + "," + r + ",'"
-          + numberName(r) + "')";
-      }
-
-      mDatabase
-      .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase
+                .query("t1", COLUMNS, where[i], null, null, null, null);
+            }
+        }
     }
 
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase.execSQL(statements[i]);
-      }
-    }
-  }
+    /**
+     * 100 SELECTs with an index
+     */
 
-  /**
-   * Test 1000 inserts into an indexed table.
-   */
+    public static class SelectIndex100 extends PerformanceBase {
+        private static final int SIZE = 1 * kMultiplier;
+        private static final String[] COLUMNS = {"count(*)", "avg(b)"};
 
-  public static class InsertIndexed1000 extends PerformanceBase {
-    private static final int SIZE = 10 * kMultiplier;
+        private String[] where = new String[SIZE];
 
-    private String[] statements = new String[SIZE];
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+            mDatabase
+            .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
+            mDatabase.execSQL("CREATE INDEX i1b ON t1(b)");
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        statements[i] =
-          "INSERT INTO t1 VALUES(" + i + "," + r + ",'"
-          + numberName(r) + "')";
-      }
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
+                        + numberName(r) + "')");
+            }
 
-      mDatabase
-      .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
-      mDatabase.execSQL("CREATE INDEX i1c ON t1(c)");
+            for (int i = 0; i < SIZE; i++) {
+                int lower = i * 100;
+                int upper = (i + 10) * 100;
+                where[i] = "b >= " + lower + " AND b < " + upper;
+            }
+        }
+
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase
+                .query("t1", COLUMNS, where[i], null, null, null, null);
+            }
+        }
     }
 
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase.execSQL(statements[i]);
-      }
-    }
-  }
+    /**
+     *  INNER JOIN without an index
+     */
 
-  /**
-   * 100 SELECTs without an index
-   */
+    public static class InnerJoin100 extends PerformanceBase {
+        private static final int SIZE = 1 * kMultiplier;
+        private static final String[] COLUMNS = {"t1.a"};
 
-  public static class Select100 extends PerformanceBase {
-    private static final int SIZE = 1 * kMultiplier;
-    private static final String[] COLUMNS = {"count(*)", "avg(b)"};
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-    private String[] where = new String[SIZE];
+            mDatabase
+            .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
+            mDatabase
+            .execSQL("CREATE TABLE t2(a INTEGER, b INTEGER, c VARCHAR(100))");
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
+                        + numberName(r) + "')");
+            }
 
-      mDatabase
-      .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t2 VALUES(" + i + "," + r + ",'"
+                        + numberName(r) + "')");
+            }
+        }
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
-            + numberName(r) + "')");
-      }
-
-      for (int i = 0; i < SIZE; i++) {
-        int lower = i * 100;
-        int upper = (i + 10) * 100;
-        where[i] = "b >= " + lower + " AND b < " + upper;
-      }
+        public void testRun() {
+            mDatabase.query("t1 INNER JOIN t2 ON t1.b = t2.b", COLUMNS, null,
+                    null, null, null, null);
+        }
     }
 
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase
-        .query("t1", COLUMNS, where[i], null, null, null, null);
-      }
-    }
-  }
+    /**
+     *  INNER JOIN without an index on one side
+     */
 
-  /**
-   * 100 SELECTs on a string comparison
-   */
+    public static class InnerJoinOneSide100 extends PerformanceBase {
+        private static final int SIZE = 1 * kMultiplier;
+        private static final String[] COLUMNS = {"t1.a"};
 
-  public static class SelectStringComparison100 extends PerformanceBase {
-    private static final int SIZE = 1 * kMultiplier;
-    private static final String[] COLUMNS = {"count(*)", "avg(b)"};
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-    private String[] where = new String[SIZE];
+            mDatabase
+            .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
+            mDatabase
+            .execSQL("CREATE TABLE t2(a INTEGER, b INTEGER, c VARCHAR(100))");
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+            mDatabase.execSQL("CREATE INDEX i1b ON t1(b)");
 
-      mDatabase
-      .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
+                        + numberName(r) + "')");
+            }
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
-            + numberName(r) + "')");
-      }
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t2 VALUES(" + i + "," + r + ",'"
+                        + numberName(r) + "')");
+            }
+        }
 
-      for (int i = 0; i < SIZE; i++) {
-        where[i] = "c LIKE '" + numberName(i) + "'";
-      }
+        public void testRun() {
+            mDatabase.query("t1 INNER JOIN t2 ON t1.b = t2.b", COLUMNS, null,
+                    null, null, null, null);
+        }
     }
 
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase
-        .query("t1", COLUMNS, where[i], null, null, null, null);
-      }
-    }
-  }
+    /**
+     *  INNER JOIN without an index on one side
+     */
 
-  /**
-   * 100 SELECTs with an index
-   */
+    public static class InnerJoinNoIndex100 extends PerformanceBase {
+        private static final int SIZE = 1 * kMultiplier;
+        private static final String[] COLUMNS = {"t1.a"};
 
-  public static class SelectIndex100 extends PerformanceBase {
-    private static final int SIZE = 1 * kMultiplier;
-    private static final String[] COLUMNS = {"count(*)", "avg(b)"};
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-    private String[] where = new String[SIZE];
+            mDatabase
+            .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
+            mDatabase
+            .execSQL("CREATE TABLE t2(a INTEGER, b INTEGER, c VARCHAR(100))");
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+            mDatabase.execSQL("CREATE INDEX i1b ON t1(b)");
 
-      mDatabase
-      .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
-      mDatabase.execSQL("CREATE INDEX i1b ON t1(b)");
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
+                        + numberName(r) + "')");
+            }
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
-            + numberName(r) + "')");
-      }
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t2 VALUES(" + i + "," + r + ",'"
+                        + numberName(r) + "')");
+            }
+        }
 
-      for (int i = 0; i < SIZE; i++) {
-        int lower = i * 100;
-        int upper = (i + 10) * 100;
-        where[i] = "b >= " + lower + " AND b < " + upper;
-      }
+        public void testRun() {
+            mDatabase.query("t1 INNER JOIN t2 ON t1.c = t2.c", COLUMNS, null,
+                    null, null, null, null);
+        }
     }
 
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase
-        .query("t1", COLUMNS, where[i], null, null, null, null);
-      }
-    }
-  }
+    /**
+     *  100 SELECTs with subqueries. Subquery is using an index
+     */
 
-  /**
-   *  INNER JOIN without an index
-   */
+    public static class SelectSubQIndex100 extends PerformanceBase {
+        private static final int SIZE = 1 * kMultiplier;
+        private static final String[] COLUMNS = {"t1.a"};
 
-  public static class InnerJoin100 extends PerformanceBase {
-    private static final int SIZE = 1 * kMultiplier;
-    private static final String[] COLUMNS = {"t1.a"};
+        private String[] where = new String[SIZE];
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-      mDatabase
-      .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
-      mDatabase
-      .execSQL("CREATE TABLE t2(a INTEGER, b INTEGER, c VARCHAR(100))");
+            mDatabase
+            .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
+            mDatabase
+            .execSQL("CREATE TABLE t2(a INTEGER, b INTEGER, c VARCHAR(100))");
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
-            + numberName(r) + "')");
-      }
+            mDatabase.execSQL("CREATE INDEX i2b ON t2(b)");
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t2 VALUES(" + i + "," + r + ",'"
-            + numberName(r) + "')");
-      }
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
+                        + numberName(r) + "')");
+            }
+
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t2 VALUES(" + i + "," + r + ",'"
+                        + numberName(r) + "')");
+            }
+
+            for (int i = 0; i < SIZE; i++) {
+                int lower = i * 100;
+                int upper = (i + 10) * 100;
+                where[i] =
+                        "t1.b IN (SELECT t2.b FROM t2 WHERE t2.b >= " + lower
+                        + " AND t2.b < " + upper + ")";
+            }
+        }
+
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase
+                .query("t1", COLUMNS, where[i], null, null, null, null);
+            }
+        }
     }
 
-    public void testRun() {
-      mDatabase.query("t1 INNER JOIN t2 ON t1.b = t2.b", COLUMNS, null,
-          null, null, null, null);
-    }
-  }
+    /**
+     *  100 SELECTs on string comparison with Index
+     */
 
-  /**
-   *  INNER JOIN without an index on one side
-   */
+    public static class SelectIndexStringComparison100 extends PerformanceBase {
+        private static final int SIZE = 1 * kMultiplier;
+        private static final String[] COLUMNS = {"count(*)", "avg(b)"};
 
-  public static class InnerJoinOneSide100 extends PerformanceBase {
-    private static final int SIZE = 1 * kMultiplier;
-    private static final String[] COLUMNS = {"t1.a"};
+        private String[] where = new String[SIZE];
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-      mDatabase
-      .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
-      mDatabase
-      .execSQL("CREATE TABLE t2(a INTEGER, b INTEGER, c VARCHAR(100))");
+            mDatabase
+            .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
+            mDatabase.execSQL("CREATE INDEX i3c ON t1(c)");
 
-      mDatabase.execSQL("CREATE INDEX i1b ON t1(b)");
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
+                        + numberName(r) + "')");
+            }
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
-            + numberName(r) + "')");
-      }
+            for (int i = 0; i < SIZE; i++) {
+                where[i] = "c LIKE '" + numberName(i) + "'";
+            }
+        }
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t2 VALUES(" + i + "," + r + ",'"
-            + numberName(r) + "')");
-      }
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase
+                .query("t1", COLUMNS, where[i], null, null, null, null);
+            }
+        }
     }
 
-    public void testRun() {
-      mDatabase.query("t1 INNER JOIN t2 ON t1.b = t2.b", COLUMNS, null,
-          null, null, null, null);
-    }
-  }
+    /**
+     *  100 SELECTs on integer
+     */
 
-  /**
-   *  INNER JOIN without an index on one side
-   */
+    public static class SelectInteger100 extends PerformanceBase {
+        private static final int SIZE = 1 * kMultiplier;
+        private static final String[] COLUMNS = {"b"};
 
-  public static class InnerJoinNoIndex100 extends PerformanceBase {
-    private static final int SIZE = 1 * kMultiplier;
-    private static final String[] COLUMNS = {"t1.a"};
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+            mDatabase
+            .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
 
-      mDatabase
-      .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
-      mDatabase
-      .execSQL("CREATE TABLE t2(a INTEGER, b INTEGER, c VARCHAR(100))");
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
+                        + numberName(r) + "')");
+            }
 
-      mDatabase.execSQL("CREATE INDEX i1b ON t1(b)");
+        }
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
-            + numberName(r) + "')");
-      }
-
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t2 VALUES(" + i + "," + r + ",'"
-            + numberName(r) + "')");
-      }
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase.query("t1", COLUMNS, null, null, null, null, null);
+            }
+        }
     }
 
-    public void testRun() {
-      mDatabase.query("t1 INNER JOIN t2 ON t1.c = t2.c", COLUMNS, null,
-          null, null, null, null);
-    }
-  }
+    /**
+     *  100 SELECTs on String
+     */
 
-  /**
-   *  100 SELECTs with subqueries. Subquery is using an index
-   */
+    public static class SelectString100 extends PerformanceBase {
+        private static final int SIZE = 1 * kMultiplier;
+        private static final String[] COLUMNS = {"c"};
 
-  public static class SelectSubQIndex100 extends PerformanceBase {
-    private static final int SIZE = 1 * kMultiplier;
-    private static final String[] COLUMNS = {"t1.a"};
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-    private String[] where = new String[SIZE];
+            mDatabase
+            .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
+                        + numberName(r) + "')");
+            }
 
-      mDatabase
-      .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
-      mDatabase
-      .execSQL("CREATE TABLE t2(a INTEGER, b INTEGER, c VARCHAR(100))");
+        }
 
-      mDatabase.execSQL("CREATE INDEX i2b ON t2(b)");
-
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
-            + numberName(r) + "')");
-      }
-
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t2 VALUES(" + i + "," + r + ",'"
-            + numberName(r) + "')");
-      }
-
-      for (int i = 0; i < SIZE; i++) {
-        int lower = i * 100;
-        int upper = (i + 10) * 100;
-        where[i] =
-          "t1.b IN (SELECT t2.b FROM t2 WHERE t2.b >= " + lower
-          + " AND t2.b < " + upper + ")";
-      }
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase.query("t1", COLUMNS, null, null, null, null, null);
+            }
+        }
     }
 
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase
-        .query("t1", COLUMNS, where[i], null, null, null, null);
-      }
-    }
-  }
+    /**
+     *  100 SELECTs on integer with index
+     */
 
-  /**
-   *  100 SELECTs on string comparison with Index
-   */
+    public static class SelectIntegerIndex100 extends PerformanceBase {
+        private static final int SIZE = 1 * kMultiplier;
+        private static final String[] COLUMNS = {"b"};
 
-  public static class SelectIndexStringComparison100 extends PerformanceBase {
-    private static final int SIZE = 1 * kMultiplier;
-    private static final String[] COLUMNS = {"count(*)", "avg(b)"};
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-    private String[] where = new String[SIZE];
+            mDatabase
+            .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
+            mDatabase.execSQL("CREATE INDEX i1b on t1(b)");
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
+                        + numberName(r) + "')");
+            }
 
-      mDatabase
-      .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
-      mDatabase.execSQL("CREATE INDEX i3c ON t1(c)");
+        }
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
-            + numberName(r) + "')");
-      }
-
-      for (int i = 0; i < SIZE; i++) {
-        where[i] = "c LIKE '" + numberName(i) + "'";
-      }
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase.query("t1", COLUMNS, null, null, null, null, null);
+            }
+        }
     }
 
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase
-        .query("t1", COLUMNS, where[i], null, null, null, null);
-      }
-    }
-  }
+    /**
+     *  100 SELECTs on String with index
+     */
 
-  /**
-   *  100 SELECTs on integer 
-   */
+    public static class SelectIndexString100 extends PerformanceBase {
+        private static final int SIZE = 1 * kMultiplier;
+        private static final String[] COLUMNS = {"c"};
 
-  public static class SelectInteger100 extends PerformanceBase {
-    private static final int SIZE = 1 * kMultiplier;
-    private static final String[] COLUMNS = {"b"};
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-    private String[] where = new String[SIZE];
+            mDatabase
+            .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
+            mDatabase.execSQL("CREATE INDEX i1c ON t1(c)");
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
+                        + numberName(r) + "')");
+            }
 
-      mDatabase
-      .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
+        }
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
-            + numberName(r) + "')");
-      }
-
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase.query("t1", COLUMNS, null, null, null, null, null);
+            }
+        }
     }
 
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase.query("t1", COLUMNS, null, null, null, null, null);
-      }
-    }
-  }
+    /**
+     *  100 SELECTs on String with starts with
+     */
 
-  /**
-   *  100 SELECTs on String
-   */
+    public static class SelectStringStartsWith100 extends PerformanceBase {
+        private static final int SIZE = 1 * kMultiplier;
+        private static final String[] COLUMNS = {"c"};
+        private String[] where = new String[SIZE];
 
-  public static class SelectString100 extends PerformanceBase {
-    private static final int SIZE = 1 * kMultiplier;
-    private static final String[] COLUMNS = {"c"};
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-    private String[] where = new String[SIZE];
+            mDatabase
+            .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
+            mDatabase.execSQL("CREATE INDEX i1c ON t1(c)");
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
+                        + numberName(r) + "')");
+            }
 
-      mDatabase
-      .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                where[i] = "c LIKE '" + numberName(r).substring(0, 1) + "*'";
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
-            + numberName(r) + "')");
-      }
+            }
 
+        }
+
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase
+                .query("t1", COLUMNS, where[i], null, null, null, null);
+            }
+        }
     }
 
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase.query("t1", COLUMNS, null, null, null, null, null);
-      }
-    }
-  }
+    /**
+     *  1000 Deletes on an indexed table
+     */
 
-  /**
-   *  100 SELECTs on integer with index
-   */
+    public static class DeleteIndexed1000 extends PerformanceBase {
+        private static final int SIZE = 10 * kMultiplier;
 
-  public static class SelectIntegerIndex100 extends PerformanceBase {
-    private static final int SIZE = 1 * kMultiplier;
-    private static final String[] COLUMNS = {"b"};
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+            mDatabase
+            .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
+            mDatabase.execSQL("CREATE INDEX i3c ON t1(c)");
 
-      mDatabase
-      .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
-      mDatabase.execSQL("CREATE INDEX i1b on t1(b)");
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
+                        + numberName(r) + "')");
+            }
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
-            + numberName(r) + "')");
-      }
+        }
 
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase.delete("t1", null, null);
+            }
+        }
     }
 
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase.query("t1", COLUMNS, null, null, null, null, null);
-      }
-    }
-  }
+    /**
+     *  1000 Deletes
+     */
 
-  /**
-   *  100 SELECTs on String with index
-   */
+    public static class Delete1000 extends PerformanceBase {
+        private static final int SIZE = 10 * kMultiplier;
 
-  public static class SelectIndexString100 extends PerformanceBase {
-    private static final int SIZE = 1 * kMultiplier;
-    private static final String[] COLUMNS = {"c"};      
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+            mDatabase
+            .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
 
-      mDatabase
-      .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
-      mDatabase.execSQL("CREATE INDEX i1c ON t1(c)");
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
+                        + numberName(r) + "')");
+            }
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
-            + numberName(r) + "')");
-      }
+        }
 
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase.delete("t1", null, null);
+            }
+        }
     }
 
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase.query("t1", COLUMNS, null, null, null, null, null);
-      }
-    }
-  }
+    /**
+     *  1000 DELETE's without an index with where clause
+     */
 
-  /**
-   *  100 SELECTs on String with starts with
-   */
+    public static class DeleteWhere1000 extends PerformanceBase {
+        private static final int SIZE = 10 * kMultiplier;
+        private String[] where = new String[SIZE];
 
-  public static class SelectStringStartsWith100 extends PerformanceBase {
-    private static final int SIZE = 1 * kMultiplier;
-    private static final String[] COLUMNS = {"c"};
-    private String[] where = new String[SIZE];
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+            mDatabase
+            .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
 
-      mDatabase
-      .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
-      mDatabase.execSQL("CREATE INDEX i1c ON t1(c)");
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
+                        + numberName(r) + "')");
+            }
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
-            + numberName(r) + "')");
-      }
+            for (int i = 0; i < SIZE; i++) {
+                int lower = i * 100;
+                int upper = (i + 10) * 100;
+                where[i] = "b >= " + lower + " AND b < " + upper;
+            }
+        }
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        where[i] = "c LIKE '" + numberName(r).substring(0, 1) + "*'";
-
-      }
-
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase.delete("t1", where[i], null);
+            }
+        }
     }
 
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase
-        .query("t1", COLUMNS, where[i], null, null, null, null);
-      }
-    }
-  }
+    /**
+     *  1000 DELETE's with an index with where clause
+     */
 
-  /**
-   *  1000 Deletes on an indexed table
-   */
+    public static class DeleteIndexWhere1000 extends PerformanceBase {
+        private static final int SIZE = 10 * kMultiplier;
+        private String[] where = new String[SIZE];
 
-  public static class DeleteIndexed1000 extends PerformanceBase {
-    private static final int SIZE = 10 * kMultiplier;
-    private static final String[] COLUMNS = {"c"};
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+            mDatabase
+            .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
+            mDatabase.execSQL("CREATE INDEX i1b ON t1(b)");
 
-      mDatabase
-      .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
-      mDatabase.execSQL("CREATE INDEX i3c ON t1(c)");
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
+                        + numberName(r) + "')");
+            }
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
-            + numberName(r) + "')");
-      }
+            for (int i = 0; i < SIZE; i++) {
+                int lower = i * 100;
+                int upper = (i + 10) * 100;
+                where[i] = "b >= " + lower + " AND b < " + upper;
+            }
+        }
 
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase.delete("t1", where[i], null);
+            }
+        }
     }
 
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase.delete("t1", null, null);
-      }
-    }
-  }
+    /**
+     *  1000 update's with an index with where clause
+     */
 
-  /**
-   *  1000 Deletes
-   */
+    public static class UpdateIndexWhere1000 extends PerformanceBase {
+        private static final int SIZE = 10 * kMultiplier;
+        private String[] where = new String[SIZE];
+        ContentValues[] mValues = new ContentValues[SIZE];
 
-  public static class Delete1000 extends PerformanceBase {
-    private static final int SIZE = 10 * kMultiplier;
-    private static final String[] COLUMNS = {"c"};       
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+            mDatabase
+            .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
+            mDatabase.execSQL("CREATE INDEX i1b ON t1(b)");
 
-      mDatabase
-      .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
+                        + numberName(r) + "')");
+            }
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
-            + numberName(r) + "')");
-      }
+            for (int i = 0; i < SIZE; i++) {
 
+                int lower = i * 100;
+                int upper = (i + 10) * 100;
+                where[i] = "b >= " + lower + " AND b < " + upper;
+                ContentValues b = new ContentValues(1);
+                b.put("b", upper);
+                mValues[i] = b;
+
+            }
+        }
+
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase.update("t1", mValues[i], where[i], null);
+            }
+        }
     }
 
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase.delete("t1", null, null);
-      }
-    }
-  }
+    /**
+     *  1000 update's without an index with where clause
+     */
 
-  /**
-   *  1000 DELETE's without an index with where clause 
-   */
+    public static class UpdateWhere1000 extends PerformanceBase {
+        private static final int SIZE = 10 * kMultiplier;
+        private String[] where = new String[SIZE];
+        ContentValues[] mValues = new ContentValues[SIZE];
 
-  public static class DeleteWhere1000 extends PerformanceBase {
-    private static final int SIZE = 10 * kMultiplier;
-    private String[] where = new String[SIZE];
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+            mDatabase
+            .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
 
-      mDatabase
-      .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
+                        + numberName(r) + "')");
+            }
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
-            + numberName(r) + "')");
-      }
+            for (int i = 0; i < SIZE; i++) {
 
-      for (int i = 0; i < SIZE; i++) {
-        int lower = i * 100;
-        int upper = (i + 10) * 100;
-        where[i] = "b >= " + lower + " AND b < " + upper;
-      }
+                int lower = i * 100;
+                int upper = (i + 10) * 100;
+                where[i] = "b >= " + lower + " AND b < " + upper;
+                ContentValues b = new ContentValues(1);
+                b.put("b", upper);
+                mValues[i] = b;
+            }
+        }
+
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase.update("t1", mValues[i], where[i], null);
+            }
+        }
     }
 
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase.delete("t1", where[i], null);
-      }
-    }
-  }
+    /**
+     *  10000 inserts for an integer
+     */
 
-  /**
-   *  1000 DELETE's with an index with where clause 
-   */
+    public static class InsertInteger10000 extends PerformanceBase {
+        private static final int SIZE = 100 * kMultiplier;
+        ContentValues[] mValues = new ContentValues[SIZE];
 
-  public static class DeleteIndexWhere1000 extends PerformanceBase {
-    private static final int SIZE = 10 * kMultiplier;
-    private String[] where = new String[SIZE];
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+            mDatabase
+            .execSQL("CREATE TABLE t1(a INTEGER)");
 
-      mDatabase
-      .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
-      mDatabase.execSQL("CREATE INDEX i1b ON t1(b)");
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                ContentValues b = new ContentValues(1);
+                b.put("a", r);
+                mValues[i] = b;
+            }
+        }
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
-            + numberName(r) + "')");
-      }
-
-      for (int i = 0; i < SIZE; i++) {
-        int lower = i * 100;
-        int upper = (i + 10) * 100;
-        where[i] = "b >= " + lower + " AND b < " + upper;
-      }
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase.insert("t1", null, mValues[i]);
+            }
+        }
     }
 
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase.delete("t1", where[i], null);
-      }
-    }
-  }
+    /**
+     *  10000 inserts for an integer -indexed table
+     */
 
-  /**
-   *  1000 update's with an index with where clause 
-   */
+    public static class InsertIntegerIndex10000 extends PerformanceBase {
+        private static final int SIZE = 100 * kMultiplier;
+        ContentValues[] mValues = new ContentValues[SIZE];
 
-  public static class UpdateIndexWhere1000 extends PerformanceBase {
-    private static final int SIZE = 10 * kMultiplier;
-    private String[] where = new String[SIZE];
-    ContentValues[] mValues = new ContentValues[SIZE];
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+            mDatabase
+            .execSQL("CREATE TABLE t1(a INTEGER)");
+            mDatabase.execSQL("CREATE INDEX i1a ON t1(a)");
 
-      mDatabase
-      .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
-      mDatabase.execSQL("CREATE INDEX i1b ON t1(b)");
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                ContentValues b = new ContentValues(1);
+                b.put("a", r);
+                mValues[i] = b;
+            }
+        }
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
-            + numberName(r) + "')");
-      }
-
-      for (int i = 0; i < SIZE; i++) {
-
-        int lower = i * 100;
-        int upper = (i + 10) * 100;
-        where[i] = "b >= " + lower + " AND b < " + upper;
-        ContentValues b = new ContentValues(1);
-        b.put("b", upper);
-        mValues[i] = b;
-
-      }
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase.insert("t1", null, mValues[i]);
+            }
+        }
     }
 
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase.update("t1", mValues[i], where[i], null);
-      }
-    }
-  }
+    /**
+     *  10000 inserts for a String
+     */
 
-  /**
-   *  1000 update's without an index with where clause 
-   */
+    public static class InsertString10000 extends PerformanceBase {
+        private static final int SIZE = 100 * kMultiplier;
+        ContentValues[] mValues = new ContentValues[SIZE];
 
-  public static class UpdateWhere1000 extends PerformanceBase {
-    private static final int SIZE = 10 * kMultiplier;       
-    private String[] where = new String[SIZE];
-    ContentValues[] mValues = new ContentValues[SIZE];
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+            mDatabase
+            .execSQL("CREATE TABLE t1(a VARCHAR(100))");
 
-      mDatabase
-      .execSQL("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100))");
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                ContentValues b = new ContentValues(1);
+                b.put("a", numberName(r));
+                mValues[i] = b;
+            }
+        }
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t1 VALUES(" + i + "," + r + ",'"
-            + numberName(r) + "')");
-      }
-
-      for (int i = 0; i < SIZE; i++) {
-
-        int lower = i * 100;
-        int upper = (i + 10) * 100;
-        where[i] = "b >= " + lower + " AND b < " + upper;
-        ContentValues b = new ContentValues(1);
-        b.put("b", upper);
-        mValues[i] = b;
-      }
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase.insert("t1", null, mValues[i]);
+            }
+        }
     }
 
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase.update("t1", mValues[i], where[i], null);
-      }
-    }
-  }
+    /**
+     *  10000 inserts for a String - indexed table
+     */
 
-  /**
-   *  10000 inserts for an integer 
-   */
+    public static class InsertStringIndexed10000 extends PerformanceBase {
+        private static final int SIZE = 100 * kMultiplier;
+        ContentValues[] mValues = new ContentValues[SIZE];
 
-  public static class InsertInteger10000 extends PerformanceBase {
-    private static final int SIZE = 100 * kMultiplier;
-    ContentValues[] mValues = new ContentValues[SIZE];
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+            mDatabase
+            .execSQL("CREATE TABLE t1(a VARCHAR(100))");
+            mDatabase.execSQL("CREATE INDEX i1a ON t1(a)");
 
-      mDatabase
-      .execSQL("CREATE TABLE t1(a INTEGER)");
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                ContentValues b = new ContentValues(1);
+                b.put("a", numberName(r));
+                mValues[i] = b;
+            }
+        }
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        ContentValues b = new ContentValues(1);
-        b.put("a", r);
-        mValues[i] = b;
-      }
-    }        
-
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase.insert("t1", null, mValues[i]);
-      }
-    }
-  }
-
-  /**
-   *  10000 inserts for an integer -indexed table
-   */
-
-  public static class InsertIntegerIndex10000 extends PerformanceBase {
-    private static final int SIZE = 100 * kMultiplier;
-    ContentValues[] mValues = new ContentValues[SIZE];
-
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
-
-      mDatabase
-      .execSQL("CREATE TABLE t1(a INTEGER)");
-      mDatabase.execSQL("CREATE INDEX i1a ON t1(a)");
-
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        ContentValues b = new ContentValues(1);
-        b.put("a", r);
-        mValues[i] = b;
-      }
-    }        
-
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase.insert("t1", null, mValues[i]);
-      }
-    }
-  }
-
-  /**
-   *  10000 inserts for a String 
-   */
-
-  public static class InsertString10000 extends PerformanceBase {
-    private static final int SIZE = 100 * kMultiplier;
-    ContentValues[] mValues = new ContentValues[SIZE];
-
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
-
-      mDatabase
-      .execSQL("CREATE TABLE t1(a VARCHAR(100))");
-
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        ContentValues b = new ContentValues(1);
-        b.put("a", numberName(r));
-        mValues[i] = b;
-      }
-    }        
-
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase.insert("t1", null, mValues[i]);
-      }
-    }
-  }
-
-  /**
-   *  10000 inserts for a String - indexed table 
-   */
-
-  public static class InsertStringIndexed10000 extends PerformanceBase {
-    private static final int SIZE = 100 * kMultiplier;       
-    ContentValues[] mValues = new ContentValues[SIZE];
-
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
-
-      mDatabase
-      .execSQL("CREATE TABLE t1(a VARCHAR(100))");
-      mDatabase.execSQL("CREATE INDEX i1a ON t1(a)");
-
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        ContentValues b = new ContentValues(1);
-        b.put("a", numberName(r));
-        mValues[i] = b; 
-      }
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase.insert("t1", null, mValues[i]);
+            }
+        }
     }
 
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase.insert("t1", null, mValues[i]);
-      }
+
+    /**
+     *  10000 selects for a String -starts with
+     */
+
+    public static class SelectStringStartsWith10000 extends PerformanceBase {
+        private static final int SIZE = 100 * kMultiplier;
+        private static final String[] COLUMNS = {"t3.a"};
+        private String[] where = new String[SIZE];
+
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
+
+            mDatabase
+            .execSQL("CREATE TABLE t3(a VARCHAR(100))");
+
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t3 VALUES('"
+                        + numberName(r) + "')");
+            }
+
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                where[i] = "a LIKE '" + numberName(r).substring(0, 1) + "*'";
+
+            }
+        }
+
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase.query("t3", COLUMNS, where[i], null, null, null, null);
+            }
+        }
     }
-  }
 
+    /**
+     *  10000 selects for a String - indexed table -starts with
+     */
 
-  /**
-   *  10000 selects for a String -starts with
-   */
+    public static class SelectStringIndexedStartsWith10000 extends
+    PerformanceBase {
+        private static final int SIZE = 100 * kMultiplier;
+        private static final String[] COLUMNS = {"t3.a"};
+        private String[] where = new String[SIZE];
 
-  public static class SelectStringStartsWith10000 extends PerformanceBase {
-    private static final int SIZE = 100 * kMultiplier;
-    private static final String[] COLUMNS = {"t3.a"};
-    private String[] where = new String[SIZE];
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+            mDatabase
+            .execSQL("CREATE TABLE t3(a VARCHAR(100))");
+            mDatabase.execSQL("CREATE INDEX i3a ON t3(a)");
 
-      mDatabase
-      .execSQL("CREATE TABLE t3(a VARCHAR(100))");
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t3 VALUES('"
+                        + numberName(r) + "')");
+            }
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t3 VALUES('"
-            + numberName(r) + "')");
-      }
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                where[i] = "a LIKE '" + numberName(r).substring(0, 1) + "*'";
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        where[i] = "a LIKE '" + numberName(r).substring(0, 1) + "*'";
+            }
+        }
 
-      }
-    }        
-
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase.query("t3", COLUMNS, where[i], null, null, null, null);
-      }
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase.query("t3", COLUMNS, where[i], null, null, null, null);
+            }
+        }
     }
-  }
 
-  /**
-   *  10000 selects for a String - indexed table -starts with
-   */
+    /**
+     *  10000 selects for an integer -
+     */
 
-  public static class SelectStringIndexedStartsWith10000 extends
-  PerformanceBase {
-    private static final int SIZE = 100 * kMultiplier;
-    private static final String[] COLUMNS = {"t3.a"};
-    private String[] where = new String[SIZE];
+    public static class SelectInteger10000 extends PerformanceBase {
+        private static final int SIZE = 100 * kMultiplier;
+        private static final String[] COLUMNS = {"t4.a"};
+        private String[] where = new String[SIZE];
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-      mDatabase
-      .execSQL("CREATE TABLE t3(a VARCHAR(100))");
-      mDatabase.execSQL("CREATE INDEX i3a ON t3(a)");
+            mDatabase
+            .execSQL("CREATE TABLE t4(a INTEGER)");
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t3 VALUES('"
-            + numberName(r) + "')");
-      }
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t4 VALUES(" + r + ")");
+                int lower = i * 100;
+                int upper = (i + 10) * 100;
+                where[i] = "a >= " + lower + " AND a < " + upper;
+            }
+        }
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        where[i] = "a LIKE '" + numberName(r).substring(0, 1) + "*'";
-
-      }                              
-    }        
-
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase.query("t3", COLUMNS, where[i], null, null, null, null);
-      }
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase.query("t4", COLUMNS, where[i], null, null, null, null);
+            }
+        }
     }
-  }
 
-  /**
-   *  10000 selects for an integer -
-   */
+    /**
+     *  10000 selects for an integer -indexed table
+     */
 
-  public static class SelectInteger10000 extends PerformanceBase {
-    private static final int SIZE = 100 * kMultiplier;
-    private static final String[] COLUMNS = {"t4.a"};
-    private String[] where = new String[SIZE];
+    public static class SelectIntegerIndexed10000 extends PerformanceBase {
+        private static final int SIZE = 100 * kMultiplier;
+        private static final String[] COLUMNS = {"t4.a"};
+        private String[] where = new String[SIZE];
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-      mDatabase
-      .execSQL("CREATE TABLE t4(a INTEGER)");
+            mDatabase
+            .execSQL("CREATE TABLE t4(a INTEGER)");
+            mDatabase.execSQL("CREATE INDEX i4a ON t4(a)");
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t4 VALUES(" + r + ")");
-        int lower = i * 100;
-        int upper = (i + 10) * 100;
-        where[i] = "a >= " + lower + " AND a < " + upper;
-      }
-    }        
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t4 VALUES(" + r + ")");
 
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase.query("t4", COLUMNS, where[i], null, null, null, null);
-      }
+                int lower = i * 100;
+                int upper = (i + 10) * 100;
+                where[i] = "a >= " + lower + " AND a < " + upper;
+            }
+
+        }
+
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase.query("t4", COLUMNS, where[i], null, null, null, null);
+            }
+        }
     }
-  }
 
-  /**
-   *  10000 selects for an integer -indexed table
-   */
 
-  public static class SelectIntegerIndexed10000 extends PerformanceBase {
-    private static final int SIZE = 100 * kMultiplier;
-    private static final String[] COLUMNS = {"t4.a"};
-    private String[] where = new String[SIZE];
+    /**
+     *  10000 selects for a String - contains 'e'
+     */
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+    public static class SelectStringContains10000 extends PerformanceBase {
+        private static final int SIZE = 100 * kMultiplier;
+        private static final String[] COLUMNS = {"t3.a"};
+        private String[] where = new String[SIZE];
 
-      mDatabase
-      .execSQL("CREATE TABLE t4(a INTEGER)");
-      mDatabase.execSQL("CREATE INDEX i4a ON t4(a)");
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t4 VALUES(" + r + ")");
+            mDatabase
+            .execSQL("CREATE TABLE t3(a VARCHAR(100))");
 
-        int lower = i * 100;
-        int upper = (i + 10) * 100;
-        where[i] = "a >= " + lower + " AND a < " + upper;
-      }
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t3 VALUES('"
+                        + numberName(r) + "')");
+            }
 
-    }        
+            for (int i = 0; i < SIZE; i++) {
+                where[i] = "a LIKE '*e*'";
 
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase.query("t4", COLUMNS, where[i], null, null, null, null);
-      }
+            }
+        }
+
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase.query("t3", COLUMNS, where[i], null, null, null, null);
+            }
+        }
     }
-  }
 
+    /**
+     *  10000 selects for a String - contains 'e'-indexed table
+     */
 
-  /**
-   *  10000 selects for a String - contains 'e'
-   */
+    public static class SelectStringIndexedContains10000 extends
+    PerformanceBase {
+        private static final int SIZE = 100 * kMultiplier;
+        private static final String[] COLUMNS = {"t3.a"};
+        private String[] where = new String[SIZE];
 
-  public static class SelectStringContains10000 extends PerformanceBase {
-    private static final int SIZE = 100 * kMultiplier;
-    private static final String[] COLUMNS = {"t3.a"};
-    private String[] where = new String[SIZE];
+        @Override
+        public void setUp() {
+            super.setUp();
+            Random random = new Random(42);
 
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
+            mDatabase
+            .execSQL("CREATE TABLE t3(a VARCHAR(100))");
+            mDatabase.execSQL("CREATE INDEX i3a ON t3(a)");
 
-      mDatabase
-      .execSQL("CREATE TABLE t3(a VARCHAR(100))");
+            for (int i = 0; i < SIZE; i++) {
+                int r = random.nextInt(100000);
+                mDatabase.execSQL("INSERT INTO t3 VALUES('"
+                        + numberName(r) + "')");
+            }
 
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t3 VALUES('"
-            + numberName(r) + "')");
-      }
+            for (int i = 0; i < SIZE; i++) {
+                where[i] = "a LIKE '*e*'";
 
-      for (int i = 0; i < SIZE; i++) {
-        where[i] = "a LIKE '*e*'";
+            }
+        }
 
-      }                              
-    }        
-
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase.query("t3", COLUMNS, where[i], null, null, null, null);
-      }
+        public void testRun() {
+            for (int i = 0; i < SIZE; i++) {
+                mDatabase.query("t3", COLUMNS, where[i], null, null, null, null);
+            }
+        }
     }
-  }
 
-  /**
-   *  10000 selects for a String - contains 'e'-indexed table
-   */
+    public static final String[] ONES =
+        {"zero", "one", "two", "three", "four", "five", "six", "seven",
+        "eight", "nine", "ten", "eleven", "twelve", "thirteen",
+        "fourteen", "fifteen", "sixteen", "seventeen", "eighteen",
+        "nineteen"};
 
-  public static class SelectStringIndexedContains10000 extends
-  PerformanceBase {
-    private static final int SIZE = 100 * kMultiplier;
-    private static final String[] COLUMNS = {"t3.a"};
-    private String[] where = new String[SIZE];
-
-    @Override
-    public void setUp() {
-      super.setUp();
-      Random random = new Random(42);
-
-      mDatabase
-      .execSQL("CREATE TABLE t3(a VARCHAR(100))");
-      mDatabase.execSQL("CREATE INDEX i3a ON t3(a)");
-
-      for (int i = 0; i < SIZE; i++) {
-        int r = random.nextInt(100000);
-        mDatabase.execSQL("INSERT INTO t3 VALUES('"
-            + numberName(r) + "')");
-      }
-
-      for (int i = 0; i < SIZE; i++) {
-        where[i] = "a LIKE '*e*'";
-
-      }                              
-    }        
-
-    public void testRun() {
-      for (int i = 0; i < SIZE; i++) {
-        mDatabase.query("t3", COLUMNS, where[i], null, null, null, null);
-      }
-    }
-  }
-
-  public static final String[] ONES =
-  {"zero", "one", "two", "three", "four", "five", "six", "seven",
-    "eight", "nine", "ten", "eleven", "twelve", "thirteen",
-    "fourteen", "fifteen", "sixteen", "seventeen", "eighteen",
-  "nineteen"};
-
-  public static final String[] TENS =
-  {"", "ten", "twenty", "thirty", "forty", "fifty", "sixty",
-    "seventy", "eighty", "ninety"};
+    public static final String[] TENS =
+        {"", "ten", "twenty", "thirty", "forty", "fifty", "sixty",
+        "seventy", "eighty", "ninety"};
 }
diff --git a/core/tests/coretests/src/android/database/sqlite/DatabaseConnectionPoolTest.java b/core/tests/coretests/src/android/database/sqlite/DatabaseConnectionPoolTest.java
deleted file mode 100644
index 525dd2d..0000000
--- a/core/tests/coretests/src/android/database/sqlite/DatabaseConnectionPoolTest.java
+++ /dev/null
@@ -1,368 +0,0 @@
-/*
- * Copyright (C) 2006 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.database.sqlite;
-
-import android.content.Context;
-import android.database.sqlite.SQLiteDatabaseTest.ClassToTestSqlCompilationAndCaching;
-import android.test.AndroidTestCase;
-import android.test.suitebuilder.annotation.SmallTest;
-import android.util.Log;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-
-public class DatabaseConnectionPoolTest extends AndroidTestCase {
-    private static final String TAG = "DatabaseConnectionPoolTest";
-
-    private static final int MAX_CONN = 5;
-    private static final String TEST_SQL = "select * from test where i = ? AND j = 1";
-    private static final String[] TEST_SQLS = new String[] {
-        TEST_SQL, TEST_SQL + 1, TEST_SQL + 2, TEST_SQL + 3, TEST_SQL + 4
-    };
-
-    private SQLiteDatabase mDatabase;
-    private File mDatabaseFile;
-    private DatabaseConnectionPool mTestPool;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        File dbDir = getContext().getDir(this.getClass().getName(), Context.MODE_PRIVATE);
-        mDatabaseFile = new File(dbDir, "database_test.db");
-        if (mDatabaseFile.exists()) {
-            mDatabaseFile.delete();
-        }
-        mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null);
-        assertNotNull(mDatabase);
-        mDatabase.execSQL("create table test (i int, j int);");
-        mTestPool = new DatabaseConnectionPool(mDatabase);
-        assertNotNull(mTestPool);
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        mTestPool.close();
-        mDatabase.close();
-        mDatabaseFile.delete();
-        super.tearDown();
-    }
-
-    @SmallTest
-    public void testGetAndRelease() {
-        mTestPool.setMaxPoolSize(MAX_CONN);
-        // connections should be lazily created.
-        assertEquals(0, mTestPool.getSize());
-        // MAX pool size should be set to MAX_CONN
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-        // get a connection
-        SQLiteDatabase db = mTestPool.get(TEST_SQL);
-        // pool size should be one - since only one should be allocated for the above get()
-        assertEquals(1, mTestPool.getSize());
-        assertEquals(mDatabase, db.mParentConnObj);
-        // no free connections should be available
-        assertEquals(0, mTestPool.getFreePoolSize());
-        assertFalse(mTestPool.isDatabaseObjFree(db));
-        // release the connection
-        mTestPool.release(db);
-        assertEquals(1, mTestPool.getFreePoolSize());
-        assertEquals(1, mTestPool.getSize());
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-        assertTrue(mTestPool.isDatabaseObjFree(db));
-        // release the same object again and expect IllegalStateException
-        try {
-            mTestPool.release(db);
-            fail("illegalStateException expected");
-        } catch (IllegalStateException e ) {
-            // expected.
-        }
-    }
-
-    /**
-     * get all connections from the pool and ask for one more.
-     * should get one of the connections already got so far. 
-     */
-    @SmallTest
-    public void testGetAllConnAndOneMore() {
-        mTestPool.setMaxPoolSize(MAX_CONN);
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-        ArrayList<SQLiteDatabase> dbObjs = new ArrayList<SQLiteDatabase>();
-        for (int i = 0; i < MAX_CONN; i++) {
-            SQLiteDatabase db = mTestPool.get(TEST_SQL);
-            assertFalse(dbObjs.contains(db));
-            dbObjs.add(db);
-            assertEquals(mDatabase, db.mParentConnObj);
-        }
-        assertEquals(0, mTestPool.getFreePoolSize());
-        assertEquals(MAX_CONN, mTestPool.getSize());
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-        // pool is maxed out and no free connections. ask for one more connection
-        SQLiteDatabase db1 = mTestPool.get(TEST_SQL);
-        // make sure db1 is one of the existing ones
-        assertTrue(dbObjs.contains(db1));
-        // pool size should remain at MAX_CONN
-        assertEquals(0, mTestPool.getFreePoolSize());
-        assertEquals(MAX_CONN, mTestPool.getSize());
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-        // release db1 but since it is allocated 2 times, it should still remain 'busy'
-        mTestPool.release(db1);
-        assertFalse(mTestPool.isDatabaseObjFree(db1));
-        assertEquals(0, mTestPool.getFreePoolSize());
-        assertEquals(MAX_CONN, mTestPool.getSize());
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-        // release all connections
-        for (int i = 0; i < MAX_CONN; i++) {
-            mTestPool.release(dbObjs.get(i));
-        }
-        // all objects in the pool should be freed now
-        assertEquals(MAX_CONN, mTestPool.getFreePoolSize());
-        assertEquals(MAX_CONN, mTestPool.getSize());
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-    }
-    
-    /**
-     * same as above except that each connection has different SQL statement associated with it. 
-     */
-    @SmallTest
-    public void testConnRetrievalForPreviouslySeenSql() {
-        mTestPool.setMaxPoolSize(MAX_CONN);
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-
-        HashMap<String, SQLiteDatabase> dbObjs = new HashMap<String, SQLiteDatabase>();
-        for (int i = 0; i < MAX_CONN; i++) {
-            SQLiteDatabase db = mTestPool.get(TEST_SQLS[i]);
-            executeSqlOnDatabaseConn(db, TEST_SQLS[i]);
-            assertFalse(dbObjs.values().contains(db));
-            dbObjs.put(TEST_SQLS[i], db);
-        }
-        assertEquals(0, mTestPool.getFreePoolSize());
-        assertEquals(MAX_CONN, mTestPool.getSize());
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-        // pool is maxed out and no free connections. ask for one more connection
-        // use a previously seen SQL statement
-        String testSql = TEST_SQLS[MAX_CONN - 1];
-        SQLiteDatabase db1 = mTestPool.get(testSql);
-        assertEquals(0, mTestPool.getFreePoolSize());
-        assertEquals(MAX_CONN, mTestPool.getSize());
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-        // make sure db1 is one of the existing ones
-        assertTrue(dbObjs.values().contains(db1));
-        assertEquals(db1, dbObjs.get(testSql));
-        // do the same again
-        SQLiteDatabase db2 = mTestPool.get(testSql);
-        // make sure db1 is one of the existing ones
-        assertEquals(db2, dbObjs.get(testSql));
-
-        // pool size should remain at MAX_CONN
-        assertEquals(0, mTestPool.getFreePoolSize());
-        assertEquals(MAX_CONN, mTestPool.getSize());
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-
-        // release db1 but since the same connection is allocated 3 times,
-        // it should still remain 'busy'
-        mTestPool.release(db1);
-        assertFalse(mTestPool.isDatabaseObjFree(dbObjs.get(testSql)));
-        assertEquals(0, mTestPool.getFreePoolSize());
-        assertEquals(MAX_CONN, mTestPool.getSize());
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-
-        // release db2 but since the same connection is allocated 2 times,
-        // it should still remain 'busy'
-        mTestPool.release(db2);
-        assertFalse(mTestPool.isDatabaseObjFree(dbObjs.get(testSql)));
-        assertEquals(0, mTestPool.getFreePoolSize());
-        assertEquals(MAX_CONN, mTestPool.getSize());
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-
-        // release all connections
-        for (int i = 0; i < MAX_CONN; i++) {
-            mTestPool.release(dbObjs.get(TEST_SQLS[i]));
-        }
-        // all objects in the pool should be freed now
-        assertEquals(MAX_CONN, mTestPool.getFreePoolSize());
-        assertEquals(MAX_CONN, mTestPool.getSize());
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-    }
-
-    private void executeSqlOnDatabaseConn(SQLiteDatabase db, String sql) {
-        // get the given sql be compiled on the given database connection.
-        // this will help DatabaseConenctionPool figure out if a given SQL statement
-        // is already cached by a database connection.
-        ClassToTestSqlCompilationAndCaching c =
-                ClassToTestSqlCompilationAndCaching.create(db, sql);
-        c.close();
-    }
-
-    /**
-     * get a connection for a SQL statement 'blah'. (connection_s)
-     * make sure the pool has at least one free connection even after this get().
-     * and get a connection for the same SQL again.
-     *    this connection should be different from connection_s.
-     *    even though there is a connection with the given SQL pre-compiled, since is it not free
-     *    AND since the pool has free connections available, should get a new connection.
-     */
-    @SmallTest
-    public void testGetConnForTheSameSql() {
-        mTestPool.setMaxPoolSize(MAX_CONN);
-
-        SQLiteDatabase db = mTestPool.get(TEST_SQL);
-        executeSqlOnDatabaseConn(db, TEST_SQL);
-        assertEquals(0, mTestPool.getFreePoolSize());
-        assertEquals(1, mTestPool.getSize());
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-
-        assertFalse(mTestPool.isDatabaseObjFree(db));
-
-        SQLiteDatabase db1 = mTestPool.get(TEST_SQL);
-        assertEquals(0, mTestPool.getFreePoolSize());
-        assertEquals(2, mTestPool.getSize());
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-
-        assertFalse(mTestPool.isDatabaseObjFree(db1));
-        assertFalse(db1.equals(db));
-
-        mTestPool.release(db);
-        assertEquals(1, mTestPool.getFreePoolSize());
-        assertEquals(2, mTestPool.getSize());
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-
-        mTestPool.release(db1);
-        assertEquals(2, mTestPool.getFreePoolSize());
-        assertEquals(2, mTestPool.getSize());
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-    }
-
-    /**
-     * get the same connection N times and release it N times.
-     * this tests DatabaseConnectionPool.PoolObj.mNumHolders
-     */
-    @SmallTest
-    public void testGetSameConnNtimesAndReleaseItNtimes() {
-        mTestPool.setMaxPoolSize(MAX_CONN);
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-
-        HashMap<String, SQLiteDatabase> dbObjs = new HashMap<String, SQLiteDatabase>();
-        for (int i = 0; i < MAX_CONN; i++) {
-            SQLiteDatabase db = mTestPool.get(TEST_SQLS[i]);
-            executeSqlOnDatabaseConn(db, TEST_SQLS[i]);
-            assertFalse(dbObjs.values().contains(db));
-            dbObjs.put(TEST_SQLS[i], db);
-        }
-        assertEquals(0, mTestPool.getFreePoolSize());
-        assertEquals(MAX_CONN, mTestPool.getSize());
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-        // every connection in the pool should have numHolders = 1
-        for (int i = 0; i < MAX_CONN; i ++) {
-            assertEquals(1, mTestPool.getPool().get(i).getNumHolders());
-        }
-        // pool is maxed out and no free connections. ask for one more connection
-        // use a previously seen SQL statement
-        String testSql = TEST_SQLS[MAX_CONN - 1];
-        SQLiteDatabase db1 = mTestPool.get(testSql);
-        assertEquals(0, mTestPool.getFreePoolSize());
-        assertEquals(MAX_CONN, mTestPool.getSize());
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-        // make sure db1 is one of the existing ones
-        assertTrue(dbObjs.values().contains(db1));
-        assertEquals(db1, dbObjs.get(testSql));
-        assertFalse(mTestPool.isDatabaseObjFree(db1));
-        DatabaseConnectionPool.PoolObj poolObj = mTestPool.getPool().get(db1.mConnectionNum - 1);
-        int numHolders = poolObj.getNumHolders();
-        assertEquals(2, numHolders);
-        assertEquals(0, mTestPool.getFreePoolSize());
-        assertEquals(MAX_CONN, mTestPool.getSize());
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-        // get the same connection N times more
-        int N = 100;
-        for (int i = 0; i < N; i++) {
-            SQLiteDatabase db2 = mTestPool.get(testSql);
-            assertEquals(db1, db2);
-            assertFalse(mTestPool.isDatabaseObjFree(db2));
-            // numHolders for this object should be now up by 1
-            int prev = numHolders;
-            numHolders = poolObj.getNumHolders();
-            assertEquals(prev + 1, numHolders);
-        }
-        // release it N times
-        for (int i = 0; i < N; i++) {
-            mTestPool.release(db1);
-            int prev = numHolders;
-            numHolders = poolObj.getNumHolders();
-            assertEquals(prev - 1, numHolders);
-            assertFalse(mTestPool.isDatabaseObjFree(db1));
-        }
-        // the connection should still have 2 more holders
-        assertFalse(mTestPool.isDatabaseObjFree(db1));
-        assertEquals(2, poolObj.getNumHolders());
-        assertEquals(0, mTestPool.getFreePoolSize());
-        assertEquals(MAX_CONN, mTestPool.getSize());
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-        // release 2 more times
-        mTestPool.release(db1);
-        mTestPool.release(db1);
-        assertEquals(0, poolObj.getNumHolders());
-        assertEquals(1, mTestPool.getFreePoolSize());
-        assertEquals(MAX_CONN, mTestPool.getSize());
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-        assertTrue(mTestPool.isDatabaseObjFree(db1));
-    }
-
-    @SmallTest
-    public void testStressTest() {
-        mTestPool.setMaxPoolSize(MAX_CONN);
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-
-        HashMap<SQLiteDatabase, Integer> dbMap = new HashMap<SQLiteDatabase, Integer>();
-        for (int i = 0; i < MAX_CONN; i++) {
-            SQLiteDatabase db = mTestPool.get(TEST_SQLS[i]);
-            assertFalse(dbMap.containsKey(db));
-            dbMap.put(db, 1);
-            executeSqlOnDatabaseConn(db, TEST_SQLS[i]);
-        }
-        assertEquals(0, mTestPool.getFreePoolSize());
-        assertEquals(MAX_CONN, mTestPool.getSize());
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-        // ask for lot more connections but since the pool is maxed out, we should start receiving
-        // connections that we already got so far
-        for (int i = MAX_CONN; i < 1000; i++) {
-            SQLiteDatabase db = mTestPool.get(TEST_SQL + i);
-            assertTrue(dbMap.containsKey(db));
-            int k = dbMap.get(db);
-            dbMap.put(db, ++k);
-        }
-        assertEquals(0, mTestPool.getFreePoolSize());
-        assertEquals(MAX_CONN, mTestPool.getSize());
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-        // print the distribution of the database connection handles received, should be uniform.
-        for (SQLiteDatabase d : dbMap.keySet()) {
-            Log.i(TAG, "connection # " + d.mConnectionNum + ", numHolders: " + dbMap.get(d));
-        }
-        // print the pool info
-        Log.i(TAG, mTestPool.toString());
-        // release all
-        for (SQLiteDatabase d : dbMap.keySet()) {
-            int num = dbMap.get(d);
-            for (int i = 0; i < num; i++) {
-                mTestPool.release(d);
-            }
-        }
-        assertEquals(MAX_CONN, mTestPool.getFreePoolSize());
-        assertEquals(MAX_CONN, mTestPool.getSize());
-        assertEquals(MAX_CONN, mTestPool.getMaxPoolSize());
-    }
-}
diff --git a/core/tests/coretests/src/android/database/sqlite/SQLiteCursorTest.java b/core/tests/coretests/src/android/database/sqlite/SQLiteCursorTest.java
index f6b1d04..9ccc6e8 100644
--- a/core/tests/coretests/src/android/database/sqlite/SQLiteCursorTest.java
+++ b/core/tests/coretests/src/android/database/sqlite/SQLiteCursorTest.java
@@ -21,8 +21,6 @@
 import android.database.Cursor;
 import android.test.AndroidTestCase;
 import android.test.suitebuilder.annotation.LargeTest;
-import android.test.suitebuilder.annotation.SmallTest;
-import android.util.Log;
 
 import java.io.File;
 import java.util.HashSet;
@@ -54,52 +52,8 @@
         super.tearDown();
     }
 
-    @SmallTest
-    public void testQueryObjReassignment() {
-        mDatabase.enableWriteAheadLogging();
-        // have a few connections in the database connection pool
-        DatabaseConnectionPool pool = mDatabase.mConnectionPool;
-        pool.setMaxPoolSize(5);
-        SQLiteCursor cursor =
-                (SQLiteCursor) mDatabase.rawQuery("select * from " + TABLE_NAME, null);
-        assertNotNull(cursor);
-        // it should use a pooled database connection
-        SQLiteDatabase db = cursor.getDatabase();
-        assertTrue(db.mConnectionNum > 0);
-        assertFalse(mDatabase.equals(db));
-        assertEquals(mDatabase, db.mParentConnObj);
-        assertTrue(pool.getConnectionList().contains(db));
-        assertTrue(db.isOpen());
-        // do a requery. cursor should continue to use the above pooled connection
-        cursor.requery();
-        SQLiteDatabase dbAgain = cursor.getDatabase();
-        assertEquals(db, dbAgain);
-        // disable WAL so that the pooled connection held by the above cursor is closed
-        mDatabase.disableWriteAheadLogging();
-        assertFalse(db.isOpen());
-        assertNull(mDatabase.mConnectionPool);
-        // requery - which should make the cursor use mDatabase connection since the pooled
-        // connection is no longer available
-        cursor.requery();
-        SQLiteDatabase db1 = cursor.getDatabase();
-        assertTrue(db1.mConnectionNum == 0);
-        assertEquals(mDatabase, db1);
-        assertNull(mDatabase.mConnectionPool);
-        assertTrue(db1.isOpen());
-        assertFalse(mDatabase.equals(db));
-        // enable WAL and requery - this time a pooled connection should be used
-        mDatabase.enableWriteAheadLogging();
-        cursor.requery();
-        db = cursor.getDatabase();
-        assertTrue(db.mConnectionNum > 0);
-        assertFalse(mDatabase.equals(db));
-        assertEquals(mDatabase, db.mParentConnObj);
-        assertTrue(mDatabase.mConnectionPool.getConnectionList().contains(db));
-        assertTrue(db.isOpen());
-    }
-
     /**
-     * this test could take a while to execute. so, designate it as LargetTest
+     * this test could take a while to execute. so, designate it as LargeTest
      */
     @LargeTest
     public void testFillWindow() {
diff --git a/core/tests/coretests/src/android/database/sqlite/SQLiteDatabaseTest.java b/core/tests/coretests/src/android/database/sqlite/SQLiteDatabaseTest.java
deleted file mode 100644
index 5ef8d11..0000000
--- a/core/tests/coretests/src/android/database/sqlite/SQLiteDatabaseTest.java
+++ /dev/null
@@ -1,971 +0,0 @@
-/*
- * Copyright (C) 2006 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.database.sqlite;
-
-import android.content.ContentValues;
-import android.content.Context;
-import android.database.Cursor;
-import android.database.DatabaseErrorHandler;
-import android.database.DatabaseUtils;
-import android.database.DefaultDatabaseErrorHandler;
-import android.database.sqlite.SQLiteDatabase;
-import android.database.sqlite.SQLiteDatabase.CursorFactory;
-import android.database.sqlite.SQLiteStatement;
-import android.test.AndroidTestCase;
-import android.test.suitebuilder.annotation.LargeTest;
-import android.test.suitebuilder.annotation.MediumTest;
-import android.test.suitebuilder.annotation.SmallTest;
-import android.test.suitebuilder.annotation.Suppress;
-import android.util.Log;
-import android.util.Pair;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-public class SQLiteDatabaseTest extends AndroidTestCase {
-    private static final String TAG = "DatabaseGeneralTest";
-    private static final String TEST_TABLE = "test";
-    private static final int CURRENT_DATABASE_VERSION = 42;
-    private SQLiteDatabase mDatabase;
-    private File mDatabaseFile;
-    private static final int INSERT = 1;
-    private static final int UPDATE = 2;
-    private static final int DELETE = 3;
-    private static final String DB_NAME = "database_test.db";
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        dbSetUp();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        dbTeardown();
-        super.tearDown();
-    }
-
-    private void dbTeardown() throws Exception {
-        mDatabase.close();
-        mDatabaseFile.delete();
-    }
-
-    private void dbSetUp() throws Exception {
-        File dbDir = getContext().getDir(this.getClass().getName(), Context.MODE_PRIVATE);
-        mDatabaseFile = new File(dbDir, DB_NAME);
-        if (mDatabaseFile.exists()) {
-            mDatabaseFile.delete();
-        }
-        mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null, null);
-        assertNotNull(mDatabase);
-        mDatabase.setVersion(CURRENT_DATABASE_VERSION);
-    }
-
-    @SmallTest
-    public void testEnableWriteAheadLogging() {
-        mDatabase.disableWriteAheadLogging();
-        assertNull(mDatabase.mConnectionPool);
-        mDatabase.enableWriteAheadLogging();
-        DatabaseConnectionPool pool = mDatabase.mConnectionPool;
-        assertNotNull(pool);
-        // make the same call again and make sure the pool already setup is not re-created
-        mDatabase.enableWriteAheadLogging();
-        assertEquals(pool, mDatabase.mConnectionPool);
-    }
-
-    @SmallTest
-    public void testDisableWriteAheadLogging() {
-        mDatabase.execSQL("create table test (i int);");
-        mDatabase.enableWriteAheadLogging();
-        assertNotNull(mDatabase.mConnectionPool);
-        // get a pooled database connection
-        SQLiteDatabase db = mDatabase.getDbConnection("select * from test");
-        assertNotNull(db);
-        assertFalse(mDatabase.equals(db));
-        assertTrue(db.isOpen());
-        // disable WAL - which should close connection pool and all pooled connections
-        mDatabase.disableWriteAheadLogging();
-        assertNull(mDatabase.mConnectionPool);
-        assertFalse(db.isOpen());
-    }
-
-    @SmallTest
-    public void testCursorsWithClosedDbConnAfterDisableWriteAheadLogging() {
-        mDatabase.disableWriteAheadLogging();
-        mDatabase.beginTransactionNonExclusive();
-        mDatabase.execSQL("create table test (i int);");
-        mDatabase.execSQL("insert into test values(1);");
-        mDatabase.setTransactionSuccessful();
-        mDatabase.endTransaction();
-        mDatabase.enableWriteAheadLogging();
-        assertNotNull(mDatabase.mConnectionPool);
-        assertEquals(0, mDatabase.mConnectionPool.getSize());
-        assertEquals(0, mDatabase.mConnectionPool.getFreePoolSize());
-        // get a cursor which should use pooled database connection
-        Cursor c = mDatabase.rawQuery("select * from test", null);
-        assertEquals(1, c.getCount());
-        assertEquals(1, mDatabase.mConnectionPool.getSize());
-        assertEquals(1, mDatabase.mConnectionPool.getFreePoolSize());
-        SQLiteDatabase db = mDatabase.mConnectionPool.getConnectionList().get(0);
-        assertTrue(mDatabase.mConnectionPool.isDatabaseObjFree(db));
-        // disable WAL - which should close connection pool and all pooled connections
-        mDatabase.disableWriteAheadLogging();
-        assertNull(mDatabase.mConnectionPool);
-        assertFalse(db.isOpen());
-        // cursor data should still be accessible because it is fetching data from CursorWindow
-        c.moveToNext();
-        assertEquals(1, c.getInt(0));
-        c.requery();
-        assertEquals(1, c.getCount());
-        c.moveToNext();
-        assertEquals(1, c.getInt(0));
-        c.close();
-    }
-
-    /**
-     * a transaction should be started before a standalone-update/insert/delete statement
-     */
-    @SmallTest
-    public void testStartXactBeforeUpdateSql() throws InterruptedException {
-        runTestForStartXactBeforeUpdateSql(INSERT);
-        runTestForStartXactBeforeUpdateSql(UPDATE);
-        runTestForStartXactBeforeUpdateSql(DELETE);
-    }
-    private void runTestForStartXactBeforeUpdateSql(int stmtType) throws InterruptedException {
-        createTableAndClearCache();
-
-        ContentValues values = new ContentValues();
-        // make some changes to data in TEST_TABLE
-        for (int i = 0; i < 5; i++) {
-            values.put("i", i);
-            values.put("j", "i" + System.currentTimeMillis());
-            mDatabase.insert(TEST_TABLE, null, values);
-            switch (stmtType) {
-                case UPDATE:
-                    values.put("j", "u" + System.currentTimeMillis());
-                    mDatabase.update(TEST_TABLE, values, "i = " + i, null);
-                    break;
-                case DELETE:
-                    mDatabase.delete(TEST_TABLE, "i = 1", null);
-                    break;
-            }
-        }
-        // do a query. even though query uses a different database connection,
-        // it should still see the above changes to data because the above standalone
-        // insert/update/deletes are done in transactions automatically.
-        String sql = "select count(*) from " + TEST_TABLE;
-        SQLiteStatement stmt = mDatabase.compileStatement(sql);
-        final int expectedValue = (stmtType == DELETE) ? 4 : 5;
-        assertEquals(expectedValue, stmt.simpleQueryForLong());
-        stmt.close();
-        Cursor c = mDatabase.rawQuery(sql, null);
-        assertEquals(1, c.getCount());
-        c.moveToFirst();
-        assertEquals(expectedValue, c.getLong(0));
-        c.close();
-
-        // do 5 more changes in a transaction but do a query before and after the commit
-        mDatabase.beginTransaction();
-        for (int i = 10; i < 15; i++) {
-            values.put("i", i);
-            values.put("j", "i" + System.currentTimeMillis());
-            mDatabase.insert(TEST_TABLE, null, values);
-            switch (stmtType) {
-                case UPDATE:
-                    values.put("j", "u" + System.currentTimeMillis());
-                    mDatabase.update(TEST_TABLE, values, "i = " + i, null);
-                    break;
-                case DELETE:
-                    mDatabase.delete(TEST_TABLE, "i = 1", null);
-                    break;
-            }
-        }
-        mDatabase.setTransactionSuccessful();
-        // do a query before commit - should still have 5 rows
-        // this query should run in a different thread to force it to use a different database
-        // connection
-        Thread t = new Thread() {
-            @Override public void run() {
-                String sql = "select count(*) from " + TEST_TABLE;
-                SQLiteStatement stmt = getDb().compileStatement(sql);
-                assertEquals(expectedValue, stmt.simpleQueryForLong());
-                stmt.close();
-                Cursor c = getDb().rawQuery(sql, null);
-                assertEquals(1, c.getCount());
-                c.moveToFirst();
-                assertEquals(expectedValue, c.getLong(0));
-                c.close();
-            }
-        };
-        t.start();
-        // wait until the above thread is done
-        t.join();
-        // commit and then query. should see changes from the transaction
-        mDatabase.endTransaction();
-        stmt = mDatabase.compileStatement(sql);
-        final int expectedValue2 = (stmtType == DELETE) ? 9 : 10;
-        assertEquals(expectedValue2, stmt.simpleQueryForLong());
-        stmt.close();
-        c = mDatabase.rawQuery(sql, null);
-        assertEquals(1, c.getCount());
-        c.moveToFirst();
-        assertEquals(expectedValue2, c.getLong(0));
-        c.close();
-    }
-    private synchronized SQLiteDatabase getDb() {
-        return mDatabase;
-    }
-
-    /**
-     * Test to ensure that readers are able to read the database data (old versions)
-     * EVEN WHEN the writer is in a transaction on the same database.
-     *<p>
-     * This test starts 1 Writer and 2 Readers and sets up connection pool for readers
-     * by calling the method {@link SQLiteDatabase#enableWriteAheadLogging()}.
-     * <p>
-     * Writer does the following in a tight loop
-     * <pre>
-     *     begin transaction
-     *     insert into table_1
-     *     insert into table_2
-     *     commit
-     * </pre>
-     * <p>
-     * As long a the writer is alive, Readers do the following in a tight loop at the same time
-     * <pre>
-     *     Reader_K does "select count(*) from table_K"  where K = 1 or 2
-     * </pre>
-     * <p>
-     * The test is run for TIME_TO_RUN_WAL_TEST_FOR sec.
-     * <p>
-     * The test is repeated for different connection-pool-sizes (1..3)
-     * <p>
-     * And at the end of of each test, the following statistics are printed
-     * <ul>
-     *    <li>connection-pool-size</li>
-     *    <li>number-of-transactions by writer</li>
-     *    <li>number of reads by reader_K while the writer is IN or NOT-IN xaction</li>
-     * </ul>
-     */
-    @LargeTest
-    @Suppress // run this test only if you need to collect the numbers from this test
-    public void testConcurrencyEffectsOfConnPool() throws Exception {
-        // run the test with sqlite WAL enable
-        runConnectionPoolTest(true);
-
-        // run the same test WITHOUT sqlite WAL enabled
-        runConnectionPoolTest(false);
-    }
-
-    private void runConnectionPoolTest(boolean useWal) throws Exception {
-        int M = 3;
-        StringBuilder[] buff = new StringBuilder[M];
-        for (int i = 0; i < M; i++) {
-            if (useWal) {
-                // set up connection pool
-                mDatabase.enableWriteAheadLogging();
-                mDatabase.mConnectionPool.setMaxPoolSize(i + 1);
-            } else {
-                mDatabase.disableWriteAheadLogging();
-            }
-            mDatabase.execSQL("CREATE TABLE t1 (i int, j int);");
-            mDatabase.execSQL("CREATE TABLE t2 (i int, j int);");
-            mDatabase.beginTransaction();
-            for (int k = 0; k < 5; k++) {
-                mDatabase.execSQL("insert into t1 values(?,?);", new String[] {k+"", k+""});
-                mDatabase.execSQL("insert into t2 values(?,?);", new String[] {k+"", k+""});
-            }
-            mDatabase.setTransactionSuccessful();
-            mDatabase.endTransaction();
-
-            // start a writer
-            Writer w = new Writer(mDatabase);
-
-            // initialize an array of counters to be passed to the readers
-            Reader r1 = new Reader(mDatabase, "t1", w, 0);
-            Reader r2 = new Reader(mDatabase, "t2", w, 1);
-            w.start();
-            r1.start();
-            r2.start();
-
-            // wait for all threads to die
-            w.join();
-            r1.join();
-            r2.join();
-
-            // print the stats
-            int[][] counts = getCounts();
-            buff[i] = new StringBuilder();
-            buff[i].append("connpool-size = ");
-            buff[i].append(i + 1);
-            buff[i].append(", num xacts by writer = ");
-            buff[i].append(getNumXacts());
-            buff[i].append(", num-reads-in-xact/NOT-in-xact by reader1 = ");
-            buff[i].append(counts[0][1] + "/" + counts[0][0]);
-            buff[i].append(", by reader2 = ");
-            buff[i].append(counts[1][1] + "/" + counts[1][0]);
-
-            Log.i(TAG, "done testing for conn-pool-size of " + (i+1));
-
-            dbTeardown();
-            dbSetUp();
-        }
-        Log.i(TAG, "duration of test " + TIME_TO_RUN_WAL_TEST_FOR + " sec");
-        for (int i = 0; i < M; i++) {
-            Log.i(TAG, buff[i].toString());
-        }
-    }
-
-    private boolean inXact = false;
-    private int numXacts;
-    private static final int TIME_TO_RUN_WAL_TEST_FOR = 15; // num sec this test should run
-    private int[][] counts = new int[2][2];
-
-    private synchronized boolean inXact() {
-        return inXact;
-    }
-
-    private synchronized void setInXactFlag(boolean flag) {
-        inXact = flag;
-    }
-
-    private synchronized void setCounts(int readerNum, int[] numReads) {
-        counts[readerNum][0] = numReads[0];
-        counts[readerNum][1] = numReads[1];
-    }
-
-    private synchronized int[][] getCounts() {
-        return counts;
-    }
-
-    private synchronized void setNumXacts(int num) {
-        numXacts = num;
-    }
-
-    private synchronized int getNumXacts() {
-        return numXacts;
-    }
-
-    private class Writer extends Thread {
-        private SQLiteDatabase db = null;
-        public Writer(SQLiteDatabase db) {
-            this.db = db;
-        }
-        @Override public void run() {
-            // in a loop, for N sec, do the following
-            //    BEGIN transaction
-            //    insert into table t1, t2
-            //    Commit
-            long now = System.currentTimeMillis();
-            int k;
-            for (k = 0;(System.currentTimeMillis() - now) / 1000 < TIME_TO_RUN_WAL_TEST_FOR; k++) {
-                db.beginTransactionNonExclusive();
-                setInXactFlag(true);
-                for (int i = 0; i < 10; i++) {
-                    db.execSQL("insert into t1 values(?,?);", new String[] {i+"", i+""});
-                    db.execSQL("insert into t2 values(?,?);", new String[] {i+"", i+""});
-                }
-                db.setTransactionSuccessful();
-                setInXactFlag(false);
-                db.endTransaction();
-            }
-            setNumXacts(k);
-        }
-    }
-
-    private class Reader extends Thread {
-        private SQLiteDatabase db = null;
-        private String table = null;
-        private Writer w = null;
-        private int readerNum;
-        private int[] numReads = new int[2];
-        public Reader(SQLiteDatabase db, String table, Writer w, int readerNum) {
-            this.db = db;
-            this.table = table;
-            this.w = w;
-            this.readerNum = readerNum;
-        }
-        @Override public void run() {
-            // while the write is alive, in a loop do the query on a table
-            while (w.isAlive()) {
-                for (int i = 0; i < 10; i++) {
-                    DatabaseUtils.longForQuery(db, "select count(*) from " + this.table, null);
-                    // update count of reads
-                    numReads[inXact() ? 1 : 0] += 1;
-                }
-            }
-            setCounts(readerNum, numReads);
-        }
-    }
-
-    public static class ClassToTestSqlCompilationAndCaching extends SQLiteProgram {
-        private ClassToTestSqlCompilationAndCaching(SQLiteDatabase db, String sql) {
-            super(db, sql);
-        }
-        public static ClassToTestSqlCompilationAndCaching create(SQLiteDatabase db, String sql) {
-            db.lock();
-            try {
-                return new ClassToTestSqlCompilationAndCaching(db, sql);
-            } finally {
-                db.unlock();
-            }
-        }
-    }
-
-    @SmallTest
-    public void testLruCachingOfSqliteCompiledSqlObjs() {
-        createTableAndClearCache();
-        // set cache size
-        int N = SQLiteDatabase.MAX_SQL_CACHE_SIZE;
-        mDatabase.setMaxSqlCacheSize(N);
-
-        // do N+1 queries - and when the 0th entry is removed from LRU cache due to the
-        // insertion of (N+1)th entry, make sure 0th entry is closed
-        ArrayList<Integer> stmtObjs = new ArrayList<Integer>();
-        ArrayList<String> sqlStrings = new ArrayList<String>();
-        int stmt0 = 0;
-        for (int i = 0; i < N+1; i++) {
-            String s = "insert into test values(" + i + ",?);";
-            sqlStrings.add(s);
-            ClassToTestSqlCompilationAndCaching c =
-                    ClassToTestSqlCompilationAndCaching.create(mDatabase, s);
-            int n = c.getSqlStatementId();
-            stmtObjs.add(i, n);
-            if (i == 0) {
-                // save the statementId of this obj. we want to make sure it is thrown out of
-                // the cache at the end of this test.
-                stmt0 = n;
-            }
-            c.close();
-        }
-        // is 0'th entry out of the cache? it should be in the list of statementIds
-        // corresponding to the pre-compiled sql statements to be finalized.
-        assertTrue(mDatabase.getQueuedUpStmtList().contains(stmt0));
-        for (int i = 1; i < N+1; i++) {
-            SQLiteCompiledSql compSql = mDatabase.getCompiledStatementForSql(sqlStrings.get(i));
-            assertNotNull(compSql);
-            assertTrue(stmtObjs.contains(compSql.nStatement));
-        }
-    }
-
-    @MediumTest
-    public void testDbCloseReleasingAllCachedSql() {
-        mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, text1 TEXT, text2 TEXT, " +
-                "num1 INTEGER, num2 INTEGER, image BLOB);");
-        final String statement = "DELETE FROM test WHERE _id=?;";
-        SQLiteStatement statementDoNotClose = mDatabase.compileStatement(statement);
-        statementDoNotClose.bindLong(1, 1);
-        /* do not close statementDoNotClose object.
-         * That should leave it in SQLiteDatabase.mPrograms.
-         * mDatabase.close() in tearDown() should release it.
-         */
-    }
-
-    private void createTableAndClearCache() {
-        mDatabase.disableWriteAheadLogging();
-        mDatabase.execSQL("DROP TABLE IF EXISTS " + TEST_TABLE);
-        mDatabase.execSQL("CREATE TABLE " + TEST_TABLE + " (i int, j int);");
-        mDatabase.enableWriteAheadLogging();
-        mDatabase.lock();
-        // flush the above statement from cache and close all the pending statements to be released
-        mDatabase.deallocCachedSqlStatements();
-        mDatabase.closePendingStatements();
-        mDatabase.unlock();
-        assertEquals(0, mDatabase.getQueuedUpStmtList().size());
-    }
-
-    /**
-     * test to make sure the statement finalizations are not done right away but
-     * piggy-backed onto the next sql statement execution on the same database.
-     */
-    @SmallTest
-    public void testStatementClose() {
-        createTableAndClearCache();
-        // fill up statement cache in mDatabase
-        int N = SQLiteDatabase.MAX_SQL_CACHE_SIZE;
-        mDatabase.setMaxSqlCacheSize(N);
-        SQLiteStatement stmt;
-        int stmt0Id = 0;
-        for (int i = 0; i < N; i ++) {
-            ClassToTestSqlCompilationAndCaching c =
-                    ClassToTestSqlCompilationAndCaching.create(mDatabase,
-                            "insert into test values(" + i + ", ?);");
-            // keep track of 0th entry
-            if (i == 0) {
-                stmt0Id = c.getSqlStatementId();
-            }
-            c.close();
-        }
-
-        // add one more to the cache - and the above 'stmt0Id' should fall out of cache
-        ClassToTestSqlCompilationAndCaching stmt1 =
-                ClassToTestSqlCompilationAndCaching.create(mDatabase,
-                        "insert into test values(100, ?);");
-        stmt1.close();
-
-        // the above close() should have queuedUp the statement for finalization
-        ArrayList<Integer> statementIds = mDatabase.getQueuedUpStmtList();
-        assertTrue(statementIds.contains(stmt0Id));
-
-        // execute something to see if this statement gets finalized
-        mDatabase.execSQL("delete from test where i = 10;");
-        statementIds = mDatabase.getQueuedUpStmtList();
-        assertFalse(statementIds.contains(stmt0Id));
-    }
-
-    /**
-     * same as above - except that the statement to be finalized is from Thread # 1.
-     * and it is eventually finalized in Thread # 2 when it executes a SQL statement.
-     * @throws InterruptedException
-     */
-    @LargeTest
-    public void testStatementCloseDiffThread() throws InterruptedException {
-        createTableAndClearCache();
-        final int N = SQLiteDatabase.MAX_SQL_CACHE_SIZE;
-        mDatabase.setMaxSqlCacheSize(N);
-        // fill up statement cache in mDatabase in a thread
-        Thread t1 = new Thread() {
-            @Override public void run() {
-                SQLiteStatement stmt;
-                for (int i = 0; i < N; i++) {
-                    ClassToTestSqlCompilationAndCaching c =
-                        ClassToTestSqlCompilationAndCaching.create(getDb(),
-                                "insert into test values(" + i + ", ?);");
-                    // keep track of 0th entry
-                    if (i == 0) {
-                        stmt0Id = c.getSqlStatementId();
-                    }
-                    c.close();
-                }
-            }
-        };
-        t1.start();
-        // wait for the thread to finish
-        t1.join();
-        // mDatabase shouldn't have any statements to be released
-        assertEquals(0, mDatabase.getQueuedUpStmtList().size());
-
-        // add one more to the cache - and the above 'stmt0Id' should fall out of cache
-        // just for the heck of it, do it in a separate thread
-        Thread t2 = new Thread() {
-            @Override public void run() {
-                ClassToTestSqlCompilationAndCaching stmt1 =
-                    ClassToTestSqlCompilationAndCaching.create(getDb(),
-                            "insert into test values(100, ?);");
-                stmt1.bindLong(1, 1);
-                stmt1.close();
-            }
-        };
-        t2.start();
-        t2.join();
-
-        // close() in the above thread should have queuedUp the stmt0Id for finalization
-        ArrayList<Integer> statementIds = getDb().getQueuedUpStmtList();
-        assertTrue(statementIds.contains(getStmt0Id()));
-        assertEquals(1, statementIds.size());
-
-        // execute something to see if this statement gets finalized
-        // again do it in a separate thread
-        Thread t3 = new Thread() {
-            @Override public void run() {
-                getDb().execSQL("delete from test where i = 10;");
-            }
-        };
-        t3.start();
-        t3.join();
-
-        // is the statement finalized?
-        statementIds = getDb().getQueuedUpStmtList();
-        assertFalse(statementIds.contains(getStmt0Id()));
-    }
-
-    private volatile int stmt0Id = 0;
-    private synchronized int getStmt0Id() {
-        return this.stmt0Id;
-    }
-
-    /**
-     * same as above - except that the queue of statements to be finalized are finalized
-     * by database close() operation.
-     */
-    @LargeTest
-    public void testStatementCloseByDbClose() throws InterruptedException {
-        createTableAndClearCache();
-        // fill up statement cache in mDatabase in a thread
-        Thread t1 = new Thread() {
-            @Override public void run() {
-                int N = SQLiteDatabase.MAX_SQL_CACHE_SIZE;
-                getDb().setMaxSqlCacheSize(N);
-                SQLiteStatement stmt;
-                for (int i = 0; i < N; i ++) {
-                    ClassToTestSqlCompilationAndCaching c =
-                            ClassToTestSqlCompilationAndCaching.create(getDb(),
-                                    "insert into test values(" + i + ", ?);");
-                    // keep track of 0th entry
-                    if (i == 0) {
-                        stmt0Id = c.getSqlStatementId();
-                    }
-                    c.close();
-                }
-            }
-        };
-        t1.start();
-        // wait for the thread to finish
-        t1.join();
-
-        // add one more to the cache - and the above 'stmt0Id' should fall out of cache
-        // just for the heck of it, do it in a separate thread
-        Thread t2 = new Thread() {
-            @Override public void run() {
-                ClassToTestSqlCompilationAndCaching stmt1 =
-                        ClassToTestSqlCompilationAndCaching.create(getDb(),
-                                "insert into test values(100, ?);");
-                stmt1.bindLong(1, 1);
-                stmt1.close();
-            }
-        };
-        t2.start();
-        t2.join();
-
-        // close() in the above thread should have queuedUp the statement for finalization
-        ArrayList<Integer> statementIds = getDb().getQueuedUpStmtList();
-        assertTrue(getStmt0Id() > 0);
-        assertTrue(statementIds.contains(stmt0Id));
-        assertEquals(1, statementIds.size());
-
-        // close the database. everything from mClosedStatementIds in mDatabase
-        // should be finalized and cleared from the list
-        // again do it in a separate thread
-        Thread t3 = new Thread() {
-            @Override public void run() {
-                getDb().close();
-            }
-        };
-        t3.start();
-        t3.join();
-
-        // check mClosedStatementIds in mDatabase. it should be empty
-        statementIds = getDb().getQueuedUpStmtList();
-        assertEquals(0, statementIds.size());
-    }
-
-    /**
-     * This test tests usage execSQL() to begin transaction works in the following way
-     *   Thread #1 does
-     *       execSQL("begin transaction");
-     *       insert()
-     *   Thread # 2
-     *       query()
-     *   Thread#1 ("end transaction")
-     * Thread # 2 query will execute - because java layer will not have locked the SQLiteDatabase
-     * object and sqlite will consider this query to be part of the transaction.
-     *
-     * but if thread # 1 uses beginTransaction() instead of execSQL() to start transaction,
-     * then Thread # 2's query will have been blocked by java layer
-     * until Thread#1 ends transaction.
-     *
-     * @throws InterruptedException
-     */
-    @SmallTest
-    public void testExecSqlToStartAndEndTransaction() throws InterruptedException {
-        runExecSqlToStartAndEndTransaction("END");
-        // same as above, instead now do "COMMIT" or "ROLLBACK" instead of "END" transaction
-        runExecSqlToStartAndEndTransaction("COMMIT");
-        runExecSqlToStartAndEndTransaction("ROLLBACK");
-    }
-    private void runExecSqlToStartAndEndTransaction(String str) throws InterruptedException {
-        createTableAndClearCache();
-        // disable WAL just so queries and updates use the same database connection
-        mDatabase.disableWriteAheadLogging();
-        mDatabase.execSQL("BEGIN transaction");
-        // even though mDatabase.beginTransaction() is not called to start transaction,
-        // mDatabase connection should now be in transaction as a result of
-        // mDatabase.execSQL("BEGIN transaction")
-        // but mDatabase.mLock should not be held by any thread
-        assertTrue(mDatabase.inTransaction());
-        assertFalse(mDatabase.isDbLockedByCurrentThread());
-        assertFalse(mDatabase.isDbLockedByOtherThreads());
-        assertTrue(mDatabase.amIInTransaction());
-        mDatabase.execSQL("INSERT into " + TEST_TABLE + " values(10, 999);");
-        assertTrue(mDatabase.inTransaction());
-        assertFalse(mDatabase.isDbLockedByCurrentThread());
-        assertFalse(mDatabase.isDbLockedByOtherThreads());
-        assertTrue(mDatabase.amIInTransaction());
-        Thread t = new Thread() {
-            @Override public void run() {
-                assertTrue(mDatabase.amIInTransaction());
-                assertEquals(999, DatabaseUtils.longForQuery(getDb(),
-                        "select j from " + TEST_TABLE + " WHERE i = 10", null));
-                assertTrue(getDb().inTransaction());
-                assertFalse(getDb().isDbLockedByCurrentThread());
-                assertFalse(getDb().isDbLockedByOtherThreads());
-                assertTrue(mDatabase.amIInTransaction());
-            }
-        };
-        t.start();
-        t.join();
-        assertTrue(mDatabase.amIInTransaction());
-        assertTrue(mDatabase.inTransaction());
-        assertFalse(mDatabase.isDbLockedByCurrentThread());
-        assertFalse(mDatabase.isDbLockedByOtherThreads());
-        mDatabase.execSQL(str);
-        assertFalse(mDatabase.amIInTransaction());
-        assertFalse(mDatabase.inTransaction());
-        assertFalse(mDatabase.isDbLockedByCurrentThread());
-        assertFalse(mDatabase.isDbLockedByOtherThreads());
-    }
-
-    /**
-     * test the following
-     * http://b/issue?id=2871037
-     *          Cursor cursor = db.query(...);
-     *          // with WAL enabled, the above uses a pooled database connection
-     *          db.beginTransaction()
-     *          try {
-     *            db.insert(......);
-     *            cursor.requery();
-     *            // since the cursor uses pooled database connection, the above requery
-     *            // will not return the results that were inserted above since the insert is
-     *            // done using main database connection AND the transaction is not committed yet.
-     *            // fix is to make the above cursor use the main database connection - and NOT
-     *            // the pooled database connection
-     *            db.setTransactionSuccessful()
-     *          } finally {
-     *            db.endTransaction()
-     *          }
-     *
-     * @throws InterruptedException
-     */
-    @SmallTest
-    public void testTransactionAndWalInterplay1() throws InterruptedException {
-        createTableAndClearCache();
-        mDatabase.execSQL("INSERT into " + TEST_TABLE + " values(10, 999);");
-        String sql = "select * from " + TEST_TABLE;
-        Cursor c = mDatabase.rawQuery(sql, null);
-        // should have 1 row in the table
-        assertEquals(1, c.getCount());
-        mDatabase.beginTransactionNonExclusive();
-        try {
-            mDatabase.execSQL("INSERT into " + TEST_TABLE + " values(100, 9909);");
-            assertEquals(2, DatabaseUtils.longForQuery(mDatabase,
-                    "select count(*) from " + TEST_TABLE, null));
-            // requery on the previously opened cursor
-            // cursor should now use the main database connection and see 2 rows
-            c.requery();
-            assertEquals(2, c.getCount());
-            mDatabase.setTransactionSuccessful();
-        } finally {
-            mDatabase.endTransaction();
-        }
-        c.close();
-
-        // do the same test but now do the requery in a separate thread.
-        createTableAndClearCache();
-        mDatabase.execSQL("INSERT into " + TEST_TABLE + " values(10, 999);");
-        final Cursor c1 = mDatabase.rawQuery("select count(*) from " + TEST_TABLE, null);
-        // should have 1 row in the table
-        assertEquals(1, c1.getCount());
-        mDatabase.beginTransactionNonExclusive();
-        try {
-            mDatabase.execSQL("INSERT into " + TEST_TABLE + " values(100, 9909);");
-            assertEquals(2, DatabaseUtils.longForQuery(mDatabase,
-                    "select count(*) from " + TEST_TABLE, null));
-            // query in a different thread. that causes the cursor to use a pooled connection
-            // and since this thread hasn't committed its changes, the cursor should still see only
-            // 1 row
-            Thread t = new Thread() {
-                @Override public void run() {
-                    c1.requery();
-                    assertEquals(1, c1.getCount());
-                }
-            };
-            t.start();
-            t.join();
-            // should be 2 rows now - including the the row inserted above
-            mDatabase.setTransactionSuccessful();
-        } finally {
-            mDatabase.endTransaction();
-        }
-        c1.close();
-    }
-
-    /**
-     * This test is same as {@link #testTransactionAndWalInterplay1()} except the following:
-     * instead of mDatabase.beginTransactionNonExclusive(), use execSQL("BEGIN transaction")
-     * and instead of mDatabase.endTransaction(), use execSQL("END");
-     */
-    @SmallTest
-    public void testTransactionAndWalInterplay2() throws InterruptedException {
-        createTableAndClearCache();
-        mDatabase.execSQL("INSERT into " + TEST_TABLE + " values(10, 999);");
-        String sql = "select * from " + TEST_TABLE;
-        Cursor c = mDatabase.rawQuery(sql, null);
-        // should have 1 row in the table
-        assertEquals(1, c.getCount());
-        mDatabase.execSQL("BEGIN transaction");
-        try {
-            mDatabase.execSQL("INSERT into " + TEST_TABLE + " values(100, 9909);");
-            assertEquals(2, DatabaseUtils.longForQuery(mDatabase,
-                    "select count(*) from " + TEST_TABLE, null));
-            // requery on the previously opened cursor
-            // cursor should now use the main database connection and see 2 rows
-            c.requery();
-            assertEquals(2, c.getCount());
-        } finally {
-            mDatabase.execSQL("commit;");
-        }
-        c.close();
-
-        // do the same test but now do the requery in a separate thread.
-        createTableAndClearCache();
-        mDatabase.execSQL("INSERT into " + TEST_TABLE + " values(10, 999);");
-        final Cursor c1 = mDatabase.rawQuery("select count(*) from " + TEST_TABLE, null);
-        // should have 1 row in the table
-        assertEquals(1, c1.getCount());
-        mDatabase.execSQL("BEGIN transaction");
-        try {
-            mDatabase.execSQL("INSERT into " + TEST_TABLE + " values(100, 9909);");
-            assertEquals(2, DatabaseUtils.longForQuery(mDatabase,
-                    "select count(*) from " + TEST_TABLE, null));
-            // query in a different thread. but since the transaction is started using
-            // execSQ() instead of beginTransaction(), cursor's query is considered part of
-            // the same transaction - and hence it should see the above inserted row
-            Thread t = new Thread() {
-                @Override public void run() {
-                    c1.requery();
-                    assertEquals(1, c1.getCount());
-                }
-            };
-            t.start();
-            t.join();
-            // should be 2 rows now - including the the row inserted above
-        } finally {
-            mDatabase.execSQL("commit");
-        }
-        c1.close();
-    }
-
-    /**
-     * This test is same as {@link #testTransactionAndWalInterplay2()} except the following:
-     * instead of committing the data, do rollback and make sure the data seen by the query
-     * within the transaction is now gone.
-     */
-    @SmallTest
-    public void testTransactionAndWalInterplay3() {
-        createTableAndClearCache();
-        mDatabase.execSQL("INSERT into " + TEST_TABLE + " values(10, 999);");
-        String sql = "select * from " + TEST_TABLE;
-        Cursor c = mDatabase.rawQuery(sql, null);
-        // should have 1 row in the table
-        assertEquals(1, c.getCount());
-        mDatabase.execSQL("BEGIN transaction");
-        try {
-            mDatabase.execSQL("INSERT into " + TEST_TABLE + " values(100, 9909);");
-            assertEquals(2, DatabaseUtils.longForQuery(mDatabase,
-                    "select count(*) from " + TEST_TABLE, null));
-            // requery on the previously opened cursor
-            // cursor should now use the main database connection and see 2 rows
-            c.requery();
-            assertEquals(2, c.getCount());
-        } finally {
-            // rollback the change
-            mDatabase.execSQL("rollback;");
-        }
-        // since the change is rolled back, do the same query again and should now find only 1 row
-        c.requery();
-        assertEquals(1, c.getCount());
-        assertEquals(1, DatabaseUtils.longForQuery(mDatabase,
-                "select count(*) from " + TEST_TABLE, null));
-        c.close();
-    }
-
-    @SmallTest
-    public void testAttachDb() {
-        String newDb = "/sdcard/mydata.db";
-        File f = new File(newDb);
-        if (f.exists()) {
-            f.delete();
-        }
-        assertFalse(f.exists());
-        SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(newDb, null);
-        db.execSQL("create table test1 (i int);");
-        db.execSQL("insert into test1 values(1);");
-        db.execSQL("insert into test1 values(11);");
-        Cursor c = null;
-        try {
-            c = db.rawQuery("select * from test1", null);
-            int count = c.getCount();
-            Log.i(TAG, "count: " + count);
-            assertEquals(2, count);
-        } finally {
-            c.close();
-            db.close();
-            c = null;
-        }
-
-        mDatabase.execSQL("attach database ? as newDb" , new String[]{newDb});
-        Cursor c1 = null;
-        try {
-            c1 = mDatabase.rawQuery("select * from newDb.test1", null);
-            assertEquals(2, c1.getCount());
-        } catch (Exception e) {
-            fail("unexpected exception: " + e.getMessage());
-        } finally {
-            if (c1 != null) {
-                c1.close();
-            }
-        }
-        List<Pair<String, String>> dbs = mDatabase.getAttachedDbs();
-        for (Pair<String, String> p: dbs) {
-            Log.i(TAG, "attached dbs: " + p.first + " : " + p.second);
-        }
-        assertEquals(2, dbs.size());
-     }
-
-    /**
-     * http://b/issue?id=2943028
-     * SQLiteOpenHelper maintains a Singleton even if it is in bad state.
-     */
-    @SmallTest
-    public void testCloseAndReopen() {
-        mDatabase.close();
-        TestOpenHelper helper = new TestOpenHelper(getContext(), DB_NAME, null,
-                CURRENT_DATABASE_VERSION, new DefaultDatabaseErrorHandler());
-        mDatabase = helper.getWritableDatabase();
-        createTableAndClearCache();
-        mDatabase.execSQL("INSERT into " + TEST_TABLE + " values(10, 999);");
-        Cursor c = mDatabase.query(TEST_TABLE, new String[]{"i", "j"}, null, null, null, null, null);
-        assertEquals(1, c.getCount());
-        c.close();
-        mDatabase.close();
-        assertFalse(mDatabase.isOpen());
-        mDatabase = helper.getReadableDatabase();
-        assertTrue(mDatabase.isOpen());
-        c = mDatabase.query(TEST_TABLE, new String[]{"i", "j"}, null, null, null, null, null);
-        assertEquals(1, c.getCount());
-        c.close();
-    }
-    private class TestOpenHelper extends SQLiteOpenHelper {
-        public TestOpenHelper(Context context, String name, CursorFactory factory, int version,
-                DatabaseErrorHandler errorHandler) {
-            super(context, name, factory, version, errorHandler);
-        }
-        @Override public void onCreate(SQLiteDatabase db) {}
-        @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {}
-    }
-}
diff --git a/core/tests/coretests/src/android/database/sqlite/SQLiteStatementTest.java b/core/tests/coretests/src/android/database/sqlite/SQLiteStatementTest.java
deleted file mode 100644
index 955336a..0000000
--- a/core/tests/coretests/src/android/database/sqlite/SQLiteStatementTest.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Copyright (C) 2006 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.database.sqlite;
-
-import android.content.Context;
-import android.test.AndroidTestCase;
-import android.test.suitebuilder.annotation.LargeTest;
-import android.test.suitebuilder.annotation.SmallTest;
-
-import java.io.File;
-import java.util.Random;
-import java.util.concurrent.locks.ReentrantLock;
-
-public class SQLiteStatementTest extends AndroidTestCase {
-    private SQLiteDatabase mDatabase;
-    private File mDatabaseFile;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        File dbDir = getContext().getDir(this.getClass().getName(), Context.MODE_PRIVATE);
-        mDatabaseFile = new File(dbDir, "database_test.db");
-        if (mDatabaseFile.exists()) {
-            mDatabaseFile.delete();
-        }
-        mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null);
-        assertNotNull(mDatabase);
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        mDatabase.close();
-        mDatabaseFile.delete();
-        super.tearDown();
-    }
-
-    /**
-     * Start 2 threads to repeatedly execute the above SQL statement.
-     * Even though 2 threads are executing the same SQL, they each should get their own copy of
-     * prepared SQL statement id and there SHOULD NOT be an error from sqlite or android.
-     * @throws InterruptedException thrown if the test threads started by this test are interrupted
-     */
-    @LargeTest
-    public void testUseOfSameSqlStatementBy2Threads() throws InterruptedException {
-        mDatabase.execSQL("CREATE TABLE test_pstmt (i INTEGER PRIMARY KEY, j text);");
-        final String stmt = "SELECT * FROM test_pstmt WHERE i = ?";
-        class RunStmtThread extends Thread {
-            @Override public void run() {
-                // do it enough times to make sure there are no corner cases going untested
-                for (int i = 0; i < 1000; i++) {
-                    SQLiteStatement s1 = mDatabase.compileStatement(stmt);
-                    s1.bindLong(1, i);
-                    s1.execute();
-                    s1.close();
-                 }
-            }
-        }
-        RunStmtThread t1 = new RunStmtThread();
-        t1.start();
-        RunStmtThread t2 = new RunStmtThread();
-        t2.start();
-         while (t1.isAlive() || t2.isAlive()) {
-             Thread.sleep(10);
-         }
-     }
-
-    /**
-     * A simple test: start 2 threads to repeatedly execute the same {@link SQLiteStatement}.
-     * The 2 threads take turns to use the {@link SQLiteStatement}; i.e., it is NOT in use
-     * by both the threads at the same time.
-     *
-     * @throws InterruptedException thrown if the test threads started by this test are interrupted
-     */
-    @LargeTest
-    public void testUseOfSameSqliteStatementBy2Threads() throws InterruptedException {
-        mDatabase.execSQL("CREATE TABLE test_pstmt (i INTEGER PRIMARY KEY, j text);");
-        final String stmt = "SELECT * FROM test_pstmt WHERE i = ?";
-        final SQLiteStatement s1 = mDatabase.compileStatement(stmt);
-        class RunStmtThread extends Thread {
-            @Override public void run() {
-                // do it enough times to make sure there are no corner cases going untested
-                for (int i = 0; i < 1000; i++) {
-                    lock();
-                    try {
-                        s1.bindLong(1, i);
-                        s1.execute();
-                    } finally {
-                        unlock();
-                    }
-                    Thread.yield();
-                }
-            }
-        }
-        RunStmtThread t1 = new RunStmtThread();
-        t1.start();
-        RunStmtThread t2 = new RunStmtThread();
-        t2.start();
-        while (t1.isAlive() || t2.isAlive()) {
-            Thread.sleep(10);
-        }
-    }
-    /** Synchronize on this when accessing the SqliteStatemet in the above */
-    private final ReentrantLock mLock = new ReentrantLock(true);
-    private void lock() {
-        mLock.lock();
-    }
-    private void unlock() {
-        mLock.unlock();
-    }
-
-    /**
-     * Tests the following: a {@link SQLiteStatement} object should not refer to a
-     * pre-compiled SQL statement id except in during the period of binding the arguments
-     * and executing the SQL statement.
-     */
-    @LargeTest
-    public void testReferenceToPrecompiledStatementId() {
-        mDatabase.execSQL("create table t (i int, j text);");
-        verifyReferenceToPrecompiledStatementId(false);
-        verifyReferenceToPrecompiledStatementId(true);
-
-        // a small stress test to make sure there are no side effects of
-        // the acquire & release of pre-compiled statement id by SQLiteStatement object.
-        for (int i = 0; i < 100; i++) {
-            verifyReferenceToPrecompiledStatementId(false);
-            verifyReferenceToPrecompiledStatementId(true);
-        }
-    }
-
-    @SuppressWarnings("deprecation")
-    private void verifyReferenceToPrecompiledStatementId(boolean wal) {
-        if (wal) {
-            mDatabase.enableWriteAheadLogging();
-        } else {
-            mDatabase.disableWriteAheadLogging();
-        }
-        // test with INSERT statement - doesn't use connection pool, if WAL is set
-        SQLiteStatement stmt = mDatabase.compileStatement("insert into t values(?,?);");
-        assertEquals(mDatabase.mNativeHandle, stmt.nHandle);
-        assertEquals(mDatabase, stmt.mDatabase);
-        // sql statement should not be compiled yet
-        assertEquals(0, stmt.nStatement);
-        assertEquals(0, stmt.getSqlStatementId());
-        int colValue = new Random().nextInt();
-        stmt.bindLong(1, colValue);
-        // verify that the sql statement is still not compiled
-        assertEquals(0, stmt.getSqlStatementId());
-        // should still be using the mDatabase connection - verify
-        assertEquals(mDatabase.mNativeHandle, stmt.nHandle);
-        assertEquals(mDatabase, stmt.mDatabase);
-        stmt.bindString(2, "blah" + colValue);
-        // verify that the sql statement is still not compiled
-        assertEquals(0, stmt.getSqlStatementId());
-        assertEquals(mDatabase.mNativeHandle, stmt.nHandle);
-        assertEquals(mDatabase, stmt.mDatabase);
-        stmt.executeInsert();
-        // now that the statement is executed, pre-compiled statement should be released
-        assertEquals(0, stmt.nStatement);
-        assertEquals(0, stmt.getSqlStatementId());
-        assertEquals(mDatabase.mNativeHandle, stmt.nHandle);
-        assertEquals(mDatabase, stmt.mDatabase);
-        stmt.close();
-        // pre-compiled SQL statement should still remain released from this object
-        assertEquals(0, stmt.nStatement);
-        assertEquals(0, stmt.getSqlStatementId());
-        // but the database handle should still be the same
-        assertEquals(mDatabase, stmt.mDatabase);
-
-        // test with a SELECT statement - uses connection pool if WAL is set
-        stmt = mDatabase.compileStatement("select i from t where j=?;");
-        // sql statement should not be compiled yet
-        assertEquals(0, stmt.nStatement);
-        assertEquals(0, stmt.getSqlStatementId());
-        assertEquals(mDatabase.mNativeHandle, stmt.nHandle);
-        assertEquals(mDatabase, stmt.mDatabase);
-        stmt.bindString(1, "blah" + colValue);
-        // verify that the sql statement is still not compiled
-        assertEquals(0, stmt.nStatement);
-        assertEquals(0, stmt.getSqlStatementId());
-        assertEquals(mDatabase.mNativeHandle, stmt.nHandle);
-        assertEquals(mDatabase, stmt.mDatabase);
-        // execute the statement
-        Long l = stmt.simpleQueryForLong();
-        assertEquals(colValue, l.intValue());
-        // now that the statement is executed, pre-compiled statement should be released
-        assertEquals(0, stmt.nStatement);
-        assertEquals(0, stmt.getSqlStatementId());
-        assertEquals(mDatabase.mNativeHandle, stmt.nHandle);
-        assertEquals(mDatabase, stmt.mDatabase);
-        stmt.close();
-        // pre-compiled SQL statement should still remain released from this object
-        assertEquals(0, stmt.nStatement);
-        assertEquals(0, stmt.getSqlStatementId());
-        // but the database handle should still remain attached to the statement
-        assertEquals(mDatabase.mNativeHandle, stmt.nHandle);
-        assertEquals(mDatabase, stmt.mDatabase);
-    }
-}
diff --git a/core/tests/coretests/src/android/database/sqlite/SQLiteUnfinalizedExceptionTest.java b/core/tests/coretests/src/android/database/sqlite/SQLiteUnfinalizedExceptionTest.java
deleted file mode 100644
index cd2005d..0000000
--- a/core/tests/coretests/src/android/database/sqlite/SQLiteUnfinalizedExceptionTest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2010 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.database.sqlite;
-
-import android.content.Context;
-import android.database.sqlite.SQLiteDatabaseTest.ClassToTestSqlCompilationAndCaching;
-import android.test.AndroidTestCase;
-import android.test.suitebuilder.annotation.SmallTest;
-
-import java.io.File;
-
-public class SQLiteUnfinalizedExceptionTest extends AndroidTestCase {
-    private SQLiteDatabase mDatabase;
-    private File mDatabaseFile;
-    private static final String TABLE_NAME = "testCursor";
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        File dbDir = getContext().getDir(this.getClass().getName(), Context.MODE_PRIVATE);
-        mDatabaseFile = new File(dbDir, "UnfinalizedExceptionTest.db");
-        if (mDatabaseFile.exists()) {
-            mDatabaseFile.delete();
-        }
-        mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null);
-        assertNotNull(mDatabase);
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        mDatabase.close();
-        mDatabaseFile.delete();
-        super.tearDown();
-    }
-
-    @SmallTest
-    public void testUnfinalizedExceptionNotExcpected() {
-        mDatabase.execSQL("CREATE TABLE " + TABLE_NAME + " (i int, j int);");
-        // the above statement should be in SQLiteDatabase.mPrograms
-        // and should automatically be finalized when database is closed
-        mDatabase.lock();
-        try {
-            mDatabase.closeDatabase();
-        } finally {
-            mDatabase.unlock();
-        }
-    }
-
-    @SmallTest
-    public void testUnfinalizedException() {
-        mDatabase.execSQL("CREATE TABLE " + TABLE_NAME + " (i int, j int);");
-        mDatabase.lock();
-        mDatabase.closePendingStatements(); // clears the above from finalizer queue in mdatabase
-        mDatabase.unlock();
-        ClassToTestSqlCompilationAndCaching.create(mDatabase, "select * from "  + TABLE_NAME);
-        // since the above is NOT closed, closing database should fail
-        mDatabase.lock();
-        try {
-            mDatabase.closeDatabase();
-            fail("exception expected");
-        } catch (SQLiteUnfinalizedObjectsException e) {
-            // expected
-        } finally {
-            mDatabase.unlock();
-        }
-    }
-}
diff --git a/core/tests/coretests/src/android/net/NetworkStatsHistoryTest.java b/core/tests/coretests/src/android/net/NetworkStatsHistoryTest.java
index 1df763a..b181122 100644
--- a/core/tests/coretests/src/android/net/NetworkStatsHistoryTest.java
+++ b/core/tests/coretests/src/android/net/NetworkStatsHistoryTest.java
@@ -24,6 +24,8 @@
 import static android.net.NetworkStatsHistory.DataStreamUtils.readVarLong;
 import static android.net.NetworkStatsHistory.DataStreamUtils.writeVarLong;
 import static android.net.NetworkStatsHistory.Entry.UNKNOWN;
+import static android.net.TrafficStats.GB_IN_BYTES;
+import static android.net.TrafficStats.MB_IN_BYTES;
 import static android.text.format.DateUtils.DAY_IN_MILLIS;
 import static android.text.format.DateUtils.HOUR_IN_MILLIS;
 import static android.text.format.DateUtils.MINUTE_IN_MILLIS;
@@ -50,10 +52,6 @@
 
     private static final long TEST_START = 1194220800000L;
 
-    private static final long KB_IN_BYTES = 1024;
-    private static final long MB_IN_BYTES = KB_IN_BYTES * 1024;
-    private static final long GB_IN_BYTES = MB_IN_BYTES * 1024;
-
     private NetworkStatsHistory stats;
 
     @Override
diff --git a/core/tests/coretests/src/android/util/InternalSelectionView.java b/core/tests/coretests/src/android/util/InternalSelectionView.java
index babf38d..a0fb0f1 100644
--- a/core/tests/coretests/src/android/util/InternalSelectionView.java
+++ b/core/tests/coretests/src/android/util/InternalSelectionView.java
@@ -36,6 +36,11 @@
  * entire width of the view.  The height of the view is divided evenly among
  * the rows.
  *
+ * Note: If the height of the view does not divide exactly to the number of rows,
+ *       the last row's height is inflated with the remainder. For example, if the
+ *       view height is 22 and there are two rows, the height of the first row is
+ *       10 and the second 22.
+ *
  * Notice what this view does to be a good citizen w.r.t its internal selection:
  * 1) calls {@link View#requestRectangleOnScreen} each time the selection changes due to
  *    internal navigation.
@@ -138,9 +143,6 @@
 
     @Override
     protected void onDraw(Canvas canvas) {
-
-        int rowHeight = getRowHeight();
-
         int rectTop = mPaddingTop;
         int rectLeft = mPaddingLeft;
         int rectRight = getWidth() - mPaddingRight;
@@ -149,6 +151,8 @@
             mPainter.setColor(Color.BLACK);
             mPainter.setAlpha(0x20);
 
+            int rowHeight = getRowHeight(i);
+
             // draw background rect
             mTempRect.set(rectLeft, rectTop, rectRight, rectTop + rowHeight);
             canvas.drawRect(mTempRect, mPainter);
@@ -178,12 +182,19 @@
         }
     }
 
-    private int getRowHeight() {
-        return (getHeight() - mPaddingTop - mPaddingBottom) / mNumRows;
+    private int getRowHeight(int row) {
+        final int availableHeight = getHeight() - mPaddingTop - mPaddingBottom;
+        final int desiredRowHeight = availableHeight / mNumRows;
+        if (row < mNumRows - 1) {
+            return desiredRowHeight;
+        } else {
+            final int residualHeight = availableHeight % mNumRows;
+            return desiredRowHeight + residualHeight;
+        }
     }
 
     public void getRectForRow(Rect rect, int row) {
-        final int rowHeight = getRowHeight();
+        final int rowHeight = getRowHeight(row);
         final int top = mPaddingTop + row * rowHeight;
         rect.set(mPaddingLeft,
                 top,
@@ -197,10 +208,7 @@
         requestRectangleOnScreen(mTempRect);
     }
 
-
-    /* (non-Javadoc)
-    * @see android.view.KeyEvent.Callback#onKeyDown(int, android.view.KeyEvent)
-    */
+    @Override
     public boolean onKeyDown(int keyCode, KeyEvent event) {
         switch(event.getKeyCode()) {
             case KeyEvent.KEYCODE_DPAD_UP:
diff --git a/core/tests/coretests/src/android/widget/focus/ListOfInternalSelectionViews.java b/core/tests/coretests/src/android/widget/focus/ListOfInternalSelectionViews.java
index 6518341..53b866c 100644
--- a/core/tests/coretests/src/android/widget/focus/ListOfInternalSelectionViews.java
+++ b/core/tests/coretests/src/android/widget/focus/ListOfInternalSelectionViews.java
@@ -17,6 +17,7 @@
 package android.widget.focus;
 
 import android.app.Activity;
+import android.graphics.Point;
 import android.os.Bundle;
 import android.view.View;
 import android.view.ViewGroup;
@@ -110,7 +111,10 @@
     @Override
     protected void onCreate(Bundle icicle) {
         super.onCreate(icicle);
-        mScreenHeight = getWindowManager().getDefaultDisplay().getHeight();
+
+        Point size = new Point();
+        getWindowManager().getDefaultDisplay().getSize(size);
+        mScreenHeight = size.y;
 
         Bundle extras = getIntent().getExtras();
         if (extras != null) {
diff --git a/core/tests/coretests/src/android/widget/focus/RequestFocus.java b/core/tests/coretests/src/android/widget/focus/RequestFocus.java
index af9ee17..21d762a 100644
--- a/core/tests/coretests/src/android/widget/focus/RequestFocus.java
+++ b/core/tests/coretests/src/android/widget/focus/RequestFocus.java
@@ -21,9 +21,7 @@
 import android.app.Activity;
 import android.os.Bundle;
 import android.os.Handler;
-import android.widget.LinearLayout;
 import android.widget.Button;
-import android.view.View;
 
 /**
  * Exercises cases where elements of the UI are requestFocus()ed.
diff --git a/core/tests/coretests/src/android/widget/focus/RequestFocusTest.java b/core/tests/coretests/src/android/widget/focus/RequestFocusTest.java
index 909a8c9..baf587e 100644
--- a/core/tests/coretests/src/android/widget/focus/RequestFocusTest.java
+++ b/core/tests/coretests/src/android/widget/focus/RequestFocusTest.java
@@ -16,21 +16,27 @@
 
 package android.widget.focus;
 
-import android.widget.focus.RequestFocus;
-import com.android.frameworks.coretests.R;
-
 import android.os.Handler;
-import android.test.ActivityInstrumentationTestCase;
+import android.test.ActivityInstrumentationTestCase2;
+import android.test.UiThreadTest;
 import android.test.suitebuilder.annotation.LargeTest;
 import android.test.suitebuilder.annotation.MediumTest;
-import android.widget.Button;
 import android.util.AndroidRuntimeException;
+import android.view.View;
+import android.view.View.OnFocusChangeListener;
+import android.view.ViewTreeObserver.OnGlobalFocusChangeListener;
+import android.widget.Button;
+
+import com.android.frameworks.coretests.R;
+
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * {@link RequestFocusTest} is set up to exercise cases where the views that
  * have focus become invisible or GONE.
  */
-public class RequestFocusTest extends ActivityInstrumentationTestCase<RequestFocus> {
+public class RequestFocusTest extends ActivityInstrumentationTestCase2<RequestFocus> {
 
     private Button mTopLeftButton;
     private Button mBottomLeftButton;
@@ -39,7 +45,7 @@
     private Handler mHandler;
 
     public RequestFocusTest() {
-        super("com.android.frameworks.coretests", RequestFocus.class);
+        super(RequestFocus.class);
     }
 
     @Override
@@ -90,8 +96,149 @@
             fail("requestFocus from wrong thread should raise exception.");
         } catch (AndroidRuntimeException e) {
             // Expected.  The actual exception is not public, so we can't catch it.
-            assertEquals("android.view.ViewAncestor$CalledFromWrongThreadException",
+            assertEquals("android.view.ViewRootImpl$CalledFromWrongThreadException",
                          e.getClass().getName());
         }
     }
+
+    /**
+     * This tests checks the case in which the first focusable View clears focus.
+     * In such a case the framework tries to give the focus to another View starting
+     * from the top. Hence, the framework will try to give focus to the view that
+     * wants to clear its focus. From a client perspective, the view does not loose
+     * focus after the call, therefore no callback for focus change should be invoked.
+     *
+     * @throws Exception If an error occurs.
+     */
+    @UiThreadTest
+    public void testOnFocusChangeNotCalledIfFocusDoesNotMove() throws Exception {
+        // Get the first focusable.
+        Button button = mTopLeftButton;
+
+        // Make sure that the button is the first focusable and focus it.
+        button.getRootView().requestFocus(View.FOCUS_DOWN);
+        assertTrue(button.hasFocus());
+
+        // Attach on focus change listener that should not be called.
+        button.setOnFocusChangeListener(new OnFocusChangeListener() {
+            @Override
+            public void onFocusChange(View v, boolean hasFocus) {
+                throw new IllegalStateException("Unexpeced call to"
+                        + "OnFocusChangeListener#onFocusChange");
+            }
+        });
+
+        // Attach on global focus change listener that should not be called.
+        button.getViewTreeObserver().addOnGlobalFocusChangeListener(
+                new OnGlobalFocusChangeListener() {
+            @Override
+            public void onGlobalFocusChanged(View oldFocus, View newFocus) {
+                throw new IllegalStateException("Unexpeced call to"
+                        + "OnFocusChangeListener#onFocusChange");
+            }
+        });
+
+        // Try to clear focus.
+        button.clearFocus();
+    }
+
+    /**
+     * This tests check whether the on focus change callbacks are invoked in
+     * the proper order when a View loses focus and the framework gives it to
+     * the fist focusable one.
+     *
+     * @throws Exception
+     */
+    @UiThreadTest
+    public void testOnFocusChangeCallbackOrder() throws Exception {
+        // Get the first focusable.
+        Button clearingFocusButton = mTopRightButton;
+        Button gainingFocusButton = mTopLeftButton;
+
+        // Make sure that the clearing focus is not the first focusable.
+        View focusCandidate = clearingFocusButton.getRootView().getParent().focusSearch(null,
+                View.FOCUS_FORWARD);
+        assertNotSame("The clearing focus button is not the first focusable.",
+                clearingFocusButton, focusCandidate);
+        assertSame("The gaining focus button is the first focusable.",
+                gainingFocusButton, focusCandidate);
+
+        // Focus the clearing focus button.
+        clearingFocusButton.requestFocus();
+        assertTrue(clearingFocusButton.hasFocus());
+
+        // Register the invocation order checker.
+        CallbackOrderChecker checker = new CallbackOrderChecker(clearingFocusButton,
+                gainingFocusButton);
+        clearingFocusButton.setOnFocusChangeListener(checker);
+        gainingFocusButton.setOnFocusChangeListener(checker);
+        clearingFocusButton.getViewTreeObserver().addOnGlobalFocusChangeListener(checker);
+
+        // Try to clear focus.
+        clearingFocusButton.clearFocus();
+
+        // Check that no callback was invoked since focus did not move.
+        checker.verify();
+    }
+
+    /**
+     * This class check whether the focus change callback are invoked in order.
+     */
+    private class CallbackOrderChecker implements OnFocusChangeListener,
+            OnGlobalFocusChangeListener {
+
+        private class CallbackInvocation {
+            final String mMethodName;
+            final Object[] mArguments;
+
+            CallbackInvocation(String methodName, Object[] arguments) {
+                mMethodName = methodName;
+                mArguments = arguments;
+            }
+        }
+
+        private final View mClearingFocusView;
+        private final View mGainingFocusView;
+
+        private final List<CallbackInvocation> mInvocations = new ArrayList<CallbackInvocation>();
+
+        public CallbackOrderChecker(View clearingFocusView, View gainingFocusView) {
+            mClearingFocusView = clearingFocusView;
+            mGainingFocusView = gainingFocusView;
+        }
+
+        @Override
+        public void onFocusChange(View view, boolean hasFocus) {
+            CallbackInvocation invocation = new CallbackInvocation(
+                    "OnFocusChangeListener#onFocusChange", new Object[] {view, hasFocus});
+            mInvocations.add(invocation);
+        }
+
+        @Override
+        public void onGlobalFocusChanged(View oldFocus, View newFocus) {
+            CallbackInvocation invocation = new CallbackInvocation(
+                    "OnFocusChangeListener#onFocusChange", new Object[] {oldFocus, newFocus});
+            mInvocations.add(invocation);
+        }
+
+        public void verify() {
+            assertSame("All focus change callback should be invoked.", 3, mInvocations.size());
+            assertInvioked("Callback for View clearing focus explected.", 0,
+                    "OnFocusChangeListener#onFocusChange",
+                    new Object[] {mClearingFocusView, false});
+            assertInvioked("Callback for View global focus change explected.", 1,
+                    "OnFocusChangeListener#onFocusChange", new Object[] {mClearingFocusView,
+                    mGainingFocusView});
+            assertInvioked("Callback for View gaining focus explected.", 2,
+                    "OnFocusChangeListener#onFocusChange", new Object[] {mGainingFocusView, true});
+        }
+
+        private void assertInvioked(String message, int order, String methodName,
+                Object[] arguments) {
+            CallbackInvocation invocation = mInvocations.get(order);
+            assertEquals(message, methodName, invocation.mMethodName);
+            assertEquals(message, arguments[0], invocation.mArguments[0]);
+            assertEquals(message, arguments[1], invocation.mArguments[1]);
+        }
+    }
 }
diff --git a/core/tests/coretests/src/android/widget/focus/ScrollingThroughListOfFocusablesTest.java b/core/tests/coretests/src/android/widget/focus/ScrollingThroughListOfFocusablesTest.java
index eb9192a..795e09c 100644
--- a/core/tests/coretests/src/android/widget/focus/ScrollingThroughListOfFocusablesTest.java
+++ b/core/tests/coretests/src/android/widget/focus/ScrollingThroughListOfFocusablesTest.java
@@ -20,10 +20,9 @@
 import android.test.InstrumentationTestCase;
 import android.test.suitebuilder.annotation.LargeTest;
 import android.test.suitebuilder.annotation.MediumTest;
+import android.util.InternalSelectionView;
 import android.view.KeyEvent;
 import android.widget.ListView;
-import android.widget.focus.ListOfInternalSelectionViews;
-import android.util.InternalSelectionView;
 
 
 /**
@@ -51,6 +50,10 @@
                     mNumRowsPerItem,      // 5 internally selectable rows per item
                     mScreenHeightFactor)); // each item is 5 / 4 screen height tall
         mListView = mActivity.getListView();
+        // Make sure we have some fading edge regardless of ListView style.
+        mListView.setVerticalFadingEdgeEnabled(true);
+        mListView.setFadingEdgeLength(10);
+        ensureNotInTouchMode();
     }
 
     @Override
@@ -67,12 +70,12 @@
         assertEquals(mNumRowsPerItem, mActivity.getNumRowsPerItem());
     }
 
-    // TODO: needs to be adjusted to pass on non-HVGA displays
-    // @MediumTest
+    @MediumTest
     public void testScrollingDownInFirstItem() throws Exception {
 
         for (int i = 0; i < mNumRowsPerItem; i++) {
             assertEquals(0, mListView.getSelectedItemPosition());
+            
             InternalSelectionView view = mActivity.getSelectedView();
 
             assertInternallySelectedRowOnScreen(view, i);
@@ -90,13 +93,12 @@
                     mListView.getSelectedView();
 
             // 1 pixel tolerance in case height / 4 is not an even number
-            final int fadingEdge = mListView.getBottom() - mListView.getVerticalFadingEdgeLength();
+            final int bottomFadingEdgeTop =
+                mListView.getBottom() - mListView.getVerticalFadingEdgeLength();
             assertTrue("bottom of view should be just above fading edge",
-                    view.getBottom() >= fadingEdge - 1 &&
-                    view.getBottom() <= fadingEdge);
+                    view.getBottom() == bottomFadingEdgeTop);
         }
 
-
         // make sure fading edge is the expected view
         {
             assertEquals("should be a second view visible due to the fading edge",
@@ -109,7 +111,6 @@
         }
     }
 
-
     @MediumTest
     public void testScrollingToSecondItem() throws Exception {
 
@@ -223,4 +224,12 @@
         assertTrue("bottom of row " + row + " should be on sreen",
                 mTempRect.bottom < mActivity.getScreenHeight());
     }
+
+    private void ensureNotInTouchMode() {
+        // If in touch mode inject a DPAD down event to exit that mode.
+        if (mListView.isInTouchMode()) {
+            sendKeys(KeyEvent.KEYCODE_DPAD_DOWN);
+            getInstrumentation().waitForIdleSync();
+        }
+    }
 }
diff --git a/core/tests/coretests/src/com/android/internal/util/FileRotatorTest.java b/core/tests/coretests/src/com/android/internal/util/FileRotatorTest.java
new file mode 100644
index 0000000..94d1cb6
--- /dev/null
+++ b/core/tests/coretests/src/com/android/internal/util/FileRotatorTest.java
@@ -0,0 +1,428 @@
+/*
+ * 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.util;
+
+import static android.text.format.DateUtils.DAY_IN_MILLIS;
+import static android.text.format.DateUtils.HOUR_IN_MILLIS;
+import static android.text.format.DateUtils.MINUTE_IN_MILLIS;
+import static android.text.format.DateUtils.SECOND_IN_MILLIS;
+import static android.text.format.DateUtils.WEEK_IN_MILLIS;
+import static android.text.format.DateUtils.YEAR_IN_MILLIS;
+
+import android.test.AndroidTestCase;
+import android.test.suitebuilder.annotation.Suppress;
+import android.util.Log;
+
+import com.android.internal.util.FileRotator.Reader;
+import com.android.internal.util.FileRotator.Writer;
+import com.google.android.collect.Lists;
+
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.ProtocolException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Random;
+
+import libcore.io.IoUtils;
+
+/**
+ * Tests for {@link FileRotator}.
+ */
+public class FileRotatorTest extends AndroidTestCase {
+    private static final String TAG = "FileRotatorTest";
+
+    private File mBasePath;
+
+    private static final String PREFIX = "rotator";
+    private static final String ANOTHER_PREFIX = "another_rotator";
+
+    private static final long TEST_TIME = 1300000000000L;
+
+    // TODO: test throwing rolls back correctly
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        mBasePath = getContext().getFilesDir();
+        IoUtils.deleteContents(mBasePath);
+    }
+
+    public void testEmpty() throws Exception {
+        final FileRotator rotate1 = new FileRotator(
+                mBasePath, PREFIX, DAY_IN_MILLIS, WEEK_IN_MILLIS);
+        final FileRotator rotate2 = new FileRotator(
+                mBasePath, ANOTHER_PREFIX, DAY_IN_MILLIS, WEEK_IN_MILLIS);
+
+        final RecordingReader reader = new RecordingReader();
+        long currentTime = TEST_TIME;
+
+        // write single new value
+        rotate1.combineActive(reader, writer("foo"), currentTime);
+        reader.assertRead();
+
+        // assert that one rotator doesn't leak into another
+        assertReadAll(rotate1, "foo");
+        assertReadAll(rotate2);
+    }
+
+    public void testCombine() throws Exception {
+        final FileRotator rotate = new FileRotator(
+                mBasePath, PREFIX, DAY_IN_MILLIS, WEEK_IN_MILLIS);
+
+        final RecordingReader reader = new RecordingReader();
+        long currentTime = TEST_TIME;
+
+        // first combine should have empty read, but still write data.
+        rotate.combineActive(reader, writer("foo"), currentTime);
+        reader.assertRead();
+        assertReadAll(rotate, "foo");
+
+        // second combine should replace contents; should read existing data,
+        // and write final data to disk.
+        currentTime += SECOND_IN_MILLIS;
+        reader.reset();
+        rotate.combineActive(reader, writer("bar"), currentTime);
+        reader.assertRead("foo");
+        assertReadAll(rotate, "bar");
+    }
+
+    public void testRotate() throws Exception {
+        final FileRotator rotate = new FileRotator(
+                mBasePath, PREFIX, DAY_IN_MILLIS, WEEK_IN_MILLIS);
+
+        final RecordingReader reader = new RecordingReader();
+        long currentTime = TEST_TIME;
+
+        // combine first record into file
+        rotate.combineActive(reader, writer("foo"), currentTime);
+        reader.assertRead();
+        assertReadAll(rotate, "foo");
+
+        // push time a few minutes forward; shouldn't rotate file
+        reader.reset();
+        currentTime += MINUTE_IN_MILLIS;
+        rotate.combineActive(reader, writer("bar"), currentTime);
+        reader.assertRead("foo");
+        assertReadAll(rotate, "bar");
+
+        // push time forward enough to rotate file; should still have same data
+        currentTime += DAY_IN_MILLIS + SECOND_IN_MILLIS;
+        rotate.maybeRotate(currentTime);
+        assertReadAll(rotate, "bar");
+
+        // combine a second time, should leave rotated value untouched, and
+        // active file should be empty.
+        reader.reset();
+        rotate.combineActive(reader, writer("baz"), currentTime);
+        reader.assertRead();
+        assertReadAll(rotate, "bar", "baz");
+    }
+
+    public void testDelete() throws Exception {
+        final FileRotator rotate = new FileRotator(
+                mBasePath, PREFIX, MINUTE_IN_MILLIS, DAY_IN_MILLIS);
+
+        final RecordingReader reader = new RecordingReader();
+        long currentTime = TEST_TIME;
+
+        // create first record and trigger rotating it
+        rotate.combineActive(reader, writer("foo"), currentTime);
+        reader.assertRead();
+        currentTime += MINUTE_IN_MILLIS + SECOND_IN_MILLIS;
+        rotate.maybeRotate(currentTime);
+
+        // create second record
+        reader.reset();
+        rotate.combineActive(reader, writer("bar"), currentTime);
+        reader.assertRead();
+        assertReadAll(rotate, "foo", "bar");
+
+        // push time far enough to expire first record
+        currentTime = TEST_TIME + DAY_IN_MILLIS + (2 * MINUTE_IN_MILLIS);
+        rotate.maybeRotate(currentTime);
+        assertReadAll(rotate, "bar");
+
+        // push further to delete second record
+        currentTime += WEEK_IN_MILLIS;
+        rotate.maybeRotate(currentTime);
+        assertReadAll(rotate);
+    }
+
+    public void testThrowRestoresBackup() throws Exception {
+        final FileRotator rotate = new FileRotator(
+                mBasePath, PREFIX, MINUTE_IN_MILLIS, DAY_IN_MILLIS);
+
+        final RecordingReader reader = new RecordingReader();
+        long currentTime = TEST_TIME;
+
+        // first, write some valid data
+        rotate.combineActive(reader, writer("foo"), currentTime);
+        reader.assertRead();
+        assertReadAll(rotate, "foo");
+
+        try {
+            // now, try writing which will throw
+            reader.reset();
+            rotate.combineActive(reader, new Writer() {
+                public void write(OutputStream out) throws IOException {
+                    new DataOutputStream(out).writeUTF("bar");
+                    throw new ProtocolException("yikes");
+                }
+            }, currentTime);
+
+            fail("woah, somehow able to write exception");
+        } catch (ProtocolException e) {
+            // expected from above
+        }
+
+        // assert that we read original data, and that it's still intact after
+        // the failed write above.
+        reader.assertRead("foo");
+        assertReadAll(rotate, "foo");
+    }
+
+    public void testOtherFilesAndMalformed() throws Exception {
+        final FileRotator rotate = new FileRotator(
+                mBasePath, PREFIX, SECOND_IN_MILLIS, SECOND_IN_MILLIS);
+
+        // should ignore another prefix
+        touch("another_rotator.1024");
+        touch("another_rotator.1024-2048");
+        assertReadAll(rotate);
+
+        // verify that broken filenames don't crash
+        touch("rotator");
+        touch("rotator...");
+        touch("rotator.-");
+        touch("rotator.---");
+        touch("rotator.a-b");
+        touch("rotator_but_not_actually");
+        assertReadAll(rotate);
+
+        // and make sure that we can read something from a legit file
+        write("rotator.100-200", "meow");
+        assertReadAll(rotate, "meow");
+    }
+
+    private static final String RED = "red";
+    private static final String GREEN = "green";
+    private static final String BLUE = "blue";
+    private static final String YELLOW = "yellow";
+
+    public void testQueryMatch() throws Exception {
+        final FileRotator rotate = new FileRotator(
+                mBasePath, PREFIX, HOUR_IN_MILLIS, YEAR_IN_MILLIS);
+
+        final RecordingReader reader = new RecordingReader();
+        long currentTime = TEST_TIME;
+
+        // rotate a bunch of historical data
+        rotate.maybeRotate(currentTime);
+        rotate.combineActive(reader, writer(RED), currentTime);
+
+        currentTime += DAY_IN_MILLIS;
+        rotate.maybeRotate(currentTime);
+        rotate.combineActive(reader, writer(GREEN), currentTime);
+
+        currentTime += DAY_IN_MILLIS;
+        rotate.maybeRotate(currentTime);
+        rotate.combineActive(reader, writer(BLUE), currentTime);
+
+        currentTime += DAY_IN_MILLIS;
+        rotate.maybeRotate(currentTime);
+        rotate.combineActive(reader, writer(YELLOW), currentTime);
+
+        final String[] FULL_SET = { RED, GREEN, BLUE, YELLOW };
+
+        assertReadAll(rotate, FULL_SET);
+        assertReadMatching(rotate, Long.MIN_VALUE, Long.MAX_VALUE, FULL_SET);
+        assertReadMatching(rotate, Long.MIN_VALUE, currentTime, FULL_SET);
+        assertReadMatching(rotate, TEST_TIME + SECOND_IN_MILLIS, currentTime, FULL_SET);
+
+        // should omit last value, since it only touches at currentTime
+        assertReadMatching(rotate, TEST_TIME + SECOND_IN_MILLIS, currentTime - SECOND_IN_MILLIS,
+                RED, GREEN, BLUE);
+
+        // check boundary condition
+        assertReadMatching(rotate, TEST_TIME + DAY_IN_MILLIS, Long.MAX_VALUE, FULL_SET);
+        assertReadMatching(rotate, TEST_TIME + DAY_IN_MILLIS + SECOND_IN_MILLIS, Long.MAX_VALUE,
+                GREEN, BLUE, YELLOW);
+
+        // test range smaller than file
+        final long blueStart = TEST_TIME + (DAY_IN_MILLIS * 2);
+        final long blueEnd = TEST_TIME + (DAY_IN_MILLIS * 3);
+        assertReadMatching(rotate, blueStart + SECOND_IN_MILLIS, blueEnd - SECOND_IN_MILLIS, BLUE);
+
+        // outside range should return nothing
+        assertReadMatching(rotate, Long.MIN_VALUE, TEST_TIME - DAY_IN_MILLIS);
+    }
+
+    public void testClockRollingBackwards() throws Exception {
+        final FileRotator rotate = new FileRotator(
+                mBasePath, PREFIX, DAY_IN_MILLIS, YEAR_IN_MILLIS);
+
+        final RecordingReader reader = new RecordingReader();
+        long currentTime = TEST_TIME;
+
+        // create record at current time
+        // --> foo
+        rotate.combineActive(reader, writer("foo"), currentTime);
+        reader.assertRead();
+        assertReadAll(rotate, "foo");
+
+        // record a day in past; should create a new active file
+        // --> bar
+        currentTime -= DAY_IN_MILLIS;
+        reader.reset();
+        rotate.combineActive(reader, writer("bar"), currentTime);
+        reader.assertRead();
+        assertReadAll(rotate, "bar", "foo");
+
+        // verify that we rewrite current active file
+        // bar --> baz
+        currentTime += SECOND_IN_MILLIS;
+        reader.reset();
+        rotate.combineActive(reader, writer("baz"), currentTime);
+        reader.assertRead("bar");
+        assertReadAll(rotate, "baz", "foo");
+
+        // return to present and verify we write oldest active file
+        // baz --> meow
+        currentTime = TEST_TIME + SECOND_IN_MILLIS;
+        reader.reset();
+        rotate.combineActive(reader, writer("meow"), currentTime);
+        reader.assertRead("baz");
+        assertReadAll(rotate, "meow", "foo");
+
+        // current time should trigger rotate of older active file
+        rotate.maybeRotate(currentTime);
+
+        // write active file, verify this time we touch original
+        // foo --> yay
+        reader.reset();
+        rotate.combineActive(reader, writer("yay"), currentTime);
+        reader.assertRead("foo");
+        assertReadAll(rotate, "meow", "yay");
+    }
+
+    @Suppress
+    public void testFuzz() throws Exception {
+        final FileRotator rotate = new FileRotator(
+                mBasePath, PREFIX, HOUR_IN_MILLIS, DAY_IN_MILLIS);
+
+        final RecordingReader reader = new RecordingReader();
+        long currentTime = TEST_TIME;
+
+        // walk forward through time, ensuring that files are cleaned properly
+        final Random random = new Random();
+        for (int i = 0; i < 1024; i++) {
+            currentTime += Math.abs(random.nextLong()) % DAY_IN_MILLIS;
+
+            reader.reset();
+            rotate.combineActive(reader, writer("meow"), currentTime);
+
+            if (random.nextBoolean()) {
+                rotate.maybeRotate(currentTime);
+            }
+        }
+
+        rotate.maybeRotate(currentTime);
+
+        Log.d(TAG, "currentTime=" + currentTime);
+        Log.d(TAG, Arrays.toString(mBasePath.list()));
+    }
+
+    public void testRecoverAtomic() throws Exception {
+        write("rotator.1024-2048", "foo");
+        write("rotator.1024-2048.backup", "bar");
+        write("rotator.2048-4096", "baz");
+        write("rotator.2048-4096.no_backup", "");
+
+        final FileRotator rotate = new FileRotator(
+                mBasePath, PREFIX, SECOND_IN_MILLIS, SECOND_IN_MILLIS);
+
+        // verify backup value was recovered; no_backup indicates that
+        // corresponding file had no backup and should be discarded.
+        assertReadAll(rotate, "bar");
+    }
+
+    private void touch(String... names) throws IOException {
+        for (String name : names) {
+            final OutputStream out = new FileOutputStream(new File(mBasePath, name));
+            out.close();
+        }
+    }
+
+    private void write(String name, String value) throws IOException {
+        final DataOutputStream out = new DataOutputStream(
+                new FileOutputStream(new File(mBasePath, name)));
+        out.writeUTF(value);
+        out.close();
+    }
+
+    private static Writer writer(final String value) {
+        return new Writer() {
+            public void write(OutputStream out) throws IOException {
+                new DataOutputStream(out).writeUTF(value);
+            }
+        };
+    }
+
+    private static void assertReadAll(FileRotator rotate, String... expected) throws IOException {
+        assertReadMatching(rotate, Long.MIN_VALUE, Long.MAX_VALUE, expected);
+    }
+
+    private static void assertReadMatching(
+            FileRotator rotate, long matchStartMillis, long matchEndMillis, String... expected)
+            throws IOException {
+        final RecordingReader reader = new RecordingReader();
+        rotate.readMatching(reader, matchStartMillis, matchEndMillis);
+        reader.assertRead(expected);
+    }
+
+    private static class RecordingReader implements Reader {
+        private ArrayList<String> mActual = Lists.newArrayList();
+
+        public void read(InputStream in) throws IOException {
+            mActual.add(new DataInputStream(in).readUTF());
+        }
+
+        public void reset() {
+            mActual.clear();
+        }
+
+        public void assertRead(String... expected) {
+            assertEquals(expected.length, mActual.size());
+
+            final ArrayList<String> actualCopy = new ArrayList<String>(mActual);
+            for (String value : expected) {
+                if (!actualCopy.remove(value)) {
+                    final String expectedString = Arrays.toString(expected);
+                    final String actualString = Arrays.toString(mActual.toArray());
+                    fail("expected: " + expectedString + " but was: " + actualString);
+                }
+            }
+        }
+    }
+}
diff --git a/data/fonts/DroidSansArabic.ttf b/data/fonts/DroidSansArabic.ttf
new file mode 100644
index 0000000..bdefaac
--- /dev/null
+++ b/data/fonts/DroidSansArabic.ttf
Binary files differ
diff --git a/data/fonts/DroidSansFallback.ttf b/data/fonts/DroidSansFallback.ttf
index 391755e..2379b2d 100644
--- a/data/fonts/DroidSansFallback.ttf
+++ b/data/fonts/DroidSansFallback.ttf
Binary files differ
diff --git a/data/fonts/DroidSansFallbackFull.ttf b/data/fonts/DroidSansFallbackFull.ttf
index 8bd5e63..41b015d 100644
--- a/data/fonts/DroidSansFallbackFull.ttf
+++ b/data/fonts/DroidSansFallbackFull.ttf
Binary files differ
diff --git a/data/fonts/Roboto-Bold.ttf b/data/fonts/Roboto-Bold.ttf
index 6d32fba..40ecd14 100644
--- a/data/fonts/Roboto-Bold.ttf
+++ b/data/fonts/Roboto-Bold.ttf
Binary files differ
diff --git a/data/fonts/Roboto-BoldItalic.ttf b/data/fonts/Roboto-BoldItalic.ttf
index fc2da4c..d9067c5 100644
--- a/data/fonts/Roboto-BoldItalic.ttf
+++ b/data/fonts/Roboto-BoldItalic.ttf
Binary files differ
diff --git a/data/fonts/Roboto-Italic.ttf b/data/fonts/Roboto-Italic.ttf
index ce2e072..88e4a5b 100644
--- a/data/fonts/Roboto-Italic.ttf
+++ b/data/fonts/Roboto-Italic.ttf
Binary files differ
diff --git a/data/fonts/Roboto-Regular.ttf b/data/fonts/Roboto-Regular.ttf
index 465dfc1..f592adf 100644
--- a/data/fonts/Roboto-Regular.ttf
+++ b/data/fonts/Roboto-Regular.ttf
Binary files differ
diff --git a/data/fonts/fallback_fonts.xml b/data/fonts/fallback_fonts.xml
index 47cdae7..51b07e4 100644
--- a/data/fonts/fallback_fonts.xml
+++ b/data/fonts/fallback_fonts.xml
@@ -25,7 +25,7 @@
 <familyset>
     <family>
         <fileset>
-            <file>DroidNaskh-Regular.ttf</file>
+            <file>DroidSansArabic.ttf</file>
         </fileset>
     </family>
     <family>
diff --git a/data/fonts/fonts.mk b/data/fonts/fonts.mk
index 9dca329..6a9ed53 100644
--- a/data/fonts/fonts.mk
+++ b/data/fonts/fonts.mk
@@ -21,6 +21,7 @@
     frameworks/base/data/fonts/Roboto-Bold.ttf:system/fonts/Roboto-Bold.ttf \
     frameworks/base/data/fonts/Roboto-Italic.ttf:system/fonts/Roboto-Italic.ttf \
     frameworks/base/data/fonts/Roboto-BoldItalic.ttf:system/fonts/Roboto-BoldItalic.ttf \
+    frameworks/base/data/fonts/DroidSansArabic.ttf:system/fonts/DroidSansArabic.ttf \
     frameworks/base/data/fonts/DroidNaskh-Regular.ttf:system/fonts/DroidNaskh-Regular.ttf \
     frameworks/base/data/fonts/DroidSansHebrew-Regular.ttf:system/fonts/DroidSansHebrew-Regular.ttf \
     frameworks/base/data/fonts/DroidSansHebrew-Bold.ttf:system/fonts/DroidSansHebrew-Bold.ttf \
diff --git a/docs/html/design/building-blocks/buttons.html b/docs/html/design/building-blocks/buttons.html
new file mode 100644
index 0000000..cc43fcb
--- /dev/null
+++ b/docs/html/design/building-blocks/buttons.html
@@ -0,0 +1,191 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Buttons
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Buttons</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<p>A button consists of text and/or an image that clearly communicates what action will occur when the
+user touches it. Android supports two different types of buttons: <em>basic buttons</em> and <em>borderless
+buttons</em>. Both can contain text labels and/or images.</p>
+
+<div style="text-align: center">
+  <img src="../static/content/buttons_basic.png">
+</div>
+
+<h2>Basic Buttons</h2>
+<p>Basic buttons are traditional buttons with borders and background. Android supports two styles for
+basic buttons: default and small. Default buttons have slightly larger font size and are optimized
+for display outside of form content. Small buttons are intended for display alongside other content.
+They have a smaller font and smaller minimum height. Use small buttons in forms where they need to
+align with other UI elements.</p>
+
+<img src="../static/content/buttons_default_small.png">
+<div class="layout-content-row">
+  <div class="layout-content-col span-6">
+    <div class="figure-caption">
+      Default buttons in Holo Dark &amp; Light.
+    </div>
+  </div>
+  <div class="layout-content-col span-6">
+    <div class="figure-caption">
+      Small buttons in Holo Dark &amp; Light.
+    </div>
+  </div>
+</div>
+
+<h2>Borderless Buttons</h2>
+<p>Borderless buttons resemble basic buttons except that they have no borders or background. You can
+use borderless buttons with both icons and text. Borderless buttons are visually more lightweight
+than basic buttons and integrate nicely with other content.</p>
+
+<img src="../static/content/buttons_borderless.png">
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/building-blocks/dialogs.html b/docs/html/design/building-blocks/dialogs.html
new file mode 100644
index 0000000..fc00780
--- /dev/null
+++ b/docs/html/design/building-blocks/dialogs.html
@@ -0,0 +1,265 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Dialogs
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Dialogs</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<p>Dialogs prompt the user for decisions or additional information required by the app to continue a
+task. Such requests can range from simple Cancel/OK decisions to more complex layouts asking the
+user to adjust settings or enter text.</p>
+
+<img src="../static/content/dialogs_main.png">
+
+<div class="with-callouts">
+
+<ol>
+<li>
+<h4>Optional title region</h4>
+<p>The title introduces the content of your dialog. It can, for example, identify the name of a
+ setting that the user is about to change, or request a decision.</p>
+</li>
+<li>
+<h4>Content area</h4>
+<p>Dialog content varies widely. For settings dialogs, a dialog may contain UI elements such as
+ sliders, text fields, checkboxes, or radio buttons that allow the user to change app or system
+ settings. In other cases, such as alerts, the content may consist solely of text that provides
+ further context for a user decision.</p>
+</li>
+<li>
+<h4>Action buttons</h4>
+<p>Action buttons are typically Cancel and/or OK, with OK indicating the preferred or most likely
+ action. However, if the options consist of specific actions such as Close or Wait rather than
+ a confirmation or cancellation of the action described in the content, then all the buttons
+ should be active verbs. As a rule, the dismissive action of a dialog is always on the left
+ whereas the affirmative actions are on the right.</p>
+</li>
+</ol>
+
+</div>
+
+<img src="../static/content/dialogs_examples.png">
+<div class="figure-caption">
+  Samples of typical dialog use in Android.
+</div>
+
+<h2 id="alerts">Alerts</h2>
+
+<p>Alerts inform the user about a situation that requires their confirmation or acknowledgement before
+proceeding. They differ slightly in appearance based upon the severity and impact of the message
+conveyed.</p>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-8">
+
+    <img src="../static/content/dialogs_w_no_title.png">
+
+  </div>
+  <div class="layout-content-col span-5">
+
+<h4>Alerts without title bars</h4>
+<p>Most alerts don't need titles. Usually the decision doesn't have a severe impact and can be summed
+up succinctly in a sentence or two. The content area should either ask a question (such as "Delete
+this conversation?") or make a clear statement whose relationship to the action buttons is obvious.</p>
+
+  </div>
+</div>
+
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-8">
+
+    <img src="../static/content/dialogs_w_title.png">
+
+  </div>
+  <div class="layout-content-col span-5">
+
+<h4>Alerts with title bars</h4>
+<p>Use alerts with title bars sparingly. They are appropriate only when a high-risk operation involving
+potential loss of data, connectivity, extra charges, and so on requires a clear question or
+statement (the title) and some additional explanation (in the content area).</p>
+<p>Keep the question or statement short: for example, "Erase USB storage?" Avoid apologies. A user
+should be able to skip the content completely and still have a clear idea of what choices are
+available based on the title and the text of the action buttons.</p>
+
+  </div>
+</div>
+
+
+<h2 id="popups">Popups</h2>
+
+<p>Popups are lightweight version of dialogs that require a single selection from the user. Popups
+don't have have explicit buttons that accept or cancel the operation. Instead, making a selection
+advances the workflow, and simply touching outside the popup dismisses it.</p>
+
+<img src="../static/content/dialogs_popups_example.png">
+
+
+<h2 id="toasts">Toasts</h2>
+
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6">
+
+    <div class="vspace size-6"></div>
+
+<p>Toasts provide lightweight feedback about an operation in a small popup. For example, navigating
+away from an email before you send it triggers a "Draft saved" toast to let you know that you can
+continue editing later. Toasts automatically disappear after a timeout.</p>
+
+  </div>
+  <div class="layout-content-col span-7">
+
+    <img src="../static/content/dialogs_toasts.png">
+
+  </div>
+</div>
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/building-blocks/grid-lists.html b/docs/html/design/building-blocks/grid-lists.html
new file mode 100644
index 0000000..b4cfdcb
--- /dev/null
+++ b/docs/html/design/building-blocks/grid-lists.html
@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Grid Lists
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Grid Lists</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<img src="../static/content/gridview_overview.png">
+
+<p>Grid lists are an alternative to standard list views. They are best suited for showing data sets
+that represent themselves through images. In contrast to simple lists, grid lists may scroll either
+vertically or horizontally.</p>
+
+
+
+<h2 id="generic_grid">Generic Grids</h2>
+
+
+<p>The items in a grid list are arranged in two dimensions, one of which is fixed when scrolling
+content. The scrolling direction dictates the ordering of the items within the grid list. Since the
+scrolling direction is not deterministic, make it easy for the user to determine the orientation by
+cutting off grid items to communicate where the overflow is located.</p>
+<p>Avoid creating grid lists that scroll in two dimensions.</p>
+
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+    <img src="../static/content/gridview_vertical.png">
+
+  </div>
+  <div class="layout-content-col span-6">
+
+<h4>Vertical scrolling</h4>
+<p>Vertically scrolling grid list items are sorted in traditional western reading direction:
+left-to-right and top-down. When displaying the list, cut off the items in the bottom row to
+communicate that the user can scroll the list down to show additional items. Be sure to retain this
+scheme when the user rotates the screen.</p>
+
+  </div>
+</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+    <img src="../static/content/gridview_horizontal.png">
+
+  </div>
+  <div class="layout-content-col span-6">
+
+<h4>Horizontal scrolling</h4>
+<p>Horizontally scrolling lists fix the vertical axis of the item grid. Compared to vertically
+scrolling lists, the sorting changes slightly to a top-down and left-to-right arrangement. Employ
+the same technique of cutting off the items in the rightmost column to indicate the scrolling
+direction.</p>
+<p>Don't use scrolling tabs as a means to switch views in conjunction with horizontally scrolling grid
+lists, because the horizontal gesture for view and content navigation will conflict. If you show
+scrolling tabs for view navigation together with a grid list, use vertical grid scrolling for list
+navigation.</p>
+
+  </div>
+</div>
+
+
+<h2 id="with_labels">Grid List with Labels</h2>
+
+<p>Use labels to display additional contextual information for your grid list items.</p>
+
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+    <img src="../static/content/gridview_style.png">
+
+  </div>
+  <div class="layout-content-col span-6">
+
+<h4>Style</h4>
+<p>Use semi-transparent panels on top of the grid list items to display your labels. This allows you to
+control the contrast and ensures legibility of the labels while letting the content "shine through".</p>
+
+  </div>
+</div>
+
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/building-blocks/index.html b/docs/html/design/building-blocks/index.html
new file mode 100644
index 0000000..c99d85c
--- /dev/null
+++ b/docs/html/design/building-blocks/index.html
@@ -0,0 +1,171 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Building Blocks
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+<style>
+#landing-graphic-container {
+  position: relative;
+}
+
+#text-overlay {
+  position: absolute;
+  left: 10px;
+  top: 472px;
+  width: 450px;
+}
+</style>
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+<div class="layout-content-row content-header just-links">
+  <div class="layout-content-col span-9">&nbsp;</div>
+  <div class="paging-links layout-content-col span-4">
+    <a href="#" class="prev-page-link">Previous</a>
+    <a href="#" class="next-page-link">Next</a>
+  </div>
+</div>
+
+
+          
+
+<div id="landing-graphic-container">
+  <div id="text-overlay">
+    Your inventory of ready-to-use elements for creating outstanding apps.
+    <br><br>
+    <a href="../building-blocks/tabs.html" class="landing-page-link">Tabs</a>
+  </div>
+
+  <a href="../building-blocks/tabs.html">
+    <img src="../static/content/building_blocks_landing.png">
+  </a>
+</div>
+
+
+
+          
+
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/building-blocks/lists.html b/docs/html/design/building-blocks/lists.html
new file mode 100644
index 0000000..914ae9e
--- /dev/null
+++ b/docs/html/design/building-blocks/lists.html
@@ -0,0 +1,184 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Lists
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Lists</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<p>Lists present multiple line items in a vertical arrangement. They can be used for data selection as
+well as drilldown navigation.</p>
+
+<div class="vspace size-1">&nbsp;</div>
+
+<div class="layout-content-row clearfix">
+  <div class="layout-content-col span-9">
+
+    <img src="../static/content/lists_main.png">
+
+  </div>
+  <div class="layout-content-col span-4 with-callouts">
+
+<ol>
+<li>
+<h4>Section Divider</h4>
+<p>Use section dividers to organize the content of your list into groups and facilitate scanning.</p>
+</li>
+<li>
+<h4>Line Items</h4>
+<p>List items can accommodate a wide range of data types in different arrangements, including
+ simple single-line items, multi-line items, and custom items with icons, checkboxes, and action
+ buttons.</p>
+</li>
+</ol>
+
+  </div>
+</div>
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/building-blocks/pickers.html b/docs/html/design/building-blocks/pickers.html
new file mode 100644
index 0000000..4c95a9f
--- /dev/null
+++ b/docs/html/design/building-blocks/pickers.html
@@ -0,0 +1,187 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Pickers
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Pickers</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<p>Pickers provide a simple way to select a single value from a set. In addition to touching the
+up/down arrow buttons, it's possible to set the desired value from the keyboard or via a swipe
+gesture.</p>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-2">&nbsp;</div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/picker_space.png">
+
+  </div>
+  <div class="layout-content-col span-5">
+
+<h4>Space considerations</h4>
+<p>Pickers can be used inline on a form, but their relatively large footprint is best suited for
+display in a dialog. For inline display, consider using more compact controls such as text fields or
+spinners.</p>
+
+  </div>
+</div>
+
+<h2>Date and time pickers</h2>
+
+<p>Android provides these as ready-to-use dialogs. Each picker is a dialog with a set of controls for
+entering the parts of the date (month, day, year) or time (hour, minute, AM/PM). Using these in your
+app helps ensure that a user's specification of a data or time input is valid and formatted
+correctly. The format of a time and date picker adjusts automatically to the locale.</p>
+
+<img src="../static/content/picker_datetime.png">
+
+
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/building-blocks/progress.html b/docs/html/design/building-blocks/progress.html
new file mode 100644
index 0000000..7aae913
--- /dev/null
+++ b/docs/html/design/building-blocks/progress.html
@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Progress and Activity
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+
+
+          
+
+<div class="layout-content-row content-header">
+  <div class="layout-content-col span-9">
+    <h2 id="system">Feedback</h2>
+  </div>
+  <div class="paging-links layout-content-col span-4">
+    <a href="#" class="prev-page-link">Previous</a>
+    <a href="#" class="next-page-link">Next</a>
+  </div>
+</div>
+
+<p>When an operation of interest to the user is taking place over a relatively long period of time,
+provide visual feedback that it's still happening and in the process of being completed.</p>
+<h2>Progress</h2>
+<p>If you know the percentage of the operation that has been completed, use a determinate progress bar
+to give the user a sense of how much longer it will take.</p>
+
+<img src="../static/content/progress_download.png">
+
+<p>The progress bar should always travel from 0% to 100% completion. Avoid setting the bar to a lower
+value than a previous value, or using the same progress bar to represent the progress of multiple
+events, since doing so makes the display meaningless. If you're not sure how long a particular
+operation will take, use an indeterminate progress indicator.</p>
+
+<div class="vspace size-2">&nbsp;</div>
+
+<img src="../static/content/progress_themes.png">
+<div class="figure-caption">
+  Progress bar in Holo Dark and Holo Light.
+</div>
+
+<h2 id="activity">Activity</h2>
+
+<p>If you don't know how much longer an operation will continue, use an indeterminate progress
+indicator. There are two styles available: a flat bar and a circle. Use the one that best fits the
+available space.</p>
+
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/progress_activity.png">
+
+  </div>
+  <div class="layout-content-col span-7 with-callouts">
+
+    <ol>
+      <li class="value-1"><h4>Activity bar (shown with the Holo Dark theme)</h4>
+        <p>
+
+An indeterminate activity bar is used at the start of an application download because Market hasn't
+been able to contact the server yet, and it's not possible to determine how long it will take for
+the download to begin.
+
+        </p>
+      </li>
+    </ol>
+
+  </div>
+</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/progress_activity2.png">
+
+  </div>
+  <div class="layout-content-col span-7 with-callouts">
+
+    <ol>
+      <li class="value-2"><h4>Activity circle (shown with the Holo Light theme)</h4>
+        <p>
+
+An indeterminate activity circle is used in the Gmail application when a message is being
+loaded because it's not possible to determine how long it will take to download the email.
+
+        </p>
+      </li>
+    </ol>
+
+  </div>
+</div>
+
+<p>You should only use one activity indicator on screen per activity, and it should appropriately sized
+for the surrounding context. For example, the largest activity circle works well when displayed in a
+blank content area, but not in a smaller dialog box.</p>
+
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/building-blocks/scrolling.html b/docs/html/design/building-blocks/scrolling.html
new file mode 100644
index 0000000..3f1167c
--- /dev/null
+++ b/docs/html/design/building-blocks/scrolling.html
@@ -0,0 +1,188 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Scrolling
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Scrolling</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<p>Scrolling allows the user to navigate to content in the overflow using a swipe gesture. The
+scrolling speed is proportional to the speed of the gesture.</p>
+<h2>Scroll Indicator</h2>
+<p>Appears during scrolling to indicate what portion of the content is currently in view.</p>
+
+<div class="framed-galaxynexus-land-span-13">
+  <video class="play-on-hover" autoplay>
+    <source src="../static/content/scroll_indicator.mp4" type="video/mp4">
+    <source src="../static/content/scroll_indicator.webm" type="video/webm">
+    <source src="../static/content/scroll_indicator.ogv" type="video/ogg">
+  </video>
+</div>
+<div class="figure-caption">
+  <div class="video-instructions">&nbsp;</div>
+</div>
+
+<h2>Index Scrolling</h2>
+<p>In addition to traditional scrolling, a long alphabetical list can also offer index scrolling: a way
+to quickly navigate to the items that begin with a particular letter. With index scrolling, a scroll
+indicator appears even when the user isn't scrolling. Touching or dragging it causes the current
+letter to pop up in a prominent way.</p>
+
+<div class="framed-galaxynexus-land-span-13">
+  <video class="play-on-hover" autoplay>
+    <source src="../static/content/scroll_index.mp4" type="video/mp4">
+    <source src="../static/content/scroll_index.webm" type="video/webm">
+    <source src="../static/content/scroll_index.ogv" type="video/ogg">
+  </video>
+</div>
+<div class="figure-caption">
+  <div class="video-instructions">&nbsp;</div>
+</div>
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/building-blocks/seek-bars.html b/docs/html/design/building-blocks/seek-bars.html
new file mode 100644
index 0000000..84cf5d2
--- /dev/null
+++ b/docs/html/design/building-blocks/seek-bars.html
@@ -0,0 +1,190 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Seek Bars and Sliders
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Seek Bars and Sliders</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<p>Interactive sliders make it possible to select a value from a continuous or discrete range of values
+by moving the slider thumb. The smallest value is to the left, the largest to the right. The
+interactive nature of the slider makes it a great choice for settings that reflect intensity levels,
+such as volume, brightness, or color saturation.</p>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-9">
+
+    <img src="../static/content/seekbar_example.png">
+
+  </div>
+  <div class="layout-content-col span-4">
+
+<div class="vspace size-2">&nbsp;</div>
+
+<h4>Example</h4>
+<p>Interactive slider to set the ringer volume. The value can either be set through the hardware volume controls or interactively via a gesture.</p>
+
+  </div>
+</div>
+
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-9">
+
+    <img src="../static/content/seekbar_style.png">
+    <div class="figure-caption">
+      Seek bars in Holo Light &amp; Dark
+    </div>
+
+  </div>
+  <div class="layout-content-col span-4">&nbsp;</div>
+</div>
+
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/building-blocks/spinners.html b/docs/html/design/building-blocks/spinners.html
new file mode 100644
index 0000000..bf21fe8
--- /dev/null
+++ b/docs/html/design/building-blocks/spinners.html
@@ -0,0 +1,190 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Spinners
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Spinners</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<p>Spinners provide a quick way to select one value from a set. In the default state, a spinner shows
+its currently selected value. Touching the spinner displays a dropdown menu with all other available
+values, from which the user can select a new one.</p>
+
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/spinners_form.png">
+
+<h4>Spinners in forms</h4>
+<p>Spinners are useful for data picking in forms. They are compact and integrate nicely with other
+components. Use spinners in forms for both simple data input and in combination with other input
+fields. For example, a text field might let you edit an email address for a contact, while its
+associated spinner allows you to select whether it's a Home or Work address.</p>
+
+  </div>
+  <div class="layout-content-col span-7">
+
+    <img src="../static/content/spinners_actionbar.png">
+
+<h4>Spinners in action bars</h4>
+<p>Use spinners in action bars to switch views. For example, Gmail uses a spinner to permit switching
+between accounts or commonly used labels. Spinners are useful when changing the view is important to
+your app, but not necessarily a frequent occurrence. In cases where view switching is frequent, use
+tabs.</p>
+
+  </div>
+</div>
+
+<img src="../static/content/spinners_hololightanddark.png">
+<div class="figure-caption">
+  Spinners in the Holo Dark and Holo Light themes, in various states.
+</div>
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/building-blocks/switches.html b/docs/html/design/building-blocks/switches.html
new file mode 100644
index 0000000..3d7bc9c
--- /dev/null
+++ b/docs/html/design/building-blocks/switches.html
@@ -0,0 +1,181 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Switches
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Switches</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<p>Switches allow the user to select options. There are three kinds of switches: checkboxes, radio
+buttons, and on/off switches.</p>
+<h2>Checkboxes</h2>
+<p>Checkboxes allow the user to select multiple options from a set. Avoid using a single checkbox to
+turn an option off or on. Instead, use an on/off switch.</p>
+
+<div style="text-align: center">
+  <img src="../static/content/switches_checkboxes.png">
+</div>
+
+<h2>Radio Buttons</h2>
+<p>Radio buttons allow the user to select one option from a set. Use radio buttons for exclusive
+selection if you think that the user needs to see all available options side-by-side. Otherwise,
+consider a spinner, which uses less space.</p>
+
+<div style="text-align: center">
+  <img src="../static/content/switches_radios.png">
+</div>
+
+<h2>On/off Switches</h2>
+<p>On/off switches toggle the state of a single settings option.</p>
+
+<div style="text-align: center">
+  <img src="../static/content/switches_switches.png">
+</div>
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/building-blocks/tabs.html b/docs/html/design/building-blocks/tabs.html
new file mode 100644
index 0000000..c094cce
--- /dev/null
+++ b/docs/html/design/building-blocks/tabs.html
@@ -0,0 +1,213 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Tabs
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Tabs</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<img src="../static/content/tabs_overview.png">
+
+<p>Tabs in the action bar make it easy to explore and switch between different views or functional
+aspects of your app, or to browse categorized data sets.</p>
+
+
+<h2 id="scrollable">Scrollable Tabs</h2>
+
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6">
+
+<p>Scrolling tab controls can contain a larger number of items than a standard tab control. To navigate
+to the next/previous view, swipe left or right.</p>
+
+  </div>
+  <div class="layout-content-col span-7">
+
+    <video width="400" class="with-shadow play-on-hover" autoplay>
+      <source src="../static/content/tabs_scrolly.mp4" type="video/mp4">
+      <source src="../static/content/tabs_scrolly.webm" type="video/webm">
+      <source src="../static/content/tabs_scrolly.ogv" type="video/ogg">
+    </video>
+    <div class="figure-caption">
+      Scrolling tabs in Android Market.
+      <div class="video-instructions">&nbsp;</div>
+    </div>
+
+  </div>
+</div>
+
+
+<h2 id="fixed">Fixed Tabs</h2>
+
+
+<p>Fixed tabs display all items concurrently. To navigate to a different view, touch the tab.</p>
+
+<img src="../static/content/tabs_standard.png">
+<div class="figure-caption">
+  Tabs in Holo Dark &amp; Light.
+</div>
+
+<img src="../static/content/tabs_youtube.png">
+<div class="figure-caption">
+  Tabs in the YouTube app.
+</div>
+
+
+
+<h2 id="stacked">Stacked Tabs</h2>
+
+
+<p>If view navigation is essential to your app, you can break out tabs into a separate action bar. This
+permits fast view switching even on narrower screens.</p>
+
+<img src="../static/content/tabs_stacked.png">
+
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/building-blocks/text-fields.html b/docs/html/design/building-blocks/text-fields.html
new file mode 100644
index 0000000..6496fa5
--- /dev/null
+++ b/docs/html/design/building-blocks/text-fields.html
@@ -0,0 +1,223 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Text Fields
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Text Fields</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<p>Text fields allow the user to type text into your app. They can be either single line or multi-line.
+Touching a text field places the cursor and automatically displays the keyboard. In addition to
+typing, text fields allow for a variety of other activities, such as text selection (cut, copy,
+paste) and data lookup via auto-completion.</p>
+
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-12">
+
+    <img src="../static/content/text_input_singlevsmultiline.png">
+
+  </div>
+</div>
+
+<h4>Single line and multi line</h4>
+<p>Single-line fields automatically scroll their content to the left as the text input cursor reaches
+the right edge of the input field. Multi-line text fields automatically break to a new line for
+overflow text and scroll vertically when the cursor reaches the lower edge.</p>
+
+<img src="../static/content/text_input_typesandtypedown.png">
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6">
+
+<h4>Text field types</h4>
+<p>Text fields can have different types, such as number, message, or email address. The type determines
+what kind of characters are allowed inside the field, and may prompt the virtual keyboard to
+optimize its layout for frequently used characters.</p>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+<h4>Auto-complete text fields</h4>
+<p>Use auto-complete text fields to present real-time completions or search results in popups, so users
+can enter information more accurately and efficiently.</p>
+
+  </div>
+</div>
+
+<h2>Text Selection</h2>
+
+<p>Users can select any word in a text field with a long press. This action triggers a text selection
+mode that facilitates extending the selection or choosing an action to perform on the selected text.
+Selection mode includes:</p>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-9">
+
+    <img src="../static/content/text_input_textselection.png">
+
+  </div>
+  <div class="layout-content-col span-4 with-callouts">
+
+<ol>
+<li>
+<h4>Contextual action bar</h4>
+<p>A contextual action bar (CAB) displays the actions available to perform on the selection:
+ typically cut, copy, and paste, but apps can insert additional commands as needed.</p>
+</li>
+<li>
+<h4>Selection handles</h4>
+<p>Selection handles can be dragged to select more or less text while remaining in selection mode.</p>
+</li>
+</ol>
+
+  </div>
+</div>
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/get-started/creative-vision.html b/docs/html/design/get-started/creative-vision.html
new file mode 100644
index 0000000..11783c4
--- /dev/null
+++ b/docs/html/design/get-started/creative-vision.html
@@ -0,0 +1,201 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Creative Vision
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Creative Vision</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<img src="../static/content/creative_vision_main.png">
+
+<div class="vspace size-1">&nbsp;</div>
+
+<p>Ice Cream Sandwich (Android 4.0) marks a major milestone for Android design. We touched nearly every
+pixel of the system as we expanded the new design approaches introduced in Honeycomb tablets to all
+types of mobile devices. Starting with the most basic elements, we introduced a new font, Roboto,
+designed for high-resolution displays. Other big changes include framework-level action bars on
+phones and support for new phones without physical buttons.</p>
+<p>We focused the design work with three overarching goals for our core apps and the system at large.
+As you design apps to work with Android, consider these goals:</p>
+
+<div class="vspace size-1">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-4">
+
+<h4>Enchant me</h4>
+<p>Beauty is more than skin deep. Android apps are sleek and aesthetically pleasing on multiple levels.
+Transitions are fast and clear; layout and typography are crisp and meaningful. App icons are works
+of art in their own right. Just like a well-made tool, your app should strive to combine beauty,
+simplicity and purpose to create a magical experience that is effortless and powerful.</p>
+
+  </div>
+  <div class="layout-content-col span-5">
+
+<h4>Simplify my life</h4>
+<p>Android apps make life easier and are easy to understand. When people use your app for the first
+time, they should intuitively grasp the most important features. The design work doesn't stop at the
+first use, though. Android apps remove ongoing chores like file management and syncing. Simple tasks
+never require complex procedures, and complex tasks are tailored to the human hand and mind. People
+of all ages and cultures feel firmly in control, and are never overwhelmed by too many choices or
+irrelevant flash.</p>
+
+  </div>
+  <div class="layout-content-col span-4">
+
+<h4>Make me amazing</h4>
+<p>It's not enough to make an app that is easy to use. Android apps empower people to try new things
+and to use apps in inventive new ways. Android lets people combine applications into new workflows
+through multitasking, notifications, and sharing across apps. At the same time, your app should feel
+personal, giving people access to superb technology with clarity and grace.</p>
+
+  </div>
+</div>
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/get-started/principles.html b/docs/html/design/get-started/principles.html
new file mode 100644
index 0000000..0d9ef20
--- /dev/null
+++ b/docs/html/design/get-started/principles.html
@@ -0,0 +1,453 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Design Principles
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Design Principles</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<p>These design principles were developed by and for the Android User Experience Team to keep users'
+best interests in mind. Consider them as you apply your own creativity and design thinking. Deviate
+with purpose.</p>
+
+<h2>Enchant Me</h2>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+<h4>Delight me in surprising ways</h4>
+<p>A beautiful surface, a carefully-placed animation, or a well-timed sound effect is a joy to
+experience. Subtle effects contribute to a feeling of effortlessness and a sense that a powerful
+force is at hand.</p>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/principles_delight.png">
+
+  </div>
+</div>
+
+<div class="vspace size-2">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+<h4>Real objects are more fun than buttons and menus</h4>
+<p>Allow people to directly touch and manipulate objects in your app. It reduces the cognitive effort
+needed to perform a task while making it more emotionally satisfying.</p>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/principles_real_objects.png">
+
+  </div>
+</div>
+
+<div class="vspace size-2">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+<h4>Let me make it mine</h4>
+<p>People love to add personal touches because it helps them feel at home and in control. Provide
+sensible, beautiful defaults, but also consider fun, optional customizations that don't hinder
+primary tasks.</p>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/principles_make_it_mine.png">
+
+  </div>
+</div>
+
+<div class="vspace size-2">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+<h4>Get to know me</h4>
+<p>Learn peoples' preferences over time. Rather than asking them to make the same choices over and
+over, place previous choices within easy reach.</p>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/principles_get_to_know_me.png">
+
+  </div>
+</div>
+
+<h2>Simplify My Life</h2>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+<h4>Keep it brief</h4>
+<p>Use short phrases with simple words. People are likely to skip sentences if they're long.</p>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/principles_keep_it_brief.png">
+
+  </div>
+</div>
+
+<div class="vspace size-2">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+<h4>Pictures are faster than words</h4>
+<p>Consider using pictures to explain ideas. They get people's attention and can be much more efficient
+than words.</p>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/principles_pictures.png">
+
+  </div>
+</div>
+
+<div class="vspace size-2">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+<h4>Decide for me but let me have the final say</h4>
+<p>Take your best guess and act rather than asking first. Too many choices and decisions make people
+unhappy. Just in case you get it wrong, allow for 'undo'.</p>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/principles_decide_for_me.png">
+
+  </div>
+</div>
+
+<div class="vspace size-2">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+<h4>Only show what I need when I need it</h4>
+<p>People get overwhelmed when they see too much at once. Break tasks and information into small,
+digestible chunks. Hide options that aren't essential at the moment, and teach people as they go.</p>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/principles_information_when_need_it.png">
+
+  </div>
+</div>
+
+<div class="vspace size-2">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+<h4>I should always know where I am</h4>
+<p>Give people confidence that they know their way around. Make places in your app look distinct and
+use transitions to show relationships among screens. Provide feedback on tasks in progress.</p>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/principles_navigation.png">
+
+  </div>
+</div>
+
+<div class="vspace size-2">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+<h4>Never lose my stuff</h4>
+<p>Save what people took time to create and let them access it from anywhere. Remember settings,
+personal touches, and creations across phones, tablets, and computers. It makes upgrading the
+easiest thing in the world.</p>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/principles_never_lose_stuff.png">
+
+  </div>
+</div>
+
+<div class="vspace size-2">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+<h4>If it looks the same, it should act the same</h4>
+<p>Help people discern functional differences by making them visually distinct rather than subtle.
+Avoid modes, which are places that look similar but act differently on the same input.</p>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/principles_looks_same.png">
+
+  </div>
+</div>
+
+<div class="vspace size-2">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+<h4>Only interrupt me if it's important</h4>
+<p>Like a good personal assistant, shield people from unimportant minutiae. People want to stay
+focused, and unless it's critical and time-sensitive, an interruption can be taxing and frustrating.</p>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/principles_important_interruption.png">
+
+  </div>
+</div>
+
+<h2>Make Me Amazing</h2>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+<h4>Give me tricks that work everywhere</h4>
+<p>People feel great when they figure things out for themselves. Make your app easier to learn by
+leveraging visual patterns and muscle memory from other Android apps. For example, the swipe gesture
+may be a good navigational shortcut.</p>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/principles_tricks.png">
+
+  </div>
+</div>
+
+<div class="vspace size-2">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+<h4>It's not my fault</h4>
+<p>Be gentle in how you prompt people to make corrections. They want to feel smart when they use your
+app. If something goes wrong, give clear recovery instructions but spare them the technical details.
+If you can fix it behind the scenes, even better.</p>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/principles_error.png">
+
+  </div>
+</div>
+
+<div class="vspace size-2">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+<h4>Sprinkle encouragement</h4>
+<p>Break complex tasks into smaller steps that can be easily accomplished. Give feedback on actions,
+even if it's just a subtle glow.</p>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/principles_sprinkle_encouragement.png">
+
+  </div>
+</div>
+
+<div class="vspace size-2">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+<h4>Do the heavy lifting for me</h4>
+<p>Make novices feel like experts by enabling them to do things they never thought they could. For
+example, shortcuts that combine multiple photo effects can make amateur photographs look amazing in
+only a few steps.</p>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/principles_heavy_lifting.png">
+
+  </div>
+</div>
+
+<div class="vspace size-2">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+<h4>Make important things fast</h4>
+<p>Not all actions are equal. Decide what's most important in your app and make it easy to find and
+fast to use, like the shutter button in a camera, or the pause button in a music player.</p>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/principles_make_important_fast.png">
+
+  </div>
+</div>
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/get-started/ui-overview.html b/docs/html/design/get-started/ui-overview.html
new file mode 100644
index 0000000..bd5ff9c
--- /dev/null
+++ b/docs/html/design/get-started/ui-overview.html
@@ -0,0 +1,302 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - UI Overview
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>UI Overview</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<p>Android's system UI provides the framework on top of which you build your app. Important aspects
+include the Home screen experience, global device navigation, and notifications.</p>
+<p>Your app will play an important part in keeping the overall Android experience consistent and
+enjoyable to use. At the end of this chapter we introduce the main elements for achieving this goal
+in your app.</p>
+<p>Read on for a quick overview of the most important aspects of the Android user interface.</p>
+
+<h2>Home, All Apps, and Recents</h2>
+
+<div class="vspace size-1">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-4">
+
+    <img src="../static/content/ui_overview_home_screen.png">
+
+<h4>Home screen</h4>
+<p>Home is a customizable space that houses app shortcuts, folders and widgets. Navigate between
+different home screen panels by swiping left and right.</p>
+<p>The Favorites Tray at the bottom always keeps your most important shortcuts and folders in view
+regardless of which panel is currently showing.</p>
+<p>Access the entire collection of apps and widgets by touching the All Apps button at the center of
+the Favorites Tray.</p>
+
+  </div>
+  <div class="layout-content-col span-4">
+
+    <img src="../static/content/ui_overview_all_apps.png">
+
+<h4>All apps screen</h4>
+<p>The All Apps screen lets you browse the entire set of apps and widgets that are installed on your
+device.</p>
+<p>Users can drag an app or widget icon from the All Apps screen and place it in any empty location on
+any Home screen.</p>
+
+  </div>
+  <div class="layout-content-col span-4">
+
+    <img src="../static/content/ui_overview_recents.png">
+
+<h4>Recents screen</h4>
+<p>Recents provides an efficient way of switching between recently used applications. It provides a
+clear navigation path between multiple ongoing tasks.</p>
+<p>The Recents button at the right side of the navigation bar displays the apps that the user has
+interacted with most recently. They are organized in reverse chronological order with the most
+recently used app at the bottom.</p>
+<p>Switch to an app by touching it. Remove an item by swiping left or right.</p>
+
+  </div>
+</div>
+
+<h2>System Bars</h2>
+
+<p>The system bars are screen areas dedicated to the display of notifications, communication of device
+status, and device navigation. Typically the system bars are displayed concurrently with your app.
+Apps that display immersive content, such as movies or images, can temporarily hide the system bars
+to allow the user to enjoy full screen content without distraction.</p>
+
+<img src="../static/content/ui_overview_system_ui.png">
+
+<div class="with-callouts">
+
+<ol>
+<li>
+<h4>Status Bar</h4>
+<p>Displays pending notifications on the left and status, such as time, battery level, or signal
+  strength, on the right. Swipe down from the status bar to show notification details.</p>
+</li>
+<li>
+<h4>Navigation Bar</h4>
+<p>New for phones in Android 4.0, the navigation bar is present only on devices that don't have
+  the traditional hardware keys. It houses the device navigation controls Back, Home, and
+  Recents, and also displays a menu for apps written for Android 2.3 or earlier.</p>
+</li>
+<li>
+<h4>Combined Bar</h4>
+<p>On tablet form factors the status and navigation bars are combined into a single bar at the
+  bottom of the screen.</p>
+</li>
+</ol>
+
+</div>
+
+<h2>Notifications</h2>
+
+<p>Notifications are brief messages that users can access at any time from the status bar. They
+provide updates, reminders, or information that's important, but not critical enough to warrant
+interrupting the user. Open the notifications drawer by swiping down on the status bar. Touching a
+notification opens the associated app. <a href="../patterns/notifications.html">More on Notifications</a></p>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-4">
+
+    <img src="../static/content/ui_overview_notifications.png">
+
+  </div>
+  <div class="layout-content-col span-9">
+
+    <img src="../static/content/notifications_dismiss.png">
+
+<p>Most notifications have a one-line title and a one-line message. The recommended layout for a
+notification includes two lines. If necessary, you can add a third line. Timestamps are optional.</p>
+<p>Swiping a notification right or left removes it from the notification drawer.</p>
+
+  </div>
+</div>
+
+
+<h2 id="app">Common App UI</h2>
+
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+    <img src="../static/content/ui_overview_app_ui.png">
+
+  </div>
+  <div class="layout-content-col span-6 with-callouts">
+
+<p>A typical Android app consists of action bars and the app content area.</p>
+<ol>
+<li>
+<h4>Main Action Bar</h4>
+<p>The command and control center for your app. The main action bar includes elements for
+  navigating your app's hierarchy and views, and also surfaces the most important actions.</p>
+<p><a href="../patterns/actionbar.html">More on the Action Bar</a></p>
+</li>
+<li>
+<h4>View Control</h4>
+<p>Allows users to switch between the different views that your app provides. Views typically
+  consist of different arrangements of your data or different functional aspects of your app.</p>
+</li>
+<li>
+<h4>Content Area</h4>
+<p>The space where the content of your app is displayed.</p>
+</li>
+<li>
+<h4>Split Action Bar</h4>
+<p>Split action bars provide a way to distribute actions across additional bars located below
+  the main action bar or at the bottom of the screen. In this example, a split action bar moves
+  important actions that won't fit in the main bar to the bottom.</p>
+</li>
+</ol>
+
+  </div>
+</div>
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/index.html b/docs/html/design/index.html
new file mode 100644
index 0000000..14d7b63
--- /dev/null
+++ b/docs/html/design/index.html
@@ -0,0 +1,164 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Welcome
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="static/default.css">
+
+<style>
+#landing-graphic-container {
+  position: relative;
+}
+
+#text-overlay {
+  position: absolute;
+  left: 10px;
+  top: 472px;
+  width: 280px;
+}
+</style>
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="index.html">Get Started</a></div>
+            <ul>
+              <li><a href="get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="get-started/principles.html">Design Principles</a></li>
+              <li><a href="get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="style/index.html">Style</a></div>
+            <ul>
+              <li><a href="style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="style/themes.html">Themes</a></li>
+              <li><a href="style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="style/typography.html">Typography</a></li>
+              <li><a href="style/color.html">Color</a></li>
+              <li><a href="style/iconography.html">Iconography</a></li>
+              <li><a href="style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="patterns/gestures.html">Gestures</a></li>
+              <li><a href="patterns/app-structure.html">App Structure</a></li>
+              <li><a href="patterns/navigation.html">Navigation</a></li>
+              <li><a href="patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="patterns/selection.html">Selection</a></li>
+              <li><a href="patterns/notifications.html">Notifications</a></li>
+              <li><a href="patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="building-blocks/lists.html">Lists</a></li>
+              <li><a href="building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="building-blocks/switches.html">Switches</a></li>
+              <li><a href="building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+
+
+          
+
+<div id="landing-graphic-container">
+  <div id="text-overlay">
+    Welcome to <strong>Android Design</strong>, your place for learning how to design exceptional Android apps.
+    <br><br>
+    <a href="get-started/creative-vision.html" class="landing-page-link">Creative Vision</a>
+  </div>
+
+  <a href="get-started/creative-vision.html">
+    <img src="static/content/index_landing_page.png">
+  </a>
+</div>
+
+
+
+          
+
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '';
+    </script>
+    <script src="static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/patterns/actionbar.html b/docs/html/design/patterns/actionbar.html
new file mode 100644
index 0000000..911c549
--- /dev/null
+++ b/docs/html/design/patterns/actionbar.html
@@ -0,0 +1,503 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Action Bar
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Action Bar</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<img src="../static/content/action_bar_pattern_overview.png">
+
+<p>The <em>action bar</em> is arguably the most important structural element of an Android app. It's a
+dedicated piece of real estate at the top of each screen that is generally persistent throughout the
+app.</p>
+<p><strong>The main purpose of the action bar is to</strong>:</p>
+<ul>
+<li>Make important actions (such as <em>New</em> or <em>Search</em>, etc) prominent and accessible in a predictable
+   way.</li>
+<li>Support consistent navigation and view switching within apps.</li>
+<li>Reduce clutter by providing an action overflow for rarely used actions.</li>
+<li>Provide a dedicated space for giving your app an identity.</li>
+</ul>
+<p>If you're new to writing Android apps, note that the action bar is one of the most important design
+elements you can implement. Following the guidelines described here will go a long way toward making
+your app's interface consistent with the core Android apps.</p>
+<h2>General Organization</h2>
+<p>The action bar is split into four different functional areas that apply to most apps.</p>
+<img src="../static/content/action_bar_basics.png">
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7 with-callouts">
+
+    <ol>
+      <li class="value-1"><h4>App icon</h4>
+        <p>
+
+The app icon establishes your app's identity. It can be replaced with a different logo or branding if
+you wish.
+Important: If the app is currently not displaying the top-level screen, be sure to display the Up
+caret to the left of the app icon, so the user can navigate up the hierarchy. For more discussion of
+Up navigation, see the <a href="../patterns/navigation.html">Navigation</a> pattern.
+
+<div class="figure">
+  <img src="../static/content/action_bar_pattern_up_app_icon.png">
+  <div class="figure-caption">
+    App icon with and without "up" affordance.
+  </div>
+</div>
+
+        </p>
+      </li>
+    </ol>
+
+  </div>
+  <div class="layout-content-col span-6 with-callouts">
+
+    <ol>
+      <li class="value-2"><h4>View control</h4>
+        <p>
+
+If your app displays data in different views, this segment of the action bar allows users to switch
+views. Examples of view-switching controls are drop-down menus or tab controls. 
+
+        </p>
+        <p>
+
+If your app doesn't support different views, you can also use this space to display non-interactive
+content, such as an app title or longer branding information.
+
+        </p>
+      </li>
+      <li class="value-3"><h4>Action buttons</h4>
+        <p>
+
+Show the most important actions of your app in the actions section. Actions that don't fit in the
+action bar are moved automatically to the action overflow.
+
+        </p>
+      </li>
+      <li class="value-4"><h4>Action overflow</h4>
+        <p>
+
+Move less often used actions to the action overflow.
+
+        </p>
+      </li>
+    </ol>
+
+  </div>
+</div>
+
+
+<h2>Adapting to Rotation and Different Screen Sizes</h2>
+<p>One of the most important UI issues to consider when creating an app is how to adjust to screen
+rotation on different screen sizes.</p>
+<p>You can adapt to such changes by using <em>split action bars</em>, which allow you to distribute action bar
+content across multiple bars located below the main action bar or at the bottom of the screen.</p>
+
+<img src="../static/content/action_bar_pattern_rotation.png">
+<div class="figure-caption">
+  Split action bar showing action buttons at the bottom of the screen in vertical orientation.
+</div>
+
+<h2>Layout Considerations for Split Action Bars</h2>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-8 with-callouts">
+
+<p>When splitting up content across multiple action bars, you generally have three possible locations
+for action bar content:</p>
+<ol>
+<li><strong>Main action bar</strong></li>
+<li><strong>Top bar</strong></li>
+<li><strong>Bottom bar</strong></li>
+</ol>
+<p>If the user can navigate up the hierarchy from a given screen, the main action bar contains the up
+caret, at a minimum.</p>
+<p>To allow the user to quickly switch between the views your app provides, use tabs or a spinner in
+the top bar.</p>
+<p>To display actions and, if necessary, the action overflow, use the bottom bar.</p>
+
+  </div>
+  <div class="layout-content-col span-3">
+
+    <img src="../static/content/action_bar_pattern_considerations.png">
+
+  </div>
+</div>
+
+<h2>Contextual Action Bars</h2>
+<p>A <em>contextual action bar (CAB)</em> is a temporary action bar that overlays the app's action bar for the
+duration of a particular sub-task. CABs are most typically used for tasks that involve acting on
+selected data or text.</p>
+
+<img src="../static/content/action_bar_cab.png">
+<div class="figure-caption">
+  Contextual action bar shown in Browser and Gmail
+</div>
+
+<p>The selection CAB appears after a long press on a selectable data item triggers selection mode.</p>
+<p><strong>From here the user can</strong>:</p>
+<ul>
+<li>Select additional elements by touching them.</li>
+<li>Trigger an action from the CAB that applies to all selected data items. The CAB then
+   automatically dismisses itself.</li>
+<li>Dismiss the CAB via the navigation bar's Back button or the CAB's checkmark button. This removes
+   the CAB along with all selection highlights.</li>
+</ul>
+<p>Use CABs whenever you allow the user to select data via long press. You can control the action
+content of a CAB in order to insert the actions you would like the user to be able to perform.</p>
+<p>For more information, refer to the "Selection" pattern.</p>
+<h2>Action Bar Elements</h2>
+<h4>Tabs</h4>
+<p><em>Tabs</em> display app views concurrently and make it easy to explore and switch between them. Use tabs
+if you expect your users to switch views frequently.</p>
+
+<img src="../static/content/tabs_youtube.png">
+
+<p>There are two types of tabs: fixed and scrollable.</p>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6">
+
+<h4>Scrollable tabs</h4>
+<p><em>Scrollable tabs</em> always take up the entire width of the bar, with the currently active view item in
+the center, and therefore need to live in a dedicated bar. Scrollable tabs can themselves be
+scrolled horizontally to bring more tabs into view.</p>
+<p>Use scrollable tabs if you have a large number of views or if you're unsure how many views will be
+displayed because your app inserts views dynamically (for example, open chats in a messaging app
+that the user can navigate between). Scrollable tabs should always allow the user to navigate
+between the views by swiping left or right on the content area as well as swiping the tabs
+themselves.</p>
+
+  </div>
+  <div class="layout-content-col span-7">
+
+    <video width="400" class="with-shadow play-on-hover" autoplay>
+      <source src="../static/content/tabs_scrolly.mp4" type="video/mp4">
+      <source src="../static/content/tabs_scrolly.webm" type="video/webm">
+      <source src="../static/content/tabs_scrolly.ogv" type="video/ogg">
+    </video>
+    <div class="figure-caption">
+      Scrolling tabs in Android Market.
+      <div class="video-instructions">&nbsp;</div>
+    </div>
+
+  </div>
+</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6">
+
+<h4>Fixed tabs</h4>
+<p><em>Fixed tabs</em> are always visible on the screen, and can't be moved out of the way like scrollable
+tabs. Fixed tabs in the main action bar can move to the top bar when the screen orientation changes.</p>
+
+  </div>
+  <div class="layout-content-col span-7">
+
+    <img src="../static/content/action_bar_pattern_default_tabs.png">
+    <div class="figure-caption">
+      Default fixed tabs shown in Holo Dark &amp; Light.
+    </div>
+
+  </div>
+</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6">
+
+<h4>Spinners</h4>
+<p>A <em>spinner</em> is a drop-down menu that allows users to switch between views of your app. </p>
+<p><strong>Use spinners rather than tabs in the main action bar if</strong>:</p>
+<ul>
+<li>You don't want to give up the vertical screen real estate for a dedicated tab bar.</li>
+<li>You expect your app's users to switch views infrequently.</li>
+</ul>
+
+  </div>
+  <div class="layout-content-col span-7">
+
+    <img src="../static/content/action_bar_pattern_spinner.png">
+    <div class="figure-caption">
+      Action bar spinner from Calendar application.
+    </div>
+
+  </div>
+</div>
+
+<h4>Action buttons</h4>
+<p><em>Action buttons</em> on the action bar surface your app's most important activities. Think about which
+buttons will get used most often, and order them accordingly. Depending on available screen real
+estate, the system shows your most important actions as action buttons and moves the rest to the
+action overflow.</p>
+
+<img src="../static/content/action_bar_pattern_action_icons.png">
+<div class="figure-caption">
+  A sampling of action buttons used throughout the Gmail application.
+</div>
+
+<p>For guidance on prioritizing actions, use the FIT scheme.</p>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-4">
+
+<p><strong>F &mdash; Frequent</strong></p>
+<ul>
+<li>Will people use this action at least 7 out of 10 times they visit the screen?</li>
+<li>Will they typically use it several times in a row?</li>
+<li>Would taking an extra step every time truly be burdensome?</li>
+</ul>
+
+  </div>
+  <div class="layout-content-col span-4">
+
+<p><strong>I &mdash; Important</strong></p>
+<ul>
+<li>Do you want everyone to discover this action because it's especially cool or a selling point?</li>
+<li>Is it something that needs to be effortless in the rare cases it's needed?</li>
+</ul>
+
+  </div>
+  <div class="layout-content-col span-4">
+
+<p><strong>T &mdash; Typical</strong></p>
+<ul>
+<li>Is it typically presented as a first-class action in similar apps?</li>
+<li>Given the context, would people be surprised if it were buried in the action overflow?</li>
+</ul>
+
+  </div>
+</div>
+
+<p>If either F, I, or T apply, then it's appropriate for the action bar. Otherwise, it belongs in the
+action overflow.</p>
+
+<p>
+
+Pre-defined glyphs should be used for certain common actions such as "refresh" and "share." The
+download link below provides a package with icons that are scaled for various screen densities and
+are suitable for use with the Holo Light and Holo Dark themes. The package also includes unstyled
+icons that you can modify to match your theme, in addition to Adobe&reg; Illustrator&reg; source
+files for further customization.
+
+</p>
+<p>
+
+<a href="../static/download/action_bar_icons-v4.0.zip">Download the Action Bar Icon
+Pack</a>
+
+</p>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6">
+
+<h4>Action overflow</h4>
+<p>The action overflow in the action bar provides access to your app's less frequently used actions.
+The overflow icon only appears on phones that have no menu hardware keys. Phones with menu keys
+display the action overflow when the user presses the key.</p>
+
+  </div>
+  <div class="layout-content-col span-7">
+
+    <img src="../static/content/action_bar_pattern_overflow.png">
+    <div class="figure-caption">
+      Action overflow is pinned to the right side.
+    </div>
+
+  </div>
+</div>
+
+<p>How many actions will fit in the main action bar? Action bar capacity is controlled by the following
+rules:</p>
+<ul>
+<li>Action buttons in the main action bar may not occupy more than 50% of the bar's width. Action
+  buttons on bottom action bars can use the entire width.</li>
+<li>The screen width in density-independent pixels
+  (<acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi screen.">dp</acronym>)
+  determine the number of items that will fit in the main action bar:<ul>
+<li>smaller than 360 dp = 2 icons</li>
+<li>360-499 dp = 3 icons</li>
+<li>500-599 dp = 4 icons</li>
+<li>600 dp and larger = 5 icons</li>
+</ul>
+</li>
+</ul>
+
+<img src="../static/content/action_bar_pattern_table.png">
+<div class="figure-caption">
+  In the above table "o" denotes an action bar item and "=" an overflow icon.
+</div>
+
+<h4>Sharing data</h4>
+<p>Whenever your app permits sharing of data, such as images or movie clips, use a <em>share action
+provider</em> in your action bar. The share action provider is designed to speed up sharing by
+displaying the most recently used sharing service next to a spinner button that contains other
+sharing options.</p>
+
+<img src="../static/content/action_bar_pattern_share_pack.png">
+<div class="figure-caption">
+  The Gallery app's share action provider with extended spinner for additional sharing options.
+</div>
+
+<h2>Action Bar Checklist</h2>
+<p>When planning your split action bars, ask yourself questions like these:</p>
+<h4>How important is view navigation to the task?</h4>
+<p>If view navigation is very important to your app, use tabs (for fastest view-switching) or spinners.</p>
+<h4>Which of the app's actions need to be consistently available directly from the action bar, and which can be moved to the action overflow?</h4>
+<p>Use the <acronym title="Frequent, Important or Typical">FIT</acronym> scheme to decide if actions
+are displayed at the top-level or can be moved to the action overflow. If the number of top-level
+actions exceeds the capacity of the main action bar, display them separately in a bottom action bar.</p>
+<h4>What else is important enough to warrant continuous display?</h4>
+<p>Sometimes it is important to display contextual information for your app that's always visible.
+Examples are the number of unread messages in a messaging inbox view or the Now Playing information
+in a music player. Carefully plan which important information you would like to display and
+structure your action bars accordingly.</p>
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/patterns/app-structure.html b/docs/html/design/patterns/app-structure.html
new file mode 100644
index 0000000..fb9205b
--- /dev/null
+++ b/docs/html/design/patterns/app-structure.html
@@ -0,0 +1,402 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Application Structure
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Application Structure</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<p>Apps come in many varieties that address very different needs. For example:</p>
+<ul>
+<li>Apps such as Calculator or Camera that are built around a single focused activity handled from a
+  single screen</li>
+<li>Apps such as Phone whose main purpose is to switch between different activities without deeper
+  navigation</li>
+<li>Apps such as Gmail or Market that combine a broad set of data views with deep navigation</li>
+</ul>
+<p>Your app's structure depends largely on the content and tasks you want to surface for your users.</p>
+<h2>General Structure</h2>
+<p>A typical Android app consists of top level and detail/edit views. If the navigation hierarchy is
+deep and complex, category views connect top level and detail views.</p>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-9">
+
+    <img src="../static/content/app_structure_overview.png">
+
+  </div>
+  <div class="layout-content-col span-4">
+
+<h4>Top level views</h4>
+<p>The top level of the app typically consists of the different views that your app supports. The views
+either show different representations of the same data or expose an altogether different functional
+facet of your app.</p>
+<div class="vspace size-3">&nbsp;</div>
+
+<h4>Category views</h4>
+<p>Category views allow you to drill deeper into your data.</p>
+<div class="vspace size-11">&nbsp;</div>
+
+<h4>Detail/edit view</h4>
+<p>The detail/edit view is where you consume or create data.</p>
+
+  </div>
+</div>
+
+<h2>Top Level</h2>
+<p>The layout of your start screen requires special attention. This is the first screen people see
+after launching your app, so it should be an equally rewarding experience for new and frequent
+visitors alike.</p>
+<p>Ask yourself: "What are my typical users most likely going to want to do in my app?", and structure
+your start screen experience accordingly.</p>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-5">
+
+<h4>Put content forward</h4>
+<p>Many apps focus on the content display. Avoid navigation-only screens and instead let people get to
+the meat of your app right away by making content the centerpiece of your start screen. Choose
+layouts that are visually engaging and appropriate for the data type and screen size.</p>
+
+  </div>
+  <div class="layout-content-col span-8">
+
+    <img src="../static/content/app_structure_market.png">
+    <div class="figure-caption">
+      Market's start screen primarily allows navigation into the stores for Apps, Music, Books,
+      Movies and Games. It is also enriched with tailored recommendations and promotions that
+      surface content of interest to the user. Search is readily available from the action bar.
+    </div>
+
+  </div>
+</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-5">
+
+<h4>Set up action bars for navigation and actions</h4>
+<p>All screens in your app should display action bars to provide consistent navigation and surface
+important actions.</p>
+<p>At the top level, special considerations apply to the action bar:</p>
+<ul>
+<li>Use the action bar to display your app's icon or title.</li>
+<li>If your top level consists of multiple views, or if switching between data from different user
+  accounts is a significant use case, make sure that it's easy for the user to navigate between them
+  by adding view controls to your action bar.</li>
+<li>If your app allows people to create content, consider making the content accessible right from the
+  top level.</li>
+<li>If your content is searchable, include the Search action in the action bar so people can cut
+  through the navigation hierarchy.</li>
+</ul>
+
+  </div>
+  <div class="layout-content-col span-8">
+
+    <img src="../static/content/app_structure_gmail.png">
+    <div class="figure-caption">
+      Email is about productivity, so an efficient, easy-to-skim list with higher data density works
+      well. Navigation supports switching between accounts and recent labels. Icons for creating a
+      new message or searching are prominent in the split action bar at the bottom.
+    </div>
+
+  </div>
+</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-5">
+
+<h4>Create an identity for your app</h4>
+<p>Creating an identity for your app goes beyond the action bar. Your app communicates its identity
+through its data, the way that data is arranged, and how people interact with it. Especially for
+media-rich applications, try to create unique layouts that showcase your data and go beyond the
+monotony of simple list views.</p>
+
+  </div>
+  <div class="layout-content-col span-8">
+
+    <img src="../static/content/app_structure_music_lndscp.png">
+    <div class="figure-caption">
+      The 3D carousel celebrates cover art and establishes a unique identity for the Music app.
+      Defaulting to the Recent view keeps the focus on music the user has been listening to lately.
+    </div>
+
+  </div>
+</div>
+
+<h2>Categories</h2>
+<p>Generally, the purpose of a deep, data-driven app is to navigate through organizational categories
+to the detail level, where data can be viewed and managed. Minimize perceived navigation effort by
+keeping your apps shallow.</p>
+<p>Even though the number of vertical navigation steps from the top level down to the detail views is
+typically dictated by the structure of your app's content, there are several ways you can cut down
+on the perception of onerous navigation.</p>
+<h4>Use tabs to combine category selection and data display</h4>
+<p>This can be successful if the categories are familiar or the number of categories is small. It has
+the advantage that a level of hierarchy is removed and data remains at the center of the user's
+attention. Navigating laterally between data-rich categories is more akin to a casual browsing
+experience than to an explicit navigation step.</p>
+
+<div class="vspace size-1">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-8">
+
+<p>If the categories are familiar, predictable, or closely related, use scrolling tabs (where not all
+items are in view simultaneously). Keep the number of scrolling tabs at a manageable level to
+minimize navigational effort. Rule of thumb: no more than 5&ndash;7 tabs.</p>
+
+    <img src="../static/content/app_structure_scrolltabs.png">
+    <div class="figure-caption">
+      Market uses tabs to simultaneously show category choice and content. To navigate between
+      categories, users can swipe left/right on the content.
+    </div>
+
+  </div>
+  <div class="layout-content-col span-5">
+
+<p>If the categories in the tabs are not closely related, favor fixed tabs, so that all categories are
+in view at the same time.</p>
+
+    <img src="../static/content/app_structure_fixedtabs.png">
+    <div class="figure-caption">
+      YouTube uses fixed tabs to switch between different, relatively unrelated functional areas.
+    </div>
+
+
+  </div>
+</div>
+
+<h4>Allow cutting through hierarchies</h4>
+<p>Take advantage of shortcuts that allow people to reach their goals quicker. To allow top-level
+invocation of actions for a data item from within list or grid views, display prominent actions
+directly on list view items using drop-downs or split list items. This lets people invoke actions on
+data without having to navigate all the way down the hierarchy.</p>
+
+<img src="../static/content/app_structure_shortcut_on_item.png">
+<div class="figure-caption">
+  Music allows the user to act upon a data item (song) from within the category view (album),
+  thereby removing the need to navigate all the way down to the song's detail view.
+</div>
+
+<h4>Acting upon multiple data items</h4>
+<p>Even though category views mostly serve to guide people to content detail, keep in mind that there
+are often good reasons to act on collections of data as well.</p>
+<p>For example, if you allow people to delete an item in a detail view, you should also allow them to
+delete multiple items in the category view. Analyze which detail view actions are applicable to
+collections of items. Then use multi-select to allow application of those actions to multiple items
+in a category view.</p>
+<h2>Details</h2>
+<p>The detail view allows you to view and act on your data. The layout of the detail view depends on
+the data type being displayed, and therefore differs widely among apps.</p>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-4">
+
+<h4>Layout</h4>
+<p>Consider the activities people will perform in the detail view and arrange the layout accordingly.
+For immersive content, make use of the lights-out mode to allow for distraction-free viewing of
+full-screen content.</p>
+
+    <img src="../static/content/app_structure_people_detail.png">
+
+  </div>
+  <div class="layout-content-col span-9">
+
+    <img src="../static/content/app_structure_book_detail_page_flip.png">
+    <div class="figure-caption">
+      Google Books' detail view is all about replicating the experience of reading an actual book.
+      The page-flip animation reinforces that notion. To create an immersive experience the app
+      enters lights-out mode, which hides all system UI affordances.
+    </div>
+
+    <div class="figure-caption">
+      The purpose of the People app's detail view is to surface communication options. The list view
+      allows for efficient scanning and quick access of phone numbers, email addresses and other
+      information items. Split items are used to combine calling and messaging into one compact line
+      item.
+    </div>
+  </div>
+</div>
+
+<h4>Make navigation between detail views efficient</h4>
+<p>If your users are likely to want to look at multiple items in sequence, allow them to navigate
+between items from within the detail view. Use swipe views or other techniques, such as filmstrips,
+to achieve this.</p>
+
+<img src="../static/content/app_structure_gmail_swipe.png">
+<div class="figure-caption">
+  Gmail using swipe views to navigate from detail view to detail view.
+</div>
+
+<img src="../static/content/app_structure_gallery_filmstrip.png">
+<div class="figure-caption">
+  In addition to supporting swipe gestures to move left or right through images, Gallery provides a
+  filmstrip control that lets people quickly jump to specific images.
+</div>
+
+<h2>Checklist</h2>
+<ul>
+<li>
+<p>Find ways to display useful content on your start screen.</p>
+</li>
+<li>
+<p>Use action bars to provide consistent navigation.</p>
+</li>
+<li>
+<p>Keep your hierarchies shallow by using horizontal navigation and shortcuts.</p>
+</li>
+<li>
+<p>Use multi-select to allow the user to act on collections of data.</p>
+</li>
+<li>
+<p>Allow for quick navigation between detail items with swipe views.</p>
+</li>
+</ul>
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/patterns/compatibility.html b/docs/html/design/patterns/compatibility.html
new file mode 100644
index 0000000..f18c62d
--- /dev/null
+++ b/docs/html/design/patterns/compatibility.html
@@ -0,0 +1,214 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Backwards Compatibility
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Backwards Compatibility</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<p>Significant changes in Android 3.0 included:</p>
+<ul>
+<li>Deprecation of navigation hardware keys (Back, Menu, Search, Home) in favor of handling navigation
+  via virtual controls (Back, Home, Recents).</li>
+<li>Robust pattern for the use of menus in action bars.</li>
+</ul>
+<p>Android 4.0 brings these changes for tablets to the phone platform.</p>
+
+<h2>Adapting Android 4.0 to Older Hardware and Apps</h2>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6">
+
+<h4>Phones with virtual navigation controls</h4>
+<p>Android apps written for Android 3.0 and later display actions in the action bar. Actions that don't
+fit in the action bar or aren't important enough to be displayed at the top level appear in the
+action overflow.</p>
+<p>Users access the action overflow by touching it in the action bar.</p>
+
+  </div>
+  <div class="layout-content-col span-7">
+
+    <img src="../static/content/compatibility_virtual_nav.png">
+
+  </div>
+</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6">
+
+<h4>Phones with physical navigation keys</h4>
+<p>Android phones with traditional navigation hardware keys don't display the virtual navigation bar at
+the bottom of the screen. Instead, the action overflow is available from the menu hardware key. The
+resulting actions popup has the same style as in the previous example, but is displayed at the bottom of the screen.</p>
+
+  </div>
+  <div class="layout-content-col span-7">
+
+    <img src="../static/content/compatibility_physical_buttons.png">
+
+  </div>
+</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6">
+
+<h4>Legacy apps on phones with virtual navigation controls</h4>
+<p>When you run an app that was built for Android 2.3 or earlier on a phone with virtual navigation
+controls, an action overflow control appears at the right side of the virtual navigation bar. You
+can touch the control to display the app's actions in the traditional Android menu styling.</p>
+
+  </div>
+  <div class="layout-content-col span-7">
+
+    <img src="../static/content/compatibility_legacy_apps.png">
+
+  </div>
+</div>
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/patterns/gestures.html b/docs/html/design/patterns/gestures.html
new file mode 100644
index 0000000..f8585e4
--- /dev/null
+++ b/docs/html/design/patterns/gestures.html
@@ -0,0 +1,268 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Gestures
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Gestures</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<p>Gestures allow users to interact with your app by manipulating the screen objects you provide. The
+following table shows the core gesture set that is supported in Android.</p>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-4">
+
+    <img src="../static/content/gesture_touch.png">
+
+<h4>Touch</h4>
+<p>Triggers the default functionality for a given item.</p>
+
+<ul>
+  <li class="no-bullet with-icon action">
+    <h4>Action</h4>
+    <p>Press, lift</p></li>
+</ul>
+
+  </div>
+  <div class="layout-content-col span-4">
+
+    <img src="../static/content/gesture_longtouch.png">
+
+<h4>Long press</h4>
+<p>Enters data selection mode. Allows you to select one or more items in a view and act upon
+  the data using a contextual action bar. Avoid using long press for showing contextual menus.</p>
+
+<ul>
+  <li class="no-bullet with-icon action">
+    <h4>Action</h4>
+    <p>Press, wait, lift</p></li>
+</ul>
+
+  </div>
+  <div class="layout-content-col span-4">
+
+    <img src="../static/content/gesture_swipe.png">
+
+<h4>Swipe</h4>
+<p>Scrolls overflowing content, or navigates between views in the same hierarchy.</p>
+
+<ul>
+  <li class="no-bullet with-icon action">
+    <h4>Action</h4>
+    <p>Press, move, lift</p></li>
+</ul>
+
+  </div>
+</div>
+
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-4">
+
+    <img src="../static/content/gesture_drag.png">
+
+<h4>Drag</h4>
+<p>Rearranges data within a view, or moves data into a container (e.g. folders on Home Screen).</p>
+
+<ul>
+  <li class="no-bullet with-icon action">
+    <h4>Action</h4>
+    <p>Long press, move, lift</p></li>
+</ul>
+
+  </div>
+  <div class="layout-content-col span-4">
+
+    <img src="../static/content/gesture_doubletouch.png">
+
+<h4>Double touch</h4>
+<p>Zooms into content. Also used as a secondary gesture for text selection.</p>
+
+<ul>
+  <li class="no-bullet with-icon action">
+    <h4>Action</h4>
+    <p>Two touches in quick succession</p></li>
+</ul>
+
+  </div>
+  <div class="layout-content-col span-4">
+
+    <img src="../static/content/gesture_pinchopen.png">
+
+<h4>Pinch open</h4>
+<p>Zooms into content.</p>
+
+<ul>
+  <li class="no-bullet with-icon action">
+    <h4>Action</h4>
+    <p>2-finger press, move outwards, lift</p></li>
+</ul>
+
+  </div>
+</div>
+
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-4">
+
+    <img src="../static/content/gesture_pinchclose.png">
+
+<h4>Pinch close</h4>
+<p>Zooms out of content.</p>
+
+<ul>
+  <li class="no-bullet with-icon action">
+    <h4>Action</h4>
+    <p>2-finger press, move inwards, lift</p></li>
+</ul>
+
+  </div>
+</div>
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/patterns/index.html b/docs/html/design/patterns/index.html
new file mode 100644
index 0000000..ff797db
--- /dev/null
+++ b/docs/html/design/patterns/index.html
@@ -0,0 +1,171 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Design Patterns
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+<style>
+#landing-graphic-container {
+  position: relative;
+}
+
+#text-overlay {
+  position: absolute;
+  left: 10px;
+  top: 492px;
+  width: 200px;
+}
+</style>
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+<div class="layout-content-row content-header just-links">
+  <div class="layout-content-col span-9">&nbsp;</div>
+  <div class="paging-links layout-content-col span-4">
+    <a href="#" class="prev-page-link">Previous</a>
+    <a href="#" class="next-page-link">Next</a>
+  </div>
+</div>
+
+
+          
+
+<div id="landing-graphic-container">
+  <div id="text-overlay">
+    Design apps that behave in a consistent, predictable fashion.
+    <br><br>
+    <a href="../patterns/new-4-0.html" class="landing-page-link">New in Android 4.0</a>
+  </div>
+
+  <a href="../patterns/new-4-0.html">
+    <img src="../static/content/patterns_landing.png">
+  </a>
+</div>
+
+
+
+          
+
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/patterns/multi-pane-layouts.html b/docs/html/design/patterns/multi-pane-layouts.html
new file mode 100644
index 0000000..af05e31
--- /dev/null
+++ b/docs/html/design/patterns/multi-pane-layouts.html
@@ -0,0 +1,260 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Multi-pane Layouts
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Multi-pane Layouts</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<p>When writing an app for Android, keep in mind that Android devices come in many different screen
+sizes and types. Make sure that your app consistently provides a balanced and aesthetically pleasing
+layout by adjusting its content to varying screen sizes and orientations.</p>
+<p><em>Panels</em> are a great way for your app to achieve this. They allow you to combine multiple views into
+one compound view when a lot of horizontal screen real estate is available and by splitting them up
+when less space is available.</p>
+<h2>Combining Multiple Views Into One</h2>
+<p>On smaller devices your content is typically divided into a master grid or list view and a detail
+view. Touching an item in the master view opens a different screen showing that item's detail
+information.</p>
+
+<img src="../static/content/multipane_views.png">
+
+<p>Because tablets have more screen real estate than phones, you can use panels to combine the related
+list and detail views into a single compound view. This uses the additional space more efficiently
+and makes navigating the app easier. </p>
+
+<img src="../static/content/multipane_view_tablet.png">
+
+<p>In general, use the pane on the right to present more information about the item you selected in the
+left pane. Make sure to keep the item in the left pane selected in order to establish the
+relationship between the panels.</p>
+<h2>Compound Views and Orientation Changes</h2>
+<p>Screens should have the same functionality regardless of orientation. If you use a compound view in
+one orientation, don't split it up when the user rotates the screen. There are several techniques
+you can use to adjust the layout after orientation change while keeping functional parity intact.</p>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-8">
+
+    <img src="../static/content/multipane_stretch.png">
+    
+  </div>
+  <div class="layout-content-col span-5">
+
+<h4>Stretch/compress</h4>
+<p>Adjust the column width of your left pane to achieve a balanced layout in both orientations.</p>
+
+  </div>
+</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-8">
+
+    <img src="../static/content/multipane_stack.png">
+    
+  </div>
+  <div class="layout-content-col span-5">
+
+<h4>Stack</h4>
+<p>Rearrange the panels on your screen to match the orientation.</p>
+
+  </div>
+</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-8">
+
+    <img src="../static/content/multipane_expand.png">
+    
+  </div>
+  <div class="layout-content-col span-5">
+
+<h4>Expand/collapse</h4>
+<p>When the device rotates, collapse the left pane view to only show the most important information.
+Provide an <em>expand</em> control that allows the user to bring the left pane content back to its original
+width and vice versa.</p>
+
+  </div>
+</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-8">
+
+    <img src="../static/content/multipane_show.png">
+    
+  </div>
+  <div class="layout-content-col span-5">
+
+<h4>Show/hide</h4>
+<p>After rotating the device, show the right pane in fullscreen view. Use the Up icon in the action bar
+to show the left panel and allow navigation to a different email. Hide the left panel by touching
+the content in the detail panel.</p>
+
+  </div>
+</div>
+
+<h2>Checklist</h2>
+<ul>
+<li>
+<p>Plan in advance on how your app scales to different screen sizes and screen orientations.</p>
+</li>
+<li>
+<p>Identify the most appropriate method for the panels in your compound views to reorganize
+  themselves when screen orientation changes.</p>
+</li>
+<li>
+<p>Look for opportunities to consolidate your views into multi-panel compound views.</p>
+</li>
+<li>
+<p>Make sure that your screens provide functional parity after the screen orientation
+  changes.</p>
+</li>
+</ul>
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/patterns/navigation.html b/docs/html/design/patterns/navigation.html
new file mode 100644
index 0000000..cad3682
--- /dev/null
+++ b/docs/html/design/patterns/navigation.html
@@ -0,0 +1,268 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Navigation with Back and Up
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Navigation with Back and Up</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<p>Consistent navigation is an essential component of the overall user experience. Few things frustrate
+users more than basic navigation that behaves in inconsistent and unexpected ways. Android 3.0
+introduced significant changes to the global navigation behavior. Thoughtfully following the
+guidelines for Back and Up will make your app's navigation predictable and reliable for your users.</p>
+<p>Android 2.3 and earlier relied upon the system <em>Back</em> button for supporting navigation within an
+app. With the introduction of action bars in Android 3.0, a second navigation mechanism appeared:
+the <em>Up</em> button, consisting of the app icon and a left-point caret.</p>
+
+<img src="../static/content/navigation_with_back_and_up.png">
+
+<h2>Up vs. Back</h2>
+<p>The Up button is used to navigate within an application based on the hierarchical relationships
+between screens. For instance, if screen A displays a list of items, and selecting an item leads to
+screen B (which presents that item in more detail), then screen B should offer an Up button that
+returns to screen A.</p>
+<p>If a screen is the topmost one in an app (i.e. the home of the app), it should not present an Up
+button.</p>
+<p>The system Back key is used to navigate based on the history of screens the user has recently seen,
+in reverse chronological order&mdash;in effect, the temporal relationships between screens.</p>
+<p>When the previously viewed screen is also the hierarchical parent of the current screen, pressing
+the Back key will have the same result as pressing an Up button -- this is a common occurrence.
+However, unlike the Up button, which ensures the user remains within your app, the Back key can
+return the user to the Home screen, or even to a different application.</p>
+
+<img src="../static/content/navigation_up_vs_back_gmail.png">
+
+<p>The Back key also supports a few behaviors not directly tied to screen-to-screen navigation:</p>
+<ul>
+<li>Back dismisses floating windows (dialogs, popups)</li>
+<li>Back dismisses contextual action bars, and removes the highlight from the selected items</li>
+<li>Back hides the onscreen keyboard (IME)</li>
+</ul>
+<h2>Navigation Within Your App</h2>
+<h4>Navigating to screens with multiple entry points</h4>
+<p>Sometimes a screen doesn't have a strict position within the app's hierarchy, and can be reached
+from multiple entry points&mdash;e.g., a settings screen which can be navigated to from any screen
+in your app. In this case, the Up button should choose to return to the referring screen, behaving
+identically to Back.</p>
+<h4>Changing view within a screen</h4>
+<p>Changing view options for a screen does not change the behavior of Up or Back: the screen is still
+in the same place within the app's hierarchy, and no new navigation history is created.</p>
+<p>Examples of such view changes are:</p>
+<ul>
+<li>Switching views using tabs and/or left-and-right swipes</li>
+<li>Switching views using a dropdown (aka collapsed tabs)</li>
+<li>Filtering a list</li>
+<li>Sorting a list</li>
+<li>Changing display characteristics (e.g. zooming)</li>
+</ul>
+<h4>Navigating between sibling screens</h4>
+<p>When your app supports navigation from a list of items to a detail view of one of those items, it's
+often desirable to support direction navigation from that item to another one which precedes or
+follows it in the list. For example, in Gmail, it's easy to swipe left or right from a conversation
+to view a newer or older one in the same Inbox. Just as when changing view within a screen, such
+navigation does not change the behavior of Up or Back.</p>
+
+<img src="../static/content/navigation_between_siblings_gmail.png">
+
+<p>However, a notable exception to this occurs when browsing between "related" detail views not tied
+together by the referring list&mdash;for example, when browsing in the Market between apps from
+the same developer, or albums by the same artist. In these cases, following each link does create
+history, causing the Back button to step through each screen of related content which has been
+viewed. Up should continue to bypass these related screens and navigate to the most recently viewed
+container screen.</p>
+
+<img src="../static/content/navigation_between_siblings_market1.png">
+
+<p>You have the ability to make the Up behavior even smarter based on your knowledge of detail
+view. If we extend our Market sample from above, imagine the user has navigated from the last Book
+viewed to the details for the Movie adaptation. In that case, Up can return to a container (Movies)
+which the user had not previously navigated through.</p>
+
+<img src="../static/content/navigation_between_siblings_market2.png">
+
+<h2>Navigation From Outside Your App</h2>
+<p>There are two categories of navigation from outside your app to screens deep within the app's
+hierarchy:</p>
+<ul>
+<li>App-to-app navigation, such as via intent completion.</li>
+<li>System-to-app navigation, such as via notifications and home screen widgets.</li>
+</ul>
+<p>Gmail provides examples of each of these. For app-to-app navigation, a "Share" intent goes directly
+to the compose screen. For system-to-app navigation, both a new message notification and a home
+screen widget can bypass the Inbox screen, taking the user directly to a conversation view.</p>
+<h4>App-to-app navigation</h4>
+<p>When navigating deep into your app's hierarchy directly from another app via an intent, Back will
+return to the referring app.</p>
+<p>The Up button is handled as follows:
+- If the destination screen is typically reached from one particular screen within your app, Up
+  should navigate to that screen.
+- Otherwise, Up should navigate to the topmost ("Home") screen of your app.</p>
+<p>For example, after choosing to share a book being viewed in Market, the user navigates directly to
+Gmail's compose screen. From there, Up returns to the Inbox (which happens to be both the
+typical referrer to compose, as well as the topmost screen of the app), while Back returns to
+Market.</p>
+
+<img src="../static/content/navigation_from_outside_up.png">
+
+<h4>System-to-app navigation</h4>
+<p>If your app was reached via the system mechanisms of notifications or home screen widgets, Up
+behaves as described for app-to-app navigation, above.</p>
+<p>For the Back key, you should make navigation more predictably by inserting into the task's back
+stack the complete upward navigation path to the app's topmost screen. This way, a user who has
+forgotten how they entered your app can safely navigate to the app's topmost screen before exiting
+it.</p>
+<p>For example, Gmail's Home screen widget has a button for diving directly to its compose screen.
+After following that path, the Back key first returns to the Inbox, and from there continues to
+Home.</p>
+
+<img src="../static/content/navigation_from_outside_back.png">
+
+
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/patterns/new-4-0.html b/docs/html/design/patterns/new-4-0.html
new file mode 100644
index 0000000..272b079
--- /dev/null
+++ b/docs/html/design/patterns/new-4-0.html
@@ -0,0 +1,224 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - New in Android 4.0
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>New in Android 4.0</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+<h4>Navigation bar</h4>
+<p>Android 4.0 removes the need for traditional hardware keys on phones by replacing them with a
+virtual navigation bar that houses the Back, Home and Recents buttons. Read the
+<a href="../patterns/compatibility.html">Compatibility</a> pattern to learn how the OS adapts to
+phones with hardware buttons and how pre-Android 3.0 apps that rely on menu keys are supported.</p>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/whats_new_nav_bar.png">
+
+  </div>
+</div>
+
+<div class="vspace size-2">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+<h4>Action bar</h4>
+<p>The action bar is the most important structural element of an Android app. It provides consistent
+navigation across the platform and allows your app to surface actions.</p>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/whats_new_action_bar.png">
+
+  </div>
+</div>
+
+<div class="vspace size-2">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+<h4>Multi-pane layouts</h4>
+<p>Creating apps that scale well across different form factors and screen sizes is important in the
+Android world. Multi-pane layouts allow you to combine different activities that show separately on
+smaller devices into richer compound views for tablets.</p>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/whats_new_multipanel.png">
+
+  </div>
+</div>
+
+<div class="vspace size-2">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+<h4>Selection</h4>
+<p>The long press gesture which was traditionally used to show contextual actions for objects is now
+used for data selection. When selecting data, contextual action bars allow you to surface actions.</p>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/whats_new_multiselect.png">
+
+  </div>
+</div>
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/patterns/notifications.html b/docs/html/design/patterns/notifications.html
new file mode 100644
index 0000000..c5045aed
--- /dev/null
+++ b/docs/html/design/patterns/notifications.html
@@ -0,0 +1,390 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Notifications
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Notifications</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<p>The notification system allows your app to keep the user informed about important events, such as
+new messages in a chat app or a calendar event.</p>
+<p>To create an app that feels streamlined, pleasant, and respectful, it is important to design your
+notifications carefully. Notifications embody your app's voice, and contribute to your app's
+personality. Unwanted or unimportant notifications can annoy the user, so use them judiciously.</p>
+<h4>When to display a notification</h4>
+<p>To create an application that people love, it's important to recognize that the user's attention and
+focus is a resource that must be protected. To use an analogy that might resonate with software
+developers, the user is not a method that can be invoked to return a value.  The user's focus is a
+resource more akin to a thread, and creating a notification momentarily blocks the user thread as
+they process and then dismiss the interruptive notification.</p>
+<p>Android's notification system has been designed to quickly inform users of events while they focus
+on a task, but it is nonetheless still important to be conscientious when deciding to create a
+notification.</p>
+<p>While well behaved apps generally only speak when spoken to, there are some limited cases where an
+app actually should interrupt the user with an unprompted notification.</p>
+<p>Notifications should be used primarily for <strong>time sensitive events</strong>, and especially if these
+synchronous events <strong>involve other people</strong>. For instance, an incoming chat is a real time and
+synchronous form of communication: there is another user actively waiting on you to respond.
+Calendar events are another good example of when to use a notification and grab the user's
+attention, because the event is imminent, and calendar events often involve other people.</p>
+
+<img src="../static/content/notifications_pattern_real_time_people.png">
+
+<div class="vspace size-2">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+<h4>When not to display a notification</h4>
+<p>There are however many other cases where notifications should not be used:</p>
+<ul>
+<li>
+<p>Don't notify the user of information that is not directed specifically at them, or information
+that is not truly time sensitive.  For instance the asynchronous and undirected updates flowing
+through a social network do not warrant a real time interruption.</p>
+</li>
+<li>
+<p>Don't create a notification if the relevant new information is currently on screen. Instead, use
+the UI of the application itself to notify the user of new information directly in context. For
+instance, a chat application should not create system notifications while the user is actively
+chatting with another user.</p>
+</li>
+<li>
+<p>Don't interrupt the user for low level technical operations, like saving or syncing information,
+or updating an application, if it is possible for the system to simply take care of itself without
+involving the user.</p>
+</li>
+<li>
+<p>Don't interrupt the user to inform them of an error if it is possible for the application to
+quickly recover from the error on its own without the user taking any action.</p>
+</li>
+<li>
+<p>Don't use notifications for services that the user cannot manually start or stop.</p>
+</li>
+<li>
+<p>Don't create superfluous notifications just to get your brand in front of users. Such
+notifications will only frustrate and likely alienate your audience. The best way to provide the
+user with a small amount of updated information and to keep them engaged with your application is to
+develop a widget that they can choose to place on their home screen.</p>
+</li>
+</ul>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/notifications_pattern_social_fail.png">
+
+  </div>
+</div>
+
+<h2>Design Guidelines</h2>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/notifications_pattern_anatomy.png">
+
+  </div>
+  <div class="layout-content-col span-6">
+
+<h4>Make it personal</h4>
+<p>For notifications of items sent by another user (such as a message or status update), include that
+person's image.</p>
+<p>Remember to include the app icon as a secondary icon in the notification, so that the user can
+still identify which app posted it.</p>    
+
+  </div>
+</div>
+
+<h4>Navigate to the right place</h4>
+<p>When the user touches a notification, be open your app to the place where the user can consume and
+act upon the data referenced in the notification. In most cases this will be the detail view of a
+single data item (e.g. a message), but it might also be a summary view if the notification is
+stacked (see <em>Stacked notifications</em> below) and references multiple items. If in any of those cases
+the user is taken to a hierarchy level below your app's top-level, insert navigation into your app's
+back stack to allow them to navigate to your app's top level using the system back key. For more
+information, see the chapter on <em>System-to-app navigation</em> in the
+<a href="../patterns/navigation.html">Navigation</a> design pattern.</p>
+<h4>Timestamps for time sensitive events</h4>
+<p>By default, standard Android notifications include a timestamp in the upper right corner. Consider
+whether the timestamp is valuable in the context of your notification. If the timestamp is not
+valuable, consider if the event is important enough to warrant grabbing the user's attention with a
+notification. If the notification is important enough, decide if you would like to opt out of
+displaying the timestamp.</p>
+<p>Include a timestamp if the user likely needs to know how long ago the notification occurred. Good
+candidates for timestamps include communication notifications (email, messaging, chat, voicemail)
+where the user may need the timestamp information to understand the context of a message or to
+tailor a response.</p>
+<h4>Stack your notifications</h4>
+<p>If your app creates a notification while another of the same type is still pending, avoid creating
+an altogether new notification object. Instead, stack the notification.</p>
+<p>A stacked notification builds a summary description and allows the user to understand how many
+notifications of a particular kind are pending.</p>
+<p><strong>Don't</strong>:</p>
+
+<img src="../static/content/notifications_pattern_additional_fail.png">
+
+<p><strong>Do</strong>:</p>
+
+<img src="../static/content/notifications_pattern_additional_win.png">
+
+<p>If you keep the summary and detail information on different screens, a stacked notification may need
+to open to a different place in the app than a single notification.</p>
+<p>For example, a single email notification should always open to the content of the email, whereas a
+stacked email notification opens to the Inbox view.</p>
+<h4>Clean up after yourself</h4>
+<p>Just like calendar events, some notifications alert the user to an event that happens at a
+particular point in time. After that moment has passed, the notification is likely not important to
+the user anymore, and you should consider removing it automatically.  The same is true for active
+chat conversations or voicemail messages the user has listened to, users should not have to manually
+dismiss notifications independently from taking action on them.</p>
+
+<div class="vspace size-1">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-7">
+
+<h4>Provide a peek into your notification</h4>
+<p>You can provide a short preview of your notification's content by providing optional ticker text.
+The ticker text is shown for a short amount of time when the notification enters the system and then
+hides automatically.</p>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/notifications_pattern_phone_ticker.png">
+
+  </div>
+</div>
+
+<h4>Make notifications optional</h4>
+<p>Users should always be in control of notifications. Allow the user to silence the notifications from
+your app by adding a notification settings item to your application settings.</p>
+<h4>Use distinct icons</h4>
+<p>By glancing at the notification area, the user should be able to discern what notification types are
+currently pending.</p>
+<p><strong>Do</strong>:</p>
+<ul>
+<li>Look at the notification icons the Android apps already provide and create notification icons for
+  your app that are sufficiently distinct in appearance.</li>
+</ul>
+<p><strong>Don't</strong>:</p>
+<ul>
+<li>Use color to distinguish your app from others. Notification icons should generally be monochrome.</li>
+</ul>
+
+<h2>Interacting With Notifications</h2>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/notifications_pattern_phone_icons.png">
+
+  </div>
+  <div class="layout-content-col span-6">
+
+<p>Notifications are indicated by icons in the notification area and can be accessed by opening the
+notification drawer.</p>
+<p>Inside the drawer, notifications are chronologically sorted with the latest one on top. Touching a
+notification opens the associated app to detailed content matching the notification. Swiping left or
+right on a notification removes it from the drawer.</p>
+
+  </div>
+</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6">
+
+<p>On tablets, the notification area is integrated with the system bar at the bottom of the screen. The
+notification drawer is opened by touching anywhere inside the notification area.</p>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/notifications_pattern_tablet.png">
+
+  </div>
+</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/notifications_pattern_ongoing_music.png">
+
+  </div>
+  <div class="layout-content-col span-6">
+
+<h4>Ongoing notifications</h4>
+<p>Ongoing notifications keep users informed about an ongoing process in the background. For example,
+music players announce the currently playing track in the notification system and continue to do so
+until the user stops the playback. They can also be used to show the user feedback for longer tasks
+like downloading a file, or encoding a video. Ongoing notifications cannot be manually removed from
+the notification drawer.</p>
+
+  </div>
+</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-12">
+
+<h4>Dialogs and toasts are for feedback not notification</h4>
+<p>Your app should not create a dialog or toast if it is not currently on screen. Dialogs and Toasts
+should only be displayed as the immediate response to the user taking an action inside of your app.
+For instance, dialogs can be used to confirm that the user understands the severity of an action,
+and toasts can echo back that an action has been successfully taken.</p>
+
+  </div>
+</div>
+
+<div class="vspace size-1">&nbsp;</div>
+
+<img src="../static/content/notifications_pattern_dialog_toast.png">
+
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/patterns/pure-android.html b/docs/html/design/patterns/pure-android.html
new file mode 100644
index 0000000..507558a
--- /dev/null
+++ b/docs/html/design/patterns/pure-android.html
@@ -0,0 +1,288 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Pure Android
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Pure Android</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<p>Most developers want to distribute their apps on multiple platforms. As you plan your app for
+Android, keep in mind that different platforms play by different rules and conventions. Design
+decisions that make perfect sense on one platform will look and feel misplaced in the context of a
+different platform. While a "design once, ship anywhere" approach might save you time up-front, you
+run the very real risk of creating inconsistent apps that alienate users. Consider the following
+guidelines to avoid the most common traps and pitfalls.</p>
+
+<div class="vspace size-1">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-5">
+
+<h4>Don't mimic UI elements from other platforms</h4>
+<p>Platforms typically provide a carefully designed set of UI elements that are themed in a very
+distinctive fashion. For example, some platforms advocate rounded corners for their buttons, others
+use gradients in their title bars. In some cases, elements may have the same purpose, but are
+designed to work a bit differently.</p>
+<p>As you build your app for Android, don't carry over themed UI elements from other platforms and
+don't mimic their specific behaviors. Review the <a href="../building-
+blocks/index.html">Building Blocks</a> section in this styleguide to learn about Android's most important UI elements
+and the way they look in the system default themes. Also examine Android's platform apps to get a
+sense of how elements are applied in the context of an app. If you want to customize the theme of UI
+elements, customize carefully according to your specific branding - and not according to the
+conventions of a different platform.</p>
+
+  </div>
+  <div class="layout-content-col span-8">
+
+    <img src="../static/content/migrating_ui_elements.png">
+    <div class="figure-caption">
+      Sampling of UI elements from Android, iOS and Windows Phone 7.
+    </div>
+
+  </div>
+</div>
+
+<div class="vspace size-2">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-5">
+
+<h4>Don't carry over platform-specific icons</h4>
+<p>Platforms typically provide sets of icons for common functionality, such as sharing, creating a new
+document or deleting.</p>
+<p>As you are migrating your app to Android, please swap out platform-specific icons with their Android
+counterparts.</p>
+<p>You can find a wide variety of icons for use in your app in the Android SDK.</p>
+
+  </div>
+  <div class="layout-content-col span-8">
+
+    <img src="../static/content/migrating_icons.png">
+    <div class="figure-caption">
+      Sampling of icons from Android, iOS and Windows Phone 7.
+    </div>
+
+  </div>
+</div>
+
+<div class="vspace size-2">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-5">
+
+<h4>Don't use bottom tab bars</h4>
+<p>Other platforms use the bottom tab bar to switch between the app's views. Per platform convention,
+Android's tabs for view control are shown in action bars at the top of the screen instead. In
+addition, Android apps may use a bottom bar to display actions on a split action bar.</p>
+<p>You should follow this guideline to create a consistent experience with other apps on the Android
+platform and to avoid confusion between actions and view switching on Android.</p>
+<p>For more information on how to properly use action bars for view control, see
+<a href="../patterns/actionbar.html">Action Bars</a>.</p>
+
+  </div>
+  <div class="layout-content-col span-8">
+
+    <img src="../static/content/migrating_ios_dialers.png">
+    <div class="figure-caption">
+      Android dialer with tabs in an action bar vs. bottom tabs in iOS.
+    </div>
+
+  </div>
+</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-5">
+
+<h4>Don't use labeled back buttons on action bars</h4>
+<p>Other platforms use an explicit back button with label to allow the user to navigate up the
+application's hierarchy. Instead, Android uses the main action bar's app icon for hierarchical
+navigation and the navigation bar's back button for temporal navigation. For more information,
+please review the <a href="../patterns/navigation.html">Navigation</a> pattern.</p>
+<p>Follow this guideline to provide a consistent navigation experience across the platform.</p>
+
+  </div>
+  <div class="layout-content-col span-8">
+
+    <img src="../static/content/migrating_ios_galleries.png">
+    <div class="figure-caption">
+      Android action bar with up caret vs. iOS labeled "Back" button.
+    </div>
+
+  </div>
+</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-5">
+
+<h4>Don't use right-pointing carets on line items</h4>
+<p>A common pattern on other platforms is the display of right-pointing carets on line items that allow
+the user to drill deeper into additional content.</p>
+<p>Android does not use such indicators on drill-down line items. Avoid them to stay consistent with
+the platform and in order to not have the user guess as to what the meaning of those carets may be.</p>
+
+  </div>
+  <div class="layout-content-col span-8">
+
+    <img src="../static/content/migrating_ios_settings.png">
+    <div class="figure-caption">
+      Android settings without right-pointing carets in line items vs. iOS settings.
+    </div>
+
+  </div>
+</div>
+
+<h2>Device Independence</h2>
+
+<p>Remember that your app will run on a wide variety of different screen sizes. Create visual assets
+for different screen sizes and densities and make use of concepts such as multi-pane layouts to
+appropriately scale your UI on different device form factors.</p>
+<p>For more information, read <a href="../style/devices-displays.html">Devices and Displays</a> as
+well as <a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a> in this design guide.</p>
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/patterns/selection.html b/docs/html/design/patterns/selection.html
new file mode 100644
index 0000000..37dcab5
--- /dev/null
+++ b/docs/html/design/patterns/selection.html
@@ -0,0 +1,252 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Selection
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Selection</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<p>Android 3.0 introduced the <em>long press</em> gesture&mdash;that is, a touch that's held in the same
+position for a moment&mdash;as the global gesture to select data. This affects the way you should
+handle multi-select and contextual actions in your apps.</p>
+
+<div class="vspace size-1">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6">
+
+<h4>What has changed?</h4>
+<p>In previous versions of Android, the long press gesture was universally used to display contextual
+actions for a given data item in a contextual menu.</p>
+<p>This pattern changed with Android 3.0. The long press gesture is now used to select data, combining
+contextual actions and selection management functions for selected data into a new element called
+the contextual action bar (CAB).</p>
+
+  </div>
+  <div class="layout-content-col span-7">
+
+    <img src="../static/content/selection_context_menu.png">
+    <div class="figure-caption">
+      Traditional use of the long press gesture to show contextual menus.
+    </div>
+
+  </div>
+</div>
+
+<h4>Using the contextual action bar (CAB)</h4>
+<p>The selection CAB is a temporary action bar that overlays your app's current action bar while data
+is selected. It appears after the user long presses on a selectable data item.</p>
+
+<img src="../static/content/selection_cab_big.png">
+
+<div class="vspace size-1">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6">
+
+<p>From here the user can:</p>
+<ul>
+<li>Select additional data items by touching them.</li>
+<li>Trigger an action from the CAB that applies to all highlighted data items. The CAB then
+  automatically dismisses itself.</li>
+<li>Dismiss the CAB via the navigation bar's Back button or the CAB's checkmark button. This removes
+  the CAB along with all selection highlights.</li>
+</ul>
+
+  </div>
+  <div class="layout-content-col span-7">
+
+    <img src="../static/content/selection_cab_example.png">
+
+  </div>
+</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6">
+
+<h4>Selecting CAB actions</h4>
+<p>You can decide which actions and elements appear in the CAB. Use the guidelines in the <a href="actionbar.html">Action Bar
+pattern</a> to decide which items to surface at the top level and which to move to the
+action overflow.</p>
+<h4>Dynamically adjust CAB actions</h4>
+<p>In most cases you need to adjust the actions in the CAB dynamically as the user adds more items to
+the selection. Actions that apply to a single selected data item don't necessarily apply to multiple
+selected data items of the same kind.</p>
+
+  </div>
+  <div class="layout-content-col span-7">
+
+    <img src="../static/content/selection_adjusting_actions.png">
+    <div class="figure-caption">
+      Adjusting actions in the CAB as additional items are selected.
+    </div>
+
+  </div>
+</div>
+
+<h2>Checklist</h2>
+<ul>
+<li>
+<p>Whenever your app supports the selection of multiple data items, make use of the contextual action
+  bar (CAB).</p>
+</li>
+<li>
+<p>Reserve the long press gesture for selection exclusively. Don't use it to display traditional
+  contextual menus.</p>
+</li>
+<li>
+<p>If you don't support multi-selection within a list, long press should do nothing.</p>
+</li>
+<li>
+<p>Plan the actions you want to display inside of a CAB in the same way you would plan the actions
+  inside your app's action bar.</p>
+</li>
+</ul>
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/patterns/swipe-views.html b/docs/html/design/patterns/swipe-views.html
new file mode 100644
index 0000000..4e8cd03
--- /dev/null
+++ b/docs/html/design/patterns/swipe-views.html
@@ -0,0 +1,225 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Swipe Views
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Swipe Views</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<p>Efficient navigation is one of the cornerstones of a well-designed app. While apps are generally
+built in a hierarchical fashion, there are instances where horizontal navigation can flatten
+vertical hierarchies and make access to related data items faster and more enjoyable. Swipe views
+allow the user to efficiently move from item to item using a simple gesture and thereby make
+browsing and consuming data a more fluent experience.</p>
+<h2>Swiping Between Detail Views</h2>
+<p>An app's data is often organized in a master/detail relationship: The user can view a list of
+related data items, such as images, chats, or emails, and then pick one of the items to see the
+detail contents in a separate screen.</p>
+
+<img src="../static/content/swipe_views.png">
+<div class="figure-caption">
+  Master (left) and detail (right) views.
+</div>
+
+<p>On a phone, since the master and detail are on separate screens, this typically requires the user to
+jump back and forth between the list and the detail view, aka "pogo-sticking".</p>
+<p>In cases where users will want to view multiple detail items in succession, avoid pogo-sticking by
+using the swipe gesture to navigate to the next/previous detail view.</p>
+
+<img src="../static/content/swipe_views2.png">
+<div class="figure-caption">
+  Navigating between consecutive Email messages using the swipe gesture.
+</div>
+
+<h2>Swiping Between Tabs</h2>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-5">
+
+    <div class="framed-galaxynexus-port-span-5">
+      <video class="play-on-hover" autoplay>
+        <source src="../static/content/swipe_tabs.mp4" type="video/mp4">
+        <source src="../static/content/swipe_tabs.webm" type="video/webm">
+        <source src="../static/content/swipe_tabs.ogv" type="video/ogg">
+      </video>
+    </div>
+    <div class="figure-caption">
+      People app with swipe gesture navigation between top-level screens.
+      <div class="video-instructions">&nbsp;</div>
+    </div>
+
+  </div>
+  <div class="layout-content-col span-8">
+
+<p>If your app uses action bar tabs, use swipe to navigate between the different views.</p>
+<div class="vspace size-2">&nbsp;</div>
+
+<h2>Checklist</h2>
+<ul>
+<li>
+<p>Use swipe to quickly navigate between detail views or tabs.</p>
+</li>
+<li>
+<p>Transition between the views as the user performs the swipe gesture. Do not wait for the
+  gesture to complete and then transition between views.</p>
+</li>
+<li>
+<p>If you used buttons in the past for previous/next navigation, replace them with
+  the swipe gesture.</p>
+</li>
+<li>
+<p>Consider adding contextual information in your detail view that informs the user about the
+  relative list position of the currently visible item.</p>
+</li>
+</ul>
+
+  </div>
+</div>
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/static/callout.png b/docs/html/design/static/callout.png
new file mode 100644
index 0000000..5d49f34
--- /dev/null
+++ b/docs/html/design/static/callout.png
Binary files differ
diff --git a/docs/html/design/static/content/action_bar_basics.png b/docs/html/design/static/content/action_bar_basics.png
new file mode 100644
index 0000000..0bf3d56
--- /dev/null
+++ b/docs/html/design/static/content/action_bar_basics.png
Binary files differ
diff --git a/docs/html/design/static/content/action_bar_cab.png b/docs/html/design/static/content/action_bar_cab.png
new file mode 100644
index 0000000..aa629b9
--- /dev/null
+++ b/docs/html/design/static/content/action_bar_cab.png
Binary files differ
diff --git a/docs/html/design/static/content/action_bar_pattern_action_icons.png b/docs/html/design/static/content/action_bar_pattern_action_icons.png
new file mode 100644
index 0000000..66f7f87
--- /dev/null
+++ b/docs/html/design/static/content/action_bar_pattern_action_icons.png
Binary files differ
diff --git a/docs/html/design/static/content/action_bar_pattern_considerations.png b/docs/html/design/static/content/action_bar_pattern_considerations.png
new file mode 100644
index 0000000..977e7f2
--- /dev/null
+++ b/docs/html/design/static/content/action_bar_pattern_considerations.png
Binary files differ
diff --git a/docs/html/design/static/content/action_bar_pattern_default_tabs.png b/docs/html/design/static/content/action_bar_pattern_default_tabs.png
new file mode 100644
index 0000000..69df289
--- /dev/null
+++ b/docs/html/design/static/content/action_bar_pattern_default_tabs.png
Binary files differ
diff --git a/docs/html/design/static/content/action_bar_pattern_overflow.png b/docs/html/design/static/content/action_bar_pattern_overflow.png
new file mode 100644
index 0000000..9c69cfe
--- /dev/null
+++ b/docs/html/design/static/content/action_bar_pattern_overflow.png
Binary files differ
diff --git a/docs/html/design/static/content/action_bar_pattern_overview.png b/docs/html/design/static/content/action_bar_pattern_overview.png
new file mode 100644
index 0000000..83a986b
--- /dev/null
+++ b/docs/html/design/static/content/action_bar_pattern_overview.png
Binary files differ
diff --git a/docs/html/design/static/content/action_bar_pattern_rotation.png b/docs/html/design/static/content/action_bar_pattern_rotation.png
new file mode 100644
index 0000000..5b9a656
--- /dev/null
+++ b/docs/html/design/static/content/action_bar_pattern_rotation.png
Binary files differ
diff --git a/docs/html/design/static/content/action_bar_pattern_share_pack.png b/docs/html/design/static/content/action_bar_pattern_share_pack.png
new file mode 100644
index 0000000..7ae8a0a
--- /dev/null
+++ b/docs/html/design/static/content/action_bar_pattern_share_pack.png
Binary files differ
diff --git a/docs/html/design/static/content/action_bar_pattern_spinner.png b/docs/html/design/static/content/action_bar_pattern_spinner.png
new file mode 100644
index 0000000..9c054b5
--- /dev/null
+++ b/docs/html/design/static/content/action_bar_pattern_spinner.png
Binary files differ
diff --git a/docs/html/design/static/content/action_bar_pattern_table.png b/docs/html/design/static/content/action_bar_pattern_table.png
new file mode 100644
index 0000000..dac7e21
--- /dev/null
+++ b/docs/html/design/static/content/action_bar_pattern_table.png
Binary files differ
diff --git a/docs/html/design/static/content/action_bar_pattern_up_app_icon.png b/docs/html/design/static/content/action_bar_pattern_up_app_icon.png
new file mode 100644
index 0000000..11b8aa9
--- /dev/null
+++ b/docs/html/design/static/content/action_bar_pattern_up_app_icon.png
Binary files differ
diff --git a/docs/html/design/static/content/app_structure_book_detail_page_flip.png b/docs/html/design/static/content/app_structure_book_detail_page_flip.png
new file mode 100644
index 0000000..13c9c52
--- /dev/null
+++ b/docs/html/design/static/content/app_structure_book_detail_page_flip.png
Binary files differ
diff --git a/docs/html/design/static/content/app_structure_fixedtabs.png b/docs/html/design/static/content/app_structure_fixedtabs.png
new file mode 100644
index 0000000..e41f97e
--- /dev/null
+++ b/docs/html/design/static/content/app_structure_fixedtabs.png
Binary files differ
diff --git a/docs/html/design/static/content/app_structure_gallery_filmstrip.png b/docs/html/design/static/content/app_structure_gallery_filmstrip.png
new file mode 100644
index 0000000..deed672
--- /dev/null
+++ b/docs/html/design/static/content/app_structure_gallery_filmstrip.png
Binary files differ
diff --git a/docs/html/design/static/content/app_structure_gmail.png b/docs/html/design/static/content/app_structure_gmail.png
new file mode 100644
index 0000000..862ac75
--- /dev/null
+++ b/docs/html/design/static/content/app_structure_gmail.png
Binary files differ
diff --git a/docs/html/design/static/content/app_structure_gmail_swipe.png b/docs/html/design/static/content/app_structure_gmail_swipe.png
new file mode 100644
index 0000000..21da4ac
--- /dev/null
+++ b/docs/html/design/static/content/app_structure_gmail_swipe.png
Binary files differ
diff --git a/docs/html/design/static/content/app_structure_market.png b/docs/html/design/static/content/app_structure_market.png
new file mode 100644
index 0000000..3b0b786
--- /dev/null
+++ b/docs/html/design/static/content/app_structure_market.png
Binary files differ
diff --git a/docs/html/design/static/content/app_structure_music_lndscp.png b/docs/html/design/static/content/app_structure_music_lndscp.png
new file mode 100644
index 0000000..0dd400c
--- /dev/null
+++ b/docs/html/design/static/content/app_structure_music_lndscp.png
Binary files differ
diff --git a/docs/html/design/static/content/app_structure_overview.png b/docs/html/design/static/content/app_structure_overview.png
new file mode 100644
index 0000000..5ba25b4
--- /dev/null
+++ b/docs/html/design/static/content/app_structure_overview.png
Binary files differ
diff --git a/docs/html/design/static/content/app_structure_people_detail.png b/docs/html/design/static/content/app_structure_people_detail.png
new file mode 100644
index 0000000..b870796
--- /dev/null
+++ b/docs/html/design/static/content/app_structure_people_detail.png
Binary files differ
diff --git a/docs/html/design/static/content/app_structure_scrolltabs.png b/docs/html/design/static/content/app_structure_scrolltabs.png
new file mode 100644
index 0000000..ef4fca4
--- /dev/null
+++ b/docs/html/design/static/content/app_structure_scrolltabs.png
Binary files differ
diff --git a/docs/html/design/static/content/app_structure_shortcut_on_item.png b/docs/html/design/static/content/app_structure_shortcut_on_item.png
new file mode 100644
index 0000000..3874e1d4
--- /dev/null
+++ b/docs/html/design/static/content/app_structure_shortcut_on_item.png
Binary files differ
diff --git a/docs/html/design/static/content/building_blocks_landing.png b/docs/html/design/static/content/building_blocks_landing.png
new file mode 100644
index 0000000..2da47b7
--- /dev/null
+++ b/docs/html/design/static/content/building_blocks_landing.png
Binary files differ
diff --git a/docs/html/design/static/content/buttons_basic.png b/docs/html/design/static/content/buttons_basic.png
new file mode 100644
index 0000000..7fa3d09
--- /dev/null
+++ b/docs/html/design/static/content/buttons_basic.png
Binary files differ
diff --git a/docs/html/design/static/content/buttons_borderless.png b/docs/html/design/static/content/buttons_borderless.png
new file mode 100644
index 0000000..1a9d906
--- /dev/null
+++ b/docs/html/design/static/content/buttons_borderless.png
Binary files differ
diff --git a/docs/html/design/static/content/buttons_default_small.png b/docs/html/design/static/content/buttons_default_small.png
new file mode 100644
index 0000000..3e776ed
--- /dev/null
+++ b/docs/html/design/static/content/buttons_default_small.png
Binary files differ
diff --git a/docs/html/design/static/content/color_spectrum.png b/docs/html/design/static/content/color_spectrum.png
new file mode 100644
index 0000000..3fd7a57
--- /dev/null
+++ b/docs/html/design/static/content/color_spectrum.png
Binary files differ
diff --git a/docs/html/design/static/content/compatibility_legacy_apps.png b/docs/html/design/static/content/compatibility_legacy_apps.png
new file mode 100644
index 0000000..a0400e1
--- /dev/null
+++ b/docs/html/design/static/content/compatibility_legacy_apps.png
Binary files differ
diff --git a/docs/html/design/static/content/compatibility_physical_buttons.png b/docs/html/design/static/content/compatibility_physical_buttons.png
new file mode 100644
index 0000000..30d5ddd
--- /dev/null
+++ b/docs/html/design/static/content/compatibility_physical_buttons.png
Binary files differ
diff --git a/docs/html/design/static/content/compatibility_virtual_nav.png b/docs/html/design/static/content/compatibility_virtual_nav.png
new file mode 100644
index 0000000..ea595a4
--- /dev/null
+++ b/docs/html/design/static/content/compatibility_virtual_nav.png
Binary files differ
diff --git a/docs/html/design/static/content/creative_vision_main.png b/docs/html/design/static/content/creative_vision_main.png
new file mode 100644
index 0000000..c9d31cb
--- /dev/null
+++ b/docs/html/design/static/content/creative_vision_main.png
Binary files differ
diff --git a/docs/html/design/static/content/design_elements_landing.png b/docs/html/design/static/content/design_elements_landing.png
new file mode 100644
index 0000000..d078cef
--- /dev/null
+++ b/docs/html/design/static/content/design_elements_landing.png
Binary files differ
diff --git a/docs/html/design/static/content/devices_displays_density.png b/docs/html/design/static/content/devices_displays_density.png
new file mode 100644
index 0000000..a21b482
--- /dev/null
+++ b/docs/html/design/static/content/devices_displays_density.png
Binary files differ
diff --git a/docs/html/design/static/content/devices_displays_main.png b/docs/html/design/static/content/devices_displays_main.png
new file mode 100644
index 0000000..fd1c645
--- /dev/null
+++ b/docs/html/design/static/content/devices_displays_main.png
Binary files differ
diff --git a/docs/html/design/static/content/dialogs_examples.png b/docs/html/design/static/content/dialogs_examples.png
new file mode 100644
index 0000000..981c5f3
--- /dev/null
+++ b/docs/html/design/static/content/dialogs_examples.png
Binary files differ
diff --git a/docs/html/design/static/content/dialogs_main.png b/docs/html/design/static/content/dialogs_main.png
new file mode 100644
index 0000000..b95266a
--- /dev/null
+++ b/docs/html/design/static/content/dialogs_main.png
Binary files differ
diff --git a/docs/html/design/static/content/dialogs_popups_example.png b/docs/html/design/static/content/dialogs_popups_example.png
new file mode 100644
index 0000000..c2a66f6
--- /dev/null
+++ b/docs/html/design/static/content/dialogs_popups_example.png
Binary files differ
diff --git a/docs/html/design/static/content/dialogs_toasts.png b/docs/html/design/static/content/dialogs_toasts.png
new file mode 100644
index 0000000..cc0b815
--- /dev/null
+++ b/docs/html/design/static/content/dialogs_toasts.png
Binary files differ
diff --git a/docs/html/design/static/content/dialogs_w_no_title.png b/docs/html/design/static/content/dialogs_w_no_title.png
new file mode 100644
index 0000000..47e2dbf
--- /dev/null
+++ b/docs/html/design/static/content/dialogs_w_no_title.png
Binary files differ
diff --git a/docs/html/design/static/content/dialogs_w_title.png b/docs/html/design/static/content/dialogs_w_title.png
new file mode 100644
index 0000000..4f2b81f
--- /dev/null
+++ b/docs/html/design/static/content/dialogs_w_title.png
Binary files differ
diff --git a/docs/html/design/static/content/gesture_doubletouch.png b/docs/html/design/static/content/gesture_doubletouch.png
new file mode 100644
index 0000000..693a593
--- /dev/null
+++ b/docs/html/design/static/content/gesture_doubletouch.png
Binary files differ
diff --git a/docs/html/design/static/content/gesture_drag.png b/docs/html/design/static/content/gesture_drag.png
new file mode 100644
index 0000000..6262644
--- /dev/null
+++ b/docs/html/design/static/content/gesture_drag.png
Binary files differ
diff --git a/docs/html/design/static/content/gesture_longtouch.png b/docs/html/design/static/content/gesture_longtouch.png
new file mode 100644
index 0000000..3eb3cbc
--- /dev/null
+++ b/docs/html/design/static/content/gesture_longtouch.png
Binary files differ
diff --git a/docs/html/design/static/content/gesture_pinchclose.png b/docs/html/design/static/content/gesture_pinchclose.png
new file mode 100644
index 0000000..471251f
--- /dev/null
+++ b/docs/html/design/static/content/gesture_pinchclose.png
Binary files differ
diff --git a/docs/html/design/static/content/gesture_pinchopen.png b/docs/html/design/static/content/gesture_pinchopen.png
new file mode 100644
index 0000000..b7c3ee3
--- /dev/null
+++ b/docs/html/design/static/content/gesture_pinchopen.png
Binary files differ
diff --git a/docs/html/design/static/content/gesture_swipe.png b/docs/html/design/static/content/gesture_swipe.png
new file mode 100644
index 0000000..f8e8a26
--- /dev/null
+++ b/docs/html/design/static/content/gesture_swipe.png
Binary files differ
diff --git a/docs/html/design/static/content/gesture_touch.png b/docs/html/design/static/content/gesture_touch.png
new file mode 100644
index 0000000..5c49b17
--- /dev/null
+++ b/docs/html/design/static/content/gesture_touch.png
Binary files differ
diff --git a/docs/html/design/static/content/gridview_example.png b/docs/html/design/static/content/gridview_example.png
new file mode 100644
index 0000000..850790f
--- /dev/null
+++ b/docs/html/design/static/content/gridview_example.png
Binary files differ
diff --git a/docs/html/design/static/content/gridview_horizontal.png b/docs/html/design/static/content/gridview_horizontal.png
new file mode 100644
index 0000000..1d329a1
--- /dev/null
+++ b/docs/html/design/static/content/gridview_horizontal.png
Binary files differ
diff --git a/docs/html/design/static/content/gridview_overview.png b/docs/html/design/static/content/gridview_overview.png
new file mode 100644
index 0000000..a831625
--- /dev/null
+++ b/docs/html/design/static/content/gridview_overview.png
Binary files differ
diff --git a/docs/html/design/static/content/gridview_style.png b/docs/html/design/static/content/gridview_style.png
new file mode 100644
index 0000000..77384f9
--- /dev/null
+++ b/docs/html/design/static/content/gridview_style.png
Binary files differ
diff --git a/docs/html/design/static/content/gridview_vertical.png b/docs/html/design/static/content/gridview_vertical.png
new file mode 100644
index 0000000..f7d85a0
--- /dev/null
+++ b/docs/html/design/static/content/gridview_vertical.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_actionbar_colors.png b/docs/html/design/static/content/iconography_actionbar_colors.png
new file mode 100644
index 0000000..2ad550a
--- /dev/null
+++ b/docs/html/design/static/content/iconography_actionbar_colors.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_actionbar_focal.png b/docs/html/design/static/content/iconography_actionbar_focal.png
new file mode 100644
index 0000000..49b6537
--- /dev/null
+++ b/docs/html/design/static/content/iconography_actionbar_focal.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_actionbar_size.png b/docs/html/design/static/content/iconography_actionbar_size.png
new file mode 100644
index 0000000..307a4fe
--- /dev/null
+++ b/docs/html/design/static/content/iconography_actionbar_size.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_actionbar_style.png b/docs/html/design/static/content/iconography_actionbar_style.png
new file mode 100644
index 0000000..a48b448
--- /dev/null
+++ b/docs/html/design/static/content/iconography_actionbar_style.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_launcher_example.png b/docs/html/design/static/content/iconography_launcher_example.png
new file mode 100644
index 0000000..a5db53e
--- /dev/null
+++ b/docs/html/design/static/content/iconography_launcher_example.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_launcher_example2.png b/docs/html/design/static/content/iconography_launcher_example2.png
new file mode 100644
index 0000000..5a709e2
--- /dev/null
+++ b/docs/html/design/static/content/iconography_launcher_example2.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_launcher_focal.png b/docs/html/design/static/content/iconography_launcher_focal.png
new file mode 100644
index 0000000..014a340
--- /dev/null
+++ b/docs/html/design/static/content/iconography_launcher_focal.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_launcher_size.png b/docs/html/design/static/content/iconography_launcher_size.png
new file mode 100644
index 0000000..48267de
--- /dev/null
+++ b/docs/html/design/static/content/iconography_launcher_size.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_launcher_style.png b/docs/html/design/static/content/iconography_launcher_style.png
new file mode 100644
index 0000000..b20c91b
--- /dev/null
+++ b/docs/html/design/static/content/iconography_launcher_style.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_notification_example.png b/docs/html/design/static/content/iconography_notification_example.png
new file mode 100644
index 0000000..a8498ce
--- /dev/null
+++ b/docs/html/design/static/content/iconography_notification_example.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_notification_focal.png b/docs/html/design/static/content/iconography_notification_focal.png
new file mode 100644
index 0000000..20d5e8f
--- /dev/null
+++ b/docs/html/design/static/content/iconography_notification_focal.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_notification_size.png b/docs/html/design/static/content/iconography_notification_size.png
new file mode 100644
index 0000000..b264e98
--- /dev/null
+++ b/docs/html/design/static/content/iconography_notification_size.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_notification_style.png b/docs/html/design/static/content/iconography_notification_style.png
new file mode 100644
index 0000000..a52db1f
--- /dev/null
+++ b/docs/html/design/static/content/iconography_notification_style.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_overview.png b/docs/html/design/static/content/iconography_overview.png
new file mode 100644
index 0000000..688c1b5
--- /dev/null
+++ b/docs/html/design/static/content/iconography_overview.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_small_colors.png b/docs/html/design/static/content/iconography_small_colors.png
new file mode 100644
index 0000000..0ac1bfd
--- /dev/null
+++ b/docs/html/design/static/content/iconography_small_colors.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_small_example.png b/docs/html/design/static/content/iconography_small_example.png
new file mode 100644
index 0000000..1e1400e
--- /dev/null
+++ b/docs/html/design/static/content/iconography_small_example.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_small_focal.png b/docs/html/design/static/content/iconography_small_focal.png
new file mode 100644
index 0000000..dff3c16
--- /dev/null
+++ b/docs/html/design/static/content/iconography_small_focal.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_small_size.png b/docs/html/design/static/content/iconography_small_size.png
new file mode 100644
index 0000000..748cf79
--- /dev/null
+++ b/docs/html/design/static/content/iconography_small_size.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_small_style.png b/docs/html/design/static/content/iconography_small_style.png
new file mode 100644
index 0000000..0149ac6
--- /dev/null
+++ b/docs/html/design/static/content/iconography_small_style.png
Binary files differ
diff --git a/docs/html/design/static/content/index_landing_page.png b/docs/html/design/static/content/index_landing_page.png
new file mode 100644
index 0000000..3f319b0
--- /dev/null
+++ b/docs/html/design/static/content/index_landing_page.png
Binary files differ
diff --git a/docs/html/design/static/content/lists_main.png b/docs/html/design/static/content/lists_main.png
new file mode 100644
index 0000000..d89ac79
--- /dev/null
+++ b/docs/html/design/static/content/lists_main.png
Binary files differ
diff --git a/docs/html/design/static/content/metrics_48.png b/docs/html/design/static/content/metrics_48.png
new file mode 100644
index 0000000..5e6c57e
--- /dev/null
+++ b/docs/html/design/static/content/metrics_48.png
Binary files differ
diff --git a/docs/html/design/static/content/metrics_closeup.png b/docs/html/design/static/content/metrics_closeup.png
new file mode 100644
index 0000000..032115a
--- /dev/null
+++ b/docs/html/design/static/content/metrics_closeup.png
Binary files differ
diff --git a/docs/html/design/static/content/metrics_diagram.png b/docs/html/design/static/content/metrics_diagram.png
new file mode 100644
index 0000000..b5e6cd2
--- /dev/null
+++ b/docs/html/design/static/content/metrics_diagram.png
Binary files differ
diff --git a/docs/html/design/static/content/metrics_forms.png b/docs/html/design/static/content/metrics_forms.png
new file mode 100644
index 0000000..449bd57
--- /dev/null
+++ b/docs/html/design/static/content/metrics_forms.png
Binary files differ
diff --git a/docs/html/design/static/content/migrating_icons.png b/docs/html/design/static/content/migrating_icons.png
new file mode 100644
index 0000000..1a25867
--- /dev/null
+++ b/docs/html/design/static/content/migrating_icons.png
Binary files differ
diff --git a/docs/html/design/static/content/migrating_ios_dialers.png b/docs/html/design/static/content/migrating_ios_dialers.png
new file mode 100644
index 0000000..27751d8
--- /dev/null
+++ b/docs/html/design/static/content/migrating_ios_dialers.png
Binary files differ
diff --git a/docs/html/design/static/content/migrating_ios_galleries.png b/docs/html/design/static/content/migrating_ios_galleries.png
new file mode 100644
index 0000000..04472fe
--- /dev/null
+++ b/docs/html/design/static/content/migrating_ios_galleries.png
Binary files differ
diff --git a/docs/html/design/static/content/migrating_ios_settings.png b/docs/html/design/static/content/migrating_ios_settings.png
new file mode 100644
index 0000000..b17cb72
--- /dev/null
+++ b/docs/html/design/static/content/migrating_ios_settings.png
Binary files differ
diff --git a/docs/html/design/static/content/migrating_ui_elements.png b/docs/html/design/static/content/migrating_ui_elements.png
new file mode 100644
index 0000000..51c2a80
--- /dev/null
+++ b/docs/html/design/static/content/migrating_ui_elements.png
Binary files differ
diff --git a/docs/html/design/static/content/misc_full_galaxynexus_blank_land_span13.png b/docs/html/design/static/content/misc_full_galaxynexus_blank_land_span13.png
new file mode 100644
index 0000000..bab6aca
--- /dev/null
+++ b/docs/html/design/static/content/misc_full_galaxynexus_blank_land_span13.png
Binary files differ
diff --git a/docs/html/design/static/content/misc_full_galaxynexus_blank_port_span5.png b/docs/html/design/static/content/misc_full_galaxynexus_blank_port_span5.png
new file mode 100644
index 0000000..bdccc2f
--- /dev/null
+++ b/docs/html/design/static/content/misc_full_galaxynexus_blank_port_span5.png
Binary files differ
diff --git a/docs/html/design/static/content/misc_full_galaxynexus_blank_port_span9.png b/docs/html/design/static/content/misc_full_galaxynexus_blank_port_span9.png
new file mode 100644
index 0000000..5e0135b
--- /dev/null
+++ b/docs/html/design/static/content/misc_full_galaxynexus_blank_port_span9.png
Binary files differ
diff --git a/docs/html/design/static/content/multipane_expand.png b/docs/html/design/static/content/multipane_expand.png
new file mode 100644
index 0000000..bb4f371
--- /dev/null
+++ b/docs/html/design/static/content/multipane_expand.png
Binary files differ
diff --git a/docs/html/design/static/content/multipane_show.png b/docs/html/design/static/content/multipane_show.png
new file mode 100644
index 0000000..0231adb
--- /dev/null
+++ b/docs/html/design/static/content/multipane_show.png
Binary files differ
diff --git a/docs/html/design/static/content/multipane_stack.png b/docs/html/design/static/content/multipane_stack.png
new file mode 100644
index 0000000..7769f0c
--- /dev/null
+++ b/docs/html/design/static/content/multipane_stack.png
Binary files differ
diff --git a/docs/html/design/static/content/multipane_stretch.png b/docs/html/design/static/content/multipane_stretch.png
new file mode 100644
index 0000000..5075af6
--- /dev/null
+++ b/docs/html/design/static/content/multipane_stretch.png
Binary files differ
diff --git a/docs/html/design/static/content/multipane_view_tablet.png b/docs/html/design/static/content/multipane_view_tablet.png
new file mode 100644
index 0000000..56a6718
--- /dev/null
+++ b/docs/html/design/static/content/multipane_view_tablet.png
Binary files differ
diff --git a/docs/html/design/static/content/multipane_views.png b/docs/html/design/static/content/multipane_views.png
new file mode 100644
index 0000000..9fdfcfd
--- /dev/null
+++ b/docs/html/design/static/content/multipane_views.png
Binary files differ
diff --git a/docs/html/design/static/content/navigation_between_siblings_gmail.png b/docs/html/design/static/content/navigation_between_siblings_gmail.png
new file mode 100644
index 0000000..fe01ed3
--- /dev/null
+++ b/docs/html/design/static/content/navigation_between_siblings_gmail.png
Binary files differ
diff --git a/docs/html/design/static/content/navigation_between_siblings_market1.png b/docs/html/design/static/content/navigation_between_siblings_market1.png
new file mode 100644
index 0000000..c3148f8
--- /dev/null
+++ b/docs/html/design/static/content/navigation_between_siblings_market1.png
Binary files differ
diff --git a/docs/html/design/static/content/navigation_between_siblings_market2.png b/docs/html/design/static/content/navigation_between_siblings_market2.png
new file mode 100644
index 0000000..208be47
--- /dev/null
+++ b/docs/html/design/static/content/navigation_between_siblings_market2.png
Binary files differ
diff --git a/docs/html/design/static/content/navigation_from_outside_back.png b/docs/html/design/static/content/navigation_from_outside_back.png
new file mode 100644
index 0000000..971ee57
--- /dev/null
+++ b/docs/html/design/static/content/navigation_from_outside_back.png
Binary files differ
diff --git a/docs/html/design/static/content/navigation_from_outside_up.png b/docs/html/design/static/content/navigation_from_outside_up.png
new file mode 100644
index 0000000..eaa3cdb
--- /dev/null
+++ b/docs/html/design/static/content/navigation_from_outside_up.png
Binary files differ
diff --git a/docs/html/design/static/content/navigation_up_vs_back_gmail.png b/docs/html/design/static/content/navigation_up_vs_back_gmail.png
new file mode 100644
index 0000000..71e6484
--- /dev/null
+++ b/docs/html/design/static/content/navigation_up_vs_back_gmail.png
Binary files differ
diff --git a/docs/html/design/static/content/navigation_with_back_and_up.png b/docs/html/design/static/content/navigation_with_back_and_up.png
new file mode 100644
index 0000000..4fb6dce
--- /dev/null
+++ b/docs/html/design/static/content/navigation_with_back_and_up.png
Binary files differ
diff --git a/docs/html/design/static/content/notifications_dismiss.png b/docs/html/design/static/content/notifications_dismiss.png
new file mode 100644
index 0000000..71bed4f
--- /dev/null
+++ b/docs/html/design/static/content/notifications_dismiss.png
Binary files differ
diff --git a/docs/html/design/static/content/notifications_pattern_additional_fail.png b/docs/html/design/static/content/notifications_pattern_additional_fail.png
new file mode 100644
index 0000000..3945ffb
--- /dev/null
+++ b/docs/html/design/static/content/notifications_pattern_additional_fail.png
Binary files differ
diff --git a/docs/html/design/static/content/notifications_pattern_additional_win.png b/docs/html/design/static/content/notifications_pattern_additional_win.png
new file mode 100644
index 0000000..74472c3
--- /dev/null
+++ b/docs/html/design/static/content/notifications_pattern_additional_win.png
Binary files differ
diff --git a/docs/html/design/static/content/notifications_pattern_anatomy.png b/docs/html/design/static/content/notifications_pattern_anatomy.png
new file mode 100644
index 0000000..cacc183
--- /dev/null
+++ b/docs/html/design/static/content/notifications_pattern_anatomy.png
Binary files differ
diff --git a/docs/html/design/static/content/notifications_pattern_dialog_toast.png b/docs/html/design/static/content/notifications_pattern_dialog_toast.png
new file mode 100644
index 0000000..517d57b
--- /dev/null
+++ b/docs/html/design/static/content/notifications_pattern_dialog_toast.png
Binary files differ
diff --git a/docs/html/design/static/content/notifications_pattern_ongoing_music.png b/docs/html/design/static/content/notifications_pattern_ongoing_music.png
new file mode 100644
index 0000000..01039bd
--- /dev/null
+++ b/docs/html/design/static/content/notifications_pattern_ongoing_music.png
Binary files differ
diff --git a/docs/html/design/static/content/notifications_pattern_phone_icons.png b/docs/html/design/static/content/notifications_pattern_phone_icons.png
new file mode 100644
index 0000000..09d8a83
--- /dev/null
+++ b/docs/html/design/static/content/notifications_pattern_phone_icons.png
Binary files differ
diff --git a/docs/html/design/static/content/notifications_pattern_phone_ticker.png b/docs/html/design/static/content/notifications_pattern_phone_ticker.png
new file mode 100644
index 0000000..601e310
--- /dev/null
+++ b/docs/html/design/static/content/notifications_pattern_phone_ticker.png
Binary files differ
diff --git a/docs/html/design/static/content/notifications_pattern_real_time_people.png b/docs/html/design/static/content/notifications_pattern_real_time_people.png
new file mode 100644
index 0000000..32e62eb
--- /dev/null
+++ b/docs/html/design/static/content/notifications_pattern_real_time_people.png
Binary files differ
diff --git a/docs/html/design/static/content/notifications_pattern_social_fail.png b/docs/html/design/static/content/notifications_pattern_social_fail.png
new file mode 100644
index 0000000..2c8fddc
--- /dev/null
+++ b/docs/html/design/static/content/notifications_pattern_social_fail.png
Binary files differ
diff --git a/docs/html/design/static/content/notifications_pattern_tablet.png b/docs/html/design/static/content/notifications_pattern_tablet.png
new file mode 100644
index 0000000..15637d5
--- /dev/null
+++ b/docs/html/design/static/content/notifications_pattern_tablet.png
Binary files differ
diff --git a/docs/html/design/static/content/patterns_landing.png b/docs/html/design/static/content/patterns_landing.png
new file mode 100644
index 0000000..d9869a5
--- /dev/null
+++ b/docs/html/design/static/content/patterns_landing.png
Binary files differ
diff --git a/docs/html/design/static/content/picker_datetime.png b/docs/html/design/static/content/picker_datetime.png
new file mode 100644
index 0000000..9876ab2
--- /dev/null
+++ b/docs/html/design/static/content/picker_datetime.png
Binary files differ
diff --git a/docs/html/design/static/content/picker_space.png b/docs/html/design/static/content/picker_space.png
new file mode 100644
index 0000000..024776f
--- /dev/null
+++ b/docs/html/design/static/content/picker_space.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_decide_for_me.png b/docs/html/design/static/content/principles_decide_for_me.png
new file mode 100644
index 0000000..2d8b883
--- /dev/null
+++ b/docs/html/design/static/content/principles_decide_for_me.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_delight.png b/docs/html/design/static/content/principles_delight.png
new file mode 100644
index 0000000..5d6e909
--- /dev/null
+++ b/docs/html/design/static/content/principles_delight.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_error.png b/docs/html/design/static/content/principles_error.png
new file mode 100644
index 0000000..93767660
--- /dev/null
+++ b/docs/html/design/static/content/principles_error.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_get_to_know_me.png b/docs/html/design/static/content/principles_get_to_know_me.png
new file mode 100644
index 0000000..954363f
--- /dev/null
+++ b/docs/html/design/static/content/principles_get_to_know_me.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_heavy_lifting.png b/docs/html/design/static/content/principles_heavy_lifting.png
new file mode 100644
index 0000000..c89c0ff
--- /dev/null
+++ b/docs/html/design/static/content/principles_heavy_lifting.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_important_interruption.png b/docs/html/design/static/content/principles_important_interruption.png
new file mode 100644
index 0000000..0576efe
--- /dev/null
+++ b/docs/html/design/static/content/principles_important_interruption.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_information_when_need_it.png b/docs/html/design/static/content/principles_information_when_need_it.png
new file mode 100644
index 0000000..c5ef3ca
--- /dev/null
+++ b/docs/html/design/static/content/principles_information_when_need_it.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_keep_it_brief.png b/docs/html/design/static/content/principles_keep_it_brief.png
new file mode 100644
index 0000000..9c2813b
--- /dev/null
+++ b/docs/html/design/static/content/principles_keep_it_brief.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_looks_same.png b/docs/html/design/static/content/principles_looks_same.png
new file mode 100644
index 0000000..3a556ad
--- /dev/null
+++ b/docs/html/design/static/content/principles_looks_same.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_make_important_fast.png b/docs/html/design/static/content/principles_make_important_fast.png
new file mode 100644
index 0000000..26da655
--- /dev/null
+++ b/docs/html/design/static/content/principles_make_important_fast.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_make_it_mine.png b/docs/html/design/static/content/principles_make_it_mine.png
new file mode 100644
index 0000000..683a0b7
--- /dev/null
+++ b/docs/html/design/static/content/principles_make_it_mine.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_navigation.png b/docs/html/design/static/content/principles_navigation.png
new file mode 100644
index 0000000..c23dde7
--- /dev/null
+++ b/docs/html/design/static/content/principles_navigation.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_never_lose_stuff.png b/docs/html/design/static/content/principles_never_lose_stuff.png
new file mode 100644
index 0000000..acbefea
--- /dev/null
+++ b/docs/html/design/static/content/principles_never_lose_stuff.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_pictures.png b/docs/html/design/static/content/principles_pictures.png
new file mode 100644
index 0000000..cebd162
--- /dev/null
+++ b/docs/html/design/static/content/principles_pictures.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_real_objects.png b/docs/html/design/static/content/principles_real_objects.png
new file mode 100644
index 0000000..3889c9a
--- /dev/null
+++ b/docs/html/design/static/content/principles_real_objects.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_sprinkle_encouragement.png b/docs/html/design/static/content/principles_sprinkle_encouragement.png
new file mode 100644
index 0000000..8617365
--- /dev/null
+++ b/docs/html/design/static/content/principles_sprinkle_encouragement.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_tricks.png b/docs/html/design/static/content/principles_tricks.png
new file mode 100644
index 0000000..f436ce9
--- /dev/null
+++ b/docs/html/design/static/content/principles_tricks.png
Binary files differ
diff --git a/docs/html/design/static/content/progress_activity.png b/docs/html/design/static/content/progress_activity.png
new file mode 100644
index 0000000..51210b4
--- /dev/null
+++ b/docs/html/design/static/content/progress_activity.png
Binary files differ
diff --git a/docs/html/design/static/content/progress_activity2.png b/docs/html/design/static/content/progress_activity2.png
new file mode 100644
index 0000000..ec3df99
--- /dev/null
+++ b/docs/html/design/static/content/progress_activity2.png
Binary files differ
diff --git a/docs/html/design/static/content/progress_download.png b/docs/html/design/static/content/progress_download.png
new file mode 100644
index 0000000..f567f74
--- /dev/null
+++ b/docs/html/design/static/content/progress_download.png
Binary files differ
diff --git a/docs/html/design/static/content/progress_themes.png b/docs/html/design/static/content/progress_themes.png
new file mode 100644
index 0000000..df090e5
--- /dev/null
+++ b/docs/html/design/static/content/progress_themes.png
Binary files differ
diff --git a/docs/html/design/static/content/scroll_index.mp4 b/docs/html/design/static/content/scroll_index.mp4
new file mode 100644
index 0000000..383bbd8
--- /dev/null
+++ b/docs/html/design/static/content/scroll_index.mp4
Binary files differ
diff --git a/docs/html/design/static/content/scroll_index.ogv b/docs/html/design/static/content/scroll_index.ogv
new file mode 100644
index 0000000..2cd61ef
--- /dev/null
+++ b/docs/html/design/static/content/scroll_index.ogv
Binary files differ
diff --git a/docs/html/design/static/content/scroll_index.webm b/docs/html/design/static/content/scroll_index.webm
new file mode 100644
index 0000000..5a665d1
--- /dev/null
+++ b/docs/html/design/static/content/scroll_index.webm
Binary files differ
diff --git a/docs/html/design/static/content/scroll_indicator.mp4 b/docs/html/design/static/content/scroll_indicator.mp4
new file mode 100644
index 0000000..924852e
--- /dev/null
+++ b/docs/html/design/static/content/scroll_indicator.mp4
Binary files differ
diff --git a/docs/html/design/static/content/scroll_indicator.ogv b/docs/html/design/static/content/scroll_indicator.ogv
new file mode 100644
index 0000000..c037bf5
--- /dev/null
+++ b/docs/html/design/static/content/scroll_indicator.ogv
Binary files differ
diff --git a/docs/html/design/static/content/scroll_indicator.webm b/docs/html/design/static/content/scroll_indicator.webm
new file mode 100644
index 0000000..000dc0a
--- /dev/null
+++ b/docs/html/design/static/content/scroll_indicator.webm
Binary files differ
diff --git a/docs/html/design/static/content/seekbar_example.png b/docs/html/design/static/content/seekbar_example.png
new file mode 100644
index 0000000..70b7e5e
--- /dev/null
+++ b/docs/html/design/static/content/seekbar_example.png
Binary files differ
diff --git a/docs/html/design/static/content/seekbar_style.png b/docs/html/design/static/content/seekbar_style.png
new file mode 100644
index 0000000..e31445d
--- /dev/null
+++ b/docs/html/design/static/content/seekbar_style.png
Binary files differ
diff --git a/docs/html/design/static/content/selection_adjusting_actions.png b/docs/html/design/static/content/selection_adjusting_actions.png
new file mode 100644
index 0000000..0799b6b
--- /dev/null
+++ b/docs/html/design/static/content/selection_adjusting_actions.png
Binary files differ
diff --git a/docs/html/design/static/content/selection_cab_big.png b/docs/html/design/static/content/selection_cab_big.png
new file mode 100644
index 0000000..72567cb
--- /dev/null
+++ b/docs/html/design/static/content/selection_cab_big.png
Binary files differ
diff --git a/docs/html/design/static/content/selection_cab_example.png b/docs/html/design/static/content/selection_cab_example.png
new file mode 100644
index 0000000..c49a2ad
--- /dev/null
+++ b/docs/html/design/static/content/selection_cab_example.png
Binary files differ
diff --git a/docs/html/design/static/content/selection_context_menu.png b/docs/html/design/static/content/selection_context_menu.png
new file mode 100644
index 0000000..c711546
--- /dev/null
+++ b/docs/html/design/static/content/selection_context_menu.png
Binary files differ
diff --git a/docs/html/design/static/content/spinners_actionbar.png b/docs/html/design/static/content/spinners_actionbar.png
new file mode 100644
index 0000000..5d07419
--- /dev/null
+++ b/docs/html/design/static/content/spinners_actionbar.png
Binary files differ
diff --git a/docs/html/design/static/content/spinners_form.png b/docs/html/design/static/content/spinners_form.png
new file mode 100644
index 0000000..79ee4e4
--- /dev/null
+++ b/docs/html/design/static/content/spinners_form.png
Binary files differ
diff --git a/docs/html/design/static/content/spinners_hololightanddark.png b/docs/html/design/static/content/spinners_hololightanddark.png
new file mode 100644
index 0000000..9b0601e
--- /dev/null
+++ b/docs/html/design/static/content/spinners_hololightanddark.png
Binary files differ
diff --git a/docs/html/design/static/content/swipe_tabs.mp4 b/docs/html/design/static/content/swipe_tabs.mp4
new file mode 100644
index 0000000..f8a1ab5
--- /dev/null
+++ b/docs/html/design/static/content/swipe_tabs.mp4
Binary files differ
diff --git a/docs/html/design/static/content/swipe_tabs.ogv b/docs/html/design/static/content/swipe_tabs.ogv
new file mode 100644
index 0000000..ae3c86b
--- /dev/null
+++ b/docs/html/design/static/content/swipe_tabs.ogv
Binary files differ
diff --git a/docs/html/design/static/content/swipe_tabs.png b/docs/html/design/static/content/swipe_tabs.png
new file mode 100644
index 0000000..f25f061
--- /dev/null
+++ b/docs/html/design/static/content/swipe_tabs.png
Binary files differ
diff --git a/docs/html/design/static/content/swipe_tabs.webm b/docs/html/design/static/content/swipe_tabs.webm
new file mode 100644
index 0000000..86f403e
--- /dev/null
+++ b/docs/html/design/static/content/swipe_tabs.webm
Binary files differ
diff --git a/docs/html/design/static/content/swipe_views.png b/docs/html/design/static/content/swipe_views.png
new file mode 100644
index 0000000..3b6ecaf
--- /dev/null
+++ b/docs/html/design/static/content/swipe_views.png
Binary files differ
diff --git a/docs/html/design/static/content/swipe_views2.png b/docs/html/design/static/content/swipe_views2.png
new file mode 100644
index 0000000..2ed366c
--- /dev/null
+++ b/docs/html/design/static/content/swipe_views2.png
Binary files differ
diff --git a/docs/html/design/static/content/switches_checkboxes.png b/docs/html/design/static/content/switches_checkboxes.png
new file mode 100644
index 0000000..92b8d5c
--- /dev/null
+++ b/docs/html/design/static/content/switches_checkboxes.png
Binary files differ
diff --git a/docs/html/design/static/content/switches_radios.png b/docs/html/design/static/content/switches_radios.png
new file mode 100644
index 0000000..f9bf5fc
--- /dev/null
+++ b/docs/html/design/static/content/switches_radios.png
Binary files differ
diff --git a/docs/html/design/static/content/switches_switches.png b/docs/html/design/static/content/switches_switches.png
new file mode 100644
index 0000000..43e2623
--- /dev/null
+++ b/docs/html/design/static/content/switches_switches.png
Binary files differ
diff --git a/docs/html/design/static/content/system_ui_landing.png b/docs/html/design/static/content/system_ui_landing.png
new file mode 100644
index 0000000..1d22920
--- /dev/null
+++ b/docs/html/design/static/content/system_ui_landing.png
Binary files differ
diff --git a/docs/html/design/static/content/tabs_overview.png b/docs/html/design/static/content/tabs_overview.png
new file mode 100644
index 0000000..c336982
--- /dev/null
+++ b/docs/html/design/static/content/tabs_overview.png
Binary files differ
diff --git a/docs/html/design/static/content/tabs_scrolly.mp4 b/docs/html/design/static/content/tabs_scrolly.mp4
new file mode 100644
index 0000000..4329243
--- /dev/null
+++ b/docs/html/design/static/content/tabs_scrolly.mp4
Binary files differ
diff --git a/docs/html/design/static/content/tabs_scrolly.ogv b/docs/html/design/static/content/tabs_scrolly.ogv
new file mode 100644
index 0000000..345e57a
--- /dev/null
+++ b/docs/html/design/static/content/tabs_scrolly.ogv
Binary files differ
diff --git a/docs/html/design/static/content/tabs_scrolly.webm b/docs/html/design/static/content/tabs_scrolly.webm
new file mode 100644
index 0000000..17e368e
--- /dev/null
+++ b/docs/html/design/static/content/tabs_scrolly.webm
Binary files differ
diff --git a/docs/html/design/static/content/tabs_stacked.png b/docs/html/design/static/content/tabs_stacked.png
new file mode 100644
index 0000000..09e9958
--- /dev/null
+++ b/docs/html/design/static/content/tabs_stacked.png
Binary files differ
diff --git a/docs/html/design/static/content/tabs_standard.png b/docs/html/design/static/content/tabs_standard.png
new file mode 100644
index 0000000..8e3ed66
--- /dev/null
+++ b/docs/html/design/static/content/tabs_standard.png
Binary files differ
diff --git a/docs/html/design/static/content/tabs_youtube.png b/docs/html/design/static/content/tabs_youtube.png
new file mode 100644
index 0000000..69e9268
--- /dev/null
+++ b/docs/html/design/static/content/tabs_youtube.png
Binary files differ
diff --git a/docs/html/design/static/content/text_input_holodarkandlight.png b/docs/html/design/static/content/text_input_holodarkandlight.png
new file mode 100644
index 0000000..aff61fc
--- /dev/null
+++ b/docs/html/design/static/content/text_input_holodarkandlight.png
Binary files differ
diff --git a/docs/html/design/static/content/text_input_singlevsmultiline.png b/docs/html/design/static/content/text_input_singlevsmultiline.png
new file mode 100644
index 0000000..7bb9a5c
--- /dev/null
+++ b/docs/html/design/static/content/text_input_singlevsmultiline.png
Binary files differ
diff --git a/docs/html/design/static/content/text_input_textselection.png b/docs/html/design/static/content/text_input_textselection.png
new file mode 100644
index 0000000..85689cf
--- /dev/null
+++ b/docs/html/design/static/content/text_input_textselection.png
Binary files differ
diff --git a/docs/html/design/static/content/text_input_typesandtypedown.png b/docs/html/design/static/content/text_input_typesandtypedown.png
new file mode 100644
index 0000000..32f761c
--- /dev/null
+++ b/docs/html/design/static/content/text_input_typesandtypedown.png
Binary files differ
diff --git a/docs/html/design/static/content/themes_holo_dark.png b/docs/html/design/static/content/themes_holo_dark.png
new file mode 100644
index 0000000..916ad27
--- /dev/null
+++ b/docs/html/design/static/content/themes_holo_dark.png
Binary files differ
diff --git a/docs/html/design/static/content/themes_holo_inverse.png b/docs/html/design/static/content/themes_holo_inverse.png
new file mode 100644
index 0000000..72c0244
--- /dev/null
+++ b/docs/html/design/static/content/themes_holo_inverse.png
Binary files differ
diff --git a/docs/html/design/static/content/themes_holo_light.png b/docs/html/design/static/content/themes_holo_light.png
new file mode 100644
index 0000000..d4b0861
--- /dev/null
+++ b/docs/html/design/static/content/themes_holo_light.png
Binary files differ
diff --git a/docs/html/design/static/content/touch_feedback_communication.png b/docs/html/design/static/content/touch_feedback_communication.png
new file mode 100644
index 0000000..bb27250
--- /dev/null
+++ b/docs/html/design/static/content/touch_feedback_communication.png
Binary files differ
diff --git a/docs/html/design/static/content/touch_feedback_manipulation.png b/docs/html/design/static/content/touch_feedback_manipulation.png
new file mode 100644
index 0000000..cb1f268
--- /dev/null
+++ b/docs/html/design/static/content/touch_feedback_manipulation.png
Binary files differ
diff --git a/docs/html/design/static/content/touch_feedback_reaction_response.png b/docs/html/design/static/content/touch_feedback_reaction_response.png
new file mode 100644
index 0000000..5a34d7a
--- /dev/null
+++ b/docs/html/design/static/content/touch_feedback_reaction_response.png
Binary files differ
diff --git a/docs/html/design/static/content/touch_feedback_states.png b/docs/html/design/static/content/touch_feedback_states.png
new file mode 100644
index 0000000..972198c
--- /dev/null
+++ b/docs/html/design/static/content/touch_feedback_states.png
Binary files differ
diff --git a/docs/html/design/static/content/typography_alphas.png b/docs/html/design/static/content/typography_alphas.png
new file mode 100644
index 0000000..4b53bd0
--- /dev/null
+++ b/docs/html/design/static/content/typography_alphas.png
Binary files differ
diff --git a/docs/html/design/static/content/typography_defaults.png b/docs/html/design/static/content/typography_defaults.png
new file mode 100644
index 0000000..87f1c87
--- /dev/null
+++ b/docs/html/design/static/content/typography_defaults.png
Binary files differ
diff --git a/docs/html/design/static/content/typography_main.png b/docs/html/design/static/content/typography_main.png
new file mode 100644
index 0000000..8298cf6e
--- /dev/null
+++ b/docs/html/design/static/content/typography_main.png
Binary files differ
diff --git a/docs/html/design/static/content/typography_sizes.png b/docs/html/design/static/content/typography_sizes.png
new file mode 100644
index 0000000..eda1d99
--- /dev/null
+++ b/docs/html/design/static/content/typography_sizes.png
Binary files differ
diff --git a/docs/html/design/static/content/ui_overview_all_apps.png b/docs/html/design/static/content/ui_overview_all_apps.png
new file mode 100644
index 0000000..467f5ad
--- /dev/null
+++ b/docs/html/design/static/content/ui_overview_all_apps.png
Binary files differ
diff --git a/docs/html/design/static/content/ui_overview_app_ui.png b/docs/html/design/static/content/ui_overview_app_ui.png
new file mode 100644
index 0000000..7fc5dcd
--- /dev/null
+++ b/docs/html/design/static/content/ui_overview_app_ui.png
Binary files differ
diff --git a/docs/html/design/static/content/ui_overview_home_screen.png b/docs/html/design/static/content/ui_overview_home_screen.png
new file mode 100644
index 0000000..ee0e4d6
--- /dev/null
+++ b/docs/html/design/static/content/ui_overview_home_screen.png
Binary files differ
diff --git a/docs/html/design/static/content/ui_overview_notifications.png b/docs/html/design/static/content/ui_overview_notifications.png
new file mode 100644
index 0000000..fd7438a
--- /dev/null
+++ b/docs/html/design/static/content/ui_overview_notifications.png
Binary files differ
diff --git a/docs/html/design/static/content/ui_overview_recents.png b/docs/html/design/static/content/ui_overview_recents.png
new file mode 100644
index 0000000..4ea0583
--- /dev/null
+++ b/docs/html/design/static/content/ui_overview_recents.png
Binary files differ
diff --git a/docs/html/design/static/content/ui_overview_system_ui.png b/docs/html/design/static/content/ui_overview_system_ui.png
new file mode 100644
index 0000000..ecc4b7d
--- /dev/null
+++ b/docs/html/design/static/content/ui_overview_system_ui.png
Binary files differ
diff --git a/docs/html/design/static/content/whats_new_action_bar.png b/docs/html/design/static/content/whats_new_action_bar.png
new file mode 100644
index 0000000..713187e
--- /dev/null
+++ b/docs/html/design/static/content/whats_new_action_bar.png
Binary files differ
diff --git a/docs/html/design/static/content/whats_new_multipanel.png b/docs/html/design/static/content/whats_new_multipanel.png
new file mode 100644
index 0000000..8e9c2f0
--- /dev/null
+++ b/docs/html/design/static/content/whats_new_multipanel.png
Binary files differ
diff --git a/docs/html/design/static/content/whats_new_multiselect.png b/docs/html/design/static/content/whats_new_multiselect.png
new file mode 100644
index 0000000..ab34b24
--- /dev/null
+++ b/docs/html/design/static/content/whats_new_multiselect.png
Binary files differ
diff --git a/docs/html/design/static/content/whats_new_nav_bar.png b/docs/html/design/static/content/whats_new_nav_bar.png
new file mode 100644
index 0000000..46239e5
--- /dev/null
+++ b/docs/html/design/static/content/whats_new_nav_bar.png
Binary files differ
diff --git a/docs/html/design/static/default.css b/docs/html/design/static/default.css
new file mode 100644
index 0000000..42ab527
--- /dev/null
+++ b/docs/html/design/static/default.css
@@ -0,0 +1,571 @@
+/* color definitions */
+/* 16 column layout */
+/* clearfix idiom */
+/* common mixins */
+/* page layout + top-level styles */
+::-moz-selection,
+::-webkit-selection,
+::selection {
+  background-color: #0099cc;
+  color: #fff; }
+
+html, body {
+  height: 100%;
+  margin: 0;
+  padding: 0;
+  background: #eee none no-repeat fixed top left;
+  background-image: -webkit-gradient(linear, 100% 0%, 100% 100%, from(#dddddd), color-stop(25%, #f2f2f2), color-stop(75%, #f2f2f2), to(#dddddd));
+  background-image: -moz-linear-gradient(top, #dddddd, #f2f2f2, #f2f2f2, #dddddd);
+  -webkit-font-smoothing: antialiased;
+  /* prevent subpixel antialiasing, which thickens the text */
+  text-rendering: optimizeLegibility;
+  /* opentype ftw */ }
+
+body {
+  color: #555555;
+  font: 14px/20px Roboto, sans-serif;
+  font-weight: 400; }
+
+#page-container {
+  width: 940px;
+  margin: 0 40px; }
+
+#page-header {
+  height: 80px;
+  margin-bottom: 20px;
+  font-size: 48px;
+  line-height: 48px;
+  font-weight: 100;
+  padding-left: 10px; }
+  #page-header a {
+    display: block;
+    position: relative;
+    top: 20px;
+    text-decoration: none;
+    color: #555555 !important; }
+
+#main-row {
+  display: inline-block; }
+  #main-row:after {
+    content: ".";
+    display: block;
+    height: 0;
+    clear: both;
+    visibility: hidden; }
+  * html #main-row {
+    height: 1px; }
+
+#page-footer {
+  margin-left: 190px;
+  margin-top: 80px;
+  color: #999999;
+  padding-bottom: 40px;
+  font-size: 12px;
+  line-height: 15px; }
+  #page-footer a {
+    color: #777777; }
+  #page-footer #copyright {
+    margin-bottom: 10px; }
+
+#nav {
+  width: 160px;
+  margin-right: 20px;
+  float: left; }
+
+#content {
+  width: 760px;
+  float: left; }
+
+a,
+a:visited {
+  color: #333333; }
+
+a:hover,
+acronym:hover {
+  color: #7aa1b0 !important; }
+
+a:focus,
+a:active {
+  color: #33b5e5 !important; }
+
+img {
+  border: none; }
+
+ul {
+  margin: 0;
+  padding: 0; }
+
+strong {
+  font-weight: 500; }
+
+em {
+  font-style: italic; }
+
+code {
+  font-family: Courier New, monospace; }
+
+acronym {
+  border-bottom: 1px dotted #555555;
+  cursor: help; }
+
+acronym:hover {
+  border-bottom-color: #7aa1b0; }
+
+img.with-shadow,
+video.with-shadow {
+  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25); }
+
+/* disclosures mixin */
+/* content layout */
+.layout-content-row {
+  display: inline-block;
+  margin-bottom: 10px; }
+  .layout-content-row:after {
+    content: ".";
+    display: block;
+    height: 0;
+    clear: both;
+    visibility: hidden; }
+  * html .layout-content-row {
+    height: 1px; }
+
+.layout-content-col {
+  float: left;
+  margin-left: 20px; }
+  .layout-content-col:first-child {
+    margin-left: 0; }
+
+.layout-content-col.span-1 {
+  width: 40px; }
+
+.layout-content-col.span-2 {
+  width: 100px; }
+
+.layout-content-col.span-3 {
+  width: 160px; }
+
+.layout-content-col.span-4 {
+  width: 220px; }
+
+.layout-content-col.span-5 {
+  width: 280px; }
+
+.layout-content-col.span-6 {
+  width: 340px; }
+
+.layout-content-col.span-7 {
+  width: 400px; }
+
+.layout-content-col.span-8 {
+  width: 460px; }
+
+.layout-content-col.span-9 {
+  width: 520px; }
+
+.layout-content-col.span-10 {
+  width: 580px; }
+
+.layout-content-col.span-11 {
+  width: 640px; }
+
+.layout-content-col.span-12 {
+  width: 700px; }
+
+.layout-content-col.span-13 {
+  width: 760px; }
+
+.vspace.size-1 {
+  height: 10px; }
+
+.vspace.size-2 {
+  height: 20px; }
+
+.vspace.size-3 {
+  height: 30px; }
+
+.vspace.size-4 {
+  height: 40px; }
+
+.vspace.size-5 {
+  height: 50px; }
+
+.vspace.size-6 {
+  height: 60px; }
+
+.vspace.size-7 {
+  height: 70px; }
+
+.vspace.size-8 {
+  height: 80px; }
+
+.vspace.size-9 {
+  height: 90px; }
+
+.vspace.size-10 {
+  height: 100px; }
+
+.vspace.size-11 {
+  height: 110px; }
+
+.vspace.size-12 {
+  height: 120px; }
+
+.vspace.size-13 {
+  height: 130px; }
+
+.vspace.size-14 {
+  height: 140px; }
+
+.vspace.size-15 {
+  height: 150px; }
+
+.vspace.size-16 {
+  height: 160px; }
+
+/* nav */
+#nav {
+  /* section header divs */
+  /* expanded section header divs */
+  /* sublinks */ }
+  #nav li {
+    list-style-type: none;
+    font-size: 14px;
+    line-height: 10px; }
+  #nav a {
+    color: #555555;
+    text-decoration: none; }
+  #nav li.selected > a,
+  #nav li.selected .nav-section-header a {
+    font-weight: 500;
+    color: #0099cc !important; }
+  #nav .nav-section-header {
+    position: relative;
+    padding: 10px;
+    margin-bottom: 1px;
+    /* section header links */ }
+    #nav .nav-section-header a {
+      color: #333333;
+      font-weight: 500;
+      text-transform: uppercase; }
+    #nav .nav-section-header:after {
+      content: '';
+      background: transparent url(disclosure_down.png) no-repeat scroll top left;
+      width: 10px;
+      height: 10px;
+      display: block;
+      position: absolute;
+      top: 10px;
+      right: 10px; }
+  #nav li.expanded .nav-section-header {
+    background: rgba(0, 0, 0, 0.05); }
+    #nav li.expanded .nav-section-header:after {
+      content: '';
+      background: transparent url(disclosure_up.png) no-repeat scroll top left;
+      width: 10px;
+      height: 10px; }
+  #nav > li > ul {
+    height: 0;
+    overflow: hidden;
+    margin-bottom: 0; }
+    #nav > li > ul.animate-height {
+      transition: height 0.25s ease-in;
+      -webkit-transition: height 0.25s ease-in;
+      -moz-transition: height 0.25s ease-in; }
+    #nav > li > ul li {
+      padding: 10px 10px 11px 10px; }
+  #nav > li.expanded > ul {
+    height: auto; }
+    #nav > li.expanded > ul li {
+      background: rgba(0, 0, 0, 0.03); }
+  #nav #back-dac-section {
+    padding: 10px;
+    border-top: 1px solid #ddd; }
+    #nav #back-dac-section a {
+      color: #333333;
+      font-weight: 500;
+      text-transform: uppercase; }
+
+/* content header */
+.content-header {
+  border-bottom: 1px solid #33b5e5;
+  height: 30px; }
+  .content-header h2 {
+    border-bottom: 0; }
+  .content-header.just-links {
+    border-bottom: 0; }
+
+.content-footer {
+  border-top: 1px solid #33b5e5;
+  margin-top: 10px;
+  height: 30px; }
+
+.paging-links {
+  position: relative; }
+  .paging-links a {
+    position: absolute;
+    font-size: 14px;
+    line-height: 30px;
+    color: #555555;
+    text-decoration: none;
+    text-transform: uppercase; }
+  .paging-links .prev-page-link {
+    display: none;
+    left: -5px; }
+    .paging-links .prev-page-link:before {
+      content: '';
+      background: transparent url(disclosure_left.png) no-repeat scroll top left;
+      width: 10px;
+      height: 10px;
+      display: inline-block;
+      margin-right: 5px; }
+  .paging-links .next-page-link {
+    display: none;
+    right: 10px; }
+    .paging-links .next-page-link:after {
+      content: '';
+      background: transparent url(disclosure_right.png) no-repeat scroll top left;
+      width: 10px;
+      height: 10px;
+      display: inline-block;
+      margin-left: 5px; }
+
+/* content body */
+#content p,
+#content ul,
+#content ol,
+#content h3 {
+  margin: 0 10px 10px 10px; }
+#content h2 {
+  padding-left: 10px;
+  padding-right: 10px;
+  margin-bottom: 10px;
+  font-size: 16px;
+  line-height: 30px;
+  font-weight: 500;
+  color: #33b5e5;
+  border-bottom: 1px solid #33b5e5;
+  height: 30px; }
+#content hr {
+  border: 0;
+  border-bottom: 1px solid #33b5e5;
+  margin-bottom: 20px; }
+#content h3 {
+  color: #33b5e5;
+  text-transform: uppercase;
+  font-size: 14px;
+  line-height: 20px;
+  font-weight: 500; }
+#content h4 {
+  margin: 0 10px;
+  color: #333333;
+  font-weight: 500;
+  font-size: 14px;
+  line-height: 20px; }
+#content strong {
+  color: #333333; }
+#content ul li,
+#content ol li {
+  margin-left: 20px; }
+  #content ul li h4,
+  #content ol li h4 {
+    margin: 0; }
+  #content ul li p,
+  #content ol li p {
+    margin-left: 0; }
+#content ul li {
+  list-style-type: square;
+  list-style-type: none;
+  position: relative; }
+  #content ul li:before {
+    content: '\2022';
+    font-family: verdana;
+    font-size: 14px;
+    line-height: 20px;
+    position: absolute;
+    left: -20px;
+    top: -1px; }
+#content ol {
+  counter-reset: item; }
+  #content ol li {
+    font-size: 14px;
+    line-height: 20px;
+    list-style-type: none;
+    position: relative; }
+    #content ol li:before {
+      content: counter(item) ". ";
+      counter-increment: item;
+      position: absolute;
+      left: -20px;
+      top: 0; }
+    #content ol li.value-1:before {
+      content: "1. "; }
+    #content ol li.value-2:before {
+      content: "2. "; }
+    #content ol li.value-3:before {
+      content: "3. "; }
+    #content ol li.value-4:before {
+      content: "4. "; }
+    #content ol li.value-5:before {
+      content: "5. "; }
+    #content ol li.value-6:before {
+      content: "6. "; }
+    #content ol li.value-7:before {
+      content: "7. "; }
+    #content ol li.value-8:before {
+      content: "8. "; }
+    #content ol li.value-9:before {
+      content: "9. "; }
+    #content ol li.value-10:before {
+      content: "10. "; }
+#content .with-callouts ol li {
+  list-style-position: inside;
+  margin-left: 0; }
+  #content .with-callouts ol li:before {
+    position: static;
+    display: inline;
+    left: 0;
+    float: left;
+    width: 17px;
+    color: #33b5e5;
+    font-weight: 500; }
+
+/* special list items */
+li.no-bullet {
+  list-style-type: none !important; }
+
+#content li.with-icon {
+  position: relative;
+  margin-left: 40px;
+  min-height: 30px; }
+  #content li.with-icon p {
+    margin-left: 0 !important; }
+  #content li.with-icon:before {
+    position: absolute;
+    left: -40px;
+    top: 0;
+    content: '';
+    width: 30px;
+    height: 30px; }
+  #content li.with-icon.tablet:before {
+    background-image: url(ico_phone_tablet.png); }
+  #content li.with-icon.web:before {
+    background-image: url(ico_web.png); }
+  #content li.with-icon.checklist:before {
+    background-image: url(ico_checklist.png); }
+  #content li.with-icon.action:before {
+    background-image: url(ico_action.png); }
+  #content li.with-icon.use:before {
+    background-image: url(ico_use.png); }
+
+/* figures and callouts */
+.figure {
+  position: relative; }
+  .figure.pad-below {
+    margin-bottom: 20px; }
+  .figure .figure-callout {
+    position: absolute;
+    color: #fff;
+    font-weight: 500;
+    font-size: 16px;
+    line-height: 23px;
+    text-align: center;
+    background: transparent url(callout.png) no-repeat scroll 50% 50%;
+    padding-right: 2px;
+    width: 30px;
+    height: 29px;
+    z-index: 1000; }
+    .figure .figure-callout.top {
+      top: -9px; }
+    .figure .figure-callout.right {
+      right: -5px; }
+
+.figure-caption {
+  margin: 0 10px 20px 10px;
+  font-size: 14px;
+  line-height: 20px;
+  font-style: italic; }
+
+/* rows of figures */
+.figure-row {
+  font-size: 0;
+  line-height: 0;
+  /* to prevent space between figures */ }
+  .figure-row .figure {
+    display: inline-block;
+    vertical-align: top; }
+  .figure-row .figure + .figure {
+    margin-left: 10px;
+    /* reintroduce space between figures */ }
+
+/* video  containers */
+.framed-galaxynexus-land-span-13 {
+  background: transparent url(content/misc_full_galaxynexus_blank_land_span13.png) no-repeat scroll top left;
+  padding: 42px 122px 62px 126px;
+  overflow: hidden; }
+  .framed-galaxynexus-land-span-13, .framed-galaxynexus-land-span-13 video, .framed-galaxynexus-land-span-13 img {
+    width: 512px;
+    height: 286px; }
+
+.framed-galaxynexus-port-span-9 {
+  background: transparent url(content/misc_full_galaxynexus_blank_port_span9.png) no-repeat scroll top left;
+  padding: 95px 122px 107px 124px;
+  overflow: hidden; }
+  .framed-galaxynexus-port-span-9, .framed-galaxynexus-port-span-9 video, .framed-galaxynexus-port-span-9 img {
+    width: 274px;
+    height: 488px; }
+
+.framed-galaxynexus-port-span-5 {
+  background: transparent url(content/misc_full_galaxynexus_blank_port_span5.png) no-repeat scroll top left;
+  padding: 75px 31px 76px 33px;
+  overflow: hidden; }
+  .framed-galaxynexus-port-span-5, .framed-galaxynexus-port-span-5 video, .framed-galaxynexus-port-span-5 img {
+    width: 216px;
+    height: 384px; }
+
+/* landing page disclosures */
+.landing-page-link {
+  text-decoration: none;
+  font-weight: 500;
+  color: #333333; }
+  .landing-page-link:after {
+    content: '';
+    background: transparent url(disclosure_right.png) no-repeat scroll top left;
+    width: 10px;
+    height: 10px;
+    display: inline-block;
+    margin-left: 5px; }
+
+/* tooltips */
+.tooltip-box {
+  position: absolute;
+  background-color: rgba(0, 0, 0, 0.9);
+  border-radius: 2px;
+  font-size: 14px;
+  line-height: 20px;
+  color: #fff;
+  padding: 6px 10px;
+  max-width: 250px;
+  z-index: 10000; }
+  .tooltip-box.below:after {
+    position: absolute;
+    content: '';
+    line-height: 0;
+    display: block;
+    top: -10px;
+    left: 5px;
+    border: 5px solid transparent;
+    border-bottom-color: rgba(0, 0, 0, 0.9); }
+
+/* video note */
+.video-instructions {
+  margin-top: 10px;
+  margin-bottom: 10px; }
+  .video-instructions:before {
+    content: '';
+    background: transparent url(ico_movie_inline.png) no-repeat scroll top left;
+    display: inline-block;
+    width: 12px;
+    height: 12px;
+    margin-right: 8px; }
+  .video-instructions:after {
+    content: 'Click to replay movie.'; }
diff --git a/docs/html/design/static/default.js b/docs/html/design/static/default.js
new file mode 100644
index 0000000..6721ab8
--- /dev/null
+++ b/docs/html/design/static/default.js
@@ -0,0 +1,161 @@
+$(document).ready(function() {
+  // prep nav expandos
+  var pagePath = document.location.pathname;
+  if (pagePath.indexOf(SITE_ROOT) == 0) {
+    pagePath = pagePath.substr(SITE_ROOT.length);
+    if (pagePath == '' || pagePath.charAt(pagePath.length - 1) == '/') {
+      pagePath += 'index.html';
+    }
+  }
+
+  if (SITE_ROOT.match(/\.\.\//) || SITE_ROOT == '') {
+    // If running locally, SITE_ROOT will be a relative path, so account for that by
+    // finding the relative URL to this page. This will allow us to find links on the page
+    // leading back to this page.
+    var pathParts = pagePath.split('/');
+    var relativePagePathParts = [];
+    var upDirs = (SITE_ROOT.match(/(\.\.\/)+/) || [''])[0].length / 3;
+    for (var i = 0; i < upDirs; i++) {
+      relativePagePathParts.push('..');
+    }
+    for (var i = 0; i < upDirs; i++) {
+      relativePagePathParts.push(pathParts[pathParts.length - (upDirs - i) - 1]);
+    }
+    relativePagePathParts.push(pathParts[pathParts.length - 1]);
+    pagePath = relativePagePathParts.join('/');
+  } else {
+    // Otherwise the page path should be an absolute URL.
+    pagePath = SITE_ROOT + pagePath;
+  }
+
+  // select current page in sidenav and set up prev/next links if they exist
+  var $selNavLink = $('#nav').find('a[href="' + pagePath + '"]');
+  if ($selNavLink.length) {
+    $selListItem = $selNavLink.closest('li');
+
+    $selListItem.addClass('selected');
+    $selListItem.closest('li.nav-section').addClass('expanded');
+
+    // set up prev links
+    var $prevLink = [];
+    var $prevListItem = $selListItem.prev('li');
+    if ($prevListItem.length) {
+      if ($prevListItem.hasClass('nav-section')) {
+        // jump to last topic of previous section
+        $prevLink = $prevListItem.find('a:last');
+      } else {
+        // jump to previous topic in this section
+        $prevLink = $prevListItem.find('a:eq(0)');
+      }
+    } else {
+      // jump to this section's index page (if it exists)
+      $prevLink = $selListItem.parents('li').find('a');
+    }
+
+    if ($prevLink.length) {
+      var prevHref = $prevLink.attr('href');
+      if (prevHref == SITE_ROOT + 'index.html') {
+        // Don't show Previous when it leads to the homepage
+        $('.prev-page-link').hide();
+      } else {
+        $('.prev-page-link').attr('href', prevHref).show();
+      }
+    } else {
+      $('.prev-page-link').hide();
+    }
+
+    // set up next links
+    var $nextLink = [];
+    if ($selListItem.hasClass('nav-section')) {
+      // we're on an index page, jump to the first topic
+      $nextLink = $selListItem.find('ul').find('a:eq(0)')
+    } else {
+      // jump to the next topic in this section (if it exists)
+      $nextLink = $selListItem.next('li').find('a:eq(0)');
+      if (!$nextLink.length) {
+        // no more topics in this section, jump to the first topic in the next section
+        $nextLink = $selListItem.parents('li').next('li.nav-section').find('a:eq(0)');
+      }
+    }
+    if ($nextLink.length) {
+      $('.next-page-link').attr('href', $nextLink.attr('href')).show();
+    } else {
+      $('.next-page-link').hide();
+    }
+  }
+
+  // Set up expand/collapse behavior
+  $('#nav li.nav-section').click(function() {
+    if ($(this).hasClass('expanded')) {
+      return;
+    }
+
+    // hide other
+    var $old = $('#nav li.nav-section.expanded');
+    if ($old.length) {
+      var $oldUl = $old.children('ul');
+      $oldUl.css('height', $oldUl.height() + 'px');
+      window.setTimeout(function() {
+        $oldUl
+            .addClass('animate-height')
+            .css('height', '');
+      }, 0);
+      $old.removeClass('expanded');
+    }
+
+    // show me
+    $(this).addClass('expanded');
+    var $ul = $(this).children('ul');
+    var expandedHeight = $ul.height();
+    $ul
+        .removeClass('animate-height')
+        .css('height', 0);
+    window.setTimeout(function() {
+      $ul
+          .addClass('animate-height')
+          .css('height', expandedHeight + 'px');
+    }, 0);
+  });
+
+  // Stop expand/collapse behavior when clicking on nav section links (since we're navigating away
+  // from the page)
+  $('.nav-section-header').find('a:eq(0)').click(function(evt) {
+    window.location.href = $(this).attr('href');
+    return false;
+  });
+
+  // Set up play-on-hover <video> tags.
+  $('video.play-on-hover').bind('click', function(){
+    $(this).get(0).load(); // in case the video isn't seekable
+    $(this).get(0).play();
+  });
+
+  // Set up tooltips
+  var TOOLTIP_MARGIN = 10;
+  $('acronym').each(function() {
+    var $target = $(this);
+    var $tooltip = $('<div>')
+        .addClass('tooltip-box')
+        .text($target.attr('title'))
+        .hide()
+        .appendTo('body');
+    $target.removeAttr('title');
+
+    $target.hover(function() {
+      // in
+      var targetRect = $target.offset();
+      targetRect.width = $target.width();
+      targetRect.height = $target.height();
+
+      $tooltip.css({
+        left: targetRect.left,
+        top: targetRect.top + targetRect.height + TOOLTIP_MARGIN
+      });
+      $tooltip.addClass('below');
+      $tooltip.show();
+    }, function() {
+      // out
+      $tooltip.hide();
+    });
+  });
+});
\ No newline at end of file
diff --git a/docs/html/design/static/disclosure_down.png b/docs/html/design/static/disclosure_down.png
new file mode 100644
index 0000000..4b3ff4d
--- /dev/null
+++ b/docs/html/design/static/disclosure_down.png
Binary files differ
diff --git a/docs/html/design/static/disclosure_left.png b/docs/html/design/static/disclosure_left.png
new file mode 100644
index 0000000..607845e
--- /dev/null
+++ b/docs/html/design/static/disclosure_left.png
Binary files differ
diff --git a/docs/html/design/static/disclosure_right.png b/docs/html/design/static/disclosure_right.png
new file mode 100644
index 0000000..f3bceb1
--- /dev/null
+++ b/docs/html/design/static/disclosure_right.png
Binary files differ
diff --git a/docs/html/design/static/disclosure_up.png b/docs/html/design/static/disclosure_up.png
new file mode 100644
index 0000000..5ff6d9d
--- /dev/null
+++ b/docs/html/design/static/disclosure_up.png
Binary files differ
diff --git a/docs/html/design/static/download/RobotoSpecimenBook.pdf b/docs/html/design/static/download/RobotoSpecimenBook.pdf
new file mode 100644
index 0000000..594a366
--- /dev/null
+++ b/docs/html/design/static/download/RobotoSpecimenBook.pdf
Binary files differ
diff --git a/docs/html/design/static/download/Roboto_Hinted_20111129.zip b/docs/html/design/static/download/Roboto_Hinted_20111129.zip
new file mode 100644
index 0000000..3d3ab77
--- /dev/null
+++ b/docs/html/design/static/download/Roboto_Hinted_20111129.zip
Binary files differ
diff --git a/docs/html/design/static/download/action_bar_icons-v4.0.zip b/docs/html/design/static/download/action_bar_icons-v4.0.zip
new file mode 100644
index 0000000..4568894
--- /dev/null
+++ b/docs/html/design/static/download/action_bar_icons-v4.0.zip
Binary files differ
diff --git a/docs/html/design/static/download/color_swatches.zip b/docs/html/design/static/download/color_swatches.zip
new file mode 100644
index 0000000..0221d7b
--- /dev/null
+++ b/docs/html/design/static/download/color_swatches.zip
Binary files differ
diff --git a/docs/html/design/static/ico_action.png b/docs/html/design/static/ico_action.png
new file mode 100644
index 0000000..30e4cc7
--- /dev/null
+++ b/docs/html/design/static/ico_action.png
Binary files differ
diff --git a/docs/html/design/static/ico_good.png b/docs/html/design/static/ico_good.png
new file mode 100644
index 0000000..afebe1c
--- /dev/null
+++ b/docs/html/design/static/ico_good.png
Binary files differ
diff --git a/docs/html/design/static/ico_movie_inline.png b/docs/html/design/static/ico_movie_inline.png
new file mode 100644
index 0000000..7cfb5c5
--- /dev/null
+++ b/docs/html/design/static/ico_movie_inline.png
Binary files differ
diff --git a/docs/html/design/static/ico_phone_tablet.png b/docs/html/design/static/ico_phone_tablet.png
new file mode 100644
index 0000000..003b876
--- /dev/null
+++ b/docs/html/design/static/ico_phone_tablet.png
Binary files differ
diff --git a/docs/html/design/static/ico_styleguide.png b/docs/html/design/static/ico_styleguide.png
new file mode 100644
index 0000000..c12907c
--- /dev/null
+++ b/docs/html/design/static/ico_styleguide.png
Binary files differ
diff --git a/docs/html/design/static/ico_use.png b/docs/html/design/static/ico_use.png
new file mode 100644
index 0000000..9d868b3
--- /dev/null
+++ b/docs/html/design/static/ico_use.png
Binary files differ
diff --git a/docs/html/design/static/ico_web.png b/docs/html/design/static/ico_web.png
new file mode 100644
index 0000000..0848e3c
--- /dev/null
+++ b/docs/html/design/static/ico_web.png
Binary files differ
diff --git a/docs/html/design/static/ico_wrong.png b/docs/html/design/static/ico_wrong.png
new file mode 100644
index 0000000..b7d04ce
--- /dev/null
+++ b/docs/html/design/static/ico_wrong.png
Binary files differ
diff --git a/docs/html/design/static/jquery-1.6.2.min.js b/docs/html/design/static/jquery-1.6.2.min.js
new file mode 100644
index 0000000..8cdc80e
--- /dev/null
+++ b/docs/html/design/static/jquery-1.6.2.min.js
@@ -0,0 +1,18 @@
+/*!
+ * jQuery JavaScript Library v1.6.2
+ * http://jquery.com/
+ *
+ * Copyright 2011, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2011, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Thu Jun 30 14:16:56 2011 -0400
+ */
+(function(a,b){function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cr(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cq(){cn=b}function cp(){setTimeout(cq,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function bZ(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function bY(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bC.test(a)?d(a,e):bY(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)bY(a+"["+e+"]",b[e],c,d);else d(a,b)}function bX(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bR,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bX(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bX(a,c,d,e,"*",g));return l}function bW(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bN),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bA(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bv:bw;if(d>0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bx(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bm(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(be,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bl(a){f.nodeName(a,"input")?bk(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bk)}function bk(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bj(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bi(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bh(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)f.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function bg(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function W(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(R.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function N(a,b){return(a&&a!=="*"?a+".":"")+b.replace(z,"`").replace(A,"&")}function M(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;i<s.length;i++)g=s[i],g.origType.replace(x,"")===a.type?q.push(g.selector):s.splice(i--,1);e=f(a.target).closest(q,a.currentTarget);for(j=0,k=e.length;j<k;j++){m=e[j];for(i=0;i<s.length;i++){g=s[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,d=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,d=f(a.relatedTarget).closest(g.selector)[0],d&&f.contains(h,d)&&(d=h);(!d||d!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){e=p[j];if(c&&e.level>c)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function K(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function E(){return!0}function D(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z])/ig,x=function(a,b){return b.toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!A){A=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||D.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b){if(H)return H.call(b,a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g="done fail isResolved isRejected promise then always pipe".split(" "),h=[].slice;f.extend({_Deferred:function(){var a=[],b,c,d,e={done:function(){if(!d){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=f.type(i),j==="array"?e.done.apply(e,i):j==="function"&&a.push(i);k&&e.resolveWith(k[0],k[1])}return this},resolveWith:function(e,f){if(!d&&!b&&!c){f=f||[],c=1;try{while(a[0])a.shift().apply(e,f)}finally{b=[e,f],c=0}}return this},resolve:function(){e.resolveWith(this,arguments);return this},isResolved:function(){return!!c||!!b},cancel:function(){d=1,a=[];return this}};return e},Deferred:function(a){var b=f._Deferred(),c=f._Deferred(),d;f.extend(b,{then:function(a,c){b.done(a).fail(c);return this},always:function(){return b.done.apply(b,arguments).fail.apply(this,arguments)},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,pipe:function(a,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[c,"reject"]},function(a,c){var e=c[0],g=c[1],h;f.isFunction(e)?b[a](function(){h=e.apply(this,arguments),h&&f.isFunction(h.promise)?h.promise().then(d.resolve,d.reject):d[g](h)}):b[a](d[g])})}).promise()},promise:function(a){if(a==null){if(d)return d;d=a={}}var c=g.length;while(c--)a[g[c]]=b[g[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c<d;c++)b[c]&&f.isFunction(b[c].promise)?b[c].promise().then(i(c),g.reject):--e;e||g.resolveWith(g,b)}else g!==a&&g.resolveWith(g,d?[a]:[]);return g.promise()}}),f.support=function(){var a=c.createElement("div"),b=c.documentElement,d,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;a.setAttribute("className","t"),a.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0},m&&f.extend(p,{position:"absolute",left:-1e3,top:-1e3});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]||i[c]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h<i;h++)g=e[h].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),k(this[0],g,d[g]))}}return d}if(typeof a=="object")return this.each(function(){f.data(this,a)});var j=a.split(".");j[1]=j[1]?"."+j[1]:"";if(c===b){d=this.triggerHandler("getData"+j[1]+"!",[j[0]]),d===b&&this.length&&(d=f.data(this[0],a),d=k(this[0],a,d));return d===b&&j[1]?this.data(j[0]):d}return this.each(function(){var b=f(this),d=[j[0],c];b.triggerHandler("setData"+j[1]+"!",d),f.data(this,a,c),b.triggerHandler("changeData"+j[1]+"!",d)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,c){a&&(c=(c||"fx")+"mark",f.data(a,c,(f.data(a,c,b,!0)||0)+1,!0))},_unmark:function(a,c,d){a!==!0&&(d=c,c=a,a=!1);if(c){d=d||"fx";var e=d+"mark",g=a?0:(f.data(c,e,b,!0)||1)-1;g?f.data(c,e,g,!0):(f.removeData(c,e,!0),m(c,d,"mark"))}},queue:function(a,c,d){if(a){c=(c||"fx")+"queue";var e=f.data(a,c,b,!0);d&&(!e||f.isArray(d)?e=f.data(a,c,f.makeArray(d),!0):e.push(d));return e||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e;d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),d.call(a,function(){f.dequeue(a,b)})),c.length||(f.removeData(a,b+"queue",!0),m(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){f.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f._Deferred(),!0))h++,l.done(m);m();return d.promise()}});var n=/[\n\t\r]/g,o=/\s+/,p=/\r/g,q=/^(?:button|input)$/i,r=/^(?:button|input|object|select|textarea)$/i,s=/^a(?:rea)?$/i,t=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,u=/\:|^on/,v,w;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(o);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(o);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(n," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(o);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(n," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h<i;h++){var j=e[h];if(j.selected&&(f.support.optDisabled?!j.disabled:j.getAttribute("disabled")===null)&&(!j.parentNode.disabled||!f.nodeName(j.parentNode,"optgroup"))){b=f(j).val();if(g)return b;d.push(b)}}if(g&&!d.length&&e.length)return f(e[c]).val();return d},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=w:v&&c!=="className"&&(f.nodeName(a,"form")||u.test(c))&&(i=v)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}},value:{get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return f.prop(a,c)?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.attrHooks.title=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=/\.(.*)$/,y=/^(?:textarea|input|select)$/i,z=/\./g,A=/ /g,B=/[^\w\s.|`]/g,C=function(a){return a.replace(B,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=D;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=D);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),C).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))f.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=f.event.special[h]||{};for(j=e||0;j<p.length;j++){q=p[j];if(d.guid===q.guid){if(l||n.test(q.namespace))e==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(e!=null)break}}if(p.length===0||e!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&f.removeEvent(a,h,s.handle),g=null,delete t[h]}if(f.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,f.isEmptyObject(s)&&f.removeData(a,b,!0)}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){var h=c.type||c,i=[],j;h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.
+shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h<i;h++){var j=d[h];if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;var k=j.handler.apply(this,g);k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[f.expando])return a;var d=a;a=f.Event(d);for(var e=this.props.length,g;e;)g=this.props[--e],a[g]=d[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(a){f.event.add(this,N(a.origType,a.selector),f.extend({},a,{handler:M,guid:a.handler.guid}))},remove:function(a){f.event.remove(this,N(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!this.preventDefault)return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?E:D):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=E;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=E;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=E,this.stopPropagation()},isDefaultPrevented:D,isPropagationStopped:D,isImmediatePropagationStopped:D};var F=function(a){var b=a.relatedTarget,c=!1,d=a.type;a.type=a.data,b!==this&&(b&&(c=f.contains(this,b)),c||(f.event.handle.apply(this,arguments),a.type=d))},G=function(a){a.type=a.data,f.event.handle.apply(this,arguments)};f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={setup:function(c){f.event.add(this,b,c&&c.selector?G:F,a)},teardown:function(a){f.event.remove(this,b,a&&a.selector?G:F)}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(a,b){if(!f.nodeName(this,"form"))f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&f(b).closest("form").length&&K("submit",this,arguments)}),f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&f(b).closest("form").length&&a.keyCode===13&&K("submit",this,arguments)});else return!1},teardown:function(a){f.event.remove(this,".specialSubmit")}});if(!f.support.changeBubbles){var H,I=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},J=function(c){var d=c.target,e,g;if(!!y.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=I(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:J,beforedeactivate:J,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&J.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&J.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",I(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in H)f.event.add(this,c+".specialChange",H[c]);return y.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return y.test(this.nodeName)}},H=f.event.special.change.filters,H.focus=H.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i<j;i++)f.event.add(this[i],a,g,d);return this}}),f.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault)for(var c in a)this.unbind(c,a[c]);else for(var d=0,e=this.length;d<e;d++)f.event.remove(this[d],a,b);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f.data(this,"lastToggle"+a.guid)||0)%d;f.data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var L={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};f.each(["live","die"],function(a,c){f.fn[c]=function(a,d,e,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:f(this.context);if(typeof a=="object"&&!a.preventDefault){for(var o in a)n[c](o,d,a[o],m);return this}if(c==="die"&&!a&&g&&g.charAt(0)==="."){n.unbind(g);return this}if(d===!1||f.isFunction(d))e=d||D,d=b;a=(a||"").split(" ");while((h=a[i++])!=null){j=x.exec(h),k="",j&&(k=j[0],h=h.replace(x,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,L[h]?(a.push(L[h]+k),h=h+k):h=(L[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)f.event.add(n[p],"live."+N(h,m),{data:d,selector:m,handler:e,origType:h,origHandler:e,preType:l});else n.unbind("live."+N(h,m),e)}return this}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(!f)g=o=!0;else if(f===!0)continue}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("parentNode",b,f,a,e,c)},"~":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("previousSibling",b,f,a,e,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c<f;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){if(a===b){g=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};f.find=k,f.expr=k.selectors,f.expr[":"]=f.expr.filters,f.unique=k.uniqueSort,f.text=k.getText,f.isXMLDoc=k.isXML,f.contains=k.contains}();var O=/Until$/,P=/^(?:parents|prevUntil|prevAll)/,Q=/,/,R=/^.[^:#\[\.,]*$/,S=Array.prototype.slice,T=f.expr.match.POS,U={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(W(this,a,!1),"not",a)},filter:function(a){return this.pushStack(W(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d<e;d++)i=a[d],j[i]||(j[i]=T.test(i)?f(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=T.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(l?l.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var X=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,Z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,$=/<([\w:]+)/,_=/<tbody/i,ba=/<|&#?\w+;/,bb=/<(?:script|object|embed|option|style)/i,bc=/checked\s*(?:[^=]|=\s*.checked.)/i,bd=/\/(java|ecma)script/i,be=/^\s*<!(?:\[CDATA\[|\-\-)/,bf={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};bf.optgroup=bf.option,bf.tbody=bf.tfoot=bf.colgroup=bf.caption=bf.thead,bf.th=bf.td,f.support.htmlSerialize||(bf._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(X,""):null;if(typeof a=="string"&&!bb.test(a)&&(f.support.leadingWhitespace||!Y.test(a))&&!bf[($.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Z,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bc.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bg(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bm)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i;b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!bb.test(a[0])&&(f.support.checkClone||!bc.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[a[0]]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j
+)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bi(a,d),e=bj(a),g=bj(d);for(h=0;e[h];++h)bi(e[h],g[h])}if(b){bh(a,d);if(c){e=bj(a),g=bj(d);for(h=0;e[h];++h)bh(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!ba.test(k))k=b.createTextNode(k);else{k=k.replace(Z,"<$1></$2>");var l=($.exec(k)||["",""])[1].toLowerCase(),m=bf[l]||bf._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=_.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Y.test(k)&&o.insertBefore(b.createTextNode(Y.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bl(k[i]);else bl(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||bd.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&f.noData[j.nodeName.toLowerCase()])continue;c=j[f.expando];if(c){b=d[c]&&d[c][e];if(b&&b.events){for(var k in b.events)g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c]}}}});var bn=/alpha\([^)]*\)/i,bo=/opacity=([^)]*)/,bp=/([A-Z]|^ms)/g,bq=/^-?\d+(?:px)?$/i,br=/^-?\d/,bs=/^[+\-]=/,bt=/[^+\-\.\de]+/g,bu={position:"absolute",visibility:"hidden",display:"block"},bv=["Left","Right"],bw=["Top","Bottom"],bx,by,bz;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bx(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d;if(h==="number"&&isNaN(d)||d==null)return;h==="string"&&bs.test(d)&&(d=+d.replace(bt,"")+parseFloat(f.css(a,c)),h="number"),h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bx)return bx(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bA(a,b,d);f.swap(a,bu,function(){e=bA(a,b,d)});return e}},set:function(a,b){if(!bq.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bo.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bn.test(g)?g.replace(bn,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bx(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(by=function(a,c){var d,e,g;c=c.replace(bp,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bz=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bq.test(d)&&br.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bx=by||bz,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bB=/%20/g,bC=/\[\]$/,bD=/\r?\n/g,bE=/#.*$/,bF=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bG=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bH=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bI=/^(?:GET|HEAD)$/,bJ=/^\/\//,bK=/\?/,bL=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bM=/^(?:select|textarea)/i,bN=/\s+/,bO=/([?&])_=[^&]*/,bP=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bQ=f.fn.load,bR={},bS={},bT,bU;try{bT=e.href}catch(bV){bT=c.createElement("a"),bT.href="",bT=bT.href}bU=bP.exec(bT.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bQ)return bQ.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bL,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bM.test(this.nodeName)||bG.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bD,"\r\n")}}):{name:b.name,value:c.replace(bD,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bT,isLocal:bH.test(bU[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bW(bR),ajaxTransport:bW(bS),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?bZ(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=b$(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bF.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bE,"").replace(bJ,bU[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bN),d.crossDomain==null&&(r=bP.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bU[1]&&r[2]==bU[2]&&(r[3]||(r[1]==="http:"?80:443))==(bU[3]||(bU[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bX(bR,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bI.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bK.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bO,"$1_="+x);d.url=y+(y===d.url?(bK.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bX(bS,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bB,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn,co=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cr("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cs(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cr("hide",3),a,b,c);for(var d=0,e=this.length;d<e;d++)if(this[d].style){var g=f.css(this[d],"display");g!=="none"&&!f._data(this[d],"olddisplay")&&f._data(this[d],"olddisplay",g)}for(d=0;d<e;d++)this[d].style&&(this[d].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cr("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return this[e.queue===!1?"each":"queue"](function(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(f.support.inlineBlockNeedsLayout?(j=cs(this.nodeName),j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)k=new f.fx(this,b,i),h=a[i],cj.test(h)?k[h==="toggle"?d?"show":"hide":h]():(l=ck.exec(h),m=k.cur(),l?(n=parseFloat(l[2]),o=l[3]||(f.cssNumber[i]?"":"px"),o!=="px"&&(f.style(this,i,(n||1)+o),m=(n||1)/k.cur()*m,f.style(this,i,m+o)),l[1]&&(n=(l[1]==="-="?-1:1)*n+m),k.custom(m,n,o)):k.custom(m,h,""));return!0})},stop:function(a,b){a&&this.queue([]),this.each(function(){var a=f.timers,c=a.length;b||f._unmark(!0,this);while(c--)a[c].elem===this&&(b&&a[c](!0),a.splice(c,1))}),b||this.dequeue();return this}}),f.each({slideDown:cr("show",1),slideUp:cr("hide",1),slideToggle:cr("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default,d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function h(a){return d.step(a)}var d=this,e=f.fx,g;this.startTime=cn||cp(),this.start=a,this.end=b,this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,h.elem=this.elem,h()&&f.timers.push(h)&&!cl&&(co?(cl=!0,g=function(){cl&&(co(g),e.tick())},co(g)):cl=setInterval(e.tick,e.interval))},show:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=cn||cp(),c=!0,d=this.elem,e=this.options,g,h;if(a||b>=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b<a.length;++b)a[b]()||a.splice(b--,1);a.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cl),cl=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var ct=/^t(?:able|d|h)$/i,cu=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cv(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);f.offset.initialize();var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.offset.doesNotAddBorder&&(!f.offset.doesAddBorderForTableAndCells||!ct.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={initialize:function(){var a=c.body,b=c.createElement("div"),d,e,g,h,i=parseFloat(f.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cu.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cu.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cv(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cv(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window);
\ No newline at end of file
diff --git a/docs/html/design/static/open_new_page.png b/docs/html/design/static/open_new_page.png
new file mode 100644
index 0000000..6197e3a
--- /dev/null
+++ b/docs/html/design/static/open_new_page.png
Binary files differ
diff --git a/docs/html/design/static/yui-3.3.0-reset-min.css b/docs/html/design/static/yui-3.3.0-reset-min.css
new file mode 100644
index 0000000..00c3892
--- /dev/null
+++ b/docs/html/design/static/yui-3.3.0-reset-min.css
@@ -0,0 +1,8 @@
+/*
+Copyright (c) 2010, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.com/yui/license.html
+version: 3.3.0
+build: 3167
+*/
+html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:text-top;}sub{vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}
\ No newline at end of file
diff --git a/docs/html/design/style/color.html b/docs/html/design/style/color.html
new file mode 100644
index 0000000..893e09e
--- /dev/null
+++ b/docs/html/design/style/color.html
@@ -0,0 +1,291 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Color
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+<style>
+  .color-row {
+    width: 740px;
+    margin-left: 10px !important;
+    margin-right: 10px !important;
+
+    display:         box;
+    display: -webkit-box;
+    display:    -moz-box;
+
+            box-orient: horizontal;
+    -webkit-box-orient: horizontal;
+       -moz-box-orient: horizontal;
+
+    cursor: pointer;
+
+            user-select: none;
+    -webkit-user-select: none;
+    /* nested user-select in FF is broken as of Jan 2012, don't use it */
+  }
+
+  .color-row-container {
+    line-height: 0; /* to remove more top space in FF for -moz-box elements */
+  }
+
+  .color-row-container + .color-row-container {
+    margin-top: -10px !important;
+  }
+
+  .color-row li {
+    margin-left: 0 !important;
+    position: relative;
+    list-style-type: none;
+    height: 80px;
+    display: block;
+
+            box-flex: 1;
+    -webkit-box-flex: 1;
+       -moz-box-flex: 1;
+  }
+
+  .color-row li:before {
+    display: none;
+  }
+
+  .color-row li.thin {
+    height: 40px;
+  }
+
+  .color-row li span {
+    display: none;
+    position: absolute;
+    top: -30px;
+    left: 50%;
+    margin-left: -2.5em;
+    width: 5em;
+    background-color: #fff;
+    padding: 10px;
+    font-weight: 600;
+    line-height: 20px;
+    text-align: center;
+    box-shadow: 0 5px 5px rgba(0,0,0,0.1);
+    cursor: text;
+
+            user-select: text;
+    -webkit-user-select: text;
+    /* nested user-select in FF is broken as of Jan 2012, don't use it */
+  }
+
+  .color-row li:hover span {
+    display: block;
+  }
+
+  /*.color-row li span:before {
+    color: #999;
+    content: 'copy ';
+  }*/
+
+  /* triangle callout */
+  .color-row li span:after {
+    content: '';
+    display: block;
+    position: absolute;
+    left: 50%;
+    bottom: -16px;
+    border: 8px solid transparent;
+    border-top-color: #fff;
+    width: 0;
+    height: 0;
+    margin-left: -8px;
+  }
+</style>
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Color</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<p>Use color primarily for emphasis. Choose colors that fit with your brand and provide good contrast
+between visual components. Note that red and green may be indistinguishable to color-blind users.</p>
+
+    <div class="color-row-container">
+      <ul class="color-row">
+        <li><span>#33b5e5</span></li>
+        <li><span>#aa66cc</span></li>
+        <li><span>#99cc00</span></li>
+        <li><span>#ffbb33</span></li>
+        <li><span>#ff4444</span></li>
+      </ul>
+    </div>
+
+    <div class="color-row-container">
+      <ul class="color-row">
+        <li class="thin"><span>#0099cc</span></li>
+        <li class="thin"><span>#9933cc</span></li>
+        <li class="thin"><span>#669900</span></li>
+        <li class="thin"><span>#ff8800</span></li>
+        <li class="thin"><span>#cc0000</span></li>
+      </ul>
+    </div>
+
+<h2>Palette</h2>
+<p>Blue is the standard accent color in Android's color palette. Each color has a corresponding darker
+shade that can be used as a complement when needed.</p>
+<p><a href="../static/download/color_swatches.zip">Download the swatches</a></p>
+
+<img src="../static/content/color_spectrum.png">
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+<script>
+  $(document).ready(function() {
+    $('.color-row li').each(function() {
+      var color = $(this).text();
+      $(this).css('background-color', color);
+      $(this).find('span')
+          .css('color', color)
+          .text(color.toUpperCase());
+    });
+    
+  });
+</script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/style/devices-displays.html b/docs/html/design/style/devices-displays.html
new file mode 100644
index 0000000..9fba719
--- /dev/null
+++ b/docs/html/design/style/devices-displays.html
@@ -0,0 +1,198 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Devices and Displays
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Devices and Displays</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<p>Android powers millions of phones, tablets, and other devices in a wide variety of screen sizes and
+form factors. By taking advantage of Android's flexible layout system, you can create apps that
+gracefully scale from large tablets to smaller phones.</p>
+
+<img src="../static/content/devices_displays_main.png">
+
+<div class="vspace size-2">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-4">
+
+<h4>Be flexible</h4>
+<p>Stretch and compress your layouts to accommodate various heights and widths.</p>
+
+  </div>
+  <div class="layout-content-col span-5">
+
+<h4>Optimize layouts</h4>
+<p>On larger devices, take advantage of extra screen real estate. Create compound views that combine
+multiple views to reveal more content and ease navigation.</p>
+
+  </div>
+  <div class="layout-content-col span-4">
+
+<h4>Assets for all</h4>
+<p>Provide resources for different screen densities (<acronym title="Dots per inch">DPI</acronym>) to
+ensure that your app looks great on any device.</p>
+
+  </div>
+</div>
+
+<div style="text-align:center">
+  <img src="../static/content/devices_displays_density.png">
+</div>
+
+<h4>Strategies</h4>
+<p>So where do you begin when designing for multiple screens? One approach is to work in the base
+standard (medium size, <acronym title="Medium density (160 dpi)">MDPI</acronym>) and scale it up or
+down for the other buckets. Another approach is to start with the device with the largest screen
+size, and then scale down and figure out the UI compromises you'll need to make on smaller screens.</p>
+<p>For more detailed information on this topic, please visit <a href="http://developer.android.com/guide/practices/screens_support.html">Supporting Multiple
+Screens</a>.</p>
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/style/iconography.html b/docs/html/design/style/iconography.html
new file mode 100644
index 0000000..5d5d200
--- /dev/null
+++ b/docs/html/design/style/iconography.html
@@ -0,0 +1,494 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Iconography
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Iconography</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<img src="../static/content/iconography_overview.png">
+
+<p>An icon is a graphic that takes up a small portion of screen real estate and provides a quick,
+intuitive representation of an action, a status, or an app.</p>
+
+
+
+<h2 id="launcher">Launcher</h2>
+
+<p>The launcher icon is the visual representation of your app on the Home or All Apps screen. Since the
+user can change the Home screen's wallpaper, make sure that your launcher icon is clearly visible on
+any type of background.</p>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-4">
+
+    <img src="../static/content/iconography_launcher_size.png">
+
+  </div>
+  <div class="layout-content-col span-4">
+
+    <img src="../static/content/iconography_launcher_focal.png">
+
+  </div>
+  <div class="layout-content-col span-4">
+
+    <img src="../static/content/iconography_launcher_style.png">
+
+  </div>
+</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-4">
+
+    <h4>Sizes &amp; scale</h4>
+
+    <ul>
+      <li class="no-bullet with-icon tablet">
+        <p>Launcher icons on a mobile device must be <strong>48x48 <acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi screen.">dp</acronym></strong>.</p></li>
+      <li class="no-bullet with-icon web">
+        <p>Launcher icons for display in Market must be <strong>512x512 pixels</strong>.</p></li>
+    </ul>
+
+  </div>
+  <div class="layout-content-col span-4">
+
+    <h4>Proportions</h4>
+
+    <ul>
+      <li class="no-bullet with-icon tablet">
+        <p>Full asset, <strong>48x48 dp</strong></p>
+      </li>
+    </ul>
+
+  </div>
+  <div class="layout-content-col span-4">
+
+<h4>Style</h4>
+<p>Use a distinct silhouette. Three-dimensional, front view, with a slight perspective as if viewed
+from above, so that users perceive some depth.</p>
+
+  </div>
+</div>
+
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-4">
+    &nbsp;
+  </div>
+  <div class="layout-content-col span-7">
+
+    <img src="../static/content/iconography_launcher_example.png">
+
+  </div>
+  <!-- 2 free columns -->
+</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-12">
+
+    <img src="../static/content/iconography_launcher_example2.png">
+
+    <div class="vspace size-2">&nbsp;</div>
+
+  </div>
+  <!-- 1 free columns -->
+</div>
+
+
+<h2 id="actionbar">Action Bar</h2>
+
+<p>
+
+Action bar icons are graphic buttons that represent the most important actions people can take
+within your app. Each one should employ a simple metaphor representing a single concept that most
+people can grasp at a glance.
+
+</p>
+<p>
+
+Pre-defined glyphs should be used for certain common actions such as "refresh" and "share." The
+download link below provides a package with icons that are scaled for various screen densities and
+are suitable for use with the Holo Light and Holo Dark themes. The package also includes unstyled
+icons that you can modify to match your theme, in addition to Adobe&reg; Illustrator&reg; source
+files for further customization.
+
+</p>
+<p>
+
+<a href="../static/download/action_bar_icons-v4.0.zip">Download the Action Bar Icon
+Pack</a>
+
+</p>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-4">
+
+    <img src="../static/content/iconography_actionbar_size.png">
+
+  </div>
+  <div class="layout-content-col span-4">
+
+    <img src="../static/content/iconography_actionbar_focal.png">
+
+  </div>
+  <div class="layout-content-col span-4">
+
+    <img src="../static/content/iconography_actionbar_style.png">
+
+  </div>
+</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-4">
+
+    <h4>Sizes &amp; scale</h4>
+
+    <ul>
+      <li class="no-bullet with-icon tablet">
+        <p>Action bar icons for phones should be <strong>32x32 <acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi screen.">dp</acronym></strong>.</p></li>
+    </ul>
+
+  </div>
+  <div class="layout-content-col span-4">
+
+    <h4>Focal area &amp; proportions</h4>
+
+    <ul>
+      <li class="no-bullet with-icon tablet">
+        <p>Full asset, <strong>32x32 dp</strong></p>
+        <p>Optical square, <strong>24x24 dp</strong></p>
+      </li>
+    </ul>
+
+  </div>
+  <div class="layout-content-col span-4">
+
+<h4>Style</h4>
+<p>Pictographic, flat, not too detailed, with smooth curves or sharp shapes. If the graphic is thin,
+rotate it 45&deg; left or right to fill the focal space. The thickness of the strokes and negative
+spaces should be a minimum of 2 dp.</p>
+
+  </div>
+</div>
+
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-3">
+
+<h4>Colors</h4>
+<p>Colors: <strong>#333333</strong><br />
+Enabled: <strong>60%</strong> opacity<br />
+Disabled: <strong>30%</strong> opacity</p>
+<div class="vspace size-1">&nbsp;</div>
+
+<p>Colors: <strong>#FFFFFF</strong><br />
+Enabled: <strong>80%</strong> opacity<br />
+Disabled: <strong>30%</strong> opacity</p>
+
+  </div>
+  <div class="layout-content-col span-9">
+
+    <img src="../static/content/iconography_actionbar_colors.png">
+
+  </div>
+</div>
+
+
+<h2 id="small_contextual">Small / Contextual Icons</h2>
+
+<p>Within the body of your app, use small icons to surface actions and/or provide status for specific
+items. For example, in the Gmail app, each message has a star icon that marks the message as
+important.</p>
+
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-4">
+
+    <img src="../static/content/iconography_small_size.png">
+
+  </div>
+  <div class="layout-content-col span-4">
+
+    <img src="../static/content/iconography_small_focal.png">
+
+  </div>
+  <div class="layout-content-col span-4">
+
+    <img src="../static/content/iconography_small_style.png">
+
+  </div>
+</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-4">
+
+    <h4>Sizes &amp; scale</h4>
+
+    <ul>
+      <li class="no-bullet with-icon tablet">
+        <p>Small icons should be <strong>16x16 <acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi screen.">dp</acronym></strong>.</p></li>
+    </ul>
+
+  </div>
+  <div class="layout-content-col span-4">
+
+    <h4>Focal area &amp; proportions</h4>
+
+    <ul>
+      <li class="no-bullet with-icon tablet">
+        <p>Full asset, <strong>16x16 dp</strong></p>
+        <p>Optical square, <strong>12x12 dp</strong></p>
+      </li>
+    </ul>
+
+  </div>
+  <div class="layout-content-col span-4">
+
+<h4>Style</h4>
+<p>Neutral, flat, and simple. Filled shapes are easier to see than thin strokes. Use a single visual
+metaphor so that a user can easily recognize and understand its purpose.</p>
+
+  </div>
+</div>
+
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-4">
+
+    <img src="../static/content/iconography_small_colors.png">
+
+    <div class="vspace size-2">&nbsp;</div>
+
+<h4>Colors</h4>
+<p>Use non-neutral colors sparingly and with purpose. For example, Gmail uses yellow in the star icon
+to indicate a bookmarked message. If an icon is actionable, choose a color that contrasts well with
+the background.</p>
+
+  </div>
+  <div class="layout-content-col span-7">
+
+    <img src="../static/content/iconography_small_example.png">
+
+  </div>
+  <!-- 2 free columns -->
+</div>
+
+
+<h2 id="notification">Notification Icons</h2>
+
+<p>If your app generates notifications, provide an icon that the system can display in the status bar
+whenever a new notification is available.</p>
+
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-4">
+
+    <img src="../static/content/iconography_notification_size.png">
+
+  </div>
+  <div class="layout-content-col span-4">
+
+    <img src="../static/content/iconography_notification_focal.png">
+
+  </div>
+  <div class="layout-content-col span-4">
+
+    <img src="../static/content/iconography_notification_style.png">
+
+  </div>
+</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-4">
+
+    <h4>Sizes &amp; scale</h4>
+
+    <ul>
+      <li class="no-bullet with-icon tablet">
+        <p>Notification icons must be <strong>24x24 <acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi screen.">dp</acronym></strong>.</p></li>
+    </ul>
+
+  </div>
+  <div class="layout-content-col span-4">
+
+    <h4>Focal area &amp; proportions</h4>
+
+    <ul>
+      <li class="no-bullet with-icon tablet">
+        <p>Full asset, <strong>24x24 dp</strong></p>
+        <p>Optical square, <strong>22x22 dp</strong></p>
+      </li>
+    </ul>
+
+  </div>
+  <div class="layout-content-col span-4">
+
+<h4>Style</h4>
+<p>Keep the style flat and simple, using the same single, visual metaphor as your launcher icon.</p>
+
+  </div>
+</div>
+
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-4">
+
+<h4>Colors</h4>
+<p>Notification icons must be entirely white. Also, the system may scale down and/or darken the icons.</p>
+
+  </div>
+  <div class="layout-content-col span-7">
+
+    <img src="../static/content/iconography_notification_example.png">
+
+  </div>
+  <!-- 2 free columns -->
+</div>
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/style/index.html b/docs/html/design/style/index.html
new file mode 100644
index 0000000..5ecbafa
--- /dev/null
+++ b/docs/html/design/style/index.html
@@ -0,0 +1,171 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Design Elements
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+<style>
+#landing-graphic-container {
+  position: relative;
+}
+
+#text-overlay {
+  position: absolute;
+  left: 10px;
+  top: 402px;
+  width: 220px;
+}
+</style>
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+<div class="layout-content-row content-header just-links">
+  <div class="layout-content-col span-9">&nbsp;</div>
+  <div class="paging-links layout-content-col span-4">
+    <a href="#" class="prev-page-link">Previous</a>
+    <a href="#" class="next-page-link">Next</a>
+  </div>
+</div>
+
+
+          
+
+<div id="landing-graphic-container">
+  <div id="text-overlay">
+    Build visually compelling apps that look great on any device. 
+    <br><br>
+    <a href="../style/devices-displays.html" class="landing-page-link">Devices and Displays</a>
+  </div>
+
+  <a href="../style/devices-displays.html">
+    <img src="../static/content/design_elements_landing.png">
+  </a>
+</div>
+
+
+
+          
+
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/style/metrics-grids.html b/docs/html/design/style/metrics-grids.html
new file mode 100644
index 0000000..17d4937
--- /dev/null
+++ b/docs/html/design/style/metrics-grids.html
@@ -0,0 +1,214 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Metrics and Grids
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Metrics and Grids</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<p>Devices vary not only in physical size, but also in screen density (<acronym title="Dots per
+inch">DPI</acronym>). To simplify the way you design for multiple screens, think of each device as
+falling into a particular size bucket and density bucket. The size buckets are <em>handset</em> (smaller than
+600<acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi
+screen.">dp</acronym>) and <em>tablet</em> (larger than or equal 600dp). The density buckets are <acronym
+title="Low density (120 dpi)">LDPI</acronym>, <acronym title="Medium density (160
+dpi)">MDPI</acronym>, <acronym title="High density (240 dpi)">HDPI</acronym>, and <acronym title
+="Extra-high density (320 dpi)">XHDPI</acronym>. Optimize your application's UI by designing
+alternative layouts for some of the different size buckets, and provide alternative bitmap images
+for different density buckets.</p>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-8">
+
+    <img src="../static/content/metrics_diagram.png">
+
+  </div>
+  <div class="layout-content-col span-5">
+
+<h4>Space considerations</h4>
+<p>Devices vary in the amount of density-independent pixels (dp) they can display.</p>
+<p>To see more, visit the
+<a href="http://developer.android.com/resources/dashboard/screens.html" target="_blank">
+Screen Sizes and Densities Device Dashboard</a>.</p>
+
+  </div>
+</div>
+
+<h2>48dp Rhythm</h2>
+
+<p>Touchable UI components are generally laid out along 48dp units.</p>
+
+<img src="../static/content/metrics_48.png">
+
+<div class="vspace size-2">&nbsp;</div>
+
+<h4>Why 48dp?</h4>
+<p>On average, 48dp translate to a physical size of about 9mm (with some variability). This is
+comfortably in the range of recommended target sizes (7-10 mm) for touchscreen objects and users
+will be able to reliably and accurately target them with their fingers.</p>
+<p>If you design your elements to be at least 48dp high and wide you can guarantee that:</p>
+<ul>
+<li>your targets will never be smaller than the minimum recommended target size of 7mm regardless of
+  what screen they are displayed on.</li>
+<li>you strike a good compromise between overall information density on the one hand, and
+  targetability of UI elements on the other.</li>
+</ul>
+
+<img src="../static/content/metrics_closeup.png">
+
+<div class="vspace size-2">&nbsp;</div>
+
+<h4>Mind the gaps</h4>
+<p>Spacing between each UI element is 8dp.</p>
+
+<h2>Examples</h2>
+
+<img src="../static/content/metrics_forms.png">
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/style/themes.html b/docs/html/design/style/themes.html
new file mode 100644
index 0000000..ada974d
--- /dev/null
+++ b/docs/html/design/style/themes.html
@@ -0,0 +1,195 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Themes
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Themes</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-5">
+
+    <img src="../static/content/themes_holo_light.png">
+    <div class="figure-caption">
+      Gmail in Holo Light.
+    </div>
+
+    <img src="../static/content/themes_holo_dark.png">
+    <div class="figure-caption">
+      Settings in Holo Dark.
+    </div>
+
+    <img src="../static/content/themes_holo_inverse.png">
+    <div class="figure-caption">
+      Talk in Holo Light with dark action bar.
+    </div>
+
+  </div>
+  <div class="layout-content-col span-7">
+
+<p>Themes are Android's mechanism for applying a consistent style to an app or activity. The style
+specifies the visual properties of the elements that make up your user interface, such as color,
+height, padding and font size. To promote greater cohesion between all apps on the platform, Android
+provides three system themes that you can choose from when building apps for Ice Cream Sandwich:</p>
+<ul>
+<li>Holo Light</li>
+<li>Holo Dark</li>
+<li>Holo Light with dark action bars</li>
+</ul>
+<p>Applying these themes will go a long way in helping you to build apps that fit right into the
+general visual language of Android.</p>
+<p>Pick the system theme that best matches the needs and design aesthetics for your app. If your
+desire is to have a more distinct look for your app, using one of the system themes as a starting
+point for your customizations is a good idea. The system themes provide a solid foundation on top
+of which you can selectively implement your own visual stylings.</p>
+
+  </div>
+</div>
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/style/touch-feedback.html b/docs/html/design/style/touch-feedback.html
new file mode 100644
index 0000000..0d49832
--- /dev/null
+++ b/docs/html/design/style/touch-feedback.html
@@ -0,0 +1,220 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Touch Feedback
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Touch Feedback</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<div class="layout-content-row" style="margin-bottom: -100px">
+  <div class="layout-content-col span-7">
+
+<p>Use color and illumination to respond to touches, reinforce the resulting behaviors of gestures, and
+indicate what actions are enabled and disabled.</p>
+<p>Whenever a user touches an actionable area in your app, provide a visual response. This lets the
+user know which object was touched and that your app is "listening".</p>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/touch_feedback_reaction_response.png">
+
+  </div>
+</div>
+
+<h4>States</h4>
+
+<div class="vspace size-1">&nbsp;</div>
+
+<img src="../static/content/touch_feedback_states.png">
+<div class="figure-caption">
+  Most of Android's UI elements have touch-feedback built in, including states that indicate
+  whether touching the element will have any effect.
+</div>
+
+<div class="vspace size-4">&nbsp;</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-4">
+
+<h4>Communication</h4>
+<p>When your objects react to more complex gestures, help users understand what the outcome of the
+operation will be. For example, in Recents, when you start swiping a thumbnail left or right, it
+starts to dim. This helps the user understand that swiping will cause the item to be removed.</p>
+
+  </div>
+  <div class="layout-content-col span-9">
+
+    <img src="../static/content/touch_feedback_manipulation.png">
+
+  </div>
+</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6">
+
+    <img src="../static/content/touch_feedback_communication.png">
+
+  </div>
+  <div class="layout-content-col span-6">
+
+<div class="vspace size-3">&nbsp;</div>
+
+<h4>Boundaries</h4>
+<p>When users try to scroll past the upper or lower limit of a scrollable area, communicate the
+boundary with a visual cue. For example, if a user attempts to scroll past the first home screen
+panel, the screen content tilts to the right to indicate that further navigation in this direction
+is not possible. Many of Android's scrollable UI widgets (e.g. lists or grid lists) already have
+support for boundary feedback built in. If you are building custom, keep boundary feedback in mind
+and provide it from within your app.</p>
+
+  </div>
+</div>
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/style/typography.html b/docs/html/design/style/typography.html
new file mode 100644
index 0000000..d3cc769
--- /dev/null
+++ b/docs/html/design/style/typography.html
@@ -0,0 +1,210 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Typography
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Typography</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-8">
+
+    <img src="../static/content/typography_main.png">
+
+  </div>
+  <div class="layout-content-col span-5">
+
+<p>The Android design language relies on traditional typographic tools such as scale, space, rhythm,
+and alignment with an underlying grid. Successful deployment of these tools is essential to help
+users quickly understand a screen of information. To support such use of typography, Ice Cream
+Sandwich introduced a new type family named Roboto, created specifically for the requirements of UI
+and high-resolution screens. The current TextView framework supports regular, bold, italic, and bold
+italic weights by default.</p>
+
+    <img src="../static/content/typography_alphas.png">
+
+<p><a href="../static/download/Roboto_Hinted_20111129.zip">Download Roboto</a></p>
+<p><a href="../static/download/RobotoSpecimenBook.pdf">Specimen Book</a></p>
+
+  </div>
+</div>
+
+<hr>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6">
+
+<h4>Default type colors</h4>
+<p>The Android UI uses the following default color styles: <code>textColorPrimary</code> and
+<code>textColorSecondary</code>. For light themes use <code>textColorPrimaryInverse</code> and
+<code>textColorSecondaryInverse</code>. The framework text color styles also support variants for
+touch feedback states when used inside UI elements.</p>
+
+    <img src="../static/content/typography_defaults.png">
+
+  </div>
+  <div class="layout-content-col span-6">
+
+<h4>Typographic Scale</h4>
+<p>Contrast in type sizes can go a long way to create ordered, understandable layouts. However, too
+many different sizes in the same UI can be messy. The Android framework uses the following limited
+set of type sizes:</p>
+
+<img src="../static/content/typography_sizes.png">
+
+<p>Users can select a system-wide scaling factor for text in the Settings app. In order to support
+these accessibility features, type should be specified in scale-independent pixels
+(<acronym title="Scale-independent pixels. One sp is one pixel on a 160 dpi screen if the user's global text scale is set to 100%.">sp</acronym>)
+wherever possible. Layouts supporting scalable types should be tested against these settings.</p>
+
+  </div>
+</div>
+
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/design/style/writing.html b/docs/html/design/style/writing.html
new file mode 100644
index 0000000..e5f1ea8
--- /dev/null
+++ b/docs/html/design/style/writing.html
@@ -0,0 +1,483 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+
+Android Design - Writing Style
+    </title>
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
+    <link rel="stylesheet" href="../static/default.css">
+
+<style>
+
+/* UI tables */
+
+.ui_table {
+  width: 100%;
+  background: #282828;
+  color: #fff;
+  border-radius: 2px;
+  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
+  border-collapse: separate;
+}
+
+.ui_table th,
+.ui_table td {
+  padding: 5px 10px;
+}
+
+.ui_table thead th {
+  font-weight: 600;
+}
+
+.ui_table tfoot td {
+  border-top: 1px solid #494949;
+  border-right: 1px solid #494949;
+  text-align: center;
+}
+
+.ui_table tfoot td:last-child {
+  border-right: 0;
+}
+
+.list_item_margins {
+  margin-left: 30px !important;
+}
+
+.example_label {
+  margin-bottom: 10px;
+  padding-left: 20px;
+  background: transparent none no-repeat scroll 0px 3px;
+}
+
+.example_label.bad {
+  background-image: url(../static/ico_wrong.png);
+}
+
+.example_label.good {
+  background-image: url(../static/ico_good.png);
+}
+
+</style>
+
+  </head>
+  <body>
+
+    <div id="page-container">
+
+      <div id="page-header"><a href="../index.html">Android Design</a></div>
+
+      <div id="main-row">
+
+        <ul id="nav">
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
+            <ul>
+              <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
+              <li><a href="../get-started/principles.html">Design Principles</a></li>
+              <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
+            <ul>
+              <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
+              <li><a href="../style/themes.html">Themes</a></li>
+              <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
+              <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
+              <li><a href="../style/typography.html">Typography</a></li>
+              <li><a href="../style/color.html">Color</a></li>
+              <li><a href="../style/iconography.html">Iconography</a></li>
+              <li><a href="../style/writing.html">Writing Style</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
+            <ul>
+              <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
+              <li><a href="../patterns/gestures.html">Gestures</a></li>
+              <li><a href="../patterns/app-structure.html">App Structure</a></li>
+              <li><a href="../patterns/navigation.html">Navigation</a></li>
+              <li><a href="../patterns/actionbar.html">Action Bar</a></li>
+              <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+              <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
+              <li><a href="../patterns/selection.html">Selection</a></li>
+              <li><a href="../patterns/notifications.html">Notifications</a></li>
+              <li><a href="../patterns/compatibility.html">Compatibility</a></li>
+              <li><a href="../patterns/pure-android.html">Pure Android</a></li>
+            </ul>
+          </li>
+
+          <li class="nav-section">
+            <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
+            <ul>
+              <li><a href="../building-blocks/tabs.html">Tabs</a></li>
+              <li><a href="../building-blocks/lists.html">Lists</a></li>
+              <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
+              <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
+              <li><a href="../building-blocks/spinners.html">Spinners</a></li>
+              <li><a href="../building-blocks/buttons.html">Buttons</a></li>
+              <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
+              <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
+              <li><a href="../building-blocks/progress.html">Progress &amp; Activity</a></li>
+              <li><a href="../building-blocks/switches.html">Switches</a></li>
+              <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
+              <li><a href="../building-blocks/pickers.html">Pickers</a></li>
+            </ul>
+          </li>
+
+          <li>
+            <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
+          </li>
+
+        </ul>
+
+        <div id="content">
+
+          
+          <div class="layout-content-row content-header">
+            <div class="layout-content-col span-9">
+              <h2>Writing Style</h2>
+            </div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+
+          
+
+<p>When choosing words for your app:</p>
+<ol>
+<li>
+<p><strong>Keep it brief.</strong> Be concise, simple and precise. Start with a 30 character limit (including
+   spaces), and don't use more unless absolutely necessary.</p>
+</li>
+<li>
+<p><strong>Keep it simple.</strong> Pretend you're speaking to someone who's smart and competent, but doesn't
+   know technical jargon and may not speak English very well. Use short words, active verbs, and
+   common nouns.</p>
+</li>
+<li>
+<p><strong>Be friendly.</strong> Use contractions. Talk directly to the reader using second person ("you"). If
+   your text doesn't read the way you'd say it in casual conversation, it's probably not the way
+   you should write it. Don't be abrupt or annoying and make the user feel safe, happy and
+   energized.</p>
+</li>
+<li>
+<p><strong>Put the most important thing first.</strong> The first two words (around 11 characters, including
+   spaces) should include at least a taste of the most important information in the string. If they
+   don't, start over.</p>
+</li>
+<li>
+<p><strong>Describe only what's necessary, and no more.</strong> Don't try to explain subtle differences. They
+   will be lost on most users.</p>
+</li>
+<li>
+<p><strong>Avoid repetition.</strong> If a significant term gets repeated within a screen or block of text, find
+   a way to use it just once.</p>
+</li>
+</ol>
+
+<h2>Examples</h2>
+
+<ol><li class="value-1"><strong>Keep it brief.</strong> From the setup wizard:</ol>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6 list_item_margins">
+
+    <div class="example_label bad">Too formal</div>
+
+    <table class="ui_table good"><tbody><tr><td>
+    Consult the documentation that came with your phone for further instructions.
+    </td></tr></tbody></table>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <div class="example_label good">Better</div>
+
+    <table class="ui_table good"><tbody><tr><td>
+    Read the instructions that came with your phone.
+    </td></tr></tbody></table>
+
+  </div>
+</div>
+
+<div class="vspace size-1">&nbsp;</div>
+
+<ol><li class="value-2"><strong>Keep it simple.</strong> From the Location settings screen:</ol>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6 list_item_margins">
+
+    <div class="example_label bad">Confusing</div>
+
+    <table class="ui_table bad">
+    <thead>
+      <tr>
+        <th>
+        Use GPS satellites
+        </th>
+      </tr>
+    </thead>
+    <tbody>
+      <tr>
+        <td>
+        When locating, accurate to street level.
+        </td>
+      </tr>
+    </tbody>
+    </table>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <div class="example_label good">Better</div>
+
+    <table class="ui_table good">
+    <thead>
+      <tr>
+        <th>
+        GPS
+        </th>
+      </tr>
+    </thead>
+    <tbody>
+      <tr>
+        <td>
+        Let apps use satellites to pinpoint your location.
+        </td>
+      </tr>
+    </tbody>
+    </table>
+
+  </div>
+</div>
+
+<div class="vspace size-1">&nbsp;</div>
+
+<ol><li class="value-3"><strong>Be friendly.</strong> Dialog that appears when an application
+crashes:</ol>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6 list_item_margins">
+
+    <div class="example_label bad">Confusing and annoying&mdash;"Sorry" just rubs salt in the
+    wound.</div>
+
+    <table class="ui_table bad">
+    <thead>
+      <tr>
+        <th colspan="3">
+        Sorry!
+        </th>
+      </tr>
+    </thead>
+    <tbody>
+      <tr>
+        <td colspan="3">
+        Activity MyAppActivity (in application MyApp)
+        is not responding.
+        </td>
+      </tr>
+    </tbody>
+    <tfoot>
+      <tr>
+        <td width="33%">Force close</td>
+        <td width="33%">Wait</td>
+        <td width="33%">Report</td>
+      </tr>
+    </tbody>
+    </table>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <div class="example_label good">Shorter, more direct, no faux-apologetic title:<br><br></div>
+
+    <table class="ui_table good">
+    <thead>
+      <tr>
+        <th colspan="3">
+        MyApp isn't responding.
+        </th>
+      </tr>
+    </thead>
+    <tbody>
+      <tr>
+        <td colspan="3">
+        Do you want to close it?
+        </td>
+      </tr>
+    </tbody>
+    <tfoot>
+      <tr>
+        <td width="33%">Wait</td>
+        <td width="33%">Report</td>
+        <td width="33%">Close</td>
+      </tr>
+    </tbody>
+    </table>
+
+  </div>
+</div>
+
+<div class="vspace size-1">&nbsp;</div>
+
+<ol><li class="value-4"><strong>Put the most important thing first.</strong></ol>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6 list_item_margins">
+
+    <div class="example_label bad">Top news last</div>
+
+    <table class="ui_table bad"><tbody><tr><td>
+    77 other people +1'd this, including Larry Page.
+    </td></tr></tbody></table>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <div class="example_label good">Top news first</div>
+
+    <table class="ui_table good"><tbody><tr><td>
+    Larry Page and 77 others +1'd this.
+    </td></tr></tbody></table>
+
+  </div>
+</div>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6 list_item_margins">
+
+    <div class="example_label bad">Task last</div>
+
+    <table class="ui_table bad"><tbody><tr><td>
+    Touch Next to complete setup using a Wi-Fi connection.
+    </td></tr></tbody></table>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <div class="example_label good">Task first</div>
+
+    <table class="ui_table good"><tbody><tr><td>
+    To finish setup using Wi-Fi, touch Next.
+    </td></tr></tbody></table>
+
+  </div>
+</div>
+
+<div class="vspace size-1">&nbsp;</div>
+
+<ol><li class="value-5"><strong>Describe only what's necessary, and no more.</strong></ol>
+
+<div class="layout-content-row">
+  <div class="layout-content-col span-6 list_item_margins">
+
+    <div class="example_label bad">From a Setup Wizard screen</div>
+
+    <table class="ui_table bad">
+    <thead>
+      <tr>
+        <th>
+        Signing in...
+        </th>
+      </tr>
+    </thead>
+    <tbody>
+      <tr>
+        <td>
+        Your phone needs to communicate with<br>
+        Google servers to sign in to your account.<br>
+        This may take up to five minutes.
+        </td>
+      </tr>
+    </tbody>
+    </table>
+
+  </div>
+  <div class="layout-content-col span-6">
+
+    <div class="example_label good">From a Setup Wizard screen</div>
+
+    <table class="ui_table good">
+    <thead>
+      <tr>
+        <th>
+        Signing in...
+        </th>
+      </tr>
+    </thead>
+    <tbody>
+      <tr>
+        <td>
+        Your phone is contacting Google.<br>
+        This can take up to 5 minutes.
+        </td>
+      </tr>
+    </tbody>
+    </table>
+
+  </div>
+</div>
+
+
+
+          
+          <div class="layout-content-row content-footer">
+            <div class="paging-links layout-content-col span-9">&nbsp;</div>
+            <div class="paging-links layout-content-col span-4">
+              <a href="#" class="prev-page-link">Previous</a>
+              <a href="#" class="next-page-link">Next</a>
+            </div>
+          </div>
+          
+        </div>
+
+      </div>
+
+      <div id="page-footer">
+
+        <p id="copyright">
+          Except as noted, this content is licensed under
+          <a href="http://creativecommons.org/licenses/by/2.5/">
+          Creative Commons Attribution 2.5</a>.<br>
+          For details and restrictions, see the
+          <a href="http://developer.android.com/license.html">Content License</a>.
+        </p>
+
+        <p>
+          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+        </p>
+
+      </div>
+    </div>
+
+    <script src="../static/jquery-1.6.2.min.js"></script>
+    <script>
+    var SITE_ROOT = '../';
+    </script>
+    <script src="../static/default.js"></script>
+
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    var pageTracker = _gat._getTracker("UA-5831155-1");
+    pageTracker._trackPageview();
+    </script>
+  </body>
+</html>
diff --git a/docs/html/guide/appendix/api-levels.jd b/docs/html/guide/appendix/api-levels.jd
index 7d119ca..cc98f8f 100644
--- a/docs/html/guide/appendix/api-levels.jd
+++ b/docs/html/guide/appendix/api-levels.jd
@@ -154,7 +154,7 @@
     <td>2</td>
     <td>{@link android.os.Build.VERSION_CODES#BASE_1_1}</td><td></td></tr>
     
-  <tr><td><a href="{@docRoot}sdk/android-1.0.html">Android 1.0</td>
+  <tr><td>Android 1.0</td>
     <td>1</td>
     <td>{@link android.os.Build.VERSION_CODES#BASE}</td>
     <td></td></tr>
diff --git a/docs/html/guide/appendix/market-filters.jd b/docs/html/guide/appendix/market-filters.jd
index 6610f5f..d9b2155 100644
--- a/docs/html/guide/appendix/market-filters.jd
+++ b/docs/html/guide/appendix/market-filters.jd
@@ -165,10 +165,10 @@
 
     <p><strong>Example 1</strong><br />
     The manifest declares <code>&lt;uses-sdk android:minSdkVersion="3"&gt;</code>
-    and does not does not include a <code>&lt;supports-screens&gt;</code> element.
-    <strong>Result</strong>: Android Market will not show the app to a user of a
-    small-screen device, but will show it to users of normal and large-screen
-    devices,  users, unless  other filters apply. </p>
+    and does not include a <code>&lt;supports-screens&gt;</code> element.
+    <strong>Result</strong>: Android Market does not show the app to a user of a
+    small-screen device, but does show it to users of normal and large-screen
+    devices, unless  other filters also exclude those devices. </p>
     <p><strong>Example 2<br />
     </strong>The manifest declares <code>&lt;uses-sdk android:minSdkVersion="3"
     android:targetSdkVersion="4"&gt;</code> and does not include a
@@ -398,8 +398,8 @@
       the device's SIM (for GSM devices), not the current roaming carrier.</p></li></ul>
 </td> </tr> <tr>
   <td valign="top">Native Platform</td> <td valign="top"><p>An application that includes native
-    libraries that target a specific platform (ARM EABI v7, for example) will only be
-    visible on devices that support that platform. For details about the NDK and using
+    libraries that target a specific platform (ARM EABI v7 or x86, for example) are
+    visible only on devices that support that platform. For details about the NDK and using
     native libraries, see <a href="{@docRoot}sdk/ndk/index.html#overview">What is the
       Android NDK?</a></p> </tr> <tr>
         <td valign="top">Copy-Protected Applications</td> <td valign="top"><p>To
diff --git a/docs/html/guide/developing/device.jd b/docs/html/guide/developing/device.jd
index 62ebfee..d390ec1 100644
--- a/docs/html/guide/developing/device.jd
+++ b/docs/html/guide/developing/device.jd
@@ -79,10 +79,8 @@
   <a href="{@docRoot}sdk/oem-usb.html">OEM USB Drivers</a> document.</li>
       <li>If you're developing on Mac OS X, it just works. Skip this step.</li>
       
-      <li>If you're developing on Ubuntu Linux, you need to add a <a
-href="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html">
-<code>udev</code></a> 
-rules file that contains a USB configuration for each type of device
+      <li>If you're developing on Ubuntu Linux, you need to add a
+<code>udev</code> rules file that contains a USB configuration for each type of device
 you want to use for development. In the rules file, each device manufacturer
 is identified by a unique vendor ID, as specified by the
 <code>ATTR{idVendor}</code> property. For a list of vendor IDs, see  <a
@@ -156,6 +154,14 @@
     <td><code>0489</code></td>
   </tr>
   <tr>
+    <td>Fujitsu</td>
+    <td><code>04C5</code></td>
+  </tr>
+  <tr>
+    <td>Fujitsu Toshiba</td>
+    <td><code>04C5</code></td>
+  </tr>
+  <tr>
     <td>Garmin-Asus</td>
     <td><code>091E</code></td>
   </tr>
@@ -248,6 +254,10 @@
     <td><code>04DD</code></td>
   </tr>
   <tr>
+    <td>Sony</td>
+    <td><code>054C</code></td>
+  </tr>
+  <tr>
     <td>Sony Ericsson</td>
     <td><code>0FCE</code></td>
   </tr>
diff --git a/docs/html/guide/developing/devices/emulator.jd b/docs/html/guide/developing/devices/emulator.jd
index 8211275..02dcb68 100644
--- a/docs/html/guide/developing/devices/emulator.jd
+++ b/docs/html/guide/developing/devices/emulator.jd
@@ -480,7 +480,7 @@
   <td>Enable the root shell (as in <code>-shell</code> and specify the QEMU character 
   device to use for communication with the shell.</td>
   <td>&lt;device&gt; must be a QEMU device type. See the documentation for '-serial <em>dev</em>' at 
-  <a href="http://www.nongnu.org/qemu/qemu-doc.html#SEC10">http://www.bellard.org/qemu/qemu-doc.html#SEC10</a> 
+  <a href="http://wiki.qemu.org/download/qemu-doc.html">http://wiki.qemu.org/download/qemu-doc.html</a> 
   for a list of device types.
 
 <p>Here are some examples: </p>
@@ -619,7 +619,7 @@
   <td>Use this command to emulate an NMEA-compatible GPS unit connected to
   an external character device or socket. The format of <code>&lt;device&gt;</code> must be QEMU-specific 
   serial device specification. See the documentation for 'serial -dev' at 
-  <a href="http://www.bellard.org/qemu/qemu-doc.html#SEC10">http://www.bellard.org/qemu/qemu-doc.html#SEC10</a>.
+  <a href="http://wiki.qemu.org/download/qemu-doc.html">http://wiki.qemu.org/download/qemu-doc.html</a>.
 </td>
 </tr>
 <tr>
@@ -638,7 +638,7 @@
   <td>Redirect radio mode to the specified character device.</td>
   <td>The format of <code>&lt;device&gt;</code> must be QEMU-specific 
   serial device specification. See the documentation for 'serial -dev' at 
-<a href="http://www.bellard.org/qemu/qemu-doc.html#SEC10">http://www.bellard.org/qemu/qemu-doc.html#SEC10</a>.
+<a href="http://wiki.qemu.org/download/qemu-doc.html">http://wiki.qemu.org/download/qemu-doc.html</a>.
 </td>
 </tr>
 <tr>
diff --git a/docs/html/guide/guide_toc.cs b/docs/html/guide/guide_toc.cs
index a9c4d30..4a9a684 100644
--- a/docs/html/guide/guide_toc.cs
+++ b/docs/html/guide/guide_toc.cs
@@ -8,15 +8,16 @@
 <ul>
 
   <li>
-    <h2><span class="en">Android Basics</span>
-        <span class="de" style="display:none">Einführung in Android</span>
-        <span class="es" style="display:none">Información básica sobre Android</span>
-        <span class="fr" style="display:none">Présentation d'Android</span>
-        <span class="it" style="display:none">Nozioni di base su Android</span>
-        <span class="ja" style="display:none">Android の基本</span>
-        <span class="zh-CN" style="display:none">Android 基础知识</span>
-        <span class="zh-TW" style="display:none">Android 簡介</span>
-    </h2>
+    <span class="heading">
+      <span class="en">Android Basics</span>
+      <span class="de" style="display:none">Einführung in Android</span>
+      <span class="es" style="display:none">Información básica sobre Android</span>
+      <span class="fr" style="display:none">Présentation d'Android</span>
+      <span class="it" style="display:none">Nozioni di base su Android</span>
+      <span class="ja" style="display:none">Android の基本</span>
+      <span class="zh-CN" style="display:none">Android 基础知识</span>
+      <span class="zh-TW" style="display:none">Android 簡介</span>
+    </span>
     <ul>
       <li><a href="<?cs var:toroot ?>guide/basics/what-is-android.html">
         <span class="en">What Is Android?</span>
@@ -46,7 +47,7 @@
   </li>
 
   <li>
-    <h2>
+    <span class="heading">
       <span class="en">Framework Topics</span>
       <span class="de" style="display:none">Framework-Themen</span>
       <span class="es" style="display:none">Temas sobre el framework</span>
@@ -55,7 +56,7 @@
       <span class="ja" style="display:none">フレームワーク トピック</span>
       <span class="zh-CN" style="display:none">框架主题</span>
       <span class="zh-TW" style="display:none">架構主題</span>
-    </h2>
+    </span>
     <ul>
       <li class="toggle-list">
         <div><a href="<?cs var:toroot ?>guide/topics/fundamentals/activities.html">
@@ -87,10 +88,24 @@
             <span class="en">Content Providers</span>
           </a></div>
           <ul>
-            <li><a href="<?cs var:toroot ?>guide/topics/providers/calendar-provider.html">
-                  <span class="en">Calendar Provider</span></a>
-                  <span class="new">new!</span>
-                </li>
+            <li>
+                <a href="<?cs var:toroot ?>guide/topics/providers/content-provider-basics.html">
+                    <span class="en">Content Provider Basics</span>
+                </a>
+                <span class="new">new!</span>
+            </li>
+            <li>
+                <a href="<?cs var:toroot ?>guide/topics/providers/content-provider-creating.html">
+                    <span class="en">Creating a Content Provider</span>
+                </a>
+                <span class="new">new!</span>
+            </li>
+            <li>
+                <a href="<?cs var:toroot ?>guide/topics/providers/calendar-provider.html">
+                    <span class="en">Calendar Provider</span>
+                </a>
+                <span class="new">new!</span>
+            </li>
           </ul>
       </li>
       <li><a href="<?cs var:toroot ?>guide/topics/intents/intents-filters.html">
@@ -116,7 +131,7 @@
               </a></li>
           <li><a href="<?cs var:toroot ?>guide/topics/ui/menus.html">
                <span class="en">Menus</span>
-              </a></li>
+              </a> <span class="new">updated</span></li>
           <li><a href="<?cs var:toroot ?>guide/topics/ui/actionbar.html">
                <span class="en">Action Bar</span>
               </a></li>
@@ -271,7 +286,8 @@
       </li>
       <li class="toggle-list">
         <div><a href="<?cs var:toroot ?>guide/topics/renderscript/index.html">
-          <span class="en">RenderScript</span></a>
+          <span class="en">Renderscript</span></a>
+          <span class="new">updated</span>
         </div>
         <ul>
           <li><a href="<?cs var:toroot ?>guide/topics/renderscript/graphics.html">
@@ -282,6 +298,10 @@
                 <span class="en">Compute</span>
               </a>
           </li>
+          <li><a href="<?cs var:toroot ?>guide/topics/renderscript/reference.html">
+                <span class="en">Runtime API Reference</span>
+              </a>
+          </li>
         </ul>
       </li>
 
@@ -360,6 +380,9 @@
           <li><a href="<?cs var:toroot ?>guide/topics/nfc/advanced-nfc.html">Advanced NFC</a></li>
         </ul>
       </li>
+      <li><a href="<?cs var:toroot?>guide/topics/wireless/wifip2p.html">
+            <span class="en">Wi-Fi Direct</span></a> <span class="new">new!</span>
+          </li>
       <li class="toggle-list">
           <div><a href="<?cs var:toroot?>guide/topics/usb/index.html">
             <span class="en">USB</span></a>
@@ -421,9 +444,9 @@
   </li>
 
   <li>
-    <h2>
+    <span class="heading">
       <span class="en">Android Market Topics</span>
-    </h2>
+    </span>
     <ul>
       <li><a href="<?cs var:toroot ?>guide/publishing/publishing.html">
           <span class="en">Publishing on Android Market</span>
@@ -467,15 +490,16 @@
 
 
   <li>
-    <h2><span class="en">Developing</span>
-               <span class="de" style="display:none">Entwicklung</span>
-               <span class="es" style="display:none">Desarrollo</span>
-               <span class="fr" style="display:none">Développement</span>
-               <span class="it" style="display:none">Sviluppo</span>
-               <span class="ja" style="display:none">開発</span>
-               <span class="zh-CN" style="display:none">开发</span>
-               <span class="zh-TW" style="display:none">開發</span>
-    </h2>
+    <span class="heading">
+      <span class="en">Developing</span>
+      <span class="de" style="display:none">Entwicklung</span>
+      <span class="es" style="display:none">Desarrollo</span>
+      <span class="fr" style="display:none">Développement</span>
+      <span class="it" style="display:none">Sviluppo</span>
+      <span class="ja" style="display:none">開発</span>
+      <span class="zh-CN" style="display:none">开发</span>
+      <span class="zh-TW" style="display:none">開發</span>
+    </span>
     <ul>
   <!--<li><a href="">Developing for Android</a></li>
       signing, upgrading, selecting a package name, select device profile, touch, trackball, dpad available, etc. -->
@@ -661,15 +685,16 @@
   </li>
 
   <li>
-    <h2><span class="en">Publishing</span>
-        <span class="de" style="display:none">Veröffentlichung</span>
-        <span class="es" style="display:none">Publicación</span>
-        <span class="fr" style="display:none">Publication</span>
-        <span class="it" style="display:none">Pubblicazione</span>
-        <span class="ja" style="display:none">公開</span>
-        <span class="zh-CN" style="display:none">发布</span>
-        <span class="zh-TW" style="display:none">發佈</span>
-    </h2>
+    <span class="heading">
+      <span class="en">Publishing</span>
+      <span class="de" style="display:none">Veröffentlichung</span>
+      <span class="es" style="display:none">Publicación</span>
+      <span class="fr" style="display:none">Publication</span>
+      <span class="it" style="display:none">Pubblicazione</span>
+      <span class="ja" style="display:none">公開</span>
+      <span class="zh-CN" style="display:none">发布</span>
+      <span class="zh-TW" style="display:none">發佈</span>
+    </span>
     <ul>
       <li><a href="<?cs var:toroot ?>guide/publishing/publishing_overview.html">
             <span class="en">Publishing Overview</span>
@@ -711,15 +736,16 @@
   </li>
 
   <li>
-    <h2><span class="en">Best Practices</span>
-               <span class="de" style="display:none">Bewährte Verfahren</span>
-               <span class="es" style="display:none">Prácticas recomendadas</span>
-               <span class="fr" style="display:none">Meilleures pratiques</span>
-               <span class="it" style="display:none">Best practice</span>
-               <span class="ja" style="display:none">ベスト プラクティス</span>
-               <span class="zh-CN" style="display:none">最佳实践</span>
-               <span class="zh-TW" style="display:none">最佳實務</span>
-    </h2>
+    <span class="heading">
+      <span class="en">Best Practices</span>
+      <span class="de" style="display:none">Bewährte Verfahren</span>
+      <span class="es" style="display:none">Prácticas recomendadas</span>
+      <span class="fr" style="display:none">Meilleures pratiques</span>
+      <span class="it" style="display:none">Best practice</span>
+      <span class="ja" style="display:none">ベスト プラクティス</span>
+      <span class="zh-CN" style="display:none">最佳实践</span>
+      <span class="zh-TW" style="display:none">最佳實務</span>
+    </span>
     <ul>
       <li><a href="<?cs var:toroot ?>guide/practices/compatibility.html">
             <span class="en">Compatibility</span>
@@ -751,20 +777,20 @@
           <li class="toggle-list">
             <div><a href="<?cs var:toroot ?>guide/practices/ui_guidelines/icon_design.html">
                    <span class="en">Icon Design</span>
-                 </a> <span class="new">updated</span></div>
+                 </a></div>
             <ul>
               <li><a href="<?cs var:toroot ?>guide/practices/ui_guidelines/icon_design_launcher.html">
                     <span class="en">Launcher Icons</span>
-                  </a> <span class="new">updated</span></li>
+                  </a></li>
               <li><a href="<?cs var:toroot ?>guide/practices/ui_guidelines/icon_design_menu.html">
                     <span class="en">Menu Icons</span>
                   </a></li>
               <li><a href="<?cs var:toroot ?>guide/practices/ui_guidelines/icon_design_action_bar.html">
                     <span class="en">Action Bar Icons</span>
-                  </a> <span class="new">new!</span></li>
+                  </a></li>
               <li><a href="<?cs var:toroot ?>guide/practices/ui_guidelines/icon_design_status_bar.html">
                     <span class="en">Status Bar Icons</span>
-                  </a> <span class="new">updated</span></li>
+                  </a></li>
               <li><a href="<?cs var:toroot ?>guide/practices/ui_guidelines/icon_design_tab.html">
                     <span class="en">Tab Icons</span>
                   </a></li>
@@ -815,8 +841,9 @@
   </li>
 
   <li>
-    <h2><span class="en">Web Applications</span>
-    </h2>
+    <span class="heading">
+      <span class="en">Web Applications</span>
+    </span>
     <ul>
       <li><a href="<?cs var:toroot ?>guide/webapps/index.html">
             <span class="en">Web Apps Overview</span>
@@ -837,15 +864,16 @@
   </li>
 
   <li>
-    <h2><span class="en">Appendix</span>
-               <span class="de" style="display:none">Anhang</span>
-               <span class="es" style="display:none">Apéndice</span>
-               <span class="fr" style="display:none">Annexes</span>
-               <span class="it" style="display:none">Appendice</span>
-               <span class="ja" style="display:none">付録</span>
-               <span class="zh-CN" style="display:none">附录</span>
-               <span class="zh-TW" style="display:none">附錄</span>
-    </h2>
+    <span class="heading">
+      <span class="en">Appendix</span>
+      <span class="de" style="display:none">Anhang</span>
+      <span class="es" style="display:none">Apéndice</span>
+      <span class="fr" style="display:none">Annexes</span>
+      <span class="it" style="display:none">Appendice</span>
+      <span class="ja" style="display:none">付録</span>
+      <span class="zh-CN" style="display:none">附录</span>
+      <span class="zh-TW" style="display:none">附錄</span>
+    </span>
     <ul>
       <li><a href="<?cs var:toroot ?>guide/appendix/api-levels.html">
             <span class="en">Android API Levels</span>
diff --git a/docs/html/guide/practices/screens-support-1.5.jd b/docs/html/guide/practices/screens-support-1.5.jd
index 9f033b4..4c6fb99 100644
--- a/docs/html/guide/practices/screens-support-1.5.jd
+++ b/docs/html/guide/practices/screens-support-1.5.jd
@@ -46,7 +46,7 @@
 default, an application written for Android 1.5 or below that does not set the <a
 href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
 android:targetSdkVersion}</a> set to {@code "4"} or higher runs in <a
-href="screen-compat-mode">screen compatibility mode</a> when on a device with a screen larger than
+href="screen-compat-mode.html">screen compatibility mode</a> when on a device with a screen larger than
 the
 <em>normal</em> screen size (basically, the system displays the application in a small window
 that is roughly the size of the normal screen size).</p>
diff --git a/docs/html/guide/practices/security.jd b/docs/html/guide/practices/security.jd
index 476c301..eeaac44 100644
--- a/docs/html/guide/practices/security.jd
+++ b/docs/html/guide/practices/security.jd
@@ -126,8 +126,8 @@
 <p>Use of <a
 href="{@docRoot}reference/android/content/Context.html#MODE_WORLD_WRITEABLE">
 world writable</a> or <a
-href="{@docRoot}reference/android/content/Context.html#MODE_WORLD_READABLE
-">world readable</a> files for IPC is discouraged because it does not provide
+href="{@docRoot}reference/android/content/Context.html#MODE_WORLD_READABLE">world
+readable</a> files for IPC is discouraged because it does not provide
 the ability to limit data access to particular applications, nor does it
 provide any control on data format. As an alternative, you might consider using
 a ContentProvider which provides read and write permissions, and can make
@@ -199,10 +199,10 @@
 <p>ContentProviders can also provide more granular access by declaring the <a
 href="{@docRoot}guide/topics/manifest/provider-element.html#gprmsn">
 grantUriPermissions</a> element and using the <code><a
-href="{@docRoot}reference/android/content/Intent.html#FLAG_GRANT_READ_URI_PERMIS
-SION">FLAG_GRANT_READ_URI_PERMISSION</a></code> and <code><a
-href="{@docRoot}reference/android/content/Intent.html#FLAG_GRANT_WRITE_URI_PERMI
-SSION">FLAG_GRANT_WRITE_URI_PERMISSION</a></code> flags in the Intent object
+href="{@docRoot}reference/android/content/Intent.html#FLAG_GRANT_READ_URI_PERMISSION">FLAG_GRANT_READ_URI_PERMISSION</a></code>
+and <code><a
+href="{@docRoot}reference/android/content/Intent.html#FLAG_GRANT_WRITE_URI_PERMISSION">FLAG_GRANT_WRITE_URI_PERMISSION</a></code>
+flags in the Intent object
 that activates the component.  The scope of these permissions can be further
 limited by the <code><a
 href="{@docRoot}guide/topics/manifest/grant-uri-permission-element.html">
@@ -211,14 +211,9 @@
 <p>When accessing a <code>
 <a href="{@docRoot}reference/android/content/ContentProvider.html">
 ContentProvider</a></code>, use parameterized query methods such as <code>
-<a href="{@docRoot}reference/android/content/ContentProvider.html#query(android.net
-.Uri,%20java.lang.String[],%20java.lang.String,%20java.lang.String[],%20java.lan
-g.String)">query()</a></code>, <code><a
-href="{@docRoot}reference/android/content/ContentProvider.html#update(android.ne
-t.Uri,%20android.content.ContentValues,%20java.lang.String,%20java.lang.String[]
-)">update()</a></code>, and <code><a
-href="{@docRoot}reference/android/content/ContentProvider.html#delete(android.ne
-t.Uri,%20java.lang.String,%20java.lang.String[])">delete()</a></code> to avoid
+<a href="{@docRoot}reference/android/content/ContentProvider.html#query(android.net.Uri,%20java.lang.String[],%20java.lang.String,%20java.lang.String[],%20java.lang.String)">query()</a></code>, <code><a
+href="{@docRoot}reference/android/content/ContentProvider.html#update(android.net.Uri,%20android.content.ContentValues,%20java.lang.String,%20java.lang.String[])">update()</a></code>, and <code><a
+href="{@docRoot}reference/android/content/ContentProvider.html#delete(android.net.Uri,%20java.lang.String,%20java.lang.String[])">delete()</a></code> to avoid
 potential <a href="http://en.wikipedia.org/wiki/SQL_injection">SQL
 Injection</a> from untrusted data. Note that using parameterized methods is not
 sufficient if the <code>selection</code> is built by concatenating user data
@@ -249,8 +244,9 @@
 Activities</a>, and <a
 href="{@docRoot}reference/android/R.styleable.html#AndroidManifestService">
 Services</a> are all declared in the application manifest.  If your IPC mechanism is
-not intended for use by other applications, set the android:exported property
-to false.  This is useful for applications that consist of multiple processes
+not intended for use by other applications, set the <a
+href="{@docRoot}guide/topics/manifest/service-element.html#exported">{@code android:exported}</a>
+property to false.  This is useful for applications that consist of multiple processes
 within the same UID, or if you decide late in development that you do not
 actually want to expose functionality as IPC but you don’t want to rewrite
 the code.</p>
@@ -276,11 +272,10 @@
 
 <p>Intents are the preferred mechanism for asynchronous IPC in Android.
 Depending on your application requirements, you might use <code><a
-href="{@docRoot}reference/android/content/Context.html#sendBroadcast(android.con
-tent.Intent)">sendBroadcast()</a></code>, <code><a
-href="{@docRoot}reference/android/content/Context.html#sendOrderedBroadcast(andr
-oid.content.Intent,%20java.lang.String)">sendOrderedBroadcast()</a></code>, or
-direct an intent to a specific application component.</p>
+href="{@docRoot}reference/android/content/Context.html#sendBroadcast(android.content.Intent)">sendBroadcast()</a></code>, 
+<code><a
+href="{@docRoot}reference/android/content/Context.html#sendOrderedBroadcast(android.content.Intent,%20java.lang.String)">sendOrderedBroadcast()</a></code>,
+or direct an intent to a specific application component.</p>
 
 <p>Note that ordered broadcasts can be “consumed” by a recipient, so they
 may not be delivered to all applications.  If you are sending an Intent where
@@ -311,14 +306,13 @@
 explicitly added as code in the interface.</p>
 
 <p>If providing an interface that does require access controls, use <code><a
-href="{@docRoot}reference/android/content/Context.html#checkCallingPermission(ja
-va.lang.String)">checkCallingPermission()</a></code> to verify whether the
+href="{@docRoot}reference/android/content/Context.html#checkCallingPermission(java.lang.String)">checkCallingPermission()</a></code>
+to verify whether the
 caller of the Binder has a required permission. This is especially important
 before accessing a Service on behalf of the caller, as the identify of your
 application is passed to other interfaces.  If invoking an interface provided
 by a Service, the <code><a
-href="{@docRoot}reference/android/content/Context.html#bindService(android.conte
-nt.Intent,%20android.content.ServiceConnection,%20int)">bindService()</a></code>
+href="{@docRoot}reference/android/content/Context.html#bindService(android.content.Intent,%20android.content.ServiceConnection,%20int)">bindService()</a></code>
  invocation may fail if you do not have permission to access the given Service.
  If calling an interface provided locally by your own application, it may be
 useful to use the <code><a
@@ -332,14 +326,14 @@
 
 <p>By default, receivers are exported and can be invoked by any other
 application. If your <code><a
-href={@docRoot}reference/android/content/BroadcastReceiver.html">
+href="{@docRoot}reference/android/content/BroadcastReceiver.html">
 BroadcastReceivers</a></code> is intended for use by other applications, you
 may want to apply security permissions to receivers using the <code><a
-href="{@docRoot}reference/android/R.styleable.html#AndroidManifestReceiver">
+href="{@docRoot}guide/topics/manifest/receiver-element.html">
 &lt;receiver&gt;</a></code> element within the application manifest.  This will
 prevent applications without appropriate permissions from sending an intent to
 the <code><a
-href={@docRoot}reference/android/content/BroadcastReceiver.html">
+href="{@docRoot}reference/android/content/BroadcastReceiver.html">
 BroadcastReceivers</a></code>.</p>
 
 <h3>Using Services</h3>
@@ -349,19 +343,21 @@
 package's AndroidManifest.xml.</p>
 
 <p>By default, Services are exported and can be invoked by any other
-application.  Services can be protected using the android:permission attribute
+application.  Services can be protected using the <a
+href="{@docRoot}guide/topics/manifest/service-element.html#prmsn">{@code android:permission}</a>
+attribute
 within the manifest’s <code><a
-href="{@docRoot}reference/android/R.styleable.html#AndroidManifestService">
+href="{@docRoot}guide/topics/manifest/service-element.html">
 &lt;service&gt;</a></code> tag. By doing so, other applications will need to declare
 a corresponding <code><a
-href="{@docRoot}reference/android/R.styleable.html#AndroidManifestService_permis
-sion">&lt;uses-permission&gt;</a></code> element in their own manifest to be
+href="{@docRoot}guide/topics/manifest/uses-permission-element.html">&lt;uses-permission&gt;</a>
+</code> element in their own manifest to be
 able to start, stop, or bind to the service.</p>
 
 <p>A Service can protect individual IPC calls into it with permissions, by
 calling <code><a
-href="{@docRoot}reference/android/content/Context.html#checkCallingPermission(ja
-va.lang.String)">checkCallingPermission()</a></code>before executing
+href="{@docRoot}reference/android/content/Context.html#checkCallingPermission(java.lang.String)">checkCallingPermission()</a></code>
+before executing
 the implementation of that call.  We generally recommend using the
 declarative permissions in the manifest, since those are less prone to
 oversight.</p>
@@ -376,9 +372,9 @@
 functionality that is not intended for use by other applications.</p>
 
 <p>If you do expose an Activity for purposes of IPC, the  <code><a
-href="{@docRoot}reference/android/R.styleable.html#AndroidManifestActivity_permi
-ssion">android:permission</a></code> attribute in the  <code><a
-href="{@docRoot}reference/android/R.styleable.html#AndroidManifestActivity">
+href="{@docRoot}guide/topics/manifest/activity-element.html#prmsn">android:permission</a></code>
+attribute in the  <code><a
+href="{@docRoot}guide/topics/manifest/activity-element.html">
 &lt;activity&gt;</a></code> declaration in the application manifest can be used to
 restrict access to only those applications which have the stated
 permissions.</p>
@@ -432,8 +428,8 @@
 <p>Generally, you should strive to create as few permissions as possible while
 satisfying your security requirements.  Creating a new permission is relatively
 uncommon for most applications, since <a
-href="{@docRoot}reference/android/Manifest.permission.html">
-system-defined permissions</a> cover many situations.  Where appropriate,
+href="{@docRoot}reference/android/Manifest.permission.html">system-defined
+permissions</a> cover many situations.  Where appropriate,
 perform access checks using existing permissions.</p>
 
 <p>If you must create a new permission, consider whether you can accomplish
@@ -560,17 +556,14 @@
 not execute JavaScript so cross-site-scripting is not possible.</p>
 
 <p>Use <code><a
-href="{@docRoot}reference/android/webkit/WebView.html#addJavascriptInterface(jav
-a.lang.Object,%20java.lang.String)">addJavaScriptInterface()</a></code> with
+href="{@docRoot}reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object,%20java.lang.String)">addJavaScriptInterface()</a></code> with
 particular care because it allows JavaScript to invoke operations that are
 normally reserved for Android applications.  Only expose <code><a
-href="{@docRoot}reference/android/webkit/WebView.html#addJavascriptInterface(jav
-a.lang.Object,%20java.lang.String)">addJavaScriptInterface()</a></code> to
+href="{@docRoot}reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object,%20java.lang.String)">addJavaScriptInterface()</a></code> to
 sources from which all input is trustworthy.  If untrusted input is allowed,
 untrusted JavaScript may be able to invoke Android methods.  In general, we
 recommend only exposing <code><a
-href="{@docRoot}reference/android/webkit/WebView.html#addJavascriptInterface(jav
-a.lang.Object,%20java.lang.String)">addJavaScriptInterface()</a></code> to
+href="{@docRoot}reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object,%20java.lang.String)">addJavaScriptInterface()</a></code> to
 JavaScript that is contained within your application APK.</p>
 
 <p>Do not trust information downloaded over HTTP, use HTTPS instead.  Even if
@@ -578,13 +571,11 @@
 subject to <a
 href="http://en.wikipedia.org/wiki/Man-in-the-middle_attack">MiTM</a> attacks
 and interception of data.  Sensitive capabilities using <code><a
-href="{@docRoot}reference/android/webkit/WebView.html#addJavascriptInterface(jav
-a.lang.Object,%20java.lang.String)">addJavaScriptInterface()</a></code> should
+href="{@docRoot}reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object,%20java.lang.String)">addJavaScriptInterface()</a></code> should
 not ever be exposed to unverified script downloaded over HTTP. Note that even
 with the use of HTTPS,
 <code><a
-href="{@docRoot}reference/android/webkit/WebView.html#addJavascriptInterface(jav
-a.lang.Object,%20java.lang.String)">addJavaScriptInterface()</a></code>
+href="{@docRoot}reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object,%20java.lang.String)">addJavaScriptInterface()</a></code>
 increases the attack surface of your application to include the server
 infrastructure and all CAs trusted by the Android-powered device.</p>
 
@@ -683,8 +674,7 @@
 <p>If a GUID is required, create a large, unique number and store it.  Do not
 use phone identifiers such as the phone number or IMEI which may be associated
 with personal information.  This topic is discussed in more detail in the <a
-href="http://android-developers.blogspot.com/2011/03/identifying-app-installatio
-ns.html">Android Developer Blog</a>.</p>
+href="http://android-developers.blogspot.com/2011/03/identifying-app-installations.html">Android Developer Blog</a>.</p>
 
 <p>Application developers should be careful writing to on-device logs.
 In Android, logs are a shared resource, and are available
@@ -724,9 +714,8 @@
 <p>If credentials are to be used only by applications that you create, then you
 can verify the application which accesses the <code><a
 href="{@docRoot}reference/android/accounts/AccountManager.html">
-AccountManager</a></code> using <code><a href="<code><a
-href="{@docRoot}h/reference/android/content/pm/PackageManager.html#checkSignatur
-es(java.lang.String,%20java.lang.String)">checkSignature()</a></code>.
+AccountManager</a></code> using <code><a
+href="{@docRoot}reference/android/content/pm/PackageManager.html#checkSignatures(java.lang.String,%20java.lang.String)">checkSignature()</a></code>.
 Alternatively, if only one application will use the credential, you might use a
 <code><a
 href={@docRoot}reference/java/security/KeyStore.html">KeyStore</a></code> for
@@ -756,15 +745,15 @@
 href="{@docRoot}reference/javax/crypto/Cipher.html">Cipher</a></code> class.</p>
 
 <p>Use a secure random number generator (
-<a href="http://developer.android.com/reference/java/security/SecureRandom.html">
+<a href="{@docRoot}reference/java/security/SecureRandom.html">
 <code>SecureRandom</code></a>) to initialize any cryptographic keys (<a
-href="http://developer.android.com/reference/javax/crypto/KeyGenerator.html">
+href="{@docRoot}reference/javax/crypto/KeyGenerator.html">
 <code>KeyGenerator</code></a>). Use of a key that is not generated with a secure random
 number generator significantly weakens the strength of the algorithm, and may
 allow offline attacks.</p>
 
 <p>If you need to store a key for repeated use, use a mechanism like <code><a
-href={@docRoot}reference/java/security/KeyStore.html">KeyStore</a></code> that
+href="{@docRoot}reference/java/security/KeyStore.html">KeyStore</a></code> that
 provides a mechanism for long term storage and retrieval of cryptographic
 keys.</p>
 
diff --git a/docs/html/guide/practices/tablets-and-handsets.jd b/docs/html/guide/practices/tablets-and-handsets.jd
index dc35801..8e07a08 100644
--- a/docs/html/guide/practices/tablets-and-handsets.jd
+++ b/docs/html/guide/practices/tablets-and-handsets.jd
@@ -99,7 +99,8 @@
 
 <p>You can enable items from the options menu to appear directly in the action bar as "action
 items". You can also add navigation features to the action bar, such as tabs or a drop-down list,
-and use the application icon to supplement the system's BACK behavior with the option to navigate to
+and use the application icon to supplement the system's <em>Back</em> button behavior with the option to
+navigate to
 your application's "home" activity or "up" the application's structural hierarchy.</p>
 
 <p>This guide provides some tips for using the action bar in ways that support both tablets and
@@ -458,7 +459,8 @@
 developer guide, you can use the application icon in the action bar to facilitate user navigation
 when appropriate&mdash;either as a method to get back to the "home" activity (similar to clicking
 the logo on a web site) or as a way to navigate up the application's structural hierarchy. Although
-it might seem similar to the standard BACK navigation in some cases, the up navigation option
+it might seem similar to the standard <em>Back</em> navigation in some cases, the up navigation
+option
 provides a more predictable navigation method for situations in which the user may have entered
 from an external location, such as a notification, app widget, or a different application.</p>
 
@@ -481,7 +483,7 @@
 information in each list item based on the available space. That is, you can create alternative
 layouts to be used by the items in your list adapter such that a large screen might display more
 detail for each item.</li>
-  <li>Create <a href="{@docRoot}guide/topics/resources/more-resources.html ">alternative resource
+  <li>Create <a href="{@docRoot}guide/topics/resources/more-resources.html">alternative resource
 files</a> for values such as integers, dimensions, and even booleans. Using size qualifiers for
 these resources, you can easily apply different layout sizes, font sizes, or enable/disable features
 based on the current screen size.</li>
diff --git a/docs/html/guide/practices/ui_guidelines/activity_task_design.jd b/docs/html/guide/practices/ui_guidelines/activity_task_design.jd
index 31ad466..9be72ee 100644
--- a/docs/html/guide/practices/ui_guidelines/activity_task_design.jd
+++ b/docs/html/guide/practices/ui_guidelines/activity_task_design.jd
@@ -40,9 +40,10 @@
       <li><a href=#reusing_tip>Handle case where no activity matches</a></li>
       <li><a href=#activity_launching_tip>Consider how to launch your activities</a></li>
       <li><a href=#activities_added_to_task_tip>Allow activities to add to current task</a></li>
-      <li><a href=#notifications_get_back_tip>Notifications should let user easily get back</li>
+      <li><a href=#notifications_get_back_tip>Notifications and App Widgets should provide consistent back behavior</li>
       <li><a href=#use_notification_tip>Use the notification system</a></li>
-      <li><a href=#taking_over_back_key>Don't take over BACK key unless you absolutely need to</a></li>
+      <li><a href=#taking_over_back_key>Don't take over <em>Back</em> button unless you absolutely
+need to</a></li>
     </ol>
   </li>
 </ol>
@@ -241,8 +242,8 @@
   Android system keeps a linear navigation history of activities the
   user has visited. This is the <em>activity stack</em>, also known as the
   back stack. In general, when a user starts a new activity, it is added
-  to the activity stack, so that pressing BACK displays the previous
-  activity on the stack. However, the user cannot use the BACK key to go
+  to the activity stack, so that pressing <em>Back</em> displays the previous
+  activity on the stack. However, the user cannot use the <em>Back</em> button to go
   back further than the last visit to Home. The adding of an activity to
   the current stack happens whether or not that activity begins a new 
   <a href=#tasks title=task>task</a> (as long as that task was started
@@ -256,10 +257,11 @@
   Activities are the only things that can be added to the activity stack
   &mdash; views, windows, menus, and dialogs cannot. That is, when
   designing the navigation, if you have screen A and you want the user
-  to be able go to a subsequent screen B and then use the BACK key to go
+  to be able go to a subsequent screen B and then use the <em>Back</em> button to go
   back to screen A, then the screen A needs to be implemented as an
   activity. The one exception to this rule is if your application 
-  <a href="#taking_over_back_key">takes control of the BACK key</a> and manages the navigation
+  <a href="#taking_over_back_key">takes control of the <em>Back</em> button</a> and manages the
+navigation
 itself.
 </p>
 
@@ -287,7 +289,7 @@
   launcher, Home screen shortcut or "Recent tasks" switcher (a long
   press on Home on some devices). The user can return to a task by
   choosing the icon for its root activity the same way they started the
-  task. Once inside a task, the BACK key goes to previous activities in
+  task. Once inside a task, the <em>Back</em> button goes to previous activities in
   that task. The activity stack is made up of one or more tasks.
 </p>
 
@@ -331,7 +333,7 @@
   Browser are two applications that do this. For example, choosing an
   address in an email starts the Maps activity as a new task, and
   choosing a link in an email starts the Browser activity as a new
-  task. In these cases, the BACK key will return to the previous
+  task. In these cases, the <em>Back</em> button will return to the previous
   activity in a different task (Email), because it was not started from
   Home.
 </p>
@@ -341,7 +343,7 @@
 
 <p>
   The following examples illustrate basic principles for applications,
-  activities, the activity stack, the BACK key, tasks and intents.  It
+  activities, the activity stack, the <em>Back</em> button, tasks and intents.  It
   shows how the system responds to user actions such as starting
   activities and switching between tasks.  With most of these examples
   you can follow along, launching activities on your device as
@@ -367,19 +369,20 @@
   <img src={@docRoot}images/activity_task_design/HomeTaskBasics1a.png>
 </p>
 
-<h3 id=navigating_away_from_an_activity>Navigating Away from an Activity with BACK and HOME keys</h3>
+<h3 id=navigating_away_from_an_activity>Navigating Away from an Activity with <em>Back</em> and
+<em>Home</em> buttons</h3>
 
 <p>
   An activity can keep or lose its state depending on how the user
-  leaves the activity &mdash; by the HOME or BACK key.
+  leaves the activity &mdash; by the <em>Home</em> or <em>Back</em> button.
 </p>
 
 <p>
-  By default, pressing the BACK key finishes (destroys) the current
+  By default, pressing the <em>Back</em> button finishes (destroys) the current
   activity and displays the previous activity to the user. In the
   following figure, the user starts email by touching the Email icon in
   the Home screen, which displays a list of email messages. The user
-  scrolls down the list (changing its initial state). Pressing BACK
+  scrolls down the list (changing its initial state). Pressing <em>Back</em>
   destroys the List Messages activity and returns to the previous
   activity, which is Home. If the user re-launches Email, it would
   re-load the messages and display its initial, non-scrolled state.
@@ -390,15 +393,15 @@
 </p>
 
 <p>
-  In the above example, pressing BACK goes to Home because it was the
+  In the above example, pressing <em>Back</em> goes to Home because it was the
   last activity the user was viewing. But if the user had gotten to List
-  Message from some other activity, then pressing BACK would have
+  Message from some other activity, then pressing <em>Back</em> would have
   returned there.
 </p>
 
 <p>
   By contrast, the next figure shows the user leaving List Messages by
-  pressing HOME instead of BACK &mdash; the List Messages activity is
+  pressing <em>Home</em> instead of <em>Back</em> &mdash; the List Messages activity is
   stopped and moved to the background rather than being
   destroyed. Starting Email again from its icon would simply bring the
   List Messages activity to the foreground (changing it from stopped to
@@ -423,8 +426,8 @@
 
 <p>
   In addition, not all activities have the behavior that they are
-  destroyed when BACK is pressed. When the user starts playing music in
-  the Music application and then presses BACK, the application overrides
+  destroyed when <em>Back</em> is pressed. When the user starts playing music in
+  the Music application and then presses <em>Back</em>, the application overrides
   the normal back behavior, preventing the player activity from being
   destroyed, and continues playing music, even though its activity is no
   longer visible &mdash; as a visual substitute, the Music application
@@ -451,7 +454,7 @@
   activity to get a picture. This is a good example of re-use of the
   Gallery activity. The following figure illustrates the sequence of
   activities to do this (up to crop). This is how it's done: The user
-  chooses Contacts, selects the contact for viewing, chooses MENU &gt;
+  chooses Contacts, selects the contact for viewing, chooses <em>Menu</em> &gt;
   Edit contact and touches the picture field, which launches the Gallery
   activity. The user then chooses the picture they want, crops and saves
   it. Saving it causes the picture to be inserted into the picture field
@@ -484,12 +487,12 @@
   <b>Gallery Re-Uses Messaging for Sharing a Picture</b> - Sharing is
   another good example of one application re-using an activity from a
   different application. As shown in the following figure, the user
-  starts Gallery, picks a picture to view, chooses MENU &gt; Share, and
+  starts Gallery, picks a picture to view, chooses <em>Menu</em> &gt; Share, and
   picks "Messaging". This starts the Messaging activity, creates a new
   message and attaches the original picture to it. The user then fills
   in the "To" field, writes a short message and sends it. User focus
   remains in the Messaging program. If the user wants to go back to the
-  Gallery, they must press the BACK key. (The user can back up through
+  Gallery, they must press the <em>Back</em> button. (The user can back up through
   each activity all the way to Home.)
 </p>
 
@@ -552,7 +555,7 @@
   <ul>
     <li>
       State 2 - The user wants to do something else while they're
-      waiting, so they press HOME, which does not interrupt the map's
+      waiting, so they press <em>Home</em>, which does not interrupt the map's
       network connection and allows the map to continue loading in the
       background.
 
@@ -729,7 +732,7 @@
         <b>Start first task.</b> You want to send a text message and attach a photo. You would choose:
 
         <p>
-          Home &gt; Messaging &gt; New message &gt; MENU &gt; Attach
+          Home &gt; Messaging &gt; New message &gt; <em>Menu</em> &gt; Attach
           &gt; Pictures. This last step launches the picture gallery
           for picking a photo. Notice that picture gallery is an
           activity in a separate application.
@@ -961,7 +964,7 @@
           address in an email message (or web page), where the Maps
           activity is started to map the location. No result from maps
           is expected to be returned to the email message; the user
-          can return by pressing the BACK key. (Such an activity is
+          can return by pressing the <em>Back</em> button. (Such an activity is
           started with {@link
           android.content.Context#startActivity(android.content.Intent)
           startActivity()}.)
@@ -1063,110 +1066,23 @@
 </p>
 
     
-<h3 id="notifications_get_back_tip">Notifications should let the user easily get back to the previous activity</h3>
+<h3 id="notifications_get_back_tip">Notifications and App Widgets should provide consistent back behavior</h3>
 <p>
-  Applications that are in the background or not running can have
-  services that send out notifications to the user letting them know about
-  events of interest. Two examples are Calendar, which can send out notifications of
-  upcoming events, and Email, which can send out notifications when new
-  messages arrive. One of the user interface guidelines is that when the
-  user is in activity A, gets a notification for activity B and
-  picks that notification, when they press the BACK key, they should
-  go back to activity A.&nbsp;
+  Notifications and app widgets are two common ways that a user can launch
+  your app through something besides its main icon in Launcher.  You must
+  take care when implementing these so that the user has a consistent experience
+  with the back button, not causing surprises in where they return to or the
+  state the application ends up in.
 </p>
 
 <p>
-  The following scenario shows how the activity stack should work
-  when the user responds to a notification.
-</p>
-
-<ol>
-  <li>
-    User is creating a new event in Calendar. They realize they
-    need to copy part of an email message into this event
-  </li>
-  <li>
-    The user chooses Home &gt; Gmail
-  </li>
-  <li>
-    While in Gmail, they receive a notification from Calendar for an upcoming meeting
-  </li>
-  <li>
-    So they choose that notification, which takes them to a
-    dedicated Calendar activity that displays brief details of the
-    upcoming meeting
-  </li>
-  <li>
-    The user chooses this short notice to view further details
-  </li>
-  <li>
-    When done viewing the event, the user presses the BACK
-    key. They should be taken to Gmail, which is where they were
-    when they took the notification
-  </li>
-</ol>
-
-<p>
-This behavior doesn't necessarily happen by default.
-</p>
-
-<p>
-Notifications generally happen primarily in one of two ways:
-</p>
-
-  <ul>
-    <li>
-      <b>The chosen activity is dedicated for notification only</b> -
-      For example, when the user receives a
-      Calendar notification, choosing that
-      notification starts a special activity that displays a list
-      of upcoming calendar events &mdash; this view is available only
-      from the notification, not through the Calendar's own user
-      interface. After viewing this upcoming event, to ensure that
-      the user pressing the BACK key will return to the activity
-      the user was in when they picked the notification, you would
-      make sure this dedicated activity does not have the same
-      task affinity as the Calendar or any other activity. (You do
-      this by setting task affinity to the empty string, which
-      means it has no affinity to anything.) The explanation for
-      this follows.
-
-      <p>
-      Because of the way tasks work, if the taskAffinity of the
-      dedicated activity is kept as its default, then pressing the
-      BACK key (in step 6, above) would go to Calendar, rather
-      than Gmail. The reason is that, by default, all activities
-      in a given application have the same task
-      affinity. Therefore, the task affinity of the dedicated
-      activity matches the Calendar task, which is already running
-      in step 1. This means in step 4, choosing the notification
-      brings the existing Calendar event (in step 1) forward and
-      starts the dedicated activity on top of it.  This is not
-      what you want to have happen. Setting the dedicated
-      activity's taskAffinity to empty string fixes this.
-      </p>
-    </li>
-
-    <li>
-      <b>The chosen activity is not dedicated, but always comes to
-      the foreground in its initial state</b> - For example, in
-      response to a notification, when the Gmail application comes
-      to the foreground, it always presents the list of conversations.
-      You can ensure this happens by setting a "clear top" flag in the
-      intent that the notification triggers.  This ensures that when the
-      activity is launched, it displays its initial activity, preventing
-      Gmail from coming to the foreground in whatever state the user last
-      happened to be viewing it. (To do this, you put {@link
-      android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP
-      FLAG_ACTIVITY_CLEAR_TOP} in the intent you pass to startActivity()). 
-    </li>
-  </ul>
-
-<p>
-  There are other ways to handle notifications, such as bringing the
-  activity to the foreground, set to display specific data, such as
-  displaying the text message thread for the person who just sent a
-  new text message.
+  The
+  <a href="{@docRoot}guide/topics/ui/notifiers/notifications.html#HandlingNotifications">Handling
+  Notifications</a> section of the developer guide's
+  <a href="{@docRoot}guide/topics/ui/notifiers/notifications.html">Status Bar Notifications</a>
+  documentation provides an overview of how to write code to correctly handle
+  notification.  This dicussion applies equally to handling interactions with
+  app widgets.
 </p>
 
 <p>
@@ -1189,20 +1105,21 @@
   convenience to respond to your message.
 </p>
 
-<h3 id=taking_over_back_key>Don't take over the BACK key unless you absolutely need to</h3>
+<h3 id=taking_over_back_key>Don't take over the <em>Back</em> button unless you absolutely need
+to</h3>
 
 <p>
   As a user navigates from one activity to the next, the system adds
   them to the activity stack. This forms a navigation history that is
-  accessible with the BACK key. Most activities are relatively limited
+  accessible with the <em>Back</em> button. Most activities are relatively limited
   in scope, with just one set of data, such as viewing a list of
   contacts, composing an email, or taking a photo. But what if your
   application is one big activity with several pages of content and
-  needs finer-grained control of the BACK key? Examples of such Google
+  needs finer-grained control of the <em>Back</em> button? Examples of such Google
   applications are the Browser, which can have several web pages open
   at once, and Maps, which can have several layers of geographic data
   to switch between. Both of these applications take control of the
-  BACK key and maintain their own internal back stacks that operate
+  <em>Back</em> button and maintain their own internal back stacks that operate
   only when these applications have focus.
 </p>
 
@@ -1211,7 +1128,7 @@
   information on a map to the user: displaying the location of a
   search result, displaying locations of friends, and displaying a
   line for a street path providing direction between points. Maps
-  stores these layers in its own history so the BACK key can return to
+  stores these layers in its own history so the <em>Back</em> button can return to
   a previous layer.
 </p>
 
@@ -1222,8 +1139,8 @@
   as Windows, Macintosh or Linux). For example, if you did a Google
   web search in one window of the Android Browser, clicking on a link
   in the search results displays a web page in that same window, and
-  then pressing BACK would to the search results page. Pressing
-  BACK goes to a previous window only if the current window was
+  then pressing <em>Back</em> would to the search results page. Pressing
+  <em>Back</em> goes to a previous window only if the current window was
   launched from that previous window.  If the user keeps pressing
   back, they will eventually leave the browser activity and return
   Home.
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design.jd b/docs/html/guide/practices/ui_guidelines/icon_design.jd
index 07b73bb..1c66185 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design.jd
@@ -42,8 +42,6 @@
 Templates Pack, v2.3 &raquo;</a></li>
 <li><a href="{@docRoot}shareables/icon_templates-v2.0.zip">Android Icon
 Templates Pack, v2.0 &raquo;</a></li>
-<li><a href="{@docRoot}shareables/icon_templates-v1.0.zip">Android Icon
-Templates Pack, v1.0 &raquo;</a></li>
 </ol>
 
 <h2>See also</h2>
@@ -57,6 +55,16 @@
 </div>
 </div>
 
+
+<div class="design-announce">
+<p><strong>New Guides for App Designers!</strong></p> 
+<p>Check out the new documents for designers at <strong><a
+href="{@docRoot}design/index.html">Android Design</a></strong>, including more guidelines
+for <a href="{@docRoot}design/style/iconography.html">Iconography</a>.</p>
+</div>
+
+
+
 <p>Creating a unified look and feel throughout a user interface adds value to
 your product. Streamlining the graphic style will also make the UI seem more
 professional to users.</p>
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_action_bar.jd b/docs/html/guide/practices/ui_guidelines/icon_design_action_bar.jd
index 449c27f..2476255 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_action_bar.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_action_bar.jd
@@ -29,6 +29,12 @@
 </div>
 </div>
 
+<div class="design-announce">
+<p><strong>New Guides for App Designers!</strong></p> 
+<p>Check out the new documents for designers at <strong><a
+href="{@docRoot}design/index.html">Android Design</a></strong>, including more guidelines
+for <a href="{@docRoot}design/style/iconography.html">Iconography</a>.</p>
+</div>
 
 
 <p>Action Bar icons are graphical elements placed in the <a
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_dialog.jd b/docs/html/guide/practices/ui_guidelines/icon_design_dialog.jd
index f78bd86..9b8cce7 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_dialog.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_dialog.jd
@@ -27,6 +27,12 @@
 </div>
 </div>
 
+<div class="design-announce">
+<p><strong>New Guides for App Designers!</strong></p> 
+<p>Check out the new documents for designers at <strong><a
+href="{@docRoot}design/index.html">Android Design</a></strong>, including more guidelines
+for <a href="{@docRoot}design/style/iconography.html">Iconography</a>.</p>
+</div>
 
 
 <p>Dialog icons are shown in pop-up dialog boxes that prompt the user for
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_launcher.jd b/docs/html/guide/practices/ui_guidelines/icon_design_launcher.jd
index 3f6061c..6b686b1 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_launcher.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_launcher.jd
@@ -26,6 +26,15 @@
 </div>
 
 
+<div class="design-announce">
+<p><strong>New Guides for App Designers!</strong></p> 
+<p>Check out the new documents for designers at <strong><a
+href="{@docRoot}design/index.html">Android Design</a></strong>, including more guidelines
+for <a href="{@docRoot}design/style/iconography.html">Iconography</a>.</p>
+</div>
+
+
+
 <p>A launcher icon is a graphic that represents your application. Launcher icons are used by
 Launcher applications and appear on the user’s Home screen. Launcher icons can also be used to
 represent shortcuts into your application (for example, a contact shortcut icon that opens detail
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_list.jd b/docs/html/guide/practices/ui_guidelines/icon_design_list.jd
index 7bf34cc..fd4dc6b 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_list.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_list.jd
@@ -28,6 +28,13 @@
 </div>
 
 
+<div class="design-announce">
+<p><strong>New Guides for App Designers!</strong></p> 
+<p>Check out the new documents for designers at <strong><a
+href="{@docRoot}design/index.html">Android Design</a></strong>, including more guidelines
+for <a href="{@docRoot}design/style/iconography.html">Iconography</a>.</p>
+</div>
+
 
 <p>List view icons look a lot like dialog icons, but they use an inner shadow
 effect where the light source is above the object. They are also designed to be
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_menu.jd b/docs/html/guide/practices/ui_guidelines/icon_design_menu.jd
index 974e48f..e267013 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_menu.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_menu.jd
@@ -32,6 +32,13 @@
 </div>
 
 
+<div class="design-announce">
+<p><strong>New Guides for App Designers!</strong></p> 
+<p>Check out the new documents for designers at <strong><a
+href="{@docRoot}design/index.html">Android Design</a></strong>, including more guidelines
+for <a href="{@docRoot}design/style/iconography.html">Iconography</a>.</p>
+</div>
+
 
 <p>Menu icons are graphical elements placed in the options menu shown to users
 when they press the Menu button. They are drawn in a flat-front perspective and
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_status_bar.jd b/docs/html/guide/practices/ui_guidelines/icon_design_status_bar.jd
index b8e07b5..a20c1ee 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_status_bar.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_status_bar.jd
@@ -40,6 +40,13 @@
 </div>
 
 
+<div class="design-announce">
+<p><strong>New Guides for App Designers!</strong></p> 
+<p>Check out the new documents for designers at <strong><a
+href="{@docRoot}design/index.html">Android Design</a></strong>, including more guidelines
+for <a href="{@docRoot}design/style/iconography.html">Iconography</a>.</p>
+</div>
+
 
 <p>Status bar icons are used to represent notifications from your application in
 the status bar.</p>
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_tab.jd b/docs/html/guide/practices/ui_guidelines/icon_design_tab.jd
index 271bd85..f85398d 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_tab.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_tab.jd
@@ -32,6 +32,13 @@
 </div>
 
 
+<div class="design-announce">
+<p><strong>New Guides for App Designers!</strong></p> 
+<p>Check out the new documents for designers at <strong><a
+href="{@docRoot}design/index.html">Android Design</a></strong>, including more guidelines
+for <a href="{@docRoot}design/style/iconography.html">Iconography</a>.</p>
+</div>
+
 
 <p>Tab icons are graphical elements used to represent individual tabs in a
 multi-tab interface. Each tab icon has two states: unselected and selected.</p>
diff --git a/docs/html/guide/practices/ui_guidelines/index.jd b/docs/html/guide/practices/ui_guidelines/index.jd
index 0e42788..3255275 100644
--- a/docs/html/guide/practices/ui_guidelines/index.jd
+++ b/docs/html/guide/practices/ui_guidelines/index.jd
@@ -2,18 +2,28 @@
 @jd:body
 
 
-<img src="{@docRoot}assets/images/uiguidelines1.png" alt="" align="right">
+
+<div class="design-announce" style="background:none;overflow:auto;padding:10px 5px">
+  <a href="{@docRoot}design/index.html"><img src="{@docRoot}images/home/android-design.png" alt=""
+style="float:left;margin:0 1em 0 0;"/></a>
+<p><strong>New Guides for App Designers!</strong></p> 
+<p>The Android UX team has put together a set of guidelines for the interaction and
+visual design of Android applications. The new collection provides an overview of
+Android styles, design patterns, building blocks for exceptional Android designs, and more.</p>
+<p><strong><a href="{@docRoot}design/index.html">Android Design</a></strong></p>
+
+<p>Over time, the documents below will be deprecated as more design information is published at
+the new location.</p>
+</div>
 
 
-<p>The Android UI team has begun developing guidelines for the interaction and
-visual design of Android applications. Look here for articles that describe
-these guidelines as we release them.</p>
+
 
  <dl>
   <dt><a href="{@docRoot}guide/practices/ui_guidelines/icon_design.html">Icon
 Design Guidelines</a> and <a
 href="{@docRoot}shareables/icon_templates-v4.0.zip">Android Icon Templates Pack
-&raquo; </a> <span class="new">updated</span></dt>
+&raquo; </a></dt>
   <dd>Your applications need a wide variety of icons, from a launcher icon to
 icons in menus, dialogs, tabs, the status bar, and lists. The Icon Guidelines
 describe each kind of icon in detail, with specifications for the size, color,
@@ -22,7 +32,8 @@
 filters that make it much simpler to create conforming icons.</dd>
 </dl>
  <dl>
-  <dt><a href="{@docRoot}guide/practices/ui_guidelines/widget_design.html">Widget Design Guidelines</a> <span class="new">updated</span></dt>
+  <dt><a href="{@docRoot}guide/practices/ui_guidelines/widget_design.html">Widget Design
+Guidelines</a> </dt>
   <dd>A widget displays an application's most important or timely information
 at a glance, on a user's Home screen. These design guidelines describe how to
 design widgets that fit with others on the Home screen. They include links to
@@ -43,7 +54,7 @@
   <dd>Android applications make use of Option menus and Context menus 
       that enable users to perform operations and navigate to other parts
       of your application or to other applications.  These guidelines describe
-      the difference between Options and Context menus, how to arrange
+      the difference between Options anontext menus, how to arrange
       menu items, when to put commands on-screen, and other details about
       menu design.
 </dd>
diff --git a/docs/html/guide/practices/ui_guidelines/menu_design.jd b/docs/html/guide/practices/ui_guidelines/menu_design.jd
index 3edf33f..7576b6c 100644
--- a/docs/html/guide/practices/ui_guidelines/menu_design.jd
+++ b/docs/html/guide/practices/ui_guidelines/menu_design.jd
@@ -71,7 +71,7 @@
   <ul>
     <li>The <em>Options menu</em> contains primary functionality that applies
         globally to the current activity or starts a related activity. 
-        It is typically invoked by a user pressing a hard button, often labeled MENU.</li>
+        It is typically invoked by a user pressing a hard button, often labeled <em>Menu</em>.</li>
     <li>The <em>Context menu</em> contains secondary functionality for the currently
         selected item.  It is typically invoked by a user's touch &amp; hold
         on an item.  Like on the Options menu, the operation can run either
@@ -109,10 +109,10 @@
 </p>
 
 <p>
-  On most devices, a user presses the MENU button to access the Options menu, 
+  On most devices, a user presses the <em>Menu</em> button to access the Options menu, 
   as shown in the screenshot below.  To close the menu, the user presses 
-  MENU again, or presses the BACK button. 
-  In fact, to cancel out of any menu, press the BACK button.  (Pressing the MENU
+  <em>Menu</em> again, or presses the <em>Back</em> button. 
+  In fact, to cancel out of any menu, press the <em>Back</em> button.  (Pressing the <em>Menu</em>
   button or touching outside the menu also works.)  Note that how to invoke this
   menu may be different on different devices.
 </p>
@@ -140,7 +140,7 @@
 
 <ul>
   <li>
-    <b>Options icon menu</b> - The first press of the MENU button displays a
+    <b>Options icon menu</b> - The first press of the <em>Menu</em> button displays a
     non-scrollable grid of icons at the bottom of the screen.  (On the G1
     phone, up to 6 buttons typically appear.)
   </li>
@@ -156,7 +156,7 @@
 
 <p>
   On some versions of Android, the user can display keyboard shortcuts in the
-  icon menu by long pressing the MENU button &mdash; the text in the icon menu
+  icon menu by long pressing the <em>Menu</em> button &mdash; the text in the icon menu
   alternates between the command names and their keyboard shortcuts (if any).
 </p>
 
@@ -299,7 +299,7 @@
   <a href="#location">location</a>) on the screen, put the command in the
   Context menu for that content.  If the command acts on no specific content
   or location, put it in the Options menu.  This separation of commands
-  is enforced by the system in the following way.  When you press the MENU
+  is enforced by the system in the following way.  When you press the <em>Menu</em>
   button to display the Options menu, the selected content becomes unselected,
   and so cannot be operated on.  For an explanation
   of why the content becomes unselected, see the article on
@@ -340,7 +340,7 @@
 
 <p>
   Before opening a Context menu, it has no visual representation that identifies
-  its presence (whereas the Options menu has the MENU button), and so is not
+  its presence (whereas the Options menu has the <em>Menu</em> button), and so is not
   particularly discoverable. 
   Therefore, in general, a Context menu should <em>duplicate</em> commands 
   found in the corresponding activity screen.  For example, while it's useful to
@@ -459,7 +459,8 @@
 <h3 id="a_dialog_should_not_have_an_options_menu">A dialog should not have an Options menu</h3>
 
 <p>
-  When a dialog is displayed, pressing the MENU button should do nothing.  This also holds true
+  When a dialog is displayed, pressing the <em>Menu</em> button should do nothing.  This also holds
+true
   for activities that look like dialogs.  A dialog box is recognizable by being
   smaller than full-screen, having zero to three buttons, is non-scrollable, and 
   possibly a list of selectable items that can include checkboxes or radio buttons.
@@ -475,7 +476,7 @@
 <h3 id="do_not_substitute_message">If an activity has no Options menu, do not display a message</h3>
 
 <p>
-  When the user presses the MENU button, if there is no Options menu, the system
+  When the user presses the <em>Menu</em> button, if there is no Options menu, the system
   currently does nothing.  We recommend you do not perform any action (such as
   displaying a message).  It's a better user experience for this behavior to be
   consistent across applications.
diff --git a/docs/html/guide/practices/ui_guidelines/widget_design.jd b/docs/html/guide/practices/ui_guidelines/widget_design.jd
index f63f3c4..d789407 100644
--- a/docs/html/guide/practices/ui_guidelines/widget_design.jd
+++ b/docs/html/guide/practices/ui_guidelines/widget_design.jd
@@ -44,6 +44,13 @@
 </div>
 
 
+<div class="design-announce">
+<p><strong>New Guides for App Designers!</strong></p> 
+<p>Check out the new documents for designers at <strong><a
+href="{@docRoot}design/index.html">Android Design</a></strong>.</p>
+</div>
+
+
 <p>App widgets (sometimes just "widgets") are a feature introduced in Android 1.5 and vastly
 improved in Android 3.0 and 3.1. A widget can display an application's most timely or otherwise
 relevant information at a glance, on a user's Home screen. The standard Android system image
diff --git a/docs/html/guide/publishing/preparing.jd b/docs/html/guide/publishing/preparing.jd
index 5ed55fe..83aa5ee 100644
--- a/docs/html/guide/publishing/preparing.jd
+++ b/docs/html/guide/publishing/preparing.jd
@@ -117,11 +117,14 @@
 certificate requirements, see <a href="{@docRoot}guide/publishing/app-signing.html#cert">Obtain a
 suitable private key</a>.</p>
 
+<p class="caution"><strong>Important:</strong> Your application must be signed with a cryptographic
+key whose validity period ends after 22 October 2033.</p>
+
 <p>You may also have to obtain other release keys if your application accesses a service or uses a
 third-party library that requires you to use a key that is based on your private key. For example,
 if your application uses the <a
-href="http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/ MapView.
-html">MapView</a> class, which is part of the <a
+href="http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/MapView.html">MapView</a>
+class, which is part of the <a
 href="http://code.google.com/android/add-ons/google-apis/maps-overview.html">Google Maps external
 library</a>, you will need to register your application with the Google Maps service and obtain
 a Maps API key. For information about getting a Maps API key, see <a
diff --git a/docs/html/guide/publishing/publishing.jd b/docs/html/guide/publishing/publishing.jd
index fa677e6..49b34d8 100644
--- a/docs/html/guide/publishing/publishing.jd
+++ b/docs/html/guide/publishing/publishing.jd
@@ -7,9 +7,9 @@
 <h2>Quickview</h2>
 
 <ul>
-<li>You can publish your application using a hosted service such as Android Market or through a web server.</li>
-<li>Before you publish, make sure you have prepared your application properly.</li>
-<li>Android Market makes it easy for users of Android-powered devices to see and download your application.</li>
+<li>Learn how to publish and update apps on Android Market.</li>
+<li>Find out how to create links to apps that are published on Android Market.</li>
+<li>Learn about Android Market features.</li>
 </ul>
 
 
@@ -17,97 +17,201 @@
 
 <ol>
 <li><a href="#overview">About Android Market</a>
+<li><A href="#marketpublish">Publishing Apps on Android Market</a></li>
 <li><a href="#marketupgrade">Publishing Updates on Android Market</a></li>
 <li><a href="#marketLicensing">Using Android Market Licensing Service</a></li>
+<li><a href="#marketinappbilling">Using Android Market In-app Billing</a></li>
 <li><a href="#marketintent">Linking to Your Apps on Android Market</a>
   <ol>
     <li><a href="#OpeningDetails">Opening an app's details page</a></li>
     <li><a href="#PerformingSearch">Performing a search</a></li>
     <li><a href="#BuildaButton">Build an Android Market button</a></li>
     <li><a href="#UriSummary">Summary of URI formats</a></li>
-  </ol>  
+  </ol>
 </li>
 </ol>
 
 <h2>See also</h2>
 
 <ol>
-<li><a href="{@docRoot}guide/publishing/licensing.html">Application Licensing</a></li>
-<li><a href="{@docRoot}guide/publishing/preparing.html">Preparing to Publish</a></li>
+<li><a href="{@docRoot}guide/publishing/publishing_overview.html">Publishing Overview</a></li>
+<li><a href="{@docRoot}guide/publishing/preparing.html">Preparing for Release</a></li>
 </ol>
 
 <div id="qv-extra">
   <img id="rule" src="{@docRoot}assets/images/grad-rule-qv.png">
   <div id="qv-sub-rule">
     <img src="{@docRoot}assets/images/icon_market.jpg" style="float:left;margin:0;padding:0 5px;">
-    <h2 style="color:#669999;">Interested in publishing your app on Android Market?</h2>
-    <p><a href="http://market.android.com/publish">Go to Android Market</a> to
-create a developer account and upload your application. For more information about the
-required assets, listing details, and options, see <a
-href="http://market.android.com/support/bin/answer.py?answer=113469">Uploading
-applications</a>.</p>
+    <h2 style="color:#669999;">Already know about Android Market and want to get started?</h2>
+    <p>Go to <a href="http://market.android.com/publish">Android Market</a>, create a developer
+account, and upload your application. For more information about required assets, listing details,
+and publishing options, see <a
+href="http://market.android.com/support/bin/answer.py?answer=113469">Upload
+Applications</a>.</p>
   </div>
 </div>
 
 </div>
 </div>
 
-<p>If you've followed the steps outlined in <a
-href="{@docRoot}guide/publishing/preparing.html">Preparing to Publish</a>, the result of the process
-is a compiled {@code .apk} file that is signed with your private release key. Your application is
-now ready to be published publicly so users can install it.</p>
+<p>One of the most effective ways to get your application into users' hands is to
+publish it on an application marketplace like Android Market. Publishing on Android Market is a
+straightforward process that you can do in just a few simple steps&mdash;register, configure,
+upload, and publish. Registration takes only a few minutes and needs to be done only once.
+The configuration and publishing steps can all be done through the Android Market Developer Console
+after you register as an Android Market developer.</p>
 
-<p>You can publish your application and allow users to install it any way you choose, including
-from your own web server. This document provides information about publishing your Android
-application with Android Market.</p>
+<p>To start publishing on Android Market, first read this topic and then go to the <a
+href="https://market.android.com/publish/signup">Android Market publisher site</a> and register as
+an Android Market developer.</p>
 
 
 <h2 id="overview">About Android Market</h2>
 
-<p>Android Market is a service that makes it easy for users to find and download Android
-applications to their Android-powered devices, either from the Android Market application on their
-device or from the Android Market web site (<a
-href="http://market.android.com">market.android.com</a>). As a developer, you can use Android Market
-to distribute your applications to users on all types of Android-powered devices, all around the
-world.</p>
+<p>Android Market is a robust publishing platform that helps you publicize, sell, and distribute
+your Android applications to users around the world. When you release your applications through
+Android Market you have access to a suite of developer tools that let you analyze your sales,
+identify market trends, and control who your applications are being distributed to. You also have
+access to several revenue-enhancing features, such as <a
+href="{@docRoot}guide/market/billing/index.html">in-app billing</a> and
+<a href="{@docRoot}guide/publishing/licensing.html">application licensing</a>.</p>
 
-<p>To publish your application on Android Market, you first need to register
-with the service using a Google account and agree to the terms of service.
-Once you are registered, you can upload your application to the service whenever
-you want, update it as many times as you want, and then publish it when you are ready.
-Once published, users can see your application, download it, and rate it. </p>
+<p>Before you can publish applications on Android Market, you need to <a
+href="http://market.android.com/publish">register</a> as an Android Market developer. During the
+registration process you will need to create a developer profile, pay a registration fee, and agree
+to the <a href="http://www.android.com/us/developer-distribution-agreement.html">Android Market
+Developer Distribution Agreement</a>. After you register you can access the Android Market Developer
+Console, where you can upload applications, configure publishing options, and monitor publishing
+data. If you want to sell your applications or use the in-app billing feature, you will also need
+to set up a Google Checkout merchant account. For more information about the registration process,
+see <a href="https://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=113468">
+Developer Registration</a>.</p>
 
-<p>To register as an Android Market developer and get started with publishing,
-visit the Android Market publisher site: </p>
+<h2 id="marketpublish">Publishing Apps on Android Market</h2>
 
-<p style="margin-left:3em;"><a
-href="http://market.android.com/publish">http://market.android.com/publish</a>
+<p>Publishing your application on Android Market is a simple process that involves three basic
+tasks (see figure 1):</p>
+
+<ul>
+  <li>Creating various graphical assets that
+accompany your app on Android Market.</li>
+  <li>Using the Android Market <a
+href="http://market.android.com/publish">Developer Console</a> to configure publishing options,
+specify listing details, and upload your app and graphical assets to Android Market.</li>
+  <li>Reviewing your publishing settings and changing the release
+status of your app from Unpublished to Published.</li>
+</ul>
+
+<img src="{@docRoot}images/publishing/publishing_android_market.png"
+     alt="Shows the three steps that are required to publish on Android Market"
+     height="168"
+     id="figure1" />
+<p class="img-caption">
+  <strong>Figure 1.</strong> To publish apps on Android Market you must first <a
+href="{@docRoot}guide/publishing/preparing.html">prepare your app for release</a> and then perform
+three simple tasks.
 </p>
 
-<p>If you plan to publish your application on Android Market, you must make sure
-that it meets the requirements listed below, which are enforced by the Market
-server when you upload the application.</p>
+<p class="caution"><strong>Important:</strong> You must <a
+href="{@docRoot}guide/publishing/preparing.html">prepare your application for release</a> before you
+can publish it on Android Market. When you prepare your application for release you configure it for
+release and build it in release mode. Building in release mode signs your application's {@code .apk}
+file with your private release key. You cannot publish an application on Android Market unless it is
+signed with your own private release key.</p>
 
-<div class="special">
-<p>Requirements enforced by the Android Market server:</p>
-<ol>
-<li>Your application must be signed with a cryptographic private key whose
-validity period ends after <span style="color:red">22 October 2033</span>. </li>
-<li>Your application must define both an <code>android:versionCode</code> and an
-<code>android:versionName</code> attribute in the
+<h3>Preparing promotional materials</h3>
+
+<p>To fully leverage the marketing and publicity capabilities of Android Market, you need to create
+several graphical assets that accompany your app on Android Market, such as screenshots, videos,
+promotional graphics, and promotional text. At a minimum you must provide two screenshots of your
+application and a high resolution application icon. The screenshots are displayed on the details
+page for your application in Android Market, and the high resolution application icon is displayed
+in various locations throughout Android Market. The high resolution icon does not replace the
+launcher icon for your application, rather, it serves as a supplemental icon and should look
+the same as your launcher icon. Promotional video,
+graphics, and text are optional, although we strongly recommended that you prepare these for your
+app. For more information about the graphic assets that accompany your application, see <a
+href="http://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=1078870">Graphic
+Assets for your Application</a>.</p>
+
+<h3>Configuring options and uploading assets</h3>
+
+<p>Android Market lets you target your application to a worldwide pool of users and devices. To
+reach these users you can use the Android Market Developer Console to configure various publishing
+options and listing details for your app. For example, you can choose the <a
+href="http://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=138294&topic=
+2365624&ctx=topic">countries</a> you want to reach, the listing languages you want to use, and the
 <a
-href="{@docRoot}guide/topics/manifest/manifest-element.html"><code>&lt;manifest&gt;</code></a>
-element of its manifest file. The server uses the <code>android:versionCode</code> as
-the basis for identifying the application internally and handling updates, and
-it displays the <code>android:versionName</code> to users as the application's
-version.</li>
-<li>Your application must define both an <code>android:icon</code> and an
-<code>android:label</code> attribute in the <a
-href="{@docRoot}guide/topics/manifest/application-element.html"><code>&lt;application&gt;</code></a>
-element of its manifest file.</li>
-</ol>
-</div>
+href="http://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=138412&topic=
+15867&ctx=topic">price</a> you want to charge in each country. You can also configure listing
+details such as the application type, <a
+href="https://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=113475&topic=
+2365760&ctx=topic">category</a>, and <a
+href="http://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=188189&topic=
+2364761&ctx=topic">content rating</a>. In addition, if you want to sell items within your app using
+the in-app billing feature, you can use the Developer Console to <a
+href="http://grendel.sea.corp.google.com:48014/guide/market/billing/billing_admin.html#billing-list
+- setup">create a product list</a> and control which items are available for purchase in your
+app.</p>
 
+<p>When you are finished setting publishing options and listing details, you can upload your assets
+and your application to Android Market. You can also upload your application as a draft
+(unpublished) application, which lets you do final testing before you publish it for final
+release.</p>
+
+<p>To learn more about Android Market publishing settings, see the following resources:</p>
+
+<ul>
+  <li><a
+href="http://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=113469&topic=
+236562&ctx=topic">Upload Applications</a>&mdash;provides a summary of the publishing settings
+you can configure for an app.</li>
+  <li><a
+href="http://support.google.com/androidmarket/developer/bin/topic.py?hl=en&topic=15867">Selling
+Your Apps</a>&mdash;provides guidance about pricing, supported currencies, tax rates, and many
+other topics related to selling apps.</li>
+  <li><a
+href="https://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=1169947&topic=
+15867&ctx=topic">Selling Apps in Multiple Currencies</a>&mdash;provides a description of how
+pricing, payouts, and exchange rates work.</li>
+</ul>
+
+<h3>Publishing your application</h3>
+
+<p>When you are satisfied that your publishing settings are correctly configured and your uploaded
+application is ready to be released to the public, you can simply click <strong>Publish</strong> in
+the Developer Console to make your app available for download
+around the world. Keep in mind, it can take several hours for your app to appear on Android
+Market after you click <strong>Publish</strong> in the Developer Console.</p>
+
+<h3>Controlling Distribution to Devices</h3>
+
+<p>If your application targets different device configurations, you can control which Android-powered
+devices have access to your application on Android Market by
+using Android Market filters. Filtering compares device configurations that you declare in your
+app's manifest file to the configuration defined by a device. For example, if you declare the camera
+filter in your manifest, only those devices that have a camera will see your app on Android
+Market. Filters must be configured in your application's manifest file when you are <a
+href="{@docRoot}guide/publishing/preparing.html">preparing your app for release</a> (that is, before
+you upload your app to Android Market). For more information, see <a
+href="{@docRoot}guide/appendix/market-filters.html">Market Filters</a>.</p>
+
+<p>You can also use the multiple APK feature to distribute different {@code .apk} files under the same
+application listing and the same package name; however, you should use this option only as a last
+resort. Android applications usually run on most compatible devices with a single APK, by supplying
+alternative resources for different configurations (for example, different layouts for different screen
+sizes) and the Android system selects the appropriate resources for the device at runtime. In a
+few cases, however, a single APK is unable to support all device configurations, because alternative
+resources make the APK file too big (greater than 50MB) or other technical challenges prevent a
+single APK from working on all devices. Although we encourage you to develop and publish a single
+APK that supports as many device configurations as possible, doing so is sometimes
+not possible. To help you publish your application for as many devices as possible, Android Market
+allows you to publish multiple APKs under the same application listing. Android Market then supplies
+each APK to the appropriate devices based on configuration support you've declared in the manifest
+file of each APK. To use this feature, you need to build your separate {@code .apk} files when you are <a
+href="{@docRoot}guide/publishing/preparing.html">preparing your app for release</a> (that is, before
+you upload your app to Android Market). For more information, see <a
+href="{@docRoot}guide/market/publishing/multiple-apks.html">Multiple APK Support</a>.</p>
 
 <h2 id="marketupgrade">Publishing Updates on Android Market</h2>
 
@@ -128,6 +232,9 @@
 consider it a new application, publish it as such, and will not offer it to existing users as an
 update.</p>
 
+<p>If you plan to publish your application on Android Market, you must make sure
+  that it meets the requirements listed below, which are enforced by the Market
+  server when you upload the application.</p>
 
 <h2 id="marketLicensing">Using Android Market Licensing Service</h2>
 
@@ -136,7 +243,7 @@
 Android Market Licensing, your applications can query Android Market at runtime
 to obtain the licensing status for the current user, then allow or disallow
 further use of the application as appropriate. Using the service, you can apply a flexible
-licensing policy on an application-by-application basis&mdash;each 
+licensing policy on an application-by-application basis&mdash;each
 application can enforce its licensing status in the way most appropriate
 for it. </p>
 
@@ -149,7 +256,31 @@
 use it in your application, read <a
 href="{@docRoot}guide/publishing/licensing.html">Application Licensing</a>.</p>
 
+<h2 id="marketinappbilling">Using Android Market In-app Billing</h2>
 
+<p><a href="{@docRoot}guide/market/billing/billing_overview.html">Android Market In-app Billing</a>
+is an Android Market service that lets you sell digital content in your applications. You can use
+the service to sell a wide range of content, including downloadable  content such as media files or
+photos, and virtual content such as game levels or potions.</p>
+
+<p>When you use Android Market's in-app billing service to sell an item, Android Market handles all
+billing details so your application never has to directly process any financial transactions.
+Android Market uses the same checkout service that is used for application purchases, so your users
+experience a consistent and familiar purchase flow (see figure 1). Also, the transaction fee for
+in-app purchases is the same as the transaction fee for application purchases (30%).</p>
+
+<p>Any application that you publish through Android Market can implement in-app billing. No special
+account or registration is required other than an Android Market publisher account and a Google
+Checkout Merchant account. Also, because the service uses no dedicated framework APIs, you can add
+in-app billing to any application that uses a minimum API level of 4 or higher.</p>
+
+<p>To help you integrate in-app billing into your application, the Android SDK provides a <a
+href="{@docRoot}guide/market/billing/billing_integrate.html#billing-download">sample application</a>
+that demonstrates a simple implementation of in-app billing. The sample application contains
+examples of billing-related classes you can use to implement in-app billing in your application. It
+also contains examples of the database, user interface, and business logic you might use to
+implement in-app billing. For more information about the in-app billing feature, see the
+<a href="{@docRoot}guide/market/billing/index.html">In-app Billing documentation</a>.</p>
 
 <h2 id="marketintent">Linking to Your Apps on Android Market</h2>
 
@@ -337,7 +468,7 @@
 Guidelines</a>.</p>
 
 <style type="text/css">
-  
+
 form.button-form {
   margin-top:2em;
 }
@@ -539,7 +670,7 @@
 
 <tr>
 <td>Display the details screen for a specific application</td>
-<td><code>http://market.android.com/details?id=&lt;package_name&gt;</code> 
+<td><code>http://market.android.com/details?id=&lt;package_name&gt;</code>
 <td><code>market://details?id=&lt;package_name&gt;</code></td>
 </tr>
 
diff --git a/docs/html/guide/publishing/publishing_overview.jd b/docs/html/guide/publishing/publishing_overview.jd
index a0f6ae3..79199c5 100755
--- a/docs/html/guide/publishing/publishing_overview.jd
+++ b/docs/html/guide/publishing/publishing_overview.jd
@@ -21,7 +21,7 @@
   </ol>
   <h2>See also</h2>
   <ol>
-    <li><a href="{@docRoot}guide/publishing/publishing_preparing.html">Preparing for
+    <li><a href="{@docRoot}guide/publishing/preparing.html">Preparing for
     Release</a></li>
     <li><a href="{@docRoot}guide/publishing/publishing.html">Publishing on Android Market</a></li>
   </ol>
@@ -134,7 +134,7 @@
 and features, coupled with numerous end-user community features, makes Android Market the premier
 marketplace for selling and buying Android applications.</p>
 
-<p>Releasing your application on Android Market is a simple process that involves four basic
+<p>Releasing your application on Android Market is a simple process that involves three basic
   steps:</p>
 
 <div class="figure" style="width:275px">
@@ -153,21 +153,16 @@
     create promotional materials for your application, such as screenshots, videos, graphics, and
     promotional text.</p>
   </li>
-  <li>Planning publishing options.
+  <li>Configuring options and uploading assets.
     <p>Android Market lets you target your application to a worldwide pool of users and devices.
-    Using various Android Market tools, you can choose the countries you want to reach, the
-    price you want to charge in each country, and the devices you want to target. You can also
-    use Android Market's filtering settings to target specific device features and capabilities.</p>
-  </li>
-  <li>Configuring publishing options and uploading assets.
-    <p>After you create your promotional materials and determine which publishing options are
-    suitable for your application, you can use the Android Market developer console to configure
-    those options and upload the promotional materials. You can also use the developer console to
-    upload your application as a draft (unpublished) application, which lets you do final
-    testing before you publish it for final release.</p>
+    By configuring various Android Market settings, you can choose the countries you want to
+    reach, the listing languages you want to use, and the price you want to charge in each
+    country. You can also configure listing details such as the application type, category, and
+    content rating. When you are done configuring options you can upload your promotional materials
+    and your application as a draft (unpublished) application.</p>
   </li>
   <li>Publishing the release version of your application.
-    <p>When you are satisfied that your publishing settings are correctly configured and your
+    <p>If you are satisfied that your publishing settings are correctly configured and your
     uploaded application is ready to be released to the public, you can simply click
     <strong>Publish</strong > in the developer console and within minutes your application will be
     live and available for download around the world.</p>
@@ -233,4 +228,4 @@
 <p>Releasing applications through email is convenient if you are sending your application to
 only a few trusted users, but it provides few protections from piracy and unauthorized
 distribution; that is, anyone you send your application to can simply forward it to someone else.
-else.
\ No newline at end of file
+else.
diff --git a/docs/html/guide/topics/appwidgets/index.jd b/docs/html/guide/topics/appwidgets/index.jd
index 7b869a0..ba7b67c 100644
--- a/docs/html/guide/topics/appwidgets/index.jd
+++ b/docs/html/guide/topics/appwidgets/index.jd
@@ -518,15 +518,12 @@
 to the App Widget without worrying about the AppWidgetProvider closing down due
 to an <a href="{@docRoot}guide/practices/design/responsiveness.html">Application
 Not Responding</a> (ANR) error. See the <a
-href="http://code.google.com/p/wiktionary-android/source/browse/trunk/Wiktionary
-/src/com/example/android/wiktionary/WordWidget.java">Wiktionary sample's
-AppWidgetProvider</a> for an example of an App Widget running a {@link
+href="http://code.google.com/p/wiktionary-android/source/browse/trunk/Wiktionary/src/com/example/android/wiktionary/WordWidget.java">Wiktionary sample's AppWidgetProvider</a> for an example of an App Widget running a {@link
 android.app.Service}.</p>
 
 <p>Also see the <a 
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/
-appwidget/ExampleAppWidgetProvider.html">
-ExampleAppWidgetProvider.java</a> sample class.</p>
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/appwidget/ExampleAppWidgetProvider.html">ExampleAppWidgetProvider.java</a>
+sample class.</p>
 
 
 <h3 id="ProviderBroadcasts">Receiving App Widget broadcast Intents</h3>
@@ -683,9 +680,8 @@
 App Widget will not be added.</p>
 
 <p>See the <a 
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/
-appwidget/ExampleAppWidgetConfigure.html">
-ExampleAppWidgetConfigure.java</a> sample class in ApiDemos for an example.</p>
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/appwidget/ExampleAppWidgetConfigure.html">ExampleAppWidgetConfigure.java</a>
+sample class in ApiDemos for an example.</p>
 
 <h2 id="preview">Setting a Preview Image</h2>
 
diff --git a/docs/html/guide/topics/fundamentals/activities.jd b/docs/html/guide/topics/fundamentals/activities.jd
index 3b31199..8736aa8 100644
--- a/docs/html/guide/topics/fundamentals/activities.jd
+++ b/docs/html/guide/topics/fundamentals/activities.jd
@@ -63,7 +63,7 @@
 activity starts, the previous activity is stopped, but the system preserves the activity
 in a stack (the "back stack"). When a new activity starts, it is pushed onto the back stack and
 takes user focus. The back stack abides to the basic "last in, first out" queue mechanism,
-so, when the user is done with the current activity and presses the BACK key, it
+so, when the user is done with the current activity and presses the <em>Back</em> button, it
 is popped from the stack (and destroyed) and the previous activity resumes. (The back stack is
 discussed more in the <a href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks
 and Back Stack</a> document.)</p>
@@ -649,7 +649,8 @@
 <p class="note"><strong>Note:</strong> There's no guarantee that {@link
 android.app.Activity#onSaveInstanceState onSaveInstanceState()} will be called before your
 activity is destroyed, because there are cases in which it won't be necessary to save the state
-(such as when the user leaves your activity using the BACK key, because the user is explicitly
+(such as when the user leaves your activity using the <em>Back</em> button, because the user is
+explicitly
 closing the activity). If the system calls {@link android.app.Activity#onSaveInstanceState
 onSaveInstanceState()}, it does so before {@link
 android.app.Activity#onStop onStop()} and possibly before {@link android.app.Activity#onPause
diff --git a/docs/html/guide/topics/fundamentals/fragments.jd b/docs/html/guide/topics/fundamentals/fragments.jd
index e8f6cd8..d4f9342 100644
--- a/docs/html/guide/topics/fundamentals/fragments.jd
+++ b/docs/html/guide/topics/fundamentals/fragments.jd
@@ -78,7 +78,7 @@
 fragment transaction, you can also add it to a back stack that's managed by the
 activity&mdash;each back stack entry in the activity is a record of the fragment transaction that
 occurred. The back stack allows the user to reverse a fragment transaction (navigate backwards),
-by pressing the BACK button.</p>
+by pressing the <em>Back</em> button.</p>
 
 <p>When you add a fragment as a part of your activity layout, it lives in a {@link
 android.view.ViewGroup} inside the activity's view hierarchy and the fragment defines its own view
@@ -398,7 +398,7 @@
 the activity layout) or {@link android.app.FragmentManager#findFragmentByTag
 findFragmentByTag()} (for fragments that do or don't provide a UI).</li> 
   <li>Pop fragments off the back stack, with {@link
-android.app.FragmentManager#popBackStack()} (simulating a BACK command by the user).</li>
+android.app.FragmentManager#popBackStack()} (simulating a <em>Back</em> command by the user).</li>
   <li>Register a listener for changes to the back stack, with {@link
 android.app.FragmentManager#addOnBackStackChangedListener addOnBackStackChangedListener()}.</li>
 </ul>
@@ -439,7 +439,7 @@
 android.app.FragmentTransaction#commit()}, however, you might want to call {@link
 android.app.FragmentTransaction#addToBackStack addToBackStack()}, in order to add the transaction
 to a back stack of fragment transactions. This back stack is managed by the activity and allows
-the user to return to the previous fragment state, by pressing the BACK key.</p>
+the user to return to the previous fragment state, by pressing the <em>Back</em> button.</p>
 
 <p>For example, here's how you can replace one fragment with another, and preserve the previous
 state in the back stack:</p>
@@ -462,14 +462,14 @@
 layout container identified by the {@code R.id.fragment_container} ID. By calling {@link
 android.app.FragmentTransaction#addToBackStack addToBackStack()}, the replace transaction is
 saved to the back stack so the user can reverse the transaction and bring back the
-previous fragment by pressing the BACK key.</p>
+previous fragment by pressing the <em>Back</em> button.</p>
 
 <p>If you add multiple changes to the transaction (such as another {@link
 android.app.FragmentTransaction#add add()} or {@link android.app.FragmentTransaction#remove
 remove()}) and call {@link
 android.app.FragmentTransaction#addToBackStack addToBackStack()}, then all changes applied
 before you call {@link android.app.FragmentTransaction#commit commit()} are added to the
-back stack as a single transaction and the BACK key will reverse them all together.</p>
+back stack as a single transaction and the <em>Back</em> button will reverse them all together.</p>
 
 <p>The order in which you add changes to a {@link android.app.FragmentTransaction} doesn't matter,
 except:</p>
@@ -696,7 +696,7 @@
 <p>The most significant difference in lifecycle between an activity and a fragment is how one is
 stored in its respective back stack. An activity is placed into a back stack of activities
 that's managed by the system when it's stopped, by default (so that the user can navigate back
-to it with the BACK key, as discussed in <a
+to it with the <em>Back</em> button, as discussed in <a
 href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back Stack</a>).
 However, a fragment is placed into a back stack managed by the host activity only when you
 explicitly request that the instance be saved by calling {@link
diff --git a/docs/html/guide/topics/fundamentals/tasks-and-back-stack.jd b/docs/html/guide/topics/fundamentals/tasks-and-back-stack.jd
index 5a1f7a2..465cf54 100644
--- a/docs/html/guide/topics/fundamentals/tasks-and-back-stack.jd
+++ b/docs/html/guide/topics/fundamentals/tasks-and-back-stack.jd
@@ -34,7 +34,9 @@
 
 <h2>See also</h2>
 <ol>
-  <li><a><a href="{@docRoot}videos/index.html#v=fL6gSd4ugSI">Application Lifecycle video</a></li>
+  <li><a href="{@docRoot}design/patterns/navigation.html">Android Design:
+Navigation</a></li>
+  <li><a href="{@docRoot}videos/index.html#v=fL6gSd4ugSI">Application Lifecycle video</a></li>
   <li><a
 href="{@docRoot}guide/topics/manifest/activity-element.html">{@code &lt;activity&gt;} manifest
 element</a></li>
@@ -72,7 +74,7 @@
 suppose you have a two-pane layout using fragments, one of which is a list view (fragment A) and the
 other being a layout to display an item from the list (fragment B). When the user selects an item
 from the list, fragment B is replaced by a new fragment (fragment C). In this case, it might be
-desireable for the user to navigate back to reveal fragment B, using the BACK button.</p>
+desireable for the user to navigate back to reveal fragment B, using the <em>Back</em> button.</p>
 <p>In order to add fragment B to the back stack so that this is possible, you must call {@link
 android.app.FragmentTransaction#addToBackStack addToBackStack()} before you {@link
 android.app.FragmentTransaction#commit()} the transaction that replaces fragment B with fragment
@@ -92,22 +94,26 @@
 
 <p>When the current activity starts another, the new activity is pushed on the top of the stack and
 takes focus. The previous activity remains in the stack, but is stopped. When an activity
-stops, the system retains the current state of its user interface. When the user presses the BACK
+stops, the system retains the current state of its user interface. When the user presses the
+<em>Back</em>
 button, the current activity is popped from the top of the stack (the activity is destroyed) and the
 previous activity resumes (the previous state of its UI is restored). Activities in the stack are
 never rearranged, only pushed and popped from the stack&mdash;pushed onto the stack when started by
-the current activity and popped off when the user leaves it using the BACK button. As such, the back
+the current activity and popped off when the user leaves it using the <em>Back</em> button. As such,
+the back
 stack operates as a "last in, first out" object structure. Figure 1 visualizes
 this behavior with a timeline showing the progress between activities along with the current back
 stack at each point in time.</p>
 
 <img src="{@docRoot}images/fundamentals/diagram_backstack.png" alt="" />
 <p class="img-caption"><strong>Figure 1.</strong> A representation of how each new activity in a
-task adds an item to the back stack. When the user presses the BACK button, the current activity is
+task adds an item to the back stack. When the user presses the <em>Back</em> button, the current
+activity is
 destroyed and the previous activity resumes.</p>
 
 
-<p>If the user continues to press BACK, then each activity in the stack is popped off to reveal the
+<p>If the user continues to press <em>Back</em>, then each activity in the stack is popped off to
+reveal the
 previous one, until the user returns to the Home screen (or to whichever activity was running when
 the task began). When all activities are removed from the stack, the task no longer exists.</p>
 
@@ -122,11 +128,13 @@
 </div>
 
 <p>A task is a cohesive unit that can move to the "background" when users begin a new task or go
-to the Home screen, via the HOME button. While in the background, all the activities in the task are
+to the Home screen, via the <em>Home</em> button. While in the background, all the activities in the
+task are
 stopped, but the back stack for the task remains intact&mdash;the task has simply lost focus while
 another task takes place, as shown in figure 2. A task can then return to the "foreground" so users
 can pick up where they left off. Suppose, for example, that the current task (Task A) has three
-activities in its stack&mdash;two under the current activity. The user presses the HOME button, then
+activities in its stack&mdash;two under the current activity. The user presses the <em>Home</em>
+button, then
 starts a new application from the application launcher. When the Home screen appears, Task A goes
 into the background. When the new application starts, the system starts a task for that application
 (Task B) with its own stack of activities. After interacting with
@@ -135,7 +143,8 @@
 foreground&mdash;all three activities in its stack are intact and the activity at the top of the
 stack resumes. At
 this point, the user can also switch back to Task B by going Home and selecting the application icon
-that started that task (or by touching and holding the HOME button to reveal recent tasks and selecting
+that started that task (or by touching and holding the <em>Home</em> button to reveal recent tasks
+and selecting
 one). This is an example of multitasking on Android.</p>
 
 <p class="note"><strong>Note:</strong> Multiple tasks can be held in the background at once.
@@ -148,7 +157,8 @@
 that activity is created and popped onto the stack (rather than bringing any previous instance of
 the activity to the top). As such, one activity in your application might be instantiated multiple
 times (even from different tasks), as shown in figure 3. As such, if the user navigates backward
-using the BACK button, each instance of the activity is revealed in the order they were opened (each
+using the <em>Back</em> button, each instance of the activity is revealed in the order they were
+opened (each
 with their own UI state). However, you can modify this behavior if you do not want an activity to be
 instantiated more than once. How to do so is discussed in the later section about <a
 href="#ManagingTasks">Managing Tasks</a>.</p>
@@ -159,19 +169,28 @@
 <ul>
   <li>When Activity A starts Activity B, Activity A is stopped, but the system retains its state
 (such as scroll position and text entered into forms).
-If the user presses the BACK button while in Activity B, Activity A resumes with its state
+If the user presses the <em>Back</em> button while in Activity B, Activity A resumes with its state
 restored.</li>
-  <li>When the user leaves a task by pressing the HOME button, the current activity is stopped and
+  <li>When the user leaves a task by pressing the <em>Home</em> button, the current activity is
+stopped and
 its task goes into the background. The system retains the state of every activity in the task. If
 the user later resumes the task by selecting the launcher icon that began the task, the task comes
 to the foreground and resumes the activity at the top of the stack.</li>
-  <li>If the user presses the BACK button, the current activity is popped from the stack and
+  <li>If the user presses the <em>Back</em> button, the current activity is popped from the stack
+and
 destroyed. The previous activity in the stack is resumed. When an activity is destroyed, the system
 <em>does not</em> retain the activity's state.</li>
   <li>Activities can be instantiated multiple times, even from other tasks.</li>
 </ul>
 
 
+<div class="design-announce">
+<p><strong>Navigation Design</strong></p>
+  <p>For more about how app navigation works on Android, read Android Design's <a
+href="{@docRoot}design/patterns/navigation.html">Navigation</a> guide.</p>
+</div>
+
+
 <h2 id="ActivityState">Saving Activity State</h2>
 
 <p>As discussed above, the system's default behavior preserves the state of an activity when it is
@@ -247,7 +266,8 @@
 <p class="caution"><strong>Caution:</strong> Most applications should not interrupt the default
 behavior for activities and tasks. If you determine that it's necessary for your activity to modify
 the default behaviors, use caution and be sure to test the usability of the activity during
-launch and when navigating back to it from other activities and tasks with the BACK button. Be sure 
+launch and when navigating back to it from other activities and tasks with the <em>Back</em> button.
+Be sure 
 to test for navigation behaviors that might conflict with the user's expected behavior.</p>
 
 
@@ -311,8 +331,10 @@
 stack remains A-B-C-D. However, if an intent arrives for an activity of type B, then a new
 instance of B is added to the stack, even if its launch mode is {@code "singleTop"}.</p>
   <p class="note"><strong>Note:</strong> When a new instance of an activity is created,
-the user can press the BACK button to return to the previous activity. But when an existing instance of
-an activity handles a new intent, the user cannot press the BACK button to return to the state of
+the user can press the <em>Back</em> button to return to the previous activity. But when an existing
+instance of
+an activity handles a new intent, the user cannot press the <em>Back</em> button to return to the
+state of
 the activity before the new intent arrived in {@link android.app.Activity#onNewIntent
 onNewIntent()}.</p>
 </dd>
@@ -324,7 +346,7 @@
 android.app.Activity#onNewIntent onNewIntent()} method, rather than creating a new instance. Only
 one instance of the activity can exist at a time.
   <p class="note"><strong>Note:</strong> Although the activity starts in a new task, the
-BACK button still returns the user to the previous activity.</p></dd>
+<em>Back</em> button still returns the user to the previous activity.</p></dd>
 <dt>{@code "singleInstance"}.</dt>
   <dd>Same as {@code "singleTask"}, except that the system doesn't launch any other activities into
 the task holding the instance. The activity is always the single and only member of its task;
@@ -342,7 +364,7 @@
 intent.</p>
 
 <p>Regardless of whether an activity starts in a new task or in the same task as the activity that
-started it, the BACK button always takes the user to the previous activity. However, if you
+started it, the <em>Back</em> button always takes the user to the previous activity. However, if you
 start an activity that specifies the {@code singleTask} launch mode, then if an instance of
 that activity exists in a background task, that whole task is brought to the foreground. At this
 point, the back stack now includes all activities from the task brought forward, at the top of the
@@ -445,7 +467,8 @@
 However, it doesn't have to be.  If there's already an existing task with the same affinity as the
 new activity, the activity is launched into that task.  If not, it begins a new task.</p>
 
-<p>If this flag causes an activity to begin a new task and the user presses the HOME button to leave
+<p>If this flag causes an activity to begin a new task and the user presses the <em>Home</em> button
+to leave
 it, there must be some way for the user to navigate back to the task. Some entities (such as the
 notification manager) always start activities in an external task, never as part of their own, so
 they always put {@code FLAG_ACTIVITY_NEW_TASK} in the intents they pass to {@link
@@ -547,7 +570,8 @@
 and a {@link android.content.Intent#CATEGORY_LAUNCHER}
 filter. Imagine, for example, what could happen if the filter is missing: An intent launches a
 {@code "singleTask"} activity, initiating a new task, and the user spends some time working in
-that task.  The user then presses the HOME button. The task is now sent to the background and is
+that task.  The user then presses the <em>Home</em> button. The task is now sent to the background
+and is
 not visible. Now the user has no way to return to the task, because it is not represented in the
 application launcher.
 </p>
diff --git a/docs/html/guide/topics/graphics/hardware-accel.jd b/docs/html/guide/topics/graphics/hardware-accel.jd
index c8703a5..39ccbf4 100644
--- a/docs/html/guide/topics/graphics/hardware-accel.jd
+++ b/docs/html/guide/topics/graphics/hardware-accel.jd
@@ -283,8 +283,6 @@
 
         <li>{@link android.graphics.Canvas#drawPicture drawPicture()}</li>
 
-        <li>{@link android.graphics.Canvas#drawPosText drawPosText()}</li>
-
         <li>{@link android.graphics.Canvas#drawTextOnPath drawTextOnPath()}</li>
 
         <li>{@link android.graphics.Canvas#drawVertices drawVertices()}</li>
@@ -302,6 +300,16 @@
         <li>{@link android.graphics.Paint#setRasterizer setRasterizer()}</li>
       </ul>
     </li>
+
+    <li>
+      <strong>Xfermodes</strong>
+
+      <ul>
+        <li>{@link android.graphics.AvoidXfermode AvoidXfermode}</li>
+
+        <li>{@link android.graphics.PixelXorXfermode PixelXorXfermode}</li>
+      </ul>
+    </li>
   </ul>
 
   <p>In addition, some operations behave differently with hardware acceleration enabled:</p>
@@ -317,12 +325,6 @@
 
         <li>{@link android.graphics.Canvas#drawBitmapMesh drawBitmapMesh()}: colors array is
         ignored</li>
-
-        <li>{@link android.graphics.Canvas#drawLines drawLines()}: anti-aliasing is not
-        supported</li>
-
-        <li>{@link android.graphics.Canvas#setDrawFilter setDrawFilter()}: can be set, but is
-        ignored</li>
       </ul>
     </li>
 
@@ -341,6 +343,24 @@
     </li>
 
     <li>
+      <strong>PorterDuffXfermode</strong>
+
+      <ul>
+        <li>{@link android.graphics.PorterDuff.Mode#DARKEN PorterDuff.Mode.DARKEN} will
+        be equivalent to {@link android.graphics.PorterDuff.Mode#SRC_OVER} when blending
+        against the framebuffer.</li>
+
+        <li>{@link android.graphics.PorterDuff.Mode#LIGHTEN PorterDuff.Mode.LIGHTEN} will
+        be equivalent to {@link android.graphics.PorterDuff.Mode#SRC_OVER} when blending
+        against the framebuffer.</li>
+
+        <li>{@link android.graphics.PorterDuff.Mode#OVERLAY PorterDuff.Mode.OVERLAY} will
+        be equivalent to {@link android.graphics.PorterDuff.Mode#SRC_OVER} when blending
+        against the framebuffer.</li>
+      </ul>
+    </li>
+
+    <li>
       <strong>ComposeShader</strong>
 
       <ul>
diff --git a/docs/html/guide/topics/intents/intents-filters.jd b/docs/html/guide/topics/intents/intents-filters.jd
index 3f94553..3ad3c93 100644
--- a/docs/html/guide/topics/intents/intents-filters.jd
+++ b/docs/html/guide/topics/intents/intents-filters.jd
@@ -247,7 +247,7 @@
 </tr><tr>
    <td>{@code CATEGORY_HOME}
    <td>The activity displays the home screen, the first screen the user sees when 
-       the device is turned on or when the HOME key is pressed.
+       the device is turned on or when the <em>Home</em> button is pressed.
 </tr><tr>
    <td>{@code CATEGORY_LAUNCHER}
    <td>The activity can be the initial activity of a task and is listed in 
diff --git a/docs/html/guide/topics/manifest/activity-element.jd b/docs/html/guide/topics/manifest/activity-element.jd
index e23fb0ec..4d9603f 100644
--- a/docs/html/guide/topics/manifest/activity-element.jd
+++ b/docs/html/guide/topics/manifest/activity-element.jd
@@ -59,7 +59,7 @@
 
 <dt>attributes:</dt>
 <dd><dl class="attr">
-<dt><a href name="reparent"></a>{@code android:allowTaskReparenting}</dt>
+<dt><a name="reparent"></a>{@code android:allowTaskReparenting}</dt>
 <dd>Whether or not the activity can move from the task that started it to 
 the task it has an affinity for when that task is next brought to the 
 front &mdash; "{@code true}" if it can move, and "{@code false}" if it 
@@ -133,21 +133,21 @@
 it's ignored for all other activities in the task.
 
 <p>
-When the value is "{@code true}", every time users start the task again, they 
-are brought to its root activity, regardless of what they were last doing in 
-the task and regardless of whether they used BACK or HOME to last leave it.  
-When the value is "{@code false}", the task may be cleared of activities in 
+When the value is "{@code true}", every time users start the task again, they
+are brought to its root activity regardless of what they were last doing in
+the task and regardless of whether they used the <em>Back</em> or <em>Home</em> button to
+leave it. When the value is "{@code false}", the task may be cleared of activities in
 some situations (see the 
 <code><a href="#always">alwaysRetainTaskState</a></code> attribute), but not always.  
 </p>
 
 <p>
 Suppose, for example, that someone launches activity P from the home screen, 
-and from there goes to activity Q.  The user next presses HOME, and then returns 
+and from there goes to activity Q.  The user next presses <em>Home</em>, and then returns 
 to activity P.  Normally, the user would see activity Q, since that is what they 
 were last doing in P's task.  However, if P set this flag to "{@code true}", all 
 of the activities on top of it (Q in this case) were removed when the user pressed 
-HOME and the task went to the background.  So the user sees only P when returning 
+<em>Home</em> and the task went to the background.  So the user sees only P when returning 
 to the task.
 </p>
 
@@ -501,7 +501,7 @@
 
 <p>Regardless of the launch mode that you choose, make sure to test the usability
 of the activity during launch and when navigating back to it from
-other activities and tasks using the BACK key. </p>
+other activities and tasks using the <em>Back</em> button. </p>
 
 <p>For more information on launch modes and their interaction with Intent
 flags, see the 
diff --git a/docs/html/guide/topics/manifest/application-element.jd b/docs/html/guide/topics/manifest/application-element.jd
index 4f1964c..df6f61a 100644
--- a/docs/html/guide/topics/manifest/application-element.jd
+++ b/docs/html/guide/topics/manifest/application-element.jd
@@ -249,7 +249,7 @@
 applications, reducing resource usage.
 </p></dd>
 
-<dt><a href name="restoreany"></a>{@code android:restoreAnyVersion}</dt>
+<dt><a name="restoreany"></a>{@code android:restoreAnyVersion}</dt>
 <dd>Indicate that the application is prepared to attempt a restore of any
 backed-up data set, even if the backup was stored by a newer version
 of the application than is currently installed on the device.  Setting
@@ -260,7 +260,7 @@
 <p>The default value of this attribute is {@code false}.
 </p></dd>
 
-<dt><a href name="aff"></a>{@code android:taskAffinity}</dt>
+<dt><a name="aff"></a>{@code android:taskAffinity}</dt>
 <dd>An affinity name that applies to all activities within the application,
 except for those that set a different affinity with their own
 <code><a href="{@docRoot}guide/topics/manifest/activity-element.html#aff">taskAffinity</a></code> 
diff --git a/docs/html/guide/topics/manifest/uses-sdk-element.jd b/docs/html/guide/topics/manifest/uses-sdk-element.jd
index b371f34..99c91f6 100644
--- a/docs/html/guide/topics/manifest/uses-sdk-element.jd
+++ b/docs/html/guide/topics/manifest/uses-sdk-element.jd
@@ -60,7 +60,7 @@
   attribute, the system assumes a default value of "1", which indicates that your
   application is compatible with all versions of Android. If your application is
   <em>not</em> compatible with all versions (for instance, it uses APIs introduced
-  in API Level 3) and you have not declared the proper <code>android:minSdkVersion</code>,
+  in API Level 3) and you have not declared the proper <code>minSdkVersion</code>,
   then when installed on a system with an API Level less than 3, the application
   will crash during runtime when attempting to access the unavailable APIs. For
   this reason, be certain to declare the appropriate API Level in the
@@ -68,18 +68,32 @@
   </dd>
 
   <dt><a name="target"></a>{@code android:targetSdkVersion}</dt>
-  <dd>An integer designating the API Level that the application is targetting.
+  <dd>An integer designating the API Level that the application targets. If not set, the default
+value equals that given to {@code minSdkVersion}.
 
-  <p>With this attribute set, the application says that it is able to run on
-  older versions (down to {@code minSdkVersion}), but was explicitly tested to
-  work with the version specified here. Specifying this target version allows the
-  platform to disable compatibility settings that are not required for the target
-  version (which may otherwise be turned on in order to maintain
-  forward-compatibility) or enable newer features that are not available to older
-  applications. This does not mean that you can program different features for
-  different versions of the platform&mdash;it simply informs the platform that you
-  have tested against the target version and the platform should not perform any
-  extra work to maintain forward-compatibility with the target version.</p>
+  <p>This attribute informs the system that you have tested against the target version and the
+system should not enable any compatibility behaviors to maintain your app's forward-compatibility
+with the target version. The application is still able to run on older versions (down to {@code
+minSdkVersion}).</p>
+
+  <p>As Android evolves with each new version, some behaviors and even appearances might change.
+However, if the API level of the platform is higher than the version declared by your app's {@code
+targetSdkVersion}, the system may enable compatibility behaviors to ensure that your app
+continues to work the way you expect. You can disable such compatibility
+behaviors by specifying {@code targetSdkVersion} to match the API
+level of the platform on which it's running. For example, setting this value to "11" or higher
+allows the system to apply a new default theme (Holo) to your app when running on Android 3.0 or
+higher and also disables <a href="{@docRoot}guide/practices/screen-compat-mode.html">screen
+compatibility mode</a> when running on larger screens (because support for API level 11 implicitly
+supports larger screens).</p>
+
+  <p>There are many compatibility behaviors that the system may enable based on the value you set
+for this attribute. Several of these behaviors are described by the corresponding platform versions
+in the {@link android.os.Build.VERSION_CODES} reference.</p>
+
+  <p>To maintain your application along with each Android release, you should increase
+the value of this attribute to match the latest API level, then thoroughly test your application on
+the corresponding platform version.</p>
 
   <p>Introduced in: API Level 4</p>
   </dd>
@@ -89,25 +103,25 @@
   designed to run. 
 
   <p>In Android 1.5, 1.6, 2.0, and 2.0.1, the system checks the value of this
-  attribute when installing an application and when revalidating the application
+  attribute when installing an application and when re-validating the application
   after a system update. In either case, if the application's
-  <code>android:maxSdkVersion</code> attribute is lower than the API Level used by
+  <code>maxSdkVersion</code> attribute is lower than the API Level used by
   the system itself, then the system will not allow the application to be
-  installed. In the case of revalidation after system update, this effectively
+  installed. In the case of re-validation after system update, this effectively
   removes your application from the device.
 
   <p>To illustrate how this attribute can affect your application after system
   updates, consider the following example: </p>
 
-  <p>An application declaring <code>android:maxSdkVersion="5"</code> in its
+  <p>An application declaring <code>maxSdkVersion="5"</code> in its
   manifest is published on Android Market. A user whose device is running Android
   1.6 (API Level 4) downloads and installs the app. After a few weeks, the user
   receives an over-the-air system update to Android 2.0 (API Level 5). After the
   update is installed, the system checks the application's
-  <code>android:maxSdkVersion</code> and successfully revalidates it. The
+  <code>maxSdkVersion</code> and successfully re-validates it. The
   application functions as normal. However, some time later, the device receives
   another system update, this time to Android 2.0.1 (API Level 6). After the
-  update, the system can no longer revalidate the application because the system's
+  update, the system can no longer re-validate the application because the system's
   own API Level (6) is now higher than the maximum supported by the application
   (5). The system prevents the application from being visible to the user, in
   effect removing it from the device.</p>
@@ -120,7 +134,7 @@
   provided it uses only standard APIs and follows development best practices.
   Second, note that in some cases, declaring the attribute can <strong>result in
   your application being removed from users' devices after a system
-  update</strong> to a higher API Level. Most devices on which your appplication
+  update</strong> to a higher API Level. Most devices on which your application
   is likely to be installed will receive periodic system updates over the air, so
   you should consider their effect on your application before setting this
   attribute.</p>
@@ -128,8 +142,8 @@
   <p style="margin-bottom:1em;">Introduced in: API Level 4</p>
 
   <div class="special">Future versions of Android (beyond Android 2.0.1) will no
-longer check or enforce the <code>android:maxSdkVersion</code> attribute during
-installation or revalidation. Android Market will continue to use the attribute
+longer check or enforce the <code>maxSdkVersion</code> attribute during
+installation or re-validation. Android Market will continue to use the attribute
 as a filter, however, when presenting users with applications available for
 download. </div>
   </dd>
diff --git a/docs/html/guide/topics/media/mediaplayer.jd b/docs/html/guide/topics/media/mediaplayer.jd
index b3ca7dd..002d113 100644
--- a/docs/html/guide/topics/media/mediaplayer.jd
+++ b/docs/html/guide/topics/media/mediaplayer.jd
@@ -251,7 +251,7 @@
 "background media" even when the user leaves your activity, much in the same
 way that the built-in Music application behaves. In this case, what you need is
 a {@link android.media.MediaPlayer MediaPlayer} controlled by a {@link android.app.Service}, as
-discussed in <a href="mpandservices">Using a Service with MediaPlayer</a>.</p>
+discussed in <a href="#mpandservices">Using a Service with MediaPlayer</a>.</p>
 
 <h2 id="mpandservices">Using a Service with MediaPlayer</h2>
 
diff --git a/docs/html/guide/topics/nfc/nfc.jd b/docs/html/guide/topics/nfc/nfc.jd
index 175bc7cc..83873c3 100644
--- a/docs/html/guide/topics/nfc/nfc.jd
+++ b/docs/html/guide/topics/nfc/nfc.jd
@@ -666,7 +666,7 @@
 potentially handling specific tags that you have deployed. AARs are only supported at the
 application level, because of the package name constraint, and not at the Activity level as with
 intent filtering. If you want to handle an intent at the Activity level, <a
-href="filtering-intents">use intent filters</a>.
+href="#filtering-intents">use intent filters</a>.
 </p>
 
 
@@ -795,8 +795,8 @@
 
 <p>The following sample shows how a simple activity calls {@link
 android.nfc.NfcAdapter.CreateNdefMessageCallback} in the <code>onCreate()</code> method of an
-activity (see <a href="{@docRoot}resources/samples/AndroidBeam/index.html"></a> for the
-complete sample). This example also has methods to help you create a MIME record:</p>
+activity (see <a href="{@docRoot}resources/samples/AndroidBeamDemo/index.html">AndroidBeamDemo</a>
+for the complete sample). This example also has methods to help you create a MIME record:</p>
 
 <pre id="code-example">
 package com.example.android.beam;
diff --git a/docs/html/guide/topics/providers/content-provider-basics.jd b/docs/html/guide/topics/providers/content-provider-basics.jd
new file mode 100644
index 0000000..40b5c3f
--- /dev/null
+++ b/docs/html/guide/topics/providers/content-provider-basics.jd
@@ -0,0 +1,1215 @@
+page.title=Content Provider Basics
+@jd:body
+<div id="qv-wrapper">
+<div id="qv">
+
+
+                    <!-- In this document -->
+<h2>In this document</h2>
+<ol>
+    <li>
+        <a href="#Basics">Overview</a>
+        <ol>
+            <li>
+                <a href="#ClientProvider">Accessing a provider</a>
+            </li>
+            <li>
+                <a href="#ContentURIs">Content URIs</a>
+            </li>
+        </ol>
+    </li>
+    <li>
+        <a href="#SimpleQuery">Retrieving Data from the Provider</a>
+        <ol>
+            <li>
+                <a href="#RequestPermissions">Requesting read access permission</a>
+            </li>
+            <li>
+                <a href="#Query">Constructing the query</a>
+            </li>
+            <li>
+                <a href="#DisplayResults">Displaying query results</a>
+            </li>
+            <li>
+                <a href="#GettingResults">Getting data from query results</a>
+            </li>
+        </ol>
+    </li>
+    <li>
+        <a href="#Permissions">Content Provider Permissions</a>
+    </li>
+    <li>
+        <a href="#Modifications">Inserting, Updating, and Deleting Data</a>
+        <ol>
+            <li>
+                <a href="#Inserting">Inserting data</a>
+            </li>
+            <li>
+                <a href="#Updating">Updating data</a>
+            </li>
+            <li>
+                <a href="#Deleting">Deleting data</a>
+            </li>
+        </ol>
+    </li>
+    <li>
+        <a href="#DataTypes">Provider Data Types</a>
+    </li>
+    <li>
+        <a href="#AltForms">Alternative Forms of Provider Access</a>
+        <ol>
+            <li>
+                <a href="#Batch">Batch access</a>
+            </li>
+            <li>
+                <a href="#Intents">Data access via intents</a>
+            </li>
+        </ol>
+    </li>
+    <li>
+        <a href="#ContractClasses">Contract Classes</a>
+    </li>
+    <li>
+        <a href="#MIMETypeReference">MIME Type Reference</a>
+    </li>
+</ol>
+
+    <!-- Key Classes -->
+<h2>Key classes</h2>
+    <ol>
+        <li>
+            {@link android.content.ContentProvider}
+        </li>
+        <li>
+            {@link android.content.ContentResolver}
+        </li>
+        <li>
+            {@link android.database.Cursor}
+        </li>
+        <li>
+            {@link android.net.Uri}
+        </li>
+    </ol>
+
+    <!-- Related Samples -->
+<h2>Related Samples</h2>
+    <ol>
+        <li>
+        <a
+        href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/List2.html">
+        Cursor (People)</a>
+        </li>
+        <li>
+        <a
+        href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/List7.html">
+        Cursor (Phones)</a>
+        </li>
+    </ol>
+
+    <!-- See also -->
+<h2>See also</h2>
+    <ol>
+        <li>
+            <a href="{@docRoot}guide/topics/providers/content-provider-creating.html">
+            Creating a Content Provider</a>
+        </li>
+        <li>
+            <a href="{@docRoot}guide/topics/providers/calendar-provider.html">
+            Calendar Provider</a>
+        </li>
+    </ol>
+</div>
+</div>
+
+    <!-- Intro paragraphs -->
+<p>
+    A content provider manages access to a central repository of data. The provider and
+    is part of an Android application, which often provides its own UI for working with
+    the data. However, content providers are primarily intended to be used by other
+    applications, which access the provider using a provider client object. Together, providers
+    and provider clients offer a consistent, standard interface to data that also handles
+    inter-process communication and secure data access.
+</p>
+<p>
+    This topic describes the basics of the following:
+</p>
+    <ul>
+        <li>How content providers work.</li>
+        <li>The API you use retrieve data from a content provider.</li>
+        <li>The API you use to insert, update, or delete data in a content provider.</li>
+        <li>Other API features that facilitate working with providers.</li>
+    </ul>
+
+    <!-- Basics -->
+<h2 id="Basics">Overview</h2>
+<p>
+    A content provider presents data to external applications as one or more tables that are
+    similar to the tables found in a relational database. A row represents an instance of some type
+    of data the provider collects, and each row in the column represents an individual piece of
+    data collected for an instance.
+</p>
+<p>
+    For example, one of the built-in providers in the Android platform is the user dictionary, which
+    stores the spellings of non-standard words that the user wants to keep. Table 1 illustrates what
+    the data might look like in this provider's table:
+</p>
+<p class="table-caption">
+    <strong>Table 1:</strong> Sample user dictionary table.
+</p>
+<table id="table1" style="width: 50%;">
+    <tr>
+        <th style="width:20%" align="center" scope="col">word</th>
+        <th style="width:20%" align="center" scope="col">app id</th>
+        <th style="width:20%" align="center" scope="col">frequency</th>
+        <th style="width:20%" align="center" scope="col">locale</th>
+        <th style="width:20%" align="center" scope="col">_ID</th>
+    </tr>
+    <tr>
+        <td align="center" scope="row">mapreduce</td>
+        <td align="center">user1</td>
+        <td align="center">100</td>
+        <td align="center">en_US</td>
+        <td align="center">1</td>
+    </tr>
+    <tr>
+        <td align="center" scope="row">precompiler</td>
+        <td align="center">user14</td>
+        <td align="center">200</td>
+        <td align="center">fr_FR</td>
+        <td align="center">2</td>
+    </tr>
+    <tr>
+        <td align="center" scope="row">applet</td>
+        <td align="center">user2</td>
+        <td align="center">225</td>
+        <td align="center">fr_CA</td>
+        <td align="center">3</td>
+    </tr>
+    <tr>
+        <td align="center" scope="row">const</td>
+        <td align="center">user1</td>
+        <td align="center">255</td>
+        <td align="center">pt_BR</td>
+        <td align="center">4</td>
+    </tr>
+    <tr>
+        <td align="center" scope="row">int</td>
+        <td align="center">user5</td>
+        <td align="center">100</td>
+        <td align="center">en_UK</td>
+        <td align="center">5</td>
+    </tr>
+</table>
+<p>
+    In table 1, each row represents an instance of a word that might not be
+    found in a standard dictionary. Each column represents some data for that word, such as the
+    locale in which it was first encountered. The column headers are column names that are stored in
+    the provider. To refer to a row's locale, you refer to its <code>locale</code> column. For
+    this provider, the <code>_ID</code> column serves as a "primary key" column that
+    the provider automatically maintains.
+</p>
+<p class="note">
+    <strong>Note:</strong> A provider isn't required to have a primary key, and it isn't required
+    to use <code>_ID</code> as the column name of a primary key if one is present. However,
+    if you want to bind data from a provider to a {@link android.widget.ListView}, one of the
+    column names has to be <code>_ID</code>. This requirement is explained in more detail in the
+    section <a href="#DisplayResults">Displaying query results</a>.
+</p>
+<h3 id="ClientProvider">Accessing a provider</h3>
+<p>
+    An application accesses the data from a content provider with
+    a {@link android.content.ContentResolver} client object. This object has methods that call
+    identically-named methods in the provider object, an instance of one of the concrete
+    subclasses of {@link android.content.ContentProvider}. The
+    {@link android.content.ContentResolver} methods provide the basic
+    "CRUD" (create, retrieve, update, and delete) functions of persistent storage.
+</p>
+<p>
+    The {@link android.content.ContentResolver} object in the client application's
+    process and the {@link android.content.ContentProvider} object in the application that owns
+    the provider automatically handle inter-process communication.
+    {@link android.content.ContentProvider} also acts as an abstraction layer between its
+    repository of data and the external appearance of data as tables.
+</p>
+<p class="note">
+    <strong>Note:</strong> To access a provider, your application usually has to request specific
+    permissions in its manifest file. This is described in more detail in the section
+    <a href="#Permissions">Content Provider Permissions</a>
+</p>
+<p>
+    For example, to get a list of the words and their locales from the User Dictionary Provider,
+    you call {@link android.content.ContentResolver#query(Uri, String[], String, String[], String)
+    ContentResolver.query()}.
+    The {@link android.content.ContentResolver#query(Uri, String[], String, String[], String)
+    query()} method calls the
+    {@link android.content.ContentProvider#query(Uri, String[], String, String[], String)
+    ContentProvider.query()} method defined by the User Dictionary Provider. The following lines
+    of code show a
+    {@link android.content.ContentResolver#query(Uri, String[], String, String[], String)
+    ContentResolver.query()} call:
+<p>
+<pre>
+// Queries the user dictionary and returns results
+mCursor = getContentResolver().query(
+    UserDictionary.Words.CONTENT_URI,   // The content URI of the words table
+    mProjection,                        // The columns to return for each row
+    mSelectionClause                    // Selection criteria
+    mSelectionArgs,                     // Selection criteria
+    mSortOrder);                        // The sort order for the returned rows
+</pre>
+<p>
+    Table 2 shows how the arguments to
+    {@link android.content.ContentResolver#query(Uri, String[], String, String[], String)
+    query(Uri,projection,selection,selectionArgs,sortOrder)} match an SQL SELECT statement:
+</p>
+<p class="table-caption">
+    <strong>Table 2:</strong> Query() compared to SQL query.
+</p>
+<table id="table2" style="width: 75%;">
+    <tr>
+        <th style="width:25%" align="center" scope="col">query() argument</th>
+        <th style="width:25%" align="center" scope="col">SELECT keyword/parameter</th>
+        <th style="width:50%" align="center" scope="col">Notes</th>
+    </tr>
+    <tr>
+        <td align="center"><code>Uri</code></td>
+        <td align="center"><code>FROM <em>table_name</em></code></td>
+        <td><code>Uri</code> maps to the table in the provider named <em>table_name</em>.</td>
+    </tr>
+    <tr>
+        <td align="center"><code>projection</code></td>
+        <td align="center"><code><em>col,col,col,...</em></code></td>
+        <td>
+            <code>projection</code> is an array of columns that should be included for each row
+            retrieved.
+        </td>
+    </tr>
+    <tr>
+        <td align="center"><code>selection</code></td>
+        <td align="center"><code>WHERE <em>col</em> = <em>value</em></code></td>
+        <td><code>selection</code> specifies the criteria for selecting rows.</td>
+    </tr>
+    <tr>
+        <td align="center"><code>selectionArgs</code></td>
+        <td align="center">
+            (No exact equivalent. Selection arguments replace <code>?</code> placeholders in the
+            selection clause.)
+        </td>
+    </tr>
+    <tr>
+        <td align="center"><code>sortOrder</code></td>
+        <td align="center"><code>ORDER BY <em>col,col,...</em></code></td>
+        <td>
+            <code>sortOrder</code> specifies the order in which rows appear in the returned
+            {@link android.database.Cursor}.
+        </td>
+    </tr>
+</table>
+<h3 id="ContentURIs">Content URIs</h3>
+<p>
+    A <strong>content URI</strong> is a URI that identifies data in a provider. Content URIs
+    include the symbolic name of the entire provider (its <strong>authority</strong>) and a
+    name that points to a table (a <strong>path</strong>). When you call
+    a client method to access a table in a provider, the content URI for the table is one of
+    the arguments.
+</p>
+<p>
+    In the preceding lines of code, the constant
+    {@link android.provider.UserDictionary.Words#CONTENT_URI} contains the content URI of
+    the user dictionary's "words" table. The {@link android.content.ContentResolver}
+    object parses out the URI's authority, and uses it to "resolve" the provider by
+    comparing the authority to a system table of known providers. The
+    {@link android.content.ContentResolver} can then dispatch the query arguments to the correct
+    provider.
+</p>
+<p>
+    The {@link android.content.ContentProvider} uses the path part of the content URI to choose the
+    table to access. A provider usually has a <strong>path</strong> for each table it exposes.
+</p>
+<p>
+    In the previous lines of code, the full URI for the "words" table is:
+</p>
+<pre>
+content://user_dictionary/words
+</pre>
+<p>
+    where the <code>user_dictionary</code> string is the provider's authority, and
+    <code>words</code> string is the table's path. The string
+    <code>content://</code> (the <strong>scheme</strong>) is always present,
+    and identifies this as a content URI.
+</p>
+<p>
+    Many providers allow you to access a single row in a table by appending an ID value
+    to the end of the URI. For example, to retrieve a row whose <code>_ID</code> is
+    <code>4</code> from user dictionary, you can use this content URI:
+</p>
+<pre>
+Uri singleUri = ContentUri.withAppendedId(UserDictionary.Words.CONTENT_URI,4);
+</pre>
+<p>
+    You often use id values when you've retrieved a set of rows and then want to update or delete
+    one of them.
+</p>
+<p class="note">
+    <strong>Note:</strong> The {@link android.net.Uri} and {@link android.net.Uri.Builder} classes
+    contain convenience methods for constructing well-formed Uri objects from strings. The
+    {@link android.content.ContentUris} contains convenience methods for appending id values to
+    a URI. The previous snippet uses {@link android.content.ContentUris#withAppendedId(Uri, long)
+    withAppendedId()} to append an id to the UserDictionary content URI.
+</p>
+
+
+    <!-- Retrieving Data from the Provider -->
+<h2 id="SimpleQuery">Retrieving Data from the Provider</h2>
+<p>
+    This section describes how to retrieve data from a provider, using the User Dictionary Provider
+    as an example.
+</p>
+<p class="note">
+    For the sake of clarity, the code snippets in this section call
+    {@link android.content.ContentResolver#query(Uri, String[], String, String[], String)
+    ContentResolver.query()} on the "UI thread"". In actual code, however, you should
+    do queries asynchronously on a separate thread. One way to do this is to use the
+    {@link android.content.CursorLoader} class, which is described
+    in more detail in the <a href="{@docRoot}guide/topics/fundamentals/loaders.html">
+    Loaders</a> guide. Also, the lines of code are snippets only; they don't show a complete
+    application.
+</p>
+<p>
+    To retrieve data from a provider, follow these basic steps:
+</p>
+<ol>
+   <li>
+        Request the read access permission for the provider.
+   </li>
+   <li>
+        Define the code that sends a query to the provider.
+   </li>
+</ol>
+<h3 id="RequestPermissions">Requesting read access permission</h3>
+<p>
+    To retrieve data from a provider, your application needs "read access permission" for the
+    provider. You can't request this permission at run-time; instead, you have to specify that
+    you need this permission in your manifest, using the
+    <code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">
+    &lt;uses-permission&gt;</a></code> element and the exact permission name defined by the
+    provider. When you specify this element in your manifest, you are in effect "requesting" this
+    permission for your application. When users install your application, they implicitly grant
+    this request.
+</p>
+<p>
+    To find the exact name of the read access permission for the provider you're using, as well
+    as the names for other access permissions used by the provider, look in the provider's
+    documentation.
+</p>
+<p>
+    The role of permissions in accessing providers is described in more detail in the section
+    <a href="#Permissions">Content Provider Permissions</a>.
+</p>
+<p>
+    The User Dictionary Provider defines the permission
+    <code>android.permission.READ_USER_DICTIONARY</code> in its manifest file, so an
+    application that wants to read from the provider must request this permission.
+</p>
+<!-- Constructing the query -->
+<h3 id="Query">Constructing the query</h3>
+<p>
+    The next step in retrieving data a provider is to construct a query. This first snippet
+    defines some variables for accessing the User Dictionary Provider:
+</p>
+<pre class="prettyprint">
+
+// A "projection" defines the columns that will be returned for each row
+String[] mProjection =
+{
+    UserDictionary.Words._ID,    // Contract class constant for the _ID column name
+    UserDictionary.Words.WORD,   // Contract class constant for the word column name
+    UserDictionary.Words.LOCALE  // Contract class constant for the locale column name
+};
+
+// Defines a string to contain the selection clause
+String mSelectionClause = null;
+
+// Initializes an array to contain selection arguments
+String[] mSelectionArgs = {""};
+
+</pre>
+<p>
+    The next snippet shows how to use
+    {@link android.content.ContentResolver#query(Uri, String[], String, String[], String)
+    ContentResolver.query()}, using the User Dictionary Provider as an example.
+    A provider client query is similar to an SQL query, and it contains a set of columns to return,
+    a set of selection criteria, and a sort order.
+</p>
+<p>
+    The set of columns that the query should return is called a <strong>projection</strong>
+    (the variable <code>mProjection</code>).
+</p>
+<p>
+    The expression that specifies the rows to retrieve is split into a selection clause and
+    selection arguments. The selection clause is a combination of logical and Boolean expressions,
+    column names, and values (the variable <code>mSelection</code>). If you specify the replaceable
+    parameter <code>?</code> instead of a value, the query method retrieves the value from the
+    selection arguments array (the variable <code>mSelectionArgs</code>).
+</p>
+<p>
+    In the next snippet, if the user doesn't enter a word, the selection clause is set to
+    <code>null</code>, and the query returns all the words in the provider. If the user enters
+    a word, the selection clause is set to <code>UserDictionary.Words.Word + " = ?"</code> and
+    the first element of selection arguments array is set to the word the user enters.
+</p>
+<pre class="prettyprint">
+/*
+ * This defines a one-element String array to contain the selection argument.
+ */
+String[] mSelectionArgs = {""};
+
+// Gets a word from the UI
+mSearchString = mSearchWord.getText().toString();
+
+// Remember to insert code here to check for invalid or malicious input.
+
+// If the word is the empty string, gets everything
+if (TextUtils.isEmpty(mSearchString)) {
+    // Setting the selection clause to null will return all words
+    mSelectionClause = null;
+    mSelectionArgs[0] = "";
+
+} else {
+    // Constructs a selection clause that matches the word that the user entered.
+    mSelectionClause = " = ?";
+
+    // Moves the user's input string to the selection arguments.
+    mSelectionArgs[0] = mSearchString;
+
+}
+
+// Does a query against the table and returns a Cursor object
+mCursor = getContentResolver().query(
+    UserDictionary.Words.CONTENT_URI,  // The content URI of the words table
+    mProjection,                       // The columns to return for each row
+    mSelectionClause                   // Either null, or the word the user entered
+    mSelectionArgs,                    // Either empty, or the string the user entered
+    mSortOrder);                       // The sort order for the returned rows
+
+// Some providers return null if an error occurs, others throw an exception
+if (null == mCursor) {
+    /*
+     * Insert code here to handle the error. Be sure not to use the cursor! You may want to
+     * call android.util.Log.e() to log this error.
+     *
+     */
+// If the Cursor is empty, the provider found no matches
+} else if (mCursor.getCount() &lt; 1) {
+
+    /*
+     * Insert code here to notify the user that the search was unsuccessful. This isn't necessarily
+     * an error. You may want to offer the user the option to insert a new row, or re-type the
+     * search term.
+     */
+
+} else {
+    // Insert code here to do something with the results
+
+}
+</pre>
+<p>
+    This query is analogous to the SQL statement:
+</p>
+<pre>
+SELECT _ID, word, frequency, locale FROM words WHERE word = &lt;userinput&gt; ORDER BY word ASC;
+</pre>
+<p>
+    In this SQL statement, the actual column names are used instead of contract class constants.
+</p>
+<h4 id="Injection">Protecting against malicious input</h4>
+<p>
+    If the data managed by the content provider is in an SQL database, including external untrusted
+    data into raw SQL statements can lead to SQL injection.
+</p>
+<p>
+    Consider this selection clause:
+</p>
+<pre>
+// Constructs a selection clause by concatenating the user's input to the column name
+String mSelectionClause =  "var = " + mUserInput;
+</pre>
+<p>
+    If you do this, you're allowing the user to concatenate malicious SQL onto your SQL statement.
+    For example, the user could enter "nothing; DROP TABLE *;"  for <code>mUserInput</code>, which
+    would result in the selection clause <code>var = nothing; DROP TABLE *;</code>. Since the
+    selection clause is treated as an SQL statement, this might cause the provider to erase all of
+    the tables in the underlying SQLite database (unless the provider is set up to catch
+    <a href="http://en.wikipedia.org/wiki/SQL_injection">SQL injection</a> attempts).
+</p>
+<p>
+    To avoid this problem, use a selection clause that uses <code>?</code> as a replaceable
+    parameter and a separate array of selection arguments. When you do this, the user input
+    is bound directly to the query rather than being interpreted as part of an SQL statement.
+    Because it's not treated as SQL, the user input can't inject malicious SQL. Instead of using
+    concatenation to include the user input, use this selection clause:
+</p>
+<pre>
+// Constructs a selection clause with a replaceable parameter
+String mSelectionClause =  "var = ?";
+</pre>
+<p>
+    Set up the array of selection arguments like this:
+</p>
+<pre>
+// Defines an array to contain the selection arguments
+String[] selectionArgs = {""};
+</pre>
+<p>
+    Put a value in the selection arguments array like this:
+</p>
+<pre>
+// Sets the selection argument to the user's input
+selectionArgs[0] = mUserInput;
+</pre>
+<p>
+    A selection clause that uses <code>?</code> as a replaceable parameter and an array of
+    selection arguments array are preferred way to specify a selection, even the provider isn't
+    based on an SQL database.
+</p>
+<!-- Displaying the results -->
+<h3 id="DisplayResults">Displaying query results</h3>
+<p>
+    The {@link android.content.ContentResolver#query(Uri, String[], String, String[], String)
+    ContentResolver.query()} client method always returns a {@link android.database.Cursor}
+    containing the columns specified by the query's projection for the rows that match the query's
+    selection criteria. A {@link android.database.Cursor} object provides random read access to the
+    rows and columns it contains. Using {@link android.database.Cursor} methods,
+    you can iterate over the rows in the results, determine the data type of each column, get the
+    data out of a column, and examine other properties of the results. Some
+    {@link android.database.Cursor} implementations automatically update the object when the
+    provider's data changes, or trigger methods in an observer object when the
+    {@link android.database.Cursor} changes, or both.
+</p>
+<p class="note">
+    <strong>Note:</strong> A provider may restrict access to columns based on the nature of the
+    object making the query. For example, the Contacts Provider restricts access for some columns to
+    sync adapters, so it won't return them to an activity or service.
+</p>
+<p>
+    If no rows match the selection criteria, the provider
+    returns a {@link android.database.Cursor} object for which
+    {@link android.database.Cursor#getCount() Cursor.getCount()} is 0 (an empty cursor).
+</p>
+<p>
+    If an internal error occurs, the results of the query depend on the particular provider. It may
+    choose to return <code>null</code>, or it may throw an {@link java.lang.Exception}.
+</p>
+<p>
+    Since a {@link android.database.Cursor} is a "list" of rows, a good way to display the
+    contents of a {@link android.database.Cursor} is to link it to a {@link android.widget.ListView}
+    via a {@link android.widget.SimpleCursorAdapter}.
+</p>
+<p>
+    The following snippet continues the code from the previous snippet. It creates a
+    {@link android.widget.SimpleCursorAdapter} object containing the {@link android.database.Cursor}
+    retrieved by the query, and sets this object to be the adapter for a
+    {@link android.widget.ListView}:
+</p>
+<pre class="prettyprint">
+// Defines a list of columns to retrieve from the Cursor and load into an output row
+String[] mWordListColumns =
+{
+    UserDictionary.Words.WORD,   // Contract class constant containing the word column name
+    UserDictionary.Words.LOCALE  // Contract class constant containing the locale column name
+};
+
+// Defines a list of View IDs that will receive the Cursor columns for each row
+int[] mWordListItems = { R.id.dictWord, R.id.locale};
+
+// Creates a new SimpleCursorAdapter
+mCursorAdapter = new SimpleCursorAdapter(
+    getApplicationContext(),               // The application's Context object
+    R.layout.wordlistrow,                  // A layout in XML for one row in the ListView
+    mCursor,                               // The result from the query
+    mWordListColumns,                      // A string array of column names in the cursor
+    mWordListItems,                        // An integer array of view IDs in the row layout
+    0);                                    // Flags (usually none are needed)
+
+// Sets the adapter for the ListView
+mWordList.setAdapter(mCursorAdapter);
+</pre>
+<p class="note">
+    <strong>Note:</strong> To back a {@link android.widget.ListView} with a
+    {@link android.database.Cursor}, the cursor must contain a column named <code>_ID</code>.
+    Because of this, the query shown previously retrieves the <code>_ID</code> column for the
+    "words" table, even though the {@link android.widget.ListView} doesn't display it.
+    This restriction also explains why most providers have a <code>_ID</code> column for each of
+    their tables.
+</p>
+
+        <!-- Getting data from query results -->
+<h3 id="GettingResults">Getting data from query results</h3>
+<p>
+    Rather than simply displaying query results, you can use them for other tasks. For
+    example, you can retrieve spellings from the user dictionary and then look them up in
+    other providers. To do this, you iterate over the rows in the {@link android.database.Cursor}:
+</p>
+<pre class="prettyprint">
+
+// Determine the column index of the column named "word"
+int index = mCursor.getColumnIndex(UserDictionary.Words.WORD);
+
+/*
+ * Only executes if the cursor is valid. The User Dictionary Provider returns null if
+ * an internal error occurs. Other providers may throw an Exception instead of returning null.
+ */
+
+if (mCursor != null) {
+    /*
+     * Moves to the next row in the cursor. Before the first movement in the cursor, the
+     * "row pointer" is -1, and if you try to retrieve data at that position you will get an
+     * exception.
+     */
+    while (mCursor.moveToNext()) {
+
+        // Gets the value from the column.
+        newWord = mCursor.getString(index);
+
+        // Insert code here to process the retrieved word.
+
+        ...
+
+        // end of while loop
+    }
+} else {
+
+    // Insert code here to report an error if the cursor is null or the provider threw an exception.
+}
+</pre>
+<p>
+    {@link android.database.Cursor} implementations contain several "get" methods for
+    retrieving different types of data from the object. For example, the previous snippet
+    uses {@link android.database.Cursor#getString(int) getString()}. They also have a
+    {@link android.database.Cursor#getType(int) getType()} method that returns a value indicating
+    the data type of the column.
+</p>
+
+
+    <!-- Requesting permissions -->
+<h2 id="Permissions">Content Provider Permissions</h2>
+<p>
+    A provider's application can specify permissions that other applications must have in order to
+    access the provider's data. These permissions ensure that the user knows what data
+    an application will try to access. Based on the provider's requirements, other applications
+    request the permissions they need in order to access the provider. End users see the requested
+    permissions when they install the application.
+</p>
+<p>
+    If a provider's application doesn't specify any permissions, then other applications have no
+    access to the provider's data. However, components in the provider's application always have
+    full read and write access, regardless of the specified permissions.
+</p>
+<p>
+    As noted previously, the User Dictionary Provider requires the
+    <code>android.permission.READ_USER_DICTIONARY</code> permission to retrieve data from it.
+    The provider has the separate <code>android.permission.WRITE_USER_DICTIONARY</code>
+    permission for inserting, updating, or deleting data.
+</p>
+<p>
+    To get the permissions needed to access a provider, an application requests them with a
+    <code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">
+    &lt;uses-permission&gt;</a></code> element in its manifest file.
+    When the Android Package Manager installs the application, a user must approve all of the
+    permissions the application requests. If the user approves all of them, Package Manager
+    continues the installation; if the user doesn't approve them, Package Manager
+    aborts the installation.
+</p>
+<p>
+    The following
+    <code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">
+    &lt;uses-permission&gt;</a></code> element requests read access to the User Dictionary Provider:
+</p>
+<pre>
+    &lt;uses-permission android:name="android.permission.READ_USER_DICTIONARY"&gt;
+</pre>
+<p>
+    The impact of permissions on provider access is explained in more detail in the
+    <a href="{@docRoot}guide/topics/security/security.html">Security and Permissions</a> guide.
+</p>
+
+
+<!-- Inserting, Updating, and Deleting Data -->
+<h2 id="Modifications">Inserting, Updating, and Deleting Data</h2>
+<p>
+    In the same way that you retrieve data from a provider, you also use the interaction between
+    a provider client and the provider's {@link android.content.ContentProvider} to modify data.
+    You call a method of {@link android.content.ContentResolver} with arguments that are passed to
+    the corresponding method of {@link android.content.ContentProvider}. The provider and provider
+    client automatically handle security and inter-process communication.
+</p>
+<h3 id="Inserting">Inserting data</h3>
+<p>
+    To insert data into a provider, you call the
+    {@link android.content.ContentResolver#insert(Uri,ContentValues) ContentResolver.insert()}
+    method. This method inserts a new row into the provider and returns a content URI for that row.
+    This snippet shows how to insert a new word into the User Dictionary Provider:
+</p>
+<pre class="prettyprint">
+// Defines a new Uri object that receives the result of the insertion
+Uri mNewUri;
+
+...
+
+// Defines an object to contain the new values to insert
+ContentValues mNewValues = new ContentValues();
+
+/*
+ * Sets the values of each column and inserts the word. The arguments to the "put"
+ * method are "column name" and "value"
+ */
+mNewValues.put(UserDictionary.Words.APP_ID, "example.user");
+mNewValues.put(UserDictionary.Words.LOCALE, "en_US");
+mNewValues.put(UserDictionary.Words.WORD, "insert");
+mNewValues.put(UserDictionary.Words.FREQUENCY, "100");
+
+mNewUri = getContentResolver().insert(
+    UserDictionary.Word.CONTENT_URI,   // the user dictionary content URI
+    mNewValues                          // the values to insert
+);
+</pre>
+<p>
+    The data for the new row goes into a single {@link android.content.ContentValues} object, which
+    is similar in form to a one-row cursor. The columns in this object don't need to have the
+    same data type, and if you don't want to specify a value at all, you can set a column
+    to <code>null</code> using {@link android.content.ContentValues#putNull(String)
+    ContentValues.putNull()}.
+</p>
+<p>
+    The snippet doesn't add the <code>_ID</code> column, because this column is maintained
+    automatically. The provider assigns a unique value of <code>_ID</code> to every row that is
+    added. Providers usually use this value as the table's primary key.
+</p>
+<p>
+    The content URI returned in <code>newUri</code> identifies the newly-added row, with
+    the following format:
+</p>
+<pre>
+content://user_dictionary/words/&lt;id_value&gt;
+</pre>
+<p>
+    The <code>&lt;id_value&gt;</code> is the contents of <code>_ID</code> for the new row.
+    Most providers can detect this form of content URI automatically and then perform the requested
+    operation on that particular row.
+</p>
+<p>
+    To get the value of <code>_ID</code> from the returned {@link android.net.Uri}, call
+    {@link android.content.ContentUris#parseId(Uri) ContentUris.parseId()}.
+</p>
+<h3 id="Updating">Updating data</h3>
+<p>
+    To update a row, you use a {@link android.content.ContentValues} object with the updated
+    values just as you do with an insertion, and selection criteria just as you do with a query.
+    The client method you use is
+    {@link android.content.ContentResolver#update(Uri, ContentValues, String, String[])
+    ContentResolver.update()}. You only need to add values to the
+    {@link android.content.ContentValues} object for columns you're updating. If you want to clear
+    the contents of a column, set the value to <code>null</code>.
+</p>
+<p>
+    The following snippet changes all the rows whose locale has the language "en" to a
+    have a locale of <code>null</code>. The return value is the number of rows that were updated:
+</p>
+<pre>
+// Defines an object to contain the updated values
+ContentValues mUpdateValues = new ContentValues();
+
+// Defines selection criteria for the rows you want to update
+String mSelectionClause = UserDictionary.Words.LOCALE +  "LIKE ?";
+String[] mSelectionArgs = {"en_%"};
+
+// Defines a variable to contain the number of updated rows
+int mRowsUpdated = 0;
+
+...
+
+/*
+ * Sets the updated value and updates the selected words.
+ */
+mUpdateValues.putNull(UserDictionary.Words.LOCALE);
+
+mRowsUpdated = getContentResolver().update(
+    UserDictionary.Words.CONTENT_URI,   // the user dictionary content URI
+    mUpdateValues                       // the columns to update
+    mSelectionClause                    // the column to select on
+    mSelectionArgs                      // the value to compare to
+);
+</pre>
+<p>
+    You should also sanitize user input when you call
+    {@link android.content.ContentResolver#update(Uri, ContentValues, String, String[])
+    ContentResolver.update()}. To learn more about this, read the section
+    <a href="#Injection">Protecting against malicious input</a>.
+</p>
+<h3 id="Deleting">Deleting data</h3>
+<p>
+    Deleting rows is similar to retrieving row data: you specify selection criteria for the rows
+    you want to delete and the client method returns the number of deleted rows.
+    The following snippet deletes rows whose appid matches "user". The method returns the
+    number of deleted rows.
+</p>
+<pre>
+
+// Defines selection criteria for the rows you want to delete
+String mSelectionClause = UserDictionary.Words.APP_ID + " LIKE ?";
+String[] mSelectionArgs = {"user"};
+
+// Defines a variable to contain the number of rows deleted
+int mRowsDeleted = 0;
+
+...
+
+// Deletes the words that match the selection criteria
+mRowsDeleted = getContentResolver().delete(
+    UserDictionary.Words.CONTENT_URI,   // the user dictionary content URI
+    mSelectionClause                    // the column to select on
+    mSelectionArgs                      // the value to compare to
+);
+</pre>
+<p>
+    You should also sanitize user input when you call
+    {@link android.content.ContentResolver#delete(Uri, String, String[])
+    ContentResolver.delete()}. To learn more about this, read the section
+    <a href="#Injection">Protecting against malicious input</a>.
+</p>
+<!-- Provider Data Types -->
+<h2 id="DataTypes">Provider Data Types</h2>
+<p>
+    Content providers can offer many different data types. The User Dictionary Provider offers only
+    text, but providers can also offer the following formats:
+</p>
+    <ul>
+        <li>
+            integer
+        </li>
+        <li>
+            long integer (long)
+        </li>
+        <li>
+            floating point
+        </li>
+        <li>
+            long floating point (double)
+        </li>
+    </ul>
+<p>
+    Another data type that providers often use is Binary Large OBject (BLOB) implemented as a
+    64KB byte array. You can see the available data types by looking at the
+    {@link android.database.Cursor} class "get" methods.
+</p>
+<p>
+    The data type for each column in a provider is usually listed in its documentation.
+    The data types for the User Dictionary Provider are listed in the reference documentation
+    for its contract class {@link android.provider.UserDictionary.Words} (contract classes are
+    described in the section <a href="#ContractClasses">Contract Classes</a>).
+    You can also determine the data type by calling {@link android.database.Cursor#getType(int)
+    Cursor.getType()}.
+</p>
+<p>
+    Providers also maintain MIME data type information for each content URI they define. You can
+    use the MIME type information to find out if your application can handle data that the
+    provider offers, or to choose a type of handling based on the MIME type. You usually need the
+    MIME type when you are working with a provider that contains complex
+    data structures or files. For example, the {@link android.provider.ContactsContract.Data}
+    table in the Contacts Provider uses MIME types to label the type of contact data stored in each
+    row. To get the MIME type corresponding to a content URI, call
+    {@link android.content.ContentResolver#getType(Uri) ContentResolver.getType()}.
+</p>
+<p>
+    The section <a href="#MIMETypeReference">MIME Type Reference</a> describes the
+    syntax of both standard and custom MIME types.
+</p>
+
+
+<!-- Alternative Forms of Provider Access -->
+<h2 id="AltForms">Alternative Forms of Provider Access</h2>
+<p>
+    Three alternative forms of provider access are important in application development:
+</p>
+<ul>
+    <li>
+        <a href="#Batch">Batch access</a>: You can create a batch of access calls with methods in
+        the {@link android.content.ContentProviderOperation} class, and then apply them with
+        {@link android.content.ContentResolver#applyBatch(String, ArrayList)
+        ContentResolver.applyBatch()}.
+    </li>
+    <li>
+        Asynchronous queries: You should do queries in a separate thread. One way to do this is to
+        use a {@link android.content.CursorLoader} object. The examples in the
+        <a href="{@docRoot}guide/topics/fundamentals/loaders.html">Loaders</a> guide demonstrate
+        how to do this.
+    </li>
+    <li>
+        <a href="#Intents">Data access via intents</a>: Although you can't send an intent
+        directly to a provider, you can send an intent to the provider's application, which is
+        usually the best-equipped to modify the provider's data.
+    </li>
+</ul>
+<p>
+    Batch access and modification via intents are described in the following sections.
+</p>
+<h3 id="Batch">Batch access</h3>
+<p>
+    Batch access to a provider is useful for inserting a large number of rows, or for inserting
+    rows in multiple tables in the same method call, or in general for performing a set of
+    operations across process boundaries as a transaction (an atomic operation).
+</p>
+<p>
+    To access a provider in "batch mode",
+    you create an array of {@link android.content.ContentProviderOperation} objects and then
+    dispatch them to a content provider with
+    {@link android.content.ContentResolver#applyBatch(String, ArrayList)
+    ContentResolver.applyBatch()}. You pass the content provider's <em>authority</em> to this
+    method, rather than a particular content URI, which allows each
+    {@link android.content.ContentProviderOperation} object in the array to work against a
+    different table. A call to {@link android.content.ContentResolver#applyBatch(String, ArrayList)
+    ContentResolver.applyBatch()} returns an array of results.
+</p>
+<p>
+    The description of the {@link android.provider.ContactsContract.RawContacts} contract class
+    includes a code snippet that demonstrates batch insertion. The
+    <a href="{@docRoot}resources/samples/ContactManager/index.html">Contact Manager</a>
+    sample application contains an example of batch access in its <code>ContactAdder.java</code>
+    source file.
+</p>
+<div class="sidebox-wrapper">
+<div class="sidebox">
+<h2>Displaying data using a helper app</h2>
+<p>
+    If your application <em>does</em> have access permissions, you still may want to use an
+    intent to display data in another application. For example, the Calendar application accepts an
+    {@link android.content.Intent#ACTION_VIEW} intent, which displays a particular date or event.
+    This allows you to display calendar information without having to create your own UI.
+    To learn more about this feature, see the
+    <a href="{@docRoot}guide/topics/providers/calendar-provider.html">Calendar Provider</a> guide.
+</p>
+<p>
+    The application to which you send the intent doesn't have to be the application
+    associated with the provider. For example, you can retrieve a contact from the
+    Contact Provider, then send an {@link android.content.Intent#ACTION_VIEW} intent
+    containing the content URI for the contact's image to an image viewer.
+</p>
+</div>
+</div>
+<h3 id="Intents">Data access via intents</h3>
+<p>
+    Intents can provide indirect access to a content provider. You allow the user to access
+    data in a provider even if your application doesn't have access permissions, either by
+    getting a result intent back from an application that has permissions, or by activating an
+    application that has permissions and letting the user do work in it.
+</p>
+<h4>Getting access with temporary permissions</h4>
+<p>
+    You can access data in a content provider, even if you don't have the proper access
+    permissions, by sending an intent to an application that does have the permissions and
+    receiving back a result intent containing "URI" permissions.
+    These are permissions for a specific content URI that last until the activity that receives
+    them is finished. The application that has permanent permissions grants temporary
+    permissions by setting a flag in the result intent:
+</p>
+<ul>
+    <li>
+        <strong>Read permission:</strong>
+        {@link android.content.Intent#FLAG_GRANT_READ_URI_PERMISSION}
+    </li>
+    <li>
+        <strong>Write permission:</strong>
+        {@link android.content.Intent#FLAG_GRANT_WRITE_URI_PERMISSION}
+    </li>
+</ul>
+<p class="note">
+    <strong>Note:</strong> These flags don't give general read or write access to the provider
+    whose authority is contained in the content URI. The access is only for the URI itself.
+</p>
+<p>
+    A provider defines URI permissions for content URIs in its manifest, using the
+    <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#gprmsn">
+    android:grantUriPermission</a></code>
+    attribute of the
+    {@code <a href="guide/topics/manifest/provider-element.html">&lt;provider&gt;</a>}
+    element, as well as the
+    {@code <a href="guide/topics/manifest/grant-uri-permission-element.html">
+    &lt;grant-uri-permission&gt;</a>} child element of the
+    {@code <a href="guide/topics/manifest/provider-element.html">&lt;provider&gt;</a>}
+    element. The URI permissions mechanism is explained in more detail in the
+    <a href="{@docRoot}guide/topics/security/security.html">Security and Permissions</a> guide,
+    in the section "URI Permissions".
+</p>
+<p>
+    For example, you can retrieve data for a contact in the Contacts Provider, even if you don't
+    have the {@link android.Manifest.permission#READ_CONTACTS} permission. You might want to do
+    this in an application that sends e-greetings to a contact on his or her birthday. Instead of
+    requesting {@link android.Manifest.permission#READ_CONTACTS}, which gives you access to all of
+    the user's contacts and all of their information, you prefer to let the user control which
+    contacts are used by your application. To do this, you use the following process:
+</p>
+<ol>
+    <li>
+        Your application sends an intent containing the action
+        {@link android.content.Intent#ACTION_PICK} and the "contacts" MIME type
+        {@link android.provider.ContactsContract.RawContacts#CONTENT_ITEM_TYPE}, using the
+        method {@link android.app.Activity#startActivityForResult(Intent, int)
+        startActivityForResult()}.
+    </li>
+    <li>
+        Because this intent matches the intent filter for the
+        People app's "selection" activity, the activity will come to the foreground.
+    </li>
+    <li>
+        In the selection activity, the user selects a
+        contact to update. When this happens, the selection activity calls
+        {@link android.app.Activity#setResult(int, Intent) setResult(resultcode, intent)}
+        to set up a intent to give back to your application. The intent contains the content URI
+        of the contact the user selected, and the "extras" flags
+        {@link android.content.Intent#FLAG_GRANT_READ_URI_PERMISSION}. These flags grant URI
+        permission to your app to read data for the contact pointed to by the
+        content URI. The selection activity then calls {@link android.app.Activity#finish()} to
+        return control to your application.
+    </li>
+    <li>
+        Your activity returns to the foreground, and the system calls your activity's
+        {@link android.app.Activity#onActivityResult(int, int, Intent) onActivityResult()}
+        method. This method receives the result intent created by the selection activity in
+        the People app.
+    </li>
+    <li>
+        With the content URI from the result intent, you can read the contact's data
+        from the Contacts Provider, even though you didn't request permanent read access permission
+        to the provider in your manifest. You can then get the contact's birthday information
+        or his or her email address and then send the e-greeting.
+    </li>
+</ol>
+<h4>Using another application</h4>
+<p>
+    A simple way to allow the user to modify data to which you don't have access permissions is to
+    activate an application that has permissions and let the user do the work there.
+</p>
+<p>
+    For example, the Calendar application accepts an
+    {@link android.content.Intent#ACTION_INSERT} intent, which allows you to activate the
+    application's insert UI. You can pass "extras" data in this intent, which the application
+    uses to pre-populate the UI. Because recurring events have a complex syntax, the preferred
+    way of inserting events into the Calendar Provider is to activate the Calendar app with an
+    {@link android.content.Intent#ACTION_INSERT} and then let the user insert the event there.
+</p>
+<!-- Contract Classes -->
+<h2 id="ContractClasses">Contract Classes</h2>
+<p>
+    A contract class defines constants that help applications work with the content URIs, column
+    names, intent actions, and other features of a content provider. Contract classes are not
+    included automatically with a provider; the provider's developer has to define them and then
+    make them available to other developers. Many of the providers included with the Android
+    platform have corresponding contract classes in the package {@link android.provider}.
+</p>
+<p>
+    For example, the User Dictionary Provider has a contract class
+    {@link android.provider.UserDictionary} containing content URI and column name constants. The
+    content URI for the "words" table is defined in the constant
+    {@link android.provider.UserDictionary.Words#CONTENT_URI UserDictionary.Words.CONTENT_URI}.
+    The {@link android.provider.UserDictionary.Words} class also contains column name constants,
+    which are used in the example snippets in this guide. For example, a query projection can be
+    defined as:
+</p>
+<pre>
+String[] mProjection =
+{
+    UserDictionary.Words._ID,
+    UserDictionary.Words.WORD,
+    UserDictionary.Words.LOCALE
+};
+</pre>
+<p>
+    Another contract class is {@link android.provider.ContactsContract} for the Contacts Provider.
+    The reference documentation for this class includes example code snippets. One of its
+    subclasses, {@link android.provider.ContactsContract.Intents.Insert}, is a contract
+    class that contains constants for intents and intent data.
+</p>
+
+
+<!-- MIME Type Reference -->
+<h2 id="MIMETypeReference">MIME Type Reference</h2>
+<p>
+    Content providers can return standard MIME media types, or custom MIME type strings, or both.
+</p>
+<p>
+    MIME types have the format
+</p>
+<pre>
+<em>type</em>/<em>subtype</em>
+</pre>
+<p>
+    For example, the well-known MIME type <code>text/html</code> has the <code>text</code> type and
+    the <code>html</code> subtype. If the provider returns this type for a URI, it means that a
+    query using that URI will return text containing HTML tags.
+</p>
+<p>
+    Custom MIME type strings, also called "vendor-specific" MIME types, have more
+    complex <em>type</em> and <em>subtype</em> values. The <em>type</em> value is always
+</p>
+<pre>
+vnd.android.cursor.<strong>dir</strong>
+</pre>
+<p>
+    for multiple rows, or
+</p>
+<pre>
+vnd.android.cursor.<strong>item</strong>
+</pre>
+<p>
+    for a single row.
+</p>
+<p>
+    The <em>subtype</em> is provider-specific. The Android built-in providers usually have a simple
+    subtype. For example, the when the Contacts application creates a row for a telephone number,
+    it sets the following MIME type in the row:
+</p>
+<pre>
+vnd.android.cursor.item/phone_v2
+</pre>
+<p>
+    Notice that the subtype value is simply <code>phone_v2</code>.
+</p>
+<p>
+    Other provider developers may create their own pattern of subtypes based on the provider's
+    authority and table names. For example, consider a provider that contains train timetables.
+    The provider's authority is <code>com.example.trains</code>, and it contains the tables
+    Line1, Line2, and Line3. In response to the content URI
+</p>
+<p>
+<pre>
+content://com.example.trains/Line1
+</pre>
+<p>
+    for table Line1, the provider returns the MIME type
+</p>
+<pre>
+vnd.android.cursor.<strong>dir</strong>/vnd.example.line1
+</pre>
+<p>
+     In response to the content URI
+</p>
+<pre>
+content://com.example.trains/Line2/5
+</pre>
+<p>
+    for row 5 in table Line2, the provider returns the MIME type
+</p>
+<pre>
+vnd.android.cursor.<strong>item</strong>/vnd.example.line2
+</pre>
+<p>
+    Most content providers define contract class constants for the MIME types they use. The
+    Contacts Provider contract class {@link android.provider.ContactsContract.RawContacts},
+    for example, defines the constant
+    {@link android.provider.ContactsContract.RawContacts#CONTENT_ITEM_TYPE} for the MIME type of
+    a single raw contact row.
+</p>
+<p>
+    Content URIs for single rows are described in the section
+    <a href="#ContentURIs">Content URIs</a>.
+</p>
diff --git a/docs/html/guide/topics/providers/content-provider-creating.jd b/docs/html/guide/topics/providers/content-provider-creating.jd
new file mode 100644
index 0000000..4ebdb50
--- /dev/null
+++ b/docs/html/guide/topics/providers/content-provider-creating.jd
@@ -0,0 +1,1215 @@
+page.title=Creating a Content Provider
+@jd:body
+<div id="qv-wrapper">
+<div id="qv">
+
+
+<h2>In this document</h2>
+<ol>
+    <li>
+        <a href="#DataStorage">Designing Data Storage</a>
+    </li>
+    <li>
+        <a href="#ContentURI">Designing Content URIs</a>
+    </li>
+    <li>
+        <a href="#ContentProvider">Implementing the ContentProvider Class</a>
+        <ol>
+            <li>
+                <a href="#RequiredAccess">Required Methods</a>
+            </li>
+            <li>
+                <a href="#Query">Implementing the query() method</a>
+            </li>
+            <li>
+                <a href="#Insert">Implementing the insert() method</a>
+            </li>
+            <li>
+                <a href="#Delete">Implementing the delete() method</a>
+            </li>
+            <li>
+                <a href="#Update">Implementing the update() method</a>
+            </li>
+            <li>
+                <a href="#OnCreate">Implementing the onCreate() method</a>
+            </li>
+        </ol>
+    </li>
+    <li>
+        <a href="#MIMETypes">Implementing Content Provider MIME Types</a>
+        <ol>
+            <li>
+                <a href="#TableMIMETypes">MIME types for tables</a>
+            </li>
+            <li>
+                <a href="#FileMIMETypes">MIME types for files</a>
+            </li>
+        </ol>
+    </li>
+    <li>
+        <a href="#ContractClass">Implementing a Contract Class</a>
+    </li>
+    <li>
+        <a href="#Permissions">Implementing Content Provider Permissions</a>
+    </li>
+    <li>
+        <a href="#ProviderElement">The &lt;provider&gt; Element</a>
+    </li>
+    <li>
+        <a href="#Intents">Intents and Data Access</a>
+    </li>
+</ol>
+<h2>Key classes</h2>
+    <ol>
+        <li>
+            {@link android.content.ContentProvider}
+        </li>
+        <li>
+            {@link android.database.Cursor}
+        </li>
+        <li>
+            {@link android.net.Uri}
+        </li>
+    </ol>
+<h2>Related Samples</h2>
+    <ol>
+        <li>
+            <a
+                href="{@docRoot}resources/samples/NotePad/index.html">
+                Note Pad sample application
+            </a>
+        </li>
+    </ol>
+<h2>See also</h2>
+    <ol>
+        <li>
+            <a href="{@docRoot}guide/topics/providers/content-provider-basics.html">
+            Content Provider Basics</a>
+        </li>
+        <li>
+            <a href="{@docRoot}guide/topics/providers/calendar-provider.html">
+            Calendar Provider</a>
+        </li>
+    </ol>
+</div>
+</div>
+
+
+<p>
+    A content provider manages access to a central repository of data. You implement a
+    provider as one or more classes in an Android application, along with elements in
+    the manifest file. One of your classes implements a subclass
+    {@link android.content.ContentProvider}, which is the interface between your provider and
+    other applications. Although content providers are meant to make data available to other
+    applications, you may of course have activities in your application that allow the user
+    to query and modify the data managed by your provider.
+</p>
+<p>
+    The rest of this topic is a basic list of steps for building a content provider and a list
+    of APIs to use.
+</p>
+
+
+<!-- Before You Start Building -->
+<h2 id="BeforeYouStart">Before You Start Building</h2>
+<p>
+    Before you start building a provider, do the following:
+</p>
+<ol>
+    <li>
+        <strong>Decide if you need a content provider</strong>. You need to build a content
+        provider if you want to provide one or more of the following features:
+        <ul>
+            <li>You want to offer complex data or files to other applications.</li>
+            <li>You want to allow users to copy complex data from your app into other apps.</li>
+            <li>You want to provide custom search suggestions using the search framework.</li>
+        </ul>
+    <p>
+        You <em>don't</em> need a provider to use an SQLite database if the use is entirely within
+        your own application.
+    </p>
+    </li>
+    <li>
+        If you haven't done so already, read the topic
+        <a href="{@docRoot}guide/topics/providers/content-provider-basics.html">
+        Content Provider Basics</a> to learn more about providers.
+    </li>
+</ol>
+<p>
+    Next, follow these steps to build your provider:
+</p>
+<ol>
+    <li>
+        Design the raw storage for your data. A content provider offers data in two ways:
+        <dl>
+            <dt>
+                File data
+            </dt>
+            <dd>
+                Data that normally goes into files, such as
+                photos, audio, or videos. Store the files in your application's private
+                space. In response to a request for a file from another application, your
+                provider can offer a handle to the file.
+            </dd>
+            <dt>
+                &quot;Structured&quot; data
+            </dt>
+            <dd>
+                Data that normally goes into a database, array, or similar structure.
+                Store the data in a form that's compatible with tables of rows and columns. A row
+                represents an entity, such as a person or an item in inventory. A column represents
+                some data for the entity, such a person's name or an item's price. A common way to
+                store this type of data is in an SQLite database, but you can use any type of
+                persistent storage. To learn more about the storage types available in the
+                Android system, see the section <a href="#DataStorage">
+                Designing Data Storage</a>.
+            </dd>
+        </dl>
+    </li>
+    <li>
+        Define a concrete implementation of the {@link android.content.ContentProvider} class and
+        its required methods. This class is the interface between your data and the rest of the
+        Android system. For more information about this class, see the section
+        <a href="#ContentProvider">Implementing the ContentProvider Class</a>.
+    </li>
+    <li>
+        Define the provider's authority string, its content URIs, and column names. If you want
+        the provider's application to handle intents, also define intent actions, extras data,
+        and flags. Also define the permissions that you will require for applications that want
+        to access your data. You should consider defining all of these values as constants in a
+        separate contract class; later, you can expose this class to other developers. For more
+        information about content URIs, see the
+        section <a href="#ContentURI">Designing Content URIs</a>.
+        For more information about intents, see the
+        section <a href="#Intents">Intents and Data Access</a>.
+    </li>
+    <li>
+        Add other optional pieces, such as sample data or an implementation
+        of {@link android.content.AbstractThreadedSyncAdapter} that can synchronize data between
+        the provider and cloud-based data.
+    </li>
+</ol>
+
+
+<!-- Designing Data Storage -->
+<h2 id="DataStorage">Designing Data Storage</h2>
+<p>
+    A content provider is the interface to data saved in a structured format. Before you create
+    the interface, you must decide how to store the data. You can store the data in any form you
+    like, and then design the interface to read and write the data as necessary.
+</p>
+<p>
+    These are some of the data storage technologies that are available in Android:
+</p>
+<ul>
+    <li>
+        The Android system includes an SQLite database API that Android's own providers use
+        to store table-oriented data. The
+        {@link android.database.sqlite.SQLiteOpenHelper} class helps you create databases, and the
+        {@link android.database.sqlite.SQLiteDatabase} class is the base class for accessing
+        databases.
+        <p>
+            Remember that you don't have to use a database to implement your repository. A provider
+            appears externally as a set of tables, similar to a relational database, but this is
+            not a requirement for the provider's internal implementation.
+        </p>
+    </li>
+    <li>
+        For storing file data, Android has a variety of file-oriented APIs.
+        To learn more about file storage, read the topic
+        <a href="{@docRoot}guide/topics/data/data-storage.html">Data Storage</a>. If you're
+        designing a provider that offers media-related data such as music or videos, you can
+        have a provider that combines table data and files.
+    </li>
+    <li>
+        For working with network-based data, use classes in {@link java.net} and
+        {@link android.net}. You can also synchronize network-based data to a local data
+        store such as a database, and then offer the data as tables or files.
+        The <a href="{@docRoot}resources/samples/SampleSyncAdapter/index.html">
+        Sample Sync Adapter</a> sample application demonstrates this type of synchronization.
+    </li>
+</ul>
+<h3 id="DataDesign">
+    Data design considerations
+</h3>
+<p>
+    Here are some tips for designing your provider's data structure:
+</p>
+<ul>
+    <li>
+        Table data should always have a &quot;primary key&quot; column that the provider maintains
+        as a unique numeric value for each row. You can use this value to link the row to related
+        rows in other tables (using it as a &quot;foreign key&quot;). Although you can use any name
+        for this column, using {@link android.provider.BaseColumns#_ID BaseColumns._ID} is the best
+        choice, because linking the results of a provider query to a
+        {@link android.widget.ListView} requires one of the retrieved columns to have the name
+        <code>_ID</code>.
+    </li>
+    <li>
+        If you want to provide bitmap images or other very large pieces of file-oriented data, store
+        the data in a file and then provide it indirectly rather than storing it directly in a
+        table. If you do this, you need to tell users of your provider that they need to use a
+        {@link android.content.ContentResolver} file method to access the data.
+    </li>
+    <li>
+        Use the Binary Large OBject (BLOB) data type to store data that varies in size or has a
+        varying structure. For example, you can use a BLOB column to store a
+        <a href="http://code.google.com/p/protobuf">protocol buffer</a> or
+        <a href="http://www.json.org">JSON structure</a>.
+        <p>
+            You can also use a BLOB to implement a <em>schema-independent</em> table. In
+            this type of table, you define a primary key column, a MIME type column, and one or
+            more generic columns as BLOB. The meaning of the data in the BLOB columns is indicated
+            by the value in the MIME type column. This allows you to store different row types in
+            the same table. The Contacts Provider's &quot;data&quot; table
+            {@link android.provider.ContactsContract.Data} is an example of a schema-independent
+            table.
+        </p>
+    </li>
+</ul>
+<!-- Designing Content URIs -->
+<h2 id="ContentURI">Designing Content URIs</h2>
+<p>
+    A <strong>content URI</strong> is a URI that identifies data in a provider. Content URIs include
+    the symbolic name of the entire provider (its <strong>authority</strong>) and a
+    name that points to a table or file (a <strong>path</strong>). The optional id part points to
+    an individual row in a table. Every data access method of
+    {@link android.content.ContentProvider} has a content URI as an argument; this allows you to
+    determine the table, row, or file to access.
+</p>
+<p>
+    The basics of content URIs are described in the topic
+    <a href="{@docRoot}guide/topics/providers/content-provider-basics.html">
+    Content Provider Basics</a>.
+</p>
+<h3>Designing an authority</h3>
+<p>
+    A provider usually has a single authority, which serves as its Android-internal name. To
+    avoid conflicts with other providers, you should use Internet domain ownership (in reverse)
+    as the basis of your provider authority. Because this recommendation is also true for Android
+    package names, you can define your provider authority as an extension of the name
+    of the package containing the provider. For example, if your Android package name is
+    <code>com.example.&lt;appname&gt;</code>, you should give your provider the
+    authority <code>com.example.&lt;appname&gt;.provider</code>.
+</p>
+<h3>Designing a path structure</h3>
+<p>
+    Developers usually create content URIs from the authority by appending paths that point to
+    individual tables. For example, if you have two tables <em>table1</em> and
+    <em>table2</em>, you combine the authority from the previous example to yield the
+    content URIs
+    <code>com.example.&lt;appname&gt;.provider/table1</code> and
+    <code>com.example.&lt;appname&gt;.provider/table2</code>. Paths aren't
+    limited to a single segment, and there doesn't have to be a table for each level of the path.
+</p>
+<h3>Handling content URI IDs</h3>
+<p>
+    By convention, providers offer access to a single row in a table by accepting a content URI
+    with an ID value for the row at the end of the URI. Also by convention, providers match the
+    ID value to the table's <code>_ID</code> column, and perform the requested access against the
+    row that matches.
+</p>
+<p>
+    This convention facilitates a common design pattern for apps accessing a provider. The app
+    does a query against the provider and displays the resulting {@link android.database.Cursor}
+    in a {@link android.widget.ListView} using a {@link android.widget.CursorAdapter}.
+    The definition of {@link android.widget.CursorAdapter} requires one of the columns in the
+    {@link android.database.Cursor} to be <code>_ID</code>
+</p>
+<p>
+    The user then picks one of the displayed rows from the UI in order to look at or modify the
+    data. The app gets the corresponding row from the {@link android.database.Cursor} backing the
+    {@link android.widget.ListView}, gets the <code>_ID</code> value for this row, appends it to
+    the content URI, and sends the access request to the provider. The provider can then do the
+    query or modification against the exact row the user picked.
+</p>
+<h3>Content URI patterns</h3>
+<p>
+    To help you choose which action to take for an incoming content URI, the provider API includes
+    the convenience class {@link android.content.UriMatcher}, which maps content URI "patterns" to
+    integer values. You can use the integer values in a <code>switch</code> statement that
+    chooses the desired action for the content URI or URIs that match a particular pattern.
+</p>
+<p>
+    A content URI pattern matches content URIs using wildcard characters:
+</p>
+    <ul>
+        <li>
+            <strong><code>*</code>:</strong> Matches a string of any valid characters of any length.
+        </li>
+        <li>
+            <strong><code>#</code>:</strong> Matches a string of numeric characters of any length.
+        </li>
+    </ul>
+<p>
+    As an example of designing and coding content URI handling, consider a provider with the
+    authority <code>com.example.app.provider</code> that recognizes the following content URIs
+    pointing to tables:
+</p>
+<ul>
+    <li>
+        <code>content://com.example.app.provider/table1</code>: A table called <code>table1</code>.
+    </li>
+    <li>
+        <code>content://com.example.app.provider/table2/dataset1</code>: A table called
+        <code>dataset1</code>.
+    </li>
+    <li>
+        <code>content://com.example.app.provider/table2/dataset2</code>: A table called
+        <code>dataset2</code>.
+    </li>
+    <li>
+        <code>content://com.example.app.provider/table3</code>: A table called <code>table3</code>.
+    </li>
+</ul>
+<p>
+    The provider also recognizes these content URIs if they have a row ID appended to them, as
+    for example <code>content://com.example.app.provider/table3/1</code> for the row identified by
+    <code>1</code> in <code>table3</code>.
+</p>
+<p>
+    The following content URI patterns would be possible:
+</p>
+<dl>
+    <dt>
+        <code>content://com.example.app.provider/*</code>
+    </dt>
+    <dd>
+        Matches any content URI in the provider.
+    </dd>
+    <dt>
+        <code>content://com.example.app.provider/table2/*</code>:
+    </dt>
+    <dd>
+        Matches a content URI for the tables <code>dataset1</code>
+        and <code>dataset2</code>, but doesn't match content URIs for <code>table1</code> or
+        <code>table3</code>.
+    </dd>
+    <dt>
+        <code>content://com.example.app.provider/table3/#</code>: Matches a content URI
+        for single rows in <code>table3</code>, such as
+        <code>content://com.example.app.provider/table3/6</code> for the row identified by
+        <code>6</code>.
+    </dt>
+</dl>
+<p>
+    The following code snippet shows how the methods in {@link android.content.UriMatcher} work.
+    This code handles URIs for an entire table differently from URIs for a
+    single row, by using the content URI pattern
+    <code>content://&lt;authority&gt;/&lt;path&gt;</code> for tables, and
+    <code>content://&lt;authority&gt;/&lt;path&gt;/&lt;id&gt;</code> for single rows.
+</p>
+<p>
+    The method {@link android.content.UriMatcher#addURI(String, String, int) addURI()} maps an
+    authority and path to an integer value. The method android.content.UriMatcher#match(Uri)
+    match()} returns the integer value for a URI. A <code>switch</code> statement
+    chooses between querying the entire table, and querying for a single record:
+</p>
+<pre class="prettyprint">
+public class ExampleProvider extends ContentProvider {
+...
+    // Creates a UriMatcher object.
+    private static final UriMatcher sUriMatcher;
+...
+    /*
+     * The calls to addURI() go here, for all of the content URI patterns that the provider
+     * should recognize. For this snippet, only the calls for table 3 are shown.
+     */
+...
+    /*
+     * Sets the integer value for multiple rows in table 3 to 1. Notice that no wildcard is used
+     * in the path
+     */
+    sUriMatcher.addURI("com.example.app.provider", "table3", 1);
+
+    /*
+     * Sets the code for a single row to 2. In this case, the "#" wildcard is
+     * used. "content://com.example.app.provider/table3/3" matches, but
+     * "content://com.example.app.provider/table3 doesn't.
+     */
+    sUriMatcher.addURI("com.example.app.provider", "table3/#", 2);
+...
+    // Implements ContentProvider.query()
+    public Cursor query(
+        Uri uri,
+        String[] projection,
+        String selection,
+        String[] selectionArgs,
+        String sortOrder) {
+...
+        /*
+         * Choose the table to query and a sort order based on the code returned for the incoming
+         * URI. Here, too, only the statements for table 3 are shown.
+         */
+        switch (sUriMatcher.match(uri)) {
+
+
+            // If the incoming URI was for all of table3
+            case 1:
+
+                if (TextUtils.isEmpty(sortOrder)) sortOrder = "_ID ASC";
+                break;
+
+            // If the incoming URI was for a single row
+            case 2:
+
+                /*
+                 * Because this URI was for a single row, the _ID value part is
+                 * present. Get the last path segment from the URI; this is the _ID value.
+                 * Then, append the value to the WHERE clause for the query
+                 */
+                selection = selection + "_ID = " uri.getLastPathSegment();
+                break;
+
+            default:
+            ...
+                // If the URI is not recognized, you should do some error handling here.
+        }
+        // call the code to actually do the query
+    }
+</pre>
+<p>
+    Another class, {@link android.content.ContentUris}, provides convenience methods for working
+    with the <code>id</code> part of content URIs. The classes {@link android.net.Uri} and
+    {@link android.net.Uri.Builder} include convenience methods for parsing existing
+    {@link android.net.Uri} objects and building new ones.
+</p>
+
+<!-- Implementing the ContentProvider class -->
+<h2 id="ContentProvider">Implementing the ContentProvider Class</h2>
+<p>
+    The {@link android.content.ContentProvider} instance manages access
+    to a structured set of data by handling requests from other applications. All forms
+    of access eventually call {@link android.content.ContentResolver}, which then calls a concrete
+    method of {@link android.content.ContentProvider} to get access.
+</p>
+<h3 id="RequiredAccess">Required methods</h3>
+<p>
+    The abstract class {@link android.content.ContentProvider} defines six abstract methods that
+    you must implement as part of your own concrete subclass. All of these methods except
+    {@link android.content.ContentProvider#onCreate() onCreate()} are called by a client application
+    that is attempting to access your content provider:
+</p>
+<dl>
+    <dt>
+        {@link android.content.ContentProvider#query(Uri, String[], String, String[], String)
+        query()}
+    </dt>
+    <dd>
+        Retrieve data from your provider. Use the arguments to select the table to
+        query, the rows and columns to return, and the sort order of the result.
+        Return the data as a {@link android.database.Cursor} object.
+    </dd>
+    <dt>
+        {@link android.content.ContentProvider#insert(Uri, ContentValues) insert()}
+    </dt>
+    <dd>
+        Insert a new row into your provider. Use the arguments to select the
+        destination table and to get the column values to use. Return a content URI for the
+        newly-inserted row.
+    </dd>
+    <dt>
+        {@link android.content.ContentProvider#update(Uri, ContentValues, String, String[])
+        update()}
+    </dt>
+    <dd>
+        Update existing rows in your provider. Use the arguments to select the table and rows
+        to update and to get the updated column values. Return the number of rows updated.
+    </dd>
+    <dt>
+        {@link android.content.ContentProvider#delete(Uri, String, String[]) delete()}
+    </dt>
+    <dd>
+        Delete rows from your provider. Use the arguments to select the table and the rows to
+        delete. Return the number of rows deleted.
+    </dd>
+    <dt>
+        {@link android.content.ContentProvider#getType(Uri) getType()}
+    </dt>
+    <dd>
+        Return the MIME type corresponding to a content URI. This method is described in more
+        detail in the section <a href="#MIMETypes">Implementing Content Provider MIME Types</a>.
+    </dd>
+    <dt>
+        {@link android.content.ContentProvider#onCreate() onCreate()}
+    </dt>
+    <dd>
+        Initialize your provider. The Android system calls this method immediately after it
+        creates your provider. Notice that your provider is not created until a
+        {@link android.content.ContentResolver} object tries to access it.
+    </dd>
+</dl>
+<p>
+    Notice that these methods have the same signature as the identically-named
+    {@link android.content.ContentResolver} methods.
+</p>
+<p>
+    Your implementation of these methods should account for the following:
+</p>
+<ul>
+    <li>
+        All of these methods except {@link android.content.ContentProvider#onCreate() onCreate()}
+        can be called by multiple threads at once, so they must be thread-safe. To learn
+        more about multiple threads, see the topic
+        <a href="{@docRoot}guide/topics/fundamentals/processes-and-threads.html">
+        Processes and Threads</a>.
+    </li>
+    <li>
+        Avoid doing lengthy operations in {@link android.content.ContentProvider#onCreate()
+        onCreate()}. Defer initialization tasks until they are actually needed.
+        The section <a href="#OnCreate">Implementing the onCreate() method</a>
+        discusses this in more detail.
+    </li>
+    <li>
+        Although you must implement these methods, your code does not have to do anything except
+        return the expected data type. For example, you may want to prevent other applications
+        from inserting data into some tables. To do this, you can ignore the call to
+        {@link android.content.ContentProvider#insert(Uri, ContentValues) insert()} and return
+        0.
+    </li>
+</ul>
+<h3 id="Query">Implementing the query() method</h3>
+<p>
+    The
+    {@link android.content.ContentProvider#query(Uri, String[], String, String[], String)
+    ContentProvider.query()} method must return a {@link android.database.Cursor} object, or if it
+    fails, throw an {@link java.lang.Exception}. If you are using an SQLite database as your data
+    storage, you can simply return the {@link android.database.Cursor} returned by one of the
+    <code>query()</code> methods of the {@link android.database.sqlite.SQLiteDatabase} class.
+    If the query does not match any rows, you should return a {@link android.database.Cursor}
+    instance whose {@link android.database.Cursor#getCount()} method returns 0.
+    You should return <code>null</code> only if an internal error occurred during the query process.
+</p>
+<p>
+    If you aren't using an SQLite database as your data storage, use one of the concrete subclasses
+    of {@link android.database.Cursor}. For example, the {@link android.database.MatrixCursor} class
+    implements a cursor in which each row is an array of {@link java.lang.Object}. With this class,
+    use {@link android.database.MatrixCursor#addRow(Object[]) addRow()} to add a new row.
+</p>
+<p>
+    Remember that the Android system must be able to communicate the {@link java.lang.Exception}
+    across process boundaries. Android can do this for the following exceptions that may be useful
+    in handling query errors:
+</p>
+<ul>
+    <li>
+        {@link java.lang.IllegalArgumentException} (You may choose to throw this if your provider
+        receives an invalid content URI)
+    </li>
+    <li>
+        {@link java.lang.NullPointerException}
+    </li>
+</ul>
+<h3 id="Insert">Implementing the insert() method</h3>
+<p>
+    The {@link android.content.ContentProvider#insert(Uri, ContentValues) insert()} method adds a
+    new row to the appropriate table, using the values in the {@link android.content.ContentValues}
+    argument. If a column name is not in the {@link android.content.ContentValues} argument, you
+    may want to provide a default value for it either in your provider code or in your database
+    schema.
+</p>
+<p>
+    This method should return the content URI for the new row. To construct this, append the new
+    row's <code>_ID</code> (or other primary key) value to the table's content URI, using
+    {@link android.content.ContentUris#withAppendedId(Uri, long) withAppendedId()}.
+</p>
+<h3 id="Delete">Implementing the delete() method</h3>
+<p>
+    The {@link android.content.ContentProvider#delete(Uri, String, String[]) delete()} method
+    does not have to physically delete rows from your data storage. If you are using a sync adapter
+    with your provider, you should consider marking a deleted row
+    with a &quot;delete&quot; flag rather than removing the row entirely. The sync adapter can
+    check for deleted rows and remove them from the server before deleting them from the provider.
+</p>
+<h3 id="Update">Implementing the update() method</h3>
+<p>
+    The {@link android.content.ContentProvider#update(Uri, ContentValues, String, String[])
+    update()} method takes the same {@link android.content.ContentValues} argument used by
+    {@link android.content.ContentProvider#insert(Uri, ContentValues) insert()}, and the
+    same <code>selection</code> and <code>selectionArgs</code> arguments used by
+    {@link android.content.ContentProvider#delete(Uri, String, String[]) delete()} and
+    {@link android.content.ContentProvider#query(Uri, String[], String, String[], String)
+    ContentProvider.query()}. This may allow you to re-use code between these methods.
+</p>
+<h3 id="OnCreate">Implementing the onCreate() method</h3>
+<p>
+    The Android system calls {@link android.content.ContentProvider#onCreate()
+    onCreate()} when it starts up the provider. You should perform only fast-running initialization
+    tasks in this method, and defer database creation and data loading until the provider actually
+    receives a request for the data. If you do lengthy tasks in
+    {@link android.content.ContentProvider#onCreate() onCreate()}, you will slow down your
+    provider's startup. In turn, this will slow down the response from the provider to other
+    applications.
+</p>
+<p>
+    For example, if you are using an SQLite database you can create
+    a new {@link android.database.sqlite.SQLiteOpenHelper} object in
+    {@link android.content.ContentProvider#onCreate() ContentProvider.onCreate()},
+    and then create the SQL tables the first time you open the database. To facilitate this, the
+    first time you call {@link android.database.sqlite.SQLiteOpenHelper#getWritableDatabase
+    getWritableDatabase()}, it automatically calls the
+    {@link android.database.sqlite.SQLiteOpenHelper#onCreate(SQLiteDatabase)
+    SQLiteOpenHelper.onCreate()} method.
+</p>
+<p>
+    The following two snippets demonstrate the interaction between
+    {@link android.content.ContentProvider#onCreate() ContentProvider.onCreate()} and
+    {@link android.database.sqlite.SQLiteOpenHelper#onCreate(SQLiteDatabase)
+    SQLiteOpenHelper.onCreate()}. The first snippet is the implementation of
+    {@link android.content.ContentProvider#onCreate() ContentProvider.onCreate()}:
+</p>
+<pre class="prettyprint">
+public class ExampleProvider extends ContentProvider
+
+    /*
+     * Defines a handle to the database helper object. The MainDatabaseHelper class is defined
+     * in a following snippet.
+     */
+    private MainDatabaseHelper mOpenHelper;
+
+    // Defines the database name
+    private static final String DBNAME = "mydb";
+
+    // Holds the database object
+    private SQLiteDatabase db;
+
+    public boolean onCreate() {
+
+        /*
+         * Creates a new helper object. This method always returns quickly.
+         * Notice that the database itself isn't created or opened
+         * until SQLiteOpenHelper.getWritableDatabase is called
+         */
+        mOpenHelper = new SQLiteOpenHelper(
+            getContext(),        // the application context
+            DBNAME,              // the name of the database)
+            null,                // uses the default SQLite cursor
+            1                    // the version number
+        );
+
+        return true;
+    }
+
+    ...
+
+    // Implements the provider's insert method
+    public Cursor insert(Uri uri, ContentValues values) {
+        // Insert code here to determine which table to open, handle error-checking, and so forth
+
+        ...
+
+        /*
+         * Gets a writeable database. This will trigger its creation if it doesn't already exist.
+         *
+         */
+        db = mOpenHelper.getWritableDatabase();
+    }
+}
+</pre>
+<p>
+    The next snippet is the implementation of
+    {@link android.database.sqlite.SQLiteOpenHelper#onCreate(SQLiteDatabase)
+    SQLiteOpenHelper.onCreate()}, including a helper class:
+</p>
+<pre class="prettyprint">
+...
+// A string that defines the SQL statement for creating a table
+private static final String SQL_CREATE_MAIN = "CREATE TABLE " +
+    "main " +                       // Table's name
+    "(" +                           // The columns in the table
+    " _ID INTEGER PRIMARY KEY, " +
+    " WORD TEXT"
+    " FREQUENCY INTEGER " +
+    " LOCALE TEXT )";
+...
+/**
+ * Helper class that actually creates and manages the provider's underlying data repository.
+ */
+protected static final class MainDatabaseHelper extends SQLiteOpenHelper {
+
+    /*
+     * Instantiates an open helper for the provider's SQLite data repository
+     * Do not do database creation and upgrade here.
+     */
+    MainDatabaseHelper(Context context) {
+        super(context, DBNAME, null, 1);
+    }
+
+    /*
+     * Creates the data repository. This is called when the provider attempts to open the
+     * repository and SQLite reports that it doesn't exist.
+     */
+    public void onCreate(SQLiteDatabase db) {
+
+        // Creates the main table
+        db.execSQL(SQL_CREATE_MAIN);
+    }
+}
+</pre>
+
+
+<!-- Implementing ContentProvider MIME Types -->
+<h2 id="MIMETypes">Implementing ContentProvider MIME Types</h2>
+<p>
+    The {@link android.content.ContentProvider} class has two methods for returning MIME types:
+</p>
+<dl>
+    <dt>
+        {@link android.content.ContentProvider#getType(Uri) getType()}
+    </dt>
+    <dd>
+        One of the required methods that you must implement for any provider.
+    </dd>
+    <dt>
+        {@link android.content.ContentProvider#getStreamTypes(Uri, String) getStreamTypes()}
+    </dt>
+    <dd>
+        A method that you're expected to implement if your provider offers files.
+    </dd>
+</dl>
+<h3 id="TableMIMETypes">MIME types for tables</h3>
+<p>
+    The {@link android.content.ContentProvider#getType(Uri) getType()} method returns a
+    {@link java.lang.String} in MIME format that describes the type of data returned by the content
+    URI argument. The {@link android.net.Uri} argument can be a pattern rather than a specific URI;
+    in this case, you should return the type of data associated with content URIs that match the
+    pattern.
+</p>
+<p>
+    For common types of data such as as text, HTML, or JPEG,
+    {@link android.content.ContentProvider#getType(Uri) getType()} should return the standard
+    MIME type for that data. A full list of these standard types is available on the
+    <a href="http://www.iana.org/assignments/media-types/index.htm">IANA MIME Media Types</a>
+    website.
+</p>
+<p>
+    For content URIs that point to a row or rows of table data,
+    {@link android.content.ContentProvider#getType(Uri) getType()} should return
+    a MIME type in Android's vendor-specific MIME format:
+</p>
+<ul>
+    <li>
+        Type part: <code>vnd</code>
+    </li>
+    <li>
+        Subtype part:
+        <ul>
+            <li>
+    If the URI pattern is for a single row: <code>android.cursor.<strong>item</strong>/</code>
+            </li>
+            <li>
+    If the URI pattern is for more than one row: <code>android.cursor.<strong>dir</strong>/</code>
+            </li>
+        </ul>
+    </li>
+    <li>
+        Provider-specific part: <code>vnd.&lt;name&gt;</code>.<code>&lt;type&gt;</code>
+        <p>
+            You supply the <code>&lt;name&gt;</code> and <code>&lt;type&gt;</code>.
+            The <code>&lt;name&gt;</code> value should be globally unique,
+            and the <code>&lt;type&gt;</code> value should be unique to the corresponding URI
+            pattern. A good choice for <code>&lt;name&gt;</code> is your company's name or
+            some part of your application's Android package name. A good choice for the
+            <code>&lt;type&gt;</code> is a string that identifies the table associated with the
+            URI.
+        </p>
+
+    </li>
+</ul>
+<p>
+    For example, if a provider's authority is
+    <code>com.example.app.provider</code>, and it exposes a table named
+    <code>table1</code>, the MIME type for multiple rows in <code>table1</code> is:
+</p>
+<pre>
+vnd.android.cursor.<strong>dir</strong>/vnd.com.example.provider.table1
+</pre>
+<p>
+    For a single row of <code>table1</code>, the MIME type is:
+</p>
+<pre>
+vnd.android.cursor.<strong>item</strong>/vnd.com.example.provider.table1
+</pre>
+<h3 id="FileMIMETypes">MIME types for files</h3>
+<p>
+    If your provider offers files, implement
+    {@link android.content.ContentProvider#getStreamTypes(Uri, String) getStreamTypes()}.
+    The method returns a {@link java.lang.String} array of MIME types for the files your provider
+    can return for a given content URI. You should filter the MIME types you offer by the MIME type
+    filter argument, so that you return only those MIME types that the client wants to handle.
+</p>
+<p>
+    For example, consider a provider that offers photo images as files in <code>.jpg</code>,
+    <code>.png</code>, and <code>.gif</code> format.
+    If an application calls {@link android.content.ContentResolver#getStreamTypes(Uri, String)
+    ContentResolver.getStreamTypes()} with the filter string <code>image/*</code> (something that
+    is an &quot;image&quot;),
+    then the {@link android.content.ContentProvider#getStreamTypes(Uri, String)
+    ContentProvider.getStreamTypes()} method should return the array:
+</p>
+<pre>
+{ &quot;image/jpeg&quot;, &quot;image/png&quot;, &quot;image/gif&quot;}
+</pre>
+<p>
+    If the app is only interested in <code>.jpg</code> files, then it can call
+    {@link android.content.ContentResolver#getStreamTypes(Uri, String)
+    ContentResolver.getStreamTypes()} with the filter string <code>*\/jpeg</code>, and
+    {@link android.content.ContentProvider#getStreamTypes(Uri, String)
+    ContentProvider.getStreamTypes()} should return:
+<pre>
+{&quot;image/jpeg&quot;}
+</pre>
+<p>
+    If your provider doesn't offer any of the MIME types requested in the filter string,
+    {@link android.content.ContentProvider#getStreamTypes(Uri, String) getStreamTypes()}
+    should return <code>null</code>.
+</p>
+
+
+<!--  Implementing a Contract Class -->
+<h2 id="ContractClass">Implementing a Contract Class</h2>
+<p>
+    A contract class is a <code>public final</code> class that contains constant definitions for the
+    URIs, column names, MIME types, and other meta-data that pertain to the provider. The class
+    establishes a contract between the provider and other applications by ensuring that the provider
+    can be correctly accessed even if there are changes to the actual values of URIs, column names,
+    and so forth.
+</p>
+<p>
+    A contract class also helps developers because it usually has mnemonic names for its constants,
+    so developers are less likely to use incorrect values for column names or URIs. Since it's a
+    class, it can contain Javadoc documentation. Integrated development environments such as
+    Eclipse can auto-complete constant names from the contract class and display Javadoc for the
+    constants.
+</p>
+<p>
+    Developers can't access the contract class's class file from your application, but they can
+    statically compile it into their application from a <code>.jar</code> file you provide.
+</p>
+<p>
+    The {@link android.provider.ContactsContract} class and its nested classes are examples of
+    contract classes.
+</p>
+<h2 id="Permissions">Implementing Content Provider Permissions</h2>
+<p>
+    Permissions and access for all aspects of the Android system are described in detail in the
+    topic <a href="{@docRoot}guide/topics/security/security.html">Security and Permissions</a>.
+    The topic <a href="{@docRoot}guide/topics/data/data-storage.html">Data Storage</a> also
+    described the security and permissions in effect for various types of storage.
+    In brief, the important points are:
+</p>
+<ul>
+    <li>
+        By default, data files stored on the device's internal storage are private to your
+        application and provider.
+    </li>
+    <li>
+        {@link android.database.sqlite.SQLiteDatabase} databases you create are private to your
+        application and provider.
+    </li>
+    <li>
+        By default, data files that you save to external storage are <em>public</em> and
+        <em>world-readable</em>. You can't use a content provider to restrict access to files in
+        external storage, because other applications can use other API calls to read and write them.
+    </li>
+    <li>
+        The method calls for opening or creating files or SQLite databases on your device's internal
+        storage can potentially give both read and write access to all other applications. If you
+        use an internal file or database as your provider's repository, and you give it
+        "world-readable" or "world-writeable" access, the permissions you set for your provider in
+        its manifest won't protect your data. The default access for files and databases in
+        internal storage is "private", and for your provider's repository you shouldn't change this.
+    </li>
+</ul>
+<p>
+    If you want to use content provider permissions to control access to your data, then you should
+    store your data in internal files, SQLite databases, or the &quot;cloud&quot; (for example,
+    on a remote server), and you should keep files and databases private to your application.
+</p>
+<h3>Implementing permissions</h3>
+<p>
+    All applications can read from or write to your provider, even if the underlying data is
+    private, because by default your provider does not have permissions set. To change this,
+    set permissions for your provider in your manifest file, using attributes or child
+    elements of the <code><a href="{@docRoot}guide/topics/manifest/provider-element.html">
+    &lt;provider&gt;</a></code> element. You can set permissions that apply to the entire provider,
+    or to certain tables, or even to certain records, or all three.
+</p>
+<p>
+    You define permissions for your provider with one or more
+    <code><a href="{@docRoot}guide/topics/manifest/permission-element.html">
+    &lt;permission&gt;</a></code> elements in your manifest file. To make the
+    permission unique to your provider, use Java-style scoping for the
+    <code><a href="{@docRoot}guide/topics/manifest/permission-element.html#nm">
+    android:name</a></code> attribute. For example, name the read permission
+    <code>com.example.app.provider.permission.READ_PROVIDER</code>.
+
+</p>
+<p>
+    The following list describes the scope of provider permissions, starting with the
+    permissions that apply to the entire provider and then becoming more fine-grained.
+    More fine-grained permissions take precedence over ones with larger scope:
+</p>
+<dl>
+    <dt>
+        Single read-write provider-level permission
+    </dt>
+    <dd>
+        One permission that controls both read and write access to the entire provider, specified
+        with the <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#prmsn">
+        android:permission</a></code> attribute of the
+        <code><a href="{@docRoot}guide/topics/manifest/provider-element.html">
+        &lt;provider&gt;</a></code> element.
+    </dd>
+    <dt>
+        Separate read and write provider-level permission
+    </dt>
+    <dd>
+        A read permission and a write permission for the entire provider. You specify them
+        with the <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#rprmsn">
+        android:readPermission</a></code> and
+        <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#wprmsn">
+        android:writePermission</a></code> attributes of the
+        <code><a href="{@docRoot}guide/topics/manifest/provider-element.html">
+        &lt;provider&gt;</a></code> element. They take precedence over the permission required by
+        <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#prmsn">
+        android:permission</a></code>.
+    </dd>
+    <dt>
+        Path-level permission
+    </dt>
+    <dd>
+        Read, write, or read/write permission for a content URI in your provider. You specify
+        each URI you want to control with a
+        <code><a href="{@docRoot}guide/topics/manifest/path-permission-element.html">
+        &lt;path-permission&gt;</a></code> child element of the
+        <code><a href="{@docRoot}guide/topics/manifest/provider-element.html">
+        &lt;provider&gt;</a></code> element. For each content URI you specify, you can specify a
+        read/write permission, a read permission, or a write permission, or all three. The read and
+        write permissions take precedence over the read/write permission. Also, path-level
+        permission takes precedence over provider-level permissions.
+    </dd>
+    <dt>
+        Temporary permission
+    </dt>
+    <dd>
+        A permission level that grants temporary access to an application, even if the application
+        doesn't have the permissions that are normally required. The temporary
+        access feature reduces the number of permissions an application has to request in
+        its manifest. When you turn on temporary permissions, the only applications that need
+        &quot;permanent&quot; permissions for your provider are ones that continually access all
+        your data.
+        <p>
+            Consider the permissions you need to implement an email provider and app, when you
+            want to allow an outside image viewer application to display photo attachments from your
+            provider. To give the image viewer the necessary access without requiring permissions,
+            set up temporary permissions for content URIs for photos. Design your email app so
+            that when the user wants to display a photo, the app sends an intent containing the
+            photo's content URI and permission flags to the image viewer. The image viewer can
+            then query your email provider to retrieve the photo, even though the viewer doesn't
+            have the normal read permission for your provider.
+        </p>
+        <p>
+            To turn on temporary permissions, either set the
+            <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#gprmsn">
+            android:grantUriPermissions</a></code> attribute of the
+            <code><a href="{@docRoot}guide/topics/manifest/provider-element.html">
+            &lt;provider&gt;</a></code> element, or add one or more
+            <code><a href="{@docRoot}guide/topics/manifest/grant-uri-permission-element.html">
+            &lt;grant-uri-permission&gt;</a></code> child elements to your
+            <code><a href="{@docRoot}guide/topics/manifest/provider-element.html">
+            &lt;provider&gt;</a></code> element. If you use temporary permissions, you have to call
+            {@link android.content.Context#revokeUriPermission(Uri, int)
+            Context.revokeUriPermission()} whenever you remove support for a content URI from your
+            provider, and the content URI is associated with a temporary permission.
+        </p>
+        <p>
+            The attribute's value determines how much of your provider is made accessible.
+            If the attribute is set to <code>true</code>, then the system will grant temporary
+            permission to your entire provider, overriding any other permissions that are required
+            by your provider-level or path-level permissions.
+        </p>
+        <p>
+            If this flag is set to <code>false</code>, then you must add
+            <code><a href="{@docRoot}guide/topics/manifest/grant-uri-permission-element.html">
+            &lt;grant-uri-permission&gt;</a></code> child elements to your
+            <code><a href="{@docRoot}guide/topics/manifest/provider-element.html">
+            &lt;provider&gt;</a></code> element. Each child element specifies the content URI or
+            URIs for which temporary access is granted.
+        </p>
+        <p>
+            To delegate temporary access to an application, an intent must contain
+            the {@link android.content.Intent#FLAG_GRANT_READ_URI_PERMISSION} or the
+            {@link android.content.Intent#FLAG_GRANT_WRITE_URI_PERMISSION} flags, or both. These
+            are set with the {@link android.content.Intent#setFlags(int) setFlags()} method.
+        </p>
+        <p>
+            If the <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#gprmsn">
+            android:grantUriPermissions</a></code> attribute is not present, it's assumed to be
+            <code>false</code>.
+        </p>
+    </dd>
+</dl>
+
+
+
+<!-- The Provider Element -->
+<h2 id="ProviderElement">The &lt;provider&gt; Element</h2>
+<p>
+    Like {@link android.app.Activity} and {@link android.app.Service} components,
+    a subclass of {@link android.content.ContentProvider}
+    must be defined in the manifest file for its application, using the
+    <code><a href="{@docRoot}guide/topics/manifest/provider-element.html">
+    &lt;provider&gt;</a></code> element. The Android system gets the following information from
+    the element:
+<dl>
+    <dt>
+        Authority
+        (<a href="{@docRoot}guide/topics/manifest/provider-element.html#auth">{@code
+        android:authorities}</a>)
+    </dt>
+    <dd>
+        Symbolic names that identify the entire provider within the system. This
+        attribute is described in more detail in the section
+        <a href="#ContentURI">Designing Content URIs</a>.
+    </dd>
+    <dt>
+        Provider class name
+        (<code>
+<a href="{@docRoot}guide/topics/manifest/provider-element.html#nm">android:name</a>
+        </code>)
+    </dt>
+    <dd>
+        The class that implements {@link android.content.ContentProvider}. This class is
+        described in more detail in the section
+        <a href="#ContentProvider">Implementing the ContentProvider Class</a>.
+    </dd>
+    <dt>
+        Permissions
+    </dt>
+    <dd>
+        Attributes that specify the permissions that other applications must have in order to access
+        the provider's data:
+        <ul>
+            <li>
+                <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#gprmsn">
+                android:grantUriPermssions</a></code>: Temporary permission flag.
+            </li>
+            <li>
+                <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#prmsn">
+                android:permission</a></code>: Single provider-wide read/write permission.
+            </li>
+            <li>
+                <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#rprmsn">
+                android:readPermission</a></code>: Provider-wide read permission.
+            </li>
+            <li>
+                <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#wprmsn">
+                android:writePermission</a></code>: Provider-wide write permission.
+            </li>
+        </ul>
+        <p>
+            Permissions and their corresponding attributes are described in more
+            detail in the section
+            <a href="#Permissions">Implementing Content Provider Permissions</a>.
+        </p>
+    </dd>
+    <dt>
+        Startup and control attributes
+    </dt>
+    <dd>
+        These attributes determine how and when the Android system starts the provider, the
+        process characteristics of the provider, and other run-time settings:
+        <ul>
+            <li>
+                <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#enabled">
+                android:enabled</a></code>: Flag allowing the system to start the provider.
+            </li>
+              <li>
+                <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#exported">
+                android:exported</a></code>: Flag allowing other applications to use this provider.
+            </li>
+            <li>
+                <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#init">
+                android:initOrder</a></code>: The order in which this provider should be started,
+                relative to other providers in the same process.
+            </li>
+            <li>
+                <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#multi">
+                android:multiProcess</a></code>: Flag allowing the system to start the provider
+                in the same process as the calling client.
+            </li>
+            <li>
+                <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#proc">
+                android:process</a></code>: The name of the process in which the provider should
+                run.
+            </li>
+            <li>
+                <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#sync">
+                android:syncable</a></code>: Flag indicating that the provider's data is to be
+                sync'ed with data on a server.
+            </li>
+        </ul>
+        <p>
+            The attributes are fully documented in the dev guide topic for the
+            <code><a href="{@docRoot}guide/topics/manifest/provider-element.html">
+            &lt;provider&gt;</a></code>
+            element.
+        </p>
+    </dd>
+    <dt>
+        Informational attributes
+    </dt>
+    <dd>
+        An optional icon and label for the provider:
+        <ul>
+            <li>
+                <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#icon">
+                android:icon</a></code>: A drawable resource containing an icon for the provider.
+                The icon appears next to the provider's label in the list of apps in
+                <em>Settings</em> &gt; <em>Apps</em> &gt; <em>All</em>.
+            </li>
+            <li>
+                <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#label">
+                android:label</a></code>: An informational label describing the provider or its
+                data, or both. The label appears in the list of apps in
+                <em>Settings</em> &gt; <em>Apps</em> &gt; <em>All</em>.
+            </li>
+        </ul>
+        <p>
+            The attributes are fully documented in the dev guide topic for the
+            <code><a href="{@docRoot}guide/topics/manifest/provider-element.html">
+            &lt;provider&gt;</a></code> element.
+        </p>
+    </dd>
+</dl>
+
+<!-- Intent Access -->
+<h2 id="Intents">Intents and Data Access</h2>
+<p>
+    Applications can access a content provider indirectly with an {@link android.content.Intent}.
+    The application does not call any of the methods of {@link android.content.ContentResolver} or
+    {@link android.content.ContentProvider}. Instead, it sends an intent that starts an activity,
+    which is often part of the provider's own application. The destination activity is in charge of
+    retrieving and displaying the data in its UI. Depending on the action in the intent, the
+    destination activity may also prompt the user to make modifications to the provider's data.
+    An intent may also contain &quot;extras&quot; data that the destination activity displays
+    in the UI; the user then has the option of changing this data before using it to modify the
+    data in the provider.
+</p>
+<p>
+
+</p>
+<p>
+    You may want to use intent access to help ensure data integrity. Your provider may depend
+    on having data inserted, updated, and deleted according to strictly defined business logic. If
+    this is the case, allowing other applications to directly modify your data may lead to
+    invalid data. If you want developers to use intent access, be sure to document it thoroughly.
+    Explain to them why intent access using your own application's UI is better than trying to
+    modify the data with their code.
+</p>
+<p>
+    Handling an incoming intent that wishes to modify your provider's data is no different from
+    handling other intents. You can learn more about using intents by reading the topic
+    <a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and Intent Filters</a>.
+</p>
diff --git a/docs/html/guide/topics/providers/content-providers.jd b/docs/html/guide/topics/providers/content-providers.jd
index 95331ce..1707f03 100644
--- a/docs/html/guide/topics/providers/content-providers.jd
+++ b/docs/html/guide/topics/providers/content-providers.jd
@@ -1,922 +1,96 @@
 page.title=Content Providers
 @jd:body
-
 <div id="qv-wrapper">
 <div id="qv">
 
-<h2>In this document</h2>
+
+<!-- In this document -->
+<h2>Topics</h2>
 <ol>
-<li><a href="#basics">Content provider basics</a></li>
-<li><a href="#querying">Querying a content provider</a></li>
-<li><a href="#modifying">Modifying data in a provider</a></li>
-<li><a href="#creating">Creating a content provider</a></li>
-<li><a href="#urisum">Content URI summary</a></li>
+    <li>
+        <a href="{@docRoot}guide/topics/providers/content-provider-basics.html">
+        Content Provider Basics</a>
+    </li>
+    <li>
+        <a href="{@docRoot}guide/topics/providers/content-provider-creating.html">
+        Creating a Content Provider</a>
+    </li>
+    <li>
+        <a href="{@docRoot}guide/topics/providers/calendar-provider.html">Calendar Provider</a>
+    </li>
 </ol>
 
-<h2>Key classes</h2>
-<ol>
-<li>{@link android.content.ContentProvider}</li>
-<li>{@link android.content.ContentResolver}</li>
-<li>{@link android.database.Cursor}</li>
-</ol>
-
-<h2>See also</h2>
-<ol>
-  <li><a href="{@docRoot}guide/topics/providers/calendar-provider.html">Calendar Provider</a></li>
-</ol>
+    <!-- Related Samples -->
+<h2>Related Samples</h2>
+    <ol>
+        <li>
+            <a href="{@docRoot}resources/samples/ContactManager/index.html">
+            Contact Manager</a> application
+        </li>
+        <li>
+        <a
+        href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/List2.html">
+        &quot;Cursor (People)&quot;
+        </a>
+        </li>
+        <li>
+        <a
+        href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/List7.html">
+        &quot;Cursor (Phones)&quot;</a>
+        </li>
+    </ol>
 </div>
 </div>
-
 <p>
-Content providers store and retrieve data and make it accessible to all 
-applications.  They're the only way to share data across applications; there's 
-no common storage area that all Android packages can access.
-</p>   
-
-<p>
-Android ships with a number of content providers for common data types 
-(audio, video, images, personal contact information, and so on).  You can 
-see some of them listed in the {@link android.provider android.provider} 
-package.  You can query these providers for the data they contain (although,
-for some, you must acquire the proper permission to read the data).
-</p>   
-
-<p class="note"><strong>Note:</strong> Android 4.0 introduces the Calendar
-Provider. For more information, see <a
-href="{@docRoot}guide/topics/providers/calendar-provider.html">Calendar
-Provider</a>.</p>
-<p>
-If you want to make your own data public, you have two options:  You can 
-create your own content provider (a {@link android.content.ContentProvider} 
-subclass) or you can add the data to an existing provider &mdash; if there's 
-one that controls the same type of data and you have permission to write to it. 
-</p>   
-
-<p>
-This document is an introduction to using content providers.  After a 
-brief discussion of the fundamentals, it explores how to query a content 
-provider, how to modify data controlled by a provider, and how to create
-a content provider of your own.
-</p>   
-
-
-<h2><a name="basics"></a>Content Provider Basics</h2>
-
-<p>
-How a content provider actually stores its data under the covers is 
-up to its designer.  But all content providers implement a common interface 
-for querying the provider and returning results &mdash; as well as for 
-adding, altering, and deleting data.
-</p>   
-
-<p>
-It's an interface that clients use indirectly, most generally through 
-{@link android.content.ContentResolver} objects.  You get a ContentResolver 
-by calling <code>{@link android.content.Context#getContentResolver 
-getContentResolver()}</code> from within the implementation of an Activity 
-or other application component:
-</p>   
-
-<pre>ContentResolver cr = getContentResolver();</pre>
-
-<p>
-You can then use the ContentResolver's methods to interact with whatever 
-content providers you're interested in.
-</p>   
-
-<p>
-When a query is initiated, the Android system identifies the content provider 
-that's the target of the query and makes sure that it is up and running.  
-The system instantiates all ContentProvider objects; you never need to do it 
-on your own.  In fact, you never deal directly with ContentProvider objects 
-at all.  Typically, there's just a single instance of each type of 
-ContentProvider.  But it can communicate with multiple ContentResolver objects 
-in different applications and processes.  The interaction between processes is 
-handled by the ContentResolver and ContentProvider classes.
-</p>   
-
-
-<h3>The data model</h3>
-
-<p>
-Content providers expose their data as a simple table on a database model, 
-where each row is a record and each column is data of a particular type 
-and meaning.  For example, information about people and their phone numbers 
-might be exposed as follows: 
-</p>   
-
-<table>
-   <tr>
-      <th scope="col">_ID</th>
-      <th scope="col">NUMBER</th>
-      <th scope="col">NUMBER_KEY</th>
-      <th scope="col">LABEL</th>
-      <th scope="col">NAME</th>
-      <th scope="col">TYPE</th>
-   </tr>
-   <tr>
-      <td>13</td>
-      <td>(425) 555 6677</td>
-      <td>425 555 6677</td>
-      <td>Kirkland office</td>
-      <td>Bully Pulpit</td>
-      <td>{@code TYPE_WORK}</td>
-   </tr>
-   <tr>
-      <td>44</td>
-      <td>(212) 555-1234</td>
-      <td>212 555 1234</td>
-      <td>NY apartment</td>
-      <td>Alan Vain</td>
-      <td>{@code TYPE_HOME}</td>
-   </tr>
-   <tr>
-      <td>45</td>
-      <td>(212) 555-6657</td>
-      <td>212 555 6657</td>
-      <td>Downtown office</td>
-      <td>Alan Vain</td>
-      <td>{@code TYPE_MOBILE}</td>
-   </tr>
-   <tr>
-      <td>53</td>
-      <td>201.555.4433</td>
-      <td>201 555 4433</td>
-      <td>Love Nest</td>
-      <td>Rex Cars</td>
-      <td>{@code TYPE_HOME}</td>
-   </tr>
-</table>
-
-<p>
-Every record includes a numeric {@code _ID} field that uniquely identifies 
-the record within the table.  IDs can be used to match records in related 
-tables &mdash; for example, to find a person's phone number in one table 
-and pictures of that person in another.
-</p>   
-
-<p>
-A query returns a {@link android.database.Cursor} object that can move from 
-record to record and column to column to read the contents of each field.  
-It has specialized methods for reading each type of data.  So, to read a field, 
-you must know what type of data the field contains.  (There's more on query 
-results and Cursor objects later.)
-</p>   
-
-
-<h3><a name="uri"></a>URIs</h3>
-
-<p>
-Each content provider exposes a public URI (wrapped as a {@link android.net.Uri} 
-object) that uniquely identifies its data set.  A content provider that controls 
-multiple data sets (multiple tables) exposes a separate URI for each one.  All 
-URIs for providers begin with the string "{@code content://}".  The {@code content:} 
-scheme identifies the data as being controlled by a content provider.
-</p>   
-
-<p>
-If you're defining a content provider, it's a good idea to also define a 
-constant for its URI, to simplify client code and make future updates cleaner.  
-Android defines {@code CONTENT_URI} constants for all the providers that come 
-with the platform.  For example, the URI for the table that matches 
-phone numbers to people and the URI for the table that holds pictures of 
-people (both controlled by the Contacts content provider) are:
-</p>   
-
-<p>
-<p style="margin-left: 2em">{@code android.provider.Contacts.Phones.CONTENT_URI}
-<br/>{@code android.provider.Contacts.Photos.CONTENT_URI}
+    Content providers manage access to a structured set of data. They encapsulate the
+    data, and provide mechanisms for defining data security. Content providers are the standard
+    interface that connects data in one process with code running in another process.
 </p>
-
 <p>
-The URI constant is used in all interactions with the content provider. 
-Every {@link android.content.ContentResolver} method takes the URI 
-as its first argument.  It's what identifies which provider the ContentResolver 
-should talk to and which table of the provider is being targeted.
-</p>   
-
-
-<h2><a name="querying"></a>Querying a Content Provider</h2>
-
-<p>
-You need three pieces of information to query a content provider:
-</p>   
-
-<ul>
-<li>The URI that identifies the provider</li>
-<li>The names of the data fields you want to receive</li>
-<li>The data types for those fields</li>
-</ul>
-
-<p>
-If you're querying a particular record, you also need the ID for that record.
-</p>   
-
-
-<h3>Making the query</h3>
-
-<p>
-To query a content provider, you can use either the 
-<code>{@link android.content.ContentResolver#query ContentResolver.query()}</code> 
-method or the <code>{@link  android.app.Activity#managedQuery 
-Activity.managedQuery()}</code> method. 
-Both methods take the same set of arguments, and both return a 
-Cursor object.  However, {@code managedQuery()} 
-causes the activity to manage the life cycle of the Cursor.  A managed Cursor 
-handles all of the niceties, such as unloading itself when the activity pauses, 
-and requerying itself when the activity restarts.  You can ask an Activity to 
-begin managing an unmanaged Cursor object for you by calling 
-<code>{@link android.app.Activity#startManagingCursor 
-Activity.startManagingCursor()}</code>. 
-</p>   
-
-<p>
-The first argument to either <code>{@link android.content.ContentResolver#query query()}</code> 
-or <code>{@link android.app.Activity#managedQuery managedQuery()}</code> is the provider URI 
-&mdash; the {@code CONTENT_URI} constant that identifies a particular 
-ContentProvider and data set (see <a href="#uri">URIs</a> earlier).
-</p>   
-
-<p>
-To restrict a query to just one record, you can append the {@code _ID} value for 
-that record to the URI &mdash; that is, place a string matching the ID as the 
-last segment of the path part of the URI.  For example, if the ID is 23, 
-the URI would be:
-</p>   
-
-<p style="margin-left: 2em">{@code content://. . . ./23}</p>   
-
-<p>
-There are some helper methods, particularly 
-<code>{@link android.content.ContentUris#withAppendedId 
-ContentUris.withAppendedId()}</code> and <code>{@link 
-android.net.Uri#withAppendedPath Uri.withAppendedPath()}</code>, 
-that make it easy to append an ID to a URI.  Both are static methods that return 
-a Uri object with the ID added.  So, for example, if you were looking for record 
-23 in the database of people contacts, you might construct a query as follows:
-</p>   
-
-<pre>
-import android.provider.Contacts.People;
-import android.content.ContentUris;
-import android.net.Uri;
-import android.database.Cursor;
-
-// Use the ContentUris method to produce the base URI for the contact with _ID == 23.
-Uri myPerson = ContentUris.withAppendedId(People.CONTENT_URI, 23);
-
-// Alternatively, use the Uri method to produce the base URI.
-// It takes a string rather than an integer.
-Uri myPerson = Uri.withAppendedPath(People.CONTENT_URI, "23");
-
-// Then query for this specific record:
-Cursor cur = managedQuery(myPerson, null, null, null, null);
-</pre>
-
-<p>
-The other arguments to the <code>{@link android.content.ContentResolver#query query()}</code> 
-and <code>{@link android.app.Activity#managedQuery managedQuery()}</code> methods delimit 
-the query in more detail.  They are:
-</p>   
-
-<ul>
-<li>The names of the data columns that should be returned.  A {@code null} 
-value returns all columns.  Otherwise, only columns that are listed by name
-are returned.  All the content providers that come with the platform define 
-constants for their columns.  For example, the 
-{@link android.provider.Contacts.Phones android.provider.Contacts.Phones} class 
-defines constants for the names of the columns in the phone table illustrated 
-earlier &mdash; {@code _ID}, {@code NUMBER}, {@code NUMBER_KEY}, {@code NAME},
-and so on.</li>
-
-<li><p>A filter detailing which rows to return, formatted as an SQL {@code WHERE} 
-clause (excluding the {@code WHERE} itself).  A {@code null} value returns 
-all rows (unless the URI limits the query to a single record).</p></li>
-
-<li><p>Selection arguments.</p></li>
-
-<li><p>A sorting order for the rows that are returned, formatted as an SQL 
-{@code ORDER BY} clause (excluding the {@code ORDER BY} itself).  A {@code null} 
-value returns the records in the default order for the table, which may be
-unordered.</p></li>  
-</ul>
-
-<p>
-Let's look at an example query to retrieve a list of contact names and their 
-primary phone numbers:
+    When you want to access data in a content provider, you use the
+    {@link android.content.ContentResolver} object in your
+    application's {@link android.content.Context} to communicate with the provider as a client.
+    The {@link android.content.ContentResolver} object communicates with the provider object, an
+    instance of a class that implements {@link android.content.ContentProvider}. The provider
+    object receives data requests from clients, performs the requested action, and
+    returns the results.
 </p>
-
-<pre>
-import android.provider.Contacts.People;
-import android.database.Cursor;
-
-// Form an array specifying which columns to return. 
-String[] projection = new String[] {
-                             People._ID,
-                             People._COUNT,
-                             People.NAME,
-                             People.NUMBER
-                          };
-
-// Get the base URI for the People table in the Contacts content provider.
-Uri contacts =  People.CONTENT_URI;
-
-// Make the query. 
-Cursor managedCursor = managedQuery(contacts,
-                         projection, // Which columns to return 
-                         null,       // Which rows to return (all rows)
-                         null,       // Selection arguments (none)
-                         // Put the results in ascending order by name
-                         People.NAME + " ASC");
-</pre>
-
 <p>
-This query retrieves data from the People table of the Contacts content 
-provider.  It gets the name, primary phone number, and unique record ID for
-each contact.  It also reports the number of records that are returned as 
-the {@code _COUNT} field of each record.
+    You don't need to develop your own provider if you don't intend to share your data with
+    other applications. However, you do need your own provider to provide custom search
+    suggestions in your own application. You also need your own provider if you want to copy and
+    paste complex data or files from your application to other applications.
 </p>
-
 <p>
-The constants for the names of the columns are defined in various interfaces 
-&mdash; {@code _ID} and {@code _COUNT} in 
-{@link android.provider.BaseColumns BaseColumns}, {@code NAME} in {@link android.provider.Contacts.PeopleColumns PeopleColumns}, and {@code NUMBER} 
-in {@link android.provider.Contacts.PhonesColumns PhoneColumns}.  The 
-{@link android.provider.Contacts.People Contacts.People} class implements 
-each of these interfaces, which is why the code example above could refer 
-to them using just the class name. 
+    Android itself includes content providers that manage data such as audio, video, images, and
+    personal contact information. You can see some of them listed in the reference
+    documentation for the
+    <code><a href="{@docRoot}reference/android/provider/package-summary.html">android.provider</a>
+    </code> package. With some restrictions, these providers are accessible to any Android
+    application.
+</p><p>
+    The following topics describe content providers in more detail:
 </p>
-
-
-<h3>What a query returns</h3>
-
-<p>
-A query returns a set of zero or more database records.  The names of the 
-columns, their default order, and their data types are specific to each 
-content provider. 
-But every provider has an {@code _ID} column, which holds a unique numeric 
-ID for each record.  Every provider can also report the number
-of records returned as the {@code _COUNT} column; its value 
-is the same for all rows. 
-</p>
-
-<p> 
-Here is an example result set for the query in the previous section:
-</p>
-
-<table border="1">
-   <tbody>
-      <tr>
-         <th scope="col">_ID</th>
-         <th scope="col">_COUNT</th>
-         <th scope="col">NAME</th>
-         <th scope="col">NUMBER</th>     
-      </tr>
-      <tr>
-         <td>44</td>
-         <td>3</td>
-         <td>Alan Vain</td>
-         <td>212 555 1234</td>   
-      </tr>
-      <tr>
-         <td>13</td>
-         <td>3</td>
-         <td>Bully Pulpit</td>
-         <td>425 555 6677</td>   
-      </tr>
-      <tr>
-         <td>53</td>
-         <td>3</td>
-         <td>Rex Cars</td>
-         <td>201 555 4433</td>
-      </tr>
-   </tbody>
-</table>
-
-<p>
-The retrieved data is exposed by a {@link android.database.Cursor Cursor} 
-object that can be used to iterate backward or forward through the result 
-set.  You can use this object only to read the data.  To add, modify, or 
-delete data, you must use a ContentResolver object.
-</p>
-
-
-<h3>Reading retrieved data</h3>
-
-<p>
-The Cursor object returned by a query provides access to a recordset of
-results.  If you have queried for a specific record by ID, this set will
-contain only one value.  Otherwise, it can contain multiple values.  
-(If there are no matches, it can also be empty.)  You 
-can read data from specific fields in the record, but you must know the 
-data type of the field, because the Cursor object has a separate method
-for reading each type of data &mdash; such as <code>{@link 
-android.database.Cursor#getString getString()}</code>, <code>{@link 
-android.database.Cursor#getInt getInt()}</code>, and <code>{@link 
-android.database.Cursor#getFloat getFloat()}</code>.  
-(However, for most types, if you call the method for reading strings, 
-the Cursor object will give you the String representation of the data.)  
-The Cursor lets you request the column name from the index of the column, 
-or the index number from the column name.
-</p>
-
-<p>
-The following snippet demonstrates reading names and phone numbers from
-the query illustrated earlier:
-</p>
-
-<pre>
-import android.provider.Contacts.People;
-
-private void getColumnData(Cursor cur){ 
-    if (cur.moveToFirst()) {
-
-        String name; 
-        String phoneNumber; 
-        int nameColumn = cur.getColumnIndex(People.NAME); 
-        int phoneColumn = cur.getColumnIndex(People.NUMBER);
-        String imagePath; 
-    
-        do {
-            // Get the field values
-            name = cur.getString(nameColumn);
-            phoneNumber = cur.getString(phoneColumn);
-           
-	    // Do something with the values. 
-            ... 
-
-        } while (cur.moveToNext());
-
-    }
-}
-</pre>
-
-<p>
-If a query can return binary data, such as an image or sound, the data 
-may be directly entered in the table or the table entry for that data may be
-a string specifying a {@code content:} URI that you can use to get the data.  
-In general, smaller amounts of data (say, from 20 to 50K or less) are most often 
-directly entered in the table and can be read by calling 
-<code>{@link android.database.Cursor#getBlob Cursor.getBlob()}</code>.  
-It returns a byte array.
-</p>
-  
-<p>
-If the table entry is a {@code content:} URI, you should never try to open 
-and read the file directly (for one thing, permissions problems can make this 
-fail).  Instead, you should call 
-<code>{@link android.content.ContentResolver#openInputStream 
-ContentResolver.openInputStream()}</code> to get an 
-{@link java.io.InputStream} object that you can use to read the data.  
-</p>
-
-
-<h2><a name="modifying"></a>Modifying Data</h2>
-
-<p>
-Data kept by a content provider can be modified by:
-</p>
-
-<ul>
-<p><li>Adding new records</li>
-<li>Adding new values to existing records</li>
-<li>Batch updating existing records</li>
-<li>Deleting records</li>
-</ul>
-
-<p>
-All data modification is accomplished using {@link android.content.ContentResolver}
-methods.  Some content providers require a more restrictive permission for writing
-data than they do for reading it.  If you don't have permission to write to a 
-content provider, the ContentResolver methods will fail.
-</p>
-
-
-<h3>Adding records</h3>
-
-<p>
-To add a new record to a content provider, first set up a map of key-value pairs 
-in a {@link android.content.ContentValues} object, where each key matches 
-the name of a column in the content provider and the value is the desired 
-value for the new record in that column.  Then call <code>{@link 
-android.content.ContentResolver#insert ContentResolver.insert()}</code> and pass 
-it the URI of the provider and the ContentValues map.  This method returns 
-the full URI of the new record &mdash; that is, the provider's URI with 
-the appended ID for the new record.  You can then use this URI to query and 
-get a Cursor over the new record, and to further modify the record.  
-Here's an example:
-</p>
-
-<pre>
-import android.provider.Contacts.People;
-import android.content.ContentResolver;
-import android.content.ContentValues; 
-
-ContentValues values = new ContentValues();
-
-// Add Abraham Lincoln to contacts and make him a favorite.
-values.put(People.NAME, "Abraham Lincoln");
-// 1 = the new contact is added to favorites
-// 0 = the new contact is not added to favorites
-values.put(People.STARRED, 1);
-
-Uri uri = getContentResolver().insert(People.CONTENT_URI, values);
-</pre>
-
-
-<h3>Adding new values</h3>
-
-<p>
-Once a record exists, you can add new information to it or modify 
-existing information.  For example, the next step in the example above would 
-be to add contact information &mdash; like a phone number or an IM or e-mail 
-address &mdash; to the new entry.  
-</p>
-
-<p>
-The best way to add to a record in the Contacts database is to append 
-the name of the table where the new data goes to the URI for the 
-record, then use the amended URI to add the new data values.  Each
-Contacts table exposes a name for this purpose as a {@code 
-CONTENT_DIRECTORY} constant.  The following code continues the previous 
-example by adding a phone number and e-mail address for the record
-just created:
-</p>
-
-<pre>
-Uri phoneUri = null;
-Uri emailUri = null;
-
-// Add a phone number for Abraham Lincoln.  Begin with the URI for
-// the new record just returned by insert(); it ends with the _ID
-// of the new record, so we don't have to add the ID ourselves.
-// Then append the designation for the phone table to this URI,
-// and use the resulting URI to insert the phone number.
-phoneUri = Uri.withAppendedPath(uri, People.Phones.CONTENT_DIRECTORY);
-
-values.clear();
-values.put(People.Phones.TYPE, People.Phones.TYPE_MOBILE);
-values.put(People.Phones.NUMBER, "1233214567");
-getContentResolver().insert(phoneUri, values);
-
-// Now add an email address in the same way.
-emailUri = Uri.withAppendedPath(uri, People.ContactMethods.CONTENT_DIRECTORY);
-
-values.clear();
-// ContactMethods.KIND is used to distinguish different kinds of
-// contact methods, such as email, IM, etc. 
-values.put(People.ContactMethods.KIND, Contacts.KIND_EMAIL);
-values.put(People.ContactMethods.DATA, "test@example.com");
-values.put(People.ContactMethods.TYPE, People.ContactMethods.TYPE_HOME);
-getContentResolver().insert(emailUri, values);   
-</pre>
-
-<p>
-You can place small amounts of binary data into a table by calling 
-the version of <code>{@link android.content.ContentValues#put 
-ContentValues.put()}</code> that takes a byte array.  
-That would work for a small icon-like image or a short audio clip, for example.  
-However, if you have a large amount of binary data to add, such as a photograph
-or a complete song, put a {@code content:} URI for the data in the table and call
-<code>{@link android.content.ContentResolver#openOutputStream 
-ContentResolver.openOutputStream()}</code> 
-with the file's URI.  (That causes the content provider to store the data 
-in a file and record the file path in a hidden field of the record.)
-</p>
-
-<p>
-In this regard, the {@link android.provider.MediaStore} content 
-provider, the main provider that dispenses image, audio, and video 
-data, employs a special convention:  The same URI that is used with 
-{@code query()} or {@code managedQuery()} to get meta-information 
-about the binary data (such as, the caption of a photograph or the
-date it was taken) is used with {@code openInputStream()} 
-to get the data itself.  Similarly, the same URI that is used with
-{@code insert()} to put meta-information into a MediaStore record 
-is used with {@code openOutputStream()} to place the binary data there.
-The following code snippet illustrates this convention:
-</p>
-
-<pre>
-import android.provider.MediaStore.Images.Media;
-import android.content.ContentValues;
-import java.io.OutputStream;
-
-// Save the name and description of an image in a ContentValues map.  
-ContentValues values = new ContentValues(3);
-values.put(Media.DISPLAY_NAME, "road_trip_1");
-values.put(Media.DESCRIPTION, "Day 1, trip to Los Angeles");
-values.put(Media.MIME_TYPE, "image/jpeg");
-
-// Add a new record without the bitmap, but with the values just set.
-// insert() returns the URI of the new record.
-Uri uri = getContentResolver().insert(Media.EXTERNAL_CONTENT_URI, values);
-
-// Now get a handle to the file for that record, and save the data into it.
-// Here, sourceBitmap is a Bitmap object representing the file to save to the database.
-try {
-    OutputStream outStream = getContentResolver().openOutputStream(uri);
-    sourceBitmap.compress(Bitmap.CompressFormat.JPEG, 50, outStream);
-    outStream.close();
-} catch (Exception e) {
-    Log.e(TAG, "exception while writing image", e);
-}
-</pre>
-
-
-<h3>Batch updating records</h3>
-
-<p>
-To batch update a group of records (for example, to change "NY" to "New York" 
-in all fields), call the <code>{@link 
-android.content.ContentResolver#update ContentResolver.update()}</code> 
-method with the columns and values to change.
-</p>
-
-
-<h3><a name="deletingrecord"></a>Deleting a record</h3>
-
-<p>
-To delete a single record, call {<code>{@link 
-android.content.ContentResolver#delete ContentResolver.delete()}</code> 
-with the URI of a specific row.
-</p>
-
-<p>
-To delete multiple rows, call <code>{@link 
-android.content.ContentResolver#delete ContentResolver.delete()}</code> 
-with the URI of the type of record to delete (for example, {@code android.provider.Contacts.People.CONTENT_URI}) and an SQL {@code WHERE} 
-clause defining which rows to delete.  (<i><b>Caution</b>: 
-Be sure to include a valid {@code WHERE} clause if you're deleting a general 
-type, or you risk deleting more records than you intended!</i>).
-</p>
-
-
-<h2><a name="creating"></a>Creating a Content Provider</h2>
-
-<p>
-To create a content provider, you must:
-</p>
-
-<ul>
-<li>Set up a system for storing the data.  Most content providers 
-store their data using Android's file storage methods or SQLite databases, 
-but you can store your data any way you want.  Android provides the
-{@link android.database.sqlite.SQLiteOpenHelper SQLiteOpenHelper}
-class to help you create a database and {@link 
-android.database.sqlite.SQLiteDatabase SQLiteDatabase} to manage it.</li>
-
-<li><p>Extend the {@link android.content.ContentProvider} class to provide 
-access to the data.</p></li>
-
-<li><p>Declare the content provider in the manifest file for your 
-application (AndroidManifest.xml).</p></li>
-</ul>
-
-<p>
-The following sections have notes on the last two of these tasks.
-</p>
-
-
-<h3>Extending the ContentProvider class</h3>
-
-<p>
-You define a {@link android.content.ContentProvider} subclass to 
-expose your data to others using the conventions expected by 
-ContentResolver and Cursor objects.  Principally, this means 
-implementing six abstract methods declared in the ContentProvider class:
-</p>
-
-<p style="margin-left: 2em">{@code query()}
-<br/>{@code insert()}
-<br/>{@code update()}
-<br/>{@code delete()}
-<br/>{@code getType()}
-<br/>{@code onCreate()}</p>
-
-<p>
-The {@code query()} method must return a {@link android.database.Cursor} object 
-that can iterate over the requested data.  Cursor itself is an interface, but
-Android provides some ready-made Cursor objects that you can use.  For example,
-{@link android.database.sqlite.SQLiteCursor} can iterate over data stored in
-an SQLite database.  You get the Cursor object by calling any of the {@link 
-android.database.sqlite.SQLiteDatabase SQLiteDatabase} class's {@code query()}
-methods.  There are other Cursor implementations &mdash; such as {@link 
-android.database.MatrixCursor} &mdash; for data not stored in a database.
-</p>
-
-<p>
-Because these ContentProvider methods can be called from 
-various ContentResolver objects in different processes and threads, 
-they must be implemented in a thread-safe manner. 
-</p>
-
-<p>
-As a courtesy, you might also want to call <code>{@link android.content.ContentResolver#notifyChange(android.net.Uri,android.database.ContentObserver)
-ContentResolver.notifyChange()}</code> to notify listeners when there are 
-modifications to the data. 
-</p>
-
-<p>
-Beyond defining the subclass itself, there are other steps you should take
-to simplify the work of clients and make the class more accessible: 
-</p>
-
-<ul>
-<li>Define a {@code public static final} {@link android.net.Uri} 
-named {@code CONTENT_URI}.  This is the string that represents the full 
-{@code content:} URI that your content provider handles.  You must define a 
-unique string for this value.  The best solution is to use the fully-qualified 
-class name of the content provider (made lowercase).  So, for example, the 
-URI for a TransportationProvider class could be defined as follows:
-
-<pre>public static final Uri CONTENT_URI = 
-               Uri.parse("content://com.example.codelab.transportationprovider");</pre>
-
-<p>
-If the provider has subtables, also define {@code CONTENT_URI} constants for
-each of the subtables.  These URIs should all have the same authority (since
-that identifies the content provider), and be distinguished only by their paths. 
-For example:
-</p>
-
-<p style="margin-left: 2em">{@code content://com.example.codelab.transportationprovider/train} 
-<br/>{@code content://com.example.codelab.transportationprovider/air/domestic}
-<br/>{@code content://com.example.codelab.transportationprovider/air/international}</p>
-
-<p>
-For an overview of {@code content:} URIs, see the <a href="#urisum">Content URI 
-Summary</a> at the end of this document.
-</p></li>
-
-<li><p>Define the column names that the content provider will return to clients. 
-If you are using an underlying database, these column names are typically 
-identical to the SQL database column names they represent.  Also define
-{@code public static} String constants that clients can use to specify 
-the columns in queries and other instructions.
-</p>
-
-<p>
-Be sure to include an integer column named "{@code _id}" 
-(with the constant {@code _ID}) for 
-the IDs of the records.  You should have this field whether or not you have 
-another field (such as a URL) that is also unique among all records.  If 
-you're using the SQLite database, the {@code _ID} field should be the 
-following type:
-</p>
-
-<p style="margin-left: 2em">{@code INTEGER PRIMARY KEY AUTOINCREMENT}</p>
-
-<p>
-The {@code AUTOINCREMENT} descriptor is optional.  But without it, SQLite
-increments an ID counter field to the next number above the largest
-existing number in the column.  If you delete the last row, the next row added
-will have the same ID as the deleted row.  {@code AUTOINCREMENT} avoids this 
-by having SQLite increment to the next largest value whether deleted or not.
-</p>
-</li>
-
-<li><p>Carefully document the data type of each column.  Clients need this
-information to read the data.</p></li>
-
-<li><p>If you are handling a new data type, you must define a new MIME type 
-to return in your implementation of <code>{@link 
-android.content.ContentProvider#getType ContentProvider.getType()}</code>.  
-The type depends in part on whether or not the {@code content:} URI submitted 
-to {@code getType()} limits the request to a specific record.  There's one 
-form of the MIME type for a single record and another for multiple records.  
-Use the {@link android.net.Uri Uri} methods to help determine what is being 
-requested.  Here is the general format for each type:</p></li>
-
-<ul>
-<li><p>For a single record:&nbsp;&nbsp;&nbsp; {@code vnd.android.cursor.item/vnd.<em>yourcompanyname.contenttype</em>}</p>
-
-<p>For example, a request for train record 122, like this URI,</p>
-<p style="margin-left: 2em">{@code content://com.example.transportationprovider/trains/122}</p>
-
-<p>might return this MIME type:</p>
-<p style="margin-left: 2em">{@code vnd.android.cursor.item/vnd.example.rail}</p>
-</li>
-
-<li><p>For multiple records:&nbsp;&nbsp;&nbsp; {@code vnd.android.cursor.dir/vnd.<em>yourcompanyname.contenttype</em>}</p>
-
-<p>For example, a request for all train records, like the following URI,</p>
-<p style="margin-left: 2em">{@code content://com.example.transportationprovider/trains}</p>
-
-<p>might return this MIME type:</p>
-<p style="margin-left: 2em">{@code vnd.android.cursor.dir/vnd.example.rail}</p>
-</li>
-</ul>
-
-<li><p>If you are exposing byte data that's too big to put in the table itself
-&mdash; such as a large bitmap file &mdash; the field that exposes the
-data to clients should actually contain a {@code content:} URI string.
-This is the field that gives clients access to the data file.  The record 
-should also have another field, named "{@code _data}" that lists the exact file 
-path on the device for that file.  This field is not intended to be read by 
-the client, but by the ContentResolver.  The client will call <code>{@link 
-android.content.ContentResolver#openInputStream ContentResolver.openInputStream()}</code> 
-on the user-facing field holding the URI for the item.  The ContentResolver 
-will request the "{@code _data}" field for that record, and because
-it has higher permissions than a client, it should be able to access
-that file directly and return a read wrapper for the file to the client.</p></li>
-
-</ul>
-
-<p>
-For an example of a private content provider implementation, see the 
-NodePadProvider class in the Notepad sample application that ships with the SDK.
-</p>
-
-
-<h3>Declaring the content provider</h3>
-
-<p>
-To let the Android system know about the content provider you've developed, 
-declare it with a {@code &lt;provider&gt;} element in the application's 
-AndroidManifest.xml file.  Content providers that are not declared in the
-manifest are not visible to the Android system
-</p>
-
-<p>
-The {@code name} attribute is the fully qualified name of the ContentProvider
-subclass.  The {@code authorities} attribute is the authority part of the 
-{@code content:} URI that identifies the provider.
-For example if the ContentProvider subclass is AutoInfoProvider, the 
-{@code &lt;provider&gt;} element might look like this:
-</p>
-
-<pre>
-&lt;provider android:name="com.example.autos.AutoInfoProvider"
-          android:authorities="com.example.autos.autoinfoprovider" 
-          . . . /&gt
-&lt;/provider&gt;
-</pre>
-
-<p>
-Note that the {@code authorities} attribute omits the path part of a 
-{@code content:} URI.  For example, if AutoInfoProvider controlled subtables
-for different types of autos or different manufacturers,
-</p>
-
-<p style="margin-left: 2em">{@code content://com.example.autos.autoinfoprovider/honda}
-<br/>{@code content://com.example.autos.autoinfoprovider/gm/compact}
-<br/>{@code content://com.example.autos.autoinfoprovider/gm/suv}</p>
-
-<p>
-those paths would not be declared in the manifest.  The authority is what 
-identifies the provider, not the path; your provider can interpret the path 
-part of the URI in any way you choose.
-</p>
-
-<p>
-Other {@code &lt;provider&gt;} attributes can set permissions to read and 
-write data, provide for an icon and text that can be displayed to users, 
-enable and disable the provider, and so on.  Set the {@code multiprocess} 
-attribute to "{@code true}" if data does not need to be synchronized between 
-multiple running versions of the content provider.  This permits an instance 
-of the provider to be created in each client process, eliminating the need 
-to perform IPC. 
-</p>
-
-
-<h2><a name="urisum"></a>Content URI Summary</h2>
-
-<p>
-Here is a recap of the important parts of a content URI:
-</p>
-
-<p>
-<img src="{@docRoot}images/content_uri.png" alt="Elements of a content URI" 
-height="80" width="528">
-</p>
-
-<ol type="A">
-<li>Standard prefix indicating that the data is controlled by a
-content provider. It's never modified.</li>
-
-<li><p>The authority part of the URI; it identifies the content provider. 
-For third-party applications, this should be a fully-qualified class name 
-(reduced to lowercase) to ensure uniqueness.  The authority is declared in 
-the {@code &lt;provider&gt;} element's {@code authorities} attribute:</p>
-
-<pre>&lt;provider android:name=".TransportationProvider"
-          android:authorities="com.example.transportationprovider"
-          . . .  &gt;</pre></li>
-
-<li><p>The path that the content provider uses to determine what kind of data is
-being requested.  This can be zero or more segments long.  If the content provider
-exposes only one type of data (only trains, for example), it can be absent.
-If the provider exposes several types, including subtypes, it can be several 
-segments long &mdash; for example, "{@code land/bus}", "{@code land/train}", 
-"{@code sea/ship}", and "{@code sea/submarine}" to give four possibilities.</p></li>
-
-<li><p>The ID of the specific record being requested, if any.  This is the 
-{@code _ID} value of the requested record.  If the request is not limited to
-a single record, this segment and the trailing slash are omitted:</p>
-
-<p style="margin-left: 2em">{@code content://com.example.transportationprovider/trains}</p>
-</li>
-</ol>
-
-
+<dl>
+    <dt>
+        <strong><a href="{@docRoot}guide/topics/providers/content-provider-basics.html">
+        Content Provider Basics</a></strong>
+    </dt>
+    <dd>
+        How to access data in a content provider when the data is organized in tables.
+    </dd>
+    <dt>
+        <strong><a href="{@docRoot}guide/topics/providers/content-provider-creating.html">
+        Creating a Content Provider</a></strong>
+    </dt>
+    <dd>
+        How to create your own content provider.
+    </dd>
+    <dt>
+        <strong><a href="{@docRoot}guide/topics/providers/calendar-provider.html">
+        Calendar Provider</a></strong>
+    </dt>
+    <dd>
+        How to access the Calendar Provider that is part of the Android platform.
+    </dd>
+</dl>
diff --git a/docs/html/guide/topics/renderscript/compute.jd b/docs/html/guide/topics/renderscript/compute.jd
index 8f08f59..e827f00 100644
--- a/docs/html/guide/topics/renderscript/compute.jd
+++ b/docs/html/guide/topics/renderscript/compute.jd
@@ -1,38 +1,253 @@
 page.title=Compute
-parent.title=RenderScript
+parent.title=Renderscript
 parent.link=index.html
+
 @jd:body
 
-  <div id="qv-wrapper">
-    <div id="qv">
+<div id="qv-wrapper">
+  <div id="qv">
+    <h2>In this document</h2>
 
-      <h2>Related Samples</h2>
+    <ol>
+      <li>
+        <a href="#creating">Creating a Compute Renderscript</a>
 
-      <ol>
-        <li><a href="{@docRoot}resources/samples/RenderScript/HelloCompute/index.html">Hello
-        Compute</a></li>
-        <li><a href="{@docRoot}resources/samples/RenderScript/Balls/index.html">Balls</a></li>
-      </ol>
-    </div>
+        <ol>
+          <li><a href="#creating-renderscript">Creating the Renderscript file</a></li>
+
+          <li><a href="#calling">Calling the Renderscript code</a></li>
+        </ol>
+      </li>
+    </ol>
+
+    <h2>Related Samples</h2>
+
+    <ol>
+      <li><a href="{@docRoot}resources/samples/RenderScript/HelloCompute/index.html">Hello
+      Compute</a></li>
+
+      <li><a href="{@docRoot}resources/samples/RenderScript/Balls/index.html">Balls</a></li>
+    </ol>
   </div>
+</div>
 
-  <p>RenderScript exposes a set of compute APIs that you can use to do intensive computational operations.
-  You can use the compute APIs in the context of a graphics RenderScript such as calculating the
-  transformation of many geometric objects in a scene. You can also create a standalone compute RenderScript that does not
-  draw anything to the screen such as bitmap image processing for a photo editor application.
-  The RenderScript compute APIs are mainly defined in the <code>rs_cl.rsh</code> header</p>
-  
-  <p>Compute RenderScripts are simpler to setup and implement as there is no graphics rendering involved.
-  You can offload computational aspects of your application to RenderScript by creating a native RenderScript
-  file (.rs) and using the generated reflected layer class to call functions in the <code>.rs</code> file. 
+<p>Renderscript exposes a set of compute APIs that you can use to do intensive computational
+operations. You can use the compute APIs in the context of a graphics Renderscript such as
+calculating the positions of many objects in a scene. You can also create standalone compute
+Renderscripts such as one that does image processing for a photo editor application.</p>
 
-  <p>See the <a href="{@docRoot}resources/samples/RenderScript/HelloCompute/index.html">HelloCompute</a>
-  sample in the Android SDK for more
-  information on how to create a simple compute RenderScript.</p>
-  <p>  
-  See the <a href="{@docRoot}resources/samples/RenderScript/Balls/index.html">Balls</a>
-  sample in the Android SDK for more
-  information on how to create a compute RenderScript that is used in a graphics RenderScript.
-  The compute RenderScript is contained in 
-  <a href="{@docRoot}resources/samples/RenderScript/Balls/src/com/example/android/rs/balls/ball_physics.html">balls_physics.rs</a>.
-  </p>
\ No newline at end of file
+<p>Compute Renderscripts scale to the amount of
+processing cores available on the device. This is enabled through a function named
+<code>rsForEach()</code> (or the <code>forEach_root()</code> method at the Android framework level).
+that automatically partitions work across available processing cores on the device. 
+For now, compute Renderscripts can only take advantage of CPU
+cores, but in the future, they can potentially run on other types of processors such as GPUs and
+DSPs.</p>
+
+<h2 id="creating-renderscript">Creating a Compute Renderscript</h2>
+
+<p>Implementing a compute Renderscript creating a <code>.rs</code> file that contains
+your Renderscript code and calling it at the Android framework level with the
+<code>forEach_root()</code> or at the Renderscript runtime level with the
+<code>rsForEach()</code> function. The following diagram describes how a typical compute
+Renderscript is set up:</p><img src="{@docRoot}images/rs_compute.png">
+
+<p class="img-caption"><strong>Figure 1.</strong> Compute Renderscript overview</p>
+
+<p>The following sections describe how to create a simple compute Renderscript and use it in an
+Android application. This example uses the <a href=
+"{@docRoot}resources/samples/RenderScript/HelloCompute/index.html">HelloCompute Renderscript
+sample</a> that is provided in the SDK as a guide (some code has been modified from its original
+form for simplicity).</p>
+
+<h3 id="creating-renderscript">Creating the Renderscript file</h3>
+
+<p>Your Renderscript code resides in <code>.rs</code> and <code>.rsh</code> files in the
+<code>&lt;project_root&gt;/src/</code> directory. This code contains the compute logic
+and declares all necessary variables and pointers.
+Every compute <code>.rs</code> file generally contains the following items:</p>
+
+<ul>
+  <li>A pragma declaration (<code>#pragma rs java_package_name(<em>package.name</em>)</code>)
+  that declares the package name of the <code>.java</code> reflection of this Renderscript.</li>
+
+  <li>A pragma declaration (<code>#pragma version(1)</code>) that declares the version of
+  Renderscript that you are using (1 is the only value for now).</li>
+
+  <li>A <code>root()</code> function that is the main worker function. The root function is
+  called by the <code>rsForEach</code> function, which allows the Renderscript code to be called and
+  executed on multiple cores if they are available. The <code>root()</code> function must return
+  <code>void</code> and accept the following arguments:
+
+    <ul>
+      <li>Pointers to memory allocations that are used for the input and output of the compute
+      Renderscript. Both of these pointers are required for Android 3.2 (API level 13) platform
+      versions or older. Android 4.0 (API level 14) and later requires one or both of these
+      allocations.</li>
+    </ul>
+
+    <p>The following arguments are optional, but both must be supplied if you choose to use
+    them:</p>
+
+    <ul>
+      <li>A pointer for user-defined data that the Renderscript might need to carry out
+      computations in addition to the necessary allocations. This can be a pointer to a simple
+      primitive or a more complex struct.</li>
+
+      <li>The size of the user-defined data.</li>
+    </ul>
+  </li>
+
+  <li>An optional <code>init()</code> function. This allows you to do any initialization 
+  before the <code>root()</code> function runs, such as initializing variables. This
+  function runs once and is called automatically when the Renderscript starts, before anything
+  else in your Renderscript.</li>
+
+  <li>Any variables, pointers, and structures that you wish to use in your Renderscript code (can
+  be declared in <code>.rsh</code> files if desired)</li>
+</ul>
+
+<p>The following code shows how the <a href=
+"{@docRoot}resources/samples/RenderScript/HelloCompute/src/com/example/android/rs/hellocompute/mono.html">
+mono.rs</a> file is implemented:</p>
+<pre>
+#pragma version(1)
+#pragma rs java_package_name(com.example.android.rs.hellocompute)
+
+//multipliers to convert a RGB colors to black and white
+const static float3 gMonoMult = {0.299f, 0.587f, 0.114f};
+
+void root(const uchar4 *v_in, uchar4 *v_out) {
+  //unpack a color to a float4
+  float4 f4 = rsUnpackColor8888(*v_in);
+  //take the dot product of the color and the multiplier
+  float3 mono = dot(f4.rgb, gMonoMult);
+  //repack the float to a color
+  *v_out = rsPackColorTo8888(mono);
+}
+</pre>
+
+<h3 id="calling">Calling the Renderscript code</h3>
+
+<p>You can do Renderscript to Renderscript calls with <code>rsForEach</code> in situations
+such as when a graphics Renderscript needs to do a lot of computational operations. The Renderscript
+<a href="{@docRoot}resources/samples/RenderScript/Balls/index.html">Balls</a> sample shows how
+this is setup. The <a href=
+"resources/samples/RenderScript/Balls/src/com/example/android/rs/balls/balls.html">balls.rs</a>
+graphics Renderscript calls the <a href=
+"resources/samples/RenderScript/Balls/src/com/example/android/rs/balls/balls.html">balls_physics.rs</a>
+compute Renderscript to calculate the location of the balls that are rendered to the screen.</p>
+
+<p>Another way to use a compute Renderscript is to call it from your Android framework code by
+creating a Renderscript object by instantiating the (<code>ScriptC_<em>script_name</em></code>)
+class. This class contains a method, <code>forEach_root()</code>, that lets you invoke
+<code>rsForEach</code>. You give it the same parameters that you would if you were invoking it
+at the Renderscript runtime level. This technique allows your Android application to offload
+intensive mathematical calculations to Renderscript. See the <a href=
+"{@docRoot}resources/samples/RenderScript/HelloCompute/index.html">HelloCompute</a> sample to see
+how a simple Android application can utilize a compute Renderscript.</p>
+
+<p>To call a compute Renderscript at the Android framework level:</p>
+
+<ol>
+  <li>Allocate memory that is needed by the compute Renderscript in your Android framework code.
+  You need an input and output {@link android.renderscript.Allocation} for Android 3.2 (API level
+  13) platform versions and older. The Android 4.0 (API level 14) platform version requires only
+  one or both {@link android.renderscript.Allocation}s.</li>
+
+  <li>Create an instance of the <code>ScriptC_<em>script_name</em></code> class.</li>
+
+  <li>Call <code>forEach_root()</code>, passing in the allocations, the
+  Renderscript, and any optional user-defined data. The output allocation will contain the output
+  of the compute Renderscript.</li>
+</ol>
+
+<p>In the following example, taken from the <a href=
+"{@docRoot}resources/samples/RenderScript/HelloCompute/index.html">HelloCompute</a> sample, processes
+a bitmap and outputs a black and white version of it. The
+<code>createScript()</code> method carries out the steps described previously. This method the compute
+Renderscript, <code>mono.rs</code>, passing in memory allocations that store the bitmap to be processed
+as well as the eventual output bitmap. It then displays the processed bitmap onto the screen:</p>
+<pre>
+package com.example.android.rs.hellocompute;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.graphics.BitmapFactory;
+import android.graphics.Bitmap;
+import android.renderscript.RenderScript;
+import android.renderscript.Allocation;
+import android.widget.ImageView;
+
+public class HelloCompute extends Activity {
+  private Bitmap mBitmapIn;
+  private Bitmap mBitmapOut;
+
+  private RenderScript mRS;
+  private Allocation mInAllocation;
+  private Allocation mOutAllocation;
+  private ScriptC_mono mScript;
+
+  &#064;Override
+  protected void onCreate(Bundle savedInstanceState) {
+      super.onCreate(savedInstanceState);
+      setContentView(R.layout.main);
+
+      mBitmapIn = loadBitmap(R.drawable.data);
+      mBitmapOut = Bitmap.createBitmap(mBitmapIn.getWidth(), mBitmapIn.getHeight(),
+                                       mBitmapIn.getConfig());
+
+      ImageView in = (ImageView) findViewById(R.id.displayin);
+      in.setImageBitmap(mBitmapIn);
+
+      ImageView out = (ImageView) findViewById(R.id.displayout);
+      out.setImageBitmap(mBitmapOut);
+
+      createScript();
+  }
+  private void createScript() {
+      mRS = RenderScript.create(this);
+      mInAllocation = Allocation.createFromBitmap(mRS, mBitmapIn,
+          Allocation.MipmapControl.MIPMAP_NONE,
+          Allocation.USAGE_SCRIPT);
+      mOutAllocation = Allocation.createTyped(mRS, mInAllocation.getType());
+      mScript = new ScriptC_mono(mRS, getResources(), R.raw.mono);
+      mScript.forEach_root(mInAllocation, mOutAllocation);
+      mOutAllocation.copyTo(mBitmapOut);
+  }
+
+  private Bitmap loadBitmap(int resource) {
+      final BitmapFactory.Options options = new BitmapFactory.Options();
+      options.inPreferredConfig = Bitmap.Config.ARGB_8888;
+      return BitmapFactory.decodeResource(getResources(), resource, options);
+  }
+}
+</pre>
+
+<p>To call a compute Renderscript from another Renderscript file:</p>
+<ol>
+ <li>Allocate memory that is needed by the compute Renderscript in your Android framework code.
+  You need an input and output {@link android.renderscript.Allocation} for Android 3.2 (API level
+  13) platform versions and older. The Android 4.0 (API level 14) platform version requires only
+  one or both {@link android.renderscript.Allocation}s.</li>
+
+  <li>Call <code>rsForEach()</code>, passing in the allocations and any optional user-defined data.
+  The output allocation will contain the output of the compute Renderscript.</li>
+</ol>
+<p>The following example, taken from the <a href=
+"{@docRoot}resources/samples/RenderScript/Balls/src/com/example/android/rs/balls/balls.html">Renderscript
+Balls sample</a>, demonstrates how to do make a script to script call:</p>
+<pre>
+rs_script script;
+rs_allocation in_allocation;
+rs_allocation out_allocation;
+UserData_t data;
+...
+rsForEach(script, in_allocation, out_allocation, &amp;data, sizeof(data));
+</pre>
+
+<p>In this example, assume that the script and memory allocations have already been
+allocated and bound at the Android framework level and that <code>UserData_t</code> is a struct
+declared previously. Passing a pointer to a struct and the size of the struct to <code>rsForEach</code>
+is optional, but useful if your compute Renderscript requires additional information other than
+the necessary memory allocations.</p>
diff --git a/docs/html/guide/topics/renderscript/graphics.jd b/docs/html/guide/topics/renderscript/graphics.jd
index 2fefecc..1c6d0de 100644
--- a/docs/html/guide/topics/renderscript/graphics.jd
+++ b/docs/html/guide/topics/renderscript/graphics.jd
@@ -1,6 +1,7 @@
-page.title=3D Graphics
-parent.title=RenderScript 
+page.title=Graphics
+parent.title=Renderscript
 parent.link=index.html
+
 @jd:body
 
   <div id="qv-wrapper">
@@ -11,16 +12,16 @@
         <li>
           <a href="#creating-graphics-rs">Creating a Graphics Renderscript</a>
           <ol>
-            <li><a href="#creating-native">Creating the native Renderscript file</a></li>
+            <li><a href="#creating-native">Creating the Renderscript file</a></li>
             <li><a href="#creating-entry">Creating the Renderscript entry point class</a></li>
-            <li><a href="#creating-view">Creating the surface view</a></li>
-            <li><a href="#creating-activity">Creating the activity</a></li>
+            <li><a href="#creating-view">Creating the view class</a></li>
+            <li><a href="#creating-activity">Creating the activity class</a></li>
           </ol>
         </li>
         <li>
           <a href="#drawing">Drawing</a>
           <ol>
-            <li><a href="#drawing-rsg">Drawing using the rsgDraw functions</a></li>
+            <li><a href="#drawing-rsg">Simple drawing</a></li>
             <li><a href="#drawing-mesh">Drawing with a mesh</a></li>
           </ol>
         </li>
@@ -31,6 +32,9 @@
             <li><a href="#shader-sampler">Defining a sampler</a></li>
           </ol>
         </li>
+        <li>
+          <a href="#fbo">Rendering to a Framebuffer Object</a>
+        </li>
       </ol>
 
       <h2>Related Samples</h2>
@@ -40,8 +44,9 @@
 
         <li><a href="{@docRoot}resources/samples/RenderScript/Fountain/index.html">Fountain</a></li>
 
-        <li><a href="{@docRoot}resources/samples/RenderScript/HelloWorld/index.html">Hello
-        World</a></li>
+        <li><a href="{@docRoot}resources/samples/RenderScript/FountainFbo/index.html">FountainFbo</a></li>        
+
+        <li><a href="{@docRoot}resources/samples/RenderScript/HelloWorld/index.html">Hello World</a></li>
 
         <li><a
 href="{@docRoot}resources/samples/RenderScript/MiscSamples/index.html">Misc Samples</a></li>
@@ -49,310 +54,476 @@
     </div>
   </div>
 
-  <p>RenderScript provides a number of graphics APIs for 3D rendering, both at the Android
-  framework level as well as at the native level. For instance, the Android framework APIs let you
+  <p>Renderscript provides a number of graphics APIs for rendering, both at the Android
+  framework level as well as at the Renderscript runtime level. For instance, the Android framework APIs let you
   create meshes and define shaders to customize the graphical rendering pipeline. The native
-  RenderScript graphics APIs lets you draw the actual meshes to render your scene. In general, you
-  will need to be familiar with APIs to appropriately render 3D graphics on an Android-powered
-  device.</p>
+  Renderscript graphics APIs let you draw the actual meshes to render your scene. You need to
+  be familiar with both APIs to appropriately render graphics on an Android-powered device.</p>
 
-  <h2 id="creating-graphics-rs">Creating a Graphics RenderScript</h2>
+  <h2 id="creating-graphics-rs">Creating a Graphics Renderscript</h2>
 
-  <p>Because of the various layers of code when writing a RenderScript application, it is useful to
-  create the following files for a scene that you want to render:</p>
+  <p>Renderscript applications require various layers of code, so it is useful to create the following
+  files to help keep your application organized:</p>
 
-  <ul>
-    <li>The native RenderScript <code>.rs</code> file. This file contains the logic to do the
-    graphics rendering.</li>
+  <dl>
+    <dt>The Renderscript <code>.rs</code> file</dt>
 
-    <li>The RenderScript entry point class that allows your view to interact with the code defined
-    in the <code>.rs</code> file. This class contains a RenderScript object(instance of
+    <dd>This file contains the logic to do the graphics rendering.</dd>
+
+    <dt>The Renderscript entry point <code>.java</code> class</dt>
+
+    <dd>This class allows the view class to interact with the code defined in the <code>.rs</code>
+    file. This class contains a Renderscript object (instance of
     <code>ScriptC_<em>renderscript_file</em></code>), which allows your Android framework code to
-    call the native RenderScript code. This class also creates the {@link
-    android.renderscript.RenderScriptGL} context object, which contains the current rendering state
-    of the RenderScript such as programs (vertex and fragment shaders, for example) that you want
-    to define and bind to the graphics pipeline. The context object attaches to the RenderScript
-    object (instance of <code><em>ScriptC_renderscript_file</em></code>) that does the rendering.
-    Our example names this class <code>HelloWorldRS</code>.</li>
+    call the Renderscript code. In general, this class does much of the setup for Renderscript
+    such as shader and mesh building and memory allocation and binding. The SDK samples follow the
+    convention of naming this file ActivityRS.java,
+    where Activity is the name of your main activity class.</dd>
 
-    <li>Create a class that extends {@link android.renderscript.RSSurfaceView} to provide a surface
-    to render on. If you want to implement callbacks from events inherited from {@link
+    <dt>The view <code>.java</code> class</dt>
+
+    <dd>This class extends {@link android.renderscript.RSSurfaceView} or {@link
+    android.renderscript.RSTextureView} to provide a surface to render on. A {@link
+    android.renderscript.RSSurfaceView} consumes a whole window, but a {@link
+    android.renderscript.RSTextureView} allows you to draw Renderscript graphics inside of a
+    view and add it to a {@link android.view.ViewGroup} alongside
+    other views. In this class, you create a {@link android.renderscript.RenderScriptGL} context object
+    with a call to {@link android.renderscript.RSSurfaceView#createRenderScriptGL
+    RSSurfaceView.createRenderscriptGL()} or {@link android.renderscript.RSTextureView#createRenderScriptGL
+    RSTextureView.createRenderscriptGL()}. The {@link android.renderscript.RenderScriptGL} context object
+    contains information about the current rendering state of Renderscript such as the vertex and
+    fragment shaders. You pass this context object to the Renderscript entry point class, so that
+    class can modify the rendering context if needed and bind the Renderscript code to the context. Once bound,
+    the view class can use the Renderscript code to display graphics.
+    The view class should also implement callbacks for events inherited from {@link
     android.view.View}, such as {@link android.view.View#onTouchEvent onTouchEvent()} and {@link
-    android.view.View#onKeyDown onKeyDown()}, do so in this class as well.</li>
+    android.view.View#onKeyDown onKeyDown()} if you want to detect these types of user interactions.
+    The SDK samples follow the convention of naming this file ActivityView.java,
+    where Activity is the name of your main activity class</dd>
 
-    <li>Create a class that is the main Activity class, like you would with any Android
-    application. This class sets your {@link android.renderscript.RSSurfaceView} as the content
-    view for this Activity.</li>
-  </ul>
+    <dt>The activity <code>.java</code> class</dt>
 
-  <p>The following sections describe how to implement these three classes by using the HelloWorld
-  RenderScript sample that is provided in the SDK as a guide (some code has been modified from its
-  original form for simplicity).</p>
+    <dd>This class is the main activity class and sets your {@link android.renderscript.RSSurfaceView} as the main content
+    view for this activity or uses the {@link android.renderscript.RSTextureView} alongside other views.</dd>
+  </dl>
+  <p>Figure 1 describes how these classes interact with one another in a graphics Renderscript:</p>
+  
+  <img src="{@docRoot}images/rs_graphics.png">
+  <p class="img-caption"><strong>Figure 1.</strong> Graphics Renderscript overview</p>
 
-  <h3 id="creating-native">Creating the native RenderScript file</h3>
 
-  <p>Your native RenderScript code resides in a <code>.rs</code> file in the
-  <code>&lt;project_root&gt;/src/</code> directory. You can also define <code>.rsh</code> header
-  files. This code contains the logic to render your graphics and declares all necessary variables
+  <p>The following sections describe how to create an application that uses a graphics Renderscript by using
+  the <a href="{@docRoot}resources/samples/RenderScript/Fountain/index.html">Renderscript Fountain
+  sample</a> that is provided in the SDK as a guide (some code has been modified from its original
+  form for simplicity).</p>
+
+  <h3 id="creating-native">Creating the Renderscript file</h3>
+
+  <p>Your Renderscript code resides in <code>.rs</code> and <code>.rsh</code> (headers) files in the
+  <code>&lt;project_root&gt;/src/</code> directory. This code contains the logic to render your
+  graphics and declares all other necessary items such as variables, structs,
   and pointers. Every graphics <code>.rs</code> file generally contains the following items:</p>
 
   <ul>
-    <li>A pragma (<code>#pragma rs java_package_name(<em>package.name</em>)</code>) that declares
-    the package name of the <code>.java</code> reflection of this RenderScript.</li>
+    <li>A pragma declaration (<code>#pragma rs java_package_name(<em>package.name</em>)</code>) that declares
+    the package name of the <code>.java</code> reflection of this Renderscript.</li>
 
-    <li>A pragma (<code>#pragma version(1)</code>) that declares the version of RenderScript that
+    <li>A pragma declaration (<code>#pragma version(1)</code>) that declares the version of Renderscript that
     you are using (1 is the only value for now).</li>
 
-    <li>A <code>#include</code> of the rs_graphics.rsh header file.</li>
+    <li>A <code>#include "rs_graphics.rsh"</code> declaration.</li>
 
-    <li>A <code>root()</code> function. This is the main worker function for your RenderScript and
-    calls RenderScript graphics APIs to draw meshes to the surface. This function is called every
-    time a frame refresh occurs, which is specified as its return value. A <code>0</code> specified
-    for the return value says to only render the frame when a property of the scene that you are
+    <li>A <code>root()</code> function. This is the main worker function for your Renderscript and
+    calls Renderscript graphics functions to render scenes. This function is called every time a
+    frame refresh occurs, which is specified as its return value. A <code>0</code> (zero) specified for
+    the return value says to only render the frame when a property of the scene that you are
     rendering changes. A non-zero positive integer specifies the refresh rate of the frame in
     milliseconds.
 
-      <p class="note"><strong>Note:</strong> The RenderScript runtime makes its best effort to
+      <p class="note"><strong>Note:</strong> The Renderscript runtime makes its best effort to
       refresh the frame at the specified rate. For example, if you are creating a live wallpaper
-      and set the return value to 50, the runtime renders the wallpaper at 20fps if it has just
-      enough or more resources to do so, and renders as fast as it can if it does not.</p>
-      
-      <p>For more
-      information on using the RenderScript graphics functions, see the <a href=
+      and set the return value to 20, the Renderscript runtime renders the wallpaper at 20fps if it has just
+      enough or more resources to do so. It renders as fast as it can if not enough resources
+      are available.</p>
+
+      <p>For more information on using the Renderscript graphics functions, see the <a href=
       "#drawing">Drawing</a> section.</p>
     </li>
 
-    <li>An <code>init()</code> function. This allows you to do any initialization of your
-    RenderScript before the <code>root()</code> function runs, such as initializing variables. This
-    function runs once and is called automatically when the RenderScript starts, before anything
-    else in your RenderScript. Creating this function is optional.</li>
+    <li>An <code>init()</code> function. This allows you to do initialization of your
+    Renderscript before the <code>root()</code> function runs, such as assigning values to variables. This
+    function runs once and is called automatically when the Renderscript starts, before anything
+    else in your Renderscript. Creating this function is optional.</li>
 
-    <li>Any variables, pointers, and structures that you wish to use in your RenderScript code (can
+    <li>Any variables, pointers, and structures that you wish to use in your Renderscript code (can
     be declared in <code>.rsh</code> files if desired)</li>
   </ul>
 
-  <p>The following code shows how the <code>helloworld.rs</code> file is implemented:</p>
+  <p>The following code shows how the <code>fountain.rs</code> file is implemented:</p>
   <pre>
 #pragma version(1)
 
 // Tell which java package name the reflected files should belong to
-#pragma rs java_package_name(com.android.rs.helloworld)
+#pragma rs java_package_name(com.example.android.rs.fountain)
 
-// Built-in header with graphics APIs
+//declare shader binding
+#pragma stateFragment(parent)
+
+// header with graphics APIs, must include explicitly
 #include "rs_graphics.rsh"
 
-// gTouchX and gTouchY are variables that are reflected for use
-// by the Android framework API. This RenderScript uses them to be notified of touch events.
-int gTouchX;
-int gTouchY;
+static int newPart = 0;
 
-// This is invoked automatically when the script is created and initializes the variables
-// in the Android framework layer as well.
-void init() {
-    gTouchX = 50.0f;
-    gTouchY = 50.0f;
+// the mesh to render
+rs_mesh partMesh;
+
+// the point representing where a particle is rendered
+typedef struct __attribute__((packed, aligned(4))) Point {
+    float2 delta;
+    float2 position;
+    uchar4 color;
+} Point_t;
+Point_t *point;
+
+// main worker function that renders particles onto the screen
+int root() {
+    float dt = min(rsGetDt(), 0.1f);
+    rsgClearColor(0.f, 0.f, 0.f, 1.f);
+    const float height = rsgGetHeight();
+    const int size = rsAllocationGetDimX(rsGetAllocation(point));
+    float dy2 = dt * (10.f);
+    Point_t * p = point;
+    for (int ct=0; ct &lt; size; ct++) {
+        p-&gt;delta.y += dy2;
+        p-&gt;position += p-&gt;delta;
+        if ((p-&gt;position.y &gt; height) &amp;&amp; (p-&gt;delta.y &gt; 0)) {
+            p-&gt;delta.y *= -0.3f;
+        }
+        p++;
+    }
+
+    rsgDrawMesh(partMesh);
+    return 1;
 }
 
-int root(int launchID) {
+// adds particles to the screen to render
+static float4 partColor[10];
+void addParticles(int rate, float x, float y, int index, bool newColor)
+{
+    if (newColor) {
+        partColor[index].x = rsRand(0.5f, 1.0f);
+        partColor[index].y = rsRand(1.0f);
+        partColor[index].z = rsRand(1.0f);
+    }
+    float rMax = ((float)rate) * 0.02f;
+    int size = rsAllocationGetDimX(rsGetAllocation(point));
+    uchar4 c = rsPackColorTo8888(partColor[index]);
 
-    // Clear the background color
-    rsgClearColor(0.0f, 0.0f, 0.0f, 0.0f);
-    // Tell the runtime what the font color should be
-    rsgFontColor(1.0f, 1.0f, 1.0f, 1.0f);
-    // Introuduce ourselves to the world by drawing a greeting
-    // at the position user touched on the screen
-    rsgDrawText("Hello World!", gTouchX, gTouchY);
-
-    // Return value tells RS roughly how often to redraw
-    // in this case 20 ms
-    return 20;
+    Point_t * np = &amp;point[newPart];
+    float2 p = {x, y};
+    while (rate--) {
+        float angle = rsRand(3.14f * 2.f);
+        float len = rsRand(rMax);
+        np-&gt;delta.x = len * sin(angle);
+        np-&gt;delta.y = len * cos(angle);
+        np-&gt;position = p;
+        np-&gt;color = c;
+        newPart++;
+        np++;
+        if (newPart &gt;= size) {
+            newPart = 0;
+            np = &amp;point[newPart];
+        }
+    }
 }
 </pre>
 
-  <h3 id="creating-entry">Creating the RenderScript entry point class</h3>
+  <h3 id="creating-entry">Creating the Renderscript entry point class</h3>
 
-  <p>When you create a RenderScript (<code>.rs</code>) file, it is helpful to create a
-  corresponding Android framework class that is an entry point into the <code>.rs</code> file. In
-  this entry point class, you create a RenderScript object by instantiating a
-  <code>ScriptC_<em>rs_filename</em></code> and binding it to the RenderScript context. The
-  RenderScript object is attached to the RenderScript bytecode, which is platform-independent and
-  gets compiled on the device when the RenderScript application runs. Both the
-  <code>ScriptC_<em>rs_filename</em></code> class and bytecode is generated by the Android build
-  tools and is packaged with the <code>.apk</code> file. The bytecode file is located in the
-  <code>&lt;project_root&gt;/res/raw/</code> directory and is named <code>rs_filename.bc</code>.
-  You refer to the bytecode as a resource (<code>R.raw.<em>rs_filename</em></code>). when creating
-  the RenderScript object..</p>
+  <p>When you create a Renderscript (<code>.rs</code>) file, it is helpful to create a
+  corresponding Android framework class that is an entry point into the <code>.rs</code> file.
+  The most important thing this class does is receive a {@link android.renderscript.RenderScriptGL} rendering context
+  object from the <a href="#creating-view">view class</a> and binds the actual Renderscript
+  code to the rendering context. This notifies your view class of the code that it needs
+  to render graphics.
+  </p>
 
-  <p>You then bind the RenderScript object to the RenderScript context, so that the surface view
-  knows what code to use to render graphics. The following code shows how the
-  <code>HelloWorldRS</code> class is implemented:</p>
+  <p>In addition, this class should contain all of the things needed to set up Renderscript.
+  Some important things that you need to do in this class are:</p>
+
+  <ul>
+    <li>Create a Renderscript object 
+  <code>ScriptC_<em>rs_filename</em></code>. The Renderscript object is attached to the Renderscript bytecode, which is platform-independent and
+  gets compiled on the device when the Renderscript application runs. The bytecode is referenced
+  as a raw resource and is passed into the constructor for the Renderscript object.
+  For example, this is how the <a href="{@docRoot}resources/samples/RenderScript/Fountain/index.html">Fountain</a>
+  sample creates the Renderscript object:
   <pre>
-package com.android.rs.helloworld;
+  RenderScriptGL rs;  //obtained from the view class
+  Resources res;      //obtained from the view class
+  ...
+  ScriptC_fountain mScript = new ScriptC_fountain(mRS, mRes, R.raw.fountain);
+  </pre>
+  </li>
+  <li>Allocate any necessary memory and bind it to your Renderscript code via the Renderscript object.</li>
+  <li>Build any necessary meshes and bind them to the Renderscript code via the Renderscript object.</li>
+  <li>Create any necessary programs and bind them to the Renderscript code via the Renderscript object.</li>
+  </ul>
+
+  <p>The following code shows how the <a href=
+  "{@docRoot}resources/samples/RenderScript/Fountain/src/com/example/android/rs/fountain/FountainRS.html">
+  FountainRS</a> class is implemented:</p>
+  <pre>
+package com.example.android.rs.fountain;
 
 import android.content.res.Resources;
 import android.renderscript.*;
+import android.util.Log;
 
-public class HelloWorldRS {
-    //context and resources are obtained from RSSurfaceView, which calls init()
+public class FountainRS {
+    public static final int PART_COUNT = 50000;
+
+    public FountainRS() {
+    }
+
+    /**
+     * This provides us with the Renderscript context and resources
+     * that allow us to create the Renderscript object
+     */
     private Resources mRes;
     private RenderScriptGL mRS;
 
-    //Declare the RenderScript object
-    private ScriptC_helloworld mScript;
+    // Renderscript object
+    private ScriptC_fountain mScript;
 
-    public HelloWorldRS() {
-    }
-
-    /**
-     * This provides us with the RenderScript context and resources
-     * that allow us to create the RenderScript object
-     */
+    // Called by the view class to initialize the Renderscript context and renderer
     public void init(RenderScriptGL rs, Resources res) {
         mRS = rs;
         mRes = res;
-        initRS();
-    }
-    /**
-     * Calls native RenderScript functions (set_gTouchX and set_gTouchY)
-     * through the reflected layer class ScriptC_helloworld to pass in
-     * touch point data.
-     */
-    public void onActionDown(int x, int y) {
-        mScript.set_gTouchX(x);
-        mScript.set_gTouchY(y);
-    }
-    /**
-     * Binds the RenderScript object to the RenderScript context
-     */
-    private void initRS() {
-        //create the RenderScript object
-        mScript = new ScriptC_helloworld(mRS, mRes, R.raw.helloworld);
-        //bind the RenderScript object to the RenderScript context
+
+        /**
+         * Create a shader and bind to the Renderscript context
+         */
+        ProgramFragmentFixedFunction.Builder pfb = new ProgramFragmentFixedFunction.Builder(rs);
+        pfb.setVaryingColor(true);
+        rs.bindProgramFragment(pfb.create());
+
+        /**
+         * Allocate memory for the particles to render and create the mesh to draw
+         */
+        ScriptField_Point points = new ScriptField_Point(mRS, PART_COUNT);
+        Mesh.AllocationBuilder smb = new Mesh.AllocationBuilder(mRS);
+        smb.addVertexAllocation(points.getAllocation());
+        smb.addIndexSetType(Mesh.Primitive.POINT);
+        Mesh sm = smb.create();
+
+       /**
+        * Create and bind the Renderscript object to the Renderscript context
+        */
+        mScript = new ScriptC_fountain(mRS, mRes, R.raw.fountain);
+        mScript.set_partMesh(sm);
+        mScript.bind_point(points);
         mRS.bindRootScript(mScript);
     }
-}
 
+    boolean holdingColor[] = new boolean[10];
+
+    /**
+     * Calls Renderscript functions (invoke_addParticles)
+     * via the Renderscript object to add particles to render
+     * based on where a user touches the screen.
+     */
+    public void newTouchPosition(float x, float y, float pressure, int id) {
+        if (id &gt;= holdingColor.length) {
+            return;
+        }
+        int rate = (int)(pressure * pressure * 500.f);
+        if (rate &gt; 500) {
+            rate = 500;
+        }
+        if (rate &gt; 0) {
+            mScript.invoke_addParticles(rate, x, y, id, !holdingColor[id]);
+            holdingColor[id] = true;
+        } else {
+            holdingColor[id] = false;
+        }
+
+    }
+}
 </pre>
 
-  <h3 id="creating-view">Creating the surface view</h3>
 
-  <p>To create a surface view to render graphics on, create a class that extends {@link
-  android.renderscript.RSSurfaceView}. This class also creates a RenderScript context object
-  ({@link android.renderscript.RenderScriptGL} and passes it to the Rendscript entry point class to
-  bind the two. The following code shows how the <code>HelloWorldView</code> class is
-  implemented:</p>
+  <h3 id="creating-view">Creating the view class</h3>
+
+
+  <p>To display graphics, you need a view to render on. Create a class that extends {@link
+  android.renderscript.RSSurfaceView} or {@link android.renderscript.RSTextureView}. This class
+  allows you to create a {@link android.renderscript.RenderScriptGL} context object by calling and
+  pass it to the Rendscript entry point class to bind the two. Once bound, the content is aware
+  of the code that it needs to use to render graphics with. If your Renderscript code
+  depends on any type of information that the view is aware of, such as touches from the user,
+  you can also use this class to relay that information to the Renderscript entry point class.
+  The following code shows how the <code>FountainView</code> class is implemented:</p>
   <pre>
-package com.android.rs.helloworld;
+package com.example.android.rs.fountain;
 
-import android.renderscript.RSSurfaceView;
+import android.renderscript.RSTextureView;
 import android.renderscript.RenderScriptGL;
 import android.content.Context;
 import android.view.MotionEvent;
 
-public class HelloWorldView extends RSSurfaceView {
-    // RenderScript context
-    private RenderScriptGL mRS;
-    // RenderScript entry point object that does the rendering
-    private HelloWorldRS mRender;
+public class FountainView extends RSTextureView {
 
-    public HelloWorldView(Context context) {
+    public FountainView(Context context) {
         super(context);
-        initRS();
     }
+    // Renderscript context
+    private RenderScriptGL mRS;
+    // Renderscript entry point object that calls Renderscript code
+    private FountainRS mRender;
 
-    private void initRS() {
+    /**
+     * Create Renderscript context and initialize Renderscript entry point
+     */
+    &#064;Override
+    protected void onAttachedToWindow() {
+        super.onAttachedToWindow();
+        android.util.Log.e("rs", "onAttachedToWindow");
         if (mRS == null) {
-            // Initialize RenderScript with default surface characteristics.
             RenderScriptGL.SurfaceConfig sc = new RenderScriptGL.SurfaceConfig();
-            //Create the RenderScript context
             mRS = createRenderScriptGL(sc);
-            // Create an instance of the RenderScript entry point class
-            mRender = new HelloWorldRS();
-            // Call the entry point class to bind it to this context
+            mRender = new FountainRS();
             mRender.init(mRS, getResources());
         }
     }
 
-    /**
-     * Rebind everything when the window becomes attached
-     */
-    protected void onAttachedToWindow() {
-        super.onAttachedToWindow();
-        initRS();
-    }
-
-    /**
-     * Stop rendering when window becomes detached
-     */
+    &#064;Override
     protected void onDetachedFromWindow() {
-        // Handle the system event and clean up
-        mRender = null;
+        super.onDetachedFromWindow();
+        android.util.Log.e("rs", "onDetachedFromWindow");
         if (mRS != null) {
             mRS = null;
             destroyRenderScriptGL();
         }
     }
 
-    /**
-     * Use callbacks to relay data to RenderScript entry point class
-     */
-    public boolean onTouchEvent(MotionEvent ev) {
-        // Pass touch events from the system to the rendering script
-        if (ev.getAction() == MotionEvent.ACTION_DOWN) {
-            mRender.onActionDown((int)ev.getX(), (int)ev.getY());
-            return true;
-        }
 
-        return false;
+    /**
+     * Use callbacks to relay data to Renderscript entry point class
+     */
+    &#064;Override
+    public boolean onTouchEvent(MotionEvent ev)
+    {
+        int act = ev.getActionMasked();
+        if (act == ev.ACTION_UP) {
+            mRender.newTouchPosition(0, 0, 0, ev.getPointerId(0));
+            return false;
+        } else if (act == MotionEvent.ACTION_POINTER_UP) {
+            // only one pointer going up, we can get the index like this
+            int pointerIndex = ev.getActionIndex();
+            int pointerId = ev.getPointerId(pointerIndex);
+            mRender.newTouchPosition(0, 0, 0, pointerId);
+        }
+        int count = ev.getHistorySize();
+        int pcount = ev.getPointerCount();
+
+        for (int p=0; p &lt; pcount; p++) {
+            int id = ev.getPointerId(p);
+            mRender.newTouchPosition(ev.getX(p),
+                                     ev.getY(p),
+                                     ev.getPressure(p),
+                                     id);
+
+            for (int i=0; i &lt; count; i++) {
+                mRender.newTouchPosition(ev.getHistoricalX(p, i),
+                                         ev.getHistoricalY(p, i),
+                                         ev.getHistoricalPressure(p, i),
+                                         id);
+            }
+        }
+        return true;
     }
 }
-
 </pre>
 
-  <h3 id="creating-activity">Creating the Activity</h3>
+  <h3 id="creating-activity">Creating the activity class</h3>
 
-  <p>Applications that use RenderScript still adhere to activity lifecyle, and are part of the same
-  view hierarchy as traditional Android applications, which is handled by the Android VM. This
-  Activity class sets its view to be the {@link android.renderscript.RSSurfaceView} and handles
-  lifecycle callback events appropriately. The following code shows how the <code>HelloWorld</code>
-  class is implemented:</p>
+  <p>Applications that use Renderscript still behave like normal Android applications, so you
+   need an activity class that handles activity lifecycle callback events appropriately. The activity class
+   also sets your {@link android.renderscript.RSSurfaceView} view class to be the main content view of the
+   activity or uses your {@link android.renderscript.RSTextureView}
+  in a {@link android.view.ViewGroup} alongside other views.</p>
+
+  <p>The following code shows how the <a href="{@docRoot}resources/samples/RenderScript/Fountain/index.html">Fountain</a>
+  sample declares its activity class:</p>
   <pre>
-public class HelloWorldActivity extends Activity {
+package com.example.android.rs.fountain;
 
-    //Custom view to use with RenderScript
-    private HelloWorldView view;
+import android.app.Activity;
+import android.os.Bundle;
+import android.util.Log;
 
+public class Fountain extends Activity {
+
+    private static final String LOG_TAG = "libRS_jni";
+    private static final boolean DEBUG  = false;
+    private static final boolean LOG_ENABLED = false;
+
+    private FountainView mView;
+
+    &#064;Override
     public void onCreate(Bundle icicle) {
         super.onCreate(icicle);
-        // Create surface view and set it as the content of our Activity
-        mView = new HelloWorldView(this);
-        setContentView(view);
+
+        // Create our Preview view and set it as 
+        // the content of our activity
+        mView = new FountainView(this);
+        setContentView(mView);
     }
 
+    &#064;Override
     protected void onResume() {
-        // Ideally an app should implement onResume() and onPause()
-        // to take appropriate action when the activity loses focus
+        Log.e("rs", "onResume");
+
+        // Ideally a game should implement onResume() and onPause()
+        // to take appropriate action when the activity looses focus
         super.onResume();
-        view.resume();
+        mView.resume();
     }
 
+    &#064;Override
     protected void onPause() {
-        // Ideally an app should implement onResume() and onPause()
-        // to take appropriate action when the activity loses focus
+        Log.e("rs", "onPause");
+
+        // Ideally a game should implement onResume() and onPause()
+        // to take appropriate action when the activity looses focus
         super.onPause();
-        view.pause();
+        mView.pause();
+
+    }
+
+    static void log(String message) {
+        if (LOG_ENABLED) {
+            Log.v(LOG_TAG, message);
+        }
     }
 }
 </pre>
 
+<p>Now that you have an idea of what is involved in a Renderscript graphics application, you can
+start building your own. It might be easiest to begin with one of the
+<a href="{@docRoot}resources/samples/RenderScript/index.html">Renderscript samples</a> as a starting
+point if this is your first time using Renderscript.</p>
+
   <h2 id="drawing">Drawing</h2>
   <p>The following sections describe how to use the graphics functions to draw with Renderscript.</p>
-  <h3 id="drawing-rsg">Drawing using the rsgDraw functions</h3>
 
-  <p>The native RenderScript APIs provide a few convenient functions to easily draw a polygon to
-  the screen. You call these in your <code>root()</code> function to have them render to the
-  surface view. These functions are available for simple drawing and should not be used for complex
-  graphics rendering:</p>
+  <h3 id="drawing-rsg">Simple drawing</h3>
+
+  <p>The native Renderscript APIs provide a few convenient functions to easily draw a polygon or text to
+  the screen. You call these in your <code>root()</code> function to have them render to the {@link
+  android.renderscript.RSSurfaceView} or {@link android.renderscript.RSTextureView}. These functions are
+  available for simple drawing and should not be used for complex graphics rendering:</p>
 
   <ul>
     <li><code>rsgDrawRect()</code>: Sets up a mesh and draws a rectangle to the screen. It uses the
@@ -360,31 +531,32 @@
 
     <li><code>rsgDrawQuad()</code>: Sets up a mesh and draws a quadrilateral to the screen.</li>
 
-    <li><code>rsgDrawQuadTexCoords()</code>: Sets up a mesh and draws a textured quadrilateral to
-    the screen.</li>
+    <li><code>rsgDrawQuadTexCoords()</code>: Sets up a mesh and draws a quadrilateral to the screen
+    using the provided coordinates of a texture.</li>
+
+    <li><code>rsgDrawText()</code>: Draws specified text to the screen. Use <code>rsgFontColor()</code>
+    to set the color of the text.</li>
   </ul>
 
   <h3 id="drawing-mesh">Drawing with a mesh</h3>
 
-  <p>When you want to draw complex shapes and textures to the screen, instantiate a {@link
-  android.renderscript.Mesh} and draw it to the screen with <code>rsgDrawMesh()</code>. A {@link
+  <p>When you want to render complex scenes to the screen, instantiate a {@link
+  android.renderscript.Mesh} and draw it with <code>rsgDrawMesh()</code>. A {@link
   android.renderscript.Mesh} is a collection of allocations that represent vertex data (positions,
-  normals, texture coordinates) and index data such as triangles and lines. You can build a Mesh in
-  three different ways:</p>
+  normals, texture coordinates) and index data that provides information on how to draw triangles
+  and lines with the provided vertex data. You can build a Mesh in three different ways:</p>
 
   <ul>
     <li>Build the mesh with the {@link android.renderscript.Mesh.TriangleMeshBuilder} class, which
-    allows you to specify a set of vertices and indices for each triangle that you want to draw.
-    The downside of doing it this way is there is no way to specify the vertices in your native
-    RenderScript code.</li>
+    allows you to specify a set of vertices and indices for each triangle that you want to draw.</li>
 
     <li>Build the mesh using an {@link android.renderscript.Allocation} or a set of {@link
     android.renderscript.Allocation}s with the {@link android.renderscript.Mesh.AllocationBuilder}
-    class. This allows you to build a mesh with vertices already stored in memory, which allows you
-    to set the vertices in native or Android code.</li>
+    class. This approach allows you to build a mesh with vertices already stored in memory, which allows you
+    to specify the vertices in Renderscript or Android framework code.</li>
 
-    <li>Build the mesh with the {@link android.renderscript.Mesh.Builder} class. This is a
-    convenience method for when you know what data types you want to use to build your mesh, but
+    <li>Build the mesh with the {@link android.renderscript.Mesh.Builder} class. You should use
+    this convenience method when you know the data types you want to use to build your mesh, but
     don't want to make separate memory allocations like with {@link
     android.renderscript.Mesh.AllocationBuilder}. You can specify the types that you want and this
     mesh builder automatically creates the memory allocations for you.</li>
@@ -421,7 +593,7 @@
 script.set_mesh(smP);
 </pre>
 
-  <p>In your native RenderScript code, draw the built mesh to the screen:</p>
+  <p>In your Renderscript code, draw the built mesh to the screen:</p>
   <pre>
 rs_mesh mesh;
 ...
@@ -435,18 +607,18 @@
 }
 </pre>
 
-  <h2 id="shaders">Shaders</h2>
+  <h2 id="shader">Programs</h2>
 
   <p>You can attach four program objects to the {@link android.renderscript.RenderScriptGL} context
   to customize the rendering pipeline. For example, you can create vertex and fragment shaders in
-  GLSL or build a raster program object with provided methods without writing GLSL code. The four
-  program objects mirror a traditional graphical rendering pipeline:</p>
+  GLSL or build a raster program object that controls culling. The four programs mirror a
+  traditional graphical rendering pipeline:</p>
 
   <table>
     <tr>
       <th>Android Object Type</th>
 
-      <th>RenderScript Native Type</th>
+      <th>Renderscript Native Type</th>
 
       <th>Description</th>
     </tr>
@@ -457,17 +629,17 @@
       <td>rs_program_vertex</td>
 
       <td>
-        <p>The RenderScript vertex program, also known as a vertex shader, describes the stage in
+        <p>The Renderscript vertex program, also known as a vertex shader, describes the stage in
         the graphics pipeline responsible for manipulating geometric data in a user-defined way.
-        The object is constructed by providing RenderScript with the following data:</p>
+        The object is constructed by providing Renderscript with the following data:</p>
 
         <ul>
-          <li>An Element describing its varying inputs or attributes</li>
+          <li>An {@link android.renderscript.Element} describing its varying inputs or attributes</li>
 
           <li>GLSL shader string that defines the body of the program</li>
 
-          <li>a Type that describes the layout of an Allocation containing constant or uniform
-          inputs</li>
+          <li>a {@link android.renderscript.Type} that describes the layout of an
+          Allocation containing constant or uniform inputs</li>
         </ul>
 
         <p>Once the program is created, bind it to the {@link android.renderscript.RenderScriptGL}
@@ -475,22 +647,29 @@
         bindProgramVertex()}. It is then used for all subsequent draw calls until you bind a new
         program. If the program has constant inputs, the user needs to bind an allocation
         containing those inputs. The allocation's type must match the one provided during creation.
-        The RenderScript library then does all the necessary plumbing to send those constants to
-        the graphics hardware. Varying inputs to the shader, such as position, normal, and texture
-        coordinates are matched by name between the input Element and the Mesh object being drawn.
-        The signatures don't have to be exact or in any strict order. As long as the input name in
-        the shader matches a channel name and size available on the mesh, the run-time would take
-        care of connecting the two. Unlike OpenGL, there is no need to link the vertex and fragment
-        programs.</p>
+        </p>
 
-        <p>To bind shader constructs to the Program, declare a struct containing the necessary
-        shader constants in your native RenderScript code. This struct is generated into a
-        reflected class that you can use as a constant input element during the Program's creation.
-        It is an easy way to create an instance of this struct as an allocation. You would then
-        bind this Allocation to the Program and the RenderScript system sends the data that is
-        contained in the struct to the hardware when necessary. To update shader constants, you
-        change the values in the Allocation and notify the native RenderScript code of the
-        change.</p>
+        <p>The Renderscript runtime then does all the necessary plumbing to send those constants to
+        the graphics hardware. Varying inputs to the shader, such as position, normal, and texture
+        coordinates are matched by name between the input {@link android.renderscript.Element}
+        and the mesh object that is being drawn. The signatures don't have to be exact or in any
+        strict order. As long as the input name in the shader matches a channel name and size
+        available on the mesh, the Renderscript runtime handles connecting the two. Unlike OpenGL
+        there is no need to link the vertex and fragment programs.</p>
+
+        <p>To bind shader constants to the program, declare a <code>struct</code> that contains the necessary
+        shader constants in your Renderscript code. This <code>struct</code> is generated into a
+        reflected class that you can use as a constant input element during the program's creation.
+        It is an easy way to create an instance of this <code>struct</code> as an allocation. You would then
+        bind this {@link android.renderscript.Allocation} to the program and the
+        Renderscript runtime sends the data that is contained in the <code>struct</code> to the hardware
+        when necessary. To update shader constants, you change the values in the
+        {@link android.renderscript.Allocation} and notify the Renderscript
+        code of the change.</p>
+
+        <p>The {@link android.renderscript.ProgramVertexFixedFunction.Builder} class also
+        lets you build a simple vertex shader without writing GLSL code.
+        </p>
       </td>
     </tr>
 
@@ -500,26 +679,33 @@
       <td>rs_program_fragment</td>
 
       <td>
-        <p>The RenderScript fragment program, also known as the fragment shader, is responsible for
+        <p>The Renderscript fragment program, also known as a fragment shader, is responsible for
         manipulating pixel data in a user-defined way. It's constructed from a GLSL shader string
-        containing the program body, textures inputs, and a Type object describing the constants
-        used by the program. Like the vertex programs, when an allocation with constant input
+        containing the program body, texture inputs, and a {@link android.renderscript.Type}
+        object that describes the constants
+        used by the program. Like the vertex programs, when an {@link android.renderscript.Allocation}
+        with constant input
         values is bound to the shader, its values are sent to the graphics program automatically.
-        Note that the values inside the allocation are not explicitly tracked. If they change
-        between two draw calls using the same program object, notify the runtime of that change by
-        calling rsgAllocationSyncAll so it could send the new values to hardware. Communication
+        Note that the values inside the {@link android.renderscript.Allocation} are not explicitly tracked.
+        If they change between two draw calls using the same program object, notify the runtime of that change by
+        calling <code>rsgAllocationSyncAll()</code>, so it can send the new values to hardware. Communication
         between the vertex and fragment programs is handled internally in the GLSL code. For
-        example, if the fragment program is expecting a varying input called varTex0, the GLSL code
+        example, if the fragment program is expecting a varying input called <code>varTex0</code>, the GLSL code
         inside the program vertex must provide it.</p>
 
-        <p>To bind shader constants to this program, declare a struct containing the necessary
-        shader constants in your native RenderScript code. This struct is generated into a
-        reflected class that you can use as a constant input element during the Program's creation.
-        It is an easy way to create an instance of this struct as an allocation. You would then
-        bind this Allocation to the Program and the RenderScript system sends the data that is
-        contained in the struct to the hardware when necessary. To update shader constants, you
-        change the values in the Allocation and notify the native RenderScript code of the
-        change.</p>
+        <p>To bind shader constructs to the program, declare a <code>struct</code> that contains the necessary
+        shader constants in your Renderscript code. This <code>struct</code> is generated into a
+        reflected class that you can use as a constant input element during the program's creation.
+        It is an easy way to create an instance of this <code>struct</code> as an allocation. You would then
+        bind this {@link android.renderscript.Allocation} to the program and the
+        Renderscript runtime sends the data that is contained in the <code>struct</code> to the hardware
+        when necessary. To update shader constants, you change the values in the
+        {@link android.renderscript.Allocation} and notify the Renderscript
+        code of the change.</p>
+
+        <p>The {@link android.renderscript.ProgramFragmentFixedFunction.Builder} class also
+        lets you build a simple fragment shader without writing GLSL code.
+        </p>
       </td>
     </tr>
 
@@ -528,7 +714,7 @@
 
       <td>rs_program_store</td>
 
-      <td>The RenderScript ProgramStore contains a set of parameters that control how the graphics
+      <td>The Renderscript store program contains a set of parameters that control how the graphics
       hardware writes to the framebuffer. It could be used to enable and disable depth writes and
       testing, setup various blending modes for effects like transparency and define write masks
       for color components.</td>
@@ -539,12 +725,12 @@
 
       <td>rs_program_raster</td>
 
-      <td>Program raster is primarily used to specify whether point sprites are enabled and to
+      <td>The Renderscript raster program is primarily used to specify whether point sprites are enabled and to
       control the culling mode. By default back faces are culled.</td>
     </tr>
   </table>
 
-  <p>The following example defines a vertex shader in GLSL and binds it to the RenderScript:</p>
+  <p>The following example defines a vertex shader in GLSL and binds it to a Renderscript context object:</p>
   <pre>
     private RenderScriptGL glRenderer;      //rendering context
     private ScriptField_Point mPoints;      //vertices
@@ -567,49 +753,37 @@
         ProgramVertex pvs = sb.create();
         pvs.bindConstants(mVpConsts.getAllocation(), 0);
         glRenderer.bindProgramVertex(pvs);
-
-
 </pre>
 
+
   <p>The <a href=
   "{@docRoot}resources/samples/RenderScript/MiscSamples/src/com/example/android/rs/miscsamples/RsRenderStatesRS.html">
   RsRenderStatesRS</a> sample has many examples on how to create a shader without writing GLSL.</p>
 
-  <h3 id="shader-bindings">Shader bindings</h3>
+  <h3 id="shader-bindings">Program bindings</h3>
 
-  <p>You can also set four pragmas that control the shaders' default bindings to the {@link
+  <p>You can also declare four pragmas that control default program bindings to the {@link
   android.renderscript.RenderScriptGL} context when the script is executing:</p>
 
   <ul>
-    <li>stateVertex</li>
+    <li><code>stateVertex</code></li>
 
-    <li>stateFragment</li>
+    <li><code>stateFragment</code></li>
 
-    <li>stateRaster</li>
+    <li><code>stateRaster</code></li>
 
-    <li>stateStore</li>
+    <li><code>stateStore</code></li>
   </ul>
 
   <p>The possible values for each pragma are <code>parent</code> or <code>default</code>. Using
-  <code>default</code> binds the shaders to the graphical context with the system defaults. The
-  default shader is defined below:</p>
-  <pre>
-("varying vec4 varColor;\n");
-("varying vec2 varTex0;\n");
-("void main() {\n");
-(" gl_Position = UNI_MVP * ATTRIB_position;\n");
-(" gl_PointSize = 1.0;\n");
-(" varColor = ATTRIB_color;\n");
-(" varTex0 = ATTRIB_texture0;\n");
-("}\n");
-</pre>
+  <code>default</code> binds the shaders to the graphical context with the system defaults.</p>
 
   <p>Using <code>parent</code> binds the shaders in the same manner as it is bound in the calling
   script. If this is the root script, the parent state is taken from the bind points that are set
   by the {@link android.renderscript.RenderScriptGL} bind methods.</p>
 
-  <p>For example, you can define this at the top of your native graphics RenderScript code to have
-  the Vertex and Store shaders inherent the bind properties from their parent scripts:</p>
+  <p>For example, you can define this at the top of your graphics Renderscript code to have
+  the vertex and store programs inherent the bind properties from their parent scripts:</p>
   <pre>
 #pragma stateVertex(parent)
 #pragma stateStore(parent)
@@ -618,18 +792,202 @@
   <h3 id="shader-sampler">Defining a sampler</h3>
 
   <p>A {@link android.renderscript.Sampler} object defines how data is extracted from textures.
-  Samplers are bound to Program objects (currently only a Fragment Program) alongside the texture
-  whose sampling they control. These objects are used to specify such things as edge clamping
-  behavior, whether mip-maps are used, and the amount of anisotropy required. There might be
-  situations where hardware does not support the desired behavior of the sampler. In these cases,
-  the runtime attempts to provide the closest possible approximation. For example, the user
-  requested 16x anisotropy, but only 8x was set because it's the best available on the
-  hardware.</p>
+  Samplers are bound to a {@link android.renderscript.ProgramFragment} alongside the texture
+  whose sampling they control. These
+  objects are used to specify such things as edge clamping behavior, whether mip-maps are used, and
+  the amount of anisotropy required. There might be situations where hardware does not support the
+  desired behavior of the sampler. In these cases, the Renderscript runtime attempts to provide the
+  closest possible approximation. For example, the user requested 16x anisotropy, but only 8x was
+  set because it's the best available on the hardware.</p>
 
   <p>The <a href=
   "{@docRoot}resources/samples/RenderScript/MiscSamples/src/com/example/android/rs/miscsamples/RsRenderStatesRS.html">
   RsRenderStatesRS</a> sample has many examples on how to create a sampler and bind it to a
   Fragment program.</p>
-  
-</body>
-</html>
+
+
+
+<h2 id="fbo">Rendering to a Framebuffer Object</h2>
+
+<p>Framebuffer objects allow you to render offscreen instead of in the default onscreen
+framebuffer. This approach might be useful for situations where you need to post-process a texture before
+rendering it to the screen, or when you want to composite two scenes in one such as rendering a rear-view
+mirror of a car. There are two buffers associated with a framebuffer object: a color buffer
+and a depth buffer. The color buffer (required) contains the actual pixel data of the scene
+that you are rendering, and the depth buffer (optional) contains the values necessary to figure
+out what vertices are drawn depending on their z-values.</p>
+
+<p>In general, you need to do the following to render to a framebuffer object:</p>
+
+<ul>
+  <li>Create {@link android.renderscript.Allocation} objects for the color buffer and
+  depth buffer (if needed). Specify the {@link
+  android.renderscript.Allocation#USAGE_GRAPHICS_RENDER_TARGET} usage attribute for these
+  allocations to notify the Renderscript runtime to use these allocations for the framebuffer
+  object. For the color buffer allocation, you most likely need to declare the {@link
+  android.renderscript.Allocation#USAGE_GRAPHICS_TEXTURE} usage attribute
+  to use the color buffer as a texture, which is the most common use of the framebuffer object.</li>
+
+  <li>Tell the Renderscript runtime to render to the framebuffer object instead of the default
+  framebuffer by calling <code>rsgBindColorTarget()</code> and passing it the color buffer
+  allocation. If applicable, call <code>rsgBindDepthTarget()</code> passing in the depth buffer
+  allocation as well.</li>
+
+  <li>Render your scene normally with the <code>rsgDraw</code> functions. The scene will be
+  rendered into the color buffer instead of the default onscreen framebuffer.</li>
+
+  <li>When done, tell the Renderscript runtime stop rendering to the color buffer and back
+  to the default framebuffer by calling <code>rsgClearAllRenderTargets()</code>.</li>
+
+  <li>Create a fragment shader and bind a the color buffer to it as a texture.</li>
+
+  <li>Render your scene to the default framebuffer. The texture will be used according
+  to the way you setup your fragment shader.</li>
+</ul>
+
+<p>The following example shows you how to render to a framebuffer object by modifying the
+<a href="{@docRoot}guide/resources/renderscript/Fountain/">Fountain</a> Renderscript sample. The end
+result is the <a href="{@docRoot}guide/resources/renderscript/FountainFBO/">FountainFBO</a> sample.
+The modifications render the exact same scene into a framebuffer object as it does the default
+framebuffer. The framebuffer object is then rendered into the default framebuffer in a small
+area at the top left corner of the screen.</p>
+
+<ol>
+  <li>Modify <code>fountain.rs</code> and add the following global variables. This creates setter
+  methods when this file is reflected into a <code>.java</code> file, allowing you to allocate
+  memory in your Android framework code and binding it to the Renderscript runtime.
+<pre>
+//allocation for color buffer
+rs_allocation gColorBuffer;
+//fragment shader for rendering without a texture (used for rendering to framebuffer object)
+rs_program_fragment gProgramFragment;
+//fragment shader for rendering with a texture (used for rendering to default framebuffer)
+rs_program_fragment gTextureProgramFragment;
+</pre>
+  </li>
+
+  <li>Modify the root function of <code>fountain.rs</code> to look like the following code. The
+  modifications are commented:
+<pre>
+int root() {
+    float dt = min(rsGetDt(), 0.1f);
+    rsgClearColor(0.f, 0.f, 0.f, 1.f);
+    const float height = rsgGetHeight();
+    const int size = rsAllocationGetDimX(rsGetAllocation(point));
+    float dy2 = dt * (10.f);
+    Point_t * p = point;
+    for (int ct=0; ct < size; ct++) {
+        p->delta.y += dy2;
+        p->position += p->delta;
+        if ((p->position.y > height) && (p->delta.y > 0)) {
+            p->delta.y *= -0.3f;
+        }
+        p++;
+    }
+    //Tell Renderscript runtime to render to the frame buffer object
+    rsgBindColorTarget(gColorBuffer, 0);
+    //Begin rendering on a white background
+    rsgClearColor(1.f, 1.f, 1.f, 1.f);
+    rsgDrawMesh(partMesh);
+
+    //When done, tell Renderscript runtime to stop rendering to framebuffer object
+    rsgClearAllRenderTargets();
+
+    //Bind a new fragment shader that declares the framebuffer object to be used as a texture
+    rsgBindProgramFragment(gTextureProgramFragment);
+
+    //Bind the framebuffer object to the fragment shader at slot 0 as a texture
+    rsgBindTexture(gTextureProgramFragment, 0, gColorBuffer);
+    //Draw a quad using the framebuffer object as the texture
+    float startX = 10, startY = 10;
+    float s = 256;
+    rsgDrawQuadTexCoords(startX, startY, 0, 0, 1,
+                         startX, startY + s, 0, 0, 0,
+                         startX + s, startY + s, 0, 1, 0,
+                         startX + s, startY, 0, 1, 1);
+
+    //Rebind the original fragment shader to render as normal
+    rsgBindProgramFragment(gProgramFragment);
+
+    //Render the main scene
+    rsgDrawMesh(partMesh);
+
+    return 1;
+}
+</pre>
+  </li>
+
+  <li>In the <code>FountainRS.java</code> file, modify the <code>init()</code> method to look
+  like the following code. The modifications are commented:
+
+<pre>
+/* Add necessary members */
+private ScriptC_fountainfbo mScript;
+private Allocation mColorBuffer;
+private ProgramFragment mProgramFragment;
+private ProgramFragment mTextureProgramFragment;
+
+public void init(RenderScriptGL rs, Resources res) {
+    mRS = rs;
+    mRes = res;
+
+    ScriptField_Point points = new ScriptField_Point(mRS, PART_COUNT);
+
+    Mesh.AllocationBuilder smb = new Mesh.AllocationBuilder(mRS);
+    smb.addVertexAllocation(points.getAllocation());
+    smb.addIndexSetType(Mesh.Primitive.POINT);
+    Mesh sm = smb.create();
+
+    mScript = new ScriptC_fountainfbo(mRS, mRes, R.raw.fountainfbo);
+    mScript.set_partMesh(sm);
+    mScript.bind_point(points);
+
+    ProgramFragmentFixedFunction.Builder pfb = new ProgramFragmentFixedFunction.Builder(rs);
+    pfb.setVaryingColor(true);
+    mProgramFragment = pfb.create();
+    mScript.set_gProgramFragment(mProgramFragment);
+
+    /* Second fragment shader to use a texture (framebuffer object) to draw with */
+    pfb.setTexture(ProgramFragmentFixedFunction.Builder.EnvMode.REPLACE,
+        ProgramFragmentFixedFunction.Builder.Format.RGBA, 0);
+
+    /* Set the fragment shader in the Renderscript runtime */
+    mTextureProgramFragment = pfb.create();
+    mScript.set_gTextureProgramFragment(mTextureProgramFragment);
+
+    /* Create the allocation for the color buffer */
+    Type.Builder colorBuilder = new Type.Builder(mRS, Element.RGBA_8888(mRS));
+    colorBuilder.setX(256).setY(256);
+    mColorBuffer = Allocation.createTyped(mRS, colorBuilder.create(),
+    Allocation.USAGE_GRAPHICS_TEXTURE |
+    Allocation.USAGE_GRAPHICS_RENDER_TARGET);
+
+    /* Set the allocation in the Renderscript runtime */
+    mScript.set_gColorBuffer(mColorBuffer);
+
+    mRS.bindRootScript(mScript);
+}
+</pre>
+
+<p class="note"><strong>Note:</strong> This sample doesn't use a depth buffer, but the following code
+shows you how to declare an example depth buffer if you need to use
+one for your application. The depth buffer must have the same dimensions as the color buffer:
+
+<pre>
+Allocation mDepthBuffer;
+
+...
+
+Type.Builder b = new Type.Builder(mRS, Element.createPixel(mRS, DataType.UNSIGNED_16,
+    DataKind.PIXEL_DEPTH));
+b.setX(256).setY(256);
+mDepthBuffer = Allocation.createTyped(mRS, b.create(),
+Allocation.USAGE_GRAPHICS_RENDER_TARGET);
+
+</pre>
+</p>
+</li>
+
+  <li>Run and use the sample. The smaller, white quad on the top-left corner is using the
+  framebuffer object as a texture, which renders the same scene as the main rendering.</li>
+</ol>
diff --git a/docs/html/guide/topics/renderscript/index.jd b/docs/html/guide/topics/renderscript/index.jd
index 148705c..a0e8876 100644
--- a/docs/html/guide/topics/renderscript/index.jd
+++ b/docs/html/guide/topics/renderscript/index.jd
@@ -1,4 +1,4 @@
-page.title=RenderScript
+page.title=Renderscript
 @jd:body
 
   <div id="qv-wrapper">
@@ -6,14 +6,14 @@
       <h2>In this document</h2>
 
       <ol>
-        <li><a href="#overview">RenderScript System Overview</a></li>
-        <li>
+        <li><a href="#overview">Renderscript Overview</a></li>
+        <li><a href="#native">Renderscript Runtime Layer</a></li>
+        <li><a href="#reflected">Reflected Layer</a>
           <ol>
-            <li><a href="#native">Native RenderScript layer</a></li>
-
-            <li><a href="#reflected">Reflected layer</a></li>
-
-            <li><a href="#framework">Android framework layer</a></li>
+            <li><a href="#func">Functions</a></li>
+            <li><a href="#var">Variables</a></li>
+            <li><a href="#pointer">Pointers</a></li>
+            <li><a href="#struct">Structs</a></li>
           </ol>
         </li>
 
@@ -21,540 +21,329 @@
           <a href="#mem-allocation">Memory Allocation APIs</a>
         </li>
         <li>
-          <a href="#dynamic">Dynamic Memory Allocations</a>
+          <a href="#memory">Working with Memory</a>
           <ol>
-            <li><a href="#pointers">Declaring pointers</a></li>
+            <li><a href="#allocating-mem">Allocating and binding memory to the Renderscript</a></li>
 
-            <li><a href="#struct-pointer-reflection">How pointers are reflected</a></li>
-
-            <li><a href="#binding">Allocating and binding memory to the RenderScript</a></li>
-
-            <li><a href="#read-write-dynamic">Reading and writing to memory</a></li>
+            <li><a href="#read-write">Reading and writing to memory</a></li>
 
           </ol>
         </li>
-        <li>
-          <a href="#static">Static Memory Allocations</a>
-        </li>
       </ol>
     </div>
   </div>
 
-  <p>RenderScript offers a high performance 3D graphics rendering and compute API at the native
-  level, which you write in the C (C99 standard). The main advantages of RenderScript are:</p>
+  <p>Renderscript offers a high performance 3D graphics rendering and compute API at the native
+  level that you write in C (C99 standard). The main advantages of Renderscript are:</p>
   <ul>
-    <li>Portability: RenderScript is designed to run on many types of devices with different CPU
-    and GPU architectures. It supports all of these architectures without having to target each
-    device, because the code is compiled and cached on the device at runtime.</li>
+    <li>Portability: Renderscript is designed to run on many types of devices with different
+    processor (CPU, GPU, and DSP for instance) architectures. It supports all of these architectures without
+    having to target each device, because the code is compiled and cached on the device
+    at runtime.</li>
 
-    <li>Performance: RenderScript provides similar performance to OpenGL with the NDK while
-    offering the portability of the OpenGL APIs provided by the Android framework ({@link
-    android.opengl}). In addition, it also offers a high performance compute API that is not
-    offered by OpenGL.</li>
+    <li>Performance: Renderscript provides similar performance to OpenGL with the NDK and also
+    provides a high performance compute API that is not offered by OpenGL.</li>
 
-    <li>Usability: RenderScript simplifies development when possible, such as eliminating JNI glue code
+    <li>Usability: Renderscript simplifies development when possible, such as eliminating JNI glue code
     and simplifying mesh setup.</li>
   </ul>
 
   <p>The main disadvantages are:</p>
 
   <ul>
-    <li>Development complexity: RenderScript introduces a new set of APIs that you have to learn.
-    RenderScript also handles memory differently compared to OpenGL with the Android framework APIs
-    or NDK.</li>
+    <li>Development complexity: Renderscript introduces a new set of APIs that you have to learn.
+    Renderscript also allocates memory differently compared to OpenGL with the Android framework APIs.
+    However, these issues are not hard to understand and Renderscript offers many features that
+    make it easier than OpenGL to initialize rendering.</li>
 
-    <li>Debugging visibility: RenderScript can potentially execute (planned feature for later releases)
-    on processors other than the main CPU (such as the GPU), so if this occurs, debugging becomes more difficult. 
+    <li>Debugging visibility: Renderscript can potentially execute (planned feature for later releases)
+    on processors other than the main CPU (such as the GPU), so if this occurs, debugging becomes more difficult.
     </li>
-
-    <li>Less features: RenderScript does not provide as many features as OpenGL such as all the compressed
-    texture formats or GL extensions.</li>
   </ul>
 
-  <p>You need to consider all of the aspects of RenderScript before deciding when to use it. The following list describes
-  general guidelines on when to use OpenGL (framework APIs or NDK) or RenderScript:</p>
-  <ul>
-    <li>If you are doing simple graphics rendering and performance is not critical, you probably want to use the
-  Android framework OpenGL APIs, which still provide adequate performance, to eliminate the added coding and debugging complexity of
-  RenderScript.</li>
 
-  <li>If you want the most flexibility and features while maintaining relatively good debugging
-  support, you probably want to use OpenGL and the NDK. Applications that require this are high end
-  or complicated games, for example.</li>
- 
-  <li>If you want a solution that is portable, has good performance,
-  and you don't need the full feature set of OpenGL, RenderScript is a good solution. If you also
-  need a high performance compute language, then RenderScript offers that as well.
-  Good candidates for RenderScript are graphics intensive UIs that require 3D rendering, live wallpapers,
-  or applications that require intensive mathematical computation.</li>
-  </ul>
-
-  <p>For an example of RenderScript in action, install the RenderScript sample applications that
+  <p>For an example of Renderscript in action, install the Renderscript sample applications that
   are shipped with the SDK in <code>&lt;sdk_root&gt;/samples/android-11/RenderScript</code>.
-  You can also see a typical use of RenderScript with the 3D carousel view in the Android 3.x
+  You can also see a typical use of Renderscript with the 3D carousel view in the Android 3.x
   versions of Google Books and YouTube.</p>
 
-  <h2 id="overview">RenderScript System Overview</h2>
+  <h2 id="overview">Renderscript Overview</h2>
+  <p>The Renderscript runtime operates at the native level and still needs to communicate
+with the Android VM, so the way a Renderscript application is setup is different from a pure VM
+application. An application that uses Renderscript is still a traditional Android application that
+runs in the VM, but you write Renderscript code for the parts of your program that require
+it. Using Renderscript can be as simple as offloading a few math calculations or as complicated as
+rendering an entire 3D game. No matter what you use it for, Renderscript remains platform
+independent, so you do not have to target multiple architectures (for example,
+ARM v5, ARM v7, x86).</p>
 
-  <p>The RenderScript system adopts a control and slave architecture where the low-level native
+  <p>The Renderscript system adopts a control and slave architecture where the low-level Renderscript runtime
   code is controlled by the higher level Android system that runs in a virtual machine (VM). The
-  Android VM still retains all control of memory and lifecycle management and calls the native
-  RenderScript code when necessary. The native code is compiled to intermediate bytecode (LLVM) and
-  packaged inside your application's <code>.apk</code> file. On the device, the bytecode is
-  compiled (just-in-time) to machine code that is further optimized for the device that it is
-  running on. The compiled code on the device is cached, so subsequent uses of the RenderScript
-  enabled application do not recompile the intermediate code. RenderScript has three layers of code
-  to enable communication between the native and Android framework code:</p>
+  Android VM still retains all control of memory management and binds memory that it allocates to
+  the Renderscript runtime, so the Renderscript code can access it. The Android framework makes
+asynchronous calls to Renderscript, and the calls are placed in a message queue and processed
+as soon as possible. Figure 1 shows how the Renderscript system is structured.</p>
+
+   <img id="figure1" src="{@docRoot}images/rs_overview.png" />
+  <p class="img-caption"><strong>Figure 1.</strong> Renderscript system overview</p>
+
+  <p>When using Renderscript, there are three layers of APIs that enable communication between the
+  Renderscript runtime and Android framework code:</p>
 
   <ul>
-    <li>The native RenderScript layer does the intensive computation or graphics rendering. You
-    define your native code in <code>.rs</code> and <code>.rsh</code> files.</li>
+    <li>The Renderscript runtime APIs allow you to do the computation or graphics rendering
+    that is required by your application.</li>
 
-    <li>The reflected layer is a set of classes that are reflected from the native code. It is basically
-    a wrapper around the native code that allows the Android framework to interact with native RenderScripts.
-    The Android build tools automatically generate the classes for this layer during
-    the build process and eliminates the need to write JNI glue code, like with the NDK.</li>
+    <li>The reflected layer APIs are a set of classes that are reflected from your Renderscript
+runtime code. It is basically a wrapper around the Renderscript code that allows the Android
+framework to interact with the Renderscript runtime. The Android build tools automatically generate the
+classes for this layer during the build process. These classes eliminate the need to write JNI glue
+code, like with the NDK.</li>
 
-    <li>The Android framework layer is comprised of the Android framework
-     APIs, which include the {@link android.renderscript} package. This layer gives high level commands
-     like, "rotate the view" or "filter the bitmap", by calling the reflected layer, which in turn calls
-     the native layer. </li>
+    <li>The Android framework APIs, which include the {@link android.renderscript} package, allow you to
+    build your application using traditional Android components such as activities and views. When
+    using Renderscript, this layer calls the reflected layer to access the Renderscript
+    runtime.</li>
   </ul>
 
-  <h3 id="native">Native RenderScript layer</h3>
+ <p></p>
 
-  <p>The native RenderScript layer consists of your RenderScript code, which is compiled and
-  executed in a compact and well defined runtime. Your RenderScript code has access to a limited
-  amount of functions because it cannot access the NDK or standard C functions, since they must be guaranteed to
-  run on a standard CPU. The RenderScript runtime was designed to run on different types of processors,
-  which may not be the CPU, so it cannot guarantee support for standard C libraries. What
-  RenderScript does offer is an API that supports intensive computation and graphics rendering with a collection of math
-  and graphics APIs.</p>
+  <h2 id="native">Renderscript Runtime Layer</h2>
 
-  <p>Some key features of the native RenderScript libraries include:</p>
+  <p>Your Renderscript code is compiled and
+  executed in a compact and well-defined runtime layer. The Renderscript runtime APIs offer support for
+intensive computation and graphics rendering that is portable and automatically scalable to the
+amount of cores available on a processor.
+</p>
+<p class="note"><strong>Note:</strong> The standard C functions in the NDK must be
+  guaranteed to run on a CPU, so Renderscript cannot access these libraries,
+  because Renderscript is designed to run on different types of processors.</p>
+
+<p>You define your Renderscript code in <code>.rs</code>
+  and <code>.rsh</code> files in the <code>src/</code> directory of your Android project. The code
+  is compiled to intermediate bytecode by the
+  <code>llvm</code> compiler that runs as part of an Android build. When your application
+  runs on a device, the bytecode is then compiled (just-in-time) to machine code by another
+  <code>llvm</code> compiler that resides on the device. The machine code is optimized for the
+  device and also cached, so subsequent uses of the Renderscript enabled application does not
+  recompile the bytecode.</p>
+
+  <p>Some key features of the Renderscript runtime libraries include:</p>
 
   <ul>
-    <li>A large collection of math functions with both scalar and vector typed overloaded versions
-    of many common routines. Operations such as adding, multiplying, dot product, and cross product
-    are available.</li>
-
-    <li>Conversion routines for primitive data types and vectors, matrix routines, date and time
-    routines, and graphics routines.</li>
-
-    <li>Logging functions</li>
 
     <li>Graphics rendering functions</li>
 
     <li>Memory allocation request features</li>
 
-    <li>Data types and structures to support the RenderScript system such as Vector types for
+    <li>A large collection of math functions with both scalar and vector typed overloaded versions
+    of many common routines. Operations such as adding, multiplying, dot product, and cross product
+    are available as well as atomic arithmetic and comparison functions.</li>
+
+    <li>Conversion routines for primitive data types and vectors, matrix routines, date and time
+    routines, and graphics routines.</li>
+
+    <li>Data types and structures to support the Renderscript system such as Vector types for
     defining two-, three-, or four-vectors.</li>
+
+    <li>Logging functions</li>
   </ul>
 
-  <p>The RenderScript header files and LLVM front-end libraries are located in the <code>include/</code> and
-  <code>clang-include/</code> directories in the
-  <code>&lt;sdk_root&gt;/platforms/android-11/renderscript/</code> directory of the Android SDK. The
-  headers are automatically included for you, except for the RenderScript graphics specific header file, which
+  <p>See the Renderscript runtime API reference for more information on the available functions. The
+  Renderscript header files are automatically included for you, except for the Renderscript graphics header file, which
   you can include as follows:</p>
-  <pre>
-#include "rs_graphics.rsh"
-</pre>
 
-  <h3 id="reflected">Reflected layer</h3>
+<pre>#include "rs_graphics.rsh"</pre>
+
+  <h2 id="reflected">Reflected Layer</h2>
 
   <p>The reflected layer is a set of classes that the Android build tools generate to allow access
-  to the native RenderScript code from the Android VM. This layer defines entry points for
-  RenderScript functions and variables, so that you can interact with them with the Android
-  framework. This layer also provides methods and constructors that allow you to allocate memory
-  for pointers that are defined in your RenderScript code. The following list describes the major
+  to the Renderscript runtime from the Android framework. This layer also provides methods
+and constructors that allow you to allocate and work with memory for pointers that are defined in
+your Renderscript code. The following list describes the major
   components that are reflected:</p>
 
   <ul>
     <li>Every <code>.rs</code> file that you create is generated into a class named
-    <code>ScriptC_<em>renderscript_filename</em></code> of type {@link
-    android.renderscript.ScriptC}. This is the <code>.java</code> version of your <code>.rs</code>
-    file, which you can call from the Android framework. This class contains the following
-    reflections:
+    <code>project_root/gen/package/name/ScriptC_<em>renderscript_filename</em></code> of
+type {@link android.renderscript.ScriptC}. This file is the <code>.java</code> version of your
+<code>.rs</code> file, which you can call from the Android framework. This class contains the
+following items reflected from the <code>.rs</code> file:
 
       <ul>
-        <li>Non-static functions in your <code>.rs</code> file.</li>
+        <li>Non-static functions</li>
 
-        <li>Non-static, global RenderScript variables. Accessor methods are generated for each
-        variable, so you can read and write the natively declared variables from the Android
-        framework. The <code>get</code> method comes with a one-way communication restriction. The
-        last value that is set from the Android framework is always returned during a call to a
-        <code>get</code> method. If the native RenderScript code changes the value, the change does
-        not propagate back to the Android framework layer.
-        If the global variables are initialized
-        in the native RenderScript code, those values are used to initialize the corresponding
-        values in the Android framework layer. If global variables are marked as
-        <code>const</code>, then a <code>set</code> method is not generated.</li>
-        <li>Global pointers generate a special method named <code>bind_<em>pointer_name</em></code>
-        instead of a <code>set()</code> method. This method allows you to bind the memory that is
-        allocated in the Android VM for the pointer to the native RenderScript (you cannot allocate
-        memory in your <code>.rs</code> file). You can read and write to this memory from both the
-        Android framework and RenderScript code. For more information, see <a href="mem-mgmt">Working
-        with Memory and Data</a></li>
+        <li>Non-static, global Renderscript variables. Accessor methods are generated for each
+        variable, so you can read and write the Renderscript variables from the Android
+        framework. If a global variable is initialized at the Renderscript runtime layer, those
+values are used to initialize the corresponding values in the Android framework layer. If global
+variables are marked as <code>const</code>, then a <code>set</code> method is not
+generated.</p></li>
+
+        <li>Global pointers</li>
       </ul>
     </li>
 
     <li>A <code>struct</code> is reflected into its own class named
-    <code>ScriptField_<em>struct_name</em></code>, which extends {@link
+
+    <code>project_root/gen/package/name/ScriptField_struct_name</em></code>, which extends {@link
     android.renderscript.Script.FieldBase}. This class represents an array of the
     <code>struct</code>, which allows you to allocate memory for one or more instances of this
     <code>struct</code>.</li>
   </ul>
 
-  <h3 id="framework">Android framework layer</h3>
 
-  <p>The Android framework layer consists of the usual Android framework APIs, which include the
-    RenderScript APIs in {@link android.renderscript}. This layer handles things such as the
-    Activity lifecycle and memory management of your application. It issues high level commands to
-    the native RenderScript code through the reflected layer and receives events from the user such
-    as touch and input events and relays them to your RenderScript code, if needed.
-  </p>
+<h3 id="func">Functions</h3>
+<p>Functions are reflected into the script class itself, located in
+<code>project_root/gen/package/name/ScriptC_renderscript_filename</code>. For
+example, if you declare the following function in your Renderscript code:</p>
 
-  <h2 id="mem-allocation">Memory Allocation APIs</h2>
+<pre>
+void touch(float x, float y, float pressure, int id) {
+    if (id >= 10) {
+        return;
+    }
 
-  <p>Before you begin writing your first RenderScript application, you must understand how 
-  memory is allocated for your RenderScript code and how data is shared between the native and VM
-  spaces. RenderScript allows you to access allocated memory in both the native layer
-  and Android system layer. All dynamic and static memory is allocated by the Android VM.
-  The Android VM also does reference counting and garbage collection for you. 
-  You can also explicitly free memory that you no longer need.</p>
-
-  <p class="note"><strong>Note:</strong> To declare temporary memory in your native RenderScript
-  code without allocating it in the Android VM, you can still do things like instantiate a scratch
-  buffer using an array.</p>
-
-  <p>The following classes support the memory management features of RenderScript in the Android
-  VM. You normally do not need to work with these classes directly, because the reflected layer
-  classes provide constructors and methods that set up the memory allocation for you. There are
-  some situations where you would want to use these classes directly to allocate memory on your
-  own, such as loading a bitmap from a resource or when you want to allocate memory for pointers to
-  primitive types.</p>
-
-  <table id="mem-mgmt-table">
-    <tr>
-      <th>Android Object Type</th>
-
-      <th>Description</th>
-    </tr>
-
-    <tr>
-      <td>{@link android.renderscript.Element}</td>
-
-      <td>
-        <p>An element represents one cell of a memory allocation and can have two forms: Basic or
-        Complex.</p>
-
-        <p>A basic element contains a single component of data of any valid RenderScript data type.
-        Examples of basic element data types include a single float value, a float4 vector, or a
-        single RGB-565 color.</p>
-
-        <p>Complex elements contain a list of basic elements and are created from
-        <code>struct</code>s that you declare in your RenderScript code. The most basic primitive
-        type determines the data alignment of the memory. For example, a float4 vector subelement
-        is alligned to <code>sizeof(float)</code> and not <code>sizeof(float4)</code>. The ordering
-        of the elements in memory are the order in which they were added, with each component
-        aligned as necessary.</p>
-      </td>
-    </tr>
-
-    <tr>
-      <td>{@link android.renderscript.Type}</td>
-
-      <td>
-        A type is a memory allocation template and consists of an element and one or more
-        dimensions. It describes the layout of the memory (basically an array of {@link
-        android.renderscript.Element}s) but does not allocate the memory for the data that it
-        describes.
-
-        <p>A type consists of five dimensions: X, Y, Z, LOD (level of detail), and Faces (of a cube
-        map). You can assign the X,Y,Z dimensions to any positive integer value within the
-        constraints of available memory. A single dimension allocation has an X dimension of
-        greater than zero while the Y and Z dimensions are zero to indicate not present. For
-        example, an allocation of x=10, y=1 is considered two dimensional and x=10, y=0 is
-        considered one dimensional. The LOD and Faces dimensions are booleans to indicate present
-        or not present.</p>
-      </td>
-    </tr>
-
-    <tr>
-      <td>{@link android.renderscript.Allocation}</td>
-
-      <td>
-        <p>An allocation provides the memory for applications based on a description of the memory
-        that is represented by a {@link android.renderscript.Type}. Allocated memory can exist in
-        many memory spaces concurrently. If memory is modified in one space, you must explicitly
-        synchronize the memory, so that it is updated in all the other spaces that it exists
-        in.</p>
-
-        <p>Allocation data is uploaded in one of two primary ways: type checked and type unchecked.
-        For simple arrays there are <code>copyFrom()</code> functions that take an array from the
-        Android system and copy it to the native layer memory store. The unchecked variants allow
-        the Android system to copy over arrays of structures because it does not support
-        structures. For example, if there is an allocation that is an array of n floats, the data
-        contained in a float[n] array or a byte[n*4] array can be copied.</p>
-      </td>
-    </tr>
-  </table>
-
-  <h2 id="dynamic">Working with dynamic memory allocations</h2>
-
-  <p>RenderScript has support for pointers, but you must allocate the memory in your Android framework
-  code. When you declare a global pointer in your <code>.rs</code> file, you allocate memory
-  through the appropriate reflected layer class and bind that memory to the native
-  RenderScript layer. You can read and write to this memory from the Android framework layer as well as the
-  RenderScript layer, which offers you the flexibility to modify variables in the most appropriate
-  layer. The following sections show you how to work with pointers, allocate memory for them, and
-  read and write to the memory.</p>
-
-  <h3 id="pointers">Declaring pointers</h3>
-
-  <p>Because RenderScript is written in C99, declaring a pointer is done in a familiar way. You can
-  declare pointers to a <code>struct</code> or a primitive type, but a <code>struct</code> cannot
-  contain pointers or nested arrays. The following code declares a <code>struct</code>, a pointer
-  to that <code>struct</code>, and a pointer of primitive type <code>int32_t</code> in an <code>.rs</code> file:</p>
-  <pre>
-#pragma version(1)
-#pragma rs java_package_name(com.example.renderscript)
-
-...
-
-typedef struct Point {
-      float2 point;
-  } Point_t;
-
-  Point_t *touchPoints;
-  int32_t *intPointer;
-
-...
+    touchPos[id].x = x;
+    touchPos[id].y = y;
+    touchPressure[id] = pressure;
+}
 </pre>
 
-<p>You cannot allocate memory for these pointers in your RenderScript code, but the Android
-build tools generate classes for you that allow you to allocate memory in the Android VM for use by
-your RenderScript code. These classes also let you read and write to the memory. The next section
-describes how these classes are generated through reflection.</p>
+<p>then the following code is generated:</p>
 
-  <h3>How pointers are reflected</h3>
+<pre>
+public void invoke_touch(float x, float y, float pressure, int id) {
+    FieldPacker touch_fp = new FieldPacker(16);
+    touch_fp.addF32(x);
+    touch_fp.addF32(y);
+    touch_fp.addF32(pressure);
+    touch_fp.addI32(id);
+    invoke(mExportFuncIdx_touch, touch_fp);
+}
+</pre>
+<p>
+Functions cannot have a return value, because the Renderscript system is designed to be
+asynchronous. When your Android framework code calls into Renderscript, the call is queued and is
+executed when possible. This restriction allows the Renderscript system to function without constant
+interruption and increases efficiency. If functions were allowed to have return values, the call
+would block until the value was returned.</p>
 
-  <p>Global variables have a getter and setter method generated. A global pointer generates a
-  <code>bind_pointerName()</code> method instead of a set() method. This method allows you to bind
-  the memory that is allocated in the Android VM to the native RenderScript. For example, the two
-  pointers in the previous section generate the following accessor methods in the <code>ScriptC_<em>rs_filename</em></code> file:</p>
+<p>
+If you want the Renderscript code to send a value back to the Android framework, use the
+<code>rsSendToClient()</code> function.
+</p>
+
+<h3 id="var">Variables</h3>
+
+  <p>Variables of supported types are reflected into the script class itself, located in
+<code>project_root/gen/package/name/ScriptC_renderscript_filename</code>. A set of accessor
+methods are generated for each variable. For example, if you declare the following variable in
+your Renderscript code:</p>
+  <pre>uint32_t unsignedInteger = 1;</pre>
+
+  <p>then the following code is generated:</p>
+
+<pre>
+private long mExportVar_unsignedInteger;
+public void set_unsignedInteger(long v){
+    mExportVar_unsignedInteger = v;
+    setVar(mExportVarIdx_unsignedInteger, v);
+}
+
+public long get_unsignedInteger(){
+    return mExportVar_unsignedInteger;
+}
+  </pre>
+
+  <h3 id="pointer">Pointers</h3>
+  <p>Pointers are reflected into the script class itself, located in
+<code>project_root/gen/package/name/ScriptC_renderscript_filename</code>. You
+can declare pointers to a <code>struct</code> or any of the supported Renderscript types, but a
+<code>struct</code> cannot contain pointers or nested arrays. For example, if you declare the
+following pointers to a <code>struct</code> and <code>int32_t</code></p>
+
+<pre>
+typedef struct Point {
+    float2 point;
+} Point_t;
+
+Point_t *touchPoints;
+int32_t *intPointer;
+</pre>
+  <p>then the following code is generated in:</p>
+
   <pre>
-
-    private ScriptField_Point mExportVar_touchPoints;
-    public void bind_touchPoints(ScriptField_Point v) {
-        mExportVar_touchPoints = v;
-        if (v == null) bindAllocation(null, mExportVarIdx_touchPoints);
-        else bindAllocation(v.getAllocation(), mExportVarIdx_touchPoints);
+private ScriptField_Point mExportVar_touchPoints;
+public void bind_touchPoints(ScriptField_Point v) {
+    mExportVar_touchPoints = v;
+    if (v == null) bindAllocation(null, mExportVarIdx_touchPoints);
+    else bindAllocation(v.getAllocation(), mExportVarIdx_touchPoints);
     }
 
     public ScriptField_Point get_touchPoints() {
-        return mExportVar_touchPoints;
+    return mExportVar_touchPoints;
     }
 
     private Allocation mExportVar_intPointer;
     public void bind_intPointer(Allocation v) {
-        mExportVar_intPointer = v;
-        if (v == null) bindAllocation(null, mExportVarIdx_intPointer);
-        else bindAllocation(v, mExportVarIdx_intPointer);
+    mExportVar_intPointer = v;
+    if (v == null) bindAllocation(null, mExportVarIdx_intPointer);
+    else bindAllocation(v, mExportVarIdx_intPointer);
     }
 
     public Allocation get_intPointer() {
         return mExportVar_intPointer;
     }
+  </pre>
 
-</pre>
+<p>A <code>get</code> method and a special method named <code>bind_<em>pointer_name</em></code>
+(instead of a <code>set()</code> method) is generated. This method allows you to bind the memory
+that is allocated in the Android VM to the Renderscript runtime (you cannot allocate
+memory in your <code>.rs</code> file). For more information, see <a href="#memory">Working
+with Allocated Memory</a>.
+</p>
 
-  <h3>Allocating and binding memory to the RenderScript</h3>
-
-  <p>When the build tools generate the reflected layer, you can use the appropriate class
-  (<code>ScriptField_Point</code>, in our example) to allocate memory for a pointer. To do this,
-  you call the constructor for the {@link android.renderscript.Script.FieldBase} class and specify
-  the amount of structures that you want to allocate memory for. To allocate memory for a primitive
-  type pointer, you must build an allocation manually, using the memory management classes
-  described in <a href="mem-mgmt-table">Table 1</a>. The example below allocates memory for both
-  the <code>intPointer</code> and <code>touchPoints</code> pointer and binds it to the
-  RenderScript:</p>
-  <pre>
-private RenderScriptGL glRenderer;
-private ScriptC_example script;
-private Resources resources;
-
-public void init(RenderScriptGL rs, Resources res) {
-   //get the rendering context and resources from the calling method
-   glRenderer = rs; 
-   resources = res; 
-   
-   //allocate memory for the struct pointer, calling the constructor
-    ScriptField_Point touchPoints = new ScriptField_Point(glRenderer, 2); 
-    
-   //Create an element manually and allocate memory for the int pointer 
-    intPointer = Allocation.createSized(glRenderer, Element.I32(glRenderer), 2); 
-    
-    //create an instance of the RenderScript, pointing it to the bytecode resource
-    mScript = new ScriptC_example(glRenderer, resources, R.raw.example); 
-    
-    // bind the struct and int pointers to the RenderScript
-    mScript.bind_touchPoints(touchPoints); 
-    script.bind_intPointer(intPointer);
-    
-    //bind the RenderScript to the rendering context
-    glRenderer.bindRootScript(script);
-}
-</pre>
-
-  <h3>Reading and writing to memory</h3>
-
-  <p>Although you have to allocate memory within the Android VM, you can work with the memory both
-  in your native RenderScript code and in your Android code. Once memory is bound, the native
-  RenderScript can read and write to the memory directly. You can also just use the accessor
-  methods in the reflected classes to access the memory. If you modify memory in the Android
-  framework, it gets automatically synchronized to the native layer. If you modify memory in the <code>.rs</code>
-  file, these changes do not get propagated back to the Android framework.
-  For example, you can modify the struct in your Android code like this:</p>
-  <pre>
-int index = 0;
-boolean copyNow = true;
-Float2 point = new Float2(0.0f, 0.0f);
-touchPoints.set_point(index, point, copyNow);
-</pre>then read it in your native RenderScript code like this:
-  <pre>
-rsDebug("Printing out a Point", touchPoints[0].point.x, touchPoints[0].point.y);
-</pre>
-
-  <h2>Working with statically allocated memory</h2>
-
-  <p>Non-static, global primitives and structs that you declare in your RenderScript are easier to work with,
-  because the memory is statically allocated at compile time. Accessor methods to set and get these
-  variables are generated when the Android build tools generate the reflected layer classes. You
-  can get and set these variables using the provided accessor methods.
- <p class="note"><strong>Note:</strong> The <code>get</code> method comes with a one-way communication restriction. The last value
-  that is set from the Android framework is always returned during a call to a <code>get</code>
-  method. If the native RenderScript code changes the value, the change does not propagate back to
-  the Android framework layer. If the global variables are initialized in the native RenderScript
-  code, those values are used to initialize the corresponding values in the Android framework
-  layer. If global variables are marked as <code>const</code>, then a <code>set</code> method is
-  not generated.</p>
-  </p>
-
-  <p>For example, if you declare the following primitive in your RenderScript code:</p>
-  <pre>
-  uint32_t unsignedInteger = 1;
-  
-</pre>
-<p>then the following code is generated in <code>ScriptC_<em>script_name</em>.java</code>:</p>
-  <pre>
- private final static int mExportVarIdx_unsignedInteger = 9;
-    private long mExportVar_unsignedInteger;
-    public void set_unsignedInteger(long v) {
-        mExportVar_unsignedInteger = v;
-        setVar(mExportVarIdx_unsignedInteger, v);
-    }
-
-    public long get_unsignedInteger() {
-        return mExportVar_unsignedInteger;
-    }
-</pre>
-
-  <p class="note"><strong>Note:</strong> The mExportVarIdx_unsignedInteger variable represents the
-  index of the <code>unsignedInteger</code>'s in an array of statically allocated primitives. You do
-  not need to work with or be aware of this index.</p>
-  
-  <p>For a <code>struct</code>, the Android build tools generate a class named
-  <code>&lt;project_root&gt;/gen/com/example/renderscript/ScriptField_struct_name</code>. This
-  class represents an array of the <code>struct</code> and allows you to allocate memory for a
-  specified number of <code>struct</code>s. This class defines:</p>
-
-  <ul>
-    <li>Overloaded constructors that allow you to allocate memory. The
-    <code>ScriptField_<em>struct_name</em>(RenderScript rs, int count)</code> constructor allows
-    you to define the number of structures that you want to allocate memory for with the
-    <code>count</code> parameter. The <code>ScriptField_<em>struct_name</em>(RenderScript rs, int
-    count, int usages)</code> constructor defines an extra parameter, <code>usages</code>, that
-    lets you specify the memory space of this memory allocation. There are four memory space
-    possibilities:
-
-      <ul>
-        <li>{@link android.renderscript.Allocation#USAGE_SCRIPT}: Allocates in the script memory
-        space. This is the default memory space if you do not specify a memory space.</li>
-
-        <li>{@link android.renderscript.Allocation#USAGE_GRAPHICS_TEXTURE}: Allocates in the
-        texture memory space of the GPU.</li>
-
-        <li>{@link android.renderscript.Allocation#USAGE_GRAPHICS_VERTEX}: Allocates in the vertex
-        memory space of the GPU.</li>
-
-        <li>{@link android.renderscript.Allocation#USAGE_GRAPHICS_CONSTANTS}: Allocates in the
-        constants memory space of the GPU that is used by the various program objects.</li>
-      </ul>
-
-      <p>You can specify one or all of these memory spaces by OR'ing them together. Doing so notifies
-      the RenderScript runtime that you intend on accessing the data in the specified memory spaces. The following
-      example allocates memory for a custom data type in both the script and vertex memory spaces:</p>
+  <h3 id="struct">Structs</h3>
+  <p>Structs are reflected into their own classes, located in
+    <code>&lt;project_root&gt;/gen/com/example/renderscript/ScriptField_struct_name</code>. This
+    class represents an array of the <code>struct</code> and allows you to allocate memory for a
+    specified number of <code>struct</code>s. For example, if you declare the following struct:</p>
 <pre>
-ScriptField_Point touchPoints = new ScriptField_Point(glRenderer, 2,
-Allocation.USAGE_SCRIPT | Allocation.USAGE_GRAPHICS_VERTEX);
+typedef struct Point {
+float2 point;
+} Point_t;
 </pre>
 
-      <p>If you modify the memory in one memory space and want to push the updates to the rest of
-      the memory spaces, call <code>rsgAllocationSyncAll()</code> in your RenderScript code to
-      synchronize the memory.</p>
-    </li>
-
-    <li>A static nested class, <code>Item</code>, allows you to create an instance of the
-    <code>struct</code>, in the form of an object. This is useful if it makes more sense to work
-    with the <code>struct</code> in your Android code. When you are done manipulating the object,
-    you can push the object to the allocated memory by calling <code>set(Item i, int index, boolean
-    copyNow)</code> and setting the <code>Item</code> to the desired position in the array. The
-    native RenderScript code automatically has access to the newly written memory.
-
-    <li>Accessor methods to get and set the values of each field in a struct. Each of these
-    accessor methods have an <code>index</code> parameter to specify the <code>struct</code> in the
-    array that you want to read or write to. Each setter method also has a <code>copyNow</code>
-    parameter that specifies whether or not to immediately sync this memory to the native
-    RenderScript layer. To sync any memory that has not been synced, call <code>copyAll()</code>.</li>
-
-    <li>The createElement() method creates an object that describes the memory layout of the struct.</li>
-
-    <li>resize() works much like a <code>realloc</code>, allowing you to expand previously
-    allocated memory, maintaining the current values that were previously set.</li>
-
-    <li>copyAll() synchronizes memory that was set on the framework level to the native level. When you call
-    a set accessor method on a member, there is an optional <code>copyNow</code> boolean parameter that you can specify. Specifying
-    <code>true</code> synchronizes the memory when you call the method. If you specify false, you can call <code>copyAll()</code>
-    once, and it synchronizes memory for the all the properties that are not synchronized.</li>
-  </ul>
-
-  <p>The following example shows the reflected class, <code>ScriptField_Point.java</code> that is
-  generated from the Point <code>struct</code>.</p>
-  <pre>
-package com.example.renderscript;
+<p>then the following code is generated in <code>ScriptField_Point.java</code>:
+<pre>
+package com.example.android.rs.hellocompute;
 
 import android.renderscript.*;
 import android.content.res.Resources;
 
-
+  /**
+  * @hide
+  */
 public class ScriptField_Point extends android.renderscript.Script.FieldBase {
-    static public class Item {
-        public static final int sizeof = 8;
 
-        Float2 point;
+    static public class Item {
+        public static final int sizeof = 12;
+
+        Float2 position;
+        float size;
 
         Item() {
-            point = new Float2();
+            position = new Float2();
         }
-
     }
 
     private Item mItemArray[];
     private FieldPacker mIOBuffer;
     public static Element createElement(RenderScript rs) {
         Element.Builder eb = new Element.Builder(rs);
-        eb.add(Element.F32_2(rs), "point");
+        eb.add(Element.F32_2(rs), "position");
+        eb.add(Element.F32(rs), "size");
         return eb.create();
     }
 
@@ -573,9 +362,11 @@
     }
 
     private void copyToArray(Item i, int index) {
-        if (mIOBuffer == null) mIOBuffer = new FieldPacker(Item.sizeof * getType().getX()/* count */);
+        if (mIOBuffer == null) mIOBuffer = new FieldPacker(Item.sizeof * getType().getX()/* count
+        */);
         mIOBuffer.reset(index * Item.sizeof);
-        mIOBuffer.addF32(i.point);
+        mIOBuffer.addF32(i.position);
+        mIOBuffer.addF32(i.size);
     }
 
     public void set(Item i, int index, boolean copyNow) {
@@ -585,7 +376,6 @@
             copyToArray(i, index);
             mAllocation.setFromFieldPacker(index, mIOBuffer);
         }
-
     }
 
     public Item get(int index) {
@@ -593,24 +383,42 @@
         return mItemArray[index];
     }
 
-    public void set_point(int index, Float2 v, boolean copyNow) {
-        if (mIOBuffer == null) mIOBuffer = new FieldPacker(Item.sizeof * getType().getX()/* count */)fnati;
+    public void set_position(int index, Float2 v, boolean copyNow) {
+        if (mIOBuffer == null) mIOBuffer = new FieldPacker(Item.sizeof * getType().getX()/* count */);
         if (mItemArray == null) mItemArray = new Item[getType().getX() /* count */];
         if (mItemArray[index] == null) mItemArray[index] = new Item();
-        mItemArray[index].point = v;
-        if (copyNow)  {
+        mItemArray[index].position = v;
+        if (copyNow) {
             mIOBuffer.reset(index * Item.sizeof);
             mIOBuffer.addF32(v);
             FieldPacker fp = new FieldPacker(8);
             fp.addF32(v);
             mAllocation.setFromFieldPacker(index, 0, fp);
         }
-
     }
 
-    public Float2 get_point(int index) {
+    public void set_size(int index, float v, boolean copyNow) {
+        if (mIOBuffer == null) mIOBuffer = new FieldPacker(Item.sizeof * getType().getX()/* count */);
+        if (mItemArray == null) mItemArray = new Item[getType().getX() /* count */];
+        if (mItemArray[index] == null) mItemArray[index] = new Item();
+        mItemArray[index].size = v;
+        if (copyNow)  {
+            mIOBuffer.reset(index * Item.sizeof + 8);
+            mIOBuffer.addF32(v);
+            FieldPacker fp = new FieldPacker(4);
+            fp.addF32(v);
+            mAllocation.setFromFieldPacker(index, 1, fp);
+        }
+    }
+
+    public Float2 get_position(int index) {
         if (mItemArray == null) return null;
-        return mItemArray[index].point;
+        return mItemArray[index].position;
+    }
+
+    public float get_size(int index) {
+        if (mItemArray == null) return 0;
+        return mItemArray[index].size;
     }
 
     public void copyAll() {
@@ -627,13 +435,361 @@
             System.arraycopy(mItemArray, 0, ni, 0, copySize);
             mItemArray = ni;
         }
-
         mAllocation.resize(newSize);
         if (mIOBuffer != null) mIOBuffer = new FieldPacker(Item.sizeof * getType().getX()/* count */);
     }
-
 }
 </pre>
 
-</body>
-</html>
+<p>The generated code is provided to you as a convenience to allocate memory for structs requested
+by the Renderscript runtime and to interact with <code>struct</code>s
+in memory. Each <code>struct</code>'s class defines the following methods and constructors:</p>
+
+  <ul>
+    <li>Overloaded constructors that allow you to allocate memory. The
+      <code>ScriptField_<em>struct_name</em>(RenderScript rs, int count)</code> constructor allows
+      you to define the number of structures that you want to allocate memory for with the
+      <code>count</code> parameter. The <code>ScriptField_<em>struct_name</em>(RenderScript rs, int
+        count, int usages)</code> constructor defines an extra parameter, <code>usages</code>, that
+      lets you specify the memory space of this memory allocation. There are four memory space
+      possibilities:
+
+      <ul>
+        <li>{@link android.renderscript.Allocation#USAGE_SCRIPT}: Allocates in the script memory
+          space. This is the default memory space if you do not specify a memory space.</li>
+
+        <li>{@link android.renderscript.Allocation#USAGE_GRAPHICS_TEXTURE}: Allocates in the
+          texture memory space of the GPU.</li>
+
+        <li>{@link android.renderscript.Allocation#USAGE_GRAPHICS_VERTEX}: Allocates in the vertex
+          memory space of the GPU.</li>
+
+        <li>{@link android.renderscript.Allocation#USAGE_GRAPHICS_CONSTANTS}: Allocates in the
+          constants memory space of the GPU that is used by the various program objects.</li>
+      </ul>
+
+      <p>You can specify multiple memory spaces by using the bitwise <code>OR</code> operator. Doing so
+        notifies the Renderscript runtime that you intend on accessing the data in the
+        specified memory spaces. The following example allocates memory for a custom data type
+        in both the script and vertex memory spaces:</p>
+      <pre>
+        ScriptField_Point touchPoints = new ScriptField_Point(glRenderer, 2,
+        Allocation.USAGE_SCRIPT | Allocation.USAGE_GRAPHICS_VERTEX);
+      </pre>
+
+      <p>If you modify the memory in one memory space and want to push the updates to the rest of
+        the memory spaces, call <code>rsgAllocationSyncAll()</code> in your Renderscript code to
+        synchronize the memory.</p>
+    </li>
+
+    <li>A static nested class, <code>Item</code>, allows you to create an instance of the
+      <code>struct</code>, in the form of an object. This nested class is useful if it makes more sense to work
+      with the <code>struct</code> in your Android code. When you are done manipulating the object,
+      you can push the object to the allocated memory by calling <code>set(Item i, int index,
+        boolean copyNow)</code> and setting the <code>Item</code> to the desired position in
+the array. The Renderscript runtime automatically has access to the newly written memory.
+
+      <li>Accessor methods to get and set the values of each field in a struct. Each of these
+        accessor methods have an <code>index</code> parameter to specify the <code>struct</code> in
+        the array that you want to read or write to. Each setter method also has a
+<code>copyNow</code> parameter that specifies whether or not to immediately sync this memory
+to the Renderscript runtime. To sync any memory that has not been synced, call
+        <code>copyAll()</code>.</li>
+
+      <li>The <code>createElement()</code> method creates a description of the struct in memory. This
+      description is used to allocate memory consisting of one or many elements.</li>
+
+      <li><code>resize()</code> works much like a <code>realloc()</code> in C, allowing you to
+expand previously allocated memory, maintaining the current values that were previously
+created.</li>
+
+      <li><code>copyAll()</code> synchronizes memory that was set on the framework level to the
+Renderscript runtime. When you call a set accessor method on a member, there is an optional
+<code>copyNow</code> boolean parameter that you can specify. Specifying
+        <code>true</code> synchronizes the memory when you call the method. If you specify false,
+        you can call <code>copyAll()</code> once, and it synchronizes memory for all the
+properties that are not yet synchronized.</li>
+    </ul>
+
+  <h2 id="mem-allocation">Memory Allocation APIs</h2>
+
+ <p>Applications that use Renderscript still run in the Android VM. The actual Renderscript code, however, runs natively and
+  needs access to the memory allocated in the Android VM. To accomplish this, you must
+  attach the memory that is allocated in the VM to the Renderscript runtime. This
+process, called binding, allows the Renderscript runtime to seamlessly work with memory that it
+requests but cannot explicitly allocate. The end result is essentially the same as if you had
+called <code>malloc</code> in C. The added benefit is that the Android VM can carry out garbage collection as well as
+share memory with the Renderscript runtime layer. Binding is only necessary for dynamically allocated memory. Statically
+allocated memory is automatically created for your Renderscript code at compile time. See <a href="#figure1">Figure 1</a>
+for more information on how memory allocation occurs.
+</p>
+
+  <p>To support this memory allocation system, there are a set of APIs that allow the Android VM to
+allocate memory and offer similar functionality to a <code>malloc</code> call. These classes
+essentially describe how memory should be allocated and also carry out the allocation. To better
+understand how these classes work, it is useful to think of them in relation to a simple
+<code>malloc</code> call that can look like this: </p>
+
+  <pre>array = (int *)malloc(sizeof(int)*10);</pre>
+
+  <p>The <code>malloc</code> call can be broken up into two parts: the size of the memory being allocated (<code>sizeof(int)</code>),
+  along with how many units of that memory should be allocated (10). The Android framework provides classes for these two parts as
+  well as a class to represent <code>malloc</code> itself.</p>
+
+  <p>The {@link android.renderscript.Element} class represents the (<code>sizeof(int)</code>) portion
+  of the <code>malloc</code> call and encapsulates one cell of a memory allocation, such as a single
+  float value or a struct. The {@link android.renderscript.Type} class encapsulates the {@link android.renderscript.Element}
+  and the amount of elements to allocate (10 in our example). You can think of a {@link android.renderscript.Type} as
+  an array of {@link android.renderscript.Element}s. The {@link android.renderscript.Allocation} class does the actual
+  memory allocation based on a given {@link android.renderscript.Type} and represents the actual allocated memory.</p>
+
+  <p>In most situations, you do not need to call these memory allocation APIs directly. The reflected layer
+  classes generate code to use these APIs automatically and all you need to do to allocate memory is call a
+  constructor that is declared in one of the reflected layer classes and then bind
+  the resulting memory {@link android.renderscript.Allocation} to the Renderscript.
+  There are some situations where you would want to use these classes directly to allocate memory on your
+  own, such as loading a bitmap from a resource or when you want to allocate memory for pointers to
+  primitive types. You can see how to do this in the
+  <a href="#allocating-mem">Allocating and binding memory to the Renderscript</a> section.
+  The following table describes the three memory management classes in more detail:</p>
+
+  <table id="mem-mgmt-table">
+    <tr>
+      <th>Android Object Type</th>
+
+      <th>Description</th>
+    </tr>
+
+    <tr>
+      <td>{@link android.renderscript.Element}</td>
+
+      <td>
+        <p>An element describes one cell of a memory allocation and can have two forms: basic or
+        complex.</p>
+
+        <p>A basic element contains a single component of data of any valid Renderscript data type.
+        Examples of basic element data types include a single <code>float</code> value, a <code>float4</code> vector, or a
+        single RGB-565 color.</p>
+
+        <p>Complex elements contain a list of basic elements and are created from
+        <code>struct</code>s that you declare in your Renderscript code. For instance an allocation
+        can contain multiple <code>struct</code>s arranged in order in memory. Each struct is considered as its
+        own element, rather than each data type within that struct.</p>
+      </td>
+    </tr>
+
+    <tr>
+      <td>{@link android.renderscript.Type}</td>
+
+      <td>
+        <p>A type is a memory allocation template and consists of an element and one or more
+        dimensions. It describes the layout of the memory (basically an array of {@link
+        android.renderscript.Element}s) but does not allocate the memory for the data that it
+        describes.</p>
+
+        <p>A type consists of five dimensions: X, Y, Z, LOD (level of detail), and Faces (of a cube
+        map). You can assign the X,Y,Z dimensions to any positive integer value within the
+        constraints of available memory. A single dimension allocation has an X dimension of
+        greater than zero while the Y and Z dimensions are zero to indicate not present. For
+        example, an allocation of x=10, y=1 is considered two dimensional and x=10, y=0 is
+        considered one dimensional. The LOD and Faces dimensions are booleans to indicate present
+        or not present.</p>
+      </td>
+    </tr>
+
+    <tr>
+      <td>{@link android.renderscript.Allocation}</td>
+
+      <td>
+        <p>An allocation provides the memory for applications based on a description of the memory
+        that is represented by a {@link android.renderscript.Type}. Allocated memory can exist in
+        many memory spaces concurrently. If memory is modified in one space, you must explicitly
+        synchronize the memory, so that it is updated in all the other spaces in which it exists.
+        </p>
+
+        <p>Allocation data is uploaded in one of two primary ways: type checked and type unchecked.
+        For simple arrays there are <code>copyFrom()</code> functions that take an array from the
+        Android system and copy it to the native layer memory store. The unchecked variants allow
+        the Android system to copy over arrays of structures because it does not support
+        structures. For example, if there is an allocation that is an array of n floats, the data
+        contained in a float[n] array or a <code>byte[n*4]</code> array can be copied.</p>
+      </td>
+    </tr>
+  </table>
+
+  <h2 id="memory">Working with Memory</h2>
+
+<p>Non-static, global variables that you declare in your Renderscript are allocated memory at compile time.
+You can work with these variables directly in your Renderscript code without having to allocate
+memory for them at the Android framework level. The Android framework layer also has access to these variables
+with the provided accessor methods that are generated in the reflected layer classes. If these variables are
+initialized at the Renderscript runtime layer, those values are used to initialize the corresponding
+values in the Android framework layer. If global variables are marked as const, then a <code>set</code> method is
+not generated.</p>
+
+
+<p class="note"><strong>Note:</strong> If you are using certain Renderscript structures that contain pointers, such as
+<code>rs_program_fragment</code> and <code>rs_allocation</code>, you have to obtain an object of the
+corresponding Android framework class first and then call the <code>set</code> method for that
+structure to bind the memory to the Renderscript runtime. You cannot directly manipulate these structures
+at the Renderscript runtime layer. Keep in mind that user-defined structures
+cannot contain pointers, so this restriction only applies to certain structures that are provided by Renderscript. 
+</p>
+
+<p>Renderscript also has support for pointers, but you must explicitly allocate the memory in your
+Android framework code. When you declare a global pointer in your <code>.rs</code> file, you
+allocate memory through the appropriate reflected layer class and bind that memory to the native
+Renderscript layer. You can interact with this memory from the Android framework layer as well as
+the Renderscript layer, which offers you the flexibility to modify variables in the most
+appropriate layer.</p>
+
+
+
+  <h3 id="allocating-mem">Allocating and binding dynamic memory to the Renderscript</h3>
+
+  <p>To allocate dynamic memory, you need to call the constructor of a
+  {@link android.renderscript.Script.FieldBase} class, which is the most common way. An alternative is to create an
+  {@link android.renderscript.Allocation} manually, which is required for things such as primitive type pointers. You should
+  use a {@link android.renderscript.Script.FieldBase} class constructor whenever available for simplicity.
+  After obtaining a memory allocation, call the reflected <code>bind</code> method of the pointer to bind the allocated memory to the
+  Renderscript runtime.</p>
+  <p>The example below allocates memory for both a primitive type pointer,
+   <code>intPointer</code>, and a pointer to a struct, <code>touchPoints</code>. It also binds the memory to the
+  Renderscript:</p>
+  <pre>
+private RenderScriptGL glRenderer;
+private ScriptC_example script;
+private Resources resources;
+
+public void init(RenderScriptGL rs, Resources res) {
+    //get the rendering context and resources from the calling method
+    glRenderer = rs;
+    resources = res;
+
+    //allocate memory for the struct pointer, calling the constructor
+    ScriptField_Point touchPoints = new ScriptField_Point(glRenderer, 2);
+
+    //Create an element manually and allocate memory for the int pointer
+    intPointer = Allocation.createSized(glRenderer, Element.I32(glRenderer), 2);
+
+    //create an instance of the Renderscript, pointing it to the bytecode resource
+    mScript = new ScriptC_example(glRenderer, resources, R.raw.example);
+
+    //bind the struct and int pointers to the Renderscript
+    mScript.bind_touchPoints(touchPoints);
+    script.bind_intPointer(intPointer);
+
+   ...
+}
+</pre>
+
+  <h3>Reading and writing to memory</h3>
+  <p>You can read and write to statically and dynamically allocated memory both at the Renderscript runtime
+  and Android framework layer.</p>
+
+<p>Statically allocated memory comes with a one-way communication restriction
+at the Renderscript runtime level. When Renderscript code changes the value of a variable, it is not
+communicated back to the Android framework layer for efficiency purposes. The last value
+that is set from the Android framework is always returned during a call to a <code>get</code>
+method. However, when Android framework code modifies a variable, that change can be communicated to
+the Renderscript runtime automatically or synchronized at a later time. If you need to send data
+from the Renderscript runtime to the Android framework layer, you can use the <code>rsSendToClient()</code> function
+to overcome this limitation.
+</p>
+<p>When working with dynamically allocated memory, any changes at the Renderscript runtime layer are propagated
+back to the Android framework layer if you modified the memory allocation using its associated pointer.
+Modifying an object at the Android framework layer immediately propagates that change back to the Renderscript
+runtime layer.</p>
+
+  <h4>Reading and writing to global variables</h4>
+
+  <p>Reading and writing to global variables is a straightforward process. You can use the accessor methods
+  at the Android framework level or set them directly in the Renderscript code. Keep in mind that any
+  changes that you make in your Renderscript code are not propagated back to the Android framework layer.</p>
+
+  <p>For example, given the following struct declared in a file named <code>rsfile.rs</code>:</p>
+<pre>
+typedef struct Point {
+    int x;
+    int y;
+} Point_t;
+
+Point_t point;
+
+</pre>
+<p>You can assign values to the struct like this directly in <code>rsfile.rs</code>. These values are not
+propagated back to the Android framework level:</p>
+<pre>
+point.x = 1;
+point.y = 1;
+</pre>
+
+<p>You can assign values to the struct at the Android framework layer like this. These values are 
+propagated back to the Renderscript runtime level:</p>
+<pre>
+ScriptC_rsfile mScript;
+
+...
+
+Item i = new ScriptField_Point.Item();
+i.x = 1;
+i.y = 1;
+mScript.set_point(i);
+</pre>
+
+<p>You can read the values in your Renderscript code like this:</p>
+
+<pre>
+rsDebug("Printing out a Point", point.x, point.y);
+</pre>
+
+<p>You can read the values in the Android framework layer with the following code. Keep in mind that this
+code only returns a value if one was set at the Android framework level. You will get a null pointer
+exception if you only set the value at the Renderscript runtime level:</p>
+
+<pre>
+Log.i("TAGNAME", "Printing out a Point: " + mScript.get_point().x + " " + mScript.get_point().y);
+System.out.println(point.get_x() + " " + point.get_y());
+</pre>
+
+<h4>Reading and writing global pointers</h4>
+
+<p>Assuming that memory has been allocated in the Android framework level and bound to the Renderscript runtime,
+you can read and write memory from the Android framework level by using the <code>get</code> and <code>set</code> methods for that pointer.
+In the Renderscript runtime layer, you can read and write to memory with pointers as normal and the changes are propagated
+back to the Android framework layer, unlike with statically allocated memory.</p>
+
+<p>For example, given the following pointer to a <code>struct</code> in a file named <code>rsfile.rs</code>:</p>
+<pre>
+typedef struct Point {
+    int x;
+    int y;
+} Point_t;
+
+Point_t *point;
+</pre>
+
+<p>Assuming you already allocated memory at the Android framework layer, you can access values in
+the <code>struct</code> as normal. Any changes you make to the struct via its pointer variable
+are automatically available to the Android framework layer:</p>
+
+<pre>
+point[index].x = 1;
+point[index].y = 1;
+</pre>
+
+<p>You can read and write values to the pointer at the Android framework layer as well:
+<pre>
+ScriptField_Point p = new ScriptField_Point(mRS, 1);
+    Item i = new ScriptField_Point.Item();
+    i.x=100;
+    i.y = 100;
+    p.set(i, 0, true);
+    mScript.bind_point(p);
+
+    points.get_x(0);            //read x and y from index 0
+    points.get_x(0);
+</pre>
+
+<p>Once memory is already bound, you do not have to rebind the memory to the Renderscript
+runtime every time you make a change to a value.</p>
diff --git a/docs/html/guide/topics/renderscript/reference.jd b/docs/html/guide/topics/renderscript/reference.jd
new file mode 100644
index 0000000..a0a9df2
--- /dev/null
+++ b/docs/html/guide/topics/renderscript/reference.jd
@@ -0,0 +1,18 @@
+page.title=Runtime API Reference
+@jd:body
+
+<script language="JavaScript">
+
+function autoResize(element){
+    var newheight;
+    var newwidth;
+
+    newheight = element.contentWindow.document.body.scrollHeight + 20;
+    newwidth = element.contentWindow.document.body.scrollWidth;
+    element.height = (newheight) + "px";
+    element.width = (newwidth) + "px";
+}
+</script>
+
+
+<iframe SRC="{@docRoot}reference/renderscript/index.html" width="100%"  id="iframe" marginheight="0" frameborder="0" onLoad="autoResize(this);"></iframe>
diff --git a/docs/html/guide/topics/resources/animation-resource.jd b/docs/html/guide/topics/resources/animation-resource.jd
index eaa698f..6473155 100644
--- a/docs/html/guide/topics/resources/animation-resource.jd
+++ b/docs/html/guide/topics/resources/animation-resource.jd
@@ -335,7 +335,7 @@
 <dd>
 <ul>
   <li><a href="{@docRoot}guide/topics/graphics/animation.html">Property Animation</a></li>
-  <li><a href="http://zoso:8080/resources/samples/ApiDemos/src/com/example/android/apis/animation/index.html">API Demos</a> for examples
+  <li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/animation/index.html">API Demos</a> for examples
   on how to use the property animation system.</li>
 </ul>
 </dd>
diff --git a/docs/html/guide/topics/resources/providing-resources.jd b/docs/html/guide/topics/resources/providing-resources.jd
index 3a176e6..380791a 100644
--- a/docs/html/guide/topics/resources/providing-resources.jd
+++ b/docs/html/guide/topics/resources/providing-resources.jd
@@ -231,6 +231,9 @@
     </ul>
     <p>You can append more than one <em>{@code &lt;qualifier&gt;}</em>. Separate each
 one with a dash.</p>
+    <p class="caution"><strong>Caution:</strong> When appending multiple qualifiers, you must
+place them in the same order in which they are listed in table 2. If the qualifiers are ordered
+wrong, the resources are ignored.</p>
   </li>
   <li>Save the respective alternative resources in this new directory. The resource files must be
 named exactly the same as the default resource files.</li>
@@ -254,20 +257,14 @@
 the same. This way, the resource ID that you use to reference the {@code icon.png} or {@code
 background.png} image is always the same, but Android selects the
 version of each resource that best matches the current device, by comparing the device
-configuration information with the qualifiers in the alternative resource directory name.</p>
+configuration information with the qualifiers in the resource directory name.</p>
 
 <p>Android supports several configuration qualifiers and you can
 add multiple qualifiers to one directory name, by separating each qualifier with a dash. Table 2
 lists the valid configuration qualifiers, in order of precedence&mdash;if you use multiple
-qualifiers for one resource directory, they must be added to the directory name in the order they
+qualifiers for a resource directory, you must add them to the directory name in the order they
 are listed in the table.</p>
 
-<p class="note"><strong>Note:</strong> Some configuration qualifiers were added after Android 1.0,
-so not
-all versions of Android support all the qualifiers listed in table 2. New qualifiers
-indicate the version in which they were added. To avoid any issues, always include a set of default
-resources for resources that your application uses. For more information, see the section about <a
-href="#Compatibility">Providing the Best Device Compatibility with Resources</a>.</p>
 
 <p class="table-caption" id="table2"><strong>Table 2.</strong> Configuration qualifier
 names.</p>
@@ -752,6 +749,17 @@
 </table>
 
 
+<p class="note"><strong>Note:</strong> Some configuration qualifiers have been added since Android
+1.0, so not all versions of Android support all the qualifiers. Using a new qualifier implicitly
+adds the platform version qualifier so that older devices are sure to ignore it. For example, using
+a <code>w600dp</code> qualifier will automatically include the <code>v13</code> qualifier, because
+the available-width qualifier was new in API level 13. To avoid any issues, always include a set of
+default resources (a set of resources with <em>no qualifiers</em>). For more information, see the
+section about <a href="#Compatibility">Providing the Best Device Compatibility with
+Resources</a>.</p>
+
+
+
 <h3 id="QualifierRules">Qualifier name rules</h3>
 
 <p>Here are some rules about using configuration qualifier names:</p>
diff --git a/docs/html/guide/topics/search/search-dialog.jd b/docs/html/guide/topics/search/search-dialog.jd
index e06563d..8b8e75b 100644
--- a/docs/html/guide/topics/search/search-dialog.jd
+++ b/docs/html/guide/topics/search/search-dialog.jd
@@ -544,7 +544,8 @@
 }
 </pre>
 
-<p>If the user cancels search by pressing the BACK button, the search dialog closes and the activity
+<p>If the user cancels search by pressing the <em>Back</em> button, the search dialog closes and the
+activity
 regains input focus. You can register to be notified when the search dialog is
 closed with {@link android.app.SearchManager#setOnDismissListener(SearchManager.OnDismissListener)
 setOnDismissListener()}
@@ -569,7 +570,8 @@
 android.content.Intent#ACTION_SEARCH} intent with a call to {@link
 android.app.Activity#onCreate(Bundle) onCreate()} and a new instance of the
 activity is brought to the top of the activity stack. There are now two instances of your
-searchable activity in the activity stack (so pressing the BACK button goes back to the previous
+searchable activity in the activity stack (so pressing the <em>Back</em> button goes back to the
+previous
 instance of the searchable activity, rather than exiting the searchable activity).</li>
   <li>If you set {@code android:launchMode} to <code>"singleTop"</code>, then the
 searchable activity receives the {@link android.content.Intent#ACTION_SEARCH} intent with a call
diff --git a/docs/html/guide/topics/sensors/sensors_motion.jd b/docs/html/guide/topics/sensors/sensors_motion.jd
index 3f712b2..b6c3cb4 100644
--- a/docs/html/guide/topics/sensors/sensors_motion.jd
+++ b/docs/html/guide/topics/sensors/sensors_motion.jd
@@ -28,7 +28,7 @@
 href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/os/RotationVectorDemo.html">
 API Demos (OS - RotationVectorDemo)</a></li>
       <li><a
-href="{@docRoot}/resources/samples/ApiDemos/src/com/example/android/apis/os/RotationVectorDemo.html"
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/os/RotationVectorDemo.html"
 >API Demos (OS - Sensors)</a></li>
     </ol>
     <h2>See also</h2>
diff --git a/docs/html/guide/topics/testing/testing_android.jd b/docs/html/guide/topics/testing/testing_android.jd
index c8a3f6e..adbc59d 100755
--- a/docs/html/guide/topics/testing/testing_android.jd
+++ b/docs/html/guide/topics/testing/testing_android.jd
@@ -318,7 +318,7 @@
     A useful general test case class, especially if you are
     just starting out with Android testing, is {@link android.test.AndroidTestCase}. It extends
     both {@link junit.framework.TestCase} and {@link junit.framework.Assert}. It provides the
-    JUnit-standard <code>setUp()</code> and <code>tearDown()</code> methods, as well as well as
+    JUnit-standard <code>setUp()</code> and <code>tearDown()</code> methods, as well as
     all of JUnit's Assert methods. In addition, it provides methods for testing permissions, and a
     method that guards against memory leaks by clearing out certain class references.
 </p>
@@ -401,7 +401,7 @@
     Mock objects isolate tests from a running system by stubbing out or overriding
     normal operations. For example, a {@link android.test.mock.MockContentResolver}
     replaces the normal resolver framework with its own local framework, which is isolated
-    from the rest of the system. MockContentResolver also also stubs out the
+    from the rest of the system. MockContentResolver also stubs out the
     {@link android.content.ContentResolver#notifyChange(Uri, ContentObserver, boolean)} method
     so that observer objects outside the test environment are not accidentally triggered.
 </p>
diff --git a/docs/html/guide/topics/ui/actionbar.jd b/docs/html/guide/topics/ui/actionbar.jd
index 3c0ef26..e59fa0f 100644
--- a/docs/html/guide/topics/ui/actionbar.jd
+++ b/docs/html/guide/topics/ui/actionbar.jd
@@ -73,8 +73,10 @@
 API Demos</a></li>
   </ol>
 
-  <h2>See also</h2>item
+  <h2>See also</h2>
   <ol>
+    <li><a
+href="{@docRoot}design/patterns/actionbar.html">Android Design: Action Bar</a></li>
     <li><a href="{@docRoot}guide/topics/ui/menus.html">Menus</a></li>
     <li><a href="{@docRoot}guide/practices/tablets-and-handsets.html">Supporting Tablets
 and Handsets</a></li>
@@ -111,9 +113,10 @@
 href="{@docRoot}guide/topics/ui/menus.html#OptionsMenu">options menu</a> directly in the action bar,
 as "action items." Action items can also provide an "action view," which provides an embedded
 widget for even more immediate action behaviors. Menu items that are not promoted
-to an action item are available in the overflow menu, revealed by either the device MENU button
+to an action item are available in the overflow menu, revealed by either the device <em>Menu</em>
+button
 (when available) or by an "overflow menu" button in the action bar (when the device does not
-include a MENU button).</p>
+include a <em>Menu</em> button).</p>
 </li>
 </ul>
 
@@ -123,6 +126,18 @@
 landscape handset), showing the logo on the left, navigation tabs, and an action item on the
 right (plus the overflow menu button).</p>
 
+<p class="note"><strong>Note:</strong> If you're looking for information about the contextual
+action bar for displaying contextual action items, see the <a
+href="{@docRoot}guide/topics/ui/menus.html#context-menu">Menu</a> guide.</p>
+
+
+<div class="design-announce">
+<p><strong>Action Bar Design</strong></p>
+  <p>For design guidelines, read Android Design's <a
+href="{@docRoot}design/patterns/actionbar.html">Action Bar</a> guide.</p>
+</div>
+
+
 
 <div class="sidebox-wrapper">
 <div class="sidebox">
@@ -215,9 +230,10 @@
 href="{@docRoot}guide/topics/ui/menus.html#OptionsMenu">options menu</a>. To do this, you can
 declare that the menu item should appear in the action bar as an "action item." An action item can
 include an icon and/or a text title. If a menu item does not appear as an action item, then the
-system places it in the overflow menu. The overflow menu is revealed either by the device MENU
+system places it in the overflow menu. The overflow menu is revealed either by the device
+<em>Menu</em>
 button (if provided by the device) or an additional button in the action bar (if the device does not
-provide the MENU button).</p>
+provide the <em>Menu</em> button).</p>
 
 <div class="figure" style="width:359px">
   <img src="{@docRoot}images/ui/actionbar-item-withtext.png" height="57" alt="" />
@@ -536,6 +552,12 @@
 <p class="img-caption"><strong>Figure 6.</strong> Example behavior for UP navigation after
 entering the Email app from the People app.</p>
 
+<div class="design-announce">
+<p><strong>Navigation Design</strong></p>
+  <p>For more about how <em>Up</em> and <em>Back</em> navigation differ, read Android Design's <a
+href="{@docRoot}design/patterns/navigation.html">Navigation</a> guide.</p>
+</div>
+
 <p>To enable the icon for up navigation (which displays the "up" indicator next to the icon), call
 {@link android.app.ActionBar#setDisplayHomeAsUpEnabled setDisplayHomeAsUpEnabled(true)} on your
 {@link android.app.ActionBar}:</p>
@@ -642,7 +664,7 @@
   <p>Adding this value requires that you set your build target to Android 4.0 or higher in order to
 compile. Older versions of Android ignore the {@code "collapseActionView"} value because they don't
 understand it. Just be sure not to use other APIs in your source code that are not supported in the
-version declared by your <a href="{@docRoot}guide/topics/manifest/uses-sdk-elementl.html#min">{@code
+version declared by your <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
 minSdkVersion}</a>, unless you add the appropriate version check at runtime.</p>
 </div>
 </div>
@@ -843,8 +865,8 @@
 android.app.Activity#onOptionsItemSelected onOptionsItemSelected()} callback method.</p>
 
 <p>For a sample using the share action provider, see
-<a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/ActionBarActionProviderActivity.html"
->ActionBarActionProviderActivity</a>.
+<a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/ActionBarShareActionProviderActivity.html"
+>ActionBarShareActionProviderActivity</a>.
 
 
 
@@ -1405,7 +1427,7 @@
     &lt;/style>
 
     &lt;!-- style for the action bar tab text -->
-    &lt;style name="CustomTabTextStyle">
+    &lt;style name="CustomTabTextStyle" parent="@android:style/TextAppearance.Holo">
         &lt;item name="android:textColor">#2456c2&lt;/item>
     &lt;/style>
 &lt;/resources>
@@ -1421,8 +1443,7 @@
 manifest file like this:</p>
 
 <pre>
-&lt;application android:theme="&#64;style/CustomActivityTheme"
-             ... />
+&lt;application android:theme="&#64;style/CustomActivityTheme" ... />
 </pre>
 
 <p>For more information about using style and theme resources in your application, read <a
@@ -1441,7 +1462,7 @@
 parent action bar style such as {@link android.R.style#Widget_Holo_ActionBar
 Widget.Holo.ActionBar}.</p>
 
-<p>For example, if you want to change the action bar's background, you could use the following
+<p>For example, if you want to change the action bar's background, you can use the following
 styles:</p>
 
 <pre>
@@ -1449,14 +1470,15 @@
 &lt;resources>
     &lt;!-- the theme applied to the application or activity -->
     &lt;style name="CustomActivityTheme" parent="@android:style/Theme.Holo">
-        &lt;item name="android:actionBarTabTextStyle">@style/customTabTextStyle&lt;/item>
+        &lt;item name="android:actionBarStyle">@style/MyActionBar&lt;/item>
         &lt;!-- other activity and action bar styles here -->
     &lt;/style>
 
-    &lt;!-- style for the action bar, simply to change the background -->
-    &lt;style parent="@android:style/Widget.Holo.ActionBar">
+    &lt;!-- style for the action bar backgrounds -->
+    &lt;style name="MyActionBar" parent="@android:style/Widget.Holo.ActionBar">
         &lt;item name="android:background">@drawable/ab_background&lt;/item>
-        &lt;item name="android:backgroundSplit">@drawable/ab_background&lt;/item>
+        &lt;item name="android:backgroundStacked">@drawable/ab_background&lt;/item>
+        &lt;item name="android:backgroundSplit">@drawable/ab_split_background&lt;/item>
     &lt;/style>
 &lt;/resources>
 </pre>
diff --git a/docs/html/guide/topics/ui/dialogs.jd b/docs/html/guide/topics/ui/dialogs.jd
index 16f14cb..82cbfd1 100644
--- a/docs/html/guide/topics/ui/dialogs.jd
+++ b/docs/html/guide/topics/ui/dialogs.jd
@@ -37,6 +37,11 @@
       <li><a href="{@docRoot}resources/tutorials/views/hello-timepicker.html">Hello
 TimePicker</a></li>
     </ol>
+    
+    <h2>See also</h2>
+    <ol>
+      <li><a href="{@docRoot}design/building-blocks/dialogs.html">Android Design: Dialogs</a></li>
+    </ol>
   </div>
 </div>
 
@@ -70,6 +75,13 @@
 base {@link android.app.Dialog} object or any of the subclasses listed above and define a new layout.
 See the section on <a href="#CustomDialog">Creating a Custom Dialog</a> below.</p>
 
+<div class="design-announce">
+<p><strong>Dialog Design</strong></p>
+  <p>For design guidelines, read Android Design's <a
+href="{@docRoot}design/building-blocks/dialogs.html">Dialogs</a> guide.</p>
+</div>
+
+
 
 <h2 id="ShowingADialog">Showing a Dialog</h2>
 
diff --git a/docs/html/guide/topics/ui/how-android-draws.jd b/docs/html/guide/topics/ui/how-android-draws.jd
index 3a57afa..6a8cd86 100644
--- a/docs/html/guide/topics/ui/how-android-draws.jd
+++ b/docs/html/guide/topics/ui/how-android-draws.jd
@@ -62,7 +62,7 @@
 
    <p>
    The measure pass uses two classes to communicate dimensions. The
-   {@link android.view.View.MeasureSpec} class is used by Views to tell their parents how they
+   {@link android.view.ViewGroup.LayoutParams} class is used by Views to tell their parents how they
    want to be measured and positioned. The base LayoutParams class just
    describes how big the View wants to be for both width and height. For each
    dimension, it can specify one of:</p>
diff --git a/docs/html/guide/topics/ui/index.jd b/docs/html/guide/topics/ui/index.jd
index d3060c5..83c8150 100644
--- a/docs/html/guide/topics/ui/index.jd
+++ b/docs/html/guide/topics/ui/index.jd
@@ -174,7 +174,8 @@
 
 <p>Application menus are another important part of an application's UI. Menus offers a reliable interface that reveals
 application functions and settings. The most common application menu is revealed by pressing
-the MENU key on the device. However, you can also add Context Menus, which may be revealed when the user presses
+the <em>Menu</em> button on the device. However, you can also add Context Menus, which may be
+revealed when the user presses
 and holds down on an item.</p>
 
 <p>Menus are also structured using a View hierarchy, but you don't define this structure yourself. Instead,
diff --git a/docs/html/guide/topics/ui/menus.jd b/docs/html/guide/topics/ui/menus.jd
index 7b5b3dc..d51a378 100644
--- a/docs/html/guide/topics/ui/menus.jd
+++ b/docs/html/guide/topics/ui/menus.jd
@@ -6,77 +6,129 @@
 <div id="qv-wrapper">
 <div id="qv">
   <h2>In this document</h2>
-  <ol>
-    <li><a href="#xml">Creating a Menu Resource</a></li>
-    <li><a href="#Inflating">Inflating a Menu Resource</a>
-    <li><a href="#options-menu">Creating an Options Menu</a>
-      <ol>
-        <li><a href="#ChangingTheMenu">Changing menu items at runtime</a></li>
-      </ol>
-    </li>
-    <li><a href="#context-menu">Creating a Context Menu</a></li>
-    <li><a href="#submenu">Creating a Submenu</a></li>
-    <li><a href="#features">Other Menu Features</a>
-      <ol>
-        <li><a href="#groups">Menu groups</a></li>
-        <li><a href="#checkable">Checkable menu items</a></li>
-        <li><a href="#shortcuts">Shortcut keys</a></li>
-        <li><a href="#intents">Dynamically adding menu intents</a></li>
-      </ol>
-    </li>
-  </ol>
+<ol>
+  <li><a href="#xml">Defining a Menu in XML</a></li>
+  <li><a href="#options-menu">Creating an Options Menu</a>
+    <ol>
+      <li><a href="#RespondingOptionsMenu">Handling click events</a></li>
+      <li><a href="#ChangingTheMenu">Changing menu items at runtime</a></li>
+    </ol>
+  </li>
+  <li><a href="#context-menu">Creating Contextual Menus</a>
+    <ol>
+      <li><a href="#FloatingContextMenu">Creating a floating context menu</a></li>
+      <li><a href="#CAB">Using the contextual action mode</a></li>
+    </ol>
+  </li>
+  <li><a href="#PopupMenu">Creating a Popup Menu</a>
+    <ol>
+      <li><a href="#PopupEvents">Handling click events</a></li>
+    </ol>
+  </li>
+  <li><a href="#groups">Creating Menu Groups</a>
+    <ol>
+      <li><a href="#checkable">Using checkable menu items</a></li>
+    </ol>
+  </li>
+  <li><a href="#intents">Adding Menu Items Based on an Intent</a>
+    <ol>
+      <li><a href="#AllowingToAdd">Allowing your activity to be added to other menus</a></li>
+    </ol>
+  </li>
+</ol>
 
   <h2>Key classes</h2>
   <ol>
     <li>{@link android.view.Menu}</li>
     <li>{@link android.view.MenuItem}</li>
     <li>{@link android.view.ContextMenu}</li>
-    <li>{@link android.view.SubMenu}</li>
+    <li>{@link android.view.ActionMode}</li>
   </ol>
 
   <h2>See also</h2>
   <ol>
     <li><a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a></li>
     <li><a href="{@docRoot}guide/topics/resources/menu-resource.html">Menu Resource</a></li>
+    <li><a
+href="http://android-developers.blogspot.com/2012/01/say-goodbye-to-menu-button.html">Say
+Goodbye to the Menu Button</a></li>
   </ol>
 </div>
 </div>
 
-<p>Menus are an important part of an activity's user interface, which provide users a familiar
-way to perform actions. Android offers a simple framework for you to add standard
-menus to your application.</p>
+<p>Menus are a common user interface component in many types of applications. To provide a familiar
+and consistent user experience, you should use the {@link android.view.Menu} APIs to present user
+actions and other options in your activities.</p>
 
-<p>There are three types of application menus:</p>
+<p>Beginning with Android 3.0 (API level 11), Android-powered devices are no longer required to
+provide a dedicated <em>Menu</em> button. With this change, Android apps should migrate away from a
+dependence on the traditional 6-item menu panel and instead provide an action bar to present common
+user actions.</p>
+
+<p>Although the design and user experience for some menu items have changed, the semantics to define
+a set of actions and options is still based on the {@link android.view.Menu} APIs. This
+guide shows how to create the three fundamental types of menus or action presentations on all
+versions of Android:</p>
+
 <dl>
-  <dt><strong>Options Menu</strong></dt>
-    <dd>The primary collection of menu items for an activity, which appears when the user touches
-the MENU button. When your application is running on Android 3.0 or later, you can provide
-quick access to select menu items by placing them directly in the <a
-href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a>, as "action items."</dd>
-  <dt><strong>Context Menu</strong></dt>
-    <dd>A floating list of menu items that appears when the user touches and holds a view
-that's registered to provide a context menu.
+  <dt><strong>Options menu and action bar</strong></dt>
+    <dd>The <a href="#options-menu">options menu</a> is the primary collection of menu items for an
+activity. It's where you should place actions that have a global impact on the app, such as
+"Search," "Compose email," and "Settings."
+  <p>If you're developing for Android 2.3 or lower, users can
+reveal the options menu panel by pressing the <em>Menu</em> button.</p>
+  <p>On Android 3.0 and higher, items from the options menu are presented by the <a
+href="{@docRoot}guide/topics/ui/actionbar.html">action bar</a> as a combination of on-screen action
+items and overflow options. Beginning with Android 3.0, the <em>Menu</em> button is deprecated (some
+devices
+don't have one), so you should migrate toward using the action bar to provide access to actions and
+other options.</p>
+  <p>See the section about <a href="#options-menu">Creating an Options Menu</a>.</p>
+    </dd>
+    
+  <dt><strong>Context menu and contextual action mode</strong></dt>
+  
+   <dd>A context menu is a <a href="#FloatingContextMenu">floating menu</a> that appears when the
+user performs a long-click on an element. It provides actions that affect the selected content or
+context frame.
+  <p>When developing for Android 3.0 and higher, you should instead use the <a
+href="#CAB">contextual action mode</a> to enable actions on selected content. This mode displays
+action items that affect the selected content in a bar at the top of the screen and allows the user
+to select multiple items.</p>
+  <p>See the section about <a href="#context-menu">Creating Contextual Menus</a>.</p>
 </dd>
-  <dt><strong>Submenu</strong></dt>
-    <dd>A floating list of menu items that appears when the user touches a menu item that contains
-a nested menu.</dd>
+    
+  <dt><strong>Popup menu</strong></dt>
+    <dd>A popup menu displays a list of items in a vertical list that's anchored to the view that
+invoked the menu. It's good for providing an overflow of actions that relate to specific content or
+to provide options for a second part of a command. Actions in a popup menu should
+<strong>not</strong> directly affect the corresponding content&mdash;that's what contextual actions
+are for. Rather, the popup menu is for extended actions that relate to regions of content in your
+activity.
+  <p>See the section about <a href="#PopupMenu">Creating a Popup Menu</a>.</p>
+</dd>
 </dl>
 
-<p>This document shows you how to create each type of menu, using XML to define the content of
-the menu and callback methods in your activity to respond when the user selects an item.</p>
 
 
+<h2 id="xml">Defining a Menu in XML</h2>
 
-<h2 id="xml">Creating a Menu Resource</h2>
+<p>For all menu types, Android provides a standard XML format to define menu items.
+Instead of building a menu in your activity's code, you should define a menu and all its items in an
+XML <a href="{@docRoot}guide/topics/resources/menu-resource.html">menu resource</a>. You can then
+inflate the menu resource (load it as a {@link android.view.Menu} object) in your activity or
+fragment.</p>
 
-<p>Instead of instantiating a {@link android.view.Menu} in your application code, you should
-define a menu and all its items in an XML <a
-href="{@docRoot}guide/topics/resources/menu-resource.html">menu resource</a>, then inflate the menu
-resource (load it as a programmable object) in your application code. Using a menu resource to
-define your menu is a good practice because it separates the content for the menu from your
-application code. It's also easier to visualize the structure and content of a menu in XML.</p>
+<p>Using a menu resource is a good practice for a few reasons:</p>
+<ul>
+  <li>It's easier to visualize the menu structure in XML.</li>
+  <li>It separates the content for the menu from your application's behavioral code.</li>
+  <li>It allows you to create alternative menu configurations for different platform versions,
+screen sizes, and other configurations by leveraging the <a
+href="{@docRoot}guide/topics/resources/index.html">app resources</a> framework.</li>
+</ul>
 
-<p>To create a menu resource, create an XML file inside your project's <code>res/menu/</code>
+<p>To define the menu, create an XML file inside your project's <code>res/menu/</code>
 directory and build the menu with the following elements:</p>
 <dl>
   <dt><code>&lt;menu></code></dt>
@@ -90,8 +142,8 @@
     
   <dt><code>&lt;group></code></dt>
     <dd>An optional, invisible container for {@code &lt;item&gt;} elements. It allows you to
-categorize menu items so they share properties such as active state and visibility. See the
-section about <a href="#groups">Menu groups</a>.</dd>
+categorize menu items so they share properties such as active state and visibility. For more
+information, see the section about <a href="#groups">Creating Menu Groups</a>.</dd>
 </dl>
 
 
@@ -101,14 +153,17 @@
 &lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt;
     &lt;item android:id="@+id/new_game"
           android:icon="@drawable/ic_new_game"
-          android:title="@string/new_game" /&gt;
+          android:title="@string/new_game"
+          android:showAsAction="ifRoom"/&gt;
     &lt;item android:id="@+id/help"
           android:icon="@drawable/ic_help"
           android:title="@string/help" /&gt;
 &lt;/menu&gt;
 </pre>
 
-<p>This example defines a menu with two items. Each item includes the attributes:</p>
+<p>The <code>&lt;item></code> element supports several attributes you can use to define an item's
+appearance and behavior. The items in the above menu include the following attributes:</p>
+
 <dl>
   <dt>{@code android:id}</dt>
     <dd>A resource ID that's unique to the item, which allows the application can recognize the item
@@ -117,312 +172,24 @@
     <dd>A reference to a drawable to use as the item's icon.</dd>
   <dt>{@code android:title}</dt>
     <dd>A reference to a string to use as the item's title.</dd>
+  <dt>{@code android:showAsAction}</dt>
+    <dd>Specifies when and how this item should appear as an action item in the <a
+href="{@docRoot}guide/topics/ui/actionbar.html">action bar</a>.</dd>
 </dl>
 
-<p>There are many more attributes you can include in an {@code &lt;item&gt;}, including some that
- specify how the item may appear in the <a
-href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a>. For more information about the XML
-syntax and attributes for a menu resource, see the <a
-href="{@docRoot}guide/topics/resources/menu-resource.html">Menu Resource</a> reference.</p>
+<p>These are the most important attributes you should use, but there are many more available.
+For information about all the supported attributes, see the <a
+href="{@docRoot}guide/topics/resources/menu-resource.html">Menu Resource</a> document.</p>
 
-
-
-<h2 id="Inflating">Inflating a Menu Resource</h2>
-
-<p>From your application code, you can inflate a menu resource (convert the XML resource into a
-programmable object) using
-{@link android.view.MenuInflater#inflate(int,Menu) MenuInflater.inflate()}. For
-example, the following code inflates the <code>game_menu.xml</code> file defined above, during the
-{@link android.app.Activity#onCreateOptionsMenu(Menu) onCreateOptionsMenu()} callback method, to
-use the menu as the activity's Options Menu:</p>
-
-<pre>
-&#64;Override
-public boolean onCreateOptionsMenu(Menu menu) {
-    MenuInflater inflater = getMenuInflater();
-    inflater.inflate(R.menu.game_menu, menu);
-    return true;
-}
-</pre>
-
-<p>The {@link android.app.Activity#getMenuInflater()} method returns a {@link
-android.view.MenuInflater} for the activity. With this object, you can call {@link
-android.view.MenuInflater#inflate(int,Menu) inflate()}, which inflates a menu resource into a
-{@link android.view.Menu} object. In this example, the menu resource defined by
-<code>game_menu.xml</code>
-is inflated into the {@link android.view.Menu} that was passed into {@link
-android.app.Activity#onCreateOptionsMenu(Menu) onCreateOptionsMenu()}. (This callback method for
-the Options Menu is discussed more in the next section.)</p>
-
-
-
-<h2 id="options-menu">Creating an Options Menu</h2>
-
-<div class="figure" style="width:200px">
-  <img src="{@docRoot}images/options_menu.png" height="333" alt="" />
-  <p class="img-caption"><strong>Figure 1.</strong> Screenshot of the Options Menu in the
-Browser.</p>
-</div>
-
-<p>The Options Menu is where you should include basic activity actions and necessary navigation
-items (for example, a button to open the application settings). Items in the Options Menu are
-accessible in two distinct ways: the MENU button or in the <a
-href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> (on devices running Android 3.0
-or higher).</p>
-
-<p>When running on a device with Android 2.3 and lower, the Options Menu appears at the bottom of
-the screen, as shown in figure 1. When opened, the first visible portion of the Options Menu is
-the icon menu. It holds the first six menu items. If you add more than six items to the
-Options Menu, Android places the sixth item and those after it into the overflow menu, which the
-user can open by touching the "More" menu item.</p>
-
-<p>On Android 3.0 and higher, items from the Options Menu is placed in the Action Bar, which appears
-at the top of the activity in place of the traditional title bar. By default all items from the
-Options Menu are placed in the overflow menu, which the user can open by touching the menu icon
-on the right side of the Action Bar. However, you can place select menu items directly in the
-Action Bar as "action items," for instant access, as shown in figure 2.</p>
-
-<p>When the Android system creates the Options Menu for the first time, it calls your
-activity's {@link android.app.Activity#onCreateOptionsMenu(Menu)
-onCreateOptionsMenu()} method. Override this method in your activity
-and populate the {@link android.view.Menu} that is passed into the method,
-{@link android.view.Menu} by inflating a menu resource as described above in <a
-href="#Inflating">Inflating a Menu Resource</a>. For example:</p>
-
-<pre>
-&#64;Override
-public boolean onCreateOptionsMenu(Menu menu) {
-    MenuInflater inflater = getMenuInflater();
-    inflater.inflate(R.menu.game_menu, menu);
-    return true;
-}
-</pre>
-
-<div class="figure" style="width:450px">
-<img src="{@docRoot}images/ui/actionbar.png" alt="" />
-<p class="img-caption"><strong>Figure 2.</strong> Action bar from the <a
-href="{@docRoot}resources/samples/HoneycombGallery/index.html">Honeycomb Gallery</a> app, including
-navigation tabs and a camera action item (plus the overflow menu button).</p>
-</div>
-
-<p>You can also populate the menu in code, using {@link android.view.Menu#add(int,int,int,int)
-add()} to add items to the {@link android.view.Menu}.</p>
-
-<p class="note"><strong>Note:</strong> On Android 2.3 and lower, the system calls {@link
-android.app.Activity#onCreateOptionsMenu(Menu) onCreateOptionsMenu()} to create the Options Menu
-when the user opens it for the first time, but on Android 3.0 and greater, the system creates it as
-soon as the activity is created, in order to populate the Action Bar.</p>
-
-
-<h3 id="RespondingOptionsMenu">Responding to user action</h3>
-
-<p>When the user selects a menu item from the Options Menu (including action items in the
-Action Bar), the system calls your activity's
-{@link android.app.Activity#onOptionsItemSelected(MenuItem) onOptionsItemSelected()}
-method. This method passes the
-{@link android.view.MenuItem} that the user selected. You can identify the menu item by calling
-{@link android.view.MenuItem#getItemId()}, which returns the unique ID for the menu
-item (defined by the {@code android:id} attribute in the menu resource or with an integer
-given to the {@link android.view.Menu#add(int,int,int,int) add()} method). You can match this ID
-against known menu items and perform the appropriate action. For example:</p>
-
-<pre>
-&#64;Override
-public boolean onOptionsItemSelected(MenuItem item) {
-    // Handle item selection
-    switch (item.getItemId()) {
-    case R.id.new_game:
-        newGame();
-        return true;
-    case R.id.help:
-        showHelp();
-        return true;
-    default:
-        return super.onOptionsItemSelected(item);
-    }
-}
-</pre>
-
-<p>In this example, {@link android.view.MenuItem#getItemId()} queries the ID for the selected menu
-item and the switch statement compares the ID against the resource IDs that were assigned to menu
-items in the XML resource. When a switch case successfully handles the menu item, it
-returns {@code true} to indicate that the item selection was handled. Otherwise, the default
-statement passes the menu item to the super class, in
-case it can handle the item selected. (If you've directly extended the {@link android.app.Activity}
-class, then the super class returns {@code false}, but it's a good practice to
-pass unhandled menu items to the super class instead of directly returning {@code false}.)</p>
-
-<p>Additionally, Android 3.0 adds the ability for you to define the on-click behavior for a menu
-item in the <a href="{@docRoot}guide/topics/resources/menu-resource.html">menu resource</a> XML,
-using the {@code android:onClick} attribute. So you don't need to implement {@link
-android.app.Activity#onOptionsItemSelected(MenuItem) onOptionsItemSelected()}. Using the {@code
-android:onClick} attribute, you can specify a method to call when the user selects the menu item.
-Your activity must then implement the method specified in the {@code android:onClick} attribute so 
-that it accepts a single {@link android.view.MenuItem} parameter&mdash;when the system calls this
-method, it passes the menu item selected.</p>
-
-<p class="note"><strong>Tip:</strong> If your application contains multiple activities and
-some of them provide the same Options Menu, consider creating
-an activity that implements nothing except the {@link android.app.Activity#onCreateOptionsMenu(Menu)
-onCreateOptionsMenu()} and {@link android.app.Activity#onOptionsItemSelected(MenuItem)
-onOptionsItemSelected()} methods. Then extend this class for each activity that should share the
-same Options Menu. This way, you have to manage only one set of code for handling menu
-actions and each descendant class inherits the menu behaviors.<br/><br/>
-If you want to add menu items to one of your descendant activities,
-override {@link android.app.Activity#onCreateOptionsMenu(Menu)
-onCreateOptionsMenu()} in that activity. Call {@code super.onCreateOptionsMenu(menu)} so the
-original menu items are created, then add new menu items with {@link
-android.view.Menu#add(int,int,int,int) menu.add()}. You can also override the super class's
-behavior for individual menu items.</p>
-
-
-<h3 id="ChangingTheMenu">Changing menu items at runtime</h3>
-
-<p>Once the activity is created, the {@link android.app.Activity#onCreateOptionsMenu(Menu)
-onCreateOptionsMenu()} method is
-called only once, as described above. The system keeps and re-uses the {@link
-android.view.Menu} you define in this method until your activity is destroyed. If you want to change
-the Options Menu any time after it's first created, you must override the
-{@link android.app.Activity#onPrepareOptionsMenu(Menu) onPrepareOptionsMenu()} method. This passes
-you the {@link android.view.Menu} object as it currently exists. This is useful if you'd like to
-remove, add, disable, or enable menu items depending on the current state of your application.</p>
-
-<p>On Android 2.3 and lower, the system calls {@link android.app.Activity#onPrepareOptionsMenu(Menu)
-onPrepareOptionsMenu()} each time the user opens the Options Menu.</p>
-
-<p>On Android 3.0 and higher, you must call {@link android.app.Activity#invalidateOptionsMenu
-invalidateOptionsMenu()} when you want to update the menu, because the menu is always open. The
-system will then call {@link android.app.Activity#onPrepareOptionsMenu(Menu) onPrepareOptionsMenu()}
-so you can update the menu items.</p>
-
-<p class="note"><strong>Note:</strong> 
-You should never change items in the Options Menu based on the {@link android.view.View} currently
-in focus. When in touch mode (when the user is not using a trackball or d-pad), views
-cannot take focus, so you should never use focus as the basis for modifying
-items in the Options Menu. If you want to provide menu items that are context-sensitive to a {@link
-android.view.View}, use a <a href="#context-menu">Context Menu</a>.</p>
-
-<p>If you're developing for Android 3.0 or higher, be sure to also read the <a
-href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer guide.</p>
-
-
-
-
-<h2 id="context-menu">Creating a Context Menu</h2>
-
-<p>A context menu is conceptually similar to the menu displayed when the user performs a
-"right-click" on a PC. You should use a context menu to provide the user access to
-actions that pertain to a specific item in the user interface. On Android, a context menu is
-displayed when the user performs a "long press" (press and hold) on an item.</p>
-
-<p>You can create a context menu for any View, though context menus are most often used for items in
-a {@link android.widget.ListView}. When the user performs a long-press on an item in a ListView and
-the list is registered to provide a context menu, the list item signals to the user that a context
-menu is available by animating its background color&mdash;it transitions from
-orange to white before opening the context menu. (The Contacts application demonstrates this
-feature.)</p>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
-<h3>Register a ListView</h3>
-<p>If your activity uses a {@link android.widget.ListView} and
-you want all list items to provide a context menu, register all items for a context
-menu by passing the {@link android.widget.ListView} to {@link
-android.app.Activity#registerForContextMenu(View) registerForContextMenu()}. For
-example, if you're using a {@link android.app.ListActivity}, register all list items like this:</p>
-<p><code>registerForContextMenu({@link android.app.ListActivity#getListView()});</code></p>
-</div>
-</div>
-
-<p>In order for a View to provide a context menu, you must "register" the view for a context
-menu. Call {@link android.app.Activity#registerForContextMenu(View) registerForContextMenu()} and
-pass it the {@link android.view.View} you want to give a context menu. When this View then
-receives a long-press, it displays a context menu.</p>
-
-<p>To define the context menu's appearance and behavior, override your activity's context menu
-callback methods, {@link android.app.Activity#onCreateContextMenu(ContextMenu,View,ContextMenuInfo)
-onCreateContextMenu()} and
-{@link android.app.Activity#onContextItemSelected(MenuItem) onContextItemSelected()}.</p>
-
-<p>For example, here's an {@link
-android.app.Activity#onCreateContextMenu(ContextMenu,View,ContextMenuInfo)
-onCreateContextMenu()} that uses the {@code context_menu.xml} menu resource:</p>
-<pre>
-&#64;Override
-public void onCreateContextMenu(ContextMenu menu, View v,
-                                ContextMenuInfo menuInfo) {
-  super.onCreateContextMenu(menu, v, menuInfo);
-  MenuInflater inflater = getMenuInflater();
-  inflater.inflate(R.menu.context_menu, menu);
-}
-</pre>
-
-<p>{@link android.view.MenuInflater} is used to inflate the context menu from a <a
-href="{@docRoot}guide/topics/resources/menu-resource.html">menu resource</a>. (You can also use
-{@link android.view.Menu#add(int,int,int,int) add()} to add menu items.) The callback method
-parameters include the {@link android.view.View}
-that the user selected and a {@link android.view.ContextMenu.ContextMenuInfo} object that provides
-additional information about the item selected. You might use these parameters to determine
-which context menu should be created, but in this example, all context menus for the activity are
-the same.</p>
-
-<p>Then when the user selects an item from the context menu, the system calls {@link
-android.app.Activity#onContextItemSelected(MenuItem) onContextItemSelected()}. Here is an example
-of how you can handle selected items:</p>
-
-<pre>
-&#64;Override
-public boolean onContextItemSelected(MenuItem item) {
-  AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
-  switch (item.getItemId()) {
-  case R.id.edit:
-    editNote(info.id);
-    return true;
-  case R.id.delete:
-    deleteNote(info.id);
-    return true;
-  default:
-    return super.onContextItemSelected(item);
-  }
-}
-</pre>
-
-<p>The structure of this code is similar to the example for <a href="#options-menu">Creating an
-Options Menu</a>, in which {@link android.view.MenuItem#getItemId()} queries the ID for the selected
-menu item and a switch statement matches the item to the IDs that are defined in the menu resource.
-And like the options menu example, the default statement calls the super class in case it
-can handle menu items not handled here, if necessary.</p>
-
-<p>In this example, the selected item is an item from a {@link android.widget.ListView}. To
-perform an action on the selected item, the application needs to know the list
-ID for the selected item (it's position in the ListView). To get the ID, the application calls
-{@link android.view.MenuItem#getMenuInfo()}, which returns a {@link
-android.widget.AdapterView.AdapterContextMenuInfo} object that includes the list ID for the
-selected item in the {@link android.widget.AdapterView.AdapterContextMenuInfo#id id} field. The
-local methods <code>editNote()</code> and <code>deleteNote()</code> methods accept this list ID to
-perform an action on the data specified by the list ID.</p>
-
-<p class="note"><strong>Note:</strong> Items in a context menu do not support icons or shortcut
-keys.</p>
-
-
-
-<h2 id="submenu">Creating Submenus</h2>
-
-<p>A submenu is a menu that the user can open by selecting an item in another menu. You can add a
-submenu to any menu (except a submenu). Submenus are useful when your application has a lot of
-functions that can be organized into topics, like items in a PC application's menu bar (File, Edit,
-View, etc.).</p>
-
-<p>When creating your <a href="{@docRoot}guide/topics/resources/menu-resource.html">menu
-resource</a>, you can create a submenu by adding a {@code &lt;menu&gt;} element as the child of an
-{@code &lt;item&gt;}. For example:</p>
+<p>You can add a submenu to an item in any menu (except a submenu) by adding a {@code &lt;menu&gt;}
+element as the child of an {@code &lt;item&gt;}. Submenus are useful when your application has a lot
+of functions that can be organized into topics, like items in a PC application's menu bar (File,
+Edit, View, etc.). For example:</p>
 
 <pre>
 &lt;?xml version="1.0" encoding="utf-8"?&gt;
 &lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt;
     &lt;item android:id="@+id/file"
-          android:icon="@drawable/file"
           android:title="@string/file" &gt;
         &lt;!-- "file" submenu --&gt;
         &lt;menu&gt;
@@ -435,23 +202,625 @@
 &lt;/menu&gt;
 </pre>
 
-<p>When the user selects an item from a submenu, the parent menu's respective on-item-selected
-callback method receives the event. For instance, if the above menu is applied as an Options Menu,
-then the {@link android.app.Activity#onOptionsItemSelected(MenuItem) onOptionsItemSelected()} method
-is called when a submenu item is selected.</p>
-
-<p>You can also use {@link android.view.Menu#addSubMenu(int,int,int,int) addSubMenu()} to
-dynamically add a {@link android.view.SubMenu} to an existing {@link android.view.Menu}. This
-returns the new {@link android.view.SubMenu} object, to which you can add
-submenu items, using {@link android.view.Menu#add(int,int,int,int) add()}</p>
+<p>To use the menu in your activity, you need to inflate the menu resource (convert the XML
+resource into a programmable object) using {@link android.view.MenuInflater#inflate(int,Menu)
+MenuInflater.inflate()}. In the following sections, you'll see how to inflate a menu for each
+menu type.</p>
 
 
 
-<h2 id="features">Other Menu Features</h2>
+<h2 id="options-menu">Creating an Options Menu</h2>
 
-<p>Here are some other features that you can apply to most menu items.</p>
+<div class="figure" style="width:200px;margin:0">
+  <img src="{@docRoot}images/options_menu.png" height="333" alt="" />
+  <p class="img-caption"><strong>Figure 1.</strong> Options menu in the
+Browser, on Android 2.3.</p>
+</div>
 
-<h3 id="groups">Menu groups</h3>
+<p>The options menu is where you should include actions and other options that are relevant to the
+current activity context, such as "Search," "Compose email," and "Settings."</p>
+
+<p>Where the items in your options menu appear on the screen depends on the version for which you've
+developed your application:</p>
+
+<ul>
+  <li>If you've developed your application for <strong>Android 2.3.x (API level 10) or
+lower</strong>, the contents of your options menu appear at the bottom of the screen when the user
+presses the <em>Menu</em> button, as shown in figure 1. When opened, the first visible portion is
+the icon
+menu, which holds up to six menu items. If your menu includes more than six items, Android places
+the sixth item and the rest into the overflow menu, which the user can open by selecting
+<em>More</em>.</li>
+
+  <li>If you've developed your application for <strong>Android 3.0 (API level 11) and
+higher</strong>, items from the options menu are available in the <a
+href="{@docRoot}guide/topics/ui/actionbar.html">action bar</a>. By default, the system
+places all items in the action overflow, which the user can reveal with the action overflow icon on
+the right side of the action bar (or by pressing the device <em>Menu</em> button, if available). To
+enable
+quick access to important actions, you can promote a few items to appear in the action bar by adding
+{@code android:showAsAction="ifRoom"} to the corresponding {@code &lt;item&gt;} elements (see figure
+2). <p>For more information about action items and other action bar behaviors, see the <a
+href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> guide. </p>
+<p class="note"><strong>Note:</strong> Even if you're <em>not</em> developing for Android 3.0 or
+higher, you can build your own action bar layout for a similar effect. For an example of how you can
+support older versions of Android with an action bar, see the <a
+href="{@docRoot}resources/samples/ActionBarCompat/index.html">Action Bar Compatibility</a>
+sample.</p>
+</li>
+</ul>
+
+<img src="{@docRoot}images/ui/actionbar.png" alt="" />
+<p class="img-caption"><strong>Figure 2.</strong> Action bar from the <a
+href="{@docRoot}resources/samples/HoneycombGallery/index.html">Honeycomb Gallery</a> app, showing
+navigation tabs and a camera action item (plus the action overflow button).</p>
+
+<p>You can declare items for the options menu from either your {@link android.app.Activity}
+subclass or a {@link android.app.Fragment} subclass. If both your activity and fragment(s)
+declare items for the options menu, they are combined in the UI. The activity's items appear
+first, followed by those of each fragment in the order in which each fragment is added to the
+activity. If necessary, you can re-order the menu items with the {@code android:orderInCategory}
+attribute in each {@code &lt;item&gt;} you need to move.</p>
+
+<p>To specify the options menu for an activity, override {@link
+android.app.Activity#onCreateOptionsMenu(Menu) onCreateOptionsMenu()} (fragments provide their
+own {@link android.app.Fragment#onCreateOptionsMenu onCreateOptionsMenu()} callback). In this
+method, you can inflate your menu resource (<a href="#xml">defined in XML</a>) into the {@link
+android.view.Menu} provided in the callback. For example:</p>
+
+<pre>
+&#64;Override
+public boolean onCreateOptionsMenu(Menu menu) {
+    MenuInflater inflater = {@link android.app.Activity#getMenuInflater()};
+    inflater.inflate(R.menu.game_menu, menu);
+    return true;
+}
+</pre>
+
+<p>You can also add menu items using {@link android.view.Menu#add(int,int,int,int)
+add()} and retrieve items with {@link android.view.Menu#findItem findItem()} to revise their
+properties with {@link android.view.MenuItem} APIs.</p>
+
+<p>If you've developed your application for Android 2.3.x and lower, the system calls {@link
+android.app.Activity#onCreateOptionsMenu(Menu) onCreateOptionsMenu()} to create the options menu
+when the user opens the menu for the first time. If you've developed for Android 3.0 and higher, the
+system calls {@link android.app.Activity#onCreateOptionsMenu(Menu) onCreateOptionsMenu()} when
+starting the activity, in order to show items to the action bar.</p>
+
+
+
+<h3 id="RespondingOptionsMenu">Handling click events</h3>
+
+<p>When the user selects an item from the options menu (including action items in the action bar),
+the system calls your activity's {@link android.app.Activity#onOptionsItemSelected(MenuItem)
+onOptionsItemSelected()} method. This method passes the {@link android.view.MenuItem} selected. You
+can identify the item by calling {@link android.view.MenuItem#getItemId()}, which returns the unique
+ID for the menu item (defined by the {@code android:id} attribute in the menu resource or with an
+integer given to the {@link android.view.Menu#add(int,int,int,int) add()} method). You can match
+this ID against known menu items to perform the appropriate action. For example:</p>
+
+<pre>
+&#64;Override
+public boolean onOptionsItemSelected(MenuItem item) {
+    // Handle item selection
+    switch (item.getItemId()) {
+        case R.id.new_game:
+            newGame();
+            return true;
+        case R.id.help:
+            showHelp();
+            return true;
+        default:
+            return super.onOptionsItemSelected(item);
+    }
+}
+</pre>
+
+<p>When you successfully handle a menu item, return {@code true}. If you don't handle the menu
+item, you should call the superclass implementation of {@link
+android.app.Activity#onOptionsItemSelected(MenuItem) onOptionsItemSelected()} (the default
+implementation returns false).</p>
+
+<p>If your activity includes fragments, the system first calls {@link
+android.app.Activity#onOptionsItemSelected(MenuItem) onOptionsItemSelected()} for the activity then
+for each fragment (in the order each fragment was added) until one returns
+{@code true} or all fragments have been called.</p>
+
+<p class="note"><strong>Tip:</strong> Android 3.0 adds the ability for you to define the on-click
+behavior for a menu item in XML, using the {@code android:onClick} attribute. The value for the
+attribute must be the name of a method defined by the activity using the menu. The method
+must be public and accept a single {@link android.view.MenuItem} parameter&mdash;when the system
+calls this method, it passes the menu item selected. For more information and an example, see the <a
+href="{@docRoot}guide/topics/resources/menu-resource.html">Menu Resource</a> document.</p>
+
+<p class="note"><strong>Tip:</strong> If your application contains multiple activities and
+some of them provide the same options menu, consider creating
+an activity that implements nothing except the {@link android.app.Activity#onCreateOptionsMenu(Menu)
+onCreateOptionsMenu()} and {@link android.app.Activity#onOptionsItemSelected(MenuItem)
+onOptionsItemSelected()} methods. Then extend this class for each activity that should share the
+same options menu. This way, you can manage one set of code for handling menu
+actions and each descendant class inherits the menu behaviors.
+If you want to add menu items to one of the descendant activities,
+override {@link android.app.Activity#onCreateOptionsMenu(Menu)
+onCreateOptionsMenu()} in that activity. Call {@code super.onCreateOptionsMenu(menu)} so the
+original menu items are created, then add new menu items with {@link
+android.view.Menu#add(int,int,int,int) menu.add()}. You can also override the super class's
+behavior for individual menu items.</p>
+
+
+<h3 id="ChangingTheMenu">Changing menu items at runtime</h3>
+
+<p>After the system calls {@link android.app.Activity#onCreateOptionsMenu(Menu)
+onCreateOptionsMenu()}, it retains an instance of the {@link android.view.Menu} you populate and
+will not call {@link android.app.Activity#onCreateOptionsMenu(Menu) onCreateOptionsMenu()}
+again unless the menu is invalidated for some reason. However, you should use {@link
+android.app.Activity#onCreateOptionsMenu(Menu) onCreateOptionsMenu()} only to create the initial
+menu state and not to make changes during the activity lifecycle.</p>
+
+<p>If you want to modify the options menu based on 
+events that occur during the activity lifecycle, you can do so in
+the {@link android.app.Activity#onPrepareOptionsMenu(Menu) onPrepareOptionsMenu()} method. This
+method passes you the {@link android.view.Menu} object as it currently exists so you can modify it,
+such as add, remove, or disable items. (Fragments also provide an {@link
+android.app.Fragment#onPrepareOptionsMenu onPrepareOptionsMenu()} callback.)</p>
+
+<p>On Android 2.3.x and lower, the system calls {@link
+android.app.Activity#onPrepareOptionsMenu(Menu)
+onPrepareOptionsMenu()} each time the user opens the options menu (presses the <em>Menu</em>
+button).</p>
+
+<p>On Android 3.0 and higher, the options menu is considered to always be open when menu items are
+presented in the action bar. When an event occurs and you want to perform a menu update, you must
+call {@link android.app.Activity#invalidateOptionsMenu invalidateOptionsMenu()} to request that the
+system call {@link android.app.Activity#onPrepareOptionsMenu(Menu) onPrepareOptionsMenu()}.</p>
+
+<p class="note"><strong>Note:</strong> 
+You should never change items in the options menu based on the {@link android.view.View} currently
+in focus. When in touch mode (when the user is not using a trackball or d-pad), views
+cannot take focus, so you should never use focus as the basis for modifying
+items in the options menu. If you want to provide menu items that are context-sensitive to a {@link
+android.view.View}, use a <a href="#context-menu">Context Menu</a>.</p>
+
+
+
+
+<h2 id="context-menu">Creating Contextual Menus</h2>
+
+<div class="figure" style="width:420px;margin-top:-1em">
+  <img src="{@docRoot}images/ui/menu-context.png" alt="" />
+  <p class="img-caption"><strong>Figure 3.</strong> Screenshots of a floating context menu (left)
+and the contextual action bar (right).</p>
+</div>
+
+<p>A contextual menu offers actions that affect a specific item or context frame in the UI. You
+can provide a context menu for any view, but they are most often used for items in a {@link
+android.widget.ListView}, {@link android.widget.GridView}, or other view collections in which
+the user can perform direct actions on each item.</p>
+
+<p>There are two ways to provide contextual actions:</p>
+<ul>
+  <li>In a <a href="#FloatingContextMenu">floating context menu</a>. A menu appears as a
+floating list of menu items (similar to a dialog) when the user performs a long-click (press and
+hold) on a view that declares support for a context menu. Users can perform a contextual
+action on one item at a time.</li>
+
+  <li>In the <a href="#CAB">contextual action mode</a>. This mode is a system implementation of
+{@link android.view.ActionMode} that displays a <em>contextual action bar</em> at the top of the
+screen with action items that affect the selected item(s). When this mode is active, users
+can perform an action on multiple items at once (if your app allows it).</li>
+</ul>
+
+<p class="note"><strong>Note:</strong> The contextual action mode is available on Android 3.0 (API
+level 11) and higher and is the preferred technique for displaying contextual actions when
+available. If your app supports versions lower than 3.0 then you should fall back to a floating
+context menu on those devices.</p>
+
+
+<h3 id="FloatingContextMenu">Creating a floating context menu</h3>
+
+<p>To provide a floating context menu:</p>
+<ol>
+  <li>Register the {@link android.view.View} to which the context menu should be associated by
+calling {@link android.app.Activity#registerForContextMenu(View) registerForContextMenu()} and pass
+it the {@link android.view.View}.
+  <p>If your activity uses a {@link android.widget.ListView} or {@link android.widget.GridView} and
+you want each item to provide the same context menu, register all items for a context menu by
+passing the {@link android.widget.ListView} or {@link android.widget.GridView} to {@link
+android.app.Activity#registerForContextMenu(View) registerForContextMenu()}.</p>
+</li>
+
+  <li>Implement the {@link
+android.view.View.OnCreateContextMenuListener#onCreateContextMenu onCreateContextMenu()} method
+in your {@link android.app.Activity} or {@link android.app.Fragment}.
+  <p>When the registered view receives a long-click event, the system calls your {@link
+android.view.View.OnCreateContextMenuListener#onCreateContextMenu onCreateContextMenu()}
+method. This is where you define the menu items, usually by inflating a menu resource. For
+example:</p>
+<pre>
+&#64;Override
+public void onCreateContextMenu(ContextMenu menu, View v,
+                                ContextMenuInfo menuInfo) {
+    super.onCreateContextMenu(menu, v, menuInfo);
+    MenuInflater inflater = getMenuInflater();
+    inflater.inflate(R.menu.context_menu, menu);
+}
+</pre>
+
+<p>{@link android.view.MenuInflater} allows you to inflate the context menu from a <a
+href="{@docRoot}guide/topics/resources/menu-resource.html">menu resource</a>. The callback method
+parameters include the {@link android.view.View}
+that the user selected and a {@link android.view.ContextMenu.ContextMenuInfo} object that provides
+additional information about the item selected. If your activity has several views that each provide
+a different context menu, you might use these parameters to determine which context menu to
+inflate.</p>
+</li>
+
+<li>Implement {@link android.app.Activity#onContextItemSelected(MenuItem)
+onContextItemSelected()}.
+  <p>When the user selects a menu item, the system calls this method so you can perform the
+appropriate action. For example:</p>
+
+<pre>
+&#64;Override
+public boolean onContextItemSelected(MenuItem item) {
+    AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
+    switch (item.getItemId()) {
+        case R.id.edit:
+            editNote(info.id);
+            return true;
+        case R.id.delete:
+            deleteNote(info.id);
+            return true;
+        default:
+            return super.onContextItemSelected(item);
+    }
+}
+</pre>
+
+<p>The {@link android.view.MenuItem#getItemId()} method queries the ID for
+the selected menu item, which you should assign to each menu item in XML using the {@code
+android:id} attribute, as shown in the section about <a href="#xml">Defining a Menu in
+XML</a>.</p>
+
+<p>When you successfully handle a menu item, return {@code true}. If you don't handle the menu item,
+you should pass the menu item to the superclass implementation. If your activity includes fragments,
+the activity receives this callback first. By calling the superclass when unhandled, the system
+passes the event to the respective callback method in each fragment, one at a time (in the order
+each fragment was added) until {@code true} or {@code false} is returned. (The default
+implementation for {@link android.app.Activity} and {@code android.app.Fragment} return {@code
+false}, so you should always call the superclass when unhandled.)</p>
+</li>
+</ol>
+
+
+<h3 id="CAB">Using the contextual action mode</h3>
+
+<p>The contextual action mode is a system implementation of {@link android.view.ActionMode} that
+focuses user interaction toward performing contextual actions. When a
+user enables this mode by selecting an item, a <em>contextual action bar</em> appears at the top of
+the screen to present actions the user can perform on the currently selected item(s). While this
+mode is enabled, the user can select multiple items (if you allow it), deselect items, and continue
+to navigate within the activity (as much as you're willing to allow). The action mode is disabled
+and the contextual action bar disappears when the user deselects all items, presses the BACK button,
+or selects the <em>Done</em> action on the left side of the bar.</p>
+
+<p class="note"><strong>Note:</strong> The contextual action bar is not necessarily
+associated with the <a href="{@docRoot}guide/topics/ui/actionbar.html">action bar</a>. They operate
+independently, even though the contextual action bar visually overtakes the action bar
+position.</p>
+
+<p>If you're developing for Android 3.0 (API level 11) or higher, you
+should usually use the contextual action mode to present contextual actions, instead of the <a
+href="#FloatingContextMenu">floating context menu</a>.</p>
+
+<p>For views that provide contextual actions, you should usually invoke the contextual action mode
+upon one of two events (or both):</p>
+<ul>
+  <li>The user performs a long-click on the view.</li>
+  <li>The user selects a checkbox or similar UI component within the view.</li>
+</ul>
+
+<p>How your application invokes the contextual action mode and defines the behavior for each
+action depends on your design. There are basically two designs:</p>
+<ul>
+  <li>For contextual actions on individual, arbitrary views.</li>
+  <li>For batch contextual actions on groups of items in a {@link
+android.widget.ListView} or {@link android.widget.GridView} (allowing the user to select multiple
+items and perform an action on them all).</li>
+</ul>
+
+<p>The following sections describe the setup required for each scenario.</p>
+
+
+<h4 id="CABforViews">Enabling the contextual action mode for individual views</h4>
+
+<p>If you want to invoke the contextual action mode only when the user selects specific
+views, you should:</p>
+<ol>
+  <li>Implement the {@link android.view.ActionMode.Callback} interface. In its callback methods, you
+can specify the actions for the contextual action bar, respond to click events on action items, and
+handle other lifecycle events for the action mode.</li>
+  <li>Call {@link android.app.Activity#startActionMode startActionMode()} when you want to show the
+bar (such as when the user long-clicks the view).</li>
+</ol>
+
+<p>For example:</p>
+
+<ol>
+  <li>Implement the {@link android.view.ActionMode.Callback ActionMode.Callback} interface:
+<pre>
+private ActionMode.Callback mActionModeCallback = new ActionMode.Callback() {
+
+    // Called when the action mode is created; startActionMode() was called
+    &#64;Override
+    public boolean onCreateActionMode(ActionMode mode, Menu menu) {
+        // Inflate a menu resource providing context menu items
+        MenuInflater inflater = mode.getMenuInflater();
+        inflater.inflate(R.menu.context_menu, menu);
+        return true;
+    }
+
+    // Called each time the action mode is shown. Always called after onCreateActionMode, but
+    // may be called multiple times if the mode is invalidated.
+    &#64;Override
+    public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
+        return false; // Return false if nothing is done
+    }
+
+    // Called when the user selects a contextual menu item
+    &#64;Override
+    public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
+        switch (item.getItemId()) {
+            case R.id.menu_share:
+                shareCurrentItem();
+                mode.finish(); // Action picked, so close the CAB
+                return true;
+            default:
+                return false;
+        }
+    }
+
+    // Called when the user exits the action mode
+    &#64;Override
+    public void onDestroyActionMode(ActionMode mode) {
+        mActionMode = null;
+    }
+};
+</pre>
+
+<p>Notice that these event callbacks are almost exactly the same as the callbacks for the <a
+href="#options-menu">options menu</a>, except each of these also pass the {@link
+android.view.ActionMode} object associated with the event. You can use {@link
+android.view.ActionMode} APIs to make various changes to the CAB, such as revise the title and
+subtitle with {@link android.view.ActionMode#setTitle setTitle()} and {@link
+android.view.ActionMode#setSubtitle setSubtitle()} (useful to indicate how many items are
+selected).</p>
+
+<p>Also notice that the above sample sets the {@code mActionMode} variable null when the
+action mode is destroyed. In the next step, you'll see how it's initialized and how saving
+the member variable in your activity or fragment can be useful.</p>
+</li>
+
+  <li>Call {@link android.app.Activity#startActionMode startActionMode()} to enable the contextual
+action mode when appropriate, such as in response to a long-click on a {@link
+android.view.View}:</p>
+
+<pre>
+someView.setOnLongClickListener(new View.OnLongClickListener() {
+    // Called when the user long-clicks on someView
+    public boolean onLongClick(View view) {
+        if (mActionMode != null) {
+            return false;
+        }
+
+        // Start the CAB using the ActionMode.Callback defined above
+        mActionMode = getActivity().startActionMode(mActionModeCallback);
+        view.setSelected(true);
+        return true;
+    }
+});
+</pre>
+
+<p>When you call {@link android.app.Activity#startActionMode startActionMode()}, the system returns
+the {@link android.view.ActionMode} created. By saving this in a member variable, you can
+make changes to the contextual action bar in response to other events. In the above sample, the
+{@link android.view.ActionMode} is used to ensure that the {@link android.view.ActionMode} instance
+is not recreated if it's already active, by checking whether the member is null before starting the
+action mode.</p>
+</li>
+</ol>
+
+
+
+<h4 id="CABforListView">Enabling batch contextual actions in a ListView or GridView</h4>
+
+<p>If you have a collection of items in a {@link android.widget.ListView} or {@link
+android.widget.GridView} (or another extension of {@link android.widget.AbsListView}) and want to
+allow users to perform batch actions, you should:</p>
+
+<ul>
+  <li>Implement the {@link android.widget.AbsListView.MultiChoiceModeListener} interface and set it
+for the view group with {@link android.widget.AbsListView#setMultiChoiceModeListener
+setMultiChoiceModeListener()}. In the listener's callback methods, you can specify the actions
+for the contextual action bar, respond to click events on action items, and handle other callbacks
+inherited from the {@link android.view.ActionMode.Callback} interface.</li>
+
+  <li>Call {@link android.widget.AbsListView#setChoiceMode setChoiceMode()} with the {@link
+android.widget.AbsListView#CHOICE_MODE_MULTIPLE_MODAL} argument.</li>
+</ul>
+
+<p>For example:</p>
+
+<pre>
+ListView listView = getListView();
+listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE_MODAL);
+listView.setMultiChoiceModeListener(new MultiChoiceModeListener() {
+
+    &#64;Override
+    public void onItemCheckedStateChanged(ActionMode mode, int position,
+                                          long id, boolean checked) {
+        // Here you can do something when items are selected/de-selected,
+        // such as update the title in the CAB
+    }
+
+    &#64;Override
+    public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
+        // Respond to clicks on the actions in the CAB
+        switch (item.getItemId()) {
+            case R.id.menu_delete:
+                deleteSelectedItems();
+                mode.finish(); // Action picked, so close the CAB
+                return true;
+            default:
+                return false;
+        }
+    }
+
+    &#64;Override
+    public boolean onCreateActionMode(ActionMode mode, Menu menu) {
+        // Inflate the menu for the CAB
+        MenuInflater inflater = mode.getMenuInflater();
+        inflater.inflate(R.menu.context, menu);
+        return true;
+    }
+
+    &#64;Override
+    public void onDestroyActionMode(ActionMode mode) {
+        // Here you can make any necessary updates to the activity when
+        // the CAB is removed. By default, selected items are deselected/unchecked.
+    }
+
+    &#64;Override
+    public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
+        // Here you can perform updates to the CAB due to
+        // an {@link android.view.ActionMode#invalidate} request
+        return false;
+    }
+});
+</pre>
+
+<p>That's it. Now when the user selects an item with a long-click, the system calls the {@link
+android.widget.AbsListView.MultiChoiceModeListener#onCreateActionMode onCreateActionMode()}
+method and displays the contextual action bar with the specified actions. While the contextual
+action bar is visible, users can select additional items.</p>
+
+<p>In some cases in which the contextual actions provide common action items, you might
+want to add a checkbox or a similar UI element that allows users to select items, because they
+might not discover the long-click behavior. When a user selects the checkbox, you
+can invoke the contextual action mode by setting the respective list item to the checked
+state with {@link android.widget.AbsListView#setItemChecked setItemChecked()}.</p>
+
+
+
+
+<h2 id="PopupMenu">Creating a Popup Menu</h2>
+
+<div class="figure" style="width:220px">
+<img src="{@docRoot}images/ui/popupmenu.png" alt="" />
+<p><strong>Figure 4.</strong> A popup menu in the Gmail app, anchored to the overflow
+button at the top-right.</p>
+</div>
+
+<p>A {@link android.widget.PopupMenu} is a modal menu anchored to a {@link android.view.View}.
+It appears below the anchor view if there is room, or above the view otherwise. It's useful for:</p>
+<ul>
+  <li>Providing an overflow-style menu for actions that <em>relate to</em> specific content (such as
+Gmail's email headers, shown in figure 4).
+    <p class="note"><strong>Note:</strong> This is not the same as a context menu, which is
+generally for actions that <em>affect</em> selected content. For actions that affect selected
+content, use the <a href="#CAB">contextual action mode</a> or <a
+href="#FloatingContextMenu">floating context menu</a>.</p></li>
+  <li>Providing a second part of a command sentence (such as a button marked "Add"
+that produces a popup menu with different "Add" options).</li>
+  <li>Providing a drop-down similar to {@link android.widget.Spinner} that does not retain
+a persistent selection.</li>
+</ul>
+
+
+<p class="note"><strong>Note:</strong> {@link android.widget.PopupMenu} is available with API
+level 11 and higher.</p>
+
+<p>If you <a href="#xml">define your menu in XML</a>, here's how you can show the popup menu:</p>
+<ol>
+  <li>Instantate a {@link android.widget.PopupMenu} with its constructor, which takes the
+current application {@link android.content.Context} and the {@link android.view.View} to which the
+menu should be anchored.</li>
+  <li>Use {@link android.view.MenuInflater} to inflate your menu resource into the {@link
+android.view.Menu} object returned by {@link
+android.widget.PopupMenu#getMenu() PopupMenu.getMenu()}. On API level 14 and above, you can use
+{@link android.widget.PopupMenu#inflate PopupMenu.inflate()} instead.</li>
+  <li>Call {@link android.widget.PopupMenu#show() PopupMenu.show()}.</li>
+</ol>
+
+<p>For example, here's a button with the {@link android.R.attr#onClick android:onClick} attribute
+that shows a popup menu:</p>
+
+<pre>
+&lt;ImageButton
+    android:layout_width="wrap_content" 
+    android:layout_height="wrap_content" 
+    android:src="@drawable/ic_overflow_holo_dark"
+    android:contentDescription="@string/descr_overflow_button"
+    android:onClick="showPopup" />
+</pre>
+
+<p>The activity can then show the popup menu like this:</p>
+
+<pre>
+public void showPopup(View v) {
+    PopupMenu popup = new PopupMenu(this, v);
+    MenuInflater inflater = popup.getMenuInflater();
+    inflater.inflate(R.menu.actions, popup.getMenu());
+    popup.show();
+}
+</pre>
+
+<p>In API level 14 and higher, you can combine the two lines that inflate the menu with {@link
+android.widget.PopupMenu#inflate PopupMenu.inflate()}.</p>
+
+<p>The menu is dismissed when the user selects an item or touches outside the menu
+area. You can listen for the dismiss event using {@link
+android.widget.PopupMenu.OnDismissListener}.</p>
+
+<h3 id="PopupEvents">Handling click events</h3>
+
+<p>To perform an
+action when the user selects a menu item, you must implement the {@link
+android.widget.PopupMenu.OnMenuItemClickListener} interface and register it with your {@link
+android.widget.PopupMenu} by calling {@link android.widget.PopupMenu#setOnMenuItemClickListener
+setOnMenuItemclickListener()}. When the user selects an item, the system calls the {@link
+android.widget.PopupMenu.OnMenuItemClickListener#onMenuItemClick onMenuItemClick()} callback in
+your interface.</p>
+
+<p>For example:</p>
+
+<pre>
+public void showMenu(View v) {
+    PopupMenu popup = new PopupMenu(this, v);
+
+    // This activity implements OnMenuItemClickListener
+    popup.setOnMenuItemClickListener(this);
+    popup.inflate(R.menu.actions);
+    popup.show();
+}
+
+&#64;Override
+public boolean onMenuItemClick(MenuItem item) {
+    switch (item.getItemId()) {
+        case R.id.archive:
+            archive(item);
+            return true;
+        case R.id.delete:
+            delete(item);
+            return true;
+        default:
+            return false;
+    }
+}
+</pre>
+
+
+<h2 id="groups">Creating Menu Groups</h2>
 
 <p>A menu group is a collection of menu items that share certain traits. With a group, you
 can:</p>
@@ -473,38 +842,41 @@
 <pre>
 &lt;?xml version="1.0" encoding="utf-8"?&gt;
 &lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt;
-    &lt;item android:id="@+id/item1"
-          android:icon="@drawable/item1"
-          android:title="@string/item1" /&gt;
+    &lt;item android:id="@+id/menu_save"
+          android:icon="@drawable/menu_save"
+          android:title="@string/menu_save" /&gt;
     &lt;!-- menu group --&gt;
-    &lt;group android:id="@+id/group1"&gt;
-        &lt;item android:id="@+id/groupItem1"
-              android:title="@string/groupItem1" /&gt;
-        &lt;item android:id="@+id/groupItem2"
-              android:title="@string/groupItem2" /&gt;
+    &lt;group android:id="@+id/group_delete"&gt;
+        &lt;item android:id="@+id/menu_archive"
+              android:title="@string/menu_archive" /&gt;
+        &lt;item android:id="@+id/menu_delete"
+              android:title="@string/menu_delete" /&gt;
     &lt;/group&gt;
 &lt;/menu&gt;
 </pre>
 
-<p>The items that are in the group appear the same as the first item that is not in a
-group&mdash;all three items in the menu are siblings. However, you can modify the traits of the two
-items in the group by referencing the group ID and using the methods listed above.</p>
+<p>The items that are in the group appear at the same level as the first item&mdash;all three items
+in the menu are siblings. However, you can modify the traits of the two
+items in the group by referencing the group ID and using the methods listed above. The system
+will also never separate grouped items. For example, if you declare {@code
+android:showAsAction="ifRoom"} for each item, they will either both appear in the action
+bar or both appear in the action overflow.</p>
 
 
-<h3 id="checkable">Checkable menu items</h3>
+<h3 id="checkable">Using checkable menu items</h3>
 
 <div class="figure" style="width:200px">
   <img src="{@docRoot}images/radio_buttons.png" height="333" alt="" />
-  <p class="img-caption"><strong>Figure 3.</strong> Screenshot of a submenu with checkable
+  <p class="img-caption"><strong>Figure 5.</strong> Screenshot of a submenu with checkable
 items.</p>
 </div>
 
 <p>A menu can be useful as an interface for turning options on and off, using a checkbox for
 stand-alone options, or radio buttons for groups of
-mutually exclusive options. Figure 2 shows a submenu with items that are checkable with radio
+mutually exclusive options. Figure 5 shows a submenu with items that are checkable with radio
 buttons.</p>
 
-<p class="note"><strong>Note:</strong> Menu items in the Icon Menu (from the Options Menu) cannot
+<p class="note"><strong>Note:</strong> Menu items in the Icon Menu (from the options menu) cannot
 display a checkbox or radio button. If you choose to make items in the Icon Menu checkable,
 you must manually indicate the checked state by swapping the icon and/or text
 each time the state changes.</p>
@@ -550,15 +922,15 @@
 <pre>
 &#64;Override
 public boolean onOptionsItemSelected(MenuItem item) {
-  switch (item.getItemId()) {
-  case R.id.vibrate:
-  case R.id.dont_vibrate:
-    if (item.isChecked()) item.setChecked(false);
-    else item.setChecked(true);
-    return true;
-  default:
-    return super.onOptionsItemSelected(item);
-  }
+    switch (item.getItemId()) {
+        case R.id.vibrate:
+        case R.id.dont_vibrate:
+            if (item.isChecked()) item.setChecked(false);
+            else item.setChecked(true);
+            return true;
+        default:
+            return super.onOptionsItemSelected(item);
+    }
 }
 </pre>
 
@@ -575,30 +947,8 @@
 href="{@docRoot}guide/topics/data/data-storage.html#pref">Shared Preferences</a>.</p>
 
 
-<h3 id="shortcuts">Shortcut keys</h3>
 
-<p>To facilitate quick access to items in the Options Menu when the user's device has a hardware
-keyboard, you can add quick-access shortcut keys using letters and/or numbers, with the
-{@code android:alphabeticShortcut} and {@code android:numericShortcut} attributes in the {@code
-&lt;item&gt;} element. You can also use the methods {@link
-android.view.MenuItem#setAlphabeticShortcut(char)} and {@link
-android.view.MenuItem#setNumericShortcut(char)}. Shortcut keys are <em>not</em>
-case sensitive.</p>
-
-<p>For example, if you apply the "s" character as an alphabetic shortcut to a "save" menu item, then
-when the menu is open (or while the user holds the MENU button) and the user presses the "s" key,
-the "save" menu item is selected.</p>
-
-<p>This shortcut key is displayed as a tip in the menu item, below the menu item name
-(except for items in the Icon Menu, which are displayed only if the user holds the MENU
-button).</p>
-
-<p class="note"><strong>Note:</strong> Shortcut keys for menu items only work on devices with a
-hardware keyboard. Shortcuts cannot be added to items in a Context Menu.</p>
-
-
-
-<h3 id="intents">Dynamically adding menu intents</h3>
+<h2 id="intents">Adding Menu Items Based on an Intent</h2>
 
 <p>Sometimes you'll want a menu item to launch an activity using an {@link android.content.Intent}
 (whether it's an activity in your application or another application). When you know the intent you
@@ -671,7 +1021,7 @@
 argument.</p>
 
 
-<h4>Allowing your activity to be added to other menus</h4>
+<h3 id="AllowingToAdd">Allowing your activity to be added to other menus</h3>
 
 <p>You can also offer the services of your activity to other applications, so your
 application can be included in the menu of others (reverse the roles described above).</p>
@@ -681,7 +1031,7 @@
 and/or {@link android.content.Intent#CATEGORY_SELECTED_ALTERNATIVE} values for the intent filter
 category. For example:</p>
 <pre>
-&lt;intent-filter label="Resize Image">
+&lt;intent-filter label="&#64;string/resize_image">
     ...
     &lt;category android:name="android.intent.category.ALTERNATIVE" />
     &lt;category android:name="android.intent.category.SELECTED_ALTERNATIVE" />
diff --git a/docs/html/guide/topics/ui/notifiers/notifications.jd b/docs/html/guide/topics/ui/notifiers/notifications.jd
index 7bc1cde..d104b4b 100644
--- a/docs/html/guide/topics/ui/notifiers/notifications.jd
+++ b/docs/html/guide/topics/ui/notifiers/notifications.jd
@@ -16,6 +16,7 @@
     <h2>In this document</h2>
     <ol>
       <li><a href="#Basics">The Basics</a></li>
+      <li><a href="#HandlingNotifications">Responding to Notifications</a></li>
       <li><a href="#ManageYourNotifications">Managing your Notifications</a></li>
       <li><a href="#CreateANotification">Creating a Notification</a>
         <ol>
@@ -33,6 +34,12 @@
       <li>{@link android.app.Notification}</li>
       <li>{@link android.app.NotificationManager}</li>
     </ol>
+    
+    <h2>See also</h2>
+    <ol>
+      <li><a href="{@docRoot}design/patterns/notifications.html">Android
+Design: Notifications</a></li>
+    </ol>
   </div>
 </div>
 
@@ -61,6 +68,14 @@
 <p class="img-caption"><strong>Figure 2.</strong> The notifications window.</p>
 
 
+<div class="design-announce">
+<p><strong>Notification Design</strong></p>
+  <p>For design guidelines, read Android Design's <a
+href="{@docRoot}design/patterns/notifications.html">Notifications</a> guide.</p>
+</div>
+
+
+
 <h2 id="Basics">The Basics</h2>
 
 <p>An {@link android.app.Activity} or {@link android.app.Service} can initiate a status bar
@@ -123,6 +138,134 @@
 </ol>
 
 
+<h2 id="HandlingNotifications">Responding to Notifications</h2>
+
+<p>A central part of the user's experience with a notification revolves around
+how it interacts with the application's UI flow.  You must implement
+this correctly to provide a consistent user experience within your app.</p>
+
+<p>Two typical examples of notifications are provided by Calendar, which can send out
+notifications of upcoming events, and Email, which can send out notifications
+when new messages arrive.  These represent the two recommended patterns for handling
+notifications: either launching into an activity that is separate from the
+main application, or launching an entirely new instance of the application
+showing the appropriate point for the notification.</p>
+
+<p>The following scenario shows how the activity stack should work
+in these two typical notification flows, first handling a Calendar notification:
+</p>
+
+<ol>
+  <li>User is creating a new event in Calendar. They realize they
+    need to copy part of an email message into this event.
+  </li>
+  <li>
+    The user chooses Home &gt; Email.
+  </li>
+  <li>
+    While in Email, they receive a notification from Calendar for an upcoming
+    meeting.
+  </li>
+  <li>
+    So they choose that notification, which takes them to a
+    dedicated Calendar activity that displays brief details of the
+    upcoming meeting.
+  </li>
+  <li>
+    The user has seen enough to know they have a meeting coming up,
+    so they press the <em>Back</em> button.  They are now returned to Email, which
+    is where they were when they took the notification.
+  </li>
+</ol>
+
+<p>Handling an Email notification:</p>
+
+<ol>
+  <li>
+    The user is currently in Email composing a message, and needs to
+    check a date in their calendar.
+  </li>
+  <li>
+    The user chooses Home &gt; Calendar.
+  </li>
+  <li>
+    While in Calendar, they receive a notification from Email about a new
+    message.
+  </li>
+  <li>
+    They select the notification, which brings them to Email with the message
+    details displayed.  This has replaced what they were previously doing
+    (writing an e-mail), but that message is still saved in their drafts.
+  </li>
+  <li>
+    The user presses <em>Back</em> once to go to the message list (the typical flow in the
+    Email app), and press <em>Back</em> again to return to Calendar as they left it.
+  </li>
+</ol>
+
+<p>In an Email style of notification, the UI launched by the notification
+shows the main application in a state representing that notification.
+For example, when the Email application comes to the foreground from its
+notification, it displays either the conversion list or a specific
+conversation depending on whether there are multiple or only one new
+email.  To achieve this, we want to completely replace whatever current
+state the application is in with a new activity stack representing the
+new notification state.</p>
+
+<p>The following code illustrates how to show this kind of notification.  Of
+most interest is the <code>makeMessageIntentStack()</code> method, which constructs
+an array of intents representing the app's new activity stack for this state.
+(If you are using fragments, you may need to initialize your fragment and
+app state so that pressing <em>Back</em> will switch the UI back to its parent state.)
+The core of this is the {@link android.content.Intent#makeRestartActivityTask
+Intent.makeRestartActivityTask()} method, which constructs the root activity
+of the stack with the appropriate flags, such as
+{@link android.content.Intent#FLAG_ACTIVITY_CLEAR_TASK Intent.FLAG_ACTIVITY_CLEAR_TASK}.</p>
+
+{@sample development/samples/ApiDemos/src/com/example/android/apis/app/IncomingMessage.java
+  app_notification}
+
+<p>In a Calendar style of notification, the UI launched by the notification
+is a dedicated activity that is not part of the normal application flow.
+For example, when the user receives a Calendar notification, choosing that
+notification starts a special activity that displays a list
+of upcoming calendar events &mdash; this view is available only
+from the notification, not through the Calendar's normal user
+interface.</p>
+
+<p>The code for posting this type of notification is very straight-forward; it
+is like the above, but the {@link android.app.PendingIntent} is for just a single
+activity, our dedicated notification activity.</p>
+
+{@sample development/samples/ApiDemos/src/com/example/android/apis/app/IncomingMessage.java
+  interstitial_notification}
+
+<p>This is not enough, however.  Normally Android considers all activities within
+an application to be part of that application's UI flow, so simply launching the
+activity like this can cause it to be mixed with your normal application back stack
+in undesired ways.  To make it behave correctly, in the manifest declaration
+for the activity the attributes 
+<code>android:launchMode="singleTask"</code>,
+<code>android:taskAffinity=""</code> and
+<code>android:excludeFromRecents="true"</code>
+must be set.  The full activity declaration for this sample is:</p>
+
+{@sample development/samples/ApiDemos/AndroidManifest.xml interstitial_affinity}
+
+<p>You must be careful when launching other activities from this initial activity,
+because this is not a top-level part of the application, does not appear in
+recents, and needs to be relaunched at any point from the notification with new data
+to show.  This best approach is to make sure any activity launched from it is
+launched in its own task.  When doing this care must be taken to make sure this
+new task interacts well with the current state of your exiting application's
+task.  This is essentially
+the same as switching to the main application as described for the Email style
+notification shown before.  Given the <code>makeMessageIntentStack()</code>
+method previously shown, handling a click then would look something like this:</p>
+
+{@sample development/samples/ApiDemos/src/com/example/android/apis/app/IncomingMessageInterstitial.java
+  app_launch}
+
 <h2 id="ManageYourNotifications">Managing your Notifications</h2>
 
 <p>The {@link android.app.NotificationManager} is a system service that manages all
diff --git a/docs/html/guide/topics/usb/accessory.jd b/docs/html/guide/topics/usb/accessory.jd
index b0f4881..8b74bc0 100644
--- a/docs/html/guide/topics/usb/accessory.jd
+++ b/docs/html/guide/topics/usb/accessory.jd
@@ -169,8 +169,9 @@
     include a <code>&lt;uses-feature&gt;</code> element that declares that your application uses
     the <code>android.hardware.usb.accessory</code> feature.</li>
 
-    <li>If you are using the <a href="addon">add-on library</a>, add the
-    <code>&lt;uses-library&gt;</code> element specifying
+    <li>If you are using the 
+    <a href="http://code.google.com/android/add-ons/google-apis/index.html">add-on library</a>,
+    add the <code>&lt;uses-library&gt;</code> element specifying
     <code>com.android.future.usb.accessory</code> for the library.</li>
 
     <li>Set the minimum SDK of the application to API Level 10 if you are using the add-on library
diff --git a/docs/html/guide/topics/usb/adk.jd b/docs/html/guide/topics/usb/adk.jd
index 6c7ab0d..4d5fbfa 100644
--- a/docs/html/guide/topics/usb/adk.jd
+++ b/docs/html/guide/topics/usb/adk.jd
@@ -281,16 +281,17 @@
       <p>On Mac:</p>
 
       <ol type="a">
-        <li>Right-click on the Arduino application in Finder and select <strong>Show Package
-        Contents</strong>.</li>
+        <li>Create, if it does not already exist, an <code>Arduino</code>
+        directory inside your user account's <code>Documents</code> directory, and within
+        that, a <code>libraries</code> directory.</li>
 
         <li>Copy the <code>firmware/arduino_libs/AndroidAccessory</code> and
-        <code>firmware/arduino_libs/USB_Host_Shield</code> directories (the complete directories,
-        not just the files within) to the <code>Contents/Resources/Java/libraries</code> directory
-        inside the Arduino application.</li>
+        <code>firmware/arduino_libs/USB_Host_Shield</code> directories (the
+        complete directories, not just the files within) to your
+        <code>Documents/Arduino/libraries/</code> directory.</li>
 
-        <li>Create a <code>CapSense</code> directory in the
-        <code>Contents/Resources/Java/libraries</code> directory.</li>
+        <li>Create a <code>CapSense</code> directory in your
+        <code>Documents/Arduino/libraries/</code> directory.</li>
 
         <li>Copy <code>CapSense.cpp</code> and <code>CapSense.h</code> from the unzipped CapSense
         download to the <code>CapSense</code> directory.</li>
@@ -699,7 +700,7 @@
 </pre>If this method returns false, the board waits until a new device is connected. If it is
 successful, the device displays itself on the USB bus as being in accessory mode when the ADK board
 re-enumerates the bus. When the device is in accessory mode, the accessory then <a href=
-"establish-adk">establishes communication with the device</a>.
+"#establish-adk">establishes communication with the device</a>.
 
   <h3 id="establish-adk">Establish communication with the device</h3>
 
diff --git a/docs/html/guide/topics/wireless/bluetooth.jd b/docs/html/guide/topics/wireless/bluetooth.jd
index 0af1d2c..76da08e 100644
--- a/docs/html/guide/topics/wireless/bluetooth.jd
+++ b/docs/html/guide/topics/wireless/bluetooth.jd
@@ -29,6 +29,7 @@
     <li><a href="#Profiles">Working with Profiles</a> 
       <ol>
         <li><a href="#AT-Commands">Vendor-specific AT commands</a>
+        <li><a href="#HDP">Health Device Profile</a>
       </ol></li>
   </ol> 
  
@@ -43,6 +44,7 @@
   <h2>Related samples</h2> 
   <ol> 
     <li><a href="{@docRoot}resources/samples/BluetoothChat/index.html">Bluetooth Chat</a></li> 
+    <li><a href="{@docRoot}resources/samples/BluetoothHDP/index.html">Bluetooth HDP (Health Device Profile)</a></li>
   </ol> 
  
 </div> 
@@ -132,11 +134,27 @@
 audio can be streamed from one device to another over a Bluetooth connection.
 "A2DP" stands for Advanced Audio Distribution Profile.</dd> 
 
-<dt>{@link android.bluetooth.BluetoothProfile.ServiceListener}</dt> 
+<dt>{@link android.bluetooth.BluetoothHealth}</dt>
+<dd> Represents a Health Device Profile proxy that controls the Bluetooth service.</dd>
+
+<dt>{@link android.bluetooth.BluetoothHealthCallback}</dt>
+
+<dd>An abstract class that you use to implement {@link
+android.bluetooth.BluetoothHealth} callbacks. You must extend this class and
+implement the callback methods to receive updates about changes in the
+application’s registration state and Bluetooth channel state.</dd>
+
+<dt>{@link android.bluetooth.BluetoothHealthAppConfiguration}</dt>
+
+<dd>Represents an application configuration that the Bluetooth Health third-party 
+application registers to communicate with a remote Bluetooth health
+device.</dd> 
+
+<dt>{@link android.bluetooth.BluetoothProfile.ServiceListener}</dt>
 
 <dd>An interface that notifies {@link android.bluetooth.BluetoothProfile} IPC
 clients when they have  been connected to or disconnected from the service (that
-is, the internal service that runs a particular profile). </dd> 
+is, the internal service that runs a particular profile). </dd>
  
 </dl> 
  
@@ -889,7 +907,7 @@
 href="{@docRoot}guide/topics/fundamentals/processes-and-threads.html#IPC">IPC</a
 >). This includes both  Bluetooth Headset and Hands-Free (v1.5) profiles. The
 {@link android.bluetooth.BluetoothHeadset} class includes support for AT commands.
-For more discussion of this topic, see <a href="#AT-Commands">Vendor-specific AT commands</a></li> 
+For more discussion of this topic, see <a href="#AT-Commands">Vendor-specific AT commands</a></li>
 
   <li><strong>A2DP</strong>. The Advanced Audio Distribution Profile (A2DP)
 profile defines how high quality audio can be streamed from one device to
@@ -897,13 +915,25 @@
 android.bluetooth.BluetoothA2dp} class, which is a proxy for controlling
 the Bluetooth A2DP  Service via IPC.</li> 
 
+ <li><strong>Health Device</strong>. Android 4.0 (API level 14) introduces
+support for the Bluetooth Health Device Profile (HDP). This lets you create
+applications that use Bluetooth to communicate with health devices that support
+Bluetooth, such as heart-rate monitors, blood meters, thermometers, scales, and
+so on. For a list of supported devices and their corresponding device data
+specialization codes, refer to <strong>Bluetooth Assigned Numbers</strong> at <a
+href="http://www.bluetooth.org">www.bluetooth.org</a>. Note that these values
+are also referenced in the ISO/IEEE 11073-20601 [7] specification as
+MDC_DEV_SPEC_PROFILE_* in the Nomenclature Codes Annex. For more discussion of
+HDP, see <a href="#HDP">Health Device Profile</a>.</li> 
+
 </ul> 
 
 <p>Here are the basic steps for working with a profile:</p> 
 <ol> 
 
-  <li>Get the default adapter, as described in <a href="{@docRoot}guide/topics/wireless/bluetooth.
-html#SettingUp">Setting Up Bluetooth</a>.</li> 
+  <li>Get the default adapter, as described in
+    <a href="{@docRoot}guide/topics/wireless/bluetooth.html#SettingUp">Setting Up
+      Bluetooth</a>.</li> 
 
   <li>Use {@link
 android.bluetooth.BluetoothAdapter#getProfileProxy(android.content.Context,
@@ -925,7 +955,9 @@
 state of the connection and perform other operations that are relevant to that
 profile.</li> 
 </ol> 
-<p> For example, this code snippet shows how to connect to a {@link android.bluetooth.BluetoothHeadset} proxy object so that you can control the
+
+<p> For example, this code snippet shows how to connect to a {@link
+android.bluetooth.BluetoothHeadset} proxy object so that you can control the
 Headset profile:</p> 
 
 <pre>BluetoothHeadset mBluetoothHeadset;
@@ -955,6 +987,8 @@
 mBluetoothAdapter.closeProfileProxy(mBluetoothHeadset);
 </pre> 
 
+
+
 <h3 id="AT-Commands">Vendor-specific AT commands</h3> 
 
 <p>Starting in Android 3.0, applications can register to receive system
@@ -964,3 +998,81 @@
 user or take other action as needed. Create a broadcast receiver for the {@link
 android.bluetooth.BluetoothHeadset#ACTION_VENDOR_SPECIFIC_HEADSET_EVENT} intent
 to handle vendor-specific AT commands for the headset.</p>
+
+<h3 id="HDP">Health Device Profile</h3>
+
+<p>Android 4.0 (API level 14) introduces support for the Bluetooth Health Device
+Profile (HDP). This lets you create applications that use Bluetooth to
+communicate with health devices that support Bluetooth, such as heart-rate
+monitors, blood meters, thermometers, and scales. The Bluetooth Health API
+includes the classes {@link android.bluetooth.BluetoothHealth}, {@link
+android.bluetooth.BluetoothHealthCallback}, and {@link
+android.bluetooth.BluetoothHealthAppConfiguration}, which are described in <a
+href="#TheBasics">The Basics</a>. </p>
+
+<p>In using the Bluetooth Health API, it's helpful to understand these key HDP concepts:</p>
+<table>
+  <tr>
+    <th>Concept</th>
+    <th>Description</th>
+  </tr>
+  <tr>
+    <td><strong>Source</strong></td>
+
+    <td>A role defined in HDP. A <em>source</em> is a  health device that
+transmits medical data (weight scale, glucose meter, thermometer, etc.) to a
+smart device such as an Android phone or tablet. </td>
+  </tr>
+  <tr>
+    <td><strong>Sink</strong></td>
+
+    <td>A role defined in HDP. In HDP, a <em>sink</em> is the smart device that
+receives the medical data. In an Android HDP application, the sink is
+represented by a {@link android.bluetooth.BluetoothHealthAppConfiguration}
+object.</td>
+  </tr>
+  <tr>
+    <td><strong>Registration</strong></td>
+    <td>Refers to registering a sink for a particular health device.</td>
+  </tr>
+  <tr>
+    <td><strong>Connection</strong></td>
+
+    <td>Refers to opening a channel between a health device and a smart device
+such as an Android phone or tablet.</td>
+  </tr>
+</table>
+
+<h4>Creating an HDP Application</h4>
+
+<p>Here are the basic steps involved in creating an Android HDP application:</p>
+<ol>
+
+  <li>Get a reference to the {@link android.bluetooth.BluetoothHealth} proxy
+object. <p>Similar to regular headset and A2DP profile devices, you must call
+{@link android.bluetooth.BluetoothAdapter#getProfileProxy getProfileProxy()}
+with a {@link android.bluetooth.BluetoothProfile.ServiceListener} and the {@link
+android.bluetooth.BluetoothProfile.ServiceListener#HEALTH} profile type to
+establish a connection with the profile proxy object.</p> </li>
+
+  <li>Create a {@link android.bluetooth.BluetoothHealthCallback} and register an
+application configuration 
+({@link android.bluetooth.BluetoothHealthAppConfiguration})
+that acts as a health
+sink.</li>
+
+  <li>Establish a connection to a health device.  Some devices will initiate the
+connection.  It is unnecessary to carry out this step for those devices.</li>
+
+  <li>When connected successfully to a health device, read/write to the health
+device using the file descriptor. <p>The received data needs to be interpreted
+using a health manager which implements the IEEE 11073-xxxxx
+specifications.</p></li>
+
+  <li>When done, close the health channel and unregister the application.  The
+channel also closes when there is extended inactivity.</li>
+</ol>
+
+<p>For a complete code sample that illustrates these steps, see <a
+href="{@docRoot}resources/samples/BluetoothHDP/index.html">Bluetooth HDP (Health
+Device Profile)</a>. </p>
diff --git a/docs/html/guide/topics/wireless/wifip2p.jd b/docs/html/guide/topics/wireless/wifip2p.jd
new file mode 100644
index 0000000..4dd3d26
--- /dev/null
+++ b/docs/html/guide/topics/wireless/wifip2p.jd
@@ -0,0 +1,611 @@
+page.title=Wi-Fi Direct
+
+@jd:body
+
+  <div id="qv-wrapper">
+    <div id="qv">
+      <h2>In this document</h2>
+
+      <ol>
+        <li><a href="#api">API Overview</a></li>
+        <li><a href="#creating-br">Creating a Broadcast Receiver for Wi-Fi Direct Intents</a></li>
+
+        <li>
+          <a href="#creating-app">Creating a Wi-Fi Direct Application</a>
+
+          <ol>
+            <li><a href="#setup">Initial setup</a></li>
+
+            <li><a href="#discovering">Discovering peers</a></li>
+
+            <li><a href="#connecting">Connecting to peers</a></li>
+
+            <li><a href="#transferring">Transferring data</a></li>
+          </ol>
+        </li>
+      </ol>
+      <h2>Related Samples</h2>
+      <ol>
+        <li><a href="{@docRoot}resources/samples/WiFiDirectDemo/index.html">Wi-Fi Direct Demo</a></li>
+      </ol>
+    </div>
+  </div>
+
+  <p>Wi-Fi Direct allows Android 4.0 (API level 14) or later devices with the appropriate hardware
+  to connect directly to each other via Wi-Fi without an intermediate access point.
+  Using these APIs, you can discover and connect to other devices when each device supports Wi-Fi Direct,
+  then communicate over a speedy connection across distances much longer than a Bluetooth connection.
+  This is useful for applications that share data among users, such as a multiplayer game or
+  a photo sharing application.</p>
+
+  <p>The Wi-Fi Direct APIs consist of the following main parts:</p>
+
+  <ul>
+    <li>Methods that allow you to discover, request, and connect to peers are defined
+    in the {@link android.net.wifi.p2p.WifiP2pManager} class.</li>
+
+    <li>Listeners that allow you to be notified of the success or failure of {@link
+    android.net.wifi.p2p.WifiP2pManager} method calls. When calling {@link
+    android.net.wifi.p2p.WifiP2pManager} methods, each method can receive a specific listener
+    passed in as a parameter.</li>
+
+    <li>Intents that notify you of specific events detected by the Wi-Fi Direct framework,
+    such as a dropped connection or a newly discovered peer.</li>
+  </ul>
+
+  <p>You often use these three main components of the APIs together. For example, you can
+  provide a {@link android.net.wifi.p2p.WifiP2pManager.ActionListener} to a call to {@link
+  android.net.wifi.p2p.WifiP2pManager#discoverPeers discoverPeers()}, so that you can be
+  notified with the {@link android.net.wifi.p2p.WifiP2pManager.ActionListener#onSuccess
+  ActionListener.onSuccess()} and {@link android.net.wifi.p2p.WifiP2pManager.ActionListener#onFailure
+  ActionListener.onFailure()}
+  methods. A {@link android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_PEERS_CHANGED_ACTION} intent is
+  also broadcast if the {@link android.net.wifi.p2p.WifiP2pManager#discoverPeers discoverPeers()}
+  method discovers that the peers list has changed.</p>
+  
+  <h2 id="api">API Overview</h2>
+
+<p>The {@link android.net.wifi.p2p.WifiP2pManager} class provides methods to allow you to interact with
+  the Wi-Fi hardware on your device to do things like discover and connect to peers. The following actions
+  are available:</p>
+
+<p class="table-caption"><strong>Table 1.</strong>Wi-Fi Direct Methods</p>
+
+   <table>
+        <tr>
+          <th>Method</th>
+          <th>Description</th>
+        </tr>
+
+	<tr>
+	  <td>{@link android.net.wifi.p2p.WifiP2pManager#initialize initialize()}</td>
+	  <td>Registers the application with the Wi-Fi framework. This must be called before calling any other Wi-Fi Direct method.</td>
+	</tr>
+
+	<tr>
+	  <td>{@link android.net.wifi.p2p.WifiP2pManager#connect connect()}</td>
+	  <td>Starts a peer-to-peer connection with a device with the specified configuration.</td>
+	</tr>
+
+	<tr>
+	  <td>{@link android.net.wifi.p2p.WifiP2pManager#cancelConnect cancelConnect()}</td>
+	  <td>Cancels any ongoing peer-to-peer group negotiation.</td>
+	</tr>
+
+	<tr>
+	  <td>{@link android.net.wifi.p2p.WifiP2pManager#requestConnectionInfo requestConnectInfo()}</td>
+	  <td>Requests a device's connection information.</td>
+	</tr>
+
+	<tr>
+	  <td>{@link android.net.wifi.p2p.WifiP2pManager#createGroup createGroup()}</td>
+	  <td>Creates a peer-to-peer group with the current device as the group owner.</td>
+	</tr>
+
+	<tr>
+	  <td>{@link android.net.wifi.p2p.WifiP2pManager#removeGroup removeGroup()}</td>
+	  <td>Removes the current peer-to-peer group.</td>
+	</tr>
+
+	<tr>
+	  <td>{@link android.net.wifi.p2p.WifiP2pManager#requestGroupInfo requestGroupInfo()}</td>
+	  <td>Requests peer-to-peer group information.</td>
+	</tr>
+
+	<tr>
+	  <td>{@link android.net.wifi.p2p.WifiP2pManager.PeerListListener#discoverPeers discoverPeers()}</td>
+	  <td>Initiates peer discovery </td>
+	</tr>
+
+	<tr>
+	  <td>{@link android.net.wifi.p2p.WifiP2pManager#requestPeers requestPeers()}</td>
+	  <td>Requests the current list of discovered peers.</td>
+	</tr>
+  </table>
+
+
+ <p>{@link android.net.wifi.p2p.WifiP2pManager} methods let you pass in a listener,
+  so that the Wi-Fi Direct framework can notify your
+  activity of the status of a call. The available listener interfaces and the
+  corresponding {@link android.net.wifi.p2p.WifiP2pManager} method calls that use the listeners
+  are described in the following table:</p>
+
+ <p class="table-caption"><strong>Table 2.</strong> Wi-Fi Direct Listeners</p>
+ 
+ <table>
+    <tr>
+      <th>Listener interface</th>
+      <th>Associated actions</th>
+    </tr>
+    <tr>
+    <td>{@link android.net.wifi.p2p.WifiP2pManager.ActionListener}</td>
+    <td>{@link android.net.wifi.p2p.WifiP2pManager#connect connect()}, {@link
+    android.net.wifi.p2p.WifiP2pManager#cancelConnect cancelConnect()}, {@link
+    android.net.wifi.p2p.WifiP2pManager#createGroup createGroup()}, {@link
+    android.net.wifi.p2p.WifiP2pManager#removeGroup removeGroup()}, and {@link
+    android.net.wifi.p2p.WifiP2pManager.PeerListListener#discoverPeers discoverPeers()}</td>
+    </tr>
+
+    <tr>
+      <td>{@link android.net.wifi.p2p.WifiP2pManager.ChannelListener}</td>
+      <td>{@link android.net.wifi.p2p.WifiP2pManager#initialize initialize()}</td>
+    </tr>
+
+    <tr>
+      <td>{@link android.net.wifi.p2p.WifiP2pManager.ConnectionInfoListener}</td>
+      <td>{@link android.net.wifi.p2p.WifiP2pManager#requestConnectionInfo requestConnectInfo()}</td>
+    </tr>
+
+    <tr>
+      <td>{@link android.net.wifi.p2p.WifiP2pManager.GroupInfoListener}</td>
+      <td>{@link android.net.wifi.p2p.WifiP2pManager#requestGroupInfo requestGroupInfo()}</td>
+    </tr>
+
+    <tr>
+      <td>{@link android.net.wifi.p2p.WifiP2pManager.PeerListListener}</td>
+      <td>{@link android.net.wifi.p2p.WifiP2pManager#requestPeers requestPeers()}</td>
+    </tr>
+  </table>
+
+<p>The Wi-Fi Direct APIs define intents that are broadcast when certain Wi-Fi Direct events happen,
+  such as when a new peer is discovered or when a device's Wi-Fi state changes. You can register
+  to receive these intents in your application by <a href="#creating-br">creating a broadcast
+  receiver</a> that handles these intents:</p>
+
+<p class="table-caption"><strong>Table 3.</strong> Wi-Fi Direct Intents</p>
+
+    <table>
+    <tr>
+      <th>Intent</th>
+      <th>Description</th>
+    </tr>
+      <tr>
+        <td>{@link android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_CONNECTION_CHANGED_ACTION}</td>
+        <td>Broadcast when the state of the device's Wi-Fi connection changes.</td>
+      </tr>
+      <tr>
+        <td>{@link android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_PEERS_CHANGED_ACTION}</td>
+        <td>Broadcast when you call {@link
+    android.net.wifi.p2p.WifiP2pManager.PeerListListener#discoverPeers discoverPeers()}. You
+    usually want to call {@link android.net.wifi.p2p.WifiP2pManager.PeerListListener#requestPeers
+    requestPeers()} to get an updated list of peers if you handle this intent in your
+    application.</td>
+      </tr>
+      <tr>
+        <td>{@link android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_STATE_CHANGED_ACTION}</td>
+        <td>Broadcast when Wi-Fi Direct is enabled or disabled on the device.</td>
+      </tr>
+      <tr>
+        <td>{@link android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_THIS_DEVICE_CHANGED_ACTION}</td>
+        <td>Broadcast when a device's details have changed, such as the device's name.</td>
+      </tr>
+    </table>
+
+
+
+  <h2 id="creating-br">Creating a Broadcast Receiver for Wi-Fi Direct Intents</h2>
+
+  <p>A broadcast receiver allows you to receive intents broadcast by the Android system,
+  so that your application can respond to events that you are interested in. The basic steps
+  for creating a broadcast receiver to handle Wi-Fi Direct intents are as follows:</p>
+
+  <ol>
+    <li>Create a class that extends the {@link android.content.BroadcastReceiver} class. For the
+    class' constructor, you most likely want to have parameters for the {@link
+    android.net.wifi.p2p.WifiP2pManager}, {@link android.net.wifi.p2p.WifiP2pManager.Channel}, and
+    the activity that this broadcast receiver will be registered in. This allows the broadcast
+    receiver to send updates to the activity as well as have access to the Wi-Fi hardware and a
+    communication channel if needed.</li>
+
+    <li>In the broadcast receiver, check for the intents that you are interested in
+    <code>{@link android.content.BroadcastReceiver#onReceive onReceive()}</code>.
+    Carry out any necessary actions depending on the intent that is
+    received. For example, if the broadcast receiver receives a {@link
+    android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_PEERS_CHANGED_ACTION} intent, you can call the
+    {@link android.net.wifi.p2p.WifiP2pManager#requestPeers requestPeers()} method to get a list of
+    the currently discovered peers.</li>
+  </ol>
+
+  <p>The following code shows you how to create a typical broadcast receiver. The broadcast
+  receiver takes a {@link android.net.wifi.p2p.WifiP2pManager} object and an activity as
+  arguments and uses these two classes to appropriately carry out the needed actions when the
+  broadcast receiver receives an intent:</p>
+
+<pre>
+/**
+ * A BroadcastReceiver that notifies of important Wi-Fi p2p events.
+ */
+public class WiFiDirectBroadcastReceiver extends BroadcastReceiver {
+
+    private WifiP2pManager manager;
+    private Channel channel;
+    private MyWiFiActivity activity;
+
+    public WiFiDirectBroadcastReceiver(WifiP2pManager manager, Channel channel,
+            MyWifiActivity activity) {
+        super();
+        this.manager = manager;
+        this.channel = channel;
+        this.activity = activity;
+    }
+
+    &#064;Override
+    public void onReceive(Context context, Intent intent) {
+        String action = intent.getAction();
+
+        if (WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION.equals(action)) {
+            // Check to see if Wi-Fi is enabled and notify appropriate activity
+        } else if (WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION.equals(action)) {
+            // Call WifiP2pManager.requestPeers() to get a list of current peers
+        } else if (WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION.equals(action)) {
+            // Respond to new connection or disconnections
+        } else if (WifiP2pManager.WIFI_P2P_THIS_DEVICE_CHANGED_ACTION.equals(action)) {
+            // Respond to this device's wifi state changing
+        }
+    }
+}
+</pre>
+
+  <h2 id="creating-app">Creating a Wi-Fi Direct Application</h2>
+
+  <p>Creating a Wi-Fi Direct application involves creating and registering a
+  broadcast receiver for your application, discovering peers, connecting to a peer, and
+  transferring data to a peer. The following sections describe how to do this.</p>
+
+  <h3 id="setup">Initial setup</h3>
+  <p>Before using the Wi-Fi Direct APIs, you must ensure that your application can access
+  the hardware and that the device supports the Wi-Fi Direct protocol. If Wi-Fi Direct is supported,
+  you can obtain an instance of {@link android.net.wifi.p2p.WifiP2pManager}, create and register
+  your broadcast receiver, and begin using the Wi-Fi Direct APIs.</p>
+  <ol>
+    <li>
+      <p>Request permission to use the Wi-Fi hardware on the device and also declare
+      your application to have the correct minimum SDK version in the Android manifest:</p>
+      <pre>
+&lt;uses-sdk android:minSdkVersion="14" /&gt;
+&lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /&gt;
+&lt;uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /&gt;
+&lt;uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /&gt;
+&lt;uses-permission android:name="android.permission.INTERNET" /&gt;
+&lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
+</pre>
+    </li>
+
+    <li>Check to see if Wi-Fi Direct is on and supported. A good place to check this is in your
+    broadcast receiver when it receives the {@link
+    android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_STATE_CHANGED_ACTION} intent. Notify your
+    activity of the Wi-Fi Direct state and react accordingly:
+<pre>
+&#064;Override
+public void onReceive(Context context, Intent intent) {
+    ...
+    String action = intent.getAction();
+    if (WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION.equals(action)) {
+        int state = intent.getIntExtra(WifiP2pManager.EXTRA_WIFI_STATE, -1);
+        if (state == WifiP2pManager.WIFI_P2P_STATE_ENABLED) {
+            // Wifi Direct is enabled
+        } else {
+            // Wi-Fi Direct is not enabled
+        }
+    }
+    ...
+}
+</pre>
+    </li>
+
+    <li>In your activity's {@link android.app.Activity#onCreate onCreate()} method, obtain an instance of {@link
+    android.net.wifi.p2p.WifiP2pManager} and register your application with the Wi-Fi Direct
+    framework by calling {@link android.net.wifi.p2p.WifiP2pManager#initialize initialize()}. This
+    method returns a {@link android.net.wifi.p2p.WifiP2pManager.Channel}, which is used to connect
+    your application to the Wi-Fi Direct framework. You should also create an instance of your
+    broadcast receiver with the {@link
+    android.net.wifi.p2p.WifiP2pManager} and {@link android.net.wifi.p2p.WifiP2pManager.Channel}
+    objects along with a reference to your activity. This allows your broadcast receiver to notify
+    your activity of interesting events and update it accordingly. It also lets you manipulate the device's
+    Wi-Fi state if necessary:
+<pre>
+WifiP2pManager mManager;
+Channel mChannel;
+BroadcastReceiver mReceiver;
+...
+&#064;Override
+protected void onCreate(Bundle savedInstanceState){
+    ...
+    mManager = (WifiP2pManager) getSystemService(Context.WIFI_P2P_SERVICE);
+    mChannel = mManager.initialize(this, getMainLooper(), null);
+    Receiver = new WiFiDirectBroadcastReceiver(manager, channel, this);
+    ...
+}
+</pre>
+    </li>
+
+    <li>Create an intent filter and add the same intents that your
+    broadcast receiver checks for:
+      <pre>
+IntentFilter mIntentFilter;
+...
+&#064;Override
+protected void onCreate(Bundle savedInstanceState){
+    ...
+    mIntentFilter = new IntentFilter();
+    mIntentFilter.addAction(WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION);
+    mIntentFilter.addAction(WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION);
+    mIntentFilter.addAction(WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION);
+    mIntentFilter.addAction(WifiP2pManager.WIFI_P2P_THIS_DEVICE_CHANGED_ACTION);
+    ...
+}
+</pre>
+    </li>
+
+    <li>Register the broadcast receiver in the {@link android.app.Activity#onResume()} method
+    of your activity and unregister it in the {@link android.app.Activity#onPause()} method of your activity:
+      <pre>
+/* register the broadcast receiver with the intent values to be matched */
+&#064;Override
+protected void onResume() {
+    super.onResume();
+    registerReceiver(receiver, intentFilter);
+}
+/* unregister the broadcast receiver */
+&#064;Override
+protected void onPause() {
+    super.onPause();
+    unregisterReceiver(receiver);
+}
+</pre>
+
+      <p>When you have obtained a {@link android.net.wifi.p2p.WifiP2pManager.Channel} and
+      set up a broadcast receiver, your application can make Wi-Fi Direct method calls and receive
+      Wi-Fi Direct intents.</p>
+    </li>
+
+    <p>You can now implement your application and use the Wi-Fi Direct features by calling the
+    methods in {@link android.net.wifi.p2p.WifiP2pManager}. The next sections describe how to do common actions
+    such as discovering and connecting to peers.</p>
+  </ol>
+
+  <h3 id="discovering">Discovering peers</h3>
+
+  <p>To discover peers that are available to connect to, call {@link
+  android.net.wifi.p2p.WifiP2pManager#discoverPeers discoverPeers()} to detect
+  available peers that are in range. The call to this function is asynchronous and a success or
+  failure is communicated to your application with {@link
+  android.net.wifi.p2p.WifiP2pManager.ActionListener#onSuccess onSuccess()} and {@link
+  android.net.wifi.p2p.WifiP2pManager.ActionListener#onFailure onFailure()} if you created a 
+  {@link android.net.wifi.p2p.WifiP2pManager.ActionListener}. The
+  {@link android.net.wifi.p2p.WifiP2pManager.ActionListener#onSuccess onSuccess()} method only notifies you
+  that the discovery process succeeded and does not provide any information about the actual peers
+  that it discovered, if any:</p>
+  <pre>
+manager.discoverPeers(channel, new WifiP2pManager.ActionListener() {
+    &#064;Override
+    public void onSuccess() {
+        ...
+    }
+
+    &#064;Override
+    public void onFailure(int reasonCode) {
+        ...
+    }
+});
+
+</pre>
+
+<p>If the discovery process succeeds and detects peers, the system broadcasts the {@link
+  android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_PEERS_CHANGED_ACTION} intent, which you can listen
+  for in a broadcast receiver to obtain a list of peers. When your application receives the {@link
+  android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_PEERS_CHANGED_ACTION} intent, you can request a
+  list of the discovered peers with {@link
+  android.net.wifi.p2p.WifiP2pManager#requestPeers requestPeers()}. The following code shows how to set this up:</p>
+  <pre>
+PeerListListener myPeerListListener;
+...
+if (WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION.equals(action)) {
+
+    // request available peers from the wifi p2p manager. This is an
+    // asynchronous call and the calling activity is notified with a
+    // callback on PeerListListener.onPeersAvailable()
+    if (manager != null) {
+        manager.requestPeers(channel, myPeerListListener);
+    }
+}
+</pre>
+
+  <p>The {@link android.net.wifi.p2p.WifiP2pManager#requestPeers requestPeers()} method is also
+  asynchronous and can notify your activity when a list of peers is available with {@link
+  android.net.wifi.p2p.WifiP2pManager.PeerListListener#onPeersAvailable onPeersAvailable()}, which is defined in the
+  the {@link android.net.wifi.p2p.WifiP2pManager.PeerListListener} interface. The {@link
+  android.net.wifi.p2p.WifiP2pManager.PeerListListener#onPeersAvailable onPeersAvailable()} method
+  provides you with an {@link android.net.wifi.p2p.WifiP2pDeviceList}, which you can iterate
+  through to find the peer that you want to connect to.</p>
+
+  <h3 id="connecting">Connecting to peers</h3>
+
+  <p>When you have figured out the device that you want to connect to after obtaining a list of
+  possible peers, call the {@link android.net.wifi.p2p.WifiP2pManager#connect connect()} method to
+  connect to the device. This method call requires a {@link android.net.wifi.p2p.WifiP2pConfig}
+  object that contains the information of the device to connect to.
+  You can be notified of a connection success or failure through the {@link
+  android.net.wifi.p2p.WifiP2pManager.ActionListener}. The following code
+  shows you how to create a connection to a desired device:</p>
+  <pre>
+//obtain a peer from the WifiP2pDeviceList
+WifiP2pDevice device;
+WifiP2pConfig config = new WifiP2pConfig();
+config.deviceAddress = device.deviceAddress;
+manager.connect(channel, config, new ActionListener() {
+
+    &#064;Override
+    public void onSuccess() {
+        //success logic
+    }
+
+    &#064;Override
+    public void onFailure(int reason) {
+        //failure logic
+    }
+});
+
+</pre>
+
+
+  <h3 id="transferring">Transferring data</h3>
+  <p>Once a connection is established, you can transfer data between the devices with
+  sockets. The basic steps of transferring data are as follows:</p>
+
+  <ol>
+    <li>Create a {@link java.net.ServerSocket}. This socket waits for a connection from a client on a specified
+    port and blocks until it happens, so do this in a background thread.</li>
+
+    <li>Create a client {@link java.net.Socket}. The client uses the IP address and port of
+    the server socket to connect to the server device.</li>
+
+    <li>Send data from the client to the server. When the client
+    socket successfully connects to the server socket, you can send data from the client to the server
+    with byte streams. </li>
+
+    <li>The server socket waits for a client connection (with the {@link java.net.ServerSocket#accept()} method). This
+    call blocks until a client connects, so call this is another thread. When a connection happens, the server device can receive
+    the data from the client. Carry out any actions with this data, such as saving it to a file
+    or presenting it to the user.</li>
+  </ol>
+
+  <p>The following example, modified from the <a href=
+  "{@docRoot}resources/samples/WifiDirectDemo/index.html">Wi-Fi Direct Demo</a> sample, shows you how
+  to create this client-server socket communication and transfer JPEG images from a client
+  to a server with a service. For a complete working example, compile and run the <a href=
+  "{@docRoot}resources/samples/WifiDirectDemo/index.html">Wi-Fi Direct Demo</a> sample.</p>
+<pre>
+public static class FileServerAsyncTask extends AsyncTask<Void, Void, String> {
+
+    private Context context;
+    private TextView statusText;
+
+    public FileServerAsyncTask(Context context, View statusText) {
+        this.context = context;
+        this.statusText = (TextView) statusText;
+    }
+
+    &#064;Override
+    protected String doInBackground(Void... params) {
+        try {
+
+            /**
+             * Create a server socket and wait for client connections. This
+             * call blocks until a connection is accepted from a client
+             */
+            ServerSocket serverSocket = new ServerSocket(8888);
+            Socket client = serverSocket.accept();
+
+            /**
+             * If this code is reached, a client has connected and transferred data
+             * Save the input stream from the client as a JPEG file
+             */
+            final File f = new File(Environment.getExternalStorageDirectory() + "/"
+                    + context.getPackageName() + "/wifip2pshared-" + System.currentTimeMillis()
+                    + ".jpg");
+
+            File dirs = new File(f.getParent());
+            if (!dirs.exists())
+                dirs.mkdirs();
+            f.createNewFile();
+            InputStream inputstream = client.getInputStream();
+            copyFile(inputstream, new FileOutputStream(f));
+            serverSocket.close();
+            return f.getAbsolutePath();
+        } catch (IOException e) {
+            Log.e(WiFiDirectActivity.TAG, e.getMessage());
+            return null;
+        }
+    }
+
+    /**
+     * Start activity that can handle the JPEG image
+     */
+    &#064;Override
+    protected void onPostExecute(String result) {
+        if (result != null) {
+            statusText.setText("File copied - " + result);
+            Intent intent = new Intent();
+            intent.setAction(android.content.Intent.ACTION_VIEW);
+            intent.setDataAndType(Uri.parse("file://" + result), "image/*");
+            context.startActivity(intent);
+        }
+    }
+}
+</pre>
+
+  <p>On the client, connect to the server socket with a client socket and transfer data. This example
+  transfers a JPEG file on the client device's file system.</p>
+
+<pre>
+Context context = this.getApplicationContext();
+String host;
+int port;
+int len;
+Socket socket = new Socket();
+byte buf[]  = new byte[1024];
+...
+try {
+    /**
+     * Create a client socket with the host,
+     * port, and timeout information.
+     */
+    socket.bind(null);
+    socket.connect((new InetSocketAddress(host, port)), 500);
+
+    /**
+     * Create a byte stream from a JPEG file and pipe it to the output stream
+     * of the socket. This data will be retrieved by the server device.
+     */
+    OutputStream outputStream = socket.getOutputStream();
+    ContentResolver cr = context.getContentResolver();
+    InputStream inputStream = null;
+    inputStream = cr.openInputStream(Uri.parse("path/to/picture.jpg"));
+    while ((len = inputStream.read(buf)) != -1) {
+        outputStream.write(buf, 0, len);
+    }
+    outputStream.close();
+    inputStream.close();
+} catch (FileNotFoundException e) {
+    //catch logic
+} catch (IOException e) {
+    //catch logic
+}
+
+/**
+ * Clean up any open sockets when done
+ * transferring or if an exception occurred.
+ */
+finally {
+    if (socket != null) {
+        if (socket.isConnected()) {
+            try {
+                socket.close();
+            } catch (IOException e) {
+                //catch logic
+            }
+        }
+    }
+}
+</pre>
diff --git a/docs/html/guide/webapps/webview.jd b/docs/html/guide/webapps/webview.jd
index ed28f21..66b5501 100644
--- a/docs/html/guide/webapps/webview.jd
+++ b/docs/html/guide/webapps/webview.jd
@@ -298,18 +298,18 @@
 pages. You can navigate backward and forward through the history with {@link
 android.webkit.WebView#goBack()} and {@link android.webkit.WebView#goForward()}.</p>
 
-<p>For example, here's how your {@link android.app.Activity} can use the device BACK key to navigate
-backward:</p>
+<p>For example, here's how your {@link android.app.Activity} can use the device <em>Back</em> button
+to navigate backward:</p>
 
 <pre>
 &#64;Override
 public boolean {@link android.app.Activity#onKeyDown(int,KeyEvent) onKeyDown}(int keyCode, KeyEvent event) {
-    // Check if the key event was the BACK key and if there's history
+    // Check if the key event was the Back button and if there's history
     if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; myWebView.{@link android.webkit.WebView#canGoBack() canGoBack}() {
         myWebView.{@link android.webkit.WebView#goBack() goBack}();
         return true;
     }
-    // If it wasn't the BACK key or there's no web page history, bubble up to the default
+    // If it wasn't the Back key or there's no web page history, bubble up to the default
     // system behavior (probably exit the activity)
     return super.onKeyDown(keyCode, event);
 }
diff --git a/docs/html/images/home/android-design.png b/docs/html/images/home/android-design.png
new file mode 100644
index 0000000..e021401
--- /dev/null
+++ b/docs/html/images/home/android-design.png
Binary files differ
diff --git a/docs/html/images/publishing/publishing_android_market.png b/docs/html/images/publishing/publishing_android_market.png
new file mode 100755
index 0000000..aa591ef
--- /dev/null
+++ b/docs/html/images/publishing/publishing_android_market.png
Binary files differ
diff --git a/docs/html/images/rs_compute.graffle b/docs/html/images/rs_compute.graffle
new file mode 100644
index 0000000..3fa8c67a
--- /dev/null
+++ b/docs/html/images/rs_compute.graffle
@@ -0,0 +1,2445 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>ActiveLayerIndex</key>
+	<integer>0</integer>
+	<key>ApplicationVersion</key>
+	<array>
+		<string>com.omnigroup.OmniGrafflePro</string>
+		<string>138.28.0.154505</string>
+	</array>
+	<key>AutoAdjust</key>
+	<true/>
+	<key>BackgroundGraphic</key>
+	<dict>
+		<key>Bounds</key>
+		<string>{{0, 0}, {576, 733}}</string>
+		<key>Class</key>
+		<string>SolidGraphic</string>
+		<key>ID</key>
+		<integer>2</integer>
+		<key>Style</key>
+		<dict>
+			<key>shadow</key>
+			<dict>
+				<key>Draws</key>
+				<string>NO</string>
+			</dict>
+			<key>stroke</key>
+			<dict>
+				<key>Draws</key>
+				<string>NO</string>
+			</dict>
+		</dict>
+	</dict>
+	<key>CanvasOrigin</key>
+	<string>{0, 0}</string>
+	<key>ColumnAlign</key>
+	<integer>1</integer>
+	<key>ColumnSpacing</key>
+	<real>36</real>
+	<key>CreationDate</key>
+	<string>2011-09-19 10:15:24 -0700</string>
+	<key>Creator</key>
+	<string>Robert Ly</string>
+	<key>DisplayScale</key>
+	<string>1 0/72 in = 1.0000 in</string>
+	<key>GraphDocumentVersion</key>
+	<integer>6</integer>
+	<key>GraphicsList</key>
+	<array>
+		<dict>
+			<key>Bounds</key>
+			<string>{{67.75, 299.343}, {157, 40.322}}</string>
+			<key>Class</key>
+			<string>ShapedGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Color</key>
+				<dict>
+					<key>b</key>
+					<string>0</string>
+					<key>g</key>
+					<string>0</string>
+					<key>r</key>
+					<string>0</string>
+				</dict>
+				<key>Font</key>
+				<string>DroidSans-Bold</string>
+				<key>Size</key>
+				<real>10</real>
+			</dict>
+			<key>ID</key>
+			<integer>247</integer>
+			<key>Magnets</key>
+			<array>
+				<string>{1, 1}</string>
+				<string>{1, -1}</string>
+				<string>{-1, -1}</string>
+				<string>{-1, 1}</string>
+				<string>{0, 1}</string>
+				<string>{0, -1}</string>
+				<string>{1, 0}</string>
+				<string>{-1, 0}</string>
+				<string>{-0.5, -0.233518}</string>
+				<string>{-0.491442, 0.260063}</string>
+				<string>{0.507118, -0.224086}</string>
+				<string>{0.507118, 0.267179}</string>
+				<string>{-0.27431, -0.474028}</string>
+				<string>{0.27978, -0.478478}</string>
+				<string>{0.293938, 0.543044}</string>
+				<string>{-0.286232, 0.553804}</string>
+			</array>
+			<key>Shape</key>
+			<string>Rectangle</string>
+			<key>Style</key>
+			<dict>
+				<key>fill</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.628571</string>
+						<key>g</key>
+						<string>0.768599</string>
+						<key>r</key>
+						<string>1</string>
+					</dict>
+					<key>FillType</key>
+					<integer>2</integer>
+					<key>GradientAngle</key>
+					<real>90</real>
+					<key>GradientColor</key>
+					<dict>
+						<key>b</key>
+						<string>0.236788</string>
+						<key>g</key>
+						<string>0.532236</string>
+						<key>r</key>
+						<string>0.990271</string>
+					</dict>
+				</dict>
+				<key>shadow</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.35</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>Fuzziness</key>
+					<real>2.3972222805023193</real>
+					<key>ShadowVector</key>
+					<string>{0, 1}</string>
+				</dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.131021</string>
+						<key>g</key>
+						<string>0.363196</string>
+						<key>r</key>
+						<string>0.725948</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>3</real>
+				</dict>
+			</dict>
+			<key>Text</key>
+			<dict>
+				<key>Text</key>
+				<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 Renderscript object}</string>
+				<key>VerticalPad</key>
+				<integer>0</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Bounds</key>
+			<string>{{67.75, 231.343}, {157, 45.161}}</string>
+			<key>Class</key>
+			<string>ShapedGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Color</key>
+				<dict>
+					<key>b</key>
+					<string>0</string>
+					<key>g</key>
+					<string>0</string>
+					<key>r</key>
+					<string>0</string>
+				</dict>
+				<key>Font</key>
+				<string>DroidSans-Bold</string>
+				<key>Size</key>
+				<real>10</real>
+			</dict>
+			<key>ID</key>
+			<integer>200</integer>
+			<key>Magnets</key>
+			<array>
+				<string>{1, 1}</string>
+				<string>{1, -1}</string>
+				<string>{-1, -1}</string>
+				<string>{-1, 1}</string>
+				<string>{0, 1}</string>
+				<string>{0, -1}</string>
+				<string>{1, 0}</string>
+				<string>{-1, 0}</string>
+				<string>{-0.5, -0.233518}</string>
+				<string>{-0.491442, 0.260063}</string>
+				<string>{0.507118, -0.224086}</string>
+				<string>{0.507118, 0.267179}</string>
+				<string>{-0.27431, -0.474028}</string>
+				<string>{0.27978, -0.478478}</string>
+				<string>{0.293938, 0.543044}</string>
+				<string>{-0.286232, 0.553804}</string>
+			</array>
+			<key>Shape</key>
+			<string>Rectangle</string>
+			<key>Style</key>
+			<dict>
+				<key>fill</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.628571</string>
+						<key>g</key>
+						<string>0.768599</string>
+						<key>r</key>
+						<string>1</string>
+					</dict>
+					<key>FillType</key>
+					<integer>2</integer>
+					<key>GradientAngle</key>
+					<real>90</real>
+					<key>GradientColor</key>
+					<dict>
+						<key>b</key>
+						<string>0.236788</string>
+						<key>g</key>
+						<string>0.532236</string>
+						<key>r</key>
+						<string>0.990271</string>
+					</dict>
+				</dict>
+				<key>shadow</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.35</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>Fuzziness</key>
+					<real>2.3972222805023193</real>
+					<key>ShadowVector</key>
+					<string>{0, 1}</string>
+				</dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.131021</string>
+						<key>g</key>
+						<string>0.363196</string>
+						<key>r</key>
+						<string>0.725948</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>3</real>
+				</dict>
+			</dict>
+			<key>Text</key>
+			<dict>
+				<key>Text</key>
+				<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 Renderscript context}</string>
+				<key>VerticalPad</key>
+				<integer>0</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Class</key>
+			<string>LineGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Font</key>
+				<string>DroidSans</string>
+				<key>Size</key>
+				<real>11</real>
+			</dict>
+			<key>Head</key>
+			<dict>
+				<key>ID</key>
+				<integer>247</integer>
+				<key>Info</key>
+				<integer>6</integer>
+			</dict>
+			<key>ID</key>
+			<integer>246</integer>
+			<key>OrthogonalBarAutomatic</key>
+			<false/>
+			<key>OrthogonalBarPoint</key>
+			<string>{0, 0}</string>
+			<key>OrthogonalBarPosition</key>
+			<real>40</real>
+			<key>Points</key>
+			<array>
+				<string>{146.25, 276.504}</string>
+				<string>{146.25, 299.343}</string>
+			</array>
+			<key>Style</key>
+			<dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.7</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>4</real>
+					<key>HeadArrow</key>
+					<string>Ball</string>
+					<key>LineType</key>
+					<integer>2</integer>
+					<key>TailArrow</key>
+					<string>0</string>
+				</dict>
+			</dict>
+			<key>Tail</key>
+			<dict>
+				<key>ID</key>
+				<integer>200</integer>
+				<key>Info</key>
+				<integer>5</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Class</key>
+			<string>LineGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Font</key>
+				<string>DroidSans</string>
+				<key>Size</key>
+				<real>11</real>
+			</dict>
+			<key>Head</key>
+			<dict>
+				<key>ID</key>
+				<integer>251</integer>
+				<key>Info</key>
+				<integer>8</integer>
+			</dict>
+			<key>ID</key>
+			<integer>256</integer>
+			<key>OrthogonalBarAutomatic</key>
+			<false/>
+			<key>OrthogonalBarPoint</key>
+			<string>{0, 0}</string>
+			<key>OrthogonalBarPosition</key>
+			<real>62</real>
+			<key>Points</key>
+			<array>
+				<string>{224.75, 319.504}</string>
+				<string>{339.25, 229.339}</string>
+			</array>
+			<key>Style</key>
+			<dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.7</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>4</real>
+					<key>HeadArrow</key>
+					<string>Ball</string>
+					<key>LineType</key>
+					<integer>2</integer>
+					<key>TailArrow</key>
+					<string>0</string>
+				</dict>
+			</dict>
+			<key>Tail</key>
+			<dict>
+				<key>ID</key>
+				<integer>247</integer>
+				<key>Info</key>
+				<integer>7</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Bounds</key>
+			<string>{{51.25, 186.67}, {190, 175.33}}</string>
+			<key>Class</key>
+			<string>ShapedGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Color</key>
+				<dict>
+					<key>b</key>
+					<string>0</string>
+					<key>g</key>
+					<string>0</string>
+					<key>r</key>
+					<string>0</string>
+				</dict>
+				<key>Font</key>
+				<string>DroidSans-Bold</string>
+				<key>Size</key>
+				<real>10</real>
+			</dict>
+			<key>ID</key>
+			<integer>235</integer>
+			<key>Magnets</key>
+			<array>
+				<string>{1, 1}</string>
+				<string>{1, -1}</string>
+				<string>{-1, -1}</string>
+				<string>{-1, 1}</string>
+				<string>{0, 1}</string>
+				<string>{0, -1}</string>
+				<string>{1, 0}</string>
+				<string>{-1, 0}</string>
+				<string>{-0.5, -0.233518}</string>
+				<string>{-0.491442, 0.260063}</string>
+				<string>{0.507118, -0.224086}</string>
+				<string>{0.507118, 0.267179}</string>
+				<string>{-0.27431, -0.474028}</string>
+				<string>{0.27978, -0.478478}</string>
+				<string>{0.293938, 0.543044}</string>
+				<string>{-0.286232, 0.553804}</string>
+			</array>
+			<key>Shape</key>
+			<string>Rectangle</string>
+			<key>Style</key>
+			<dict>
+				<key>fill</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>1</string>
+						<key>g</key>
+						<string>0.874135</string>
+						<key>r</key>
+						<string>0.71718</string>
+					</dict>
+					<key>FillType</key>
+					<integer>2</integer>
+					<key>GradientAngle</key>
+					<real>90</real>
+					<key>GradientColor</key>
+					<dict>
+						<key>b</key>
+						<string>1</string>
+						<key>g</key>
+						<string>0.662438</string>
+						<key>r</key>
+						<string>0.464468</string>
+					</dict>
+				</dict>
+				<key>shadow</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.35</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>Fuzziness</key>
+					<real>2.3972222805023193</real>
+					<key>ShadowVector</key>
+					<string>{0, 1}</string>
+				</dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.93512</string>
+						<key>g</key>
+						<string>0.472602</string>
+						<key>r</key>
+						<string>0.333854</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>3</real>
+				</dict>
+			</dict>
+			<key>Text</key>
+			<dict>
+				<key>Text</key>
+				<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 \
+Activity\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+}</string>
+				<key>VerticalPad</key>
+				<integer>0</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Bounds</key>
+			<string>{{26.5, 137.831}, {239.5, 238.669}}</string>
+			<key>Class</key>
+			<string>ShapedGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Color</key>
+				<dict>
+					<key>b</key>
+					<string>0</string>
+					<key>g</key>
+					<string>0</string>
+					<key>r</key>
+					<string>0</string>
+				</dict>
+				<key>Font</key>
+				<string>Helvetica-Bold</string>
+				<key>Size</key>
+				<real>10</real>
+			</dict>
+			<key>ID</key>
+			<integer>233</integer>
+			<key>Magnets</key>
+			<array>
+				<string>{1, 1}</string>
+				<string>{1, -1}</string>
+				<string>{-1, -1}</string>
+				<string>{-1, 1}</string>
+				<string>{0, 1}</string>
+				<string>{0, -1}</string>
+				<string>{1, 0}</string>
+				<string>{-1, 0}</string>
+				<string>{-0.5, -0.233518}</string>
+				<string>{-0.491442, 0.260063}</string>
+				<string>{0.507118, -0.224086}</string>
+				<string>{0.507118, 0.267179}</string>
+				<string>{-0.27431, -0.474028}</string>
+				<string>{0.27978, -0.478478}</string>
+				<string>{0.293938, 0.543044}</string>
+				<string>{-0.286232, 0.553804}</string>
+			</array>
+			<key>Shape</key>
+			<string>Rectangle</string>
+			<key>Style</key>
+			<dict>
+				<key>fill</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.938075</string>
+						<key>g</key>
+						<string>0.938269</string>
+						<key>r</key>
+						<string>0.938154</string>
+					</dict>
+					<key>FillType</key>
+					<integer>2</integer>
+					<key>GradientAngle</key>
+					<real>90</real>
+					<key>GradientColor</key>
+					<dict>
+						<key>b</key>
+						<string>0.727869</string>
+						<key>g</key>
+						<string>0.728019</string>
+						<key>r</key>
+						<string>0.72793</string>
+					</dict>
+				</dict>
+				<key>shadow</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.35</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>Fuzziness</key>
+					<real>2.3972222805023193</real>
+					<key>ShadowVector</key>
+					<string>{0, 1}</string>
+				</dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.472997</string>
+						<key>g</key>
+						<string>0.473094</string>
+						<key>r</key>
+						<string>0.473036</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>3</real>
+				</dict>
+			</dict>
+			<key>Text</key>
+			<dict>
+				<key>Text</key>
+				<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 \
+\
+\
+\
+Android Framework\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+}</string>
+				<key>VerticalPad</key>
+				<integer>0</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Class</key>
+			<string>Group</string>
+			<key>Graphics</key>
+			<array>
+				<dict>
+					<key>Class</key>
+					<string>LineGraphic</string>
+					<key>FontInfo</key>
+					<dict>
+						<key>Font</key>
+						<string>DroidSans</string>
+						<key>Size</key>
+						<real>11</real>
+					</dict>
+					<key>Head</key>
+					<dict>
+						<key>ID</key>
+						<integer>250</integer>
+					</dict>
+					<key>ID</key>
+					<integer>249</integer>
+					<key>OrthogonalBarAutomatic</key>
+					<false/>
+					<key>OrthogonalBarPoint</key>
+					<string>{0, 0}</string>
+					<key>OrthogonalBarPosition</key>
+					<real>4.1290435791015625</real>
+					<key>Points</key>
+					<array>
+						<string>{434.25, 252.366}</string>
+						<string>{434.25, 281.285}</string>
+					</array>
+					<key>Style</key>
+					<dict>
+						<key>stroke</key>
+						<dict>
+							<key>Color</key>
+							<dict>
+								<key>a</key>
+								<string>0.7</string>
+								<key>b</key>
+								<string>0</string>
+								<key>g</key>
+								<string>0</string>
+								<key>r</key>
+								<string>0</string>
+							</dict>
+							<key>CornerRadius</key>
+							<real>4</real>
+							<key>HeadArrow</key>
+							<string>FilledArrow</string>
+							<key>LineType</key>
+							<integer>2</integer>
+							<key>TailArrow</key>
+							<string>0</string>
+						</dict>
+					</dict>
+					<key>Tail</key>
+					<dict>
+						<key>ID</key>
+						<integer>251</integer>
+						<key>Info</key>
+						<integer>5</integer>
+					</dict>
+				</dict>
+				<dict>
+					<key>Bounds</key>
+					<string>{{339.25, 281.285}, {190, 46.0537}}</string>
+					<key>Class</key>
+					<string>ShapedGraphic</string>
+					<key>FontInfo</key>
+					<dict>
+						<key>Color</key>
+						<dict>
+							<key>b</key>
+							<string>0</string>
+							<key>g</key>
+							<string>0</string>
+							<key>r</key>
+							<string>0</string>
+						</dict>
+						<key>Font</key>
+						<string>Helvetica-Bold</string>
+						<key>Size</key>
+						<real>10</real>
+					</dict>
+					<key>ID</key>
+					<integer>250</integer>
+					<key>Magnets</key>
+					<array>
+						<string>{1, 1}</string>
+						<string>{1, -1}</string>
+						<string>{-1, -1}</string>
+						<string>{-1, 1}</string>
+						<string>{0, 1}</string>
+						<string>{0, -1}</string>
+						<string>{1, 0}</string>
+						<string>{-1, 0}</string>
+						<string>{-0.5, -0.233518}</string>
+						<string>{-0.491442, 0.260063}</string>
+						<string>{0.507118, -0.224086}</string>
+						<string>{0.507118, 0.267179}</string>
+						<string>{-0.27431, -0.474028}</string>
+						<string>{0.27978, -0.478478}</string>
+						<string>{0.293938, 0.543044}</string>
+						<string>{-0.286232, 0.553804}</string>
+					</array>
+					<key>Shape</key>
+					<string>Rectangle</string>
+					<key>Style</key>
+					<dict>
+						<key>fill</key>
+						<dict>
+							<key>Color</key>
+							<dict>
+								<key>b</key>
+								<string>0.274119</string>
+								<key>g</key>
+								<string>0.950739</string>
+								<key>r</key>
+								<string>0.787494</string>
+							</dict>
+							<key>FillType</key>
+							<integer>2</integer>
+							<key>GradientAngle</key>
+							<real>90</real>
+							<key>GradientColor</key>
+							<dict>
+								<key>b</key>
+								<string>0.223529</string>
+								<key>g</key>
+								<string>0.776471</string>
+								<key>r</key>
+								<string>0.643137</string>
+							</dict>
+						</dict>
+						<key>shadow</key>
+						<dict>
+							<key>Color</key>
+							<dict>
+								<key>a</key>
+								<string>0.35</string>
+								<key>b</key>
+								<string>0</string>
+								<key>g</key>
+								<string>0</string>
+								<key>r</key>
+								<string>0</string>
+							</dict>
+							<key>Fuzziness</key>
+							<real>2.3972222805023193</real>
+							<key>ShadowVector</key>
+							<string>{0, 1}</string>
+						</dict>
+						<key>stroke</key>
+						<dict>
+							<key>Color</key>
+							<dict>
+								<key>b</key>
+								<string>0.165602</string>
+								<key>g</key>
+								<string>0.586124</string>
+								<key>r</key>
+								<string>0.428309</string>
+							</dict>
+							<key>CornerRadius</key>
+							<real>3</real>
+						</dict>
+					</dict>
+					<key>Text</key>
+					<dict>
+						<key>Text</key>
+						<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 Renderscript Compute Engine}</string>
+						<key>VerticalPad</key>
+						<integer>0</integer>
+					</dict>
+				</dict>
+				<dict>
+					<key>Bounds</key>
+					<string>{{339.25, 206.312}, {190, 46.0537}}</string>
+					<key>Class</key>
+					<string>ShapedGraphic</string>
+					<key>FontInfo</key>
+					<dict>
+						<key>Color</key>
+						<dict>
+							<key>b</key>
+							<string>0</string>
+							<key>g</key>
+							<string>0</string>
+							<key>r</key>
+							<string>0</string>
+						</dict>
+						<key>Font</key>
+						<string>DroidSans-Bold</string>
+						<key>Size</key>
+						<real>10</real>
+					</dict>
+					<key>ID</key>
+					<integer>251</integer>
+					<key>Magnets</key>
+					<array>
+						<string>{1, 1}</string>
+						<string>{1, -1}</string>
+						<string>{-1, -1}</string>
+						<string>{-1, 1}</string>
+						<string>{0, 1}</string>
+						<string>{0, -1}</string>
+						<string>{1, 0}</string>
+						<string>{-1, 0}</string>
+						<string>{-0.5, -0.233518}</string>
+						<string>{-0.491442, 0.260063}</string>
+						<string>{0.507118, -0.224086}</string>
+						<string>{0.507118, 0.267179}</string>
+						<string>{-0.27431, -0.474028}</string>
+						<string>{0.27978, -0.478478}</string>
+						<string>{0.293938, 0.543044}</string>
+						<string>{-0.286232, 0.553804}</string>
+					</array>
+					<key>Shape</key>
+					<string>Rectangle</string>
+					<key>Style</key>
+					<dict>
+						<key>fill</key>
+						<dict>
+							<key>Color</key>
+							<dict>
+								<key>b</key>
+								<string>1</string>
+								<key>g</key>
+								<string>0.874135</string>
+								<key>r</key>
+								<string>0.71718</string>
+							</dict>
+							<key>FillType</key>
+							<integer>2</integer>
+							<key>GradientAngle</key>
+							<real>90</real>
+							<key>GradientColor</key>
+							<dict>
+								<key>b</key>
+								<string>1</string>
+								<key>g</key>
+								<string>0.662438</string>
+								<key>r</key>
+								<string>0.464468</string>
+							</dict>
+						</dict>
+						<key>shadow</key>
+						<dict>
+							<key>Color</key>
+							<dict>
+								<key>a</key>
+								<string>0.35</string>
+								<key>b</key>
+								<string>0</string>
+								<key>g</key>
+								<string>0</string>
+								<key>r</key>
+								<string>0</string>
+							</dict>
+							<key>Fuzziness</key>
+							<real>2.3972222805023193</real>
+							<key>ShadowVector</key>
+							<string>{0, 1}</string>
+						</dict>
+						<key>stroke</key>
+						<dict>
+							<key>Color</key>
+							<dict>
+								<key>b</key>
+								<string>0.93512</string>
+								<key>g</key>
+								<string>0.472602</string>
+								<key>r</key>
+								<string>0.333854</string>
+							</dict>
+							<key>CornerRadius</key>
+							<real>3</real>
+						</dict>
+					</dict>
+					<key>Text</key>
+					<dict>
+						<key>Text</key>
+						<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 Compute Renderscript (.rs)}</string>
+						<key>VerticalPad</key>
+						<integer>0</integer>
+					</dict>
+				</dict>
+				<dict>
+					<key>Bounds</key>
+					<string>{{314.5, 168.835}, {239.5, 175.33}}</string>
+					<key>Class</key>
+					<string>ShapedGraphic</string>
+					<key>FontInfo</key>
+					<dict>
+						<key>Color</key>
+						<dict>
+							<key>b</key>
+							<string>0</string>
+							<key>g</key>
+							<string>0</string>
+							<key>r</key>
+							<string>0</string>
+						</dict>
+						<key>Font</key>
+						<string>Helvetica-Bold</string>
+						<key>Size</key>
+						<real>10</real>
+					</dict>
+					<key>ID</key>
+					<integer>252</integer>
+					<key>Magnets</key>
+					<array>
+						<string>{1, 1}</string>
+						<string>{1, -1}</string>
+						<string>{-1, -1}</string>
+						<string>{-1, 1}</string>
+						<string>{0, 1}</string>
+						<string>{0, -1}</string>
+						<string>{1, 0}</string>
+						<string>{-1, 0}</string>
+						<string>{-0.5, -0.233518}</string>
+						<string>{-0.491442, 0.260063}</string>
+						<string>{0.507118, -0.224086}</string>
+						<string>{0.507118, 0.267179}</string>
+						<string>{-0.27431, -0.474028}</string>
+						<string>{0.27978, -0.478478}</string>
+						<string>{0.293938, 0.543044}</string>
+						<string>{-0.286232, 0.553804}</string>
+					</array>
+					<key>Shape</key>
+					<string>Rectangle</string>
+					<key>Style</key>
+					<dict>
+						<key>fill</key>
+						<dict>
+							<key>Color</key>
+							<dict>
+								<key>b</key>
+								<string>0.938075</string>
+								<key>g</key>
+								<string>0.938269</string>
+								<key>r</key>
+								<string>0.938154</string>
+							</dict>
+							<key>FillType</key>
+							<integer>2</integer>
+							<key>GradientAngle</key>
+							<real>90</real>
+							<key>GradientColor</key>
+							<dict>
+								<key>b</key>
+								<string>0.727869</string>
+								<key>g</key>
+								<string>0.728019</string>
+								<key>r</key>
+								<string>0.72793</string>
+							</dict>
+						</dict>
+						<key>shadow</key>
+						<dict>
+							<key>Color</key>
+							<dict>
+								<key>a</key>
+								<string>0.35</string>
+								<key>b</key>
+								<string>0</string>
+								<key>g</key>
+								<string>0</string>
+								<key>r</key>
+								<string>0</string>
+							</dict>
+							<key>Fuzziness</key>
+							<real>2.3972222805023193</real>
+							<key>ShadowVector</key>
+							<string>{0, 1}</string>
+						</dict>
+						<key>stroke</key>
+						<dict>
+							<key>Color</key>
+							<dict>
+								<key>b</key>
+								<string>0.472997</string>
+								<key>g</key>
+								<string>0.473094</string>
+								<key>r</key>
+								<string>0.473036</string>
+							</dict>
+							<key>CornerRadius</key>
+							<real>3</real>
+						</dict>
+					</dict>
+					<key>Text</key>
+					<dict>
+						<key>Text</key>
+						<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 \
+\
+\
+Renderscript Runtime\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+}</string>
+						<key>VerticalPad</key>
+						<integer>0</integer>
+					</dict>
+				</dict>
+			</array>
+			<key>ID</key>
+			<integer>248</integer>
+		</dict>
+	</array>
+	<key>GridInfo</key>
+	<dict/>
+	<key>GuidesLocked</key>
+	<string>NO</string>
+	<key>GuidesVisible</key>
+	<string>YES</string>
+	<key>HPages</key>
+	<integer>1</integer>
+	<key>ImageCounter</key>
+	<integer>1</integer>
+	<key>KeepToScale</key>
+	<false/>
+	<key>Layers</key>
+	<array>
+		<dict>
+			<key>Lock</key>
+			<string>NO</string>
+			<key>Name</key>
+			<string>Layer 1</string>
+			<key>Print</key>
+			<string>YES</string>
+			<key>View</key>
+			<string>YES</string>
+		</dict>
+	</array>
+	<key>LayoutInfo</key>
+	<dict>
+		<key>Animate</key>
+		<string>NO</string>
+		<key>circoMinDist</key>
+		<real>18</real>
+		<key>circoSeparation</key>
+		<real>0.0</real>
+		<key>layoutEngine</key>
+		<string>dot</string>
+		<key>neatoSeparation</key>
+		<real>0.0</real>
+		<key>twopiSeparation</key>
+		<real>0.0</real>
+	</dict>
+	<key>LinksVisible</key>
+	<string>NO</string>
+	<key>MagnetsVisible</key>
+	<string>NO</string>
+	<key>MasterSheets</key>
+	<array/>
+	<key>ModificationDate</key>
+	<string>2011-11-07 11:10:03 -0800</string>
+	<key>Modifier</key>
+	<string>Robert Ly</string>
+	<key>NotesVisible</key>
+	<string>NO</string>
+	<key>Orientation</key>
+	<integer>2</integer>
+	<key>OriginVisible</key>
+	<string>NO</string>
+	<key>PageBreaks</key>
+	<string>YES</string>
+	<key>PrintInfo</key>
+	<dict>
+		<key>NSBottomMargin</key>
+		<array>
+			<string>float</string>
+			<string>41</string>
+		</array>
+		<key>NSLeftMargin</key>
+		<array>
+			<string>float</string>
+			<string>18</string>
+		</array>
+		<key>NSPaperSize</key>
+		<array>
+			<string>coded</string>
+			<string>BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU1ZhbHVlAISECE5TT2JqZWN0AIWEASqEhAx7X05TU2l6ZT1mZn2WgWQCgRgDhg==</string>
+		</array>
+		<key>NSRightMargin</key>
+		<array>
+			<string>float</string>
+			<string>18</string>
+		</array>
+		<key>NSTopMargin</key>
+		<array>
+			<string>float</string>
+			<string>18</string>
+		</array>
+	</dict>
+	<key>PrintOnePage</key>
+	<false/>
+	<key>QuickLookPreview</key>
+	<data>
+	JVBERi0xLjMKJcTl8uXrp/Og0MTGCjUgMCBvYmoKPDwgL0xlbmd0aCA2IDAgUiAvRmls
+	dGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAHFWstyHbkN3fMruJQWbjff3cuJM5OK
+	V0mkqllksphcy2M7ku2RNHn8fQ5AAOy+0pWlTWKVSw00CJLA4SHI1q/+z/5XP+OntOpb
+	Sv72yv/oP/vXb+6CP9z5wD93B/9qnoqn/xvD9/71n65uD1df73/7+drdfoSrWAK7i7n4
+	NK9TmOPiU4nTsrboDzf+9R9vgv/9F+43zt24NJ9SmpYC29zyNOPJddv4lG1a0UGI6nfY
+	yiBSKD4GGkPDIEKbYlK/6dhvWJrPhcZAtjVNLdqAsxqHuvRgVV/jhGnBNpd5mktWx+WB
+	bRy2aalsK4Go3ZZSQKNDbGueQi3uxhdMQSR/DSlOtdTVVKVkPCOqMUDJAuZZiz+wlNYw
+	Lan4a0fv0jpPoS1wqG7SsvB76kWfDzIGla8hIx45mYlLIWOQ5k7F3he176+7/JR0EFel
+	9lFTX9TWpmRdawx28cEsP8hoR8QItfDC80mYe8yE1tDqtEH1gKtnuHb8vQo+pzzFAvTV
+	qTD0Lj4Ef/cBMD2xQIJ/i6XxqS+UNxdYGrmlOVV5WDM/xHVt7uINEmw9zbzMgO4+JUCK
+	U9FTrtIm5apCJl1olsmMqWngOclZQ9klw4YgJ2WGFjCAfPZnZymXd9uUi0qymMWdigq2
+	naz4kJHs3iFlXdZRa8ptSpZymTC80ZLQ6Y+Uq+bGXyA5ICqs/zssS5DUJszHCf3dpQ+R
+	F+8r/H6FtVNbawlP1V+Cln4I04wkXb73f/Vnfzknvov+7EofPp8jn1C8O3f7F7dqcacP
+	B32wVx+l8Vf5fe/5wY1+fpM32s29NrlRZxjJ3/zlW//9pWAyISdAbIl1qstClIGnoSDW
+	iG1aZ2KNboPfa7coEyCwDDmRC+IONnB5gSLlxD64SV7CtLYG0lGfeZm7jXRrMhLdR6Ya
+	h1TTWlzBJKoD3+/9miw9w4taiKbLY2zH761FiX066La7KFHma8PQoO1j2GllF1Z/w7th
+	SsvUwA6Yc6C4hBVTaaDy1ALvmA475re4pcwYVw3YVgG3iw/xFL04YrKH9IIdcgGZE8/E
+	OgPK05oKoHyKXXgeLs7gP1gZPFSxgYeqBB5xbthsSlR4RGzjcAG2UIMMRcWmTT44jdj1
+	pznGOuARsdWwjcDDZIWHM80GHqaTzJlflbVnS3YUjTu2OJZHiz4dDF5NdL4KDwuawEPj
+	wxTU4aGqZ3GQJp72lSMaagg101B+SEJvdOl/EXIwLvgqJKSscW801YnlaQLrRGZNbs9d
+	57qXE5g/++lsksEJ2bkzc/PT+QnKykBLQ2lmmFTFBpOicgIwKrKw1ojKOm9kLEi4MEzm
+	eaHFtaUspHWe86Asl+fSbZSyVFZMerPYYNJ0ApcsfhVx1rMhzDTWQsZ2LGsLBzLm6Rgm
+	bb6KSZSZPWhKriJuMKkh21MW5hgoLg8oi4r8b1FWjhj5sgSpiNIpymKSfEhZaI4zAPBW
+	lhoicRdKVHDXyYpIFhc2m7hs8BFFscGHqBQfccF+Dp3iIy4o5+DC8JFiRh2IGt84K2FX
+	WNcyOMsl7G1sI/gw2fBhmg0+TCfZVb+KD+tZs+1NYy1kbMeytnA6HcOHzdfwoTFSzpKQ
+	bfChIXsWZ2nmabM64iycYbAH0nboXlQ4PeAdqbGEMNzZswsnf/YUN1I/7uw0N36vRdYv
+	Ql1aa6l+V2rNjk7H2GRf/wEn4l/utjWmlfJSbNr2daPniYgDXexbZbdxsWLzBDKvzQRl
+	fFdIOcvnbuqUS1p0G6lbrWcLigjmTqQAxZzLOEKRgvxh2SArpvjwsNF7OH2L/58em4bT
+	abQ+RJoF9eGjDVH6GArrI1ojTMPRoQlMjfJ0Jf5ZaTHHmoZ4DTHLmVZNIkpxVIk41NaM
+	1yREbozSg8RUyCO1pOfWz6bmJhUc3fAu4R09oQ2ZdwGNun1xasfvzAlLZE9dmfD4I5vk
+	Ff+cjpBHNbFuM4XuHTuQzXA1GwkLrU8aJzxZoKj+Qy2FgcohNqKOrRREvZw5ydsh8xkg
+	N5zcU27C2/mlvP3CkywHOgAroHvNtImbTJsOGXQBkwoNB2ZKZ8ABgRtLpltCDiTTmEug
+	u4+RaTqkQ0Sm+3FdMs3qken+FnaUzuGEJXKvmea+xAp6rNC9Sc+qjZBGJVkcU9BMjxlK
+	pjFNCYtm2pvmaSI+SiWI2IGIcdc0o/i/POxOswB8bTjQvcIGt+fks+8+v7v98vGd/+H2
+	55urf325/ce5v/zk7BRZ+NqjADa4JcEaxUGHzpBdxlSRpH6E7JqIsz2/z9O6UE5YdiUn
+	ao+I9vcJJ0U0VgFHAbpGMmd0apKe6BGbNI8Czzgr4uBAR0XKGbZz7i418aBipjbyCsvr
+	kaeDIy2lDs55cPA8NDJ86Qsu+vRoHNKGA9JHRhpMkTXHFscyZbnPxmJKyxnlKzbMhOsb
+	3Gjg8Nivpdyz13OhChKQ5ZNjeXQ5q7OHZdgLT448fBewzdc2ICHyBhKikSwHXCnOgbLc
+	sx4WcFYzSIB21w0kKi4PeE0rvlKNBgk8GiTwvIUERM62S+pBkg/vBgk8D+146u85vTK4
+	AQlMV4ZvkJDpWYJFHpDwj1sAKQIia6GQEMXz1n1P+SNnRtxo15YWXF1hovvVjqur7/TU
+	aNWU3CW5s3/qKy147v+zPaH1kuMblU5EHd2wiQbsWXNmeCRiBFUAH7h7PlKkKReAXm0i
+	tjq2aDj0pOBMLuwTLNINIr4JoB5n3KgGF49xbbDA4S7jbBGx97ANblrh1JlMXvrdxN7i
+	uMWQqdrmZao+6OIqRVq4qgEWqUh7ooZCCxRoETwcUY5luqjBTS+85AJ2i+ggLgv2dtHA
+	84Lqj4Jj7VCpxIBOaTx5WuY5wQrfDTI1w6LElbIqcMbA7oIgQrFptcI4UmzMt2pG/9pO
+	Rkl3weYcg6u4fd30PzTHsztwRJR0NhewXBwTfGUji7Q9M2RUsRQ6oCOmqsB3Cnxv2Cpw
+	7cwKqimfinqg62qOOurHhvAh6gGfcxJtlhFlZCn41hRwZxfWdQHiTIMQcfy0HTZWXCnh
+	ew7ityL8K/a1jaZObcVXqoADO7WDJ9yxVoyR2nXvDLxAfLcZAWqdrrFxbtrFaWV0rOa9
+	a7YjsHYyvx53qrOxqQAtmB8olQkbBIElqgqsSFyIZr4HFpu+iNEElyqoYWBAi9rnFbsM
+	XGDpiAIFd14r1oEpqJgBWs1lRukBEyioU9xSdPEgo1L52uPYM9O27lRVsfqpgXhUkXvE
+	EPbyExKQK29l+OiLXdv0tGuL0T5itGWzxkLWb1DgBSyVC10ToEIt+NRX6S4FQHr2vo1D
+	0dzwQa9v3PXRjVu96RriT6/8RanFsqKqQ5awHDEGun3Gx8wwn7pA6RMj5qFbapRzPSuq
+	2EBBVT2xICYseVzSaKIjmIdcGBQiVcm8WAUKkSrqygws6JIFDgpmKOh6VyioPKCAM1mn
+	hJ4v86gi92jp1RHs3kqq9Z1CQYevUNDpOYOCzn8fMYMCs3ePoZzKH/3IZDX6SPPRZQnK
+	lBlWwNHDrfp/9ZXJKgG9SNaLjnFv/G8tDe63FcFgl0y7U2n4yqQLvSvA1YMKRKVcAUjt
+	2AV7z5ZdXALd0YdaY5cEvq30ndpcJrAyf8vtkFJRISUy+MnyqiYdJeZRxd6jwkRHsHvr
+	dtJgIhm+Qirr9KxriZEyn0RsQErfb9klYSOiD/XMLli1MWK/OsEuzj4hK+wCVh5ooZNL
+	ewm54CPmSXI59UVJlgqqqi25YAfsig0SVCVIwCa8I5c083FukAtXHmDJgQQcQxP9acNA
+	Al+BUCXG5EI3pXwgkmirPJDA169kIulUjyqikOI/l9jLT0hGRDp8RYJNz5Cg899HzJBg
+	IXveQWBk+YhbsNemXPEnKf/Hi1illL/LXeon+S2flzaXuntm+S+c9lyDCmVuZHN0cmVh
+	bQplbmRvYmoKNiAwIG9iagoyOTIyCmVuZG9iagozIDAgb2JqCjw8IC9UeXBlIC9QYWdl
+	IC9QYXJlbnQgNCAwIFIgL1Jlc291cmNlcyA3IDAgUiAvQ29udGVudHMgNSAwIFIgL01l
+	ZGlhQm94IFswIDAgNTc2IDczM10KPj4KZW5kb2JqCjcgMCBvYmoKPDwgL1Byb2NTZXQg
+	WyAvUERGIC9UZXh0IC9JbWFnZUIgL0ltYWdlQyAvSW1hZ2VJIF0gL0NvbG9yU3BhY2Ug
+	PDwgL0NzMiAyMiAwIFIKL0NzMSA4IDAgUiA+PiAvRXh0R1N0YXRlIDw8IC9HczIgMzAg
+	MCBSIC9HczEgMzEgMCBSID4+IC9Gb250IDw8IC9GMS4wIDIzIDAgUgo+PiAvWE9iamVj
+	dCA8PCAvSW0xIDkgMCBSIC9JbTQgMTUgMCBSIC9JbTUgMTcgMCBSIC9JbTMgMTMgMCBS
+	IC9JbTIgMTEgMCBSCi9JbTYgMTkgMCBSID4+IC9TaGFkaW5nIDw8IC9TaDUgMjcgMCBS
+	IC9TaDYgMjggMCBSIC9TaDQgMjYgMCBSIC9TaDMgMjUgMCBSCi9TaDcgMjkgMCBSIC9T
+	aDIgMjQgMCBSIC9TaDEgMjEgMCBSID4+ID4+CmVuZG9iagoyNyAwIG9iago8PCAvQ29s
+	b3JTcGFjZSAzMiAwIFIgL1NoYWRpbmdUeXBlIDIgL0Nvb3JkcyBbIDk1LjUgLTg4LjE2
+	NSA5NS40OTk5OCA4OC4xNjUwNApdIC9Eb21haW4gWyAwIDEgXSAvRXh0ZW5kIFsgZmFs
+	c2UgZmFsc2UgXSAvRnVuY3Rpb24gMzMgMCBSID4+CmVuZG9iagoyOCAwIG9iago8PCAv
+	Q29sb3JTcGFjZSAzMiAwIFIgL1NoYWRpbmdUeXBlIDIgL0Nvb3JkcyBbIDc5IC0yMy4w
+	ODA1MSA3OSAyMy4wODA1NCBdCi9Eb21haW4gWyAwIDEgXSAvRXh0ZW5kIFsgZmFsc2Ug
+	ZmFsc2UgXSAvRnVuY3Rpb24gMzQgMCBSID4+CmVuZG9iagoyNiAwIG9iago8PCAvQ29s
+	b3JTcGFjZSAzMiAwIFIgL1NoYWRpbmdUeXBlIDIgL0Nvb3JkcyBbIDEyMC4yNSAtMTE5
+	LjgzNDcgMTIwLjI1IDExOS44MzQ4Cl0gL0RvbWFpbiBbIDAgMSBdIC9FeHRlbmQgWyBm
+	YWxzZSBmYWxzZSBdIC9GdW5jdGlvbiAzNSAwIFIgPj4KZW5kb2JqCjI1IDAgb2JqCjw8
+	IC9Db2xvclNwYWNlIDMyIDAgUiAvU2hhZGluZ1R5cGUgMiAvQ29vcmRzIFsgOTUuNSAt
+	MjMuNTI2ODUgOTUuNDk5OTggMjMuNTI2ODkKXSAvRG9tYWluIFsgMCAxIF0gL0V4dGVu
+	ZCBbIGZhbHNlIGZhbHNlIF0gL0Z1bmN0aW9uIDM2IDAgUiA+PgplbmRvYmoKMjkgMCBv
+	YmoKPDwgL0NvbG9yU3BhY2UgMzIgMCBSIC9TaGFkaW5nVHlwZSAyIC9Db29yZHMgWyA3
+	OSAtMjAuNjYxMDEgNzkgMjAuNjYxMDQgXQovRG9tYWluIFsgMCAxIF0gL0V4dGVuZCBb
+	IGZhbHNlIGZhbHNlIF0gL0Z1bmN0aW9uIDM3IDAgUiA+PgplbmRvYmoKMjQgMCBvYmoK
+	PDwgL0NvbG9yU3BhY2UgMzIgMCBSIC9TaGFkaW5nVHlwZSAyIC9Db29yZHMgWyA5NS41
+	IC0yMy41MjY4NSA5NS40OTk5OCAyMy41MjY4OQpdIC9Eb21haW4gWyAwIDEgXSAvRXh0
+	ZW5kIFsgZmFsc2UgZmFsc2UgXSAvRnVuY3Rpb24gMzggMCBSID4+CmVuZG9iagoyMSAw
+	IG9iago8PCAvQ29sb3JTcGFjZSAzMiAwIFIgL1NoYWRpbmdUeXBlIDIgL0Nvb3JkcyBb
+	IDEyMC4yNSAtODguMTY1IDEyMC4yNSA4OC4xNjUwNQpdIC9Eb21haW4gWyAwIDEgXSAv
+	RXh0ZW5kIFsgZmFsc2UgZmFsc2UgXSAvRnVuY3Rpb24gMzkgMCBSID4+CmVuZG9iago5
+	IDAgb2JqCjw8IC9MZW5ndGggMTAgMCBSIC9UeXBlIC9YT2JqZWN0IC9TdWJ0eXBlIC9J
+	bWFnZSAvV2lkdGggNTAyIC9IZWlnaHQgNDkwIC9JbnRlcnBvbGF0ZQp0cnVlIC9Db2xv
+	clNwYWNlIDQwIDAgUiAvSW50ZW50IC9QZXJjZXB0dWFsIC9TTWFzayA0MSAwIFIgL0Jp
+	dHNQZXJDb21wb25lbnQKOCAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAHt
+	0DEBAAAAwqD1T20Hb4hAYcCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAgX9gQzkAAQplbmRzdHJlYW0KZW5kb2JqCjEwIDAgb2Jq
+	CjMyNDEKZW5kb2JqCjE1IDAgb2JqCjw8IC9MZW5ndGggMTYgMCBSIC9UeXBlIC9YT2Jq
+	ZWN0IC9TdWJ0eXBlIC9JbWFnZSAvV2lkdGggNDAyIC9IZWlnaHQgMzc0IC9JbnRlcnBv
+	bGF0ZQp0cnVlIC9Db2xvclNwYWNlIDQwIDAgUiAvSW50ZW50IC9QZXJjZXB0dWFsIC9T
+	TWFzayA0MyAwIFIgL0JpdHNQZXJDb21wb25lbnQKOCAvRmlsdGVyIC9GbGF0ZURlY29k
+	ZSA+PgpzdHJlYW0KeAHt0DEBAAAAwqD1T20Hb4hAYcCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAgX9g4j4AAQplbmRzdHJlYW0KZW5kb2JqCjE2IDAgb2JqCjE5OTAKZW5kb2Jq
+	CjE3IDAgb2JqCjw8IC9MZW5ndGggMTggMCBSIC9UeXBlIC9YT2JqZWN0IC9TdWJ0eXBl
+	IC9JbWFnZSAvV2lkdGggMzM2IC9IZWlnaHQgMTEyIC9JbnRlcnBvbGF0ZQp0cnVlIC9D
+	b2xvclNwYWNlIDQwIDAgUiAvSW50ZW50IC9QZXJjZXB0dWFsIC9TTWFzayA0NSAwIFIg
+	L0JpdHNQZXJDb21wb25lbnQKOCAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0K
+	eAHt0DEBAAAAwqD1T20ND4hAYcCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQOP
+	AwO5DwABCmVuZHN0cmVhbQplbmRvYmoKMTggMCBvYmoKNTE2CmVuZG9iagoxMyAwIG9i
+	ago8PCAvTGVuZ3RoIDE0IDAgUiAvVHlwZSAvWE9iamVjdCAvU3VidHlwZSAvSW1hZ2Ug
+	L1dpZHRoIDUwMiAvSGVpZ2h0IDYzMCAvSW50ZXJwb2xhdGUKdHJ1ZSAvQ29sb3JTcGFj
+	ZSA0MCAwIFIgL0ludGVudCAvUGVyY2VwdHVhbCAvU01hc2sgNDcgMCBSIC9CaXRzUGVy
+	Q29tcG9uZW50CjggL0ZpbHRlciAvRmxhdGVEZWNvZGUgPj4Kc3RyZWFtCngB7dAxAQAA
+	AMKg9U9tCy+IQGHAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAED74EBev4AAQplbmRzdHJlYW0KZW5kb2JqCjE0IDAgb2JqCjQx
+	NjEKZW5kb2JqCjExIDAgb2JqCjw8IC9MZW5ndGggMTIgMCBSIC9UeXBlIC9YT2JqZWN0
+	IC9TdWJ0eXBlIC9JbWFnZSAvV2lkdGggNDAyIC9IZWlnaHQgMTE0IC9JbnRlcnBvbGF0
+	ZQp0cnVlIC9Db2xvclNwYWNlIDQwIDAgUiAvSW50ZW50IC9QZXJjZXB0dWFsIC9TTWFz
+	ayA0OSAwIFIgL0JpdHNQZXJDb21wb25lbnQKOCAvRmlsdGVyIC9GbGF0ZURlY29kZSA+
+	PgpzdHJlYW0KeAHt0AENAAAAwqD3T20PBxEoDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgw8D8wGSoAAQplbmRzdHJlYW0KZW5kb2JqCjEyIDAgb2JqCjYyMgpl
+	bmRvYmoKMTkgMCBvYmoKPDwgL0xlbmd0aCAyMCAwIFIgL1R5cGUgL1hPYmplY3QgL1N1
+	YnR5cGUgL0ltYWdlIC9XaWR0aCAzMzYgL0hlaWdodCAxMDQgL0ludGVycG9sYXRlCnRy
+	dWUgL0NvbG9yU3BhY2UgNDAgMCBSIC9JbnRlbnQgL1BlcmNlcHR1YWwgL1NNYXNrIDUx
+	IDAgUiAvQml0c1BlckNvbXBvbmVudAo4IC9GaWx0ZXIgL0ZsYXRlRGVjb2RlID4+CnN0
+	cmVhbQp4Ae3QMQEAAADCoPVPbQlPiEBhwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg
+	wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM
+	GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB
+	AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg
+	wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM
+	GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB
+	AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg
+	wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM
+	GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB
+	AwYMGDBgwIABAwYMGDBgwIABAwb+AwOZjwABCmVuZHN0cmVhbQplbmRvYmoKMjAgMCBv
+	YmoKNDgxCmVuZG9iago0MSAwIG9iago8PCAvTGVuZ3RoIDQyIDAgUiAvVHlwZSAvWE9i
+	amVjdCAvU3VidHlwZSAvSW1hZ2UgL1dpZHRoIDUwMiAvSGVpZ2h0IDQ5MCAvQ29sb3JT
+	cGFjZQovRGV2aWNlR3JheSAvSW50ZXJwb2xhdGUgdHJ1ZSAvQml0c1BlckNvbXBvbmVu
+	dCA4IC9GaWx0ZXIgL0ZsYXRlRGVjb2RlID4+CnN0cmVhbQp4Ae3YWVeTZx9GcTKTEGYZ
+	DVpBi1WDVZGiAhWlMs+Q0O//Rd7Qd7Wrwauetmu776P2f3btHw/aDgz4LGABC1jAAhaw
+	gAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtY
+	wAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUs
+	YAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIW
+	sIAFLGABC/xHCxR8uALf/lErFEvlcsUHK1AulYqFf5IvlMrVwcbQUNOHKjDUqNcq5exe
+	KJZrjeGxyXtT0z5SgampexOjzXqlFD73Hvrg8MRM6+GjpaXHPlCBpcVHD+anxoaqgb1Y
+	ro9OLzx+9vL1m9XVtz5MgdXVN6/aTxfnJ5u1r9gL5cGRmUfPXr/b/Lj9yYcqsP3rxtrL
+	Hxcmh6rFO3+lK1abUz+8WNva2Ts4PPKRChweHux++vB6+f54vdz/R3uhVB9v/fT2193j
+	s4uLSx+pwMXF+enhzoefl2aG73zshcrQ1OKrzd2Ty+tOp+sjFeh0Olfnh5/Xn7fG66W+
+	X/HF6sjs8tqno4tO9+bm5ncfqEAPtHt9trf186N7jf5f8cXa6P3n77+cXN2iqw4y703p
+	iXYuDrdXH083K31/sJcGx1vtjd2za8lZ4rdrbj/2y+PPaz/2/mDvV69PLKxs7ffUeaNd
+	9PtN9+p4Z3159mv1By+39s9VZ/6MdK9Ofnv3dG7kq2/9/+rM0d/9qm+rd777PswAf6n3
+	/d+5Un3ij29dddWZBb7HVX7rqv/5P+j8Dc/+WfBbZ/vmdarnLuyr6mzfvE713IV9VZ3t
+	m9epnruwr6qzffM61XMX9lV1tm9ep3ruwr6qzvbN61TPXdhX1dm+eZ3quQv7qjrbN69T
+	PXdhX1Vn++Z1qucu7KvqbN+8TvXchX1Vne2b16meu7CvqrN98zrVcxf2VXW2b16neu7C
+	vqrO9s3rVM9d2FfV2b55neq5C/uqOts3r1M9d2FfVWf75nWq5y7sq+ps37xO9dyFfVWd
+	7ZvXqZ67sK+qs33zOtVzF/ZVdbZvXqd67sK+qs72zetUz13YV9XZvnmd6rkL+6o62zev
+	Uz13YV9VZ/vmdarnLuyr6mzfvE713IV9VZ3tm9epnruwr6qzffM61XMX9lV1tm9ep3ru
+	wr6qzvbN61TPXdhX1dm+eZ3quQv7qjrbN69TPXdhX1Vn++Z1qucu7KvqbN+8TvXchX1V
+	ne2b16meu7CvqrN98zrVcxf2VXW2b16neu7CvqrO9s3rVM9d2FfV2b55neq5C/uqOts3
+	r1M9d2FfVWf75nWq5y7sq+ps37xO9dyFfVWd7ZvXqZ67sK+qs33zOtVzF/ZVdbZvXqd6
+	7sK+qs72zetUz13YV9XZvnmd6rkL+6o62zevUz13YV9VZ/vmdarnLuyr6mzfvE713IV9
+	VZ3tm9epnruwr6qzffM61XMX9lV1tm9ep3ruwr6qzvbN61TPXdhX1dm+eZ3quQv7qjrb
+	N69TPXdhX1Vn++Z1qucu7KvqbN+8TvXchX1Vne2b16meu7CvqrN98zrVcxf2VXW2b16n
+	eu7CvqrO9s3rVM9d2FfV2b55neq5C/uqOts3r1M9d2FfVWf75nWq5y7sq+ps37xO9dyF
+	fVWd7ZvXqZ67sK+qs33zOtVzF/ZVdbZvXqd67sK+qs72zetUz13YV9XZvnmd6rkL+6o6
+	2zevUz13YV9VZ/vmdarnLuyr6mzfvE713IV9VZ3tm9epnruwr6qzffM61XMX9lV1tm9e
+	p3ruwr6qzvbN61TPXdhX1dm+eZ3quQv7qjrbN69TPXdhX1Vn++Z1qucu7KvqbN+8TvXc
+	hX1Vne2b16meu7CvqrN98zrVcxf2VXW2b16neu7CvqrO9s3rVM9d2FfV2b55neq5C/uq
+	Ots3r1M9d2FfVWf75nWq5y7sq+ps37xO9dyFfVWd7ZvXqZ67sK+qs33zOtVzF/ZVdbZv
+	Xqd67sK+qs72zetUz13YV9XZvnmd6rkL+6o62zevUz13YV9VZ/vmdarnLuyr6mzfvE71
+	3IV9VZ3tm9epnruwr6qzffM61XMX9lV1tm9ep3ruwr6qzvbN61TPXdhX1dm+eZ3quQv7
+	qjrbN69TPXdhX1Vn++Z1qucu7KvqbN+8TvXchX1Vne2b16meu7CvqrN98zrVcxf2VXW2
+	b16neu7CvqrO9s3rVM9d2FfV2b55neq5C/uqOts3r1M9d2FfVWf75nWq5y7sq+ps37xO
+	9dyFfVWd7ZvXqZ67sK+qs33zOtVzF/ZVdbZvXqd67sK+qs72zetUz13YV9XZvnmd6rkL
+	+6o62zevUz13YV9VZ/vmdarnLuyr6mzfvE713IV9VZ3tm9epnruwr6qzffM61XMX9lV1
+	tm9ep3ruwr6qzvbN61TPXdhX1dm+eZ3quQv7qjrbN69TPXdhX1Vn++Z1qucu7KvqbN+8
+	TvXchX1Vne2b16meu7CvqrN98zrVcxf2VXW2b16neu7CvqrO9s3rVM9d2FfV2b55neq5
+	C/uqOts3r1M9d2FfVWf75nWq5y7sq+ps37xO9dyFfVWd7ZvXqZ67sK+qs33zOtVzF/ZV
+	dbZvXqd67sK+qs72zetUz13YV9XZvnmd6rkL+6o62zevUz13YV9VZ/vmdarnLuyr6mzf
+	vE713IV9VZ3tm9epnruwr6qzffM61XMX9lV1tm9ep3ruwr6qzvbN61TPXdhX1dm+eZ3q
+	uQv7qjrbN69TPXdhX1Vn++Z1qucu7KvqbN+8TvXchX1Vne2b16meu7CvqrN98zrVcxf2
+	VXW2b16neu7CvqrO9s3rVM9d2FfV2b55neq5C/uqOts3r1M9d2FfVWf75nWq5y7sq+ps
+	37xO9dyFfVWd7ZvXqZ67sK/fVr++Ya//Xtf9pV4Y+Nsr1ScerGztn6vO/Lm4VV9fnhup
+	3lEfX1jZ3Du7vrnxa+fB33Qvj3d+WZ4dvqM+ON56sbF7et2VHYjeUz/6vPZkZrjS960X
+	a6PzP7377fhKdSR65+Lg45ulqaE76tXhmSer2wfn113dWe69X97dztXJl42VhxONct+3
+	Xig3Jh+23+8cnV9e376OD1LgVvPq8nT/49un86O10t/+Bt/7x1JtZO7J642dg+PTs947
+	90EK9DBPT452t9fbP9wbqhT71YuVxkRr+dX7jztfdvf29n2YAnt7u18+b621l2ZHBkt9
+	v+AHBgqlanOy9aS9uv5hY3Nzy4cpsLm58X7t1bPFubH63U/9lr3WnJh7+Pjp8xft9ooP
+	U6DdfvFsebE1PdqoFO986r1f972vvTEyOT13v7XgIxVoteZnp8abvS/9a/Rb9kqt0RwZ
+	G/exCoyNjjTr1XJE77EXS+VqrTZY95EKDA7WqpV/Mv/j7/SFQrFY8rEKFIvFQvrl3v9f
+	cf6bBSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGAB
+	C1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCA
+	BSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jA
+	AhawgAUsYAELWMACFrCABSxggX+lwP8AyqUofgplbmRzdHJlYW0KZW5kb2JqCjQyIDAg
+	b2JqCjI3OTgKZW5kb2JqCjQzIDAgb2JqCjw8IC9MZW5ndGggNDQgMCBSIC9UeXBlIC9Y
+	T2JqZWN0IC9TdWJ0eXBlIC9JbWFnZSAvV2lkdGggNDAyIC9IZWlnaHQgMzc0IC9Db2xv
+	clNwYWNlCi9EZXZpY2VHcmF5IC9JbnRlcnBvbGF0ZSB0cnVlIC9CaXRzUGVyQ29tcG9u
+	ZW50IDggL0ZpbHRlciAvRmxhdGVEZWNvZGUgPj4Kc3RyZWFtCngB7ZdZW5NXAAbJHgiL
+	LIJsClKRugRL61aWShURUBAhBP//H2nwqRa0zlX93ovOueHihQzPDOdL6OvzaEADGtCA
+	BjSgAQ0UY6BULlc8hRool0ul78UtlSu1eqPZ7ynSQLNRq1b+vUmpUmu2hkZGxzwFGhi9
+	Njw40KiW/6VJuVJvjYxPzczN3/QUZ2B+dnpybKi/9u01KVUag+MzC3fuPWi3Vz1FGWg/
+	vL+yND91baD29S0pVeqDE/PL7cfPNza3PMUZ2Fx/unZ/aWa0l+Tq+3u51hqfX1lb397Z
+	fbPnKc7Am9evtp62f5oeaX713Ko0R6aX1zZ3Dg6P3h97ijPw/ujd3p/PHy5eH7x6SUrV
+	1vhCe33n7fFpp3PmKc5Ap3NytL/9ZGWmd0kuP7bK9aGpO4+394873e75+flHTzEGeq67
+	Z6dHuxvtW+MD1cufgMuNkZl7z3cOTy96WKSYHJ8oF0k+7L/4dan32LpcpNIcnXuwsXvU
+	8YYUWONzkpO3L5/cmRq6WqR/dL69+eZ9xwtSdJGP592Td6+e3r0xVL9yR/rHbra39o57
+	RQr/jf73wO7p4c6zu9PD3xRZtUjmj+OiyPOV7xQ5y/xO/2/qlyKX/2uv9J5aF3fEIoE/
+	DosEpCPSIqgnMFokIB2RFkE9gdEiAemItAjqCYwWCUhHpEVQT2C0SEA6Ii2CegKjRQLS
+	EWkR1BMYLRKQjkiLoJ7AaJGAdERaBPUERosEpCPSIqgnMFokIB2RFkE9gdEiAemItAjq
+	CYwWCUhHpEVQT2C0SEA6Ii2CegKjRQLSEWkR1BMYLRKQjkiLoJ7AaJGAdERaBPUERosE
+	pCPSIqgnMFokIB2RFkE9gdEiAemItAjqCYwWCUhHpEVQT2C0SEA6Ii2CegKjRQLSEWkR
+	1BMYLRKQjkiLoJ7AaJGAdERaBPUERosEpCPSIqgnMFokIB2RFkE9gdEiAemItAjqCYwW
+	CUhHpEVQT2C0SEA6Ii2CegKjRQLSEWkR1BMYLRKQjkiLoJ7AaJGAdERaBPUERosEpCPS
+	IqgnMFokIB2RFkE9gdEiAemItAjqCYwWCUhHpEVQT2C0SEA6Ii2CegKjRQLSEWkR1BMY
+	LRKQjkiLoJ7AaJGAdERaBPUERosEpCPSIqgnMFokIB2RFkE9gdEiAemItAjqCYwWCUhH
+	pEVQT2C0SEA6Ii2CegKjRQLSEWkR1BMYLRKQjkiLoJ7AaJGAdERaBPUERosEpCPSIqgn
+	MFokIB2RFkE9gdEiAemItAjqCYwWCUhHpEVQT2C0SEA6Ii2CegKjRQLSEWkR1BMYLRKQ
+	jkiLoJ7AaJGAdERaBPUERosEpCPSIqgnMFokIB2RFkE9gdEiAemItAjqCYwWCUhHpEVQ
+	T2C0SEA6Ii2CegKjRQLSEWkR1BMYLRKQjkiLoJ7AaJGAdERaBPUERosEpCPSIqgnMFok
+	IB2RFkE9gdEiAemItAjqCYwWCUhHpEVQT2C0SEA6Ii2CegKjRQLSEWkR1BMYLRKQjkiL
+	oJ7AaJGAdERaBPUERosEpCPSIqgnMFokIB2RFkE9gdEiAemItAjqCYwWCUhHpEVQT2C0
+	SEA6Ii2CegKjRQLSEWkR1BMYLRKQjkiLoJ7AaJGAdERaBPUERosEpCPSIqgnMFokIB2R
+	FkE9gdEiAemItAjqCYwWCUhHpEVQT2C0SEA6Ii2CegKjRQLSEWkR1BMYLRKQjkiLoJ7A
+	aJGAdERaBPUERosEpCPSIqgnMFokIB2RFkE9gdEiAemItAjqCYwWCUhHpEVQT2C0SEA6
+	Ii2CegKjRQLSEWkR1BMYLRKQjkiLoJ7AaJGAdERaBPUERosEpCPSIqgnMFokIB2RFkE9
+	gdEiAemItAjqCYwWCUhHpEVQT2C0SEA6Ii2CegKjRQLSEWkR1BMYLRKQjkiLoJ7AaJGA
+	dERaBPUERosEpCPSIqgnMFokIB2RFkE9gdEiAemItAjqCYwWCUhHpEVQT2C0SEA6Ii2C
+	egKjRQLSEWkR1BMYLRKQjkiLoJ7AaJGAdERaBPUERosEpCPSIqgnMFokIB2RFkE9gdEi
+	AemItAjqCYwWCUhHpEVQT2C0SEA6Ii2CegKjRQLSEWkR1BMYLRKQjkiLoJ7AaJGAdERa
+	BPUERosEpCPSIqgnMFokIB2RFkE9gdEiAemItAjqCYwWCUhHpEVQT2C0SEA6Ii2CegKj
+	RQLSEWkR1BMYLRKQjkiLoJ7AaJGAdERaBPUERosEpCPSIqgnMFokIB2RFkE9gdEiAemI
+	tAjqCYwWCUhHpEVQT2C0SEA6Ii2CegKjRQLSEWkR1BMYLRKQjkiLoJ7AaJGAdERaBPUE
+	RosEpCPSIqgnMFokIB2RFkE9gdEiAemItAjqCYwWCUhHpEVQT2C0SEA6Ii2CegKjRQLS
+	EWkR1BMYLRKQjkiLoJ7AaJGAdERaBPUERosEpCPSIqgnMFokIB2RFkE9gdEiAemItAjq
+	CYwWCUhHpEVQT2C0SEA6Ii2CegKjRQLSEWkR1BMYLRKQjkiLoJ7AaJGAdERaBPUERosE
+	pCPSIqgnMFokIB2RFkE9gdEiAemItAjqCYwWCUhHpEVQT2C0SEA6Ii2CegKjRQLSEWkR
+	1BMYLRKQjkiLoJ7AaJGAdERaBPUERosEpCPSIqgnMFokIB2RFkE9gdEiAemItAjqCYwW
+	CUhHpEVQT2C0SEA6IrFIB3/U8YcY+FKk1PfPqfSP3Vzd2jvunP8Qpi9KBr5XZL69ufe+
+	c35uE7L3A7bz7um7V8/u3hiqX7kjzdG5hxu7Rxb5AcrxJXtXoHvy7uWT5amh2uUi5cbI
+	7L3fXx+ednvf4S1Bh//t2NN99uFg+7efJgevFqkP31h+8ufBh7OLJP8t01cDA70b0u0c
+	vdl8tDA+UL18R0q11sTio43XhyedM0+hBjqnxwcvn96bu9as/PNJq6+vVOm/Nrvy2x+7
+	b4+OP3iKNHB8uP9qfXVpcqhevlykr1wfnLh1//Hmy939/QNPcQb2915v//7L8uxo/5WH
+	1sUlaQxPLvy89mzjjxfbnuIMvNhaf9xenhtv1a5ekb6+crU5fH1u6eeHj9Z+9RRn4JfV
+	B3cXZ8Za9crl9/WL51epl2RwdHL25sLi7SVPQQZu3168NTc9MTLwbZBPSeoDQyNj4xPX
+	PYUZmJgYHx1uNWvf3JBP7/K9a1Jv9A+0PEUaGOhv1Crlrx9Znz92lcqVSrVarXkKMtCT
+	Xe3l+F6Pv7uUPEUa+Hwb/KoBDWhAAxrQgAY0UICBvwALpbhFCmVuZHN0cmVhbQplbmRv
+	YmoKNDQgMCBvYmoKMjQ0NwplbmRvYmoKNDUgMCBvYmoKPDwgL0xlbmd0aCA0NiAwIFIg
+	L1R5cGUgL1hPYmplY3QgL1N1YnR5cGUgL0ltYWdlIC9XaWR0aCAzMzYgL0hlaWdodCAx
+	MTIgL0NvbG9yU3BhY2UKL0RldmljZUdyYXkgL0ludGVycG9sYXRlIHRydWUgL0JpdHNQ
+	ZXJDb21wb25lbnQgOCAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAHt3V1T
+	GgcYBWB2F1i+PxMVAtHGIFRlMzH1AwVHGxC1ClJAzP//I91l2gyLcLonN51pznulHg4X
+	z7w7yo1vKKSRgAQkIAEJSOD/LWCYpqUhBEzTMNathGFakagdi2uCC8TsSNhaLWpYkVgy
+	nc0XNIEF8rlMKmGHzRWiphVNZoub5Ur1vSaoQPVdaaOQjkder6hh2alieae2f+g4nzTB
+	BJzmQWO3uplLRJY31LCiqTfVPee41e5caoIKdC5Ojw52y3kX1P9byYwki9XG0cV1r397
+	pwkqcHvTvTx1PpaysaUn3oplS3tHnd4fg+HTSBNU4Gn4ePd7q/nL25R/QY1wsrjjXPQe
+	RpPp9FkTVGA6HQ/vr08aZXdBFx94M5rerB1f34+ms9nLy8s3TRABV2r2PBn22852MRFe
+	/JvJtLPl/VZvMPE05RkEc/4aD/TP+6svu+4Dv+hpxfKVw3Z/ONV2Brb8B3T88PWktpn2
+	e8bzVadz+zTVcnKe315m48fuaX0rHfXtZ7zw3rm8G7me5Pv99C+fTQa9s3op88rzkzx/
+	ZDk8z1Zjjefzj7zjz9357rn4Cclyn3dvP+VJL4c8aTJYkCfkoUN50mSwIE/IQ4fypMlg
+	QZ6Qhw7lSZPBgjwhDx3KkyaDBXlCHjqUJ00GC/KEPHQoT5oMFuQJeehQnjQZLMgT8tCh
+	PGkyWJAn5KFDedJksCBPyEOH8qTJYEGekIcO5UmTwYI8IQ8dypMmgwV5Qh46lCdNBgvy
+	hDx0KE+aDBbkCXnoUJ40GSzIE/LQoTxpMliQJ+ShQ3nSZLAgT8hDh/KkyWBBnpCHDuVJ
+	k8GCPCEPHcqTJoMFeUIeOpQnTQYL8oQ8dChPmgwW5Al56FCeNBksyBPy0KE8aTJYkCfk
+	oUN50mSwIE/IQ4fypMlgQZ6Qhw7lSZPBgjwhDx3KkyaDBXlCHjqUJ00GC/KEPHQoT5oM
+	FuQJeehQnjQZLMgT8tChPGkyWJAn5KFDedJksCBPyEOH8qTJYAF6TvXv/CHeivC75+r7
+	CCsa+hES8DzP6lvL9xF0vwOhrc/W3O/QfZn1ZChxD/asui/j3T/6tdV7nN8/Qn1lPgHv
+	/tFofv8o6bvXM7/P9Zvuc/mw/vUb97iRe59rcOPe5yr473MZ4URxu3nefRiNpxpCYDIe
+	3l0d18tZ23c/LmTZmVLtqN29fxw+aQILDAcP/euz5s6bpP++YciMJAqV+ufzq+5N/1YT
+	VKDf+9o5ae5uZZbvb3r3YYuVWvPL2UW7owkq0D4/+bz/oZSLL61nKOTdLy6Utj82Dg6b
+	mqACh/t7Hyob2df3iz3QaCJT2Ci9q1Q1AQUqlfLW23zK3c7FD5t/HzZ177/biVQml9cE
+	FshlM8l4dOX9d3dDTSscse1YXBNQIBazo5E1mvMtNQzTNC1NUAFXy1jxqC+eMtbXEpCA
+	BCQggf9A4C9bXHKRCmVuZHN0cmVhbQplbmRvYmoKNDYgMCBvYmoKMTA4OQplbmRvYmoK
+	NDcgMCBvYmoKPDwgL0xlbmd0aCA0OCAwIFIgL1R5cGUgL1hPYmplY3QgL1N1YnR5cGUg
+	L0ltYWdlIC9XaWR0aCA1MDIgL0hlaWdodCA2MzAgL0NvbG9yU3BhY2UKL0RldmljZUdy
+	YXkgL0ludGVycG9sYXRlIHRydWUgL0JpdHNQZXJDb21wb25lbnQgOCAvRmlsdGVyIC9G
+	bGF0ZURlY29kZSA+PgpzdHJlYW0KeAHt11lzlAUeRvF0OitZgICBgEQWDYuyCLILyC5b
+	IJAQ5vt/kek4o2VAjlUzVxzPe+PFX6vynF/eTjs21lOBClSgAhWoQAUqUIEKVKACFahA
+	BSpQgQpUoAIVqEAFKlCBClSgAhWoQAUqUIEKVKACFahABSpQgQpUoAIVqEAFKlCBClSg
+	AhWoQAUqUIEKVKACFahABSpQgQpUoAIVqEAFKlCBClSgAhWoQAUqUIEKVKACFahABSpQ
+	gQpUoAIVqEAFKlCBClSgAhWoQAUqUIEKVKACFahABSpQgQpUoAIVqEAFKlCBClSgAhWo
+	QAUqUIEKVKACFahABSpQgf+hwGAwGO+RFRihwq/CYHw4MTk1Nd2jKjA1NTkxHP8M/GB8
+	Ymp2bn5hcW+PqcDi4sL8nunJ4V+yD4aTs/P7Di4fXlk50iMqsLJy6KulvXPTE3/xug+G
+	U3v2LR898e3ps2fP9XgKnD17Zu3U6sqBhZmJ8U/+uo9Pzi0dOXnu0k/Xb97qURW4ee3K
+	+bXV5cWZiY8/5AcTs/uPfHfh+p37jx4/6TEVePz44S+3r3x/fHlh+uO/7cPphUOnLt58
+	8PTFq/X11z2eAuvr6y+fP7579dzqgbnJ3S/7YGLP0uoPNx48f/12c/Rs9WgKjDjfbbx6
+	evfK2sri9O6/7IPJ+eVvr9x79mbz/fbo+dCjKbDj+f7dq8e3zq8uzU7s+j43Pr24cubG
+	o1fvdsT/1WMqMPr93d7aeHbv8smDc7u/z43P7Dv6/e2nr7e2MzeJ72zZ+dR6/+7lg6vf
+	Lc/v/sM+nN1/7PydX99s9abb0H9z33736tH1tUMLU7u+zg1nl1Yv3H22sdWr7lTfXH90
+	4/ThxU/VL6YuFP/PpO3N9cc3z6x8Rv29dvc/e1jq/0T/P9R3/Q/7zt/1nU/43nXn70Tq
+	TldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69K
+	nfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX
+	1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTlde
+	lTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4
+	r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2u
+	vCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3
+	cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7
+	XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp1
+	7uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5T
+	d7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV
+	6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8
+	pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ry
+	qtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzH
+	eU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu50
+	5VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5
+	j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d
+	6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWp
+	cx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/Oa
+	utOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqr
+	Uuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/n
+	NXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOV
+	V6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+
+	zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWn
+	K69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XO
+	fZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvq
+	TldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69K
+	nfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX
+	1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTlde
+	lTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4
+	r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2u
+	vCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3
+	cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7
+	XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp1
+	7uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5T
+	d7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV
+	6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8
+	pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ry
+	qtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzH
+	eU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu50
+	5VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5
+	j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d
+	6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvIrVt/g/7vqFFvhD
+	fTD2p2c4u7R68e6zja0PX+isfmws8Fn1YxfuPHuz9eFD7tjvizx+2N589ejG6cMLU7vf
+	9Zn9X5//+WnqXyTq3/zQozd5+92rh9fWDi1M7lIfn9579NytJ+ub26N/pbf9bzJ+YeeR
+	6Pu3L+7/9O3y/EfqU4uH1649ePn2/Q77F7aqHxcLjN707a03v965dPzAnold7/pgcu7g
+	iUs/P1l/t/W+x1Zga3PjxcPr577eNzP80zf4sbHBcHbf0TNX7z19+XrjbY+swMb680e3
+	L51aXpga36U+Nj41f/Cb76/eefT0+YseV4Hnz57cv/Xj2tH9s7s/4Hde9unF5eNnL9/4
+	+d790fOgR1JghPnL3dvXLqx9fWDu41d9bGx8Ymbxq2Onzl748fKVHlWByxd/OH3iyNL8
+	1HDXd7mdD/vBiH1+afno6vGTJ0/1iAqcPPHNsZWDe+f+Av039qk9C3uXDhz8qkdV4OCB
+	/YtzM5Ofvum/fbUbve5TM7N75npkBfbMTk8Oxz/5eP/9+/xgfDicmJiY7BEVGIGOyD9r
+	/l/7QY+swO8vdf+sQAUqUIEKVKACFahABSpQgQpUoAIVqEAFKlCBClSgAhWoQAUqUIEK
+	VKACFahABSpQgQpUoAIVqEAFKlCBClSgAhWoQAUqUIEKVKACFahABSpQgQpUoAIVqEAF
+	KlCBClSgAhWoQAUqUIEKVKACFahABSpQgQpUoAIVqEAFKlCBClSgAhWoQAUqUIEKVKAC
+	FahABSpQgQpUoAIVqEAFKlCBClSgAhWoQAUqUIEKVKACFahABSpQgQpUoAL/X4F/A+4p
+	3x8KZW5kc3RyZWFtCmVuZG9iago0OCAwIG9iagozNDQ5CmVuZG9iago0OSAwIG9iago8
+	PCAvTGVuZ3RoIDUwIDAgUiAvVHlwZSAvWE9iamVjdCAvU3VidHlwZSAvSW1hZ2UgL1dp
+	ZHRoIDQwMiAvSGVpZ2h0IDExNCAvQ29sb3JTcGFjZQovRGV2aWNlR3JheSAvSW50ZXJw
+	b2xhdGUgdHJ1ZSAvQml0c1BlckNvbXBvbmVudCA4IC9GaWx0ZXIgL0ZsYXRlRGVjb2Rl
+	ID4+CnN0cmVhbQp4Ae2dW1PaXBSGyRkIBAELQgVrKQdFY0c/5SRaFTxQASkJof//jzRo
+	2yEq64695pu+60Iv3oGXeR52tl6tUAgDAiAAAiAAAiAAAiAghoAkywpGKAFZlqRVciVZ
+	0XQjHMGIJBA2NFV534mkaGEznkimMAIJJDesWNRQ5XecyIpuJtLZ/HahiBFHoPAxl0nF
+	I9rbYyIpRiyd/1TeP7DtI4woAvZhvVYqZDei2utTIil6bLNQsU9b590LjDgC3U7juF7K
+	J30lwftd1sx0oXbcuerf3T9gxBG4v+1dNOwvuUT41XNLCSdyleNu//to/DTBiCPwNB4+
+	XLcOdz/EgodEUs30J7vTf5w4rjvDiCPgutPx4OqslvcPyfJjS9bj2fLp1WDiet58Pv+J
+	EUPAZ+3NnPHdub2TjqrLfwHLRiK/3+qPnIUPGBGj47lloeTH4NtJyX9sLRtRwsntg/O7
+	sYsTItDGHyXTx5uzcjYeNBJJFuzu/ZOLAyLayM+5Nx32GtWtuB44I5FU0b54mPhGhH+i
+	f77Qc0b9ZjVnvTFyBCM8X46FkVZthZEZz2f6t1v/Gln+r13xn1qLMwIjDF8OGGGATlbC
+	CImHIYQRBuhkJYyQeBhCGGGATlbCCImHIYQRBuhkJYyQeBhCGGGATlbCCImHIYQRBuhk
+	JYyQeBhCGGGATlbCCImHIYQRBuhkJYyQeBhCGGGATlbCCImHIYQRBuhkJYyQeBhCGGGA
+	TlbCCImHIYQRBuhkJYyQeBhCGGGATlbCCImHIYQRBuhkJYyQeBhCGGGATlbCCImHIYQR
+	BuhkJYyQeBhCGGGATlbCCImHIYQRBuhkJYyQeBhCGGGATlbCCImHIYQRBuhkJYyQeBhC
+	GGGATlbCCImHIYQRBuhkJYyQeBhCGGGATlbCCImHIYQRBuhkJYyQeBhCGGGATlbCCImH
+	IYQRBuhkJYyQeBhCGGGATlbCCImHIYQRBuhkJYyQeBhCGGGATlbCCImHIYQRBuhkJYyQ
+	eBhCGGGATlbCCImHIYQRBuhkJYyQeBhCGGGATlbCCImHIYQRBuhkJYyQeBhCGGGATlbC
+	CImHIYQRBuhk5V8jr7e4vuwMJV+LcB0EVhp52au7jkq8J0HAXwfujHrN6tbrvbrJwuHL
+	7mnixYjWQMA3stg9XckGd0/L4Y3teud5P/saSvGWKwn429fns+nj9Wk5EwvsZ5cNK7fX
+	7A2nnod94CvxrSHwhXjuZHB5/HnTVJdvdkmLZb6cXD48ObOFE4woAp7nzabDfvuwmIqo
+	oaWR1GiqeNC8GYx/OI6LEUbAcaaT0d3FSSVnGcvLwEMhxbCypaP29f334WiMEUZgNBoO
+	bi/P6sW0GbhGQiFJjSQ/lo8a3ete/xYjjkD/5lvnv/puJm4oy9eIb0TWzFT+8/7X02a7
+	3cEIItButxondnUnY4UD9/riQpEUPbqR2d4tV/f2McII7NUqpZ38pi8keIu8KNEi8eRm
+	ZiuXx4gjkMt+SCdMQ5WDz6znv7okWdUjZsyyEhhxBKx4LGpoytsT8tuJomq6gRFIQNc1
+	VXnvgDwb8X9IkowRSkCS3nle/dGB3yAAAiAAAiAAAv93Ar8AcG6kVAplbmRzdHJlYW0K
+	ZW5kb2JqCjUwIDAgb2JqCjEyMDIKZW5kb2JqCjUxIDAgb2JqCjw8IC9MZW5ndGggNTIg
+	MCBSIC9UeXBlIC9YT2JqZWN0IC9TdWJ0eXBlIC9JbWFnZSAvV2lkdGggMzM2IC9IZWln
+	aHQgMTA0IC9Db2xvclNwYWNlCi9EZXZpY2VHcmF5IC9JbnRlcnBvbGF0ZSB0cnVlIC9C
+	aXRzUGVyQ29tcG9uZW50IDggL0ZpbHRlciAvRmxhdGVEZWNvZGUgPj4Kc3RyZWFtCngB
+	7d1ZV9pQFAVgkkAghEEGURAqlIpUJSqtI0OLiggoiBKg//+P9GJXESKcdY+Pus+Tstk8
+	fOtmOTyc63JhIAABCEAAAhD42AKKqmoYhoCqKsqqI6Gomkf3+gyMvIDP63Fry0UVzeMz
+	g+FIFCMtEFkLBfxet7pEVNV0MxzbSKUzXzCyApmtZCIaNDxvj6iieQOxVHZn78CyDjFy
+	AlZpv5jPbKz5Pc4Tqmh6IJ4pWCcX1VodIytQq5yV9/OpiABd/KmkesxYpliuNJqtuzZG
+	VuDu9qZ+Zn1Lhn2OJ17zhZOFcq3Z7fUfBxhZgcf+Q/vqopRbDyweUMVtxrJWpXk/GNr2
+	CCMrYNvP/U7jtJgSB3T+gVf14MbOSaMzsMfjyWTyByMjIKTGo2G/VbW2Y373/O9Mqjec
+	2rto9oZTTXjKYL68Zwr61Pn9Iy8e+HlPzRdJH1RbfRunU9ryP+jz/fXpzkZw0dOIZKza
+	3aONw8nz/DMZPz/cnO1uBvWF82lEv1j19kB4Mj/v0799POw1z3eToTeeh/B8z+GYel4U
+	V3iO3vOJn7sz85z/C0kTz/v0fMKTfTjgySYjC/AkedghPNlkZAGeJA87hCebjCzAk+Rh
+	h/Bkk5EFeJI87BCebDKyAE+Shx3Ck01GFuBJ8rBDeLLJyAI8SR52CE82GVmAJ8nDDuHJ
+	JiML8CR52CE82WRkAZ4kDzuEJ5uMLMCT5GGH8GSTkQV4kjzsEJ5sMrIAT5KHHcKTTUYW
+	4EnysEN4ssnIAjxJHnYITzYZWYAnycMO4ckmIwvwJHnYITzZZGQBniQPO4Qnm4wswJPk
+	YYfwZJORBXiSPOwQnmwysgBPkocdwpNNRhbgSfKwQ3iyycgCPEkedghPNhlZgCfJww7h
+	ySYjC/AkedghPNlkZAGeJA87hCebjCzAk+Rhh/Bkk5EFeJI87BCebDKyAE+Shx3Ck01G
+	FkhPm6wiXCIw83Tu//y3r3JJAy9RAqs8xX7aNvbTUnJLs8l4+HBz/mY/rdifXJruT8a+
+	36Vqq14UXGLf7/VpwbE/Wez33tq7/L/fe1UbrzsFhOfoqdv4+S2xuN9b1UObhdOr7tMI
+	C76dZsT34nSO7f5d7Sjr2D+veMx47qh623vG7QiydyO8vM8eDrpXZ3vptcX7ERTNWNsq
+	/qy37vuDJ4y0wGDQ69xUDvOJoD6/PtnlUsV1Pdv7J7XrVrvTxcgKdNq3jcvjwlbEWLhu
+	wuUS10mFEtnvx+fVX78bGFmBX/XKibWTjpmL18uIq1FUty+0ns5/Lx2Vyz8wcgLl48OD
+	3VwyauqO64/EARWggUgilcnmvmJkBXLb6WQ87H/L+QKqG4FwNBaPr2PkBOLxWCRk+pZc
+	xze9DEkcUd1r+E2MvIDf8Ho052V8s5ulxI2mmhvDERCY8/9YmlG+fqFgpAVe1fAVBCAA
+	AQhAAAIfV+AvZD1MOQplbmRzdHJlYW0KZW5kb2JqCjUyIDAgb2JqCjEwODYKZW5kb2Jq
+	CjMwIDAgb2JqCjw8IC9UeXBlIC9FeHRHU3RhdGUgL2NhIDAuNyA+PgplbmRvYmoKMzEg
+	MCBvYmoKPDwgL1R5cGUgL0V4dEdTdGF0ZSAvQ0EgMC43ID4+CmVuZG9iago1MyAwIG9i
+	ago8PCAvTGVuZ3RoIDU0IDAgUiAvTiAxIC9BbHRlcm5hdGUgL0RldmljZUdyYXkgL0Zp
+	bHRlciAvRmxhdGVEZWNvZGUgPj4Kc3RyZWFtCngBhVJPSBRRHP7NNhKEiEGFeIh3CgmV
+	KaysoNp2dVmVbVuV0qIYZ9+6o7Mz05vZNcWTBF2iPHUPomN07NChm5eiwKxL1yCpIAg8
+	dej7zezqKIRveTvf+/39ft97RG2dpu87KUFUc0OVK6Wnbk5Ni4MfKUUd1E5YphX46WJx
+	jLHruZK/u9fWZ9LYst7HtXb79j21lWVgIeottrcQ+iGRZgAfmZ8oZYCzwB2Wr9g+ATxY
+	Dqwa8COiAw+auTDT0Zx0pbItkVPmoigqr2I7Sa77+bnGvou1iYP+XI9m1o69s+qq0UzU
+	tPdEobwPrkQZz19U9mw1FKcN45xIQxop8q7V3ytMxxGRKxBKBlI1ZLmfak6ddeB1GLtd
+	upPj+PYQpT7JYKiJtemymR2FfQB2KsvsEPAF6PGyYg/ngXth/1tRw5PAJ2E/ZId51q0f
+	9heuU+B7hD014M4UrsXx2oofXi0BQ/dUI2iMc03E09c5c6SI7zHUGZj3RjmmCzF3lqoT
+	N4A7YR9ZqmYKsV37ruol7nsCd9PjO9GbOQtcoBxJcrEV2RTQPAlYFH2LsEkOPD7OHlXg
+	d6iYwBy5idzNKPce1REbZ6NSgVZ6jVfGT+O58cX4ZWwYz4B+rHbXe3z/6eMVdde2Pjz5
+	jXrcOa69nRtVYVZxZQvd/8cyhI/ZJzmmwdOhWVhr2HbkD5rMTLAMKMR/BT6X+pITVdzV
+	7u24RRLMUD4sbCW6S1RuKdTqPYNKrBwr2AB2cJLELFocuFNrujl4d9giem35TVey64b+
+	+vZ6+9ryHm3KqCkoE82zRGaUsVuj5N142/1mkRGfODq+572KWsn+SUUQP4U5WiryFFX0
+	VlDWxG9nDn4btn5cP6Xn9UH9PAk9rZ/Rr+ijEb4MdEnPwnNRH6NJ8LBpIeISoIqDM9RO
+	VGONA+Ip8fK0W2SR/Q9AGf1mCmVuZHN0cmVhbQplbmRvYmoKNTQgMCBvYmoKNzA0CmVu
+	ZG9iagoyMiAwIG9iagpbIC9JQ0NCYXNlZCA1MyAwIFIgXQplbmRvYmoKNTUgMCBvYmoK
+	PDwgL0xlbmd0aCA1NiAwIFIgL04gMyAvQWx0ZXJuYXRlIC9EZXZpY2VSR0IgL0ZpbHRl
+	ciAvRmxhdGVEZWNvZGUgPj4Kc3RyZWFtCngB1VlnWBTNsu6ZTcCypCXnHEVylpwkSA6C
+	SFrSknMOSlKCIIiAgKCACCKCGAgCImACRIKAEQmiIKhgAgThDur3fec+55x/98+d55me
+	d6uqq2unerqn3gGAbdktONgfpgMgIDA81MpQh/eggyMv7gWgBDSAEYgBSjdSWLC2hYUp
+	+K/H9wkA7SrHJHd9/Vez/6yg9/AMIwEAWSBqd48wUgCCrwMA65CCQ8MBQK0j8uGo8GAE
+	ox8gmDEUCRDBL3ex92+8sovdf2EM+peNjZUuABhWACio3dxCvQEgCCJy3kiSN+KHoAcA
+	liHQgxwIAPEggjVIPm4eALAVIzZ7AgKCdnEfgkXd/8WP979gNzf3v326uXn/jX//F6Qn
+	MrAeOSzY3y3m14//yybAPwK5X78OBqSlDvQ3280NM3IueLjpmSBXTuTcDvb/lTPEBmL3
+	DLS1RmS7eE+gu5n5H6zhFWpghWCkL2QRHK6zi5F7BnkFh1vY/JEnxvromiGYGpEXeIbp
+	/+XnnK+b8W7OaBB5c2iElS2CBRHcHRZprY9gZEZBb2J9bOz/2Hz18NT7I4dhL7KB0W8b
+	mIEcbrQ7FiOSc36/IJPdGJCxYEVgAvyBJ4gAoUgbCCSBKdAFen9aSeAF3BBNJKILA37g
+	LYIDkB5BSJ8gBPP+sdP9N4nBr37eSL//7ZEXkBDbiL/H/D0aLzLmXz7JwAPBf8ndkDF2
+	dbvRhbmQk/8Z8y+LXX+/opGul16U3vorJrQwWhatgNZBq6M10CqAF82MZgeSaHm0Mlob
+	rYlWQ3QqwAC8QTx7/xXjrv+AZq/I4qAYVTsfRLv7393/0gK7X9bkv3//WwSAPLTcsvxX
+	BACEe0YjzwEAukHBMaFkb59wXm3kyfXcw2sUSNq7h1dWWkZmV/3/5thds34H+8Xq11oE
+	MT/+RxbQCIAyGZmPzv/I3E8C0C6JPPv1/8iEC5G1wReAAUFSRGjkb3/o3QsGUAFaZIay
+	AW4gAESR+ywLFIEa0AL6wBiYAxvgAJyR+eODzMFQEAXiwVGQDrLASXAalIAKUAVqQQNo
+	Bi2gA9wB98AAGAbj4AWYBvNgCayA72ATgiAcRICIEBvEAwlBEpAspAxpQPqQKWQFOUCu
+	kDcUCEVA8VAKlAXlQyXQeagOugq1QXegh9AI9AyagRahz9APGAVTw4wwFywMS8HKsDZs
+	AtvAh2FvOASOhVPhHLgYroQvwzfhO/AAPA5Pw0vwNxRA4VHMKD6UJEoZpYsyRzmivFCh
+	qERUJqoQVYm6gmpH3UeNoaZRy6gNNBZNRPOiJZF5uh9tiyahQ9CJ6Gx0CboWfRPdhx5D
+	z6BX0NsYAoYTI4FRxRhhDmK8MVGYdEwhpgZzA3MXM46Zx3zHYrHMWBGsEnY/1gHri43D
+	ZmPPYhux3dgR7Bz2Gw6HY8NJ4NRx5jg3XDguHXcGdxl3GzeKm8etU+ApeChkKQwoHCkC
+	KZIpCikuUXRRjFK8o9ikpKMUolSlNKf0oIyhzKWspmynfEw5T7lJRU8lQqVOZUPlS3WU
+	qpjqCtVdqpdUX/B4PD9eBW+JJ+OP4IvxTfgH+Bn8BjUDtTi1LrUTdQR1DvVF6m7qZ9Rf
+	CASCMEGL4EgIJ+QQ6gi9hCnCOg2RZi+NEY0HTRJNKc1NmlGaj7SUtEK02rTOtLG0hbTX
+	aB/TLtNR0gnT6dK50SXSldK10U3SfaMn0svQm9MH0GfTX6J/SL/AgGMQZtBn8GBIZahi
+	6GWYI6KIAkRdIomYQqwm3iXOM2IZRRiNGH0ZsxgbGIcYV5gYmOSZ7JiimUqZOpmmmVHM
+	wsxGzP7MuczNzBPMP1i4WLRZPFkyWK6wjLKssXKwarF6smayNrKOs/5g42XTZ/Njy2Nr
+	YXvFjmYXZ7dkj2IvZ7/LvszByKHGQeLI5GjmeM4Jc4pzWnHGcVZxDnJ+4+LmMuQK5jrD
+	1cu1zM3MrcXty13A3cW9yEPk0eAh8xTw3OZ5z8vEq83rz1vM28e7wsfJt58vgu883xDf
+	Jr8Ivy1/Mn8j/ysBKgFlAS+BAoEegRVBHsEDgvGC9YLPhSiFlIV8hIqE7gutCYsI2wsf
+	E24RXhBhFTESiRWpF3kpShDVFA0RrRR9IoYVUxbzEzsrNiwOiyuI+4iXij+WgCUUJcgS
+	ZyVG9mD2qOwJ3FO5Z1KSWlJbMlKyXnJmL/Ne073Je1v2fpQSlHKUypO6L7UtrSDtL10t
+	/UKGQcZYJlmmXeazrLgsSbZU9okcQc5ALkmuVW5VXkLeU75c/qkCUeGAwjGFHoWfikqK
+	oYpXFBeVBJVclcqUJpUZlS2Us5UfqGBUdFSSVDpUNlQVVcNVm1U/qUmq+aldUlvYJ7LP
+	c1/1vjl1fnU39fPq0xq8Gq4a5zSmNfk03TQrNWe1BLQ8tGq03mmLaftqX9b+qCOtE6pz
+	Q2dNV1U3QbdbD6VnqJepN6TPoG+rX6I/ZcBv4G1Qb7BiqGAYZ9i9H7PfZH/e/kkjLiOS
+	UZ3RirGScYJxnwm1ibVJicmsqbhpqGn7AfiA8YFTB16aCZkFmrWYA3Mj81PmryxELEIs
+	blliLS0sSy3fWslYxVvdtyZau1hfsv5uo2OTa/PCVtQ2wrbHjtbOya7Obs1ezz7ffvqg
+	1MGEgwMO7A5kh1ZHnKOdY43jt0P6h04fmndScEp3mjgscjj68ENndmd/504XWhc3l2uu
+	GFd710uuW27mbpVu39yN3MvcV0i6pCLSkoeWR4HHoqe6Z77nOy91r3yvBW9171Peiz6a
+	PoU+y2Rdcgl51Xe/b4Xvmp+530W/HX97/8YAigDXgLZAhkC/wL4g7qDooJFgieD04OkQ
+	1ZDTISuhJqE1YVDY4bDWcEbk5XAwQjQiLWImUiOyNHI9yi7qWjR9dGD0YIx4TEbMu1iD
+	2Atx6DhSXE88X/zR+JkE7YTziVCie2JPkkBSatL8EcMjtUepjvodfZQsnZyf/DXFPqU9
+	lSv1SOpcmmFafTpNemj65DG1YxXH0cfJx4cy5DLOZGxnemT2Z0lnFWZtZZOy+0/InCg+
+	sZPjlTOUq5hbfhJ7MvDkRJ5mXm0+fX5s/typA6duFvAWZBZ8Pe1y+mGhfGFFEVVRRNF0
+	sWlx6xnBMyfPbJX4lIyX6pQ2lnGWZZStnfU4O1quVX6lgqsiq+LHOfK5p+cNz9+sFK4s
+	rMJWRVa9rbarvn9B+UJdDXtNVs3Pi4EXp2utavvqlOrqLnFeyq2H6yPqFy87XR5u0Gto
+	vSJ55Xwjc2NWE2iKaHp/1fXqRLNJc8815WtXrgtdL7tBvJF5E7oZc3OlxadlutWhdaTN
+	uK2nXa39xq29ty528HWUdjJ15nZRdaV27dyOvf2tO7h7+Y73nbkel54XvQd7n/RZ9g3d
+	Nbn74J7Bvd772vdvP1B/0PFQ9WFbv3J/y4DiwM1BhcEbjxQe3RhSHLr5WOlx67DKcPvI
+	vpGuUc3RO2N6Y/eeGD0ZGDcbH5mwnXg66TQ5/dTj6cIz/2erzyOfb7448hLzMvMV3avC
+	Kc6pytdirxunFac7Z/RmBmetZ1/MkeaW3oS92ZpPfUt4W/iO513dguxCx6LB4vD7Q+/n
+	l4KXNpfTP9B/KPso+vH6J61PgysHV+ZXQ1d3Pmd/Yfty8av8155vFt+mvgd831zLXGdb
+	r91Q3rj/w/7Hu82oLdxW8U+xn+3bJtsvdwJ2doLdQt1+vQugkBb28gLg80XkPcEBqR2G
+	AaCi+V1T/LJAyhUIsUGwHbQXWoLPopzRQuj3mG5sMS6YwopSn0oRL0W9lyBBo0xrQudK
+	H8FwmtjGOMNMzaLNGsrWwL7EKcbly93Es86nx39SYFZIRviYyCsxBfGTEsuS+nurpLZl
+	nGTb5dkVohXHleVUclSX9xmqn9P4oWWlfUFnQ89Ev8RgYb+8UZxxlyl0QMss1rzJYs6K
+	3lrdxsM2ze6c/bWDtx16HbsPtTk1Hq5xLnM56ZrsFuLuTDL1UPLk9yJ4rXnP+PSTm31L
+	/JL9yQEWgQpBLEFrwWMh9aFJYebhPOGfIroic6KcoiWif8T0x5bEkeOVE7AJY4kVSf5H
+	dI4KJjOm0KbSpdGn0x0jHKfMQGfsZG5kfc5eOjGb8zx39ORAXk9+26krBVWnzxTmFKUU
+	x52JKUkuLS67cXa4fLZi+dzK+ZXKlapP1R8vfKhZurhQ+6Zu5tJc/WoD/RXdxsSmlquv
+	m9ev424Qb/K0iLcqtGm2G92y7nDvjO4qvn2ne6EH3UvsY7/Le0/8vtIDnYc6/aL9nwYy
+	B9kGzz/SfLQ81PA4dFhlBBp5NFo+FvJEf5xt/ONE72TRU59nis92nne/iH0p93L5VcNU
+	2Ot909jp0ZmyWa85mbnNN/fmC956vlNdYFh4v9j1PnvJfplvefHD1Y+xn3RW8Cvjqw2f
+	y79c/7r23Wvt+YbWj4LN6Z9y2wU7O7/yLwA1wQ4oBtQDdDrGBMuEfYW7RpFN6U9li9ej
+	liOI0QjRitJJ0SswGBDtGAOZUpmrWPpYl9jpOTQ4yVwl3IM8O3zK/OECVwTfC0uI+IjW
+	ii1JSO4Jlbyxd0NaU+ao7H15vIKpYo7SiApR1UItZ1+/BlZTUytSu1bnhR5eX9XA3TBj
+	f73RgPGiKXyAxUzEXM5C1VLVSs5a0IbG5pvtc7tu++qDmQ6BjtaHlJw4nHYOzzr3udS4
+	prt5uGuROElrHiOe9V5p3s4+SmQ68oLvbb8i/8AA/UD2wA9Bt4NzQhxD+UMXw5rCoyJU
+	I35GdkUlRWvFoGMexJ6Is4gnxo8nFCUeQlbWlSO9RyuSU1ICUx3TDNPlj/Edpz6+ljGb
+	OZh1M/vcieM5obmHT5rmaeYrnNpbIHqav5CziKWY/gxVCbpkq/Rr2dLZ6fLJipFzw+fH
+	K19XLVWv16Au0tSy1Qlekq7fd9mgwfyKQ6NnU+TV7Obaa33Xp26stkCtdG187XK3DDoO
+	dQZ3pd8u7a6709BT3XuyL/yuzT3Z+/T3Vx88QdamioG0Qb9HlkPKj/mG8cPrI3Ojj8aa
+	nxSNJ0yQJk2eyj/jeo55vvziyctbr6qmTryOnw6e8ZsNmAt/kzCf/jbvXenChcWm9+1L
+	vcuPPrz4uL6islr9Recb/vvX9YUfo1uV2w5/8s8JnYBF4QFUAJoDPYBJxmpg13GdFMco
+	Hajk8DT4BeqHhGs05bQn6FLoYxkiiTGMMUwJzOksuaxn2RrZ+ziecn7kJvAI8urwufKn
+	CFQJ3hVaFKERlRGzFY+TqNjTJ7koRS+tJOMoGydXLn9bYUpxW5lDRUXVSo28L1E9T6NK
+	86pWh/ZdnX7dQb0B/fsGtw2v7a80yjQONDEx5TX9euCeWZE52ULFEmc5YXXBOsxGy5ba
+	dtKu2j74oJoD1mHYseSQp9Nep++Hu5zTXcxcia6TbiXIOsFDmvY45+nqxeP12vucjyuZ
+	hzzle9bPwZ/oPxSQEagfBAXdCg4PEQl5Gno8TCnsXXhhhF7E58hzUWZRm9F1MXaxcGxj
+	3KF4THxTwqFETGJTkvMRxiMjRwuTPVOUU2lS59M60wuO+R3XzmDJ+JB5J6sg2+uEUg5V
+	znRu68n8vNB861MKBWwF26ffFPYXNRafOhNZ4lCqWsaO7Jbj5TcqSs+dOJ9emVqVVn3s
+	wrGatIsJtQF1By/p16tdVm8wueLWGN9UfPV686Nr89c3b9K3CLfua7Ns976V2HG681JX
+	x+373f13Hvbc7b3T13m39d61+w0PLj6s6D8zkD+Y/Sh9KOVx2nDeSO3ow7HVca4Jo8nI
+	p5XPhp5vvBR8ZT2V+3p6hjzH+ubbO8xi4nLv6ql1wd38/+aWdvcErCIANQjvYXcEAEtE
+	U2sJgFABQnG0AWBBAMBGBcB+aQCmXwJQmejf+wcE0AgDR4dUnAJACqgjzMYhhEtIBPmg
+	BtwCI2ARqRfZIXnIHPKDjkEXoF5oFoZhAVgfqfSy4Eb4CfwDqef2o0JQJag+1CdkDhqi
+	I9BV6DEMCiOPVGQlmCEsCquCDcbWYmdxnLiDuALcKAU9hSXFKYpxSjZKF8oayo9UylQp
+	VMN4bnwgvpuakdqX+g6BgxBFGKdRpDlDs0PrTTtKp013jV6cvoZBhKGRqEYcZHRh/Mp0
+	glmceYAlmJWFtZcthJ2ffYLjBOd+LizXPe5MHkteTt4PfH38VQJZgrFCAcIeIi6izmKu
+	4p4SAXtiJDP2lku1S0/KvJf9KPdG/olCr+JNpSvKl1TqVC+pNe1rVe/TGNOc19rQodUV
+	0zPQ9zbIMry6/4UxzkTW1P5AqFmKea5FuWWL1QsbSlsNuyhkv/vsKH8o2umOM8HFybXO
+	bZnE5aHpae8V4H3cp5n8wU/JPyPgdZBi8MmQj8j+1hzJFBUe3R/LEuccX5uwk+RzZCbZ
+	LeV1mkP6+HGHjK2shZycvLMF7IXGxcElxWWt5UPnZiq/X6C5KFZnUh/d0N7E3Vx5Q6Kl
+	vG2nw6nr1h3e3sy7Gw98+sceyT/OGpl7cmBi6Jnri42pohnluddvUxc2l/iXtz9Wrwiu
+	Vnxh+1r5XWPt3Ubxps7W1Hbor/UDQjgHPCACLoSBVUL4HntARliFPHARdIEJ8AmiQjgC
+	HcgFSoTKoS5oGsm9MGwMB8OFcBf8FkWHUkV5ovJQt1Ef0JzoA0iFfhX9BsOGMcOkYTqR
+	6lsa64/k/S1OCOeFq8UtUUhRRFB0UmIpLSjPUr6nUqXKonqNl8dn4d9Qa1Kfpf5JcCXc
+	pZGkKaLF0EbSLtGR6Kbp3enfM8QQaYmXGA0ZF5iymGWYn7Oks8qzvmUrZbfhoOMY5Szm
+	cueW4gE847wNfBn83gLGgjJCHMIUwpsiX0W/im1JEPYISGrsdZXKkG6TeS/HKW+hkKU4
+	qEyvYq96Rm1MHdIQ1jTQ8tI+rtOgO64PG8gaeu0/azRpwmxqd6DQbMyCxtLQKsm63WbN
+	TtE++mCnI+aQhVPF4c8uxq7Vbj9Jlsg69d5bzieBPODH5R8ScC+IKzgyZCxMPrwoYivK
+	JborljUuMP5eokBS5pH1ZN+UV2kW6b3HlTIasvizS3JYcivyVPM/FLQWFhUnl4SUuZQb
+	n5Ov5KmmubBz8XPd2/qnDQ8aO662Xbtz43HLq7alWxtdVN28Pap9B+/FPCjtbx8cHnox
+	/HR08EnHxOWnZ5/nvTw2lTQdMxv1Jvpt3EL0+8PLzB9qPrGskFerPo9/WfvG8l1uzWI9
+	bOPMj0dbuJ+W29V/8o8FBMCCPP0yQAfhl3xAAihAOKT7YBbsQFzQPugwkvvz0D3kLZMB
+	VoVJ8Am4FZ5HEVHaCHNThZpAUyLsYgT6Mnoew4M5hCnGTCCMiz22BDuFE8D54q7htimM
+	KYopFhDG5ATlHJLzAqoVvDm+iZpIHUM9SzAjdNJI01yg5aEto+Omq0Z4iz4GFyKM5Nue
+	Ccd0izmcRZplhfU6WwK7EQcrxzJnH9c57iQeEq8pnwq/uACfII8Qn7CYiKKokZiLeIxE
+	0Z52yVkpBmljmXTZXnmMgqVigzJRJUl1dR9ZfUHTX+u7Troep367oYsR3rjDlGyGMc+y
+	BFZB1q9szex6kD2p9ZCKU7ezmcuMWzSJ1qPKS967m2ziO+lPClgNOhrCFNoYfiBiJepM
+	jHEcFN+aSEraPpqTwppamS55rDPDJnM9+0pO4EnxvLFTvgVfCiOKvp2JKtkqSy9nrKg5
+	r1Y5Vh1QQ3Wxtm7/pcXL2VfkG99cPX/N/4ZeC38bun2xY6Srs7uhp7Kv5F7Bg7z+3MHc
+	oazhhFHnJ9Lj3yabnwW8EHv5durCtNes+NzqfMe7tEW996vLxz98/mS0kr3a8vnVl+Wv
+	G9/mvj9cy1/ft/52I3Vj40fgj7nNg5u3txi3yFtdPxl/kn92bVNsW2wXb7/eEdkJ2mnZ
+	zX+Yl5zs7u4BIGodhH6c2tn5IgwALh+An3k7O5uVOzs/q5BiA/kG0u3/+3vFrjEW4dzL
+	bu2i/3T8D+gdk/4KZW5kc3RyZWFtCmVuZG9iago1NiAwIG9iago1OTUzCmVuZG9iago0
+	MCAwIG9iagpbIC9JQ0NCYXNlZCA1NSAwIFIgXQplbmRvYmoKNTcgMCBvYmoKPDwgL0xl
+	bmd0aCA1OCAwIFIgL04gMyAvQWx0ZXJuYXRlIC9EZXZpY2VSR0IgL0ZpbHRlciAvRmxh
+	dGVEZWNvZGUgPj4Kc3RyZWFtCngBhVTPaxNBFP42bqnQIghaaw6yeJAiSVmraEXUNv0R
+	YmsM2x+2RZBkM0nWbjbr7ia1pYjk4tEq3kXtoQf/gB568GQvSoVaRSjeqyhioRct8c1u
+	TLal6sDOfvPeN+99b3bfAA1y0jT1gATkDcdSohFpbHxCavyIAI6iCUE0JVXb7E4kBkGD
+	c/l759h6D4FbVsN7+3eyd62a0raaB4T9QOBHmtkqsO8XcQpZEgKIPN+hKcd0CN/j2PLs
+	jzlOeXjBtQ8rPcRZInxANS3Of024U80l00CDSDiU9XFSPpzXi5TXHQdpbmbGyBC9T5Cm
+	u8zuq2KhnE72DpC9nfR+TrPePsIhwgsZrT9GuI2e9YzVP+Jh4aTmxIY9HBg19PhgFbca
+	qfg1whRfEE0nolRx2S4N8Ziu/VbySoJwkDjKZGGAc1pIT9dMbvi6hwV9JtcTr+J3VlHh
+	eY8TZ97U3e9F2gKvMA4dDBoMmg1IUBBFBGGYsFBAhjwaMTSycj8jqwYbk3sydSRqu3Ri
+	RLFBezbcPbdRpN08/igicZRDtQiS/EH+Kq/JT+V5+ctcsNhW95Stm5q68uA7xeWZuRoe
+	19PI43NNXnyV1HaTV0eWrHl6vJrsGj/sV5cx5oI1j8RzsPvxLV+VzJcpjBTF41Xz6kuE
+	dVoxN9+fbH87PeIuzy611nOtiYs3VpuXZ/1qSPvuqryT5lX5T1718fxnzcRj4ikxJnaK
+	5yGJl8Uu8ZLYS6sL4mBtxwidlYYp0m2R+iTVYGCavPUvXT9beL1Gfwz1UZQZzNJUifd/
+	wipkNJ25Dm/6j9vH/Bfk94rnnygCL2zgyJm6bVNx7xChZaVuc64CF7/RffC2bmujfjj8
+	BFg8qxatUjWfILwBHHaHeh7oKZjTlpbNOVKHLJ+TuunKYlLMUNtDUlLXJddlSxazmVVi
+	6XbYmdMdbhyhOUL3xKdKZZP6r/ERsP2wUvn5rFLZfk4a1oGX+m/AvP1FCmVuZHN0cmVh
+	bQplbmRvYmoKNTggMCBvYmoKNzM3CmVuZG9iagozMiAwIG9iagpbIC9JQ0NCYXNlZCA1
+	NyAwIFIgXQplbmRvYmoKNTkgMCBvYmoKPDwgL0xlbmd0aCA2MCAwIFIgL04gMyAvQWx0
+	ZXJuYXRlIC9EZXZpY2VSR0IgL0ZpbHRlciAvRmxhdGVEZWNvZGUgPj4Kc3RyZWFtCngB
+	hVTPaxNBFP42bqnQIghaaw6yeJAiSVmraEXUNv0RYmsM2x+2RZBkM0nWbjbr7ia1pYjk
+	4tEq3kXtoQf/gB568GQvSoVaRSjeqyhioRct8c1uTLal6sDOfvPeN+99b3bfAA1y0jT1
+	gATkDcdSohFpbHxCavyIAI6iCUE0JVXb7E4kBkGDc/l759h6D4FbVsN7+3eyd62a0raa
+	B4T9QOBHmtkqsO8XcQpZEgKIPN+hKcd0CN/j2PLsjzlOeXjBtQ8rPcRZInxANS3Of024
+	U80l00CDSDiU9XFSPpzXi5TXHQdpbmbGyBC9T5Cmu8zuq2KhnE72DpC9nfR+TrPePsIh
+	wgsZrT9GuI2e9YzVP+Jh4aTmxIY9HBg19PhgFbcaqfg1whRfEE0nolRx2S4N8Ziu/Vby
+	SoJwkDjKZGGAc1pIT9dMbvi6hwV9JtcTr+J3VlHheY8TZ97U3e9F2gKvMA4dDBoMmg1I
+	UBBFBGGYsFBAhjwaMTSycj8jqwYbk3sydSRqu3RiRLFBezbcPbdRpN08/igicZRDtQiS
+	/EH+Kq/JT+V5+ctcsNhW95Stm5q68uA7xeWZuRoe19PI43NNXnyV1HaTV0eWrHl6vJrs
+	Gj/sV5cx5oI1j8RzsPvxLV+VzJcpjBTF41Xz6kuEdVoxN9+fbH87PeIuzy611nOtiYs3
+	VpuXZ/1qSPvuqryT5lX5T1718fxnzcRj4ikxJnaK5yGJl8Uu8ZLYS6sL4mBtxwidlYYp
+	0m2R+iTVYGCavPUvXT9beL1Gfwz1UZQZzNJUifd/wipkNJ25Dm/6j9vH/Bfk94rnnygC
+	L2zgyJm6bVNx7xChZaVuc64CF7/RffC2bmujfjj8BFg8qxatUjWfILwBHHaHeh7oKZjT
+	lpbNOVKHLJ+TuunKYlLMUNtDUlLXJddlSxazmVVi6XbYmdMdbhyhOUL3xKdKZZP6r/ER
+	sP2wUvn5rFLZfk4a1oGX+m/AvP1FCmVuZHN0cmVhbQplbmRvYmoKNjAgMCBvYmoKNzM3
+	CmVuZG9iago4IDAgb2JqClsgL0lDQ0Jhc2VkIDU5IDAgUiBdCmVuZG9iago0IDAgb2Jq
+	Cjw8IC9UeXBlIC9QYWdlcyAvTWVkaWFCb3ggWzAgMCA2MTIgNzkyXSAvQ291bnQgMSAv
+	S2lkcyBbIDMgMCBSIF0gPj4KZW5kb2JqCjYxIDAgb2JqCjw8IC9UeXBlIC9DYXRhbG9n
+	IC9PdXRsaW5lcyAyIDAgUiAvUGFnZXMgNCAwIFIgL1ZlcnNpb24gLzEuNCA+PgplbmRv
+	YmoKMzkgMCBvYmoKPDwgL0xlbmd0aCA2MiAwIFIgL09yZGVyIDEgL0VuY29kZSBbIDAg
+	MTM2NCBdIC9GdW5jdGlvblR5cGUgMCAvQml0c1BlclNhbXBsZQo4IC9EZWNvZGUgWyAw
+	IDEgMCAxIDAgMSBdIC9Eb21haW4gWyAwIDEgXSAvUmFuZ2UgWyAwIDEgMCAxIDAgMSBd
+	IC9TaXplIFsgMTM2NQpdIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlID4+CnN0cmVhbQp4Aa3B
+	BwKBAABA0ftfSTRUtDWMFu00dQV34L+3bT/6bB/OylmWdaHMy8yZpnmijNPIGUDv4c3p
+	QV3fUdqu5TRN21DqpuZUVV1RyqrkFKBX8eI8Qfkzp2R5xknTLKUkacKJ4ySmPOIH5w66
+	3W+cKyi6RpQwCjlBEAYUP/A5F5B38TguyHEdjg2ybItiWibIMA3K2ThzTiD9pHM0kKqp
+	nCNIOSoUWZFBkixRREnkHED7w54jgHbC7n9fqv5GzAplbmRzdHJlYW0KZW5kb2JqCjYy
+	IDAgb2JqCjE4OAplbmRvYmoKMzggMCBvYmoKPDwgL0xlbmd0aCA2MyAwIFIgL09yZGVy
+	IDEgL0VuY29kZSBbIDAgMTM2NCBdIC9GdW5jdGlvblR5cGUgMCAvQml0c1BlclNhbXBs
+	ZQo4IC9EZWNvZGUgWyAwIDEgMCAxIDAgMSBdIC9Eb21haW4gWyAwIDEgXSAvUmFuZ2Ug
+	WyAwIDEgMCAxIDAgMSBdIC9TaXplIFsgMTM2NQpdIC9GaWx0ZXIgL0ZsYXRlRGVjb2Rl
+	ID4+CnN0cmVhbQp4AaXChVJCUQBAwb+2u7u7sekGFQMDW7ED61OOMTL48MWNnU1+kLSY
+	+OD7u+L4O8XfiAuPvWH3lZjt6CsSX4gaR15QnCOSI6w9lCP0rD74jOETQZmBJ+w+ErDt
+	f0T0A/5/fQ+ovMf303uPZs8dOt13GN7ilrl6i+UbVp2u3CD0mhWzy9dIv2I5f+kKzYtZ
+	dC5kKbxkQfL8JeYvmBfoukDoOS6zc+dIP2Muf/YMrafM6J0+5fcJ0/KnTjB/zJTAyWOc
+	HzFpceIIuYdM/Dl+iPoM4xnG9I5m+H3AqPyRA0zuMyJ2eB+HewxbH9pD4i5DxoO7qE8z
+	mGZAb3+a7zuK+3Yovk2f8N5tHG7Ra71nC4mb9Bh3b6I4RffPrhQ6O1N0bqjv2KD4Oh3C
+	29exu0a77bY1RCdp+7c1icoErfktCXQ2J2iOq2+KYxijSWZjDMtRGp02RBEaocFsfQSV
+	Yerz68LorA2hsyZEYZAaydVBLAeodloVQKifKrOVfqT7qPyzwod6L+V6y7wUeiiTXOrB
+	vJtSgSVuvn4CXuWIVQplbmRzdHJlYW0KZW5kb2JqCjYzIDAgb2JqCjQxMAplbmRvYmoK
+	MzcgMCBvYmoKPDwgL0xlbmd0aCA2NCAwIFIgL09yZGVyIDEgL0VuY29kZSBbIDAgMTM2
+	NCBdIC9GdW5jdGlvblR5cGUgMCAvQml0c1BlclNhbXBsZQo4IC9EZWNvZGUgWyAwIDEg
+	MCAxIDAgMSBdIC9Eb21haW4gWyAwIDEgXSAvUmFuZ2UgWyAwIDEgMCAxIDAgMSBdIC9T
+	aXplIFsgMTM2NQpdIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlID4+CnN0cmVhbQp4AY3CCTdU
+	cRgH4C8mEolEIpGSkpKSEolEIhljxqxmDGNm7Pu+71tf6/29neuY073jf+99n/Pw3wTb
+	jPOlcIwvTV7E2HCMLySjfKF7HmXTo3wuOcJnwhE+M3kaYcNhPpUM86nuSZhNh/hE8DjE
+	x0OyQT42eRRkwwAfCfv5KPnQz6Z9fCh44OMDr7iHD1T3PWw4yPvCbt5P3nOzVRfvXcee
+	S33Xhd0BcSd2VXecSN2PHUkHdq5uO2CzD9t2t/qg/SPbiy3VzV6k/o1N4R5s9mDDdjc2
+	7K53Q/tLtgvrqmtdSP0Ta8KdWOvEqu0OrNpd6YD2h3g7Vm5cbkfq71gWbsNyG5YkW7Fk
+	ebEV2m/iLVg0XmiB+lcsSDZjoRnzkk2YtzzXhOtfMCfZiDnj2Uaof8as8CfMSDZgxvJ0
+	A65/xLRwPaZ1p+qh/gFTwu8xKVmHSfMTdfj/HSaEazGhO14L9bcYF36DhHANEoqUqKG4
+	/muKC1dTXDdWTaZfUUzyJY0JV9GYyWgVGb6gqGQlRXVHK8n0cxqVHXlGohU0YjJSQYZP
+	KSJcTpHk4XIyXUbDguEyCj8RL6WwaqiUDB9TSLiEQslDJWS1mIbsBosp+Ei8iIKqgSIy
+	fEgB4UIKJPsLyWoB+e36Csj3QDyffKrefEp9n7ySeeS96skjm7nksTuYS9p7sjk0qOrO
+	odR3yS2cTe5sctnOIpfdgSzS3hHPpIEbnZmU+jY5hTPImUH9kunUb9mRTtpb4mnkSPsH
+	inMKnAplbmRzdHJlYW0KZW5kb2JqCjY0IDAgb2JqCjU3MgplbmRvYmoKMzYgMCBvYmoK
+	PDwgL0xlbmd0aCA2NSAwIFIgL09yZGVyIDEgL0VuY29kZSBbIDAgMTM2NCBdIC9GdW5j
+	dGlvblR5cGUgMCAvQml0c1BlclNhbXBsZQo4IC9EZWNvZGUgWyAwIDEgMCAxIDAgMSBd
+	IC9Eb21haW4gWyAwIDEgXSAvUmFuZ2UgWyAwIDEgMCAxIDAgMSBdIC9TaXplIFsgMTM2
+	NQpdIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlID4+CnN0cmVhbQp4AbXCiVYBUQAA0O8y++pL
+	s0WWyCCSdQahlMqSLUspwhd06uQ4ozHmzbx3zy1t7KVjlY0d+NquGC0qa1V5LR65EmV4
+	iytR9UssIroUi0uxALlQWP5eCAWt+YUA4aeQNzb3KYD9EHIWZj8EvXMhq5fPzsFm5vzu
+	O59B943PvPHXKM7468PTM95wLj37d8qlQV5NOYAT7sra1ITTPuZSCCbH3M9XzWzyFcYR
+	m9y+HLEwD9lL3Ykha/6ATQCOD9htJj7Q3Wfilsf6jMYeE0NT6jHSC8pdRvpLS106CneH
+	juq+6NAmt+kL8JE2bWiLjgCnIq394Ral8ZkKo3n+RCH8SJ2rhx4paJtk6NhgkzTzgQya
+	Gnggj78nA5D678n9DdJvKOFvAD+7I1C9Jc60+m4JCOuEz1hvnTAW99a3a7jX7NMarreK
+	n0LtqeK7N7gH3QruqeDugzF3xewy5j7QVcasLmEuw50lDKyCOS10KNi2zaGoyzYH7Cey
+	7W/RdgLyGwqvtaMKZW5kc3RyZWFtCmVuZG9iago2NSAwIG9iagozODQKZW5kb2JqCjM1
+	IDAgb2JqCjw8IC9MZW5ndGggNjYgMCBSIC9PcmRlciAxIC9FbmNvZGUgWyAwIDEzNjQg
+	XSAvRnVuY3Rpb25UeXBlIDAgL0JpdHNQZXJTYW1wbGUKOCAvRGVjb2RlIFsgMCAxIDAg
+	MSAwIDEgXSAvRG9tYWluIFsgMCAxIF0gL1JhbmdlIFsgMCAxIDAgMSAwIDEgXSAvU2l6
+	ZSBbIDEzNjUKXSAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAGtwQcCgQAA
+	QNH7X0k0VLQ1jBbtNHUFd+C/t20/+mwfzspZlnWhzMvMmaZ5oozTyBlA7+HN6UFd31Ha
+	ruU0TdtQ6qbmVFVdUcqq5BSgV/HiPEH5M6dkecZJ0yylJGnCieMkpjziB+cOut1vnCso
+	ukaUMAo5QRAGFD/wOReQd/E4LshxHY4NsmyLYlomyDANytk4c04g/aRzNJCqqZwjSDkq
+	FFmRQZIsUURJ5BxA+8OeI4B2wu5/X6r+RswKZW5kc3RyZWFtCmVuZG9iago2NiAwIG9i
+	agoxODgKZW5kb2JqCjM0IDAgb2JqCjw8IC9MZW5ndGggNjcgMCBSIC9PcmRlciAxIC9F
+	bmNvZGUgWyAwIDEzNjQgXSAvRnVuY3Rpb25UeXBlIDAgL0JpdHNQZXJTYW1wbGUKOCAv
+	RGVjb2RlIFsgMCAxIDAgMSAwIDEgXSAvRG9tYWluIFsgMCAxIF0gL1JhbmdlIFsgMCAx
+	IDAgMSAwIDEgXSAvU2l6ZSBbIDEzNjUKXSAvRmlsdGVyIC9GbGF0ZURlY29kZSA+Pgpz
+	dHJlYW0KeAGNwgk3VHEYB+AvJhKJRCKRkpKSkhKJRCIZY8asZgxjZuz7vu9bX+v9vZ3r
+	mNO943/vfZ/z8N8E24zzpXCML01exNhwjC8ko3yhex5l06N8LjnCZ8IRPjN5GmHDYT6V
+	DPOp7kmYTYf4RPA4xMdDskE+NnkUZMMAHwn7+Sj50M+mfXwoeODjA6+4hw9U9z1sOMj7
+	wm7eT95zs1UX713Hnkt914XdAXEndlV3nEjdjx1JB3aubjtgsw/bdrf6oP0j24st1c1e
+	pP6NTeEebPZgw3Y3Nuyud0P7S7YL66prXUj9E2vCnVjrxKrtDqzaXemA9od4O1ZuXG5H
+	6u9YFm7DchuWJFuxZHmxFdpv4i1YNF5ogfpXLEg2Y6EZ85JNmLc814TrXzAn2Yg549lG
+	qH/GrPAnzEg2YMbydAOuf8S0cD2mdafqof4BU8LvMSlZh0nzE3X4/x0mhGsxoTteC/W3
+	GBd+g4RwDRKKlKihuP5rigtXU1w3Vk2mX1FM8iWNCVfRmMloFRm+oKhkJUV1RyvJ9HMa
+	lR15RqIVNGIyUkGGTykiXE6R5OFyMl1Gw4LhMgo/ES+lsGqolAwfU0i4hELJQyVktZiG
+	7AaLKfhIvIiCqoEiMnxIAeFCCiT7C8lqAfnt+grI90A8n3yq3nxKfZ+8knnkverJI5u5
+	5LE7mEvae7I5NKjqzqHUd8ktnE3ubHLZziKX3YEs0t4Rz6SBG52ZlPo2OYUzyJlB/ZLp
+	1G/ZkU7aW+Jp5Ej7B4pzCpwKZW5kc3RyZWFtCmVuZG9iago2NyAwIG9iago1NzIKZW5k
+	b2JqCjMzIDAgb2JqCjw8IC9MZW5ndGggNjggMCBSIC9PcmRlciAxIC9FbmNvZGUgWyAw
+	IDEzNjQgXSAvRnVuY3Rpb25UeXBlIDAgL0JpdHNQZXJTYW1wbGUKOCAvRGVjb2RlIFsg
+	MCAxIDAgMSAwIDEgXSAvRG9tYWluIFsgMCAxIF0gL1JhbmdlIFsgMCAxIDAgMSAwIDEg
+	XSAvU2l6ZSBbIDEzNjUKXSAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAGl
+	woVSQlEAQMG/tru7u7HpBhUDA1uxA+tTjjEy+PDFjZ1NfpC0mPjg+7vi+DvF34gLj71h
+	95WY7egrEl+IGkdeUJwjkiOsPZQj9Kw++IzhE0GZgSfsPhKw7X9E9AP+f30PqLzH99N7
+	j2bPHTrddxje4pa5eovlG1adrtwg9JoVs8vXSL9iOX/pCs2LWXQuZCm8ZEHy/CXmL5gX
+	6LpA6Dkus3PnSD9jLn/2DK2nzOidPuX3CdPyp04wf8yUwMljnB8xaXHiCLmHTPw5foj6
+	DOMZxvSOZvh9wKj8kQNM7jMidngfh3sMWx/aQ+IuQ8aDu6hPM5hmQG9/mu87ivt2KL5N
+	n/DebRxu0Wu9ZwuJm/QYd2+iOEX3z64UOjtTdG6o79ig+DodwtvXsbtGu+22NUQnafu3
+	NYnKBK35LQl0NidojqtvimMYo0lmYwzLURqdNkQRGqHBbH0ElWHq8+vC6KwNobMmRGGQ
+	GsnVQSwHqHZaFUConyqzlX6k+6j8s8KHei/lesu8FHook1zqwbybUoElbr5+Al7liFUK
+	ZW5kc3RyZWFtCmVuZG9iago2OCAwIG9iago0MTAKZW5kb2JqCjIgMCBvYmoKPDwgL0xh
+	c3QgNjkgMCBSIC9GaXJzdCA3MCAwIFIgPj4KZW5kb2JqCjcwIDAgb2JqCjw8IC9QYXJl
+	bnQgNzEgMCBSIC9Db3VudCAwIC9EZXN0IFsgMyAwIFIgL1hZWiAwIDczMyAwIF0gL1Rp
+	dGxlIChDYW52YXMgMSkKPj4KZW5kb2JqCjcxIDAgb2JqCjw8ID4+CmVuZG9iago2OSAw
+	IG9iago8PCAvUGFyZW50IDcxIDAgUiAvQ291bnQgMCAvRGVzdCBbIDMgMCBSIC9YWVog
+	MCA3MzMgMCBdIC9UaXRsZSAoQ2FudmFzIDEpCj4+CmVuZG9iago3MiAwIG9iago8PCAv
+	TGVuZ3RoIDczIDAgUiAvTGVuZ3RoMSAxMTg3MiAvRmlsdGVyIC9GbGF0ZURlY29kZSA+
+	PgpzdHJlYW0KeAG9egt4U1W28N7nmZwkbR7Ns02TNGnTR/qkDwKFnpa+oA2UlkKLrbSU
+	MoUBLFjLS5gOoIWiI86MgsiML3QUBw3FwaADl8utIz64F0UvPhD1iq/RiuNUUSEn/9on
+	pUI/v/n8vt9vzsk6a7/O3muvvfZaa6+TnlU3dSIN6kM0qpvf3r0YyVfGlwhR3R3L27uj
+	eUMd4Jc7enuc0TybihB96+LuXyyP5hVBhATPL5atHX0/rgUhs7qrs31RtB5dBlzYBQXR
+	PM4H7Ola3rMmmte/BvjmZTd0jNbHJUBeXN6+ZnR8dBbyzhXtyzuj7TNOAE7tvuHGntF8
+	F+C27lWdo+1xE9D3PwhDqQMtRUq0DCkQhbRwA2X8J4IHMVBL6gFKMxvvXxBb/DXSKeTu
+	HvRm9ZHE31x//e7i2cte1UZlJbRTyu1JBbzDpUlpCKkx1L+t2jhWQ2rJ5Qih+owQqgaY
+	CpAPkJ5xQCE+g3eguNYRUYkdDFI53rB+cRRnAf8/kp9BnCWqNUjZsbnY0bF5c3VaqRLX
+	oCIGIweuQB4Zlw96HneE8NRBjxvQlCiiBovskEOissjjCBctdFwuCimwGO/41vM7x0WA
+	bzwljq89uY5XoN2poirHyVKoH3S8lB6iAL3oCTFYjHWc8Pza8ZeiNMdTRZMdg14oG3Qc
+	KAV0yLG36NeOh7bIJQ+my+gBTwjvHnTcT9Ahx33Q/92b5Yq7oi9uiqLuLfJANxyU0YqD
+	IerxQ47lnhTHQngRiypHq2eZo8Xjd8wpDeHkQUeAvHbIUes96aghQw86xOhAhdHeCzwy
+	xXnRYX2eZx2p0RGSSGvR4HB6ah126N93/90On+d6R2l6CD/6dHVquqfae3dhCI/IYxAE
+	hBK0Ioo6vEfwn1AVSsPzUTK+52B1GtCMdww6NgPafbA6tSg5RH8i6h0HvdXeLQCFAMkA
+	jSE8R/TxO/lFfCM/gc/g0/gU3sUn8vF8nEKv0CpiFGqFoFAoOAWjoBRIEReKvCdmECmK
+	47QEcQx5MnJaS5E0POCJKKyg0AwU4tAtpt4SS4l+qs5fWf4jjza5sK0844fL8kMyw4Lt
+	wbtrGpqC++zNwTySiNibr6r//0l2lsHbNfVrD9av/WxuRae7os1d0QnQFtze22UJ9i10
+	Og98tpZUOIN0StvCji6C2zuDa92d5cHP3OXOA/Xye+Oq55Lqenf5ATS3Yk7TgbliZ/lg
+	vVhf4W4vbz5YV1E985qxto2NVV3xI2NVkM6qyVh18nvjxppJquvIWDPJWDPJWHVinTxW
+	RkbFkoYyxB5DOvY4ymR3IjtThuwIRd4CeJtgqSFygT2FhEg4MkyDZsNJBN69hOPQk4hH
+	T6ONoG1eRfuwErnRMM5Db2I7TkdvIAm9jf4P2dB2dD88K9An+BvQMp/iVGhTiDahP6L7
+	It2oG5XA/QlmkRFNRJ9G1kdORL5DZWgADWEeG7A9chhlo364d6M9WE0tjBxAFlSLVoNW
+	34ReQG9FBiN/h/4L0YdYh7OZyZF3QMBYKPGjbWgfehq7sBun4+siH0K5BWhsQfsigUgv
+	vHcBWmWjmWg9jPY+duAUnIF343P0cKQv8huYWwLUNaIOuJejX6NdaA/aL7dayCSwRui/
+	HNVA3W/Qy+gT9BUo3DRchtdQr9N/p79kJjO7I0NARyOM14buwzRwxYMb8SLcjffjp/B/
+	4W+oIqqd9tOvM93MA0BbI9qKHkBH0PPoNHoHfYaG0fcojBmgaSqehdfjP8B7/0dNoFqp
+	DdRt1FvUBTqXPsfwzHb2FvbZCBN5PfI90JyI0tFk2OmzURPqhHsxWoFuQr9CWzCPdqID
+	6L+A2nfRu1jAWpyNc3EVnoOvw7/Ea9GdeC9+Bp/F5/FH+FOgzkA5KDeVTfXCeJuobdR+
+	apA6TA3TOrqH3kAfo8/R3zBGppU5Bve7bCbbwyVwNfxs6ffSu5HMyI7IblgXE9welIYy
+	0VTMABeXoy2wktuAZ3vQXvQ4egINosHIJexHQ+gVoOt9dAFdhBVLgNuF8/BEXIdnA4XL
+	8HL8K7wLKNyHDwGVz+Jn0Rl8Bl+CW0JWSkllUtdR7dRauHejXdRpmT9q2kWn0pl0Dd0Q
+	+Qe9nz5Af8UkM/OZlcx6ZoDZxdzHJrBT2HnsfLabvYs9xL7E/i97gR3h7Fw/t5d7ijvN
+	K/h8fhcv4SSgxYmT0VPoKEjd3XQ35D1oGt4CqzoXvQzSO4yeQ5fQd+gY+hO2I4kmq5kS
+	eQCFIlthNY+gv9A3o2J0J/U7akakhH6UVuK8yEXoKwfW68qNxPS0VG9Kssed5HI6Eu0J
+	8TarxWwyxhn0Om1sjEatEpQKnmMZmsLIV+GubHMGU9qCTIq7ujqT5N3tUNB+VUFb0AlF
+	lde2CTrJe+1QdU1LEVouHtdSjLYUx1pirbMYFWf6nBVuZ/BkudsZwvNnN0H69nJ3szM4
+	LKcDcnqHnNZA2uWCF5wVlq5yZxC3OSuClb1dAxVt5Zk+fFgEYyBk+tBhhESkIh0H0bT2
+	DaBc0TTSoiJoc5dXBK1uSEMdnVzRvihYN7upojze5WrO9AXxtA73wiBylwVjM0ZfJ++B
+	Ekyub4KxM31LgkA/2q5e5F60PSSihW0k1d7SFKTbm4NUGxlDlxE0u8uD5nUfWn7IXklV
+	3HZVZZBKrmzvHKgMim3bgekk20Zy7bdBrqbBCd1StzQ3BfEtQBwhQqY9OouomUhuW+oM
+	Kt1l7q6BpW3Ac1TXNGgTbRXutvLmIKpvGrSKVjmT6Tts2TjZBUw5nFmaWUrwZJdlYxR/
+	vDla/uoxgi0bh94DXFM/xhdMxnZPBzKDzg4YBHgBtE4kj86JaKBjIrAPrmYMs1wC9EwL
+	UiBKdHKQTZ7eHuxrGCWjvat8lLil5YNKq022S2XN0L5tQDsJFhDaa93Oga8RrKx7+PNr
+	S9pHS7hk7deIVJL1HxOhIG6/ku4l9jMZTFKXxd1Flq9XXmrIuy0VVxVAntitTHA4fTUh
+	pKxrOoDxb5pDOHJLCJXbD4OBoRdcD9UZROCWlMNwkPH5oCDdBSmgoBIGqiSS4RxwDkxf
+	NOCsdHaBSDHJMoaKzoHmbGBYQxOwBc1pcgXF5vixZGdz8yToJ4v0A69A84Fm6GHpaA+A
+	5aLsMDTK9tXArFLqmmY3BfvK44NieTMwHYT4WF1T8BjIb3MztMoZoxQo3rDEMkpzLtCc
+	kw71edFewK3pgy6aBwZInw1Nblfw2MBA/ADZddE8eMjjC8TRghAiTQiHQ7ivDt4F5HbF
+	yyx3uV1AVjPh6QQQ4CsCBG79v+ZwwRjd8GYhUFsgc7joZ+LwxJ/CYf9P4vCkMUqv4fBk
+	oHkS4XDxv4/DU67h8NR/zeGSMbqBSBGoLZE5XPozcbjsp3B42k/icPkYpddwuAJoLicc
+	rvz3cbjqGg5X/2sOTx+jG4icAdROlzlc8zNxuPancDjwkzg8c4zSazg8C2ieSThc9+/j
+	8OxrOFz/rzncMEY3EDkHqG2QOdz4M3F47k/h8LyfxOGmMUqv4XAz0NxEODx/jMNifBBd
+	rYf7xqld9LMr5uuuYjn7PNpN+eH4vA+1Ahgh3Qdl+QAt7Fz0MPMB2gPph5gb0WRIrwdc
+	BbgEcDbgMmi/DUAJ+U28HfVBWT8pB9hA29EmKC8j/ZI8pG2cH8UQDGAEXy0aV4LgEOLA
+	F0bIieaTw/w1FwXxtisXnP5/wsVCGw6Ah0jWj1/KHy8eLRWQCijSoBjIxwJokQ7pARtQ
+	HFBtgpQZzn5WOO/Fw6nODqckcuXDfTP6KzoH54tzlJYqowbpufQTTALTywrsFjbEXuZ+
+	y0/iB/j3FFMVW5UxyiblnwWtMFP4QnUrnNh2IwTnh+MwWx5NFV0sZwe/nOHtNBJYxk7T
+	lE3J8XaMrArlPteyYghazBwpDoSLZ2q/KQ5ow8WopDhcTCA3Z4LOpfMC7GYeCl0+yR7/
+	fmqIqb/0BKESo1apg+pk34LZVIppXjpFu5pare2n+rUco4s1xFkNMbEMa1ih/D6bvY+l
+	WJsxzvi6q+ww/jOCIbUzvwmsvBzW+f1+7XlUUpKbg1v1hsISbOZ4ThdnNjmwO8WbUtC6
+	qbqhau/2vAZn7sYpjz3YuIiegH2P3LiQkn73jXRq6OHwJ93nznwfJvQYgZ6ATE++aNHr
+	lAaj2WzTaxQGJb1C873SevXwIyNkaL0fIhPlHwXk8ZEZjjM0F4vdhUV6Xb43JRtPwNtm
+	3bR9ZkXV6S35zYSAMywXkr6SvpBOSy880dT+xS6Mcd7QI+GPu2H8PiDiSYgx0ChFNOBU
+	WmBhfNyNrAzb7fpVlM+BsDwiKgkM5+YYXDpXH86WXsHp0v8SntKw8oh9FNaOQkR2zoq/
+	7KKwl00VJnJFymquS1gjbGW2crvpu5hd3D76YeZRLoRDwgl8QniDfkMwYp7jKKRQKuEh
+	YJ6l4gQhWQ/ZOJZN1kMdr0gnMS5BBYc1TinQrEKlASpVAsOxIRw3qKQpQIcEq7rzplWW
+	jN6Z2hFLIOz3w0/nt8q0W7JRibk4UFJcrPf7s0FM2P6sjA3aGnAnmWPxQWaouT/LMlpA
+	QwE91KyDlvDr1xYX8wBkrVErdqngMO2Cw7ALU9m4N/Q4bqEEaXBB+P3F0lHqGTg7l+PZ
+	308lDJI50hI5w65nL8AucaAeMW2e8Hv+9wr6Oqo5vsm+mFmNt7GPxQ0yTwt/Y55XvUW9
+	HfeO5d34by1acwirRLdNobCpSx00rS+1KR2mIrOiyJHI21yxRYlWp+se1/658j4IDMMu
+	COj8w68NwzSHS4qH9f5sLawVoVhfVOhymk1mFwimO4kyxpkm5BUVFrk45HJ6U3S45X+e
+	wibc8+cFvPRyYvachx89fvKPDzZmO3BuqvS0FJGOHzpE7WDmvXJoZNvA0sI26R/ffntx
+	qX/VP6RXXz6JO2kbyNDDsP4UzFaFskkk+xlQP0pUA5FsThtC+BR6RtZFNVChAnkhmIY4
+	V01GTi4GYbpyM+cuj1Avh/PpnEsPMX7miPR8BEm3SBehYxhjD0LMAfYYdFwkmvl0hlHS
+	6YhSKrhebFPRimSlVVCFcMJBV/3jUZ7IqiFAdmkYuBGOCm50rD2MMWyn+sNrpf9mj0lh
+	aX8Ehe8G6X0I5rEShhMgitAkpjvd8RYj6zWkpGMIQ6SnUV67wu5MMnDmJK7IHD9Pa/Mh
+	b3KqNcMXwokw8OhijA48FB4CCYL9CpqphCxI2K8z+2FNdC7gfwFsVXehyZyIjXEcnwih
+	D9AeZiNZpGychd0yV/Ap3NqV39Kct+jtP03Kmbh03eJGhdon7Y/h1JiiOrZKx6XT1Gnm
+	uNRjSb/51ixbuLJ84tZ5S15KT9t5b0enxx+fnJs4tXTb7deHj8KsaDQ5co6ZyCwAze5H
+	k9Ad4qzJVEHhWrwNM28k4pR/fpT+sTtGw0LEz2DLgLgJk5KVkpVOCph4VVK8yTfJwacL
+	Kl+eapIhgAJZkwrSp6bYim2B+ExFoMA6ufiv2IpcqBo/QXTlzJHA8IgsmOd1/pMffihL
+	Jijok36d3kw2FiaYQMbo1orBsRj0qCyhhUXeQsIlEFme412QduVB9AZ0bCIGNmVhL7R0
+	J6UU5IMsG6hz8UU54nxv2exJLffS+2clTWmd35meKEjDyqqV2HBw+3aKTkiQXtQI9ORA
+	S8/v//Pexoe7Kb3OqFRrzd766aXL7rggxNqKpk3ISy65o2VHVdVzkjp/xsRUTbprUrKY
+	WfDYvS/MzzVi8vEJ5GR95ANmD8iiHix2mZisdKpi9Gpk9eh5leD0sCrjFsqWZHcIDo1X
+	ZXUl7XLVzRyVyZHzZKcOk00KPx1MHyQC6Y1xlDvJm+I1kmWHuU7QRwUE5k64QT/2zy/P
+	9Nfn+qVPcUJhaWB18rpE/z33Tkq8+VfMfOnFryVpsNBZt409Fh6pTc273DN4Z0/tjttr
+	Vt8WitJbFXmLyYd1J7Z6hVhxj+lRE9WfgKcbm/Rd+jXCWn3I+LzhhFFhoTjG/irjSbTx
+	phhBrX1a7YlTJWoLYx2oMNFstzkVhWarw9nvqh6dz6jeCY/IemeY2EVQPjIma7oS9KWs
+	dcg0zKB3iNrhOZeTKtCiCXmMGdNahSunc0dBQsKE2xfNUWK3MOdW6Tvpu2+x/h8nMWuR
+	4qlnp+SW3VG7cc30rcvmbup5Fk/8DlvxxNCneK+8FiUg052wFlqY3SzR94karInRTmlp
+	ZPZoeU6wewSVkbYZHJyD9jI2h61QY0107HJVV4zKKFmQ8Mh5WIkfVgXEE5alFZnMRGEU
+	xGB3EiIkX1kWeVWodbtzsEv6bMqenv+QLmF85umNnVPrN9y0ei3TMi9AKb4Xd7Y34YKv
+	sBmLl1c9dceJuflHbtv5F9iH2ZGzzCRYD1DBKAk9Lk6vVPTH7cT3gD3DSpbTsrYatlI7
+	3XkrviW23yHQJtpsMBnM1YpaU615uq3F1GKebzuL32Y+tX/svOjUzsCV2q3sZi0DZvAu
+	ccKsmAUxN8TQMTHxnCfJxZv1vniViaaS6ELz+qTENnWfmlLbPJQj5q5Eq9sDrLginUQ4
+	W8GOnB/OjrLjZNSUtIL2RCtb8cpWBHsRtBMoLrh5FzxGjQnZjEinRZMxPrU8Bj/Lr79u
+	61tVokFFhU1c++SGpqJEM3ar5t92+ZR0HDs+jKN7bl668qbPFq9o76u5fW9ZWl58Tvui
+	+7AalF88fOKEi0ZlUhlzPfBJA18WctB8UTuQCEqD9eRk83ouWeNJC+ES0Zng9FlicyiH
+	3pHszfEZbHkJW+IzlYU+a27eVcscVUU6Pyw1aKLwyZJhfwnMTkc0cqvniqaRxVQPkytw
+	6eJAUpM83iuTnEJ0ExjQgnz9hCLqyMDmFXf7E52T7lZN6RKxsWqd9Mgr0rcxuFAdn7V8
+	d35SWnbj1lcvfXXuur/vfPjeB2+vWbFgxgC9yppx4x8ufXP6l6G9D+WZvL8o21NZ6S7F
+	3sv/xDV0dK9uA2O3j30JZs+jyWJSLarFLagFPl0cADXM8YISHB/EeTEPjvCgqy4qxbIj
+	TJxCsHayk0YcFR34KQD7pHdBSmVg4DOQtPoSHDUopJSq8ZPyOAY0mXyDfgbYzKBGsNoa
+	sNroVBTjsyEkjKaNZ1EIacHEG7KJBUfQOGrBcSKGvV0AeyWO6GQvflL6ANul+ZY4RXoG
+	tm86qpmQQsb+bhGF0yYz+y/NfPiP4N3DhSFqj5jl7BHwDL4UB0Wqkn2N+pBiYhWCspHd
+	xt6h+I3yOfZFxZv8u4qzSpWCs3DZdDaTymZyRfRErpau5lrpZm4pvYRbw2xldtJ38Y/R
+	TzL7uEf5Q3SI+Rv9AmOr4Wbwc9mtzGbFEHtC8Sb9JvMO/5ZCxSqVDMtyKhV8a+UhCd8C
+	BMpJ0y/pwbdQgqfJcJRSYGhO4AU4UNk0WPAilVOVoxJVjMqq1vS76j4gOuRyq3wM+QJ4
+	DwcQ2bCZ/f2BrAxG9i/XNQ8hPRg7vz+2X6sgriRIHOykla3gSWOXEtxJXufahC24A7dL
+	m/Ft0qPSpV7pE/bI5Y/wbmlBeBF+db30GOFVH9Cxh5kPX4COlwZQEawifBKGpwkgGWAJ
+	nNeWwrlsLeB1gLcBHgB8D+B7AD8GcBjgY+B2DLR3wdckGvxSDfJAnxb5mQxy54Be7WDd
+	FOAJZcNpzwzvcPBVUIlj4Q0dCqA4SCWC9bMjL2ArykLZ2A391cG3yVFTN6QdGfaPXDk5
+	FBcDdwLD2uGoDwR+KShXuI20i5xaiJU3gvxclXQZiSEEo28mmL3jNn+WVqCks3Epi3sz
+	zdL7cZ4l69LNINjGguyGLRsCU50TG5qWMfMnVvobipaGZ1OHpqbWLsyfHl5NbWv3zZqV
+	2RzuZsT7Gj1i0YS6tsxMmH8/yF476BcTzLBGzGSxESfjItyk6lJxWK/llB5QcjGMYGYL
+	zbGUzaqL8cZaLdajV7ZdIDw06niDSoG1Hy7xy+oEgaPyI3Px0gNnpLPm9N47CxOk89hQ
+	lNvUv4RpOXAynETtnJs1Z31pZ3gQSJyTXEZ2F+g/sNt7mE5YLXLiDoipZhor1FvVW7W0
+	WWOJXayhWY8ljld5YlQWi4IqNNtsikKd1WoL4d6DY2pdNtKg6EaPBiB9q9CqlaMqT7Zk
+	HjgKoIJ88jRi6rNbb92wob9/A5UlfS59DPfnOA5MrhXHhU+/MLh374EDe/cOLpYex41f
+	fo7nS498TonAyw1SA7MbZFMDUjFDTDMbFEKCjfI4eRsneAwqa4xCY9EUam1JnCPeYfFa
+	f9Qvkq2O7BuBaxQ1wlHRiHoPBXpiYmRPidhlWUDonht/DZ5QZ3H96g12rJTCL2+am50p
+	fYR1WfkLNlP3Hf/dzDVHA5mheyi/9JF0QXpPerXUUxE+wV54oCptOrA5qoOoS0wLxARm
+	HEY0rjpIxWrgiFolWg28hlMLTiqHEimanMypGJVXDYfyEF500FW3+IqsvxY9krcS/Qus
+	fg3OXsR5AFM5KthRYql3VIb4dM2fJ7uk97G2LLeuj2nBWDpLU90lm8MXmbKjy1OnEZoo
+	WPu34ftqO8pAPrRRnKXUcilWDa1kXCpVjTBdVeUqd1annaEV9iSnWmBMGYzJ5vPpecaX
+	qvL5Yo2C024KJPHGTD6QbMtSI3sgNhMFMqyZWVd5byNwLJH90RE4O4KCAvZHhSR8UntS
+	3qjXt16PW7Fs5mWPNBncuYJ82JbM6HlSduzkjQyq35lSgHGHMrHgjjkdqalS5HBt7fCZ
+	lzE2SB9w1uyVrbPS0yP7Guf847IU+Ro+NrfUOv15eTlW65SsivK+nW8+dKLIOWmSN9dk
+	npg6u379gyfffJSGjQAxksjfqTVsF+zTGYe0vliH2qd7Bq9EDG4RTTxq4TBngaWJ5UYY
+	pRf9FtbJEsIxB11tZHleKz4fLh4pJuvzBYRM4OQ/XAI+ABwHC0icaILRrSMn4sIiI8/B
+	3HTGXdh24EDSPI09pv/FGTn08pdwjnTqpfCxaS6MX2f5QO5i6j4i75FPmEbQHSQOVitm
+	CSabKd000TSX7+Q5G1gMzhSjEVjwn20awWuzqGwJuNBijU/4QXmQfan3B8KvyTwnnrMc
+	T8IkjkS8KmJPie/JE/eTkJaMHzB5V/22ED7nS58xTtO0DXO+mpONP2fKwje0Zjf0ikuo
+	2ZeO7mbzDMW+J9qepe60A+9soOPmwf9QOPRHcZaXm8Mt4h7m/gLfvTmspaqgah3VQ69m
+	uCq8FfWzO9k/sU+zJ+iP8UWspJ0M49WDjaScGHv10AVHsfDXMo6mBAUFxieE1YM0BJew
+	+hBj5TsJv61XB1+s2r9ZZMVIoi5jARcwiGOxFkhHDwrgXYK7gl0GOhnnSashVLUWix8w
+	ZZeOMmWXz8I8IBrJuWAeauQn/5ADT4QFT0QBQIIONIAAXgn5twoCMSYRhysp9WiK+Crx
+	ZAw5gmOg+rHrkX04TRqS3n58v/SG9N84bx8MdoHWXTpK2y5/BOmvovqB8LCOgU/qmBZ3
+	KkAVUzxjYGwC7aU8TAqXLhQyfqGCmS40Ms3CXcw9wv3Mk8JTzNP8s8IQ86LwKvO28CFz
+	kTEztIVhaa+eojDDWhia9erBpxSUFkGl9Op5hUJQWQSlCliNEWZ4gUEcCxEvlRIMsZIH
+	X4XGgsBQHPzXi8S/FI8hiHipNY9FJX2U89F4VyDbMqQdgj0N/ggJQpAoBNhgADhwY21/
+	hmIDxL7WNWufs2jZ/owNiqtzY3Vsv9byQ0tyJFqJWyeAywJ8hKcK23CPtAe3HhrEDdJu
+	SP/hr0eoVMoiDeHi8HD4NK6SDsOaGKUq4N8COYL8ptjtFeYKi4W7hL3CaQGcLsxxCbxO
+	k8k7NVP4XE0N38oTC7yaX6vRmGMLNf3KrapdqpCKi4tTKzSUU6326lUqgeMph0LhhTgh
+	SWoEoxr4xPFK5KB8Boc2No43AY9iNCo1yOdBqBAAi2rDbxXWTqNpjGcjgfOWy8AfAqOh
+	QlDigfPh8+CwyNFCECcMwUIWvLn6NeuemzAqvCQNpxF/9hUBdmBTYdFU7I1KGRX1hA94
+	0mtt1gxG6sZTvngfooIDyzYeScnKwpteoShBr1umZlZdPkt7Lp2SXrwL01wc0f3yFSH/
+	OPqxywGFNPgEavDEPCgFpYJPVgD/n6pAlfBfpWr4G2AteGgzwRebjepRA/wXai6aB/9g
+	aoavC9eRf7WCdBEJIxdHvkOUlk0rqwhkVHcu6+3sWdLRnll2w7JFpNWVawskdgDcDxAE
+	OAZwCuA9gC+jDbEWsBMgB0AEqANoA+gG6APYAXA/QBDgGMApgPcAvoxOmNICdgLkAIgA
+	dQBtkdELwTWWxuBhXJtPHZdPG5eXj5NXvV86rl42uVfVV4yrrxyXrx+Xbx+XXzgu3zEu
+	D8y9Zj7yOl81/i/G1S8Zl186Lv/LcXn5v9ZX9bdiXP0N4/Ld4/KrxuVvHJfvGZe/aVy+
+	d1x+9bj8mnH5tST//wAT5F4+CmVuZHN0cmVhbQplbmRvYmoKNzMgMCBvYmoKNzgxMgpl
+	bmRvYmoKNzQgMCBvYmoKPDwgL1R5cGUgL0ZvbnREZXNjcmlwdG9yIC9Bc2NlbnQgNzcw
+	IC9DYXBIZWlnaHQgNzIwIC9EZXNjZW50IC0yMzAgL0ZsYWdzIDMyCi9Gb250QkJveCBb
+	LTEwMTggLTQ4MSAxNDM2IDExNTldIC9Gb250TmFtZSAvQUJDQkVNK0hlbHZldGljYS1C
+	b2xkIC9JdGFsaWNBbmdsZQowIC9TdGVtViAwIC9NYXhXaWR0aCAxNTAwIC9YSGVpZ2h0
+	IDU0OSAvRm9udEZpbGUyIDcyIDAgUiA+PgplbmRvYmoKNzUgMCBvYmoKWyAyNzggMCAw
+	IDAgMCAwIDAgMCAzMzMgMzMzIDAgMCAwIDAgMjc4IDAgMCAwIDAgMCAwIDAgMCAwIDAg
+	MCAwIDAgMCAwIDAgMAowIDcyMiAwIDcyMiAwIDY2NyA2MTEgMCAwIDAgMCAwIDAgMCAw
+	IDAgMCAwIDcyMiAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwCjAgNTU2IDYxMSA1NTYg
+	NjExIDU1NiAwIDYxMSAwIDI3OCAyNzggNTU2IDAgODg5IDYxMSA2MTEgNjExIDAgMzg5
+	IDU1NiAzMzMKNjExIDU1NiA3NzggNTU2IDU1NiBdCmVuZG9iagoyMyAwIG9iago8PCAv
+	VHlwZSAvRm9udCAvU3VidHlwZSAvVHJ1ZVR5cGUgL0Jhc2VGb250IC9BQkNCRU0rSGVs
+	dmV0aWNhLUJvbGQgL0ZvbnREZXNjcmlwdG9yCjc0IDAgUiAvV2lkdGhzIDc1IDAgUiAv
+	Rmlyc3RDaGFyIDMyIC9MYXN0Q2hhciAxMjEgL0VuY29kaW5nIC9NYWNSb21hbkVuY29k
+	aW5nCj4+CmVuZG9iago3NiAwIG9iagooTWFjIE9TIFggMTAuNi44IFF1YXJ0eiBQREZD
+	b250ZXh0KQplbmRvYmoKNzcgMCBvYmoKKEQ6MjAxMTExMDcxOTEwNDVaMDAnMDAnKQpl
+	bmRvYmoKMSAwIG9iago8PCAvUHJvZHVjZXIgNzYgMCBSIC9DcmVhdGlvbkRhdGUgNzcg
+	MCBSIC9Nb2REYXRlIDc3IDAgUiA+PgplbmRvYmoKeHJlZgowIDc4CjAwMDAwMDAwMDAg
+	NjU1MzUgZiAKMDAwMDA1Mjc0MCAwMDAwMCBuIAowMDAwMDQzNzk1IDAwMDAwIG4gCjAw
+	MDAwMDMwMzggMDAwMDAgbiAKMDAwMDAzOTI2MyAwMDAwMCBuIAowMDAwMDAwMDIyIDAw
+	MDAwIG4gCjAwMDAwMDMwMTggMDAwMDAgbiAKMDAwMDAwMzE0MiAwMDAwMCBuIAowMDAw
+	MDM5MjI3IDAwMDAwIG4gCjAwMDAwMDQ1ODkgMDAwMDAgbiAKMDAwMDAwODA1MCAwMDAw
+	MCBuIAowMDAwMDE1NDYzIDAwMDAwIG4gCjAwMDAwMTYzMDYgMDAwMDAgbiAKMDAwMDAx
+	MTA2MCAwMDAwMCBuIAowMDAwMDE1NDQyIDAwMDAwIG4gCjAwMDAwMDgwNzEgMDAwMDAg
+	biAKMDAwMDAxMDI4MiAwMDAwMCBuIAowMDAwMDEwMzAzIDAwMDAwIG4gCjAwMDAwMTEw
+	NDAgMDAwMDAgbiAKMDAwMDAxNjMyNiAwMDAwMCBuIAowMDAwMDE3MDI4IDAwMDAwIG4g
+	CjAwMDAwMDQ0MzMgMDAwMDAgbiAKMDAwMDAzMTMxOSAwMDAwMCBuIAowMDAwMDUyNDY2
+	IDAwMDAwIG4gCjAwMDAwMDQyNzUgMDAwMDAgbiAKMDAwMDAwMzk2NyAwMDAwMCBuIAow
+	MDAwMDAzODA5IDAwMDAwIG4gCjAwMDAwMDM1MDMgMDAwMDAgbiAKMDAwMDAwMzY1OSAw
+	MDAwMCBuIAowMDAwMDA0MTI1IDAwMDAwIG4gCjAwMDAwMzAzOTcgMDAwMDAgbiAKMDAw
+	MDAzMDQ0NCAwMDAwMCBuIAowMDAwMDM4MzMwIDAwMDAwIG4gCjAwMDAwNDMxNTAgMDAw
+	MDAgbiAKMDAwMDA0MjM0MyAwMDAwMCBuIAowMDAwMDQxOTIwIDAwMDAwIG4gCjAwMDAw
+	NDEzMDEgMDAwMDAgbiAKMDAwMDA0MDQ5NCAwMDAwMCBuIAowMDAwMDM5ODQ5IDAwMDAw
+	IG4gCjAwMDAwMzk0MjYgMDAwMDAgbiAKMDAwMDAzNzQzMyAwMDAwMCBuIAowMDAwMDE3
+	MDQ4IDAwMDAwIG4gCjAwMDAwMjAwMzggMDAwMDAgbiAKMDAwMDAyMDA1OSAwMDAwMCBu
+	IAowMDAwMDIyNjk4IDAwMDAwIG4gCjAwMDAwMjI3MTkgMDAwMDAgbiAKMDAwMDAyNDAw
+	MCAwMDAwMCBuIAowMDAwMDI0MDIxIDAwMDAwIG4gCjAwMDAwMjc2NjIgMDAwMDAgbiAK
+	MDAwMDAyNzY4MyAwMDAwMCBuIAowMDAwMDI5MDc3IDAwMDAwIG4gCjAwMDAwMjkwOTgg
+	MDAwMDAgbiAKMDAwMDAzMDM3NiAwMDAwMCBuIAowMDAwMDMwNDkxIDAwMDAwIG4gCjAw
+	MDAwMzEyOTkgMDAwMDAgbiAKMDAwMDAzMTM1NiAwMDAwMCBuIAowMDAwMDM3NDEyIDAw
+	MDAwIG4gCjAwMDAwMzc0NzAgMDAwMDAgbiAKMDAwMDAzODMxMCAwMDAwMCBuIAowMDAw
+	MDM4MzY3IDAwMDAwIG4gCjAwMDAwMzkyMDcgMDAwMDAgbiAKMDAwMDAzOTM0NiAwMDAw
+	MCBuIAowMDAwMDM5ODI5IDAwMDAwIG4gCjAwMDAwNDA0NzQgMDAwMDAgbiAKMDAwMDA0
+	MTI4MSAwMDAwMCBuIAowMDAwMDQxOTAwIDAwMDAwIG4gCjAwMDAwNDIzMjMgMDAwMDAg
+	biAKMDAwMDA0MzEzMCAwMDAwMCBuIAowMDAwMDQzNzc1IDAwMDAwIG4gCjAwMDAwNDM5
+	NTggMDAwMDAgbiAKMDAwMDA0Mzg0MyAwMDAwMCBuIAowMDAwMDQzOTM2IDAwMDAwIG4g
+	CjAwMDAwNDQwNTEgMDAwMDAgbiAKMDAwMDA1MTk1NCAwMDAwMCBuIAowMDAwMDUxOTc1
+	IDAwMDAwIG4gCjAwMDAwNTIyMDYgMDAwMDAgbiAKMDAwMDA1MjY0NiAwMDAwMCBuIAow
+	MDAwMDUyNjk4IDAwMDAwIG4gCnRyYWlsZXIKPDwgL1NpemUgNzggL1Jvb3QgNjEgMCBS
+	IC9JbmZvIDEgMCBSIC9JRCBbIDw0MDJjNDE5YjU1N2U4MTRkOTA1MTdiOGZhZDAxYWZk
+	Mz4KPDQwMmM0MTliNTU3ZTgxNGQ5MDUxN2I4ZmFkMDFhZmQzPiBdID4+CnN0YXJ0eHJl
+	Zgo1MjgxNQolJUVPRgoxIDAgb2JqCjw8L0F1dGhvciAoUm9iZXJ0IEx5KS9DcmVhdGlv
+	bkRhdGUgKEQ6MjAxMTA5MTkxNzE1MDBaKS9DcmVhdG9yIChPbW5pR3JhZmZsZSBQcm9m
+	ZXNzaW9uYWwgNS4zLjIpL01vZERhdGUgKEQ6MjAxMTExMDcxOTEwMDBaKS9Qcm9kdWNl
+	ciA3NiAwIFIgL1RpdGxlIChyc19jb21wdXRlKT4+CmVuZG9iagp4cmVmCjEgMQowMDAw
+	MDU0NTMzIDAwMDAwIG4gCnRyYWlsZXIKPDwvSUQgWzw0MDJjNDE5YjU1N2U4MTRkOTA1
+	MTdiOGZhZDAxYWZkMz4gPDQwMmM0MTliNTU3ZTgxNGQ5MDUxN2I4ZmFkMDFhZmQzPl0g
+	L0luZm8gMSAwIFIgL1ByZXYgNTI4MTUgL1Jvb3QgNjEgMCBSIC9TaXplIDc4Pj4Kc3Rh
+	cnR4cmVmCjU0NzEwCiUlRU9GCg==
+	</data>
+	<key>QuickLookThumbnail</key>
+	<data>
+	TU0AKgAAEs6AP+BP8AQWDQeEQmFQuGQ2HQ+IRGJROKRWLReMRmNRuOR2KQOCR6RSOSSW
+	TSeUSmVSuJSCWS+YTGZTOaTWVS6bTmdTueT2fRucT+hUOiUWjSd9Ul/uKmAACU+j1GWP
+	2qAARVepVmtQ5511/vKwAAGWOEAGzACB0WzAG0QK1We0xN4XMAB67Vu8XmCvS+P+5vCx
+	WSaWu2yGh4S4y93YsACHHXrIVm+PS/XQF5cAYi3YO4ZuDZrDTLQWXO6GKO/UY3H5HWUX
+	Jv/UO8AZcFxTRwvCOPdAAO73CgDFu4ABLiQh28fM2d78sAZMACfocm2YmE6PCcEABHtS
+	PbwbY1asa3xT/X9ixgzfwfraXpb+0l34AAq/MAOb7e0G2Rzuh0AAJv+AB8QEAALwKAAS
+	QQABmwWAB/QcABwQiAAMQoAAHQuABuQ03jfKSfQAAHEIABbEgAB2HQdLQz72PU9j1rY7
+	ARxkkcBHxBsHvHHKGHzHjmr67AFSC9rqSGtzuoKfckgAsB5AAe0nxBER4ynCcKnVK8LQ
+	xKZ4gAC0vSyBwAHTMYAHrMwAARNKnKgfk2gBJJ9gBIIFR8ej/QAqh+gACs+SKgkjz9QL
+	vwQEiOLSa9ET3PqgSMs6iLSwlHrdD06n+452zlISH0BFrp0bTzTU4iVRILF70xXUCMVI
+	AC/wPBKNzafgAGxWkOA6mtVp1XKS0o152V+2bMIWfB9oJHFIoNIjrRa39TIXZVHWSz1S
+	xdZlIRdaKEn6fyCAKAaCgOAq2IOtNWhLc6OVjWdag5dtAo2Vl4oQFF6ABX52ABHh8zuC
+	co2/PN/IQ74BYJG5/S7L5d4UAAr4aABw4gAEtsC9F1Afi4AXUGuNtJVKL16vp15FYLay
+	IaZ0ANBoGTotrkoKwy2XHFVS2Sz9m5kzObvUhlr5fm2ZZhmuaZ7m2iaGgwFnxOwSApWT
+	R4nc4S3TN1EGuAAN6xjtT2pjyFF7r4AN0cYAYuB4AK6eeMzdC8w0pdoOQzDYNbnsmMGH
+	u4ABdvVbAAaW/YQCwAHJwYAAbw0wAA/j+7LwXCDTx6GUBQE4UrK51ZIhhuHgA4AH0Bb0
+	Z26aEJDoOfZpnPRdJm1VZy03VdPmec9RFXX9kh4DnrJoRghONrrZqF0VhqlE6wDet0DU
+	0iU7m+ceZ47CSZxHfeP5fp3JT/n2xVLCZAykxnSAAE/FQJvHkBPOgWBueJDbOd9NyOhd
+	s0yJs39vV9i3H46AhgDHnLgIgIL7WQQViZ0ATtTVkNaBQAG5gadGtN5D2oHp/gk9YhS0
+	HtwSevBSDMHX1qhgqW5dRr3FKZTo9Mbg8Xzj6AU+pcj935vyhgQpmQ6RzNjAuBpW4+R8
+	D3TKPRtIEgKOBHVDc/wGHjADYLDF/bsImP6guQYBA9UuO7X3BtJZYV6AogQAAasXwAAZ
+	jEQwd49Xfj7AIAAASKnkvYgwy8gkMTcPtenHWN0EFIlujlDQ5Q+WDgmAsno0cIy+n2HM
+	5ghcKXzj5ha/eF7NFHQQNJHB2AmxEB5T2BluABwEPnAUAxMI5hwjcMyAKNIGAOAfOGBY
+	C6IwbA+Zcy1yK436vxfe82KZsndofem9GLcXRqTBjDGMhY4R2xrHkAoCRmVvuzji+99z
+	+FqTQdK6OGbp2Yu0mhNdZj+JqyPdkP4eyHwXAQSbFiQhlByzrcxCgeKdB8AKTCpB2UtI
+	7wcdNM+SC4x4DtHWksd6+AEyfAAVRg4BQDspH8m4dQ5WxgeBMCksQDgIQRloz5oMkXsT
+	WTkPcwAIgHo2IW9EFNJZgTCQoBh445h5LfHOAJfpZo9yxdi82WT9o3PXOrPYhq0ZvyUp
+	otJIdOj1FJAADECKXJBpuNfOscsJoJgAG6PI2s8WzRYn3UCjSf561ap5LGCxCTEsxq/V
+	t2bsn61lntPgBQ9jZUgRtL0sIKq6RdGnXdAiBiDnOpYt8dgCZVABjWAAe49U7DyHc5cC
+	4HARHVq8QUfJzACAGc4iGNY5BuNWAQ58AAFAMq3pqQUec/XCgQX7RyvY8jZAJAY2YfQ+
+	B7AAk4nSHkPgErCJCPW0Zs6KOmAGPtfYNgKpcIW5Q17gxyVQemNseCdB7gJquuMAQ818
+	FsT1A+adN61VAVRN5+cTag2Pu1eIzY/U4ogALQUBwGZKALHvLoCFIiFPRBXfUiCNapDd
+	G64Vw7AFaDYX4e0b+Azmj+PQAkFIRY1ACLYMsXwsU9gblUNcZgwzkxrHWOUcAAAPgoBe
+	c2xFBR9qyAaBECkR24YZw2OwdA4rOgYA84kcUpARgsBpVIagzAAAQArewBtpl82wxEnH
+	E1KhwDaGkhYCIFSrAqBkY0FAMQADFFwKg4A6angiBWDMAALwdhHliAO14AAcgXuIQp7o
+	/7kPhfGQsbY8Ta3PoqQcFI4BYGNAVFcyE1Yny3ISNcfeJxvgbCGzUBdbgAO7h9FhtAAA
+	WaPIhCV8T53GLqruNOzoFMTkHYAN4dSshxACBAqUglsE7DxHaf0fo/E44/yYPYehgB1D
+	kG8gQDzUrzIfAGAS9NrEwzZH1ZFjI+0PwDTfsRgMnT0YjQ+Pa3YEwLq3GuMsX6BwXA5l
+	LGu18PgD2cHmO18BhANAjBXJQA4/UPg8AycK4qSjXtizY+fN1zUygJAiQgFw5hbmNf6S
+	/PkNIoEqGqP2Vo3ALhAkoA0fBwtFEM0bo8FhEDsFPjS2xtSsm/ZJ01pshQ4x4xpGmPPJ
+	karuSOii7CtD7LwP6vBV+aKz5HXbm3TVcYCR/I2CCBw2T07jF9KZi7SZDM3m1HqAiZbP
+	gXjjzuCEAe7FpT4JM9atPJSK0auyQYapdQADbAyER0/ClMAjAfoshWjUSAt4kYzijiF1
+	DR7dgGYo770jRHpyOnzP61wzmzPqGT1TQ59tDWaJ0zrQzbM1C8BfNwABDA904hPPTKMQ
+	HDvHoQ8T0DzAPvdmQMRwCpMa4khAiBVC+NmuFNa3wFemAoA49A4h1GyW2wcDoFaKgLAQ
+	ykBgCXODPG7U8DgFKKjxHrD4HoKwQgAGsOJ8CxFZGG+Gvsfa20ugQPQO8elsQigxgOBg
+	CMLiDDTAICbrYHAkkIAcPlTAJAIQ+SIc7s/aThdr4t23t5xOjkKHaPSNY4h5AIAAAKAI
+	dc4ArFAG8KtQvAsitik6ZYls5M5m76dsnAvAAMACT0BOAqQ+3aTiNewGG+uUggG2HkTC
+	Ho8yIQBkG6FCKsH6uSIOGyHIn+WIT0Hg+GtkKgHmHwQ+W8LYHyH4T0BCAs3uHIHaSaAc
+	9Sc6+iAAGyHMXwBWA6cCA+AqbMGqHEn+H4QeAsAeNqHpBwsIH0VkAfCNBwVkBYA+cCAk
+	9yIQGmAS7QG0A+CelkAcHwXw7EHqLKIMHmL4y6Bew+Ie4mKg/mTcGhEEOyO2IuV26qRY
+	IcUuwDEONtETEQVSnSH+G9Eo8oIWG0HjBG6MdMBmG4E80SH4w2Iw3+Iy5aJZDUykGuA+
+	Cim0AiHyXwpBDqIWTNDrD3D4IdD84qQwXUGfF7EI3u78pmIdEaImNHEWP+tPGHEeI5GI
+	INElEo1qTS/8zdBEbOAOX6LSBqGuEu0SH0G2Iy6mlkm7HCJ6GkAaBsAAGuBECzFaH1Fg
+	AcTsIWHsTOBeBgBg/gTXF0TCXUGdH6x2AgzmIsVWjbGEIaVbGgAABlIUXej4g8eUI8qW
+	VkNev0v3GkUDEwbMHkAM6OLOBAGuFIQIH+Xwpu4CaGo3HCj0IOW4mwwYz9Aejmm0myz8
+	HGAO+OHKBECcdmAiH0cu7ETsNHFoqOBiylD67VD/F2TdH6GcbqbNGaJIckPYHPKkAAFv
+	KqAADFKwJPKga6IrEkQ0lJItGo+CANGxJO5UI+o26ePaIOtGUw14ZSAQoIjzLOfpLSjg
+	6gIUAlJ4KsAcbTFmTPIUyfKK/jKPH2TcQWGacQeWHqHyNlC8tiLMsGJ6YASeh8cMdAKH
+	B4tiAuAcBGePEkG3NC8oSJEwoqHgAKtOXG72qImim+iaZg5WOaHiNkKevSs2PRNWqFDt
+	Jc8G5pAaZoAmH0fA/UTsemOcBnORHw/lKQVkGZOdKYeOHaHywAAUA6GIjUZwpsdpLpHI
+	hlO7EMijJRLo8HO+IYHuHibNFcCsec8gH/NDG+APPiUCGyHjLG5HO2p3FMiwWzP1LUHS
+	HGv2H+H8T0AyBA/EkkWQp+aNAgeaSIAoH3J6AenOu6OcBpQtOVMK4uABOcx0POUCHkH0
+	1qAIAyF6uyjwLhAcPSLPP6qwu67+hAdE5RLUZdRZRmIMH0Ho3ugCCoUDEkG1R+tlPlEu
+	Hk3uHcAIxOmyAKHkxc2MJUmyHOHCGyZsAyA/QOmkJOvMmmH0Ae+OmeAqH3OGAgbSSISe
+	tjQsxvMHHy7YTdQ4kQvnRCIKAqF2a0Z4m5O0dUq5NVNbHAmu74kgdPQET/Ja8GH0Hq3u
+	AmH2CqIYYANeGzUcTQTUenPooqHaAIyYZkB0HcFoAABQAfAyz2m5T3RkQUHoX6GiAeB+
+	IQaaP6BIAdQmISOWh9TPQxH1Q0GXVvTcISHiHzQCApTmEgD+wsk0TC2g0oAgToHOHISa
+	1WIIxMfPUCP8AuTo2CT0f8+gHyT09iP8AsNqc+ZSHcHYtjWgHgHcRslQfUh4Vkt0Q+Ae
+	Ai/8oo/8GgGSkOsWPQAUASZSn9DqAKAMW+AkAqTow0S4CYCwBUMyH4yYAoH7UUnQqYL6
+	v/Ug/8SJPomWHcAKyYM2B+HgFmOeAVVfN4jlFJEM5lAlN/QYISGYHugcGcAeCCIQAuH7
+	VZQkqjViAAY2BrVpTWVkGVZ4qgpGH3A8H6AgF0AAHEG8MAlES4AaAec4lAc4huSa14jW
+	AhXcoKH61KHuacsGAgAkfOGUGCxcBaBmvYAeAk/8HaHVDqh6T1Xac5XAh9NmRsAmAqfO
+	KoIIlAZSAqAufVWTWWQeAaAcc4FqFUasB8CM+PbmPQHYHUTsBgBweMH+HyxOAoH9R4NH
+	UYL6gUGtSCc4NGG0HkxPUq7sIKB+HWFZU4AOUwIWFqGSGow4AsmWA9CAZqG4HMUwBKA2
+	xOwYLYHvC8LEAQvSHtB4OAHmtiAkAafOHW+EKsAyX6HoHuX2HSHebS9svS+otoH0TiHn
+	d6Mbea5MGUH01GGWAdZcMJQeqeBHVcIYvxZuIhEWNpZ0AAGTfnA+nxV21qH0AbaIkiml
+	JktCmff9ZKz9gBAimsVDZPgJTvTtJiZyH4HwmWAwADPW543dcygXPic5YmHiX6HYAIla
+	IOCCHSFKAABSAIkOscEcFgwsHKHabTDAc4AlCKAAGAGk1qBndwRAYKQcYO9veDC49mbM
+	FsGYG0AACcBsi490vSHcHktiF0GilIBiBEgcAIYKHkHuRtiigcCgBy3LSuGOH4akF+AF
+	ZwZ8AsH8cuBAAbY+LSX1ITIWIfTKNU+ORCW+XVfmGTYiUCHiH1A8HyAWFyvCa1Iea4Wb
+	ZNKdkEklRcSNkNGXgcmWAyAFPWeXEki+6yANkua1PoxOHWAIcCIOCEHKE/hIADFFgFSv
+	ZOqi2NDEVYHrXMAidAz6G6HOl0AzGBlMfmGSAHHuGYAxFYZmAwH7fQAcMAWGQGBxmOi6
+	GRmVc4IZRAP6HsH8wAAEREm88DUBkXRrJfAG5W75Jk7zf8p/m0XIH6ToAwAVjJLVcwMo
+	0vjySIGxdAAAHWAGpUZaCIHHG4BUH8lIR0I4GQAKBuAAGWA2CuN+A0H+kOBGAaNk2NZq
+	Bzoci6GPojjyWfkTPyqjGDIZkJopILLXRtkIjtRgg+IgMJnUH+4zonLUGyHkyYHVnmZq
+	BcG+FGN4H+P7T5N7N3ANgXAJpuIsG0AIUKG2A7l8INoNoQAaOENHjboc2weEVloiGOAB
+	kuZSjevHo2osedP3GXLm6urEnvqvqzK5LXPLGdYcMoGkGiySsoZSeWGuHiyYHSAClbII
+	scmclrp3gLDtIdq9N273rtAOp6ZyA2zUQOAc52ghjaRQRSUYIJF6GebOK6YNkRo5rnEb
+	rmU2hCnxkHsloyIYTmUrEEGhnaewGxrccSAFnpNdJKdqm6qI6spofntTZBAepxO5PGII
+	A2H8uSBKAfsMnwvwB3uBn5uEJoNftBmYixracCHSAEvZZFAMdLNWdqiaMQZnO5VDZFT0
+	dTtkqGdeVuuTVaUwNGUpuAB3uHvMJgNfsbqjkwIWG/PQOaLEaE7vpvNjvpZM5evFufVD
+	p1lPT+AgACSaA4AabTvEqMB5wPvPwSJUNfKVuOgvRPQbwhqxLUWdwfpDRbo/LsecrDou
+	u6iwUoB7xDwVxGJNFoH/mUGRvXqnwlrBw3wknoRXxdwvwpsxs3Ozr1xnLuUCYACBx7xJ
+	x+JFh3poP5TVyANYALyRH/IDyNyYIsKDybyhyjyk6fo5ynytyuPHyfyxy3y5yzs1y7zB
+	zCKPy1zFzLzMKFzJzPzVzWJoICAADgEAAAMAAAABAF0AAAEBAAMAAAABADYAAAECAAMA
+	AAAEAAATfAEDAAMAAAABAAUAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAESAAMAAAAB
+	AAEAAAEVAAMAAAABAAQAAAEWAAMAAAABADYAAAEXAAQAAAABAAASxgEcAAMAAAABAAEA
+	AAE9AAMAAAABAAIAAAFSAAMAAAABAAEAAAFTAAMAAAAEAAAThAAAAAAACAAIAAgACAAB
+	AAEAAQAB
+	</data>
+	<key>ReadOnly</key>
+	<string>NO</string>
+	<key>RowAlign</key>
+	<integer>1</integer>
+	<key>RowSpacing</key>
+	<real>36</real>
+	<key>SheetTitle</key>
+	<string>Canvas 1</string>
+	<key>SmartAlignmentGuidesActive</key>
+	<string>YES</string>
+	<key>SmartDistanceGuidesActive</key>
+	<string>YES</string>
+	<key>UniqueID</key>
+	<integer>1</integer>
+	<key>UseEntirePage</key>
+	<false/>
+	<key>VPages</key>
+	<integer>1</integer>
+	<key>WindowInfo</key>
+	<dict>
+		<key>CurrentSheet</key>
+		<integer>0</integer>
+		<key>ExpandedCanvases</key>
+		<array>
+			<dict>
+				<key>name</key>
+				<string>Canvas 1</string>
+			</dict>
+		</array>
+		<key>Frame</key>
+		<string>{{67, 91}, {969, 926}}</string>
+		<key>ListView</key>
+		<true/>
+		<key>OutlineWidth</key>
+		<integer>142</integer>
+		<key>RightSidebar</key>
+		<false/>
+		<key>ShowRuler</key>
+		<true/>
+		<key>Sidebar</key>
+		<true/>
+		<key>SidebarWidth</key>
+		<integer>120</integer>
+		<key>VisibleRegion</key>
+		<string>{{-129, -19}, {834, 772}}</string>
+		<key>Zoom</key>
+		<real>1</real>
+		<key>ZoomValues</key>
+		<array>
+			<array>
+				<string>Canvas 1</string>
+				<real>1</real>
+				<real>1</real>
+			</array>
+		</array>
+	</dict>
+	<key>saveQuickLookFiles</key>
+	<string>YES</string>
+</dict>
+</plist>
diff --git a/docs/html/images/rs_compute.png b/docs/html/images/rs_compute.png
new file mode 100644
index 0000000..263b2ec
--- /dev/null
+++ b/docs/html/images/rs_compute.png
Binary files differ
diff --git a/docs/html/images/rs_graphics.graffle b/docs/html/images/rs_graphics.graffle
new file mode 100644
index 0000000..5dee4c6
--- /dev/null
+++ b/docs/html/images/rs_graphics.graffle
@@ -0,0 +1,3107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>ActiveLayerIndex</key>
+	<integer>0</integer>
+	<key>ApplicationVersion</key>
+	<array>
+		<string>com.omnigroup.OmniGrafflePro</string>
+		<string>138.28.0.154505</string>
+	</array>
+	<key>AutoAdjust</key>
+	<true/>
+	<key>BackgroundGraphic</key>
+	<dict>
+		<key>Bounds</key>
+		<string>{{0, 0}, {576, 733}}</string>
+		<key>Class</key>
+		<string>SolidGraphic</string>
+		<key>ID</key>
+		<integer>2</integer>
+		<key>Style</key>
+		<dict>
+			<key>shadow</key>
+			<dict>
+				<key>Draws</key>
+				<string>NO</string>
+			</dict>
+			<key>stroke</key>
+			<dict>
+				<key>Draws</key>
+				<string>NO</string>
+			</dict>
+		</dict>
+	</dict>
+	<key>CanvasOrigin</key>
+	<string>{0, 0}</string>
+	<key>ColumnAlign</key>
+	<integer>1</integer>
+	<key>ColumnSpacing</key>
+	<real>36</real>
+	<key>CreationDate</key>
+	<string>2011-09-19 10:15:24 -0700</string>
+	<key>Creator</key>
+	<string>Robert Ly</string>
+	<key>DisplayScale</key>
+	<string>1 0/72 in = 1.0000 in</string>
+	<key>GraphDocumentVersion</key>
+	<integer>6</integer>
+	<key>GraphicsList</key>
+	<array>
+		<dict>
+			<key>Bounds</key>
+			<string>{{95.9835, 355}, {107.033, 31}}</string>
+			<key>Class</key>
+			<string>ShapedGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Color</key>
+				<dict>
+					<key>b</key>
+					<string>0</string>
+					<key>g</key>
+					<string>0</string>
+					<key>r</key>
+					<string>0</string>
+				</dict>
+				<key>Font</key>
+				<string>Helvetica-Bold</string>
+				<key>Size</key>
+				<real>10</real>
+			</dict>
+			<key>ID</key>
+			<integer>155</integer>
+			<key>Line</key>
+			<dict>
+				<key>ID</key>
+				<integer>246</integer>
+				<key>Position</key>
+				<real>0.19373114407062531</real>
+				<key>RotationType</key>
+				<integer>0</integer>
+			</dict>
+			<key>Magnets</key>
+			<array>
+				<string>{1, 1}</string>
+				<string>{1, -1}</string>
+				<string>{-1, -1}</string>
+				<string>{-1, 1}</string>
+				<string>{0, 1}</string>
+				<string>{0, -1}</string>
+				<string>{1, 0}</string>
+				<string>{-1, 0}</string>
+				<string>{-0.5, -0.233518}</string>
+				<string>{-0.491442, 0.260063}</string>
+				<string>{0.507118, -0.224086}</string>
+				<string>{0.507118, 0.267179}</string>
+				<string>{-0.27431, -0.474028}</string>
+				<string>{0.27978, -0.478478}</string>
+				<string>{0.293938, 0.543044}</string>
+				<string>{-0.286232, 0.553804}</string>
+			</array>
+			<key>Shape</key>
+			<string>Rectangle</string>
+			<key>Style</key>
+			<dict>
+				<key>fill</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.938075</string>
+						<key>g</key>
+						<string>0.938269</string>
+						<key>r</key>
+						<string>0.938154</string>
+					</dict>
+					<key>FillType</key>
+					<integer>2</integer>
+					<key>GradientAngle</key>
+					<real>90</real>
+					<key>GradientColor</key>
+					<dict>
+						<key>b</key>
+						<string>0.727869</string>
+						<key>g</key>
+						<string>0.728019</string>
+						<key>r</key>
+						<string>0.72793</string>
+					</dict>
+				</dict>
+				<key>shadow</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.35</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>Fuzziness</key>
+					<real>2.3972222805023193</real>
+					<key>ShadowVector</key>
+					<string>{0, 1}</string>
+				</dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.472997</string>
+						<key>g</key>
+						<string>0.473094</string>
+						<key>r</key>
+						<string>0.473036</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>3</real>
+				</dict>
+			</dict>
+			<key>Text</key>
+			<dict>
+				<key>Text</key>
+				<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 bindRootScript()}</string>
+				<key>VerticalPad</key>
+				<integer>0</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Bounds</key>
+			<string>{{71, 431.245}, {157, 24}}</string>
+			<key>Class</key>
+			<string>ShapedGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Color</key>
+				<dict>
+					<key>b</key>
+					<string>0</string>
+					<key>g</key>
+					<string>0</string>
+					<key>r</key>
+					<string>0</string>
+				</dict>
+				<key>Font</key>
+				<string>DroidSans-Bold</string>
+				<key>Size</key>
+				<real>10</real>
+			</dict>
+			<key>ID</key>
+			<integer>247</integer>
+			<key>Magnets</key>
+			<array>
+				<string>{1, 1}</string>
+				<string>{1, -1}</string>
+				<string>{-1, -1}</string>
+				<string>{-1, 1}</string>
+				<string>{0, 1}</string>
+				<string>{0, -1}</string>
+				<string>{1, 0}</string>
+				<string>{-1, 0}</string>
+				<string>{-0.5, -0.233518}</string>
+				<string>{-0.491442, 0.260063}</string>
+				<string>{0.507118, -0.224086}</string>
+				<string>{0.507118, 0.267179}</string>
+				<string>{-0.27431, -0.474028}</string>
+				<string>{0.27978, -0.478478}</string>
+				<string>{0.293938, 0.543044}</string>
+				<string>{-0.286232, 0.553804}</string>
+			</array>
+			<key>Shape</key>
+			<string>Rectangle</string>
+			<key>Style</key>
+			<dict>
+				<key>fill</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.628571</string>
+						<key>g</key>
+						<string>0.768599</string>
+						<key>r</key>
+						<string>1</string>
+					</dict>
+					<key>FillType</key>
+					<integer>2</integer>
+					<key>GradientAngle</key>
+					<real>90</real>
+					<key>GradientColor</key>
+					<dict>
+						<key>b</key>
+						<string>0.236788</string>
+						<key>g</key>
+						<string>0.532236</string>
+						<key>r</key>
+						<string>0.990271</string>
+					</dict>
+				</dict>
+				<key>shadow</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.35</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>Fuzziness</key>
+					<real>2.3972222805023193</real>
+					<key>ShadowVector</key>
+					<string>{0, 1}</string>
+				</dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.131021</string>
+						<key>g</key>
+						<string>0.363196</string>
+						<key>r</key>
+						<string>0.725948</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>3</real>
+				</dict>
+			</dict>
+			<key>Text</key>
+			<dict>
+				<key>Text</key>
+				<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 Renderscript object}</string>
+				<key>VerticalPad</key>
+				<integer>0</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Bounds</key>
+			<string>{{71, 306.83}, {157, 24}}</string>
+			<key>Class</key>
+			<string>ShapedGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Color</key>
+				<dict>
+					<key>b</key>
+					<string>0</string>
+					<key>g</key>
+					<string>0</string>
+					<key>r</key>
+					<string>0</string>
+				</dict>
+				<key>Font</key>
+				<string>DroidSans-Bold</string>
+				<key>Size</key>
+				<real>10</real>
+			</dict>
+			<key>ID</key>
+			<integer>200</integer>
+			<key>Magnets</key>
+			<array>
+				<string>{1, 1}</string>
+				<string>{1, -1}</string>
+				<string>{-1, -1}</string>
+				<string>{-1, 1}</string>
+				<string>{0, 1}</string>
+				<string>{0, -1}</string>
+				<string>{1, 0}</string>
+				<string>{-1, 0}</string>
+				<string>{-0.5, -0.233518}</string>
+				<string>{-0.491442, 0.260063}</string>
+				<string>{0.507118, -0.224086}</string>
+				<string>{0.507118, 0.267179}</string>
+				<string>{-0.27431, -0.474028}</string>
+				<string>{0.27978, -0.478478}</string>
+				<string>{0.293938, 0.543044}</string>
+				<string>{-0.286232, 0.553804}</string>
+			</array>
+			<key>Shape</key>
+			<string>Rectangle</string>
+			<key>Style</key>
+			<dict>
+				<key>fill</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.628571</string>
+						<key>g</key>
+						<string>0.768599</string>
+						<key>r</key>
+						<string>1</string>
+					</dict>
+					<key>FillType</key>
+					<integer>2</integer>
+					<key>GradientAngle</key>
+					<real>90</real>
+					<key>GradientColor</key>
+					<dict>
+						<key>b</key>
+						<string>0.236788</string>
+						<key>g</key>
+						<string>0.532236</string>
+						<key>r</key>
+						<string>0.990271</string>
+					</dict>
+				</dict>
+				<key>shadow</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.35</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>Fuzziness</key>
+					<real>2.3972222805023193</real>
+					<key>ShadowVector</key>
+					<string>{0, 1}</string>
+				</dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.131021</string>
+						<key>g</key>
+						<string>0.363196</string>
+						<key>r</key>
+						<string>0.725948</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>3</real>
+				</dict>
+			</dict>
+			<key>Text</key>
+			<dict>
+				<key>Text</key>
+				<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 RenderscriptGL context}</string>
+				<key>VerticalPad</key>
+				<integer>0</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Class</key>
+			<string>LineGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Font</key>
+				<string>DroidSans</string>
+				<key>Size</key>
+				<real>11</real>
+			</dict>
+			<key>Head</key>
+			<dict>
+				<key>ID</key>
+				<integer>247</integer>
+				<key>Info</key>
+				<integer>8</integer>
+			</dict>
+			<key>ID</key>
+			<integer>246</integer>
+			<key>OrthogonalBarAutomatic</key>
+			<false/>
+			<key>OrthogonalBarPoint</key>
+			<string>{0, 0}</string>
+			<key>OrthogonalBarPosition</key>
+			<real>36</real>
+			<key>Points</key>
+			<array>
+				<string>{149.5, 330.83}</string>
+				<string>{71, 443.245}</string>
+			</array>
+			<key>Style</key>
+			<dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.7</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>4</real>
+					<key>HeadArrow</key>
+					<string>Ball</string>
+					<key>LineType</key>
+					<integer>2</integer>
+					<key>TailArrow</key>
+					<string>0</string>
+				</dict>
+			</dict>
+			<key>Tail</key>
+			<dict>
+				<key>ID</key>
+				<integer>200</integer>
+				<key>Info</key>
+				<integer>5</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Class</key>
+			<string>LineGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Font</key>
+				<string>DroidSans</string>
+				<key>Size</key>
+				<real>11</real>
+			</dict>
+			<key>Head</key>
+			<dict>
+				<key>ID</key>
+				<integer>202</integer>
+				<key>Info</key>
+				<integer>6</integer>
+			</dict>
+			<key>ID</key>
+			<integer>245</integer>
+			<key>OrthogonalBarAutomatic</key>
+			<false/>
+			<key>OrthogonalBarPoint</key>
+			<string>{0, 0}</string>
+			<key>OrthogonalBarPosition</key>
+			<real>4.1290435791015625</real>
+			<key>Points</key>
+			<array>
+				<string>{149.5, 236.415}</string>
+				<string>{149.5, 266.076}</string>
+			</array>
+			<key>Style</key>
+			<dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.7</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>4</real>
+					<key>HeadArrow</key>
+					<string>Ball</string>
+					<key>LineType</key>
+					<integer>2</integer>
+					<key>TailArrow</key>
+					<string>0</string>
+				</dict>
+			</dict>
+			<key>Tail</key>
+			<dict>
+				<key>ID</key>
+				<integer>235</integer>
+				<key>Info</key>
+				<integer>5</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Class</key>
+			<string>LineGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Font</key>
+				<string>DroidSans</string>
+				<key>Size</key>
+				<real>11</real>
+			</dict>
+			<key>Head</key>
+			<dict>
+				<key>ID</key>
+				<integer>251</integer>
+				<key>Info</key>
+				<integer>8</integer>
+			</dict>
+			<key>ID</key>
+			<integer>242</integer>
+			<key>OrthogonalBarAutomatic</key>
+			<false/>
+			<key>OrthogonalBarPoint</key>
+			<string>{0, 0}</string>
+			<key>OrthogonalBarPosition</key>
+			<real>57</real>
+			<key>Points</key>
+			<array>
+				<string>{228, 443.245}</string>
+				<string>{344.75, 303.184}</string>
+			</array>
+			<key>Style</key>
+			<dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.7</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>4</real>
+					<key>HeadArrow</key>
+					<string>Ball</string>
+					<key>LineType</key>
+					<integer>2</integer>
+					<key>TailArrow</key>
+					<string>0</string>
+				</dict>
+			</dict>
+			<key>Tail</key>
+			<dict>
+				<key>ID</key>
+				<integer>247</integer>
+				<key>Info</key>
+				<integer>7</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Bounds</key>
+			<string>{{54.5, 266.076}, {190, 73.3394}}</string>
+			<key>Class</key>
+			<string>ShapedGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Color</key>
+				<dict>
+					<key>b</key>
+					<string>0</string>
+					<key>g</key>
+					<string>0</string>
+					<key>r</key>
+					<string>0</string>
+				</dict>
+				<key>Font</key>
+				<string>DroidSans-Bold</string>
+				<key>Size</key>
+				<real>10</real>
+			</dict>
+			<key>ID</key>
+			<integer>202</integer>
+			<key>Magnets</key>
+			<array>
+				<string>{1, 1}</string>
+				<string>{1, -1}</string>
+				<string>{-1, -1}</string>
+				<string>{-1, 1}</string>
+				<string>{0, 1}</string>
+				<string>{0, -1}</string>
+				<string>{1, 0}</string>
+				<string>{-1, 0}</string>
+				<string>{-0.5, -0.233518}</string>
+				<string>{-0.491442, 0.260063}</string>
+				<string>{0.507118, -0.224086}</string>
+				<string>{0.507118, 0.267179}</string>
+				<string>{-0.27431, -0.474028}</string>
+				<string>{0.27978, -0.478478}</string>
+				<string>{0.293938, 0.543044}</string>
+				<string>{-0.286232, 0.553804}</string>
+			</array>
+			<key>Shape</key>
+			<string>Rectangle</string>
+			<key>Style</key>
+			<dict>
+				<key>fill</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>1</string>
+						<key>g</key>
+						<string>0.874135</string>
+						<key>r</key>
+						<string>0.71718</string>
+					</dict>
+					<key>FillType</key>
+					<integer>2</integer>
+					<key>GradientAngle</key>
+					<real>90</real>
+					<key>GradientColor</key>
+					<dict>
+						<key>b</key>
+						<string>1</string>
+						<key>g</key>
+						<string>0.662438</string>
+						<key>r</key>
+						<string>0.464468</string>
+					</dict>
+				</dict>
+				<key>shadow</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.35</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>Fuzziness</key>
+					<real>2.3972222805023193</real>
+					<key>ShadowVector</key>
+					<string>{0, 1}</string>
+				</dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.93512</string>
+						<key>g</key>
+						<string>0.472602</string>
+						<key>r</key>
+						<string>0.333854</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>3</real>
+				</dict>
+			</dict>
+			<key>Text</key>
+			<dict>
+				<key>Text</key>
+				<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 RsSurfaceView or RsTextureView\
+\
+}</string>
+				<key>VerticalPad</key>
+				<integer>0</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Bounds</key>
+			<string>{{54.5, 186.245}, {190, 50.1697}}</string>
+			<key>Class</key>
+			<string>ShapedGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Color</key>
+				<dict>
+					<key>b</key>
+					<string>0</string>
+					<key>g</key>
+					<string>0</string>
+					<key>r</key>
+					<string>0</string>
+				</dict>
+				<key>Font</key>
+				<string>DroidSans-Bold</string>
+				<key>Size</key>
+				<real>10</real>
+			</dict>
+			<key>ID</key>
+			<integer>235</integer>
+			<key>Magnets</key>
+			<array>
+				<string>{1, 1}</string>
+				<string>{1, -1}</string>
+				<string>{-1, -1}</string>
+				<string>{-1, 1}</string>
+				<string>{0, 1}</string>
+				<string>{0, -1}</string>
+				<string>{1, 0}</string>
+				<string>{-1, 0}</string>
+				<string>{-0.5, -0.233518}</string>
+				<string>{-0.491442, 0.260063}</string>
+				<string>{0.507118, -0.224086}</string>
+				<string>{0.507118, 0.267179}</string>
+				<string>{-0.27431, -0.474028}</string>
+				<string>{0.27978, -0.478478}</string>
+				<string>{0.293938, 0.543044}</string>
+				<string>{-0.286232, 0.553804}</string>
+			</array>
+			<key>Shape</key>
+			<string>Rectangle</string>
+			<key>Style</key>
+			<dict>
+				<key>fill</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>1</string>
+						<key>g</key>
+						<string>0.874135</string>
+						<key>r</key>
+						<string>0.71718</string>
+					</dict>
+					<key>FillType</key>
+					<integer>2</integer>
+					<key>GradientAngle</key>
+					<real>90</real>
+					<key>GradientColor</key>
+					<dict>
+						<key>b</key>
+						<string>1</string>
+						<key>g</key>
+						<string>0.662438</string>
+						<key>r</key>
+						<string>0.464468</string>
+					</dict>
+				</dict>
+				<key>shadow</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.35</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>Fuzziness</key>
+					<real>2.3972222805023193</real>
+					<key>ShadowVector</key>
+					<string>{0, 1}</string>
+				</dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.93512</string>
+						<key>g</key>
+						<string>0.472602</string>
+						<key>r</key>
+						<string>0.333854</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>3</real>
+				</dict>
+			</dict>
+			<key>Text</key>
+			<dict>
+				<key>Text</key>
+				<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 Activity}</string>
+				<key>VerticalPad</key>
+				<integer>0</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Bounds</key>
+			<string>{{54.5, 401.585}, {190, 68}}</string>
+			<key>Class</key>
+			<string>ShapedGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Color</key>
+				<dict>
+					<key>b</key>
+					<string>0</string>
+					<key>g</key>
+					<string>0</string>
+					<key>r</key>
+					<string>0</string>
+				</dict>
+				<key>Font</key>
+				<string>DroidSans-Bold</string>
+				<key>Size</key>
+				<real>10</real>
+			</dict>
+			<key>ID</key>
+			<integer>234</integer>
+			<key>Magnets</key>
+			<array>
+				<string>{1, 1}</string>
+				<string>{1, -1}</string>
+				<string>{-1, -1}</string>
+				<string>{-1, 1}</string>
+				<string>{0, 1}</string>
+				<string>{0, -1}</string>
+				<string>{1, 0}</string>
+				<string>{-1, 0}</string>
+				<string>{-0.5, -0.233518}</string>
+				<string>{-0.491442, 0.260063}</string>
+				<string>{0.507118, -0.224086}</string>
+				<string>{0.507118, 0.267179}</string>
+				<string>{-0.27431, -0.474028}</string>
+				<string>{0.27978, -0.478478}</string>
+				<string>{0.293938, 0.543044}</string>
+				<string>{-0.286232, 0.553804}</string>
+			</array>
+			<key>Shape</key>
+			<string>Rectangle</string>
+			<key>Style</key>
+			<dict>
+				<key>fill</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>1</string>
+						<key>g</key>
+						<string>0.874135</string>
+						<key>r</key>
+						<string>0.71718</string>
+					</dict>
+					<key>FillType</key>
+					<integer>2</integer>
+					<key>GradientAngle</key>
+					<real>90</real>
+					<key>GradientColor</key>
+					<dict>
+						<key>b</key>
+						<string>1</string>
+						<key>g</key>
+						<string>0.662438</string>
+						<key>r</key>
+						<string>0.464468</string>
+					</dict>
+				</dict>
+				<key>shadow</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.35</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>Fuzziness</key>
+					<real>2.3972222805023193</real>
+					<key>ShadowVector</key>
+					<string>{0, 1}</string>
+				</dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.93512</string>
+						<key>g</key>
+						<string>0.472602</string>
+						<key>r</key>
+						<string>0.333854</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>3</real>
+				</dict>
+			</dict>
+			<key>Text</key>
+			<dict>
+				<key>Text</key>
+				<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 \
+\
+Renderscript entry point\
+\
+\
+\
+\
+}</string>
+				<key>VerticalPad</key>
+				<integer>0</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Bounds</key>
+			<string>{{29.75, 139.33}, {239.5, 350.67}}</string>
+			<key>Class</key>
+			<string>ShapedGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Color</key>
+				<dict>
+					<key>b</key>
+					<string>0</string>
+					<key>g</key>
+					<string>0</string>
+					<key>r</key>
+					<string>0</string>
+				</dict>
+				<key>Font</key>
+				<string>Helvetica-Bold</string>
+				<key>Size</key>
+				<real>10</real>
+			</dict>
+			<key>ID</key>
+			<integer>233</integer>
+			<key>Magnets</key>
+			<array>
+				<string>{1, 1}</string>
+				<string>{1, -1}</string>
+				<string>{-1, -1}</string>
+				<string>{-1, 1}</string>
+				<string>{0, 1}</string>
+				<string>{0, -1}</string>
+				<string>{1, 0}</string>
+				<string>{-1, 0}</string>
+				<string>{-0.5, -0.233518}</string>
+				<string>{-0.491442, 0.260063}</string>
+				<string>{0.507118, -0.224086}</string>
+				<string>{0.507118, 0.267179}</string>
+				<string>{-0.27431, -0.474028}</string>
+				<string>{0.27978, -0.478478}</string>
+				<string>{0.293938, 0.543044}</string>
+				<string>{-0.286232, 0.553804}</string>
+			</array>
+			<key>Shape</key>
+			<string>Rectangle</string>
+			<key>Style</key>
+			<dict>
+				<key>fill</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.938075</string>
+						<key>g</key>
+						<string>0.938269</string>
+						<key>r</key>
+						<string>0.938154</string>
+					</dict>
+					<key>FillType</key>
+					<integer>2</integer>
+					<key>GradientAngle</key>
+					<real>90</real>
+					<key>GradientColor</key>
+					<dict>
+						<key>b</key>
+						<string>0.727869</string>
+						<key>g</key>
+						<string>0.728019</string>
+						<key>r</key>
+						<string>0.72793</string>
+					</dict>
+				</dict>
+				<key>shadow</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.35</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>Fuzziness</key>
+					<real>2.3972222805023193</real>
+					<key>ShadowVector</key>
+					<string>{0, 1}</string>
+				</dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.472997</string>
+						<key>g</key>
+						<string>0.473094</string>
+						<key>r</key>
+						<string>0.473036</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>3</real>
+				</dict>
+			</dict>
+			<key>Text</key>
+			<dict>
+				<key>Text</key>
+				<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 \
+\
+\
+\
+Android Framework\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+}</string>
+				<key>VerticalPad</key>
+				<integer>0</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Class</key>
+			<string>Group</string>
+			<key>Graphics</key>
+			<array>
+				<dict>
+					<key>Class</key>
+					<string>LineGraphic</string>
+					<key>FontInfo</key>
+					<dict>
+						<key>Font</key>
+						<string>DroidSans</string>
+						<key>Size</key>
+						<real>11</real>
+					</dict>
+					<key>Head</key>
+					<dict>
+						<key>ID</key>
+						<integer>250</integer>
+					</dict>
+					<key>ID</key>
+					<integer>249</integer>
+					<key>OrthogonalBarAutomatic</key>
+					<false/>
+					<key>OrthogonalBarPoint</key>
+					<string>{0, 0}</string>
+					<key>OrthogonalBarPosition</key>
+					<real>4.1290435791015625</real>
+					<key>Points</key>
+					<array>
+						<string>{439.75, 326.693}</string>
+						<string>{439.75, 351.997}</string>
+					</array>
+					<key>Style</key>
+					<dict>
+						<key>stroke</key>
+						<dict>
+							<key>Color</key>
+							<dict>
+								<key>a</key>
+								<string>0.7</string>
+								<key>b</key>
+								<string>0</string>
+								<key>g</key>
+								<string>0</string>
+								<key>r</key>
+								<string>0</string>
+							</dict>
+							<key>CornerRadius</key>
+							<real>4</real>
+							<key>HeadArrow</key>
+							<string>FilledArrow</string>
+							<key>LineType</key>
+							<integer>2</integer>
+							<key>TailArrow</key>
+							<string>0</string>
+						</dict>
+					</dict>
+					<key>Tail</key>
+					<dict>
+						<key>ID</key>
+						<integer>251</integer>
+						<key>Info</key>
+						<integer>5</integer>
+					</dict>
+				</dict>
+				<dict>
+					<key>Bounds</key>
+					<string>{{344.75, 351.997}, {190, 47.0177}}</string>
+					<key>Class</key>
+					<string>ShapedGraphic</string>
+					<key>FontInfo</key>
+					<dict>
+						<key>Color</key>
+						<dict>
+							<key>b</key>
+							<string>0</string>
+							<key>g</key>
+							<string>0</string>
+							<key>r</key>
+							<string>0</string>
+						</dict>
+						<key>Font</key>
+						<string>Helvetica-Bold</string>
+						<key>Size</key>
+						<real>10</real>
+					</dict>
+					<key>ID</key>
+					<integer>250</integer>
+					<key>Magnets</key>
+					<array>
+						<string>{1, 1}</string>
+						<string>{1, -1}</string>
+						<string>{-1, -1}</string>
+						<string>{-1, 1}</string>
+						<string>{0, 1}</string>
+						<string>{0, -1}</string>
+						<string>{1, 0}</string>
+						<string>{-1, 0}</string>
+						<string>{-0.5, -0.233518}</string>
+						<string>{-0.491442, 0.260063}</string>
+						<string>{0.507118, -0.224086}</string>
+						<string>{0.507118, 0.267179}</string>
+						<string>{-0.27431, -0.474028}</string>
+						<string>{0.27978, -0.478478}</string>
+						<string>{0.293938, 0.543044}</string>
+						<string>{-0.286232, 0.553804}</string>
+					</array>
+					<key>Shape</key>
+					<string>Rectangle</string>
+					<key>Style</key>
+					<dict>
+						<key>fill</key>
+						<dict>
+							<key>Color</key>
+							<dict>
+								<key>b</key>
+								<string>0.274119</string>
+								<key>g</key>
+								<string>0.950739</string>
+								<key>r</key>
+								<string>0.787494</string>
+							</dict>
+							<key>FillType</key>
+							<integer>2</integer>
+							<key>GradientAngle</key>
+							<real>90</real>
+							<key>GradientColor</key>
+							<dict>
+								<key>b</key>
+								<string>0.223529</string>
+								<key>g</key>
+								<string>0.776471</string>
+								<key>r</key>
+								<string>0.643137</string>
+							</dict>
+						</dict>
+						<key>shadow</key>
+						<dict>
+							<key>Color</key>
+							<dict>
+								<key>a</key>
+								<string>0.35</string>
+								<key>b</key>
+								<string>0</string>
+								<key>g</key>
+								<string>0</string>
+								<key>r</key>
+								<string>0</string>
+							</dict>
+							<key>Fuzziness</key>
+							<real>2.3972222805023193</real>
+							<key>ShadowVector</key>
+							<string>{0, 1}</string>
+						</dict>
+						<key>stroke</key>
+						<dict>
+							<key>Color</key>
+							<dict>
+								<key>b</key>
+								<string>0.165602</string>
+								<key>g</key>
+								<string>0.586124</string>
+								<key>r</key>
+								<string>0.428309</string>
+							</dict>
+							<key>CornerRadius</key>
+							<real>3</real>
+						</dict>
+					</dict>
+					<key>Text</key>
+					<dict>
+						<key>Text</key>
+						<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 Renderscript Graphics Engine}</string>
+						<key>VerticalPad</key>
+						<integer>0</integer>
+					</dict>
+				</dict>
+				<dict>
+					<key>Bounds</key>
+					<string>{{344.75, 279.675}, {190, 47.0177}}</string>
+					<key>Class</key>
+					<string>ShapedGraphic</string>
+					<key>FontInfo</key>
+					<dict>
+						<key>Color</key>
+						<dict>
+							<key>b</key>
+							<string>0</string>
+							<key>g</key>
+							<string>0</string>
+							<key>r</key>
+							<string>0</string>
+						</dict>
+						<key>Font</key>
+						<string>DroidSans-Bold</string>
+						<key>Size</key>
+						<real>10</real>
+					</dict>
+					<key>ID</key>
+					<integer>251</integer>
+					<key>Magnets</key>
+					<array>
+						<string>{1, 1}</string>
+						<string>{1, -1}</string>
+						<string>{-1, -1}</string>
+						<string>{-1, 1}</string>
+						<string>{0, 1}</string>
+						<string>{0, -1}</string>
+						<string>{1, 0}</string>
+						<string>{-1, 0}</string>
+						<string>{-0.5, -0.233518}</string>
+						<string>{-0.491442, 0.260063}</string>
+						<string>{0.507118, -0.224086}</string>
+						<string>{0.507118, 0.267179}</string>
+						<string>{-0.27431, -0.474028}</string>
+						<string>{0.27978, -0.478478}</string>
+						<string>{0.293938, 0.543044}</string>
+						<string>{-0.286232, 0.553804}</string>
+					</array>
+					<key>Shape</key>
+					<string>Rectangle</string>
+					<key>Style</key>
+					<dict>
+						<key>fill</key>
+						<dict>
+							<key>Color</key>
+							<dict>
+								<key>b</key>
+								<string>1</string>
+								<key>g</key>
+								<string>0.874135</string>
+								<key>r</key>
+								<string>0.71718</string>
+							</dict>
+							<key>FillType</key>
+							<integer>2</integer>
+							<key>GradientAngle</key>
+							<real>90</real>
+							<key>GradientColor</key>
+							<dict>
+								<key>b</key>
+								<string>1</string>
+								<key>g</key>
+								<string>0.662438</string>
+								<key>r</key>
+								<string>0.464468</string>
+							</dict>
+						</dict>
+						<key>shadow</key>
+						<dict>
+							<key>Color</key>
+							<dict>
+								<key>a</key>
+								<string>0.35</string>
+								<key>b</key>
+								<string>0</string>
+								<key>g</key>
+								<string>0</string>
+								<key>r</key>
+								<string>0</string>
+							</dict>
+							<key>Fuzziness</key>
+							<real>2.3972222805023193</real>
+							<key>ShadowVector</key>
+							<string>{0, 1}</string>
+						</dict>
+						<key>stroke</key>
+						<dict>
+							<key>Color</key>
+							<dict>
+								<key>b</key>
+								<string>0.93512</string>
+								<key>g</key>
+								<string>0.472602</string>
+								<key>r</key>
+								<string>0.333854</string>
+							</dict>
+							<key>CornerRadius</key>
+							<real>3</real>
+						</dict>
+					</dict>
+					<key>Text</key>
+					<dict>
+						<key>Text</key>
+						<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 Graphics Renderscript (.rs)}</string>
+						<key>VerticalPad</key>
+						<integer>0</integer>
+					</dict>
+				</dict>
+				<dict>
+					<key>Bounds</key>
+					<string>{{320, 238}, {239.5, 179}}</string>
+					<key>Class</key>
+					<string>ShapedGraphic</string>
+					<key>FontInfo</key>
+					<dict>
+						<key>Color</key>
+						<dict>
+							<key>b</key>
+							<string>0</string>
+							<key>g</key>
+							<string>0</string>
+							<key>r</key>
+							<string>0</string>
+						</dict>
+						<key>Font</key>
+						<string>Helvetica-Bold</string>
+						<key>Size</key>
+						<real>10</real>
+					</dict>
+					<key>ID</key>
+					<integer>252</integer>
+					<key>Magnets</key>
+					<array>
+						<string>{1, 1}</string>
+						<string>{1, -1}</string>
+						<string>{-1, -1}</string>
+						<string>{-1, 1}</string>
+						<string>{0, 1}</string>
+						<string>{0, -1}</string>
+						<string>{1, 0}</string>
+						<string>{-1, 0}</string>
+						<string>{-0.5, -0.233518}</string>
+						<string>{-0.491442, 0.260063}</string>
+						<string>{0.507118, -0.224086}</string>
+						<string>{0.507118, 0.267179}</string>
+						<string>{-0.27431, -0.474028}</string>
+						<string>{0.27978, -0.478478}</string>
+						<string>{0.293938, 0.543044}</string>
+						<string>{-0.286232, 0.553804}</string>
+					</array>
+					<key>Shape</key>
+					<string>Rectangle</string>
+					<key>Style</key>
+					<dict>
+						<key>fill</key>
+						<dict>
+							<key>Color</key>
+							<dict>
+								<key>b</key>
+								<string>0.938075</string>
+								<key>g</key>
+								<string>0.938269</string>
+								<key>r</key>
+								<string>0.938154</string>
+							</dict>
+							<key>FillType</key>
+							<integer>2</integer>
+							<key>GradientAngle</key>
+							<real>90</real>
+							<key>GradientColor</key>
+							<dict>
+								<key>b</key>
+								<string>0.727869</string>
+								<key>g</key>
+								<string>0.728019</string>
+								<key>r</key>
+								<string>0.72793</string>
+							</dict>
+						</dict>
+						<key>shadow</key>
+						<dict>
+							<key>Color</key>
+							<dict>
+								<key>a</key>
+								<string>0.35</string>
+								<key>b</key>
+								<string>0</string>
+								<key>g</key>
+								<string>0</string>
+								<key>r</key>
+								<string>0</string>
+							</dict>
+							<key>Fuzziness</key>
+							<real>2.3972222805023193</real>
+							<key>ShadowVector</key>
+							<string>{0, 1}</string>
+						</dict>
+						<key>stroke</key>
+						<dict>
+							<key>Color</key>
+							<dict>
+								<key>b</key>
+								<string>0.472997</string>
+								<key>g</key>
+								<string>0.473094</string>
+								<key>r</key>
+								<string>0.473036</string>
+							</dict>
+							<key>CornerRadius</key>
+							<real>3</real>
+						</dict>
+					</dict>
+					<key>Text</key>
+					<dict>
+						<key>Text</key>
+						<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 \
+\
+\
+Renderscrpt Runtime Layer\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+}</string>
+						<key>VerticalPad</key>
+						<integer>0</integer>
+					</dict>
+				</dict>
+			</array>
+			<key>ID</key>
+			<integer>248</integer>
+		</dict>
+	</array>
+	<key>GridInfo</key>
+	<dict/>
+	<key>GuidesLocked</key>
+	<string>NO</string>
+	<key>GuidesVisible</key>
+	<string>YES</string>
+	<key>HPages</key>
+	<integer>1</integer>
+	<key>ImageCounter</key>
+	<integer>1</integer>
+	<key>KeepToScale</key>
+	<false/>
+	<key>Layers</key>
+	<array>
+		<dict>
+			<key>Lock</key>
+			<string>NO</string>
+			<key>Name</key>
+			<string>Layer 1</string>
+			<key>Print</key>
+			<string>YES</string>
+			<key>View</key>
+			<string>YES</string>
+		</dict>
+	</array>
+	<key>LayoutInfo</key>
+	<dict>
+		<key>Animate</key>
+		<string>NO</string>
+		<key>circoMinDist</key>
+		<real>18</real>
+		<key>circoSeparation</key>
+		<real>0.0</real>
+		<key>layoutEngine</key>
+		<string>dot</string>
+		<key>neatoSeparation</key>
+		<real>0.0</real>
+		<key>twopiSeparation</key>
+		<real>0.0</real>
+	</dict>
+	<key>LinksVisible</key>
+	<string>NO</string>
+	<key>MagnetsVisible</key>
+	<string>NO</string>
+	<key>MasterSheets</key>
+	<array/>
+	<key>ModificationDate</key>
+	<string>2011-11-07 10:35:41 -0800</string>
+	<key>Modifier</key>
+	<string>Robert Ly</string>
+	<key>NotesVisible</key>
+	<string>NO</string>
+	<key>Orientation</key>
+	<integer>2</integer>
+	<key>OriginVisible</key>
+	<string>NO</string>
+	<key>PageBreaks</key>
+	<string>YES</string>
+	<key>PrintInfo</key>
+	<dict>
+		<key>NSBottomMargin</key>
+		<array>
+			<string>float</string>
+			<string>41</string>
+		</array>
+		<key>NSLeftMargin</key>
+		<array>
+			<string>float</string>
+			<string>18</string>
+		</array>
+		<key>NSPaperSize</key>
+		<array>
+			<string>coded</string>
+			<string>BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU1ZhbHVlAISECE5TT2JqZWN0AIWEASqEhAx7X05TU2l6ZT1mZn2WgWQCgRgDhg==</string>
+		</array>
+		<key>NSRightMargin</key>
+		<array>
+			<string>float</string>
+			<string>18</string>
+		</array>
+		<key>NSTopMargin</key>
+		<array>
+			<string>float</string>
+			<string>18</string>
+		</array>
+	</dict>
+	<key>PrintOnePage</key>
+	<false/>
+	<key>QuickLookPreview</key>
+	<data>
+	JVBERi0xLjMKJcTl8uXrp/Og0MTGCjUgMCBvYmoKPDwgL0xlbmd0aCA2IDAgUiAvRmls
+	dGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAG9m01zHrcNgO/7K/YoH7xZkvt5bNMk
+	00wPbeRpD0kPqWzHduU4kZSm+fd9QAIg39UrWZ52OhpZBJYEQeKDAEj/3P+l/7kf+ZnX
+	pV9T6m9e9X/rf+w/+/w29Fe3fcg/t1f983GYe/ltOr7uP/vzq5urVz/d/fL9dXfzFlJx
+	DplcnOY+hWlYxrj1cQvDtq+xv3rff/bH96H/w4c8bxxL53nrU9qHNNM37fuwxrB1pW98
+	tG9ch2kck9KtfZWJaQp9nITuuvVhX4Y1xaiE05FwCHs/7UMYpXNMy7CFaBxPx85LqH2n
+	fRzCHHYlPB/7bnPtm7ZlSDEsyvFifcOy5W1Lc7/MsmnwkPZ5mJc1KN31sb5xDfBg7Nau
+	oZCdYg+T87bIBk/jkBCGkt0KWVGDFBOczv37fp4XJC3ta9obpBfZHIQ/7/lDGhZBGQgx
+	bSd2UcZItxTWIU0pACqJxMoLbWld5RmldU0rlL6AXYpjHVyAPfcW9E7f079CZ4S9mOlI
+	S9kzop2wbqu76t94+33WdWhmbtlu1EV0PGyjG0LV8P7mbfcz9iDm8hwFQGVXdmmUcaKt
+	l29Cf/sGzX7ApkL/NaPfFdv6/LIbh2lNY1owK2nsU27EfV/7y8+Rh880ZstkCllDTJtL
+	SNpVQp2AZeujmFPZellbxBBMQlOYXEJTQNmKIE3IYS0S6iZaRULSaiQkYN5wG1yASSUk
+	9A2jf9EOaQkXQoeWsWcSyquy1ZmEykov2U68Ebp9248dnqjZmKMIfv+iD1HlE/vn6zYs
+	2zZt/fNl6V8goS/DMLKtL17333YX3zwTpxb7i1fW+PEZEgDxUv/6hxvrcWuNK2vcPOsK
+	lZ900F2vDaf/iyKM/N1bRbw3IjpRd2Fj/6Q9vrcev1mj5env/Yuv+y9eqMalac36OCdc
+	zLR0mHEKLUbEnhIeU4xZe4GZSp8w7BuicxgvARVRm9yjm0ZUSoYKlTJmXNEeIKM54tyk
+	h81rMOJX3hTToQbTMow7zgF2yqg0tVQd0lmFhn5XTIErX8fvdcSsa5FZT1dbubBdM05t
+	f7Iynu4s5idHpNCKxf43WXXYWcw2jGFdVrxHl4/RE+9xTnXjzkEzY2rZgcSzDqTTQ/ng
+	QFDWlNI2q9/g1ACzpxkTeMh/5IV0cd2HZWWcq4hjGhVxnIpbTvExbHjwIv64xUxFfH/B
+	YMDDIjJ1FUlx5vitKpLiUnqoijhsKoLv1x6NijhOxadUHdJZXeDGR3fscYR9hK1F/FNR
+	EV+tqUjdNVUR359GRRz3vj/xW/15v6XCl6P46LowrW0niJqOjqu/+Eqdg3sl9xI/PeNQ
+	wYG90R7maNxbuf8yR+NOyv2KeamXSss/+HROxMn6J5vw4Ay7i+8uhiPXTua7Z8/6s64s
+	icaN6JPrqWFwIO52DOdaKNo97+KGsrEnjoFMpeop0d0udmN62qWEnkYitUoVr5b7mKYa
+	bJpKyKo9Wk1VnGue0TXNs5ld85Jhjj0OsJyhRTN9Pa6ryVZsutr7nqiuOoyuwls+KBx3
+	4s5kVZPszcGdlazg4M46D1H0JE4zEflOuFncWTrrziy0at1Z9/mlRD9xIw6iQagaovi1
+	QHiCX3vUn/W4vGHfccGmJ51jWj2xXqYX4uInUhCHp0Kl6gkpwxg4Sk1PiMmxyzW0ekK+
+	In2gkg9byV8yXPXEMFVPOu9lMjW6DpeZJaZSqSsvR9g1zb7XEbOup+qJrbjqie1J0Ym6
+	b41P8718kk8zDTjj0yT3medpPefT/l9+6DHfibp9gu/sLr4wV/nDwd0aHtdZ/ZpkDaMo
+	8mdf3Yb+h9s2GMgBvuyYmZEdghWTtmEuR6v1IVMZSRWufdAUFXHZ5ZA5J/BlWo4fpo0y
+	rQ3n9N5JnZmBceQxiQxREEKPTNkRKP+b+4Nes5av+X13bxli+jYHgZewaHOgq8aizeGI
+	OocPkhO05KXCDqvH9KAVl4W4q1P4GniFcQk7S4+47BKXzXvEpYN2eJTxVwZLcCuDpXMX
+	MbKcLzmxOJFq5ZnIW6gwkLcIF9LGnjiXEEYBOcTzh0KhM1BC59o+1yrfp30na2PzYQ5+
+	IKaYwn6ncyVbnvChPfKGZEvNvPkOSeQJITYhsr/yryS1YsfLarFkU7khr22lGKiCEHeE
+	jejSEtvprCM3Wq0j74sj/+TElj3sgqSFopK68Qo3IlaMijSwrmUlPnCYPRNZqVSnLW9p
+	0YdpIxuUXNdFTOHGZpKmiVjajYhzLxFxVymUxB/qJmKZqYj4tNWIOCAKmKsi7px9F7Eu
+	z0WscBWxIg6e+JAV3xMgsSWGOHKOvrg6SZAp8yyr5MdhHj3O5FAnQb743Y8vbz68fdl/
+	efP9+1e/frj557P+xbuabXLQo1JwTg1BJDaFBmaRU8pVIyKr0kUsTAbAyEpVSsG45fFs
+	U/4schd6Ml66x0UiuE2qeEouLoQn2fBkPoM4sYUdAzmu52Gj/FFRnIUNOYE6m4zB5WOZ
+	+2FAOxInKpO5qy2p0zmpfuiST7ZIZHiCKFEXgVZc8MSwKgEX6vnRzLGINxIxyEaUQGs+
+	a59G6759fmLeKIyTaLPlhMgmbIOrsMnlS5civWlkYWRWKsxpZJsZf5W9LR4GYQtswp6W
+	bUCNMFAVNj3wRPQoymWQCltBic1M2NYjy8XJKVQmUxna3O23rgWw7AIq08wiSuJLcmHb
+	krNsFSBWV2Hb14PBHtLBexI9JINsw0JRYcFO1+5Qx+r/mzpWd/HkFO5MmezO077frAhm
+	aaXlfx8eiIzu2shIzvi8fTM1IcoSG6WrInJDZB0pHgA5lE6qVfM0YwfUkIvOzeiOkBDP
+	LC6E0m/RIdcy7EaVUglORM6NlilkWqZg1TIolv5FIYycQmUyUx6d++RbC0jpRNTKuVY1
+	80W5avuqTzaKVaqi2Xe2Tk5/3IqwOWI84lY4+cOyc8dgtzuHPK6WmosqzlTjl2UvVxqX
+	b5aHvEue68nepXsgi8tLorCE9XOFYbJ3RONfDKceJGz4JQq8KvuwEfMICT9OJJfFR5rs
+	I9m4nj4qe7nnoQf08nFSILH9fJwoWGWf74WEYpaak1MoT2YijTp3+82GFa5U9s61yt4X
+	ZbLvbNWFK4dc9o55ipdpRXtwMyL0NW1cAnksoMVyogGrP7vD8Cr2v8z4rfhzR7G65j1u
+	3eJzd4zSJeyIKuHOcXqEcBvG+U8onuOBidM/kzAJJzfP0iHt5LyU7uivAUMiKajWbZBK
+	2MBGwobKcnNyApG0n5whBmrPxinYF5Wwc60SnnRRNWLwVWe9c8gl7Bi3bmHTrHsl8wDe
+	LRz/aGhPEBYlDy+xw3rWuo3Yk637oRqNLCnHWuM6Ly57Cb4yosqeQEhxRZYSp5OFEFhr
+	LEhhBRIYmMrazdNg6nxrGz/IpbJYa7Fug0z25WMbP1iPIlEy7kxOoRIdqkilaud+QIES
+	P9gX7SiZiK4z0/FFeQDhqy4+R/eghhD+/SnWPTWiPVg3aTVR5jh9JIjwquylXVv5Kf/a
+	68zuBF6Z7f+1Nfnmhk5zkVO2uDA7k40EDoC0x3NRzsXbV7/2H26ILiwF+dgUPkPXXgiS
+	ghEWkq0/TwcXd/HN7YsnUD9T1YrkoFua9/s0v21ipn+b/7yr26oXh15g/x/sIRcwAZWT
+	BR4CRdnCusCPFqPEN0ReC0z4UTlTJSRD54mAFSGHKuftKWKnBDrKNZh1iuJ9AckBiXFI
+	kQE7qQ7ZOZ2/Jy4SA/ma0FQEbnzlFUfkDUTcKQlzT166SN5DHqmgOIMTxEdAcnxWQWHE
+	CDAlV2hSAmowUnh6rLwlfiJEPFPi7p9fcWspEVfOawA3DSFNJL6OiCi2vIepw6gfLbmo
+	RAUjyQsWbv15IiNX5+hokCcADYY69RoSHNZhnEdTlG0x2uIjCyZPD50yqvLI2pU2lHBf
+	qzBr81dMZVLXdpWvsuwcaAzPq5aav6hPfN8rDEuS114bLA5OzoCKQH8KIu9493BBMXBl
+	wb0Hu7JwSyCqJLNQEp0pakRem5Bmrj3ubZgmymmG6XiXMyxR4gcbRwFkplq2s3lxkY9Y
+	boNBPzkawfg43jBxtYCiVeqc39siobVzUDHOZxlHLMnlwBA5SZivUKfw4xjj4N76Ht91
+	Mc+8y6jZOHBpIndkZdtFy0DKJawieBt0QMAHnpbvXASJvaYVWTMGzuQxi4Ewz3HUwNc9
+	BRnskUtg70P1QnpgwRE7VaiwwKZl2A2e8dJ7QutW7iB6NoRHYiM3AmjmCOdCnwh1lj5I
+	KXIHlDeie8wc2fxIEWVhDBrHacteQAeprsSy2MEyQRAMpor3wRmtzCEPrXheVbhZVpaU
+	V7vhcsrbnmVk0CZMIOpS0eZVFuf5ui+kV5AZw847tX5FAiRLhWeCz00wa+AncxSYTYbB
+	BGnqxA5HKRIyG29uqCILTl6FxdSx25i9eN1FErb8GOywtKIXElSvMME9Af3k4ivKUwQD
+	rztGlWqn47I35zXcFskDC4BLlcH4UPH0+LIM4oQziJKEFBpK+JrcIU9lAMuHD4Ou+5Uq
+	Z668OQ7Nn3DXmVhu6zyMlC8KPdQuveRcE1ahzxhdRVfnsoW3eyLRcwuX2BnRsFF4Uslv
+	sWlxFlYn+2jgzIPGsmP5scb2iYHziq+hMoHHX3hyJs++2N8xhnwrdPSrWHgH9+KX1bxl
+	2x0UIamEHSdiSyNKxTPHLEPuUstgSm7yjeeSmVaRcKJgPaG4DSXzJXkqA7KE3c1c1113
+	HDJxYrmt82TZ+aztl6YtBiSnprKaJeyrcAn7Its9UQnbN2KUxx5dFG/I8zSX4SFCLvVH
+	PMN0iJ0I5B67nyz3hh7GebysofSTimx2L8nDr5o6Nzpxyvz9MDRKHJCwxENcC+tWk/Og
+	3Ypy5Zqyu7hz1muU2rKhzkbCj1xaK87GwaqKOULJXYoqchoHnKAAcceTal1OwA0PKWBR
+	RXk2M8q5bTodOU/kO3pL+qYAjgrpO9T4GsehSUZLmjaLqFjnUPulbWdFdEZVEXUNjSKW
+	XSjGqTviiug7JEW47GqENSIK3h+bqzm+pCgPp/0lRZG0xNZlv7Kr2c+6GivnWWwmj7bL
+	Q4pPdTXZUXJtYRU4OUwUJEF2sRgui3TimorqG7EVAp14a2MxvYDEWBks8pXXhvsYm7OE
+	9Dd/z2eJAVm+HJM21DfdcYjLaOWmzpIl53O2X9p26WWMlqNE11Cdmi9Rjg7bETtKDH6K
+	ozEJ3rfV51y7Ef1wDJ+x1sccTXnc5dZ6dDT906v53YU5gX9ohf6d/nXq7i7u1eox5Z2M
+	V8JGniJ3cSTZ5p1OBpG3nK1EdxmMHPz6TU+rBsNVEL2twzyKpjlIaF0u5J0cBas6lVSv
+	+soI4HVPIsiFP7EZj1k6Ekdl0ihVDJedDPYOgA8DVw0lgkVm8XGrLqnOy35UngBEb1qE
+	VuchMZUNJM4jjeDMJvjlDDWD/lggkiSMFsWSN+fjk33D43fzD5Xn6wKIovH9Lm7AVtyA
+	Jj7eEYmKy828CxT314obv9GKeyNdypfzLm4Ccpuq479NnIgbsBU3YJWKUWowkmkbCK3k
+	AO/kDkDtyHsJOZ5sHKAuycTNIudGugCn4gbxFD/hsjxEI5IRRp5gn3MSZrRWcbcHR+Xh
+	evO03azc/t5dulm79zAidmd3992FvcjsyuPy/wBuuobCCmVuZHN0cmVhbQplbmRvYmoK
+	NiAwIG9iago0MjM5CmVuZG9iagozIDAgb2JqCjw8IC9UeXBlIC9QYWdlIC9QYXJlbnQg
+	NCAwIFIgL1Jlc291cmNlcyA3IDAgUiAvQ29udGVudHMgNSAwIFIgL01lZGlhQm94IFsw
+	IDAgNTc2IDczM10KPj4KZW5kb2JqCjcgMCBvYmoKPDwgL1Byb2NTZXQgWyAvUERGIC9U
+	ZXh0IC9JbWFnZUIgL0ltYWdlQyAvSW1hZ2VJIF0gL0NvbG9yU3BhY2UgPDwgL0NzMiAy
+	NiAwIFIKL0NzMSA4IDAgUiA+PiAvRXh0R1N0YXRlIDw8IC9HczIgMzcgMCBSIC9HczEg
+	MzggMCBSID4+IC9Gb250IDw8IC9GMS4wIDI3IDAgUgo+PiAvWE9iamVjdCA8PCAvSW0z
+	IDEzIDAgUiAvSW0yIDExIDAgUiAvSW02IDE5IDAgUiAvSW03IDIxIDAgUiAvSW0xIDkg
+	MCBSCi9JbTggMjMgMCBSIC9JbTUgMTcgMCBSIC9JbTQgMTUgMCBSID4+IC9TaGFkaW5n
+	IDw8IC9TaDMgMjkgMCBSIC9TaDIgMjggMCBSCi9TaDEgMjUgMCBSIC9TaDUgMzEgMCBS
+	IC9TaDkgMzUgMCBSIC9TaDEwIDM2IDAgUiAvU2g4IDM0IDAgUiAvU2g3IDMzIDAgUiAv
+	U2g0CjMwIDAgUiAvU2g2IDMyIDAgUiA+PiA+PgplbmRvYmoKMjkgMCBvYmoKPDwgL0Nv
+	bG9yU3BhY2UgMzkgMCBSIC9TaGFkaW5nVHlwZSAyIC9Db29yZHMgWyA5NS41IC0yNC4w
+	MDg4NCA5NS41IDI0LjAwODg3Cl0gL0RvbWFpbiBbIDAgMSBdIC9FeHRlbmQgWyBmYWxz
+	ZSBmYWxzZSBdIC9GdW5jdGlvbiA0MCAwIFIgPj4KZW5kb2JqCjI4IDAgb2JqCjw8IC9D
+	b2xvclNwYWNlIDM5IDAgUiAvU2hhZGluZ1R5cGUgMiAvQ29vcmRzIFsgOTUuNSAtMjQu
+	MDA4ODQgOTUuNSAyNC4wMDg4NwpdIC9Eb21haW4gWyAwIDEgXSAvRXh0ZW5kIFsgZmFs
+	c2UgZmFsc2UgXSAvRnVuY3Rpb24gNDEgMCBSID4+CmVuZG9iagoyNSAwIG9iago8PCAv
+	Q29sb3JTcGFjZSAzOSAwIFIgL1NoYWRpbmdUeXBlIDIgL0Nvb3JkcyBbIDEyMC4yNSAt
+	ODkuOTk5OTggMTIwLjI1IDkwLjAwMDA0Cl0gL0RvbWFpbiBbIDAgMSBdIC9FeHRlbmQg
+	WyBmYWxzZSBmYWxzZSBdIC9GdW5jdGlvbiA0MiAwIFIgPj4KZW5kb2JqCjMxIDAgb2Jq
+	Cjw8IC9Db2xvclNwYWNlIDM5IDAgUiAvU2hhZGluZ1R5cGUgMiAvQ29vcmRzIFsgOTUu
+	NSAtMzQuNSA5NS40OTk5OCAzNC41MDAwNApdIC9Eb21haW4gWyAwIDEgXSAvRXh0ZW5k
+	IFsgZmFsc2UgZmFsc2UgXSAvRnVuY3Rpb24gNDMgMCBSID4+CmVuZG9iagozNSAwIG9i
+	ago8PCAvQ29sb3JTcGFjZSAzOSAwIFIgL1NoYWRpbmdUeXBlIDIgL0Nvb3JkcyBbIDc5
+	IC0xMi41IDc5IDEyLjUwMDAzIF0gL0RvbWFpbgpbIDAgMSBdIC9FeHRlbmQgWyBmYWxz
+	ZSBmYWxzZSBdIC9GdW5jdGlvbiA0NCAwIFIgPj4KZW5kb2JqCjM2IDAgb2JqCjw8IC9D
+	b2xvclNwYWNlIDM5IDAgUiAvU2hhZGluZ1R5cGUgMiAvQ29vcmRzIFsgNTQuMDE2NSAt
+	MTYgNTQuMDE2NDkgMTYuMDAwMDIKXSAvRG9tYWluIFsgMCAxIF0gL0V4dGVuZCBbIGZh
+	bHNlIGZhbHNlIF0gL0Z1bmN0aW9uIDQ1IDAgUiA+PgplbmRvYmoKMzQgMCBvYmoKPDwg
+	L0NvbG9yU3BhY2UgMzkgMCBSIC9TaGFkaW5nVHlwZSAyIC9Db29yZHMgWyA3OSAtMTIu
+	NSA3OSAxMi41MDAwMyBdIC9Eb21haW4KWyAwIDEgXSAvRXh0ZW5kIFsgZmFsc2UgZmFs
+	c2UgXSAvRnVuY3Rpb24gNDYgMCBSID4+CmVuZG9iagozMyAwIG9iago8PCAvQ29sb3JT
+	cGFjZSAzOSAwIFIgL1NoYWRpbmdUeXBlIDIgL0Nvb3JkcyBbIDk1LjUgLTM3LjE2OTcg
+	OTUuNDk5OTggMzcuMTY5NzQKXSAvRG9tYWluIFsgMCAxIF0gL0V4dGVuZCBbIGZhbHNl
+	IGZhbHNlIF0gL0Z1bmN0aW9uIDQ3IDAgUiA+PgplbmRvYmoKMzAgMCBvYmoKPDwgL0Nv
+	bG9yU3BhY2UgMzkgMCBSIC9TaGFkaW5nVHlwZSAyIC9Db29yZHMgWyAxMjAuMjUgLTE3
+	NS44MzUgMTIwLjI0OTkgMTc1LjgzNTEKXSAvRG9tYWluIFsgMCAxIF0gL0V4dGVuZCBb
+	IGZhbHNlIGZhbHNlIF0gL0Z1bmN0aW9uIDQ4IDAgUiA+PgplbmRvYmoKMzIgMCBvYmoK
+	PDwgL0NvbG9yU3BhY2UgMzkgMCBSIC9TaGFkaW5nVHlwZSAyIC9Db29yZHMgWyA5NS41
+	IC0yNS41ODQ4NSA5NS40OTk5OCAyNS41ODQ4OQpdIC9Eb21haW4gWyAwIDEgXSAvRXh0
+	ZW5kIFsgZmFsc2UgZmFsc2UgXSAvRnVuY3Rpb24gNDkgMCBSID4+CmVuZG9iagoxMyAw
+	IG9iago8PCAvTGVuZ3RoIDE0IDAgUiAvVHlwZSAvWE9iamVjdCAvU3VidHlwZSAvSW1h
+	Z2UgL1dpZHRoIDUwMiAvSGVpZ2h0IDg4MiAvSW50ZXJwb2xhdGUKdHJ1ZSAvQ29sb3JT
+	cGFjZSA1MCAwIFIgL0ludGVudCAvUGVyY2VwdHVhbCAvU01hc2sgNTEgMCBSIC9CaXRz
+	UGVyQ29tcG9uZW50CjggL0ZpbHRlciAvRmxhdGVEZWNvZGUgPj4Kc3RyZWFtCngB7dAx
+	AQAAAMKg9U9tCy+IQGHAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgIHfwABF0AABCmVu
+	ZHN0cmVhbQplbmRvYmoKMTQgMCBvYmoKNTgxNgplbmRvYmoKMTEgMCBvYmoKPDwgL0xl
+	bmd0aCAxMiAwIFIgL1R5cGUgL1hPYmplY3QgL1N1YnR5cGUgL0ltYWdlIC9XaWR0aCA0
+	MDIgL0hlaWdodCAxMTYgL0ludGVycG9sYXRlCnRydWUgL0NvbG9yU3BhY2UgNTAgMCBS
+	IC9JbnRlbnQgL1BlcmNlcHR1YWwgL1NNYXNrIDUzIDAgUiAvQml0c1BlckNvbXBvbmVu
+	dAo4IC9GaWx0ZXIgL0ZsYXRlRGVjb2RlID4+CnN0cmVhbQp4Ae3QMQEAAADCoPVPbQdv
+	iEBhwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB
+	AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg
+	wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM
+	GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB
+	AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg
+	wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM
+	GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB
+	AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg
+	wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM
+	GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB
+	AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg
+	wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwb+
+	gQEilgABCmVuZHN0cmVhbQplbmRvYmoKMTIgMCBvYmoKNjM0CmVuZG9iagoxOSAwIG9i
+	ago8PCAvTGVuZ3RoIDIwIDAgUiAvVHlwZSAvWE9iamVjdCAvU3VidHlwZSAvSW1hZ2Ug
+	L1dpZHRoIDQwMiAvSGVpZ2h0IDE3MCAvSW50ZXJwb2xhdGUKdHJ1ZSAvQ29sb3JTcGFj
+	ZSA1MCAwIFIgL0ludGVudCAvUGVyY2VwdHVhbCAvU01hc2sgNTUgMCBSIC9CaXRzUGVy
+	Q29tcG9uZW50CjggL0ZpbHRlciAvRmxhdGVEZWNvZGUgPj4Kc3RyZWFtCngB7dABDQAA
+	AMKg909tDjeIQGHAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDgY2AhCQABCmVuZHN0cmVh
+	bQplbmRvYmoKMjAgMCBvYmoKOTE3CmVuZG9iagoyMSAwIG9iago8PCAvTGVuZ3RoIDIy
+	IDAgUiAvVHlwZSAvWE9iamVjdCAvU3VidHlwZSAvSW1hZ2UgL1dpZHRoIDMzNiAvSGVp
+	Z2h0IDcwIC9JbnRlcnBvbGF0ZQp0cnVlIC9Db2xvclNwYWNlIDUwIDAgUiAvSW50ZW50
+	IC9QZXJjZXB0dWFsIC9TTWFzayA1NyAwIFIgL0JpdHNQZXJDb21wb25lbnQKOCAvRmls
+	dGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAHt0DEBAAAAwqD1T20MH4hAYcCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw8BwYE68A
+	AQplbmRzdHJlYW0KZW5kb2JqCjIyIDAgb2JqCjMzMQplbmRvYmoKOSAwIG9iago8PCAv
+	TGVuZ3RoIDEwIDAgUiAvVHlwZSAvWE9iamVjdCAvU3VidHlwZSAvSW1hZ2UgL1dpZHRo
+	IDUwMiAvSGVpZ2h0IDQ5MCAvSW50ZXJwb2xhdGUKdHJ1ZSAvQ29sb3JTcGFjZSA1MCAw
+	IFIgL0ludGVudCAvUGVyY2VwdHVhbCAvU01hc2sgNTkgMCBSIC9CaXRzUGVyQ29tcG9u
+	ZW50CjggL0ZpbHRlciAvRmxhdGVEZWNvZGUgPj4Kc3RyZWFtCngB7dAxAQAAAMKg9U9t
+	B2+IQGHAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgIF/YEM5AAEKZW5kc3RyZWFtCmVuZG9iagoxMCAwIG9iagozMjQxCmVuZG9i
+	agoyMyAwIG9iago8PCAvTGVuZ3RoIDI0IDAgUiAvVHlwZSAvWE9iamVjdCAvU3VidHlw
+	ZSAvSW1hZ2UgL1dpZHRoIDIzNiAvSGVpZ2h0IDg0IC9JbnRlcnBvbGF0ZQp0cnVlIC9D
+	b2xvclNwYWNlIDUwIDAgUiAvSW50ZW50IC9QZXJjZXB0dWFsIC9TTWFzayA2MSAwIFIg
+	L0JpdHNQZXJDb21wb25lbnQKOCAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0K
+	eAHt0DEBAAAAwqD1T20MH4hAYcCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMG/gMD6FAAAQplbmRzdHJlYW0KZW5kb2JqCjI0IDAg
+	b2JqCjI4MwplbmRvYmoKMTcgMCBvYmoKPDwgL0xlbmd0aCAxOCAwIFIgL1R5cGUgL1hP
+	YmplY3QgL1N1YnR5cGUgL0ltYWdlIC9XaWR0aCA0MDIgL0hlaWdodCAxMjIgL0ludGVy
+	cG9sYXRlCnRydWUgL0NvbG9yU3BhY2UgNTAgMCBSIC9JbnRlbnQgL1BlcmNlcHR1YWwg
+	L1NNYXNrIDYzIDAgUiAvQml0c1BlckNvbXBvbmVudAo4IC9GaWx0ZXIgL0ZsYXRlRGVj
+	b2RlID4+CnN0cmVhbQp4Ae3QMQEAAADCoPVPbQlPiEBhwIABAwYMGDBgwIABAwYMGDBg
+	wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM
+	GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB
+	AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg
+	wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM
+	GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB
+	AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg
+	wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM
+	GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB
+	AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg
+	wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM
+	GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB
+	AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg
+	wIABAwYMGDBg4DMwPtoAAQplbmRzdHJlYW0KZW5kb2JqCjE4IDAgb2JqCjY2NQplbmRv
+	YmoKMTUgMCBvYmoKPDwgL0xlbmd0aCAxNiAwIFIgL1R5cGUgL1hPYmplY3QgL1N1YnR5
+	cGUgL0ltYWdlIC9XaWR0aCA0MDIgL0hlaWdodCAyMzggL0ludGVycG9sYXRlCnRydWUg
+	L0NvbG9yU3BhY2UgNTAgMCBSIC9JbnRlbnQgL1BlcmNlcHR1YWwgL1NNYXNrIDY1IDAg
+	UiAvQml0c1BlckNvbXBvbmVudAo4IC9GaWx0ZXIgL0ZsYXRlRGVjb2RlID4+CnN0cmVh
+	bQp4Ae3QMQEAAADCoPVPbQwfiEBhwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB
+	AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg
+	wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM
+	GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB
+	AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg
+	wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM
+	GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB
+	AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg
+	wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM
+	GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB
+	AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg
+	wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM
+	GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB
+	AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg
+	wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM
+	GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB
+	AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg
+	wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM
+	GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB
+	AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg
+	wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM
+	GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB
+	AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg
+	wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM
+	GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGPgPDGFw
+	AAEKZW5kc3RyZWFtCmVuZG9iagoxNiAwIG9iagoxMjc1CmVuZG9iago1MyAwIG9iago8
+	PCAvTGVuZ3RoIDU0IDAgUiAvVHlwZSAvWE9iamVjdCAvU3VidHlwZSAvSW1hZ2UgL1dp
+	ZHRoIDQwMiAvSGVpZ2h0IDExNiAvQ29sb3JTcGFjZQovRGV2aWNlR3JheSAvSW50ZXJw
+	b2xhdGUgdHJ1ZSAvQml0c1BlckNvbXBvbmVudCA4IC9GaWx0ZXIgL0ZsYXRlRGVjb2Rl
+	ID4+CnN0cmVhbQp4Ae2dW1PaWhiGyUpCQiAcKycL21Y51EOcwSJGBTcWilAREQL0//+R
+	HWrbASrfHeubPX2/Gy7eCS/zPKy14GoFAhgQAAEQAAEQAAEQAAE5BBQhVIxUAkIoyja5
+	ilD1oGGGMDIJmIauqW87UVTdDNuxRBIjkUAiHo1YhibecCLUYDiWyuTfF4oYeQQK+7l0
+	0g7pfy4TRTUiqfxB6fjUcc4xsgg4ZyfVw0Imbumbq0RRg5F3hbJTd2+bLYw8As2bRu3k
+	MJ/wlayf70IPpwrV2k2723voY+QRePjaaTWco1zM3Ni3VDOWK9ea3W9Po+cxRh6B59Gw
+	f++efdiLrC8SRQunDpyb7uN46nkzjDwCnjcZDdqX1by/SFa3LRG0M6V6ezD25vPFYvEd
+	I4eAz3o+m456t84/KUtb/QUsjFj+2O0+TZc+YESOjh8tSyUvg38vDv1ta9WIaiben972
+	Rh5WiEQbv5RMHr9cljL2upFQouA0H549LBDZRr4v5pNhp1HJ2sG1NRJKFp1Wf+wbkf6J
+	/vrC+fSpe1XJRf8wcg4jPF+OpRG3usXIjOcz/d2tv42s/mtX/V1ruUZghOHLASMM0MlK
+	GCHxMIQwwgCdrIQREg9DCCMM0MlKGCHxMIQwwgCdrIQREg9DCCMM0MlKGCHxMIQwwgCd
+	rIQREg9DCCMM0MlKGCHxMIQwwgCdrIQREg9DCCMM0MlKGCHxMIQwwgCdrIQREg9DCCMM
+	0MlKGCHxMIQwwgCdrIQREg9DCCMM0MlKGCHxMIQwwgCdrIQREg9DCCMM0MlKGCHxMIQw
+	wgCdrIQREg9DCCMM0MlKGCHxMIQwwgCdrIQREg9DCCMM0MlKGCHxMIQwwgCdrIQREg9D
+	CCMM0MlKGCHxMIQwwgCdrIQREg9DCCMM0MlKGCHxMIQwwgCdrIQREg9DCCMM0MlKGCHx
+	MIQwwgCdrIQREg9DCCMM0MlKGCHxMIQwwgCdrIQREg9DCCMM0MlKGCHxMIQwwgCdrIQR
+	Eg9DCCMM0MlKGCHxMIQwwgCdrIQREg9DCCMM0MlKGCHxMIQwwgCdrIQREg9DCCMM0MlK
+	GCHxMIQwwgCdrIQREg9DCCMM0MnK30Y2bzp+vVeXfBbhLghsNfJ69/QuKvGeBIHFwjfS
+	uapkN++eThTOXu9nJx5GtAMCvpHl/ezlzPr97MKM75/cfB1N57igfQfUt7/lwp/Zy+N9
+	vZSO6KvniDCiuWqjM5zMoGQ7vh0kvpC5N+7f1T6+C2urRhQ9kj6q3fWfp7M5RiqBmTcZ
+	dq9PC8mQGlgZRbOShZOr+8HoZTLFyCQwGQ97rYtSNmqIFSGBgDDszOG52+59Gz5hJBIY
+	Pg66rfpxMWWtHSOBgKKF4vkj57LZ/tLFSCTQub+7vjg+SNuGunqM+MtF6FYi9+HT+efL
+	K9e9xsgh4LqNeu2sXExHzbVzfbl/Kapuxfb2D47KlU8YaQSqldLHYi5lm9r6KfJTiRmJ
+	p9KZbA4jj0A2s5eMhg1NbOxZP5QILWhaETuKkUnADluGvnmGLH0sRxGqpgeDQQMjiYAP
+	W9c19a0F8qrEl6IoAiORgA/8jf3qlw68ggAIgAAIgAAI/N8J/Ac/+KIKCmVuZHN0cmVh
+	bQplbmRvYmoKNTQgMCBvYmoKMTIwNAplbmRvYmoKNjMgMCBvYmoKPDwgL0xlbmd0aCA2
+	NCAwIFIgL1R5cGUgL1hPYmplY3QgL1N1YnR5cGUgL0ltYWdlIC9XaWR0aCA0MDIgL0hl
+	aWdodCAxMjIgL0NvbG9yU3BhY2UKL0RldmljZUdyYXkgL0ludGVycG9sYXRlIHRydWUg
+	L0JpdHNQZXJDb21wb25lbnQgOCAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0K
+	eAHtl2tT2moUhUlCLtwFVISCekopViGdQ+sdGKkgl4MClQD9/3+koTNtwcv2i33XnOna
+	n2DWkJV5HvZLCAQ4JEACJEACJEACJEACaghoum5wlBLQdU17Tq6mG6ZlOyGOSgKObQaN
+	p51ohulEYolkiqOQQHIjHg3bQf0JJ7phRRLpTC5f2OWoI1B4k91OxULm4zXRDDuazu2X
+	Diuu+5GjioBbPTooFjIbYfPhlmiGFd0svHePz+uNJkcdgcblae2omEv6StZ/33Uzki4c
+	1C5bnW6vz1FHoHfTbp6677IJ58G5ZTiJ7Ptao/Pf3Wg84agjMB7d9r+cV//Ziq4viRaM
+	pPfdy85wMvW8GUcdAc+7Hw1aJwc5f0lWjy3dimVKx63BxJvPF4vFN44aAj7r+Ww66tbd
+	vXQ4uPoErNuJ3OF552669EEjanT8aFkq+Tq4+lT0j61VI4aTzFfq3ZHHDVFo46eS++H1
+	SSkTWzcSShbcRm/scUFUG/m2mN/ftk/LOzFrbUdCqV232Z/4RpTf0V9fOJ/edc7K2fgj
+	Ix9pBPPlWBo5P3jGyAxzT3936y8jq//aDf/UWu4IjQC+HDQCgC5W0oiIBxDSCAC6WEkj
+	Ih5ASCMA6GIljYh4ACGNAKCLlTQi4gGENAKALlbSiIgHENIIALpYSSMiHkBIIwDoYiWN
+	iHgAIY0AoIuVNCLiAYQ0AoAuVtKIiAcQ0ggAulhJIyIeQEgjAOhiJY2IeAAhjQCgi5U0
+	IuIBhDQCgC5W0oiIBxDSCAC6WEkjIh5ASCMA6GIljYh4ACGNAKCLlTQi4gGENAKALlbS
+	iIgHENIIALpYSSMiHkBIIwDoYiWNiHgAIY0AoIuVNCLiAYQ0AoAuVtKIiAcQ0ggAulhJ
+	IyIeQEgjAOhiJY2IeAAhjQCgi5U0IuIBhDQCgC5W0oiIBxDSCAC6WEkjIh5ASCMA6GIl
+	jYh4ACGNAKCLlTQi4gGENAKALlbSiIgHENIIALpYSSMiHkBIIwDoYiWNiHgAIY0AoIuV
+	NCLiAYQ0AoAuVtKIiAcQ0ggAulhJIyIeQEgjAOhiJY2IeAAhjQCgi5U0IuIBhDQCgC5W
+	0oiIBxDSCAC6WEkjIh5ASCMA6GIljYh4ACGNAKCLlaIRbyF+luGfIPDLiBb4PUYotes2
+	+xMa+RPIX7jm0shZORu31o0kC26jN/YWC27JCwBfO17M72/bp+Wd2LoRJ5mv1Lsjb04l
+	r038hestfCPD65NSJmau7ohuJ3Ifzju3Uxp5AeBrx76Q2dfB1afiVmTdiBXLlD63BhNv
+	TievDV24nn8izWfTu5u6u5cKB1d3RAuG03vuRXs4mXr+zDhqCPisp/ejfuv4IJdwjN9P
+	Wv4rw05kS7V6e3A7Go8nHEUExuPR3bDXOqvub0ZMfc2IboZThXLt4qp90+31OYoI9Hrd
+	m+vmiVvc8Vdk9dAKBDTDim7mS9XPZ5eNRpOjikCjfnH67+Hb7EbowYosldjRVHbv3Yej
+	StXlqCJQrRyW3+a3E2FTX18R/wTztyQcT29n3+QLHHUE8rmdrWTM35BHQpZKTDsci28k
+	/UlxFBBYkk4m4tGQFXxKiK9EN4KW7TghjjoCjm2Zz/j48eilabpucBQS0HVde+LAWnsQ
+	5hsSIAESIAESIIH/L4HvkRHshAplbmRzdHJlYW0KZW5kb2JqCjY0IDAgb2JqCjEyNDMK
+	ZW5kb2JqCjYxIDAgb2JqCjw8IC9MZW5ndGggNjIgMCBSIC9UeXBlIC9YT2JqZWN0IC9T
+	dWJ0eXBlIC9JbWFnZSAvV2lkdGggMjM2IC9IZWlnaHQgODQgL0NvbG9yU3BhY2UKL0Rl
+	dmljZUdyYXkgL0ludGVycG9sYXRlIHRydWUgL0JpdHNQZXJDb21wb25lbnQgOCAvRmls
+	dGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAHtnGtz6VAUhuUekYhI0Wg5Tl2qWjHD
+	cavSoVKl4tII9f//yEnq9LBbvnfvWe8HY5sxs961nsiYeVcCARB0ADoAHYAO/JwOUDTN
+	kCOaok61lqIZjhfEICkSBZ5ljtulGE4MKaoWJURaJCxLAksfmS3N8CFVTyQvU2kylLo0
+	4lElyDHfzFKMIOvJTL50Z5oVEmSWb4u5dEKT+K9mKYaXz1IFs95+6PbIULfTqt1lk5rE
+	0egvFM2F9FSx2ulbo5cxGXp5Hj62KjlDDbIoxYyoGoVq13qdzRdLMrSY2+NB27yKyTwy
+	WIoN6RmzY02XK9ddkyHXdRaTQePmIiIyhxDTvJLI1/uTpbvZvL+/b/GX52KzWc1H3UpG
+	lxCIaUFNltrWbOU7JcLrduuZXb+99v/k4jJ3eMEyonZ59zCau4RM9YNLz6xjD5uFhMIj
+	XoNayuy+LFxShrozu1nNrHbRCH/xGk2bvfHS84r/pbp38OH15ojXCple7095Xe97QsI7
+	f66+V+HwBssEo2l/ruR5fb6/SarglQRy9x48hmGucL3ugcDwHTAM9xwMsUVKBoaBYQQI
+	DA/AMDCMIbZIycAwMIwAgeEBGAaGMcQWKRkYBoYRIDA8AMPAMIbYIiUDw8AwAgSGB2AY
+	GMYQW6RkYBgYRoDA8AAMA8MYYouUDAwDwwgQGB48hj9ya0gw/DO35hIVvdz+94pmaj9z
+	phhO71TJXn7Yz9R+z15qqfIuP3zqm/h97nu1h63rczQ/TIuRi9vO89zPwONn6mjFfpZ/
+	40yfGvmEgmTgaSFsFJtD21kTY9a36i4nj9VsLIR4pTg5nq0+juer9YYYrV3HtjrldBTd
+	46BYKZq6bQ4m8zdnRYgcZ2mPerWCF5VG9nMC/oJO1mz3R69Te0aG7OnE6tVLaR1FOBCg
+	2GAkmSs3HvpPQ4sMDQeP97VSJq4IXxclaU7SjN9Fs9ZotolQq1mvlgvpeFhEtq78bTNv
+	q1lSYxe/svnrIhG6LuSv0oauiOzhYsNusY6iOVFW9Vji3CBC54n4WTQcOr7ETdEsL0qy
+	EiZEihwKCkc2uD9Hy7AcT4w47tRjCP7ZpSjvGRNEyHNy+Pdm5w9eoQPQAejAj+vAX1W0
+	pJsKZW5kc3RyZWFtCmVuZG9iago2MiAwIG9iago4NDIKZW5kb2JqCjY1IDAgb2JqCjw8
+	IC9MZW5ndGggNjYgMCBSIC9UeXBlIC9YT2JqZWN0IC9TdWJ0eXBlIC9JbWFnZSAvV2lk
+	dGggNDAyIC9IZWlnaHQgMjM4IC9Db2xvclNwYWNlCi9EZXZpY2VHcmF5IC9JbnRlcnBv
+	bGF0ZSB0cnVlIC9CaXRzUGVyQ29tcG9uZW50IDggL0ZpbHRlciAvRmxhdGVEZWNvZGUg
+	Pj4Kc3RyZWFtCngB7ddrU5J7FIZxeTgjB9EUtU0nQx0PNOlWMg9tDfKQiAoIff8vsqGm
+	Aqu7/aKee/Z0rTe9WFOr+V3+oSYmGAQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAA
+	AQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAAB
+	BBBAAAEEEPj/CkSCIMqEKhAEkciPfmAiQTSeSKbSTJgCqWQ8Fv1+k0g0nprMFYrTTIgC
+	xal8NpOMBd9pEkQTk4WZ0uJf5UdMeALlhwtz07l0/NtnEokmszOLTyprG9XqCyYsgerm
+	+upSuTSVid9/JZFoIvugvFzd2Ts4PGLCEzjcr22tLy0WB0nGv9+D+ORMeXVr/7hxenbO
+	hCdw9q5+VKs+Xyik7n1uRVOFheWtw8b7q9b1DROewHWreX6yt/l0Njv+SCKxyZkn1f3G
+	5U2n271jwhPodtuti+Pd1cXBIxn92AoSuVJl5/jiptvr9fv9D0w4AgPr3l2ndXpQfTyT
+	iY3+CzhIFhbX9hpXnWEPioST4+OVYZLbi3+2lwYfW6NFoqniXxsHp60uLyTEGp+TtC/f
+	7lZKufEi6WK5enh23eWBhF3kQ7/XbtZrK/O5xNgbSU8/qh6d3wyKhP43+uMP9jpXjVcr
+	C/lvirygiOeHY1hkb/UHRe48f6c/++qXIqP/a48OPrWGb4Qihh8OihjQ5UmKSB7DkiIG
+	dHmSIpLHsKSIAV2epIjkMSwpYkCXJykieQxLihjQ5UmKSB7DkiIGdHmSIpLHsKSIAV2e
+	pIjkMSwpYkCXJykieQxLihjQ5UmKSB7DkiIGdHmSIpLHsKSIAV2epIjkMSwpYkCXJyki
+	eQxLihjQ5UmKSB7DkiIGdHmSIpLHsKSIAV2epIjkMSwpYkCXJykieQxLihjQ5UmKSB7D
+	kiIGdHmSIpLHsKSIAV2epIjkMSwpYkCXJykieQxLihjQ5UmKSB7DkiIGdHmSIpLHsKSI
+	AV2epIjkMSwpYkCXJykieQxLihjQ5UmKSB7DkiIGdHmSIpLHsKSIAV2epIjkMSwpYkCX
+	JykieQxLihjQ5UmKSB7DkiIGdHmSIpLHsKSIAV2epIjkMSwpYkCXJykieQxLihjQ5UmK
+	SB7DkiIGdHmSIpLHsKSIAV2epIjkMSwpYkCXJykieQxLihjQ5UmKSB7DkiIGdHmSIpLH
+	sKSIAV2epIjkMSwpYkCXJykieQxLihjQ5UmKSB7DkiIGdHmSIpLHsKSIAV2epIjkMSwp
+	YkCXJykieQxLihjQ5UmKSB7DkiIGdHmSIpLHsKSIAV2epIjkMSwpYkCXJykieQxLihjQ
+	5UmKSB7DkiIGdHmSIpLHsKSIAV2epIjkMSwpYkCXJykieQxLihjQ5UmKSB7DkiIGdHmS
+	IpLHsKSIAV2epIjkMSwpYkCXJykieQxLihjQ5UmKSB7DkiIGdHnyS5HIxNeJpqcfvTg6
+	v+n25e9l+TsEflikSpHf4f2zP7Pf73Wa9Vcr8/nE+BspljcPz667fR7Jzwh/8X5QpN2s
+	15ZLubEiQWrq4fr+u1anR5JfLK7/uP5g7m4vT3Yqc9n46BsJkvmF1Vq92b4jiSb8xdtB
+	kF735vzNy2cPJmOjRSLx7NzS1pvzVueux4QqcNe9bTZeb5SL6ejXf2lNTERimenyeu3k
+	onXb7jAhCrTbN813h9uV+XwyGC0yESRypaXq3vHp+8vmFROaQLN5ed44+nutPJMZ+xoZ
+	PpL01OLzzd2D47f1BhOaQL1+8ub19trj2VwyOvo1MnguQTxTXHi6Wt3ere0xoQm8qu28
+	3KiUZ/Opse/14edXJBrPFGYfPl6qrKwyoQmsLFeeleenc6nY+LfIxyRBPJUtzMyW5heY
+	0ATmS3MPpvOZZCy495n1KUkskcpkc3kmRIFcdjKdjN//Dhn2GE4kiMbiCSZUgXh88D6+
+	80A+JRlEGUzAhCcwBP+Mz68IIIAAAggggAACCCCAAAIIIIAAAggggAACCCCAAAIIIIAA
+	AggggAACCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAAC
+	CPwXgX8B0P1liwplbmRzdHJlYW0KZW5kb2JqCjY2IDAgb2JqCjE1ODEKZW5kb2JqCjU1
+	IDAgb2JqCjw8IC9MZW5ndGggNTYgMCBSIC9UeXBlIC9YT2JqZWN0IC9TdWJ0eXBlIC9J
+	bWFnZSAvV2lkdGggNDAyIC9IZWlnaHQgMTcwIC9Db2xvclNwYWNlCi9EZXZpY2VHcmF5
+	IC9JbnRlcnBvbGF0ZSB0cnVlIC9CaXRzUGVyQ29tcG9uZW50IDggL0ZpbHRlciAvRmxh
+	dGVEZWNvZGUgPj4Kc3RyZWFtCngB7ZfZUhpbAEXpbuYGkcEJxVm0UNFgnKKY4IQ4gChT
+	/v9HbmNdE1DZb5z9kH1erMo2LGstT4M+n44MyIAMyIAMyIAMyIAZA5ZtOzpGDdi2ZY2K
+	a9lOIBgKR3RMGgiHAn7n6yaWEwi78UQypWPQQHJyIhYN+e0vmthO0E2kZ7ILuUUdcwZy
+	83PTqXgk8PmaWE4ols4ubxR2isU9HVMGirvbW2u5mclo4OMtsZxgLJPLFw9Pz8sXOuYM
+	lM+OS9tr2aSXZPj93Q646dxW6axyU72r6ZgzcHd7fXFcXJ9LhD88t5xwYi5fKt881BvP
+	TR1zBp4bT7XL092VqdjwJbH8bnq5eHbz2Gy12x0dcwba7dfGfeVoK+tdksHHlh2Mz2wc
+	Vu6b7W631+v91jFjwHPd7bQa1fPiUjrqH/wEbIcS2cLpTb3V76EiZnK8UfpJXu5/Hax5
+	j63BIk44ubBzXm20dUMM1nhP8vp4dbQxEx8uEknmiuW757YuiOkiv3vd16fr483ZeHDo
+	jkRSi8WLWtMrYvwn+ueB3Vb95mRzbuJTkT0V4fxy9Iucbo0o0uH8TP829U+Rwb/aHe+p
+	1b8jKkL45VARgnSIVBGohzCqCEE6RKoI1EMYVYQgHSJVBOohjCpCkA6RKgL1EEYVIUiH
+	SBWBegijihCkQ6SKQD2EUUUI0iFSRaAewqgiBOkQqSJQD2FUEYJ0iFQRqIcwqghBOkSq
+	CNRDGFWEIB0iVQTqIYwqQpAOkSoC9RBGFSFIh0gVgXoIo4oQpEOkikA9hFFFCNIhUkWg
+	HsKoIgTpEKkiUA9hVBGCdIhUEaiHMKoIQTpEqgjUQxhVhCAdIlUE6iGMKkKQDpEqAvUQ
+	RhUhSIdIFYF6CKOKEKRDpIpAPYRRRQjSIVJFoB7CqCIE6RCpIlAPYVQRgnSIVBGohzCq
+	CEE6RKoI1EMYVYQgHSJVBOohjCpCkA6RKgL1EEYVIUiHSBWBegijihCkQ6SKQD2EUUUI
+	0iFSRaAewqgiBOkQqSJQD2FUEYJ0iFQRqIcwqghBOkSqCNRDGFWEIB0iVQTqIYwqQpAO
+	kSoC9RBGFSFIh0gVgXoIo4oQpEOkikA9hFFFCNIhUkWgHsKoIgTpEKkiUA9hVBGCdIhU
+	EaiHMKoIQTpEqgjUQxhVhCAdIlUE6iGMKkKQDpEqAvUQRhUhSIdIFYF6CKOKEKRDpIpA
+	PYRRRQjSIVJFoB7CqCIE6RCpIlAPYVQRgnSIVBGohzCqCEE6RKoI1EMYVYQgHSJVBOoh
+	jCpCkA6RKgL1EEYVIUiHSBWBegijihCkQ6SKQD2EUUUI0iFSRaAewqgiBOkQqSJQD2FU
+	EYJ0iFQRqIcwqghBOkSqCNRDGFWEIB0iVQTqIYwqQpAOkSoC9RBGFSFIh0gVgXoIo4oQ
+	pEOkikA9hFFFCNIhEhZpw/+qcSwG/hSxfH+PE0kt7l3Umu3eWJh6UWRgVJFcsVx7VhGk
+	bjxbr9t6uj7ZnI0Hh+5IOLmwe171iuiSjMf7qFft9Xrd16ero/zMcBE7lJgv/Litt7re
+	dyjKKH1j+HdPd+flofJ9fToWGLwjdnBiNn90+fjS6ScZA1gv+bUB74Z028935f3ldNQ/
+	WMQKuJnV/fPb+mu7o2PUQLvVfLg6LixMhp2/n7R8PsuJTM5vHf6sPjWaLzomDTTrD9dn
+	+2vT8aA9WMRnB2OZpe3D8nX1/kHHoIH72u3lj2/5+WRk6KHVvyShienlQumk/LNSudQx
+	ZKBS+XVxdlTML6TdD1fE57P94Ymp3Hqh+K10cPBdx4yBg4PS3s7mSjYVCzqD7+v955fl
+	JYmnpucXl1dX13RMGVhdWcrNZRLu5yBvSYLReCKVzkzpmDOQSScn3HDg0w15e5f3rkkw
+	HIm6bkzHkAHXdaORUMCxPz6y3j92Wbbj+P0BHWMG/H6/l2NUj/+7WDomDbzfBn2VARmQ
+	ARmQARmQARkwYOA/LaDxbQplbmRzdHJlYW0KZW5kb2JqCjU2IDAgb2JqCjE0NzYKZW5k
+	b2JqCjU3IDAgb2JqCjw8IC9MZW5ndGggNTggMCBSIC9UeXBlIC9YT2JqZWN0IC9TdWJ0
+	eXBlIC9JbWFnZSAvV2lkdGggMzM2IC9IZWlnaHQgNzAgL0NvbG9yU3BhY2UKL0Rldmlj
+	ZUdyYXkgL0ludGVycG9sYXRlIHRydWUgL0JpdHNQZXJDb21wb25lbnQgOCAvRmlsdGVy
+	IC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAHt3NlS4lAQBmCykbAEBGTVuCFLKcRSRxEV
+	HRRUlIAIAX3/F5lEaigCcuq0V1Pj/19YVprm4quOqHU6Ph8CAQhAAAIQgMD/LSCIooQQ
+	BERREFaNhCBKil/VAgi/gKYqsvS1qCApWkiPxuIIt0BsLRIOqrL4hago+UPRRDq3aWwh
+	vALGRjYV1wPK8ogKkhpO5HYKBxXTPEL4BMzqYTlvpNeCyuKECpI/vG4UzbP6deMG4RVo
+	XNVODvO5mAPq/VQSlVDCKJ9cNduPTx2EV+DpoXVTM/ezUW3hjpe0aLZ40mi/9PqvA4RX
+	4LVvde7q1d1k2DugghxK7JhX7e5gZNtjhFfAtof95+Z5OecM6PwNL/r1dOGs+TywJ5P3
+	9/cPhEfAkZqMR/3Ha3M7EZTnf2cS1WjuoN7ujVxNePJgfr7GBX17/n2ad274eU9Ji21W
+	rh/7NqaT2/Iv6LB7f15I617PQMwwG0+vNoaT5vnxPhlarVopo/s98xmIb5k3nYHjSXy/
+	H//yyajXvihlI0ueR/D8znC4nvXyCs/xd97xZ/fMPOf/QpKc+92dT3iShwOeZDJmAzyZ
+	POQiPMlkzAZ4MnnIRXiSyZgN8GTykIvwJJMxG+DJ5CEX4UkmYzbAk8lDLsKTTMZsgCeT
+	h1yEJ5mM2QBPJg+5CE8yGbMBnkwechGeZDJmAzyZPOQiPMlkzAZ4MnnIRXiSyZgN8GTy
+	kIvwJJMxG+DJ5CEX4UkmYzbAk8lDLsKTTMZsmHkunlecnq9j9qK4LLDSc3r+c7kBVxgC
+	zoHvkdW6KGUWz3/GjOr0fDKjGaUlAcfTPZ9cTHvPJ4va2sbh1UPf3UdY6sGFVQLu7sb4
+	rXt3Vkh59xFENZIt11rWcAzQVXhfXHc4J/agc3u8tx7y7MsISjiVP7nt9EfjCUIQGNtv
+	VvuyYsQCnn0uQQ7GjcPa3XP/bThCuAWGw4H10DgtZCLq/HFvn89dkMub9ebjS9fqIZwC
+	ltXttG9+HRiJoGf9yOcT5MBabr96ft28b7URToFW6+728vRgO6mrC/vFPlEJxrK7ZfP0
+	vFZHOAUuamfHlYKRjGieTyN3M9Z5ekgwmtzYzhdKZYRToFQs7BmZuK7J3p+en6CiooWj
+	iWQ6k0U4BTLp1Ho8suKBLIIo+7VgWI8g3AJ6OBRQv3gay3QX3nkAk6z4EYKAojgPC5r/
+	z9JUcvZVcCIivAIu18wO30AAAhCAAAT+GYE/v2FL9wplbmRzdHJlYW0KZW5kb2JqCjU4
+	IDAgb2JqCjkyNQplbmRvYmoKNTkgMCBvYmoKPDwgL0xlbmd0aCA2MCAwIFIgL1R5cGUg
+	L1hPYmplY3QgL1N1YnR5cGUgL0ltYWdlIC9XaWR0aCA1MDIgL0hlaWdodCA0OTAgL0Nv
+	bG9yU3BhY2UKL0RldmljZUdyYXkgL0ludGVycG9sYXRlIHRydWUgL0JpdHNQZXJDb21w
+	b25lbnQgOCAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAHt2FtTk2cYRmHy
+	ZUtIQEBkY6NtKcK4iVOtIlWwKKhYIiKEpP//jzRpp50G9faY1fWe9OBpZ3qvyw9tp6Z8
+	FrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGAB
+	C1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCA
+	BSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jA
+	AhawgAUsYIGrXaBUFGUfrUBRlEpf/XVZKsrVWr0x7YMVaNSrlfJX3EvlamOmPTe/4GMV
+	mL8222rWK8WX3ItybWZucXntu84tH6pA5+bqjYX2dPULn3upXG8trn2/cfd+t/vQByrQ
+	fXBva72zfK1Z/exrL5VrreudO90nOy9293yoArvPtx/dW1+bH7Ff+jNdUZ1Z7Gw9er5/
+	+PbdkQ9V4N2bg73t7k+rc43LP+PLjbnVO492D3//cPLx1Icq8PGkd/Rq58EPS61LH3up
+	MrP4fff54fHpeb9/4UMV6PfPTt7vP91aG33sEz/ii1p7eePJ/vvT/mAwHA7/8GEKjDgH
+	F+cnb190by82KxP/9VbU59bu7hx+OB+bq44h/2vImP3T+98er49+xE+olxvz391/8fak
+	75fOEv+H/ez49dON5fYl9en5Tnf33ce+HzpQ/Y/h4Kx3sL250q5NfuvTC7e6e0enI3Xi
+	6v/9psH5h8Nnm6uzn6s/VB37q2OsvrP1NfUL7O7/97B/1Sf+71x59BN+/K2rzvzVoTrT
+	Na9SPfdhXlVnuuZVquc+zKvqTNe8SvXch3lVnemaV6me+zCvqjNd8yrVcx/mVXWma16l
+	eu7DvKrOdM2rVM99mFfVma55leq5D/OqOtM1r1I992FeVWe65lWq5z7Mq+pM17xK9dyH
+	eVWd6ZpXqZ77MK+qM13zKtVzH+ZVdaZrXqV67sO8qs50zatUz32YV9WZrnmV6rkP86o6
+	0zWvUj33YV5VZ7rmVarnPsyr6kzXvEr13Id5VZ3pmlepnvswr6ozXfMq1XMf5lV1pmte
+	pXruw7yqznTNq1TPfZhX1ZmueZXquQ/zqjrTNa9SPfdhXlVnuuZVquc+zKvqTNe8SvXc
+	h3lVnemaV6me+zCvqjNd8yrVcx/mVXWma16leu7DvKrOdM2rVM99mFfVma55leq5D/Oq
+	OtM1r1I992FeVWe65lWq5z7Mq+pM17xK9dyHeVWd6ZpXqZ77MK+qM13zKtVzH+ZVdaZr
+	XqV67sO8qs50zatUz32YV9WZrnmV6rkP86o60zWvUj33YV5VZ7rmVarnPsyr6kzXvEr1
+	3Id5VZ3pmlepnvswr6ozXfMq1XMf5lV1pmtepXruw7yqznTNq1TPfZhX1ZmueZXquQ/z
+	qjrTNa9SPfdhXlVnuuZVquc+zKvqTNe8SvXch3lVnemaV6me+zCvqjNd8yrVcx/mVXWm
+	a16leu7DvKrOdM2rVM99mFfVma55leq5D/OqOtM1r1I992FeVWe65lWq5z7Mq+pM17xK
+	9dyHeVWd6ZpXqZ77MK+qM13zKtVzH+ZVdaZrXqV67sO8qs50zatUz32YV9WZrnmV6rkP
+	86o60zWvUj33YV5VZ7rmVarnPsyr6kzXvEr13Id5VZ3pmlepnvswr6ozXfMq1XMf5lV1
+	pmtepXruw7yqznTNq1TPfZhX1ZmueZXquQ/zqjrTNa9SPfdhXlVnuuZVquc+zKvqTNe8
+	SvXch3lVnemaV6me+zCvqjNd8yrVcx/mVXWma16leu7DvKrOdM2rVM99mFfVma55leq5
+	D/OqOtM1r1I992FeVWe65lWq5z7Mq+pM17xK9dyHeVWd6ZpXqZ77MK+qM13zKtVzH+ZV
+	daZrXqV67sO8qs50zatUz32YV9WZrnmV6rkP86o60zWvUj33YV5VZ7rmVarnPsyr6kzX
+	vEr13Id5VZ3pmlepnvswr6ozXfMq1XMf5lV1pmtepXruw7yqznTNq1TPfZhX1ZmueZXq
+	uQ/zqjrTNa9SPfdhXlVnuuZVquc+zKvqTNe8SvXch3lVnemaV6me+zCvqjNd8yrVcx/m
+	VXWma16leu7DvKrOdM2rVM99mFfVma55leq5D/OqOtM1r1I992FeVWe65lWq5z7Mq+pM
+	17xK9dyHeVWd6ZpXqZ77MK+qM13zKtVzH+ZVdaZrXqV67sO8qs50zatUz32YV9WZrnmV
+	6rkP86o60zWvUj33YV5VZ7rmVarnPsyr6kzXvEr13Id5VZ3pmlepnvswr6ozXfMq1XMf
+	5lV1pmtepXruw7yqznTNq1TPfZhX1ZmueZXquQ/zqjrTNa9SPfdhXlVnuuZVquc+zKvq
+	TNe8SvXch3lVnemaV6me+zCvqjNd8yrVcx/mVXWma16leu7DvKrOdM2rVM99mFfVma55
+	leq5D/OqOtM1r1I992FeVWe65lWq5z7Mq+pM17xK9dyHeVWd6ZpXqZ77MK+qM13zKtVz
+	H+ZVdaZrXqV67sO8qs50zatUz32YV9WZrnmV6rkP86o60zWvUj33YV5VZ7rmVarnPsyr
+	6kzXvEr13Id5VZ3pmlepnvswr6ozXfMq1XMf5lV1pmtepXruw7yqznTNq1TPfZhX1Zmu
+	eZXquQ/zqjrTNa9SPfdhXlVnuuZVquc+zKvqTNe8SvXch3lVnemaV6me+zCvqjNd8yrV
+	cx/mVXWma16leu7DvKrOdM2rVM99mFfVma55leq5D/OqOtM1r1I992FeVWe65lWq5z7M
+	q+pM17xK9dyHeVWd6ZpXqZ77MK+qM13zKtVzH+ZVdaZrXqV67sO8qs50zatUz32YV9WZ
+	rnmV6rkP86o60zWvUj33YV5VZ7rmVarnPsyr6kzXvEr13Id5VZ3pmlepnvswr6ozXfMq
+	1XMf5lV1pmtepXruw7yqznTNq1TPfZhX1ZmueZXquQ/zqjrTNa/6V7009Z9Xnl649XDv
+	6LQ/zP+016tZ4OvqXdWvJuk3/62Hw8F57+DZ5sps7dK3Pt95sPvuY3/ox/7NiFfubxip
+	n/UOtu8styfVi8a1m/eevzk5H8h+5VC/8S88HL2LT8evnmzcaFUnvvWiPru6tX3QO7uQ
+	/RsRr9x5hD7onx69/PnH6zOVCfVStXVj/dHLo5Pzi4GPVuCi/6l3+Ov9zvx0+T9/gp+a
+	KlWaC51726/en3w6O/exCpydnfbe7D7eWJmtFxPqU0Wtvbze3dl/+/tx74OPVKDXOz46
+	3PvlbmexOfnb+vhjn7629tODpy/2Xx8c+kgFDg5evfz18d3bS+16eeK39dF3X1Sb86s/
+	bHUfP93e8ZEKPNt+8vP9jc7SbGPyz3LjH/alcrU5t3Tz9vrG5paPVGDzzsaPnZWFdqNy
+	6Xf1v9iLaqM1t7i0vLLqIxVYWb5xfWG2Wa8Ul3++/81eqTWarfasj1Wg3ZqZrlc/+z19
+	bD5+paJcqdZ8tALV6ug7/9KH/jf7CH70Ch+qwNj0H1//agELWMACFrCABSxgAQtYwAIW
+	sIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAEL
+	WMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAF
+	LGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1gAUuBPhGXoYQplbmRz
+	dHJlYW0KZW5kb2JqCjYwIDAgb2JqCjI4MTIKZW5kb2JqCjUxIDAgb2JqCjw8IC9MZW5n
+	dGggNTIgMCBSIC9UeXBlIC9YT2JqZWN0IC9TdWJ0eXBlIC9JbWFnZSAvV2lkdGggNTAy
+	IC9IZWlnaHQgODgyIC9Db2xvclNwYWNlCi9EZXZpY2VHcmF5IC9JbnRlcnBvbGF0ZSB0
+	cnVlIC9CaXRzUGVyQ29tcG9uZW50IDggL0ZpbHRlciAvRmxhdGVEZWNvZGUgPj4Kc3Ry
+	ZWFtCngB7ddZd1QFGkbhVCojGYCAgTBEBg2DMggyCwgyyBQIJIT+/3+kK3brMiDbu+7F
+	dp8bLz5dK+9+cirl2FhPBSpQgQpUoAIVqEAFKlCBClSgAhWoQAUqUIEKVKACFahABSpQ
+	gQpUoAIVqEAFKlCBClSgAhWoQAUqUIEKVKACFahABSpQgQpUoAIVqEAFKlCBClSgAhWo
+	QAUqUIEKVKACFahABSpQgQpUoAIVqEAFKlCBClSgAhWoQAUqUIEKVKACFahABSpQgQpU
+	oAIVqEAFKlCBClSgAhWoQAUqUIEKVKACFahABSpQgQpUoAIVqEAFKlCBClSgAhWoQAUq
+	UIEKVKACFahABSpQgQpUoAIVqEAFKlCBClSgAhWoQAUqUIEK/M8LDAaD8R5ZgREq/CIN
+	xocTk1NT0z2qAlNTkxPD8c/AD8Ynpmbn5hcW9/aYCiwuLszvmZ4c/iX7YDg5O7/v4PLh
+	lZUjPaICKyuHvlraOzc98Rev+2A4tWff8rGT35w5d+58j6fAuXNn106vrhxYmJkY/+Sv
+	+/jk3NKRU+cv/3jj1u0eVYFb169eWFtdXpyZ+PhDfjAxu//Itxdv3H3w6PGTHlOBx49/
+	+fnO1e9OLC9Mf/y3fTi9cOj0pVsPn754tb7+usdTYH19/eXzx/eunV89MDe5+2UfTOxZ
+	Wv3+5sPnr99ujp6tHk2BEee7jVdP711dW1mc3v2XfTA5v/zN1fvP3my+3x49H3o0BXY8
+	37979fj2hdWl2Yld3+fGpxdXzt589Ordjvi/ekwFRr+/21sbz+5fOXVwbvf3ufGZfUe/
+	u/P09dZ25ibxnS07n1rv3718eO3b5fndf9iHs/uPX7j765ut3nQb+m/u2+9ePbqxdmhh
+	atfXueHs0urFe882tnrVneqb649unjm8+Kn6pdSF4v+ZtL25/vjW2ZXPqL/X7v5nD0v9
+	n+j/h/qu/2Hf+bu+8wnfu+78nUjd6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOV
+	V6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+
+	zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWn
+	K69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XO
+	fZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvq
+	TldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69K
+	nfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX
+	1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTlde
+	lTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4
+	r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2u
+	vCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3
+	cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7
+	XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp1
+	7uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5T
+	d7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV
+	6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8
+	pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ry
+	qtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzH
+	eU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu50
+	5VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5
+	j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d
+	6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWp
+	cx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/Oa
+	utOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqr
+	Uuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/n
+	NXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOV
+	V6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+
+	zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWn
+	K69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XO
+	fZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvq
+	TldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69K
+	nfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX
+	1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTlde
+	lTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4
+	r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2u
+	vCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3
+	cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7
+	XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp1
+	7uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5T
+	d7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV
+	6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8
+	pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ry
+	qtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzH
+	eU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu50
+	5VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5
+	j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d
+	6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWp
+	cx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/Oa
+	utOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqr
+	Uuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/n
+	NXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOV
+	V6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+
+	zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWn
+	K69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XO
+	fZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvq
+	TldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69K
+	nfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX
+	1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTlde
+	lTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4
+	r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV6XOfZzX1J2u
+	vCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3
+	cV5Td7ryqtS5j/OautOVV6XOfZzX1J2uvCp17uO8pu505VWpcx/nNXWnK69Knfs4r6k7
+	XXlV6tzHeU3d6cqrUuc+zmvqTldelTr3cV5Td7ryqtS5j/OautOVV7H6Fv/HXb/QAn+o
+	D8b+9Axnl1Yv3Xu2sfXhC53Vj40FPqt+/OLdZ2+2PnzIHft9kccP25uvHt08c3hhave7
+	PrP/2IWfnqb+RaL+zQ89epO337365fraoYXJXerj03uPnr/9ZH1ze/Sv9Lb/TcYv7DwS
+	ff/2xYMfv1me/0h9avHw2vWHL9++32H/wlb142KB0Zu+vfXm17uXTxzYM7HrXR9Mzh08
+	efmnJ+vvtt732ApsbW68+OXG+WP7ZoZ/+gY/NjYYzu47evba/acvX2+87ZEV2Fh//ujO
+	5dPLC1Pju9THxqfmD3793bW7j54+f9HjKvD82ZMHt39YO7p/dvcH/M7LPr24fOLclZs/
+	3X8weh72SAqMMH++d+f6xbVjB+Y+ftXHxsYnZha/On763MUfrlztURW4cun7MyePLM1P
+	DXd9l9v5sB+M2OeXlo+unjh16nSPqMCpk18fXzm4d+4v0H9jn9qzsHfpwMGvelQFDh7Y
+	vzg3M/npm/7bV7vR6z41M7tnrkdWYM/s9ORw/JOP99+/zw/Gh8OJiYnJHlGBEeiI/LPm
+	/7Uf9MgK/P5S988KVKACFahABSpQgQpUoAIVqEAFKlCBClSgAhWoQAUqUIEKVKACFahA
+	BSpQgQpUoAIVqEAFKlCBClSgAhWoQAUqUIEKVKACFahABSpQgQpUoAIVqEAFKlCBClSg
+	AhWoQAUqUIEKVKACFahABSpQgQpUoAIVqEAFKlCBClSgAhWoQAUqUIEKVKACFahABSpQ
+	gQpUoAIVqEAFKlCBClSgAhWoQAUqUIEKVKACFahABSpQgQpUoAIVqEAFKlCBClSgAhWo
+	QAUqUIEKVKACFahABSpQgQpUoAIVqEAFKlCBClTg/1ng3++OKP0KZW5kc3RyZWFtCmVu
+	ZG9iago1MiAwIG9iago0NTczCmVuZG9iagozNyAwIG9iago8PCAvVHlwZSAvRXh0R1N0
+	YXRlIC9jYSAwLjcgPj4KZW5kb2JqCjM4IDAgb2JqCjw8IC9UeXBlIC9FeHRHU3RhdGUg
+	L0NBIDAuNyA+PgplbmRvYmoKNjcgMCBvYmoKPDwgL0xlbmd0aCA2OCAwIFIgL04gMyAv
+	QWx0ZXJuYXRlIC9EZXZpY2VSR0IgL0ZpbHRlciAvRmxhdGVEZWNvZGUgPj4Kc3RyZWFt
+	CngB1VlnWBTNsu6ZTcCypCXnHEVylpwkSA6CSFrSknMOSlKCIIiAgKCACCKCGAgCImAC
+	RIKAEQmiIKhgAgThDur3fec+55x/98+d55med6uqq2unerqn3gGAbdktONgfpgMgIDA8
+	1MpQh/eggyMv7gWgBDSAEYgBSjdSWLC2hYUp+K/H9wkA7SrHJHd9/Vez/6yg9/AMIwEA
+	WSBqd48wUgCCrwMA65CCQ8MBQK0j8uGo8GAEox8gmDEUCRDBL3ex92+8sovdf2EM+peN
+	jZUuABhWACio3dxCvQEgCCJy3kiSN+KHoAcAliHQgxwIAPEggjVIPm4eALAVIzZ7AgKC
+	dnEfgkXd/8WP979gNzf3v326uXn/jX//F6QnMrAeOSzY3y3m14//yybAPwK5X78OBqSl
+	DvQ3280NM3IueLjpmSBXTuTcDvb/lTPEBmL3DLS1RmS7eE+gu5n5H6zhFWpghWCkL2QR
+	HK6zi5F7BnkFh1vY/JEnxvromiGYGpEXeIbp/+XnnK+b8W7OaBB5c2iElS2CBRHcHRZp
+	rY9gZEZBb2J9bOz/2Hz18NT7I4dhL7KB0W8bmIEcbrQ7FiOSc36/IJPdGJCxYEVgAvyB
+	J4gAoUgbCCSBKdAFen9aSeAF3BBNJKILA37gLYIDkB5BSJ8gBPP+sdP9N4nBr37eSL//
+	7ZEXkBDbiL/H/D0aLzLmXz7JwAPBf8ndkDF2dbvRhbmQk/8Z8y+LXX+/opGul16U3vor
+	JrQwWhatgNZBq6M10CqAF82MZgeSaHm0MlobrYlWQ3QqwAC8QTx7/xXjrv+AZq/I4qAY
+	VTsfRLv7393/0gK7X9bkv3//WwSAPLTcsvxXBACEe0YjzwEAukHBMaFkb59wXm3kyfXc
+	w2sUSNq7h1dWWkZmV/3/5thds34H+8Xq11oEMT/+RxbQCIAyGZmPzv/I3E8C0C6JPPv1
+	/8iEC5G1wReAAUFSRGjkb3/o3QsGUAFaZIayAW4gAESR+ywLFIEa0AL6wBiYAxvgAJyR
+	+eODzMFQEAXiwVGQDrLASXAalIAKUAVqQQNoBi2gA9wB98AAGAbj4AWYBvNgCayA72AT
+	giAcRICIEBvEAwlBEpAspAxpQPqQKWQFOUCukDcUCEVA8VAKlAXlQyXQeagOugq1QXeg
+	h9AI9AyagRahz9APGAVTw4wwFywMS8HKsDZsAtvAh2FvOASOhVPhHLgYroQvwzfhO/AA
+	PA5Pw0vwNxRA4VHMKD6UJEoZpYsyRzmivFChqERUJqoQVYm6gmpH3UeNoaZRy6gNNBZN
+	RPOiJZF5uh9tiyahQ9CJ6Gx0CboWfRPdhx5Dz6BX0NsYAoYTI4FRxRhhDmK8MVGYdEwh
+	pgZzA3MXM46Zx3zHYrHMWBGsEnY/1gHri43DZmPPYhux3dgR7Bz2Gw6HY8NJ4NRx5jg3
+	XDguHXcGdxl3GzeKm8etU+ApeChkKQwoHCkCKZIpCikuUXRRjFK8o9ikpKMUolSlNKf0
+	oIyhzKWspmynfEw5T7lJRU8lQqVOZUPlS3WUqpjqCtVdqpdUX/B4PD9eBW+JJ+OP4Ivx
+	TfgH+Bn8BjUDtTi1LrUTdQR1DvVF6m7qZ9RfCASCMEGL4EgIJ+QQ6gi9hCnCOg2RZi+N
+	EY0HTRJNKc1NmlGaj7SUtEK02rTOtLG0hbTXaB/TLtNR0gnT6dK50SXSldK10U3SfaMn
+	0svQm9MH0GfTX6J/SL/AgGMQZtBn8GBIZahi6GWYI6KIAkRdIomYQqwm3iXOM2IZRRiN
+	GH0ZsxgbGIcYV5gYmOSZ7JiimUqZOpmmmVHMwsxGzP7MuczNzBPMP1i4WLRZPFkyWK6w
+	jLKssXKwarF6smayNrKOs/5g42XTZ/Njy2NrYXvFjmYXZ7dkj2IvZ7/LvszByKHGQeLI
+	5GjmeM4Jc4pzWnHGcVZxDnJ+4+LmMuQK5jrD1cu1zM3MrcXty13A3cW9yEPk0eAh8xTw
+	3OZ5z8vEq83rz1vM28e7wsfJt58vgu883xDfJr8Ivy1/Mn8j/ysBKgFlAS+BAoEegRVB
+	HsEDgvGC9YLPhSiFlIV8hIqE7gutCYsI2wsfE24RXhBhFTESiRWpF3kpShDVFA0RrRR9
+	IoYVUxbzEzsrNiwOiyuI+4iXij+WgCUUJcgSZyVG9mD2qOwJ3FO5Z1KSWlJbMlKyXnJm
+	L/Ne073Je1v2fpQSlHKUypO6L7UtrSDtL10t/UKGQcZYJlmmXeazrLgsSbZU9okcQc5A
+	LkmuVW5VXkLeU75c/qkCUeGAwjGFHoWfikqKoYpXFBeVBJVclcqUJpUZlS2Us5UfqGBU
+	dFSSVDpUNlQVVcNVm1U/qUmq+aldUlvYJ7LPc1/1vjl1fnU39fPq0xq8Gq4a5zSmNfk0
+	3TQrNWe1BLQ8tGq03mmLaftqX9b+qCOtE6pzQ2dNV1U3QbdbD6VnqJepN6TPoG+rX6I/
+	ZcBv4G1Qb7BiqGAYZ9i9H7PfZH/e/kkjLiOSUZ3RirGScYJxnwm1ibVJicmsqbhpqGn7
+	AfiA8YFTB16aCZkFmrWYA3Mj81PmryxELEIsblliLS0sSy3fWslYxVvdtyZau1hfsv5u
+	o2OTa/PCVtQ2wrbHjtbOya7Obs1ezz7ffvqg1MGEgwMO7A5kh1ZHnKOdY43jt0P6h04f
+	mndScEp3mjgscjj68ENndmd/504XWhc3l2uuGFd710uuW27mbpVu39yN3MvcV0i6pCLS
+	koeWR4HHoqe6Z77nOy91r3yvBW9171Peiz6aPoU+y2Rdcgl51Xe/b4Xvmp+530W/HX97
+	/8YAigDXgLZAhkC/wL4g7qDooJFgieD04OkQ1ZDTISuhJqE1YVDY4bDWcEbk5XAwQjQi
+	LWImUiOyNHI9yi7qWjR9dGD0YIx4TEbMu1iD2Atx6DhSXE88X/zR+JkE7YTziVCie2JP
+	kkBSatL8EcMjtUepjvodfZQsnZyf/DXFPqU9lSv1SOpcmmFafTpNemj65DG1YxXH0cfJ
+	x4cy5DLOZGxnemT2Z0lnFWZtZZOy+0/InCg+sZPjlTOUq5hbfhJ7MvDkRJ5mXm0+fX5s
+	/typA6duFvAWZBZ8Pe1y+mGhfGFFEVVRRNF0sWlx6xnBMyfPbJX4lIyX6pQ2lnGWZZSt
+	nfU4O1quVX6lgqsiq+LHOfK5p+cNz9+sFK4srMJWRVa9rbarvn9B+UJdDXtNVs3Pi4EX
+	p2utavvqlOrqLnFeyq2H6yPqFy87XR5u0GtovSJ55Xwjc2NWE2iKaHp/1fXqRLNJc881
+	5WtXrgtdL7tBvJF5E7oZc3OlxadlutWhdaTNuK2nXa39xq29ty528HWUdjJ15nZRdaV2
+	7dyOvf2tO7h7+Y73nbkel54XvQd7n/RZ9g3dNbn74J7Bvd772vdvP1B/0PFQ9WFbv3J/
+	y4DiwM1BhcEbjxQe3RhSHLr5WOlx67DKcPvIvpGuUc3RO2N6Y/eeGD0ZGDcbH5mwnXg6
+	6TQ5/dTj6cIz/2erzyOfb7448hLzMvMV3avCKc6pytdirxunFac7Z/RmBmetZ1/MkeaW
+	3oS92ZpPfUt4W/iO513dguxCx6LB4vD7Q+/nl4KXNpfTP9B/KPso+vH6J61PgysHV+ZX
+	Q1d3Pmd/Yfty8av8155vFt+mvgd831zLXGdbr91Q3rj/w/7Hu82oLdxW8U+xn+3bJtsv
+	dwJ2doLdQt1+vQugkBb28gLg80XkPcEBqR2GAaCi+V1T/LJAyhUIsUGwHbQXWoLPopzR
+	Quj3mG5sMS6YwopSn0oRL0W9lyBBo0xrQudKH8FwmtjGOMNMzaLNGsrWwL7EKcbly93E
+	s86nx39SYFZIRviYyCsxBfGTEsuS+nurpLZlnGTb5dkVohXHleVUclSX9xmqn9P4oWWl
+	fUFnQ89Ev8RgYb+8UZxxlyl0QMss1rzJYs6K3lrdxsM2ze6c/bWDtx16HbsPtTk1Hq5x
+	LnM56ZrsFuLuTDL1UPLk9yJ4rXnP+PSTm31L/JL9yQEWgQpBLEFrwWMh9aFJYebhPOGf
+	Iroic6KcoiWif8T0x5bEkeOVE7AJY4kVSf5HdI4KJjOm0KbSpdGn0x0jHKfMQGfsZG5k
+	fc5eOjGb8zx39ORAXk9+26krBVWnzxTmFKUUx52JKUkuLS67cXa4fLZi+dzK+ZXKlapP
+	1R8vfKhZurhQ+6Zu5tJc/WoD/RXdxsSmlquvm9ev424Qb/K0iLcqtGm2G92y7nDvjO4q
+	vn2ne6EH3UvsY7/Le0/8vtIDnYc6/aL9nwYyB9kGzz/SfLQ81PA4dFhlBBp5NFo+FvJE
+	f5xt/ONE72TRU59nis92nne/iH0p93L5VcNU2Ot909jp0ZmyWa85mbnNN/fmC956vlNd
+	YFh4v9j1PnvJfplvefHD1Y+xn3RW8Cvjqw2fy79c/7r23Wvt+YbWj4LN6Z9y2wU7O7/y
+	LwA1wQ4oBtQDdDrGBMuEfYW7RpFN6U9li9ejliOI0QjRitJJ0SswGBDtGAOZUpmrWPpY
+	l9jpOTQ4yVwl3IM8O3zK/OECVwTfC0uI+IjWii1JSO4Jlbyxd0NaU+ao7H15vIKpYo7S
+	iApR1UItZ1+/BlZTUytSu1bnhR5eX9XA3TBjf73RgPGiKXyAxUzEXM5C1VLVSs5a0IbG
+	5pvtc7tu++qDmQ6BjtaHlJw4nHYOzzr3udS4prt5uGuROElrHiOe9V5p3s4+SmQ68oLv
+	bb8i/8AA/UD2wA9Bt4NzQhxD+UMXw5rCoyJUI35GdkUlRWvFoGMexJ6Is4gnxo8nFCUe
+	QlbWlSO9RyuSU1ICUx3TDNPlj/Edpz6+ljGbOZh1M/vcieM5obmHT5rmaeYrnNpbIHqa
+	v5CziKWY/gxVCbpkq/Rr2dLZ6fLJipFzw+fHK19XLVWv16Au0tSy1Qlekq7fd9mgwfyK
+	Q6NnU+TV7Obaa33Xp26stkCtdG187XK3DDoOdQZ3pd8u7a6709BT3XuyL/yuzT3Z+/T3
+	Vx88QdamioG0Qb9HlkPKj/mG8cPrI3Ojj8aanxSNJ0yQJk2eyj/jeo55vvziyctbr6qm
+	TryOnw6e8ZsNmAt/kzCf/jbvXenChcWm9+1LvcuPPrz4uL6islr9Recb/vvX9YUfo1uV
+	2w5/8s8JnYBF4QFUAJoDPYBJxmpg13GdFMcoHajk8DT4BeqHhGs05bQn6FLoYxkiiTGM
+	MUwJzOksuaxn2RrZ+ziecn7kJvAI8urwufKnCFQJ3hVaFKERlRGzFY+TqNjTJ7koRS+t
+	JOMoGydXLn9bYUpxW5lDRUXVSo28L1E9T6NK86pWh/ZdnX7dQb0B/fsGtw2v7a80yjQO
+	NDEx5TX9euCeWZE52ULFEmc5YXXBOsxGy5badtKu2j74oJoD1mHYseSQp9Nep++Hu5zT
+	Xcxcia6TbiXIOsFDmvY45+nqxeP12vucjyuZhzzle9bPwZ/oPxSQEagfBAXdCg4PEQl5
+	Gno8TCnsXXhhhF7E58hzUWZRm9F1MXaxcGxj3KF4THxTwqFETGJTkvMRxiMjRwuTPVOU
+	U2lS59M60wuO+R3XzmDJ+JB5J6sg2+uEUg5VznRu68n8vNB861MKBWwF26ffFPYXNRaf
+	OhNZ4lCqWsaO7Jbj5TcqSs+dOJ9emVqVVn3swrGatIsJtQF1By/p16tdVm8wueLWGN9U
+	fPV686Nr89c3b9K3CLfua7Ns976V2HG681JXx+373f13Hvbc7b3T13m39d61+w0PLj6s
+	6D8zkD+Y/Sh9KOVx2nDeSO3ow7HVca4Jo8nIp5XPhp5vvBR8ZT2V+3p6hjzH+ubbO8xi
+	4nLv6ql1wd38/+aWdvcErCIANQjvYXcEAEtEU2sJgFABQnG0AWBBAMBGBcB+aQCmXwJQ
+	mejf+wcE0AgDR4dUnAJACqgjzMYhhEtIBPmgBtwCI2ARqRfZIXnIHPKDjkEXoF5oFoZh
+	AVgfqfSy4Eb4CfwDqef2o0JQJag+1CdkDhqiI9BV6DEMCiOPVGQlmCEsCquCDcbWYmdx
+	nLiDuALcKAU9hSXFKYpxSjZKF8oayo9UylQpVMN4bnwgvpuakdqX+g6BgxBFGKdRpDlD
+	s0PrTTtKp013jV6cvoZBhKGRqEYcZHRh/Mp0glmceYAlmJWFtZcthJ2ffYLjBOd+LizX
+	Pe5MHkteTt4PfH38VQJZgrFCAcIeIi6izmKu4p4SAXtiJDP2lku1S0/KvJf9KPdG/olC
+	r+JNpSvKl1TqVC+pNe1rVe/TGNOc19rQodUV0zPQ9zbIMry6/4UxzkTW1P5AqFmKea5F
+	uWWL1QsbSlsNuyhkv/vsKH8o2umOM8HFybXObZnE5aHpae8V4H3cp5n8wU/JPyPgdZBi
+	8MmQj8j+1hzJFBUe3R/LEuccX5uwk+RzZCbZLeV1mkP6+HGHjK2shZycvLMF7IXGxcEl
+	xWWt5UPnZiq/X6C5KFZnUh/d0N7E3Vx5Q6KlvG2nw6nr1h3e3sy7Gw98+sceyT/OGpl7
+	cmBi6Jnri42pohnluddvUxc2l/iXtz9WrwiuVnxh+1r5XWPt3Ubxps7W1Hbor/UDQjgH
+	PCACLoSBVUL4HntARliFPHARdIEJ8AmiQjgCHcgFSoTKoS5oGsm9MGwMB8OFcBf8FkWH
+	UkV5ovJQt1Ef0JzoA0iFfhX9BsOGMcOkYTqR6lsa64/k/S1OCOeFq8UtUUhRRFB0UmIp
+	LSjPUr6nUqXKonqNl8dn4d9Qa1Kfpf5JcCXcpZGkKaLF0EbSLtGR6Kbp3enfM8QQaYmX
+	GA0ZF5iymGWYn7Oks8qzvmUrZbfhoOMY5SzmcueW4gE847wNfBn83gLGgjJCHMIUwpsi
+	X0W/im1JEPYISGrsdZXKkG6TeS/HKW+hkKU4qEyvYq96Rm1MHdIQ1jTQ8tI+rtOgO64P
+	G8gaeu0/azRpwmxqd6DQbMyCxtLQKsm63WbNTtE++mCnI+aQhVPF4c8uxq7Vbj9Jlsg6
+	9d5bzieBPODH5R8ScC+IKzgyZCxMPrwoYivKJborljUuMP5eokBS5pH1ZN+UV2kW6b3H
+	lTIasvizS3JYcivyVPM/FLQWFhUnl4SUuZQbn5Ov5KmmubBz8XPd2/qnDQ8aO662Xbtz
+	43HLq7alWxtdVN28Pap9B+/FPCjtbx8cHnox/HR08EnHxOWnZ5/nvTw2lTQdMxv1Jvpt
+	3EL0+8PLzB9qPrGskFerPo9/WfvG8l1uzWI9bOPMj0dbuJ+W29V/8o8FBMCCPP0yQAfh
+	l3xAAihAOKT7YBbsQFzQPugwkvvz0D3kLZMBVoVJ8Am4FZ5HEVHaCHNThZpAUyLsYgT6
+	Mnoew4M5hCnGTCCMiz22BDuFE8D54q7htimMKYopFhDG5ATlHJLzAqoVvDm+iZpIHUM9
+	SzAjdNJI01yg5aEto+Omq0Z4iz4GFyKM5NueCcd0izmcRZplhfU6WwK7EQcrxzJnH9c5
+	7iQeEq8pnwq/uACfII8Qn7CYiKKokZiLeIxE0Z52yVkpBmljmXTZXnmMgqVigzJRJUl1
+	dR9ZfUHTX+u7Troep367oYsR3rjDlGyGMc+yBFZB1q9szex6kD2p9ZCKU7ezmcuMWzSJ
+	1qPKS967m2ziO+lPClgNOhrCFNoYfiBiJepMjHEcFN+aSEraPpqTwppamS55rDPDJnM9
+	+0pO4EnxvLFTvgVfCiOKvp2JKtkqSy9nrKg5r1Y5Vh1QQ3Wxtm7/pcXL2VfkG99cPX/N
+	/4ZeC38bun2xY6Srs7uhp7Kv5F7Bg7z+3MHcoazhhFHnJ9Lj3yabnwW8EHv5durCtNes
+	+NzqfMe7tEW996vLxz98/mS0kr3a8vnVl+WvG9/mvj9cy1/ft/52I3Vj40fgj7nNg5u3
+	txi3yFtdPxl/kn92bVNsW2wXb7/eEdkJ2mnZzX+Yl5zs7u4BIGodhH6c2tn5IgwALh+A
+	n3k7O5uVOzs/q5BiA/kG0u3/+3vFrjEW4dzLbu2i/3T8D+gdk/4KZW5kc3RyZWFtCmVu
+	ZG9iago2OCAwIG9iago1OTUzCmVuZG9iago1MCAwIG9iagpbIC9JQ0NCYXNlZCA2NyAw
+	IFIgXQplbmRvYmoKNjkgMCBvYmoKPDwgL0xlbmd0aCA3MCAwIFIgL04gMSAvQWx0ZXJu
+	YXRlIC9EZXZpY2VHcmF5IC9GaWx0ZXIgL0ZsYXRlRGVjb2RlID4+CnN0cmVhbQp4AYVS
+	T0gUURz+zTYShIhBhXiIdwoJlSmsrKDadnVZlW1bldKiGGffuqOzM9Ob2TXFkwRdojx1
+	D6JjdOzQoZuXosCsS9cgqSAIPHXo+83s6iiEb3k73/v9/X7fe0RtnabvOylBVHNDlSul
+	p25OTYuDHylFHdROWKYV+OlicYyx67mSv7vX1mfS2LLex7V2+/Y9tZVlYCHqLba3EPoh
+	kWYAH5mfKGWAs8Adlq/YPgE8WA6sGvAjogMPmrkw09GcdKWyLZFT5qIoKq9iO0mu+/m5
+	xr6LtYmD/lyPZtaOvbPqqtFM1LT3RKG8D65EGc9fVPZsNRSnDeOcSEMaKfKu1d8rTMcR
+	kSsQSgZSNWS5n2pOnXXgdRi7XbqT4/j2EKU+yWCoibXpspkdhX0AdirL7BDwBejxsmIP
+	54F7Yf9bUcOTwCdhP2SHedatH/YXrlPge4Q9NeDOFK7F8dqKH14tAUP3VCNojHNNxNPX
+	OXOkiO8x1BmY90Y5pgsxd5aqEzeAO2EfWapmCrFd+67qJe57AnfT4zvRmzkLXKAcSXKx
+	FdkU0DwJWBR9i7BJDjw+zh5V4HeomMAcuYnczSj3HtURG2ejUoFWeo1Xxk/jufHF+GVs
+	GM+Afqx213t8/+njFXXXtj48+Y163DmuvZ0bVWFWcWUL3f/HMoSP2Sc5psHToVlYa9h2
+	5A+azEywDCjEfwU+l/qSE1Xc1e7tuEUSzFA+LGwluktUbinU6j2DSqwcK9gAdnCSxCxa
+	HLhTa7o5eHfYInpt+U1XsuuG/vr2evva8h5tyqgpKBPNs0RmlLFbo+TdeNv9ZpERnzg6
+	vue9ilrJ/klFED+FOVoq8hRV9FZQ1sRvZw5+G7Z+XD+l5/VB/TwJPa2f0a/ooxG+DHRJ
+	z8JzUR+jSfCwaSHiEqCKgzPUTlRjjQPiKfHytFtkkf0PQBn9ZgplbmRzdHJlYW0KZW5k
+	b2JqCjcwIDAgb2JqCjcwNAplbmRvYmoKMjYgMCBvYmoKWyAvSUNDQmFzZWQgNjkgMCBS
+	IF0KZW5kb2JqCjcxIDAgb2JqCjw8IC9MZW5ndGggNzIgMCBSIC9OIDMgL0FsdGVybmF0
+	ZSAvRGV2aWNlUkdCIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlID4+CnN0cmVhbQp4AYVUz2sT
+	QRT+Nm6p0CIIWmsOsniQIklZq2hF1Db9EWJrDNsftkWQZDNJ1m426+4mtaWI5OLRKt5F
+	7aEH/4AeevBkL0qFWkUo3qsoYqEXLfHNbky2perAzn7z3jfvfW923wANctI09YAE5A3H
+	UqIRaWx8Qmr8iACOoglBNCVV2+xOJAZBg3P5e+fYeg+BW1bDe/t3snetmtK2mgeE/UDg
+	R5rZKrDvF3EKWRICiDzfoSnHdAjf49jy7I85Tnl4wbUPKz3EWSJ8QDUtzn9NuFPNJdNA
+	g0g4lPVxUj6c14uU1x0HaW5mxsgQvU+QprvM7qtioZxO9g6QvZ30fk6z3j7CIcILGa0/
+	RriNnvWM1T/iYeGk5sSGPRwYNfT4YBW3Gqn4NcIUXxBNJ6JUcdkuDfGYrv1W8kqCcJA4
+	ymRhgHNaSE/XTG74uocFfSbXE6/id1ZR4XmPE2fe1N3vRdoCrzAOHQwaDJoNSFAQRQRh
+	mLBQQIY8GjE0snI/I6sGG5N7MnUkart0YkSxQXs23D23UaTdPP4oInGUQ7UIkvxB/iqv
+	yU/lefnLXLDYVveUrZuauvLgO8XlmbkaHtfTyONzTV58ldR2k1dHlqx5erya7Bo/7FeX
+	MeaCNY/Ec7D78S1flcyXKYwUxeNV8+pLhHVaMTffn2x/Oz3iLs8utdZzrYmLN1abl2f9
+	akj77qq8k+ZV+U9e9fH8Z83EY+IpMSZ2iuchiZfFLvGS2EurC+JgbccInZWGKdJtkfok
+	1WBgmrz1L10/W3i9Rn8M9VGUGczSVIn3f8IqZDSduQ5v+o/bx/wX5PeK558oAi9s4MiZ
+	um1Tce8QoWWlbnOuAhe/0X3wtm5ro344/ARYPKsWrVI1nyC8ARx2h3oe6CmY05aWzTlS
+	hyyfk7rpymJSzFDbQ1JS1yXXZUsWs5lVYul22JnTHW4coTlC98SnSmWT+q/xEbD9sFL5
+	+axS2X5OGtaBl/pvwLz9RQplbmRzdHJlYW0KZW5kb2JqCjcyIDAgb2JqCjczNwplbmRv
+	YmoKOCAwIG9iagpbIC9JQ0NCYXNlZCA3MSAwIFIgXQplbmRvYmoKNzMgMCBvYmoKPDwg
+	L0xlbmd0aCA3NCAwIFIgL04gMyAvQWx0ZXJuYXRlIC9EZXZpY2VSR0IgL0ZpbHRlciAv
+	RmxhdGVEZWNvZGUgPj4Kc3RyZWFtCngBhVTPaxNBFP42bqnQIghaaw6yeJAiSVmraEXU
+	Nv0RYmsM2x+2RZBkM0nWbjbr7ia1pYjk4tEq3kXtoQf/gB568GQvSoVaRSjeqyhioRct
+	8c1uTLal6sDOfvPeN+99b3bfAA1y0jT1gATkDcdSohFpbHxCavyIAI6iCUE0JVXb7E4k
+	BkGDc/l759h6D4FbVsN7+3eyd62a0raaB4T9QOBHmtkqsO8XcQpZEgKIPN+hKcd0CN/j
+	2PLsjzlOeXjBtQ8rPcRZInxANS3Of024U80l00CDSDiU9XFSPpzXi5TXHQdpbmbGyBC9
+	T5Cmu8zuq2KhnE72DpC9nfR+TrPePsIhwgsZrT9GuI2e9YzVP+Jh4aTmxIY9HBg19Phg
+	Fbcaqfg1whRfEE0nolRx2S4N8Ziu/VbySoJwkDjKZGGAc1pIT9dMbvi6hwV9JtcTr+J3
+	VlHheY8TZ97U3e9F2gKvMA4dDBoMmg1IUBBFBGGYsFBAhjwaMTSycj8jqwYbk3sydSRq
+	u3RiRLFBezbcPbdRpN08/igicZRDtQiS/EH+Kq/JT+V5+ctcsNhW95Stm5q68uA7xeWZ
+	uRoe19PI43NNXnyV1HaTV0eWrHl6vJrsGj/sV5cx5oI1j8RzsPvxLV+VzJcpjBTF41Xz
+	6kuEdVoxN9+fbH87PeIuzy611nOtiYs3VpuXZ/1qSPvuqryT5lX5T1718fxnzcRj4ikx
+	JnaK5yGJl8Uu8ZLYS6sL4mBtxwidlYYp0m2R+iTVYGCavPUvXT9beL1Gfwz1UZQZzNJU
+	ifd/wipkNJ25Dm/6j9vH/Bfk94rnnygCL2zgyJm6bVNx7xChZaVuc64CF7/RffC2bmuj
+	fjj8BFg8qxatUjWfILwBHHaHeh7oKZjTlpbNOVKHLJ+TuunKYlLMUNtDUlLXJddlSxaz
+	mVVi6XbYmdMdbhyhOUL3xKdKZZP6r/ERsP2wUvn5rFLZfk4a1oGX+m/AvP1FCmVuZHN0
+	cmVhbQplbmRvYmoKNzQgMCBvYmoKNzM3CmVuZG9iagozOSAwIG9iagpbIC9JQ0NCYXNl
+	ZCA3MyAwIFIgXQplbmRvYmoKNCAwIG9iago8PCAvVHlwZSAvUGFnZXMgL01lZGlhQm94
+	IFswIDAgNjEyIDc5Ml0gL0NvdW50IDEgL0tpZHMgWyAzIDAgUiBdID4+CmVuZG9iago3
+	NSAwIG9iago8PCAvVHlwZSAvQ2F0YWxvZyAvT3V0bGluZXMgMiAwIFIgL1BhZ2VzIDQg
+	MCBSIC9WZXJzaW9uIC8xLjQgPj4KZW5kb2JqCjQ5IDAgb2JqCjw8IC9MZW5ndGggNzYg
+	MCBSIC9PcmRlciAxIC9FbmNvZGUgWyAwIDEzNjQgXSAvRnVuY3Rpb25UeXBlIDAgL0Jp
+	dHNQZXJTYW1wbGUKOCAvRGVjb2RlIFsgMCAxIDAgMSAwIDEgXSAvRG9tYWluIFsgMCAx
+	IF0gL1JhbmdlIFsgMCAxIDAgMSAwIDEgXSAvU2l6ZSBbIDEzNjUKXSAvRmlsdGVyIC9G
+	bGF0ZURlY29kZSA+PgpzdHJlYW0KeAGlwoVSQlEAQMG/tru7u7HpBhUDA1uxA+tTjjEy
+	+PDFjZ1NfpC0mPjg+7vi+DvF34gLj71h95WY7egrEl+IGkdeUJwjkiOsPZQj9Kw++Izh
+	E0GZgSfsPhKw7X9E9AP+f30PqLzH99N7j2bPHTrddxje4pa5eovlG1adrtwg9JoVs8vX
+	SL9iOX/pCs2LWXQuZCm8ZEHy/CXmL5gX6LpA6Dkus3PnSD9jLn/2DK2nzOidPuX3CdPy
+	p04wf8yUwMljnB8xaXHiCLmHTPw5foj6DOMZxvSOZvh9wKj8kQNM7jMidngfh3sMWx/a
+	Q+IuQ8aDu6hPM5hmQG9/mu87ivt2KL5Nn/DebRxu0Wu9ZwuJm/QYd2+iOEX3z64UOjtT
+	dG6o79ig+DodwtvXsbtGu+22NUQnafu3NYnKBK35LQl0NidojqtvimMYo0lmYwzLURqd
+	NkQRGqHBbH0ElWHq8+vC6KwNobMmRGGQGsnVQSwHqHZaFUConyqzlX6k+6j8s8KHei/l
+	esu8FHook1zqwbybUoElbr5+Al7liFUKZW5kc3RyZWFtCmVuZG9iago3NiAwIG9iago0
+	MTAKZW5kb2JqCjQ4IDAgb2JqCjw8IC9MZW5ndGggNzcgMCBSIC9PcmRlciAxIC9FbmNv
+	ZGUgWyAwIDEzNjQgXSAvRnVuY3Rpb25UeXBlIDAgL0JpdHNQZXJTYW1wbGUKOCAvRGVj
+	b2RlIFsgMCAxIDAgMSAwIDEgXSAvRG9tYWluIFsgMCAxIF0gL1JhbmdlIFsgMCAxIDAg
+	MSAwIDEgXSAvU2l6ZSBbIDEzNjUKXSAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJl
+	YW0KeAGtwQcCgQAAQNH7X0k0VLQ1jBbtNHUFd+C/t20/+mwfzspZlnWhzMvMmaZ5oozT
+	yBlA7+HN6UFd31HaruU0TdtQ6qbmVFVdUcqq5BSgV/HiPEH5M6dkecZJ0yylJGnCieMk
+	pjziB+cOut1vnCsoukaUMAo5QRAGFD/wOReQd/E4LshxHY4NsmyLYlomyDANytk4c04g
+	/aRzNJCqqZwjSDkqFFmRQZIsUURJ5BxA+8OeI4B2wu5/X6r+RswKZW5kc3RyZWFtCmVu
+	ZG9iago3NyAwIG9iagoxODgKZW5kb2JqCjQ3IDAgb2JqCjw8IC9MZW5ndGggNzggMCBS
+	IC9PcmRlciAxIC9FbmNvZGUgWyAwIDEzNjQgXSAvRnVuY3Rpb25UeXBlIDAgL0JpdHNQ
+	ZXJTYW1wbGUKOCAvRGVjb2RlIFsgMCAxIDAgMSAwIDEgXSAvRG9tYWluIFsgMCAxIF0g
+	L1JhbmdlIFsgMCAxIDAgMSAwIDEgXSAvU2l6ZSBbIDEzNjUKXSAvRmlsdGVyIC9GbGF0
+	ZURlY29kZSA+PgpzdHJlYW0KeAGlwoVSQlEAQMG/tru7u7HpBhUDA1uxA+tTjjEy+PDF
+	jZ1NfpC0mPjg+7vi+DvF34gLj71h95WY7egrEl+IGkdeUJwjkiOsPZQj9Kw++IzhE0GZ
+	gSfsPhKw7X9E9AP+f30PqLzH99N7j2bPHTrddxje4pa5eovlG1adrtwg9JoVs8vXSL9i
+	OX/pCs2LWXQuZCm8ZEHy/CXmL5gX6LpA6Dkus3PnSD9jLn/2DK2nzOidPuX3CdPyp04w
+	f8yUwMljnB8xaXHiCLmHTPw5foj6DOMZxvSOZvh9wKj8kQNM7jMidngfh3sMWx/aQ+Iu
+	Q8aDu6hPM5hmQG9/mu87ivt2KL5Nn/DebRxu0Wu9ZwuJm/QYd2+iOEX3z64UOjtTdG6o
+	79ig+DodwtvXsbtGu+22NUQnafu3NYnKBK35LQl0NidojqtvimMYo0lmYwzLURqdNkQR
+	GqHBbH0ElWHq8+vC6KwNobMmRGGQGsnVQSwHqHZaFUConyqzlX6k+6j8s8KHei/lesu8
+	FHook1zqwbybUoElbr5+Al7liFUKZW5kc3RyZWFtCmVuZG9iago3OCAwIG9iago0MTAK
+	ZW5kb2JqCjQ2IDAgb2JqCjw8IC9MZW5ndGggNzkgMCBSIC9PcmRlciAxIC9FbmNvZGUg
+	WyAwIDEzNjQgXSAvRnVuY3Rpb25UeXBlIDAgL0JpdHNQZXJTYW1wbGUKOCAvRGVjb2Rl
+	IFsgMCAxIDAgMSAwIDEgXSAvRG9tYWluIFsgMCAxIF0gL1JhbmdlIFsgMCAxIDAgMSAw
+	IDEgXSAvU2l6ZSBbIDEzNjUKXSAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0K
+	eAGNwgk3VHEYB+AvJhKJRCKRkpKSkhKJRCIZY8asZgxjZuz7vu9bX+v9vZ3rmNO943/v
+	fZ/z8N8E24zzpXCML01exNhwjC8ko3yhex5l06N8LjnCZ8IRPjN5GmHDYT6VDPOp7kmY
+	TYf4RPA4xMdDskE+NnkUZMMAHwn7+Sj50M+mfXwoeODjA6+4hw9U9z1sOMj7wm7eT95z
+	s1UX713Hnkt914XdAXEndlV3nEjdjx1JB3aubjtgsw/bdrf6oP0j24st1c1epP6NTeEe
+	bPZgw3Y3Nuyud0P7S7YL66prXUj9E2vCnVjrxKrtDqzaXemA9od4O1ZuXG5H6u9YFm7D
+	chuWJFuxZHmxFdpv4i1YNF5ogfpXLEg2Y6EZ85JNmLc814TrXzAn2Yg549lGqH/GrPAn
+	zEg2YMbydAOuf8S0cD2mdafqof4BU8LvMSlZh0nzE3X4/x0mhGsxoTteC/W3GBd+g4Rw
+	DRKKlKihuP5rigtXU1w3Vk2mX1FM8iWNCVfRmMloFRm+oKhkJUV1RyvJ9HMalR15RqIV
+	NGIyUkGGTykiXE6R5OFyMl1Gw4LhMgo/ES+lsGqolAwfU0i4hELJQyVktZiG7AaLKfhI
+	vIiCqoEiMnxIAeFCCiT7C8lqAfnt+grI90A8n3yq3nxKfZ+8knnkverJI5u55LE7mEva
+	e7I5NKjqzqHUd8ktnE3ubHLZziKX3YEs0t4Rz6SBG52ZlPo2OYUzyJlB/ZLp1G/ZkU7a
+	W+Jp5Ej7B4pzCpwKZW5kc3RyZWFtCmVuZG9iago3OSAwIG9iago1NzIKZW5kb2JqCjQ1
+	IDAgb2JqCjw8IC9MZW5ndGggODAgMCBSIC9PcmRlciAxIC9FbmNvZGUgWyAwIDEzNjQg
+	XSAvRnVuY3Rpb25UeXBlIDAgL0JpdHNQZXJTYW1wbGUKOCAvRGVjb2RlIFsgMCAxIDAg
+	MSAwIDEgXSAvRG9tYWluIFsgMCAxIF0gL1JhbmdlIFsgMCAxIDAgMSAwIDEgXSAvU2l6
+	ZSBbIDEzNjUKXSAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAGtwQcCgQAA
+	QNH7X0k0VLQ1jBbtNHUFd+C/t20/+mwfzspZlnWhzMvMmaZ5oozTyBlA7+HN6UFd31Ha
+	ruU0TdtQ6qbmVFVdUcqq5BSgV/HiPEH5M6dkecZJ0yylJGnCieMkpjziB+cOut1vnCso
+	ukaUMAo5QRAGFD/wOReQd/E4LshxHY4NsmyLYlomyDANytk4c04g/aRzNJCqqZwjSDkq
+	FFmRQZIsUURJ5BxA+8OeI4B2wu5/X6r+RswKZW5kc3RyZWFtCmVuZG9iago4MCAwIG9i
+	agoxODgKZW5kb2JqCjQ0IDAgb2JqCjw8IC9MZW5ndGggODEgMCBSIC9PcmRlciAxIC9F
+	bmNvZGUgWyAwIDEzNjQgXSAvRnVuY3Rpb25UeXBlIDAgL0JpdHNQZXJTYW1wbGUKOCAv
+	RGVjb2RlIFsgMCAxIDAgMSAwIDEgXSAvRG9tYWluIFsgMCAxIF0gL1JhbmdlIFsgMCAx
+	IDAgMSAwIDEgXSAvU2l6ZSBbIDEzNjUKXSAvRmlsdGVyIC9GbGF0ZURlY29kZSA+Pgpz
+	dHJlYW0KeAGNwgk3VHEYB+AvJhKJRCKRkpKSkhKJRCIZY8asZgxjZuz7vu9bX+v9vZ3r
+	mNO943/vfZ/z8N8E24zzpXCML01exNhwjC8ko3yhex5l06N8LjnCZ8IRPjN5GmHDYT6V
+	DPOp7kmYTYf4RPA4xMdDskE+NnkUZMMAHwn7+Sj50M+mfXwoeODjA6+4hw9U9z1sOMj7
+	wm7eT95zs1UX713Hnkt914XdAXEndlV3nEjdjx1JB3aubjtgsw/bdrf6oP0j24st1c1e
+	pP6NTeEebPZgw3Y3Nuyud0P7S7YL66prXUj9E2vCnVjrxKrtDqzaXemA9od4O1ZuXG5H
+	6u9YFm7DchuWJFuxZHmxFdpv4i1YNF5ogfpXLEg2Y6EZ85JNmLc814TrXzAn2Yg549lG
+	qH/GrPAnzEg2YMbydAOuf8S0cD2mdafqof4BU8LvMSlZh0nzE3X4/x0mhGsxoTteC/W3
+	GBd+g4RwDRKKlKihuP5rigtXU1w3Vk2mX1FM8iWNCVfRmMloFRm+oKhkJUV1RyvJ9HMa
+	lR15RqIVNGIyUkGGTykiXE6R5OFyMl1Gw4LhMgo/ES+lsGqolAwfU0i4hELJQyVktZiG
+	7AaLKfhIvIiCqoEiMnxIAeFCCiT7C8lqAfnt+grI90A8n3yq3nxKfZ+8knnkverJI5u5
+	5LE7mEvae7I5NKjqzqHUd8ktnE3ubHLZziKX3YEs0t4Rz6SBG52ZlPo2OYUzyJlB/ZLp
+	1G/ZkU7aW+Jp5Ej7B4pzCpwKZW5kc3RyZWFtCmVuZG9iago4MSAwIG9iago1NzIKZW5k
+	b2JqCjQzIDAgb2JqCjw8IC9MZW5ndGggODIgMCBSIC9PcmRlciAxIC9FbmNvZGUgWyAw
+	IDEzNjQgXSAvRnVuY3Rpb25UeXBlIDAgL0JpdHNQZXJTYW1wbGUKOCAvRGVjb2RlIFsg
+	MCAxIDAgMSAwIDEgXSAvRG9tYWluIFsgMCAxIF0gL1JhbmdlIFsgMCAxIDAgMSAwIDEg
+	XSAvU2l6ZSBbIDEzNjUKXSAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAGl
+	woVSQlEAQMG/tru7u7HpBhUDA1uxA+tTjjEy+PDFjZ1NfpC0mPjg+7vi+DvF34gLj71h
+	95WY7egrEl+IGkdeUJwjkiOsPZQj9Kw++IzhE0GZgSfsPhKw7X9E9AP+f30PqLzH99N7
+	j2bPHTrddxje4pa5eovlG1adrtwg9JoVs8vXSL9iOX/pCs2LWXQuZCm8ZEHy/CXmL5gX
+	6LpA6Dkus3PnSD9jLn/2DK2nzOidPuX3CdPyp04wf8yUwMljnB8xaXHiCLmHTPw5foj6
+	DOMZxvSOZvh9wKj8kQNM7jMidngfh3sMWx/aQ+IuQ8aDu6hPM5hmQG9/mu87ivt2KL5N
+	n/DebRxu0Wu9ZwuJm/QYd2+iOEX3z64UOjtTdG6o79ig+DodwtvXsbtGu+22NUQnafu3
+	NYnKBK35LQl0NidojqtvimMYo0lmYwzLURqdNkQRGqHBbH0ElWHq8+vC6KwNobMmRGGQ
+	GsnVQSwHqHZaFUConyqzlX6k+6j8s8KHei/lesu8FHook1zqwbybUoElbr5+Al7liFUK
+	ZW5kc3RyZWFtCmVuZG9iago4MiAwIG9iago0MTAKZW5kb2JqCjQyIDAgb2JqCjw8IC9M
+	ZW5ndGggODMgMCBSIC9PcmRlciAxIC9FbmNvZGUgWyAwIDEzNjQgXSAvRnVuY3Rpb25U
+	eXBlIDAgL0JpdHNQZXJTYW1wbGUKOCAvRGVjb2RlIFsgMCAxIDAgMSAwIDEgXSAvRG9t
+	YWluIFsgMCAxIF0gL1JhbmdlIFsgMCAxIDAgMSAwIDEgXSAvU2l6ZSBbIDEzNjUKXSAv
+	RmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAGtwQcCgQAAQNH7X0k0VLQ1jBbt
+	NHUFd+C/t20/+mwfzspZlnWhzMvMmaZ5oozTyBlA7+HN6UFd31HaruU0TdtQ6qbmVFVd
+	Ucqq5BSgV/HiPEH5M6dkecZJ0yylJGnCieMkpjziB+cOut1vnCsoukaUMAo5QRAGFD/w
+	OReQd/E4LshxHY4NsmyLYlomyDANytk4c04g/aRzNJCqqZwjSDkqFFmRQZIsUURJ5BxA
+	+8OeI4B2wu5/X6r+RswKZW5kc3RyZWFtCmVuZG9iago4MyAwIG9iagoxODgKZW5kb2Jq
+	CjQxIDAgb2JqCjw8IC9MZW5ndGggODQgMCBSIC9PcmRlciAxIC9FbmNvZGUgWyAwIDEz
+	NjQgXSAvRnVuY3Rpb25UeXBlIDAgL0JpdHNQZXJTYW1wbGUKOCAvRGVjb2RlIFsgMCAx
+	IDAgMSAwIDEgXSAvRG9tYWluIFsgMCAxIF0gL1JhbmdlIFsgMCAxIDAgMSAwIDEgXSAv
+	U2l6ZSBbIDEzNjUKXSAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAGlwoVS
+	QlEAQMG/tru7u7HpBhUDA1uxA+tTjjEy+PDFjZ1NfpC0mPjg+7vi+DvF34gLj71h95WY
+	7egrEl+IGkdeUJwjkiOsPZQj9Kw++IzhE0GZgSfsPhKw7X9E9AP+f30PqLzH99N7j2bP
+	HTrddxje4pa5eovlG1adrtwg9JoVs8vXSL9iOX/pCs2LWXQuZCm8ZEHy/CXmL5gX6LpA
+	6Dkus3PnSD9jLn/2DK2nzOidPuX3CdPyp04wf8yUwMljnB8xaXHiCLmHTPw5foj6DOMZ
+	xvSOZvh9wKj8kQNM7jMidngfh3sMWx/aQ+IuQ8aDu6hPM5hmQG9/mu87ivt2KL5Nn/De
+	bRxu0Wu9ZwuJm/QYd2+iOEX3z64UOjtTdG6o79ig+DodwtvXsbtGu+22NUQnafu3NYnK
+	BK35LQl0NidojqtvimMYo0lmYwzLURqdNkQRGqHBbH0ElWHq8+vC6KwNobMmRGGQGsnV
+	QSwHqHZaFUConyqzlX6k+6j8s8KHei/lesu8FHook1zqwbybUoElbr5+Al7liFUKZW5k
+	c3RyZWFtCmVuZG9iago4NCAwIG9iago0MTAKZW5kb2JqCjQwIDAgb2JqCjw8IC9MZW5n
+	dGggODUgMCBSIC9PcmRlciAxIC9FbmNvZGUgWyAwIDEzNjQgXSAvRnVuY3Rpb25UeXBl
+	IDAgL0JpdHNQZXJTYW1wbGUKOCAvRGVjb2RlIFsgMCAxIDAgMSAwIDEgXSAvRG9tYWlu
+	IFsgMCAxIF0gL1JhbmdlIFsgMCAxIDAgMSAwIDEgXSAvU2l6ZSBbIDEzNjUKXSAvRmls
+	dGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAG1wolWAVEAANDvMvvqS7NFlsggknUG
+	oZTKki1LKcIXdOrkOKMx5s28d88tbeylY5WNHfjarhgtKmtVeS0euRJleIsrUfVLLCK6
+	FItLsQC5UFj+XggFrfmFAOGnkDc29ymA/RByFmY/BL1zIauXz87BZub87jufQfeNz7zx
+	1yjO+OvD0zPecC49+3fKpUFeTTmAE+7K2tSE0z7mUggmx9zPV81s8hXGEZvcvhyxMA/Z
+	S92JIWv+gE0Ajg/YbSY+0N1n4pbH+ozGHhNDU+ox0gvKXUb6S0tdOgp3h47qvujQJrfp
+	C/CRNm1oi44ApyKt/eEWpfGZCqN5/kQh/Eidq4ceKWibZOjYYJM084EMmhp4II+/JwOQ
+	+u/J/Q3SbyjhbwA/uyNQvSXOtPpuCQjrhM9Yb50wFvfWt2u41+zTGq63ip9C7aniuze4
+	B90K7qng7oMxd8XsMuY+0FXGrC5hLsOdJQysgjktdCjYts2hqMs2B+wnsu1v0XYC8hsK
+	r7WjCmVuZHN0cmVhbQplbmRvYmoKODUgMCBvYmoKMzg0CmVuZG9iagoyIDAgb2JqCjw8
+	IC9MYXN0IDg2IDAgUiAvRmlyc3QgODcgMCBSID4+CmVuZG9iago4NyAwIG9iago8PCAv
+	UGFyZW50IDg4IDAgUiAvQ291bnQgMCAvRGVzdCBbIDMgMCBSIC9YWVogMCA3MzMgMCBd
+	IC9UaXRsZSAoQ2FudmFzIDEpCj4+CmVuZG9iago4OCAwIG9iago8PCA+PgplbmRvYmoK
+	ODYgMCBvYmoKPDwgL1BhcmVudCA4OCAwIFIgL0NvdW50IDAgL0Rlc3QgWyAzIDAgUiAv
+	WFlaIDAgNzMzIDAgXSAvVGl0bGUgKENhbnZhcyAxKQo+PgplbmRvYmoKODkgMCBvYmoK
+	PDwgL0xlbmd0aCA5MCAwIFIgL0xlbmd0aDEgMTMwODAgL0ZpbHRlciAvRmxhdGVEZWNv
+	ZGUgPj4Kc3RyZWFtCngBvXsLeFNV1uje55mcJG0eTfPoI0mTNH2n7zZQ6GnpC9pAaSm2
+	SKUFyhQGsCjyHBABLRTfMwoiIz7QQRw0FAeDDFwugw6CzEXBX1TUcUTEweqMU0EtOblr
+	n4QKvX7z+X13vjmnK/t59l5nrbXXXmud3cW33dGFNGgNolHjtM6eOUi+cnMRoi7OWtDZ
+	EykbuiF9c9aSxfZImU1DiL5nTs8vFkTKigBCgusX85dHn49bg1BCYndX5+xIO7oKaXE3
+	VETKuBBSV/eCxcsiZf0ZSH8z/9ZZ0fY40t6woHNZdH50Dsr2hZ0LuiL9cxWQpvXcevvi
+	SNm7DdL5Pbd1RfvjVsDv/yAMtW40DynRfKRAFNLCPR0h/qLgQgy0knaAiuyWJ2fEln2L
+	dGRYhJ725Kwh6euOP35/5dxVj2q1sgb6KeX+pAGe4dKldITUGNo/UK0ebiGt5HIHUVNm
+	ENUBjAUoBMjI3KMQX8UPorj2QVGJbQxS2c5avjqEc4D+F+TfAM4R1RqknLWuzDZr3bq6
+	9AolrkclDEY2XI1cclrV73rBFsRj+11OSMZEEqq/JAlKSFSWuGyhkpm2qyVBBRYTbN+5
+	fm27AnDZVW771pVnewv6nSqptZ2sgPZ+24mMIAXJcVeQwWKs7ZjrLtsfStJtL5eMtvV7
+	oK7ftqcCkn22HSV32Z5ZL9c8nSEnT7mCeGu/7UmS7LNth/EfXSc3PBJ5cG0k6VkvT3Tr
+	XjlZuDdIvbDPtsCVapsJD2JRZWt3zbdNd/lsUyqC2N1v85PH9tkaPCdt9WTqfpsYmag4
+	MnqRS8Y4PzJtluuALS0yQwrpLRpsdleDLQnGz3ryUVuW6xZbRUYQ73ylLi3DVed5tDiI
+	B+U5SAKIkmRhJJnlOYh/h2pROp6G3PixvXXpgDN+sN+2DpKte+vSStxB+qKot+311HnW
+	AxQDuAFagniKmMVv5mfzLXwBn8mn86m8g0/mE/g4hV6hVcQo1ApBoVBwCkZBKZAiLhj+
+	q5hJpCiO05KEY8gvI+e1FMnDD/wiCisoNAEFOXR3/JJyc7l+rM5XU/UTPx1yZUdV5o+X
+	+cdsphknBR6tb24N7EpqC+STTDip7br2/59sVyU8Xd+0fG/T8ktTq7uc1R3O6i6AjsCm
+	Jd3mwJqZdvueS8tJgz1Ap3bMnNVN0s6uwHJnV1XgkrPKvqdJfm5E81TS3OSs2oOmVk9p
+	3TNV7KrqbxKbqp2dVW17G6vrJt4w18bhueqqf2KuajJYHZmrUX5uxFwTSXMjmWsimWsi
+	matRbJTnysysnttcidjDSMceQdnsZpTEVKIkhMLvA3xAUqk5/DV7CgnhUHiABs2FUwh8
+	PITj0EuIR6+g1aBt3ka7sBI50QDOR+/hJJyBziIJfYD+hqxoE3oSfqvRRXwZtMwXOA36
+	FKO16Am0PdyDelA53Bcxi4yoFH0RXhk+Fv4eVaI+dBTz2ICTwvuRF/XCvRVtw2pqZngP
+	MqMGtBS0+lr0Bno/3B/+O4xfjD7DOuxlRoc/BAFjocaHNqJd6BXswE6cgW8Ofwb1ZsBx
+	OtoV9oeXwHNfQy8vmohWwmyfYBtOxZl4K/6IHgivCd8P75YIbS1oFtwL0F1oC9qGdsu9
+	ZjKJrBHGr0L10HY/ehNdRN+Awk3HlXgZ9Q79d/ofzGhma/go4NEC83Wg7ZgGqrhwC56N
+	e/Bu/DL+E75MlVCdtI9+h+lhngLcWtAG9BQ6iP6MTqMP0SU0gH5AIcwATmPxJLwS/xae
+	+xtVQLVTq6h7qfepr+k8+iOGZzaxd7MHwkz4nfAPgHMyykCjYaVPRq2oC+45aCG6A92J
+	1mMebUZ70J8A24/Rx1jAWuzFebgWT8E341/i5eghvAO/is/h8/gC/gKwM1A2ykl5qSUw
+	31pqI7Wb6qf2UwO0jl5Mr6IP0x/Rlxkj084chvtjNptdzCVy9fxk6TfSx+Hs8IPhrcCX
+	eLhdKB1lo7GYASouQOuBkxuBZtvQDvQCehH1o/7wEPaho+gtwOsT9DW6AhxLhNuB83Ep
+	bsSTAcP5eAG+E28BDHfhfYDlAXwAvYvfxUNwS8hCKals6maqk1oO91a0hTot00dNO+g0
+	Opuup5vD/6R303vobxg3M41ZxKxk+pgtzHY2kR3D3sROY3vYR9h97An2f9iv2UEuievl
+	dnAvc6d5BV/Ib+ElnAK42LEbvYwOgdQ9SvdA2YXG4fXA1anoTZDeAfQaGkLfo8PodzgJ
+	STThZmr4KRQMbwBuHkR/oH+FytBD1K+pCeFyeietxPnhKzBWLvDr2o3EjPQ0T6rb5Uxx
+	2G3JSYkJVovZFG+MM+h12tgYjVolKBU8xzI0hVFWtbOmwx5I7Qgwqc66umxSdnZCRed1
+	FR0BO1TV3NgnYCfPdULTDT1F6DlnRE8x0lMc7om19jJUlp1lr3baAyernPYgnja5FfL3
+	VTnb7IEBOe+X8w/KeQ3kHQ54wF5t7q6yB3CHvTpQs6S7r7qjKjsL7xdhMxCys9B+hESk
+	IgMH0LjOVaBc0TjSozpgdVZVByxOyEMb7a7unB1onNxaXZXgcLRlZwXwuFnOmQHkrAzE
+	ZkYfJ8+BEnQ3tcLc2VlzA4A/2qSe7Zy9KSiimR0k1zm9NUB3tgWoDjKHLjNgclYFTCs+
+	M/9YvJarvve6xgDlruns6qsJiB2bgOik2EFKnfdCqb7ZDsNSd7e1BvDdgBxBQsY98haR
+	bcLdMc8eUDornd198zqA5qixtd8qWqudHVVtAdTU2m8RLXIhO2u/efVoBxBlf3ZFdgVJ
+	RzvMqyPp5+si9W8fJql59dG/QlrfNEwXTOZ2jgc0A/ZZMAnQAnAtJT9dpahvVimQD642
+	DG85F/AZF6BAlGh3gHWP7wysaY6i0dldFUVuXlW/0mKV96XKNujf0acdBQyE/lqnve9b
+	BJx1Dnx5Y01ntIZza79FpJHwf1iEArjzWn4J2T/dsCV1m53dhH1LZFZD2Wmuvq4CymTf
+	ygaDM6s+iJSNrXswvr8tiMN3B1FV0n7YYOgZt0BzJhG4uVUwHRSysqAiwwE5wKAGJqoh
+	kmHvs/eNn91nr7F3g0gxbjmFhq6+Ni8QrLkVyIKmtDoCYlvCcLarrW0UjJNDxoFHoHtf
+	G4wwLzoCpHKVNwSdvFn18Fapja2TWwNrqhICYlUbEB2E+HBja+AwyG9bG/TKHcYUMF41
+	1xzFOQ9wzs2A9vzIKGDWrIEh2vr6yJjNrU5H4HBfX0IfWXWRMljIIyvEaEUQkS6EwkG8
+	phGehcTpSJBJ7nA6AK02QtMCEOBrAgRm/b+ncNEw3vBkMWBbJFO45D9E4dKfQ2Hfz6Lw
+	qGFMb6DwaMB5FKFw2X+PwmNuoPDYf0/h8mG8AUkRsC2XKVzxH6Jw5c+h8LifReGqYUxv
+	oHA14FxFKFzz36Nw7Q0Urvv3FB4/jDcgOQGwHS9TuP4/ROGGn0Nh/8+i8MRhTG+g8CTA
+	eSKhcON/j8KTb6Bw07+ncPMw3oDkFMC2WaZwy3+IwlN/DoVv+lkUbh3G9AYKtwHOrYTC
+	04YpLCYE0PV6eM0ItYv+44r55utIzv4ZbaV84D7vQu0ARsivgbpCdip6lvkUbeN8qIWk
+	UPcM1JG8A1IvczsaDfmVkNZCWg6plzwP+UqAXhhnI4AS6tfySWgNqYu2raKT0Fqor4z2
+	XwV5K8wTQ1IAI9hwkXgTBI0QBzYyQnY0jTj5N1wUxOGuXRAV+BkXG+3DgWcTCV+RCuV1
+	TwpIBXMiiDL91BWDYiEqpkN6ZEBxgGc8MoEPiJAFPL8E8O8Q+LrJyAbYOlAK+IYueZBC
+	VIh+hf6IPgK/4wl8imqillEX6Q10kBGYF1mOXcz+hZvJHeMr+Xv5wxD32KqsVD6svCjU
+	CA+q4lUdqpfVZvVU9WXN/eDVbUUIfIwj8OY8Gis6WC4JbHeGT6KRwDJJNE1ZlRyfhJFF
+	odzlmF8GgY2Jg2X+UNlE7eUyvzZUhsrLQmUE8nILdA6dB2Ar80zw6kn2yA9jg0zT0IsE
+	ZYzapVlUF/s+vGeNmO6hU7VLqaXaXqpXyzG6WEOcxRATy7CGhcofvOx2lmKtxjjjO47K
+	/fj3CKbUTrzsX3Q1pPP5fNrzqLw8Lxe36w3F5djE8ZwuzhRvw85UT2pR+9q65todm/Kb
+	7Xmrxzz/dMtsugBnPXf7TEr69WXp1NFnQxd7Pnr3hxDBxwj4+GV8CkWzXqc0GE0mq16j
+	MCjphZoflJbrpx8cJFPrfRC9qLrgl+dHJnB5aC4WO4tL9LpCT6oXF+CNk+7YNLG69vT6
+	wjaCwLssF5S+kb6STktvvNja+dUWjHH+0edCn/fA/GsAiZcgDkGjVNGA02iBhflxD7Iw
+	bI/jzgid/SF5RlTuH8jLNTh0jjXYK72FM6T/ITSlQQoQuxN4RyEiZefEX3ZT2MOmCaVc
+	ibKO6xaWCRuYDdxW+hFmC7eLfpbZyQVxUDiGjwln6bOCEfMcRyGFUgk/AuZZKk4Q3Hoo
+	xrGsWw9tvCKDxMEEFTh0nFKgWYVKA1iqBIZjgziuX0lTkOwTLOquO24zZy6ZqB00+0M+
+	H/zpfBYZd7MXlZvK/OVlZXqfzwtiwvbmZK7S1oPJyRxOCDBH23pzzNEKGiroo2066Al/
+	vdqyMh6A8Bq1Y4cKHG4HOMwOTHnxkuALeDolSP0zQp/MkQ5Rr4J/XYUn/zCWEAgogtGz
+	QBsKcirkJZHgV2HZK1E9RII5bRDhU+hVecXWQ4MKaElSGuJE9Zm5eRgIfe1mPro6SL0Z
+	KqRzh55hfMxB6c9hJN0tXYGBYQ6IezN72MMwcIlo4jMYRklnIEqp4JZgq4pWuJUWQRXE
+	iXsdTS/I6yaybPxEgkN6nzcUYWpkrm2MMZRE9YaWS39hD0shaXcYhR4FzraE32NfYi/K
+	q/9usf6Y4gPFD9bvHUw6lebwGerNbcYtjtctR5K+UyoNgj7ljC0mIzZWz1Q4bbReIVSY
+	lE6D3qDX0BAVK3EmpPw+Vmt18yUJFpc7iO/c69i9PILZAKxn/8lBnW9Apzf5vGO8hHED
+	5eVlAwRRLdRCVZQVsNKcKZROG1+QX1ziKHLonB5Yhk67J1WnLSl22JEJMyudGxra+z/7
+	7onHXzdJL1Bz3rS11a7olz448KfXXsNV2IJbLKFl9OXNZQ7pX7BG/vG3vQ9dvvpFcG5m
+	/Yk38Uw85+xZ6dN38DdEziN03gUkZ1G6GIsoqoJV0FaeciMLx99I34naC7BaQqAgyHLR
+	ObbhQur9oW/YI0O10hUYi0LPgFwsgrEEiGq0ihl2Z4LZyHoMqRkYwiIZ6ZQnSZFkTzFw
+	phSuxJRwk9aahTzuNEtmVhAnAyOn3sDIo6GjIK2gG0ALlsuU8ulMPiCTzpFfUlwEasFZ
+	HG9KxsY4jk+GUAxoKpPRAfTz4hzslDHEp3B7d+H0tvzZH/xuVG7pvBVzWhTqLGl3DKfG
+	FDVrg3REOk2dZo5Ii80Zv7onxxqqqSrdcNPcExnpmx+f1eXyJbjzksdWbLzvltAheCsi
+	L++zMezXKAcih8+I8xSxEA1PtagssSaHKXWOukszN+WzbFW6Nt2YZk31jDKWWvcbjxvP
+	Gd/OumS4FP+94Yf477NjY5BOlWK2uU0Kd0qMijHnnMk0n0ms8MbRTEWm0mt+1KszTVI8
+	mmbNsxXrbkLFOZbcPJk+u6P0GRiUBWqACJQsSGUDAyBEJh8m9ILVDRCVpngTyFGEWF5M
+	lHghcuQzJkIlZwpnlJU79DHGIZCsIoxXxqTX71tQdZcobtx2ofURbMemL/B4hXRWMb/u
+	l0vvr8n+tfS7lvXSCemC9FdpHzUZ/7kr/2ZzzqrxaZ5kZ+GYOe+9jrkrl+4udXdMneSx
+	Osekjet+7bj0LeYvMGkgaw5Y0yeAkjwqFdWYy+ApRqEEpYeCuLWfcoPeaxWVHOyGhx1E
+	58Fu6B8MRfQ02RnIPgjcl2/mhFQrHZeq2SPS0NA45iBE4TBwBbGjYXwOLRXhPRm3Hjbs
+	fIzdeqjiaBY+M1E0pVDAlBTCQazrp2Ebwbp9jIX/f7RsVMcS6SsjGpbt9V/TrhQoU+on
+	tCugB3oUbnoIi5JS+lCKweOxSHZrWCVPwRqh0ejwR0wpMwPFQAx5FHpAnDSaKipejjdi
+	5mwyTv3XhYzPnTEaFqLYBmsmxAKZ1JzUnAxSwSSoUhLis0bZ+AxBlZWvGmXwI3/OqKKM
+	sanWMqs/IVvhL7KMLvsjtgCd6/CLZG8HAkal5bzOd/Kzz6J6J3QSZMRENgIQGZOcz4xK
+	TAyOxaBwjHGyAvIUE+EBWeE53gF5Rz4IC9gEyRiWWg6WVVMKSFVJcYmB+iihJFec5qmc
+	PGr64/TuSSlj2qd1ZSQL0oCydhE27N20iaITE6XjGoEe7Z+++Df/+/GWZ3sovc6oVGtN
+	nqbxFfMf+FqItZaMK8h3lz8w/cHa2tckdeGE0jRNhmOUW8wuev7xN6blGfEZICOsxZXh
+	T5ltsD/okR1Vim6lXRWjVyOLS8+rBLuLVRnXU9aUJJtg03hUFkfKFkfjxKh6GTxP9PGA
+	rIIHynWR5YL0xjjKmeJJ9RiJgMG7FugjSgbenVCDfv5f/3i3tynPJ32BE4sr/EvdK5J9
+	jz0+KvlXdzLTpOPfSlJ/sb1xI3s4NNiQln91cf9DixsevK9+6b3BCL614feZQuA7sTkX
+	itWPxe+Mp3oT8Xhjq75bv0xYrg8a/2w4ZlSYKY5JeptxJVv5+BhBrX1F7YpTJWuLY22o
+	ONmUZLUrik0Wm73XURd9H1kZ6HyhQVkZDBA7DnYWOSU8XQT7u7zcyWsQdQDbCjDYYaeK
+	tKgAlAGmtQpHbteDRYmJBffNnqLETmHKPdL30vffYf0/T2LWLCVQB8bkVT7QsHrZ+A3z
+	p65dfACXfg+7TGnwC7xD5kU5yHQX8EILbzdJzLqoBuvHmERpaWRyaXlOSHIJKiNtNdg4
+	G+1hrDZrscaSbNviqKuOyihhSGjwPCiuH7kC4pmXi9pRvIks+KIY7ExBBOVrbJG5Qq3Y
+	CmtOujRm2+L/JQ1h/O4rq7vGNq26Y+lyZvpNfkrxg7i5sxUXfYNNWLx628sPHJtaePDe
+	zX+AdegNn2NGAT842fp/QRxfo+iN24wfA/sLK1lOy1rr2RrtePs9+O7YXptAx9MmQ7zB
+	VKdoiG8wjbdOj59ummY9hz9gvkj63H7Frp2Aa7Qb2HVaBsy2R8SCSTEzYm6NoWNiEjhX
+	ioM36bMSVPE0lUIXm1amJHeo16gptdVF2WIeSbY4XUCKa9JJhLPdr/OdH/BGyHEyYie0
+	g0WDFrXjRe0I1iLscLD5wc07ojpe5iqQSKdFozE+tSAGH+BX3rzh/VrRoKJC8Vzn6ObW
+	kmQTdqqm3Xv1lHQE2z6Loxf/at6iOy7NWdi5pv6+HZXp+Qm5nbO3YzVsoAnw2R4usOVh
+	sW1i3wLf6a4KL5RolAWrz4YmgUU3AwAUE9SYoKdKPoOgB4uNA+0mgJ9lgtsKORs8pZE9
+	MCXyQJsNPJWHobcF/DELjgEOdMC3qqjCPw8WbtmZwah1Xk78ofKB9sEBIg2ww+dgYLyx
+	wOgEqXAWFRDdU0DlZ6WaF2UeOCCd375t9NgB9i2avkjTRXZ72RtXH6JvfaPmpcqZgEOl
+	VMncAjzXwE6Ri6aJ2r5kUICsK9fL6zm3xpUexOWiPdGeZY7NpWx6m9uTm2Ww5ieuT8hW
+	FmdZ8vKvE9nIJkzW3XnQqqGT5QM+YtHp5K3XdU1ryktOD4wCSy4OVl2Ky3ONYWOIngVb
+	r6hQX1BCHexbt/BRX7J91KOqMd0iNtaukJ57S/ouBherE3IWbC1MSfe2bHh76JuPbv77
+	5mcff/q++oUzJvTRt1kyb//t0OXTvwzueCY/3vOLym01Nc4K7Ln6L1xPR/jXC3vuLexB
+	4ES56GYpD9Ua0x3DxJn0SO0y8VpeUBSzVotB69FZzJZDjsbokpSdUKIkgfigI+XdQba2
+	gOzE9ALrgSxL3VhcQI97tig7Tvow2bNg0R3SeZw49plpzC01dWPueji0htrcWtyw+d5Q
+	P3swdGVGPcGJgm+ACO9iTwBHeDRaTGlADXg6mg6fO/eANHG8INsEnAfzYAr0X0NJdoyJ
+	kwiWgOy0EcdFB7stwC7pY9ACMjDw6VhaOgRhCAoppTr8kjyPAY0m51ZeBdYzqAU8FQ14
+	KuhUJMXngkiI5o3nUBBpwa0xeInXgqBzxGvByRh0ZxG8chxwLdWDX5I+xUnSNHOcIiMT
+	J609pClIJXN/P5vC6aOZ3UMTn30CvH24MHzpQ8wC4IEK/UPsF6ka9gz1GcXEKgRlC7uR
+	fUBxv/I19rjiPf5jxTmlSsGZOS/tZdLYbK6ELuUa6DqunW7j5tFzuWXMBmYz/Qj/PP0S
+	s4vbye+DsMTr9BuMtZ6bwE9lNzDrFEfZY4r36PeYD/n3FSpWqWRYllOp4HwGD1n4fihQ
+	dpo+oQd/SgmeJ8NRSoGhOYEX4OSPVYMFD1LZVbkqUcWoLGpNr6PxU7Iur7bL/tVXQHsw
+	h2TDweQjBhEj+5sr2o4iPRgTPl9sr1ZBXEsQGNBUi9rBVcAOJZhEvM6xFpvxLNwprcP3
+	SjuloSXSRfbg1Qt4qzQjNBu/vVJ6ntBqDeCxjZkGX42PVPhRCXARjpHAbzyAG2AuRHXm
+	gVZZDukKSDdC2gfpY5A+BunzAPsBPgdqx0B/B3yBpkHjaCC+kw36hvy6Qe5sMGoSWA8K
+	0E/eqKbi4CSBEsfCEzrkR3GQSwbrIgl0VjLoKrD6sRPGa4TzDFFT4qgW9NLgtUhCWRlQ
+	xx+xxSPmFCgsuI10dM3Arnht+USyDiMxNMCoMpGUfeBeX45WoKRzcalzlmSbpE/iXHNX
+	ZJhAsI1F3ub1q/xj7aXNrfOZaaU1vuaSeaHJ1L6xaQ0zC8eHllIbO7MmTcpuC/Uw4vYW
+	l1hS0NiRnQ3vT9Z/J+g8Ev2qF7NZbMRuXIJbVd0qDuu1nNIFm0gMI5jYYlMsZbXoYjyx
+	N2qCo2R3jvgawPuBcl9UG/zku3jovnelc6aMJQ8VJ4IuMJTktfbOZabvORlKoTZPzZmy
+	sqIr1A8oTnFXktUFOhnsom1MF3CLROf8YpqJxgr1BvUGLW3SmGPnaGjWZY7jVa4Yldms
+	oIpNVquiWGexWIN4yd7hbTPiEel8UX8IqH8bum1RVA3LloILOcDFAf/HjoyYunTPPatW
+	9fauonKkL6XP4f4Sx4FJY8FxodNv9O/YsWfPjh39c6QXcMs/vsTTpOe+pESg5SqpmdkK
+	sqkBqZggppsMCiHRSrnsvJUTXAaVJUahMWuKtdYUzpZgM3ssP2l3yrs6cf9hr9BFjBzZ
+	wI5aZ0V6soXLlihRsLKA0Itvvwssza6ypqWrkrBSCr25dqo3W7qAdTmFM9ZR24/8euKy
+	Q/7s4GOUDzyzr8E3e7vCVR06xn79VG36eCBzRAdRQ8x02Hkn7Ec0rt1LxWrA96kVLQZe
+	w6kFO5VLiRRNInVUjMqjhiBdEM/e62icc03Wz0RCdO1E/wLuZyBuRowzMEWIiTyMLPWh
+	ypCQofn9aIf0CdZW5jWuYaZjLJ2jqZ7ydaErTOWhBWnjCE4U8P4DOJPRiTLBglgtTlJq
+	uVSLhlYyDpWqXhivqnVU2evS36UVSSl2tcDEZzLx1qwsPc9kpamysmKNgj0p3p/CG7N5
+	v9uao0ZJ/ths5M+0ZOdcZx0PQuhAtvfl+IvsHEeEJHRSe1IOKNzSfgtux7IZJVv8btlR
+	hmV5g6MsL2RQ/fZU8JNnKZOLHpgyKy1NCu9vaBh4902MDdKnnMW7qH1SRkZ4V8uUf16V
+	wt/CAZXpDXZffn6uxTImp7pqzeb3njlWYh81ypMXbypNm9y08umT7+2kYSGAnRX+O7WM
+	7YZ1OmGfNivWps7SvYoXIQZPF+N5NJ3DnBlYE8sNMkoPehj4ZA7imL2ODsKeM2XnQ2WD
+	ZYQ/X4GjDJHAgXKwSyBQU0TixsRYivhzRp6DIIDOuAVb9+xJuUmTFNN7fEIuveAEzpVO
+	nQgdHufA+B2W9+fNobYTeQ9fZFpAd5CIeYOYI8Rb4zPiS+On8l08Z4Udg4uP0Qgs+CdW
+	jeCxmlXWRFxstiQk/mhGkHWp9/lDZ2SaE89Eji9jEleWIxNEbMC254l5T1Bz46fiPbc9
+	XAxHgKRLjD1+3Kop30zx4i+ZytCt7d7mJeJcavLQoa1svqEs68WOA9RDSUA7K+i4m+Ds
+	GoeeECd5uCncbO5Z7g9wVobDWqoWmlZQi+mlDFeLN6BedjP7O/YV9hj9Ob6ClbSdYTx6
+	2CMpO8YeOU5AkTgBR1OCgpKjBOpIlEAtRwkIvS3XB2Mt2tfN18UIoiEC2BCHY6+QJ7vB
+	ImK9y+EBA+3G+dJSCF0vx+KnTOXQIaby6jl4jxjY+xzwHmrkI6dqwRJhwRJRAJBAKw0g
+	gFVCTrgh0CIkynotp47miK2SQGaRI7oGqhc7ntuF06Wj0gcv7JbOSn/B+btgsq9p3dAh
+	2nr1AuSjcUBCw0YGjuFgWtysAFVM8YyBsQq0h3IxqVyGUMz4hGpmvNDCtAmPMI8JTzIv
+	CS8zr/AHhKPMceFt5gPhM+YKY2JoM8PSHj1FYYY1MzTr0YOdKyjNgkrp0fMKhaAyC0oV
+	kBojzPACgzgWIuAqJWzESh5sFRoLAkNxcD6UxMMVzyOIgKs1z0ckPUr5SGzG7zUf1R6V
+	vx6QoLgcKYQ9mERrIBim7c1UrIJY+Io27WtmLdubuUpxfWm4je3Vmn/sSVzORbi9AEwW
+	oCP8qrAVL5a24fZ9/bhZ2gr53/7xIJVGmaWjuCw0EDqNa6X9wBOjVAv0myF/a3pP7PEI
+	U4U5wiPCDuG0AEYX5rhEXqfJ5u2aMXyepp5v58kOvJRfrtGYYos1vcoNqi2qoIqLi1Mr
+	NJRdrfboVSqB4ymbQuGB7wYkqxGMaqATxyuRjcoy2LSxcXw80ChGo1IHsXovNAiQimrD
+	wwpLlzF+mGaD/vPmq0AfAsNhrXL/+dB5MFjkrwcgThg+HrBgzTUtW/FaQVR4SZ5EFb3X
+	BNiG44tLxmJPRMqoiCW8x5XRYLVkMlIPHvPVJ/CVoG/+6oOpOTl47VsUJeh189XMbVfP
+	0a6hU9LxRzDNxRHdL19hckrxpy43VNJgE6jBEnOhNLDIMsBKKwL7rATiZlVggdXAOcc6
+	NB4OEdfDiVA/nNZshHOPTagZzlJORTfBCcg2+Ap5MzkVD5JGpI1cHPFnW6vHNba0ZtZ1
+	zV/StXjurM7sylvnzya9rl3w7QHtBCChm2MAZwEuAnwHneBLJDYDpAGUAtQBtAJ0AywD
+	2ACwBWAnQBDgGMBZgIsA38GLKwDMAGkApQB1AK0A3QDLADYAbAHYCRAEOAZwNhy9AAc0
+	nMdghdxYThtRTh9Rll36656vGNFePaJcM6JcO6LcMKLcNKLcPKI8ZUR56ohy54jyzBHl
+	WSPKwLQb6CHL0nXvJ//PxnXlX4zo3z2iPHdEed6I8i9HlOX/Eblu/IUj2m8dUZb/h+O6
+	/reNaL99RHnxiPIdI8pLRpSXjiiDPN1An+Wk/H8B4eKsgwplbmRzdHJlYW0KZW5kb2Jq
+	CjkwIDAgb2JqCjg2NDAKZW5kb2JqCjkxIDAgb2JqCjw8IC9UeXBlIC9Gb250RGVzY3Jp
+	cHRvciAvQXNjZW50IDc3MCAvQ2FwSGVpZ2h0IDcyMCAvRGVzY2VudCAtMjMwIC9GbGFn
+	cyAzMgovRm9udEJCb3ggWy0xMDE4IC00ODEgMTQzNiAxMTU5XSAvRm9udE5hbWUgL1hF
+	Q1BVWCtIZWx2ZXRpY2EtQm9sZCAvSXRhbGljQW5nbGUKMCAvU3RlbVYgMCAvTWF4V2lk
+	dGggMTUwMCAvWEhlaWdodCA1NDkgL0ZvbnRGaWxlMiA4OSAwIFIgPj4KZW5kb2JqCjky
+	IDAgb2JqClsgMjc4IDAgMCAwIDAgMCAwIDAgMzMzIDMzMyAwIDAgMCAwIDI3OCAwIDAg
+	MCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAKMCA3MjIgMCAwIDAgNjY3IDYxMSA3
+	NzggMCAwIDAgMCA2MTEgMCAwIDAgMCAwIDcyMiA2NjcgNjExIDAgNjY3IDAgMCAwIDAg
+	MAowIDAgMCAwIDAgNTU2IDYxMSA1NTYgNjExIDU1NiAzMzMgNjExIDYxMSAyNzggMjc4
+	IDU1NiAwIDg4OSA2MTEgNjExIDYxMSAwCjM4OSA1NTYgMzMzIDYxMSA1NTYgNzc4IDU1
+	NiA1NTYgXQplbmRvYmoKMjcgMCBvYmoKPDwgL1R5cGUgL0ZvbnQgL1N1YnR5cGUgL1Ry
+	dWVUeXBlIC9CYXNlRm9udCAvWEVDUFVYK0hlbHZldGljYS1Cb2xkIC9Gb250RGVzY3Jp
+	cHRvcgo5MSAwIFIgL1dpZHRocyA5MiAwIFIgL0ZpcnN0Q2hhciAzMiAvTGFzdENoYXIg
+	MTIxIC9FbmNvZGluZyAvTWFjUm9tYW5FbmNvZGluZwo+PgplbmRvYmoKOTMgMCBvYmoK
+	KE1hYyBPUyBYIDEwLjYuOCBRdWFydHogUERGQ29udGV4dCkKZW5kb2JqCjk0IDAgb2Jq
+	CihEOjIwMTExMTA3MTgzOTIwWjAwJzAwJykKZW5kb2JqCjEgMCBvYmoKPDwgL1Byb2R1
+	Y2VyIDkzIDAgUiAvQ3JlYXRpb25EYXRlIDk0IDAgUiAvTW9kRGF0ZSA5NCAwIFIgPj4K
+	ZW5kb2JqCnhyZWYKMCA5NQowMDAwMDAwMDAwIDY1NTM1IGYgCjAwMDAwNjI3NjQgMDAw
+	MDAgbiAKMDAwMDA1Mjk3OSAwMDAwMCBuIAowMDAwMDA0MzU1IDAwMDAwIG4gCjAwMDAw
+	NDY3MzQgMDAwMDAgbiAKMDAwMDAwMDAyMiAwMDAwMCBuIAowMDAwMDA0MzM1IDAwMDAw
+	IG4gCjAwMDAwMDQ0NTkgMDAwMDAgbiAKMDAwMDA0NTgwMSAwMDAwMCBuIAowMDAwMDE1
+	MDg0IDAwMDAwIG4gCjAwMDAwMTg1NDUgMDAwMDAgbiAKMDAwMDAxMjQ4MCAwMDAwMCBu
+	IAowMDAwMDEzMzM1IDAwMDAwIG4gCjAwMDAwMDY0MjIgMDAwMDAgbiAKMDAwMDAxMjQ1
+	OSAwMDAwMCBuIAowMDAwMDE5OTk1IDAwMDAwIG4gCjAwMDAwMjE0OTEgMDAwMDAgbiAK
+	MDAwMDAxOTA4OSAwMDAwMCBuIAowMDAwMDE5OTc1IDAwMDAwIG4gCjAwMDAwMTMzNTUg
+	MDAwMDAgbiAKMDAwMDAxNDQ5MyAwMDAwMCBuIAowMDAwMDE0NTEzIDAwMDAwIG4gCjAw
+	MDAwMTUwNjQgMDAwMDAgbiAKMDAwMDAxODU2NiAwMDAwMCBuIAowMDAwMDE5MDY5IDAw
+	MDAwIG4gCjAwMDAwMDUxODkgMDAwMDAgbiAKMDAwMDA0NDkwNCAwMDAwMCBuIAowMDAw
+	MDYyNDkwIDAwMDAwIG4gCjAwMDAwMDUwMzUgMDAwMDAgbiAKMDAwMDAwNDg4MSAwMDAw
+	MCBuIAowMDAwMDA2MTA1IDAwMDAwIG4gCjAwMDAwMDUzNDcgMDAwMDAgbiAKMDAwMDAw
+	NjI2NCAwMDAwMCBuIAowMDAwMDA1OTQ4IDAwMDAwIG4gCjAwMDAwMDU4MDIgMDAwMDAg
+	biAKMDAwMDAwNTUwMSAwMDAwMCBuIAowMDAwMDA1NjQ3IDAwMDAwIG4gCjAwMDAwMzc4
+	NjggMDAwMDAgbiAKMDAwMDAzNzkxNSAwMDAwMCBuIAowMDAwMDQ2Njk3IDAwMDAwIG4g
+	CjAwMDAwNTIzNjAgMDAwMDAgbiAKMDAwMDA1MTcxNSAwMDAwMCBuIAowMDAwMDUxMjky
+	IDAwMDAwIG4gCjAwMDAwNTA2NDcgMDAwMDAgbiAKMDAwMDA0OTg0MCAwMDAwMCBuIAow
+	MDAwMDQ5NDE3IDAwMDAwIG4gCjAwMDAwNDg2MTAgMDAwMDAgbiAKMDAwMDA0Nzk2NSAw
+	MDAwMCBuIAowMDAwMDQ3NTQyIDAwMDAwIG4gCjAwMDAwNDY4OTcgMDAwMDAgbiAKMDAw
+	MDA0NDAzOSAwMDAwMCBuIAowMDAwMDMzMDgyIDAwMDAwIG4gCjAwMDAwMzc4NDcgMDAw
+	MDAgbiAKMDAwMDAyMTUxMiAwMDAwMCBuIAowMDAwMDIyOTA4IDAwMDAwIG4gCjAwMDAw
+	MjcyMzIgMDAwMDAgbiAKMDAwMDAyODkwMCAwMDAwMCBuIAowMDAwMDI4OTIxIDAwMDAw
+	IG4gCjAwMDAwMzAwMzcgMDAwMDAgbiAKMDAwMDAzMDA1NyAwMDAwMCBuIAowMDAwMDMz
+	MDYxIDAwMDAwIG4gCjAwMDAwMjQzODUgMDAwMDAgbiAKMDAwMDAyNTQxOCAwMDAwMCBu
+	IAowMDAwMDIyOTI5IDAwMDAwIG4gCjAwMDAwMjQzNjQgMDAwMDAgbiAKMDAwMDAyNTQz
+	OCAwMDAwMCBuIAowMDAwMDI3MjExIDAwMDAwIG4gCjAwMDAwMzc5NjIgMDAwMDAgbiAK
+	MDAwMDA0NDAxOCAwMDAwMCBuIAowMDAwMDQ0MDc2IDAwMDAwIG4gCjAwMDAwNDQ4ODQg
+	MDAwMDAgbiAKMDAwMDA0NDk0MSAwMDAwMCBuIAowMDAwMDQ1NzgxIDAwMDAwIG4gCjAw
+	MDAwNDU4MzcgMDAwMDAgbiAKMDAwMDA0NjY3NyAwMDAwMCBuIAowMDAwMDQ2ODE3IDAw
+	MDAwIG4gCjAwMDAwNDc1MjIgMDAwMDAgbiAKMDAwMDA0Nzk0NSAwMDAwMCBuIAowMDAw
+	MDQ4NTkwIDAwMDAwIG4gCjAwMDAwNDkzOTcgMDAwMDAgbiAKMDAwMDA0OTgyMCAwMDAw
+	MCBuIAowMDAwMDUwNjI3IDAwMDAwIG4gCjAwMDAwNTEyNzIgMDAwMDAgbiAKMDAwMDA1
+	MTY5NSAwMDAwMCBuIAowMDAwMDUyMzQwIDAwMDAwIG4gCjAwMDAwNTI5NTkgMDAwMDAg
+	biAKMDAwMDA1MzE0MiAwMDAwMCBuIAowMDAwMDUzMDI3IDAwMDAwIG4gCjAwMDAwNTMx
+	MjAgMDAwMDAgbiAKMDAwMDA1MzIzNSAwMDAwMCBuIAowMDAwMDYxOTY2IDAwMDAwIG4g
+	CjAwMDAwNjE5ODcgMDAwMDAgbiAKMDAwMDA2MjIxOCAwMDAwMCBuIAowMDAwMDYyNjcw
+	IDAwMDAwIG4gCjAwMDAwNjI3MjIgMDAwMDAgbiAKdHJhaWxlcgo8PCAvU2l6ZSA5NSAv
+	Um9vdCA3NSAwIFIgL0luZm8gMSAwIFIgL0lEIFsgPGYzYTI5Yjg5OTMxMWUxMmY1NDY5
+	NGJlN2ZlNThmMDgyPgo8ZjNhMjliODk5MzExZTEyZjU0Njk0YmU3ZmU1OGYwODI+IF0g
+	Pj4Kc3RhcnR4cmVmCjYyODM5CiUlRU9GCjEgMCBvYmoKPDwvQXV0aG9yIChSb2JlcnQg
+	THkpL0NyZWF0aW9uRGF0ZSAoRDoyMDExMDkxOTE3MTUwMFopL0NyZWF0b3IgKE9tbmlH
+	cmFmZmxlIFByb2Zlc3Npb25hbCA1LjMuMikvTW9kRGF0ZSAoRDoyMDExMTEwNzE4MzUw
+	MFopL1Byb2R1Y2VyIDkzIDAgUiAvVGl0bGUgKHJzX2dyYXBoaWNzKT4+CmVuZG9iagp4
+	cmVmCjEgMQowMDAwMDY0ODk3IDAwMDAwIG4gCnRyYWlsZXIKPDwvSUQgWzxmM2EyOWI4
+	OTkzMTFlMTJmNTQ2OTRiZTdmZTU4ZjA4Mj4gPGYzYTI5Yjg5OTMxMWUxMmY1NDY5NGJl
+	N2ZlNThmMDgyPl0gL0luZm8gMSAwIFIgL1ByZXYgNjI4MzkgL1Jvb3QgNzUgMCBSIC9T
+	aXplIDk1Pj4Kc3RhcnR4cmVmCjY1MDc1CiUlRU9GCg==
+	</data>
+	<key>QuickLookThumbnail</key>
+	<data>
+	TU0AKgAAGLSAP+BP8AQWDQeEQmFQuGQ2HQ+IRGJROKRWLReMRmNRuOR2MQOCR6RSOSSW
+	TSeUSmVSuLSCWS+YTGZTOaTWYS6bTmdTueT2fSKcT+hUOiUWjSug0elUumU2nSB2VGnV
+	OTP6rAALVmqVuuSBv18AA+xQgA2UAQOMWUA2eBSO1WyQxa32iRXO2xN5XkACC+Vy/U5+
+	4F/uXCAAIYe4Qy7QS3we6QbFgDGwbHwXIwvI5OC5XJWa0ZrEwfLwrM2aDvDUAAO6u/62
+	lYF+v9zbMAA7bRTP5625Fyb3Vay0O/hAAJcWEO3kZ21vfmAB6c8ACfpYnS2vOW93dnic
+	agbvdQS8vLfh3XeWibDB4XbA6KWvNw60Fv5AAr/UAYRywgG/sAOj/O2CQAHzAYAAvAwA
+	BJBIAGZBizqucBwnDAsDvWABuwu8cBQIAcOAAFsPgAHkRI49yzoUeMUAAD0VvNFqfPQ/
+	Datu67vuU6kan1HIAHnHgAHq6ACAKAoARQeIAAzJAAHPJYAAjJwAOydwAAxKiwrG2ZzA
+	AfEtgAA0vS7L59zEAEcn0AAFzQ50egmCgKAAqx/AACs5xu6y7shGrqgA1B4AAD8/xdQK
+	dRgwr9gahEaRKhLc0VOqGUZR87ss0yFUgxzvUbS7GUpRdJRsha0PDP1AUFUqZvQcdUxk
+	9lNU+j1LUrTFEVk7tN0yylaVxWyKSKva+1NYCX1RVVDRstB8H2gh+H7RrR0nOy4obZ1j
+	U8zEatFa6HWmyKrIIAgBrWBQD2exNehDc9g3SlT0HFdtVtCgxpnSAkyAUBbNpDW7JMpf
+	brRNRDINFfDLYJRtorvfUSsZfaCWi9+CYCtmILXRoFnwerogqflqPAvVzhDdWQpNdl3W
+	KhZsndeh5gIBmJ35l+HtNO+KPdg980yuOFYjnWYX/mWcs7h+B6DgGIAafJ6OiCmNoXXo
+	RafkWopE9EIwlkyFGsdkhneAWW4kx08MxTuIYhhGcYdolPZzhOx33iOzbagwJH9jAUgq
+	fayLNp2oalvqNapCIAAZwaGGqdgDAAdszojtG3bhh+1oKaxmGGAARBUGU9nadIAH6feN
+	ggCoLvubxsSmDoRgAA97dUA4EoTmub5fyOhVukM3aSFYLaZXQAVEEfgb94SLvQr5v3eh
+	ZonRIZ0H7e9sWhgOf7A0HHleTRC86fczAkDAPAAAQBAGAB1nKbwAAQBb2AgCnRgmDDyB
+	SGggbTg9XaH6ee4CDQBnnDwGGNqQd+8F4cBSJPFLA1chI0R0uIHMPtlqiVHKQM4WRl5c
+	1LscAAOwcw4EmgWA4AAAYBF6J6gqwJmJnoMgdAK0kFoGG8ELVEgkEkBobEPPQN6HQAIF
+	EIGeOhcY4B7PPdi7A+DEWyuyaEzBSjQGvwoUfEhx0Sl/tgUmQUEQCH/AvAzDEhSPH/Q0
+	hvGMhcOYdrFUgM0criBuxDiQ0Bn8TkTMURNHJhxdorQWdq/WOy/Y6xvbynZsAJQFtJBi
+	BqLxCVRAlkZGSRxBz0IXG7Dw/hCxnjiXoOofSQyygCX441Zsf2BL+YWot6Ufx/D8Y3CN
+	IZ75QQWYbBaUjbmix+liBgAw+QAAuA4xsyJz2kyMBKSMtA9ZjOdMDI8n6cH0AIARMg2M
+	knBOEIutN6EE1qkWSigCDS1nozWI8ZGMAAATTlI4Wg/w6AASqY2kKVsyieFonGegbk9Z
+	KKHVattPK2VyKwXwrufJZptpOAjBqfU31OKOoC9Ga5aJgTknMRstE2y0TuPbPtgysoTq
+	CT1QsxJvRyTQH/PUbiZ00vVVySSf1CnenCHfNxWr96WT/pkQucZ0gTkcmZRQttFiJq9G
+	3UEAANKiEMm2cVAJF6HmwABUEbdQ6ilvHtVNH0x05gVUcnyky94SL0LrRgADVaRUkmnB
+	GbJPFpzGYwVEdiowPkxnARWcYKK6U6KuchxUzKLUdIMMivwABdWBRUiypiA5dEHrY5Zq
+	FIJuIVXaOIwxiAWWTAALuywAAf2ZAAM6zhCGPgAGnaFCbo6XAAB9acAAG7VAAFNa1MDi
+	DDgQMSFa2i76NkMVSOOsc9gFW9g0PdMybx/0IoYni4i8HYVgLQNobI10tJcBcC8GM3bj
+	TYcbP2jRbWFgDAEuEAycZfnQroCiuyca8TQABT4iU461JkR0l5xEzFRPhk9VdJSTKupy
+	ToMW/gAAa3/mbM9LY+L3JmTE3iZ0z6mFowSns1KVAMAAG1hN1q41emrPJfAAAGsOUzus
+	ACxh6MJjaq3BprLrwAmIlGwC65imGRVI7HRsGLWxSzIvC1PoJAID3g1e28d5XEnJnZel
+	IWH6G0pNxdmO9YKPQSpXBSs5HEsUiGzlXEpkRwDzAUAAfYDqC4wNJEYgo/jdtuZqVeTq
+	xl/yvcgrRTLPI9y0bNjZtABB5pSBCA3Hl4Wkgqz9kC8+B8iTvcZkotOTHe0Hw9lDJdxy
+	L6MvuOekQ2NKVluQAAb4817j5AZl8h7aEc4ED+GQJ4AAnBdDXekAy4xtDTGXOQFwNEfF
+	6HsPQ8Rb33gaSUOF877ALAAHUOWyAFQNPfAOAh147h1aSBkD0IgABxjcdM+lloLQag9g
+	uzVnbMADj0zwA0e2PZj5+BVoA5NhgAX5MiNcdczwCAHkFnLMOcWyEScetV/NCWv75hQ4
+	+DLREdJTAPgQCirFIJL0kejSjpk0PPIUN0eS9x7gJtk3l/GMp1yqAANwaYzDJPiQ1jxz
+	yZh9D5wIBECuEYSJDHIN4bJtQJJuH/mQ4nKcuPbTIPjHgAoSZc51hsEIJsQOlw2B+YYF
+	AMwhIaSGUC4R6uKBEA/HhC6Hgr6tuZxW6L8kLGYPC2QBQD6EbJHKQG9YmP67PEuPOcGw
+	77bPFeJ7Ah+80A4P5KQFgGpxIXOmkQ1+/YlIWNsd7LR5AItlv5XHcHHjQGGLpxI69JAf
+	BJuUbo1Rmp+BOC8AACQFstHIN25wJwYA52BB3dPYDnDxcUAXVfH3x6rmf6yZ4FwOsgXs
+	ezskRWiNFAcPpKQJQIbh6odCyYLOsXPwJflSAyR29fAS4hWfisaVf4upXsseoqr60LcI
+	tYHh/DrTl3khg6fyd97/b3LZCxtDvUOPAA3FfE8WziWhyYwvU0vfLB4EgLdZQcsgAI9a
+	HqHmT6Ak2IcSHQt0AQAUZaAiAwhCH25+HYHOsgAYAeQC2iGqAACiDKDy9O7E38icUgAi
+	H2cUBMAi6md6oeQ+Ba+Oqm3CvyqY74G8AG3KAKAUmeIOHAGwGiAAA4BG3KSC7EH6405M
+	3CH45wy8TcIPAESMfMdMBMBeBuziHmHecUAaAgAmIoHkHgraAcfYS0HuYwIETjAUUONM
+	HoHiT6fUtkNM7mIKBKAG/A7w70IUHVDspEGrDy0sIWGuHaXuZS08xqdij6hMU8jw7Qxc
+	jikBEK0a7iIIaWSkBOAm3CUhBURAjKmS4WeQIMmYtKvavym2TKAAHEANBYAiAyPIH05+
+	GAFeE8S6dcfRAWxA8qRUBMBcAAGwGccqdQ+MAsA8BE42GkGSAABUBoB+s2GEFqRsAyBA
+	vJCo/A7AdfGeTkA0re2UPyfUoLDKg3Amw2BApzAAXHAqoLCorbC4nU7AXGB8CcC+Rs7m
+	IIBYARDk/EIXDsHVDxD04aIZD6ZaHWAGoKjoBYHQFoOiAW+E3+fyWw+qK4GqHuQCGwAs
+	2eLQAsH+SkBQAkYwIWvbBWIYvaVESQAyIQmYvOnG62IMVEGUHoZAAG9aIOHCGyGgTOAb
+	IAfCABB0Gc8wumH9CGhE9YnW5LJ+5OhA5y3C1qT7Jm1+HoHe/A3emfFU3DKQd8HanUfE
+	XoAcAk1+45GGA+8yj8HsHqSMSEmeKsY2HsHkSMBCBWBmMSYWBaAQc47wH6IYsSPQGpLs
+	8AawHaUOc5ECAAB0HcFmnIAGnUFQF848CKBq3KASW+ILJqG4HK/ABGA0qwIOzITiALMY
+	X+HQHcSMAkAdH6Hgf8G6HNHuAmAeZaBuBQZAHoHuwIAKQ6HwH0bwLeHMHaT6AwAk/gII
+	HSHef8BOA8wiGeHy10GaAmCOYeAyACcVIvIyIVBcQ9EuIUwGwdNuSrMqruOSVFJMISFw
+	HGqwH+AG7E3k7M7caGmq7SKQ+uigNiIKBsAbHuAsAcd4ITLoMFLsGoxKUgGoHWZa0kqS
+	JCB4HOFMQQH4qeDkE+FynIAzCyHkHul0AkAYdeGAGog8Aa+eAAB2BSe+GUG0PyBiBEwi
+	H4KuAgXEAAFsGcpKCQBihqG+HUT6RKCoB0BWAAGKGwsgMCTiHMHcf8BCAuoKHBRcAAAm
+	Aay2G/N4AABuBMhCCyB9BYGaACBSAAGUAsCgYCA6AGcUBSAnOapoOYx5I4IXOmq0whJF
+	OwcUq1O2IQFiG8dGH+560fPU+u+0zgdtTiJQeiBsAec4A2AhPmIQm3LrLu/QIYGmHWUO
+	HIH7IALMB6HCE0l2H4ucpiNBNiY2HgHsl0AwAgXupWJUGWAI80GSA8DAloA6AIraBUAm
+	aSMjS8l2BdFvTCS5THOtE5TMAAtLTSIOGiHM9iAK+0J0503C2Q/SKGKuNUaOLCAVDoIT
+	UAMEtCGmABUGIWGkHUUOHEH4qSIMAUHkg9PAXoIIk9PIzBXCj6aDAgwIKsbwdca9IUif
+	TqzElqZ0HwAYA2YeBCAMraBWAoaSIXOeBfX8IZTEwfVmzHVqvPVwK2HXYSv0qwr4pori
+	JitKPRWdWgt8VaGwHWy2HYH2deYLEQbE7UIijoli50aTCObwAYy9PGIg7YIlZEzAAmAG
+	bqAuz2RrVZX881VgwJVkwjOuvMOSsTYOWk0RPQbQljZc+mILHsKwK0J1Yaw+q1YktEwa
+	pQoAVjaq0LEapWnGyGoIVnauIgycyRU4d7VYBhbNYBVjYFZ5VpZ8cVYTKY560gKUEnbo
+	AAClbvB6A4hDbHawuoIqT0V6PQGlcG82ATY4JbbEyQJEoe0Fa6yfcUJeUhOeBjcpbRZ1
+	bVTLbaAA/Ic43URqHyH4aSLjbkJmGkGjWeBOBQ6EAPdYJ+H2H6wIAYAOQCu6fGpsR6PQ
+	Gjd1cKxQn4I5OeQ5dsuqIu3QqZWi0S30IU0Evpd4MVd8InOeBlelctOoSnYGTeKusS75
+	aCfIAMFCdUYsI1ToI1XI/jIS7a8RIW3wPdJ3W+HYCaNqANXoz4pEGhfteaIeMyiYRrOe
+	tVXpe5bDa+o80+u0LasZcNcPb+TyZhVZekczZzerTJZ6g2Kle3biVkHaASE/WgAZT83v
+	aQ0/Tjac+zERfGI+6YLaH6HKCWh4AO11I0mOPRftJjgRbBcTa/OfZ3eqqRJsHAg874RW
+	e/iCwLFw0qLQBTiRT+O0TaTch0fOosnK6EsTH00fhuABVYBnizeph1gmsS4QhEQ6MiHa
+	ARg2ddT83ybOV2hPhNXhY9ZbPQ7W7QLNfaMkHXfgAaANJCMjOePQGfj9fwIlbeteIhFE
+	GNkMvQp4IImZH0tKs+s5JweAdSq0IOwxc2/LdYXHOfbMBgRCRGVFePgUuKITixi1ghi5
+	bZgoraRjeCIYHWAKFAAAGeGUqe2UYwA8BGQC50bwAuAyUOG23YNUBCtlK+bwAgAkdfC3
+	XO5oHwHsY2lVLkBOBaqwGWGEpCA66icEAaXHCrKgAgmeG4ayw2A8PYASAUSHCOTidcXo
+	GoGanU2KPYAaAcmeHgHa3DPCk8AwA2PYSEvrl6fAHcCYLCAPXpckqoPRkfYoy2tusSwY
+	mdb8Q0l0LEAefBJq0UOuzNYITjeYLRi+QMdG0Fi+T+rfFFlBoem8UdOeqI1llNcxi6Kl
+	lWQ672AHFcGuGig9m4g2HSYw5SZafCLWHYHUYwAgAideAUAaSGHkHewJnKcQAXjwwkGq
+	/AAiAmdeBoB0hCGCFyfO2QSGA4BAPYGQGCsgBeBq102WaS2QXoA5mEtAGY0kBqB4PIG6
+	GycUW+k9mSR8HmTMAznGnWH2TjFQUOBUBhJCAIHfoDjw11VWOboOs7amrBkEWKARdaaC
+	Ugq0LReYIncfgFcRkUKvh4ya0MigaDOev+Bri3pblQsSHGXdlYjkHOAHg21WuDTg7GIb
+	K+TMXs+gigic1rtyAW+hZZttPI2U3DAsmeQ5XAhRWKAOHjjvhcIZeKMEGbupkAIasSWL
+	kwngJLVZtNtROrbXozlTFHtaQ6UgHIH8E41VtorRaGyMJSLfHeTOHs1KAdoGUdukNiQY
+	49hqIfuwP5u0yPhAJpYfV+S5u9pZvBczvGeNjAfGMjWsE7vW+w7JaIolTtZUzfjheRlE
+	ivDG82HuCUSaAQZAMi0EPQGXxToS0uHgHuXoHaHY/ANtonwDw4w/otENvdtDjVtEurjW
+	c6LaAmAXLkIXVYBtyPu/etvDewTisTidwcIYHmHzHuW+XG4xu3fyIKAMAEy2u5PEINxO
+	MFxS1fv6d6HKH0TcHmJDAqtldYdeli5moBuEZljiUQIA/n+AACAgCAABA4RB4JDYHCoV
+	CIlDITEotFYJDIjFItG4Q/HU5gAGwQ74S/4jCHzKwANpdF4s+JkAHhNQAGJxF39OwA65
+	8AG9QQAA6JMKNR6REpRAwDTZPKaTUalU4nTqXGY5VKVKKxT61H34/AA/bI/2XZwACLVX
+	qbB3O+wmAHe/4ODAaEAABgOBwA1WYxQAtFKmQAPCSUgA9no8wAEAoFwA4m01QABwSCgA
+	FQyHQA9Xk8QACgYDKGBQNcnU6AADQeEQABbW5m+3AAFw6IAA83g7tKBQBBgEABkPSKAG
+	It1aAAcEbiAgGBAA9HjJquRyqX4xCK5Fn87JEGgNJqPMnwABv56R5JpNpwGIvV586wA2
+	/pvwFwavba9X4t+vypz3oVADtv6jUBKy/itP+g6rwLBiuP0jsIKtCaDrIfp/mVDS0rXB
+	wAHKfS4ncfqDgWBy8L0vh1nMcgAHidx1LGsKhgI3x8MUAB8HuerKssAAHgmCoAHSchwA
+	AAgCNOCgNM4bZpmYzMmR+CMhHcdZzgACgMA2AB5HcdsjtMABwGwaQAB0JDEF+WBSJGEQ
+	TsaCQLAAfR8nuACdn8AAVBmHSFwQioAu8AANAO3jxpmHFFPSmaangm6cqOfVJgAclLKG
+	osE01TdOU7T1Pou/QE1Gsayw0ZUOAQ/aJRACien2usTryBAErYjiKIgib+qVXTtJOhdd
+	1+hqq1tYKMI9Xrs1xYVboQAZ3HKkdDK6mNE0XRDy0dSD3K/BtQW/cFw3FTb9QvDMNr2v
+	ijnIfNXHSfSDgUu7Qn40CEz07cBwPXllWDfNAWRf6YYFZll37ZJ+z04J+gAfYIA9XzXn
+	jaIOAPMD/K5SZ9ABRQcUZbL2UjceR5JkuTU1cxk5VHt1KMcZ8VcdB9ODeS8BodZcgAE4
+	FHopEFphg1hvfZKIQrBWCqPoKsmqfUhGqC7iv0BB5RaDoEUOoyVnyAAc67j710e9uT7H
+	smy5PcxkbTVNVoQcB7yEc59L4cJsGeAAuAydIABeBjGYGAA2EoVYABAC4JUICYHNWBNV
+	GOa8jBqE2IH2sk8IFxAHgAdR4Z7BgAHcek7ggBdahMDk5nYeUeGOaxvgAEIMLiA4CgGr
+	oGcYAAjhoFFkoQZ59g4ABhgMGyugWeyRA+BVH5+9SXeKo55elH4H8yCnr7N7Pte3lCy7
+	SZGWQCgZvntOZ4gQDIAHadBwgAJR9GCAAWgJFqjmycp2AAbhzt50dVAMAQb4aw438gjA
+	wa4AhBixkKHsPhjZEXbmnGONgcYAAggtBCXkAjtR5j2a2N4dRJoHFiBc4UAA7B4j2AAB
+	kCYDU9gcSERki4zwAu8GaBoxBGAID4WiCABT+WMEDY0mcHSfnuRHiRElTq5hjRNbWhIg
+	Y3h6pzHeAcDR2QbDeE0AAFg9xnKeaUUZZB2VyL8aER1okMwEg3AANAEQYSKkDAoPpaII
+	QFpgKO1oAAO4+RKj9H+QBRomROXSUgbg805jtissIAg+VHueLo7VZZTCHNDYxGiIKoUK
+	FHI9JMhrnpMSbX4c4AA/ACALIuBYfa0QRAMiAhQgcegeSzkDLWW0SFzDFl0+Eo42h6GQ
+	HWAN9KwCHyfjM0mOMxlfRjKTGGYpB2gzIme0KYqwCpEHlVBUEoDn8qSUpLMHkt5xTjbG
+	uYYk54nlGHOPNWo+B/qqIK0VP7A19oBnmsJApSWCISnvPyGU9p/oEWIz4gYCgBMbAsAt
+	O7P49A9odOSiFEVwTmnRIWKBXWfycaNRdCKmmf0ZjFRsrZTEAUeaNSAmEegfUrolS2ly
+	CVzDDplLwo0mWx02KjThk1OikU8m8xulYPqX1DqJQQlAv6kJHSQrZB5UJrywk1U2jFAq
+	p0kqkV+nkmas1Qp8VEq4P6wVFrFWMpY/x2VnqjWOtRXwDVtNWA2F1a65URrLXOu1d68V
+	5O0t6vVfa/V/nFXWwFg7CWFe1YKw1ibFWLU/Yixlj7IWRpDVSyVlbLWGsdZezVm69EBA
+	AA4BAAADAAAAAQBeAAABAQADAAAAAQBMAAABAgADAAAABAAAGWIBAwADAAAAAQAFAAAB
+	BgADAAAAAQACAAABEQAEAAAAAQAAAAgBEgADAAAAAQABAAABFQADAAAAAQAEAAABFgAD
+	AAAAAQBMAAABFwAEAAAAAQAAGKwBHAADAAAAAQABAAABPQADAAAAAQACAAABUgADAAAA
+	AQABAAABUwADAAAABAAAGWoAAAAAAAgACAAIAAgAAQABAAEAAQ==
+	</data>
+	<key>ReadOnly</key>
+	<string>NO</string>
+	<key>RowAlign</key>
+	<integer>1</integer>
+	<key>RowSpacing</key>
+	<real>36</real>
+	<key>SheetTitle</key>
+	<string>Canvas 1</string>
+	<key>SmartAlignmentGuidesActive</key>
+	<string>YES</string>
+	<key>SmartDistanceGuidesActive</key>
+	<string>YES</string>
+	<key>UniqueID</key>
+	<integer>1</integer>
+	<key>UseEntirePage</key>
+	<false/>
+	<key>VPages</key>
+	<integer>1</integer>
+	<key>WindowInfo</key>
+	<dict>
+		<key>CurrentSheet</key>
+		<integer>0</integer>
+		<key>ExpandedCanvases</key>
+		<array>
+			<dict>
+				<key>name</key>
+				<string>Canvas 1</string>
+			</dict>
+		</array>
+		<key>Frame</key>
+		<string>{{516, 97}, {969, 926}}</string>
+		<key>ListView</key>
+		<true/>
+		<key>OutlineWidth</key>
+		<integer>142</integer>
+		<key>RightSidebar</key>
+		<false/>
+		<key>ShowRuler</key>
+		<true/>
+		<key>Sidebar</key>
+		<true/>
+		<key>SidebarWidth</key>
+		<integer>120</integer>
+		<key>VisibleRegion</key>
+		<string>{{-129, -19}, {834, 772}}</string>
+		<key>Zoom</key>
+		<real>1</real>
+		<key>ZoomValues</key>
+		<array>
+			<array>
+				<string>Canvas 1</string>
+				<real>1</real>
+				<real>1</real>
+			</array>
+		</array>
+	</dict>
+	<key>saveQuickLookFiles</key>
+	<string>YES</string>
+</dict>
+</plist>
diff --git a/docs/html/images/rs_graphics.png b/docs/html/images/rs_graphics.png
new file mode 100644
index 0000000..fde58d2
--- /dev/null
+++ b/docs/html/images/rs_graphics.png
Binary files differ
diff --git a/docs/html/images/rs_overview.graffle b/docs/html/images/rs_overview.graffle
new file mode 100644
index 0000000..5613744
--- /dev/null
+++ b/docs/html/images/rs_overview.graffle
@@ -0,0 +1,3012 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>ActiveLayerIndex</key>
+	<integer>0</integer>
+	<key>ApplicationVersion</key>
+	<array>
+		<string>com.omnigroup.OmniGrafflePro</string>
+		<string>138.28.0.154505</string>
+	</array>
+	<key>AutoAdjust</key>
+	<true/>
+	<key>BackgroundGraphic</key>
+	<dict>
+		<key>Bounds</key>
+		<string>{{0, 0}, {576, 733}}</string>
+		<key>Class</key>
+		<string>SolidGraphic</string>
+		<key>ID</key>
+		<integer>2</integer>
+		<key>Style</key>
+		<dict>
+			<key>shadow</key>
+			<dict>
+				<key>Draws</key>
+				<string>NO</string>
+			</dict>
+			<key>stroke</key>
+			<dict>
+				<key>Draws</key>
+				<string>NO</string>
+			</dict>
+		</dict>
+	</dict>
+	<key>CanvasOrigin</key>
+	<string>{0, 0}</string>
+	<key>ColumnAlign</key>
+	<integer>1</integer>
+	<key>ColumnSpacing</key>
+	<real>36</real>
+	<key>CreationDate</key>
+	<string>2011-09-07 14:32:49 -0700</string>
+	<key>Creator</key>
+	<string>Robert Ly</string>
+	<key>DisplayScale</key>
+	<string>1 0/72 in = 1.0000 in</string>
+	<key>GraphDocumentVersion</key>
+	<integer>6</integer>
+	<key>GraphicsList</key>
+	<array>
+		<dict>
+			<key>Class</key>
+			<string>LineGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Font</key>
+				<string>DroidSans</string>
+				<key>Size</key>
+				<real>11</real>
+			</dict>
+			<key>Head</key>
+			<dict>
+				<key>ID</key>
+				<integer>214</integer>
+				<key>Info</key>
+				<integer>3</integer>
+			</dict>
+			<key>ID</key>
+			<integer>227</integer>
+			<key>OrthogonalBarAutomatic</key>
+			<false/>
+			<key>OrthogonalBarPoint</key>
+			<string>{0, 0}</string>
+			<key>OrthogonalBarPosition</key>
+			<real>6.25</real>
+			<key>Points</key>
+			<array>
+				<string>{367.375, 325.998}</string>
+				<string>{332.375, 325.998}</string>
+			</array>
+			<key>Style</key>
+			<dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.7</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>4</real>
+					<key>HeadArrow</key>
+					<string>0</string>
+					<key>LineType</key>
+					<integer>2</integer>
+					<key>TailArrow</key>
+					<string>0</string>
+				</dict>
+			</dict>
+			<key>Tail</key>
+			<dict>
+				<key>ID</key>
+				<integer>200</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Class</key>
+			<string>LineGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Font</key>
+				<string>DroidSans</string>
+				<key>Size</key>
+				<real>11</real>
+			</dict>
+			<key>Head</key>
+			<dict>
+				<key>ID</key>
+				<integer>4</integer>
+			</dict>
+			<key>ID</key>
+			<integer>226</integer>
+			<key>OrthogonalBarAutomatic</key>
+			<false/>
+			<key>OrthogonalBarPoint</key>
+			<string>{0, 0}</string>
+			<key>OrthogonalBarPosition</key>
+			<real>4.1290435791015625</real>
+			<key>Points</key>
+			<array>
+				<string>{138.375, 427.17}</string>
+				<string>{138.375, 454.17}</string>
+			</array>
+			<key>Style</key>
+			<dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.7</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>4</real>
+					<key>HeadArrow</key>
+					<string>FilledArrow</string>
+					<key>LineType</key>
+					<integer>2</integer>
+					<key>TailArrow</key>
+					<string>0</string>
+				</dict>
+			</dict>
+			<key>Tail</key>
+			<dict>
+				<key>ID</key>
+				<integer>157</integer>
+				<key>Info</key>
+				<integer>5</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Bounds</key>
+			<string>{{43.375, 454.17}, {190, 50.1697}}</string>
+			<key>Class</key>
+			<string>ShapedGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Color</key>
+				<dict>
+					<key>b</key>
+					<string>0</string>
+					<key>g</key>
+					<string>0</string>
+					<key>r</key>
+					<string>0</string>
+				</dict>
+				<key>Font</key>
+				<string>Helvetica-Bold</string>
+				<key>Size</key>
+				<real>10</real>
+			</dict>
+			<key>ID</key>
+			<integer>4</integer>
+			<key>Magnets</key>
+			<array>
+				<string>{1, 1}</string>
+				<string>{1, -1}</string>
+				<string>{-1, -1}</string>
+				<string>{-1, 1}</string>
+				<string>{0, 1}</string>
+				<string>{0, -1}</string>
+				<string>{1, 0}</string>
+				<string>{-1, 0}</string>
+				<string>{-0.5, -0.233518}</string>
+				<string>{-0.491442, 0.260063}</string>
+				<string>{0.507118, -0.224086}</string>
+				<string>{0.507118, 0.267179}</string>
+				<string>{-0.27431, -0.474028}</string>
+				<string>{0.27978, -0.478478}</string>
+				<string>{0.293938, 0.543044}</string>
+				<string>{-0.286232, 0.553804}</string>
+			</array>
+			<key>Shape</key>
+			<string>Rectangle</string>
+			<key>Style</key>
+			<dict>
+				<key>fill</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.274119</string>
+						<key>g</key>
+						<string>0.950739</string>
+						<key>r</key>
+						<string>0.787494</string>
+					</dict>
+					<key>FillType</key>
+					<integer>2</integer>
+					<key>GradientAngle</key>
+					<real>90</real>
+					<key>GradientColor</key>
+					<dict>
+						<key>b</key>
+						<string>0.223529</string>
+						<key>g</key>
+						<string>0.776471</string>
+						<key>r</key>
+						<string>0.643137</string>
+					</dict>
+				</dict>
+				<key>shadow</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.35</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>Fuzziness</key>
+					<real>2.3972222805023193</real>
+					<key>ShadowVector</key>
+					<string>{0, 1}</string>
+				</dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.165602</string>
+						<key>g</key>
+						<string>0.586124</string>
+						<key>r</key>
+						<string>0.428309</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>3</real>
+				</dict>
+			</dict>
+			<key>Text</key>
+			<dict>
+				<key>Text</key>
+				<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 Renderscript Graphics and Compute Engine}</string>
+				<key>VerticalPad</key>
+				<integer>0</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Bounds</key>
+			<string>{{303.368, 423.5}, {70, 24}}</string>
+			<key>Class</key>
+			<string>ShapedGraphic</string>
+			<key>FitText</key>
+			<string>YES</string>
+			<key>Flow</key>
+			<string>Resize</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Color</key>
+				<dict>
+					<key>a</key>
+					<string>0.65</string>
+					<key>w</key>
+					<string>0</string>
+				</dict>
+				<key>Font</key>
+				<string>DroidSans</string>
+				<key>Size</key>
+				<real>10</real>
+			</dict>
+			<key>ID</key>
+			<integer>224</integer>
+			<key>Line</key>
+			<dict>
+				<key>ID</key>
+				<integer>223</integer>
+				<key>Position</key>
+				<real>0.61347693204879761</real>
+				<key>RotationType</key>
+				<integer>0</integer>
+			</dict>
+			<key>Magnets</key>
+			<array>
+				<string>{0, 1}</string>
+				<string>{0, -1}</string>
+				<string>{1, 0}</string>
+				<string>{-1, 0}</string>
+			</array>
+			<key>Shape</key>
+			<string>Rectangle</string>
+			<key>Style</key>
+			<dict>
+				<key>shadow</key>
+				<dict>
+					<key>Draws</key>
+					<string>NO</string>
+				</dict>
+				<key>stroke</key>
+				<dict>
+					<key>Draws</key>
+					<string>NO</string>
+				</dict>
+			</dict>
+			<key>Text</key>
+			<dict>
+				<key>RTFD</key>
+				<data>
+				BAtzdHJlYW10eXBlZIHoA4QBQISEhBJOU0F0dHJpYnV0
+				ZWRTdHJpbmcAhIQITlNPYmplY3QAhZKEhIQITlNTdHJp
+				bmcBlIQBKwpSZWFkL1dyaXRlhoQCaUkBCpKEhIQMTlNE
+				aWN0aW9uYXJ5AJSEAWkDkoSWlgdOU0NvbG9yhpKEhIQH
+				TlNDb2xvcgCUhAFjA4QCZmYAg2ZmJj+GkoSWlgZOU0Zv
+				bnSGkoSEhAZOU0ZvbnQelJkchAVbMjhjXQYAAAAUAAAA
+				//5IAGUAbAB2AGUAdABpAGMAYQCEAWYMmwCbAZsAmwCG
+				koSWlhBOU1BhcmFncmFwaFN0eWxlhpKEhIQQTlNQYXJh
+				Z3JhcGhTdHlsZQCUhARDQ0BTAgCEhIQHTlNBcnJheQCU
+				mQyShISECU5TVGV4dFRhYgCUhAJDZgAchpKEpaQAOIaS
+				hKWkAFSGkoSlpABwhpKEpaQAgYwAhpKEpaQAgagAhpKE
+				paQAgcQAhpKEpaQAgeAAhpKEpaQAgfwAhpKEpaQAgRgB
+				hpKEpaQAgTQBhpKEpaQAgVABhoYAhoaG
+				</data>
+				<key>Text</key>
+				<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;\red0\green0\blue0;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
+
+\f0\fs24 \cf2 Read/Write}</string>
+				<key>alpha</key>
+				<array>
+					<array>
+						<integer>0</integer>
+						<integer>10</integer>
+						<real>0.64999997615814209</real>
+					</array>
+				</array>
+			</dict>
+			<key>Wrap</key>
+			<string>NO</string>
+		</dict>
+		<dict>
+			<key>Class</key>
+			<string>LineGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Font</key>
+				<string>DroidSans</string>
+				<key>Size</key>
+				<real>11</real>
+			</dict>
+			<key>Head</key>
+			<dict>
+				<key>ID</key>
+				<integer>225</integer>
+				<key>Info</key>
+				<integer>7</integer>
+			</dict>
+			<key>ID</key>
+			<integer>223</integer>
+			<key>OrthogonalBarAutomatic</key>
+			<false/>
+			<key>OrthogonalBarPoint</key>
+			<string>{0, 0}</string>
+			<key>OrthogonalBarPosition</key>
+			<real>31</real>
+			<key>Points</key>
+			<array>
+				<string>{413.275, 381.998}</string>
+				<string>{258.125, 435.5}</string>
+			</array>
+			<key>Style</key>
+			<dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.7</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>4</real>
+					<key>HeadArrow</key>
+					<string>FilledArrow</string>
+					<key>LineType</key>
+					<integer>2</integer>
+					<key>TailArrow</key>
+					<string>FilledArrow</string>
+				</dict>
+			</dict>
+			<key>Tail</key>
+			<dict>
+				<key>ID</key>
+				<integer>200</integer>
+				<key>Info</key>
+				<integer>16</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Bounds</key>
+			<string>{{306.62, 201.5}, {70, 24}}</string>
+			<key>Class</key>
+			<string>ShapedGraphic</string>
+			<key>FitText</key>
+			<string>YES</string>
+			<key>Flow</key>
+			<string>Resize</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Color</key>
+				<dict>
+					<key>a</key>
+					<string>0.65</string>
+					<key>w</key>
+					<string>0</string>
+				</dict>
+				<key>Font</key>
+				<string>DroidSans</string>
+				<key>Size</key>
+				<real>10</real>
+			</dict>
+			<key>ID</key>
+			<integer>222</integer>
+			<key>Line</key>
+			<dict>
+				<key>ID</key>
+				<integer>221</integer>
+				<key>Position</key>
+				<real>0.60332739353179932</real>
+				<key>RotationType</key>
+				<integer>0</integer>
+			</dict>
+			<key>Magnets</key>
+			<array>
+				<string>{0, 1}</string>
+				<string>{0, -1}</string>
+				<string>{1, 0}</string>
+				<string>{-1, 0}</string>
+			</array>
+			<key>Shape</key>
+			<string>Rectangle</string>
+			<key>Style</key>
+			<dict>
+				<key>shadow</key>
+				<dict>
+					<key>Draws</key>
+					<string>NO</string>
+				</dict>
+				<key>stroke</key>
+				<dict>
+					<key>Draws</key>
+					<string>NO</string>
+				</dict>
+			</dict>
+			<key>Text</key>
+			<dict>
+				<key>RTFD</key>
+				<data>
+				BAtzdHJlYW10eXBlZIHoA4QBQISEhBJOU0F0dHJpYnV0
+				ZWRTdHJpbmcAhIQITlNPYmplY3QAhZKEhIQITlNTdHJp
+				bmcBlIQBKwpSZWFkL1dyaXRlhoQCaUkBCpKEhIQMTlNE
+				aWN0aW9uYXJ5AJSEAWkDkoSWlgdOU0NvbG9yhpKEhIQH
+				TlNDb2xvcgCUhAFjA4QCZmYAg2ZmJj+GkoSWlgZOU0Zv
+				bnSGkoSEhAZOU0ZvbnQelJkchAVbMjhjXQYAAAAUAAAA
+				//5IAGUAbAB2AGUAdABpAGMAYQCEAWYMmwCbAZsAmwCG
+				koSWlhBOU1BhcmFncmFwaFN0eWxlhpKEhIQQTlNQYXJh
+				Z3JhcGhTdHlsZQCUhARDQ0BTAgCEhIQHTlNBcnJheQCU
+				mQyShISECU5TVGV4dFRhYgCUhAJDZgAchpKEpaQAOIaS
+				hKWkAFSGkoSlpABwhpKEpaQAgYwAhpKEpaQAgagAhpKE
+				paQAgcQAhpKEpaQAgeAAhpKEpaQAgfwAhpKEpaQAgRgB
+				hpKEpaQAgTQBhpKEpaQAgVABhoYAhoaG
+				</data>
+				<key>Text</key>
+				<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;\red0\green0\blue0;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
+
+\f0\fs24 \cf2 Read/Write}</string>
+				<key>alpha</key>
+				<array>
+					<array>
+						<integer>0</integer>
+						<integer>10</integer>
+						<real>0.64999997615814209</real>
+					</array>
+				</array>
+			</dict>
+			<key>Wrap</key>
+			<string>NO</string>
+		</dict>
+		<dict>
+			<key>Class</key>
+			<string>LineGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Font</key>
+				<string>DroidSans</string>
+				<key>Size</key>
+				<real>11</real>
+			</dict>
+			<key>Head</key>
+			<dict>
+				<key>ID</key>
+				<integer>155</integer>
+				<key>Info</key>
+				<integer>7</integer>
+			</dict>
+			<key>ID</key>
+			<integer>221</integer>
+			<key>OrthogonalBarAutomatic</key>
+			<false/>
+			<key>OrthogonalBarPoint</key>
+			<string>{0, 0}</string>
+			<key>OrthogonalBarPosition</key>
+			<real>4.1290435791015625</real>
+			<key>Points</key>
+			<array>
+				<string>{410.256, 272.907}</string>
+				<string>{258.125, 213.5}</string>
+			</array>
+			<key>Style</key>
+			<dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.7</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>4</real>
+					<key>HeadArrow</key>
+					<string>FilledArrow</string>
+					<key>LineType</key>
+					<integer>2</integer>
+					<key>TailArrow</key>
+					<string>FilledArrow</string>
+				</dict>
+			</dict>
+			<key>Tail</key>
+			<dict>
+				<key>ID</key>
+				<integer>200</integer>
+				<key>Info</key>
+				<integer>13</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Bounds</key>
+			<string>{{278.375, 306.998}, {54, 38}}</string>
+			<key>Class</key>
+			<string>ShapedGraphic</string>
+			<key>FitText</key>
+			<string>YES</string>
+			<key>Flow</key>
+			<string>Resize</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Color</key>
+				<dict>
+					<key>a</key>
+					<string>0.65</string>
+					<key>w</key>
+					<string>0</string>
+				</dict>
+				<key>Font</key>
+				<string>DroidSans</string>
+				<key>Size</key>
+				<real>10</real>
+			</dict>
+			<key>ID</key>
+			<integer>214</integer>
+			<key>Line</key>
+			<dict>
+				<key>ID</key>
+				<integer>213</integer>
+				<key>Position</key>
+				<real>0.48846337199211121</real>
+				<key>RotationType</key>
+				<integer>0</integer>
+			</dict>
+			<key>Magnets</key>
+			<array>
+				<string>{0, 1}</string>
+				<string>{0, -1}</string>
+				<string>{1, 0}</string>
+				<string>{-1, 0}</string>
+			</array>
+			<key>Shape</key>
+			<string>Rectangle</string>
+			<key>Style</key>
+			<dict>
+				<key>shadow</key>
+				<dict>
+					<key>Draws</key>
+					<string>NO</string>
+				</dict>
+				<key>stroke</key>
+				<dict>
+					<key>Draws</key>
+					<string>NO</string>
+				</dict>
+			</dict>
+			<key>Text</key>
+			<dict>
+				<key>RTFD</key>
+				<data>
+				BAtzdHJlYW10eXBlZIHoA4QBQISEhBJOU0F0dHJpYnV0
+				ZWRTdHJpbmcAhIQITlNPYmplY3QAhZKEhIQITlNTdHJp
+				bmcBlIQBKw5NZW1vcnkKQmluZGluZ4aEAmlJAQ6ShISE
+				DE5TRGljdGlvbmFyeQCUhAFpA5KElpYHTlNDb2xvcoaS
+				hISEB05TQ29sb3IAlIQBYwOEAmZmAINmZiY/hpKElpYG
+				TlNGb250hpKEhIQGTlNGb250HpSZHIQFWzI4Y10GAAAA
+				FAAAAP/+SABlAGwAdgBlAHQAaQBjAGEAhAFmDJsAmwGb
+				AJsAhpKElpYQTlNQYXJhZ3JhcGhTdHlsZYaShISEEE5T
+				UGFyYWdyYXBoU3R5bGUAlIQEQ0NAUwIAhISEB05TQXJy
+				YXkAlJkMkoSEhAlOU1RleHRUYWIAlIQCQ2YAHIaShKWk
+				ADiGkoSlpABUhpKEpaQAcIaShKWkAIGMAIaShKWkAIGo
+				AIaShKWkAIHEAIaShKWkAIHgAIaShKWkAIH8AIaShKWk
+				AIEYAYaShKWkAIE0AYaShKWkAIFQAYaGAIaGhg==
+				</data>
+				<key>Text</key>
+				<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;\red0\green0\blue0;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
+
+\f0\fs24 \cf2 Memory\
+Binding}</string>
+				<key>alpha</key>
+				<array>
+					<array>
+						<integer>0</integer>
+						<integer>14</integer>
+						<real>0.64999997615814209</real>
+					</array>
+				</array>
+			</dict>
+			<key>Wrap</key>
+			<string>NO</string>
+		</dict>
+		<dict>
+			<key>Class</key>
+			<string>LineGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Font</key>
+				<string>DroidSans</string>
+				<key>Size</key>
+				<real>11</real>
+			</dict>
+			<key>Head</key>
+			<dict>
+				<key>ID</key>
+				<integer>225</integer>
+				<key>Info</key>
+				<integer>11</integer>
+			</dict>
+			<key>ID</key>
+			<integer>213</integer>
+			<key>OrthogonalBarAutomatic</key>
+			<false/>
+			<key>OrthogonalBarPoint</key>
+			<string>{0, 0}</string>
+			<key>OrthogonalBarPosition</key>
+			<real>4.1290435791015625</real>
+			<key>Points</key>
+			<array>
+				<string>{258.125, 263.815}</string>
+				<string>{305.375, 334}</string>
+				<string>{258.125, 393.3}</string>
+			</array>
+			<key>Style</key>
+			<dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.7</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>4</real>
+					<key>HeadArrow</key>
+					<string>Ball</string>
+					<key>LineType</key>
+					<integer>2</integer>
+					<key>TailArrow</key>
+					<string>0</string>
+				</dict>
+			</dict>
+			<key>Tail</key>
+			<dict>
+				<key>ID</key>
+				<integer>155</integer>
+				<key>Info</key>
+				<integer>12</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Bounds</key>
+			<string>{{328.398, 152.3}, {66, 38}}</string>
+			<key>Class</key>
+			<string>ShapedGraphic</string>
+			<key>FitText</key>
+			<string>Vertical</string>
+			<key>Flow</key>
+			<string>Resize</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Color</key>
+				<dict>
+					<key>a</key>
+					<string>0.65</string>
+					<key>w</key>
+					<string>0</string>
+				</dict>
+				<key>Font</key>
+				<string>DroidSans</string>
+				<key>Size</key>
+				<real>10</real>
+			</dict>
+			<key>ID</key>
+			<integer>199</integer>
+			<key>Line</key>
+			<dict>
+				<key>ID</key>
+				<integer>198</integer>
+				<key>Position</key>
+				<real>0.34207895398139954</real>
+				<key>RotationType</key>
+				<integer>0</integer>
+			</dict>
+			<key>Magnets</key>
+			<array>
+				<string>{0, 1}</string>
+				<string>{0, -1}</string>
+				<string>{1, 0}</string>
+				<string>{-1, 0}</string>
+			</array>
+			<key>Shape</key>
+			<string>Rectangle</string>
+			<key>Style</key>
+			<dict>
+				<key>shadow</key>
+				<dict>
+					<key>Draws</key>
+					<string>NO</string>
+				</dict>
+				<key>stroke</key>
+				<dict>
+					<key>Draws</key>
+					<string>NO</string>
+				</dict>
+			</dict>
+			<key>Text</key>
+			<dict>
+				<key>RTFD</key>
+				<data>
+				BAtzdHJlYW10eXBlZIHoA4QBQISEhBJOU0F0dHJpYnV0
+				ZWRTdHJpbmcAhIQITlNPYmplY3QAhZKEhIQITlNTdHJp
+				bmcBlIQBKxFNZW1vcnkgQWxsb2NhdGlvboaEAmlJARGS
+				hISEDE5TRGljdGlvbmFyeQCUhAFpA5KElpYHTlNDb2xv
+				coaShISEB05TQ29sb3IAlIQBYwOEAmZmAINmZiY/hpKE
+				lpYGTlNGb250hpKEhIQGTlNGb250HpSZHIQFWzI4Y10G
+				AAAAFAAAAP/+SABlAGwAdgBlAHQAaQBjAGEAhAFmDJsA
+				mwGbAJsAhpKElpYQTlNQYXJhZ3JhcGhTdHlsZYaShISE
+				EE5TUGFyYWdyYXBoU3R5bGUAlIQEQ0NAUwIAhISEB05T
+				QXJyYXkAlJkMkoSEhAlOU1RleHRUYWIAlIQCQ2YAHIaS
+				hKWkADiGkoSlpABUhpKEpaQAcIaShKWkAIGMAIaShKWk
+				AIGoAIaShKWkAIHEAIaShKWkAIHgAIaShKWkAIH8AIaS
+				hKWkAIEYAYaShKWkAIE0AYaShKWkAIFQAYaGAIaGhg==
+				</data>
+				<key>Text</key>
+				<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;\red0\green0\blue0;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
+
+\f0\fs24 \cf2 Memory Allocation}</string>
+				<key>alpha</key>
+				<array>
+					<array>
+						<integer>0</integer>
+						<integer>17</integer>
+						<real>0.64999997615814209</real>
+					</array>
+				</array>
+			</dict>
+		</dict>
+		<dict>
+			<key>Class</key>
+			<string>LineGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Font</key>
+				<string>DroidSans</string>
+				<key>Size</key>
+				<real>11</real>
+			</dict>
+			<key>Head</key>
+			<dict>
+				<key>ID</key>
+				<integer>200</integer>
+				<key>Info</key>
+				<integer>6</integer>
+			</dict>
+			<key>ID</key>
+			<integer>198</integer>
+			<key>OrthogonalBarAutomatic</key>
+			<false/>
+			<key>OrthogonalBarPoint</key>
+			<string>{0, 0}</string>
+			<key>OrthogonalBarPosition</key>
+			<real>4.1290435791015625</real>
+			<key>Points</key>
+			<array>
+				<string>{258.125, 171.3}</string>
+				<string>{462.375, 269.998}</string>
+			</array>
+			<key>Style</key>
+			<dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.7</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>4</real>
+					<key>HeadArrow</key>
+					<string>Ball</string>
+					<key>LineType</key>
+					<integer>2</integer>
+					<key>TailArrow</key>
+					<string>0</string>
+				</dict>
+			</dict>
+			<key>Tail</key>
+			<dict>
+				<key>ID</key>
+				<integer>155</integer>
+				<key>Info</key>
+				<integer>11</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Bounds</key>
+			<string>{{367.375, 269.998}, {190, 112}}</string>
+			<key>Class</key>
+			<string>ShapedGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Color</key>
+				<dict>
+					<key>b</key>
+					<string>0</string>
+					<key>g</key>
+					<string>0</string>
+					<key>r</key>
+					<string>0</string>
+				</dict>
+				<key>Font</key>
+				<string>DroidSans-Bold</string>
+				<key>Size</key>
+				<real>10</real>
+			</dict>
+			<key>ID</key>
+			<integer>200</integer>
+			<key>Magnets</key>
+			<array>
+				<string>{1, 1}</string>
+				<string>{1, -1}</string>
+				<string>{-1, -1}</string>
+				<string>{-1, 1}</string>
+				<string>{0, 1}</string>
+				<string>{0, -1}</string>
+				<string>{1, 0}</string>
+				<string>{-1, 0}</string>
+				<string>{-0.5, -0.233518}</string>
+				<string>{-0.491442, 0.260063}</string>
+				<string>{0.507118, -0.224086}</string>
+				<string>{0.507118, 0.267179}</string>
+				<string>{-0.27431, -0.474028}</string>
+				<string>{0.27978, -0.478478}</string>
+				<string>{0.293938, 0.543044}</string>
+				<string>{-0.286232, 0.553804}</string>
+			</array>
+			<key>Shape</key>
+			<string>Rectangle</string>
+			<key>Style</key>
+			<dict>
+				<key>fill</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.628571</string>
+						<key>g</key>
+						<string>0.768599</string>
+						<key>r</key>
+						<string>1</string>
+					</dict>
+					<key>FillType</key>
+					<integer>2</integer>
+					<key>GradientAngle</key>
+					<real>90</real>
+					<key>GradientColor</key>
+					<dict>
+						<key>b</key>
+						<string>0.236788</string>
+						<key>g</key>
+						<string>0.532236</string>
+						<key>r</key>
+						<string>0.990271</string>
+					</dict>
+				</dict>
+				<key>shadow</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.35</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>Fuzziness</key>
+					<real>2.3972222805023193</real>
+					<key>ShadowVector</key>
+					<string>{0, 1}</string>
+				</dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.131021</string>
+						<key>g</key>
+						<string>0.363196</string>
+						<key>r</key>
+						<string>0.725948</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>3</real>
+				</dict>
+			</dict>
+			<key>Text</key>
+			<dict>
+				<key>Text</key>
+				<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 Memory}</string>
+				<key>VerticalPad</key>
+				<integer>0</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Class</key>
+			<string>LineGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Font</key>
+				<string>DroidSans</string>
+				<key>Size</key>
+				<real>11</real>
+			</dict>
+			<key>Head</key>
+			<dict>
+				<key>ID</key>
+				<integer>225</integer>
+			</dict>
+			<key>ID</key>
+			<integer>203</integer>
+			<key>OrthogonalBarAutomatic</key>
+			<false/>
+			<key>OrthogonalBarPoint</key>
+			<string>{0, 0}</string>
+			<key>OrthogonalBarPosition</key>
+			<real>4.1290435791015625</real>
+			<key>Points</key>
+			<array>
+				<string>{138.375, 309.5}</string>
+				<string>{138.375, 340}</string>
+			</array>
+			<key>Style</key>
+			<dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.7</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>4</real>
+					<key>HeadArrow</key>
+					<string>FilledArrow</string>
+					<key>LineType</key>
+					<integer>2</integer>
+					<key>TailArrow</key>
+					<string>0</string>
+				</dict>
+			</dict>
+			<key>Tail</key>
+			<dict>
+				<key>ID</key>
+				<integer>155</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Class</key>
+			<string>LineGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Font</key>
+				<string>DroidSans</string>
+				<key>Size</key>
+				<real>11</real>
+			</dict>
+			<key>Head</key>
+			<dict>
+				<key>ID</key>
+				<integer>201</integer>
+				<key>Info</key>
+				<integer>6</integer>
+			</dict>
+			<key>ID</key>
+			<integer>196</integer>
+			<key>OrthogonalBarAutomatic</key>
+			<false/>
+			<key>OrthogonalBarPoint</key>
+			<string>{0, 0}</string>
+			<key>OrthogonalBarPosition</key>
+			<real>4.1290435791015625</real>
+			<key>Points</key>
+			<array>
+				<string>{138.375, 208.17}</string>
+				<string>{138.375, 233.208}</string>
+			</array>
+			<key>Style</key>
+			<dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.7</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>4</real>
+					<key>HeadArrow</key>
+					<string>FilledArrow</string>
+					<key>LineType</key>
+					<integer>2</integer>
+					<key>TailArrow</key>
+					<string>0</string>
+				</dict>
+			</dict>
+			<key>Tail</key>
+			<dict>
+				<key>ID</key>
+				<integer>202</integer>
+				<key>Info</key>
+				<integer>5</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Bounds</key>
+			<string>{{43.375, 158}, {190, 50.1697}}</string>
+			<key>Class</key>
+			<string>ShapedGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Color</key>
+				<dict>
+					<key>b</key>
+					<string>0</string>
+					<key>g</key>
+					<string>0</string>
+					<key>r</key>
+					<string>0</string>
+				</dict>
+				<key>Font</key>
+				<string>DroidSans-Bold</string>
+				<key>Size</key>
+				<real>10</real>
+			</dict>
+			<key>ID</key>
+			<integer>202</integer>
+			<key>Magnets</key>
+			<array>
+				<string>{1, 1}</string>
+				<string>{1, -1}</string>
+				<string>{-1, -1}</string>
+				<string>{-1, 1}</string>
+				<string>{0, 1}</string>
+				<string>{0, -1}</string>
+				<string>{1, 0}</string>
+				<string>{-1, 0}</string>
+				<string>{-0.5, -0.233518}</string>
+				<string>{-0.491442, 0.260063}</string>
+				<string>{0.507118, -0.224086}</string>
+				<string>{0.507118, 0.267179}</string>
+				<string>{-0.27431, -0.474028}</string>
+				<string>{0.27978, -0.478478}</string>
+				<string>{0.293938, 0.543044}</string>
+				<string>{-0.286232, 0.553804}</string>
+			</array>
+			<key>Shape</key>
+			<string>Rectangle</string>
+			<key>Style</key>
+			<dict>
+				<key>fill</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>1</string>
+						<key>g</key>
+						<string>0.874135</string>
+						<key>r</key>
+						<string>0.71718</string>
+					</dict>
+					<key>FillType</key>
+					<integer>2</integer>
+					<key>GradientAngle</key>
+					<real>90</real>
+					<key>GradientColor</key>
+					<dict>
+						<key>b</key>
+						<string>1</string>
+						<key>g</key>
+						<string>0.662438</string>
+						<key>r</key>
+						<string>0.464468</string>
+					</dict>
+				</dict>
+				<key>shadow</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.35</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>Fuzziness</key>
+					<real>2.3972222805023193</real>
+					<key>ShadowVector</key>
+					<string>{0, 1}</string>
+				</dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.93512</string>
+						<key>g</key>
+						<string>0.472602</string>
+						<key>r</key>
+						<string>0.333854</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>3</real>
+				</dict>
+			</dict>
+			<key>Text</key>
+			<dict>
+				<key>Text</key>
+				<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 Android Application Code}</string>
+				<key>VerticalPad</key>
+				<integer>0</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Bounds</key>
+			<string>{{43.375, 233.208}, {190, 50.1697}}</string>
+			<key>Class</key>
+			<string>ShapedGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Color</key>
+				<dict>
+					<key>b</key>
+					<string>0</string>
+					<key>g</key>
+					<string>0</string>
+					<key>r</key>
+					<string>0</string>
+				</dict>
+				<key>Font</key>
+				<string>Helvetica-Bold</string>
+				<key>Size</key>
+				<real>10</real>
+			</dict>
+			<key>ID</key>
+			<integer>201</integer>
+			<key>Magnets</key>
+			<array>
+				<string>{1, 1}</string>
+				<string>{1, -1}</string>
+				<string>{-1, -1}</string>
+				<string>{-1, 1}</string>
+				<string>{0, 1}</string>
+				<string>{0, -1}</string>
+				<string>{1, 0}</string>
+				<string>{-1, 0}</string>
+				<string>{-0.5, -0.233518}</string>
+				<string>{-0.491442, 0.260063}</string>
+				<string>{0.507118, -0.224086}</string>
+				<string>{0.507118, 0.267179}</string>
+				<string>{-0.27431, -0.474028}</string>
+				<string>{0.27978, -0.478478}</string>
+				<string>{0.293938, 0.543044}</string>
+				<string>{-0.286232, 0.553804}</string>
+			</array>
+			<key>Shape</key>
+			<string>Rectangle</string>
+			<key>Style</key>
+			<dict>
+				<key>fill</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.274119</string>
+						<key>g</key>
+						<string>0.950739</string>
+						<key>r</key>
+						<string>0.787494</string>
+					</dict>
+					<key>FillType</key>
+					<integer>2</integer>
+					<key>GradientAngle</key>
+					<real>90</real>
+					<key>GradientColor</key>
+					<dict>
+						<key>b</key>
+						<string>0.223529</string>
+						<key>g</key>
+						<string>0.776471</string>
+						<key>r</key>
+						<string>0.643137</string>
+					</dict>
+				</dict>
+				<key>shadow</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.35</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>Fuzziness</key>
+					<real>2.3972222805023193</real>
+					<key>ShadowVector</key>
+					<string>{0, 1}</string>
+				</dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.165602</string>
+						<key>g</key>
+						<string>0.586124</string>
+						<key>r</key>
+						<string>0.428309</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>3</real>
+				</dict>
+			</dict>
+			<key>Text</key>
+			<dict>
+				<key>Text</key>
+				<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 Reflected Layer Classes }</string>
+				<key>VerticalPad</key>
+				<integer>0</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Bounds</key>
+			<string>{{43.375, 377}, {190, 50.1697}}</string>
+			<key>Class</key>
+			<string>ShapedGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Color</key>
+				<dict>
+					<key>b</key>
+					<string>0</string>
+					<key>g</key>
+					<string>0</string>
+					<key>r</key>
+					<string>0</string>
+				</dict>
+				<key>Font</key>
+				<string>DroidSans-Bold</string>
+				<key>Size</key>
+				<real>10</real>
+			</dict>
+			<key>ID</key>
+			<integer>157</integer>
+			<key>Magnets</key>
+			<array>
+				<string>{1, 1}</string>
+				<string>{1, -1}</string>
+				<string>{-1, -1}</string>
+				<string>{-1, 1}</string>
+				<string>{0, 1}</string>
+				<string>{0, -1}</string>
+				<string>{1, 0}</string>
+				<string>{-1, 0}</string>
+				<string>{-0.5, -0.233518}</string>
+				<string>{-0.491442, 0.260063}</string>
+				<string>{0.507118, -0.224086}</string>
+				<string>{0.507118, 0.267179}</string>
+				<string>{-0.27431, -0.474028}</string>
+				<string>{0.27978, -0.478478}</string>
+				<string>{0.293938, 0.543044}</string>
+				<string>{-0.286232, 0.553804}</string>
+			</array>
+			<key>Shape</key>
+			<string>Rectangle</string>
+			<key>Style</key>
+			<dict>
+				<key>fill</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>1</string>
+						<key>g</key>
+						<string>0.874135</string>
+						<key>r</key>
+						<string>0.71718</string>
+					</dict>
+					<key>FillType</key>
+					<integer>2</integer>
+					<key>GradientAngle</key>
+					<real>90</real>
+					<key>GradientColor</key>
+					<dict>
+						<key>b</key>
+						<string>1</string>
+						<key>g</key>
+						<string>0.662438</string>
+						<key>r</key>
+						<string>0.464468</string>
+					</dict>
+				</dict>
+				<key>shadow</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.35</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>Fuzziness</key>
+					<real>2.3972222805023193</real>
+					<key>ShadowVector</key>
+					<string>{0, 1}</string>
+				</dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.93512</string>
+						<key>g</key>
+						<string>0.472602</string>
+						<key>r</key>
+						<string>0.333854</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>3</real>
+				</dict>
+			</dict>
+			<key>Text</key>
+			<dict>
+				<key>Text</key>
+				<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 Renderscript Code}</string>
+				<key>VerticalPad</key>
+				<integer>0</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Bounds</key>
+			<string>{{18.625, 118}, {239.5, 191}}</string>
+			<key>Class</key>
+			<string>ShapedGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Color</key>
+				<dict>
+					<key>b</key>
+					<string>0</string>
+					<key>g</key>
+					<string>0</string>
+					<key>r</key>
+					<string>0</string>
+				</dict>
+				<key>Font</key>
+				<string>Helvetica-Bold</string>
+				<key>Size</key>
+				<real>10</real>
+			</dict>
+			<key>ID</key>
+			<integer>155</integer>
+			<key>Line</key>
+			<dict>
+				<key>ID</key>
+				<integer>196</integer>
+				<key>Position</key>
+				<real>0.21288931369781494</real>
+				<key>RotationType</key>
+				<integer>0</integer>
+			</dict>
+			<key>Magnets</key>
+			<array>
+				<string>{1, 1}</string>
+				<string>{1, -1}</string>
+				<string>{-1, -1}</string>
+				<string>{-1, 1}</string>
+				<string>{0, 1}</string>
+				<string>{0, -1}</string>
+				<string>{1, 0}</string>
+				<string>{-1, 0}</string>
+				<string>{-0.5, -0.233518}</string>
+				<string>{-0.491442, 0.260063}</string>
+				<string>{0.507118, -0.224086}</string>
+				<string>{0.507118, 0.267179}</string>
+				<string>{-0.27431, -0.474028}</string>
+				<string>{0.27978, -0.478478}</string>
+				<string>{0.293938, 0.543044}</string>
+				<string>{-0.286232, 0.553804}</string>
+			</array>
+			<key>Shape</key>
+			<string>Rectangle</string>
+			<key>Style</key>
+			<dict>
+				<key>fill</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.938075</string>
+						<key>g</key>
+						<string>0.938269</string>
+						<key>r</key>
+						<string>0.938154</string>
+					</dict>
+					<key>FillType</key>
+					<integer>2</integer>
+					<key>GradientAngle</key>
+					<real>90</real>
+					<key>GradientColor</key>
+					<dict>
+						<key>b</key>
+						<string>0.727869</string>
+						<key>g</key>
+						<string>0.728019</string>
+						<key>r</key>
+						<string>0.72793</string>
+					</dict>
+				</dict>
+				<key>shadow</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.35</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>Fuzziness</key>
+					<real>2.3972222805023193</real>
+					<key>ShadowVector</key>
+					<string>{0, 1}</string>
+				</dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.472997</string>
+						<key>g</key>
+						<string>0.473094</string>
+						<key>r</key>
+						<string>0.473036</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>3</real>
+				</dict>
+			</dict>
+			<key>Text</key>
+			<dict>
+				<key>Text</key>
+				<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 \
+\
+Android Framework\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+}</string>
+				<key>VerticalPad</key>
+				<integer>0</integer>
+			</dict>
+		</dict>
+		<dict>
+			<key>Bounds</key>
+			<string>{{18.625, 340}, {239.5, 191}}</string>
+			<key>Class</key>
+			<string>ShapedGraphic</string>
+			<key>FontInfo</key>
+			<dict>
+				<key>Color</key>
+				<dict>
+					<key>b</key>
+					<string>0</string>
+					<key>g</key>
+					<string>0</string>
+					<key>r</key>
+					<string>0</string>
+				</dict>
+				<key>Font</key>
+				<string>Helvetica-Bold</string>
+				<key>Size</key>
+				<real>10</real>
+			</dict>
+			<key>ID</key>
+			<integer>225</integer>
+			<key>Magnets</key>
+			<array>
+				<string>{1, 1}</string>
+				<string>{1, -1}</string>
+				<string>{-1, -1}</string>
+				<string>{-1, 1}</string>
+				<string>{0, 1}</string>
+				<string>{0, -1}</string>
+				<string>{1, 0}</string>
+				<string>{-1, 0}</string>
+				<string>{-0.5, -0.233518}</string>
+				<string>{-0.491442, 0.260063}</string>
+				<string>{0.507118, -0.224086}</string>
+				<string>{0.507118, 0.267179}</string>
+				<string>{-0.27431, -0.474028}</string>
+				<string>{0.27978, -0.478478}</string>
+				<string>{0.293938, 0.543044}</string>
+				<string>{-0.286232, 0.553804}</string>
+			</array>
+			<key>Shape</key>
+			<string>Rectangle</string>
+			<key>Style</key>
+			<dict>
+				<key>fill</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.938075</string>
+						<key>g</key>
+						<string>0.938269</string>
+						<key>r</key>
+						<string>0.938154</string>
+					</dict>
+					<key>FillType</key>
+					<integer>2</integer>
+					<key>GradientAngle</key>
+					<real>90</real>
+					<key>GradientColor</key>
+					<dict>
+						<key>b</key>
+						<string>0.727869</string>
+						<key>g</key>
+						<string>0.728019</string>
+						<key>r</key>
+						<string>0.72793</string>
+					</dict>
+				</dict>
+				<key>shadow</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>a</key>
+						<string>0.35</string>
+						<key>b</key>
+						<string>0</string>
+						<key>g</key>
+						<string>0</string>
+						<key>r</key>
+						<string>0</string>
+					</dict>
+					<key>Fuzziness</key>
+					<real>2.3972222805023193</real>
+					<key>ShadowVector</key>
+					<string>{0, 1}</string>
+				</dict>
+				<key>stroke</key>
+				<dict>
+					<key>Color</key>
+					<dict>
+						<key>b</key>
+						<string>0.472997</string>
+						<key>g</key>
+						<string>0.473094</string>
+						<key>r</key>
+						<string>0.473036</string>
+					</dict>
+					<key>CornerRadius</key>
+					<real>3</real>
+				</dict>
+			</dict>
+			<key>Text</key>
+			<dict>
+				<key>Text</key>
+				<string>{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
+
+\f0\b\fs24 \cf0 \
+\
+Renderscript Runtime\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+}</string>
+				<key>VerticalPad</key>
+				<integer>0</integer>
+			</dict>
+		</dict>
+	</array>
+	<key>GridInfo</key>
+	<dict/>
+	<key>GuidesLocked</key>
+	<string>NO</string>
+	<key>GuidesVisible</key>
+	<string>YES</string>
+	<key>HPages</key>
+	<integer>1</integer>
+	<key>ImageCounter</key>
+	<integer>1</integer>
+	<key>KeepToScale</key>
+	<false/>
+	<key>Layers</key>
+	<array>
+		<dict>
+			<key>Lock</key>
+			<string>NO</string>
+			<key>Name</key>
+			<string>Layer 1</string>
+			<key>Print</key>
+			<string>YES</string>
+			<key>View</key>
+			<string>YES</string>
+		</dict>
+	</array>
+	<key>LayoutInfo</key>
+	<dict>
+		<key>Animate</key>
+		<string>NO</string>
+		<key>circoMinDist</key>
+		<real>18</real>
+		<key>circoSeparation</key>
+		<real>0.0</real>
+		<key>layoutEngine</key>
+		<string>dot</string>
+		<key>neatoSeparation</key>
+		<real>0.0</real>
+		<key>twopiSeparation</key>
+		<real>0.0</real>
+	</dict>
+	<key>LinksVisible</key>
+	<string>NO</string>
+	<key>MagnetsVisible</key>
+	<string>NO</string>
+	<key>MasterSheets</key>
+	<array/>
+	<key>ModificationDate</key>
+	<string>2011-11-29 09:13:03 -0800</string>
+	<key>Modifier</key>
+	<string>Robert Ly</string>
+	<key>NotesVisible</key>
+	<string>NO</string>
+	<key>Orientation</key>
+	<integer>2</integer>
+	<key>OriginVisible</key>
+	<string>NO</string>
+	<key>PageBreaks</key>
+	<string>YES</string>
+	<key>PrintInfo</key>
+	<dict>
+		<key>NSBottomMargin</key>
+		<array>
+			<string>float</string>
+			<string>41</string>
+		</array>
+		<key>NSLeftMargin</key>
+		<array>
+			<string>float</string>
+			<string>18</string>
+		</array>
+		<key>NSPaperSize</key>
+		<array>
+			<string>coded</string>
+			<string>BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU1ZhbHVlAISECE5TT2JqZWN0AIWEASqEhAx7X05TU2l6ZT1mZn2WgWQCgRgDhg==</string>
+		</array>
+		<key>NSRightMargin</key>
+		<array>
+			<string>float</string>
+			<string>18</string>
+		</array>
+		<key>NSTopMargin</key>
+		<array>
+			<string>float</string>
+			<string>18</string>
+		</array>
+	</dict>
+	<key>PrintOnePage</key>
+	<false/>
+	<key>QuickLookPreview</key>
+	<data>
+	JVBERi0xLjMKJcTl8uXrp/Og0MTGCjUgMCBvYmoKPDwgL0xlbmd0aCA2IDAgUiAvRmls
+	dGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAHFWsuOHbcR3fMruBwt1Go+u3spK7YR
+	IwFizwBeBFkII8ljZ8ayZ2QE/tr8Sk6xHuTte++MJAiIBEHNumTxUYf15O/+e/+7n/G3
+	LNUvKfn7t/5H/6t/8eoh+OsHH9rfh2v/fJ6Kp39Dx3f+xT/e3l+//e3DH69v3f3PYBVL
+	aOxiwsg0xbgsqw/rPK3bEv31nX/x17vg//K+zXuyc54jdQ5u33lmzjX4tEzbQozjtk2p
+	M47G+ETfnNMU1i0K30f7lrA+yjfE5FMNtIrVp5zR2RinxxYRY6Qz0ZOQRZAMYphqLD5t
+	yd+5WMoUpHWLM63Tsoat/RjLKj9hQKkbflXC7K+tFefiaWT7zcU5TSlDJMYqzhENnoW+
+	MZIXQI1bH7Zpq2sonpo4DFqaMnHWLhg2NE5/Spe80fpn4k3suMlbcDJb5g3SOvjnBP43
+	urB2Mg2bYECHE+cAOMZMoAxbbMh1QG6HpG+QZNg8JzxCqguGbAuGELwub4J/uAEWj2+B
+	o1sQ/Hf49wvfhleXwH9e0pyqfGy5fQCFi798BSHaVHO7S5iCT9WlPHs0VKxojWJF06SY
+	g0pKxJrpFPTnEldnYvUlbooBQUhpMmax0reJlRqDWKnJ4nLGRMSHKbpYqTHQh89RrFhi
+	Fyv2KlvoYqUNmljRGMWK5p2/hASgcoDDB6gPqJvhLA/ERrf3qysfYtMyz/H/8xqnCm2Q
+	/HP8u4JUvwnTDFFcvfP/9Bc/PCPVFf3FW/349RmkBsKbZ+7wh3vt8aAf1/phP/0sg3+T
+	/z/49uH6PH/ILzrNBx1yp8ywkn/5q+/811eCPLl6NeRpwx/XkaKkES5GU1BUKFqogsVQ
+	UgNUE/74a2gShlGOlUkdPTkWghpGCXhyTNxHcWoEhZEzyoAlowk6lK81ZWbTFboWVSTa
+	VqRZe8CYbakDzdu+FWiuH42izSgD5Ix2N6oT2gbUDhSqahSntvBJjVKwgjaWlUo8qVSU
+	3RdTKgEnPM8wdR0vRhrUi9EUCwGrheBJ8gyOAAASI9cVTZor8+54SfMCmBHK1BzNG/dR
+	vCQlAHckAJgzpQx4MZoARPlaU2ZWvDhby77Hvj3gRbc0KCav++72ph+N4sUoA16Mdqyn
+	3Ak9NYIBqmqmM4r+CosblBbOsC55PdBZrumsi5e/vrl///Mb/83967u3/3l//+9n/uqX
+	rixybUYslUpyT7O1IKkUpzmRo1Cqiwk2H9YulSxGwgjNomhrXqcVNo00jJGWKSwJhlL4
+	QQKFO9l8Srj2uh6l3Hr4Q0sg58GGwfVqSwGCiLGztswNLtpDKE+1dYRLhZau3XWvfQk4
+	Jl0hPkmqQ5MVQIbDSQeFHSQ6ibAFX8IUKnmhH60DMHTaQmHX7vImfaIOSCmtRfyJCryA
+	WSpAzBm/gjfh0rKMKEBrRAGaJtMFvk/zAFXIa3MXpZVjbvsl58JIkHmsHQU+R4gPh4Iu
+	jDojGAqMcutMBEYTIZF9aIytzXNDOHsKt2F1pMf+dxuRsJuOAt2rLYGOaTixEQXtAD/G
+	/Rjlu/NACuxv80Cy+yT/g/0Qc0zMyRD/w118tP/hL16pd/Fe/I838j95G270NgT/sFfT
+	Are5KxGlDBBSkoFiW6ec1820S95gDMAFlkNxU+CPRQRIA5QK0FzLCKUMz5U6CZSAFiF0
+	KCllUCjWS4GgjK3Nc8OQ7ShPtvsI2ZHCyWXZc9dreiq7kxxgpT0OFAytPtCmP0/B5AV6
+	dZbY8fImf6KCyRFqfgPkylpDJE0T4DRC0zyuYUiscV4HmChlgImSFAMx5amUgHhTQBFT
+	JS7kYCgFOQFcS1ZYrPzjSuYrDzDBkrmTahwjXDs5fKMMMDGagMAYW1vmVqG7qKvZ99i3
+	dQT20XbUtY7uuSs+PRVdqZzkABPtcexYnAqAFAASA512LCp8MmjDzeddLHTxw9v/dk/i
+	hN+yYz96K7QDpANgSndMEWCZ+jJl9cFIGmJxkOQv/iY66bUqqz/1w4aYEtQxpthuJV6z
+	wRam2YdxMQq4HMZaLAxXYPC75qPWAGdqKk7L0oIrhAUC3EI3sLdgE8l9GgxnQah14D4h
+	Ts+H7pMRACd254wyGE6jCQiNsbV57m44i6xGtB1ie+lxfgR2o5oOqT3ZqxlOOonhxAbo
+	8gFSkkTcJ1rtzn2qq6UTD0Kok14zlOPgPpWT2k3ZjSGUa3mZz3KffCijYkOriVGcaPpR
+	hR5KC5m6QgtIQ3YUINvGnlG3eREBFHk5sJTCD/rv0H0ygqHAKKMy02EsQ+TymLFaNJu7
+	qyZdjUjdeuza3UrSbgwFtldDAZ2E4JQ+BxRQE8rLPZ29KYN8z0ZFwN+ylATltXOkLCh6
+	VIPt5hg1GN3Aba7xiDM02EtVQprU0f9vRV1pBsc0nKggd2HJHfW6NOtzpL20w+iWWRJo
+	dpSChyF+8e1D8D89jNrfUomWB1NA3PWMZoQxIM8cYTYnOV1EBJ5gt43i4XkIRdzdluCn
+	iVvGDVNHmlqnKUivVvIPXaCEHhRBQTBPFGKJUOmAcnM8zr8D4+/w75ej7ZAF03lQKWjL
+	AkXm6QvVeTqlzyPjkCyj7ahGGOza0cFR4qFwvkQnTzilTCQ7Jpcirmlve/L7qd1mkQxy
+	2pCpA/B1xVSz2IZzaW3okr5aHXH+TCghbcvCPJTWEf5O16Dnoe2Bv4ygVVIyOy0SotWE
+	/AN5+QWxMWQGv4kpt6Ag00LpAiWVsjSxZpQ2alk39FACORtk95RCWQVQsMdOiYgwEf8a
+	W8SvbZTMjEwEt69tdUq5RTVlbUkDxPPcKVWeOiGcaGw7oc2Mtewpu7bbtYcRufJ+aF7d
+	oWxZF2KHIidp50ba7/h0yRCmCs2MW5EQlRScFrn5IfSSWreBXCuzakFGCpuuU0Z+pB1z
+	K03UjzGBrhXqmglcYtmQUYLcK4RKNYqQwhxDUyyn7oXuIsJn3LYVN0klJRQg2oSpJBV3
+	XCjLDxe/E3AHNrIOQkFyYm2UASNws2vBIo1tWilVTYSGTq/tASPcA0gz0WgnFR78XWZr
+	BJl5wIhQpIet7fwIVOlk9drHtmwL0ZPbnSTOoGNED+5xH38HgRNlDmjvea5rPuWD/90c
+	XysyqL25f+a4/gFXu3vCrPWfMDiWHiZRz3OmwiQgTnndoCR4DUgiE3hHEq5XWTPQr910
+	e/CLp3nDnRCCCwssCfEmH4hvQYT2QcwN8HUKpeaJQurtMaNCFzuWhBRVJTyhJnIHLuAH
+	ImgUyqJATfouxUy9jJIxQ6U+PI58o1qmWhd4/vgAaOE7dMqCNEhLKtk4VDUDirc0zrhT
+	hmXeoDpsBUxBH1tnHwcfc14jfEzoJObeKbwCcLJxsr9rrZ0dlusTef7biusJpy9sUAe1
+	4nKRA42qPSptTittsPtp53JQaTu1wfioNPi46kYJfhzO4p8n9tXg5VrRbcAjcMj4u//z
+	IBYbFNLRdKfQD1MVCvw3aJyWYxunewlHjSexD5kWKTQLFz90b44729LgtPWrcc6ToEXp
+	jSDcUIIbFLkQSoGWgt9E92GkJL4OQmrpdO4ChM0F+XpKPbcxkBr4Qm8JJaUM2FtrRRhC
+	t8VILm2ogs8bpa9lFhTKuZOuxAgIWGS5RkLAAsTLy4M2DIr2sVtGUKB9LIA56vVIk+OG
+	EAkeEX2mDbe4zNUoWGHGnYSPNQwruJFhwT4jLn1ZcBUT0m5lS3iVAIhXBAEDBdegzGkB
+	pz6OtA68N/RS7p2iK5Bx6MPLpOmYOViRB9CO3BZglN3uzlwxXJyMi+PwxIXN/rqS2YcD
+	hIcMw02zmvapmyZiFsvfHqfsksvDRTtG/umLxnB2rb483rPdZKduNc7g+Jo5LqV/hTiI
+	bw4uDH8gmuGP459+OnmpUOMi24PXGOae50A6DREo4QMmjuA00MgdBA3WwPoFvN+gcuUB
+	rUwR/lZGcAQ1DRihKN6c/Yx4mdkrBTCAdzzTExIhgVOEAzqSxNjoO6ijMImQRP2t2kd3
+	oLFwJVSuBneuBe9+kBOmbeBBy/HQ82FBUzsyQJfb7psuF9eGA5i+A3I/W0zT59KhEi7Z
+	WZJp2ja8BqEzhzEkOeTmD7YHI4TLPQ0VNJFEM2wy+t1RkEfw0p44cZHjMI/JG3KUeeBg
+	CAbooE6NbmEYDA0e7lxTuExXELoPKTe8B0KIiqdhdM4LXpxkKt6xtXv0DiLsrG3wUMU/
+	m6LAk5tthubRRILZIeRXX7958ePJBAU9iTk1xZChoMMnZS+ZD2OL/MS9XS41YXD3njZY
+	OH/XZLogpU4qEP6AiplJMGLsZ9HkREKBEC+j6FoZAboQDhsocGHWVFG6hSsCeW06gpr9
+	RvHPHfjaJrHt75KD+FrKQS8EP8yyi4SHWigjYDmKbJi+1h5g3Z5y3bnz94ftFd9VXkzn
+	nxE0j/wzUnUFuqDz1xG0fDuURHWcFlM3gLazhICJREcHdTOQGrsTQ8/dFzn4hMqHygvq
+	keXVRNi0ns4hUuXLcjT0zF1BuRvJfB9XvPj8hGtCuY82Tp/PfeE7cor/F7kglA+R9GVE
+	GLjihSUSuy0/AuPdCMCYpWmZoplfsu4Z52Wp4IiIBSwAea1k4dLUelACIO4zSlkDV2SV
+	qBMonJiJSqCAgZ0/pQwlAOulqVtlbG2eG8vZU7iN9LP02P/eR/CGAF34jeQR6Y4t/8uH
+	BG0vv7cjG7LAdqpDOYBWHmjDvdgJK86vKdxHvNFETR2gR1DTciHLuVzIuWeaKAF+RrEz
+	IwsBt9TggeC2EQZ4CEWFn/GkswRyWwUNGSmzsAyFTsqjJjxSJj2mJSRKF24IyAx0ZUY4
+	R50UHkawQqdRICh9YGM0ER3cT2ZsbZlbhe1sNfse+7aOwBHQhkizMTx0x73OKUci8JDW
+	AA+hPJ4A0dQnAvUm+BMxIHCJdBY9mvo/vvP8VqJIq1NafKlVg5seZ0Jz+/6IYyxK4hd3
+	YUO1aqDFgXOR8v6Q6HbswoWMR3pQNBQo72oo8CSslqrZIUsX6eL19Wqv4XIlw118rYuE
+	Y9/2pVURpR84JU8mmEi+uh17ITSQEpIhBxUNoB5v54cSBwgI/UBwp5wL8g0P6hlU4scD
+	YUuqw/4h5dxeLks1gwnNYOvKbNDjDoZ2R/qbVmRz4I7wErFVjvCN0FP3NojNNb84H8K2
+	FijRcWkeMuEBFeVMicLGRClIC+DcSImPFE6rGaUd1/f/A1RDIwEKZW5kc3RyZWFtCmVu
+	ZG9iago2IDAgb2JqCjM4ODcKZW5kb2JqCjMgMCBvYmoKPDwgL1R5cGUgL1BhZ2UgL1Bh
+	cmVudCA0IDAgUiAvUmVzb3VyY2VzIDcgMCBSIC9Db250ZW50cyA1IDAgUiAvTWVkaWFC
+	b3ggWzAgMCA1NzYgNzMzXQo+PgplbmRvYmoKNyAwIG9iago8PCAvUHJvY1NldCBbIC9Q
+	REYgL1RleHQgL0ltYWdlQiAvSW1hZ2VDIC9JbWFnZUkgXSAvQ29sb3JTcGFjZSA8PCAv
+	Q3MxIDggMCBSCi9DczIgMTYgMCBSID4+IC9FeHRHU3RhdGUgPDwgL0dzMSAyNSAwIFIg
+	L0dzMiAyNiAwIFIgL0dzMyAyNyAwIFIgL0dzNCAyOCAwIFIKPj4gL0ZvbnQgPDwgL0Yy
+	LjAgMjMgMCBSIC9GMS4wIDE3IDAgUiA+PiAvWE9iamVjdCA8PCAvSW0zIDEzIDAgUiAv
+	SW0xIDkgMCBSCi9JbTIgMTEgMCBSID4+IC9TaGFkaW5nIDw8IC9TaDEgMTUgMCBSIC9T
+	aDMgMTkgMCBSIC9TaDcgMjQgMCBSIC9TaDIgMTggMCBSCi9TaDUgMjEgMCBSIC9TaDYg
+	MjIgMCBSIC9TaDQgMjAgMCBSID4+ID4+CmVuZG9iagoxNSAwIG9iago8PCAvQ29sb3JT
+	cGFjZSA4IDAgUiAvU2hhZGluZ1R5cGUgMiAvQ29vcmRzIFsgMTIwLjI1IC05NiAxMjAu
+	MjUgOTYuMDAwMDUgXQovRG9tYWluIFsgMCAxIF0gL0V4dGVuZCBbIGZhbHNlIGZhbHNl
+	IF0gL0Z1bmN0aW9uIDI5IDAgUiA+PgplbmRvYmoKMTkgMCBvYmoKPDwgL0NvbG9yU3Bh
+	Y2UgOCAwIFIgL1NoYWRpbmdUeXBlIDIgL0Nvb3JkcyBbIDk1LjUgLTI1LjU4NDg1IDk1
+	LjQ5OTk4IDI1LjU4NDg5Cl0gL0RvbWFpbiBbIDAgMSBdIC9FeHRlbmQgWyBmYWxzZSBm
+	YWxzZSBdIC9GdW5jdGlvbiAzMCAwIFIgPj4KZW5kb2JqCjI0IDAgb2JqCjw8IC9Db2xv
+	clNwYWNlIDggMCBSIC9TaGFkaW5nVHlwZSAyIC9Db29yZHMgWyA5NS41IC0yNS41ODQ4
+	NSA5NS40OTk5OCAyNS41ODQ4OQpdIC9Eb21haW4gWyAwIDEgXSAvRXh0ZW5kIFsgZmFs
+	c2UgZmFsc2UgXSAvRnVuY3Rpb24gMzEgMCBSID4+CmVuZG9iagoxOCAwIG9iago8PCAv
+	Q29sb3JTcGFjZSA4IDAgUiAvU2hhZGluZ1R5cGUgMiAvQ29vcmRzIFsgMTIwLjI1IC05
+	NiAxMjAuMjUgOTYuMDAwMDUgXQovRG9tYWluIFsgMCAxIF0gL0V4dGVuZCBbIGZhbHNl
+	IGZhbHNlIF0gL0Z1bmN0aW9uIDMyIDAgUiA+PgplbmRvYmoKMjEgMCBvYmoKPDwgL0Nv
+	bG9yU3BhY2UgOCAwIFIgL1NoYWRpbmdUeXBlIDIgL0Nvb3JkcyBbIDk1LjUgLTI1LjU4
+	NDg1IDk1LjQ5OTk4IDI1LjU4NDg5Cl0gL0RvbWFpbiBbIDAgMSBdIC9FeHRlbmQgWyBm
+	YWxzZSBmYWxzZSBdIC9GdW5jdGlvbiAzMyAwIFIgPj4KZW5kb2JqCjIyIDAgb2JqCjw8
+	IC9Db2xvclNwYWNlIDggMCBSIC9TaGFkaW5nVHlwZSAyIC9Db29yZHMgWyA5NS41IC01
+	Ni41IDk1LjQ5OTk4IDU2LjUwMDA0Cl0gL0RvbWFpbiBbIDAgMSBdIC9FeHRlbmQgWyBm
+	YWxzZSBmYWxzZSBdIC9GdW5jdGlvbiAzNCAwIFIgPj4KZW5kb2JqCjIwIDAgb2JqCjw8
+	IC9Db2xvclNwYWNlIDggMCBSIC9TaGFkaW5nVHlwZSAyIC9Db29yZHMgWyA5NS41IC0y
+	NS41ODQ4NSA5NS40OTk5OCAyNS41ODQ4OQpdIC9Eb21haW4gWyAwIDEgXSAvRXh0ZW5k
+	IFsgZmFsc2UgZmFsc2UgXSAvRnVuY3Rpb24gMzUgMCBSID4+CmVuZG9iagoxMyAwIG9i
+	ago8PCAvTGVuZ3RoIDE0IDAgUiAvVHlwZSAvWE9iamVjdCAvU3VidHlwZSAvSW1hZ2Ug
+	L1dpZHRoIDQwMiAvSGVpZ2h0IDI0NiAvSW50ZXJwb2xhdGUKdHJ1ZSAvQ29sb3JTcGFj
+	ZSAzNiAwIFIgL0ludGVudCAvUGVyY2VwdHVhbCAvU01hc2sgMzcgMCBSIC9CaXRzUGVy
+	Q29tcG9uZW50CjggL0ZpbHRlciAvRmxhdGVEZWNvZGUgPj4Kc3RyZWFtCngB7dCBAAAA
+	AMOg+VMf5IVQYcCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMvAwOHIAABCmVuZHN0cmVhbQplbmRvYmoK
+	MTQgMCBvYmoKMTMxNgplbmRvYmoKOSAwIG9iago8PCAvTGVuZ3RoIDEwIDAgUiAvVHlw
+	ZSAvWE9iamVjdCAvU3VidHlwZSAvSW1hZ2UgL1dpZHRoIDUwMiAvSGVpZ2h0IDQ2MiAv
+	SW50ZXJwb2xhdGUKdHJ1ZSAvQ29sb3JTcGFjZSAzNiAwIFIgL0ludGVudCAvUGVyY2Vw
+	dHVhbCAvU01hc2sgMzkgMCBSIC9CaXRzUGVyQ29tcG9uZW50CjggL0ZpbHRlciAvRmxh
+	dGVEZWNvZGUgPj4Kc3RyZWFtCngB7dABDQAAAMKg909tDwcRKAwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
+	gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
+	MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
+	BgwYMGDAgAEDPwMDnnIAAQplbmRzdHJlYW0KZW5kb2JqCjEwIDAgb2JqCjMwNTcKZW5k
+	b2JqCjExIDAgb2JqCjw8IC9MZW5ndGggMTIgMCBSIC9UeXBlIC9YT2JqZWN0IC9TdWJ0
+	eXBlIC9JbWFnZSAvV2lkdGggNDAyIC9IZWlnaHQgMTIyIC9JbnRlcnBvbGF0ZQp0cnVl
+	IC9Db2xvclNwYWNlIDM2IDAgUiAvSW50ZW50IC9QZXJjZXB0dWFsIC9TTWFzayA0MSAw
+	IFIgL0JpdHNQZXJDb21wb25lbnQKOCAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJl
+	YW0KeAHt0DEBAAAAwqD1T20JT4hAYcCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCA
+	AQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgw
+	YMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMG
+	DBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYOAz
+	MD7aAAEKZW5kc3RyZWFtCmVuZG9iagoxMiAwIG9iago2NjUKZW5kb2JqCjQxIDAgb2Jq
+	Cjw8IC9MZW5ndGggNDIgMCBSIC9UeXBlIC9YT2JqZWN0IC9TdWJ0eXBlIC9JbWFnZSAv
+	V2lkdGggNDAyIC9IZWlnaHQgMTIyIC9Db2xvclNwYWNlCi9EZXZpY2VHcmF5IC9JbnRl
+	cnBvbGF0ZSB0cnVlIC9CaXRzUGVyQ29tcG9uZW50IDggL0ZpbHRlciAvRmxhdGVEZWNv
+	ZGUgPj4Kc3RyZWFtCngB7ZdrU9pqFIVJQi7cBVSEgnpKKVYhnUPrHRipIJeDApUA/f9/
+	pKEzbcHL9ot915zp2p9g1pCVeR72SwgEOCRAAiRAAiRAAiRAAmoIaLpucJQS0HVNe06u
+	phumZTshjkoCjm0GjaedaIbpRGKJZIqjkEByIx4N20H9CSe6YUUS6UwuX9jlqCNQeJPd
+	TsVC5uM10Qw7ms7tlw4rrvuRo4qAWz06KBYyG2Hz4ZZohhXdLLx3j8/rjSZHHYHG5Wnt
+	qJhL+krWf991M5IuHNQuW51ur89RR6B3026euu+yCefBuWU4iez7WqPz391oPOGoIzAe
+	3fa/nFf/2YquL4kWjKT33cvOcDL1vBlHHQHPux8NWicHOX9JVo8t3YplSsetwcSbzxeL
+	xTeOGgI+6/lsOurW3b10OLj6BKzbidzheeduuvRBI2p0/GhZKvk6uPpU9I+tVSOGk8xX
+	6t2Rxw1RaOOnkvvh9UkpE1s3EkoW3EZv7HFBVBv5tpjf37ZPyzsxa21HQqldt9mf+EaU
+	39FfXzif3nXOytn4IyMfaQTz5VgaOT94xsgMc09/d+svI6v/2g3/1FruCI0Avhw0AoAu
+	VtKIiAcQ0ggAulhJIyIeQEgjAOhiJY2IeAAhjQCgi5U0IuIBhDQCgC5W0oiIBxDSCAC6
+	WEkjIh5ASCMA6GIljYh4ACGNAKCLlTQi4gGENAKALlbSiIgHENIIALpYSSMiHkBIIwDo
+	YiWNiHgAIY0AoIuVNCLiAYQ0AoAuVtKIiAcQ0ggAulhJIyIeQEgjAOhiJY2IeAAhjQCg
+	i5U0IuIBhDQCgC5W0oiIBxDSCAC6WEkjIh5ASCMA6GIljYh4ACGNAKCLlTQi4gGENAKA
+	LlbSiIgHENIIALpYSSMiHkBIIwDoYiWNiHgAIY0AoIuVNCLiAYQ0AoAuVtKIiAcQ0ggA
+	ulhJIyIeQEgjAOhiJY2IeAAhjQCgi5U0IuIBhDQCgC5W0oiIBxDSCAC6WEkjIh5ASCMA
+	6GIljYh4ACGNAKCLlTQi4gGENAKALlbSiIgHENIIALpYSSMiHkBIIwDoYiWNiHgAIY0A
+	oIuVNCLiAYQ0AoAuVtKIiAcQ0ggAulhJIyIeQEgjAOhiJY2IeAAhjQCgi5WiEW8hfpbh
+	nyDwy4gW+D1GKLXrNvsTGvkTyF+45tLIWTkbt9aNJAtuozf2FgtuyQsAXztezO9v26fl
+	ndi6ESeZr9S7I29OJa9N/IXrLXwjw+uTUiZmru6IbidyH847t1MaeQHga8e+kNnXwdWn
+	4lZk3YgVy5Q+twYTb04nrw1duJ5/Is1n07uburuXCgdXd0QLhtN77kV7OJl6/sw4agj4
+	rKf3o37r+CCXcIzfT1r+K8NOZEu1entwOxqPJxxFBMbj0d2w1zqr7m9GTH3NiG6GU4Vy
+	7eKqfdPt9TmKCPR63Zvr5olb3PFXZPXQCgQ0w4pu5kvVz2eXjUaTo4pAo35x+u/h2+xG
+	6MGKLJXY0VR2792Ho0rV5agiUK0clt/mtxNhU19fEf8E87ckHE9vZ9/kCxx1BPK5na1k
+	zN+QR0KWSkw7HItvJP1JcRQQWJJOJuLRkBV8SoivRDeClu04IY46Ao5tmc/4+PHopWm6
+	bnAUEtB1XXviwFp7EOYbEiABEiABEiCB/y+B75ER7IQKZW5kc3RyZWFtCmVuZG9iago0
+	MiAwIG9iagoxMjQzCmVuZG9iagozOSAwIG9iago8PCAvTGVuZ3RoIDQwIDAgUiAvVHlw
+	ZSAvWE9iamVjdCAvU3VidHlwZSAvSW1hZ2UgL1dpZHRoIDUwMiAvSGVpZ2h0IDQ2MiAv
+	Q29sb3JTcGFjZQovRGV2aWNlR3JheSAvSW50ZXJwb2xhdGUgdHJ1ZSAvQml0c1BlckNv
+	bXBvbmVudCA4IC9GaWx0ZXIgL0ZsYXRlRGVjb2RlID4+CnN0cmVhbQp4Ae3YW1fV9R5G
+	cVmLxUlAkRS1TSdDGR5opFvJPLQ1yEMiKiD0/t/Ihho1wnK696Wz+bvp4ltj9MyPf7RO
+	nOhVoAIVqEAFKlCBClSgAhWoQAUqUIEKVKACFahABSpQgQpUoAIVqEAFKlCBClSgAhWo
+	QAUqUIEKVKACFahABSpQgQpUoAIVqEAFKlCBClSgAhWoQAUqUIEKVKACFfjfCowNBsOe
+	rcBgMDb2Xv+xwXA0MTk13ZMVmJocjQ/f4z42HE2dnDu1cKbnKrBwen52ZnJ88Hfug+HE
+	yVOLSxf/tfxZT1Vg+dML587MTY/+5nMfG07OLl78YuXq9bW1b3qiAms3rq1eWl46PTP6
+	y9c+NpyY/WT58trtu/cfPOypCjy4t37z2qWLC4fs7/yZbjA6ubi8evPeo80nT5/1VAWe
+	/rTxcH3t6wunpt79GT+cOnXh8s0Hmz+/3H71uqcq8Gp769njuze+PDv7zsc+Nn5y8Yu1
+	e5svXu/u7b3tqQrs7e1sP390Z/Xi4cd+7Ef8YGJuaeX2o+ev9/b3Dw4OfulpChxy7r/d
+	3X5yf+3zxZnxY//1Npg8dfHq3c2Xu0fmqWvIfx1yxP7m+X9uXTr8EX9MfTi18K/r959s
+	7/Wlu8R/Z9958eOdlaW5d9SnF5bXHjx9tdeHLlT/5WB/Z2tj/cr5uYnj3/r0mc/WHj57
+	fahuXP2P37S/+3LzuysX5v+q/k3q2l8dR+p3V9+n/la7+5897A/1Y/93bnj4E/7oW0/d
+	+asjdacrr0qd+zivqTtdeVXq3Md5Td3pyqtS5z7Oa+pOV16VOvdxXlN3uvKq1LmP85q6
+	05VXpc59nNfUna68KnXu47ym7nTlValzH+c1dacrr0qd+zivqTtdeVXq3Md5Td3pyqtS
+	5z7Oa+pOV16VOvdxXlN3uvKq1LmP85q605VXpc59nNfUna68KnXu47ym7nTlValzH+c1
+	dacrr0qd+zivqTtdeVXq3Md5Td3pyqtS5z7Oa+pOV16VOvdxXlN3uvKq1LmP85q605VX
+	pc59nNfUna68KnXu47ym7nTlValzH+c1dacrr0qd+zivqTtdeVXq3Md5Td3pyqtS5z7O
+	a+pOV16VOvdxXlN3uvKq1LmP85q605VXpc59nNfUna68KnXu47ym7nTlValzH+c1dacr
+	r0qd+zivqTtdeVXq3Md5Td3pyqtS5z7Oa+pOV16VOvdxXlN3uvKq1LmP85q605VXpc59
+	nNfUna68KnXu47ym7nTlValzH+c1dacrr0qd+zivqTtdeVXq3Md5Td3pyqtS5z7Oa+pO
+	V16VOvdxXlN3uvKq1LmP85q605VXpc59nNfUna68KnXu47ym7nTlValzH+c1dacrr0qd
+	+zivqTtdeVXq3Md5Td3pyqtS5z7Oa+pOV16VOvdxXlN3uvKq1LmP85q605VXpc59nNfU
+	na68KnXu47ym7nTlValzH+c1dacrr0qd+zivqTtdeVXq3Md5Td3pyqtS5z7Oa+pOV16V
+	OvdxXlN3uvKq1LmP85q605VXpc59nNfUna68KnXu47ym7nTlValzH+c1dacrr0qd+ziv
+	qTtdeVXq3Md5Td3pyqtS5z7Oa+pOV16VOvdxXlN3uvKq1LmP85q605VXpc59nNfUna68
+	KnXu47ym7nTlValzH+c1dacrr0qd+zivqTtdeVXq3Md5Td3pyqtS5z7Oa+pOV16VOvdx
+	XlN3uvKq1LmP85q605VXpc59nNfUna68KnXu47ym7nTlValzH+c1dacrr0qd+zivqTtd
+	eVXq3Md5Td3pyqtS5z7Oa+pOV16VOvdxXlN3uvKq1LmP85q605VXpc59nNfUna68KnXu
+	47ym7nTlValzH+c1dacrr0qd+zivqTtdeVXq3Md5Td3pyqtS5z7Oa+pOV16VOvdxXlN3
+	uvKq1LmP85q605VXpc59nNfUna68KnXu47ym7nTlValzH+c1dacrr0qd+zivqTtdeVXq
+	3Md5Td3pyqtS5z7Oa+pOV16VOvdxXlN3uvKq1LmP85q605VXpc59nNfUna68KnXu47ym
+	7nTlValzH+c1dacrr0qd+zivqTtdeVXq3Md5Td3pyqtS5z7Oa+pOV16VOvdxXlN3uvKq
+	1LmP85q605VXpc59nNfUna68KnXu47ym7nTlValzH+c1dacrr0qd+zivqTtdeVXq3Md5
+	Td3pyqtS5z7Oa+pOV16VOvdxXlN3uvKq1LmP85q605VXpc59nNfUna68KnXu47ym7nTl
+	ValzH+c1dacrr0qd+zivqTtdeVXq3Md5Td3pyqtS5z7Oa+pOV16VOvdxXlN3uvKq1LmP
+	85q605VXpc59nNfUna68KnXu47ym7nTlValzH+c1dacrr0qd+zivqTtdeVXq3Md5Td3p
+	yqtS5z7Oa+pOV16VOvdxXlN3uvKq1LmP85q605VXpc59nNfUna68KnXu47ym7nTlValz
+	H+c1dacrr0qd+zivqTtdeVXq3Md5Td3pyqtS5z7Oa+pOV16VOvdxXlN3uvKq1LmP85q6
+	05VXpc59nNfUna68KnXu47ym7nTlValzH+c1dacrr0qd+zivqTtdeVXq3Md5Td3pyqtS
+	5z7Oa+pOV16VOvdxXlN3uvKq1LmP85q605VXpc59nNfUna68KnXu47ym7nTlValzH+c1
+	dacrr0qd+zivqTtdeVXq3Md5Td3pyqtS5z7Oa+pOV16VOvdxXlN3uvKq1LmP85q605VX
+	pc59nNfUna68KnXu47ym7nTlValzH+c1dacrr0qd+zivqTtdeVXq3Md5Td3pyqtS5z7O
+	a+pOV16VOvdxXlN3uvKq1LmP85q605VXpc59nNfUna68KnXu47ym7nTlValzH+c1dacr
+	r0qd+zivqTtdeVXq3Md5Td3pyqtS5z7Oa+pOV16VOvdxXlN3uvKq1LmP85q605VXpc59
+	nNfUna68KnXu47ym7nTlValzH+c1dacrr0qd+zivqTtdeVXq3Md5Td3pyqtS5z7Oa+pO
+	V16VOvdxXlN3uvKqP9THTvzpDafPfPbNw2ev9w74n+76cRZ4v/pa6h8n6Qf/rQ8O9ne3
+	Nr67cn5+4p1vfWH5xoOnr/YO+tg/GPGj+xsO1Xe2NtYvL80dVx9Mnf702r2ftnf3Y//o
+	UD/wL3xw+N6+efH49sq52dGxb30wOX9hdX1ja+dt7B+I+NGdD9H3914/++Hbrz45OX5M
+	fWw0e+7SzR+ebe++3e/ZCrzde7O1+f315YXp4Z/+BH/ixNj4zJnla+uPn2+/2dntuQrs
+	7Lze+unBrZXz85ODY+onBhNzS5fW7j568vOLrZc9U4GtrRfPNh/+++ry4szx39aPPvbp
+	0xe/vnHn/qMfNzZ7pgIbG49/+P7W1c/Pzk0Oj/22fvjdD0YzCxe+XF27dWf9bs9U4Lv1
+	299eX1k+Oz91/M9yRz/sx4ajmVNnP/380sqV1Z6pwJXLK18tnz8zNzX+zu/qv7IPRlOz
+	pxbPLp2/0DMVOL907pMz8zOT44N3f77/xj4+MTUzOzffcxWYmz05PTn6y+/pR+ZHb2ww
+	HB9N9GwFRqPD7/zvPvTf2A/hD9+gpypwZPq7b3+tQAUqUIEKVKACFahABSpQgQpUoAIV
+	qEAFKlCBClSgAhWoQAUqUIEKVKACFahABSpQgQpUoAIVqEAFKlCBClSgAhWoQAUqUIEK
+	VKACFahABSpQgQpUoAIVqMD/WeC/aJaU4QplbmRzdHJlYW0KZW5kb2JqCjQwIDAgb2Jq
+	CjI3ODkKZW5kb2JqCjM3IDAgb2JqCjw8IC9MZW5ndGggMzggMCBSIC9UeXBlIC9YT2Jq
+	ZWN0IC9TdWJ0eXBlIC9JbWFnZSAvV2lkdGggNDAyIC9IZWlnaHQgMjQ2IC9Db2xvclNw
+	YWNlCi9EZXZpY2VHcmF5IC9JbnRlcnBvbGF0ZSB0cnVlIC9CaXRzUGVyQ29tcG9uZW50
+	IDggL0ZpbHRlciAvRmxhdGVEZWNvZGUgPj4Kc3RyZWFtCngB7ZdrU5J7HEXl4Y6Aoilq
+	0c1QxwtNepTMS0eDvCQiAkLf/4scqKnAavemnj1zWr83vdhTq1nLP9TEBIcBDGAAAxjA
+	AAYwEI6BSBBEuVANBEEk8rO4kSAaTyRTaS5MA6lkPBb9cZNINJ6azE0VZrgQDRSm89lM
+	Mhb8oEkQTUxOzRaXHpUec+EZKD1cnJ/JpePfP5NINJmdXXpaXt+sVF5yYRmobG2sLZeK
+	05n4/VcSiSayD0orld39w6NjLjwDRwfV7Y3lpcIgyfj3exCfnC2tbR+c1M/OL7jwDJy/
+	rx1XKy8Wp1L3PreiqanFle2j+ofr5k2LC8/ATbNxcbq/9WwuO/5IIrHJ2aeVg/pVq9Pt
+	3nHhGeh2283Lk721pcEjGf3YChK5Ynn35LLV7fX6/f5HLhwDA9e9u07z7LDyZDYTG/0X
+	cJCcWlrfr193hj0oEk6OT5RhktvLf3eWBx9bo0WiqcKjzcOzZpcXEmKNL0naV+/2ysXc
+	eJF0oVQ5Or/p8kDCLvKx32s3atXVhVxi7I2kZx5Xji9agyKh/43+emCvc11/vbqY/67I
+	S4p4fjiGRfbXflLkzvN3+rupX4uM/q89OvjUGr4Rihh+OChikC6RFJF6DCNFDNIlkiJS
+	j2GkiEG6RFJE6jGMFDFIl0iKSD2GkSIG6RJJEanHMFLEIF0iKSL1GEaKGKRLJEWkHsNI
+	EYN0iaSI1GMYKWKQLpEUkXoMI0UM0iWSIlKPYaSIQbpEUkTqMYwUMUiXSIpIPYaRIgbp
+	EkkRqccwUsQgXSIpIvUYRooYpEskRaQew0gRg3SJpIjUYxgpYpAukRSRegwjRQzSJZIi
+	Uo9hpIhBukRSROoxjBQxSJdIikg9hpEiBukSSRGpxzBSxCBdIiki9RhGihikSyRFpB7D
+	SBGDdImkiNRjGClikC6RFJF6DCNFDNIlkiJSj2GkiEG6RFJE6jGMFDFIl0iKSD2GkSIG
+	6RJJEanHMFLEIF0iKSL1GEaKGKRLJEWkHsNIEYN0iaSI1GMYKWKQLpEUkXoMI0UM0iWS
+	IlKPYaSIQbpEUkTqMYwUMUiXSIpIPYaRIgbpEkkRqccwUsQgXSIpIvUYRooYpEskRaQe
+	w0gRg3SJpIjUYxgpYpAukRSRegwjRQzSJZIiUo9hpIhBukRSROoxjBQxSJdIikg9hpEi
+	BukSSRGpxzBSxCBdIiki9RhGihikSyRFpB7DSBGDdImkiNRjGClikC6RFJF6DCNFDNIl
+	kiJSj2GkiEG6RFJE6jGMFDFIl0iKSD2GkSIG6RJJEanHMFLEIF0iKSL1GEaKGKRLJEWk
+	HsNIEYN0iaSI1GMYKWKQLpEUkXoMI0UM0iWSIlKPYaSIQbpEUkTqMYwUMUiXSIpIPYaR
+	IgbpEkkRqccwUsQgXSIpIvUYRooYpEskRaQew0gRg3SJpIjUYxgpYpAukRSRegwjRQzS
+	JZIiUo9hpIhBukRSROoxjBQxSJdIikg9hpEiBukSSRGpxzBSxCBdIiki9RhGihikSyRF
+	pB7DSBGDdImkiNRjGClikC6RFJF6DCNFDNIlkiJSj2GkiEG6RFJE6jGMFDFIl0iKSD2G
+	kSIG6RJJEanHMFLEIF0iKSL1GEaKGKRLJEWkHsNIEYN0iaSI1GMYKWKQLpEUkXoMI0UM
+	0iWSIlKPYaSIQbpEUkTqMYwUMUiXSIpIPYaRIgbpEkkRqccwUsQgXSIpIvUYRooYpEsk
+	RaQew0gRg3SJpIjUYxgpYpAukRSRegwjRQzSJZIiUo9hpIhBukRSROoxjBQxSJdIikg9
+	hpEiBukSSRGpxzBSxCBdIiki9RhGihikSyRFpB7DSBGDdImkiNRjGClikC6RFJF6DCNF
+	DNIlkiJSj2GkiEG6RFJE6jGMFDFIl0iKSD2GkSIG6RJJEanHMFLEIF0ivxaJTHy7aHrm
+	8cvji1a3L38v458w8NMiFYr8Cd+/+jP7/V6nUXu9upBPjL+RQmnr6Pym2+eR/Erhb94H
+	RdqNWnWlmBsrEqSmH24cvG92eiT5zcb1H9cf3N3t1elueT4bH30jQTK/uFatNdp3JNEK
+	f/M6CNLrti7evnr+YDI2WiQSz84vb7+9aHbuelyoBu66t436m81SIR399i+tiYlILDNT
+	2qieXjZv2x0uRAPtdqvx/minvJBPBqNFJoJErrhc2T85+3DVuOZCM9BoXF3Uj/9ZL81m
+	xr5Gho8kPb30Ymvv8ORdrc6FZqBWO337Zmf9yVwuGR39Ghk8lyCeKSw+W6vs7FX3udAM
+	vK7uvtosl+byqbHv9eHnVyQaz0zNPXyyXF5d40IzsLpSfl5amMmlYuPfIp+SBPFUdmp2
+	rriwyIVmYKE4/2Amn0nGgnufWZ+TxBKpTDaX50I0kMtOppPx+98hwx7DiwTRWDzBhWog
+	Hh+8jx88kM9JBlEGF3DhGRgK/yKfXzGAAQxgAAMY+P8Z+A/zFAiFCmVuZHN0cmVhbQpl
+	bmRvYmoKMzggMCBvYmoKMTg0MQplbmRvYmoKMjUgMCBvYmoKPDwgL1R5cGUgL0V4dEdT
+	dGF0ZSAvQ0EgMC43ID4+CmVuZG9iagoyNiAwIG9iago8PCAvVHlwZSAvRXh0R1N0YXRl
+	IC9jYSAwLjcgPj4KZW5kb2JqCjI3IDAgb2JqCjw8IC9UeXBlIC9FeHRHU3RhdGUgL2Nh
+	IDAuNjUgPj4KZW5kb2JqCjI4IDAgb2JqCjw8IC9UeXBlIC9FeHRHU3RhdGUgL2NhIDEg
+	Pj4KZW5kb2JqCjQzIDAgb2JqCjw8IC9MZW5ndGggNDQgMCBSIC9OIDMgL0FsdGVybmF0
+	ZSAvRGV2aWNlUkdCIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlID4+CnN0cmVhbQp4AdVZZ1gU
+	zbLumU3AsqQl5xxFcpacJEgOgkha0pJzDkpSgiCIgICggAgighgIAiJgAkSCgBEJoiCo
+	YAIE4Q7q933nPuecf/fPneeZnnerqqtrp3q6p94BgG3ZLTjYH6YDICAwPNTKUIf3oIMj
+	L+4FoAQ0gBGIAUo3UliwtoWFKfivx/cJAO0qxyR3ff1Xs/+soPfwDCMBAFkganePMFIA
+	gq8DAOuQgkPDAUCtI/LhqPBgBKMfIJgxFAkQwS93sfdvvLKL3X9hDPqXjY2VLgAYVgAo
+	qN3cQr0BIAgict5Ikjfih6AHAJYh0IMcCADxIII1SD5uHgCwFSM2ewICgnZxH4JF3f/F
+	j/e/YDc39799url5/41//xekJzKwHjks2N8t5teP/8smwD8CuV+/DgakpQ70N9vNDTNy
+	Lni46ZkgV07k3A72/5UzxAZi9wy0tUZku3hPoLuZ+R+s4RVqYIVgpC9kERyus4uRewZ5
+	BYdb2PyRJ8b66JohmBqRF3iG6f/l55yvm/FuzmgQeXNohJUtggUR3B0Waa2PYGRGQW9i
+	fWzs/9h89fDU+yOHYS+ygdFvG5iBHG60OxYjknN+vyCT3RiQsWBFYAL8gSeIAKFIGwgk
+	gSnQBXp/WkngBdwQTSSiCwN+4C2CA5AeQUifIATz/rHT/TeJwa9+3ki//+2RF5AQ24i/
+	x/w9Gi8y5l8+ycADwX/J3ZAxdnW70YW5kJP/GfMvi11/v6KRrpdelN76Kya0MFoWrYDW
+	QaujNdAqgBfNjGYHkmh5tDJaG62JVkN0KsAAvEE8e/8V467/gGavyOKgGFU7H0S7+9/d
+	/9ICu1/W5L9//1sEgDy03LL8VwQAhHtGI88BALpBwTGhZG+fcF5t5Mn13MNrFEjau4dX
+	VlpGZlf9/+bYXbN+B/vF6tdaBDE//kcW0AiAMhmZj87/yNxPAtAuiTz79f/IhAuRtcEX
+	gAFBUkRo5G9/6N0LBlABWmSGsgFuIABEkfssCxSBGtAC+sAYmAMb4ACckfnjg8zBUBAF
+	4sFRkA6ywElwGpSAClAFakEDaAYtoAPcAffAABgG4+AFmAbzYAmsgO9gE4IgHESAiBAb
+	xAMJQRKQLKQMaUD6kClkBTlArpA3FAhFQPFQCpQF5UMl0HmoDroKtUF3oIfQCPQMmoEW
+	oc/QDxgFU8OMMBcsDEvByrA2bALbwIdhbzgEjoVT4Ry4GK6EL8M34TvwADwOT8NL8DcU
+	QOFRzCg+lCRKGaWLMkc5orxQoahEVCaqEFWJuoJqR91HjaGmUcuoDTQWTUTzoiWRebof
+	bYsmoUPQiehsdAm6Fn0T3YceQ8+gV9DbGAKGEyOBUcUYYQ5ivDFRmHRMIaYGcwNzFzOO
+	mcd8x2KxzFgRrBJ2P9YB64uNw2Zjz2Ibsd3YEewc9hsOh2PDSeDUceY4N1w4Lh13BncZ
+	dxs3ipvHrVPgKXgoZCkMKBwpAimSKQopLlF0UYxSvKPYpKSjFKJUpTSn9KCMocylrKZs
+	p3xMOU+5SUVPJUKlTmVD5Ut1lKqY6grVXaqXVF/weDw/XgVviSfjj+CL8U34B/gZ/AY1
+	A7U4tS61E3UEdQ71Repu6mfUXwgEgjBBi+BICCfkEOoIvYQpwjoNkWYvjRGNB00STSnN
+	TZpRmo+0lLRCtNq0zrSxtIW012gf0y7TUdIJ0+nSudEl0pXStdFN0n2jJ9LL0JvTB9Bn
+	01+if0i/wIBjEGbQZ/BgSGWoYuhlmCOiiAJEXSKJmEKsJt4lzjNiGUUYjRh9GbMYGxiH
+	GFeYGJjkmeyYoplKmTqZpplRzMLMRsz+zLnMzcwTzD9YuFi0WTxZMliusIyyrLFysGqx
+	erJmsjayjrP+YONl02fzY8tja2F7xY5mF2e3ZI9iL2e/y77MwcihxkHiyORo5njOCXOK
+	c1pxxnFWcQ5yfuPi5jLkCuY6w9XLtczNzK3F7ctdwN3FvchD5NHgIfMU8Nzmec/LxKvN
+	689bzNvHu8LHybefL4LvPN8Q3ya/CL8tfzJ/I/8rASoBZQEvgQKBHoEVQR7BA4LxgvWC
+	z4UohZSFfISKhO4LrQmLCNsLHxNuEV4QYRUxEokVqRd5KUoQ1RQNEa0UfSKGFVMW8xM7
+	KzYsDosriPuIl4o/loAlFCXIEmclRvZg9qjsCdxTuWdSklpSWzJSsl5yZi/zXtO9yXtb
+	9n6UEpRylMqTui+1La0g7S9dLf1ChkHGWCZZpl3ms6y4LEm2VPaJHEHOQC5JrlVuVV5C
+	3lO+XP6pAlHhgMIxhR6Fn4pKiqGKVxQXlQSVXJXKlCaVGZUtlLOVH6hgVHRUklQ6VDZU
+	FVXDVZtVP6lJqvmpXVJb2Ceyz3Nf9b45dX51N/Xz6tMavBquGuc0pjX5NN00KzVntQS0
+	PLRqtN5pi2n7al/W/qgjrROqc0NnTVdVN0G3Ww+lZ6iXqTekz6Bvq1+iP2XAb+BtUG+w
+	YqhgGGfYvR+z32R/3v5JIy4jklGd0YqxknGCcZ8JtYm1SYnJrKm4aahp+wH4gPGBUwde
+	mgmZBZq1mANzI/NT5q8sRCxCLG5ZYi0tLEst31rJWMVb3bcmWrtYX7L+bqNjk2vzwlbU
+	NsK2x47Wzsmuzm7NXs8+3376oNTBhIMDDuwOZIdWR5yjnWON47dD+odOH5p3UnBKd5o4
+	LHI4+vBDZ3Znf+dOF1oXN5drrhhXe9dLrltu5m6Vbt/cjdzL3FdIuqQi0pKHlkeBx6Kn
+	ume+5zsvda98rwVvde9T3os+mj6FPstkXXIJedV3v2+F75qfud9Fvx1/e//GAIoA14C2
+	QIZAv8C+IO6g6KCRYIng9ODpENWQ0yEroSahNWFQ2OGw1nBG5OVwMEI0Ii1iJlIjsjRy
+	Pcou6lo0fXRg9GCMeExGzLtYg9gLceg4UlxPPF/80fiZBO2E84lQontiT5JAUmrS/BHD
+	I7VHqY76HX2ULJ2cn/w1xT6lPZUr9UjqXJphWn06TXpo+uQxtWMVx9HHyceHMuQyzmRs
+	Z3pk9mdJZxVmbWWTsvtPyJwoPrGT45UzlKuYW34SezLw5ESeZl5tPn1+bP7cqQOnbhbw
+	FmQWfD3tcvphoXxhRRFVUUTRdLFpcesZwTMnz2yV+JSMl+qUNpZxlmWUrZ31ODtarlV+
+	pYKrIqvixznyuafnDc/frBSuLKzCVkVWva22q75/QflCXQ17TVbNz4uBF6drrWr76pTq
+	6i5xXsqth+sj6hcvO10ebtBraL0ieeV8I3NjVhNoimh6f9X16kSzSXPPNeVrV64LXS+7
+	QbyReRO6GXNzpcWnZbrVoXWkzbitp12t/catvbcudvB1lHYydeZ2UXWldu3cjr39rTu4
+	e/mO9525HpeeF70He5/0WfYN3TW5++Cewb3e+9r3bz9Qf9DxUPVhW79yf8uA4sDNQYXB
+	G48UHt0YUhy6+VjpceuwynD7yL6RrlHN0TtjemP3nhg9GRg3Gx+ZsJ14Ouk0Of3U4+nC
+	M/9nq88jn2++OPIS8zLzFd2rwinOqcrXYq8bpxWnO2f0ZgZnrWdfzJHmlt6EvdmaT31L
+	eFv4judd3YLsQseiweLw+0Pv55eClzaX0z/Qfyj7KPrx+ietT4MrB1fmV0NXdz5nf2H7
+	cvGr/Neebxbfpr4HfN9cy1xnW6/dUN64/8P+x7vNqC3cVvFPsZ/t2ybbL3cCdnaC3ULd
+	fr0LoJAW9vIC4PNF5D3BAakdhgGgovldU/yyQMoVCLFBsB20F1qCz6Kc0ULo95hubDEu
+	mMKKUp9KES9FvZcgQaNMa0LnSh/BcJrYxjjDTM2izRrK1sC+xCnG5cvdxLPOp8d/UmBW
+	SEb4mMgrMQXxkxLLkvp7q6S2ZZxk2+XZFaIVx5XlVHJUl/cZqp/T+KFlpX1BZ0PPRL/E
+	YGG/vFGccZcpdEDLLNa8yWLOit5a3cbDNs3unP21g7cdeh27D7U5NR6ucS5zOema7Bbi
+	7kwy9VDy5PcieK15z/j0k5t9S/yS/ckBFoEKQSxBa8FjIfWhSWHm4TzhnyK6InOinKIl
+	on/E9MeWxJHjlROwCWOJFUn+R3SOCiYzptCm0qXRp9MdIxynzEBn7GRuZH3OXjoxm/M8
+	d/TkQF5PftupKwVVp88U5hSlFMediSlJLi0uu3F2uHy2YvncyvmVypWqT9UfL3yoWbq4
+	UPumbubSXP1qA/0V3cbEpparr5vXr+NuEG/ytIi3KrRpthvdsu5w74zuKr59p3uhB91L
+	7GO/y3tP/L7SA52HOv2i/Z8GMgfZBs8/0ny0PNTwOHRYZQQaeTRaPhbyRH+cbfzjRO9k
+	0VOfZ4rPdp53v4h9Kfdy+VXDVNjrfdPY6dGZslmvOZm5zTf35gveer5TXWBYeL/Y9T57
+	yX6Zb3nxw9WPsZ90VvAr46sNn8u/XP+69t1r7fmG1o+CzemfctsFOzu/8i8ANcEOKAbU
+	A3Q6xgTLhH2Fu0aRTelPZYvXo5YjiNEI0YrSSdErMBgQ7RgDmVKZq1j6WJfY6Tk0OMlc
+	JdyDPDt8yvzhAlcE3wtLiPiI1ootSUjuCZW8sXdDWlPmqOx9ebyCqWKO0ogKUdVCLWdf
+	vwZWU1MrUrtW54UeXl/VwN0wY3+90YDxoil8gMVMxFzOQtVS1UrOWtCGxuab7XO7bvvq
+	g5kOgY7Wh5ScOJx2Ds8697nUuKa7ebhrkThJax4jnvVead7OPkpkOvKC722/Iv/AAP1A
+	9sAPQbeDc0IcQ/lDF8OawqMiVCN+RnZFJUVrxaBjHsSeiLOIJ8aPJxQlHkJW1pUjvUcr
+	klNSAlMd0wzT5Y/xHac+vpYxmzmYdTP73InjOaG5h0+a5mnmK5zaWyB6mr+Qs4ilmP4M
+	VQm6ZKv0a9nS2enyyYqRc8PnxytfVy1Vr9egLtLUstUJXpKu33fZoMH8ikOjZ1Pk1ezm
+	2mt916durLZArXRtfO1ytww6DnUGd6XfLu2uu9PQU917si/8rs092fv091cfPEHWpoqB
+	tEG/R5ZDyo/5hvHD6yNzo4/Gmp8UjSdMkCZNnso/43qOeb784snLW6+qpk68jp8OnvGb
+	DZgLf5Mwn/42713pwoXFpvftS73Ljz68+Li+orJa/UXnG/771/WFH6NbldsOf/LPCZ2A
+	ReEBVACaAz2AScZqYNdxnRTHKB2o5PA0+AXqh4RrNOW0J+hS6GMZIokxjDFMCczpLLms
+	Z9ka2fs4nnJ+5CbwCPLq8LnypwhUCd4VWhShEZURsxWPk6jY0ye5KEUvrSTjKBsnVy5/
+	W2FKcVuZQ0VF1UqNvC9RPU+jSvOqVof2XZ1+3UG9Af37BrcNr+2vNMo0DjQxMeU1/Xrg
+	nlmROdlCxRJnOWF1wTrMRsuW2nbSrto++KCaA9Zh2LHkkKfTXqfvh7uc013MXImuk24l
+	yDrBQ5r2OOfp6sXj9dr7nI8rmYc85XvWz8Gf6D8UkBGoHwQF3QoODxEJeRp6PEwp7F14
+	YYRexOfIc1FmUZvRdTF2sXBsY9yheEx8U8KhRExiU5LzEcYjI0cLkz1TlFNpUufTOtML
+	jvkd185gyfiQeSerINvrhFIOVc50buvJ/LzQfOtTCgVsBdun3xT2FzUWnzoTWeJQqlrG
+	juyW4+U3KkrPnTifXplalVZ97MKxmrSLCbUBdQcv6derXVZvMLni1hjfVHz1evOja/PX
+	N2/Stwi37muzbPe+ldhxuvNSV8ft+939dx723O2909d5t/XetfsNDy4+rOg/M5A/mP0o
+	fSjlcdpw3kjt6MOx1XGuCaPJyKeVz4aeb7wUfGU9lft6eoY8x/rm2zvMYuJy7+qpdcHd
+	/P/mlnb3BKwiADUI72F3BABLRFNrCYBQAUJxtAFgQQDARgXAfmkApl8CUJno3/sHBNAI
+	A0eHVJwCQAqoI8zGIYRLSAT5oAbcAiNgEakX2SF5yBzyg45BF6BeaBaGYQFYH6n0suBG
+	+An8A6nn9qNCUCWoPtQnZA4aoiPQVegxDAojj1RkJZghLAqrgg3G1mJncZy4g7gC3CgF
+	PYUlxSmKcUo2ShfKGsqPVMpUKVTDeG58IL6bmpHal/oOgYMQRRinUaQ5Q7ND6007SqdN
+	d41enL6GQYShkahGHGR0YfzKdIJZnHmAJZiVhbWXLYSdn32C4wTnfi4s1z3uTB5LXk7e
+	D3x9/FUCWYKxQgHCHiIuos5iruKeEgF7YiQz9pZLtUtPyryX/Sj3Rv6JQq/iTaUrypdU
+	6lQvqTXta1Xv0xjTnNfa0KHVFdMz0Pc2yDK8uv+FMc5E1tT+QKhZinmuRblli9ULG0pb
+	DbsoZL/77Ch/KNrpjjPBxcm1zm2ZxOWh6WnvFeB93KeZ/MFPyT8j4HWQYvDJkI/I/tYc
+	yRQVHt0fyxLnHF+bsJPkc2Qm2S3ldZpD+vhxh4ytrIWcnLyzBeyFxsXBJcVlreVD52Yq
+	v1+guShWZ1If3dDexN1ceUOipbxtp8Op69Yd3t7MuxsPfPrHHsk/zhqZe3JgYuiZ64uN
+	qaIZ5bnXb1MXNpf4l7c/Vq8IrlZ8Yfta+V1j7d1G8abO1tR26K/1A0I4BzwgAi6EgVVC
+	+B57QEZYhTxwEXSBCfAJokI4Ah3IBUqEyqEuaBrJvTBsDAfDhXAX/BZFh1JFeaLyULdR
+	H9Cc6ANIhX4V/QbDhjHDpGE6kepbGuuP5P0tTgjnhavFLVFIUURQdFJiKS0oz1K+p1Kl
+	yqJ6jZfHZ+HfUGtSn6X+SXAl3KWRpCmixdBG0i7Rkeim6d3p3zPEEGmJlxgNGReYsphl
+	mJ+zpLPKs75lK2W34aDjGOUs5nLnluIBPOO8DXwZ/N4CxoIyQhzCFMKbIl9Fv4ptSRD2
+	CEhq7HWVypBuk3kvxylvoZClOKhMr2KvekZtTB3SENY00PLSPq7ToDuuDxvIGnrtP2s0
+	acJsaneg0GzMgsbS0CrJut1mzU7RPvpgpyPmkIVTxeHPLsau1W4/SZbIOvXeW84ngTzg
+	x+UfEnAviCs4MmQsTD68KGIryiW6K5Y1LjD+XqJAUuaR9WTflFdpFum9x5UyGrL4s0ty
+	WHIr8lTzPxS0FhYVJ5eElLmUG5+Tr+Spprmwc/Fz3dv6pw0PGjuutl27c+Nxy6u2pVsb
+	XVTdvD2qfQfvxTwo7W8fHB56Mfx0dPBJx8Tlp2ef5708NpU0HTMb9Sb6bdxC9PvDy8wf
+	aj6xrJBXqz6Pf1n7xvJdbs1iPWzjzI9HW7ifltvVf/KPBQTAgjz9MkAH4Zd8QAIoQDik
+	+2AW7EBc0D7oMJL789A95C2TAVaFSfAJuBWeRxFR2ghzU4WaQFMi7GIE+jJ6HsODOYQp
+	xkwgjIs9tgQ7hRPA+eKu4bYpjCmKKRYQxuQE5RyS8wKqFbw5vomaSB1DPUswI3TSSNNc
+	oOWhLaPjpqtGeIs+BhcijOTbngnHdIs5nEWaZYX1OlsCuxEHK8cyZx/XOe4kHhKvKZ8K
+	v7gAnyCPEJ+wmIiiqJGYi3iMRNGedslZKQZpY5l02V55jIKlYoMyUSVJdXUfWX1B01/r
+	u066Hqd+u6GLEd64w5RshjHPsgRWQdavbM3sepA9qfWQilO3s5nLjFs0idajykveu5ts
+	4jvpTwpYDToawhTaGH4gYiXqTIxxHBTfmkhK2j6ak8KaWpkueawzwyZzPftKTuBJ8byx
+	U74FXwojir6diSrZKksvZ6yoOa9WOVYdUEN1sbZu/6XFy9lX5BvfXD1/zf+GXgt/G7p9
+	sWOkq7O7oaeyr+RewYO8/tzB3KGs4YRR5yfS498mm58FvBB7+XbqwrTXrPjc6nzHu7RF
+	vfery8c/fP5ktJK92vL51Zflrxvf5r4/XMtf37f+diN1Y+NH4I+5zYObt7cYt8hbXT8Z
+	f5J/dm1TbFtsF2+/3hHZCdpp2c1/mJec7O7uASBqHYR+nNrZ+SIMAC4fgJ95OzublTs7
+	P6uQYgP5BtLt//t7xa4xFuHcy27tov90/A/oHZP+CmVuZHN0cmVhbQplbmRvYmoKNDQg
+	MCBvYmoKNTk1MwplbmRvYmoKMzYgMCBvYmoKWyAvSUNDQmFzZWQgNDMgMCBSIF0KZW5k
+	b2JqCjQ1IDAgb2JqCjw8IC9MZW5ndGggNDYgMCBSIC9OIDMgL0FsdGVybmF0ZSAvRGV2
+	aWNlUkdCIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlID4+CnN0cmVhbQp4AYVUz2sTQRT+Nm6p
+	0CIIWmsOsniQIklZq2hF1Db9EWJrDNsftkWQZDNJ1m426+4mtaWI5OLRKt5F7aEH/4Ae
+	evBkL0qFWkUo3qsoYqEXLfHNbky2perAzn7z3jfvfW923wANctI09YAE5A3HUqIRaWx8
+	Qmr8iACOoglBNCVV2+xOJAZBg3P5e+fYeg+BW1bDe/t3snetmtK2mgeE/UDgR5rZKrDv
+	F3EKWRICiDzfoSnHdAjf49jy7I85Tnl4wbUPKz3EWSJ8QDUtzn9NuFPNJdNAg0g4lPVx
+	Uj6c14uU1x0HaW5mxsgQvU+QprvM7qtioZxO9g6QvZ30fk6z3j7CIcILGa0/RriNnvWM
+	1T/iYeGk5sSGPRwYNfT4YBW3Gqn4NcIUXxBNJ6JUcdkuDfGYrv1W8kqCcJA4ymRhgHNa
+	SE/XTG74uocFfSbXE6/id1ZR4XmPE2fe1N3vRdoCrzAOHQwaDJoNSFAQRQRhmLBQQIY8
+	GjE0snI/I6sGG5N7MnUkart0YkSxQXs23D23UaTdPP4oInGUQ7UIkvxB/iqvyU/lefnL
+	XLDYVveUrZuauvLgO8XlmbkaHtfTyONzTV58ldR2k1dHlqx5erya7Bo/7FeXMeaCNY/E
+	c7D78S1flcyXKYwUxeNV8+pLhHVaMTffn2x/Oz3iLs8utdZzrYmLN1abl2f9akj77qq8
+	k+ZV+U9e9fH8Z83EY+IpMSZ2iuchiZfFLvGS2EurC+JgbccInZWGKdJtkfok1WBgmrz1
+	L10/W3i9Rn8M9VGUGczSVIn3f8IqZDSduQ5v+o/bx/wX5PeK558oAi9s4MiZum1Tce8Q
+	oWWlbnOuAhe/0X3wtm5ro344/ARYPKsWrVI1nyC8ARx2h3oe6CmY05aWzTlShyyfk7rp
+	ymJSzFDbQ1JS1yXXZUsWs5lVYul22JnTHW4coTlC98SnSmWT+q/xEbD9sFL5+axS2X5O
+	GtaBl/pvwLz9RQplbmRzdHJlYW0KZW5kb2JqCjQ2IDAgb2JqCjczNwplbmRvYmoKOCAw
+	IG9iagpbIC9JQ0NCYXNlZCA0NSAwIFIgXQplbmRvYmoKNDcgMCBvYmoKPDwgL0xlbmd0
+	aCA0OCAwIFIgL04gMSAvQWx0ZXJuYXRlIC9EZXZpY2VHcmF5IC9GaWx0ZXIgL0ZsYXRl
+	RGVjb2RlID4+CnN0cmVhbQp4AYVST0gUURz+zTYShIhBhXiIdwoJlSmsrKDadnVZlW1b
+	ldKiGGffuqOzM9Ob2TXFkwRdojx1D6JjdOzQoZuXosCsS9cgqSAIPHXo+83s6iiEb3k7
+	3/v9/X7fe0RtnabvOylBVHNDlSulp25OTYuDHylFHdROWKYV+OlicYyx67mSv7vX1mfS
+	2LLex7V2+/Y9tZVlYCHqLba3EPohkWYAH5mfKGWAs8Adlq/YPgE8WA6sGvAjogMPmrkw
+	09GcdKWyLZFT5qIoKq9iO0mu+/m5xr6LtYmD/lyPZtaOvbPqqtFM1LT3RKG8D65EGc9f
+	VPZsNRSnDeOcSEMaKfKu1d8rTMcRkSsQSgZSNWS5n2pOnXXgdRi7XbqT4/j2EKU+yWCo
+	ibXpspkdhX0AdirL7BDwBejxsmIP54F7Yf9bUcOTwCdhP2SHedatH/YXrlPge4Q9NeDO
+	FK7F8dqKH14tAUP3VCNojHNNxNPXOXOkiO8x1BmY90Y5pgsxd5aqEzeAO2EfWapmCrFd
+	+67qJe57AnfT4zvRmzkLXKAcSXKxFdkU0DwJWBR9i7BJDjw+zh5V4HeomMAcuYnczSj3
+	HtURG2ejUoFWeo1Xxk/jufHF+GVsGM+Afqx213t8/+njFXXXtj48+Y163DmuvZ0bVWFW
+	cWUL3f/HMoSP2Sc5psHToVlYa9h25A+azEywDCjEfwU+l/qSE1Xc1e7tuEUSzFA+LGwl
+	uktUbinU6j2DSqwcK9gAdnCSxCxaHLhTa7o5eHfYInpt+U1XsuuG/vr2evva8h5tyqgp
+	KBPNs0RmlLFbo+TdeNv9ZpERnzg6vue9ilrJ/klFED+FOVoq8hRV9FZQ1sRvZw5+G7Z+
+	XD+l5/VB/TwJPa2f0a/ooxG+DHRJz8JzUR+jSfCwaSHiEqCKgzPUTlRjjQPiKfHytFtk
+	kf0PQBn9ZgplbmRzdHJlYW0KZW5kb2JqCjQ4IDAgb2JqCjcwNAplbmRvYmoKMTYgMCBv
+	YmoKWyAvSUNDQmFzZWQgNDcgMCBSIF0KZW5kb2JqCjQgMCBvYmoKPDwgL1R5cGUgL1Bh
+	Z2VzIC9NZWRpYUJveCBbMCAwIDYxMiA3OTJdIC9Db3VudCAxIC9LaWRzIFsgMyAwIFIg
+	XSA+PgplbmRvYmoKNDkgMCBvYmoKPDwgL1R5cGUgL0NhdGFsb2cgL091dGxpbmVzIDIg
+	MCBSIC9QYWdlcyA0IDAgUiAvVmVyc2lvbiAvMS40ID4+CmVuZG9iagozNSAwIG9iago8
+	PCAvTGVuZ3RoIDUwIDAgUiAvT3JkZXIgMSAvRW5jb2RlIFsgMCAxMzY0IF0gL0Z1bmN0
+	aW9uVHlwZSAwIC9CaXRzUGVyU2FtcGxlCjggL0RlY29kZSBbIDAgMSAwIDEgMCAxIF0g
+	L0RvbWFpbiBbIDAgMSBdIC9SYW5nZSBbIDAgMSAwIDEgMCAxIF0gL1NpemUgWyAxMzY1
+	Cl0gL0ZpbHRlciAvRmxhdGVEZWNvZGUgPj4Kc3RyZWFtCngBtcKJVgFRAADQ7zL76kuz
+	RZbIIJJ1BqGUypItSynCF3Tq5DijMebNvHfPLW3spWOVjR342q4YLSprVXktHrkSZXiL
+	K1H1SywiuhSLS7EAuVBY/l4IBa35hQDhp5A3NvcpgP0QchZmPwS9cyGrl8/OwWbm/O47
+	n0H3jc+88dcozvjrw9Mz3nAuPft3yqVBXk05gBPuytrUhNM+5lIIJsfcz1fNbPIVxhGb
+	3L4csTAP2UvdiSFr/oBNAI4P2G0mPtDdZ+KWx/qMxh4TQ1PqMdILyl1G+ktLXToKd4eO
+	6r7o0Ca36QvwkTZtaIuOAKcirf3hFqXxmQqjef5EIfxInauHHilom2To2GCTNPOBDJoa
+	eCCPvycDkPrvyf0N0m8o4W8AP7sjUL0lzrT6bgkI64TPWG+dMBb31rdruNfs0xqut4qf
+	Qu2p4rs3uAfdCu6p4O6DMXfF7DLmPtBVxqwuYS7DnSUMrII5LXQo2LbNoajLNgfsJ7Lt
+	b9F2AvIbCq+1owplbmRzdHJlYW0KZW5kb2JqCjUwIDAgb2JqCjM4NAplbmRvYmoKMzQg
+	MCBvYmoKPDwgL0xlbmd0aCA1MSAwIFIgL09yZGVyIDEgL0VuY29kZSBbIDAgMTM2NCBd
+	IC9GdW5jdGlvblR5cGUgMCAvQml0c1BlclNhbXBsZQo4IC9EZWNvZGUgWyAwIDEgMCAx
+	IDAgMSBdIC9Eb21haW4gWyAwIDEgXSAvUmFuZ2UgWyAwIDEgMCAxIDAgMSBdIC9TaXpl
+	IFsgMTM2NQpdIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlID4+CnN0cmVhbQp4AY3CCTdUcRgH
+	4C8mEolEIpGSkpKSEolEIhljxqxmDGNm7Pu+71tf6/29neuY073jf+99n/Pw3wTbjPOl
+	cIwvTV7E2HCMLySjfKF7HmXTo3wuOcJnwhE+M3kaYcNhPpUM86nuSZhNh/hE8DjEx0Oy
+	QT42eRRkwwAfCfv5KPnQz6Z9fCh44OMDr7iHD1T3PWw4yPvCbt5P3nOzVRfvXceeS33X
+	hd0BcSd2VXecSN2PHUkHdq5uO2CzD9t2t/qg/SPbiy3VzV6k/o1N4R5s9mDDdjc27K53
+	Q/tLtgvrqmtdSP0Ta8KdWOvEqu0OrNpd6YD2h3g7Vm5cbkfq71gWbsNyG5YkW7FkebEV
+	2m/iLVg0XmiB+lcsSDZjoRnzkk2YtzzXhOtfMCfZiDnj2Uaof8as8CfMSDZgxvJ0A65/
+	xLRwPaZ1p+qh/gFTwu8xKVmHSfMTdfj/HSaEazGhO14L9bcYF36DhHANEoqUqKG4/muK
+	C1dTXDdWTaZfUUzyJY0JV9GYyWgVGb6gqGQlRXVHK8n0cxqVHXlGohU0YjJSQYZPKSJc
+	TpHk4XIyXUbDguEyCj8RL6WwaqiUDB9TSLiEQslDJWS1mIbsBosp+Ei8iIKqgSIyfEgB
+	4UIKJPsLyWoB+e36Csj3QDyffKrefEp9n7ySeeS96skjm7nksTuYS9p7sjk0qOrOodR3
+	yS2cTe5sctnOIpfdgSzS3hHPpIEbnZmU+jY5hTPImUH9kunUb9mRTtpb4mnkSPsHinMK
+	nAplbmRzdHJlYW0KZW5kb2JqCjUxIDAgb2JqCjU3MgplbmRvYmoKMzMgMCBvYmoKPDwg
+	L0xlbmd0aCA1MiAwIFIgL09yZGVyIDEgL0VuY29kZSBbIDAgMTM2NCBdIC9GdW5jdGlv
+	blR5cGUgMCAvQml0c1BlclNhbXBsZQo4IC9EZWNvZGUgWyAwIDEgMCAxIDAgMSBdIC9E
+	b21haW4gWyAwIDEgXSAvUmFuZ2UgWyAwIDEgMCAxIDAgMSBdIC9TaXplIFsgMTM2NQpd
+	IC9GaWx0ZXIgL0ZsYXRlRGVjb2RlID4+CnN0cmVhbQp4AaXChVJCUQBAwb+2u7u7sekG
+	FQMDW7ED61OOMTL48MWNnU1+kLSY+OD7u+L4O8XfiAuPvWH3lZjt6CsSX4gaR15QnCOS
+	I6w9lCP0rD74jOETQZmBJ+w+ErDtf0T0A/5/fQ+ovMf303uPZs8dOt13GN7ilrl6i+Ub
+	Vp2u3CD0mhWzy9dIv2I5f+kKzYtZdC5kKbxkQfL8JeYvmBfoukDoOS6zc+dIP2Muf/YM
+	rafM6J0+5fcJ0/KnTjB/zJTAyWOcHzFpceIIuYdM/Dl+iPoM4xnG9I5m+H3AqPyRA0zu
+	MyJ2eB+HewxbH9pD4i5DxoO7qE8zmGZAb3+a7zuK+3Yovk2f8N5tHG7Ra71nC4mb9Bh3
+	b6I4RffPrhQ6O1N0bqjv2KD4Oh3C29exu0a77bY1RCdp+7c1icoErfktCXQ2J2iOq2+K
+	YxijSWZjDMtRGp02RBEaocFsfQSVYerz68LorA2hsyZEYZAaydVBLAeodloVQKifKrOV
+	fqT7qPyzwod6L+V6y7wUeiiTXOrBvJtSgSVuvn4CXuWIVQplbmRzdHJlYW0KZW5kb2Jq
+	CjUyIDAgb2JqCjQxMAplbmRvYmoKMzIgMCBvYmoKPDwgL0xlbmd0aCA1MyAwIFIgL09y
+	ZGVyIDEgL0VuY29kZSBbIDAgMTM2NCBdIC9GdW5jdGlvblR5cGUgMCAvQml0c1BlclNh
+	bXBsZQo4IC9EZWNvZGUgWyAwIDEgMCAxIDAgMSBdIC9Eb21haW4gWyAwIDEgXSAvUmFu
+	Z2UgWyAwIDEgMCAxIDAgMSBdIC9TaXplIFsgMTM2NQpdIC9GaWx0ZXIgL0ZsYXRlRGVj
+	b2RlID4+CnN0cmVhbQp4Aa3BBwKBAABA0ftfSTRUtDWMFu00dQV34L+3bT/6bB/OylmW
+	daHMy8yZpnmijNPIGUDv4c3pQV3fUdqu5TRN21DqpuZUVV1RyqrkFKBX8eI8Qfkzp2R5
+	xknTLKUkacKJ4ySmPOIH5w663W+cKyi6RpQwCjlBEAYUP/A5F5B38TguyHEdjg2ybIti
+	WibIMA3K2ThzTiD9pHM0kKqpnCNIOSoUWZFBkixRREnkHED7w54jgHbC7n9fqv5GzApl
+	bmRzdHJlYW0KZW5kb2JqCjUzIDAgb2JqCjE4OAplbmRvYmoKMzEgMCBvYmoKPDwgL0xl
+	bmd0aCA1NCAwIFIgL09yZGVyIDEgL0VuY29kZSBbIDAgMTM2NCBdIC9GdW5jdGlvblR5
+	cGUgMCAvQml0c1BlclNhbXBsZQo4IC9EZWNvZGUgWyAwIDEgMCAxIDAgMSBdIC9Eb21h
+	aW4gWyAwIDEgXSAvUmFuZ2UgWyAwIDEgMCAxIDAgMSBdIC9TaXplIFsgMTM2NQpdIC9G
+	aWx0ZXIgL0ZsYXRlRGVjb2RlID4+CnN0cmVhbQp4AbXCiVYBUQAA0O8y++pLs0WWyCCS
+	dQahlMqSLUspwhd06uQ4ozHmzbx3zy1t7KVjlY0d+NquGC0qa1V5LR65EmV4iytR9Uss
+	IroUi0uxALlQWP5eCAWt+YUA4aeQNzb3KYD9EHIWZj8EvXMhq5fPzsFm5vzuO59B943P
+	vPHXKM7468PTM95wLj37d8qlQV5NOYAT7sra1ITTPuZSCCbH3M9XzWzyFcYRm9y+HLEw
+	D9lL3Ykha/6ATQCOD9htJj7Q3Wfilsf6jMYeE0NT6jHSC8pdRvpLS106CneHjuq+6NAm
+	t+kL8JE2bWiLjgCnIq394Ral8ZkKo3n+RCH8SJ2rhx4paJtk6NhgkzTzgQyaGnggj78n
+	A5D678n9DdJvKOFvAD+7I1C9Jc60+m4JCOuEz1hvnTAW99a3a7jX7NMarreKn0LtqeK7
+	N7gH3QruqeDugzF3xewy5j7QVcasLmEuw50lDKyCOS10KNi2zaGoyzYH7Cey7W/RdgLy
+	GwqvtaMKZW5kc3RyZWFtCmVuZG9iago1NCAwIG9iagozODQKZW5kb2JqCjMwIDAgb2Jq
+	Cjw8IC9MZW5ndGggNTUgMCBSIC9PcmRlciAxIC9FbmNvZGUgWyAwIDEzNjQgXSAvRnVu
+	Y3Rpb25UeXBlIDAgL0JpdHNQZXJTYW1wbGUKOCAvRGVjb2RlIFsgMCAxIDAgMSAwIDEg
+	XSAvRG9tYWluIFsgMCAxIF0gL1JhbmdlIFsgMCAxIDAgMSAwIDEgXSAvU2l6ZSBbIDEz
+	NjUKXSAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAGlwoVSQlEAQMG/tru7
+	u7HpBhUDA1uxA+tTjjEy+PDFjZ1NfpC0mPjg+7vi+DvF34gLj71h95WY7egrEl+IGkde
+	UJwjkiOsPZQj9Kw++IzhE0GZgSfsPhKw7X9E9AP+f30PqLzH99N7j2bPHTrddxje4pa5
+	eovlG1adrtwg9JoVs8vXSL9iOX/pCs2LWXQuZCm8ZEHy/CXmL5gX6LpA6Dkus3PnSD9j
+	Ln/2DK2nzOidPuX3CdPyp04wf8yUwMljnB8xaXHiCLmHTPw5foj6DOMZxvSOZvh9wKj8
+	kQNM7jMidngfh3sMWx/aQ+IuQ8aDu6hPM5hmQG9/mu87ivt2KL5Nn/DebRxu0Wu9ZwuJ
+	m/QYd2+iOEX3z64UOjtTdG6o79ig+DodwtvXsbtGu+22NUQnafu3NYnKBK35LQl0Nido
+	jqtvimMYo0lmYwzLURqdNkQRGqHBbH0ElWHq8+vC6KwNobMmRGGQGsnVQSwHqHZaFUCo
+	nyqzlX6k+6j8s8KHei/lesu8FHook1zqwbybUoElbr5+Al7liFUKZW5kc3RyZWFtCmVu
+	ZG9iago1NSAwIG9iago0MTAKZW5kb2JqCjI5IDAgb2JqCjw8IC9MZW5ndGggNTYgMCBS
+	IC9PcmRlciAxIC9FbmNvZGUgWyAwIDEzNjQgXSAvRnVuY3Rpb25UeXBlIDAgL0JpdHNQ
+	ZXJTYW1wbGUKOCAvRGVjb2RlIFsgMCAxIDAgMSAwIDEgXSAvRG9tYWluIFsgMCAxIF0g
+	L1JhbmdlIFsgMCAxIDAgMSAwIDEgXSAvU2l6ZSBbIDEzNjUKXSAvRmlsdGVyIC9GbGF0
+	ZURlY29kZSA+PgpzdHJlYW0KeAGtwQcCgQAAQNH7X0k0VLQ1jBbtNHUFd+C/t20/+mwf
+	zspZlnWhzMvMmaZ5oozTyBlA7+HN6UFd31HaruU0TdtQ6qbmVFVdUcqq5BSgV/HiPEH5
+	M6dkecZJ0yylJGnCieMkpjziB+cOut1vnCsoukaUMAo5QRAGFD/wOReQd/E4LshxHY4N
+	smyLYlomyDANytk4c04g/aRzNJCqqZwjSDkqFFmRQZIsUURJ5BxA+8OeI4B2wu5/X6r+
+	RswKZW5kc3RyZWFtCmVuZG9iago1NiAwIG9iagoxODgKZW5kb2JqCjIgMCBvYmoKPDwg
+	L0xhc3QgNTcgMCBSIC9GaXJzdCA1OCAwIFIgPj4KZW5kb2JqCjU4IDAgb2JqCjw8IC9Q
+	YXJlbnQgNTkgMCBSIC9Db3VudCAwIC9EZXN0IFsgMyAwIFIgL1hZWiAwIDczMyAwIF0g
+	L1RpdGxlIChDYW52YXMgMSkKPj4KZW5kb2JqCjU5IDAgb2JqCjw8ID4+CmVuZG9iago1
+	NyAwIG9iago8PCAvUGFyZW50IDU5IDAgUiAvQ291bnQgMCAvRGVzdCBbIDMgMCBSIC9Y
+	WVogMCA3MzMgMCBdIC9UaXRsZSAoQ2FudmFzIDEpCj4+CmVuZG9iago2MCAwIG9iago8
+	PCAvTGVuZ3RoIDYxIDAgUiAvTGVuZ3RoMSAxMDM5MiAvRmlsdGVyIC9GbGF0ZURlY29k
+	ZSA+PgpzdHJlYW0KeAG9Wnl4U9eVP/e+VZstydoXS0KWZHlfwNjYYMXYxiw2ZglYNAbb
+	YDAEJ0DALFOok0AAh5AQwhJI05IFDJQgjBtEKAzNmJJMM03SoSSl6bSZkjbTL/7SmSFt
+	B5A05z0ZB/y1+fJHvr6nc/fl3N8999xz79PqVWvaQQPdwEDjvNYVi0F+/H8CIL0LO1tX
+	JONpIvrvLOxa7U7GuUwAZvniFUs6k3HxOQClc8ny9UP1DZis7+5ob12UzIfb6Jd0YEIy
+	Tkajn9HRuXpdMq7vR3/28ocXDuWnXcF4TmfruqH+4SOMux9q7WxPlve/g37GiocfWT0U
+	70Z/2opV7UPlSRPy9y4QTDXCw6CAB0EAClp8mwGET5VOYDFXysdnUY5q94LUii9AJw0T
+	YEH907L/E8+Prv61/XZAtUv8P0xQ3Ckv+XwwHgRQE8wfVO0azpHroWOMwqzsKExGqkQa
+	g5SdfZ8FuslheAbp+0gMLCVPwnqk7UjPI7HDoaMYO0ue7GPF0BtkPdjIlJCKdc02WF0W
+	pcr18yjh+190/dLyu3PEirP3MbH2aUBxn5J8n3wPFoGLvAo+sgHqIJMcOB1c7mrBrKOw
+	AqkbiZFdQo72pRe5LpAc8LEE6/ghnSWvu/5QmOv6pDBKSZ/rzUCURe/H6RgLpbouOl90
+	/bNziesC0vFk1rEglnjdddS53LU7PUoO9LmedUYJ1tmV9NY4serrrs7gXteiQjl/2t4o
+	Pd7nKsP8OSGVq6TU4xrjvO7KD0RFgvFc5zRXVuG/uTKwIhZzY6O+kM7lcO52jcOsdGdN
+	YBzSOXKMHIQscrDPN8X1BgZxuKcnB0v3Rsk/na7LLPRFyYZQSV3m3mBdwBec5vIFawMB
+	DM95S9gsfEu4TygSsoVMwS94BLtgEPWiVkwR1aJSFEUhSn7QV+niz5HjUImwHD8t8iIX
+	Ja9hInuOnJATT5wRWZGKIBqiid+i8BIwRMnxfq0UwsDrvBzio+TE6WTSiZCLlUKsnKGl
+	UhgddIESkcIUiJCnojxsMXVVWir1E3RltdV/z2mRc+642X//sRBnZO/UWU2RY85wpEgK
+	JJzhO8UtdwJ/11+9BrPaq7Kzp85cf7prxbLFNe3emhZvTTtSS+TJrg5LpLvN7T61bIWU
+	4Y4w/pa2hR2S39oeWeFtr44s81a7T3XJ9UZkL5ayu7zVp2BxzeymU4tD7dV9XaGuGm9r
+	dfh0W9Wq5nv62j7c16qqv9FXldTYKqmvNrneiL6apew2qa9mqa9mqa+2UJvclzT4mqWz
+	qh5ZjdLprlk61R3JnBWZPGNeU8TdGq6OksOYWL0GuIug5c5DJtcNNjYfXACJXyJdk/z4
+	/Ynfc5dBG+9M/DdTjpN6ViIar6yAi/AUHISTwEMvhjNhPuyHt8kyXNsPQD9cJemQh7qX
+	hShMg3dIIvE+LIZXsPxqeBP2wClQY51O1GHTYCfxJTZgPIThNticeAkyoBSegPNQhq3u
+	hMHE0cRpzJ0J98MxOI71f0q89BSblngtcR1EmIFtbsac9xPTEidBDzlQBY2YuhkuEB9z
+	LdEBFihH7l6A78Eh+DF8Rh4j/YmORFfivcTHKKoWcMAsfDeSfvIxc5J9IvFC4o+JOCKR
+	CVnYawvshpex/ZP4XkTVWkMeJKvJbrKHhuhjtJ/dwpnjMcQhCJPwrUOtvA0ROAsD8D/w
+	f+RzamG0zGrmUmJM4n9BBVNxlNJI2qEL36347sQxnSM8KSATSSPZSJ4je8i/0yx6P22i
+	a+k6+numgXmAWc/8O/sI28ft4PbzqvgXiXOJy4lfgBmc8C1YBZtwdG/Ce3ADbhIG23IQ
+	HyknVWQ+vt3kID1LDpGztJFcJO/RY+Q35Hfkc3KLclRNjTSbrqa76XH6Jv0Zs5TZwzzP
+	/Ib5gp3AUe4Q9wnvE34Vb4tvj/8sUZ74OPFXVLEieHBmqqABFkArjnYFjIbv4ChO4HsS
+	Z20ALsHb8vs74oBB+CuiAERPbKSI1OPbQKaTxWQpeZG8ge8FmZc/U5wIqqA6aqYOOou2
+	0U7aTX9Buxk7k8VMYeYxJ/F9i7nK3GJusRybxhrZSexk2MF2sgfwPcz2sn3su1wZN4Fr
+	4OZw3dx2bgezkHufu8pv4nfyffzn/J9QLU4THhZ24Oy8jTL7Y5TlLx+WZCD3RfAQLCTV
+	pA324mwcIq3Qg9K1iGxDvFZAZqKZ2cRMogUoDRfgn1BaD8BG2M48AIcSHzLH4AOUlOXY
+	ZDccYavAye3D2XkMClCKht5QMCuYGfD7MryjPG5U+Q67zWoxm4yGNL1Oq1GrlApR4DmW
+	oQRyary1Le6IvyXC+r11dblS3NuKCa13JbTgUnZHau8tE3FL9Vox656SISy5eETJULJk
+	aLgk0boroCI3x13jdUf+rdrrjpJ5M5ow/FS1N+yODMrhejn8jBzWYNjjwQruGktHtTtC
+	Wtw1kdqujp6alurcHHI2hHAoc3MkxRECldRwBCa2bkQFCxOlEjURm7e6JmL1YhjzGF9N
+	66JI44ymmmq7xxPGNEya2YR95OYsjSCf8KR6kXfRk9EQtLVIodYHmiJMazhCW6S2dNkR
+	s7c6Yt7wieXL6J1QzY67MiPUV9va3lMbCbU8ieBK0RYp1roDY1NnubFZuiXcFCFbhpiQ
+	eFyGnErsJvcEX8syd0ThrfJ29CxrQXBhZlOfLWSTlW8EGpv6rCGrHMnNOWvZVO7B0Z/N
+	vS/3Pskv91g2Jf0/PJ5M//lFybdsGvgt+lNnDgNAJAS8k5HPiHuh3IkXmS2VnPZS6FlY
+	ijjhEyY4zKXIz8QIRZlhfBHON7k10j3rDhsd1UnmWpZV9ymsNnkTqgpj+ZYe7TicKSyv
+	9bp7vsDdusU7+Nm9Ka1DKbxP+wVImdJED8tKhLTeCXdJm6UPR91h8XZI89slzynGvZaa
+	uxIwLkEj8Rwx4Abe2OSJuMOYgNZkztQoKBqbThGyMxwliS1RqHaeRRuVWTAfs3MkUVta
+	jf1jJDcHE7I8GMrLcddiz7WSrLh73D2TF/W4a90dKEysT/Yxo70nnI8IzmpCnGA29hgK
+	24eD7eHwOGwnX2oHq2DxnjC2sGyoBfTlpPwYFirIwc2U8Tc2zWiKdFfbI6HqMM4Ciu/F
+	xqbIRZTccBhLFQ5zihxvXGoZ4rkIeS7MwvziZCtou3RjE+GeHqnNWU1eT+RiT4+9R1pv
+	yXiUwMiE0FBCFKQiEuRR0t2IddHzeuzyHHi8HmQrLGE6GkX6jkShzf7VCJcM8401xyK3
+	JTLCpd8QwmVfB+FxXwvh8mFO70G4AnkulxAe/49DeMI9CFd+NcKhYb6RyfuQ25CMcNU3
+	hPDEr4Nw9ddCuGaY03sQrkWeaySEJ/3jEK67B+HJX43wlGG+kcmpyO0UGeFp3xDC9V8H
+	4YavhfD0YU7vQbgReZ4uITzjH4fwzHsQnvXVCM8e5huZvB+5nS0jPOcbQnju10G46Wsh
+	HB7m9B6E5yHPYQnhbw0jHLJH4G493D1C7cI3rpgfuAtytJQ4PVTRMjw4I3FzIB1pH38M
+	9uEZrF94Cm8zHoGZeNguR78UqQ5pPLkMm5G2Y7nNGJeonB6D7diGGcsasdk790FqPKVc
+	wLgb5knH86946Ffk3cli8HT3tx5uOJEfDgnDoS8D0pWUApR4JsLrJiSNnJUCqXiXpZPD
+	enTT5JDkGOTQaDxtNMF10kFu0E3MFNbA7sWTyjv8av4lfkAICS+IBnGeeEwRwgNFFQD7
+	Hp5tGbwjq0zeW4n5aFwgidoowHtIUhzDzEdRYJEAw8JH8AbWAJiT/Qa2wqFfUFis8+gC
+	SFXszujt/+TO35wYZetv4R1IEkm6TO4nO2QWiJnsw0MYpQ49wwBllNJ9CGPNt1yByorK
+	Cm5rXvZG7QBpJsXES36+P563X2oNr/UgHWd9PLZDZVSuhRrrSBMOlNnG7GP3K48qo4qo
+	ks/E9gSeJ1RUKNBRgsCRHYRh3Qal0qfHNAPH+fRYQKXiGIWS5TmiogQZSRfEKAmHFHi8
+	4BVKhsNYb0iv0ZjNNu5F8qLSqtYc8uyYj7cn1oYblvpYzNpQ0179+9pqC1SakfH6WEWs
+	QldWSXT6sjL86cry5aFMRSuIvWiPsAPhrXkWHJuUwGACMxDOHiq7VVtRISAVFpDmZmgm
+	KpKGo2c8jJcwO38zuOVjary2J3bue+/QZ+g8uj22lll4cyKJxutkVPchLiyGlCjNmfBY
+	qHSeZp5uGV2mWabbQNd6hMmaOh11iq5U1pWGGAbEdDNVpQdEttC+NLXQa8tSGH2ZJmsw
+	K0oWnPZ0LcYhNtyQxtOg/XP94I1BqIxVDurL8mNl0tgKCyauD+ktNk60+ni/YGGzCWcT
+	swlkE7xSefRRHAEpGlsyZnTA7/Xo7goyHrd0lhN4wZT0g4QObKp9aE3VY/HvkhNnGgqf
+	nrYxvuZf6FpCO0PTg/UrSxeGt8T/I7abafSOffqZIke8LDZv2cQF3x/nit3i0g58a+2T
+	4fxAdknL0Z2P/ADlDHHgzYhDGvw0FK4mU3EiiYIxESvzAeHSiIMxqOzquaSJuUJ+xVxR
+	/UqtZJWspoY+QdkZdB+lQWWmplRZqplE59IuKvgWaZSU0aOoqtR6hheNKAksixeCB0Ma
+	pYtR8TE1oTGNS48pr6eB1dC1wpLdoJWQu269UVaGP8t1CURJTJIyojeX4ZXaKY06So71
+	U0KVKgz0Ucps5erzNsTYjQNbuaRfWADNq1aSVc0r0zwK4tF5daNLxuCCMBpMRp13H3GS
+	w+RlYjvPxpsvxedxF7jzt/zstZsTmYW57629FWQ/yC359ejb38X1R/E8D9w6xEUBAXgu
+	pBc0k0kdFyZN3FJukWEdJ5rO4eWKFezEEaryetz+Fv1K/RoDo093GRxGxpNuMrB+fYYv
+	HRQKu5Cuon6HXXT7jC6fiSlMXWq3BUW/L6C0ZgavevbcKzw3Bq/gi+u6ojKGAoQLpExn
+	lqVIWiHNKE3ZksiTojviwniKJNnghXTiIigmZqM3j+QTvyxLXmbSjpdXjV8ct12mvb2d
+	73a2zZnLCYxKn3dDqWbVwqKyDfHyy4xjxbPfLUuPK+mhwvmxzb3F3lXdl2YHaw2etIo5
+	XzxTaI/1oKz48GvASsREjZfRe0QFWSesV6xTbSVPsNwkMpVWM3VsvVil3C5uVb5FLzOX
+	hbdU6ibVEqFDtZ0+wTwhbFc9T/cye4QDqqP0MPOqcEyVijfISlFlFU3KuQKvElklnZBZ
+	k8n5eF4An1qtUrCEUVGG49UcoGJSMYKYgiIlcPwTIZFhbyip4ka3CsgTaqtmJ+oZK8oS
+	6pmyMhvSkJfUOUmNY65AcSJb6/MGt+YNolj1K/B+RIm3maFUPSGU5RiWFxSiQoma7EBI
+	qWdZBpNBrdq6USteQl3EZYsbtZe2ikh3IlNnrD9NUCFjjdexORR3Rm5QoRCT7eFeSbEF
+	UXtRJi23IWYRByxbpcBGcQBnc1Vz80qU3TQFKcYf8SpQamPESKZ9SKYR47X4pvfjJ+LH
+	3493o8jezx6X6OZE9s1bE3A2GJiZ+Ei+uUrFO8kK+HWoNKuAKLW4bh2B4jrtUsUyrVAm
+	6tUKxl4kZCicWrWzPJvmBcvPlNPyoiyfXitwoiMwyuyIkp6Q1+x0CQFnnoo6x6gqhIoK
+	h0EIZvVm2CbYg44pqYFS6/gJPyL78MLuLNkLstqT9J2k9q7HBlBgobJyUHpR++kQbElg
+	8wbzBiU1iHIsa8LMkrHGUUCsPlKS6gFLut0DJrfBQzyjYCz1gM1p9hCjBx38DpRNtBXS
+	vfOjjz6KSr45w1SMinI8SSGphBd4IymR1KbfOwpVpHcCKZaWgs6AhbCLFOIdFfAHJM8/
+	ZnTJ2DSSsqphQXivp6Oos61wFumfYFQ/vuGpco+yl/vLy+e71ph96nRdVo6/OcukGPuz
+	b+85/8a+nnfn5Uw+vMvo4FM0jvwlZLmYY8l9YNa0rFk/OVhXtz+2zzGKYbao+SpvqG7Z
+	D7fteSWNXJf0B95sMu+xDWADOxwJ5R+xkv2WXvGYhZki6g4aGMbAO22CxonaVbDbzdqA
+	njABqrM5lQGz1YGfe4TTnlUbh9BFbCvqB8vKpP0kiS4GtIMylKPBKvrURqUfUtK0fqLX
+	pWoFK8Y4YDySQDMqk8YPqXp0FBbeT1jCe6Q9R4JVAjbpZsvYgsmMmkOCEjWmhGCxBB0d
+	o4VigV79nfmkdtWmH0wp2PbsisetJ9P/dO7nN4n+ioNtiHyw8PHezu8f+mj72l9cIsW/
+	x2vZcbhcoTRxjRnk3kRrzAlrQ0VjUyalzE05wh61cz7RQFOdWhCdTiFNSZ1mFZeXlqcN
+	6vQ2lypgs6a7tnpWVd09/Nj164BShT8dWgny0G0Wh0IJhFhUODYHOmClflDaRT8OEH+y
+	xOilgcgCwhsBdaOuWOcdIw0LxozWF//52UMbDx3esO0o6ZlVMP7ES5U/ePh0/Obn/0EW
+	fPrB2z/9l/f+lY4dnT6VOm9O2LOwieTe/COZi+utLnGNteFNsQO/KviIOrR+n/i87YiL
+	4VJoKmcwpuhTjYaQOmQQgzYyVfU6c5n8hLls/1D8peKq60Pvp+ZPvarLust6+oDIeTJS
+	D5icGWW8IJg8ToegdJpUPmGf44jjjOMDB+szpfocnFWpFnQpgVRngLMFMvKEgNXqD1zx
+	HG5OAhS7LtscV2KyBSUbUvnNw3KC+4d28I4JUgteVElo3BKO5V1+nVavTdMatCyv9o2y
+	Z/jRinf6SbpTYRb8oDKm+IkmxWvzYBKHjmhBudJo0ZGWZXJdymszKzvrUbKyGVaiHSbt
+	PyajJx1X4lhZgHBd8oi2DoVI3pJG8QKh/VdLS/Ta259zz+x7anaB4ZQwvXDm+vtmvhX/
+	I7H8J3GpMqec+HYvR7zspAfvn7F8yksvX2oumVS+K6/RoUXNiIYqqYr719Q+drqHSB+7
+	cU7Gx8uZT3FOXJCLX4nOhOpLDJPFyYomMazYpj5q73UeDRzOPmtX4a5hGhVMGVCOQjXH
+	8kGnVal3KlPzhLw8zsHkmfJyg5ytQJ0S0EzwBxzW/IK7BPHGYJmEdOz6F4jnHT1XOSjD
+	mxTJHG+mLV2ly/Bp/d50vx8ybejoVCkeSE1Ra3zOUX4SsAdxPar1HhnFoVWIcMrSKkno
+	mGId2nueUf5AMUIpwShrsAwJQZAVnbw6Ue0R+u35xWMOV6yIv33is5QzmsD4x98N+ZmS
+	/Rtfi98iwhuk+pXvXKj17f72m9Nz4u+zVRO8E7feLnqn69rBV+sCFc/O+fXMxr+gUaQh
+	efFDF/sWHPjh+ZMLN9Nc2f7ZjIeQcnl3EaAk5BA+YdEA4BmlAndfxD8oMKh4FMc8bclV
+	WlE/EKsYkI17lLyKynrUTmm41HTFRu/mM/iwWbeucuelfyIQ2I6OdCZhIBjCsySj5LBR
+	bBNPNCx3V5NoBybNwMpkY9v7+5PHGmwD+eN97CTww5ZQuSAKKXyqWTSnmFMDYgCXSp11
+	jmqJSu31KW1Or1VJWbPP4zQ7NWhW8HaHj0lTZmKfuiB+iCZ9tqD0/T2EuiTPh5NjDWRG
+	ieb0l0OLXdfeGLwRG2IGzy14cBnENZW0yiTrHprTio24E0nbj/nOLoTmJ04Xj6anTrLr
+	5dDmvtDo8MruhpyMipfaP2zIOvdg/bLnz9iCKxYf6Wfz90/PGF+ZUTtn1guzd8bG0k8f
+	bNx5OLaLnussmvriu7G3pH0Fx80MopxbcWeZHyo8w1/mKcsb+IChi18tcAY1NVi0Tg6H
+	aVEpbYLNBuqgwuYgeZagFax23OL5e0Ymq46kNOO4BnVlZSQ5ICIN6a6hSCPAtZxCcDxk
+	8/FpxzquN+accRZsCgWnlOba+8kR5H/+zO/NfSk2g77cVrFIY6oas3Jp7F1kFme6PPFL
+	1oP7oRq/jVrhmVDxfnGv9nnTq2yveFh71BQV3xI/YD9J+S+DepzIOy2C2qlXWQWr1UgD
+	qTa7ImC02uxRosBdcUjryRbHlzuivCPk4PWEX5WmQA2lo34imDHEaTCkNKj9QLToiCbc
+	BJkUdGQdJjnS5pehl89eOEe48+lRW1G0RZIb32+3FEx749W9e1/GD9C343/5dfw20f+B
+	X01SD++d/9ztvuPXmWvxz+I34rH4ayT7NhomIS4p4/RZlE8dTA/5A4xfM5aZxLIpopam
+	KHQKdUCUpkinFG1pRNr3wKpPi5IanJpNslKXzkMNWjwBVdZXDsQGUN8MnSNlSZOmBc18
+	aa+WxGv7ceMrD3IWp9au3fYsitHZkoOUucDQk6ti+6X1Zk58ThXcPER+5g81ecqLKSRK
+	KkM+1lRmZvgUpc6GSwG/8AbBmGJMZVwMZW6brFbbbc+SIQsk1lw2IB1EtMklkC8tgFjF
+	oDZ2XV6YuMZ1BklVDdlc/jG4xxb3vn78uN9YqEk3uCYGNs3btYubF//F7lhNaZqK0J0K
+	8dEl9NJuWdcY45Nl3S1Jxr+GHuoxbrMcsTACb+ZL9XX6Jv0SYS2zVthh2I+3VvuN+0z7
+	zL3Qa9LWwVTjJPPbRraa+wlHt3KH4TA5wvWauYxMzmI0m1BfGdWqVKeYIgmSyY6jxJk5
+	aTZaTqqfNqE8XfEskdDGq4n665bkeWHorJBcEHiOKMI7FjyJVUj443EhpDcawWTq1JvN
+	Fo6QTrxNsuCFhXYjWvPoieiT5pWFBSuJdCNRzDNUoDxan4Ex0oZYMnYCGYvmPcN4Lvsf
+	b6t6ofsFfzA9P0tblK/lJqTEV7+DBzg2f0l8V/yz1+KL+3nxFQ3vsYjPZbANt/czj0nr
+	X34S7fit/2890s0cg/9XQLsEvxGPgXFQDbXyPwim4H8Epsv/YZD+KTAXHsCSBEsm7+x4
+	vB+Dpjl14dn3Z9e1L+9qX710Yatc4k4vUvkOpHVI25BQsPBfGoD/xQBAxQQfIn2K9Fds
+	VkSyIGUilSLVITUhdSCtQ9qGtD8x9GAdGA4TtEDujeePiN83Il41Il4/Ij5zRHzuiLg0
+	yrv7XzgivmhEXMb9Ln6XjMhfOiIufbu/u335P4B31X9oRP7DI+KrRsTl//DdVX+9lP//
+	kHV4XQplbmRzdHJlYW0KZW5kb2JqCjYxIDAgb2JqCjY3NzUKZW5kb2JqCjYyIDAgb2Jq
+	Cjw8IC9UeXBlIC9Gb250RGVzY3JpcHRvciAvQXNjZW50IDc3MCAvQ2FwSGVpZ2h0IDcx
+	NyAvRGVzY2VudCAtMjMwIC9GbGFncyAzMgovRm9udEJCb3ggWy05NTEgLTQ4MSAxNDQ1
+	IDExMjJdIC9Gb250TmFtZSAvWFZIWVRVK0hlbHZldGljYSAvSXRhbGljQW5nbGUgMAov
+	U3RlbVYgMCAvTWF4V2lkdGggMTUwMCAvWEhlaWdodCA2MzcgL0ZvbnRGaWxlMiA2MCAw
+	IFIgPj4KZW5kb2JqCjYzIDAgb2JqClsgMjc4IDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAw
+	IDAgMCAyNzggMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDY2Nwo2Njcg
+	MCAwIDAgMCAwIDAgMCAwIDAgMCA4MzMgMCAwIDAgMCA3MjIgMCAwIDAgMCA5NDQgMCAw
+	IDAgMCAwIDAgMCAwIDAgNTU2CjAgNTAwIDU1NiA1NTYgMCA1NTYgMCAyMjIgMCAwIDIy
+	MiA4MzMgNTU2IDU1NiAwIDAgMzMzIDAgMjc4IDAgMCAwIDAgNTAwIF0KZW5kb2JqCjIz
+	IDAgb2JqCjw8IC9UeXBlIC9Gb250IC9TdWJ0eXBlIC9UcnVlVHlwZSAvQmFzZUZvbnQg
+	L1hWSFlUVStIZWx2ZXRpY2EgL0ZvbnREZXNjcmlwdG9yCjYyIDAgUiAvV2lkdGhzIDYz
+	IDAgUiAvRmlyc3RDaGFyIDMyIC9MYXN0Q2hhciAxMjEgL0VuY29kaW5nIC9NYWNSb21h
+	bkVuY29kaW5nCj4+CmVuZG9iago2NCAwIG9iago8PCAvTGVuZ3RoIDY1IDAgUiAvTGVu
+	Z3RoMSAxMTg5MiAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAHdent4U1W2
+	+NrnnZOkTdK82zRJkzZ9pA9KHwQKTUtbCm2gFAotttICZQoDCojIY2AQ1ELBEZ1RELnj
+	qDiDKE4oDgYZuFwGFRXu9YFXBdRxRMXRDup0RKU5+a1zUjrQz28+v+/6zR+/nKyzn2fv
+	tddae6211znLl93aCVpYDzQ0zOpYMh+Un98KQLXOXdyxJF5OqgcgO+auWO6Kl9lMAPqu
+	+Ut+sjheFsIAovcni1YNPm/yApgXdXV2zIu3wwCmJV1YES+TIky9XYuXr4yXDWcwXbno
+	5rmD7cYLWB63uGPl4PxwHsuumzoWd8b753yBaeaSm29ZPljehmn7kmWdg/1JM+L3P0Cw
+	NhUWggoWgQAU6PBqBeAvil5gsFVuR6jIbfrN7MSyf4BeUIZ71Je3Xs684P7jt5fPD/jU
+	61Q12E+l9Jcb8BkuS8oC0BBsP6deN9Qit8q/1Ag05kSgFmEcQhFCds5+Ifgc2QbGtv6g
+	ijgZUDvftv3tKMlD+n+s3MMkL6jRgmruxjLn3I0ba7MqVKQOShkCTlINXiWt6vU+6YyQ
+	cb1eDyZj4wnVW+rAEgRVpV5ntHSOc6A0IpBgsvMb7y+dlxG+9pY7/+Ed4XwN+71aOsF5
+	ugLbe52vZEcoTF72RhgSTHSe9N7u/ENplvOZ0jHOXh/W9Tr3V2By0Lm79HbnY3coNY9m
+	K8kj3gjZ2ev8jZwcdD6M4z+wUWm4P/7ghniy5A5lopsPKMlNByLUkwedi70Zzjn4IAmq
+	nW3eRc5Wb8A5vSJC0nudIfmxg85632lnnTx1rzMYn6gkPnqxV8G4MD6t33vYmRmfIU3u
+	HUxyurz1TgeO7//NA06/90ZnRXaE7Hm2NjPbW+t7oCRC+pU55AQRlZOb4slc3xHyO5gA
+	WWQWpJMHD9RmIc5kW69zIyY7D9RmlqZH6ItBg/OAr9Z3B0IJQjpCU4RMD/r57fw8vokf
+	yefwWXwG7+ZT+WTeKBgEnZAgaARREAROYARKAMEYif05mCNLkZHTyQnHyHdGyesoOY83
+	vANFBAomQYSDO80ryq3lhnH6QE3V99zalcr2qpx//qz/zOZYiSP8QN205vBeR0u4UM7E
+	HC3XtP9fsp2V+HRd46oDjas+m1Hd6alu91R3IrSHt6zosobXz3G59n+2Sm5whemM9jlz
+	u+S0ozO8ytNZFf7MU+Xa36g8N6x5htzc6KnaDzOqpzfvnxHsrOptDDZWezqqWg40VNdO
+	vm6uzUNz1VZ/z1zV8mC18lwNynPD5posNzfIc02W55osz9UQbFDmysmpXjCtEthjoGeP
+	Qy67HRxMJTgAYmcRzsmpNC12iX0VxFg01kejZiNpMrx/hRjh98DDs7AOtc3rsJeowAN9
+	pBDeIQ6SDW+DBOfgL2CHLfAbvFfDRfI1aplPSSb2KYEN8Gt4OLYElkA5XhcJCyYYBZ/G
+	1sROxr6FSuiBE4QnScQROwT50I3XTthFNNSc2H6wQj3cButxjJfgbKw39lccvwQ+InqS
+	z4yJvYsCxmJNADbDXniWuImHZJMbYh9hvRVxbIW9sVBsBT53CXvlw2RYg7N9QJwkg+SQ
+	neQ9ui+2PvYLXFsKtjXBXLwWw+2wA3bBPqXXHCaFNeH4VVCHbb+AU3ARvkKFm0UqyUrq
+	Tfqv9BfMGGZn7ATi0YTztcPDhEaqeEkTmUeWkH3kGfIn8jVVSnXQAfpNZgnzCOLWBJvg
+	ETgCL8Ib8C58Bn3wHUQJgziNI1PIGvIf+NxfqJFUG7WW2kqdpS7RI+j3GJ7Zwt7JHo4x
+	sTdj3yHOqZANY3CnT4Vm6MRrPtwEt8LP4Q7Cw3bYD39CbN+H94lIdCSfjCATyHRyA/kp
+	WQX3kt3kOXKeXCAfk08RuyTKSXmofGoFzreB2kzto3qpQ1QfraeX02vpY/R79NeMiWlj
+	juH1PpvLLudSuDp+qvQr6f1YbmxbbCfyxYyXF7IgF8YRBqm4GO5ATm5Gmu2C3fAkPA29
+	0Bu7QgJwAl5DvD6AS3AZOZaCl5sUklGkgUxFDBeRxeTnZAdiuJccRCwPk8PwFnmLXMFL
+	AhulonKpG6gOahVeO2EH9YZCHw3tpjPpXLqOnhb7kt5H76e/YtKZWcxSZg3Tw+xgHmZT
+	2LHsTHYWu4S9nz3IvsL+L3uJ7eccXDe3m3uGe4MX+CJ+By+RNMTFRdLhGTiKUvcAvQTL
+	XhhP7kCuzoBTKL198DxcgW/hGPyOOECiZW5mxB6BSGwTcvMI/IH+GZTBvdQvqUmxcnoP
+	rSKFscs4VgHy6+oFweysTF9GuteT5nY5Ux0pyXab1WI2GZMMel1iglajFlUCz7EMTRHw
+	V3tq2l3hjPYwk+Gprc2Vy54OrOi4pqI97MKqmuv7hF3ycx3YdF3PIPacP6xnMN4zONST
+	6FxlUJbrd1V7XOHTVR5XhMya2oz5u6s8La5wn5IPKfltSl6LebcbH3BVW7uqXGHS7qoO
+	16zo6qlur8r1k0NBNAZirh8OAQRBLQ8chvEda1G5wni5R3XY7qmqDts8mMc2Or26Y164
+	YWpzdVWy292S6w+T8XM9c8LgqQwn5gw+Lj+HSjC9sRnnzvUvCCP+sEUzzzNvSyQIc9rl
+	XEdrc5juaAlT7fIc+pywxVMVtqz+yPrP4tVc9dZrGsNUek1HZ09NONi+BYkuF9vlUsdW
+	LNVNc+Gw1J0tzWFyJyInI6HgHl9F3Eykty90hVWeSk9Xz8J2pDk0NPfag/ZqT3tVSxga
+	m3ttQZtSyPUfsq4b40aiHMqtyK2Q0zFu67p4+snGeP3rx+TUuu7EnzGtaxyiC5Hn9kxE
+	NMOuuTgJ0gJxHSXfOkdBz9xRSD78tRBc5QLEZ3yYQlGi08Ns+sSO8Pppg2h0dFUNIrew
+	qldlsyt2qbIF+7f36EYjA7G/zuPq+QcgZz19n19f0zFYw6Xr/gFyo8z/IREKk46r+RWy
+	/UxHk9Rl9XTJ7FuhsBrLHmv1NRVYlu1WLjqc/roIqBqa9xPyi5YIid0ZgSrHITQw9Owb
+	sTlHFrgFVTgdFvx+rMh2Yw4xqMGJamTJcPW4eibO63HVuLpQpJh0JcWGzp6WfCTYtGYk
+	C0xvdoeDLclD2c6WltE4Tp48Dj6C3XtacISFgyNgqlTlR7FTvr8OV5XR0Dy1Oby+Kjkc
+	rGpBoqMQH2toDh9D+W1pwV4FQ5gixmsXWAdxHoE4F2Rje2F8FHRr1uMQLT098pjTmj3u
+	8LGenuQeedfFy+ghD68IDlZEQO4iUzhC1jfgs5h43MkKyd0eN6LVItN0JArwVQFCt/5f
+	U7h4CG98sgSxLVYoXPojUXjUD6Fw4AdRePQQptdReAziPFqmcNm/j8Jjr6PwuH9N4fIh
+	vBHJIGJbrlC44keicOUPofD4H0ThqiFMr6NwNeJcJVO45t9H4QnXUbj2X1N44hDeiOQk
+	xHaiQuG6H4nC9T+EwqEfROHJQ5heR+EpiPNkmcIN/z4KT72Owo3/msLThvBGJKcjttMU
+	Cjf9SBSe8UMoPPMHUbh5CNPrKNyCODfLFJ41ROFgchiu1cPrh6ld+NEV8w3XkJx9EXZS
+	AQBMixBa2RnwOPMh7OIC0KSke2E71j/G3AJjECZgXTmm+ZhWInTjs5uxvAHTLbwD1st1
+	g21raQdswLZKai+YsG4tjpmAZTmfgn5aPKaEgSHgSA+WXejt4kH+//iTwwE0AoOnJW5o
+	LB5jWld/qquZ701FrFUjTlpMEyARo2AAejBAEhjxTGnGkgXPfTY86wEkI8gr+f/lhyd1
+	/BXhdZwUkflkB2WngtQLdAl9lqllHmVL2DD7HZfHneAu8Fv580KhsE04q2pX7VVJYpl4
+	Rl2CT1N4sgY8Bx1HLvAwLuhmOQeeLxjeQYPIMg6apuwqjncQsAmqve5FZRh8mdxfFoqW
+	TdZ9XRbSRcugvCxaJsOIgpF6t96HsJN5LDJwmj3+3bgI03jlaRlLGrEEdg/OQ4GIHDsf
+	/GkXRXxspjiKK1XVcl3iSnETs4nbSd/P7OD20o8ze7gIiYgnyUnxbfpt0UR4jqNAUKnw
+	JhKepYyimG7AopFl0w3YxgvZclxJVOMBiVOJNCuotRaLXS0yHBshxl4VTWFyULRpOm9d
+	Zs1ZMVnXbw1FAwH86wM2jJ1UfWzNh3JLWai8rMwQCOTjktjuvJy1ujp04ZhjyWHmREt3
+	nnWwgsYK+kSLHnviv1tXVsYjjCggbdBG3Go8wLrxAOomVD5ZEXmStFKi1Ds7+sF86Sj1
+	HJ5Xq8jU78aRfOk1hSKtsbfYNewlPL87YXkwa6b4K/5XAn0D1ZLc7JjP3EY2s08Ye5ln
+	xReYF9VnqXPGd63vJ39j1VkiRB302AXBrqlw0rShwq5ymkstQqkzlbe7E0tTbS73g+59
+	MxSehfqQYyF9oO9MHy6zr7yszxDI1/XFMTaUlrhdFrPFneHL8KRRJqN5ZGFpSambA7fL
+	l6Enrf/zDDGT5U/N5qVTqfnTH99z/PSvH23Kd5IRmdKzUkw6fvAgtY2Z+drB/s09C0va
+	pS+/+ebywsCyL6XXT50mnbQdNcXjyH8KV6uGfDl6/BxudxXUYfSY00WAvArPofwJWPEc
+	9gAlpVEr1OUUjCBulKnBi3lvoJ86FS2iC648xgSYI9KLMZDulC7jwDjHLlQk+9ljOHBp
+	0MJnM4yKzgZKJXAriF1NC+kqm6iOkJQD7sYn4zRRxDh0AcrLo0iN6IiCpKGZdjGmqIPq
+	jq6S/ps9JkWlfTGIPoDS2xR7h/09exHSMJp0Z7DupHBO+M7+rZvJojLdgaQ6a4tph/sF
+	23HHNypVkmhIO+NMyE5MNDAVHidtEMQKi8qTZEgyaOk0gFJPctpTiTp7Ol+abPOmR8jP
+	D7j3rbqGW6f7kV96gyWQPzZfFs6+8jjbojqsxapBcYszTa9DpiHPit16j4/jOY/MOZ3M
+	WLAQZo1nU31b70ff/PqhFyzSk9T8U86WCat7pXOH//T886SK2EiTLbqS/np7mVv6u/SV
+	9MVfDtz79cCnkQU5da+cInPI/Lfflj58k3wl7+U4nfciyVnICiYCRVWwAm3nqXSwcfz1
+	9J2s+xjKQ9Hyq5TdRYqos1e+Yo9fmSBdVsbajm8cMnEsAxwLblMBLwgqVm8WbKos8Ak5
+	Kq8+21DKFwtlqlGGhdCpXwW36jfDXfqd8IB+D/xW/yJcFr5RpbCCqDILVhXDG+y8XbQY
+	kD36fMNYvlwsN6w2HFIdNLxoSEjkE0VKTDToVQKwCTxFG0SeTtADlSDQghG1BcXQPsqQ
+	qE3wJdqSGpEVqCVQ19l0589bo2U6RUugwkN9h0whuPkx0QdGFMDSNoJ/WXiKSopx8xvN
+	JllkCbOYHJY+oKRPpTelzyjpA3KMaGTFSH+U81D2lRzmzeyHcgaSkRyrZF38GO6RpUgL
+	EaNCzcFslyfZamJ9SRnZBMNK2VmUzyE4XGlJnCWNK7Ukz9TZ/eBLz7Tl+CMkFYV6cKMP
+	CvWJ6AlEUB8IIMLl8maPBvQWxJXo3bi3i4twp5eYLanEZOT4VAxlGXH/m2QFkE/yiEfZ
+	B+RV0tZV1NpSOO/c70YXjFq4en6ToPFL+xI4DaGouZuk49Ib1BvMcWm5Nftnd+XZozVV
+	ozbNXPBKdtb2h+Z2egPJ6SNSx1VsvvvG6FFcFQ1jYu8xo5jZaKkDMBruCU4ZQxWXrCKb
+	CfN2Ksn4+8fZn3gStCxGcJPsORgHYzLyMvKy5QomWZ2WbPaPdvLZotpfqB6dFIJQ3uji
+	7HEZ9jJ7KDlXCBXbxpT9kdjADbXkaRjcRP2K0rugD5z+6KPB/RM9HZB3FCpt5B9yDyFn
+	cB8lkESCG0fRfiWlvhKZSqgOeY53Y95diNE4vREphmTKI8oWS8soLkI9mUS9l1xaEJzl
+	q5w6uvUhet+UtLFtszqzU0WpTzVhKUk6sGULRaekSC9rRXpMqHX5r/7roabHl1AGvUml
+	0Vl8jRMrFt1zSUy0l44fWZhefk/rtgkTnpc0RZNGZWqz3aPTg7nFTzz00qwRJiK/TEQ5
+	mRA7yxQhHR1oMW4KVj9o3mOmulPIRFOzocuwUlxliJheTDppEqwUxzheZ7ypdt6cIGp0
+	z2q8RnWqriTRCSWpFofdJZRYbE5Xt7t28jVaRx+I9is2og+FJ4AaR0llGi1F26YoG5lI
+	lri6QYK5XVSxDkYWMhZC6wR3Qee24pSUkXfPm64iHnH6XdK30rffEMOXpwlrlZKpw2NH
+	VN5Tv27lxE2LZmxYfpiM+ha1z6jIp2S3srZylJFO1OE6XN2UoP+iBi2/yUHpaLB4dTwn
+	Oryi2kTbk5yck/Yxdqe9RGtLde5w11Zfs4Ro/wWUfUVh9pXrcRMY5E3aBmaLvCuLE4gn
+	DWSUDfF9kKbwnFq9s4C4pc/G7lr+n9IVQt56dl3nuMa1t962immdGaKE74LbO5pJ8VfE
+	QoIDy5655+SMoiNbt/8B5To/dp4ZjfxAc4l24cngxBqh27idPIi+B1GxnI6117E1uomu
+	u8idid1OkTbTliRzkqVWqDfXWybaW82tlln28+Qc86njE9dll24SqdFtYjfqGHRZ7g+O
+	nJIwO+HmBDohIZnzprl5i8GfrDbTVBpdYlmTltquWa+hNHYv5Uy4P9Xm8SIpBrkZvYAm
+	vw1t/oW+/Dg5TsftRxtaurjKApRt3O2oCPDi3XgbNPxoP9JAr4MxhLy6OIEc5tfcsOns
+	hGCSmoqauY4x05pLUy3Eo561deBV6ThxfmSkl/9s4dJbP5t/U8f6urt3V2YVJhd0zHuY
+	aFCZJOMrYPzRUClVMjcinbT45qUAZgV1Pam4CVlvQT5v4NK13qwIKQ+6Ulx+a2IB5TQ4
+	030F/iR7YcodybmqEr9tROE1bI5vbVlWL+DOjp4u7wvI1lHWxqTNe3XnKmJqwMWhVTSi
+	pKZ5fVcXOVbe6+jsFBcZRpZSR3o23vRAINU1+gH12K4gMU1YLf32NembBFKiSc5bvLMo
+	LSu/adPrV75674a/bn/8oUfvrrtp9qQeepkt55b/uPL1Gz+N7H6s0Oz7SeWumhpPBfEN
+	/J3UyccatJXd6JPcyB7Bc0h5MJ2lfFRzQlcCY7QYQOO18DpeFEpYuy1J59PbrLaj7oZB
+	MY4r8T5Fd6MEKxpK0dayiZGdNE4xMPpxZCQ9/vHiXKP0bqpv8dJbpQskZdxjs5gba2rH
+	3n5fdD21vbmkfvvWaC97JHp5dp2ME4XvYIDsZV9BjvAwJphWD/WkFVrxddN+VLUcL6rQ
+	FALnIzw6/b1XUVKcftlNRm+pPISOo+zooomTYa/0Pu4cBRh8dSfdduWovPYNuPbFuHY1
+	fBHsDVI17BnqI4pJRFvdxG5m7xF+oXqefVl4h39fOK9SC5yVy6fzmUw2lyulR3H1dC3X
+	RrdwC+kF3EpmE7Odvp9/gv49s5fbwx+kI8wL9EuMvY6bxM9gNzEbhRPsSeEd+h3mXf6s
+	oGZVKoZlObUa30vzmMX3JiLloulXDOgTqvCEwHCUSmRoTuTxBMnZtUT0gdqlLlAH1Yza
+	ptF2uxs+lPXJQJty1Pkbrlk2+rLRsAS6Q3k5jHIuWN1yAgxYFwgkdusE+QiAjFrahnsL
+	HUniVqEnwOvdG4iVzCUd0kayVdojXVkhXWSPDHxMdkqzo/PI62ukJ2RabcGbfD6iIT2Y
+	RAERWZkJPmJj2CEWhKKDHgj6U1kE6b5H+pA48CF8fj2uYxczC9+2Ha8IQSlyGV+/492M
+	kI6wAE/HC/EcvArT1ZhuxrQH0wcxfRDTJxAOIXyC3ErA/m58c0fjeUSL7/By8Qwt39NR
+	Xpw4qgO9NQG9lHyUags+w+EbWBVJxCf0EAIj5lIxPuAAH6Y2yIN84sHxGvA9cFxHR0/o
+	+vsC/VdXg/5UeVmoD51axT/BExQqarxM9KCsowW4KvbxrNuEBnkkGmSLnLL3bA3k6URK
+	Om/MmL8i1yJ9YPQuWJ1tQYE0FedPu2NtaJxr1LTmRcysUTWBaaULo1Opg+My6+cUTYze
+	Rm3u8E+ZktsSXcIEH27yBktHNrTn5uL65X3bgbrKjCusC+ayxETSSSlpVnepOWLQcSov
+	KswERrSwJZZEym7Tyz7jdTv4xOCBC9UTyk5feWBwF3/vWnx0z1vSeUv2intLUnAPJ5WO
+	aO5ewLTuPx1No7bPyJu+pqIz2osoTk+vlBUL6lL0AXYxncgtOcIRCmZaaCJoNmk26WiL
+	1po4X0uzXquRV3sT1FarQJVY7HahRG+z2SNkxYEhE6H4R6g0FeeoTD4NLoNlSwfVp2IV
+	vXgEhOIi+W4i1Gd33bV2bXf3WipP+lz6BK/PiRHNt40Yo2+81Lt79/79u3f3zpeeJE1f
+	fE5mSb/9nAoiLddK05idKJtalIpJwSxLkiCm2Cmvi7dzojdJbUsQtFZtic6exjmTnVaf
+	zeZO2+FuuGrF+mUzFsITDxp0+QiE6A4adMU5G/REig2yufKk+TLkEERcQOjlt9z+0OjU
+	zrLG29Y6iEqKntowIz9X+pjo84pmb6QePv7LySuPhnIjD1IB6WPpkvRn6fUKb3X0JHvp
+	kQlZE5HMcR1GXWFaMaI06RDQZMIBKlGLoYkJQVsSr+U0oosqoIIUbZJPDwlqn8ZmNEXI
+	vAPuhvlXZf2MsmlDbbLeRNzPyKoTHRE0u+haKlpckWbqXXVScrb2qTFuPCboKkc0rGda
+	CZHO09SS8o3Ry0zl0cWZ42WcKOT9OXyX3QE54Id1wSkqHZdh09Iqxq1W14kT1RPcVa7a
+	rLdowZHm0oiMOYcx2/1+A8/4M9V+f6JJdDnMoTTelMuH0u15GnCEEnMhlGPLzbvGE+zH
+	I4NCd+UMikESPEEocYPoad1pZaPe2HYjaSOKy6C4UenoGhYX4bZkBuMIipOobGQjnkYz
+	igmZq0otvmf63MxMKXaovr7vrVOEJEkfcrb8pW1TsrNje5umfzkgxf6BL/Zb612BwsIC
+	m21sXnXV+u3vPHay1DV6tG+E2TIqc2rjmkdPv7OHxo1AwBT7K7WS7cJ9Oumgzp/o1Pj1
+	z5GlwJDWoJmHVo5wVmRNItfPqHxwH/LJGiEJB9ztMnvOlF2IlvWXyfz5Wwh3aRR3KfoT
+	eFgtlmNZI00evRwJKSk18RyuTW/aQez796fN1DoSul+eVEAvfoUUSK++Ej023k3Imywf
+	GjGfeliW99hFpgl1hxx3rA/miWa7Ods8yjyD7+Q5O1oczpygFVn0xe1a0We3qu0ppMRq
+	S075p/mX96UhEIqeUWgue+Go8pHaeP5QPLRiWcbRj+VlV1ZGLZ08YvYtu68EP52QPmNc
+	5vFrp381PZ98zlRGb27Ln7YiuICaeuXoTrYwqcz/dPth6l4H0i4BbYYbv/nRQED+ig8i
+	wGJwRkCQgzQ0gpj/HK6HxaCqISBHaK7mNIM5OTqTLAe7lIhXEtVN3L/dS7KkE9K5J/dJ
+	b0v/TQr3MpUDl2j9laO0feBjzCsxBApM0gSmAWkkR2rfCS7xiTPE+eL94m7xDRGNNeG4
+	FF6vzeVd2rH8CG0d38bLmvc2fpVWa0ks0XarNql3qCNqzmjUCFrKpdH4DGq1yPGUUxB8
+	GBeUs1rRpFFj9IdXgZPyJzl1iUbejMKQoFVrIkRzABtETIOapPsEW6fJ/ERcKlZM7g9d
+	sA7g2UeGwdAgbt7QhegFNFRKdBDJQTA4yKIX0Lhy9fMjBwODcl4OC+TLzFqKboCTmEtK
+	xxFfnEoU+psZPrLfm11vt+Uw0hIy9m8fYBSwZ9G6Ixl5eWTDaxQlGvSLNMyygfO098qr
+	0sv3E5ozynseI9fMTPY11PwpMDc4eoo4W6R4L+cUvfi9jFd0Yh5D9EZ9qyWBM9BiKq6T
+	+EDXwxm0viSn9T6TzZGKCxx0L/tR8M9ceC9ugWXRV6K4KPx95X398ulA8e1QTZlkNcVZ
+	TPJewMBS8Uj5wDuSHkPQSknREocxI3l8KnX4sHTh4V2h6jNybIN9jaEuEjJpivGlgXvp
+	m1+qebqpIa635DvE5C+Tvu+XipU0+hkZkImeRLZyRijG76xq8IumWvxYsA6//JoMU9CP
+	mAqNMA2/mZoBM/FLp1n4ldV/KQMS9EuIkuMw+g+TKqqrx0/Nqe1ctKJz+YK5HbmVNy+a
+	J+uMq7/1mNmKgHFDeArhjwinEM4jfI4wgJ01CCkIfoQyhHqEVoRFCD9D2IqwC+EphD8i
+	nEI4j/A5wgAyToOQguBHKEOojw3+cHwYyhO0jNeXK4aVFdV/Tf/qYe01w8oThpXrh5VD
+	w8qNw8odw8pzh5WRkNfhr/D0Gvx+Mqy9a1h5wbDyT4eVFw0rK99jXzP+TcPabx5WXjKs
+	vGxY+ZZh5eXDyrcOK982rIwBu2vXf4WSy/8PQiA9pQplbmRzdHJlYW0KZW5kb2JqCjY1
+	IDAgb2JqCjc3NDEKZW5kb2JqCjY2IDAgb2JqCjw8IC9UeXBlIC9Gb250RGVzY3JpcHRv
+	ciAvQXNjZW50IDc3MCAvQ2FwSGVpZ2h0IDcyMCAvRGVzY2VudCAtMjMwIC9GbGFncyAz
+	MgovRm9udEJCb3ggWy0xMDE4IC00ODEgMTQzNiAxMTU5XSAvRm9udE5hbWUgL0pBRUVD
+	UStIZWx2ZXRpY2EtQm9sZCAvSXRhbGljQW5nbGUKMCAvU3RlbVYgMCAvTWF4V2lkdGgg
+	MTUwMCAvWEhlaWdodCA2NDQgL0ZvbnRGaWxlMiA2NCAwIFIgPj4KZW5kb2JqCjY3IDAg
+	b2JqClsgMjc4IDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAw
+	IDAgMCAwIDAgMCAwIDAgMCAwIDAgMCA3MjIKMCA3MjIgMCA2NjcgNjExIDc3OCAwIDAg
+	MCAwIDYxMSA4MzMgMCAwIDAgMCA3MjIgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMAow
+	IDU1NiAwIDU1NiA2MTEgNTU2IDAgNjExIDYxMSAyNzggMCA1NTYgMjc4IDg4OSA2MTEg
+	NjExIDYxMSAwIDM4OSA1NTYgMzMzCjYxMSAwIDc3OCAwIDU1NiAwIDAgMCAwIDAgMCAw
+	IDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAKMCAwIDAg
+	MCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAw
+	IDAgMCAwIDAgMCAwIDAgMAowIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAg
+	MCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgNjExCl0KZW5kb2JqCjE3
+	IDAgb2JqCjw8IC9UeXBlIC9Gb250IC9TdWJ0eXBlIC9UcnVlVHlwZSAvQmFzZUZvbnQg
+	L0pBRUVDUStIZWx2ZXRpY2EtQm9sZCAvRm9udERlc2NyaXB0b3IKNjYgMCBSIC9XaWR0
+	aHMgNjcgMCBSIC9GaXJzdENoYXIgMzIgL0xhc3RDaGFyIDIyMyAvRW5jb2RpbmcgL01h
+	Y1JvbWFuRW5jb2RpbmcKPj4KZW5kb2JqCjY4IDAgb2JqCihNYWMgT1MgWCAxMC42Ljgg
+	UXVhcnR6IFBERkNvbnRleHQpCmVuZG9iago2OSAwIG9iagooRDoyMDExMTEyOTE3MTM1
+	MVowMCcwMCcpCmVuZG9iagoxIDAgb2JqCjw8IC9Qcm9kdWNlciA2OCAwIFIgL0NyZWF0
+	aW9uRGF0ZSA2OSAwIFIgL01vZERhdGUgNjkgMCBSID4+CmVuZG9iagp4cmVmCjAgNzAK
+	MDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDQ2ODM1IDAwMDAwIG4gCjAwMDAwMzAyMzIg
+	MDAwMDAgbiAKMDAwMDAwNDAwMyAwMDAwMCBuIAowMDAwMDI1ODg4IDAwMDAwIG4gCjAw
+	MDAwMDAwMjIgMDAwMDAgbiAKMDAwMDAwMzk4MyAwMDAwMCBuIAowMDAwMDA0MTA3IDAw
+	MDAwIG4gCjAwMDAwMjQ5ODcgMDAwMDAgbiAKMDAwMDAwNzExMCAwMDAwMCBuIAowMDAw
+	MDEwMzg3IDAwMDAwIG4gCjAwMDAwMTA0MDggMDAwMDAgbiAKMDAwMDAxMTI5NCAwMDAw
+	MCBuIAowMDAwMDA1NTUyIDAwMDAwIG4gCjAwMDAwMDcwODkgMDAwMDAgbiAKMDAwMDAw
+	NDQ2OSAwMDAwMCBuIAowMDAwMDI1ODUxIDAwMDAwIG4gCjAwMDAwNDY1NjEgMDAwMDAg
+	biAKMDAwMDAwNDkzNCAwMDAwMCBuIAowMDAwMDA0NjIwIDAwMDAwIG4gCjAwMDAwMDUz
+	OTUgMDAwMDAgbiAKMDAwMDAwNTA4NSAwMDAwMCBuIAowMDAwMDA1MjQyIDAwMDAwIG4g
+	CjAwMDAwMzc4NDAgMDAwMDAgbiAKMDAwMDAwNDc3NyAwMDAwMCBuIAowMDAwMDE3ODI2
+	IDAwMDAwIG4gCjAwMDAwMTc4NzMgMDAwMDAgbiAKMDAwMDAxNzkyMCAwMDAwMCBuIAow
+	MDAwMDE3OTY4IDAwMDAwIG4gCjAwMDAwMjk4MDkgMDAwMDAgbiAKMDAwMDAyOTE2NCAw
+	MDAwMCBuIAowMDAwMDI4NTQ1IDAwMDAwIG4gCjAwMDAwMjgxMjIgMDAwMDAgbiAKMDAw
+	MDAyNzQ3NyAwMDAwMCBuIAowMDAwMDI2NjcwIDAwMDAwIG4gCjAwMDAwMjYwNTEgMDAw
+	MDAgbiAKMDAwMDAyNDA5MCAwMDAwMCBuIAowMDAwMDE1NzcyIDAwMDAwIG4gCjAwMDAw
+	MTc4MDUgMDAwMDAgbiAKMDAwMDAxMjc3MCAwMDAwMCBuIAowMDAwMDE1NzUxIDAwMDAw
+	IG4gCjAwMDAwMTEzMTQgMDAwMDAgbiAKMDAwMDAxMjc0OSAwMDAwMCBuIAowMDAwMDE4
+	MDEzIDAwMDAwIG4gCjAwMDAwMjQwNjkgMDAwMDAgbiAKMDAwMDAyNDEyNyAwMDAwMCBu
+	IAowMDAwMDI0OTY3IDAwMDAwIG4gCjAwMDAwMjUwMjMgMDAwMDAgbiAKMDAwMDAyNTgz
+	MSAwMDAwMCBuIAowMDAwMDI1OTcxIDAwMDAwIG4gCjAwMDAwMjY2NTAgMDAwMDAgbiAK
+	MDAwMDAyNzQ1NyAwMDAwMCBuIAowMDAwMDI4MTAyIDAwMDAwIG4gCjAwMDAwMjg1MjUg
+	MDAwMDAgbiAKMDAwMDAyOTE0NCAwMDAwMCBuIAowMDAwMDI5Nzg5IDAwMDAwIG4gCjAw
+	MDAwMzAyMTIgMDAwMDAgbiAKMDAwMDAzMDM5NSAwMDAwMCBuIAowMDAwMDMwMjgwIDAw
+	MDAwIG4gCjAwMDAwMzAzNzMgMDAwMDAgbiAKMDAwMDAzMDQ4OCAwMDAwMCBuIAowMDAw
+	MDM3MzU0IDAwMDAwIG4gCjAwMDAwMzczNzUgMDAwMDAgbiAKMDAwMDAzNzYwMCAwMDAw
+	MCBuIAowMDAwMDM4MDE1IDAwMDAwIG4gCjAwMDAwNDU4NDcgMDAwMDAgbiAKMDAwMDA0
+	NTg2OCAwMDAwMCBuIAowMDAwMDQ2MDk5IDAwMDAwIG4gCjAwMDAwNDY3NDEgMDAwMDAg
+	biAKMDAwMDA0Njc5MyAwMDAwMCBuIAp0cmFpbGVyCjw8IC9TaXplIDcwIC9Sb290IDQ5
+	IDAgUiAvSW5mbyAxIDAgUiAvSUQgWyA8MDMyMzk3ZTAwZDIyMzQyMWNhZjU0MmY1MTM0
+	N2VjMGY+CjwwMzIzOTdlMDBkMjIzNDIxY2FmNTQyZjUxMzQ3ZWMwZj4gXSA+PgpzdGFy
+	dHhyZWYKNDY5MTAKJSVFT0YKMSAwIG9iago8PC9BdXRob3IgKFJvYmVydCBMeSkvQ3Jl
+	YXRpb25EYXRlIChEOjIwMTEwOTA3MjEzMjAwWikvQ3JlYXRvciAoT21uaUdyYWZmbGUg
+	UHJvZmVzc2lvbmFsIDUuMy4yKS9Nb2REYXRlIChEOjIwMTExMTI5MTcxMzAwWikvUHJv
+	ZHVjZXIgNjggMCBSIC9UaXRsZSAocmVuZGVyc2NyaXB0X292ZXJ2aWV3KT4+CmVuZG9i
+	agp4cmVmCjEgMQowMDAwMDQ4NDY4IDAwMDAwIG4gCnRyYWlsZXIKPDwvSUQgWzwwMzIz
+	OTdlMDBkMjIzNDIxY2FmNTQyZjUxMzQ3ZWMwZj4gPDAzMjM5N2UwMGQyMjM0MjFjYWY1
+	NDJmNTEzNDdlYzBmPl0gL0luZm8gMSAwIFIgL1ByZXYgNDY5MTAgL1Jvb3QgNDkgMCBS
+	IC9TaXplIDcwPj4Kc3RhcnR4cmVmCjQ4NjU2CiUlRU9GCg==
+	</data>
+	<key>QuickLookThumbnail</key>
+	<data>
+	TU0AKgAAF16AP+BP8AQWDQeEQmFQuGQ2HQ+IRGJROKRWLReMRmNRuOR2OQOCR6RSOSSW
+	TSeUSmVSuNSCWS+YTGZTOaTWaPecP9xTsAAefTaBQUAgGbQ+ggChyuBgB9U0ACaoUWpV
+	OqQ56Vd/vCtAAG12EUOiUuq1+k2KxwawACzRGtPAAB64We5XOZvW7P923muV6L2m1why
+	4EABvCUik3l2gAJYuEYjDUScPcAVd6AAT5eyWGjwq/UG2gAIaGT52CZ8Qae6anVSi7PV
+	/uzYXsG4+1ZuM0subkAFbeABzb+EV3ZujiYrGU19AAK8sACTnABm9EAP7qABw9cABftA
+	AHd0AN3wAAOeOmU4CecACz1AAee3ayG0WXbRTPiH7av8fmOa3X7EGP+zL3wCv6Dn3AwA
+	HlBIAHtBgAAHB4AHjCQAAxCoAHTDAAAfDYAM/CoMNkADiHQADIgAA0UAAAsVgAfkXABA
+	x9gABUaMmq4AAnHIAH7HjlOYh7SQG+bPhFIr9SPJCJv4dUmRCv8gyg+T4ITKKiIOpcgo
+	PKsBSyzkpNpK6gy6oUvy2z4RzRJM1TWhUlya/4GIRJ8yzpKyDSxOsuKShc5s0gktzDP8
+	8zxOyEz7PU/QRBU0BHNlHTY/kRgBOCGG2dYBoKBADoKo8907K1P05Ka0TvUlOM4oSFVC
+	2syVFVtWSpUtU1PWKCIIAh9uSEQJn62ilwSeTmuesdgIQ7oHUfZL+N+c0QoWbR302ewD
+	tmpFZrVK9ssNV1U09MNX21a1aXFO0p3NV7NqJb07pDPdwysBZ7HiAASgnGVAgAed9XoE
+	oSrOX2AXzfbCA3GzK2OAAE4VgR5sGwuCWSmz+MCcsnPmbR4AQyYDWRWCF3c+FC25d12V
+	9b6yW5j9y1Nk+SVcv2ToMBx9WCEgInzXzPK2BeeZzUaTPGDgAAFogAMc84CRhA6fU2pc
+	eV7fWG4hB9MWKz6VRiAGeAXCkLPw/hybDScAIWa5240eACY6o1UVhTx/XbdWV2vbVbTB
+	dk/3FLWR7nkO571bQJH7eYTgnnCF2KqATZ8la0mtx8Oq3hQEu470UANhgAHxzetZ7EwX
+	9BxiYHB0gASKET8v4cfV87rkgmud4FaMrlrStKxOEGNb2CWLUInadIAHedZzgACgMg/z
+	R62DbZ6HidwABQGQdgAbRnmOnoFa4AwEa55rEgQBU4g2EITgAcZuGrox0HGywY+mfR8H
+	toYBaTuCCAUrx4nYdQAAIArmBxjbGo9AGYPCngwByqRPYFB+luBQBRw5CligpgoVMdcF
+	3MlpaIAJHaPYNm0ay0xhzBYPk0OuOEAAH4VOpLu6t9jWyGDTHW5QdQ/wHoCVyzgawyhf
+	NaAaBA6Y/lew5AABEC7BR0jiG4jOH6LR9M4AcBMCyCx5FuHANcZr2E4gXA6CR/r/2hno
+	HeOlir4E4gJAZDcfo/EZRpAkicA7lB3jqWaPkfA9X+gEcwPkfMeAOAjBa8UDIHlsMlA0
+	ANeYKgKD4TkUEygAIKApYikmE8KYVtfLvJWGBCxpDrdkOgfsN29M/lGyyUjf1PSklNKt
+	WK42/t7lcqCVSswNgBHeAAFYFpGKEcyCuX0k0kSVhU8iTBrpKo0dkQsaA6nZDiHzKKUq
+	3ZZMhVKupbE1FxpkM0uGWEhXazTlXNZuy11RmdWyCIA8twWS6IY1E9J65gH6mFJc1Z/H
+	SDgRmjUhYyhxzNH3EAhs43apyWwyKV8rJouAVVN6ay2W8zdlOrKUs6C3AyA2ZIhc7gW0
+	bnjPI7Ew4WGuG/SNhLCyFj3H0UQfg/iCgDAEyIqSEl5gFPQ9lrhdKXUsAO0lxhrYOq9p
+	GN8AAQ6iEYmQAAaNSYigRAi5VZDm5GUyURHlpLl0BI5AmT0n5yCKAIq8idFJIp5zEnqX
+	c8A3Z8zJPiokvqXyRFpHdXFFSLFKJArcR5MZEKfVWrOAAHNfyMHCOsdhYrSERHFApYkA
+	AFrGAAHPY+rSm7EgUfM6wDNl3i2KqgRBp4AILjrAACq0RI6x0hH+Nu1FaSMV5S0oM+ZE
+	zoxZaoAAGFtXRJeUTayvCX6fW1BhR0jFnVmAAA7cW0lH56GqP4Nq5lqrdEsrykEY9065
+	gFAADS7Bo67zaQERenwMbwXAIvcI4FxQO3HhRSCYo/7mDapK5QhY6x6jXQcAlYMHCwze
+	VjflvN/COI8pYQcAiEKBX7mvQPApGG7D/HxVkCgC3Fl/QY/K8AMbxEWvIs2816JLVkuU
+	XcbGIbVF/luMNhIFhsNtoIqtVc5G3UwIrjBWzcW+UQxeREew5wXo4AIDeqdPgZ5BwuRX
+	DNxLjViuRh41J/MQ4pq8xpII7h/jEJ6BMa1+j5swbo3hVsqFVZZLKzG7k2JG40y8oY+Y
+	+R14WAmAQGzjMJ3XuzkMieRcN5IvTcnJZdxr59ABk8hg78pv9AjleVM1CBUsLTi5bbHs
+	bWtrZN9UWZKIq0lTiqcqXx9jsBkYoAgNSGImuwDTOmdUe3DzuR60t6xq6tveQwdo/MqA
+	CAgNOgZBxpDMWaLAUj6QgBJUaOccawQDAHUwBACTGgEgLcwOQcBbgJAWdlAIdgAAvBtB
+	mAAaYy0SP7jwBoDyyB4DsMkPAd8jAfhIBCAAX4tRvRFAo5Qe49o2gNcwAgBN1oqyMAGA
+	SDmyHKAxBwwVu1DSDD7HdhYCoBsfL4s2DXiGpSJZ2yPqrJNphqcZz/V8hY7R+jFKQA3W
+	xfx1jojwO8dr8o1kE36QUfI91exo30O+CJBAHAQU2OEbhbggBIUaMMXlQlWbzH49AF0U
+	9920BuwUYYut3gYA2sgcg4S3AVAs1wf6Vh5bnsWBpOL8UZAsBmBnBF+i1Dy1IBQAuoCF
+	5xdOfsux4jyIrutMUAApO8AADB3uyOCigjD8AADiGoHJ57NcNLxGr5eDsH3iYrkA6CSt
+	oZRLGVCMzkM0r5OV1C9GUJVAPHToFQD4+l5nF0GO7nkMp9bMxcbyTxCKYPLatryHomFS
+	K0V4AAtBWCpWBzBF0EsNGuNm9wHwPXnAwBeKZYx/D5fkfzxA0u+pB8ZlQfoCfpV20ilR
+	MtEtIXdIt6lKH3q1/gIKAIeupPRZv++iav8CSNzuaz60k49x0z4AENgYT/QDsaIgxYxo
+	8xACKNAGIdAAXAy/AQIYH6jsAAP4qSGi76IWHOHuGAR2ASgGoO8onIxaIkzI0wT4VMXL
+	A6IjA+paHs06A0AWem4cc4B1BeI4/kQO/oJMHwHceAAKGsF6Qc/684oULlBMJhAYkYP4
+	GfCM42/8IU3oLcH+OqaIUw++Xw++l4UOT49o+4ZEUPCozAxg0maGACqqAGrUu4j4ZxBe
+	B1BiX2/mMZBrBuRUGmFxB5CSZ+8yb8ZS8s0eK+/I7M860vD082lXAYZwP4GdELCQ/McY
+	0Wy+UEtyTyXwujEdEXETEjC9EhEbC6c0c4PagM/jDVBnDYJLBtBwGiFrB4U2VnBImyZY
+	XeVlA+lkbpFe0a8jD/Fmb7FWKJCHAcLuti+mtclnCmTE8ou2IYS2QItwS5GE+3GJF8Ig
+	q5E3DSYbDW9dFDDcAKGeFgQcjAVnBGXRACXPG2ZLFlA2ZSdtHDD8XXEBG5HEVoH6H2Zw
+	wmH+GZHk98qml5CtEYqnEeZdHvEnExC3HxH1ExIDHzEkayB7IPGgaURlBpGpBwGaFaQc
+	2LFUy2UNFXHG8xItIq8lBDIo81IwVmH6ieABDKH/EKGdEQTYRc6KLStmYihEBlJgI5JU
+	QE7oJPFERUGSFRIi9/GJD2I3D8tXJ8I1KAILJCOSJAOopYs6YiMcqssEYitmhKIcWKIO
+	YQJpJuAKGQFLIjFOkK8yXEtfKJG7LGcBFtI3FitbDvLI0vHbKPGMkmriefJrKe4kIW8A
+	xMRMqPDKsWsbKScyLgkJMAIxKwGKFBGy7rDtI1LBAGJDDsHGHUeepWpYBCAwsobdB9H2
+	80xbMaPiZGlgKCjWRkJcwvLiuqWdLqTa7iq4q40AqsketmKWQ2huUkg/L8++Hy3GhSG6
+	FsQcPQ87DzA0XWFSGEGeAAFWGG1sBIA0qyBMA2soGqHEf4A+AqiAAcAUY0bgpYB2BUBA
+	MsA4AvIuZ/HRI8VGjW6LNGvEFbPVHoCbPbNQIXAgUUWDNk1eQweAsEqYqahgqxMHGqF+
+	EvJ2xq0c+5QEPmHcHoMkHSHeYaW2AsAeTiHeHofkH2H6pYAqAacoGoHGtACABY3XGXQL
+	PFFiZdKMPeH+p9CiTW1afSqsX6X8TYKWKWrqIcUlL2qszjL88KMcsYimsu7IIvKwF8Ep
+	MPIzAJFhMxQFFmm7A8XbSXHHBJLaYMH+seeIk2JpFSLHSwJQziUYI5L8KXJbIaRUF0Eh
+	Gyp5HUIhHKmy0pLJFolNF/D+lfTY0aPnHaV7HgMdLozHCvTTGHJ/T8Ik9SrbGUIeM+vU
+	I1BlIXFAJJKwFyEbN7ChLTI9CtLWVAoQkLLFTpSKZbRHUtN+IIjWV6P5TyL4/CS/JnPV
+	IgCDVXNMhEtQG2AANPO6XwsMIOSYf5PyAANg2qs3NKt8IRSpHpPoUoq5T0tWS+NMNRE7
+	GjE/GnUZGqFsENN7MRMZMUULU7PDEAlbM3WtM/Wq0YmxPNF0NdV2RDUEIcs2D5XUABS7
+	VuegBQBQAAFtXmbGTiBvXuABJMAABdX4RaRfPoF3YCAACRYIQcQhWCGzYSABIOB6ABRW
+	tUNCiAp8UoDJYqSFTgIaPqPvWXIUONWcJHKwFoELN6g5D7ANDxMVSdW7W1I489B9SdVD
+	XGH+s/XrYvZsZVEvJREkLSLSRMqkQ/Z1T3HxLfT7GUryTOTTY5GlJtGqFgD9UhAVQHT7
+	LVTpPFJ9H3T5RBalUyStTtZlXcsFC0TFGZZxIJErGHGLbHUI/LHsy5EtHrbUciLdS7aV
+	WbaZBwFeD5YNZKY/b6kbSOxvb+ZRalZVIoU7W9ajTrQra+TebIy4HGluOmf6mrEpbhaH
+	bjH5GBcvIBbdGZEUzQIIbgKIAQAEpYAyAg0US+WLbpURE9UVY+JEHuHaeIAKFYDuf6pc
+	KrA0LOZWH5cWP5WCUob+G2HeY0HyfDHAv9D4oTM6yxSLTmXIWsnHDrQJedI6mwAQeUOa
+	AiOSSCWLRdITaWJNAYMkHIGMFoRKH0Rk4NBBAcHskYT2Ro/9YwJLd3DzA8WwP+NmWWOB
+	WMIOGwHccwHoY5apUlUnSSZKy1apUzgNCDFTbiXMVGZmWCBMXszLbksyspKsIskes2A1
+	g+JjaIIeFdhI1eCThPPe/KbAbFbCYuHgcoHiAIWreZIm89LRZRN/UvhqlRhvZMlWAgH2
+	WCBKAjfgS+G5iPNM8LR4Ios6OWArEOSQz6vosNfBhSIRhWHJZqIWGqbOdmNmoanBc+qQ
+	GIF0eCeGAAA0BCcWjsMkAoAwvOHAGzAikGX8Hve0Ac2iMmHkMTL8+cfkiERkBCBU2yGo
+	GRB2BCBW06H4HyOSHKG+xSAq3AOaBcx8pfZLFsmoT2AqH8XmgegiISWLXhXjisIAAIFA
+	4JAndBwABIUAAdDYLD4hEYlE4pFYtFXrGX+444AAXHwAAZEAH/JQA1naCQA6wAD5JJpE
+	AYLJX/IZG1mWwAA8ndLHe63MAAiFg0AAEAgGAHg63QAAYEAkAAUDZc9Hg7QABwSC6lVA
+	A32szpaEwwABWOCEAGmxl0AAmFw6AHY53FWQSCgA7XQ4wARSwawABgOCJtMpphZnJgwA
+	XiABSFHzEnlk8cKRTF8xmc1m85BoRCgJDIdndJpdND4y9Y3HQVrYk0nXKnO/JdIYHNYf
+	MoFuNtu4hupJA5HL4nwNw+Hs8wACKnudvwufzt9AuHJolug6A3gABUFXxEnn4e4KhVp/
+	N5/PB3dCYXDQd6Ph8YlqX+4ftHpBEWe6ZU4ny2reuC6ibN260ApqmTDQFA6Cpi4jowbC
+	EEt0w8Bt9BLgt440GpHAzghEA53gAFoLsiw8HPC5QVxW+UWxciL1PY0L3RfGrzvo+xwq
+	k1yImWcy8HEfAIIomsNQC30EQi6clQXDcLIlIroOBJEjwY6UmueEIDu2GQNnu8DxBZMU
+	bTI+UYtA0T3zLNbNPob83x2vEYHo3SRgHKc2IojJ6KMpAAATQE8s0kSagcBLeIeelFRG
+	FoW0FR7NxjBwI0pSFLNQjU3m/P9As7B0KvRT8PIKd9SgAAtUKcBgGMRUDz1FRFBw6kzU
+	gAclbgAbddAALFes0A9gABHKdspYADgACVkgAf1mAAdFngAftpMQ1q8Aba4AUVPgY24v
+	J2qwzrJnkAAM3K/CuUvdIAPobl2zjDjDVGzNYPjB1SxFVAC3Oi16PhfrMVqEWBAAc+Cg
+	AE2ENJe6XpqeGHRkAB8YkAAB4q5YEMIglpH6rNgnvj4ABBkV1ZJGr6V0bd309WdYoJel
+	/s2W2ZVPVIi5tVt5OFlmcZbUOd1qGGg5LoeiaKgb6G1pN33ofR+HtZZ/45MmYZ4ABwG+
+	cGKIWDoOg5F+qXomp/YoAQDMCAaVIjWtuBjo23bfSD6GzudObTnSZHOfJfqkDBswK6Dp
+	urwEHys3rjSNKqHwNJ3BSfxcJcdxE8AAfJ0baCwDhvhiCntzoABl0G4dF0eTI0bHT3fV
+	ylH+YtTgoasj8neUNyM4cBQ1CmWyd2PFd05/ayd3G/yYe50hgAAKALzUTpHWoZ+f0no+
+	k8z6dObGLsJeh3H8YaEgka2/m0aqWHmeDIhOFoLAAfZ944BAEtCdRzz4CYLLw6wBQogZ
+	3nZL4GgQMIcgfRLQIkqGeMgoIJAUgTYuUkAgBikj8H2QIphygGgObMAsB5hB+vtOWAlf
+	Q+h8scOGPQecA33mhAeBFjJAx9jsBkW4AoNmqudaeDSHD04dQ7MyfQa0P3sESe260AgE
+	RqEFF6LNlI6RzJ8HGN87YEQJkqMEUkfw/SalagcAUpI6ByHKBQC59Re1xlIAEYEA5oQc
+	BBLiLwWLKQBgEjOASLi6x5GRAyB4BoABtDTHYuQDx7wMAbj2NAZJQQZg7a8Nc/YAAOgj
+	SGNgaQ6gABWDGC8AAHgRFRN9C9toE4ZkSY+l8GspYeSnlQRA+g1ZWN1IkOwfb3QAgOGm
+	hZDCFSRu0AAPYekEx4juS+BoDxLh/EmfygompdFxgSAqXgAsaTbE1GwNOSgG5hrrHpAM
+	DIHSXS/S+A8CTGXdIdcGlFBbLiZD9HfDFzDmiCGHYkd+UoNZUz1lSfQak+YgkRHaP11o
+	AQGy1dUv9DYxRdtZAuBxVg0hlDnQsOgcpygGAOWOB4EBLh0vzJbOEAAFgMx7G0NQlkg1
+	WIEGsNAdK5AOHvom2YcI3ERBcDVDF96+iKy3nOSQeQNHkAFnoREfNQQATzntUWHZ9BpV
+	Jlc8wmQ6x9PdH+AuWs76coYSWTIew9YBv8S+P0fjYwHARWOPUecExvjaKwCkGAF11wnI
+	THUBYDGzReXHBqDNcgADBFsN4AANwflxAUAxY48B3NPA+COThM5ynQSjVYeYM6OgIeWT
+	AkcowAA4sxUazT0akVKWM1UdY/HWj+AQNFfjOyIsvQhOheLPSLtUtY5t3dsXVACHrTwC
+	oB4aWxssDm31m7gNwPoNG4hgQDNmIiOgewzFlgFHKbZyaGUpWKSS7u6NrjfpESwnixrh
+	brkWAGPsEAAALgLePO8k1QTIg6vZcG9zRT6DPvlPsiDqrUu2QKrFl9qG7pQZybm/Dm7a
+	WUtavC/12LY3qABewHV78HMkPoM7CUQaBs7QcRGplssLYBwzhXAuF764Ew1h/DmIsPYj
+	IlPEAAPMWYPxcpY+gzMZMdWPfvAtN8LISv4cXDeNyKWqqvjs6+PcBEUH1kcAAPclYvyY
+	nmGw/8ZXMXzijDOGMTYivQgjAOVstYkujflquIMwZiwPmHLZtyTPsgmD7NmTc3JkH5nE
+	f4186ZFInifPCo2wZEy5gbPN+shY2zLgMmqgCVAl0Rm/RSLiaKIvtouHWZNIaTPNo3Sm
+	l9MaZd7f/TWndPYPICAAAA4BAAADAAAAAQBfAAABAQADAAAAAQBPAAABAgADAAAABAAA
+	GAwBAwADAAAAAQAFAAABBgADAAAAAQACAAABEQAEAAAAAQAAAAgBEgADAAAAAQABAAAB
+	FQADAAAAAQAEAAABFgADAAAAAQBPAAABFwAEAAAAAQAAF1UBHAADAAAAAQABAAABPQAD
+	AAAAAQACAAABUgADAAAAAQABAAABUwADAAAABAAAGBQAAAAAAAgACAAIAAgAAQABAAEA
+	AQ==
+	</data>
+	<key>ReadOnly</key>
+	<string>NO</string>
+	<key>RowAlign</key>
+	<integer>1</integer>
+	<key>RowSpacing</key>
+	<real>36</real>
+	<key>SheetTitle</key>
+	<string>Canvas 1</string>
+	<key>SmartAlignmentGuidesActive</key>
+	<string>YES</string>
+	<key>SmartDistanceGuidesActive</key>
+	<string>YES</string>
+	<key>UniqueID</key>
+	<integer>1</integer>
+	<key>UseEntirePage</key>
+	<false/>
+	<key>VPages</key>
+	<integer>1</integer>
+	<key>WindowInfo</key>
+	<dict>
+		<key>CurrentSheet</key>
+		<integer>0</integer>
+		<key>ExpandedCanvases</key>
+		<array>
+			<dict>
+				<key>name</key>
+				<string>Canvas 1</string>
+			</dict>
+		</array>
+		<key>Frame</key>
+		<string>{{318, 108}, {971, 888}}</string>
+		<key>ListView</key>
+		<true/>
+		<key>OutlineWidth</key>
+		<integer>142</integer>
+		<key>RightSidebar</key>
+		<false/>
+		<key>ShowRuler</key>
+		<true/>
+		<key>Sidebar</key>
+		<true/>
+		<key>SidebarWidth</key>
+		<integer>120</integer>
+		<key>VisibleRegion</key>
+		<string>{{-130, 0}, {836, 734}}</string>
+		<key>Zoom</key>
+		<real>1</real>
+		<key>ZoomValues</key>
+		<array>
+			<array>
+				<string>Canvas 1</string>
+				<real>1</real>
+				<real>1</real>
+			</array>
+		</array>
+	</dict>
+	<key>saveQuickLookFiles</key>
+	<string>YES</string>
+</dict>
+</plist>
diff --git a/docs/html/images/rs_overview.png b/docs/html/images/rs_overview.png
new file mode 100644
index 0000000..888063dc
--- /dev/null
+++ b/docs/html/images/rs_overview.png
Binary files differ
diff --git a/docs/html/images/ui/menu-context.png b/docs/html/images/ui/menu-context.png
new file mode 100644
index 0000000..f6975fb
--- /dev/null
+++ b/docs/html/images/ui/menu-context.png
Binary files differ
diff --git a/docs/html/images/ui/popupmenu.png b/docs/html/images/ui/popupmenu.png
new file mode 100644
index 0000000..5c99821
--- /dev/null
+++ b/docs/html/images/ui/popupmenu.png
Binary files differ
diff --git a/docs/html/index.jd b/docs/html/index.jd
index 8624633..b9d6758 100644
--- a/docs/html/index.jd
+++ b/docs/html/index.jd
@@ -1,4 +1,5 @@
 home=true
+page.metaDescription=The official site for Android developers. Provides the Android SDK and documentation for app developers and designers.
 @jd:body
 
 
@@ -11,14 +12,15 @@
                             </div><!-- end homeTitle -->
                             <div id="announcement-block">
                             <!-- total max width is 520px -->
-                                  <img src="{@docRoot}images/home/market_icon.png"
-alt="Android Market" width="120px" style="padding:10px 53px 5px"/>
+                                <a href="{@docRoot}design/index.html">
+                                  <img src="{@docRoot}images/home/android-design.png"
+alt="Android Design" width="160px" style="padding:10px 33px 5px"/>
+                                </a>
                                   <div id="announcement" style="width:275px">
-    <p>We've completely redesigned Android Market for phones to make it easier to
-explore Android apps, games, and other content. Look for the new version coming to your
-Android phone!</p> <p><a
-href="http://android-developers.blogspot.com/2011/07/new-android-market-for-phones.html">Learn more
-&raquo;</a></p>
+    <p>Introducing <b>Android Design</b>: The place to learn about principles, building blocks, and patterns
+      for creating world-class Android user interfaces. Whether you're a UI professional or a developer
+      playing that role, these docs show you how to make good design decisions, big and small.</p>
+    <p><a href="{@docRoot}design/index.html">Android Design &raquo;</a></p>
                                 </div> <!-- end annoucement -->
                             </div> <!-- end annoucement-block -->
                         </div><!-- end topAnnouncement -->
@@ -141,6 +143,20 @@
 + "href='{@docRoot}sdk/api_diff/15/changes.html'>diff report</a>. If you're new to Android, "
 + "get started with the <a href='/sdk/index.html'>SDK starter package</a>.</p>"
     },
+    
+    'plus': {
+      'layout':"imgLeft",
+      'icon':"google-plus-small.png",
+      'name':"Google+ Page",
+      'img':"google-plus.png",
+      'title':"Android Developers on Google+",
+      'desc': "<p>We now have a Google+ page for <a "
++ "href='https://plus.google.com/108967384991768947849'>+Android Developers</a>. "
++ "We'll use it to host Hangouts for developers, talk about the latest releases, "
++ "development and design tips, and much more.</p>"
++ "<div style='margin:.7em 0 0 -1.2em'><g:plus href='https://plus.google.com/108967384991768947849' "
++ "size=\"smallbadge\" width=\"275\"></g:plus></div>"
+    },
 
     'tv': {
       'layout':"imgLeft",
@@ -185,5 +201,16 @@
 </script>
 <script type="text/javascript" src="{@docRoot}assets/carousel.js"></script>
 <script type="text/javascript">
-  initCarousel("sdk");
+  initCarousel("plus");
 </script>
+
+<script type="text/javascript" src="https://plus.google.com/108967384991768947849"
+rel="publisher"></script>
+<script type="text/javascript">
+window.___gcfg = {lang: 'en'};
+(function() 
+{var po = document.createElement("script");
+po.type = "text/javascript"; po.async = true;po.src = "https://apis.google.com/js/plusone.js";
+var s = document.getElementsByTagName("script")[0];
+s.parentNode.insertBefore(po, s);
+})();</script>
diff --git a/docs/html/reference/renderscript/annotated.html b/docs/html/reference/renderscript/annotated.html
new file mode 100644
index 0000000..0425db2
--- /dev/null
+++ b/docs/html/reference/renderscript/annotated.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>Data Structures</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li><a href="globals.html"><span>Globals</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">Data Structures</div>  </div>
+</div>
+<div class="contents">
+<div class="textblock"> </div><table>
+  <tr><td class="indexkey"><a class="el" href="structrs__allocation.html">rs_allocation</a></td><td class="indexvalue">Opaque handle to a Renderscript allocation </td></tr>
+  <tr><td class="indexkey"><a class="el" href="structrs__element.html">rs_element</a></td><td class="indexvalue">Opaque handle to a Renderscript element </td></tr>
+  <tr><td class="indexkey"><a class="el" href="structrs__font.html">rs_font</a></td><td class="indexvalue">Opaque handle to a Renderscript font object </td></tr>
+  <tr><td class="indexkey"><a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a></td><td class="indexvalue">2x2 float matrix </td></tr>
+  <tr><td class="indexkey"><a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a></td><td class="indexvalue">3x3 float matrix </td></tr>
+  <tr><td class="indexkey"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a></td><td class="indexvalue">4x4 float matrix </td></tr>
+  <tr><td class="indexkey"><a class="el" href="structrs__mesh.html">rs_mesh</a></td><td class="indexvalue">Opaque handle to a Renderscript mesh object </td></tr>
+  <tr><td class="indexkey"><a class="el" href="structrs__program__fragment.html">rs_program_fragment</a></td><td class="indexvalue">Opaque handle to a Renderscript ProgramFragment object </td></tr>
+  <tr><td class="indexkey"><a class="el" href="structrs__program__raster.html">rs_program_raster</a></td><td class="indexvalue">Opaque handle to a Renderscript ProgramRaster object </td></tr>
+  <tr><td class="indexkey"><a class="el" href="structrs__program__store.html">rs_program_store</a></td><td class="indexvalue">Opaque handle to a Renderscript ProgramStore object </td></tr>
+  <tr><td class="indexkey"><a class="el" href="structrs__program__vertex.html">rs_program_vertex</a></td><td class="indexvalue">Opaque handle to a Renderscript ProgramVertex object </td></tr>
+  <tr><td class="indexkey"><a class="el" href="structrs__sampler.html">rs_sampler</a></td><td class="indexvalue">Opaque handle to a Renderscript sampler object </td></tr>
+  <tr><td class="indexkey"><a class="el" href="structrs__script.html">rs_script</a></td><td class="indexvalue">Opaque handle to a Renderscript script object </td></tr>
+  <tr><td class="indexkey"><a class="el" href="structrs__script__call.html">rs_script_call</a></td><td class="indexvalue"></td></tr>
+  <tr><td class="indexkey"><a class="el" href="structrs__tm.html">rs_tm</a></td><td class="indexvalue"></td></tr>
+  <tr><td class="indexkey"><a class="el" href="structrs__type.html">rs_type</a></td><td class="indexvalue">Opaque handle to a Renderscript type </td></tr>
+</table>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/doxygen.css b/docs/html/reference/renderscript/doxygen.css
new file mode 100644
index 0000000..22c7b5c
--- /dev/null
+++ b/docs/html/reference/renderscript/doxygen.css
@@ -0,0 +1,946 @@
+/* The standard CSS for doxygen */
+
+body, table, div, p, dl {
+	font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif;
+	font-size: 12px;
+}
+
+/* @group Heading Levels */
+
+h1 {
+	font-size: 150%;
+}
+
+.title {
+	font-size: 150%;
+	font-weight: bold;
+	margin: 10px 2px;
+}
+
+h2 {
+	font-size: 120%;
+}
+
+h3 {
+	font-size: 100%;
+}
+
+dt {
+	font-weight: bold;
+}
+
+div.multicol {
+	-moz-column-gap: 1em;
+	-webkit-column-gap: 1em;
+	-moz-column-count: 3;
+	-webkit-column-count: 3;
+}
+
+p.startli, p.startdd, p.starttd {
+	margin-top: 2px;
+}
+
+p.endli {
+	margin-bottom: 0px;
+}
+
+p.enddd {
+	margin-bottom: 4px;
+}
+
+p.endtd {
+	margin-bottom: 2px;
+}
+
+/* @end */
+
+caption {
+	font-weight: bold;
+}
+
+span.legend {
+        font-size: 70%;
+        text-align: center;
+}
+
+h3.version {
+        font-size: 90%;
+        text-align: center;
+}
+
+div.qindex, div.navtab{
+	background-color: #EBEFF6;
+	border: 1px solid #A3B4D7;
+	text-align: center;
+}
+
+div.qindex, div.navpath {
+	width: 100%;
+	line-height: 140%;
+}
+
+div.navtab {
+	margin-right: 15px;
+}
+
+/* @group Link Styling */
+
+a {
+	color: #3D578C;
+	font-weight: normal;
+	text-decoration: none;
+}
+
+.contents a:visited {
+	color: #4665A2;
+}
+
+a:hover {
+	text-decoration: underline;
+}
+
+a.qindex {
+	font-weight: bold;
+}
+
+a.qindexHL {
+	font-weight: bold;
+	background-color: #9CAFD4;
+	color: #ffffff;
+	border: 1px double #869DCA;
+}
+
+.contents a.qindexHL:visited {
+        color: #ffffff;
+}
+
+a.el {
+	font-weight: bold;
+}
+
+a.elRef {
+}
+
+a.code {
+	color: #4665A2;
+}
+
+a.codeRef {
+	color: #4665A2;
+}
+
+/* @end */
+
+dl.el {
+	margin-left: -1cm;
+}
+
+.fragment {
+	font-family: monospace, fixed;
+	font-size: 105%;
+}
+
+pre.fragment {
+	border: 1px solid #C4CFE5;
+	background-color: #FBFCFD;
+	padding: 4px 6px;
+	margin: 4px 8px 4px 2px;
+	overflow: auto;
+	word-wrap: break-word;
+	font-size:  9pt;
+	line-height: 125%;
+}
+
+div.ah {
+	background-color: black;
+	font-weight: bold;
+	color: #ffffff;
+	margin-bottom: 3px;
+	margin-top: 3px;
+	padding: 0.2em;
+	border: solid thin #333;
+	border-radius: 0.5em;
+	-webkit-border-radius: .5em;
+	-moz-border-radius: .5em;
+	box-shadow: 2px 2px 3px #999;
+	-webkit-box-shadow: 2px 2px 3px #999;
+	-moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
+	background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444));
+	background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000);
+}
+
+div.groupHeader {
+	margin-left: 16px;
+	margin-top: 12px;
+	font-weight: bold;
+}
+
+div.groupText {
+	margin-left: 16px;
+	font-style: italic;
+}
+
+body {
+	background-color: white;
+	color: black;
+        margin: 0;
+}
+
+div.contents {
+	margin-top: 10px;
+	margin-left: 8px;
+	margin-right: 8px;
+}
+
+td.indexkey {
+	background-color: #EBEFF6;
+	font-weight: bold;
+	border: 1px solid #C4CFE5;
+	margin: 2px 0px 2px 0;
+	padding: 2px 10px;
+}
+
+td.indexvalue {
+	background-color: #EBEFF6;
+	border: 1px solid #C4CFE5;
+	padding: 2px 10px;
+	margin: 2px 0px;
+}
+
+tr.memlist {
+	background-color: #EEF1F7;
+}
+
+p.formulaDsp {
+	text-align: center;
+}
+
+img.formulaDsp {
+	
+}
+
+img.formulaInl {
+	vertical-align: middle;
+}
+
+div.center {
+	text-align: center;
+        margin-top: 0px;
+        margin-bottom: 0px;
+        padding: 0px;
+}
+
+div.center img {
+	border: 0px;
+}
+
+address.footer {
+	text-align: right;
+	padding-right: 12px;
+}
+
+img.footer {
+	border: 0px;
+	vertical-align: middle;
+}
+
+/* @group Code Colorization */
+
+span.keyword {
+	color: #008000
+}
+
+span.keywordtype {
+	color: #604020
+}
+
+span.keywordflow {
+	color: #e08000
+}
+
+span.comment {
+	color: #800000
+}
+
+span.preprocessor {
+	color: #806020
+}
+
+span.stringliteral {
+	color: #002080
+}
+
+span.charliteral {
+	color: #008080
+}
+
+span.vhdldigit { 
+	color: #ff00ff 
+}
+
+span.vhdlchar { 
+	color: #000000 
+}
+
+span.vhdlkeyword { 
+	color: #700070 
+}
+
+span.vhdllogic { 
+	color: #ff0000 
+}
+
+/* @end */
+
+/*
+.search {
+	color: #003399;
+	font-weight: bold;
+}
+
+form.search {
+	margin-bottom: 0px;
+	margin-top: 0px;
+}
+
+input.search {
+	font-size: 75%;
+	color: #000080;
+	font-weight: normal;
+	background-color: #e8eef2;
+}
+*/
+
+td.tiny {
+	font-size: 75%;
+}
+
+.dirtab {
+	padding: 4px;
+	border-collapse: collapse;
+	border: 1px solid #A3B4D7;
+}
+
+th.dirtab {
+	background: #EBEFF6;
+	font-weight: bold;
+}
+
+hr {
+	height: 0px;
+	border: none;
+	border-top: 1px solid #4A6AAA;
+}
+
+hr.footer {
+	height: 1px;
+}
+
+/* @group Member Descriptions */
+
+table.memberdecls {
+	border-spacing: 0px;
+	padding: 0px;
+}
+
+.mdescLeft, .mdescRight,
+.memItemLeft, .memItemRight,
+.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
+	background-color: #F9FAFC;
+	border: none;
+	margin: 4px;
+	padding: 1px 0 0 8px;
+}
+
+.mdescLeft, .mdescRight {
+	padding: 0px 8px 4px 8px;
+	color: #555;
+}
+
+.memItemLeft, .memItemRight, .memTemplParams {
+	border-top: 1px solid #C4CFE5;
+}
+
+.memItemLeft, .memTemplItemLeft {
+        white-space: nowrap;
+}
+
+.memItemRight {
+	width: 100%;
+}
+
+.memTemplParams {
+	color: #4665A2;
+        white-space: nowrap;
+}
+
+/* @end */
+
+/* @group Member Details */
+
+/* Styles for detailed member documentation */
+
+.memtemplate {
+	font-size: 80%;
+	color: #4665A2;
+	font-weight: normal;
+	margin-left: 9px;
+}
+
+.memnav {
+	background-color: #EBEFF6;
+	border: 1px solid #A3B4D7;
+	text-align: center;
+	margin: 2px;
+	margin-right: 15px;
+	padding: 2px;
+}
+
+.mempage {
+	width: 100%;
+}
+
+.memitem {
+	padding: 0;
+	margin-bottom: 10px;
+	margin-right: 5px;
+}
+
+.memname {
+        white-space: nowrap;
+        font-weight: bold;
+        margin-left: 6px;
+}
+
+.memproto, dl.reflist dt {
+        border-top: 1px solid #A8B8D9;
+        border-left: 1px solid #A8B8D9;
+        border-right: 1px solid #A8B8D9;
+        padding: 6px 0px 6px 0px;
+        color: #253555;
+        font-weight: bold;
+        text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
+        /* opera specific markup */
+        box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+        border-top-right-radius: 8px;
+        border-top-left-radius: 8px;
+        /* firefox specific markup */
+        -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+        -moz-border-radius-topright: 8px;
+        -moz-border-radius-topleft: 8px;
+        /* webkit specific markup */
+        -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+        -webkit-border-top-right-radius: 8px;
+        -webkit-border-top-left-radius: 8px;
+        background-image:url('nav_f.png');
+        background-repeat:repeat-x;
+        background-color: #E2E8F2;
+
+}
+
+.memdoc, dl.reflist dd {
+        border-bottom: 1px solid #A8B8D9;      
+        border-left: 1px solid #A8B8D9;      
+        border-right: 1px solid #A8B8D9; 
+        padding: 2px 5px;
+        background-color: #FBFCFD;
+        border-top-width: 0;
+        /* opera specific markup */
+        border-bottom-left-radius: 8px;
+        border-bottom-right-radius: 8px;
+        box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+        /* firefox specific markup */
+        -moz-border-radius-bottomleft: 8px;
+        -moz-border-radius-bottomright: 8px;
+        -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+        background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7);
+        /* webkit specific markup */
+        -webkit-border-bottom-left-radius: 8px;
+        -webkit-border-bottom-right-radius: 8px;
+        -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+        background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7F8FB), to(#EEF1F7));
+}
+
+dl.reflist dt {
+        padding: 5px;
+}
+
+dl.reflist dd {
+        margin: 0px 0px 10px 0px;
+        padding: 5px;
+}
+
+.paramkey {
+	text-align: right;
+}
+
+.paramtype {
+	white-space: nowrap;
+}
+
+.paramname {
+	color: #602020;
+	white-space: nowrap;
+}
+.paramname em {
+	font-style: normal;
+}
+
+.params, .retval, .exception, .tparams {
+        border-spacing: 6px 2px;
+}       
+
+.params .paramname, .retval .paramname {
+        font-weight: bold;
+        vertical-align: top;
+}
+        
+.params .paramtype {
+        font-style: italic;
+        vertical-align: top;
+}       
+        
+.params .paramdir {
+        font-family: "courier new",courier,monospace;
+        vertical-align: top;
+}
+
+
+
+
+/* @end */
+
+/* @group Directory (tree) */
+
+/* for the tree view */
+
+.ftvtree {
+	font-family: sans-serif;
+	margin: 0px;
+}
+
+/* these are for tree view when used as main index */
+
+.directory {
+	font-size: 9pt;
+	font-weight: bold;
+	margin: 5px;
+}
+
+.directory h3 {
+	margin: 0px;
+	margin-top: 1em;
+	font-size: 11pt;
+}
+
+/*
+The following two styles can be used to replace the root node title
+with an image of your choice.  Simply uncomment the next two styles,
+specify the name of your image and be sure to set 'height' to the
+proper pixel height of your image.
+*/
+
+/*
+.directory h3.swap {
+	height: 61px;
+	background-repeat: no-repeat;
+	background-image: url("yourimage.gif");
+}
+.directory h3.swap span {
+	display: none;
+}
+*/
+
+.directory > h3 {
+	margin-top: 0;
+}
+
+.directory p {
+	margin: 0px;
+	white-space: nowrap;
+}
+
+.directory div {
+	display: none;
+	margin: 0px;
+}
+
+.directory img {
+	vertical-align: -30%;
+}
+
+/* these are for tree view when not used as main index */
+
+.directory-alt {
+	font-size: 100%;
+	font-weight: bold;
+}
+
+.directory-alt h3 {
+	margin: 0px;
+	margin-top: 1em;
+	font-size: 11pt;
+}
+
+.directory-alt > h3 {
+	margin-top: 0;
+}
+
+.directory-alt p {
+	margin: 0px;
+	white-space: nowrap;
+}
+
+.directory-alt div {
+	display: none;
+	margin: 0px;
+}
+
+.directory-alt img {
+	vertical-align: -30%;
+}
+
+/* @end */
+
+div.dynheader {
+        margin-top: 8px;
+}
+
+address {
+	font-style: normal;
+	color: #2A3D61;
+}
+
+table.doxtable {
+	border-collapse:collapse;
+}
+
+table.doxtable td, table.doxtable th {
+	border: 1px solid #2D4068;
+	padding: 3px 7px 2px;
+}
+
+table.doxtable th {
+	background-color: #374F7F;
+	color: #FFFFFF;
+	font-size: 110%;
+	padding-bottom: 4px;
+	padding-top: 5px;
+	text-align:left;
+}
+
+table.fieldtable {
+        width: 100%;
+        margin-bottom: 10px;
+        border: 1px solid #A8B8D9;
+        border-spacing: 0px;
+        -moz-border-radius: 4px;
+        -webkit-border-radius: 4px;
+        border-radius: 4px;
+        -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
+        -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);
+        box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);
+}
+
+.fieldtable td, .fieldtable th {
+        padding: 3px 7px 2px;
+}
+
+.fieldtable td.fieldtype, .fieldtable td.fieldname {
+        white-space: nowrap;
+        border-right: 1px solid #A8B8D9;
+        border-bottom: 1px solid #A8B8D9;
+        vertical-align: top;
+}
+
+.fieldtable td.fielddoc {
+        border-bottom: 1px solid #A8B8D9;
+        width: 100%;
+}
+
+.fieldtable tr:last-child td {
+        border-bottom: none;
+}
+
+.fieldtable th {
+        background-image:url('nav_f.png');
+        background-repeat:repeat-x;
+        background-color: #E2E8F2;
+        font-size: 90%;
+        color: #253555;
+        padding-bottom: 4px;
+        padding-top: 5px;
+        text-align:left;
+        -moz-border-radius-topleft: 4px;
+        -moz-border-radius-topright: 4px;
+        -webkit-border-top-left-radius: 4px;
+        -webkit-border-top-right-radius: 4px;
+        border-top-left-radius: 4px;
+        border-top-right-radius: 4px;
+        border-bottom: 1px solid #A8B8D9;
+}
+
+
+.tabsearch {
+	top: 0px;
+	left: 10px;
+	height: 36px;
+	background-image: url('tab_b.png');
+	z-index: 101;
+	overflow: hidden;
+	font-size: 13px;
+}
+
+.navpath ul
+{
+	font-size: 11px;
+	background-image:url('tab_b.png');
+	background-repeat:repeat-x;
+	height:30px;
+	line-height:30px;
+	color:#8AA0CC;
+	border:solid 1px #C2CDE4;
+	overflow:hidden;
+	margin:0px;
+	padding:0px;
+}
+
+.navpath li
+{
+	list-style-type:none;
+	float:left;
+	padding-left:10px;
+	padding-right:15px;
+	background-image:url('bc_s.png');
+	background-repeat:no-repeat;
+	background-position:right;
+	color:#364D7C;
+}
+
+.navpath li.navelem a
+{
+	height:32px;
+	display:block;
+	text-decoration: none;
+	outline: none;
+}
+
+.navpath li.navelem a:hover
+{
+	color:#6884BD;
+}
+
+.navpath li.footer
+{
+        list-style-type:none;
+        float:right;
+        padding-left:10px;
+        padding-right:15px;
+        background-image:none;
+        background-repeat:no-repeat;
+        background-position:right;
+        color:#364D7C;
+        font-size: 8pt;
+}
+
+
+div.summary
+{
+	float: right;
+	font-size: 8pt;
+	padding-right: 5px;
+	width: 50%;
+	text-align: right;
+}       
+
+div.summary a
+{
+	white-space: nowrap;
+}
+
+div.ingroups
+{
+	margin-left: 5px;
+	font-size: 8pt;
+	padding-left: 5px;
+	width: 50%;
+	text-align: left;
+}
+
+div.ingroups a
+{
+	white-space: nowrap;
+}
+
+div.header
+{
+        background-image:url('nav_h.png');
+        background-repeat:repeat-x;
+	background-color: #F9FAFC;
+	margin:  0px;
+	border-bottom: 1px solid #C4CFE5;
+}
+
+div.headertitle
+{
+	padding: 5px 5px 5px 7px;
+}
+
+dl
+{
+        padding: 0 0 0 10px;
+}
+
+dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug
+{
+        border-left:4px solid;
+        padding: 0 0 0 6px;
+}
+
+dl.note
+{
+        border-color: #D0C000;
+}
+
+dl.warning, dl.attention
+{
+        border-color: #FF0000;
+}
+
+dl.pre, dl.post, dl.invariant
+{
+        border-color: #00D000;
+}
+
+dl.deprecated
+{
+        border-color: #505050;
+}
+
+dl.todo
+{
+        border-color: #00C0E0;
+}
+
+dl.test
+{
+        border-color: #3030E0;
+}
+
+dl.bug
+{
+        border-color: #C08050;
+}
+
+#projectlogo
+{
+	text-align: center;
+	vertical-align: bottom;
+	border-collapse: separate;
+}
+ 
+#projectlogo img
+{ 
+	border: 0px none;
+}
+ 
+#projectname
+{
+	font: 300% Tahoma, Arial,sans-serif;
+	margin: 0px;
+	padding: 2px 0px;
+}
+    
+#projectbrief
+{
+	font: 120% Tahoma, Arial,sans-serif;
+	margin: 0px;
+	padding: 0px;
+}
+
+#projectnumber
+{
+	font: 50% Tahoma, Arial,sans-serif;
+	margin: 0px;
+	padding: 0px;
+}
+
+#titlearea
+{
+	padding: 0px;
+	margin: 0px;
+	width: 100%;
+	border-bottom: 1px solid #5373B4;
+}
+
+.image
+{
+        text-align: center;
+}
+
+.dotgraph
+{
+        text-align: center;
+}
+
+.mscgraph
+{
+        text-align: center;
+}
+
+.caption
+{
+	font-weight: bold;
+}
+
+div.zoom
+{
+	border: 1px solid #90A5CE;
+}
+
+dl.citelist {
+        margin-bottom:50px;
+}
+
+dl.citelist dt {
+        color:#334975;
+        float:left;
+        font-weight:bold;
+        margin-right:10px;
+        padding:5px;
+}
+
+dl.citelist dd {
+        margin:2px 0;
+        padding:5px 0;
+}
+
+@media print
+{
+  #top { display: none; }
+  #side-nav { display: none; }
+  #nav-path { display: none; }
+  body { overflow:visible; }
+  h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }
+  .summary { display: none; }
+  .memitem { page-break-inside: avoid; }
+  #doc-content
+  {
+    margin-left:0 !important;
+    height:auto !important;
+    width:auto !important;
+    overflow:inherit;
+    display:inline;
+  }
+  pre.fragment
+  {
+    overflow: visible;
+    text-wrap: unrestricted;
+    white-space: -moz-pre-wrap; /* Moz */
+    white-space: -pre-wrap; /* Opera 4-6 */
+    white-space: -o-pre-wrap; /* Opera 7 */
+    white-space: pre-wrap; /* CSS3  */
+    word-wrap: break-word; /* IE 5.5+ */
+  }
+}
+
diff --git a/docs/html/reference/renderscript/globals.html b/docs/html/reference/renderscript/globals.html
new file mode 100644
index 0000000..f6fa413
--- /dev/null
+++ b/docs/html/reference/renderscript/globals.html
@@ -0,0 +1,720 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>Members</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow3" class="tabs2">
+    <ul class="tablist">
+      <li class="current"><a href="globals.html"><span>All</span></a></li>
+      <li><a href="globals_func.html"><span>Functions</span></a></li>
+      <li><a href="globals_type.html"><span>Typedefs</span></a></li>
+      <li><a href="globals_enum.html"><span>Enumerations</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow4" class="tabs3">
+    <ul class="tablist">
+      <li><a href="#index_a"><span>a</span></a></li>
+      <li><a href="#index_c"><span>c</span></a></li>
+      <li><a href="#index_d"><span>d</span></a></li>
+      <li><a href="#index_e"><span>e</span></a></li>
+      <li><a href="#index_f"><span>f</span></a></li>
+      <li><a href="#index_h"><span>h</span></a></li>
+      <li><a href="#index_i"><span>i</span></a></li>
+      <li><a href="#index_l"><span>l</span></a></li>
+      <li><a href="#index_m"><span>m</span></a></li>
+      <li><a href="#index_n"><span>n</span></a></li>
+      <li><a href="#index_p"><span>p</span></a></li>
+      <li><a href="#index_r"><span>r</span></a></li>
+      <li><a href="#index_s"><span>s</span></a></li>
+      <li><a href="#index_t"><span>t</span></a></li>
+      <li><a href="#index_u"><span>u</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<div class="textblock"> </div>
+
+<h3><a class="anchor" id="index_a"></a>- a -</h3><ul>
+<li>acos()
+: <a class="el" href="rs__cl_8rsh.html#a07648648c7f857cfd1479821d4389751">rs_cl.rsh</a>
+</li>
+<li>acosh()
+: <a class="el" href="rs__cl_8rsh.html#a6575106413ec72448439ef67f1309424">rs_cl.rsh</a>
+</li>
+<li>acospi()
+: <a class="el" href="rs__cl_8rsh.html#a2c0c7c00815bd480fcda80d1144ac20d">rs_cl.rsh</a>
+</li>
+<li>asin()
+: <a class="el" href="rs__cl_8rsh.html#a78b9d0583bd0699e2eac30d2a136817a">rs_cl.rsh</a>
+</li>
+<li>asinh()
+: <a class="el" href="rs__cl_8rsh.html#a4e3fe465ed5541af53192c59c80af1a0">rs_cl.rsh</a>
+</li>
+<li>asinpi()
+: <a class="el" href="rs__cl_8rsh.html#a679b63e86358fc962cb343eb6263496b">rs_cl.rsh</a>
+</li>
+<li>atan()
+: <a class="el" href="rs__cl_8rsh.html#ab790c3a7df8fcbeab77f6c0e3b4dcada">rs_cl.rsh</a>
+</li>
+<li>atan2()
+: <a class="el" href="rs__cl_8rsh.html#aaf4b636b09041878e1542054c73d81e9">rs_cl.rsh</a>
+</li>
+<li>atan2pi()
+: <a class="el" href="rs__cl_8rsh.html#a9aed0a1613c86acf5e4c5ad3290a4745">rs_cl.rsh</a>
+</li>
+<li>atanh()
+: <a class="el" href="rs__cl_8rsh.html#a83bdf415cc561ff6237a124273d9fb0d">rs_cl.rsh</a>
+</li>
+<li>atanpi()
+: <a class="el" href="rs__cl_8rsh.html#a420d4aaea0e53d7172845a21a1e648ea">rs_cl.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_c"></a>- c -</h3><ul>
+<li>cbrt()
+: <a class="el" href="rs__cl_8rsh.html#ae9d1787b55c2587478a24d96573225df">rs_cl.rsh</a>
+</li>
+<li>ceil()
+: <a class="el" href="rs__cl_8rsh.html#aa8fc6daff743a1b635ccbf9af83fe4e4">rs_cl.rsh</a>
+</li>
+<li>char2
+: <a class="el" href="rs__types_8rsh.html#ac532b4c1895c8bd4fb75dc370c484351">rs_types.rsh</a>
+</li>
+<li>char3
+: <a class="el" href="rs__types_8rsh.html#a4617fb31f4c03402515efee0a9b56210">rs_types.rsh</a>
+</li>
+<li>char4
+: <a class="el" href="rs__types_8rsh.html#aecb498648daac97c7cc5f31c242dfa03">rs_types.rsh</a>
+</li>
+<li>clamp()
+: <a class="el" href="rs__cl_8rsh.html#ad4dab580aba6cf15539b407b9163dfde">rs_cl.rsh</a>
+</li>
+<li>copysign()
+: <a class="el" href="rs__cl_8rsh.html#a29f2602d95aa7b3950e2b77b3e268f7e">rs_cl.rsh</a>
+</li>
+<li>cos()
+: <a class="el" href="rs__cl_8rsh.html#a8eec7aeb4b0c46b06cbcd1a3ac3e6f05">rs_cl.rsh</a>
+</li>
+<li>cosh()
+: <a class="el" href="rs__cl_8rsh.html#ac8d88d83182afd591401eaed101d9670">rs_cl.rsh</a>
+</li>
+<li>cospi()
+: <a class="el" href="rs__cl_8rsh.html#a07b12188bd53c6b584274892f6abf425">rs_cl.rsh</a>
+</li>
+<li>cross()
+: <a class="el" href="rs__cl_8rsh.html#a0f7beb26bb4aa30535babd14492a7e90">rs_cl.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_d"></a>- d -</h3><ul>
+<li>degrees()
+: <a class="el" href="rs__cl_8rsh.html#adc1b551193e66d8037daa1721df4d29c">rs_cl.rsh</a>
+</li>
+<li>distance()
+: <a class="el" href="rs__cl_8rsh.html#a4488863373be92e113e9d24aa3d21e76">rs_cl.rsh</a>
+</li>
+<li>dot()
+: <a class="el" href="rs__cl_8rsh.html#a70544acaca578035a849eef67d62c449">rs_cl.rsh</a>
+</li>
+<li>double2
+: <a class="el" href="rs__types_8rsh.html#a75ef868cedebc2a6eeb1bc6ca6ca49c3">rs_types.rsh</a>
+</li>
+<li>double3
+: <a class="el" href="rs__types_8rsh.html#aa3c90d5a23d674185a13e95402eda7eb">rs_types.rsh</a>
+</li>
+<li>double4
+: <a class="el" href="rs__types_8rsh.html#a60f4b04e076f0dd0ecc99c365fc4ca21">rs_types.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_e"></a>- e -</h3><ul>
+<li>erf()
+: <a class="el" href="rs__cl_8rsh.html#a139f102df651c25c26dd35d549173f57">rs_cl.rsh</a>
+</li>
+<li>erfc()
+: <a class="el" href="rs__cl_8rsh.html#a2e24dc8594e758b64c340153f67a533c">rs_cl.rsh</a>
+</li>
+<li>exp()
+: <a class="el" href="rs__cl_8rsh.html#a6d9aac64c2686961ca8f30e3c34fef36">rs_cl.rsh</a>
+</li>
+<li>exp10()
+: <a class="el" href="rs__cl_8rsh.html#a4b51589157c9ce600ea6156be51d8d18">rs_cl.rsh</a>
+</li>
+<li>exp2()
+: <a class="el" href="rs__cl_8rsh.html#a39bca19ee2b1aa95144e58eb4a1e4f88">rs_cl.rsh</a>
+</li>
+<li>expm1()
+: <a class="el" href="rs__cl_8rsh.html#a7996044b67be921a5e58e2fe76af66e2">rs_cl.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_f"></a>- f -</h3><ul>
+<li>fabs()
+: <a class="el" href="rs__cl_8rsh.html#ad6e897f1acae252ec0901e3b122992ea">rs_cl.rsh</a>
+</li>
+<li>fdim()
+: <a class="el" href="rs__cl_8rsh.html#ae7a7bac0f4e244594078f87b42c8716a">rs_cl.rsh</a>
+</li>
+<li>float2
+: <a class="el" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">rs_types.rsh</a>
+</li>
+<li>float3
+: <a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">rs_types.rsh</a>
+</li>
+<li>float4
+: <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">rs_types.rsh</a>
+</li>
+<li>floor()
+: <a class="el" href="rs__cl_8rsh.html#aae2da38a7246378dff8014ec407a30c3">rs_cl.rsh</a>
+</li>
+<li>fma()
+: <a class="el" href="rs__cl_8rsh.html#ac42909daec463fe449743e70baf8360d">rs_cl.rsh</a>
+</li>
+<li>fmax()
+: <a class="el" href="rs__cl_8rsh.html#a60f2072d8a746e7fe05cd46dea0fefcc">rs_cl.rsh</a>
+</li>
+<li>fmin()
+: <a class="el" href="rs__cl_8rsh.html#a1fd9d57c6c992866bf5161be2cf4c447">rs_cl.rsh</a>
+</li>
+<li>fmod()
+: <a class="el" href="rs__cl_8rsh.html#a31d5e179730ae44e1dbc74c1535f392e">rs_cl.rsh</a>
+</li>
+<li>fract()
+: <a class="el" href="rs__cl_8rsh.html#ac5277212e0df309a0a7c908424f7b14b">rs_cl.rsh</a>
+</li>
+<li>frexp()
+: <a class="el" href="rs__cl_8rsh.html#a778635fffed3cee8ab0800482ba53a30">rs_cl.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_h"></a>- h -</h3><ul>
+<li>hypot()
+: <a class="el" href="rs__cl_8rsh.html#a147f38d6e41f45de9b5e7c6f3dcac010">rs_cl.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_i"></a>- i -</h3><ul>
+<li>ilogb()
+: <a class="el" href="rs__cl_8rsh.html#aad9a8beba52acb77b1efeba432e6cc2c">rs_cl.rsh</a>
+</li>
+<li>int16_t
+: <a class="el" href="rs__types_8rsh.html#aa343fa3b3d06292b959ffdd4c4703b06">rs_types.rsh</a>
+</li>
+<li>int2
+: <a class="el" href="rs__types_8rsh.html#a6bc1fa1354fe2145b8f12b4bbfafcf4c">rs_types.rsh</a>
+</li>
+<li>int3
+: <a class="el" href="rs__types_8rsh.html#ad5512266b63fd06dcf450f6c9d5326c8">rs_types.rsh</a>
+</li>
+<li>int32_t
+: <a class="el" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">rs_types.rsh</a>
+</li>
+<li>int4
+: <a class="el" href="rs__types_8rsh.html#a897deab71f679999ed99d4153c797e70">rs_types.rsh</a>
+</li>
+<li>int64_t
+: <a class="el" href="rs__types_8rsh.html#a996e72f71b11a5bb8b3b7b6936b1516d">rs_types.rsh</a>
+</li>
+<li>int8_t
+: <a class="el" href="rs__types_8rsh.html#ad566f6541e98b74246db1a3a3a85ad49">rs_types.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_l"></a>- l -</h3><ul>
+<li>ldexp()
+: <a class="el" href="rs__cl_8rsh.html#a013bc1dcda984cbc608e123ed38491e6">rs_cl.rsh</a>
+</li>
+<li>length()
+: <a class="el" href="rs__cl_8rsh.html#a1a222b7879342279e1e0070d6afd9e18">rs_cl.rsh</a>
+</li>
+<li>lgamma()
+: <a class="el" href="rs__cl_8rsh.html#a735f4e14e33c50348ef41220f9210bcc">rs_cl.rsh</a>
+</li>
+<li>log()
+: <a class="el" href="rs__cl_8rsh.html#a3ff85f5f4b206ecf9ec9d128d7d18a08">rs_cl.rsh</a>
+</li>
+<li>log10()
+: <a class="el" href="rs__cl_8rsh.html#af5c1bdba2a13aa2e2b0722287f6a919f">rs_cl.rsh</a>
+</li>
+<li>log1p()
+: <a class="el" href="rs__cl_8rsh.html#ae10541ede49062ef7f977712c4878c1f">rs_cl.rsh</a>
+</li>
+<li>log2()
+: <a class="el" href="rs__cl_8rsh.html#a2fb571ae932f671ff3e9e97f2d3fabb7">rs_cl.rsh</a>
+</li>
+<li>logb()
+: <a class="el" href="rs__cl_8rsh.html#a28742d6ce2f20a61f16ecc08ed499871">rs_cl.rsh</a>
+</li>
+<li>long2
+: <a class="el" href="rs__types_8rsh.html#afd55d62cee0785034b73375acd0df9da">rs_types.rsh</a>
+</li>
+<li>long3
+: <a class="el" href="rs__types_8rsh.html#ad9cedbf4050fad14138d1dcb3428ec18">rs_types.rsh</a>
+</li>
+<li>long4
+: <a class="el" href="rs__types_8rsh.html#ae177e4918f36e5c9da36d524cdb7a2e7">rs_types.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_m"></a>- m -</h3><ul>
+<li>mad()
+: <a class="el" href="rs__cl_8rsh.html#a4f9086698f1eb466ba2dccf7e331cdc3">rs_cl.rsh</a>
+</li>
+<li>mix()
+: <a class="el" href="rs__cl_8rsh.html#af4c76d51368c8e330cb59ea5a0a2310e">rs_cl.rsh</a>
+</li>
+<li>modf()
+: <a class="el" href="rs__cl_8rsh.html#a841633bcdcaeb6a514d9c6460f0adf2d">rs_cl.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_n"></a>- n -</h3><ul>
+<li>nextafter()
+: <a class="el" href="rs__cl_8rsh.html#adb11df05fb9985595af0a7bd882bdeac">rs_cl.rsh</a>
+</li>
+<li>normalize()
+: <a class="el" href="rs__cl_8rsh.html#a373e03e92a1b7f3fdea5ca4ca159d2a8">rs_cl.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_p"></a>- p -</h3><ul>
+<li>pow()
+: <a class="el" href="rs__cl_8rsh.html#a9243de1d67fcc847a89f95748d664b19">rs_cl.rsh</a>
+</li>
+<li>pown()
+: <a class="el" href="rs__cl_8rsh.html#afd46205452017b741abb2e17fc28557d">rs_cl.rsh</a>
+</li>
+<li>powr()
+: <a class="el" href="rs__cl_8rsh.html#a3ff65421721ec8e6ce8d875a563d005f">rs_cl.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_r"></a>- r -</h3><ul>
+<li>radians()
+: <a class="el" href="rs__cl_8rsh.html#aaef2526c4d190ba6f7301b4e810917a7">rs_cl.rsh</a>
+</li>
+<li>remainder()
+: <a class="el" href="rs__cl_8rsh.html#a5188ac0e3af95b0956c6abeafb74fda9">rs_cl.rsh</a>
+</li>
+<li>rint()
+: <a class="el" href="rs__cl_8rsh.html#adb0ffe344ae56ca7fc9083c1f2943e55">rs_cl.rsh</a>
+</li>
+<li>rootn()
+: <a class="el" href="rs__cl_8rsh.html#af169e7e1c575b7c24c1834569223077f">rs_cl.rsh</a>
+</li>
+<li>round()
+: <a class="el" href="rs__cl_8rsh.html#aff4846ab5b947550814d5414a2c3626f">rs_cl.rsh</a>
+</li>
+<li>rs_for_each_strategy
+: <a class="el" href="rs__core_8rsh.html#ae1755c901e8acb42510ad10b4e104746">rs_core.rsh</a>
+</li>
+<li>rs_quaternion
+: <a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_types.rsh</a>
+</li>
+<li>rs_script_call_t
+: <a class="el" href="rs__core_8rsh.html#ae8756b32e23445f287960b9d0ffb449c">rs_core.rsh</a>
+</li>
+<li>rs_time_t
+: <a class="el" href="rs__time_8rsh.html#ad2b4759a0a6a98bd79b7ad82a4b057d6">rs_time.rsh</a>
+</li>
+<li>rsAllocationGetDimFaces()
+: <a class="el" href="rs__allocation_8rsh.html#ac85f7ed88f38b35482c6d63b56d470fe">rs_allocation.rsh</a>
+</li>
+<li>rsAllocationGetDimLOD()
+: <a class="el" href="rs__allocation_8rsh.html#ac42a07c079d6b3c6bb21975170d4e11c">rs_allocation.rsh</a>
+</li>
+<li>rsAllocationGetDimX()
+: <a class="el" href="rs__allocation_8rsh.html#a3ca7f505a97d5b7f477bc65b9e77dafb">rs_allocation.rsh</a>
+</li>
+<li>rsAllocationGetDimY()
+: <a class="el" href="rs__allocation_8rsh.html#ac889b866b465580eb313e5d2a9fcac3d">rs_allocation.rsh</a>
+</li>
+<li>rsAllocationGetDimZ()
+: <a class="el" href="rs__allocation_8rsh.html#acd6f1a2b2443e6ea39e6154577645d2c">rs_allocation.rsh</a>
+</li>
+<li>rsClamp()
+: <a class="el" href="rs__math_8rsh.html#ad36abebbb36ffc5312fb2ed8baf98d39">rs_math.rsh</a>
+</li>
+<li>rsClearObject()
+: <a class="el" href="rs__object_8rsh.html#aab5f47dc11b9044b3d02c4ed818fe6e7">rs_object.rsh</a>
+</li>
+<li>rsDebug()
+: <a class="el" href="rs__debug_8rsh.html#a9a86fd617111dee78b3179a293afb66c">rs_debug.rsh</a>
+</li>
+<li>rsExtractFrustumPlanes()
+: <a class="el" href="rs__math_8rsh.html#a191f9c687c56322c18b7d71491602122">rs_math.rsh</a>
+</li>
+<li>rsForEach()
+: <a class="el" href="rs__core_8rsh.html#a95ebbf7a8923193df144649c066daae6">rs_core.rsh</a>
+</li>
+<li>rsFrac()
+: <a class="el" href="rs__math_8rsh.html#ac4f127e78da0849321c7f6db14f9e989">rs_math.rsh</a>
+</li>
+<li>rsgAllocationSyncAll()
+: <a class="el" href="rs__graphics_8rsh.html#a647228d8e15da6ad67a97701d920dcac">rs_graphics.rsh</a>
+</li>
+<li>rsgBindFont()
+: <a class="el" href="rs__graphics_8rsh.html#ae89effef281e92e2940055883ea366d4">rs_graphics.rsh</a>
+</li>
+<li>rsgBindProgramFragment()
+: <a class="el" href="rs__graphics_8rsh.html#a9f8deb600729a83c39c5bcaba2152b9c">rs_graphics.rsh</a>
+</li>
+<li>rsgBindProgramRaster()
+: <a class="el" href="rs__graphics_8rsh.html#a391eb5535544f6312c724b910da6ec35">rs_graphics.rsh</a>
+</li>
+<li>rsgBindProgramStore()
+: <a class="el" href="rs__graphics_8rsh.html#a34dfa6eddd7454fc1865222c5a022315">rs_graphics.rsh</a>
+</li>
+<li>rsgBindProgramVertex()
+: <a class="el" href="rs__graphics_8rsh.html#a894e26d0d05d3ef99be65ddf98dd901c">rs_graphics.rsh</a>
+</li>
+<li>rsgBindSampler()
+: <a class="el" href="rs__graphics_8rsh.html#a4ade6c5acbf6acaa1c29a1aecc6e87d3">rs_graphics.rsh</a>
+</li>
+<li>rsgBindTexture()
+: <a class="el" href="rs__graphics_8rsh.html#a1694eb5489bd3a444da921dbf16aeeb5">rs_graphics.rsh</a>
+</li>
+<li>rsgClearColor()
+: <a class="el" href="rs__graphics_8rsh.html#a147674fed92745fbb5c64a6300ca3c49">rs_graphics.rsh</a>
+</li>
+<li>rsgClearDepth()
+: <a class="el" href="rs__graphics_8rsh.html#a4bedb06e8facd587e3eacd746fe3e727">rs_graphics.rsh</a>
+</li>
+<li>rsgDrawMesh()
+: <a class="el" href="rs__graphics_8rsh.html#a6f8b87c994810908fbe5e01f8f63f9af">rs_graphics.rsh</a>
+</li>
+<li>rsgDrawQuad()
+: <a class="el" href="rs__graphics_8rsh.html#ad6953da0349e58547b08b8ce174ed3fc">rs_graphics.rsh</a>
+</li>
+<li>rsgDrawQuadTexCoords()
+: <a class="el" href="rs__graphics_8rsh.html#afb98a59bb9f878f0a09459567c269e64">rs_graphics.rsh</a>
+</li>
+<li>rsgDrawRect()
+: <a class="el" href="rs__graphics_8rsh.html#a80c51849bf12ec6c699c23c3fa3e6208">rs_graphics.rsh</a>
+</li>
+<li>rsgDrawSpriteScreenspace()
+: <a class="el" href="rs__graphics_8rsh.html#a07d15127330fa1dff6c99b0d7d14e65e">rs_graphics.rsh</a>
+</li>
+<li>rsgDrawText()
+: <a class="el" href="rs__graphics_8rsh.html#afaec82492762e62cad1ff53ada479b14">rs_graphics.rsh</a>
+</li>
+<li>rsGetAllocation()
+: <a class="el" href="rs__allocation_8rsh.html#aadad7654929c451be299df125061c9ba">rs_allocation.rsh</a>
+</li>
+<li>rsGetDt()
+: <a class="el" href="rs__time_8rsh.html#adea2682186fd903752431ad848bd8bf4">rs_time.rsh</a>
+</li>
+<li>rsGetElementAt()
+: <a class="el" href="rs__allocation_8rsh.html#a3fd30b4388748601e025bb3566ce0cbc">rs_allocation.rsh</a>
+</li>
+<li>rsgFontColor()
+: <a class="el" href="rs__graphics_8rsh.html#abda8c344092ed6310c7a8f353a6df876">rs_graphics.rsh</a>
+</li>
+<li>rsgGetHeight()
+: <a class="el" href="rs__graphics_8rsh.html#a7e6565cd5d5e44f442a8bf8ba68f4681">rs_graphics.rsh</a>
+</li>
+<li>rsgGetWidth()
+: <a class="el" href="rs__graphics_8rsh.html#a67f4ed1ca4bba27d5c952ada89cd0717">rs_graphics.rsh</a>
+</li>
+<li>rsgMeasureText()
+: <a class="el" href="rs__graphics_8rsh.html#a5c599f4ea989f3d0616cbf8e983688c4">rs_graphics.rsh</a>
+</li>
+<li>rsgMeshComputeBoundingBox()
+: <a class="el" href="rs__graphics_8rsh.html#a0978c54902dd1d60180f8dbb0b781105">rs_graphics.rsh</a>
+</li>
+<li>rsgProgramFragmentConstantColor()
+: <a class="el" href="rs__graphics_8rsh.html#a35ac8c3759e25047e6a458c15520c887">rs_graphics.rsh</a>
+</li>
+<li>rsgProgramVertexGetProjectionMatrix()
+: <a class="el" href="rs__graphics_8rsh.html#a2b767d209b36ffcd2e0fc0cf6f4c5706">rs_graphics.rsh</a>
+</li>
+<li>rsgProgramVertexLoadModelMatrix()
+: <a class="el" href="rs__graphics_8rsh.html#a976b8594cccb4b94d7ce520b44d884e3">rs_graphics.rsh</a>
+</li>
+<li>rsgProgramVertexLoadProjectionMatrix()
+: <a class="el" href="rs__graphics_8rsh.html#a83a87d8efa3f26ed3f8fb25e49f29059">rs_graphics.rsh</a>
+</li>
+<li>rsgProgramVertexLoadTextureMatrix()
+: <a class="el" href="rs__graphics_8rsh.html#a377b7b394c4bf0881532b1241d4be168">rs_graphics.rsh</a>
+</li>
+<li>rsIsObject()
+: <a class="el" href="rs__object_8rsh.html#ac1d6da920f12974b3633d25ed078da2d">rs_object.rsh</a>
+</li>
+<li>rsIsSphereInFrustum()
+: <a class="el" href="rs__math_8rsh.html#a7bbeaf44838e08e68d5cf3e3d7b0818c">rs_math.rsh</a>
+</li>
+<li>rsLocaltime()
+: <a class="el" href="rs__time_8rsh.html#a08a8fcadae964f7416aef487da624110">rs_time.rsh</a>
+</li>
+<li>rsMatrixGet()
+: <a class="el" href="rs__matrix_8rsh.html#af1fb87eb02f166bb85ef10a92333bb49">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixInverse()
+: <a class="el" href="rs__matrix_8rsh.html#a00b6a334ba5ac94d84850f22ec9f4de5">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixInverseTranspose()
+: <a class="el" href="rs__matrix_8rsh.html#ac05080d52da2d99a759ef34fa0655e82">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixLoad()
+: <a class="el" href="rs__matrix_8rsh.html#a06176acb38405937cb94c835a712a3b3">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixLoadFrustum()
+: <a class="el" href="rs__matrix_8rsh.html#ad25760aaf01e95d0055237afab41bbb3">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixLoadIdentity()
+: <a class="el" href="rs__matrix_8rsh.html#a0ffd9de971cf10d0a663ff565be8d3cc">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixLoadMultiply()
+: <a class="el" href="rs__matrix_8rsh.html#a79f14c4c0f5ecc1bbd0bf54da8b653ef">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixLoadOrtho()
+: <a class="el" href="rs__matrix_8rsh.html#a4c59884a0e534dbbcdc5655842732d43">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixLoadPerspective()
+: <a class="el" href="rs__matrix_8rsh.html#aa404c34d7478f2921f7415d2da95d02b">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixLoadRotate()
+: <a class="el" href="rs__matrix_8rsh.html#a268032f3ac6d766b1d7fe72a6cb50464">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixLoadScale()
+: <a class="el" href="rs__matrix_8rsh.html#acaf51d1f9ad5041ce01fbf8b7c5923fd">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixLoadTranslate()
+: <a class="el" href="rs__matrix_8rsh.html#a1b521c8a3d1260fa732cbf0a71af0e74">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixMultiply()
+: <a class="el" href="rs__matrix_8rsh.html#a4d9a8bb7c3f5d67b14fa349bdd531d13">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixRotate()
+: <a class="el" href="rs__matrix_8rsh.html#ad5ed05ca4880397fb29615e3c6798de1">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixScale()
+: <a class="el" href="rs__matrix_8rsh.html#a94cc6b22bd1a6c07a9a1c1d21afb392c">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixSet()
+: <a class="el" href="rs__matrix_8rsh.html#a68e320f7fa2cc5a5b4759e3ab679ee10">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixTranslate()
+: <a class="el" href="rs__matrix_8rsh.html#a4df5f9b5bb6044f3c3426f2f58b94405">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixTranspose()
+: <a class="el" href="rs__matrix_8rsh.html#ac52acb31a705f6c68af8bddea0e79969">rs_matrix.rsh</a>
+</li>
+<li>rsPackColorTo8888()
+: <a class="el" href="rs__math_8rsh.html#a22e0be7e18b317a7453ebad4300934f6">rs_math.rsh</a>
+</li>
+<li>rsqrt()
+: <a class="el" href="rs__cl_8rsh.html#a5db00fde9e6bff693a38f3a37e7a1f70">rs_cl.rsh</a>
+</li>
+<li>rsQuaternionAdd()
+: <a class="el" href="rs__quaternion_8rsh.html#a5e6e493b9917336b0d9118fdd4e91444">rs_quaternion.rsh</a>
+</li>
+<li>rsQuaternionConjugate()
+: <a class="el" href="rs__quaternion_8rsh.html#acd670264e49743d35f38028b8e2a8800">rs_quaternion.rsh</a>
+</li>
+<li>rsQuaternionDot()
+: <a class="el" href="rs__quaternion_8rsh.html#aa810f8857439564e7b3be771f47b40ca">rs_quaternion.rsh</a>
+</li>
+<li>rsQuaternionGetMatrixUnit()
+: <a class="el" href="rs__quaternion_8rsh.html#a7726c524868c49892976fec53ea0693b">rs_quaternion.rsh</a>
+</li>
+<li>rsQuaternionLoadRotate()
+: <a class="el" href="rs__quaternion_8rsh.html#adf4423c521e34f3cf29d5dd5b5a93de0">rs_quaternion.rsh</a>
+</li>
+<li>rsQuaternionLoadRotateUnit()
+: <a class="el" href="rs__quaternion_8rsh.html#aa72a43cf3d7b5924de1ddfaa5766db09">rs_quaternion.rsh</a>
+</li>
+<li>rsQuaternionMultiply()
+: <a class="el" href="rs__quaternion_8rsh.html#a4f3d214912facf72f6a6d57e95aa3c3b">rs_quaternion.rsh</a>
+</li>
+<li>rsQuaternionNormalize()
+: <a class="el" href="rs__quaternion_8rsh.html#abb31aad2416044ad5bbf44ee7c838e2a">rs_quaternion.rsh</a>
+</li>
+<li>rsQuaternionSet()
+: <a class="el" href="rs__quaternion_8rsh.html#a249782133e54f13a8096d1fbe295714d">rs_quaternion.rsh</a>
+</li>
+<li>rsQuaternionSlerp()
+: <a class="el" href="rs__quaternion_8rsh.html#a7da94a30e287cbb8148771a5cd768dbd">rs_quaternion.rsh</a>
+</li>
+<li>rsRand()
+: <a class="el" href="rs__math_8rsh.html#a03e898d810ac44158e7461b2b2b1c356">rs_math.rsh</a>
+</li>
+<li>rsSendToClient()
+: <a class="el" href="rs__core_8rsh.html#a508003cadad2d37d41e2de7e9226f859">rs_core.rsh</a>
+</li>
+<li>rsSendToClientBlocking()
+: <a class="el" href="rs__core_8rsh.html#afc93b00be08f58512a6ab6a87feb9515">rs_core.rsh</a>
+</li>
+<li>rsSetObject()
+: <a class="el" href="rs__object_8rsh.html#a5132f90b4aaf8d2e35e6ad021fb08175">rs_object.rsh</a>
+</li>
+<li>rsTime()
+: <a class="el" href="rs__time_8rsh.html#a555f9324acb8c3d0c6f09a1d05478ce2">rs_time.rsh</a>
+</li>
+<li>rsUnpackColor8888()
+: <a class="el" href="rs__math_8rsh.html#a26525a4f5093bd0f13191efe06127f4b">rs_math.rsh</a>
+</li>
+<li>rsUptimeMillis()
+: <a class="el" href="rs__time_8rsh.html#a3c406e51a769718dd1c760518b9cad44">rs_time.rsh</a>
+</li>
+<li>rsUptimeNanos()
+: <a class="el" href="rs__time_8rsh.html#a24e2cc12acf1e7fdd857d1a48981395d">rs_time.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_s"></a>- s -</h3><ul>
+<li>short2
+: <a class="el" href="rs__types_8rsh.html#a303d3ad18aaeacfcfeda2b8580b98796">rs_types.rsh</a>
+</li>
+<li>short3
+: <a class="el" href="rs__types_8rsh.html#a3f4967691ae2b249511b5f3dd9e18793">rs_types.rsh</a>
+</li>
+<li>short4
+: <a class="el" href="rs__types_8rsh.html#a198219da0b1d51c8d7f8f12aad7e502d">rs_types.rsh</a>
+</li>
+<li>sign()
+: <a class="el" href="rs__cl_8rsh.html#a3e6d477a06dec7070f073eec9d8f420c">rs_cl.rsh</a>
+</li>
+<li>sin()
+: <a class="el" href="rs__cl_8rsh.html#a8c8cd526b44eb55aede77cf659f24306">rs_cl.rsh</a>
+</li>
+<li>sincos()
+: <a class="el" href="rs__cl_8rsh.html#a240f7c7c20b432a30dc660b5dd4cd320">rs_cl.rsh</a>
+</li>
+<li>sinh()
+: <a class="el" href="rs__cl_8rsh.html#ae686e0cc567f7ee2b0a84706aa486e4a">rs_cl.rsh</a>
+</li>
+<li>sinpi()
+: <a class="el" href="rs__cl_8rsh.html#a4fe4fef049786e888526d6f37b912b0a">rs_cl.rsh</a>
+</li>
+<li>size_t
+: <a class="el" href="rs__types_8rsh.html#a29d85914ddff32967d85ada69854206d">rs_types.rsh</a>
+</li>
+<li>sqrt()
+: <a class="el" href="rs__cl_8rsh.html#a92da0faef80c4d8f66e954c8c169a729">rs_cl.rsh</a>
+</li>
+<li>ssize_t
+: <a class="el" href="rs__types_8rsh.html#a170745d0d946e79c4c2a056d1d158996">rs_types.rsh</a>
+</li>
+<li>step()
+: <a class="el" href="rs__cl_8rsh.html#a4f7ba6882099d16853d0415982121900">rs_cl.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_t"></a>- t -</h3><ul>
+<li>tan()
+: <a class="el" href="rs__cl_8rsh.html#af12e245af8ff9bb72b5000e7c26cd8fe">rs_cl.rsh</a>
+</li>
+<li>tanh()
+: <a class="el" href="rs__cl_8rsh.html#abc36e89ddb87ea78451d1c5921ddbd8d">rs_cl.rsh</a>
+</li>
+<li>tanpi()
+: <a class="el" href="rs__cl_8rsh.html#ad8bfb083dd3979a305e594a0d6e581c4">rs_cl.rsh</a>
+</li>
+<li>tgamma()
+: <a class="el" href="rs__cl_8rsh.html#ab9f4cbfd2470420ee302f28cf3de6dd0">rs_cl.rsh</a>
+</li>
+<li>trunc()
+: <a class="el" href="rs__cl_8rsh.html#ad1a7c65693231219db1babeae1c41f15">rs_cl.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_u"></a>- u -</h3><ul>
+<li>uchar
+: <a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">rs_types.rsh</a>
+</li>
+<li>uchar2
+: <a class="el" href="rs__types_8rsh.html#aff5eb7cd53a34bb01924bf64485296de">rs_types.rsh</a>
+</li>
+<li>uchar3
+: <a class="el" href="rs__types_8rsh.html#a247b5eacf2b662849668cbc33120343f">rs_types.rsh</a>
+</li>
+<li>uchar4
+: <a class="el" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">rs_types.rsh</a>
+</li>
+<li>uint
+: <a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">rs_types.rsh</a>
+</li>
+<li>uint16_t
+: <a class="el" href="rs__types_8rsh.html#a273cf69d639a59973b6019625df33e30">rs_types.rsh</a>
+</li>
+<li>uint2
+: <a class="el" href="rs__types_8rsh.html#aaf90cd1f01a121e824fc6e1b927e7683">rs_types.rsh</a>
+</li>
+<li>uint3
+: <a class="el" href="rs__types_8rsh.html#ae80e36ac834c891aa76b09a220344e78">rs_types.rsh</a>
+</li>
+<li>uint32_t
+: <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">rs_types.rsh</a>
+</li>
+<li>uint4
+: <a class="el" href="rs__types_8rsh.html#ad92f0ec6c2cdc1f11a6d7fe321047462">rs_types.rsh</a>
+</li>
+<li>uint64_t
+: <a class="el" href="rs__types_8rsh.html#aaa5d1cd013383c889537491c3cfd9aad">rs_types.rsh</a>
+</li>
+<li>uint8_t
+: <a class="el" href="rs__types_8rsh.html#aba7bc1797add20fe3efdf37ced1182c5">rs_types.rsh</a>
+</li>
+<li>ulong
+: <a class="el" href="rs__types_8rsh.html#ab46637ef82283186e57f54756fe67203">rs_types.rsh</a>
+</li>
+<li>ulong2
+: <a class="el" href="rs__types_8rsh.html#a56988b12ab16acf753356f7a5c70565a">rs_types.rsh</a>
+</li>
+<li>ulong3
+: <a class="el" href="rs__types_8rsh.html#ac623a569c28935fbedd3a8ed27ae0696">rs_types.rsh</a>
+</li>
+<li>ulong4
+: <a class="el" href="rs__types_8rsh.html#a3029c54b8e1779a1ddbdfe875432d137">rs_types.rsh</a>
+</li>
+<li>ushort
+: <a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">rs_types.rsh</a>
+</li>
+<li>ushort2
+: <a class="el" href="rs__types_8rsh.html#a24a9d78cfc32475e2c6eb1cdec239bf2">rs_types.rsh</a>
+</li>
+<li>ushort3
+: <a class="el" href="rs__types_8rsh.html#ab78391445785d2ca0276392a9c97fcba">rs_types.rsh</a>
+</li>
+<li>ushort4
+: <a class="el" href="rs__types_8rsh.html#a77a09fa01d7fc721bbc44c32aac2d487">rs_types.rsh</a>
+</li>
+</ul>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/globals_enum.html b/docs/html/reference/renderscript/globals_enum.html
new file mode 100644
index 0000000..7301432
--- /dev/null
+++ b/docs/html/reference/renderscript/globals_enum.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>Members</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow3" class="tabs2">
+    <ul class="tablist">
+      <li><a href="globals.html"><span>All</span></a></li>
+      <li><a href="globals_func.html"><span>Functions</span></a></li>
+      <li><a href="globals_type.html"><span>Typedefs</span></a></li>
+      <li class="current"><a href="globals_enum.html"><span>Enumerations</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+&#160;<ul>
+<li>rs_for_each_strategy
+: <a class="el" href="rs__core_8rsh.html#ae1755c901e8acb42510ad10b4e104746">rs_core.rsh</a>
+</li>
+</ul>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/globals_func.html b/docs/html/reference/renderscript/globals_func.html
new file mode 100644
index 0000000..5886454
--- /dev/null
+++ b/docs/html/reference/renderscript/globals_func.html
@@ -0,0 +1,571 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>Members</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow3" class="tabs2">
+    <ul class="tablist">
+      <li><a href="globals.html"><span>All</span></a></li>
+      <li class="current"><a href="globals_func.html"><span>Functions</span></a></li>
+      <li><a href="globals_type.html"><span>Typedefs</span></a></li>
+      <li><a href="globals_enum.html"><span>Enumerations</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow4" class="tabs3">
+    <ul class="tablist">
+      <li><a href="#index_a"><span>a</span></a></li>
+      <li><a href="#index_c"><span>c</span></a></li>
+      <li><a href="#index_d"><span>d</span></a></li>
+      <li><a href="#index_e"><span>e</span></a></li>
+      <li><a href="#index_f"><span>f</span></a></li>
+      <li><a href="#index_h"><span>h</span></a></li>
+      <li><a href="#index_i"><span>i</span></a></li>
+      <li><a href="#index_l"><span>l</span></a></li>
+      <li><a href="#index_m"><span>m</span></a></li>
+      <li><a href="#index_n"><span>n</span></a></li>
+      <li><a href="#index_p"><span>p</span></a></li>
+      <li><a href="#index_r"><span>r</span></a></li>
+      <li><a href="#index_s"><span>s</span></a></li>
+      <li><a href="#index_t"><span>t</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_a"></a>- a -</h3><ul>
+<li>acos()
+: <a class="el" href="rs__cl_8rsh.html#a07648648c7f857cfd1479821d4389751">rs_cl.rsh</a>
+</li>
+<li>acosh()
+: <a class="el" href="rs__cl_8rsh.html#a6575106413ec72448439ef67f1309424">rs_cl.rsh</a>
+</li>
+<li>acospi()
+: <a class="el" href="rs__cl_8rsh.html#a2c0c7c00815bd480fcda80d1144ac20d">rs_cl.rsh</a>
+</li>
+<li>asin()
+: <a class="el" href="rs__cl_8rsh.html#a78b9d0583bd0699e2eac30d2a136817a">rs_cl.rsh</a>
+</li>
+<li>asinh()
+: <a class="el" href="rs__cl_8rsh.html#a4e3fe465ed5541af53192c59c80af1a0">rs_cl.rsh</a>
+</li>
+<li>asinpi()
+: <a class="el" href="rs__cl_8rsh.html#a679b63e86358fc962cb343eb6263496b">rs_cl.rsh</a>
+</li>
+<li>atan()
+: <a class="el" href="rs__cl_8rsh.html#ab790c3a7df8fcbeab77f6c0e3b4dcada">rs_cl.rsh</a>
+</li>
+<li>atan2()
+: <a class="el" href="rs__cl_8rsh.html#aaf4b636b09041878e1542054c73d81e9">rs_cl.rsh</a>
+</li>
+<li>atan2pi()
+: <a class="el" href="rs__cl_8rsh.html#a9aed0a1613c86acf5e4c5ad3290a4745">rs_cl.rsh</a>
+</li>
+<li>atanh()
+: <a class="el" href="rs__cl_8rsh.html#a83bdf415cc561ff6237a124273d9fb0d">rs_cl.rsh</a>
+</li>
+<li>atanpi()
+: <a class="el" href="rs__cl_8rsh.html#a420d4aaea0e53d7172845a21a1e648ea">rs_cl.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_c"></a>- c -</h3><ul>
+<li>cbrt()
+: <a class="el" href="rs__cl_8rsh.html#ae9d1787b55c2587478a24d96573225df">rs_cl.rsh</a>
+</li>
+<li>ceil()
+: <a class="el" href="rs__cl_8rsh.html#aa8fc6daff743a1b635ccbf9af83fe4e4">rs_cl.rsh</a>
+</li>
+<li>clamp()
+: <a class="el" href="rs__cl_8rsh.html#ad4dab580aba6cf15539b407b9163dfde">rs_cl.rsh</a>
+</li>
+<li>copysign()
+: <a class="el" href="rs__cl_8rsh.html#a29f2602d95aa7b3950e2b77b3e268f7e">rs_cl.rsh</a>
+</li>
+<li>cos()
+: <a class="el" href="rs__cl_8rsh.html#a8eec7aeb4b0c46b06cbcd1a3ac3e6f05">rs_cl.rsh</a>
+</li>
+<li>cosh()
+: <a class="el" href="rs__cl_8rsh.html#ac8d88d83182afd591401eaed101d9670">rs_cl.rsh</a>
+</li>
+<li>cospi()
+: <a class="el" href="rs__cl_8rsh.html#a07b12188bd53c6b584274892f6abf425">rs_cl.rsh</a>
+</li>
+<li>cross()
+: <a class="el" href="rs__cl_8rsh.html#a0f7beb26bb4aa30535babd14492a7e90">rs_cl.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_d"></a>- d -</h3><ul>
+<li>degrees()
+: <a class="el" href="rs__cl_8rsh.html#adc1b551193e66d8037daa1721df4d29c">rs_cl.rsh</a>
+</li>
+<li>distance()
+: <a class="el" href="rs__cl_8rsh.html#a4488863373be92e113e9d24aa3d21e76">rs_cl.rsh</a>
+</li>
+<li>dot()
+: <a class="el" href="rs__cl_8rsh.html#a70544acaca578035a849eef67d62c449">rs_cl.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_e"></a>- e -</h3><ul>
+<li>erf()
+: <a class="el" href="rs__cl_8rsh.html#a139f102df651c25c26dd35d549173f57">rs_cl.rsh</a>
+</li>
+<li>erfc()
+: <a class="el" href="rs__cl_8rsh.html#a2e24dc8594e758b64c340153f67a533c">rs_cl.rsh</a>
+</li>
+<li>exp()
+: <a class="el" href="rs__cl_8rsh.html#a6d9aac64c2686961ca8f30e3c34fef36">rs_cl.rsh</a>
+</li>
+<li>exp10()
+: <a class="el" href="rs__cl_8rsh.html#a4b51589157c9ce600ea6156be51d8d18">rs_cl.rsh</a>
+</li>
+<li>exp2()
+: <a class="el" href="rs__cl_8rsh.html#a39bca19ee2b1aa95144e58eb4a1e4f88">rs_cl.rsh</a>
+</li>
+<li>expm1()
+: <a class="el" href="rs__cl_8rsh.html#a7996044b67be921a5e58e2fe76af66e2">rs_cl.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_f"></a>- f -</h3><ul>
+<li>fabs()
+: <a class="el" href="rs__cl_8rsh.html#ad6e897f1acae252ec0901e3b122992ea">rs_cl.rsh</a>
+</li>
+<li>fdim()
+: <a class="el" href="rs__cl_8rsh.html#ae7a7bac0f4e244594078f87b42c8716a">rs_cl.rsh</a>
+</li>
+<li>floor()
+: <a class="el" href="rs__cl_8rsh.html#aae2da38a7246378dff8014ec407a30c3">rs_cl.rsh</a>
+</li>
+<li>fma()
+: <a class="el" href="rs__cl_8rsh.html#ac42909daec463fe449743e70baf8360d">rs_cl.rsh</a>
+</li>
+<li>fmax()
+: <a class="el" href="rs__cl_8rsh.html#a60f2072d8a746e7fe05cd46dea0fefcc">rs_cl.rsh</a>
+</li>
+<li>fmin()
+: <a class="el" href="rs__cl_8rsh.html#a1fd9d57c6c992866bf5161be2cf4c447">rs_cl.rsh</a>
+</li>
+<li>fmod()
+: <a class="el" href="rs__cl_8rsh.html#a31d5e179730ae44e1dbc74c1535f392e">rs_cl.rsh</a>
+</li>
+<li>fract()
+: <a class="el" href="rs__cl_8rsh.html#ac5277212e0df309a0a7c908424f7b14b">rs_cl.rsh</a>
+</li>
+<li>frexp()
+: <a class="el" href="rs__cl_8rsh.html#a778635fffed3cee8ab0800482ba53a30">rs_cl.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_h"></a>- h -</h3><ul>
+<li>hypot()
+: <a class="el" href="rs__cl_8rsh.html#a147f38d6e41f45de9b5e7c6f3dcac010">rs_cl.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_i"></a>- i -</h3><ul>
+<li>ilogb()
+: <a class="el" href="rs__cl_8rsh.html#aad9a8beba52acb77b1efeba432e6cc2c">rs_cl.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_l"></a>- l -</h3><ul>
+<li>ldexp()
+: <a class="el" href="rs__cl_8rsh.html#a013bc1dcda984cbc608e123ed38491e6">rs_cl.rsh</a>
+</li>
+<li>length()
+: <a class="el" href="rs__cl_8rsh.html#a1a222b7879342279e1e0070d6afd9e18">rs_cl.rsh</a>
+</li>
+<li>lgamma()
+: <a class="el" href="rs__cl_8rsh.html#a735f4e14e33c50348ef41220f9210bcc">rs_cl.rsh</a>
+</li>
+<li>log()
+: <a class="el" href="rs__cl_8rsh.html#a3ff85f5f4b206ecf9ec9d128d7d18a08">rs_cl.rsh</a>
+</li>
+<li>log10()
+: <a class="el" href="rs__cl_8rsh.html#af5c1bdba2a13aa2e2b0722287f6a919f">rs_cl.rsh</a>
+</li>
+<li>log1p()
+: <a class="el" href="rs__cl_8rsh.html#ae10541ede49062ef7f977712c4878c1f">rs_cl.rsh</a>
+</li>
+<li>log2()
+: <a class="el" href="rs__cl_8rsh.html#a2fb571ae932f671ff3e9e97f2d3fabb7">rs_cl.rsh</a>
+</li>
+<li>logb()
+: <a class="el" href="rs__cl_8rsh.html#a28742d6ce2f20a61f16ecc08ed499871">rs_cl.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_m"></a>- m -</h3><ul>
+<li>mad()
+: <a class="el" href="rs__cl_8rsh.html#a4f9086698f1eb466ba2dccf7e331cdc3">rs_cl.rsh</a>
+</li>
+<li>mix()
+: <a class="el" href="rs__cl_8rsh.html#af4c76d51368c8e330cb59ea5a0a2310e">rs_cl.rsh</a>
+</li>
+<li>modf()
+: <a class="el" href="rs__cl_8rsh.html#a841633bcdcaeb6a514d9c6460f0adf2d">rs_cl.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_n"></a>- n -</h3><ul>
+<li>nextafter()
+: <a class="el" href="rs__cl_8rsh.html#adb11df05fb9985595af0a7bd882bdeac">rs_cl.rsh</a>
+</li>
+<li>normalize()
+: <a class="el" href="rs__cl_8rsh.html#a373e03e92a1b7f3fdea5ca4ca159d2a8">rs_cl.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_p"></a>- p -</h3><ul>
+<li>pow()
+: <a class="el" href="rs__cl_8rsh.html#a9243de1d67fcc847a89f95748d664b19">rs_cl.rsh</a>
+</li>
+<li>pown()
+: <a class="el" href="rs__cl_8rsh.html#afd46205452017b741abb2e17fc28557d">rs_cl.rsh</a>
+</li>
+<li>powr()
+: <a class="el" href="rs__cl_8rsh.html#a3ff65421721ec8e6ce8d875a563d005f">rs_cl.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_r"></a>- r -</h3><ul>
+<li>radians()
+: <a class="el" href="rs__cl_8rsh.html#aaef2526c4d190ba6f7301b4e810917a7">rs_cl.rsh</a>
+</li>
+<li>remainder()
+: <a class="el" href="rs__cl_8rsh.html#a5188ac0e3af95b0956c6abeafb74fda9">rs_cl.rsh</a>
+</li>
+<li>rint()
+: <a class="el" href="rs__cl_8rsh.html#adb0ffe344ae56ca7fc9083c1f2943e55">rs_cl.rsh</a>
+</li>
+<li>rootn()
+: <a class="el" href="rs__cl_8rsh.html#af169e7e1c575b7c24c1834569223077f">rs_cl.rsh</a>
+</li>
+<li>round()
+: <a class="el" href="rs__cl_8rsh.html#aff4846ab5b947550814d5414a2c3626f">rs_cl.rsh</a>
+</li>
+<li>rsAllocationGetDimFaces()
+: <a class="el" href="rs__allocation_8rsh.html#ac85f7ed88f38b35482c6d63b56d470fe">rs_allocation.rsh</a>
+</li>
+<li>rsAllocationGetDimLOD()
+: <a class="el" href="rs__allocation_8rsh.html#ac42a07c079d6b3c6bb21975170d4e11c">rs_allocation.rsh</a>
+</li>
+<li>rsAllocationGetDimX()
+: <a class="el" href="rs__allocation_8rsh.html#a3ca7f505a97d5b7f477bc65b9e77dafb">rs_allocation.rsh</a>
+</li>
+<li>rsAllocationGetDimY()
+: <a class="el" href="rs__allocation_8rsh.html#ac889b866b465580eb313e5d2a9fcac3d">rs_allocation.rsh</a>
+</li>
+<li>rsAllocationGetDimZ()
+: <a class="el" href="rs__allocation_8rsh.html#acd6f1a2b2443e6ea39e6154577645d2c">rs_allocation.rsh</a>
+</li>
+<li>rsClamp()
+: <a class="el" href="rs__math_8rsh.html#ae31137028793c4aaf4df839535135837">rs_math.rsh</a>
+</li>
+<li>rsClearObject()
+: <a class="el" href="rs__object_8rsh.html#aab5f47dc11b9044b3d02c4ed818fe6e7">rs_object.rsh</a>
+</li>
+<li>rsDebug()
+: <a class="el" href="rs__debug_8rsh.html#a0a59285be7204bde7b199c77578b6a42">rs_debug.rsh</a>
+</li>
+<li>rsExtractFrustumPlanes()
+: <a class="el" href="rs__math_8rsh.html#a191f9c687c56322c18b7d71491602122">rs_math.rsh</a>
+</li>
+<li>rsForEach()
+: <a class="el" href="rs__core_8rsh.html#a95ebbf7a8923193df144649c066daae6">rs_core.rsh</a>
+</li>
+<li>rsFrac()
+: <a class="el" href="rs__math_8rsh.html#ac4f127e78da0849321c7f6db14f9e989">rs_math.rsh</a>
+</li>
+<li>rsgAllocationSyncAll()
+: <a class="el" href="rs__graphics_8rsh.html#a647228d8e15da6ad67a97701d920dcac">rs_graphics.rsh</a>
+</li>
+<li>rsgBindFont()
+: <a class="el" href="rs__graphics_8rsh.html#ae89effef281e92e2940055883ea366d4">rs_graphics.rsh</a>
+</li>
+<li>rsgBindProgramFragment()
+: <a class="el" href="rs__graphics_8rsh.html#a9f8deb600729a83c39c5bcaba2152b9c">rs_graphics.rsh</a>
+</li>
+<li>rsgBindProgramRaster()
+: <a class="el" href="rs__graphics_8rsh.html#a391eb5535544f6312c724b910da6ec35">rs_graphics.rsh</a>
+</li>
+<li>rsgBindProgramStore()
+: <a class="el" href="rs__graphics_8rsh.html#a34dfa6eddd7454fc1865222c5a022315">rs_graphics.rsh</a>
+</li>
+<li>rsgBindProgramVertex()
+: <a class="el" href="rs__graphics_8rsh.html#a894e26d0d05d3ef99be65ddf98dd901c">rs_graphics.rsh</a>
+</li>
+<li>rsgBindSampler()
+: <a class="el" href="rs__graphics_8rsh.html#a4ade6c5acbf6acaa1c29a1aecc6e87d3">rs_graphics.rsh</a>
+</li>
+<li>rsgBindTexture()
+: <a class="el" href="rs__graphics_8rsh.html#a1694eb5489bd3a444da921dbf16aeeb5">rs_graphics.rsh</a>
+</li>
+<li>rsgClearColor()
+: <a class="el" href="rs__graphics_8rsh.html#a147674fed92745fbb5c64a6300ca3c49">rs_graphics.rsh</a>
+</li>
+<li>rsgClearDepth()
+: <a class="el" href="rs__graphics_8rsh.html#a4bedb06e8facd587e3eacd746fe3e727">rs_graphics.rsh</a>
+</li>
+<li>rsgDrawMesh()
+: <a class="el" href="rs__graphics_8rsh.html#a6f8b87c994810908fbe5e01f8f63f9af">rs_graphics.rsh</a>
+</li>
+<li>rsgDrawQuad()
+: <a class="el" href="rs__graphics_8rsh.html#ad6953da0349e58547b08b8ce174ed3fc">rs_graphics.rsh</a>
+</li>
+<li>rsgDrawQuadTexCoords()
+: <a class="el" href="rs__graphics_8rsh.html#afb98a59bb9f878f0a09459567c269e64">rs_graphics.rsh</a>
+</li>
+<li>rsgDrawRect()
+: <a class="el" href="rs__graphics_8rsh.html#a80c51849bf12ec6c699c23c3fa3e6208">rs_graphics.rsh</a>
+</li>
+<li>rsgDrawSpriteScreenspace()
+: <a class="el" href="rs__graphics_8rsh.html#a07d15127330fa1dff6c99b0d7d14e65e">rs_graphics.rsh</a>
+</li>
+<li>rsgDrawText()
+: <a class="el" href="rs__graphics_8rsh.html#afaec82492762e62cad1ff53ada479b14">rs_graphics.rsh</a>
+</li>
+<li>rsGetAllocation()
+: <a class="el" href="rs__allocation_8rsh.html#aadad7654929c451be299df125061c9ba">rs_allocation.rsh</a>
+</li>
+<li>rsGetDt()
+: <a class="el" href="rs__time_8rsh.html#adea2682186fd903752431ad848bd8bf4">rs_time.rsh</a>
+</li>
+<li>rsGetElementAt()
+: <a class="el" href="rs__allocation_8rsh.html#a3fd30b4388748601e025bb3566ce0cbc">rs_allocation.rsh</a>
+</li>
+<li>rsgFontColor()
+: <a class="el" href="rs__graphics_8rsh.html#abda8c344092ed6310c7a8f353a6df876">rs_graphics.rsh</a>
+</li>
+<li>rsgGetHeight()
+: <a class="el" href="rs__graphics_8rsh.html#a7e6565cd5d5e44f442a8bf8ba68f4681">rs_graphics.rsh</a>
+</li>
+<li>rsgGetWidth()
+: <a class="el" href="rs__graphics_8rsh.html#a67f4ed1ca4bba27d5c952ada89cd0717">rs_graphics.rsh</a>
+</li>
+<li>rsgMeasureText()
+: <a class="el" href="rs__graphics_8rsh.html#a5c599f4ea989f3d0616cbf8e983688c4">rs_graphics.rsh</a>
+</li>
+<li>rsgMeshComputeBoundingBox()
+: <a class="el" href="rs__graphics_8rsh.html#a0978c54902dd1d60180f8dbb0b781105">rs_graphics.rsh</a>
+</li>
+<li>rsgProgramFragmentConstantColor()
+: <a class="el" href="rs__graphics_8rsh.html#a35ac8c3759e25047e6a458c15520c887">rs_graphics.rsh</a>
+</li>
+<li>rsgProgramVertexGetProjectionMatrix()
+: <a class="el" href="rs__graphics_8rsh.html#a2b767d209b36ffcd2e0fc0cf6f4c5706">rs_graphics.rsh</a>
+</li>
+<li>rsgProgramVertexLoadModelMatrix()
+: <a class="el" href="rs__graphics_8rsh.html#a976b8594cccb4b94d7ce520b44d884e3">rs_graphics.rsh</a>
+</li>
+<li>rsgProgramVertexLoadProjectionMatrix()
+: <a class="el" href="rs__graphics_8rsh.html#a83a87d8efa3f26ed3f8fb25e49f29059">rs_graphics.rsh</a>
+</li>
+<li>rsgProgramVertexLoadTextureMatrix()
+: <a class="el" href="rs__graphics_8rsh.html#a377b7b394c4bf0881532b1241d4be168">rs_graphics.rsh</a>
+</li>
+<li>rsIsObject()
+: <a class="el" href="rs__object_8rsh.html#a81f862730b961bd93ac132c24cbc0f82">rs_object.rsh</a>
+</li>
+<li>rsIsSphereInFrustum()
+: <a class="el" href="rs__math_8rsh.html#a7bbeaf44838e08e68d5cf3e3d7b0818c">rs_math.rsh</a>
+</li>
+<li>rsLocaltime()
+: <a class="el" href="rs__time_8rsh.html#a08a8fcadae964f7416aef487da624110">rs_time.rsh</a>
+</li>
+<li>rsMatrixGet()
+: <a class="el" href="rs__matrix_8rsh.html#a90b0548da8dbe1f643bcbac8466e5b72">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixInverse()
+: <a class="el" href="rs__matrix_8rsh.html#a00b6a334ba5ac94d84850f22ec9f4de5">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixInverseTranspose()
+: <a class="el" href="rs__matrix_8rsh.html#ac05080d52da2d99a759ef34fa0655e82">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixLoad()
+: <a class="el" href="rs__matrix_8rsh.html#a06176acb38405937cb94c835a712a3b3">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixLoadFrustum()
+: <a class="el" href="rs__matrix_8rsh.html#ad25760aaf01e95d0055237afab41bbb3">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixLoadIdentity()
+: <a class="el" href="rs__matrix_8rsh.html#a0ffd9de971cf10d0a663ff565be8d3cc">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixLoadMultiply()
+: <a class="el" href="rs__matrix_8rsh.html#a79f14c4c0f5ecc1bbd0bf54da8b653ef">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixLoadOrtho()
+: <a class="el" href="rs__matrix_8rsh.html#a4c59884a0e534dbbcdc5655842732d43">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixLoadPerspective()
+: <a class="el" href="rs__matrix_8rsh.html#aa404c34d7478f2921f7415d2da95d02b">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixLoadRotate()
+: <a class="el" href="rs__matrix_8rsh.html#a268032f3ac6d766b1d7fe72a6cb50464">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixLoadScale()
+: <a class="el" href="rs__matrix_8rsh.html#acaf51d1f9ad5041ce01fbf8b7c5923fd">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixLoadTranslate()
+: <a class="el" href="rs__matrix_8rsh.html#a1b521c8a3d1260fa732cbf0a71af0e74">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixMultiply()
+: <a class="el" href="rs__matrix_8rsh.html#a716bc2d29b80eb25388aba3ba8845aef">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixRotate()
+: <a class="el" href="rs__matrix_8rsh.html#ad5ed05ca4880397fb29615e3c6798de1">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixScale()
+: <a class="el" href="rs__matrix_8rsh.html#a94cc6b22bd1a6c07a9a1c1d21afb392c">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixSet()
+: <a class="el" href="rs__matrix_8rsh.html#ada106cb8f08e4b23930d7ba1a0ce5609">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixTranslate()
+: <a class="el" href="rs__matrix_8rsh.html#a4df5f9b5bb6044f3c3426f2f58b94405">rs_matrix.rsh</a>
+</li>
+<li>rsMatrixTranspose()
+: <a class="el" href="rs__matrix_8rsh.html#a49164dd4d4e85b212196028b1fd89dc1">rs_matrix.rsh</a>
+</li>
+<li>rsPackColorTo8888()
+: <a class="el" href="rs__math_8rsh.html#a22e0be7e18b317a7453ebad4300934f6">rs_math.rsh</a>
+</li>
+<li>rsqrt()
+: <a class="el" href="rs__cl_8rsh.html#a5db00fde9e6bff693a38f3a37e7a1f70">rs_cl.rsh</a>
+</li>
+<li>rsQuaternionAdd()
+: <a class="el" href="rs__quaternion_8rsh.html#a5e6e493b9917336b0d9118fdd4e91444">rs_quaternion.rsh</a>
+</li>
+<li>rsQuaternionConjugate()
+: <a class="el" href="rs__quaternion_8rsh.html#acd670264e49743d35f38028b8e2a8800">rs_quaternion.rsh</a>
+</li>
+<li>rsQuaternionDot()
+: <a class="el" href="rs__quaternion_8rsh.html#aa810f8857439564e7b3be771f47b40ca">rs_quaternion.rsh</a>
+</li>
+<li>rsQuaternionGetMatrixUnit()
+: <a class="el" href="rs__quaternion_8rsh.html#a7726c524868c49892976fec53ea0693b">rs_quaternion.rsh</a>
+</li>
+<li>rsQuaternionLoadRotate()
+: <a class="el" href="rs__quaternion_8rsh.html#adf4423c521e34f3cf29d5dd5b5a93de0">rs_quaternion.rsh</a>
+</li>
+<li>rsQuaternionLoadRotateUnit()
+: <a class="el" href="rs__quaternion_8rsh.html#aa72a43cf3d7b5924de1ddfaa5766db09">rs_quaternion.rsh</a>
+</li>
+<li>rsQuaternionMultiply()
+: <a class="el" href="rs__quaternion_8rsh.html#a4f3d214912facf72f6a6d57e95aa3c3b">rs_quaternion.rsh</a>
+</li>
+<li>rsQuaternionNormalize()
+: <a class="el" href="rs__quaternion_8rsh.html#abb31aad2416044ad5bbf44ee7c838e2a">rs_quaternion.rsh</a>
+</li>
+<li>rsQuaternionSet()
+: <a class="el" href="rs__quaternion_8rsh.html#a249782133e54f13a8096d1fbe295714d">rs_quaternion.rsh</a>
+</li>
+<li>rsQuaternionSlerp()
+: <a class="el" href="rs__quaternion_8rsh.html#a7da94a30e287cbb8148771a5cd768dbd">rs_quaternion.rsh</a>
+</li>
+<li>rsRand()
+: <a class="el" href="rs__math_8rsh.html#a84b2e7468314873b3aa02969e310d9e4">rs_math.rsh</a>
+</li>
+<li>rsSendToClient()
+: <a class="el" href="rs__core_8rsh.html#a508003cadad2d37d41e2de7e9226f859">rs_core.rsh</a>
+</li>
+<li>rsSendToClientBlocking()
+: <a class="el" href="rs__core_8rsh.html#a6e4ff6388e8c6978ed17447214f2a2e2">rs_core.rsh</a>
+</li>
+<li>rsSetObject()
+: <a class="el" href="rs__object_8rsh.html#a8135bceeb7b3ec8bf9a49d04e39bd565">rs_object.rsh</a>
+</li>
+<li>rsTime()
+: <a class="el" href="rs__time_8rsh.html#a555f9324acb8c3d0c6f09a1d05478ce2">rs_time.rsh</a>
+</li>
+<li>rsUnpackColor8888()
+: <a class="el" href="rs__math_8rsh.html#a26525a4f5093bd0f13191efe06127f4b">rs_math.rsh</a>
+</li>
+<li>rsUptimeMillis()
+: <a class="el" href="rs__time_8rsh.html#a3c406e51a769718dd1c760518b9cad44">rs_time.rsh</a>
+</li>
+<li>rsUptimeNanos()
+: <a class="el" href="rs__time_8rsh.html#a24e2cc12acf1e7fdd857d1a48981395d">rs_time.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_s"></a>- s -</h3><ul>
+<li>sign()
+: <a class="el" href="rs__cl_8rsh.html#a3e6d477a06dec7070f073eec9d8f420c">rs_cl.rsh</a>
+</li>
+<li>sin()
+: <a class="el" href="rs__cl_8rsh.html#a8c8cd526b44eb55aede77cf659f24306">rs_cl.rsh</a>
+</li>
+<li>sincos()
+: <a class="el" href="rs__cl_8rsh.html#a240f7c7c20b432a30dc660b5dd4cd320">rs_cl.rsh</a>
+</li>
+<li>sinh()
+: <a class="el" href="rs__cl_8rsh.html#ae686e0cc567f7ee2b0a84706aa486e4a">rs_cl.rsh</a>
+</li>
+<li>sinpi()
+: <a class="el" href="rs__cl_8rsh.html#a4fe4fef049786e888526d6f37b912b0a">rs_cl.rsh</a>
+</li>
+<li>sqrt()
+: <a class="el" href="rs__cl_8rsh.html#a92da0faef80c4d8f66e954c8c169a729">rs_cl.rsh</a>
+</li>
+<li>step()
+: <a class="el" href="rs__cl_8rsh.html#a4f7ba6882099d16853d0415982121900">rs_cl.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_t"></a>- t -</h3><ul>
+<li>tan()
+: <a class="el" href="rs__cl_8rsh.html#af12e245af8ff9bb72b5000e7c26cd8fe">rs_cl.rsh</a>
+</li>
+<li>tanh()
+: <a class="el" href="rs__cl_8rsh.html#abc36e89ddb87ea78451d1c5921ddbd8d">rs_cl.rsh</a>
+</li>
+<li>tanpi()
+: <a class="el" href="rs__cl_8rsh.html#ad8bfb083dd3979a305e594a0d6e581c4">rs_cl.rsh</a>
+</li>
+<li>tgamma()
+: <a class="el" href="rs__cl_8rsh.html#ab9f4cbfd2470420ee302f28cf3de6dd0">rs_cl.rsh</a>
+</li>
+<li>trunc()
+: <a class="el" href="rs__cl_8rsh.html#ad1a7c65693231219db1babeae1c41f15">rs_cl.rsh</a>
+</li>
+</ul>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/globals_type.html b/docs/html/reference/renderscript/globals_type.html
new file mode 100644
index 0000000..238a6c4
--- /dev/null
+++ b/docs/html/reference/renderscript/globals_type.html
@@ -0,0 +1,223 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>Members</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow3" class="tabs2">
+    <ul class="tablist">
+      <li><a href="globals.html"><span>All</span></a></li>
+      <li><a href="globals_func.html"><span>Functions</span></a></li>
+      <li class="current"><a href="globals_type.html"><span>Typedefs</span></a></li>
+      <li><a href="globals_enum.html"><span>Enumerations</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow4" class="tabs3">
+    <ul class="tablist">
+      <li><a href="#index_c"><span>c</span></a></li>
+      <li><a href="#index_d"><span>d</span></a></li>
+      <li><a href="#index_f"><span>f</span></a></li>
+      <li><a href="#index_i"><span>i</span></a></li>
+      <li><a href="#index_l"><span>l</span></a></li>
+      <li><a href="#index_r"><span>r</span></a></li>
+      <li><a href="#index_s"><span>s</span></a></li>
+      <li><a href="#index_u"><span>u</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_c"></a>- c -</h3><ul>
+<li>char2
+: <a class="el" href="rs__types_8rsh.html#ac532b4c1895c8bd4fb75dc370c484351">rs_types.rsh</a>
+</li>
+<li>char3
+: <a class="el" href="rs__types_8rsh.html#a4617fb31f4c03402515efee0a9b56210">rs_types.rsh</a>
+</li>
+<li>char4
+: <a class="el" href="rs__types_8rsh.html#aecb498648daac97c7cc5f31c242dfa03">rs_types.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_d"></a>- d -</h3><ul>
+<li>double2
+: <a class="el" href="rs__types_8rsh.html#a75ef868cedebc2a6eeb1bc6ca6ca49c3">rs_types.rsh</a>
+</li>
+<li>double3
+: <a class="el" href="rs__types_8rsh.html#aa3c90d5a23d674185a13e95402eda7eb">rs_types.rsh</a>
+</li>
+<li>double4
+: <a class="el" href="rs__types_8rsh.html#a60f4b04e076f0dd0ecc99c365fc4ca21">rs_types.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_f"></a>- f -</h3><ul>
+<li>float2
+: <a class="el" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">rs_types.rsh</a>
+</li>
+<li>float3
+: <a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">rs_types.rsh</a>
+</li>
+<li>float4
+: <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">rs_types.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_i"></a>- i -</h3><ul>
+<li>int16_t
+: <a class="el" href="rs__types_8rsh.html#aa343fa3b3d06292b959ffdd4c4703b06">rs_types.rsh</a>
+</li>
+<li>int2
+: <a class="el" href="rs__types_8rsh.html#a6bc1fa1354fe2145b8f12b4bbfafcf4c">rs_types.rsh</a>
+</li>
+<li>int3
+: <a class="el" href="rs__types_8rsh.html#ad5512266b63fd06dcf450f6c9d5326c8">rs_types.rsh</a>
+</li>
+<li>int32_t
+: <a class="el" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">rs_types.rsh</a>
+</li>
+<li>int4
+: <a class="el" href="rs__types_8rsh.html#a897deab71f679999ed99d4153c797e70">rs_types.rsh</a>
+</li>
+<li>int64_t
+: <a class="el" href="rs__types_8rsh.html#a996e72f71b11a5bb8b3b7b6936b1516d">rs_types.rsh</a>
+</li>
+<li>int8_t
+: <a class="el" href="rs__types_8rsh.html#ad566f6541e98b74246db1a3a3a85ad49">rs_types.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_l"></a>- l -</h3><ul>
+<li>long2
+: <a class="el" href="rs__types_8rsh.html#afd55d62cee0785034b73375acd0df9da">rs_types.rsh</a>
+</li>
+<li>long3
+: <a class="el" href="rs__types_8rsh.html#ad9cedbf4050fad14138d1dcb3428ec18">rs_types.rsh</a>
+</li>
+<li>long4
+: <a class="el" href="rs__types_8rsh.html#ae177e4918f36e5c9da36d524cdb7a2e7">rs_types.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_r"></a>- r -</h3><ul>
+<li>rs_quaternion
+: <a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_types.rsh</a>
+</li>
+<li>rs_script_call_t
+: <a class="el" href="rs__core_8rsh.html#ae8756b32e23445f287960b9d0ffb449c">rs_core.rsh</a>
+</li>
+<li>rs_time_t
+: <a class="el" href="rs__time_8rsh.html#ad2b4759a0a6a98bd79b7ad82a4b057d6">rs_time.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_s"></a>- s -</h3><ul>
+<li>short2
+: <a class="el" href="rs__types_8rsh.html#a303d3ad18aaeacfcfeda2b8580b98796">rs_types.rsh</a>
+</li>
+<li>short3
+: <a class="el" href="rs__types_8rsh.html#a3f4967691ae2b249511b5f3dd9e18793">rs_types.rsh</a>
+</li>
+<li>short4
+: <a class="el" href="rs__types_8rsh.html#a198219da0b1d51c8d7f8f12aad7e502d">rs_types.rsh</a>
+</li>
+<li>size_t
+: <a class="el" href="rs__types_8rsh.html#a29d85914ddff32967d85ada69854206d">rs_types.rsh</a>
+</li>
+<li>ssize_t
+: <a class="el" href="rs__types_8rsh.html#a170745d0d946e79c4c2a056d1d158996">rs_types.rsh</a>
+</li>
+</ul>
+
+
+<h3><a class="anchor" id="index_u"></a>- u -</h3><ul>
+<li>uchar
+: <a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">rs_types.rsh</a>
+</li>
+<li>uchar2
+: <a class="el" href="rs__types_8rsh.html#aff5eb7cd53a34bb01924bf64485296de">rs_types.rsh</a>
+</li>
+<li>uchar3
+: <a class="el" href="rs__types_8rsh.html#a247b5eacf2b662849668cbc33120343f">rs_types.rsh</a>
+</li>
+<li>uchar4
+: <a class="el" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">rs_types.rsh</a>
+</li>
+<li>uint
+: <a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">rs_types.rsh</a>
+</li>
+<li>uint16_t
+: <a class="el" href="rs__types_8rsh.html#a273cf69d639a59973b6019625df33e30">rs_types.rsh</a>
+</li>
+<li>uint2
+: <a class="el" href="rs__types_8rsh.html#aaf90cd1f01a121e824fc6e1b927e7683">rs_types.rsh</a>
+</li>
+<li>uint3
+: <a class="el" href="rs__types_8rsh.html#ae80e36ac834c891aa76b09a220344e78">rs_types.rsh</a>
+</li>
+<li>uint32_t
+: <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">rs_types.rsh</a>
+</li>
+<li>uint4
+: <a class="el" href="rs__types_8rsh.html#ad92f0ec6c2cdc1f11a6d7fe321047462">rs_types.rsh</a>
+</li>
+<li>uint64_t
+: <a class="el" href="rs__types_8rsh.html#aaa5d1cd013383c889537491c3cfd9aad">rs_types.rsh</a>
+</li>
+<li>uint8_t
+: <a class="el" href="rs__types_8rsh.html#aba7bc1797add20fe3efdf37ced1182c5">rs_types.rsh</a>
+</li>
+<li>ulong
+: <a class="el" href="rs__types_8rsh.html#ab46637ef82283186e57f54756fe67203">rs_types.rsh</a>
+</li>
+<li>ulong2
+: <a class="el" href="rs__types_8rsh.html#a56988b12ab16acf753356f7a5c70565a">rs_types.rsh</a>
+</li>
+<li>ulong3
+: <a class="el" href="rs__types_8rsh.html#ac623a569c28935fbedd3a8ed27ae0696">rs_types.rsh</a>
+</li>
+<li>ulong4
+: <a class="el" href="rs__types_8rsh.html#a3029c54b8e1779a1ddbdfe875432d137">rs_types.rsh</a>
+</li>
+<li>ushort
+: <a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">rs_types.rsh</a>
+</li>
+<li>ushort2
+: <a class="el" href="rs__types_8rsh.html#a24a9d78cfc32475e2c6eb1cdec239bf2">rs_types.rsh</a>
+</li>
+<li>ushort3
+: <a class="el" href="rs__types_8rsh.html#ab78391445785d2ca0276392a9c97fcba">rs_types.rsh</a>
+</li>
+<li>ushort4
+: <a class="el" href="rs__types_8rsh.html#a77a09fa01d7fc721bbc44c32aac2d487">rs_types.rsh</a>
+</li>
+</ul>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/index.html b/docs/html/reference/renderscript/index.html
new file mode 100644
index 0000000..c4c057e
--- /dev/null
+++ b/docs/html/reference/renderscript/index.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>Main Page</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li class="current"><a href="index.html"><span>Overview</span></a></li>
+      <li><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<div class="textblock"><p>Renderscript is a high-performance runtime that provides graphics rendering and compute operations at the native level. Renderscript code is compiled on devices at runtime to allow platform-independence as well. This reference documentation describes the Renderscript runtime APIs, which you can utilize to write Renderscript code in C99. The Renderscript header files are automatically included for you, except for the <a class="el" href="rs__graphics_8rsh.html" title="Renderscript graphics API.">rs_graphics.rsh</a> header. If you are doing graphics rendering, include the graphics header file like this:</p>
+<p><code>#include "rs_graphics.rsh"</code></p>
+<p>To use Renderscript, you need to utilize the Renderscript runtime APIs documented here as well as the Android framework APIs for Renderscript. For documentation on the Android framework APIs, see the <a target="_parent" href="http://developer.android.com/reference/android/renderscript/package-summary.html">android.renderscript</a> package reference. For more information on how to develop with Renderscript and how the runtime and Android framework APIs interact, see the <a target="_parent" href="http://developer.android.com/guide/topics/renderscript/index.html">Renderscript developer guide</a> and the <a target="_parent" href="http://developer.android.com/resources/samples/RenderScript/index.html">Renderscript samples</a>. </p>
+</div></div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/rs__allocation_8rsh.html b/docs/html/reference/renderscript/rs__allocation_8rsh.html
new file mode 100644
index 0000000..ca2663b
--- /dev/null
+++ b/docs/html/reference/renderscript/rs__allocation_8rsh.html
@@ -0,0 +1,269 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_allocation.rsh File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="summary">
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_allocation.rsh File Reference</div>  </div>
+</div>
+<div class="contents">
+<table class="memberdecls">
+<tr><td colspan="2"><h2><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structrs__allocation.html">rs_allocation</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__allocation_8rsh.html#aadad7654929c451be299df125061c9ba">rsGetAllocation</a> (const void *)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__allocation_8rsh.html#a3ca7f505a97d5b7f477bc65b9e77dafb">rsAllocationGetDimX</a> (<a class="el" href="structrs__allocation.html">rs_allocation</a>)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__allocation_8rsh.html#ac889b866b465580eb313e5d2a9fcac3d">rsAllocationGetDimY</a> (<a class="el" href="structrs__allocation.html">rs_allocation</a>)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__allocation_8rsh.html#acd6f1a2b2443e6ea39e6154577645d2c">rsAllocationGetDimZ</a> (<a class="el" href="structrs__allocation.html">rs_allocation</a>)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__allocation_8rsh.html#ac42a07c079d6b3c6bb21975170d4e11c">rsAllocationGetDimLOD</a> (<a class="el" href="structrs__allocation.html">rs_allocation</a>)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__allocation_8rsh.html#ac85f7ed88f38b35482c6d63b56d470fe">rsAllocationGetDimFaces</a> (<a class="el" href="structrs__allocation.html">rs_allocation</a>)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">const void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__allocation_8rsh.html#a3fd30b4388748601e025bb3566ce0cbc">rsGetElementAt</a> (<a class="el" href="structrs__allocation.html">rs_allocation</a>, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> x)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">const void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__allocation_8rsh.html#a7e0a1753a930557f6dc87f25ed3fd23b">rsGetElementAt</a> (<a class="el" href="structrs__allocation.html">rs_allocation</a>, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> x, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> y)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">const void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__allocation_8rsh.html#a049ba2f6e6e18d47f2267474b2092822">rsGetElementAt</a> (<a class="el" href="structrs__allocation.html">rs_allocation</a>, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> x, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> y, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> z)</td></tr>
+</table>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>Allocation routines. </p>
+
+<p>Definition in file <a class="el" href="rs__allocation_8rsh_source.html">rs_allocation.rsh</a>.</p>
+</div><hr/><h2>Function Documentation</h2>
+<a class="anchor" id="ac85f7ed88f38b35482c6d63b56d470fe"></a><!-- doxytag: member="rs_allocation.rsh::rsAllocationGetDimFaces" ref="ac85f7ed88f38b35482c6d63b56d470fe" args="(rs_allocation)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> rsAllocationGetDimFaces </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__allocation.html">rs_allocation</a>&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Query an allocation for the presence of more than one face.</p>
+<dl class="return"><dt><b>Returns:</b></dt><dd>uint32_t Returns 1 if more than one face is present, 0 otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="ac42a07c079d6b3c6bb21975170d4e11c"></a><!-- doxytag: member="rs_allocation.rsh::rsAllocationGetDimLOD" ref="ac42a07c079d6b3c6bb21975170d4e11c" args="(rs_allocation)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> rsAllocationGetDimLOD </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__allocation.html">rs_allocation</a>&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Query an allocation for the presence of more than one LOD.</p>
+<dl class="return"><dt><b>Returns:</b></dt><dd>uint32_t Returns 1 if more than one LOD is present, 0 otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a3ca7f505a97d5b7f477bc65b9e77dafb"></a><!-- doxytag: member="rs_allocation.rsh::rsAllocationGetDimX" ref="a3ca7f505a97d5b7f477bc65b9e77dafb" args="(rs_allocation)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> rsAllocationGetDimX </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__allocation.html">rs_allocation</a>&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Query the dimension of an allocation.</p>
+<dl class="return"><dt><b>Returns:</b></dt><dd>uint32_t The X dimension of the allocation. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="ac889b866b465580eb313e5d2a9fcac3d"></a><!-- doxytag: member="rs_allocation.rsh::rsAllocationGetDimY" ref="ac889b866b465580eb313e5d2a9fcac3d" args="(rs_allocation)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> rsAllocationGetDimY </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__allocation.html">rs_allocation</a>&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Query the dimension of an allocation.</p>
+<dl class="return"><dt><b>Returns:</b></dt><dd>uint32_t The Y dimension of the allocation. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="acd6f1a2b2443e6ea39e6154577645d2c"></a><!-- doxytag: member="rs_allocation.rsh::rsAllocationGetDimZ" ref="acd6f1a2b2443e6ea39e6154577645d2c" args="(rs_allocation)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> rsAllocationGetDimZ </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__allocation.html">rs_allocation</a>&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Query the dimension of an allocation.</p>
+<dl class="return"><dt><b>Returns:</b></dt><dd>uint32_t The Z dimension of the allocation. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="aadad7654929c451be299df125061c9ba"></a><!-- doxytag: member="rs_allocation.rsh::rsGetAllocation" ref="aadad7654929c451be299df125061c9ba" args="(const void *)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="structrs__allocation.html">rs_allocation</a> rsGetAllocation </td>
+          <td>(</td>
+          <td class="paramtype">const void *&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Returns the Allocation for a given pointer. The pointer should point within a valid allocation. The results are undefined if the pointer is not from a valid allocation. </p>
+
+</div>
+</div>
+<a class="anchor" id="a3fd30b4388748601e025bb3566ce0cbc"></a><!-- doxytag: member="rs_allocation.rsh::rsGetElementAt" ref="a3fd30b4388748601e025bb3566ce0cbc" args="(rs_allocation, uint32_t x)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">const void* rsGetElementAt </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__allocation.html">rs_allocation</a>&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td>
+          <td class="paramname"><em>x</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Extract a single element from an allocation. </p>
+
+</div>
+</div>
+<a class="anchor" id="a7e0a1753a930557f6dc87f25ed3fd23b"></a><!-- doxytag: member="rs_allocation.rsh::rsGetElementAt" ref="a7e0a1753a930557f6dc87f25ed3fd23b" args="(rs_allocation, uint32_t x, uint32_t y)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">const void* rsGetElementAt </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__allocation.html">rs_allocation</a>&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td>
+          <td class="paramname"><em>x</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td>
+          <td class="paramname"><em>y</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a049ba2f6e6e18d47f2267474b2092822"></a><!-- doxytag: member="rs_allocation.rsh::rsGetElementAt" ref="a049ba2f6e6e18d47f2267474b2092822" args="(rs_allocation, uint32_t x, uint32_t y, uint32_t z)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">const void* rsGetElementAt </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__allocation.html">rs_allocation</a>&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td>
+          <td class="paramname"><em>x</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td>
+          <td class="paramname"><em>y</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td>
+          <td class="paramname"><em>z</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/rs__allocation_8rsh_source.html b/docs/html/reference/renderscript/rs__allocation_8rsh_source.html
new file mode 100644
index 0000000..0d1c167
--- /dev/null
+++ b/docs/html/reference/renderscript/rs__allocation_8rsh_source.html
@@ -0,0 +1,102 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_allocation.rsh Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_allocation.rsh</div>  </div>
+</div>
+<div class="contents">
+<a href="rs__allocation_8rsh.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
+<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2011 The Android Open Source Project</span>
+<a name="l00003"></a>00003 <span class="comment"> *</span>
+<a name="l00004"></a>00004 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span>
+<a name="l00005"></a>00005 <span class="comment"> * you may not use this file except in compliance with the License.</span>
+<a name="l00006"></a>00006 <span class="comment"> * You may obtain a copy of the License at</span>
+<a name="l00007"></a>00007 <span class="comment"> *</span>
+<a name="l00008"></a>00008 <span class="comment"> *      http://www.apache.org/licenses/LICENSE-2.0</span>
+<a name="l00009"></a>00009 <span class="comment"> *</span>
+<a name="l00010"></a>00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
+<a name="l00011"></a>00011 <span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span>
+<a name="l00012"></a>00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
+<a name="l00013"></a>00013 <span class="comment"> * See the License for the specific language governing permissions and</span>
+<a name="l00014"></a>00014 <span class="comment"> * limitations under the License.</span>
+<a name="l00015"></a>00015 <span class="comment"> */</span>
+<a name="l00016"></a>00016 
+<a name="l00023"></a>00023 <span class="preprocessor">#ifndef __RS_ALLOCATION_RSH__</span>
+<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define __RS_ALLOCATION_RSH__</span>
+<a name="l00025"></a>00025 <span class="preprocessor"></span>
+<a name="l00031"></a>00031 <span class="keyword">extern</span> <a class="code" href="structrs__allocation.html" title="Opaque handle to a Renderscript allocation.">rs_allocation</a> __attribute__((overloadable))
+<a name="l00032"></a>00032     <a class="code" href="rs__allocation_8rsh.html#aadad7654929c451be299df125061c9ba">rsGetAllocation</a>(const <span class="keywordtype">void</span> *);
+<a name="l00033"></a>00033 
+<a name="l00039"></a>00039 extern <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> __attribute__((overloadable))
+<a name="l00040"></a>00040     <a class="code" href="rs__allocation_8rsh.html#a3ca7f505a97d5b7f477bc65b9e77dafb">rsAllocationGetDimX</a>(<a class="code" href="structrs__allocation.html" title="Opaque handle to a Renderscript allocation.">rs_allocation</a>);
+<a name="l00041"></a>00041 
+<a name="l00047"></a>00047 extern <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> __attribute__((overloadable))
+<a name="l00048"></a>00048     <a class="code" href="rs__allocation_8rsh.html#ac889b866b465580eb313e5d2a9fcac3d">rsAllocationGetDimY</a>(rs_allocation);
+<a name="l00049"></a>00049 
+<a name="l00055"></a>00055 extern <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> __attribute__((overloadable))
+<a name="l00056"></a>00056     <a class="code" href="rs__allocation_8rsh.html#acd6f1a2b2443e6ea39e6154577645d2c">rsAllocationGetDimZ</a>(rs_allocation);
+<a name="l00057"></a>00057 
+<a name="l00063"></a>00063 extern <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> __attribute__((overloadable))
+<a name="l00064"></a>00064     <a class="code" href="rs__allocation_8rsh.html#ac42a07c079d6b3c6bb21975170d4e11c">rsAllocationGetDimLOD</a>(rs_allocation);
+<a name="l00065"></a>00065 
+<a name="l00071"></a>00071 extern <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> __attribute__((overloadable))
+<a name="l00072"></a>00072     <a class="code" href="rs__allocation_8rsh.html#ac85f7ed88f38b35482c6d63b56d470fe">rsAllocationGetDimFaces</a>(rs_allocation);
+<a name="l00073"></a>00073 
+<a name="l00074"></a>00074 <span class="preprocessor">#if (defined(RS_VERSION) &amp;&amp; (RS_VERSION &gt;= 14))</span>
+<a name="l00075"></a>00075 <span class="preprocessor"></span>
+<a name="l00089"></a>00089 <span class="keyword">extern</span> <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00090"></a>00090     rsAllocationCopy1DRange(rs_allocation dstAlloc,
+<a name="l00091"></a>00091                             <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> dstOff, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> dstMip,
+<a name="l00092"></a>00092                             <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> count,
+<a name="l00093"></a>00093                             rs_allocation srcAlloc,
+<a name="l00094"></a>00094                             <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> srcOff, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> srcMip);
+<a name="l00095"></a>00095 
+<a name="l00117"></a>00117 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00118"></a>00118     rsAllocationCopy2DRange(rs_allocation dstAlloc,
+<a name="l00119"></a>00119                             <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> dstXoff, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> dstYoff,
+<a name="l00120"></a>00120                             <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> dstMip,
+<a name="l00121"></a>00121                             rs_allocation_cubemap_face dstFace,
+<a name="l00122"></a>00122                             <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> width, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> height,
+<a name="l00123"></a>00123                             rs_allocation srcAlloc,
+<a name="l00124"></a>00124                             <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> srcXoff, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> srcYoff,
+<a name="l00125"></a>00125                             <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> srcMip,
+<a name="l00126"></a>00126                             rs_allocation_cubemap_face srcFace);
+<a name="l00127"></a>00127 
+<a name="l00128"></a>00128 <span class="preprocessor">#endif //defined(RS_VERSION) &amp;&amp; (RS_VERSION &gt;= 14)</span>
+<a name="l00129"></a>00129 <span class="preprocessor"></span>
+<a name="l00133"></a>00133 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">void</span> * __attribute__((overloadable))
+<a name="l00134"></a>00134     <a class="code" href="rs__allocation_8rsh.html#a3fd30b4388748601e025bb3566ce0cbc">rsGetElementAt</a>(rs_allocation, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> x);
+<a name="l00138"></a>00138 extern const <span class="keywordtype">void</span> * __attribute__((overloadable))
+<a name="l00139"></a>00139     <a class="code" href="rs__allocation_8rsh.html#a3fd30b4388748601e025bb3566ce0cbc">rsGetElementAt</a>(rs_allocation, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> x, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> y);
+<a name="l00143"></a>00143 extern const <span class="keywordtype">void</span> * __attribute__((overloadable))
+<a name="l00144"></a>00144     <a class="code" href="rs__allocation_8rsh.html#a3fd30b4388748601e025bb3566ce0cbc">rsGetElementAt</a>(rs_allocation, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> x, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> y, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> z);
+<a name="l00145"></a>00145 
+<a name="l00146"></a>00146 <span class="preprocessor">#endif</span>
+<a name="l00147"></a>00147 <span class="preprocessor"></span>
+</pre></div></div>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/rs__atomic_8rsh.html b/docs/html/reference/renderscript/rs__atomic_8rsh.html
new file mode 100644
index 0000000..3d0e97e
--- /dev/null
+++ b/docs/html/reference/renderscript/rs__atomic_8rsh.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_atomic.rsh File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_atomic.rsh File Reference</div>  </div>
+</div>
+<div class="contents">
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>Atomic routines. </p>
+
+<p>Definition in file <a class="el" href="rs__atomic_8rsh_source.html">rs_atomic.rsh</a>.</p>
+</div></div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/rs__atomic_8rsh_source.html b/docs/html/reference/renderscript/rs__atomic_8rsh_source.html
new file mode 100644
index 0000000..a1400bd
--- /dev/null
+++ b/docs/html/reference/renderscript/rs__atomic_8rsh_source.html
@@ -0,0 +1,110 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_atomic.rsh Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_atomic.rsh</div>  </div>
+</div>
+<div class="contents">
+<a href="rs__atomic_8rsh.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
+<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2011 The Android Open Source Project</span>
+<a name="l00003"></a>00003 <span class="comment"> *</span>
+<a name="l00004"></a>00004 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span>
+<a name="l00005"></a>00005 <span class="comment"> * you may not use this file except in compliance with the License.</span>
+<a name="l00006"></a>00006 <span class="comment"> * You may obtain a copy of the License at</span>
+<a name="l00007"></a>00007 <span class="comment"> *</span>
+<a name="l00008"></a>00008 <span class="comment"> *      http://www.apache.org/licenses/LICENSE-2.0</span>
+<a name="l00009"></a>00009 <span class="comment"> *</span>
+<a name="l00010"></a>00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
+<a name="l00011"></a>00011 <span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span>
+<a name="l00012"></a>00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
+<a name="l00013"></a>00013 <span class="comment"> * See the License for the specific language governing permissions and</span>
+<a name="l00014"></a>00014 <span class="comment"> * limitations under the License.</span>
+<a name="l00015"></a>00015 <span class="comment"> */</span>
+<a name="l00016"></a>00016 
+<a name="l00023"></a>00023 <span class="preprocessor">#ifndef __RS_ATOMIC_RSH__</span>
+<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define __RS_ATOMIC_RSH__</span>
+<a name="l00025"></a>00025 <span class="preprocessor"></span>
+<a name="l00026"></a>00026 <span class="preprocessor">#if (defined(RS_VERSION) &amp;&amp; (RS_VERSION &gt;= 14))</span>
+<a name="l00027"></a>00027 <span class="preprocessor"></span>
+<a name="l00036"></a>00036 <span class="keyword">extern</span> <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a> __attribute__((overloadable))
+<a name="l00037"></a>00037     rsAtomicInc(volatile <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a>* addr);
+<a name="l00046"></a>00046 extern <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> __attribute__((overloadable))
+<a name="l00047"></a>00047     rsAtomicInc(volatile <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>* addr);
+<a name="l00048"></a>00048 
+<a name="l00056"></a>00056 extern <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a> __attribute__((overloadable))
+<a name="l00057"></a>00057     rsAtomicDec(volatile <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a>* addr);
+<a name="l00065"></a>00065 extern <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> __attribute__((overloadable))
+<a name="l00066"></a>00066     rsAtomicDec(volatile <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>* addr);
+<a name="l00067"></a>00067 
+<a name="l00076"></a>00076 extern <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a> __attribute__((overloadable))
+<a name="l00077"></a>00077     rsAtomicAdd(volatile <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a>* addr, <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a> value);
+<a name="l00086"></a>00086 extern <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> __attribute__((overloadable))
+<a name="l00087"></a>00087     rsAtomicAdd(volatile <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>* addr, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> value);
+<a name="l00088"></a>00088 
+<a name="l00097"></a>00097 extern <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a> __attribute__((overloadable))
+<a name="l00098"></a>00098     rsAtomicSub(volatile <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a>* addr, <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a> value);
+<a name="l00107"></a>00107 extern <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> __attribute__((overloadable))
+<a name="l00108"></a>00108     rsAtomicSub(volatile <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>* addr, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> value);
+<a name="l00109"></a>00109 
+<a name="l00118"></a>00118 extern <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a> __attribute__((overloadable))
+<a name="l00119"></a>00119     rsAtomicAnd(volatile <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a>* addr, <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a> value);
+<a name="l00128"></a>00128 extern <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> __attribute__((overloadable))
+<a name="l00129"></a>00129     rsAtomicAnd(volatile <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>* addr, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> value);
+<a name="l00130"></a>00130 
+<a name="l00139"></a>00139 extern <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a> __attribute__((overloadable))
+<a name="l00140"></a>00140     rsAtomicOr(volatile <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a>* addr, <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a> value);
+<a name="l00149"></a>00149 extern <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> __attribute__((overloadable))
+<a name="l00150"></a>00150     rsAtomicOr(volatile <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>* addr, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> value);
+<a name="l00151"></a>00151 
+<a name="l00160"></a>00160 extern <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> __attribute__((overloadable))
+<a name="l00161"></a>00161     rsAtomicXor(volatile <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>* addr, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> value);
+<a name="l00170"></a>00170 extern <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a> __attribute__((overloadable))
+<a name="l00171"></a>00171     rsAtomicXor(volatile <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a>* addr, <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a> value);
+<a name="l00172"></a>00172 
+<a name="l00182"></a>00182 extern <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> __attribute__((overloadable))
+<a name="l00183"></a>00183     rsAtomicMin(volatile <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>* addr, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> value);
+<a name="l00193"></a>00193 extern <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a> __attribute__((overloadable))
+<a name="l00194"></a>00194     rsAtomicMin(volatile <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a>* addr, <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a> value);
+<a name="l00195"></a>00195 
+<a name="l00205"></a>00205 extern <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> __attribute__((overloadable))
+<a name="l00206"></a>00206     rsAtomicMax(volatile <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>* addr, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> value);
+<a name="l00216"></a>00216 extern <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a> __attribute__((overloadable))
+<a name="l00217"></a>00217     rsAtomicMax(volatile <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a>* addr, <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a> value);
+<a name="l00218"></a>00218 
+<a name="l00230"></a>00230 extern <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a> __attribute__((overloadable))
+<a name="l00231"></a>00231     rsAtomicCas(volatile <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a>* addr, <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a> compareValue, <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a> newValue);
+<a name="l00232"></a>00232 
+<a name="l00244"></a>00244 extern <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> __attribute__((overloadable))
+<a name="l00245"></a>00245     rsAtomicCas(volatile <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>* addr, <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a> compareValue, <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a> newValue);
+<a name="l00246"></a>00246 
+<a name="l00247"></a>00247 <span class="preprocessor">#endif //defined(RS_VERSION) &amp;&amp; (RS_VERSION &gt;= 14)</span>
+<a name="l00248"></a>00248 <span class="preprocessor"></span>
+<a name="l00249"></a>00249 <span class="preprocessor">#endif</span>
+<a name="l00250"></a>00250 <span class="preprocessor"></span>
+</pre></div></div>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/rs__cl_8rsh.html b/docs/html/reference/renderscript/rs__cl_8rsh.html
new file mode 100644
index 0000000..5c499e6
--- /dev/null
+++ b/docs/html/reference/renderscript/rs__cl_8rsh.html
@@ -0,0 +1,1938 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_cl.rsh File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="summary">
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_cl.rsh File Reference</div>  </div>
+</div>
+<div class="contents">
+<table class="memberdecls">
+<tr><td colspan="2"><h2><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a07648648c7f857cfd1479821d4389751">acos</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a6575106413ec72448439ef67f1309424">acosh</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a2c0c7c00815bd480fcda80d1144ac20d">acospi</a> (float v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a78b9d0583bd0699e2eac30d2a136817a">asin</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a4e3fe465ed5541af53192c59c80af1a0">asinh</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a679b63e86358fc962cb343eb6263496b">asinpi</a> (float v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#ab790c3a7df8fcbeab77f6c0e3b4dcada">atan</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#aaf4b636b09041878e1542054c73d81e9">atan2</a> (float y, float x)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a83bdf415cc561ff6237a124273d9fb0d">atanh</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a420d4aaea0e53d7172845a21a1e648ea">atanpi</a> (float v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a9aed0a1613c86acf5e4c5ad3290a4745">atan2pi</a> (float y, float x)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#ae9d1787b55c2587478a24d96573225df">cbrt</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#aa8fc6daff743a1b635ccbf9af83fe4e4">ceil</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a29f2602d95aa7b3950e2b77b3e268f7e">copysign</a> (float x, float y)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a8eec7aeb4b0c46b06cbcd1a3ac3e6f05">cos</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#ac8d88d83182afd591401eaed101d9670">cosh</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a07b12188bd53c6b584274892f6abf425">cospi</a> (float v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a2e24dc8594e758b64c340153f67a533c">erfc</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a139f102df651c25c26dd35d549173f57">erf</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a6d9aac64c2686961ca8f30e3c34fef36">exp</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a39bca19ee2b1aa95144e58eb4a1e4f88">exp2</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a9243de1d67fcc847a89f95748d664b19">pow</a> (float x, float y)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a4b51589157c9ce600ea6156be51d8d18">exp10</a> (float v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a7996044b67be921a5e58e2fe76af66e2">expm1</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#ad6e897f1acae252ec0901e3b122992ea">fabs</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#ae7a7bac0f4e244594078f87b42c8716a">fdim</a> (float, float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#aae2da38a7246378dff8014ec407a30c3">floor</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#ac42909daec463fe449743e70baf8360d">fma</a> (float a, float b, float c)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a60f2072d8a746e7fe05cd46dea0fefcc">fmax</a> (float x, float y)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a1fd9d57c6c992866bf5161be2cf4c447">fmin</a> (float x, float y)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a31d5e179730ae44e1dbc74c1535f392e">fmod</a> (float x, float y)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#ac5277212e0df309a0a7c908424f7b14b">fract</a> (float v, float *iptr)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a778635fffed3cee8ab0800482ba53a30">frexp</a> (float v, int *iptr)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a147f38d6e41f45de9b5e7c6f3dcac010">hypot</a> (float x, float y)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#aad9a8beba52acb77b1efeba432e6cc2c">ilogb</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a013bc1dcda984cbc608e123ed38491e6">ldexp</a> (float x, int y)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a3ff36f9b21927d6b4b58616e48fddcb4">lgamma</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a735f4e14e33c50348ef41220f9210bcc">lgamma</a> (float x, int *y)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a3ff85f5f4b206ecf9ec9d128d7d18a08">log</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#af5c1bdba2a13aa2e2b0722287f6a919f">log10</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a2fb571ae932f671ff3e9e97f2d3fabb7">log2</a> (float v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#ae10541ede49062ef7f977712c4878c1f">log1p</a> (float v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a28742d6ce2f20a61f16ecc08ed499871">logb</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a4f9086698f1eb466ba2dccf7e331cdc3">mad</a> (float a, float b, float c)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a841633bcdcaeb6a514d9c6460f0adf2d">modf</a> (float x, float *iret)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#adb11df05fb9985595af0a7bd882bdeac">nextafter</a> (float x, float y)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#afd46205452017b741abb2e17fc28557d">pown</a> (float v, int p)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a3ff65421721ec8e6ce8d875a563d005f">powr</a> (float v, float p)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a5188ac0e3af95b0956c6abeafb74fda9">remainder</a> (float x, float y)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#adb0ffe344ae56ca7fc9083c1f2943e55">rint</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#af169e7e1c575b7c24c1834569223077f">rootn</a> (float v, int n)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#aff4846ab5b947550814d5414a2c3626f">round</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a92da0faef80c4d8f66e954c8c169a729">sqrt</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a5db00fde9e6bff693a38f3a37e7a1f70">rsqrt</a> (float v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a8c8cd526b44eb55aede77cf659f24306">sin</a> (float v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a240f7c7c20b432a30dc660b5dd4cd320">sincos</a> (float v, float *cosptr)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#ae686e0cc567f7ee2b0a84706aa486e4a">sinh</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a4fe4fef049786e888526d6f37b912b0a">sinpi</a> (float v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#af12e245af8ff9bb72b5000e7c26cd8fe">tan</a> (float v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#abc36e89ddb87ea78451d1c5921ddbd8d">tanh</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#ad8bfb083dd3979a305e594a0d6e581c4">tanpi</a> (float v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#ab9f4cbfd2470420ee302f28cf3de6dd0">tgamma</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#ad1a7c65693231219db1babeae1c41f15">trunc</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#ad4dab580aba6cf15539b407b9163dfde">clamp</a> (float amount, float low, float high)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#adc1b551193e66d8037daa1721df4d29c">degrees</a> (float radians)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#af4c76d51368c8e330cb59ea5a0a2310e">mix</a> (float start, float stop, float amount)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#aaef2526c4d190ba6f7301b4e810917a7">radians</a> (float degrees)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a4f7ba6882099d16853d0415982121900">step</a> (float edge, float v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a3e6d477a06dec7070f073eec9d8f420c">sign</a> (float v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a0f7beb26bb4aa30535babd14492a7e90">cross</a> (<a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> lhs, <a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> rhs)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a70544acaca578035a849eef67d62c449">dot</a> (float lhs, float rhs)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a1a222b7879342279e1e0070d6afd9e18">length</a> (float v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a4488863373be92e113e9d24aa3d21e76">distance</a> (float lhs, float rhs)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__cl_8rsh.html#a373e03e92a1b7f3fdea5ca4ca159d2a8">normalize</a> (float v)</td></tr>
+</table>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>Basic math functions. </p>
+
+<p>Definition in file <a class="el" href="rs__cl_8rsh_source.html">rs_cl.rsh</a>.</p>
+</div><hr/><h2>Function Documentation</h2>
+<a class="anchor" id="a07648648c7f857cfd1479821d4389751"></a><!-- doxytag: member="rs_cl.rsh::acos" ref="a07648648c7f857cfd1479821d4389751" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float acos </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the inverse cosine.</p>
+<p>Supports float, float2, float3, float4 </p>
+
+</div>
+</div>
+<a class="anchor" id="a6575106413ec72448439ef67f1309424"></a><!-- doxytag: member="rs_cl.rsh::acosh" ref="a6575106413ec72448439ef67f1309424" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float acosh </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the inverse hyperbolic cosine.</p>
+<p>Supports float, float2, float3, float4 </p>
+
+</div>
+</div>
+<a class="anchor" id="a2c0c7c00815bd480fcda80d1144ac20d"></a><!-- doxytag: member="rs_cl.rsh::acospi" ref="a2c0c7c00815bd480fcda80d1144ac20d" args="(float v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME float acospi </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the inverse cosine divided by PI.</p>
+<p>Supports float, float2, float3, float4 </p>
+
+</div>
+</div>
+<a class="anchor" id="a78b9d0583bd0699e2eac30d2a136817a"></a><!-- doxytag: member="rs_cl.rsh::asin" ref="a78b9d0583bd0699e2eac30d2a136817a" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float asin </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the inverse sine.</p>
+<p>Supports float, float2, float3, float4 </p>
+
+</div>
+</div>
+<a class="anchor" id="a4e3fe465ed5541af53192c59c80af1a0"></a><!-- doxytag: member="rs_cl.rsh::asinh" ref="a4e3fe465ed5541af53192c59c80af1a0" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float asinh </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the inverse hyperbolic sine.</p>
+<p>Supports float, float2, float3, float4 </p>
+
+</div>
+</div>
+<a class="anchor" id="a679b63e86358fc962cb343eb6263496b"></a><!-- doxytag: member="rs_cl.rsh::asinpi" ref="a679b63e86358fc962cb343eb6263496b" args="(float v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME float asinpi </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the inverse sine divided by PI.</p>
+<p>Supports float, float2, float3, float4 </p>
+
+</div>
+</div>
+<a class="anchor" id="ab790c3a7df8fcbeab77f6c0e3b4dcada"></a><!-- doxytag: member="rs_cl.rsh::atan" ref="ab790c3a7df8fcbeab77f6c0e3b4dcada" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float atan </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the inverse tangent.</p>
+<p>Supports float, float2, float3, float4 </p>
+
+</div>
+</div>
+<a class="anchor" id="aaf4b636b09041878e1542054c73d81e9"></a><!-- doxytag: member="rs_cl.rsh::atan2" ref="aaf4b636b09041878e1542054c73d81e9" args="(float y, float x)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float atan2 </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the inverse tangent of y / x.</p>
+<p>Supports float, float2, float3, float4. Both arguments must be of the same type.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">y</td><td></td></tr>
+    <tr><td class="paramname">x</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a9aed0a1613c86acf5e4c5ad3290a4745"></a><!-- doxytag: member="rs_cl.rsh::atan2pi" ref="a9aed0a1613c86acf5e4c5ad3290a4745" args="(float y, float x)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME float atan2pi </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the inverse tangent of y / x, divided by PI.</p>
+<p>Supports float, float2, float3, float4. Both arguments must be of the same type.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">y</td><td></td></tr>
+    <tr><td class="paramname">x</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a83bdf415cc561ff6237a124273d9fb0d"></a><!-- doxytag: member="rs_cl.rsh::atanh" ref="a83bdf415cc561ff6237a124273d9fb0d" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float atanh </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the inverse hyperbolic tangent.</p>
+<p>Supports float, float2, float3, float4 </p>
+
+</div>
+</div>
+<a class="anchor" id="a420d4aaea0e53d7172845a21a1e648ea"></a><!-- doxytag: member="rs_cl.rsh::atanpi" ref="a420d4aaea0e53d7172845a21a1e648ea" args="(float v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME float atanpi </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the inverse tangent divided by PI.</p>
+<p>Supports float, float2, float3, float4 </p>
+
+</div>
+</div>
+<a class="anchor" id="ae9d1787b55c2587478a24d96573225df"></a><!-- doxytag: member="rs_cl.rsh::cbrt" ref="ae9d1787b55c2587478a24d96573225df" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float cbrt </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the cube root.</p>
+<p>Supports float, float2, float3, float4. </p>
+
+</div>
+</div>
+<a class="anchor" id="aa8fc6daff743a1b635ccbf9af83fe4e4"></a><!-- doxytag: member="rs_cl.rsh::ceil" ref="aa8fc6daff743a1b635ccbf9af83fe4e4" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float ceil </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the smallest integer not less than a value.</p>
+<p>Supports float, float2, float3, float4. </p>
+
+</div>
+</div>
+<a class="anchor" id="ad4dab580aba6cf15539b407b9163dfde"></a><!-- doxytag: member="rs_cl.rsh::clamp" ref="ad4dab580aba6cf15539b407b9163dfde" args="(float amount, float low, float high)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> clamp </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>amount</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>low</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>high</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the minimum of two values.</p>
+<p>Supports 1,2,3,4 components of uchar, char, ushort, short, uint, int, float. Return the maximum of two values.</p>
+<p>Supports 1,2,3,4 components of uchar, char, ushort, short, uint, int, float. Clamp a value to a specified high and low bound.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">amount</td><td>value to be clamped. Supports 1,2,3,4 components </td></tr>
+    <tr><td class="paramname">low</td><td>Lower bound, must be scalar or matching vector. </td></tr>
+    <tr><td class="paramname">high</td><td>High bound, must match type of low </td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a29f2602d95aa7b3950e2b77b3e268f7e"></a><!-- doxytag: member="rs_cl.rsh::copysign" ref="a29f2602d95aa7b3950e2b77b3e268f7e" args="(float x, float y)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float copysign </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Copy the sign bit from y to x.</p>
+<p>Supports float, float2, float3, float4. Both arguments must be of the same type.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">x</td><td></td></tr>
+    <tr><td class="paramname">y</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a8eec7aeb4b0c46b06cbcd1a3ac3e6f05"></a><!-- doxytag: member="rs_cl.rsh::cos" ref="a8eec7aeb4b0c46b06cbcd1a3ac3e6f05" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float cos </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the cosine.</p>
+<p>Supports float, float2, float3, float4. </p>
+
+</div>
+</div>
+<a class="anchor" id="ac8d88d83182afd591401eaed101d9670"></a><!-- doxytag: member="rs_cl.rsh::cosh" ref="ac8d88d83182afd591401eaed101d9670" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float cosh </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the hypebolic cosine.</p>
+<p>Supports float, float2, float3, float4. </p>
+
+</div>
+</div>
+<a class="anchor" id="a07b12188bd53c6b584274892f6abf425"></a><!-- doxytag: member="rs_cl.rsh::cospi" ref="a07b12188bd53c6b584274892f6abf425" args="(float v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME float cospi </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the cosine of the value * PI.</p>
+<p>Supports float, float2, float3, float4. </p>
+
+</div>
+</div>
+<a class="anchor" id="a0f7beb26bb4aa30535babd14492a7e90"></a><!-- doxytag: member="rs_cl.rsh::cross" ref="a0f7beb26bb4aa30535babd14492a7e90" args="(float3 lhs, float3 rhs)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> cross </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a>&#160;</td>
+          <td class="paramname"><em>lhs</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a>&#160;</td>
+          <td class="paramname"><em>rhs</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Compute the cross product of two vectors.</p>
+<p>Supports 3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="adc1b551193e66d8037daa1721df4d29c"></a><!-- doxytag: member="rs_cl.rsh::degrees" ref="adc1b551193e66d8037daa1721df4d29c" args="(float radians)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME float degrees </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>radians</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Convert from radians to degrees.</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="a4488863373be92e113e9d24aa3d21e76"></a><!-- doxytag: member="rs_cl.rsh::distance" ref="a4488863373be92e113e9d24aa3d21e76" args="(float lhs, float rhs)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME float distance </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>lhs</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>rhs</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Compute the distance between two points.</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="a70544acaca578035a849eef67d62c449"></a><!-- doxytag: member="rs_cl.rsh::dot" ref="a70544acaca578035a849eef67d62c449" args="(float lhs, float rhs)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME float dot </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>lhs</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>rhs</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Compute the dot product of two vectors.</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="a139f102df651c25c26dd35d549173f57"></a><!-- doxytag: member="rs_cl.rsh::erf" ref="a139f102df651c25c26dd35d549173f57" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float erf </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the error function.</p>
+<p>Supports float, float2, float3, float4. </p>
+
+</div>
+</div>
+<a class="anchor" id="a2e24dc8594e758b64c340153f67a533c"></a><!-- doxytag: member="rs_cl.rsh::erfc" ref="a2e24dc8594e758b64c340153f67a533c" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float erfc </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the complementary error function.</p>
+<p>Supports float, float2, float3, float4. </p>
+
+</div>
+</div>
+<a class="anchor" id="a6d9aac64c2686961ca8f30e3c34fef36"></a><!-- doxytag: member="rs_cl.rsh::exp" ref="a6d9aac64c2686961ca8f30e3c34fef36" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float exp </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return e ^ value.</p>
+<p>Supports float, float2, float3, float4. </p>
+
+</div>
+</div>
+<a class="anchor" id="a4b51589157c9ce600ea6156be51d8d18"></a><!-- doxytag: member="rs_cl.rsh::exp10" ref="a4b51589157c9ce600ea6156be51d8d18" args="(float v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME float exp10 </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return 10 ^ value.</p>
+<p>Supports float, float2, float3, float4. </p>
+
+</div>
+</div>
+<a class="anchor" id="a39bca19ee2b1aa95144e58eb4a1e4f88"></a><!-- doxytag: member="rs_cl.rsh::exp2" ref="a39bca19ee2b1aa95144e58eb4a1e4f88" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float exp2 </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return 2 ^ value.</p>
+<p>Supports float, float2, float3, float4. </p>
+
+</div>
+</div>
+<a class="anchor" id="a7996044b67be921a5e58e2fe76af66e2"></a><!-- doxytag: member="rs_cl.rsh::expm1" ref="a7996044b67be921a5e58e2fe76af66e2" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float expm1 </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return (e ^ value) - 1.</p>
+<p>Supports float, float2, float3, float4. </p>
+
+</div>
+</div>
+<a class="anchor" id="ad6e897f1acae252ec0901e3b122992ea"></a><!-- doxytag: member="rs_cl.rsh::fabs" ref="ad6e897f1acae252ec0901e3b122992ea" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float fabs </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the absolute value of a value.</p>
+<p>Supports float, float2, float3, float4. </p>
+
+</div>
+</div>
+<a class="anchor" id="ae7a7bac0f4e244594078f87b42c8716a"></a><!-- doxytag: member="rs_cl.rsh::fdim" ref="ae7a7bac0f4e244594078f87b42c8716a" args="(float, float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float fdim </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname">&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the positive difference between two values.</p>
+<p>Supports float, float2, float3, float4. Both arguments must be of the same type. </p>
+
+</div>
+</div>
+<a class="anchor" id="aae2da38a7246378dff8014ec407a30c3"></a><!-- doxytag: member="rs_cl.rsh::floor" ref="aae2da38a7246378dff8014ec407a30c3" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float floor </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the smallest integer not greater than a value.</p>
+<p>Supports float, float2, float3, float4. </p>
+
+</div>
+</div>
+<a class="anchor" id="ac42909daec463fe449743e70baf8360d"></a><!-- doxytag: member="rs_cl.rsh::fma" ref="ac42909daec463fe449743e70baf8360d" args="(float a, float b, float c)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float fma </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>a</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>b</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>c</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return a*b + c.</p>
+<p>Supports float, float2, float3, float4. </p>
+
+</div>
+</div>
+<a class="anchor" id="a60f2072d8a746e7fe05cd46dea0fefcc"></a><!-- doxytag: member="rs_cl.rsh::fmax" ref="a60f2072d8a746e7fe05cd46dea0fefcc" args="(float x, float y)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float fmax </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return (x &lt; y ? y : x)</p>
+<p>Supports float, float2, float3, float4. </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">x,:</td><td>may be float, float2, float3, float4 </td></tr>
+    <tr><td class="paramname">y,:</td><td>may be float or vector. If vector must match type of x. </td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a1fd9d57c6c992866bf5161be2cf4c447"></a><!-- doxytag: member="rs_cl.rsh::fmin" ref="a1fd9d57c6c992866bf5161be2cf4c447" args="(float x, float y)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float fmin </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return (x &gt; y ? y : x)</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">x,:</td><td>may be float, float2, float3, float4 </td></tr>
+    <tr><td class="paramname">y,:</td><td>may be float or vector. If vector must match type of x. </td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a31d5e179730ae44e1dbc74c1535f392e"></a><!-- doxytag: member="rs_cl.rsh::fmod" ref="a31d5e179730ae44e1dbc74c1535f392e" args="(float x, float y)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float fmod </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the remainder from x / y</p>
+<p>Supports float, float2, float3, float4. </p>
+
+</div>
+</div>
+<a class="anchor" id="ac5277212e0df309a0a7c908424f7b14b"></a><!-- doxytag: member="rs_cl.rsh::fract" ref="ac5277212e0df309a0a7c908424f7b14b" args="(float v, float *iptr)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME float fract </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float *&#160;</td>
+          <td class="paramname"><em>iptr</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return fractional part of v</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">iptr</td><td>iptr[0] will be set to the floor of the input value. Supports float, float2, float3, float4. </td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a778635fffed3cee8ab0800482ba53a30"></a><!-- doxytag: member="rs_cl.rsh::frexp" ref="a778635fffed3cee8ab0800482ba53a30" args="(float v, int *iptr)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float frexp </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int *&#160;</td>
+          <td class="paramname"><em>iptr</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the mantissa and place the exponent into iptr[0]</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">v</td><td>Supports float, float2, float3, float4. </td></tr>
+    <tr><td class="paramname">iptr</td><td>Must have the same vector size as v. </td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a147f38d6e41f45de9b5e7c6f3dcac010"></a><!-- doxytag: member="rs_cl.rsh::hypot" ref="a147f38d6e41f45de9b5e7c6f3dcac010" args="(float x, float y)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float hypot </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return sqrt(x*x + y*y)</p>
+<p>Supports float, float2, float3, float4. </p>
+
+</div>
+</div>
+<a class="anchor" id="aad9a8beba52acb77b1efeba432e6cc2c"></a><!-- doxytag: member="rs_cl.rsh::ilogb" ref="aad9a8beba52acb77b1efeba432e6cc2c" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">int ilogb </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the integer exponent of a value</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="a013bc1dcda984cbc608e123ed38491e6"></a><!-- doxytag: member="rs_cl.rsh::ldexp" ref="a013bc1dcda984cbc608e123ed38491e6" args="(float x, int y)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float ldexp </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int&#160;</td>
+          <td class="paramname"><em>y</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return (x * 2^y)</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">x</td><td>Supports 1,2,3,4 components </td></tr>
+    <tr><td class="paramname">y</td><td>Supports single component or matching vector. </td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a1a222b7879342279e1e0070d6afd9e18"></a><!-- doxytag: member="rs_cl.rsh::length" ref="a1a222b7879342279e1e0070d6afd9e18" args="(float v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME float length </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Compute the length of a vector.</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="a3ff36f9b21927d6b4b58616e48fddcb4"></a><!-- doxytag: member="rs_cl.rsh::lgamma" ref="a3ff36f9b21927d6b4b58616e48fddcb4" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float lgamma </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the log gamma</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="a735f4e14e33c50348ef41220f9210bcc"></a><!-- doxytag: member="rs_cl.rsh::lgamma" ref="a735f4e14e33c50348ef41220f9210bcc" args="(float x, int *y)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float lgamma </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int *&#160;</td>
+          <td class="paramname"><em>y</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the log gamma and sign</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">x</td><td>Supports 1,2,3,4 components </td></tr>
+    <tr><td class="paramname">y</td><td>Supports matching vector. </td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a3ff85f5f4b206ecf9ec9d128d7d18a08"></a><!-- doxytag: member="rs_cl.rsh::log" ref="a3ff85f5f4b206ecf9ec9d128d7d18a08" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float log </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the natural logarithm</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="af5c1bdba2a13aa2e2b0722287f6a919f"></a><!-- doxytag: member="rs_cl.rsh::log10" ref="af5c1bdba2a13aa2e2b0722287f6a919f" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float log10 </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the base 10 logarithm</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="ae10541ede49062ef7f977712c4878c1f"></a><!-- doxytag: member="rs_cl.rsh::log1p" ref="ae10541ede49062ef7f977712c4878c1f" args="(float v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float log1p </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the natural logarithm of (v + 1.0f)</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="a2fb571ae932f671ff3e9e97f2d3fabb7"></a><!-- doxytag: member="rs_cl.rsh::log2" ref="a2fb571ae932f671ff3e9e97f2d3fabb7" args="(float v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME float log2 </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the base 2 logarithm</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="a28742d6ce2f20a61f16ecc08ed499871"></a><!-- doxytag: member="rs_cl.rsh::logb" ref="a28742d6ce2f20a61f16ecc08ed499871" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float logb </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Compute the exponent of the value.</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="a4f9086698f1eb466ba2dccf7e331cdc3"></a><!-- doxytag: member="rs_cl.rsh::mad" ref="a4f9086698f1eb466ba2dccf7e331cdc3" args="(float a, float b, float c)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float mad </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>a</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>b</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>c</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Compute (a * b) + c</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="af4c76d51368c8e330cb59ea5a0a2310e"></a><!-- doxytag: member="rs_cl.rsh::mix" ref="af4c76d51368c8e330cb59ea5a0a2310e" args="(float start, float stop, float amount)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> mix </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>start</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>stop</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>amount</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>return start + ((stop - start) * amount);</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="a841633bcdcaeb6a514d9c6460f0adf2d"></a><!-- doxytag: member="rs_cl.rsh::modf" ref="a841633bcdcaeb6a514d9c6460f0adf2d" args="(float x, float *iret)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float modf </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float *&#160;</td>
+          <td class="paramname"><em>iret</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the integral and fractional components of a number Supports 1,2,3,4 components</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">x</td><td>Source value </td></tr>
+    <tr><td class="paramname">iret</td><td>iret[0] will be set to the integral portion of the number. </td></tr>
+  </table>
+  </dd>
+</dl>
+<dl class="return"><dt><b>Returns:</b></dt><dd>The floating point portion of the value. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="adb11df05fb9985595af0a7bd882bdeac"></a><!-- doxytag: member="rs_cl.rsh::nextafter" ref="adb11df05fb9985595af0a7bd882bdeac" args="(float x, float y)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float nextafter </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the next floating point number from x towards y.</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="a373e03e92a1b7f3fdea5ca4ca159d2a8"></a><!-- doxytag: member="rs_cl.rsh::normalize" ref="a373e03e92a1b7f3fdea5ca4ca159d2a8" args="(float v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> normalize </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Normalize a vector.</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="a9243de1d67fcc847a89f95748d664b19"></a><!-- doxytag: member="rs_cl.rsh::pow" ref="a9243de1d67fcc847a89f95748d664b19" args="(float x, float y)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float pow </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return x ^ y.</p>
+<p>Supports float, float2, float3, float4. Both arguments must be of the same type. </p>
+
+</div>
+</div>
+<a class="anchor" id="afd46205452017b741abb2e17fc28557d"></a><!-- doxytag: member="rs_cl.rsh::pown" ref="afd46205452017b741abb2e17fc28557d" args="(float v, int p)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME float pown </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int&#160;</td>
+          <td class="paramname"><em>p</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return (v ^ p).</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="a3ff65421721ec8e6ce8d875a563d005f"></a><!-- doxytag: member="rs_cl.rsh::powr" ref="a3ff65421721ec8e6ce8d875a563d005f" args="(float v, float p)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME float powr </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>p</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return (v ^ p). </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">v</td><td>must be greater than 0.</td></tr>
+  </table>
+  </dd>
+</dl>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="aaef2526c4d190ba6f7301b4e810917a7"></a><!-- doxytag: member="rs_cl.rsh::radians" ref="aaef2526c4d190ba6f7301b4e810917a7" args="(float degrees)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME float radians </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>degrees</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Convert from degrees to radians.</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="a5188ac0e3af95b0956c6abeafb74fda9"></a><!-- doxytag: member="rs_cl.rsh::remainder" ref="a5188ac0e3af95b0956c6abeafb74fda9" args="(float x, float y)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float remainder </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return round x/y to the nearest integer then compute the remander.</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="adb0ffe344ae56ca7fc9083c1f2943e55"></a><!-- doxytag: member="rs_cl.rsh::rint" ref="adb0ffe344ae56ca7fc9083c1f2943e55" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float rint </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Round to the nearest integral value.</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="af169e7e1c575b7c24c1834569223077f"></a><!-- doxytag: member="rs_cl.rsh::rootn" ref="af169e7e1c575b7c24c1834569223077f" args="(float v, int n)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME float rootn </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int&#160;</td>
+          <td class="paramname"><em>n</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Compute the Nth root of a value.</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="aff4846ab5b947550814d5414a2c3626f"></a><!-- doxytag: member="rs_cl.rsh::round" ref="aff4846ab5b947550814d5414a2c3626f" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float round </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Round to the nearest integral value. Half values are rounded away from zero.</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="a5db00fde9e6bff693a38f3a37e7a1f70"></a><!-- doxytag: member="rs_cl.rsh::rsqrt" ref="a5db00fde9e6bff693a38f3a37e7a1f70" args="(float v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME float rsqrt </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return (1 / sqrt(value)).</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">v</td><td>The incoming value in radians Supports 1,2,3,4 components </td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a3e6d477a06dec7070f073eec9d8f420c"></a><!-- doxytag: member="rs_cl.rsh::sign" ref="a3e6d477a06dec7070f073eec9d8f420c" args="(float v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME float sign </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>if (v &lt; 0) return -1.f; else if (v &gt; 0) return 1.f; else return 0.f;</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="a8c8cd526b44eb55aede77cf659f24306"></a><!-- doxytag: member="rs_cl.rsh::sin" ref="a8c8cd526b44eb55aede77cf659f24306" args="(float v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float sin </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the sine of a value specified in radians.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">v</td><td>The incoming value in radians Supports 1,2,3,4 components </td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a240f7c7c20b432a30dc660b5dd4cd320"></a><!-- doxytag: member="rs_cl.rsh::sincos" ref="a240f7c7c20b432a30dc660b5dd4cd320" args="(float v, float *cosptr)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME float sincos </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float *&#160;</td>
+          <td class="paramname"><em>cosptr</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the sine and cosine of a value.</p>
+<dl class="return"><dt><b>Returns:</b></dt><dd>sine </dd></dl>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">v</td><td>The incoming value in radians </td></tr>
+    <tr><td class="paramname">*cosptr</td><td>cosptr[0] will be set to the cosine value.</td></tr>
+  </table>
+  </dd>
+</dl>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="ae686e0cc567f7ee2b0a84706aa486e4a"></a><!-- doxytag: member="rs_cl.rsh::sinh" ref="ae686e0cc567f7ee2b0a84706aa486e4a" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float sinh </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the hyperbolic sine of a value specified in radians.</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="a4fe4fef049786e888526d6f37b912b0a"></a><!-- doxytag: member="rs_cl.rsh::sinpi" ref="a4fe4fef049786e888526d6f37b912b0a" args="(float v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME float sinpi </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the sin(v * PI).</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="a92da0faef80c4d8f66e954c8c169a729"></a><!-- doxytag: member="rs_cl.rsh::sqrt" ref="a92da0faef80c4d8f66e954c8c169a729" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float sqrt </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the square root of a value.</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="a4f7ba6882099d16853d0415982121900"></a><!-- doxytag: member="rs_cl.rsh::step" ref="a4f7ba6882099d16853d0415982121900" args="(float edge, float v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> step </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>edge</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>if (v &lt; edge) return 0.f; else return 1.f;</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="af12e245af8ff9bb72b5000e7c26cd8fe"></a><!-- doxytag: member="rs_cl.rsh::tan" ref="af12e245af8ff9bb72b5000e7c26cd8fe" args="(float v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float tan </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the tangent of a value.</p>
+<p>Supports 1,2,3,4 components </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">v</td><td>The incoming value in radians </td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="abc36e89ddb87ea78451d1c5921ddbd8d"></a><!-- doxytag: member="rs_cl.rsh::tanh" ref="abc36e89ddb87ea78451d1c5921ddbd8d" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float tanh </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return the hyperbolic tangent of a value.</p>
+<p>Supports 1,2,3,4 components </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">v</td><td>The incoming value in radians </td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ad8bfb083dd3979a305e594a0d6e581c4"></a><!-- doxytag: member="rs_cl.rsh::tanpi" ref="ad8bfb083dd3979a305e594a0d6e581c4" args="(float v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME float tanpi </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return tan(v * PI)</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="ab9f4cbfd2470420ee302f28cf3de6dd0"></a><!-- doxytag: member="rs_cl.rsh::tgamma" ref="ab9f4cbfd2470420ee302f28cf3de6dd0" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float tgamma </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Compute the gamma function of a value.</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+<a class="anchor" id="ad1a7c65693231219db1babeae1c41f15"></a><!-- doxytag: member="rs_cl.rsh::trunc" ref="ad1a7c65693231219db1babeae1c41f15" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float trunc </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Round to integral using truncation.</p>
+<p>Supports 1,2,3,4 components </p>
+
+</div>
+</div>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/rs__cl_8rsh_source.html b/docs/html/reference/renderscript/rs__cl_8rsh_source.html
new file mode 100644
index 0000000..73ecdc6
--- /dev/null
+++ b/docs/html/reference/renderscript/rs__cl_8rsh_source.html
@@ -0,0 +1,475 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_cl.rsh Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_cl.rsh</div>  </div>
+</div>
+<div class="contents">
+<a href="rs__cl_8rsh.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
+<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2011 The Android Open Source Project</span>
+<a name="l00003"></a>00003 <span class="comment"> *</span>
+<a name="l00004"></a>00004 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span>
+<a name="l00005"></a>00005 <span class="comment"> * you may not use this file except in compliance with the License.</span>
+<a name="l00006"></a>00006 <span class="comment"> * You may obtain a copy of the License at</span>
+<a name="l00007"></a>00007 <span class="comment"> *</span>
+<a name="l00008"></a>00008 <span class="comment"> *      http://www.apache.org/licenses/LICENSE-2.0</span>
+<a name="l00009"></a>00009 <span class="comment"> *</span>
+<a name="l00010"></a>00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
+<a name="l00011"></a>00011 <span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span>
+<a name="l00012"></a>00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
+<a name="l00013"></a>00013 <span class="comment"> * See the License for the specific language governing permissions and</span>
+<a name="l00014"></a>00014 <span class="comment"> * limitations under the License.</span>
+<a name="l00015"></a>00015 <span class="comment"> */</span>
+<a name="l00016"></a>00016 
+<a name="l00023"></a>00023 <span class="preprocessor">#ifndef __RS_CL_RSH__</span>
+<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define __RS_CL_RSH__</span>
+<a name="l00025"></a>00025 <span class="preprocessor"></span>
+<a name="l00026"></a>00026 <span class="comment">// Conversions</span>
+<a name="l00027"></a>00027 <span class="preprocessor">#define CVT_FUNC_2(typeout, typein)                             \</span>
+<a name="l00028"></a>00028 <span class="preprocessor">_RS_RUNTIME typeout##2 __attribute__((overloadable))             \</span>
+<a name="l00029"></a>00029 <span class="preprocessor">        convert_##typeout##2(typein##2 v);                      \</span>
+<a name="l00030"></a>00030 <span class="preprocessor">_RS_RUNTIME typeout##3 __attribute__((overloadable))             \</span>
+<a name="l00031"></a>00031 <span class="preprocessor">        convert_##typeout##3(typein##3 v);                      \</span>
+<a name="l00032"></a>00032 <span class="preprocessor">_RS_RUNTIME typeout##4 __attribute__((overloadable))             \</span>
+<a name="l00033"></a>00033 <span class="preprocessor">        convert_##typeout##4(typein##4 v);</span>
+<a name="l00034"></a>00034 <span class="preprocessor"></span>
+<a name="l00035"></a>00035 
+<a name="l00036"></a>00036 <span class="preprocessor">#define CVT_FUNC(type)  CVT_FUNC_2(type, uchar)     \</span>
+<a name="l00037"></a>00037 <span class="preprocessor">                        CVT_FUNC_2(type, char)      \</span>
+<a name="l00038"></a>00038 <span class="preprocessor">                        CVT_FUNC_2(type, ushort)    \</span>
+<a name="l00039"></a>00039 <span class="preprocessor">                        CVT_FUNC_2(type, short)     \</span>
+<a name="l00040"></a>00040 <span class="preprocessor">                        CVT_FUNC_2(type, uint)      \</span>
+<a name="l00041"></a>00041 <span class="preprocessor">                        CVT_FUNC_2(type, int)       \</span>
+<a name="l00042"></a>00042 <span class="preprocessor">                        CVT_FUNC_2(type, float)</span>
+<a name="l00043"></a>00043 <span class="preprocessor"></span>
+<a name="l00044"></a>00044 CVT_FUNC(<span class="keywordtype">char</span>)
+<a name="l00045"></a>00045 CVT_FUNC(<a class="code" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a>)
+<a name="l00046"></a>00046 CVT_FUNC(<span class="keywordtype">short</span>)
+<a name="l00047"></a>00047 CVT_FUNC(<a class="code" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a>)
+<a name="l00048"></a>00048 CVT_FUNC(<span class="keywordtype">int</span>)
+<a name="l00049"></a>00049 CVT_FUNC(<a class="code" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>)
+<a name="l00050"></a>00050 CVT_FUNC(<span class="keywordtype">float</span>)
+<a name="l00051"></a>00051 
+<a name="l00052"></a>00052 <span class="comment">// Float ops, 6.11.2</span>
+<a name="l00053"></a>00053 
+<a name="l00054"></a>00054 <span class="preprocessor">#define FN_FUNC_FN(fnc)                                         \</span>
+<a name="l00055"></a>00055 <span class="preprocessor">_RS_RUNTIME float2 __attribute__((overloadable)) fnc(float2 v);  \</span>
+<a name="l00056"></a>00056 <span class="preprocessor">_RS_RUNTIME float3 __attribute__((overloadable)) fnc(float3 v);  \</span>
+<a name="l00057"></a>00057 <span class="preprocessor">_RS_RUNTIME float4 __attribute__((overloadable)) fnc(float4 v);</span>
+<a name="l00058"></a>00058 <span class="preprocessor"></span>
+<a name="l00059"></a>00059 <span class="preprocessor">#define IN_FUNC_FN(fnc)                                         \</span>
+<a name="l00060"></a>00060 <span class="preprocessor">_RS_RUNTIME int2 __attribute__((overloadable)) fnc(float2 v);    \</span>
+<a name="l00061"></a>00061 <span class="preprocessor">_RS_RUNTIME int3 __attribute__((overloadable)) fnc(float3 v);    \</span>
+<a name="l00062"></a>00062 <span class="preprocessor">_RS_RUNTIME int4 __attribute__((overloadable)) fnc(float4 v);</span>
+<a name="l00063"></a>00063 <span class="preprocessor"></span>
+<a name="l00064"></a>00064 <span class="preprocessor">#define FN_FUNC_FN_FN(fnc)                                                  \</span>
+<a name="l00065"></a>00065 <span class="preprocessor">_RS_RUNTIME float2 __attribute__((overloadable)) fnc(float2 v1, float2 v2);  \</span>
+<a name="l00066"></a>00066 <span class="preprocessor">_RS_RUNTIME float3 __attribute__((overloadable)) fnc(float3 v1, float3 v2);  \</span>
+<a name="l00067"></a>00067 <span class="preprocessor">_RS_RUNTIME float4 __attribute__((overloadable)) fnc(float4 v1, float4 v2);</span>
+<a name="l00068"></a>00068 <span class="preprocessor"></span>
+<a name="l00069"></a>00069 <span class="preprocessor">#define FN_FUNC_FN_F(fnc)                                                   \</span>
+<a name="l00070"></a>00070 <span class="preprocessor">_RS_RUNTIME float2 __attribute__((overloadable)) fnc(float2 v1, float v2);   \</span>
+<a name="l00071"></a>00071 <span class="preprocessor">_RS_RUNTIME float3 __attribute__((overloadable)) fnc(float3 v1, float v2);   \</span>
+<a name="l00072"></a>00072 <span class="preprocessor">_RS_RUNTIME float4 __attribute__((overloadable)) fnc(float4 v1, float v2);</span>
+<a name="l00073"></a>00073 <span class="preprocessor"></span>
+<a name="l00074"></a>00074 <span class="preprocessor">#define FN_FUNC_FN_IN(fnc)                                                  \</span>
+<a name="l00075"></a>00075 <span class="preprocessor">_RS_RUNTIME float2 __attribute__((overloadable)) fnc(float2 v1, int2 v2);    \</span>
+<a name="l00076"></a>00076 <span class="preprocessor">_RS_RUNTIME float3 __attribute__((overloadable)) fnc(float3 v1, int3 v2);    \</span>
+<a name="l00077"></a>00077 <span class="preprocessor">_RS_RUNTIME float4 __attribute__((overloadable)) fnc(float4 v1, int4 v2);    \</span>
+<a name="l00078"></a>00078 <span class="preprocessor"></span>
+<a name="l00079"></a>00079 <span class="preprocessor"></span><span class="preprocessor">#define FN_FUNC_FN_I(fnc)                                                   \</span>
+<a name="l00080"></a>00080 <span class="preprocessor">_RS_RUNTIME float2 __attribute__((overloadable)) fnc(float2 v1, int v2);     \</span>
+<a name="l00081"></a>00081 <span class="preprocessor">_RS_RUNTIME float3 __attribute__((overloadable)) fnc(float3 v1, int v2);     \</span>
+<a name="l00082"></a>00082 <span class="preprocessor">_RS_RUNTIME float4 __attribute__((overloadable)) fnc(float4 v1, int v2);</span>
+<a name="l00083"></a>00083 <span class="preprocessor"></span>
+<a name="l00084"></a>00084 <span class="preprocessor">#define FN_FUNC_FN_PFN(fnc)                     \</span>
+<a name="l00085"></a>00085 <span class="preprocessor">_RS_RUNTIME float2 __attribute__((overloadable)) \</span>
+<a name="l00086"></a>00086 <span class="preprocessor">        fnc(float2 v1, float2 *v2);             \</span>
+<a name="l00087"></a>00087 <span class="preprocessor">_RS_RUNTIME float3 __attribute__((overloadable)) \</span>
+<a name="l00088"></a>00088 <span class="preprocessor">        fnc(float3 v1, float3 *v2);             \</span>
+<a name="l00089"></a>00089 <span class="preprocessor">_RS_RUNTIME float4 __attribute__((overloadable)) \</span>
+<a name="l00090"></a>00090 <span class="preprocessor">        fnc(float4 v1, float4 *v2);</span>
+<a name="l00091"></a>00091 <span class="preprocessor"></span>
+<a name="l00092"></a>00092 <span class="preprocessor">#define FN_FUNC_FN_PIN(fnc)                                                 \</span>
+<a name="l00093"></a>00093 <span class="preprocessor">_RS_RUNTIME float2 __attribute__((overloadable)) fnc(float2 v1, int2 *v2);   \</span>
+<a name="l00094"></a>00094 <span class="preprocessor">_RS_RUNTIME float3 __attribute__((overloadable)) fnc(float3 v1, int3 *v2);   \</span>
+<a name="l00095"></a>00095 <span class="preprocessor">_RS_RUNTIME float4 __attribute__((overloadable)) fnc(float4 v1, int4 *v2);</span>
+<a name="l00096"></a>00096 <span class="preprocessor"></span>
+<a name="l00097"></a>00097 <span class="preprocessor">#define FN_FUNC_FN_FN_FN(fnc)                   \</span>
+<a name="l00098"></a>00098 <span class="preprocessor">_RS_RUNTIME float2 __attribute__((overloadable)) \</span>
+<a name="l00099"></a>00099 <span class="preprocessor">        fnc(float2 v1, float2 v2, float2 v3);   \</span>
+<a name="l00100"></a>00100 <span class="preprocessor">_RS_RUNTIME float3 __attribute__((overloadable)) \</span>
+<a name="l00101"></a>00101 <span class="preprocessor">        fnc(float3 v1, float3 v2, float3 v3);   \</span>
+<a name="l00102"></a>00102 <span class="preprocessor">_RS_RUNTIME float4 __attribute__((overloadable)) \</span>
+<a name="l00103"></a>00103 <span class="preprocessor">        fnc(float4 v1, float4 v2, float4 v3);</span>
+<a name="l00104"></a>00104 <span class="preprocessor"></span>
+<a name="l00105"></a>00105 <span class="preprocessor">#define FN_FUNC_FN_FN_PIN(fnc)                  \</span>
+<a name="l00106"></a>00106 <span class="preprocessor">_RS_RUNTIME float2 __attribute__((overloadable)) \</span>
+<a name="l00107"></a>00107 <span class="preprocessor">        fnc(float2 v1, float2 v2, int2 *v3);    \</span>
+<a name="l00108"></a>00108 <span class="preprocessor">_RS_RUNTIME float3 __attribute__((overloadable)) \</span>
+<a name="l00109"></a>00109 <span class="preprocessor">        fnc(float3 v1, float3 v2, int3 *v3);    \</span>
+<a name="l00110"></a>00110 <span class="preprocessor">_RS_RUNTIME float4 __attribute__((overloadable)) \</span>
+<a name="l00111"></a>00111 <span class="preprocessor">        fnc(float4 v1, float4 v2, int4 *v3);</span>
+<a name="l00112"></a>00112 <span class="preprocessor"></span>
+<a name="l00113"></a>00113 
+<a name="l00119"></a>00119 <span class="keyword">extern</span> <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a07648648c7f857cfd1479821d4389751">acos</a>(<span class="keywordtype">float</span>);
+<a name="l00120"></a>00120 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#a07648648c7f857cfd1479821d4389751">acos</a>)
+<a name="l00121"></a>00121 
+<a name="l00127"></a>00127 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a6575106413ec72448439ef67f1309424">acosh</a>(<span class="keywordtype">float</span>);
+<a name="l00128"></a>00128 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#a6575106413ec72448439ef67f1309424">acosh</a>)
+<a name="l00129"></a>00129 
+<a name="l00135"></a>00135 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a2c0c7c00815bd480fcda80d1144ac20d">acospi</a>(<span class="keywordtype">float</span> v);
+<a name="l00136"></a>00136 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#a2c0c7c00815bd480fcda80d1144ac20d">acospi</a>)
+<a name="l00137"></a>00137 
+<a name="l00143"></a>00143 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a78b9d0583bd0699e2eac30d2a136817a">asin</a>(<span class="keywordtype">float</span>);
+<a name="l00144"></a>00144 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#a78b9d0583bd0699e2eac30d2a136817a">asin</a>)
+<a name="l00145"></a>00145 
+<a name="l00151"></a>00151 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a4e3fe465ed5541af53192c59c80af1a0">asinh</a>(<span class="keywordtype">float</span>);
+<a name="l00152"></a>00152 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#a4e3fe465ed5541af53192c59c80af1a0">asinh</a>)
+<a name="l00153"></a>00153 
+<a name="l00154"></a>00154 
+<a name="l00160"></a>00160 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a679b63e86358fc962cb343eb6263496b">asinpi</a>(<span class="keywordtype">float</span> v);
+<a name="l00161"></a>00161 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#a679b63e86358fc962cb343eb6263496b">asinpi</a>)
+<a name="l00162"></a>00162 
+<a name="l00168"></a>00168 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#ab790c3a7df8fcbeab77f6c0e3b4dcada">atan</a>(<span class="keywordtype">float</span>);
+<a name="l00169"></a>00169 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#ab790c3a7df8fcbeab77f6c0e3b4dcada">atan</a>)
+<a name="l00170"></a>00170 
+<a name="l00180"></a>00180 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#aaf4b636b09041878e1542054c73d81e9">atan2</a>(<span class="keywordtype">float</span> y, <span class="keywordtype">float</span> x);
+<a name="l00181"></a>00181 FN_FUNC_FN_FN(<a class="code" href="rs__cl_8rsh.html#aaf4b636b09041878e1542054c73d81e9">atan2</a>)
+<a name="l00182"></a>00182 
+<a name="l00188"></a>00188 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a83bdf415cc561ff6237a124273d9fb0d">atanh</a>(<span class="keywordtype">float</span>);
+<a name="l00189"></a>00189 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#a83bdf415cc561ff6237a124273d9fb0d">atanh</a>)
+<a name="l00190"></a>00190 
+<a name="l00196"></a>00196 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a420d4aaea0e53d7172845a21a1e648ea">atanpi</a>(<span class="keywordtype">float</span> v);
+<a name="l00197"></a>00197 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#a420d4aaea0e53d7172845a21a1e648ea">atanpi</a>)
+<a name="l00198"></a>00198 
+<a name="l00208"></a>00208 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a9aed0a1613c86acf5e4c5ad3290a4745">atan2pi</a>(<span class="keywordtype">float</span> y, <span class="keywordtype">float</span> x);
+<a name="l00209"></a>00209 FN_FUNC_FN_FN(<a class="code" href="rs__cl_8rsh.html#a9aed0a1613c86acf5e4c5ad3290a4745">atan2pi</a>)
+<a name="l00210"></a>00210 
+<a name="l00211"></a>00211 
+<a name="l00217"></a>00217 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#ae9d1787b55c2587478a24d96573225df">cbrt</a>(<span class="keywordtype">float</span>);
+<a name="l00218"></a>00218 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#ae9d1787b55c2587478a24d96573225df">cbrt</a>)
+<a name="l00219"></a>00219 
+<a name="l00225"></a>00225 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#aa8fc6daff743a1b635ccbf9af83fe4e4">ceil</a>(<span class="keywordtype">float</span>);
+<a name="l00226"></a>00226 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#aa8fc6daff743a1b635ccbf9af83fe4e4">ceil</a>)
+<a name="l00227"></a>00227 
+<a name="l00237"></a>00237 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a29f2602d95aa7b3950e2b77b3e268f7e">copysign</a>(<span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y);
+<a name="l00238"></a>00238 FN_FUNC_FN_FN(<a class="code" href="rs__cl_8rsh.html#a29f2602d95aa7b3950e2b77b3e268f7e">copysign</a>)
+<a name="l00239"></a>00239 
+<a name="l00245"></a>00245 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a8eec7aeb4b0c46b06cbcd1a3ac3e6f05">cos</a>(<span class="keywordtype">float</span>);
+<a name="l00246"></a>00246 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#a8eec7aeb4b0c46b06cbcd1a3ac3e6f05">cos</a>)
+<a name="l00247"></a>00247 
+<a name="l00253"></a>00253 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#ac8d88d83182afd591401eaed101d9670">cosh</a>(<span class="keywordtype">float</span>);
+<a name="l00254"></a>00254 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#ac8d88d83182afd591401eaed101d9670">cosh</a>)
+<a name="l00255"></a>00255 
+<a name="l00261"></a>00261 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a07b12188bd53c6b584274892f6abf425">cospi</a>(<span class="keywordtype">float</span> v);
+<a name="l00262"></a>00262 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#a07b12188bd53c6b584274892f6abf425">cospi</a>)
+<a name="l00263"></a>00263 
+<a name="l00269"></a>00269 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a2e24dc8594e758b64c340153f67a533c">erfc</a>(<span class="keywordtype">float</span>);
+<a name="l00270"></a>00270 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#a2e24dc8594e758b64c340153f67a533c">erfc</a>)
+<a name="l00271"></a>00271 
+<a name="l00277"></a>00277 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a139f102df651c25c26dd35d549173f57">erf</a>(<span class="keywordtype">float</span>);
+<a name="l00278"></a>00278 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#a139f102df651c25c26dd35d549173f57">erf</a>)
+<a name="l00279"></a>00279 
+<a name="l00285"></a>00285 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a6d9aac64c2686961ca8f30e3c34fef36">exp</a>(<span class="keywordtype">float</span>);
+<a name="l00286"></a>00286 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#a6d9aac64c2686961ca8f30e3c34fef36">exp</a>)
+<a name="l00287"></a>00287 
+<a name="l00293"></a>00293 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a39bca19ee2b1aa95144e58eb4a1e4f88">exp2</a>(<span class="keywordtype">float</span>);
+<a name="l00294"></a>00294 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#a39bca19ee2b1aa95144e58eb4a1e4f88">exp2</a>)
+<a name="l00295"></a>00295 
+<a name="l00302"></a>00302 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a9243de1d67fcc847a89f95748d664b19">pow</a>(<span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y);
+<a name="l00303"></a>00303 FN_FUNC_FN_FN(<a class="code" href="rs__cl_8rsh.html#a9243de1d67fcc847a89f95748d664b19">pow</a>)
+<a name="l00304"></a>00304 
+<a name="l00310"></a>00310 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a4b51589157c9ce600ea6156be51d8d18">exp10</a>(<span class="keywordtype">float</span> v);
+<a name="l00311"></a>00311 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#a4b51589157c9ce600ea6156be51d8d18">exp10</a>)
+<a name="l00312"></a>00312 
+<a name="l00318"></a>00318 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a7996044b67be921a5e58e2fe76af66e2">expm1</a>(<span class="keywordtype">float</span>);
+<a name="l00319"></a>00319 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#a7996044b67be921a5e58e2fe76af66e2">expm1</a>)
+<a name="l00320"></a>00320 
+<a name="l00326"></a>00326 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#ad6e897f1acae252ec0901e3b122992ea">fabs</a>(<span class="keywordtype">float</span>);
+<a name="l00327"></a>00327 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#ad6e897f1acae252ec0901e3b122992ea">fabs</a>)
+<a name="l00328"></a>00328 
+<a name="l00335"></a>00335 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#ae7a7bac0f4e244594078f87b42c8716a">fdim</a>(<span class="keywordtype">float</span>, <span class="keywordtype">float</span>);
+<a name="l00336"></a>00336 FN_FUNC_FN_FN(<a class="code" href="rs__cl_8rsh.html#ae7a7bac0f4e244594078f87b42c8716a">fdim</a>)
+<a name="l00337"></a>00337 
+<a name="l00343"></a>00343 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#aae2da38a7246378dff8014ec407a30c3">floor</a>(<span class="keywordtype">float</span>);
+<a name="l00344"></a>00344 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#aae2da38a7246378dff8014ec407a30c3">floor</a>)
+<a name="l00345"></a>00345 
+<a name="l00351"></a>00351 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#ac42909daec463fe449743e70baf8360d">fma</a>(<span class="keywordtype">float</span> a, <span class="keywordtype">float</span> b, <span class="keywordtype">float</span> c);
+<a name="l00352"></a>00352 FN_FUNC_FN_FN_FN(<a class="code" href="rs__cl_8rsh.html#ac42909daec463fe449743e70baf8360d">fma</a>)
+<a name="l00353"></a>00353 
+<a name="l00361"></a>00361 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a60f2072d8a746e7fe05cd46dea0fefcc">fmax</a>(<span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y);
+<a name="l00362"></a>00362 FN_FUNC_FN_FN(<a class="code" href="rs__cl_8rsh.html#a60f2072d8a746e7fe05cd46dea0fefcc">fmax</a>);
+<a name="l00363"></a>00363 FN_FUNC_FN_F(fmax);
+<a name="l00364"></a>00364 
+<a name="l00371"></a>00371 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a1fd9d57c6c992866bf5161be2cf4c447">fmin</a>(<span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y);
+<a name="l00372"></a>00372 FN_FUNC_FN_FN(<a class="code" href="rs__cl_8rsh.html#a1fd9d57c6c992866bf5161be2cf4c447">fmin</a>);
+<a name="l00373"></a>00373 FN_FUNC_FN_F(fmin);
+<a name="l00374"></a>00374 
+<a name="l00380"></a>00380 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a31d5e179730ae44e1dbc74c1535f392e">fmod</a>(<span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y);
+<a name="l00381"></a>00381 FN_FUNC_FN_FN(<a class="code" href="rs__cl_8rsh.html#a31d5e179730ae44e1dbc74c1535f392e">fmod</a>)
+<a name="l00382"></a>00382 
+<a name="l00383"></a>00383 
+<a name="l00390"></a>00390 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#ac5277212e0df309a0a7c908424f7b14b">fract</a>(<span class="keywordtype">float</span> v, <span class="keywordtype">float</span> *iptr);
+<a name="l00391"></a>00391 FN_FUNC_FN_PFN(<a class="code" href="rs__cl_8rsh.html#ac5277212e0df309a0a7c908424f7b14b">fract</a>)
+<a name="l00392"></a>00392 
+<a name="l00399"></a>00399 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a778635fffed3cee8ab0800482ba53a30">frexp</a>(<span class="keywordtype">float</span> v, <span class="keywordtype">int</span> *iptr);
+<a name="l00400"></a>00400 FN_FUNC_FN_PIN(<a class="code" href="rs__cl_8rsh.html#a778635fffed3cee8ab0800482ba53a30">frexp</a>)
+<a name="l00401"></a>00401 
+<a name="l00407"></a>00407 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a147f38d6e41f45de9b5e7c6f3dcac010">hypot</a>(<span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y);
+<a name="l00408"></a>00408 FN_FUNC_FN_FN(<a class="code" href="rs__cl_8rsh.html#a147f38d6e41f45de9b5e7c6f3dcac010">hypot</a>)
+<a name="l00409"></a>00409 
+<a name="l00415"></a>00415 extern <span class="keywordtype">int</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#aad9a8beba52acb77b1efeba432e6cc2c">ilogb</a>(<span class="keywordtype">float</span>);
+<a name="l00416"></a>00416 IN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#aad9a8beba52acb77b1efeba432e6cc2c">ilogb</a>)
+<a name="l00417"></a>00417 
+<a name="l00424"></a>00424 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a013bc1dcda984cbc608e123ed38491e6">ldexp</a>(<span class="keywordtype">float</span> x, <span class="keywordtype">int</span> y);
+<a name="l00425"></a>00425 FN_FUNC_FN_IN(<a class="code" href="rs__cl_8rsh.html#a013bc1dcda984cbc608e123ed38491e6">ldexp</a>)
+<a name="l00426"></a>00426 FN_FUNC_FN_I(<a class="code" href="rs__cl_8rsh.html#a013bc1dcda984cbc608e123ed38491e6">ldexp</a>)
+<a name="l00427"></a>00427 
+<a name="l00433"></a>00433 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a3ff36f9b21927d6b4b58616e48fddcb4">lgamma</a>(<span class="keywordtype">float</span>);
+<a name="l00434"></a>00434 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#a3ff36f9b21927d6b4b58616e48fddcb4">lgamma</a>)
+<a name="l00435"></a>00435 
+<a name="l00442"></a>00442 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a3ff36f9b21927d6b4b58616e48fddcb4">lgamma</a>(<span class="keywordtype">float</span> x, <span class="keywordtype">int</span>* y);
+<a name="l00443"></a>00443 FN_FUNC_FN_PIN(<a class="code" href="rs__cl_8rsh.html#a3ff36f9b21927d6b4b58616e48fddcb4">lgamma</a>)
+<a name="l00444"></a>00444 
+<a name="l00450"></a>00450 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a3ff85f5f4b206ecf9ec9d128d7d18a08">log</a>(<span class="keywordtype">float</span>);
+<a name="l00451"></a>00451 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#a3ff85f5f4b206ecf9ec9d128d7d18a08">log</a>)
+<a name="l00452"></a>00452 
+<a name="l00458"></a>00458 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#af5c1bdba2a13aa2e2b0722287f6a919f">log10</a>(<span class="keywordtype">float</span>);
+<a name="l00459"></a>00459 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#af5c1bdba2a13aa2e2b0722287f6a919f">log10</a>)
+<a name="l00460"></a>00460 
+<a name="l00466"></a>00466 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a2fb571ae932f671ff3e9e97f2d3fabb7">log2</a>(<span class="keywordtype">float</span> v);
+<a name="l00467"></a>00467 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#a2fb571ae932f671ff3e9e97f2d3fabb7">log2</a>)
+<a name="l00468"></a>00468 
+<a name="l00474"></a>00474 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#ae10541ede49062ef7f977712c4878c1f">log1p</a>(<span class="keywordtype">float</span> v);
+<a name="l00475"></a>00475 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#ae10541ede49062ef7f977712c4878c1f">log1p</a>)
+<a name="l00476"></a>00476 
+<a name="l00482"></a>00482 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a28742d6ce2f20a61f16ecc08ed499871">logb</a>(<span class="keywordtype">float</span>);
+<a name="l00483"></a>00483 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#a28742d6ce2f20a61f16ecc08ed499871">logb</a>)
+<a name="l00484"></a>00484 
+<a name="l00490"></a>00490 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a4f9086698f1eb466ba2dccf7e331cdc3">mad</a>(<span class="keywordtype">float</span> a, <span class="keywordtype">float</span> b, <span class="keywordtype">float</span> c);
+<a name="l00491"></a>00491 FN_FUNC_FN_FN_FN(<a class="code" href="rs__cl_8rsh.html#a4f9086698f1eb466ba2dccf7e331cdc3">mad</a>)
+<a name="l00492"></a>00492 
+<a name="l00501"></a>00501 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a841633bcdcaeb6a514d9c6460f0adf2d">modf</a>(<span class="keywordtype">float</span> x, <span class="keywordtype">float</span> *iret);
+<a name="l00502"></a>00502 FN_FUNC_FN_PFN(<a class="code" href="rs__cl_8rsh.html#a841633bcdcaeb6a514d9c6460f0adf2d">modf</a>);
+<a name="l00503"></a>00503 
+<a name="l00504"></a>00504 <span class="comment">//extern float __attribute__((overloadable)) nan(uint);</span>
+<a name="l00505"></a>00505 
+<a name="l00511"></a>00511 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#adb11df05fb9985595af0a7bd882bdeac">nextafter</a>(<span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y);
+<a name="l00512"></a>00512 FN_FUNC_FN_FN(<a class="code" href="rs__cl_8rsh.html#adb11df05fb9985595af0a7bd882bdeac">nextafter</a>)
+<a name="l00513"></a>00513 
+<a name="l00519"></a>00519 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#afd46205452017b741abb2e17fc28557d">pown</a>(<span class="keywordtype">float</span> v, <span class="keywordtype">int</span> p);
+<a name="l00520"></a>00520 FN_FUNC_FN_IN(<a class="code" href="rs__cl_8rsh.html#afd46205452017b741abb2e17fc28557d">pown</a>)
+<a name="l00521"></a>00521 
+<a name="l00528"></a>00528 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a3ff65421721ec8e6ce8d875a563d005f">powr</a>(<span class="keywordtype">float</span> v, <span class="keywordtype">float</span> p);
+<a name="l00529"></a>00529 FN_FUNC_FN_FN(<a class="code" href="rs__cl_8rsh.html#a3ff65421721ec8e6ce8d875a563d005f">powr</a>)
+<a name="l00530"></a>00530 
+<a name="l00536"></a>00536 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a5188ac0e3af95b0956c6abeafb74fda9">remainder</a>(<span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y);
+<a name="l00537"></a>00537 FN_FUNC_FN_FN(<a class="code" href="rs__cl_8rsh.html#a5188ac0e3af95b0956c6abeafb74fda9">remainder</a>)
+<a name="l00538"></a>00538 
+<a name="l00539"></a>00539 <span class="comment">// document once we know the precision of bionic</span>
+<a name="l00540"></a>00540 extern <span class="keywordtype">float</span> __attribute__((overloadable)) remquo(<span class="keywordtype">float</span>, <span class="keywordtype">float</span>, <span class="keywordtype">int</span> *);
+<a name="l00541"></a>00541 FN_FUNC_FN_FN_PIN(remquo)
+<a name="l00542"></a>00542 
+<a name="l00548"></a>00548 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#adb0ffe344ae56ca7fc9083c1f2943e55">rint</a>(<span class="keywordtype">float</span>);
+<a name="l00549"></a>00549 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#adb0ffe344ae56ca7fc9083c1f2943e55">rint</a>)
+<a name="l00550"></a>00550 
+<a name="l00556"></a>00556 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#af169e7e1c575b7c24c1834569223077f">rootn</a>(<span class="keywordtype">float</span> v, <span class="keywordtype">int</span> n);
+<a name="l00557"></a>00557 FN_FUNC_FN_IN(<a class="code" href="rs__cl_8rsh.html#af169e7e1c575b7c24c1834569223077f">rootn</a>)
+<a name="l00558"></a>00558 
+<a name="l00564"></a>00564 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#aff4846ab5b947550814d5414a2c3626f">round</a>(<span class="keywordtype">float</span>);
+<a name="l00565"></a>00565 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#aff4846ab5b947550814d5414a2c3626f">round</a>)
+<a name="l00566"></a>00566 
+<a name="l00572"></a>00572 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a92da0faef80c4d8f66e954c8c169a729">sqrt</a>(<span class="keywordtype">float</span>);
+<a name="l00573"></a>00573 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#a92da0faef80c4d8f66e954c8c169a729">sqrt</a>)
+<a name="l00574"></a>00574 
+<a name="l00581"></a>00581 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a5db00fde9e6bff693a38f3a37e7a1f70">rsqrt</a>(<span class="keywordtype">float</span> v);
+<a name="l00582"></a>00582 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#a5db00fde9e6bff693a38f3a37e7a1f70">rsqrt</a>)
+<a name="l00583"></a>00583 
+<a name="l00590"></a>00590 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a8c8cd526b44eb55aede77cf659f24306">sin</a>(<span class="keywordtype">float</span> v);
+<a name="l00591"></a>00591 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#a8c8cd526b44eb55aede77cf659f24306">sin</a>)
+<a name="l00592"></a>00592 
+<a name="l00602"></a>00602 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a240f7c7c20b432a30dc660b5dd4cd320">sincos</a>(<span class="keywordtype">float</span> v, <span class="keywordtype">float</span> *cosptr);
+<a name="l00603"></a>00603 FN_FUNC_FN_PFN(<a class="code" href="rs__cl_8rsh.html#a240f7c7c20b432a30dc660b5dd4cd320">sincos</a>);
+<a name="l00604"></a>00604 
+<a name="l00610"></a>00610 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#ae686e0cc567f7ee2b0a84706aa486e4a">sinh</a>(<span class="keywordtype">float</span>);
+<a name="l00611"></a>00611 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#ae686e0cc567f7ee2b0a84706aa486e4a">sinh</a>)
+<a name="l00612"></a>00612 
+<a name="l00618"></a>00618 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a4fe4fef049786e888526d6f37b912b0a">sinpi</a>(<span class="keywordtype">float</span> v);
+<a name="l00619"></a>00619 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#a4fe4fef049786e888526d6f37b912b0a">sinpi</a>)
+<a name="l00620"></a>00620 
+<a name="l00627"></a>00627 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#af12e245af8ff9bb72b5000e7c26cd8fe">tan</a>(<span class="keywordtype">float</span> v);
+<a name="l00628"></a>00628 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#af12e245af8ff9bb72b5000e7c26cd8fe">tan</a>)
+<a name="l00629"></a>00629 
+<a name="l00636"></a>00636 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#abc36e89ddb87ea78451d1c5921ddbd8d">tanh</a>(<span class="keywordtype">float</span>);
+<a name="l00637"></a>00637 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#abc36e89ddb87ea78451d1c5921ddbd8d">tanh</a>)
+<a name="l00638"></a>00638 
+<a name="l00644"></a>00644 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#ad8bfb083dd3979a305e594a0d6e581c4">tanpi</a>(<span class="keywordtype">float</span> v);
+<a name="l00645"></a>00645 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#ad8bfb083dd3979a305e594a0d6e581c4">tanpi</a>)
+<a name="l00646"></a>00646 
+<a name="l00652"></a>00652 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#ab9f4cbfd2470420ee302f28cf3de6dd0">tgamma</a>(<span class="keywordtype">float</span>);
+<a name="l00653"></a>00653 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#ab9f4cbfd2470420ee302f28cf3de6dd0">tgamma</a>)
+<a name="l00654"></a>00654 
+<a name="l00660"></a>00660 extern <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#ad1a7c65693231219db1babeae1c41f15">trunc</a>(<span class="keywordtype">float</span>);
+<a name="l00661"></a>00661 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#ad1a7c65693231219db1babeae1c41f15">trunc</a>)
+<a name="l00662"></a>00662 
+<a name="l00663"></a>00663 
+<a name="l00664"></a>00664 <span class="preprocessor">#define XN_FUNC_YN(typeout, fnc, typein)                                \</span>
+<a name="l00665"></a>00665 <span class="preprocessor">extern typeout __attribute__((overloadable)) fnc(typein);               \</span>
+<a name="l00666"></a>00666 <span class="preprocessor">_RS_RUNTIME typeout##2 __attribute__((overloadable)) fnc(typein##2 v);   \</span>
+<a name="l00667"></a>00667 <span class="preprocessor">_RS_RUNTIME typeout##3 __attribute__((overloadable)) fnc(typein##3 v);   \</span>
+<a name="l00668"></a>00668 <span class="preprocessor">_RS_RUNTIME typeout##4 __attribute__((overloadable)) fnc(typein##4 v);</span>
+<a name="l00669"></a>00669 <span class="preprocessor"></span>
+<a name="l00670"></a>00670 <span class="preprocessor">#define UIN_FUNC_IN(fnc)          \</span>
+<a name="l00671"></a>00671 <span class="preprocessor">XN_FUNC_YN(uchar, fnc, char)      \</span>
+<a name="l00672"></a>00672 <span class="preprocessor">XN_FUNC_YN(ushort, fnc, short)    \</span>
+<a name="l00673"></a>00673 <span class="preprocessor">XN_FUNC_YN(uint, fnc, int)</span>
+<a name="l00674"></a>00674 <span class="preprocessor"></span>
+<a name="l00675"></a>00675 <span class="preprocessor">#define IN_FUNC_IN(fnc)           \</span>
+<a name="l00676"></a>00676 <span class="preprocessor">XN_FUNC_YN(uchar, fnc, uchar)     \</span>
+<a name="l00677"></a>00677 <span class="preprocessor">XN_FUNC_YN(char, fnc, char)       \</span>
+<a name="l00678"></a>00678 <span class="preprocessor">XN_FUNC_YN(ushort, fnc, ushort)   \</span>
+<a name="l00679"></a>00679 <span class="preprocessor">XN_FUNC_YN(short, fnc, short)     \</span>
+<a name="l00680"></a>00680 <span class="preprocessor">XN_FUNC_YN(uint, fnc, uint)       \</span>
+<a name="l00681"></a>00681 <span class="preprocessor">XN_FUNC_YN(int, fnc, int)</span>
+<a name="l00682"></a>00682 <span class="preprocessor"></span>
+<a name="l00683"></a>00683 
+<a name="l00684"></a>00684 <span class="preprocessor">#define XN_FUNC_XN_XN_BODY(type, fnc, body)         \</span>
+<a name="l00685"></a>00685 <span class="preprocessor">_RS_RUNTIME type __attribute__((overloadable))       \</span>
+<a name="l00686"></a>00686 <span class="preprocessor">        fnc(type v1, type v2);                      \</span>
+<a name="l00687"></a>00687 <span class="preprocessor">_RS_RUNTIME type##2 __attribute__((overloadable))    \</span>
+<a name="l00688"></a>00688 <span class="preprocessor">        fnc(type##2 v1, type##2 v2);                \</span>
+<a name="l00689"></a>00689 <span class="preprocessor">_RS_RUNTIME type##3 __attribute__((overloadable))    \</span>
+<a name="l00690"></a>00690 <span class="preprocessor">        fnc(type##3 v1, type##3 v2);                \</span>
+<a name="l00691"></a>00691 <span class="preprocessor">_RS_RUNTIME type##4 __attribute__((overloadable))    \</span>
+<a name="l00692"></a>00692 <span class="preprocessor">        fnc(type##4 v1, type##4 v2);</span>
+<a name="l00693"></a>00693 <span class="preprocessor"></span>
+<a name="l00694"></a>00694 <span class="preprocessor">#define IN_FUNC_IN_IN_BODY(fnc, body) \</span>
+<a name="l00695"></a>00695 <span class="preprocessor">XN_FUNC_XN_XN_BODY(uchar, fnc, body)  \</span>
+<a name="l00696"></a>00696 <span class="preprocessor">XN_FUNC_XN_XN_BODY(char, fnc, body)   \</span>
+<a name="l00697"></a>00697 <span class="preprocessor">XN_FUNC_XN_XN_BODY(ushort, fnc, body) \</span>
+<a name="l00698"></a>00698 <span class="preprocessor">XN_FUNC_XN_XN_BODY(short, fnc, body)  \</span>
+<a name="l00699"></a>00699 <span class="preprocessor">XN_FUNC_XN_XN_BODY(uint, fnc, body)   \</span>
+<a name="l00700"></a>00700 <span class="preprocessor">XN_FUNC_XN_XN_BODY(int, fnc, body)    \</span>
+<a name="l00701"></a>00701 <span class="preprocessor">XN_FUNC_XN_XN_BODY(float, fnc, body)</span>
+<a name="l00702"></a>00702 <span class="preprocessor"></span>
+<a name="l00703"></a>00703 UIN_FUNC_IN(abs)
+<a name="l00704"></a>00704 IN_FUNC_IN(clz)
+<a name="l00705"></a>00705 
+<a name="l00711"></a>00711 IN_FUNC_IN_IN_BODY(min, (v1 &lt; v2 ? v1 : v2))
+<a name="l00712"></a>00712 FN_FUNC_FN_F(min)
+<a name="l00713"></a>00713 
+<a name="l00719"></a>00719 IN_FUNC_IN_IN_BODY(max, (v1 &gt; v2 ? v1 : v2))
+<a name="l00720"></a>00720 FN_FUNC_FN_F(max)
+<a name="l00721"></a>00721 
+<a name="l00729"></a>00729 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#ad4dab580aba6cf15539b407b9163dfde">clamp</a>(<span class="keywordtype">float</span> amount, <span class="keywordtype">float</span> low, <span class="keywordtype">float</span> high);
+<a name="l00730"></a>00730 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#ad4dab580aba6cf15539b407b9163dfde">clamp</a>(<a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> amount, <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> low, <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> high);
+<a name="l00731"></a>00731 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#ad4dab580aba6cf15539b407b9163dfde">clamp</a>(<a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> amount, <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> low, <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> high);
+<a name="l00732"></a>00732 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#ad4dab580aba6cf15539b407b9163dfde">clamp</a>(<a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> amount, <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> low, <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> high);
+<a name="l00733"></a>00733 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#ad4dab580aba6cf15539b407b9163dfde">clamp</a>(<a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> amount, <span class="keywordtype">float</span> low, <span class="keywordtype">float</span> high);
+<a name="l00734"></a>00734 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#ad4dab580aba6cf15539b407b9163dfde">clamp</a>(<a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> amount, <span class="keywordtype">float</span> low, <span class="keywordtype">float</span> high);
+<a name="l00735"></a>00735 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#ad4dab580aba6cf15539b407b9163dfde">clamp</a>(<a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> amount, <span class="keywordtype">float</span> low, <span class="keywordtype">float</span> high);
+<a name="l00736"></a>00736 
+<a name="l00742"></a>00742 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#adc1b551193e66d8037daa1721df4d29c">degrees</a>(<span class="keywordtype">float</span> <a class="code" href="rs__cl_8rsh.html#aaef2526c4d190ba6f7301b4e810917a7">radians</a>);
+<a name="l00743"></a>00743 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#adc1b551193e66d8037daa1721df4d29c">degrees</a>)
+<a name="l00744"></a>00744 
+<a name="l00750"></a>00750 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#af4c76d51368c8e330cb59ea5a0a2310e">mix</a>(<span class="keywordtype">float</span> start, <span class="keywordtype">float</span> stop, <span class="keywordtype">float</span> amount);
+<a name="l00751"></a>00751 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#af4c76d51368c8e330cb59ea5a0a2310e">mix</a>(<a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> start, <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> stop, <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> amount);
+<a name="l00752"></a>00752 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#af4c76d51368c8e330cb59ea5a0a2310e">mix</a>(<a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> start, <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> stop, <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> amount);
+<a name="l00753"></a>00753 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#af4c76d51368c8e330cb59ea5a0a2310e">mix</a>(<a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> start, <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> stop, <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> amount);
+<a name="l00754"></a>00754 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#af4c76d51368c8e330cb59ea5a0a2310e">mix</a>(<a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> start, <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> stop, <span class="keywordtype">float</span> amount);
+<a name="l00755"></a>00755 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#af4c76d51368c8e330cb59ea5a0a2310e">mix</a>(<a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> start, <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> stop, <span class="keywordtype">float</span> amount);
+<a name="l00756"></a>00756 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#af4c76d51368c8e330cb59ea5a0a2310e">mix</a>(<a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> start, <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> stop, <span class="keywordtype">float</span> amount);
+<a name="l00757"></a>00757 
+<a name="l00763"></a>00763 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) radians(<span class="keywordtype">float</span> <a class="code" href="rs__cl_8rsh.html#adc1b551193e66d8037daa1721df4d29c">degrees</a>);
+<a name="l00764"></a>00764 FN_FUNC_FN(radians)
+<a name="l00765"></a>00765 
+<a name="l00774"></a>00774 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a4f7ba6882099d16853d0415982121900">step</a>(<span class="keywordtype">float</span> edge, <span class="keywordtype">float</span> v);
+<a name="l00775"></a>00775 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a4f7ba6882099d16853d0415982121900">step</a>(<a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> edge, <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> v);
+<a name="l00776"></a>00776 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a4f7ba6882099d16853d0415982121900">step</a>(<a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> edge, <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> v);
+<a name="l00777"></a>00777 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a4f7ba6882099d16853d0415982121900">step</a>(<a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> edge, <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> v);
+<a name="l00778"></a>00778 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a4f7ba6882099d16853d0415982121900">step</a>(<a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> edge, <span class="keywordtype">float</span> v);
+<a name="l00779"></a>00779 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a4f7ba6882099d16853d0415982121900">step</a>(<a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> edge, <span class="keywordtype">float</span> v);
+<a name="l00780"></a>00780 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a4f7ba6882099d16853d0415982121900">step</a>(<a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> edge, <span class="keywordtype">float</span> v);
+<a name="l00781"></a>00781 
+<a name="l00782"></a>00782 <span class="comment">// not implemented</span>
+<a name="l00783"></a>00783 extern <span class="keywordtype">float</span> __attribute__((overloadable)) smoothstep(<span class="keywordtype">float</span>, <span class="keywordtype">float</span>, <span class="keywordtype">float</span>);
+<a name="l00784"></a>00784 extern <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> __attribute__((overloadable)) smoothstep(<a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a>, float2, float2);
+<a name="l00785"></a>00785 extern <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> __attribute__((overloadable)) smoothstep(<a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a>, float3, float3);
+<a name="l00786"></a>00786 extern <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((overloadable)) smoothstep(<a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a>, float4, float4);
+<a name="l00787"></a>00787 extern float2 __attribute__((overloadable)) smoothstep(<span class="keywordtype">float</span>, <span class="keywordtype">float</span>, float2);
+<a name="l00788"></a>00788 extern float3 __attribute__((overloadable)) smoothstep(<span class="keywordtype">float</span>, <span class="keywordtype">float</span>, float3);
+<a name="l00789"></a>00789 extern float4 __attribute__((overloadable)) smoothstep(<span class="keywordtype">float</span>, <span class="keywordtype">float</span>, float4);
+<a name="l00790"></a>00790 
+<a name="l00798"></a>00798 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a3e6d477a06dec7070f073eec9d8f420c">sign</a>(<span class="keywordtype">float</span> v);
+<a name="l00799"></a>00799 FN_FUNC_FN(<a class="code" href="rs__cl_8rsh.html#a3e6d477a06dec7070f073eec9d8f420c">sign</a>)
+<a name="l00800"></a>00800 
+<a name="l00806"></a>00806 _RS_RUNTIME float3 __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a0f7beb26bb4aa30535babd14492a7e90">cross</a>(float3 lhs, float3 rhs);
+<a name="l00807"></a>00807 _RS_RUNTIME float4 __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a0f7beb26bb4aa30535babd14492a7e90">cross</a>(float4 lhs, float4 rhs);
+<a name="l00808"></a>00808 
+<a name="l00814"></a>00814 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a70544acaca578035a849eef67d62c449">dot</a>(<span class="keywordtype">float</span> lhs, <span class="keywordtype">float</span> rhs);
+<a name="l00815"></a>00815 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a70544acaca578035a849eef67d62c449">dot</a>(float2 lhs, float2 rhs);
+<a name="l00816"></a>00816 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a70544acaca578035a849eef67d62c449">dot</a>(float3 lhs, float3 rhs);
+<a name="l00817"></a>00817 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a70544acaca578035a849eef67d62c449">dot</a>(float4 lhs, float4 rhs);
+<a name="l00818"></a>00818 
+<a name="l00824"></a>00824 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a1a222b7879342279e1e0070d6afd9e18">length</a>(<span class="keywordtype">float</span> v);
+<a name="l00825"></a>00825 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a1a222b7879342279e1e0070d6afd9e18">length</a>(float2 v);
+<a name="l00826"></a>00826 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a1a222b7879342279e1e0070d6afd9e18">length</a>(float3 v);
+<a name="l00827"></a>00827 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a1a222b7879342279e1e0070d6afd9e18">length</a>(float4 v);
+<a name="l00828"></a>00828 
+<a name="l00834"></a>00834 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a4488863373be92e113e9d24aa3d21e76">distance</a>(<span class="keywordtype">float</span> lhs, <span class="keywordtype">float</span> rhs);
+<a name="l00835"></a>00835 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a4488863373be92e113e9d24aa3d21e76">distance</a>(float2 lhs, float2 rhs);
+<a name="l00836"></a>00836 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a4488863373be92e113e9d24aa3d21e76">distance</a>(float3 lhs, float3 rhs);
+<a name="l00837"></a>00837 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a4488863373be92e113e9d24aa3d21e76">distance</a>(float4 lhs, float4 rhs);
+<a name="l00838"></a>00838 
+<a name="l00844"></a>00844 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a373e03e92a1b7f3fdea5ca4ca159d2a8">normalize</a>(<span class="keywordtype">float</span> v);
+<a name="l00845"></a>00845 _RS_RUNTIME float2 __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a373e03e92a1b7f3fdea5ca4ca159d2a8">normalize</a>(float2 v);
+<a name="l00846"></a>00846 _RS_RUNTIME float3 __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a373e03e92a1b7f3fdea5ca4ca159d2a8">normalize</a>(float3 v);
+<a name="l00847"></a>00847 _RS_RUNTIME float4 __attribute__((overloadable)) <a class="code" href="rs__cl_8rsh.html#a373e03e92a1b7f3fdea5ca4ca159d2a8">normalize</a>(float4 v);
+<a name="l00848"></a>00848 
+<a name="l00849"></a>00849 <span class="preprocessor">#undef CVT_FUNC</span>
+<a name="l00850"></a>00850 <span class="preprocessor"></span><span class="preprocessor">#undef CVT_FUNC_2</span>
+<a name="l00851"></a>00851 <span class="preprocessor"></span><span class="preprocessor">#undef FN_FUNC_FN</span>
+<a name="l00852"></a>00852 <span class="preprocessor"></span><span class="preprocessor">#undef IN_FUNC_FN</span>
+<a name="l00853"></a>00853 <span class="preprocessor"></span><span class="preprocessor">#undef FN_FUNC_FN_FN</span>
+<a name="l00854"></a>00854 <span class="preprocessor"></span><span class="preprocessor">#undef FN_FUNC_FN_F</span>
+<a name="l00855"></a>00855 <span class="preprocessor"></span><span class="preprocessor">#undef FN_FUNC_FN_IN</span>
+<a name="l00856"></a>00856 <span class="preprocessor"></span><span class="preprocessor">#undef FN_FUNC_FN_I</span>
+<a name="l00857"></a>00857 <span class="preprocessor"></span><span class="preprocessor">#undef FN_FUNC_FN_PFN</span>
+<a name="l00858"></a>00858 <span class="preprocessor"></span><span class="preprocessor">#undef FN_FUNC_FN_PIN</span>
+<a name="l00859"></a>00859 <span class="preprocessor"></span><span class="preprocessor">#undef FN_FUNC_FN_FN_FN</span>
+<a name="l00860"></a>00860 <span class="preprocessor"></span><span class="preprocessor">#undef FN_FUNC_FN_FN_PIN</span>
+<a name="l00861"></a>00861 <span class="preprocessor"></span><span class="preprocessor">#undef XN_FUNC_YN</span>
+<a name="l00862"></a>00862 <span class="preprocessor"></span><span class="preprocessor">#undef UIN_FUNC_IN</span>
+<a name="l00863"></a>00863 <span class="preprocessor"></span><span class="preprocessor">#undef IN_FUNC_IN</span>
+<a name="l00864"></a>00864 <span class="preprocessor"></span><span class="preprocessor">#undef XN_FUNC_XN_XN_BODY</span>
+<a name="l00865"></a>00865 <span class="preprocessor"></span><span class="preprocessor">#undef IN_FUNC_IN_IN_BODY</span>
+<a name="l00866"></a>00866 <span class="preprocessor"></span>
+<a name="l00867"></a>00867 <span class="preprocessor">#endif</span>
+</pre></div></div>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/rs__core_8rsh.html b/docs/html/reference/renderscript/rs__core_8rsh.html
new file mode 100644
index 0000000..5a32e19
--- /dev/null
+++ b/docs/html/reference/renderscript/rs__core_8rsh.html
@@ -0,0 +1,306 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_core.rsh File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="summary">
+<a href="#nested-classes">Data Structures</a> &#124;
+<a href="#typedef-members">Typedefs</a> &#124;
+<a href="#enum-members">Enumerations</a> &#124;
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_core.rsh File Reference</div>  </div>
+</div>
+<div class="contents">
+<div class="textblock"><code>#include &quot;<a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>&quot;</code><br/>
+<code>#include &quot;<a class="el" href="rs__allocation_8rsh_source.html">rs_allocation.rsh</a>&quot;</code><br/>
+<code>#include &quot;<a class="el" href="rs__atomic_8rsh_source.html">rs_atomic.rsh</a>&quot;</code><br/>
+<code>#include &quot;<a class="el" href="rs__cl_8rsh_source.html">rs_cl.rsh</a>&quot;</code><br/>
+<code>#include &quot;<a class="el" href="rs__debug_8rsh_source.html">rs_debug.rsh</a>&quot;</code><br/>
+<code>#include &quot;<a class="el" href="rs__math_8rsh_source.html">rs_math.rsh</a>&quot;</code><br/>
+<code>#include &quot;<a class="el" href="rs__matrix_8rsh_source.html">rs_matrix.rsh</a>&quot;</code><br/>
+<code>#include &quot;<a class="el" href="rs__object_8rsh_source.html">rs_object.rsh</a>&quot;</code><br/>
+<code>#include &quot;<a class="el" href="rs__quaternion_8rsh_source.html">rs_quaternion.rsh</a>&quot;</code><br/>
+<code>#include &quot;<a class="el" href="rs__time_8rsh_source.html">rs_time.rsh</a>&quot;</code><br/>
+</div><table class="memberdecls">
+<tr><td colspan="2"><h2><a name="nested-classes"></a>
+Data Structures</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrs__script__call.html">rs_script_call</a></td></tr>
+<tr><td colspan="2"><h2><a name="typedef-members"></a>
+Typedefs</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structrs__script__call.html">rs_script_call</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__core_8rsh.html#ae8756b32e23445f287960b9d0ffb449c">rs_script_call_t</a></td></tr>
+<tr><td colspan="2"><h2><a name="enum-members"></a>
+Enumerations</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__core_8rsh.html#ae1755c901e8acb42510ad10b4e104746">rs_for_each_strategy</a> </td></tr>
+<tr><td colspan="2"><h2><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__core_8rsh.html#a91cfbca99f87ef144bea2cdf1e8473ca">rsSendToClient</a> (int cmdID)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__core_8rsh.html#a508003cadad2d37d41e2de7e9226f859">rsSendToClient</a> (int cmdID, const void *data, <a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> len)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__core_8rsh.html#a6e4ff6388e8c6978ed17447214f2a2e2">rsSendToClientBlocking</a> (int cmdID)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__core_8rsh.html#afc93b00be08f58512a6ab6a87feb9515">rsSendToClientBlocking</a> (int cmdID, const void *data, <a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> len)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__core_8rsh.html#a95ebbf7a8923193df144649c066daae6">rsForEach</a> (<a class="el" href="structrs__script.html">rs_script</a> script, <a class="el" href="structrs__allocation.html">rs_allocation</a> input, <a class="el" href="structrs__allocation.html">rs_allocation</a> output, const void *usrData, const <a class="el" href="rs__core_8rsh.html#ae8756b32e23445f287960b9d0ffb449c">rs_script_call_t</a> *sc)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__core_8rsh.html#ae62dc9d507e0e62c064217c71cc94101">rsForEach</a> (<a class="el" href="structrs__script.html">rs_script</a> script, <a class="el" href="structrs__allocation.html">rs_allocation</a> input, <a class="el" href="structrs__allocation.html">rs_allocation</a> output, const void *usrData)</td></tr>
+</table>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>todo-jsams </p>
+
+<p>Definition in file <a class="el" href="rs__core_8rsh_source.html">rs_core.rsh</a>.</p>
+</div><hr/><h2>Typedef Documentation</h2>
+<a class="anchor" id="ae8756b32e23445f287960b9d0ffb449c"></a><!-- doxytag: member="rs_core.rsh::rs_script_call_t" ref="ae8756b32e23445f287960b9d0ffb449c" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef struct <a class="el" href="structrs__script__call.html">rs_script_call</a>  <a class="el" href="rs__core_8rsh.html#ae8756b32e23445f287960b9d0ffb449c">rs_script_call_t</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Structure to provide extra information to a rsForEach call. Primarly used to restrict the call to a subset of cells in the allocation. </p>
+
+</div>
+</div>
+<hr/><h2>Enumeration Type Documentation</h2>
+<a class="anchor" id="ae1755c901e8acb42510ad10b4e104746"></a><!-- doxytag: member="rs_core.rsh::rs_for_each_strategy" ref="ae1755c901e8acb42510ad10b4e104746" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">enum <a class="el" href="rs__core_8rsh.html#ae1755c901e8acb42510ad10b4e104746">rs_for_each_strategy</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Launch order hint for rsForEach calls. This provides a hint to the system to determine in which order the root function of the target is called with each cell of the allocation.</p>
+<p>This is a hint and implementations may not obey the order. </p>
+
+<p>Definition at line <a class="el" href="rs__core_8rsh_source.html#l00074">74</a> of file <a class="el" href="rs__core_8rsh_source.html">rs_core.rsh</a>.</p>
+
+</div>
+</div>
+<hr/><h2>Function Documentation</h2>
+<a class="anchor" id="a95ebbf7a8923193df144649c066daae6"></a><!-- doxytag: member="rs_core.rsh::rsForEach" ref="a95ebbf7a8923193df144649c066daae6" args="(rs_script script, rs_allocation input, rs_allocation output, const void *usrData, const rs_script_call_t *sc)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsForEach </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__script.html">rs_script</a>&#160;</td>
+          <td class="paramname"><em>script</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="structrs__allocation.html">rs_allocation</a>&#160;</td>
+          <td class="paramname"><em>input</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="structrs__allocation.html">rs_allocation</a>&#160;</td>
+          <td class="paramname"><em>output</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const void *&#160;</td>
+          <td class="paramname"><em>usrData</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="rs__core_8rsh.html#ae8756b32e23445f287960b9d0ffb449c">rs_script_call_t</a> *&#160;</td>
+          <td class="paramname"><em>sc</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Make a script to script call to launch work. One of the input or output is required to be a valid object. The input and output must be of the same dimensions. API 10-13</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">script</td><td>The target script to call </td></tr>
+    <tr><td class="paramname">input</td><td>The allocation to source data from </td></tr>
+    <tr><td class="paramname">output</td><td>the allocation to write date into </td></tr>
+    <tr><td class="paramname">usrData</td><td>The user definied params to pass to the root script. May be NULL. </td></tr>
+    <tr><td class="paramname">sc</td><td>Extra control infomation used to select a sub-region of the allocation to be processed or suggest a walking strategy. May be NULL. </td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ae62dc9d507e0e62c064217c71cc94101"></a><!-- doxytag: member="rs_core.rsh::rsForEach" ref="ae62dc9d507e0e62c064217c71cc94101" args="(rs_script script, rs_allocation input, rs_allocation output, const void *usrData)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsForEach </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__script.html">rs_script</a>&#160;</td>
+          <td class="paramname"><em>script</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="structrs__allocation.html">rs_allocation</a>&#160;</td>
+          <td class="paramname"><em>input</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="structrs__allocation.html">rs_allocation</a>&#160;</td>
+          <td class="paramname"><em>output</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const void *&#160;</td>
+          <td class="paramname"><em>usrData</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a91cfbca99f87ef144bea2cdf1e8473ca"></a><!-- doxytag: member="rs_core.rsh::rsSendToClient" ref="a91cfbca99f87ef144bea2cdf1e8473ca" args="(int cmdID)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">bool rsSendToClient </td>
+          <td>(</td>
+          <td class="paramtype">int&#160;</td>
+          <td class="paramname"><em>cmdID</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Send a message back to the client. Will not block and returns true if the message was sendable and false if the fifo was full. A message ID is required. Data payload is optional. </p>
+
+</div>
+</div>
+<a class="anchor" id="a508003cadad2d37d41e2de7e9226f859"></a><!-- doxytag: member="rs_core.rsh::rsSendToClient" ref="a508003cadad2d37d41e2de7e9226f859" args="(int cmdID, const void *data, uint len)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">bool rsSendToClient </td>
+          <td>(</td>
+          <td class="paramtype">int&#160;</td>
+          <td class="paramname"><em>cmdID</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const void *&#160;</td>
+          <td class="paramname"><em>data</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>&#160;</td>
+          <td class="paramname"><em>len</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a6e4ff6388e8c6978ed17447214f2a2e2"></a><!-- doxytag: member="rs_core.rsh::rsSendToClientBlocking" ref="a6e4ff6388e8c6978ed17447214f2a2e2" args="(int cmdID)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsSendToClientBlocking </td>
+          <td>(</td>
+          <td class="paramtype">int&#160;</td>
+          <td class="paramname"><em>cmdID</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Send a message back to the client, blocking until the message is queued. A message ID is required. Data payload is optional. </p>
+
+</div>
+</div>
+<a class="anchor" id="afc93b00be08f58512a6ab6a87feb9515"></a><!-- doxytag: member="rs_core.rsh::rsSendToClientBlocking" ref="afc93b00be08f58512a6ab6a87feb9515" args="(int cmdID, const void *data, uint len)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsSendToClientBlocking </td>
+          <td>(</td>
+          <td class="paramtype">int&#160;</td>
+          <td class="paramname"><em>cmdID</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const void *&#160;</td>
+          <td class="paramname"><em>data</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>&#160;</td>
+          <td class="paramname"><em>len</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/rs__core_8rsh_source.html b/docs/html/reference/renderscript/rs__core_8rsh_source.html
new file mode 100644
index 0000000..fac83e0
--- /dev/null
+++ b/docs/html/reference/renderscript/rs__core_8rsh_source.html
@@ -0,0 +1,125 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_core.rsh Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_core.rsh</div>  </div>
+</div>
+<div class="contents">
+<a href="rs__core_8rsh.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
+<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2011 The Android Open Source Project</span>
+<a name="l00003"></a>00003 <span class="comment"> *</span>
+<a name="l00004"></a>00004 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span>
+<a name="l00005"></a>00005 <span class="comment"> * you may not use this file except in compliance with the License.</span>
+<a name="l00006"></a>00006 <span class="comment"> * You may obtain a copy of the License at</span>
+<a name="l00007"></a>00007 <span class="comment"> *</span>
+<a name="l00008"></a>00008 <span class="comment"> *      http://www.apache.org/licenses/LICENSE-2.0</span>
+<a name="l00009"></a>00009 <span class="comment"> *</span>
+<a name="l00010"></a>00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
+<a name="l00011"></a>00011 <span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span>
+<a name="l00012"></a>00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
+<a name="l00013"></a>00013 <span class="comment"> * See the License for the specific language governing permissions and</span>
+<a name="l00014"></a>00014 <span class="comment"> * limitations under the License.</span>
+<a name="l00015"></a>00015 <span class="comment"> */</span>
+<a name="l00016"></a>00016 
+<a name="l00024"></a>00024 <span class="preprocessor">#ifndef __RS_CORE_RSH__</span>
+<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#define __RS_CORE_RSH__</span>
+<a name="l00026"></a>00026 <span class="preprocessor"></span>
+<a name="l00027"></a>00027 <span class="preprocessor">#define _RS_RUNTIME extern</span>
+<a name="l00028"></a>00028 <span class="preprocessor"></span>
+<a name="l00029"></a>00029 <span class="preprocessor">#include &quot;<a class="code" href="rs__types_8rsh.html">rs_types.rsh</a>&quot;</span>
+<a name="l00030"></a>00030 <span class="preprocessor">#include &quot;<a class="code" href="rs__allocation_8rsh.html" title="Allocation routines.">rs_allocation.rsh</a>&quot;</span>
+<a name="l00031"></a>00031 <span class="preprocessor">#include &quot;<a class="code" href="rs__atomic_8rsh.html" title="Atomic routines.">rs_atomic.rsh</a>&quot;</span>
+<a name="l00032"></a>00032 <span class="preprocessor">#include &quot;<a class="code" href="rs__cl_8rsh.html" title="Basic math functions.">rs_cl.rsh</a>&quot;</span>
+<a name="l00033"></a>00033 <span class="preprocessor">#include &quot;<a class="code" href="rs__debug_8rsh.html" title="Utility debugging routines.">rs_debug.rsh</a>&quot;</span>
+<a name="l00034"></a>00034 <span class="preprocessor">#include &quot;<a class="code" href="rs__math_8rsh.html">rs_math.rsh</a>&quot;</span>
+<a name="l00035"></a>00035 <span class="preprocessor">#include &quot;<a class="code" href="rs__matrix_8rsh.html" title="Matrix routines.">rs_matrix.rsh</a>&quot;</span>
+<a name="l00036"></a>00036 <span class="preprocessor">#include &quot;<a class="code" href="rs__object_8rsh.html" title="Object routines.">rs_object.rsh</a>&quot;</span>
+<a name="l00037"></a>00037 <span class="preprocessor">#include &quot;<a class="code" href="rs__quaternion_8rsh.html" title="Quaternion routines.">rs_quaternion.rsh</a>&quot;</span>
+<a name="l00038"></a>00038 <span class="preprocessor">#include &quot;<a class="code" href="rs__time_8rsh.html" title="Renderscript time routines.">rs_time.rsh</a>&quot;</span>
+<a name="l00039"></a>00039 
+<a name="l00040"></a>00040 
+<a name="l00041"></a>00041 
+<a name="l00047"></a>00047 <span class="keyword">extern</span> <span class="keywordtype">bool</span> __attribute__((overloadable))
+<a name="l00048"></a>00048     <a class="code" href="rs__core_8rsh.html#a91cfbca99f87ef144bea2cdf1e8473ca">rsSendToClient</a>(<span class="keywordtype">int</span> cmdID);
+<a name="l00052"></a>00052 extern <span class="keywordtype">bool</span> __attribute__((overloadable))
+<a name="l00053"></a>00053     <a class="code" href="rs__core_8rsh.html#a91cfbca99f87ef144bea2cdf1e8473ca">rsSendToClient</a>(<span class="keywordtype">int</span> cmdID, const <span class="keywordtype">void</span> *data, <a class="code" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> len);
+<a name="l00058"></a>00058 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00059"></a>00059     <a class="code" href="rs__core_8rsh.html#a6e4ff6388e8c6978ed17447214f2a2e2">rsSendToClientBlocking</a>(<span class="keywordtype">int</span> cmdID);
+<a name="l00063"></a>00063 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00064"></a>00064     <a class="code" href="rs__core_8rsh.html#a6e4ff6388e8c6978ed17447214f2a2e2">rsSendToClientBlocking</a>(<span class="keywordtype">int</span> cmdID, const <span class="keywordtype">void</span> *data, <a class="code" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> len);
+<a name="l00065"></a>00065 
+<a name="l00066"></a>00066 
+<a name="l00074"></a><a class="code" href="rs__core_8rsh.html#ae1755c901e8acb42510ad10b4e104746">00074</a> enum <a class="code" href="rs__core_8rsh.html#ae1755c901e8acb42510ad10b4e104746">rs_for_each_strategy</a> {
+<a name="l00075"></a>00075     RS_FOR_EACH_STRATEGY_SERIAL,
+<a name="l00076"></a>00076     RS_FOR_EACH_STRATEGY_DONT_CARE,
+<a name="l00077"></a>00077     RS_FOR_EACH_STRATEGY_DST_LINEAR,
+<a name="l00078"></a>00078     RS_FOR_EACH_STRATEGY_TILE_SMALL,
+<a name="l00079"></a>00079     RS_FOR_EACH_STRATEGY_TILE_MEDIUM,
+<a name="l00080"></a>00080     RS_FOR_EACH_STRATEGY_TILE_LARGE
+<a name="l00081"></a>00081 };
+<a name="l00082"></a>00082 
+<a name="l00083"></a>00083 
+<a name="l00088"></a><a class="code" href="structrs__script__call.html">00088</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structrs__script__call.html">rs_script_call</a> {
+<a name="l00089"></a>00089     <span class="keyword">enum</span> <a class="code" href="rs__core_8rsh.html#ae1755c901e8acb42510ad10b4e104746">rs_for_each_strategy</a> strategy;
+<a name="l00090"></a>00090     <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> xStart;
+<a name="l00091"></a>00091     <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> xEnd;
+<a name="l00092"></a>00092     <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> yStart;
+<a name="l00093"></a>00093     <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> yEnd;
+<a name="l00094"></a>00094     <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> zStart;
+<a name="l00095"></a>00095     <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> zEnd;
+<a name="l00096"></a>00096     <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> arrayStart;
+<a name="l00097"></a>00097     <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> arrayEnd;
+<a name="l00098"></a>00098 } <a class="code" href="rs__core_8rsh.html#ae8756b32e23445f287960b9d0ffb449c">rs_script_call_t</a>;
+<a name="l00099"></a>00099 
+<a name="l00116"></a>00116 <span class="preprocessor">#if !defined(RS_VERSION) || (RS_VERSION &lt; 14)</span>
+<a name="l00117"></a>00117 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00118"></a>00118     <a class="code" href="rs__core_8rsh.html#a95ebbf7a8923193df144649c066daae6">rsForEach</a>(<a class="code" href="structrs__script.html" title="Opaque handle to a Renderscript script object.">rs_script</a> script, <a class="code" href="structrs__allocation.html" title="Opaque handle to a Renderscript allocation.">rs_allocation</a> input,
+<a name="l00119"></a>00119               <a class="code" href="structrs__allocation.html" title="Opaque handle to a Renderscript allocation.">rs_allocation</a> output, const <span class="keywordtype">void</span> * usrData,
+<a name="l00120"></a>00120               const <a class="code" href="structrs__script__call.html">rs_script_call_t</a> *sc);
+<a name="l00124"></a>00124 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00125"></a>00125     <a class="code" href="rs__core_8rsh.html#a95ebbf7a8923193df144649c066daae6">rsForEach</a>(<a class="code" href="structrs__script.html" title="Opaque handle to a Renderscript script object.">rs_script</a> script, <a class="code" href="structrs__allocation.html" title="Opaque handle to a Renderscript allocation.">rs_allocation</a> input,
+<a name="l00126"></a>00126               <a class="code" href="structrs__allocation.html" title="Opaque handle to a Renderscript allocation.">rs_allocation</a> output, const <span class="keywordtype">void</span> * usrData);
+<a name="l00127"></a>00127 <span class="preprocessor">#else</span>
+<a name="l00128"></a>00128 <span class="preprocessor"></span>
+<a name="l00147"></a>00147 <span class="keyword">extern</span> <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00148"></a>00148     <a class="code" href="rs__core_8rsh.html#a95ebbf7a8923193df144649c066daae6">rsForEach</a>(<a class="code" href="structrs__script.html" title="Opaque handle to a Renderscript script object.">rs_script</a> script, <a class="code" href="structrs__allocation.html" title="Opaque handle to a Renderscript allocation.">rs_allocation</a> input, <a class="code" href="structrs__allocation.html" title="Opaque handle to a Renderscript allocation.">rs_allocation</a> output,
+<a name="l00149"></a>00149               const <span class="keywordtype">void</span> * usrData, <span class="keywordtype">size_t</span> usrDataLen, const <a class="code" href="structrs__script__call.html">rs_script_call_t</a> *);
+<a name="l00153"></a>00153 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00154"></a>00154     <a class="code" href="rs__core_8rsh.html#a95ebbf7a8923193df144649c066daae6">rsForEach</a>(<a class="code" href="structrs__script.html" title="Opaque handle to a Renderscript script object.">rs_script</a> script, <a class="code" href="structrs__allocation.html" title="Opaque handle to a Renderscript allocation.">rs_allocation</a> input, <a class="code" href="structrs__allocation.html" title="Opaque handle to a Renderscript allocation.">rs_allocation</a> output,
+<a name="l00155"></a>00155               const <span class="keywordtype">void</span> * usrData, <span class="keywordtype">size_t</span> usrDataLen);
+<a name="l00159"></a>00159 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00160"></a>00160     <a class="code" href="rs__core_8rsh.html#a95ebbf7a8923193df144649c066daae6">rsForEach</a>(<a class="code" href="structrs__script.html" title="Opaque handle to a Renderscript script object.">rs_script</a> script, <a class="code" href="structrs__allocation.html" title="Opaque handle to a Renderscript allocation.">rs_allocation</a> input, <a class="code" href="structrs__allocation.html" title="Opaque handle to a Renderscript allocation.">rs_allocation</a> output);
+<a name="l00161"></a>00161 <span class="preprocessor">#endif</span>
+<a name="l00162"></a>00162 <span class="preprocessor"></span>
+<a name="l00163"></a>00163 
+<a name="l00164"></a>00164 
+<a name="l00165"></a>00165 <span class="preprocessor">#undef _RS_RUNTIME</span>
+<a name="l00166"></a>00166 <span class="preprocessor"></span>
+<a name="l00167"></a>00167 <span class="preprocessor">#endif</span>
+</pre></div></div>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/rs__debug_8rsh.html b/docs/html/reference/renderscript/rs__debug_8rsh.html
new file mode 100644
index 0000000..75ce9db
--- /dev/null
+++ b/docs/html/reference/renderscript/rs__debug_8rsh.html
@@ -0,0 +1,459 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_debug.rsh File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="summary">
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_debug.rsh File Reference</div>  </div>
+</div>
+<div class="contents">
+<table class="memberdecls">
+<tr><td colspan="2"><h2><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__debug_8rsh.html#a9a86fd617111dee78b3179a293afb66c">rsDebug</a> (const char *, float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__debug_8rsh.html#aebd4d3e687a397db1a817ca6d46aed29">rsDebug</a> (const char *, float, float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__debug_8rsh.html#ab1731408774f01186aff59b89c47fe32">rsDebug</a> (const char *, float, float, float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__debug_8rsh.html#a6bb20c16c9fcc613158ca8c6f0dd81bd">rsDebug</a> (const char *, float, float, float, float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__debug_8rsh.html#a0a59285be7204bde7b199c77578b6a42">rsDebug</a> (const char *, double)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__debug_8rsh.html#a47b07360e1df6885b3f2eb207408db2c">rsDebug</a> (const char *, const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__debug_8rsh.html#aee885d367bb22f5c437dec486eafb75c">rsDebug</a> (const char *, const <a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__debug_8rsh.html#ac611c53b945b0ced90fde98e3846be79">rsDebug</a> (const char *, const <a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__debug_8rsh.html#ad8f8901db11563ddd7d655fed025047f">rsDebug</a> (const char *, int)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__debug_8rsh.html#a490b0f6af3cc2e0280e97f2d2c2da228">rsDebug</a> (const char *, <a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__debug_8rsh.html#aa75aa9faf7646ceeafeb19279416e9e8">rsDebug</a> (const char *, long)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__debug_8rsh.html#aa371f42b8d323a1a20d56461011fc664">rsDebug</a> (const char *, unsigned long)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__debug_8rsh.html#ab5a58069a9d914e413f52b0f9bd62a00">rsDebug</a> (const char *, const void *)</td></tr>
+</table>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>Utility debugging routines. </p>
+<p>Routines intended to be used during application developement. These should not be used in shipping applications. All print a string and value pair to the standard log. </p>
+
+<p>Definition in file <a class="el" href="rs__debug_8rsh_source.html">rs_debug.rsh</a>.</p>
+</div><hr/><h2>Function Documentation</h2>
+<a class="anchor" id="a9a86fd617111dee78b3179a293afb66c"></a><!-- doxytag: member="rs_debug.rsh::rsDebug" ref="a9a86fd617111dee78b3179a293afb66c" args="(const char *, float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME void rsDebug </td>
+          <td>(</td>
+          <td class="paramtype">const char *&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname">&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Debug function. Prints a string and value to the log. </p>
+
+</div>
+</div>
+<a class="anchor" id="aebd4d3e687a397db1a817ca6d46aed29"></a><!-- doxytag: member="rs_debug.rsh::rsDebug" ref="aebd4d3e687a397db1a817ca6d46aed29" args="(const char *, float, float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsDebug </td>
+          <td>(</td>
+          <td class="paramtype">const char *&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname">&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Debug function. Prints a string and value to the log. </p>
+
+</div>
+</div>
+<a class="anchor" id="ab1731408774f01186aff59b89c47fe32"></a><!-- doxytag: member="rs_debug.rsh::rsDebug" ref="ab1731408774f01186aff59b89c47fe32" args="(const char *, float, float, float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsDebug </td>
+          <td>(</td>
+          <td class="paramtype">const char *&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname">&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Debug function. Prints a string and value to the log. </p>
+
+</div>
+</div>
+<a class="anchor" id="a6bb20c16c9fcc613158ca8c6f0dd81bd"></a><!-- doxytag: member="rs_debug.rsh::rsDebug" ref="a6bb20c16c9fcc613158ca8c6f0dd81bd" args="(const char *, float, float, float, float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsDebug </td>
+          <td>(</td>
+          <td class="paramtype">const char *&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname">&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Debug function. Prints a string and value to the log. </p>
+
+</div>
+</div>
+<a class="anchor" id="a0a59285be7204bde7b199c77578b6a42"></a><!-- doxytag: member="rs_debug.rsh::rsDebug" ref="a0a59285be7204bde7b199c77578b6a42" args="(const char *, double)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsDebug </td>
+          <td>(</td>
+          <td class="paramtype">const char *&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">double&#160;</td>
+          <td class="paramname">&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Debug function. Prints a string and value to the log. </p>
+
+</div>
+</div>
+<a class="anchor" id="a47b07360e1df6885b3f2eb207408db2c"></a><!-- doxytag: member="rs_debug.rsh::rsDebug" ref="a47b07360e1df6885b3f2eb207408db2c" args="(const char *, const rs_matrix4x4 *)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsDebug </td>
+          <td>(</td>
+          <td class="paramtype">const char *&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname">&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Debug function. Prints a string and value to the log. </p>
+
+</div>
+</div>
+<a class="anchor" id="aee885d367bb22f5c437dec486eafb75c"></a><!-- doxytag: member="rs_debug.rsh::rsDebug" ref="aee885d367bb22f5c437dec486eafb75c" args="(const char *, const rs_matrix3x3 *)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsDebug </td>
+          <td>(</td>
+          <td class="paramtype">const char *&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *&#160;</td>
+          <td class="paramname">&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Debug function. Prints a string and value to the log. </p>
+
+</div>
+</div>
+<a class="anchor" id="ac611c53b945b0ced90fde98e3846be79"></a><!-- doxytag: member="rs_debug.rsh::rsDebug" ref="ac611c53b945b0ced90fde98e3846be79" args="(const char *, const rs_matrix2x2 *)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsDebug </td>
+          <td>(</td>
+          <td class="paramtype">const char *&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *&#160;</td>
+          <td class="paramname">&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Debug function. Prints a string and value to the log. </p>
+
+</div>
+</div>
+<a class="anchor" id="ad8f8901db11563ddd7d655fed025047f"></a><!-- doxytag: member="rs_debug.rsh::rsDebug" ref="ad8f8901db11563ddd7d655fed025047f" args="(const char *, int)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsDebug </td>
+          <td>(</td>
+          <td class="paramtype">const char *&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int&#160;</td>
+          <td class="paramname">&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Debug function. Prints a string and value to the log. </p>
+
+</div>
+</div>
+<a class="anchor" id="a490b0f6af3cc2e0280e97f2d2c2da228"></a><!-- doxytag: member="rs_debug.rsh::rsDebug" ref="a490b0f6af3cc2e0280e97f2d2c2da228" args="(const char *, uint)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsDebug </td>
+          <td>(</td>
+          <td class="paramtype">const char *&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>&#160;</td>
+          <td class="paramname">&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Debug function. Prints a string and value to the log. </p>
+
+</div>
+</div>
+<a class="anchor" id="aa75aa9faf7646ceeafeb19279416e9e8"></a><!-- doxytag: member="rs_debug.rsh::rsDebug" ref="aa75aa9faf7646ceeafeb19279416e9e8" args="(const char *, long)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsDebug </td>
+          <td>(</td>
+          <td class="paramtype">const char *&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">long&#160;</td>
+          <td class="paramname">&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Debug function. Prints a string and value to the log. </p>
+
+</div>
+</div>
+<a class="anchor" id="aa371f42b8d323a1a20d56461011fc664"></a><!-- doxytag: member="rs_debug.rsh::rsDebug" ref="aa371f42b8d323a1a20d56461011fc664" args="(const char *, unsigned long)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsDebug </td>
+          <td>(</td>
+          <td class="paramtype">const char *&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">unsigned&#160;</td>
+          <td class="paramname"><em>long</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Debug function. Prints a string and value to the log. </p>
+
+</div>
+</div>
+<a class="anchor" id="ab5a58069a9d914e413f52b0f9bd62a00"></a><!-- doxytag: member="rs_debug.rsh::rsDebug" ref="ab5a58069a9d914e413f52b0f9bd62a00" args="(const char *, const void *)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsDebug </td>
+          <td>(</td>
+          <td class="paramtype">const char *&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const void *&#160;</td>
+          <td class="paramname">&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Debug function. Prints a string and value to the log. </p>
+
+</div>
+</div>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/rs__debug_8rsh_source.html b/docs/html/reference/renderscript/rs__debug_8rsh_source.html
new file mode 100644
index 0000000..b06e99c
--- /dev/null
+++ b/docs/html/reference/renderscript/rs__debug_8rsh_source.html
@@ -0,0 +1,94 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_debug.rsh Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_debug.rsh</div>  </div>
+</div>
+<div class="contents">
+<a href="rs__debug_8rsh.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
+<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2011 The Android Open Source Project</span>
+<a name="l00003"></a>00003 <span class="comment"> *</span>
+<a name="l00004"></a>00004 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span>
+<a name="l00005"></a>00005 <span class="comment"> * you may not use this file except in compliance with the License.</span>
+<a name="l00006"></a>00006 <span class="comment"> * You may obtain a copy of the License at</span>
+<a name="l00007"></a>00007 <span class="comment"> *</span>
+<a name="l00008"></a>00008 <span class="comment"> *      http://www.apache.org/licenses/LICENSE-2.0</span>
+<a name="l00009"></a>00009 <span class="comment"> *</span>
+<a name="l00010"></a>00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
+<a name="l00011"></a>00011 <span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span>
+<a name="l00012"></a>00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
+<a name="l00013"></a>00013 <span class="comment"> * See the License for the specific language governing permissions and</span>
+<a name="l00014"></a>00014 <span class="comment"> * limitations under the License.</span>
+<a name="l00015"></a>00015 <span class="comment"> */</span>
+<a name="l00016"></a>00016 
+<a name="l00026"></a>00026 <span class="preprocessor">#ifndef __RS_DEBUG_RSH__</span>
+<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#define __RS_DEBUG_RSH__</span>
+<a name="l00028"></a>00028 <span class="preprocessor"></span>
+<a name="l00029"></a>00029 
+<a name="l00030"></a>00030 
+<a name="l00034"></a>00034 <span class="keyword">extern</span> <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00035"></a>00035     <a class="code" href="rs__debug_8rsh.html#a9a86fd617111dee78b3179a293afb66c">rsDebug</a>(const <span class="keywordtype">char</span> *, <span class="keywordtype">float</span>);
+<a name="l00039"></a>00039 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00040"></a>00040     <a class="code" href="rs__debug_8rsh.html#a9a86fd617111dee78b3179a293afb66c">rsDebug</a>(const <span class="keywordtype">char</span> *, <span class="keywordtype">float</span>, <span class="keywordtype">float</span>);
+<a name="l00044"></a>00044 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00045"></a>00045     <a class="code" href="rs__debug_8rsh.html#a9a86fd617111dee78b3179a293afb66c">rsDebug</a>(const <span class="keywordtype">char</span> *, <span class="keywordtype">float</span>, <span class="keywordtype">float</span>, <span class="keywordtype">float</span>);
+<a name="l00049"></a>00049 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00050"></a>00050     <a class="code" href="rs__debug_8rsh.html#a9a86fd617111dee78b3179a293afb66c">rsDebug</a>(const <span class="keywordtype">char</span> *, <span class="keywordtype">float</span>, <span class="keywordtype">float</span>, <span class="keywordtype">float</span>, <span class="keywordtype">float</span>);
+<a name="l00054"></a>00054 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00055"></a>00055     <a class="code" href="rs__debug_8rsh.html#a9a86fd617111dee78b3179a293afb66c">rsDebug</a>(const <span class="keywordtype">char</span> *, <span class="keywordtype">double</span>);
+<a name="l00059"></a>00059 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00060"></a>00060     <a class="code" href="rs__debug_8rsh.html#a9a86fd617111dee78b3179a293afb66c">rsDebug</a>(const <span class="keywordtype">char</span> *, const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *);
+<a name="l00064"></a>00064 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00065"></a>00065     <a class="code" href="rs__debug_8rsh.html#a9a86fd617111dee78b3179a293afb66c">rsDebug</a>(const <span class="keywordtype">char</span> *, const <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *);
+<a name="l00069"></a>00069 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00070"></a>00070     <a class="code" href="rs__debug_8rsh.html#a9a86fd617111dee78b3179a293afb66c">rsDebug</a>(const <span class="keywordtype">char</span> *, const <a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *);
+<a name="l00074"></a>00074 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00075"></a>00075     <a class="code" href="rs__debug_8rsh.html#a9a86fd617111dee78b3179a293afb66c">rsDebug</a>(const <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>);
+<a name="l00079"></a>00079 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00080"></a>00080     <a class="code" href="rs__debug_8rsh.html#a9a86fd617111dee78b3179a293afb66c">rsDebug</a>(const <span class="keywordtype">char</span> *, <a class="code" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>);
+<a name="l00084"></a>00084 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00085"></a>00085     <a class="code" href="rs__debug_8rsh.html#a9a86fd617111dee78b3179a293afb66c">rsDebug</a>(const <span class="keywordtype">char</span> *, <span class="keywordtype">long</span>);
+<a name="l00089"></a>00089 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00090"></a>00090     <a class="code" href="rs__debug_8rsh.html#a9a86fd617111dee78b3179a293afb66c">rsDebug</a>(const <span class="keywordtype">char</span> *, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>);
+<a name="l00094"></a>00094 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00095"></a>00095     <a class="code" href="rs__debug_8rsh.html#a9a86fd617111dee78b3179a293afb66c">rsDebug</a>(const <span class="keywordtype">char</span> *, <span class="keywordtype">long</span> <span class="keywordtype">long</span>);
+<a name="l00099"></a>00099 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00100"></a>00100     <a class="code" href="rs__debug_8rsh.html#a9a86fd617111dee78b3179a293afb66c">rsDebug</a>(const <span class="keywordtype">char</span> *, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <span class="keywordtype">long</span>);
+<a name="l00104"></a>00104 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00105"></a>00105     <a class="code" href="rs__debug_8rsh.html#a9a86fd617111dee78b3179a293afb66c">rsDebug</a>(const <span class="keywordtype">char</span> *, const <span class="keywordtype">void</span> *);
+<a name="l00106"></a>00106 <span class="preprocessor">#define RS_DEBUG(a) rsDebug(#a, a)</span>
+<a name="l00107"></a>00107 <span class="preprocessor"></span><span class="preprocessor">#define RS_DEBUG_MARKER rsDebug(__FILE__, __LINE__)</span>
+<a name="l00108"></a>00108 <span class="preprocessor"></span>
+<a name="l00109"></a>00109 
+<a name="l00113"></a>00113 _RS_RUNTIME <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__debug_8rsh.html#a9a86fd617111dee78b3179a293afb66c">rsDebug</a>(const <span class="keywordtype">char</span> *s, <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> v);
+<a name="l00117"></a>00117 _RS_RUNTIME <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__debug_8rsh.html#a9a86fd617111dee78b3179a293afb66c">rsDebug</a>(const <span class="keywordtype">char</span> *s, <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> v);
+<a name="l00121"></a>00121 _RS_RUNTIME <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__debug_8rsh.html#a9a86fd617111dee78b3179a293afb66c">rsDebug</a>(const <span class="keywordtype">char</span> *s, <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> v);
+<a name="l00122"></a>00122 
+<a name="l00123"></a>00123 <span class="preprocessor">#endif</span>
+</pre></div></div>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/rs__graphics_8rsh.html b/docs/html/reference/renderscript/rs__graphics_8rsh.html
new file mode 100644
index 0000000..8a17b30
--- /dev/null
+++ b/docs/html/reference/renderscript/rs__graphics_8rsh.html
@@ -0,0 +1,1347 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_graphics.rsh File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="summary">
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_graphics.rsh File Reference</div>  </div>
+</div>
+<div class="contents">
+<table class="memberdecls">
+<tr><td colspan="2"><h2><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#a9f8deb600729a83c39c5bcaba2152b9c">rsgBindProgramFragment</a> (<a class="el" href="structrs__program__fragment.html">rs_program_fragment</a> pf)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#a34dfa6eddd7454fc1865222c5a022315">rsgBindProgramStore</a> (<a class="el" href="structrs__program__store.html">rs_program_store</a> ps)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#a894e26d0d05d3ef99be65ddf98dd901c">rsgBindProgramVertex</a> (<a class="el" href="structrs__program__vertex.html">rs_program_vertex</a> pv)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#a391eb5535544f6312c724b910da6ec35">rsgBindProgramRaster</a> (<a class="el" href="structrs__program__raster.html">rs_program_raster</a> pr)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#a4ade6c5acbf6acaa1c29a1aecc6e87d3">rsgBindSampler</a> (<a class="el" href="structrs__program__fragment.html">rs_program_fragment</a>, <a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> slot, <a class="el" href="structrs__sampler.html">rs_sampler</a>)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#a1694eb5489bd3a444da921dbf16aeeb5">rsgBindTexture</a> (<a class="el" href="structrs__program__fragment.html">rs_program_fragment</a>, <a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> slot, <a class="el" href="structrs__allocation.html">rs_allocation</a>)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#a83a87d8efa3f26ed3f8fb25e49f29059">rsgProgramVertexLoadProjectionMatrix</a> (const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *proj)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#a976b8594cccb4b94d7ce520b44d884e3">rsgProgramVertexLoadModelMatrix</a> (const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *model)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#a377b7b394c4bf0881532b1241d4be168">rsgProgramVertexLoadTextureMatrix</a> (const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *tex)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#a2b767d209b36ffcd2e0fc0cf6f4c5706">rsgProgramVertexGetProjectionMatrix</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *proj)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#a35ac8c3759e25047e6a458c15520c887">rsgProgramFragmentConstantColor</a> (<a class="el" href="structrs__program__fragment.html">rs_program_fragment</a> pf, float r, float g, float b, float a)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#a67f4ed1ca4bba27d5c952ada89cd0717">rsgGetWidth</a> (void)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#a7e6565cd5d5e44f442a8bf8ba68f4681">rsgGetHeight</a> (void)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#a647228d8e15da6ad67a97701d920dcac">rsgAllocationSyncAll</a> (<a class="el" href="structrs__allocation.html">rs_allocation</a> alloc)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#a80c51849bf12ec6c699c23c3fa3e6208">rsgDrawRect</a> (float x1, float y1, float x2, float y2, float z)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#ad6953da0349e58547b08b8ce174ed3fc">rsgDrawQuad</a> (float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#afb98a59bb9f878f0a09459567c269e64">rsgDrawQuadTexCoords</a> (float x1, float y1, float z1, float u1, float v1, float x2, float y2, float z2, float u2, float v2, float x3, float y3, float z3, float u3, float v3, float x4, float y4, float z4, float u4, float v4)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#a07d15127330fa1dff6c99b0d7d14e65e">rsgDrawSpriteScreenspace</a> (float x, float y, float z, float w, float h)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#a6f8b87c994810908fbe5e01f8f63f9af">rsgDrawMesh</a> (<a class="el" href="structrs__mesh.html">rs_mesh</a> ism)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#a621abfc693fed028b5dc74826453142d">rsgDrawMesh</a> (<a class="el" href="structrs__mesh.html">rs_mesh</a> ism, <a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> primitiveIndex)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#ab2704a6d16e3d7983524d0a8413c1b8a">rsgDrawMesh</a> (<a class="el" href="structrs__mesh.html">rs_mesh</a> ism, <a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> primitiveIndex, <a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> start, <a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> len)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#a147674fed92745fbb5c64a6300ca3c49">rsgClearColor</a> (float r, float g, float b, float a)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#a4bedb06e8facd587e3eacd746fe3e727">rsgClearDepth</a> (float value)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#afaec82492762e62cad1ff53ada479b14">rsgDrawText</a> (const char *, int x, int y)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#ac5e84fd253b4b1d2b0e11a7a0a7df945">rsgDrawText</a> (<a class="el" href="structrs__allocation.html">rs_allocation</a>, int x, int y)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#ae89effef281e92e2940055883ea366d4">rsgBindFont</a> (<a class="el" href="structrs__font.html">rs_font</a> font)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#abda8c344092ed6310c7a8f353a6df876">rsgFontColor</a> (float r, float g, float b, float a)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#a5c599f4ea989f3d0616cbf8e983688c4">rsgMeasureText</a> (const char *, int *left, int *right, int *top, int *bottom)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#a2abb920283b1dafa9059de488143a870">rsgMeasureText</a> (<a class="el" href="structrs__allocation.html">rs_allocation</a>, int *left, int *right, int *top, int *bottom)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#a0978c54902dd1d60180f8dbb0b781105">rsgMeshComputeBoundingBox</a> (<a class="el" href="structrs__mesh.html">rs_mesh</a> mesh, float *minX, float *minY, float *minZ, float *maxX, float *maxY, float *maxZ)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">static __inline__ void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__graphics_8rsh.html#a6058b6b6c8b94f96f03dc8bca6a2090b">rsgMeshComputeBoundingBox</a> (<a class="el" href="structrs__mesh.html">rs_mesh</a> mesh, <a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> *bBoxMin, <a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> *bBoxMax)</td></tr>
+</table>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>Renderscript graphics API. </p>
+<p>A set of graphics functions used by Renderscript. </p>
+
+<p>Definition in file <a class="el" href="rs__graphics_8rsh_source.html">rs_graphics.rsh</a>.</p>
+</div><hr/><h2>Function Documentation</h2>
+<a class="anchor" id="a647228d8e15da6ad67a97701d920dcac"></a><!-- doxytag: member="rs_graphics.rsh::rsgAllocationSyncAll" ref="a647228d8e15da6ad67a97701d920dcac" args="(rs_allocation alloc)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgAllocationSyncAll </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__allocation.html">rs_allocation</a>&#160;</td>
+          <td class="paramname"><em>alloc</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Sync the contents of an allocation from its SCRIPT memory space to its HW memory spaces.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">alloc</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ae89effef281e92e2940055883ea366d4"></a><!-- doxytag: member="rs_graphics.rsh::rsgBindFont" ref="ae89effef281e92e2940055883ea366d4" args="(rs_font font)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgBindFont </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__font.html">rs_font</a>&#160;</td>
+          <td class="paramname"><em>font</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Binds the font object to be used for all subsequent font rendering calls </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">font</td><td>object to bind </td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a9f8deb600729a83c39c5bcaba2152b9c"></a><!-- doxytag: member="rs_graphics.rsh::rsgBindProgramFragment" ref="a9f8deb600729a83c39c5bcaba2152b9c" args="(rs_program_fragment pf)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgBindProgramFragment </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__program__fragment.html">rs_program_fragment</a>&#160;</td>
+          <td class="paramname"><em>pf</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Bind a new ProgramFragment to the rendering context.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">pf</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a391eb5535544f6312c724b910da6ec35"></a><!-- doxytag: member="rs_graphics.rsh::rsgBindProgramRaster" ref="a391eb5535544f6312c724b910da6ec35" args="(rs_program_raster pr)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgBindProgramRaster </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__program__raster.html">rs_program_raster</a>&#160;</td>
+          <td class="paramname"><em>pr</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Bind a new ProgramRaster to the rendering context.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">pr</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a34dfa6eddd7454fc1865222c5a022315"></a><!-- doxytag: member="rs_graphics.rsh::rsgBindProgramStore" ref="a34dfa6eddd7454fc1865222c5a022315" args="(rs_program_store ps)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgBindProgramStore </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__program__store.html">rs_program_store</a>&#160;</td>
+          <td class="paramname"><em>ps</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Bind a new ProgramStore to the rendering context.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">ps</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a894e26d0d05d3ef99be65ddf98dd901c"></a><!-- doxytag: member="rs_graphics.rsh::rsgBindProgramVertex" ref="a894e26d0d05d3ef99be65ddf98dd901c" args="(rs_program_vertex pv)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgBindProgramVertex </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__program__vertex.html">rs_program_vertex</a>&#160;</td>
+          <td class="paramname"><em>pv</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Bind a new ProgramVertex to the rendering context.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">pv</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a4ade6c5acbf6acaa1c29a1aecc6e87d3"></a><!-- doxytag: member="rs_graphics.rsh::rsgBindSampler" ref="a4ade6c5acbf6acaa1c29a1aecc6e87d3" args="(rs_program_fragment, uint slot, rs_sampler)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgBindSampler </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__program__fragment.html">rs_program_fragment</a>&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>&#160;</td>
+          <td class="paramname"><em>slot</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="structrs__sampler.html">rs_sampler</a>&#160;</td>
+          <td class="paramname">&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Bind a new Sampler object to a ProgramFragment. The sampler will operate on the texture bound at the matching slot.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">slot</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a1694eb5489bd3a444da921dbf16aeeb5"></a><!-- doxytag: member="rs_graphics.rsh::rsgBindTexture" ref="a1694eb5489bd3a444da921dbf16aeeb5" args="(rs_program_fragment, uint slot, rs_allocation)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgBindTexture </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__program__fragment.html">rs_program_fragment</a>&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>&#160;</td>
+          <td class="paramname"><em>slot</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="structrs__allocation.html">rs_allocation</a>&#160;</td>
+          <td class="paramname">&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Bind a new Allocation object to a ProgramFragment. The Allocation must be a valid texture for the Program. The sampling of the texture will be controled by the Sampler bound at the matching slot.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">slot</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a147674fed92745fbb5c64a6300ca3c49"></a><!-- doxytag: member="rs_graphics.rsh::rsgClearColor" ref="a147674fed92745fbb5c64a6300ca3c49" args="(float r, float g, float b, float a)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgClearColor </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>r</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>g</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>b</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>a</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Clears the rendering surface to the specified color.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">r</td><td></td></tr>
+    <tr><td class="paramname">g</td><td></td></tr>
+    <tr><td class="paramname">b</td><td></td></tr>
+    <tr><td class="paramname">a</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a4bedb06e8facd587e3eacd746fe3e727"></a><!-- doxytag: member="rs_graphics.rsh::rsgClearDepth" ref="a4bedb06e8facd587e3eacd746fe3e727" args="(float value)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgClearDepth </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>value</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Clears the depth suface to the specified value. </p>
+
+</div>
+</div>
+<a class="anchor" id="a6f8b87c994810908fbe5e01f8f63f9af"></a><!-- doxytag: member="rs_graphics.rsh::rsgDrawMesh" ref="a6f8b87c994810908fbe5e01f8f63f9af" args="(rs_mesh ism)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgDrawMesh </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__mesh.html">rs_mesh</a>&#160;</td>
+          <td class="paramname"><em>ism</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Draw a mesh using the current context state. The whole mesh is rendered.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">ism</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a621abfc693fed028b5dc74826453142d"></a><!-- doxytag: member="rs_graphics.rsh::rsgDrawMesh" ref="a621abfc693fed028b5dc74826453142d" args="(rs_mesh ism, uint primitiveIndex)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgDrawMesh </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__mesh.html">rs_mesh</a>&#160;</td>
+          <td class="paramname"><em>ism</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>&#160;</td>
+          <td class="paramname"><em>primitiveIndex</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Draw part of a mesh using the current context state. </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">ism</td><td>mesh object to render </td></tr>
+    <tr><td class="paramname">primitiveIndex</td><td>for meshes that contain multiple primitive groups this parameter specifies the index of the group to draw. </td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ab2704a6d16e3d7983524d0a8413c1b8a"></a><!-- doxytag: member="rs_graphics.rsh::rsgDrawMesh" ref="ab2704a6d16e3d7983524d0a8413c1b8a" args="(rs_mesh ism, uint primitiveIndex, uint start, uint len)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgDrawMesh </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__mesh.html">rs_mesh</a>&#160;</td>
+          <td class="paramname"><em>ism</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>&#160;</td>
+          <td class="paramname"><em>primitiveIndex</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>&#160;</td>
+          <td class="paramname"><em>start</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>&#160;</td>
+          <td class="paramname"><em>len</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Draw specified index range of part of a mesh using the current context state. </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">ism</td><td>mesh object to render </td></tr>
+    <tr><td class="paramname">primitiveIndex</td><td>for meshes that contain multiple primitive groups this parameter specifies the index of the group to draw. </td></tr>
+    <tr><td class="paramname">start</td><td>starting index in the range </td></tr>
+    <tr><td class="paramname">len</td><td>number of indices to draw </td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ad6953da0349e58547b08b8ce174ed3fc"></a><!-- doxytag: member="rs_graphics.rsh::rsgDrawQuad" ref="ad6953da0349e58547b08b8ce174ed3fc" args="(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgDrawQuad </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x1</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y1</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>z1</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x2</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y2</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>z2</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x3</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y3</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>z3</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x4</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y4</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>z4</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Low performance utility function for drawing a simple quad. Not intended for drawing large quantities of geometry.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">x1</td><td></td></tr>
+    <tr><td class="paramname">y1</td><td></td></tr>
+    <tr><td class="paramname">z1</td><td></td></tr>
+    <tr><td class="paramname">x2</td><td></td></tr>
+    <tr><td class="paramname">y2</td><td></td></tr>
+    <tr><td class="paramname">z2</td><td></td></tr>
+    <tr><td class="paramname">x3</td><td></td></tr>
+    <tr><td class="paramname">y3</td><td></td></tr>
+    <tr><td class="paramname">z3</td><td></td></tr>
+    <tr><td class="paramname">x4</td><td></td></tr>
+    <tr><td class="paramname">y4</td><td></td></tr>
+    <tr><td class="paramname">z4</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="afb98a59bb9f878f0a09459567c269e64"></a><!-- doxytag: member="rs_graphics.rsh::rsgDrawQuadTexCoords" ref="afb98a59bb9f878f0a09459567c269e64" args="(float x1, float y1, float z1, float u1, float v1, float x2, float y2, float z2, float u2, float v2, float x3, float y3, float z3, float u3, float v3, float x4, float y4, float z4, float u4, float v4)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgDrawQuadTexCoords </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x1</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y1</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>z1</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>u1</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v1</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x2</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y2</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>z2</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>u2</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v2</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x3</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y3</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>z3</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>u3</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v3</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x4</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y4</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>z4</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>u4</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v4</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Low performance utility function for drawing a textured quad. Not intended for drawing large quantities of geometry.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">x1</td><td></td></tr>
+    <tr><td class="paramname">y1</td><td></td></tr>
+    <tr><td class="paramname">z1</td><td></td></tr>
+    <tr><td class="paramname">u1</td><td></td></tr>
+    <tr><td class="paramname">v1</td><td></td></tr>
+    <tr><td class="paramname">x2</td><td></td></tr>
+    <tr><td class="paramname">y2</td><td></td></tr>
+    <tr><td class="paramname">z2</td><td></td></tr>
+    <tr><td class="paramname">u2</td><td></td></tr>
+    <tr><td class="paramname">v2</td><td></td></tr>
+    <tr><td class="paramname">x3</td><td></td></tr>
+    <tr><td class="paramname">y3</td><td></td></tr>
+    <tr><td class="paramname">z3</td><td></td></tr>
+    <tr><td class="paramname">u3</td><td></td></tr>
+    <tr><td class="paramname">v3</td><td></td></tr>
+    <tr><td class="paramname">x4</td><td></td></tr>
+    <tr><td class="paramname">y4</td><td></td></tr>
+    <tr><td class="paramname">z4</td><td></td></tr>
+    <tr><td class="paramname">u4</td><td></td></tr>
+    <tr><td class="paramname">v4</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a80c51849bf12ec6c699c23c3fa3e6208"></a><!-- doxytag: member="rs_graphics.rsh::rsgDrawRect" ref="a80c51849bf12ec6c699c23c3fa3e6208" args="(float x1, float y1, float x2, float y2, float z)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgDrawRect </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x1</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y1</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x2</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y2</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>z</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Low performance utility function for drawing a simple rectangle. Not intended for drawing large quantities of geometry.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">x1</td><td></td></tr>
+    <tr><td class="paramname">y1</td><td></td></tr>
+    <tr><td class="paramname">x2</td><td></td></tr>
+    <tr><td class="paramname">y2</td><td></td></tr>
+    <tr><td class="paramname">z</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a07d15127330fa1dff6c99b0d7d14e65e"></a><!-- doxytag: member="rs_graphics.rsh::rsgDrawSpriteScreenspace" ref="a07d15127330fa1dff6c99b0d7d14e65e" args="(float x, float y, float z, float w, float h)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgDrawSpriteScreenspace </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>z</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>w</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>h</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Low performance function for drawing rectangles in screenspace. This function uses the default passthough ProgramVertex. Any bound ProgramVertex is ignored. This function has considerable overhead and should not be used for drawing in shipping applications.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">x</td><td></td></tr>
+    <tr><td class="paramname">y</td><td></td></tr>
+    <tr><td class="paramname">z</td><td></td></tr>
+    <tr><td class="paramname">w</td><td></td></tr>
+    <tr><td class="paramname">h</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="afaec82492762e62cad1ff53ada479b14"></a><!-- doxytag: member="rs_graphics.rsh::rsgDrawText" ref="afaec82492762e62cad1ff53ada479b14" args="(const char *, int x, int y)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgDrawText </td>
+          <td>(</td>
+          <td class="paramtype">const char *&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int&#160;</td>
+          <td class="paramname"><em>x</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int&#160;</td>
+          <td class="paramname"><em>y</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Draws text given a string and location </p>
+
+</div>
+</div>
+<a class="anchor" id="ac5e84fd253b4b1d2b0e11a7a0a7df945"></a><!-- doxytag: member="rs_graphics.rsh::rsgDrawText" ref="ac5e84fd253b4b1d2b0e11a7a0a7df945" args="(rs_allocation, int x, int y)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgDrawText </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__allocation.html">rs_allocation</a>&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int&#160;</td>
+          <td class="paramname"><em>x</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int&#160;</td>
+          <td class="paramname"><em>y</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="abda8c344092ed6310c7a8f353a6df876"></a><!-- doxytag: member="rs_graphics.rsh::rsgFontColor" ref="abda8c344092ed6310c7a8f353a6df876" args="(float r, float g, float b, float a)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgFontColor </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>r</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>g</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>b</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>a</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Sets the font color for all subsequent rendering calls </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">r</td><td>red component </td></tr>
+    <tr><td class="paramname">g</td><td>green component </td></tr>
+    <tr><td class="paramname">b</td><td>blue component </td></tr>
+    <tr><td class="paramname">a</td><td>alpha component </td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a7e6565cd5d5e44f442a8bf8ba68f4681"></a><!-- doxytag: member="rs_graphics.rsh::rsgGetHeight" ref="a7e6565cd5d5e44f442a8bf8ba68f4681" args="(void)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> rsgGetHeight </td>
+          <td>(</td>
+          <td class="paramtype">void&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Get the height of the current rendering surface.</p>
+<dl class="return"><dt><b>Returns:</b></dt><dd>uint </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a67f4ed1ca4bba27d5c952ada89cd0717"></a><!-- doxytag: member="rs_graphics.rsh::rsgGetWidth" ref="a67f4ed1ca4bba27d5c952ada89cd0717" args="(void)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> rsgGetWidth </td>
+          <td>(</td>
+          <td class="paramtype">void&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Get the width of the current rendering surface.</p>
+<dl class="return"><dt><b>Returns:</b></dt><dd>uint </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a5c599f4ea989f3d0616cbf8e983688c4"></a><!-- doxytag: member="rs_graphics.rsh::rsgMeasureText" ref="a5c599f4ea989f3d0616cbf8e983688c4" args="(const char *, int *left, int *right, int *top, int *bottom)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgMeasureText </td>
+          <td>(</td>
+          <td class="paramtype">const char *&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int *&#160;</td>
+          <td class="paramname"><em>left</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int *&#160;</td>
+          <td class="paramname"><em>right</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int *&#160;</td>
+          <td class="paramname"><em>top</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int *&#160;</td>
+          <td class="paramname"><em>bottom</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Returns the bounding box of the text relative to (0, 0) Any of left, right, top, bottom could be NULL </p>
+
+</div>
+</div>
+<a class="anchor" id="a2abb920283b1dafa9059de488143a870"></a><!-- doxytag: member="rs_graphics.rsh::rsgMeasureText" ref="a2abb920283b1dafa9059de488143a870" args="(rs_allocation, int *left, int *right, int *top, int *bottom)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgMeasureText </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__allocation.html">rs_allocation</a>&#160;</td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int *&#160;</td>
+          <td class="paramname"><em>left</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int *&#160;</td>
+          <td class="paramname"><em>right</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int *&#160;</td>
+          <td class="paramname"><em>top</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int *&#160;</td>
+          <td class="paramname"><em>bottom</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a0978c54902dd1d60180f8dbb0b781105"></a><!-- doxytag: member="rs_graphics.rsh::rsgMeshComputeBoundingBox" ref="a0978c54902dd1d60180f8dbb0b781105" args="(rs_mesh mesh, float *minX, float *minY, float *minZ, float *maxX, float *maxY, float *maxZ)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgMeshComputeBoundingBox </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__mesh.html">rs_mesh</a>&#160;</td>
+          <td class="paramname"><em>mesh</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float *&#160;</td>
+          <td class="paramname"><em>minX</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float *&#160;</td>
+          <td class="paramname"><em>minY</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float *&#160;</td>
+          <td class="paramname"><em>minZ</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float *&#160;</td>
+          <td class="paramname"><em>maxX</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float *&#160;</td>
+          <td class="paramname"><em>maxY</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float *&#160;</td>
+          <td class="paramname"><em>maxZ</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Computes an axis aligned bounding box of a mesh object </p>
+
+</div>
+</div>
+<a class="anchor" id="a6058b6b6c8b94f96f03dc8bca6a2090b"></a><!-- doxytag: member="rs_graphics.rsh::rsgMeshComputeBoundingBox" ref="a6058b6b6c8b94f96f03dc8bca6a2090b" args="(rs_mesh mesh, float3 *bBoxMin, float3 *bBoxMax)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">static __inline__ void rsgMeshComputeBoundingBox </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__mesh.html">rs_mesh</a>&#160;</td>
+          <td class="paramname"><em>mesh</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> *&#160;</td>
+          <td class="paramname"><em>bBoxMin</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> *&#160;</td>
+          <td class="paramname"><em>bBoxMax</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td><code> [static]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+<p>Definition at line <a class="el" href="rs__graphics_8rsh_source.html#l00380">380</a> of file <a class="el" href="rs__graphics_8rsh_source.html">rs_graphics.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a35ac8c3759e25047e6a458c15520c887"></a><!-- doxytag: member="rs_graphics.rsh::rsgProgramFragmentConstantColor" ref="a35ac8c3759e25047e6a458c15520c887" args="(rs_program_fragment pf, float r, float g, float b, float a)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgProgramFragmentConstantColor </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__program__fragment.html">rs_program_fragment</a>&#160;</td>
+          <td class="paramname"><em>pf</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>r</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>g</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>b</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>a</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Set the constant color for a fixed function emulation program.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">pf</td><td></td></tr>
+    <tr><td class="paramname">r</td><td></td></tr>
+    <tr><td class="paramname">g</td><td></td></tr>
+    <tr><td class="paramname">b</td><td></td></tr>
+    <tr><td class="paramname">a</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a2b767d209b36ffcd2e0fc0cf6f4c5706"></a><!-- doxytag: member="rs_graphics.rsh::rsgProgramVertexGetProjectionMatrix" ref="a2b767d209b36ffcd2e0fc0cf6f4c5706" args="(rs_matrix4x4 *proj)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgProgramVertexGetProjectionMatrix </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>proj</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Get the projection matrix for a currently bound fixed function vertex program. Calling this function with a custom vertex shader would result in an error. </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">proj</td><td>matrix to store the current projection matrix into </td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a976b8594cccb4b94d7ce520b44d884e3"></a><!-- doxytag: member="rs_graphics.rsh::rsgProgramVertexLoadModelMatrix" ref="a976b8594cccb4b94d7ce520b44d884e3" args="(const rs_matrix4x4 *model)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgProgramVertexLoadModelMatrix </td>
+          <td>(</td>
+          <td class="paramtype">const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>model</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Load the model matrix for a currently bound fixed function vertex program. Calling this function with a custom vertex shader would result in an error. </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">model</td><td>model matrix </td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a83a87d8efa3f26ed3f8fb25e49f29059"></a><!-- doxytag: member="rs_graphics.rsh::rsgProgramVertexLoadProjectionMatrix" ref="a83a87d8efa3f26ed3f8fb25e49f29059" args="(const rs_matrix4x4 *proj)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgProgramVertexLoadProjectionMatrix </td>
+          <td>(</td>
+          <td class="paramtype">const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>proj</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Load the projection matrix for a currently bound fixed function vertex program. Calling this function with a custom vertex shader would result in an error. </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">proj</td><td>projection matrix </td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a377b7b394c4bf0881532b1241d4be168"></a><!-- doxytag: member="rs_graphics.rsh::rsgProgramVertexLoadTextureMatrix" ref="a377b7b394c4bf0881532b1241d4be168" args="(const rs_matrix4x4 *tex)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsgProgramVertexLoadTextureMatrix </td>
+          <td>(</td>
+          <td class="paramtype">const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>tex</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Load the texture matrix for a currently bound fixed function vertex program. Calling this function with a custom vertex shader would result in an error. </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">tex</td><td>texture matrix </td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/rs__graphics_8rsh_source.html b/docs/html/reference/renderscript/rs__graphics_8rsh_source.html
new file mode 100644
index 0000000..b9ce0b7
--- /dev/null
+++ b/docs/html/reference/renderscript/rs__graphics_8rsh_source.html
@@ -0,0 +1,183 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_graphics.rsh Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_graphics.rsh</div>  </div>
+</div>
+<div class="contents">
+<a href="rs__graphics_8rsh.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
+<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2011 The Android Open Source Project</span>
+<a name="l00003"></a>00003 <span class="comment"> *</span>
+<a name="l00004"></a>00004 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span>
+<a name="l00005"></a>00005 <span class="comment"> * you may not use this file except in compliance with the License.</span>
+<a name="l00006"></a>00006 <span class="comment"> * You may obtain a copy of the License at</span>
+<a name="l00007"></a>00007 <span class="comment"> *</span>
+<a name="l00008"></a>00008 <span class="comment"> *      http://www.apache.org/licenses/LICENSE-2.0</span>
+<a name="l00009"></a>00009 <span class="comment"> *</span>
+<a name="l00010"></a>00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
+<a name="l00011"></a>00011 <span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span>
+<a name="l00012"></a>00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
+<a name="l00013"></a>00013 <span class="comment"> * See the License for the specific language governing permissions and</span>
+<a name="l00014"></a>00014 <span class="comment"> * limitations under the License.</span>
+<a name="l00015"></a>00015 <span class="comment"> */</span>
+<a name="l00016"></a>00016 
+<a name="l00023"></a>00023 <span class="preprocessor">#ifndef __RS_GRAPHICS_RSH__</span>
+<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define __RS_GRAPHICS_RSH__</span>
+<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#if (defined(RS_VERSION) &amp;&amp; (RS_VERSION &gt;= 14))</span>
+<a name="l00026"></a>00026 <span class="preprocessor"></span>
+<a name="l00031"></a>00031 <span class="keyword">extern</span> <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00032"></a>00032     rsgBindColorTarget(<a class="code" href="structrs__allocation.html" title="Opaque handle to a Renderscript allocation.">rs_allocation</a> colorTarget, <a class="code" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> slot);
+<a name="l00033"></a>00033 
+<a name="l00038"></a>00038 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00039"></a>00039     rsgClearColorTarget(<a class="code" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> slot);
+<a name="l00040"></a>00040 
+<a name="l00045"></a>00045 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00046"></a>00046     rsgBindDepthTarget(<a class="code" href="structrs__allocation.html" title="Opaque handle to a Renderscript allocation.">rs_allocation</a> depthTarget);
+<a name="l00047"></a>00047 
+<a name="l00051"></a>00051 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00052"></a>00052     rsgClearDepthTarget(<span class="keywordtype">void</span>);
+<a name="l00053"></a>00053 
+<a name="l00058"></a>00058 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00059"></a>00059     rsgClearAllRenderTargets(<span class="keywordtype">void</span>);
+<a name="l00060"></a>00060 
+<a name="l00064"></a>00064 extern <a class="code" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> __attribute__((overloadable))
+<a name="l00065"></a>00065     rsgFinish(<span class="keywordtype">void</span>);
+<a name="l00066"></a>00066 
+<a name="l00067"></a>00067 <span class="preprocessor">#endif //defined(RS_VERSION) &amp;&amp; (RS_VERSION &gt;= 14)</span>
+<a name="l00068"></a>00068 <span class="preprocessor"></span>
+<a name="l00074"></a>00074 <span class="keyword">extern</span> <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00075"></a>00075     <a class="code" href="rs__graphics_8rsh.html#a9f8deb600729a83c39c5bcaba2152b9c">rsgBindProgramFragment</a>(<a class="code" href="structrs__program__fragment.html" title="Opaque handle to a Renderscript ProgramFragment object.">rs_program_fragment</a> pf);
+<a name="l00076"></a>00076 
+<a name="l00082"></a>00082 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00083"></a>00083     <a class="code" href="rs__graphics_8rsh.html#a34dfa6eddd7454fc1865222c5a022315">rsgBindProgramStore</a>(<a class="code" href="structrs__program__store.html" title="Opaque handle to a Renderscript ProgramStore object.">rs_program_store</a> ps);
+<a name="l00084"></a>00084 
+<a name="l00090"></a>00090 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00091"></a>00091     <a class="code" href="rs__graphics_8rsh.html#a894e26d0d05d3ef99be65ddf98dd901c">rsgBindProgramVertex</a>(<a class="code" href="structrs__program__vertex.html" title="Opaque handle to a Renderscript ProgramVertex object.">rs_program_vertex</a> pv);
+<a name="l00092"></a>00092 
+<a name="l00098"></a>00098 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00099"></a>00099     <a class="code" href="rs__graphics_8rsh.html#a391eb5535544f6312c724b910da6ec35">rsgBindProgramRaster</a>(<a class="code" href="structrs__program__raster.html" title="Opaque handle to a Renderscript ProgramRaster object.">rs_program_raster</a> pr);
+<a name="l00100"></a>00100 
+<a name="l00107"></a>00107 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00108"></a>00108     <a class="code" href="rs__graphics_8rsh.html#a4ade6c5acbf6acaa1c29a1aecc6e87d3">rsgBindSampler</a>(<a class="code" href="structrs__program__fragment.html" title="Opaque handle to a Renderscript ProgramFragment object.">rs_program_fragment</a>, <a class="code" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> slot, <a class="code" href="structrs__sampler.html" title="Opaque handle to a Renderscript sampler object.">rs_sampler</a>);
+<a name="l00109"></a>00109 
+<a name="l00118"></a>00118 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00119"></a>00119     <a class="code" href="rs__graphics_8rsh.html#a1694eb5489bd3a444da921dbf16aeeb5">rsgBindTexture</a>(rs_program_fragment, <a class="code" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> slot, <a class="code" href="structrs__allocation.html" title="Opaque handle to a Renderscript allocation.">rs_allocation</a>);
+<a name="l00120"></a>00120 
+<a name="l00127"></a>00127 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00128"></a>00128     <a class="code" href="rs__graphics_8rsh.html#a83a87d8efa3f26ed3f8fb25e49f29059">rsgProgramVertexLoadProjectionMatrix</a>(const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *proj);
+<a name="l00135"></a>00135 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00136"></a>00136     <a class="code" href="rs__graphics_8rsh.html#a976b8594cccb4b94d7ce520b44d884e3">rsgProgramVertexLoadModelMatrix</a>(const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *model);
+<a name="l00143"></a>00143 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00144"></a>00144     <a class="code" href="rs__graphics_8rsh.html#a377b7b394c4bf0881532b1241d4be168">rsgProgramVertexLoadTextureMatrix</a>(const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *tex);
+<a name="l00151"></a>00151 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00152"></a>00152     <a class="code" href="rs__graphics_8rsh.html#a2b767d209b36ffcd2e0fc0cf6f4c5706">rsgProgramVertexGetProjectionMatrix</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *proj);
+<a name="l00153"></a>00153 
+<a name="l00163"></a>00163 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00164"></a>00164     <a class="code" href="rs__graphics_8rsh.html#a35ac8c3759e25047e6a458c15520c887">rsgProgramFragmentConstantColor</a>(rs_program_fragment pf, <span class="keywordtype">float</span> r, <span class="keywordtype">float</span> g, <span class="keywordtype">float</span> b, <span class="keywordtype">float</span> a);
+<a name="l00165"></a>00165 
+<a name="l00171"></a>00171 extern <a class="code" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> __attribute__((overloadable))
+<a name="l00172"></a>00172     <a class="code" href="rs__graphics_8rsh.html#a67f4ed1ca4bba27d5c952ada89cd0717">rsgGetWidth</a>(<span class="keywordtype">void</span>);
+<a name="l00173"></a>00173 
+<a name="l00179"></a>00179 extern <a class="code" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> __attribute__((overloadable))
+<a name="l00180"></a>00180     <a class="code" href="rs__graphics_8rsh.html#a7e6565cd5d5e44f442a8bf8ba68f4681">rsgGetHeight</a>(<span class="keywordtype">void</span>);
+<a name="l00181"></a>00181 
+<a name="l00182"></a>00182 
+<a name="l00189"></a>00189 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00190"></a>00190     <a class="code" href="rs__graphics_8rsh.html#a647228d8e15da6ad67a97701d920dcac">rsgAllocationSyncAll</a>(rs_allocation alloc);
+<a name="l00191"></a>00191 
+<a name="l00192"></a>00192 <span class="preprocessor">#if (defined(RS_VERSION) &amp;&amp; (RS_VERSION &gt;= 14))</span>
+<a name="l00193"></a>00193 <span class="preprocessor"></span>
+<a name="l00201"></a>00201 <span class="keyword">extern</span> <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00202"></a>00202     <a class="code" href="rs__graphics_8rsh.html#a647228d8e15da6ad67a97701d920dcac">rsgAllocationSyncAll</a>(rs_allocation alloc,
+<a name="l00203"></a>00203                          rs_allocation_usage_type source);
+<a name="l00204"></a>00204 
+<a name="l00205"></a>00205 <span class="preprocessor">#endif //defined(RS_VERSION) &amp;&amp; (RS_VERSION &gt;= 14)</span>
+<a name="l00206"></a>00206 <span class="preprocessor"></span>
+<a name="l00217"></a>00217 <span class="keyword">extern</span> <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00218"></a>00218     <a class="code" href="rs__graphics_8rsh.html#a80c51849bf12ec6c699c23c3fa3e6208">rsgDrawRect</a>(<span class="keywordtype">float</span> x1, <span class="keywordtype">float</span> y1, <span class="keywordtype">float</span> x2, <span class="keywordtype">float</span> y2, <span class="keywordtype">float</span> z);
+<a name="l00219"></a>00219 
+<a name="l00237"></a>00237 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00238"></a>00238     <a class="code" href="rs__graphics_8rsh.html#ad6953da0349e58547b08b8ce174ed3fc">rsgDrawQuad</a>(<span class="keywordtype">float</span> x1, <span class="keywordtype">float</span> y1, <span class="keywordtype">float</span> z1,
+<a name="l00239"></a>00239                 <span class="keywordtype">float</span> x2, <span class="keywordtype">float</span> y2, <span class="keywordtype">float</span> z2,
+<a name="l00240"></a>00240                 <span class="keywordtype">float</span> x3, <span class="keywordtype">float</span> y3, <span class="keywordtype">float</span> z3,
+<a name="l00241"></a>00241                 <span class="keywordtype">float</span> x4, <span class="keywordtype">float</span> y4, <span class="keywordtype">float</span> z4);
+<a name="l00242"></a>00242 
+<a name="l00243"></a>00243 
+<a name="l00269"></a>00269 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00270"></a>00270     <a class="code" href="rs__graphics_8rsh.html#afb98a59bb9f878f0a09459567c269e64">rsgDrawQuadTexCoords</a>(<span class="keywordtype">float</span> x1, <span class="keywordtype">float</span> y1, <span class="keywordtype">float</span> z1, <span class="keywordtype">float</span> u1, <span class="keywordtype">float</span> v1,
+<a name="l00271"></a>00271                          <span class="keywordtype">float</span> x2, <span class="keywordtype">float</span> y2, <span class="keywordtype">float</span> z2, <span class="keywordtype">float</span> u2, <span class="keywordtype">float</span> v2,
+<a name="l00272"></a>00272                          <span class="keywordtype">float</span> x3, <span class="keywordtype">float</span> y3, <span class="keywordtype">float</span> z3, <span class="keywordtype">float</span> u3, <span class="keywordtype">float</span> v3,
+<a name="l00273"></a>00273                          <span class="keywordtype">float</span> x4, <span class="keywordtype">float</span> y4, <span class="keywordtype">float</span> z4, <span class="keywordtype">float</span> u4, <span class="keywordtype">float</span> v4);
+<a name="l00274"></a>00274 
+<a name="l00275"></a>00275 
+<a name="l00288"></a>00288 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00289"></a>00289     <a class="code" href="rs__graphics_8rsh.html#a07d15127330fa1dff6c99b0d7d14e65e">rsgDrawSpriteScreenspace</a>(<span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> z, <span class="keywordtype">float</span> w, <span class="keywordtype">float</span> h);
+<a name="l00290"></a>00290 
+<a name="l00297"></a>00297 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00298"></a>00298     <a class="code" href="rs__graphics_8rsh.html#a6f8b87c994810908fbe5e01f8f63f9af">rsgDrawMesh</a>(<a class="code" href="structrs__mesh.html" title="Opaque handle to a Renderscript mesh object.">rs_mesh</a> ism);
+<a name="l00305"></a>00305 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00306"></a>00306     <a class="code" href="rs__graphics_8rsh.html#a6f8b87c994810908fbe5e01f8f63f9af">rsgDrawMesh</a>(<a class="code" href="structrs__mesh.html" title="Opaque handle to a Renderscript mesh object.">rs_mesh</a> ism, <a class="code" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> primitiveIndex);
+<a name="l00315"></a>00315 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00316"></a>00316     <a class="code" href="rs__graphics_8rsh.html#a6f8b87c994810908fbe5e01f8f63f9af">rsgDrawMesh</a>(<a class="code" href="structrs__mesh.html" title="Opaque handle to a Renderscript mesh object.">rs_mesh</a> ism, <a class="code" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> primitiveIndex, <a class="code" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> start, <a class="code" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> len);
+<a name="l00317"></a>00317 
+<a name="l00326"></a>00326 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00327"></a>00327     <a class="code" href="rs__graphics_8rsh.html#a147674fed92745fbb5c64a6300ca3c49">rsgClearColor</a>(<span class="keywordtype">float</span> r, <span class="keywordtype">float</span> g, <span class="keywordtype">float</span> b, <span class="keywordtype">float</span> a);
+<a name="l00328"></a>00328 
+<a name="l00332"></a>00332 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00333"></a>00333     <a class="code" href="rs__graphics_8rsh.html#a4bedb06e8facd587e3eacd746fe3e727">rsgClearDepth</a>(<span class="keywordtype">float</span> value);
+<a name="l00337"></a>00337 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00338"></a>00338     <a class="code" href="rs__graphics_8rsh.html#afaec82492762e62cad1ff53ada479b14">rsgDrawText</a>(const <span class="keywordtype">char</span> *, <span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y);
+<a name="l00342"></a>00342 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00343"></a>00343     <a class="code" href="rs__graphics_8rsh.html#afaec82492762e62cad1ff53ada479b14">rsgDrawText</a>(rs_allocation, <span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y);
+<a name="l00348"></a>00348 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00349"></a>00349     <a class="code" href="rs__graphics_8rsh.html#ae89effef281e92e2940055883ea366d4">rsgBindFont</a>(<a class="code" href="structrs__font.html" title="Opaque handle to a Renderscript font object.">rs_font</a> font);
+<a name="l00357"></a>00357 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00358"></a>00358     <a class="code" href="rs__graphics_8rsh.html#abda8c344092ed6310c7a8f353a6df876">rsgFontColor</a>(<span class="keywordtype">float</span> r, <span class="keywordtype">float</span> g, <span class="keywordtype">float</span> b, <span class="keywordtype">float</span> a);
+<a name="l00363"></a>00363 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00364"></a>00364     <a class="code" href="rs__graphics_8rsh.html#a5c599f4ea989f3d0616cbf8e983688c4">rsgMeasureText</a>(const <span class="keywordtype">char</span> *, <span class="keywordtype">int</span> *left, <span class="keywordtype">int</span> *right, <span class="keywordtype">int</span> *top, <span class="keywordtype">int</span> *bottom);
+<a name="l00368"></a>00368 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00369"></a>00369     <a class="code" href="rs__graphics_8rsh.html#a5c599f4ea989f3d0616cbf8e983688c4">rsgMeasureText</a>(rs_allocation, <span class="keywordtype">int</span> *left, <span class="keywordtype">int</span> *right, <span class="keywordtype">int</span> *top, <span class="keywordtype">int</span> *bottom);
+<a name="l00373"></a>00373 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00374"></a>00374     <a class="code" href="rs__graphics_8rsh.html#a0978c54902dd1d60180f8dbb0b781105">rsgMeshComputeBoundingBox</a>(<a class="code" href="structrs__mesh.html" title="Opaque handle to a Renderscript mesh object.">rs_mesh</a> mesh, <span class="keywordtype">float</span> *minX, <span class="keywordtype">float</span> *minY, <span class="keywordtype">float</span> *minZ,
+<a name="l00375"></a>00375                                                 <span class="keywordtype">float</span> *maxX, <span class="keywordtype">float</span> *maxY, <span class="keywordtype">float</span> *maxZ);
+<a name="l00379"></a>00379 __inline__ static <span class="keywordtype">void</span> __attribute__((overloadable, always_inline))
+<a name="l00380"></a><a class="code" href="rs__graphics_8rsh.html#a6058b6b6c8b94f96f03dc8bca6a2090b">00380</a> <a class="code" href="rs__graphics_8rsh.html#a0978c54902dd1d60180f8dbb0b781105">rsgMeshComputeBoundingBox</a>(<a class="code" href="structrs__mesh.html" title="Opaque handle to a Renderscript mesh object.">rs_mesh</a> mesh, <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> *bBoxMin, <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> *bBoxMax) {
+<a name="l00381"></a>00381     <span class="keywordtype">float</span> x1, y1, z1, x2, y2, z2;
+<a name="l00382"></a>00382     <a class="code" href="rs__graphics_8rsh.html#a0978c54902dd1d60180f8dbb0b781105">rsgMeshComputeBoundingBox</a>(mesh, &amp;x1, &amp;y1, &amp;z1, &amp;x2, &amp;y2, &amp;z2);
+<a name="l00383"></a>00383     bBoxMin-&gt;x = x1;
+<a name="l00384"></a>00384     bBoxMin-&gt;y = y1;
+<a name="l00385"></a>00385     bBoxMin-&gt;z = z1;
+<a name="l00386"></a>00386     bBoxMax-&gt;x = x2;
+<a name="l00387"></a>00387     bBoxMax-&gt;y = y2;
+<a name="l00388"></a>00388     bBoxMax-&gt;z = z2;
+<a name="l00389"></a>00389 }
+<a name="l00390"></a>00390 
+<a name="l00391"></a>00391 <span class="preprocessor">#endif</span>
+<a name="l00392"></a>00392 <span class="preprocessor"></span>
+</pre></div></div>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/rs__math_8rsh.html b/docs/html/reference/renderscript/rs__math_8rsh.html
new file mode 100644
index 0000000..9415c3a
--- /dev/null
+++ b/docs/html/reference/renderscript/rs__math_8rsh.html
@@ -0,0 +1,679 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_math.rsh File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="summary">
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_math.rsh File Reference</div>  </div>
+</div>
+<div class="contents">
+<table class="memberdecls">
+<tr><td colspan="2"><h2><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#ad9106e5aae5b1248870f21061f36a1c9">rsRand</a> (int max_value)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#a01edf1cf3cdaecb1629761b69148e189">rsRand</a> (int min_value, int max_value)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#a03e898d810ac44158e7461b2b2b1c356">rsRand</a> (float max_value)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#a84b2e7468314873b3aa02969e310d9e4">rsRand</a> (float min_value, float max_value)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#ac4f127e78da0849321c7f6db14f9e989">rsFrac</a> (float)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#ad40f2fb8f416e2ab7d2879de3b3d885e">rsClamp</a> (<a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> amount, <a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> low, <a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> high)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#ad36abebbb36ffc5312fb2ed8baf98d39">rsClamp</a> (int amount, int low, int high)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#a1f9e5f628fc42e8215e9dcf89ebc6897">rsClamp</a> (<a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a> amount, <a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a> low, <a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a> high)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME short&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#a7b8cb9e970171f866b75d333abf68d89">rsClamp</a> (short amount, short low, short high)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#a08fe0a967cc59f2ad831115557c86c50">rsClamp</a> (<a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a> amount, <a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a> low, <a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a> high)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#ae31137028793c4aaf4df839535135837">rsClamp</a> (char amount, char low, char high)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">static __inline__ void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#a191f9c687c56322c18b7d71491602122">rsExtractFrustumPlanes</a> (const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *viewProj, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *left, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *right, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *top, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *bottom, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *near, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *far)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">static __inline__ bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#a7bbeaf44838e08e68d5cf3e3d7b0818c">rsIsSphereInFrustum</a> (<a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *sphere, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *left, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *right, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *top, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *bottom, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *near, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *far)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">uchar4</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#a628c8d13e3fe41fc860ad937184e4dcd">rsPackColorTo8888</a> (float r, float g, float b)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">uchar4</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#a84d08e07ec8421c51ee8bd57d5b8b33e">rsPackColorTo8888</a> (float r, float g, float b, float a)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">uchar4</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#a22e0be7e18b317a7453ebad4300934f6">rsPackColorTo8888</a> (<a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> color)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#a26525a4f5093bd0f13191efe06127f4b">rsUnpackColor8888</a> (<a class="el" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">uchar4</a> c)</td></tr>
+</table>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>todo-jsams </p>
+
+<p>Definition in file <a class="el" href="rs__math_8rsh_source.html">rs_math.rsh</a>.</p>
+</div><hr/><h2>Function Documentation</h2>
+<a class="anchor" id="ad40f2fb8f416e2ab7d2879de3b3d885e"></a><!-- doxytag: member="rs_math.rsh::rsClamp" ref="ad40f2fb8f416e2ab7d2879de3b3d885e" args="(uint amount, uint low, uint high)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> rsClamp </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>&#160;</td>
+          <td class="paramname"><em>amount</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>&#160;</td>
+          <td class="paramname"><em>low</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>&#160;</td>
+          <td class="paramname"><em>high</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Clamp the value amount between low and high.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">amount</td><td>The value to clamp </td></tr>
+    <tr><td class="paramname">low</td><td></td></tr>
+    <tr><td class="paramname">high</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ad36abebbb36ffc5312fb2ed8baf98d39"></a><!-- doxytag: member="rs_math.rsh::rsClamp" ref="ad36abebbb36ffc5312fb2ed8baf98d39" args="(int amount, int low, int high)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME int rsClamp </td>
+          <td>(</td>
+          <td class="paramtype">int&#160;</td>
+          <td class="paramname"><em>amount</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int&#160;</td>
+          <td class="paramname"><em>low</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int&#160;</td>
+          <td class="paramname"><em>high</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a1f9e5f628fc42e8215e9dcf89ebc6897"></a><!-- doxytag: member="rs_math.rsh::rsClamp" ref="a1f9e5f628fc42e8215e9dcf89ebc6897" args="(ushort amount, ushort low, ushort high)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a> rsClamp </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a>&#160;</td>
+          <td class="paramname"><em>amount</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a>&#160;</td>
+          <td class="paramname"><em>low</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a>&#160;</td>
+          <td class="paramname"><em>high</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a7b8cb9e970171f866b75d333abf68d89"></a><!-- doxytag: member="rs_math.rsh::rsClamp" ref="a7b8cb9e970171f866b75d333abf68d89" args="(short amount, short low, short high)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME short rsClamp </td>
+          <td>(</td>
+          <td class="paramtype">short&#160;</td>
+          <td class="paramname"><em>amount</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">short&#160;</td>
+          <td class="paramname"><em>low</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">short&#160;</td>
+          <td class="paramname"><em>high</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a08fe0a967cc59f2ad831115557c86c50"></a><!-- doxytag: member="rs_math.rsh::rsClamp" ref="a08fe0a967cc59f2ad831115557c86c50" args="(uchar amount, uchar low, uchar high)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a> rsClamp </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a>&#160;</td>
+          <td class="paramname"><em>amount</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a>&#160;</td>
+          <td class="paramname"><em>low</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a>&#160;</td>
+          <td class="paramname"><em>high</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="ae31137028793c4aaf4df839535135837"></a><!-- doxytag: member="rs_math.rsh::rsClamp" ref="ae31137028793c4aaf4df839535135837" args="(char amount, char low, char high)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME char rsClamp </td>
+          <td>(</td>
+          <td class="paramtype">char&#160;</td>
+          <td class="paramname"><em>amount</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">char&#160;</td>
+          <td class="paramname"><em>low</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">char&#160;</td>
+          <td class="paramname"><em>high</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a191f9c687c56322c18b7d71491602122"></a><!-- doxytag: member="rs_math.rsh::rsExtractFrustumPlanes" ref="a191f9c687c56322c18b7d71491602122" args="(const rs_matrix4x4 *viewProj, float4 *left, float4 *right, float4 *top, float4 *bottom, float4 *near, float4 *far)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">static __inline__ void rsExtractFrustumPlanes </td>
+          <td>(</td>
+          <td class="paramtype">const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>viewProj</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
+          <td class="paramname"><em>left</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
+          <td class="paramname"><em>right</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
+          <td class="paramname"><em>top</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
+          <td class="paramname"><em>bottom</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
+          <td class="paramname"><em>near</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
+          <td class="paramname"><em>far</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td><code> [static]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Computes 6 frustum planes from the view projection matrix </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">viewProj</td><td>matrix to extract planes from </td></tr>
+    <tr><td class="paramname">left</td><td>plane </td></tr>
+    <tr><td class="paramname">right</td><td>plane </td></tr>
+    <tr><td class="paramname">top</td><td>plane </td></tr>
+    <tr><td class="paramname">bottom</td><td>plane </td></tr>
+    <tr><td class="paramname">near</td><td>plane </td></tr>
+    <tr><td class="paramname">far</td><td>plane </td></tr>
+  </table>
+  </dd>
+</dl>
+
+<p>Definition at line <a class="el" href="rs__math_8rsh_source.html#l00102">102</a> of file <a class="el" href="rs__math_8rsh_source.html">rs_math.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ac4f127e78da0849321c7f6db14f9e989"></a><!-- doxytag: member="rs_math.rsh::rsFrac" ref="ac4f127e78da0849321c7f6db14f9e989" args="(float)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float rsFrac </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Returns the fractional part of a float </p>
+
+</div>
+</div>
+<a class="anchor" id="a7bbeaf44838e08e68d5cf3e3d7b0818c"></a><!-- doxytag: member="rs_math.rsh::rsIsSphereInFrustum" ref="a7bbeaf44838e08e68d5cf3e3d7b0818c" args="(float4 *sphere, float4 *left, float4 *right, float4 *top, float4 *bottom, float4 *near, float4 *far)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">static __inline__ bool rsIsSphereInFrustum </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
+          <td class="paramname"><em>sphere</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
+          <td class="paramname"><em>left</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
+          <td class="paramname"><em>right</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
+          <td class="paramname"><em>top</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
+          <td class="paramname"><em>bottom</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
+          <td class="paramname"><em>near</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
+          <td class="paramname"><em>far</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td><code> [static]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Checks if a sphere is withing the 6 frustum planes </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">sphere</td><td>float4 representing the sphere </td></tr>
+    <tr><td class="paramname">left</td><td>plane </td></tr>
+    <tr><td class="paramname">right</td><td>plane </td></tr>
+    <tr><td class="paramname">top</td><td>plane </td></tr>
+    <tr><td class="paramname">bottom</td><td>plane </td></tr>
+    <tr><td class="paramname">near</td><td>plane </td></tr>
+    <tr><td class="paramname">far</td><td>plane </td></tr>
+  </table>
+  </dd>
+</dl>
+
+<p>Definition at line <a class="el" href="rs__math_8rsh_source.html#l00162">162</a> of file <a class="el" href="rs__math_8rsh_source.html">rs_math.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a628c8d13e3fe41fc860ad937184e4dcd"></a><!-- doxytag: member="rs_math.rsh::rsPackColorTo8888" ref="a628c8d13e3fe41fc860ad937184e4dcd" args="(float r, float g, float b)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">uchar4</a> rsPackColorTo8888 </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>r</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>g</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>b</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Pack floating point (0-1) RGB values into a uchar4. The alpha component is set to 255 (1.0).</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">r</td><td></td></tr>
+    <tr><td class="paramname">g</td><td></td></tr>
+    <tr><td class="paramname">b</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+<dl class="return"><dt><b>Returns:</b></dt><dd>uchar4 </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a84d08e07ec8421c51ee8bd57d5b8b33e"></a><!-- doxytag: member="rs_math.rsh::rsPackColorTo8888" ref="a84d08e07ec8421c51ee8bd57d5b8b33e" args="(float r, float g, float b, float a)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">uchar4</a> rsPackColorTo8888 </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>r</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>g</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>b</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>a</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Pack floating point (0-1) RGBA values into a uchar4.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">r</td><td></td></tr>
+    <tr><td class="paramname">g</td><td></td></tr>
+    <tr><td class="paramname">b</td><td></td></tr>
+    <tr><td class="paramname">a</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+<dl class="return"><dt><b>Returns:</b></dt><dd>uchar4 </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a22e0be7e18b317a7453ebad4300934f6"></a><!-- doxytag: member="rs_math.rsh::rsPackColorTo8888" ref="a22e0be7e18b317a7453ebad4300934f6" args="(float3 color)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">uchar4</a> rsPackColorTo8888 </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a>&#160;</td>
+          <td class="paramname"><em>color</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Pack floating point (0-1) RGB values into a uchar4. The alpha component is set to 255 (1.0).</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">color</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+<dl class="return"><dt><b>Returns:</b></dt><dd>uchar4</dd></dl>
+<p>Pack floating point (0-1) RGBA values into a uchar4.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">color</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+<dl class="return"><dt><b>Returns:</b></dt><dd>uchar4 </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="ad9106e5aae5b1248870f21061f36a1c9"></a><!-- doxytag: member="rs_math.rsh::rsRand" ref="ad9106e5aae5b1248870f21061f36a1c9" args="(int max_value)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">int rsRand </td>
+          <td>(</td>
+          <td class="paramtype">int&#160;</td>
+          <td class="paramname"><em>max_value</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Return a random value between 0 (or min_value) and max_malue. </p>
+
+</div>
+</div>
+<a class="anchor" id="a01edf1cf3cdaecb1629761b69148e189"></a><!-- doxytag: member="rs_math.rsh::rsRand" ref="a01edf1cf3cdaecb1629761b69148e189" args="(int min_value, int max_value)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">int rsRand </td>
+          <td>(</td>
+          <td class="paramtype">int&#160;</td>
+          <td class="paramname"><em>min_value</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int&#160;</td>
+          <td class="paramname"><em>max_value</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a03e898d810ac44158e7461b2b2b1c356"></a><!-- doxytag: member="rs_math.rsh::rsRand" ref="a03e898d810ac44158e7461b2b2b1c356" args="(float max_value)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float rsRand </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>max_value</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a84b2e7468314873b3aa02969e310d9e4"></a><!-- doxytag: member="rs_math.rsh::rsRand" ref="a84b2e7468314873b3aa02969e310d9e4" args="(float min_value, float max_value)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float rsRand </td>
+          <td>(</td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>min_value</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>max_value</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a26525a4f5093bd0f13191efe06127f4b"></a><!-- doxytag: member="rs_math.rsh::rsUnpackColor8888" ref="a26525a4f5093bd0f13191efe06127f4b" args="(uchar4 c)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> rsUnpackColor8888 </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">uchar4</a>&#160;</td>
+          <td class="paramname"><em>c</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Unpack a uchar4 color to float4. The resulting float range will be (0-1).</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">c</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+<dl class="return"><dt><b>Returns:</b></dt><dd>float4 </dd></dl>
+
+</div>
+</div>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/rs__math_8rsh_source.html b/docs/html/reference/renderscript/rs__math_8rsh_source.html
new file mode 100644
index 0000000..c056994
--- /dev/null
+++ b/docs/html/reference/renderscript/rs__math_8rsh_source.html
@@ -0,0 +1,174 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_math.rsh Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_math.rsh</div>  </div>
+</div>
+<div class="contents">
+<a href="rs__math_8rsh.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
+<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2011 The Android Open Source Project</span>
+<a name="l00003"></a>00003 <span class="comment"> *</span>
+<a name="l00004"></a>00004 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span>
+<a name="l00005"></a>00005 <span class="comment"> * you may not use this file except in compliance with the License.</span>
+<a name="l00006"></a>00006 <span class="comment"> * You may obtain a copy of the License at</span>
+<a name="l00007"></a>00007 <span class="comment"> *</span>
+<a name="l00008"></a>00008 <span class="comment"> *      http://www.apache.org/licenses/LICENSE-2.0</span>
+<a name="l00009"></a>00009 <span class="comment"> *</span>
+<a name="l00010"></a>00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
+<a name="l00011"></a>00011 <span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span>
+<a name="l00012"></a>00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
+<a name="l00013"></a>00013 <span class="comment"> * See the License for the specific language governing permissions and</span>
+<a name="l00014"></a>00014 <span class="comment"> * limitations under the License.</span>
+<a name="l00015"></a>00015 <span class="comment"> */</span>
+<a name="l00016"></a>00016 
+<a name="l00024"></a>00024 <span class="preprocessor">#ifndef __RS_MATH_RSH__</span>
+<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#define __RS_MATH_RSH__</span>
+<a name="l00026"></a>00026 <span class="preprocessor"></span>
+<a name="l00027"></a>00027 
+<a name="l00031"></a>00031 <span class="keyword">extern</span> <span class="keywordtype">int</span> __attribute__((overloadable))
+<a name="l00032"></a>00032     <a class="code" href="rs__math_8rsh.html#ad9106e5aae5b1248870f21061f36a1c9">rsRand</a>(<span class="keywordtype">int</span> max_value);
+<a name="l00036"></a>00036 extern <span class="keywordtype">int</span> __attribute__((overloadable))
+<a name="l00037"></a>00037     <a class="code" href="rs__math_8rsh.html#ad9106e5aae5b1248870f21061f36a1c9">rsRand</a>(<span class="keywordtype">int</span> min_value, <span class="keywordtype">int</span> max_value);
+<a name="l00041"></a>00041 extern <span class="keywordtype">float</span> __attribute__((overloadable))
+<a name="l00042"></a>00042     <a class="code" href="rs__math_8rsh.html#ad9106e5aae5b1248870f21061f36a1c9">rsRand</a>(<span class="keywordtype">float</span> max_value);
+<a name="l00046"></a>00046 extern <span class="keywordtype">float</span> __attribute__((overloadable))
+<a name="l00047"></a>00047     <a class="code" href="rs__math_8rsh.html#ad9106e5aae5b1248870f21061f36a1c9">rsRand</a>(<span class="keywordtype">float</span> min_value, <span class="keywordtype">float</span> max_value);
+<a name="l00048"></a>00048 
+<a name="l00052"></a>00052 extern <span class="keywordtype">float</span> __attribute__((overloadable))
+<a name="l00053"></a>00053     <a class="code" href="rs__math_8rsh.html#ac4f127e78da0849321c7f6db14f9e989">rsFrac</a>(<span class="keywordtype">float</span>);
+<a name="l00054"></a>00054 
+<a name="l00055"></a>00055 
+<a name="l00057"></a>00057 <span class="comment">// int ops</span>
+<a name="l00059"></a>00059 <span class="comment"></span>
+<a name="l00067"></a>00067 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> __attribute__((overloadable, always_inline)) <a class="code" href="rs__math_8rsh.html#ad40f2fb8f416e2ab7d2879de3b3d885e">rsClamp</a>(<a class="code" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> amount, <a class="code" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> low, <a class="code" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> high);
+<a name="l00068"></a>00068 
+<a name="l00072"></a>00072 _RS_RUNTIME <span class="keywordtype">int</span> __attribute__((overloadable, always_inline)) <a class="code" href="rs__math_8rsh.html#ad40f2fb8f416e2ab7d2879de3b3d885e">rsClamp</a>(<span class="keywordtype">int</span> amount, <span class="keywordtype">int</span> low, <span class="keywordtype">int</span> high);
+<a name="l00076"></a>00076 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a> __attribute__((overloadable, always_inline)) <a class="code" href="rs__math_8rsh.html#ad40f2fb8f416e2ab7d2879de3b3d885e">rsClamp</a>(<a class="code" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a> amount, <a class="code" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a> low, <a class="code" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a> high);
+<a name="l00080"></a>00080 _RS_RUNTIME <span class="keywordtype">short</span> __attribute__((overloadable, always_inline)) <a class="code" href="rs__math_8rsh.html#ad40f2fb8f416e2ab7d2879de3b3d885e">rsClamp</a>(<span class="keywordtype">short</span> amount, <span class="keywordtype">short</span> low, <span class="keywordtype">short</span> high);
+<a name="l00084"></a>00084 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a> __attribute__((overloadable, always_inline)) <a class="code" href="rs__math_8rsh.html#ad40f2fb8f416e2ab7d2879de3b3d885e">rsClamp</a>(<a class="code" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a> amount, <a class="code" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a> low, <a class="code" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a> high);
+<a name="l00088"></a>00088 _RS_RUNTIME <span class="keywordtype">char</span> __attribute__((overloadable, always_inline)) <a class="code" href="rs__math_8rsh.html#ad40f2fb8f416e2ab7d2879de3b3d885e">rsClamp</a>(<span class="keywordtype">char</span> amount, <span class="keywordtype">char</span> low, <span class="keywordtype">char</span> high);
+<a name="l00089"></a>00089 
+<a name="l00090"></a>00090 
+<a name="l00101"></a>00101 __inline__ static <span class="keywordtype">void</span> __attribute__((overloadable, always_inline))
+<a name="l00102"></a><a class="code" href="rs__math_8rsh.html#a191f9c687c56322c18b7d71491602122">00102</a> <a class="code" href="rs__math_8rsh.html#a191f9c687c56322c18b7d71491602122">rsExtractFrustumPlanes</a>(const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *viewProj,
+<a name="l00103"></a>00103                          <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *left, <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *right,
+<a name="l00104"></a>00104                          <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *top, <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *bottom,
+<a name="l00105"></a>00105                          <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *near, <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *far) {
+<a name="l00106"></a>00106     <span class="comment">// x y z w = a b c d in the plane equation</span>
+<a name="l00107"></a>00107     left-&gt;x = viewProj-&gt;m[3] + viewProj-&gt;m[0];
+<a name="l00108"></a>00108     left-&gt;y = viewProj-&gt;m[7] + viewProj-&gt;m[4];
+<a name="l00109"></a>00109     left-&gt;z = viewProj-&gt;m[11] + viewProj-&gt;m[8];
+<a name="l00110"></a>00110     left-&gt;w = viewProj-&gt;m[15] + viewProj-&gt;m[12];
+<a name="l00111"></a>00111 
+<a name="l00112"></a>00112     right-&gt;x = viewProj-&gt;m[3] - viewProj-&gt;m[0];
+<a name="l00113"></a>00113     right-&gt;y = viewProj-&gt;m[7] - viewProj-&gt;m[4];
+<a name="l00114"></a>00114     right-&gt;z = viewProj-&gt;m[11] - viewProj-&gt;m[8];
+<a name="l00115"></a>00115     right-&gt;w = viewProj-&gt;m[15] - viewProj-&gt;m[12];
+<a name="l00116"></a>00116 
+<a name="l00117"></a>00117     top-&gt;x = viewProj-&gt;m[3] - viewProj-&gt;m[1];
+<a name="l00118"></a>00118     top-&gt;y = viewProj-&gt;m[7] - viewProj-&gt;m[5];
+<a name="l00119"></a>00119     top-&gt;z = viewProj-&gt;m[11] - viewProj-&gt;m[9];
+<a name="l00120"></a>00120     top-&gt;w = viewProj-&gt;m[15] - viewProj-&gt;m[13];
+<a name="l00121"></a>00121 
+<a name="l00122"></a>00122     bottom-&gt;x = viewProj-&gt;m[3] + viewProj-&gt;m[1];
+<a name="l00123"></a>00123     bottom-&gt;y = viewProj-&gt;m[7] + viewProj-&gt;m[5];
+<a name="l00124"></a>00124     bottom-&gt;z = viewProj-&gt;m[11] + viewProj-&gt;m[9];
+<a name="l00125"></a>00125     bottom-&gt;w = viewProj-&gt;m[15] + viewProj-&gt;m[13];
+<a name="l00126"></a>00126 
+<a name="l00127"></a>00127     near-&gt;x = viewProj-&gt;m[3] + viewProj-&gt;m[2];
+<a name="l00128"></a>00128     near-&gt;y = viewProj-&gt;m[7] + viewProj-&gt;m[6];
+<a name="l00129"></a>00129     near-&gt;z = viewProj-&gt;m[11] + viewProj-&gt;m[10];
+<a name="l00130"></a>00130     near-&gt;w = viewProj-&gt;m[15] + viewProj-&gt;m[14];
+<a name="l00131"></a>00131 
+<a name="l00132"></a>00132     far-&gt;x = viewProj-&gt;m[3] - viewProj-&gt;m[2];
+<a name="l00133"></a>00133     far-&gt;y = viewProj-&gt;m[7] - viewProj-&gt;m[6];
+<a name="l00134"></a>00134     far-&gt;z = viewProj-&gt;m[11] - viewProj-&gt;m[10];
+<a name="l00135"></a>00135     far-&gt;w = viewProj-&gt;m[15] - viewProj-&gt;m[14];
+<a name="l00136"></a>00136 
+<a name="l00137"></a>00137     <span class="keywordtype">float</span> len = <a class="code" href="rs__cl_8rsh.html#a1a222b7879342279e1e0070d6afd9e18">length</a>(left-&gt;xyz);
+<a name="l00138"></a>00138     *left /= len;
+<a name="l00139"></a>00139     len = <a class="code" href="rs__cl_8rsh.html#a1a222b7879342279e1e0070d6afd9e18">length</a>(right-&gt;xyz);
+<a name="l00140"></a>00140     *right /= len;
+<a name="l00141"></a>00141     len = <a class="code" href="rs__cl_8rsh.html#a1a222b7879342279e1e0070d6afd9e18">length</a>(top-&gt;xyz);
+<a name="l00142"></a>00142     *top /= len;
+<a name="l00143"></a>00143     len = <a class="code" href="rs__cl_8rsh.html#a1a222b7879342279e1e0070d6afd9e18">length</a>(bottom-&gt;xyz);
+<a name="l00144"></a>00144     *bottom /= len;
+<a name="l00145"></a>00145     len = <a class="code" href="rs__cl_8rsh.html#a1a222b7879342279e1e0070d6afd9e18">length</a>(near-&gt;xyz);
+<a name="l00146"></a>00146     *near /= len;
+<a name="l00147"></a>00147     len = <a class="code" href="rs__cl_8rsh.html#a1a222b7879342279e1e0070d6afd9e18">length</a>(far-&gt;xyz);
+<a name="l00148"></a>00148     *far /= len;
+<a name="l00149"></a>00149 }
+<a name="l00150"></a>00150 
+<a name="l00161"></a>00161 __inline__ <span class="keyword">static</span> <span class="keywordtype">bool</span> __attribute__((overloadable, always_inline))
+<a name="l00162"></a><a class="code" href="rs__math_8rsh.html#a7bbeaf44838e08e68d5cf3e3d7b0818c">00162</a> <a class="code" href="rs__math_8rsh.html#a7bbeaf44838e08e68d5cf3e3d7b0818c">rsIsSphereInFrustum</a>(<a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *sphere,
+<a name="l00163"></a>00163                       <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *left, <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *right,
+<a name="l00164"></a>00164                       <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *top, <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *bottom,
+<a name="l00165"></a>00165                       <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *near, <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *far) {
+<a name="l00166"></a>00166 
+<a name="l00167"></a>00167     <span class="keywordtype">float</span> distToCenter = <a class="code" href="rs__cl_8rsh.html#a70544acaca578035a849eef67d62c449">dot</a>(left-&gt;xyz, sphere-&gt;xyz) + left-&gt;w;
+<a name="l00168"></a>00168     <span class="keywordflow">if</span> (distToCenter &lt; -sphere-&gt;w) {
+<a name="l00169"></a>00169         <span class="keywordflow">return</span> <span class="keyword">false</span>;
+<a name="l00170"></a>00170     }
+<a name="l00171"></a>00171     distToCenter = <a class="code" href="rs__cl_8rsh.html#a70544acaca578035a849eef67d62c449">dot</a>(right-&gt;xyz, sphere-&gt;xyz) + right-&gt;w;
+<a name="l00172"></a>00172     <span class="keywordflow">if</span> (distToCenter &lt; -sphere-&gt;w) {
+<a name="l00173"></a>00173         <span class="keywordflow">return</span> <span class="keyword">false</span>;
+<a name="l00174"></a>00174     }
+<a name="l00175"></a>00175     distToCenter = <a class="code" href="rs__cl_8rsh.html#a70544acaca578035a849eef67d62c449">dot</a>(top-&gt;xyz, sphere-&gt;xyz) + top-&gt;w;
+<a name="l00176"></a>00176     <span class="keywordflow">if</span> (distToCenter &lt; -sphere-&gt;w) {
+<a name="l00177"></a>00177         <span class="keywordflow">return</span> <span class="keyword">false</span>;
+<a name="l00178"></a>00178     }
+<a name="l00179"></a>00179     distToCenter = <a class="code" href="rs__cl_8rsh.html#a70544acaca578035a849eef67d62c449">dot</a>(bottom-&gt;xyz, sphere-&gt;xyz) + bottom-&gt;w;
+<a name="l00180"></a>00180     <span class="keywordflow">if</span> (distToCenter &lt; -sphere-&gt;w) {
+<a name="l00181"></a>00181         <span class="keywordflow">return</span> <span class="keyword">false</span>;
+<a name="l00182"></a>00182     }
+<a name="l00183"></a>00183     distToCenter = <a class="code" href="rs__cl_8rsh.html#a70544acaca578035a849eef67d62c449">dot</a>(near-&gt;xyz, sphere-&gt;xyz) + near-&gt;w;
+<a name="l00184"></a>00184     <span class="keywordflow">if</span> (distToCenter &lt; -sphere-&gt;w) {
+<a name="l00185"></a>00185         <span class="keywordflow">return</span> <span class="keyword">false</span>;
+<a name="l00186"></a>00186     }
+<a name="l00187"></a>00187     distToCenter = <a class="code" href="rs__cl_8rsh.html#a70544acaca578035a849eef67d62c449">dot</a>(far-&gt;xyz, sphere-&gt;xyz) + far-&gt;w;
+<a name="l00188"></a>00188     <span class="keywordflow">if</span> (distToCenter &lt; -sphere-&gt;w) {
+<a name="l00189"></a>00189         <span class="keywordflow">return</span> <span class="keyword">false</span>;
+<a name="l00190"></a>00190     }
+<a name="l00191"></a>00191     <span class="keywordflow">return</span> <span class="keyword">true</span>;
+<a name="l00192"></a>00192 }
+<a name="l00193"></a>00193 
+<a name="l00194"></a>00194 
+<a name="l00205"></a>00205 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">uchar4</a> __attribute__((overloadable)) <a class="code" href="rs__math_8rsh.html#a628c8d13e3fe41fc860ad937184e4dcd">rsPackColorTo8888</a>(<span class="keywordtype">float</span> r, <span class="keywordtype">float</span> g, <span class="keywordtype">float</span> b);
+<a name="l00206"></a>00206 
+<a name="l00217"></a>00217 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">uchar4</a> __attribute__((overloadable)) <a class="code" href="rs__math_8rsh.html#a628c8d13e3fe41fc860ad937184e4dcd">rsPackColorTo8888</a>(<span class="keywordtype">float</span> r, <span class="keywordtype">float</span> g, <span class="keywordtype">float</span> b, <span class="keywordtype">float</span> a);
+<a name="l00218"></a>00218 
+<a name="l00227"></a>00227 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">uchar4</a> __attribute__((overloadable)) <a class="code" href="rs__math_8rsh.html#a628c8d13e3fe41fc860ad937184e4dcd">rsPackColorTo8888</a>(<a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> color);
+<a name="l00228"></a>00228 
+<a name="l00236"></a>00236 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">uchar4</a> __attribute__((overloadable)) <a class="code" href="rs__math_8rsh.html#a628c8d13e3fe41fc860ad937184e4dcd">rsPackColorTo8888</a>(<a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> color);
+<a name="l00237"></a>00237 
+<a name="l00245"></a>00245 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> <a class="code" href="rs__math_8rsh.html#a26525a4f5093bd0f13191efe06127f4b">rsUnpackColor8888</a>(<a class="code" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">uchar4</a> c);
+<a name="l00246"></a>00246 
+<a name="l00247"></a>00247 
+<a name="l00248"></a>00248 <span class="preprocessor">#endif</span>
+</pre></div></div>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/rs__matrix_8rsh.html b/docs/html/reference/renderscript/rs__matrix_8rsh.html
new file mode 100644
index 0000000..b956301
--- /dev/null
+++ b/docs/html/reference/renderscript/rs__matrix_8rsh.html
@@ -0,0 +1,1520 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_matrix.rsh File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="summary">
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_matrix.rsh File Reference</div>  </div>
+</div>
+<div class="contents">
+<table class="memberdecls">
+<tr><td colspan="2"><h2><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a68e320f7fa2cc5a5b4759e3ab679ee10">rsMatrixSet</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col, float v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#ada106cb8f08e4b23930d7ba1a0ce5609">rsMatrixSet</a> (<a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *m, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col, float v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a086c4f1cd21500f8e332226af4f62001">rsMatrixSet</a> (<a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *m, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col, float v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#af1fb87eb02f166bb85ef10a92333bb49">rsMatrixGet</a> (const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a90b0548da8dbe1f643bcbac8466e5b72">rsMatrixGet</a> (const <a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *m, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a22a46174a3c72452c9f6c33403aeae19">rsMatrixGet</a> (const <a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *m, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a0ffd9de971cf10d0a663ff565be8d3cc">rsMatrixLoadIdentity</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a5b31e83553efa947db2198674d5db043">rsMatrixLoadIdentity</a> (<a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *m)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#ad2954a5ac11d2370227296be89e92471">rsMatrixLoadIdentity</a> (<a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *m)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#ac380c4117e047da494a74f0dad20fab3">rsMatrixLoad</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, const float *v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#aef942535c5d56072125dcf5244970ea2">rsMatrixLoad</a> (<a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *m, const float *v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#aa327089f7ad9161d7372094163147005">rsMatrixLoad</a> (<a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *m, const float *v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a5239a3f5f2becd20507d0aa56638ba03">rsMatrixLoad</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a06176acb38405937cb94c835a712a3b3">rsMatrixLoad</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, const <a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a3a3d0f0053720fb4afb3a3eb32e42a82">rsMatrixLoad</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, const <a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a654e5abe095770979d740f7b55382bd0">rsMatrixLoad</a> (<a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *m, const <a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a5f3697805c794c9c9f2f8cfdde4b9a44">rsMatrixLoad</a> (<a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *m, const <a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a268032f3ac6d766b1d7fe72a6cb50464">rsMatrixLoadRotate</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, float rot, float x, float y, float z)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#acaf51d1f9ad5041ce01fbf8b7c5923fd">rsMatrixLoadScale</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, float x, float y, float z)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a1b521c8a3d1260fa732cbf0a71af0e74">rsMatrixLoadTranslate</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, float x, float y, float z)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a79f14c4c0f5ecc1bbd0bf54da8b653ef">rsMatrixLoadMultiply</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *lhs, const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *rhs)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a78872343ea6a5c1a846160ccdc4add52">rsMatrixLoadMultiply</a> (<a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *m, const <a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *lhs, const <a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *rhs)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#ae0dd4755c28fc896626ebf5dc784130f">rsMatrixLoadMultiply</a> (<a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *m, const <a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *lhs, const <a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *rhs)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *rhs)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#ae0b03aeec17ec8b9c5e75f8efb1bdc53">rsMatrixMultiply</a> (<a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *m, const <a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *rhs)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#ab1973ad3efa0ab2d53f466dd9fb190bb">rsMatrixMultiply</a> (<a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *m, const <a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *rhs)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#ad5ed05ca4880397fb29615e3c6798de1">rsMatrixRotate</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, float rot, float x, float y, float z)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a94cc6b22bd1a6c07a9a1c1d21afb392c">rsMatrixScale</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, float x, float y, float z)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a4df5f9b5bb6044f3c3426f2f58b94405">rsMatrixTranslate</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, float x, float y, float z)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a4c59884a0e534dbbcdc5655842732d43">rsMatrixLoadOrtho</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, float left, float right, float bottom, float top, float near, float far)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#ad25760aaf01e95d0055237afab41bbb3">rsMatrixLoadFrustum</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, float left, float right, float bottom, float top, float near, float far)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#aa404c34d7478f2921f7415d2da95d02b">rsMatrixLoadPerspective</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, float fovy, float aspect, float near, float far)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a47b6abbf32ffaf77bb13d96c3f05779f">rsMatrixMultiply</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> in)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a716bc2d29b80eb25388aba3ba8845aef">rsMatrixMultiply</a> (<a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *m, <a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> in)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a4d9a8bb7c3f5d67b14fa349bdd531d13">rsMatrixMultiply</a> (<a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *m, <a class="el" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> in)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a00b6a334ba5ac94d84850f22ec9f4de5">rsMatrixInverse</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#ac05080d52da2d99a759ef34fa0655e82">rsMatrixInverseTranspose</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a88095c70f1550c760844b3e32e41a31a">rsMatrixTranspose</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#ac52acb31a705f6c68af8bddea0e79969">rsMatrixTranspose</a> (<a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *m)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a49164dd4d4e85b212196028b1fd89dc1">rsMatrixTranspose</a> (<a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *m)</td></tr>
+</table>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>Matrix routines. </p>
+
+<p>Definition in file <a class="el" href="rs__matrix_8rsh_source.html">rs_matrix.rsh</a>.</p>
+</div><hr/><h2>Function Documentation</h2>
+<a class="anchor" id="af1fb87eb02f166bb85ef10a92333bb49"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixGet" ref="af1fb87eb02f166bb85ef10a92333bb49" args="(const rs_matrix4x4 *m, uint32_t row, uint32_t col)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME float rsMatrixGet </td>
+          <td>(</td>
+          <td class="paramtype">const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td>
+          <td class="paramname"><em>row</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td>
+          <td class="paramname"><em>col</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Get one element of a matrix.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">m</td><td>The matrix to read from </td></tr>
+    <tr><td class="paramname">row</td><td></td></tr>
+    <tr><td class="paramname">col</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+<dl class="return"><dt><b>Returns:</b></dt><dd>float </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a90b0548da8dbe1f643bcbac8466e5b72"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixGet" ref="a90b0548da8dbe1f643bcbac8466e5b72" args="(const rs_matrix3x3 *m, uint32_t row, uint32_t col)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME float rsMatrixGet </td>
+          <td>(</td>
+          <td class="paramtype">const <a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td>
+          <td class="paramname"><em>row</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td>
+          <td class="paramname"><em>col</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a22a46174a3c72452c9f6c33403aeae19"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixGet" ref="a22a46174a3c72452c9f6c33403aeae19" args="(const rs_matrix2x2 *m, uint32_t row, uint32_t col)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME float rsMatrixGet </td>
+          <td>(</td>
+          <td class="paramtype">const <a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td>
+          <td class="paramname"><em>row</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td>
+          <td class="paramname"><em>col</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a00b6a334ba5ac94d84850f22ec9f4de5"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixInverse" ref="a00b6a334ba5ac94d84850f22ec9f4de5" args="(rs_matrix4x4 *m)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">bool rsMatrixInverse </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>m</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Returns true if the matrix was successfully inversed</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">m</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ac05080d52da2d99a759ef34fa0655e82"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixInverseTranspose" ref="ac05080d52da2d99a759ef34fa0655e82" args="(rs_matrix4x4 *m)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">bool rsMatrixInverseTranspose </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>m</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Returns true if the matrix was successfully inversed and transposed.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">m</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ac380c4117e047da494a74f0dad20fab3"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixLoad" ref="ac380c4117e047da494a74f0dad20fab3" args="(rs_matrix4x4 *m, const float *v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixLoad </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const float *&#160;</td>
+          <td class="paramname"><em>v</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Set the elements of a matrix from an array of floats.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">m</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="aef942535c5d56072125dcf5244970ea2"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixLoad" ref="aef942535c5d56072125dcf5244970ea2" args="(rs_matrix3x3 *m, const float *v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixLoad </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const float *&#160;</td>
+          <td class="paramname"><em>v</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="aa327089f7ad9161d7372094163147005"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixLoad" ref="aa327089f7ad9161d7372094163147005" args="(rs_matrix2x2 *m, const float *v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixLoad </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const float *&#160;</td>
+          <td class="paramname"><em>v</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a5239a3f5f2becd20507d0aa56638ba03"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixLoad" ref="a5239a3f5f2becd20507d0aa56638ba03" args="(rs_matrix4x4 *m, const rs_matrix4x4 *v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixLoad </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>v</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a06176acb38405937cb94c835a712a3b3"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixLoad" ref="a06176acb38405937cb94c835a712a3b3" args="(rs_matrix4x4 *m, const rs_matrix3x3 *v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixLoad </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *&#160;</td>
+          <td class="paramname"><em>v</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a3a3d0f0053720fb4afb3a3eb32e42a82"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixLoad" ref="a3a3d0f0053720fb4afb3a3eb32e42a82" args="(rs_matrix4x4 *m, const rs_matrix2x2 *v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixLoad </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *&#160;</td>
+          <td class="paramname"><em>v</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Set the elements of a matrix from another matrix.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">m</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a654e5abe095770979d740f7b55382bd0"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixLoad" ref="a654e5abe095770979d740f7b55382bd0" args="(rs_matrix3x3 *m, const rs_matrix3x3 *v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixLoad </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *&#160;</td>
+          <td class="paramname"><em>v</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a5f3697805c794c9c9f2f8cfdde4b9a44"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixLoad" ref="a5f3697805c794c9c9f2f8cfdde4b9a44" args="(rs_matrix2x2 *m, const rs_matrix2x2 *v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixLoad </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *&#160;</td>
+          <td class="paramname"><em>v</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="ad25760aaf01e95d0055237afab41bbb3"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixLoadFrustum" ref="ad25760aaf01e95d0055237afab41bbb3" args="(rs_matrix4x4 *m, float left, float right, float bottom, float top, float near, float far)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixLoadFrustum </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>left</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>right</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>bottom</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>top</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>near</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>far</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Load an Frustum projection matrix constructed from the 6 planes</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">m</td><td></td></tr>
+    <tr><td class="paramname">left</td><td></td></tr>
+    <tr><td class="paramname">right</td><td></td></tr>
+    <tr><td class="paramname">bottom</td><td></td></tr>
+    <tr><td class="paramname">top</td><td></td></tr>
+    <tr><td class="paramname">near</td><td></td></tr>
+    <tr><td class="paramname">far</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a0ffd9de971cf10d0a663ff565be8d3cc"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixLoadIdentity" ref="a0ffd9de971cf10d0a663ff565be8d3cc" args="(rs_matrix4x4 *m)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixLoadIdentity </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>m</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Set the elements of a matrix to the identity matrix.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">m</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a5b31e83553efa947db2198674d5db043"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixLoadIdentity" ref="a5b31e83553efa947db2198674d5db043" args="(rs_matrix3x3 *m)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixLoadIdentity </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *&#160;</td>
+          <td class="paramname"><em>m</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="ad2954a5ac11d2370227296be89e92471"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixLoadIdentity" ref="ad2954a5ac11d2370227296be89e92471" args="(rs_matrix2x2 *m)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixLoadIdentity </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *&#160;</td>
+          <td class="paramname"><em>m</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a79f14c4c0f5ecc1bbd0bf54da8b653ef"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixLoadMultiply" ref="a79f14c4c0f5ecc1bbd0bf54da8b653ef" args="(rs_matrix4x4 *m, const rs_matrix4x4 *lhs, const rs_matrix4x4 *rhs)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixLoadMultiply </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>lhs</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>rhs</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Multiply two matrix (lhs, rhs) and place the result in m.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">m</td><td></td></tr>
+    <tr><td class="paramname">lhs</td><td></td></tr>
+    <tr><td class="paramname">rhs</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a78872343ea6a5c1a846160ccdc4add52"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixLoadMultiply" ref="a78872343ea6a5c1a846160ccdc4add52" args="(rs_matrix3x3 *m, const rs_matrix3x3 *lhs, const rs_matrix3x3 *rhs)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixLoadMultiply </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *&#160;</td>
+          <td class="paramname"><em>lhs</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *&#160;</td>
+          <td class="paramname"><em>rhs</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="ae0dd4755c28fc896626ebf5dc784130f"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixLoadMultiply" ref="ae0dd4755c28fc896626ebf5dc784130f" args="(rs_matrix2x2 *m, const rs_matrix2x2 *lhs, const rs_matrix2x2 *rhs)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixLoadMultiply </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *&#160;</td>
+          <td class="paramname"><em>lhs</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *&#160;</td>
+          <td class="paramname"><em>rhs</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a4c59884a0e534dbbcdc5655842732d43"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixLoadOrtho" ref="a4c59884a0e534dbbcdc5655842732d43" args="(rs_matrix4x4 *m, float left, float right, float bottom, float top, float near, float far)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixLoadOrtho </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>left</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>right</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>bottom</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>top</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>near</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>far</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Load an Ortho projection matrix constructed from the 6 planes</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">m</td><td></td></tr>
+    <tr><td class="paramname">left</td><td></td></tr>
+    <tr><td class="paramname">right</td><td></td></tr>
+    <tr><td class="paramname">bottom</td><td></td></tr>
+    <tr><td class="paramname">top</td><td></td></tr>
+    <tr><td class="paramname">near</td><td></td></tr>
+    <tr><td class="paramname">far</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="aa404c34d7478f2921f7415d2da95d02b"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixLoadPerspective" ref="aa404c34d7478f2921f7415d2da95d02b" args="(rs_matrix4x4 *m, float fovy, float aspect, float near, float far)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixLoadPerspective </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>fovy</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>aspect</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>near</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>far</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Load an perspective projection matrix constructed from the 6 planes</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">m</td><td></td></tr>
+    <tr><td class="paramname">fovy</td><td>Field of view, in degrees along the Y axis. </td></tr>
+    <tr><td class="paramname">aspect</td><td>Ratio of x / y. </td></tr>
+    <tr><td class="paramname">near</td><td></td></tr>
+    <tr><td class="paramname">far</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a268032f3ac6d766b1d7fe72a6cb50464"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixLoadRotate" ref="a268032f3ac6d766b1d7fe72a6cb50464" args="(rs_matrix4x4 *m, float rot, float x, float y, float z)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixLoadRotate </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>rot</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>z</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Load a rotation matrix.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">m</td><td></td></tr>
+    <tr><td class="paramname">rot</td><td></td></tr>
+    <tr><td class="paramname">x</td><td></td></tr>
+    <tr><td class="paramname">y</td><td></td></tr>
+    <tr><td class="paramname">z</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="acaf51d1f9ad5041ce01fbf8b7c5923fd"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixLoadScale" ref="acaf51d1f9ad5041ce01fbf8b7c5923fd" args="(rs_matrix4x4 *m, float x, float y, float z)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixLoadScale </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>z</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Load a scale matrix.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">m</td><td></td></tr>
+    <tr><td class="paramname">x</td><td></td></tr>
+    <tr><td class="paramname">y</td><td></td></tr>
+    <tr><td class="paramname">z</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a1b521c8a3d1260fa732cbf0a71af0e74"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixLoadTranslate" ref="a1b521c8a3d1260fa732cbf0a71af0e74" args="(rs_matrix4x4 *m, float x, float y, float z)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixLoadTranslate </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>z</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Load a translation matrix.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">m</td><td></td></tr>
+    <tr><td class="paramname">x</td><td></td></tr>
+    <tr><td class="paramname">y</td><td></td></tr>
+    <tr><td class="paramname">z</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a97953ab2606900a839e5816c619abe66"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixMultiply" ref="a97953ab2606900a839e5816c619abe66" args="(rs_matrix4x4 *m, const rs_matrix4x4 *rhs)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixMultiply </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>rhs</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Multiply the matrix m by rhs and place the result back into m.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">m</td><td>(lhs) </td></tr>
+    <tr><td class="paramname">rhs</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ae0b03aeec17ec8b9c5e75f8efb1bdc53"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixMultiply" ref="ae0b03aeec17ec8b9c5e75f8efb1bdc53" args="(rs_matrix3x3 *m, const rs_matrix3x3 *rhs)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixMultiply </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *&#160;</td>
+          <td class="paramname"><em>rhs</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="ab1973ad3efa0ab2d53f466dd9fb190bb"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixMultiply" ref="ab1973ad3efa0ab2d53f466dd9fb190bb" args="(rs_matrix2x2 *m, const rs_matrix2x2 *rhs)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixMultiply </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *&#160;</td>
+          <td class="paramname"><em>rhs</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a47b6abbf32ffaf77bb13d96c3f05779f"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixMultiply" ref="a47b6abbf32ffaf77bb13d96c3f05779f" args="(rs_matrix4x4 *m, float4 in)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> rsMatrixMultiply </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a>&#160;</td>
+          <td class="paramname"><em>in</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Multiply a vector by a matrix and return the result vector. API version 10-13</p>
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a716bc2d29b80eb25388aba3ba8845aef"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixMultiply" ref="a716bc2d29b80eb25388aba3ba8845aef" args="(rs_matrix3x3 *m, float3 in)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> rsMatrixMultiply </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a>&#160;</td>
+          <td class="paramname"><em>in</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a4d9a8bb7c3f5d67b14fa349bdd531d13"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixMultiply" ref="a4d9a8bb7c3f5d67b14fa349bdd531d13" args="(rs_matrix2x2 *m, float2 in)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> rsMatrixMultiply </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a>&#160;</td>
+          <td class="paramname"><em>in</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="ad5ed05ca4880397fb29615e3c6798de1"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixRotate" ref="ad5ed05ca4880397fb29615e3c6798de1" args="(rs_matrix4x4 *m, float rot, float x, float y, float z)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixRotate </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>rot</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>z</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Multiple matrix m with a rotation matrix</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">m</td><td></td></tr>
+    <tr><td class="paramname">rot</td><td></td></tr>
+    <tr><td class="paramname">x</td><td></td></tr>
+    <tr><td class="paramname">y</td><td></td></tr>
+    <tr><td class="paramname">z</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a94cc6b22bd1a6c07a9a1c1d21afb392c"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixScale" ref="a94cc6b22bd1a6c07a9a1c1d21afb392c" args="(rs_matrix4x4 *m, float x, float y, float z)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixScale </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>z</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Multiple matrix m with a scale matrix</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">m</td><td></td></tr>
+    <tr><td class="paramname">x</td><td></td></tr>
+    <tr><td class="paramname">y</td><td></td></tr>
+    <tr><td class="paramname">z</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a68e320f7fa2cc5a5b4759e3ab679ee10"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixSet" ref="a68e320f7fa2cc5a5b4759e3ab679ee10" args="(rs_matrix4x4 *m, uint32_t row, uint32_t col, float v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME void rsMatrixSet </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td>
+          <td class="paramname"><em>row</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td>
+          <td class="paramname"><em>col</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Set one element of a matrix.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">m</td><td>The matrix to be set </td></tr>
+    <tr><td class="paramname">row</td><td></td></tr>
+    <tr><td class="paramname">col</td><td></td></tr>
+    <tr><td class="paramname">v</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+<dl class="return"><dt><b>Returns:</b></dt><dd>void </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="ada106cb8f08e4b23930d7ba1a0ce5609"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixSet" ref="ada106cb8f08e4b23930d7ba1a0ce5609" args="(rs_matrix3x3 *m, uint32_t row, uint32_t col, float v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME void rsMatrixSet </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td>
+          <td class="paramname"><em>row</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td>
+          <td class="paramname"><em>col</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a086c4f1cd21500f8e332226af4f62001"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixSet" ref="a086c4f1cd21500f8e332226af4f62001" args="(rs_matrix2x2 *m, uint32_t row, uint32_t col, float v)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">_RS_RUNTIME void rsMatrixSet </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td>
+          <td class="paramname"><em>row</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td>
+          <td class="paramname"><em>col</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>v</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a4df5f9b5bb6044f3c3426f2f58b94405"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixTranslate" ref="a4df5f9b5bb6044f3c3426f2f58b94405" args="(rs_matrix4x4 *m, float x, float y, float z)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixTranslate </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>z</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Multiple matrix m with a translation matrix</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">m</td><td></td></tr>
+    <tr><td class="paramname">x</td><td></td></tr>
+    <tr><td class="paramname">y</td><td></td></tr>
+    <tr><td class="paramname">z</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a88095c70f1550c760844b3e32e41a31a"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixTranspose" ref="a88095c70f1550c760844b3e32e41a31a" args="(rs_matrix4x4 *m)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixTranspose </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>m</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Transpose the matrix m.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">m</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ac52acb31a705f6c68af8bddea0e79969"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixTranspose" ref="ac52acb31a705f6c68af8bddea0e79969" args="(rs_matrix3x3 *m)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixTranspose </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *&#160;</td>
+          <td class="paramname"><em>m</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a49164dd4d4e85b212196028b1fd89dc1"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixTranspose" ref="a49164dd4d4e85b212196028b1fd89dc1" args="(rs_matrix2x2 *m)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsMatrixTranspose </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *&#160;</td>
+          <td class="paramname"><em>m</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/rs__matrix_8rsh_source.html b/docs/html/reference/renderscript/rs__matrix_8rsh_source.html
new file mode 100644
index 0000000..531a3e3
--- /dev/null
+++ b/docs/html/reference/renderscript/rs__matrix_8rsh_source.html
@@ -0,0 +1,173 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_matrix.rsh Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_matrix.rsh</div>  </div>
+</div>
+<div class="contents">
+<a href="rs__matrix_8rsh.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
+<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2011 The Android Open Source Project</span>
+<a name="l00003"></a>00003 <span class="comment"> *</span>
+<a name="l00004"></a>00004 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span>
+<a name="l00005"></a>00005 <span class="comment"> * you may not use this file except in compliance with the License.</span>
+<a name="l00006"></a>00006 <span class="comment"> * You may obtain a copy of the License at</span>
+<a name="l00007"></a>00007 <span class="comment"> *</span>
+<a name="l00008"></a>00008 <span class="comment"> *      http://www.apache.org/licenses/LICENSE-2.0</span>
+<a name="l00009"></a>00009 <span class="comment"> *</span>
+<a name="l00010"></a>00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
+<a name="l00011"></a>00011 <span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span>
+<a name="l00012"></a>00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
+<a name="l00013"></a>00013 <span class="comment"> * See the License for the specific language governing permissions and</span>
+<a name="l00014"></a>00014 <span class="comment"> * limitations under the License.</span>
+<a name="l00015"></a>00015 <span class="comment"> */</span>
+<a name="l00016"></a>00016 
+<a name="l00023"></a>00023 <span class="preprocessor">#ifndef __RS_MATRIX_RSH__</span>
+<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define __RS_MATRIX_RSH__</span>
+<a name="l00025"></a>00025 <span class="preprocessor"></span>
+<a name="l00036"></a>00036 _RS_RUNTIME <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00037"></a>00037 <a class="code" href="rs__matrix_8rsh.html#a68e320f7fa2cc5a5b4759e3ab679ee10">rsMatrixSet</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col, <span class="keywordtype">float</span> v);
+<a name="l00041"></a>00041 _RS_RUNTIME <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00042"></a>00042 <a class="code" href="rs__matrix_8rsh.html#a68e320f7fa2cc5a5b4759e3ab679ee10">rsMatrixSet</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col, <span class="keywordtype">float</span> v);
+<a name="l00046"></a>00046 _RS_RUNTIME <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00047"></a>00047 <a class="code" href="rs__matrix_8rsh.html#a68e320f7fa2cc5a5b4759e3ab679ee10">rsMatrixSet</a>(<a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col, <span class="keywordtype">float</span> v);
+<a name="l00048"></a>00048 
+<a name="l00058"></a>00058 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable))
+<a name="l00059"></a>00059 <a class="code" href="rs__matrix_8rsh.html#af1fb87eb02f166bb85ef10a92333bb49">rsMatrixGet</a>(const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col);
+<a name="l00063"></a>00063 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable))
+<a name="l00064"></a>00064 <a class="code" href="rs__matrix_8rsh.html#af1fb87eb02f166bb85ef10a92333bb49">rsMatrixGet</a>(const <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col);
+<a name="l00068"></a>00068 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable))
+<a name="l00069"></a>00069 <a class="code" href="rs__matrix_8rsh.html#af1fb87eb02f166bb85ef10a92333bb49">rsMatrixGet</a>(const <a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col);
+<a name="l00070"></a>00070 
+<a name="l00076"></a>00076 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#a0ffd9de971cf10d0a663ff565be8d3cc">rsMatrixLoadIdentity</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m);
+<a name="l00080"></a>00080 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#a0ffd9de971cf10d0a663ff565be8d3cc">rsMatrixLoadIdentity</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m);
+<a name="l00084"></a>00084 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#a0ffd9de971cf10d0a663ff565be8d3cc">rsMatrixLoadIdentity</a>(<a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m);
+<a name="l00085"></a>00085 
+<a name="l00091"></a>00091 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac380c4117e047da494a74f0dad20fab3">rsMatrixLoad</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, const <span class="keywordtype">float</span> *v);
+<a name="l00095"></a>00095 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac380c4117e047da494a74f0dad20fab3">rsMatrixLoad</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, const <span class="keywordtype">float</span> *v);
+<a name="l00099"></a>00099 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac380c4117e047da494a74f0dad20fab3">rsMatrixLoad</a>(<a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m, const <span class="keywordtype">float</span> *v);
+<a name="l00103"></a>00103 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac380c4117e047da494a74f0dad20fab3">rsMatrixLoad</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *v);
+<a name="l00107"></a>00107 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac380c4117e047da494a74f0dad20fab3">rsMatrixLoad</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, const <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *v);
+<a name="l00108"></a>00108 
+<a name="l00114"></a>00114 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac380c4117e047da494a74f0dad20fab3">rsMatrixLoad</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, const <a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *v);
+<a name="l00118"></a>00118 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac380c4117e047da494a74f0dad20fab3">rsMatrixLoad</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, const <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *v);
+<a name="l00122"></a>00122 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac380c4117e047da494a74f0dad20fab3">rsMatrixLoad</a>(<a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m, const <a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *v);
+<a name="l00123"></a>00123 
+<a name="l00133"></a>00133 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00134"></a>00134 <a class="code" href="rs__matrix_8rsh.html#a268032f3ac6d766b1d7fe72a6cb50464">rsMatrixLoadRotate</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <span class="keywordtype">float</span> rot, <span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> z);
+<a name="l00135"></a>00135 
+<a name="l00144"></a>00144 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00145"></a>00145 <a class="code" href="rs__matrix_8rsh.html#acaf51d1f9ad5041ce01fbf8b7c5923fd">rsMatrixLoadScale</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> z);
+<a name="l00146"></a>00146 
+<a name="l00155"></a>00155 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00156"></a>00156 <a class="code" href="rs__matrix_8rsh.html#a1b521c8a3d1260fa732cbf0a71af0e74">rsMatrixLoadTranslate</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> z);
+<a name="l00157"></a>00157 
+<a name="l00165"></a>00165 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00166"></a>00166 <a class="code" href="rs__matrix_8rsh.html#a79f14c4c0f5ecc1bbd0bf54da8b653ef">rsMatrixLoadMultiply</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *lhs, const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *rhs);
+<a name="l00170"></a>00170 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00171"></a>00171 <a class="code" href="rs__matrix_8rsh.html#a79f14c4c0f5ecc1bbd0bf54da8b653ef">rsMatrixLoadMultiply</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, const <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *lhs, const <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *rhs);
+<a name="l00175"></a>00175 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00176"></a>00176 <a class="code" href="rs__matrix_8rsh.html#a79f14c4c0f5ecc1bbd0bf54da8b653ef">rsMatrixLoadMultiply</a>(<a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m, const <a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *lhs, const <a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *rhs);
+<a name="l00177"></a>00177 
+<a name="l00184"></a>00184 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00185"></a>00185 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *rhs);
+<a name="l00189"></a>00189 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00190"></a>00190 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, const <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *rhs);
+<a name="l00194"></a>00194 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00195"></a>00195 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m, const <a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *rhs);
+<a name="l00196"></a>00196 
+<a name="l00206"></a>00206 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00207"></a>00207 <a class="code" href="rs__matrix_8rsh.html#ad5ed05ca4880397fb29615e3c6798de1">rsMatrixRotate</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <span class="keywordtype">float</span> rot, <span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> z);
+<a name="l00208"></a>00208 
+<a name="l00217"></a>00217 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00218"></a>00218 <a class="code" href="rs__matrix_8rsh.html#a94cc6b22bd1a6c07a9a1c1d21afb392c">rsMatrixScale</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> z);
+<a name="l00219"></a>00219 
+<a name="l00228"></a>00228 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00229"></a>00229 <a class="code" href="rs__matrix_8rsh.html#a4df5f9b5bb6044f3c3426f2f58b94405">rsMatrixTranslate</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> z);
+<a name="l00230"></a>00230 
+<a name="l00242"></a>00242 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00243"></a>00243 <a class="code" href="rs__matrix_8rsh.html#a4c59884a0e534dbbcdc5655842732d43">rsMatrixLoadOrtho</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <span class="keywordtype">float</span> left, <span class="keywordtype">float</span> right, <span class="keywordtype">float</span> bottom, <span class="keywordtype">float</span> top, <span class="keywordtype">float</span> near, <span class="keywordtype">float</span> far);
+<a name="l00244"></a>00244 
+<a name="l00256"></a>00256 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00257"></a>00257 <a class="code" href="rs__matrix_8rsh.html#ad25760aaf01e95d0055237afab41bbb3">rsMatrixLoadFrustum</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <span class="keywordtype">float</span> left, <span class="keywordtype">float</span> right, <span class="keywordtype">float</span> bottom, <span class="keywordtype">float</span> top, <span class="keywordtype">float</span> near, <span class="keywordtype">float</span> far);
+<a name="l00258"></a>00258 
+<a name="l00268"></a>00268 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00269"></a>00269 <a class="code" href="rs__matrix_8rsh.html#aa404c34d7478f2921f7415d2da95d02b">rsMatrixLoadPerspective</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a>* m, <span class="keywordtype">float</span> fovy, <span class="keywordtype">float</span> aspect, <span class="keywordtype">float</span> near, <span class="keywordtype">float</span> far);
+<a name="l00270"></a>00270 
+<a name="l00271"></a>00271 <span class="preprocessor">#if !defined(RS_VERSION) || (RS_VERSION &lt; 14)</span>
+<a name="l00272"></a>00272 <span class="preprocessor"></span>
+<a name="l00276"></a>00276 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((overloadable))
+<a name="l00277"></a>00277 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> in);
+<a name="l00278"></a>00278 
+<a name="l00282"></a>00282 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((overloadable))
+<a name="l00283"></a>00283 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> in);
+<a name="l00284"></a>00284 
+<a name="l00288"></a>00288 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((overloadable))
+<a name="l00289"></a>00289 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> in);
+<a name="l00290"></a>00290 
+<a name="l00294"></a>00294 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> __attribute__((overloadable))
+<a name="l00295"></a>00295 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> in);
+<a name="l00296"></a>00296 
+<a name="l00300"></a>00300 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> __attribute__((overloadable))
+<a name="l00301"></a>00301 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> in);
+<a name="l00302"></a>00302 
+<a name="l00306"></a>00306 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> __attribute__((overloadable))
+<a name="l00307"></a>00307 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m, <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> in);
+<a name="l00308"></a>00308 <span class="preprocessor">#else</span>
+<a name="l00309"></a>00309 <span class="preprocessor"></span>
+<a name="l00313"></a>00313 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((overloadable))
+<a name="l00314"></a>00314 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> in);
+<a name="l00315"></a>00315 
+<a name="l00319"></a>00319 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((overloadable))
+<a name="l00320"></a>00320 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> in);
+<a name="l00321"></a>00321 
+<a name="l00325"></a>00325 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((overloadable))
+<a name="l00326"></a>00326 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> in);
+<a name="l00327"></a>00327 
+<a name="l00331"></a>00331 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> __attribute__((overloadable))
+<a name="l00332"></a>00332 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(const <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> in);
+<a name="l00333"></a>00333 
+<a name="l00337"></a>00337 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> __attribute__((overloadable))
+<a name="l00338"></a>00338 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(const <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> in);
+<a name="l00339"></a>00339 
+<a name="l00343"></a>00343 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> __attribute__((overloadable))
+<a name="l00344"></a>00344 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(const <a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m, <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> in);
+<a name="l00345"></a>00345 <span class="preprocessor">#endif</span>
+<a name="l00346"></a>00346 <span class="preprocessor"></span>
+<a name="l00347"></a>00347 
+<a name="l00353"></a>00353 <span class="keyword">extern</span> <span class="keywordtype">bool</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#a00b6a334ba5ac94d84850f22ec9f4de5">rsMatrixInverse</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m);
+<a name="l00354"></a>00354 
+<a name="l00360"></a>00360 extern <span class="keywordtype">bool</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac05080d52da2d99a759ef34fa0655e82">rsMatrixInverseTranspose</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m);
+<a name="l00361"></a>00361 
+<a name="l00367"></a>00367 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#a88095c70f1550c760844b3e32e41a31a">rsMatrixTranspose</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m);
+<a name="l00371"></a>00371 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#a88095c70f1550c760844b3e32e41a31a">rsMatrixTranspose</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m);
+<a name="l00375"></a>00375 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#a88095c70f1550c760844b3e32e41a31a">rsMatrixTranspose</a>(<a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m);
+<a name="l00376"></a>00376 
+<a name="l00377"></a>00377 
+<a name="l00378"></a>00378 <span class="preprocessor">#endif</span>
+</pre></div></div>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/rs__object_8rsh.html b/docs/html/reference/renderscript/rs__object_8rsh.html
new file mode 100644
index 0000000..464e7e5
--- /dev/null
+++ b/docs/html/reference/renderscript/rs__object_8rsh.html
@@ -0,0 +1,791 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_object.rsh File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="summary">
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_object.rsh File Reference</div>  </div>
+</div>
+<div class="contents">
+<table class="memberdecls">
+<tr><td colspan="2"><h2><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#af6983a1578621ce283acc07f876cda62">rsSetObject</a> (<a class="el" href="structrs__element.html">rs_element</a> *dst, <a class="el" href="structrs__element.html">rs_element</a> src)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#ab1c6d0672b6b88add70a98e627eeb7ae">rsSetObject</a> (<a class="el" href="structrs__type.html">rs_type</a> *dst, <a class="el" href="structrs__type.html">rs_type</a> src)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#af3446b1b9c2e4b600cdc8d828f3dbb59">rsSetObject</a> (<a class="el" href="structrs__allocation.html">rs_allocation</a> *dst, <a class="el" href="structrs__allocation.html">rs_allocation</a> src)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#a5132f90b4aaf8d2e35e6ad021fb08175">rsSetObject</a> (<a class="el" href="structrs__sampler.html">rs_sampler</a> *dst, <a class="el" href="structrs__sampler.html">rs_sampler</a> src)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#a9dfc520ed267ac9733760bc628a93cae">rsSetObject</a> (<a class="el" href="structrs__script.html">rs_script</a> *dst, <a class="el" href="structrs__script.html">rs_script</a> src)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#a4d6368cf71d6fd2e55efbe23af6cfd7c">rsSetObject</a> (<a class="el" href="structrs__mesh.html">rs_mesh</a> *dst, <a class="el" href="structrs__mesh.html">rs_mesh</a> src)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#a8135bceeb7b3ec8bf9a49d04e39bd565">rsSetObject</a> (<a class="el" href="structrs__program__fragment.html">rs_program_fragment</a> *dst, <a class="el" href="structrs__program__fragment.html">rs_program_fragment</a> src)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#a5512c023d40e416bea709f8d8caf9674">rsSetObject</a> (<a class="el" href="structrs__program__vertex.html">rs_program_vertex</a> *dst, <a class="el" href="structrs__program__vertex.html">rs_program_vertex</a> src)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#a42c0d25d78051a1de58a7a1c4dcfdada">rsSetObject</a> (<a class="el" href="structrs__program__raster.html">rs_program_raster</a> *dst, <a class="el" href="structrs__program__raster.html">rs_program_raster</a> src)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#a4babadff570c9f57edbb3fb98c80a113">rsSetObject</a> (<a class="el" href="structrs__program__store.html">rs_program_store</a> *dst, <a class="el" href="structrs__program__store.html">rs_program_store</a> src)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#ad1af9aed63d9f925a8e6288c0607d55b">rsSetObject</a> (<a class="el" href="structrs__font.html">rs_font</a> *dst, <a class="el" href="structrs__font.html">rs_font</a> src)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#aab5f47dc11b9044b3d02c4ed818fe6e7">rsClearObject</a> (<a class="el" href="structrs__element.html">rs_element</a> *dst)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#ae9c24592eb550e72c9ff480dfbb9fe07">rsClearObject</a> (<a class="el" href="structrs__type.html">rs_type</a> *dst)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#a5b944e2762ce1a44f7e63abd41851bcd">rsClearObject</a> (<a class="el" href="structrs__allocation.html">rs_allocation</a> *dst)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#a51fe2098cc5c2ff73ceff8cc46b6dd89">rsClearObject</a> (<a class="el" href="structrs__sampler.html">rs_sampler</a> *dst)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#a0034d7e67f80a9ce2e1139f1cb54b9a4">rsClearObject</a> (<a class="el" href="structrs__script.html">rs_script</a> *dst)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#a6f26564cf4fa1bcd46db51a478bf91b9">rsClearObject</a> (<a class="el" href="structrs__mesh.html">rs_mesh</a> *dst)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#afc6aca3a903d5e2021d9eeab4836fd26">rsClearObject</a> (<a class="el" href="structrs__program__fragment.html">rs_program_fragment</a> *dst)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#a712fcc988eedf21845495477cec54029">rsClearObject</a> (<a class="el" href="structrs__program__vertex.html">rs_program_vertex</a> *dst)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#a06b6d56105e192e121a5a4a555dc7b70">rsClearObject</a> (<a class="el" href="structrs__program__raster.html">rs_program_raster</a> *dst)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#a691d3c2564dd2c08d965ccb1c73a9b29">rsClearObject</a> (<a class="el" href="structrs__program__store.html">rs_program_store</a> *dst)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#aa246aa3c8162ef03e43bc0062671ae29">rsClearObject</a> (<a class="el" href="structrs__font.html">rs_font</a> *dst)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#a81f862730b961bd93ac132c24cbc0f82">rsIsObject</a> (<a class="el" href="structrs__element.html">rs_element</a>)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#a445c32d5bc085369f1ffa1a8ba13a381">rsIsObject</a> (<a class="el" href="structrs__type.html">rs_type</a>)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#afd33063fc6e45cb23f9a6f68dc2976ba">rsIsObject</a> (<a class="el" href="structrs__allocation.html">rs_allocation</a>)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#a509c7f0eacf1f07a3e7afaa029168f11">rsIsObject</a> (<a class="el" href="structrs__sampler.html">rs_sampler</a>)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#a6dc9db5fb60856b04c0b495a85affcbc">rsIsObject</a> (<a class="el" href="structrs__script.html">rs_script</a>)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#aa1860f7322da25f4c4a1727571b01e2b">rsIsObject</a> (<a class="el" href="structrs__mesh.html">rs_mesh</a>)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#afa57d9148778b03b270facbdbcb88816">rsIsObject</a> (<a class="el" href="structrs__program__fragment.html">rs_program_fragment</a>)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#acaa5da532eab1803a72fc4af2e7c6573">rsIsObject</a> (<a class="el" href="structrs__program__vertex.html">rs_program_vertex</a>)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#a2358cf1fd6b2e0b1d6f1bde8664d9c41">rsIsObject</a> (<a class="el" href="structrs__program__raster.html">rs_program_raster</a>)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#a547cd0a8071d895139893f1e10f5c3fd">rsIsObject</a> (<a class="el" href="structrs__program__store.html">rs_program_store</a>)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__object_8rsh.html#ac1d6da920f12974b3633d25ed078da2d">rsIsObject</a> (<a class="el" href="structrs__font.html">rs_font</a>)</td></tr>
+</table>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>Object routines. </p>
+
+<p>Definition in file <a class="el" href="rs__object_8rsh_source.html">rs_object.rsh</a>.</p>
+</div><hr/><h2>Function Documentation</h2>
+<a class="anchor" id="aab5f47dc11b9044b3d02c4ed818fe6e7"></a><!-- doxytag: member="rs_object.rsh::rsClearObject" ref="aab5f47dc11b9044b3d02c4ed818fe6e7" args="(rs_element *dst)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsClearObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__element.html">rs_element</a> *&#160;</td>
+          <td class="paramname"><em>dst</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Sets the object to NULL.</p>
+<dl class="return"><dt><b>Returns:</b></dt><dd>bool </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="ae9c24592eb550e72c9ff480dfbb9fe07"></a><!-- doxytag: member="rs_object.rsh::rsClearObject" ref="ae9c24592eb550e72c9ff480dfbb9fe07" args="(rs_type *dst)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsClearObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__type.html">rs_type</a> *&#160;</td>
+          <td class="paramname"><em>dst</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a5b944e2762ce1a44f7e63abd41851bcd"></a><!-- doxytag: member="rs_object.rsh::rsClearObject" ref="a5b944e2762ce1a44f7e63abd41851bcd" args="(rs_allocation *dst)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsClearObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__allocation.html">rs_allocation</a> *&#160;</td>
+          <td class="paramname"><em>dst</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a51fe2098cc5c2ff73ceff8cc46b6dd89"></a><!-- doxytag: member="rs_object.rsh::rsClearObject" ref="a51fe2098cc5c2ff73ceff8cc46b6dd89" args="(rs_sampler *dst)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsClearObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__sampler.html">rs_sampler</a> *&#160;</td>
+          <td class="paramname"><em>dst</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a0034d7e67f80a9ce2e1139f1cb54b9a4"></a><!-- doxytag: member="rs_object.rsh::rsClearObject" ref="a0034d7e67f80a9ce2e1139f1cb54b9a4" args="(rs_script *dst)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsClearObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__script.html">rs_script</a> *&#160;</td>
+          <td class="paramname"><em>dst</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a6f26564cf4fa1bcd46db51a478bf91b9"></a><!-- doxytag: member="rs_object.rsh::rsClearObject" ref="a6f26564cf4fa1bcd46db51a478bf91b9" args="(rs_mesh *dst)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsClearObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__mesh.html">rs_mesh</a> *&#160;</td>
+          <td class="paramname"><em>dst</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="afc6aca3a903d5e2021d9eeab4836fd26"></a><!-- doxytag: member="rs_object.rsh::rsClearObject" ref="afc6aca3a903d5e2021d9eeab4836fd26" args="(rs_program_fragment *dst)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsClearObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__program__fragment.html">rs_program_fragment</a> *&#160;</td>
+          <td class="paramname"><em>dst</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a712fcc988eedf21845495477cec54029"></a><!-- doxytag: member="rs_object.rsh::rsClearObject" ref="a712fcc988eedf21845495477cec54029" args="(rs_program_vertex *dst)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsClearObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__program__vertex.html">rs_program_vertex</a> *&#160;</td>
+          <td class="paramname"><em>dst</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a06b6d56105e192e121a5a4a555dc7b70"></a><!-- doxytag: member="rs_object.rsh::rsClearObject" ref="a06b6d56105e192e121a5a4a555dc7b70" args="(rs_program_raster *dst)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsClearObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__program__raster.html">rs_program_raster</a> *&#160;</td>
+          <td class="paramname"><em>dst</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a691d3c2564dd2c08d965ccb1c73a9b29"></a><!-- doxytag: member="rs_object.rsh::rsClearObject" ref="a691d3c2564dd2c08d965ccb1c73a9b29" args="(rs_program_store *dst)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsClearObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__program__store.html">rs_program_store</a> *&#160;</td>
+          <td class="paramname"><em>dst</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="aa246aa3c8162ef03e43bc0062671ae29"></a><!-- doxytag: member="rs_object.rsh::rsClearObject" ref="aa246aa3c8162ef03e43bc0062671ae29" args="(rs_font *dst)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsClearObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__font.html">rs_font</a> *&#160;</td>
+          <td class="paramname"><em>dst</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a81f862730b961bd93ac132c24cbc0f82"></a><!-- doxytag: member="rs_object.rsh::rsIsObject" ref="a81f862730b961bd93ac132c24cbc0f82" args="(rs_element)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">bool rsIsObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__element.html">rs_element</a>&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Tests if the object is valid. Returns true if the object is valid, false if it is NULL.</p>
+<dl class="return"><dt><b>Returns:</b></dt><dd>bool </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a445c32d5bc085369f1ffa1a8ba13a381"></a><!-- doxytag: member="rs_object.rsh::rsIsObject" ref="a445c32d5bc085369f1ffa1a8ba13a381" args="(rs_type)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">bool rsIsObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__type.html">rs_type</a>&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="afd33063fc6e45cb23f9a6f68dc2976ba"></a><!-- doxytag: member="rs_object.rsh::rsIsObject" ref="afd33063fc6e45cb23f9a6f68dc2976ba" args="(rs_allocation)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">bool rsIsObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__allocation.html">rs_allocation</a>&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a509c7f0eacf1f07a3e7afaa029168f11"></a><!-- doxytag: member="rs_object.rsh::rsIsObject" ref="a509c7f0eacf1f07a3e7afaa029168f11" args="(rs_sampler)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">bool rsIsObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__sampler.html">rs_sampler</a>&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a6dc9db5fb60856b04c0b495a85affcbc"></a><!-- doxytag: member="rs_object.rsh::rsIsObject" ref="a6dc9db5fb60856b04c0b495a85affcbc" args="(rs_script)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">bool rsIsObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__script.html">rs_script</a>&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="aa1860f7322da25f4c4a1727571b01e2b"></a><!-- doxytag: member="rs_object.rsh::rsIsObject" ref="aa1860f7322da25f4c4a1727571b01e2b" args="(rs_mesh)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">bool rsIsObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__mesh.html">rs_mesh</a>&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="afa57d9148778b03b270facbdbcb88816"></a><!-- doxytag: member="rs_object.rsh::rsIsObject" ref="afa57d9148778b03b270facbdbcb88816" args="(rs_program_fragment)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">bool rsIsObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__program__fragment.html">rs_program_fragment</a>&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="acaa5da532eab1803a72fc4af2e7c6573"></a><!-- doxytag: member="rs_object.rsh::rsIsObject" ref="acaa5da532eab1803a72fc4af2e7c6573" args="(rs_program_vertex)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">bool rsIsObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__program__vertex.html">rs_program_vertex</a>&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a2358cf1fd6b2e0b1d6f1bde8664d9c41"></a><!-- doxytag: member="rs_object.rsh::rsIsObject" ref="a2358cf1fd6b2e0b1d6f1bde8664d9c41" args="(rs_program_raster)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">bool rsIsObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__program__raster.html">rs_program_raster</a>&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a547cd0a8071d895139893f1e10f5c3fd"></a><!-- doxytag: member="rs_object.rsh::rsIsObject" ref="a547cd0a8071d895139893f1e10f5c3fd" args="(rs_program_store)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">bool rsIsObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__program__store.html">rs_program_store</a>&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="ac1d6da920f12974b3633d25ed078da2d"></a><!-- doxytag: member="rs_object.rsh::rsIsObject" ref="ac1d6da920f12974b3633d25ed078da2d" args="(rs_font)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">bool rsIsObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__font.html">rs_font</a>&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="af6983a1578621ce283acc07f876cda62"></a><!-- doxytag: member="rs_object.rsh::rsSetObject" ref="af6983a1578621ce283acc07f876cda62" args="(rs_element *dst, rs_element src)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsSetObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__element.html">rs_element</a> *&#160;</td>
+          <td class="paramname"><em>dst</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="structrs__element.html">rs_element</a>&#160;</td>
+          <td class="paramname"><em>src</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Copy reference to the specified object.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">dst</td><td></td></tr>
+    <tr><td class="paramname">src</td><td></td></tr>
+  </table>
+  </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ab1c6d0672b6b88add70a98e627eeb7ae"></a><!-- doxytag: member="rs_object.rsh::rsSetObject" ref="ab1c6d0672b6b88add70a98e627eeb7ae" args="(rs_type *dst, rs_type src)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsSetObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__type.html">rs_type</a> *&#160;</td>
+          <td class="paramname"><em>dst</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="structrs__type.html">rs_type</a>&#160;</td>
+          <td class="paramname"><em>src</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="af3446b1b9c2e4b600cdc8d828f3dbb59"></a><!-- doxytag: member="rs_object.rsh::rsSetObject" ref="af3446b1b9c2e4b600cdc8d828f3dbb59" args="(rs_allocation *dst, rs_allocation src)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsSetObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__allocation.html">rs_allocation</a> *&#160;</td>
+          <td class="paramname"><em>dst</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="structrs__allocation.html">rs_allocation</a>&#160;</td>
+          <td class="paramname"><em>src</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a5132f90b4aaf8d2e35e6ad021fb08175"></a><!-- doxytag: member="rs_object.rsh::rsSetObject" ref="a5132f90b4aaf8d2e35e6ad021fb08175" args="(rs_sampler *dst, rs_sampler src)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsSetObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__sampler.html">rs_sampler</a> *&#160;</td>
+          <td class="paramname"><em>dst</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="structrs__sampler.html">rs_sampler</a>&#160;</td>
+          <td class="paramname"><em>src</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a9dfc520ed267ac9733760bc628a93cae"></a><!-- doxytag: member="rs_object.rsh::rsSetObject" ref="a9dfc520ed267ac9733760bc628a93cae" args="(rs_script *dst, rs_script src)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsSetObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__script.html">rs_script</a> *&#160;</td>
+          <td class="paramname"><em>dst</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="structrs__script.html">rs_script</a>&#160;</td>
+          <td class="paramname"><em>src</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a4d6368cf71d6fd2e55efbe23af6cfd7c"></a><!-- doxytag: member="rs_object.rsh::rsSetObject" ref="a4d6368cf71d6fd2e55efbe23af6cfd7c" args="(rs_mesh *dst, rs_mesh src)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsSetObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__mesh.html">rs_mesh</a> *&#160;</td>
+          <td class="paramname"><em>dst</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="structrs__mesh.html">rs_mesh</a>&#160;</td>
+          <td class="paramname"><em>src</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a8135bceeb7b3ec8bf9a49d04e39bd565"></a><!-- doxytag: member="rs_object.rsh::rsSetObject" ref="a8135bceeb7b3ec8bf9a49d04e39bd565" args="(rs_program_fragment *dst, rs_program_fragment src)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsSetObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__program__fragment.html">rs_program_fragment</a> *&#160;</td>
+          <td class="paramname"><em>dst</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="structrs__program__fragment.html">rs_program_fragment</a>&#160;</td>
+          <td class="paramname"><em>src</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a5512c023d40e416bea709f8d8caf9674"></a><!-- doxytag: member="rs_object.rsh::rsSetObject" ref="a5512c023d40e416bea709f8d8caf9674" args="(rs_program_vertex *dst, rs_program_vertex src)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsSetObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__program__vertex.html">rs_program_vertex</a> *&#160;</td>
+          <td class="paramname"><em>dst</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="structrs__program__vertex.html">rs_program_vertex</a>&#160;</td>
+          <td class="paramname"><em>src</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a42c0d25d78051a1de58a7a1c4dcfdada"></a><!-- doxytag: member="rs_object.rsh::rsSetObject" ref="a42c0d25d78051a1de58a7a1c4dcfdada" args="(rs_program_raster *dst, rs_program_raster src)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsSetObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__program__raster.html">rs_program_raster</a> *&#160;</td>
+          <td class="paramname"><em>dst</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="structrs__program__raster.html">rs_program_raster</a>&#160;</td>
+          <td class="paramname"><em>src</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="a4babadff570c9f57edbb3fb98c80a113"></a><!-- doxytag: member="rs_object.rsh::rsSetObject" ref="a4babadff570c9f57edbb3fb98c80a113" args="(rs_program_store *dst, rs_program_store src)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsSetObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__program__store.html">rs_program_store</a> *&#160;</td>
+          <td class="paramname"><em>dst</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="structrs__program__store.html">rs_program_store</a>&#160;</td>
+          <td class="paramname"><em>src</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+<a class="anchor" id="ad1af9aed63d9f925a8e6288c0607d55b"></a><!-- doxytag: member="rs_object.rsh::rsSetObject" ref="ad1af9aed63d9f925a8e6288c0607d55b" args="(rs_font *dst, rs_font src)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void rsSetObject </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__font.html">rs_font</a> *&#160;</td>
+          <td class="paramname"><em>dst</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="structrs__font.html">rs_font</a>&#160;</td>
+          <td class="paramname"><em>src</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+
+</div>
+</div>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/rs__object_8rsh_source.html b/docs/html/reference/renderscript/rs__object_8rsh_source.html
new file mode 100644
index 0000000..0f9b488
--- /dev/null
+++ b/docs/html/reference/renderscript/rs__object_8rsh_source.html
@@ -0,0 +1,126 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_object.rsh Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_object.rsh</div>  </div>
+</div>
+<div class="contents">
+<a href="rs__object_8rsh.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
+<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2011 The Android Open Source Project</span>
+<a name="l00003"></a>00003 <span class="comment"> *</span>
+<a name="l00004"></a>00004 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span>
+<a name="l00005"></a>00005 <span class="comment"> * you may not use this file except in compliance with the License.</span>
+<a name="l00006"></a>00006 <span class="comment"> * You may obtain a copy of the License at</span>
+<a name="l00007"></a>00007 <span class="comment"> *</span>
+<a name="l00008"></a>00008 <span class="comment"> *      http://www.apache.org/licenses/LICENSE-2.0</span>
+<a name="l00009"></a>00009 <span class="comment"> *</span>
+<a name="l00010"></a>00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
+<a name="l00011"></a>00011 <span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span>
+<a name="l00012"></a>00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
+<a name="l00013"></a>00013 <span class="comment"> * See the License for the specific language governing permissions and</span>
+<a name="l00014"></a>00014 <span class="comment"> * limitations under the License.</span>
+<a name="l00015"></a>00015 <span class="comment"> */</span>
+<a name="l00016"></a>00016 
+<a name="l00023"></a>00023 <span class="preprocessor">#ifndef __RS_OBJECT_RSH__</span>
+<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define __RS_OBJECT_RSH__</span>
+<a name="l00025"></a>00025 <span class="preprocessor"></span>
+<a name="l00026"></a>00026 
+<a name="l00033"></a>00033 <span class="keyword">extern</span> <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00034"></a>00034     <a class="code" href="rs__object_8rsh.html#af6983a1578621ce283acc07f876cda62">rsSetObject</a>(<a class="code" href="structrs__element.html" title="Opaque handle to a Renderscript element.">rs_element</a> *dst, <a class="code" href="structrs__element.html" title="Opaque handle to a Renderscript element.">rs_element</a> src);
+<a name="l00038"></a>00038 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00039"></a>00039     <a class="code" href="rs__object_8rsh.html#af6983a1578621ce283acc07f876cda62">rsSetObject</a>(<a class="code" href="structrs__type.html" title="Opaque handle to a Renderscript type.">rs_type</a> *dst, <a class="code" href="structrs__type.html" title="Opaque handle to a Renderscript type.">rs_type</a> src);
+<a name="l00043"></a>00043 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00044"></a>00044     <a class="code" href="rs__object_8rsh.html#af6983a1578621ce283acc07f876cda62">rsSetObject</a>(<a class="code" href="structrs__allocation.html" title="Opaque handle to a Renderscript allocation.">rs_allocation</a> *dst, <a class="code" href="structrs__allocation.html" title="Opaque handle to a Renderscript allocation.">rs_allocation</a> src);
+<a name="l00048"></a>00048 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00049"></a>00049     <a class="code" href="rs__object_8rsh.html#af6983a1578621ce283acc07f876cda62">rsSetObject</a>(<a class="code" href="structrs__sampler.html" title="Opaque handle to a Renderscript sampler object.">rs_sampler</a> *dst, <a class="code" href="structrs__sampler.html" title="Opaque handle to a Renderscript sampler object.">rs_sampler</a> src);
+<a name="l00053"></a>00053 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00054"></a>00054     <a class="code" href="rs__object_8rsh.html#af6983a1578621ce283acc07f876cda62">rsSetObject</a>(<a class="code" href="structrs__script.html" title="Opaque handle to a Renderscript script object.">rs_script</a> *dst, <a class="code" href="structrs__script.html" title="Opaque handle to a Renderscript script object.">rs_script</a> src);
+<a name="l00058"></a>00058 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00059"></a>00059     <a class="code" href="rs__object_8rsh.html#af6983a1578621ce283acc07f876cda62">rsSetObject</a>(<a class="code" href="structrs__mesh.html" title="Opaque handle to a Renderscript mesh object.">rs_mesh</a> *dst, <a class="code" href="structrs__mesh.html" title="Opaque handle to a Renderscript mesh object.">rs_mesh</a> src);
+<a name="l00063"></a>00063 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00064"></a>00064     <a class="code" href="rs__object_8rsh.html#af6983a1578621ce283acc07f876cda62">rsSetObject</a>(<a class="code" href="structrs__program__fragment.html" title="Opaque handle to a Renderscript ProgramFragment object.">rs_program_fragment</a> *dst, <a class="code" href="structrs__program__fragment.html" title="Opaque handle to a Renderscript ProgramFragment object.">rs_program_fragment</a> src);
+<a name="l00068"></a>00068 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00069"></a>00069     <a class="code" href="rs__object_8rsh.html#af6983a1578621ce283acc07f876cda62">rsSetObject</a>(<a class="code" href="structrs__program__vertex.html" title="Opaque handle to a Renderscript ProgramVertex object.">rs_program_vertex</a> *dst, <a class="code" href="structrs__program__vertex.html" title="Opaque handle to a Renderscript ProgramVertex object.">rs_program_vertex</a> src);
+<a name="l00073"></a>00073 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00074"></a>00074     <a class="code" href="rs__object_8rsh.html#af6983a1578621ce283acc07f876cda62">rsSetObject</a>(<a class="code" href="structrs__program__raster.html" title="Opaque handle to a Renderscript ProgramRaster object.">rs_program_raster</a> *dst, <a class="code" href="structrs__program__raster.html" title="Opaque handle to a Renderscript ProgramRaster object.">rs_program_raster</a> src);
+<a name="l00078"></a>00078 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00079"></a>00079     <a class="code" href="rs__object_8rsh.html#af6983a1578621ce283acc07f876cda62">rsSetObject</a>(<a class="code" href="structrs__program__store.html" title="Opaque handle to a Renderscript ProgramStore object.">rs_program_store</a> *dst, <a class="code" href="structrs__program__store.html" title="Opaque handle to a Renderscript ProgramStore object.">rs_program_store</a> src);
+<a name="l00083"></a>00083 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00084"></a>00084     <a class="code" href="rs__object_8rsh.html#af6983a1578621ce283acc07f876cda62">rsSetObject</a>(<a class="code" href="structrs__font.html" title="Opaque handle to a Renderscript font object.">rs_font</a> *dst, <a class="code" href="structrs__font.html" title="Opaque handle to a Renderscript font object.">rs_font</a> src);
+<a name="l00085"></a>00085 
+<a name="l00091"></a>00091 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00092"></a>00092     <a class="code" href="rs__object_8rsh.html#aab5f47dc11b9044b3d02c4ed818fe6e7">rsClearObject</a>(<a class="code" href="structrs__element.html" title="Opaque handle to a Renderscript element.">rs_element</a> *dst);
+<a name="l00096"></a>00096 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00097"></a>00097     <a class="code" href="rs__object_8rsh.html#aab5f47dc11b9044b3d02c4ed818fe6e7">rsClearObject</a>(<a class="code" href="structrs__type.html" title="Opaque handle to a Renderscript type.">rs_type</a> *dst);
+<a name="l00101"></a>00101 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00102"></a>00102     <a class="code" href="rs__object_8rsh.html#aab5f47dc11b9044b3d02c4ed818fe6e7">rsClearObject</a>(<a class="code" href="structrs__allocation.html" title="Opaque handle to a Renderscript allocation.">rs_allocation</a> *dst);
+<a name="l00106"></a>00106 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00107"></a>00107     <a class="code" href="rs__object_8rsh.html#aab5f47dc11b9044b3d02c4ed818fe6e7">rsClearObject</a>(<a class="code" href="structrs__sampler.html" title="Opaque handle to a Renderscript sampler object.">rs_sampler</a> *dst);
+<a name="l00111"></a>00111 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00112"></a>00112     <a class="code" href="rs__object_8rsh.html#aab5f47dc11b9044b3d02c4ed818fe6e7">rsClearObject</a>(<a class="code" href="structrs__script.html" title="Opaque handle to a Renderscript script object.">rs_script</a> *dst);
+<a name="l00116"></a>00116 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00117"></a>00117     <a class="code" href="rs__object_8rsh.html#aab5f47dc11b9044b3d02c4ed818fe6e7">rsClearObject</a>(<a class="code" href="structrs__mesh.html" title="Opaque handle to a Renderscript mesh object.">rs_mesh</a> *dst);
+<a name="l00121"></a>00121 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00122"></a>00122     <a class="code" href="rs__object_8rsh.html#aab5f47dc11b9044b3d02c4ed818fe6e7">rsClearObject</a>(<a class="code" href="structrs__program__fragment.html" title="Opaque handle to a Renderscript ProgramFragment object.">rs_program_fragment</a> *dst);
+<a name="l00126"></a>00126 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00127"></a>00127     <a class="code" href="rs__object_8rsh.html#aab5f47dc11b9044b3d02c4ed818fe6e7">rsClearObject</a>(<a class="code" href="structrs__program__vertex.html" title="Opaque handle to a Renderscript ProgramVertex object.">rs_program_vertex</a> *dst);
+<a name="l00131"></a>00131 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00132"></a>00132     <a class="code" href="rs__object_8rsh.html#aab5f47dc11b9044b3d02c4ed818fe6e7">rsClearObject</a>(<a class="code" href="structrs__program__raster.html" title="Opaque handle to a Renderscript ProgramRaster object.">rs_program_raster</a> *dst);
+<a name="l00136"></a>00136 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00137"></a>00137     <a class="code" href="rs__object_8rsh.html#aab5f47dc11b9044b3d02c4ed818fe6e7">rsClearObject</a>(<a class="code" href="structrs__program__store.html" title="Opaque handle to a Renderscript ProgramStore object.">rs_program_store</a> *dst);
+<a name="l00141"></a>00141 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00142"></a>00142     <a class="code" href="rs__object_8rsh.html#aab5f47dc11b9044b3d02c4ed818fe6e7">rsClearObject</a>(<a class="code" href="structrs__font.html" title="Opaque handle to a Renderscript font object.">rs_font</a> *dst);
+<a name="l00143"></a>00143 
+<a name="l00144"></a>00144 
+<a name="l00145"></a>00145 
+<a name="l00152"></a>00152 extern <span class="keywordtype">bool</span> __attribute__((overloadable))
+<a name="l00153"></a>00153     <a class="code" href="rs__object_8rsh.html#a81f862730b961bd93ac132c24cbc0f82">rsIsObject</a>(<a class="code" href="structrs__element.html" title="Opaque handle to a Renderscript element.">rs_element</a>);
+<a name="l00157"></a>00157 extern <span class="keywordtype">bool</span> __attribute__((overloadable))
+<a name="l00158"></a>00158     <a class="code" href="rs__object_8rsh.html#a81f862730b961bd93ac132c24cbc0f82">rsIsObject</a>(<a class="code" href="structrs__type.html" title="Opaque handle to a Renderscript type.">rs_type</a>);
+<a name="l00162"></a>00162 extern <span class="keywordtype">bool</span> __attribute__((overloadable))
+<a name="l00163"></a>00163     <a class="code" href="rs__object_8rsh.html#a81f862730b961bd93ac132c24cbc0f82">rsIsObject</a>(<a class="code" href="structrs__allocation.html" title="Opaque handle to a Renderscript allocation.">rs_allocation</a>);
+<a name="l00167"></a>00167 extern <span class="keywordtype">bool</span> __attribute__((overloadable))
+<a name="l00168"></a>00168     <a class="code" href="rs__object_8rsh.html#a81f862730b961bd93ac132c24cbc0f82">rsIsObject</a>(<a class="code" href="structrs__sampler.html" title="Opaque handle to a Renderscript sampler object.">rs_sampler</a>);
+<a name="l00172"></a>00172 extern <span class="keywordtype">bool</span> __attribute__((overloadable))
+<a name="l00173"></a>00173     <a class="code" href="rs__object_8rsh.html#a81f862730b961bd93ac132c24cbc0f82">rsIsObject</a>(<a class="code" href="structrs__script.html" title="Opaque handle to a Renderscript script object.">rs_script</a>);
+<a name="l00177"></a>00177 extern <span class="keywordtype">bool</span> __attribute__((overloadable))
+<a name="l00178"></a>00178     <a class="code" href="rs__object_8rsh.html#a81f862730b961bd93ac132c24cbc0f82">rsIsObject</a>(<a class="code" href="structrs__mesh.html" title="Opaque handle to a Renderscript mesh object.">rs_mesh</a>);
+<a name="l00182"></a>00182 extern <span class="keywordtype">bool</span> __attribute__((overloadable))
+<a name="l00183"></a>00183     <a class="code" href="rs__object_8rsh.html#a81f862730b961bd93ac132c24cbc0f82">rsIsObject</a>(<a class="code" href="structrs__program__fragment.html" title="Opaque handle to a Renderscript ProgramFragment object.">rs_program_fragment</a>);
+<a name="l00187"></a>00187 extern <span class="keywordtype">bool</span> __attribute__((overloadable))
+<a name="l00188"></a>00188     <a class="code" href="rs__object_8rsh.html#a81f862730b961bd93ac132c24cbc0f82">rsIsObject</a>(<a class="code" href="structrs__program__vertex.html" title="Opaque handle to a Renderscript ProgramVertex object.">rs_program_vertex</a>);
+<a name="l00192"></a>00192 extern <span class="keywordtype">bool</span> __attribute__((overloadable))
+<a name="l00193"></a>00193     <a class="code" href="rs__object_8rsh.html#a81f862730b961bd93ac132c24cbc0f82">rsIsObject</a>(<a class="code" href="structrs__program__raster.html" title="Opaque handle to a Renderscript ProgramRaster object.">rs_program_raster</a>);
+<a name="l00197"></a>00197 extern <span class="keywordtype">bool</span> __attribute__((overloadable))
+<a name="l00198"></a>00198     <a class="code" href="rs__object_8rsh.html#a81f862730b961bd93ac132c24cbc0f82">rsIsObject</a>(<a class="code" href="structrs__program__store.html" title="Opaque handle to a Renderscript ProgramStore object.">rs_program_store</a>);
+<a name="l00202"></a>00202 extern <span class="keywordtype">bool</span> __attribute__((overloadable))
+<a name="l00203"></a>00203     <a class="code" href="rs__object_8rsh.html#a81f862730b961bd93ac132c24cbc0f82">rsIsObject</a>(<a class="code" href="structrs__font.html" title="Opaque handle to a Renderscript font object.">rs_font</a>);
+<a name="l00204"></a>00204 
+<a name="l00205"></a>00205 <span class="preprocessor">#endif</span>
+</pre></div></div>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/rs__quaternion_8rsh.html b/docs/html/reference/renderscript/rs__quaternion_8rsh.html
new file mode 100644
index 0000000..bd6979c
--- /dev/null
+++ b/docs/html/reference/renderscript/rs__quaternion_8rsh.html
@@ -0,0 +1,556 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_quaternion.rsh File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="summary">
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_quaternion.rsh File Reference</div>  </div>
+</div>
+<div class="contents">
+<table class="memberdecls">
+<tr><td colspan="2"><h2><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__quaternion_8rsh.html#a5ff868dbc33e710a666a102fdcc6670a">rsQuaternionSet</a> (<a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q, float w, float x, float y, float z)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__quaternion_8rsh.html#a249782133e54f13a8096d1fbe295714d">rsQuaternionSet</a> (<a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q, const <a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *rhs)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__quaternion_8rsh.html#a4f3d214912facf72f6a6d57e95aa3c3b">rsQuaternionMultiply</a> (<a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q, float s)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__quaternion_8rsh.html#a5e6e493b9917336b0d9118fdd4e91444">rsQuaternionAdd</a> (<a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q, const <a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *rhs)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__quaternion_8rsh.html#aa72a43cf3d7b5924de1ddfaa5766db09">rsQuaternionLoadRotateUnit</a> (<a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q, float rot, float x, float y, float z)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__quaternion_8rsh.html#adf4423c521e34f3cf29d5dd5b5a93de0">rsQuaternionLoadRotate</a> (<a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q, float rot, float x, float y, float z)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__quaternion_8rsh.html#acd670264e49743d35f38028b8e2a8800">rsQuaternionConjugate</a> (<a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">static float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__quaternion_8rsh.html#aa810f8857439564e7b3be771f47b40ca">rsQuaternionDot</a> (const <a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q0, const <a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q1)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__quaternion_8rsh.html#abb31aad2416044ad5bbf44ee7c838e2a">rsQuaternionNormalize</a> (<a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__quaternion_8rsh.html#a8bbbb286a2e2cb71b416c053f44844c3">rsQuaternionMultiply</a> (<a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q, const <a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *rhs)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__quaternion_8rsh.html#a7da94a30e287cbb8148771a5cd768dbd">rsQuaternionSlerp</a> (<a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q, const <a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q0, const <a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q1, float t)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__quaternion_8rsh.html#a7726c524868c49892976fec53ea0693b">rsQuaternionGetMatrixUnit</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, const <a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q)</td></tr>
+</table>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>Quaternion routines. </p>
+
+<p>Definition in file <a class="el" href="rs__quaternion_8rsh_source.html">rs_quaternion.rsh</a>.</p>
+</div><hr/><h2>Function Documentation</h2>
+<a class="anchor" id="a5e6e493b9917336b0d9118fdd4e91444"></a><!-- doxytag: member="rs_quaternion.rsh::rsQuaternionAdd" ref="a5e6e493b9917336b0d9118fdd4e91444" args="(rs_quaternion *q, const rs_quaternion *rhs)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">static void rsQuaternionAdd </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *&#160;</td>
+          <td class="paramname"><em>q</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *&#160;</td>
+          <td class="paramname"><em>rhs</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td><code> [static]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Add two quaternions </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">q</td><td>destination quaternion to add to </td></tr>
+    <tr><td class="paramname">rsh</td><td>right hand side quaternion to add </td></tr>
+  </table>
+  </dd>
+</dl>
+
+<p>Definition at line <a class="el" href="rs__quaternion_8rsh_source.html#l00074">74</a> of file <a class="el" href="rs__quaternion_8rsh_source.html">rs_quaternion.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="acd670264e49743d35f38028b8e2a8800"></a><!-- doxytag: member="rs_quaternion.rsh::rsQuaternionConjugate" ref="acd670264e49743d35f38028b8e2a8800" args="(rs_quaternion *q)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">static void rsQuaternionConjugate </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *&#160;</td>
+          <td class="paramname"><em>q</em></td><td>)</td>
+          <td><code> [static]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Conjugates the quaternion </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">q</td><td>quaternion to conjugate </td></tr>
+  </table>
+  </dd>
+</dl>
+
+<p>Definition at line <a class="el" href="rs__quaternion_8rsh_source.html#l00127">127</a> of file <a class="el" href="rs__quaternion_8rsh_source.html">rs_quaternion.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="aa810f8857439564e7b3be771f47b40ca"></a><!-- doxytag: member="rs_quaternion.rsh::rsQuaternionDot" ref="aa810f8857439564e7b3be771f47b40ca" args="(const rs_quaternion *q0, const rs_quaternion *q1)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">static float rsQuaternionDot </td>
+          <td>(</td>
+          <td class="paramtype">const <a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *&#160;</td>
+          <td class="paramname"><em>q0</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *&#160;</td>
+          <td class="paramname"><em>q1</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td><code> [static]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Dot product of two quaternions </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">q0</td><td>first quaternion </td></tr>
+    <tr><td class="paramname">q1</td><td>second quaternion </td></tr>
+  </table>
+  </dd>
+</dl>
+<dl class="return"><dt><b>Returns:</b></dt><dd>dot product between q0 and q1 </dd></dl>
+
+<p>Definition at line <a class="el" href="rs__quaternion_8rsh_source.html#l00140">140</a> of file <a class="el" href="rs__quaternion_8rsh_source.html">rs_quaternion.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a7726c524868c49892976fec53ea0693b"></a><!-- doxytag: member="rs_quaternion.rsh::rsQuaternionGetMatrixUnit" ref="a7726c524868c49892976fec53ea0693b" args="(rs_matrix4x4 *m, const rs_quaternion *q)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">static void rsQuaternionGetMatrixUnit </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
+          <td class="paramname"><em>m</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *&#160;</td>
+          <td class="paramname"><em>q</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td><code> [static]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Computes rotation matrix from the normalized quaternion </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">m</td><td>resulting matrix </td></tr>
+    <tr><td class="paramname">p</td><td>normalized quaternion </td></tr>
+  </table>
+  </dd>
+</dl>
+
+<p>Definition at line <a class="el" href="rs__quaternion_8rsh_source.html#l00228">228</a> of file <a class="el" href="rs__quaternion_8rsh_source.html">rs_quaternion.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="adf4423c521e34f3cf29d5dd5b5a93de0"></a><!-- doxytag: member="rs_quaternion.rsh::rsQuaternionLoadRotate" ref="adf4423c521e34f3cf29d5dd5b5a93de0" args="(rs_quaternion *q, float rot, float x, float y, float z)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">static void rsQuaternionLoadRotate </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *&#160;</td>
+          <td class="paramname"><em>q</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>rot</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>z</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td><code> [static]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Loads a quaternion that represents a rotation about an arbitrary vector (doesn't have to be unit) </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">q</td><td>quaternion to set </td></tr>
+    <tr><td class="paramname">rot</td><td>angle to rotate by </td></tr>
+    <tr><td class="paramname">x</td><td>component of a vector </td></tr>
+    <tr><td class="paramname">y</td><td>component of a vector </td></tr>
+    <tr><td class="paramname">x</td><td>component of a vector </td></tr>
+  </table>
+  </dd>
+</dl>
+
+<p>Definition at line <a class="el" href="rs__quaternion_8rsh_source.html#l00111">111</a> of file <a class="el" href="rs__quaternion_8rsh_source.html">rs_quaternion.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="aa72a43cf3d7b5924de1ddfaa5766db09"></a><!-- doxytag: member="rs_quaternion.rsh::rsQuaternionLoadRotateUnit" ref="aa72a43cf3d7b5924de1ddfaa5766db09" args="(rs_quaternion *q, float rot, float x, float y, float z)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">static void rsQuaternionLoadRotateUnit </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *&#160;</td>
+          <td class="paramname"><em>q</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>rot</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>z</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td><code> [static]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Loads a quaternion that represents a rotation about an arbitrary unit vector </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">q</td><td>quaternion to set </td></tr>
+    <tr><td class="paramname">rot</td><td>angle to rotate by </td></tr>
+    <tr><td class="paramname">x</td><td>component of a vector </td></tr>
+    <tr><td class="paramname">y</td><td>component of a vector </td></tr>
+    <tr><td class="paramname">x</td><td>component of a vector </td></tr>
+  </table>
+  </dd>
+</dl>
+
+<p>Definition at line <a class="el" href="rs__quaternion_8rsh_source.html#l00090">90</a> of file <a class="el" href="rs__quaternion_8rsh_source.html">rs_quaternion.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a4f3d214912facf72f6a6d57e95aa3c3b"></a><!-- doxytag: member="rs_quaternion.rsh::rsQuaternionMultiply" ref="a4f3d214912facf72f6a6d57e95aa3c3b" args="(rs_quaternion *q, float s)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">static void rsQuaternionMultiply </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *&#160;</td>
+          <td class="paramname"><em>q</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>s</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td><code> [static]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Multiply quaternion by a scalar </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">q</td><td>quaternion to multiply </td></tr>
+    <tr><td class="paramname">s</td><td>scalar </td></tr>
+  </table>
+  </dd>
+</dl>
+
+<p>Definition at line <a class="el" href="rs__quaternion_8rsh_source.html#l00061">61</a> of file <a class="el" href="rs__quaternion_8rsh_source.html">rs_quaternion.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a8bbbb286a2e2cb71b416c053f44844c3"></a><!-- doxytag: member="rs_quaternion.rsh::rsQuaternionMultiply" ref="a8bbbb286a2e2cb71b416c053f44844c3" args="(rs_quaternion *q, const rs_quaternion *rhs)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">static void rsQuaternionMultiply </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *&#160;</td>
+          <td class="paramname"><em>q</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *&#160;</td>
+          <td class="paramname"><em>rhs</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td><code> [static]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Multiply quaternion by another quaternion </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">q</td><td>destination quaternion </td></tr>
+    <tr><td class="paramname">rhs</td><td>right hand side quaternion to multiply by </td></tr>
+  </table>
+  </dd>
+</dl>
+
+<p>Definition at line <a class="el" href="rs__quaternion_8rsh_source.html#l00163">163</a> of file <a class="el" href="rs__quaternion_8rsh_source.html">rs_quaternion.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="abb31aad2416044ad5bbf44ee7c838e2a"></a><!-- doxytag: member="rs_quaternion.rsh::rsQuaternionNormalize" ref="abb31aad2416044ad5bbf44ee7c838e2a" args="(rs_quaternion *q)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">static void rsQuaternionNormalize </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *&#160;</td>
+          <td class="paramname"><em>q</em></td><td>)</td>
+          <td><code> [static]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Normalizes the quaternion </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">q</td><td>quaternion to normalize </td></tr>
+  </table>
+  </dd>
+</dl>
+
+<p>Definition at line <a class="el" href="rs__quaternion_8rsh_source.html#l00149">149</a> of file <a class="el" href="rs__quaternion_8rsh_source.html">rs_quaternion.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a5ff868dbc33e710a666a102fdcc6670a"></a><!-- doxytag: member="rs_quaternion.rsh::rsQuaternionSet" ref="a5ff868dbc33e710a666a102fdcc6670a" args="(rs_quaternion *q, float w, float x, float y, float z)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">static void rsQuaternionSet </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *&#160;</td>
+          <td class="paramname"><em>q</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>w</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>x</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>y</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>z</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td><code> [static]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Set the quaternion components </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">w</td><td>component </td></tr>
+    <tr><td class="paramname">x</td><td>component </td></tr>
+    <tr><td class="paramname">y</td><td>component </td></tr>
+    <tr><td class="paramname">z</td><td>component </td></tr>
+  </table>
+  </dd>
+</dl>
+
+<p>Definition at line <a class="el" href="rs__quaternion_8rsh_source.html#l00035">35</a> of file <a class="el" href="rs__quaternion_8rsh_source.html">rs_quaternion.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a249782133e54f13a8096d1fbe295714d"></a><!-- doxytag: member="rs_quaternion.rsh::rsQuaternionSet" ref="a249782133e54f13a8096d1fbe295714d" args="(rs_quaternion *q, const rs_quaternion *rhs)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">static void rsQuaternionSet </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *&#160;</td>
+          <td class="paramname"><em>q</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *&#160;</td>
+          <td class="paramname"><em>rhs</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td><code> [static]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Set the quaternion from another quaternion </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">q</td><td>destination quaternion </td></tr>
+    <tr><td class="paramname">rhs</td><td>source quaternion </td></tr>
+  </table>
+  </dd>
+</dl>
+
+<p>Definition at line <a class="el" href="rs__quaternion_8rsh_source.html#l00048">48</a> of file <a class="el" href="rs__quaternion_8rsh_source.html">rs_quaternion.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a7da94a30e287cbb8148771a5cd768dbd"></a><!-- doxytag: member="rs_quaternion.rsh::rsQuaternionSlerp" ref="a7da94a30e287cbb8148771a5cd768dbd" args="(rs_quaternion *q, const rs_quaternion *q0, const rs_quaternion *q1, float t)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">static void rsQuaternionSlerp </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *&#160;</td>
+          <td class="paramname"><em>q</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *&#160;</td>
+          <td class="paramname"><em>q0</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *&#160;</td>
+          <td class="paramname"><em>q1</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">float&#160;</td>
+          <td class="paramname"><em>t</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td><code> [static]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Performs spherical linear interpolation between two quaternions </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">q</td><td>result quaternion from interpolation </td></tr>
+    <tr><td class="paramname">q0</td><td>first param </td></tr>
+    <tr><td class="paramname">q1</td><td>second param </td></tr>
+    <tr><td class="paramname">t</td><td>how much to interpolate by </td></tr>
+  </table>
+  </dd>
+</dl>
+
+<p>Definition at line <a class="el" href="rs__quaternion_8rsh_source.html#l00182">182</a> of file <a class="el" href="rs__quaternion_8rsh_source.html">rs_quaternion.rsh</a>.</p>
+
+</div>
+</div>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/rs__quaternion_8rsh_source.html b/docs/html/reference/renderscript/rs__quaternion_8rsh_source.html
new file mode 100644
index 0000000..c08565a
--- /dev/null
+++ b/docs/html/reference/renderscript/rs__quaternion_8rsh_source.html
@@ -0,0 +1,211 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_quaternion.rsh Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_quaternion.rsh</div>  </div>
+</div>
+<div class="contents">
+<a href="rs__quaternion_8rsh.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
+<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2011 The Android Open Source Project</span>
+<a name="l00003"></a>00003 <span class="comment"> *</span>
+<a name="l00004"></a>00004 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span>
+<a name="l00005"></a>00005 <span class="comment"> * you may not use this file except in compliance with the License.</span>
+<a name="l00006"></a>00006 <span class="comment"> * You may obtain a copy of the License at</span>
+<a name="l00007"></a>00007 <span class="comment"> *</span>
+<a name="l00008"></a>00008 <span class="comment"> *      http://www.apache.org/licenses/LICENSE-2.0</span>
+<a name="l00009"></a>00009 <span class="comment"> *</span>
+<a name="l00010"></a>00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
+<a name="l00011"></a>00011 <span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span>
+<a name="l00012"></a>00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
+<a name="l00013"></a>00013 <span class="comment"> * See the License for the specific language governing permissions and</span>
+<a name="l00014"></a>00014 <span class="comment"> * limitations under the License.</span>
+<a name="l00015"></a>00015 <span class="comment"> */</span>
+<a name="l00016"></a>00016 
+<a name="l00023"></a>00023 <span class="preprocessor">#ifndef __RS_QUATERNION_RSH__</span>
+<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define __RS_QUATERNION_RSH__</span>
+<a name="l00025"></a>00025 <span class="preprocessor"></span>
+<a name="l00026"></a>00026 
+<a name="l00034"></a>00034 <span class="keyword">static</span> <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00035"></a><a class="code" href="rs__quaternion_8rsh.html#a5ff868dbc33e710a666a102fdcc6670a">00035</a> <a class="code" href="rs__quaternion_8rsh.html#a5ff868dbc33e710a666a102fdcc6670a">rsQuaternionSet</a>(<a class="code" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q, <span class="keywordtype">float</span> w, <span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> z) {
+<a name="l00036"></a>00036     q-&gt;w = w;
+<a name="l00037"></a>00037     q-&gt;x = x;
+<a name="l00038"></a>00038     q-&gt;y = y;
+<a name="l00039"></a>00039     q-&gt;z = z;
+<a name="l00040"></a>00040 }
+<a name="l00041"></a>00041 
+<a name="l00047"></a>00047 <span class="keyword">static</span> <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00048"></a><a class="code" href="rs__quaternion_8rsh.html#a249782133e54f13a8096d1fbe295714d">00048</a> <a class="code" href="rs__quaternion_8rsh.html#a5ff868dbc33e710a666a102fdcc6670a">rsQuaternionSet</a>(<a class="code" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q, const <a class="code" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *rhs) {
+<a name="l00049"></a>00049     q-&gt;w = rhs-&gt;w;
+<a name="l00050"></a>00050     q-&gt;x = rhs-&gt;x;
+<a name="l00051"></a>00051     q-&gt;y = rhs-&gt;y;
+<a name="l00052"></a>00052     q-&gt;z = rhs-&gt;z;
+<a name="l00053"></a>00053 }
+<a name="l00054"></a>00054 
+<a name="l00060"></a>00060 <span class="keyword">static</span> <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00061"></a><a class="code" href="rs__quaternion_8rsh.html#a4f3d214912facf72f6a6d57e95aa3c3b">00061</a> <a class="code" href="rs__quaternion_8rsh.html#a4f3d214912facf72f6a6d57e95aa3c3b">rsQuaternionMultiply</a>(<a class="code" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q, <span class="keywordtype">float</span> s) {
+<a name="l00062"></a>00062     q-&gt;w *= s;
+<a name="l00063"></a>00063     q-&gt;x *= s;
+<a name="l00064"></a>00064     q-&gt;y *= s;
+<a name="l00065"></a>00065     q-&gt;z *= s;
+<a name="l00066"></a>00066 }
+<a name="l00067"></a>00067 
+<a name="l00073"></a>00073 <span class="keyword">static</span> <span class="keywordtype">void</span>
+<a name="l00074"></a><a class="code" href="rs__quaternion_8rsh.html#a5e6e493b9917336b0d9118fdd4e91444">00074</a> <a class="code" href="rs__quaternion_8rsh.html#a5e6e493b9917336b0d9118fdd4e91444">rsQuaternionAdd</a>(<a class="code" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q, <span class="keyword">const</span> <a class="code" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *rhs) {
+<a name="l00075"></a>00075     q-&gt;w *= rhs-&gt;w;
+<a name="l00076"></a>00076     q-&gt;x *= rhs-&gt;x;
+<a name="l00077"></a>00077     q-&gt;y *= rhs-&gt;y;
+<a name="l00078"></a>00078     q-&gt;z *= rhs-&gt;z;
+<a name="l00079"></a>00079 }
+<a name="l00080"></a>00080 
+<a name="l00089"></a>00089 <span class="keyword">static</span> <span class="keywordtype">void</span>
+<a name="l00090"></a><a class="code" href="rs__quaternion_8rsh.html#aa72a43cf3d7b5924de1ddfaa5766db09">00090</a> <a class="code" href="rs__quaternion_8rsh.html#aa72a43cf3d7b5924de1ddfaa5766db09">rsQuaternionLoadRotateUnit</a>(<a class="code" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q, <span class="keywordtype">float</span> rot, <span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> z) {
+<a name="l00091"></a>00091     rot *= (float)(M_PI / 180.0f) * 0.5f;
+<a name="l00092"></a>00092     <span class="keywordtype">float</span> c = <a class="code" href="rs__cl_8rsh.html#a8eec7aeb4b0c46b06cbcd1a3ac3e6f05">cos</a>(rot);
+<a name="l00093"></a>00093     <span class="keywordtype">float</span> s = <a class="code" href="rs__cl_8rsh.html#a8c8cd526b44eb55aede77cf659f24306">sin</a>(rot);
+<a name="l00094"></a>00094 
+<a name="l00095"></a>00095     q-&gt;w = c;
+<a name="l00096"></a>00096     q-&gt;x = x * s;
+<a name="l00097"></a>00097     q-&gt;y = y * s;
+<a name="l00098"></a>00098     q-&gt;z = z * s;
+<a name="l00099"></a>00099 }
+<a name="l00100"></a>00100 
+<a name="l00110"></a>00110 <span class="keyword">static</span> <span class="keywordtype">void</span>
+<a name="l00111"></a><a class="code" href="rs__quaternion_8rsh.html#adf4423c521e34f3cf29d5dd5b5a93de0">00111</a> <a class="code" href="rs__quaternion_8rsh.html#adf4423c521e34f3cf29d5dd5b5a93de0">rsQuaternionLoadRotate</a>(<a class="code" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q, <span class="keywordtype">float</span> rot, <span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> z) {
+<a name="l00112"></a>00112     <span class="keyword">const</span> <span class="keywordtype">float</span> len = x*x + y*y + z*z;
+<a name="l00113"></a>00113     <span class="keywordflow">if</span> (len != 1) {
+<a name="l00114"></a>00114         <span class="keyword">const</span> <span class="keywordtype">float</span> recipLen = 1.f / <a class="code" href="rs__cl_8rsh.html#a92da0faef80c4d8f66e954c8c169a729">sqrt</a>(len);
+<a name="l00115"></a>00115         x *= recipLen;
+<a name="l00116"></a>00116         y *= recipLen;
+<a name="l00117"></a>00117         z *= recipLen;
+<a name="l00118"></a>00118     }
+<a name="l00119"></a>00119     <a class="code" href="rs__quaternion_8rsh.html#aa72a43cf3d7b5924de1ddfaa5766db09">rsQuaternionLoadRotateUnit</a>(q, rot, x, y, z);
+<a name="l00120"></a>00120 }
+<a name="l00121"></a>00121 
+<a name="l00126"></a>00126 <span class="keyword">static</span> <span class="keywordtype">void</span>
+<a name="l00127"></a><a class="code" href="rs__quaternion_8rsh.html#acd670264e49743d35f38028b8e2a8800">00127</a> <a class="code" href="rs__quaternion_8rsh.html#acd670264e49743d35f38028b8e2a8800">rsQuaternionConjugate</a>(<a class="code" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q) {
+<a name="l00128"></a>00128     q-&gt;x = -q-&gt;x;
+<a name="l00129"></a>00129     q-&gt;y = -q-&gt;y;
+<a name="l00130"></a>00130     q-&gt;z = -q-&gt;z;
+<a name="l00131"></a>00131 }
+<a name="l00132"></a>00132 
+<a name="l00139"></a>00139 <span class="keyword">static</span> <span class="keywordtype">float</span>
+<a name="l00140"></a><a class="code" href="rs__quaternion_8rsh.html#aa810f8857439564e7b3be771f47b40ca">00140</a> <a class="code" href="rs__quaternion_8rsh.html#aa810f8857439564e7b3be771f47b40ca">rsQuaternionDot</a>(<span class="keyword">const</span> <a class="code" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q0, <span class="keyword">const</span> <a class="code" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q1) {
+<a name="l00141"></a>00141     <span class="keywordflow">return</span> q0-&gt;w*q1-&gt;w + q0-&gt;x*q1-&gt;x + q0-&gt;y*q1-&gt;y + q0-&gt;z*q1-&gt;z;
+<a name="l00142"></a>00142 }
+<a name="l00143"></a>00143 
+<a name="l00148"></a>00148 <span class="keyword">static</span> <span class="keywordtype">void</span>
+<a name="l00149"></a><a class="code" href="rs__quaternion_8rsh.html#abb31aad2416044ad5bbf44ee7c838e2a">00149</a> <a class="code" href="rs__quaternion_8rsh.html#abb31aad2416044ad5bbf44ee7c838e2a">rsQuaternionNormalize</a>(<a class="code" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q) {
+<a name="l00150"></a>00150     <span class="keyword">const</span> <span class="keywordtype">float</span> len = <a class="code" href="rs__quaternion_8rsh.html#aa810f8857439564e7b3be771f47b40ca">rsQuaternionDot</a>(q, q);
+<a name="l00151"></a>00151     <span class="keywordflow">if</span> (len != 1) {
+<a name="l00152"></a>00152         <span class="keyword">const</span> <span class="keywordtype">float</span> recipLen = 1.f / <a class="code" href="rs__cl_8rsh.html#a92da0faef80c4d8f66e954c8c169a729">sqrt</a>(len);
+<a name="l00153"></a>00153         <a class="code" href="rs__quaternion_8rsh.html#a4f3d214912facf72f6a6d57e95aa3c3b">rsQuaternionMultiply</a>(q, recipLen);
+<a name="l00154"></a>00154     }
+<a name="l00155"></a>00155 }
+<a name="l00156"></a>00156 
+<a name="l00162"></a>00162 <span class="keyword">static</span> <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00163"></a><a class="code" href="rs__quaternion_8rsh.html#a8bbbb286a2e2cb71b416c053f44844c3">00163</a> <a class="code" href="rs__quaternion_8rsh.html#a4f3d214912facf72f6a6d57e95aa3c3b">rsQuaternionMultiply</a>(<a class="code" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q, const <a class="code" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *rhs) {
+<a name="l00164"></a>00164     <a class="code" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> qtmp;
+<a name="l00165"></a>00165     <a class="code" href="rs__quaternion_8rsh.html#a5ff868dbc33e710a666a102fdcc6670a">rsQuaternionSet</a>(&amp;qtmp, q);
+<a name="l00166"></a>00166 
+<a name="l00167"></a>00167     q-&gt;w = qtmp.w*rhs-&gt;w - qtmp.x*rhs-&gt;x - qtmp.y*rhs-&gt;y - qtmp.z*rhs-&gt;z;
+<a name="l00168"></a>00168     q-&gt;x = qtmp.w*rhs-&gt;x + qtmp.x*rhs-&gt;w + qtmp.y*rhs-&gt;z - qtmp.z*rhs-&gt;y;
+<a name="l00169"></a>00169     q-&gt;y = qtmp.w*rhs-&gt;y + qtmp.y*rhs-&gt;w + qtmp.z*rhs-&gt;x - qtmp.x*rhs-&gt;z;
+<a name="l00170"></a>00170     q-&gt;z = qtmp.w*rhs-&gt;z + qtmp.z*rhs-&gt;w + qtmp.x*rhs-&gt;y - qtmp.y*rhs-&gt;x;
+<a name="l00171"></a>00171     <a class="code" href="rs__quaternion_8rsh.html#abb31aad2416044ad5bbf44ee7c838e2a">rsQuaternionNormalize</a>(q);
+<a name="l00172"></a>00172 }
+<a name="l00173"></a>00173 
+<a name="l00181"></a>00181 <span class="keyword">static</span> <span class="keywordtype">void</span>
+<a name="l00182"></a><a class="code" href="rs__quaternion_8rsh.html#a7da94a30e287cbb8148771a5cd768dbd">00182</a> <a class="code" href="rs__quaternion_8rsh.html#a7da94a30e287cbb8148771a5cd768dbd">rsQuaternionSlerp</a>(<a class="code" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q, <span class="keyword">const</span> <a class="code" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q0, <span class="keyword">const</span> <a class="code" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q1, <span class="keywordtype">float</span> t) {
+<a name="l00183"></a>00183     <span class="keywordflow">if</span> (t &lt;= 0.0f) {
+<a name="l00184"></a>00184         <a class="code" href="rs__quaternion_8rsh.html#a5ff868dbc33e710a666a102fdcc6670a">rsQuaternionSet</a>(q, q0);
+<a name="l00185"></a>00185         <span class="keywordflow">return</span>;
+<a name="l00186"></a>00186     }
+<a name="l00187"></a>00187     <span class="keywordflow">if</span> (t &gt;= 1.0f) {
+<a name="l00188"></a>00188         <a class="code" href="rs__quaternion_8rsh.html#a5ff868dbc33e710a666a102fdcc6670a">rsQuaternionSet</a>(q, q1);
+<a name="l00189"></a>00189         <span class="keywordflow">return</span>;
+<a name="l00190"></a>00190     }
+<a name="l00191"></a>00191 
+<a name="l00192"></a>00192     <a class="code" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> tempq0, tempq1;
+<a name="l00193"></a>00193     <a class="code" href="rs__quaternion_8rsh.html#a5ff868dbc33e710a666a102fdcc6670a">rsQuaternionSet</a>(&amp;tempq0, q0);
+<a name="l00194"></a>00194     <a class="code" href="rs__quaternion_8rsh.html#a5ff868dbc33e710a666a102fdcc6670a">rsQuaternionSet</a>(&amp;tempq1, q1);
+<a name="l00195"></a>00195 
+<a name="l00196"></a>00196     <span class="keywordtype">float</span> angle = <a class="code" href="rs__quaternion_8rsh.html#aa810f8857439564e7b3be771f47b40ca">rsQuaternionDot</a>(q0, q1);
+<a name="l00197"></a>00197     <span class="keywordflow">if</span> (angle &lt; 0) {
+<a name="l00198"></a>00198         <a class="code" href="rs__quaternion_8rsh.html#a4f3d214912facf72f6a6d57e95aa3c3b">rsQuaternionMultiply</a>(&amp;tempq0, -1.0f);
+<a name="l00199"></a>00199         angle *= -1.0f;
+<a name="l00200"></a>00200     }
+<a name="l00201"></a>00201 
+<a name="l00202"></a>00202     <span class="keywordtype">float</span> scale, invScale;
+<a name="l00203"></a>00203     <span class="keywordflow">if</span> (angle + 1.0f &gt; 0.05f) {
+<a name="l00204"></a>00204         <span class="keywordflow">if</span> (1.0f - angle &gt;= 0.05f) {
+<a name="l00205"></a>00205             <span class="keywordtype">float</span> theta = <a class="code" href="rs__cl_8rsh.html#a07648648c7f857cfd1479821d4389751">acos</a>(angle);
+<a name="l00206"></a>00206             <span class="keywordtype">float</span> invSinTheta = 1.0f / <a class="code" href="rs__cl_8rsh.html#a8c8cd526b44eb55aede77cf659f24306">sin</a>(theta);
+<a name="l00207"></a>00207             scale = <a class="code" href="rs__cl_8rsh.html#a8c8cd526b44eb55aede77cf659f24306">sin</a>(theta * (1.0f - t)) * invSinTheta;
+<a name="l00208"></a>00208             invScale = <a class="code" href="rs__cl_8rsh.html#a8c8cd526b44eb55aede77cf659f24306">sin</a>(theta * t) * invSinTheta;
+<a name="l00209"></a>00209         } <span class="keywordflow">else</span> {
+<a name="l00210"></a>00210             scale = 1.0f - t;
+<a name="l00211"></a>00211             invScale = t;
+<a name="l00212"></a>00212         }
+<a name="l00213"></a>00213     } <span class="keywordflow">else</span> {
+<a name="l00214"></a>00214         <a class="code" href="rs__quaternion_8rsh.html#a5ff868dbc33e710a666a102fdcc6670a">rsQuaternionSet</a>(&amp;tempq1, tempq0.z, -tempq0.y, tempq0.x, -tempq0.w);
+<a name="l00215"></a>00215         scale = <a class="code" href="rs__cl_8rsh.html#a8c8cd526b44eb55aede77cf659f24306">sin</a>(M_PI * (0.5f - t));
+<a name="l00216"></a>00216         invScale = <a class="code" href="rs__cl_8rsh.html#a8c8cd526b44eb55aede77cf659f24306">sin</a>(M_PI * t);
+<a name="l00217"></a>00217     }
+<a name="l00218"></a>00218 
+<a name="l00219"></a>00219     <a class="code" href="rs__quaternion_8rsh.html#a5ff868dbc33e710a666a102fdcc6670a">rsQuaternionSet</a>(q, tempq0.w*scale + tempq1.w*invScale, tempq0.x*scale + tempq1.x*invScale,
+<a name="l00220"></a>00220                         tempq0.y*scale + tempq1.y*invScale, tempq0.z*scale + tempq1.z*invScale);
+<a name="l00221"></a>00221 }
+<a name="l00222"></a>00222 
+<a name="l00228"></a><a class="code" href="rs__quaternion_8rsh.html#a7726c524868c49892976fec53ea0693b">00228</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="rs__quaternion_8rsh.html#a7726c524868c49892976fec53ea0693b">rsQuaternionGetMatrixUnit</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <span class="keyword">const</span> <a class="code" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a> *q) {
+<a name="l00229"></a>00229     <span class="keywordtype">float</span> xx = q-&gt;x * q-&gt;x;
+<a name="l00230"></a>00230     <span class="keywordtype">float</span> xy = q-&gt;x * q-&gt;y;
+<a name="l00231"></a>00231     <span class="keywordtype">float</span> xz = q-&gt;x * q-&gt;z;
+<a name="l00232"></a>00232     <span class="keywordtype">float</span> xw = q-&gt;x * q-&gt;w;
+<a name="l00233"></a>00233     <span class="keywordtype">float</span> yy = q-&gt;y * q-&gt;y;
+<a name="l00234"></a>00234     <span class="keywordtype">float</span> yz = q-&gt;y * q-&gt;z;
+<a name="l00235"></a>00235     <span class="keywordtype">float</span> yw = q-&gt;y * q-&gt;w;
+<a name="l00236"></a>00236     <span class="keywordtype">float</span> zz = q-&gt;z * q-&gt;z;
+<a name="l00237"></a>00237     <span class="keywordtype">float</span> zw = q-&gt;z * q-&gt;w;
+<a name="l00238"></a>00238 
+<a name="l00239"></a>00239     m-&gt;m[0]  = 1.0f - 2.0f * ( yy + zz );
+<a name="l00240"></a>00240     m-&gt;m[4]  =        2.0f * ( xy - zw );
+<a name="l00241"></a>00241     m-&gt;m[8]  =        2.0f * ( xz + yw );
+<a name="l00242"></a>00242     m-&gt;m[1]  =        2.0f * ( xy + zw );
+<a name="l00243"></a>00243     m-&gt;m[5]  = 1.0f - 2.0f * ( xx + zz );
+<a name="l00244"></a>00244     m-&gt;m[9]  =        2.0f * ( yz - xw );
+<a name="l00245"></a>00245     m-&gt;m[2]  =        2.0f * ( xz - yw );
+<a name="l00246"></a>00246     m-&gt;m[6]  =        2.0f * ( yz + xw );
+<a name="l00247"></a>00247     m-&gt;m[10] = 1.0f - 2.0f * ( xx + yy );
+<a name="l00248"></a>00248     m-&gt;m[3]  = m-&gt;m[7] = m-&gt;m[11] = m-&gt;m[12] = m-&gt;m[13] = m-&gt;m[14] = 0.0f;
+<a name="l00249"></a>00249     m-&gt;m[15] = 1.0f;
+<a name="l00250"></a>00250 }
+<a name="l00251"></a>00251 
+<a name="l00252"></a>00252 <span class="preprocessor">#endif</span>
+<a name="l00253"></a>00253 <span class="preprocessor"></span>
+</pre></div></div>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/rs__time_8rsh.html b/docs/html/reference/renderscript/rs__time_8rsh.html
new file mode 100644
index 0000000..34ac9cd
--- /dev/null
+++ b/docs/html/reference/renderscript/rs__time_8rsh.html
@@ -0,0 +1,194 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_time.rsh File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="summary">
+<a href="#nested-classes">Data Structures</a> &#124;
+<a href="#typedef-members">Typedefs</a> &#124;
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_time.rsh File Reference</div>  </div>
+</div>
+<div class="contents">
+<table class="memberdecls">
+<tr><td colspan="2"><h2><a name="nested-classes"></a>
+Data Structures</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrs__tm.html">rs_tm</a></td></tr>
+<tr><td colspan="2"><h2><a name="typedef-members"></a>
+Typedefs</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__time_8rsh.html#ad2b4759a0a6a98bd79b7ad82a4b057d6">rs_time_t</a></td></tr>
+<tr><td colspan="2"><h2><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="rs__time_8rsh.html#ad2b4759a0a6a98bd79b7ad82a4b057d6">rs_time_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__time_8rsh.html#a555f9324acb8c3d0c6f09a1d05478ce2">rsTime</a> (<a class="el" href="rs__time_8rsh.html#ad2b4759a0a6a98bd79b7ad82a4b057d6">rs_time_t</a> *timer)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structrs__tm.html">rs_tm</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__time_8rsh.html#a08a8fcadae964f7416aef487da624110">rsLocaltime</a> (<a class="el" href="structrs__tm.html">rs_tm</a> *local, const <a class="el" href="rs__time_8rsh.html#ad2b4759a0a6a98bd79b7ad82a4b057d6">rs_time_t</a> *timer)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="rs__types_8rsh.html#a996e72f71b11a5bb8b3b7b6936b1516d">int64_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__time_8rsh.html#a3c406e51a769718dd1c760518b9cad44">rsUptimeMillis</a> (void)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="rs__types_8rsh.html#a996e72f71b11a5bb8b3b7b6936b1516d">int64_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__time_8rsh.html#a24e2cc12acf1e7fdd857d1a48981395d">rsUptimeNanos</a> (void)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__time_8rsh.html#adea2682186fd903752431ad848bd8bf4">rsGetDt</a> (void)</td></tr>
+</table>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>Renderscript time routines. </p>
+<p>This file contains Renderscript functions relating to time and date manipulation. </p>
+
+<p>Definition in file <a class="el" href="rs__time_8rsh_source.html">rs_time.rsh</a>.</p>
+</div><hr/><h2>Typedef Documentation</h2>
+<a class="anchor" id="ad2b4759a0a6a98bd79b7ad82a4b057d6"></a><!-- doxytag: member="rs_time.rsh::rs_time_t" ref="ad2b4759a0a6a98bd79b7ad82a4b057d6" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef int <a class="el" href="rs__time_8rsh.html#ad2b4759a0a6a98bd79b7ad82a4b057d6">rs_time_t</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Calendar time interpreted as seconds elapsed since the Epoch (00:00:00 on January 1, 1970, Coordinated Universal Time (UTC)). </p>
+
+<p>Definition at line <a class="el" href="rs__time_8rsh_source.html#l00031">31</a> of file <a class="el" href="rs__time_8rsh_source.html">rs_time.rsh</a>.</p>
+
+</div>
+</div>
+<hr/><h2>Function Documentation</h2>
+<a class="anchor" id="adea2682186fd903752431ad848bd8bf4"></a><!-- doxytag: member="rs_time.rsh::rsGetDt" ref="adea2682186fd903752431ad848bd8bf4" args="(void)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">float rsGetDt </td>
+          <td>(</td>
+          <td class="paramtype">void&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Returns the time in seconds since this function was last called in this script.</p>
+<dl class="return"><dt><b>Returns:</b></dt><dd>Time in seconds. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a08a8fcadae964f7416aef487da624110"></a><!-- doxytag: member="rs_time.rsh::rsLocaltime" ref="a08a8fcadae964f7416aef487da624110" args="(rs_tm *local, const rs_time_t *timer)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="structrs__tm.html">rs_tm</a>* rsLocaltime </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="structrs__tm.html">rs_tm</a> *&#160;</td>
+          <td class="paramname"><em>local</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="rs__time_8rsh.html#ad2b4759a0a6a98bd79b7ad82a4b057d6">rs_time_t</a> *&#160;</td>
+          <td class="paramname"><em>timer</em>&#160;</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Converts the time specified by <code>timer</code> into broken-down time and stores it in <code>local</code>. This function also returns a pointer to <code>local</code>. If <code>local</code> is NULL, this function does nothing and returns NULL.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">local</td><td>Broken-down time. </td></tr>
+    <tr><td class="paramname">timer</td><td>Input time as calendar time.</td></tr>
+  </table>
+  </dd>
+</dl>
+<dl class="return"><dt><b>Returns:</b></dt><dd>Pointer to broken-down time (same as input <code>local</code>). </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a555f9324acb8c3d0c6f09a1d05478ce2"></a><!-- doxytag: member="rs_time.rsh::rsTime" ref="a555f9324acb8c3d0c6f09a1d05478ce2" args="(rs_time_t *timer)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="rs__time_8rsh.html#ad2b4759a0a6a98bd79b7ad82a4b057d6">rs_time_t</a> rsTime </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="rs__time_8rsh.html#ad2b4759a0a6a98bd79b7ad82a4b057d6">rs_time_t</a> *&#160;</td>
+          <td class="paramname"><em>timer</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Returns the number of seconds since the Epoch (00:00:00 UTC, January 1, 1970). If <code>timer</code> is non-NULL, the result is also stored in the memory pointed to by this variable. If an error occurs, a value of -1 is returned.</p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">timer</td><td>Location to also store the returned calendar time.</td></tr>
+  </table>
+  </dd>
+</dl>
+<dl class="return"><dt><b>Returns:</b></dt><dd>Seconds since the Epoch. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a3c406e51a769718dd1c760518b9cad44"></a><!-- doxytag: member="rs_time.rsh::rsUptimeMillis" ref="a3c406e51a769718dd1c760518b9cad44" args="(void)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="rs__types_8rsh.html#a996e72f71b11a5bb8b3b7b6936b1516d">int64_t</a> rsUptimeMillis </td>
+          <td>(</td>
+          <td class="paramtype">void&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Returns the current system clock (uptime) in milliseconds.</p>
+<dl class="return"><dt><b>Returns:</b></dt><dd>Uptime in milliseconds. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a24e2cc12acf1e7fdd857d1a48981395d"></a><!-- doxytag: member="rs_time.rsh::rsUptimeNanos" ref="a24e2cc12acf1e7fdd857d1a48981395d" args="(void)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="rs__types_8rsh.html#a996e72f71b11a5bb8b3b7b6936b1516d">int64_t</a> rsUptimeNanos </td>
+          <td>(</td>
+          <td class="paramtype">void&#160;</td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Returns the current system clock (uptime) in nanoseconds.</p>
+<dl class="return"><dt><b>Returns:</b></dt><dd>Uptime in nanoseconds. </dd></dl>
+
+</div>
+</div>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/rs__time_8rsh_source.html b/docs/html/reference/renderscript/rs__time_8rsh_source.html
new file mode 100644
index 0000000..1c5c74b
--- /dev/null
+++ b/docs/html/reference/renderscript/rs__time_8rsh_source.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_time.rsh Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_time.rsh</div>  </div>
+</div>
+<div class="contents">
+<a href="rs__time_8rsh.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
+<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2011 The Android Open Source Project</span>
+<a name="l00003"></a>00003 <span class="comment"> *</span>
+<a name="l00004"></a>00004 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span>
+<a name="l00005"></a>00005 <span class="comment"> * you may not use this file except in compliance with the License.</span>
+<a name="l00006"></a>00006 <span class="comment"> * You may obtain a copy of the License at</span>
+<a name="l00007"></a>00007 <span class="comment"> *</span>
+<a name="l00008"></a>00008 <span class="comment"> *      http://www.apache.org/licenses/LICENSE-2.0</span>
+<a name="l00009"></a>00009 <span class="comment"> *</span>
+<a name="l00010"></a>00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
+<a name="l00011"></a>00011 <span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span>
+<a name="l00012"></a>00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
+<a name="l00013"></a>00013 <span class="comment"> * See the License for the specific language governing permissions and</span>
+<a name="l00014"></a>00014 <span class="comment"> * limitations under the License.</span>
+<a name="l00015"></a>00015 <span class="comment"> */</span>
+<a name="l00016"></a>00016 
+<a name="l00024"></a>00024 <span class="preprocessor">#ifndef __RS_TIME_RSH__</span>
+<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#define __RS_TIME_RSH__</span>
+<a name="l00026"></a>00026 <span class="preprocessor"></span>
+<a name="l00031"></a><a class="code" href="rs__time_8rsh.html#ad2b4759a0a6a98bd79b7ad82a4b057d6">00031</a> <span class="keyword">typedef</span> <span class="keywordtype">int</span> <a class="code" href="rs__time_8rsh.html#ad2b4759a0a6a98bd79b7ad82a4b057d6">rs_time_t</a>;
+<a name="l00032"></a>00032 
+<a name="l00049"></a><a class="code" href="structrs__tm.html">00049</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{
+<a name="l00050"></a><a class="code" href="structrs__tm.html#ae1590aa8850370a4712da801edb8da9e">00050</a>     <span class="keywordtype">int</span> <a class="code" href="structrs__tm.html#ae1590aa8850370a4712da801edb8da9e" title="seconds">tm_sec</a>;     
+<a name="l00051"></a><a class="code" href="structrs__tm.html#abd4bd6ccf0d1f20859ecaecf850ce85b">00051</a>     <span class="keywordtype">int</span> <a class="code" href="structrs__tm.html#abd4bd6ccf0d1f20859ecaecf850ce85b" title="minutes">tm_min</a>;     
+<a name="l00052"></a><a class="code" href="structrs__tm.html#afb46962bc20f8724567981adc3711b5a">00052</a>     <span class="keywordtype">int</span> <a class="code" href="structrs__tm.html#afb46962bc20f8724567981adc3711b5a" title="hours">tm_hour</a>;    
+<a name="l00053"></a><a class="code" href="structrs__tm.html#ac87e43828f05bf62d0c770889b81ff15">00053</a>     <span class="keywordtype">int</span> <a class="code" href="structrs__tm.html#ac87e43828f05bf62d0c770889b81ff15" title="day of the month">tm_mday</a>;    
+<a name="l00054"></a><a class="code" href="structrs__tm.html#a34a5466d376e405f343ed4e1592d7832">00054</a>     <span class="keywordtype">int</span> <a class="code" href="structrs__tm.html#a34a5466d376e405f343ed4e1592d7832" title="month">tm_mon</a>;     
+<a name="l00055"></a><a class="code" href="structrs__tm.html#a74e582a615a448949969a0982d8a62d2">00055</a>     <span class="keywordtype">int</span> <a class="code" href="structrs__tm.html#a74e582a615a448949969a0982d8a62d2" title="year">tm_year</a>;    
+<a name="l00056"></a><a class="code" href="structrs__tm.html#a4d40217d3cd15b51e0093db1810426e4">00056</a>     <span class="keywordtype">int</span> <a class="code" href="structrs__tm.html#a4d40217d3cd15b51e0093db1810426e4" title="day of the week">tm_wday</a>;    
+<a name="l00057"></a><a class="code" href="structrs__tm.html#a589eab24c4d79f05f0b3601162ed34d0">00057</a>     <span class="keywordtype">int</span> <a class="code" href="structrs__tm.html#a589eab24c4d79f05f0b3601162ed34d0" title="day of the year">tm_yday</a>;    
+<a name="l00058"></a><a class="code" href="structrs__tm.html#a8cffdd224d2ea30a079a86ef1e41e111">00058</a>     <span class="keywordtype">int</span> <a class="code" href="structrs__tm.html#a8cffdd224d2ea30a079a86ef1e41e111" title="daylight savings time">tm_isdst</a>;   
+<a name="l00059"></a>00059 } <a class="code" href="structrs__tm.html">rs_tm</a>;
+<a name="l00060"></a>00060 
+<a name="l00070"></a>00070 <span class="keyword">extern</span> <a class="code" href="rs__time_8rsh.html#ad2b4759a0a6a98bd79b7ad82a4b057d6">rs_time_t</a> __attribute__((overloadable))
+<a name="l00071"></a>00071     <a class="code" href="rs__time_8rsh.html#a555f9324acb8c3d0c6f09a1d05478ce2">rsTime</a>(<a class="code" href="rs__time_8rsh.html#ad2b4759a0a6a98bd79b7ad82a4b057d6">rs_time_t</a> *timer);
+<a name="l00072"></a>00072 
+<a name="l00083"></a>00083 extern <a class="code" href="structrs__tm.html">rs_tm</a> * __attribute__((overloadable))
+<a name="l00084"></a>00084     <a class="code" href="rs__time_8rsh.html#a08a8fcadae964f7416aef487da624110">rsLocaltime</a>(<a class="code" href="structrs__tm.html">rs_tm</a> *local, const <a class="code" href="rs__time_8rsh.html#ad2b4759a0a6a98bd79b7ad82a4b057d6">rs_time_t</a> *timer);
+<a name="l00085"></a>00085 
+<a name="l00091"></a>00091 extern <a class="code" href="rs__types_8rsh.html#a996e72f71b11a5bb8b3b7b6936b1516d">int64_t</a> __attribute__((overloadable))
+<a name="l00092"></a>00092     <a class="code" href="rs__time_8rsh.html#a3c406e51a769718dd1c760518b9cad44">rsUptimeMillis</a>(<span class="keywordtype">void</span>);
+<a name="l00093"></a>00093 
+<a name="l00099"></a>00099 extern <a class="code" href="rs__types_8rsh.html#a996e72f71b11a5bb8b3b7b6936b1516d">int64_t</a> __attribute__((overloadable))
+<a name="l00100"></a>00100     <a class="code" href="rs__time_8rsh.html#a24e2cc12acf1e7fdd857d1a48981395d">rsUptimeNanos</a>(<span class="keywordtype">void</span>);
+<a name="l00101"></a>00101 
+<a name="l00108"></a>00108 extern <span class="keywordtype">float</span> __attribute__((overloadable))
+<a name="l00109"></a>00109     <a class="code" href="rs__time_8rsh.html#adea2682186fd903752431ad848bd8bf4">rsGetDt</a>(<span class="keywordtype">void</span>);
+<a name="l00110"></a>00110 
+<a name="l00111"></a>00111 <span class="preprocessor">#endif</span>
+</pre></div></div>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/rs__types_8rsh.html b/docs/html/reference/renderscript/rs__types_8rsh.html
new file mode 100644
index 0000000..bd601f2
--- /dev/null
+++ b/docs/html/reference/renderscript/rs__types_8rsh.html
@@ -0,0 +1,846 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_types.rsh File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="summary">
+<a href="#nested-classes">Data Structures</a> &#124;
+<a href="#typedef-members">Typedefs</a>  </div>
+  <div class="headertitle">
+<div class="title">/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_types.rsh File Reference</div>  </div>
+</div>
+<div class="contents">
+<div class="textblock"><code>#include &quot;stdbool.h&quot;</code><br/>
+</div><table class="memberdecls">
+<tr><td colspan="2"><h2><a name="nested-classes"></a>
+Data Structures</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrs__element.html">rs_element</a></td></tr>
+<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Opaque handle to a Renderscript element.  <a href="structrs__element.html#details">More...</a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrs__type.html">rs_type</a></td></tr>
+<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Opaque handle to a Renderscript type.  <a href="structrs__type.html#details">More...</a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrs__allocation.html">rs_allocation</a></td></tr>
+<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Opaque handle to a Renderscript allocation.  <a href="structrs__allocation.html#details">More...</a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrs__sampler.html">rs_sampler</a></td></tr>
+<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Opaque handle to a Renderscript sampler object.  <a href="structrs__sampler.html#details">More...</a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrs__script.html">rs_script</a></td></tr>
+<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Opaque handle to a Renderscript script object.  <a href="structrs__script.html#details">More...</a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrs__mesh.html">rs_mesh</a></td></tr>
+<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Opaque handle to a Renderscript mesh object.  <a href="structrs__mesh.html#details">More...</a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrs__program__fragment.html">rs_program_fragment</a></td></tr>
+<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Opaque handle to a Renderscript ProgramFragment object.  <a href="structrs__program__fragment.html#details">More...</a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrs__program__vertex.html">rs_program_vertex</a></td></tr>
+<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Opaque handle to a Renderscript ProgramVertex object.  <a href="structrs__program__vertex.html#details">More...</a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrs__program__raster.html">rs_program_raster</a></td></tr>
+<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Opaque handle to a Renderscript ProgramRaster object.  <a href="structrs__program__raster.html#details">More...</a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrs__program__store.html">rs_program_store</a></td></tr>
+<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Opaque handle to a Renderscript ProgramStore object.  <a href="structrs__program__store.html#details">More...</a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrs__font.html">rs_font</a></td></tr>
+<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Opaque handle to a Renderscript font object.  <a href="structrs__font.html#details">More...</a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a></td></tr>
+<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">4x4 float matrix  <a href="structrs__matrix4x4.html#details">More...</a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a></td></tr>
+<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">3x3 float matrix  <a href="structrs__matrix3x3.html#details">More...</a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a></td></tr>
+<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">2x2 float matrix  <a href="structrs__matrix2x2.html#details">More...</a><br/></td></tr>
+<tr><td colspan="2"><h2><a name="typedef-members"></a>
+Typedefs</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#ad566f6541e98b74246db1a3a3a85ad49">int8_t</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef short&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#aa343fa3b3d06292b959ffdd4c4703b06">int16_t</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef long long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#a996e72f71b11a5bb8b3b7b6936b1516d">int64_t</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef unsigned char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef unsigned short&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#a273cf69d639a59973b6019625df33e30">uint16_t</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef unsigned long long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="rs__types_8rsh.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="rs__types_8rsh.html#a273cf69d639a59973b6019625df33e30">uint16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="rs__types_8rsh.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#ab46637ef82283186e57f54756fe67203">ulong</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#a29d85914ddff32967d85ada69854206d">size_t</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#a170745d0d946e79c4c2a056d1d158996">ssize_t</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#a75ef868cedebc2a6eeb1bc6ca6ca49c3">double2</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#aa3c90d5a23d674185a13e95402eda7eb">double3</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#a60f4b04e076f0dd0ecc99c365fc4ca21">double4</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#aff5eb7cd53a34bb01924bf64485296de">uchar2</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#a247b5eacf2b662849668cbc33120343f">uchar3</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">uchar4</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#a24a9d78cfc32475e2c6eb1cdec239bf2">ushort2</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#ab78391445785d2ca0276392a9c97fcba">ushort3</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#a77a09fa01d7fc721bbc44c32aac2d487">ushort4</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#aaf90cd1f01a121e824fc6e1b927e7683">uint2</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#ae80e36ac834c891aa76b09a220344e78">uint3</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#ad92f0ec6c2cdc1f11a6d7fe321047462">uint4</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="rs__types_8rsh.html#ab46637ef82283186e57f54756fe67203">ulong</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#a56988b12ab16acf753356f7a5c70565a">ulong2</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="rs__types_8rsh.html#ab46637ef82283186e57f54756fe67203">ulong</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#ac623a569c28935fbedd3a8ed27ae0696">ulong3</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="rs__types_8rsh.html#ab46637ef82283186e57f54756fe67203">ulong</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#a3029c54b8e1779a1ddbdfe875432d137">ulong4</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#ac532b4c1895c8bd4fb75dc370c484351">char2</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#a4617fb31f4c03402515efee0a9b56210">char3</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#aecb498648daac97c7cc5f31c242dfa03">char4</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef short&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#a303d3ad18aaeacfcfeda2b8580b98796">short2</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef short&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#a3f4967691ae2b249511b5f3dd9e18793">short3</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef short&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#a198219da0b1d51c8d7f8f12aad7e502d">short4</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#a6bc1fa1354fe2145b8f12b4bbfafcf4c">int2</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#ad5512266b63fd06dcf450f6c9d5326c8">int3</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#a897deab71f679999ed99d4153c797e70">int4</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#afd55d62cee0785034b73375acd0df9da">long2</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#ad9cedbf4050fad14138d1dcb3428ec18">long3</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#ae177e4918f36e5c9da36d524cdb7a2e7">long4</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a></td></tr>
+</table>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>Define the standard Renderscript types</p>
+<p>Integers 8 bit: char, int8_t 16 bit: short, int16_t 32 bit: int, in32_t 64 bit: long, long long, int64_t</p>
+<p>Unsigned Integers 8 bit: uchar, uint8_t 16 bit: ushort, uint16_t 32 bit: uint, uint32_t 64 bit: ulong, uint64_t</p>
+<p>Floating point 32 bit: float 64 bit: double</p>
+<p>Vectors of length 2, 3, and 4 are supported for all the types above. </p>
+
+<p>Definition in file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+</div><hr/><h2>Typedef Documentation</h2>
+<a class="anchor" id="ac532b4c1895c8bd4fb75dc370c484351"></a><!-- doxytag: member="rs_types.rsh::char2" ref="ac532b4c1895c8bd4fb75dc370c484351" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef char <a class="el" href="rs__types_8rsh.html#ac532b4c1895c8bd4fb75dc370c484351">char2</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic char type. Provides two char fields packed into a single 16 bit field with 16 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00273">273</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a4617fb31f4c03402515efee0a9b56210"></a><!-- doxytag: member="rs_types.rsh::char3" ref="a4617fb31f4c03402515efee0a9b56210" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef char <a class="el" href="rs__types_8rsh.html#a4617fb31f4c03402515efee0a9b56210">char3</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic char type. Provides three char fields packed into a single 32 bit field with 32 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00278">278</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="aecb498648daac97c7cc5f31c242dfa03"></a><!-- doxytag: member="rs_types.rsh::char4" ref="aecb498648daac97c7cc5f31c242dfa03" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef char <a class="el" href="rs__types_8rsh.html#aecb498648daac97c7cc5f31c242dfa03">char4</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic char type. Provides four char fields packed into a single 32 bit field with 32 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00283">283</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a75ef868cedebc2a6eeb1bc6ca6ca49c3"></a><!-- doxytag: member="rs_types.rsh::double2" ref="a75ef868cedebc2a6eeb1bc6ca6ca49c3" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef double <a class="el" href="rs__types_8rsh.html#a75ef868cedebc2a6eeb1bc6ca6ca49c3">double2</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic double type. Provides two double fields packed into a single 128 bit field with 128 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00193">193</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="aa3c90d5a23d674185a13e95402eda7eb"></a><!-- doxytag: member="rs_types.rsh::double3" ref="aa3c90d5a23d674185a13e95402eda7eb" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef double <a class="el" href="rs__types_8rsh.html#aa3c90d5a23d674185a13e95402eda7eb">double3</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic double type. Provides three double fields packed into a single 256 bit field with 256 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00198">198</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a60f4b04e076f0dd0ecc99c365fc4ca21"></a><!-- doxytag: member="rs_types.rsh::double4" ref="a60f4b04e076f0dd0ecc99c365fc4ca21" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef double <a class="el" href="rs__types_8rsh.html#a60f4b04e076f0dd0ecc99c365fc4ca21">double4</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic double type. Provides four double fields packed into a single 256 bit field with 256 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00203">203</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a5086d0fcb71f916c936af486ccf0dd41"></a><!-- doxytag: member="rs_types.rsh::float2" ref="a5086d0fcb71f916c936af486ccf0dd41" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef float <a class="el" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic float type. Provides two float fields packed into a single 64 bit field with 64 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00176">176</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a0046fa0f208d0899adbcf1f8b5aafadd"></a><!-- doxytag: member="rs_types.rsh::float3" ref="a0046fa0f208d0899adbcf1f8b5aafadd" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef float <a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic float type. Provides three float fields packed into a single 128 bit field with 128 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00181">181</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="adb5162dc168ddd471d948faa60b37c5e"></a><!-- doxytag: member="rs_types.rsh::float4" ref="adb5162dc168ddd471d948faa60b37c5e" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef float <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic float type. Provides four float fields packed into a single 128 bit field with 128 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00187">187</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="aa343fa3b3d06292b959ffdd4c4703b06"></a><!-- doxytag: member="rs_types.rsh::int16_t" ref="aa343fa3b3d06292b959ffdd4c4703b06" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef short <a class="el" href="rs__types_8rsh.html#aa343fa3b3d06292b959ffdd4c4703b06">int16_t</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>16 bit integer type </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00054">54</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a6bc1fa1354fe2145b8f12b4bbfafcf4c"></a><!-- doxytag: member="rs_types.rsh::int2" ref="a6bc1fa1354fe2145b8f12b4bbfafcf4c" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef int <a class="el" href="rs__types_8rsh.html#a6bc1fa1354fe2145b8f12b4bbfafcf4c">int2</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic int type. Provides two int fields packed into a single 64 bit field with 64 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00305">305</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ad5512266b63fd06dcf450f6c9d5326c8"></a><!-- doxytag: member="rs_types.rsh::int3" ref="ad5512266b63fd06dcf450f6c9d5326c8" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef int <a class="el" href="rs__types_8rsh.html#ad5512266b63fd06dcf450f6c9d5326c8">int3</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic int type. Provides three int fields packed into a single 128 bit field with 128 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00310">310</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a32f2e37ee053cf2ce8ca28d1f74630e5"></a><!-- doxytag: member="rs_types.rsh::int32_t" ref="a32f2e37ee053cf2ce8ca28d1f74630e5" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef int <a class="el" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>32 bit integer type </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00058">58</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a897deab71f679999ed99d4153c797e70"></a><!-- doxytag: member="rs_types.rsh::int4" ref="a897deab71f679999ed99d4153c797e70" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef int <a class="el" href="rs__types_8rsh.html#a897deab71f679999ed99d4153c797e70">int4</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic int type. Provides two four fields packed into a single 128 bit field with 128 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00315">315</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a996e72f71b11a5bb8b3b7b6936b1516d"></a><!-- doxytag: member="rs_types.rsh::int64_t" ref="a996e72f71b11a5bb8b3b7b6936b1516d" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef long long <a class="el" href="rs__types_8rsh.html#a996e72f71b11a5bb8b3b7b6936b1516d">int64_t</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>64 bit integer type </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00062">62</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ad566f6541e98b74246db1a3a3a85ad49"></a><!-- doxytag: member="rs_types.rsh::int8_t" ref="ad566f6541e98b74246db1a3a3a85ad49" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef char <a class="el" href="rs__types_8rsh.html#ad566f6541e98b74246db1a3a3a85ad49">int8_t</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>8 bit integer type </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00050">50</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="afd55d62cee0785034b73375acd0df9da"></a><!-- doxytag: member="rs_types.rsh::long2" ref="afd55d62cee0785034b73375acd0df9da" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef long <a class="el" href="rs__types_8rsh.html#afd55d62cee0785034b73375acd0df9da">long2</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic long type. Provides two long fields packed into a single 128 bit field with 128 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00321">321</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ad9cedbf4050fad14138d1dcb3428ec18"></a><!-- doxytag: member="rs_types.rsh::long3" ref="ad9cedbf4050fad14138d1dcb3428ec18" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef long <a class="el" href="rs__types_8rsh.html#ad9cedbf4050fad14138d1dcb3428ec18">long3</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic long type. Provides three long fields packed into a single 256 bit field with 256 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00326">326</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ae177e4918f36e5c9da36d524cdb7a2e7"></a><!-- doxytag: member="rs_types.rsh::long4" ref="ae177e4918f36e5c9da36d524cdb7a2e7" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef long <a class="el" href="rs__types_8rsh.html#ae177e4918f36e5c9da36d524cdb7a2e7">long4</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic long type. Provides four long fields packed into a single 256 bit field with 256 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00331">331</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a86f99f382dc35fc8ad98b524fe6d5447"></a><!-- doxytag: member="rs_types.rsh::rs_quaternion" ref="a86f99f382dc35fc8ad98b524fe6d5447" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> <a class="el" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>quaternion type for use with the quaternion functions </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00364">364</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a303d3ad18aaeacfcfeda2b8580b98796"></a><!-- doxytag: member="rs_types.rsh::short2" ref="a303d3ad18aaeacfcfeda2b8580b98796" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef short <a class="el" href="rs__types_8rsh.html#a303d3ad18aaeacfcfeda2b8580b98796">short2</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic short type. Provides two short fields packed into a single 32 bit field with 32 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00289">289</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a3f4967691ae2b249511b5f3dd9e18793"></a><!-- doxytag: member="rs_types.rsh::short3" ref="a3f4967691ae2b249511b5f3dd9e18793" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef short <a class="el" href="rs__types_8rsh.html#a3f4967691ae2b249511b5f3dd9e18793">short3</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic short type. Provides three short fields packed into a single 64 bit field with 64 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00294">294</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a198219da0b1d51c8d7f8f12aad7e502d"></a><!-- doxytag: member="rs_types.rsh::short4" ref="a198219da0b1d51c8d7f8f12aad7e502d" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef short <a class="el" href="rs__types_8rsh.html#a198219da0b1d51c8d7f8f12aad7e502d">short4</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic short type. Provides four short fields packed into a single 64 bit field with 64 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00299">299</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a29d85914ddff32967d85ada69854206d"></a><!-- doxytag: member="rs_types.rsh::size_t" ref="a29d85914ddff32967d85ada69854206d" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> <a class="el" href="rs__types_8rsh.html#a29d85914ddff32967d85ada69854206d">size_t</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Typedef for unsigned int </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00098">98</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a170745d0d946e79c4c2a056d1d158996"></a><!-- doxytag: member="rs_types.rsh::ssize_t" ref="a170745d0d946e79c4c2a056d1d158996" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef <a class="el" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a> <a class="el" href="rs__types_8rsh.html#a170745d0d946e79c4c2a056d1d158996">ssize_t</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Typedef for int (use for 32-bit integers) </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00102">102</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a27c902d5ca78afa82d5ed75554d5cedc"></a><!-- doxytag: member="rs_types.rsh::uchar" ref="a27c902d5ca78afa82d5ed75554d5cedc" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef <a class="el" href="rs__types_8rsh.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> <a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>8 bit unsigned integer type </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00082">82</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="aff5eb7cd53a34bb01924bf64485296de"></a><!-- doxytag: member="rs_types.rsh::uchar2" ref="aff5eb7cd53a34bb01924bf64485296de" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef <a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a> <a class="el" href="rs__types_8rsh.html#aff5eb7cd53a34bb01924bf64485296de">uchar2</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic uchar type. Provides two uchar fields packed into a single 16 bit field with 16 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00209">209</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a247b5eacf2b662849668cbc33120343f"></a><!-- doxytag: member="rs_types.rsh::uchar3" ref="a247b5eacf2b662849668cbc33120343f" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef <a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a> <a class="el" href="rs__types_8rsh.html#a247b5eacf2b662849668cbc33120343f">uchar3</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic uchar type. Provides three uchar fields packed into a single 32 bit field with 32 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00214">214</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ae6ed52a87d4ff920c303b13b00f7396d"></a><!-- doxytag: member="rs_types.rsh::uchar4" ref="ae6ed52a87d4ff920c303b13b00f7396d" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef <a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a> <a class="el" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">uchar4</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic uchar type. Provides four uchar fields packed into a single 32 bit field with 32 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00219">219</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a4f5fce8c1ef282264f9214809524d836"></a><!-- doxytag: member="rs_types.rsh::uint" ref="a4f5fce8c1ef282264f9214809524d836" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> <a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>32 bit unsigned integer type </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00090">90</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a273cf69d639a59973b6019625df33e30"></a><!-- doxytag: member="rs_types.rsh::uint16_t" ref="a273cf69d639a59973b6019625df33e30" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef unsigned short <a class="el" href="rs__types_8rsh.html#a273cf69d639a59973b6019625df33e30">uint16_t</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>16 bit unsigned integer type </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00070">70</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="aaf90cd1f01a121e824fc6e1b927e7683"></a><!-- doxytag: member="rs_types.rsh::uint2" ref="aaf90cd1f01a121e824fc6e1b927e7683" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef <a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> <a class="el" href="rs__types_8rsh.html#aaf90cd1f01a121e824fc6e1b927e7683">uint2</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic uint type. Provides two uint fields packed into a single 64 bit field with 64 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00241">241</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ae80e36ac834c891aa76b09a220344e78"></a><!-- doxytag: member="rs_types.rsh::uint3" ref="ae80e36ac834c891aa76b09a220344e78" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef <a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> <a class="el" href="rs__types_8rsh.html#ae80e36ac834c891aa76b09a220344e78">uint3</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic uint type. Provides three uint fields packed into a single 128 bit field with 128 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00246">246</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a435d1572bf3f880d55459d9805097f62"></a><!-- doxytag: member="rs_types.rsh::uint32_t" ref="a435d1572bf3f880d55459d9805097f62" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef unsigned int <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>32 bit unsigned integer type </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00074">74</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ad92f0ec6c2cdc1f11a6d7fe321047462"></a><!-- doxytag: member="rs_types.rsh::uint4" ref="ad92f0ec6c2cdc1f11a6d7fe321047462" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef <a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> <a class="el" href="rs__types_8rsh.html#ad92f0ec6c2cdc1f11a6d7fe321047462">uint4</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic uint type. Provides four uint fields packed into a single 128 bit field with 128 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00251">251</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="aaa5d1cd013383c889537491c3cfd9aad"></a><!-- doxytag: member="rs_types.rsh::uint64_t" ref="aaa5d1cd013383c889537491c3cfd9aad" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef unsigned long long <a class="el" href="rs__types_8rsh.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>64 bit unsigned integer type </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00078">78</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="aba7bc1797add20fe3efdf37ced1182c5"></a><!-- doxytag: member="rs_types.rsh::uint8_t" ref="aba7bc1797add20fe3efdf37ced1182c5" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef unsigned char <a class="el" href="rs__types_8rsh.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>8 bit unsigned integer type </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00066">66</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ab46637ef82283186e57f54756fe67203"></a><!-- doxytag: member="rs_types.rsh::ulong" ref="ab46637ef82283186e57f54756fe67203" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef <a class="el" href="rs__types_8rsh.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> <a class="el" href="rs__types_8rsh.html#ab46637ef82283186e57f54756fe67203">ulong</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Typedef for unsigned long (use for 64-bit unsigned integers) </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00094">94</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a56988b12ab16acf753356f7a5c70565a"></a><!-- doxytag: member="rs_types.rsh::ulong2" ref="a56988b12ab16acf753356f7a5c70565a" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef <a class="el" href="rs__types_8rsh.html#ab46637ef82283186e57f54756fe67203">ulong</a> <a class="el" href="rs__types_8rsh.html#a56988b12ab16acf753356f7a5c70565a">ulong2</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic ulong type. Provides two ulong fields packed into a single 128 bit field with 128 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00257">257</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ac623a569c28935fbedd3a8ed27ae0696"></a><!-- doxytag: member="rs_types.rsh::ulong3" ref="ac623a569c28935fbedd3a8ed27ae0696" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef <a class="el" href="rs__types_8rsh.html#ab46637ef82283186e57f54756fe67203">ulong</a> <a class="el" href="rs__types_8rsh.html#ac623a569c28935fbedd3a8ed27ae0696">ulong3</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic ulong type. Provides three ulong fields packed into a single 256 bit field with 256 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00262">262</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a3029c54b8e1779a1ddbdfe875432d137"></a><!-- doxytag: member="rs_types.rsh::ulong4" ref="a3029c54b8e1779a1ddbdfe875432d137" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef <a class="el" href="rs__types_8rsh.html#ab46637ef82283186e57f54756fe67203">ulong</a> <a class="el" href="rs__types_8rsh.html#a3029c54b8e1779a1ddbdfe875432d137">ulong4</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic ulong type. Provides four ulong fields packed into a single 256 bit field with 256 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00267">267</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a9e58a7bf060b7a5fbf6a401d3020adca"></a><!-- doxytag: member="rs_types.rsh::ushort" ref="a9e58a7bf060b7a5fbf6a401d3020adca" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef <a class="el" href="rs__types_8rsh.html#a273cf69d639a59973b6019625df33e30">uint16_t</a> <a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>16 bit unsigned integer type </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00086">86</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a24a9d78cfc32475e2c6eb1cdec239bf2"></a><!-- doxytag: member="rs_types.rsh::ushort2" ref="a24a9d78cfc32475e2c6eb1cdec239bf2" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef <a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a> <a class="el" href="rs__types_8rsh.html#a24a9d78cfc32475e2c6eb1cdec239bf2">ushort2</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic ushort type. Provides two ushort fields packed into a single 32 bit field with 32 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00225">225</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ab78391445785d2ca0276392a9c97fcba"></a><!-- doxytag: member="rs_types.rsh::ushort3" ref="ab78391445785d2ca0276392a9c97fcba" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef <a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a> <a class="el" href="rs__types_8rsh.html#ab78391445785d2ca0276392a9c97fcba">ushort3</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic ushort type. Provides three ushort fields packed into a single 64 bit field with 64 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00230">230</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a77a09fa01d7fc721bbc44c32aac2d487"></a><!-- doxytag: member="rs_types.rsh::ushort4" ref="a77a09fa01d7fc721bbc44c32aac2d487" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">typedef <a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a> <a class="el" href="rs__types_8rsh.html#a77a09fa01d7fc721bbc44c32aac2d487">ushort4</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>Vector version of the basic ushort type. Provides four ushort fields packed into a single 64 bit field with 64 bit alignment. </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00235">235</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+
+</div>
+</div>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/rs__types_8rsh_source.html b/docs/html/reference/renderscript/rs__types_8rsh_source.html
new file mode 100644
index 0000000..96c55e1
--- /dev/null
+++ b/docs/html/reference/renderscript/rs__types_8rsh_source.html
@@ -0,0 +1,160 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_types.rsh Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li class="current"><a href="globals.html"><span>Globals</span></a></li>
+      <li><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_types.rsh</div>  </div>
+</div>
+<div class="contents">
+<a href="rs__types_8rsh.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
+<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2011 The Android Open Source Project</span>
+<a name="l00003"></a>00003 <span class="comment"> *</span>
+<a name="l00004"></a>00004 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span>
+<a name="l00005"></a>00005 <span class="comment"> * you may not use this file except in compliance with the License.</span>
+<a name="l00006"></a>00006 <span class="comment"> * You may obtain a copy of the License at</span>
+<a name="l00007"></a>00007 <span class="comment"> *</span>
+<a name="l00008"></a>00008 <span class="comment"> *      http://www.apache.org/licenses/LICENSE-2.0</span>
+<a name="l00009"></a>00009 <span class="comment"> *</span>
+<a name="l00010"></a>00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
+<a name="l00011"></a>00011 <span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span>
+<a name="l00012"></a>00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
+<a name="l00013"></a>00013 <span class="comment"> * See the License for the specific language governing permissions and</span>
+<a name="l00014"></a>00014 <span class="comment"> * limitations under the License.</span>
+<a name="l00015"></a>00015 <span class="comment"> */</span>
+<a name="l00016"></a>00016 
+<a name="l00041"></a>00041 <span class="preprocessor">#ifndef __RS_TYPES_RSH__</span>
+<a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#define __RS_TYPES_RSH__</span>
+<a name="l00043"></a>00043 <span class="preprocessor"></span>
+<a name="l00044"></a>00044 <span class="preprocessor">#define M_PI        3.14159265358979323846264338327950288f   </span><span class="comment">/* pi */</span>
+<a name="l00045"></a>00045 
+<a name="l00046"></a>00046 <span class="preprocessor">#include &quot;stdbool.h&quot;</span>
+<a name="l00050"></a><a class="code" href="rs__types_8rsh.html#ad566f6541e98b74246db1a3a3a85ad49">00050</a> <span class="keyword">typedef</span> <span class="keywordtype">char</span> <a class="code" href="rs__types_8rsh.html#ad566f6541e98b74246db1a3a3a85ad49">int8_t</a>;
+<a name="l00054"></a><a class="code" href="rs__types_8rsh.html#aa343fa3b3d06292b959ffdd4c4703b06">00054</a> <span class="keyword">typedef</span> <span class="keywordtype">short</span> <a class="code" href="rs__types_8rsh.html#aa343fa3b3d06292b959ffdd4c4703b06">int16_t</a>;
+<a name="l00058"></a><a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">00058</a> <span class="keyword">typedef</span> <span class="keywordtype">int</span> <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a>;
+<a name="l00062"></a><a class="code" href="rs__types_8rsh.html#a996e72f71b11a5bb8b3b7b6936b1516d">00062</a> <span class="keyword">typedef</span> <span class="keywordtype">long</span> <span class="keywordtype">long</span> <a class="code" href="rs__types_8rsh.html#a996e72f71b11a5bb8b3b7b6936b1516d">int64_t</a>;
+<a name="l00066"></a><a class="code" href="rs__types_8rsh.html#aba7bc1797add20fe3efdf37ced1182c5">00066</a> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="rs__types_8rsh.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>;
+<a name="l00070"></a><a class="code" href="rs__types_8rsh.html#a273cf69d639a59973b6019625df33e30">00070</a> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> <a class="code" href="rs__types_8rsh.html#a273cf69d639a59973b6019625df33e30">uint16_t</a>;
+<a name="l00074"></a><a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">00074</a> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>;
+<a name="l00078"></a><a class="code" href="rs__types_8rsh.html#aaa5d1cd013383c889537491c3cfd9aad">00078</a> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <span class="keywordtype">long</span> <a class="code" href="rs__types_8rsh.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>;
+<a name="l00082"></a><a class="code" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">00082</a> <span class="keyword">typedef</span> <a class="code" href="rs__types_8rsh.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> <a class="code" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a>;
+<a name="l00086"></a><a class="code" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">00086</a> <span class="keyword">typedef</span> <a class="code" href="rs__types_8rsh.html#a273cf69d639a59973b6019625df33e30">uint16_t</a> <a class="code" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a>;
+<a name="l00090"></a><a class="code" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">00090</a> <span class="keyword">typedef</span> <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> <a class="code" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>;
+<a name="l00094"></a><a class="code" href="rs__types_8rsh.html#ab46637ef82283186e57f54756fe67203">00094</a> <span class="keyword">typedef</span> <a class="code" href="rs__types_8rsh.html#aaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> <a class="code" href="rs__types_8rsh.html#ab46637ef82283186e57f54756fe67203">ulong</a>;
+<a name="l00098"></a><a class="code" href="rs__types_8rsh.html#a29d85914ddff32967d85ada69854206d">00098</a> <span class="keyword">typedef</span> <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> <a class="code" href="rs__types_8rsh.html#a29d85914ddff32967d85ada69854206d">size_t</a>;
+<a name="l00102"></a><a class="code" href="rs__types_8rsh.html#a170745d0d946e79c4c2a056d1d158996">00102</a> <span class="keyword">typedef</span> <a class="code" href="rs__types_8rsh.html#a32f2e37ee053cf2ce8ca28d1f74630e5">int32_t</a> <a class="code" href="rs__types_8rsh.html#a170745d0d946e79c4c2a056d1d158996">ssize_t</a>;
+<a name="l00103"></a>00103 
+<a name="l00109"></a><a class="code" href="structrs__element.html">00109</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ <span class="keyword">const</span> <span class="keywordtype">int</span>* <span class="keyword">const</span> p; } __attribute__((packed, aligned(4))) <a class="code" href="structrs__element.html" title="Opaque handle to a Renderscript element.">rs_element</a>;
+<a name="l00115"></a><a class="code" href="structrs__type.html">00115</a> typedef struct { <span class="keyword">const</span> <span class="keywordtype">int</span>* <span class="keyword">const</span> p; } __attribute__((packed, aligned(4))) <a class="code" href="structrs__type.html" title="Opaque handle to a Renderscript type.">rs_type</a>;
+<a name="l00121"></a><a class="code" href="structrs__allocation.html">00121</a> typedef struct { <span class="keyword">const</span> <span class="keywordtype">int</span>* <span class="keyword">const</span> p; } __attribute__((packed, aligned(4))) <a class="code" href="structrs__allocation.html" title="Opaque handle to a Renderscript allocation.">rs_allocation</a>;
+<a name="l00127"></a><a class="code" href="structrs__sampler.html">00127</a> typedef struct { <span class="keyword">const</span> <span class="keywordtype">int</span>* <span class="keyword">const</span> p; } __attribute__((packed, aligned(4))) <a class="code" href="structrs__sampler.html" title="Opaque handle to a Renderscript sampler object.">rs_sampler</a>;
+<a name="l00133"></a><a class="code" href="structrs__script.html">00133</a> typedef struct { <span class="keyword">const</span> <span class="keywordtype">int</span>* <span class="keyword">const</span> p; } __attribute__((packed, aligned(4))) <a class="code" href="structrs__script.html" title="Opaque handle to a Renderscript script object.">rs_script</a>;
+<a name="l00139"></a><a class="code" href="structrs__mesh.html">00139</a> typedef struct { <span class="keyword">const</span> <span class="keywordtype">int</span>* <span class="keyword">const</span> p; } __attribute__((packed, aligned(4))) <a class="code" href="structrs__mesh.html" title="Opaque handle to a Renderscript mesh object.">rs_mesh</a>;
+<a name="l00145"></a><a class="code" href="structrs__program__fragment.html">00145</a> typedef struct { <span class="keyword">const</span> <span class="keywordtype">int</span>* <span class="keyword">const</span> p; } __attribute__((packed, aligned(4))) <a class="code" href="structrs__program__fragment.html" title="Opaque handle to a Renderscript ProgramFragment object.">rs_program_fragment</a>;
+<a name="l00151"></a><a class="code" href="structrs__program__vertex.html">00151</a> typedef struct { <span class="keyword">const</span> <span class="keywordtype">int</span>* <span class="keyword">const</span> p; } __attribute__((packed, aligned(4))) <a class="code" href="structrs__program__vertex.html" title="Opaque handle to a Renderscript ProgramVertex object.">rs_program_vertex</a>;
+<a name="l00157"></a><a class="code" href="structrs__program__raster.html">00157</a> typedef struct { <span class="keyword">const</span> <span class="keywordtype">int</span>* <span class="keyword">const</span> p; } __attribute__((packed, aligned(4))) <a class="code" href="structrs__program__raster.html" title="Opaque handle to a Renderscript ProgramRaster object.">rs_program_raster</a>;
+<a name="l00163"></a><a class="code" href="structrs__program__store.html">00163</a> typedef struct { <span class="keyword">const</span> <span class="keywordtype">int</span>* <span class="keyword">const</span> p; } __attribute__((packed, aligned(4))) <a class="code" href="structrs__program__store.html" title="Opaque handle to a Renderscript ProgramStore object.">rs_program_store</a>;
+<a name="l00169"></a><a class="code" href="structrs__font.html">00169</a> typedef struct { <span class="keyword">const</span> <span class="keywordtype">int</span>* <span class="keyword">const</span> p; } __attribute__((packed, aligned(4))) <a class="code" href="structrs__font.html" title="Opaque handle to a Renderscript font object.">rs_font</a>;
+<a name="l00170"></a>00170 
+<a name="l00176"></a><a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">00176</a> typedef <span class="keywordtype">float</span> <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> __attribute__((ext_vector_type(2)));
+<a name="l00181"></a><a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">00181</a> typedef <span class="keywordtype">float</span> <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> __attribute__((ext_vector_type(3)));
+<a name="l00187"></a><a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">00187</a> typedef <span class="keywordtype">float</span> <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((ext_vector_type(4)));
+<a name="l00188"></a>00188 
+<a name="l00193"></a><a class="code" href="rs__types_8rsh.html#a75ef868cedebc2a6eeb1bc6ca6ca49c3">00193</a> typedef <span class="keywordtype">double</span> <a class="code" href="rs__types_8rsh.html#a75ef868cedebc2a6eeb1bc6ca6ca49c3">double2</a> __attribute__((ext_vector_type(2)));
+<a name="l00198"></a><a class="code" href="rs__types_8rsh.html#aa3c90d5a23d674185a13e95402eda7eb">00198</a> typedef <span class="keywordtype">double</span> <a class="code" href="rs__types_8rsh.html#aa3c90d5a23d674185a13e95402eda7eb">double3</a> __attribute__((ext_vector_type(3)));
+<a name="l00203"></a><a class="code" href="rs__types_8rsh.html#a60f4b04e076f0dd0ecc99c365fc4ca21">00203</a> typedef <span class="keywordtype">double</span> <a class="code" href="rs__types_8rsh.html#a60f4b04e076f0dd0ecc99c365fc4ca21">double4</a> __attribute__((ext_vector_type(4)));
+<a name="l00204"></a>00204 
+<a name="l00209"></a><a class="code" href="rs__types_8rsh.html#aff5eb7cd53a34bb01924bf64485296de">00209</a> typedef <a class="code" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a> <a class="code" href="rs__types_8rsh.html#aff5eb7cd53a34bb01924bf64485296de">uchar2</a> __attribute__((ext_vector_type(2)));
+<a name="l00214"></a><a class="code" href="rs__types_8rsh.html#a247b5eacf2b662849668cbc33120343f">00214</a> typedef <a class="code" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a> <a class="code" href="rs__types_8rsh.html#a247b5eacf2b662849668cbc33120343f">uchar3</a> __attribute__((ext_vector_type(3)));
+<a name="l00219"></a><a class="code" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">00219</a> typedef <a class="code" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a> <a class="code" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">uchar4</a> __attribute__((ext_vector_type(4)));
+<a name="l00220"></a>00220 
+<a name="l00225"></a><a class="code" href="rs__types_8rsh.html#a24a9d78cfc32475e2c6eb1cdec239bf2">00225</a> typedef <a class="code" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a> <a class="code" href="rs__types_8rsh.html#a24a9d78cfc32475e2c6eb1cdec239bf2">ushort2</a> __attribute__((ext_vector_type(2)));
+<a name="l00230"></a><a class="code" href="rs__types_8rsh.html#ab78391445785d2ca0276392a9c97fcba">00230</a> typedef <a class="code" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a> <a class="code" href="rs__types_8rsh.html#ab78391445785d2ca0276392a9c97fcba">ushort3</a> __attribute__((ext_vector_type(3)));
+<a name="l00235"></a><a class="code" href="rs__types_8rsh.html#a77a09fa01d7fc721bbc44c32aac2d487">00235</a> typedef <a class="code" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a> <a class="code" href="rs__types_8rsh.html#a77a09fa01d7fc721bbc44c32aac2d487">ushort4</a> __attribute__((ext_vector_type(4)));
+<a name="l00236"></a>00236 
+<a name="l00241"></a><a class="code" href="rs__types_8rsh.html#aaf90cd1f01a121e824fc6e1b927e7683">00241</a> typedef <a class="code" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> <a class="code" href="rs__types_8rsh.html#aaf90cd1f01a121e824fc6e1b927e7683">uint2</a> __attribute__((ext_vector_type(2)));
+<a name="l00246"></a><a class="code" href="rs__types_8rsh.html#ae80e36ac834c891aa76b09a220344e78">00246</a> typedef <a class="code" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> <a class="code" href="rs__types_8rsh.html#ae80e36ac834c891aa76b09a220344e78">uint3</a> __attribute__((ext_vector_type(3)));
+<a name="l00251"></a><a class="code" href="rs__types_8rsh.html#ad92f0ec6c2cdc1f11a6d7fe321047462">00251</a> typedef <a class="code" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> <a class="code" href="rs__types_8rsh.html#ad92f0ec6c2cdc1f11a6d7fe321047462">uint4</a> __attribute__((ext_vector_type(4)));
+<a name="l00252"></a>00252 
+<a name="l00257"></a><a class="code" href="rs__types_8rsh.html#a56988b12ab16acf753356f7a5c70565a">00257</a> typedef <a class="code" href="rs__types_8rsh.html#ab46637ef82283186e57f54756fe67203">ulong</a> <a class="code" href="rs__types_8rsh.html#a56988b12ab16acf753356f7a5c70565a">ulong2</a> __attribute__((ext_vector_type(2)));
+<a name="l00262"></a><a class="code" href="rs__types_8rsh.html#ac623a569c28935fbedd3a8ed27ae0696">00262</a> typedef <a class="code" href="rs__types_8rsh.html#ab46637ef82283186e57f54756fe67203">ulong</a> <a class="code" href="rs__types_8rsh.html#ac623a569c28935fbedd3a8ed27ae0696">ulong3</a> __attribute__((ext_vector_type(3)));
+<a name="l00267"></a><a class="code" href="rs__types_8rsh.html#a3029c54b8e1779a1ddbdfe875432d137">00267</a> typedef <a class="code" href="rs__types_8rsh.html#ab46637ef82283186e57f54756fe67203">ulong</a> <a class="code" href="rs__types_8rsh.html#a3029c54b8e1779a1ddbdfe875432d137">ulong4</a> __attribute__((ext_vector_type(4)));
+<a name="l00268"></a>00268 
+<a name="l00273"></a><a class="code" href="rs__types_8rsh.html#ac532b4c1895c8bd4fb75dc370c484351">00273</a> typedef <span class="keywordtype">char</span> <a class="code" href="rs__types_8rsh.html#ac532b4c1895c8bd4fb75dc370c484351">char2</a> __attribute__((ext_vector_type(2)));
+<a name="l00278"></a><a class="code" href="rs__types_8rsh.html#a4617fb31f4c03402515efee0a9b56210">00278</a> typedef <span class="keywordtype">char</span> <a class="code" href="rs__types_8rsh.html#a4617fb31f4c03402515efee0a9b56210">char3</a> __attribute__((ext_vector_type(3)));
+<a name="l00283"></a><a class="code" href="rs__types_8rsh.html#aecb498648daac97c7cc5f31c242dfa03">00283</a> typedef <span class="keywordtype">char</span> <a class="code" href="rs__types_8rsh.html#aecb498648daac97c7cc5f31c242dfa03">char4</a> __attribute__((ext_vector_type(4)));
+<a name="l00284"></a>00284 
+<a name="l00289"></a><a class="code" href="rs__types_8rsh.html#a303d3ad18aaeacfcfeda2b8580b98796">00289</a> typedef <span class="keywordtype">short</span> <a class="code" href="rs__types_8rsh.html#a303d3ad18aaeacfcfeda2b8580b98796">short2</a> __attribute__((ext_vector_type(2)));
+<a name="l00294"></a><a class="code" href="rs__types_8rsh.html#a3f4967691ae2b249511b5f3dd9e18793">00294</a> typedef <span class="keywordtype">short</span> <a class="code" href="rs__types_8rsh.html#a3f4967691ae2b249511b5f3dd9e18793">short3</a> __attribute__((ext_vector_type(3)));
+<a name="l00299"></a><a class="code" href="rs__types_8rsh.html#a198219da0b1d51c8d7f8f12aad7e502d">00299</a> typedef <span class="keywordtype">short</span> <a class="code" href="rs__types_8rsh.html#a198219da0b1d51c8d7f8f12aad7e502d">short4</a> __attribute__((ext_vector_type(4)));
+<a name="l00300"></a>00300 
+<a name="l00305"></a><a class="code" href="rs__types_8rsh.html#a6bc1fa1354fe2145b8f12b4bbfafcf4c">00305</a> typedef <span class="keywordtype">int</span> <a class="code" href="rs__types_8rsh.html#a6bc1fa1354fe2145b8f12b4bbfafcf4c">int2</a> __attribute__((ext_vector_type(2)));
+<a name="l00310"></a><a class="code" href="rs__types_8rsh.html#ad5512266b63fd06dcf450f6c9d5326c8">00310</a> typedef <span class="keywordtype">int</span> <a class="code" href="rs__types_8rsh.html#ad5512266b63fd06dcf450f6c9d5326c8">int3</a> __attribute__((ext_vector_type(3)));
+<a name="l00315"></a><a class="code" href="rs__types_8rsh.html#a897deab71f679999ed99d4153c797e70">00315</a> typedef <span class="keywordtype">int</span> <a class="code" href="rs__types_8rsh.html#a897deab71f679999ed99d4153c797e70">int4</a> __attribute__((ext_vector_type(4)));
+<a name="l00316"></a>00316 
+<a name="l00321"></a><a class="code" href="rs__types_8rsh.html#afd55d62cee0785034b73375acd0df9da">00321</a> typedef <span class="keywordtype">long</span> <a class="code" href="rs__types_8rsh.html#afd55d62cee0785034b73375acd0df9da">long2</a> __attribute__((ext_vector_type(2)));
+<a name="l00326"></a><a class="code" href="rs__types_8rsh.html#ad9cedbf4050fad14138d1dcb3428ec18">00326</a> typedef <span class="keywordtype">long</span> <a class="code" href="rs__types_8rsh.html#ad9cedbf4050fad14138d1dcb3428ec18">long3</a> __attribute__((ext_vector_type(3)));
+<a name="l00331"></a><a class="code" href="rs__types_8rsh.html#ae177e4918f36e5c9da36d524cdb7a2e7">00331</a> typedef <span class="keywordtype">long</span> <a class="code" href="rs__types_8rsh.html#ae177e4918f36e5c9da36d524cdb7a2e7">long4</a> __attribute__((ext_vector_type(4)));
+<a name="l00332"></a>00332 
+<a name="l00339"></a><a class="code" href="structrs__matrix4x4.html">00339</a> typedef struct {
+<a name="l00340"></a>00340     <span class="keywordtype">float</span> m[16];
+<a name="l00341"></a>00341 } <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a>;
+<a name="l00348"></a><a class="code" href="structrs__matrix3x3.html">00348</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{
+<a name="l00349"></a>00349     <span class="keywordtype">float</span> m[9];
+<a name="l00350"></a>00350 } <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a>;
+<a name="l00357"></a><a class="code" href="structrs__matrix2x2.html">00357</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{
+<a name="l00358"></a>00358     <span class="keywordtype">float</span> m[4];
+<a name="l00359"></a>00359 } <a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a>;
+<a name="l00360"></a>00360 
+<a name="l00364"></a><a class="code" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">00364</a> <span class="keyword">typedef</span> <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> <a class="code" href="rs__types_8rsh.html#a86f99f382dc35fc8ad98b524fe6d5447">rs_quaternion</a>;
+<a name="l00365"></a>00365 
+<a name="l00366"></a>00366 <span class="preprocessor">#define RS_PACKED __attribute__((packed, aligned(4)))</span>
+<a name="l00367"></a>00367 <span class="preprocessor"></span><span class="preprocessor">#define NULL ((const void *)0)</span>
+<a name="l00368"></a>00368 <span class="preprocessor"></span>
+<a name="l00369"></a>00369 <span class="preprocessor">#if (defined(RS_VERSION) &amp;&amp; (RS_VERSION &gt;= 14))</span>
+<a name="l00370"></a>00370 <span class="preprocessor"></span>
+<a name="l00374"></a>00374 <span class="keyword">typedef</span> <span class="keyword">enum</span> {
+<a name="l00375"></a>00375     RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X = 0,
+<a name="l00376"></a>00376     RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_X = 1,
+<a name="l00377"></a>00377     RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_Y = 2,
+<a name="l00378"></a>00378     RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_Y = 3,
+<a name="l00379"></a>00379     RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_Z = 4,
+<a name="l00380"></a>00380     RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_Z = 5
+<a name="l00381"></a>00381 } rs_allocation_cubemap_face;
+<a name="l00382"></a>00382 
+<a name="l00389"></a>00389 <span class="keyword">typedef</span> <span class="keyword">enum</span> {
+<a name="l00390"></a>00390     RS_ALLOCATION_USAGE_SCRIPT = 0x0001,
+<a name="l00391"></a>00391     RS_ALLOCATION_USAGE_GRAPHICS_TEXTURE = 0x0002,
+<a name="l00392"></a>00392     RS_ALLOCATION_USAGE_GRAPHICS_VERTEX = 0x0004,
+<a name="l00393"></a>00393     RS_ALLOCATION_USAGE_GRAPHICS_CONSTANTS = 0x0008,
+<a name="l00394"></a>00394     RS_ALLOCATION_USAGE_GRAPHICS_RENDER_TARGET = 0x0010
+<a name="l00395"></a>00395 } rs_allocation_usage_type;
+<a name="l00396"></a>00396 
+<a name="l00397"></a>00397 <span class="preprocessor">#endif //defined(RS_VERSION) &amp;&amp; (RS_VERSION &gt;= 14)</span>
+<a name="l00398"></a>00398 <span class="preprocessor"></span>
+<a name="l00399"></a>00399 <span class="preprocessor">#endif</span>
+</pre></div></div>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/structrs__allocation.html b/docs/html/reference/renderscript/structrs__allocation.html
new file mode 100644
index 0000000..b166fdd
--- /dev/null
+++ b/docs/html/reference/renderscript/structrs__allocation.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>rs_allocation Struct Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li><a href="globals.html"><span>Globals</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">rs_allocation Struct Reference</div>  </div>
+</div>
+<div class="contents">
+<!-- doxytag: class="rs_allocation" -->
+<p>Opaque handle to a Renderscript allocation.  
+ <a href="structrs__allocation.html#details">More...</a></p>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>Opaque handle to a Renderscript allocation. </p>
+<p>See: android.renderscript.Allocation </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00121">121</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>/src/ics-mr1/frameworks/base/libs/rs/scriptc/<a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a></li>
+</ul>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/structrs__element.html b/docs/html/reference/renderscript/structrs__element.html
new file mode 100644
index 0000000..79cd090
--- /dev/null
+++ b/docs/html/reference/renderscript/structrs__element.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>rs_element Struct Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li><a href="globals.html"><span>Globals</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">rs_element Struct Reference</div>  </div>
+</div>
+<div class="contents">
+<!-- doxytag: class="rs_element" -->
+<p>Opaque handle to a Renderscript element.  
+ <a href="structrs__element.html#details">More...</a></p>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>Opaque handle to a Renderscript element. </p>
+<p>See: android.renderscript.Element </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00109">109</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>/src/ics-mr1/frameworks/base/libs/rs/scriptc/<a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a></li>
+</ul>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/structrs__font.html b/docs/html/reference/renderscript/structrs__font.html
new file mode 100644
index 0000000..83eb649
--- /dev/null
+++ b/docs/html/reference/renderscript/structrs__font.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>rs_font Struct Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li><a href="globals.html"><span>Globals</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">rs_font Struct Reference</div>  </div>
+</div>
+<div class="contents">
+<!-- doxytag: class="rs_font" -->
+<p>Opaque handle to a Renderscript font object.  
+ <a href="structrs__font.html#details">More...</a></p>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>Opaque handle to a Renderscript font object. </p>
+<p>See: android.renderscript.Font </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00169">169</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>/src/ics-mr1/frameworks/base/libs/rs/scriptc/<a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a></li>
+</ul>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/structrs__matrix2x2.html b/docs/html/reference/renderscript/structrs__matrix2x2.html
new file mode 100644
index 0000000..8789066
--- /dev/null
+++ b/docs/html/reference/renderscript/structrs__matrix2x2.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>rs_matrix2x2 Struct Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li><a href="globals.html"><span>Globals</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">rs_matrix2x2 Struct Reference</div>  </div>
+</div>
+<div class="contents">
+<!-- doxytag: class="rs_matrix2x2" -->
+<p>2x2 float matrix  
+ <a href="structrs__matrix2x2.html#details">More...</a></p>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>2x2 float matrix </p>
+<p>Native holder for RS matrix. Elements are stored in the array at the location [row*2 + col] </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00357">357</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>/src/ics-mr1/frameworks/base/libs/rs/scriptc/<a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a></li>
+</ul>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/structrs__matrix3x3.html b/docs/html/reference/renderscript/structrs__matrix3x3.html
new file mode 100644
index 0000000..2b036df
--- /dev/null
+++ b/docs/html/reference/renderscript/structrs__matrix3x3.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>rs_matrix3x3 Struct Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li><a href="globals.html"><span>Globals</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">rs_matrix3x3 Struct Reference</div>  </div>
+</div>
+<div class="contents">
+<!-- doxytag: class="rs_matrix3x3" -->
+<p>3x3 float matrix  
+ <a href="structrs__matrix3x3.html#details">More...</a></p>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>3x3 float matrix </p>
+<p>Native holder for RS matrix. Elements are stored in the array at the location [row*3 + col] </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00348">348</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>/src/ics-mr1/frameworks/base/libs/rs/scriptc/<a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a></li>
+</ul>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/structrs__matrix4x4.html b/docs/html/reference/renderscript/structrs__matrix4x4.html
new file mode 100644
index 0000000..c696108
--- /dev/null
+++ b/docs/html/reference/renderscript/structrs__matrix4x4.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>rs_matrix4x4 Struct Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li><a href="globals.html"><span>Globals</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">rs_matrix4x4 Struct Reference</div>  </div>
+</div>
+<div class="contents">
+<!-- doxytag: class="rs_matrix4x4" -->
+<p>4x4 float matrix  
+ <a href="structrs__matrix4x4.html#details">More...</a></p>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>4x4 float matrix </p>
+<p>Native holder for RS matrix. Elements are stored in the array at the location [row*4 + col] </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00339">339</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>/src/ics-mr1/frameworks/base/libs/rs/scriptc/<a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a></li>
+</ul>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/structrs__mesh.html b/docs/html/reference/renderscript/structrs__mesh.html
new file mode 100644
index 0000000..6f58a54
--- /dev/null
+++ b/docs/html/reference/renderscript/structrs__mesh.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>rs_mesh Struct Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li><a href="globals.html"><span>Globals</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">rs_mesh Struct Reference</div>  </div>
+</div>
+<div class="contents">
+<!-- doxytag: class="rs_mesh" -->
+<p>Opaque handle to a Renderscript mesh object.  
+ <a href="structrs__mesh.html#details">More...</a></p>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>Opaque handle to a Renderscript mesh object. </p>
+<p>See: android.renderscript.Mesh </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00139">139</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>/src/ics-mr1/frameworks/base/libs/rs/scriptc/<a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a></li>
+</ul>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/structrs__program__fragment.html b/docs/html/reference/renderscript/structrs__program__fragment.html
new file mode 100644
index 0000000..ed8eae7
--- /dev/null
+++ b/docs/html/reference/renderscript/structrs__program__fragment.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>rs_program_fragment Struct Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li><a href="globals.html"><span>Globals</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">rs_program_fragment Struct Reference</div>  </div>
+</div>
+<div class="contents">
+<!-- doxytag: class="rs_program_fragment" -->
+<p>Opaque handle to a Renderscript ProgramFragment object.  
+ <a href="structrs__program__fragment.html#details">More...</a></p>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>Opaque handle to a Renderscript ProgramFragment object. </p>
+<p>See: android.renderscript.ProgramFragment </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00145">145</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>/src/ics-mr1/frameworks/base/libs/rs/scriptc/<a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a></li>
+</ul>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/structrs__program__raster.html b/docs/html/reference/renderscript/structrs__program__raster.html
new file mode 100644
index 0000000..a914854
--- /dev/null
+++ b/docs/html/reference/renderscript/structrs__program__raster.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>rs_program_raster Struct Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li><a href="globals.html"><span>Globals</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">rs_program_raster Struct Reference</div>  </div>
+</div>
+<div class="contents">
+<!-- doxytag: class="rs_program_raster" -->
+<p>Opaque handle to a Renderscript ProgramRaster object.  
+ <a href="structrs__program__raster.html#details">More...</a></p>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>Opaque handle to a Renderscript ProgramRaster object. </p>
+<p>See: android.renderscript.ProgramRaster </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00157">157</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>/src/ics-mr1/frameworks/base/libs/rs/scriptc/<a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a></li>
+</ul>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/structrs__program__store.html b/docs/html/reference/renderscript/structrs__program__store.html
new file mode 100644
index 0000000..6ecfece
--- /dev/null
+++ b/docs/html/reference/renderscript/structrs__program__store.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>rs_program_store Struct Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li><a href="globals.html"><span>Globals</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">rs_program_store Struct Reference</div>  </div>
+</div>
+<div class="contents">
+<!-- doxytag: class="rs_program_store" -->
+<p>Opaque handle to a Renderscript ProgramStore object.  
+ <a href="structrs__program__store.html#details">More...</a></p>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>Opaque handle to a Renderscript ProgramStore object. </p>
+<p>See: android.renderscript.ProgramStore </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00163">163</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>/src/ics-mr1/frameworks/base/libs/rs/scriptc/<a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a></li>
+</ul>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/structrs__program__vertex.html b/docs/html/reference/renderscript/structrs__program__vertex.html
new file mode 100644
index 0000000..2b145a3
--- /dev/null
+++ b/docs/html/reference/renderscript/structrs__program__vertex.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>rs_program_vertex Struct Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li><a href="globals.html"><span>Globals</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">rs_program_vertex Struct Reference</div>  </div>
+</div>
+<div class="contents">
+<!-- doxytag: class="rs_program_vertex" -->
+<p>Opaque handle to a Renderscript ProgramVertex object.  
+ <a href="structrs__program__vertex.html#details">More...</a></p>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>Opaque handle to a Renderscript ProgramVertex object. </p>
+<p>See: android.renderscript.ProgramVertex </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00151">151</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>/src/ics-mr1/frameworks/base/libs/rs/scriptc/<a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a></li>
+</ul>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/structrs__sampler.html b/docs/html/reference/renderscript/structrs__sampler.html
new file mode 100644
index 0000000..58ea0de
--- /dev/null
+++ b/docs/html/reference/renderscript/structrs__sampler.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>rs_sampler Struct Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li><a href="globals.html"><span>Globals</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">rs_sampler Struct Reference</div>  </div>
+</div>
+<div class="contents">
+<!-- doxytag: class="rs_sampler" -->
+<p>Opaque handle to a Renderscript sampler object.  
+ <a href="structrs__sampler.html#details">More...</a></p>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>Opaque handle to a Renderscript sampler object. </p>
+<p>See: android.renderscript.Sampler </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00127">127</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>/src/ics-mr1/frameworks/base/libs/rs/scriptc/<a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a></li>
+</ul>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/structrs__script.html b/docs/html/reference/renderscript/structrs__script.html
new file mode 100644
index 0000000..0946635
--- /dev/null
+++ b/docs/html/reference/renderscript/structrs__script.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>rs_script Struct Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li><a href="globals.html"><span>Globals</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">rs_script Struct Reference</div>  </div>
+</div>
+<div class="contents">
+<!-- doxytag: class="rs_script" -->
+<p>Opaque handle to a Renderscript script object.  
+ <a href="structrs__script.html#details">More...</a></p>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>Opaque handle to a Renderscript script object. </p>
+<p>See: android.renderscript.ScriptC </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00133">133</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>/src/ics-mr1/frameworks/base/libs/rs/scriptc/<a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a></li>
+</ul>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/structrs__script__call.html b/docs/html/reference/renderscript/structrs__script__call.html
new file mode 100644
index 0000000..9ba0681
--- /dev/null
+++ b/docs/html/reference/renderscript/structrs__script__call.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>rs_script_call Struct Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li><a href="globals.html"><span>Globals</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">rs_script_call Struct Reference</div>  </div>
+</div>
+<div class="contents">
+<!-- doxytag: class="rs_script_call" --><hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>Structure to provide extra information to a rsForEach call. Primarly used to restrict the call to a subset of cells in the allocation. </p>
+
+<p>Definition at line <a class="el" href="rs__core_8rsh_source.html#l00088">88</a> of file <a class="el" href="rs__core_8rsh_source.html">rs_core.rsh</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>/src/ics-mr1/frameworks/base/libs/rs/scriptc/<a class="el" href="rs__core_8rsh_source.html">rs_core.rsh</a></li>
+</ul>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/structrs__tm.html b/docs/html/reference/renderscript/structrs__tm.html
new file mode 100644
index 0000000..80f8fe9
--- /dev/null
+++ b/docs/html/reference/renderscript/structrs__tm.html
@@ -0,0 +1,75 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>rs_tm Struct Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li><a href="globals.html"><span>Globals</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="summary">
+<a href="#pub-attribs">Data Fields</a>  </div>
+  <div class="headertitle">
+<div class="title">rs_tm Struct Reference</div>  </div>
+</div>
+<div class="contents">
+<!-- doxytag: class="rs_tm" --><table class="memberdecls">
+<tr><td colspan="2"><h2><a name="pub-attribs"></a>
+Data Fields</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae1590aa8850370a4712da801edb8da9e"></a><!-- doxytag: member="rs_tm::tm_sec" ref="ae1590aa8850370a4712da801edb8da9e" args="" -->
+int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrs__tm.html#ae1590aa8850370a4712da801edb8da9e">tm_sec</a></td></tr>
+<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">seconds <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abd4bd6ccf0d1f20859ecaecf850ce85b"></a><!-- doxytag: member="rs_tm::tm_min" ref="abd4bd6ccf0d1f20859ecaecf850ce85b" args="" -->
+int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrs__tm.html#abd4bd6ccf0d1f20859ecaecf850ce85b">tm_min</a></td></tr>
+<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">minutes <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afb46962bc20f8724567981adc3711b5a"></a><!-- doxytag: member="rs_tm::tm_hour" ref="afb46962bc20f8724567981adc3711b5a" args="" -->
+int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrs__tm.html#afb46962bc20f8724567981adc3711b5a">tm_hour</a></td></tr>
+<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">hours <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac87e43828f05bf62d0c770889b81ff15"></a><!-- doxytag: member="rs_tm::tm_mday" ref="ac87e43828f05bf62d0c770889b81ff15" args="" -->
+int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrs__tm.html#ac87e43828f05bf62d0c770889b81ff15">tm_mday</a></td></tr>
+<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">day of the month <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a34a5466d376e405f343ed4e1592d7832"></a><!-- doxytag: member="rs_tm::tm_mon" ref="a34a5466d376e405f343ed4e1592d7832" args="" -->
+int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrs__tm.html#a34a5466d376e405f343ed4e1592d7832">tm_mon</a></td></tr>
+<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">month <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a74e582a615a448949969a0982d8a62d2"></a><!-- doxytag: member="rs_tm::tm_year" ref="a74e582a615a448949969a0982d8a62d2" args="" -->
+int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrs__tm.html#a74e582a615a448949969a0982d8a62d2">tm_year</a></td></tr>
+<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">year <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4d40217d3cd15b51e0093db1810426e4"></a><!-- doxytag: member="rs_tm::tm_wday" ref="a4d40217d3cd15b51e0093db1810426e4" args="" -->
+int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrs__tm.html#a4d40217d3cd15b51e0093db1810426e4">tm_wday</a></td></tr>
+<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">day of the week <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a589eab24c4d79f05f0b3601162ed34d0"></a><!-- doxytag: member="rs_tm::tm_yday" ref="a589eab24c4d79f05f0b3601162ed34d0" args="" -->
+int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrs__tm.html#a589eab24c4d79f05f0b3601162ed34d0">tm_yday</a></td></tr>
+<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">day of the year <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8cffdd224d2ea30a079a86ef1e41e111"></a><!-- doxytag: member="rs_tm::tm_isdst" ref="a8cffdd224d2ea30a079a86ef1e41e111" args="" -->
+int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrs__tm.html#a8cffdd224d2ea30a079a86ef1e41e111">tm_isdst</a></td></tr>
+<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">daylight savings time <br/></td></tr>
+</table>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>Data structure for broken-down time components.</p>
+<p>tm_sec - Seconds after the minute. This ranges from 0 to 59, but possibly up to 60 for leap seconds. tm_min - Minutes after the hour. This ranges from 0 to 59. tm_hour - Hours past midnight. This ranges from 0 to 23. tm_mday - Day of the month. This ranges from 1 to 31. tm_mon - Months since January. This ranges from 0 to 11. tm_year - Years since 1900. tm_wday - Days since Sunday. This ranges from 0 to 6. tm_yday - Days since January 1. This ranges from 0 to 365. tm_isdst - Flag to indicate whether daylight saving time is in effect. The value is positive if it is in effect, zero if it is not, and negative if the information is not available. </p>
+
+<p>Definition at line <a class="el" href="rs__time_8rsh_source.html#l00049">49</a> of file <a class="el" href="rs__time_8rsh_source.html">rs_time.rsh</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>/src/ics-mr1/frameworks/base/libs/rs/scriptc/<a class="el" href="rs__time_8rsh_source.html">rs_time.rsh</a></li>
+</ul>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/structrs__type.html b/docs/html/reference/renderscript/structrs__type.html
new file mode 100644
index 0000000..f8eec3e
--- /dev/null
+++ b/docs/html/reference/renderscript/structrs__type.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+
+<title>rs_type Struct Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+
+
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+
+<!-- Generated by Doxygen 1.7.5.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Overview</span></a></li>
+      <li><a href="globals.html"><span>Globals</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Structs</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="header">
+  <div class="headertitle">
+<div class="title">rs_type Struct Reference</div>  </div>
+</div>
+<div class="contents">
+<!-- doxytag: class="rs_type" -->
+<p>Opaque handle to a Renderscript type.  
+ <a href="structrs__type.html#details">More...</a></p>
+<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<div class="textblock"><p>Opaque handle to a Renderscript type. </p>
+<p>See: android.renderscript.Type </p>
+
+<p>Definition at line <a class="el" href="rs__types_8rsh_source.html#l00115">115</a> of file <a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>/src/ics-mr1/frameworks/base/libs/rs/scriptc/<a class="el" href="rs__types_8rsh_source.html">rs_types.rsh</a></li>
+</ul>
+</div>
+
+</body>
+</html>
diff --git a/docs/html/reference/renderscript/tab_a.png b/docs/html/reference/renderscript/tab_a.png
new file mode 100644
index 0000000..2d99ef2
--- /dev/null
+++ b/docs/html/reference/renderscript/tab_a.png
Binary files differ
diff --git a/docs/html/reference/renderscript/tab_b.png b/docs/html/reference/renderscript/tab_b.png
new file mode 100644
index 0000000..b2c3d2b
--- /dev/null
+++ b/docs/html/reference/renderscript/tab_b.png
Binary files differ
diff --git a/docs/html/reference/renderscript/tab_h.png b/docs/html/reference/renderscript/tab_h.png
new file mode 100644
index 0000000..c11f48f
--- /dev/null
+++ b/docs/html/reference/renderscript/tab_h.png
Binary files differ
diff --git a/docs/html/reference/renderscript/tab_s.png b/docs/html/reference/renderscript/tab_s.png
new file mode 100644
index 0000000..978943a
--- /dev/null
+++ b/docs/html/reference/renderscript/tab_s.png
Binary files differ
diff --git a/docs/html/reference/renderscript/tabs.css b/docs/html/reference/renderscript/tabs.css
new file mode 100644
index 0000000..2192056
--- /dev/null
+++ b/docs/html/reference/renderscript/tabs.css
@@ -0,0 +1,59 @@
+.tabs, .tabs2, .tabs3 {
+    background-image: url('tab_b.png');
+    width: 100%;
+    z-index: 101;
+    font-size: 13px;
+}
+
+.tabs2 {
+    font-size: 10px;
+}
+.tabs3 {
+    font-size: 9px;
+}
+
+.tablist {
+    margin: 0;
+    padding: 0;
+    display: table;
+}
+
+.tablist li {
+    float: left;
+    display: table-cell;
+    background-image: url('tab_b.png');
+    line-height: 36px;
+    list-style: none;
+}
+
+.tablist a {
+    display: block;
+    padding: 0 20px;
+    font-weight: bold;
+    background-image:url('tab_s.png');
+    background-repeat:no-repeat;
+    background-position:right;
+    color: #283A5D;
+    text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
+    text-decoration: none;
+    outline: none;
+}
+
+.tabs3 .tablist a {
+    padding: 0 10px;
+}
+
+.tablist a:hover {
+    background-image: url('tab_h.png');
+    background-repeat:repeat-x;
+    color: #fff;
+    text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);
+    text-decoration: none;
+}
+
+.tablist li.current a {
+    background-image: url('tab_a.png');
+    background-repeat:repeat-x;
+    color: #fff;
+    text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);
+}
diff --git a/docs/html/resources/community-more.jd b/docs/html/resources/community-more.jd
index df72926..3089d45 100644
--- a/docs/html/resources/community-more.jd
+++ b/docs/html/resources/community-more.jd
@@ -1,5 +1,5 @@
 community=true
-page.title=IRC and Twitter
+page.title=IRC, G+, Twitter
 @jd:body
 
 <p>In addition to the <a href="community-groups.html">Android developer forums</a>, you can participate in the Android developer community through IRC and you can follow us on Twitter. </p>
@@ -45,8 +45,27 @@
 </li>
 </ul>
 
+
+<h3 id="gplus">Google+</h3>
+<p>We use a Google+ page to host Hangouts for developers, talk about the latest
+releases, development and design tips, and much more.</p>
+
+<div style='margin-top:1em'><g:plus href='https://plus.google.com/108967384991768947849'
+size='badge'></g:plus></div>
+
+
 <h3 id="twitter">Twitter</h3>
 <p>You can follow us on Twitter at this account:</p>
 
 <p style="margin-left:2em;"><a href="http://twitter.com/androiddev">http://twitter.com/androiddev</a></p>
 
+<script type="text/javascript" src="https://plus.google.com/108967384991768947849"
+rel="publisher"></script>
+<script type="text/javascript">
+window.___gcfg = {lang: 'en'};
+(function() 
+{var po = document.createElement("script");
+po.type = "text/javascript"; po.async = true;po.src = "https://apis.google.com/js/plusone.js";
+var s = document.getElementsByTagName("script")[0];
+s.parentNode.insertBefore(po, s);
+})();</script>
\ No newline at end of file
diff --git a/docs/html/resources/dashboard/opengl.jd b/docs/html/resources/dashboard/opengl.jd
index 357c1ea..d55ab2b 100644
--- a/docs/html/resources/dashboard/opengl.jd
+++ b/docs/html/resources/dashboard/opengl.jd
@@ -57,7 +57,7 @@
 <div class="dashboard-panel">
 
 <img alt="" width="400" height="250"
-src="http://chart.googleapis.com/chart?cht=p&chs=400x250&chco=c4df9b,6fad0c&chl=GL%201.1|GL%202.0%20%26%201.1&chd=t%3A9.5,90.5" />
+src="http://chart.googleapis.com/chart?cht=p&chs=400x250&chco=c4df9b,6fad0c&chl=GL%201.1%20only|GL%202.0%20%26%201.1&chd=t%3A10.7,89.3" />
 
 <table>
 <tr>
@@ -65,15 +65,15 @@
 <th scope="col">Distribution</th>
 </tr>
 <tr>
-<td>1.1</th>
-<td>9.5%</td>
+<td>1.1 only</th>
+<td>10.7%</td>
 </tr>
 <tr>
-<td>2.0</th>
-<td>90.5%</td>
+<td>2.0 &amp; 1.1</th>
+<td>89.3%</td>
 </tr>
 </table>
 
-<p><em>Data collected during a 7-day period ending on January 3, 2012</em></p>
+<p><em>Data collected during a 7-day period ending on February 1, 2012</em></p>
 </div>
 
diff --git a/docs/html/resources/dashboard/platform-versions.jd b/docs/html/resources/dashboard/platform-versions.jd
index 2618a04..4ea52af 100644
--- a/docs/html/resources/dashboard/platform-versions.jd
+++ b/docs/html/resources/dashboard/platform-versions.jd
@@ -52,7 +52,7 @@
 <div class="dashboard-panel">
 
 <img alt="" height="250" width="470"
-src="http://chart.apis.google.com/chart?&cht=p&chs=460x250&chd=t:0.6,1.1,8.5,30.4,0.6,54.9,0.1,1.5,1.7,0.3,0.3&chl=Android%201.5|Android%201.6|Android%202.1|Android%202.2|Android%202.3|Android%202.3.3|Android%203.0|Android%203.1|Android%203.2|Android%204.0|Android%204.0.3&chco=c4df9b,6fad0c" />
+src="http://chart.apis.google.com/chart?&cht=p&chs=460x250&chd=t:0.6,1.0,7.6,27.8,0.5,58.1,0.1,1.4,1.9,0.3,0.7&chl=Android%201.5|Android%201.6|Android%202.1|Android%202.2|Android%202.3|Android%202.3.3|Android%203.0|Android%203.1|Android%203.2|Android%204.0|Android%204.0.3&chco=c4df9b,6fad0c" />
 
 <table>
 <tr>
@@ -62,24 +62,24 @@
   <th>Distribution</th>
 </tr>
 <tr><td><a href="{@docRoot}sdk/android-1.5.html">Android 1.5</a></td><td>Cupcake</td>  <td>3</td><td>0.6%</td></tr>
-<tr><td><a href="{@docRoot}sdk/android-1.6.html">Android 1.6</a></td><td>Donut</td>    <td>4</td><td>1.1%</td></tr>
-<tr><td><a href="{@docRoot}sdk/android-2.1.html">Android 2.1</a></td><td>Eclair</td>   <td>7</td><td>8.5%</td></tr>
-<tr><td><a href="{@docRoot}sdk/android-2.2.html">Android 2.2</a></td><td>Froyo</td>    <td>8</td><td>30.4%</td></tr>
+<tr><td><a href="{@docRoot}sdk/android-1.6.html">Android 1.6</a></td><td>Donut</td>    <td>4</td><td>1.0%</td></tr>
+<tr><td><a href="{@docRoot}sdk/android-2.1.html">Android 2.1</a></td><td>Eclair</td>   <td>7</td><td>7.6%</td></tr>
+<tr><td><a href="{@docRoot}sdk/android-2.2.html">Android 2.2</a></td><td>Froyo</td>    <td>8</td><td>27.8%</td></tr>
 <tr><td><a href="{@docRoot}sdk/android-2.3.html">Android 2.3 -<br/>
-                             Android 2.3.2</a></td><td rowspan="2">Gingerbread</td>    <td>9</td><td>0.6%</td></tr>
+                             Android 2.3.2</a></td><td rowspan="2">Gingerbread</td>    <td>9</td><td>0.5%</td></tr>
 <tr><td><a href="{@docRoot}sdk/android-2.3.3.html">Android 2.3.3 -<br/>
-      Android 2.3.7</a></td><!-- Gingerbread -->                                       <td>10</td><td>54.9%</td></tr>
+      Android 2.3.7</a></td><!-- Gingerbread -->                                       <td>10</td><td>58.1%</td></tr>
 <tr><td><a href="{@docRoot}sdk/android-3.0.html">Android 3.0</a></td>
                                                    <td rowspan="3">Honeycomb</td>      <td>11</td><td>0.1%</td></tr>
-<tr><td><a href="{@docRoot}sdk/android-3.1.html">Android 3.1</a></td><!-- Honeycomb --><td>12</td><td>1.5%</td></tr>
-<tr><td><a href="{@docRoot}sdk/android-3.2.html">Android 3.2</a></td><!-- Honeycomb --><td>13</td><td>1.7%</td></tr> 
+<tr><td><a href="{@docRoot}sdk/android-3.1.html">Android 3.1</a></td><!-- Honeycomb --><td>12</td><td>1.4%</td></tr>
+<tr><td><a href="{@docRoot}sdk/android-3.2.html">Android 3.2</a></td><!-- Honeycomb --><td>13</td><td>1.9%</td></tr> 
 <tr><td><a href="{@docRoot}sdk/android-4.0.html">Android 4.0 -<br/>
                                                Android 4.0.2</a></td>
                                                 <td rowspan="2">Ice Cream Sandwich</td><td>14</td><td>0.3%</td></tr> 
-<tr><td><a href="{@docRoot}sdk/android-4.0.3.html">Android 4.0.3</a></td><!-- ICS     --><td>15</td><td>0.3%</td></tr> 
+<tr><td><a href="{@docRoot}sdk/android-4.0.3.html">Android 4.0.3</a></td><!-- ICS     --><td>15</td><td>0.7%</td></tr> 
 </table>
 
-<p><em>Data collected during a 14-day period ending on January 3, 2012</em></p>
+<p><em>Data collected during a 14-day period ending on February 1, 2012</em></p>
 <!--
 <p style="font-size:.9em">* <em>Other: 0.1% of devices running obsolete versions</em></p>
 -->
@@ -108,9 +108,9 @@
 <div class="dashboard-panel">
 
 <img alt="" height="250" width="660" style="padding:5px;background:#fff"
-src="http://chart.apis.google.com/chart?&cht=lc&chs=660x250&chxt=x,x,y,r&chxr=0,0,12|1,0,12|2,0,100|3,0,100&chxl=0%3A%7C07/01%7C07/15%7C08/01%7C08/15%7C09/01%7C09/15%7C10/01%7C10/15%7C11/01%7C11/15%7C12/01%7C12/15%7C01/01%7C1%3A%7C2011%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C2012%7C2%3A%7C0%25%7C25%25%7C50%25%7C75%25%7C100%25%7C3%3A%7C0%25%7C25%25%7C50%25%7C75%25%7C100%25&chxp=0,0,1,2,3,4,5,6,7,8,9,10,11,12&chxtc=0,5&chd=t:99.2,99.0,98.8,98.7,98.5,98.5,98.2,98.1,98.0,99.9,99.9,99.7,99.2|97.7,97.6,97.5,97.5,97.5,97.5,97.1,97.1,97.0,99.1,99.1,99.0,98.6|95.5,95.5,95.5,95.6,95.7,95.8,95.6,95.9,95.7,97.7,97.8,97.8,97.5|77.6,79.0,80.2,81.1,82.4,83.3,83.8,84.9,85.1,87.5,88.2,88.6,89.0|17.8,20.6,24.3,27.5,31.2,34.7,38.3,41.3,44.0,48.9,52.9,55.7,58.5|16.8,20.0,23.7,26.9,30.6,34.1,37.8,40.8,43.5,48.4,52.4,55.2,57.9|0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.0,2.3,2.6,3.2|0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.2,1.3,1.7&chm=b,c3df9b,0,1,0|b,b8dc82,1,2,0|tAndroid 2.1,608920,2,0,15,,t::-5|b,addb67,2,3,0|tAndroid 2.2,517617,3,0,15,,t::-5|b,a3db4b,3,4,0|b,98dc2e,4,5,0|tAndroid 2.3.3,334d0a,5,0,15,,t::-5|b,8cd41b,5,6,0|b,7ec113,6,7,0|B,6fad0c,7,8,0&chg=7,25&chdl=Android 1.5|Android 1.6|Android 2.1|Android 2.2|Android 2.3|Android 2.3.3|Android 3.1|Android 3.2&chco=add274,a2d15a,97d13e,8bcb28,7dba1e,6ea715,5f920e,507d08" />
+src="http://chart.apis.google.com/chart?&cht=lc&chs=660x250&chxt=x,x,y,r&chxr=0,0,12|1,0,12|2,0,100|3,0,100&chxl=0%3A%7C08/01%7C08/15%7C09/01%7C09/15%7C10/01%7C10/15%7C11/01%7C11/15%7C12/01%7C12/15%7C01/01%7C01/15%7C02/01%7C1%3A%7C2011%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C2012%7C%7C2012%7C2%3A%7C0%25%7C25%25%7C50%25%7C75%25%7C100%25%7C3%3A%7C0%25%7C25%25%7C50%25%7C75%25%7C100%25&chxp=0,0,1,2,3,4,5,6,7,8,9,10,11,12&chxtc=0,5&chd=t:98.2,98.1,97.9,97.9,97.7,97.6,97.5,99.4,99.4,99.2,98.6,98.4,98.5|96.9,96.9,96.9,96.9,96.6,96.6,96.5,98.6,98.6,98.5,98.0,97.8,97.9|94.9,95.0,95.1,95.2,95.1,95.4,95.2,97.2,97.3,97.3,96.9,96.8,96.9|79.6,80.5,81.8,82.7,83.3,84.4,84.6,87.0,87.7,88.1,88.4,88.8,89.2|23.7,26.9,30.6,34.1,37.8,40.8,43.5,48.4,52.4,55.2,57.9,59.7,61.3|0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.0,2.3,2.6,3.2,3.2,3.3|0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.2,1.3,1.7,1.8,1.9&chm=b,c3df9b,0,1,0|b,b6dc7d,1,2,0|tAndroid%202.1,5b831d,2,0,15,,t::-5|b,aadb5e,2,3,0|tAndroid%202.2,496c13,3,0,15,,t::-5|b,9ddb3d,3,4,0|tAndroid%202.3.3,38540b,4,0,15,,t::-5|b,91da1e,4,5,0|b,80c414,5,6,0|B,6fad0c,6,7,0&chg=7,25&chdl=Android%201.5|Android%201.6|Android%202.1|Android%202.2|Android%202.3.3|Android%203.1|Android%203.2&chco=add274,a0d155,94d134,84c323,73ad18,62960f,507d08" />
 
-<p><em>Last historical dataset collected during a 14-day period ending on January 3, 2012</em></p>
+<p><em>Last historical dataset collected during a 14-day period ending on February 1, 2012</em></p>
 
 
 </div><!-- end dashboard-panel -->
diff --git a/docs/html/resources/dashboard/screens.jd b/docs/html/resources/dashboard/screens.jd
index 79d59d9..ae5cdc7 100644
--- a/docs/html/resources/dashboard/screens.jd
+++ b/docs/html/resources/dashboard/screens.jd
@@ -60,7 +60,7 @@
 <div class="dashboard-panel">
 
 <img alt="" width="400" height="250"
-src="http://chart.googleapis.com/chart?cht=p&chs=400x250&chco=c4df9b,6fad0c&chl=Xlarge%20/%20mdpi|Large%20/%20ldpi|Large%20/%20mdpi|Normal%20/%20hdpi|Normal%20/%20ldpi|Normal%20/%20mdpi|Small%20/%20hdpi|Small%20/%20ldpi&chd=t%3A3.1,0.1,3.1,71.0,1.0,17.5,2.9,1.3" />
+src="http://chart.googleapis.com/chart?cht=p&chs=400x250&chco=c4df9b,6fad0c&chl=Xlarge%20/%20mdpi|Large%20/%20ldpi|Large%20/%20mdpi|Normal%20/%20hdpi|Normal%20/%20ldpi|Normal%20/%20mdpi|Normal%20/%20xhdpi|Small%20/%20hdpi|Small%20/%20ldpi&chd=t%3A4.8,0.2,2.9,67.1,0.7,18.4,1.8,2.5,1.6" />
 
 <table>
 <tr>
@@ -71,31 +71,31 @@
 <th scope="col">xhdpi</th>
 </tr>
 <tr><th scope="row">small</th> 
-<td>1.3%</td>     <!-- small/ldpi -->
+<td>1.6%</td>     <!-- small/ldpi -->
 <td></td>     <!-- small/mdpi -->
-<td>2.9%</td> <!-- small/hdpi -->
+<td>2.5%</td> <!-- small/hdpi -->
 <td></td>     <!-- small/xhdpi -->
 </tr> 
 <tr><th scope="row">normal</th> 
-<td>1.0%</td>  <!-- normal/ldpi -->
-<td>17.5%</td> <!-- normal/mdpi -->
-<td>71%</td> <!-- normal/hdpi -->
-<td></td>      <!-- normal/xhdpi -->
+<td>0.7%</td>  <!-- normal/ldpi -->
+<td>18.4%</td> <!-- normal/mdpi -->
+<td>67.1%</td> <!-- normal/hdpi -->
+<td>1.8%</td>      <!-- normal/xhdpi -->
 </tr> 
 <tr><th scope="row">large</th> 
-<td>0.1%</td>     <!-- large/ldpi -->
-<td>3.1%</td> <!-- large/mdpi -->
+<td>0.2%</td>     <!-- large/ldpi -->
+<td>2.9%</td> <!-- large/mdpi -->
 <td></td>     <!-- large/hdpi -->
 <td></td>     <!-- large/xhdpi -->
 </tr> 
 <tr><th scope="row">xlarge</th> 
 <td></td>     <!-- xlarge/ldpi -->
-<td>3.1%</td> <!-- xlarge/mdpi -->
+<td>4.8%</td> <!-- xlarge/mdpi -->
 <td></td>     <!-- xlarge/hdpi -->
 <td></td>     <!-- xlarge/xhdpi -->
 </tr> 
 </table>
 
-<p><em>Data collected during a 7-day period ending on December 1, 2011</em></p>
+<p><em>Data collected during a 7-day period ending on February 1, 2012</em></p>
 </div>
 
diff --git a/docs/html/resources/resources_toc.cs b/docs/html/resources/resources_toc.cs
index 8df419f..8483037 100644
--- a/docs/html/resources/resources_toc.cs
+++ b/docs/html/resources/resources_toc.cs
@@ -1,7 +1,8 @@
 <ul>
   <li>
-    <h2><span class="en">Android Training</span>
-    </h2>
+    <span class="heading">
+      <span class="en">Android Training</span>
+    </span>
     <ul>
       
       <li><a href="<?cs var:toroot ?>training/index.html">
@@ -237,8 +238,9 @@
       
       
   <li>
-    <h2><span class="en">Technical Resources</span>
-    </h2>
+    <span class="heading">
+      <span class="en">Technical Resources</span>
+    </span>
     <ul>
       <li class="toggle-list">
         <div><a href="<?cs var:toroot ?>resources/browser.html?tag=sample">
@@ -288,29 +290,31 @@
     </ul>
   </li>
   <li>
-    <h2><span class="en">Community</span>
-               <span style="display:none" class="de"></span>
-               <span style="display:none" class="es">Comunidad</span>
-               <span style="display:none" class="fr">Communauté</span>
-               <span style="display:none" class="it"></span>
-               <span style="display:none" class="ja">コミュニティ</span>
-               <span style="display:none" class="zh-CN">社区</span>
-               <span style="display:none" class="zh-TW">社群</span>
-    </h2>
+    <span class="heading">
+      <span class="en">Community</span>
+      <span style="display:none" class="de"></span>
+      <span style="display:none" class="es">Comunidad</span>
+      <span style="display:none" class="fr">Communauté</span>
+      <span style="display:none" class="it"></span>
+      <span style="display:none" class="ja">コミュニティ</span>
+      <span style="display:none" class="zh-CN">社区</span>
+      <span style="display:none" class="zh-TW">社群</span>
+    </span>
     <ul>
       <li><a href="<?cs var:toroot ?>resources/community-groups.html">
             <span class="en">Developer Forums</span>
           </a></li>
       <li><a href="<?cs var:toroot ?>resources/community-more.html">
-            <span class="en">IRC, Twitter</span>
+            <span class="en">IRC, G+, Twitter</span>
           </a></li>
     </ul>
   </li>
 <?cs
   if:android.whichdoc == "online" ?>
   <li>
-    <h2><span class="en">Device Dashboard</span>
-    </h2>
+    <span class="heading">
+      <span class="en">Device Dashboard</span>
+    </span>
     <ul>
       <li><a href="<?cs var:toroot ?>resources/dashboard/platform-versions.html">
             <span class="en">Platform Versions</span>
@@ -327,7 +331,9 @@
 ?>
 
   <li>
-   <h2><span class="en">More</span></h2>
+    <span class="heading">
+      <span class="en">More</span>
+    </span>
     <ul>
       <li><a href="<?cs var:toroot ?>resources/faq/commontasks.html">
             <span class="en">Common Tasks </span>
diff --git a/docs/html/resources/tutorials/hello-world.jd b/docs/html/resources/tutorials/hello-world.jd
index 9afab6a..cc8cb3e 100644
--- a/docs/html/resources/tutorials/hello-world.jd
+++ b/docs/html/resources/tutorials/hello-world.jd
@@ -24,7 +24,7 @@
 management to greatly speed up your development cycles.</p>
 
 <p>This tutorial assumes that you're using Eclipse. If you're using the command line, see
-<a href="{@docRoot}/guide/developing/building/building-cmdline.html">Building and Running from the
+<a href="{@docRoot}guide/developing/building/building-cmdline.html">Building and Running from the
 Command Line</a>. You can then return to this tutorial and ignore anything about Eclipse.</p>
 
 <p>Before you start, you should already have the SDK installed, and if you're
diff --git a/docs/html/sdk/RELEASENOTES.jd b/docs/html/sdk/RELEASENOTES.jd
index bf091e9..91eb57f 100644
--- a/docs/html/sdk/RELEASENOTES.jd
+++ b/docs/html/sdk/RELEASENOTES.jd
@@ -657,8 +657,8 @@
 <p><strong>T-Mobile G1 Compatibility</strong></p>
 
 <p>This version of the SDK has been tested for compatibility with the first 
-Android-powered mobile device, the <a href="http://www.t-mobileg1.com">T-Mobile
-G1</a>. </p>
+Android-powered mobile device, the T-Mobile
+G1. </p>
 
 <p><strong>MapView API Key</strong></p>
 
diff --git a/docs/html/sdk/android-1.1.jd b/docs/html/sdk/android-1.1.jd
index 8123fa8..b61f186 100644
--- a/docs/html/sdk/android-1.1.jd
+++ b/docs/html/sdk/android-1.1.jd
@@ -106,7 +106,7 @@
 <p>The Android 1.1 system image was tested for compatability with the
 Android-powered devices listed below:</p>
 	<ul>
-	<li><a href="http://www.t-mobileg1.com">T-Mobile G1</a></li>
+	<li>T-Mobile G1</li>
 	</ul>
 
 <h2 id="apps">Built-in Applications</h2>
diff --git a/docs/html/sdk/android-2.3.3.jd b/docs/html/sdk/android-2.3.3.jd
index 7a5b044..023e2e4 100644
--- a/docs/html/sdk/android-2.3.3.jd
+++ b/docs/html/sdk/android-2.3.3.jd
@@ -336,7 +336,7 @@
 <li>English, New Zealand (en_NZ)</li>
 <li>English, Singapore(en_SG)</li>
 <li>English, US (en_US)</li>
-<li>English, Zimbabwe (en_ZA)</li>
+<li>English, South Africa (en_ZA)</li>
 <li>Spanish (es_ES)</li>
 <li>Spanish, US (es_US)</li>
 <li>Finnish, Finland (fi_FI)</li>
diff --git a/docs/html/sdk/android-2.3.4.jd b/docs/html/sdk/android-2.3.4.jd
index 4cb44b9..eeaa69a 100644
--- a/docs/html/sdk/android-2.3.4.jd
+++ b/docs/html/sdk/android-2.3.4.jd
@@ -296,7 +296,7 @@
 <li>English, New Zealand (en_NZ)</li>
 <li>English, Singapore(en_SG)</li>
 <li>English, US (en_US)</li>
-<li>English, Zimbabwe (en_ZA)</li>
+<li>English, South Africa (en_ZA)</li>
 <li>Spanish (es_ES)</li>
 <li>Spanish, US (es_US)</li>
 <li>Finnish, Finland (fi_FI)</li>
diff --git a/docs/html/sdk/android-2.3.jd b/docs/html/sdk/android-2.3.jd
index e7aa0fa..fc4f5aa 100644
--- a/docs/html/sdk/android-2.3.jd
+++ b/docs/html/sdk/android-2.3.jd
@@ -859,7 +859,7 @@
 <li>English, New Zealand (en_NZ)</li>
 <li>English, Singapore(en_SG)</li>
 <li>English, US (en_US)</li>
-<li>English, Zimbabwe (en_ZA)</li>
+<li>English, South Africa (en_ZA)</li>
 <li>Spanish (es_ES)</li>
 <li>Spanish, US (es_US)</li>
 <li>Finnish, Finland (fi_FI)</li>
diff --git a/docs/html/sdk/android-3.0.jd b/docs/html/sdk/android-3.0.jd
index 7b04446..49fefee 100644
--- a/docs/html/sdk/android-3.0.jd
+++ b/docs/html/sdk/android-3.0.jd
@@ -262,8 +262,8 @@
 
 <p>For more information, read the <a href="{@docRoot}guide/topics/clipboard/copy-paste.html">Copy
 and Paste</a> documentation. You can also see a simple implementation of copy and paste in the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/content/ClipboardSample.
-html">API Demos</a> and a more complete implementation in the <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/content/ClipboardSample.html">API Demos</a>
+and a more complete implementation in the <a
 href="{@docRoot}resources/samples/NotePad/index.html">Note Pad</a> application.</p>
 
 
@@ -386,7 +386,7 @@
 <p>For more information, read the <a
 href="{@docRoot}guide/topics/fundamentals/loaders.html">Loaders</a> documentation. You can also see
 example code using loaders in the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/FragmentListCursorLoader.html">FragmentListCursorLoader</a>
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/LoaderCursor.html">LoaderCursor</a>
 and <a
 href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/LoaderThrottle.html">
 LoaderThrottle</a> samples.</p>
@@ -1119,7 +1119,7 @@
 <li>English, New Zealand (en_NZ)</li>
 <li>English, Singapore(en_SG)</li>
 <li>English, US (en_US)</li>
-<li>English, Zimbabwe (en_ZA)</li>
+<li>English, South Africa (en_ZA)</li>
 <li>Spanish (es_ES)</li>
 <li>Spanish, US (es_US)</li>
 <li>Finnish, Finland (fi_FI)</li>
diff --git a/docs/html/sdk/android-3.1.jd b/docs/html/sdk/android-3.1.jd
index 0d2d7f8..b9cf969 100644
--- a/docs/html/sdk/android-3.1.jd
+++ b/docs/html/sdk/android-3.1.jd
@@ -422,10 +422,9 @@
 
 <p class="note">To look at a sample application that uses joystick motion
 events, see <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/
-GameControllerInput.html">GameControllerInput</a> and <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/
-GameView.html">GameView</a>.</p>
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/GameControllerInput.html">GameControllerInput</a> 
+and <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/GameView.html">GameView</a>.</p>
 
 <h3>RTP API</h3>
 
@@ -931,7 +930,7 @@
 href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code
 &lt;uses-feature&gt;}</a> manifest elements. For more information about
 declaring features in an application manifest, read <a
-href="{docRoot}guide/appendix/market-filters.html">Android Market
+href="{@docRoot}guide/appendix/market-filters.html">Android Market
 Filters</a>.</p>
 
 
@@ -1041,7 +1040,7 @@
 <li>English, New Zealand (en_NZ)</li>
 <li>English, Singapore(en_SG)</li>
 <li>English, US (en_US)</li>
-<li>English, Zimbabwe (en_ZA)</li>
+<li>English, South Africa (en_ZA)</li>
 <li>Spanish (es_ES)</li>
 <li>Spanish, US (es_US)</li>
 <li>Finnish, Finland (fi_FI)</li>
diff --git a/docs/html/sdk/android-4.0.3.jd b/docs/html/sdk/android-4.0.3.jd
index c17a422..809c83c 100644
--- a/docs/html/sdk/android-4.0.3.jd
+++ b/docs/html/sdk/android-4.0.3.jd
@@ -58,12 +58,34 @@
 environment, refer to the "Installed Packages" listing in the Android SDK
 Manager.</p>
 
+<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 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" style="padding-left:1em;">
 
   <p><a href="#" onclick="return toggleContent(this)">
     <img src="{@docRoot}assets/images/triangle-opened.png"
 class="toggle-content-img" alt="" />
+    Android {@sdkPlatformVersion}, Revision 2</a> <em>(January 2012)</em>
+  </a></p>
+
+  <div class="toggle-content-toggleme" style="padding-left:2em;">
+
+<dl>
+<dt>Maintenance release. SDK Tools r14 or higher is required.
+</dt>
+</dl>
+
+  </div>
+</div>
+
+<div class="toggle-content closed" style="padding-left:1em;">
+
+  <p><a href="#" onclick="return toggleContent(this)">
+    <img src="{@docRoot}assets/images/triangle-closed.png"
+class="toggle-content-img" alt="" />
     Android {@sdkPlatformVersion}, Revision 1</a> <em>(December 2011)</em>
   </a></p>
 
@@ -71,17 +93,12 @@
 
 <dl>
 <dt>Initial release. SDK Tools r14 or higher is required.
-  <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 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>
 </dt>
 </dl>
 
   </div>
 </div>
 
-
 <h2 id="api">API Overview</h2>
 
 <p>The sections below provide a technical overview of new APIs in Android 4.0.3.</p>
@@ -418,7 +435,7 @@
 <li>English, New Zealand (en_NZ)</li>
 <li>English, Singapore(en_SG)</li>
 <li>English, US (en_US)</li>
-<li>English, Zimbabwe (en_ZA)</li>
+<li>English, South Africa (en_ZA)</li>
 <li>Spanish (es_ES)</li>
 <li>Spanish, US (es_US)</li>
 <li>Finnish, Finland (fi_FI)</li>
diff --git a/docs/html/sdk/android-4.0.jd b/docs/html/sdk/android-4.0.jd
index 7161b03..2cad86b 100644
--- a/docs/html/sdk/android-4.0.jd
+++ b/docs/html/sdk/android-4.0.jd
@@ -1292,9 +1292,9 @@
 }
 </pre>
 
-<p>For an example using the {@link android.widget.ShareActionProvider}, see the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/ActionBarActionProviderActivity.html"
->ActionBarActionProviderActivity</a> class in ApiDemos.</p>
+<p>For an example using the {@link android.widget.ShareActionProvider}, see <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/ActionBarShareActionProviderActivity.html"
+>ActionBarShareActionProviderActivity</a> in ApiDemos.</p>
 
 
 <h4>Collapsible action views</h4>
@@ -1963,7 +1963,7 @@
 <li>English, New Zealand (en_NZ)</li>
 <li>English, Singapore(en_SG)</li>
 <li>English, US (en_US)</li>
-<li>English, Zimbabwe (en_ZA)</li>
+<li>English, South Africa (en_ZA)</li>
 <li>Spanish (es_ES)</li>
 <li>Spanish, US (es_US)</li>
 <li>Finnish, Finland (fi_FI)</li>
diff --git a/docs/html/sdk/eclipse-adt.jd b/docs/html/sdk/eclipse-adt.jd
index f15da78..30825ee 100644
--- a/docs/html/sdk/eclipse-adt.jd
+++ b/docs/html/sdk/eclipse-adt.jd
@@ -42,7 +42,7 @@
 
 <p>Developing in Eclipse with ADT is highly recommended and is the fastest way
 to get started. With the guided project setup it provides, as well as tools
-integration, custom XML editors, and debug ouput pane, ADT gives you an
+integration, custom XML editors, and debug output pane, ADT gives you an
 incredible boost in developing Android applications. </p>
 
 <p>This document provides step-by-step instructions on how to download the ADT
@@ -1104,7 +1104,7 @@
 <h3 id="downloading">Downloading the ADT Plugin</h3>
 
 <p>Use the Update Manager feature of your Eclipse installation to install the latest
-revision of ADT on your development computer.<>
+revision of ADT on your development computer.</p>
 
 <p>Assuming that you have a compatible version of the Eclipse IDE installed, as
 described in <a href="#preparing">Preparing for Installation</a>, above, follow
diff --git a/docs/html/sdk/index.jd b/docs/html/sdk/index.jd
index 65a1f46..5cf05e0 100644
--- a/docs/html/sdk/index.jd
+++ b/docs/html/sdk/index.jd
@@ -1,4 +1,5 @@
 page.title=Android SDK
+page.metaDescription=Download the official Android SDK to develop apps for Android-powered devices.
 sdk.redirect=0
 
 sdk.win_installer=installer_r16-windows.exe
diff --git a/docs/html/sdk/sdk_toc.cs b/docs/html/sdk/sdk_toc.cs
index 5f6a57f..0de477a 100644
--- a/docs/html/sdk/sdk_toc.cs
+++ b/docs/html/sdk/sdk_toc.cs
@@ -1,7 +1,7 @@
 <?cs if:!sdk.redirect ?>
 <ul>
   <li>
-    <h2>
+    <span class="heading">
       <span class="en">Android SDK Starter Package</span>
       <span style="display:none" class="de">Aktuelle SDK-Version</span>
       <span style="display:none" class="es">Versión actual del SDK</span>
@@ -10,7 +10,7 @@
       <span style="display:none" class="ja">現在リリースされている SDK</span>
       <span style="display:none" class="zh-CN">当前的 SDK 版本</span>
       <span style="display:none" class="zh-TW">目前 SDK 發行版本</span>
-    </h2>
+    </span>
     <ul><?cs
   if:android.whichdoc == "online" ?>
       <li><a href="<?cs var:toroot ?>sdk/index.html">
@@ -37,7 +37,8 @@
     </ul>
   </li><?cs
   if:sdk.preview ?>
-  <li><h2>Android 3.0 Preview SDK</h2>
+  <li>
+    <span class="heading">Android 3.0 Preview SDK</span>
     <ul>
       <li><a href="<?cs var:toroot ?>sdk/preview/start.html">Getting Started</a> <span
 class="new">new!</span></li>
@@ -46,13 +47,14 @@
   /if ?>
   <?cs
   if:sdk.preview ?>
-  <li><h2>Android x.x Preview</h2>
+  <li>
+    <span class="heading">Android x.x Preview</span>
     <ul>
     </ul>
   </li><?cs
   /if ?>
   <li>
-    <h2>
+    <span class="heading">
       <span class="en">Downloadable SDK Components</span>
       <span style="display:none" class="de"></span>
       <span style="display:none" class="es"></span>
@@ -61,7 +63,7 @@
       <span style="display:none" class="ja"></span>
       <span style="display:none" class="zh-CN"></span>
       <span style="display:none" class="zh-TW"></span>
-    </h2>
+    </span>
     <ul>
       <li><a href="<?cs var:toroot ?>sdk/adding-components.html">
       <span class="en">Adding SDK Components</span>
@@ -158,7 +160,7 @@
     </ul>
   </li>
   <li>
-      <h2>
+    <span class="heading">
       <span class="en">ADT Plugin for Eclipse</span>
       <span style="display:none" class="de"></span>
       <span style="display:none" class="es"></span>
@@ -167,7 +169,7 @@
       <span style="display:none" class="ja"></span>
       <span style="display:none" class="zh-CN"></span>
       <span style="display:none" class="zh-TW"></span>
-      </h2>
+    </span>
     <ul>
       <li><a href="<?cs var:toroot ?>sdk/eclipse-adt.html">ADT 16.0.1
       <span style="display:none" class="de"></span>
@@ -182,7 +184,8 @@
     </ul>
   </li>
   <li>
-    <h2><span class="en">Native Development Tools</span>
+    <span class="heading">
+      <span class="en">Native Development Tools</span>
       <span style="display:none" class="de"></span>
       <span style="display:none" class="es"></span>
       <span style="display:none" class="fr"></span>
@@ -190,7 +193,7 @@
       <span style="display:none" class="ja"></span>
       <span style="display:none" class="zh-CN"></span>
       <span style="display:none" class="zh-TW"></span>
-    </h2>
+    </span>
     <ul>
       <li><a href="<?cs var:toroot ?>sdk/ndk/index.html">Android NDK, r7</a>
         <span class="new">new!</span>
@@ -200,7 +203,7 @@
   </li>
 
   <li>
-    <h2>
+    <span class="heading">
       <span class="en">More Information</span>
       <span style="display:none" class="de"></span>
       <span style="display:none" class="es"></span>
@@ -209,7 +212,7 @@
       <span style="display:none" class="ja"></span>
       <span style="display:none" class="zh-CN"></span>
       <span style="display:none" class="zh-TW"></span>
-    </h2>
+    </span>
     <ul>
       <li><a href="<?cs var:toroot ?>sdk/oem-usb.html">
         <span class="en">OEM USB Drivers</span>
diff --git a/docs/html/shareables/adl/2010Q2_Business_Overview.pdf b/docs/html/shareables/adl/2010Q2_Business_Overview.pdf
deleted file mode 100644
index c34ea15..0000000
--- a/docs/html/shareables/adl/2010Q2_Business_Overview.pdf
+++ /dev/null
Binary files differ
diff --git a/docs/html/shareables/adl/2010Q2_Market_Overview.pdf b/docs/html/shareables/adl/2010Q2_Market_Overview.pdf
deleted file mode 100644
index 3752258..0000000
--- a/docs/html/shareables/adl/2010Q2_Market_Overview.pdf
+++ /dev/null
Binary files differ
diff --git a/docs/html/shareables/adl/2010Q2_SDK_Overview.pdf b/docs/html/shareables/adl/2010Q2_SDK_Overview.pdf
deleted file mode 100644
index 8796584..0000000
--- a/docs/html/shareables/adl/2010Q2_SDK_Overview.pdf
+++ /dev/null
Binary files differ
diff --git a/docs/html/shareables/adl/2011Q3_Android_Market_for_Developers.pdf b/docs/html/shareables/adl/2011Q3_Android_Market_for_Developers.pdf
deleted file mode 100644
index 598a27e..0000000
--- a/docs/html/shareables/adl/2011Q3_Android_Market_for_Developers.pdf
+++ /dev/null
Binary files differ
diff --git a/docs/html/shareables/adl/2011Q3_Designing_UIs_for_Phones_and_Tablets.pdf b/docs/html/shareables/adl/2011Q3_Designing_UIs_for_Phones_and_Tablets.pdf
deleted file mode 100644
index 6ef41dd..0000000
--- a/docs/html/shareables/adl/2011Q3_Designing_UIs_for_Phones_and_Tablets.pdf
+++ /dev/null
Binary files differ
diff --git a/docs/html/shareables/adl/2011Q3_Introduction_to_Honeycomb_APIs.pdf b/docs/html/shareables/adl/2011Q3_Introduction_to_Honeycomb_APIs.pdf
deleted file mode 100755
index e56d2377..0000000
--- a/docs/html/shareables/adl/2011Q3_Introduction_to_Honeycomb_APIs.pdf
+++ /dev/null
Binary files differ
diff --git a/docs/html/shareables/icon_templates-v1.0.zip b/docs/html/shareables/icon_templates-v1.0.zip
deleted file mode 100644
index 94fbcdc..0000000
--- a/docs/html/shareables/icon_templates-v1.0.zip
+++ /dev/null
Binary files differ
diff --git a/docs/html/sitemap.txt b/docs/html/sitemap.txt
index 0298a8e..cfbda2b 100644
--- a/docs/html/sitemap.txt
+++ b/docs/html/sitemap.txt
@@ -231,7 +231,6 @@
 http://developer.android.com/resources/samples/CubeLiveWallpaper/index.html
 http://developer.android.com/resources/samples/LunarLander/index.html
 http://developer.android.com/resources/samples/MultiResolution/index.html
-http://developer.android.com/resources/samples/NFCDemo/index.html
 http://developer.android.com/resources/samples/NotePad/index.html
 http://developer.android.com/resources/samples/SampleSyncAdapter/index.html
 http://developer.android.com/resources/samples/SearchableDictionary/index.html
@@ -1996,17 +1995,6 @@
 http://developer.android.com/reference/android/content/DialogInterface.html
 http://developer.android.com/reference/org/apache/http/message/BasicHeaderIterator.html
 http://developer.android.com/reference/org/apache/http/message/BasicListHeaderIterator.html
-http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/nfc/TagViewer.html
-http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/nfc/NdefMessageParser.html
-http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/nfc/record/ParsedNdefRecord.html
-http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/nfc/record/SmartPoster.html
-http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/nfc/record/TextRecord.html
-http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/nfc/record/UriRecord.html
-http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/nfc/simulator/FakeTagsActivity.html
-http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/nfc/simulator/MockNdefMessages.html
-http://developer.android.com/resources/samples/NFCDemo/res/index.html
-http://developer.android.com/resources/samples/NFCDemo/src/index.html
-http://developer.android.com/resources/samples/NFCDemo/AndroidManifest.html
 http://developer.android.com/reference/java/lang/InternalError.html
 http://developer.android.com/reference/java/lang/Error.html
 http://developer.android.com/reference/java/lang/VirtualMachineError.html
@@ -3039,7 +3027,6 @@
 http://developer.android.com/sdk/api_diff/3/changes/pkg_java.lang.html
 http://developer.android.com/sdk/api_diff/3/changes/pkg_java.util.jar.html
 http://developer.android.com/sdk/api_diff/3/changes/pkg_java.util.logging.html
-http://developer.android.com/resources/samples/NFCDemo/src/com/index.html
 http://developer.android.com/sdk/api_diff/9/changes/alldiffs_index_removals.html
 http://developer.android.com/sdk/api_diff/9/changes/alldiffs_index_additions.html
 http://developer.android.com/sdk/api_diff/9/changes/alldiffs_index_changes.html
@@ -3514,7 +3501,6 @@
 http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/LabelView.html
 http://developer.android.com/resources/samples/ApiDemos/res/layout/custom_view_1.html
 http://developer.android.com/resources/samples/NotePad/src/com/example/android/notepad/NoteEditor.html
-http://developer.android.com/resources/samples/NFCDemo/src/com/example/index.html
 http://developer.android.com/reference/org/apache/http/conn/ssl/SSLSocketFactory.html
 http://developer.android.com/reference/android/location/package-descr.html
 http://developer.android.com/resources/samples/AccessibilityService/res/values/strings.html
@@ -3939,10 +3925,6 @@
 http://developer.android.com/resources/samples/ContactManager/res/drawable-mdpi/icon.html
 http://developer.android.com/resources/samples/BackupRestore/src/com/example/index.html
 http://developer.android.com/reference/org/apache/http/message/package-descr.html
-http://developer.android.com/resources/samples/NFCDemo/res/drawable/index.html
-http://developer.android.com/resources/samples/NFCDemo/res/layout/index.html
-http://developer.android.com/resources/samples/NFCDemo/res/raw/index.html
-http://developer.android.com/resources/samples/NFCDemo/res/values/index.html
 http://developer.android.com/reference/android/bluetooth/package-descr.html
 http://developer.android.com/resources/samples/SipDemo/res/drawable/index.html
 http://developer.android.com/resources/samples/SipDemo/res/layout/index.html
@@ -4110,7 +4092,6 @@
 http://developer.android.com/sdk/api_diff/9/changes/methods_index_additions.html
 http://developer.android.com/sdk/api_diff/9/changes/methods_index_changes.html
 http://developer.android.com/reference/android/media/audiofx/package-descr.html
-http://developer.android.com/resources/samples/NFCDemo/res/values/strings.html
 http://developer.android.com/reference/android/sax/ElementListener.html
 http://developer.android.com/reference/android/sax/EndElementListener.html
 http://developer.android.com/reference/android/sax/EndTextElementListener.html
@@ -4599,7 +4580,6 @@
 http://developer.android.com/reference/android/text/method/package-descr.html
 http://developer.android.com/resources/samples/JetBoy/JETBOY_content/JETBOY_Music.logic/LgDoc/index.html
 http://developer.android.com/resources/samples/TicTacToeMain/res/layout/main.html
-http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/index.html
 http://developer.android.com/resources/samples/SearchableDictionary/res/drawable-mdpi/ic_menu_search.html
 http://developer.android.com/resources/samples/TicTacToeMain/res/values/strings.html
 http://developer.android.com/sdk/api_diff/7/changes/alldiffs_index_additions.html
@@ -4637,9 +4617,6 @@
 http://developer.android.com/resources/samples/SoftKeyboard/res/values-land/index.html
 http://developer.android.com/resources/samples/SoftKeyboard/res/xml/index.html
 http://developer.android.com/reference/junit/runner/package-descr.html
-http://developer.android.com/resources/samples/NFCDemo/res/layout/tag_divider.html
-http://developer.android.com/resources/samples/NFCDemo/res/layout/tag_text.html
-http://developer.android.com/resources/samples/NFCDemo/res/layout/tag_viewer.html
 http://developer.android.com/resources/samples/AccelerometerPlay/res/drawable-ldpi/icon.html
 http://developer.android.com/resources/samples/CubeLiveWallpaper/src/com/example/index.html
 http://developer.android.com/reference/android/text/style/package-descr.html
@@ -4726,14 +4703,12 @@
 http://developer.android.com/sdk/api_diff/3/changes/classes_index_additions.html
 http://developer.android.com/sdk/api_diff/3/changes/classes_index_changes.html
 http://developer.android.com/resources/samples/WiktionarySimple/src/com/index.html
-http://developer.android.com/resources/samples/NFCDemo/res/drawable/icon.html
 http://developer.android.com/resources/samples/SearchableDictionary/res/drawable-hdpi/ic_menu_search.html
 http://developer.android.com/resources/samples/SipDemo/res/values/strings.html
 http://developer.android.com/resources/samples/SpinnerTest/src/com/android/index.html
 http://developer.android.com/sdk/api_diff/3/changes/methods_index_removals.html
 http://developer.android.com/sdk/api_diff/3/changes/methods_index_additions.html
 http://developer.android.com/sdk/api_diff/3/changes/methods_index_changes.html
-http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/nfc/index.html
 http://developer.android.com/resources/samples/SoftKeyboard/res/xml/method.html
 http://developer.android.com/resources/samples/SoftKeyboard/res/xml/qwerty.html
 http://developer.android.com/resources/samples/SoftKeyboard/res/xml/symbols.html
@@ -5326,8 +5301,6 @@
 http://developer.android.com/sdk/api_diff/5/changes/alldiffs_index_removals.html
 http://developer.android.com/sdk/api_diff/5/changes/alldiffs_index_additions.html
 http://developer.android.com/sdk/api_diff/5/changes/alldiffs_index_changes.html
-http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/nfc/record/index.html
-http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/nfc/simulator/index.html
 http://developer.android.com/resources/samples/BackupRestore/src/com/example/android/index.html
 http://developer.android.com/resources/samples/BluetoothChat/src/com/example/android/BluetoothChat/index.html
 http://developer.android.com/resources/samples/ContactManager/src/com/example/android/index.html
diff --git a/docs/html/training/design-navigation/ancestral-temporal.jd b/docs/html/training/design-navigation/ancestral-temporal.jd
index 02e43e1..ab6a64d 100644
--- a/docs/html/training/design-navigation/ancestral-temporal.jd
+++ b/docs/html/training/design-navigation/ancestral-temporal.jd
@@ -21,6 +21,7 @@
 
 <h2>You should also read</h2>
 <ul>
+  <li><a href="{@docRoot}design/patterns/navigation.html">Android Design: Navigation</a></li>
   <li><a href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back Stack</a></li>
 </ul>
 
@@ -28,32 +29,65 @@
 </div>
 
 
-<p>Now that users can navigate <a href="descendant-lateral.html">deep into</a> the application's screen hierarchy, we need to provide a method for navigating up the hierarchy, to parent and ancestor screens. Additionally, we should ensure that temporal navigation via the BACK button is respected to respect Android conventions.</p>
+<p>Now that users can navigate <a href="descendant-lateral.html">deep into</a> the application's
+screen hierarchy, we need to provide a method for navigating up the hierarchy, to parent and
+ancestor screens. Additionally, we should ensure that temporal navigation via the <em>Back</em>
+button is respected to respect Android conventions.</p>
 
+<div class="design-announce">
+<p><strong>Back/Up Navigation Design</strong></p>
+  <p>For design guidelines, read Android Design's <a
+  href="{@docRoot}design/patterns/navigation.html">Navigation</a> pattern guide.</p>
+</div>
 
 <h2 id="temporal-navigation">Support Temporal Navigation: <em>Back</em></h2>
 
-<p>Temporal navigation, or navigation between historical screens, is deeply rooted in the Android system. All Android users expect the BACK button to take them to the previous screen, regardless of other state. The set of historical screens is always rooted at the user's Launcher application (the phone's "home" screen). That is, pressing BACK enough times should land you back at the Launcher, after which the BACK button will do nothing.</p>
+<p>Temporal navigation, or navigation between historical screens, is deeply rooted in the Android
+system. All Android users expect the <em>Back</em> button to take them to the previous screen,
+regardless of other state. The set of historical screens is always rooted at the user's Launcher
+application (the phone's "home" screen). That is, pressing <em>Back</em> enough times should land
+you back at the Launcher, after which the <em>Back</em> button will do nothing.</p>
 
 
 <img src="{@docRoot}images/training/app-navigation-ancestral-navigate-back.png"
-  alt="The BACK button behavior after entering the Email app from the People (or Contacts) app" id="figure-navigate-back">
+  alt="The Back button behavior after entering the Email app from the People (or Contacts) app"
+id="figure-navigate-back">
 
-<p class="img-caption"><strong>Figure 1.</strong> The BACK button behavior after entering the Email app from the People (or Contacts) app.</p>
+<p class="img-caption"><strong>Figure 1.</strong> The <em>Back</em> button behavior after entering
+the Email app from the People (or Contacts) app.</p>
 
 
-<p>Applications generally don't have to worry about managing the BACK button themselves; the system handles <a href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">tasks and the <em>back stack</em></a>, or the list of previous screens, automatically. The BACK button by default simply traverses this list of screens, removing the current screen from the list upon being pressed.</p>
+<p>Applications generally don't have to worry about managing the <em>Back</em> button themselves;
+the system handles <a href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">tasks and
+the <em>back stack</em></a>, or the list of previous screens, automatically. The <em>Back</em>
+button by default simply traverses this list of screens, removing the current screen from the list
+upon being pressed.</p>
 
-<p>There are, however, cases where you may want to override the behavior for BACK. For example, if your screen contains an embedded web browser where users can interact with page elements to navigate between web pages, you may wish to trigger the embedded browser's default <em>back</em> behavior when users press the device's BACK button. Upon reaching the beginning of the browser's internal history, you should always defer to the system's default behavior for the BACK button.</p>
+<p>There are, however, cases where you may want to override the behavior for <em>Back</em>. For
+example, if your screen contains an embedded web browser where users can interact with page elements
+to navigate between web pages, you may wish to trigger the embedded browser's default <em>back</em>
+behavior when users press the device's <em>Back</em> button. Upon reaching the beginning of the
+browser's internal history, you should always defer to the system's default behavior for the
+<em>Back</em> button.</p>
 
 
 <h2 id="ancestral-navigation">Provide Ancestral Navigation: <em>Up</em> and <em>Home</em></h2>
 
-<p>Before Android 3.0, the most common form of ancestral navigation was the <em>Home</em> metaphor. This was generally implemented as a <em>Home</em> item accessible via the device's MENU button, or a <em>Home</em> button at the top-left of the screen, usually as a component of the <a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a>. Upon selecting <em>Home</em>, the user would be taken to the screen at the top of the screen hierarchy, generally known as the application's home screen.</p>
+<p>Before Android 3.0, the most common form of ancestral navigation was the <em>Home</em> metaphor.
+This was generally implemented as a <em>Home</em> item accessible via the device's <em>Menu</em>
+button, or a <em>Home</em> button at the top-left of the screen, usually as a component of the
+Action Bar (<a href="{@docRoot}design/patterns/actionbar.html">pattern docs</a> at Android Design).
+Upon selecting <em>Home</em>, the user would be taken to the screen at the top of the screen
+hierarchy, generally known as the application's home screen.</p>
 
 <p>Providing direct access to the application's home screen can give the user a sense of comfort and security. Regardless of where they are in the application, if they get lost in the app, they can select <em>Home</em> to arrive back at the familiar home screen.</p>
 
-<p>Android 3.0 introduced the <em>Up</em> metaphor, which is presented in the Action Bar as a substitute for the <em>Home</em> button described above. Upon tapping <em>Up</em>, the user should be taken to the parent screen in the hierarchy. This navigation step is usually the previous screen (as described with the BACK button discussion above), but this is not universally the case. Thus, developers must ensure that <em>Up</em> for each screen navigates to a single, predetermined parent screen.</p>
+<p>Android 3.0 introduced the <em>Up</em> metaphor, which is presented in the Action Bar as a
+substitute for the <em>Home</em> button described above. Upon tapping <em>Up</em>, the user should
+be taken to the parent screen in the hierarchy. This navigation step is usually the previous screen
+(as described with the <em>Back</em> button discussion above), but this is not universally the case.
+Thus, developers must ensure that <em>Up</em> for each screen navigates to a single, predetermined
+parent screen.</p>
 
 
 <img src="{@docRoot}images/training/app-navigation-ancestral-navigate-up.png"
@@ -64,6 +98,12 @@
 
 <p>In some cases, it's appropriate for <em>Up</em> to perform an action rather than navigating to a parent screen. Take for example, the Gmail application for Android 3.0-based tablets. When viewing a mail conversation while holding the device in landscape, the conversation list, as well as the conversation details are presented side-by-side. This is a form of parent-child screen grouping, as discussed in a <a href="multiple-sizes.html">previous lesson</a>. However, when viewing a mail conversation in the portrait orientation, only the conversation details are shown. The <em>Up</em> button is used to temporarily show the parent pane, which slides in from the left of the screen. Pressing the <em>Up</em> button again while the left pane is visible exits the context of the individual conversation, up to a full-screen list of conversations.</p>
 
-<p class="note"><strong>Implementation Note:</strong> As a best practice, when implementing either <em>Home</em> or <em>Up</em>, make sure to clear the back stack of any descendent screens. For <em>Home</em>, the only remaining screen on the back stack should be the home screen. For <em>Up</em> navigation, the current screen should be removed from the back stack, unless BACK navigates across screen hierarchies. You can use the {@link android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP} and {@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK} intent flags together to achieve this.</p>
+<p class="note"><strong>Implementation Note:</strong> As a best practice, when implementing either
+<em>Home</em> or <em>Up</em>, make sure to clear the back stack of any descendent screens. For
+<em>Home</em>, the only remaining screen on the back stack should be the home screen. For
+<em>Up</em> navigation, the current screen should be removed from the back stack, unless
+<em>Back</em> navigates across screen hierarchies. You can use the {@link
+android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP} and {@link
+android.content.Intent#FLAG_ACTIVITY_NEW_TASK} intent flags together to achieve this.</p>
 
 <p>In the last lesson, we apply the concepts discussed in all of the lessons so far to create interaction design wireframes for our example news application.</p>
diff --git a/docs/html/training/design-navigation/descendant-lateral.jd b/docs/html/training/design-navigation/descendant-lateral.jd
index ebfd913..2d97e40 100644
--- a/docs/html/training/design-navigation/descendant-lateral.jd
+++ b/docs/html/training/design-navigation/descendant-lateral.jd
@@ -18,9 +18,18 @@
   <li><a href="#buttons">Buttons and Simple Targets</a></li>
   <li><a href="#lists">Lists, Grids, Carousels, and Stacks</a></li>
   <li><a href="#tabs">Tabs</a></li>
-  <li><a href="#paging">Horizontal Paging</a></li>
+  <li><a href="#paging">Horizontal Paging (Swipe Views)</a></li>
 </ol>
 
+<h2>You should also read</h2>
+<ul>
+  <li><a href="{@docRoot}design/building-blocks/buttons.html">Android Design: Buttons</a></li>
+  <li><a href="{@docRoot}design/building-blocks/lists.html">Android Design: Lists</a></li>
+  <li><a href="{@docRoot}design/building-blocks/grid-lists.html">Android Design: Grid Lists</a></li>
+  <li><a href="{@docRoot}design/building-blocks/tabs.html">Android Design: Tabs</a></li>
+  <li><a href="{@docRoot}design/patterns/swipe-views.html">Android Design: Swipe Views</a></li>
+</ul>
+
 </div>
 </div>
 
@@ -48,6 +57,12 @@
 
 <h2 id="buttons">Buttons and Simple Targets</h2>
 
+<div class="design-announce">
+<p><strong>Button Design</strong></p>
+  <p>For design guidelines, read Android Design's <a
+  href="{@docRoot}design/building-blocks/buttons.html">Buttons</a> guide.</p>
+</div>
+
 <p>For section-related screens, offering touchable and keyboard-focusable targets in the parent is generally the most straightforward and familiar kind of touch-based navigation interface. Examples of such targets include buttons, fixed-size list views, or text links, although the latter is not an ideal UI (user interface) element for touch-based navigation. Upon selecting one of these targets, the child screen is opened, replacing the current context (screen) entirely. Buttons and other simple targets are rarely used for representing items in a collection.</p>
 
 
@@ -64,6 +79,13 @@
 
 <h2 id="lists">Lists, Grids, Carousels, and Stacks</h2>
 
+<div class="design-announce">
+<p><strong>List and Grid List Design</strong></p>
+  <p>For design guidelines, read Android Design's <a
+  href="{@docRoot}design/building-blocks/lists.html">Lists</a> and <a
+  href="{@docRoot}design/building-blocks/grid-lists.html">Grid Lists</a> guides.</p>
+</div>
+
 <p>For collection-related screens, and especially for textual information, vertically scrolling lists are often the most straightforward and familiar kind of interface. For more visual or media-rich content items such as photos or videos, vertically scrolling grids of items, horizontally scrolling lists (sometimes referred to as <em>carousels</em>), or stacks (sometimes referred to as <em>cards</em>) can be used instead. These UI elements are generally best used for presenting item collections or large sets of child screens (for example, a list of stories or a list of 10 or more news topics), rather than a small set of unrelated, sibling child screens.</p>
 
 
@@ -80,6 +102,12 @@
 
 <h2 id="tabs">Tabs</h2>
 
+<div class="design-announce">
+<p><strong>Tab Design</strong></p>
+  <p>For design guidelines, read Android Design's <a
+  href="{@docRoot}design/building-blocks/tabs.html">Tabs</a> guide.</p>
+</div>
+
 <p>Using tabs is a very popular solution for lateral navigation. This pattern allows grouping of sibling screens, in that the tab content container in the parent screen can embed child screens that otherwise would be entirely separate contexts. Tabs are most appropriate for small sets (4 or fewer) of section-related screens.</p>
 
 
@@ -89,7 +117,16 @@
 <p class="img-caption"><strong>Figure 5.</strong> Example phone and tablet tab-based navigation interfaces with relevant screen map excerpt.</p>
 
 
-<p>Several best practices apply when using tabs. Tabs should be persistent across immediate related screens. Only the designated content region should change when selecting a tab, and tab indicators should remain available at all times. Additionally, tab switches should not be treated as history. For example, if a user switches from a tab <em>A</em> to another tab <em>B</em>, pressing the BACK button (more on that in the <a href="ancestral-temporal.html">next lesson</a>) should not re-select tab <em>A</em>. Tabs are usually laid out horizontally, although other presentations of tab navigation such as using a drop-down list in the <a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> are sometimes appropriate. Lastly, and most importantly, <em>tabs should always run along the top of the screen</em>, and should not be aligned to the bottom of the screen.</p>
+<p>Several best practices apply when using tabs. Tabs should be persistent across immediate related
+screens. Only the designated content region should change when selecting a tab, and tab indicators
+should remain available at all times. Additionally, tab switches should not be treated as history.
+For example, if a user switches from a tab <em>A</em> to another tab <em>B</em>, pressing the
+<em>Back</em> button (more on that in the <a href="ancestral-temporal.html">next lesson</a>) should
+not re-select tab <em>A</em>. Tabs are usually laid out horizontally, although other presentations
+of tab navigation such as using a drop-down list in the Action Bar (<a
+href="{@docRoot}design/patterns/actionbar.html">pattern docs</a> at Android Design) are sometimes
+appropriate. Lastly, and most importantly, <em>tabs should always run along the top of the
+screen</em>, and should not be aligned to the bottom of the screen.</p>
 
 <p>There are some obvious immediate benefits of tabs over simpler list- and button-based navigation:</p>
 
@@ -101,9 +138,15 @@
 <p>A common criticism is that space must be reserved for the tab indicators, detracting from the space available to tab contents. This consequence is usually acceptable, and the tradeoff commonly weighs in favor of using this pattern. You should also feel free to customize tab indicators, showing text and/or icons to make optimal use of vertical space. When adjusting indicator heights however, ensure that tab indicators are large enough for a human finger to touch without error.</p>
 
 
-<h2 id="paging">Horizontal Paging</h2>
+<h2 id="paging">Horizontal Paging (Swipe Views)</h2>
 
-<p>Another popular lateral navigation pattern is horizontal paging. This pattern applies best to collection-related sibling screens, such as a list of categories (world, business, technology, and health stories). Like tabs, this pattern also allows grouping screens in that the parent presents the contents of child screens embedded within its own layout.</p>
+<div class="design-announce">
+<p><strong>Swipe Views Design</strong></p>
+  <p>For design guidelines, read Android Design's <a
+  href="{@docRoot}design/patterns/swipe-views.html">Swipe Views</a> pattern guides.</p>
+</div>
+
+<p>Another popular lateral navigation pattern is horizontal paging, also referred to as swipe views. This pattern applies best to collection-related sibling screens, such as a list of categories (world, business, technology, and health stories). Like tabs, this pattern also allows grouping screens in that the parent presents the contents of child screens embedded within its own layout.</p>
 
 
 <img src="{@docRoot}images/training/app-navigation-descendant-lateral-paging.png"
diff --git a/docs/html/training/design-navigation/index.jd b/docs/html/training/design-navigation/index.jd
index e02d52e..af60717 100644
--- a/docs/html/training/design-navigation/index.jd
+++ b/docs/html/training/design-navigation/index.jd
@@ -14,7 +14,7 @@
 
 <p>This class is not specific to any particular version of the Android platform. It is also primarily design-focused and does not require knowledge of the Android SDK. That said, you should have experience using an Android device for a better understanding of the context in which Android applications run.</p>
 
-<p>You should also have basic familiarity with the <a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a>, used across most applications in devices running Android 3.0 and later.</p>
+<p>You should also have basic familiarity with the Action Bar (<a href="{@docRoot}design/patterns/actionbar.html">pattern docs</a> at Android Design), used across most applications in devices running Android 3.0 and later.</p>
 
 
 </div>
@@ -41,7 +41,9 @@
     <dd>Learn about techniques for allowing users to navigate deep into, as well as across, your content hierarchy. Also learn about pros and cons of, and best practices for, specific navigational UI elements for various situations.</dd>
 
   <dt><strong><a href="ancestral-temporal.html">Providing Ancestral and Temporal Navigation</a></strong></dt>
-    <dd>Learn how to allow users to navigate upwards in the content hierarchy. Also learn about best practices for the BACK button and temporal navigation, or navigation to previous screens that may not be hierarchically related.</dd>
+    <dd>Learn how to allow users to navigate upwards in the content hierarchy. Also learn about best
+practices for the <em>Back</em> button and temporal navigation, or navigation to previous screens
+that may not be hierarchically related.</dd>
 
   <dt><strong><a href="wireframing.html">Putting it All Together: Wireframing the Example App</a></strong></dt>
     <dd>Learn how to create screen wireframes (low-fidelity graphic mockups) representing the screens in a news application based on the desired information model. These wireframes utilize navigational elements discussed in previous lessons to demonstrate intuitive and efficient navigation.</dd>
diff --git a/docs/html/training/design-navigation/multiple-sizes.jd b/docs/html/training/design-navigation/multiple-sizes.jd
index 7a8139f..ebaec0f 100644
--- a/docs/html/training/design-navigation/multiple-sizes.jd
+++ b/docs/html/training/design-navigation/multiple-sizes.jd
@@ -22,6 +22,7 @@
 
 <h2>You should also read</h2>
 <ul>
+  <li><a href="{@docRoot}design/patterns/multi-pane-layouts.html">Android Design: Multi-pane Layouts</a></li>
   <li><a href="{@docRoot}training/multiscreen/index.html">Designing for Multiple Screens</a></li>
 </ul>
 
@@ -35,6 +36,12 @@
 
 <h2 id="multi-pane-layouts">Group Screens with Multi-pane Layouts</h2>
 
+<div class="design-announce">
+<p><strong>Multi-pane Layout Design</strong></p>
+  <p>For design guidelines, read Android Design's <a
+  href="{@docRoot}design/patterns/multi-pane-layouts.html">Multi-pane Layouts</a> pattern guide.</p>
+</div>
+
 <p>3 to 4-inch screens are generally only suitable for showing a single vertical pane of content at a time, be it a list of items, or detail information about an item, etc. Thus on such devices, screens generally map one-to-one with levels in the information hierarchy (<em>categories</em> &rarr; <em>object list</em> &rarr; <em>object detail</em>).</p>
 
 <p>Larger screens such as those found on tablets and TVs, on the other hand, generally have much more available screen space and are able to present multiple panes of content. In landscape, panes are usually ordered from left to right in increasing detail order. Users are especially accustomed to multiple panes on larger screens from years and years of desktop application and desktop web site use. Many desktop applications and websites offer a left-hand navigation pane or use a master/detail two-pane layout.</p>
@@ -76,12 +83,12 @@
   <li><strong>Expand/collapse</strong>
     <img src="{@docRoot}images/training/app-navigation-multiple-sizes-strategy-collapse.png"
       alt="Expand/collapse strategy">
-    <p>A variation on the stretch strategy is to collapse the contents of the left pane when in portrait. This works quite well with master/detail panes where the left (master) pane contains easily collapsible list items. An example would be for a realtime chat application. In landscape, the left list could contain chat contact photos, names, and online statuses. In portrait, horizontal space could be collapsed by hiding contact names and only showing photos and online status indicator icons.</p></li>
+    <p>A variation on the stretch strategy is to collapse the contents of the left pane when in portrait. This works quite well with master/detail panes where the left (master) pane contains easily collapsible list items. An example would be for a realtime chat application. In landscape, the left list could contain chat contact photos, names, and online statuses. In portrait, horizontal space could be collapsed by hiding contact names and only showing photos and online status indicator icons. Optionally also provide an expand control that allows the user to expand the left pane content to its larger width and vice versa.</p></li>
 
   <li><strong>Show/Hide</strong>
     <img src="{@docRoot}images/training/app-navigation-multiple-sizes-strategy-show-hide.png"
       alt="Show/Hide strategy">
-    <p>In this scenario, the left pane is completely hidden in portrait mode. However, <em>to ensure the functional parity</em> of your screen in portrait and landscape, the left pane should be made available via an onscreen affordance (such as a button). It's usually appropriate to use the <em>Up</em> button in the <a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> to show the left pane, as is discussed in a <a href="ancestral-temporal.html">later lesson</a>.</p></li>
+    <p>In this scenario, the left pane is completely hidden in portrait mode. However, <em>to ensure the functional parity</em> of your screen in portrait and landscape, the left pane should be made available via an onscreen affordance (such as a button). It's usually appropriate to use the <em>Up</em> button in the Action Bar (<a href="{@docRoot}design/patterns/actionbar.html">pattern docs</a> at Android Design) to show the left pane, as is discussed in a <a href="ancestral-temporal.html">later lesson</a>.</p></li>
 
   <li><strong>Stack</strong>
     <img src="{@docRoot}images/training/app-navigation-multiple-sizes-strategy-stack.png"
diff --git a/docs/html/training/design-navigation/wireframing.jd b/docs/html/training/design-navigation/wireframing.jd
index c7687dd..6deceb1 100644
--- a/docs/html/training/design-navigation/wireframing.jd
+++ b/docs/html/training/design-navigation/wireframing.jd
@@ -121,5 +121,5 @@
   <li><a href="{@docRoot}guide/topics/ui/index.html">Developer's Guide: User Interface</a>: learn how to implement your user interface designs using the Android SDK.</li>
   <li><a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a>: implement tabs, up navigation, on-screen actions, etc.
   <li><a href="{@docRoot}guide/topics/fundamentals/fragments.html">Fragments</a>: implement re-usable, multi-pane layouts
-  <li><a href="{@docRoot}sdk/compatibility-library.html">Support Library</a>: implement horizontal paging using <code>ViewPager</code></li>
+  <li><a href="{@docRoot}sdk/compatibility-library.html">Support Library</a>: implement horizontal paging (swipe views) using <code>ViewPager</code></li>
 </ul>
diff --git a/docs/html/training/id-auth/authenticate.jd b/docs/html/training/id-auth/authenticate.jd
index 4eba87b..592fe1c 100644
--- a/docs/html/training/id-auth/authenticate.jd
+++ b/docs/html/training/id-auth/authenticate.jd
@@ -63,8 +63,8 @@
 strings that identify your app to the service. You need to obtain these strings
 directly from the service owner. Google has a self-service system for obtaining
 client ids and secrets. The article <a
-href="http://code.google.com/apis/tasks/articles/oauth-and-tasks-on-android.
-html">Getting Started with the Tasks API and OAuth 2.0 on Android</a> explains
+href="http://code.google.com/apis/tasks/articles/oauth-and-tasks-on-android.html">Getting
+Started with the Tasks API and OAuth 2.0 on Android</a> explains
 how to use this system to obtain these values for use with the Google Tasks
 API.</li>
 </ul>
diff --git a/docs/html/training/monitoring-device-state/manifest-receivers.jd b/docs/html/training/monitoring-device-state/manifest-receivers.jd
index 556a733..0b79ce6 100644
--- a/docs/html/training/monitoring-device-state/manifest-receivers.jd
+++ b/docs/html/training/monitoring-device-state/manifest-receivers.jd
@@ -14,7 +14,7 @@
 
 <h2>This lesson teaches you to</h2>
 <ol>
-  <li><a href="ToggleReceivers">Toggle and Cascade State Change Receivers to Improve
+  <li><a href="#ToggleReceivers">Toggle and Cascade State Change Receivers to Improve
 Efficiency</a></li>
 </ol>
 
diff --git a/drm/common/DrmEngineBase.cpp b/drm/common/DrmEngineBase.cpp
index 9b16c36..1c345a2 100644
--- a/drm/common/DrmEngineBase.cpp
+++ b/drm/common/DrmEngineBase.cpp
@@ -120,13 +120,23 @@
 }
 
 status_t DrmEngineBase::openDecryptSession(
-    int uniqueId, DecryptHandle* decryptHandle, int fd, off64_t offset, off64_t length) {
-    return onOpenDecryptSession(uniqueId, decryptHandle, fd, offset, length);
+    int uniqueId, DecryptHandle* decryptHandle,
+    int fd, off64_t offset, off64_t length, const char* mime) {
+
+    if (!mime || mime[0] == '\0') {
+        return onOpenDecryptSession(uniqueId, decryptHandle, fd, offset, length);
+    }
+
+    return onOpenDecryptSession(uniqueId, decryptHandle, fd, offset, length, mime);
 }
 
 status_t DrmEngineBase::openDecryptSession(
-    int uniqueId, DecryptHandle* decryptHandle, const char* uri) {
-    return onOpenDecryptSession(uniqueId, decryptHandle, uri);
+    int uniqueId, DecryptHandle* decryptHandle,
+    const char* uri, const char* mime) {
+    if (!mime || mime[0] == '\0') {
+        return onOpenDecryptSession(uniqueId, decryptHandle, uri);
+    }
+    return onOpenDecryptSession(uniqueId, decryptHandle, uri, mime);
 }
 
 status_t DrmEngineBase::closeDecryptSession(int uniqueId, DecryptHandle* decryptHandle) {
diff --git a/drm/common/IDrmManagerService.cpp b/drm/common/IDrmManagerService.cpp
index 3ed8ade..43f64f2 100644
--- a/drm/common/IDrmManagerService.cpp
+++ b/drm/common/IDrmManagerService.cpp
@@ -600,7 +600,7 @@
 }
 
 DecryptHandle* BpDrmManagerService::openDecryptSession(
-            int uniqueId, int fd, off64_t offset, off64_t length) {
+            int uniqueId, int fd, off64_t offset, off64_t length, const char* mime) {
     ALOGV("Entering BpDrmManagerService::openDecryptSession");
     Parcel data, reply;
 
@@ -609,6 +609,11 @@
     data.writeFileDescriptor(fd);
     data.writeInt64(offset);
     data.writeInt64(length);
+    String8 mimeType;
+    if (mime) {
+        mimeType = mime;
+    }
+    data.writeString8(mimeType);
 
     remote()->transact(OPEN_DECRYPT_SESSION, data, &reply);
 
@@ -620,13 +625,20 @@
     return handle;
 }
 
-DecryptHandle* BpDrmManagerService::openDecryptSession(int uniqueId, const char* uri) {
-    ALOGV("Entering BpDrmManagerService::openDecryptSession");
+DecryptHandle* BpDrmManagerService::openDecryptSession(
+        int uniqueId, const char* uri, const char* mime) {
+
+    ALOGV("Entering BpDrmManagerService::openDecryptSession: mime=%s", mime? mime: "NULL");
     Parcel data, reply;
 
     data.writeInterfaceToken(IDrmManagerService::getInterfaceDescriptor());
     data.writeInt32(uniqueId);
     data.writeString8(String8(uri));
+    String8 mimeType;
+    if (mime) {
+        mimeType = mime;
+    }
+    data.writeString8(mimeType);
 
     remote()->transact(OPEN_DECRYPT_SESSION_FROM_URI, data, &reply);
 
@@ -1265,8 +1277,10 @@
 
         const off64_t offset = data.readInt64();
         const off64_t length = data.readInt64();
+        const String8 mime = data.readString8();
+
         DecryptHandle* handle
-            = openDecryptSession(uniqueId, fd, offset, length);
+            = openDecryptSession(uniqueId, fd, offset, length, mime.string());
 
         if (NULL != handle) {
             writeDecryptHandleToParcelData(handle, reply);
@@ -1283,8 +1297,9 @@
 
         const int uniqueId = data.readInt32();
         const String8 uri = data.readString8();
+        const String8 mime = data.readString8();
 
-        DecryptHandle* handle = openDecryptSession(uniqueId, uri.string());
+        DecryptHandle* handle = openDecryptSession(uniqueId, uri.string(), mime.string());
 
         if (NULL != handle) {
             writeDecryptHandleToParcelData(handle, reply);
diff --git a/drm/drmserver/DrmManager.cpp b/drm/drmserver/DrmManager.cpp
index 3abf3d3..999295a 100644
--- a/drm/drmserver/DrmManager.cpp
+++ b/drm/drmserver/DrmManager.cpp
@@ -426,7 +426,9 @@
     return DRM_NO_ERROR;
 }
 
-DecryptHandle* DrmManager::openDecryptSession(int uniqueId, int fd, off64_t offset, off64_t length) {
+DecryptHandle* DrmManager::openDecryptSession(
+        int uniqueId, int fd, off64_t offset, off64_t length, const char* mime) {
+
     Mutex::Autolock _l(mDecryptLock);
     status_t result = DRM_ERROR_CANNOT_HANDLE;
     Vector<String8> plugInIdList = mPlugInManager.getPlugInIdList();
@@ -438,7 +440,7 @@
         for (unsigned int index = 0; index < plugInIdList.size(); index++) {
             String8 plugInId = plugInIdList.itemAt(index);
             IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
-            result = rDrmEngine.openDecryptSession(uniqueId, handle, fd, offset, length);
+            result = rDrmEngine.openDecryptSession(uniqueId, handle, fd, offset, length, mime);
 
             if (DRM_NO_ERROR == result) {
                 ++mDecryptSessionId;
@@ -453,7 +455,8 @@
     return handle;
 }
 
-DecryptHandle* DrmManager::openDecryptSession(int uniqueId, const char* uri) {
+DecryptHandle* DrmManager::openDecryptSession(
+        int uniqueId, const char* uri, const char* mime) {
     Mutex::Autolock _l(mDecryptLock);
     status_t result = DRM_ERROR_CANNOT_HANDLE;
     Vector<String8> plugInIdList = mPlugInManager.getPlugInIdList();
@@ -465,7 +468,7 @@
         for (unsigned int index = 0; index < plugInIdList.size(); index++) {
             String8 plugInId = plugInIdList.itemAt(index);
             IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
-            result = rDrmEngine.openDecryptSession(uniqueId, handle, uri);
+            result = rDrmEngine.openDecryptSession(uniqueId, handle, uri, mime);
 
             if (DRM_NO_ERROR == result) {
                 ++mDecryptSessionId;
diff --git a/drm/drmserver/DrmManagerService.cpp b/drm/drmserver/DrmManagerService.cpp
index df17ac5..caeb026 100644
--- a/drm/drmserver/DrmManagerService.cpp
+++ b/drm/drmserver/DrmManagerService.cpp
@@ -208,20 +208,20 @@
 }
 
 DecryptHandle* DrmManagerService::openDecryptSession(
-            int uniqueId, int fd, off64_t offset, off64_t length) {
+            int uniqueId, int fd, off64_t offset, off64_t length, const char* mime) {
     ALOGV("Entering DrmManagerService::openDecryptSession");
     if (isProtectedCallAllowed()) {
-        return mDrmManager->openDecryptSession(uniqueId, fd, offset, length);
+        return mDrmManager->openDecryptSession(uniqueId, fd, offset, length, mime);
     }
 
     return NULL;
 }
 
 DecryptHandle* DrmManagerService::openDecryptSession(
-            int uniqueId, const char* uri) {
+            int uniqueId, const char* uri, const char* mime) {
     ALOGV("Entering DrmManagerService::openDecryptSession with uri");
     if (isProtectedCallAllowed()) {
-        return mDrmManager->openDecryptSession(uniqueId, uri);
+        return mDrmManager->openDecryptSession(uniqueId, uri, mime);
     }
 
     return NULL;
diff --git a/drm/libdrmframework/DrmManagerClient.cpp b/drm/libdrmframework/DrmManagerClient.cpp
index c9c0d57..8768c08 100644
--- a/drm/libdrmframework/DrmManagerClient.cpp
+++ b/drm/libdrmframework/DrmManagerClient.cpp
@@ -116,12 +116,18 @@
     return mDrmManagerClientImpl->getAllSupportInfo(mUniqueId, length, drmSupportInfoArray);
 }
 
-sp<DecryptHandle> DrmManagerClient::openDecryptSession(int fd, off64_t offset, off64_t length) {
-    return mDrmManagerClientImpl->openDecryptSession(mUniqueId, fd, offset, length);
+sp<DecryptHandle> DrmManagerClient::openDecryptSession(
+        int fd, off64_t offset, off64_t length, const char* mime) {
+
+    return mDrmManagerClientImpl->openDecryptSession(
+                    mUniqueId, fd, offset, length, mime);
 }
 
-sp<DecryptHandle> DrmManagerClient::openDecryptSession(const char* uri) {
-    return mDrmManagerClientImpl->openDecryptSession(mUniqueId, uri);
+sp<DecryptHandle> DrmManagerClient::openDecryptSession(
+        const char* uri, const char* mime) {
+
+    return mDrmManagerClientImpl->openDecryptSession(
+                    mUniqueId, uri, mime);
 }
 
 status_t DrmManagerClient::closeDecryptSession(sp<DecryptHandle> &decryptHandle) {
diff --git a/drm/libdrmframework/DrmManagerClientImpl.cpp b/drm/libdrmframework/DrmManagerClientImpl.cpp
index b222b8f..fb0439e 100644
--- a/drm/libdrmframework/DrmManagerClientImpl.cpp
+++ b/drm/libdrmframework/DrmManagerClientImpl.cpp
@@ -255,15 +255,19 @@
 }
 
 sp<DecryptHandle> DrmManagerClientImpl::openDecryptSession(
-            int uniqueId, int fd, off64_t offset, off64_t length) {
-    return getDrmManagerService()->openDecryptSession(uniqueId, fd, offset, length);
+            int uniqueId, int fd, off64_t offset,
+            off64_t length, const char* mime) {
+
+    return getDrmManagerService()->openDecryptSession(
+                uniqueId, fd, offset, length, mime);
 }
 
 sp<DecryptHandle> DrmManagerClientImpl::openDecryptSession(
-        int uniqueId, const char* uri) {
+        int uniqueId, const char* uri, const char* mime) {
+
     DecryptHandle* handle = NULL;
     if (NULL != uri) {
-        handle = getDrmManagerService()->openDecryptSession(uniqueId, uri);
+        handle = getDrmManagerService()->openDecryptSession(uniqueId, uri, mime);
     }
     return handle;
 }
diff --git a/drm/libdrmframework/include/DrmManager.h b/drm/libdrmframework/include/DrmManager.h
index ac2b946..c9167d4 100644
--- a/drm/libdrmframework/include/DrmManager.h
+++ b/drm/libdrmframework/include/DrmManager.h
@@ -111,9 +111,10 @@
 
     status_t getAllSupportInfo(int uniqueId, int* length, DrmSupportInfo** drmSupportInfoArray);
 
-    DecryptHandle* openDecryptSession(int uniqueId, int fd, off64_t offset, off64_t length);
+    DecryptHandle* openDecryptSession(
+            int uniqueId, int fd, off64_t offset, off64_t length, const char* mime);
 
-    DecryptHandle* openDecryptSession(int uniqueId, const char* uri);
+    DecryptHandle* openDecryptSession(int uniqueId, const char* uri, const char* mime);
 
     status_t closeDecryptSession(int uniqueId, DecryptHandle* decryptHandle);
 
diff --git a/drm/libdrmframework/include/DrmManagerClientImpl.h b/drm/libdrmframework/include/DrmManagerClientImpl.h
index e3338d9..2aa493f 100644
--- a/drm/libdrmframework/include/DrmManagerClientImpl.h
+++ b/drm/libdrmframework/include/DrmManagerClientImpl.h
@@ -300,20 +300,24 @@
      * @param[in] fd File descriptor of the protected content to be decrypted
      * @param[in] offset Start position of the content
      * @param[in] length The length of the protected content
+     * @param[in] mime The mime type of the protected content if it is not NULL or empty
      * @return
      *     Handle for the decryption session
      */
-    sp<DecryptHandle> openDecryptSession(int uniqueId, int fd, off64_t offset, off64_t length);
+    sp<DecryptHandle> openDecryptSession(
+            int uniqueId, int fd, off64_t offset, off64_t length, const char* mime);
 
     /**
      * Open the decrypt session to decrypt the given protected content
      *
      * @param[in] uniqueId Unique identifier for a session
      * @param[in] uri Path of the protected content to be decrypted
+     * @param[in] mime The mime type of the protected content if it is not NULL or empty
      * @return
      *     Handle for the decryption session
      */
-    sp<DecryptHandle> openDecryptSession(int uniqueId, const char* uri);
+    sp<DecryptHandle> openDecryptSession(
+            int uniqueId, const char* uri, const char* mime);
 
     /**
      * Close the decrypt session for the given handle
diff --git a/drm/libdrmframework/include/DrmManagerService.h b/drm/libdrmframework/include/DrmManagerService.h
index 9cb5804..1a8c2ae 100644
--- a/drm/libdrmframework/include/DrmManagerService.h
+++ b/drm/libdrmframework/include/DrmManagerService.h
@@ -98,9 +98,11 @@
 
     status_t getAllSupportInfo(int uniqueId, int* length, DrmSupportInfo** drmSupportInfoArray);
 
-    DecryptHandle* openDecryptSession(int uniqueId, int fd, off64_t offset, off64_t length);
+    DecryptHandle* openDecryptSession(
+        int uniqueId, int fd, off64_t offset, off64_t length, const char *mime);
 
-    DecryptHandle* openDecryptSession(int uniqueId, const char* uri);
+    DecryptHandle* openDecryptSession(
+        int uniqueId, const char* uri, const char* mime);
 
     status_t closeDecryptSession(int uniqueId, DecryptHandle* decryptHandle);
 
diff --git a/drm/libdrmframework/include/IDrmManagerService.h b/drm/libdrmframework/include/IDrmManagerService.h
index b9618bb..a7d21c5 100644
--- a/drm/libdrmframework/include/IDrmManagerService.h
+++ b/drm/libdrmframework/include/IDrmManagerService.h
@@ -139,9 +139,12 @@
     virtual status_t getAllSupportInfo(
             int uniqueId, int* length, DrmSupportInfo** drmSupportInfoArray) = 0;
 
-    virtual DecryptHandle* openDecryptSession(int uniqueId, int fd, off64_t offset, off64_t length) = 0;
+    virtual DecryptHandle* openDecryptSession(
+                int uniqueId, int fd, off64_t offset,
+                off64_t length, const char* mime) = 0;
 
-    virtual DecryptHandle* openDecryptSession(int uniqueId, const char* uri) = 0;
+    virtual DecryptHandle* openDecryptSession(
+                int uniqueId, const char* uri, const char* mime) = 0;
 
     virtual status_t closeDecryptSession(int uniqueId, DecryptHandle* decryptHandle) = 0;
 
@@ -222,9 +225,12 @@
     virtual status_t getAllSupportInfo(
             int uniqueId, int* length, DrmSupportInfo** drmSupportInfoArray);
 
-    virtual DecryptHandle* openDecryptSession(int uniqueId, int fd, off64_t offset, off64_t length);
+    virtual DecryptHandle* openDecryptSession(
+                int uniqueId, int fd, off64_t offset, off64_t length,
+                const char* mime);
 
-    virtual DecryptHandle* openDecryptSession(int uniqueId, const char* uri);
+    virtual DecryptHandle* openDecryptSession(
+                int uniqueId, const char* uri, const char* mime);
 
     virtual status_t closeDecryptSession(int uniqueId, DecryptHandle* decryptHandle);
 
diff --git a/drm/libdrmframework/plugins/common/include/DrmEngineBase.h b/drm/libdrmframework/plugins/common/include/DrmEngineBase.h
index 4a5afcf..08f6e6d 100644
--- a/drm/libdrmframework/plugins/common/include/DrmEngineBase.h
+++ b/drm/libdrmframework/plugins/common/include/DrmEngineBase.h
@@ -80,10 +80,12 @@
     DrmSupportInfo* getSupportInfo(int uniqueId);
 
     status_t openDecryptSession(
-            int uniqueId, DecryptHandle* decryptHandle, int fd, off64_t offset, off64_t length);
+            int uniqueId, DecryptHandle* decryptHandle,
+            int fd, off64_t offset, off64_t length, const char* mime);
 
     status_t openDecryptSession(
-            int uniqueId, DecryptHandle* decryptHandle, const char* uri);
+            int uniqueId, DecryptHandle* decryptHandle,
+            const char* uri, const char* mime);
 
     status_t closeDecryptSession(int uniqueId, DecryptHandle* decryptHandle);
 
@@ -375,7 +377,29 @@
      *     DRM_ERROR_CANNOT_HANDLE for failure and DRM_NO_ERROR for success
      */
     virtual status_t onOpenDecryptSession(
-            int uniqueId, DecryptHandle* decryptHandle, int fd, off64_t offset, off64_t length) = 0;
+            int uniqueId, DecryptHandle* decryptHandle,
+            int fd, off64_t offset, off64_t length) = 0;
+
+    /**
+     * Open the decrypt session to decrypt the given protected content
+     *
+     * @param[in] uniqueId Unique identifier for a session
+     * @param[in] decryptHandle Handle for the current decryption session
+     * @param[in] fd File descriptor of the protected content to be decrypted
+     * @param[in] offset Start position of the content
+     * @param[in] length The length of the protected content
+     * @param[in] mime Mime type of the protected content
+     *     drm plugin may do some optimization since the mime type is known.
+     * @return
+     *     DRM_ERROR_CANNOT_HANDLE for failure and DRM_NO_ERROR for success
+     */
+    virtual status_t onOpenDecryptSession(
+            int uniqueId, DecryptHandle* decryptHandle,
+            int fd, off64_t offset, off64_t length,
+            const char* mime) {
+
+        return DRM_ERROR_CANNOT_HANDLE;
+    }
 
     /**
      * Open the decrypt session to decrypt the given protected content
@@ -387,7 +411,26 @@
      *     DRM_ERROR_CANNOT_HANDLE for failure and DRM_NO_ERROR for success
      */
     virtual status_t onOpenDecryptSession(
-            int uniqueId, DecryptHandle* decryptHandle, const char* uri) = 0;
+            int uniqueId, DecryptHandle* decryptHandle,
+            const char* uri) = 0;
+
+    /**
+     * Open the decrypt session to decrypt the given protected content
+     *
+     * @param[in] uniqueId Unique identifier for a session
+     * @param[in] decryptHandle Handle for the current decryption session
+     * @param[in] uri Path of the protected content to be decrypted
+     * @param[in] mime Mime type of the protected content. The corresponding
+     *     drm plugin may do some optimization since the mime type is known.
+     * @return
+     *     DRM_ERROR_CANNOT_HANDLE for failure and DRM_NO_ERROR for success
+     */
+    virtual status_t onOpenDecryptSession(
+            int uniqueId, DecryptHandle* decryptHandle,
+            const char* uri, const char* mime) {
+
+        return DRM_ERROR_CANNOT_HANDLE;
+    }
 
     /**
      * Close the decrypt session for the given handle
diff --git a/drm/libdrmframework/plugins/common/include/IDrmEngine.h b/drm/libdrmframework/plugins/common/include/IDrmEngine.h
index 77460f6..dcf5977 100644
--- a/drm/libdrmframework/plugins/common/include/IDrmEngine.h
+++ b/drm/libdrmframework/plugins/common/include/IDrmEngine.h
@@ -320,11 +320,14 @@
      * @param[in] fd File descriptor of the protected content to be decrypted
      * @param[in] offset Start position of the content
      * @param[in] length The length of the protected content
+     * @param[in] mime Mime type of the protected content if it is
+     *     not NULL or empty
      * @return
      *     DRM_ERROR_CANNOT_HANDLE for failure and DRM_NO_ERROR for success
      */
     virtual status_t openDecryptSession(
-        int uniqueId, DecryptHandle* decryptHandle, int fd, off64_t offset, off64_t length) = 0;
+        int uniqueId, DecryptHandle* decryptHandle,
+        int fd, off64_t offset, off64_t length, const char* mime) = 0;
 
     /**
      * Open the decrypt session to decrypt the given protected content
@@ -332,11 +335,14 @@
      * @param[in] uniqueId Unique identifier for a session
      * @param[in] decryptHandle Handle for the current decryption session
      * @param[in] uri Path of the protected content to be decrypted
+     * @param[in] mime Mime type of the protected content if it is
+     *     not NULL or empty
      * @return
      *     DRM_ERROR_CANNOT_HANDLE for failure and DRM_NO_ERROR for success
      */
     virtual status_t openDecryptSession(
-        int uniqueId, DecryptHandle* decryptHandle, const char* uri) = 0;
+        int uniqueId, DecryptHandle* decryptHandle,
+        const char* uri, const char* mime) = 0;
 
     /**
      * Close the decrypt session for the given handle
diff --git a/graphics/java/android/graphics/AvoidXfermode.java b/graphics/java/android/graphics/AvoidXfermode.java
index 7e2722d..5a59e36 100644
--- a/graphics/java/android/graphics/AvoidXfermode.java
+++ b/graphics/java/android/graphics/AvoidXfermode.java
@@ -20,6 +20,7 @@
  * AvoidXfermode xfermode will draw the src everywhere except on top of the
  * opColor or, depending on the Mode, draw only on top of the opColor.
  */
+@Deprecated
 public class AvoidXfermode extends Xfermode {
 
     // these need to match the enum in SkAvoidXfermode.h on the native side
diff --git a/graphics/java/android/graphics/Canvas.java b/graphics/java/android/graphics/Canvas.java
index e1c73fd..dcda67d 100644
--- a/graphics/java/android/graphics/Canvas.java
+++ b/graphics/java/android/graphics/Canvas.java
@@ -130,8 +130,7 @@
      */
     public Canvas(Bitmap bitmap) {
         if (!bitmap.isMutable()) {
-            throw new IllegalStateException(
-                            "Immutable bitmap passed to Canvas constructor");
+            throw new IllegalStateException("Immutable bitmap passed to Canvas constructor");
         }
         throwIfRecycled(bitmap);
         mNativeCanvas = initRaster(bitmap.ni());
@@ -361,8 +360,8 @@
     /**
      * Helper version of saveLayer() that takes 4 values rather than a RectF.
      */
-    public int saveLayer(float left, float top, float right, float bottom,
-                         Paint paint, int saveFlags) {
+    public int saveLayer(float left, float top, float right, float bottom, Paint paint,
+            int saveFlags) {
         return native_saveLayer(mNativeCanvas, left, top, right, bottom,
                                 paint != null ? paint.mNativePaint : 0,
                                 saveFlags);
@@ -392,8 +391,8 @@
     /**
      * Helper for saveLayerAlpha() that takes 4 values instead of a RectF.
      */
-    public int saveLayerAlpha(float left, float top, float right, float bottom,
-                              int alpha, int saveFlags) {
+    public int saveLayerAlpha(float left, float top, float right, float bottom, int alpha,
+            int saveFlags) {
         return native_saveLayerAlpha(mNativeCanvas, left, top, right, bottom,
                                      alpha, saveFlags);
     }
@@ -496,9 +495,15 @@
     /**
      * Completely replace the current matrix with the specified matrix. If the
      * matrix parameter is null, then the current matrix is reset to identity.
+     * 
+     * <strong>Note:</strong> it is recommended to use {@link #concat(Matrix)},
+     * {@link #scale(float, float)}, {@link #translate(float, float)} and
+     * {@link #rotate(float)} instead of this method.
      *
      * @param matrix The matrix to replace the current matrix with. If it is
      *               null, set the current matrix to identity.
+     *               
+     * @see #concat(Matrix) 
      */
     public void setMatrix(Matrix matrix) {
         native_setMatrix(mNativeCanvas,
@@ -509,6 +514,7 @@
      * Return, in ctm, the current transformation matrix. This does not alter
      * the matrix in the canvas, but just returns a copy of it.
      */
+    @Deprecated
     public void getMatrix(Matrix ctm) {
         native_getCTM(mNativeCanvas, ctm.native_instance);
     }
@@ -517,8 +523,10 @@
      * Return a new matrix with a copy of the canvas' current transformation
      * matrix.
      */
+    @Deprecated
     public final Matrix getMatrix() {
         Matrix m = new Matrix();
+        //noinspection deprecation
         getMatrix(m);
         return m;
     }
@@ -531,9 +539,8 @@
      * @return true if the resulting clip is non-empty
      */
     public boolean clipRect(RectF rect, Region.Op op) {
-        return native_clipRect(mNativeCanvas,
-                               rect.left, rect.top, rect.right, rect.bottom,
-                               op.nativeInt);
+        return native_clipRect(mNativeCanvas, rect.left, rect.top, rect.right, rect.bottom,
+                op.nativeInt);
     }
 
     /**
@@ -545,9 +552,8 @@
      * @return true if the resulting clip is non-empty
      */
     public boolean clipRect(Rect rect, Region.Op op) {
-        return native_clipRect(mNativeCanvas,
-                               rect.left, rect.top, rect.right, rect.bottom,
-                               op.nativeInt);
+        return native_clipRect(mNativeCanvas, rect.left, rect.top, rect.right, rect.bottom,
+                op.nativeInt);
     }
 
     /**
@@ -583,10 +589,8 @@
      * @param op     How the clip is modified
      * @return       true if the resulting clip is non-empty
      */
-    public boolean clipRect(float left, float top, float right, float bottom,
-                            Region.Op op) {
-        return native_clipRect(mNativeCanvas, left, top, right, bottom,
-                               op.nativeInt);
+    public boolean clipRect(float left, float top, float right, float bottom, Region.Op op) {
+        return native_clipRect(mNativeCanvas, left, top, right, bottom, op.nativeInt);
     }
 
     /**
@@ -602,9 +606,8 @@
      *               clip
      * @return       true if the resulting clip is non-empty
      */
-    public native boolean clipRect(float left, float top,
-                                   float right, float bottom);
-    
+    public native boolean clipRect(float left, float top, float right, float bottom);
+
     /**
      * Intersect the current clip with the specified rectangle, which is
      * expressed in local coordinates.
@@ -618,9 +621,8 @@
      *               clip
      * @return       true if the resulting clip is non-empty
      */
-    public native boolean clipRect(int left, int top,
-                                   int right, int bottom);
-    
+    public native boolean clipRect(int left, int top, int right, int bottom);
+
     /**
         * Modify the current clip with the specified path.
      *
@@ -753,8 +755,7 @@
      * @return            true if the rect (transformed by the canvas' matrix)
      *                    does not intersect with the canvas' clip
      */
-    public boolean quickReject(float left, float top, float right, float bottom,
-                               EdgeType type) {
+    public boolean quickReject(float left, float top, float right, float bottom, EdgeType type) {
         return native_quickReject(mNativeCanvas, left, top, right, bottom,
                                   type.nativeInt);
     }
@@ -854,8 +855,7 @@
      *                 "points" that are drawn is really (count >> 1).
      * @param paint    The paint used to draw the points
      */
-    public native void drawPoints(float[] pts, int offset, int count,
-                                  Paint paint);
+    public native void drawPoints(float[] pts, int offset, int count, Paint paint);
 
     /**
      * Helper for drawPoints() that assumes you want to draw the entire array
@@ -878,10 +878,8 @@
      * @param startY The y-coordinate of the start point of the line
      * @param paint  The paint used to draw the line
      */
-    public void drawLine(float startX, float startY, float stopX, float stopY,
-                         Paint paint) {
-        native_drawLine(mNativeCanvas, startX, startY, stopX, stopY,
-                        paint.mNativePaint);
+    public void drawLine(float startX, float startY, float stopX, float stopY, Paint paint) {
+        native_drawLine(mNativeCanvas, startX, startY, stopX, stopY, paint.mNativePaint);
     }
 
     /**
@@ -899,8 +897,7 @@
      *                 (count >> 2).
      * @param paint    The paint used to draw the points
      */
-    public native void drawLines(float[] pts, int offset, int count,
-                                 Paint paint);
+    public native void drawLines(float[] pts, int offset, int count, Paint paint);
 
     public void drawLines(float[] pts, Paint paint) {
         drawLines(pts, 0, pts.length, paint);
@@ -939,10 +936,8 @@
      * @param bottom The bottom side of the rectangle to be drawn
      * @param paint  The paint used to draw the rect
      */
-    public void drawRect(float left, float top, float right, float bottom,
-                         Paint paint) {
-        native_drawRect(mNativeCanvas, left, top, right, bottom,
-                        paint.mNativePaint);
+    public void drawRect(float left, float top, float right, float bottom, Paint paint) {
+        native_drawRect(mNativeCanvas, left, top, right, bottom, paint.mNativePaint);
     }
 
     /**
@@ -969,8 +964,7 @@
      * @param paint  The paint used to draw the circle
      */
     public void drawCircle(float cx, float cy, float radius, Paint paint) {
-        native_drawCircle(mNativeCanvas, cx, cy, radius,
-                          paint.mNativePaint);
+        native_drawCircle(mNativeCanvas, cx, cy, radius, paint.mNativePaint);
     }
 
     /**
@@ -996,8 +990,8 @@
                         close it if it is being stroked. This will draw a wedge
      * @param paint      The paint used to draw the arc
      */
-    public void drawArc(RectF oval, float startAngle, float sweepAngle,
-                        boolean useCenter, Paint paint) {
+    public void drawArc(RectF oval, float startAngle, float sweepAngle, boolean useCenter,
+            Paint paint) {
         if (oval == null) {
             throw new NullPointerException();
         }
@@ -1035,8 +1029,7 @@
     
     private static void throwIfRecycled(Bitmap bitmap) {
         if (bitmap.isRecycled()) {
-            throw new RuntimeException(
-                        "Canvas: trying to use a recycled bitmap " + bitmap);
+            throw new RuntimeException("Canvas: trying to use a recycled bitmap " + bitmap);
         }
     }
 
@@ -1077,8 +1070,7 @@
     public void drawBitmap(Bitmap bitmap, float left, float top, Paint paint) {
         throwIfRecycled(bitmap);
         native_drawBitmap(mNativeCanvas, bitmap.ni(), left, top,
-                paint != null ? paint.mNativePaint : 0, mDensity, mScreenDensity,
-                bitmap.mDensity);
+                paint != null ? paint.mNativePaint : 0, mDensity, mScreenDensity, bitmap.mDensity);
     }
 
     /**
@@ -1109,8 +1101,7 @@
         }
         throwIfRecycled(bitmap);
         native_drawBitmap(mNativeCanvas, bitmap.ni(), src, dst,
-                          paint != null ? paint.mNativePaint : 0,
-                          mScreenDensity, bitmap.mDensity);
+                          paint != null ? paint.mNativePaint : 0, mScreenDensity, bitmap.mDensity);
     }
 
     /**
@@ -1141,8 +1132,7 @@
         }
         throwIfRecycled(bitmap);
         native_drawBitmap(mNativeCanvas, bitmap.ni(), src, dst,
-                          paint != null ? paint.mNativePaint : 0,
-                          mScreenDensity, bitmap.mDensity);
+                          paint != null ? paint.mNativePaint : 0, mScreenDensity, bitmap.mDensity);
     }
     
     /**
@@ -1164,9 +1154,8 @@
      *                 be 0xFF for every pixel).
      * @param paint  May be null. The paint used to draw the bitmap
      */
-    public void drawBitmap(int[] colors, int offset, int stride, float x,
-                           float y, int width, int height, boolean hasAlpha,
-                           Paint paint) {
+    public void drawBitmap(int[] colors, int offset, int stride, float x, float y,
+            int width, int height, boolean hasAlpha, Paint paint) {
         // check for valid input
         if (width < 0) {
             throw new IllegalArgumentException("width must be >= 0");
@@ -1195,8 +1184,7 @@
     /** Legacy version of drawBitmap(int[] colors, ...) that took ints for x,y
      */
     public void drawBitmap(int[] colors, int offset, int stride, int x, int y,
-                           int width, int height, boolean hasAlpha,
-                           Paint paint) {
+            int width, int height, boolean hasAlpha, Paint paint) {
         // call through to the common float version
         drawBitmap(colors, offset, stride, (float)x, (float)y, width, height,
                    hasAlpha, paint);
@@ -1250,8 +1238,7 @@
      * @param paint  May be null. The paint used to draw the bitmap
      */
     public void drawBitmapMesh(Bitmap bitmap, int meshWidth, int meshHeight,
-                               float[] verts, int vertOffset,
-                               int[] colors, int colorOffset, Paint paint) {
+            float[] verts, int vertOffset, int[] colors, int colorOffset, Paint paint) {
         if ((meshWidth | meshHeight | vertOffset | colorOffset) < 0) {
             throw new ArrayIndexOutOfBoundsException();
         }
@@ -1269,7 +1256,7 @@
                              verts, vertOffset, colors, colorOffset,
                              paint != null ? paint.mNativePaint : 0);
     }
-        
+
     public enum VertexMode {
         TRIANGLES(0),
         TRIANGLE_STRIP(1),
@@ -1315,12 +1302,9 @@
      * @param indexCount number of entries in the indices array (if not null).
      * @param paint Specifies the shader to use if the texs array is non-null. 
      */
-    public void drawVertices(VertexMode mode, int vertexCount,
-                             float[] verts, int vertOffset,
-                             float[] texs, int texOffset,
-                             int[] colors, int colorOffset,
-                             short[] indices, int indexOffset,
-                             int indexCount, Paint paint) {
+    public void drawVertices(VertexMode mode, int vertexCount, float[] verts, int vertOffset,
+            float[] texs, int texOffset, int[] colors, int colorOffset,
+            short[] indices, int indexOffset, int indexCount, Paint paint) {
         checkRange(verts.length, vertOffset, vertexCount);
         if (texs != null) {
             checkRange(texs.length, texOffset, vertexCount);
@@ -1345,8 +1329,7 @@
      * @param y     The y-coordinate of the origin of the text being drawn
      * @param paint The paint used for the text (e.g. color, size, style)
      */
-    public void drawText(char[] text, int index, int count, float x, float y,
-                         Paint paint) {
+    public void drawText(char[] text, int index, int count, float x, float y, Paint paint) {
         if ((index | count | (index + count) |
             (text.length - index - count)) < 0) {
             throw new IndexOutOfBoundsException();
@@ -1380,8 +1363,7 @@
      * @param y     The y-coordinate of the origin of the text being drawn
      * @param paint The paint used for the text (e.g. color, size, style)
      */
-    public void drawText(String text, int start, int end, float x, float y,
-                         Paint paint) {
+    public void drawText(String text, int start, int end, float x, float y, Paint paint) {
         if ((start | end | (end - start) | (text.length() - end)) < 0) {
             throw new IndexOutOfBoundsException();
         }
@@ -1402,8 +1384,7 @@
      * @param y        The y-coordinate of origin for where to draw the text
      * @param paint The paint used for the text (e.g. color, size, style)
      */
-    public void drawText(CharSequence text, int start, int end, float x,
-                         float y, Paint paint) {
+    public void drawText(CharSequence text, int start, int end, float x, float y, Paint paint) {
         if (text instanceof String || text instanceof SpannedString ||
             text instanceof SpannableString) {
             native_drawText(mNativeCanvas, text.toString(), start, end, x, y,
@@ -1441,9 +1422,8 @@
      * @param paint the paint
      * @hide
      */
-    public void drawTextRun(char[] text, int index, int count,
-            int contextIndex, int contextCount, float x, float y, int dir,
-            Paint paint) {
+    public void drawTextRun(char[] text, int index, int count, int contextIndex, int contextCount,
+            float x, float y, int dir, Paint paint) {
 
         if (text == null) {
             throw new NullPointerException("text is null");
@@ -1479,9 +1459,8 @@
      * @param paint the paint
      * @hide
      */
-    public void drawTextRun(CharSequence text, int start, int end,
-            int contextStart, int contextEnd, float x, float y, int dir,
-            Paint paint) {
+    public void drawTextRun(CharSequence text, int start, int end, int contextStart, int contextEnd,
+            float x, float y, int dir, Paint paint) {
 
         if (text == null) {
             throw new NullPointerException("text is null");
@@ -1516,6 +1495,9 @@
     /**
      * Draw the text in the array, with each character's origin specified by
      * the pos array.
+     * 
+     * This method does not support glyph composition and decomposition and
+     * should therefore not be used to render complex scripts.
      *
      * @param text     The text to be drawn
      * @param index    The index of the first character to draw
@@ -1524,8 +1506,8 @@
      *                 character
      * @param paint    The paint used for the text (e.g. color, size, style)
      */
-    public void drawPosText(char[] text, int index, int count, float[] pos,
-                            Paint paint) {
+    @Deprecated
+    public void drawPosText(char[] text, int index, int count, float[] pos, Paint paint) {
         if (index < 0 || index + count > text.length || count*2 > pos.length) {
             throw new IndexOutOfBoundsException();
         }
@@ -1536,11 +1518,15 @@
     /**
      * Draw the text in the array, with each character's origin specified by
      * the pos array.
+     * 
+     * This method does not support glyph composition and decomposition and
+     * should therefore not be used to render complex scripts.
      *
      * @param text  The text to be drawn
      * @param pos   Array of [x,y] positions, used to position each character
      * @param paint The paint used for the text (e.g. color, size, style)
      */
+    @Deprecated
     public void drawPosText(String text, float[] pos, Paint paint) {
         if (text.length()*2 > pos.length) {
             throw new ArrayIndexOutOfBoundsException();
@@ -1562,7 +1548,7 @@
      * @param paint    The paint used for the text (e.g. color, size, style)
      */
     public void drawTextOnPath(char[] text, int index, int count, Path path,
-                               float hOffset, float vOffset, Paint paint) {
+            float hOffset, float vOffset, Paint paint) {
         if (index < 0 || index + count > text.length) {
             throw new ArrayIndexOutOfBoundsException();
         }
@@ -1584,12 +1570,10 @@
      *                 the text
      * @param paint    The paint used for the text (e.g. color, size, style)
      */
-    public void drawTextOnPath(String text, Path path, float hOffset,
-                               float vOffset, Paint paint) {
+    public void drawTextOnPath(String text, Path path, float hOffset, float vOffset, Paint paint) {
         if (text.length() > 0) {
-            native_drawTextOnPath(mNativeCanvas, text, path.ni(),
-                                  hOffset, vOffset, paint.mBidiFlags,
-                                  paint.mNativePaint);
+            native_drawTextOnPath(mNativeCanvas, text, path.ni(), hOffset, vOffset,
+                    paint.mBidiFlags, paint.mNativePaint);
         }
     }
 
@@ -1612,8 +1596,7 @@
         save();
         translate(dst.left, dst.top);
         if (picture.getWidth() > 0 && picture.getHeight() > 0) {
-            scale(dst.width() / picture.getWidth(),
-                  dst.height() / picture.getHeight());
+            scale(dst.width() / picture.getWidth(), dst.height() / picture.getHeight());
         }
         drawPicture(picture);
         restore();
@@ -1626,8 +1609,8 @@
         save();
         translate(dst.left, dst.top);
         if (picture.getWidth() > 0 && picture.getHeight() > 0) {
-            scale((float)dst.width() / picture.getWidth(),
-                  (float)dst.height() / picture.getHeight());
+            scale((float) dst.width() / picture.getWidth(),
+                    (float) dst.height() / picture.getHeight());
         }
         drawPicture(picture);
         restore();
diff --git a/graphics/java/android/graphics/DrawFilter.java b/graphics/java/android/graphics/DrawFilter.java
index 6b44ed7..1f64539 100644
--- a/graphics/java/android/graphics/DrawFilter.java
+++ b/graphics/java/android/graphics/DrawFilter.java
@@ -28,7 +28,11 @@
     /* package */ int mNativeInt;    // pointer to native object
 
     protected void finalize() throws Throwable {
-        nativeDestructor(mNativeInt);
+        try {
+            nativeDestructor(mNativeInt);
+        } finally {
+            super.finalize();
+        }
     }
     
     private static native void nativeDestructor(int nativeDrawFilter);
diff --git a/graphics/java/android/graphics/LinearGradient.java b/graphics/java/android/graphics/LinearGradient.java
index 82ed199..96a71e3 100644
--- a/graphics/java/android/graphics/LinearGradient.java
+++ b/graphics/java/android/graphics/LinearGradient.java
@@ -28,8 +28,8 @@
                             the the colors are distributed evenly along the gradient line.
         @param  tile        The Shader tiling mode
 	*/
-	public LinearGradient(float x0, float y0, float x1, float y1,
-                          int colors[], float positions[], TileMode tile) {
+	public LinearGradient(float x0, float y0, float x1, float y1, int colors[], float positions[],
+            TileMode tile) {
         if (colors.length < 2) {
             throw new IllegalArgumentException("needs >= 2 number of colors");
         }
@@ -50,8 +50,8 @@
         @param  color1  The color at the end of the gradient line.
         @param  tile    The Shader tiling mode
 	*/
-	public LinearGradient(float x0, float y0, float x1, float y1,
-                          int color0, int color1, TileMode tile) {
+	public LinearGradient(float x0, float y0, float x1, float y1, int color0, int color1,
+            TileMode tile) {
         native_instance = nativeCreate2(x0, y0, x1, y1, color0, color1, tile.nativeInt);
         native_shader = nativePostCreate2(native_instance, x0, y0, x1, y1, color0, color1,
                 tile.nativeInt);
diff --git a/graphics/java/android/graphics/Paint.java b/graphics/java/android/graphics/Paint.java
index ce42612..c97785e 100644
--- a/graphics/java/android/graphics/Paint.java
+++ b/graphics/java/android/graphics/Paint.java
@@ -528,6 +528,7 @@
      *
      * @return true if the lineartext bit is set in the paint's flags
      */
+    @Deprecated
     public final boolean isLinearText() {
         return (getFlags() & LINEAR_TEXT_FLAG) != 0;
     }
@@ -538,6 +539,7 @@
      * @param linearText true to set the linearText bit in the paint's flags,
      *                   false to clear it.
      */
+    @Deprecated
     public native void setLinearText(boolean linearText);
 
     /**
@@ -2142,8 +2144,6 @@
     private static native void native_setTextAlign(int native_object,
                                                    int align);
 
-    private static native float native_getFontMetrics(int native_paint,
-                                                      FontMetrics metrics);
     private static native int native_getTextWidths(int native_object,
                             char[] text, int index, int count, float[] widths);
     private static native int native_getTextWidths(int native_object,
diff --git a/graphics/java/android/graphics/PaintFlagsDrawFilter.java b/graphics/java/android/graphics/PaintFlagsDrawFilter.java
index 0f0d03d..c833a12 100644
--- a/graphics/java/android/graphics/PaintFlagsDrawFilter.java
+++ b/graphics/java/android/graphics/PaintFlagsDrawFilter.java
@@ -17,6 +17,10 @@
 package android.graphics;
 
 public class PaintFlagsDrawFilter extends DrawFilter {
+    /** @hide **/
+    public final int clearBits;
+    /** @hide **/
+    public final int setBits;
 
     /**
      * Subclass of DrawFilter that affects every paint by first clearing
@@ -27,6 +31,8 @@
      * @param setBits These bits will be set in the paint's flags
      */
     public PaintFlagsDrawFilter(int clearBits, int setBits) {
+        this.clearBits = clearBits;
+        this.setBits = setBits;
         // our native constructor can return 0, if the specified bits
         // are effectively a no-op
         mNativeInt = nativeConstructor(clearBits, setBits);
diff --git a/graphics/java/android/graphics/PathMeasure.java b/graphics/java/android/graphics/PathMeasure.java
index 98f7821..7062824 100644
--- a/graphics/java/android/graphics/PathMeasure.java
+++ b/graphics/java/android/graphics/PathMeasure.java
@@ -17,6 +17,7 @@
 package android.graphics;
 
 public class PathMeasure {
+    private Path mPath;
 
     /**
      * Create an empty PathMeasure object. To uses this to measure the length
@@ -28,6 +29,7 @@
      * is used. If the path is modified, you must call setPath with the path.
      */
     public PathMeasure() {
+        mPath = null;
         native_instance = native_create(0, false);
     }
     
@@ -46,8 +48,8 @@
      *        even if its contour was not explicitly closed.
      */
     public PathMeasure(Path path, boolean forceClosed) {
-        // note: the native side makes a copy of path, so we don't need a java
-        // reference to it here, since it's fine if it gets GC'd
+        // The native implementation does not copy the path, prevent it from being GC'd
+        mPath = path;
         native_instance = native_create(path != null ? path.ni() : 0,
                                         forceClosed);
     }
@@ -56,8 +58,7 @@
      * Assign a new path, or null to have none.
      */
     public void setPath(Path path, boolean forceClosed) {
-        // note: the native side makes a copy of path, so we don't need a java
-        // reference to it here, since it's fine if it gets GC'd
+        mPath = path;
         native_setPath(native_instance,
                        path != null ? path.ni() : 0,
                        forceClosed);
diff --git a/graphics/java/android/graphics/Picture.java b/graphics/java/android/graphics/Picture.java
index bbb2dbf..997141d 100644
--- a/graphics/java/android/graphics/Picture.java
+++ b/graphics/java/android/graphics/Picture.java
@@ -32,10 +32,15 @@
     private Canvas mRecordingCanvas;
     private final int mNativePicture;
 
+    /**
+     * @hide
+     */
+    public final boolean createdFromStream;
+
     private static final int WORKING_STREAM_STORAGE = 16 * 1024;
 
     public Picture() {
-        this(nativeConstructor(0));
+        this(nativeConstructor(0), false);
     }
 
     /**
@@ -44,7 +49,7 @@
      * changes will not be reflected in this picture.
      */
     public Picture(Picture src) {
-        this(nativeConstructor(src != null ? src.mNativePicture : 0));
+        this(nativeConstructor(src != null ? src.mNativePicture : 0), false);
     }
     
     /**
@@ -101,15 +106,24 @@
     /**
      * Create a new picture (already recorded) from the data in the stream. This
      * data was generated by a previous call to writeToStream().
+     * 
+     * <strong>Note:</strong> a picture created from an input stream cannot be
+     * replayed on a hardware accelerated canvas.
+     * 
+     * @see #writeToStream(java.io.OutputStream) 
      */
     public static Picture createFromStream(InputStream stream) {
-        return new Picture(
-            nativeCreateFromStream(stream, new byte[WORKING_STREAM_STORAGE]));
+        return new Picture(nativeCreateFromStream(stream, new byte[WORKING_STREAM_STORAGE]), true);
     }
 
     /**
      * Write the picture contents to a stream. The data can be used to recreate
      * the picture in this or another process by calling createFromStream.
+     *
+     * <strong>Note:</strong> a picture created from an input stream cannot be
+     * replayed on a hardware accelerated canvas.
+     * 
+     * @see #createFromStream(java.io.InputStream) 
      */
     public void writeToStream(OutputStream stream) {
         // do explicit check before calling the native method
@@ -123,18 +137,23 @@
     }
 
     protected void finalize() throws Throwable {
-        nativeDestructor(mNativePicture);
+        try {
+            nativeDestructor(mNativePicture);
+        } finally {
+            super.finalize();
+        }
     }
-    
-    /*package*/ final int ni() {
+
+    final int ni() {
         return mNativePicture;
     }
     
-    private Picture(int nativePicture) {
+    private Picture(int nativePicture, boolean fromStream) {
         if (nativePicture == 0) {
             throw new RuntimeException();
         }
         mNativePicture = nativePicture;
+        createdFromStream = fromStream;
     }
 
     // return empty picture if src is 0, or a copy of the native src
diff --git a/graphics/java/android/graphics/PixelXorXfermode.java b/graphics/java/android/graphics/PixelXorXfermode.java
index 18d15cf..6075ec3 100644
--- a/graphics/java/android/graphics/PixelXorXfermode.java
+++ b/graphics/java/android/graphics/PixelXorXfermode.java
@@ -22,6 +22,7 @@
  * this mode *always* returns an opaque color (alpha == 255). Thus it is
  * not really usefull for operating on blended colors.
  */
+@Deprecated
 public class PixelXorXfermode extends Xfermode {
 
     public PixelXorXfermode(int opColor) {
diff --git a/graphics/java/android/graphics/Rect.java b/graphics/java/android/graphics/Rect.java
index 7830224..0ada1fb 100644
--- a/graphics/java/android/graphics/Rect.java
+++ b/graphics/java/android/graphics/Rect.java
@@ -76,13 +76,21 @@
     }
 
     @Override
-    public boolean equals(Object obj) {
-        Rect r = (Rect) obj;
-        if (r != null) {
-            return left == r.left && top == r.top && right == r.right
-                    && bottom == r.bottom;
-        }
-        return false;
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        Rect r = (Rect) o;
+        return left == r.left && top == r.top && right == r.right && bottom == r.bottom;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = left;
+        result = 31 * result + top;
+        result = 31 * result + right;
+        result = 31 * result + bottom;
+        return result;
     }
 
     @Override
diff --git a/graphics/java/android/graphics/RectF.java b/graphics/java/android/graphics/RectF.java
index 00e9609..293dfcc 100644
--- a/graphics/java/android/graphics/RectF.java
+++ b/graphics/java/android/graphics/RectF.java
@@ -79,6 +79,24 @@
         bottom = r.bottom;
     }
 
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        Rect r = (Rect) o;
+        return left == r.left && top == r.top && right == r.right && bottom == r.bottom;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = (left != +0.0f ? Float.floatToIntBits(left) : 0);
+        result = 31 * result + (top != +0.0f ? Float.floatToIntBits(top) : 0);
+        result = 31 * result + (right != +0.0f ? Float.floatToIntBits(right) : 0);
+        result = 31 * result + (bottom != +0.0f ? Float.floatToIntBits(bottom) : 0);
+        return result;
+    }
+
     public String toString() {
         return "RectF(" + left + ", " + top + ", "
                       + right + ", " + bottom + ")";
diff --git a/graphics/java/android/graphics/drawable/GradientDrawable.java b/graphics/java/android/graphics/drawable/GradientDrawable.java
index 50964d5..5b50beb 100644
--- a/graphics/java/android/graphics/drawable/GradientDrawable.java
+++ b/graphics/java/android/graphics/drawable/GradientDrawable.java
@@ -173,9 +173,20 @@
     }
 
     /**
-     * Specify radii for each of the 4 corners. For each corner, the array
-     * contains 2 values, [X_radius, Y_radius]. The corners are ordered
-     * top-left, top-right, bottom-right, bottom-left
+     * <p>Specify radii for each of the 4 corners. For each corner, the array
+     * contains 2 values, <code>[X_radius, Y_radius]</code>. The corners are ordered
+     * top-left, top-right, bottom-right, bottom-left. This property
+     * is honored only when the shape is of type {@link #RECTANGLE}.</p>
+     * <p><strong>Note</strong>: changing this property will affect all instances
+     * of a drawable loaded from a resource. It is recommended to invoke
+     * {@link #mutate()} before changing this property.</p>
+     *
+     * @param radii 4 pairs of X and Y radius for each corner, specified in pixels.
+     *              The length of this array must be >= 8
+     *
+     * @see #mutate()
+     * @see #setCornerRadii(float[])
+     * @see #setShape(int)
      */
     public void setCornerRadii(float[] radii) {
         mGradientState.setCornerRadii(radii);
@@ -184,23 +195,57 @@
     }
     
     /**
-     * Specify radius for the corners of the gradient. If this is > 0, then the
-     * drawable is drawn in a round-rectangle, rather than a rectangle.
+     * <p>Specify radius for the corners of the gradient. If this is > 0, then the
+     * drawable is drawn in a round-rectangle, rather than a rectangle. This property
+     * is honored only when the shape is of type {@link #RECTANGLE}.</p>
+     * <p><strong>Note</strong>: changing this property will affect all instances
+     * of a drawable loaded from a resource. It is recommended to invoke
+     * {@link #mutate()} before changing this property.</p>
+     *
+     * @param radius The radius in pixels of the corners of the rectangle shape
+     *
+     * @see #mutate()
+     * @see #setCornerRadii(float[])
+     * @see #setShape(int) 
      */
     public void setCornerRadius(float radius) {
         mGradientState.setCornerRadius(radius);
         mPathIsDirty = true;
         invalidateSelf();
     }
-    
+
     /**
-     * Set the stroke width and color for the drawable. If width is zero,
-     * then no stroke is drawn.
+     * <p>Set the stroke width and color for the drawable. If width is zero,
+     * then no stroke is drawn.</p>
+     * <p><strong>Note</strong>: changing this property will affect all instances
+     * of a drawable loaded from a resource. It is recommended to invoke
+     * {@link #mutate()} before changing this property.</p>
+     *
+     * @param width The width in pixels of the stroke
+     * @param color The color of the stroke
+     *
+     * @see #mutate()
+     * @see #setStroke(int, int, float, float) 
      */
     public void setStroke(int width, int color) {
         setStroke(width, color, 0, 0);
     }
-    
+
+    /**
+     * <p>Set the stroke width and color for the drawable. If width is zero,
+     * then no stroke is drawn. This method can also be used to dash the stroke.</p>
+     * <p><strong>Note</strong>: changing this property will affect all instances
+     * of a drawable loaded from a resource. It is recommended to invoke
+     * {@link #mutate()} before changing this property.</p>
+     *
+     * @param width The width in pixels of the stroke
+     * @param color The color of the stroke
+     * @param dashWidth The length in pixels of the dashes, set to 0 to disable dashes 
+     * @param dashGap The gap in pixels between dashes
+     *
+     * @see #mutate()
+     * @see #setStroke(int, int) 
+     */
     public void setStroke(int width, int color, float dashWidth, float dashGap) {
         mGradientState.setStroke(width, color, dashWidth, dashGap);
 
@@ -218,13 +263,37 @@
         mStrokePaint.setPathEffect(e);
         invalidateSelf();
     }
-    
+
+
+    /**
+     * <p>Sets the size of the shape drawn by this drawable.</p>
+     * <p><strong>Note</strong>: changing this property will affect all instances
+     * of a drawable loaded from a resource. It is recommended to invoke
+     * {@link #mutate()} before changing this property.</p>
+     *
+     * @param width The width of the shape used by this drawable
+     * @param height The height of the shape used by this drawable
+     *
+     * @see #mutate()
+     * @see #setGradientType(int)
+     */
     public void setSize(int width, int height) {
         mGradientState.setSize(width, height);
         mPathIsDirty = true;
         invalidateSelf();
     }
-    
+
+    /**
+     * <p>Sets the type of shape used to draw the gradient.</p>
+     * <p><strong>Note</strong>: changing this property will affect all instances
+     * of a drawable loaded from a resource. It is recommended to invoke
+     * {@link #mutate()} before changing this property.</p>
+     *
+     * @param shape The desired shape for this drawable: {@link #LINE},
+     *              {@link #OVAL}, {@link #RECTANGLE} or {@link #RING}
+     *
+     * @see #mutate()
+     */
     public void setShape(int shape) {
         mRingPath = null;
         mPathIsDirty = true;
@@ -232,24 +301,73 @@
         invalidateSelf();
     }
 
+    /**
+     * <p>Sets the type of gradient used by this drawable..</p>
+     * <p><strong>Note</strong>: changing this property will affect all instances
+     * of a drawable loaded from a resource. It is recommended to invoke
+     * {@link #mutate()} before changing this property.</p>
+     *
+     * @param gradient The type of the gradient: {@link #LINEAR_GRADIENT},
+     *                 {@link #RADIAL_GRADIENT} or {@link #SWEEP_GRADIENT}
+     *
+     * @see #mutate()
+     */
     public void setGradientType(int gradient) {
         mGradientState.setGradientType(gradient);
         mRectIsDirty = true;
         invalidateSelf();
     }
 
+    /**
+     * <p>Sets the center location of the gradient. The radius is honored only when 
+     * the gradient type is set to {@link #RADIAL_GRADIENT} or {@link #SWEEP_GRADIENT}.</p>
+     * <p><strong>Note</strong>: changing this property will affect all instances
+     * of a drawable loaded from a resource. It is recommended to invoke
+     * {@link #mutate()} before changing this property.</p>
+     *
+     * @param x The x coordinate of the gradient's center
+     * @param y The y coordinate of the gradient's center
+     *
+     * @see #mutate()
+     * @see #setGradientType(int)
+     */
     public void setGradientCenter(float x, float y) {
         mGradientState.setGradientCenter(x, y);
         mRectIsDirty = true;
         invalidateSelf();
     }
 
+    /**
+     * <p>Sets the radius of the gradient. The radius is honored only when the
+     * gradient type is set to {@link #RADIAL_GRADIENT}.</p>
+     * <p><strong>Note</strong>: changing this property will affect all instances
+     * of a drawable loaded from a resource. It is recommended to invoke
+     * {@link #mutate()} before changing this property.</p>
+     *
+     * @param gradientRadius The radius of the gradient in pixels
+     *
+     * @see #mutate()
+     * @see #setGradientType(int) 
+     */
     public void setGradientRadius(float gradientRadius) {
         mGradientState.setGradientRadius(gradientRadius);
         mRectIsDirty = true;
         invalidateSelf();
     }
 
+    /**
+     * <p>Sets whether or not this drawable will honor its <code>level</code>
+     * property.</p>
+     * <p><strong>Note</strong>: changing this property will affect all instances
+     * of a drawable loaded from a resource. It is recommended to invoke
+     * {@link #mutate()} before changing this property.</p>
+     *
+     * @param useLevel True if this drawable should honor its level, false otherwise
+     *
+     * @see #mutate()
+     * @see #setLevel(int) 
+     * @see #getLevel() 
+     */
     public void setUseLevel(boolean useLevel) {
         mGradientState.mUseLevel = useLevel;
         mRectIsDirty = true;
@@ -261,6 +379,47 @@
         return alpha * scale >> 8;
     }
 
+    /**
+     * Returns the orientation of the gradient defined in this drawable.
+     */
+    public Orientation getOrientation() {
+        return mGradientState.mOrientation;
+    }
+
+    /**
+     * <p>Changes the orientation of the gradient defined in this drawable.</p>
+     * <p><strong>Note</strong>: changing orientation will affect all instances
+     * of a drawable loaded from a resource. It is recommended to invoke
+     * {@link #mutate()} before changing the orientation.</p>
+     * 
+     * @param orientation The desired orientation (angle) of the gradient
+     *                    
+     * @see #mutate() 
+     */
+    public void setOrientation(Orientation orientation) {
+        mGradientState.mOrientation = orientation;
+        mRectIsDirty = true;
+        invalidateSelf();
+    }
+
+    /**
+     * <p>Sets the colors used to draw the gradient. Each color is specified as an
+     * ARGB integer and the array must contain at least 2 colors.</p>
+     * <p><strong>Note</strong>: changing orientation will affect all instances
+     * of a drawable loaded from a resource. It is recommended to invoke
+     * {@link #mutate()} before changing the orientation.</p>
+     *
+     * @param colors 2 or more ARGB colors
+     *
+     * @see #mutate()
+     * @see #setColor(int) 
+     */
+    public void setColors(int[] colors) {
+        mGradientState.setColors(colors);
+        mRectIsDirty = true;
+        invalidateSelf();
+    }
+
     @Override
     public void draw(Canvas canvas) {
         if (!ensureValidRect()) {
@@ -442,6 +601,17 @@
         return ringPath;
     }
 
+    /**
+     * <p>Changes this drawbale to use a single color instead of a gradient.</p>
+     * <p><strong>Note</strong>: changing orientation will affect all instances
+     * of a drawable loaded from a resource. It is recommended to invoke
+     * {@link #mutate()} before changing the orientation.</p>
+     *
+     * @param argb The color used to fill the shape
+     *
+     * @see #mutate()
+     * @see #setColors(int[]) 
+     */
     public void setColor(int argb) {
         mGradientState.setSolidColor(argb);
         mFillPaint.setColor(argb);
@@ -450,10 +620,9 @@
 
     @Override
     public int getChangingConfigurations() {
-        return super.getChangingConfigurations()
-                | mGradientState.mChangingConfigurations;
+        return super.getChangingConfigurations() | mGradientState.mChangingConfigurations;
     }
-    
+
     @Override
     public void setAlpha(int alpha) {
         if (alpha != mAlpha) {
@@ -480,7 +649,6 @@
 
     @Override
     public int getOpacity() {
-        // XXX need to figure out the actual opacity...
         return PixelFormat.TRANSLUCENT;
     }
 
@@ -911,11 +1079,6 @@
         private float mGradientRadius = 0.5f;
         private boolean mUseLevel;
         private boolean mUseLevelForShape;
-        
-        
-        GradientState() {
-            mOrientation = Orientation.TOP_BOTTOM;
-        }
 
         GradientState(Orientation orientation, int[] colors) {
             mOrientation = orientation;
@@ -987,6 +1150,11 @@
             mCenterY = y;
         }
 
+        public void setColors(int[] colors) {
+            mHasSolidColor = false;
+            mColors = colors;
+        }
+        
         public void setSolidColor(int argb) {
             mHasSolidColor = true;
             mSolidColor = argb;
@@ -1055,4 +1223,3 @@
         }
     }
 }
-
diff --git a/graphics/java/android/renderscript/Allocation.java b/graphics/java/android/renderscript/Allocation.java
index f285f5b..11c2427 100644
--- a/graphics/java/android/renderscript/Allocation.java
+++ b/graphics/java/android/renderscript/Allocation.java
@@ -487,6 +487,7 @@
 
         final byte[] data = fp.getData();
         int eSize = mType.mElement.mElements[component_number].getSizeBytes();
+        eSize *= mType.mElement.mArraySizes[component_number];
 
         if (data.length != eSize) {
             throw new RSIllegalArgumentException("Field packer sizelength " + data.length +
diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java
index ad10832..bfe412c 100644
--- a/graphics/java/android/renderscript/RenderScript.java
+++ b/graphics/java/android/renderscript/RenderScript.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 The Android Open Source Project
+ * Copyright (C) 2008-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.
@@ -837,7 +837,8 @@
                         mRS.mErrorCallback.mErrorNum = subID;
                         mRS.mErrorCallback.run();
                     } else {
-                        //throw new RSRuntimeException("Received error num " + subID + ", details: " + e);
+                        // Do not throw here. In these cases, we do not have
+                        // a fatal error.
                     }
                     continue;
                 }
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp
index bc1db4d..9622bd2 100644
--- a/graphics/jni/android_renderscript_RenderScript.cpp
+++ b/graphics/jni/android_renderscript_RenderScript.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 The Android Open Source Project
+ * Copyright (C) 2011-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.
@@ -567,7 +567,7 @@
     jint len = _env->GetArrayLength(data);
     LOG_API("nAllocationElementData1D, con(%p), alloc(%p), offset(%i), comp(%i), len(%i), sizeBytes(%i)", con, (RsAllocation)alloc, offset, compIdx, len, sizeBytes);
     jbyte *ptr = _env->GetByteArrayElements(data, NULL);
-    rsAllocation1DElementData(con, (RsAllocation)alloc, offset, lod, ptr, compIdx, sizeBytes);
+    rsAllocation1DElementData(con, (RsAllocation)alloc, offset, lod, ptr, sizeBytes, compIdx);
     _env->ReleaseByteArrayElements(data, ptr, JNI_ABORT);
 }
 
@@ -623,7 +623,7 @@
                         jint srcAlloc, jint srcXoff, jint srcYoff,
                         jint srcMip, jint srcFace)
 {
-    LOG_API("nAllocation2DData_s, con(%p), dstAlloc(%p), dstXoff, dstYoff,"
+    LOG_API("nAllocation2DData_s, con(%p), dstAlloc(%p), dstXoff(%i), dstYoff(%i),"
             " dstMip(%i), dstFace(%i), width(%i), height(%i),"
             " srcAlloc(%p), srcXoff(%i), srcYoff(%i), srcMip(%i), srcFace(%i)",
             con, (RsAllocation)dstAlloc, dstXoff, dstYoff, dstMip, dstFace,
diff --git a/include/binder/IPCThreadState.h b/include/binder/IPCThreadState.h
index 3378d97..691ba2f 100644
--- a/include/binder/IPCThreadState.h
+++ b/include/binder/IPCThreadState.h
@@ -41,6 +41,7 @@
 
             int                 getCallingPid();
             int                 getCallingUid();
+            int                 getOrigCallingUid();
 
             void                setStrictModePolicy(int32_t policy);
             int32_t             getStrictModePolicy() const;
@@ -116,6 +117,7 @@
             status_t            mLastError;
             pid_t               mCallingPid;
             uid_t               mCallingUid;
+            uid_t               mOrigCallingUid;
             int32_t             mStrictModePolicy;
             int32_t             mLastTransactionBinderFlags;
 };
diff --git a/include/drm/DrmManagerClient.h b/include/drm/DrmManagerClient.h
index b8fe46d..c47bbfb 100644
--- a/include/drm/DrmManagerClient.h
+++ b/include/drm/DrmManagerClient.h
@@ -66,19 +66,21 @@
      * @param[in] fd File descriptor of the protected content to be decrypted
      * @param[in] offset Start position of the content
      * @param[in] length The length of the protected content
+     * @param[in] mime Mime type of the protected content if it is not NULL or empty
      * @return
      *     Handle for the decryption session
      */
-    sp<DecryptHandle> openDecryptSession(int fd, off64_t offset, off64_t length);
+    sp<DecryptHandle> openDecryptSession(int fd, off64_t offset, off64_t length, const char* mime);
 
     /**
      * Open the decrypt session to decrypt the given protected content
      *
      * @param[in] uri Path of the protected content to be decrypted
+     * @param[in] mime Mime type of the protected content if it is not NULL or empty
      * @return
      *     Handle for the decryption session
      */
-    sp<DecryptHandle> openDecryptSession(const char* uri);
+    sp<DecryptHandle> openDecryptSession(const char* uri, const char* mime);
 
     /**
      * Close the decrypt session for the given handle
diff --git a/include/gui/DisplayEventReceiver.h b/include/gui/DisplayEventReceiver.h
index dccc164..7bca8d6 100644
--- a/include/gui/DisplayEventReceiver.h
+++ b/include/gui/DisplayEventReceiver.h
@@ -63,7 +63,9 @@
 public:
     /*
      * DisplayEventReceiver creates and registers an event connection with
-     * SurfaceFlinger. Events start being delivered immediately.
+     * SurfaceFlinger. VSync events are disabled by default. Call setVSyncRate
+     * or requestNextVsync to receive them.
+     * Other events start being delivered immediately.
      */
     DisplayEventReceiver();
 
@@ -93,6 +95,8 @@
      * should be destroyed and getEvents() shouldn't be called again.
      */
     ssize_t getEvents(Event* events, size_t count);
+    static ssize_t getEvents(const sp<BitTube>& dataChannel,
+            Event* events, size_t count);
 
     /*
      * setVsyncRate() sets the Event::VSync delivery rate. A value of
diff --git a/include/media/AudioEffect.h b/include/media/AudioEffect.h
index 1417416..4c57ed2 100644
--- a/include/media/AudioEffect.h
+++ b/include/media/AudioEffect.h
@@ -108,7 +108,8 @@
      * Returned value
      *   *descriptor updated with effect descriptor
      */
-    static status_t getEffectDescriptor(effect_uuid_t *uuid, effect_descriptor_t *descriptor);
+    static status_t getEffectDescriptor(effect_uuid_t *uuid,
+                                        effect_descriptor_t *descriptor) /*const*/;
 
 
     /*
@@ -226,8 +227,8 @@
     AudioEffect(const effect_uuid_t *type,
                 const effect_uuid_t *uuid = NULL,
                   int32_t priority = 0,
-                  effect_callback_t cbf = 0,
-                  void* user = 0,
+                  effect_callback_t cbf = NULL,
+                  void* user = NULL,
                   int sessionId = 0,
                   audio_io_handle_t io = 0
                   );
@@ -238,8 +239,8 @@
     AudioEffect(const char *typeStr,
                     const char *uuidStr = NULL,
                     int32_t priority = 0,
-                    effect_callback_t cbf = 0,
-                    void* user = 0,
+                    effect_callback_t cbf = NULL,
+                    void* user = NULL,
                     int sessionId = 0,
                     audio_io_handle_t io = 0
                     );
@@ -260,8 +261,8 @@
             status_t    set(const effect_uuid_t *type,
                             const effect_uuid_t *uuid = NULL,
                             int32_t priority = 0,
-                            effect_callback_t cbf = 0,
-                            void* user = 0,
+                            effect_callback_t cbf = NULL,
+                            void* user = NULL,
                             int sessionId = 0,
                             audio_io_handle_t io = 0
                             );
diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h
index 2fb69b6..ca57f9e 100644
--- a/include/media/AudioRecord.h
+++ b/include/media/AudioRecord.h
@@ -22,7 +22,6 @@
 
 #include <media/IAudioFlinger.h>
 #include <media/IAudioRecord.h>
-#include <media/AudioTrack.h>
 
 #include <utils/RefBase.h>
 #include <utils/Errors.h>
@@ -34,6 +33,8 @@
 
 namespace android {
 
+class audio_track_cblk_t;
+
 // ----------------------------------------------------------------------------
 
 class AudioRecord
@@ -67,7 +68,7 @@
         };
         uint32_t    flags;
         int         channelCount;
-        int         format;
+        audio_format_t format;
         size_t      frameCount;
         size_t      size;
         union {
@@ -111,7 +112,7 @@
 
      static status_t getMinFrameCount(int* frameCount,
                                       uint32_t sampleRate,
-                                      int format,
+                                      audio_format_t format,
                                       int channelCount);
 
     /* Constructs an uninitialized AudioRecord. No connection with
@@ -148,14 +149,14 @@
          RECORD_IIR_ENABLE = AUDIO_IN_ACOUSTICS_TX_IIR_ENABLE,
      };
 
-                        AudioRecord(int inputSource,
+                        AudioRecord(audio_source_t inputSource,
                                     uint32_t sampleRate = 0,
-                                    int format          = 0,
+                                    audio_format_t format = AUDIO_FORMAT_DEFAULT,
                                     uint32_t channelMask = AUDIO_CHANNEL_IN_MONO,
                                     int frameCount      = 0,
                                     uint32_t flags      = 0,
-                                    callback_t cbf = 0,
-                                    void* user = 0,
+                                    callback_t cbf = NULL,
+                                    void* user = NULL,
                                     int notificationFrames = 0,
                                     int sessionId = 0);
 
@@ -174,14 +175,14 @@
      *  - NO_INIT: audio server or audio hardware not initialized
      *  - PERMISSION_DENIED: recording is not allowed for the requesting process
      * */
-            status_t    set(int inputSource     = 0,
+            status_t    set(audio_source_t inputSource = AUDIO_SOURCE_DEFAULT,
                             uint32_t sampleRate = 0,
-                            int format          = 0,
+                            audio_format_t format = AUDIO_FORMAT_DEFAULT,
                             uint32_t channelMask = AUDIO_CHANNEL_IN_MONO,
                             int frameCount      = 0,
                             uint32_t flags      = 0,
-                            callback_t cbf = 0,
-                            void* user = 0,
+                            callback_t cbf = NULL,
+                            void* user = NULL,
                             int notificationFrames = 0,
                             bool threadCanCallJava = false,
                             int sessionId = 0);
@@ -202,12 +203,12 @@
 
    /* getters, see constructor */
 
-            int         format() const;
+            audio_format_t format() const;
             int         channelCount() const;
             int         channels() const;
             uint32_t    frameCount() const;
-            int         frameSize() const;
-            int         inputSource() const;
+            size_t      frameSize() const;
+            audio_source_t inputSource() const;
 
 
     /* After it's created the track is not active. Call start() to
@@ -343,12 +344,11 @@
         virtual status_t    readyToRun() { return NO_ERROR; }
         virtual void        onFirstRef() {}
         AudioRecord& mReceiver;
-        Mutex       mLock;
     };
 
             bool processAudioBuffer(const sp<ClientRecordThread>& thread);
             status_t openRecord_l(uint32_t sampleRate,
-                                uint32_t format,
+                                audio_format_t format,
                                 uint32_t channelMask,
                                 int frameCount,
                                 uint32_t flags,
@@ -364,10 +364,9 @@
     uint32_t                mFrameCount;
 
     audio_track_cblk_t*     mCblk;
-    uint32_t                mFormat;
+    audio_format_t          mFormat;
     uint8_t                 mChannelCount;
-    uint8_t                 mInputSource;
-    uint8_t                 mReserved[2];
+    audio_source_t          mInputSource;
     status_t                mStatus;
     uint32_t                mLatency;
 
diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h
index 6a15f6e..74a1e62 100644
--- a/include/media/AudioSystem.h
+++ b/include/media/AudioSystem.h
@@ -55,19 +55,19 @@
     static status_t getMasterMute(bool* mute);
 
     // set/get stream volume on specified output
-    static status_t setStreamVolume(int stream, float value, int output);
-    static status_t getStreamVolume(int stream, float* volume, int output);
+    static status_t setStreamVolume(audio_stream_type_t stream, float value, int output);
+    static status_t getStreamVolume(audio_stream_type_t stream, float* volume, int output);
 
     // mute/unmute stream
-    static status_t setStreamMute(int stream, bool mute);
-    static status_t getStreamMute(int stream, bool* mute);
+    static status_t setStreamMute(audio_stream_type_t stream, bool mute);
+    static status_t getStreamMute(audio_stream_type_t stream, bool* mute);
 
-    // set audio mode in audio hardware (see audio_mode_t)
-    static status_t setMode(int mode);
+    // set audio mode in audio hardware
+    static status_t setMode(audio_mode_t mode);
 
     // returns true in *state if tracks are active on the specified stream or has been active
     // in the past inPastMs milliseconds
-    static status_t isStreamActive(int stream, bool *state, uint32_t inPastMs = 0);
+    static status_t isStreamActive(audio_stream_type_t stream, bool *state, uint32_t inPastMs = 0);
 
     // set/get audio hardware parameters. The function accepts a list of parameters
     // key value pairs in the form: key1=value1;key2=value2;...
@@ -83,13 +83,19 @@
     static float linearToLog(int volume);
     static int logToLinear(float volume);
 
+    static status_t getOutputSamplingRate(int* samplingRate, audio_stream_type_t stream = AUDIO_STREAM_DEFAULT);
+    static status_t getOutputFrameCount(int* frameCount, audio_stream_type_t stream = AUDIO_STREAM_DEFAULT);
+    static status_t getOutputLatency(uint32_t* latency, audio_stream_type_t stream = AUDIO_STREAM_DEFAULT);
+
+    // DEPRECATED
     static status_t getOutputSamplingRate(int* samplingRate, int stream = AUDIO_STREAM_DEFAULT);
+
+    // DEPRECATED
     static status_t getOutputFrameCount(int* frameCount, int stream = AUDIO_STREAM_DEFAULT);
-    static status_t getOutputLatency(uint32_t* latency, int stream = AUDIO_STREAM_DEFAULT);
 
-    static bool routedToA2dpOutput(int streamType);
+    static bool routedToA2dpOutput(audio_stream_type_t streamType);
 
-    static status_t getInputBufferSize(uint32_t sampleRate, int format, int channelCount,
+    static status_t getInputBufferSize(uint32_t sampleRate, audio_format_t format, int channelCount,
         size_t* buffSize);
 
     static status_t setVoiceVolume(float volume);
@@ -103,7 +109,7 @@
     // - BAD_VALUE: invalid parameter
     // NOTE: this feature is not supported on all hardware platforms and it is
     // necessary to check returned status before using the returned values.
-    static status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, int stream = AUDIO_STREAM_DEFAULT);
+    static status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, audio_stream_type_t stream = AUDIO_STREAM_DEFAULT);
 
     static unsigned int  getInputFramesLost(audio_io_handle_t ioHandle);
 
@@ -128,7 +134,7 @@
     class OutputDescriptor {
     public:
         OutputDescriptor()
-        : samplingRate(0), format(0), channels(0), frameCount(0), latency(0)  {}
+        : samplingRate(0), format(AUDIO_FORMAT_DEFAULT), channels(0), frameCount(0), latency(0)  {}
 
         uint32_t samplingRate;
         int32_t format;
@@ -142,13 +148,12 @@
     //
     static status_t setDeviceConnectionState(audio_devices_t device, audio_policy_dev_state_t state, const char *device_address);
     static audio_policy_dev_state_t getDeviceConnectionState(audio_devices_t device, const char *device_address);
-    static status_t setPhoneState(int state);
-    static status_t setRingerMode(uint32_t mode, uint32_t mask);
+    static status_t setPhoneState(audio_mode_t state);
     static status_t setForceUse(audio_policy_force_use_t usage, audio_policy_forced_cfg_t config);
     static audio_policy_forced_cfg_t getForceUse(audio_policy_force_use_t usage);
     static audio_io_handle_t getOutput(audio_stream_type_t stream,
                                         uint32_t samplingRate = 0,
-                                        uint32_t format = AUDIO_FORMAT_DEFAULT,
+                                        audio_format_t format = AUDIO_FORMAT_DEFAULT,
                                         uint32_t channels = AUDIO_CHANNEL_OUT_STEREO,
                                         audio_policy_output_flags_t flags = AUDIO_POLICY_OUTPUT_FLAG_INDIRECT);
     static status_t startOutput(audio_io_handle_t output,
@@ -158,9 +163,9 @@
                                audio_stream_type_t stream,
                                int session = 0);
     static void releaseOutput(audio_io_handle_t output);
-    static audio_io_handle_t getInput(int inputSource,
+    static audio_io_handle_t getInput(audio_source_t inputSource,
                                     uint32_t samplingRate = 0,
-                                    uint32_t format = AUDIO_FORMAT_DEFAULT,
+                                    audio_format_t format = AUDIO_FORMAT_DEFAULT,
                                     uint32_t channels = AUDIO_CHANNEL_IN_MONO,
                                     audio_in_acoustics_t acoustics = (audio_in_acoustics_t)0,
                                     int sessionId = 0);
@@ -170,8 +175,12 @@
     static status_t initStreamVolume(audio_stream_type_t stream,
                                       int indexMin,
                                       int indexMax);
-    static status_t setStreamVolumeIndex(audio_stream_type_t stream, int index);
-    static status_t getStreamVolumeIndex(audio_stream_type_t stream, int *index);
+    static status_t setStreamVolumeIndex(audio_stream_type_t stream,
+                                         int index,
+                                         audio_devices_t device);
+    static status_t getStreamVolumeIndex(audio_stream_type_t stream,
+                                         int *index,
+                                         audio_devices_t device);
 
     static uint32_t getStrategyForStream(audio_stream_type_t stream);
     static uint32_t getDevicesForStream(audio_stream_type_t stream);
@@ -233,13 +242,13 @@
     static size_t gInBuffSize;
     // previous parameters for recording buffer size queries
     static uint32_t gPrevInSamplingRate;
-    static int gPrevInFormat;
+    static audio_format_t gPrevInFormat;
     static int gPrevInChannelCount;
 
     static sp<IAudioPolicyService> gAudioPolicyService;
 
     // mapping between stream types and outputs
-    static DefaultKeyedVector<int, audio_io_handle_t> gStreamOutputMap;
+    static DefaultKeyedVector<audio_stream_type_t, audio_io_handle_t> gStreamOutputMap;
     // list of output descriptors containing cached parameters
     // (sampling rate, framecount, channel count...)
     static DefaultKeyedVector<audio_io_handle_t, OutputDescriptor *> gOutputs;
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h
index 98b2c70..11db81b 100644
--- a/include/media/AudioTrack.h
+++ b/include/media/AudioTrack.h
@@ -69,7 +69,8 @@
             MUTE    = 0x00000001
         };
         uint32_t    flags;
-        int         format;
+        audio_format_t format; // but AUDIO_FORMAT_PCM_8_BIT -> AUDIO_FORMAT_PCM_16_BIT
+        // accessed directly by WebKit ANP callback
         int         channelCount; // will be removed in the future, do not use
         size_t      frameCount;
         size_t      size;
@@ -109,7 +110,7 @@
      */
 
      static status_t getMinFrameCount(int* frameCount,
-                                      int streamType      =-1,
+                                      audio_stream_type_t streamType = AUDIO_STREAM_DEFAULT,
                                       uint32_t sampleRate = 0);
 
     /* Constructs an uninitialized AudioTrack. No connection with
@@ -141,9 +142,21 @@
      * sessionId:          Specific session ID, or zero to use default.
      */
 
-                        AudioTrack( int streamType,
+                        AudioTrack( audio_stream_type_t streamType,
                                     uint32_t sampleRate  = 0,
-                                    int format           = 0,
+                                    audio_format_t format = AUDIO_FORMAT_DEFAULT,
+                                    int channelMask      = 0,
+                                    int frameCount       = 0,
+                                    uint32_t flags       = 0,
+                                    callback_t cbf       = NULL,
+                                    void* user           = NULL,
+                                    int notificationFrames = 0,
+                                    int sessionId = 0);
+
+                        // DEPRECATED
+                        explicit AudioTrack( int streamType,
+                                    uint32_t sampleRate  = 0,
+                                    int format = AUDIO_FORMAT_DEFAULT,
                                     int channelMask      = 0,
                                     int frameCount       = 0,
                                     uint32_t flags       = 0,
@@ -161,14 +174,14 @@
      * EVENT_UNDERRUN event.
      */
 
-                        AudioTrack( int streamType,
+                        AudioTrack( audio_stream_type_t streamType,
                                     uint32_t sampleRate = 0,
-                                    int format          = 0,
+                                    audio_format_t format = AUDIO_FORMAT_DEFAULT,
                                     int channelMask     = 0,
                                     const sp<IMemory>& sharedBuffer = 0,
                                     uint32_t flags      = 0,
-                                    callback_t cbf      = 0,
-                                    void* user          = 0,
+                                    callback_t cbf      = NULL,
+                                    void* user          = NULL,
                                     int notificationFrames = 0,
                                     int sessionId = 0);
 
@@ -185,14 +198,14 @@
      *  - BAD_VALUE: invalid parameter (channels, format, sampleRate...)
      *  - NO_INIT: audio server or audio hardware not initialized
      * */
-            status_t    set(int streamType      =-1,
+            status_t    set(audio_stream_type_t streamType = AUDIO_STREAM_DEFAULT,
                             uint32_t sampleRate = 0,
-                            int format          = 0,
+                            audio_format_t format = AUDIO_FORMAT_DEFAULT,
                             int channelMask     = 0,
                             int frameCount      = 0,
                             uint32_t flags      = 0,
-                            callback_t cbf      = 0,
-                            void* user          = 0,
+                            callback_t cbf      = NULL,
+                            void* user          = NULL,
                             int notificationFrames = 0,
                             const sp<IMemory>& sharedBuffer = 0,
                             bool threadCanCallJava = false,
@@ -214,11 +227,16 @@
 
     /* getters, see constructor */
 
-            int         streamType() const;
-            int         format() const;
+            audio_stream_type_t streamType() const;
+            audio_format_t format() const;
             int         channelCount() const;
             uint32_t    frameCount() const;
-            int         frameSize() const;
+
+    /* Return channelCount * (bit depth per channel / 8).
+     * channelCount is determined from channelMask, and bit depth comes from format.
+     */
+            size_t      frameSize() const;
+
             sp<IMemory>& sharedBuffer();
 
 
@@ -255,18 +273,18 @@
      * left and right volumes. Levels must be >= 0.0 and <= 1.0.
      */
             status_t    setVolume(float left, float right);
-            void        getVolume(float* left, float* right);
+            void        getVolume(float* left, float* right) const;
 
     /* Set the send level for this track. An auxiliary effect should be attached
      * to the track with attachEffect(). Level must be >= 0.0 and <= 1.0.
      */
             status_t    setAuxEffectSendLevel(float level);
-            void        getAuxEffectSendLevel(float* level);
+            void        getAuxEffectSendLevel(float* level) const;
 
     /* Set sample rate for this track, mostly used for games' sound effects
      */
             status_t    setSampleRate(int sampleRate);
-            uint32_t    getSampleRate();
+            uint32_t    getSampleRate() const;
 
     /* Enables looping and sets the start and end points of looping.
      *
@@ -281,7 +299,7 @@
      *          (loopEnd-loopStart) <= framecount()
      */
             status_t    setLoop(uint32_t loopStart, uint32_t loopEnd, int loopCount);
-            status_t    getLoop(uint32_t *loopStart, uint32_t *loopEnd, int *loopCount);
+            status_t    getLoop(uint32_t *loopStart, uint32_t *loopEnd, int *loopCount) const;
 
     /* Sets marker position. When playback reaches the number of frames specified, a callback with
      * event type EVENT_MARKER is called. Calling setMarkerPosition with marker == 0 cancels marker
@@ -297,7 +315,7 @@
      *  - INVALID_OPERATION: the AudioTrack has no callback installed.
      */
             status_t    setMarkerPosition(uint32_t marker);
-            status_t    getMarkerPosition(uint32_t *marker);
+            status_t    getMarkerPosition(uint32_t *marker) const;
 
 
     /* Sets position update period. Every time the number of frames specified has been played,
@@ -315,7 +333,7 @@
      *  - INVALID_OPERATION: the AudioTrack has no callback installed.
      */
             status_t    setPositionUpdatePeriod(uint32_t updatePeriod);
-            status_t    getPositionUpdatePeriod(uint32_t *updatePeriod);
+            status_t    getPositionUpdatePeriod(uint32_t *updatePeriod) const;
 
     /* Sets playback head position within AudioTrack buffer. The new position is specified
      * in number of frames.
@@ -366,7 +384,7 @@
      * Returned value:
      *  AudioTrack session ID.
      */
-            int    getSessionId();
+            int    getSessionId() const;
 
     /* Attach track auxiliary output to specified effect. Use effectId = 0
      * to detach track from effect.
@@ -393,7 +411,7 @@
      */
 
         enum {
-            NO_MORE_BUFFERS = 0x80000001,
+            NO_MORE_BUFFERS = 0x80000001,   // same name in AudioFlinger.h, ok to be different value
             STOPPED = 1
         };
 
@@ -428,13 +446,12 @@
         virtual status_t    readyToRun();
         virtual void        onFirstRef();
         AudioTrack& mReceiver;
-        Mutex       mLock;
     };
 
             bool processAudioBuffer(const sp<AudioTrackThread>& thread);
-            status_t createTrack_l(int streamType,
+            status_t createTrack_l(audio_stream_type_t streamType,
                                  uint32_t sampleRate,
-                                 uint32_t format,
+                                 audio_format_t format,
                                  uint32_t channelMask,
                                  int frameCount,
                                  uint32_t flags,
@@ -456,8 +473,8 @@
     uint32_t                mFrameCount;
 
     audio_track_cblk_t*     mCblk;
-    uint32_t                mFormat;
-    uint8_t                 mStreamType;
+    audio_format_t          mFormat;
+    audio_stream_type_t     mStreamType;
     uint8_t                 mChannelCount;
     uint8_t                 mMuted;
     uint8_t                 mReserved;
diff --git a/include/media/IAudioFlinger.h b/include/media/IAudioFlinger.h
index 9e3cb7f..ba94bad 100644
--- a/include/media/IAudioFlinger.h
+++ b/include/media/IAudioFlinger.h
@@ -46,9 +46,9 @@
      */
     virtual sp<IAudioTrack> createTrack(
                                 pid_t pid,
-                                int streamType,
+                                audio_stream_type_t streamType,
                                 uint32_t sampleRate,
-                                uint32_t format,
+                                audio_format_t format,
                                 uint32_t channelMask,
                                 int frameCount,
                                 uint32_t flags,
@@ -61,7 +61,7 @@
                                 pid_t pid,
                                 int input,
                                 uint32_t sampleRate,
-                                uint32_t format,
+                                audio_format_t format,
                                 uint32_t channelMask,
                                 int frameCount,
                                 uint32_t flags,
@@ -73,7 +73,7 @@
      */
     virtual     uint32_t    sampleRate(int output) const = 0;
     virtual     int         channelCount(int output) const = 0;
-    virtual     uint32_t    format(int output) const = 0;
+    virtual     audio_format_t format(int output) const = 0;
     virtual     size_t      frameCount(int output) const = 0;
     virtual     uint32_t    latency(int output) const = 0;
 
@@ -89,31 +89,31 @@
     /* set/get stream type state. This will probably be used by
      * the preference panel, mostly.
      */
-    virtual     status_t    setStreamVolume(int stream, float value, int output) = 0;
-    virtual     status_t    setStreamMute(int stream, bool muted) = 0;
+    virtual     status_t    setStreamVolume(audio_stream_type_t stream, float value, int output) = 0;
+    virtual     status_t    setStreamMute(audio_stream_type_t stream, bool muted) = 0;
 
-    virtual     float       streamVolume(int stream, int output) const = 0;
-    virtual     bool        streamMute(int stream) const = 0;
+    virtual     float       streamVolume(audio_stream_type_t stream, int output) const = 0;
+    virtual     bool        streamMute(audio_stream_type_t stream) const = 0;
 
     // set audio mode
-    virtual     status_t    setMode(int mode) = 0;
+    virtual     status_t    setMode(audio_mode_t mode) = 0;
 
     // mic mute/state
     virtual     status_t    setMicMute(bool state) = 0;
     virtual     bool        getMicMute() const = 0;
 
     virtual     status_t    setParameters(int ioHandle, const String8& keyValuePairs) = 0;
-    virtual     String8     getParameters(int ioHandle, const String8& keys) = 0;
+    virtual     String8     getParameters(int ioHandle, const String8& keys) const = 0;
 
     // register a current process for audio output change notifications
     virtual void registerClient(const sp<IAudioFlingerClient>& client) = 0;
 
     // retrieve the audio recording buffer size
-    virtual size_t getInputBufferSize(uint32_t sampleRate, int format, int channelCount) = 0;
+    virtual size_t getInputBufferSize(uint32_t sampleRate, audio_format_t format, int channelCount) const = 0;
 
     virtual int openOutput(uint32_t *pDevices,
                                     uint32_t *pSamplingRate,
-                                    uint32_t *pFormat,
+                                    audio_format_t *pFormat,
                                     uint32_t *pChannels,
                                     uint32_t *pLatencyMs,
                                     uint32_t flags) = 0;
@@ -124,29 +124,30 @@
 
     virtual int openInput(uint32_t *pDevices,
                                     uint32_t *pSamplingRate,
-                                    uint32_t *pFormat,
+                                    audio_format_t *pFormat,
                                     uint32_t *pChannels,
-                                    uint32_t acoustics) = 0;
+                                    audio_in_acoustics_t acoustics) = 0;
     virtual status_t closeInput(int input) = 0;
 
-    virtual status_t setStreamOutput(uint32_t stream, int output) = 0;
+    virtual status_t setStreamOutput(audio_stream_type_t stream, int output) = 0;
 
     virtual status_t setVoiceVolume(float volume) = 0;
 
-    virtual status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, int output) = 0;
+    virtual status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, int output) const = 0;
 
-    virtual unsigned int  getInputFramesLost(int ioHandle) = 0;
+    virtual unsigned int getInputFramesLost(int ioHandle) const = 0;
 
     virtual int newAudioSessionId() = 0;
 
     virtual void acquireAudioSessionId(int audioSession) = 0;
     virtual void releaseAudioSessionId(int audioSession) = 0;
 
-    virtual status_t queryNumberEffects(uint32_t *numEffects) = 0;
+    virtual status_t queryNumberEffects(uint32_t *numEffects) const = 0;
 
-    virtual status_t queryEffect(uint32_t index, effect_descriptor_t *pDescriptor) = 0;
+    virtual status_t queryEffect(uint32_t index, effect_descriptor_t *pDescriptor) const = 0;
 
-    virtual status_t getEffectDescriptor(effect_uuid_t *pEffectUUID, effect_descriptor_t *pDescriptor) = 0;
+    virtual status_t getEffectDescriptor(effect_uuid_t *pEffectUUID,
+                                        effect_descriptor_t *pDescriptor) const = 0;
 
     virtual sp<IEffect> createEffect(pid_t pid,
                                     effect_descriptor_t *pDesc,
diff --git a/include/media/IAudioPolicyService.h b/include/media/IAudioPolicyService.h
index 9807cbe..4d88297 100644
--- a/include/media/IAudioPolicyService.h
+++ b/include/media/IAudioPolicyService.h
@@ -45,13 +45,12 @@
                                               const char *device_address) = 0;
     virtual audio_policy_dev_state_t getDeviceConnectionState(audio_devices_t device,
                                                                           const char *device_address) = 0;
-    virtual status_t setPhoneState(int state) = 0;
-    virtual status_t setRingerMode(uint32_t mode, uint32_t mask) = 0;
+    virtual status_t setPhoneState(audio_mode_t state) = 0;
     virtual status_t setForceUse(audio_policy_force_use_t usage, audio_policy_forced_cfg_t config) = 0;
     virtual audio_policy_forced_cfg_t getForceUse(audio_policy_force_use_t usage) = 0;
     virtual audio_io_handle_t getOutput(audio_stream_type_t stream,
                                         uint32_t samplingRate = 0,
-                                        uint32_t format = AUDIO_FORMAT_DEFAULT,
+                                        audio_format_t format = AUDIO_FORMAT_DEFAULT,
                                         uint32_t channels = 0,
                                         audio_policy_output_flags_t flags = AUDIO_POLICY_OUTPUT_FLAG_INDIRECT) = 0;
     virtual status_t startOutput(audio_io_handle_t output,
@@ -61,9 +60,9 @@
                                 audio_stream_type_t stream,
                                 int session = 0) = 0;
     virtual void releaseOutput(audio_io_handle_t output) = 0;
-    virtual audio_io_handle_t getInput(int inputSource,
+    virtual audio_io_handle_t getInput(audio_source_t inputSource,
                                     uint32_t samplingRate = 0,
-                                    uint32_t format = AUDIO_FORMAT_DEFAULT,
+                                    audio_format_t format = AUDIO_FORMAT_DEFAULT,
                                     uint32_t channels = 0,
                                     audio_in_acoustics_t acoustics = (audio_in_acoustics_t)0,
                                     int audioSession = 0) = 0;
@@ -73,8 +72,12 @@
     virtual status_t initStreamVolume(audio_stream_type_t stream,
                                       int indexMin,
                                       int indexMax) = 0;
-    virtual status_t setStreamVolumeIndex(audio_stream_type_t stream, int index) = 0;
-    virtual status_t getStreamVolumeIndex(audio_stream_type_t stream, int *index) = 0;
+    virtual status_t setStreamVolumeIndex(audio_stream_type_t stream,
+                                          int index,
+                                          audio_devices_t device) = 0;
+    virtual status_t getStreamVolumeIndex(audio_stream_type_t stream,
+                                          int *index,
+                                          audio_devices_t device) = 0;
     virtual uint32_t getStrategyForStream(audio_stream_type_t stream) = 0;
     virtual uint32_t getDevicesForStream(audio_stream_type_t stream) = 0;
     virtual audio_io_handle_t getOutputForEffect(effect_descriptor_t *desc) = 0;
@@ -85,7 +88,7 @@
                                     int id) = 0;
     virtual status_t unregisterEffect(int id) = 0;
     virtual status_t setEffectEnabled(int id, bool enabled) = 0;
-    virtual bool     isStreamActive(int stream, uint32_t inPastMs = 0) const = 0;
+    virtual bool     isStreamActive(audio_stream_type_t stream, uint32_t inPastMs = 0) const = 0;
     virtual status_t queryDefaultPreProcessing(int audioSession,
                                               effect_descriptor_t *descriptors,
                                               uint32_t *count) = 0;
diff --git a/include/media/IAudioTrack.h b/include/media/IAudioTrack.h
index 3fa2bf8..b83e552 100644
--- a/include/media/IAudioTrack.h
+++ b/include/media/IAudioTrack.h
@@ -35,6 +35,9 @@
 public: 
     DECLARE_META_INTERFACE(AudioTrack);
 
+    /* Get this track's control block */
+    virtual sp<IMemory> getCblk() const = 0;
+
     /* After it's created the track is not active. Call start() to
      * make it active. If set, the callback will start being called.
      */
@@ -67,8 +70,6 @@
      */
     virtual status_t    attachAuxEffect(int effectId) = 0;
 
-    /* get this track's control block */
-    virtual sp<IMemory> getCblk() const = 0;    
 };
 
 // ----------------------------------------------------------------------------
diff --git a/include/media/IMediaPlayer.h b/include/media/IMediaPlayer.h
index e905903..6425886 100644
--- a/include/media/IMediaPlayer.h
+++ b/include/media/IMediaPlayer.h
@@ -21,6 +21,7 @@
 #include <binder/IInterface.h>
 #include <binder/Parcel.h>
 #include <utils/KeyedVector.h>
+#include <system/audio.h>
 
 namespace android {
 
@@ -51,7 +52,7 @@
     virtual status_t        getCurrentPosition(int* msec) = 0;
     virtual status_t        getDuration(int* msec) = 0;
     virtual status_t        reset() = 0;
-    virtual status_t        setAudioStreamType(int type) = 0;
+    virtual status_t        setAudioStreamType(audio_stream_type_t type) = 0;
     virtual status_t        setLooping(int loop) = 0;
     virtual status_t        setVolume(float leftVolume, float rightVolume) = 0;
     virtual status_t        setAuxEffectSendLevel(float level) = 0;
diff --git a/include/media/IMediaPlayerService.h b/include/media/IMediaPlayerService.h
index 93bbe13..4f46fcd 100644
--- a/include/media/IMediaPlayerService.h
+++ b/include/media/IMediaPlayerService.h
@@ -23,6 +23,7 @@
 #include <utils/String8.h>
 #include <binder/IInterface.h>
 #include <binder/Parcel.h>
+#include <system/audio.h>
 
 #include <media/IMediaPlayerClient.h>
 #include <media/IMediaPlayer.h>
@@ -43,8 +44,8 @@
     virtual sp<IMediaMetadataRetriever> createMetadataRetriever(pid_t pid) = 0;
     virtual sp<IMediaPlayer> create(pid_t pid, const sp<IMediaPlayerClient>& client, int audioSessionId = 0) = 0;
 
-    virtual sp<IMemory>         decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, int* pFormat) = 0;
-    virtual sp<IMemory>         decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, int* pFormat) = 0;
+    virtual sp<IMemory>         decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, audio_format_t* pFormat) = 0;
+    virtual sp<IMemory>         decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, audio_format_t* pFormat) = 0;
     virtual sp<IOMX>            getOMX() = 0;
 
     // codecs and audio devices usage tracking for the battery app
diff --git a/include/media/IOMX.h b/include/media/IOMX.h
index c4cc947..a295e9a 100644
--- a/include/media/IOMX.h
+++ b/include/media/IOMX.h
@@ -42,10 +42,10 @@
     typedef void *buffer_id;
     typedef void *node_id;
 
-    // Given the calling process' pid, returns true iff
+    // Given a node_id and the calling process' pid, returns true iff
     // the implementation of the OMX interface lives in the same
     // process.
-    virtual bool livesLocally(pid_t pid) = 0;
+    virtual bool livesLocally(node_id node, pid_t pid) = 0;
 
     struct ComponentInfo {
         String8 mName;
diff --git a/include/media/JetPlayer.h b/include/media/JetPlayer.h
index 6d53989..491a950 100644
--- a/include/media/JetPlayer.h
+++ b/include/media/JetPlayer.h
@@ -94,7 +94,7 @@
     S_JET_STATUS        mJetStatus;
     S_JET_STATUS        mPreviousJetStatus;
 
-    char                mJetFilePath[256];
+    char                mJetFilePath[PATH_MAX];
 
     class JetPlayerThread : public Thread {
     public:
diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h
index 80f43a3..7beb176 100644
--- a/include/media/MediaPlayerInterface.h
+++ b/include/media/MediaPlayerInterface.h
@@ -85,7 +85,7 @@
         // audio data.
         virtual status_t    open(
                 uint32_t sampleRate, int channelCount,
-                int format=AUDIO_FORMAT_PCM_16_BIT,
+                audio_format_t format=AUDIO_FORMAT_PCM_16_BIT,
                 int bufferCount=DEFAULT_AUDIOSINK_BUFFERCOUNT,
                 AudioCallback cb = NULL,
                 void *cookie = NULL) = 0;
@@ -199,7 +199,7 @@
     virtual             ~MediaPlayerHWInterface() {}
     virtual bool        hardwareOutput() { return true; }
     virtual status_t    setVolume(float leftVolume, float rightVolume) = 0;
-    virtual status_t    setAudioStreamType(int streamType) = 0;
+    virtual status_t    setAudioStreamType(audio_stream_type_t streamType) = 0;
 };
 
 }; // namespace android
diff --git a/include/media/ToneGenerator.h b/include/media/ToneGenerator.h
index 1ad1f26..df0c97e 100644
--- a/include/media/ToneGenerator.h
+++ b/include/media/ToneGenerator.h
@@ -151,10 +151,10 @@
         NUM_SUP_TONES = LAST_SUP_TONE-FIRST_SUP_TONE+1
     };
 
-    ToneGenerator(int streamType, float volume, bool threadCanCallJava = false);
+    ToneGenerator(audio_stream_type_t streamType, float volume, bool threadCanCallJava = false);
     ~ToneGenerator();
 
-    bool startTone(int toneType, int durationMs = -1);
+    bool startTone(tone_type toneType, int durationMs = -1);
     void stopTone();
 
     bool isInited() { return (mState == TONE_IDLE)?false:true;}
@@ -266,7 +266,7 @@
     Mutex mCbkCondLock; // Mutex associated to mWaitCbkCond
     Condition mWaitCbkCond; // condition enabling interface to wait for audio callback completion after a change is requested
     float mVolume;  // Volume applied to audio track
-    int mStreamType; // Audio stream used for output
+    audio_stream_type_t mStreamType; // Audio stream used for output
     unsigned int mProcessSize;  // Size of audio blocks generated at a time by audioCallback() (in PCM frames).
 
     bool initAudioTrack();
@@ -274,7 +274,7 @@
     bool prepareWave();
     unsigned int numWaves(unsigned int segmentIdx);
     void clearWaveGens();
-    int getToneForRegion(int toneType);
+    tone_type getToneForRegion(tone_type toneType);
 
     // WaveGenerator generates a single sine wave
     class WaveGenerator {
diff --git a/include/media/Visualizer.h b/include/media/Visualizer.h
index 5d2c874..60fa15b 100644
--- a/include/media/Visualizer.h
+++ b/include/media/Visualizer.h
@@ -66,8 +66,8 @@
      * See AudioEffect constructor for details on parameters.
      */
                         Visualizer(int32_t priority = 0,
-                                   effect_callback_t cbf = 0,
-                                   void* user = 0,
+                                   effect_callback_t cbf = NULL,
+                                   void* user = NULL,
                                    int sessionId = 0);
 
                         ~Visualizer();
@@ -143,7 +143,7 @@
     void periodicCapture();
     uint32_t initCaptureSize();
 
-    Mutex mLock;
+    Mutex mCaptureLock;
     uint32_t mCaptureRate;
     uint32_t mCaptureSize;
     uint32_t mSampleRate;
diff --git a/include/media/mediaplayer.h b/include/media/mediaplayer.h
index e6a0cc5..00b7dd5 100644
--- a/include/media/mediaplayer.h
+++ b/include/media/mediaplayer.h
@@ -185,13 +185,13 @@
             status_t        getCurrentPosition(int *msec);
             status_t        getDuration(int *msec);
             status_t        reset();
-            status_t        setAudioStreamType(int type);
+            status_t        setAudioStreamType(audio_stream_type_t type);
             status_t        setLooping(int loop);
             bool            isLooping();
             status_t        setVolume(float leftVolume, float rightVolume);
             void            notify(int msg, int ext1, int ext2, const Parcel *obj = NULL);
-    static  sp<IMemory>     decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, int* pFormat);
-    static  sp<IMemory>     decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, int* pFormat);
+    static  sp<IMemory>     decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, audio_format_t* pFormat);
+    static  sp<IMemory>     decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, audio_format_t* pFormat);
             status_t        invoke(const Parcel& request, Parcel *reply);
             status_t        setMetadataFilter(const Parcel& filter);
             status_t        getMetadata(bool update_only, bool apply_filter, Parcel *metadata);
@@ -223,7 +223,7 @@
     int                         mSeekPosition;
     bool                        mPrepareSync;
     status_t                    mPrepareStatus;
-    int                         mStreamType;
+    audio_stream_type_t         mStreamType;
     bool                        mLoop;
     float                       mLeftVolume;
     float                       mRightVolume;
diff --git a/include/media/stagefright/AACWriter.h b/include/media/stagefright/AACWriter.h
index fa3ab8a..49397ee 100644
--- a/include/media/stagefright/AACWriter.h
+++ b/include/media/stagefright/AACWriter.h
@@ -34,7 +34,7 @@
     virtual status_t addSource(const sp<MediaSource> &source);
     virtual bool reachedEOS();
     virtual status_t start(MetaData *params = NULL);
-    virtual status_t stop();
+    virtual status_t stop() { return reset(); }
     virtual status_t pause();
 
 protected:
@@ -66,6 +66,7 @@
     bool exceedsFileSizeLimit();
     bool exceedsFileDurationLimit();
     status_t writeAdtsHeader(uint32_t frameLength);
+    status_t reset();
 
     DISALLOW_EVIL_CONSTRUCTORS(AACWriter);
 };
diff --git a/include/media/stagefright/AMRWriter.h b/include/media/stagefright/AMRWriter.h
index 62d57b4..392f968 100644
--- a/include/media/stagefright/AMRWriter.h
+++ b/include/media/stagefright/AMRWriter.h
@@ -37,7 +37,7 @@
     virtual status_t addSource(const sp<MediaSource> &source);
     virtual bool reachedEOS();
     virtual status_t start(MetaData *params = NULL);
-    virtual status_t stop();
+    virtual status_t stop() { return reset(); }
     virtual status_t pause();
 
 protected:
@@ -60,6 +60,7 @@
     status_t threadFunc();
     bool exceedsFileSizeLimit();
     bool exceedsFileDurationLimit();
+    status_t reset();
 
     AMRWriter(const AMRWriter &);
     AMRWriter &operator=(const AMRWriter &);
diff --git a/include/media/stagefright/AudioSource.h b/include/media/stagefright/AudioSource.h
index 19bd31b..79437bf 100644
--- a/include/media/stagefright/AudioSource.h
+++ b/include/media/stagefright/AudioSource.h
@@ -34,13 +34,13 @@
     // Note that the "channels" parameter is _not_ the number of channels,
     // but a bitmask of audio_channels_t constants.
     AudioSource(
-            int inputSource, uint32_t sampleRate,
+            audio_source_t inputSource, uint32_t sampleRate,
             uint32_t channels = AUDIO_CHANNEL_IN_MONO);
 
     status_t initCheck() const;
 
     virtual status_t start(MetaData *params = NULL);
-    virtual status_t stop();
+    virtual status_t stop() { return reset(); }
     virtual sp<MetaData> getFormat();
 
     // Returns the maximum amplitude since last call.
@@ -97,6 +97,7 @@
 
     void releaseQueuedFrames_l();
     void waitOutstandingEncodingFrames_l();
+    status_t reset();
 
     AudioSource(const AudioSource &);
     AudioSource &operator=(const AudioSource &);
diff --git a/include/media/stagefright/CameraSource.h b/include/media/stagefright/CameraSource.h
index 446720b..5a35358 100644
--- a/include/media/stagefright/CameraSource.h
+++ b/include/media/stagefright/CameraSource.h
@@ -79,7 +79,7 @@
     virtual ~CameraSource();
 
     virtual status_t start(MetaData *params = NULL);
-    virtual status_t stop();
+    virtual status_t stop() { return reset(); }
     virtual status_t read(
             MediaBuffer **buffer, const ReadOptions *options = NULL);
 
@@ -163,7 +163,6 @@
                  bool storeMetaDataInVideoBuffers);
 
     virtual void startCameraRecording();
-    virtual void stopCameraRecording();
     virtual void releaseRecordingFrame(const sp<IMemory>& frame);
 
     // Returns true if need to skip the current frame.
@@ -220,7 +219,9 @@
     status_t checkFrameRate(const CameraParameters& params,
                     int32_t frameRate);
 
+    void stopCameraRecording();
     void releaseCamera();
+    status_t reset();
 
     CameraSource(const CameraSource &);
     CameraSource &operator=(const CameraSource &);
diff --git a/include/media/stagefright/CameraSourceTimeLapse.h b/include/media/stagefright/CameraSourceTimeLapse.h
index b060691..0936da2 100644
--- a/include/media/stagefright/CameraSourceTimeLapse.h
+++ b/include/media/stagefright/CameraSourceTimeLapse.h
@@ -121,9 +121,6 @@
     // Wrapper over CameraSource::read() to implement quick stop.
     virtual status_t read(MediaBuffer **buffer, const ReadOptions *options = NULL);
 
-    // For video camera case, just stops the camera's video recording.
-    virtual void stopCameraRecording();
-
     // mSkipCurrentFrame is set to true in dataCallbackTimestamp() if the current
     // frame needs to be skipped and this function just returns the value of mSkipCurrentFrame.
     virtual bool skipCurrentFrame(int64_t timestampUs);
diff --git a/include/media/stagefright/DataSource.h b/include/media/stagefright/DataSource.h
index 713af92..00d583e 100644
--- a/include/media/stagefright/DataSource.h
+++ b/include/media/stagefright/DataSource.h
@@ -81,7 +81,7 @@
     static void RegisterDefaultSniffers();
 
     // for DRM
-    virtual sp<DecryptHandle> DrmInitialization() {
+    virtual sp<DecryptHandle> DrmInitialization(const char *mime = NULL) {
         return NULL;
     }
     virtual void getDrmInfo(sp<DecryptHandle> &handle, DrmManagerClient **client) {};
diff --git a/include/media/stagefright/FileSource.h b/include/media/stagefright/FileSource.h
index 6cf86dc..d994cb3 100644
--- a/include/media/stagefright/FileSource.h
+++ b/include/media/stagefright/FileSource.h
@@ -38,7 +38,7 @@
 
     virtual status_t getSize(off64_t *size);
 
-    virtual sp<DecryptHandle> DrmInitialization();
+    virtual sp<DecryptHandle> DrmInitialization(const char *mime);
 
     virtual void getDrmInfo(sp<DecryptHandle> &handle, DrmManagerClient **client);
 
diff --git a/include/media/stagefright/MPEG2TSWriter.h b/include/media/stagefright/MPEG2TSWriter.h
index e4c1c49..a7c9ecf 100644
--- a/include/media/stagefright/MPEG2TSWriter.h
+++ b/include/media/stagefright/MPEG2TSWriter.h
@@ -37,7 +37,7 @@
 
     virtual status_t addSource(const sp<MediaSource> &source);
     virtual status_t start(MetaData *param = NULL);
-    virtual status_t stop();
+    virtual status_t stop() { return reset(); }
     virtual status_t pause();
     virtual bool reachedEOS();
     virtual status_t dump(int fd, const Vector<String16>& args);
@@ -78,6 +78,7 @@
     void writeAccessUnit(int32_t sourceIndex, const sp<ABuffer> &buffer);
 
     ssize_t internalWrite(const void *data, size_t size);
+    status_t reset();
 
     DISALLOW_EVIL_CONSTRUCTORS(MPEG2TSWriter);
 };
diff --git a/include/media/stagefright/MPEG4Writer.h b/include/media/stagefright/MPEG4Writer.h
index 77166ed..0409b30 100644
--- a/include/media/stagefright/MPEG4Writer.h
+++ b/include/media/stagefright/MPEG4Writer.h
@@ -37,7 +37,7 @@
 
     virtual status_t addSource(const sp<MediaSource> &source);
     virtual status_t start(MetaData *param = NULL);
-    virtual status_t stop();
+    virtual status_t stop() { return reset(); }
     virtual status_t pause();
     virtual bool reachedEOS();
     virtual status_t dump(int fd, const Vector<String16>& args);
@@ -184,6 +184,7 @@
     void writeLongitude(int degreex10000);
     void sendSessionSummary();
     void release();
+    status_t reset();
 
     MPEG4Writer(const MPEG4Writer &);
     MPEG4Writer &operator=(const MPEG4Writer &);
diff --git a/include/media/stagefright/MediaExtractor.h b/include/media/stagefright/MediaExtractor.h
index eb45237..94090ee 100644
--- a/include/media/stagefright/MediaExtractor.h
+++ b/include/media/stagefright/MediaExtractor.h
@@ -56,10 +56,10 @@
     virtual uint32_t flags() const;
 
     // for DRM
-    virtual void setDrmFlag(bool flag) {
+    void setDrmFlag(bool flag) {
         mIsDrm = flag;
     };
-    virtual bool getDrmFlag() {
+    bool getDrmFlag() {
         return mIsDrm;
     }
     virtual char* getDrmTrackInfo(size_t trackID, int *len) {
diff --git a/include/media/stagefright/OMXCodec.h b/include/media/stagefright/OMXCodec.h
index 84f8282..4c30e04 100644
--- a/include/media/stagefright/OMXCodec.h
+++ b/include/media/stagefright/OMXCodec.h
@@ -172,6 +172,7 @@
     uint32_t mFlags;
 
     bool mIsEncoder;
+    bool mIsVideo;
     char *mMIME;
     char *mComponentName;
     sp<MetaData> mOutputFormat;
diff --git a/include/media/stagefright/SurfaceMediaSource.h b/include/media/stagefright/SurfaceMediaSource.h
index d0940bb..54baab6 100644
--- a/include/media/stagefright/SurfaceMediaSource.h
+++ b/include/media/stagefright/SurfaceMediaSource.h
@@ -58,7 +58,7 @@
 
     // For the MediaSource interface for use by StageFrightRecorder:
     virtual status_t start(MetaData *params = NULL);
-    virtual status_t stop();
+    virtual status_t stop() { return reset(); }
     virtual status_t read(
             MediaBuffer **buffer, const ReadOptions *options = NULL);
     virtual sp<MetaData> getFormat();
@@ -359,6 +359,8 @@
     Condition mFrameAvailableCondition;
     Condition mFrameCompleteCondition;
 
+    status_t reset();
+
     // Avoid copying and equating and default constructor
     DISALLOW_IMPLICIT_CONSTRUCTORS(SurfaceMediaSource);
 };
diff --git a/include/media/thread_init.h b/include/media/thread_init.h
deleted file mode 100644
index 2feac86..0000000
--- a/include/media/thread_init.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-#ifndef THREAD_INIT_H
-#define THREAD_INIT_H
-
-bool InitializeForThread();
-void UninitializeForThread();
-
-#endif /* THREAD_INIT_H*/
-	
diff --git a/include/private/media/AudioTrackShared.h b/include/private/media/AudioTrackShared.h
index 046d5e9..23226c0 100644
--- a/include/private/media/AudioTrackShared.h
+++ b/include/private/media/AudioTrackShared.h
@@ -54,6 +54,7 @@
 #define CBLK_RESTORED_ON        0x0040  // track has been restored after invalidation
 #define CBLK_RESTORED_OFF       0x0040  // by AudioFlinger
 
+// Important: do not add any virtual methods, including ~
 struct audio_track_cblk_t
 {
 
@@ -71,21 +72,28 @@
                 uint32_t    loopStart;
                 uint32_t    loopEnd;
                 int         loopCount;
-    volatile    union {
-                    uint16_t    volume[2];
-                    uint32_t    volumeLR;
-                };
+
+                // Channel volumes are fixed point U4.12, so 0x1000 means 1.0.
+                // Left channel is in [0:15], right channel is in [16:31].
+                // Always read and write the combined pair atomically.
+                // For AudioTrack only, not used by AudioRecord.
+private:
+                uint32_t    mVolumeLR;
+public:
+
                 uint32_t    sampleRate;
                 // NOTE: audio_track_cblk_t::frameSize is not equal to AudioTrack::frameSize() for
                 // 8 bit PCM data: in this case,  mCblk->frameSize is based on a sample size of
                 // 16 bit because data is converted to 16 bit before being stored in buffer
 
-                uint8_t     frameSize;
+                uint8_t     frameSize;       // would normally be size_t, but 8 bits is plenty
                 uint8_t     pad1;
                 uint16_t    bufferTimeoutMs; // Maximum cumulated timeout before restarting audioflinger
 
                 uint16_t    waitTimeMs;      // Cumulated wait time
-                uint16_t    sendLevel;
+private:
+                uint16_t    mSendLevel;      // Fixed point U4.12 so 0x1000 means 1.0
+public:
     volatile    int32_t     flags;
 
                 // Cache line boundary (32 bytes)
@@ -98,6 +106,30 @@
                 uint32_t    framesAvailable_l();
                 uint32_t    framesReady();
                 bool        tryLock();
+
+                // No barriers on the following operations, so the ordering of loads/stores
+                // with respect to other parameters is UNPREDICTABLE. That's considered safe.
+
+                // for AudioTrack client only, caller must limit to 0.0 <= sendLevel <= 1.0
+                void        setSendLevel(float sendLevel) {
+                    mSendLevel = uint16_t(sendLevel * 0x1000);
+                }
+
+                // for AudioFlinger only; the return value must be validated by the caller
+                uint16_t    getSendLevel_U4_12() const {
+                    return mSendLevel;
+                }
+
+                // for AudioTrack client only, caller must limit to 0 <= volumeLR <= 0x10001000
+                void        setVolumeLR(uint32_t volumeLR) {
+                    mVolumeLR = volumeLR;
+                }
+
+                // for AudioFlinger only; the return value must be validated by the caller
+                uint32_t    getVolumeLR() const {
+                    return mVolumeLR;
+                }
+
 };
 
 
diff --git a/include/ui/GraphicLog.h b/include/ui/GraphicLog.h
deleted file mode 100644
index ee1b09a..0000000
--- a/include/ui/GraphicLog.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#ifndef _UI_GRAPHIC_LOG_H
-#define _UI_GRAPHIC_LOG_H
-
-#include <utils/Singleton.h>
-#include <cutils/compiler.h>
-
-namespace android {
-
-class GraphicLog : public Singleton<GraphicLog>
-{
-    int32_t mEnabled;
-    static void logImpl(int32_t tag, int32_t buffer);
-    static void logImpl(int32_t tag, int32_t identity, int32_t buffer);
-
-public:
-    enum {
-        SF_APP_DEQUEUE_BEFORE   = 60100,
-        SF_APP_DEQUEUE_AFTER    = 60101,
-        SF_APP_LOCK_BEFORE      = 60102,
-        SF_APP_LOCK_AFTER       = 60103,
-        SF_APP_QUEUE            = 60104,
-
-        SF_REPAINT              = 60105,
-        SF_COMPOSITION_COMPLETE = 60106,
-        SF_UNLOCK_CLIENTS       = 60107,
-        SF_SWAP_BUFFERS         = 60108,
-        SF_REPAINT_DONE         = 60109,
-
-        SF_FB_POST_BEFORE       = 60110,
-        SF_FB_POST_AFTER        = 60111,
-        SF_FB_DEQUEUE_BEFORE    = 60112,
-        SF_FB_DEQUEUE_AFTER     = 60113,
-        SF_FB_LOCK_BEFORE       = 60114,
-        SF_FB_LOCK_AFTER        = 60115,
-    };
-
-    inline void log(int32_t tag, int32_t buffer) {
-        if (CC_UNLIKELY(mEnabled))
-            logImpl(tag, buffer);
-    }
-    inline void log(int32_t tag, int32_t identity, int32_t buffer) {
-        if (CC_UNLIKELY(mEnabled))
-            logImpl(tag, identity, buffer);
-    }
-
-    GraphicLog();
-
-    void setEnabled(bool enable);
-};
-
-}
-
-#endif // _UI_GRAPHIC_LOG_H
-
diff --git a/include/ui/Region.h b/include/ui/Region.h
index 6c9a620..f242f18 100644
--- a/include/ui/Region.h
+++ b/include/ui/Region.h
@@ -55,43 +55,51 @@
             void        set(uint32_t w, uint32_t h);
         
             Region&     orSelf(const Rect& rhs);
+            Region&     xorSelf(const Rect& rhs);
             Region&     andSelf(const Rect& rhs);
             Region&     subtractSelf(const Rect& rhs);
 
             // boolean operators, applied on this
             Region&     orSelf(const Region& rhs);
+            Region&     xorSelf(const Region& rhs);
             Region&     andSelf(const Region& rhs);
             Region&     subtractSelf(const Region& rhs);
 
             // boolean operators
     const   Region      merge(const Rect& rhs) const;
+    const   Region      mergeExclusive(const Rect& rhs) const;
     const   Region      intersect(const Rect& rhs) const;
     const   Region      subtract(const Rect& rhs) const;
 
             // boolean operators
     const   Region      merge(const Region& rhs) const;
+    const   Region      mergeExclusive(const Region& rhs) const;
     const   Region      intersect(const Region& rhs) const;
     const   Region      subtract(const Region& rhs) const;
 
             // these translate rhs first
             Region&     translateSelf(int dx, int dy);
             Region&     orSelf(const Region& rhs, int dx, int dy);
+            Region&     xorSelf(const Region& rhs, int dx, int dy);
             Region&     andSelf(const Region& rhs, int dx, int dy);
             Region&     subtractSelf(const Region& rhs, int dx, int dy);
 
             // these translate rhs first
     const   Region      translate(int dx, int dy) const;
     const   Region      merge(const Region& rhs, int dx, int dy) const;
+    const   Region      mergeExclusive(const Region& rhs, int dx, int dy) const;
     const   Region      intersect(const Region& rhs, int dx, int dy) const;
     const   Region      subtract(const Region& rhs, int dx, int dy) const;
 
     // convenience operators overloads
     inline  const Region      operator | (const Region& rhs) const;
+    inline  const Region      operator ^ (const Region& rhs) const;
     inline  const Region      operator & (const Region& rhs) const;
     inline  const Region      operator - (const Region& rhs) const;
     inline  const Region      operator + (const Point& pt) const;
 
     inline  Region&     operator |= (const Region& rhs);
+    inline  Region&     operator ^= (const Region& rhs);
     inline  Region&     operator &= (const Region& rhs);
     inline  Region&     operator -= (const Region& rhs);
     inline  Region&     operator += (const Point& pt);
@@ -158,6 +166,9 @@
 const Region Region::operator | (const Region& rhs) const {
     return merge(rhs);
 }
+const Region Region::operator ^ (const Region& rhs) const {
+    return mergeExclusive(rhs);
+}
 const Region Region::operator & (const Region& rhs) const {
     return intersect(rhs);
 }
@@ -172,6 +183,9 @@
 Region& Region::operator |= (const Region& rhs) {
     return orSelf(rhs);
 }
+Region& Region::operator ^= (const Region& rhs) {
+    return xorSelf(rhs);
+}
 Region& Region::operator &= (const Region& rhs) {
     return andSelf(rhs);
 }
diff --git a/include/utils/ResourceTypes.h b/include/utils/ResourceTypes.h
index 46420c1..c496da6 100644
--- a/include/utils/ResourceTypes.h
+++ b/include/utils/ResourceTypes.h
@@ -444,23 +444,31 @@
 
     void uninit();
 
+    // Return string entry as UTF16; if the pool is UTF8, the string will
+    // be converted before returning.
     inline const char16_t* stringAt(const ResStringPool_ref& ref, size_t* outLen) const {
         return stringAt(ref.index, outLen);
     }
     const char16_t* stringAt(size_t idx, size_t* outLen) const;
 
+    // Note: returns null if the string pool is not UTF8.
     const char* string8At(size_t idx, size_t* outLen) const;
 
+    // Return string whether the pool is UTF8 or UTF16.  Does not allow you
+    // to distinguish null.
+    const String8 string8ObjectAt(size_t idx) const;
+
     const ResStringPool_span* styleAt(const ResStringPool_ref& ref) const;
     const ResStringPool_span* styleAt(size_t idx) const;
 
     ssize_t indexOfString(const char16_t* str, size_t strLen) const;
 
     size_t size() const;
+    size_t styleCount() const;
+    size_t bytes() const;
 
-#ifndef HAVE_ANDROID_OS
+    bool isSorted() const;
     bool isUTF8() const;
-#endif
 
 private:
     status_t                    mError;
@@ -746,7 +754,9 @@
 /**
  * Header for a resource table.  Its data contains a series of
  * additional chunks:
- *   * A ResStringPool_header containing all table values.
+ *   * A ResStringPool_header containing all table values.  This string pool
+ *     contains all of the string values in the entire resource table (not
+ *     the names of entries or type identifiers however).
  *   * One or more ResTable_package chunks.
  *
  * Specific entries within a resource table can be uniquely identified
@@ -843,6 +853,8 @@
         DENSITY_MEDIUM = ACONFIGURATION_DENSITY_MEDIUM,
         DENSITY_TV = ACONFIGURATION_DENSITY_TV,
         DENSITY_HIGH = ACONFIGURATION_DENSITY_HIGH,
+        DENSITY_XHIGH = ACONFIGURATION_DENSITY_XHIGH,
+        DENSITY_XXHIGH = ACONFIGURATION_DENSITY_XXHIGH,
         DENSITY_NONE = ACONFIGURATION_DENSITY_NONE
     };
     
@@ -982,68 +994,15 @@
         uint32_t screenSizeDp;
     };
 
-    inline void copyFromDeviceNoSwap(const ResTable_config& o) {
-        const size_t size = dtohl(o.size);
-        if (size >= sizeof(ResTable_config)) {
-            *this = o;
-        } else {
-            memcpy(this, &o, size);
-            memset(((uint8_t*)this)+size, 0, sizeof(ResTable_config)-size);
-        }
-    }
+    void copyFromDeviceNoSwap(const ResTable_config& o);
     
-    inline void copyFromDtoH(const ResTable_config& o) {
-        copyFromDeviceNoSwap(o);
-        size = sizeof(ResTable_config);
-        mcc = dtohs(mcc);
-        mnc = dtohs(mnc);
-        density = dtohs(density);
-        screenWidth = dtohs(screenWidth);
-        screenHeight = dtohs(screenHeight);
-        sdkVersion = dtohs(sdkVersion);
-        minorVersion = dtohs(minorVersion);
-        smallestScreenWidthDp = dtohs(smallestScreenWidthDp);
-        screenWidthDp = dtohs(screenWidthDp);
-        screenHeightDp = dtohs(screenHeightDp);
-    }
+    void copyFromDtoH(const ResTable_config& o);
     
-    inline void swapHtoD() {
-        size = htodl(size);
-        mcc = htods(mcc);
-        mnc = htods(mnc);
-        density = htods(density);
-        screenWidth = htods(screenWidth);
-        screenHeight = htods(screenHeight);
-        sdkVersion = htods(sdkVersion);
-        minorVersion = htods(minorVersion);
-        smallestScreenWidthDp = htods(smallestScreenWidthDp);
-        screenWidthDp = htods(screenWidthDp);
-        screenHeightDp = htods(screenHeightDp);
-    }
-    
-    inline int compare(const ResTable_config& o) const {
-        int32_t diff = (int32_t)(imsi - o.imsi);
-        if (diff != 0) return diff;
-        diff = (int32_t)(locale - o.locale);
-        if (diff != 0) return diff;
-        diff = (int32_t)(screenType - o.screenType);
-        if (diff != 0) return diff;
-        diff = (int32_t)(input - o.input);
-        if (diff != 0) return diff;
-        diff = (int32_t)(screenSize - o.screenSize);
-        if (diff != 0) return diff;
-        diff = (int32_t)(version - o.version);
-        if (diff != 0) return diff;
-        diff = (int32_t)(screenLayout - o.screenLayout);
-        if (diff != 0) return diff;
-        diff = (int32_t)(uiMode - o.uiMode);
-        if (diff != 0) return diff;
-        diff = (int32_t)(smallestScreenWidthDp - o.smallestScreenWidthDp);
-        if (diff != 0) return diff;
-        diff = (int32_t)(screenSizeDp - o.screenSizeDp);
-        return (int)diff;
-    }
-    
+    void swapHtoD();
+
+    int compare(const ResTable_config& o) const;
+    int compareLogical(const ResTable_config& o) const;
+
     // Flags indicating a set of config values.  These flag constants must
     // match the corresponding ones in android.content.pm.ActivityInfo and
     // attrs_manifest.xml.
@@ -1066,158 +1025,10 @@
     
     // Compare two configuration, returning CONFIG_* flags set for each value
     // that is different.
-    inline int diff(const ResTable_config& o) const {
-        int diffs = 0;
-        if (mcc != o.mcc) diffs |= CONFIG_MCC;
-        if (mnc != o.mnc) diffs |= CONFIG_MNC;
-        if (locale != o.locale) diffs |= CONFIG_LOCALE;
-        if (orientation != o.orientation) diffs |= CONFIG_ORIENTATION;
-        if (density != o.density) diffs |= CONFIG_DENSITY;
-        if (touchscreen != o.touchscreen) diffs |= CONFIG_TOUCHSCREEN;
-        if (((inputFlags^o.inputFlags)&(MASK_KEYSHIDDEN|MASK_NAVHIDDEN)) != 0)
-                diffs |= CONFIG_KEYBOARD_HIDDEN;
-        if (keyboard != o.keyboard) diffs |= CONFIG_KEYBOARD;
-        if (navigation != o.navigation) diffs |= CONFIG_NAVIGATION;
-        if (screenSize != o.screenSize) diffs |= CONFIG_SCREEN_SIZE;
-        if (version != o.version) diffs |= CONFIG_VERSION;
-        if (screenLayout != o.screenLayout) diffs |= CONFIG_SCREEN_LAYOUT;
-        if (uiMode != o.uiMode) diffs |= CONFIG_UI_MODE;
-        if (smallestScreenWidthDp != o.smallestScreenWidthDp) diffs |= CONFIG_SMALLEST_SCREEN_SIZE;
-        if (screenSizeDp != o.screenSizeDp) diffs |= CONFIG_SCREEN_SIZE;
-        return diffs;
-    }
+    int diff(const ResTable_config& o) const;
     
     // Return true if 'this' is more specific than 'o'.
-    inline bool
-    isMoreSpecificThan(const ResTable_config& o) const {
-        // The order of the following tests defines the importance of one
-        // configuration parameter over another.  Those tests first are more
-        // important, trumping any values in those following them.
-        if (imsi || o.imsi) {
-            if (mcc != o.mcc) {
-                if (!mcc) return false;
-                if (!o.mcc) return true;
-            }
-
-            if (mnc != o.mnc) {
-                if (!mnc) return false;
-                if (!o.mnc) return true;
-            }
-        }
-
-        if (locale || o.locale) {
-            if (language[0] != o.language[0]) {
-                if (!language[0]) return false;
-                if (!o.language[0]) return true;
-            }
-
-            if (country[0] != o.country[0]) {
-                if (!country[0]) return false;
-                if (!o.country[0]) return true;
-            }
-        }
-
-        if (smallestScreenWidthDp || o.smallestScreenWidthDp) {
-            if (smallestScreenWidthDp != o.smallestScreenWidthDp) {
-                if (!smallestScreenWidthDp) return false;
-                if (!o.smallestScreenWidthDp) return true;
-            }
-        }
-
-        if (screenSizeDp || o.screenSizeDp) {
-            if (screenWidthDp != o.screenWidthDp) {
-                if (!screenWidthDp) return false;
-                if (!o.screenWidthDp) return true;
-            }
-
-            if (screenHeightDp != o.screenHeightDp) {
-                if (!screenHeightDp) return false;
-                if (!o.screenHeightDp) return true;
-            }
-        }
-
-        if (screenLayout || o.screenLayout) {
-            if (((screenLayout^o.screenLayout) & MASK_SCREENSIZE) != 0) {
-                if (!(screenLayout & MASK_SCREENSIZE)) return false;
-                if (!(o.screenLayout & MASK_SCREENSIZE)) return true;
-            }
-            if (((screenLayout^o.screenLayout) & MASK_SCREENLONG) != 0) {
-                if (!(screenLayout & MASK_SCREENLONG)) return false;
-                if (!(o.screenLayout & MASK_SCREENLONG)) return true;
-            }
-        }
-
-        if (orientation != o.orientation) {
-            if (!orientation) return false;
-            if (!o.orientation) return true;
-        }
-
-        if (uiMode || o.uiMode) {
-            if (((uiMode^o.uiMode) & MASK_UI_MODE_TYPE) != 0) {
-                if (!(uiMode & MASK_UI_MODE_TYPE)) return false;
-                if (!(o.uiMode & MASK_UI_MODE_TYPE)) return true;
-            }
-            if (((uiMode^o.uiMode) & MASK_UI_MODE_NIGHT) != 0) {
-                if (!(uiMode & MASK_UI_MODE_NIGHT)) return false;
-                if (!(o.uiMode & MASK_UI_MODE_NIGHT)) return true;
-            }
-        }
-
-        // density is never 'more specific'
-        // as the default just equals 160
-
-        if (touchscreen != o.touchscreen) {
-            if (!touchscreen) return false;
-            if (!o.touchscreen) return true;
-        }
-
-        if (input || o.input) {
-            if (((inputFlags^o.inputFlags) & MASK_KEYSHIDDEN) != 0) {
-                if (!(inputFlags & MASK_KEYSHIDDEN)) return false;
-                if (!(o.inputFlags & MASK_KEYSHIDDEN)) return true;
-            }
-
-            if (((inputFlags^o.inputFlags) & MASK_NAVHIDDEN) != 0) {
-                if (!(inputFlags & MASK_NAVHIDDEN)) return false;
-                if (!(o.inputFlags & MASK_NAVHIDDEN)) return true;
-            }
-
-            if (keyboard != o.keyboard) {
-                if (!keyboard) return false;
-                if (!o.keyboard) return true;
-            }
-
-            if (navigation != o.navigation) {
-                if (!navigation) return false;
-                if (!o.navigation) return true;
-            }
-        }
-
-        if (screenSize || o.screenSize) {
-            if (screenWidth != o.screenWidth) {
-                if (!screenWidth) return false;
-                if (!o.screenWidth) return true;
-            }
-
-            if (screenHeight != o.screenHeight) {
-                if (!screenHeight) return false;
-                if (!o.screenHeight) return true;
-            }
-        }
-
-        if (version || o.version) {
-            if (sdkVersion != o.sdkVersion) {
-                if (!sdkVersion) return false;
-                if (!o.sdkVersion) return true;
-            }
-
-            if (minorVersion != o.minorVersion) {
-                if (!minorVersion) return false;
-                if (!o.minorVersion) return true;
-            }
-        }
-        return false;
-    }
+    bool isMoreSpecificThan(const ResTable_config& o) const;
 
     // Return true if 'this' is a better match than 'o' for the 'requested'
     // configuration.  This assumes that match() has already been used to
@@ -1229,222 +1040,7 @@
     // they are not equal then one must be generic because only generic and
     // '==requested' will pass the match() call.  So if this is not generic,
     // it wins.  If this IS generic, o wins (return false).
-    inline bool
-    isBetterThan(const ResTable_config& o,
-            const ResTable_config* requested) const {
-        if (requested) {
-            if (imsi || o.imsi) {
-                if ((mcc != o.mcc) && requested->mcc) {
-                    return (mcc);
-                }
-
-                if ((mnc != o.mnc) && requested->mnc) {
-                    return (mnc);
-                }
-            }
-
-            if (locale || o.locale) {
-                if ((language[0] != o.language[0]) && requested->language[0]) {
-                    return (language[0]);
-                }
-
-                if ((country[0] != o.country[0]) && requested->country[0]) {
-                    return (country[0]);
-                }
-            }
-
-            if (smallestScreenWidthDp || o.smallestScreenWidthDp) {
-                // The configuration closest to the actual size is best.
-                // We assume that larger configs have already been filtered
-                // out at this point.  That means we just want the largest one.
-                return smallestScreenWidthDp >= o.smallestScreenWidthDp;
-            }
-
-            if (screenSizeDp || o.screenSizeDp) {
-                // "Better" is based on the sum of the difference between both
-                // width and height from the requested dimensions.  We are
-                // assuming the invalid configs (with smaller dimens) have
-                // already been filtered.  Note that if a particular dimension
-                // is unspecified, we will end up with a large value (the
-                // difference between 0 and the requested dimension), which is
-                // good since we will prefer a config that has specified a
-                // dimension value.
-                int myDelta = 0, otherDelta = 0;
-                if (requested->screenWidthDp) {
-                    myDelta += requested->screenWidthDp - screenWidthDp;
-                    otherDelta += requested->screenWidthDp - o.screenWidthDp;
-                }
-                if (requested->screenHeightDp) {
-                    myDelta += requested->screenHeightDp - screenHeightDp;
-                    otherDelta += requested->screenHeightDp - o.screenHeightDp;
-                }
-                //ALOGI("Comparing this %dx%d to other %dx%d in %dx%d: myDelta=%d otherDelta=%d",
-                //    screenWidthDp, screenHeightDp, o.screenWidthDp, o.screenHeightDp,
-                //    requested->screenWidthDp, requested->screenHeightDp, myDelta, otherDelta);
-                return (myDelta <= otherDelta);
-            }
-
-            if (screenLayout || o.screenLayout) {
-                if (((screenLayout^o.screenLayout) & MASK_SCREENSIZE) != 0
-                        && (requested->screenLayout & MASK_SCREENSIZE)) {
-                    // A little backwards compatibility here: undefined is
-                    // considered equivalent to normal.  But only if the
-                    // requested size is at least normal; otherwise, small
-                    // is better than the default.
-                    int mySL = (screenLayout & MASK_SCREENSIZE);
-                    int oSL = (o.screenLayout & MASK_SCREENSIZE);
-                    int fixedMySL = mySL;
-                    int fixedOSL = oSL;
-                    if ((requested->screenLayout & MASK_SCREENSIZE) >= SCREENSIZE_NORMAL) {
-                        if (fixedMySL == 0) fixedMySL = SCREENSIZE_NORMAL;
-                        if (fixedOSL == 0) fixedOSL = SCREENSIZE_NORMAL;
-                    }
-                    // For screen size, the best match is the one that is
-                    // closest to the requested screen size, but not over
-                    // (the not over part is dealt with in match() below).
-                    if (fixedMySL == fixedOSL) {
-                        // If the two are the same, but 'this' is actually
-                        // undefined, then the other is really a better match.
-                        if (mySL == 0) return false;
-                        return true;
-                    }
-                    return fixedMySL >= fixedOSL;
-                }
-                if (((screenLayout^o.screenLayout) & MASK_SCREENLONG) != 0
-                        && (requested->screenLayout & MASK_SCREENLONG)) {
-                    return (screenLayout & MASK_SCREENLONG);
-                }
-            }
-
-            if ((orientation != o.orientation) && requested->orientation) {
-                return (orientation);
-            }
-
-            if (uiMode || o.uiMode) {
-                if (((uiMode^o.uiMode) & MASK_UI_MODE_TYPE) != 0
-                        && (requested->uiMode & MASK_UI_MODE_TYPE)) {
-                    return (uiMode & MASK_UI_MODE_TYPE);
-                }
-                if (((uiMode^o.uiMode) & MASK_UI_MODE_NIGHT) != 0
-                        && (requested->uiMode & MASK_UI_MODE_NIGHT)) {
-                    return (uiMode & MASK_UI_MODE_NIGHT);
-                }
-            }
-
-            if (screenType || o.screenType) {
-                if (density != o.density) {
-                    // density is tough.  Any density is potentially useful
-                    // because the system will scale it.  Scaling down
-                    // is generally better than scaling up.
-                    // Default density counts as 160dpi (the system default)
-                    // TODO - remove 160 constants
-                    int h = (density?density:160);
-                    int l = (o.density?o.density:160);
-                    bool bImBigger = true;
-                    if (l > h) {
-                        int t = h;
-                        h = l;
-                        l = t;
-                        bImBigger = false;
-                    }
- 
-                    int reqValue = (requested->density?requested->density:160);
-                    if (reqValue >= h) {
-                        // requested value higher than both l and h, give h
-                        return bImBigger;
-                    }
-                    if (l >= reqValue) {
-                        // requested value lower than both l and h, give l
-                        return !bImBigger;
-                    }
-                    // saying that scaling down is 2x better than up
-                    if (((2 * l) - reqValue) * h > reqValue * reqValue) {
-                        return !bImBigger;
-                    } else { 
-                        return bImBigger;
-                    }
-                }
-
-                if ((touchscreen != o.touchscreen) && requested->touchscreen) {
-                    return (touchscreen);
-                }
-            }
-
-            if (input || o.input) {
-                const int keysHidden = inputFlags & MASK_KEYSHIDDEN;
-                const int oKeysHidden = o.inputFlags & MASK_KEYSHIDDEN;
-                if (keysHidden != oKeysHidden) {
-                    const int reqKeysHidden =
-                            requested->inputFlags & MASK_KEYSHIDDEN;
-                    if (reqKeysHidden) {
-
-                        if (!keysHidden) return false;
-                        if (!oKeysHidden) return true;
-                        // For compatibility, we count KEYSHIDDEN_NO as being
-                        // the same as KEYSHIDDEN_SOFT.  Here we disambiguate
-                        // these by making an exact match more specific.
-                        if (reqKeysHidden == keysHidden) return true;
-                        if (reqKeysHidden == oKeysHidden) return false;
-                    }
-                }
-
-                const int navHidden = inputFlags & MASK_NAVHIDDEN;
-                const int oNavHidden = o.inputFlags & MASK_NAVHIDDEN;
-                if (navHidden != oNavHidden) {
-                    const int reqNavHidden =
-                            requested->inputFlags & MASK_NAVHIDDEN;
-                    if (reqNavHidden) {
-
-                        if (!navHidden) return false;
-                        if (!oNavHidden) return true;
-                    }
-                }
-
-                if ((keyboard != o.keyboard) && requested->keyboard) {
-                    return (keyboard);
-                }
-
-                if ((navigation != o.navigation) && requested->navigation) {
-                    return (navigation);
-                }
-            }
-
-            if (screenSize || o.screenSize) {
-                // "Better" is based on the sum of the difference between both
-                // width and height from the requested dimensions.  We are
-                // assuming the invalid configs (with smaller sizes) have
-                // already been filtered.  Note that if a particular dimension
-                // is unspecified, we will end up with a large value (the
-                // difference between 0 and the requested dimension), which is
-                // good since we will prefer a config that has specified a
-                // size value.
-                int myDelta = 0, otherDelta = 0;
-                if (requested->screenWidth) {
-                    myDelta += requested->screenWidth - screenWidth;
-                    otherDelta += requested->screenWidth - o.screenWidth;
-                }
-                if (requested->screenHeight) {
-                    myDelta += requested->screenHeight - screenHeight;
-                    otherDelta += requested->screenHeight - o.screenHeight;
-                }
-                return (myDelta <= otherDelta);
-            }
-
-            if (version || o.version) {
-                if ((sdkVersion != o.sdkVersion) && requested->sdkVersion) {
-                    return (sdkVersion > o.sdkVersion);
-                }
-
-                if ((minorVersion != o.minorVersion) &&
-                        requested->minorVersion) {
-                    return (minorVersion);
-                }
-            }
-
-            return false;
-        }
-        return isMoreSpecificThan(o);
-    }
+    bool isBetterThan(const ResTable_config& o, const ResTable_config* requested) const;
 
     // Return true if 'this' can be considered a match for the parameters in 
     // 'settings'.
@@ -1452,150 +1048,11 @@
     // but a request for the default should not match odd specifics
     // (ie, request with no mcc should not match a particular mcc's data)
     // settings is the requested settings
-    inline bool match(const ResTable_config& settings) const {
-        if (imsi != 0) {
-            if (mcc != 0 && mcc != settings.mcc) {
-                return false;
-            }
-            if (mnc != 0 && mnc != settings.mnc) {
-                return false;
-            }
-        }
-        if (locale != 0) {
-            if (language[0] != 0
-                && (language[0] != settings.language[0]
-                    || language[1] != settings.language[1])) {
-                return false;
-            }
-            if (country[0] != 0
-                && (country[0] != settings.country[0]
-                    || country[1] != settings.country[1])) {
-                return false;
-            }
-        }
-        if (screenConfig != 0) {
-            const int screenSize = screenLayout&MASK_SCREENSIZE;
-            const int setScreenSize = settings.screenLayout&MASK_SCREENSIZE;
-            // Any screen sizes for larger screens than the setting do not
-            // match.
-            if (screenSize != 0 && screenSize > setScreenSize) {
-                return false;
-            }
-            
-            const int screenLong = screenLayout&MASK_SCREENLONG;
-            const int setScreenLong = settings.screenLayout&MASK_SCREENLONG;
-            if (screenLong != 0 && screenLong != setScreenLong) {
-                return false;
-            }
+    bool match(const ResTable_config& settings) const;
 
-            const int uiModeType = uiMode&MASK_UI_MODE_TYPE;
-            const int setUiModeType = settings.uiMode&MASK_UI_MODE_TYPE;
-            if (uiModeType != 0 && uiModeType != setUiModeType) {
-                return false;
-            }
+    void getLocale(char str[6]) const;
 
-            const int uiModeNight = uiMode&MASK_UI_MODE_NIGHT;
-            const int setUiModeNight = settings.uiMode&MASK_UI_MODE_NIGHT;
-            if (uiModeNight != 0 && uiModeNight != setUiModeNight) {
-                return false;
-            }
-
-            if (smallestScreenWidthDp != 0
-                    && smallestScreenWidthDp > settings.smallestScreenWidthDp) {
-                return false;
-            }
-        }
-        if (screenSizeDp != 0) {
-            if (screenWidthDp != 0 && screenWidthDp > settings.screenWidthDp) {
-                //ALOGI("Filtering out width %d in requested %d", screenWidthDp, settings.screenWidthDp);
-                return false;
-            }
-            if (screenHeightDp != 0 && screenHeightDp > settings.screenHeightDp) {
-                //ALOGI("Filtering out height %d in requested %d", screenHeightDp, settings.screenHeightDp);
-                return false;
-            }
-        }
-        if (screenType != 0) {
-            if (orientation != 0 && orientation != settings.orientation) {
-                return false;
-            }
-            // density always matches - we can scale it.  See isBetterThan
-            if (touchscreen != 0 && touchscreen != settings.touchscreen) {
-                return false;
-            }
-        }
-        if (input != 0) {
-            const int keysHidden = inputFlags&MASK_KEYSHIDDEN;
-            const int setKeysHidden = settings.inputFlags&MASK_KEYSHIDDEN;
-            if (keysHidden != 0 && keysHidden != setKeysHidden) {
-                // For compatibility, we count a request for KEYSHIDDEN_NO as also
-                // matching the more recent KEYSHIDDEN_SOFT.  Basically
-                // KEYSHIDDEN_NO means there is some kind of keyboard available.
-                //ALOGI("Matching keysHidden: have=%d, config=%d\n", keysHidden, setKeysHidden);
-                if (keysHidden != KEYSHIDDEN_NO || setKeysHidden != KEYSHIDDEN_SOFT) {
-                    //ALOGI("No match!");
-                    return false;
-                }
-            }
-            const int navHidden = inputFlags&MASK_NAVHIDDEN;
-            const int setNavHidden = settings.inputFlags&MASK_NAVHIDDEN;
-            if (navHidden != 0 && navHidden != setNavHidden) {
-                return false;
-            }
-            if (keyboard != 0 && keyboard != settings.keyboard) {
-                return false;
-            }
-            if (navigation != 0 && navigation != settings.navigation) {
-                return false;
-            }
-        }
-        if (screenSize != 0) {
-            if (screenWidth != 0 && screenWidth > settings.screenWidth) {
-                return false;
-            }
-            if (screenHeight != 0 && screenHeight > settings.screenHeight) {
-                return false;
-            }
-        }
-        if (version != 0) {
-            if (sdkVersion != 0 && sdkVersion > settings.sdkVersion) {
-                return false;
-            }
-            if (minorVersion != 0 && minorVersion != settings.minorVersion) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    void getLocale(char str[6]) const {
-        memset(str, 0, 6);
-        if (language[0]) {
-            str[0] = language[0];
-            str[1] = language[1];
-            if (country[0]) {
-                str[2] = '_';
-                str[3] = country[0];
-                str[4] = country[1];
-            }
-        }
-    }
-
-    String8 toString() const {
-        char buf[200];
-        sprintf(buf, "imsi=%d/%d lang=%c%c reg=%c%c orient=%d touch=%d dens=%d "
-                "kbd=%d nav=%d input=%d ssz=%dx%d sw%ddp w%ddp h%ddp sz=%d long=%d "
-                "ui=%d night=%d vers=%d.%d",
-                mcc, mnc,
-                language[0] ? language[0] : '-', language[1] ? language[1] : '-',
-                country[0] ? country[0] : '-', country[1] ? country[1] : '-',
-                orientation, touchscreen, density, keyboard, navigation, inputFlags,
-                screenWidth, screenHeight, smallestScreenWidthDp, screenWidthDp, screenHeightDp,
-                screenLayout&MASK_SCREENSIZE, screenLayout&MASK_SCREENLONG,
-                uiMode&MASK_UI_MODE_TYPE, uiMode&MASK_UI_MODE_NIGHT,
-                sdkVersion, minorVersion);
-        return String8(buf);
-    }
+    String8 toString() const;
 };
 
 /**
@@ -2054,8 +1511,14 @@
     const char16_t* getBasePackageName(size_t idx) const;
     uint32_t getBasePackageId(size_t idx) const;
 
+    // Return the number of resource tables that the object contains.
     size_t getTableCount() const;
+    // Return the values string pool for the resource table at the given
+    // index.  This string pool contains all of the strings for values
+    // contained in the resource table -- that is the item values themselves,
+    // but not the names their entries or types.
     const ResStringPool* getTableStringBlock(size_t index) const;
+    // Return unique cookie identifier for the given resource table.
     void* getTableCookie(size_t index) const;
 
     // Return the configurations (ResTable_config) that we know about
diff --git a/include/utils/TypeHelpers.h b/include/utils/TypeHelpers.h
index 7b4fb70..1f2c2d5 100644
--- a/include/utils/TypeHelpers.h
+++ b/include/utils/TypeHelpers.h
@@ -233,19 +233,15 @@
     }
 };
 
-template<>
 template <typename K, typename V>
 struct trait_trivial_ctor< key_value_pair_t<K, V> >
 { enum { value = aggregate_traits<K,V>::has_trivial_ctor }; };
-template<> 
 template <typename K, typename V>
 struct trait_trivial_dtor< key_value_pair_t<K, V> >
 { enum { value = aggregate_traits<K,V>::has_trivial_dtor }; };
-template<> 
 template <typename K, typename V>
 struct trait_trivial_copy< key_value_pair_t<K, V> >
 { enum { value = aggregate_traits<K,V>::has_trivial_copy }; };
-template<> 
 template <typename K, typename V>
 struct trait_trivial_move< key_value_pair_t<K, V> >
 { enum { value = aggregate_traits<K,V>::has_trivial_move }; };
diff --git a/include/utils/threads.h b/include/utils/threads.h
index ab3e8cd..b4a8b7c 100644
--- a/include/utils/threads.h
+++ b/include/utils/threads.h
@@ -526,6 +526,12 @@
     // Do not call from this object's thread; will return WOULD_BLOCK in that case.
             status_t    join();
 
+#ifdef HAVE_ANDROID_OS
+    // Return the thread's kernel ID, same as the thread itself calling gettid() or
+    // androidGetTid(), or -1 if the thread is not running.
+            pid_t       getTid() const;
+#endif
+
 protected:
     // exitPending() returns true if requestExit() has been called.
             bool        exitPending() const;
@@ -551,8 +557,10 @@
     volatile bool           mExitPending;
     volatile bool           mRunning;
             sp<Thread>      mHoldSelf;
-#if HAVE_ANDROID_OS
-            int             mTid;
+#ifdef HAVE_ANDROID_OS
+    // legacy for debugging, not used by getTid() as it is set by the child thread
+    // and so is not initialized until the child reaches that point
+            pid_t           mTid;
 #endif
 };
 
diff --git a/libs/binder/IPCThreadState.cpp b/libs/binder/IPCThreadState.cpp
index a42c336..b578a6c 100644
--- a/libs/binder/IPCThreadState.cpp
+++ b/libs/binder/IPCThreadState.cpp
@@ -371,6 +371,11 @@
     return mCallingUid;
 }
 
+int IPCThreadState::getOrigCallingUid()
+{
+    return mOrigCallingUid;
+}
+
 int64_t IPCThreadState::clearCallingIdentity()
 {
     int64_t token = ((int64_t)mCallingUid<<32) | mCallingPid;
@@ -641,6 +646,7 @@
 {
     pthread_setspecific(gTLS, this);
     clearCaller();
+    mOrigCallingUid = mCallingUid;
     mIn.setDataCapacity(256);
     mOut.setDataCapacity(256);
 }
@@ -692,7 +698,7 @@
         
         case BR_ACQUIRE_RESULT:
             {
-                LOG_ASSERT(acquireResult != NULL, "Unexpected brACQUIRE_RESULT");
+                ALOG_ASSERT(acquireResult != NULL, "Unexpected brACQUIRE_RESULT");
                 const int32_t result = mIn.readInt32();
                 if (!acquireResult) continue;
                 *acquireResult = result ? NO_ERROR : INVALID_OPERATION;
@@ -703,7 +709,7 @@
             {
                 binder_transaction_data tr;
                 err = mIn.read(&tr, sizeof(tr));
-                LOG_ASSERT(err == NO_ERROR, "Not enough command data for brREPLY");
+                ALOG_ASSERT(err == NO_ERROR, "Not enough command data for brREPLY");
                 if (err != NO_ERROR) goto finish;
 
                 if (reply) {
@@ -752,7 +758,7 @@
 
 status_t IPCThreadState::talkWithDriver(bool doReceive)
 {
-    LOG_ASSERT(mProcess->mDriverFD >= 0, "Binder driver is not opened");
+    ALOG_ASSERT(mProcess->mDriverFD >= 0, "Binder driver is not opened");
     
     binder_write_read bwr;
     
@@ -905,7 +911,7 @@
     case BR_ACQUIRE:
         refs = (RefBase::weakref_type*)mIn.readInt32();
         obj = (BBinder*)mIn.readInt32();
-        LOG_ASSERT(refs->refBase() == obj,
+        ALOG_ASSERT(refs->refBase() == obj,
                    "BR_ACQUIRE: object %p does not match cookie %p (expected %p)",
                    refs, obj, refs->refBase());
         obj->incStrong(mProcess.get());
@@ -921,7 +927,7 @@
     case BR_RELEASE:
         refs = (RefBase::weakref_type*)mIn.readInt32();
         obj = (BBinder*)mIn.readInt32();
-        LOG_ASSERT(refs->refBase() == obj,
+        ALOG_ASSERT(refs->refBase() == obj,
                    "BR_RELEASE: object %p does not match cookie %p (expected %p)",
                    refs, obj, refs->refBase());
         IF_LOG_REMOTEREFS() {
@@ -946,7 +952,7 @@
         // NOTE: This assertion is not valid, because the object may no
         // longer exist (thus the (BBinder*)cast above resulting in a different
         // memory address).
-        //LOG_ASSERT(refs->refBase() == obj,
+        //ALOG_ASSERT(refs->refBase() == obj,
         //           "BR_DECREFS: object %p does not match cookie %p (expected %p)",
         //           refs, obj, refs->refBase());
         mPendingWeakDerefs.push(refs);
@@ -958,7 +964,7 @@
          
         {
             const bool success = refs->attemptIncStrong(mProcess.get());
-            LOG_ASSERT(success && refs->refBase() == obj,
+            ALOG_ASSERT(success && refs->refBase() == obj,
                        "BR_ATTEMPT_ACQUIRE: object %p does not match cookie %p (expected %p)",
                        refs, obj, refs->refBase());
             
@@ -971,7 +977,7 @@
         {
             binder_transaction_data tr;
             result = mIn.read(&tr, sizeof(tr));
-            LOG_ASSERT(result == NO_ERROR,
+            ALOG_ASSERT(result == NO_ERROR,
                 "Not enough command data for brTRANSACTION");
             if (result != NO_ERROR) break;
             
@@ -987,6 +993,7 @@
             
             mCallingPid = tr.sender_pid;
             mCallingUid = tr.sender_euid;
+            mOrigCallingUid = tr.sender_euid;
             
             int curPrio = getpriority(PRIO_PROCESS, mMyThreadId);
             if (gDisableBackgroundScheduling) {
@@ -1045,6 +1052,7 @@
             
             mCallingPid = origPid;
             mCallingUid = origUid;
+            mOrigCallingUid = origUid;
 
             IF_LOG_TRANSACTIONS() {
                 TextOutput::Bundle _b(alog);
@@ -1114,7 +1122,7 @@
     IF_LOG_COMMANDS() {
         alog << "Writing BC_FREE_BUFFER for " << data << endl;
     }
-    LOG_ASSERT(data != NULL, "Called with NULL data");
+    ALOG_ASSERT(data != NULL, "Called with NULL data");
     if (parcel != NULL) parcel->closeFileDescriptors();
     IPCThreadState* state = self();
     state->mOut.writeInt32(BC_FREE_BUFFER);
diff --git a/libs/gui/Android.mk b/libs/gui/Android.mk
index b8be67d..b6f5b9e 100644
--- a/libs/gui/Android.mk
+++ b/libs/gui/Android.mk
@@ -34,6 +34,13 @@
 
 LOCAL_MODULE:= libgui
 
+ifeq ($(TARGET_BOARD_PLATFORM), omap4)
+	LOCAL_CFLAGS += -DUSE_FENCE_SYNC
+endif
+ifeq ($(TARGET_BOARD_PLATFORM), s5pc110)
+	LOCAL_CFLAGS += -DUSE_FENCE_SYNC
+endif
+
 ifeq ($(TARGET_BOARD_PLATFORM), tegra)
 	LOCAL_CFLAGS += -DALLOW_DEQUEUE_CURRENT_BUFFER
 endif
diff --git a/libs/gui/BitTube.cpp b/libs/gui/BitTube.cpp
index 785da39..55f4178 100644
--- a/libs/gui/BitTube.cpp
+++ b/libs/gui/BitTube.cpp
@@ -17,8 +17,9 @@
 #include <stdint.h>
 #include <sys/types.h>
 
-#include <unistd.h>
 #include <fcntl.h>
+#include <signal.h>
+#include <unistd.h>
 
 #include <utils/Errors.h>
 
@@ -38,6 +39,8 @@
         mSendFd = fds[1];
         fcntl(mReceiveFd, F_SETFL, O_NONBLOCK);
         fcntl(mSendFd, F_SETFL, O_NONBLOCK);
+        // ignore SIGPIPE, we handle write errors through EPIPE instead
+        signal(SIGPIPE, SIG_IGN);
     } else {
         mReceiveFd = -errno;
         ALOGE("BitTube: pipe creation failed (%s)", strerror(-mReceiveFd));
diff --git a/libs/gui/DisplayEventReceiver.cpp b/libs/gui/DisplayEventReceiver.cpp
index 3b3ccaa..6a4763d 100644
--- a/libs/gui/DisplayEventReceiver.cpp
+++ b/libs/gui/DisplayEventReceiver.cpp
@@ -80,7 +80,13 @@
 
 ssize_t DisplayEventReceiver::getEvents(DisplayEventReceiver::Event* events,
         size_t count) {
-    ssize_t size = mDataChannel->read(events, sizeof(events[0])*count);
+    return DisplayEventReceiver::getEvents(mDataChannel, events, count);
+}
+
+ssize_t DisplayEventReceiver::getEvents(const sp<BitTube>& dataChannel,
+        Event* events, size_t count)
+{
+    ssize_t size = dataChannel->read(events, sizeof(events[0])*count);
     ALOGE_IF(size<0,
             "DisplayEventReceiver::getEvents error (%s)",
             strerror(-size));
diff --git a/libs/gui/ISurfaceComposerClient.cpp b/libs/gui/ISurfaceComposerClient.cpp
index 5ebdbd9..8fe96b1 100644
--- a/libs/gui/ISurfaceComposerClient.cpp
+++ b/libs/gui/ISurfaceComposerClient.cpp
@@ -35,15 +35,6 @@
 
 // ---------------------------------------------------------------------------
 
-/* ideally AID_GRAPHICS would be in a semi-public header
- * or there would be a way to map a user/group name to its id
- */
-#ifndef AID_GRAPHICS
-#define AID_GRAPHICS 1003
-#endif
-
-// ---------------------------------------------------------------------------
-
 namespace android {
 
 enum {
diff --git a/libs/hwui/Android.mk b/libs/hwui/Android.mk
index 95e0a18..5ec3983 100644
--- a/libs/hwui/Android.mk
+++ b/libs/hwui/Android.mk
@@ -26,6 +26,7 @@
 		ShapeCache.cpp \
 		SkiaColorFilter.cpp \
 		SkiaShader.cpp \
+		Snapshot.cpp \
 		TextureCache.cpp \
 		TextDropShadowCache.cpp
 	
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp
index d1af1a3..0ef8469 100644
--- a/libs/hwui/Caches.cpp
+++ b/libs/hwui/Caches.cpp
@@ -55,6 +55,16 @@
 
     glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
 
+    if (extensions.hasDebugMarker()) {
+        eventMark = glInsertEventMarkerEXT;
+        startMark = glPushGroupMarkerEXT;
+        endMark = glPopGroupMarkerEXT;
+    } else {
+        eventMark = eventMarkNull;
+        startMark = startMarkNull;
+        endMark = endMarkNull;
+    }
+
     init();
 
     mDebugLevel = readDebugLevel();
diff --git a/libs/hwui/Caches.h b/libs/hwui/Caches.h
index 409584f..f8c7bcc 100644
--- a/libs/hwui/Caches.h
+++ b/libs/hwui/Caches.h
@@ -240,7 +240,15 @@
     GammaFontRenderer fontRenderer;
     ResourceCache resourceCache;
 
+    PFNGLINSERTEVENTMARKEREXTPROC eventMark;
+    PFNGLPUSHGROUPMARKEREXTPROC startMark;
+    PFNGLPOPGROUPMARKEREXTPROC endMark;
+
 private:
+    static void eventMarkNull(GLsizei length, const GLchar *marker) { }
+    static void startMarkNull(GLsizei length, const GLchar *marker) { }
+    static void endMarkNull() { }
+
     GLuint mCurrentBuffer;
     GLuint mCurrentIndicesBuffer;
     void* mCurrentPositionPointer;
diff --git a/libs/hwui/Debug.h b/libs/hwui/Debug.h
index 0ad0c2a..16a3d73 100644
--- a/libs/hwui/Debug.h
+++ b/libs/hwui/Debug.h
@@ -62,6 +62,9 @@
 // Turn on to display debug info about the layer renderer
 #define DEBUG_LAYER_RENDERER 0
 
+// Turn on to enable additional debugging in the font renderers
+#define DEBUG_FONT_RENDERER 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 656a384..1a11fbc 100644
--- a/libs/hwui/DisplayListRenderer.cpp
+++ b/libs/hwui/DisplayListRenderer.cpp
@@ -19,9 +19,10 @@
 
 #include "DisplayListLogBuffer.h"
 #include "DisplayListRenderer.h"
-#include <utils/String8.h>
 #include "Caches.h"
 
+#include <utils/String8.h>
+
 namespace android {
 namespace uirenderer {
 
@@ -60,12 +61,15 @@
     "DrawLines",
     "DrawPoints",
     "DrawText",
+    "DrawPosText",
     "ResetShader",
     "SetupShader",
     "ResetColorFilter",
     "SetupColorFilter",
     "ResetShadow",
     "SetupShadow",
+    "ResetPaintFilter",
+    "SetupPaintFilter",
     "DrawGLFunction"
 };
 
@@ -214,7 +218,7 @@
         indent[i] = ' ';
     }
     indent[count] = '\0';
-    ALOGD("%sStart display list (%p)", (char*) indent + 2, this);
+    ALOGD("%sStart display list (%p, %s)", (char*) indent + 2, this, mName.string());
 
     int saveCount = renderer.getSaveCount() - 1;
 
@@ -248,7 +252,7 @@
                 float f2 = getFloat();
                 float f3 = getFloat();
                 float f4 = getFloat();
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 int flags = getInt();
                 ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %p, 0x%x", (char*) indent,
                     OP_NAMES[op], f1, f2, f3, f4, paint, flags);
@@ -321,7 +325,7 @@
                 Layer* layer = (Layer*) getInt();
                 float x = getFloat();
                 float y = getFloat();
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 ALOGD("%s%s %p, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op],
                     layer, x, y, paint);
             }
@@ -330,7 +334,7 @@
                 SkBitmap* bitmap = getBitmap();
                 float x = getFloat();
                 float y = getFloat();
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 ALOGD("%s%s %p, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op],
                     bitmap, x, y, paint);
             }
@@ -338,7 +342,7 @@
             case DrawBitmapMatrix: {
                 SkBitmap* bitmap = getBitmap();
                 SkMatrix* matrix = getMatrix();
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 ALOGD("%s%s %p, %p, %p", (char*) indent, OP_NAMES[op],
                     bitmap, matrix, paint);
             }
@@ -353,7 +357,7 @@
                 float f6 = getFloat();
                 float f7 = getFloat();
                 float f8 = getFloat();
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 ALOGD("%s%s %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %p",
                     (char*) indent, OP_NAMES[op], bitmap, f1, f2, f3, f4, f5, f6, f7, f8, paint);
             }
@@ -367,7 +371,7 @@
                 float* vertices = getFloats(verticesCount);
                 bool hasColors = getInt();
                 int* colors = hasColors ? getInts(colorsCount) : NULL;
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 ALOGD("%s%s", (char*) indent, OP_NAMES[op]);
             }
             break;
@@ -386,7 +390,7 @@
                 float top = getFloat();
                 float right = getFloat();
                 float bottom = getFloat();
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 ALOGD("%s%s %.2f, %.2f, %.2f, %.2f", (char*) indent, OP_NAMES[op],
                         left, top, right, bottom);
             }
@@ -402,7 +406,7 @@
                 float f2 = getFloat();
                 float f3 = getFloat();
                 float f4 = getFloat();
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op],
                     f1, f2, f3, f4, paint);
             }
@@ -414,7 +418,7 @@
                 float f4 = getFloat();
                 float f5 = getFloat();
                 float f6 = getFloat();
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %p",
                     (char*) indent, OP_NAMES[op], f1, f2, f3, f4, f5, f6, paint);
             }
@@ -423,7 +427,7 @@
                 float f1 = getFloat();
                 float f2 = getFloat();
                 float f3 = getFloat();
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 ALOGD("%s%s %.2f, %.2f, %.2f, %p",
                     (char*) indent, OP_NAMES[op], f1, f2, f3, paint);
             }
@@ -433,7 +437,7 @@
                 float f2 = getFloat();
                 float f3 = getFloat();
                 float f4 = getFloat();
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %p",
                     (char*) indent, OP_NAMES[op], f1, f2, f3, f4, paint);
             }
@@ -446,28 +450,28 @@
                 float f5 = getFloat();
                 float f6 = getFloat();
                 int i1 = getInt();
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %d, %p",
                     (char*) indent, OP_NAMES[op], f1, f2, f3, f4, f5, f6, i1, paint);
             }
             break;
             case DrawPath: {
                 SkPath* path = getPath();
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 ALOGD("%s%s %p, %p", (char*) indent, OP_NAMES[op], path, paint);
             }
             break;
             case DrawLines: {
                 int count = 0;
                 float* points = getFloats(count);
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 ALOGD("%s%s", (char*) indent, OP_NAMES[op]);
             }
             break;
             case DrawPoints: {
                 int count = 0;
                 float* points = getFloats(count);
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 ALOGD("%s%s", (char*) indent, OP_NAMES[op]);
             }
             break;
@@ -476,12 +480,21 @@
                 int count = getInt();
                 float x = getFloat();
                 float y = getFloat();
-                SkPaint* paint = getPaint();
+                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 DrawPosText: {
+                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);
+            }
             case ResetShader: {
                 ALOGD("%s%s", (char*) indent, OP_NAMES[op]);
             }
@@ -513,6 +526,16 @@
                     radius, dx, dy, color);
             }
             break;
+            case ResetPaintFilter: {
+                ALOGD("%s%s", (char*) indent, OP_NAMES[op]);
+            }
+            break;
+            case SetupPaintFilter: {
+                int clearBits = getInt();
+                int setBits = getInt();
+                ALOGD("%s%s 0x%x, 0x%x", (char*) indent, OP_NAMES[op], clearBits, setBits);
+            }
+            break;
             default:
                 ALOGD("Display List error: op not handled: %s%s",
                     (char*) indent, OP_NAMES[op]);
@@ -540,9 +563,11 @@
         indent[i] = ' ';
     }
     indent[count] = '\0';
-    DISPLAY_LIST_LOGD("%sStart display list (%p)", (char*) indent + 2, this);
+    DISPLAY_LIST_LOGD("%sStart display list (%p, %s)", (char*) indent + 2, this, mName.string());
 #endif
 
+    renderer.startMark(mName.string());
+
     DisplayListLogBuffer& logBuffer = DisplayListLogBuffer::getInstance();
     int saveCount = renderer.getSaveCount() - 1;
     while (!mReader.eof()) {
@@ -553,7 +578,9 @@
             case DrawGLFunction: {
                 Functor *functor = (Functor *) getInt();
                 DISPLAY_LIST_LOGD("%s%s %p", (char*) indent, OP_NAMES[op], functor);
+                renderer.startMark("GL functor");
                 needsInvalidate |= renderer.callDrawGLFunction(functor, dirty);
+                renderer.endMark();
             }
             break;
             case Save: {
@@ -578,7 +605,7 @@
                 float f2 = getFloat();
                 float f3 = getFloat();
                 float f4 = getFloat();
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 int flags = getInt();
                 DISPLAY_LIST_LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %p, 0x%x", (char*) indent,
                     OP_NAMES[op], f1, f2, f3, f4, paint, flags);
@@ -661,7 +688,7 @@
                 Layer* layer = (Layer*) getInt();
                 float x = getFloat();
                 float y = getFloat();
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 DISPLAY_LIST_LOGD("%s%s %p, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op],
                     layer, x, y, paint);
                 renderer.drawLayer(layer, x, y, paint);
@@ -671,7 +698,7 @@
                 SkBitmap* bitmap = getBitmap();
                 float x = getFloat();
                 float y = getFloat();
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 DISPLAY_LIST_LOGD("%s%s %p, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op],
                     bitmap, x, y, paint);
                 renderer.drawBitmap(bitmap, x, y, paint);
@@ -680,7 +707,7 @@
             case DrawBitmapMatrix: {
                 SkBitmap* bitmap = getBitmap();
                 SkMatrix* matrix = getMatrix();
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 DISPLAY_LIST_LOGD("%s%s %p, %p, %p", (char*) indent, OP_NAMES[op],
                     bitmap, matrix, paint);
                 renderer.drawBitmap(bitmap, matrix, paint);
@@ -696,7 +723,7 @@
                 float f6 = getFloat();
                 float f7 = getFloat();
                 float f8 = getFloat();
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 DISPLAY_LIST_LOGD("%s%s %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %p",
                     (char*) indent, OP_NAMES[op], bitmap, f1, f2, f3, f4, f5, f6, f7, f8, paint);
                 renderer.drawBitmap(bitmap, f1, f2, f3, f4, f5, f6, f7, f8, paint);
@@ -712,7 +739,7 @@
                 float* vertices = getFloats(verticesCount);
                 bool hasColors = getInt();
                 int* colors = hasColors ? getInts(colorsCount) : NULL;
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
 
                 DISPLAY_LIST_LOGD("%s%s", (char*) indent, OP_NAMES[op]);
                 renderer.drawBitmapMesh(bitmap, meshWidth, meshHeight, vertices, colors, paint);
@@ -736,7 +763,7 @@
                 float top = getFloat();
                 float right = getFloat();
                 float bottom = getFloat();
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
 
                 DISPLAY_LIST_LOGD("%s%s", (char*) indent, OP_NAMES[op]);
                 renderer.drawPatch(bitmap, xDivs, yDivs, colors, xDivsCount, yDivsCount,
@@ -755,7 +782,7 @@
                 float f2 = getFloat();
                 float f3 = getFloat();
                 float f4 = getFloat();
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 DISPLAY_LIST_LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op],
                     f1, f2, f3, f4, paint);
                 renderer.drawRect(f1, f2, f3, f4, paint);
@@ -768,7 +795,7 @@
                 float f4 = getFloat();
                 float f5 = getFloat();
                 float f6 = getFloat();
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 DISPLAY_LIST_LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %p",
                     (char*) indent, OP_NAMES[op], f1, f2, f3, f4, f5, f6, paint);
                 renderer.drawRoundRect(f1, f2, f3, f4, f5, f6, paint);
@@ -778,7 +805,7 @@
                 float f1 = getFloat();
                 float f2 = getFloat();
                 float f3 = getFloat();
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 DISPLAY_LIST_LOGD("%s%s %.2f, %.2f, %.2f, %p",
                     (char*) indent, OP_NAMES[op], f1, f2, f3, paint);
                 renderer.drawCircle(f1, f2, f3, paint);
@@ -789,7 +816,7 @@
                 float f2 = getFloat();
                 float f3 = getFloat();
                 float f4 = getFloat();
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 DISPLAY_LIST_LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %p",
                     (char*) indent, OP_NAMES[op], f1, f2, f3, f4, paint);
                 renderer.drawOval(f1, f2, f3, f4, paint);
@@ -803,7 +830,7 @@
                 float f5 = getFloat();
                 float f6 = getFloat();
                 int i1 = getInt();
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 DISPLAY_LIST_LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %d, %p",
                     (char*) indent, OP_NAMES[op], f1, f2, f3, f4, f5, f6, i1, paint);
                 renderer.drawArc(f1, f2, f3, f4, f5, f6, i1 == 1, paint);
@@ -811,7 +838,7 @@
             break;
             case DrawPath: {
                 SkPath* path = getPath();
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 DISPLAY_LIST_LOGD("%s%s %p, %p", (char*) indent, OP_NAMES[op], path, paint);
                 renderer.drawPath(path, paint);
             }
@@ -819,7 +846,7 @@
             case DrawLines: {
                 int count = 0;
                 float* points = getFloats(count);
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 DISPLAY_LIST_LOGD("%s%s", (char*) indent, OP_NAMES[op]);
                 renderer.drawLines(points, count, paint);
             }
@@ -827,7 +854,7 @@
             case DrawPoints: {
                 int count = 0;
                 float* points = getFloats(count);
-                SkPaint* paint = getPaint();
+                SkPaint* paint = getPaint(renderer);
                 DISPLAY_LIST_LOGD("%s%s", (char*) indent, OP_NAMES[op]);
                 renderer.drawPoints(points, count, paint);
             }
@@ -837,13 +864,24 @@
                 int count = getInt();
                 float x = getFloat();
                 float y = getFloat();
-                SkPaint* paint = getPaint();
+                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);
                 renderer.drawText(text.text(), text.length(), count, x, y, paint, length);
             }
             break;
+            case DrawPosText: {
+                getText(&text);
+                int count = getInt();
+                int positionsCount = 0;
+                float* positions = getFloats(positionsCount);
+                SkPaint* paint = getPaint(renderer);
+                DISPLAY_LIST_LOGD("%s%s %s, %d, %d, %p", (char*) indent,
+                        OP_NAMES[op], text.text(), text.length(), count, paint);
+                renderer.drawPosText(text.text(), text.length(), count, positions, paint);
+            }
+            break;
             case ResetShader: {
                 DISPLAY_LIST_LOGD("%s%s", (char*) indent, OP_NAMES[op]);
                 renderer.resetShader();
@@ -881,6 +919,19 @@
                 renderer.setupShadow(radius, dx, dy, color);
             }
             break;
+            case ResetPaintFilter: {
+                DISPLAY_LIST_LOGD("%s%s", (char*) indent, OP_NAMES[op]);
+                renderer.resetPaintFilter();
+            }
+            break;
+            case SetupPaintFilter: {
+                int clearBits = getInt();
+                int setBits = getInt();
+                DISPLAY_LIST_LOGD("%s%s 0x%x, 0x%x", (char*) indent, OP_NAMES[op],
+                        clearBits, setBits);
+                renderer.setupPaintFilter(clearBits, setBits);
+            }
+            break;
             default:
                 DISPLAY_LIST_LOGD("Display List error: op not handled: %s%s",
                     (char*) indent, OP_NAMES[op]);
@@ -888,6 +939,8 @@
         }
     }
 
+    renderer.endMark();
+
     DISPLAY_LIST_LOGD("%sDone, returning %d", (char*) indent + 2, needsInvalidate);
     return needsInvalidate;
 }
@@ -1216,6 +1269,17 @@
     addFloat(length < 0.0f ? paint->measureText(text, bytesCount) : length);
 }
 
+void DisplayListRenderer::drawPosText(const char* text, int bytesCount, int count,
+        const float* positions, SkPaint* paint) {
+    if (count <= 0) return;
+    addOp(DisplayList::DrawPosText);
+    addText(text, bytesCount);
+    addInt(count);
+    addFloats(positions, count * 2);
+    paint->setAntiAlias(true);
+    addPaint(paint);
+}
+
 void DisplayListRenderer::resetShader() {
     addOp(DisplayList::ResetShader);
 }
@@ -1245,5 +1309,15 @@
     addInt(color);
 }
 
+void DisplayListRenderer::resetPaintFilter() {
+    addOp(DisplayList::ResetPaintFilter);
+}
+
+void DisplayListRenderer::setupPaintFilter(int clearBits, int setBits) {
+    addOp(DisplayList::SetupPaintFilter);
+    addInt(clearBits);
+    addInt(setBits);
+}
+
 }; // namespace uirenderer
 }; // namespace android
diff --git a/libs/hwui/DisplayListRenderer.h b/libs/hwui/DisplayListRenderer.h
index 5d922db..46506e4 100644
--- a/libs/hwui/DisplayListRenderer.h
+++ b/libs/hwui/DisplayListRenderer.h
@@ -28,6 +28,8 @@
 
 #include <cutils/compiler.h>
 
+#include <utils/String8.h>
+
 #include "DisplayListLogBuffer.h"
 #include "OpenGLRenderer.h"
 #include "utils/Functor.h"
@@ -96,12 +98,15 @@
         DrawLines,
         DrawPoints,
         DrawText,
+        DrawPosText,
         ResetShader,
         SetupShader,
         ResetColorFilter,
         SetupColorFilter,
         ResetShadow,
         SetupShadow,
+        ResetPaintFilter,
+        SetupPaintFilter,
         DrawGLFunction,
     };
 
@@ -125,6 +130,12 @@
         return mIsRenderable;
     }
 
+    void setName(const char* name) {
+        if (name) {
+            mName.setTo(name);
+        }
+    }
+
 private:
     void init();
 
@@ -176,8 +187,8 @@
         return (SkPath*) getInt();
     }
 
-    SkPaint* getPaint() {
-        return (SkPaint*) getInt();
+    SkPaint* getPaint(OpenGLRenderer& renderer) {
+        return renderer.filterPaint((SkPaint*) getInt());
     }
 
     DisplayList* getDisplayList() {
@@ -221,6 +232,8 @@
     size_t mSize;
 
     bool mIsRenderable;
+
+    String8 mName;
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -291,6 +304,8 @@
     virtual void drawPoints(float* points, int count, SkPaint* paint);
     virtual void drawText(const char* text, int bytesCount, int count, float x, float y,
             SkPaint* paint, float length = 1.0f);
+    virtual void drawPosText(const char* text, int bytesCount, int count, const float* positions,
+            SkPaint* paint);
 
     virtual void resetShader();
     virtual void setupShader(SkiaShader* shader);
@@ -301,6 +316,9 @@
     virtual void resetShadow();
     virtual void setupShadow(float radius, float dx, float dy, int color);
 
+    virtual void resetPaintFilter();
+    virtual void setupPaintFilter(int clearBits, int setBits);
+
     ANDROID_API void reset();
 
     const SkWriter32& writeStream() const {
@@ -419,7 +437,7 @@
             return;
         }
 
-        SkPaint* paintCopy =  mPaintMap.valueFor(paint);
+        SkPaint* paintCopy = mPaintMap.valueFor(paint);
         if (paintCopy == NULL || paintCopy->getGenerationID() != paint->getGenerationID()) {
             paintCopy = new SkPaint(*paint);
             mPaintMap.add(paint, paintCopy);
diff --git a/libs/hwui/Extensions.h b/libs/hwui/Extensions.h
index 1069e3f..f11fecc 100644
--- a/libs/hwui/Extensions.h
+++ b/libs/hwui/Extensions.h
@@ -67,6 +67,7 @@
         mHasNPot = hasExtension("GL_OES_texture_npot");
         mHasFramebufferFetch = hasExtension("GL_NV_shader_framebuffer_fetch");
         mHasDiscardFramebuffer = hasExtension("GL_EXT_discard_framebuffer");
+        mHasDebugMarker = hasExtension("GL_EXT_debug_marker");
 
         const char* vendor = (const char*) glGetString(GL_VENDOR);
         EXT_LOGD("Vendor: %s", vendor);
@@ -82,6 +83,7 @@
     inline bool hasFramebufferFetch() const { return mHasFramebufferFetch; }
     inline bool needsHighpTexCoords() const { return mNeedsHighpTexCoords; }
     inline bool hasDiscardFramebuffer() const { return mHasDiscardFramebuffer; }
+    inline bool hasDebugMarker() const { return mHasDebugMarker; }
 
     bool hasExtension(const char* extension) const {
         const String8 s(extension);
@@ -101,6 +103,7 @@
     bool mNeedsHighpTexCoords;
     bool mHasFramebufferFetch;
     bool mHasDiscardFramebuffer;
+    bool mHasDebugMarker;
 }; // class Extensions
 
 }; // namespace uirenderer
diff --git a/libs/hwui/FontRenderer.cpp b/libs/hwui/FontRenderer.cpp
index 790c143..3df105b 100644
--- a/libs/hwui/FontRenderer.cpp
+++ b/libs/hwui/FontRenderer.cpp
@@ -94,7 +94,8 @@
     }
 }
 
-void Font::measureCachedGlyph(CachedGlyphInfo *glyph, int x, int y, Rect *bounds) {
+void Font::measureCachedGlyph(CachedGlyphInfo *glyph, int x, int y,
+        uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, const float* pos) {
     int nPenX = x + glyph->mBitmapLeft;
     int nPenY = y + glyph->mBitmapTop;
 
@@ -115,7 +116,8 @@
     }
 }
 
-void Font::drawCachedGlyph(CachedGlyphInfo* glyph, int x, int y) {
+void Font::drawCachedGlyph(CachedGlyphInfo* glyph, int x, int y,
+        uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, const float* pos) {
     int nPenX = x + glyph->mBitmapLeft;
     int nPenY = y + glyph->mBitmapTop + glyph->mBitmapHeight;
 
@@ -133,8 +135,8 @@
             nPenX, nPenY - height, u1, v1, glyph->mCachedTextureLine->mCacheTexture);
 }
 
-void Font::drawCachedGlyph(CachedGlyphInfo* glyph, int x, int y,
-        uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH) {
+void Font::drawCachedGlyphBitmap(CachedGlyphInfo* glyph, int x, int y,
+        uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, const float* pos) {
     int nPenX = x + glyph->mBitmapLeft;
     int nPenY = y + glyph->mBitmapTop;
 
@@ -149,10 +151,12 @@
     int32_t bX = 0, bY = 0;
     for (cacheX = glyph->mStartX, bX = nPenX; cacheX < endX; cacheX++, bX++) {
         for (cacheY = glyph->mStartY, bY = nPenY; cacheY < endY; cacheY++, bY++) {
+#if DEBUG_FONT_RENDERER
             if (bX < 0 || bY < 0 || bX >= (int32_t) bitmapW || bY >= (int32_t) bitmapH) {
                 ALOGE("Skipping invalid index");
                 continue;
             }
+#endif
             uint8_t tempCol = cacheBuffer[cacheY * cacheWidth + cacheX];
             bitmap[bY * bitmapW + bX] = tempCol;
         }
@@ -181,13 +185,19 @@
         int numGlyphs, int x, int y, uint8_t *bitmap, uint32_t bitmapW, uint32_t bitmapH) {
     if (bitmap != NULL && bitmapW > 0 && bitmapH > 0) {
         render(paint, text, start, len, numGlyphs, x, y, BITMAP, bitmap,
-                bitmapW, bitmapH, NULL);
+                bitmapW, bitmapH, NULL, NULL);
     } else {
         render(paint, text, start, len, numGlyphs, x, y, FRAMEBUFFER, NULL,
-                0, 0, NULL);
+                0, 0, NULL, NULL);
     }
 }
 
+void Font::render(SkPaint* paint, const char *text, uint32_t start, uint32_t len,
+            int numGlyphs, int x, int y, const float* positions) {
+    render(paint, text, start, len, numGlyphs, x, y, FRAMEBUFFER, NULL,
+            0, 0, NULL, positions);
+}
+
 void Font::measure(SkPaint* paint, const char* text, uint32_t start, uint32_t len,
         int numGlyphs, Rect *bounds) {
     if (bounds == NULL) {
@@ -195,62 +205,95 @@
         return;
     }
     bounds->set(1e6, -1e6, -1e6, 1e6);
-    render(paint, text, start, len, numGlyphs, 0, 0, MEASURE, NULL, 0, 0, bounds);
+    render(paint, text, start, len, numGlyphs, 0, 0, MEASURE, NULL, 0, 0, bounds, NULL);
 }
 
 #define SkAutoKern_AdjustF(prev, next) (((next) - (prev) + 32) >> 6 << 16)
 
 void Font::render(SkPaint* paint, const char* text, uint32_t start, uint32_t len,
         int numGlyphs, int x, int y, RenderMode mode, uint8_t *bitmap,
-        uint32_t bitmapW, uint32_t bitmapH,Rect *bounds) {
+        uint32_t bitmapW, uint32_t bitmapH, Rect *bounds, const float* positions) {
     if (numGlyphs == 0 || text == NULL || len == 0) {
         return;
     }
 
-    float penX = x;
-    int penY = y;
-    int glyphsLeft = 1;
-    if (numGlyphs > 0) {
-        glyphsLeft = numGlyphs;
-    }
-
-    SkFixed prevRsbDelta = 0;
-    penX += 0.5f;
+    int glyphsCount = 0;
 
     text += start;
 
-    while (glyphsLeft > 0) {
-        glyph_t glyph = GET_GLYPH(text);
+    static RenderGlyph gRenderGlyph[] = {
+            &android::uirenderer::Font::drawCachedGlyph,
+            &android::uirenderer::Font::drawCachedGlyphBitmap,
+            &android::uirenderer::Font::measureCachedGlyph
+    };
+    RenderGlyph render = gRenderGlyph[mode];
 
-        // Reached the end of the string
-        if (IS_END_OF_STRING(glyph)) {
-            break;
-        }
+    if (CC_LIKELY(positions == NULL)) {
+        SkFixed prevRsbDelta = 0;
 
-        CachedGlyphInfo* cachedGlyph = getCachedGlyph(paint, glyph);
-        penX += SkFixedToFloat(SkAutoKern_AdjustF(prevRsbDelta, cachedGlyph->mLsbDelta));
-        prevRsbDelta = cachedGlyph->mRsbDelta;
+        float penX = x;
+        int penY = y;
 
-        // If it's still not valid, we couldn't cache it, so we shouldn't draw garbage
-        if (cachedGlyph->mIsValid) {
-            switch(mode) {
-            case FRAMEBUFFER:
-                drawCachedGlyph(cachedGlyph, (int) floorf(penX), penY);
-                break;
-            case BITMAP:
-                drawCachedGlyph(cachedGlyph, (int) floorf(penX), penY, bitmap, bitmapW, bitmapH);
-                break;
-            case MEASURE:
-                measureCachedGlyph(cachedGlyph, (int) floorf(penX), penY, bounds);
+        penX += 0.5f;
+
+        while (glyphsCount < numGlyphs) {
+            glyph_t glyph = GET_GLYPH(text);
+
+            // Reached the end of the string
+            if (IS_END_OF_STRING(glyph)) {
                 break;
             }
+
+            CachedGlyphInfo* cachedGlyph = getCachedGlyph(paint, glyph);
+            penX += SkFixedToFloat(SkAutoKern_AdjustF(prevRsbDelta, cachedGlyph->mLsbDelta));
+            prevRsbDelta = cachedGlyph->mRsbDelta;
+
+            // If it's still not valid, we couldn't cache it, so we shouldn't draw garbage
+            if (cachedGlyph->mIsValid) {
+                (*this.*render)(cachedGlyph, (int) floorf(penX), penY,
+                        bitmap, bitmapW, bitmapH, bounds, positions);
+            }
+
+            penX += SkFixedToFloat(cachedGlyph->mAdvanceX);
+
+            glyphsCount++;
         }
+    } else {
+        const SkPaint::Align align = paint->getTextAlign();
 
-        penX += SkFixedToFloat(cachedGlyph->mAdvanceX);
+        // This is for renderPosText()
+        while (glyphsCount < numGlyphs) {
+            glyph_t glyph = GET_GLYPH(text);
 
-        // If we were given a specific number of glyphs, decrement
-        if (numGlyphs > 0) {
-            glyphsLeft--;
+            // Reached the end of the string
+            if (IS_END_OF_STRING(glyph)) {
+                break;
+            }
+
+            CachedGlyphInfo* cachedGlyph = getCachedGlyph(paint, glyph);
+
+            // If it's still not valid, we couldn't cache it, so we shouldn't draw garbage
+            if (cachedGlyph->mIsValid) {
+                int penX = x + positions[(glyphsCount << 1)];
+                int penY = y + positions[(glyphsCount << 1) + 1];
+
+                switch (align) {
+                    case SkPaint::kRight_Align:
+                        penX -= SkFixedToFloat(cachedGlyph->mAdvanceX);
+                        penY -= SkFixedToFloat(cachedGlyph->mAdvanceY);
+                        break;
+                    case SkPaint::kCenter_Align:
+                        penX -= SkFixedToFloat(cachedGlyph->mAdvanceX >> 1);
+                        penY -= SkFixedToFloat(cachedGlyph->mAdvanceY >> 1);
+                    default:
+                        break;
+                }
+
+                (*this.*render)(cachedGlyph, penX, penY,
+                        bitmap, bitmapW, bitmapH, bounds, positions);
+            }
+
+            glyphsCount++;
         }
     }
 }
@@ -866,21 +909,15 @@
     return image;
 }
 
-bool FontRenderer::renderText(SkPaint* paint, const Rect* clip, const char *text,
-        uint32_t startIndex, uint32_t len, int numGlyphs, int x, int y, Rect* bounds) {
+void FontRenderer::initRender(const Rect* clip, Rect* bounds) {
     checkInit();
 
-    if (!mCurrentFont) {
-        ALOGE("No font set");
-        return false;
-    }
-
     mDrawn = false;
     mBounds = bounds;
     mClip = clip;
+}
 
-    mCurrentFont->render(paint, text, startIndex, len, numGlyphs, x, y);
-
+void FontRenderer::finishRender() {
     mBounds = NULL;
     mClip = NULL;
 
@@ -888,6 +925,33 @@
         issueDrawCommand();
         mCurrentQuadIndex = 0;
     }
+}
+
+bool FontRenderer::renderText(SkPaint* paint, const Rect* clip, const char *text,
+        uint32_t startIndex, uint32_t len, int numGlyphs, int x, int y, Rect* bounds) {
+    if (!mCurrentFont) {
+        ALOGE("No font set");
+        return false;
+    }
+
+    initRender(clip, bounds);
+    mCurrentFont->render(paint, text, startIndex, len, numGlyphs, x, y);
+    finishRender();
+
+    return mDrawn;
+}
+
+bool FontRenderer::renderPosText(SkPaint* paint, const Rect* clip, const char *text,
+        uint32_t startIndex, uint32_t len, int numGlyphs, int x, int y,
+        const float* positions, Rect* bounds) {
+    if (!mCurrentFont) {
+        ALOGE("No font set");
+        return false;
+    }
+
+    initRender(clip, bounds);
+    mCurrentFont->render(paint, text, startIndex, len, numGlyphs, x, y, positions);
+    finishRender();
 
     return mDrawn;
 }
diff --git a/libs/hwui/FontRenderer.h b/libs/hwui/FontRenderer.h
index 005cdde..b767be5 100644
--- a/libs/hwui/FontRenderer.h
+++ b/libs/hwui/FontRenderer.h
@@ -151,6 +151,10 @@
     void render(SkPaint* paint, const char *text, uint32_t start, uint32_t len,
             int numGlyphs, int x, int y, uint8_t *bitmap = NULL,
             uint32_t bitmapW = 0, uint32_t bitmapH = 0);
+
+    void render(SkPaint* paint, const char *text, uint32_t start, uint32_t len,
+            int numGlyphs, int x, int y, const float* positions);
+
     /**
      * Creates a new font associated with the specified font state.
      */
@@ -160,6 +164,8 @@
 
 protected:
     friend class FontRenderer;
+    typedef void (Font::*RenderGlyph)(CachedGlyphInfo*, int, int, uint8_t*,
+            uint32_t, uint32_t, Rect*, const float*);
 
     enum RenderMode {
         FRAMEBUFFER,
@@ -169,7 +175,7 @@
 
     void render(SkPaint* paint, const char *text, uint32_t start, uint32_t len,
             int numGlyphs, int x, int y, RenderMode mode, uint8_t *bitmap,
-            uint32_t bitmapW, uint32_t bitmapH, Rect *bounds);
+            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);
@@ -183,11 +189,17 @@
     void invalidateTextureCache(CacheTextureLine *cacheLine = NULL);
 
     CachedGlyphInfo* cacheGlyph(SkPaint* paint, glyph_t glyph);
-    void updateGlyphCache(SkPaint* paint, const SkGlyph& skiaGlyph, CachedGlyphInfo *glyph);
-    void measureCachedGlyph(CachedGlyphInfo *glyph, int x, int y, Rect *bounds);
-    void drawCachedGlyph(CachedGlyphInfo *glyph, int x, int y);
-    void drawCachedGlyph(CachedGlyphInfo *glyph, int x, int y,
-            uint8_t *bitmap, uint32_t bitmapW, uint32_t bitmapH);
+    void updateGlyphCache(SkPaint* paint, const SkGlyph& skiaGlyph, CachedGlyphInfo* glyph);
+
+    void measureCachedGlyph(CachedGlyphInfo* glyph, int x, int y,
+            uint8_t *bitmap, uint32_t bitmapW, uint32_t bitmapH,
+            Rect* bounds, const float* pos);
+    void drawCachedGlyph(CachedGlyphInfo* glyph, int x, int y,
+            uint8_t *bitmap, uint32_t bitmapW, uint32_t bitmapH,
+            Rect* bounds, const float* pos);
+    void drawCachedGlyphBitmap(CachedGlyphInfo* glyph, int x, int y,
+            uint8_t *bitmap, uint32_t bitmapW, uint32_t bitmapH,
+            Rect* bounds, const float* pos);
 
     CachedGlyphInfo* getCachedGlyph(SkPaint* paint, glyph_t textUnit);
 
@@ -226,8 +238,12 @@
     }
 
     void setFont(SkPaint* paint, uint32_t fontId, float fontSize);
+    // bounds is an out parameter
     bool renderText(SkPaint* paint, const Rect* clip, const char *text, uint32_t startIndex,
             uint32_t len, int numGlyphs, int x, int y, Rect* bounds);
+    // bounds is an out parameter
+    bool renderPosText(SkPaint* paint, const Rect* clip, const char *text, uint32_t startIndex,
+            uint32_t len, int numGlyphs, int x, int y, const float* positions, Rect* bounds);
 
     struct DropShadow {
         DropShadow() { };
@@ -297,6 +313,8 @@
     void initVertexArrayBuffers();
 
     void checkInit();
+    void initRender(const Rect* clip, Rect* bounds);
+    void finishRender();
 
     String16 mLatinPrecache;
     void precacheLatin(SkPaint* paint);
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 12ed205..afae70f 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -111,6 +111,7 @@
     mShader = NULL;
     mColorFilter = NULL;
     mHasShadow = false;
+    mHasDrawFilter = false;
 
     memcpy(mMeshVertices, gMeshVertices, sizeof(gMeshVertices));
 
@@ -123,9 +124,25 @@
 }
 
 ///////////////////////////////////////////////////////////////////////////////
+// Debug
+///////////////////////////////////////////////////////////////////////////////
+
+void OpenGLRenderer::startMark(const char* name) const {
+    mCaches.startMark(0, name);
+}
+
+void OpenGLRenderer::endMark() const {
+    mCaches.endMark();
+}
+
+///////////////////////////////////////////////////////////////////////////////
 // Setup
 ///////////////////////////////////////////////////////////////////////////////
 
+uint32_t OpenGLRenderer::getStencilSize() {
+    return STENCIL_BUFFER_SIZE;
+}
+
 void OpenGLRenderer::setViewport(int width, int height) {
     mOrthoMatrix.loadOrtho(0, width, height, 0, -1, 1);
 
@@ -737,7 +754,7 @@
 
     // TODO: See LayerRenderer.cpp::generateMesh() for important
     //       information about this implementation
-    if (!layer->region.isEmpty()) {
+    if (CC_LIKELY(!layer->region.isEmpty())) {
         size_t count;
         const android::Rect* rects = layer->region.getArray(&count);
 
@@ -1381,7 +1398,7 @@
     if (!texture) return;
     const AutoTexture autoCleanup(texture);
 
-    if (bitmap->getConfig() == SkBitmap::kA8_Config) {
+    if (CC_UNLIKELY(bitmap->getConfig() == SkBitmap::kA8_Config)) {
         drawAlphaBitmap(texture, left, top, paint);
     } else {
         drawTextureRect(left, top, right, bottom, texture, paint);
@@ -1437,9 +1454,9 @@
     float bottom = FLT_MIN;
 
 #if RENDER_LAYERS_AS_REGIONS
-    bool hasActiveLayer = hasLayer();
+    const bool hasActiveLayer = hasLayer();
 #else
-    bool hasActiveLayer = false;
+    const bool hasActiveLayer = false;
 #endif
 
     // TODO: Support the colors array
@@ -1524,7 +1541,7 @@
 
     texture->setWrap(GL_CLAMP_TO_EDGE, true);
 
-    if (mSnapshot->transform->isPureTranslate()) {
+    if (CC_LIKELY(mSnapshot->transform->isPureTranslate())) {
         const float x = (int) floorf(dstLeft + mSnapshot->transform->getTranslateX() + 0.5f);
         const float y = (int) floorf(dstTop + mSnapshot->transform->getTranslateY() + 0.5f);
 
@@ -1570,7 +1587,7 @@
     const Patch* mesh = mCaches.patchCache.get(bitmap->width(), bitmap->height(),
             right - left, bottom - top, xDivs, yDivs, colors, width, height, numColors);
 
-    if (mesh && mesh->verticesCount > 0) {
+    if (CC_LIKELY(mesh && mesh->verticesCount > 0)) {
         const bool pureTranslate = mSnapshot->transform->isPureTranslate();
 #if RENDER_LAYERS_AS_REGIONS
         // Mark the current layer dirty where we are going to draw the patch
@@ -1580,7 +1597,7 @@
             const size_t count = mesh->quads.size();
             for (size_t i = 0; i < count; i++) {
                 const Rect& bounds = mesh->quads.itemAt(i);
-                if (pureTranslate) {
+                if (CC_LIKELY(pureTranslate)) {
                     const float x = (int) floorf(bounds.left + offsetX + 0.5f);
                     const float y = (int) floorf(bounds.top + offsetY + 0.5f);
                     dirtyLayer(x, y, x + bounds.getWidth(), y + bounds.getHeight());
@@ -1592,7 +1609,7 @@
         }
 #endif
 
-        if (pureTranslate) {
+        if (CC_LIKELY(pureTranslate)) {
             const float x = (int) floorf(left + mSnapshot->transform->getTranslateX() + 0.5f);
             const float y = (int) floorf(top + mSnapshot->transform->getTranslateY() + 0.5f);
 
@@ -1620,7 +1637,7 @@
     float inverseScaleX = 1.0f;
     float inverseScaleY = 1.0f;
     // The quad that we use needs to account for scaling.
-    if (!mSnapshot->transform->isPureTranslate()) {
+    if (CC_UNLIKELY(!mSnapshot->transform->isPureTranslate())) {
         Matrix4 *mat = mSnapshot->transform;
         float m00 = mat->data[Matrix4::kScaleX];
         float m01 = mat->data[Matrix4::kSkewY];
@@ -1726,7 +1743,7 @@
         // The quad that we use for AA and hairlines needs to account for scaling. For hairlines
         // the line on the screen should always be one pixel wide regardless of scale. For
         // AA lines, we only want one pixel of translucent boundary around the quad.
-        if (!mSnapshot->transform->isPureTranslate()) {
+        if (CC_UNLIKELY(!mSnapshot->transform->isPureTranslate())) {
             Matrix4 *mat = mSnapshot->transform;
             float m00 = mat->data[Matrix4::kScaleX];
             float m01 = mat->data[Matrix4::kSkewY];
@@ -1734,8 +1751,8 @@
             float m10 = mat->data[Matrix4::kSkewX];
             float m11 = mat->data[Matrix4::kScaleX];
             float m12 = mat->data[6];
-            float scaleX = sqrt(m00*m00 + m01*m01);
-            float scaleY = sqrt(m10*m10 + m11*m11);
+            float scaleX = sqrtf(m00 * m00 + m01 * m01);
+            float scaleY = sqrtf(m10 * m10 + m11 * m11);
             inverseScaleX = (scaleX != 0) ? (inverseScaleX / scaleX) : 0;
             inverseScaleY = (scaleY != 0) ? (inverseScaleY / scaleY) : 0;
             if (inverseScaleX != 1.0f || inverseScaleY != 1.0f) {
@@ -1753,11 +1770,7 @@
     setupDrawColor(paint->getColor(), alpha);
     setupDrawColorFilter();
     setupDrawShader();
-    if (isAA) {
-        setupDrawBlending(true, mode);
-    } else {
-        setupDrawBlending(mode);
-    }
+    setupDrawBlending(isAA, mode);
     setupDrawProgram();
     setupDrawModelViewIdentity(true);
     setupDrawColorUniforms();
@@ -1775,7 +1788,7 @@
     Vertex* vertices = &lines[0];
     AAVertex wLines[verticesCount];
     AAVertex* aaVertices = &wLines[0];
-    if (!isAA) {
+    if (CC_UNLIKELY(!isAA)) {
         setupDrawVertices(vertices);
     } else {
         void* widthCoords = ((GLbyte*) aaVertices) + gVertexAAWidthOffset;
@@ -2082,14 +2095,83 @@
     }
 }
 
-void OpenGLRenderer::drawText(const char* text, int bytesCount, int count,
-        float x, float y, SkPaint* paint, float length) {
-    if (text == NULL || count == 0) {
+void OpenGLRenderer::drawPosText(const char* text, int bytesCount, int count,
+        const float* positions, SkPaint* paint) {
+    if (text == NULL || count == 0 || mSnapshot->isIgnored() ||
+            (paint->getAlpha() == 0 && paint->getXfermode() == NULL)) {
         return;
     }
-    if (mSnapshot->isIgnored()) return;
 
-    // NOTE: AA and glyph id encoding are set in DisplayListRenderer.cpp
+    // NOTE: Skia does not support perspective transform on drawPosText yet
+    if (!mSnapshot->transform->isSimple()) {
+        return;
+    }
+
+    float x = 0.0f;
+    float y = 0.0f;
+    const bool pureTranslate = mSnapshot->transform->isPureTranslate();
+    if (pureTranslate) {
+        x = (int) floorf(x + mSnapshot->transform->getTranslateX() + 0.5f);
+        y = (int) floorf(y + mSnapshot->transform->getTranslateY() + 0.5f);
+    }
+
+    FontRenderer& fontRenderer = mCaches.fontRenderer.getFontRenderer(paint);
+    fontRenderer.setFont(paint, SkTypeface::UniqueID(paint->getTypeface()),
+            paint->getTextSize());
+
+    int alpha;
+    SkXfermode::Mode mode;
+    getAlphaAndMode(paint, &alpha, &mode);
+
+    // Pick the appropriate texture filtering
+    bool linearFilter = mSnapshot->transform->changesBounds();
+    if (pureTranslate && !linearFilter) {
+        linearFilter = fabs(y - (int) y) > 0.0f || fabs(x - (int) x) > 0.0f;
+    }
+
+    mCaches.activeTexture(0);
+    setupDraw();
+    setupDrawDirtyRegionsDisabled();
+    setupDrawWithTexture(true);
+    setupDrawAlpha8Color(paint->getColor(), alpha);
+    setupDrawColorFilter();
+    setupDrawShader();
+    setupDrawBlending(true, mode);
+    setupDrawProgram();
+    setupDrawModelView(x, y, x, y, pureTranslate, true);
+    setupDrawTexture(fontRenderer.getTexture(linearFilter));
+    setupDrawPureColorUniforms();
+    setupDrawColorFilterUniforms();
+    setupDrawShaderUniforms(pureTranslate);
+
+    const Rect* clip = pureTranslate ? mSnapshot->clipRect : &mSnapshot->getLocalClip();
+    Rect bounds(FLT_MAX / 2.0f, FLT_MAX / 2.0f, FLT_MIN / 2.0f, FLT_MIN / 2.0f);
+
+#if RENDER_LAYERS_AS_REGIONS
+    const bool hasActiveLayer = hasLayer();
+#else
+    const bool hasActiveLayer = false;
+#endif
+
+    if (fontRenderer.renderPosText(paint, clip, text, 0, bytesCount, count, x, y,
+            positions, hasActiveLayer ? &bounds : NULL)) {
+#if RENDER_LAYERS_AS_REGIONS
+        if (hasActiveLayer) {
+            if (!pureTranslate) {
+                mSnapshot->transform->mapRect(bounds);
+            }
+            dirtyLayerUnchecked(bounds, getRegion());
+        }
+#endif
+    }
+}
+
+void OpenGLRenderer::drawText(const char* text, int bytesCount, int count,
+        float x, float y, SkPaint* paint, float length) {
+    if (text == NULL || count == 0 || mSnapshot->isIgnored() ||
+            (paint->getAlpha() == 0 && paint->getXfermode() == NULL)) {
+        return;
+    }
 
     switch (paint->getTextAlign()) {
         case SkPaint::kCenter_Align:
@@ -2115,15 +2197,16 @@
     const float oldX = x;
     const float oldY = y;
     const bool pureTranslate = mSnapshot->transform->isPureTranslate();
-    if (pureTranslate) {
+    if (CC_LIKELY(pureTranslate)) {
         x = (int) floorf(x + mSnapshot->transform->getTranslateX() + 0.5f);
         y = (int) floorf(y + mSnapshot->transform->getTranslateY() + 0.5f);
     }
 
-    FontRenderer& fontRenderer = mCaches.fontRenderer.getFontRenderer(paint);
 #if DEBUG_GLYPHS
     ALOGD("OpenGLRenderer drawText() with FontID=%d", SkTypeface::UniqueID(paint->getTypeface()));
 #endif
+
+    FontRenderer& fontRenderer = mCaches.fontRenderer.getFontRenderer(paint);
     fontRenderer.setFont(paint, SkTypeface::UniqueID(paint->getTypeface()),
             paint->getTextSize());
 
@@ -2131,7 +2214,7 @@
     SkXfermode::Mode mode;
     getAlphaAndMode(paint, &alpha, &mode);
 
-    if (mHasShadow) {
+    if (CC_UNLIKELY(mHasShadow)) {
         mCaches.activeTexture(0);
 
         mCaches.dropShadowCache.setFontRenderer(fontRenderer);
@@ -2165,10 +2248,6 @@
         glDrawArrays(GL_TRIANGLE_STRIP, 0, gMeshCount);
     }
 
-    if (paint->getAlpha() == 0 && paint->getXfermode() == NULL) {
-        return;
-    }
-
     // Pick the appropriate texture filtering
     bool linearFilter = mSnapshot->transform->changesBounds();
     if (pureTranslate && !linearFilter) {
@@ -2194,9 +2273,9 @@
     Rect bounds(FLT_MAX / 2.0f, FLT_MAX / 2.0f, FLT_MIN / 2.0f, FLT_MIN / 2.0f);
 
 #if RENDER_LAYERS_AS_REGIONS
-    bool hasActiveLayer = hasLayer();
+    const bool hasActiveLayer = hasLayer();
 #else
-    bool hasActiveLayer = false;
+    const bool hasActiveLayer = false;
 #endif
 
     if (fontRenderer.renderText(paint, clip, text, 0, bytesCount, count, x, y,
@@ -2243,7 +2322,7 @@
     layer->setAlpha(alpha, mode);
 
 #if RENDER_LAYERS_AS_REGIONS
-    if (!layer->region.isEmpty()) {
+    if (CC_LIKELY(!layer->region.isEmpty())) {
         if (layer->region.isRect()) {
             composeLayerRect(layer, layer->regionRect);
         } else if (layer->mesh) {
@@ -2259,7 +2338,7 @@
             setupDrawPureColorUniforms();
             setupDrawColorFilterUniforms();
             setupDrawTexture(layer->getTexture());
-            if (mSnapshot->transform->isPureTranslate()) {
+            if (CC_LIKELY(mSnapshot->transform->isPureTranslate())) {
                 x = (int) floorf(x + mSnapshot->transform->getTranslateX() + 0.5f);
                 y = (int) floorf(y + mSnapshot->transform->getTranslateY() + 0.5f);
 
@@ -2333,6 +2412,31 @@
 }
 
 ///////////////////////////////////////////////////////////////////////////////
+// Draw filters
+///////////////////////////////////////////////////////////////////////////////
+
+void OpenGLRenderer::resetPaintFilter() {
+    mHasDrawFilter = false;
+}
+
+void OpenGLRenderer::setupPaintFilter(int clearBits, int setBits) {
+    mHasDrawFilter = true;
+    mPaintFilterClearBits = clearBits & SkPaint::kAllFlags;
+    mPaintFilterSetBits = setBits & SkPaint::kAllFlags;
+}
+
+SkPaint* OpenGLRenderer::filterPaint(SkPaint* paint) {
+    if (!mHasDrawFilter || !paint) return paint;
+
+    uint32_t flags = paint->getFlags();
+
+    mFilteredPaint = *paint;
+    mFilteredPaint.setFlags((flags & ~mPaintFilterClearBits) | mPaintFilterSetBits);
+
+    return &mFilteredPaint;
+}
+
+///////////////////////////////////////////////////////////////////////////////
 // Drawing implementation
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -2394,7 +2498,7 @@
                 break;
         }
 
-        if (underlineWidth > 0.0f) {
+        if (CC_LIKELY(underlineWidth > 0.0f)) {
             const float textSize = paintCopy.getTextSize();
             const float strokeWidth = fmax(textSize * kStdUnderline_Thickness, 1.0f);
 
@@ -2463,7 +2567,7 @@
 
     texture->setWrap(GL_CLAMP_TO_EDGE, true);
 
-    if (mSnapshot->transform->isPureTranslate()) {
+    if (CC_LIKELY(mSnapshot->transform->isPureTranslate())) {
         const float x = (int) floorf(left + mSnapshot->transform->getTranslateX() + 0.5f);
         const float y = (int) floorf(top + mSnapshot->transform->getTranslateY() + 0.5f);
 
@@ -2523,8 +2627,8 @@
         // the blending, turn blending off here
         // If the blend mode cannot be implemented using shaders, fall
         // back to the default SrcOver blend mode instead
-        if (mode > SkXfermode::kScreen_Mode) {
-            if (mCaches.extensions.hasFramebufferFetch()) {
+        if CC_UNLIKELY((mode > SkXfermode::kScreen_Mode)) {
+            if (CC_UNLIKELY(mCaches.extensions.hasFramebufferFetch())) {
                 description.framebufferMode = mode;
                 description.swapSrcDst = swapSrcDst;
 
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index 019e9b2..3c2d09e 100644
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -124,6 +124,8 @@
     virtual void drawPoints(float* points, int count, SkPaint* paint);
     virtual void drawText(const char* text, int bytesCount, int count, float x, float y,
             SkPaint* paint, float length = -1.0f);
+    virtual void drawPosText(const char* text, int bytesCount, int count, const float* positions,
+            SkPaint* paint);
 
     virtual void resetShader();
     virtual void setupShader(SkiaShader* shader);
@@ -134,6 +136,16 @@
     virtual void resetShadow();
     virtual void setupShadow(float radius, float dx, float dy, int color);
 
+    virtual void resetPaintFilter();
+    virtual void setupPaintFilter(int clearBits, int setBits);
+
+    SkPaint* filterPaint(SkPaint* paint);
+
+    ANDROID_API static uint32_t getStencilSize();
+
+    void startMark(const char* name) const;
+    void endMark() const;
+
 protected:
     /**
      * Compose the layer defined in the current snapshot with the layer
@@ -579,6 +591,12 @@
     float mShadowDy;
     int mShadowColor;
 
+    // Draw filters
+    bool mHasDrawFilter;
+    int mPaintFilterClearBits;
+    int mPaintFilterSetBits;
+    SkPaint mFilteredPaint;
+
     // Various caches
     Caches& mCaches;
 
diff --git a/libs/hwui/Properties.h b/libs/hwui/Properties.h
index 2eae0f1..7854729 100644
--- a/libs/hwui/Properties.h
+++ b/libs/hwui/Properties.h
@@ -37,6 +37,11 @@
 // Textures used by layers must have dimensions multiples of this number
 #define LAYER_SIZE 64
 
+// Defines the size in bits of the stencil buffer
+// Note: Only 1 bit is required for clipping but more bits are required
+// to properly implement the winding fill rule when rasterizing paths
+#define STENCIL_BUFFER_SIZE 0
+
 /**
  * Debug level for app developers.
  */
diff --git a/libs/hwui/Snapshot.cpp b/libs/hwui/Snapshot.cpp
new file mode 100644
index 0000000..de2c674
--- /dev/null
+++ b/libs/hwui/Snapshot.cpp
@@ -0,0 +1,256 @@
+/*
+ * 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.
+ */
+
+#include "Snapshot.h"
+
+#include <SkCanvas.h>
+
+namespace android {
+namespace uirenderer {
+
+///////////////////////////////////////////////////////////////////////////////
+// Constructors
+///////////////////////////////////////////////////////////////////////////////
+
+Snapshot::Snapshot(): flags(0), previous(NULL), layer(NULL), fbo(0),
+        invisible(false), empty(false) {
+
+    transform = &mTransformRoot;
+    clipRect = &mClipRectRoot;
+    region = NULL;
+    clipRegion = NULL;
+}
+
+/**
+ * Copies the specified snapshot/ The specified snapshot is stored as
+ * the previous snapshot.
+ */
+Snapshot::Snapshot(const sp<Snapshot>& s, int saveFlags):
+        flags(0), previous(s), layer(NULL), fbo(s->fbo),
+        invisible(s->invisible), empty(false),
+        viewport(s->viewport), height(s->height) {
+
+    clipRegion = NULL;
+
+    if (saveFlags & SkCanvas::kMatrix_SaveFlag) {
+        mTransformRoot.load(*s->transform);
+        transform = &mTransformRoot;
+    } else {
+        transform = s->transform;
+    }
+
+    if (saveFlags & SkCanvas::kClip_SaveFlag) {
+        mClipRectRoot.set(*s->clipRect);
+        clipRect = &mClipRectRoot;
+#if STENCIL_BUFFER_SIZE
+        if (s->clipRegion) {
+            mClipRegionRoot.merge(*s->clipRegion);
+            clipRegion = &mClipRegionRoot;
+        }
+#endif
+    } else {
+        clipRect = s->clipRect;
+#if STENCIL_BUFFER_SIZE
+        clipRegion = s->clipRegion;
+#endif
+    }
+
+    if (s->flags & Snapshot::kFlagFboTarget) {
+        flags |= Snapshot::kFlagFboTarget;
+        region = s->region;
+    } else {
+        region = NULL;
+    }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Clipping
+///////////////////////////////////////////////////////////////////////////////
+
+void Snapshot::ensureClipRegion() {
+#if STENCIL_BUFFER_SIZE
+    if (!clipRegion) {
+        clipRegion = &mClipRegionRoot;
+        android::Rect tmp(clipRect->left, clipRect->top, clipRect->right, clipRect->bottom);
+        clipRegion->set(tmp);
+    }
+#endif
+}
+
+void Snapshot::copyClipRectFromRegion() {
+#if STENCIL_BUFFER_SIZE
+    if (!clipRegion->isEmpty()) {
+        android::Rect bounds(clipRegion->bounds());
+        clipRect->set(bounds.left, bounds.top, bounds.right, bounds.bottom);
+
+        if (clipRegion->isRect()) {
+            clipRegion->clear();
+            clipRegion = NULL;
+        }
+    } else {
+        clipRect->setEmpty();
+        clipRegion = NULL;
+    }
+#endif
+}
+
+bool Snapshot::clipRegionOr(float left, float top, float right, float bottom) {
+#if STENCIL_BUFFER_SIZE
+    android::Rect tmp(left, top, right, bottom);
+    clipRegion->orSelf(tmp);
+    copyClipRectFromRegion();
+    return true;
+#else
+    return false;
+#endif
+}
+
+bool Snapshot::clipRegionXor(float left, float top, float right, float bottom) {
+#if STENCIL_BUFFER_SIZE
+    android::Rect tmp(left, top, right, bottom);
+    clipRegion->xorSelf(tmp);
+    copyClipRectFromRegion();
+    return true;
+#else
+    return false;
+#endif
+}
+
+bool Snapshot::clipRegionAnd(float left, float top, float right, float bottom) {
+#if STENCIL_BUFFER_SIZE
+    android::Rect tmp(left, top, right, bottom);
+    clipRegion->andSelf(tmp);
+    copyClipRectFromRegion();
+    return true;
+#else
+    return false;
+#endif
+}
+
+bool Snapshot::clipRegionNand(float left, float top, float right, float bottom) {
+#if STENCIL_BUFFER_SIZE
+    android::Rect tmp(left, top, right, bottom);
+    clipRegion->subtractSelf(tmp);
+    copyClipRectFromRegion();
+    return true;
+#else
+    return false;
+#endif
+}
+
+bool Snapshot::clip(float left, float top, float right, float bottom, SkRegion::Op op) {
+    Rect r(left, top, right, bottom);
+    transform->mapRect(r);
+    return clipTransformed(r, op);
+}
+
+bool Snapshot::clipTransformed(const Rect& r, SkRegion::Op op) {
+    bool clipped = false;
+
+    switch (op) {
+        case SkRegion::kDifference_Op: {
+            ensureClipRegion();
+            clipped = clipRegionNand(r.left, r.top, r.right, r.bottom);
+            break;
+        }
+        case SkRegion::kIntersect_Op: {
+            if (CC_UNLIKELY(clipRegion)) {
+                clipped = clipRegionOr(r.left, r.top, r.right, r.bottom);
+            } else {
+                clipped = clipRect->intersect(r);
+                if (!clipped) {
+                    clipRect->setEmpty();
+                    clipped = true;
+                }
+            }
+            break;
+        }
+        case SkRegion::kUnion_Op: {
+            if (CC_UNLIKELY(clipRegion)) {
+                clipped = clipRegionAnd(r.left, r.top, r.right, r.bottom);
+            } else {
+                clipped = clipRect->unionWith(r);
+            }
+            break;
+        }
+        case SkRegion::kXOR_Op: {
+            ensureClipRegion();
+            clipped = clipRegionXor(r.left, r.top, r.right, r.bottom);
+            break;
+        }
+        case SkRegion::kReverseDifference_Op: {
+            // TODO!!!!!!!
+            break;
+        }
+        case SkRegion::kReplace_Op: {
+            setClip(r.left, r.top, r.right, r.bottom);
+            clipped = true;
+            break;
+        }
+    }
+
+    if (clipped) {
+        flags |= Snapshot::kFlagClipSet;
+    }
+
+    return clipped;
+}
+
+void Snapshot::setClip(float left, float top, float right, float bottom) {
+    clipRect->set(left, top, right, bottom);
+#if STENCIL_BUFFER_SIZE
+    if (clipRegion) {
+        clipRegion->clear();
+        clipRegion = NULL;
+    }
+#endif
+    flags |= Snapshot::kFlagClipSet;
+}
+
+const Rect& Snapshot::getLocalClip() {
+    mat4 inverse;
+    inverse.loadInverse(*transform);
+
+    mLocalClip.set(*clipRect);
+    inverse.mapRect(mLocalClip);
+
+    return mLocalClip;
+}
+
+void Snapshot::resetClip(float left, float top, float right, float bottom) {
+    clipRect = &mClipRectRoot;
+    setClip(left, top, right, bottom);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Transforms
+///////////////////////////////////////////////////////////////////////////////
+
+void Snapshot::resetTransform(float x, float y, float z) {
+    transform = &mTransformRoot;
+    transform->loadTranslate(x, y, z);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Queries
+///////////////////////////////////////////////////////////////////////////////
+
+bool Snapshot::isIgnored() const {
+    return invisible || empty;
+}
+
+}; // namespace uirenderer
+}; // namespace android
diff --git a/libs/hwui/Snapshot.h b/libs/hwui/Snapshot.h
index aff7b93..b2bc879 100644
--- a/libs/hwui/Snapshot.h
+++ b/libs/hwui/Snapshot.h
@@ -23,7 +23,7 @@
 #include <utils/RefBase.h>
 #include <ui/Region.h>
 
-#include <SkCanvas.h>
+#include <SkRegion.h>
 
 #include "Layer.h"
 #include "Matrix.h"
@@ -43,43 +43,12 @@
  */
 class Snapshot: public LightRefBase<Snapshot> {
 public:
-    Snapshot(): flags(0), previous(NULL), layer(NULL), fbo(0), invisible(false), empty(false) {
-        transform = &mTransformRoot;
-        clipRect = &mClipRectRoot;
-        region = NULL;
-    }
+
+    Snapshot();
+    Snapshot(const sp<Snapshot>& s, int saveFlags);
 
     /**
-     * Copies the specified snapshot/ The specified snapshot is stored as
-     * the previous snapshot.
-     */
-    Snapshot(const sp<Snapshot>& s, int saveFlags):
-            flags(0), previous(s), layer(NULL), fbo(s->fbo),
-            invisible(s->invisible), empty(false), viewport(s->viewport), height(s->height) {
-        if (saveFlags & SkCanvas::kMatrix_SaveFlag) {
-            mTransformRoot.load(*s->transform);
-            transform = &mTransformRoot;
-        } else {
-            transform = s->transform;
-        }
-
-        if (saveFlags & SkCanvas::kClip_SaveFlag) {
-            mClipRectRoot.set(*s->clipRect);
-            clipRect = &mClipRectRoot;
-        } else {
-            clipRect = s->clipRect;
-        }
-
-        if (s->flags & Snapshot::kFlagFboTarget) {
-            flags |= Snapshot::kFlagFboTarget;
-            region = s->region;
-        } else {
-            region = NULL;
-        }
-    }
-
-    /**
-     * Various flags set on #flags.
+     * Various flags set on ::flags.
      */
     enum Flags {
         /**
@@ -115,87 +84,41 @@
      * by this snapshot's trasnformation.
      */
     bool clip(float left, float top, float right, float bottom,
-            SkRegion::Op op = SkRegion::kIntersect_Op) {
-        Rect r(left, top, right, bottom);
-        transform->mapRect(r);
-        return clipTransformed(r, op);
-    }
+            SkRegion::Op op = SkRegion::kIntersect_Op);
 
     /**
      * Modifies the current clip with the new clip rectangle and
      * the specified operation. The specified rectangle is considered
      * already transformed.
      */
-    bool clipTransformed(const Rect& r, SkRegion::Op op = SkRegion::kIntersect_Op) {
-        bool clipped = false;
-
-        // NOTE: The unimplemented operations require support for regions
-        // Supporting regions would require using a stencil buffer instead
-        // of the scissor. The stencil buffer itself is not too expensive
-        // (memory cost excluded) but on fillrate limited devices, managing
-        // the stencil might have a negative impact on the framerate.
-        switch (op) {
-            case SkRegion::kDifference_Op:
-                break;
-            case SkRegion::kIntersect_Op:
-                clipped = clipRect->intersect(r);
-                if (!clipped) {
-                    clipRect->setEmpty();
-                    clipped = true;
-                }
-                break;
-            case SkRegion::kUnion_Op:
-                clipped = clipRect->unionWith(r);
-                break;
-            case SkRegion::kXOR_Op:
-                break;
-            case SkRegion::kReverseDifference_Op:
-                break;
-            case SkRegion::kReplace_Op:
-                clipRect->set(r);
-                clipped = true;
-                break;
-        }
-
-        if (clipped) {
-            flags |= Snapshot::kFlagClipSet;
-        }
-
-        return clipped;
-    }
+    bool clipTransformed(const Rect& r, SkRegion::Op op = SkRegion::kIntersect_Op);
 
     /**
      * Sets the current clip.
      */
-    void setClip(float left, float top, float right, float bottom) {
-        clipRect->set(left, top, right, bottom);
-        flags |= Snapshot::kFlagClipSet;
-    }
+    void setClip(float left, float top, float right, float bottom);
 
-    const Rect& getLocalClip() {
-        mat4 inverse;
-        inverse.loadInverse(*transform);
+    /**
+     * Returns the current clip in local coordinates. The clip rect is
+     * transformed by the inverse transform matrix.
+     */
+    const Rect& getLocalClip();
 
-        mLocalClip.set(*clipRect);
-        inverse.mapRect(mLocalClip);
+    /**
+     * Resets the clip to the specified rect.
+     */
+    void resetClip(float left, float top, float right, float bottom);
 
-        return mLocalClip;
-    }
+    /**
+     * Resets the current transform to a pure 3D translation.
+     */
+    void resetTransform(float x, float y, float z);
 
-    void resetTransform(float x, float y, float z) {
-        transform = &mTransformRoot;
-        transform->loadTranslate(x, y, z);
-    }
-
-    void resetClip(float left, float top, float right, float bottom) {
-        clipRect = &mClipRectRoot;
-        clipRect->set(left, top, right, bottom);
-        flags |= Snapshot::kFlagClipSet;
-    }
-
-    bool isIgnored() const {
-        return invisible || empty;
-    }
+    /**
+     * Indicates whether this snapshot should be ignored. A snapshot
+     * is typicalled ignored if its layer is invisible or empty.
+     */
+    bool isIgnored() const;
 
     /**
      * Dirty flags.
@@ -209,6 +132,8 @@
 
     /**
      * Only set when the flag kFlagIsLayer is set.
+     *
+     * This snapshot does not own the layer, this pointer must not be freed.
      */
     Layer* layer;
 
@@ -249,25 +174,57 @@
     /**
      * Local transformation. Holds the current translation, scale and
      * rotation values.
+     *
+     * This is a reference to a matrix owned by this snapshot or another
+     *  snapshot. This pointer must not be freed. See ::mTransformRoot.
      */
     mat4* transform;
 
     /**
-     * Current clip region. The clip is stored in canvas-space coordinates,
+     * Current clip rect. The clip is stored in canvas-space coordinates,
      * (screen-space coordinates in the regular case.)
+     *
+     * This is a reference to a rect owned by this snapshot or another
+     * snapshot. This pointer must not be freed. See ::mClipRectRoot.
      */
     Rect* clipRect;
 
     /**
+     * Current clip region. The clip is stored in canvas-space coordinates,
+     * (screen-space coordinates in the regular case.)
+     *
+     * This is a reference to a region owned by this snapshot or another
+     * snapshot. This pointer must not be freed. See ::mClipRegionRoot.
+     *
+     * This field is used only if STENCIL_BUFFER_SIZE is > 0.
+     */
+    Region* clipRegion;
+
+    /**
      * The ancestor layer's dirty region.
+     *
+     * This is a reference to a region owned by a layer. This pointer must
+     * not be freed.
      */
     Region* region;
 
 private:
+    void ensureClipRegion();
+    void copyClipRectFromRegion();
+
+    bool clipRegionOr(float left, float top, float right, float bottom);
+    bool clipRegionXor(float left, float top, float right, float bottom);
+    bool clipRegionAnd(float left, float top, float right, float bottom);
+    bool clipRegionNand(float left, float top, float right, float bottom);
+
     mat4 mTransformRoot;
     Rect mClipRectRoot;
     Rect mLocalClip;
 
+#if STENCIL_BUFFER_SIZE
+    Region mClipRegionRoot;
+#endif
+
 }; // class Snapshot
 
 }; // namespace uirenderer
diff --git a/libs/rs/Android.mk b/libs/rs/Android.mk
index 58d3e5c..2166ce7 100644
--- a/libs/rs/Android.mk
+++ b/libs/rs/Android.mk
@@ -89,7 +89,6 @@
 	rsFifoSocket.cpp \
 	rsFileA3D.cpp \
 	rsFont.cpp \
-	rsLocklessFifo.cpp \
 	rsObjectBase.cpp \
 	rsMatrix2x2.cpp \
 	rsMatrix3x3.cpp \
@@ -128,7 +127,7 @@
 	driver/rsdShaderCache.cpp \
 	driver/rsdVertexArray.cpp
 
-LOCAL_SHARED_LIBRARIES += libz libcutils libutils libEGL libGLESv1_CM libGLESv2 libui libbcc libbcinfo
+LOCAL_SHARED_LIBRARIES += libz libcutils libutils libEGL libGLESv1_CM libGLESv2 libui libbcc libbcinfo libgui
 
 LOCAL_STATIC_LIBRARIES := libdex libft2
 
@@ -196,7 +195,6 @@
 	rsFifoSocket.cpp \
 	rsFileA3D.cpp \
 	rsFont.cpp \
-	rsLocklessFifo.cpp \
 	rsObjectBase.cpp \
 	rsMatrix2x2.cpp \
 	rsMatrix3x3.cpp \
diff --git a/libs/rs/driver/rsdBcc.cpp b/libs/rs/driver/rsdBcc.cpp
index 24bb288..bec6ffff 100644
--- a/libs/rs/driver/rsdBcc.cpp
+++ b/libs/rs/driver/rsdBcc.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 The Android Open Source Project
+ * Copyright (C) 2011-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.
@@ -36,6 +36,7 @@
 
 struct DrvScript {
     int (*mRoot)();
+    int (*mRootExpand)();
     void (*mInit)();
     void (*mFreeChildren)();
 
@@ -52,6 +53,10 @@
     uint32_t mScriptTextLength;
 };
 
+typedef void (*outer_foreach_t)(
+    const android::renderscript::RsForEachStubParamStruct *,
+    uint32_t x1, uint32_t x2,
+    uint32_t instep, uint32_t outstep);
 
 static Script * setTLS(Script *sc) {
     ScriptTLSStruct * tls = (ScriptTLSStruct *)pthread_getspecific(rsdgThreadTLSKey);
@@ -123,6 +128,7 @@
     }
 
     drv->mRoot = reinterpret_cast<int (*)()>(bccGetFuncAddr(drv->mBccScript, "root"));
+    drv->mRootExpand = reinterpret_cast<int (*)()>(bccGetFuncAddr(drv->mBccScript, "root.expand"));
     drv->mInit = reinterpret_cast<void (*)()>(bccGetFuncAddr(drv->mBccScript, "init"));
     drv->mFreeChildren = reinterpret_cast<void (*)()>(bccGetFuncAddr(drv->mBccScript, ".rs.dtor"));
 
@@ -165,7 +171,12 @@
     script->mHal.info.exportedPragmaCount = drv->ME->getPragmaCount();
     script->mHal.info.exportedPragmaKeyList = drv->ME->getPragmaKeyList();
     script->mHal.info.exportedPragmaValueList = drv->ME->getPragmaValueList();
-    script->mHal.info.root = drv->mRoot;
+
+    if (drv->mRootExpand) {
+      script->mHal.info.root = drv->mRootExpand;
+    } else {
+      script->mHal.info.root = drv->mRoot;
+    }
 
     pthread_mutex_unlock(&rsdgInitMutex);
     return true;
@@ -224,7 +235,7 @@
     RsdHal * dc = (RsdHal *)mtls->rsc->mHal.drv;
     uint32_t sig = mtls->sig;
 
-    outer_foreach_t fn = dc->mForEachLaunch[sig];
+    outer_foreach_t fn = (outer_foreach_t) mtls->script->mHal.info.root;
     while (1) {
         uint32_t slice = (uint32_t)android_atomic_inc(&mtls->mSliceNum);
         uint32_t yStart = mtls->yStart + slice * mtls->mSliceSize;
@@ -240,8 +251,7 @@
             uint32_t offset = mtls->dimX * p.y;
             p.out = mtls->ptrOut + (mtls->eStrideOut * offset);
             p.in = mtls->ptrIn + (mtls->eStrideIn * offset);
-            fn(&mtls->script->mHal.info.root, &p, mtls->xStart, mtls->xEnd,
-               mtls->eStrideIn, mtls->eStrideOut);
+            fn(&p, mtls->xStart, mtls->xEnd, mtls->eStrideIn, mtls->eStrideOut);
         }
     }
 }
@@ -255,7 +265,7 @@
     RsdHal * dc = (RsdHal *)mtls->rsc->mHal.drv;
     uint32_t sig = mtls->sig;
 
-    outer_foreach_t fn = dc->mForEachLaunch[sig];
+    outer_foreach_t fn = (outer_foreach_t) mtls->script->mHal.info.root;
     while (1) {
         uint32_t slice = (uint32_t)android_atomic_inc(&mtls->mSliceNum);
         uint32_t xStart = mtls->xStart + slice * mtls->mSliceSize;
@@ -270,7 +280,7 @@
 
         p.out = mtls->ptrOut + (mtls->eStrideOut * xStart);
         p.in = mtls->ptrIn + (mtls->eStrideIn * xStart);
-        fn(&mtls->script->mHal.info.root, &p, xStart, xEnd, mtls->eStrideIn, mtls->eStrideOut);
+        fn(&p, xStart, xEnd, mtls->eStrideIn, mtls->eStrideOut);
     }
 }
 
@@ -381,7 +391,7 @@
         uint32_t sig = mtls.sig;
 
         //ALOGE("launch 3");
-        outer_foreach_t fn = dc->mForEachLaunch[sig];
+        outer_foreach_t fn = (outer_foreach_t) mtls.script->mHal.info.root;
         for (p.ar[0] = mtls.arrayStart; p.ar[0] < mtls.arrayEnd; p.ar[0]++) {
             for (p.z = mtls.zStart; p.z < mtls.zEnd; p.z++) {
                 for (p.y = mtls.yStart; p.y < mtls.yEnd; p.y++) {
@@ -390,8 +400,8 @@
                                       mtls.dimX * p.y;
                     p.out = mtls.ptrOut + (mtls.eStrideOut * offset);
                     p.in = mtls.ptrIn + (mtls.eStrideIn * offset);
-                    fn(&mtls.script->mHal.info.root, &p, mtls.xStart, mtls.xEnd,
-                       mtls.eStrideIn, mtls.eStrideOut);
+                    fn(&p, mtls.xStart, mtls.xEnd, mtls.eStrideIn,
+                       mtls.eStrideOut);
                 }
             }
         }
diff --git a/libs/rs/driver/rsdCore.cpp b/libs/rs/driver/rsdCore.cpp
index b514e21..1a535d0 100644
--- a/libs/rs/driver/rsdCore.cpp
+++ b/libs/rs/driver/rsdCore.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 The Android Open Source Project
+ * Copyright (C) 2011-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.
@@ -43,7 +43,6 @@
 
 static void Shutdown(Context *rsc);
 static void SetPriority(const Context *rsc, int32_t priority);
-static void initForEach(outer_foreach_t* forEachLaunch);
 
 static RsdHalFunctions FunctionTable = {
     rsdGLInit,
@@ -208,8 +207,6 @@
     rsdgThreadTLSKeyCount++;
     pthread_mutex_unlock(&rsdgInitMutex);
 
-    initForEach(dc->mForEachLaunch);
-
     dc->mTlsStruct.mContext = rsc;
     dc->mTlsStruct.mScript = NULL;
     int status = pthread_setspecific(rsdgThreadTLSKey, &dc->mTlsStruct);
@@ -291,173 +288,3 @@
 
 }
 
-static void rsdForEach17(const void *vRoot,
-        const android::renderscript::RsForEachStubParamStruct *p,
-                                uint32_t x1, uint32_t x2,
-                                uint32_t instep, uint32_t outstep) {
-    typedef void (*fe)(const void *, uint32_t);
-    (*(fe*)vRoot)(p->in, p->y);
-}
-
-static void rsdForEach18(const void *vRoot,
-        const android::renderscript::RsForEachStubParamStruct *p,
-                                uint32_t x1, uint32_t x2,
-                                uint32_t instep, uint32_t outstep) {
-    typedef void (*fe)(void *, uint32_t);
-    (*(fe*)vRoot)(p->out, p->y);
-}
-
-static void rsdForEach19(const void *vRoot,
-        const android::renderscript::RsForEachStubParamStruct *p,
-                                uint32_t x1, uint32_t x2,
-                                uint32_t instep, uint32_t outstep) {
-    typedef void (*fe)(const void *, void *, uint32_t);
-    (*(fe*)vRoot)(p->in, p->out, p->y);
-}
-
-static void rsdForEach21(const void *vRoot,
-        const android::renderscript::RsForEachStubParamStruct *p,
-                                uint32_t x1, uint32_t x2,
-                                uint32_t instep, uint32_t outstep) {
-    typedef void (*fe)(const void *, const void *, uint32_t);
-    (*(fe*)vRoot)(p->in, p->usr, p->y);
-}
-
-static void rsdForEach22(const void *vRoot,
-        const android::renderscript::RsForEachStubParamStruct *p,
-                                uint32_t x1, uint32_t x2,
-                                uint32_t instep, uint32_t outstep) {
-    typedef void (*fe)(void *, const void *, uint32_t);
-    (*(fe*)vRoot)(p->out, p->usr, p->y);
-}
-
-static void rsdForEach23(const void *vRoot,
-        const android::renderscript::RsForEachStubParamStruct *p,
-                                uint32_t x1, uint32_t x2,
-                                uint32_t instep, uint32_t outstep) {
-    typedef void (*fe)(const void *, void *, const void *, uint32_t);
-    (*(fe*)vRoot)(p->in, p->out, p->usr, p->y);
-}
-
-static void rsdForEach25(const void *vRoot,
-        const android::renderscript::RsForEachStubParamStruct *p,
-                                uint32_t x1, uint32_t x2,
-                                uint32_t instep, uint32_t outstep) {
-    typedef void (*fe)(const void *, uint32_t, uint32_t);
-    const uint8_t *pin = (const uint8_t *)p->in;
-    uint32_t y = p->y;
-    for (uint32_t x = x1; x < x2; x++) {
-        (*(fe*)vRoot)(pin, x, y);
-        pin += instep;
-    }
-}
-
-static void rsdForEach26(const void *vRoot,
-        const android::renderscript::RsForEachStubParamStruct *p,
-                                uint32_t x1, uint32_t x2,
-                                uint32_t instep, uint32_t outstep) {
-    typedef void (*fe)(void *, uint32_t, uint32_t);
-    uint8_t *pout = (uint8_t *)p->out;
-    uint32_t y = p->y;
-    for (uint32_t x = x1; x < x2; x++) {
-        (*(fe*)vRoot)(pout, x, y);
-        pout += outstep;
-    }
-}
-
-static void rsdForEach27(const void *vRoot,
-        const android::renderscript::RsForEachStubParamStruct *p,
-                                uint32_t x1, uint32_t x2,
-                                uint32_t instep, uint32_t outstep) {
-    typedef void (*fe)(const void *, void *, uint32_t, uint32_t);
-    uint8_t *pout = (uint8_t *)p->out;
-    const uint8_t *pin = (const uint8_t *)p->in;
-    uint32_t y = p->y;
-    for (uint32_t x = x1; x < x2; x++) {
-        (*(fe*)vRoot)(pin, pout, x, y);
-        pin += instep;
-        pout += outstep;
-    }
-}
-
-static void rsdForEach29(const void *vRoot,
-        const android::renderscript::RsForEachStubParamStruct *p,
-                                uint32_t x1, uint32_t x2,
-                                uint32_t instep, uint32_t outstep) {
-    typedef void (*fe)(const void *, const void *, uint32_t, uint32_t);
-    const uint8_t *pin = (const uint8_t *)p->in;
-    const void *usr = p->usr;
-    const uint32_t y = p->y;
-    for (uint32_t x = x1; x < x2; x++) {
-        (*(fe*)vRoot)(pin, usr, x, y);
-        pin += instep;
-    }
-}
-
-static void rsdForEach30(const void *vRoot,
-        const android::renderscript::RsForEachStubParamStruct *p,
-                                uint32_t x1, uint32_t x2,
-                                uint32_t instep, uint32_t outstep) {
-    typedef void (*fe)(void *, const void *, uint32_t, uint32_t);
-    uint8_t *pout = (uint8_t *)p->out;
-    const void *usr = p->usr;
-    const uint32_t y = p->y;
-    for (uint32_t x = x1; x < x2; x++) {
-        (*(fe*)vRoot)(pout, usr, x, y);
-        pout += outstep;
-    }
-}
-
-static void rsdForEach31(const void *vRoot,
-        const android::renderscript::RsForEachStubParamStruct *p,
-                                uint32_t x1, uint32_t x2,
-                                uint32_t instep, uint32_t outstep) {
-    typedef void (*fe)(const void *, void *, const void *, uint32_t, uint32_t);
-    uint8_t *pout = (uint8_t *)p->out;
-    const uint8_t *pin = (const uint8_t *)p->in;
-    const void *usr = p->usr;
-    const uint32_t y = p->y;
-    for (uint32_t x = x1; x < x2; x++) {
-        (*(fe*)vRoot)(pin, pout, usr, x, y);
-        pin += instep;
-        pout += outstep;
-    }
-}
-
-
-static void initForEach(outer_foreach_t* forEachLaunch) {
-    rsAssert(forEachLaunch);
-    forEachLaunch[0x00] = NULL;
-    forEachLaunch[0x01] = rsdForEach31; // in
-    forEachLaunch[0x02] = rsdForEach30; //     out
-    forEachLaunch[0x03] = rsdForEach31; // in, out
-    forEachLaunch[0x04] = NULL;
-    forEachLaunch[0x05] = rsdForEach29;  // in,      usr
-    forEachLaunch[0x06] = rsdForEach30; //     out, usr
-    forEachLaunch[0x07] = rsdForEach31; // in, out, usr
-    forEachLaunch[0x08] = NULL;
-    forEachLaunch[0x09] = rsdForEach25; // in,           x
-    forEachLaunch[0x0a] = rsdForEach26; //     out,      x
-    forEachLaunch[0x0b] = rsdForEach27; // in, out,      x
-    forEachLaunch[0x0c] = NULL;
-    forEachLaunch[0x0d] = rsdForEach29; // in,      usr, x
-    forEachLaunch[0x0e] = rsdForEach30; //     out, usr, x
-    forEachLaunch[0x0f] = rsdForEach31; // in, out, usr, x
-    forEachLaunch[0x10] = NULL;
-    forEachLaunch[0x11] = rsdForEach17; // in               y
-    forEachLaunch[0x12] = rsdForEach18; //     out,         y
-    forEachLaunch[0x13] = rsdForEach19; // in, out,         y
-    forEachLaunch[0x14] = NULL;
-    forEachLaunch[0x15] = rsdForEach21; // in,      usr,    y
-    forEachLaunch[0x16] = rsdForEach22; //     out, usr,    y
-    forEachLaunch[0x17] = rsdForEach23; // in, out, usr,    y
-    forEachLaunch[0x18] = NULL;
-    forEachLaunch[0x19] = rsdForEach25; // in,           x, y
-    forEachLaunch[0x1a] = rsdForEach26; //     out,      x, y
-    forEachLaunch[0x1b] = rsdForEach27; // in, out,      x, y
-    forEachLaunch[0x1c] = NULL;
-    forEachLaunch[0x1d] = rsdForEach29; // in,      usr, x, y
-    forEachLaunch[0x1e] = rsdForEach30; //     out, usr, x, y
-    forEachLaunch[0x1f] = rsdForEach31; // in, out, usr, x, y
-}
-
diff --git a/libs/rs/driver/rsdCore.h b/libs/rs/driver/rsdCore.h
index ce86d11..126c87a 100644
--- a/libs/rs/driver/rsdCore.h
+++ b/libs/rs/driver/rsdCore.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 The Android Open Source Project
+ * Copyright (C) 2011-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.
@@ -27,11 +27,6 @@
 typedef void (* InvokeFunc_t)(void);
 typedef void (*WorkerCallback_t)(void *usr, uint32_t idx);
 
-typedef void (*outer_foreach_t)(const void *,
-    const android::renderscript::RsForEachStubParamStruct *,
-                                uint32_t x1, uint32_t x2,
-                                uint32_t instep, uint32_t outstep);
-
 typedef struct RsdSymbolTableRec {
     const char * mName;
     void * mPtr;
@@ -62,8 +57,6 @@
     Workers mWorkers;
     bool mExit;
 
-    outer_foreach_t mForEachLaunch[32];
-
     ScriptTLSStruct mTlsStruct;
 
     RsdGL gl;
diff --git a/libs/rs/driver/rsdGL.cpp b/libs/rs/driver/rsdGL.cpp
index b53a68cf..368dd710 100644
--- a/libs/rs/driver/rsdGL.cpp
+++ b/libs/rs/driver/rsdGL.cpp
@@ -215,6 +215,8 @@
     ret = eglChooseConfig(dc->gl.egl.display, configAttribs, 0, 0, &numConfigs);
     checkEglError("eglGetConfigs", ret);
 
+    eglSwapInterval(dc->gl.egl.display, 0);
+
     if (numConfigs) {
         EGLConfig* const configs = new EGLConfig[numConfigs];
 
@@ -340,9 +342,9 @@
 
     dc->gl.gl.OES_texture_npot = NULL != strstr((const char *)dc->gl.gl.extensions,
                                                 "GL_OES_texture_npot");
-    dc->gl.gl.GL_IMG_texture_npot = NULL != strstr((const char *)dc->gl.gl.extensions,
+    dc->gl.gl.IMG_texture_npot = NULL != strstr((const char *)dc->gl.gl.extensions,
                                                    "GL_IMG_texture_npot");
-    dc->gl.gl.GL_NV_texture_npot_2D_mipmap = NULL != strstr((const char *)dc->gl.gl.extensions,
+    dc->gl.gl.NV_texture_npot_2D_mipmap = NULL != strstr((const char *)dc->gl.gl.extensions,
                                                             "GL_NV_texture_npot_2D_mipmap");
     dc->gl.gl.EXT_texture_max_aniso = 1.0f;
     bool hasAniso = NULL != strstr((const char *)dc->gl.gl.extensions,
diff --git a/libs/rs/driver/rsdGL.h b/libs/rs/driver/rsdGL.h
index fc33885..51893c3 100644
--- a/libs/rs/driver/rsdGL.h
+++ b/libs/rs/driver/rsdGL.h
@@ -61,8 +61,8 @@
         int32_t maxVertexTextureUnits;
 
         bool OES_texture_npot;
-        bool GL_IMG_texture_npot;
-        bool GL_NV_texture_npot_2D_mipmap;
+        bool IMG_texture_npot;
+        bool NV_texture_npot_2D_mipmap;
         float EXT_texture_max_aniso;
     } gl;
 
diff --git a/libs/rs/driver/rsdRuntimeMath.cpp b/libs/rs/driver/rsdRuntimeMath.cpp
index e315539..753ef73 100644
--- a/libs/rs/driver/rsdRuntimeMath.cpp
+++ b/libs/rs/driver/rsdRuntimeMath.cpp
@@ -329,6 +329,16 @@
     return prev;
 }
 
+static uint32_t SC_AtomicUMin(volatile uint32_t *ptr, uint32_t value) {
+    uint32_t prev, status;
+    do {
+        prev = *ptr;
+        uint32_t n = rsMin(value, prev);
+        status = android_atomic_release_cas((int32_t) prev, (int32_t)n, (volatile int32_t*) ptr);
+    } while (CC_UNLIKELY(status != 0));
+    return prev;
+}
+
 static int32_t SC_AtomicMin(volatile int32_t *ptr, int32_t value) {
     int32_t prev, status;
     do {
@@ -339,6 +349,16 @@
     return prev;
 }
 
+static uint32_t SC_AtomicUMax(volatile uint32_t *ptr, uint32_t value) {
+    uint32_t prev, status;
+    do {
+        prev = *ptr;
+        uint32_t n = rsMax(value, prev);
+        status = android_atomic_release_cas((int32_t) prev, (int32_t) n, (volatile int32_t*) ptr);
+    } while (CC_UNLIKELY(status != 0));
+    return prev;
+}
+
 static int32_t SC_AtomicMax(volatile int32_t *ptr, int32_t value) {
     int32_t prev, status;
     do {
@@ -524,9 +544,9 @@
     { "_Z11rsAtomicXorPVii", (void *)&SC_AtomicXor, true },
     { "_Z11rsAtomicXorPVjj", (void *)&SC_AtomicXor, true },
     { "_Z11rsAtomicMinPVii", (void *)&SC_AtomicMin, true },
-    { "_Z11rsAtomicMinPVjj", (void *)&SC_AtomicMin, true },
+    { "_Z11rsAtomicMinPVjj", (void *)&SC_AtomicUMin, true },
     { "_Z11rsAtomicMaxPVii", (void *)&SC_AtomicMax, true },
-    { "_Z11rsAtomicMaxPVjj", (void *)&SC_AtomicMax, true },
+    { "_Z11rsAtomicMaxPVjj", (void *)&SC_AtomicUMax, true },
     { "_Z11rsAtomicCasPViii", (void *)&SC_AtomicCas, true },
     { "_Z11rsAtomicCasPVjjj", (void *)&SC_AtomicCas, true },
 
diff --git a/libs/rs/driver/rsdShader.cpp b/libs/rs/driver/rsdShader.cpp
index a10deb4..c70193ae 100644
--- a/libs/rs/driver/rsdShader.cpp
+++ b/libs/rs/driver/rsdShader.cpp
@@ -349,8 +349,8 @@
 
     if (!dc->gl.gl.OES_texture_npot && tex->getType()->getIsNp2()) {
         if (tex->getHasGraphicsMipmaps() &&
-            (dc->gl.gl.GL_NV_texture_npot_2D_mipmap || dc->gl.gl.GL_IMG_texture_npot)) {
-            if (dc->gl.gl.GL_NV_texture_npot_2D_mipmap) {
+            (dc->gl.gl.NV_texture_npot_2D_mipmap || dc->gl.gl.IMG_texture_npot)) {
+            if (dc->gl.gl.NV_texture_npot_2D_mipmap) {
                 RSD_CALL_GL(glTexParameteri, target, GL_TEXTURE_MIN_FILTER,
                             trans[s->mHal.state.minFilter]);
             } else {
diff --git a/libs/rs/rs.spec b/libs/rs/rs.spec
index 20b1f52..ffb1196 100644
--- a/libs/rs/rs.spec
+++ b/libs/rs/rs.spec
@@ -115,6 +115,7 @@
 	}
 
 ContextDestroyWorker {
+        sync
 }
 
 AssignName {
@@ -162,7 +163,7 @@
 	param uint32_t x
 	param uint32_t lod
 	param const void *data
-	param uint32_t comp_offset
+	param size_t comp_offset
 	}
 
 Allocation2DData {
@@ -183,7 +184,7 @@
 	param uint32_t lod
 	param RsAllocationCubemapFace face
 	param const void *data
-	param uint32_t element_offset
+	param size_t element_offset
 	}
 
 AllocationGenerateMipmaps {
diff --git a/libs/rs/rsAllocation.cpp b/libs/rs/rsAllocation.cpp
index 2773d5c..fd85b07 100644
--- a/libs/rs/rsAllocation.cpp
+++ b/libs/rs/rsAllocation.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 The Android Open Source Project
+ * Copyright (C) 2009-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.
@@ -71,11 +71,11 @@
 }
 
 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t lod,
-                         uint32_t count, const void *data, uint32_t sizeBytes) {
-    const uint32_t eSize = mHal.state.type->getElementSizeBytes();
+                         uint32_t count, const void *data, size_t sizeBytes) {
+    const size_t eSize = mHal.state.type->getElementSizeBytes();
 
     if ((count * eSize) != sizeBytes) {
-        ALOGE("Allocation::subData called with mismatched size expected %i, got %i",
+        ALOGE("Allocation::subData called with mismatched size expected %zu, got %zu",
              (count * eSize), sizeBytes);
         mHal.state.type->dumpLOGV("type info");
         return;
@@ -86,14 +86,14 @@
 }
 
 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t lod, RsAllocationCubemapFace face,
-             uint32_t w, uint32_t h, const void *data, uint32_t sizeBytes) {
-    const uint32_t eSize = mHal.state.elementSizeBytes;
-    const uint32_t lineSize = eSize * w;
+             uint32_t w, uint32_t h, const void *data, size_t sizeBytes) {
+    const size_t eSize = mHal.state.elementSizeBytes;
+    const size_t lineSize = eSize * w;
 
     //ALOGE("data2d %p,  %i %i %i %i %i %i %p %i", this, xoff, yoff, lod, face, w, h, data, sizeBytes);
 
     if ((lineSize * h) != sizeBytes) {
-        ALOGE("Allocation size mismatch, expected %i, got %i", (lineSize * h), sizeBytes);
+        ALOGE("Allocation size mismatch, expected %zu, got %zu", (lineSize * h), sizeBytes);
         rsAssert(!"Allocation::subData called with mismatched size");
         return;
     }
@@ -104,12 +104,12 @@
 
 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t zoff,
                       uint32_t lod, RsAllocationCubemapFace face,
-                      uint32_t w, uint32_t h, uint32_t d, const void *data, uint32_t sizeBytes) {
+                      uint32_t w, uint32_t h, uint32_t d, const void *data, size_t sizeBytes) {
 }
 
 void Allocation::elementData(Context *rsc, uint32_t x, const void *data,
-                                uint32_t cIdx, uint32_t sizeBytes) {
-    uint32_t eSize = mHal.state.elementSizeBytes;
+                                uint32_t cIdx, size_t sizeBytes) {
+    size_t eSize = mHal.state.elementSizeBytes;
 
     if (cIdx >= mHal.state.type->getElement()->getFieldCount()) {
         ALOGE("Error Allocation::subElementData component %i out of range.", cIdx);
@@ -124,8 +124,9 @@
     }
 
     const Element * e = mHal.state.type->getElement()->getField(cIdx);
-    if (sizeBytes != e->getSizeBytes()) {
-        ALOGE("Error Allocation::subElementData data size %i does not match field size %zu.", sizeBytes, e->getSizeBytes());
+    uint32_t elemArraySize = mHal.state.type->getElement()->getFieldArraySize(cIdx);
+    if (sizeBytes != e->getSizeBytes() * elemArraySize) {
+        ALOGE("Error Allocation::subElementData data size %zu does not match field size %zu.", sizeBytes, e->getSizeBytes());
         rsc->setError(RS_ERROR_BAD_VALUE, "subElementData bad size.");
         return;
     }
@@ -135,8 +136,8 @@
 }
 
 void Allocation::elementData(Context *rsc, uint32_t x, uint32_t y,
-                                const void *data, uint32_t cIdx, uint32_t sizeBytes) {
-    uint32_t eSize = mHal.state.elementSizeBytes;
+                                const void *data, uint32_t cIdx, size_t sizeBytes) {
+    size_t eSize = mHal.state.elementSizeBytes;
 
     if (x >= mHal.state.dimensionX) {
         ALOGE("Error Allocation::subElementData X offset %i out of range.", x);
@@ -157,9 +158,9 @@
     }
 
     const Element * e = mHal.state.type->getElement()->getField(cIdx);
-
-    if (sizeBytes != e->getSizeBytes()) {
-        ALOGE("Error Allocation::subElementData data size %i does not match field size %zu.", sizeBytes, e->getSizeBytes());
+    uint32_t elemArraySize = mHal.state.type->getElement()->getFieldArraySize(cIdx);
+    if (sizeBytes != e->getSizeBytes() * elemArraySize) {
+        ALOGE("Error Allocation::subElementData data size %zu does not match field size %zu.", sizeBytes, e->getSizeBytes());
         rsc->setError(RS_ERROR_BAD_VALUE, "subElementData bad size.");
         return;
     }
@@ -249,7 +250,7 @@
     delete[] sizeUnpadded;
 }
 
-void Allocation::unpackVec3Allocation(const void *data, uint32_t dataSize) {
+void Allocation::unpackVec3Allocation(const void *data, size_t dataSize) {
     const uint8_t *src = (const uint8_t*)data;
     uint8_t *dst = (uint8_t*)getPtr();
 
@@ -519,13 +520,13 @@
 }
 
 void rsi_Allocation2DElementData(Context *rsc, RsAllocation va, uint32_t x, uint32_t y, uint32_t lod, RsAllocationCubemapFace face,
-                                 const void *data, size_t eoff, uint32_t sizeBytes) { // TODO: this seems wrong, eoff and sizeBytes may be swapped
+                                 const void *data, size_t sizeBytes, size_t eoff) {
     Allocation *a = static_cast<Allocation *>(va);
     a->elementData(rsc, x, y, data, eoff, sizeBytes);
 }
 
 void rsi_Allocation1DElementData(Context *rsc, RsAllocation va, uint32_t x, uint32_t lod,
-                                 const void *data, size_t eoff, uint32_t sizeBytes) { // TODO: this seems wrong, eoff and sizeBytes may be swapped
+                                 const void *data, size_t sizeBytes, size_t eoff) {
     Allocation *a = static_cast<Allocation *>(va);
     a->elementData(rsc, x, data, eoff, sizeBytes);
 }
diff --git a/libs/rs/rsAllocation.h b/libs/rs/rsAllocation.h
index 4ce863a..20201ca 100644
--- a/libs/rs/rsAllocation.h
+++ b/libs/rs/rsAllocation.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 The Android Open Source Project
+ * Copyright (C) 2009-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.
@@ -80,16 +80,16 @@
     void resize1D(Context *rsc, uint32_t dimX);
     void resize2D(Context *rsc, uint32_t dimX, uint32_t dimY);
 
-    void data(Context *rsc, uint32_t xoff, uint32_t lod, uint32_t count, const void *data, uint32_t sizeBytes);
+    void data(Context *rsc, uint32_t xoff, uint32_t lod, uint32_t count, const void *data, size_t sizeBytes);
     void data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t lod, RsAllocationCubemapFace face,
-                 uint32_t w, uint32_t h, const void *data, uint32_t sizeBytes);
+                 uint32_t w, uint32_t h, const void *data, size_t sizeBytes);
     void data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t zoff, uint32_t lod, RsAllocationCubemapFace face,
-                 uint32_t w, uint32_t h, uint32_t d, const void *data, uint32_t sizeBytes);
+                 uint32_t w, uint32_t h, uint32_t d, const void *data, size_t sizeBytes);
 
     void elementData(Context *rsc, uint32_t x,
-                        const void *data, uint32_t elementOff, uint32_t sizeBytes);
+                     const void *data, uint32_t elementOff, size_t sizeBytes);
     void elementData(Context *rsc, uint32_t x, uint32_t y,
-                        const void *data, uint32_t elementOff, uint32_t sizeBytes);
+                     const void *data, uint32_t elementOff, size_t sizeBytes);
 
     void read(void *data);
 
@@ -138,7 +138,7 @@
 
     uint32_t getPackedSize() const;
     static void writePackedData(const Type *type, uint8_t *dst, const uint8_t *src, bool dstPadded);
-    void unpackVec3Allocation(const void *data, uint32_t dataSize);
+    void unpackVec3Allocation(const void *data, size_t dataSize);
     void packVec3Allocation(OStream *stream) const;
 };
 
diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp
index ad2ff0f..04284dd 100644
--- a/libs/rs/rsContext.cpp
+++ b/libs/rs/rsContext.cpp
@@ -18,6 +18,7 @@
 #include "rsContext.h"
 #include "rsThreadIO.h"
 #include <ui/FramebufferNativeWindow.h>
+#include <gui/DisplayEventReceiver.h>
 
 #include <sys/types.h>
 #include <sys/resource.h>
@@ -245,42 +246,55 @@
     }
 
     rsc->mRunning = true;
-    bool mDraw = true;
-    bool doWait = true;
-
-    uint64_t targetTime = rsc->getTime();
-    while (!rsc->mExit) {
-        uint64_t waitTime = 0;
-        uint64_t now = rsc->getTime();
-        if (!doWait) {
-            if (now < targetTime) {
-                waitTime = targetTime - now;
-                doWait = true;
-            }
+    if (!rsc->mIsGraphicsContext) {
+        while (!rsc->mExit) {
+            rsc->mIO.playCoreCommands(rsc, true, -1);
         }
+    } else {
+#ifndef ANDROID_RS_SERIALIZE
+        DisplayEventReceiver displayEvent;
+        DisplayEventReceiver::Event eventBuffer[1];
+#endif
+        int vsyncRate = 0;
+        int targetRate = 0;
 
-        mDraw |= rsc->mIO.playCoreCommands(rsc, doWait, waitTime);
-        mDraw &= (rsc->mRootScript.get() != NULL);
-        mDraw &= rsc->mHasSurface;
+        bool drawOnce = false;
+        while (!rsc->mExit) {
+            rsc->timerSet(RS_TIMER_IDLE);
 
-        if (mDraw && rsc->mIsGraphicsContext) {
-            uint64_t delay = rsc->runRootScript() * 1000000;
-            targetTime = rsc->getTime() + delay;
-            doWait = (delay == 0);
-
-            if (rsc->props.mLogVisual) {
-                rsc->displayDebugStats();
+#ifndef ANDROID_RS_SERIALIZE
+            if (vsyncRate != targetRate) {
+                displayEvent.setVsyncRate(targetRate);
+                vsyncRate = targetRate;
+            }
+            if (targetRate) {
+                drawOnce |= rsc->mIO.playCoreCommands(rsc, true, displayEvent.getFd());
+                while (displayEvent.getEvents(eventBuffer, 1) != 0) {
+                    //ALOGE("vs2 time past %lld", (rsc->getTime() - eventBuffer[0].header.timestamp) / 1000000);
+                }
+            } else
+#endif
+            {
+                drawOnce |= rsc->mIO.playCoreCommands(rsc, true, -1);
             }
 
-            mDraw = !rsc->mPaused;
-            rsc->timerSet(RS_TIMER_CLEAR_SWAP);
-            rsc->mHal.funcs.swap(rsc);
-            rsc->timerFrame();
-            rsc->timerSet(RS_TIMER_INTERNAL);
-            rsc->timerPrint();
-            rsc->timerReset();
-        } else {
-            doWait = true;
+            if ((rsc->mRootScript.get() != NULL) && rsc->mHasSurface &&
+                (targetRate || drawOnce) && !rsc->mPaused) {
+
+                drawOnce = false;
+                targetRate = ((rsc->runRootScript() + 15) / 16);
+
+                if (rsc->props.mLogVisual) {
+                    rsc->displayDebugStats();
+                }
+
+                rsc->timerSet(RS_TIMER_CLEAR_SWAP);
+                rsc->mHal.funcs.swap(rsc);
+                rsc->timerFrame();
+                rsc->timerSet(RS_TIMER_INTERNAL);
+                rsc->timerPrint();
+                rsc->timerReset();
+            }
         }
     }
 
@@ -315,8 +329,8 @@
          mFBOCache.deinit(this);
     }
     ObjectBase::freeAllChildren(this);
-    //ALOGV("destroyWorkerThreadResources 2");
     mExit = true;
+    //ALOGV("destroyWorkerThreadResources 2");
 }
 
 void Context::printWatchdogInfo(void *ctx) {
@@ -382,7 +396,7 @@
     pthread_mutex_lock(&gInitMutex);
 
     mIO.init();
-    mIO.setTimoutCallback(printWatchdogInfo, this, 2e9);
+    mIO.setTimeoutCallback(printWatchdogInfo, this, 2e9);
 
     dev->addContext(this);
     mDev = dev;
@@ -434,14 +448,12 @@
     ALOGV("%p Context::~Context", this);
 
     if (!mIsContextLite) {
-        mIO.coreFlush();
-        rsAssert(mExit);
-        mExit = true;
         mPaused = false;
         void *res;
 
         mIO.shutdown();
         int status = pthread_join(mThreadId, &res);
+        rsAssert(mExit);
 
         if (mHal.funcs.shutdownDriver) {
             mHal.funcs.shutdownDriver(this);
diff --git a/libs/rs/rsContext.h b/libs/rs/rsContext.h
index 61c29f9..a844a20 100644
--- a/libs/rs/rsContext.h
+++ b/libs/rs/rsContext.h
@@ -39,7 +39,6 @@
 #include "rsFBOCache.h"
 
 #include "rsgApiStructs.h"
-#include "rsLocklessFifo.h"
 
 // ---------------------------------------------------------------------------
 namespace android {
diff --git a/libs/rs/rsFifo.cpp b/libs/rs/rsFifo.cpp
deleted file mode 100644
index 3d5d8c4..0000000
--- a/libs/rs/rsFifo.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.
- */
-
-#include "rsFifoSocket.h"
-#include "utils/Timers.h"
-#include "utils/StopWatch.h"
-
-using namespace android;
-using namespace android::renderscript;
-
-Fifo::Fifo() {
-
-}
-
-Fifo::~Fifo() {
-
-}
-
diff --git a/libs/rs/rsFifo.h b/libs/rs/rsFifo.h
index f924b95..911f446 100644
--- a/libs/rs/rsFifo.h
+++ b/libs/rs/rsFifo.h
@@ -35,9 +35,9 @@
     virtual ~Fifo();
 
 public:
-    void virtual writeAsync(const void *data, size_t bytes) = 0;
+    bool virtual writeAsync(const void *data, size_t bytes, bool waitForSpace = true) = 0;
     void virtual writeWaitReturn(void *ret, size_t retSize) = 0;
-    size_t virtual read(void *data, size_t bytes) = 0;
+    size_t virtual read(void *data, size_t bytes, bool doWait = true, uint64_t timeToWait = 0) = 0;
     void virtual readReturn(const void *data, size_t bytes) = 0;
 
     void virtual flush() = 0;
diff --git a/libs/rs/rsFifoSocket.cpp b/libs/rs/rsFifoSocket.cpp
index 163a44b..bd511cf 100644
--- a/libs/rs/rsFifoSocket.cpp
+++ b/libs/rs/rsFifoSocket.cpp
@@ -22,6 +22,7 @@
 #include <stdlib.h>
 #include <ctype.h>
 #include <unistd.h>
+#include <poll.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 
@@ -29,55 +30,79 @@
 using namespace android::renderscript;
 
 FifoSocket::FifoSocket() {
-    sequence = 1;
+    mShutdown = false;
 }
 
 FifoSocket::~FifoSocket() {
 
 }
 
-bool FifoSocket::init() {
+bool FifoSocket::init(bool supportNonBlocking, bool supportReturnValues, size_t maxDataSize) {
     int ret = socketpair(AF_UNIX, SOCK_STREAM, 0, sv);
     return false;
 }
 
 void FifoSocket::shutdown() {
+    mShutdown = true;
+    uint64_t d = 0;
+    ::send(sv[0], &d, sizeof(d), 0);
+    ::send(sv[1], &d, sizeof(d), 0);
+    close(sv[0]);
+    close(sv[1]);
 }
 
-void FifoSocket::writeAsync(const void *data, size_t bytes) {
+bool FifoSocket::writeAsync(const void *data, size_t bytes, bool waitForSpace) {
     if (bytes == 0) {
-        return;
+        return true;
     }
     //ALOGE("writeAsync %p %i", data, bytes);
     size_t ret = ::send(sv[0], data, bytes, 0);
     //ALOGE("writeAsync ret %i", ret);
     rsAssert(ret == bytes);
+    return true;
 }
 
 void FifoSocket::writeWaitReturn(void *retData, size_t retBytes) {
+    if (mShutdown) {
+        return;
+    }
+
     //ALOGE("writeWaitReturn %p %i", retData, retBytes);
-    size_t ret = ::recv(sv[0], retData, retBytes, 0);
+    size_t ret = ::recv(sv[0], retData, retBytes, MSG_WAITALL);
     //ALOGE("writeWaitReturn %i", ret);
     rsAssert(ret == retBytes);
 }
 
 size_t FifoSocket::read(void *data, size_t bytes) {
+    if (mShutdown) {
+        return 0;
+    }
+
     //ALOGE("read %p %i", data, bytes);
-    size_t ret = ::recv(sv[1], data, bytes, 0);
-    rsAssert(ret == bytes);
-    //ALOGE("read ret %i", ret);
+    size_t ret = ::recv(sv[1], data, bytes, MSG_WAITALL);
+    rsAssert(ret == bytes || mShutdown);
+    //ALOGE("read ret %i  bytes %i", ret, bytes);
+    if (mShutdown) {
+        ret = 0;
+    }
     return ret;
 }
 
-void FifoSocket::readReturn(const void *data, size_t bytes) {
-    ALOGE("readReturn %p %Zu", data, bytes);
-    size_t ret = ::send(sv[1], data, bytes, 0);
-    ALOGE("readReturn %Zu", ret);
-    rsAssert(ret == bytes);
+bool FifoSocket::isEmpty() {
+    struct pollfd p;
+    p.fd = sv[1];
+    p.events = POLLIN;
+    int r = poll(&p, 1, 0);
+    //ALOGE("poll r=%i", r);
+    return r == 0;
 }
 
 
-void FifoSocket::flush() {
+void FifoSocket::readReturn(const void *data, size_t bytes) {
+    //ALOGE("readReturn %p %Zu", data, bytes);
+    size_t ret = ::send(sv[1], data, bytes, 0);
+    //ALOGE("readReturn %Zu", ret);
+    //rsAssert(ret == bytes);
 }
 
 
diff --git a/libs/rs/rsFifoSocket.h b/libs/rs/rsFifoSocket.h
index 7df2b67..cac0a75 100644
--- a/libs/rs/rsFifoSocket.h
+++ b/libs/rs/rsFifoSocket.h
@@ -29,23 +29,23 @@
     FifoSocket();
     virtual ~FifoSocket();
 
-    bool init();
+    bool init(bool supportNonBlocking = true,
+              bool supportReturnValues = true,
+              size_t maxDataSize = 0);
     void shutdown();
 
+    bool writeAsync(const void *data, size_t bytes, bool waitForSpace = true);
+    void writeWaitReturn(void *ret, size_t retSize);
+    size_t read(void *data, size_t bytes);
+    void readReturn(const void *data, size_t bytes);
+    bool isEmpty();
 
-
-    void virtual writeAsync(const void *data, size_t bytes);
-    void virtual writeWaitReturn(void *ret, size_t retSize);
-    size_t virtual read(void *data, size_t bytes);
-    void virtual readReturn(const void *data, size_t bytes);
-
-    void virtual flush();
+    int getWriteFd() {return sv[0];}
+    int getReadFd() {return sv[1];}
 
 protected:
     int sv[2];
-    uint32_t sequence;
-
-
+    bool mShutdown;
 };
 
 }
diff --git a/libs/rs/rsLocklessFifo.cpp b/libs/rs/rsLocklessFifo.cpp
deleted file mode 100644
index 0466d8b..0000000
--- a/libs/rs/rsLocklessFifo.cpp
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
-#include "rsLocklessFifo.h"
-#include "utils/Timers.h"
-#include "utils/StopWatch.h"
-
-using namespace android;
-using namespace android::renderscript;
-
-LocklessCommandFifo::LocklessCommandFifo() : mBuffer(0), mInitialized(false) {
-    mTimeoutCallback = NULL;
-    mTimeoutCallbackData = NULL;
-    mTimeoutWait = 0;
-}
-
-LocklessCommandFifo::~LocklessCommandFifo() {
-    if (!mInShutdown && mInitialized) {
-        shutdown();
-    }
-    if (mBuffer) {
-        free(mBuffer);
-    }
-}
-
-void LocklessCommandFifo::shutdown() {
-    mInShutdown = true;
-    mSignalToWorker.set();
-}
-
-bool LocklessCommandFifo::init(uint32_t sizeInBytes) {
-    // Add room for a buffer reset command
-    mBuffer = static_cast<uint8_t *>(malloc(sizeInBytes + 4));
-    if (!mBuffer) {
-        ALOGE("LocklessFifo allocation failure");
-        return false;
-    }
-
-    if (!mSignalToControl.init() || !mSignalToWorker.init()) {
-        ALOGE("Signal setup failed");
-        free(mBuffer);
-        return false;
-    }
-
-    mInShutdown = false;
-    mSize = sizeInBytes;
-    mPut = mBuffer;
-    mGet = mBuffer;
-    mEnd = mBuffer + (sizeInBytes) - 1;
-    //dumpState("init");
-    mInitialized = true;
-    return true;
-}
-
-uint32_t LocklessCommandFifo::getFreeSpace() const {
-    int32_t freeSpace = 0;
-    //dumpState("getFreeSpace");
-
-    if (mPut >= mGet) {
-        freeSpace = mEnd - mPut;
-    } else {
-        freeSpace = mGet - mPut;
-    }
-
-    if (freeSpace < 0) {
-        freeSpace = 0;
-    }
-    return freeSpace;
-}
-
-bool LocklessCommandFifo::isEmpty() const {
-    uint32_t p = android_atomic_acquire_load((int32_t *)&mPut);
-    return ((uint8_t *)p) == mGet;
-}
-
-
-void * LocklessCommandFifo::reserve(uint32_t sizeInBytes) {
-    // Add space for command header and loop token;
-    sizeInBytes += 8;
-
-    //dumpState("reserve");
-    if (getFreeSpace() < sizeInBytes) {
-        makeSpace(sizeInBytes);
-    }
-
-    return mPut + 4;
-}
-
-void LocklessCommandFifo::commit(uint32_t command, uint32_t sizeInBytes) {
-    if (mInShutdown) {
-        return;
-    }
-    //dumpState("commit 1");
-    reinterpret_cast<uint16_t *>(mPut)[0] = command;
-    reinterpret_cast<uint16_t *>(mPut)[1] = sizeInBytes;
-
-    int32_t s = ((sizeInBytes + 3) & ~3) + 4;
-    android_atomic_add(s, (int32_t *)&mPut);
-    //dumpState("commit 2");
-    mSignalToWorker.set();
-}
-
-void LocklessCommandFifo::commitSync(uint32_t command, uint32_t sizeInBytes) {
-    if (mInShutdown) {
-        return;
-    }
-
-    //char buf[1024];
-    //sprintf(buf, "RenderScript LocklessCommandFifo::commitSync  %p %i  %i", this, command, sizeInBytes);
-    //StopWatch compileTimer(buf);
-    commit(command, sizeInBytes);
-    flush();
-}
-
-void LocklessCommandFifo::flush() {
-    //dumpState("flush 1");
-    while (mPut != mGet) {
-        while (!mSignalToControl.wait(mTimeoutWait)) {
-            if (mTimeoutCallback) {
-                mTimeoutCallback(mTimeoutCallbackData);
-            }
-        }
-    }
-    //dumpState("flush 2");
-}
-
-void LocklessCommandFifo::setTimoutCallback(void (*cbk)(void *), void *data, uint64_t timeout) {
-    mTimeoutCallback = cbk;
-    mTimeoutCallbackData = data;
-    mTimeoutWait = timeout;
-}
-
-bool LocklessCommandFifo::wait(uint64_t timeout) {
-    while (isEmpty() && !mInShutdown) {
-        mSignalToControl.set();
-        return mSignalToWorker.wait(timeout);
-    }
-    return true;
-}
-
-const void * LocklessCommandFifo::get(uint32_t *command, uint32_t *bytesData, uint64_t timeout) {
-    while (1) {
-        //dumpState("get");
-        wait(timeout);
-
-        if (isEmpty() || mInShutdown) {
-            *command = 0;
-            *bytesData = 0;
-            return NULL;
-        }
-
-        *command = reinterpret_cast<const uint16_t *>(mGet)[0];
-        *bytesData = reinterpret_cast<const uint16_t *>(mGet)[1];
-        if (*command) {
-            // non-zero command is valid
-            return mGet+4;
-        }
-
-        // zero command means reset to beginning.
-        mGet = mBuffer;
-    }
-}
-
-void LocklessCommandFifo::next() {
-    uint32_t bytes = reinterpret_cast<const uint16_t *>(mGet)[1];
-
-    android_atomic_add(((bytes + 3) & ~3) + 4, (int32_t *)&mGet);
-    //mGet += ((bytes + 3) & ~3) + 4;
-    if (isEmpty()) {
-        mSignalToControl.set();
-    }
-    //dumpState("next");
-}
-
-bool LocklessCommandFifo::makeSpaceNonBlocking(uint32_t bytes) {
-    //dumpState("make space non-blocking");
-    if ((mPut+bytes) > mEnd) {
-        // Need to loop regardless of where get is.
-        if ((mGet > mPut) || (mBuffer+4 >= mGet)) {
-            return false;
-        }
-
-        // Toss in a reset then the normal wait for space will do the rest.
-        reinterpret_cast<uint16_t *>(mPut)[0] = 0;
-        reinterpret_cast<uint16_t *>(mPut)[1] = 0;
-        mPut = mBuffer;
-        mSignalToWorker.set();
-    }
-
-    // it will fit here so we just need to wait for space.
-    if (getFreeSpace() < bytes) {
-        return false;
-    }
-
-    return true;
-}
-
-void LocklessCommandFifo::makeSpace(uint32_t bytes) {
-    //dumpState("make space");
-    if ((mPut+bytes) > mEnd) {
-        // Need to loop regardless of where get is.
-        while ((mGet > mPut) || (mBuffer+4 >= mGet)) {
-            usleep(100);
-        }
-
-        // Toss in a reset then the normal wait for space will do the rest.
-        reinterpret_cast<uint16_t *>(mPut)[0] = 0;
-        reinterpret_cast<uint16_t *>(mPut)[1] = 0;
-        mPut = mBuffer;
-        mSignalToWorker.set();
-    }
-
-    // it will fit here so we just need to wait for space.
-    while (getFreeSpace() < bytes) {
-        usleep(100);
-    }
-
-}
-
-void LocklessCommandFifo::dumpState(const char *s) const {
-    ALOGV("%s %p  put %p, get %p,  buf %p,  end %p", s, this, mPut, mGet, mBuffer, mEnd);
-}
-
-void LocklessCommandFifo::printDebugData() const {
-    dumpState("printing fifo debug");
-    const uint32_t *pptr = (const uint32_t *)mGet;
-    pptr -= 8 * 4;
-    if (mGet < mBuffer) {
-        pptr = (const uint32_t *)mBuffer;
-    }
-
-
-    for (int ct=0; ct < 16; ct++) {
-        ALOGV("fifo %p = 0x%08x  0x%08x  0x%08x  0x%08x", pptr, pptr[0], pptr[1], pptr[2], pptr[3]);
-        pptr += 4;
-    }
-
-}
diff --git a/libs/rs/rsLocklessFifo.h b/libs/rs/rsLocklessFifo.h
deleted file mode 100644
index dafc512..0000000
--- a/libs/rs/rsLocklessFifo.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
-#ifndef ANDROID_RS_LOCKLESS_FIFO_H
-#define ANDROID_RS_LOCKLESS_FIFO_H
-
-
-#include "rsUtils.h"
-#include "rsSignal.h"
-
-namespace android {
-namespace renderscript {
-
-
-// A simple FIFO to be used as a producer / consumer between two
-// threads.  One is writer and one is reader.  The common cases
-// will not require locking.  It is not threadsafe for multiple
-// readers or writers by design.
-
-class LocklessCommandFifo {
-public:
-    bool init(uint32_t size);
-    void shutdown();
-    void setTimoutCallback(void (*)(void *), void *, uint64_t timeout);
-
-    void printDebugData() const;
-
-    LocklessCommandFifo();
-    ~LocklessCommandFifo();
-
-protected:
-    uint8_t * volatile mPut;
-    uint8_t * volatile mGet;
-    uint8_t * mBuffer;
-    uint8_t * mEnd;
-    uint8_t mSize;
-    bool mInShutdown;
-    bool mInitialized;
-
-    Signal mSignalToWorker;
-    Signal mSignalToControl;
-
-public:
-    void * reserve(uint32_t bytes);
-    void commit(uint32_t command, uint32_t bytes);
-    void commitSync(uint32_t command, uint32_t bytes);
-
-    void flush();
-    bool wait(uint64_t timeout = 0);
-
-    const void * get(uint32_t *command, uint32_t *bytesData, uint64_t timeout = 0);
-    void next();
-
-    void makeSpace(uint32_t bytes);
-    bool makeSpaceNonBlocking(uint32_t bytes);
-
-    bool isEmpty() const;
-    uint32_t getFreeSpace() const;
-
-private:
-    void dumpState(const char *) const;
-
-    void (*mTimeoutCallback)(void *);
-    void * mTimeoutCallbackData;
-    uint64_t mTimeoutWait;
-};
-
-
-}
-}
-#endif
diff --git a/libs/rs/rsScriptC.cpp b/libs/rs/rsScriptC.cpp
index afc8ba0..b4eb995 100644
--- a/libs/rs/rsScriptC.cpp
+++ b/libs/rs/rsScriptC.cpp
@@ -206,7 +206,6 @@
         return false;
     }
 
-    rsAssert(bcWrapper.getHeaderVersion() == 0);
     if (bcWrapper.getBCFileType() == bcinfo::BC_WRAPPER) {
         sdkVersion = bcWrapper.getTargetAPI();
     }
@@ -323,7 +322,7 @@
 
     if (!s->runCompiler(rsc, resName, cacheDir, (uint8_t *)text, text_length)) {
         // Error during compile, destroy s and return null.
-        delete s;
+        ObjectBase::checkDelete(s);
         return NULL;
     }
 
diff --git a/libs/rs/rsThreadIO.cpp b/libs/rs/rsThreadIO.cpp
index 8ba1a0e..8e4b988 100644
--- a/libs/rs/rsThreadIO.cpp
+++ b/libs/rs/rsThreadIO.cpp
@@ -18,222 +18,189 @@
 
 #include "rsThreadIO.h"
 
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include <fcntl.h>
+#include <poll.h>
+
+
 using namespace android;
 using namespace android::renderscript;
 
-ThreadIO::ThreadIO() : mUsingSocket(false) {
+ThreadIO::ThreadIO() {
+    mRunning = true;
 }
 
 ThreadIO::~ThreadIO() {
 }
 
-void ThreadIO::init(bool useSocket) {
-    mUsingSocket = useSocket;
-    mToCore.init(16 * 1024);
-
-    if (mUsingSocket) {
-        mToClientSocket.init();
-        mToCoreSocket.init();
-    } else {
-        mToClient.init(1024);
-    }
+void ThreadIO::init() {
+    mToClient.init();
+    mToCore.init();
 }
 
 void ThreadIO::shutdown() {
-    //ALOGE("shutdown 1");
+    mRunning = false;
     mToCore.shutdown();
-    //ALOGE("shutdown 2");
-}
-
-void ThreadIO::coreFlush() {
-    //ALOGE("coreFlush 1");
-    if (mUsingSocket) {
-    } else {
-        mToCore.flush();
-    }
-    //ALOGE("coreFlush 2");
 }
 
 void * ThreadIO::coreHeader(uint32_t cmdID, size_t dataLen) {
     //ALOGE("coreHeader %i %i", cmdID, dataLen);
-    if (mUsingSocket) {
-        CoreCmdHeader hdr;
-        hdr.bytes = dataLen;
-        hdr.cmdID = cmdID;
-        mToCoreSocket.writeAsync(&hdr, sizeof(hdr));
-    } else {
-        mCoreCommandSize = dataLen;
-        mCoreCommandID = cmdID;
-        mCoreDataPtr = (uint8_t *)mToCore.reserve(dataLen);
-        mCoreDataBasePtr = mCoreDataPtr;
-    }
-    //ALOGE("coreHeader ret %p", mCoreDataPtr);
-    return mCoreDataPtr;
-}
-
-void ThreadIO::coreData(const void *data, size_t dataLen) {
-    //ALOGE("coreData %p %i", data, dataLen);
-    mToCoreSocket.writeAsync(data, dataLen);
-    //ALOGE("coreData ret %p", mCoreDataPtr);
+    CoreCmdHeader *hdr = (CoreCmdHeader *)&mSendBuffer[0];
+    hdr->bytes = dataLen;
+    hdr->cmdID = cmdID;
+    mSendLen = dataLen + sizeof(CoreCmdHeader);
+    //mToCoreSocket.writeAsync(&hdr, sizeof(hdr));
+    //ALOGE("coreHeader ret ");
+    return &mSendBuffer[sizeof(CoreCmdHeader)];
 }
 
 void ThreadIO::coreCommit() {
-    //ALOGE("coreCommit %p %p %i", mCoreDataPtr, mCoreDataBasePtr, mCoreCommandSize);
-    if (mUsingSocket) {
-    } else {
-        rsAssert((size_t)(mCoreDataPtr - mCoreDataBasePtr) <= mCoreCommandSize);
-        mToCore.commit(mCoreCommandID, mCoreCommandSize);
-    }
-    //ALOGE("coreCommit ret");
-}
-
-void ThreadIO::coreCommitSync() {
-    //ALOGE("coreCommitSync %p %p %i", mCoreDataPtr, mCoreDataBasePtr, mCoreCommandSize);
-    if (mUsingSocket) {
-    } else {
-        rsAssert((size_t)(mCoreDataPtr - mCoreDataBasePtr) <= mCoreCommandSize);
-        mToCore.commitSync(mCoreCommandID, mCoreCommandSize);
-    }
-    //ALOGE("coreCommitSync ret");
+    mToCore.writeAsync(&mSendBuffer, mSendLen);
 }
 
 void ThreadIO::clientShutdown() {
-    //ALOGE("coreShutdown 1");
     mToClient.shutdown();
-    //ALOGE("coreShutdown 2");
 }
 
 void ThreadIO::coreSetReturn(const void *data, size_t dataLen) {
-    rsAssert(dataLen <= sizeof(mToCoreRet));
-    memcpy(&mToCoreRet, data, dataLen);
+    uint32_t buf;
+    if (data == NULL) {
+        data = &buf;
+        dataLen = sizeof(buf);
+    }
+
+    mToCore.readReturn(data, dataLen);
 }
 
 void ThreadIO::coreGetReturn(void *data, size_t dataLen) {
-    memcpy(data, &mToCoreRet, dataLen);
+    uint32_t buf;
+    if (data == NULL) {
+        data = &buf;
+        dataLen = sizeof(buf);
+    }
+
+    mToCore.writeWaitReturn(data, dataLen);
 }
 
-void ThreadIO::setTimoutCallback(void (*cb)(void *), void *dat, uint64_t timeout) {
-    mToCore.setTimoutCallback(cb, dat, timeout);
+void ThreadIO::setTimeoutCallback(void (*cb)(void *), void *dat, uint64_t timeout) {
+    //mToCore.setTimeoutCallback(cb, dat, timeout);
 }
 
-
-bool ThreadIO::playCoreCommands(Context *con, bool waitForCommand, uint64_t timeToWait) {
+bool ThreadIO::playCoreCommands(Context *con, bool waitForCommand, int waitFd) {
     bool ret = false;
-    uint64_t startTime = con->getTime();
 
-    while (!mToCore.isEmpty() || waitForCommand) {
-        uint32_t cmdID = 0;
-        uint32_t cmdSize = 0;
-        ret = true;
-        if (con->props.mLogTimes) {
-            con->timerSet(Context::RS_TIMER_IDLE);
+    uint8_t buf[2 * 1024];
+    const CoreCmdHeader *cmd = (const CoreCmdHeader *)&buf[0];
+    const void * data = (const void *)&buf[sizeof(CoreCmdHeader)];
+
+    struct pollfd p[2];
+    p[0].fd = mToCore.getReadFd();
+    p[0].events = POLLIN;
+    p[0].revents = 0;
+    p[1].fd = waitFd;
+    p[1].events = POLLIN;
+    p[1].revents = 0;
+    int pollCount = 1;
+    if (waitFd >= 0) {
+        pollCount = 2;
+    }
+
+    if (con->props.mLogTimes) {
+        con->timerSet(Context::RS_TIMER_IDLE);
+    }
+
+    int waitTime = -1;
+    while (mRunning) {
+        int pr = poll(p, pollCount, waitTime);
+        if (pr <= 0) {
+            break;
         }
 
-        uint64_t delay = 0;
-        if (waitForCommand) {
-            delay = timeToWait - (con->getTime() - startTime);
-            if (delay > timeToWait) {
-                delay = 0;
+        if (p[0].revents) {
+            size_t r = mToCore.read(&buf[0], sizeof(CoreCmdHeader));
+            mToCore.read(&buf[sizeof(CoreCmdHeader)], cmd->bytes);
+
+            if (r != sizeof(CoreCmdHeader)) {
+                // exception or timeout occurred.
+                break;
+            }
+
+            ret = true;
+            if (con->props.mLogTimes) {
+                con->timerSet(Context::RS_TIMER_INTERNAL);
+            }
+            waitForCommand = false;
+            //ALOGV("playCoreCommands 3 %i %i", cmd->cmdID, cmd->bytes);
+
+            if (cmd->cmdID >= (sizeof(gPlaybackFuncs) / sizeof(void *))) {
+                rsAssert(cmd->cmdID < (sizeof(gPlaybackFuncs) / sizeof(void *)));
+                ALOGE("playCoreCommands error con %p, cmd %i", con, cmd->cmdID);
+            }
+            gPlaybackFuncs[cmd->cmdID](con, data, cmd->bytes);
+
+            if (con->props.mLogTimes) {
+                con->timerSet(Context::RS_TIMER_IDLE);
+            }
+
+            if (waitFd < 0) {
+                // If we don't have a secondary wait object we should stop blocking now
+                // that at least one command has been processed.
+                waitTime = 0;
             }
         }
-        const void * data = mToCore.get(&cmdID, &cmdSize, delay);
-        if (!cmdSize) {
-            // exception or timeout occurred.
-            return false;
-        }
-        if (con->props.mLogTimes) {
-            con->timerSet(Context::RS_TIMER_INTERNAL);
-        }
-        waitForCommand = false;
-        //ALOGV("playCoreCommands 3 %i %i", cmdID, cmdSize);
 
-        if (cmdID >= (sizeof(gPlaybackFuncs) / sizeof(void *))) {
-            rsAssert(cmdID < (sizeof(gPlaybackFuncs) / sizeof(void *)));
-            ALOGE("playCoreCommands error con %p, cmd %i", con, cmdID);
-            mToCore.printDebugData();
+        if (p[1].revents && !p[0].revents) {
+            // We want to finish processing fifo events before processing the vsync.
+            // Otherwise we can end up falling behind and having tremendous lag.
+            break;
         }
-        gPlaybackFuncs[cmdID](con, data, cmdSize << 2);
-        mToCore.next();
     }
     return ret;
 }
 
 RsMessageToClientType ThreadIO::getClientHeader(size_t *receiveLen, uint32_t *usrID) {
-    if (mUsingSocket) {
-        mToClientSocket.read(&mLastClientHeader, sizeof(mLastClientHeader));
-    } else {
-        size_t bytesData = 0;
-        const uint32_t *d = (const uint32_t *)mToClient.get(&mLastClientHeader.cmdID, (uint32_t*)&bytesData);
-        if (bytesData >= sizeof(uint32_t)) {
-            mLastClientHeader.userID = d[0];
-            mLastClientHeader.bytes = bytesData - sizeof(uint32_t);
-        } else {
-            mLastClientHeader.userID = 0;
-            mLastClientHeader.bytes = 0;
-        }
-    }
+    //ALOGE("getClientHeader");
+    mToClient.read(&mLastClientHeader, sizeof(mLastClientHeader));
+
     receiveLen[0] = mLastClientHeader.bytes;
     usrID[0] = mLastClientHeader.userID;
+    //ALOGE("getClientHeader %i %i %i", mLastClientHeader.cmdID, usrID[0], receiveLen[0]);
     return (RsMessageToClientType)mLastClientHeader.cmdID;
 }
 
 RsMessageToClientType ThreadIO::getClientPayload(void *data, size_t *receiveLen,
                                 uint32_t *usrID, size_t bufferLen) {
+    //ALOGE("getClientPayload");
     receiveLen[0] = mLastClientHeader.bytes;
     usrID[0] = mLastClientHeader.userID;
     if (bufferLen < mLastClientHeader.bytes) {
         return RS_MESSAGE_TO_CLIENT_RESIZE;
     }
-    if (mUsingSocket) {
-        if (receiveLen[0]) {
-            mToClientSocket.read(data, receiveLen[0]);
-        }
-        return (RsMessageToClientType)mLastClientHeader.cmdID;
-    } else {
-        uint32_t bytesData = 0;
-        uint32_t commandID = 0;
-        const uint32_t *d = (const uint32_t *)mToClient.get(&commandID, &bytesData);
-        //ALOGE("getMessageToClient 3    %i  %i", commandID, bytesData);
-        //ALOGE("getMessageToClient  %i %i", commandID, *subID);
-        if (bufferLen >= receiveLen[0]) {
-            memcpy(data, d+1, receiveLen[0]);
-            mToClient.next();
-            return (RsMessageToClientType)commandID;
-        }
+    if (receiveLen[0]) {
+        mToClient.read(data, receiveLen[0]);
     }
-    return RS_MESSAGE_TO_CLIENT_RESIZE;
+    //ALOGE("getClientPayload x");
+    return (RsMessageToClientType)mLastClientHeader.cmdID;
 }
 
 bool ThreadIO::sendToClient(RsMessageToClientType cmdID, uint32_t usrID, const void *data,
                             size_t dataLen, bool waitForSpace) {
+
+    //ALOGE("sendToClient %i %i %i", cmdID, usrID, (int)dataLen);
     ClientCmdHeader hdr;
     hdr.bytes = dataLen;
     hdr.cmdID = cmdID;
     hdr.userID = usrID;
-    if (mUsingSocket) {
-        mToClientSocket.writeAsync(&hdr, sizeof(hdr));
-        if (dataLen) {
-            mToClientSocket.writeAsync(data, dataLen);
-        }
-        return true;
-    } else {
-        if (!waitForSpace) {
-            if (!mToClient.makeSpaceNonBlocking(dataLen + sizeof(hdr))) {
-                // Not enough room, and not waiting.
-                return false;
-            }
-        }
 
-        //ALOGE("sendMessageToClient 2");
-        uint32_t *p = (uint32_t *)mToClient.reserve(dataLen + sizeof(usrID));
-        p[0] = usrID;
-        if (dataLen > 0) {
-            memcpy(p+1, data, dataLen);
-        }
-        mToClient.commit(cmdID, dataLen + sizeof(usrID));
-        //ALOGE("sendMessageToClient 3");
-        return true;
+    mToClient.writeAsync(&hdr, sizeof(hdr));
+    if (dataLen) {
+        mToClient.writeAsync(data, dataLen);
     }
-    return false;
+
+    //ALOGE("sendToClient x");
+    return true;
 }
 
diff --git a/libs/rs/rsThreadIO.h b/libs/rs/rsThreadIO.h
index ebce0ab..d56a1c9 100644
--- a/libs/rs/rsThreadIO.h
+++ b/libs/rs/rsThreadIO.h
@@ -18,7 +18,6 @@
 #define ANDROID_RS_THREAD_IO_H
 
 #include "rsUtils.h"
-#include "rsLocklessFifo.h"
 #include "rsFifoSocket.h"
 
 // ---------------------------------------------------------------------------
@@ -32,23 +31,17 @@
     ThreadIO();
     ~ThreadIO();
 
-    void init(bool useSocket = false);
+    void init();
     void shutdown();
 
     // Plays back commands from the client.
     // Returns true if any commands were processed.
-    bool playCoreCommands(Context *con, bool waitForCommand, uint64_t timeToWait);
+    bool playCoreCommands(Context *con, bool waitForCommand, int waitFd);
 
-    void setTimoutCallback(void (*)(void *), void *, uint64_t timeout);
-    //LocklessCommandFifo mToCore;
+    void setTimeoutCallback(void (*)(void *), void *, uint64_t timeout);
 
-
-
-    void coreFlush();
     void * coreHeader(uint32_t, size_t dataLen);
-    void coreData(const void *data, size_t dataLen);
     void coreCommit();
-    void coreCommitSync();
     void coreSetReturn(const void *data, size_t dataLen);
     void coreGetReturn(void *data, size_t dataLen);
 
@@ -71,20 +64,16 @@
     } ClientCmdHeader;
     ClientCmdHeader mLastClientHeader;
 
-    size_t mCoreCommandSize;
-    uint32_t mCoreCommandID;
-    uint8_t * mCoreDataPtr;
-    uint8_t * mCoreDataBasePtr;
+    bool mRunning;
 
-    bool mUsingSocket;
-    LocklessCommandFifo mToClient;
-    LocklessCommandFifo mToCore;
-
-    FifoSocket mToClientSocket;
-    FifoSocket mToCoreSocket;
+    FifoSocket mToClient;
+    FifoSocket mToCore;
 
     intptr_t mToCoreRet;
 
+    size_t mSendLen;
+    uint8_t mSendBuffer[2 * 1024];
+
 };
 
 
diff --git a/libs/rs/rsg_generator.c b/libs/rs/rsg_generator.c
index 6b84e56..385c8b5 100644
--- a/libs/rs/rsg_generator.c
+++ b/libs/rs/rsg_generator.c
@@ -256,7 +256,7 @@
                     fprintf(f, "        memcpy(payload, %s, %s_length);\n", vt->name, vt->name);
                     fprintf(f, "        cmd->%s = (", vt->name);
                     printVarType(f, vt);
-                    fprintf(f, ")payload;\n");
+                    fprintf(f, ")(payload - ((uint8_t *)&cmd[1]));\n");
                     fprintf(f, "        payload += %s_length;\n", vt->name);
                     fprintf(f, "    } else {\n");
                     fprintf(f, "        cmd->%s = %s;\n", vt->name, vt->name);
@@ -270,26 +270,19 @@
                 needFlush = 1;
             }
 
+            fprintf(f, "    io->coreCommit();\n");
             if (hasInlineDataPointers(api)) {
-                fprintf(f, "    if (dataSize < 1024) {\n");
-                fprintf(f, "        io->coreCommit();\n");
-                fprintf(f, "    } else {\n");
-                fprintf(f, "        io->coreCommitSync();\n");
+                fprintf(f, "    if (dataSize >= 1024) {\n");
+                fprintf(f, "        io->coreGetReturn(NULL, 0);\n");
                 fprintf(f, "    }\n");
-            } else {
-                fprintf(f, "    io->coreCommit");
-                if (needFlush) {
-                    fprintf(f, "Sync");
-                }
-                fprintf(f, "();\n");
-            }
-
-            if (api->ret.typeName[0]) {
+            } else if (api->ret.typeName[0]) {
                 fprintf(f, "\n    ");
                 printVarType(f, &api->ret);
                 fprintf(f, " ret;\n");
                 fprintf(f, "    io->coreGetReturn(&ret, sizeof(ret));\n");
                 fprintf(f, "    return ret;\n");
+            } else if (needFlush) {
+                fprintf(f, "    io->coreGetReturn(NULL, 0);\n");
             }
         }
         fprintf(f, "};\n\n");
@@ -434,6 +427,7 @@
 
     for (ct=0; ct < apiCount; ct++) {
         const ApiEntry * api = &apis[ct];
+        int needFlush = 0;
 
         if (api->direct) {
             continue;
@@ -444,6 +438,13 @@
         //fprintf(f, "    ALOGE(\"play command %s\\n\");\n", api->name);
         fprintf(f, "    const RS_CMD_%s *cmd = static_cast<const RS_CMD_%s *>(vp);\n", api->name, api->name);
 
+        if (hasInlineDataPointers(api)) {
+            fprintf(f, "    const uint8_t *baseData = 0;\n");
+            fprintf(f, "    if (cmdSizeBytes != sizeof(RS_CMD_%s)) {\n", api->name);
+            fprintf(f, "        baseData = &((const uint8_t *)vp)[sizeof(*cmd)];\n");
+            fprintf(f, "    }\n");
+        }
+
         fprintf(f, "    ");
         if (api->ret.typeName[0]) {
             fprintf(f, "\n    ");
@@ -453,12 +454,31 @@
         fprintf(f, "rsi_%s(con", api->name);
         for (ct2=0; ct2 < api->paramCount; ct2++) {
             const VarType *vt = &api->params[ct2];
-            fprintf(f, ",\n           cmd->%s", vt->name);
+            needFlush += vt->ptrLevel;
+
+            if (hasInlineDataPointers(api) && vt->ptrLevel) {
+                fprintf(f, ",\n           (const %s *)&baseData[(intptr_t)cmd->%s]", vt->typeName, vt->name);
+            } else {
+                fprintf(f, ",\n           cmd->%s", vt->name);
+            }
         }
         fprintf(f, ");\n");
 
-        if (api->ret.typeName[0]) {
+        if (hasInlineDataPointers(api)) {
+            fprintf(f, "    size_t totalSize = 0;\n");
+            for (ct2=0; ct2 < api->paramCount; ct2++) {
+                if (api->params[ct2].ptrLevel) {
+                    fprintf(f, "    totalSize += cmd->%s_length;\n", api->params[ct2].name);
+                }
+            }
+
+            fprintf(f, "    if ((totalSize != 0) && (cmdSizeBytes == sizeof(RS_CMD_%s))) {\n", api->name);
+            fprintf(f, "        con->mIO.coreSetReturn(NULL, 0);\n");
+            fprintf(f, "    }\n");
+        } else if (api->ret.typeName[0]) {
             fprintf(f, "    con->mIO.coreSetReturn(&ret, sizeof(ret));\n");
+        } else if (api->sync || needFlush) {
+            fprintf(f, "    con->mIO.coreSetReturn(NULL, 0);\n");
         }
 
         fprintf(f, "};\n\n");
@@ -466,6 +486,7 @@
 
     for (ct=0; ct < apiCount; ct++) {
         const ApiEntry * api = &apis[ct];
+        int needFlush = 0;
 
         fprintf(f, "void rspr_%s(Context *con, Fifo *f, uint8_t *scratch, size_t scratchSize) {\n", api->name);
 
@@ -475,6 +496,7 @@
 
         for (ct2=0; ct2 < api->paramCount; ct2++) {
             const VarType *vt = &api->params[ct2];
+            needFlush += vt->ptrLevel;
             if (vt->ptrLevel == 1) {
                 fprintf(f, "    cmd.%s = (", vt->name);
                 printVarType(f, vt);
@@ -515,6 +537,8 @@
 
         if (api->ret.typeName[0]) {
             fprintf(f, "    f->readReturn(&ret, sizeof(ret));\n");
+        } else if (needFlush) {
+            fprintf(f, "    f->readReturn(NULL, 0);\n");
         }
 
         fprintf(f, "};\n\n");
diff --git a/libs/rs/scriptc/rs_allocation.rsh b/libs/rs/scriptc/rs_allocation.rsh
index 1cb3a99..9ec03bf 100644
--- a/libs/rs/scriptc/rs_allocation.rsh
+++ b/libs/rs/scriptc/rs_allocation.rsh
@@ -28,13 +28,13 @@
  *
  * To use Renderscript, you need to utilize the Renderscript runtime APIs documented here
  * as well as the Android framework APIs for Renderscript.
- * For documentation on the Android framework APIs, see the <a href=
+ * For documentation on the Android framework APIs, see the <a target="_parent" href=
  * "http://developer.android.com/reference/android/renderscript/package-summary.html">
  * android.renderscript</a> package reference.
  * For more information on how to develop with Renderscript and how the runtime and
- * Android framework APIs interact, see the <a href=
+ * Android framework APIs interact, see the <a target="_parent" href=
  * "http://developer.android.com/guide/topics/renderscript/index.html">Renderscript
- * developer guide</a> and the <a href=
+ * developer guide</a> and the <a target="_parent" href=
  * "http://developer.android.com/resources/samples/RenderScript/index.html">
  * Renderscript samples</a>.
  */
diff --git a/libs/rs/scriptc/rs_atomic.rsh b/libs/rs/scriptc/rs_atomic.rsh
index 87c6c02..a455edd 100644
--- a/libs/rs/scriptc/rs_atomic.rsh
+++ b/libs/rs/scriptc/rs_atomic.rsh
@@ -242,7 +242,7 @@
  * @return old value
  */
 extern uint32_t __attribute__((overloadable))
-    rsAtomicCas(volatile uint32_t* addr, int32_t compareValue, int32_t newValue);
+    rsAtomicCas(volatile uint32_t* addr, uint32_t compareValue, uint32_t newValue);
 
 #endif //defined(RS_VERSION) && (RS_VERSION >= 14)
 
diff --git a/libs/ui/Android.mk b/libs/ui/Android.mk
index fbabfc4..f8b4452 100644
--- a/libs/ui/Android.mk
+++ b/libs/ui/Android.mk
@@ -47,7 +47,6 @@
 	GraphicBuffer.cpp \
 	GraphicBufferAllocator.cpp \
 	GraphicBufferMapper.cpp \
-	GraphicLog.cpp \
 	InputTransport.cpp \
 	PixelFormat.cpp \
 	Rect.cpp \
diff --git a/libs/ui/FramebufferNativeWindow.cpp b/libs/ui/FramebufferNativeWindow.cpp
index f5ed981..d1dca0c 100644
--- a/libs/ui/FramebufferNativeWindow.cpp
+++ b/libs/ui/FramebufferNativeWindow.cpp
@@ -29,7 +29,6 @@
 
 #include <ui/Rect.h>
 #include <ui/FramebufferNativeWindow.h>
-#include <ui/GraphicLog.h>
 
 #include <EGL/egl.h>
 
@@ -211,9 +210,6 @@
     if (self->mBufferHead >= self->mNumBuffers)
         self->mBufferHead = 0;
 
-    GraphicLog& logger(GraphicLog::getInstance());
-    logger.log(GraphicLog::SF_FB_DEQUEUE_BEFORE, index);
-
     // wait for a free buffer
     while (!self->mNumFreeBuffers) {
         self->mCondition.wait(self->mutex);
@@ -224,7 +220,6 @@
 
     *buffer = self->buffers[index].get();
 
-    logger.log(GraphicLog::SF_FB_DEQUEUE_AFTER, index);
     return 0;
 }
 
@@ -235,16 +230,12 @@
     Mutex::Autolock _l(self->mutex);
 
     const int index = self->mCurrentBufferIndex;
-    GraphicLog& logger(GraphicLog::getInstance());
-    logger.log(GraphicLog::SF_FB_LOCK_BEFORE, index);
 
     // wait that the buffer we're locking is not front anymore
     while (self->front == buffer) {
         self->mCondition.wait(self->mutex);
     }
 
-    logger.log(GraphicLog::SF_FB_LOCK_AFTER, index);
-
     return NO_ERROR;
 }
 
@@ -257,13 +248,7 @@
     buffer_handle_t handle = static_cast<NativeBuffer*>(buffer)->handle;
 
     const int index = self->mCurrentBufferIndex;
-    GraphicLog& logger(GraphicLog::getInstance());
-    logger.log(GraphicLog::SF_FB_POST_BEFORE, index);
-
     int res = fb->post(fb, handle);
-
-    logger.log(GraphicLog::SF_FB_POST_AFTER, index);
-
     self->front = static_cast<NativeBuffer*>(buffer);
     self->mNumFreeBuffers++;
     self->mCondition.broadcast();
diff --git a/libs/ui/GraphicLog.cpp b/libs/ui/GraphicLog.cpp
deleted file mode 100644
index 7ba2779..0000000
--- a/libs/ui/GraphicLog.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <cutils/log.h>
-#include <cutils/properties.h>
-#include <utils/Endian.h>
-#include <utils/Timers.h>
-
-#include <ui/GraphicLog.h>
-
-namespace android {
-
-ANDROID_SINGLETON_STATIC_INSTANCE(GraphicLog)
-
-static inline
-void writeInt32(uint8_t* base, size_t& pos, int32_t value) {
-#ifdef HAVE_LITTLE_ENDIAN
-    int32_t v = value;
-#else
-    int32_t v = htole32(value);
-#endif
-    base[pos] = EVENT_TYPE_INT;
-    memcpy(&base[pos+1], &v, sizeof(int32_t));
-    pos += 1+sizeof(int32_t);
-}
-
-static inline
-void writeInt64(uint8_t* base,  size_t& pos, int64_t value) {
-#ifdef HAVE_LITTLE_ENDIAN
-    int64_t v = value;
-#else
-    int64_t v = htole64(value);
-#endif
-    base[pos] = EVENT_TYPE_LONG;
-    memcpy(&base[pos+1], &v, sizeof(int64_t));
-    pos += 1+sizeof(int64_t);
-}
-
-void GraphicLog::logImpl(int32_t tag, int32_t buffer)
-{
-    uint8_t scratch[2 + 2 + sizeof(int32_t) + sizeof(int64_t)];
-    size_t pos = 0;
-    scratch[pos++] = EVENT_TYPE_LIST;
-    scratch[pos++] = 2;
-    writeInt32(scratch, pos, buffer);
-    writeInt64(scratch, pos, ns2ms( systemTime( SYSTEM_TIME_MONOTONIC ) ));
-    android_bWriteLog(tag, scratch, sizeof(scratch));
-}
-
-void GraphicLog::logImpl(int32_t tag, int32_t identity, int32_t buffer)
-{
-    uint8_t scratch[2 + 3 + sizeof(int32_t) + sizeof(int32_t) + sizeof(int64_t)];
-    size_t pos = 0;
-    scratch[pos++] = EVENT_TYPE_LIST;
-    scratch[pos++] = 3;
-    writeInt32(scratch, pos, buffer);
-    writeInt32(scratch, pos, identity);
-    writeInt64(scratch, pos, ns2ms( systemTime( SYSTEM_TIME_MONOTONIC ) ));
-    android_bWriteLog(tag, scratch, sizeof(scratch));
-}
-
-GraphicLog::GraphicLog()
-    : mEnabled(0)
-{
-    char property[PROPERTY_VALUE_MAX];
-    if (property_get("debug.graphic_log", property, NULL) > 0) {
-        mEnabled = atoi(property);
-    }
-}
-
-void GraphicLog::setEnabled(bool enable)
-{
-    mEnabled = enable;
-}
-
-}
diff --git a/libs/ui/Region.cpp b/libs/ui/Region.cpp
index 8cd047a..6e2e731 100644
--- a/libs/ui/Region.cpp
+++ b/libs/ui/Region.cpp
@@ -126,6 +126,9 @@
 Region& Region::orSelf(const Rect& r) {
     return operationSelf(r, op_or);
 }
+Region& Region::xorSelf(const Rect& r) {
+    return operationSelf(r, op_xor);
+}
 Region& Region::andSelf(const Rect& r) {
     return operationSelf(r, op_and);
 }
@@ -143,6 +146,9 @@
 Region& Region::orSelf(const Region& rhs) {
     return operationSelf(rhs, op_or);
 }
+Region& Region::xorSelf(const Region& rhs) {
+    return operationSelf(rhs, op_xor);
+}
 Region& Region::andSelf(const Region& rhs) {
     return operationSelf(rhs, op_and);
 }
@@ -165,6 +171,9 @@
 const Region Region::merge(const Rect& rhs) const {
     return operation(rhs, op_or);
 }
+const Region Region::mergeExclusive(const Rect& rhs) const {
+    return operation(rhs, op_xor);
+}
 const Region Region::intersect(const Rect& rhs) const {
     return operation(rhs, op_and);
 }
@@ -182,6 +191,9 @@
 const Region Region::merge(const Region& rhs) const {
     return operation(rhs, op_or);
 }
+const Region Region::mergeExclusive(const Region& rhs) const {
+    return operation(rhs, op_xor);
+}
 const Region Region::intersect(const Region& rhs) const {
     return operation(rhs, op_and);
 }
@@ -205,6 +217,9 @@
 Region& Region::orSelf(const Region& rhs, int dx, int dy) {
     return operationSelf(rhs, dx, dy, op_or);
 }
+Region& Region::xorSelf(const Region& rhs, int dx, int dy) {
+    return operationSelf(rhs, dx, dy, op_xor);
+}
 Region& Region::andSelf(const Region& rhs, int dx, int dy) {
     return operationSelf(rhs, dx, dy, op_and);
 }
@@ -222,6 +237,9 @@
 const Region Region::merge(const Region& rhs, int dx, int dy) const {
     return operation(rhs, dx, dy, op_or);
 }
+const Region Region::mergeExclusive(const Region& rhs, int dx, int dy) const {
+    return operation(rhs, dx, dy, op_xor);
+}
 const Region Region::intersect(const Region& rhs, int dx, int dy) const {
     return operation(rhs, dx, dy, op_and);
 }
@@ -421,6 +439,7 @@
     SkRegion::Op sk_op;
     switch (op) {
         case op_or: sk_op = SkRegion::kUnion_Op; name="OR"; break;
+        case op_xor: sk_op = SkRegion::kUnion_XOR; name="XOR"; break;
         case op_and: sk_op = SkRegion::kIntersect_Op; name="AND"; break;
         case op_nand: sk_op = SkRegion::kDifference_Op; name="NAND"; break;
     }
diff --git a/libs/usb/tests/AccessoryChat/Android.mk b/libs/usb/tests/AccessoryChat/Android.mk
index 77b8424..ecb455a 100644
--- a/libs/usb/tests/AccessoryChat/Android.mk
+++ b/libs/usb/tests/AccessoryChat/Android.mk
@@ -23,9 +23,4 @@
 
 LOCAL_PACKAGE_NAME := AccessoryChat
 
-LOCAL_JAVA_LIBRARIES := com.android.future.usb.accessory
-
-# Force an old SDK version to make sure we aren't using newer UsbManager APIs
-LOCAL_SDK_VERSION := 8
-
 include $(BUILD_PACKAGE)
diff --git a/libs/usb/tests/AccessoryChat/AndroidManifest.xml b/libs/usb/tests/AccessoryChat/AndroidManifest.xml
index 802b715..6667eba 100644
--- a/libs/usb/tests/AccessoryChat/AndroidManifest.xml
+++ b/libs/usb/tests/AccessoryChat/AndroidManifest.xml
@@ -17,8 +17,9 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
         package="com.android.accessorychat">
 
+    <uses-feature android:name="android.hardware.usb.accessory" />
+
     <application android:label="Accessory Chat">
-        <uses-library android:name="com.android.future.usb.accessory" />
 
         <activity android:name="AccessoryChat" android:label="Accessory Chat">
             <intent-filter>
@@ -35,5 +36,5 @@
                 android:resource="@xml/accessory_filter" />
         </activity>
     </application>
-    <uses-sdk android:minSdkVersion="10" />
+    <uses-sdk android:minSdkVersion="12" />
 </manifest>
diff --git a/libs/usb/tests/AccessoryChat/accessorychat/accessorychat.c b/libs/usb/tests/AccessoryChat/accessorychat/accessorychat.c
index 85b52dd..06b477f 100644
--- a/libs/usb/tests/AccessoryChat/accessorychat/accessorychat.c
+++ b/libs/usb/tests/AccessoryChat/accessorychat/accessorychat.c
@@ -98,7 +98,7 @@
     vendorId = usb_device_get_vendor_id(device);
     productId = usb_device_get_product_id(device);
 
-    if (vendorId == 0x18D1 || vendorId == 0x22B8) {
+    if (vendorId == 0x18D1 || vendorId == 0x22B8 || vendorId == 0x04e8) {
         if (!sDevice && (productId == 0x2D00 || productId == 0x2D01)) {
             struct usb_descriptor_header* desc;
             struct usb_descriptor_iter iter;
diff --git a/libs/usb/tests/AccessoryChat/src/com/android/accessorychat/AccessoryChat.java b/libs/usb/tests/AccessoryChat/src/com/android/accessorychat/AccessoryChat.java
index c3f4fa3..bf0cef0 100644
--- a/libs/usb/tests/AccessoryChat/src/com/android/accessorychat/AccessoryChat.java
+++ b/libs/usb/tests/AccessoryChat/src/com/android/accessorychat/AccessoryChat.java
@@ -33,8 +33,8 @@
 import android.widget.EditText;
 import android.widget.TextView;
 
-import com.android.future.usb.UsbAccessory;
-import com.android.future.usb.UsbManager;
+import android.hardware.usb.UsbManager;
+import android.hardware.usb.UsbAccessory;
 
 import java.io.FileDescriptor;
 import java.io.FileInputStream;
@@ -64,9 +64,11 @@
         public void onReceive(Context context, Intent intent) {
             if (ACTION_USB_PERMISSION.equals(intent.getAction())) {
                 synchronized (this) {
-                    UsbAccessory accessory = UsbManager.getAccessory(intent);
+                    UsbAccessory accessory = (UsbAccessory) intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);
                     if (intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false)) {
-                        openAccessory(accessory);
+                        if (accessory != null) {
+                            openAccessory(accessory);
+                        }
                     } else {
                         Log.d(TAG, "permission denied for accessory " + accessory);
                     }
@@ -80,7 +82,7 @@
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
-        mUsbManager = UsbManager.getInstance(this);
+        mUsbManager = (UsbManager) getSystemService(Context.USB_SERVICE);
         mPermissionIntent = PendingIntent.getBroadcast(this, 0, new Intent(ACTION_USB_PERMISSION), 0);
         IntentFilter filter = new IntentFilter(ACTION_USB_PERMISSION);
         registerReceiver(mUsbReceiver, filter);
diff --git a/libs/utils/Android.mk b/libs/utils/Android.mk
index 544ab74..24cf504 100644
--- a/libs/utils/Android.mk
+++ b/libs/utils/Android.mk
@@ -98,7 +98,8 @@
 
 LOCAL_C_INCLUDES += \
 		external/zlib \
-		external/icu4c/common
+		external/icu4c/common \
+		bionic/libc/private
 
 LOCAL_LDLIBS += -lpthread
 
@@ -114,7 +115,10 @@
 
 ifeq ($(TARGET_OS),linux)
 include $(CLEAR_VARS)
-LOCAL_C_INCLUDES += external/zlib external/icu4c/common
+LOCAL_C_INCLUDES += \
+		external/zlib \
+		external/icu4c/common \
+		bionic/libc/private
 LOCAL_LDLIBS := -lrt -ldl -lpthread
 LOCAL_MODULE := libutils
 LOCAL_SRC_FILES := $(commonSources) BackupData.cpp BackupHelpers.cpp
diff --git a/libs/utils/RefBase.cpp b/libs/utils/RefBase.cpp
index ad0939e..e80a795 100644
--- a/libs/utils/RefBase.cpp
+++ b/libs/utils/RefBase.cpp
@@ -332,7 +332,7 @@
     
     refs->addStrongRef(id);
     const int32_t c = android_atomic_inc(&refs->mStrong);
-    LOG_ASSERT(c > 0, "incStrong() called on %p after last strong ref", refs);
+    ALOG_ASSERT(c > 0, "incStrong() called on %p after last strong ref", refs);
 #if PRINT_REFS
     ALOGD("incStrong of %p from %p: cnt=%d\n", this, id, c);
 #endif
@@ -352,7 +352,7 @@
 #if PRINT_REFS
     ALOGD("decStrong of %p from %p: cnt=%d\n", this, id, c);
 #endif
-    LOG_ASSERT(c >= 1, "decStrong() called on %p too many times", refs);
+    ALOG_ASSERT(c >= 1, "decStrong() called on %p too many times", refs);
     if (c == 1) {
         refs->mBase->onLastStrongRef(id);
         if ((refs->mFlags&OBJECT_LIFETIME_MASK) == OBJECT_LIFETIME_STRONG) {
@@ -369,7 +369,7 @@
     
     refs->addStrongRef(id);
     const int32_t c = android_atomic_inc(&refs->mStrong);
-    LOG_ASSERT(c >= 0, "forceIncStrong called on %p after ref count underflow",
+    ALOG_ASSERT(c >= 0, "forceIncStrong called on %p after ref count underflow",
                refs);
 #if PRINT_REFS
     ALOGD("forceIncStrong of %p from %p: cnt=%d\n", this, id, c);
@@ -399,7 +399,7 @@
     weakref_impl* const impl = static_cast<weakref_impl*>(this);
     impl->addWeakRef(id);
     const int32_t c = android_atomic_inc(&impl->mWeak);
-    LOG_ASSERT(c >= 0, "incWeak called on %p after last weak ref", this);
+    ALOG_ASSERT(c >= 0, "incWeak called on %p after last weak ref", this);
 }
 
 
@@ -408,7 +408,7 @@
     weakref_impl* const impl = static_cast<weakref_impl*>(this);
     impl->removeWeakRef(id);
     const int32_t c = android_atomic_dec(&impl->mWeak);
-    LOG_ASSERT(c >= 1, "decWeak called on %p too many times", this);
+    ALOG_ASSERT(c >= 1, "decWeak called on %p too many times", this);
     if (c != 1) return;
 
     if ((impl->mFlags&OBJECT_LIFETIME_WEAK) == OBJECT_LIFETIME_STRONG) {
@@ -442,7 +442,7 @@
     weakref_impl* const impl = static_cast<weakref_impl*>(this);
     
     int32_t curCount = impl->mStrong;
-    LOG_ASSERT(curCount >= 0, "attemptIncStrong called on %p after underflow",
+    ALOG_ASSERT(curCount >= 0, "attemptIncStrong called on %p after underflow",
                this);
     while (curCount > 0 && curCount != INITIAL_STRONG_VALUE) {
         if (android_atomic_cmpxchg(curCount, curCount+1, &impl->mStrong) == 0) {
@@ -503,7 +503,7 @@
     weakref_impl* const impl = static_cast<weakref_impl*>(this);
 
     int32_t curCount = impl->mWeak;
-    LOG_ASSERT(curCount >= 0, "attemptIncWeak called on %p after underflow",
+    ALOG_ASSERT(curCount >= 0, "attemptIncWeak called on %p after underflow",
                this);
     while (curCount > 0) {
         if (android_atomic_cmpxchg(curCount, curCount+1, &impl->mWeak) == 0) {
diff --git a/libs/utils/ResourceTypes.cpp b/libs/utils/ResourceTypes.cpp
index 15b83bb..3fa562e 100644
--- a/libs/utils/ResourceTypes.cpp
+++ b/libs/utils/ResourceTypes.cpp
@@ -221,7 +221,7 @@
 static bool assertIdmapHeader(const uint32_t* map, size_t sizeBytes)
 {
     if (sizeBytes < ResTable::IDMAP_HEADER_SIZE_BYTES) {
-        ALOGW("idmap assertion failed: size=%d bytes\n", sizeBytes);
+        ALOGW("idmap assertion failed: size=%d bytes\n", (int)sizeBytes);
         return false;
     }
     if (*map != htodl(IDMAP_MAGIC)) { // htodl: map data expected to be in correct endianess
@@ -250,7 +250,7 @@
         return UNKNOWN_ERROR;
     }
     if (typeCount > size) {
-        ALOGW("Resource ID map: number of types=%d exceeds size of map=%d\n", typeCount, size);
+        ALOGW("Resource ID map: number of types=%d exceeds size of map=%d\n", typeCount, (int)size);
         return UNKNOWN_ERROR;
     }
     const uint32_t typeOffset = map[type];
@@ -260,7 +260,7 @@
     }
     if (typeOffset + 1 > size) {
         ALOGW("Resource ID map: type offset=%d exceeds reasonable value, size of map=%d\n",
-             typeOffset, size);
+             typeOffset, (int)size);
         return UNKNOWN_ERROR;
     }
     const uint32_t entryCount = map[typeOffset];
@@ -271,7 +271,7 @@
     }
     const uint32_t index = typeOffset + 2 + entry - entryOffset;
     if (index > size) {
-        ALOGW("Resource ID map: entry index=%d exceeds size of map=%d\n", index, size);
+        ALOGW("Resource ID map: entry index=%d exceeds size of map=%d\n", index, (int)size);
         *outValue = 0;
         return NO_ERROR;
     }
@@ -659,6 +659,16 @@
     return NULL;
 }
 
+const String8 ResStringPool::string8ObjectAt(size_t idx) const
+{
+    size_t len;
+    const char *str = (const char*)string8At(idx, &len);
+    if (str != NULL) {
+        return String8(str);
+    }
+    return String8(stringAt(idx, &len));
+}
+
 const ResStringPool_span* ResStringPool::styleAt(const ResStringPool_ref& ref) const
 {
     return styleAt(ref.index);
@@ -738,12 +748,25 @@
     return (mError == NO_ERROR) ? mHeader->stringCount : 0;
 }
 
-#ifndef HAVE_ANDROID_OS
+size_t ResStringPool::styleCount() const
+{
+    return (mError == NO_ERROR) ? mHeader->styleCount : 0;
+}
+
+size_t ResStringPool::bytes() const
+{
+    return (mError == NO_ERROR) ? mHeader->header.size : 0;
+}
+
+bool ResStringPool::isSorted() const
+{
+    return (mHeader->flags&ResStringPool_header::SORTED_FLAG)!=0;
+}
+
 bool ResStringPool::isUTF8() const
 {
     return (mHeader->flags&ResStringPool_header::UTF8_FLAG)!=0;
 }
-#endif
 
 // --------------------------------------------------------------------
 // --------------------------------------------------------------------
@@ -1367,6 +1390,873 @@
 // --------------------------------------------------------------------
 // --------------------------------------------------------------------
 
+void ResTable_config::copyFromDeviceNoSwap(const ResTable_config& o) {
+    const size_t size = dtohl(o.size);
+    if (size >= sizeof(ResTable_config)) {
+        *this = o;
+    } else {
+        memcpy(this, &o, size);
+        memset(((uint8_t*)this)+size, 0, sizeof(ResTable_config)-size);
+    }
+}
+
+void ResTable_config::copyFromDtoH(const ResTable_config& o) {
+    copyFromDeviceNoSwap(o);
+    size = sizeof(ResTable_config);
+    mcc = dtohs(mcc);
+    mnc = dtohs(mnc);
+    density = dtohs(density);
+    screenWidth = dtohs(screenWidth);
+    screenHeight = dtohs(screenHeight);
+    sdkVersion = dtohs(sdkVersion);
+    minorVersion = dtohs(minorVersion);
+    smallestScreenWidthDp = dtohs(smallestScreenWidthDp);
+    screenWidthDp = dtohs(screenWidthDp);
+    screenHeightDp = dtohs(screenHeightDp);
+}
+
+void ResTable_config::swapHtoD() {
+    size = htodl(size);
+    mcc = htods(mcc);
+    mnc = htods(mnc);
+    density = htods(density);
+    screenWidth = htods(screenWidth);
+    screenHeight = htods(screenHeight);
+    sdkVersion = htods(sdkVersion);
+    minorVersion = htods(minorVersion);
+    smallestScreenWidthDp = htods(smallestScreenWidthDp);
+    screenWidthDp = htods(screenWidthDp);
+    screenHeightDp = htods(screenHeightDp);
+}
+
+int ResTable_config::compare(const ResTable_config& o) const {
+    int32_t diff = (int32_t)(imsi - o.imsi);
+    if (diff != 0) return diff;
+    diff = (int32_t)(locale - o.locale);
+    if (diff != 0) return diff;
+    diff = (int32_t)(screenType - o.screenType);
+    if (diff != 0) return diff;
+    diff = (int32_t)(input - o.input);
+    if (diff != 0) return diff;
+    diff = (int32_t)(screenSize - o.screenSize);
+    if (diff != 0) return diff;
+    diff = (int32_t)(version - o.version);
+    if (diff != 0) return diff;
+    diff = (int32_t)(screenLayout - o.screenLayout);
+    if (diff != 0) return diff;
+    diff = (int32_t)(uiMode - o.uiMode);
+    if (diff != 0) return diff;
+    diff = (int32_t)(smallestScreenWidthDp - o.smallestScreenWidthDp);
+    if (diff != 0) return diff;
+    diff = (int32_t)(screenSizeDp - o.screenSizeDp);
+    return (int)diff;
+}
+
+int ResTable_config::compareLogical(const ResTable_config& o) const {
+    if (mcc != o.mcc) {
+        return mcc < o.mcc ? -1 : 1;
+    }
+    if (mnc != o.mnc) {
+        return mnc < o.mnc ? -1 : 1;
+    }
+    if (language[0] != o.language[0]) {
+        return language[0] < o.language[0] ? -1 : 1;
+    }
+    if (language[1] != o.language[1]) {
+        return language[1] < o.language[1] ? -1 : 1;
+    }
+    if (country[0] != o.country[0]) {
+        return country[0] < o.country[0] ? -1 : 1;
+    }
+    if (country[1] != o.country[1]) {
+        return country[1] < o.country[1] ? -1 : 1;
+    }
+    if (smallestScreenWidthDp != o.smallestScreenWidthDp) {
+        return smallestScreenWidthDp < o.smallestScreenWidthDp ? -1 : 1;
+    }
+    if (screenWidthDp != o.screenWidthDp) {
+        return screenWidthDp < o.screenWidthDp ? -1 : 1;
+    }
+    if (screenHeightDp != o.screenHeightDp) {
+        return screenHeightDp < o.screenHeightDp ? -1 : 1;
+    }
+    if (screenWidth != o.screenWidth) {
+        return screenWidth < o.screenWidth ? -1 : 1;
+    }
+    if (screenHeight != o.screenHeight) {
+        return screenHeight < o.screenHeight ? -1 : 1;
+    }
+    if (density != o.density) {
+        return density < o.density ? -1 : 1;
+    }
+    if (orientation != o.orientation) {
+        return orientation < o.orientation ? -1 : 1;
+    }
+    if (touchscreen != o.touchscreen) {
+        return touchscreen < o.touchscreen ? -1 : 1;
+    }
+    if (input != o.input) {
+        return input < o.input ? -1 : 1;
+    }
+    if (screenLayout != o.screenLayout) {
+        return screenLayout < o.screenLayout ? -1 : 1;
+    }
+    if (uiMode != o.uiMode) {
+        return uiMode < o.uiMode ? -1 : 1;
+    }
+    if (version != o.version) {
+        return version < o.version ? -1 : 1;
+    }
+    return 0;
+}
+
+int ResTable_config::diff(const ResTable_config& o) const {
+    int diffs = 0;
+    if (mcc != o.mcc) diffs |= CONFIG_MCC;
+    if (mnc != o.mnc) diffs |= CONFIG_MNC;
+    if (locale != o.locale) diffs |= CONFIG_LOCALE;
+    if (orientation != o.orientation) diffs |= CONFIG_ORIENTATION;
+    if (density != o.density) diffs |= CONFIG_DENSITY;
+    if (touchscreen != o.touchscreen) diffs |= CONFIG_TOUCHSCREEN;
+    if (((inputFlags^o.inputFlags)&(MASK_KEYSHIDDEN|MASK_NAVHIDDEN)) != 0)
+            diffs |= CONFIG_KEYBOARD_HIDDEN;
+    if (keyboard != o.keyboard) diffs |= CONFIG_KEYBOARD;
+    if (navigation != o.navigation) diffs |= CONFIG_NAVIGATION;
+    if (screenSize != o.screenSize) diffs |= CONFIG_SCREEN_SIZE;
+    if (version != o.version) diffs |= CONFIG_VERSION;
+    if (screenLayout != o.screenLayout) diffs |= CONFIG_SCREEN_LAYOUT;
+    if (uiMode != o.uiMode) diffs |= CONFIG_UI_MODE;
+    if (smallestScreenWidthDp != o.smallestScreenWidthDp) diffs |= CONFIG_SMALLEST_SCREEN_SIZE;
+    if (screenSizeDp != o.screenSizeDp) diffs |= CONFIG_SCREEN_SIZE;
+    return diffs;
+}
+
+bool ResTable_config::isMoreSpecificThan(const ResTable_config& o) const {
+    // The order of the following tests defines the importance of one
+    // configuration parameter over another.  Those tests first are more
+    // important, trumping any values in those following them.
+    if (imsi || o.imsi) {
+        if (mcc != o.mcc) {
+            if (!mcc) return false;
+            if (!o.mcc) return true;
+        }
+
+        if (mnc != o.mnc) {
+            if (!mnc) return false;
+            if (!o.mnc) return true;
+        }
+    }
+
+    if (locale || o.locale) {
+        if (language[0] != o.language[0]) {
+            if (!language[0]) return false;
+            if (!o.language[0]) return true;
+        }
+
+        if (country[0] != o.country[0]) {
+            if (!country[0]) return false;
+            if (!o.country[0]) return true;
+        }
+    }
+
+    if (smallestScreenWidthDp || o.smallestScreenWidthDp) {
+        if (smallestScreenWidthDp != o.smallestScreenWidthDp) {
+            if (!smallestScreenWidthDp) return false;
+            if (!o.smallestScreenWidthDp) return true;
+        }
+    }
+
+    if (screenSizeDp || o.screenSizeDp) {
+        if (screenWidthDp != o.screenWidthDp) {
+            if (!screenWidthDp) return false;
+            if (!o.screenWidthDp) return true;
+        }
+
+        if (screenHeightDp != o.screenHeightDp) {
+            if (!screenHeightDp) return false;
+            if (!o.screenHeightDp) return true;
+        }
+    }
+
+    if (screenLayout || o.screenLayout) {
+        if (((screenLayout^o.screenLayout) & MASK_SCREENSIZE) != 0) {
+            if (!(screenLayout & MASK_SCREENSIZE)) return false;
+            if (!(o.screenLayout & MASK_SCREENSIZE)) return true;
+        }
+        if (((screenLayout^o.screenLayout) & MASK_SCREENLONG) != 0) {
+            if (!(screenLayout & MASK_SCREENLONG)) return false;
+            if (!(o.screenLayout & MASK_SCREENLONG)) return true;
+        }
+    }
+
+    if (orientation != o.orientation) {
+        if (!orientation) return false;
+        if (!o.orientation) return true;
+    }
+
+    if (uiMode || o.uiMode) {
+        if (((uiMode^o.uiMode) & MASK_UI_MODE_TYPE) != 0) {
+            if (!(uiMode & MASK_UI_MODE_TYPE)) return false;
+            if (!(o.uiMode & MASK_UI_MODE_TYPE)) return true;
+        }
+        if (((uiMode^o.uiMode) & MASK_UI_MODE_NIGHT) != 0) {
+            if (!(uiMode & MASK_UI_MODE_NIGHT)) return false;
+            if (!(o.uiMode & MASK_UI_MODE_NIGHT)) return true;
+        }
+    }
+
+    // density is never 'more specific'
+    // as the default just equals 160
+
+    if (touchscreen != o.touchscreen) {
+        if (!touchscreen) return false;
+        if (!o.touchscreen) return true;
+    }
+
+    if (input || o.input) {
+        if (((inputFlags^o.inputFlags) & MASK_KEYSHIDDEN) != 0) {
+            if (!(inputFlags & MASK_KEYSHIDDEN)) return false;
+            if (!(o.inputFlags & MASK_KEYSHIDDEN)) return true;
+        }
+
+        if (((inputFlags^o.inputFlags) & MASK_NAVHIDDEN) != 0) {
+            if (!(inputFlags & MASK_NAVHIDDEN)) return false;
+            if (!(o.inputFlags & MASK_NAVHIDDEN)) return true;
+        }
+
+        if (keyboard != o.keyboard) {
+            if (!keyboard) return false;
+            if (!o.keyboard) return true;
+        }
+
+        if (navigation != o.navigation) {
+            if (!navigation) return false;
+            if (!o.navigation) return true;
+        }
+    }
+
+    if (screenSize || o.screenSize) {
+        if (screenWidth != o.screenWidth) {
+            if (!screenWidth) return false;
+            if (!o.screenWidth) return true;
+        }
+
+        if (screenHeight != o.screenHeight) {
+            if (!screenHeight) return false;
+            if (!o.screenHeight) return true;
+        }
+    }
+
+    if (version || o.version) {
+        if (sdkVersion != o.sdkVersion) {
+            if (!sdkVersion) return false;
+            if (!o.sdkVersion) return true;
+        }
+
+        if (minorVersion != o.minorVersion) {
+            if (!minorVersion) return false;
+            if (!o.minorVersion) return true;
+        }
+    }
+    return false;
+}
+
+bool ResTable_config::isBetterThan(const ResTable_config& o,
+        const ResTable_config* requested) const {
+    if (requested) {
+        if (imsi || o.imsi) {
+            if ((mcc != o.mcc) && requested->mcc) {
+                return (mcc);
+            }
+
+            if ((mnc != o.mnc) && requested->mnc) {
+                return (mnc);
+            }
+        }
+
+        if (locale || o.locale) {
+            if ((language[0] != o.language[0]) && requested->language[0]) {
+                return (language[0]);
+            }
+
+            if ((country[0] != o.country[0]) && requested->country[0]) {
+                return (country[0]);
+            }
+        }
+
+        if (smallestScreenWidthDp || o.smallestScreenWidthDp) {
+            // The configuration closest to the actual size is best.
+            // We assume that larger configs have already been filtered
+            // out at this point.  That means we just want the largest one.
+            return smallestScreenWidthDp >= o.smallestScreenWidthDp;
+        }
+
+        if (screenSizeDp || o.screenSizeDp) {
+            // "Better" is based on the sum of the difference between both
+            // width and height from the requested dimensions.  We are
+            // assuming the invalid configs (with smaller dimens) have
+            // already been filtered.  Note that if a particular dimension
+            // is unspecified, we will end up with a large value (the
+            // difference between 0 and the requested dimension), which is
+            // good since we will prefer a config that has specified a
+            // dimension value.
+            int myDelta = 0, otherDelta = 0;
+            if (requested->screenWidthDp) {
+                myDelta += requested->screenWidthDp - screenWidthDp;
+                otherDelta += requested->screenWidthDp - o.screenWidthDp;
+            }
+            if (requested->screenHeightDp) {
+                myDelta += requested->screenHeightDp - screenHeightDp;
+                otherDelta += requested->screenHeightDp - o.screenHeightDp;
+            }
+            //ALOGI("Comparing this %dx%d to other %dx%d in %dx%d: myDelta=%d otherDelta=%d",
+            //    screenWidthDp, screenHeightDp, o.screenWidthDp, o.screenHeightDp,
+            //    requested->screenWidthDp, requested->screenHeightDp, myDelta, otherDelta);
+            return (myDelta <= otherDelta);
+        }
+
+        if (screenLayout || o.screenLayout) {
+            if (((screenLayout^o.screenLayout) & MASK_SCREENSIZE) != 0
+                    && (requested->screenLayout & MASK_SCREENSIZE)) {
+                // A little backwards compatibility here: undefined is
+                // considered equivalent to normal.  But only if the
+                // requested size is at least normal; otherwise, small
+                // is better than the default.
+                int mySL = (screenLayout & MASK_SCREENSIZE);
+                int oSL = (o.screenLayout & MASK_SCREENSIZE);
+                int fixedMySL = mySL;
+                int fixedOSL = oSL;
+                if ((requested->screenLayout & MASK_SCREENSIZE) >= SCREENSIZE_NORMAL) {
+                    if (fixedMySL == 0) fixedMySL = SCREENSIZE_NORMAL;
+                    if (fixedOSL == 0) fixedOSL = SCREENSIZE_NORMAL;
+                }
+                // For screen size, the best match is the one that is
+                // closest to the requested screen size, but not over
+                // (the not over part is dealt with in match() below).
+                if (fixedMySL == fixedOSL) {
+                    // If the two are the same, but 'this' is actually
+                    // undefined, then the other is really a better match.
+                    if (mySL == 0) return false;
+                    return true;
+                }
+                return fixedMySL >= fixedOSL;
+            }
+            if (((screenLayout^o.screenLayout) & MASK_SCREENLONG) != 0
+                    && (requested->screenLayout & MASK_SCREENLONG)) {
+                return (screenLayout & MASK_SCREENLONG);
+            }
+        }
+
+        if ((orientation != o.orientation) && requested->orientation) {
+            return (orientation);
+        }
+
+        if (uiMode || o.uiMode) {
+            if (((uiMode^o.uiMode) & MASK_UI_MODE_TYPE) != 0
+                    && (requested->uiMode & MASK_UI_MODE_TYPE)) {
+                return (uiMode & MASK_UI_MODE_TYPE);
+            }
+            if (((uiMode^o.uiMode) & MASK_UI_MODE_NIGHT) != 0
+                    && (requested->uiMode & MASK_UI_MODE_NIGHT)) {
+                return (uiMode & MASK_UI_MODE_NIGHT);
+            }
+        }
+
+        if (screenType || o.screenType) {
+            if (density != o.density) {
+                // density is tough.  Any density is potentially useful
+                // because the system will scale it.  Scaling down
+                // is generally better than scaling up.
+                // Default density counts as 160dpi (the system default)
+                // TODO - remove 160 constants
+                int h = (density?density:160);
+                int l = (o.density?o.density:160);
+                bool bImBigger = true;
+                if (l > h) {
+                    int t = h;
+                    h = l;
+                    l = t;
+                    bImBigger = false;
+                }
+
+                int reqValue = (requested->density?requested->density:160);
+                if (reqValue >= h) {
+                    // requested value higher than both l and h, give h
+                    return bImBigger;
+                }
+                if (l >= reqValue) {
+                    // requested value lower than both l and h, give l
+                    return !bImBigger;
+                }
+                // saying that scaling down is 2x better than up
+                if (((2 * l) - reqValue) * h > reqValue * reqValue) {
+                    return !bImBigger;
+                } else {
+                    return bImBigger;
+                }
+            }
+
+            if ((touchscreen != o.touchscreen) && requested->touchscreen) {
+                return (touchscreen);
+            }
+        }
+
+        if (input || o.input) {
+            const int keysHidden = inputFlags & MASK_KEYSHIDDEN;
+            const int oKeysHidden = o.inputFlags & MASK_KEYSHIDDEN;
+            if (keysHidden != oKeysHidden) {
+                const int reqKeysHidden =
+                        requested->inputFlags & MASK_KEYSHIDDEN;
+                if (reqKeysHidden) {
+
+                    if (!keysHidden) return false;
+                    if (!oKeysHidden) return true;
+                    // For compatibility, we count KEYSHIDDEN_NO as being
+                    // the same as KEYSHIDDEN_SOFT.  Here we disambiguate
+                    // these by making an exact match more specific.
+                    if (reqKeysHidden == keysHidden) return true;
+                    if (reqKeysHidden == oKeysHidden) return false;
+                }
+            }
+
+            const int navHidden = inputFlags & MASK_NAVHIDDEN;
+            const int oNavHidden = o.inputFlags & MASK_NAVHIDDEN;
+            if (navHidden != oNavHidden) {
+                const int reqNavHidden =
+                        requested->inputFlags & MASK_NAVHIDDEN;
+                if (reqNavHidden) {
+
+                    if (!navHidden) return false;
+                    if (!oNavHidden) return true;
+                }
+            }
+
+            if ((keyboard != o.keyboard) && requested->keyboard) {
+                return (keyboard);
+            }
+
+            if ((navigation != o.navigation) && requested->navigation) {
+                return (navigation);
+            }
+        }
+
+        if (screenSize || o.screenSize) {
+            // "Better" is based on the sum of the difference between both
+            // width and height from the requested dimensions.  We are
+            // assuming the invalid configs (with smaller sizes) have
+            // already been filtered.  Note that if a particular dimension
+            // is unspecified, we will end up with a large value (the
+            // difference between 0 and the requested dimension), which is
+            // good since we will prefer a config that has specified a
+            // size value.
+            int myDelta = 0, otherDelta = 0;
+            if (requested->screenWidth) {
+                myDelta += requested->screenWidth - screenWidth;
+                otherDelta += requested->screenWidth - o.screenWidth;
+            }
+            if (requested->screenHeight) {
+                myDelta += requested->screenHeight - screenHeight;
+                otherDelta += requested->screenHeight - o.screenHeight;
+            }
+            return (myDelta <= otherDelta);
+        }
+
+        if (version || o.version) {
+            if ((sdkVersion != o.sdkVersion) && requested->sdkVersion) {
+                return (sdkVersion > o.sdkVersion);
+            }
+
+            if ((minorVersion != o.minorVersion) &&
+                    requested->minorVersion) {
+                return (minorVersion);
+            }
+        }
+
+        return false;
+    }
+    return isMoreSpecificThan(o);
+}
+
+bool ResTable_config::match(const ResTable_config& settings) const {
+    if (imsi != 0) {
+        if (mcc != 0 && mcc != settings.mcc) {
+            return false;
+        }
+        if (mnc != 0 && mnc != settings.mnc) {
+            return false;
+        }
+    }
+    if (locale != 0) {
+        if (language[0] != 0
+            && (language[0] != settings.language[0]
+                || language[1] != settings.language[1])) {
+            return false;
+        }
+        if (country[0] != 0
+            && (country[0] != settings.country[0]
+                || country[1] != settings.country[1])) {
+            return false;
+        }
+    }
+    if (screenConfig != 0) {
+        const int screenSize = screenLayout&MASK_SCREENSIZE;
+        const int setScreenSize = settings.screenLayout&MASK_SCREENSIZE;
+        // Any screen sizes for larger screens than the setting do not
+        // match.
+        if (screenSize != 0 && screenSize > setScreenSize) {
+            return false;
+        }
+
+        const int screenLong = screenLayout&MASK_SCREENLONG;
+        const int setScreenLong = settings.screenLayout&MASK_SCREENLONG;
+        if (screenLong != 0 && screenLong != setScreenLong) {
+            return false;
+        }
+
+        const int uiModeType = uiMode&MASK_UI_MODE_TYPE;
+        const int setUiModeType = settings.uiMode&MASK_UI_MODE_TYPE;
+        if (uiModeType != 0 && uiModeType != setUiModeType) {
+            return false;
+        }
+
+        const int uiModeNight = uiMode&MASK_UI_MODE_NIGHT;
+        const int setUiModeNight = settings.uiMode&MASK_UI_MODE_NIGHT;
+        if (uiModeNight != 0 && uiModeNight != setUiModeNight) {
+            return false;
+        }
+
+        if (smallestScreenWidthDp != 0
+                && smallestScreenWidthDp > settings.smallestScreenWidthDp) {
+            return false;
+        }
+    }
+    if (screenSizeDp != 0) {
+        if (screenWidthDp != 0 && screenWidthDp > settings.screenWidthDp) {
+            //ALOGI("Filtering out width %d in requested %d", screenWidthDp, settings.screenWidthDp);
+            return false;
+        }
+        if (screenHeightDp != 0 && screenHeightDp > settings.screenHeightDp) {
+            //ALOGI("Filtering out height %d in requested %d", screenHeightDp, settings.screenHeightDp);
+            return false;
+        }
+    }
+    if (screenType != 0) {
+        if (orientation != 0 && orientation != settings.orientation) {
+            return false;
+        }
+        // density always matches - we can scale it.  See isBetterThan
+        if (touchscreen != 0 && touchscreen != settings.touchscreen) {
+            return false;
+        }
+    }
+    if (input != 0) {
+        const int keysHidden = inputFlags&MASK_KEYSHIDDEN;
+        const int setKeysHidden = settings.inputFlags&MASK_KEYSHIDDEN;
+        if (keysHidden != 0 && keysHidden != setKeysHidden) {
+            // For compatibility, we count a request for KEYSHIDDEN_NO as also
+            // matching the more recent KEYSHIDDEN_SOFT.  Basically
+            // KEYSHIDDEN_NO means there is some kind of keyboard available.
+            //ALOGI("Matching keysHidden: have=%d, config=%d\n", keysHidden, setKeysHidden);
+            if (keysHidden != KEYSHIDDEN_NO || setKeysHidden != KEYSHIDDEN_SOFT) {
+                //ALOGI("No match!");
+                return false;
+            }
+        }
+        const int navHidden = inputFlags&MASK_NAVHIDDEN;
+        const int setNavHidden = settings.inputFlags&MASK_NAVHIDDEN;
+        if (navHidden != 0 && navHidden != setNavHidden) {
+            return false;
+        }
+        if (keyboard != 0 && keyboard != settings.keyboard) {
+            return false;
+        }
+        if (navigation != 0 && navigation != settings.navigation) {
+            return false;
+        }
+    }
+    if (screenSize != 0) {
+        if (screenWidth != 0 && screenWidth > settings.screenWidth) {
+            return false;
+        }
+        if (screenHeight != 0 && screenHeight > settings.screenHeight) {
+            return false;
+        }
+    }
+    if (version != 0) {
+        if (sdkVersion != 0 && sdkVersion > settings.sdkVersion) {
+            return false;
+        }
+        if (minorVersion != 0 && minorVersion != settings.minorVersion) {
+            return false;
+        }
+    }
+    return true;
+}
+
+void ResTable_config::getLocale(char str[6]) const {
+    memset(str, 0, 6);
+    if (language[0]) {
+        str[0] = language[0];
+        str[1] = language[1];
+        if (country[0]) {
+            str[2] = '_';
+            str[3] = country[0];
+            str[4] = country[1];
+        }
+    }
+}
+
+String8 ResTable_config::toString() const {
+    String8 res;
+
+    if (mcc != 0) {
+        if (res.size() > 0) res.append("-");
+        res.appendFormat("%dmcc", dtohs(mcc));
+    }
+    if (mnc != 0) {
+        if (res.size() > 0) res.append("-");
+        res.appendFormat("%dmnc", dtohs(mnc));
+    }
+    if (language[0] != 0) {
+        if (res.size() > 0) res.append("-");
+        res.append(language, 2);
+    }
+    if (country[0] != 0) {
+        if (res.size() > 0) res.append("-");
+        res.append(country, 2);
+    }
+    if (smallestScreenWidthDp != 0) {
+        if (res.size() > 0) res.append("-");
+        res.appendFormat("sw%ddp", dtohs(smallestScreenWidthDp));
+    }
+    if (screenWidthDp != 0) {
+        if (res.size() > 0) res.append("-");
+        res.appendFormat("w%ddp", dtohs(screenWidthDp));
+    }
+    if (screenHeightDp != 0) {
+        if (res.size() > 0) res.append("-");
+        res.appendFormat("h%ddp", dtohs(screenHeightDp));
+    }
+    if ((screenLayout&MASK_SCREENSIZE) != SCREENSIZE_ANY) {
+        if (res.size() > 0) res.append("-");
+        switch (screenLayout&ResTable_config::MASK_SCREENSIZE) {
+            case ResTable_config::SCREENSIZE_SMALL:
+                res.append("small");
+                break;
+            case ResTable_config::SCREENSIZE_NORMAL:
+                res.append("normal");
+                break;
+            case ResTable_config::SCREENSIZE_LARGE:
+                res.append("large");
+                break;
+            case ResTable_config::SCREENSIZE_XLARGE:
+                res.append("xlarge");
+                break;
+            default:
+                res.appendFormat("screenLayoutSize=%d",
+                        dtohs(screenLayout&ResTable_config::MASK_SCREENSIZE));
+                break;
+        }
+    }
+    if ((screenLayout&MASK_SCREENLONG) != 0) {
+        if (res.size() > 0) res.append("-");
+        switch (screenLayout&ResTable_config::MASK_SCREENLONG) {
+            case ResTable_config::SCREENLONG_NO:
+                res.append("notlong");
+                break;
+            case ResTable_config::SCREENLONG_YES:
+                res.append("long");
+                break;
+            default:
+                res.appendFormat("screenLayoutLong=%d",
+                        dtohs(screenLayout&ResTable_config::MASK_SCREENLONG));
+                break;
+        }
+    }
+    if (orientation != ORIENTATION_ANY) {
+        if (res.size() > 0) res.append("-");
+        switch (orientation) {
+            case ResTable_config::ORIENTATION_PORT:
+                res.append("port");
+                break;
+            case ResTable_config::ORIENTATION_LAND:
+                res.append("land");
+                break;
+            case ResTable_config::ORIENTATION_SQUARE:
+                res.append("square");
+                break;
+            default:
+                res.appendFormat("orientation=%d", dtohs(orientation));
+                break;
+        }
+    }
+    if ((uiMode&MASK_UI_MODE_TYPE) != UI_MODE_TYPE_ANY) {
+        if (res.size() > 0) res.append("-");
+        switch (uiMode&ResTable_config::MASK_UI_MODE_TYPE) {
+            case ResTable_config::UI_MODE_TYPE_DESK:
+                res.append("desk");
+                break;
+            case ResTable_config::UI_MODE_TYPE_CAR:
+                res.append("car");
+                break;
+            case ResTable_config::UI_MODE_TYPE_TELEVISION:
+                res.append("television");
+                break;
+            case ResTable_config::UI_MODE_TYPE_APPLIANCE:
+                res.append("appliance");
+                break;
+            default:
+                res.appendFormat("uiModeType=%d",
+                        dtohs(screenLayout&ResTable_config::MASK_UI_MODE_TYPE));
+                break;
+        }
+    }
+    if ((uiMode&MASK_UI_MODE_NIGHT) != 0) {
+        if (res.size() > 0) res.append("-");
+        switch (uiMode&ResTable_config::MASK_UI_MODE_NIGHT) {
+            case ResTable_config::UI_MODE_NIGHT_NO:
+                res.append("notnight");
+                break;
+            case ResTable_config::UI_MODE_NIGHT_YES:
+                res.append("night");
+                break;
+            default:
+                res.appendFormat("uiModeNight=%d",
+                        dtohs(uiMode&MASK_UI_MODE_NIGHT));
+                break;
+        }
+    }
+    if (density != DENSITY_DEFAULT) {
+        if (res.size() > 0) res.append("-");
+        switch (density) {
+            case ResTable_config::DENSITY_LOW:
+                res.append("ldpi");
+                break;
+            case ResTable_config::DENSITY_MEDIUM:
+                res.append("mdpi");
+                break;
+            case ResTable_config::DENSITY_TV:
+                res.append("tvdpi");
+                break;
+            case ResTable_config::DENSITY_HIGH:
+                res.append("hdpi");
+                break;
+            case ResTable_config::DENSITY_XHIGH:
+                res.append("xhdpi");
+                break;
+            case ResTable_config::DENSITY_XXHIGH:
+                res.append("xxhdpi");
+                break;
+            case ResTable_config::DENSITY_NONE:
+                res.append("nodpi");
+                break;
+            default:
+                res.appendFormat("density=%d", dtohs(density));
+                break;
+        }
+    }
+    if (touchscreen != TOUCHSCREEN_ANY) {
+        if (res.size() > 0) res.append("-");
+        switch (touchscreen) {
+            case ResTable_config::TOUCHSCREEN_NOTOUCH:
+                res.append("notouch");
+                break;
+            case ResTable_config::TOUCHSCREEN_FINGER:
+                res.append("finger");
+                break;
+            case ResTable_config::TOUCHSCREEN_STYLUS:
+                res.append("stylus");
+                break;
+            default:
+                res.appendFormat("touchscreen=%d", dtohs(touchscreen));
+                break;
+        }
+    }
+    if (keyboard != KEYBOARD_ANY) {
+        if (res.size() > 0) res.append("-");
+        switch (keyboard) {
+            case ResTable_config::KEYBOARD_NOKEYS:
+                res.append("nokeys");
+                break;
+            case ResTable_config::KEYBOARD_QWERTY:
+                res.append("qwerty");
+                break;
+            case ResTable_config::KEYBOARD_12KEY:
+                res.append("12key");
+                break;
+            default:
+                res.appendFormat("keyboard=%d", dtohs(keyboard));
+                break;
+        }
+    }
+    if ((inputFlags&MASK_KEYSHIDDEN) != 0) {
+        if (res.size() > 0) res.append("-");
+        switch (inputFlags&MASK_KEYSHIDDEN) {
+            case ResTable_config::KEYSHIDDEN_NO:
+                res.append("keysexposed");
+                break;
+            case ResTable_config::KEYSHIDDEN_YES:
+                res.append("keyshidden");
+                break;
+            case ResTable_config::KEYSHIDDEN_SOFT:
+                res.append("keyssoft");
+                break;
+        }
+    }
+    if (navigation != NAVIGATION_ANY) {
+        if (res.size() > 0) res.append("-");
+        switch (navigation) {
+            case ResTable_config::NAVIGATION_NONAV:
+                res.append("nonav");
+                break;
+            case ResTable_config::NAVIGATION_DPAD:
+                res.append("dpad");
+                break;
+            case ResTable_config::NAVIGATION_TRACKBALL:
+                res.append("trackball");
+                break;
+            case ResTable_config::NAVIGATION_WHEEL:
+                res.append("wheel");
+                break;
+            default:
+                res.appendFormat("navigation=%d", dtohs(navigation));
+                break;
+        }
+    }
+    if ((inputFlags&MASK_NAVHIDDEN) != 0) {
+        if (res.size() > 0) res.append("-");
+        switch (inputFlags&MASK_NAVHIDDEN) {
+            case ResTable_config::NAVHIDDEN_NO:
+                res.append("navsexposed");
+                break;
+            case ResTable_config::NAVHIDDEN_YES:
+                res.append("navhidden");
+                break;
+            default:
+                res.appendFormat("inputFlagsNavHidden=%d",
+                        dtohs(inputFlags&MASK_NAVHIDDEN));
+                break;
+        }
+    }
+    if (screenSize != 0) {
+        if (res.size() > 0) res.append("-");
+        res.appendFormat("%dx%d", dtohs(screenWidth), dtohs(screenHeight));
+    }
+    if (version != 0) {
+        if (res.size() > 0) res.append("-");
+        res.appendFormat("v%d", dtohs(sdkVersion));
+        if (minorVersion != 0) {
+            res.appendFormat(".%d", dtohs(minorVersion));
+        }
+    }
+
+    return res;
+}
+
+// --------------------------------------------------------------------
+// --------------------------------------------------------------------
+// --------------------------------------------------------------------
+
 struct ResTable::Header
 {
     Header(ResTable* _owner) : owner(_owner), ownedData(NULL), header(NULL),
@@ -3953,43 +4843,9 @@
         ResTable_config thisConfig;
         thisConfig.copyFromDtoH(thisType->config);
 
-        TABLE_GETENTRY(LOGI("Match entry 0x%x in type 0x%x (sz 0x%x): imsi:%d/%d=%d/%d "
-                            "lang:%c%c=%c%c cnt:%c%c=%c%c orien:%d=%d touch:%d=%d "
-                            "density:%d=%d key:%d=%d inp:%d=%d nav:%d=%d w:%d=%d h:%d=%d "
-                            "swdp:%d=%d wdp:%d=%d hdp:%d=%d\n",
+        TABLE_GETENTRY(LOGI("Match entry 0x%x in type 0x%x (sz 0x%x): %s\n",
                            entryIndex, typeIndex+1, dtohl(thisType->config.size),
-                           thisConfig.mcc, thisConfig.mnc,
-                           config ? config->mcc : 0, config ? config->mnc : 0,
-                           thisConfig.language[0] ? thisConfig.language[0] : '-',
-                           thisConfig.language[1] ? thisConfig.language[1] : '-',
-                           config && config->language[0] ? config->language[0] : '-',
-                           config && config->language[1] ? config->language[1] : '-',
-                           thisConfig.country[0] ? thisConfig.country[0] : '-',
-                           thisConfig.country[1] ? thisConfig.country[1] : '-',
-                           config && config->country[0] ? config->country[0] : '-',
-                           config && config->country[1] ? config->country[1] : '-',
-                           thisConfig.orientation,
-                           config ? config->orientation : 0,
-                           thisConfig.touchscreen,
-                           config ? config->touchscreen : 0,
-                           thisConfig.density,
-                           config ? config->density : 0,
-                           thisConfig.keyboard,
-                           config ? config->keyboard : 0,
-                           thisConfig.inputFlags,
-                           config ? config->inputFlags : 0,
-                           thisConfig.navigation,
-                           config ? config->navigation : 0,
-                           thisConfig.screenWidth,
-                           config ? config->screenWidth : 0,
-                           thisConfig.screenHeight,
-                           config ? config->screenHeight : 0,
-                           thisConfig.smallestScreenWidthDp,
-                           config ? config->smallestScreenWidthDp : 0,
-                           thisConfig.screenWidthDp,
-                           config ? config->screenWidthDp : 0,
-                           thisConfig.screenHeightDp,
-                           config ? config->screenHeightDp : 0));
+                           thisConfig.toString().string()));
         
         // Check to make sure this one is valid for the current parameters.
         if (config && !thisConfig.match(*config)) {
@@ -4273,26 +5129,8 @@
             TABLE_GETENTRY(
                 ResTable_config thisConfig;
                 thisConfig.copyFromDtoH(type->config);
-                ALOGI("Adding config to type %d: imsi:%d/%d lang:%c%c cnt:%c%c "
-                     "orien:%d touch:%d density:%d key:%d inp:%d nav:%d w:%d h:%d "
-                     "swdp:%d wdp:%d hdp:%d\n",
-                      type->id,
-                      thisConfig.mcc, thisConfig.mnc,
-                      thisConfig.language[0] ? thisConfig.language[0] : '-',
-                      thisConfig.language[1] ? thisConfig.language[1] : '-',
-                      thisConfig.country[0] ? thisConfig.country[0] : '-',
-                      thisConfig.country[1] ? thisConfig.country[1] : '-',
-                      thisConfig.orientation,
-                      thisConfig.touchscreen,
-                      thisConfig.density,
-                      thisConfig.keyboard,
-                      thisConfig.inputFlags,
-                      thisConfig.navigation,
-                      thisConfig.screenWidth,
-                      thisConfig.screenHeight,
-                      thisConfig.smallestScreenWidthDp,
-                      thisConfig.screenWidthDp,
-                      thisConfig.screenHeightDp));
+                ALOGI("Adding config to type %d: %s\n",
+                      type->id, thisConfig.toString().string()));
             t->configs.add(type);
         } else {
             status_t err = validate_chunk(chunk, sizeof(ResChunk_header),
@@ -4622,186 +5460,9 @@
                         printf("      NON-INTEGER ResTable_type ADDRESS: %p\n", type);
                         continue;
                     }
-                    char density[16];
-                    uint16_t dval = dtohs(type->config.density);
-                    if (dval == ResTable_config::DENSITY_DEFAULT) {
-                        strcpy(density, "def");
-                    } else if (dval == ResTable_config::DENSITY_NONE) {
-                        strcpy(density, "no");
-                    } else {
-                        sprintf(density, "%d", (int)dval);
-                    }
-                    printf("      config %d", (int)configIndex);
-                    if (type->config.mcc != 0) {
-                        printf(" mcc=%d", dtohs(type->config.mcc));
-                    }
-                    if (type->config.mnc != 0) {
-                        printf(" mnc=%d", dtohs(type->config.mnc));
-                    }
-                    if (type->config.locale != 0) {
-                        printf(" lang=%c%c cnt=%c%c",
-                               type->config.language[0] ? type->config.language[0] : '-',
-                               type->config.language[1] ? type->config.language[1] : '-',
-                               type->config.country[0] ? type->config.country[0] : '-',
-                               type->config.country[1] ? type->config.country[1] : '-');
-                    }
-                    if (type->config.screenLayout != 0) {
-                        printf(" sz=%d",
-                                type->config.screenLayout&ResTable_config::MASK_SCREENSIZE);
-                        switch (type->config.screenLayout&ResTable_config::MASK_SCREENSIZE) {
-                            case ResTable_config::SCREENSIZE_SMALL:
-                                printf(" (small)");
-                                break;
-                            case ResTable_config::SCREENSIZE_NORMAL:
-                                printf(" (normal)");
-                                break;
-                            case ResTable_config::SCREENSIZE_LARGE:
-                                printf(" (large)");
-                                break;
-                            case ResTable_config::SCREENSIZE_XLARGE:
-                                printf(" (xlarge)");
-                                break;
-                        }
-                        printf(" lng=%d",
-                                type->config.screenLayout&ResTable_config::MASK_SCREENLONG);
-                        switch (type->config.screenLayout&ResTable_config::MASK_SCREENLONG) {
-                            case ResTable_config::SCREENLONG_NO:
-                                printf(" (notlong)");
-                                break;
-                            case ResTable_config::SCREENLONG_YES:
-                                printf(" (long)");
-                                break;
-                        }
-                    }
-                    if (type->config.orientation != 0) {
-                        printf(" orient=%d", type->config.orientation);
-                        switch (type->config.orientation) {
-                            case ResTable_config::ORIENTATION_PORT:
-                                printf(" (port)");
-                                break;
-                            case ResTable_config::ORIENTATION_LAND:
-                                printf(" (land)");
-                                break;
-                            case ResTable_config::ORIENTATION_SQUARE:
-                                printf(" (square)");
-                                break;
-                        }
-                    }
-                    if (type->config.uiMode != 0) {
-                        printf(" type=%d",
-                                type->config.uiMode&ResTable_config::MASK_UI_MODE_TYPE);
-                        switch (type->config.uiMode&ResTable_config::MASK_UI_MODE_TYPE) {
-                            case ResTable_config::UI_MODE_TYPE_NORMAL:
-                                printf(" (normal)");
-                                break;
-                            case ResTable_config::UI_MODE_TYPE_CAR:
-                                printf(" (car)");
-                                break;
-                        }
-                        printf(" night=%d",
-                                type->config.uiMode&ResTable_config::MASK_UI_MODE_NIGHT);
-                        switch (type->config.uiMode&ResTable_config::MASK_UI_MODE_NIGHT) {
-                            case ResTable_config::UI_MODE_NIGHT_NO:
-                                printf(" (no)");
-                                break;
-                            case ResTable_config::UI_MODE_NIGHT_YES:
-                                printf(" (yes)");
-                                break;
-                        }
-                    }
-                    if (dval != 0) {
-                        printf(" density=%s", density);
-                    }
-                    if (type->config.touchscreen != 0) {
-                        printf(" touch=%d", type->config.touchscreen);
-                        switch (type->config.touchscreen) {
-                            case ResTable_config::TOUCHSCREEN_NOTOUCH:
-                                printf(" (notouch)");
-                                break;
-                            case ResTable_config::TOUCHSCREEN_STYLUS:
-                                printf(" (stylus)");
-                                break;
-                            case ResTable_config::TOUCHSCREEN_FINGER:
-                                printf(" (finger)");
-                                break;
-                        }
-                    }
-                    if (type->config.inputFlags != 0) {
-                        printf(" keyhid=%d", type->config.inputFlags&ResTable_config::MASK_KEYSHIDDEN);
-                        switch (type->config.inputFlags&ResTable_config::MASK_KEYSHIDDEN) {
-                            case ResTable_config::KEYSHIDDEN_NO:
-                                printf(" (no)");
-                                break;
-                            case ResTable_config::KEYSHIDDEN_YES:
-                                printf(" (yes)");
-                                break;
-                            case ResTable_config::KEYSHIDDEN_SOFT:
-                                printf(" (soft)");
-                                break;
-                        }
-                        printf(" navhid=%d", type->config.inputFlags&ResTable_config::MASK_NAVHIDDEN);
-                        switch (type->config.inputFlags&ResTable_config::MASK_NAVHIDDEN) {
-                            case ResTable_config::NAVHIDDEN_NO:
-                                printf(" (no)");
-                                break;
-                            case ResTable_config::NAVHIDDEN_YES:
-                                printf(" (yes)");
-                                break;
-                        }
-                    }
-                    if (type->config.keyboard != 0) {
-                        printf(" kbd=%d", type->config.keyboard);
-                        switch (type->config.keyboard) {
-                            case ResTable_config::KEYBOARD_NOKEYS:
-                                printf(" (nokeys)");
-                                break;
-                            case ResTable_config::KEYBOARD_QWERTY:
-                                printf(" (qwerty)");
-                                break;
-                            case ResTable_config::KEYBOARD_12KEY:
-                                printf(" (12key)");
-                                break;
-                        }
-                    }
-                    if (type->config.navigation != 0) {
-                        printf(" nav=%d", type->config.navigation);
-                        switch (type->config.navigation) {
-                            case ResTable_config::NAVIGATION_NONAV:
-                                printf(" (nonav)");
-                                break;
-                            case ResTable_config::NAVIGATION_DPAD:
-                                printf(" (dpad)");
-                                break;
-                            case ResTable_config::NAVIGATION_TRACKBALL:
-                                printf(" (trackball)");
-                                break;
-                            case ResTable_config::NAVIGATION_WHEEL:
-                                printf(" (wheel)");
-                                break;
-                        }
-                    }
-                    if (type->config.screenWidth != 0) {
-                        printf(" w=%d", dtohs(type->config.screenWidth));
-                    }
-                    if (type->config.screenHeight != 0) {
-                        printf(" h=%d", dtohs(type->config.screenHeight));
-                    }
-                    if (type->config.smallestScreenWidthDp != 0) {
-                        printf(" swdp=%d", dtohs(type->config.smallestScreenWidthDp));
-                    }
-                    if (type->config.screenWidthDp != 0) {
-                        printf(" wdp=%d", dtohs(type->config.screenWidthDp));
-                    }
-                    if (type->config.screenHeightDp != 0) {
-                        printf(" hdp=%d", dtohs(type->config.screenHeightDp));
-                    }
-                    if (type->config.sdkVersion != 0) {
-                        printf(" sdk=%d", dtohs(type->config.sdkVersion));
-                    }
-                    if (type->config.minorVersion != 0) {
-                        printf(" mver=%d", dtohs(type->config.minorVersion));
-                    }
-                    printf("\n");
+                    String8 configStr = type->config.toString();
+                    printf("      config %s:\n", configStr.size() > 0
+                            ? configStr.string() : "(default)");
                     size_t entryCount = dtohl(type->entryCount);
                     uint32_t entriesStart = dtohl(type->entriesStart);
                     if ((entriesStart&0x3) != 0) {
diff --git a/libs/utils/String16.cpp b/libs/utils/String16.cpp
index 4ce1664..94e072f 100644
--- a/libs/utils/String16.cpp
+++ b/libs/utils/String16.cpp
@@ -112,7 +112,7 @@
 {
     size_t len = strlen16(o);
     SharedBuffer* buf = SharedBuffer::alloc((len+1)*sizeof(char16_t));
-    LOG_ASSERT(buf, "Unable to allocate shared buffer");
+    ALOG_ASSERT(buf, "Unable to allocate shared buffer");
     if (buf) {
         char16_t* str = (char16_t*)buf->data();
         strcpy16(str, o);
@@ -126,7 +126,7 @@
 String16::String16(const char16_t* o, size_t len)
 {
     SharedBuffer* buf = SharedBuffer::alloc((len+1)*sizeof(char16_t));
-    LOG_ASSERT(buf, "Unable to allocate shared buffer");
+    ALOG_ASSERT(buf, "Unable to allocate shared buffer");
     if (buf) {
         char16_t* str = (char16_t*)buf->data();
         memcpy(str, o, len*sizeof(char16_t));
diff --git a/libs/utils/String8.cpp b/libs/utils/String8.cpp
index 0bc5aff..562f026 100644
--- a/libs/utils/String8.cpp
+++ b/libs/utils/String8.cpp
@@ -80,7 +80,7 @@
 {
     if (len > 0) {
         SharedBuffer* buf = SharedBuffer::alloc(len+1);
-        LOG_ASSERT(buf, "Unable to allocate shared buffer");
+        ALOG_ASSERT(buf, "Unable to allocate shared buffer");
         if (buf) {
             char* str = (char*)buf->data();
             memcpy(str, in, len);
@@ -103,7 +103,7 @@
     }
 
     SharedBuffer* buf = SharedBuffer::alloc(bytes+1);
-    LOG_ASSERT(buf, "Unable to allocate shared buffer");
+    ALOG_ASSERT(buf, "Unable to allocate shared buffer");
     if (!buf) {
         return getEmptyString();
     }
@@ -125,7 +125,7 @@
     }
 
     SharedBuffer* buf = SharedBuffer::alloc(bytes+1);
-    LOG_ASSERT(buf, "Unable to allocate shared buffer");
+    ALOG_ASSERT(buf, "Unable to allocate shared buffer");
     if (!buf) {
         return getEmptyString();
     }
diff --git a/libs/utils/Threads.cpp b/libs/utils/Threads.cpp
index e343c62..ab207f5 100644
--- a/libs/utils/Threads.cpp
+++ b/libs/utils/Threads.cpp
@@ -34,6 +34,9 @@
 # include <pthread.h>
 # include <sched.h>
 # include <sys/resource.h>
+#ifdef HAVE_ANDROID_OS
+# include <bionic_pthread.h>
+#endif
 #elif defined(HAVE_WIN32_THREADS)
 # include <windows.h>
 # include <stdint.h>
@@ -86,7 +89,7 @@
     char *          threadName;
 
     // we use this trampoline when we need to set the priority with
-    // nice/setpriority.
+    // nice/setpriority, and name with prctl.
     static int trampoline(const thread_data_t* t) {
         thread_func_t f = t->entryFunction;
         void* u = t->userData;
@@ -141,8 +144,13 @@
 
 #ifdef HAVE_ANDROID_OS  /* valgrind is rejecting RT-priority create reqs */
     if (threadPriority != PRIORITY_DEFAULT || threadName != NULL) {
-        // We could avoid the trampoline if there was a way to get to the
-        // android_thread_id_t (pid) from pthread_t
+        // Now that the pthread_t has a method to find the associated
+        // android_thread_id_t (pid) from pthread_t, it would be possible to avoid
+        // this trampoline in some cases as the parent could set the properties
+        // for the child.  However, there would be a race condition because the
+        // child becomes ready immediately, and it doesn't work for the name.
+        // prctl(PR_SET_NAME) only works for self; prctl(PR_SET_THREAD_NAME) was
+        // proposed but not yet accepted.
         thread_data_t* t = new thread_data_t;
         t->priority = threadPriority;
         t->threadName = threadName ? strdup(threadName) : NULL;
@@ -178,6 +186,13 @@
     return 1;
 }
 
+#ifdef HAVE_ANDROID_OS
+static pthread_t android_thread_id_t_to_pthread(android_thread_id_t thread)
+{
+    return (pthread_t) thread;
+}
+#endif
+
 android_thread_id_t androidGetThreadId()
 {
     return (android_thread_id_t)pthread_self();
@@ -909,6 +924,23 @@
     return mStatus;
 }
 
+#ifdef HAVE_ANDROID_OS
+pid_t Thread::getTid() const
+{
+    // mTid is not defined until the child initializes it, and the caller may need it earlier
+    Mutex::Autolock _l(mLock);
+    pid_t tid;
+    if (mRunning) {
+        pthread_t pthread = android_thread_id_t_to_pthread(mThread);
+        tid = __pthread_gettid(pthread);
+    } else {
+        ALOGW("Thread (this=%p): getTid() is undefined before run()", this);
+        tid = -1;
+    }
+    return tid;
+}
+#endif
+
 bool Thread::exitPending() const
 {
     Mutex::Autolock _l(mLock);
diff --git a/libs/utils/VectorImpl.cpp b/libs/utils/VectorImpl.cpp
index 4a9029671..220ae3e 100644
--- a/libs/utils/VectorImpl.cpp
+++ b/libs/utils/VectorImpl.cpp
@@ -56,7 +56,7 @@
 
 VectorImpl::~VectorImpl()
 {
-    LOG_ASSERT(!mCount,
+    ALOG_ASSERT(!mCount,
         "[%p] "
         "subclasses of VectorImpl must call finish_vector()"
         " in their destructor. Leaking %d bytes.",
@@ -66,7 +66,7 @@
 
 VectorImpl& VectorImpl::operator = (const VectorImpl& rhs)
 {
-    LOG_ASSERT(mItemSize == rhs.mItemSize,
+    ALOG_ASSERT(mItemSize == rhs.mItemSize,
         "Vector<> have different types (this=%p, rhs=%p)", this, &rhs);
     if (this != &rhs) {
         release_storage();
@@ -248,7 +248,7 @@
 
 ssize_t VectorImpl::replaceAt(const void* prototype, size_t index)
 {
-    LOG_ASSERT(index<size(),
+    ALOG_ASSERT(index<size(),
         "[%p] replace: index=%d, size=%d", this, (int)index, (int)size());
 
     void* item = editItemLocation(index);
@@ -267,7 +267,7 @@
 
 ssize_t VectorImpl::removeItemsAt(size_t index, size_t count)
 {
-    LOG_ASSERT((index+count)<=size(),
+    ALOG_ASSERT((index+count)<=size(),
         "[%p] remove: index=%d, count=%d, size=%d",
                this, (int)index, (int)count, (int)size());
 
@@ -291,7 +291,7 @@
 
 void* VectorImpl::editItemLocation(size_t index)
 {
-    LOG_ASSERT(index<capacity(),
+    ALOG_ASSERT(index<capacity(),
         "[%p] editItemLocation: index=%d, capacity=%d, count=%d",
         this, (int)index, (int)capacity(), (int)mCount);
             
@@ -303,7 +303,7 @@
 
 const void* VectorImpl::itemLocation(size_t index) const
 {
-    LOG_ASSERT(index<capacity(),
+    ALOG_ASSERT(index<capacity(),
         "[%p] itemLocation: index=%d, capacity=%d, count=%d",
         this, (int)index, (int)capacity(), (int)mCount);
 
@@ -349,7 +349,7 @@
 //    ALOGV("_grow(this=%p, where=%d, amount=%d) count=%d, capacity=%d",
 //        this, (int)where, (int)amount, (int)mCount, (int)capacity());
 
-    LOG_ASSERT(where <= mCount,
+    ALOG_ASSERT(where <= mCount,
             "[%p] _grow: where=%d, amount=%d, count=%d",
             this, (int)where, (int)amount, (int)mCount); // caller already checked
 
@@ -402,7 +402,7 @@
 //    ALOGV("_shrink(this=%p, where=%d, amount=%d) count=%d, capacity=%d",
 //        this, (int)where, (int)amount, (int)mCount, (int)capacity());
 
-    LOG_ASSERT(where + amount <= mCount,
+    ALOG_ASSERT(where + amount <= mCount,
             "[%p] _shrink: where=%d, amount=%d, count=%d",
             this, (int)where, (int)amount, (int)mCount); // caller already checked
 
diff --git a/media/java/android/media/AmrInputStream.java b/media/java/android/media/AmrInputStream.java
index bc68472..8b7eee2 100644
--- a/media/java/android/media/AmrInputStream.java
+++ b/media/java/android/media/AmrInputStream.java
@@ -44,7 +44,7 @@
     private int mGae;
     
     // result amr stream
-    private byte[] mBuf = new byte[SAMPLES_PER_FRAME * 2];
+    private final byte[] mBuf = new byte[SAMPLES_PER_FRAME * 2];
     private int mBufIn = 0;
     private int mBufOut = 0;
     
diff --git a/media/java/android/media/AsyncPlayer.java b/media/java/android/media/AsyncPlayer.java
index 09aec2e..804528e 100644
--- a/media/java/android/media/AsyncPlayer.java
+++ b/media/java/android/media/AsyncPlayer.java
@@ -49,7 +49,7 @@
         }
     }
 
-    private LinkedList<Command> mCmdQueue = new LinkedList();
+    private final LinkedList<Command> mCmdQueue = new LinkedList();
 
     private void startSound(Command cmd) {
         // Preparing can be slow, so if there is something else
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java
index 936ec0f..78eb89f 100644
--- a/media/java/android/media/AudioManager.java
+++ b/media/java/android/media/AudioManager.java
@@ -1509,7 +1509,7 @@
      * Map to convert focus event listener IDs, as used in the AudioService audio focus stack,
      * to actual listener objects.
      */
-    private HashMap<String, OnAudioFocusChangeListener> mAudioFocusIdListenerMap =
+    private final HashMap<String, OnAudioFocusChangeListener> mAudioFocusIdListenerMap =
             new HashMap<String, OnAudioFocusChangeListener>();
     /**
      * Lock to prevent concurrent changes to the list of focus listeners for this AudioManager
@@ -1524,7 +1524,7 @@
     /**
      * Handler for audio focus events coming from the audio service.
      */
-    private FocusEventHandlerDelegate mAudioFocusEventHandlerDelegate =
+    private final FocusEventHandlerDelegate mAudioFocusEventHandlerDelegate =
             new FocusEventHandlerDelegate();
 
     /**
@@ -1563,7 +1563,7 @@
         }
     }
 
-    private IAudioFocusDispatcher mAudioFocusDispatcher = new IAudioFocusDispatcher.Stub() {
+    private final IAudioFocusDispatcher mAudioFocusDispatcher = new IAudioFocusDispatcher.Stub() {
 
         public void dispatchAudioFocusChange(int focusChange, String id) {
             Message m = mAudioFocusEventHandlerDelegate.getHandler().obtainMessage(focusChange, id);
@@ -1649,11 +1649,46 @@
                     mAudioFocusDispatcher, getIdForAudioFocusListener(l),
                     mContext.getPackageName() /* package name */);
         } catch (RemoteException e) {
-            Log.e(TAG, "Can't call requestAudioFocus() from AudioService due to "+e);
+            Log.e(TAG, "Can't call requestAudioFocus() on AudioService due to "+e);
         }
         return status;
     }
 
+    /**
+     * @hide
+     * Used internally by telephony package to request audio focus. Will cause the focus request
+     * to be associated with the "voice communication" identifier only used in AudioService
+     * to identify this use case.
+     * @param streamType use STREAM_RING for focus requests when ringing, VOICE_CALL for
+     *    the establishment of the call
+     * @param durationHint the type of focus request. AUDIOFOCUS_GAIN_TRANSIENT is recommended so
+     *    media applications resume after a call
+     */
+    public void requestAudioFocusForCall(int streamType, int durationHint) {
+        IAudioService service = getService();
+        try {
+            service.requestAudioFocus(streamType, durationHint, mICallBack, null,
+                    AudioService.IN_VOICE_COMM_FOCUS_ID,
+                    "system" /* dump-friendly package name */);
+        } catch (RemoteException e) {
+            Log.e(TAG, "Can't call requestAudioFocusForCall() on AudioService due to "+e);
+        }
+    }
+
+    /**
+     * @hide
+     * Used internally by telephony package to abandon audio focus, typically after a call or
+     * when ringing ends and the call is rejected or not answered.
+     * Should match one or more calls to {@link #requestAudioFocusForCall(int, int)}.
+     */
+    public void abandonAudioFocusForCall() {
+        IAudioService service = getService();
+        try {
+            service.abandonAudioFocus(null, AudioService.IN_VOICE_COMM_FOCUS_ID);
+        } catch (RemoteException e) {
+            Log.e(TAG, "Can't call abandonAudioFocusForCall() on AudioService due to "+e);
+        }
+    }
 
     /**
      *  Abandon audio focus. Causes the previous focus owner, if any, to receive focus.
@@ -1668,7 +1703,7 @@
             status = service.abandonAudioFocus(mAudioFocusDispatcher,
                     getIdForAudioFocusListener(l));
         } catch (RemoteException e) {
-            Log.e(TAG, "Can't call abandonAudioFocus() from AudioService due to "+e);
+            Log.e(TAG, "Can't call abandonAudioFocus() on AudioService due to "+e);
         }
         return status;
     }
@@ -1920,7 +1955,7 @@
      /**
       * {@hide}
       */
-     private IBinder mICallBack = new Binder();
+     private final IBinder mICallBack = new Binder();
 
     /**
      * Checks whether the phone is in silent mode, with or without vibrate.
diff --git a/media/java/android/media/AudioRecord.java b/media/java/android/media/AudioRecord.java
index 855e831..5cc24c0 100644
--- a/media/java/android/media/AudioRecord.java
+++ b/media/java/android/media/AudioRecord.java
@@ -161,7 +161,7 @@
     /**
      * Lock to make sure mRecordingState updates are reflecting the actual state of the object.
      */
-    private Object mRecordingStateLock = new Object();
+    private final Object mRecordingStateLock = new Object();
     /**
      * The listener the AudioRecord notifies when the record position reaches a marker
      * or for periodic updates during the progression of the record head.
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index 72876d7..13e3982 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -110,7 +110,7 @@
     private static final int SENDMSG_QUEUE = 2;
 
     // AudioHandler message.whats
-    private static final int MSG_SET_SYSTEM_VOLUME = 0;
+    private static final int MSG_SET_DEVICE_VOLUME = 0;
     private static final int MSG_PERSIST_VOLUME = 1;
     private static final int MSG_PERSIST_RINGER_MODE = 3;
     private static final int MSG_PERSIST_VIBRATE_SETTING = 4;
@@ -124,6 +124,7 @@
     private static final int MSG_BT_HEADSET_CNCT_FAILED = 12;
     private static final int MSG_RCDISPLAY_CLEAR = 13;
     private static final int MSG_RCDISPLAY_UPDATE = 14;
+    private static final int MSG_SET_ALL_VOLUMES = 15;
 
 
     // flags for MSG_PERSIST_VOLUME indicating if current and/or last audible volume should be
@@ -150,7 +151,7 @@
     private boolean mMediaServerOk;
 
     private SoundPool mSoundPool;
-    private Object mSoundEffectsLock = new Object();
+    private final Object mSoundEffectsLock = new Object();
     private static final int NUM_SOUNDPOOL_CHANNELS = 4;
     private static final int SOUND_EFFECT_VOLUME = 1000;
 
@@ -167,7 +168,7 @@
     /* Sound effect file name mapping sound effect id (AudioManager.FX_xxx) to
      * file index in SOUND_EFFECT_FILES[] (first column) and indicating if effect
      * uses soundpool (second column) */
-    private int[][] SOUND_EFFECT_FILES_MAP = new int[][] {
+    private final int[][] SOUND_EFFECT_FILES_MAP = new int[][] {
         {0, -1},  // FX_KEY_CLICK
         {0, -1},  // FX_FOCUS_NAVIGATION_UP
         {0, -1},  // FX_FOCUS_NAVIGATION_DOWN
@@ -180,7 +181,7 @@
     };
 
    /** @hide Maximum volume index values for audio streams */
-    private int[] MAX_STREAM_VOLUME = new int[] {
+    private final int[] MAX_STREAM_VOLUME = new int[] {
         5,  // STREAM_VOICE_CALL
         7,  // STREAM_SYSTEM
         7,  // STREAM_RING
@@ -196,7 +197,7 @@
      * of another stream: This avoids multiplying the volume settings for hidden
      * stream types that follow other stream behavior for volume settings
      * NOTE: do not create loops in aliases! */
-    private int[] STREAM_VOLUME_ALIAS = new int[] {
+    private final int[] STREAM_VOLUME_ALIAS = new int[] {
         AudioSystem.STREAM_VOICE_CALL,  // STREAM_VOICE_CALL
         AudioSystem.STREAM_SYSTEM,  // STREAM_SYSTEM
         AudioSystem.STREAM_RING,  // STREAM_RING
@@ -209,7 +210,7 @@
         AudioSystem.STREAM_MUSIC  // STREAM_TTS
     };
 
-    private AudioSystem.ErrorCallback mAudioSystemCallback = new AudioSystem.ErrorCallback() {
+    private final AudioSystem.ErrorCallback mAudioSystemCallback = new AudioSystem.ErrorCallback() {
         public void onError(int error) {
             switch (error) {
             case AudioSystem.AUDIO_STATUS_SERVER_DIED:
@@ -269,17 +270,17 @@
     private boolean mIsRinging = false;
 
     // Devices currently connected
-    private HashMap <Integer, String> mConnectedDevices = new HashMap <Integer, String>();
+    private final HashMap <Integer, String> mConnectedDevices = new HashMap <Integer, String>();
 
     // Forced device usage for communications
     private int mForcedUseForComm;
 
     // List of binder death handlers for setMode() client processes.
     // The last process to have called setMode() is at the top of the list.
-    private ArrayList <SetModeDeathHandler> mSetModeDeathHandlers = new ArrayList <SetModeDeathHandler>();
+    private final ArrayList <SetModeDeathHandler> mSetModeDeathHandlers = new ArrayList <SetModeDeathHandler>();
 
     // List of clients having issued a SCO start request
-    private ArrayList <ScoClient> mScoClients = new ArrayList <ScoClient>();
+    private final ArrayList <ScoClient> mScoClients = new ArrayList <ScoClient>();
 
     // BluetoothHeadset API to control SCO connection
     private BluetoothHeadset mBluetoothHeadset;
@@ -329,6 +330,7 @@
     // Keyguard manager proxy
     private KeyguardManager mKeyguardManager;
 
+
     ///////////////////////////////////////////////////////////////////////////
     // Construction
     ///////////////////////////////////////////////////////////////////////////
@@ -431,12 +433,17 @@
 
         // Correct stream index values for streams with aliases
         for (int i = 0; i < numStreamTypes; i++) {
+            int device = getDeviceForStream(i);
             if (STREAM_VOLUME_ALIAS[i] != i) {
-                int index = rescaleIndex(streams[i].mIndex, STREAM_VOLUME_ALIAS[i], i);
-                streams[i].mIndex = streams[i].getValidIndex(index);
-                setStreamVolumeIndex(i, index);
-                index = rescaleIndex(streams[i].mLastAudibleIndex, STREAM_VOLUME_ALIAS[i], i);
-                streams[i].mLastAudibleIndex = streams[i].getValidIndex(index);
+                int index = rescaleIndex(streams[i].getIndex(device, false  /* lastAudible */),
+                                STREAM_VOLUME_ALIAS[i],
+                                i);
+                streams[i].mIndex.put(device, streams[i].getValidIndex(index));
+                streams[i].applyDeviceVolume(device);
+                index = rescaleIndex(streams[i].getIndex(device, true  /* lastAudible */),
+                            STREAM_VOLUME_ALIAS[i],
+                            i);
+                streams[i].mLastAudibleIndex.put(device, streams[i].getValidIndex(index));
             }
         }
     }
@@ -488,10 +495,6 @@
         restoreMediaButtonReceiver();
     }
 
-    private void setStreamVolumeIndex(int stream, int index) {
-        AudioSystem.setStreamVolumeIndex(stream, (index + 5)/10);
-    }
-
     private int rescaleIndex(int index, int srcStream, int dstStream) {
         return (index * mStreamStates[dstStream].getMaxIndex() + mStreamStates[srcStream].getMaxIndex() / 2) / mStreamStates[srcStream].getMaxIndex();
     }
@@ -535,7 +538,11 @@
         // checkForRingerModeChange() in place of STREAM_RING or STREAM_NOTIFICATION)
         int streamTypeAlias = STREAM_VOLUME_ALIAS[streamType];
         VolumeStreamState streamState = mStreamStates[streamTypeAlias];
-        final int oldIndex = (streamState.muteCount() != 0) ? streamState.mLastAudibleIndex : streamState.mIndex;
+
+        final int device = getDeviceForStream(streamTypeAlias);
+        // get last audible index if stream is muted, current index otherwise
+        final int oldIndex = streamState.getIndex(device,
+                                                  (streamState.muteCount() != 0) /* lastAudible */);
         boolean adjustVolume = true;
 
         // If either the client forces allowing ringer modes for this adjustment,
@@ -564,32 +571,32 @@
                     if (STREAM_VOLUME_ALIAS[i] == streamTypeAlias) {
                         VolumeStreamState s = mStreamStates[i];
 
-                        s.adjustLastAudibleIndex(direction);
+                        s.adjustLastAudibleIndex(direction, device);
                         // Post a persist volume msg
                         sendMsg(mAudioHandler,
                                 MSG_PERSIST_VOLUME,
                                 SENDMSG_REPLACE,
                                 PERSIST_LAST_AUDIBLE,
-                                0,
+                                device,
                                 s,
                                 PERSIST_DELAY);
                     }
                 }
             }
-            index = streamState.mLastAudibleIndex;
+            index = streamState.getIndex(device, true  /* lastAudible */);
         } else {
-            if (adjustVolume && streamState.adjustIndex(direction)) {
+            if (adjustVolume && streamState.adjustIndex(direction, device)) {
                 // Post message to set system volume (it in turn will post a message
                 // to persist). Do not change volume if stream is muted.
                 sendMsg(mAudioHandler,
-                        MSG_SET_SYSTEM_VOLUME,
+                        MSG_SET_DEVICE_VOLUME,
                         SENDMSG_NOOP,
-                        0,
+                        device,
                         0,
                         streamState,
                         0);
             }
-            index = streamState.mIndex;
+            index = streamState.getIndex(device, false  /* lastAudible */);
         }
 
         sendVolumeUpdate(streamType, oldIndex, index, flags);
@@ -600,7 +607,10 @@
         ensureValidStreamType(streamType);
         VolumeStreamState streamState = mStreamStates[STREAM_VOLUME_ALIAS[streamType]];
 
-        final int oldIndex = (streamState.muteCount() != 0) ? streamState.mLastAudibleIndex : streamState.mIndex;
+        final int device = getDeviceForStream(streamType);
+        // get last audible index if stream is muted, current index otherwise
+        final int oldIndex = streamState.getIndex(device,
+                                                  (streamState.muteCount() != 0) /* lastAudible */);
 
         // setting ring or notifications volume to 0 on voice capable devices enters silent mode
         if (mVoiceCapable && (((flags & AudioManager.FLAG_ALLOW_RINGER_MODES) != 0) ||
@@ -610,7 +620,11 @@
                 newRingerMode = System.getInt(mContentResolver, System.VIBRATE_IN_SILENT, 1) == 1
                     ? AudioManager.RINGER_MODE_VIBRATE
                     : AudioManager.RINGER_MODE_SILENT;
-                setStreamVolumeInt(STREAM_VOLUME_ALIAS[streamType], index, false, true);
+                setStreamVolumeInt(STREAM_VOLUME_ALIAS[streamType],
+                                   index,
+                                   device,
+                                   false,
+                                   true);
             } else {
                 newRingerMode = AudioManager.RINGER_MODE_NORMAL;
             }
@@ -618,9 +632,10 @@
         }
 
         index = rescaleIndex(index * 10, streamType, STREAM_VOLUME_ALIAS[streamType]);
-        setStreamVolumeInt(STREAM_VOLUME_ALIAS[streamType], index, false, true);
-
-        index = (streamState.muteCount() != 0) ? streamState.mLastAudibleIndex : streamState.mIndex;
+        setStreamVolumeInt(STREAM_VOLUME_ALIAS[streamType], index, device, false, true);
+        // get last audible index if stream is muted, current index otherwise
+        index = streamState.getIndex(device,
+                                     (streamState.muteCount() != 0) /* lastAudible */);
 
         sendVolumeUpdate(streamType, oldIndex, index, flags);
     }
@@ -648,35 +663,40 @@
      *
      * @param streamType Type of the stream
      * @param index Desired volume index of the stream
+     * @param device the device whose volume must be changed
      * @param force If true, set the volume even if the desired volume is same
      * as the current volume.
      * @param lastAudible If true, stores new index as last audible one
      */
-    private void setStreamVolumeInt(int streamType, int index, boolean force, boolean lastAudible) {
+    private void setStreamVolumeInt(int streamType,
+                                    int index,
+                                    int device,
+                                    boolean force,
+                                    boolean lastAudible) {
         VolumeStreamState streamState = mStreamStates[streamType];
 
         // If stream is muted, set last audible index only
         if (streamState.muteCount() != 0) {
             // Do not allow last audible index to be 0
             if (index != 0) {
-                streamState.setLastAudibleIndex(index);
+                streamState.setLastAudibleIndex(index, device);
                 // Post a persist volume msg
                 sendMsg(mAudioHandler,
                         MSG_PERSIST_VOLUME,
                         SENDMSG_REPLACE,
                         PERSIST_LAST_AUDIBLE,
-                        0,
+                        device,
                         streamState,
                         PERSIST_DELAY);
             }
         } else {
-            if (streamState.setIndex(index, lastAudible) || force) {
+            if (streamState.setIndex(index, device, lastAudible) || force) {
                 // Post message to set system volume (it in turn will post a message
                 // to persist).
                 sendMsg(mAudioHandler,
-                        MSG_SET_SYSTEM_VOLUME,
+                        MSG_SET_DEVICE_VOLUME,
                         SENDMSG_NOOP,
-                        0,
+                        device,
                         0,
                         streamState,
                         0);
@@ -708,7 +728,8 @@
     /** @see AudioManager#getStreamVolume(int) */
     public int getStreamVolume(int streamType) {
         ensureValidStreamType(streamType);
-        return (mStreamStates[streamType].mIndex + 5) / 10;
+        int device = getDeviceForStream(streamType);
+        return (mStreamStates[streamType].getIndex(device, false  /* lastAudible */) + 5) / 10;
     }
 
     /** @see AudioManager#getStreamMaxVolume(int) */
@@ -721,7 +742,8 @@
     /** Get last audible volume before stream was muted. */
     public int getLastAudibleStreamVolume(int streamType) {
         ensureValidStreamType(streamType);
-        return (mStreamStates[streamType].mLastAudibleIndex + 5) / 10;
+        int device = getDeviceForStream(streamType);
+        return (mStreamStates[streamType].getIndex(device, true  /* lastAudible */) + 5) / 10;
     }
 
     /** @see AudioManager#getRingerMode() */
@@ -764,9 +786,16 @@
                     // ring and notifications volume should never be 0 when not silenced
                     // on voice capable devices
                     if (mVoiceCapable &&
-                            STREAM_VOLUME_ALIAS[streamType] == AudioSystem.STREAM_RING &&
-                            mStreamStates[streamType].mLastAudibleIndex == 0) {
-                        mStreamStates[streamType].mLastAudibleIndex = 10;
+                            STREAM_VOLUME_ALIAS[streamType] == AudioSystem.STREAM_RING) {
+
+                        Set set = mStreamStates[streamType].mLastAudibleIndex.entrySet();
+                        Iterator i = set.iterator();
+                        while (i.hasNext()) {
+                            Map.Entry entry = (Map.Entry)i.next();
+                            if ((Integer)entry.getValue() == 0) {
+                                entry.setValue(10);
+                            }
+                        }
                     }
                     mStreamStates[streamType].mute(null, false);
                     mRingerModeMutedStreams &= ~(1 << streamType);
@@ -963,8 +992,6 @@
             if (mode != mMode) {
                 status = AudioSystem.setPhoneState(mode);
                 if (status == AudioSystem.AUDIO_STATUS_OK) {
-                    // automatically handle audio focus for mode changes
-                    handleFocusForCalls(mMode, mode, cb);
                     mMode = mode;
                 } else {
                     if (hdlr != null) {
@@ -988,46 +1015,13 @@
                 }
             }
             int streamType = getActiveStreamType(AudioManager.USE_DEFAULT_STREAM_TYPE);
-            int index = mStreamStates[STREAM_VOLUME_ALIAS[streamType]].mIndex;
-            setStreamVolumeInt(STREAM_VOLUME_ALIAS[streamType], index, true, false);
+            int device = getDeviceForStream(streamType);
+            int index = mStreamStates[STREAM_VOLUME_ALIAS[streamType]].getIndex(device, false);
+            setStreamVolumeInt(STREAM_VOLUME_ALIAS[streamType], index, device, true, false);
         }
         return newModeOwnerPid;
     }
 
-    /** pre-condition: oldMode != newMode */
-    private void handleFocusForCalls(int oldMode, int newMode, IBinder cb) {
-        // if ringing
-        if (newMode == AudioSystem.MODE_RINGTONE) {
-            // if not ringing silently
-            int ringVolume = AudioService.this.getStreamVolume(AudioManager.STREAM_RING);
-            if (ringVolume > 0) {
-                // request audio focus for the communication focus entry
-                requestAudioFocus(AudioManager.STREAM_RING,
-                        AudioManager.AUDIOFOCUS_GAIN_TRANSIENT, cb,
-                        null /* IAudioFocusDispatcher allowed to be null only for this clientId */,
-                        IN_VOICE_COMM_FOCUS_ID /*clientId*/,
-                        "system");
-
-            }
-        }
-        // if entering call
-        else if ((newMode == AudioSystem.MODE_IN_CALL)
-                || (newMode == AudioSystem.MODE_IN_COMMUNICATION)) {
-            // request audio focus for the communication focus entry
-            // (it's ok if focus was already requested during ringing)
-            requestAudioFocus(AudioManager.STREAM_RING,
-                    AudioManager.AUDIOFOCUS_GAIN_TRANSIENT, cb,
-                    null /* IAudioFocusDispatcher allowed to be null only for this clientId */,
-                    IN_VOICE_COMM_FOCUS_ID /*clientId*/,
-                    "system");
-        }
-        // if exiting call
-        else if (newMode == AudioSystem.MODE_NORMAL) {
-            // abandon audio focus for communication focus entry
-            abandonAudioFocus(null, IN_VOICE_COMM_FOCUS_ID);
-        }
-    }
-
     /** @see AudioManager#getMode() */
     public int getMode() {
         return mMode;
@@ -1253,28 +1247,7 @@
         for (int streamType = 0; streamType < numStreamTypes; streamType++) {
             VolumeStreamState streamState = mStreamStates[streamType];
 
-            String settingName = System.VOLUME_SETTINGS[STREAM_VOLUME_ALIAS[streamType]];
-            String lastAudibleSettingName = settingName + System.APPEND_FOR_LAST_AUDIBLE;
-            int index = Settings.System.getInt(mContentResolver,
-                                           settingName,
-                                           AudioManager.DEFAULT_STREAM_VOLUME[streamType]);
-            if (STREAM_VOLUME_ALIAS[streamType] != streamType) {
-                index = rescaleIndex(index * 10, STREAM_VOLUME_ALIAS[streamType], streamType);
-            } else {
-                index *= 10;
-            }
-            streamState.mIndex = streamState.getValidIndex(index);
-
-            index = (index + 5) / 10;
-            index = Settings.System.getInt(mContentResolver,
-                                            lastAudibleSettingName,
-                                            (index > 0) ? index : AudioManager.DEFAULT_STREAM_VOLUME[streamType]);
-            if (STREAM_VOLUME_ALIAS[streamType] != streamType) {
-                index = rescaleIndex(index * 10, STREAM_VOLUME_ALIAS[streamType], streamType);
-            } else {
-                index *= 10;
-            }
-            streamState.mLastAudibleIndex = streamState.getValidIndex(index);
+            streamState.readSettings();
 
             // unmute stream that was muted but is not affect by mute anymore
             if (streamState.muteCount() != 0 && !isStreamAffectedByMute(streamType)) {
@@ -1286,7 +1259,7 @@
             }
             // apply stream volume
             if (streamState.muteCount() == 0) {
-                setStreamVolumeIndex(streamType, streamState.mIndex);
+                streamState.applyAllVolumes();
             }
         }
 
@@ -1877,6 +1850,22 @@
         return false;
     }
 
+    private int getDeviceForStream(int stream) {
+        int device = AudioSystem.getDevicesForStream(stream);
+        if ((device & (device - 1)) != 0) {
+            // Multiple device selection is either:
+            //  - speaker + one other device: give priority to speaker in this case.
+            //  - one A2DP device + another device: happens with duplicated output. In this case
+            // retain the device on the A2DP output as the other must not correspond to an active
+            // selection if not the speaker.
+            if ((device & AudioSystem.DEVICE_OUT_SPEAKER) != 0) {
+                device = AudioSystem.DEVICE_OUT_SPEAKER;
+            } else {
+                device &= AudioSystem.DEVICE_OUT_ALL_A2DP;
+            }
+        }
+        return device;
+    }
 
     ///////////////////////////////////////////////////////////////////////////
     // Inner classes
@@ -1888,54 +1877,127 @@
         private String mVolumeIndexSettingName;
         private String mLastAudibleVolumeIndexSettingName;
         private int mIndexMax;
-        private int mIndex;
-        private int mLastAudibleIndex;
-        private ArrayList<VolumeDeathHandler> mDeathHandlers; //handles mute/solo requests client death
+        private final HashMap <Integer, Integer> mIndex = new HashMap <Integer, Integer>();
+        private final HashMap <Integer, Integer> mLastAudibleIndex =
+                                                                new HashMap <Integer, Integer>();
+        private ArrayList<VolumeDeathHandler> mDeathHandlers; //handles mute/solo clients death
 
         private VolumeStreamState(String settingName, int streamType) {
 
-            setVolumeIndexSettingName(settingName);
+            mVolumeIndexSettingName = settingName;
+            mLastAudibleVolumeIndexSettingName = settingName + System.APPEND_FOR_LAST_AUDIBLE;
 
             mStreamType = streamType;
-
-            final ContentResolver cr = mContentResolver;
             mIndexMax = MAX_STREAM_VOLUME[streamType];
-            mIndex = Settings.System.getInt(cr,
-                                            mVolumeIndexSettingName,
-                                            AudioManager.DEFAULT_STREAM_VOLUME[streamType]);
-            mLastAudibleIndex = Settings.System.getInt(cr,
-                                                       mLastAudibleVolumeIndexSettingName,
-                                                       (mIndex > 0) ? mIndex : AudioManager.DEFAULT_STREAM_VOLUME[streamType]);
             AudioSystem.initStreamVolume(streamType, 0, mIndexMax);
             mIndexMax *= 10;
-            mIndex = getValidIndex(10 * mIndex);
-            mLastAudibleIndex = getValidIndex(10 * mLastAudibleIndex);
-            setStreamVolumeIndex(streamType, mIndex);
+
+            readSettings();
+
+            applyAllVolumes();
+
             mDeathHandlers = new ArrayList<VolumeDeathHandler>();
         }
 
-        public void setVolumeIndexSettingName(String settingName) {
-            mVolumeIndexSettingName = settingName;
-            mLastAudibleVolumeIndexSettingName = settingName + System.APPEND_FOR_LAST_AUDIBLE;
+        public String getSettingNameForDevice(boolean lastAudible, int device) {
+            String name = lastAudible ?
+                            mLastAudibleVolumeIndexSettingName :
+                            mVolumeIndexSettingName;
+            String suffix = AudioSystem.getDeviceName(device);
+            if (suffix.isEmpty()) {
+                return name;
+            }
+            return name + "_" + suffix;
         }
 
-        public boolean adjustIndex(int deltaIndex) {
-            return setIndex(mIndex + deltaIndex * 10, true);
+        public void readSettings() {
+            int index = Settings.System.getInt(mContentResolver,
+                            mVolumeIndexSettingName,
+                            AudioManager.DEFAULT_STREAM_VOLUME[mStreamType]);
+
+            mIndex.clear();
+            mIndex.put(AudioSystem.DEVICE_OUT_DEFAULT, index);
+
+            index = Settings.System.getInt(mContentResolver,
+                            mLastAudibleVolumeIndexSettingName,
+                            (index > 0) ? index : AudioManager.DEFAULT_STREAM_VOLUME[mStreamType]);
+            mLastAudibleIndex.clear();
+            mLastAudibleIndex.put(AudioSystem.DEVICE_OUT_DEFAULT, index);
+
+            int remainingDevices = AudioSystem.DEVICE_OUT_ALL;
+            for (int i = 0; remainingDevices != 0; i++) {
+                int device = (1 << i);
+                if ((device & remainingDevices) == 0) {
+                    continue;
+                }
+                remainingDevices &= ~device;
+
+                // retrieve current volume for device
+                String name = getSettingNameForDevice(false, device);
+                index = Settings.System.getInt(mContentResolver, name, -1);
+                if (index == -1) {
+                    continue;
+                }
+                mIndex.put(device, getValidIndex(10 * index));
+
+                // retrieve last audible volume for device
+                name = getSettingNameForDevice(true, device);
+                index = Settings.System.getInt(mContentResolver, name, -1);
+                mLastAudibleIndex.put(device, getValidIndex(10 * index));
+            }
         }
 
-        public boolean setIndex(int index, boolean lastAudible) {
-            int oldIndex = mIndex;
-            mIndex = getValidIndex(index);
+        public void applyDeviceVolume(int device) {
+            AudioSystem.setStreamVolumeIndex(mStreamType,
+                                             (getIndex(device, false  /* lastAudible */) + 5)/10,
+                                             device);
+        }
 
-            if (oldIndex != mIndex) {
+        public void applyAllVolumes() {
+            // apply default volume first: by convention this will reset all
+            // devices volumes in audio policy manager to the supplied value
+            AudioSystem.setStreamVolumeIndex(mStreamType,
+                    (getIndex(AudioSystem.DEVICE_OUT_DEFAULT, false /* lastAudible */) + 5)/10,
+                    AudioSystem.DEVICE_OUT_DEFAULT);
+            // then apply device specific volumes
+            Set set = mIndex.entrySet();
+            Iterator i = set.iterator();
+            while (i.hasNext()) {
+                Map.Entry entry = (Map.Entry)i.next();
+                int device = ((Integer)entry.getKey()).intValue();
+                if (device != AudioSystem.DEVICE_OUT_DEFAULT) {
+                    AudioSystem.setStreamVolumeIndex(mStreamType,
+                                                     ((Integer)entry.getValue() + 5)/10,
+                                                     device);
+                }
+            }
+        }
+
+        public boolean adjustIndex(int deltaIndex, int device) {
+            return setIndex(getIndex(device,
+                                     false  /* lastAudible */) + deltaIndex * 10,
+                            device,
+                            true  /* lastAudible */);
+        }
+
+        public boolean setIndex(int index, int device, boolean lastAudible) {
+            int oldIndex = getIndex(device, false  /* lastAudible */);
+            index = getValidIndex(index);
+            mIndex.put(device, getValidIndex(index));
+
+            if (oldIndex != index) {
                 if (lastAudible) {
-                    mLastAudibleIndex = mIndex;
+                    mLastAudibleIndex.put(device, index);
                 }
                 // Apply change to all streams using this one as alias
                 int numStreamTypes = AudioSystem.getNumStreamTypes();
                 for (int streamType = numStreamTypes - 1; streamType >= 0; streamType--) {
                     if (streamType != mStreamType && STREAM_VOLUME_ALIAS[streamType] == mStreamType) {
-                        mStreamStates[streamType].setIndex(rescaleIndex(mIndex, mStreamType, streamType), lastAudible);
+                        mStreamStates[streamType].setIndex(rescaleIndex(index,
+                                                                        mStreamType,
+                                                                        streamType),
+                                                           device,
+                                                           lastAudible);
                     }
                 }
                 return true;
@@ -1944,12 +2006,29 @@
             }
         }
 
-        public void setLastAudibleIndex(int index) {
-            mLastAudibleIndex = getValidIndex(index);
+        public int getIndex(int device, boolean lastAudible) {
+            HashMap <Integer, Integer> indexes;
+            if (lastAudible) {
+                indexes = mLastAudibleIndex;
+            } else {
+                indexes = mIndex;
+            }
+            Integer index = indexes.get(device);
+            if (index == null) {
+                // there is always an entry for AudioSystem.DEVICE_OUT_DEFAULT
+                index = indexes.get(AudioSystem.DEVICE_OUT_DEFAULT);
+            }
+            return index.intValue();
         }
 
-        public void adjustLastAudibleIndex(int deltaIndex) {
-            setLastAudibleIndex(mLastAudibleIndex + deltaIndex * 10);
+        public void setLastAudibleIndex(int index, int device) {
+            mLastAudibleIndex.put(device, getValidIndex(index));
+        }
+
+        public void adjustLastAudibleIndex(int deltaIndex, int device) {
+            setLastAudibleIndex(getIndex(device,
+                                         true  /* lastAudible */) + deltaIndex * 10,
+                                device);
         }
 
         public int getMaxIndex() {
@@ -1994,10 +2073,20 @@
                                     mICallback.linkToDeath(this, 0);
                                 }
                                 mDeathHandlers.add(this);
-                                // If the stream is not yet muted by any client, set lvel to 0
+                                // If the stream is not yet muted by any client, set level to 0
                                 if (muteCount() == 0) {
-                                    setIndex(0, false);
-                                    sendMsg(mAudioHandler, MSG_SET_SYSTEM_VOLUME, SENDMSG_NOOP, 0, 0,
+                                    Set set = mIndex.entrySet();
+                                    Iterator i = set.iterator();
+                                    while (i.hasNext()) {
+                                        Map.Entry entry = (Map.Entry)i.next();
+                                        int device = ((Integer)entry.getKey()).intValue();
+                                        setIndex(0, device, false /* lastAudible */);
+                                    }
+                                    sendMsg(mAudioHandler,
+                                            MSG_SET_ALL_VOLUMES,
+                                            SENDMSG_NOOP,
+                                            0,
+                                            0,
                                             VolumeStreamState.this, 0);
                                 }
                             } catch (RemoteException e) {
@@ -2026,9 +2115,22 @@
                                     // If the stream is not muted any more, restore it's volume if
                                     // ringer mode allows it
                                     if (!isStreamAffectedByRingerMode(mStreamType) ||
-                                            getRingerMode() == AudioManager.RINGER_MODE_NORMAL) {
-                                        setIndex(mLastAudibleIndex, false);
-                                        sendMsg(mAudioHandler, MSG_SET_SYSTEM_VOLUME, SENDMSG_NOOP, 0, 0,
+                                            mRingerMode == AudioManager.RINGER_MODE_NORMAL) {
+                                        Set set = mIndex.entrySet();
+                                        Iterator i = set.iterator();
+                                        while (i.hasNext()) {
+                                            Map.Entry entry = (Map.Entry)i.next();
+                                            int device = ((Integer)entry.getKey()).intValue();
+                                            setIndex(getIndex(device,
+                                                              true  /* lastAudible */),
+                                                     device,
+                                                     false  /* lastAudible */);
+                                        }
+                                        sendMsg(mAudioHandler,
+                                                MSG_SET_ALL_VOLUMES,
+                                                SENDMSG_NOOP,
+                                                0,
+                                                0,
                                                 VolumeStreamState.this, 0);
                                     }
                                 }
@@ -2107,17 +2209,17 @@
     /** Handles internal volume messages in separate volume thread. */
     private class AudioHandler extends Handler {
 
-        private void setSystemVolume(VolumeStreamState streamState) {
+        private void setDeviceVolume(VolumeStreamState streamState, int device) {
 
-            // Adjust volume
-            setStreamVolumeIndex(streamState.mStreamType, streamState.mIndex);
+            // Apply volume
+            streamState.applyDeviceVolume(device);
 
             // Apply change to all streams using this one as alias
             int numStreamTypes = AudioSystem.getNumStreamTypes();
             for (int streamType = numStreamTypes - 1; streamType >= 0; streamType--) {
                 if (streamType != streamState.mStreamType &&
-                    STREAM_VOLUME_ALIAS[streamType] == streamState.mStreamType) {
-                    setStreamVolumeIndex(streamType, mStreamStates[streamType].mIndex);
+                        STREAM_VOLUME_ALIAS[streamType] == streamState.mStreamType) {
+                    mStreamStates[streamType].applyDeviceVolume(device);
                 }
             }
 
@@ -2126,21 +2228,39 @@
                     MSG_PERSIST_VOLUME,
                     SENDMSG_REPLACE,
                     PERSIST_CURRENT|PERSIST_LAST_AUDIBLE,
-                    0,
+                    device,
                     streamState,
                     PERSIST_DELAY);
 
         }
 
+        private void setAllVolumes(VolumeStreamState streamState) {
+
+            // Apply volume
+            streamState.applyAllVolumes();
+
+            // Apply change to all streams using this one as alias
+            int numStreamTypes = AudioSystem.getNumStreamTypes();
+            for (int streamType = numStreamTypes - 1; streamType >= 0; streamType--) {
+                if (streamType != streamState.mStreamType &&
+                        STREAM_VOLUME_ALIAS[streamType] == streamState.mStreamType) {
+                    mStreamStates[streamType].applyAllVolumes();
+                }
+            }
+        }
+
         private void persistVolume(VolumeStreamState streamState,
-                                   int persistType) {
+                                   int persistType,
+                                   int device) {
             if ((persistType & PERSIST_CURRENT) != 0) {
-                System.putInt(mContentResolver, streamState.mVolumeIndexSettingName,
-                              (streamState.mIndex + 5)/ 10);
+                System.putInt(mContentResolver,
+                          streamState.getSettingNameForDevice(false /* lastAudible */, device),
+                          (streamState.getIndex(device, false /* lastAudible */) + 5)/ 10);
             }
             if ((persistType & PERSIST_LAST_AUDIBLE) != 0) {
-                System.putInt(mContentResolver, streamState.mLastAudibleVolumeIndexSettingName,
-                    (streamState.mLastAudibleIndex + 5) / 10);
+                System.putInt(mContentResolver,
+                        streamState.getSettingNameForDevice(true /* lastAudible */, device),
+                        (streamState.getIndex(device, true  /* lastAudible */) + 5) / 10);
             }
         }
 
@@ -2223,12 +2343,16 @@
 
             switch (msg.what) {
 
-                case MSG_SET_SYSTEM_VOLUME:
-                    setSystemVolume((VolumeStreamState) msg.obj);
+                case MSG_SET_DEVICE_VOLUME:
+                    setDeviceVolume((VolumeStreamState) msg.obj, msg.arg1);
+                    break;
+
+                case MSG_SET_ALL_VOLUMES:
+                    setAllVolumes((VolumeStreamState) msg.obj);
                     break;
 
                 case MSG_PERSIST_VOLUME:
-                    persistVolume((VolumeStreamState) msg.obj, msg.arg1);
+                    persistVolume((VolumeStreamState) msg.obj, msg.arg1, msg.arg2);
                     break;
 
                 case MSG_PERSIST_RINGER_MODE:
@@ -2264,7 +2388,7 @@
                     synchronized (mConnectedDevices) {
                         Set set = mConnectedDevices.entrySet();
                         Iterator i = set.iterator();
-                        while(i.hasNext()){
+                        while (i.hasNext()) {
                             Map.Entry device = (Map.Entry)i.next();
                             AudioSystem.setDeviceConnectionState(
                                                             ((Integer)device.getKey()).intValue(),
@@ -2282,15 +2406,10 @@
                     // Restore stream volumes
                     int numStreamTypes = AudioSystem.getNumStreamTypes();
                     for (int streamType = numStreamTypes - 1; streamType >= 0; streamType--) {
-                        int index;
                         VolumeStreamState streamState = mStreamStates[streamType];
                         AudioSystem.initStreamVolume(streamType, 0, (streamState.mIndexMax + 5) / 10);
-                        if (streamState.muteCount() == 0) {
-                            index = streamState.mIndex;
-                        } else {
-                            index = 0;
-                        }
-                        setStreamVolumeIndex(streamType, index);
+
+                        streamState.applyAllVolumes();
                     }
 
                     // Restore ringer mode
@@ -2741,9 +2860,10 @@
     //==========================================================================================
 
     /* constant to identify focus stack entry that is used to hold the focus while the phone
-     * is ringing or during a call
+     * is ringing or during a call. Used by com.android.internal.telephony.CallManager when
+     * entering and exiting calls.
      */
-    private final static String IN_VOICE_COMM_FOCUS_ID = "AudioFocus_For_Phone_Ring_And_Calls";
+    public final static String IN_VOICE_COMM_FOCUS_ID = "AudioFocus_For_Phone_Ring_And_Calls";
 
     private final static Object mAudioFocusLock = new Object();
 
@@ -2825,7 +2945,7 @@
         }
     }
 
-    private Stack<FocusStackEntry> mFocusStack = new Stack<FocusStackEntry>();
+    private final Stack<FocusStackEntry> mFocusStack = new Stack<FocusStackEntry>();
 
     /**
      * Helper function:
@@ -3202,7 +3322,7 @@
      *  synchronized on mRCStack, but also BEFORE on mFocusLock as any change in either
      *  stack, audio focus or RC, can lead to a change in the remote control display
      */
-    private Stack<RemoteControlStackEntry> mRCStack = new Stack<RemoteControlStackEntry>();
+    private final Stack<RemoteControlStackEntry> mRCStack = new Stack<RemoteControlStackEntry>();
 
     /**
      * Helper function:
diff --git a/media/java/android/media/AudioSystem.java b/media/java/android/media/AudioSystem.java
index 474a842..3080497 100644
--- a/media/java/android/media/AudioSystem.java
+++ b/media/java/android/media/AudioSystem.java
@@ -183,6 +183,7 @@
         }
     }
 
+
     /*
      * AudioPolicyService methods
      */
@@ -202,6 +203,23 @@
     public static final int DEVICE_OUT_ANLG_DOCK_HEADSET = 0x800;
     public static final int DEVICE_OUT_DGTL_DOCK_HEADSET = 0x1000;
     public static final int DEVICE_OUT_DEFAULT = 0x8000;
+    public static final int DEVICE_OUT_ALL = (DEVICE_OUT_EARPIECE |
+                                              DEVICE_OUT_SPEAKER |
+                                              DEVICE_OUT_WIRED_HEADSET |
+                                              DEVICE_OUT_WIRED_HEADPHONE |
+                                              DEVICE_OUT_BLUETOOTH_SCO |
+                                              DEVICE_OUT_BLUETOOTH_SCO_HEADSET |
+                                              DEVICE_OUT_BLUETOOTH_SCO_CARKIT |
+                                              DEVICE_OUT_BLUETOOTH_A2DP |
+                                              DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES |
+                                              DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER |
+                                              DEVICE_OUT_AUX_DIGITAL |
+                                              DEVICE_OUT_ANLG_DOCK_HEADSET |
+                                              DEVICE_OUT_DGTL_DOCK_HEADSET |
+                                              DEVICE_OUT_DEFAULT);
+    public static final int DEVICE_OUT_ALL_A2DP = (DEVICE_OUT_BLUETOOTH_A2DP |
+                                                   DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES |
+                                                   DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER);
     // input devices
     public static final int DEVICE_IN_COMMUNICATION = 0x10000;
     public static final int DEVICE_IN_AMBIENT = 0x20000;
@@ -218,6 +236,54 @@
     public static final int DEVICE_STATE_AVAILABLE = 1;
     private static final int NUM_DEVICE_STATES = 1;
 
+    public static final String DEVICE_OUT_EARPIECE_NAME = "earpiece";
+    public static final String DEVICE_OUT_SPEAKER_NAME = "speaker";
+    public static final String DEVICE_OUT_WIRED_HEADSET_NAME = "headset";
+    public static final String DEVICE_OUT_WIRED_HEADPHONE_NAME = "headphone";
+    public static final String DEVICE_OUT_BLUETOOTH_SCO_NAME = "bt_sco";
+    public static final String DEVICE_OUT_BLUETOOTH_SCO_HEADSET_NAME = "bt_sco_hs";
+    public static final String DEVICE_OUT_BLUETOOTH_SCO_CARKIT_NAME = "bt_sco_carkit";
+    public static final String DEVICE_OUT_BLUETOOTH_A2DP_NAME = "bt_a2dp";
+    public static final String DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES_NAME = "bt_a2dp_hp";
+    public static final String DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER_NAME = "bt_a2dp_spk";
+    public static final String DEVICE_OUT_AUX_DIGITAL_NAME = "aux_digital";
+    public static final String DEVICE_OUT_ANLG_DOCK_HEADSET_NAME = "analog_dock";
+    public static final String DEVICE_OUT_DGTL_DOCK_HEADSET_NAME = "digital_dock";
+
+    public static String getDeviceName(int device)
+    {
+        switch(device) {
+        case DEVICE_OUT_EARPIECE:
+            return DEVICE_OUT_EARPIECE_NAME;
+        case DEVICE_OUT_SPEAKER:
+            return DEVICE_OUT_SPEAKER_NAME;
+        case DEVICE_OUT_WIRED_HEADSET:
+            return DEVICE_OUT_WIRED_HEADSET_NAME;
+        case DEVICE_OUT_WIRED_HEADPHONE:
+            return DEVICE_OUT_WIRED_HEADPHONE_NAME;
+        case DEVICE_OUT_BLUETOOTH_SCO:
+            return DEVICE_OUT_BLUETOOTH_SCO_NAME;
+        case DEVICE_OUT_BLUETOOTH_SCO_HEADSET:
+            return DEVICE_OUT_BLUETOOTH_SCO_HEADSET_NAME;
+        case DEVICE_OUT_BLUETOOTH_SCO_CARKIT:
+            return DEVICE_OUT_BLUETOOTH_SCO_CARKIT_NAME;
+        case DEVICE_OUT_BLUETOOTH_A2DP:
+            return DEVICE_OUT_BLUETOOTH_A2DP_NAME;
+        case DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES:
+            return DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES_NAME;
+        case DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER:
+            return DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER_NAME;
+        case DEVICE_OUT_AUX_DIGITAL:
+            return DEVICE_OUT_AUX_DIGITAL_NAME;
+        case DEVICE_OUT_ANLG_DOCK_HEADSET:
+            return DEVICE_OUT_ANLG_DOCK_HEADSET_NAME;
+        case DEVICE_OUT_DGTL_DOCK_HEADSET:
+            return DEVICE_OUT_DGTL_DOCK_HEADSET_NAME;
+        default:
+            return "";
+        }
+    }
+
     // phone state, match audio_mode???
     public static final int PHONE_STATE_OFFCALL = 0;
     public static final int PHONE_STATE_RINGING = 1;
@@ -247,11 +313,10 @@
     public static native int setDeviceConnectionState(int device, int state, String device_address);
     public static native int getDeviceConnectionState(int device, String device_address);
     public static native int setPhoneState(int state);
-    public static native int setRingerMode(int mode, int mask);
     public static native int setForceUse(int usage, int config);
     public static native int getForceUse(int usage);
     public static native int initStreamVolume(int stream, int indexMin, int indexMax);
-    public static native int setStreamVolumeIndex(int stream, int index);
-    public static native int getStreamVolumeIndex(int stream);
+    public static native int setStreamVolumeIndex(int stream, int index, int device);
+    public static native int getStreamVolumeIndex(int stream, int device);
     public static native int getDevicesForStream(int stream);
 }
diff --git a/media/java/android/media/AudioTrack.java b/media/java/android/media/AudioTrack.java
index 7b2f1b7..7d4c282 100644
--- a/media/java/android/media/AudioTrack.java
+++ b/media/java/android/media/AudioTrack.java
@@ -840,7 +840,10 @@
 
     /**
      * Stops playing the audio data.
-     *
+     * When used on an instance created in {@link #MODE_STREAM} mode, audio will stop playing
+     * after the last buffer that was written has been played. For an immediate stop, use
+     * {@link #pause()}, followed by {@link #flush()} to discard audio data that hasn't been played
+     * back yet.
      * @throws IllegalStateException
      */
     public void stop()
@@ -859,7 +862,7 @@
     /**
      * Pauses the playback of the audio data. Data that has not been played
      * back will not be discarded. Subsequent calls to {@link #play} will play
-     * this data back.
+     * this data back. See {@link #flush()} to discard this data.
      *
      * @throws IllegalStateException
      */
diff --git a/media/java/android/media/ExifInterface.java b/media/java/android/media/ExifInterface.java
index 925f965..9d6c9f6 100644
--- a/media/java/android/media/ExifInterface.java
+++ b/media/java/android/media/ExifInterface.java
@@ -111,7 +111,7 @@
     // there can only be one user at a time for the native functions (and
     // they cannot keep state in the native code across function calls). We
     // use sLock to serialize the accesses.
-    private static Object sLock = new Object();
+    private static final Object sLock = new Object();
 
     /**
      * Reads Exif tags from the specified JPEG file.
diff --git a/media/java/android/media/MediaFile.java b/media/java/android/media/MediaFile.java
index e275aa6..7f7e284 100644
--- a/media/java/android/media/MediaFile.java
+++ b/media/java/android/media/MediaFile.java
@@ -120,18 +120,18 @@
         }
     }
     
-    private static HashMap<String, MediaFileType> sFileTypeMap
+    private static final HashMap<String, MediaFileType> sFileTypeMap
             = new HashMap<String, MediaFileType>();
-    private static HashMap<String, Integer> sMimeTypeMap
+    private static final HashMap<String, Integer> sMimeTypeMap
             = new HashMap<String, Integer>();
     // maps file extension to MTP format code
-    private static HashMap<String, Integer> sFileTypeToFormatMap
+    private static final HashMap<String, Integer> sFileTypeToFormatMap
             = new HashMap<String, Integer>();
     // maps mime type to MTP format code
-    private static HashMap<String, Integer> sMimeTypeToFormatMap
+    private static final HashMap<String, Integer> sMimeTypeToFormatMap
             = new HashMap<String, Integer>();
     // maps MTP format code to mime type
-    private static HashMap<Integer, String> sFormatToMimeTypeMap
+    private static final HashMap<Integer, String> sFormatToMimeTypeMap
             = new HashMap<Integer, String>();
 
     static void addFileType(String extension, int fileType, String mimeType) {
diff --git a/media/java/android/media/MediaInserter.java b/media/java/android/media/MediaInserter.java
index a998407..e92c710 100644
--- a/media/java/android/media/MediaInserter.java
+++ b/media/java/android/media/MediaInserter.java
@@ -32,7 +32,7 @@
  * {@hide}
  */
 public class MediaInserter {
-    private HashMap<Uri, List<ContentValues>> mRowMap =
+    private final HashMap<Uri, List<ContentValues>> mRowMap =
             new HashMap<Uri, List<ContentValues>>();
 
     private IContentProvider mProvider;
diff --git a/media/java/android/media/MediaRecorder.java b/media/java/android/media/MediaRecorder.java
index 08e6032..85d99c1 100644
--- a/media/java/android/media/MediaRecorder.java
+++ b/media/java/android/media/MediaRecorder.java
@@ -138,10 +138,13 @@
      */
     public final class AudioSource {
       /* Do not change these values without updating their counterparts
-       * in include/media/mediarecorder.h!
+       * in system/core/include/system/audio.h!
        */
         private AudioSource() {}
+
+        /** Default audio source **/
         public static final int DEFAULT = 0;
+
         /** Microphone audio source */
         public static final int MIC = 1;
 
@@ -201,18 +204,24 @@
         /** MPEG4 media file format*/
         public static final int MPEG_4 = 2;
 
-        /** The following formats are audio only .aac or .amr formats **/
-        /** @deprecated  Deprecated in favor of AMR_NB */
-        /** Deprecated in favor of MediaRecorder.OutputFormat.AMR_NB */
-        /** AMR NB file format */
+        /** The following formats are audio only .aac or .amr formats */
+
+        /**
+         * AMR NB file format
+         * @deprecated  Deprecated in favor of MediaRecorder.OutputFormat.AMR_NB
+         */
         public static final int RAW_AMR = 3;
+
         /** AMR NB file format */
         public static final int AMR_NB = 3;
+
         /** AMR WB file format */
         public static final int AMR_WB = 4;
+
         /** @hide AAC ADIF file format */
         public static final int AAC_ADIF = 5;
-        /** @hide AAC ADTS file format */
+
+        /** AAC ADTS file format */
         public static final int AAC_ADTS = 6;
 
         /** @hide Stream over a socket, limited to a single stream */
diff --git a/media/java/android/media/MediaScanner.java b/media/java/android/media/MediaScanner.java
index 55074aa..9dc9cef 100644
--- a/media/java/android/media/MediaScanner.java
+++ b/media/java/android/media/MediaScanner.java
@@ -35,6 +35,7 @@
 import android.os.RemoteException;
 import android.os.SystemProperties;
 import android.provider.MediaStore;
+import android.provider.MediaStore.Files.FileColumns;
 import android.provider.Settings;
 import android.provider.MediaStore.Audio;
 import android.provider.MediaStore.Files;
@@ -58,6 +59,7 @@
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.Locale;
 
 /**
  * Internal service helper that no-one should use directly.
@@ -312,17 +314,8 @@
 
     private final String mExternalStoragePath;
 
-    // WARNING: Bulk inserts sounded like a great idea and gave us a good performance improvement,
-    // but unfortunately it also introduced a number of bugs.  Many of those bugs were fixed,
-    // but (at least) one problem is still outstanding:
-    //
-    // - Bulk inserts broke the code that sets the default ringtones, notifications, and alarms
-    //   on first boot
-    //
-    // This problem might be solvable by moving the logic to the media provider or disabling bulk
-    // inserts only for those cases. For now, we are disabling bulk inserts until we have a solid
-    // fix for this problem.
-    private static final boolean ENABLE_BULK_INSERTS = false;
+    /** whether to use bulk inserts or individual inserts for each item */
+    private static final boolean ENABLE_BULK_INSERTS = true;
 
     // used when scanning the image database so we know whether we have to prune
     // old thumbnail files
@@ -352,7 +345,7 @@
     // this should be set when scanning files on a case insensitive file system.
     private boolean mCaseInsensitivePaths;
 
-    private BitmapFactory.Options mBitmapOptions = new BitmapFactory.Options();
+    private final BitmapFactory.Options mBitmapOptions = new BitmapFactory.Options();
 
     private static class FileCacheEntry {
         long mRowId;
@@ -408,7 +401,7 @@
                 + Settings.System.ALARM_ALERT);
     }
 
-    private MyMediaScannerClient mClient = new MyMediaScannerClient();
+    private final MyMediaScannerClient mClient = new MyMediaScannerClient();
 
     private boolean isDrmEnabled() {
         String prop = SystemProperties.get("drm.service.enabled");
@@ -895,6 +888,7 @@
                 }
             }
             Uri result = null;
+            boolean needToSetSettings = false;
             if (rowId == 0) {
                 if (mMtpObjectHandle != 0) {
                     values.put(MediaStore.MediaColumns.MEDIA_SCANNER_NEW_OBJECT_ID, mMtpObjectHandle);
@@ -906,12 +900,37 @@
                     }
                     values.put(Files.FileColumns.FORMAT, format);
                 }
+                // Setting a flag in order not to use bulk insert for the file related with
+                // notifications, ringtones, and alarms, because the rowId of the inserted file is
+                // needed.
+                if (mWasEmptyPriorToScan) {
+                    if (notifications && !mDefaultNotificationSet) {
+                        if (TextUtils.isEmpty(mDefaultNotificationFilename) ||
+                                doesPathHaveFilename(entry.mPath, mDefaultNotificationFilename)) {
+                            needToSetSettings = true;
+                        }
+                    } else if (ringtones && !mDefaultRingtoneSet) {
+                        if (TextUtils.isEmpty(mDefaultRingtoneFilename) ||
+                                doesPathHaveFilename(entry.mPath, mDefaultRingtoneFilename)) {
+                            needToSetSettings = true;
+                        }
+                    } else if (alarms && !mDefaultAlarmSet) {
+                        if (TextUtils.isEmpty(mDefaultAlarmAlertFilename) ||
+                                doesPathHaveFilename(entry.mPath, mDefaultAlarmAlertFilename)) {
+                            needToSetSettings = true;
+                        }
+                    }
+                }
+
                 // new file, insert it
                 // We insert directories immediately to ensure they are in the database
                 // before the files they contain.
                 // Otherwise we can get duplicate directory entries in the database
                 // if one of the media FileInserters is flushed before the files table FileInserter
-                if (inserter == null || entry.mFormat == MtpConstants.FORMAT_ASSOCIATION) {
+                // Also, we immediately insert the file if the rowId of the inserted file is
+                // needed.
+                if (inserter == null || needToSetSettings ||
+                        entry.mFormat == MtpConstants.FORMAT_ASSOCIATION) {
                     result = mMediaProvider.insert(tableUri, values);
                 } else {
                     inserter.insert(tableUri, values);
@@ -927,24 +946,33 @@
                 // path should never change, and we want to avoid replacing mixed cased paths
                 // with squashed lower case paths
                 values.remove(MediaStore.MediaColumns.DATA);
+
+                int mediaType = 0;
+                if (!MediaScanner.isNoMediaPath(entry.mPath)) {
+                    int fileType = MediaFile.getFileTypeForMimeType(mMimeType);
+                    if (MediaFile.isAudioFileType(fileType)) {
+                        mediaType = FileColumns.MEDIA_TYPE_AUDIO;
+                    } else if (MediaFile.isVideoFileType(fileType)) {
+                        mediaType = FileColumns.MEDIA_TYPE_VIDEO;
+                    } else if (MediaFile.isImageFileType(fileType)) {
+                        mediaType = FileColumns.MEDIA_TYPE_IMAGE;
+                    } else if (MediaFile.isPlayListFileType(fileType)) {
+                        mediaType = FileColumns.MEDIA_TYPE_PLAYLIST;
+                    }
+                    values.put(FileColumns.MEDIA_TYPE, mediaType);
+                }
+
                 mMediaProvider.update(result, values, null, null);
             }
 
-            if (notifications && mWasEmptyPriorToScan && !mDefaultNotificationSet) {
-                if (TextUtils.isEmpty(mDefaultNotificationFilename) ||
-                        doesPathHaveFilename(entry.mPath, mDefaultNotificationFilename)) {
+            if(needToSetSettings) {
+                if (notifications) {
                     setSettingIfNotSet(Settings.System.NOTIFICATION_SOUND, tableUri, rowId);
                     mDefaultNotificationSet = true;
-                }
-            } else if (ringtones && mWasEmptyPriorToScan && !mDefaultRingtoneSet) {
-                if (TextUtils.isEmpty(mDefaultRingtoneFilename) ||
-                        doesPathHaveFilename(entry.mPath, mDefaultRingtoneFilename)) {
+                } else if (ringtones) {
                     setSettingIfNotSet(Settings.System.RINGTONE, tableUri, rowId);
                     mDefaultRingtoneSet = true;
-                }
-            } else if (alarms && mWasEmptyPriorToScan && !mDefaultAlarmSet) {
-                if (TextUtils.isEmpty(mDefaultAlarmAlertFilename) ||
-                        doesPathHaveFilename(entry.mPath, mDefaultAlarmAlertFilename)) {
+                } else if (alarms) {
                     setSettingIfNotSet(Settings.System.ALARM_ALERT, tableUri, rowId);
                     mDefaultAlarmSet = true;
                 }
@@ -1023,7 +1051,7 @@
                 // First read existing files from the files table
 
                 c = mMediaProvider.query(mFilesUri, FILES_PRESCAN_PROJECTION,
-                        where, selectionArgs, null);
+                        where, selectionArgs, null, null);
 
                 if (c != null) {
                     mWasEmptyPriorToScan = c.getCount() == 0;
@@ -1060,7 +1088,7 @@
 
         // compute original size of images
         mOriginalCount = 0;
-        c = mMediaProvider.query(mImagesUri, ID_PROJECTION, null, null, null);
+        c = mMediaProvider.query(mImagesUri, ID_PROJECTION, null, null, null, null);
         if (c != null) {
             mOriginalCount = c.getCount();
             c.close();
@@ -1095,7 +1123,7 @@
                     new String [] { "_data" },
                     null,
                     null,
-                    null);
+                    null, null);
             Log.v(TAG, "pruneDeadThumbnailFiles... " + c);
             if (c != null && c.moveToFirst()) {
                 do {
@@ -1148,15 +1176,14 @@
             }
 
             if (fileMissing) {
-                // Clear the file path to prevent the _DELETE_FILE database hook
-                // in the media provider from deleting the file.
+                // Tell the provider to not delete the file.
                 // If the file is truly gone the delete is unnecessary, and we want to avoid
-                // accidentally deleting files that are really there.
-                ContentValues values = new ContentValues();
-                values.put(Files.FileColumns.DATA, "");
-                values.put(Files.FileColumns.DATE_MODIFIED, 0);
-                mMediaProvider.update(ContentUris.withAppendedId(mFilesUri, entry.mRowId),
-                        values, null, null);
+                // accidentally deleting files that are really there (this may happen if the
+                // filesystem is mounted and unmounted while the scanner is running).
+                Uri.Builder builder = mFilesUri.buildUpon();
+                builder.appendEncodedPath(String.valueOf(entry.mRowId));
+                builder.appendQueryParameter(MediaStore.PARAM_DELETE_DATA, "false");
+                Uri missingUri = builder.build();
 
                 // do not delete missing playlists, since they may have been modified by the user.
                 // the user can delete them in the media player instead.
@@ -1165,9 +1192,12 @@
                 int fileType = (mediaFileType == null ? 0 : mediaFileType.fileType);
 
                 if (!MediaFile.isPlayListFileType(fileType)) {
-                    mMediaProvider.delete(ContentUris.withAppendedId(mFilesUri, entry.mRowId),
-                            null, null);
+                    mMediaProvider.delete(missingUri, null, null);
                     iterator.remove();
+                    if (entry.mPath.toLowerCase(Locale.US).endsWith("/.nomedia")) {
+                        File f = new File(path);
+                        mMediaProvider.call(MediaStore.UNHIDE_CALL, f.getParent(), null);
+                    }
                 }
             }
         }
@@ -1460,7 +1490,7 @@
             if (bestMatch.mRowId == 0) {
                 Cursor c = mMediaProvider.query(mAudioUri, ID_PROJECTION,
                         MediaStore.Files.FileColumns.DATA + "=?",
-                        new String[] { bestMatch.mPath }, null);
+                        new String[] { bestMatch.mPath }, null, null);
                 if (c != null) {
                     if (c.moveToNext()) {
                         bestMatch.mRowId = c.getLong(0);
diff --git a/media/java/android/media/MediaScannerConnection.java b/media/java/android/media/MediaScannerConnection.java
index 969da39..21b6e14 100644
--- a/media/java/android/media/MediaScannerConnection.java
+++ b/media/java/android/media/MediaScannerConnection.java
@@ -46,7 +46,7 @@
     private IMediaScannerService mService;
     private boolean mConnected; // true if connect() has been called since last disconnect()
 
-    private IMediaScannerListener.Stub mListener = new IMediaScannerListener.Stub() {
+    private final IMediaScannerListener.Stub mListener = new IMediaScannerListener.Stub() {
         public void scanCompleted(String path, Uri uri) {
             MediaScannerConnectionClient client = mClient;
             if (client != null) {
diff --git a/media/java/android/media/MiniThumbFile.java b/media/java/android/media/MiniThumbFile.java
index df141c1..63b149c 100644
--- a/media/java/android/media/MiniThumbFile.java
+++ b/media/java/android/media/MiniThumbFile.java
@@ -52,7 +52,7 @@
     private RandomAccessFile mMiniThumbFile;
     private FileChannel mChannel;
     private ByteBuffer mBuffer;
-    private static Hashtable<String, MiniThumbFile> sThumbFiles =
+    private static final Hashtable<String, MiniThumbFile> sThumbFiles =
         new Hashtable<String, MiniThumbFile>();
 
     /**
diff --git a/media/java/android/media/RemoteControlClient.java b/media/java/android/media/RemoteControlClient.java
index 77acfe6..18b4ee6 100644
--- a/media/java/android/media/RemoteControlClient.java
+++ b/media/java/android/media/RemoteControlClient.java
@@ -576,6 +576,7 @@
     /**
      * Cache for the metadata strings.
      * Access synchronized on mCacheLock
+     * This is re-initialized in apply() and so cannot be final.
      */
     private Bundle mMetadata = new Bundle();
 
@@ -621,7 +622,7 @@
     /**
      * The IRemoteControlClient implementation
      */
-    private IRemoteControlClient mIRCC = new IRemoteControlClient.Stub() {
+    private final IRemoteControlClient mIRCC = new IRemoteControlClient.Stub() {
 
         public void onInformationRequested(int clientGeneration, int infoFlags,
                 int artWidth, int artHeight) {
diff --git a/media/java/android/media/RingtoneManager.java b/media/java/android/media/RingtoneManager.java
index 9c0819f..7aaf4aa 100644
--- a/media/java/android/media/RingtoneManager.java
+++ b/media/java/android/media/RingtoneManager.java
@@ -224,7 +224,7 @@
      * If a column (item from this list) exists in the Cursor, its value must
      * be true (value of 1) for the row to be returned.
      */
-    private List<String> mFilterColumns = new ArrayList<String>();
+    private final List<String> mFilterColumns = new ArrayList<String>();
     
     private boolean mStopPreviousRingtone = true;
     private Ringtone mPreviousRingtone;
diff --git a/media/java/android/mtp/MtpDatabase.java b/media/java/android/mtp/MtpDatabase.java
index 19db1c0..18aa4b3 100755
--- a/media/java/android/mtp/MtpDatabase.java
+++ b/media/java/android/mtp/MtpDatabase.java
@@ -266,7 +266,7 @@
             Cursor c = null;
             try {
                 c = mMediaProvider.query(mObjectsUri, ID_PROJECTION, PATH_WHERE,
-                        new String[] { path }, null);
+                        new String[] { path }, null, null);
                 if (c != null && c.getCount() > 0) {
                     Log.w(TAG, "file already exists in beginSendObject: " + path);
                     return -1;
@@ -433,7 +433,7 @@
             }
         }
 
-        return mMediaProvider.query(mObjectsUri, ID_PROJECTION, where, whereArgs, null);
+        return mMediaProvider.query(mObjectsUri, ID_PROJECTION, where, whereArgs, null, null);
     }
 
     private int[] getObjectList(int storageID, int format, int parent) {
@@ -699,7 +699,7 @@
         String path = null;
         String[] whereArgs = new String[] {  Integer.toString(handle) };
         try {
-            c = mMediaProvider.query(mObjectsUri, PATH_PROJECTION, ID_WHERE, whereArgs, null);
+            c = mMediaProvider.query(mObjectsUri, PATH_PROJECTION, ID_WHERE, whereArgs, null, null);
             if (c != null && c.moveToNext()) {
                 path = c.getString(1);
             }
@@ -752,6 +752,29 @@
             return MtpConstants.RESPONSE_GENERAL_ERROR;
         }
 
+        // check if nomedia status changed
+        if (newFile.isDirectory()) {
+            // for directories, check if renamed from something hidden to something non-hidden
+            if (oldFile.getName().startsWith(".") && !newPath.startsWith(".")) {
+                // directory was unhidden
+                try {
+                    mMediaProvider.call(MediaStore.UNHIDE_CALL, newPath, null);
+                } catch (RemoteException e) {
+                    Log.e(TAG, "failed to unhide/rescan for " + newPath);
+                }
+            }
+        } else {
+            // for files, check if renamed from .nomedia to something else
+            if (oldFile.getName().toLowerCase(Locale.US).equals(".nomedia")
+                    && !newPath.toLowerCase(Locale.US).equals(".nomedia")) {
+                try {
+                    mMediaProvider.call(MediaStore.UNHIDE_CALL, oldFile.getParent(), null);
+                } catch (RemoteException e) {
+                    Log.e(TAG, "failed to unhide/rescan for " + newPath);
+                }
+            }
+        }
+
         return MtpConstants.RESPONSE_OK;
     }
 
@@ -815,7 +838,7 @@
         Cursor c = null;
         try {
             c = mMediaProvider.query(mObjectsUri, OBJECT_INFO_PROJECTION,
-                            ID_WHERE, new String[] {  Integer.toString(handle) }, null);
+                            ID_WHERE, new String[] {  Integer.toString(handle) }, null, null);
             if (c != null && c.moveToNext()) {
                 outStorageFormatParent[0] = c.getInt(1);
                 outStorageFormatParent[1] = c.getInt(2);
@@ -858,7 +881,7 @@
         Cursor c = null;
         try {
             c = mMediaProvider.query(mObjectsUri, PATH_SIZE_FORMAT_PROJECTION,
-                            ID_WHERE, new String[] {  Integer.toString(handle) }, null);
+                            ID_WHERE, new String[] {  Integer.toString(handle) }, null, null);
             if (c != null && c.moveToNext()) {
                 String path = c.getString(1);
                 path.getChars(0, path.length(), outFilePath, 0);
@@ -887,7 +910,7 @@
         Cursor c = null;
         try {
             c = mMediaProvider.query(mObjectsUri, PATH_SIZE_FORMAT_PROJECTION,
-                            ID_WHERE, new String[] {  Integer.toString(handle) }, null);
+                            ID_WHERE, new String[] {  Integer.toString(handle) }, null, null);
             if (c != null && c.moveToNext()) {
                 // don't convert to media path here, since we will be matching
                 // against paths in the database matching /data/media
@@ -915,6 +938,15 @@
 
             Uri uri = Files.getMtpObjectsUri(mVolumeName, handle);
             if (mMediaProvider.delete(uri, null, null) > 0) {
+                if (format != MtpConstants.FORMAT_ASSOCIATION
+                        && path.toLowerCase(Locale.US).endsWith("/.nomedia")) {
+                    try {
+                        String parentPath = path.substring(0, path.lastIndexOf("/"));
+                        mMediaProvider.call(MediaStore.UNHIDE_CALL, parentPath, null);
+                    } catch (RemoteException e) {
+                        Log.e(TAG, "failed to unhide/rescan for " + path);
+                    }
+                }
                 return MtpConstants.RESPONSE_OK;
             } else {
                 return MtpConstants.RESPONSE_INVALID_OBJECT_HANDLE;
@@ -933,7 +965,7 @@
         Uri uri = Files.getMtpReferencesUri(mVolumeName, handle);
         Cursor c = null;
         try {
-            c = mMediaProvider.query(uri, ID_PROJECTION, null, null, null);
+            c = mMediaProvider.query(uri, ID_PROJECTION, null, null, null, null);
             if (c == null) {
                 return null;
             }
diff --git a/media/java/android/mtp/MtpPropertyGroup.java b/media/java/android/mtp/MtpPropertyGroup.java
index 76c8569..dab5454 100644
--- a/media/java/android/mtp/MtpPropertyGroup.java
+++ b/media/java/android/mtp/MtpPropertyGroup.java
@@ -191,7 +191,7 @@
             // for now we are only reading properties from the "objects" table
             c = mProvider.query(mUri,
                             new String [] { Files.FileColumns._ID, column },
-                            ID_WHERE, new String[] { Integer.toString(id) }, null);
+                            ID_WHERE, new String[] { Integer.toString(id) }, null, null);
             if (c != null && c.moveToNext()) {
                 return c.getString(1);
             } else {
@@ -211,7 +211,7 @@
         try {
             c = mProvider.query(Audio.Media.getContentUri(mVolumeName),
                             new String [] { Files.FileColumns._ID, column },
-                            ID_WHERE, new String[] { Integer.toString(id) }, null);
+                            ID_WHERE, new String[] { Integer.toString(id) }, null, null);
             if (c != null && c.moveToNext()) {
                 return c.getString(1);
             } else {
@@ -232,7 +232,7 @@
             Uri uri = Audio.Genres.getContentUriForAudioId(mVolumeName, id);
             c = mProvider.query(uri,
                             new String [] { Files.FileColumns._ID, Audio.GenresColumns.NAME },
-                            null, null, null);
+                            null, null, null, null);
             if (c != null && c.moveToNext()) {
                 return c.getString(1);
             } else {
@@ -254,7 +254,7 @@
             // for now we are only reading properties from the "objects" table
             c = mProvider.query(mUri,
                             new String [] { Files.FileColumns._ID, column },
-                            ID_WHERE, new String[] { Integer.toString(id) }, null);
+                            ID_WHERE, new String[] { Integer.toString(id) }, null, null);
             if (c != null && c.moveToNext()) {
                 return new Long(c.getLong(1));
             }
@@ -323,7 +323,7 @@
         try {
             // don't query if not necessary
             if (depth > 0 || handle == 0xFFFFFFFF || mColumns.length > 1) {
-                c = mProvider.query(mUri, mColumns, where, whereArgs, null);
+                c = mProvider.query(mUri, mColumns, where, whereArgs, null, null);
                 if (c == null) {
                     return new MtpPropertyList(0, MtpConstants.RESPONSE_INVALID_OBJECT_HANDLE);
                 }
diff --git a/media/jni/Android.mk b/media/jni/Android.mk
index d4b326c..23cc0e2 100644
--- a/media/jni/Android.mk
+++ b/media/jni/Android.mk
@@ -26,10 +26,13 @@
     libgui \
     libstagefright \
     libcamera_client \
-    libsqlite \
     libmtp \
     libusbhost \
-    libexif
+    libexif \
+    libstagefright_amrnb_common \
+
+LOCAL_STATIC_LIBRARIES := \
+    libstagefright_amrnbenc
 
 LOCAL_C_INCLUDES += \
     external/jhead \
diff --git a/media/jni/android_media_MediaPlayer.cpp b/media/jni/android_media_MediaPlayer.cpp
index 39fd9a9..8ff9dd3 100644
--- a/media/jni/android_media_MediaPlayer.cpp
+++ b/media/jni/android_media_MediaPlayer.cpp
@@ -479,7 +479,7 @@
         jniThrowException(env, "java/lang/IllegalStateException", NULL);
         return;
     }
-    process_media_player_call( env, thiz, mp->setAudioStreamType(streamtype) , NULL, NULL );
+    process_media_player_call( env, thiz, mp->setAudioStreamType((audio_stream_type_t) streamtype) , NULL, NULL );
 }
 
 static void
diff --git a/media/jni/soundpool/SoundPool.cpp b/media/jni/soundpool/SoundPool.cpp
index 14a5309..0d51def 100644
--- a/media/jni/soundpool/SoundPool.cpp
+++ b/media/jni/soundpool/SoundPool.cpp
@@ -39,7 +39,7 @@
 uint32_t kDefaultSampleRate = 44100;
 uint32_t kDefaultFrameCount = 1200;
 
-SoundPool::SoundPool(int maxChannels, int streamType, int srcQuality)
+SoundPool::SoundPool(int maxChannels, audio_stream_type_t streamType, int srcQuality)
 {
     ALOGV("SoundPool constructor: maxChannels=%d, streamType=%d, srcQuality=%d",
             maxChannels, streamType, srcQuality);
@@ -496,7 +496,7 @@
 {
     uint32_t sampleRate;
     int numChannels;
-    int format;
+    audio_format_t format;
     sp<IMemory> p;
     ALOGV("Start decode");
     if (mUrl) {
@@ -570,7 +570,7 @@
         // initialize track
         int afFrameCount;
         int afSampleRate;
-        int streamType = mSoundPool->streamType();
+        audio_stream_type_t streamType = mSoundPool->streamType();
         if (AudioSystem::getOutputFrameCount(&afFrameCount, streamType) != NO_ERROR) {
             afFrameCount = kDefaultFrameCount;
         }
diff --git a/media/jni/soundpool/SoundPool.h b/media/jni/soundpool/SoundPool.h
index 6010aac..6b11c28 100644
--- a/media/jni/soundpool/SoundPool.h
+++ b/media/jni/soundpool/SoundPool.h
@@ -56,7 +56,7 @@
     int sampleID() { return mSampleID; }
     int numChannels() { return mNumChannels; }
     int sampleRate() { return mSampleRate; }
-    int format() { return mFormat; }
+    audio_format_t format() { return mFormat; }
     size_t size() { return mSize; }
     int state() { return mState; }
     uint8_t* data() { return static_cast<uint8_t*>(mData->pointer()); }
@@ -65,7 +65,7 @@
     sp<IMemory> getIMemory() { return mData; }
 
     // hack
-    void init(int numChannels, int sampleRate, int format, size_t size, sp<IMemory> data ) {
+    void init(int numChannels, int sampleRate, audio_format_t format, size_t size, sp<IMemory> data ) {
         mNumChannels = numChannels; mSampleRate = sampleRate; mFormat = format; mSize = size; mData = data; }
 
 private:
@@ -77,7 +77,7 @@
     uint16_t            mSampleRate;
     uint8_t             mState : 3;
     uint8_t             mNumChannels : 2;
-    uint8_t             mFormat : 2;
+    audio_format_t      mFormat;
     int                 mFd;
     int64_t             mOffset;
     int64_t             mLength;
@@ -162,7 +162,7 @@
     friend class SoundPoolThread;
     friend class SoundChannel;
 public:
-    SoundPool(int maxChannels, int streamType, int srcQuality);
+    SoundPool(int maxChannels, audio_stream_type_t streamType, int srcQuality);
     ~SoundPool();
     int load(const char* url, int priority);
     int load(int fd, int64_t offset, int64_t length, int priority);
@@ -178,7 +178,7 @@
     void setPriority(int channelID, int priority);
     void setLoop(int channelID, int loop);
     void setRate(int channelID, float rate);
-    int streamType() const { return mStreamType; }
+    audio_stream_type_t streamType() const { return mStreamType; }
     int srcQuality() const { return mSrcQuality; }
 
     // called from SoundPoolThread
@@ -220,7 +220,7 @@
     List<SoundChannel*>     mStop;
     DefaultKeyedVector< int, sp<Sample> >   mSamples;
     int                     mMaxChannels;
-    int                     mStreamType;
+    audio_stream_type_t     mStreamType;
     int                     mSrcQuality;
     int                     mAllocated;
     int                     mNextSampleID;
diff --git a/media/jni/soundpool/android_media_SoundPool.cpp b/media/jni/soundpool/android_media_SoundPool.cpp
index fe1c20a..da3af9d 100644
--- a/media/jni/soundpool/android_media_SoundPool.cpp
+++ b/media/jni/soundpool/android_media_SoundPool.cpp
@@ -179,7 +179,7 @@
 android_media_SoundPool_native_setup(JNIEnv *env, jobject thiz, jobject weakRef, jint maxChannels, jint streamType, jint srcQuality)
 {
     ALOGV("android_media_SoundPool_native_setup");
-    SoundPool *ap = new SoundPool(maxChannels, streamType, srcQuality);
+    SoundPool *ap = new SoundPool(maxChannels, (audio_stream_type_t) streamType, srcQuality);
     if (ap == NULL) {
         return -1;
     }
diff --git a/media/libeffects/preprocessing/Android.mk b/media/libeffects/preprocessing/Android.mk
index 77d40b6..7f7c7e1 100755
--- a/media/libeffects/preprocessing/Android.mk
+++ b/media/libeffects/preprocessing/Android.mk
@@ -13,7 +13,7 @@
 LOCAL_C_INCLUDES += \
     external/webrtc/src \
     external/webrtc/src/modules/interface \
-    external/webrtc/src/modules/audio_processing/main/interface \
+    external/webrtc/src/modules/audio_processing/interface \
     system/media/audio_effects/include
 
 LOCAL_C_INCLUDES += $(call include-path-for, speex)
diff --git a/media/libeffects/preprocessing/PreProcessing.cpp b/media/libeffects/preprocessing/PreProcessing.cpp
index e988e06..9fd6764 100755
--- a/media/libeffects/preprocessing/PreProcessing.cpp
+++ b/media/libeffects/preprocessing/PreProcessing.cpp
@@ -24,8 +24,8 @@
 #include <audio_effects/effect_aec.h>
 #include <audio_effects/effect_agc.h>
 #include <audio_effects/effect_ns.h>
-#include "modules/interface/module_common_types.h"
-#include "modules/audio_processing/main/interface/audio_processing.h"
+#include <module_common_types.h>
+#include <audio_processing.h>
 #include "speex/speex_resampler.h"
 
 
@@ -220,8 +220,8 @@
 // Automatic Gain Control (AGC)
 //------------------------------------------------------------------------------
 
-static const int kAgcDefaultTargetLevel = 0;
-static const int kAgcDefaultCompGain = 90;
+static const int kAgcDefaultTargetLevel = 3;
+static const int kAgcDefaultCompGain = 9;
 static const bool kAgcDefaultLimiter = true;
 
 int  AgcInit (preproc_effect_t *effect)
diff --git a/media/libmedia/Android.mk b/media/libmedia/Android.mk
index 7af4a87..23670df 100644
--- a/media/libmedia/Android.mk
+++ b/media/libmedia/Android.mk
@@ -43,13 +43,12 @@
     IEffectClient.cpp \
     AudioEffect.cpp \
     Visualizer.cpp \
-    MemoryLeakTrackUtil.cpp \
-    fixedfft.cpp.arm
+    MemoryLeakTrackUtil.cpp
 
 LOCAL_SHARED_LIBRARIES := \
 	libui libcutils libutils libbinder libsonivox libicuuc libexpat \
         libcamera_client libstagefright_foundation \
-        libgui libdl
+        libgui libdl libaudioutils
 
 LOCAL_WHOLE_STATIC_LIBRARY := libmedia_helper
 
@@ -61,6 +60,7 @@
     $(TOP)/frameworks/base/include/media/stagefright/openmax \
     external/icu4c/common \
     external/expat/lib \
-    system/media/audio_effects/include
+    system/media/audio_effects/include \
+    system/media/audio_utils/include
 
 include $(BUILD_SHARED_LIBRARY)
diff --git a/media/libmedia/AudioEffect.cpp b/media/libmedia/AudioEffect.cpp
index 6639d06..bfa093d 100644
--- a/media/libmedia/AudioEffect.cpp
+++ b/media/libmedia/AudioEffect.cpp
@@ -342,7 +342,7 @@
 {
     ALOGW("IEffect died");
     mStatus = NO_INIT;
-    if (mCbf) {
+    if (mCbf != NULL) {
         status_t status = DEAD_OBJECT;
         mCbf(EVENT_ERROR, mUserData, &status);
     }
@@ -363,7 +363,7 @@
             mStatus = ALREADY_EXISTS;
         }
     }
-    if (mCbf) {
+    if (mCbf != NULL) {
         mCbf(EVENT_CONTROL_STATUS_CHANGED, mUserData, &controlGranted);
     }
 }
@@ -373,7 +373,7 @@
     ALOGV("enableStatusChanged %p enabled %d mCbf %p", this, enabled, mCbf);
     if (mStatus == ALREADY_EXISTS) {
         mEnabled = enabled;
-        if (mCbf) {
+        if (mCbf != NULL) {
             mCbf(EVENT_ENABLE_STATUS_CHANGED, mUserData, &enabled);
         }
     }
@@ -389,7 +389,7 @@
         return;
     }
 
-    if (mCbf && cmdCode == EFFECT_CMD_SET_PARAM) {
+    if (mCbf != NULL && cmdCode == EFFECT_CMD_SET_PARAM) {
         effect_param_t *cmd = (effect_param_t *)cmdData;
         cmd->status = *(int32_t *)replyData;
         mCbf(EVENT_PARAMETER_CHANGED, mUserData, cmd);
@@ -412,7 +412,8 @@
     return af->queryEffect(index, descriptor);
 }
 
-status_t AudioEffect::getEffectDescriptor(effect_uuid_t *uuid, effect_descriptor_t *descriptor)
+status_t AudioEffect::getEffectDescriptor(effect_uuid_t *uuid,
+        effect_descriptor_t *descriptor) /*const*/
 {
     const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger();
     if (af == 0) return PERMISSION_DENIED;
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp
index 2674070..b74b3e3 100644
--- a/media/libmedia/AudioRecord.cpp
+++ b/media/libmedia/AudioRecord.cpp
@@ -48,7 +48,7 @@
 status_t AudioRecord::getMinFrameCount(
         int* frameCount,
         uint32_t sampleRate,
-        int format,
+        audio_format_t format,
         int channelCount)
 {
     size_t size = 0;
@@ -84,9 +84,9 @@
 }
 
 AudioRecord::AudioRecord(
-        int inputSource,
+        audio_source_t inputSource,
         uint32_t sampleRate,
-        int format,
+        audio_format_t format,
         uint32_t channelMask,
         int frameCount,
         uint32_t flags,
@@ -119,9 +119,9 @@
 }
 
 status_t AudioRecord::set(
-        int inputSource,
+        audio_source_t inputSource,
         uint32_t sampleRate,
-        int format,
+        audio_format_t format,
         uint32_t channelMask,
         int frameCount,
         uint32_t flags,
@@ -148,7 +148,7 @@
         sampleRate = DEFAULT_SAMPLE_RATE;
     }
     // these below should probably come from the audioFlinger too...
-    if (format == 0) {
+    if (format == AUDIO_FORMAT_DEFAULT) {
         format = AUDIO_FORMAT_PCM_16_BIT;
     }
     // validate parameters
@@ -206,11 +206,8 @@
         return status;
     }
 
-    if (cbf != 0) {
+    if (cbf != NULL) {
         mClientRecordThread = new ClientRecordThread(*this, threadCanCallJava);
-        if (mClientRecordThread == 0) {
-            return NO_INIT;
-        }
     }
 
     mStatus = NO_ERROR;
@@ -231,7 +228,7 @@
     mMarkerReached = false;
     mNewPosition = 0;
     mUpdatePeriod = 0;
-    mInputSource = (uint8_t)inputSource;
+    mInputSource = inputSource;
     mFlags = flags;
     mInput = input;
     AudioSystem::acquireAudioSessionId(mSessionId);
@@ -251,7 +248,7 @@
     return mLatency;
 }
 
-int AudioRecord::format() const
+audio_format_t AudioRecord::format() const
 {
     return mFormat;
 }
@@ -266,7 +263,7 @@
     return mFrameCount;
 }
 
-int AudioRecord::frameSize() const
+size_t AudioRecord::frameSize() const
 {
     if (audio_is_linear_pcm(mFormat)) {
         return channelCount()*audio_bytes_per_sample(mFormat);
@@ -275,9 +272,9 @@
     }
 }
 
-int AudioRecord::inputSource() const
+audio_source_t AudioRecord::inputSource() const
 {
-    return (int)mInputSource;
+    return mInputSource;
 }
 
 // -------------------------------------------------------------------------
@@ -296,7 +293,6 @@
                 return WOULD_BLOCK;
             }
         }
-        t->mLock.lock();
      }
 
     AutoMutex lock(mLock);
@@ -337,10 +333,6 @@
         }
     }
 
-    if (t != 0) {
-        t->mLock.unlock();
-    }
-
     return ret;
 }
 
@@ -350,10 +342,6 @@
 
     ALOGV("stop");
 
-    if (t != 0) {
-        t->mLock.lock();
-    }
-
     AutoMutex lock(mLock);
     if (mActive == 1) {
         mActive = 0;
@@ -370,10 +358,6 @@
         }
     }
 
-    if (t != 0) {
-        t->mLock.unlock();
-    }
-
     return NO_ERROR;
 }
 
@@ -390,7 +374,7 @@
 
 status_t AudioRecord::setMarkerPosition(uint32_t marker)
 {
-    if (mCbf == 0) return INVALID_OPERATION;
+    if (mCbf == NULL) return INVALID_OPERATION;
 
     mMarkerPosition = marker;
     mMarkerReached = false;
@@ -400,7 +384,7 @@
 
 status_t AudioRecord::getMarkerPosition(uint32_t *marker)
 {
-    if (marker == 0) return BAD_VALUE;
+    if (marker == NULL) return BAD_VALUE;
 
     *marker = mMarkerPosition;
 
@@ -409,7 +393,7 @@
 
 status_t AudioRecord::setPositionUpdatePeriod(uint32_t updatePeriod)
 {
-    if (mCbf == 0) return INVALID_OPERATION;
+    if (mCbf == NULL) return INVALID_OPERATION;
 
     uint32_t curPosition;
     getPosition(&curPosition);
@@ -421,7 +405,7 @@
 
 status_t AudioRecord::getPositionUpdatePeriod(uint32_t *updatePeriod)
 {
-    if (updatePeriod == 0) return BAD_VALUE;
+    if (updatePeriod == NULL) return BAD_VALUE;
 
     *updatePeriod = mUpdatePeriod;
 
@@ -430,7 +414,7 @@
 
 status_t AudioRecord::getPosition(uint32_t *position)
 {
-    if (position == 0) return BAD_VALUE;
+    if (position == NULL) return BAD_VALUE;
 
     AutoMutex lock(mLock);
     *position = mCblk->user;
@@ -451,7 +435,7 @@
 // must be called with mLock held
 status_t AudioRecord::openRecord_l(
         uint32_t sampleRate,
-        uint32_t format,
+        audio_format_t format,
         uint32_t channelMask,
         int frameCount,
         uint32_t flags,
diff --git a/media/libmedia/AudioSystem.cpp b/media/libmedia/AudioSystem.cpp
index f7f129c..110a294 100644
--- a/media/libmedia/AudioSystem.cpp
+++ b/media/libmedia/AudioSystem.cpp
@@ -35,12 +35,13 @@
 sp<AudioSystem::AudioFlingerClient> AudioSystem::gAudioFlingerClient;
 audio_error_callback AudioSystem::gAudioErrorCallback = NULL;
 // Cached values
-DefaultKeyedVector<int, audio_io_handle_t> AudioSystem::gStreamOutputMap(0);
+
+DefaultKeyedVector<audio_stream_type_t, audio_io_handle_t> AudioSystem::gStreamOutputMap(0);
 DefaultKeyedVector<audio_io_handle_t, AudioSystem::OutputDescriptor *> AudioSystem::gOutputs(0);
 
-// Cached values for recording queries
+// Cached values for recording queries, all protected by gLock
 uint32_t AudioSystem::gPrevInSamplingRate = 16000;
-int AudioSystem::gPrevInFormat = AUDIO_FORMAT_PCM_16_BIT;
+audio_format_t AudioSystem::gPrevInFormat = AUDIO_FORMAT_PCM_16_BIT;
 int AudioSystem::gPrevInChannelCount = 1;
 size_t AudioSystem::gInBuffSize = 0;
 
@@ -49,7 +50,7 @@
 const sp<IAudioFlinger>& AudioSystem::get_audio_flinger()
 {
     Mutex::Autolock _l(gLock);
-    if (gAudioFlinger.get() == 0) {
+    if (gAudioFlinger == 0) {
         sp<IServiceManager> sm = defaultServiceManager();
         sp<IBinder> binder;
         do {
@@ -120,7 +121,7 @@
     return NO_ERROR;
 }
 
-status_t AudioSystem::setStreamVolume(int stream, float value, int output)
+status_t AudioSystem::setStreamVolume(audio_stream_type_t stream, float value, int output)
 {
     if (uint32_t(stream) >= AUDIO_STREAM_CNT) return BAD_VALUE;
     const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger();
@@ -129,7 +130,7 @@
     return NO_ERROR;
 }
 
-status_t AudioSystem::setStreamMute(int stream, bool mute)
+status_t AudioSystem::setStreamMute(audio_stream_type_t stream, bool mute)
 {
     if (uint32_t(stream) >= AUDIO_STREAM_CNT) return BAD_VALUE;
     const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger();
@@ -138,7 +139,7 @@
     return NO_ERROR;
 }
 
-status_t AudioSystem::getStreamVolume(int stream, float* volume, int output)
+status_t AudioSystem::getStreamVolume(audio_stream_type_t stream, float* volume, int output)
 {
     if (uint32_t(stream) >= AUDIO_STREAM_CNT) return BAD_VALUE;
     const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger();
@@ -147,7 +148,7 @@
     return NO_ERROR;
 }
 
-status_t AudioSystem::getStreamMute(int stream, bool* mute)
+status_t AudioSystem::getStreamMute(audio_stream_type_t stream, bool* mute)
 {
     if (uint32_t(stream) >= AUDIO_STREAM_CNT) return BAD_VALUE;
     const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger();
@@ -156,9 +157,9 @@
     return NO_ERROR;
 }
 
-status_t AudioSystem::setMode(int mode)
+status_t AudioSystem::setMode(audio_mode_t mode)
 {
-    if (mode >= AUDIO_MODE_CNT) return BAD_VALUE;
+    if (uint32_t(mode) >= AUDIO_MODE_CNT) return BAD_VALUE;
     const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger();
     if (af == 0) return PERMISSION_DENIED;
     return af->setMode(mode);
@@ -203,7 +204,12 @@
     return volume ? 100 - int(dBConvertInverse * log(volume) + 0.5) : 0;
 }
 
-status_t AudioSystem::getOutputSamplingRate(int* samplingRate, int streamType)
+// DEPRECATED
+status_t AudioSystem::getOutputSamplingRate(int* samplingRate, int streamType) {
+    return getOutputSamplingRate(samplingRate, (audio_stream_type_t)streamType);
+}
+
+status_t AudioSystem::getOutputSamplingRate(int* samplingRate, audio_stream_type_t streamType)
 {
     OutputDescriptor *outputDesc;
     audio_io_handle_t output;
@@ -212,14 +218,14 @@
         streamType = AUDIO_STREAM_MUSIC;
     }
 
-    output = getOutput((audio_stream_type_t)streamType);
+    output = getOutput(streamType);
     if (output == 0) {
         return PERMISSION_DENIED;
     }
 
     gLock.lock();
     outputDesc = AudioSystem::gOutputs.valueFor(output);
-    if (outputDesc == 0) {
+    if (outputDesc == NULL) {
         ALOGV("getOutputSamplingRate() no output descriptor for output %d in gOutputs", output);
         gLock.unlock();
         const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger();
@@ -236,7 +242,12 @@
     return NO_ERROR;
 }
 
-status_t AudioSystem::getOutputFrameCount(int* frameCount, int streamType)
+// DEPRECATED
+status_t AudioSystem::getOutputFrameCount(int* frameCount, int streamType) {
+    return getOutputFrameCount(frameCount, (audio_stream_type_t)streamType);
+}
+
+status_t AudioSystem::getOutputFrameCount(int* frameCount, audio_stream_type_t streamType)
 {
     OutputDescriptor *outputDesc;
     audio_io_handle_t output;
@@ -245,14 +256,14 @@
         streamType = AUDIO_STREAM_MUSIC;
     }
 
-    output = getOutput((audio_stream_type_t)streamType);
+    output = getOutput(streamType);
     if (output == 0) {
         return PERMISSION_DENIED;
     }
 
     gLock.lock();
     outputDesc = AudioSystem::gOutputs.valueFor(output);
-    if (outputDesc == 0) {
+    if (outputDesc == NULL) {
         gLock.unlock();
         const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger();
         if (af == 0) return PERMISSION_DENIED;
@@ -267,7 +278,7 @@
     return NO_ERROR;
 }
 
-status_t AudioSystem::getOutputLatency(uint32_t* latency, int streamType)
+status_t AudioSystem::getOutputLatency(uint32_t* latency, audio_stream_type_t streamType)
 {
     OutputDescriptor *outputDesc;
     audio_io_handle_t output;
@@ -276,14 +287,14 @@
         streamType = AUDIO_STREAM_MUSIC;
     }
 
-    output = getOutput((audio_stream_type_t)streamType);
+    output = getOutput(streamType);
     if (output == 0) {
         return PERMISSION_DENIED;
     }
 
     gLock.lock();
     outputDesc = AudioSystem::gOutputs.valueFor(output);
-    if (outputDesc == 0) {
+    if (outputDesc == NULL) {
         gLock.unlock();
         const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger();
         if (af == 0) return PERMISSION_DENIED;
@@ -298,25 +309,30 @@
     return NO_ERROR;
 }
 
-status_t AudioSystem::getInputBufferSize(uint32_t sampleRate, int format, int channelCount,
+status_t AudioSystem::getInputBufferSize(uint32_t sampleRate, audio_format_t format, int channelCount,
     size_t* buffSize)
 {
+    gLock.lock();
     // Do we have a stale gInBufferSize or are we requesting the input buffer size for new values
-    if ((gInBuffSize == 0) || (sampleRate != gPrevInSamplingRate) || (format != gPrevInFormat)
+    size_t inBuffSize = gInBuffSize;
+    if ((inBuffSize == 0) || (sampleRate != gPrevInSamplingRate) || (format != gPrevInFormat)
         || (channelCount != gPrevInChannelCount)) {
+        gLock.unlock();
+        const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger();
+        if (af == 0) {
+            return PERMISSION_DENIED;
+        }
+        inBuffSize = af->getInputBufferSize(sampleRate, format, channelCount);
+        gLock.lock();
         // save the request params
         gPrevInSamplingRate = sampleRate;
         gPrevInFormat = format;
         gPrevInChannelCount = channelCount;
 
-        gInBuffSize = 0;
-        const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger();
-        if (af == 0) {
-            return PERMISSION_DENIED;
-        }
-        gInBuffSize = af->getInputBufferSize(sampleRate, format, channelCount);
+        gInBuffSize = inBuffSize;
     }
-    *buffSize = gInBuffSize;
+    gLock.unlock();
+    *buffSize = inBuffSize;
 
     return NO_ERROR;
 }
@@ -328,7 +344,7 @@
     return af->setVoiceVolume(value);
 }
 
-status_t AudioSystem::getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, int stream)
+status_t AudioSystem::getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, audio_stream_type_t stream)
 {
     const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger();
     if (af == 0) return PERMISSION_DENIED;
@@ -337,7 +353,7 @@
         stream = AUDIO_STREAM_MUSIC;
     }
 
-    return af->getRenderPosition(halFrames, dspFrames, getOutput((audio_stream_type_t)stream));
+    return af->getRenderPosition(halFrames, dspFrames, getOutput(stream));
 }
 
 unsigned int AudioSystem::getInputFramesLost(audio_io_handle_t ioHandle) {
@@ -389,7 +405,7 @@
 void AudioSystem::AudioFlingerClient::ioConfigChanged(int event, int ioHandle, void *param2) {
     ALOGV("ioConfigChanged() event %d", event);
     OutputDescriptor *desc;
-    uint32_t stream;
+    audio_stream_type_t stream;
 
     if (ioHandle == 0) return;
 
@@ -397,8 +413,8 @@
 
     switch (event) {
     case STREAM_CONFIG_CHANGED:
-        if (param2 == 0) break;
-        stream = *(uint32_t *)param2;
+        if (param2 == NULL) break;
+        stream = *(audio_stream_type_t *)param2;
         ALOGV("ioConfigChanged() STREAM_CONFIG_CHANGED stream %d, output %d", stream, ioHandle);
         if (gStreamOutputMap.indexOfKey(stream) >= 0) {
             gStreamOutputMap.replaceValueFor(stream, ioHandle);
@@ -409,7 +425,7 @@
             ALOGV("ioConfigChanged() opening already existing output! %d", ioHandle);
             break;
         }
-        if (param2 == 0) break;
+        if (param2 == NULL) break;
         desc = (OutputDescriptor *)param2;
 
         OutputDescriptor *outputDesc =  new OutputDescriptor(*desc);
@@ -438,7 +454,7 @@
             ALOGW("ioConfigChanged() modifying unknow output! %d", ioHandle);
             break;
         }
-        if (param2 == 0) break;
+        if (param2 == NULL) break;
         desc = (OutputDescriptor *)param2;
 
         ALOGV("ioConfigChanged() new config for output %d samplingRate %d, format %d channels %d frameCount %d latency %d",
@@ -462,7 +478,7 @@
     gAudioErrorCallback = cb;
 }
 
-bool AudioSystem::routedToA2dpOutput(int streamType) {
+bool AudioSystem::routedToA2dpOutput(audio_stream_type_t streamType) {
     switch(streamType) {
     case AUDIO_STREAM_MUSIC:
     case AUDIO_STREAM_VOICE_CALL:
@@ -484,7 +500,7 @@
 const sp<IAudioPolicyService>& AudioSystem::get_audio_policy_service()
 {
     gLock.lock();
-    if (gAudioPolicyService.get() == 0) {
+    if (gAudioPolicyService == 0) {
         sp<IServiceManager> sm = defaultServiceManager();
         sp<IBinder> binder;
         do {
@@ -531,21 +547,15 @@
     return aps->getDeviceConnectionState(device, device_address);
 }
 
-status_t AudioSystem::setPhoneState(int state)
+status_t AudioSystem::setPhoneState(audio_mode_t state)
 {
+    if (uint32_t(state) >= AUDIO_MODE_CNT) return BAD_VALUE;
     const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service();
     if (aps == 0) return PERMISSION_DENIED;
 
     return aps->setPhoneState(state);
 }
 
-status_t AudioSystem::setRingerMode(uint32_t mode, uint32_t mask)
-{
-    const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service();
-    if (aps == 0) return PERMISSION_DENIED;
-    return aps->setRingerMode(mode, mask);
-}
-
 status_t AudioSystem::setForceUse(audio_policy_force_use_t usage, audio_policy_forced_cfg_t config)
 {
     const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service();
@@ -563,7 +573,7 @@
 
 audio_io_handle_t AudioSystem::getOutput(audio_stream_type_t stream,
                                     uint32_t samplingRate,
-                                    uint32_t format,
+                                    audio_format_t format,
                                     uint32_t channels,
                                     audio_policy_output_flags_t flags)
 {
@@ -621,9 +631,9 @@
     aps->releaseOutput(output);
 }
 
-audio_io_handle_t AudioSystem::getInput(int inputSource,
+audio_io_handle_t AudioSystem::getInput(audio_source_t inputSource,
                                     uint32_t samplingRate,
-                                    uint32_t format,
+                                    audio_format_t format,
                                     uint32_t channels,
                                     audio_in_acoustics_t acoustics,
                                     int sessionId)
@@ -663,18 +673,22 @@
     return aps->initStreamVolume(stream, indexMin, indexMax);
 }
 
-status_t AudioSystem::setStreamVolumeIndex(audio_stream_type_t stream, int index)
+status_t AudioSystem::setStreamVolumeIndex(audio_stream_type_t stream,
+                                           int index,
+                                           audio_devices_t device)
 {
     const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service();
     if (aps == 0) return PERMISSION_DENIED;
-    return aps->setStreamVolumeIndex(stream, index);
+    return aps->setStreamVolumeIndex(stream, index, device);
 }
 
-status_t AudioSystem::getStreamVolumeIndex(audio_stream_type_t stream, int *index)
+status_t AudioSystem::getStreamVolumeIndex(audio_stream_type_t stream,
+                                           int *index,
+                                           audio_devices_t device)
 {
     const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service();
     if (aps == 0) return PERMISSION_DENIED;
-    return aps->getStreamVolumeIndex(stream, index);
+    return aps->getStreamVolumeIndex(stream, index, device);
 }
 
 uint32_t AudioSystem::getStrategyForStream(audio_stream_type_t stream)
@@ -723,7 +737,7 @@
     return aps->setEffectEnabled(id, enabled);
 }
 
-status_t AudioSystem::isStreamActive(int stream, bool* state, uint32_t inPastMs)
+status_t AudioSystem::isStreamActive(audio_stream_type_t stream, bool* state, uint32_t inPastMs)
 {
     const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service();
     if (aps == 0) return PERMISSION_DENIED;
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp
index 191fbaf..087d7b2 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -43,13 +43,15 @@
 #include <system/audio.h>
 #include <system/audio_policy.h>
 
+#include <audio_utils/primitives.h>
+
 namespace android {
 // ---------------------------------------------------------------------------
 
 // static
 status_t AudioTrack::getMinFrameCount(
         int* frameCount,
-        int streamType,
+        audio_stream_type_t streamType,
         uint32_t sampleRate)
 {
     int afSampleRate;
@@ -83,9 +85,9 @@
 }
 
 AudioTrack::AudioTrack(
-        int streamType,
+        audio_stream_type_t streamType,
         uint32_t sampleRate,
-        int format,
+        audio_format_t format,
         int channelMask,
         int frameCount,
         uint32_t flags,
@@ -106,6 +108,25 @@
         uint32_t sampleRate,
         int format,
         int channelMask,
+        int frameCount,
+        uint32_t flags,
+        callback_t cbf,
+        void* user,
+        int notificationFrames,
+        int sessionId)
+    : mStatus(NO_INIT),
+      mPreviousPriority(ANDROID_PRIORITY_NORMAL), mPreviousSchedulingGroup(ANDROID_TGROUP_DEFAULT)
+{
+    mStatus = set((audio_stream_type_t)streamType, sampleRate, (audio_format_t)format, channelMask,
+            frameCount, flags, cbf, user, notificationFrames,
+            0, false, sessionId);
+}
+
+AudioTrack::AudioTrack(
+        audio_stream_type_t streamType,
+        uint32_t sampleRate,
+        audio_format_t format,
+        int channelMask,
         const sp<IMemory>& sharedBuffer,
         uint32_t flags,
         callback_t cbf,
@@ -140,9 +161,9 @@
 }
 
 status_t AudioTrack::set(
-        int streamType,
+        audio_stream_type_t streamType,
         uint32_t sampleRate,
-        int format,
+        audio_format_t format,
         int channelMask,
         int frameCount,
         uint32_t flags,
@@ -179,7 +200,7 @@
         sampleRate = afSampleRate;
     }
     // these below should probably come from the audioFlinger too...
-    if (format == 0) {
+    if (format == AUDIO_FORMAT_DEFAULT) {
         format = AUDIO_FORMAT_PCM_16_BIT;
     }
     if (channelMask == 0) {
@@ -204,8 +225,8 @@
     uint32_t channelCount = popcount(channelMask);
 
     audio_io_handle_t output = AudioSystem::getOutput(
-                                    (audio_stream_type_t)streamType,
-                                    sampleRate,format, channelMask,
+                                    streamType,
+                                    sampleRate, format, channelMask,
                                     (audio_policy_output_flags_t)flags);
 
     if (output == 0) {
@@ -215,7 +236,7 @@
 
     mVolume[LEFT] = 1.0f;
     mVolume[RIGHT] = 1.0f;
-    mSendLevel = 0;
+    mSendLevel = 0.0f;
     mFrameCount = frameCount;
     mNotificationFramesReq = notificationFrames;
     mSessionId = sessionId;
@@ -224,7 +245,7 @@
     // create the IAudioTrack
     status_t status = createTrack_l(streamType,
                                   sampleRate,
-                                  (uint32_t)format,
+                                  format,
                                   (uint32_t)channelMask,
                                   frameCount,
                                   flags,
@@ -236,18 +257,14 @@
         return status;
     }
 
-    if (cbf != 0) {
+    if (cbf != NULL) {
         mAudioTrackThread = new AudioTrackThread(*this, threadCanCallJava);
-        if (mAudioTrackThread == 0) {
-          ALOGE("Could not create callback thread");
-          return NO_INIT;
-        }
     }
 
     mStatus = NO_ERROR;
 
     mStreamType = streamType;
-    mFormat = (uint32_t)format;
+    mFormat = format;
     mChannelMask = (uint32_t)channelMask;
     mChannelCount = channelCount;
     mSharedBuffer = sharedBuffer;
@@ -279,12 +296,12 @@
     return mLatency;
 }
 
-int AudioTrack::streamType() const
+audio_stream_type_t AudioTrack::streamType() const
 {
     return mStreamType;
 }
 
-int AudioTrack::format() const
+audio_format_t AudioTrack::format() const
 {
     return mFormat;
 }
@@ -299,7 +316,7 @@
     return mCblk->frameCount;
 }
 
-int AudioTrack::frameSize() const
+size_t AudioTrack::frameSize() const
 {
     if (audio_is_linear_pcm(mFormat)) {
         return channelCount()*audio_bytes_per_sample(mFormat);
@@ -328,7 +345,6 @@
                 return;
             }
         }
-        t->mLock.lock();
      }
 
     AutoMutex lock(mLock);
@@ -379,9 +395,6 @@
         }
     }
 
-    if (t != 0) {
-        t->mLock.unlock();
-    }
 }
 
 void AudioTrack::stop()
@@ -389,9 +402,6 @@
     sp<AudioTrackThread> t = mAudioTrackThread;
 
     ALOGV("stop %p", this);
-    if (t != 0) {
-        t->mLock.lock();
-    }
 
     AutoMutex lock(mLock);
     if (mActive) {
@@ -417,9 +427,6 @@
         }
     }
 
-    if (t != 0) {
-        t->mLock.unlock();
-    }
 }
 
 bool AudioTrack::stopped() const
@@ -484,13 +491,12 @@
     mVolume[LEFT] = left;
     mVolume[RIGHT] = right;
 
-    // write must be atomic
-    mCblk->volumeLR = (uint32_t(uint16_t(right * 0x1000)) << 16) | uint16_t(left * 0x1000);
+    mCblk->setVolumeLR((uint32_t(uint16_t(right * 0x1000)) << 16) | uint16_t(left * 0x1000));
 
     return NO_ERROR;
 }
 
-void AudioTrack::getVolume(float* left, float* right)
+void AudioTrack::getVolume(float* left, float* right) const
 {
     if (left != NULL) {
         *left  = mVolume[LEFT];
@@ -503,19 +509,19 @@
 status_t AudioTrack::setAuxEffectSendLevel(float level)
 {
     ALOGV("setAuxEffectSendLevel(%f)", level);
-    if (level > 1.0f) {
+    if (level < 0.0f || level > 1.0f) {
         return BAD_VALUE;
     }
     AutoMutex lock(mLock);
 
     mSendLevel = level;
 
-    mCblk->sendLevel = uint16_t(level * 0x1000);
+    mCblk->setSendLevel(level);
 
     return NO_ERROR;
 }
 
-void AudioTrack::getAuxEffectSendLevel(float* level)
+void AudioTrack::getAuxEffectSendLevel(float* level) const
 {
     if (level != NULL) {
         *level  = mSendLevel;
@@ -537,7 +543,7 @@
     return NO_ERROR;
 }
 
-uint32_t AudioTrack::getSampleRate()
+uint32_t AudioTrack::getSampleRate() const
 {
     AutoMutex lock(mLock);
     return mCblk->sampleRate;
@@ -585,16 +591,16 @@
     return NO_ERROR;
 }
 
-status_t AudioTrack::getLoop(uint32_t *loopStart, uint32_t *loopEnd, int *loopCount)
+status_t AudioTrack::getLoop(uint32_t *loopStart, uint32_t *loopEnd, int *loopCount) const
 {
     AutoMutex lock(mLock);
-    if (loopStart != 0) {
+    if (loopStart != NULL) {
         *loopStart = mCblk->loopStart;
     }
-    if (loopEnd != 0) {
+    if (loopEnd != NULL) {
         *loopEnd = mCblk->loopEnd;
     }
-    if (loopCount != 0) {
+    if (loopCount != NULL) {
         if (mCblk->loopCount < 0) {
             *loopCount = -1;
         } else {
@@ -607,7 +613,7 @@
 
 status_t AudioTrack::setMarkerPosition(uint32_t marker)
 {
-    if (mCbf == 0) return INVALID_OPERATION;
+    if (mCbf == NULL) return INVALID_OPERATION;
 
     mMarkerPosition = marker;
     mMarkerReached = false;
@@ -615,9 +621,9 @@
     return NO_ERROR;
 }
 
-status_t AudioTrack::getMarkerPosition(uint32_t *marker)
+status_t AudioTrack::getMarkerPosition(uint32_t *marker) const
 {
-    if (marker == 0) return BAD_VALUE;
+    if (marker == NULL) return BAD_VALUE;
 
     *marker = mMarkerPosition;
 
@@ -626,7 +632,7 @@
 
 status_t AudioTrack::setPositionUpdatePeriod(uint32_t updatePeriod)
 {
-    if (mCbf == 0) return INVALID_OPERATION;
+    if (mCbf == NULL) return INVALID_OPERATION;
 
     uint32_t curPosition;
     getPosition(&curPosition);
@@ -636,9 +642,9 @@
     return NO_ERROR;
 }
 
-status_t AudioTrack::getPositionUpdatePeriod(uint32_t *updatePeriod)
+status_t AudioTrack::getPositionUpdatePeriod(uint32_t *updatePeriod) const
 {
-    if (updatePeriod == 0) return BAD_VALUE;
+    if (updatePeriod == NULL) return BAD_VALUE;
 
     *updatePeriod = mUpdatePeriod;
 
@@ -663,7 +669,7 @@
 
 status_t AudioTrack::getPosition(uint32_t *position)
 {
-    if (position == 0) return BAD_VALUE;
+    if (position == NULL) return BAD_VALUE;
     AutoMutex lock(mLock);
     *position = mFlushed ? 0 : mCblk->server;
 
@@ -692,11 +698,11 @@
 // must be called with mLock held
 audio_io_handle_t AudioTrack::getOutput_l()
 {
-    return AudioSystem::getOutput((audio_stream_type_t)mStreamType,
+    return AudioSystem::getOutput(mStreamType,
             mCblk->sampleRate, mFormat, mChannelMask, (audio_policy_output_flags_t)mFlags);
 }
 
-int AudioTrack::getSessionId()
+int AudioTrack::getSessionId() const
 {
     return mSessionId;
 }
@@ -715,9 +721,9 @@
 
 // must be called with mLock held
 status_t AudioTrack::createTrack_l(
-        int streamType,
+        audio_stream_type_t streamType,
         uint32_t sampleRate,
-        uint32_t format,
+        audio_format_t format,
         uint32_t channelMask,
         int frameCount,
         uint32_t flags,
@@ -821,8 +827,8 @@
         mCblk->stepUser(mCblk->frameCount);
     }
 
-    mCblk->volumeLR = (uint32_t(uint16_t(mVolume[RIGHT] * 0x1000)) << 16) | uint16_t(mVolume[LEFT] * 0x1000);
-    mCblk->sendLevel = uint16_t(mSendLevel * 0x1000);
+    mCblk->setVolumeLR((uint32_t(uint16_t(mVolume[RIGHT] * 0x1000)) << 16) | uint16_t(mVolume[LEFT] * 0x1000));
+    mCblk->setSendLevel(mSendLevel);
     mAudioTrack->attachAuxEffect(mAuxEffectId);
     mCblk->bufferTimeoutMs = MAX_STARTUP_TIMEOUT_MS;
     mCblk->waitTimeMs = 0;
@@ -983,7 +989,7 @@
     ssize_t written = 0;
     const int8_t *src = (const int8_t *)buffer;
     Buffer audioBuffer;
-    size_t frameSz = (size_t)frameSize();
+    size_t frameSz = frameSize();
 
     do {
         audioBuffer.frameCount = userSize/frameSz;
@@ -1003,12 +1009,7 @@
         if (mFormat == AUDIO_FORMAT_PCM_8_BIT && !(mFlags & AUDIO_POLICY_OUTPUT_FLAG_DIRECT)) {
             // Divide capacity by 2 to take expansion into account
             toWrite = audioBuffer.size>>1;
-            // 8 to 16 bit conversion
-            int count = toWrite;
-            int16_t *dst = (int16_t *)(audioBuffer.i8);
-            while(count--) {
-                *dst++ = (int16_t)(*src++^0x80) << 8;
-            }
+            memcpy_to_i16_from_u8(audioBuffer.i16, (const uint8_t *) src, toWrite);
         } else {
             toWrite = audioBuffer.size;
             memcpy(audioBuffer.i8, src, toWrite);
@@ -1129,19 +1130,14 @@
         if (writtenSize > reqSize) writtenSize = reqSize;
 
         if (mFormat == AUDIO_FORMAT_PCM_8_BIT && !(mFlags & AUDIO_POLICY_OUTPUT_FLAG_DIRECT)) {
-            // 8 to 16 bit conversion
-            const int8_t *src = audioBuffer.i8 + writtenSize-1;
-            int count = writtenSize;
-            int16_t *dst = audioBuffer.i16 + writtenSize-1;
-            while(count--) {
-                *dst-- = (int16_t)(*src--^0x80) << 8;
-            }
+            // 8 to 16 bit conversion, note that source and destination are the same address
+            memcpy_to_i16_from_u8(audioBuffer.i16, (const uint8_t *) audioBuffer.i8, writtenSize);
             writtenSize <<= 1;
         }
 
         audioBuffer.size = writtenSize;
         // NOTE: mCblk->frameSize is not equal to AudioTrack::frameSize() for
-        // 8 bit PCM data: in this case,  mCblk->frameSize is based on a sampel size of
+        // 8 bit PCM data: in this case,  mCblk->frameSize is based on a sample size of
         // 16 bit.
         audioBuffer.frameCount = writtenSize/mCblk->frameSize;
 
@@ -1313,9 +1309,9 @@
 
 audio_track_cblk_t::audio_track_cblk_t()
     : lock(Mutex::SHARED), cv(Condition::SHARED), user(0), server(0),
-    userBase(0), serverBase(0), buffers(0), frameCount(0),
-    loopStart(UINT_MAX), loopEnd(UINT_MAX), loopCount(0), volumeLR(0),
-    sendLevel(0), flags(0)
+    userBase(0), serverBase(0), buffers(NULL), frameCount(0),
+    loopStart(UINT_MAX), loopEnd(UINT_MAX), loopCount(0), mVolumeLR(0x10001000),
+    mSendLevel(0), flags(0)
 {
 }
 
diff --git a/media/libmedia/IAudioFlinger.cpp b/media/libmedia/IAudioFlinger.cpp
index abd491f..29b61df 100644
--- a/media/libmedia/IAudioFlinger.cpp
+++ b/media/libmedia/IAudioFlinger.cpp
@@ -82,9 +82,9 @@
 
     virtual sp<IAudioTrack> createTrack(
                                 pid_t pid,
-                                int streamType,
+                                audio_stream_type_t streamType,
                                 uint32_t sampleRate,
-                                uint32_t format,
+                                audio_format_t format,
                                 uint32_t channelMask,
                                 int frameCount,
                                 uint32_t flags,
@@ -97,7 +97,7 @@
         sp<IAudioTrack> track;
         data.writeInterfaceToken(IAudioFlinger::getInterfaceDescriptor());
         data.writeInt32(pid);
-        data.writeInt32(streamType);
+        data.writeInt32((int32_t) streamType);
         data.writeInt32(sampleRate);
         data.writeInt32(format);
         data.writeInt32(channelMask);
@@ -131,7 +131,7 @@
                                 pid_t pid,
                                 int input,
                                 uint32_t sampleRate,
-                                uint32_t format,
+                                audio_format_t format,
                                 uint32_t channelMask,
                                 int frameCount,
                                 uint32_t flags,
@@ -188,13 +188,13 @@
         return reply.readInt32();
     }
 
-    virtual uint32_t format(int output) const
+    virtual audio_format_t format(int output) const
     {
         Parcel data, reply;
         data.writeInterfaceToken(IAudioFlinger::getInterfaceDescriptor());
         data.writeInt32(output);
         remote()->transact(FORMAT, data, &reply);
-        return reply.readInt32();
+        return (audio_format_t) reply.readInt32();
     }
 
     virtual size_t frameCount(int output) const
@@ -249,47 +249,47 @@
         return reply.readInt32();
     }
 
-    virtual status_t setStreamVolume(int stream, float value, int output)
+    virtual status_t setStreamVolume(audio_stream_type_t stream, float value, int output)
     {
         Parcel data, reply;
         data.writeInterfaceToken(IAudioFlinger::getInterfaceDescriptor());
-        data.writeInt32(stream);
+        data.writeInt32((int32_t) stream);
         data.writeFloat(value);
         data.writeInt32(output);
         remote()->transact(SET_STREAM_VOLUME, data, &reply);
         return reply.readInt32();
     }
 
-    virtual status_t setStreamMute(int stream, bool muted)
+    virtual status_t setStreamMute(audio_stream_type_t stream, bool muted)
     {
         Parcel data, reply;
         data.writeInterfaceToken(IAudioFlinger::getInterfaceDescriptor());
-        data.writeInt32(stream);
+        data.writeInt32((int32_t) stream);
         data.writeInt32(muted);
         remote()->transact(SET_STREAM_MUTE, data, &reply);
         return reply.readInt32();
     }
 
-    virtual float streamVolume(int stream, int output) const
+    virtual float streamVolume(audio_stream_type_t stream, int output) const
     {
         Parcel data, reply;
         data.writeInterfaceToken(IAudioFlinger::getInterfaceDescriptor());
-        data.writeInt32(stream);
+        data.writeInt32((int32_t) stream);
         data.writeInt32(output);
         remote()->transact(STREAM_VOLUME, data, &reply);
         return reply.readFloat();
     }
 
-    virtual bool streamMute(int stream) const
+    virtual bool streamMute(audio_stream_type_t stream) const
     {
         Parcel data, reply;
         data.writeInterfaceToken(IAudioFlinger::getInterfaceDescriptor());
-        data.writeInt32(stream);
+        data.writeInt32((int32_t) stream);
         remote()->transact(STREAM_MUTE, data, &reply);
         return reply.readInt32();
     }
 
-    virtual status_t setMode(int mode)
+    virtual status_t setMode(audio_mode_t mode)
     {
         Parcel data, reply;
         data.writeInterfaceToken(IAudioFlinger::getInterfaceDescriptor());
@@ -325,7 +325,7 @@
         return reply.readInt32();
     }
 
-    virtual String8 getParameters(int ioHandle, const String8& keys)
+    virtual String8 getParameters(int ioHandle, const String8& keys) const
     {
         Parcel data, reply;
         data.writeInterfaceToken(IAudioFlinger::getInterfaceDescriptor());
@@ -343,7 +343,7 @@
         remote()->transact(REGISTER_CLIENT, data, &reply);
     }
 
-    virtual size_t getInputBufferSize(uint32_t sampleRate, int format, int channelCount)
+    virtual size_t getInputBufferSize(uint32_t sampleRate, audio_format_t format, int channelCount) const
     {
         Parcel data, reply;
         data.writeInterfaceToken(IAudioFlinger::getInterfaceDescriptor());
@@ -356,7 +356,7 @@
 
     virtual int openOutput(uint32_t *pDevices,
                             uint32_t *pSamplingRate,
-                            uint32_t *pFormat,
+                            audio_format_t *pFormat,
                             uint32_t *pChannels,
                             uint32_t *pLatencyMs,
                             uint32_t flags)
@@ -364,7 +364,7 @@
         Parcel data, reply;
         uint32_t devices = pDevices ? *pDevices : 0;
         uint32_t samplingRate = pSamplingRate ? *pSamplingRate : 0;
-        uint32_t format = pFormat ? *pFormat : 0;
+        audio_format_t format = pFormat ? *pFormat : AUDIO_FORMAT_DEFAULT;
         uint32_t channels = pChannels ? *pChannels : 0;
         uint32_t latency = pLatencyMs ? *pLatencyMs : 0;
 
@@ -382,7 +382,7 @@
         if (pDevices) *pDevices = devices;
         samplingRate = reply.readInt32();
         if (pSamplingRate) *pSamplingRate = samplingRate;
-        format = reply.readInt32();
+        format = (audio_format_t) reply.readInt32();
         if (pFormat) *pFormat = format;
         channels = reply.readInt32();
         if (pChannels) *pChannels = channels;
@@ -430,14 +430,14 @@
 
     virtual int openInput(uint32_t *pDevices,
                             uint32_t *pSamplingRate,
-                            uint32_t *pFormat,
+                            audio_format_t *pFormat,
                             uint32_t *pChannels,
-                            uint32_t acoustics)
+                            audio_in_acoustics_t acoustics)
     {
         Parcel data, reply;
         uint32_t devices = pDevices ? *pDevices : 0;
         uint32_t samplingRate = pSamplingRate ? *pSamplingRate : 0;
-        uint32_t format = pFormat ? *pFormat : 0;
+        audio_format_t format = pFormat ? *pFormat : AUDIO_FORMAT_DEFAULT;
         uint32_t channels = pChannels ? *pChannels : 0;
 
         data.writeInterfaceToken(IAudioFlinger::getInterfaceDescriptor());
@@ -445,14 +445,14 @@
         data.writeInt32(samplingRate);
         data.writeInt32(format);
         data.writeInt32(channels);
-        data.writeInt32(acoustics);
+        data.writeInt32((int32_t) acoustics);
         remote()->transact(OPEN_INPUT, data, &reply);
         int input = reply.readInt32();
         devices = reply.readInt32();
         if (pDevices) *pDevices = devices;
         samplingRate = reply.readInt32();
         if (pSamplingRate) *pSamplingRate = samplingRate;
-        format = reply.readInt32();
+        format = (audio_format_t) reply.readInt32();
         if (pFormat) *pFormat = format;
         channels = reply.readInt32();
         if (pChannels) *pChannels = channels;
@@ -468,11 +468,11 @@
         return reply.readInt32();
     }
 
-    virtual status_t setStreamOutput(uint32_t stream, int output)
+    virtual status_t setStreamOutput(audio_stream_type_t stream, int output)
     {
         Parcel data, reply;
         data.writeInterfaceToken(IAudioFlinger::getInterfaceDescriptor());
-        data.writeInt32(stream);
+        data.writeInt32((int32_t) stream);
         data.writeInt32(output);
         remote()->transact(SET_STREAM_OUTPUT, data, &reply);
         return reply.readInt32();
@@ -487,7 +487,7 @@
         return reply.readInt32();
     }
 
-    virtual status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, int output)
+    virtual status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, int output) const
     {
         Parcel data, reply;
         data.writeInterfaceToken(IAudioFlinger::getInterfaceDescriptor());
@@ -507,7 +507,7 @@
         return status;
     }
 
-    virtual unsigned int getInputFramesLost(int ioHandle)
+    virtual unsigned int getInputFramesLost(int ioHandle) const
     {
         Parcel data, reply;
         data.writeInterfaceToken(IAudioFlinger::getInterfaceDescriptor());
@@ -544,7 +544,7 @@
         remote()->transact(RELEASE_AUDIO_SESSION_ID, data, &reply);
     }
 
-    virtual status_t queryNumberEffects(uint32_t *numEffects)
+    virtual status_t queryNumberEffects(uint32_t *numEffects) const
     {
         Parcel data, reply;
         data.writeInterfaceToken(IAudioFlinger::getInterfaceDescriptor());
@@ -562,7 +562,7 @@
         return NO_ERROR;
     }
 
-    virtual status_t queryEffect(uint32_t index, effect_descriptor_t *pDescriptor)
+    virtual status_t queryEffect(uint32_t index, effect_descriptor_t *pDescriptor) const
     {
         if (pDescriptor == NULL) {
             return BAD_VALUE;
@@ -582,7 +582,8 @@
         return NO_ERROR;
     }
 
-    virtual status_t getEffectDescriptor(effect_uuid_t *pUuid, effect_descriptor_t *pDescriptor)
+    virtual status_t getEffectDescriptor(effect_uuid_t *pUuid,
+            effect_descriptor_t *pDescriptor) const
     {
         if (pUuid == NULL || pDescriptor == NULL) {
             return BAD_VALUE;
@@ -640,7 +641,7 @@
                 *id = tmp;
             }
             tmp = reply.readInt32();
-            if (enabled) {
+            if (enabled != NULL) {
                 *enabled = tmp;
             }
             effect = interface_cast<IEffect>(reply.readStrongBinder());
@@ -678,7 +679,7 @@
             pid_t pid = data.readInt32();
             int streamType = data.readInt32();
             uint32_t sampleRate = data.readInt32();
-            int format = data.readInt32();
+            audio_format_t format = (audio_format_t) data.readInt32();
             int channelCount = data.readInt32();
             size_t bufferCount = data.readInt32();
             uint32_t flags = data.readInt32();
@@ -687,7 +688,7 @@
             int sessionId = data.readInt32();
             status_t status;
             sp<IAudioTrack> track = createTrack(pid,
-                    streamType, sampleRate, format,
+                    (audio_stream_type_t) streamType, sampleRate, format,
                     channelCount, bufferCount, flags, buffer, output, &sessionId, &status);
             reply->writeInt32(sessionId);
             reply->writeInt32(status);
@@ -699,7 +700,7 @@
             pid_t pid = data.readInt32();
             int input = data.readInt32();
             uint32_t sampleRate = data.readInt32();
-            int format = data.readInt32();
+            audio_format_t format = (audio_format_t) data.readInt32();
             int channelCount = data.readInt32();
             size_t bufferCount = data.readInt32();
             uint32_t flags = data.readInt32();
@@ -762,31 +763,31 @@
             int stream = data.readInt32();
             float volume = data.readFloat();
             int output = data.readInt32();
-            reply->writeInt32( setStreamVolume(stream, volume, output) );
+            reply->writeInt32( setStreamVolume((audio_stream_type_t) stream, volume, output) );
             return NO_ERROR;
         } break;
         case SET_STREAM_MUTE: {
             CHECK_INTERFACE(IAudioFlinger, data, reply);
             int stream = data.readInt32();
-            reply->writeInt32( setStreamMute(stream, data.readInt32()) );
+            reply->writeInt32( setStreamMute((audio_stream_type_t) stream, data.readInt32()) );
             return NO_ERROR;
         } break;
         case STREAM_VOLUME: {
             CHECK_INTERFACE(IAudioFlinger, data, reply);
             int stream = data.readInt32();
             int output = data.readInt32();
-            reply->writeFloat( streamVolume(stream, output) );
+            reply->writeFloat( streamVolume((audio_stream_type_t) stream, output) );
             return NO_ERROR;
         } break;
         case STREAM_MUTE: {
             CHECK_INTERFACE(IAudioFlinger, data, reply);
             int stream = data.readInt32();
-            reply->writeInt32( streamMute(stream) );
+            reply->writeInt32( streamMute((audio_stream_type_t) stream) );
             return NO_ERROR;
         } break;
         case SET_MODE: {
             CHECK_INTERFACE(IAudioFlinger, data, reply);
-            int mode = data.readInt32();
+            audio_mode_t mode = (audio_mode_t) data.readInt32();
             reply->writeInt32( setMode(mode) );
             return NO_ERROR;
         } break;
@@ -825,7 +826,7 @@
         case GET_INPUTBUFFERSIZE: {
             CHECK_INTERFACE(IAudioFlinger, data, reply);
             uint32_t sampleRate = data.readInt32();
-            int format = data.readInt32();
+            audio_format_t format = (audio_format_t) data.readInt32();
             int channelCount = data.readInt32();
             reply->writeInt32( getInputBufferSize(sampleRate, format, channelCount) );
             return NO_ERROR;
@@ -834,7 +835,7 @@
             CHECK_INTERFACE(IAudioFlinger, data, reply);
             uint32_t devices = data.readInt32();
             uint32_t samplingRate = data.readInt32();
-            uint32_t format = data.readInt32();
+            audio_format_t format = (audio_format_t) data.readInt32();
             uint32_t channels = data.readInt32();
             uint32_t latency = data.readInt32();
             uint32_t flags = data.readInt32();
@@ -879,15 +880,15 @@
             CHECK_INTERFACE(IAudioFlinger, data, reply);
             uint32_t devices = data.readInt32();
             uint32_t samplingRate = data.readInt32();
-            uint32_t format = data.readInt32();
+            audio_format_t format = (audio_format_t) data.readInt32();
             uint32_t channels = data.readInt32();
-            uint32_t acoutics = data.readInt32();
+            audio_in_acoustics_t acoustics = (audio_in_acoustics_t) data.readInt32();
 
             int input = openInput(&devices,
                                      &samplingRate,
                                      &format,
                                      &channels,
-                                     acoutics);
+                                     acoustics);
             reply->writeInt32(input);
             reply->writeInt32(devices);
             reply->writeInt32(samplingRate);
@@ -904,7 +905,7 @@
             CHECK_INTERFACE(IAudioFlinger, data, reply);
             uint32_t stream = data.readInt32();
             int output = data.readInt32();
-            reply->writeInt32(setStreamOutput(stream, output));
+            reply->writeInt32(setStreamOutput((audio_stream_type_t) stream, output));
             return NO_ERROR;
         } break;
         case SET_VOICE_VOLUME: {
diff --git a/media/libmedia/IAudioFlingerClient.cpp b/media/libmedia/IAudioFlingerClient.cpp
index 5a3f250..9458bc0 100644
--- a/media/libmedia/IAudioFlingerClient.cpp
+++ b/media/libmedia/IAudioFlingerClient.cpp
@@ -73,7 +73,7 @@
             CHECK_INTERFACE(IAudioFlingerClient, data, reply);
             int event = data.readInt32();
             int ioHandle = data.readInt32();
-            void *param2 = 0;
+            void *param2 = NULL;
             AudioSystem::OutputDescriptor desc;
             uint32_t stream;
             if (event == AudioSystem::STREAM_CONFIG_CHANGED) {
diff --git a/media/libmedia/IAudioPolicyService.cpp b/media/libmedia/IAudioPolicyService.cpp
index 50b4855..99385aa4 100644
--- a/media/libmedia/IAudioPolicyService.cpp
+++ b/media/libmedia/IAudioPolicyService.cpp
@@ -33,7 +33,7 @@
     SET_DEVICE_CONNECTION_STATE = IBinder::FIRST_CALL_TRANSACTION,
     GET_DEVICE_CONNECTION_STATE,
     SET_PHONE_STATE,
-    SET_RINGER_MODE,
+    SET_RINGER_MODE,    // reserved, no longer used
     SET_FORCE_USE,
     GET_FORCE_USE,
     GET_OUTPUT,
@@ -91,7 +91,7 @@
         return static_cast <audio_policy_dev_state_t>(reply.readInt32());
     }
 
-    virtual status_t setPhoneState(int state)
+    virtual status_t setPhoneState(audio_mode_t state)
     {
         Parcel data, reply;
         data.writeInterfaceToken(IAudioPolicyService::getInterfaceDescriptor());
@@ -100,16 +100,6 @@
         return static_cast <status_t> (reply.readInt32());
     }
 
-    virtual status_t setRingerMode(uint32_t mode, uint32_t mask)
-    {
-        Parcel data, reply;
-        data.writeInterfaceToken(IAudioPolicyService::getInterfaceDescriptor());
-        data.writeInt32(mode);
-        data.writeInt32(mask);
-        remote()->transact(SET_RINGER_MODE, data, &reply);
-        return static_cast <status_t> (reply.readInt32());
-    }
-
     virtual status_t setForceUse(audio_policy_force_use_t usage, audio_policy_forced_cfg_t config)
     {
         Parcel data, reply;
@@ -132,7 +122,7 @@
     virtual audio_io_handle_t getOutput(
                                         audio_stream_type_t stream,
                                         uint32_t samplingRate,
-                                        uint32_t format,
+                                        audio_format_t format,
                                         uint32_t channels,
                                         audio_policy_output_flags_t flags)
     {
@@ -154,7 +144,7 @@
         Parcel data, reply;
         data.writeInterfaceToken(IAudioPolicyService::getInterfaceDescriptor());
         data.writeInt32(output);
-        data.writeInt32(stream);
+        data.writeInt32((int32_t) stream);
         data.writeInt32(session);
         remote()->transact(START_OUTPUT, data, &reply);
         return static_cast <status_t> (reply.readInt32());
@@ -167,7 +157,7 @@
         Parcel data, reply;
         data.writeInterfaceToken(IAudioPolicyService::getInterfaceDescriptor());
         data.writeInt32(output);
-        data.writeInt32(stream);
+        data.writeInt32((int32_t) stream);
         data.writeInt32(session);
         remote()->transact(STOP_OUTPUT, data, &reply);
         return static_cast <status_t> (reply.readInt32());
@@ -182,16 +172,16 @@
     }
 
     virtual audio_io_handle_t getInput(
-                                    int inputSource,
+                                    audio_source_t inputSource,
                                     uint32_t samplingRate,
-                                    uint32_t format,
+                                    audio_format_t format,
                                     uint32_t channels,
                                     audio_in_acoustics_t acoustics,
                                     int audioSession)
     {
         Parcel data, reply;
         data.writeInterfaceToken(IAudioPolicyService::getInterfaceDescriptor());
-        data.writeInt32(inputSource);
+        data.writeInt32((int32_t) inputSource);
         data.writeInt32(samplingRate);
         data.writeInt32(static_cast <uint32_t>(format));
         data.writeInt32(channels);
@@ -240,21 +230,28 @@
         return static_cast <status_t> (reply.readInt32());
     }
 
-    virtual status_t setStreamVolumeIndex(audio_stream_type_t stream, int index)
+    virtual status_t setStreamVolumeIndex(audio_stream_type_t stream,
+                                          int index,
+                                          audio_devices_t device)
     {
         Parcel data, reply;
         data.writeInterfaceToken(IAudioPolicyService::getInterfaceDescriptor());
         data.writeInt32(static_cast <uint32_t>(stream));
         data.writeInt32(index);
+        data.writeInt32(static_cast <uint32_t>(device));
         remote()->transact(SET_STREAM_VOLUME, data, &reply);
         return static_cast <status_t> (reply.readInt32());
     }
 
-    virtual status_t getStreamVolumeIndex(audio_stream_type_t stream, int *index)
+    virtual status_t getStreamVolumeIndex(audio_stream_type_t stream,
+                                          int *index,
+                                          audio_devices_t device)
     {
         Parcel data, reply;
         data.writeInterfaceToken(IAudioPolicyService::getInterfaceDescriptor());
         data.writeInt32(static_cast <uint32_t>(stream));
+        data.writeInt32(static_cast <uint32_t>(device));
+
         remote()->transact(GET_STREAM_VOLUME, data, &reply);
         int lIndex = reply.readInt32();
         if (index) *index = lIndex;
@@ -324,11 +321,11 @@
         return static_cast <status_t> (reply.readInt32());
     }
 
-    virtual bool isStreamActive(int stream, uint32_t inPastMs) const
+    virtual bool isStreamActive(audio_stream_type_t stream, uint32_t inPastMs) const
     {
         Parcel data, reply;
         data.writeInterfaceToken(IAudioPolicyService::getInterfaceDescriptor());
-        data.writeInt32(stream);
+        data.writeInt32((int32_t) stream);
         data.writeInt32(inPastMs);
         remote()->transact(IS_STREAM_ACTIVE, data, &reply);
         return reply.readInt32();
@@ -394,15 +391,7 @@
 
         case SET_PHONE_STATE: {
             CHECK_INTERFACE(IAudioPolicyService, data, reply);
-            reply->writeInt32(static_cast <uint32_t>(setPhoneState(data.readInt32())));
-            return NO_ERROR;
-        } break;
-
-        case SET_RINGER_MODE: {
-            CHECK_INTERFACE(IAudioPolicyService, data, reply);
-            uint32_t mode = data.readInt32();
-            uint32_t mask = data.readInt32();
-            reply->writeInt32(static_cast <uint32_t>(setRingerMode(mode, mask)));
+            reply->writeInt32(static_cast <uint32_t>(setPhoneState((audio_mode_t) data.readInt32())));
             return NO_ERROR;
         } break;
 
@@ -427,7 +416,7 @@
             audio_stream_type_t stream =
                     static_cast <audio_stream_type_t>(data.readInt32());
             uint32_t samplingRate = data.readInt32();
-            uint32_t format = data.readInt32();
+            audio_format_t format = (audio_format_t) data.readInt32();
             uint32_t channels = data.readInt32();
             audio_policy_output_flags_t flags =
                     static_cast <audio_policy_output_flags_t>(data.readInt32());
@@ -472,9 +461,9 @@
 
         case GET_INPUT: {
             CHECK_INTERFACE(IAudioPolicyService, data, reply);
-            int inputSource = data.readInt32();
+            audio_source_t inputSource = (audio_source_t) data.readInt32();
             uint32_t samplingRate = data.readInt32();
-            uint32_t format = data.readInt32();
+            audio_format_t format = (audio_format_t) data.readInt32();
             uint32_t channels = data.readInt32();
             audio_in_acoustics_t acoustics =
                     static_cast <audio_in_acoustics_t>(data.readInt32());
@@ -525,7 +514,10 @@
             audio_stream_type_t stream =
                     static_cast <audio_stream_type_t>(data.readInt32());
             int index = data.readInt32();
-            reply->writeInt32(static_cast <uint32_t>(setStreamVolumeIndex(stream, index)));
+            audio_devices_t device = static_cast <audio_devices_t>(data.readInt32());
+            reply->writeInt32(static_cast <uint32_t>(setStreamVolumeIndex(stream,
+                                                                          index,
+                                                                          device)));
             return NO_ERROR;
         } break;
 
@@ -533,8 +525,9 @@
             CHECK_INTERFACE(IAudioPolicyService, data, reply);
             audio_stream_type_t stream =
                     static_cast <audio_stream_type_t>(data.readInt32());
+            audio_devices_t device = static_cast <audio_devices_t>(data.readInt32());
             int index;
-            status_t status = getStreamVolumeIndex(stream, &index);
+            status_t status = getStreamVolumeIndex(stream, &index, device);
             reply->writeInt32(index);
             reply->writeInt32(static_cast <uint32_t>(status));
             return NO_ERROR;
@@ -598,9 +591,9 @@
 
         case IS_STREAM_ACTIVE: {
             CHECK_INTERFACE(IAudioPolicyService, data, reply);
-            int stream = data.readInt32();
+            audio_stream_type_t stream = (audio_stream_type_t) data.readInt32();
             uint32_t inPastMs = (uint32_t)data.readInt32();
-            reply->writeInt32( isStreamActive(stream, inPastMs) );
+            reply->writeInt32( isStreamActive((audio_stream_type_t) stream, inPastMs) );
             return NO_ERROR;
         } break;
 
diff --git a/media/libmedia/IAudioTrack.cpp b/media/libmedia/IAudioTrack.cpp
index 0b372f3..e618619 100644
--- a/media/libmedia/IAudioTrack.cpp
+++ b/media/libmedia/IAudioTrack.cpp
@@ -46,6 +46,18 @@
     {
     }
     
+    virtual sp<IMemory> getCblk() const
+    {
+        Parcel data, reply;
+        sp<IMemory> cblk;
+        data.writeInterfaceToken(IAudioTrack::getInterfaceDescriptor());
+        status_t status = remote()->transact(GET_CBLK, data, &reply);
+        if (status == NO_ERROR) {
+            cblk = interface_cast<IMemory>(reply.readStrongBinder());
+        }
+        return cblk;
+    }
+
     virtual status_t start()
     {
         Parcel data, reply;
@@ -88,18 +100,6 @@
         remote()->transact(PAUSE, data, &reply);
     }
     
-    virtual sp<IMemory> getCblk() const
-    {
-        Parcel data, reply;
-        sp<IMemory> cblk;
-        data.writeInterfaceToken(IAudioTrack::getInterfaceDescriptor());
-        status_t status = remote()->transact(GET_CBLK, data, &reply);
-        if (status == NO_ERROR) {
-            cblk = interface_cast<IMemory>(reply.readStrongBinder());
-        }
-        return cblk;
-    }
-
     virtual status_t attachAuxEffect(int effectId)
     {
         Parcel data, reply;
diff --git a/media/libmedia/IMediaDeathNotifier.cpp b/media/libmedia/IMediaDeathNotifier.cpp
index 8525482..aeb35a5 100644
--- a/media/libmedia/IMediaDeathNotifier.cpp
+++ b/media/libmedia/IMediaDeathNotifier.cpp
@@ -36,7 +36,7 @@
 {
     ALOGV("getMediaPlayerService");
     Mutex::Autolock _l(sServiceLock);
-    if (sMediaPlayerService.get() == 0) {
+    if (sMediaPlayerService == 0) {
         sp<IServiceManager> sm = defaultServiceManager();
         sp<IBinder> binder;
         do {
diff --git a/media/libmedia/IMediaPlayer.cpp b/media/libmedia/IMediaPlayer.cpp
index 9c1e6b7..64cc919 100644
--- a/media/libmedia/IMediaPlayer.cpp
+++ b/media/libmedia/IMediaPlayer.cpp
@@ -198,11 +198,11 @@
         return reply.readInt32();
     }
 
-    status_t setAudioStreamType(int type)
+    status_t setAudioStreamType(audio_stream_type_t stream)
     {
         Parcel data, reply;
         data.writeInterfaceToken(IMediaPlayer::getInterfaceDescriptor());
-        data.writeInt32(type);
+        data.writeInt32((int32_t) stream);
         remote()->transact(SET_AUDIO_STREAM_TYPE, data, &reply);
         return reply.readInt32();
     }
@@ -397,7 +397,7 @@
         } break;
         case SET_AUDIO_STREAM_TYPE: {
             CHECK_INTERFACE(IMediaPlayer, data, reply);
-            reply->writeInt32(setAudioStreamType(data.readInt32()));
+            reply->writeInt32(setAudioStreamType((audio_stream_type_t) data.readInt32()));
             return NO_ERROR;
         } break;
         case SET_LOOPING: {
diff --git a/media/libmedia/IMediaPlayerService.cpp b/media/libmedia/IMediaPlayerService.cpp
index 8e4dd04..f5b5cbd 100644
--- a/media/libmedia/IMediaPlayerService.cpp
+++ b/media/libmedia/IMediaPlayerService.cpp
@@ -78,7 +78,7 @@
         return interface_cast<IMediaRecorder>(reply.readStrongBinder());
     }
 
-    virtual sp<IMemory> decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, int* pFormat)
+    virtual sp<IMemory> decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, audio_format_t* pFormat)
     {
         Parcel data, reply;
         data.writeInterfaceToken(IMediaPlayerService::getInterfaceDescriptor());
@@ -86,11 +86,11 @@
         remote()->transact(DECODE_URL, data, &reply);
         *pSampleRate = uint32_t(reply.readInt32());
         *pNumChannels = reply.readInt32();
-        *pFormat = reply.readInt32();
+        *pFormat = (audio_format_t) reply.readInt32();
         return interface_cast<IMemory>(reply.readStrongBinder());
     }
 
-    virtual sp<IMemory> decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, int* pFormat)
+    virtual sp<IMemory> decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, audio_format_t* pFormat)
     {
         Parcel data, reply;
         data.writeInterfaceToken(IMediaPlayerService::getInterfaceDescriptor());
@@ -100,7 +100,7 @@
         remote()->transact(DECODE_FD, data, &reply);
         *pSampleRate = uint32_t(reply.readInt32());
         *pNumChannels = reply.readInt32();
-        *pFormat = reply.readInt32();
+        *pFormat = (audio_format_t) reply.readInt32();
         return interface_cast<IMemory>(reply.readStrongBinder());
     }
 
@@ -148,11 +148,11 @@
             const char* url = data.readCString();
             uint32_t sampleRate;
             int numChannels;
-            int format;
+            audio_format_t format;
             sp<IMemory> player = decode(url, &sampleRate, &numChannels, &format);
             reply->writeInt32(sampleRate);
             reply->writeInt32(numChannels);
-            reply->writeInt32(format);
+            reply->writeInt32((int32_t) format);
             reply->writeStrongBinder(player->asBinder());
             return NO_ERROR;
         } break;
@@ -163,11 +163,11 @@
             int64_t length = data.readInt64();
             uint32_t sampleRate;
             int numChannels;
-            int format;
+            audio_format_t format;
             sp<IMemory> player = decode(fd, offset, length, &sampleRate, &numChannels, &format);
             reply->writeInt32(sampleRate);
             reply->writeInt32(numChannels);
-            reply->writeInt32(format);
+            reply->writeInt32((int32_t) format);
             reply->writeStrongBinder(player->asBinder());
             return NO_ERROR;
         } break;
diff --git a/media/libmedia/IOMX.cpp b/media/libmedia/IOMX.cpp
index d2f5f71..27c7e03 100644
--- a/media/libmedia/IOMX.cpp
+++ b/media/libmedia/IOMX.cpp
@@ -59,9 +59,10 @@
         : BpInterface<IOMX>(impl) {
     }
 
-    virtual bool livesLocally(pid_t pid) {
+    virtual bool livesLocally(node_id node, pid_t pid) {
         Parcel data, reply;
         data.writeInterfaceToken(IOMX::getInterfaceDescriptor());
+        data.writeIntPtr((intptr_t)node);
         data.writeInt32(pid);
         remote()->transact(LIVES_LOCALLY, data, &reply);
 
@@ -417,7 +418,9 @@
         case LIVES_LOCALLY:
         {
             CHECK_INTERFACE(IOMX, data, reply);
-            reply->writeInt32(livesLocally((pid_t)data.readInt32()));
+            node_id node = (void *)data.readIntPtr();
+            pid_t pid = (pid_t)data.readInt32();
+            reply->writeInt32(livesLocally(node, pid));
 
             return OK;
         }
diff --git a/media/libmedia/JetPlayer.cpp b/media/libmedia/JetPlayer.cpp
index 188e582..8456db5 100644
--- a/media/libmedia/JetPlayer.cpp
+++ b/media/libmedia/JetPlayer.cpp
@@ -91,7 +91,7 @@
     mAudioTrack = new AudioTrack();
     mAudioTrack->set(AUDIO_STREAM_MUSIC,  //TODO parametrize this
             pLibConfig->sampleRate,
-            1, // format = PCM 16bits per sample,
+            AUDIO_FORMAT_PCM_16_BIT,
             (pLibConfig->numChannels == 2) ? AUDIO_CHANNEL_OUT_STEREO : AUDIO_CHANNEL_OUT_MONO,
             mTrackBufferSize,
             0);
@@ -168,10 +168,6 @@
     // allocate render buffer
     mAudioBuffer = 
         new EAS_PCM[pLibConfig->mixBufferSize * pLibConfig->numChannels * MIX_NUM_BUFFERS];
-    if (!mAudioBuffer) {
-        ALOGE("JetPlayer::render(): mAudioBuffer allocate failed");
-        goto threadExit;
-    }
 
     // signal main thread that we started
     {
@@ -338,8 +334,8 @@
     Mutex::Autolock lock(mMutex);
 
     mEasJetFileLoc = (EAS_FILE_LOCATOR) malloc(sizeof(EAS_FILE));
-    memset(mJetFilePath, 0, 256);
-    strncpy(mJetFilePath, path, strlen(path));
+    strncpy(mJetFilePath, path, sizeof(mJetFilePath));
+    mJetFilePath[sizeof(mJetFilePath) - 1] = '\0';
     mEasJetFileLoc->path = mJetFilePath;
 
     mEasJetFileLoc->fd = 0;
diff --git a/media/libmedia/MediaScannerClient.cpp b/media/libmedia/MediaScannerClient.cpp
index 40b8188..9fe1820 100644
--- a/media/libmedia/MediaScannerClient.cpp
+++ b/media/libmedia/MediaScannerClient.cpp
@@ -173,6 +173,7 @@
             const char* source = mValues->getEntry(i);
             int targetLength = len * 3 + 1;
             char* buffer = new char[targetLength];
+            // don't normally check for NULL, but in this case targetLength may be large
             if (!buffer)
                 break;
             char* target = buffer;
diff --git a/media/libmedia/ToneGenerator.cpp b/media/libmedia/ToneGenerator.cpp
index 35dfbb8..e6e989d 100644
--- a/media/libmedia/ToneGenerator.cpp
+++ b/media/libmedia/ToneGenerator.cpp
@@ -751,7 +751,7 @@
 
 // Used by ToneGenerator::getToneForRegion() to convert user specified supervisory tone type
 // to actual tone for current region.
-const unsigned char ToneGenerator::sToneMappingTable[NUM_REGIONS-1][NUM_SUP_TONES] = {
+const unsigned char /*tone_type*/ ToneGenerator::sToneMappingTable[NUM_REGIONS-1][NUM_SUP_TONES] = {
         {   // ANSI
             TONE_ANSI_DIAL,             // TONE_SUP_DIAL
             TONE_ANSI_BUSY,             // TONE_SUP_BUSY
@@ -798,7 +798,7 @@
 //        none
 //
 ////////////////////////////////////////////////////////////////////////////////
-ToneGenerator::ToneGenerator(int streamType, float volume, bool threadCanCallJava) {
+ToneGenerator::ToneGenerator(audio_stream_type_t streamType, float volume, bool threadCanCallJava) {
 
     ALOGV("ToneGenerator constructor: streamType=%d, volume=%f\n", streamType, volume);
 
@@ -811,9 +811,9 @@
     mThreadCanCallJava = threadCanCallJava;
     mStreamType = streamType;
     mVolume = volume;
-    mpAudioTrack = 0;
-    mpToneDesc = 0;
-    mpNewToneDesc = 0;
+    mpAudioTrack = NULL;
+    mpToneDesc = NULL;
+    mpNewToneDesc = NULL;
     // Generate tone by chunks of 20 ms to keep cadencing precision
     mProcessSize = (mSamplingRate * 20) / 1000;
 
@@ -855,7 +855,7 @@
 ToneGenerator::~ToneGenerator() {
     ALOGV("ToneGenerator destructor\n");
 
-    if (mpAudioTrack) {
+    if (mpAudioTrack != NULL) {
         stopTone();
         ALOGV("Delete Track: %p\n", mpAudioTrack);
         delete mpAudioTrack;
@@ -878,7 +878,7 @@
 //        none
 //
 ////////////////////////////////////////////////////////////////////////////////
-bool ToneGenerator::startTone(int toneType, int durationMs) {
+bool ToneGenerator::startTone(tone_type toneType, int durationMs) {
     bool lResult = false;
     status_t lStatus;
 
@@ -1012,15 +1012,11 @@
 
     if (mpAudioTrack) {
         delete mpAudioTrack;
-        mpAudioTrack = 0;
+        mpAudioTrack = NULL;
     }
 
    // Open audio track in mono, PCM 16bit, default sampling rate, default buffer size
     mpAudioTrack = new AudioTrack();
-    if (mpAudioTrack == 0) {
-        ALOGE("AudioTrack allocation failed");
-        goto initAudioTrack_exit;
-    }
     ALOGV("Create Track: %p\n", mpAudioTrack);
 
     mpAudioTrack->set(mStreamType,
@@ -1052,7 +1048,7 @@
     if (mpAudioTrack) {
         ALOGV("Delete Track I: %p\n", mpAudioTrack);
         delete mpAudioTrack;
-        mpAudioTrack = 0;
+        mpAudioTrack = NULL;
     }
 
     return false;
@@ -1321,7 +1317,7 @@
 bool ToneGenerator::prepareWave() {
     unsigned int segmentIdx = 0;
 
-    if (!mpNewToneDesc) {
+    if (mpNewToneDesc == NULL) {
         return false;
     }
 
@@ -1353,9 +1349,6 @@
                         new ToneGenerator::WaveGenerator((unsigned short)mSamplingRate,
                                 frequency,
                                 TONEGEN_GAIN/lNumWaves);
-                if (lpWaveGen == 0) {
-                    goto prepareWave_exit;
-                }
                 mWaveGens.add(frequency, lpWaveGen);
             }
             frequency = mpNewToneDesc->segments[segmentIdx].waveFreq[++freqIdx];
@@ -1375,12 +1368,6 @@
     }
 
     return true;
-
-prepareWave_exit:
-
-    clearWaveGens();
-
-    return false;
 }
 
 
@@ -1447,13 +1434,13 @@
 //        none
 //
 ////////////////////////////////////////////////////////////////////////////////
-int ToneGenerator::getToneForRegion(int toneType) {
-    int regionTone;
+ToneGenerator::tone_type ToneGenerator::getToneForRegion(tone_type toneType) {
+    tone_type regionTone;
 
     if (mRegion == CEPT || toneType < FIRST_SUP_TONE || toneType > LAST_SUP_TONE) {
         regionTone = toneType;
     } else {
-        regionTone = sToneMappingTable[mRegion][toneType - FIRST_SUP_TONE];
+        regionTone = (tone_type) sToneMappingTable[mRegion][toneType - FIRST_SUP_TONE];
     }
 
     ALOGV("getToneForRegion, tone %d, region %d, regionTone %d", toneType, mRegion, regionTone);
diff --git a/media/libmedia/Visualizer.cpp b/media/libmedia/Visualizer.cpp
index d08ffa5..13b64e9 100644
--- a/media/libmedia/Visualizer.cpp
+++ b/media/libmedia/Visualizer.cpp
@@ -27,8 +27,7 @@
 #include <cutils/bitops.h>
 
 #include <media/Visualizer.h>
-
-extern void fixed_fft_real(int n, int32_t *v);
+#include <audio_utils/fixedfft.h>
 
 namespace android {
 
@@ -54,7 +53,7 @@
 
 status_t Visualizer::setEnabled(bool enabled)
 {
-    Mutex::Autolock _l(mLock);
+    Mutex::Autolock _l(mCaptureLock);
 
     sp<CaptureThread> t = mCaptureThread;
     if (t != 0) {
@@ -74,7 +73,7 @@
     if (status == NO_ERROR) {
         if (t != 0) {
             if (enabled) {
-                t->run("AudioTrackThread");
+                t->run("Visualizer");
             } else {
                 t->requestExit();
             }
@@ -93,7 +92,7 @@
     if (rate > CAPTURE_RATE_MAX) {
         return BAD_VALUE;
     }
-    Mutex::Autolock _l(mLock);
+    Mutex::Autolock _l(mCaptureLock);
 
     if (mEnabled) {
         return INVALID_OPERATION;
@@ -115,10 +114,6 @@
 
     if (cbk != NULL) {
         mCaptureThread = new CaptureThread(*this, rate, ((flags & CAPTURE_CALL_JAVA) != 0));
-        if (mCaptureThread == 0) {
-            ALOGE("Could not create callback thread");
-            return NO_INIT;
-        }
     }
     ALOGV("setCaptureCallBack() rate: %d thread %p flags 0x%08x",
             rate, mCaptureThread.get(), mCaptureFlags);
@@ -133,7 +128,7 @@
         return BAD_VALUE;
     }
 
-    Mutex::Autolock _l(mLock);
+    Mutex::Autolock _l(mCaptureLock);
     if (mEnabled) {
         return INVALID_OPERATION;
     }
@@ -235,7 +230,7 @@
 
 void Visualizer::periodicCapture()
 {
-    Mutex::Autolock _l(mLock);
+    Mutex::Autolock _l(mCaptureLock);
     ALOGV("periodicCapture() %p mCaptureCallBack %p mCaptureFlags 0x%08x",
             this, mCaptureCallBack, mCaptureFlags);
     if (mCaptureCallBack != NULL &&
diff --git a/media/libmedia/autodetect.cpp b/media/libmedia/autodetect.cpp
index dfcc6a0..be5c3b2 100644
--- a/media/libmedia/autodetect.cpp
+++ b/media/libmedia/autodetect.cpp
@@ -16,7 +16,7 @@
 
 #include "autodetect.h"
 
-typedef struct CharRange {
+struct CharRange {
     uint16_t first;
     uint16_t last;
 };
diff --git a/media/libmedia/fixedfft.cpp b/media/libmedia/fixedfft.cpp
deleted file mode 100644
index 2b495e6..0000000
--- a/media/libmedia/fixedfft.cpp
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-/* A Fixed point implementation of Fast Fourier Transform (FFT). Complex numbers
- * are represented by 32-bit integers, where higher 16 bits are real part and
- * lower ones are imaginary part. Few compromises are made between efficiency,
- * accuracy, and maintainability. To make it fast, arithmetic shifts are used
- * instead of divisions, and bitwise inverses are used instead of negates. To
- * keep it small, only radix-2 Cooley-Tukey algorithm is implemented, and only
- * half of the twiddle factors are stored. Although there are still ways to make
- * it even faster or smaller, it costs too much on one of the aspects.
- */
-
-#include <stdio.h>
-#include <stdint.h>
-#ifdef __arm__
-#include <machine/cpu-features.h>
-#endif
-
-#define LOG_FFT_SIZE 10
-#define MAX_FFT_SIZE (1 << LOG_FFT_SIZE)
-
-static const int32_t twiddle[MAX_FFT_SIZE / 4] = {
-    0x00008000, 0xff378001, 0xfe6e8002, 0xfda58006, 0xfcdc800a, 0xfc13800f,
-    0xfb4a8016, 0xfa81801e, 0xf9b88027, 0xf8ef8032, 0xf827803e, 0xf75e804b,
-    0xf6958059, 0xf5cd8068, 0xf5058079, 0xf43c808b, 0xf374809e, 0xf2ac80b2,
-    0xf1e480c8, 0xf11c80de, 0xf05580f6, 0xef8d8110, 0xeec6812a, 0xedff8146,
-    0xed388163, 0xec718181, 0xebab81a0, 0xeae481c1, 0xea1e81e2, 0xe9588205,
-    0xe892822a, 0xe7cd824f, 0xe7078276, 0xe642829d, 0xe57d82c6, 0xe4b982f1,
-    0xe3f4831c, 0xe3308349, 0xe26d8377, 0xe1a983a6, 0xe0e683d6, 0xe0238407,
-    0xdf61843a, 0xde9e846e, 0xdddc84a3, 0xdd1b84d9, 0xdc598511, 0xdb998549,
-    0xdad88583, 0xda1885be, 0xd95885fa, 0xd8988637, 0xd7d98676, 0xd71b86b6,
-    0xd65c86f6, 0xd59e8738, 0xd4e1877b, 0xd42487c0, 0xd3678805, 0xd2ab884c,
-    0xd1ef8894, 0xd13488dd, 0xd0798927, 0xcfbe8972, 0xcf0489be, 0xce4b8a0c,
-    0xcd928a5a, 0xccd98aaa, 0xcc218afb, 0xcb698b4d, 0xcab28ba0, 0xc9fc8bf5,
-    0xc9468c4a, 0xc8908ca1, 0xc7db8cf8, 0xc7278d51, 0xc6738dab, 0xc5c08e06,
-    0xc50d8e62, 0xc45b8ebf, 0xc3a98f1d, 0xc2f88f7d, 0xc2488fdd, 0xc198903e,
-    0xc0e990a1, 0xc03a9105, 0xbf8c9169, 0xbedf91cf, 0xbe329236, 0xbd86929e,
-    0xbcda9307, 0xbc2f9371, 0xbb8593dc, 0xbadc9448, 0xba3394b5, 0xb98b9523,
-    0xb8e39592, 0xb83c9603, 0xb7969674, 0xb6f196e6, 0xb64c9759, 0xb5a897ce,
-    0xb5059843, 0xb46298b9, 0xb3c09930, 0xb31f99a9, 0xb27f9a22, 0xb1df9a9c,
-    0xb1409b17, 0xb0a29b94, 0xb0059c11, 0xaf689c8f, 0xaecc9d0e, 0xae319d8e,
-    0xad979e0f, 0xacfd9e91, 0xac659f14, 0xabcd9f98, 0xab36a01c, 0xaaa0a0a2,
-    0xaa0aa129, 0xa976a1b0, 0xa8e2a238, 0xa84fa2c2, 0xa7bda34c, 0xa72ca3d7,
-    0xa69ca463, 0xa60ca4f0, 0xa57ea57e, 0xa4f0a60c, 0xa463a69c, 0xa3d7a72c,
-    0xa34ca7bd, 0xa2c2a84f, 0xa238a8e2, 0xa1b0a976, 0xa129aa0a, 0xa0a2aaa0,
-    0xa01cab36, 0x9f98abcd, 0x9f14ac65, 0x9e91acfd, 0x9e0fad97, 0x9d8eae31,
-    0x9d0eaecc, 0x9c8faf68, 0x9c11b005, 0x9b94b0a2, 0x9b17b140, 0x9a9cb1df,
-    0x9a22b27f, 0x99a9b31f, 0x9930b3c0, 0x98b9b462, 0x9843b505, 0x97ceb5a8,
-    0x9759b64c, 0x96e6b6f1, 0x9674b796, 0x9603b83c, 0x9592b8e3, 0x9523b98b,
-    0x94b5ba33, 0x9448badc, 0x93dcbb85, 0x9371bc2f, 0x9307bcda, 0x929ebd86,
-    0x9236be32, 0x91cfbedf, 0x9169bf8c, 0x9105c03a, 0x90a1c0e9, 0x903ec198,
-    0x8fddc248, 0x8f7dc2f8, 0x8f1dc3a9, 0x8ebfc45b, 0x8e62c50d, 0x8e06c5c0,
-    0x8dabc673, 0x8d51c727, 0x8cf8c7db, 0x8ca1c890, 0x8c4ac946, 0x8bf5c9fc,
-    0x8ba0cab2, 0x8b4dcb69, 0x8afbcc21, 0x8aaaccd9, 0x8a5acd92, 0x8a0cce4b,
-    0x89becf04, 0x8972cfbe, 0x8927d079, 0x88ddd134, 0x8894d1ef, 0x884cd2ab,
-    0x8805d367, 0x87c0d424, 0x877bd4e1, 0x8738d59e, 0x86f6d65c, 0x86b6d71b,
-    0x8676d7d9, 0x8637d898, 0x85fad958, 0x85beda18, 0x8583dad8, 0x8549db99,
-    0x8511dc59, 0x84d9dd1b, 0x84a3dddc, 0x846ede9e, 0x843adf61, 0x8407e023,
-    0x83d6e0e6, 0x83a6e1a9, 0x8377e26d, 0x8349e330, 0x831ce3f4, 0x82f1e4b9,
-    0x82c6e57d, 0x829de642, 0x8276e707, 0x824fe7cd, 0x822ae892, 0x8205e958,
-    0x81e2ea1e, 0x81c1eae4, 0x81a0ebab, 0x8181ec71, 0x8163ed38, 0x8146edff,
-    0x812aeec6, 0x8110ef8d, 0x80f6f055, 0x80def11c, 0x80c8f1e4, 0x80b2f2ac,
-    0x809ef374, 0x808bf43c, 0x8079f505, 0x8068f5cd, 0x8059f695, 0x804bf75e,
-    0x803ef827, 0x8032f8ef, 0x8027f9b8, 0x801efa81, 0x8016fb4a, 0x800ffc13,
-    0x800afcdc, 0x8006fda5, 0x8002fe6e, 0x8001ff37,
-};
-
-/* Returns the multiplication of \conj{a} and {b}. */
-static inline int32_t mult(int32_t a, int32_t b)
-{
-#if __ARM_ARCH__ >= 6
-    int32_t t = b;
-    __asm__("smuad  %0, %0, %1"          : "+r" (t) : "r" (a));
-    __asm__("smusdx %0, %0, %1"          : "+r" (b) : "r" (a));
-    __asm__("pkhtb  %0, %0, %1, ASR #16" : "+r" (t) : "r" (b));
-    return t;
-#else
-    return (((a >> 16) * (b >> 16) + (int16_t)a * (int16_t)b) & ~0xFFFF) |
-        ((((a >> 16) * (int16_t)b - (int16_t)a * (b >> 16)) >> 16) & 0xFFFF);
-#endif
-}
-
-static inline int32_t half(int32_t a)
-{
-#if __ARM_ARCH__ >= 6
-    __asm__("shadd16 %0, %0, %1" : "+r" (a) : "r" (0));
-    return a;
-#else
-    return ((a >> 1) & ~0x8000) | (a & 0x8000);
-#endif
-}
-
-void fixed_fft(int n, int32_t *v)
-{
-    int scale = LOG_FFT_SIZE, i, p, r;
-
-    for (r = 0, i = 1; i < n; ++i) {
-        for (p = n; !(p & r); p >>= 1, r ^= p);
-        if (i < r) {
-            int32_t t = v[i];
-            v[i] = v[r];
-            v[r] = t;
-        }
-    }
-
-    for (p = 1; p < n; p <<= 1) {
-        --scale;
-
-        for (i = 0; i < n; i += p << 1) {
-            int32_t x = half(v[i]);
-            int32_t y = half(v[i + p]);
-            v[i] = x + y;
-            v[i + p] = x - y;
-        }
-
-        for (r = 1; r < p; ++r) {
-            int32_t w = MAX_FFT_SIZE / 4 - (r << scale);
-            i = w >> 31;
-            w = twiddle[(w ^ i) - i] ^ (i << 16);
-            for (i = r; i < n; i += p << 1) {
-                int32_t x = half(v[i]);
-                int32_t y = mult(w, v[i + p]);
-                v[i] = x - y;
-                v[i + p] = x + y;
-            }
-        }
-    }
-}
-
-void fixed_fft_real(int n, int32_t *v)
-{
-    int scale = LOG_FFT_SIZE, m = n >> 1, i;
-
-    fixed_fft(n, v);
-    for (i = 1; i <= n; i <<= 1, --scale);
-    v[0] = mult(~v[0], 0x80008000);
-    v[m] = half(v[m]);
-
-    for (i = 1; i < n >> 1; ++i) {
-        int32_t x = half(v[i]);
-        int32_t z = half(v[n - i]);
-        int32_t y = z - (x ^ 0xFFFF);
-        x = half(x + (z ^ 0xFFFF));
-        y = mult(y, twiddle[i << scale]);
-        v[i] = x - y;
-        v[n - i] = (x + y) ^ 0xFFFF;
-    }
-}
diff --git a/media/libmedia/mediametadataretriever.cpp b/media/libmedia/mediametadataretriever.cpp
index 88e269f..8d53357 100644
--- a/media/libmedia/mediametadataretriever.cpp
+++ b/media/libmedia/mediametadataretriever.cpp
@@ -35,7 +35,7 @@
 const sp<IMediaPlayerService>& MediaMetadataRetriever::getService()
 {
     Mutex::Autolock lock(sServiceLock);
-    if (sService.get() == 0) {
+    if (sService == 0) {
         sp<IServiceManager> sm = defaultServiceManager();
         sp<IBinder> binder;
         do {
diff --git a/media/libmedia/mediaplayer.cpp b/media/libmedia/mediaplayer.cpp
index 2284927..f1c47dd 100644
--- a/media/libmedia/mediaplayer.cpp
+++ b/media/libmedia/mediaplayer.cpp
@@ -30,7 +30,7 @@
 #include <gui/SurfaceTextureClient.h>
 
 #include <media/mediaplayer.h>
-#include <media/AudioTrack.h>
+#include <media/AudioSystem.h>
 
 #include <surfaceflinger/Surface.h>
 
@@ -478,7 +478,7 @@
     return reset_l();
 }
 
-status_t MediaPlayer::setAudioStreamType(int type)
+status_t MediaPlayer::setAudioStreamType(audio_stream_type_t type)
 {
     ALOGV("MediaPlayer::setAudioStreamType");
     Mutex::Autolock _l(mLock);
@@ -709,7 +709,7 @@
     }
 }
 
-/*static*/ sp<IMemory> MediaPlayer::decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, int* pFormat)
+/*static*/ sp<IMemory> MediaPlayer::decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, audio_format_t* pFormat)
 {
     ALOGV("decode(%s)", url);
     sp<IMemory> p;
@@ -729,7 +729,7 @@
     notify(MEDIA_ERROR, MEDIA_ERROR_SERVER_DIED, 0);
 }
 
-/*static*/ sp<IMemory> MediaPlayer::decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, int* pFormat)
+/*static*/ sp<IMemory> MediaPlayer::decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, audio_format_t* pFormat)
 {
     ALOGV("decode(%d, %lld, %lld)", fd, offset, length);
     sp<IMemory> p;
diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp
index f5cb019..a0c20ae 100644
--- a/media/libmediaplayerservice/MediaPlayerService.cpp
+++ b/media/libmediaplayerservice/MediaPlayerService.cpp
@@ -1010,7 +1010,7 @@
     return p->reset();
 }
 
-status_t MediaPlayerService::Client::setAudioStreamType(int type)
+status_t MediaPlayerService::Client::setAudioStreamType(audio_stream_type_t type)
 {
     ALOGV("[%d] setAudioStreamType(%d)", mConnId, type);
     // TODO: for hardware output, call player instead
@@ -1149,7 +1149,7 @@
 
 static size_t kDefaultHeapSize = 1024 * 1024; // 1MB
 
-sp<IMemory> MediaPlayerService::decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, int* pFormat)
+sp<IMemory> MediaPlayerService::decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, audio_format_t* pFormat)
 {
     ALOGV("decode(%s)", url);
     sp<MemoryBase> mem;
@@ -1197,7 +1197,7 @@
     mem = new MemoryBase(cache->getHeap(), 0, cache->size());
     *pSampleRate = cache->sampleRate();
     *pNumChannels = cache->channelCount();
-    *pFormat = (int)cache->format();
+    *pFormat = cache->format();
     ALOGV("return memory @ %p, sampleRate=%u, channelCount = %d, format = %d", mem->pointer(), *pSampleRate, *pNumChannels, *pFormat);
 
 Exit:
@@ -1205,7 +1205,7 @@
     return mem;
 }
 
-sp<IMemory> MediaPlayerService::decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, int* pFormat)
+sp<IMemory> MediaPlayerService::decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, audio_format_t* pFormat)
 {
     ALOGV("decode(%d, %lld, %lld)", fd, offset, length);
     sp<MemoryBase> mem;
@@ -1339,7 +1339,7 @@
 }
 
 status_t MediaPlayerService::AudioOutput::open(
-        uint32_t sampleRate, int channelCount, int format, int bufferCount,
+        uint32_t sampleRate, int channelCount, audio_format_t format, int bufferCount,
         AudioCallback cb, void *cookie)
 {
     mCallback = cb;
@@ -1611,7 +1611,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 
 status_t MediaPlayerService::AudioCache::open(
-        uint32_t sampleRate, int channelCount, int format, int bufferCount,
+        uint32_t sampleRate, int channelCount, audio_format_t format, int bufferCount,
         AudioCallback cb, void *cookie)
 {
     ALOGV("open(%u, %d, %d, %d)", sampleRate, channelCount, format, bufferCount);
@@ -1621,7 +1621,7 @@
 
     mSampleRate = sampleRate;
     mChannelCount = (uint16_t)channelCount;
-    mFormat = (uint16_t)format;
+    mFormat = format;
     mMsecsPerFrame = 1.e3 / (float) sampleRate;
 
     if (cb != NULL) {
diff --git a/media/libmediaplayerservice/MediaPlayerService.h b/media/libmediaplayerservice/MediaPlayerService.h
index 04d9e28..fa71d11 100644
--- a/media/libmediaplayerservice/MediaPlayerService.h
+++ b/media/libmediaplayerservice/MediaPlayerService.h
@@ -34,6 +34,7 @@
 
 namespace android {
 
+class AudioTrack;
 class IMediaRecorder;
 class IMediaMetadataRetriever;
 class IOMX;
@@ -83,7 +84,7 @@
 
         virtual status_t        open(
                 uint32_t sampleRate, int channelCount,
-                int format, int bufferCount,
+                audio_format_t format, int bufferCount,
                 AudioCallback cb, void *cookie);
 
         virtual void            start();
@@ -92,7 +93,7 @@
         virtual void            flush();
         virtual void            pause();
         virtual void            close();
-                void            setAudioStreamType(int streamType) { mStreamType = streamType; }
+                void            setAudioStreamType(audio_stream_type_t streamType) { mStreamType = streamType; }
                 void            setVolume(float left, float right);
                 status_t        setAuxEffectSendLevel(float level);
                 status_t        attachAuxEffect(int effectId);
@@ -108,7 +109,7 @@
         AudioTrack*             mTrack;
         AudioCallback           mCallback;
         void *                  mCallbackCookie;
-        int                     mStreamType;
+        audio_stream_type_t     mStreamType;
         float                   mLeftVolume;
         float                   mRightVolume;
         float                   mMsecsPerFrame;
@@ -139,7 +140,7 @@
         virtual int             getSessionId();
 
         virtual status_t        open(
-                uint32_t sampleRate, int channelCount, int format,
+                uint32_t sampleRate, int channelCount, audio_format_t format,
                 int bufferCount = 1,
                 AudioCallback cb = NULL, void *cookie = NULL);
 
@@ -149,10 +150,10 @@
         virtual void            flush() {}
         virtual void            pause() {}
         virtual void            close() {}
-                void            setAudioStreamType(int streamType) {}
+                void            setAudioStreamType(audio_stream_type_t streamType) {}
                 void            setVolume(float left, float right) {}
                 uint32_t        sampleRate() const { return mSampleRate; }
-                uint32_t        format() const { return (uint32_t)mFormat; }
+                audio_format_t  format() const { return mFormat; }
                 size_t          size() const { return mSize; }
                 status_t        wait();
 
@@ -170,7 +171,7 @@
         sp<MemoryHeapBase>  mHeap;
         float               mMsecsPerFrame;
         uint16_t            mChannelCount;
-        uint16_t            mFormat;
+        audio_format_t      mFormat;
         ssize_t             mFrameCount;
         uint32_t            mSampleRate;
         uint32_t            mSize;
@@ -190,8 +191,8 @@
 
     virtual sp<IMediaPlayer>    create(pid_t pid, const sp<IMediaPlayerClient>& client, int audioSessionId);
 
-    virtual sp<IMemory>         decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, int* pFormat);
-    virtual sp<IMemory>         decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, int* pFormat);
+    virtual sp<IMemory>         decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, audio_format_t* pFormat);
+    virtual sp<IMemory>         decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, audio_format_t* pFormat);
     virtual sp<IOMX>            getOMX();
 
     virtual status_t            dump(int fd, const Vector<String16>& args);
@@ -259,7 +260,7 @@
         virtual status_t        getCurrentPosition(int* msec);
         virtual status_t        getDuration(int* msec);
         virtual status_t        reset();
-        virtual status_t        setAudioStreamType(int type);
+        virtual status_t        setAudioStreamType(audio_stream_type_t type);
         virtual status_t        setLooping(int loop);
         virtual status_t        setVolume(float leftVolume, float rightVolume);
         virtual status_t        invoke(const Parcel& request, Parcel *reply);
diff --git a/media/libmediaplayerservice/MediaRecorderClient.cpp b/media/libmediaplayerservice/MediaRecorderClient.cpp
index d219fc2..beda945 100644
--- a/media/libmediaplayerservice/MediaRecorderClient.cpp
+++ b/media/libmediaplayerservice/MediaRecorderClient.cpp
@@ -33,8 +33,6 @@
 
 #include <utils/String16.h>
 
-#include <media/AudioTrack.h>
-
 #include <system/audio.h>
 
 #include "MediaRecorderClient.h"
diff --git a/media/libmediaplayerservice/MidiFile.h b/media/libmediaplayerservice/MidiFile.h
index 2a0dcf9..f6f8f7b 100644
--- a/media/libmediaplayerservice/MidiFile.h
+++ b/media/libmediaplayerservice/MidiFile.h
@@ -19,7 +19,6 @@
 #define ANDROID_MIDIFILE_H
 
 #include <media/MediaPlayerInterface.h>
-#include <media/AudioTrack.h>
 #include <libsonivox/eas.h>
 
 namespace android {
@@ -78,7 +77,7 @@
     EAS_I32             mDuration;
     EAS_STATE           mState;
     EAS_FILE            mFileLocator;
-    int                 mStreamType;
+    audio_stream_type_t mStreamType;
     bool                mLoop;
     volatile bool       mExit;
     bool                mPaused;
diff --git a/media/libmediaplayerservice/TestPlayerStub.cpp b/media/libmediaplayerservice/TestPlayerStub.cpp
index 0f0ff65..5d9728a 100644
--- a/media/libmediaplayerservice/TestPlayerStub.cpp
+++ b/media/libmediaplayerservice/TestPlayerStub.cpp
@@ -176,7 +176,7 @@
     mContentUrl = NULL;
 
     if (mPlayer) {
-        LOG_ASSERT(mDeletePlayer != NULL, "mDeletePlayer is null");
+        ALOG_ASSERT(mDeletePlayer != NULL, "mDeletePlayer is null");
         (*mDeletePlayer)(mPlayer);
         mPlayer = NULL;
     }
diff --git a/media/libstagefright/AACWriter.cpp b/media/libstagefright/AACWriter.cpp
index 1673ccd..9cdb463 100644
--- a/media/libstagefright/AACWriter.cpp
+++ b/media/libstagefright/AACWriter.cpp
@@ -60,7 +60,7 @@
 
 AACWriter::~AACWriter() {
     if (mStarted) {
-        stop();
+        reset();
     }
 
     if (mFd != -1) {
@@ -152,7 +152,7 @@
     return OK;
 }
 
-status_t AACWriter::stop() {
+status_t AACWriter::reset() {
     if (!mStarted) {
         return OK;
     }
diff --git a/media/libstagefright/AMRWriter.cpp b/media/libstagefright/AMRWriter.cpp
index 6c4e307..59b4ca7 100644
--- a/media/libstagefright/AMRWriter.cpp
+++ b/media/libstagefright/AMRWriter.cpp
@@ -52,7 +52,7 @@
 
 AMRWriter::~AMRWriter() {
     if (mStarted) {
-        stop();
+        reset();
     }
 
     if (mFd != -1) {
@@ -152,7 +152,7 @@
     return OK;
 }
 
-status_t AMRWriter::stop() {
+status_t AMRWriter::reset() {
     if (!mStarted) {
         return OK;
     }
diff --git a/media/libstagefright/AVIExtractor.cpp b/media/libstagefright/AVIExtractor.cpp
index a3187b7..5a6211e 100644
--- a/media/libstagefright/AVIExtractor.cpp
+++ b/media/libstagefright/AVIExtractor.cpp
@@ -577,6 +577,7 @@
         case FOURCC('a', 'v', 'c', '1'):
         case FOURCC('d', 'a', 'v', 'c'):
         case FOURCC('x', '2', '6', '4'):
+        case FOURCC('H', '2', '6', '4'):
         case FOURCC('v', 's', 's', 'h'):
             return MEDIA_MIMETYPE_VIDEO_AVC;
 
diff --git a/media/libstagefright/Android.mk b/media/libstagefright/Android.mk
index 0aeb515..483e5ab 100644
--- a/media/libstagefright/Android.mk
+++ b/media/libstagefright/Android.mk
@@ -74,12 +74,11 @@
         libcrypto        \
         libssl           \
         libgui           \
+        libstagefright_omx \
 
 LOCAL_STATIC_LIBRARIES := \
         libstagefright_color_conversion \
         libstagefright_aacenc \
-        libstagefright_amrnbenc \
-        libstagefright_amrwbenc \
         libstagefright_avcenc \
         libstagefright_m4vh263enc \
         libstagefright_matroska \
@@ -141,7 +140,6 @@
 ################################################################################
 
 LOCAL_SHARED_LIBRARIES += \
-        libstagefright_amrnb_common \
         libstagefright_enc_common \
         libstagefright_avc_common \
         libstagefright_foundation \
diff --git a/media/libstagefright/AudioSource.cpp b/media/libstagefright/AudioSource.cpp
index 2172cc0..fef2a00 100644
--- a/media/libstagefright/AudioSource.cpp
+++ b/media/libstagefright/AudioSource.cpp
@@ -47,7 +47,7 @@
 }
 
 AudioSource::AudioSource(
-        int inputSource, uint32_t sampleRate, uint32_t channels)
+        audio_source_t inputSource, uint32_t sampleRate, uint32_t channels)
     : mStarted(false),
       mSampleRate(sampleRate),
       mPrevSampleTimeUs(0),
@@ -72,7 +72,7 @@
 
 AudioSource::~AudioSource() {
     if (mStarted) {
-        stop();
+        reset();
     }
 
     delete mRecord;
@@ -130,7 +130,7 @@
     }
 }
 
-status_t AudioSource::stop() {
+status_t AudioSource::reset() {
     Mutex::Autolock autoLock(mLock);
     if (!mStarted) {
         return UNKNOWN_ERROR;
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index 7a2d7b3..8073af8 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -30,7 +30,7 @@
 #include "include/MPEG2TSExtractor.h"
 #include "include/WVMExtractor.h"
 
-#include "timedtext/TimedTextPlayer.h"
+#include "timedtext/TimedTextDriver.h"
 
 #include <binder/IPCThreadState.h>
 #include <binder/IServiceManager.h>
@@ -192,7 +192,7 @@
       mVideoBuffer(NULL),
       mDecryptHandle(NULL),
       mLastVideoTimeUs(-1),
-      mTextPlayer(NULL) {
+      mTextDriver(NULL) {
     CHECK_EQ(mClient.connect(), (status_t)OK);
 
     DataSource::RegisterDefaultSniffers();
@@ -335,6 +335,14 @@
         return UNKNOWN_ERROR;
     }
 
+    if (extractor->getDrmFlag()) {
+        checkDrmStatus(dataSource);
+    }
+
+    return setDataSource_l(extractor);
+}
+
+void AwesomePlayer::checkDrmStatus(const sp<DataSource>& dataSource) {
     dataSource->getDrmInfo(mDecryptHandle, &mDrmManagerClient);
     if (mDecryptHandle != NULL) {
         CHECK(mDrmManagerClient);
@@ -342,8 +350,6 @@
             notifyListener_l(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_DRM_NO_LICENSE);
         }
     }
-
-    return setDataSource_l(extractor);
 }
 
 status_t AwesomePlayer::setDataSource_l(const sp<MediaExtractor> &extractor) {
@@ -524,9 +530,9 @@
     delete mAudioPlayer;
     mAudioPlayer = NULL;
 
-    if (mTextPlayer != NULL) {
-        delete mTextPlayer;
-        mTextPlayer = NULL;
+    if (mTextDriver != NULL) {
+        delete mTextDriver;
+        mTextDriver = NULL;
     }
 
     mVideoRenderer.clear();
@@ -1112,7 +1118,7 @@
     }
 
     if (mFlags & TEXTPLAYER_STARTED) {
-        mTextPlayer->pause();
+        mTextDriver->pause();
         modifyFlags(TEXT_RUNNING, CLEAR);
     }
 
@@ -1266,9 +1272,9 @@
 }
 
 status_t AwesomePlayer::setTimedTextTrackIndex(int32_t index) {
-    if (mTextPlayer != NULL) {
+    if (mTextDriver != NULL) {
         if (index >= 0) { // to turn on a text track
-            status_t err = mTextPlayer->setTimedTextTrackIndex(index);
+            status_t err = mTextDriver->setTimedTextTrackIndex(index);
             if (err != OK) {
                 return err;
             }
@@ -1284,7 +1290,7 @@
                 modifyFlags(TEXTPLAYER_STARTED, CLEAR);
             }
 
-            return mTextPlayer->setTimedTextTrackIndex(index);
+            return mTextDriver->setTimedTextTrackIndex(index);
         }
     } else {
         return INVALID_OPERATION;
@@ -1313,7 +1319,7 @@
     seekAudioIfNecessary_l();
 
     if (mFlags & TEXTPLAYER_STARTED) {
-        mTextPlayer->seekTo(mSeekTimeUs);
+        mTextDriver->seekToAsync(mSeekTimeUs);
     }
 
     if (!(mFlags & PLAYING)) {
@@ -1358,11 +1364,11 @@
     Mutex::Autolock autoLock(mTimedTextLock);
     CHECK(source != NULL);
 
-    if (mTextPlayer == NULL) {
-        mTextPlayer = new TimedTextPlayer(this, mListener, &mQueue);
+    if (mTextDriver == NULL) {
+        mTextDriver = new TimedTextDriver(mListener);
     }
 
-    mTextPlayer->addTextSource(source);
+    mTextDriver->addInBandTextSource(source);
 }
 
 status_t AwesomePlayer::initAudioDecoder() {
@@ -1689,7 +1695,7 @@
     }
 
     if ((mFlags & TEXTPLAYER_STARTED) && !(mFlags & (TEXT_RUNNING | SEEK_PREVIEW))) {
-        mTextPlayer->resume();
+        mTextDriver->resume();
         modifyFlags(TEXT_RUNNING, SET);
     }
 
@@ -1841,6 +1847,10 @@
         return;
     }
     mAudioStatusEventPending = true;
+    // Do not honor delay when looping in order to limit audio gap
+    if (mFlags & (LOOPING | AUTO_LOOPING)) {
+        delayUs = 0;
+    }
     mQueue.postEventWithDelay(mCheckAudioStatusEvent, delayUs);
 }
 
@@ -2091,7 +2101,7 @@
         String8 mimeType;
         float confidence;
         sp<AMessage> dummy;
-        bool success = SniffDRM(dataSource, &mimeType, &confidence, &dummy);
+        bool success = SniffWVM(dataSource, &mimeType, &confidence, &dummy);
 
         if (!success
                 || strcasecmp(
@@ -2111,13 +2121,8 @@
         }
     }
 
-    dataSource->getDrmInfo(mDecryptHandle, &mDrmManagerClient);
-
-    if (mDecryptHandle != NULL) {
-        CHECK(mDrmManagerClient);
-        if (RightsStatus::RIGHTS_VALID != mDecryptHandle->status) {
-            notifyListener_l(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_DRM_NO_LICENSE);
-        }
+    if (extractor->getDrmFlag()) {
+        checkDrmStatus(dataSource);
     }
 
     status_t err = setDataSource_l(extractor);
@@ -2236,11 +2241,11 @@
         case KEY_PARAMETER_TIMED_TEXT_ADD_OUT_OF_BAND_SOURCE:
         {
             Mutex::Autolock autoLock(mTimedTextLock);
-            if (mTextPlayer == NULL) {
-                mTextPlayer = new TimedTextPlayer(this, mListener, &mQueue);
+            if (mTextDriver == NULL) {
+                mTextDriver = new TimedTextDriver(mListener);
             }
 
-            return mTextPlayer->setParameter(key, request);
+            return mTextDriver->addOutOfBandTextSource(request);
         }
         case KEY_PARAMETER_CACHE_STAT_COLLECT_FREQ_MS:
         {
diff --git a/media/libstagefright/CameraSource.cpp b/media/libstagefright/CameraSource.cpp
index 1850c9c..228659c 100755
--- a/media/libstagefright/CameraSource.cpp
+++ b/media/libstagefright/CameraSource.cpp
@@ -548,7 +548,7 @@
 
 CameraSource::~CameraSource() {
     if (mStarted) {
-        stop();
+        reset();
     } else if (mInitCheck == OK) {
         // Camera is initialized but because start() is never called,
         // the lock on Camera is never released(). This makes sure
@@ -632,8 +632,8 @@
     mCameraFlags = 0;
 }
 
-status_t CameraSource::stop() {
-    ALOGD("stop: E");
+status_t CameraSource::reset() {
+    ALOGD("reset: E");
     Mutex::Autolock autoLock(mLock);
     mStarted = false;
     mFrameAvailableCondition.signal();
@@ -670,7 +670,7 @@
     }
 
     CHECK_EQ(mNumFramesReceived, mNumFramesEncoded + mNumFramesDropped);
-    ALOGD("stop: X");
+    ALOGD("reset: X");
     return OK;
 }
 
diff --git a/media/libstagefright/CameraSourceTimeLapse.cpp b/media/libstagefright/CameraSourceTimeLapse.cpp
index 263ab50..83d67b9 100644
--- a/media/libstagefright/CameraSourceTimeLapse.cpp
+++ b/media/libstagefright/CameraSourceTimeLapse.cpp
@@ -87,6 +87,10 @@
 }
 
 CameraSourceTimeLapse::~CameraSourceTimeLapse() {
+    if (mLastReadBufferCopy) {
+        mLastReadBufferCopy->release();
+        mLastReadBufferCopy = NULL;
+    }
 }
 
 void CameraSourceTimeLapse::startQuickReadReturns() {
@@ -204,15 +208,6 @@
     }
 }
 
-void CameraSourceTimeLapse::stopCameraRecording() {
-    ALOGV("stopCameraRecording");
-    CameraSource::stopCameraRecording();
-    if (mLastReadBufferCopy) {
-        mLastReadBufferCopy->release();
-        mLastReadBufferCopy = NULL;
-    }
-}
-
 sp<IMemory> CameraSourceTimeLapse::createIMemoryCopy(
         const sp<IMemory> &source_data) {
 
diff --git a/media/libstagefright/DRMExtractor.cpp b/media/libstagefright/DRMExtractor.cpp
index 9452ab1..afc4a80 100644
--- a/media/libstagefright/DRMExtractor.cpp
+++ b/media/libstagefright/DRMExtractor.cpp
@@ -282,13 +282,13 @@
     if (decryptHandle != NULL) {
         if (decryptHandle->decryptApiType == DecryptApiType::CONTAINER_BASED) {
             *mimeType = String8("drm+container_based+") + decryptHandle->mimeType;
+            *confidence = 10.0f;
         } else if (decryptHandle->decryptApiType == DecryptApiType::ELEMENTARY_STREAM_BASED) {
             *mimeType = String8("drm+es_based+") + decryptHandle->mimeType;
-        } else if (decryptHandle->decryptApiType == DecryptApiType::WV_BASED) {
-            *mimeType = MEDIA_MIMETYPE_CONTAINER_WVM;
-            ALOGW("SniffWVM: found match\n");
+            *confidence = 10.0f;
+        } else {
+            return false;
         }
-        *confidence = 10.0f;
 
         return true;
     }
diff --git a/media/libstagefright/DataSource.cpp b/media/libstagefright/DataSource.cpp
index e471f73..d0a7880 100644
--- a/media/libstagefright/DataSource.cpp
+++ b/media/libstagefright/DataSource.cpp
@@ -32,6 +32,7 @@
 #include "include/DRMExtractor.h"
 #include "include/FLACExtractor.h"
 #include "include/AACExtractor.h"
+#include "include/WVMExtractor.h"
 
 #include "matroska/MatroskaExtractor.h"
 
@@ -120,6 +121,7 @@
     RegisterSniffer(SniffAAC);
     RegisterSniffer(SniffAVI);
     RegisterSniffer(SniffMPEG2PS);
+    RegisterSniffer(SniffWVM);
 
     char value[PROPERTY_VALUE_MAX];
     if (property_get("drm.service.enabled", value, NULL)
diff --git a/media/libstagefright/FileSource.cpp b/media/libstagefright/FileSource.cpp
index 73cb48c..01f53e4 100644
--- a/media/libstagefright/FileSource.cpp
+++ b/media/libstagefright/FileSource.cpp
@@ -127,7 +127,7 @@
     return OK;
 }
 
-sp<DecryptHandle> FileSource::DrmInitialization() {
+sp<DecryptHandle> FileSource::DrmInitialization(const char *mime) {
     if (mDrmManagerClient == NULL) {
         mDrmManagerClient = new DrmManagerClient();
     }
@@ -138,7 +138,7 @@
 
     if (mDecryptHandle == NULL) {
         mDecryptHandle = mDrmManagerClient->openDecryptSession(
-                mFd, mOffset, mLength);
+                mFd, mOffset, mLength, mime);
     }
 
     if (mDecryptHandle == NULL) {
diff --git a/media/libstagefright/MPEG2TSWriter.cpp b/media/libstagefright/MPEG2TSWriter.cpp
index 36009ab..0b4ecbe 100644
--- a/media/libstagefright/MPEG2TSWriter.cpp
+++ b/media/libstagefright/MPEG2TSWriter.cpp
@@ -513,7 +513,7 @@
 
 MPEG2TSWriter::~MPEG2TSWriter() {
     if (mStarted) {
-        stop();
+        reset();
     }
 
     mLooper->unregisterHandler(mReflector->id());
@@ -564,7 +564,7 @@
     return OK;
 }
 
-status_t MPEG2TSWriter::stop() {
+status_t MPEG2TSWriter::reset() {
     CHECK(mStarted);
 
     for (size_t i = 0; i < mSources.size(); ++i) {
diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp
index bc88015..6c95d4e 100644
--- a/media/libstagefright/MPEG4Extractor.cpp
+++ b/media/libstagefright/MPEG4Extractor.cpp
@@ -20,7 +20,6 @@
 #include "include/MPEG4Extractor.h"
 #include "include/SampleTable.h"
 #include "include/ESDS.h"
-#include "timedtext/TimedTextPlayer.h"
 
 #include <arpa/inet.h>
 
@@ -2430,4 +2429,3 @@
 }
 
 }  // namespace android
-
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp
index 06dd875..068660b 100755
--- a/media/libstagefright/MPEG4Writer.cpp
+++ b/media/libstagefright/MPEG4Writer.cpp
@@ -282,7 +282,7 @@
 }
 
 MPEG4Writer::~MPEG4Writer() {
-    stop();
+    reset();
 
     while (!mTracks.empty()) {
         List<Track *>::iterator it = mTracks.begin();
@@ -616,7 +616,7 @@
     mStarted = false;
 }
 
-status_t MPEG4Writer::stop() {
+status_t MPEG4Writer::reset() {
     if (mInitCheck != OK) {
         return OK;
     } else {
diff --git a/media/libstagefright/NuCachedSource2.cpp b/media/libstagefright/NuCachedSource2.cpp
index 249c298..0957426 100644
--- a/media/libstagefright/NuCachedSource2.cpp
+++ b/media/libstagefright/NuCachedSource2.cpp
@@ -370,6 +370,7 @@
                     && (mSource->flags() & DataSource::kIsHTTPBasedSource)) {
                 ALOGV("Disconnecting at high watermark");
                 static_cast<HTTPBase *>(mSource.get())->disconnect();
+                mFinalStatus = -EAGAIN;
             }
         }
     } else {
@@ -549,7 +550,7 @@
 
     size_t delta = offset - mCacheOffset;
 
-    if (mFinalStatus != OK) {
+    if (mFinalStatus != OK && mNumRetriesLeft == 0) {
         if (delta >= mCache->totalSize()) {
             return mFinalStatus;
         }
@@ -591,7 +592,7 @@
     size_t totalSize = mCache->totalSize();
     CHECK_EQ(mCache->releaseFromStart(totalSize), totalSize);
 
-    mFinalStatus = OK;
+    mNumRetriesLeft = kMaxNumRetries;
     mFetching = true;
 
     return OK;
@@ -603,8 +604,8 @@
     restartPrefetcherIfNecessary_l(true /* ignore low water threshold */);
 }
 
-sp<DecryptHandle> NuCachedSource2::DrmInitialization() {
-    return mSource->DrmInitialization();
+sp<DecryptHandle> NuCachedSource2::DrmInitialization(const char* mime) {
+    return mSource->DrmInitialization(mime);
 }
 
 void NuCachedSource2::getDrmInfo(sp<DecryptHandle> &handle, DrmManagerClient **client) {
diff --git a/media/libstagefright/OMXClient.cpp b/media/libstagefright/OMXClient.cpp
index 9de873e..7a805aa 100644
--- a/media/libstagefright/OMXClient.cpp
+++ b/media/libstagefright/OMXClient.cpp
@@ -20,11 +20,299 @@
 
 #include <binder/IServiceManager.h>
 #include <media/IMediaPlayerService.h>
-#include <media/stagefright/MediaDebug.h>
+#include <media/stagefright/foundation/ADebug.h>
 #include <media/stagefright/OMXClient.h>
+#include <utils/KeyedVector.h>
+
+#include "include/OMX.h"
 
 namespace android {
 
+struct MuxOMX : public IOMX {
+    MuxOMX(const sp<IOMX> &remoteOMX);
+    virtual ~MuxOMX();
+
+    virtual IBinder *onAsBinder() { return NULL; }
+
+    virtual bool livesLocally(node_id node, pid_t pid);
+
+    virtual status_t listNodes(List<ComponentInfo> *list);
+
+    virtual status_t allocateNode(
+            const char *name, const sp<IOMXObserver> &observer,
+            node_id *node);
+
+    virtual status_t freeNode(node_id node);
+
+    virtual status_t sendCommand(
+            node_id node, OMX_COMMANDTYPE cmd, OMX_S32 param);
+
+    virtual status_t getParameter(
+            node_id node, OMX_INDEXTYPE index,
+            void *params, size_t size);
+
+    virtual status_t setParameter(
+            node_id node, OMX_INDEXTYPE index,
+            const void *params, size_t size);
+
+    virtual status_t getConfig(
+            node_id node, OMX_INDEXTYPE index,
+            void *params, size_t size);
+
+    virtual status_t setConfig(
+            node_id node, OMX_INDEXTYPE index,
+            const void *params, size_t size);
+
+    virtual status_t getState(
+            node_id node, OMX_STATETYPE* state);
+
+    virtual status_t storeMetaDataInBuffers(
+            node_id node, OMX_U32 port_index, OMX_BOOL enable);
+
+    virtual status_t enableGraphicBuffers(
+            node_id node, OMX_U32 port_index, OMX_BOOL enable);
+
+    virtual status_t getGraphicBufferUsage(
+            node_id node, OMX_U32 port_index, OMX_U32* usage);
+
+    virtual status_t useBuffer(
+            node_id node, OMX_U32 port_index, const sp<IMemory> &params,
+            buffer_id *buffer);
+
+    virtual status_t useGraphicBuffer(
+            node_id node, OMX_U32 port_index,
+            const sp<GraphicBuffer> &graphicBuffer, buffer_id *buffer);
+
+    virtual status_t allocateBuffer(
+            node_id node, OMX_U32 port_index, size_t size,
+            buffer_id *buffer, void **buffer_data);
+
+    virtual status_t allocateBufferWithBackup(
+            node_id node, OMX_U32 port_index, const sp<IMemory> &params,
+            buffer_id *buffer);
+
+    virtual status_t freeBuffer(
+            node_id node, OMX_U32 port_index, buffer_id buffer);
+
+    virtual status_t fillBuffer(node_id node, buffer_id buffer);
+
+    virtual status_t emptyBuffer(
+            node_id node,
+            buffer_id buffer,
+            OMX_U32 range_offset, OMX_U32 range_length,
+            OMX_U32 flags, OMX_TICKS timestamp);
+
+    virtual status_t getExtensionIndex(
+            node_id node,
+            const char *parameter_name,
+            OMX_INDEXTYPE *index);
+
+private:
+    mutable Mutex mLock;
+
+    sp<IOMX> mRemoteOMX;
+    sp<IOMX> mLocalOMX;
+
+    KeyedVector<node_id, bool> mIsLocalNode;
+
+    bool isLocalNode(node_id node) const;
+    bool isLocalNode_l(node_id node) const;
+    const sp<IOMX> &getOMX(node_id node) const;
+    const sp<IOMX> &getOMX_l(node_id node) const;
+
+    static bool IsSoftwareComponent(const char *name);
+
+    DISALLOW_EVIL_CONSTRUCTORS(MuxOMX);
+};
+
+MuxOMX::MuxOMX(const sp<IOMX> &remoteOMX)
+    : mRemoteOMX(remoteOMX) {
+}
+
+MuxOMX::~MuxOMX() {
+}
+
+bool MuxOMX::isLocalNode(node_id node) const {
+    Mutex::Autolock autoLock(mLock);
+
+    return isLocalNode_l(node);
+}
+
+bool MuxOMX::isLocalNode_l(node_id node) const {
+    return mIsLocalNode.indexOfKey(node) >= 0;
+}
+
+// static
+bool MuxOMX::IsSoftwareComponent(const char *name) {
+    return !strncasecmp(name, "OMX.google.", 11);
+}
+
+const sp<IOMX> &MuxOMX::getOMX(node_id node) const {
+    return isLocalNode(node) ? mLocalOMX : mRemoteOMX;
+}
+
+const sp<IOMX> &MuxOMX::getOMX_l(node_id node) const {
+    return isLocalNode_l(node) ? mLocalOMX : mRemoteOMX;
+}
+
+bool MuxOMX::livesLocally(node_id node, pid_t pid) {
+    return getOMX(node)->livesLocally(node, pid);
+}
+
+status_t MuxOMX::listNodes(List<ComponentInfo> *list) {
+    Mutex::Autolock autoLock(mLock);
+
+    if (mLocalOMX == NULL) {
+        mLocalOMX = new OMX;
+    }
+
+    return mLocalOMX->listNodes(list);
+}
+
+status_t MuxOMX::allocateNode(
+        const char *name, const sp<IOMXObserver> &observer,
+        node_id *node) {
+    Mutex::Autolock autoLock(mLock);
+
+    sp<IOMX> omx;
+
+    if (IsSoftwareComponent(name)) {
+        if (mLocalOMX == NULL) {
+            mLocalOMX = new OMX;
+        }
+        omx = mLocalOMX;
+    } else {
+        omx = mRemoteOMX;
+    }
+
+    status_t err = omx->allocateNode(name, observer, node);
+
+    if (err != OK) {
+        return err;
+    }
+
+    if (omx == mLocalOMX) {
+        mIsLocalNode.add(*node, true);
+    }
+
+    return OK;
+}
+
+status_t MuxOMX::freeNode(node_id node) {
+    Mutex::Autolock autoLock(mLock);
+
+    status_t err = getOMX_l(node)->freeNode(node);
+
+    if (err != OK) {
+        return err;
+    }
+
+    mIsLocalNode.removeItem(node);
+
+    return OK;
+}
+
+status_t MuxOMX::sendCommand(
+        node_id node, OMX_COMMANDTYPE cmd, OMX_S32 param) {
+    return getOMX(node)->sendCommand(node, cmd, param);
+}
+
+status_t MuxOMX::getParameter(
+        node_id node, OMX_INDEXTYPE index,
+        void *params, size_t size) {
+    return getOMX(node)->getParameter(node, index, params, size);
+}
+
+status_t MuxOMX::setParameter(
+        node_id node, OMX_INDEXTYPE index,
+        const void *params, size_t size) {
+    return getOMX(node)->setParameter(node, index, params, size);
+}
+
+status_t MuxOMX::getConfig(
+        node_id node, OMX_INDEXTYPE index,
+        void *params, size_t size) {
+    return getOMX(node)->getConfig(node, index, params, size);
+}
+
+status_t MuxOMX::setConfig(
+        node_id node, OMX_INDEXTYPE index,
+        const void *params, size_t size) {
+    return getOMX(node)->setConfig(node, index, params, size);
+}
+
+status_t MuxOMX::getState(
+        node_id node, OMX_STATETYPE* state) {
+    return getOMX(node)->getState(node, state);
+}
+
+status_t MuxOMX::storeMetaDataInBuffers(
+        node_id node, OMX_U32 port_index, OMX_BOOL enable) {
+    return getOMX(node)->storeMetaDataInBuffers(node, port_index, enable);
+}
+
+status_t MuxOMX::enableGraphicBuffers(
+        node_id node, OMX_U32 port_index, OMX_BOOL enable) {
+    return getOMX(node)->enableGraphicBuffers(node, port_index, enable);
+}
+
+status_t MuxOMX::getGraphicBufferUsage(
+        node_id node, OMX_U32 port_index, OMX_U32* usage) {
+    return getOMX(node)->getGraphicBufferUsage(node, port_index, usage);
+}
+
+status_t MuxOMX::useBuffer(
+        node_id node, OMX_U32 port_index, const sp<IMemory> &params,
+        buffer_id *buffer) {
+    return getOMX(node)->useBuffer(node, port_index, params, buffer);
+}
+
+status_t MuxOMX::useGraphicBuffer(
+        node_id node, OMX_U32 port_index,
+        const sp<GraphicBuffer> &graphicBuffer, buffer_id *buffer) {
+    return getOMX(node)->useGraphicBuffer(
+            node, port_index, graphicBuffer, buffer);
+}
+
+status_t MuxOMX::allocateBuffer(
+        node_id node, OMX_U32 port_index, size_t size,
+        buffer_id *buffer, void **buffer_data) {
+    return getOMX(node)->allocateBuffer(
+            node, port_index, size, buffer, buffer_data);
+}
+
+status_t MuxOMX::allocateBufferWithBackup(
+        node_id node, OMX_U32 port_index, const sp<IMemory> &params,
+        buffer_id *buffer) {
+    return getOMX(node)->allocateBufferWithBackup(
+            node, port_index, params, buffer);
+}
+
+status_t MuxOMX::freeBuffer(
+        node_id node, OMX_U32 port_index, buffer_id buffer) {
+    return getOMX(node)->freeBuffer(node, port_index, buffer);
+}
+
+status_t MuxOMX::fillBuffer(node_id node, buffer_id buffer) {
+    return getOMX(node)->fillBuffer(node, buffer);
+}
+
+status_t MuxOMX::emptyBuffer(
+        node_id node,
+        buffer_id buffer,
+        OMX_U32 range_offset, OMX_U32 range_length,
+        OMX_U32 flags, OMX_TICKS timestamp) {
+    return getOMX(node)->emptyBuffer(
+            node, buffer, range_offset, range_length, flags, timestamp);
+}
+
+status_t MuxOMX::getExtensionIndex(
+        node_id node,
+        const char *parameter_name,
+        OMX_INDEXTYPE *index) {
+    return getOMX(node)->getExtensionIndex(node, parameter_name, index);
+}
+
 OMXClient::OMXClient() {
 }
 
@@ -38,6 +326,11 @@
     mOMX = service->getOMX();
     CHECK(mOMX.get() != NULL);
 
+    if (!mOMX->livesLocally(NULL /* node */, getpid())) {
+        ALOGI("Using client-side OMX mux.");
+        mOMX = new MuxOMX(mOMX);
+    }
+
     return OK;
 }
 
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 60d9bb7..381320b 100755
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -19,8 +19,6 @@
 #include <utils/Log.h>
 
 #include "include/AACEncoder.h"
-#include "include/AMRNBEncoder.h"
-#include "include/AMRWBEncoder.h"
 #include "include/AVCEncoder.h"
 #include "include/M4vH263Encoder.h"
 
@@ -71,8 +69,6 @@
 
 #define FACTORY_REF(name) { #name, Make##name },
 
-FACTORY_CREATE_ENCODER(AMRNBEncoder)
-FACTORY_CREATE_ENCODER(AMRWBEncoder)
 FACTORY_CREATE_ENCODER(AACEncoder)
 FACTORY_CREATE_ENCODER(AVCEncoder)
 FACTORY_CREATE_ENCODER(M4vH263Encoder)
@@ -86,8 +82,6 @@
     };
 
     static const FactoryInfo kFactoryInfo[] = {
-        FACTORY_REF(AMRNBEncoder)
-        FACTORY_REF(AMRWBEncoder)
         FACTORY_REF(AACEncoder)
         FACTORY_REF(AVCEncoder)
         FACTORY_REF(M4vH263Encoder)
@@ -149,10 +143,11 @@
 
 static const CodecInfo kEncoderInfo[] = {
     { MEDIA_MIMETYPE_AUDIO_AMR_NB, "OMX.TI.AMR.encode" },
-    { MEDIA_MIMETYPE_AUDIO_AMR_NB, "AMRNBEncoder" },
+    { MEDIA_MIMETYPE_AUDIO_AMR_NB, "OMX.google.amrnb.encoder" },
     { MEDIA_MIMETYPE_AUDIO_AMR_WB, "OMX.TI.WBAMR.encode" },
-    { MEDIA_MIMETYPE_AUDIO_AMR_WB, "AMRWBEncoder" },
+    { MEDIA_MIMETYPE_AUDIO_AMR_WB, "OMX.google.amrwb.encoder" },
     { MEDIA_MIMETYPE_AUDIO_AAC, "OMX.TI.AAC.encode" },
+    { MEDIA_MIMETYPE_AUDIO_AAC, "OMX.google.aac.encoder" },
     { MEDIA_MIMETYPE_AUDIO_AAC, "AACEncoder" },
     { MEDIA_MIMETYPE_VIDEO_MPEG4, "OMX.TI.DUCATI1.VIDEO.MPEG4E" },
     { MEDIA_MIMETYPE_VIDEO_MPEG4, "OMX.qcom.7x30.video.encoder.mpeg4" },
@@ -1482,11 +1477,12 @@
         const sp<MediaSource> &source,
         const sp<ANativeWindow> &nativeWindow)
     : mOMX(omx),
-      mOMXLivesLocally(omx->livesLocally(getpid())),
+      mOMXLivesLocally(omx->livesLocally(node, getpid())),
       mNode(node),
       mQuirks(quirks),
       mFlags(flags),
       mIsEncoder(isEncoder),
+      mIsVideo(!strncasecmp("video/", mime, 6)),
       mMIME(strdup(mime)),
       mComponentName(strdup(componentName)),
       mSource(source),
@@ -2192,7 +2188,7 @@
 }
 
 int64_t OMXCodec::retrieveDecodingTimeUs(bool isCodecSpecific) {
-    CHECK(mIsEncoder);
+    CHECK(mIsEncoder && mIsVideo);
 
     if (mDecodingTimeList.empty()) {
         CHECK(mSignalledEOS || mNoMoreOutputData);
@@ -2387,7 +2383,7 @@
                     mNoMoreOutputData = true;
                 }
 
-                if (mIsEncoder) {
+                if (mIsEncoder && mIsVideo) {
                     int64_t decodingTimeUs = retrieveDecodingTimeUs(isCodecSpecific);
                     buffer->meta_data()->setInt64(kKeyDecodingTime, decodingTimeUs);
                 }
@@ -3249,7 +3245,7 @@
         int64_t lastBufferTimeUs;
         CHECK(srcBuffer->meta_data()->findInt64(kKeyTime, &lastBufferTimeUs));
         CHECK(lastBufferTimeUs >= 0);
-        if (mIsEncoder) {
+        if (mIsEncoder && mIsVideo) {
             mDecodingTimeList.push_back(lastBufferTimeUs);
         }
 
diff --git a/media/libstagefright/SurfaceMediaSource.cpp b/media/libstagefright/SurfaceMediaSource.cpp
index 2233d1b..d068381 100644
--- a/media/libstagefright/SurfaceMediaSource.cpp
+++ b/media/libstagefright/SurfaceMediaSource.cpp
@@ -60,7 +60,7 @@
 SurfaceMediaSource::~SurfaceMediaSource() {
     ALOGV("SurfaceMediaSource::~SurfaceMediaSource");
     if (!mStopped) {
-        stop();
+        reset();
     }
 }
 
@@ -716,9 +716,9 @@
 }
 
 
-status_t SurfaceMediaSource::stop()
+status_t SurfaceMediaSource::reset()
 {
-    ALOGV("Stop");
+    ALOGV("Reset");
 
     Mutex::Autolock lock(mMutex);
     // TODO: Add waiting on mFrameCompletedCondition here?
diff --git a/media/libstagefright/WVMExtractor.cpp b/media/libstagefright/WVMExtractor.cpp
index 2092cb6..1e4e049 100644
--- a/media/libstagefright/WVMExtractor.cpp
+++ b/media/libstagefright/WVMExtractor.cpp
@@ -45,17 +45,12 @@
 static Mutex gWVMutex;
 
 WVMExtractor::WVMExtractor(const sp<DataSource> &source)
-    : mDataSource(source) {
-    {
-        Mutex::Autolock autoLock(gWVMutex);
-        if (gVendorLibHandle == NULL) {
-            gVendorLibHandle = dlopen("libwvm.so", RTLD_NOW);
-        }
+    : mDataSource(source)
+{
+    Mutex::Autolock autoLock(gWVMutex);
 
-        if (gVendorLibHandle == NULL) {
-            ALOGE("Failed to open libwvm.so");
-            return;
-        }
+    if (!getVendorLibHandle()) {
+        return;
     }
 
     typedef WVMLoadableExtractor *(*GetInstanceFunc)(sp<DataSource>);
@@ -64,13 +59,28 @@
                 "_ZN7android11GetInstanceENS_2spINS_10DataSourceEEE");
 
     if (getInstanceFunc) {
+        CHECK(source->DrmInitialization(MEDIA_MIMETYPE_CONTAINER_WVM) != NULL);
         mImpl = (*getInstanceFunc)(source);
         CHECK(mImpl != NULL);
+        setDrmFlag(true);
     } else {
         ALOGE("Failed to locate GetInstance in libwvm.so");
     }
 }
 
+bool WVMExtractor::getVendorLibHandle()
+{
+    if (gVendorLibHandle == NULL) {
+        gVendorLibHandle = dlopen("libwvm.so", RTLD_NOW);
+    }
+
+    if (gVendorLibHandle == NULL) {
+        ALOGE("Failed to open libwvm.so");
+    }
+
+    return gVendorLibHandle != NULL;
+}
+
 WVMExtractor::~WVMExtractor() {
 }
 
@@ -113,5 +123,33 @@
     }
 }
 
+bool SniffWVM(
+    const sp<DataSource> &source, String8 *mimeType, float *confidence,
+        sp<AMessage> *) {
+
+    Mutex::Autolock autoLock(gWVMutex);
+
+    if (!WVMExtractor::getVendorLibHandle()) {
+        return false;
+    }
+
+    typedef WVMLoadableExtractor *(*SnifferFunc)(const sp<DataSource>&);
+    SnifferFunc snifferFunc =
+        (SnifferFunc) dlsym(gVendorLibHandle,
+                            "_ZN7android15IsWidevineMediaERKNS_2spINS_10DataSourceEEE");
+
+    if (snifferFunc) {
+        if ((*snifferFunc)(source)) {
+            *mimeType = MEDIA_MIMETYPE_CONTAINER_WVM;
+            *confidence = 10.0f;
+            return true;
+        }
+    } else {
+        ALOGE("IsWidevineMedia not found in libwvm.so");
+    }
+
+    return false;
+}
+
 } //namespace android
 
diff --git a/media/libstagefright/chromium_http/ChromiumHTTPDataSource.cpp b/media/libstagefright/chromium_http/ChromiumHTTPDataSource.cpp
index 180460b..76f7946 100644
--- a/media/libstagefright/chromium_http/ChromiumHTTPDataSource.cpp
+++ b/media/libstagefright/chromium_http/ChromiumHTTPDataSource.cpp
@@ -259,7 +259,7 @@
     mCondition.broadcast();
 }
 
-sp<DecryptHandle> ChromiumHTTPDataSource::DrmInitialization() {
+sp<DecryptHandle> ChromiumHTTPDataSource::DrmInitialization(const char* mime) {
     Mutex::Autolock autoLock(mLock);
 
     if (mDrmManagerClient == NULL) {
@@ -275,7 +275,7 @@
          * original one
          */
         mDecryptHandle = mDrmManagerClient->openDecryptSession(
-                String8(mURI.c_str()));
+                String8(mURI.c_str()), mime);
     }
 
     if (mDecryptHandle == NULL) {
diff --git a/media/libstagefright/codecs/aacdec/SoftAAC.cpp b/media/libstagefright/codecs/aacdec/SoftAAC.cpp
index da9d280..ea6c360 100644
--- a/media/libstagefright/codecs/aacdec/SoftAAC.cpp
+++ b/media/libstagefright/codecs/aacdec/SoftAAC.cpp
@@ -218,6 +218,18 @@
             return OMX_ErrorNone;
         }
 
+        case OMX_IndexParamAudioPcm:
+        {
+            const OMX_AUDIO_PARAM_PCMMODETYPE *pcmParams =
+                (OMX_AUDIO_PARAM_PCMMODETYPE *)params;
+
+            if (pcmParams->nPortIndex != 1) {
+                return OMX_ErrorUndefined;
+            }
+
+            return OMX_ErrorNone;
+        }
+
         default:
             return SimpleSoftOMXComponent::internalSetParameter(index, params);
     }
diff --git a/media/libstagefright/codecs/aacenc/Android.mk b/media/libstagefright/codecs/aacenc/Android.mk
index f9cc6a3..34a2796 100644
--- a/media/libstagefright/codecs/aacenc/Android.mk
+++ b/media/libstagefright/codecs/aacenc/Android.mk
@@ -59,7 +59,7 @@
 
 LOCAL_ARM_MODE := arm
 
-LOCAL_STATIC_LIBRARIES := 
+LOCAL_STATIC_LIBRARIES :=
 
 LOCAL_SHARED_LIBRARIES :=
 
@@ -85,3 +85,29 @@
 endif
 
 include $(BUILD_STATIC_LIBRARY)
+
+################################################################################
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+        SoftAACEncoder.cpp
+
+LOCAL_C_INCLUDES := \
+        frameworks/base/media/libstagefright/include \
+        frameworks/base/include/media/stagefright/openmax \
+	frameworks/base/media/libstagefright/codecs/common/include \
+
+LOCAL_CFLAGS := -DOSCL_IMPORT_REF=
+
+LOCAL_STATIC_LIBRARIES := \
+        libstagefright_aacenc
+
+LOCAL_SHARED_LIBRARIES := \
+        libstagefright_omx libstagefright_foundation libutils \
+        libstagefright_enc_common
+
+LOCAL_MODULE := libstagefright_soft_aacenc
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/media/libstagefright/codecs/aacenc/SampleCode/AAC_E_SAMPLES.c b/media/libstagefright/codecs/aacenc/SampleCode/AAC_E_SAMPLES.c
index 2ea9449..2f31de4 100644
--- a/media/libstagefright/codecs/aacenc/SampleCode/AAC_E_SAMPLES.c
+++ b/media/libstagefright/codecs/aacenc/SampleCode/AAC_E_SAMPLES.c
@@ -29,11 +29,11 @@
 #include		"cmnMemory.h"
 
 #define  VO_AAC_E_OUTPUT	  1
-#define READ_SIZE	(1024*8)	
+#define READ_SIZE	(1024*8)
 unsigned char outBuf[1024*8];
 unsigned char inBuf[READ_SIZE];
 
-const char* HelpString = 
+const char* HelpString =
 "VisualOn AAC encoder Usage:\n"
 "voAACEncTest -if <inputfile.pcm> -of <outputfile.aac> -sr <samplerate> -ch <channel> -br <bitrate> -adts <adts> \n"
 "-if input file name \n"
@@ -49,7 +49,7 @@
 {
 	// notice that:
 	// bitRate/nChannels > 8000
-	// bitRate/nChannels < 160000 
+	// bitRate/nChannels < 160000
 	// bitRate/nChannels < sampleRate*6
 	param->adtsUsed = 1;
 	param->bitRate = 0;
@@ -69,7 +69,7 @@
 		{
 			argv++;
 			argc--;
-			*input_filename = *argv; 
+			*input_filename = *argv;
 		}
 		else if (!strcmp(*argv, "-of"))
 		{
diff --git a/media/libstagefright/codecs/aacenc/SoftAACEncoder.cpp b/media/libstagefright/codecs/aacenc/SoftAACEncoder.cpp
new file mode 100644
index 0000000..c6724c26
--- /dev/null
+++ b/media/libstagefright/codecs/aacenc/SoftAACEncoder.cpp
@@ -0,0 +1,560 @@
+/*
+ * 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.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "SoftAACEncoder"
+#include <utils/Log.h>
+
+#include "SoftAACEncoder.h"
+
+#include "voAAC.h"
+#include "cmnMemory.h"
+
+#include <media/stagefright/foundation/ADebug.h>
+#include <media/stagefright/foundation/hexdump.h>
+
+namespace android {
+
+template<class T>
+static void InitOMXParams(T *params) {
+    params->nSize = sizeof(T);
+    params->nVersion.s.nVersionMajor = 1;
+    params->nVersion.s.nVersionMinor = 0;
+    params->nVersion.s.nRevision = 0;
+    params->nVersion.s.nStep = 0;
+}
+
+SoftAACEncoder::SoftAACEncoder(
+        const char *name,
+        const OMX_CALLBACKTYPE *callbacks,
+        OMX_PTR appData,
+        OMX_COMPONENTTYPE **component)
+    : SimpleSoftOMXComponent(name, callbacks, appData, component),
+      mEncoderHandle(NULL),
+      mApiHandle(NULL),
+      mMemOperator(NULL),
+      mNumChannels(1),
+      mSampleRate(44100),
+      mBitRate(0),
+      mSentCodecSpecificData(false),
+      mInputSize(0),
+      mInputFrame(NULL),
+      mInputTimeUs(-1ll),
+      mSawInputEOS(false),
+      mSignalledError(false) {
+    initPorts();
+    CHECK_EQ(initEncoder(), (status_t)OK);
+
+    setAudioParams();
+}
+
+SoftAACEncoder::~SoftAACEncoder() {
+    delete[] mInputFrame;
+    mInputFrame = NULL;
+
+    if (mEncoderHandle) {
+        CHECK_EQ(VO_ERR_NONE, mApiHandle->Uninit(mEncoderHandle));
+        mEncoderHandle = NULL;
+    }
+
+    delete mApiHandle;
+    mApiHandle = NULL;
+
+    delete mMemOperator;
+    mMemOperator = NULL;
+}
+
+void SoftAACEncoder::initPorts() {
+    OMX_PARAM_PORTDEFINITIONTYPE def;
+    InitOMXParams(&def);
+
+    def.nPortIndex = 0;
+    def.eDir = OMX_DirInput;
+    def.nBufferCountMin = kNumBuffers;
+    def.nBufferCountActual = def.nBufferCountMin;
+    def.nBufferSize = kNumSamplesPerFrame * sizeof(int16_t) * 2;
+    def.bEnabled = OMX_TRUE;
+    def.bPopulated = OMX_FALSE;
+    def.eDomain = OMX_PortDomainAudio;
+    def.bBuffersContiguous = OMX_FALSE;
+    def.nBufferAlignment = 1;
+
+    def.format.audio.cMIMEType = const_cast<char *>("audio/raw");
+    def.format.audio.pNativeRender = NULL;
+    def.format.audio.bFlagErrorConcealment = OMX_FALSE;
+    def.format.audio.eEncoding = OMX_AUDIO_CodingPCM;
+
+    addPort(def);
+
+    def.nPortIndex = 1;
+    def.eDir = OMX_DirOutput;
+    def.nBufferCountMin = kNumBuffers;
+    def.nBufferCountActual = def.nBufferCountMin;
+    def.nBufferSize = 8192;
+    def.bEnabled = OMX_TRUE;
+    def.bPopulated = OMX_FALSE;
+    def.eDomain = OMX_PortDomainAudio;
+    def.bBuffersContiguous = OMX_FALSE;
+    def.nBufferAlignment = 2;
+
+    def.format.audio.cMIMEType = const_cast<char *>("audio/aac");
+    def.format.audio.pNativeRender = NULL;
+    def.format.audio.bFlagErrorConcealment = OMX_FALSE;
+    def.format.audio.eEncoding = OMX_AUDIO_CodingAAC;
+
+    addPort(def);
+}
+
+status_t SoftAACEncoder::initEncoder() {
+    mApiHandle = new VO_AUDIO_CODECAPI;
+
+    if (VO_ERR_NONE != voGetAACEncAPI(mApiHandle)) {
+        ALOGE("Failed to get api handle");
+        return UNKNOWN_ERROR;
+    }
+
+    mMemOperator = new VO_MEM_OPERATOR;
+    mMemOperator->Alloc = cmnMemAlloc;
+    mMemOperator->Copy = cmnMemCopy;
+    mMemOperator->Free = cmnMemFree;
+    mMemOperator->Set = cmnMemSet;
+    mMemOperator->Check = cmnMemCheck;
+
+    VO_CODEC_INIT_USERDATA userData;
+    memset(&userData, 0, sizeof(userData));
+    userData.memflag = VO_IMF_USERMEMOPERATOR;
+    userData.memData = (VO_PTR) mMemOperator;
+    if (VO_ERR_NONE !=
+            mApiHandle->Init(&mEncoderHandle, VO_AUDIO_CodingAAC, &userData)) {
+        ALOGE("Failed to init AAC encoder");
+        return UNKNOWN_ERROR;
+    }
+
+    return OK;
+}
+
+OMX_ERRORTYPE SoftAACEncoder::internalGetParameter(
+        OMX_INDEXTYPE index, OMX_PTR params) {
+    switch (index) {
+        case OMX_IndexParamAudioPortFormat:
+        {
+            OMX_AUDIO_PARAM_PORTFORMATTYPE *formatParams =
+                (OMX_AUDIO_PARAM_PORTFORMATTYPE *)params;
+
+            if (formatParams->nPortIndex > 1) {
+                return OMX_ErrorUndefined;
+            }
+
+            if (formatParams->nIndex > 0) {
+                return OMX_ErrorNoMore;
+            }
+
+            formatParams->eEncoding =
+                (formatParams->nPortIndex == 0)
+                    ? OMX_AUDIO_CodingPCM : OMX_AUDIO_CodingAAC;
+
+            return OMX_ErrorNone;
+        }
+
+        case OMX_IndexParamAudioAac:
+        {
+            OMX_AUDIO_PARAM_AACPROFILETYPE *aacParams =
+                (OMX_AUDIO_PARAM_AACPROFILETYPE *)params;
+
+            if (aacParams->nPortIndex != 1) {
+                return OMX_ErrorUndefined;
+            }
+
+            aacParams->nBitRate = mBitRate;
+            aacParams->nAudioBandWidth = 0;
+            aacParams->nAACtools = 0;
+            aacParams->nAACERtools = 0;
+            aacParams->eAACProfile = OMX_AUDIO_AACObjectMain;
+            aacParams->eAACStreamFormat = OMX_AUDIO_AACStreamFormatMP4FF;
+            aacParams->eChannelMode = OMX_AUDIO_ChannelModeStereo;
+
+            aacParams->nChannels = mNumChannels;
+            aacParams->nSampleRate = mSampleRate;
+            aacParams->nFrameLength = 0;
+
+            return OMX_ErrorNone;
+        }
+
+        case OMX_IndexParamAudioPcm:
+        {
+            OMX_AUDIO_PARAM_PCMMODETYPE *pcmParams =
+                (OMX_AUDIO_PARAM_PCMMODETYPE *)params;
+
+            if (pcmParams->nPortIndex != 0) {
+                return OMX_ErrorUndefined;
+            }
+
+            pcmParams->eNumData = OMX_NumericalDataSigned;
+            pcmParams->eEndian = OMX_EndianBig;
+            pcmParams->bInterleaved = OMX_TRUE;
+            pcmParams->nBitPerSample = 16;
+            pcmParams->ePCMMode = OMX_AUDIO_PCMModeLinear;
+            pcmParams->eChannelMapping[0] = OMX_AUDIO_ChannelLF;
+            pcmParams->eChannelMapping[1] = OMX_AUDIO_ChannelRF;
+
+            pcmParams->nChannels = mNumChannels;
+            pcmParams->nSamplingRate = mSampleRate;
+
+            return OMX_ErrorNone;
+        }
+
+        default:
+            return SimpleSoftOMXComponent::internalGetParameter(index, params);
+    }
+}
+
+OMX_ERRORTYPE SoftAACEncoder::internalSetParameter(
+        OMX_INDEXTYPE index, const OMX_PTR params) {
+    switch (index) {
+        case OMX_IndexParamStandardComponentRole:
+        {
+            const OMX_PARAM_COMPONENTROLETYPE *roleParams =
+                (const OMX_PARAM_COMPONENTROLETYPE *)params;
+
+            if (strncmp((const char *)roleParams->cRole,
+                        "audio_encoder.aac",
+                        OMX_MAX_STRINGNAME_SIZE - 1)) {
+                return OMX_ErrorUndefined;
+            }
+
+            return OMX_ErrorNone;
+        }
+
+        case OMX_IndexParamAudioPortFormat:
+        {
+            const OMX_AUDIO_PARAM_PORTFORMATTYPE *formatParams =
+                (const OMX_AUDIO_PARAM_PORTFORMATTYPE *)params;
+
+            if (formatParams->nPortIndex > 1) {
+                return OMX_ErrorUndefined;
+            }
+
+            if (formatParams->nIndex > 0) {
+                return OMX_ErrorNoMore;
+            }
+
+            if ((formatParams->nPortIndex == 0
+                        && formatParams->eEncoding != OMX_AUDIO_CodingPCM)
+                || (formatParams->nPortIndex == 1
+                        && formatParams->eEncoding != OMX_AUDIO_CodingAAC)) {
+                return OMX_ErrorUndefined;
+            }
+
+            return OMX_ErrorNone;
+        }
+
+        case OMX_IndexParamAudioAac:
+        {
+            OMX_AUDIO_PARAM_AACPROFILETYPE *aacParams =
+                (OMX_AUDIO_PARAM_AACPROFILETYPE *)params;
+
+            if (aacParams->nPortIndex != 1) {
+                return OMX_ErrorUndefined;
+            }
+
+            mBitRate = aacParams->nBitRate;
+            mNumChannels = aacParams->nChannels;
+            mSampleRate = aacParams->nSampleRate;
+
+            if (setAudioParams() != OK) {
+                return OMX_ErrorUndefined;
+            }
+
+            return OMX_ErrorNone;
+        }
+
+        case OMX_IndexParamAudioPcm:
+        {
+            OMX_AUDIO_PARAM_PCMMODETYPE *pcmParams =
+                (OMX_AUDIO_PARAM_PCMMODETYPE *)params;
+
+            if (pcmParams->nPortIndex != 0) {
+                return OMX_ErrorUndefined;
+            }
+
+            mNumChannels = pcmParams->nChannels;
+            mSampleRate = pcmParams->nSamplingRate;
+
+            if (setAudioParams() != OK) {
+                return OMX_ErrorUndefined;
+            }
+
+            return OMX_ErrorNone;
+        }
+
+
+        default:
+            return SimpleSoftOMXComponent::internalSetParameter(index, params);
+    }
+}
+
+status_t SoftAACEncoder::setAudioParams() {
+    // We call this whenever sample rate, number of channels or bitrate change
+    // in reponse to setParameter calls.
+
+    ALOGV("setAudioParams: %lu Hz, %lu channels, %lu bps",
+         mSampleRate, mNumChannels, mBitRate);
+
+    status_t err = setAudioSpecificConfigData();
+
+    if (err != OK) {
+        return err;
+    }
+
+    AACENC_PARAM params;
+    memset(&params, 0, sizeof(params));
+    params.sampleRate = mSampleRate;
+    params.bitRate = mBitRate;
+    params.nChannels = mNumChannels;
+    params.adtsUsed = 0;  // We add adts header in the file writer if needed.
+    if (VO_ERR_NONE != mApiHandle->SetParam(
+                mEncoderHandle, VO_PID_AAC_ENCPARAM,  &params)) {
+        ALOGE("Failed to set AAC encoder parameters");
+        return UNKNOWN_ERROR;
+    }
+
+    return OK;
+}
+
+static status_t getSampleRateTableIndex(int32_t sampleRate, int32_t &index) {
+    static const int32_t kSampleRateTable[] = {
+        96000, 88200, 64000, 48000, 44100, 32000,
+        24000, 22050, 16000, 12000, 11025, 8000
+    };
+    const int32_t tableSize =
+        sizeof(kSampleRateTable) / sizeof(kSampleRateTable[0]);
+
+    for (int32_t i = 0; i < tableSize; ++i) {
+        if (sampleRate == kSampleRateTable[i]) {
+            index = i;
+            return OK;
+        }
+    }
+
+    return UNKNOWN_ERROR;
+}
+
+status_t SoftAACEncoder::setAudioSpecificConfigData() {
+    // The AAC encoder's audio specific config really only encodes
+    // number of channels and the sample rate (mapped to an index into
+    // a fixed sample rate table).
+
+    int32_t index;
+    status_t err = getSampleRateTableIndex(mSampleRate, index);
+    if (err != OK) {
+        ALOGE("Unsupported sample rate (%lu Hz)", mSampleRate);
+        return err;
+    }
+
+    if (mNumChannels > 2 || mNumChannels <= 0) {
+        ALOGE("Unsupported number of channels(%lu)", mNumChannels);
+        return UNKNOWN_ERROR;
+    }
+
+    // OMX_AUDIO_AACObjectLC
+    mAudioSpecificConfigData[0] = ((0x02 << 3) | (index >> 1));
+    mAudioSpecificConfigData[1] = ((index & 0x01) << 7) | (mNumChannels << 3);
+
+    return OK;
+}
+
+void SoftAACEncoder::onQueueFilled(OMX_U32 portIndex) {
+    if (mSignalledError) {
+        return;
+    }
+
+    List<BufferInfo *> &inQueue = getPortQueue(0);
+    List<BufferInfo *> &outQueue = getPortQueue(1);
+
+    if (!mSentCodecSpecificData) {
+        // The very first thing we want to output is the codec specific
+        // data. It does not require any input data but we will need an
+        // output buffer to store it in.
+
+        if (outQueue.empty()) {
+            return;
+        }
+
+        BufferInfo *outInfo = *outQueue.begin();
+        OMX_BUFFERHEADERTYPE *outHeader = outInfo->mHeader;
+        outHeader->nFilledLen = sizeof(mAudioSpecificConfigData);
+        outHeader->nFlags = OMX_BUFFERFLAG_CODECCONFIG;
+
+        uint8_t *out = outHeader->pBuffer + outHeader->nOffset;
+        memcpy(out, mAudioSpecificConfigData, sizeof(mAudioSpecificConfigData));
+
+#if 0
+        ALOGI("sending codec specific data.");
+        hexdump(out, sizeof(mAudioSpecificConfigData));
+#endif
+
+        outQueue.erase(outQueue.begin());
+        outInfo->mOwnedByUs = false;
+        notifyFillBufferDone(outHeader);
+
+        mSentCodecSpecificData = true;
+    }
+
+    size_t numBytesPerInputFrame =
+        mNumChannels * kNumSamplesPerFrame * sizeof(int16_t);
+
+    for (;;) {
+        // We do the following until we run out of buffers.
+
+        while (mInputSize < numBytesPerInputFrame) {
+            // As long as there's still input data to be read we
+            // will drain "kNumSamplesPerFrame * mNumChannels" samples
+            // into the "mInputFrame" buffer and then encode those
+            // as a unit into an output buffer.
+
+            if (mSawInputEOS || inQueue.empty()) {
+                return;
+            }
+
+            BufferInfo *inInfo = *inQueue.begin();
+            OMX_BUFFERHEADERTYPE *inHeader = inInfo->mHeader;
+
+            const void *inData = inHeader->pBuffer + inHeader->nOffset;
+
+            size_t copy = numBytesPerInputFrame - mInputSize;
+            if (copy > inHeader->nFilledLen) {
+                copy = inHeader->nFilledLen;
+            }
+
+            if (mInputFrame == NULL) {
+                mInputFrame = new int16_t[kNumSamplesPerFrame * mNumChannels];
+            }
+
+            if (mInputSize == 0) {
+                mInputTimeUs = inHeader->nTimeStamp;
+            }
+
+            memcpy((uint8_t *)mInputFrame + mInputSize, inData, copy);
+            mInputSize += copy;
+
+            inHeader->nOffset += copy;
+            inHeader->nFilledLen -= copy;
+
+            // "Time" on the input buffer has in effect advanced by the
+            // number of audio frames we just advanced nOffset by.
+            inHeader->nTimeStamp +=
+                (copy * 1000000ll / mSampleRate)
+                    / (mNumChannels * sizeof(int16_t));
+
+            if (inHeader->nFilledLen == 0) {
+                if (inHeader->nFlags & OMX_BUFFERFLAG_EOS) {
+                    ALOGV("saw input EOS");
+                    mSawInputEOS = true;
+
+                    // Pad any remaining data with zeroes.
+                    memset((uint8_t *)mInputFrame + mInputSize,
+                           0,
+                           numBytesPerInputFrame - mInputSize);
+
+                    mInputSize = numBytesPerInputFrame;
+                }
+
+                inQueue.erase(inQueue.begin());
+                inInfo->mOwnedByUs = false;
+                notifyEmptyBufferDone(inHeader);
+
+                inData = NULL;
+                inHeader = NULL;
+                inInfo = NULL;
+            }
+        }
+
+        // At this  point we have all the input data necessary to encode
+        // a single frame, all we need is an output buffer to store the result
+        // in.
+
+        if (outQueue.empty()) {
+            return;
+        }
+
+        BufferInfo *outInfo = *outQueue.begin();
+        OMX_BUFFERHEADERTYPE *outHeader = outInfo->mHeader;
+
+        VO_CODECBUFFER inputData;
+        memset(&inputData, 0, sizeof(inputData));
+        inputData.Buffer = (unsigned char *)mInputFrame;
+        inputData.Length = numBytesPerInputFrame;
+        CHECK(VO_ERR_NONE ==
+                mApiHandle->SetInputData(mEncoderHandle, &inputData));
+
+        VO_CODECBUFFER outputData;
+        memset(&outputData, 0, sizeof(outputData));
+        VO_AUDIO_OUTPUTINFO outputInfo;
+        memset(&outputInfo, 0, sizeof(outputInfo));
+
+        uint8_t *outPtr = (uint8_t *)outHeader->pBuffer + outHeader->nOffset;
+        size_t outAvailable = outHeader->nAllocLen - outHeader->nOffset;
+
+        VO_U32 ret = VO_ERR_NONE;
+        size_t nOutputBytes = 0;
+        do {
+            outputData.Buffer = outPtr;
+            outputData.Length = outAvailable - nOutputBytes;
+            ret = mApiHandle->GetOutputData(
+                    mEncoderHandle, &outputData, &outputInfo);
+            if (ret == VO_ERR_NONE) {
+                outPtr += outputData.Length;
+                nOutputBytes += outputData.Length;
+            }
+        } while (ret != VO_ERR_INPUT_BUFFER_SMALL);
+
+        outHeader->nFilledLen = nOutputBytes;
+
+        outHeader->nFlags = OMX_BUFFERFLAG_ENDOFFRAME;
+
+        if (mSawInputEOS) {
+            // We also tag this output buffer with EOS if it corresponds
+            // to the final input buffer.
+            outHeader->nFlags = OMX_BUFFERFLAG_EOS;
+        }
+
+        outHeader->nTimeStamp = mInputTimeUs;
+
+#if 0
+        ALOGI("sending %d bytes of data (time = %lld us, flags = 0x%08lx)",
+              nOutputBytes, mInputTimeUs, outHeader->nFlags);
+
+        hexdump(outHeader->pBuffer + outHeader->nOffset, outHeader->nFilledLen);
+#endif
+
+        outQueue.erase(outQueue.begin());
+        outInfo->mOwnedByUs = false;
+        notifyFillBufferDone(outHeader);
+
+        outHeader = NULL;
+        outInfo = NULL;
+
+        mInputSize = 0;
+    }
+}
+
+}  // namespace android
+
+android::SoftOMXComponent *createSoftOMXComponent(
+        const char *name, const OMX_CALLBACKTYPE *callbacks,
+        OMX_PTR appData, OMX_COMPONENTTYPE **component) {
+    return new android::SoftAACEncoder(name, callbacks, appData, component);
+}
diff --git a/media/libstagefright/codecs/aacenc/SoftAACEncoder.h b/media/libstagefright/codecs/aacenc/SoftAACEncoder.h
new file mode 100644
index 0000000..d148eb7
--- /dev/null
+++ b/media/libstagefright/codecs/aacenc/SoftAACEncoder.h
@@ -0,0 +1,82 @@
+/*
+ * 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.
+ */
+
+#ifndef SOFT_AAC_ENCODER_H_
+
+#define SOFT_AAC_ENCODER_H_
+
+#include "SimpleSoftOMXComponent.h"
+
+struct VO_AUDIO_CODECAPI;
+struct VO_MEM_OPERATOR;
+
+namespace android {
+
+struct SoftAACEncoder : public SimpleSoftOMXComponent {
+    SoftAACEncoder(
+            const char *name,
+            const OMX_CALLBACKTYPE *callbacks,
+            OMX_PTR appData,
+            OMX_COMPONENTTYPE **component);
+
+protected:
+    virtual ~SoftAACEncoder();
+
+    virtual OMX_ERRORTYPE internalGetParameter(
+            OMX_INDEXTYPE index, OMX_PTR params);
+
+    virtual OMX_ERRORTYPE internalSetParameter(
+            OMX_INDEXTYPE index, const OMX_PTR params);
+
+    virtual void onQueueFilled(OMX_U32 portIndex);
+
+private:
+    enum {
+        kNumBuffers             = 4,
+        kNumSamplesPerFrame     = 1024,
+    };
+
+    void *mEncoderHandle;
+    VO_AUDIO_CODECAPI *mApiHandle;
+    VO_MEM_OPERATOR  *mMemOperator;
+
+    OMX_U32 mNumChannels;
+    OMX_U32 mSampleRate;
+    OMX_U32 mBitRate;
+
+    bool mSentCodecSpecificData;
+    size_t mInputSize;
+    int16_t *mInputFrame;
+    int64_t mInputTimeUs;
+
+    bool mSawInputEOS;
+
+    uint8_t mAudioSpecificConfigData[2];
+
+    bool mSignalledError;
+
+    void initPorts();
+    status_t initEncoder();
+
+    status_t setAudioSpecificConfigData();
+    status_t setAudioParams();
+
+    DISALLOW_EVIL_CONSTRUCTORS(SoftAACEncoder);
+};
+
+}  // namespace android
+
+#endif  // SOFT_AAC_ENCODER_H_
diff --git a/media/libstagefright/codecs/aacenc/basic_op/basic_op.h b/media/libstagefright/codecs/aacenc/basic_op/basic_op.h
index 8291684..ef3c31b 100644
--- a/media/libstagefright/codecs/aacenc/basic_op/basic_op.h
+++ b/media/libstagefright/codecs/aacenc/basic_op/basic_op.h
@@ -91,7 +91,7 @@
 #else
 Word32 L_msu (Word32 L_var3, Word16 var1, Word16 var2);
 #endif
-    
+
 /* Long sub,        2 */
 #if (L_SUB_IS_INLINE)
 __inline Word32 L_sub(Word32 L_var1, Word32 L_var2);
@@ -119,7 +119,7 @@
 #else
 Word16 add (Word16 var1, Word16 var2);
 #endif
-    
+
 /* Short sub,           1   */
 #if (SUB_IS_INLINE)
 __inline Word16 sub(Word16 var1, Word16 var2);
@@ -227,48 +227,48 @@
 #if ARMV4_INASM
 __inline Word32 ASM_L_shr(Word32 L_var1, Word16 var2)
 {
-	Word32 result; 
-	asm volatile( 
-		"MOV %[result], %[L_var1], ASR %[var2] \n" 
+	Word32 result;
+	asm volatile(
+		"MOV %[result], %[L_var1], ASR %[var2] \n"
 		:[result]"=r"(result)
 		:[L_var1]"r"(L_var1), [var2]"r"(var2)
-		); 
-	return result;	
+		);
+	return result;
 }
- 
+
 __inline Word32 ASM_L_shl(Word32 L_var1, Word16 var2)
 {
-	Word32 result; 
-	asm volatile( 
+	Word32 result;
+	asm volatile(
 		"MOV	r2, %[L_var1] \n"
 		"MOV	r3, #0x7fffffff\n"
-		"MOV	%[result], %[L_var1], ASL %[var2] \n" 
+		"MOV	%[result], %[L_var1], ASL %[var2] \n"
 		"TEQ	r2, %[result], ASR %[var2]\n"
 		"EORNE  %[result],r3,r2,ASR#31\n"
 		:[result]"+r"(result)
 		:[L_var1]"r"(L_var1), [var2]"r"(var2)
 		:"r2", "r3"
-		); 
-	return result;	
+		);
+	return result;
 }
 
 __inline Word32 ASM_shr(Word32 L_var1, Word16 var2)
 {
-	Word32 result; 
-	asm volatile( 
+	Word32 result;
+	asm volatile(
 		"CMP	%[var2], #15\n"
 		"MOVGE  %[var2], #15\n"
 		"MOV	%[result], %[L_var1], ASR %[var2]\n"
 		:[result]"=r"(result)
-		:[L_var1]"r"(L_var1), [var2]"r"(var2) 
-		); 
-	return result;	
-} 
+		:[L_var1]"r"(L_var1), [var2]"r"(var2)
+		);
+	return result;
+}
 
 __inline Word32 ASM_shl(Word32 L_var1, Word16 var2)
 {
-	Word32 result; 
-	asm volatile( 
+	Word32 result;
+	asm volatile(
 		"CMP	%[var2], #16\n"
 		"MOVGE  %[var2], #16\n"
 		"MOV    %[result], %[L_var1], ASL %[var2]\n"
@@ -280,9 +280,9 @@
 		:[result]"+r"(result)
 		:[L_var1]"r"(L_var1), [var2]"r"(var2)
 		:"r2", "r3"
-		); 
-	return result;	
-} 
+		);
+	return result;
+}
 #endif
 
 /*___________________________________________________________________________
@@ -300,17 +300,17 @@
 		"MOV	r3, #1\n"
 		"MOV	r2,%[L_var1],ASR#15\n"
 		"RSB	r3, r3, r3, LSL #15\n"
-		"TEQ	r2,%[L_var1],ASR#31\n"	
+		"TEQ	r2,%[L_var1],ASR#31\n"
 		"EORNE	%[result],r3,%[L_var1],ASR#31\n"
 		:[result]"+r"(result)
 		:[L_var1]"r"(L_var1)
-		:"r2", "r3"			
+		:"r2", "r3"
 	);
 
 	return result;
 #else
     Word16 var_out;
-    
+
     //var_out = (L_var1 > (Word32)0X00007fffL) ? (MAX_16) : ((L_var1 < (Word32)0xffff8000L) ? (MIN_16) : ((Word16)L_var1));
 
     if (L_var1 > 0X00007fffL)
@@ -419,13 +419,13 @@
 __inline Word32 L_mult(Word16 var1, Word16 var2)
 {
 #if ARMV5TE_L_MULT
-	Word32 result; 
-	asm volatile( 
-		"SMULBB %[result], %[var1], %[var2] \n" 
-		"QADD %[result], %[result], %[result] \n" 
+	Word32 result;
+	asm volatile(
+		"SMULBB %[result], %[var1], %[var2] \n"
+		"QADD %[result], %[result], %[result] \n"
 		:[result]"+r"(result)
 		:[var1]"r"(var1), [var2]"r"(var2)
-		); 
+		);
 	return result;
 #else
     Word32 L_var_out;
@@ -449,14 +449,14 @@
 __inline Word32 L_msu (Word32 L_var3, Word16 var1, Word16 var2)
 {
 #if ARMV5TE_L_MSU
-	Word32 result; 
-	asm volatile( 
-		"SMULBB %[result], %[var1], %[var2] \n" 
+	Word32 result;
+	asm volatile(
+		"SMULBB %[result], %[var1], %[var2] \n"
 		"QADD %[result], %[result], %[result] \n"
 		"QSUB %[result], %[L_var3], %[result]\n"
 		:[result]"+r"(result)
 		:[L_var3]"r"(L_var3), [var1]"r"(var1), [var2]"r"(var2)
-		); 
+		);
 	return result;
 #else
     Word32 L_var_out;
@@ -473,12 +473,12 @@
 __inline Word32 L_sub(Word32 L_var1, Word32 L_var2)
 {
 #if ARMV5TE_L_SUB
-	Word32 result; 
-	asm volatile( 
+	Word32 result;
+	asm volatile(
 		"QSUB %[result], %[L_var1], %[L_var2]\n"
 		:[result]"+r"(result)
 		:[L_var1]"r"(L_var1), [L_var2]"r"(L_var2)
-		); 
+		);
 	return result;
 #else
     Word32 L_var_out;
@@ -588,9 +588,9 @@
 __inline Word16 add (Word16 var1, Word16 var2)
 {
 #if ARMV5TE_ADD
-	Word32 result; 
-	asm volatile( 
-		"ADD  %[result], %[var1], %[var2] \n" 
+	Word32 result;
+	asm volatile(
+		"ADD  %[result], %[var1], %[var2] \n"
 		"MOV  r3, #0x1\n"
 		"MOV  r2, %[result], ASR #15\n"
 		"RSB  r3, r3, r3, LSL, #15\n"
@@ -599,7 +599,7 @@
 		:[result]"+r"(result)
 		:[var1]"r"(var1), [var2]"r"(var2)
 		:"r2", "r3"
-		); 
+		);
 	return result;
 #else
     Word16 var_out;
@@ -618,18 +618,18 @@
 __inline Word16 sub(Word16 var1, Word16 var2)
 {
 #if ARMV5TE_SUB
-	Word32 result; 
-	asm volatile( 
+	Word32 result;
+	asm volatile(
 		"MOV   r3, #1\n"
-		"SUB   %[result], %[var1], %[var2] \n"		
+		"SUB   %[result], %[var1], %[var2] \n"
 		"RSB   r3,r3,r3,LSL#15\n"
-		"MOV   r2, %[var1], ASR #15 \n" 
+		"MOV   r2, %[var1], ASR #15 \n"
 		"TEQ   r2, %[var1], ASR #31 \n"
 		"EORNE %[result], r3, %[result], ASR #31 \n"
 		:[result]"+r"(result)
 		:[var1]"r"(var1), [var2]"r"(var2)
 		:"r2", "r3"
-		); 
+		);
 	return result;
 #else
     Word16 var_out;
@@ -637,7 +637,7 @@
 
     L_diff = (Word32) var1 - var2;
     var_out = saturate(L_diff);
-   
+
     return (var_out);
 #endif
 }
@@ -657,16 +657,16 @@
     {
     	var_out = 0;
     	L_num = (Word32) var1;
-    
+
     	L_denom = (Word32) var2;
-    	
+
 		//return (L_num<<15)/var2;
 
     	for (iteration = 0; iteration < 15; iteration++)
     	{
     		var_out <<= 1;
     		L_num <<= 1;
-    		
+
     		if (L_num >= L_denom)
     		{
     			L_num -= L_denom;
@@ -683,8 +683,8 @@
 __inline Word16 mult (Word16 var1, Word16 var2)
 {
 #if ARMV5TE_MULT
-	Word32 result; 
-	asm volatile( 
+	Word32 result;
+	asm volatile(
 		"SMULBB r2, %[var1], %[var2] \n"
 		"MOV	r3, #1\n"
 		"MOV	%[result], r2, ASR #15\n"
@@ -695,7 +695,7 @@
 		:[result]"+r"(result)
 		:[var1]"r"(var1), [var2]"r"(var2)
 		:"r2", "r3"
-		); 
+		);
 	return result;
 #else
     Word16 var_out;
@@ -718,8 +718,8 @@
 __inline Word16 norm_s (Word16 var1)
 {
 #if ARMV5TE_NORM_S
-	Word16 result; 
-	asm volatile( 
+	Word16 result;
+	asm volatile(
 		"MOV   r2,%[var1] \n"
 		"CMP   r2, #0\n"
 		"RSBLT %[var1], %[var1], #0 \n"
@@ -727,11 +727,11 @@
 		"SUBNE %[result], %[result], #17\n"
 		"MOVEQ %[result], #0\n"
 		"CMP   r2, #-1\n"
-		"MOVEQ %[result], #15\n" 
+		"MOVEQ %[result], #15\n"
 		:[result]"+r"(result)
 		:[var1]"r"(var1)
 		:"r2"
-		); 
+		);
 	return result;
 #else
     Word16 var_out;
@@ -768,15 +768,15 @@
 __inline Word16 norm_l (Word32 L_var1)
 {
 #if ARMV5TE_NORM_L
-	Word16 result; 
-	asm volatile( 
+	Word16 result;
+	asm volatile(
 		"CMP    %[L_var1], #0\n"
 		"CLZNE  %[result], %[L_var1]\n"
-		"SUBNE  %[result], %[result], #1\n" 
+		"SUBNE  %[result], %[result], #1\n"
 		"MOVEQ  %[result], #0\n"
 		:[result]"+r"(result)
 		:[L_var1]"r"(L_var1)
-		); 
+		);
 	return result;
 #else
     //Word16 var_out;
@@ -805,84 +805,84 @@
     //}
     //return (var_out);
   Word16 a16;
-  Word16 r = 0 ;       
+  Word16 r = 0 ;
 
-   
+
   if ( L_var1 < 0 ) {
-    L_var1 = ~L_var1; 
+    L_var1 = ~L_var1;
   }
 
   if (0 == (L_var1 & 0x7fff8000)) {
     a16 = extract_l(L_var1);
     r += 16;
-       
+
     if (0 == (a16 & 0x7f80)) {
       r += 8;
-         
+
       if (0 == (a16 & 0x0078)) {
         r += 4;
-           
+
         if (0 == (a16 & 0x0006)) {
           r += 2;
-             
+
           if (0 == (a16 & 0x0001)) {
             r += 1;
           }
         }
         else {
-             
+
           if (0 == (a16 & 0x0004)) {
             r += 1;
           }
         }
       }
       else {
-           
+
         if (0 == (a16 & 0x0060)) {
           r += 2;
-             
+
           if (0 == (a16 & 0x0010)) {
             r += 1;
           }
         }
         else {
-             
+
           if (0 == (a16 & 0x0040)) {
             r += 1;
           }
         }
       }
-    } 
-    else { 
-         
+    }
+    else {
+
       if (0 == (a16 & 0x7800)) {
         r += 4;
-           
+
         if (0 == (a16 & 0x0600)) {
           r += 2;
-             
+
           if (0 == (a16 & 0x0100)) {
             r += 1;
           }
         }
         else {
-             
+
           if (0 == (a16 & 0x0400)) {
             r += 1;
           }
         }
       }
       else {
-           
+
         if (0 == (a16 & 0x6000)) {
           r += 2;
-             
+
           if (0 == (a16 & 0x1000)) {
             r += 1;
           }
         }
         else {
-             
+
           if (0 == (a16 & 0x4000)) {
             r += 1;
           }
@@ -892,38 +892,38 @@
   }
   else {
     a16 = extract_h(L_var1);
-       
+
     if (0 == (a16 & 0x7f80)) {
       r += 8;
-         
+
       if (0 == (a16 & 0x0078)) {
         r += 4 ;
-           
+
         if (0 == (a16 & 0x0006)) {
           r += 2;
-             
+
           if (0 == (a16 & 0x0001)) {
             r += 1;
           }
         }
         else {
-             
+
           if (0 == (a16 & 0x0004)) {
             r += 1;
           }
         }
       }
       else {
-           
+
         if (0 == (a16 & 0x0060)) {
           r += 2;
-             
+
           if (0 == (a16 & 0x0010)) {
             r += 1;
           }
         }
         else {
-             
+
           if (0 == (a16 & 0x0040)) {
             r += 1;
           }
@@ -931,35 +931,35 @@
       }
     }
     else {
-         
+
       if (0 == (a16 & 0x7800)) {
         r += 4;
-           
+
         if (0 == (a16 & 0x0600)) {
           r += 2;
-             
+
           if (0 == (a16 & 0x0100)) {
             r += 1;
           }
         }
         else {
-             
+
           if (0 == (a16 & 0x0400)) {
             r += 1;
           }
         }
       }
       else {
-           
+
         if (0 == (a16 & 0x6000)) {
           r += 2;
-             
+
           if (0 == (a16 & 0x1000)) {
             r += 1;
           }
         }
         else {
-             
+
           if (0 == (a16 & 0x4000)) {
             return 1;
           }
@@ -967,7 +967,7 @@
       }
     }
   }
-  
+
   return r ;
 #endif
 }
@@ -978,17 +978,17 @@
 __inline Word16 round16(Word32 L_var1)
 {
 #if ARMV5TE_ROUND
-	Word16 result; 
-	asm volatile( 
+	Word16 result;
+	asm volatile(
 		"MOV   r1,#0x00008000\n"
 		"QADD  %[result], %[L_var1], r1\n"
-		"MOV   %[result], %[result], ASR #16 \n" 
+		"MOV   %[result], %[result], ASR #16 \n"
 		:[result]"+r"(result)
 		:[L_var1]"r"(L_var1)
 		:"r1"
-		); 
+		);
 	return result;
-#else   
+#else
     Word16 var_out;
     Word32 L_rounded;
 
@@ -1004,14 +1004,14 @@
 __inline Word32 L_mac (Word32 L_var3, Word16 var1, Word16 var2)
 {
 #if ARMV5TE_L_MAC
-	Word32 result; 
-	asm volatile( 
+	Word32 result;
+	asm volatile(
 		"SMULBB %[result], %[var1], %[var2]\n"
 		"QADD	%[result], %[result], %[result]\n"
 		"QADD   %[result], %[result], %[L_var3]\n"
 		:[result]"+r"(result)
 		: [L_var3]"r"(L_var3), [var1]"r"(var1), [var2]"r"(var2)
-		); 
+		);
 	return result;
 #else
     Word32 L_var_out;
@@ -1028,12 +1028,12 @@
 __inline Word32 L_add (Word32 L_var1, Word32 L_var2)
 {
 #if ARMV5TE_L_ADD
-	Word32 result; 
-	asm volatile( 
+	Word32 result;
+	asm volatile(
 		"QADD %[result], %[L_var1], %[L_var2]\n"
 		:[result]"+r"(result)
 		:[L_var1]"r"(L_var1), [L_var2]"r"(L_var2)
-		); 
+		);
 	return result;
 #else
     Word32 L_var_out;
@@ -1114,7 +1114,7 @@
 
     L_var3 = L_msu (L_var3, var1, var2);
     var_out = (Word16)((L_var3 + 0x8000L) >> 16);
-    
+
     return (var_out);
 }
 #endif
diff --git a/media/libstagefright/codecs/aacenc/basic_op/basicop2.c b/media/libstagefright/codecs/aacenc/basic_op/basicop2.c
index 82d3f38..d43bbd9 100644
--- a/media/libstagefright/codecs/aacenc/basic_op/basicop2.c
+++ b/media/libstagefright/codecs/aacenc/basic_op/basicop2.c
@@ -16,7 +16,7 @@
 /*******************************************************************************
 	File:		basicop2.c
 
-	Content:	Basic arithmetic operators. 
+	Content:	Basic arithmetic operators.
 
 *******************************************************************************/
 
@@ -462,7 +462,7 @@
     {
         L_var_out = MAX_32;
     }
-        
+
     return (L_var_out);
 }
 #endif
diff --git a/media/libstagefright/codecs/aacenc/basic_op/oper_32b.c b/media/libstagefright/codecs/aacenc/basic_op/oper_32b.c
index 0ad82f0..982f4fd 100644
--- a/media/libstagefright/codecs/aacenc/basic_op/oper_32b.c
+++ b/media/libstagefright/codecs/aacenc/basic_op/oper_32b.c
@@ -17,7 +17,7 @@
 	File:		oper_32b.c
 
 	Content:	  This file contains operations in double precision.
- 
+
 *******************************************************************************/
 
 #include "typedef.h"
@@ -200,12 +200,12 @@
 }
 
 /*!
- 
-  \brief  calculates the log dualis times 4 of argument 
+
+  \brief  calculates the log dualis times 4 of argument
           iLog4(x) = (Word32)(4 * log(value)/log(2.0))
 
   \return ilog4 value
- 
+
 */
 Word16 iLog4(Word32 value)
 {
@@ -225,7 +225,7 @@
     iLog4 = (-(iLog4 << 2) - norm_s(tmp16)) - 1;
   }
   else {
-    iLog4 = -128; /* -(INT_BITS*4); */                                          
+    iLog4 = -128; /* -(INT_BITS*4); */
   }
 
   return iLog4;
@@ -268,79 +268,79 @@
 }
 
 static const Word32 pow2Table[POW2_TABLE_SIZE] = {
-0x7fffffff, 0x7fa765ad, 0x7f4f08ae, 0x7ef6e8da, 
-0x7e9f0606, 0x7e476009, 0x7deff6b6, 0x7d98c9e6, 
-0x7d41d96e, 0x7ceb2523, 0x7c94acde, 0x7c3e7073, 
-0x7be86fb9, 0x7b92aa88, 0x7b3d20b6, 0x7ae7d21a, 
-0x7a92be8b, 0x7a3de5df, 0x79e947ef, 0x7994e492, 
-0x7940bb9e, 0x78ecccec, 0x78991854, 0x78459dac, 
-0x77f25cce, 0x779f5591, 0x774c87cc, 0x76f9f359, 
-0x76a7980f, 0x765575c8, 0x76038c5b, 0x75b1dba2, 
-0x75606374, 0x750f23ab, 0x74be1c20, 0x746d4cac, 
-0x741cb528, 0x73cc556d, 0x737c2d55, 0x732c3cba, 
-0x72dc8374, 0x728d015d, 0x723db650, 0x71eea226, 
-0x719fc4b9, 0x71511de4, 0x7102ad80, 0x70b47368, 
-0x70666f76, 0x7018a185, 0x6fcb096f, 0x6f7da710, 
-0x6f307a41, 0x6ee382de, 0x6e96c0c3, 0x6e4a33c9, 
-0x6dfddbcc, 0x6db1b8a8, 0x6d65ca38, 0x6d1a1057, 
-0x6cce8ae1, 0x6c8339b2, 0x6c381ca6, 0x6bed3398, 
-0x6ba27e66, 0x6b57fce9, 0x6b0daeff, 0x6ac39485, 
-0x6a79ad56, 0x6a2ff94f, 0x69e6784d, 0x699d2a2c, 
-0x69540ec9, 0x690b2601, 0x68c26fb1, 0x6879ebb6, 
-0x683199ed, 0x67e97a34, 0x67a18c68, 0x6759d065, 
-0x6712460b, 0x66caed35, 0x6683c5c3, 0x663ccf92, 
-0x65f60a80, 0x65af766a, 0x6569132f, 0x6522e0ad, 
-0x64dcdec3, 0x64970d4f, 0x64516c2e, 0x640bfb41, 
-0x63c6ba64, 0x6381a978, 0x633cc85b, 0x62f816eb, 
-0x62b39509, 0x626f4292, 0x622b1f66, 0x61e72b65, 
-0x61a3666d, 0x615fd05f, 0x611c6919, 0x60d9307b, 
-0x60962665, 0x60534ab7, 0x60109d51, 0x5fce1e12, 
-0x5f8bccdb, 0x5f49a98c, 0x5f07b405, 0x5ec5ec26, 
-0x5e8451d0, 0x5e42e4e3, 0x5e01a540, 0x5dc092c7, 
-0x5d7fad59, 0x5d3ef4d7, 0x5cfe6923, 0x5cbe0a1c, 
-0x5c7dd7a4, 0x5c3dd19c, 0x5bfdf7e5, 0x5bbe4a61, 
-0x5b7ec8f2, 0x5b3f7377, 0x5b0049d4, 0x5ac14bea, 
-0x5a82799a, 0x5a43d2c6, 0x5a055751, 0x59c7071c, 
-0x5988e209, 0x594ae7fb, 0x590d18d3, 0x58cf7474, 
-0x5891fac1, 0x5854ab9b, 0x581786e6, 0x57da8c83, 
-0x579dbc57, 0x57611642, 0x57249a29, 0x56e847ef, 
-0x56ac1f75, 0x567020a0, 0x56344b52, 0x55f89f70, 
-0x55bd1cdb, 0x5581c378, 0x55469329, 0x550b8bd4, 
-0x54d0ad5b, 0x5495f7a1, 0x545b6a8b, 0x542105fd, 
-0x53e6c9db, 0x53acb607, 0x5372ca68, 0x533906e0, 
-0x52ff6b55, 0x52c5f7aa, 0x528cabc3, 0x52538786, 
-0x521a8ad7, 0x51e1b59a, 0x51a907b4, 0x5170810b, 
-0x51382182, 0x50ffe8fe, 0x50c7d765, 0x508fec9c, 
-0x50582888, 0x50208b0e, 0x4fe91413, 0x4fb1c37c, 
-0x4f7a9930, 0x4f439514, 0x4f0cb70c, 0x4ed5ff00, 
-0x4e9f6cd4, 0x4e69006e, 0x4e32b9b4, 0x4dfc988c, 
-0x4dc69cdd, 0x4d90c68b, 0x4d5b157e, 0x4d25899c, 
-0x4cf022ca, 0x4cbae0ef, 0x4c85c3f1, 0x4c50cbb8, 
-0x4c1bf829, 0x4be7492b, 0x4bb2bea5, 0x4b7e587d, 
-0x4b4a169c, 0x4b15f8e6, 0x4ae1ff43, 0x4aae299b, 
-0x4a7a77d5, 0x4a46e9d6, 0x4a137f88, 0x49e038d0, 
-0x49ad1598, 0x497a15c4, 0x4947393f, 0x49147fee, 
-0x48e1e9ba, 0x48af768a, 0x487d2646, 0x484af8d6, 
-0x4818ee22, 0x47e70611, 0x47b5408c, 0x47839d7b, 
-0x47521cc6, 0x4720be55, 0x46ef8210, 0x46be67e0, 
-0x468d6fae, 0x465c9961, 0x462be4e2, 0x45fb521a, 
-0x45cae0f2, 0x459a9152, 0x456a6323, 0x453a564d, 
-0x450a6abb, 0x44daa054, 0x44aaf702, 0x447b6ead, 
-0x444c0740, 0x441cc0a3, 0x43ed9ac0, 0x43be9580, 
-0x438fb0cb, 0x4360ec8d, 0x433248ae, 0x4303c517, 
-0x42d561b4, 0x42a71e6c, 0x4278fb2b, 0x424af7da, 
-0x421d1462, 0x41ef50ae, 0x41c1aca8, 0x41942839, 
-0x4166c34c, 0x41397dcc, 0x410c57a2, 0x40df50b8, 
-0x40b268fa, 0x4085a051, 0x4058f6a8, 0x402c6be9 
+0x7fffffff, 0x7fa765ad, 0x7f4f08ae, 0x7ef6e8da,
+0x7e9f0606, 0x7e476009, 0x7deff6b6, 0x7d98c9e6,
+0x7d41d96e, 0x7ceb2523, 0x7c94acde, 0x7c3e7073,
+0x7be86fb9, 0x7b92aa88, 0x7b3d20b6, 0x7ae7d21a,
+0x7a92be8b, 0x7a3de5df, 0x79e947ef, 0x7994e492,
+0x7940bb9e, 0x78ecccec, 0x78991854, 0x78459dac,
+0x77f25cce, 0x779f5591, 0x774c87cc, 0x76f9f359,
+0x76a7980f, 0x765575c8, 0x76038c5b, 0x75b1dba2,
+0x75606374, 0x750f23ab, 0x74be1c20, 0x746d4cac,
+0x741cb528, 0x73cc556d, 0x737c2d55, 0x732c3cba,
+0x72dc8374, 0x728d015d, 0x723db650, 0x71eea226,
+0x719fc4b9, 0x71511de4, 0x7102ad80, 0x70b47368,
+0x70666f76, 0x7018a185, 0x6fcb096f, 0x6f7da710,
+0x6f307a41, 0x6ee382de, 0x6e96c0c3, 0x6e4a33c9,
+0x6dfddbcc, 0x6db1b8a8, 0x6d65ca38, 0x6d1a1057,
+0x6cce8ae1, 0x6c8339b2, 0x6c381ca6, 0x6bed3398,
+0x6ba27e66, 0x6b57fce9, 0x6b0daeff, 0x6ac39485,
+0x6a79ad56, 0x6a2ff94f, 0x69e6784d, 0x699d2a2c,
+0x69540ec9, 0x690b2601, 0x68c26fb1, 0x6879ebb6,
+0x683199ed, 0x67e97a34, 0x67a18c68, 0x6759d065,
+0x6712460b, 0x66caed35, 0x6683c5c3, 0x663ccf92,
+0x65f60a80, 0x65af766a, 0x6569132f, 0x6522e0ad,
+0x64dcdec3, 0x64970d4f, 0x64516c2e, 0x640bfb41,
+0x63c6ba64, 0x6381a978, 0x633cc85b, 0x62f816eb,
+0x62b39509, 0x626f4292, 0x622b1f66, 0x61e72b65,
+0x61a3666d, 0x615fd05f, 0x611c6919, 0x60d9307b,
+0x60962665, 0x60534ab7, 0x60109d51, 0x5fce1e12,
+0x5f8bccdb, 0x5f49a98c, 0x5f07b405, 0x5ec5ec26,
+0x5e8451d0, 0x5e42e4e3, 0x5e01a540, 0x5dc092c7,
+0x5d7fad59, 0x5d3ef4d7, 0x5cfe6923, 0x5cbe0a1c,
+0x5c7dd7a4, 0x5c3dd19c, 0x5bfdf7e5, 0x5bbe4a61,
+0x5b7ec8f2, 0x5b3f7377, 0x5b0049d4, 0x5ac14bea,
+0x5a82799a, 0x5a43d2c6, 0x5a055751, 0x59c7071c,
+0x5988e209, 0x594ae7fb, 0x590d18d3, 0x58cf7474,
+0x5891fac1, 0x5854ab9b, 0x581786e6, 0x57da8c83,
+0x579dbc57, 0x57611642, 0x57249a29, 0x56e847ef,
+0x56ac1f75, 0x567020a0, 0x56344b52, 0x55f89f70,
+0x55bd1cdb, 0x5581c378, 0x55469329, 0x550b8bd4,
+0x54d0ad5b, 0x5495f7a1, 0x545b6a8b, 0x542105fd,
+0x53e6c9db, 0x53acb607, 0x5372ca68, 0x533906e0,
+0x52ff6b55, 0x52c5f7aa, 0x528cabc3, 0x52538786,
+0x521a8ad7, 0x51e1b59a, 0x51a907b4, 0x5170810b,
+0x51382182, 0x50ffe8fe, 0x50c7d765, 0x508fec9c,
+0x50582888, 0x50208b0e, 0x4fe91413, 0x4fb1c37c,
+0x4f7a9930, 0x4f439514, 0x4f0cb70c, 0x4ed5ff00,
+0x4e9f6cd4, 0x4e69006e, 0x4e32b9b4, 0x4dfc988c,
+0x4dc69cdd, 0x4d90c68b, 0x4d5b157e, 0x4d25899c,
+0x4cf022ca, 0x4cbae0ef, 0x4c85c3f1, 0x4c50cbb8,
+0x4c1bf829, 0x4be7492b, 0x4bb2bea5, 0x4b7e587d,
+0x4b4a169c, 0x4b15f8e6, 0x4ae1ff43, 0x4aae299b,
+0x4a7a77d5, 0x4a46e9d6, 0x4a137f88, 0x49e038d0,
+0x49ad1598, 0x497a15c4, 0x4947393f, 0x49147fee,
+0x48e1e9ba, 0x48af768a, 0x487d2646, 0x484af8d6,
+0x4818ee22, 0x47e70611, 0x47b5408c, 0x47839d7b,
+0x47521cc6, 0x4720be55, 0x46ef8210, 0x46be67e0,
+0x468d6fae, 0x465c9961, 0x462be4e2, 0x45fb521a,
+0x45cae0f2, 0x459a9152, 0x456a6323, 0x453a564d,
+0x450a6abb, 0x44daa054, 0x44aaf702, 0x447b6ead,
+0x444c0740, 0x441cc0a3, 0x43ed9ac0, 0x43be9580,
+0x438fb0cb, 0x4360ec8d, 0x433248ae, 0x4303c517,
+0x42d561b4, 0x42a71e6c, 0x4278fb2b, 0x424af7da,
+0x421d1462, 0x41ef50ae, 0x41c1aca8, 0x41942839,
+0x4166c34c, 0x41397dcc, 0x410c57a2, 0x40df50b8,
+0x40b268fa, 0x4085a051, 0x4058f6a8, 0x402c6be9
 };
 
 /*!
- 
-  \brief calculates 2 ^ (x/y) for x<=0, y > 0, x <= 32768 * y 
-  
+
+  \brief calculates 2 ^ (x/y) for x<=0, y > 0, x <= 32768 * y
+
   avoids integer division
-  
-  \return 
+
+  \return
 */
 Word32 pow2_xy(Word32 x, Word32 y)
 {
@@ -355,7 +355,7 @@
   fPart = tmp2 - iPart*y;
   iPart = min(iPart,INT_BITS-1);
 
-  res = pow2Table[(POW2_TABLE_SIZE*fPart)/y] >> iPart; 
- 
+  res = pow2Table[(POW2_TABLE_SIZE*fPart)/y] >> iPart;
+
   return(res);
-}
\ No newline at end of file
+}
diff --git a/media/libstagefright/codecs/aacenc/basic_op/oper_32b.h b/media/libstagefright/codecs/aacenc/basic_op/oper_32b.h
index 1d35e5e..9ebd1c2 100644
--- a/media/libstagefright/codecs/aacenc/basic_op/oper_32b.h
+++ b/media/libstagefright/codecs/aacenc/basic_op/oper_32b.h
@@ -51,21 +51,21 @@
     swHigh1 = (Word16)(L_var2 >> 16);
 
     l_var_out = (long)swLow1 * (long)var1 >> 15;
-    
+
     l_var_out += swHigh1 * var1 << 1;
-    
+
     return(l_var_out);
 }
 
 __inline Word32 L_mpy_wx(Word32 L_var2, Word16 var1)
 {
 #if ARMV5TE_L_MPY_LS
-	Word32 result; 
-	asm volatile( 
-		"SMULWB  %[result], %[L_var2], %[var1] \n" 
+	Word32 result;
+	asm volatile(
+		"SMULWB  %[result], %[L_var2], %[var1] \n"
 		:[result]"+r"(result)
 		:[L_var2]"r"(L_var2), [var1]"r"(var1)
-		); 
+		);
 	return result;
 #else
     unsigned short swLow1;
@@ -75,9 +75,9 @@
     swLow1 = (unsigned short)(L_var2);
     swHigh1 = (Word16)(L_var2 >> 16);
 
-    l_var_out = (long)swLow1 * (long)var1 >> 16;    
+    l_var_out = (long)swLow1 * (long)var1 >> 16;
     l_var_out += swHigh1 * var1;
-    
+
     return(l_var_out);
 #endif
 }
diff --git a/media/libstagefright/codecs/aacenc/basic_op/typedef.h b/media/libstagefright/codecs/aacenc/basic_op/typedef.h
index 1030803..b1f8225 100644
--- a/media/libstagefright/codecs/aacenc/basic_op/typedef.h
+++ b/media/libstagefright/codecs/aacenc/basic_op/typedef.h
@@ -30,7 +30,7 @@
 /*
  * this is the original code from the ETSI file typedef.h
  */
-   
+
 #if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(_MSC_VER) || defined(__ZTC__)
 typedef signed char Word8;
 typedef short Word16;
diff --git a/media/libstagefright/codecs/aacenc/basic_op/typedefs.h b/media/libstagefright/codecs/aacenc/basic_op/typedefs.h
index c7e774b..2d5d956 100644
--- a/media/libstagefright/codecs/aacenc/basic_op/typedefs.h
+++ b/media/libstagefright/codecs/aacenc/basic_op/typedefs.h
@@ -55,7 +55,7 @@
 #define INT_BITS   32
 /*
 ********************************************************************************
-*                         DEFINITION OF CONSTANTS 
+*                         DEFINITION OF CONSTANTS
 ********************************************************************************
 */
 /*
@@ -77,12 +77,12 @@
 /*
  ********* define 32 bit signed/unsigned types & constants
  */
-typedef long Word32;
-typedef unsigned long UWord32;
+typedef int Word32;
+typedef unsigned int UWord32;
 
 
 
-#ifdef LINUX
+#ifndef _MSC_VER
 typedef long long Word64;
 typedef unsigned long long UWord64;
 #else
@@ -120,12 +120,12 @@
     #define ARMV5TE_L_MULT        1
     #define ARMV5TE_L_MAC         1
     #define ARMV5TE_L_MSU         1
-   
-    
+
+
     #define ARMV5TE_DIV_S         1
     #define ARMV5TE_ROUND         1
     #define ARMV5TE_MULT          1
-    
+
     #define ARMV5TE_NORM_S        1
     #define ARMV5TE_NORM_L        1
 	#define ARMV5TE_L_MPY_LS	  1
@@ -149,7 +149,7 @@
 #define ROUND_IS_INLINE                 1   //define round as inline function
 #define L_MAC_IS_INLINE                 1   //define L_mac as inline function
 #define L_ADD_IS_INLINE                 1   //define L_add as inline function
-#define EXTRACT_H_IS_INLINE             1   //define extract_h as inline function 
+#define EXTRACT_H_IS_INLINE             1   //define extract_h as inline function
 #define EXTRACT_L_IS_INLINE             1   //define extract_l as inline function        //???
 #define MULT_R_IS_INLINE                1   //define mult_r as inline function
 #define SHR_R_IS_INLINE                 1   //define shr_r as inline function
diff --git a/media/libstagefright/codecs/aacenc/inc/aac_rom.h b/media/libstagefright/codecs/aacenc/inc/aac_rom.h
index 784bb70..8e206b7 100644
--- a/media/libstagefright/codecs/aacenc/inc/aac_rom.h
+++ b/media/libstagefright/codecs/aacenc/inc/aac_rom.h
@@ -16,7 +16,7 @@
 /*******************************************************************************
 	File:		aac_rom.h
 
-	Content:	constant tables 
+	Content:	constant tables
 
 *******************************************************************************/
 
diff --git a/media/libstagefright/codecs/aacenc/inc/aacenc_core.h b/media/libstagefright/codecs/aacenc/inc/aacenc_core.h
index 41ba756..1acdbbc 100644
--- a/media/libstagefright/codecs/aacenc/inc/aacenc_core.h
+++ b/media/libstagefright/codecs/aacenc/inc/aacenc_core.h
@@ -47,7 +47,7 @@
 
 
 typedef struct {
-	
+
   AACENC_CONFIG config;     /* Word16 size: 8 */
 
   ELEMENT_INFO elInfo;      /* Word16 size: 4 */
diff --git a/media/libstagefright/codecs/aacenc/inc/adj_thr.h b/media/libstagefright/codecs/aacenc/inc/adj_thr.h
index f7cb888..0f4bb5e 100644
--- a/media/libstagefright/codecs/aacenc/inc/adj_thr.h
+++ b/media/libstagefright/codecs/aacenc/inc/adj_thr.h
@@ -16,7 +16,7 @@
 /*******************************************************************************
 	File:		adj_thr.h
 
-	Content:	Threshold compensation function 
+	Content:	Threshold compensation function
 
 *******************************************************************************/
 
@@ -44,7 +44,7 @@
                       PSY_OUT_ELEMENT *psyOutElement,
                       Word16 *chBitDistribution,
                       Word16 logSfbEnergy[MAX_CHANNELS][MAX_GROUPED_SFB],
-                      Word16 sfbNRelevantLines[MAX_CHANNELS][MAX_GROUPED_SFB],                      
+                      Word16 sfbNRelevantLines[MAX_CHANNELS][MAX_GROUPED_SFB],
                       QC_OUT_ELEMENT* qcOE,
 					  ELEMENT_BITS* elBits,
 					  const Word16 nChannels,
diff --git a/media/libstagefright/codecs/aacenc/inc/adj_thr_data.h b/media/libstagefright/codecs/aacenc/inc/adj_thr_data.h
index 9ac4664..30132d8 100644
--- a/media/libstagefright/codecs/aacenc/inc/adj_thr_data.h
+++ b/media/libstagefright/codecs/aacenc/inc/adj_thr_data.h
@@ -16,7 +16,7 @@
 /*******************************************************************************
 	File:		adj_thr_data.h
 
-	Content:	Threshold compensation parameter 
+	Content:	Threshold compensation parameter
 
 *******************************************************************************/
 
diff --git a/media/libstagefright/codecs/aacenc/inc/bitenc.h b/media/libstagefright/codecs/aacenc/inc/bitenc.h
index 6ded3c6..6a58aeb 100644
--- a/media/libstagefright/codecs/aacenc/inc/bitenc.h
+++ b/media/libstagefright/codecs/aacenc/inc/bitenc.h
@@ -26,7 +26,7 @@
 #include "qc_data.h"
 #include "tns.h"
 #include "channel_map.h"
-#include "interface.h"  
+#include "interface.h"
 
 struct BITSTREAMENCODER_INIT
 {
diff --git a/media/libstagefright/codecs/aacenc/inc/config.h b/media/libstagefright/codecs/aacenc/inc/config.h
index 3b29cef..b0b4c26 100644
--- a/media/libstagefright/codecs/aacenc/inc/config.h
+++ b/media/libstagefright/codecs/aacenc/inc/config.h
@@ -33,4 +33,4 @@
 #define MINBITS_COEF		744
 
 
-#endif
\ No newline at end of file
+#endif
diff --git a/media/libstagefright/codecs/aacenc/inc/interface.h b/media/libstagefright/codecs/aacenc/inc/interface.h
index 966ac99..a42e6a9 100644
--- a/media/libstagefright/codecs/aacenc/inc/interface.h
+++ b/media/libstagefright/codecs/aacenc/inc/interface.h
@@ -55,11 +55,11 @@
   Word16  windowShape;
   Word16  groupingMask;
   Word16  sfbOffsets[MAX_GROUPED_SFB+1];
-  Word16  mdctScale; 
-  Word32 *sfbEnergy; 
+  Word16  mdctScale;
+  Word32 *sfbEnergy;
   Word32 *sfbSpreadedEnergy;
-  Word32 *sfbThreshold;       
-  Word32 *mdctSpectrum;        
+  Word32 *sfbThreshold;
+  Word32 *mdctSpectrum;
   Word32  sfbEnSumLR;
   Word32  sfbEnSumMS;
   Word32 sfbDist[MAX_GROUPED_SFB];
diff --git a/media/libstagefright/codecs/aacenc/inc/line_pe.h b/media/libstagefright/codecs/aacenc/inc/line_pe.h
index 038d5a3..116d5a8 100644
--- a/media/libstagefright/codecs/aacenc/inc/line_pe.h
+++ b/media/libstagefright/codecs/aacenc/inc/line_pe.h
@@ -24,8 +24,8 @@
 #define __LINE_PE_H
 
 
-#include "psy_const.h" 
-#include "interface.h" 
+#include "psy_const.h"
+#include "interface.h"
 
 
 typedef struct {
@@ -72,4 +72,4 @@
 
 
 
-#endif 
+#endif
diff --git a/media/libstagefright/codecs/aacenc/inc/psy_const.h b/media/libstagefright/codecs/aacenc/inc/psy_const.h
index b05d683..19fb9b2 100644
--- a/media/libstagefright/codecs/aacenc/inc/psy_const.h
+++ b/media/libstagefright/codecs/aacenc/inc/psy_const.h
@@ -69,7 +69,7 @@
 
 #define BLOCK_SWITCHING_OFFSET		   (1*1024+3*128+64+128)
 #define BLOCK_SWITCHING_DATA_SIZE          FRAME_LEN_LONG
-										    
+
 #define TRANSFORM_OFFSET_LONG    0
 #define TRANSFORM_OFFSET_SHORT   448
 
diff --git a/media/libstagefright/codecs/aacenc/inc/psy_main.h b/media/libstagefright/codecs/aacenc/inc/psy_main.h
index 5fcbe13..2ccac60 100644
--- a/media/libstagefright/codecs/aacenc/inc/psy_main.h
+++ b/media/libstagefright/codecs/aacenc/inc/psy_main.h
@@ -54,9 +54,9 @@
                     Word16 bandwidth);
 
 
-Word16 psyMain(Word16                   nChannels,   /*!< total number of channels */              
+Word16 psyMain(Word16                   nChannels,   /*!< total number of channels */
                ELEMENT_INFO             *elemInfo,
-               Word16                   *timeSignal, /*!< interleaved time signal */ 
+               Word16                   *timeSignal, /*!< interleaved time signal */
                PSY_DATA                 psyData[MAX_CHANNELS],
                TNS_DATA                 tnsData[MAX_CHANNELS],
                PSY_CONFIGURATION_LONG*  psyConfLong,
diff --git a/media/libstagefright/codecs/aacenc/inc/qc_main.h b/media/libstagefright/codecs/aacenc/inc/qc_main.h
index 924a06d..8f83973 100644
--- a/media/libstagefright/codecs/aacenc/inc/qc_main.h
+++ b/media/libstagefright/codecs/aacenc/inc/qc_main.h
@@ -35,7 +35,7 @@
 
 Word16 QCNew(QC_STATE *hQC, VO_MEM_OPERATOR *pMemOP);
 
-Word16 QCInit(QC_STATE *hQC, 
+Word16 QCInit(QC_STATE *hQC,
               struct QC_INIT *init);
 
 void QCDelete(QC_STATE *hQC, VO_MEM_OPERATOR *pMemOP);
diff --git a/media/libstagefright/codecs/aacenc/inc/quantize.h b/media/libstagefright/codecs/aacenc/inc/quantize.h
index 7dac2bf..1cafef6 100644
--- a/media/libstagefright/codecs/aacenc/inc/quantize.h
+++ b/media/libstagefright/codecs/aacenc/inc/quantize.h
@@ -28,7 +28,7 @@
 
 #define MAX_QUANT 8191
 
-void QuantizeSpectrum(Word16 sfbCnt, 
+void QuantizeSpectrum(Word16 sfbCnt,
                       Word16 maxSfbPerGroup,
                       Word16 sfbPerGroup,
                       Word16 *sfbOffset, Word32 *mdctSpectrum,
diff --git a/media/libstagefright/codecs/aacenc/inc/sf_estim.h b/media/libstagefright/codecs/aacenc/inc/sf_estim.h
index 11436a2..997eba5 100644
--- a/media/libstagefright/codecs/aacenc/inc/sf_estim.h
+++ b/media/libstagefright/codecs/aacenc/inc/sf_estim.h
@@ -23,7 +23,7 @@
 #ifndef __SF_ESTIM_H__
 #define __SF_ESTIM_H__
 /*
-   Scale factor estimation 
+   Scale factor estimation
  */
 #include "psy_const.h"
 #include "interface.h"
@@ -43,4 +43,4 @@
                      Word16          logSfbFormFactor[MAX_CHANNELS][MAX_GROUPED_SFB],
                      Word16          sfbNRelevantLines[MAX_CHANNELS][MAX_GROUPED_SFB],
                      const Word16    nChannels);
-#endif
\ No newline at end of file
+#endif
diff --git a/media/libstagefright/codecs/aacenc/inc/stat_bits.h b/media/libstagefright/codecs/aacenc/inc/stat_bits.h
index fff3d14..9cddc1d 100644
--- a/media/libstagefright/codecs/aacenc/inc/stat_bits.h
+++ b/media/libstagefright/codecs/aacenc/inc/stat_bits.h
@@ -28,7 +28,7 @@
 
 Word16 countStaticBitdemand(PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS],
                             PSY_OUT_ELEMENT *psyOutElement,
-                            Word16 nChannels, 
+                            Word16 nChannels,
 							Word16 adtsUsed);
 
 #endif /* __STAT_BITS_H */
diff --git a/media/libstagefright/codecs/aacenc/inc/tns_param.h b/media/libstagefright/codecs/aacenc/inc/tns_param.h
index 78265bb..0aa33c3 100644
--- a/media/libstagefright/codecs/aacenc/inc/tns_param.h
+++ b/media/libstagefright/codecs/aacenc/inc/tns_param.h
@@ -44,7 +44,7 @@
 }TNS_INFO_TAB;
 
 
-void GetTnsParam(TNS_CONFIG_TABULATED *tnsConfigTab, 
+void GetTnsParam(TNS_CONFIG_TABULATED *tnsConfigTab,
                  Word32 bitRate, Word16 channels, Word16 blockType);
 
 void GetTnsMaxBands(Word32 samplingRate, Word16 blockType, Word16* tnsMaxSfb);
diff --git a/media/libstagefright/codecs/aacenc/inc/transform.h b/media/libstagefright/codecs/aacenc/inc/transform.h
index 93d5ffe..311cef5 100644
--- a/media/libstagefright/codecs/aacenc/inc/transform.h
+++ b/media/libstagefright/codecs/aacenc/inc/transform.h
@@ -24,7 +24,7 @@
 #define __TRANSFORM_H__
 
 #include "typedef.h"
-                  
+
 void Transform_Real(Word16 *mdctDelayBuffer,
                     Word16 *timeSignal,
                     Word16 chIncrement,     /*! channel increment */
@@ -33,4 +33,4 @@
                     Word16 windowSequence
                     );
 
-#endif
\ No newline at end of file
+#endif
diff --git a/media/libstagefright/codecs/aacenc/src/aac_rom.c b/media/libstagefright/codecs/aacenc/src/aac_rom.c
index 16b44e0..127322d 100644
--- a/media/libstagefright/codecs/aacenc/src/aac_rom.c
+++ b/media/libstagefright/codecs/aacenc/src/aac_rom.c
@@ -24,14 +24,14 @@
 
 #if defined (ARMV5E) && !defined (ARMV7Neon)
 
-/* 
- *  Q30 for 128 and 1024 
+/*
+ *  Q30 for 128 and 1024
  *
  * for (i = 0; i < num/4; i++) {
  *   angle = (i + 0.125) * M_PI / num;
  *   x = cos(angle) * (1 << 30);
  *   x = sin(angle) * (1 << 30);
- * 
+ *
  *   angle = (num/2 - 1 - i + 0.125) * M_PI / num;
  *   x = cos(angle) * (1 << 30);
  *   x = sin(angle) * (1 << 30);
@@ -39,313 +39,313 @@
  */
 const int cossintab[128 + 1024] = {
 	/* 128 */
-	0x3fffec43, 0x003243f1, 0x015fd4d2, 0x3ffc38d1, 0x3ff9c13a, 0x01c454f5, 0x02f1b755, 0x3feea776, 
-	0x3fe9b8a9, 0x03562038, 0x0483259d, 0x3fd73a4a, 0x3fcfd50b, 0x04e767c5, 0x0613e1c5, 0x3fb5f4ea, 
-	0x3fac1a5b, 0x0677edbb, 0x07a3adff, 0x3f8adc77, 0x3f7e8e1e, 0x08077457, 0x09324ca7, 0x3f55f796, 
-	0x3f473759, 0x0995bdfd, 0x0abf8043, 0x3f174e70, 0x3f061e95, 0x0b228d42, 0x0c4b0b94, 0x3eceeaad, 
-	0x3ebb4ddb, 0x0cada4f5, 0x0dd4b19a, 0x3e7cd778, 0x3e66d0b4, 0x0e36c82a, 0x0f5c35a3, 0x3e212179, 
-	0x3e08b42a, 0x0fbdba40, 0x10e15b4e, 0x3dbbd6d4, 0x3da106bd, 0x11423ef0, 0x1263e699, 0x3d4d0728, 
-	0x3d2fd86c, 0x12c41a4f, 0x13e39be9, 0x3cd4c38b, 0x3cb53aaa, 0x144310dd, 0x15604013, 0x3c531e88, 
-	0x3c314060, 0x15bee78c, 0x16d99864, 0x3bc82c1f, 0x3ba3fde7, 0x173763c9, 0x184f6aab, 0x3b3401bb, 
-	0x3b0d8909, 0x18ac4b87, 0x19c17d44, 0x3a96b636, 0x3a6df8f8, 0x1a1d6544, 0x1b2f971e, 0x39f061d2, 
-	0x39c5664f, 0x1b8a7815, 0x1c997fc4, 0x39411e33, 0x3913eb0e, 0x1cf34baf, 0x1dfeff67, 0x38890663, 
-	0x3859a292, 0x1e57a86d, 0x1f5fdee6, 0x37c836c2, 0x3796a996, 0x1fb7575c, 0x20bbe7d8, 0x36fecd0e, 
-	0x36cb1e2a, 0x21122240, 0x2212e492, 0x362ce855, 0x35f71fb1, 0x2267d3a0, 0x2364a02e, 0x3552a8f4, 
-	0x351acedd, 0x23b836ca, 0x24b0e699, 0x34703095, 0x34364da6, 0x250317df, 0x25f78497, 0x3385a222, 
-	0x3349bf48, 0x264843d9, 0x273847c8, 0x329321c7, 0x32554840, 0x27878893, 0x2872feb6, 0x3198d4ea, 
-	0x31590e3e, 0x28c0b4d2, 0x29a778db, 0x3096e223, 0x30553828, 0x29f3984c, 0x2ad586a3, 0x2f8d713a, 
-	0x2f49ee0f, 0x2b2003ac, 0x2bfcf97c, 0x2e7cab1c, 0x2e37592c, 0x2c45c8a0, 0x2d1da3d5, 0x2d64b9da, 
+	0x3fffec43, 0x003243f1, 0x015fd4d2, 0x3ffc38d1, 0x3ff9c13a, 0x01c454f5, 0x02f1b755, 0x3feea776,
+	0x3fe9b8a9, 0x03562038, 0x0483259d, 0x3fd73a4a, 0x3fcfd50b, 0x04e767c5, 0x0613e1c5, 0x3fb5f4ea,
+	0x3fac1a5b, 0x0677edbb, 0x07a3adff, 0x3f8adc77, 0x3f7e8e1e, 0x08077457, 0x09324ca7, 0x3f55f796,
+	0x3f473759, 0x0995bdfd, 0x0abf8043, 0x3f174e70, 0x3f061e95, 0x0b228d42, 0x0c4b0b94, 0x3eceeaad,
+	0x3ebb4ddb, 0x0cada4f5, 0x0dd4b19a, 0x3e7cd778, 0x3e66d0b4, 0x0e36c82a, 0x0f5c35a3, 0x3e212179,
+	0x3e08b42a, 0x0fbdba40, 0x10e15b4e, 0x3dbbd6d4, 0x3da106bd, 0x11423ef0, 0x1263e699, 0x3d4d0728,
+	0x3d2fd86c, 0x12c41a4f, 0x13e39be9, 0x3cd4c38b, 0x3cb53aaa, 0x144310dd, 0x15604013, 0x3c531e88,
+	0x3c314060, 0x15bee78c, 0x16d99864, 0x3bc82c1f, 0x3ba3fde7, 0x173763c9, 0x184f6aab, 0x3b3401bb,
+	0x3b0d8909, 0x18ac4b87, 0x19c17d44, 0x3a96b636, 0x3a6df8f8, 0x1a1d6544, 0x1b2f971e, 0x39f061d2,
+	0x39c5664f, 0x1b8a7815, 0x1c997fc4, 0x39411e33, 0x3913eb0e, 0x1cf34baf, 0x1dfeff67, 0x38890663,
+	0x3859a292, 0x1e57a86d, 0x1f5fdee6, 0x37c836c2, 0x3796a996, 0x1fb7575c, 0x20bbe7d8, 0x36fecd0e,
+	0x36cb1e2a, 0x21122240, 0x2212e492, 0x362ce855, 0x35f71fb1, 0x2267d3a0, 0x2364a02e, 0x3552a8f4,
+	0x351acedd, 0x23b836ca, 0x24b0e699, 0x34703095, 0x34364da6, 0x250317df, 0x25f78497, 0x3385a222,
+	0x3349bf48, 0x264843d9, 0x273847c8, 0x329321c7, 0x32554840, 0x27878893, 0x2872feb6, 0x3198d4ea,
+	0x31590e3e, 0x28c0b4d2, 0x29a778db, 0x3096e223, 0x30553828, 0x29f3984c, 0x2ad586a3, 0x2f8d713a,
+	0x2f49ee0f, 0x2b2003ac, 0x2bfcf97c, 0x2e7cab1c, 0x2e37592c, 0x2c45c8a0, 0x2d1da3d5, 0x2d64b9da,
 	/* 1024 */
-	0x3fffffb1, 0x0006487f, 0x002bfb74, 0x3ffff0e3, 0x3fffe705, 0x00388c6e, 0x005e3f4c, 0x3fffba9b, 
-	0x3fffa6de, 0x006ad03b, 0x009082ea, 0x3fff5cd8, 0x3fff3f3c, 0x009d13c5, 0x00c2c62f, 0x3ffed79b, 
-	0x3ffeb021, 0x00cf56ef, 0x00f508fc, 0x3ffe2ae5, 0x3ffdf98c, 0x01019998, 0x01274b31, 0x3ffd56b5, 
-	0x3ffd1b7e, 0x0133dba3, 0x01598cb1, 0x3ffc5b0c, 0x3ffc15f7, 0x01661cf0, 0x018bcd5b, 0x3ffb37ec, 
-	0x3ffae8f9, 0x01985d60, 0x01be0d11, 0x3ff9ed53, 0x3ff99483, 0x01ca9cd4, 0x01f04bb4, 0x3ff87b44, 
-	0x3ff81896, 0x01fcdb2e, 0x02228924, 0x3ff6e1bf, 0x3ff67534, 0x022f184d, 0x0254c544, 0x3ff520c5, 
-	0x3ff4aa5d, 0x02615414, 0x0286fff3, 0x3ff33858, 0x3ff2b813, 0x02938e62, 0x02b93914, 0x3ff12878, 
-	0x3ff09e56, 0x02c5c71a, 0x02eb7086, 0x3feef126, 0x3fee5d28, 0x02f7fe1c, 0x031da62b, 0x3fec9265, 
-	0x3febf48b, 0x032a3349, 0x034fd9e5, 0x3fea0c35, 0x3fe96480, 0x035c6682, 0x03820b93, 0x3fe75e98, 
-	0x3fe6ad08, 0x038e97a9, 0x03b43b17, 0x3fe48990, 0x3fe3ce26, 0x03c0c69e, 0x03e66852, 0x3fe18d1f, 
-	0x3fe0c7da, 0x03f2f342, 0x04189326, 0x3fde6945, 0x3fdd9a27, 0x04251d77, 0x044abb73, 0x3fdb1e06, 
-	0x3fda450f, 0x0457451d, 0x047ce11a, 0x3fd7ab64, 0x3fd6c894, 0x04896a16, 0x04af03fc, 0x3fd4115f, 
-	0x3fd324b7, 0x04bb8c42, 0x04e123fa, 0x3fd04ffc, 0x3fcf597c, 0x04edab83, 0x051340f6, 0x3fcc673b, 
-	0x3fcb66e4, 0x051fc7b9, 0x05455ad1, 0x3fc8571f, 0x3fc74cf3, 0x0551e0c7, 0x0577716b, 0x3fc41fac, 
-	0x3fc30baa, 0x0583f68c, 0x05a984a6, 0x3fbfc0e3, 0x3fbea30c, 0x05b608eb, 0x05db9463, 0x3fbb3ac7, 
-	0x3fba131b, 0x05e817c3, 0x060da083, 0x3fb68d5b, 0x3fb55bdc, 0x061a22f7, 0x063fa8e7, 0x3fb1b8a2, 
-	0x3fb07d50, 0x064c2a67, 0x0671ad71, 0x3facbc9f, 0x3fab777b, 0x067e2df5, 0x06a3ae00, 0x3fa79954, 
-	0x3fa64a5f, 0x06b02d81, 0x06d5aa77, 0x3fa24ec6, 0x3fa0f600, 0x06e228ee, 0x0707a2b7, 0x3f9cdcf7, 
-	0x3f9b7a62, 0x0714201b, 0x073996a1, 0x3f9743eb, 0x3f95d787, 0x074612eb, 0x076b8616, 0x3f9183a5, 
-	0x3f900d72, 0x0778013d, 0x079d70f7, 0x3f8b9c28, 0x3f8a1c29, 0x07a9eaf5, 0x07cf5726, 0x3f858d79, 
-	0x3f8403ae, 0x07dbcff2, 0x08013883, 0x3f7f579b, 0x3f7dc405, 0x080db016, 0x083314f1, 0x3f78fa92, 
-	0x3f775d31, 0x083f8b43, 0x0864ec4f, 0x3f727661, 0x3f70cf38, 0x08716159, 0x0896be80, 0x3f6bcb0e, 
-	0x3f6a1a1c, 0x08a3323a, 0x08c88b65, 0x3f64f89b, 0x3f633de2, 0x08d4fdc6, 0x08fa52de, 0x3f5dff0e, 
-	0x3f5c3a8f, 0x0906c3e0, 0x092c14ce, 0x3f56de6a, 0x3f551026, 0x09388469, 0x095dd116, 0x3f4f96b4, 
-	0x3f4dbeac, 0x096a3f42, 0x098f8796, 0x3f4827f0, 0x3f464626, 0x099bf44c, 0x09c13831, 0x3f409223, 
-	0x3f3ea697, 0x09cda368, 0x09f2e2c7, 0x3f38d552, 0x3f36e006, 0x09ff4c78, 0x0a24873a, 0x3f30f181, 
-	0x3f2ef276, 0x0a30ef5e, 0x0a56256c, 0x3f28e6b6, 0x3f26ddec, 0x0a628bfa, 0x0a87bd3d, 0x3f20b4f5, 
-	0x3f1ea26e, 0x0a94222f, 0x0ab94e8f, 0x3f185c43, 0x3f164001, 0x0ac5b1dc, 0x0aead944, 0x3f0fdca5, 
-	0x3f0db6a9, 0x0af73ae5, 0x0b1c5d3d, 0x3f073621, 0x3f05066d, 0x0b28bd2a, 0x0b4dda5c, 0x3efe68bc, 
-	0x3efc2f50, 0x0b5a388d, 0x0b7f5081, 0x3ef5747b, 0x3ef3315a, 0x0b8bacf0, 0x0bb0bf8f, 0x3eec5965, 
-	0x3eea0c8e, 0x0bbd1a33, 0x0be22766, 0x3ee3177e, 0x3ee0c0f4, 0x0bee8038, 0x0c1387e9, 0x3ed9aecc, 
-	0x3ed74e91, 0x0c1fdee1, 0x0c44e0f9, 0x3ed01f55, 0x3ecdb56a, 0x0c513610, 0x0c763278, 0x3ec66920, 
-	0x3ec3f585, 0x0c8285a5, 0x0ca77c47, 0x3ebc8c31, 0x3eba0ee9, 0x0cb3cd84, 0x0cd8be47, 0x3eb2888f, 
-	0x3eb0019c, 0x0ce50d8c, 0x0d09f85b, 0x3ea85e41, 0x3ea5cda3, 0x0d1645a0, 0x0d3b2a64, 0x3e9e0d4c, 
-	0x3e9b7306, 0x0d4775a1, 0x0d6c5443, 0x3e9395b7, 0x3e90f1ca, 0x0d789d71, 0x0d9d75db, 0x3e88f788, 
-	0x3e8649f5, 0x0da9bcf2, 0x0dce8f0d, 0x3e7e32c6, 0x3e7b7b90, 0x0ddad406, 0x0dff9fba, 0x3e734778, 
-	0x3e70869f, 0x0e0be28e, 0x0e30a7c5, 0x3e6835a4, 0x3e656b2b, 0x0e3ce86b, 0x0e61a70f, 0x3e5cfd51, 
-	0x3e5a2939, 0x0e6de580, 0x0e929d7a, 0x3e519e86, 0x3e4ec0d1, 0x0e9ed9af, 0x0ec38ae8, 0x3e46194a, 
-	0x3e4331fa, 0x0ecfc4d9, 0x0ef46f3b, 0x3e3a6da4, 0x3e377cbb, 0x0f00a6df, 0x0f254a53, 0x3e2e9b9c, 
-	0x3e2ba11b, 0x0f317fa5, 0x0f561c15, 0x3e22a338, 0x3e1f9f21, 0x0f624f0c, 0x0f86e460, 0x3e168480, 
-	0x3e1376d5, 0x0f9314f5, 0x0fb7a317, 0x3e0a3f7b, 0x3e07283f, 0x0fc3d143, 0x0fe8581d, 0x3dfdd432, 
-	0x3dfab365, 0x0ff483d7, 0x10190352, 0x3df142ab, 0x3dee1851, 0x10252c94, 0x1049a49a, 0x3de48aef, 
-	0x3de15708, 0x1055cb5b, 0x107a3bd5, 0x3dd7ad05, 0x3dd46f94, 0x1086600e, 0x10aac8e6, 0x3dcaa8f5, 
-	0x3dc761fc, 0x10b6ea90, 0x10db4baf, 0x3dbd7ec7, 0x3dba2e48, 0x10e76ac3, 0x110bc413, 0x3db02e84, 
-	0x3dacd481, 0x1117e088, 0x113c31f3, 0x3da2b834, 0x3d9f54af, 0x11484bc2, 0x116c9531, 0x3d951bde, 
-	0x3d91aed9, 0x1178ac53, 0x119cedaf, 0x3d87598c, 0x3d83e309, 0x11a9021d, 0x11cd3b50, 0x3d797145, 
-	0x3d75f147, 0x11d94d02, 0x11fd7df6, 0x3d6b6313, 0x3d67d99b, 0x12098ce5, 0x122db583, 0x3d5d2efe, 
-	0x3d599c0e, 0x1239c1a7, 0x125de1da, 0x3d4ed50f, 0x3d4b38aa, 0x1269eb2b, 0x128e02dc, 0x3d40554e, 
-	0x3d3caf76, 0x129a0954, 0x12be186c, 0x3d31afc5, 0x3d2e007c, 0x12ca1c03, 0x12ee226c, 0x3d22e47c, 
-	0x3d1f2bc5, 0x12fa231b, 0x131e20c0, 0x3d13f37e, 0x3d10315a, 0x132a1e7e, 0x134e1348, 0x3d04dcd2, 
-	0x3d011145, 0x135a0e0e, 0x137df9e7, 0x3cf5a082, 0x3cf1cb8e, 0x1389f1af, 0x13add481, 0x3ce63e98, 
-	0x3ce2603f, 0x13b9c943, 0x13dda2f7, 0x3cd6b71e, 0x3cd2cf62, 0x13e994ab, 0x140d652c, 0x3cc70a1c, 
-	0x3cc318ff, 0x141953cb, 0x143d1b02, 0x3cb7379c, 0x3cb33d22, 0x14490685, 0x146cc45c, 0x3ca73fa9, 
-	0x3ca33bd3, 0x1478acbc, 0x149c611d, 0x3c97224c, 0x3c93151d, 0x14a84652, 0x14cbf127, 0x3c86df8e, 
-	0x3c82c909, 0x14d7d32a, 0x14fb745e, 0x3c76777b, 0x3c7257a2, 0x15075327, 0x152aeaa3, 0x3c65ea1c, 
-	0x3c61c0f1, 0x1536c62b, 0x155a53d9, 0x3c55377b, 0x3c510501, 0x15662c18, 0x1589afe3, 0x3c445fa2, 
-	0x3c4023dd, 0x159584d3, 0x15b8fea4, 0x3c33629d, 0x3c2f1d8e, 0x15c4d03e, 0x15e83fff, 0x3c224075, 
-	0x3c1df21f, 0x15f40e3a, 0x161773d6, 0x3c10f935, 0x3c0ca19b, 0x16233eac, 0x16469a0d, 0x3bff8ce8, 
-	0x3bfb2c0c, 0x16526176, 0x1675b286, 0x3bedfb99, 0x3be9917e, 0x1681767c, 0x16a4bd25, 0x3bdc4552, 
-	0x3bd7d1fa, 0x16b07d9f, 0x16d3b9cc, 0x3bca6a1d, 0x3bc5ed8d, 0x16df76c3, 0x1702a85e, 0x3bb86a08, 
-	0x3bb3e440, 0x170e61cc, 0x173188be, 0x3ba6451b, 0x3ba1b620, 0x173d3e9b, 0x17605ad0, 0x3b93fb63, 
-	0x3b8f6337, 0x176c0d15, 0x178f1e76, 0x3b818ceb, 0x3b7ceb90, 0x179acd1c, 0x17bdd394, 0x3b6ef9be, 
-	0x3b6a4f38, 0x17c97e93, 0x17ec7a0d, 0x3b5c41e8, 0x3b578e39, 0x17f8215e, 0x181b11c4, 0x3b496574, 
-	0x3b44a8a0, 0x1826b561, 0x18499a9d, 0x3b36646e, 0x3b319e77, 0x18553a7d, 0x1878147a, 0x3b233ee1, 
-	0x3b1e6fca, 0x1883b097, 0x18a67f3f, 0x3b0ff4d9, 0x3b0b1ca6, 0x18b21791, 0x18d4dad0, 0x3afc8663, 
-	0x3af7a516, 0x18e06f50, 0x1903270f, 0x3ae8f38b, 0x3ae40926, 0x190eb7b7, 0x193163e1, 0x3ad53c5b, 
-	0x3ad048e3, 0x193cf0a9, 0x195f9128, 0x3ac160e1, 0x3abc6458, 0x196b1a09, 0x198daec8, 0x3aad6129, 
-	0x3aa85b92, 0x199933bb, 0x19bbbca6, 0x3a993d3e, 0x3a942e9d, 0x19c73da3, 0x19e9baa3, 0x3a84f52f, 
-	0x3a7fdd86, 0x19f537a4, 0x1a17a8a5, 0x3a708906, 0x3a6b6859, 0x1a2321a2, 0x1a45868e, 0x3a5bf8d1, 
-	0x3a56cf23, 0x1a50fb81, 0x1a735442, 0x3a47449c, 0x3a4211f0, 0x1a7ec524, 0x1aa111a6, 0x3a326c74, 
-	0x3a2d30cd, 0x1aac7e6f, 0x1acebe9d, 0x3a1d7066, 0x3a182bc8, 0x1ada2746, 0x1afc5b0a, 0x3a08507f, 
-	0x3a0302ed, 0x1b07bf8c, 0x1b29e6d2, 0x39f30ccc, 0x39edb649, 0x1b354727, 0x1b5761d8, 0x39dda55a, 
-	0x39d845e9, 0x1b62bdf8, 0x1b84cc01, 0x39c81a36, 0x39c2b1da, 0x1b9023e5, 0x1bb22530, 0x39b26b6d, 
-	0x39acfa2b, 0x1bbd78d2, 0x1bdf6d4a, 0x399c990d, 0x39971ee7, 0x1beabca1, 0x1c0ca432, 0x3986a324, 
-	0x3981201e, 0x1c17ef39, 0x1c39c9cd, 0x397089bf, 0x396afddc, 0x1c45107c, 0x1c66ddfe, 0x395a4ceb, 
-	0x3954b82e, 0x1c72204f, 0x1c93e0ab, 0x3943ecb6, 0x393e4f23, 0x1c9f1e96, 0x1cc0d1b6, 0x392d692f, 
-	0x3927c2c9, 0x1ccc0b35, 0x1cedb106, 0x3916c262, 0x3911132d, 0x1cf8e611, 0x1d1a7e7d, 0x38fff85e, 
-	0x38fa405e, 0x1d25af0d, 0x1d473a00, 0x38e90b31, 0x38e34a69, 0x1d52660f, 0x1d73e374, 0x38d1fae9, 
-	0x38cc315d, 0x1d7f0afb, 0x1da07abc, 0x38bac795, 0x38b4f547, 0x1dab9db5, 0x1dccffbf, 0x38a37142, 
-	0x389d9637, 0x1dd81e21, 0x1df9725f, 0x388bf7ff, 0x3886143b, 0x1e048c24, 0x1e25d282, 0x38745bdb, 
-	0x386e6f60, 0x1e30e7a4, 0x1e52200c, 0x385c9ce3, 0x3856a7b6, 0x1e5d3084, 0x1e7e5ae2, 0x3844bb28, 
-	0x383ebd4c, 0x1e8966a8, 0x1eaa82e9, 0x382cb6b7, 0x3826b030, 0x1eb589f7, 0x1ed69805, 0x38148f9f, 
-	0x380e8071, 0x1ee19a54, 0x1f029a1c, 0x37fc45ef, 0x37f62e1d, 0x1f0d97a5, 0x1f2e8911, 0x37e3d9b7, 
-	0x37ddb945, 0x1f3981ce, 0x1f5a64cb, 0x37cb4b04, 0x37c521f6, 0x1f6558b5, 0x1f862d2d, 0x37b299e7, 
-	0x37ac6841, 0x1f911c3d, 0x1fb1e21d, 0x3799c66f, 0x37938c34, 0x1fbccc4d, 0x1fdd8381, 0x3780d0aa, 
-	0x377a8ddf, 0x1fe868c8, 0x2009113c, 0x3767b8a9, 0x37616d51, 0x2013f196, 0x20348b35, 0x374e7e7b, 
-	0x37482a9a, 0x203f6699, 0x205ff14f, 0x3735222f, 0x372ec5c9, 0x206ac7b8, 0x208b4372, 0x371ba3d4, 
-	0x37153eee, 0x209614d9, 0x20b68181, 0x3702037c, 0x36fb9618, 0x20c14ddf, 0x20e1ab63, 0x36e84135, 
-	0x36e1cb58, 0x20ec72b1, 0x210cc0fc, 0x36ce5d10, 0x36c7debd, 0x21178334, 0x2137c232, 0x36b4571b, 
-	0x36add058, 0x21427f4d, 0x2162aeea, 0x369a2f69, 0x3693a038, 0x216d66e2, 0x218d870b, 0x367fe608, 
-	0x36794e6e, 0x219839d8, 0x21b84a79, 0x36657b08, 0x365edb09, 0x21c2f815, 0x21e2f91a, 0x364aee7b, 
-	0x3644461b, 0x21eda17f, 0x220d92d4, 0x36304070, 0x36298fb4, 0x221835fb, 0x2238178d, 0x361570f8, 
-	0x360eb7e3, 0x2242b56f, 0x22628729, 0x35fa8023, 0x35f3beba, 0x226d1fc1, 0x228ce191, 0x35df6e03, 
-	0x35d8a449, 0x229774d7, 0x22b726a8, 0x35c43aa7, 0x35bd68a1, 0x22c1b496, 0x22e15655, 0x35a8e621, 
-	0x35a20bd3, 0x22ebdee5, 0x230b707e, 0x358d7081, 0x35868def, 0x2315f3a8, 0x23357509, 0x3571d9d9, 
-	0x356aef08, 0x233ff2c8, 0x235f63dc, 0x35562239, 0x354f2f2c, 0x2369dc29, 0x23893cdd, 0x353a49b2, 
-	0x35334e6f, 0x2393afb2, 0x23b2fff3, 0x351e5056, 0x35174ce0, 0x23bd6d48, 0x23dcad03, 0x35023636, 
-	0x34fb2a92, 0x23e714d3, 0x240643f4, 0x34e5fb63, 0x34dee795, 0x2410a639, 0x242fc4ad, 0x34c99fef, 
-	0x34c283fb, 0x243a215f, 0x24592f13, 0x34ad23eb, 0x34a5ffd5, 0x2463862c, 0x2482830d, 0x34908768, 
-	0x34895b36, 0x248cd487, 0x24abc082, 0x3473ca79, 0x346c962f, 0x24b60c57, 0x24d4e757, 0x3456ed2f, 
-	0x344fb0d1, 0x24df2d81, 0x24fdf775, 0x3439ef9c, 0x3432ab2e, 0x250837ed, 0x2526f0c1, 0x341cd1d2, 
-	0x34158559, 0x25312b81, 0x254fd323, 0x33ff93e2, 0x33f83f62, 0x255a0823, 0x25789e80, 0x33e235df, 
-	0x33dad95e, 0x2582cdbc, 0x25a152c0, 0x33c4b7db, 0x33bd535c, 0x25ab7c30, 0x25c9efca, 0x33a719e8, 
-	0x339fad70, 0x25d41369, 0x25f27584, 0x33895c18, 0x3381e7ac, 0x25fc934b, 0x261ae3d6, 0x336b7e7e, 
-	0x33640223, 0x2624fbbf, 0x26433aa7, 0x334d812d, 0x3345fce6, 0x264d4cac, 0x266b79dd, 0x332f6435, 
-	0x3327d808, 0x267585f8, 0x2693a161, 0x331127ab, 0x3309939c, 0x269da78b, 0x26bbb119, 0x32f2cba1, 
-	0x32eb2fb5, 0x26c5b14c, 0x26e3a8ec, 0x32d45029, 0x32ccac64, 0x26eda322, 0x270b88c2, 0x32b5b557, 
-	0x32ae09be, 0x27157cf5, 0x27335082, 0x3296fb3d, 0x328f47d5, 0x273d3eac, 0x275b0014, 0x327821ee, 
-	0x327066bc, 0x2764e82f, 0x27829760, 0x3259297d, 0x32516686, 0x278c7965, 0x27aa164c, 0x323a11fe, 
-	0x32324746, 0x27b3f235, 0x27d17cc1, 0x321adb83, 0x3213090f, 0x27db5288, 0x27f8caa5, 0x31fb8620, 
-	0x31f3abf5, 0x28029a45, 0x281fffe2, 0x31dc11e8, 0x31d4300b, 0x2829c954, 0x28471c5e, 0x31bc7eee, 
-	0x31b49564, 0x2850df9d, 0x286e2002, 0x319ccd46, 0x3194dc14, 0x2877dd07, 0x28950ab6, 0x317cfd04, 
-	0x3175042e, 0x289ec17a, 0x28bbdc61, 0x315d0e3b, 0x31550dc6, 0x28c58cdf, 0x28e294eb, 0x313d00ff, 
-	0x3134f8f1, 0x28ec3f1e, 0x2909343e, 0x311cd564, 0x3114c5c0, 0x2912d81f, 0x292fba40, 0x30fc8b7d, 
-	0x30f47449, 0x293957c9, 0x295626da, 0x30dc235e, 0x30d404a0, 0x295fbe06, 0x297c79f5, 0x30bb9d1c, 
-	0x30b376d8, 0x29860abd, 0x29a2b378, 0x309af8ca, 0x3092cb05, 0x29ac3dd7, 0x29c8d34d, 0x307a367c, 
-	0x3072013c, 0x29d2573c, 0x29eed95b, 0x30595648, 0x30511991, 0x29f856d5, 0x2a14c58b, 0x30385840, 
-	0x30301418, 0x2a1e3c8a, 0x2a3a97c7, 0x30173c7a, 0x300ef0e5, 0x2a440844, 0x2a604ff5, 0x2ff6030a, 
-	0x2fedb00d, 0x2a69b9ec, 0x2a85ee00, 0x2fd4ac04, 0x2fcc51a5, 0x2a8f516b, 0x2aab71d0, 0x2fb3377c, 
-	0x2faad5c1, 0x2ab4cea9, 0x2ad0db4e, 0x2f91a589, 0x2f893c75, 0x2ada318e, 0x2af62a63, 0x2f6ff63d, 
-	0x2f6785d7, 0x2aff7a05, 0x2b1b5ef8, 0x2f4e29af, 0x2f45b1fb, 0x2b24a7f6, 0x2b4078f5, 0x2f2c3ff2, 
-	0x2f23c0f6, 0x2b49bb4a, 0x2b657844, 0x2f0a391d, 0x2f01b2de, 0x2b6eb3ea, 0x2b8a5cce, 0x2ee81543, 
-	0x2edf87c6, 0x2b9391c0, 0x2baf267d, 0x2ec5d479, 0x2ebd3fc4, 0x2bb854b4, 0x2bd3d53a, 0x2ea376d6, 
-	0x2e9adaee, 0x2bdcfcb0, 0x2bf868ed, 0x2e80fc6e, 0x2e785958, 0x2c01899e, 0x2c1ce181, 0x2e5e6556, 
-	0x2e55bb17, 0x2c25fb66, 0x2c413edf, 0x2e3bb1a4, 0x2e330042, 0x2c4a51f3, 0x2c6580f1, 0x2e18e16d, 
-	0x2e1028ed, 0x2c6e8d2e, 0x2c89a79f, 0x2df5f4c7, 0x2ded352f, 0x2c92ad01, 0x2cadb2d5, 0x2dd2ebc7, 
-	0x2dca251c, 0x2cb6b155, 0x2cd1a27b, 0x2dafc683, 0x2da6f8ca, 0x2cda9a14, 0x2cf5767c, 0x2d8c8510, 
+	0x3fffffb1, 0x0006487f, 0x002bfb74, 0x3ffff0e3, 0x3fffe705, 0x00388c6e, 0x005e3f4c, 0x3fffba9b,
+	0x3fffa6de, 0x006ad03b, 0x009082ea, 0x3fff5cd8, 0x3fff3f3c, 0x009d13c5, 0x00c2c62f, 0x3ffed79b,
+	0x3ffeb021, 0x00cf56ef, 0x00f508fc, 0x3ffe2ae5, 0x3ffdf98c, 0x01019998, 0x01274b31, 0x3ffd56b5,
+	0x3ffd1b7e, 0x0133dba3, 0x01598cb1, 0x3ffc5b0c, 0x3ffc15f7, 0x01661cf0, 0x018bcd5b, 0x3ffb37ec,
+	0x3ffae8f9, 0x01985d60, 0x01be0d11, 0x3ff9ed53, 0x3ff99483, 0x01ca9cd4, 0x01f04bb4, 0x3ff87b44,
+	0x3ff81896, 0x01fcdb2e, 0x02228924, 0x3ff6e1bf, 0x3ff67534, 0x022f184d, 0x0254c544, 0x3ff520c5,
+	0x3ff4aa5d, 0x02615414, 0x0286fff3, 0x3ff33858, 0x3ff2b813, 0x02938e62, 0x02b93914, 0x3ff12878,
+	0x3ff09e56, 0x02c5c71a, 0x02eb7086, 0x3feef126, 0x3fee5d28, 0x02f7fe1c, 0x031da62b, 0x3fec9265,
+	0x3febf48b, 0x032a3349, 0x034fd9e5, 0x3fea0c35, 0x3fe96480, 0x035c6682, 0x03820b93, 0x3fe75e98,
+	0x3fe6ad08, 0x038e97a9, 0x03b43b17, 0x3fe48990, 0x3fe3ce26, 0x03c0c69e, 0x03e66852, 0x3fe18d1f,
+	0x3fe0c7da, 0x03f2f342, 0x04189326, 0x3fde6945, 0x3fdd9a27, 0x04251d77, 0x044abb73, 0x3fdb1e06,
+	0x3fda450f, 0x0457451d, 0x047ce11a, 0x3fd7ab64, 0x3fd6c894, 0x04896a16, 0x04af03fc, 0x3fd4115f,
+	0x3fd324b7, 0x04bb8c42, 0x04e123fa, 0x3fd04ffc, 0x3fcf597c, 0x04edab83, 0x051340f6, 0x3fcc673b,
+	0x3fcb66e4, 0x051fc7b9, 0x05455ad1, 0x3fc8571f, 0x3fc74cf3, 0x0551e0c7, 0x0577716b, 0x3fc41fac,
+	0x3fc30baa, 0x0583f68c, 0x05a984a6, 0x3fbfc0e3, 0x3fbea30c, 0x05b608eb, 0x05db9463, 0x3fbb3ac7,
+	0x3fba131b, 0x05e817c3, 0x060da083, 0x3fb68d5b, 0x3fb55bdc, 0x061a22f7, 0x063fa8e7, 0x3fb1b8a2,
+	0x3fb07d50, 0x064c2a67, 0x0671ad71, 0x3facbc9f, 0x3fab777b, 0x067e2df5, 0x06a3ae00, 0x3fa79954,
+	0x3fa64a5f, 0x06b02d81, 0x06d5aa77, 0x3fa24ec6, 0x3fa0f600, 0x06e228ee, 0x0707a2b7, 0x3f9cdcf7,
+	0x3f9b7a62, 0x0714201b, 0x073996a1, 0x3f9743eb, 0x3f95d787, 0x074612eb, 0x076b8616, 0x3f9183a5,
+	0x3f900d72, 0x0778013d, 0x079d70f7, 0x3f8b9c28, 0x3f8a1c29, 0x07a9eaf5, 0x07cf5726, 0x3f858d79,
+	0x3f8403ae, 0x07dbcff2, 0x08013883, 0x3f7f579b, 0x3f7dc405, 0x080db016, 0x083314f1, 0x3f78fa92,
+	0x3f775d31, 0x083f8b43, 0x0864ec4f, 0x3f727661, 0x3f70cf38, 0x08716159, 0x0896be80, 0x3f6bcb0e,
+	0x3f6a1a1c, 0x08a3323a, 0x08c88b65, 0x3f64f89b, 0x3f633de2, 0x08d4fdc6, 0x08fa52de, 0x3f5dff0e,
+	0x3f5c3a8f, 0x0906c3e0, 0x092c14ce, 0x3f56de6a, 0x3f551026, 0x09388469, 0x095dd116, 0x3f4f96b4,
+	0x3f4dbeac, 0x096a3f42, 0x098f8796, 0x3f4827f0, 0x3f464626, 0x099bf44c, 0x09c13831, 0x3f409223,
+	0x3f3ea697, 0x09cda368, 0x09f2e2c7, 0x3f38d552, 0x3f36e006, 0x09ff4c78, 0x0a24873a, 0x3f30f181,
+	0x3f2ef276, 0x0a30ef5e, 0x0a56256c, 0x3f28e6b6, 0x3f26ddec, 0x0a628bfa, 0x0a87bd3d, 0x3f20b4f5,
+	0x3f1ea26e, 0x0a94222f, 0x0ab94e8f, 0x3f185c43, 0x3f164001, 0x0ac5b1dc, 0x0aead944, 0x3f0fdca5,
+	0x3f0db6a9, 0x0af73ae5, 0x0b1c5d3d, 0x3f073621, 0x3f05066d, 0x0b28bd2a, 0x0b4dda5c, 0x3efe68bc,
+	0x3efc2f50, 0x0b5a388d, 0x0b7f5081, 0x3ef5747b, 0x3ef3315a, 0x0b8bacf0, 0x0bb0bf8f, 0x3eec5965,
+	0x3eea0c8e, 0x0bbd1a33, 0x0be22766, 0x3ee3177e, 0x3ee0c0f4, 0x0bee8038, 0x0c1387e9, 0x3ed9aecc,
+	0x3ed74e91, 0x0c1fdee1, 0x0c44e0f9, 0x3ed01f55, 0x3ecdb56a, 0x0c513610, 0x0c763278, 0x3ec66920,
+	0x3ec3f585, 0x0c8285a5, 0x0ca77c47, 0x3ebc8c31, 0x3eba0ee9, 0x0cb3cd84, 0x0cd8be47, 0x3eb2888f,
+	0x3eb0019c, 0x0ce50d8c, 0x0d09f85b, 0x3ea85e41, 0x3ea5cda3, 0x0d1645a0, 0x0d3b2a64, 0x3e9e0d4c,
+	0x3e9b7306, 0x0d4775a1, 0x0d6c5443, 0x3e9395b7, 0x3e90f1ca, 0x0d789d71, 0x0d9d75db, 0x3e88f788,
+	0x3e8649f5, 0x0da9bcf2, 0x0dce8f0d, 0x3e7e32c6, 0x3e7b7b90, 0x0ddad406, 0x0dff9fba, 0x3e734778,
+	0x3e70869f, 0x0e0be28e, 0x0e30a7c5, 0x3e6835a4, 0x3e656b2b, 0x0e3ce86b, 0x0e61a70f, 0x3e5cfd51,
+	0x3e5a2939, 0x0e6de580, 0x0e929d7a, 0x3e519e86, 0x3e4ec0d1, 0x0e9ed9af, 0x0ec38ae8, 0x3e46194a,
+	0x3e4331fa, 0x0ecfc4d9, 0x0ef46f3b, 0x3e3a6da4, 0x3e377cbb, 0x0f00a6df, 0x0f254a53, 0x3e2e9b9c,
+	0x3e2ba11b, 0x0f317fa5, 0x0f561c15, 0x3e22a338, 0x3e1f9f21, 0x0f624f0c, 0x0f86e460, 0x3e168480,
+	0x3e1376d5, 0x0f9314f5, 0x0fb7a317, 0x3e0a3f7b, 0x3e07283f, 0x0fc3d143, 0x0fe8581d, 0x3dfdd432,
+	0x3dfab365, 0x0ff483d7, 0x10190352, 0x3df142ab, 0x3dee1851, 0x10252c94, 0x1049a49a, 0x3de48aef,
+	0x3de15708, 0x1055cb5b, 0x107a3bd5, 0x3dd7ad05, 0x3dd46f94, 0x1086600e, 0x10aac8e6, 0x3dcaa8f5,
+	0x3dc761fc, 0x10b6ea90, 0x10db4baf, 0x3dbd7ec7, 0x3dba2e48, 0x10e76ac3, 0x110bc413, 0x3db02e84,
+	0x3dacd481, 0x1117e088, 0x113c31f3, 0x3da2b834, 0x3d9f54af, 0x11484bc2, 0x116c9531, 0x3d951bde,
+	0x3d91aed9, 0x1178ac53, 0x119cedaf, 0x3d87598c, 0x3d83e309, 0x11a9021d, 0x11cd3b50, 0x3d797145,
+	0x3d75f147, 0x11d94d02, 0x11fd7df6, 0x3d6b6313, 0x3d67d99b, 0x12098ce5, 0x122db583, 0x3d5d2efe,
+	0x3d599c0e, 0x1239c1a7, 0x125de1da, 0x3d4ed50f, 0x3d4b38aa, 0x1269eb2b, 0x128e02dc, 0x3d40554e,
+	0x3d3caf76, 0x129a0954, 0x12be186c, 0x3d31afc5, 0x3d2e007c, 0x12ca1c03, 0x12ee226c, 0x3d22e47c,
+	0x3d1f2bc5, 0x12fa231b, 0x131e20c0, 0x3d13f37e, 0x3d10315a, 0x132a1e7e, 0x134e1348, 0x3d04dcd2,
+	0x3d011145, 0x135a0e0e, 0x137df9e7, 0x3cf5a082, 0x3cf1cb8e, 0x1389f1af, 0x13add481, 0x3ce63e98,
+	0x3ce2603f, 0x13b9c943, 0x13dda2f7, 0x3cd6b71e, 0x3cd2cf62, 0x13e994ab, 0x140d652c, 0x3cc70a1c,
+	0x3cc318ff, 0x141953cb, 0x143d1b02, 0x3cb7379c, 0x3cb33d22, 0x14490685, 0x146cc45c, 0x3ca73fa9,
+	0x3ca33bd3, 0x1478acbc, 0x149c611d, 0x3c97224c, 0x3c93151d, 0x14a84652, 0x14cbf127, 0x3c86df8e,
+	0x3c82c909, 0x14d7d32a, 0x14fb745e, 0x3c76777b, 0x3c7257a2, 0x15075327, 0x152aeaa3, 0x3c65ea1c,
+	0x3c61c0f1, 0x1536c62b, 0x155a53d9, 0x3c55377b, 0x3c510501, 0x15662c18, 0x1589afe3, 0x3c445fa2,
+	0x3c4023dd, 0x159584d3, 0x15b8fea4, 0x3c33629d, 0x3c2f1d8e, 0x15c4d03e, 0x15e83fff, 0x3c224075,
+	0x3c1df21f, 0x15f40e3a, 0x161773d6, 0x3c10f935, 0x3c0ca19b, 0x16233eac, 0x16469a0d, 0x3bff8ce8,
+	0x3bfb2c0c, 0x16526176, 0x1675b286, 0x3bedfb99, 0x3be9917e, 0x1681767c, 0x16a4bd25, 0x3bdc4552,
+	0x3bd7d1fa, 0x16b07d9f, 0x16d3b9cc, 0x3bca6a1d, 0x3bc5ed8d, 0x16df76c3, 0x1702a85e, 0x3bb86a08,
+	0x3bb3e440, 0x170e61cc, 0x173188be, 0x3ba6451b, 0x3ba1b620, 0x173d3e9b, 0x17605ad0, 0x3b93fb63,
+	0x3b8f6337, 0x176c0d15, 0x178f1e76, 0x3b818ceb, 0x3b7ceb90, 0x179acd1c, 0x17bdd394, 0x3b6ef9be,
+	0x3b6a4f38, 0x17c97e93, 0x17ec7a0d, 0x3b5c41e8, 0x3b578e39, 0x17f8215e, 0x181b11c4, 0x3b496574,
+	0x3b44a8a0, 0x1826b561, 0x18499a9d, 0x3b36646e, 0x3b319e77, 0x18553a7d, 0x1878147a, 0x3b233ee1,
+	0x3b1e6fca, 0x1883b097, 0x18a67f3f, 0x3b0ff4d9, 0x3b0b1ca6, 0x18b21791, 0x18d4dad0, 0x3afc8663,
+	0x3af7a516, 0x18e06f50, 0x1903270f, 0x3ae8f38b, 0x3ae40926, 0x190eb7b7, 0x193163e1, 0x3ad53c5b,
+	0x3ad048e3, 0x193cf0a9, 0x195f9128, 0x3ac160e1, 0x3abc6458, 0x196b1a09, 0x198daec8, 0x3aad6129,
+	0x3aa85b92, 0x199933bb, 0x19bbbca6, 0x3a993d3e, 0x3a942e9d, 0x19c73da3, 0x19e9baa3, 0x3a84f52f,
+	0x3a7fdd86, 0x19f537a4, 0x1a17a8a5, 0x3a708906, 0x3a6b6859, 0x1a2321a2, 0x1a45868e, 0x3a5bf8d1,
+	0x3a56cf23, 0x1a50fb81, 0x1a735442, 0x3a47449c, 0x3a4211f0, 0x1a7ec524, 0x1aa111a6, 0x3a326c74,
+	0x3a2d30cd, 0x1aac7e6f, 0x1acebe9d, 0x3a1d7066, 0x3a182bc8, 0x1ada2746, 0x1afc5b0a, 0x3a08507f,
+	0x3a0302ed, 0x1b07bf8c, 0x1b29e6d2, 0x39f30ccc, 0x39edb649, 0x1b354727, 0x1b5761d8, 0x39dda55a,
+	0x39d845e9, 0x1b62bdf8, 0x1b84cc01, 0x39c81a36, 0x39c2b1da, 0x1b9023e5, 0x1bb22530, 0x39b26b6d,
+	0x39acfa2b, 0x1bbd78d2, 0x1bdf6d4a, 0x399c990d, 0x39971ee7, 0x1beabca1, 0x1c0ca432, 0x3986a324,
+	0x3981201e, 0x1c17ef39, 0x1c39c9cd, 0x397089bf, 0x396afddc, 0x1c45107c, 0x1c66ddfe, 0x395a4ceb,
+	0x3954b82e, 0x1c72204f, 0x1c93e0ab, 0x3943ecb6, 0x393e4f23, 0x1c9f1e96, 0x1cc0d1b6, 0x392d692f,
+	0x3927c2c9, 0x1ccc0b35, 0x1cedb106, 0x3916c262, 0x3911132d, 0x1cf8e611, 0x1d1a7e7d, 0x38fff85e,
+	0x38fa405e, 0x1d25af0d, 0x1d473a00, 0x38e90b31, 0x38e34a69, 0x1d52660f, 0x1d73e374, 0x38d1fae9,
+	0x38cc315d, 0x1d7f0afb, 0x1da07abc, 0x38bac795, 0x38b4f547, 0x1dab9db5, 0x1dccffbf, 0x38a37142,
+	0x389d9637, 0x1dd81e21, 0x1df9725f, 0x388bf7ff, 0x3886143b, 0x1e048c24, 0x1e25d282, 0x38745bdb,
+	0x386e6f60, 0x1e30e7a4, 0x1e52200c, 0x385c9ce3, 0x3856a7b6, 0x1e5d3084, 0x1e7e5ae2, 0x3844bb28,
+	0x383ebd4c, 0x1e8966a8, 0x1eaa82e9, 0x382cb6b7, 0x3826b030, 0x1eb589f7, 0x1ed69805, 0x38148f9f,
+	0x380e8071, 0x1ee19a54, 0x1f029a1c, 0x37fc45ef, 0x37f62e1d, 0x1f0d97a5, 0x1f2e8911, 0x37e3d9b7,
+	0x37ddb945, 0x1f3981ce, 0x1f5a64cb, 0x37cb4b04, 0x37c521f6, 0x1f6558b5, 0x1f862d2d, 0x37b299e7,
+	0x37ac6841, 0x1f911c3d, 0x1fb1e21d, 0x3799c66f, 0x37938c34, 0x1fbccc4d, 0x1fdd8381, 0x3780d0aa,
+	0x377a8ddf, 0x1fe868c8, 0x2009113c, 0x3767b8a9, 0x37616d51, 0x2013f196, 0x20348b35, 0x374e7e7b,
+	0x37482a9a, 0x203f6699, 0x205ff14f, 0x3735222f, 0x372ec5c9, 0x206ac7b8, 0x208b4372, 0x371ba3d4,
+	0x37153eee, 0x209614d9, 0x20b68181, 0x3702037c, 0x36fb9618, 0x20c14ddf, 0x20e1ab63, 0x36e84135,
+	0x36e1cb58, 0x20ec72b1, 0x210cc0fc, 0x36ce5d10, 0x36c7debd, 0x21178334, 0x2137c232, 0x36b4571b,
+	0x36add058, 0x21427f4d, 0x2162aeea, 0x369a2f69, 0x3693a038, 0x216d66e2, 0x218d870b, 0x367fe608,
+	0x36794e6e, 0x219839d8, 0x21b84a79, 0x36657b08, 0x365edb09, 0x21c2f815, 0x21e2f91a, 0x364aee7b,
+	0x3644461b, 0x21eda17f, 0x220d92d4, 0x36304070, 0x36298fb4, 0x221835fb, 0x2238178d, 0x361570f8,
+	0x360eb7e3, 0x2242b56f, 0x22628729, 0x35fa8023, 0x35f3beba, 0x226d1fc1, 0x228ce191, 0x35df6e03,
+	0x35d8a449, 0x229774d7, 0x22b726a8, 0x35c43aa7, 0x35bd68a1, 0x22c1b496, 0x22e15655, 0x35a8e621,
+	0x35a20bd3, 0x22ebdee5, 0x230b707e, 0x358d7081, 0x35868def, 0x2315f3a8, 0x23357509, 0x3571d9d9,
+	0x356aef08, 0x233ff2c8, 0x235f63dc, 0x35562239, 0x354f2f2c, 0x2369dc29, 0x23893cdd, 0x353a49b2,
+	0x35334e6f, 0x2393afb2, 0x23b2fff3, 0x351e5056, 0x35174ce0, 0x23bd6d48, 0x23dcad03, 0x35023636,
+	0x34fb2a92, 0x23e714d3, 0x240643f4, 0x34e5fb63, 0x34dee795, 0x2410a639, 0x242fc4ad, 0x34c99fef,
+	0x34c283fb, 0x243a215f, 0x24592f13, 0x34ad23eb, 0x34a5ffd5, 0x2463862c, 0x2482830d, 0x34908768,
+	0x34895b36, 0x248cd487, 0x24abc082, 0x3473ca79, 0x346c962f, 0x24b60c57, 0x24d4e757, 0x3456ed2f,
+	0x344fb0d1, 0x24df2d81, 0x24fdf775, 0x3439ef9c, 0x3432ab2e, 0x250837ed, 0x2526f0c1, 0x341cd1d2,
+	0x34158559, 0x25312b81, 0x254fd323, 0x33ff93e2, 0x33f83f62, 0x255a0823, 0x25789e80, 0x33e235df,
+	0x33dad95e, 0x2582cdbc, 0x25a152c0, 0x33c4b7db, 0x33bd535c, 0x25ab7c30, 0x25c9efca, 0x33a719e8,
+	0x339fad70, 0x25d41369, 0x25f27584, 0x33895c18, 0x3381e7ac, 0x25fc934b, 0x261ae3d6, 0x336b7e7e,
+	0x33640223, 0x2624fbbf, 0x26433aa7, 0x334d812d, 0x3345fce6, 0x264d4cac, 0x266b79dd, 0x332f6435,
+	0x3327d808, 0x267585f8, 0x2693a161, 0x331127ab, 0x3309939c, 0x269da78b, 0x26bbb119, 0x32f2cba1,
+	0x32eb2fb5, 0x26c5b14c, 0x26e3a8ec, 0x32d45029, 0x32ccac64, 0x26eda322, 0x270b88c2, 0x32b5b557,
+	0x32ae09be, 0x27157cf5, 0x27335082, 0x3296fb3d, 0x328f47d5, 0x273d3eac, 0x275b0014, 0x327821ee,
+	0x327066bc, 0x2764e82f, 0x27829760, 0x3259297d, 0x32516686, 0x278c7965, 0x27aa164c, 0x323a11fe,
+	0x32324746, 0x27b3f235, 0x27d17cc1, 0x321adb83, 0x3213090f, 0x27db5288, 0x27f8caa5, 0x31fb8620,
+	0x31f3abf5, 0x28029a45, 0x281fffe2, 0x31dc11e8, 0x31d4300b, 0x2829c954, 0x28471c5e, 0x31bc7eee,
+	0x31b49564, 0x2850df9d, 0x286e2002, 0x319ccd46, 0x3194dc14, 0x2877dd07, 0x28950ab6, 0x317cfd04,
+	0x3175042e, 0x289ec17a, 0x28bbdc61, 0x315d0e3b, 0x31550dc6, 0x28c58cdf, 0x28e294eb, 0x313d00ff,
+	0x3134f8f1, 0x28ec3f1e, 0x2909343e, 0x311cd564, 0x3114c5c0, 0x2912d81f, 0x292fba40, 0x30fc8b7d,
+	0x30f47449, 0x293957c9, 0x295626da, 0x30dc235e, 0x30d404a0, 0x295fbe06, 0x297c79f5, 0x30bb9d1c,
+	0x30b376d8, 0x29860abd, 0x29a2b378, 0x309af8ca, 0x3092cb05, 0x29ac3dd7, 0x29c8d34d, 0x307a367c,
+	0x3072013c, 0x29d2573c, 0x29eed95b, 0x30595648, 0x30511991, 0x29f856d5, 0x2a14c58b, 0x30385840,
+	0x30301418, 0x2a1e3c8a, 0x2a3a97c7, 0x30173c7a, 0x300ef0e5, 0x2a440844, 0x2a604ff5, 0x2ff6030a,
+	0x2fedb00d, 0x2a69b9ec, 0x2a85ee00, 0x2fd4ac04, 0x2fcc51a5, 0x2a8f516b, 0x2aab71d0, 0x2fb3377c,
+	0x2faad5c1, 0x2ab4cea9, 0x2ad0db4e, 0x2f91a589, 0x2f893c75, 0x2ada318e, 0x2af62a63, 0x2f6ff63d,
+	0x2f6785d7, 0x2aff7a05, 0x2b1b5ef8, 0x2f4e29af, 0x2f45b1fb, 0x2b24a7f6, 0x2b4078f5, 0x2f2c3ff2,
+	0x2f23c0f6, 0x2b49bb4a, 0x2b657844, 0x2f0a391d, 0x2f01b2de, 0x2b6eb3ea, 0x2b8a5cce, 0x2ee81543,
+	0x2edf87c6, 0x2b9391c0, 0x2baf267d, 0x2ec5d479, 0x2ebd3fc4, 0x2bb854b4, 0x2bd3d53a, 0x2ea376d6,
+	0x2e9adaee, 0x2bdcfcb0, 0x2bf868ed, 0x2e80fc6e, 0x2e785958, 0x2c01899e, 0x2c1ce181, 0x2e5e6556,
+	0x2e55bb17, 0x2c25fb66, 0x2c413edf, 0x2e3bb1a4, 0x2e330042, 0x2c4a51f3, 0x2c6580f1, 0x2e18e16d,
+	0x2e1028ed, 0x2c6e8d2e, 0x2c89a79f, 0x2df5f4c7, 0x2ded352f, 0x2c92ad01, 0x2cadb2d5, 0x2dd2ebc7,
+	0x2dca251c, 0x2cb6b155, 0x2cd1a27b, 0x2dafc683, 0x2da6f8ca, 0x2cda9a14, 0x2cf5767c, 0x2d8c8510,
 	0x2d83b04f, 0x2cfe6728, 0x2d192ec1, 0x2d692784, 0x2d604bc0, 0x2d22187a, 0x2d3ccb34, 0x2d45adf6
 };
 
 
 const int twidTab512[(8*6 + 32*6 + 128*6)/2] = {
-	0x40000000, 0x40000000, 0x40000000, 0x3b20187d, 
-	0x3ec50c7c, 0x3536238e, 0x2d412d41, 0x3b20187d, 
-	0x187d3b20, 0x187d3b20, 0x3536238e, 0xf3843ec5, 
-	0x00004000, 0x2d412d41, 0xd2bf2d41, 0xe7833b20, 
-	0x238e3536, 0xc13b0c7c, 0xd2bf2d41, 0x187d3b20, 
-	0xc4e0e783, 0xc4e0187d, 0x0c7c3ec5, 0xdc72caca, 
+	0x40000000, 0x40000000, 0x40000000, 0x3b20187d,
+	0x3ec50c7c, 0x3536238e, 0x2d412d41, 0x3b20187d,
+	0x187d3b20, 0x187d3b20, 0x3536238e, 0xf3843ec5,
+	0x00004000, 0x2d412d41, 0xd2bf2d41, 0xe7833b20,
+	0x238e3536, 0xc13b0c7c, 0xd2bf2d41, 0x187d3b20,
+	0xc4e0e783, 0xc4e0187d, 0x0c7c3ec5, 0xdc72caca,
 
-	0x40000000, 0x40000000, 0x40000000, 0x3fb10645, 
-	0x3fec0323, 0x3f4e0964, 0x3ec50c7c, 0x3fb10645, 
-	0x3d3e1294, 0x3d3e1294, 0x3f4e0964, 0x39da1b5d, 
-	0x3b20187d, 0x3ec50c7c, 0x3536238e, 0x38711e2b, 
-	0x3e140f8c, 0x2f6b2afa, 0x3536238e, 0x3d3e1294, 
-	0x28993179, 0x31792899, 0x3c42158f, 0x20e736e5, 
-	0x2d412d41, 0x3b20187d, 0x187d3b20, 0x28993179, 
-	0x39da1b5d, 0x0f8c3e14, 0x238e3536, 0x38711e2b, 
-	0x06453fb1, 0x1e2b3871, 0x36e520e7, 0xfcdd3fec, 
-	0x187d3b20, 0x3536238e, 0xf3843ec5, 0x12943d3e, 
-	0x3367261f, 0xea713c42, 0x0c7c3ec5, 0x31792899, 
-	0xe1d53871, 0x06453fb1, 0x2f6b2afa, 0xd9e13367, 
-	0x00004000, 0x2d412d41, 0xd2bf2d41, 0xf9bb3fb1, 
-	0x2afa2f6b, 0xcc99261f, 0xf3843ec5, 0x28993179, 
-	0xc78f1e2b, 0xed6c3d3e, 0x261f3367, 0xc3be158f, 
-	0xe7833b20, 0x238e3536, 0xc13b0c7c, 0xe1d53871, 
-	0x20e736e5, 0xc0140323, 0xdc723536, 0x1e2b3871, 
-	0xc04ff9bb, 0xd7673179, 0x1b5d39da, 0xc1ecf074, 
-	0xd2bf2d41, 0x187d3b20, 0xc4e0e783, 0xce872899, 
-	0x158f3c42, 0xc91bdf19, 0xcaca238e, 0x12943d3e, 
-	0xce87d767, 0xc78f1e2b, 0x0f8c3e14, 0xd506d095, 
-	0xc4e0187d, 0x0c7c3ec5, 0xdc72caca, 0xc2c21294, 
-	0x09643f4e, 0xe4a3c626, 0xc13b0c7c, 0x06453fb1, 
-	0xed6cc2c2, 0xc04f0645, 0x03233fec, 0xf69cc0b2, 
+	0x40000000, 0x40000000, 0x40000000, 0x3fb10645,
+	0x3fec0323, 0x3f4e0964, 0x3ec50c7c, 0x3fb10645,
+	0x3d3e1294, 0x3d3e1294, 0x3f4e0964, 0x39da1b5d,
+	0x3b20187d, 0x3ec50c7c, 0x3536238e, 0x38711e2b,
+	0x3e140f8c, 0x2f6b2afa, 0x3536238e, 0x3d3e1294,
+	0x28993179, 0x31792899, 0x3c42158f, 0x20e736e5,
+	0x2d412d41, 0x3b20187d, 0x187d3b20, 0x28993179,
+	0x39da1b5d, 0x0f8c3e14, 0x238e3536, 0x38711e2b,
+	0x06453fb1, 0x1e2b3871, 0x36e520e7, 0xfcdd3fec,
+	0x187d3b20, 0x3536238e, 0xf3843ec5, 0x12943d3e,
+	0x3367261f, 0xea713c42, 0x0c7c3ec5, 0x31792899,
+	0xe1d53871, 0x06453fb1, 0x2f6b2afa, 0xd9e13367,
+	0x00004000, 0x2d412d41, 0xd2bf2d41, 0xf9bb3fb1,
+	0x2afa2f6b, 0xcc99261f, 0xf3843ec5, 0x28993179,
+	0xc78f1e2b, 0xed6c3d3e, 0x261f3367, 0xc3be158f,
+	0xe7833b20, 0x238e3536, 0xc13b0c7c, 0xe1d53871,
+	0x20e736e5, 0xc0140323, 0xdc723536, 0x1e2b3871,
+	0xc04ff9bb, 0xd7673179, 0x1b5d39da, 0xc1ecf074,
+	0xd2bf2d41, 0x187d3b20, 0xc4e0e783, 0xce872899,
+	0x158f3c42, 0xc91bdf19, 0xcaca238e, 0x12943d3e,
+	0xce87d767, 0xc78f1e2b, 0x0f8c3e14, 0xd506d095,
+	0xc4e0187d, 0x0c7c3ec5, 0xdc72caca, 0xc2c21294,
+	0x09643f4e, 0xe4a3c626, 0xc13b0c7c, 0x06453fb1,
+	0xed6cc2c2, 0xc04f0645, 0x03233fec, 0xf69cc0b2,
 
-	0x40000000, 0x40000000, 0x40000000, 0x3ffb0192, 
-	0x3ffe00c9, 0x3ff4025b, 0x3fec0323, 0x3ffb0192, 
-	0x3fd304b5, 0x3fd304b5, 0x3ff4025b, 0x3f9c070d, 
-	0x3fb10645, 0x3fec0323, 0x3f4e0964, 0x3f8407d5, 
-	0x3fe103ec, 0x3eeb0bb6, 0x3f4e0964, 0x3fd304b5, 
-	0x3e710e05, 0x3f0e0af1, 0x3fc3057d, 0x3de2104f, 
-	0x3ec50c7c, 0x3fb10645, 0x3d3e1294, 0x3e710e05, 
-	0x3f9c070d, 0x3c8414d1, 0x3e140f8c, 0x3f8407d5, 
-	0x3bb61708, 0x3dae1111, 0x3f6a089c, 0x3ad21937, 
-	0x3d3e1294, 0x3f4e0964, 0x39da1b5d, 0x3cc51413, 
-	0x3f2f0a2a, 0x38cf1d79, 0x3c42158f, 0x3f0e0af1, 
-	0x37af1f8b, 0x3bb61708, 0x3eeb0bb6, 0x367c2192, 
-	0x3b20187d, 0x3ec50c7c, 0x3536238e, 0x3a8219ef, 
-	0x3e9c0d41, 0x33de257d, 0x39da1b5d, 0x3e710e05, 
-	0x3274275f, 0x392a1cc6, 0x3e440ec9, 0x30f82934, 
-	0x38711e2b, 0x3e140f8c, 0x2f6b2afa, 0x37af1f8b, 
-	0x3de2104f, 0x2dce2cb2, 0x36e520e7, 0x3dae1111, 
-	0x2c212e5a, 0x3612223d, 0x3d7711d3, 0x2a652ff1, 
-	0x3536238e, 0x3d3e1294, 0x28993179, 0x345324da, 
-	0x3d021354, 0x26c032ee, 0x3367261f, 0x3cc51413, 
-	0x24da3453, 0x3274275f, 0x3c8414d1, 0x22e635a5, 
-	0x31792899, 0x3c42158f, 0x20e736e5, 0x307629cd, 
-	0x3bfd164c, 0x1edc3811, 0x2f6b2afa, 0x3bb61708, 
-	0x1cc6392a, 0x2e5a2c21, 0x3b6c17c3, 0x1aa63a2f, 
-	0x2d412d41, 0x3b20187d, 0x187d3b20, 0x2c212e5a, 
-	0x3ad21937, 0x164c3bfd, 0x2afa2f6b, 0x3a8219ef, 
-	0x14133cc5, 0x29cd3076, 0x3a2f1aa6, 0x11d33d77, 
-	0x28993179, 0x39da1b5d, 0x0f8c3e14, 0x275f3274, 
-	0x39831c12, 0x0d413e9c, 0x261f3367, 0x392a1cc6, 
-	0x0af13f0e, 0x24da3453, 0x38cf1d79, 0x089c3f6a, 
-	0x238e3536, 0x38711e2b, 0x06453fb1, 0x223d3612, 
-	0x38111edc, 0x03ec3fe1, 0x20e736e5, 0x37af1f8b, 
-	0x01923ffb, 0x1f8b37af, 0x374b2039, 0xff373ffe, 
-	0x1e2b3871, 0x36e520e7, 0xfcdd3fec, 0x1cc6392a, 
-	0x367c2192, 0xfa833fc3, 0x1b5d39da, 0x3612223d, 
-	0xf82b3f84, 0x19ef3a82, 0x35a522e6, 0xf5d63f2f, 
-	0x187d3b20, 0x3536238e, 0xf3843ec5, 0x17083bb6, 
-	0x34c62434, 0xf1373e44, 0x158f3c42, 0x345324da, 
-	0xeeef3dae, 0x14133cc5, 0x33de257d, 0xecac3d02, 
-	0x12943d3e, 0x3367261f, 0xea713c42, 0x11113dae, 
-	0x32ee26c0, 0xe83d3b6c, 0x0f8c3e14, 0x3274275f, 
-	0xe6113a82, 0x0e053e71, 0x31f727fd, 0xe3ee3983, 
-	0x0c7c3ec5, 0x31792899, 0xe1d53871, 0x0af13f0e, 
-	0x30f82934, 0xdfc7374b, 0x09643f4e, 0x307629cd, 
-	0xddc33612, 0x07d53f84, 0x2ff12a65, 0xdbcc34c6, 
-	0x06453fb1, 0x2f6b2afa, 0xd9e13367, 0x04b53fd3, 
-	0x2ee32b8e, 0xd80331f7, 0x03233fec, 0x2e5a2c21, 
-	0xd6333076, 0x01923ffb, 0x2dce2cb2, 0xd4722ee3, 
-	0x00004000, 0x2d412d41, 0xd2bf2d41, 0xfe6e3ffb, 
-	0x2cb22dce, 0xd11d2b8e, 0xfcdd3fec, 0x2c212e5a, 
-	0xcf8a29cd, 0xfb4b3fd3, 0x2b8e2ee3, 0xce0927fd, 
-	0xf9bb3fb1, 0x2afa2f6b, 0xcc99261f, 0xf82b3f84, 
-	0x2a652ff1, 0xcb3a2434, 0xf69c3f4e, 0x29cd3076, 
-	0xc9ee223d, 0xf50f3f0e, 0x293430f8, 0xc8b52039, 
-	0xf3843ec5, 0x28993179, 0xc78f1e2b, 0xf1fb3e71, 
-	0x27fd31f7, 0xc67d1c12, 0xf0743e14, 0x275f3274, 
-	0xc57e19ef, 0xeeef3dae, 0x26c032ee, 0xc49417c3, 
-	0xed6c3d3e, 0x261f3367, 0xc3be158f, 0xebed3cc5, 
-	0x257d33de, 0xc2fe1354, 0xea713c42, 0x24da3453, 
-	0xc2521111, 0xe8f83bb6, 0x243434c6, 0xc1bc0ec9, 
-	0xe7833b20, 0x238e3536, 0xc13b0c7c, 0xe6113a82, 
-	0x22e635a5, 0xc0d10a2a, 0xe4a339da, 0x223d3612, 
-	0xc07c07d5, 0xe33a392a, 0x2192367c, 0xc03d057d, 
-	0xe1d53871, 0x20e736e5, 0xc0140323, 0xe07537af, 
-	0x2039374b, 0xc00200c9, 0xdf1936e5, 0x1f8b37af, 
-	0xc005fe6e, 0xddc33612, 0x1edc3811, 0xc01ffc14, 
-	0xdc723536, 0x1e2b3871, 0xc04ff9bb, 0xdb263453, 
-	0x1d7938cf, 0xc096f764, 0xd9e13367, 0x1cc6392a, 
-	0xc0f2f50f, 0xd8a13274, 0x1c123983, 0xc164f2bf, 
-	0xd7673179, 0x1b5d39da, 0xc1ecf074, 0xd6333076, 
-	0x1aa63a2f, 0xc289ee2d, 0xd5062f6b, 0x19ef3a82, 
-	0xc33bebed, 0xd3df2e5a, 0x19373ad2, 0xc403e9b4, 
-	0xd2bf2d41, 0x187d3b20, 0xc4e0e783, 0xd1a62c21, 
-	0x17c33b6c, 0xc5d1e55a, 0xd0952afa, 0x17083bb6, 
-	0xc6d6e33a, 0xcf8a29cd, 0x164c3bfd, 0xc7efe124, 
-	0xce872899, 0x158f3c42, 0xc91bdf19, 0xcd8c275f, 
-	0x14d13c84, 0xca5bdd1a, 0xcc99261f, 0x14133cc5, 
-	0xcbaddb26, 0xcbad24da, 0x13543d02, 0xcd12d940, 
-	0xcaca238e, 0x12943d3e, 0xce87d767, 0xc9ee223d, 
-	0x11d33d77, 0xd00fd59b, 0xc91b20e7, 0x11113dae, 
-	0xd1a6d3df, 0xc8511f8b, 0x104f3de2, 0xd34ed232, 
-	0xc78f1e2b, 0x0f8c3e14, 0xd506d095, 0xc6d61cc6, 
-	0x0ec93e44, 0xd6cccf08, 0xc6261b5d, 0x0e053e71, 
-	0xd8a1cd8c, 0xc57e19ef, 0x0d413e9c, 0xda83cc22, 
-	0xc4e0187d, 0x0c7c3ec5, 0xdc72caca, 0xc44a1708, 
-	0x0bb63eeb, 0xde6ec984, 0xc3be158f, 0x0af13f0e, 
-	0xe075c851, 0xc33b1413, 0x0a2a3f2f, 0xe287c731, 
-	0xc2c21294, 0x09643f4e, 0xe4a3c626, 0xc2521111, 
-	0x089c3f6a, 0xe6c9c52e, 0xc1ec0f8c, 0x07d53f84, 
-	0xe8f8c44a, 0xc18f0e05, 0x070d3f9c, 0xeb2fc37c, 
-	0xc13b0c7c, 0x06453fb1, 0xed6cc2c2, 0xc0f20af1, 
-	0x057d3fc3, 0xefb1c21e, 0xc0b20964, 0x04b53fd3, 
-	0xf1fbc18f, 0xc07c07d5, 0x03ec3fe1, 0xf44ac115, 
-	0xc04f0645, 0x03233fec, 0xf69cc0b2, 0xc02d04b5, 
-	0x025b3ff4, 0xf8f3c064, 0xc0140323, 0x01923ffb, 
-	0xfb4bc02d, 0xc0050192, 0x00c93ffe, 0xfda5c00c	
+	0x40000000, 0x40000000, 0x40000000, 0x3ffb0192,
+	0x3ffe00c9, 0x3ff4025b, 0x3fec0323, 0x3ffb0192,
+	0x3fd304b5, 0x3fd304b5, 0x3ff4025b, 0x3f9c070d,
+	0x3fb10645, 0x3fec0323, 0x3f4e0964, 0x3f8407d5,
+	0x3fe103ec, 0x3eeb0bb6, 0x3f4e0964, 0x3fd304b5,
+	0x3e710e05, 0x3f0e0af1, 0x3fc3057d, 0x3de2104f,
+	0x3ec50c7c, 0x3fb10645, 0x3d3e1294, 0x3e710e05,
+	0x3f9c070d, 0x3c8414d1, 0x3e140f8c, 0x3f8407d5,
+	0x3bb61708, 0x3dae1111, 0x3f6a089c, 0x3ad21937,
+	0x3d3e1294, 0x3f4e0964, 0x39da1b5d, 0x3cc51413,
+	0x3f2f0a2a, 0x38cf1d79, 0x3c42158f, 0x3f0e0af1,
+	0x37af1f8b, 0x3bb61708, 0x3eeb0bb6, 0x367c2192,
+	0x3b20187d, 0x3ec50c7c, 0x3536238e, 0x3a8219ef,
+	0x3e9c0d41, 0x33de257d, 0x39da1b5d, 0x3e710e05,
+	0x3274275f, 0x392a1cc6, 0x3e440ec9, 0x30f82934,
+	0x38711e2b, 0x3e140f8c, 0x2f6b2afa, 0x37af1f8b,
+	0x3de2104f, 0x2dce2cb2, 0x36e520e7, 0x3dae1111,
+	0x2c212e5a, 0x3612223d, 0x3d7711d3, 0x2a652ff1,
+	0x3536238e, 0x3d3e1294, 0x28993179, 0x345324da,
+	0x3d021354, 0x26c032ee, 0x3367261f, 0x3cc51413,
+	0x24da3453, 0x3274275f, 0x3c8414d1, 0x22e635a5,
+	0x31792899, 0x3c42158f, 0x20e736e5, 0x307629cd,
+	0x3bfd164c, 0x1edc3811, 0x2f6b2afa, 0x3bb61708,
+	0x1cc6392a, 0x2e5a2c21, 0x3b6c17c3, 0x1aa63a2f,
+	0x2d412d41, 0x3b20187d, 0x187d3b20, 0x2c212e5a,
+	0x3ad21937, 0x164c3bfd, 0x2afa2f6b, 0x3a8219ef,
+	0x14133cc5, 0x29cd3076, 0x3a2f1aa6, 0x11d33d77,
+	0x28993179, 0x39da1b5d, 0x0f8c3e14, 0x275f3274,
+	0x39831c12, 0x0d413e9c, 0x261f3367, 0x392a1cc6,
+	0x0af13f0e, 0x24da3453, 0x38cf1d79, 0x089c3f6a,
+	0x238e3536, 0x38711e2b, 0x06453fb1, 0x223d3612,
+	0x38111edc, 0x03ec3fe1, 0x20e736e5, 0x37af1f8b,
+	0x01923ffb, 0x1f8b37af, 0x374b2039, 0xff373ffe,
+	0x1e2b3871, 0x36e520e7, 0xfcdd3fec, 0x1cc6392a,
+	0x367c2192, 0xfa833fc3, 0x1b5d39da, 0x3612223d,
+	0xf82b3f84, 0x19ef3a82, 0x35a522e6, 0xf5d63f2f,
+	0x187d3b20, 0x3536238e, 0xf3843ec5, 0x17083bb6,
+	0x34c62434, 0xf1373e44, 0x158f3c42, 0x345324da,
+	0xeeef3dae, 0x14133cc5, 0x33de257d, 0xecac3d02,
+	0x12943d3e, 0x3367261f, 0xea713c42, 0x11113dae,
+	0x32ee26c0, 0xe83d3b6c, 0x0f8c3e14, 0x3274275f,
+	0xe6113a82, 0x0e053e71, 0x31f727fd, 0xe3ee3983,
+	0x0c7c3ec5, 0x31792899, 0xe1d53871, 0x0af13f0e,
+	0x30f82934, 0xdfc7374b, 0x09643f4e, 0x307629cd,
+	0xddc33612, 0x07d53f84, 0x2ff12a65, 0xdbcc34c6,
+	0x06453fb1, 0x2f6b2afa, 0xd9e13367, 0x04b53fd3,
+	0x2ee32b8e, 0xd80331f7, 0x03233fec, 0x2e5a2c21,
+	0xd6333076, 0x01923ffb, 0x2dce2cb2, 0xd4722ee3,
+	0x00004000, 0x2d412d41, 0xd2bf2d41, 0xfe6e3ffb,
+	0x2cb22dce, 0xd11d2b8e, 0xfcdd3fec, 0x2c212e5a,
+	0xcf8a29cd, 0xfb4b3fd3, 0x2b8e2ee3, 0xce0927fd,
+	0xf9bb3fb1, 0x2afa2f6b, 0xcc99261f, 0xf82b3f84,
+	0x2a652ff1, 0xcb3a2434, 0xf69c3f4e, 0x29cd3076,
+	0xc9ee223d, 0xf50f3f0e, 0x293430f8, 0xc8b52039,
+	0xf3843ec5, 0x28993179, 0xc78f1e2b, 0xf1fb3e71,
+	0x27fd31f7, 0xc67d1c12, 0xf0743e14, 0x275f3274,
+	0xc57e19ef, 0xeeef3dae, 0x26c032ee, 0xc49417c3,
+	0xed6c3d3e, 0x261f3367, 0xc3be158f, 0xebed3cc5,
+	0x257d33de, 0xc2fe1354, 0xea713c42, 0x24da3453,
+	0xc2521111, 0xe8f83bb6, 0x243434c6, 0xc1bc0ec9,
+	0xe7833b20, 0x238e3536, 0xc13b0c7c, 0xe6113a82,
+	0x22e635a5, 0xc0d10a2a, 0xe4a339da, 0x223d3612,
+	0xc07c07d5, 0xe33a392a, 0x2192367c, 0xc03d057d,
+	0xe1d53871, 0x20e736e5, 0xc0140323, 0xe07537af,
+	0x2039374b, 0xc00200c9, 0xdf1936e5, 0x1f8b37af,
+	0xc005fe6e, 0xddc33612, 0x1edc3811, 0xc01ffc14,
+	0xdc723536, 0x1e2b3871, 0xc04ff9bb, 0xdb263453,
+	0x1d7938cf, 0xc096f764, 0xd9e13367, 0x1cc6392a,
+	0xc0f2f50f, 0xd8a13274, 0x1c123983, 0xc164f2bf,
+	0xd7673179, 0x1b5d39da, 0xc1ecf074, 0xd6333076,
+	0x1aa63a2f, 0xc289ee2d, 0xd5062f6b, 0x19ef3a82,
+	0xc33bebed, 0xd3df2e5a, 0x19373ad2, 0xc403e9b4,
+	0xd2bf2d41, 0x187d3b20, 0xc4e0e783, 0xd1a62c21,
+	0x17c33b6c, 0xc5d1e55a, 0xd0952afa, 0x17083bb6,
+	0xc6d6e33a, 0xcf8a29cd, 0x164c3bfd, 0xc7efe124,
+	0xce872899, 0x158f3c42, 0xc91bdf19, 0xcd8c275f,
+	0x14d13c84, 0xca5bdd1a, 0xcc99261f, 0x14133cc5,
+	0xcbaddb26, 0xcbad24da, 0x13543d02, 0xcd12d940,
+	0xcaca238e, 0x12943d3e, 0xce87d767, 0xc9ee223d,
+	0x11d33d77, 0xd00fd59b, 0xc91b20e7, 0x11113dae,
+	0xd1a6d3df, 0xc8511f8b, 0x104f3de2, 0xd34ed232,
+	0xc78f1e2b, 0x0f8c3e14, 0xd506d095, 0xc6d61cc6,
+	0x0ec93e44, 0xd6cccf08, 0xc6261b5d, 0x0e053e71,
+	0xd8a1cd8c, 0xc57e19ef, 0x0d413e9c, 0xda83cc22,
+	0xc4e0187d, 0x0c7c3ec5, 0xdc72caca, 0xc44a1708,
+	0x0bb63eeb, 0xde6ec984, 0xc3be158f, 0x0af13f0e,
+	0xe075c851, 0xc33b1413, 0x0a2a3f2f, 0xe287c731,
+	0xc2c21294, 0x09643f4e, 0xe4a3c626, 0xc2521111,
+	0x089c3f6a, 0xe6c9c52e, 0xc1ec0f8c, 0x07d53f84,
+	0xe8f8c44a, 0xc18f0e05, 0x070d3f9c, 0xeb2fc37c,
+	0xc13b0c7c, 0x06453fb1, 0xed6cc2c2, 0xc0f20af1,
+	0x057d3fc3, 0xefb1c21e, 0xc0b20964, 0x04b53fd3,
+	0xf1fbc18f, 0xc07c07d5, 0x03ec3fe1, 0xf44ac115,
+	0xc04f0645, 0x03233fec, 0xf69cc0b2, 0xc02d04b5,
+	0x025b3ff4, 0xf8f3c064, 0xc0140323, 0x01923ffb,
+	0xfb4bc02d, 0xc0050192, 0x00c93ffe, 0xfda5c00c
 };
 
 const int twidTab64[(4*6 + 16*6)/2] = {
-	0x40000000, 0x40000000, 0x40000000, 0x2d412d41, 
-	0x3b20187d, 0x187d3b20, 0x00004000, 0x2d412d41, 
-	0xd2bf2d41, 0xd2bf2d41, 0x187d3b20, 0xc4e0e783, 
+	0x40000000, 0x40000000, 0x40000000, 0x2d412d41,
+	0x3b20187d, 0x187d3b20, 0x00004000, 0x2d412d41,
+	0xd2bf2d41, 0xd2bf2d41, 0x187d3b20, 0xc4e0e783,
 
-	0x40000000, 0x40000000, 0x40000000, 0x3ec50c7c, 
-	0x3fb10645, 0x3d3e1294, 0x3b20187d, 0x3ec50c7c, 
-	0x3536238e, 0x3536238e, 0x3d3e1294, 0x28993179, 
-	0x2d412d41, 0x3b20187d, 0x187d3b20, 0x238e3536, 
-	0x38711e2b, 0x06453fb1, 0x187d3b20, 0x3536238e, 
-	0xf3843ec5, 0x0c7c3ec5, 0x31792899, 0xe1d53871, 
-	0x00004000, 0x2d412d41, 0xd2bf2d41, 0xf3843ec5, 
-	0x28993179, 0xc78f1e2b, 0xe7833b20, 0x238e3536, 
-	0xc13b0c7c, 0xdc723536, 0x1e2b3871, 0xc04ff9bb, 
-	0xd2bf2d41, 0x187d3b20, 0xc4e0e783, 0xcaca238e, 
-	0x12943d3e, 0xce87d767, 0xc4e0187d, 0x0c7c3ec5, 
-	0xdc72caca, 0xc13b0c7c, 0x06453fb1, 0xed6cc2c2 
+	0x40000000, 0x40000000, 0x40000000, 0x3ec50c7c,
+	0x3fb10645, 0x3d3e1294, 0x3b20187d, 0x3ec50c7c,
+	0x3536238e, 0x3536238e, 0x3d3e1294, 0x28993179,
+	0x2d412d41, 0x3b20187d, 0x187d3b20, 0x238e3536,
+	0x38711e2b, 0x06453fb1, 0x187d3b20, 0x3536238e,
+	0xf3843ec5, 0x0c7c3ec5, 0x31792899, 0xe1d53871,
+	0x00004000, 0x2d412d41, 0xd2bf2d41, 0xf3843ec5,
+	0x28993179, 0xc78f1e2b, 0xe7833b20, 0x238e3536,
+	0xc13b0c7c, 0xdc723536, 0x1e2b3871, 0xc04ff9bb,
+	0xd2bf2d41, 0x187d3b20, 0xc4e0e783, 0xcaca238e,
+	0x12943d3e, 0xce87d767, 0xc4e0187d, 0x0c7c3ec5,
+	0xdc72caca, 0xc13b0c7c, 0x06453fb1, 0xed6cc2c2
 };
 
 #elif defined ARMV7Neon
-/* 
- *  Q29 for 128 and 1024 
+/*
+ *  Q29 for 128 and 1024
  *
  * for (i = 0; i < num/4; i++) {
  *   angle = (i + 0.125) * M_PI / num;
  *   x = cos(angle) * (1 << 29);
  *   x = sin(angle) * (1 << 29);
- * 
+ *
  *   angle = (num/2 - 1 - i + 0.125) * M_PI / num;
  *   x = cos(angle) * (1 << 29);
  *   x = sin(angle) * (1 << 29);
@@ -353,313 +353,313 @@
  */
 const int cossintab[128 + 1024] = {
 	/* 128 */
-	0x1ffff621, 0x001921f9, 0x00afea69, 0x1ffe1c68, 0x1ffce09d, 0x00e22a7a, 0x0178dbaa, 0x1ff753bb, 
-	0x1ff4dc55, 0x01ab101c, 0x024192cf, 0x1feb9d25, 0x1fe7ea85, 0x0273b3e2, 0x0309f0e2, 0x1fdafa75, 
-	0x1fd60d2e, 0x033bf6dd, 0x03d1d700, 0x1fc56e3b, 0x1fbf470f, 0x0403ba2b, 0x04992653, 0x1faafbcb, 
-	0x1fa39bac, 0x04cadefe, 0x055fc022, 0x1f8ba738, 0x1f830f4a, 0x059146a1, 0x062585ca, 0x1f677557, 
-	0x1f5da6ed, 0x0656d27a, 0x06ea58cd, 0x1f3e6bbc, 0x1f33685a, 0x071b6415, 0x07ae1ad2, 0x1f1090bd, 
-	0x1f045a15, 0x07dedd20, 0x0870ada7, 0x1eddeb6a, 0x1ed0835f, 0x08a11f78, 0x0931f34d, 0x1ea68394, 
-	0x1e97ec36, 0x09620d27, 0x09f1cdf5, 0x1e6a61c5, 0x1e5a9d55, 0x0a21886e, 0x0ab02009, 0x1e298f44, 
-	0x1e18a030, 0x0adf73c6, 0x0b6ccc32, 0x1de4160f, 0x1dd1fef4, 0x0b9bb1e5, 0x0c27b555, 0x1d9a00de, 
-	0x1d86c484, 0x0c5625c3, 0x0ce0bea2, 0x1d4b5b1b, 0x1d36fc7c, 0x0d0eb2a2, 0x0d97cb8f, 0x1cf830e9, 
-	0x1ce2b328, 0x0dc53c0a, 0x0e4cbfe2, 0x1ca08f1a, 0x1c89f587, 0x0e79a5d7, 0x0eff7fb3, 0x1c448331, 
-	0x1c2cd149, 0x0f2bd437, 0x0fafef73, 0x1be41b61, 0x1bcb54cb, 0x0fdbabae, 0x105df3ec, 0x1b7f6687, 
-	0x1b658f15, 0x10891120, 0x11097249, 0x1b16742a, 0x1afb8fd9, 0x1133e9d0, 0x11b25017, 0x1aa9547a, 
-	0x1a8d676e, 0x11dc1b65, 0x1258734d, 0x1a38184a, 0x1a1b26d3, 0x12818bef, 0x12fbc24b, 0x19c2d111, 
-	0x19a4dfa4, 0x132421ec, 0x139c23e4, 0x194990e4, 0x192aa420, 0x13c3c44a, 0x14397f5b, 0x18cc6a75, 
-	0x18ac871f, 0x14605a69, 0x14d3bc6d, 0x184b7112, 0x182a9c14, 0x14f9cc26, 0x156ac352, 0x17c6b89d, 
+	0x1ffff621, 0x001921f9, 0x00afea69, 0x1ffe1c68, 0x1ffce09d, 0x00e22a7a, 0x0178dbaa, 0x1ff753bb,
+	0x1ff4dc55, 0x01ab101c, 0x024192cf, 0x1feb9d25, 0x1fe7ea85, 0x0273b3e2, 0x0309f0e2, 0x1fdafa75,
+	0x1fd60d2e, 0x033bf6dd, 0x03d1d700, 0x1fc56e3b, 0x1fbf470f, 0x0403ba2b, 0x04992653, 0x1faafbcb,
+	0x1fa39bac, 0x04cadefe, 0x055fc022, 0x1f8ba738, 0x1f830f4a, 0x059146a1, 0x062585ca, 0x1f677557,
+	0x1f5da6ed, 0x0656d27a, 0x06ea58cd, 0x1f3e6bbc, 0x1f33685a, 0x071b6415, 0x07ae1ad2, 0x1f1090bd,
+	0x1f045a15, 0x07dedd20, 0x0870ada7, 0x1eddeb6a, 0x1ed0835f, 0x08a11f78, 0x0931f34d, 0x1ea68394,
+	0x1e97ec36, 0x09620d27, 0x09f1cdf5, 0x1e6a61c5, 0x1e5a9d55, 0x0a21886e, 0x0ab02009, 0x1e298f44,
+	0x1e18a030, 0x0adf73c6, 0x0b6ccc32, 0x1de4160f, 0x1dd1fef4, 0x0b9bb1e5, 0x0c27b555, 0x1d9a00de,
+	0x1d86c484, 0x0c5625c3, 0x0ce0bea2, 0x1d4b5b1b, 0x1d36fc7c, 0x0d0eb2a2, 0x0d97cb8f, 0x1cf830e9,
+	0x1ce2b328, 0x0dc53c0a, 0x0e4cbfe2, 0x1ca08f1a, 0x1c89f587, 0x0e79a5d7, 0x0eff7fb3, 0x1c448331,
+	0x1c2cd149, 0x0f2bd437, 0x0fafef73, 0x1be41b61, 0x1bcb54cb, 0x0fdbabae, 0x105df3ec, 0x1b7f6687,
+	0x1b658f15, 0x10891120, 0x11097249, 0x1b16742a, 0x1afb8fd9, 0x1133e9d0, 0x11b25017, 0x1aa9547a,
+	0x1a8d676e, 0x11dc1b65, 0x1258734d, 0x1a38184a, 0x1a1b26d3, 0x12818bef, 0x12fbc24b, 0x19c2d111,
+	0x19a4dfa4, 0x132421ec, 0x139c23e4, 0x194990e4, 0x192aa420, 0x13c3c44a, 0x14397f5b, 0x18cc6a75,
+	0x18ac871f, 0x14605a69, 0x14d3bc6d, 0x184b7112, 0x182a9c14, 0x14f9cc26, 0x156ac352, 0x17c6b89d,
 	0x17a4f708, 0x159001d6, 0x15fe7cbe, 0x173e558e, 0x171bac96, 0x1622e450, 0x168ed1eb, 0x16b25ced,
 	/* 1024 */
-	0x1fffffd9, 0x0003243f, 0x0015fdba, 0x1ffff872, 0x1ffff382, 0x001c4637, 0x002f1fa6, 0x1fffdd4d, 
-	0x1fffd36f, 0x0035681d, 0x00484175, 0x1fffae6c, 0x1fff9f9e, 0x004e89e3, 0x00616318, 0x1fff6bce, 
-	0x1fff5811, 0x0067ab77, 0x007a847e, 0x1fff1572, 0x1ffefcc6, 0x0080cccc, 0x0093a599, 0x1ffeab5b, 
-	0x1ffe8dbf, 0x0099edd2, 0x00acc658, 0x1ffe2d86, 0x1ffe0afc, 0x00b30e78, 0x00c5e6ad, 0x1ffd9bf6, 
-	0x1ffd747c, 0x00cc2eb0, 0x00df0688, 0x1ffcf6aa, 0x1ffcca41, 0x00e54e6a, 0x00f825da, 0x1ffc3da2, 
-	0x1ffc0c4b, 0x00fe6d97, 0x01114492, 0x1ffb70e0, 0x1ffb3a9a, 0x01178c27, 0x012a62a2, 0x1ffa9063, 
-	0x1ffa552e, 0x0130aa0a, 0x01437ffa, 0x1ff99c2c, 0x1ff95c09, 0x0149c731, 0x015c9c8a, 0x1ff8943c, 
-	0x1ff84f2b, 0x0162e38d, 0x0175b843, 0x1ff77893, 0x1ff72e94, 0x017bff0e, 0x018ed316, 0x1ff64932, 
-	0x1ff5fa46, 0x019519a5, 0x01a7ecf2, 0x1ff5061b, 0x1ff4b240, 0x01ae3341, 0x01c105c9, 0x1ff3af4c, 
-	0x1ff35684, 0x01c74bd5, 0x01da1d8c, 0x1ff244c8, 0x1ff1e713, 0x01e0634f, 0x01f33429, 0x1ff0c68f, 
-	0x1ff063ed, 0x01f979a1, 0x020c4993, 0x1fef34a3, 0x1feecd14, 0x02128ebb, 0x02255db9, 0x1fed8f03, 
-	0x1fed2287, 0x022ba28f, 0x023e708d, 0x1febd5b2, 0x1feb644a, 0x0244b50b, 0x025781fe, 0x1fea08b0, 
-	0x1fe9925c, 0x025dc621, 0x027091fd, 0x1fe827fe, 0x1fe7acbe, 0x0276d5c1, 0x0289a07b, 0x1fe6339d, 
-	0x1fe5b372, 0x028fe3dd, 0x02a2ad69, 0x1fe42b90, 0x1fe3a679, 0x02a8f063, 0x02bbb8b6, 0x1fe20fd6, 
-	0x1fe185d5, 0x02c1fb46, 0x02d4c253, 0x1fdfe071, 0x1fdf5186, 0x02db0475, 0x02edca32, 0x1fdd9d64, 
-	0x1fdd098e, 0x02f40be2, 0x0306d042, 0x1fdb46ae, 0x1fdaadee, 0x030d117c, 0x031fd474, 0x1fd8dc51, 
-	0x1fd83ea8, 0x03261534, 0x0338d6b8, 0x1fd65e4f, 0x1fd5bbbd, 0x033f16fb, 0x0351d700, 0x1fd3ccaa, 
-	0x1fd32530, 0x035816c1, 0x036ad53c, 0x1fd12763, 0x1fd07b00, 0x03711477, 0x0383d15c, 0x1fce6e7c, 
-	0x1fcdbd31, 0x038a100e, 0x039ccb51, 0x1fcba1f5, 0x1fcaebc3, 0x03a30975, 0x03b5c30b, 0x1fc8c1d2, 
-	0x1fc806b9, 0x03bc009f, 0x03ceb87c, 0x1fc5ce14, 0x1fc50e14, 0x03d4f57a, 0x03e7ab93, 0x1fc2c6bd, 
-	0x1fc201d7, 0x03ede7f9, 0x04009c42, 0x1fbfabcd, 0x1fbee202, 0x0406d80b, 0x04198a78, 0x1fbc7d49, 
-	0x1fbbae99, 0x041fc5a1, 0x04327628, 0x1fb93b31, 0x1fb8679c, 0x0438b0ac, 0x044b5f40, 0x1fb5e587, 
-	0x1fb50d0e, 0x0451991d, 0x046445b2, 0x1fb27c4e, 0x1fb19ef1, 0x046a7ee3, 0x047d296f, 0x1faeff87, 
-	0x1fae1d47, 0x048361f0, 0x04960a67, 0x1fab6f35, 0x1faa8813, 0x049c4235, 0x04aee88b, 0x1fa7cb5a, 
-	0x1fa6df56, 0x04b51fa1, 0x04c7c3cb, 0x1fa413f8, 0x1fa32313, 0x04cdfa26, 0x04e09c18, 0x1fa04912, 
-	0x1f9f534c, 0x04e6d1b4, 0x04f97163, 0x1f9c6aa9, 0x1f9b7003, 0x04ffa63c, 0x0512439d, 0x1f9878c1, 
-	0x1f97793b, 0x051877af, 0x052b12b6, 0x1f94735b, 0x1f936ef6, 0x053145fd, 0x0543de9e, 0x1f905a7a, 
-	0x1f8f5137, 0x054a1117, 0x055ca748, 0x1f8c2e21, 0x1f8b2000, 0x0562d8ee, 0x05756ca2, 0x1f87ee52, 
-	0x1f86db55, 0x057b9d73, 0x058e2e9f, 0x1f839b10, 0x1f828336, 0x05945e95, 0x05a6ed2e, 0x1f7f345e, 
-	0x1f7e17a8, 0x05ad1c47, 0x05bfa840, 0x1f7aba3e, 0x1f7998ad, 0x05c5d678, 0x05d85fc7, 0x1f762cb2, 
-	0x1f750647, 0x05de8d19, 0x05f113b3, 0x1f718bbf, 0x1f70607a, 0x05f7401c, 0x0609c3f5, 0x1f6cd766, 
-	0x1f6ba748, 0x060fef71, 0x0622707d, 0x1f680fab, 0x1f66dab5, 0x06289b08, 0x063b193c, 0x1f633490, 
-	0x1f61fac3, 0x064142d3, 0x0653be23, 0x1f5e4619, 0x1f5d0775, 0x0659e6c2, 0x066c5f24, 0x1f594448, 
-	0x1f5800ce, 0x067286c6, 0x0684fc2e, 0x1f542f21, 0x1f52e6d2, 0x068b22d0, 0x069d9532, 0x1f4f06a6, 
-	0x1f4db983, 0x06a3bad0, 0x06b62a22, 0x1f49cadc, 0x1f4878e5, 0x06bc4eb9, 0x06cebaee, 0x1f447bc4, 
-	0x1f4324fb, 0x06d4de79, 0x06e74786, 0x1f3f1963, 0x1f3dbdc8, 0x06ed6a03, 0x06ffcfdd, 0x1f39a3bc, 
-	0x1f384350, 0x0705f147, 0x071853e3, 0x1f341ad2, 0x1f32b595, 0x071e7436, 0x0730d388, 0x1f2e7ea9, 
-	0x1f2d149d, 0x0736f2c0, 0x07494ebd, 0x1f28cf43, 0x1f276069, 0x074f6cd7, 0x0761c574, 0x1f230ca5, 
-	0x1f2198fd, 0x0767e26c, 0x077a379d, 0x1f1d36d2, 0x1f1bbe5d, 0x07805370, 0x0792a52a, 0x1f174dce, 
-	0x1f15d08d, 0x0798bfd3, 0x07ab0e0a, 0x1f11519c, 0x1f0fcf91, 0x07b12786, 0x07c37230, 0x1f0b4240, 
-	0x1f09bb6b, 0x07c98a7a, 0x07dbd18c, 0x1f051fbe, 0x1f03941f, 0x07e1e8a1, 0x07f42c0e, 0x1efeea19, 
-	0x1efd59b3, 0x07fa41eb, 0x080c81a9, 0x1ef8a155, 0x1ef70c28, 0x0812964a, 0x0824d24d, 0x1ef24577, 
-	0x1ef0ab84, 0x082ae5ad, 0x083d1dea, 0x1eebd682, 0x1eea37ca, 0x08433007, 0x08556473, 0x1ee5547a, 
-	0x1ee3b0fe, 0x085b7548, 0x086da5d8, 0x1edebf64, 0x1edd1724, 0x0873b562, 0x0885e209, 0x1ed81742, 
-	0x1ed66a41, 0x088bf044, 0x089e18f9, 0x1ed15c1a, 0x1ecfaa57, 0x08a425e1, 0x08b64a98, 0x1eca8def, 
-	0x1ec8d76c, 0x08bc562a, 0x08ce76d8, 0x1ec3acc6, 0x1ec1f184, 0x08d4810f, 0x08e69da8, 0x1ebcb8a3, 
-	0x1ebaf8a3, 0x08eca681, 0x08febefb, 0x1eb5b18a, 0x1eb3eccd, 0x0904c673, 0x0916dac2, 0x1eae977f, 
-	0x1eacce07, 0x091ce0d4, 0x092ef0ed, 0x1ea76a87, 0x1ea59c55, 0x0934f596, 0x0947016e, 0x1ea02aa7, 
-	0x1e9e57bb, 0x094d04aa, 0x095f0c36, 0x1e98d7e2, 0x1e97003e, 0x09650e01, 0x09771136, 0x1e91723e, 
-	0x1e8f95e3, 0x097d118d, 0x098f1060, 0x1e89f9bf, 0x1e8818ad, 0x09950f3f, 0x09a709a4, 0x1e826e69, 
-	0x1e8088a2, 0x09ad0707, 0x09befcf4, 0x1e7ad041, 0x1e78e5c7, 0x09c4f8d8, 0x09d6ea40, 0x1e731f4c, 
-	0x1e71301f, 0x09dce4a1, 0x09eed17b, 0x1e6b5b8f, 0x1e6967b1, 0x09f4ca56, 0x0a06b296, 0x1e63850e, 
-	0x1e618c80, 0x0a0ca9e6, 0x0a1e8d81, 0x1e5b9bce, 0x1e599e91, 0x0a248343, 0x0a36622e, 0x1e539fd4, 
-	0x1e519dea, 0x0a3c565e, 0x0a4e308f, 0x1e4b9126, 0x1e498a8e, 0x0a542329, 0x0a65f894, 0x1e436fc7, 
-	0x1e416485, 0x0a6be995, 0x0a7dba2f, 0x1e3b3bbd, 0x1e392bd1, 0x0a83a993, 0x0a957551, 0x1e32f50e, 
-	0x1e30e079, 0x0a9b6315, 0x0aad29ec, 0x1e2a9bbd, 0x1e288281, 0x0ab3160c, 0x0ac4d7f1, 0x1e222fd1, 
-	0x1e2011ee, 0x0acac26a, 0x0adc7f52, 0x1e19b14f, 0x1e178ec7, 0x0ae2681f, 0x0af41fff, 0x1e11203b, 
-	0x1e0ef910, 0x0afa071d, 0x0b0bb9eb, 0x1e087c9b, 0x1e0650ce, 0x0b119f56, 0x0b234d07, 0x1dffc674, 
-	0x1dfd9606, 0x0b2930bb, 0x0b3ad943, 0x1df6fdcc, 0x1df4c8bf, 0x0b40bb3e, 0x0b525e92, 0x1dee22a9, 
-	0x1debe8fd, 0x0b583ecf, 0x0b69dce6, 0x1de5350f, 0x1de2f6c6, 0x0b6fbb62, 0x0b81542f, 0x1ddc3504, 
-	0x1dd9f220, 0x0b8730e6, 0x0b98c45f, 0x1dd3228e, 0x1dd0db10, 0x0b9e9f4d, 0x0bb02d68, 0x1dc9fdb2, 
-	0x1dc7b19b, 0x0bb6068a, 0x0bc78f3b, 0x1dc0c676, 0x1dbe75c8, 0x0bcd668e, 0x0bdee9ca, 0x1db77cdf, 
-	0x1db5279c, 0x0be4bf4a, 0x0bf63d07, 0x1dae20f4, 0x1dabc71d, 0x0bfc10af, 0x0c0d88e2, 0x1da4b2ba, 
-	0x1da25450, 0x0c135ab0, 0x0c24cd4e, 0x1d9b3237, 0x1d98cf3b, 0x0c2a9d3e, 0x0c3c0a3d, 0x1d919f70, 
-	0x1d8f37e5, 0x0c41d84b, 0x0c533fa0, 0x1d87fa6d, 0x1d858e53, 0x0c590bc9, 0x0c6a6d68, 0x1d7e4332, 
-	0x1d7bd28b, 0x0c7037a8, 0x0c819388, 0x1d7479c5, 0x1d720493, 0x0c875bdb, 0x0c98b1f0, 0x1d6a9e2e, 
-	0x1d682472, 0x0c9e7854, 0x0cafc894, 0x1d60b070, 0x1d5e322c, 0x0cb58d04, 0x0cc6d764, 0x1d56b094, 
-	0x1d542dc9, 0x0ccc99de, 0x0cddde53, 0x1d4c9e9f, 0x1d4a174f, 0x0ce39ed2, 0x0cf4dd52, 0x1d427a97, 
-	0x1d3feec3, 0x0cfa9bd2, 0x0d0bd452, 0x1d384483, 0x1d35b42d, 0x0d1190d1, 0x0d22c347, 0x1d2dfc68, 
-	0x1d2b6791, 0x0d287dc1, 0x0d39aa21, 0x1d23a24e, 0x1d2108f8, 0x0d3f6292, 0x0d5088d3, 0x1d19363a, 
-	0x1d169867, 0x0d563f38, 0x0d675f4e, 0x1d0eb833, 0x1d0c15e4, 0x0d6d13a3, 0x0d7e2d85, 0x1d04283f, 
-	0x1d018176, 0x0d83dfc6, 0x0d94f369, 0x1cf98666, 0x1cf6db24, 0x0d9aa393, 0x0dabb0ec, 0x1ceed2ad, 
-	0x1cec22f4, 0x0db15efc, 0x0dc26600, 0x1ce40d1b, 0x1ce158ed, 0x0dc811f3, 0x0dd91298, 0x1cd935b7, 
-	0x1cd67d15, 0x0ddebc69, 0x0defb6a5, 0x1cce4c87, 0x1ccb8f74, 0x0df55e51, 0x0e065219, 0x1cc35192, 
-	0x1cc0900f, 0x0e0bf79c, 0x0e1ce4e6, 0x1cb844df, 0x1cb57eee, 0x0e22883e, 0x0e336eff, 0x1cad2675, 
-	0x1caa5c17, 0x0e391027, 0x0e49f055, 0x1ca1f65b, 0x1c9f2792, 0x0e4f8f4b, 0x0e6068db, 0x1c96b497, 
-	0x1c93e165, 0x0e66059a, 0x0e76d883, 0x1c8b6131, 0x1c888997, 0x0e7c7308, 0x0e8d3f3e, 0x1c7ffc2f, 
-	0x1c7d202f, 0x0e92d787, 0x0ea39d00, 0x1c748599, 0x1c71a535, 0x0ea93308, 0x0eb9f1ba, 0x1c68fd75, 
-	0x1c6618ae, 0x0ebf857d, 0x0ed03d5e, 0x1c5d63ca, 0x1c5a7aa4, 0x0ed5ceda, 0x0ee67fdf, 0x1c51b8a1, 
-	0x1c4ecb1c, 0x0eec0f10, 0x0efcb92f, 0x1c45fc00, 0x1c430a1d, 0x0f024612, 0x0f12e941, 0x1c3a2ded, 
-	0x1c3737b0, 0x0f1873d2, 0x0f291006, 0x1c2e4e72, 0x1c2b53db, 0x0f2e9842, 0x0f3f2d71, 0x1c225d94, 
-	0x1c1f5ea6, 0x0f44b354, 0x0f554175, 0x1c165b5b, 0x1c135818, 0x0f5ac4fc, 0x0f6b4c03, 0x1c0a47cf, 
-	0x1c074038, 0x0f70cd2a, 0x0f814d0e, 0x1bfe22f8, 0x1bfb170f, 0x0f86cbd3, 0x0f974489, 0x1bf1ecdb, 
-	0x1beedca2, 0x0f9cc0e7, 0x0fad3265, 0x1be5a582, 0x1be290fb, 0x0fb2ac5a, 0x0fc31697, 0x1bd94cf4, 
-	0x1bd63421, 0x0fc88e1e, 0x0fd8f10f, 0x1bcce337, 0x1bc9c61a, 0x0fde6626, 0x0feec1c0, 0x1bc06855, 
-	0x1bbd46f0, 0x0ff43464, 0x1004889e, 0x1bb3dc55, 0x1bb0b6a9, 0x1009f8cb, 0x101a459a, 0x1ba73f3d, 
-	0x1ba4154d, 0x101fb34d, 0x102ff8a8, 0x1b9a9117, 0x1b9762e4, 0x103563dc, 0x1045a1b9, 0x1b8dd1ea, 
-	0x1b8a9f77, 0x104b0a6c, 0x105b40c1, 0x1b8101be, 0x1b7dcb0c, 0x1060a6ef, 0x1070d5b1, 0x1b74209b, 
-	0x1b70e5ac, 0x10763958, 0x1086607e, 0x1b672e88, 0x1b63ef5f, 0x108bc19a, 0x109be119, 0x1b5a2b8e, 
-	0x1b56e82c, 0x10a13fa6, 0x10b15775, 0x1b4d17b4, 0x1b49d01c, 0x10b6b371, 0x10c6c385, 0x1b3ff304, 
-	0x1b3ca737, 0x10cc1cec, 0x10dc253c, 0x1b32bd84, 0x1b2f6d85, 0x10e17c0b, 0x10f17c8d, 0x1b25773d, 
-	0x1b22230e, 0x10f6d0c0, 0x1106c96a, 0x1b182038, 0x1b14c7da, 0x110c1afe, 0x111c0bc6, 0x1b0ab87c, 
-	0x1b075bf1, 0x11215ab8, 0x11314395, 0x1afd4012, 0x1af9df5d, 0x11368fe1, 0x114670c8, 0x1aefb702, 
-	0x1aec5225, 0x114bba6b, 0x115b9354, 0x1ae21d54, 0x1adeb451, 0x1160da4b, 0x1170ab2a, 0x1ad47311, 
-	0x1ad105e9, 0x1175ef72, 0x1185b83f, 0x1ac6b841, 0x1ac346f8, 0x118af9d4, 0x119aba84, 0x1ab8ecec, 
-	0x1ab57784, 0x119ff964, 0x11afb1ee, 0x1aab111c, 0x1aa79796, 0x11b4ee14, 0x11c49e6f, 0x1a9d24d9, 
-	0x1a99a737, 0x11c9d7d9, 0x11d97ff9, 0x1a8f282b, 0x1a8ba670, 0x11deb6a4, 0x11ee5682, 0x1a811b1b, 
-	0x1a7d9549, 0x11f38a6a, 0x120321fa, 0x1a72fdb2, 0x1a6f73ca, 0x1208531c, 0x1217e256, 0x1a64cff8, 
-	0x1a6141fd, 0x121d10af, 0x122c9789, 0x1a5691f5, 0x1a52ffeb, 0x1231c316, 0x12414186, 0x1a4843b4, 
-	0x1a44ad9b, 0x12466a44, 0x1255e041, 0x1a39e53d, 0x1a364b17, 0x125b062b, 0x126a73ac, 0x1a2b7698, 
-	0x1a27d868, 0x126f96c1, 0x127efbbb, 0x1a1cf7ce, 0x1a195597, 0x12841bf6, 0x12937861, 0x1a0e68e9, 
-	0x1a0ac2ac, 0x129895c0, 0x12a7e991, 0x19ffc9f1, 0x19fc1fb1, 0x12ad0412, 0x12bc4f40, 0x19f11af0, 
-	0x19ed6caf, 0x12c166de, 0x12d0a960, 0x19e25bee, 0x19dea9ae, 0x12d5be18, 0x12e4f7e5, 0x19d38cf4, 
-	0x19cfd6b8, 0x12ea09b4, 0x12f93ac2, 0x19c4ae0c, 0x19c0f3d6, 0x12fe49a6, 0x130d71eb, 0x19b5bf3f, 
-	0x19b20111, 0x13127de0, 0x13219d53, 0x19a6c096, 0x19a2fe73, 0x1326a656, 0x1335bcef, 0x1997b21b, 
-	0x1993ec04, 0x133ac2fc, 0x1349d0b0, 0x198893d6, 0x1984c9ce, 0x134ed3c5, 0x135dd88c, 0x197965d0, 
-	0x197597da, 0x1362d8a6, 0x1371d476, 0x196a2815, 0x19665632, 0x1376d191, 0x1385c461, 0x195adaab, 
-	0x195704df, 0x138abe7b, 0x1399a841, 0x194b7d9e, 0x1947a3eb, 0x139e9f56, 0x13ad800a, 0x193c10f7, 
-	0x1938335e, 0x13b27417, 0x13c14bb0, 0x192c94bf, 0x1928b343, 0x13c63cb2, 0x13d50b26, 0x191d08ff, 
-	0x191923a3, 0x13d9f91b, 0x13e8be60, 0x190d6dc1, 0x19098488, 0x13eda944, 0x13fc6553, 0x18fdc310, 
-	0x18f9d5fa, 0x14014d23, 0x140ffff1, 0x18ee08f4, 0x18ea1805, 0x1414e4aa, 0x14238e2f, 0x18de3f77, 
-	0x18da4ab2, 0x14286fce, 0x14371001, 0x18ce66a3, 0x18ca6e0a, 0x143bee83, 0x144a855b, 0x18be7e82, 
-	0x18ba8217, 0x144f60bd, 0x145dee30, 0x18ae871e, 0x18aa86e3, 0x1462c670, 0x14714a76, 0x189e8080, 
-	0x189a7c78, 0x14761f8f, 0x14849a1f, 0x188e6ab2, 0x188a62e0, 0x14896c0f, 0x1497dd20, 0x187e45be, 
-	0x187a3a25, 0x149cabe4, 0x14ab136d, 0x186e11af, 0x186a0250, 0x14afdf03, 0x14be3cfa, 0x185dce8e, 
-	0x1859bb6c, 0x14c3055e, 0x14d159bc, 0x184d7c65, 0x18496583, 0x14d61eeb, 0x14e469a6, 0x183d1b3e, 
-	0x1839009e, 0x14e92b9e, 0x14f76cad, 0x182cab24, 0x18288cc8, 0x14fc2b6a, 0x150a62c6, 0x181c2c20, 
-	0x18180a0c, 0x150f1e45, 0x151d4be3, 0x180b9e3d, 0x18077873, 0x15220422, 0x153027fb, 0x17fb0185, 
-	0x17f6d807, 0x1534dcf6, 0x1542f700, 0x17ea5602, 0x17e628d3, 0x1547a8b5, 0x1555b8e8, 0x17d99bbe, 
-	0x17d56ae0, 0x155a6754, 0x15686da7, 0x17c8d2c4, 0x17c49e3b, 0x156d18c7, 0x157b1532, 0x17b7fb1f, 
-	0x17b3c2ec, 0x157fbd03, 0x158daf7c, 0x17a714d7, 0x17a2d8fe, 0x159253fb, 0x15a03c7a, 0x17961ff9, 
-	0x1791e07b, 0x15a4dda5, 0x15b2bc22, 0x17851c8e, 0x1780d96f, 0x15b759f5, 0x15c52e67, 0x17740aa1, 
-	0x176fc3e3, 0x15c9c8e0, 0x15d7933f, 0x1762ea3d, 0x175e9fe2, 0x15dc2a5a, 0x15e9ea9d, 0x1751bb6b, 
-	0x174d6d77, 0x15ee7e58, 0x15fc3477, 0x17407e37, 0x173c2cac, 0x1600c4cf, 0x160e70c1, 0x172f32ab, 
-	0x172add8c, 0x1612fdb3, 0x16209f70, 0x171dd8d2, 0x17198021, 0x162528fa, 0x1632c078, 0x170c70b7, 
-	0x17081477, 0x16374697, 0x1644d3d0, 0x16fafa64, 0x16f69a97, 0x16495680, 0x1656d96a, 0x16e975e4, 
-	0x16e5128e, 0x165b58aa, 0x1668d13e, 0x16d7e341, 0x16d37c65, 0x166d4d0a, 0x167abb3e, 0x16c64288, 
+	0x1fffffd9, 0x0003243f, 0x0015fdba, 0x1ffff872, 0x1ffff382, 0x001c4637, 0x002f1fa6, 0x1fffdd4d,
+	0x1fffd36f, 0x0035681d, 0x00484175, 0x1fffae6c, 0x1fff9f9e, 0x004e89e3, 0x00616318, 0x1fff6bce,
+	0x1fff5811, 0x0067ab77, 0x007a847e, 0x1fff1572, 0x1ffefcc6, 0x0080cccc, 0x0093a599, 0x1ffeab5b,
+	0x1ffe8dbf, 0x0099edd2, 0x00acc658, 0x1ffe2d86, 0x1ffe0afc, 0x00b30e78, 0x00c5e6ad, 0x1ffd9bf6,
+	0x1ffd747c, 0x00cc2eb0, 0x00df0688, 0x1ffcf6aa, 0x1ffcca41, 0x00e54e6a, 0x00f825da, 0x1ffc3da2,
+	0x1ffc0c4b, 0x00fe6d97, 0x01114492, 0x1ffb70e0, 0x1ffb3a9a, 0x01178c27, 0x012a62a2, 0x1ffa9063,
+	0x1ffa552e, 0x0130aa0a, 0x01437ffa, 0x1ff99c2c, 0x1ff95c09, 0x0149c731, 0x015c9c8a, 0x1ff8943c,
+	0x1ff84f2b, 0x0162e38d, 0x0175b843, 0x1ff77893, 0x1ff72e94, 0x017bff0e, 0x018ed316, 0x1ff64932,
+	0x1ff5fa46, 0x019519a5, 0x01a7ecf2, 0x1ff5061b, 0x1ff4b240, 0x01ae3341, 0x01c105c9, 0x1ff3af4c,
+	0x1ff35684, 0x01c74bd5, 0x01da1d8c, 0x1ff244c8, 0x1ff1e713, 0x01e0634f, 0x01f33429, 0x1ff0c68f,
+	0x1ff063ed, 0x01f979a1, 0x020c4993, 0x1fef34a3, 0x1feecd14, 0x02128ebb, 0x02255db9, 0x1fed8f03,
+	0x1fed2287, 0x022ba28f, 0x023e708d, 0x1febd5b2, 0x1feb644a, 0x0244b50b, 0x025781fe, 0x1fea08b0,
+	0x1fe9925c, 0x025dc621, 0x027091fd, 0x1fe827fe, 0x1fe7acbe, 0x0276d5c1, 0x0289a07b, 0x1fe6339d,
+	0x1fe5b372, 0x028fe3dd, 0x02a2ad69, 0x1fe42b90, 0x1fe3a679, 0x02a8f063, 0x02bbb8b6, 0x1fe20fd6,
+	0x1fe185d5, 0x02c1fb46, 0x02d4c253, 0x1fdfe071, 0x1fdf5186, 0x02db0475, 0x02edca32, 0x1fdd9d64,
+	0x1fdd098e, 0x02f40be2, 0x0306d042, 0x1fdb46ae, 0x1fdaadee, 0x030d117c, 0x031fd474, 0x1fd8dc51,
+	0x1fd83ea8, 0x03261534, 0x0338d6b8, 0x1fd65e4f, 0x1fd5bbbd, 0x033f16fb, 0x0351d700, 0x1fd3ccaa,
+	0x1fd32530, 0x035816c1, 0x036ad53c, 0x1fd12763, 0x1fd07b00, 0x03711477, 0x0383d15c, 0x1fce6e7c,
+	0x1fcdbd31, 0x038a100e, 0x039ccb51, 0x1fcba1f5, 0x1fcaebc3, 0x03a30975, 0x03b5c30b, 0x1fc8c1d2,
+	0x1fc806b9, 0x03bc009f, 0x03ceb87c, 0x1fc5ce14, 0x1fc50e14, 0x03d4f57a, 0x03e7ab93, 0x1fc2c6bd,
+	0x1fc201d7, 0x03ede7f9, 0x04009c42, 0x1fbfabcd, 0x1fbee202, 0x0406d80b, 0x04198a78, 0x1fbc7d49,
+	0x1fbbae99, 0x041fc5a1, 0x04327628, 0x1fb93b31, 0x1fb8679c, 0x0438b0ac, 0x044b5f40, 0x1fb5e587,
+	0x1fb50d0e, 0x0451991d, 0x046445b2, 0x1fb27c4e, 0x1fb19ef1, 0x046a7ee3, 0x047d296f, 0x1faeff87,
+	0x1fae1d47, 0x048361f0, 0x04960a67, 0x1fab6f35, 0x1faa8813, 0x049c4235, 0x04aee88b, 0x1fa7cb5a,
+	0x1fa6df56, 0x04b51fa1, 0x04c7c3cb, 0x1fa413f8, 0x1fa32313, 0x04cdfa26, 0x04e09c18, 0x1fa04912,
+	0x1f9f534c, 0x04e6d1b4, 0x04f97163, 0x1f9c6aa9, 0x1f9b7003, 0x04ffa63c, 0x0512439d, 0x1f9878c1,
+	0x1f97793b, 0x051877af, 0x052b12b6, 0x1f94735b, 0x1f936ef6, 0x053145fd, 0x0543de9e, 0x1f905a7a,
+	0x1f8f5137, 0x054a1117, 0x055ca748, 0x1f8c2e21, 0x1f8b2000, 0x0562d8ee, 0x05756ca2, 0x1f87ee52,
+	0x1f86db55, 0x057b9d73, 0x058e2e9f, 0x1f839b10, 0x1f828336, 0x05945e95, 0x05a6ed2e, 0x1f7f345e,
+	0x1f7e17a8, 0x05ad1c47, 0x05bfa840, 0x1f7aba3e, 0x1f7998ad, 0x05c5d678, 0x05d85fc7, 0x1f762cb2,
+	0x1f750647, 0x05de8d19, 0x05f113b3, 0x1f718bbf, 0x1f70607a, 0x05f7401c, 0x0609c3f5, 0x1f6cd766,
+	0x1f6ba748, 0x060fef71, 0x0622707d, 0x1f680fab, 0x1f66dab5, 0x06289b08, 0x063b193c, 0x1f633490,
+	0x1f61fac3, 0x064142d3, 0x0653be23, 0x1f5e4619, 0x1f5d0775, 0x0659e6c2, 0x066c5f24, 0x1f594448,
+	0x1f5800ce, 0x067286c6, 0x0684fc2e, 0x1f542f21, 0x1f52e6d2, 0x068b22d0, 0x069d9532, 0x1f4f06a6,
+	0x1f4db983, 0x06a3bad0, 0x06b62a22, 0x1f49cadc, 0x1f4878e5, 0x06bc4eb9, 0x06cebaee, 0x1f447bc4,
+	0x1f4324fb, 0x06d4de79, 0x06e74786, 0x1f3f1963, 0x1f3dbdc8, 0x06ed6a03, 0x06ffcfdd, 0x1f39a3bc,
+	0x1f384350, 0x0705f147, 0x071853e3, 0x1f341ad2, 0x1f32b595, 0x071e7436, 0x0730d388, 0x1f2e7ea9,
+	0x1f2d149d, 0x0736f2c0, 0x07494ebd, 0x1f28cf43, 0x1f276069, 0x074f6cd7, 0x0761c574, 0x1f230ca5,
+	0x1f2198fd, 0x0767e26c, 0x077a379d, 0x1f1d36d2, 0x1f1bbe5d, 0x07805370, 0x0792a52a, 0x1f174dce,
+	0x1f15d08d, 0x0798bfd3, 0x07ab0e0a, 0x1f11519c, 0x1f0fcf91, 0x07b12786, 0x07c37230, 0x1f0b4240,
+	0x1f09bb6b, 0x07c98a7a, 0x07dbd18c, 0x1f051fbe, 0x1f03941f, 0x07e1e8a1, 0x07f42c0e, 0x1efeea19,
+	0x1efd59b3, 0x07fa41eb, 0x080c81a9, 0x1ef8a155, 0x1ef70c28, 0x0812964a, 0x0824d24d, 0x1ef24577,
+	0x1ef0ab84, 0x082ae5ad, 0x083d1dea, 0x1eebd682, 0x1eea37ca, 0x08433007, 0x08556473, 0x1ee5547a,
+	0x1ee3b0fe, 0x085b7548, 0x086da5d8, 0x1edebf64, 0x1edd1724, 0x0873b562, 0x0885e209, 0x1ed81742,
+	0x1ed66a41, 0x088bf044, 0x089e18f9, 0x1ed15c1a, 0x1ecfaa57, 0x08a425e1, 0x08b64a98, 0x1eca8def,
+	0x1ec8d76c, 0x08bc562a, 0x08ce76d8, 0x1ec3acc6, 0x1ec1f184, 0x08d4810f, 0x08e69da8, 0x1ebcb8a3,
+	0x1ebaf8a3, 0x08eca681, 0x08febefb, 0x1eb5b18a, 0x1eb3eccd, 0x0904c673, 0x0916dac2, 0x1eae977f,
+	0x1eacce07, 0x091ce0d4, 0x092ef0ed, 0x1ea76a87, 0x1ea59c55, 0x0934f596, 0x0947016e, 0x1ea02aa7,
+	0x1e9e57bb, 0x094d04aa, 0x095f0c36, 0x1e98d7e2, 0x1e97003e, 0x09650e01, 0x09771136, 0x1e91723e,
+	0x1e8f95e3, 0x097d118d, 0x098f1060, 0x1e89f9bf, 0x1e8818ad, 0x09950f3f, 0x09a709a4, 0x1e826e69,
+	0x1e8088a2, 0x09ad0707, 0x09befcf4, 0x1e7ad041, 0x1e78e5c7, 0x09c4f8d8, 0x09d6ea40, 0x1e731f4c,
+	0x1e71301f, 0x09dce4a1, 0x09eed17b, 0x1e6b5b8f, 0x1e6967b1, 0x09f4ca56, 0x0a06b296, 0x1e63850e,
+	0x1e618c80, 0x0a0ca9e6, 0x0a1e8d81, 0x1e5b9bce, 0x1e599e91, 0x0a248343, 0x0a36622e, 0x1e539fd4,
+	0x1e519dea, 0x0a3c565e, 0x0a4e308f, 0x1e4b9126, 0x1e498a8e, 0x0a542329, 0x0a65f894, 0x1e436fc7,
+	0x1e416485, 0x0a6be995, 0x0a7dba2f, 0x1e3b3bbd, 0x1e392bd1, 0x0a83a993, 0x0a957551, 0x1e32f50e,
+	0x1e30e079, 0x0a9b6315, 0x0aad29ec, 0x1e2a9bbd, 0x1e288281, 0x0ab3160c, 0x0ac4d7f1, 0x1e222fd1,
+	0x1e2011ee, 0x0acac26a, 0x0adc7f52, 0x1e19b14f, 0x1e178ec7, 0x0ae2681f, 0x0af41fff, 0x1e11203b,
+	0x1e0ef910, 0x0afa071d, 0x0b0bb9eb, 0x1e087c9b, 0x1e0650ce, 0x0b119f56, 0x0b234d07, 0x1dffc674,
+	0x1dfd9606, 0x0b2930bb, 0x0b3ad943, 0x1df6fdcc, 0x1df4c8bf, 0x0b40bb3e, 0x0b525e92, 0x1dee22a9,
+	0x1debe8fd, 0x0b583ecf, 0x0b69dce6, 0x1de5350f, 0x1de2f6c6, 0x0b6fbb62, 0x0b81542f, 0x1ddc3504,
+	0x1dd9f220, 0x0b8730e6, 0x0b98c45f, 0x1dd3228e, 0x1dd0db10, 0x0b9e9f4d, 0x0bb02d68, 0x1dc9fdb2,
+	0x1dc7b19b, 0x0bb6068a, 0x0bc78f3b, 0x1dc0c676, 0x1dbe75c8, 0x0bcd668e, 0x0bdee9ca, 0x1db77cdf,
+	0x1db5279c, 0x0be4bf4a, 0x0bf63d07, 0x1dae20f4, 0x1dabc71d, 0x0bfc10af, 0x0c0d88e2, 0x1da4b2ba,
+	0x1da25450, 0x0c135ab0, 0x0c24cd4e, 0x1d9b3237, 0x1d98cf3b, 0x0c2a9d3e, 0x0c3c0a3d, 0x1d919f70,
+	0x1d8f37e5, 0x0c41d84b, 0x0c533fa0, 0x1d87fa6d, 0x1d858e53, 0x0c590bc9, 0x0c6a6d68, 0x1d7e4332,
+	0x1d7bd28b, 0x0c7037a8, 0x0c819388, 0x1d7479c5, 0x1d720493, 0x0c875bdb, 0x0c98b1f0, 0x1d6a9e2e,
+	0x1d682472, 0x0c9e7854, 0x0cafc894, 0x1d60b070, 0x1d5e322c, 0x0cb58d04, 0x0cc6d764, 0x1d56b094,
+	0x1d542dc9, 0x0ccc99de, 0x0cddde53, 0x1d4c9e9f, 0x1d4a174f, 0x0ce39ed2, 0x0cf4dd52, 0x1d427a97,
+	0x1d3feec3, 0x0cfa9bd2, 0x0d0bd452, 0x1d384483, 0x1d35b42d, 0x0d1190d1, 0x0d22c347, 0x1d2dfc68,
+	0x1d2b6791, 0x0d287dc1, 0x0d39aa21, 0x1d23a24e, 0x1d2108f8, 0x0d3f6292, 0x0d5088d3, 0x1d19363a,
+	0x1d169867, 0x0d563f38, 0x0d675f4e, 0x1d0eb833, 0x1d0c15e4, 0x0d6d13a3, 0x0d7e2d85, 0x1d04283f,
+	0x1d018176, 0x0d83dfc6, 0x0d94f369, 0x1cf98666, 0x1cf6db24, 0x0d9aa393, 0x0dabb0ec, 0x1ceed2ad,
+	0x1cec22f4, 0x0db15efc, 0x0dc26600, 0x1ce40d1b, 0x1ce158ed, 0x0dc811f3, 0x0dd91298, 0x1cd935b7,
+	0x1cd67d15, 0x0ddebc69, 0x0defb6a5, 0x1cce4c87, 0x1ccb8f74, 0x0df55e51, 0x0e065219, 0x1cc35192,
+	0x1cc0900f, 0x0e0bf79c, 0x0e1ce4e6, 0x1cb844df, 0x1cb57eee, 0x0e22883e, 0x0e336eff, 0x1cad2675,
+	0x1caa5c17, 0x0e391027, 0x0e49f055, 0x1ca1f65b, 0x1c9f2792, 0x0e4f8f4b, 0x0e6068db, 0x1c96b497,
+	0x1c93e165, 0x0e66059a, 0x0e76d883, 0x1c8b6131, 0x1c888997, 0x0e7c7308, 0x0e8d3f3e, 0x1c7ffc2f,
+	0x1c7d202f, 0x0e92d787, 0x0ea39d00, 0x1c748599, 0x1c71a535, 0x0ea93308, 0x0eb9f1ba, 0x1c68fd75,
+	0x1c6618ae, 0x0ebf857d, 0x0ed03d5e, 0x1c5d63ca, 0x1c5a7aa4, 0x0ed5ceda, 0x0ee67fdf, 0x1c51b8a1,
+	0x1c4ecb1c, 0x0eec0f10, 0x0efcb92f, 0x1c45fc00, 0x1c430a1d, 0x0f024612, 0x0f12e941, 0x1c3a2ded,
+	0x1c3737b0, 0x0f1873d2, 0x0f291006, 0x1c2e4e72, 0x1c2b53db, 0x0f2e9842, 0x0f3f2d71, 0x1c225d94,
+	0x1c1f5ea6, 0x0f44b354, 0x0f554175, 0x1c165b5b, 0x1c135818, 0x0f5ac4fc, 0x0f6b4c03, 0x1c0a47cf,
+	0x1c074038, 0x0f70cd2a, 0x0f814d0e, 0x1bfe22f8, 0x1bfb170f, 0x0f86cbd3, 0x0f974489, 0x1bf1ecdb,
+	0x1beedca2, 0x0f9cc0e7, 0x0fad3265, 0x1be5a582, 0x1be290fb, 0x0fb2ac5a, 0x0fc31697, 0x1bd94cf4,
+	0x1bd63421, 0x0fc88e1e, 0x0fd8f10f, 0x1bcce337, 0x1bc9c61a, 0x0fde6626, 0x0feec1c0, 0x1bc06855,
+	0x1bbd46f0, 0x0ff43464, 0x1004889e, 0x1bb3dc55, 0x1bb0b6a9, 0x1009f8cb, 0x101a459a, 0x1ba73f3d,
+	0x1ba4154d, 0x101fb34d, 0x102ff8a8, 0x1b9a9117, 0x1b9762e4, 0x103563dc, 0x1045a1b9, 0x1b8dd1ea,
+	0x1b8a9f77, 0x104b0a6c, 0x105b40c1, 0x1b8101be, 0x1b7dcb0c, 0x1060a6ef, 0x1070d5b1, 0x1b74209b,
+	0x1b70e5ac, 0x10763958, 0x1086607e, 0x1b672e88, 0x1b63ef5f, 0x108bc19a, 0x109be119, 0x1b5a2b8e,
+	0x1b56e82c, 0x10a13fa6, 0x10b15775, 0x1b4d17b4, 0x1b49d01c, 0x10b6b371, 0x10c6c385, 0x1b3ff304,
+	0x1b3ca737, 0x10cc1cec, 0x10dc253c, 0x1b32bd84, 0x1b2f6d85, 0x10e17c0b, 0x10f17c8d, 0x1b25773d,
+	0x1b22230e, 0x10f6d0c0, 0x1106c96a, 0x1b182038, 0x1b14c7da, 0x110c1afe, 0x111c0bc6, 0x1b0ab87c,
+	0x1b075bf1, 0x11215ab8, 0x11314395, 0x1afd4012, 0x1af9df5d, 0x11368fe1, 0x114670c8, 0x1aefb702,
+	0x1aec5225, 0x114bba6b, 0x115b9354, 0x1ae21d54, 0x1adeb451, 0x1160da4b, 0x1170ab2a, 0x1ad47311,
+	0x1ad105e9, 0x1175ef72, 0x1185b83f, 0x1ac6b841, 0x1ac346f8, 0x118af9d4, 0x119aba84, 0x1ab8ecec,
+	0x1ab57784, 0x119ff964, 0x11afb1ee, 0x1aab111c, 0x1aa79796, 0x11b4ee14, 0x11c49e6f, 0x1a9d24d9,
+	0x1a99a737, 0x11c9d7d9, 0x11d97ff9, 0x1a8f282b, 0x1a8ba670, 0x11deb6a4, 0x11ee5682, 0x1a811b1b,
+	0x1a7d9549, 0x11f38a6a, 0x120321fa, 0x1a72fdb2, 0x1a6f73ca, 0x1208531c, 0x1217e256, 0x1a64cff8,
+	0x1a6141fd, 0x121d10af, 0x122c9789, 0x1a5691f5, 0x1a52ffeb, 0x1231c316, 0x12414186, 0x1a4843b4,
+	0x1a44ad9b, 0x12466a44, 0x1255e041, 0x1a39e53d, 0x1a364b17, 0x125b062b, 0x126a73ac, 0x1a2b7698,
+	0x1a27d868, 0x126f96c1, 0x127efbbb, 0x1a1cf7ce, 0x1a195597, 0x12841bf6, 0x12937861, 0x1a0e68e9,
+	0x1a0ac2ac, 0x129895c0, 0x12a7e991, 0x19ffc9f1, 0x19fc1fb1, 0x12ad0412, 0x12bc4f40, 0x19f11af0,
+	0x19ed6caf, 0x12c166de, 0x12d0a960, 0x19e25bee, 0x19dea9ae, 0x12d5be18, 0x12e4f7e5, 0x19d38cf4,
+	0x19cfd6b8, 0x12ea09b4, 0x12f93ac2, 0x19c4ae0c, 0x19c0f3d6, 0x12fe49a6, 0x130d71eb, 0x19b5bf3f,
+	0x19b20111, 0x13127de0, 0x13219d53, 0x19a6c096, 0x19a2fe73, 0x1326a656, 0x1335bcef, 0x1997b21b,
+	0x1993ec04, 0x133ac2fc, 0x1349d0b0, 0x198893d6, 0x1984c9ce, 0x134ed3c5, 0x135dd88c, 0x197965d0,
+	0x197597da, 0x1362d8a6, 0x1371d476, 0x196a2815, 0x19665632, 0x1376d191, 0x1385c461, 0x195adaab,
+	0x195704df, 0x138abe7b, 0x1399a841, 0x194b7d9e, 0x1947a3eb, 0x139e9f56, 0x13ad800a, 0x193c10f7,
+	0x1938335e, 0x13b27417, 0x13c14bb0, 0x192c94bf, 0x1928b343, 0x13c63cb2, 0x13d50b26, 0x191d08ff,
+	0x191923a3, 0x13d9f91b, 0x13e8be60, 0x190d6dc1, 0x19098488, 0x13eda944, 0x13fc6553, 0x18fdc310,
+	0x18f9d5fa, 0x14014d23, 0x140ffff1, 0x18ee08f4, 0x18ea1805, 0x1414e4aa, 0x14238e2f, 0x18de3f77,
+	0x18da4ab2, 0x14286fce, 0x14371001, 0x18ce66a3, 0x18ca6e0a, 0x143bee83, 0x144a855b, 0x18be7e82,
+	0x18ba8217, 0x144f60bd, 0x145dee30, 0x18ae871e, 0x18aa86e3, 0x1462c670, 0x14714a76, 0x189e8080,
+	0x189a7c78, 0x14761f8f, 0x14849a1f, 0x188e6ab2, 0x188a62e0, 0x14896c0f, 0x1497dd20, 0x187e45be,
+	0x187a3a25, 0x149cabe4, 0x14ab136d, 0x186e11af, 0x186a0250, 0x14afdf03, 0x14be3cfa, 0x185dce8e,
+	0x1859bb6c, 0x14c3055e, 0x14d159bc, 0x184d7c65, 0x18496583, 0x14d61eeb, 0x14e469a6, 0x183d1b3e,
+	0x1839009e, 0x14e92b9e, 0x14f76cad, 0x182cab24, 0x18288cc8, 0x14fc2b6a, 0x150a62c6, 0x181c2c20,
+	0x18180a0c, 0x150f1e45, 0x151d4be3, 0x180b9e3d, 0x18077873, 0x15220422, 0x153027fb, 0x17fb0185,
+	0x17f6d807, 0x1534dcf6, 0x1542f700, 0x17ea5602, 0x17e628d3, 0x1547a8b5, 0x1555b8e8, 0x17d99bbe,
+	0x17d56ae0, 0x155a6754, 0x15686da7, 0x17c8d2c4, 0x17c49e3b, 0x156d18c7, 0x157b1532, 0x17b7fb1f,
+	0x17b3c2ec, 0x157fbd03, 0x158daf7c, 0x17a714d7, 0x17a2d8fe, 0x159253fb, 0x15a03c7a, 0x17961ff9,
+	0x1791e07b, 0x15a4dda5, 0x15b2bc22, 0x17851c8e, 0x1780d96f, 0x15b759f5, 0x15c52e67, 0x17740aa1,
+	0x176fc3e3, 0x15c9c8e0, 0x15d7933f, 0x1762ea3d, 0x175e9fe2, 0x15dc2a5a, 0x15e9ea9d, 0x1751bb6b,
+	0x174d6d77, 0x15ee7e58, 0x15fc3477, 0x17407e37, 0x173c2cac, 0x1600c4cf, 0x160e70c1, 0x172f32ab,
+	0x172add8c, 0x1612fdb3, 0x16209f70, 0x171dd8d2, 0x17198021, 0x162528fa, 0x1632c078, 0x170c70b7,
+	0x17081477, 0x16374697, 0x1644d3d0, 0x16fafa64, 0x16f69a97, 0x16495680, 0x1656d96a, 0x16e975e4,
+	0x16e5128e, 0x165b58aa, 0x1668d13e, 0x16d7e341, 0x16d37c65, 0x166d4d0a, 0x167abb3e, 0x16c64288,
 	0x16c1d827, 0x167f3394, 0x168c9760, 0x16b493c2, 0x16b025e0, 0x16910c3d, 0x169e659a, 0x16a2d6fb
 };
 
 const int twidTab512[8*6 + 32*6 + 128*6] = {
-	0x20000000, 0x00000000, 0x1d906bcf, 0x0c3ef153, 0x16a09e66, 0x16a09e66, 0x0c3ef153, 0x1d906bcf, 
-	0x20000000, 0x00000000, 0x1f6297d0, 0x063e2e0f, 0x1d906bcf, 0x0c3ef153, 0x1a9b6629, 0x11c73b3a, 
-	0x20000000, 0x00000000, 0x1a9b6629, 0x11c73b3a, 0x0c3ef153, 0x1d906bcf, 0xf9c1d1f1, 0x1f6297d0, 
-	0x00000000, 0x20000000, 0xf3c10ead, 0x1d906bcf, 0xe95f619a, 0x16a09e66, 0xe26f9431, 0x0c3ef153, 
-	0x16a09e66, 0x16a09e66, 0x11c73b3a, 0x1a9b6629, 0x0c3ef153, 0x1d906bcf, 0x063e2e0f, 0x1f6297d0, 
-	0xe95f619a, 0x16a09e66, 0xe09d6830, 0x063e2e0f, 0xe26f9431, 0xf3c10ead, 0xee38c4c6, 0xe56499d7, 
+	0x20000000, 0x00000000, 0x1d906bcf, 0x0c3ef153, 0x16a09e66, 0x16a09e66, 0x0c3ef153, 0x1d906bcf,
+	0x20000000, 0x00000000, 0x1f6297d0, 0x063e2e0f, 0x1d906bcf, 0x0c3ef153, 0x1a9b6629, 0x11c73b3a,
+	0x20000000, 0x00000000, 0x1a9b6629, 0x11c73b3a, 0x0c3ef153, 0x1d906bcf, 0xf9c1d1f1, 0x1f6297d0,
+	0x00000000, 0x20000000, 0xf3c10ead, 0x1d906bcf, 0xe95f619a, 0x16a09e66, 0xe26f9431, 0x0c3ef153,
+	0x16a09e66, 0x16a09e66, 0x11c73b3a, 0x1a9b6629, 0x0c3ef153, 0x1d906bcf, 0x063e2e0f, 0x1f6297d0,
+	0xe95f619a, 0x16a09e66, 0xe09d6830, 0x063e2e0f, 0xe26f9431, 0xf3c10ead, 0xee38c4c6, 0xe56499d7,
 
-	0x20000000, 0x00000000, 0x1fd88da4, 0x0322f4d8, 0x1f6297d0, 0x063e2e0f, 0x1e9f4157, 0x094a0317, 
-	0x20000000, 0x00000000, 0x1ff621e3, 0x0191f65f, 0x1fd88da4, 0x0322f4d8, 0x1fa7557f, 0x04b2041c, 
-	0x20000000, 0x00000000, 0x1fa7557f, 0x04b2041c, 0x1e9f4157, 0x094a0317, 0x1ced7af4, 0x0dae8805, 
-	0x1d906bcf, 0x0c3ef153, 0x1c38b2f2, 0x0f15ae9c, 0x1a9b6629, 0x11c73b3a, 0x18bc806b, 0x144cf325, 
-	0x1f6297d0, 0x063e2e0f, 0x1f0a7efc, 0x07c67e5f, 0x1e9f4157, 0x094a0317, 0x1e212105, 0x0ac7cd3b, 
-	0x1a9b6629, 0x11c73b3a, 0x17b5df22, 0x157d6935, 0x144cf325, 0x18bc806b, 0x10738799, 0x1b728345, 
-	0x16a09e66, 0x16a09e66, 0x144cf325, 0x18bc806b, 0x11c73b3a, 0x1a9b6629, 0x0f15ae9c, 0x1c38b2f2, 
-	0x1d906bcf, 0x0c3ef153, 0x1ced7af4, 0x0dae8805, 0x1c38b2f2, 0x0f15ae9c, 0x1b728345, 0x10738799, 
-	0x0c3ef153, 0x1d906bcf, 0x07c67e5f, 0x1f0a7efc, 0x0322f4d8, 0x1fd88da4, 0xfe6e09a1, 0x1ff621e3, 
-	0x0c3ef153, 0x1d906bcf, 0x094a0317, 0x1e9f4157, 0x063e2e0f, 0x1f6297d0, 0x0322f4d8, 0x1fd88da4, 
-	0x1a9b6629, 0x11c73b3a, 0x19b3e048, 0x130ff7fd, 0x18bc806b, 0x144cf325, 0x17b5df22, 0x157d6935, 
-	0xf9c1d1f1, 0x1f6297d0, 0xf53832c5, 0x1e212105, 0xf0ea5164, 0x1c38b2f2, 0xecf00803, 0x19b3e048, 
-	0x00000000, 0x20000000, 0xfcdd0b28, 0x1fd88da4, 0xf9c1d1f1, 0x1f6297d0, 0xf6b5fce9, 0x1e9f4157, 
-	0x16a09e66, 0x16a09e66, 0x157d6935, 0x17b5df22, 0x144cf325, 0x18bc806b, 0x130ff7fd, 0x19b3e048, 
-	0xe95f619a, 0x16a09e66, 0xe64c1fb8, 0x130ff7fd, 0xe3c74d0e, 0x0f15ae9c, 0xe1dedefb, 0x0ac7cd3b, 
-	0xf3c10ead, 0x1d906bcf, 0xf0ea5164, 0x1c38b2f2, 0xee38c4c6, 0x1a9b6629, 0xebb30cdb, 0x18bc806b, 
-	0x11c73b3a, 0x1a9b6629, 0x10738799, 0x1b728345, 0x0f15ae9c, 0x1c38b2f2, 0x0dae8805, 0x1ced7af4, 
-	0xe09d6830, 0x063e2e0f, 0xe009de1d, 0x0191f65f, 0xe027725c, 0xfcdd0b28, 0xe0f58104, 0xf83981a1, 
-	0xe95f619a, 0x16a09e66, 0xe7437f95, 0x144cf325, 0xe56499d7, 0x11c73b3a, 0xe3c74d0e, 0x0f15ae9c, 
-	0x0c3ef153, 0x1d906bcf, 0x0ac7cd3b, 0x1e212105, 0x094a0317, 0x1e9f4157, 0x07c67e5f, 0x1f0a7efc, 
-	0xe26f9431, 0xf3c10ead, 0xe48d7cbb, 0xef8c7867, 0xe7437f95, 0xebb30cdb, 0xea8296cb, 0xe84a20de, 
-	0xe26f9431, 0x0c3ef153, 0xe160bea9, 0x094a0317, 0xe09d6830, 0x063e2e0f, 0xe027725c, 0x0322f4d8, 
-	0x063e2e0f, 0x1f6297d0, 0x04b2041c, 0x1fa7557f, 0x0322f4d8, 0x1fd88da4, 0x0191f65f, 0x1ff621e3, 
-	0xee38c4c6, 0xe56499d7, 0xf25177fb, 0xe312850c, 0xf6b5fce9, 0xe160bea9, 0xfb4dfbe4, 0xe058aa81, 
+	0x20000000, 0x00000000, 0x1fd88da4, 0x0322f4d8, 0x1f6297d0, 0x063e2e0f, 0x1e9f4157, 0x094a0317,
+	0x20000000, 0x00000000, 0x1ff621e3, 0x0191f65f, 0x1fd88da4, 0x0322f4d8, 0x1fa7557f, 0x04b2041c,
+	0x20000000, 0x00000000, 0x1fa7557f, 0x04b2041c, 0x1e9f4157, 0x094a0317, 0x1ced7af4, 0x0dae8805,
+	0x1d906bcf, 0x0c3ef153, 0x1c38b2f2, 0x0f15ae9c, 0x1a9b6629, 0x11c73b3a, 0x18bc806b, 0x144cf325,
+	0x1f6297d0, 0x063e2e0f, 0x1f0a7efc, 0x07c67e5f, 0x1e9f4157, 0x094a0317, 0x1e212105, 0x0ac7cd3b,
+	0x1a9b6629, 0x11c73b3a, 0x17b5df22, 0x157d6935, 0x144cf325, 0x18bc806b, 0x10738799, 0x1b728345,
+	0x16a09e66, 0x16a09e66, 0x144cf325, 0x18bc806b, 0x11c73b3a, 0x1a9b6629, 0x0f15ae9c, 0x1c38b2f2,
+	0x1d906bcf, 0x0c3ef153, 0x1ced7af4, 0x0dae8805, 0x1c38b2f2, 0x0f15ae9c, 0x1b728345, 0x10738799,
+	0x0c3ef153, 0x1d906bcf, 0x07c67e5f, 0x1f0a7efc, 0x0322f4d8, 0x1fd88da4, 0xfe6e09a1, 0x1ff621e3,
+	0x0c3ef153, 0x1d906bcf, 0x094a0317, 0x1e9f4157, 0x063e2e0f, 0x1f6297d0, 0x0322f4d8, 0x1fd88da4,
+	0x1a9b6629, 0x11c73b3a, 0x19b3e048, 0x130ff7fd, 0x18bc806b, 0x144cf325, 0x17b5df22, 0x157d6935,
+	0xf9c1d1f1, 0x1f6297d0, 0xf53832c5, 0x1e212105, 0xf0ea5164, 0x1c38b2f2, 0xecf00803, 0x19b3e048,
+	0x00000000, 0x20000000, 0xfcdd0b28, 0x1fd88da4, 0xf9c1d1f1, 0x1f6297d0, 0xf6b5fce9, 0x1e9f4157,
+	0x16a09e66, 0x16a09e66, 0x157d6935, 0x17b5df22, 0x144cf325, 0x18bc806b, 0x130ff7fd, 0x19b3e048,
+	0xe95f619a, 0x16a09e66, 0xe64c1fb8, 0x130ff7fd, 0xe3c74d0e, 0x0f15ae9c, 0xe1dedefb, 0x0ac7cd3b,
+	0xf3c10ead, 0x1d906bcf, 0xf0ea5164, 0x1c38b2f2, 0xee38c4c6, 0x1a9b6629, 0xebb30cdb, 0x18bc806b,
+	0x11c73b3a, 0x1a9b6629, 0x10738799, 0x1b728345, 0x0f15ae9c, 0x1c38b2f2, 0x0dae8805, 0x1ced7af4,
+	0xe09d6830, 0x063e2e0f, 0xe009de1d, 0x0191f65f, 0xe027725c, 0xfcdd0b28, 0xe0f58104, 0xf83981a1,
+	0xe95f619a, 0x16a09e66, 0xe7437f95, 0x144cf325, 0xe56499d7, 0x11c73b3a, 0xe3c74d0e, 0x0f15ae9c,
+	0x0c3ef153, 0x1d906bcf, 0x0ac7cd3b, 0x1e212105, 0x094a0317, 0x1e9f4157, 0x07c67e5f, 0x1f0a7efc,
+	0xe26f9431, 0xf3c10ead, 0xe48d7cbb, 0xef8c7867, 0xe7437f95, 0xebb30cdb, 0xea8296cb, 0xe84a20de,
+	0xe26f9431, 0x0c3ef153, 0xe160bea9, 0x094a0317, 0xe09d6830, 0x063e2e0f, 0xe027725c, 0x0322f4d8,
+	0x063e2e0f, 0x1f6297d0, 0x04b2041c, 0x1fa7557f, 0x0322f4d8, 0x1fd88da4, 0x0191f65f, 0x1ff621e3,
+	0xee38c4c6, 0xe56499d7, 0xf25177fb, 0xe312850c, 0xf6b5fce9, 0xe160bea9, 0xfb4dfbe4, 0xe058aa81,
 
-	0x20000000, 0x00000000, 0x1ffd8861, 0x00c90ab0, 0x1ff621e3, 0x0191f65f, 0x1fe9cdad, 0x025aa412, 
-	0x20000000, 0x00000000, 0x1fff6217, 0x00648748, 0x1ffd8861, 0x00c90ab0, 0x1ffa72f0, 0x012d8657, 
-	0x20000000, 0x00000000, 0x1ffa72f0, 0x012d8657, 0x1fe9cdad, 0x025aa412, 0x1fce15fd, 0x0386f0b9, 
-	0x1fd88da4, 0x0322f4d8, 0x1fc26471, 0x03eac9cb, 0x1fa7557f, 0x04b2041c, 0x1f8764fa, 0x05788511, 
-	0x1ff621e3, 0x0191f65f, 0x1ff09566, 0x01f656e8, 0x1fe9cdad, 0x025aa412, 0x1fe1cafd, 0x02beda01, 
-	0x1fa7557f, 0x04b2041c, 0x1f7599a4, 0x05db7678, 0x1f38f3ac, 0x0702e09b, 0x1ef178a4, 0x0827dc07, 
-	0x1f6297d0, 0x063e2e0f, 0x1f38f3ac, 0x0702e09b, 0x1f0a7efc, 0x07c67e5f, 0x1ed740e7, 0x0888e931, 
-	0x1fd88da4, 0x0322f4d8, 0x1fce15fd, 0x0386f0b9, 0x1fc26471, 0x03eac9cb, 0x1fb57972, 0x044e7c34, 
-	0x1e9f4157, 0x094a0317, 0x1e426a4b, 0x0a68f121, 0x1ddb13b7, 0x0b844298, 0x1d696174, 0x0c9b9532, 
-	0x1e9f4157, 0x094a0317, 0x1e6288ec, 0x0a09ae4a, 0x1e212105, 0x0ac7cd3b, 0x1ddb13b7, 0x0b844298, 
-	0x1fa7557f, 0x04b2041c, 0x1f97f925, 0x05155dac, 0x1f8764fa, 0x05788511, 0x1f7599a4, 0x05db7678, 
-	0x1ced7af4, 0x0dae8805, 0x1c678b35, 0x0ebcbbae, 0x1bd7c0ac, 0x0fc5d26e, 0x1b3e4d3f, 0x10c9704d, 
-	0x1d906bcf, 0x0c3ef153, 0x1d4134d1, 0x0cf7bca2, 0x1ced7af4, 0x0dae8805, 0x1c954b21, 0x0e63374d, 
-	0x1f6297d0, 0x063e2e0f, 0x1f4e603b, 0x06a0a809, 0x1f38f3ac, 0x0702e09b, 0x1f2252f7, 0x0764d3f9, 
-	0x1a9b6629, 0x11c73b3a, 0x19ef43ef, 0x12bedb26, 0x193a224a, 0x13affa29, 0x187c4010, 0x149a449c, 
-	0x1c38b2f2, 0x0f15ae9c, 0x1bd7c0ac, 0x0fc5d26e, 0x1b728345, 0x10738799, 0x1b090a58, 0x111eb354, 
-	0x1f0a7efc, 0x07c67e5f, 0x1ef178a4, 0x0827dc07, 0x1ed740e7, 0x0888e931, 0x1ebbd8c9, 0x08e9a220, 
-	0x17b5df22, 0x157d6935, 0x16e74455, 0x16591926, 0x1610b755, 0x172d0838, 0x15328293, 0x17f8ece3, 
-	0x1a9b6629, 0x11c73b3a, 0x1a29a7a0, 0x126d054d, 0x19b3e048, 0x130ff7fd, 0x193a224a, 0x13affa29, 
-	0x1e9f4157, 0x094a0317, 0x1e817bab, 0x09aa0861, 0x1e6288ec, 0x0a09ae4a, 0x1e426a4b, 0x0a68f121, 
-	0x144cf325, 0x18bc806b, 0x136058b1, 0x19777ef5, 0x126d054d, 0x1a29a7a0, 0x11734d64, 0x1ad2bc9e, 
-	0x18bc806b, 0x144cf325, 0x183b0e0c, 0x14e6cabc, 0x17b5df22, 0x157d6935, 0x172d0838, 0x1610b755, 
-	0x1e212105, 0x0ac7cd3b, 0x1dfeae62, 0x0b263eef, 0x1ddb13b7, 0x0b844298, 0x1db65262, 0x0be1d499, 
-	0x10738799, 0x1b728345, 0x0f6e0ca9, 0x1c08c426, 0x0e63374d, 0x1c954b21, 0x0d536416, 0x1d17e774, 
-	0x16a09e66, 0x16a09e66, 0x1610b755, 0x172d0838, 0x157d6935, 0x17b5df22, 0x14e6cabc, 0x183b0e0c, 
-	0x1d906bcf, 0x0c3ef153, 0x1d696174, 0x0c9b9532, 0x1d4134d1, 0x0cf7bca2, 0x1d17e774, 0x0d536416, 
-	0x0c3ef153, 0x1d906bcf, 0x0b263eef, 0x1dfeae62, 0x0a09ae4a, 0x1e6288ec, 0x08e9a220, 0x1ebbd8c9, 
-	0x144cf325, 0x18bc806b, 0x13affa29, 0x193a224a, 0x130ff7fd, 0x19b3e048, 0x126d054d, 0x1a29a7a0, 
-	0x1ced7af4, 0x0dae8805, 0x1cc1f0f4, 0x0e0924ec, 0x1c954b21, 0x0e63374d, 0x1c678b35, 0x0ebcbbae, 
-	0x07c67e5f, 0x1f0a7efc, 0x06a0a809, 0x1f4e603b, 0x05788511, 0x1f8764fa, 0x044e7c34, 0x1fb57972, 
-	0x11c73b3a, 0x1a9b6629, 0x111eb354, 0x1b090a58, 0x10738799, 0x1b728345, 0x0fc5d26e, 0x1bd7c0ac, 
-	0x1c38b2f2, 0x0f15ae9c, 0x1c08c426, 0x0f6e0ca9, 0x1bd7c0ac, 0x0fc5d26e, 0x1ba5aa67, 0x101cfc87, 
-	0x0322f4d8, 0x1fd88da4, 0x01f656e8, 0x1ff09566, 0x00c90ab0, 0x1ffd8861, 0xff9b78b8, 0x1fff6217, 
-	0x0f15ae9c, 0x1c38b2f2, 0x0e63374d, 0x1c954b21, 0x0dae8805, 0x1ced7af4, 0x0cf7bca2, 0x1d4134d1, 
-	0x1b728345, 0x10738799, 0x1b3e4d3f, 0x10c9704d, 0x1b090a58, 0x111eb354, 0x1ad2bc9e, 0x11734d64, 
-	0xfe6e09a1, 0x1ff621e3, 0xfd4125ff, 0x1fe1cafd, 0xfc153635, 0x1fc26471, 0xfaeaa254, 0x1f97f925, 
-	0x0c3ef153, 0x1d906bcf, 0x0b844298, 0x1ddb13b7, 0x0ac7cd3b, 0x1e212105, 0x0a09ae4a, 0x1e6288ec, 
-	0x1a9b6629, 0x11c73b3a, 0x1a63091b, 0x121a7999, 0x1a29a7a0, 0x126d054d, 0x19ef43ef, 0x12bedb26, 
-	0xf9c1d1f1, 0x1f6297d0, 0xf89b2c07, 0x1f2252f7, 0xf77716cf, 0x1ed740e7, 0xf655f79f, 0x1e817bab, 
-	0x094a0317, 0x1e9f4157, 0x0888e931, 0x1ed740e7, 0x07c67e5f, 0x1f0a7efc, 0x0702e09b, 0x1f38f3ac, 
-	0x19b3e048, 0x130ff7fd, 0x19777ef5, 0x136058b1, 0x193a224a, 0x13affa29, 0x18fbcca4, 0x13fed953, 
-	0xf53832c5, 0x1e212105, 0xf41e2b67, 0x1db65262, 0xf308435e, 0x1d4134d1, 0xf1f6db14, 0x1cc1f0f4, 
-	0x063e2e0f, 0x1f6297d0, 0x05788511, 0x1f8764fa, 0x04b2041c, 0x1fa7557f, 0x03eac9cb, 0x1fc26471, 
-	0x18bc806b, 0x144cf325, 0x187c4010, 0x149a449c, 0x183b0e0c, 0x14e6cabc, 0x17f8ece3, 0x15328293, 
-	0xf0ea5164, 0x1c38b2f2, 0xefe30379, 0x1ba5aa67, 0xeee14cac, 0x1b090a58, 0xede58667, 0x1a63091b, 
-	0x0322f4d8, 0x1fd88da4, 0x025aa412, 0x1fe9cdad, 0x0191f65f, 0x1ff621e3, 0x00c90ab0, 0x1ffd8861, 
-	0x17b5df22, 0x157d6935, 0x1771e75f, 0x15c77bbe, 0x172d0838, 0x1610b755, 0x16e74455, 0x16591926, 
-	0xecf00803, 0x19b3e048, 0xec0126ad, 0x18fbcca4, 0xeb193544, 0x183b0e0c, 0xea388442, 0x1771e75f, 
-	0x00000000, 0x20000000, 0xff36f550, 0x1ffd8861, 0xfe6e09a1, 0x1ff621e3, 0xfda55bee, 0x1fe9cdad, 
-	0x16a09e66, 0x16a09e66, 0x16591926, 0x16e74455, 0x1610b755, 0x172d0838, 0x15c77bbe, 0x1771e75f, 
-	0xe95f619a, 0x16a09e66, 0xe88e18a1, 0x15c77bbe, 0xe7c4f1f4, 0x14e6cabc, 0xe704335c, 0x13fed953, 
-	0xfcdd0b28, 0x1fd88da4, 0xfc153635, 0x1fc26471, 0xfb4dfbe4, 0x1fa7557f, 0xfa877aef, 0x1f8764fa, 
-	0x157d6935, 0x17b5df22, 0x15328293, 0x17f8ece3, 0x14e6cabc, 0x183b0e0c, 0x149a449c, 0x187c4010, 
-	0xe64c1fb8, 0x130ff7fd, 0xe59cf6e5, 0x121a7999, 0xe4f6f5a8, 0x111eb354, 0xe45a5599, 0x101cfc87, 
-	0xf9c1d1f1, 0x1f6297d0, 0xf8fd1f65, 0x1f38f3ac, 0xf83981a1, 0x1f0a7efc, 0xf77716cf, 0x1ed740e7, 
-	0x144cf325, 0x18bc806b, 0x13fed953, 0x18fbcca4, 0x13affa29, 0x193a224a, 0x136058b1, 0x19777ef5, 
-	0xe3c74d0e, 0x0f15ae9c, 0xe33e0f0c, 0x0e0924ec, 0xe2becb2f, 0x0cf7bca2, 0xe249ad9e, 0x0be1d499, 
-	0xf6b5fce9, 0x1e9f4157, 0xf5f651b6, 0x1e6288ec, 0xf53832c5, 0x1e212105, 0xf47bbd68, 0x1ddb13b7, 
-	0x130ff7fd, 0x19b3e048, 0x12bedb26, 0x19ef43ef, 0x126d054d, 0x1a29a7a0, 0x121a7999, 0x1a63091b, 
-	0xe1dedefb, 0x0ac7cd3b, 0xe17e8455, 0x09aa0861, 0xe128bf19, 0x0888e931, 0xe0ddad09, 0x0764d3f9, 
-	0xf3c10ead, 0x1d906bcf, 0xf308435e, 0x1d4134d1, 0xf25177fb, 0x1ced7af4, 0xf19cc8b3, 0x1c954b21, 
-	0x11c73b3a, 0x1a9b6629, 0x11734d64, 0x1ad2bc9e, 0x111eb354, 0x1b090a58, 0x10c9704d, 0x1b3e4d3f, 
-	0xe09d6830, 0x063e2e0f, 0xe06806db, 0x05155dac, 0xe03d9b8f, 0x03eac9cb, 0xe01e3503, 0x02beda01, 
-	0xf0ea5164, 0x1c38b2f2, 0xf03a2d92, 0x1bd7c0ac, 0xef8c7867, 0x1b728345, 0xeee14cac, 0x1b090a58, 
-	0x10738799, 0x1b728345, 0x101cfc87, 0x1ba5aa67, 0x0fc5d26e, 0x1bd7c0ac, 0x0f6e0ca9, 0x1c08c426, 
-	0xe009de1d, 0x0191f65f, 0xe0009de9, 0x00648748, 0xe002779f, 0xff36f550, 0xe00f6a9a, 0xfe09a918, 
-	0xee38c4c6, 0x1a9b6629, 0xed92fab3, 0x1a29a7a0, 0xecf00803, 0x19b3e048, 0xec5005d7, 0x193a224a, 
-	0x0f15ae9c, 0x1c38b2f2, 0x0ebcbbae, 0x1c678b35, 0x0e63374d, 0x1c954b21, 0x0e0924ec, 0x1cc1f0f4, 
-	0xe027725c, 0xfcdd0b28, 0xe04a868e, 0xfbb183cc, 0xe0789b06, 0xfa877aef, 0xe0b19fc5, 0xf95f57f7, 
-	0xebb30cdb, 0x18bc806b, 0xeb193544, 0x183b0e0c, 0xea8296cb, 0x17b5df22, 0xe9ef48ab, 0x172d0838, 
-	0x0dae8805, 0x1ced7af4, 0x0d536416, 0x1d17e774, 0x0cf7bca2, 0x1d4134d1, 0x0c9b9532, 0x1d696174, 
-	0xe0f58104, 0xf83981a1, 0xe1442737, 0xf7165de0, 0xe19d7714, 0xf5f651b6, 0xe201519e, 0xf4d9c111, 
-	0xe95f619a, 0x16a09e66, 0xe8d2f7c8, 0x1610b755, 0xe84a20de, 0x157d6935, 0xe7c4f1f4, 0x14e6cabc, 
-	0x0c3ef153, 0x1d906bcf, 0x0be1d499, 0x1db65262, 0x0b844298, 0x1ddb13b7, 0x0b263eef, 0x1dfeae62, 
-	0xe26f9431, 0xf3c10ead, 0xe2e8188c, 0xf2ac9bea, 0xe36ab4df, 0xf19cc8b3, 0xe3f73bda, 0xf091f357, 
-	0xe7437f95, 0x144cf325, 0xe6c5ddb6, 0x13affa29, 0xe64c1fb8, 0x130ff7fd, 0xe5d65860, 0x126d054d, 
-	0x0ac7cd3b, 0x1e212105, 0x0a68f121, 0x1e426a4b, 0x0a09ae4a, 0x1e6288ec, 0x09aa0861, 0x1e817bab, 
-	0xe48d7cbb, 0xef8c7867, 0xe52d4362, 0xee8cb29c, 0xe5d65860, 0xed92fab3, 0xe688810b, 0xec9fa74f, 
-	0xe56499d7, 0x11c73b3a, 0xe4f6f5a8, 0x111eb354, 0xe48d7cbb, 0x10738799, 0xe4283f54, 0x0fc5d26e, 
-	0x094a0317, 0x1e9f4157, 0x08e9a220, 0x1ebbd8c9, 0x0888e931, 0x1ed740e7, 0x0827dc07, 0x1ef178a4, 
-	0xe7437f95, 0xebb30cdb, 0xe807131d, 0xeacd7d6d, 0xe8d2f7c8, 0xe9ef48ab, 0xe9a6e6da, 0xe918bbab, 
-	0xe3c74d0e, 0x0f15ae9c, 0xe36ab4df, 0x0e63374d, 0xe312850c, 0x0dae8805, 0xe2becb2f, 0x0cf7bca2, 
-	0x07c67e5f, 0x1f0a7efc, 0x0764d3f9, 0x1f2252f7, 0x0702e09b, 0x1f38f3ac, 0x06a0a809, 0x1f4e603b, 
-	0xea8296cb, 0xe84a20de, 0xeb65bb64, 0xe783bff0, 0xec5005d7, 0xe6c5ddb6, 0xed4124da, 0xe610bc11, 
-	0xe26f9431, 0x0c3ef153, 0xe224ec49, 0x0b844298, 0xe1dedefb, 0x0ac7cd3b, 0xe19d7714, 0x0a09ae4a, 
-	0x063e2e0f, 0x1f6297d0, 0x05db7678, 0x1f7599a4, 0x05788511, 0x1f8764fa, 0x05155dac, 0x1f97f925, 
-	0xee38c4c6, 0xe56499d7, 0xef368fb3, 0xe4c1b2c1, 0xf03a2d92, 0xe4283f54, 0xf1434452, 0xe39874cb, 
-	0xe160bea9, 0x094a0317, 0xe128bf19, 0x0888e931, 0xe0f58104, 0x07c67e5f, 0xe0c70c54, 0x0702e09b, 
-	0x04b2041c, 0x1fa7557f, 0x044e7c34, 0x1fb57972, 0x03eac9cb, 0x1fc26471, 0x0386f0b9, 0x1fce15fd, 
-	0xf25177fb, 0xe312850c, 0xf3646ace, 0xe2969e8c, 0xf47bbd68, 0xe224ec49, 0xf5970edf, 0xe1bd95b5, 
-	0xe09d6830, 0x063e2e0f, 0xe0789b06, 0x05788511, 0xe058aa81, 0x04b2041c, 0xe03d9b8f, 0x03eac9cb, 
-	0x0322f4d8, 0x1fd88da4, 0x02beda01, 0x1fe1cafd, 0x025aa412, 0x1fe9cdad, 0x01f656e8, 0x1ff09566, 
-	0xf6b5fce9, 0xe160bea9, 0xf7d823f9, 0xe10e875c, 0xf8fd1f65, 0xe0c70c54, 0xfa248988, 0xe08a665c, 
-	0xe027725c, 0x0322f4d8, 0xe0163253, 0x025aa412, 0xe009de1d, 0x0191f65f, 0xe002779f, 0x00c90ab0, 
-	0x0191f65f, 0x1ff621e3, 0x012d8657, 0x1ffa72f0, 0x00c90ab0, 0x1ffd8861, 0x00648748, 0x1fff6217, 
+	0x20000000, 0x00000000, 0x1ffd8861, 0x00c90ab0, 0x1ff621e3, 0x0191f65f, 0x1fe9cdad, 0x025aa412,
+	0x20000000, 0x00000000, 0x1fff6217, 0x00648748, 0x1ffd8861, 0x00c90ab0, 0x1ffa72f0, 0x012d8657,
+	0x20000000, 0x00000000, 0x1ffa72f0, 0x012d8657, 0x1fe9cdad, 0x025aa412, 0x1fce15fd, 0x0386f0b9,
+	0x1fd88da4, 0x0322f4d8, 0x1fc26471, 0x03eac9cb, 0x1fa7557f, 0x04b2041c, 0x1f8764fa, 0x05788511,
+	0x1ff621e3, 0x0191f65f, 0x1ff09566, 0x01f656e8, 0x1fe9cdad, 0x025aa412, 0x1fe1cafd, 0x02beda01,
+	0x1fa7557f, 0x04b2041c, 0x1f7599a4, 0x05db7678, 0x1f38f3ac, 0x0702e09b, 0x1ef178a4, 0x0827dc07,
+	0x1f6297d0, 0x063e2e0f, 0x1f38f3ac, 0x0702e09b, 0x1f0a7efc, 0x07c67e5f, 0x1ed740e7, 0x0888e931,
+	0x1fd88da4, 0x0322f4d8, 0x1fce15fd, 0x0386f0b9, 0x1fc26471, 0x03eac9cb, 0x1fb57972, 0x044e7c34,
+	0x1e9f4157, 0x094a0317, 0x1e426a4b, 0x0a68f121, 0x1ddb13b7, 0x0b844298, 0x1d696174, 0x0c9b9532,
+	0x1e9f4157, 0x094a0317, 0x1e6288ec, 0x0a09ae4a, 0x1e212105, 0x0ac7cd3b, 0x1ddb13b7, 0x0b844298,
+	0x1fa7557f, 0x04b2041c, 0x1f97f925, 0x05155dac, 0x1f8764fa, 0x05788511, 0x1f7599a4, 0x05db7678,
+	0x1ced7af4, 0x0dae8805, 0x1c678b35, 0x0ebcbbae, 0x1bd7c0ac, 0x0fc5d26e, 0x1b3e4d3f, 0x10c9704d,
+	0x1d906bcf, 0x0c3ef153, 0x1d4134d1, 0x0cf7bca2, 0x1ced7af4, 0x0dae8805, 0x1c954b21, 0x0e63374d,
+	0x1f6297d0, 0x063e2e0f, 0x1f4e603b, 0x06a0a809, 0x1f38f3ac, 0x0702e09b, 0x1f2252f7, 0x0764d3f9,
+	0x1a9b6629, 0x11c73b3a, 0x19ef43ef, 0x12bedb26, 0x193a224a, 0x13affa29, 0x187c4010, 0x149a449c,
+	0x1c38b2f2, 0x0f15ae9c, 0x1bd7c0ac, 0x0fc5d26e, 0x1b728345, 0x10738799, 0x1b090a58, 0x111eb354,
+	0x1f0a7efc, 0x07c67e5f, 0x1ef178a4, 0x0827dc07, 0x1ed740e7, 0x0888e931, 0x1ebbd8c9, 0x08e9a220,
+	0x17b5df22, 0x157d6935, 0x16e74455, 0x16591926, 0x1610b755, 0x172d0838, 0x15328293, 0x17f8ece3,
+	0x1a9b6629, 0x11c73b3a, 0x1a29a7a0, 0x126d054d, 0x19b3e048, 0x130ff7fd, 0x193a224a, 0x13affa29,
+	0x1e9f4157, 0x094a0317, 0x1e817bab, 0x09aa0861, 0x1e6288ec, 0x0a09ae4a, 0x1e426a4b, 0x0a68f121,
+	0x144cf325, 0x18bc806b, 0x136058b1, 0x19777ef5, 0x126d054d, 0x1a29a7a0, 0x11734d64, 0x1ad2bc9e,
+	0x18bc806b, 0x144cf325, 0x183b0e0c, 0x14e6cabc, 0x17b5df22, 0x157d6935, 0x172d0838, 0x1610b755,
+	0x1e212105, 0x0ac7cd3b, 0x1dfeae62, 0x0b263eef, 0x1ddb13b7, 0x0b844298, 0x1db65262, 0x0be1d499,
+	0x10738799, 0x1b728345, 0x0f6e0ca9, 0x1c08c426, 0x0e63374d, 0x1c954b21, 0x0d536416, 0x1d17e774,
+	0x16a09e66, 0x16a09e66, 0x1610b755, 0x172d0838, 0x157d6935, 0x17b5df22, 0x14e6cabc, 0x183b0e0c,
+	0x1d906bcf, 0x0c3ef153, 0x1d696174, 0x0c9b9532, 0x1d4134d1, 0x0cf7bca2, 0x1d17e774, 0x0d536416,
+	0x0c3ef153, 0x1d906bcf, 0x0b263eef, 0x1dfeae62, 0x0a09ae4a, 0x1e6288ec, 0x08e9a220, 0x1ebbd8c9,
+	0x144cf325, 0x18bc806b, 0x13affa29, 0x193a224a, 0x130ff7fd, 0x19b3e048, 0x126d054d, 0x1a29a7a0,
+	0x1ced7af4, 0x0dae8805, 0x1cc1f0f4, 0x0e0924ec, 0x1c954b21, 0x0e63374d, 0x1c678b35, 0x0ebcbbae,
+	0x07c67e5f, 0x1f0a7efc, 0x06a0a809, 0x1f4e603b, 0x05788511, 0x1f8764fa, 0x044e7c34, 0x1fb57972,
+	0x11c73b3a, 0x1a9b6629, 0x111eb354, 0x1b090a58, 0x10738799, 0x1b728345, 0x0fc5d26e, 0x1bd7c0ac,
+	0x1c38b2f2, 0x0f15ae9c, 0x1c08c426, 0x0f6e0ca9, 0x1bd7c0ac, 0x0fc5d26e, 0x1ba5aa67, 0x101cfc87,
+	0x0322f4d8, 0x1fd88da4, 0x01f656e8, 0x1ff09566, 0x00c90ab0, 0x1ffd8861, 0xff9b78b8, 0x1fff6217,
+	0x0f15ae9c, 0x1c38b2f2, 0x0e63374d, 0x1c954b21, 0x0dae8805, 0x1ced7af4, 0x0cf7bca2, 0x1d4134d1,
+	0x1b728345, 0x10738799, 0x1b3e4d3f, 0x10c9704d, 0x1b090a58, 0x111eb354, 0x1ad2bc9e, 0x11734d64,
+	0xfe6e09a1, 0x1ff621e3, 0xfd4125ff, 0x1fe1cafd, 0xfc153635, 0x1fc26471, 0xfaeaa254, 0x1f97f925,
+	0x0c3ef153, 0x1d906bcf, 0x0b844298, 0x1ddb13b7, 0x0ac7cd3b, 0x1e212105, 0x0a09ae4a, 0x1e6288ec,
+	0x1a9b6629, 0x11c73b3a, 0x1a63091b, 0x121a7999, 0x1a29a7a0, 0x126d054d, 0x19ef43ef, 0x12bedb26,
+	0xf9c1d1f1, 0x1f6297d0, 0xf89b2c07, 0x1f2252f7, 0xf77716cf, 0x1ed740e7, 0xf655f79f, 0x1e817bab,
+	0x094a0317, 0x1e9f4157, 0x0888e931, 0x1ed740e7, 0x07c67e5f, 0x1f0a7efc, 0x0702e09b, 0x1f38f3ac,
+	0x19b3e048, 0x130ff7fd, 0x19777ef5, 0x136058b1, 0x193a224a, 0x13affa29, 0x18fbcca4, 0x13fed953,
+	0xf53832c5, 0x1e212105, 0xf41e2b67, 0x1db65262, 0xf308435e, 0x1d4134d1, 0xf1f6db14, 0x1cc1f0f4,
+	0x063e2e0f, 0x1f6297d0, 0x05788511, 0x1f8764fa, 0x04b2041c, 0x1fa7557f, 0x03eac9cb, 0x1fc26471,
+	0x18bc806b, 0x144cf325, 0x187c4010, 0x149a449c, 0x183b0e0c, 0x14e6cabc, 0x17f8ece3, 0x15328293,
+	0xf0ea5164, 0x1c38b2f2, 0xefe30379, 0x1ba5aa67, 0xeee14cac, 0x1b090a58, 0xede58667, 0x1a63091b,
+	0x0322f4d8, 0x1fd88da4, 0x025aa412, 0x1fe9cdad, 0x0191f65f, 0x1ff621e3, 0x00c90ab0, 0x1ffd8861,
+	0x17b5df22, 0x157d6935, 0x1771e75f, 0x15c77bbe, 0x172d0838, 0x1610b755, 0x16e74455, 0x16591926,
+	0xecf00803, 0x19b3e048, 0xec0126ad, 0x18fbcca4, 0xeb193544, 0x183b0e0c, 0xea388442, 0x1771e75f,
+	0x00000000, 0x20000000, 0xff36f550, 0x1ffd8861, 0xfe6e09a1, 0x1ff621e3, 0xfda55bee, 0x1fe9cdad,
+	0x16a09e66, 0x16a09e66, 0x16591926, 0x16e74455, 0x1610b755, 0x172d0838, 0x15c77bbe, 0x1771e75f,
+	0xe95f619a, 0x16a09e66, 0xe88e18a1, 0x15c77bbe, 0xe7c4f1f4, 0x14e6cabc, 0xe704335c, 0x13fed953,
+	0xfcdd0b28, 0x1fd88da4, 0xfc153635, 0x1fc26471, 0xfb4dfbe4, 0x1fa7557f, 0xfa877aef, 0x1f8764fa,
+	0x157d6935, 0x17b5df22, 0x15328293, 0x17f8ece3, 0x14e6cabc, 0x183b0e0c, 0x149a449c, 0x187c4010,
+	0xe64c1fb8, 0x130ff7fd, 0xe59cf6e5, 0x121a7999, 0xe4f6f5a8, 0x111eb354, 0xe45a5599, 0x101cfc87,
+	0xf9c1d1f1, 0x1f6297d0, 0xf8fd1f65, 0x1f38f3ac, 0xf83981a1, 0x1f0a7efc, 0xf77716cf, 0x1ed740e7,
+	0x144cf325, 0x18bc806b, 0x13fed953, 0x18fbcca4, 0x13affa29, 0x193a224a, 0x136058b1, 0x19777ef5,
+	0xe3c74d0e, 0x0f15ae9c, 0xe33e0f0c, 0x0e0924ec, 0xe2becb2f, 0x0cf7bca2, 0xe249ad9e, 0x0be1d499,
+	0xf6b5fce9, 0x1e9f4157, 0xf5f651b6, 0x1e6288ec, 0xf53832c5, 0x1e212105, 0xf47bbd68, 0x1ddb13b7,
+	0x130ff7fd, 0x19b3e048, 0x12bedb26, 0x19ef43ef, 0x126d054d, 0x1a29a7a0, 0x121a7999, 0x1a63091b,
+	0xe1dedefb, 0x0ac7cd3b, 0xe17e8455, 0x09aa0861, 0xe128bf19, 0x0888e931, 0xe0ddad09, 0x0764d3f9,
+	0xf3c10ead, 0x1d906bcf, 0xf308435e, 0x1d4134d1, 0xf25177fb, 0x1ced7af4, 0xf19cc8b3, 0x1c954b21,
+	0x11c73b3a, 0x1a9b6629, 0x11734d64, 0x1ad2bc9e, 0x111eb354, 0x1b090a58, 0x10c9704d, 0x1b3e4d3f,
+	0xe09d6830, 0x063e2e0f, 0xe06806db, 0x05155dac, 0xe03d9b8f, 0x03eac9cb, 0xe01e3503, 0x02beda01,
+	0xf0ea5164, 0x1c38b2f2, 0xf03a2d92, 0x1bd7c0ac, 0xef8c7867, 0x1b728345, 0xeee14cac, 0x1b090a58,
+	0x10738799, 0x1b728345, 0x101cfc87, 0x1ba5aa67, 0x0fc5d26e, 0x1bd7c0ac, 0x0f6e0ca9, 0x1c08c426,
+	0xe009de1d, 0x0191f65f, 0xe0009de9, 0x00648748, 0xe002779f, 0xff36f550, 0xe00f6a9a, 0xfe09a918,
+	0xee38c4c6, 0x1a9b6629, 0xed92fab3, 0x1a29a7a0, 0xecf00803, 0x19b3e048, 0xec5005d7, 0x193a224a,
+	0x0f15ae9c, 0x1c38b2f2, 0x0ebcbbae, 0x1c678b35, 0x0e63374d, 0x1c954b21, 0x0e0924ec, 0x1cc1f0f4,
+	0xe027725c, 0xfcdd0b28, 0xe04a868e, 0xfbb183cc, 0xe0789b06, 0xfa877aef, 0xe0b19fc5, 0xf95f57f7,
+	0xebb30cdb, 0x18bc806b, 0xeb193544, 0x183b0e0c, 0xea8296cb, 0x17b5df22, 0xe9ef48ab, 0x172d0838,
+	0x0dae8805, 0x1ced7af4, 0x0d536416, 0x1d17e774, 0x0cf7bca2, 0x1d4134d1, 0x0c9b9532, 0x1d696174,
+	0xe0f58104, 0xf83981a1, 0xe1442737, 0xf7165de0, 0xe19d7714, 0xf5f651b6, 0xe201519e, 0xf4d9c111,
+	0xe95f619a, 0x16a09e66, 0xe8d2f7c8, 0x1610b755, 0xe84a20de, 0x157d6935, 0xe7c4f1f4, 0x14e6cabc,
+	0x0c3ef153, 0x1d906bcf, 0x0be1d499, 0x1db65262, 0x0b844298, 0x1ddb13b7, 0x0b263eef, 0x1dfeae62,
+	0xe26f9431, 0xf3c10ead, 0xe2e8188c, 0xf2ac9bea, 0xe36ab4df, 0xf19cc8b3, 0xe3f73bda, 0xf091f357,
+	0xe7437f95, 0x144cf325, 0xe6c5ddb6, 0x13affa29, 0xe64c1fb8, 0x130ff7fd, 0xe5d65860, 0x126d054d,
+	0x0ac7cd3b, 0x1e212105, 0x0a68f121, 0x1e426a4b, 0x0a09ae4a, 0x1e6288ec, 0x09aa0861, 0x1e817bab,
+	0xe48d7cbb, 0xef8c7867, 0xe52d4362, 0xee8cb29c, 0xe5d65860, 0xed92fab3, 0xe688810b, 0xec9fa74f,
+	0xe56499d7, 0x11c73b3a, 0xe4f6f5a8, 0x111eb354, 0xe48d7cbb, 0x10738799, 0xe4283f54, 0x0fc5d26e,
+	0x094a0317, 0x1e9f4157, 0x08e9a220, 0x1ebbd8c9, 0x0888e931, 0x1ed740e7, 0x0827dc07, 0x1ef178a4,
+	0xe7437f95, 0xebb30cdb, 0xe807131d, 0xeacd7d6d, 0xe8d2f7c8, 0xe9ef48ab, 0xe9a6e6da, 0xe918bbab,
+	0xe3c74d0e, 0x0f15ae9c, 0xe36ab4df, 0x0e63374d, 0xe312850c, 0x0dae8805, 0xe2becb2f, 0x0cf7bca2,
+	0x07c67e5f, 0x1f0a7efc, 0x0764d3f9, 0x1f2252f7, 0x0702e09b, 0x1f38f3ac, 0x06a0a809, 0x1f4e603b,
+	0xea8296cb, 0xe84a20de, 0xeb65bb64, 0xe783bff0, 0xec5005d7, 0xe6c5ddb6, 0xed4124da, 0xe610bc11,
+	0xe26f9431, 0x0c3ef153, 0xe224ec49, 0x0b844298, 0xe1dedefb, 0x0ac7cd3b, 0xe19d7714, 0x0a09ae4a,
+	0x063e2e0f, 0x1f6297d0, 0x05db7678, 0x1f7599a4, 0x05788511, 0x1f8764fa, 0x05155dac, 0x1f97f925,
+	0xee38c4c6, 0xe56499d7, 0xef368fb3, 0xe4c1b2c1, 0xf03a2d92, 0xe4283f54, 0xf1434452, 0xe39874cb,
+	0xe160bea9, 0x094a0317, 0xe128bf19, 0x0888e931, 0xe0f58104, 0x07c67e5f, 0xe0c70c54, 0x0702e09b,
+	0x04b2041c, 0x1fa7557f, 0x044e7c34, 0x1fb57972, 0x03eac9cb, 0x1fc26471, 0x0386f0b9, 0x1fce15fd,
+	0xf25177fb, 0xe312850c, 0xf3646ace, 0xe2969e8c, 0xf47bbd68, 0xe224ec49, 0xf5970edf, 0xe1bd95b5,
+	0xe09d6830, 0x063e2e0f, 0xe0789b06, 0x05788511, 0xe058aa81, 0x04b2041c, 0xe03d9b8f, 0x03eac9cb,
+	0x0322f4d8, 0x1fd88da4, 0x02beda01, 0x1fe1cafd, 0x025aa412, 0x1fe9cdad, 0x01f656e8, 0x1ff09566,
+	0xf6b5fce9, 0xe160bea9, 0xf7d823f9, 0xe10e875c, 0xf8fd1f65, 0xe0c70c54, 0xfa248988, 0xe08a665c,
+	0xe027725c, 0x0322f4d8, 0xe0163253, 0x025aa412, 0xe009de1d, 0x0191f65f, 0xe002779f, 0x00c90ab0,
+	0x0191f65f, 0x1ff621e3, 0x012d8657, 0x1ffa72f0, 0x00c90ab0, 0x1ffd8861, 0x00648748, 0x1fff6217,
 	0xfb4dfbe4, 0xe058aa81, 0xfc790f47, 0xe031ea03, 0xfda55bee, 0xe0163253, 0xfed279a9, 0xe0058d10
 };
 
 const int twidTab64[4*6 + 16*6] = {
-	0x20000000, 0x00000000, 0x16a09e66, 0x16a09e66, 0x00000000, 0x20000000, 0xe95f619a, 0x16a09e66, 
-	0x20000000, 0x00000000, 0x1d906bcf, 0x0c3ef153, 0x16a09e66, 0x16a09e66, 0x0c3ef153, 0x1d906bcf, 
-	0x20000000, 0x00000000, 0x0c3ef153, 0x1d906bcf, 0xe95f619a, 0x16a09e66, 0xe26f9431, 0xf3c10ead, 
+	0x20000000, 0x00000000, 0x16a09e66, 0x16a09e66, 0x00000000, 0x20000000, 0xe95f619a, 0x16a09e66,
+	0x20000000, 0x00000000, 0x1d906bcf, 0x0c3ef153, 0x16a09e66, 0x16a09e66, 0x0c3ef153, 0x1d906bcf,
+	0x20000000, 0x00000000, 0x0c3ef153, 0x1d906bcf, 0xe95f619a, 0x16a09e66, 0xe26f9431, 0xf3c10ead,
 
-	0x20000000, 0x00000000, 0x1f6297d0, 0x063e2e0f, 0x1d906bcf, 0x0c3ef153, 0x1a9b6629, 0x11c73b3a, 
-	0x20000000, 0x00000000, 0x1fd88da4, 0x0322f4d8, 0x1f6297d0, 0x063e2e0f, 0x1e9f4157, 0x094a0317, 
-	0x20000000, 0x00000000, 0x1e9f4157, 0x094a0317, 0x1a9b6629, 0x11c73b3a, 0x144cf325, 0x18bc806b, 
-	0x16a09e66, 0x16a09e66, 0x11c73b3a, 0x1a9b6629, 0x0c3ef153, 0x1d906bcf, 0x063e2e0f, 0x1f6297d0, 
-	0x1d906bcf, 0x0c3ef153, 0x1c38b2f2, 0x0f15ae9c, 0x1a9b6629, 0x11c73b3a, 0x18bc806b, 0x144cf325, 
-	0x0c3ef153, 0x1d906bcf, 0x0322f4d8, 0x1fd88da4, 0xf9c1d1f1, 0x1f6297d0, 0xf0ea5164, 0x1c38b2f2, 
-	0x00000000, 0x20000000, 0xf9c1d1f1, 0x1f6297d0, 0xf3c10ead, 0x1d906bcf, 0xee38c4c6, 0x1a9b6629, 
-	0x16a09e66, 0x16a09e66, 0x144cf325, 0x18bc806b, 0x11c73b3a, 0x1a9b6629, 0x0f15ae9c, 0x1c38b2f2, 
-	0xe95f619a, 0x16a09e66, 0xe3c74d0e, 0x0f15ae9c, 0xe09d6830, 0x063e2e0f, 0xe027725c, 0xfcdd0b28, 
-	0xe95f619a, 0x16a09e66, 0xe56499d7, 0x11c73b3a, 0xe26f9431, 0x0c3ef153, 0xe09d6830, 0x063e2e0f, 
-	0x0c3ef153, 0x1d906bcf, 0x094a0317, 0x1e9f4157, 0x063e2e0f, 0x1f6297d0, 0x0322f4d8, 0x1fd88da4, 
+	0x20000000, 0x00000000, 0x1f6297d0, 0x063e2e0f, 0x1d906bcf, 0x0c3ef153, 0x1a9b6629, 0x11c73b3a,
+	0x20000000, 0x00000000, 0x1fd88da4, 0x0322f4d8, 0x1f6297d0, 0x063e2e0f, 0x1e9f4157, 0x094a0317,
+	0x20000000, 0x00000000, 0x1e9f4157, 0x094a0317, 0x1a9b6629, 0x11c73b3a, 0x144cf325, 0x18bc806b,
+	0x16a09e66, 0x16a09e66, 0x11c73b3a, 0x1a9b6629, 0x0c3ef153, 0x1d906bcf, 0x063e2e0f, 0x1f6297d0,
+	0x1d906bcf, 0x0c3ef153, 0x1c38b2f2, 0x0f15ae9c, 0x1a9b6629, 0x11c73b3a, 0x18bc806b, 0x144cf325,
+	0x0c3ef153, 0x1d906bcf, 0x0322f4d8, 0x1fd88da4, 0xf9c1d1f1, 0x1f6297d0, 0xf0ea5164, 0x1c38b2f2,
+	0x00000000, 0x20000000, 0xf9c1d1f1, 0x1f6297d0, 0xf3c10ead, 0x1d906bcf, 0xee38c4c6, 0x1a9b6629,
+	0x16a09e66, 0x16a09e66, 0x144cf325, 0x18bc806b, 0x11c73b3a, 0x1a9b6629, 0x0f15ae9c, 0x1c38b2f2,
+	0xe95f619a, 0x16a09e66, 0xe3c74d0e, 0x0f15ae9c, 0xe09d6830, 0x063e2e0f, 0xe027725c, 0xfcdd0b28,
+	0xe95f619a, 0x16a09e66, 0xe56499d7, 0x11c73b3a, 0xe26f9431, 0x0c3ef153, 0xe09d6830, 0x063e2e0f,
+	0x0c3ef153, 0x1d906bcf, 0x094a0317, 0x1e9f4157, 0x063e2e0f, 0x1f6297d0, 0x0322f4d8, 0x1fd88da4,
 	0xe26f9431, 0xf3c10ead, 0xe7437f95, 0xebb30cdb, 0xee38c4c6, 0xe56499d7, 0xf6b5fce9, 0xe160bea9
 };
 
 #else
 
-/* 
- *  Q30 for 128 and 1024 
+/*
+ *  Q30 for 128 and 1024
  *
  * for (i = 0; i < num/4; i++) {
  *   angle = (i + 0.125) * M_PI / num;
  *   x = cos(angle) * (1 << 30);
  *   x = sin(angle) * (1 << 30);
- * 
+ *
  *   angle = (num/2 - 1 - i + 0.125) * M_PI / num;
  *   x = cos(angle) * (1 << 30);
  *   x = sin(angle) * (1 << 30);
@@ -667,379 +667,379 @@
  */
 const int cossintab[128 + 1024] = {
 	/* 128 */
-	0x3fffec43, 0x003243f1, 0x015fd4d2, 0x3ffc38d1, 0x3ff9c13a, 0x01c454f5, 0x02f1b755, 0x3feea776, 
-	0x3fe9b8a9, 0x03562038, 0x0483259d, 0x3fd73a4a, 0x3fcfd50b, 0x04e767c5, 0x0613e1c5, 0x3fb5f4ea, 
-	0x3fac1a5b, 0x0677edbb, 0x07a3adff, 0x3f8adc77, 0x3f7e8e1e, 0x08077457, 0x09324ca7, 0x3f55f796, 
-	0x3f473759, 0x0995bdfd, 0x0abf8043, 0x3f174e70, 0x3f061e95, 0x0b228d42, 0x0c4b0b94, 0x3eceeaad, 
-	0x3ebb4ddb, 0x0cada4f5, 0x0dd4b19a, 0x3e7cd778, 0x3e66d0b4, 0x0e36c82a, 0x0f5c35a3, 0x3e212179, 
-	0x3e08b42a, 0x0fbdba40, 0x10e15b4e, 0x3dbbd6d4, 0x3da106bd, 0x11423ef0, 0x1263e699, 0x3d4d0728, 
-	0x3d2fd86c, 0x12c41a4f, 0x13e39be9, 0x3cd4c38b, 0x3cb53aaa, 0x144310dd, 0x15604013, 0x3c531e88, 
-	0x3c314060, 0x15bee78c, 0x16d99864, 0x3bc82c1f, 0x3ba3fde7, 0x173763c9, 0x184f6aab, 0x3b3401bb, 
-	0x3b0d8909, 0x18ac4b87, 0x19c17d44, 0x3a96b636, 0x3a6df8f8, 0x1a1d6544, 0x1b2f971e, 0x39f061d2, 
-	0x39c5664f, 0x1b8a7815, 0x1c997fc4, 0x39411e33, 0x3913eb0e, 0x1cf34baf, 0x1dfeff67, 0x38890663, 
-	0x3859a292, 0x1e57a86d, 0x1f5fdee6, 0x37c836c2, 0x3796a996, 0x1fb7575c, 0x20bbe7d8, 0x36fecd0e, 
-	0x36cb1e2a, 0x21122240, 0x2212e492, 0x362ce855, 0x35f71fb1, 0x2267d3a0, 0x2364a02e, 0x3552a8f4, 
-	0x351acedd, 0x23b836ca, 0x24b0e699, 0x34703095, 0x34364da6, 0x250317df, 0x25f78497, 0x3385a222, 
-	0x3349bf48, 0x264843d9, 0x273847c8, 0x329321c7, 0x32554840, 0x27878893, 0x2872feb6, 0x3198d4ea, 
-	0x31590e3e, 0x28c0b4d2, 0x29a778db, 0x3096e223, 0x30553828, 0x29f3984c, 0x2ad586a3, 0x2f8d713a, 
-	0x2f49ee0f, 0x2b2003ac, 0x2bfcf97c, 0x2e7cab1c, 0x2e37592c, 0x2c45c8a0, 0x2d1da3d5, 0x2d64b9da, 
+	0x3fffec43, 0x003243f1, 0x015fd4d2, 0x3ffc38d1, 0x3ff9c13a, 0x01c454f5, 0x02f1b755, 0x3feea776,
+	0x3fe9b8a9, 0x03562038, 0x0483259d, 0x3fd73a4a, 0x3fcfd50b, 0x04e767c5, 0x0613e1c5, 0x3fb5f4ea,
+	0x3fac1a5b, 0x0677edbb, 0x07a3adff, 0x3f8adc77, 0x3f7e8e1e, 0x08077457, 0x09324ca7, 0x3f55f796,
+	0x3f473759, 0x0995bdfd, 0x0abf8043, 0x3f174e70, 0x3f061e95, 0x0b228d42, 0x0c4b0b94, 0x3eceeaad,
+	0x3ebb4ddb, 0x0cada4f5, 0x0dd4b19a, 0x3e7cd778, 0x3e66d0b4, 0x0e36c82a, 0x0f5c35a3, 0x3e212179,
+	0x3e08b42a, 0x0fbdba40, 0x10e15b4e, 0x3dbbd6d4, 0x3da106bd, 0x11423ef0, 0x1263e699, 0x3d4d0728,
+	0x3d2fd86c, 0x12c41a4f, 0x13e39be9, 0x3cd4c38b, 0x3cb53aaa, 0x144310dd, 0x15604013, 0x3c531e88,
+	0x3c314060, 0x15bee78c, 0x16d99864, 0x3bc82c1f, 0x3ba3fde7, 0x173763c9, 0x184f6aab, 0x3b3401bb,
+	0x3b0d8909, 0x18ac4b87, 0x19c17d44, 0x3a96b636, 0x3a6df8f8, 0x1a1d6544, 0x1b2f971e, 0x39f061d2,
+	0x39c5664f, 0x1b8a7815, 0x1c997fc4, 0x39411e33, 0x3913eb0e, 0x1cf34baf, 0x1dfeff67, 0x38890663,
+	0x3859a292, 0x1e57a86d, 0x1f5fdee6, 0x37c836c2, 0x3796a996, 0x1fb7575c, 0x20bbe7d8, 0x36fecd0e,
+	0x36cb1e2a, 0x21122240, 0x2212e492, 0x362ce855, 0x35f71fb1, 0x2267d3a0, 0x2364a02e, 0x3552a8f4,
+	0x351acedd, 0x23b836ca, 0x24b0e699, 0x34703095, 0x34364da6, 0x250317df, 0x25f78497, 0x3385a222,
+	0x3349bf48, 0x264843d9, 0x273847c8, 0x329321c7, 0x32554840, 0x27878893, 0x2872feb6, 0x3198d4ea,
+	0x31590e3e, 0x28c0b4d2, 0x29a778db, 0x3096e223, 0x30553828, 0x29f3984c, 0x2ad586a3, 0x2f8d713a,
+	0x2f49ee0f, 0x2b2003ac, 0x2bfcf97c, 0x2e7cab1c, 0x2e37592c, 0x2c45c8a0, 0x2d1da3d5, 0x2d64b9da,
 	/* 1024 */
-	0x3fffffb1, 0x0006487f, 0x002bfb74, 0x3ffff0e3, 0x3fffe705, 0x00388c6e, 0x005e3f4c, 0x3fffba9b, 
-	0x3fffa6de, 0x006ad03b, 0x009082ea, 0x3fff5cd8, 0x3fff3f3c, 0x009d13c5, 0x00c2c62f, 0x3ffed79b, 
-	0x3ffeb021, 0x00cf56ef, 0x00f508fc, 0x3ffe2ae5, 0x3ffdf98c, 0x01019998, 0x01274b31, 0x3ffd56b5, 
-	0x3ffd1b7e, 0x0133dba3, 0x01598cb1, 0x3ffc5b0c, 0x3ffc15f7, 0x01661cf0, 0x018bcd5b, 0x3ffb37ec, 
-	0x3ffae8f9, 0x01985d60, 0x01be0d11, 0x3ff9ed53, 0x3ff99483, 0x01ca9cd4, 0x01f04bb4, 0x3ff87b44, 
-	0x3ff81896, 0x01fcdb2e, 0x02228924, 0x3ff6e1bf, 0x3ff67534, 0x022f184d, 0x0254c544, 0x3ff520c5, 
-	0x3ff4aa5d, 0x02615414, 0x0286fff3, 0x3ff33858, 0x3ff2b813, 0x02938e62, 0x02b93914, 0x3ff12878, 
-	0x3ff09e56, 0x02c5c71a, 0x02eb7086, 0x3feef126, 0x3fee5d28, 0x02f7fe1c, 0x031da62b, 0x3fec9265, 
-	0x3febf48b, 0x032a3349, 0x034fd9e5, 0x3fea0c35, 0x3fe96480, 0x035c6682, 0x03820b93, 0x3fe75e98, 
-	0x3fe6ad08, 0x038e97a9, 0x03b43b17, 0x3fe48990, 0x3fe3ce26, 0x03c0c69e, 0x03e66852, 0x3fe18d1f, 
-	0x3fe0c7da, 0x03f2f342, 0x04189326, 0x3fde6945, 0x3fdd9a27, 0x04251d77, 0x044abb73, 0x3fdb1e06, 
-	0x3fda450f, 0x0457451d, 0x047ce11a, 0x3fd7ab64, 0x3fd6c894, 0x04896a16, 0x04af03fc, 0x3fd4115f, 
-	0x3fd324b7, 0x04bb8c42, 0x04e123fa, 0x3fd04ffc, 0x3fcf597c, 0x04edab83, 0x051340f6, 0x3fcc673b, 
-	0x3fcb66e4, 0x051fc7b9, 0x05455ad1, 0x3fc8571f, 0x3fc74cf3, 0x0551e0c7, 0x0577716b, 0x3fc41fac, 
-	0x3fc30baa, 0x0583f68c, 0x05a984a6, 0x3fbfc0e3, 0x3fbea30c, 0x05b608eb, 0x05db9463, 0x3fbb3ac7, 
-	0x3fba131b, 0x05e817c3, 0x060da083, 0x3fb68d5b, 0x3fb55bdc, 0x061a22f7, 0x063fa8e7, 0x3fb1b8a2, 
-	0x3fb07d50, 0x064c2a67, 0x0671ad71, 0x3facbc9f, 0x3fab777b, 0x067e2df5, 0x06a3ae00, 0x3fa79954, 
-	0x3fa64a5f, 0x06b02d81, 0x06d5aa77, 0x3fa24ec6, 0x3fa0f600, 0x06e228ee, 0x0707a2b7, 0x3f9cdcf7, 
-	0x3f9b7a62, 0x0714201b, 0x073996a1, 0x3f9743eb, 0x3f95d787, 0x074612eb, 0x076b8616, 0x3f9183a5, 
-	0x3f900d72, 0x0778013d, 0x079d70f7, 0x3f8b9c28, 0x3f8a1c29, 0x07a9eaf5, 0x07cf5726, 0x3f858d79, 
-	0x3f8403ae, 0x07dbcff2, 0x08013883, 0x3f7f579b, 0x3f7dc405, 0x080db016, 0x083314f1, 0x3f78fa92, 
-	0x3f775d31, 0x083f8b43, 0x0864ec4f, 0x3f727661, 0x3f70cf38, 0x08716159, 0x0896be80, 0x3f6bcb0e, 
-	0x3f6a1a1c, 0x08a3323a, 0x08c88b65, 0x3f64f89b, 0x3f633de2, 0x08d4fdc6, 0x08fa52de, 0x3f5dff0e, 
-	0x3f5c3a8f, 0x0906c3e0, 0x092c14ce, 0x3f56de6a, 0x3f551026, 0x09388469, 0x095dd116, 0x3f4f96b4, 
-	0x3f4dbeac, 0x096a3f42, 0x098f8796, 0x3f4827f0, 0x3f464626, 0x099bf44c, 0x09c13831, 0x3f409223, 
-	0x3f3ea697, 0x09cda368, 0x09f2e2c7, 0x3f38d552, 0x3f36e006, 0x09ff4c78, 0x0a24873a, 0x3f30f181, 
-	0x3f2ef276, 0x0a30ef5e, 0x0a56256c, 0x3f28e6b6, 0x3f26ddec, 0x0a628bfa, 0x0a87bd3d, 0x3f20b4f5, 
-	0x3f1ea26e, 0x0a94222f, 0x0ab94e8f, 0x3f185c43, 0x3f164001, 0x0ac5b1dc, 0x0aead944, 0x3f0fdca5, 
-	0x3f0db6a9, 0x0af73ae5, 0x0b1c5d3d, 0x3f073621, 0x3f05066d, 0x0b28bd2a, 0x0b4dda5c, 0x3efe68bc, 
-	0x3efc2f50, 0x0b5a388d, 0x0b7f5081, 0x3ef5747b, 0x3ef3315a, 0x0b8bacf0, 0x0bb0bf8f, 0x3eec5965, 
-	0x3eea0c8e, 0x0bbd1a33, 0x0be22766, 0x3ee3177e, 0x3ee0c0f4, 0x0bee8038, 0x0c1387e9, 0x3ed9aecc, 
-	0x3ed74e91, 0x0c1fdee1, 0x0c44e0f9, 0x3ed01f55, 0x3ecdb56a, 0x0c513610, 0x0c763278, 0x3ec66920, 
-	0x3ec3f585, 0x0c8285a5, 0x0ca77c47, 0x3ebc8c31, 0x3eba0ee9, 0x0cb3cd84, 0x0cd8be47, 0x3eb2888f, 
-	0x3eb0019c, 0x0ce50d8c, 0x0d09f85b, 0x3ea85e41, 0x3ea5cda3, 0x0d1645a0, 0x0d3b2a64, 0x3e9e0d4c, 
-	0x3e9b7306, 0x0d4775a1, 0x0d6c5443, 0x3e9395b7, 0x3e90f1ca, 0x0d789d71, 0x0d9d75db, 0x3e88f788, 
-	0x3e8649f5, 0x0da9bcf2, 0x0dce8f0d, 0x3e7e32c6, 0x3e7b7b90, 0x0ddad406, 0x0dff9fba, 0x3e734778, 
-	0x3e70869f, 0x0e0be28e, 0x0e30a7c5, 0x3e6835a4, 0x3e656b2b, 0x0e3ce86b, 0x0e61a70f, 0x3e5cfd51, 
-	0x3e5a2939, 0x0e6de580, 0x0e929d7a, 0x3e519e86, 0x3e4ec0d1, 0x0e9ed9af, 0x0ec38ae8, 0x3e46194a, 
-	0x3e4331fa, 0x0ecfc4d9, 0x0ef46f3b, 0x3e3a6da4, 0x3e377cbb, 0x0f00a6df, 0x0f254a53, 0x3e2e9b9c, 
-	0x3e2ba11b, 0x0f317fa5, 0x0f561c15, 0x3e22a338, 0x3e1f9f21, 0x0f624f0c, 0x0f86e460, 0x3e168480, 
-	0x3e1376d5, 0x0f9314f5, 0x0fb7a317, 0x3e0a3f7b, 0x3e07283f, 0x0fc3d143, 0x0fe8581d, 0x3dfdd432, 
-	0x3dfab365, 0x0ff483d7, 0x10190352, 0x3df142ab, 0x3dee1851, 0x10252c94, 0x1049a49a, 0x3de48aef, 
-	0x3de15708, 0x1055cb5b, 0x107a3bd5, 0x3dd7ad05, 0x3dd46f94, 0x1086600e, 0x10aac8e6, 0x3dcaa8f5, 
-	0x3dc761fc, 0x10b6ea90, 0x10db4baf, 0x3dbd7ec7, 0x3dba2e48, 0x10e76ac3, 0x110bc413, 0x3db02e84, 
-	0x3dacd481, 0x1117e088, 0x113c31f3, 0x3da2b834, 0x3d9f54af, 0x11484bc2, 0x116c9531, 0x3d951bde, 
-	0x3d91aed9, 0x1178ac53, 0x119cedaf, 0x3d87598c, 0x3d83e309, 0x11a9021d, 0x11cd3b50, 0x3d797145, 
-	0x3d75f147, 0x11d94d02, 0x11fd7df6, 0x3d6b6313, 0x3d67d99b, 0x12098ce5, 0x122db583, 0x3d5d2efe, 
-	0x3d599c0e, 0x1239c1a7, 0x125de1da, 0x3d4ed50f, 0x3d4b38aa, 0x1269eb2b, 0x128e02dc, 0x3d40554e, 
-	0x3d3caf76, 0x129a0954, 0x12be186c, 0x3d31afc5, 0x3d2e007c, 0x12ca1c03, 0x12ee226c, 0x3d22e47c, 
-	0x3d1f2bc5, 0x12fa231b, 0x131e20c0, 0x3d13f37e, 0x3d10315a, 0x132a1e7e, 0x134e1348, 0x3d04dcd2, 
-	0x3d011145, 0x135a0e0e, 0x137df9e7, 0x3cf5a082, 0x3cf1cb8e, 0x1389f1af, 0x13add481, 0x3ce63e98, 
-	0x3ce2603f, 0x13b9c943, 0x13dda2f7, 0x3cd6b71e, 0x3cd2cf62, 0x13e994ab, 0x140d652c, 0x3cc70a1c, 
-	0x3cc318ff, 0x141953cb, 0x143d1b02, 0x3cb7379c, 0x3cb33d22, 0x14490685, 0x146cc45c, 0x3ca73fa9, 
-	0x3ca33bd3, 0x1478acbc, 0x149c611d, 0x3c97224c, 0x3c93151d, 0x14a84652, 0x14cbf127, 0x3c86df8e, 
-	0x3c82c909, 0x14d7d32a, 0x14fb745e, 0x3c76777b, 0x3c7257a2, 0x15075327, 0x152aeaa3, 0x3c65ea1c, 
-	0x3c61c0f1, 0x1536c62b, 0x155a53d9, 0x3c55377b, 0x3c510501, 0x15662c18, 0x1589afe3, 0x3c445fa2, 
-	0x3c4023dd, 0x159584d3, 0x15b8fea4, 0x3c33629d, 0x3c2f1d8e, 0x15c4d03e, 0x15e83fff, 0x3c224075, 
-	0x3c1df21f, 0x15f40e3a, 0x161773d6, 0x3c10f935, 0x3c0ca19b, 0x16233eac, 0x16469a0d, 0x3bff8ce8, 
-	0x3bfb2c0c, 0x16526176, 0x1675b286, 0x3bedfb99, 0x3be9917e, 0x1681767c, 0x16a4bd25, 0x3bdc4552, 
-	0x3bd7d1fa, 0x16b07d9f, 0x16d3b9cc, 0x3bca6a1d, 0x3bc5ed8d, 0x16df76c3, 0x1702a85e, 0x3bb86a08, 
-	0x3bb3e440, 0x170e61cc, 0x173188be, 0x3ba6451b, 0x3ba1b620, 0x173d3e9b, 0x17605ad0, 0x3b93fb63, 
-	0x3b8f6337, 0x176c0d15, 0x178f1e76, 0x3b818ceb, 0x3b7ceb90, 0x179acd1c, 0x17bdd394, 0x3b6ef9be, 
-	0x3b6a4f38, 0x17c97e93, 0x17ec7a0d, 0x3b5c41e8, 0x3b578e39, 0x17f8215e, 0x181b11c4, 0x3b496574, 
-	0x3b44a8a0, 0x1826b561, 0x18499a9d, 0x3b36646e, 0x3b319e77, 0x18553a7d, 0x1878147a, 0x3b233ee1, 
-	0x3b1e6fca, 0x1883b097, 0x18a67f3f, 0x3b0ff4d9, 0x3b0b1ca6, 0x18b21791, 0x18d4dad0, 0x3afc8663, 
-	0x3af7a516, 0x18e06f50, 0x1903270f, 0x3ae8f38b, 0x3ae40926, 0x190eb7b7, 0x193163e1, 0x3ad53c5b, 
-	0x3ad048e3, 0x193cf0a9, 0x195f9128, 0x3ac160e1, 0x3abc6458, 0x196b1a09, 0x198daec8, 0x3aad6129, 
-	0x3aa85b92, 0x199933bb, 0x19bbbca6, 0x3a993d3e, 0x3a942e9d, 0x19c73da3, 0x19e9baa3, 0x3a84f52f, 
-	0x3a7fdd86, 0x19f537a4, 0x1a17a8a5, 0x3a708906, 0x3a6b6859, 0x1a2321a2, 0x1a45868e, 0x3a5bf8d1, 
-	0x3a56cf23, 0x1a50fb81, 0x1a735442, 0x3a47449c, 0x3a4211f0, 0x1a7ec524, 0x1aa111a6, 0x3a326c74, 
-	0x3a2d30cd, 0x1aac7e6f, 0x1acebe9d, 0x3a1d7066, 0x3a182bc8, 0x1ada2746, 0x1afc5b0a, 0x3a08507f, 
-	0x3a0302ed, 0x1b07bf8c, 0x1b29e6d2, 0x39f30ccc, 0x39edb649, 0x1b354727, 0x1b5761d8, 0x39dda55a, 
-	0x39d845e9, 0x1b62bdf8, 0x1b84cc01, 0x39c81a36, 0x39c2b1da, 0x1b9023e5, 0x1bb22530, 0x39b26b6d, 
-	0x39acfa2b, 0x1bbd78d2, 0x1bdf6d4a, 0x399c990d, 0x39971ee7, 0x1beabca1, 0x1c0ca432, 0x3986a324, 
-	0x3981201e, 0x1c17ef39, 0x1c39c9cd, 0x397089bf, 0x396afddc, 0x1c45107c, 0x1c66ddfe, 0x395a4ceb, 
-	0x3954b82e, 0x1c72204f, 0x1c93e0ab, 0x3943ecb6, 0x393e4f23, 0x1c9f1e96, 0x1cc0d1b6, 0x392d692f, 
-	0x3927c2c9, 0x1ccc0b35, 0x1cedb106, 0x3916c262, 0x3911132d, 0x1cf8e611, 0x1d1a7e7d, 0x38fff85e, 
-	0x38fa405e, 0x1d25af0d, 0x1d473a00, 0x38e90b31, 0x38e34a69, 0x1d52660f, 0x1d73e374, 0x38d1fae9, 
-	0x38cc315d, 0x1d7f0afb, 0x1da07abc, 0x38bac795, 0x38b4f547, 0x1dab9db5, 0x1dccffbf, 0x38a37142, 
-	0x389d9637, 0x1dd81e21, 0x1df9725f, 0x388bf7ff, 0x3886143b, 0x1e048c24, 0x1e25d282, 0x38745bdb, 
-	0x386e6f60, 0x1e30e7a4, 0x1e52200c, 0x385c9ce3, 0x3856a7b6, 0x1e5d3084, 0x1e7e5ae2, 0x3844bb28, 
-	0x383ebd4c, 0x1e8966a8, 0x1eaa82e9, 0x382cb6b7, 0x3826b030, 0x1eb589f7, 0x1ed69805, 0x38148f9f, 
-	0x380e8071, 0x1ee19a54, 0x1f029a1c, 0x37fc45ef, 0x37f62e1d, 0x1f0d97a5, 0x1f2e8911, 0x37e3d9b7, 
-	0x37ddb945, 0x1f3981ce, 0x1f5a64cb, 0x37cb4b04, 0x37c521f6, 0x1f6558b5, 0x1f862d2d, 0x37b299e7, 
-	0x37ac6841, 0x1f911c3d, 0x1fb1e21d, 0x3799c66f, 0x37938c34, 0x1fbccc4d, 0x1fdd8381, 0x3780d0aa, 
-	0x377a8ddf, 0x1fe868c8, 0x2009113c, 0x3767b8a9, 0x37616d51, 0x2013f196, 0x20348b35, 0x374e7e7b, 
-	0x37482a9a, 0x203f6699, 0x205ff14f, 0x3735222f, 0x372ec5c9, 0x206ac7b8, 0x208b4372, 0x371ba3d4, 
-	0x37153eee, 0x209614d9, 0x20b68181, 0x3702037c, 0x36fb9618, 0x20c14ddf, 0x20e1ab63, 0x36e84135, 
-	0x36e1cb58, 0x20ec72b1, 0x210cc0fc, 0x36ce5d10, 0x36c7debd, 0x21178334, 0x2137c232, 0x36b4571b, 
-	0x36add058, 0x21427f4d, 0x2162aeea, 0x369a2f69, 0x3693a038, 0x216d66e2, 0x218d870b, 0x367fe608, 
-	0x36794e6e, 0x219839d8, 0x21b84a79, 0x36657b08, 0x365edb09, 0x21c2f815, 0x21e2f91a, 0x364aee7b, 
-	0x3644461b, 0x21eda17f, 0x220d92d4, 0x36304070, 0x36298fb4, 0x221835fb, 0x2238178d, 0x361570f8, 
-	0x360eb7e3, 0x2242b56f, 0x22628729, 0x35fa8023, 0x35f3beba, 0x226d1fc1, 0x228ce191, 0x35df6e03, 
-	0x35d8a449, 0x229774d7, 0x22b726a8, 0x35c43aa7, 0x35bd68a1, 0x22c1b496, 0x22e15655, 0x35a8e621, 
-	0x35a20bd3, 0x22ebdee5, 0x230b707e, 0x358d7081, 0x35868def, 0x2315f3a8, 0x23357509, 0x3571d9d9, 
-	0x356aef08, 0x233ff2c8, 0x235f63dc, 0x35562239, 0x354f2f2c, 0x2369dc29, 0x23893cdd, 0x353a49b2, 
-	0x35334e6f, 0x2393afb2, 0x23b2fff3, 0x351e5056, 0x35174ce0, 0x23bd6d48, 0x23dcad03, 0x35023636, 
-	0x34fb2a92, 0x23e714d3, 0x240643f4, 0x34e5fb63, 0x34dee795, 0x2410a639, 0x242fc4ad, 0x34c99fef, 
-	0x34c283fb, 0x243a215f, 0x24592f13, 0x34ad23eb, 0x34a5ffd5, 0x2463862c, 0x2482830d, 0x34908768, 
-	0x34895b36, 0x248cd487, 0x24abc082, 0x3473ca79, 0x346c962f, 0x24b60c57, 0x24d4e757, 0x3456ed2f, 
-	0x344fb0d1, 0x24df2d81, 0x24fdf775, 0x3439ef9c, 0x3432ab2e, 0x250837ed, 0x2526f0c1, 0x341cd1d2, 
-	0x34158559, 0x25312b81, 0x254fd323, 0x33ff93e2, 0x33f83f62, 0x255a0823, 0x25789e80, 0x33e235df, 
-	0x33dad95e, 0x2582cdbc, 0x25a152c0, 0x33c4b7db, 0x33bd535c, 0x25ab7c30, 0x25c9efca, 0x33a719e8, 
-	0x339fad70, 0x25d41369, 0x25f27584, 0x33895c18, 0x3381e7ac, 0x25fc934b, 0x261ae3d6, 0x336b7e7e, 
-	0x33640223, 0x2624fbbf, 0x26433aa7, 0x334d812d, 0x3345fce6, 0x264d4cac, 0x266b79dd, 0x332f6435, 
-	0x3327d808, 0x267585f8, 0x2693a161, 0x331127ab, 0x3309939c, 0x269da78b, 0x26bbb119, 0x32f2cba1, 
-	0x32eb2fb5, 0x26c5b14c, 0x26e3a8ec, 0x32d45029, 0x32ccac64, 0x26eda322, 0x270b88c2, 0x32b5b557, 
-	0x32ae09be, 0x27157cf5, 0x27335082, 0x3296fb3d, 0x328f47d5, 0x273d3eac, 0x275b0014, 0x327821ee, 
-	0x327066bc, 0x2764e82f, 0x27829760, 0x3259297d, 0x32516686, 0x278c7965, 0x27aa164c, 0x323a11fe, 
-	0x32324746, 0x27b3f235, 0x27d17cc1, 0x321adb83, 0x3213090f, 0x27db5288, 0x27f8caa5, 0x31fb8620, 
-	0x31f3abf5, 0x28029a45, 0x281fffe2, 0x31dc11e8, 0x31d4300b, 0x2829c954, 0x28471c5e, 0x31bc7eee, 
-	0x31b49564, 0x2850df9d, 0x286e2002, 0x319ccd46, 0x3194dc14, 0x2877dd07, 0x28950ab6, 0x317cfd04, 
-	0x3175042e, 0x289ec17a, 0x28bbdc61, 0x315d0e3b, 0x31550dc6, 0x28c58cdf, 0x28e294eb, 0x313d00ff, 
-	0x3134f8f1, 0x28ec3f1e, 0x2909343e, 0x311cd564, 0x3114c5c0, 0x2912d81f, 0x292fba40, 0x30fc8b7d, 
-	0x30f47449, 0x293957c9, 0x295626da, 0x30dc235e, 0x30d404a0, 0x295fbe06, 0x297c79f5, 0x30bb9d1c, 
-	0x30b376d8, 0x29860abd, 0x29a2b378, 0x309af8ca, 0x3092cb05, 0x29ac3dd7, 0x29c8d34d, 0x307a367c, 
-	0x3072013c, 0x29d2573c, 0x29eed95b, 0x30595648, 0x30511991, 0x29f856d5, 0x2a14c58b, 0x30385840, 
-	0x30301418, 0x2a1e3c8a, 0x2a3a97c7, 0x30173c7a, 0x300ef0e5, 0x2a440844, 0x2a604ff5, 0x2ff6030a, 
-	0x2fedb00d, 0x2a69b9ec, 0x2a85ee00, 0x2fd4ac04, 0x2fcc51a5, 0x2a8f516b, 0x2aab71d0, 0x2fb3377c, 
-	0x2faad5c1, 0x2ab4cea9, 0x2ad0db4e, 0x2f91a589, 0x2f893c75, 0x2ada318e, 0x2af62a63, 0x2f6ff63d, 
-	0x2f6785d7, 0x2aff7a05, 0x2b1b5ef8, 0x2f4e29af, 0x2f45b1fb, 0x2b24a7f6, 0x2b4078f5, 0x2f2c3ff2, 
-	0x2f23c0f6, 0x2b49bb4a, 0x2b657844, 0x2f0a391d, 0x2f01b2de, 0x2b6eb3ea, 0x2b8a5cce, 0x2ee81543, 
-	0x2edf87c6, 0x2b9391c0, 0x2baf267d, 0x2ec5d479, 0x2ebd3fc4, 0x2bb854b4, 0x2bd3d53a, 0x2ea376d6, 
-	0x2e9adaee, 0x2bdcfcb0, 0x2bf868ed, 0x2e80fc6e, 0x2e785958, 0x2c01899e, 0x2c1ce181, 0x2e5e6556, 
-	0x2e55bb17, 0x2c25fb66, 0x2c413edf, 0x2e3bb1a4, 0x2e330042, 0x2c4a51f3, 0x2c6580f1, 0x2e18e16d, 
-	0x2e1028ed, 0x2c6e8d2e, 0x2c89a79f, 0x2df5f4c7, 0x2ded352f, 0x2c92ad01, 0x2cadb2d5, 0x2dd2ebc7, 
-	0x2dca251c, 0x2cb6b155, 0x2cd1a27b, 0x2dafc683, 0x2da6f8ca, 0x2cda9a14, 0x2cf5767c, 0x2d8c8510, 
+	0x3fffffb1, 0x0006487f, 0x002bfb74, 0x3ffff0e3, 0x3fffe705, 0x00388c6e, 0x005e3f4c, 0x3fffba9b,
+	0x3fffa6de, 0x006ad03b, 0x009082ea, 0x3fff5cd8, 0x3fff3f3c, 0x009d13c5, 0x00c2c62f, 0x3ffed79b,
+	0x3ffeb021, 0x00cf56ef, 0x00f508fc, 0x3ffe2ae5, 0x3ffdf98c, 0x01019998, 0x01274b31, 0x3ffd56b5,
+	0x3ffd1b7e, 0x0133dba3, 0x01598cb1, 0x3ffc5b0c, 0x3ffc15f7, 0x01661cf0, 0x018bcd5b, 0x3ffb37ec,
+	0x3ffae8f9, 0x01985d60, 0x01be0d11, 0x3ff9ed53, 0x3ff99483, 0x01ca9cd4, 0x01f04bb4, 0x3ff87b44,
+	0x3ff81896, 0x01fcdb2e, 0x02228924, 0x3ff6e1bf, 0x3ff67534, 0x022f184d, 0x0254c544, 0x3ff520c5,
+	0x3ff4aa5d, 0x02615414, 0x0286fff3, 0x3ff33858, 0x3ff2b813, 0x02938e62, 0x02b93914, 0x3ff12878,
+	0x3ff09e56, 0x02c5c71a, 0x02eb7086, 0x3feef126, 0x3fee5d28, 0x02f7fe1c, 0x031da62b, 0x3fec9265,
+	0x3febf48b, 0x032a3349, 0x034fd9e5, 0x3fea0c35, 0x3fe96480, 0x035c6682, 0x03820b93, 0x3fe75e98,
+	0x3fe6ad08, 0x038e97a9, 0x03b43b17, 0x3fe48990, 0x3fe3ce26, 0x03c0c69e, 0x03e66852, 0x3fe18d1f,
+	0x3fe0c7da, 0x03f2f342, 0x04189326, 0x3fde6945, 0x3fdd9a27, 0x04251d77, 0x044abb73, 0x3fdb1e06,
+	0x3fda450f, 0x0457451d, 0x047ce11a, 0x3fd7ab64, 0x3fd6c894, 0x04896a16, 0x04af03fc, 0x3fd4115f,
+	0x3fd324b7, 0x04bb8c42, 0x04e123fa, 0x3fd04ffc, 0x3fcf597c, 0x04edab83, 0x051340f6, 0x3fcc673b,
+	0x3fcb66e4, 0x051fc7b9, 0x05455ad1, 0x3fc8571f, 0x3fc74cf3, 0x0551e0c7, 0x0577716b, 0x3fc41fac,
+	0x3fc30baa, 0x0583f68c, 0x05a984a6, 0x3fbfc0e3, 0x3fbea30c, 0x05b608eb, 0x05db9463, 0x3fbb3ac7,
+	0x3fba131b, 0x05e817c3, 0x060da083, 0x3fb68d5b, 0x3fb55bdc, 0x061a22f7, 0x063fa8e7, 0x3fb1b8a2,
+	0x3fb07d50, 0x064c2a67, 0x0671ad71, 0x3facbc9f, 0x3fab777b, 0x067e2df5, 0x06a3ae00, 0x3fa79954,
+	0x3fa64a5f, 0x06b02d81, 0x06d5aa77, 0x3fa24ec6, 0x3fa0f600, 0x06e228ee, 0x0707a2b7, 0x3f9cdcf7,
+	0x3f9b7a62, 0x0714201b, 0x073996a1, 0x3f9743eb, 0x3f95d787, 0x074612eb, 0x076b8616, 0x3f9183a5,
+	0x3f900d72, 0x0778013d, 0x079d70f7, 0x3f8b9c28, 0x3f8a1c29, 0x07a9eaf5, 0x07cf5726, 0x3f858d79,
+	0x3f8403ae, 0x07dbcff2, 0x08013883, 0x3f7f579b, 0x3f7dc405, 0x080db016, 0x083314f1, 0x3f78fa92,
+	0x3f775d31, 0x083f8b43, 0x0864ec4f, 0x3f727661, 0x3f70cf38, 0x08716159, 0x0896be80, 0x3f6bcb0e,
+	0x3f6a1a1c, 0x08a3323a, 0x08c88b65, 0x3f64f89b, 0x3f633de2, 0x08d4fdc6, 0x08fa52de, 0x3f5dff0e,
+	0x3f5c3a8f, 0x0906c3e0, 0x092c14ce, 0x3f56de6a, 0x3f551026, 0x09388469, 0x095dd116, 0x3f4f96b4,
+	0x3f4dbeac, 0x096a3f42, 0x098f8796, 0x3f4827f0, 0x3f464626, 0x099bf44c, 0x09c13831, 0x3f409223,
+	0x3f3ea697, 0x09cda368, 0x09f2e2c7, 0x3f38d552, 0x3f36e006, 0x09ff4c78, 0x0a24873a, 0x3f30f181,
+	0x3f2ef276, 0x0a30ef5e, 0x0a56256c, 0x3f28e6b6, 0x3f26ddec, 0x0a628bfa, 0x0a87bd3d, 0x3f20b4f5,
+	0x3f1ea26e, 0x0a94222f, 0x0ab94e8f, 0x3f185c43, 0x3f164001, 0x0ac5b1dc, 0x0aead944, 0x3f0fdca5,
+	0x3f0db6a9, 0x0af73ae5, 0x0b1c5d3d, 0x3f073621, 0x3f05066d, 0x0b28bd2a, 0x0b4dda5c, 0x3efe68bc,
+	0x3efc2f50, 0x0b5a388d, 0x0b7f5081, 0x3ef5747b, 0x3ef3315a, 0x0b8bacf0, 0x0bb0bf8f, 0x3eec5965,
+	0x3eea0c8e, 0x0bbd1a33, 0x0be22766, 0x3ee3177e, 0x3ee0c0f4, 0x0bee8038, 0x0c1387e9, 0x3ed9aecc,
+	0x3ed74e91, 0x0c1fdee1, 0x0c44e0f9, 0x3ed01f55, 0x3ecdb56a, 0x0c513610, 0x0c763278, 0x3ec66920,
+	0x3ec3f585, 0x0c8285a5, 0x0ca77c47, 0x3ebc8c31, 0x3eba0ee9, 0x0cb3cd84, 0x0cd8be47, 0x3eb2888f,
+	0x3eb0019c, 0x0ce50d8c, 0x0d09f85b, 0x3ea85e41, 0x3ea5cda3, 0x0d1645a0, 0x0d3b2a64, 0x3e9e0d4c,
+	0x3e9b7306, 0x0d4775a1, 0x0d6c5443, 0x3e9395b7, 0x3e90f1ca, 0x0d789d71, 0x0d9d75db, 0x3e88f788,
+	0x3e8649f5, 0x0da9bcf2, 0x0dce8f0d, 0x3e7e32c6, 0x3e7b7b90, 0x0ddad406, 0x0dff9fba, 0x3e734778,
+	0x3e70869f, 0x0e0be28e, 0x0e30a7c5, 0x3e6835a4, 0x3e656b2b, 0x0e3ce86b, 0x0e61a70f, 0x3e5cfd51,
+	0x3e5a2939, 0x0e6de580, 0x0e929d7a, 0x3e519e86, 0x3e4ec0d1, 0x0e9ed9af, 0x0ec38ae8, 0x3e46194a,
+	0x3e4331fa, 0x0ecfc4d9, 0x0ef46f3b, 0x3e3a6da4, 0x3e377cbb, 0x0f00a6df, 0x0f254a53, 0x3e2e9b9c,
+	0x3e2ba11b, 0x0f317fa5, 0x0f561c15, 0x3e22a338, 0x3e1f9f21, 0x0f624f0c, 0x0f86e460, 0x3e168480,
+	0x3e1376d5, 0x0f9314f5, 0x0fb7a317, 0x3e0a3f7b, 0x3e07283f, 0x0fc3d143, 0x0fe8581d, 0x3dfdd432,
+	0x3dfab365, 0x0ff483d7, 0x10190352, 0x3df142ab, 0x3dee1851, 0x10252c94, 0x1049a49a, 0x3de48aef,
+	0x3de15708, 0x1055cb5b, 0x107a3bd5, 0x3dd7ad05, 0x3dd46f94, 0x1086600e, 0x10aac8e6, 0x3dcaa8f5,
+	0x3dc761fc, 0x10b6ea90, 0x10db4baf, 0x3dbd7ec7, 0x3dba2e48, 0x10e76ac3, 0x110bc413, 0x3db02e84,
+	0x3dacd481, 0x1117e088, 0x113c31f3, 0x3da2b834, 0x3d9f54af, 0x11484bc2, 0x116c9531, 0x3d951bde,
+	0x3d91aed9, 0x1178ac53, 0x119cedaf, 0x3d87598c, 0x3d83e309, 0x11a9021d, 0x11cd3b50, 0x3d797145,
+	0x3d75f147, 0x11d94d02, 0x11fd7df6, 0x3d6b6313, 0x3d67d99b, 0x12098ce5, 0x122db583, 0x3d5d2efe,
+	0x3d599c0e, 0x1239c1a7, 0x125de1da, 0x3d4ed50f, 0x3d4b38aa, 0x1269eb2b, 0x128e02dc, 0x3d40554e,
+	0x3d3caf76, 0x129a0954, 0x12be186c, 0x3d31afc5, 0x3d2e007c, 0x12ca1c03, 0x12ee226c, 0x3d22e47c,
+	0x3d1f2bc5, 0x12fa231b, 0x131e20c0, 0x3d13f37e, 0x3d10315a, 0x132a1e7e, 0x134e1348, 0x3d04dcd2,
+	0x3d011145, 0x135a0e0e, 0x137df9e7, 0x3cf5a082, 0x3cf1cb8e, 0x1389f1af, 0x13add481, 0x3ce63e98,
+	0x3ce2603f, 0x13b9c943, 0x13dda2f7, 0x3cd6b71e, 0x3cd2cf62, 0x13e994ab, 0x140d652c, 0x3cc70a1c,
+	0x3cc318ff, 0x141953cb, 0x143d1b02, 0x3cb7379c, 0x3cb33d22, 0x14490685, 0x146cc45c, 0x3ca73fa9,
+	0x3ca33bd3, 0x1478acbc, 0x149c611d, 0x3c97224c, 0x3c93151d, 0x14a84652, 0x14cbf127, 0x3c86df8e,
+	0x3c82c909, 0x14d7d32a, 0x14fb745e, 0x3c76777b, 0x3c7257a2, 0x15075327, 0x152aeaa3, 0x3c65ea1c,
+	0x3c61c0f1, 0x1536c62b, 0x155a53d9, 0x3c55377b, 0x3c510501, 0x15662c18, 0x1589afe3, 0x3c445fa2,
+	0x3c4023dd, 0x159584d3, 0x15b8fea4, 0x3c33629d, 0x3c2f1d8e, 0x15c4d03e, 0x15e83fff, 0x3c224075,
+	0x3c1df21f, 0x15f40e3a, 0x161773d6, 0x3c10f935, 0x3c0ca19b, 0x16233eac, 0x16469a0d, 0x3bff8ce8,
+	0x3bfb2c0c, 0x16526176, 0x1675b286, 0x3bedfb99, 0x3be9917e, 0x1681767c, 0x16a4bd25, 0x3bdc4552,
+	0x3bd7d1fa, 0x16b07d9f, 0x16d3b9cc, 0x3bca6a1d, 0x3bc5ed8d, 0x16df76c3, 0x1702a85e, 0x3bb86a08,
+	0x3bb3e440, 0x170e61cc, 0x173188be, 0x3ba6451b, 0x3ba1b620, 0x173d3e9b, 0x17605ad0, 0x3b93fb63,
+	0x3b8f6337, 0x176c0d15, 0x178f1e76, 0x3b818ceb, 0x3b7ceb90, 0x179acd1c, 0x17bdd394, 0x3b6ef9be,
+	0x3b6a4f38, 0x17c97e93, 0x17ec7a0d, 0x3b5c41e8, 0x3b578e39, 0x17f8215e, 0x181b11c4, 0x3b496574,
+	0x3b44a8a0, 0x1826b561, 0x18499a9d, 0x3b36646e, 0x3b319e77, 0x18553a7d, 0x1878147a, 0x3b233ee1,
+	0x3b1e6fca, 0x1883b097, 0x18a67f3f, 0x3b0ff4d9, 0x3b0b1ca6, 0x18b21791, 0x18d4dad0, 0x3afc8663,
+	0x3af7a516, 0x18e06f50, 0x1903270f, 0x3ae8f38b, 0x3ae40926, 0x190eb7b7, 0x193163e1, 0x3ad53c5b,
+	0x3ad048e3, 0x193cf0a9, 0x195f9128, 0x3ac160e1, 0x3abc6458, 0x196b1a09, 0x198daec8, 0x3aad6129,
+	0x3aa85b92, 0x199933bb, 0x19bbbca6, 0x3a993d3e, 0x3a942e9d, 0x19c73da3, 0x19e9baa3, 0x3a84f52f,
+	0x3a7fdd86, 0x19f537a4, 0x1a17a8a5, 0x3a708906, 0x3a6b6859, 0x1a2321a2, 0x1a45868e, 0x3a5bf8d1,
+	0x3a56cf23, 0x1a50fb81, 0x1a735442, 0x3a47449c, 0x3a4211f0, 0x1a7ec524, 0x1aa111a6, 0x3a326c74,
+	0x3a2d30cd, 0x1aac7e6f, 0x1acebe9d, 0x3a1d7066, 0x3a182bc8, 0x1ada2746, 0x1afc5b0a, 0x3a08507f,
+	0x3a0302ed, 0x1b07bf8c, 0x1b29e6d2, 0x39f30ccc, 0x39edb649, 0x1b354727, 0x1b5761d8, 0x39dda55a,
+	0x39d845e9, 0x1b62bdf8, 0x1b84cc01, 0x39c81a36, 0x39c2b1da, 0x1b9023e5, 0x1bb22530, 0x39b26b6d,
+	0x39acfa2b, 0x1bbd78d2, 0x1bdf6d4a, 0x399c990d, 0x39971ee7, 0x1beabca1, 0x1c0ca432, 0x3986a324,
+	0x3981201e, 0x1c17ef39, 0x1c39c9cd, 0x397089bf, 0x396afddc, 0x1c45107c, 0x1c66ddfe, 0x395a4ceb,
+	0x3954b82e, 0x1c72204f, 0x1c93e0ab, 0x3943ecb6, 0x393e4f23, 0x1c9f1e96, 0x1cc0d1b6, 0x392d692f,
+	0x3927c2c9, 0x1ccc0b35, 0x1cedb106, 0x3916c262, 0x3911132d, 0x1cf8e611, 0x1d1a7e7d, 0x38fff85e,
+	0x38fa405e, 0x1d25af0d, 0x1d473a00, 0x38e90b31, 0x38e34a69, 0x1d52660f, 0x1d73e374, 0x38d1fae9,
+	0x38cc315d, 0x1d7f0afb, 0x1da07abc, 0x38bac795, 0x38b4f547, 0x1dab9db5, 0x1dccffbf, 0x38a37142,
+	0x389d9637, 0x1dd81e21, 0x1df9725f, 0x388bf7ff, 0x3886143b, 0x1e048c24, 0x1e25d282, 0x38745bdb,
+	0x386e6f60, 0x1e30e7a4, 0x1e52200c, 0x385c9ce3, 0x3856a7b6, 0x1e5d3084, 0x1e7e5ae2, 0x3844bb28,
+	0x383ebd4c, 0x1e8966a8, 0x1eaa82e9, 0x382cb6b7, 0x3826b030, 0x1eb589f7, 0x1ed69805, 0x38148f9f,
+	0x380e8071, 0x1ee19a54, 0x1f029a1c, 0x37fc45ef, 0x37f62e1d, 0x1f0d97a5, 0x1f2e8911, 0x37e3d9b7,
+	0x37ddb945, 0x1f3981ce, 0x1f5a64cb, 0x37cb4b04, 0x37c521f6, 0x1f6558b5, 0x1f862d2d, 0x37b299e7,
+	0x37ac6841, 0x1f911c3d, 0x1fb1e21d, 0x3799c66f, 0x37938c34, 0x1fbccc4d, 0x1fdd8381, 0x3780d0aa,
+	0x377a8ddf, 0x1fe868c8, 0x2009113c, 0x3767b8a9, 0x37616d51, 0x2013f196, 0x20348b35, 0x374e7e7b,
+	0x37482a9a, 0x203f6699, 0x205ff14f, 0x3735222f, 0x372ec5c9, 0x206ac7b8, 0x208b4372, 0x371ba3d4,
+	0x37153eee, 0x209614d9, 0x20b68181, 0x3702037c, 0x36fb9618, 0x20c14ddf, 0x20e1ab63, 0x36e84135,
+	0x36e1cb58, 0x20ec72b1, 0x210cc0fc, 0x36ce5d10, 0x36c7debd, 0x21178334, 0x2137c232, 0x36b4571b,
+	0x36add058, 0x21427f4d, 0x2162aeea, 0x369a2f69, 0x3693a038, 0x216d66e2, 0x218d870b, 0x367fe608,
+	0x36794e6e, 0x219839d8, 0x21b84a79, 0x36657b08, 0x365edb09, 0x21c2f815, 0x21e2f91a, 0x364aee7b,
+	0x3644461b, 0x21eda17f, 0x220d92d4, 0x36304070, 0x36298fb4, 0x221835fb, 0x2238178d, 0x361570f8,
+	0x360eb7e3, 0x2242b56f, 0x22628729, 0x35fa8023, 0x35f3beba, 0x226d1fc1, 0x228ce191, 0x35df6e03,
+	0x35d8a449, 0x229774d7, 0x22b726a8, 0x35c43aa7, 0x35bd68a1, 0x22c1b496, 0x22e15655, 0x35a8e621,
+	0x35a20bd3, 0x22ebdee5, 0x230b707e, 0x358d7081, 0x35868def, 0x2315f3a8, 0x23357509, 0x3571d9d9,
+	0x356aef08, 0x233ff2c8, 0x235f63dc, 0x35562239, 0x354f2f2c, 0x2369dc29, 0x23893cdd, 0x353a49b2,
+	0x35334e6f, 0x2393afb2, 0x23b2fff3, 0x351e5056, 0x35174ce0, 0x23bd6d48, 0x23dcad03, 0x35023636,
+	0x34fb2a92, 0x23e714d3, 0x240643f4, 0x34e5fb63, 0x34dee795, 0x2410a639, 0x242fc4ad, 0x34c99fef,
+	0x34c283fb, 0x243a215f, 0x24592f13, 0x34ad23eb, 0x34a5ffd5, 0x2463862c, 0x2482830d, 0x34908768,
+	0x34895b36, 0x248cd487, 0x24abc082, 0x3473ca79, 0x346c962f, 0x24b60c57, 0x24d4e757, 0x3456ed2f,
+	0x344fb0d1, 0x24df2d81, 0x24fdf775, 0x3439ef9c, 0x3432ab2e, 0x250837ed, 0x2526f0c1, 0x341cd1d2,
+	0x34158559, 0x25312b81, 0x254fd323, 0x33ff93e2, 0x33f83f62, 0x255a0823, 0x25789e80, 0x33e235df,
+	0x33dad95e, 0x2582cdbc, 0x25a152c0, 0x33c4b7db, 0x33bd535c, 0x25ab7c30, 0x25c9efca, 0x33a719e8,
+	0x339fad70, 0x25d41369, 0x25f27584, 0x33895c18, 0x3381e7ac, 0x25fc934b, 0x261ae3d6, 0x336b7e7e,
+	0x33640223, 0x2624fbbf, 0x26433aa7, 0x334d812d, 0x3345fce6, 0x264d4cac, 0x266b79dd, 0x332f6435,
+	0x3327d808, 0x267585f8, 0x2693a161, 0x331127ab, 0x3309939c, 0x269da78b, 0x26bbb119, 0x32f2cba1,
+	0x32eb2fb5, 0x26c5b14c, 0x26e3a8ec, 0x32d45029, 0x32ccac64, 0x26eda322, 0x270b88c2, 0x32b5b557,
+	0x32ae09be, 0x27157cf5, 0x27335082, 0x3296fb3d, 0x328f47d5, 0x273d3eac, 0x275b0014, 0x327821ee,
+	0x327066bc, 0x2764e82f, 0x27829760, 0x3259297d, 0x32516686, 0x278c7965, 0x27aa164c, 0x323a11fe,
+	0x32324746, 0x27b3f235, 0x27d17cc1, 0x321adb83, 0x3213090f, 0x27db5288, 0x27f8caa5, 0x31fb8620,
+	0x31f3abf5, 0x28029a45, 0x281fffe2, 0x31dc11e8, 0x31d4300b, 0x2829c954, 0x28471c5e, 0x31bc7eee,
+	0x31b49564, 0x2850df9d, 0x286e2002, 0x319ccd46, 0x3194dc14, 0x2877dd07, 0x28950ab6, 0x317cfd04,
+	0x3175042e, 0x289ec17a, 0x28bbdc61, 0x315d0e3b, 0x31550dc6, 0x28c58cdf, 0x28e294eb, 0x313d00ff,
+	0x3134f8f1, 0x28ec3f1e, 0x2909343e, 0x311cd564, 0x3114c5c0, 0x2912d81f, 0x292fba40, 0x30fc8b7d,
+	0x30f47449, 0x293957c9, 0x295626da, 0x30dc235e, 0x30d404a0, 0x295fbe06, 0x297c79f5, 0x30bb9d1c,
+	0x30b376d8, 0x29860abd, 0x29a2b378, 0x309af8ca, 0x3092cb05, 0x29ac3dd7, 0x29c8d34d, 0x307a367c,
+	0x3072013c, 0x29d2573c, 0x29eed95b, 0x30595648, 0x30511991, 0x29f856d5, 0x2a14c58b, 0x30385840,
+	0x30301418, 0x2a1e3c8a, 0x2a3a97c7, 0x30173c7a, 0x300ef0e5, 0x2a440844, 0x2a604ff5, 0x2ff6030a,
+	0x2fedb00d, 0x2a69b9ec, 0x2a85ee00, 0x2fd4ac04, 0x2fcc51a5, 0x2a8f516b, 0x2aab71d0, 0x2fb3377c,
+	0x2faad5c1, 0x2ab4cea9, 0x2ad0db4e, 0x2f91a589, 0x2f893c75, 0x2ada318e, 0x2af62a63, 0x2f6ff63d,
+	0x2f6785d7, 0x2aff7a05, 0x2b1b5ef8, 0x2f4e29af, 0x2f45b1fb, 0x2b24a7f6, 0x2b4078f5, 0x2f2c3ff2,
+	0x2f23c0f6, 0x2b49bb4a, 0x2b657844, 0x2f0a391d, 0x2f01b2de, 0x2b6eb3ea, 0x2b8a5cce, 0x2ee81543,
+	0x2edf87c6, 0x2b9391c0, 0x2baf267d, 0x2ec5d479, 0x2ebd3fc4, 0x2bb854b4, 0x2bd3d53a, 0x2ea376d6,
+	0x2e9adaee, 0x2bdcfcb0, 0x2bf868ed, 0x2e80fc6e, 0x2e785958, 0x2c01899e, 0x2c1ce181, 0x2e5e6556,
+	0x2e55bb17, 0x2c25fb66, 0x2c413edf, 0x2e3bb1a4, 0x2e330042, 0x2c4a51f3, 0x2c6580f1, 0x2e18e16d,
+	0x2e1028ed, 0x2c6e8d2e, 0x2c89a79f, 0x2df5f4c7, 0x2ded352f, 0x2c92ad01, 0x2cadb2d5, 0x2dd2ebc7,
+	0x2dca251c, 0x2cb6b155, 0x2cd1a27b, 0x2dafc683, 0x2da6f8ca, 0x2cda9a14, 0x2cf5767c, 0x2d8c8510,
 	0x2d83b04f, 0x2cfe6728, 0x2d192ec1, 0x2d692784, 0x2d604bc0, 0x2d22187a, 0x2d3ccb34, 0x2d45adf6
 };
 
 const int twidTab512[8*6 + 32*6 + 128*6] = {
-	0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x3b20d79e, 0x187de2a6, 
-	0x3ec52f9f, 0x0c7c5c1e, 0x3536cc52, 0x238e7673, 0x2d413ccc, 0x2d413ccc, 0x3b20d79e, 0x187de2a6, 
-	0x187de2a6, 0x3b20d79e, 0x187de2a6, 0x3b20d79e, 0x3536cc52, 0x238e7673, 0xf383a3e2, 0x3ec52f9f, 
-	0x00000000, 0x40000000, 0x2d413ccc, 0x2d413ccc, 0xd2bec334, 0x2d413ccc, 0xe7821d5a, 0x3b20d79e, 
-	0x238e7673, 0x3536cc52, 0xc13ad061, 0x0c7c5c1e, 0xd2bec334, 0x2d413ccc, 0x187de2a6, 0x3b20d79e, 
-	0xc4df2862, 0xe7821d5a, 0xc4df2862, 0x187de2a6, 0x0c7c5c1e, 0x3ec52f9f, 0xdc71898d, 0xcac933ae, 
+	0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x3b20d79e, 0x187de2a6,
+	0x3ec52f9f, 0x0c7c5c1e, 0x3536cc52, 0x238e7673, 0x2d413ccc, 0x2d413ccc, 0x3b20d79e, 0x187de2a6,
+	0x187de2a6, 0x3b20d79e, 0x187de2a6, 0x3b20d79e, 0x3536cc52, 0x238e7673, 0xf383a3e2, 0x3ec52f9f,
+	0x00000000, 0x40000000, 0x2d413ccc, 0x2d413ccc, 0xd2bec334, 0x2d413ccc, 0xe7821d5a, 0x3b20d79e,
+	0x238e7673, 0x3536cc52, 0xc13ad061, 0x0c7c5c1e, 0xd2bec334, 0x2d413ccc, 0x187de2a6, 0x3b20d79e,
+	0xc4df2862, 0xe7821d5a, 0xc4df2862, 0x187de2a6, 0x0c7c5c1e, 0x3ec52f9f, 0xdc71898d, 0xcac933ae,
 
-	0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x3fb11b47, 0x0645e9af, 
-	0x3fec43c6, 0x0323ecbe, 0x3f4eaafe, 0x09640837, 0x3ec52f9f, 0x0c7c5c1e, 0x3fb11b47, 0x0645e9af, 
-	0x3d3e82ad, 0x1294062e, 0x3d3e82ad, 0x1294062e, 0x3f4eaafe, 0x09640837, 0x39daf5e8, 0x1b5d1009, 
-	0x3b20d79e, 0x187de2a6, 0x3ec52f9f, 0x0c7c5c1e, 0x3536cc52, 0x238e7673, 0x387165e3, 0x1e2b5d38, 
-	0x3e14fdf7, 0x0f8cfcbd, 0x2f6bbe44, 0x2afad269, 0x3536cc52, 0x238e7673, 0x3d3e82ad, 0x1294062e, 
-	0x2899e64a, 0x317900d6, 0x317900d6, 0x2899e64a, 0x3c424209, 0x158f9a75, 0x20e70f32, 0x36e5068a, 
-	0x2d413ccc, 0x2d413ccc, 0x3b20d79e, 0x187de2a6, 0x187de2a6, 0x3b20d79e, 0x2899e64a, 0x317900d6, 
-	0x39daf5e8, 0x1b5d1009, 0x0f8cfcbd, 0x3e14fdf7, 0x238e7673, 0x3536cc52, 0x387165e3, 0x1e2b5d38, 
-	0x0645e9af, 0x3fb11b47, 0x1e2b5d38, 0x387165e3, 0x36e5068a, 0x20e70f32, 0xfcdc1342, 0x3fec43c6, 
-	0x187de2a6, 0x3b20d79e, 0x3536cc52, 0x238e7673, 0xf383a3e2, 0x3ec52f9f, 0x1294062e, 0x3d3e82ad, 
-	0x3367c08f, 0x261feff9, 0xea70658b, 0x3c424209, 0x0c7c5c1e, 0x3ec52f9f, 0x317900d6, 0x2899e64a, 
-	0xe1d4a2c8, 0x387165e3, 0x0645e9af, 0x3fb11b47, 0x2f6bbe44, 0x2afad269, 0xd9e01007, 0x3367c08f, 
-	0x00000000, 0x40000000, 0x2d413ccc, 0x2d413ccc, 0xd2bec334, 0x2d413ccc, 0xf9ba1651, 0x3fb11b47, 
-	0x2afad269, 0x2f6bbe44, 0xcc983f71, 0x261feff9, 0xf383a3e2, 0x3ec52f9f, 0x2899e64a, 0x317900d6, 
-	0xc78e9a1d, 0x1e2b5d38, 0xed6bf9d2, 0x3d3e82ad, 0x261feff9, 0x3367c08f, 0xc3bdbdf7, 0x158f9a75, 
-	0xe7821d5a, 0x3b20d79e, 0x238e7673, 0x3536cc52, 0xc13ad061, 0x0c7c5c1e, 0xe1d4a2c8, 0x387165e3, 
-	0x20e70f32, 0x36e5068a, 0xc013bc3a, 0x0323ecbe, 0xdc71898d, 0x3536cc52, 0x1e2b5d38, 0x387165e3, 
-	0xc04ee4b9, 0xf9ba1651, 0xd76619b6, 0x317900d6, 0x1b5d1009, 0x39daf5e8, 0xc1eb0209, 0xf0730343, 
-	0xd2bec334, 0x2d413ccc, 0x187de2a6, 0x3b20d79e, 0xc4df2862, 0xe7821d5a, 0xce86ff2a, 0x2899e64a, 
-	0x158f9a75, 0x3c424209, 0xc91af976, 0xdf18f0ce, 0xcac933ae, 0x238e7673, 0x1294062e, 0x3d3e82ad, 
-	0xce86ff2a, 0xd76619b6, 0xc78e9a1d, 0x1e2b5d38, 0x0f8cfcbd, 0x3e14fdf7, 0xd5052d97, 0xd09441bc, 
-	0xc4df2862, 0x187de2a6, 0x0c7c5c1e, 0x3ec52f9f, 0xdc71898d, 0xcac933ae, 0xc2c17d53, 0x1294062e, 
-	0x09640837, 0x3f4eaafe, 0xe4a2eff7, 0xc6250a18, 0xc13ad061, 0x0c7c5c1e, 0x0645e9af, 0x3fb11b47, 
-	0xed6bf9d2, 0xc2c17d53, 0xc04ee4b9, 0x0645e9af, 0x0323ecbe, 0x3fec43c6, 0xf69bf7c9, 0xc0b15502, 
+	0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x3fb11b47, 0x0645e9af,
+	0x3fec43c6, 0x0323ecbe, 0x3f4eaafe, 0x09640837, 0x3ec52f9f, 0x0c7c5c1e, 0x3fb11b47, 0x0645e9af,
+	0x3d3e82ad, 0x1294062e, 0x3d3e82ad, 0x1294062e, 0x3f4eaafe, 0x09640837, 0x39daf5e8, 0x1b5d1009,
+	0x3b20d79e, 0x187de2a6, 0x3ec52f9f, 0x0c7c5c1e, 0x3536cc52, 0x238e7673, 0x387165e3, 0x1e2b5d38,
+	0x3e14fdf7, 0x0f8cfcbd, 0x2f6bbe44, 0x2afad269, 0x3536cc52, 0x238e7673, 0x3d3e82ad, 0x1294062e,
+	0x2899e64a, 0x317900d6, 0x317900d6, 0x2899e64a, 0x3c424209, 0x158f9a75, 0x20e70f32, 0x36e5068a,
+	0x2d413ccc, 0x2d413ccc, 0x3b20d79e, 0x187de2a6, 0x187de2a6, 0x3b20d79e, 0x2899e64a, 0x317900d6,
+	0x39daf5e8, 0x1b5d1009, 0x0f8cfcbd, 0x3e14fdf7, 0x238e7673, 0x3536cc52, 0x387165e3, 0x1e2b5d38,
+	0x0645e9af, 0x3fb11b47, 0x1e2b5d38, 0x387165e3, 0x36e5068a, 0x20e70f32, 0xfcdc1342, 0x3fec43c6,
+	0x187de2a6, 0x3b20d79e, 0x3536cc52, 0x238e7673, 0xf383a3e2, 0x3ec52f9f, 0x1294062e, 0x3d3e82ad,
+	0x3367c08f, 0x261feff9, 0xea70658b, 0x3c424209, 0x0c7c5c1e, 0x3ec52f9f, 0x317900d6, 0x2899e64a,
+	0xe1d4a2c8, 0x387165e3, 0x0645e9af, 0x3fb11b47, 0x2f6bbe44, 0x2afad269, 0xd9e01007, 0x3367c08f,
+	0x00000000, 0x40000000, 0x2d413ccc, 0x2d413ccc, 0xd2bec334, 0x2d413ccc, 0xf9ba1651, 0x3fb11b47,
+	0x2afad269, 0x2f6bbe44, 0xcc983f71, 0x261feff9, 0xf383a3e2, 0x3ec52f9f, 0x2899e64a, 0x317900d6,
+	0xc78e9a1d, 0x1e2b5d38, 0xed6bf9d2, 0x3d3e82ad, 0x261feff9, 0x3367c08f, 0xc3bdbdf7, 0x158f9a75,
+	0xe7821d5a, 0x3b20d79e, 0x238e7673, 0x3536cc52, 0xc13ad061, 0x0c7c5c1e, 0xe1d4a2c8, 0x387165e3,
+	0x20e70f32, 0x36e5068a, 0xc013bc3a, 0x0323ecbe, 0xdc71898d, 0x3536cc52, 0x1e2b5d38, 0x387165e3,
+	0xc04ee4b9, 0xf9ba1651, 0xd76619b6, 0x317900d6, 0x1b5d1009, 0x39daf5e8, 0xc1eb0209, 0xf0730343,
+	0xd2bec334, 0x2d413ccc, 0x187de2a6, 0x3b20d79e, 0xc4df2862, 0xe7821d5a, 0xce86ff2a, 0x2899e64a,
+	0x158f9a75, 0x3c424209, 0xc91af976, 0xdf18f0ce, 0xcac933ae, 0x238e7673, 0x1294062e, 0x3d3e82ad,
+	0xce86ff2a, 0xd76619b6, 0xc78e9a1d, 0x1e2b5d38, 0x0f8cfcbd, 0x3e14fdf7, 0xd5052d97, 0xd09441bc,
+	0xc4df2862, 0x187de2a6, 0x0c7c5c1e, 0x3ec52f9f, 0xdc71898d, 0xcac933ae, 0xc2c17d53, 0x1294062e,
+	0x09640837, 0x3f4eaafe, 0xe4a2eff7, 0xc6250a18, 0xc13ad061, 0x0c7c5c1e, 0x0645e9af, 0x3fb11b47,
+	0xed6bf9d2, 0xc2c17d53, 0xc04ee4b9, 0x0645e9af, 0x0323ecbe, 0x3fec43c6, 0xf69bf7c9, 0xc0b15502,
 
-	0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x3ffb10c1, 0x0192155f, 
-	0x3ffec42d, 0x00c90e8f, 0x3ff4e5df, 0x025b0cae, 0x3fec43c6, 0x0323ecbe, 0x3ffb10c1, 0x0192155f, 
-	0x3fd39b5a, 0x04b54824, 0x3fd39b5a, 0x04b54824, 0x3ff4e5df, 0x025b0cae, 0x3f9c2bfa, 0x070de171, 
-	0x3fb11b47, 0x0645e9af, 0x3fec43c6, 0x0323ecbe, 0x3f4eaafe, 0x09640837, 0x3f84c8e1, 0x07d59395, 
-	0x3fe12acb, 0x03ecadcf, 0x3eeb3347, 0x0bb6ecef, 0x3f4eaafe, 0x09640837, 0x3fd39b5a, 0x04b54824, 
-	0x3e71e758, 0x0e05c135, 0x3f0ec9f4, 0x0af10a22, 0x3fc395f9, 0x057db402, 0x3de2f147, 0x104fb80e, 
-	0x3ec52f9f, 0x0c7c5c1e, 0x3fb11b47, 0x0645e9af, 0x3d3e82ad, 0x1294062e, 0x3e71e758, 0x0e05c135, 
-	0x3f9c2bfa, 0x070de171, 0x3c84d496, 0x14d1e242, 0x3e14fdf7, 0x0f8cfcbd, 0x3f84c8e1, 0x07d59395, 
-	0x3bb6276d, 0x17088530, 0x3dae81ce, 0x1111d262, 0x3f6af2e3, 0x089cf867, 0x3ad2c2e7, 0x19372a63, 
-	0x3d3e82ad, 0x1294062e, 0x3f4eaafe, 0x09640837, 0x39daf5e8, 0x1b5d1009, 0x3cc511d8, 0x14135c94, 
-	0x3f2ff249, 0x0a2abb58, 0x38cf1669, 0x1d79775b, 0x3c424209, 0x158f9a75, 0x3f0ec9f4, 0x0af10a22, 
-	0x37af8158, 0x1f8ba4db, 0x3bb6276d, 0x17088530, 0x3eeb3347, 0x0bb6ecef, 0x367c9a7d, 0x2192e09a, 
-	0x3b20d79e, 0x187de2a6, 0x3ec52f9f, 0x0c7c5c1e, 0x3536cc52, 0x238e7673, 0x3a8269a2, 0x19ef7943, 
-	0x3e9cc076, 0x0d415012, 0x33de87de, 0x257db64b, 0x39daf5e8, 0x1b5d1009, 0x3e71e758, 0x0e05c135, 
-	0x32744493, 0x275ff452, 0x392a9642, 0x1cc66e99, 0x3e44a5ee, 0x0ec9a7f2, 0x30f8801f, 0x29348937, 
-	0x387165e3, 0x1e2b5d38, 0x3e14fdf7, 0x0f8cfcbd, 0x2f6bbe44, 0x2afad269, 0x37af8158, 0x1f8ba4db, 
-	0x3de2f147, 0x104fb80e, 0x2dce88a9, 0x2cb2324b, 0x36e5068a, 0x20e70f32, 0x3dae81ce, 0x1111d262, 
-	0x2c216eaa, 0x2e5a106f, 0x361214b0, 0x223d66a8, 0x3d77b191, 0x11d3443f, 0x2a650525, 0x2ff1d9c6, 
-	0x3536cc52, 0x238e7673, 0x3d3e82ad, 0x1294062e, 0x2899e64a, 0x317900d6, 0x34534f40, 0x24da0a99, 
-	0x3d02f756, 0x135410c2, 0x26c0b162, 0x32eefde9, 0x3367c08f, 0x261feff9, 0x3cc511d8, 0x14135c94, 
-	0x24da0a99, 0x34534f40, 0x32744493, 0x275ff452, 0x3c84d496, 0x14d1e242, 0x22e69ac7, 0x35a5793c, 
-	0x317900d6, 0x2899e64a, 0x3c424209, 0x158f9a75, 0x20e70f32, 0x36e5068a, 0x30761c17, 0x29cd9577, 
-	0x3bfd5cc4, 0x164c7ddd, 0x1edc1952, 0x3811884c, 0x2f6bbe44, 0x2afad269, 0x3bb6276d, 0x17088530, 
-	0x1cc66e99, 0x392a9642, 0x2e5a106f, 0x2c216eaa, 0x3b6ca4c4, 0x17c3a931, 0x1aa6c82b, 0x3a2fcee8, 
-	0x2d413ccc, 0x2d413ccc, 0x3b20d79e, 0x187de2a6, 0x187de2a6, 0x3b20d79e, 0x2c216eaa, 0x2e5a106f, 
-	0x3ad2c2e7, 0x19372a63, 0x164c7ddd, 0x3bfd5cc4, 0x2afad269, 0x2f6bbe44, 0x3a8269a2, 0x19ef7943, 
-	0x14135c94, 0x3cc511d8, 0x29cd9577, 0x30761c17, 0x3a2fcee8, 0x1aa6c82b, 0x11d3443f, 0x3d77b191, 
-	0x2899e64a, 0x317900d6, 0x39daf5e8, 0x1b5d1009, 0x0f8cfcbd, 0x3e14fdf7, 0x275ff452, 0x32744493, 
-	0x3983e1e7, 0x1c1249d8, 0x0d415012, 0x3e9cc076, 0x261feff9, 0x3367c08f, 0x392a9642, 0x1cc66e99, 
-	0x0af10a22, 0x3f0ec9f4, 0x24da0a99, 0x34534f40, 0x38cf1669, 0x1d79775b, 0x089cf867, 0x3f6af2e3, 
-	0x238e7673, 0x3536cc52, 0x387165e3, 0x1e2b5d38, 0x0645e9af, 0x3fb11b47, 0x223d66a8, 0x361214b0, 
-	0x3811884c, 0x1edc1952, 0x03ecadcf, 0x3fe12acb, 0x20e70f32, 0x36e5068a, 0x37af8158, 0x1f8ba4db, 
-	0x0192155f, 0x3ffb10c1, 0x1f8ba4db, 0x37af8158, 0x374b54ce, 0x2039f90e, 0xff36f171, 0x3ffec42d, 
-	0x1e2b5d38, 0x387165e3, 0x36e5068a, 0x20e70f32, 0xfcdc1342, 0x3fec43c6, 0x1cc66e99, 0x392a9642, 
-	0x367c9a7d, 0x2192e09a, 0xfa824bfe, 0x3fc395f9, 0x1b5d1009, 0x39daf5e8, 0x361214b0, 0x223d66a8, 
-	0xf82a6c6b, 0x3f84c8e1, 0x19ef7943, 0x3a8269a2, 0x35a5793c, 0x22e69ac7, 0xf5d544a8, 0x3f2ff249, 
-	0x187de2a6, 0x3b20d79e, 0x3536cc52, 0x238e7673, 0xf383a3e2, 0x3ec52f9f, 0x17088530, 0x3bb6276d, 
-	0x34c61236, 0x2434f332, 0xf136580e, 0x3e44a5ee, 0x158f9a75, 0x3c424209, 0x34534f40, 0x24da0a99, 
-	0xeeee2d9e, 0x3dae81ce, 0x14135c94, 0x3cc511d8, 0x33de87de, 0x257db64b, 0xecabef3e, 0x3d02f756, 
-	0x1294062e, 0x3d3e82ad, 0x3367c08f, 0x261feff9, 0xea70658b, 0x3c424209, 0x1111d262, 0x3dae81ce, 
-	0x32eefde9, 0x26c0b162, 0xe83c56cf, 0x3b6ca4c4, 0x0f8cfcbd, 0x3e14fdf7, 0x32744493, 0x275ff452, 
-	0xe61086bd, 0x3a8269a2, 0x0e05c135, 0x3e71e758, 0x31f79947, 0x27fdb2a6, 0xe3edb628, 0x3983e1e7, 
-	0x0c7c5c1e, 0x3ec52f9f, 0x317900d6, 0x2899e64a, 0xe1d4a2c8, 0x387165e3, 0x0af10a22, 0x3f0ec9f4, 
-	0x30f8801f, 0x29348937, 0xdfc606f2, 0x374b54ce, 0x09640837, 0x3f4eaafe, 0x30761c17, 0x29cd9577, 
-	0xddc29958, 0x361214b0, 0x07d59395, 0x3f84c8e1, 0x2ff1d9c6, 0x2a650525, 0xdbcb0cce, 0x34c61236, 
-	0x0645e9af, 0x3fb11b47, 0x2f6bbe44, 0x2afad269, 0xd9e01007, 0x3367c08f, 0x04b54824, 0x3fd39b5a, 
-	0x2ee3cebe, 0x2b8ef77c, 0xd8024d5a, 0x31f79947, 0x0323ecbe, 0x3fec43c6, 0x2e5a106f, 0x2c216eaa, 
-	0xd6326a89, 0x30761c17, 0x0192155f, 0x3ffb10c1, 0x2dce88a9, 0x2cb2324b, 0xd4710884, 0x2ee3cebe, 
-	0x00000000, 0x40000000, 0x2d413ccc, 0x2d413ccc, 0xd2bec334, 0x2d413ccc, 0xfe6deaa1, 0x3ffb10c1, 
-	0x2cb2324b, 0x2dce88a9, 0xd11c3142, 0x2b8ef77c, 0xfcdc1342, 0x3fec43c6, 0x2c216eaa, 0x2e5a106f, 
-	0xcf89e3e9, 0x29cd9577, 0xfb4ab7dc, 0x3fd39b5a, 0x2b8ef77c, 0x2ee3cebe, 0xce0866b9, 0x27fdb2a6, 
-	0xf9ba1651, 0x3fb11b47, 0x2afad269, 0x2f6bbe44, 0xcc983f71, 0x261feff9, 0xf82a6c6b, 0x3f84c8e1, 
-	0x2a650525, 0x2ff1d9c6, 0xcb39edca, 0x2434f332, 0xf69bf7c9, 0x3f4eaafe, 0x29cd9577, 0x30761c17, 
-	0xc9edeb50, 0x223d66a8, 0xf50ef5de, 0x3f0ec9f4, 0x29348937, 0x30f8801f, 0xc8b4ab32, 0x2039f90e, 
-	0xf383a3e2, 0x3ec52f9f, 0x2899e64a, 0x317900d6, 0xc78e9a1d, 0x1e2b5d38, 0xf1fa3ecb, 0x3e71e758, 
-	0x27fdb2a6, 0x31f79947, 0xc67c1e19, 0x1c1249d8, 0xf0730343, 0x3e14fdf7, 0x275ff452, 0x32744493, 
-	0xc57d965e, 0x19ef7943, 0xeeee2d9e, 0x3dae81ce, 0x26c0b162, 0x32eefde9, 0xc4935b3c, 0x17c3a931, 
-	0xed6bf9d2, 0x3d3e82ad, 0x261feff9, 0x3367c08f, 0xc3bdbdf7, 0x158f9a75, 0xebeca36c, 0x3cc511d8, 
-	0x257db64b, 0x33de87de, 0xc2fd08aa, 0x135410c2, 0xea70658b, 0x3c424209, 0x24da0a99, 0x34534f40, 
-	0xc2517e32, 0x1111d262, 0xe8f77ad0, 0x3bb6276d, 0x2434f332, 0x34c61236, 0xc1bb5a12, 0x0ec9a7f2, 
-	0xe7821d5a, 0x3b20d79e, 0x238e7673, 0x3536cc52, 0xc13ad061, 0x0c7c5c1e, 0xe61086bd, 0x3a8269a2, 
-	0x22e69ac7, 0x35a5793c, 0xc0d00db7, 0x0a2abb58, 0xe4a2eff7, 0x39daf5e8, 0x223d66a8, 0x361214b0, 
-	0xc07b371f, 0x07d59395, 0xe3399167, 0x392a9642, 0x2192e09a, 0x367c9a7d, 0xc03c6a07, 0x057db402, 
-	0xe1d4a2c8, 0x387165e3, 0x20e70f32, 0x36e5068a, 0xc013bc3a, 0x0323ecbe, 0xe0745b25, 0x37af8158, 
-	0x2039f90e, 0x374b54ce, 0xc0013bd3, 0x00c90e8f, 0xdf18f0ce, 0x36e5068a, 0x1f8ba4db, 0x37af8158, 
-	0xc004ef3f, 0xfe6deaa1, 0xddc29958, 0x361214b0, 0x1edc1952, 0x3811884c, 0xc01ed535, 0xfc135231, 
-	0xdc71898d, 0x3536cc52, 0x1e2b5d38, 0x387165e3, 0xc04ee4b9, 0xf9ba1651, 0xdb25f567, 0x34534f40, 
-	0x1d79775b, 0x38cf1669, 0xc0950d1d, 0xf7630799, 0xd9e01007, 0x3367c08f, 0x1cc66e99, 0x392a9642, 
-	0xc0f1360c, 0xf50ef5de, 0xd8a00bae, 0x32744493, 0x1c1249d8, 0x3983e1e7, 0xc1633f8a, 0xf2beafee, 
-	0xd76619b6, 0x317900d6, 0x1b5d1009, 0x39daf5e8, 0xc1eb0209, 0xf0730343, 0xd6326a89, 0x30761c17, 
-	0x1aa6c82b, 0x3a2fcee8, 0xc2884e6f, 0xee2cbbc1, 0xd5052d97, 0x2f6bbe44, 0x19ef7943, 0x3a8269a2, 
-	0xc33aee28, 0xebeca36c, 0xd3de9156, 0x2e5a106f, 0x19372a63, 0x3ad2c2e7, 0xc402a33c, 0xe9b38223, 
-	0xd2bec334, 0x2d413ccc, 0x187de2a6, 0x3b20d79e, 0xc4df2862, 0xe7821d5a, 0xd1a5ef91, 0x2c216eaa, 
-	0x17c3a931, 0x3b6ca4c4, 0xc5d03118, 0xe55937d5, 0xd09441bc, 0x2afad269, 0x17088530, 0x3bb6276d, 
-	0xc6d569be, 0xe3399167, 0xcf89e3e9, 0x29cd9577, 0x164c7ddd, 0x3bfd5cc4, 0xc7ee77b4, 0xe123e6ae, 
-	0xce86ff2a, 0x2899e64a, 0x158f9a75, 0x3c424209, 0xc91af976, 0xdf18f0ce, 0xcd8bbb6d, 0x275ff452, 
-	0x14d1e242, 0x3c84d496, 0xca5a86c4, 0xdd196539, 0xcc983f71, 0x261feff9, 0x14135c94, 0x3cc511d8, 
-	0xcbacb0c0, 0xdb25f567, 0xcbacb0c0, 0x24da0a99, 0x135410c2, 0x3d02f756, 0xcd110217, 0xd93f4e9e, 
-	0xcac933ae, 0x238e7673, 0x1294062e, 0x3d3e82ad, 0xce86ff2a, 0xd76619b6, 0xc9edeb50, 0x223d66a8, 
-	0x11d3443f, 0x3d77b191, 0xd00e263a, 0xd59afadb, 0xc91af976, 0x20e70f32, 0x1111d262, 0x3dae81ce, 
-	0xd1a5ef91, 0xd3de9156, 0xc8507ea8, 0x1f8ba4db, 0x104fb80e, 0x3de2f147, 0xd34dcdb5, 0xd2317757, 
-	0xc78e9a1d, 0x1e2b5d38, 0x0f8cfcbd, 0x3e14fdf7, 0xd5052d97, 0xd09441bc, 0xc6d569be, 0x1cc66e99, 
-	0x0ec9a7f2, 0x3e44a5ee, 0xd6cb76c9, 0xcf077fe1, 0xc6250a18, 0x1b5d1009, 0x0e05c135, 0x3e71e758, 
-	0xd8a00bae, 0xcd8bbb6d, 0xc57d965e, 0x19ef7943, 0x0d415012, 0x3e9cc076, 0xda8249b5, 0xcc217822, 
-	0xc4df2862, 0x187de2a6, 0x0c7c5c1e, 0x3ec52f9f, 0xdc71898d, 0xcac933ae, 0xc449d893, 0x17088530, 
-	0x0bb6ecef, 0x3eeb3347, 0xde6d1f66, 0xc9836583, 0xc3bdbdf7, 0x158f9a75, 0x0af10a22, 0x3f0ec9f4, 
-	0xe0745b25, 0xc8507ea8, 0xc33aee28, 0x14135c94, 0x0a2abb58, 0x3f2ff249, 0xe28688a5, 0xc730e997, 
-	0xc2c17d53, 0x1294062e, 0x09640837, 0x3f4eaafe, 0xe4a2eff7, 0xc6250a18, 0xc2517e32, 0x1111d262, 
-	0x089cf867, 0x3f6af2e3, 0xe6c8d59d, 0xc52d3d19, 0xc1eb0209, 0x0f8cfcbd, 0x07d59395, 0x3f84c8e1, 
-	0xe8f77ad0, 0xc449d893, 0xc18e18a8, 0x0e05c135, 0x070de171, 0x3f9c2bfa, 0xeb2e1dbe, 0xc37b2b6a, 
-	0xc13ad061, 0x0c7c5c1e, 0x0645e9af, 0x3fb11b47, 0xed6bf9d2, 0xc2c17d53, 0xc0f1360c, 0x0af10a22, 
-	0x057db402, 0x3fc395f9, 0xefb047f2, 0xc21d0eb9, 0xc0b15502, 0x09640837, 0x04b54824, 0x3fd39b5a, 
-	0xf1fa3ecb, 0xc18e18a8, 0xc07b371f, 0x07d59395, 0x03ecadcf, 0x3fe12acb, 0xf4491311, 0xc114ccb9, 
-	0xc04ee4b9, 0x0645e9af, 0x0323ecbe, 0x3fec43c6, 0xf69bf7c9, 0xc0b15502, 0xc02c64a6, 0x04b54824, 
-	0x025b0cae, 0x3ff4e5df, 0xf8f21e8f, 0xc063d406, 0xc013bc3a, 0x0323ecbe, 0x0192155f, 0x3ffb10c1, 
+	0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x3ffb10c1, 0x0192155f,
+	0x3ffec42d, 0x00c90e8f, 0x3ff4e5df, 0x025b0cae, 0x3fec43c6, 0x0323ecbe, 0x3ffb10c1, 0x0192155f,
+	0x3fd39b5a, 0x04b54824, 0x3fd39b5a, 0x04b54824, 0x3ff4e5df, 0x025b0cae, 0x3f9c2bfa, 0x070de171,
+	0x3fb11b47, 0x0645e9af, 0x3fec43c6, 0x0323ecbe, 0x3f4eaafe, 0x09640837, 0x3f84c8e1, 0x07d59395,
+	0x3fe12acb, 0x03ecadcf, 0x3eeb3347, 0x0bb6ecef, 0x3f4eaafe, 0x09640837, 0x3fd39b5a, 0x04b54824,
+	0x3e71e758, 0x0e05c135, 0x3f0ec9f4, 0x0af10a22, 0x3fc395f9, 0x057db402, 0x3de2f147, 0x104fb80e,
+	0x3ec52f9f, 0x0c7c5c1e, 0x3fb11b47, 0x0645e9af, 0x3d3e82ad, 0x1294062e, 0x3e71e758, 0x0e05c135,
+	0x3f9c2bfa, 0x070de171, 0x3c84d496, 0x14d1e242, 0x3e14fdf7, 0x0f8cfcbd, 0x3f84c8e1, 0x07d59395,
+	0x3bb6276d, 0x17088530, 0x3dae81ce, 0x1111d262, 0x3f6af2e3, 0x089cf867, 0x3ad2c2e7, 0x19372a63,
+	0x3d3e82ad, 0x1294062e, 0x3f4eaafe, 0x09640837, 0x39daf5e8, 0x1b5d1009, 0x3cc511d8, 0x14135c94,
+	0x3f2ff249, 0x0a2abb58, 0x38cf1669, 0x1d79775b, 0x3c424209, 0x158f9a75, 0x3f0ec9f4, 0x0af10a22,
+	0x37af8158, 0x1f8ba4db, 0x3bb6276d, 0x17088530, 0x3eeb3347, 0x0bb6ecef, 0x367c9a7d, 0x2192e09a,
+	0x3b20d79e, 0x187de2a6, 0x3ec52f9f, 0x0c7c5c1e, 0x3536cc52, 0x238e7673, 0x3a8269a2, 0x19ef7943,
+	0x3e9cc076, 0x0d415012, 0x33de87de, 0x257db64b, 0x39daf5e8, 0x1b5d1009, 0x3e71e758, 0x0e05c135,
+	0x32744493, 0x275ff452, 0x392a9642, 0x1cc66e99, 0x3e44a5ee, 0x0ec9a7f2, 0x30f8801f, 0x29348937,
+	0x387165e3, 0x1e2b5d38, 0x3e14fdf7, 0x0f8cfcbd, 0x2f6bbe44, 0x2afad269, 0x37af8158, 0x1f8ba4db,
+	0x3de2f147, 0x104fb80e, 0x2dce88a9, 0x2cb2324b, 0x36e5068a, 0x20e70f32, 0x3dae81ce, 0x1111d262,
+	0x2c216eaa, 0x2e5a106f, 0x361214b0, 0x223d66a8, 0x3d77b191, 0x11d3443f, 0x2a650525, 0x2ff1d9c6,
+	0x3536cc52, 0x238e7673, 0x3d3e82ad, 0x1294062e, 0x2899e64a, 0x317900d6, 0x34534f40, 0x24da0a99,
+	0x3d02f756, 0x135410c2, 0x26c0b162, 0x32eefde9, 0x3367c08f, 0x261feff9, 0x3cc511d8, 0x14135c94,
+	0x24da0a99, 0x34534f40, 0x32744493, 0x275ff452, 0x3c84d496, 0x14d1e242, 0x22e69ac7, 0x35a5793c,
+	0x317900d6, 0x2899e64a, 0x3c424209, 0x158f9a75, 0x20e70f32, 0x36e5068a, 0x30761c17, 0x29cd9577,
+	0x3bfd5cc4, 0x164c7ddd, 0x1edc1952, 0x3811884c, 0x2f6bbe44, 0x2afad269, 0x3bb6276d, 0x17088530,
+	0x1cc66e99, 0x392a9642, 0x2e5a106f, 0x2c216eaa, 0x3b6ca4c4, 0x17c3a931, 0x1aa6c82b, 0x3a2fcee8,
+	0x2d413ccc, 0x2d413ccc, 0x3b20d79e, 0x187de2a6, 0x187de2a6, 0x3b20d79e, 0x2c216eaa, 0x2e5a106f,
+	0x3ad2c2e7, 0x19372a63, 0x164c7ddd, 0x3bfd5cc4, 0x2afad269, 0x2f6bbe44, 0x3a8269a2, 0x19ef7943,
+	0x14135c94, 0x3cc511d8, 0x29cd9577, 0x30761c17, 0x3a2fcee8, 0x1aa6c82b, 0x11d3443f, 0x3d77b191,
+	0x2899e64a, 0x317900d6, 0x39daf5e8, 0x1b5d1009, 0x0f8cfcbd, 0x3e14fdf7, 0x275ff452, 0x32744493,
+	0x3983e1e7, 0x1c1249d8, 0x0d415012, 0x3e9cc076, 0x261feff9, 0x3367c08f, 0x392a9642, 0x1cc66e99,
+	0x0af10a22, 0x3f0ec9f4, 0x24da0a99, 0x34534f40, 0x38cf1669, 0x1d79775b, 0x089cf867, 0x3f6af2e3,
+	0x238e7673, 0x3536cc52, 0x387165e3, 0x1e2b5d38, 0x0645e9af, 0x3fb11b47, 0x223d66a8, 0x361214b0,
+	0x3811884c, 0x1edc1952, 0x03ecadcf, 0x3fe12acb, 0x20e70f32, 0x36e5068a, 0x37af8158, 0x1f8ba4db,
+	0x0192155f, 0x3ffb10c1, 0x1f8ba4db, 0x37af8158, 0x374b54ce, 0x2039f90e, 0xff36f171, 0x3ffec42d,
+	0x1e2b5d38, 0x387165e3, 0x36e5068a, 0x20e70f32, 0xfcdc1342, 0x3fec43c6, 0x1cc66e99, 0x392a9642,
+	0x367c9a7d, 0x2192e09a, 0xfa824bfe, 0x3fc395f9, 0x1b5d1009, 0x39daf5e8, 0x361214b0, 0x223d66a8,
+	0xf82a6c6b, 0x3f84c8e1, 0x19ef7943, 0x3a8269a2, 0x35a5793c, 0x22e69ac7, 0xf5d544a8, 0x3f2ff249,
+	0x187de2a6, 0x3b20d79e, 0x3536cc52, 0x238e7673, 0xf383a3e2, 0x3ec52f9f, 0x17088530, 0x3bb6276d,
+	0x34c61236, 0x2434f332, 0xf136580e, 0x3e44a5ee, 0x158f9a75, 0x3c424209, 0x34534f40, 0x24da0a99,
+	0xeeee2d9e, 0x3dae81ce, 0x14135c94, 0x3cc511d8, 0x33de87de, 0x257db64b, 0xecabef3e, 0x3d02f756,
+	0x1294062e, 0x3d3e82ad, 0x3367c08f, 0x261feff9, 0xea70658b, 0x3c424209, 0x1111d262, 0x3dae81ce,
+	0x32eefde9, 0x26c0b162, 0xe83c56cf, 0x3b6ca4c4, 0x0f8cfcbd, 0x3e14fdf7, 0x32744493, 0x275ff452,
+	0xe61086bd, 0x3a8269a2, 0x0e05c135, 0x3e71e758, 0x31f79947, 0x27fdb2a6, 0xe3edb628, 0x3983e1e7,
+	0x0c7c5c1e, 0x3ec52f9f, 0x317900d6, 0x2899e64a, 0xe1d4a2c8, 0x387165e3, 0x0af10a22, 0x3f0ec9f4,
+	0x30f8801f, 0x29348937, 0xdfc606f2, 0x374b54ce, 0x09640837, 0x3f4eaafe, 0x30761c17, 0x29cd9577,
+	0xddc29958, 0x361214b0, 0x07d59395, 0x3f84c8e1, 0x2ff1d9c6, 0x2a650525, 0xdbcb0cce, 0x34c61236,
+	0x0645e9af, 0x3fb11b47, 0x2f6bbe44, 0x2afad269, 0xd9e01007, 0x3367c08f, 0x04b54824, 0x3fd39b5a,
+	0x2ee3cebe, 0x2b8ef77c, 0xd8024d5a, 0x31f79947, 0x0323ecbe, 0x3fec43c6, 0x2e5a106f, 0x2c216eaa,
+	0xd6326a89, 0x30761c17, 0x0192155f, 0x3ffb10c1, 0x2dce88a9, 0x2cb2324b, 0xd4710884, 0x2ee3cebe,
+	0x00000000, 0x40000000, 0x2d413ccc, 0x2d413ccc, 0xd2bec334, 0x2d413ccc, 0xfe6deaa1, 0x3ffb10c1,
+	0x2cb2324b, 0x2dce88a9, 0xd11c3142, 0x2b8ef77c, 0xfcdc1342, 0x3fec43c6, 0x2c216eaa, 0x2e5a106f,
+	0xcf89e3e9, 0x29cd9577, 0xfb4ab7dc, 0x3fd39b5a, 0x2b8ef77c, 0x2ee3cebe, 0xce0866b9, 0x27fdb2a6,
+	0xf9ba1651, 0x3fb11b47, 0x2afad269, 0x2f6bbe44, 0xcc983f71, 0x261feff9, 0xf82a6c6b, 0x3f84c8e1,
+	0x2a650525, 0x2ff1d9c6, 0xcb39edca, 0x2434f332, 0xf69bf7c9, 0x3f4eaafe, 0x29cd9577, 0x30761c17,
+	0xc9edeb50, 0x223d66a8, 0xf50ef5de, 0x3f0ec9f4, 0x29348937, 0x30f8801f, 0xc8b4ab32, 0x2039f90e,
+	0xf383a3e2, 0x3ec52f9f, 0x2899e64a, 0x317900d6, 0xc78e9a1d, 0x1e2b5d38, 0xf1fa3ecb, 0x3e71e758,
+	0x27fdb2a6, 0x31f79947, 0xc67c1e19, 0x1c1249d8, 0xf0730343, 0x3e14fdf7, 0x275ff452, 0x32744493,
+	0xc57d965e, 0x19ef7943, 0xeeee2d9e, 0x3dae81ce, 0x26c0b162, 0x32eefde9, 0xc4935b3c, 0x17c3a931,
+	0xed6bf9d2, 0x3d3e82ad, 0x261feff9, 0x3367c08f, 0xc3bdbdf7, 0x158f9a75, 0xebeca36c, 0x3cc511d8,
+	0x257db64b, 0x33de87de, 0xc2fd08aa, 0x135410c2, 0xea70658b, 0x3c424209, 0x24da0a99, 0x34534f40,
+	0xc2517e32, 0x1111d262, 0xe8f77ad0, 0x3bb6276d, 0x2434f332, 0x34c61236, 0xc1bb5a12, 0x0ec9a7f2,
+	0xe7821d5a, 0x3b20d79e, 0x238e7673, 0x3536cc52, 0xc13ad061, 0x0c7c5c1e, 0xe61086bd, 0x3a8269a2,
+	0x22e69ac7, 0x35a5793c, 0xc0d00db7, 0x0a2abb58, 0xe4a2eff7, 0x39daf5e8, 0x223d66a8, 0x361214b0,
+	0xc07b371f, 0x07d59395, 0xe3399167, 0x392a9642, 0x2192e09a, 0x367c9a7d, 0xc03c6a07, 0x057db402,
+	0xe1d4a2c8, 0x387165e3, 0x20e70f32, 0x36e5068a, 0xc013bc3a, 0x0323ecbe, 0xe0745b25, 0x37af8158,
+	0x2039f90e, 0x374b54ce, 0xc0013bd3, 0x00c90e8f, 0xdf18f0ce, 0x36e5068a, 0x1f8ba4db, 0x37af8158,
+	0xc004ef3f, 0xfe6deaa1, 0xddc29958, 0x361214b0, 0x1edc1952, 0x3811884c, 0xc01ed535, 0xfc135231,
+	0xdc71898d, 0x3536cc52, 0x1e2b5d38, 0x387165e3, 0xc04ee4b9, 0xf9ba1651, 0xdb25f567, 0x34534f40,
+	0x1d79775b, 0x38cf1669, 0xc0950d1d, 0xf7630799, 0xd9e01007, 0x3367c08f, 0x1cc66e99, 0x392a9642,
+	0xc0f1360c, 0xf50ef5de, 0xd8a00bae, 0x32744493, 0x1c1249d8, 0x3983e1e7, 0xc1633f8a, 0xf2beafee,
+	0xd76619b6, 0x317900d6, 0x1b5d1009, 0x39daf5e8, 0xc1eb0209, 0xf0730343, 0xd6326a89, 0x30761c17,
+	0x1aa6c82b, 0x3a2fcee8, 0xc2884e6f, 0xee2cbbc1, 0xd5052d97, 0x2f6bbe44, 0x19ef7943, 0x3a8269a2,
+	0xc33aee28, 0xebeca36c, 0xd3de9156, 0x2e5a106f, 0x19372a63, 0x3ad2c2e7, 0xc402a33c, 0xe9b38223,
+	0xd2bec334, 0x2d413ccc, 0x187de2a6, 0x3b20d79e, 0xc4df2862, 0xe7821d5a, 0xd1a5ef91, 0x2c216eaa,
+	0x17c3a931, 0x3b6ca4c4, 0xc5d03118, 0xe55937d5, 0xd09441bc, 0x2afad269, 0x17088530, 0x3bb6276d,
+	0xc6d569be, 0xe3399167, 0xcf89e3e9, 0x29cd9577, 0x164c7ddd, 0x3bfd5cc4, 0xc7ee77b4, 0xe123e6ae,
+	0xce86ff2a, 0x2899e64a, 0x158f9a75, 0x3c424209, 0xc91af976, 0xdf18f0ce, 0xcd8bbb6d, 0x275ff452,
+	0x14d1e242, 0x3c84d496, 0xca5a86c4, 0xdd196539, 0xcc983f71, 0x261feff9, 0x14135c94, 0x3cc511d8,
+	0xcbacb0c0, 0xdb25f567, 0xcbacb0c0, 0x24da0a99, 0x135410c2, 0x3d02f756, 0xcd110217, 0xd93f4e9e,
+	0xcac933ae, 0x238e7673, 0x1294062e, 0x3d3e82ad, 0xce86ff2a, 0xd76619b6, 0xc9edeb50, 0x223d66a8,
+	0x11d3443f, 0x3d77b191, 0xd00e263a, 0xd59afadb, 0xc91af976, 0x20e70f32, 0x1111d262, 0x3dae81ce,
+	0xd1a5ef91, 0xd3de9156, 0xc8507ea8, 0x1f8ba4db, 0x104fb80e, 0x3de2f147, 0xd34dcdb5, 0xd2317757,
+	0xc78e9a1d, 0x1e2b5d38, 0x0f8cfcbd, 0x3e14fdf7, 0xd5052d97, 0xd09441bc, 0xc6d569be, 0x1cc66e99,
+	0x0ec9a7f2, 0x3e44a5ee, 0xd6cb76c9, 0xcf077fe1, 0xc6250a18, 0x1b5d1009, 0x0e05c135, 0x3e71e758,
+	0xd8a00bae, 0xcd8bbb6d, 0xc57d965e, 0x19ef7943, 0x0d415012, 0x3e9cc076, 0xda8249b5, 0xcc217822,
+	0xc4df2862, 0x187de2a6, 0x0c7c5c1e, 0x3ec52f9f, 0xdc71898d, 0xcac933ae, 0xc449d893, 0x17088530,
+	0x0bb6ecef, 0x3eeb3347, 0xde6d1f66, 0xc9836583, 0xc3bdbdf7, 0x158f9a75, 0x0af10a22, 0x3f0ec9f4,
+	0xe0745b25, 0xc8507ea8, 0xc33aee28, 0x14135c94, 0x0a2abb58, 0x3f2ff249, 0xe28688a5, 0xc730e997,
+	0xc2c17d53, 0x1294062e, 0x09640837, 0x3f4eaafe, 0xe4a2eff7, 0xc6250a18, 0xc2517e32, 0x1111d262,
+	0x089cf867, 0x3f6af2e3, 0xe6c8d59d, 0xc52d3d19, 0xc1eb0209, 0x0f8cfcbd, 0x07d59395, 0x3f84c8e1,
+	0xe8f77ad0, 0xc449d893, 0xc18e18a8, 0x0e05c135, 0x070de171, 0x3f9c2bfa, 0xeb2e1dbe, 0xc37b2b6a,
+	0xc13ad061, 0x0c7c5c1e, 0x0645e9af, 0x3fb11b47, 0xed6bf9d2, 0xc2c17d53, 0xc0f1360c, 0x0af10a22,
+	0x057db402, 0x3fc395f9, 0xefb047f2, 0xc21d0eb9, 0xc0b15502, 0x09640837, 0x04b54824, 0x3fd39b5a,
+	0xf1fa3ecb, 0xc18e18a8, 0xc07b371f, 0x07d59395, 0x03ecadcf, 0x3fe12acb, 0xf4491311, 0xc114ccb9,
+	0xc04ee4b9, 0x0645e9af, 0x0323ecbe, 0x3fec43c6, 0xf69bf7c9, 0xc0b15502, 0xc02c64a6, 0x04b54824,
+	0x025b0cae, 0x3ff4e5df, 0xf8f21e8f, 0xc063d406, 0xc013bc3a, 0x0323ecbe, 0x0192155f, 0x3ffb10c1,
 	0xfb4ab7dc, 0xc02c64a6, 0xc004ef3f, 0x0192155f, 0x00c90e8f, 0x3ffec42d, 0xfda4f352, 0xc00b1a21
 };
 
 const int twidTab64[4*6 + 16*6] = {
-	0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x2d413ccc, 0x2d413ccc, 
-	0x3b20d79e, 0x187de2a6, 0x187de2a6, 0x3b20d79e, 0x00000000, 0x40000000, 0x2d413ccc, 0x2d413ccc, 
-	0xd2bec334, 0x2d413ccc, 0xd2bec334, 0x2d413ccc, 0x187de2a6, 0x3b20d79e, 0xc4df2862, 0xe7821d5a, 
+	0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x2d413ccc, 0x2d413ccc,
+	0x3b20d79e, 0x187de2a6, 0x187de2a6, 0x3b20d79e, 0x00000000, 0x40000000, 0x2d413ccc, 0x2d413ccc,
+	0xd2bec334, 0x2d413ccc, 0xd2bec334, 0x2d413ccc, 0x187de2a6, 0x3b20d79e, 0xc4df2862, 0xe7821d5a,
 
-	0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x3ec52f9f, 0x0c7c5c1e, 
-	0x3fb11b47, 0x0645e9af, 0x3d3e82ad, 0x1294062e, 0x3b20d79e, 0x187de2a6, 0x3ec52f9f, 0x0c7c5c1e, 
-	0x3536cc52, 0x238e7673, 0x3536cc52, 0x238e7673, 0x3d3e82ad, 0x1294062e, 0x2899e64a, 0x317900d6, 
-	0x2d413ccc, 0x2d413ccc, 0x3b20d79e, 0x187de2a6, 0x187de2a6, 0x3b20d79e, 0x238e7673, 0x3536cc52, 
-	0x387165e3, 0x1e2b5d38, 0x0645e9af, 0x3fb11b47, 0x187de2a6, 0x3b20d79e, 0x3536cc52, 0x238e7673, 
-	0xf383a3e2, 0x3ec52f9f, 0x0c7c5c1e, 0x3ec52f9f, 0x317900d6, 0x2899e64a, 0xe1d4a2c8, 0x387165e3, 
-	0x00000000, 0x40000000, 0x2d413ccc, 0x2d413ccc, 0xd2bec334, 0x2d413ccc, 0xf383a3e2, 0x3ec52f9f, 
-	0x2899e64a, 0x317900d6, 0xc78e9a1d, 0x1e2b5d38, 0xe7821d5a, 0x3b20d79e, 0x238e7673, 0x3536cc52, 
-	0xc13ad061, 0x0c7c5c1e, 0xdc71898d, 0x3536cc52, 0x1e2b5d38, 0x387165e3, 0xc04ee4b9, 0xf9ba1651, 
-	0xd2bec334, 0x2d413ccc, 0x187de2a6, 0x3b20d79e, 0xc4df2862, 0xe7821d5a, 0xcac933ae, 0x238e7673, 
-	0x1294062e, 0x3d3e82ad, 0xce86ff2a, 0xd76619b6, 0xc4df2862, 0x187de2a6, 0x0c7c5c1e, 0x3ec52f9f, 
-	0xdc71898d, 0xcac933ae, 0xc13ad061, 0x0c7c5c1e, 0x0645e9af, 0x3fb11b47, 0xed6bf9d2, 0xc2c17d53 
+	0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x40000000, 0x00000000, 0x3ec52f9f, 0x0c7c5c1e,
+	0x3fb11b47, 0x0645e9af, 0x3d3e82ad, 0x1294062e, 0x3b20d79e, 0x187de2a6, 0x3ec52f9f, 0x0c7c5c1e,
+	0x3536cc52, 0x238e7673, 0x3536cc52, 0x238e7673, 0x3d3e82ad, 0x1294062e, 0x2899e64a, 0x317900d6,
+	0x2d413ccc, 0x2d413ccc, 0x3b20d79e, 0x187de2a6, 0x187de2a6, 0x3b20d79e, 0x238e7673, 0x3536cc52,
+	0x387165e3, 0x1e2b5d38, 0x0645e9af, 0x3fb11b47, 0x187de2a6, 0x3b20d79e, 0x3536cc52, 0x238e7673,
+	0xf383a3e2, 0x3ec52f9f, 0x0c7c5c1e, 0x3ec52f9f, 0x317900d6, 0x2899e64a, 0xe1d4a2c8, 0x387165e3,
+	0x00000000, 0x40000000, 0x2d413ccc, 0x2d413ccc, 0xd2bec334, 0x2d413ccc, 0xf383a3e2, 0x3ec52f9f,
+	0x2899e64a, 0x317900d6, 0xc78e9a1d, 0x1e2b5d38, 0xe7821d5a, 0x3b20d79e, 0x238e7673, 0x3536cc52,
+	0xc13ad061, 0x0c7c5c1e, 0xdc71898d, 0x3536cc52, 0x1e2b5d38, 0x387165e3, 0xc04ee4b9, 0xf9ba1651,
+	0xd2bec334, 0x2d413ccc, 0x187de2a6, 0x3b20d79e, 0xc4df2862, 0xe7821d5a, 0xcac933ae, 0x238e7673,
+	0x1294062e, 0x3d3e82ad, 0xce86ff2a, 0xd76619b6, 0xc4df2862, 0x187de2a6, 0x0c7c5c1e, 0x3ec52f9f,
+	0xdc71898d, 0xcac933ae, 0xc13ad061, 0x0c7c5c1e, 0x0645e9af, 0x3fb11b47, 0xed6bf9d2, 0xc2c17d53
 };
 #endif  //ARMV5E
 
-const int ShortWindowSine[FRAME_LEN_SHORT/2] ={  
-	0x00c97fff, 0x025b7ffa, 0x03ed7ff1, 0x057f7fe2, 0x07117fce, 0x08a27fb5, 0x0a337f98, 0x0bc47f75, 
-	0x0d547f4e, 0x0ee47f22, 0x10737ef0, 0x12017eba, 0x138f7e7f, 0x151c7e3f, 0x16a87dfb, 0x18337db1, 
-	0x19be7d63, 0x1b477d0f, 0x1cd07cb7, 0x1e577c5a, 0x1fdd7bf9, 0x21627b92, 0x22e57b27, 0x24677ab7, 
-	0x25e87a42, 0x276879c9, 0x28e5794a, 0x2a6278c8, 0x2bdc7840, 0x2d5577b4, 0x2ecc7723, 0x3042768e, 
-	0x31b575f4, 0x33277556, 0x349774b3, 0x3604740b, 0x3770735f, 0x38d972af, 0x3a4071fa, 0x3ba57141, 
-	0x3d087083, 0x3e686fc2, 0x3fc66efb, 0x41216e31, 0x427a6d62, 0x43d16c8f, 0x45246bb8, 0x46756add, 
-	0x47c469fd, 0x490f691a, 0x4a586832, 0x4b9e6747, 0x4ce16657, 0x4e216564, 0x4f5e646c, 0x50986371, 
+const int ShortWindowSine[FRAME_LEN_SHORT/2] ={
+	0x00c97fff, 0x025b7ffa, 0x03ed7ff1, 0x057f7fe2, 0x07117fce, 0x08a27fb5, 0x0a337f98, 0x0bc47f75,
+	0x0d547f4e, 0x0ee47f22, 0x10737ef0, 0x12017eba, 0x138f7e7f, 0x151c7e3f, 0x16a87dfb, 0x18337db1,
+	0x19be7d63, 0x1b477d0f, 0x1cd07cb7, 0x1e577c5a, 0x1fdd7bf9, 0x21627b92, 0x22e57b27, 0x24677ab7,
+	0x25e87a42, 0x276879c9, 0x28e5794a, 0x2a6278c8, 0x2bdc7840, 0x2d5577b4, 0x2ecc7723, 0x3042768e,
+	0x31b575f4, 0x33277556, 0x349774b3, 0x3604740b, 0x3770735f, 0x38d972af, 0x3a4071fa, 0x3ba57141,
+	0x3d087083, 0x3e686fc2, 0x3fc66efb, 0x41216e31, 0x427a6d62, 0x43d16c8f, 0x45246bb8, 0x46756add,
+	0x47c469fd, 0x490f691a, 0x4a586832, 0x4b9e6747, 0x4ce16657, 0x4e216564, 0x4f5e646c, 0x50986371,
 	0x51cf6272, 0x5303616f, 0x54336068, 0x55605f5e, 0x568a5e50, 0x57b15d3e, 0x58d45c29, 0x59f45b10
 };
 
-const int LongWindowKBD[FRAME_LEN_LONG/2]={  
-	0x000a7fff, 0x000e7fff, 0x00127fff, 0x00157fff, 0x00197fff, 0x001c7fff, 0x00207fff, 0x00237fff, 
-	0x00267fff, 0x002a7fff, 0x002d7fff, 0x00307fff, 0x00347fff, 0x00387fff, 0x003b7fff, 0x003f7fff, 
-	0x00437fff, 0x00477fff, 0x004b7fff, 0x004f7fff, 0x00537fff, 0x00577fff, 0x005b7fff, 0x00607fff, 
-	0x00647fff, 0x00697fff, 0x006d7fff, 0x00727fff, 0x00777fff, 0x007c7fff, 0x00817fff, 0x00867fff, 
-	0x008b7fff, 0x00917fff, 0x00967fff, 0x009c7fff, 0x00a17fff, 0x00a77fff, 0x00ad7fff, 0x00b37fff, 
-	0x00b97fff, 0x00bf7fff, 0x00c67fff, 0x00cc7fff, 0x00d37fff, 0x00da7fff, 0x00e07fff, 0x00e77fff, 
-	0x00ee7fff, 0x00f57fff, 0x00fd7fff, 0x01047fff, 0x010c7fff, 0x01137fff, 0x011b7fff, 0x01237fff, 
-	0x012b7fff, 0x01337fff, 0x013c7ffe, 0x01447ffe, 0x014d7ffe, 0x01567ffe, 0x015f7ffe, 0x01687ffe, 
-	0x01717ffe, 0x017a7ffe, 0x01837ffe, 0x018d7ffe, 0x01977ffd, 0x01a17ffd, 0x01ab7ffd, 0x01b57ffd, 
-	0x01bf7ffd, 0x01ca7ffd, 0x01d47ffd, 0x01df7ffc, 0x01ea7ffc, 0x01f57ffc, 0x02007ffc, 0x020c7ffc, 
-	0x02177ffc, 0x02237ffb, 0x022f7ffb, 0x023b7ffb, 0x02477ffb, 0x02537ffb, 0x02607ffa, 0x026d7ffa, 
-	0x027a7ffa, 0x02877ffa, 0x02947ff9, 0x02a17ff9, 0x02af7ff9, 0x02bc7ff9, 0x02ca7ff8, 0x02d87ff8, 
-	0x02e77ff8, 0x02f57ff7, 0x03047ff7, 0x03127ff7, 0x03217ff6, 0x03317ff6, 0x03407ff5, 0x034f7ff5, 
-	0x035f7ff5, 0x036f7ff4, 0x037f7ff4, 0x038f7ff3, 0x03a07ff3, 0x03b07ff2, 0x03c17ff2, 0x03d27ff1, 
-	0x03e37ff1, 0x03f57ff0, 0x04067ff0, 0x04187fef, 0x042a7fef, 0x043c7fee, 0x044f7fed, 0x04617fed, 
-	0x04747fec, 0x04877feb, 0x049a7feb, 0x04ae7fea, 0x04c17fe9, 0x04d57fe9, 0x04e97fe8, 0x04fd7fe7, 
-	0x05127fe6, 0x05277fe5, 0x053b7fe5, 0x05507fe4, 0x05667fe3, 0x057b7fe2, 0x05917fe1, 0x05a77fe0, 
-	0x05bd7fdf, 0x05d37fde, 0x05ea7fdd, 0x06017fdc, 0x06187fdb, 0x062f7fda, 0x06467fd9, 0x065e7fd7, 
-	0x06767fd6, 0x068e7fd5, 0x06a67fd4, 0x06bf7fd2, 0x06d87fd1, 0x06f17fd0, 0x070a7fce, 0x07237fcd, 
-	0x073d7fcc, 0x07577fca, 0x07717fc9, 0x078c7fc7, 0x07a67fc5, 0x07c17fc4, 0x07dc7fc2, 0x07f77fc0, 
-	0x08137fbf, 0x082f7fbd, 0x084b7fbb, 0x08677fb9, 0x08847fb7, 0x08a07fb6, 0x08bd7fb4, 0x08da7fb2, 
-	0x08f87faf, 0x09167fad, 0x09347fab, 0x09527fa9, 0x09707fa7, 0x098f7fa5, 0x09ae7fa2, 0x09cd7fa0, 
-	0x09ec7f9d, 0x0a0c7f9b, 0x0a2c7f98, 0x0a4c7f96, 0x0a6c7f93, 0x0a8d7f91, 0x0aae7f8e, 0x0acf7f8b, 
-	0x0af07f88, 0x0b127f85, 0x0b337f82, 0x0b557f7f, 0x0b787f7c, 0x0b9a7f79, 0x0bbd7f76, 0x0be07f73, 
-	0x0c047f6f, 0x0c277f6c, 0x0c4b7f69, 0x0c6f7f65, 0x0c937f61, 0x0cb87f5e, 0x0cdd7f5a, 0x0d027f56, 
-	0x0d277f53, 0x0d4d7f4f, 0x0d737f4b, 0x0d997f47, 0x0dbf7f43, 0x0de67f3e, 0x0e0c7f3a, 0x0e347f36, 
-	0x0e5b7f31, 0x0e837f2d, 0x0eaa7f28, 0x0ed37f24, 0x0efb7f1f, 0x0f237f1a, 0x0f4c7f15, 0x0f757f10, 
-	0x0f9f7f0b, 0x0fc87f06, 0x0ff27f01, 0x101c7efb, 0x10477ef6, 0x10717ef0, 0x109c7eeb, 0x10c87ee5, 
-	0x10f37edf, 0x111f7eda, 0x114a7ed4, 0x11777ece, 0x11a37ec7, 0x11d07ec1, 0x11fd7ebb, 0x122a7eb4, 
-	0x12577eae, 0x12857ea7, 0x12b37ea0, 0x12e17e9a, 0x130f7e93, 0x133e7e8c, 0x136d7e84, 0x139c7e7d, 
-	0x13cc7e76, 0x13fb7e6e, 0x142b7e67, 0x145b7e5f, 0x148c7e57, 0x14bc7e4f, 0x14ed7e47, 0x151e7e3f, 
-	0x15507e37, 0x15817e2e, 0x15b37e26, 0x15e57e1d, 0x16187e14, 0x164a7e0b, 0x167d7e02, 0x16b07df9, 
-	0x16e47df0, 0x17177de6, 0x174b7ddd, 0x177f7dd3, 0x17b37dc9, 0x17e87dbf, 0x181d7db5, 0x18527dab, 
-	0x18877da1, 0x18bc7d96, 0x18f27d8c, 0x19287d81, 0x195e7d76, 0x19957d6b, 0x19cb7d60, 0x1a027d54, 
-	0x1a397d49, 0x1a717d3d, 0x1aa87d31, 0x1ae07d26, 0x1b187d19, 0x1b507d0d, 0x1b897d01, 0x1bc27cf4, 
-	0x1bfb7ce8, 0x1c347cdb, 0x1c6d7cce, 0x1ca77cc1, 0x1ce17cb3, 0x1d1b7ca6, 0x1d557c98, 0x1d8f7c8a, 
-	0x1dca7c7c, 0x1e057c6e, 0x1e407c60, 0x1e7b7c51, 0x1eb77c43, 0x1ef37c34, 0x1f2f7c25, 0x1f6b7c16, 
-	0x1fa77c06, 0x1fe47bf7, 0x20217be7, 0x205e7bd7, 0x209b7bc7, 0x20d87bb7, 0x21167ba6, 0x21547b96, 
-	0x21927b85, 0x21d07b74, 0x220e7b63, 0x224d7b52, 0x228c7b40, 0x22cb7b2e, 0x230a7b1c, 0x23497b0a, 
-	0x23897af8, 0x23c87ae6, 0x24087ad3, 0x24487ac0, 0x24897aad, 0x24c97a9a, 0x250a7a86, 0x254b7a73, 
-	0x258c7a5f, 0x25cd7a4b, 0x260e7a36, 0x26507a22, 0x26917a0d, 0x26d379f8, 0x271579e3, 0x275779ce, 
-	0x279a79b8, 0x27dc79a3, 0x281f798d, 0x28627977, 0x28a57960, 0x28e8794a, 0x292b7933, 0x296f791c, 
-	0x29b27905, 0x29f678ed, 0x2a3a78d6, 0x2a7e78be, 0x2ac278a6, 0x2b07788d, 0x2b4b7875, 0x2b90785c, 
-	0x2bd47843, 0x2c19782a, 0x2c5e7810, 0x2ca477f7, 0x2ce977dd, 0x2d2e77c3, 0x2d7477a8, 0x2dba778e, 
-	0x2dff7773, 0x2e457758, 0x2e8b773d, 0x2ed27721, 0x2f187706, 0x2f5e76ea, 0x2fa576cd, 0x2fec76b1, 
-	0x30327694, 0x30797677, 0x30c0765a, 0x3107763d, 0x314e761f, 0x31967601, 0x31dd75e3, 0x322575c5, 
-	0x326c75a6, 0x32b47588, 0x32fc7569, 0x33447549, 0x338c752a, 0x33d4750a, 0x341c74ea, 0x346474ca, 
-	0x34ac74a9, 0x34f57488, 0x353d7467, 0x35857446, 0x35ce7424, 0x36177403, 0x365f73e1, 0x36a873be, 
-	0x36f1739c, 0x373a7379, 0x37837356, 0x37cc7333, 0x3815730f, 0x385e72ec, 0x38a772c8, 0x38f172a3, 
-	0x393a727f, 0x3983725a, 0x39cd7235, 0x3a167210, 0x3a6071ea, 0x3aa971c4, 0x3af3719e, 0x3b3c7178, 
-	0x3b867151, 0x3bd0712b, 0x3c197104, 0x3c6370dc, 0x3cad70b5, 0x3cf7708d, 0x3d407065, 0x3d8a703c, 
-	0x3dd47014, 0x3e1e6feb, 0x3e686fc2, 0x3eb16f98, 0x3efb6f6f, 0x3f456f45, 0x3f8f6f1b, 0x3fd96ef0, 
-	0x40236ec6, 0x406d6e9b, 0x40b66e70, 0x41006e44, 0x414a6e19, 0x41946ded, 0x41de6dc1, 0x42286d94, 
-	0x42716d68, 0x42bb6d3b, 0x43056d0d, 0x434f6ce0, 0x43986cb2, 0x43e26c84, 0x442c6c56, 0x44756c28, 
-	0x44bf6bf9, 0x45086bca, 0x45526b9b, 0x459b6b6b, 0x45e56b3c, 0x462e6b0c, 0x46786adb, 0x46c16aab, 
-	0x470a6a7a, 0x47536a49, 0x479c6a18, 0x47e569e7, 0x482e69b5, 0x48776983, 0x48c06951, 0x4909691e, 
-	0x495268ec, 0x499b68b9, 0x49e36885, 0x4a2c6852, 0x4a74681e, 0x4abd67ea, 0x4b0567b6, 0x4b4d6782, 
-	0x4b95674d, 0x4bde6718, 0x4c2666e3, 0x4c6d66ae, 0x4cb56678, 0x4cfd6642, 0x4d45660c, 0x4d8c65d6, 
-	0x4dd4659f, 0x4e1b6568, 0x4e626531, 0x4ea964fa, 0x4ef064c3, 0x4f37648b, 0x4f7e6453, 0x4fc5641b, 
-	0x500b63e2, 0x505263aa, 0x50986371, 0x50df6338, 0x512562fe, 0x516b62c5, 0x51b1628b, 0x51f66251, 
-	0x523c6217, 0x528161dc, 0x52c761a2, 0x530c6167, 0x5351612c, 0x539660f1, 0x53db60b5, 0x54206079, 
-	0x5464603d, 0x54a96001, 0x54ed5fc5, 0x55315f88, 0x55755f4b, 0x55b95f0e, 0x55fc5ed1, 0x56405e94, 
-	0x56835e56, 0x56c75e18, 0x570a5dda, 0x574d5d9c, 0x578f5d5e, 0x57d25d1f, 0x58145ce0, 0x58565ca1, 
+const int LongWindowKBD[FRAME_LEN_LONG/2]={
+	0x000a7fff, 0x000e7fff, 0x00127fff, 0x00157fff, 0x00197fff, 0x001c7fff, 0x00207fff, 0x00237fff,
+	0x00267fff, 0x002a7fff, 0x002d7fff, 0x00307fff, 0x00347fff, 0x00387fff, 0x003b7fff, 0x003f7fff,
+	0x00437fff, 0x00477fff, 0x004b7fff, 0x004f7fff, 0x00537fff, 0x00577fff, 0x005b7fff, 0x00607fff,
+	0x00647fff, 0x00697fff, 0x006d7fff, 0x00727fff, 0x00777fff, 0x007c7fff, 0x00817fff, 0x00867fff,
+	0x008b7fff, 0x00917fff, 0x00967fff, 0x009c7fff, 0x00a17fff, 0x00a77fff, 0x00ad7fff, 0x00b37fff,
+	0x00b97fff, 0x00bf7fff, 0x00c67fff, 0x00cc7fff, 0x00d37fff, 0x00da7fff, 0x00e07fff, 0x00e77fff,
+	0x00ee7fff, 0x00f57fff, 0x00fd7fff, 0x01047fff, 0x010c7fff, 0x01137fff, 0x011b7fff, 0x01237fff,
+	0x012b7fff, 0x01337fff, 0x013c7ffe, 0x01447ffe, 0x014d7ffe, 0x01567ffe, 0x015f7ffe, 0x01687ffe,
+	0x01717ffe, 0x017a7ffe, 0x01837ffe, 0x018d7ffe, 0x01977ffd, 0x01a17ffd, 0x01ab7ffd, 0x01b57ffd,
+	0x01bf7ffd, 0x01ca7ffd, 0x01d47ffd, 0x01df7ffc, 0x01ea7ffc, 0x01f57ffc, 0x02007ffc, 0x020c7ffc,
+	0x02177ffc, 0x02237ffb, 0x022f7ffb, 0x023b7ffb, 0x02477ffb, 0x02537ffb, 0x02607ffa, 0x026d7ffa,
+	0x027a7ffa, 0x02877ffa, 0x02947ff9, 0x02a17ff9, 0x02af7ff9, 0x02bc7ff9, 0x02ca7ff8, 0x02d87ff8,
+	0x02e77ff8, 0x02f57ff7, 0x03047ff7, 0x03127ff7, 0x03217ff6, 0x03317ff6, 0x03407ff5, 0x034f7ff5,
+	0x035f7ff5, 0x036f7ff4, 0x037f7ff4, 0x038f7ff3, 0x03a07ff3, 0x03b07ff2, 0x03c17ff2, 0x03d27ff1,
+	0x03e37ff1, 0x03f57ff0, 0x04067ff0, 0x04187fef, 0x042a7fef, 0x043c7fee, 0x044f7fed, 0x04617fed,
+	0x04747fec, 0x04877feb, 0x049a7feb, 0x04ae7fea, 0x04c17fe9, 0x04d57fe9, 0x04e97fe8, 0x04fd7fe7,
+	0x05127fe6, 0x05277fe5, 0x053b7fe5, 0x05507fe4, 0x05667fe3, 0x057b7fe2, 0x05917fe1, 0x05a77fe0,
+	0x05bd7fdf, 0x05d37fde, 0x05ea7fdd, 0x06017fdc, 0x06187fdb, 0x062f7fda, 0x06467fd9, 0x065e7fd7,
+	0x06767fd6, 0x068e7fd5, 0x06a67fd4, 0x06bf7fd2, 0x06d87fd1, 0x06f17fd0, 0x070a7fce, 0x07237fcd,
+	0x073d7fcc, 0x07577fca, 0x07717fc9, 0x078c7fc7, 0x07a67fc5, 0x07c17fc4, 0x07dc7fc2, 0x07f77fc0,
+	0x08137fbf, 0x082f7fbd, 0x084b7fbb, 0x08677fb9, 0x08847fb7, 0x08a07fb6, 0x08bd7fb4, 0x08da7fb2,
+	0x08f87faf, 0x09167fad, 0x09347fab, 0x09527fa9, 0x09707fa7, 0x098f7fa5, 0x09ae7fa2, 0x09cd7fa0,
+	0x09ec7f9d, 0x0a0c7f9b, 0x0a2c7f98, 0x0a4c7f96, 0x0a6c7f93, 0x0a8d7f91, 0x0aae7f8e, 0x0acf7f8b,
+	0x0af07f88, 0x0b127f85, 0x0b337f82, 0x0b557f7f, 0x0b787f7c, 0x0b9a7f79, 0x0bbd7f76, 0x0be07f73,
+	0x0c047f6f, 0x0c277f6c, 0x0c4b7f69, 0x0c6f7f65, 0x0c937f61, 0x0cb87f5e, 0x0cdd7f5a, 0x0d027f56,
+	0x0d277f53, 0x0d4d7f4f, 0x0d737f4b, 0x0d997f47, 0x0dbf7f43, 0x0de67f3e, 0x0e0c7f3a, 0x0e347f36,
+	0x0e5b7f31, 0x0e837f2d, 0x0eaa7f28, 0x0ed37f24, 0x0efb7f1f, 0x0f237f1a, 0x0f4c7f15, 0x0f757f10,
+	0x0f9f7f0b, 0x0fc87f06, 0x0ff27f01, 0x101c7efb, 0x10477ef6, 0x10717ef0, 0x109c7eeb, 0x10c87ee5,
+	0x10f37edf, 0x111f7eda, 0x114a7ed4, 0x11777ece, 0x11a37ec7, 0x11d07ec1, 0x11fd7ebb, 0x122a7eb4,
+	0x12577eae, 0x12857ea7, 0x12b37ea0, 0x12e17e9a, 0x130f7e93, 0x133e7e8c, 0x136d7e84, 0x139c7e7d,
+	0x13cc7e76, 0x13fb7e6e, 0x142b7e67, 0x145b7e5f, 0x148c7e57, 0x14bc7e4f, 0x14ed7e47, 0x151e7e3f,
+	0x15507e37, 0x15817e2e, 0x15b37e26, 0x15e57e1d, 0x16187e14, 0x164a7e0b, 0x167d7e02, 0x16b07df9,
+	0x16e47df0, 0x17177de6, 0x174b7ddd, 0x177f7dd3, 0x17b37dc9, 0x17e87dbf, 0x181d7db5, 0x18527dab,
+	0x18877da1, 0x18bc7d96, 0x18f27d8c, 0x19287d81, 0x195e7d76, 0x19957d6b, 0x19cb7d60, 0x1a027d54,
+	0x1a397d49, 0x1a717d3d, 0x1aa87d31, 0x1ae07d26, 0x1b187d19, 0x1b507d0d, 0x1b897d01, 0x1bc27cf4,
+	0x1bfb7ce8, 0x1c347cdb, 0x1c6d7cce, 0x1ca77cc1, 0x1ce17cb3, 0x1d1b7ca6, 0x1d557c98, 0x1d8f7c8a,
+	0x1dca7c7c, 0x1e057c6e, 0x1e407c60, 0x1e7b7c51, 0x1eb77c43, 0x1ef37c34, 0x1f2f7c25, 0x1f6b7c16,
+	0x1fa77c06, 0x1fe47bf7, 0x20217be7, 0x205e7bd7, 0x209b7bc7, 0x20d87bb7, 0x21167ba6, 0x21547b96,
+	0x21927b85, 0x21d07b74, 0x220e7b63, 0x224d7b52, 0x228c7b40, 0x22cb7b2e, 0x230a7b1c, 0x23497b0a,
+	0x23897af8, 0x23c87ae6, 0x24087ad3, 0x24487ac0, 0x24897aad, 0x24c97a9a, 0x250a7a86, 0x254b7a73,
+	0x258c7a5f, 0x25cd7a4b, 0x260e7a36, 0x26507a22, 0x26917a0d, 0x26d379f8, 0x271579e3, 0x275779ce,
+	0x279a79b8, 0x27dc79a3, 0x281f798d, 0x28627977, 0x28a57960, 0x28e8794a, 0x292b7933, 0x296f791c,
+	0x29b27905, 0x29f678ed, 0x2a3a78d6, 0x2a7e78be, 0x2ac278a6, 0x2b07788d, 0x2b4b7875, 0x2b90785c,
+	0x2bd47843, 0x2c19782a, 0x2c5e7810, 0x2ca477f7, 0x2ce977dd, 0x2d2e77c3, 0x2d7477a8, 0x2dba778e,
+	0x2dff7773, 0x2e457758, 0x2e8b773d, 0x2ed27721, 0x2f187706, 0x2f5e76ea, 0x2fa576cd, 0x2fec76b1,
+	0x30327694, 0x30797677, 0x30c0765a, 0x3107763d, 0x314e761f, 0x31967601, 0x31dd75e3, 0x322575c5,
+	0x326c75a6, 0x32b47588, 0x32fc7569, 0x33447549, 0x338c752a, 0x33d4750a, 0x341c74ea, 0x346474ca,
+	0x34ac74a9, 0x34f57488, 0x353d7467, 0x35857446, 0x35ce7424, 0x36177403, 0x365f73e1, 0x36a873be,
+	0x36f1739c, 0x373a7379, 0x37837356, 0x37cc7333, 0x3815730f, 0x385e72ec, 0x38a772c8, 0x38f172a3,
+	0x393a727f, 0x3983725a, 0x39cd7235, 0x3a167210, 0x3a6071ea, 0x3aa971c4, 0x3af3719e, 0x3b3c7178,
+	0x3b867151, 0x3bd0712b, 0x3c197104, 0x3c6370dc, 0x3cad70b5, 0x3cf7708d, 0x3d407065, 0x3d8a703c,
+	0x3dd47014, 0x3e1e6feb, 0x3e686fc2, 0x3eb16f98, 0x3efb6f6f, 0x3f456f45, 0x3f8f6f1b, 0x3fd96ef0,
+	0x40236ec6, 0x406d6e9b, 0x40b66e70, 0x41006e44, 0x414a6e19, 0x41946ded, 0x41de6dc1, 0x42286d94,
+	0x42716d68, 0x42bb6d3b, 0x43056d0d, 0x434f6ce0, 0x43986cb2, 0x43e26c84, 0x442c6c56, 0x44756c28,
+	0x44bf6bf9, 0x45086bca, 0x45526b9b, 0x459b6b6b, 0x45e56b3c, 0x462e6b0c, 0x46786adb, 0x46c16aab,
+	0x470a6a7a, 0x47536a49, 0x479c6a18, 0x47e569e7, 0x482e69b5, 0x48776983, 0x48c06951, 0x4909691e,
+	0x495268ec, 0x499b68b9, 0x49e36885, 0x4a2c6852, 0x4a74681e, 0x4abd67ea, 0x4b0567b6, 0x4b4d6782,
+	0x4b95674d, 0x4bde6718, 0x4c2666e3, 0x4c6d66ae, 0x4cb56678, 0x4cfd6642, 0x4d45660c, 0x4d8c65d6,
+	0x4dd4659f, 0x4e1b6568, 0x4e626531, 0x4ea964fa, 0x4ef064c3, 0x4f37648b, 0x4f7e6453, 0x4fc5641b,
+	0x500b63e2, 0x505263aa, 0x50986371, 0x50df6338, 0x512562fe, 0x516b62c5, 0x51b1628b, 0x51f66251,
+	0x523c6217, 0x528161dc, 0x52c761a2, 0x530c6167, 0x5351612c, 0x539660f1, 0x53db60b5, 0x54206079,
+	0x5464603d, 0x54a96001, 0x54ed5fc5, 0x55315f88, 0x55755f4b, 0x55b95f0e, 0x55fc5ed1, 0x56405e94,
+	0x56835e56, 0x56c75e18, 0x570a5dda, 0x574d5d9c, 0x578f5d5e, 0x57d25d1f, 0x58145ce0, 0x58565ca1,
 	0x58995c62, 0x58da5c23, 0x591c5be3, 0x595e5ba4, 0x599f5b64, 0x59e05b24, 0x5a215ae3, 0x5a625aa3
 };
 
@@ -1070,277 +1070,277 @@
 
   \brief   these tables are used for the non
            linear quantizer and inverse quantizer
-           
+
 */
 const Word32 mTab_3_4[512] = {
-	0x4c1bf829, 0x4c3880de, 0x4c550603, 0x4c71879c, 
-	0x4c8e05aa, 0x4caa8030, 0x4cc6f72f, 0x4ce36aab, 
-	0x4cffdaa4, 0x4d1c471d, 0x4d38b019, 0x4d55159a, 
-	0x4d7177a1, 0x4d8dd631, 0x4daa314b, 0x4dc688f3, 
-	0x4de2dd2a, 0x4dff2df2, 0x4e1b7b4d, 0x4e37c53d, 
-	0x4e540bc5, 0x4e704ee6, 0x4e8c8ea3, 0x4ea8cafd, 
-	0x4ec503f7, 0x4ee13992, 0x4efd6bd0, 0x4f199ab4, 
-	0x4f35c640, 0x4f51ee75, 0x4f6e1356, 0x4f8a34e4, 
-	0x4fa65321, 0x4fc26e10, 0x4fde85b2, 0x4ffa9a0a, 
-	0x5016ab18, 0x5032b8e0, 0x504ec362, 0x506acaa1, 
-	0x5086cea0, 0x50a2cf5e, 0x50becce0, 0x50dac725, 
-	0x50f6be31, 0x5112b205, 0x512ea2a3, 0x514a900d, 
-	0x51667a45, 0x5182614c, 0x519e4524, 0x51ba25cf, 
-	0x51d60350, 0x51f1dda7, 0x520db4d6, 0x522988e0, 
-	0x524559c6, 0x52612789, 0x527cf22d, 0x5298b9b1, 
-	0x52b47e19, 0x52d03f65, 0x52ebfd98, 0x5307b8b4, 
-	0x532370b9, 0x533f25aa, 0x535ad789, 0x53768656, 
-	0x53923215, 0x53addac6, 0x53c9806b, 0x53e52306, 
-	0x5400c298, 0x541c5f24, 0x5437f8ab, 0x54538f2e, 
-	0x546f22af, 0x548ab330, 0x54a640b3, 0x54c1cb38, 
-	0x54dd52c2, 0x54f8d753, 0x551458eb, 0x552fd78d, 
-	0x554b5339, 0x5566cbf3, 0x558241bb, 0x559db492, 
-	0x55b9247b, 0x55d49177, 0x55effb87, 0x560b62ad, 
-	0x5626c6eb, 0x56422842, 0x565d86b4, 0x5678e242, 
-	0x56943aee, 0x56af90b9, 0x56cae3a4, 0x56e633b2, 
-	0x570180e4, 0x571ccb3b, 0x573812b8, 0x5753575e, 
-	0x576e992e, 0x5789d829, 0x57a51450, 0x57c04da6, 
-	0x57db842b, 0x57f6b7e1, 0x5811e8c9, 0x582d16e6, 
-	0x58484238, 0x58636ac0, 0x587e9081, 0x5899b37c, 
-	0x58b4d3b1, 0x58cff123, 0x58eb0bd3, 0x590623c2, 
-	0x592138f2, 0x593c4b63, 0x59575b19, 0x59726812, 
-	0x598d7253, 0x59a879da, 0x59c37eab, 0x59de80c6, 
-	0x59f9802d, 0x5a147ce0, 0x5a2f76e2, 0x5a4a6e34, 
-	0x5a6562d6, 0x5a8054cb, 0x5a9b4414, 0x5ab630b2, 
-	0x5ad11aa6, 0x5aec01f1, 0x5b06e696, 0x5b21c895, 
-	0x5b3ca7ef, 0x5b5784a6, 0x5b725ebc, 0x5b8d3631, 
-	0x5ba80b06, 0x5bc2dd3e, 0x5bddacd9, 0x5bf879d8, 
-	0x5c13443d, 0x5c2e0c09, 0x5c48d13e, 0x5c6393dc, 
-	0x5c7e53e5, 0x5c99115a, 0x5cb3cc3c, 0x5cce848d, 
-	0x5ce93a4e, 0x5d03ed80, 0x5d1e9e24, 0x5d394c3b, 
-	0x5d53f7c7, 0x5d6ea0c9, 0x5d894742, 0x5da3eb33, 
-	0x5dbe8c9e, 0x5dd92b84, 0x5df3c7e5, 0x5e0e61c3, 
-	0x5e28f920, 0x5e438dfc, 0x5e5e2059, 0x5e78b037, 
-	0x5e933d99, 0x5eadc87e, 0x5ec850e9, 0x5ee2d6da, 
-	0x5efd5a53, 0x5f17db54, 0x5f3259e0, 0x5f4cd5f6, 
-	0x5f674f99, 0x5f81c6c8, 0x5f9c3b87, 0x5fb6add4, 
-	0x5fd11db3, 0x5feb8b23, 0x6005f626, 0x60205ebd, 
-	0x603ac4e9, 0x605528ac, 0x606f8a05, 0x6089e8f7, 
-	0x60a44583, 0x60be9fa9, 0x60d8f76b, 0x60f34cca, 
-	0x610d9fc7, 0x6127f062, 0x61423e9e, 0x615c8a7a, 
-	0x6176d3f9, 0x61911b1b, 0x61ab5fe1, 0x61c5a24d, 
-	0x61dfe25f, 0x61fa2018, 0x62145b7a, 0x622e9485, 
-	0x6248cb3b, 0x6262ff9d, 0x627d31ab, 0x62976167, 
-	0x62b18ed1, 0x62cbb9eb, 0x62e5e2b6, 0x63000933, 
-	0x631a2d62, 0x63344f45, 0x634e6edd, 0x63688c2b, 
-	0x6382a730, 0x639cbfec, 0x63b6d661, 0x63d0ea90, 
-	0x63eafc7a, 0x64050c1f, 0x641f1982, 0x643924a2, 
-	0x64532d80, 0x646d341f, 0x6487387e, 0x64a13a9e, 
-	0x64bb3a81, 0x64d53828, 0x64ef3393, 0x65092cc4, 
-	0x652323bb, 0x653d1879, 0x65570b00, 0x6570fb50, 
-	0x658ae96b, 0x65a4d550, 0x65bebf01, 0x65d8a680, 
-	0x65f28bcc, 0x660c6ee8, 0x66264fd3, 0x66402e8f, 
-	0x665a0b1c, 0x6673e57d, 0x668dbdb0, 0x66a793b8, 
-	0x66c16795, 0x66db3949, 0x66f508d4, 0x670ed636, 
-	0x6728a172, 0x67426a87, 0x675c3177, 0x6775f643, 
-	0x678fb8eb, 0x67a97971, 0x67c337d5, 0x67dcf418, 
-	0x67f6ae3b, 0x6810663f, 0x682a1c25, 0x6843cfed, 
-	0x685d8199, 0x68773129, 0x6890de9f, 0x68aa89fa, 
-	0x68c4333d, 0x68ddda67, 0x68f77f7a, 0x69112277, 
-	0x692ac35e, 0x69446230, 0x695dfeee, 0x6977999a, 
-	0x69913232, 0x69aac8ba, 0x69c45d31, 0x69ddef98, 
-	0x69f77ff0, 0x6a110e3a, 0x6a2a9a77, 0x6a4424a8, 
-	0x6a5daccc, 0x6a7732e6, 0x6a90b6f6, 0x6aaa38fd, 
-	0x6ac3b8fb, 0x6add36f2, 0x6af6b2e2, 0x6b102ccd, 
-	0x6b29a4b2, 0x6b431a92, 0x6b5c8e6f, 0x6b76004a, 
-	0x6b8f7022, 0x6ba8ddf9, 0x6bc249d0, 0x6bdbb3a7, 
-	0x6bf51b80, 0x6c0e815a, 0x6c27e537, 0x6c414718, 
-	0x6c5aa6fd, 0x6c7404e7, 0x6c8d60d7, 0x6ca6bace, 
-	0x6cc012cc, 0x6cd968d2, 0x6cf2bce1, 0x6d0c0ef9, 
-	0x6d255f1d, 0x6d3ead4b, 0x6d57f985, 0x6d7143cc, 
-	0x6d8a8c21, 0x6da3d283, 0x6dbd16f5, 0x6dd65976, 
-	0x6def9a08, 0x6e08d8ab, 0x6e221560, 0x6e3b5027, 
-	0x6e548902, 0x6e6dbff1, 0x6e86f4f5, 0x6ea0280e, 
-	0x6eb9593e, 0x6ed28885, 0x6eebb5e3, 0x6f04e15a, 
-	0x6f1e0aea, 0x6f373294, 0x6f505859, 0x6f697c39, 
-	0x6f829e35, 0x6f9bbe4e, 0x6fb4dc85, 0x6fcdf8d9, 
-	0x6fe7134d, 0x70002be0, 0x70194293, 0x70325767, 
-	0x704b6a5d, 0x70647b76, 0x707d8ab1, 0x70969811, 
-	0x70afa394, 0x70c8ad3d, 0x70e1b50c, 0x70fabb01, 
-	0x7113bf1d, 0x712cc161, 0x7145c1ce, 0x715ec064, 
-	0x7177bd24, 0x7190b80f, 0x71a9b124, 0x71c2a866, 
-	0x71db9dd4, 0x71f49170, 0x720d8339, 0x72267331, 
-	0x723f6159, 0x72584db0, 0x72713838, 0x728a20f1, 
-	0x72a307db, 0x72bbecf9, 0x72d4d049, 0x72edb1ce, 
-	0x73069187, 0x731f6f75, 0x73384b98, 0x735125f3, 
-	0x7369fe84, 0x7382d54d, 0x739baa4e, 0x73b47d89, 
-	0x73cd4efd, 0x73e61eab, 0x73feec94, 0x7417b8b8, 
-	0x74308319, 0x74494bb6, 0x74621291, 0x747ad7aa, 
-	0x74939b02, 0x74ac5c98, 0x74c51c6f, 0x74ddda86, 
-	0x74f696de, 0x750f5178, 0x75280a54, 0x7540c174, 
-	0x755976d7, 0x75722a7e, 0x758adc69, 0x75a38c9b, 
-	0x75bc3b12, 0x75d4e7cf, 0x75ed92d4, 0x76063c21, 
-	0x761ee3b6, 0x76378994, 0x76502dbc, 0x7668d02e, 
-	0x768170eb, 0x769a0ff3, 0x76b2ad47, 0x76cb48e7, 
-	0x76e3e2d5, 0x76fc7b10, 0x7715119a, 0x772da673, 
-	0x7746399b, 0x775ecb13, 0x77775adc, 0x778fe8f6, 
-	0x77a87561, 0x77c1001f, 0x77d98930, 0x77f21095, 
-	0x780a964d, 0x78231a5b, 0x783b9cbd, 0x78541d75, 
-	0x786c9c84, 0x788519e9, 0x789d95a6, 0x78b60fbb, 
-	0x78ce8828, 0x78e6feef, 0x78ff740f, 0x7917e78a, 
-	0x7930595f, 0x7948c990, 0x7961381d, 0x7979a506, 
-	0x7992104c, 0x79aa79f0, 0x79c2e1f1, 0x79db4852, 
-	0x79f3ad11, 0x7a0c1031, 0x7a2471b0, 0x7a3cd191, 
-	0x7a552fd3, 0x7a6d8c76, 0x7a85e77d, 0x7a9e40e6, 
-	0x7ab698b2, 0x7aceeee3, 0x7ae74378, 0x7aff9673, 
-	0x7b17e7d2, 0x7b303799, 0x7b4885c5, 0x7b60d259, 
-	0x7b791d55, 0x7b9166b9, 0x7ba9ae86, 0x7bc1f4bc, 
-	0x7bda395c, 0x7bf27c66, 0x7c0abddb, 0x7c22fdbb, 
-	0x7c3b3c07, 0x7c5378c0, 0x7c6bb3e5, 0x7c83ed78, 
-	0x7c9c2579, 0x7cb45be9, 0x7ccc90c7, 0x7ce4c414, 
-	0x7cfcf5d2, 0x7d152600, 0x7d2d549f, 0x7d4581b0, 
-	0x7d5dad32, 0x7d75d727, 0x7d8dff8f, 0x7da6266a, 
-	0x7dbe4bba, 0x7dd66f7d, 0x7dee91b6, 0x7e06b264, 
-	0x7e1ed188, 0x7e36ef22, 0x7e4f0b34, 0x7e6725bd, 
-	0x7e7f3ebd, 0x7e975636, 0x7eaf6c28, 0x7ec78093, 
-	0x7edf9378, 0x7ef7a4d7, 0x7f0fb4b1, 0x7f27c307, 
-	0x7f3fcfd8, 0x7f57db25, 0x7f6fe4ef, 0x7f87ed36, 
+	0x4c1bf829, 0x4c3880de, 0x4c550603, 0x4c71879c,
+	0x4c8e05aa, 0x4caa8030, 0x4cc6f72f, 0x4ce36aab,
+	0x4cffdaa4, 0x4d1c471d, 0x4d38b019, 0x4d55159a,
+	0x4d7177a1, 0x4d8dd631, 0x4daa314b, 0x4dc688f3,
+	0x4de2dd2a, 0x4dff2df2, 0x4e1b7b4d, 0x4e37c53d,
+	0x4e540bc5, 0x4e704ee6, 0x4e8c8ea3, 0x4ea8cafd,
+	0x4ec503f7, 0x4ee13992, 0x4efd6bd0, 0x4f199ab4,
+	0x4f35c640, 0x4f51ee75, 0x4f6e1356, 0x4f8a34e4,
+	0x4fa65321, 0x4fc26e10, 0x4fde85b2, 0x4ffa9a0a,
+	0x5016ab18, 0x5032b8e0, 0x504ec362, 0x506acaa1,
+	0x5086cea0, 0x50a2cf5e, 0x50becce0, 0x50dac725,
+	0x50f6be31, 0x5112b205, 0x512ea2a3, 0x514a900d,
+	0x51667a45, 0x5182614c, 0x519e4524, 0x51ba25cf,
+	0x51d60350, 0x51f1dda7, 0x520db4d6, 0x522988e0,
+	0x524559c6, 0x52612789, 0x527cf22d, 0x5298b9b1,
+	0x52b47e19, 0x52d03f65, 0x52ebfd98, 0x5307b8b4,
+	0x532370b9, 0x533f25aa, 0x535ad789, 0x53768656,
+	0x53923215, 0x53addac6, 0x53c9806b, 0x53e52306,
+	0x5400c298, 0x541c5f24, 0x5437f8ab, 0x54538f2e,
+	0x546f22af, 0x548ab330, 0x54a640b3, 0x54c1cb38,
+	0x54dd52c2, 0x54f8d753, 0x551458eb, 0x552fd78d,
+	0x554b5339, 0x5566cbf3, 0x558241bb, 0x559db492,
+	0x55b9247b, 0x55d49177, 0x55effb87, 0x560b62ad,
+	0x5626c6eb, 0x56422842, 0x565d86b4, 0x5678e242,
+	0x56943aee, 0x56af90b9, 0x56cae3a4, 0x56e633b2,
+	0x570180e4, 0x571ccb3b, 0x573812b8, 0x5753575e,
+	0x576e992e, 0x5789d829, 0x57a51450, 0x57c04da6,
+	0x57db842b, 0x57f6b7e1, 0x5811e8c9, 0x582d16e6,
+	0x58484238, 0x58636ac0, 0x587e9081, 0x5899b37c,
+	0x58b4d3b1, 0x58cff123, 0x58eb0bd3, 0x590623c2,
+	0x592138f2, 0x593c4b63, 0x59575b19, 0x59726812,
+	0x598d7253, 0x59a879da, 0x59c37eab, 0x59de80c6,
+	0x59f9802d, 0x5a147ce0, 0x5a2f76e2, 0x5a4a6e34,
+	0x5a6562d6, 0x5a8054cb, 0x5a9b4414, 0x5ab630b2,
+	0x5ad11aa6, 0x5aec01f1, 0x5b06e696, 0x5b21c895,
+	0x5b3ca7ef, 0x5b5784a6, 0x5b725ebc, 0x5b8d3631,
+	0x5ba80b06, 0x5bc2dd3e, 0x5bddacd9, 0x5bf879d8,
+	0x5c13443d, 0x5c2e0c09, 0x5c48d13e, 0x5c6393dc,
+	0x5c7e53e5, 0x5c99115a, 0x5cb3cc3c, 0x5cce848d,
+	0x5ce93a4e, 0x5d03ed80, 0x5d1e9e24, 0x5d394c3b,
+	0x5d53f7c7, 0x5d6ea0c9, 0x5d894742, 0x5da3eb33,
+	0x5dbe8c9e, 0x5dd92b84, 0x5df3c7e5, 0x5e0e61c3,
+	0x5e28f920, 0x5e438dfc, 0x5e5e2059, 0x5e78b037,
+	0x5e933d99, 0x5eadc87e, 0x5ec850e9, 0x5ee2d6da,
+	0x5efd5a53, 0x5f17db54, 0x5f3259e0, 0x5f4cd5f6,
+	0x5f674f99, 0x5f81c6c8, 0x5f9c3b87, 0x5fb6add4,
+	0x5fd11db3, 0x5feb8b23, 0x6005f626, 0x60205ebd,
+	0x603ac4e9, 0x605528ac, 0x606f8a05, 0x6089e8f7,
+	0x60a44583, 0x60be9fa9, 0x60d8f76b, 0x60f34cca,
+	0x610d9fc7, 0x6127f062, 0x61423e9e, 0x615c8a7a,
+	0x6176d3f9, 0x61911b1b, 0x61ab5fe1, 0x61c5a24d,
+	0x61dfe25f, 0x61fa2018, 0x62145b7a, 0x622e9485,
+	0x6248cb3b, 0x6262ff9d, 0x627d31ab, 0x62976167,
+	0x62b18ed1, 0x62cbb9eb, 0x62e5e2b6, 0x63000933,
+	0x631a2d62, 0x63344f45, 0x634e6edd, 0x63688c2b,
+	0x6382a730, 0x639cbfec, 0x63b6d661, 0x63d0ea90,
+	0x63eafc7a, 0x64050c1f, 0x641f1982, 0x643924a2,
+	0x64532d80, 0x646d341f, 0x6487387e, 0x64a13a9e,
+	0x64bb3a81, 0x64d53828, 0x64ef3393, 0x65092cc4,
+	0x652323bb, 0x653d1879, 0x65570b00, 0x6570fb50,
+	0x658ae96b, 0x65a4d550, 0x65bebf01, 0x65d8a680,
+	0x65f28bcc, 0x660c6ee8, 0x66264fd3, 0x66402e8f,
+	0x665a0b1c, 0x6673e57d, 0x668dbdb0, 0x66a793b8,
+	0x66c16795, 0x66db3949, 0x66f508d4, 0x670ed636,
+	0x6728a172, 0x67426a87, 0x675c3177, 0x6775f643,
+	0x678fb8eb, 0x67a97971, 0x67c337d5, 0x67dcf418,
+	0x67f6ae3b, 0x6810663f, 0x682a1c25, 0x6843cfed,
+	0x685d8199, 0x68773129, 0x6890de9f, 0x68aa89fa,
+	0x68c4333d, 0x68ddda67, 0x68f77f7a, 0x69112277,
+	0x692ac35e, 0x69446230, 0x695dfeee, 0x6977999a,
+	0x69913232, 0x69aac8ba, 0x69c45d31, 0x69ddef98,
+	0x69f77ff0, 0x6a110e3a, 0x6a2a9a77, 0x6a4424a8,
+	0x6a5daccc, 0x6a7732e6, 0x6a90b6f6, 0x6aaa38fd,
+	0x6ac3b8fb, 0x6add36f2, 0x6af6b2e2, 0x6b102ccd,
+	0x6b29a4b2, 0x6b431a92, 0x6b5c8e6f, 0x6b76004a,
+	0x6b8f7022, 0x6ba8ddf9, 0x6bc249d0, 0x6bdbb3a7,
+	0x6bf51b80, 0x6c0e815a, 0x6c27e537, 0x6c414718,
+	0x6c5aa6fd, 0x6c7404e7, 0x6c8d60d7, 0x6ca6bace,
+	0x6cc012cc, 0x6cd968d2, 0x6cf2bce1, 0x6d0c0ef9,
+	0x6d255f1d, 0x6d3ead4b, 0x6d57f985, 0x6d7143cc,
+	0x6d8a8c21, 0x6da3d283, 0x6dbd16f5, 0x6dd65976,
+	0x6def9a08, 0x6e08d8ab, 0x6e221560, 0x6e3b5027,
+	0x6e548902, 0x6e6dbff1, 0x6e86f4f5, 0x6ea0280e,
+	0x6eb9593e, 0x6ed28885, 0x6eebb5e3, 0x6f04e15a,
+	0x6f1e0aea, 0x6f373294, 0x6f505859, 0x6f697c39,
+	0x6f829e35, 0x6f9bbe4e, 0x6fb4dc85, 0x6fcdf8d9,
+	0x6fe7134d, 0x70002be0, 0x70194293, 0x70325767,
+	0x704b6a5d, 0x70647b76, 0x707d8ab1, 0x70969811,
+	0x70afa394, 0x70c8ad3d, 0x70e1b50c, 0x70fabb01,
+	0x7113bf1d, 0x712cc161, 0x7145c1ce, 0x715ec064,
+	0x7177bd24, 0x7190b80f, 0x71a9b124, 0x71c2a866,
+	0x71db9dd4, 0x71f49170, 0x720d8339, 0x72267331,
+	0x723f6159, 0x72584db0, 0x72713838, 0x728a20f1,
+	0x72a307db, 0x72bbecf9, 0x72d4d049, 0x72edb1ce,
+	0x73069187, 0x731f6f75, 0x73384b98, 0x735125f3,
+	0x7369fe84, 0x7382d54d, 0x739baa4e, 0x73b47d89,
+	0x73cd4efd, 0x73e61eab, 0x73feec94, 0x7417b8b8,
+	0x74308319, 0x74494bb6, 0x74621291, 0x747ad7aa,
+	0x74939b02, 0x74ac5c98, 0x74c51c6f, 0x74ddda86,
+	0x74f696de, 0x750f5178, 0x75280a54, 0x7540c174,
+	0x755976d7, 0x75722a7e, 0x758adc69, 0x75a38c9b,
+	0x75bc3b12, 0x75d4e7cf, 0x75ed92d4, 0x76063c21,
+	0x761ee3b6, 0x76378994, 0x76502dbc, 0x7668d02e,
+	0x768170eb, 0x769a0ff3, 0x76b2ad47, 0x76cb48e7,
+	0x76e3e2d5, 0x76fc7b10, 0x7715119a, 0x772da673,
+	0x7746399b, 0x775ecb13, 0x77775adc, 0x778fe8f6,
+	0x77a87561, 0x77c1001f, 0x77d98930, 0x77f21095,
+	0x780a964d, 0x78231a5b, 0x783b9cbd, 0x78541d75,
+	0x786c9c84, 0x788519e9, 0x789d95a6, 0x78b60fbb,
+	0x78ce8828, 0x78e6feef, 0x78ff740f, 0x7917e78a,
+	0x7930595f, 0x7948c990, 0x7961381d, 0x7979a506,
+	0x7992104c, 0x79aa79f0, 0x79c2e1f1, 0x79db4852,
+	0x79f3ad11, 0x7a0c1031, 0x7a2471b0, 0x7a3cd191,
+	0x7a552fd3, 0x7a6d8c76, 0x7a85e77d, 0x7a9e40e6,
+	0x7ab698b2, 0x7aceeee3, 0x7ae74378, 0x7aff9673,
+	0x7b17e7d2, 0x7b303799, 0x7b4885c5, 0x7b60d259,
+	0x7b791d55, 0x7b9166b9, 0x7ba9ae86, 0x7bc1f4bc,
+	0x7bda395c, 0x7bf27c66, 0x7c0abddb, 0x7c22fdbb,
+	0x7c3b3c07, 0x7c5378c0, 0x7c6bb3e5, 0x7c83ed78,
+	0x7c9c2579, 0x7cb45be9, 0x7ccc90c7, 0x7ce4c414,
+	0x7cfcf5d2, 0x7d152600, 0x7d2d549f, 0x7d4581b0,
+	0x7d5dad32, 0x7d75d727, 0x7d8dff8f, 0x7da6266a,
+	0x7dbe4bba, 0x7dd66f7d, 0x7dee91b6, 0x7e06b264,
+	0x7e1ed188, 0x7e36ef22, 0x7e4f0b34, 0x7e6725bd,
+	0x7e7f3ebd, 0x7e975636, 0x7eaf6c28, 0x7ec78093,
+	0x7edf9378, 0x7ef7a4d7, 0x7f0fb4b1, 0x7f27c307,
+	0x7f3fcfd8, 0x7f57db25, 0x7f6fe4ef, 0x7f87ed36,
 	0x7f9ff3fb, 0x7fb7f93e, 0x7fcffcff, 0x7fe7ff40
 };
 
 const Word32 mTab_4_3[512]={
-	0x32cbfd4a, 0x32eddd70, 0x330fc339, 0x3331aea3, 
-	0x33539fac, 0x33759652, 0x33979294, 0x33b99470, 
-	0x33db9be4, 0x33fda8ed, 0x341fbb8b, 0x3441d3bb, 
-	0x3463f17c, 0x348614cc, 0x34a83da8, 0x34ca6c10, 
-	0x34eca001, 0x350ed979, 0x35311877, 0x35535cfa, 
-	0x3575a6fe, 0x3597f683, 0x35ba4b87, 0x35dca607, 
-	0x35ff0603, 0x36216b78, 0x3643d665, 0x366646c7, 
-	0x3688bc9e, 0x36ab37e8, 0x36cdb8a2, 0x36f03ecb, 
-	0x3712ca62, 0x37355b64, 0x3757f1d1, 0x377a8da5, 
-	0x379d2ee0, 0x37bfd580, 0x37e28184, 0x380532e8, 
-	0x3827e9ad, 0x384aa5d0, 0x386d674f, 0x38902e2a, 
-	0x38b2fa5d, 0x38d5cbe9, 0x38f8a2ca, 0x391b7eff, 
-	0x393e6088, 0x39614761, 0x3984338a, 0x39a72501, 
-	0x39ca1bc4, 0x39ed17d1, 0x3a101928, 0x3a331fc6, 
-	0x3a562baa, 0x3a793cd2, 0x3a9c533d, 0x3abf6ee9, 
-	0x3ae28fd5, 0x3b05b5ff, 0x3b28e165, 0x3b4c1206, 
-	0x3b6f47e0, 0x3b9282f2, 0x3bb5c33a, 0x3bd908b7, 
-	0x3bfc5368, 0x3c1fa349, 0x3c42f85b, 0x3c66529c, 
-	0x3c89b209, 0x3cad16a2, 0x3cd08065, 0x3cf3ef51, 
-	0x3d176364, 0x3d3adc9c, 0x3d5e5af8, 0x3d81de77, 
-	0x3da56717, 0x3dc8f4d6, 0x3dec87b4, 0x3e101fae, 
-	0x3e33bcc3, 0x3e575ef2, 0x3e7b063a, 0x3e9eb298, 
-	0x3ec2640c, 0x3ee61a93, 0x3f09d62d, 0x3f2d96d8, 
-	0x3f515c93, 0x3f75275b, 0x3f98f731, 0x3fbccc11, 
-	0x3fe0a5fc, 0x400484ef, 0x402868ea, 0x404c51e9, 
-	0x40703fee, 0x409432f5, 0x40b82afd, 0x40dc2806, 
-	0x41002a0d, 0x41243111, 0x41483d12, 0x416c4e0d, 
-	0x41906401, 0x41b47eed, 0x41d89ecf, 0x41fcc3a7, 
-	0x4220ed72, 0x42451c30, 0x42694fde, 0x428d887d, 
-	0x42b1c609, 0x42d60883, 0x42fa4fe8, 0x431e9c37, 
-	0x4342ed70, 0x43674390, 0x438b9e96, 0x43affe82, 
-	0x43d46351, 0x43f8cd03, 0x441d3b95, 0x4441af08, 
-	0x44662758, 0x448aa487, 0x44af2690, 0x44d3ad75, 
-	0x44f83933, 0x451cc9c8, 0x45415f35, 0x4565f977, 
-	0x458a988d, 0x45af3c76, 0x45d3e531, 0x45f892bc, 
-	0x461d4516, 0x4641fc3e, 0x4666b832, 0x468b78f2, 
-	0x46b03e7c, 0x46d508cf, 0x46f9d7e9, 0x471eabca, 
-	0x47438470, 0x476861d9, 0x478d4406, 0x47b22af3, 
-	0x47d716a1, 0x47fc070e, 0x4820fc39, 0x4845f620, 
-	0x486af4c3, 0x488ff820, 0x48b50035, 0x48da0d03, 
-	0x48ff1e87, 0x492434c0, 0x49494fad, 0x496e6f4d, 
-	0x4993939f, 0x49b8bca2, 0x49ddea54, 0x4a031cb4, 
-	0x4a2853c1, 0x4a4d8f7a, 0x4a72cfde, 0x4a9814eb, 
-	0x4abd5ea1, 0x4ae2acfd, 0x4b080000, 0x4b2d57a8, 
-	0x4b52b3f3, 0x4b7814e1, 0x4b9d7a70, 0x4bc2e49f, 
-	0x4be8536e, 0x4c0dc6db, 0x4c333ee4, 0x4c58bb89, 
-	0x4c7e3cc9, 0x4ca3c2a2, 0x4cc94d14, 0x4ceedc1c, 
-	0x4d146fbb, 0x4d3a07ef, 0x4d5fa4b6, 0x4d854611, 
-	0x4daaebfd, 0x4dd09679, 0x4df64585, 0x4e1bf91f, 
-	0x4e41b146, 0x4e676dfa, 0x4e8d2f38, 0x4eb2f501, 
-	0x4ed8bf52, 0x4efe8e2b, 0x4f24618a, 0x4f4a3970, 
-	0x4f7015d9, 0x4f95f6c6, 0x4fbbdc36, 0x4fe1c626, 
-	0x5007b497, 0x502da787, 0x50539ef5, 0x50799ae1, 
-	0x509f9b48, 0x50c5a02a, 0x50eba985, 0x5111b75a, 
-	0x5137c9a6, 0x515de069, 0x5183fba2, 0x51aa1b4f, 
-	0x51d03f70, 0x51f66803, 0x521c9508, 0x5242c67d, 
-	0x5268fc62, 0x528f36b5, 0x52b57575, 0x52dbb8a2, 
-	0x5302003a, 0x53284c3c, 0x534e9ca8, 0x5374f17c, 
-	0x539b4ab7, 0x53c1a858, 0x53e80a5f, 0x540e70ca, 
-	0x5434db98, 0x545b4ac8, 0x5481be5a, 0x54a8364b, 
-	0x54ceb29c, 0x54f5334c, 0x551bb858, 0x554241c1, 
-	0x5568cf85, 0x558f61a3, 0x55b5f81b, 0x55dc92eb, 
-	0x56033212, 0x5629d590, 0x56507d63, 0x5677298a, 
-	0x569dda05, 0x56c48ed3, 0x56eb47f2, 0x57120562, 
-	0x5738c721, 0x575f8d2f, 0x5786578a, 0x57ad2633, 
-	0x57d3f927, 0x57fad066, 0x5821abef, 0x58488bc0, 
-	0x586f6fda, 0x5896583b, 0x58bd44e2, 0x58e435ce, 
-	0x590b2aff, 0x59322473, 0x59592229, 0x59802420, 
-	0x59a72a59, 0x59ce34d0, 0x59f54387, 0x5a1c567b, 
-	0x5a436dac, 0x5a6a8919, 0x5a91a8c1, 0x5ab8cca3, 
-	0x5adff4be, 0x5b072111, 0x5b2e519c, 0x5b55865e, 
-	0x5b7cbf54, 0x5ba3fc80, 0x5bcb3ddf, 0x5bf28371, 
-	0x5c19cd35, 0x5c411b2a, 0x5c686d4f, 0x5c8fc3a4, 
-	0x5cb71e27, 0x5cde7cd7, 0x5d05dfb4, 0x5d2d46bd, 
-	0x5d54b1f0, 0x5d7c214e, 0x5da394d4, 0x5dcb0c83, 
-	0x5df28859, 0x5e1a0856, 0x5e418c78, 0x5e6914be, 
-	0x5e90a129, 0x5eb831b7, 0x5edfc667, 0x5f075f38, 
-	0x5f2efc29, 0x5f569d3a, 0x5f7e426a, 0x5fa5ebb7, 
-	0x5fcd9921, 0x5ff54aa8, 0x601d004a, 0x6044ba06, 
-	0x606c77dc, 0x609439ca, 0x60bbffd0, 0x60e3c9ee, 
-	0x610b9821, 0x61336a6a, 0x615b40c8, 0x61831b39, 
-	0x61aaf9bd, 0x61d2dc53, 0x61fac2fa, 0x6222adb2, 
-	0x624a9c79, 0x62728f4f, 0x629a8633, 0x62c28123, 
-	0x62ea8020, 0x63128329, 0x633a8a3c, 0x63629559, 
-	0x638aa47f, 0x63b2b7ad, 0x63dacee2, 0x6402ea1e, 
-	0x642b0960, 0x64532ca6, 0x647b53f1, 0x64a37f3f, 
-	0x64cbae8f, 0x64f3e1e2, 0x651c1935, 0x65445488, 
-	0x656c93db, 0x6594d72c, 0x65bd1e7b, 0x65e569c7, 
-	0x660db90f, 0x66360c53, 0x665e6391, 0x6686bec9, 
-	0x66af1dfa, 0x66d78123, 0x66ffe844, 0x6728535b, 
-	0x6750c268, 0x6779356b, 0x67a1ac62, 0x67ca274c, 
-	0x67f2a629, 0x681b28f9, 0x6843afb9, 0x686c3a6a, 
-	0x6894c90b, 0x68bd5b9b, 0x68e5f219, 0x690e8c84, 
-	0x69372add, 0x695fcd21, 0x69887350, 0x69b11d6a, 
-	0x69d9cb6d, 0x6a027d5a, 0x6a2b332f, 0x6a53eceb, 
-	0x6a7caa8d, 0x6aa56c16, 0x6ace3184, 0x6af6fad6, 
-	0x6b1fc80c, 0x6b489925, 0x6b716e20, 0x6b9a46fd, 
-	0x6bc323bb, 0x6bec0458, 0x6c14e8d5, 0x6c3dd130, 
-	0x6c66bd69, 0x6c8fad80, 0x6cb8a172, 0x6ce19940, 
-	0x6d0a94e9, 0x6d33946d, 0x6d5c97ca, 0x6d859eff, 
-	0x6daeaa0d, 0x6dd7b8f1, 0x6e00cbad, 0x6e29e23e, 
-	0x6e52fca4, 0x6e7c1adf, 0x6ea53cee, 0x6ece62cf, 
-	0x6ef78c83, 0x6f20ba09, 0x6f49eb5f, 0x6f732085, 
-	0x6f9c597b, 0x6fc59640, 0x6feed6d3, 0x70181b33, 
-	0x70416360, 0x706aaf59, 0x7093ff1d, 0x70bd52ab, 
-	0x70e6aa04, 0x71100525, 0x7139640f, 0x7162c6c1, 
-	0x718c2d3a, 0x71b5977a, 0x71df057f, 0x72087749, 
-	0x7231ecd8, 0x725b662a, 0x7284e33f, 0x72ae6417, 
-	0x72d7e8b0, 0x7301710a, 0x732afd24, 0x73548cfe, 
-	0x737e2097, 0x73a7b7ee, 0x73d15303, 0x73faf1d5, 
-	0x74249462, 0x744e3aac, 0x7477e4b0, 0x74a1926e, 
-	0x74cb43e6, 0x74f4f917, 0x751eb201, 0x75486ea1, 
-	0x75722ef9, 0x759bf307, 0x75c5baca, 0x75ef8642, 
-	0x7619556f, 0x7643284f, 0x766cfee2, 0x7696d928, 
-	0x76c0b71f, 0x76ea98c7, 0x77147e20, 0x773e6728, 
-	0x776853df, 0x77924445, 0x77bc3858, 0x77e63019, 
-	0x78102b85, 0x783a2a9e, 0x78642d62, 0x788e33d1, 
-	0x78b83de9, 0x78e24bab, 0x790c5d15, 0x79367228, 
-	0x79608ae1, 0x798aa742, 0x79b4c748, 0x79deeaf4, 
-	0x7a091245, 0x7a333d3a, 0x7a5d6bd2, 0x7a879e0e, 
-	0x7ab1d3ec, 0x7adc0d6b, 0x7b064a8c, 0x7b308b4d, 
-	0x7b5acfae, 0x7b8517ae, 0x7baf634c, 0x7bd9b289, 
-	0x7c040563, 0x7c2e5bda, 0x7c58b5ec, 0x7c83139b, 
-	0x7cad74e4, 0x7cd7d9c7, 0x7d024244, 0x7d2cae5a, 
-	0x7d571e09, 0x7d81914f, 0x7dac082d, 0x7dd682a1, 
-	0x7e0100ac, 0x7e2b824b, 0x7e560780, 0x7e809048, 
-	0x7eab1ca5, 0x7ed5ac94, 0x7f004015, 0x7f2ad729, 
+	0x32cbfd4a, 0x32eddd70, 0x330fc339, 0x3331aea3,
+	0x33539fac, 0x33759652, 0x33979294, 0x33b99470,
+	0x33db9be4, 0x33fda8ed, 0x341fbb8b, 0x3441d3bb,
+	0x3463f17c, 0x348614cc, 0x34a83da8, 0x34ca6c10,
+	0x34eca001, 0x350ed979, 0x35311877, 0x35535cfa,
+	0x3575a6fe, 0x3597f683, 0x35ba4b87, 0x35dca607,
+	0x35ff0603, 0x36216b78, 0x3643d665, 0x366646c7,
+	0x3688bc9e, 0x36ab37e8, 0x36cdb8a2, 0x36f03ecb,
+	0x3712ca62, 0x37355b64, 0x3757f1d1, 0x377a8da5,
+	0x379d2ee0, 0x37bfd580, 0x37e28184, 0x380532e8,
+	0x3827e9ad, 0x384aa5d0, 0x386d674f, 0x38902e2a,
+	0x38b2fa5d, 0x38d5cbe9, 0x38f8a2ca, 0x391b7eff,
+	0x393e6088, 0x39614761, 0x3984338a, 0x39a72501,
+	0x39ca1bc4, 0x39ed17d1, 0x3a101928, 0x3a331fc6,
+	0x3a562baa, 0x3a793cd2, 0x3a9c533d, 0x3abf6ee9,
+	0x3ae28fd5, 0x3b05b5ff, 0x3b28e165, 0x3b4c1206,
+	0x3b6f47e0, 0x3b9282f2, 0x3bb5c33a, 0x3bd908b7,
+	0x3bfc5368, 0x3c1fa349, 0x3c42f85b, 0x3c66529c,
+	0x3c89b209, 0x3cad16a2, 0x3cd08065, 0x3cf3ef51,
+	0x3d176364, 0x3d3adc9c, 0x3d5e5af8, 0x3d81de77,
+	0x3da56717, 0x3dc8f4d6, 0x3dec87b4, 0x3e101fae,
+	0x3e33bcc3, 0x3e575ef2, 0x3e7b063a, 0x3e9eb298,
+	0x3ec2640c, 0x3ee61a93, 0x3f09d62d, 0x3f2d96d8,
+	0x3f515c93, 0x3f75275b, 0x3f98f731, 0x3fbccc11,
+	0x3fe0a5fc, 0x400484ef, 0x402868ea, 0x404c51e9,
+	0x40703fee, 0x409432f5, 0x40b82afd, 0x40dc2806,
+	0x41002a0d, 0x41243111, 0x41483d12, 0x416c4e0d,
+	0x41906401, 0x41b47eed, 0x41d89ecf, 0x41fcc3a7,
+	0x4220ed72, 0x42451c30, 0x42694fde, 0x428d887d,
+	0x42b1c609, 0x42d60883, 0x42fa4fe8, 0x431e9c37,
+	0x4342ed70, 0x43674390, 0x438b9e96, 0x43affe82,
+	0x43d46351, 0x43f8cd03, 0x441d3b95, 0x4441af08,
+	0x44662758, 0x448aa487, 0x44af2690, 0x44d3ad75,
+	0x44f83933, 0x451cc9c8, 0x45415f35, 0x4565f977,
+	0x458a988d, 0x45af3c76, 0x45d3e531, 0x45f892bc,
+	0x461d4516, 0x4641fc3e, 0x4666b832, 0x468b78f2,
+	0x46b03e7c, 0x46d508cf, 0x46f9d7e9, 0x471eabca,
+	0x47438470, 0x476861d9, 0x478d4406, 0x47b22af3,
+	0x47d716a1, 0x47fc070e, 0x4820fc39, 0x4845f620,
+	0x486af4c3, 0x488ff820, 0x48b50035, 0x48da0d03,
+	0x48ff1e87, 0x492434c0, 0x49494fad, 0x496e6f4d,
+	0x4993939f, 0x49b8bca2, 0x49ddea54, 0x4a031cb4,
+	0x4a2853c1, 0x4a4d8f7a, 0x4a72cfde, 0x4a9814eb,
+	0x4abd5ea1, 0x4ae2acfd, 0x4b080000, 0x4b2d57a8,
+	0x4b52b3f3, 0x4b7814e1, 0x4b9d7a70, 0x4bc2e49f,
+	0x4be8536e, 0x4c0dc6db, 0x4c333ee4, 0x4c58bb89,
+	0x4c7e3cc9, 0x4ca3c2a2, 0x4cc94d14, 0x4ceedc1c,
+	0x4d146fbb, 0x4d3a07ef, 0x4d5fa4b6, 0x4d854611,
+	0x4daaebfd, 0x4dd09679, 0x4df64585, 0x4e1bf91f,
+	0x4e41b146, 0x4e676dfa, 0x4e8d2f38, 0x4eb2f501,
+	0x4ed8bf52, 0x4efe8e2b, 0x4f24618a, 0x4f4a3970,
+	0x4f7015d9, 0x4f95f6c6, 0x4fbbdc36, 0x4fe1c626,
+	0x5007b497, 0x502da787, 0x50539ef5, 0x50799ae1,
+	0x509f9b48, 0x50c5a02a, 0x50eba985, 0x5111b75a,
+	0x5137c9a6, 0x515de069, 0x5183fba2, 0x51aa1b4f,
+	0x51d03f70, 0x51f66803, 0x521c9508, 0x5242c67d,
+	0x5268fc62, 0x528f36b5, 0x52b57575, 0x52dbb8a2,
+	0x5302003a, 0x53284c3c, 0x534e9ca8, 0x5374f17c,
+	0x539b4ab7, 0x53c1a858, 0x53e80a5f, 0x540e70ca,
+	0x5434db98, 0x545b4ac8, 0x5481be5a, 0x54a8364b,
+	0x54ceb29c, 0x54f5334c, 0x551bb858, 0x554241c1,
+	0x5568cf85, 0x558f61a3, 0x55b5f81b, 0x55dc92eb,
+	0x56033212, 0x5629d590, 0x56507d63, 0x5677298a,
+	0x569dda05, 0x56c48ed3, 0x56eb47f2, 0x57120562,
+	0x5738c721, 0x575f8d2f, 0x5786578a, 0x57ad2633,
+	0x57d3f927, 0x57fad066, 0x5821abef, 0x58488bc0,
+	0x586f6fda, 0x5896583b, 0x58bd44e2, 0x58e435ce,
+	0x590b2aff, 0x59322473, 0x59592229, 0x59802420,
+	0x59a72a59, 0x59ce34d0, 0x59f54387, 0x5a1c567b,
+	0x5a436dac, 0x5a6a8919, 0x5a91a8c1, 0x5ab8cca3,
+	0x5adff4be, 0x5b072111, 0x5b2e519c, 0x5b55865e,
+	0x5b7cbf54, 0x5ba3fc80, 0x5bcb3ddf, 0x5bf28371,
+	0x5c19cd35, 0x5c411b2a, 0x5c686d4f, 0x5c8fc3a4,
+	0x5cb71e27, 0x5cde7cd7, 0x5d05dfb4, 0x5d2d46bd,
+	0x5d54b1f0, 0x5d7c214e, 0x5da394d4, 0x5dcb0c83,
+	0x5df28859, 0x5e1a0856, 0x5e418c78, 0x5e6914be,
+	0x5e90a129, 0x5eb831b7, 0x5edfc667, 0x5f075f38,
+	0x5f2efc29, 0x5f569d3a, 0x5f7e426a, 0x5fa5ebb7,
+	0x5fcd9921, 0x5ff54aa8, 0x601d004a, 0x6044ba06,
+	0x606c77dc, 0x609439ca, 0x60bbffd0, 0x60e3c9ee,
+	0x610b9821, 0x61336a6a, 0x615b40c8, 0x61831b39,
+	0x61aaf9bd, 0x61d2dc53, 0x61fac2fa, 0x6222adb2,
+	0x624a9c79, 0x62728f4f, 0x629a8633, 0x62c28123,
+	0x62ea8020, 0x63128329, 0x633a8a3c, 0x63629559,
+	0x638aa47f, 0x63b2b7ad, 0x63dacee2, 0x6402ea1e,
+	0x642b0960, 0x64532ca6, 0x647b53f1, 0x64a37f3f,
+	0x64cbae8f, 0x64f3e1e2, 0x651c1935, 0x65445488,
+	0x656c93db, 0x6594d72c, 0x65bd1e7b, 0x65e569c7,
+	0x660db90f, 0x66360c53, 0x665e6391, 0x6686bec9,
+	0x66af1dfa, 0x66d78123, 0x66ffe844, 0x6728535b,
+	0x6750c268, 0x6779356b, 0x67a1ac62, 0x67ca274c,
+	0x67f2a629, 0x681b28f9, 0x6843afb9, 0x686c3a6a,
+	0x6894c90b, 0x68bd5b9b, 0x68e5f219, 0x690e8c84,
+	0x69372add, 0x695fcd21, 0x69887350, 0x69b11d6a,
+	0x69d9cb6d, 0x6a027d5a, 0x6a2b332f, 0x6a53eceb,
+	0x6a7caa8d, 0x6aa56c16, 0x6ace3184, 0x6af6fad6,
+	0x6b1fc80c, 0x6b489925, 0x6b716e20, 0x6b9a46fd,
+	0x6bc323bb, 0x6bec0458, 0x6c14e8d5, 0x6c3dd130,
+	0x6c66bd69, 0x6c8fad80, 0x6cb8a172, 0x6ce19940,
+	0x6d0a94e9, 0x6d33946d, 0x6d5c97ca, 0x6d859eff,
+	0x6daeaa0d, 0x6dd7b8f1, 0x6e00cbad, 0x6e29e23e,
+	0x6e52fca4, 0x6e7c1adf, 0x6ea53cee, 0x6ece62cf,
+	0x6ef78c83, 0x6f20ba09, 0x6f49eb5f, 0x6f732085,
+	0x6f9c597b, 0x6fc59640, 0x6feed6d3, 0x70181b33,
+	0x70416360, 0x706aaf59, 0x7093ff1d, 0x70bd52ab,
+	0x70e6aa04, 0x71100525, 0x7139640f, 0x7162c6c1,
+	0x718c2d3a, 0x71b5977a, 0x71df057f, 0x72087749,
+	0x7231ecd8, 0x725b662a, 0x7284e33f, 0x72ae6417,
+	0x72d7e8b0, 0x7301710a, 0x732afd24, 0x73548cfe,
+	0x737e2097, 0x73a7b7ee, 0x73d15303, 0x73faf1d5,
+	0x74249462, 0x744e3aac, 0x7477e4b0, 0x74a1926e,
+	0x74cb43e6, 0x74f4f917, 0x751eb201, 0x75486ea1,
+	0x75722ef9, 0x759bf307, 0x75c5baca, 0x75ef8642,
+	0x7619556f, 0x7643284f, 0x766cfee2, 0x7696d928,
+	0x76c0b71f, 0x76ea98c7, 0x77147e20, 0x773e6728,
+	0x776853df, 0x77924445, 0x77bc3858, 0x77e63019,
+	0x78102b85, 0x783a2a9e, 0x78642d62, 0x788e33d1,
+	0x78b83de9, 0x78e24bab, 0x790c5d15, 0x79367228,
+	0x79608ae1, 0x798aa742, 0x79b4c748, 0x79deeaf4,
+	0x7a091245, 0x7a333d3a, 0x7a5d6bd2, 0x7a879e0e,
+	0x7ab1d3ec, 0x7adc0d6b, 0x7b064a8c, 0x7b308b4d,
+	0x7b5acfae, 0x7b8517ae, 0x7baf634c, 0x7bd9b289,
+	0x7c040563, 0x7c2e5bda, 0x7c58b5ec, 0x7c83139b,
+	0x7cad74e4, 0x7cd7d9c7, 0x7d024244, 0x7d2cae5a,
+	0x7d571e09, 0x7d81914f, 0x7dac082d, 0x7dd682a1,
+	0x7e0100ac, 0x7e2b824b, 0x7e560780, 0x7e809048,
+	0x7eab1ca5, 0x7ed5ac94, 0x7f004015, 0x7f2ad729,
 	0x7f5571cd, 0x7f801003, 0x7faab1c8, 0x7fd5571d
 };
 
 
 const Word32 invSBF[24] = {
-  0x3FFD34FC, 0x2D3F8000, 0x24F18C7E, 0x1FFE9A7E, 
-  0x1C9DF10C, 0x1A1F851A, 0x182FE994, 0x169FC000, 
-  0x15542AAA, 0x143C31C2, 0x134B1B6C, 0x127920BE, 
-  0x11BF2FCC, 0x111A749E, 0x1085FC42, 0x0FFFA7BE, 
-  0x0F855818, 0x0F14EE56, 0x0EAE6A78, 0x0E4EF886, 
+  0x3FFD34FC, 0x2D3F8000, 0x24F18C7E, 0x1FFE9A7E,
+  0x1C9DF10C, 0x1A1F851A, 0x182FE994, 0x169FC000,
+  0x15542AAA, 0x143C31C2, 0x134B1B6C, 0x127920BE,
+  0x11BF2FCC, 0x111A749E, 0x1085FC42, 0x0FFFA7BE,
+  0x0F855818, 0x0F14EE56, 0x0EAE6A78, 0x0E4EF886,
   0x0DF69880, 0x0DA49568, 0x0D578542, 0x0D101D0C
 };
 
@@ -1353,40 +1353,40 @@
 };
 
 const Word16 sideInfoTabLong[MAX_SFB_LONG + 1] = {
-  9, 9, 9, 9, 9, 9, 9, 9, 9, 
-  9, 9, 9, 9, 9, 9, 9, 9, 9, 
-  9, 9, 9, 9, 9, 9, 9, 9, 9, 
-  9, 9, 9, 9, 14, 14, 14, 14, 
-  14, 14, 14, 14, 14, 14, 14, 
-  14, 14, 14, 14, 14, 14, 14, 
+  9, 9, 9, 9, 9, 9, 9, 9, 9,
+  9, 9, 9, 9, 9, 9, 9, 9, 9,
+  9, 9, 9, 9, 9, 9, 9, 9, 9,
+  9, 9, 9, 9, 14, 14, 14, 14,
+  14, 14, 14, 14, 14, 14, 14,
+  14, 14, 14, 14, 14, 14, 14,
   14, 14, 14
 };
 
 const Word16 sideInfoTabShort[MAX_SFB_SHORT + 1] = {
-  7, 7, 7, 7, 7, 7, 7, 10, 10, 
+  7, 7, 7, 7, 7, 7, 7, 10, 10,
   10, 10, 10, 10, 10, 13, 13
 };
 
 Word32 specExpMantTableComb_enc[4][14] =
 {
-  {0x40000000,  0x50a28be6,  0x6597fa95,  0x40000000, 
-   0x50a28be6,  0x6597fa95,  0x40000000,  0x50a28be6, 
-   0x6597fa95,  0x40000000,  0x50a28be6,  0x6597fa95, 
-   0x40000000,  0x50a28be6}, 
+  {0x40000000,  0x50a28be6,  0x6597fa95,  0x40000000,
+   0x50a28be6,  0x6597fa95,  0x40000000,  0x50a28be6,
+   0x6597fa95,  0x40000000,  0x50a28be6,  0x6597fa95,
+   0x40000000,  0x50a28be6},
 
-  {0x4c1bf829,  0x5fe4435e,  0x78d0df9c,  0x4c1bf829, 
-   0x5fe4435e,  0x78d0df9c,  0x4c1bf829,  0x5fe4435e, 
-   0x78d0df9c,  0x4c1bf829,  0x5fe4435e,  0x78d0df9c, 
-   0x4c1bf829,  0x5fe4435e}, 
+  {0x4c1bf829,  0x5fe4435e,  0x78d0df9c,  0x4c1bf829,
+   0x5fe4435e,  0x78d0df9c,  0x4c1bf829,  0x5fe4435e,
+   0x78d0df9c,  0x4c1bf829,  0x5fe4435e,  0x78d0df9c,
+   0x4c1bf829,  0x5fe4435e},
 
-  {0x5a82799a,  0x7208f81d,  0x47d66b0f,  0x5a82799a, 
-   0x7208f81d,  0x47d66b0f,  0x5a82799a,  0x7208f81d, 
-   0x47d66b0f,  0x5a82799a,  0x7208f81d,  0x47d66b0f, 
-   0x5a82799a,  0x7208f81d}, 
+  {0x5a82799a,  0x7208f81d,  0x47d66b0f,  0x5a82799a,
+   0x7208f81d,  0x47d66b0f,  0x5a82799a,  0x7208f81d,
+   0x47d66b0f,  0x5a82799a,  0x7208f81d,  0x47d66b0f,
+   0x5a82799a,  0x7208f81d},
 
-  {0x6ba27e65,  0x43ce3e4b,  0x556e0424,  0x6ba27e65, 
-   0x43ce3e4b,  0x556e0424,  0x6ba27e65,  0x43ce3e4b, 
-   0x556e0424,  0x6ba27e65,  0x43ce3e4b,  0x556e0424, 
+  {0x6ba27e65,  0x43ce3e4b,  0x556e0424,  0x6ba27e65,
+   0x43ce3e4b,  0x556e0424,  0x6ba27e65,  0x43ce3e4b,
+   0x556e0424,  0x6ba27e65,  0x43ce3e4b,  0x556e0424,
    0x6ba27e65,  0x43ce3e4b}
 };
 
@@ -1417,12 +1417,12 @@
 };
 
 const int sampRateTab[NUM_SAMPLE_RATES] = {
-    96000, 88200, 64000, 48000, 44100, 32000, 
+    96000, 88200, 64000, 48000, 44100, 32000,
 	24000, 22050, 16000, 12000, 11025,  8000
 };
 
 
-const int	rates[8] = {		
+const int	rates[8] = {
 	160, 240, 320, 400, 480, 560, 640, 0
 };
 
@@ -1507,7 +1507,7 @@
 };
 
 /*
-  these tables are used only for counting and 
+  these tables are used only for counting and
   are stored in packed format
 */
 const UWord16 huff_ltab1_2[3][3][3][3]=
@@ -2260,12 +2260,12 @@
 };
 
 const Word32 m_log2_table[INT_BITS] = {
-  0x00000000,0x4ae00d00,0x2934f080,0x15c01a3f, 
-  0x0b31fb80,0x05aeb4e0,0x02dcf2d0,0x016fe50c, 
+  0x00000000,0x4ae00d00,0x2934f080,0x15c01a3f,
+  0x0b31fb80,0x05aeb4e0,0x02dcf2d0,0x016fe50c,
   0x00b84e23,0x005c3e10,0x002e24ca,0x001713d6,
   0x000b8a47,0x0005c53b,0x0002e2a3,0x00017153,
   0x0000b8aa,0x00005c55,0x00002e2b,0x00001715,
-  0x00000b8b,0x000005c5,0x000002e3,0x00000171, 
+  0x00000b8b,0x000005c5,0x000002e3,0x00000171,
   0x000000b9,0x0000005c,0x0000002e,0x00000017,
   0x0000000c,0x00000006,0x00000003,0x00000001
 };
@@ -2344,7 +2344,7 @@
 };
 
 
-const unsigned char bitrevTab[17 + 129] = 
+const unsigned char bitrevTab[17 + 129] =
 {
 /* 64 */
 0x01, 0x08, 0x02, 0x04, 0x03, 0x0c, 0x05, 0x0a, 0x07, 0x0e, 0x0b, 0x0d, 0x00, 0x06, 0x09, 0x0f,
@@ -2360,4 +2360,4 @@
 0x4d, 0x59, 0x4f, 0x79, 0x53, 0x65, 0x57, 0x75, 0x5b, 0x6d, 0x5f, 0x7d, 0x67, 0x73, 0x6f, 0x7b,
 0x00, 0x08, 0x14, 0x1c, 0x22, 0x2a, 0x36, 0x3e, 0x41, 0x49, 0x55, 0x5d, 0x63, 0x6b, 0x77, 0x7f,
 0x00,
-};
\ No newline at end of file
+};
diff --git a/media/libstagefright/codecs/aacenc/src/aacenc.c b/media/libstagefright/codecs/aacenc/src/aacenc.c
index 975f598..ad2f29a 100644
--- a/media/libstagefright/codecs/aacenc/src/aacenc.c
+++ b/media/libstagefright/codecs/aacenc/src/aacenc.c
@@ -48,7 +48,7 @@
 
 	interMem = 0;
 	error = 0;
-	
+
 	/* init the memory operator */
 	if(pUserData == NULL || pUserData->memflag != VO_IMF_USERMEMOPERATOR || pUserData->memData == NULL )
 	{
@@ -113,7 +113,7 @@
 		{
 			mem_free(pMemOP, hAacEnc, VO_INDEX_ENC_AAC);
 			hAacEnc = NULL;
-		}		
+		}
 		*phCodec = NULL;
 		return VO_ERR_OUTOF_MEMORY;
 	}
@@ -168,9 +168,9 @@
 	{
 		return VO_ERR_INVALID_ARG;
 	}
-	
+
 	hAacEnc = (AAC_ENCODER *)hCodec;
-	
+
 	/* init input pcm buffer and length*/
 	hAacEnc->inbuf = (short *)pInput->Buffer;
 	hAacEnc->inlen = pInput->Length / sizeof(short);
@@ -178,12 +178,12 @@
 
 	hAacEnc->encbuf = hAacEnc->inbuf;
 	hAacEnc->enclen = hAacEnc->inlen;
-	
+
 	/* rebuild intra pcm buffer and length*/
 	if(hAacEnc->intlen)
 	{
 		length = min(hAacEnc->config.nChannelsIn*AACENC_BLOCKSIZE - hAacEnc->intlen, hAacEnc->inlen);
-		hAacEnc->voMemop->Copy(VO_INDEX_ENC_AAC, hAacEnc->intbuf + hAacEnc->intlen, 
+		hAacEnc->voMemop->Copy(VO_INDEX_ENC_AAC, hAacEnc->intbuf + hAacEnc->intlen,
 			hAacEnc->inbuf, length*sizeof(short));
 
 		hAacEnc->encbuf = hAacEnc->intbuf;
@@ -192,7 +192,7 @@
 		hAacEnc->inbuf += length;
 		hAacEnc->inlen -= length;
 	}
-	
+
 	return VO_ERR_NONE;
 }
 
@@ -219,11 +219,11 @@
 	 /* check the input pcm buffer and length*/
 	 if(NULL == hAacEnc->encbuf || hAacEnc->enclen < inbuflen)
 	 {
-		length = hAacEnc->enclen;		
+		length = hAacEnc->enclen;
 		if(hAacEnc->intlen == 0)
-		{	
-			hAacEnc->voMemop->Copy(VO_INDEX_ENC_AAC, hAacEnc->intbuf, 
-				hAacEnc->encbuf, length*sizeof(short));		
+		{
+			hAacEnc->voMemop->Copy(VO_INDEX_ENC_AAC, hAacEnc->intbuf,
+				hAacEnc->encbuf, length*sizeof(short));
 			hAacEnc->uselength += length*sizeof(short);
 		}
 		else
@@ -236,7 +236,7 @@
 		pOutput->Length = 0;
 		if(pOutInfo)
 			pOutInfo->InputUsed = hAacEnc->uselength;
-		return VO_ERR_INPUT_BUFFER_SMALL;	
+		return VO_ERR_INPUT_BUFFER_SMALL;
 	 }
 
 	 /* check the output aac buffer and length*/
@@ -254,7 +254,7 @@
 	 /* update the input pcm buffer and length*/
 	 if(hAacEnc->intlen)
 	 {
-		length = inbuflen - hAacEnc->intlen;		
+		length = inbuflen - hAacEnc->intlen;
 		hAacEnc->encbuf = hAacEnc->inbuf;
 		hAacEnc->enclen = hAacEnc->inlen;
 		hAacEnc->uselength += length*sizeof(short);
@@ -265,7 +265,7 @@
 		 hAacEnc->encbuf = hAacEnc->encbuf + inbuflen;
 		 hAacEnc->enclen = hAacEnc->enclen - inbuflen;
 		 hAacEnc->uselength += inbuflen*sizeof(short);
-	 }	 
+	 }
 
 	 /* update the output aac information */
 	if(pOutInfo)
@@ -287,7 +287,7 @@
 VO_U32 VO_API voAACEncUninit(VO_HANDLE hCodec)
 {
 	AAC_ENCODER* hAacEnc = (AAC_ENCODER*)hCodec;
-	
+
 	if(NULL != hAacEnc)
 	{
 		/* close the aac encoder */
@@ -296,7 +296,7 @@
 		/* free the aac encoder handle*/
 		mem_free(hAacEnc->voMemop, hAacEnc, VO_INDEX_ENC_AAC);
 		hAacEnc = NULL;
-	}	
+	}
 
 	return VO_ERR_NONE;
 }
@@ -319,7 +319,7 @@
 
 	if(NULL == hAacEnc)
 		return VO_ERR_INVALID_ARG;
-	
+
 	switch(uParamID)
 	{
 	case VO_PID_AAC_ENCPARAM:  /* init aac encoder parameter*/
@@ -354,11 +354,11 @@
 		SampleRateIdx = i;
 
 		tmp = 441;
-		if(config.sampleRate%8000 == 0) 
+		if(config.sampleRate%8000 == 0)
 			tmp =480;
 		/* check the bitrate */
 		if(config.bitRate!=0 && (config.bitRate/config.nChannelsOut < 4000) ||
-           (config.bitRate/config.nChannelsOut > 160000) || 
+           (config.bitRate/config.nChannelsOut > 160000) ||
 		   (config.bitRate > config.sampleRate*6*config.nChannelsOut))
 		{
 			config.bitRate = 640*config.sampleRate/tmp*config.nChannelsOut;
@@ -385,7 +385,7 @@
 
 		/* init aac encoder core */
 		ret = AacEncOpen(hAacEnc, config);
-		if(ret) 
+		if(ret)
 			return VO_ERR_AUDIO_UNSFEATURE;
 		break;
 	case VO_PID_AUDIO_FORMAT:	/* init pcm channel and samplerate*/
@@ -426,7 +426,7 @@
 
 		/* update the bitrates */
 		tmp = 441;
-		if(config.sampleRate%8000 == 0) 
+		if(config.sampleRate%8000 == 0)
 			tmp =480;
 
 		config.bitRate = 640*config.sampleRate/tmp*config.nChannelsOut;
@@ -449,10 +449,10 @@
 		}
 
 		config.bandWidth = BandwithCoefTab[i][SampleRateIdx];
-		
+
 		/* init aac encoder core */
 		ret = AacEncOpen(hAacEnc, config);
-		if(ret) 
+		if(ret)
 			return VO_ERR_AUDIO_UNSFEATURE;
 		break;
 	default:
@@ -483,7 +483,7 @@
 {
 	if(pDecHandle == NULL)
 		return VO_ERR_INVALID_ARG;
-		
+
 	pDecHandle->Init = voAACEncInit;
 	pDecHandle->SetInputData = voAACEncSetInputData;
 	pDecHandle->GetOutputData = voAACEncGetOutputData;
@@ -492,4 +492,4 @@
 	pDecHandle->Uninit = voAACEncUninit;
 
 	return VO_ERR_NONE;
-}
\ No newline at end of file
+}
diff --git a/media/libstagefright/codecs/aacenc/src/aacenc_core.c b/media/libstagefright/codecs/aacenc/src/aacenc_core.c
index b69a017..2b3bd48 100644
--- a/media/libstagefright/codecs/aacenc/src/aacenc_core.c
+++ b/media/libstagefright/codecs/aacenc/src/aacenc_core.c
@@ -43,8 +43,8 @@
   config->adtsUsed        = 1;
   config->nChannelsIn     = 2;
   config->nChannelsOut    = 2;
-  config->bitRate         = 128000;                      
-  config->bandWidth       = 0;                           
+  config->bitRate         = 128000;
+  config->bandWidth       = 0;
 }
 
 /********************************************************************************
@@ -63,11 +63,11 @@
   Word16 profile = 1;
 
   ELEMENT_INFO *elInfo = NULL;
-   
+
   if (hAacEnc==0) {
-    error=1;                                  
+    error=1;
   }
-   
+
   if (!error) {
     hAacEnc->config = config;
   }
@@ -83,7 +83,7 @@
 
   if (!error) {
     /* use or not tns tool for long and short block */
-	 Word16 tnsMask=3;      
+	 Word16 tnsMask=3;
 
 	/* init encoder psychoacoustic */
     error = psyMainInit(&hAacEnc->psyKernel,
@@ -107,10 +107,10 @@
     qcInit.elInfo = &hAacEnc->elInfo;
 
     qcInit.maxBits = (Word16) (MAXBITS_COEF*elInfo->nChannelsInEl);
-    qcInit.bitRes = qcInit.maxBits;                                      
+    qcInit.bitRes = qcInit.maxBits;
     qcInit.averageBits = (Word16) ((config.bitRate * FRAME_LEN_LONG) / config.sampleRate);
 
-    qcInit.padding.paddingRest = config.sampleRate;                          
+    qcInit.padding.paddingRest = config.sampleRate;
 
     qcInit.meanPe = (Word16) ((10 * FRAME_LEN_LONG * hAacEnc->config.bandWidth) /
                                               (config.sampleRate>>1));
@@ -118,17 +118,17 @@
     qcInit.maxBitFac = (Word16) ((100 * (MAXBITS_COEF-MINBITS_COEF)* elInfo->nChannelsInEl)/
                                                  (qcInit.averageBits?qcInit.averageBits:1));
 
-    qcInit.bitrate = config.bitRate;                                     
+    qcInit.bitrate = config.bitRate;
 
     error = QCInit(&hAacEnc->qcKernel, &qcInit);
   }
 
   /* init bitstream encoder */
   if (!error) {
-    hAacEnc->bseInit.nChannels   = elInfo->nChannelsInEl;                
-    hAacEnc->bseInit.bitrate     = config.bitRate;                       
-    hAacEnc->bseInit.sampleRate  = config.sampleRate;                    
-    hAacEnc->bseInit.profile     = profile;                              
+    hAacEnc->bseInit.nChannels   = elInfo->nChannelsInEl;
+    hAacEnc->bseInit.bitrate     = config.bitRate;
+    hAacEnc->bseInit.sampleRate  = config.sampleRate;
+    hAacEnc->bseInit.profile     = profile;
   }
 
   return error;
@@ -152,14 +152,14 @@
   ELEMENT_INFO *elInfo = &aacEnc->elInfo;
   Word16 globUsedBits;
   Word16 ancDataBytes, ancDataBytesLeft;
-  
-  ancDataBytes = ancDataBytesLeft = *numAncBytes;                          
+
+  ancDataBytes = ancDataBytesLeft = *numAncBytes;
 
   /* init output aac data buffer and length */
   aacEnc->hBitStream = CreateBitBuffer(&aacEnc->bitStream, outBytes, *numOutBytes);
 
   /* psychoacoustic process */
-  psyMain(aacEnc->config.nChannelsOut,    
+  psyMain(aacEnc->config.nChannelsOut,
           elInfo,
           timeSignal,
           &aacEnc->psyKernel.psyData[elInfo->ChannelIndex[0]],
@@ -175,9 +175,9 @@
   AdjustBitrate(&aacEnc->qcKernel,
                 aacEnc->config.bitRate,
                 aacEnc->config.sampleRate);
-    
+
   /* quantization and coding process */
-  QCMain(&aacEnc->qcKernel,         
+  QCMain(&aacEnc->qcKernel,
          &aacEnc->qcKernel.elementBits,
          &aacEnc->qcKernel.adjThr.adjThrStateElem,
          &aacEnc->psyOut.psyOutChannel[elInfo->ChannelIndex[0]],
@@ -193,11 +193,11 @@
                          &aacEnc->qcOut);
 
   /* write bitstream process */
-  WriteBitstream(aacEnc->hBitStream,				 
+  WriteBitstream(aacEnc->hBitStream,
                  *elInfo,
                  &aacEnc->qcOut,
                  &aacEnc->psyOut,
-                 &globUsedBits,				 
+                 &globUsedBits,
                  ancBytes,
 				 aacEnc->psyKernel.sampleRateIdx);
 
@@ -219,7 +219,7 @@
 **********************************************************************************/
 void AacEncClose (AAC_ENCODER* hAacEnc, VO_MEM_OPERATOR *pMemOP)
 {
-  if (hAacEnc) {  
+  if (hAacEnc) {
     QCDelete(&hAacEnc->qcKernel, pMemOP);
 
     QCOutDelete(&hAacEnc->qcOut, pMemOP);
diff --git a/media/libstagefright/codecs/aacenc/src/adj_thr.c b/media/libstagefright/codecs/aacenc/src/adj_thr.c
index 83b43a1..a8ab809 100644
--- a/media/libstagefright/codecs/aacenc/src/adj_thr.c
+++ b/media/libstagefright/codecs/aacenc/src/adj_thr.c
@@ -71,7 +71,7 @@
   Word32 *pthrExp, *psfbThre;
   for (ch=0; ch<nChannels; ch++) {
     PSY_OUT_CHANNEL *psyOutChan = &psyOutChannel[ch];
-	 for(sfbGrp = 0; sfbGrp < psyOutChan->sfbCnt; sfbGrp+= psyOutChan->sfbPerGroup)	 
+	 for(sfbGrp = 0; sfbGrp < psyOutChan->sfbCnt; sfbGrp+= psyOutChan->sfbPerGroup)
 	  pthrExp = &(thrExp[ch][sfbGrp]);
 	  psfbThre = psyOutChan->sfbThreshold + sfbGrp;
 	  for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
@@ -96,21 +96,21 @@
   Word32 nSfb, avgEn;
   Word16 log_avgEn = 0;
   Word32 startRatio_x_avgEn = 0;
-                                                                           
+
 
   for (ch=0; ch<nChannels; ch++) {
     PSY_OUT_CHANNEL* psyOutChan = &psyOutChannel[ch];
 
     /* calc average energy per scalefactor band */
-    avgEn = 0;                                                           
-    nSfb = 0;                                                            
+    avgEn = 0;
+    nSfb = 0;
     for (sfbOffs=0; sfbOffs<psyOutChan->sfbCnt; sfbOffs+=psyOutChan->sfbPerGroup) {
       for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
         avgEn = L_add(avgEn, psyOutChan->sfbEnergy[sfbOffs+sfb]);
         nSfb = nSfb + 1;
       }
     }
-     
+
     if (nSfb > 0) {
 	  avgEn = avgEn / nSfb;
 
@@ -118,7 +118,7 @@
       startRatio_x_avgEn = fixmul(msaParam->startRatio, avgEn);
     }
 
-    
+
     /* reduce minSnr requirement by minSnr^minSnrRed dependent on avgEn/sfbEn */
     for (sfbOffs=0; sfbOffs<psyOutChan->sfbCnt; sfbOffs+=psyOutChan->sfbPerGroup) {
       for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
@@ -126,22 +126,22 @@
           Word16 dbRatio, minSnrRed;
           Word32 snrRed;
           Word16 newMinSnr;
-          
+
           dbRatio = log_avgEn - logSfbEnergy[ch][sfbOffs+sfb];
           dbRatio = dbRatio + (dbRatio << 1);
 
           minSnrRed = 110 - ((dbRatio + (dbRatio << 1)) >> 2);
-          minSnrRed = max(minSnrRed, 20); /* 110: (0.375(redOffs)+1)*80,  
+          minSnrRed = max(minSnrRed, 20); /* 110: (0.375(redOffs)+1)*80,
                                                3: 0.00375(redRatioFac)*80
                                                20: 0.25(maxRed) * 80 */
 
-          snrRed = minSnrRed * iLog4((psyOutChan->sfbMinSnr[sfbOffs+sfb] << 16)); 
-          /* 
+          snrRed = minSnrRed * iLog4((psyOutChan->sfbMinSnr[sfbOffs+sfb] << 16));
+          /*
              snrRedI si now scaled by 80 (minSnrRed) and 4 (ffr_iLog4)
           */
-        
+
           newMinSnr = round16(pow2_xy(snrRed,80*4));
-         
+
           psyOutChan->sfbMinSnr[sfbOffs+sfb] = min(newMinSnr, minSnrLimit);
         }
       }
@@ -169,7 +169,7 @@
 
   for (ch=0; ch<nChannels; ch++) {
     PSY_OUT_CHANNEL *psyOutChan = &psyOutChannel[ch];
-     
+
     if (psyOutChan->windowSequence != SHORT_WINDOW) {
       for(sfbGrp = 0;sfbGrp < psyOutChan->sfbCnt;sfbGrp+= psyOutChan->sfbPerGroup){
          psfbSpreadEn = psyOutChan->sfbSpreadedEnergy + sfbGrp;
@@ -194,7 +194,7 @@
   if (ahParam->modifyMinSnr) {
     for(ch=0; ch<nChannels; ch++) {
       PSY_OUT_CHANNEL *psyOutChan = &psyOutChannel[ch];
-         
+
       if (psyOutChan->windowSequence != SHORT_WINDOW)
         threshold = HOLE_THR_LONG;
       else
@@ -204,39 +204,39 @@
         Word16 *psfbMinSnr = psyOutChan->sfbMinSnr + sfbGrp;
 		for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
           Word32 sfbEn, sfbEnm1, sfbEnp1, avgEn;
-             
+
           if (sfb > 0)
             sfbEnm1 = psyOutChan->sfbEnergy[sfbGrp+sfb-1];
           else
             sfbEnm1 = psyOutChan->sfbEnergy[sfbGrp];
-             
+
           if (sfb < (psyOutChan->maxSfbPerGroup-1))
             sfbEnp1 = psyOutChan->sfbEnergy[sfbGrp+sfb+1];
           else
             sfbEnp1 = psyOutChan->sfbEnergy[sfbGrp+sfb];
           avgEn = (sfbEnm1 + sfbEnp1) >> 1;
-          sfbEn = psyOutChan->sfbEnergy[sfbGrp+sfb];                             
-             
+          sfbEn = psyOutChan->sfbEnergy[sfbGrp+sfb];
+
           if (sfbEn > avgEn && avgEn > 0) {
             Word32 tmpMinSnr;
             shift = norm_l(sfbEn);
 			tmpMinSnr = Div_32(L_mpy_ls(avgEn, minSnrLimit) << shift, sfbEn << shift );
-            tmpMinSnr = max(tmpMinSnr, HOLE_THR_LONG);                  
+            tmpMinSnr = max(tmpMinSnr, HOLE_THR_LONG);
             tmpMinSnr = max(tmpMinSnr, threshold);
             *psfbMinSnr = min(*psfbMinSnr, tmpMinSnr);
           }
           /* valley ? */
-             
+
           if ((sfbEn < (avgEn >> 1)) && (sfbEn > 0)) {
             Word32 tmpMinSnr;
-            Word32 minSnrEn = L_mpy_wx(avgEn, *psfbMinSnr);                 
-             
+            Word32 minSnrEn = L_mpy_wx(avgEn, *psfbMinSnr);
+
             if(minSnrEn < sfbEn) {
 			  shift = norm_l(sfbEn);
               tmpMinSnr = Div_32( minSnrEn << shift, sfbEn<<shift);
             }
             else {
-              tmpMinSnr = MAX_16;                                             
+              tmpMinSnr = MAX_16;
             }
             tmpMinSnr = min(minSnrLimit, tmpMinSnr);
 
@@ -251,7 +251,7 @@
 
   /* stereo: adapt the minimum requirements sfbMinSnr of mid and
      side channels */
-   
+
   if (nChannels == 2) {
     PSY_OUT_CHANNEL *psyOutChanM = &psyOutChannel[0];
     PSY_OUT_CHANNEL *psyOutChanS = &psyOutChannel[1];
@@ -260,30 +260,30 @@
         Word32 sfbEnM = psyOutChanM->sfbEnergy[sfb];
         Word32 sfbEnS = psyOutChanS->sfbEnergy[sfb];
         Word32 maxSfbEn = max(sfbEnM, sfbEnS);
-        Word32 maxThr = L_mpy_wx(maxSfbEn, psyOutChanM->sfbMinSnr[sfb]) >> 1;        
-         
+        Word32 maxThr = L_mpy_wx(maxSfbEn, psyOutChanM->sfbMinSnr[sfb]) >> 1;
+
         if(maxThr >= sfbEnM) {
-          psyOutChanM->sfbMinSnr[sfb] = MAX_16;                                          
+          psyOutChanM->sfbMinSnr[sfb] = MAX_16;
         }
         else {
-          shift = norm_l(sfbEnM); 
-		  psyOutChanM->sfbMinSnr[sfb] = min(max(psyOutChanM->sfbMinSnr[sfb], 
+          shift = norm_l(sfbEnM);
+		  psyOutChanM->sfbMinSnr[sfb] = min(max(psyOutChanM->sfbMinSnr[sfb],
 			  round16(Div_32(maxThr<<shift, sfbEnM << shift))), minSnrLimit);
         }
-         
+
         if(maxThr >= sfbEnS) {
           psyOutChanS->sfbMinSnr[sfb] = MAX_16;
         }
         else {
 		  shift = norm_l(sfbEnS);
-          psyOutChanS->sfbMinSnr[sfb] = min(max(psyOutChanS->sfbMinSnr[sfb], 
+          psyOutChanS->sfbMinSnr[sfb] = min(max(psyOutChanS->sfbMinSnr[sfb],
 			  round16(Div_32(maxThr << shift, sfbEnS << shift))), minSnrLimit);
         }
 
-         
+
         if (sfbEnM > psyOutChanM->sfbSpreadedEnergy[sfb])
           psyOutChanS->sfbSpreadedEnergy[sfb] = L_mpy_ls(sfbEnS, MS_THRSPREAD_COEF);
-         
+
         if (sfbEnS > psyOutChanS->sfbSpreadedEnergy[sfb])
           psyOutChanM->sfbSpreadedEnergy[sfb] = L_mpy_ls(sfbEnM, MS_THRSPREAD_COEF);
       }
@@ -297,7 +297,7 @@
     for(sfbGrp = 0;sfbGrp < psyOutChan->sfbCnt;sfbGrp+= psyOutChan->sfbPerGroup){
       Word16 *pahFlag = ahFlag[ch] + sfbGrp;
 	  for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
-               
+
         if ((psyOutChan->sfbSpreadedEnergy[sfbGrp+sfb] > psyOutChan->sfbEnergy[sfbGrp+sfb]) ||
             (psyOutChan->sfbEnergy[sfbGrp+sfb] <= psyOutChan->sfbThreshold[sfbGrp+sfb]) ||
             (psyOutChan->sfbMinSnr[sfbGrp+sfb] == MAX_16)) {
@@ -308,7 +308,7 @@
         }
       }
       for (sfb=psyOutChan->maxSfbPerGroup; sfb<psyOutChan->sfbPerGroup; sfb++) {
-        *pahFlag++ = NO_AH;                                                          
+        *pahFlag++ = NO_AH;
       }
     }
   }
@@ -331,15 +331,15 @@
   Word16 ch, sfb, sfbGrp;
   int ipe, iconstPart, inActiveLines;
 
-  ipe = 0;                                                       
-  iconstPart = 0;                                                
-  inActiveLines = 0;                                             
+  ipe = 0;
+  iconstPart = 0;
+  inActiveLines = 0;
   for(ch=0; ch<nChannels; ch++) {
     PSY_OUT_CHANNEL *psyOutChan = &psyOutChannel[ch];
     PE_CHANNEL_DATA *peChanData = &peData->peChannelData[ch];
     for(sfbGrp = 0;sfbGrp < psyOutChan->sfbCnt;sfbGrp+= psyOutChan->sfbPerGroup){
       for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
-         
+
         if (ahFlag[ch][sfbGrp+sfb] < AH_ACTIVE) {
           ipe = ipe + peChanData->sfbPe[sfbGrp+sfb];
           iconstPart = iconstPart + peChanData->sfbConstPart[sfbGrp+sfb];
@@ -349,9 +349,9 @@
     }
   }
 
-  *pe = saturate(ipe);                                                       
-  *constPart = saturate(iconstPart);                                                
-  *nActiveLines = saturate(inActiveLines);  
+  *pe = saturate(ipe);
+  *constPart = saturate(iconstPart);
+  *nActiveLines = saturate(inActiveLines);
 }
 
 /********************************************************************************
@@ -367,16 +367,16 @@
                              const Word32     redVal)
 {
   Word32 sfbThrReduced;
-  Word32 *psfbEn, *psfbThr;     
+  Word32 *psfbEn, *psfbThr;
   Word16 ch, sfb, sfbGrp;
 
   for(ch=0; ch<nChannels; ch++) {
     PSY_OUT_CHANNEL *psyOutChan = &psyOutChannel[ch];
     for(sfbGrp=0; sfbGrp<psyOutChan->sfbCnt; sfbGrp+=psyOutChan->sfbPerGroup) {
- 	  psfbEn  = psyOutChan->sfbEnergy + sfbGrp;                                      
+ 	  psfbEn  = psyOutChan->sfbEnergy + sfbGrp;
       psfbThr = psyOutChan->sfbThreshold + sfbGrp;
 	  for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
-         
+
         if (*psfbEn > *psfbThr) {
           /* threshold reduction formula */
           Word32 tmp = thrExp[ch][sfbGrp+sfb] + redVal;
@@ -384,11 +384,11 @@
           sfbThrReduced = fixmul(tmp, tmp);
           /* avoid holes */
           tmp = L_mpy_ls(*psfbEn, psyOutChan->sfbMinSnr[sfbGrp+sfb]);
-             
-          if ((sfbThrReduced > tmp) && 
+
+          if ((sfbThrReduced > tmp) &&
               (ahFlag[ch][sfbGrp+sfb] != NO_AH)){
             sfbThrReduced = max(tmp, *psfbThr);
-            ahFlag[ch][sfbGrp+sfb] = AH_ACTIVE;                                          
+            ahFlag[ch][sfbGrp+sfb] = AH_ACTIVE;
           }
 		  *psfbThr = sfbThrReduced;
         }
@@ -426,7 +426,7 @@
   Word32 sfbThrReduced;
 
   /* for each sfb calc relative factors for pe changes */
-  normFactor = 1;                                                                        
+  normFactor = 1;
   for(ch=0; ch<nChannels; ch++) {
     psyOutChan = &psyOutChannel[ch];
     peChanData = &peData->peChannelData[ch];
@@ -436,22 +436,22 @@
 	  pahFlag = ahFlag[ch] + sfbGrp;
 	  for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
         Word32 redThrExp = thrExp[ch][sfbGrp+sfb] + redVal;
-             
+
         if (((*pahFlag < AH_ACTIVE) || (deltaPe > 0)) && (redThrExp > 0) ) {
-            
+
           *psfbPeFactors = (*psfbNActiveLines) * (0x7fffffff / redThrExp);
           normFactor = L_add(normFactor, *psfbPeFactors);
         }
         else {
-          *psfbPeFactors = 0;                                              
+          *psfbPeFactors = 0;
         }
-		psfbPeFactors++; 
+		psfbPeFactors++;
 		pahFlag++; psfbNActiveLines++;
       }
     }
   }
 
- 
+
   /* calculate new thresholds */
   for(ch=0; ch<nChannels; ch++) {
     psyOutChan = &psyOutChannel[ch];
@@ -464,7 +464,7 @@
         /* pe difference for this sfb */
         deltaSfbPe = *psfbPeFactors * deltaPe;
 
-		/* thr3(n) = thr2(n)*2^deltaSfbPe/b(n) */         
+		/* thr3(n) = thr2(n)*2^deltaSfbPe/b(n) */
         if (*psfbNActiveLines > 0) {
           /* new threshold */
           Word32 thrFactor;
@@ -476,7 +476,7 @@
               reduce threshold
             */
             thrFactor = pow2_xy(L_negate(deltaSfbPe), (normFactor* (*psfbNActiveLines)));
-              
+
             sfbThrReduced = L_mpy_ls(sfbThr, round16(thrFactor));
           }
           else {
@@ -484,28 +484,28 @@
               increase threshold
             */
             thrFactor = pow2_xy(deltaSfbPe, (normFactor * (*psfbNActiveLines)));
-              
-             
+
+
             if(thrFactor > sfbThr) {
               shift = norm_l(thrFactor);
 			  sfbThrReduced = Div_32( sfbThr << shift, thrFactor<<shift );
             }
             else {
-              sfbThrReduced = MAX_32;                                                                            
+              sfbThrReduced = MAX_32;
             }
 
           }
-            
+
           /* avoid hole */
           sfbEn = L_mpy_ls(sfbEn, psyOutChan->sfbMinSnr[sfbGrp+sfb]);
-             
+
           if ((sfbThrReduced > sfbEn) &&
               (*pahFlag == AH_INACTIVE)) {
             sfbThrReduced = max(sfbEn, sfbThr);
-            *pahFlag = AH_ACTIVE;                                                                  
+            *pahFlag = AH_ACTIVE;
           }
 
-          psyOutChan->sfbThreshold[sfbGrp+sfb] = sfbThrReduced;  
+          psyOutChan->sfbThreshold[sfbGrp+sfb] = sfbThrReduced;
         }
 
 		pahFlag++; psfbNActiveLines++; psfbPeFactors++;
@@ -521,8 +521,8 @@
 * description: if the desired pe can not be reached, reduce pe by reducing minSnr
 *
 **********************************************************************************/
-static void reduceMinSnr(PSY_OUT_CHANNEL  psyOutChannel[MAX_CHANNELS], 
-                         PE_DATA         *peData, 
+static void reduceMinSnr(PSY_OUT_CHANNEL  psyOutChannel[MAX_CHANNELS],
+                         PE_DATA         *peData,
                          Word16           ahFlag[MAX_CHANNELS][MAX_GROUPED_SFB],
                          const Word16     nChannels,
                          const Word16     desiredPe)
@@ -531,9 +531,9 @@
   Word16 deltaPe;
 
   /* start at highest freq down to 0 */
-  sfbSubWin = psyOutChannel[0].maxSfbPerGroup;                                                 
+  sfbSubWin = psyOutChannel[0].maxSfbPerGroup;
   while (peData->pe > desiredPe && sfbSubWin > 0) {
-       
+
     sfbSubWin = sfbSubWin - 1;
     /* loop over all subwindows */
     for (sfb=sfbSubWin; sfb<psyOutChannel[0].sfbCnt;
@@ -541,10 +541,10 @@
       /* loop over all channels */
 		PE_CHANNEL_DATA* peChan = peData->peChannelData;
 		PSY_OUT_CHANNEL* psyOutCh = psyOutChannel;
-		for (ch=0; ch<nChannels; ch++) {           
+		for (ch=0; ch<nChannels; ch++) {
         if (ahFlag[ch][sfb] != NO_AH &&
             psyOutCh->sfbMinSnr[sfb] < minSnrLimit) {
-          psyOutCh->sfbMinSnr[sfb] = minSnrLimit;                                      
+          psyOutCh->sfbMinSnr[sfb] = minSnrLimit;
           psyOutCh->sfbThreshold[sfb] =
             L_mpy_ls(psyOutCh->sfbEnergy[sfb], psyOutCh->sfbMinSnr[sfb]);
 
@@ -552,12 +552,12 @@
           deltaPe = ((peChan->sfbNLines4[sfb] + (peChan->sfbNLines4[sfb] >> 1)) >> 2) -
               peChan->sfbPe[sfb];
           peData->pe = peData->pe + deltaPe;
-          peChan->pe = peChan->pe + deltaPe;		  
+          peChan->pe = peChan->pe + deltaPe;
         }
 		peChan += 1; psyOutCh += 1;
       }
       /* stop if enough has been saved */
-       
+
       if (peData->pe <= desiredPe)
         break;
     }
@@ -567,13 +567,13 @@
 /********************************************************************************
 *
 * function name:allowMoreHoles
-* description: if the desired pe can not be reached, some more scalefactor bands  
+* description: if the desired pe can not be reached, some more scalefactor bands
 *              have to be quantized to zero
 *
 **********************************************************************************/
-static void allowMoreHoles(PSY_OUT_CHANNEL  psyOutChannel[MAX_CHANNELS], 
+static void allowMoreHoles(PSY_OUT_CHANNEL  psyOutChannel[MAX_CHANNELS],
                            PSY_OUT_ELEMENT *psyOutElement,
-                           PE_DATA         *peData, 
+                           PE_DATA         *peData,
                            Word16           ahFlag[MAX_CHANNELS][MAX_GROUPED_SFB],
                            const AH_PARAM  *ahParam,
                            const Word16     nChannels,
@@ -582,46 +582,46 @@
   Word16 ch, sfb;
   Word16 actPe, shift;
 
-  actPe = peData->pe;                                                                    
+  actPe = peData->pe;
 
   /* for MS allow hole in the channel with less energy */
-     
+
   if (nChannels==2 &&
       psyOutChannel[0].windowSequence==psyOutChannel[1].windowSequence) {
     PSY_OUT_CHANNEL *psyOutChanL = &psyOutChannel[0];
     PSY_OUT_CHANNEL *psyOutChanR = &psyOutChannel[1];
     for (sfb=0; sfb<psyOutChanL->sfbCnt; sfb++) {
       Word32 minEn;
-       
+
       if (psyOutElement->toolsInfo.msMask[sfb]) {
         /* allow hole in side channel ? */
         minEn = L_mpy_ls(psyOutChanL->sfbEnergy[sfb], (minSnrLimit * psyOutChanL->sfbMinSnr[sfb]) >> 16);
-           
+
         if (ahFlag[1][sfb] != NO_AH &&
             minEn > psyOutChanR->sfbEnergy[sfb]) {
-          ahFlag[1][sfb] = NO_AH;                                                                
+          ahFlag[1][sfb] = NO_AH;
           psyOutChanR->sfbThreshold[sfb] = L_add(psyOutChanR->sfbEnergy[sfb], psyOutChanR->sfbEnergy[sfb]);
           actPe = actPe - peData->peChannelData[1].sfbPe[sfb];
         }
         /* allow hole in mid channel ? */
         else {
         minEn = L_mpy_ls(psyOutChanR->sfbEnergy[sfb], (minSnrLimit * psyOutChanR->sfbMinSnr[sfb]) >> 16);
-             
+
           if (ahFlag[0][sfb]!= NO_AH &&
               minEn > psyOutChanL->sfbEnergy[sfb]) {
-            ahFlag[0][sfb] = NO_AH;                                                              
+            ahFlag[0][sfb] = NO_AH;
             psyOutChanL->sfbThreshold[sfb] = L_add(psyOutChanL->sfbEnergy[sfb], psyOutChanL->sfbEnergy[sfb]);
             actPe = actPe - peData->peChannelData[0].sfbPe[sfb];
           }
         }
-         
+
         if (actPe < desiredPe)
           break;
       }
     }
   }
 
-  /* subsequently erase bands */   
+  /* subsequently erase bands */
   if (actPe > desiredPe) {
     Word16 startSfb[2];
     Word32 avgEn, minEn;
@@ -634,20 +634,20 @@
 
     /* do not go below startSfb */
     for (ch=0; ch<nChannels; ch++) {
-         
+
       if (psyOutChannel[ch].windowSequence != SHORT_WINDOW)
         startSfb[ch] = ahParam->startSfbL;
       else
         startSfb[ch] = ahParam->startSfbS;
     }
 
-    avgEn = 0;                                                           
-    minEn = MAX_32;                                                      
-    ahCnt = 0;                                                           
+    avgEn = 0;
+    minEn = MAX_32;
+    ahCnt = 0;
     for (ch=0; ch<nChannels; ch++) {
       PSY_OUT_CHANNEL *psyOutChan = &psyOutChannel[ch];
       for (sfb=startSfb[ch]; sfb<psyOutChan->sfbCnt; sfb++) {
-           
+
         if ((ahFlag[ch][sfb] != NO_AH) &&
             (psyOutChan->sfbEnergy[sfb] > psyOutChan->sfbThreshold[sfb])) {
           minEn = min(minEn, psyOutChan->sfbEnergy[sfb]);
@@ -656,7 +656,7 @@
         }
       }
     }
-     
+
     if(ahCnt) {
       Word32 iahCnt;
       shift = norm_l(ahCnt);
@@ -674,46 +674,46 @@
 
     /* start with lowest energy border at highest sfb */
     maxSfb = psyOutChannel[0].sfbCnt - 1;
-    minSfb = startSfb[0];                                                                
-     
+    minSfb = startSfb[0];
+
     if (nChannels == 2) {
       maxSfb = max(maxSfb, (psyOutChannel[1].sfbCnt - 1));
       minSfb = min(minSfb, startSfb[1]);
     }
 
-    sfb = maxSfb;                                                                        
-    enIdx = 0;                                                                           
-    done = 0;                                                                            
+    sfb = maxSfb;
+    enIdx = 0;
+    done = 0;
     while (!done) {
-       
+
       for (ch=0; ch<nChannels; ch++) {
         PSY_OUT_CHANNEL *psyOutChan = &psyOutChannel[ch];
-           
+
         if (sfb>=startSfb[ch] && sfb<psyOutChan->sfbCnt) {
           /* sfb energy below border ? */
-             
+
           if (ahFlag[ch][sfb] != NO_AH && psyOutChan->sfbEnergy[sfb] < en[enIdx]){
             /* allow hole */
-            ahFlag[ch][sfb] = NO_AH;                                                     
+            ahFlag[ch][sfb] = NO_AH;
             psyOutChan->sfbThreshold[sfb] = L_add(psyOutChan->sfbEnergy[sfb], psyOutChan->sfbEnergy[sfb]);
             actPe = actPe - peData->peChannelData[ch].sfbPe[sfb];
           }
-           
+
           if (actPe < desiredPe) {
-            done = 1;                                                                    
+            done = 1;
             break;
           }
         }
       }
       sfb = sfb - 1;
-       
+
       if (sfb < minSfb) {
         /* restart with next energy border */
-        sfb = maxSfb;                                                                    
+        sfb = maxSfb;
         enIdx = enIdx + 1;
-         
+
         if (enIdx - 4 >= 0)
-          done = 1;                                                                      
+          done = 1;
       }
     }
   }
@@ -748,13 +748,13 @@
 
   initAvoidHoleFlag(peData->ahFlag, psyOutChannel, psyOutElement, nChannels, ahParam);
 
-  noRedPe = peData->pe;                                                          
-  constPart = peData->constPart;                                                 
-  nActiveLines = peData->nActiveLines;       
+  noRedPe = peData->pe;
+  constPart = peData->constPart;
+  nActiveLines = peData->nActiveLines;
 
   /* first guess of reduction value t^0.25 = 2^((a-pen)/4*b) */
   avgThrExp = pow2_xy((constPart - noRedPe), (nActiveLines << 2));
-  
+
   /* r1 = 2^((a-per)/4*b) - t^0.25 */
   redVal = pow2_xy((constPart - desiredPe), (nActiveLines << 2)) - avgThrExp;
 
@@ -763,40 +763,40 @@
 
   /* pe after first guess */
   calcSfbPe(peData, psyOutChannel, nChannels);
-  redPe = peData->pe;                                                            
+  redPe = peData->pe;
 
-  iter = 0;                                                                      
+  iter = 0;
   do {
     /* pe for bands where avoid hole is inactive */
     calcPeNoAH(&redPeNoAH, &constPartNoAH, &nActiveLinesNoAH,
                peData, peData->ahFlag, psyOutChannel, nChannels);
 
     desiredPeNoAH = desiredPe -(redPe - redPeNoAH);
-     
+
     if (desiredPeNoAH < 0) {
-      desiredPeNoAH = 0;                                                         
+      desiredPeNoAH = 0;
     }
 
     /* second guess */
-     
+
     if (nActiveLinesNoAH > 0) {
-		
+
 		avgThrExp = pow2_xy((constPartNoAH - redPeNoAH), (nActiveLinesNoAH << 2));
-		
+
 		redVal = (redVal + pow2_xy((constPartNoAH - desiredPeNoAH), (nActiveLinesNoAH << 2))) - avgThrExp;
-		
+
 		/* reduce thresholds */
 		reduceThresholds(psyOutChannel, peData->ahFlag, peData->thrExp, nChannels, redVal);
     }
 
     calcSfbPe(peData, psyOutChannel, nChannels);
-    redPe = peData->pe;                                                          
+    redPe = peData->pe;
 
     iter = iter+1;
-       
+
   } while ((20 * abs_s(redPe - desiredPe) > desiredPe) && (iter < 2));
 
-   
+
   if ((100 * redPe < 115 * desiredPe)) {
     correctThresh(psyOutChannel, peData->ahFlag, peData, peData->thrExp, redVal,
                   nChannels, desiredPe - redPe);
@@ -863,7 +863,7 @@
   if(clipHigh-clipLow)
   bitspend = (minBitSpend + ((maxBitSpend - minBitSpend)*(fillLevel - clipLow) /
                                 (clipHigh-clipLow)));
-                            
+
   return (bitspend);
 }
 
@@ -884,19 +884,19 @@
   Word16 minFacHi, maxFacHi, minFacLo, maxFacLo;
   Word16 diff;
   Word16 minDiff = extract_l(currPe / 6);
-  minFacHi = 30;                                                         
-  maxFacHi = 100;                                                        
-  minFacLo = 14;                                                         
-  maxFacLo = 7;                                                          
+  minFacHi = 30;
+  maxFacHi = 100;
+  minFacLo = 14;
+  maxFacLo = 7;
 
   diff = currPe - *peMax ;
-   
+
   if (diff > 0) {
     *peMin = *peMin + ((diff * minFacHi) / 100);
     *peMax = *peMax + ((diff * maxFacHi) / 100);
   } else {
     diff = *peMin - currPe;
-     
+
     if (diff > 0) {
       *peMin = *peMin - ((diff * minFacLo) / 100);
       *peMax = *peMax - ((diff * maxFacLo) / 100);
@@ -906,7 +906,7 @@
     }
   }
 
-   
+
   if ((*peMax - *peMin) < minDiff) {
     Word16 partLo, partHi;
 
@@ -969,7 +969,7 @@
                     (adjThrChan->peMax - adjThrChan->peMin));
   else
 	bitresFac = 0x7fff;
-               
+
   bitresFac = min(bitresFac,
                     (100-30 + extract_l((100 * bitresBits) / avgBits)));
 
@@ -995,23 +995,23 @@
 
   /* common for all elements: */
   /* parameters for bitres control */
-  hAdjThr->bresParamLong.clipSaveLow   =  20;                    
-  hAdjThr->bresParamLong.clipSaveHigh  =  95;                    
-  hAdjThr->bresParamLong.minBitSave    =  -5;                    
-  hAdjThr->bresParamLong.maxBitSave    =  30;                    
-  hAdjThr->bresParamLong.clipSpendLow  =  20;                    
-  hAdjThr->bresParamLong.clipSpendHigh =  95;                    
-  hAdjThr->bresParamLong.minBitSpend   = -10;                    
-  hAdjThr->bresParamLong.maxBitSpend   =  40;                    
+  hAdjThr->bresParamLong.clipSaveLow   =  20;
+  hAdjThr->bresParamLong.clipSaveHigh  =  95;
+  hAdjThr->bresParamLong.minBitSave    =  -5;
+  hAdjThr->bresParamLong.maxBitSave    =  30;
+  hAdjThr->bresParamLong.clipSpendLow  =  20;
+  hAdjThr->bresParamLong.clipSpendHigh =  95;
+  hAdjThr->bresParamLong.minBitSpend   = -10;
+  hAdjThr->bresParamLong.maxBitSpend   =  40;
 
-  hAdjThr->bresParamShort.clipSaveLow   =  20;                   
-  hAdjThr->bresParamShort.clipSaveHigh  =  75;                   
-  hAdjThr->bresParamShort.minBitSave    =   0;                   
-  hAdjThr->bresParamShort.maxBitSave    =  20;                   
-  hAdjThr->bresParamShort.clipSpendLow  =  20;                   
-  hAdjThr->bresParamShort.clipSpendHigh =  75;                   
-  hAdjThr->bresParamShort.minBitSpend   = -5;                    
-  hAdjThr->bresParamShort.maxBitSpend   =  50;                   
+  hAdjThr->bresParamShort.clipSaveLow   =  20;
+  hAdjThr->bresParamShort.clipSaveHigh  =  75;
+  hAdjThr->bresParamShort.minBitSave    =   0;
+  hAdjThr->bresParamShort.maxBitSave    =  20;
+  hAdjThr->bresParamShort.clipSpendLow  =  20;
+  hAdjThr->bresParamShort.clipSpendHigh =  75;
+  hAdjThr->bresParamShort.minBitSpend   = -5;
+  hAdjThr->bresParamShort.maxBitSpend   =  50;
 
   /* specific for each element: */
 
@@ -1020,7 +1020,7 @@
   atsElem->peMax = extract_l(((120*meanPe) / 100));
 
   /* additional pe offset to correct pe2bits for low bitrates */
-  atsElem->peOffset = 0;                             
+  atsElem->peOffset = 0;
   if (chBitrate < 32000) {
     atsElem->peOffset = max(50, (100 - extract_l((100 * chBitrate) / 32000)));
   }
@@ -1039,24 +1039,24 @@
 
   /* minSnr adaptation */
   /* maximum reduction of minSnr goes down to minSnr^maxRed */
-  msaParam->maxRed = 0x20000000;     /* *0.25f /                        
+  msaParam->maxRed = 0x20000000;     /* *0.25f */
   /* start adaptation of minSnr for avgEn/sfbEn > startRatio */
-  msaParam->startRatio = 0x0ccccccd; /* 10 */                        
+  msaParam->startRatio = 0x0ccccccd; /* 10 */
   /* maximum minSnr reduction to minSnr^maxRed is reached for
      avgEn/sfbEn >= maxRatio */
-  msaParam->maxRatio =  0x0020c49c; /* 1000 */                         
+  msaParam->maxRatio =  0x0020c49c; /* 1000 */
   /* helper variables to interpolate minSnr reduction for
      avgEn/sfbEn between startRatio and maxRatio */
 
-  msaParam->redRatioFac = 0xfb333333; /* -0.75/20 */         
+  msaParam->redRatioFac = 0xfb333333; /* -0.75/20 */
 
-  msaParam->redOffs = 0x30000000;  /* msaParam->redRatioFac * 10*log10(msaParam->startRatio) */  
+  msaParam->redOffs = 0x30000000;  /* msaParam->redRatioFac * 10*log10(msaParam->startRatio) */
 
-       
+
   /* pe correction */
-  atsElem->peLast = 0;                                                 
-  atsElem->dynBitsLast = 0;                                            
-  atsElem->peCorrectionFactor = 100; /* 1.0 */                         
+  atsElem->peLast = 0;
+  atsElem->dynBitsLast = 0;
+  atsElem->peCorrectionFactor = 100; /* 1.0 */
 
 }
 
@@ -1069,20 +1069,20 @@
 *****************************************************************************/
 static void calcPeCorrection(Word16 *correctionFac,
                              const Word16 peAct,
-                             const Word16 peLast, 
-                             const Word16 bitsLast) 
+                             const Word16 peLast,
+                             const Word16 bitsLast)
 {
   Word32 peAct100 = 100 * peAct;
   Word32 peLast100 = 100 * peLast;
   Word16 peBitsLast = bits2pe(bitsLast);
-           
+
   if ((bitsLast > 0) &&
       (peAct100 < (150 * peLast)) &&  (peAct100 > (70 * peLast)) &&
       ((120 * peBitsLast) > peLast100 ) && (( 65 * peBitsLast) < peLast100))
     {
       Word16 newFac = (100 * peLast) / peBitsLast;
       /* dead zone */
-       
+
       if (newFac < 100) {
         newFac = min(((110 * newFac) / 100), 100);
         newFac = max(newFac, 85);
@@ -1091,13 +1091,13 @@
         newFac = max(((90 * newFac) / 100), 100);
         newFac = min(newFac, 115);
       }
-         
+
       if ((newFac > 100 && *correctionFac < 100) ||
           (newFac < 100 && *correctionFac > 100)) {
-        *correctionFac = 100;                                                    
+        *correctionFac = 100;
       }
       /* faster adaptation towards 1.0, slower in the other direction */
-             
+
       if ((*correctionFac < 100 && newFac < *correctionFac) ||
           (*correctionFac > 100 && newFac > *correctionFac))
         *correctionFac = (85 * *correctionFac + 15 * newFac) / 100;
@@ -1107,7 +1107,7 @@
       *correctionFac = max(*correctionFac, 85);
     }
   else {
-    *correctionFac = 100;                                                        
+    *correctionFac = 100;
   }
 }
 
@@ -1123,40 +1123,40 @@
                       PSY_OUT_ELEMENT *psyOutElement,
                       Word16          *chBitDistribution,
                       Word16           logSfbEnergy[MAX_CHANNELS][MAX_GROUPED_SFB],
-                      Word16           sfbNRelevantLines[MAX_CHANNELS][MAX_GROUPED_SFB],                      
+                      Word16           sfbNRelevantLines[MAX_CHANNELS][MAX_GROUPED_SFB],
                       QC_OUT_ELEMENT  *qcOE,
 					  ELEMENT_BITS	  *elBits,
 					  const Word16     nChannels,
                       const Word16     maxBitFac)
 {
-  PE_DATA peData;  
+  PE_DATA peData;
   Word16 noRedPe, grantedPe, grantedPeCorr;
   Word16 curWindowSequence;
   Word16 bitFactor;
   Word16 avgBits = (elBits->averageBits - (qcOE->staticBitsUsed + qcOE->ancBitsUsed));
-  Word16 bitresBits = elBits->bitResLevel; 
+  Word16 bitresBits = elBits->bitResLevel;
   Word16 maxBitresBits = elBits->maxBits;
   Word16 sideInfoBits = (qcOE->staticBitsUsed + qcOE->ancBitsUsed);
   Word16 ch;
-   
+
   prepareSfbPe(&peData, psyOutChannel, logSfbEnergy, sfbNRelevantLines, nChannels, AdjThrStateElement->peOffset);
-   
+
   /* pe without reduction */
   calcSfbPe(&peData, psyOutChannel, nChannels);
-  noRedPe = peData.pe;                                                   
+  noRedPe = peData.pe;
 
 
-  curWindowSequence = LONG_WINDOW;                                       
-   
+  curWindowSequence = LONG_WINDOW;
+
   if (nChannels == 2) {
-       
+
     if ((psyOutChannel[0].windowSequence == SHORT_WINDOW) ||
         (psyOutChannel[1].windowSequence == SHORT_WINDOW)) {
-      curWindowSequence = SHORT_WINDOW;                                  
+      curWindowSequence = SHORT_WINDOW;
     }
   }
   else {
-    curWindowSequence = psyOutChannel[0].windowSequence;                 
+    curWindowSequence = psyOutChannel[0].windowSequence;
   }
 
 
@@ -1170,13 +1170,13 @@
   grantedPe = ((bitFactor * bits2pe(avgBits)) / 100);
 
   /* correction of pe value */
-  calcPeCorrection(&(AdjThrStateElement->peCorrectionFactor), 
+  calcPeCorrection(&(AdjThrStateElement->peCorrectionFactor),
                    min(grantedPe, noRedPe),
-                   AdjThrStateElement->peLast, 
+                   AdjThrStateElement->peLast,
                    AdjThrStateElement->dynBitsLast);
   grantedPeCorr = (grantedPe * AdjThrStateElement->peCorrectionFactor) / 100;
 
-     
+
   if (grantedPeCorr < noRedPe && noRedPe > peData.offset) {
     /* calc threshold necessary for desired pe */
     adaptThresholdsToPe(psyOutChannel,
@@ -1192,8 +1192,8 @@
   /* calculate relative distribution */
   for (ch=0; ch<nChannels; ch++) {
     Word16 peOffsDiff = peData.pe - peData.offset;
-    chBitDistribution[ch] = 200;                                                 
-     
+    chBitDistribution[ch] = 200;
+
     if (peOffsDiff > 0) {
       Word32 temp = 1000 - (nChannels * 200);
       chBitDistribution[ch] = chBitDistribution[ch] +
@@ -1202,10 +1202,10 @@
   }
 
   /* store pe */
-  qcOE->pe = noRedPe;                                                            
+  qcOE->pe = noRedPe;
 
   /* update last pe */
-  AdjThrStateElement->peLast = grantedPe;                                        
+  AdjThrStateElement->peLast = grantedPe;
 }
 
 /********************************************************************************
@@ -1217,7 +1217,7 @@
 void AdjThrUpdate(ATS_ELEMENT *AdjThrStateElement,
                   const Word16 dynBitsUsed)
 {
-  AdjThrStateElement->dynBitsLast = dynBitsUsed;                                 
+  AdjThrStateElement->dynBitsLast = dynBitsUsed;
 }
 
 
diff --git a/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/AutoCorrelation_v5.s b/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/AutoCorrelation_v5.s
index e0885f1..e705197 100644
--- a/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/AutoCorrelation_v5.s
+++ b/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/AutoCorrelation_v5.s
@@ -22,34 +22,34 @@
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 
 
-	.section .text	
+	.section .text
 	.global	AutoCorrelation
 
 AutoCorrelation:
 	stmdb     sp!, {r4 - r11, lr}
 
-  sub     r13, r13, #20                     
+  sub     r13, r13, #20
 
-  mov     r5, r0                            
-  mov     r7, r1                            
-  mov     r9, r3                            
-  mov     r2, r2, lsl #16                      
-  mov     r0, #0          
-  mov     r4, r2, asr #16                   
-  mov     r8, #0                            
-  cmp     r4, #0                            
-  ble     L136        
-	
-	cmp     r4, #8 
-	mov		  r2, #0 
-  blt     L133   
+  mov     r5, r0
+  mov     r7, r1
+  mov     r9, r3
+  mov     r2, r2, lsl #16
+  mov     r0, #0
+  mov     r4, r2, asr #16
+  mov     r8, #0
+  cmp     r4, #0
+  ble     L136
 
-	sub     r12, r4, #8                
-L132:  
-  ldr     r6, [r5, r2]  
+	cmp     r4, #8
+	mov		  r2, #0
+  blt     L133
+
+	sub     r12, r4, #8
+L132:
+  ldr     r6, [r5, r2]
 	add		  r2, r2, #4
 	smulbb  r3, r6, r6
-	ldr     r1, [r5, r2] 
+	ldr     r1, [r5, r2]
 	smultt	r10, r6, r6
 	mov		  r3, r3, asr #9
 	smulbb	r6, r1, r1
@@ -72,95 +72,95 @@
 	add     r8, r8, #6
 
 	qadd	  r0, r0, r6
-	cmp     r8, r12                            
-  blt     L132	                  
-L133:                         
-  ldrsh   r6, [r5, r2]                      
-  mul     r10, r6, r6   
-	add     r2, r2, #2                     
-  mov     r1, r10, asr #9                    
+	cmp     r8, r12
+  blt     L132
+L133:
+  ldrsh   r6, [r5, r2]
+  mul     r10, r6, r6
+	add     r2, r2, #2
+  mov     r1, r10, asr #9
   qadd    r0, r0, r1
-L134:                         
-  add     r8, r8, #1                        
-  cmp     r8, r4                            
-  blt     L133                            
-L135:                        
-L136:                         
-  str     r0, [r7, #0]                      
-  cmp     r0, #0                            
-  beq     L1320                           
-L137:                         
-  mov     r2, r9, lsl #16                   
-	mov     r8, #1                                
-  mov     r2, r2, asr #16                   
-  cmp     r2, #1                            
-  ble     L1319                           
-L138:                        
-L139:                         
-  sub     r4, r4, #1                        
-  mov     r14, #0                           
-  mov     r3, #0                            
-  cmp     r4, #0                            
-  ble     L1317                           
-L1310:                       
-  cmp     r4, #6                            
-  addlt   r6, r5, r8, lsl #1                
-  blt     L1314                           
-L1311:                        
-  add     r6, r5, r8, lsl #1                
-  sub     r12, r4, #6                       
-  str     r8, [r13, #8]                     
-  str     r7, [r13, #4]                     
-L1312:                        
-  mov     r1, r3, lsl #1                    
-  ldrsh   r7, [r6, r1]                      
-  ldrsh   r10, [r5, r1]  
-  add     r8, r1, r6 
-	add     r9, r5, r1                       
+L134:
+  add     r8, r8, #1
+  cmp     r8, r4
+  blt     L133
+L135:
+L136:
+  str     r0, [r7, #0]
+  cmp     r0, #0
+  beq     L1320
+L137:
+  mov     r2, r9, lsl #16
+	mov     r8, #1
+  mov     r2, r2, asr #16
+  cmp     r2, #1
+  ble     L1319
+L138:
+L139:
+  sub     r4, r4, #1
+  mov     r14, #0
+  mov     r3, #0
+  cmp     r4, #0
+  ble     L1317
+L1310:
+  cmp     r4, #6
+  addlt   r6, r5, r8, lsl #1
+  blt     L1314
+L1311:
+  add     r6, r5, r8, lsl #1
+  sub     r12, r4, #6
+  str     r8, [r13, #8]
+  str     r7, [r13, #4]
+L1312:
+  mov     r1, r3, lsl #1
+  ldrsh   r7, [r6, r1]
+  ldrsh   r10, [r5, r1]
+  add     r8, r1, r6
+	add     r9, r5, r1
 	mul     r7, r10, r7
-  ldrsh   r1, [r8, #2] 
-	ldrsh   r10, [r8, #4]   
-  add     r7, r14, r7, asr #9  	                                             
-  ldrsh   r0, [r9, #2]                          
-  ldrsh   r11, [r9, #4]                   
-  mul     r1, r0, r1                        
-  ldrsh   r14, [r8, #6]                     
-  mul     r10, r11, r10          
-	add     r7, r7, r1, asr #9            
-  ldrsh   r8, [r8, #8] 
+  ldrsh   r1, [r8, #2]
+	ldrsh   r10, [r8, #4]
+  add     r7, r14, r7, asr #9
+  ldrsh   r0, [r9, #2]
+  ldrsh   r11, [r9, #4]
+  mul     r1, r0, r1
+  ldrsh   r14, [r8, #6]
+  mul     r10, r11, r10
+	add     r7, r7, r1, asr #9
+  ldrsh   r8, [r8, #8]
 	add     r3, r3, #5
-	ldrsh   r11, [r9, #6]                  
-  ldrsh   r1, [r9, #8]                      
-  mul     r14, r11, r14                     
-  add     r7, r7, r10, asr #9       
-  mul     r1, r1, r8                             
-  add     r14, r7, r14, asr #9              
-	cmp     r3, r12 
-  add     r14, r14, r1, asr #9              
-  ble     L1312                           
-L1313:                        
-  ldr     r8, [r13, #8]                     
-  ldr     r7, [r13, #4]                     
-L1314:                        
-L1315:                        
-  mov     r12, r3, lsl #1                   
-  ldrsh   r9, [r6, r12]                     
-  ldrsh   r12, [r5, r12]                    
-  add     r3, r3, #1                        
-  cmp     r3, r4                            
-  mul     r12, r12, r9                      
-  add     r14, r14, r12, asr #9             
-  blt     L1315                           
-L1316:                        
-L1317:                        
-  str     r14, [r7, +r8, lsl #2]            
-  add     r8, r8, #1                        
-  cmp     r8, r2                            
-  blt     L139   
-	                         
+	ldrsh   r11, [r9, #6]
+  ldrsh   r1, [r9, #8]
+  mul     r14, r11, r14
+  add     r7, r7, r10, asr #9
+  mul     r1, r1, r8
+  add     r14, r7, r14, asr #9
+	cmp     r3, r12
+  add     r14, r14, r1, asr #9
+  ble     L1312
+L1313:
+  ldr     r8, [r13, #8]
+  ldr     r7, [r13, #4]
+L1314:
+L1315:
+  mov     r12, r3, lsl #1
+  ldrsh   r9, [r6, r12]
+  ldrsh   r12, [r5, r12]
+  add     r3, r3, #1
+  cmp     r3, r4
+  mul     r12, r12, r9
+  add     r14, r14, r12, asr #9
+  blt     L1315
+L1316:
+L1317:
+  str     r14, [r7, +r8, lsl #2]
+  add     r8, r8, #1
+  cmp     r8, r2
+  blt     L139
+
 L1319:
 L1320:
-	add     r13, r13, #20                    
+	add     r13, r13, #20
 	ldmia   sp!, {r4 - r11, pc}
 
 	@ENDP  @ |AutoCorrelation|
diff --git a/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/CalcWindowEnergy_v5.s b/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/CalcWindowEnergy_v5.s
index 75b916c..b30e8cb 100644
--- a/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/CalcWindowEnergy_v5.s
+++ b/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/CalcWindowEnergy_v5.s
@@ -22,91 +22,91 @@
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 
 	.section .text
-	
+
 	.global	CalcWindowEnergy
 
 CalcWindowEnergy:
 	stmdb   sp!, {r4 - r11, lr}
-	sub     r13, r13, #20 
+	sub     r13, r13, #20
 
-  mov     r3, r3, lsl #16                         
+  mov     r3, r3, lsl #16
 	ldr     r10, [r0, #168]                    @ states0 = blockSwitchingControl->iirStates[0];
-  mov     r3, r3, asr #16 
+  mov     r3, r3, asr #16
 	ldr     r11, [r0, #172]                    @ states1 = blockSwitchingControl->iirStates[1];
 
 	mov     r2, r2, lsl #16
-	ldr     r12, hiPassCoeff                   @ Coeff0 = hiPassCoeff[0];      
+	ldr     r12, hiPassCoeff                   @ Coeff0 = hiPassCoeff[0];
   mov     r2, r2, asr #16
 	ldr     r14, hiPassCoeff + 4			         @ Coeff1 = hiPassCoeff[1];
-	
+
 	mov			r8, #0							               @ w=0
 	mov			r5, #0							               @ wOffset = 0;
-	
+
 BLOCK_BEGIN:
-	mov			r6, #0                             @ accuUE = 0; 
-	mov			r7, #0								             @ accuFE = 0; 
+	mov			r6, #0                             @ accuUE = 0;
+	mov			r7, #0								             @ accuFE = 0;
 	mov			r4, #0							               @ i=0
-		                   
-	str			r8, [r13, #4]	
-	str			r0, [r13, #8]	
+
+	str			r8, [r13, #4]
+	str			r0, [r13, #8]
 	str			r3, [r13, #12]
-	
-ENERGY_BEG:	
-	mov     r9, r5, lsl #1  
+
+ENERGY_BEG:
+	mov     r9, r5, lsl #1
 	ldrsh   r9, [r1, r9]											@ tempUnfiltered = timeSignal[tidx];
 
 	add			r5, r5, r2												@ tidx = tidx + chIncrement;
-	
-	smulwb	r3, r14, r9												@ accu1 = L_mpy_ls(Coeff1, tempUnfiltered);	
+
+	smulwb	r3, r14, r9												@ accu1 = L_mpy_ls(Coeff1, tempUnfiltered);
 	smull		r0, r8, r12, r11									@ accu2 = fixmul( Coeff0, states1 );
-	
+
 	mov			r3, r3, lsl #1
 	mov			r8, r8, lsl #1
 
-	sub			r0, r3, r10												@ accu3 = accu1 - states0;	
+	sub			r0, r3, r10												@ accu3 = accu1 - states0;
 	sub			r8,	r0, r8												@ out = accu3 - accu2;
 
 	mov		  r10, r3														@ states0 = accu1;
-	mov		  r11, r8														@ states1 = out;  
-	
-	mul		  r3, r9, r9	
+	mov		  r11, r8														@ states1 = out;
+
+	mul		  r3, r9, r9
 	mov     r8, r8, asr #16
-	
+
 	add		  r4, r4, #1
 	add     r6, r6, r3, asr #7
 
-	mul		  r9, r8, r8	
+	mul		  r9, r8, r8
 	ldr		  r3, [r13, #12]
 
 	add		  r7, r7, r9, asr #7
-		
-	cmp     r4, r3                            
-  blt     ENERGY_BEG       
-	
+
+	cmp     r4, r3
+  blt     ENERGY_BEG
+
 	ldr		  r0, [r13, #8]
 	ldr		  r8, [r13, #4]
-	
+
 ENERGY_END:
 	add		  r4, r0, r8, lsl #2
 
-	str     r6, [r4, #72]         
-	add		  r8, r8, #1	           
-  str     r7, [r4, #136]                   
+	str     r6, [r4, #72]
+	add		  r8, r8, #1
+  str     r7, [r4, #136]
 
 	cmp		  r8, #8
-	blt		  BLOCK_BEGIN                  	                        
+	blt		  BLOCK_BEGIN
 
 BLOCK_END:
-	str     r10, [r0, #168]                    
-  str     r11, [r0, #172]                    
-  mov     r0, #1            
-	                
-  add     r13, r13, #20   
-	ldmia   sp!, {r4 - r11, pc}                  
+	str     r10, [r0, #168]
+  str     r11, [r0, #172]
+  mov     r0, #1
+
+  add     r13, r13, #20
+	ldmia   sp!, {r4 - r11, pc}
 
 hiPassCoeff:
 	.word 0xbec8b439
 	.word	0x609d4952
-		
+
 	@ENDP
 	.end
diff --git a/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/PrePostMDCT_v5.s b/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/PrePostMDCT_v5.s
index 38fe092..da21d5f 100644
--- a/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/PrePostMDCT_v5.s
+++ b/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/PrePostMDCT_v5.s
@@ -26,46 +26,46 @@
 
 PreMDCT:
 	stmdb       sp!, {r4 - r11, lr}
-	
+
 	add         r9, r0, r1, lsl #2
 	sub         r3, r9, #8
 
 	movs        r1, r1, asr #2
 	beq         PreMDCT_END
-	
+
 PreMDCT_LOOP:
 	ldr					r8, [r2], #4
 	ldr					r9, [r2], #4
-	
+
 	ldrd				r4, [r0]
 	ldrd				r6, [r3]
-	
+
 	smull				r14, r11, r4, r8					@ MULHIGH(tr1, cosa)
 	smull    			r10, r12, r7, r8					@ MULHIGH(ti1, cosa)
-		
+
 	smull				r14, r8, r7, r9						@ MULHIGH(ti1, sina)
-	smull				r7, r10, r4, r9						@ MULHIGH(tr1, sina)	
-		
-	add					r11, r11, r8						@ MULHIGH(cosa, tr1) + MULHIGH(sina, ti1)@	
+	smull				r7, r10, r4, r9						@ MULHIGH(tr1, sina)
+
+	add					r11, r11, r8						@ MULHIGH(cosa, tr1) + MULHIGH(sina, ti1)@
 	sub					r7, r12, r10						@ MULHIGH(ti1, cosa) - MULHIGH(tr1, sina)
-	
+
 	ldr					r8, [r2], #4
 	ldr					r9, [r2], #4
-	
+
 	smull				r14, r4, r6, r8						@ MULHIGH(tr2, cosa)
 	smull    			r10, r12, r5, r8					@ MULHIGH(ti2, cosa)
-		
+
 	smull				r14, r8, r5, r9						@ MULHIGH(ti2, sina)
 	smull				r5, r10, r6, r9						@ MULHIGH(tr2, sina)
-	
+
 	add					r8, r8, r4
 	sub					r9, r12, r10
-	
-	mov					r6, r11		
 
-	strd				r6, [r0]	
+	mov					r6, r11
+
+	strd				r6, [r0]
 	strd				r8, [r3]
-	
+
 	subs				r1, r1, #1
 	sub					r3, r3, #8
 	add 				r0, r0, #8
@@ -74,52 +74,52 @@
 PreMDCT_END:
 	ldmia       sp!, {r4 - r11, pc}
 	@ENDP  @ |PreMDCT|
-	
+
 	.section .text
 	.global	PostMDCT
 
 PostMDCT:
 	stmdb       sp!, {r4 - r11, lr}
-	
+
 	add         r9, r0, r1, lsl #2
 	sub         r3, r9, #8
 
 	movs        r1, r1, asr #2
 	beq         PostMDCT_END
-	
+
 PostMDCT_LOOP:
-	ldr					r8, [r2], #4					
+	ldr					r8, [r2], #4
 	ldr					r9, [r2], #4
-	
+
 	ldrd				r4, [r0]
 	ldrd				r6, [r3]
-	
+
 	smull				r14, r11, r4, r8					@ MULHIGH(tr1, cosa)
 	smull    			r10, r12, r5, r8					@ MULHIGH(ti1, cosa)
-		
+
 	smull				r14, r8, r5, r9						@ MULHIGH(ti1, sina)
-	smull				r5, r10, r4, r9						@ MULHIGH(tr1, sina)	
-		
-	add					r4, r11, r8							@ MULHIGH(cosa, tr1) + MULHIGH(sina, ti1)@	
+	smull				r5, r10, r4, r9						@ MULHIGH(tr1, sina)
+
+	add					r4, r11, r8							@ MULHIGH(cosa, tr1) + MULHIGH(sina, ti1)@
 	sub					r11, r10, r12						@ MULHIGH(ti1, cosa) - MULHIGH(tr1, sina)@
-	
+
 	ldr					r8, [r2], #4						@
 	ldr					r9, [r2], #4
-	
+
 	smull				r14, r5, r6, r8						@ MULHIGH(tr2, cosa)
 	smull    			r10, r12, r7, r8					@ MULHIGH(ti2, cosa)
-		
+
 	smull				r14, r8, r7, r9						@ MULHIGH(ti2, sina)
 	smull				r7, r10, r6, r9						@ MULHIGH(tr2, sina)
-	
+
 	add					r6, r8, r5							@ MULHIGH(cosb, tr2) + MULHIGH(sinb, ti2)@
 	sub					r5, r10, r12						@ MULHIGH(sinb, tr2) - MULHIGH(cosb, ti2)@
-	
-	mov					r7, r11				
+
+	mov					r7, r11
 
 	strd				r4, [r0]
 	strd				r6, [r3]
-	
+
 	subs				r1, r1, #1
 	sub					r3, r3, #8
 	add 				r0, r0, #8
@@ -128,4 +128,4 @@
 PostMDCT_END:
 	ldmia       sp!, {r4 - r11, pc}
 	@ENDP  @ |PostMDCT|
-	.end
\ No newline at end of file
+	.end
diff --git a/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/R4R8First_v5.s b/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/R4R8First_v5.s
index b30881a..4ca4f31 100644
--- a/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/R4R8First_v5.s
+++ b/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/R4R8First_v5.s
@@ -26,46 +26,46 @@
 
 Radix4First:
 	stmdb       sp!, {r4 - r11, lr}
-	
+
 	movs				r10, r1
 	mov					r11, r0
 	beq					Radix4First_END
-		
+
 Radix4First_LOOP:
 	ldrd				r0, [r11]
 	ldrd				r2, [r11, #8]
 	ldrd				r4, [r11, #16]
 	ldrd				r6, [r11, #24]
-	
+
 	add					r8, r0, r2
 	add					r9, r1, r3
-	
+
 	sub					r0, r0, r2
 	sub					r1, r1, r3
-	
+
 	add					r2, r4, r6
 	add					r3, r5, r7
-	
+
 	sub					r4, r4, r6
 	sub					r5, r5, r7
-	
+
 	add					r6, r8, r2
 	add					r7, r9, r3
-	
+
 	sub					r8, r8, r2
 	sub					r9, r9, r3
-	
+
 	add					r2, r0, r5
 	sub					r3, r1, r4
-	
+
 	sub					r0, r0, r5
 	add					r1, r1, r4
-	
+
 	strd				r6, [r11]
 	strd				r2, [r11, #8]
 	strd				r8, [r11, #16]
 	strd				r0, [r11, #24]
-	
+
 	subs				r10, r10, #1
 	add					r11, r11, #32
 	bne					Radix4First_LOOP
@@ -73,180 +73,180 @@
 Radix4First_END:
 	ldmia       sp!, {r4 - r11, pc}
 	@ENDP  @ |Radix4First|
-	
+
 	.section .text
 	.global	Radix8First
 
 Radix8First:
 	stmdb       sp!, {r4 - r11, lr}
 	sub         sp, sp, #0x24
-	
+
 	mov				  r12, r1
 	mov					r14, r0
 	cmp					r12, #0
 	beq					Radix8First_END
-	
+
 Radix8First_LOOP:
-	ldrd				r0, [r14]		
+	ldrd				r0, [r14]
 	ldrd				r2, [r14, #8]
 	ldrd				r4, [r14, #16]
 	ldrd				r6, [r14, #24]
-	
+
 	add					r8, r0, r2					@ r0 = buf[0] + buf[2]@
 	add					r9, r1, r3					@ i0 = buf[1] + buf[3]@
-	
+
 	sub					r0, r0, r2					@ r1 = buf[0] - buf[2]@
 	sub					r1, r1, r3					@ i1 = buf[1] - buf[3]@
-	
+
 	add					r2, r4, r6					@	r2 = buf[4] + buf[6]@
 	add					r3, r5, r7					@ i2 = buf[5] + buf[7]@
-	
+
 	sub					r4, r4, r6					@	r3 = buf[4] - buf[6]@
 	sub					r5, r5, r7					@ i3 = buf[5] - buf[7]@
-	
+
 	add					r6, r8, r2					@ r4 = (r0 + r2) >> 1@
 	add					r7, r9, r3					@ i4 = (i0 + i2) >> 1@
-	
+
 	sub					r8, r8, r2					@	r5 = (r0 - r2) >> 1@
 	sub					r9, r9, r3					@ i5 = (i0 - i2) >> 1@
-	
+
 	sub					r2, r0, r5					@ r6 = (r1 - i3) >> 1@
 	add					r3, r1, r4					@ i6 = (i1 + r3) >> 1@
-	
+
 	add					r0, r0, r5					@ r7 = (r1 + i3) >> 1@
 	sub					r1, r1, r4					@ i7 = (i1 - r3) >> 1@
-	
+
 	mov					r6, r6, asr #1			@
 	mov					r7, r7, asr #1			@
-	
+
 	mov					r8, r8, asr #1
 	mov					r9, r9, asr #1
-	
+
 	mov					r2, r2, asr #1
 	mov					r3, r3, asr #1
-	
+
 	mov					r0, r0, asr #1
-	mov					r1, r1, asr #1	
-	
+	mov					r1, r1, asr #1
+
 	str					r6, [sp]
 	str					r7, [sp, #4]
-	
+
 	str					r8, [sp, #8]
 	str					r9, [sp, #12]
-	
+
 	str					r2, [sp, #16]
-	str					r3, [sp, #20]	
-	
+	str					r3, [sp, #20]
+
 	str					r0, [sp, #24]
-	str					r1, [sp, #28]	
-	
-	ldrd				r2, [r14, #32]		
+	str					r1, [sp, #28]
+
+	ldrd				r2, [r14, #32]
 	ldrd				r4, [r14, #40]
 	ldrd				r6, [r14, #48]
 	ldrd				r8, [r14, #56]
-	
+
 	add					r0, r2, r4					@ r0 = buf[ 8] + buf[10]@
 	add					r1, r3, r5					@ i0 = buf[ 9] + buf[11]@
-	
+
 	sub					r2, r2, r4					@ r1 = buf[ 8] - buf[10]@
 	sub					r3, r3, r5					@ i1 = buf[ 9] - buf[11]@
-	
+
 	add					r4, r6, r8					@ r2 = buf[12] + buf[14]@
 	add					r5, r7, r9					@ i2 = buf[13] + buf[15]@
-	
+
 	sub					r6, r6, r8					@ r3 = buf[12] - buf[14]@
 	sub					r7, r7, r9					@	i3 = buf[13] - buf[15]@
-	
+
 	add					r8, r0, r4					@ t0 = (r0 + r2)
 	add					r9, r1, r5					@ t1 = (i0 + i2)
-	
+
 	sub					r0, r0, r4					@ t2 = (r0 - r2)
 	sub					r1, r1, r5					@ t3 = (i0 - i2)
-	
+
 	mov					r8, r8, asr #1
 	ldr					r4, [sp]
-	
+
 	mov					r9, r9, asr #1
 	ldr					r5, [sp, #4]
-	
-	mov					r0, r0, asr #1		
+
+	mov					r0, r0, asr #1
 	mov					r1, r1, asr #1
-	
+
 	add					r10, r4, r8					@ buf[ 0] = r4 + t0@
 	add					r11, r5, r9					@ buf[ 1] = i4 + t1@
-	
+
 	sub					r4,  r4, r8					@ buf[ 8] = r4 - t0@
 	sub					r5,  r5, r9					@	buf[ 9] = i4 - t1@
-	
+
  	strd				r10, [r14]
  	strd				r4,  [r14, #32]
- 	
+
  	ldr					r10, [sp, #8]
  	ldr					r11, [sp, #12]
- 	
+
  	add					r4, r10, r1					@ buf[ 4] = r5 + t3@
  	sub					r5, r11, r0					@	buf[ 5] = i5 - t2@
- 	
+
  	sub					r10, r10, r1				@ buf[12] = r5 - t3@
  	add					r11, r11, r0				@ buf[13] = i5 + t2@
- 	
+
  	strd				r4,  [r14, #16]
  	strd				r10, [r14, #48]
- 	
+
  	sub					r0, r2, r7					@ r0 = r1 - i3@
  	add					r1, r3, r6					@ i0 = i1 + r3@
- 
+
   ldr					r11, DATATab
- 	
+
  	add					r2, r2, r7					@ r2 = r1 + i3@
  	sub					r3, r3, r6					@ i2 = i1 - r3@
- 	
+
 	sub					r4, r0, r1					@ r0 - i0
 	add					r5, r0, r1					@ r0 + i0
-	
+
 	sub					r0, r2, r3					@ r2 - i2
 	add					r1, r2, r3					@ r2 + i2
-	
-	smull				r8, r6, r4, r11								
-	smull				r9, r7, r5, r11								
-	
+
+	smull				r8, r6, r4, r11
+	smull				r9, r7, r5, r11
+
 	ldr					r2, [sp, #16]
 	ldr					r3, [sp, #20]
-	
-	smull				r8, r4, r0, r11								
-	smull				r9, r5, r1, r11								
-	
+
+	smull				r8, r4, r0, r11
+	smull				r9, r5, r1, r11
+
 	ldr					r10, [sp, #24]
 	ldr					r11, [sp, #28]
-	
+
 	sub					r8, r2, r6
 	sub					r9, r3, r7
-	
+
 	add					r2, r2, r6
 	add					r3, r3, r7
-	
+
 	add					r6, r10, r5
 	sub					r7, r11, r4
-	
+
 	sub					r0, r10, r5
 	add					r1, r11, r4
-	
+
 	strd				r6, [r14, #8]
 	strd				r8, [r14, #24]
 	strd				r0, [r14, #40]
 	strd				r2, [r14, #56]
-	
+
 	subs				r12, r12, #1
 	add					r14, r14, #64
-	
+
 	bne					Radix8First_LOOP
-	
+
 Radix8First_END:
 	add         sp, sp, #0x24
 	ldmia       sp!, {r4 - r11, pc}
-	
+
 DATATab:
 	.word       0x5a82799a
-	
+
 	@ENDP  @ |Radix8First|
-	.end
\ No newline at end of file
+	.end
diff --git a/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/Radix4FFT_v5.s b/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/Radix4FFT_v5.s
index bc069b4..b59b967 100644
--- a/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/Radix4FFT_v5.s
+++ b/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/Radix4FFT_v5.s
@@ -25,145 +25,145 @@
 
 Radix4FFT:
 	stmdb     sp!, {r4 - r11, lr}
-	sub       sp, sp, #32                     
+	sub       sp, sp, #32
 
 	mov			r1, r1, asr #2
-	cmp     r1, #0       
-	beq     Radix4FFT_END                            
-                       
-Radix4FFT_LOOP1:          
-	mov     r14, r0          							@ xptr = buf@          
+	cmp     r1, #0
+	beq     Radix4FFT_END
+
+Radix4FFT_LOOP1:
+	mov     r14, r0          							@ xptr = buf@
 	mov		r10, r1 												@ i = num@
 	mov     r9, r2, lsl #3  							@ step = 2*bgn@
-	cmp     r10, #0  
-	str		r0, [sp] 
-	str		r1, [sp, #4]      
+	cmp     r10, #0
+	str		r0, [sp]
+	str		r1, [sp, #4]
 	str		r2, [sp, #8]
-	str		r3, [sp, #12]  
-	beq     Radix4FFT_LOOP1_END                            	    
-     
-Radix4FFT_LOOP2:                       
+	str		r3, [sp, #12]
+	beq     Radix4FFT_LOOP1_END
+
+Radix4FFT_LOOP2:
 	mov     r12, r3				        				@ csptr = twidTab@
 	mov		r11, r2												@ j = bgn
-	cmp     r11, #0        
+	cmp     r11, #0
 	str		r10, [sp, #16]
-	beq     Radix4FFT_LOOP2_END                         
-	 
-Radix4FFT_LOOP3:                          
-	str			r11, [sp, #20]	 
-	
+	beq     Radix4FFT_LOOP2_END
+
+Radix4FFT_LOOP3:
+	str			r11, [sp, #20]
+
 	ldrd		r0, [r14, #0]									@ r0 = xptr[0]@ r1 = xptr[1]@
 	add			r14, r14, r9 	 								@ xptr += step@
-	
-	ldrd		r10,	[r14, #0]  					 			@ r2 = xptr[0]@ r3 = xptr[1]@	
+
+	ldrd		r10,	[r14, #0]  					 			@ r2 = xptr[0]@ r3 = xptr[1]@
 	ldr			r8, [r12], #4									@ cosxsinx = csptr[0]@
-	
+
 	smulwt	r4, r10, r8										@ L_mpy_wx(cosx, t0)
 	smulwt	r3, r11, r8										@ L_mpy_wx(cosx, t1)
-	
+
 	smlawb	r2, r11, r8, r4								@ r2 = L_mpy_wx(cosx, t0) + L_mpy_wx(sinx, t1)@
 	smulwb	r5, r10, r8										@ L_mpy_wx(sinx, t0)
-	
+
 	mov			r10, r0, asr #2								@ t0 = r0 >> 2@
 	mov			r11, r1, asr #2								@	t1 = r1 >> 2@
-		
+
 	sub			r3, r3, r5										@ r3 = L_mpy_wx(cosx, t1) - L_mpy_wx(sinx, t0)@
 	add     r14, r14, r9 	 								@ xptr += step@
-	
+
 	sub			r0, r10, r2										@ r0 = t0 - r2@
 	sub			r1, r11, r3									  @ r1 = t1 - r3@
-	
+
 	add			r2, r10, r2										@ r2 = t0 + r2@
 	add			r3, r11, r3										@ r3 = t1 + r3@
-	
+
 	str			r2, [sp, #24]
 	str			r3, [sp, #28]
-	
+
 	ldrd		r10, [r14, #0]								@ r4 = xptr[0]@ r5 = xptr[1]@
 	ldr			r8, [r12], #4									@ cosxsinx = csptr[1]@
-	
+
 	smulwt	r6, r10, r8										@ L_mpy_wx(cosx, t0)
 	smulwt	r5, r11, r8										@ L_mpy_wx(cosx, t1)
-	
+
 	smlawb	r4, r11, r8, r6								@ r4 = L_mpy_wx(cosx, t0) + L_mpy_wx(sinx, t1)@
 	smulwb	r7, r10, r8										@ L_mpy_wx(sinx, t0)
-	
+
 	add			r14, r14, r9									@ xptr += step@
 	sub			r5, r5, r7										@ r5 = L_mpy_wx(cosx, t1) - L_mpy_wx(sinx, t0)@
-		
+
 	ldrd		r10, [r14]										@ r6 = xptr[0]@ r7 = xptr[1]@
 	ldr			r8, [r12], #4									@ cosxsinx = csptr[1]@
-	
+
 	smulwt	r2, r10, r8										@ L_mpy_wx(cosx, t0)
 	smulwt	r7, r11, r8										@ L_mpy_wx(cosx, t1)
-	
+
 	smlawb	r6, r11, r8, r2								@ r4 = L_mpy_wx(cosx, t0) + L_mpy_wx(sinx, t1)@
 	smulwb	r3, r10, r8										@ L_mpy_wx(sinx, t0)
-	
-	mov			r10, r4												@ t0 = r4@
-	mov			r11, r5												@ t1 = r5@	
-	
-	sub			r7, r7, r3										@ r5 = L_mpy_wx(cosx, t1) - L_mpy_wx(sinx, t0)@
-	
 
-	add			r4,  r10, r6									@	r4 = t0 + r6@	
+	mov			r10, r4												@ t0 = r4@
+	mov			r11, r5												@ t1 = r5@
+
+	sub			r7, r7, r3										@ r5 = L_mpy_wx(cosx, t1) - L_mpy_wx(sinx, t0)@
+
+
+	add			r4,  r10, r6									@	r4 = t0 + r6@
 	sub			r5, r7, r11										@ r5 = r7 - t1@
-	
+
 	sub			r6, r10, r6										@ r6 = t0 - r6@
 	add			r7, r7, r11										@ r7 = r7 + t1@
-	
+
 	ldr			r2, [sp, #24]
 	ldr			r3, [sp, #28]
-	
+
 	add			r10, r0, r5										@ xptr[0] = r0 + r5@
 	add			r11, r1, r6										@ xptr[0] = r1 + r6
-	
-	strd		r10, [r14]										
+
+	strd		r10, [r14]
 	sub			r14, r14, r9									@ xptr -= step@
-	
+
 	sub			r10, r2, r4										@	xptr[0] = r2 - r4@
 	sub			r11, r3, r7										@ xptr[1] = r3 - r7@
-	
-	strd		r10, [r14]				
+
+	strd		r10, [r14]
 	sub			r14, r14, r9									@ xptr -= step@
-	
+
 	sub			r10, r0, r5										@ xptr[0] = r0 - r5@
 	sub			r11, r1, r6										@ xptr[0] = r1 - r6
-	
-	strd		r10, [r14]										
+
+	strd		r10, [r14]
 	sub			r14, r14, r9									@ xptr -= step@
-	
+
 	add			r10, r2, r4										@	xptr[0] = r2 - r4@
 	add			r11, r3, r7										@ xptr[1] = r3 - r7@
-	
-	strd		r10, [r14]				
+
+	strd		r10, [r14]
 	add			r14, r14, #8									@ xptr += 2@
-	
+
 	ldr			r11, [sp, #20]
 	subs		r11, r11, #1
-	bne			Radix4FFT_LOOP3	
-	 
-Radix4FFT_LOOP2_END:           
+	bne			Radix4FFT_LOOP3
+
+Radix4FFT_LOOP2_END:
 	ldr			r10, [sp, #16]
 	ldr			r3, [sp, #12]
 	ldr			r2, [sp, #8]
-	rsb			r8, r9, r9, lsl #2   
+	rsb			r8, r9, r9, lsl #2
 	sub			r10, r10, #1
-	add			r14, r14, r8		      
-	cmp			r10, #0  
-	bhi     Radix4FFT_LOOP2           
-                        
-Radix4FFT_LOOP1_END:               
-	ldr     r0, [sp]    
+	add			r14, r14, r8
+	cmp			r10, #0
+	bhi     Radix4FFT_LOOP2
+
+Radix4FFT_LOOP1_END:
+	ldr     r0, [sp]
 	ldr		r1, [sp, #4]
 	add     r3, r3, r8, asr #1
-	mov     r2, r2, lsl #2 
-	movs    r1, r1, asr #2 
-	bne     Radix4FFT_LOOP1          
-                        
-Radix4FFT_END:                        
-	add     sp, sp, #32                  
+	mov     r2, r2, lsl #2
+	movs    r1, r1, asr #2
+	bne     Radix4FFT_LOOP1
+
+Radix4FFT_END:
+	add     sp, sp, #32
 	ldmia   sp!, {r4 - r11, pc}
-		
+
 	@ENDP  @ |Radix4FFT|
-	.end
\ No newline at end of file
+	.end
diff --git a/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/band_nrg_v5.s b/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/band_nrg_v5.s
index 3b88810..4789f6d 100644
--- a/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/band_nrg_v5.s
+++ b/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/band_nrg_v5.s
@@ -26,31 +26,31 @@
 	.global	CalcBandEnergy
 
 CalcBandEnergy:
-	stmdb   sp!, {r4 - r11, lr}	
-                   
-  mov     r2, r2, lsl #16                   
+	stmdb   sp!, {r4 - r11, lr}
+
+  mov     r2, r2, lsl #16
 	ldr     r12, [r13, #36]
 	mov			r9, #0
-  mov     r5, r2, asr #16    
-	mov			r4, #0               
-  cmp     r5, #0	
-	ble     L212 
+  mov     r5, r2, asr #16
+	mov			r4, #0
+  cmp     r5, #0
+	ble     L212
 
 L22:
-  mov     r2, r4, lsl #1                    
-  ldrsh   r10, [r1, r2]                     
-  add     r11, r1, r2                       
-  ldrsh   r2, [r11, #2]    
-	mov     r14, #0                 
-  cmp     r10, r2                           
-  bge     L28 
-	
+  mov     r2, r4, lsl #1
+  ldrsh   r10, [r1, r2]
+  add     r11, r1, r2
+  ldrsh   r2, [r11, #2]
+	mov     r14, #0
+  cmp     r10, r2
+  bge     L28
+
 L23:
-	ldr     r11, [r0, +r10, lsl #2]	
-  add     r10, r10, #1    
-	ldr     r6, [r0, +r10, lsl #2]	
+	ldr     r11, [r0, +r10, lsl #2]
+  add     r10, r10, #1
+	ldr     r6, [r0, +r10, lsl #2]
 	smull   r11, r7, r11, r11
-	add     r10, r10, #1 
+	add     r10, r10, #1
 	smull	  r6, r8, r6, r6
 	ldr     r11, [r0, +r10, lsl #2]
 	qadd	  r14, r14, r7
@@ -59,71 +59,71 @@
 	ldr     r6, [r0, +r10, lsl #2]
 	qadd	  r14, r14, r8
 	smull	  r6, r8, r6, r6
-  add     r10, r10, #1 
+  add     r10, r10, #1
 	qadd	  r14, r14, r7
 	cmp     r10, r2
 	qadd	  r14, r14, r8
-	blt     L23   
+	blt     L23
 
-L28:	
+L28:
 	qadd	  r14, r14, r14
 	str     r14, [r3, +r4, lsl #2]
-	add     r4, r4, #1 
+	add     r4, r4, #1
 	qadd	  r9, r9, r14
-	cmp     r4, r5                          
+	cmp     r4, r5
 
-  blt     L22       	
+  blt     L22
 
-L212:	
-	str     r9, [r12, #0]                     
+L212:
+	str     r9, [r12, #0]
 	ldmia   sp!, {r4 - r11, pc}
-	
+
 	@ENDP  ; |CalcBandEnergy|
-	
+
 	.global	CalcBandEnergyMS
 
 CalcBandEnergyMS:
 	stmdb   sp!, {r4 - r11, lr}
 	sub     r13, r13, #24
-	
-	mov     r12, #0 
-  mov     r3, r3, lsl #16  
-  mov     r14, #0 
-	mov     r3, r3, asr #16      
-	cmp     r3, #0          
-	mov		  r4, #0                  
-  ble     L315    
-	
-L32:	
+
+	mov     r12, #0
+  mov     r3, r3, lsl #16
+  mov     r14, #0
+	mov     r3, r3, asr #16
+	cmp     r3, #0
+	mov		  r4, #0
+  ble     L315
+
+L32:
 	mov		  r5, r4, lsl #1
 	mov		  r6, #0
 	ldrsh   r10, [r2, r5]
 	add     r5, r2, r5
 	mov		  r7, #0
-	ldrsh	  r11, [r5, #2]                        
-	cmp     r10, r11                          
-  bge     L39    
+	ldrsh	  r11, [r5, #2]
+	cmp     r10, r11
+  bge     L39
 
 	str		  r3, [r13, #4]
 	str		  r4, [r13, #8]
 	str		  r12, [r13, #12]
 	str		  r14, [r13, #16]
 
-L33:	
-	ldr     r8, [r0, +r10, lsl #2]                    
+L33:
+	ldr     r8, [r0, +r10, lsl #2]
 	ldr     r9, [r1, +r10, lsl #2]
 	mov		  r8, r8, asr #1
 	add		  r10, r10, #1
 	mov		  r9, r9, asr #1
 
-	ldr     r12, [r0, +r10, lsl #2]          
-	add		  r5, r8, r9	          
+	ldr     r12, [r0, +r10, lsl #2]
+	add		  r5, r8, r9
 	ldr     r14, [r1, +r10, lsl #2]
 	sub		  r8, r8, r9
 
-	smull   r5, r3, r5, r5 
+	smull   r5, r3, r5, r5
 	mov		  r12, r12, asr #1
-	smull   r8, r4, r8, r8 
+	smull   r8, r4, r8, r8
 	mov		  r14, r14, asr #1
 
 	qadd	  r6, r6, r3
@@ -131,27 +131,27 @@
 	qadd	  r7, r7, r4
 	sub		  r8, r12, r14
 
-	smull   r5, r3, r5, r5 
+	smull   r5, r3, r5, r5
 	add		  r10, r10, #1
-	smull   r8, r4, r8, r8 
-		
+	smull   r8, r4, r8, r8
+
 	qadd	  r6, r6, r3
 	qadd	  r7, r7, r4
 
-	ldr     r8, [r0, +r10, lsl #2]                    
+	ldr     r8, [r0, +r10, lsl #2]
 	ldr     r9, [r1, +r10, lsl #2]
 	mov		  r8, r8, asr #1
 	add		  r10, r10, #1
 	mov		  r9, r9, asr #1
 
-	ldr     r12, [r0, +r10, lsl #2]          
-	add		  r5, r8, r9	          
+	ldr     r12, [r0, +r10, lsl #2]
+	add		  r5, r8, r9
 	ldr     r14, [r1, +r10, lsl #2]
 	sub		  r8, r8, r9
 
-	smull   r5, r3, r5, r5 
+	smull   r5, r3, r5, r5
 	mov		  r12, r12, asr #1
-	smull   r8, r4, r8, r8 
+	smull   r8, r4, r8, r8
 	mov		  r14, r14, asr #1
 
 	qadd	  r6, r6, r3
@@ -159,37 +159,37 @@
 	qadd	  r7, r7, r4
 	sub		  r8, r12, r14
 
-	smull   r5, r3, r5, r5 
+	smull   r5, r3, r5, r5
 	add		  r10, r10, #1
-	smull   r8, r4, r8, r8 
-		
+	smull   r8, r4, r8, r8
+
 	qadd	  r6, r6, r3
 	qadd	  r7, r7, r4
 
 	cmp     r10, r11
-	
+
 	blt		  L33
 
 	ldr		  r3, [r13, #4]
-	ldr		  r4, [r13, #8]	
+	ldr		  r4, [r13, #8]
 	ldr		  r12, [r13, #12]
 	ldr		  r14, [r13, #16]
-L39:	
+L39:
 	qadd	  r6, r6, r6
-	qadd	  r7, r7, r7	
-	
+	qadd	  r7, r7, r7
+
 	ldr		  r8, [r13, #60]
 	ldr		  r9, [r13, #68]
 
 	qadd	  r12, r12, r6
 	qadd	  r14, r14, r7
-	
-	str		  r6, [r8, +r4, lsl #2]       
-	str     r7, [r9, +r4, lsl #2]    
-	
+
+	str		  r6, [r8, +r4, lsl #2]
+	str     r7, [r9, +r4, lsl #2]
+
 	add		  r4, r4, #1
 	cmp		  r4, r3
-	blt     L32            
+	blt     L32
 
 L315:
 	ldr		  r8, [r13, #64]
diff --git a/media/libstagefright/codecs/aacenc/src/asm/ARMV7/PrePostMDCT_v7.s b/media/libstagefright/codecs/aacenc/src/asm/ARMV7/PrePostMDCT_v7.s
index a04c105..7f6b881 100644
--- a/media/libstagefright/codecs/aacenc/src/asm/ARMV7/PrePostMDCT_v7.s
+++ b/media/libstagefright/codecs/aacenc/src/asm/ARMV7/PrePostMDCT_v7.s
@@ -23,113 +23,124 @@
 
 	.section .text
 	.global	PreMDCT
+	.fnstart
 
 PreMDCT:
 	stmdb     sp!, {r4 - r11, lr}
-	
+	.save	  {r4 - r11, lr}
+	fstmfdd   sp!, {d8 - d15}
+	.vsave	  {d8 - d15}
+
 	add         r9, r0, r1, lsl #2
 	sub         r3, r9, #32
 
 	movs        r1, r1, asr #2
-	beq         PreMDCT_END	
-	
+	beq         PreMDCT_END
+
 PreMDCT_LOOP:
 	VLD4.I32			{d0, d2, d4, d6}, [r2]!				@ cosa = *csptr++@ sina = *csptr++@
 	VLD4.I32			{d1, d3, d5, d7}, [r2]!				@ cosb = *csptr++@ sinb = *csptr++@
 	VLD2.I32			{d8, d9, d10, d11}, [r0]			@ tr1 = *(buf0 + 0)@ ti2 = *(buf0 + 1)@
 	VLD2.I32			{d13, d15}, [r3]!					@ tr2 = *(buf1 - 1)@ ti1 = *(buf1 + 0)@
 	VLD2.I32			{d12, d14}, [r3]!					@ tr2 = *(buf1 - 1)@ ti1 = *(buf1 + 0)@
-		
-	VREV64.32			Q8, Q7	
+
+	VREV64.32			Q8, Q7
 	VREV64.32			Q9, Q6
 
-	
+
 	VQDMULH.S32		Q10, Q0, Q4								@ MULHIGH(cosa, tr1)
 	VQDMULH.S32		Q11, Q1, Q8								@ MULHIGH(sina, ti1)
 	VQDMULH.S32		Q12, Q0, Q8								@ MULHIGH(cosa, ti1)
 	VQDMULH.S32		Q13, Q1, Q4								@ MULHIGH(sina, tr1)
-		
+
 	VADD.S32			Q0, Q10, Q11						@ *buf0++ = MULHIGH(cosa, tr1) + MULHIGH(sina, ti1)@
 	VSUB.S32			Q1, Q12, Q13						@ *buf0++ = MULHIGH(cosa, ti1) - MULHIGH(sina, tr1)@
-	
+
 	VST2.I32			{d0, d1, d2, d3}, [r0]!
 	sub						r3, r3, #32
-	
+
 	VQDMULH.S32		Q10, Q2, Q9										@ MULHIGH(cosb, tr2)
 	VQDMULH.S32		Q11, Q3, Q5										@ MULHIGH(sinb, ti2)
 	VQDMULH.S32		Q12, Q2, Q5										@ MULHIGH(cosb, ti2)
 	VQDMULH.S32		Q13, Q3, Q9										@ MULHIGH(sinb, tr2)
-		
+
 	VADD.S32			Q0, Q10, Q11									@ MULHIGH(cosa, tr2) + MULHIGH(sina, ti2)@
 	VSUB.S32			Q1, Q12, Q13									@ MULHIGH(cosa, ti2) - MULHIGH(sina, tr2)@
-	
+
 	VREV64.32			Q3, Q1
 	VREV64.32			Q2, Q0
-		
-	VST2.I32		{d5, d7}, [r3]!	
-	VST2.I32		{d4, d6}, [r3]! 
-	
+
+	VST2.I32		{d5, d7}, [r3]!
+	VST2.I32		{d4, d6}, [r3]!
+
 	subs     		r1, r1, #4
-	sub		  		r3, r3, #64	
+	sub		  		r3, r3, #64
 	bne       	PreMDCT_LOOP
-	
+
 PreMDCT_END:
+	fldmfdd   sp!, {d8 - d15}
 	ldmia     sp!, {r4 - r11, pc}
 	@ENDP  @ |PreMDCT|
+	.fnend
 
 	.section .text
 	.global	PostMDCT
+	.fnstart
 
 PostMDCT:
 	stmdb     sp!, {r4 - r11, lr}
-	
+	.save	  {r4 - r11, lr}
+	fstmfdd   sp!, {d8 - d15}
+	.vsave	  {d8 - d15}
+
 	add         r9, r0, r1, lsl #2
 	sub         r3, r9, #32
 
 	movs        r1, r1, asr #2
 	beq         PostMDCT_END
-	
+
 PostMDCT_LOOP:
 	VLD4.I32			{d0, d2, d4, d6}, [r2]!				@ cosa = *csptr++@ sina = *csptr++@
 	VLD4.I32			{d1, d3, d5, d7}, [r2]!				@ cosb = *csptr++@ sinb = *csptr++@
 	VLD2.I32			{d8, d9, d10, d11}, [r0]			@ tr1 = *(zbuf1 + 0)@ ti1 = *(zbuf1 + 1)@
 	VLD2.I32			{d13, d15}, [r3]!							@ tr2 = *(zbuf2 - 1)@ ti2 = *(zbuf2 + 0)@
-	VLD2.I32			{d12, d14}, [r3]!							@ tr2 = *(zbuf2 - 1)@ ti2 = *(zbuf2 + 0)@	
+	VLD2.I32			{d12, d14}, [r3]!							@ tr2 = *(zbuf2 - 1)@ ti2 = *(zbuf2 + 0)@
 
-	VREV64.32			Q8, Q6	
-	VREV64.32			Q9, Q7			
-	
+	VREV64.32			Q8, Q6
+	VREV64.32			Q9, Q7
+
 	VQDMULH.S32		Q10, Q0, Q4										@ MULHIGH(cosa, tr1)
 	VQDMULH.S32		Q11, Q1, Q5										@ MULHIGH(sina, ti1)
 	VQDMULH.S32		Q12, Q0, Q5										@ MULHIGH(cosa, ti1)
 	VQDMULH.S32		Q13, Q1, Q4										@ MULHIGH(sina, tr1)
-		
+
 	VADD.S32			Q0, Q10, Q11									@ *buf0++ = MULHIGH(cosa, tr1) + MULHIGH(sina, ti1)@
 	VSUB.S32			Q5, Q13, Q12									@ *buf1-- = MULHIGH(sina, tr1) - MULHIGH(cosa, ti1)@
-	
+
 	VQDMULH.S32		Q10, Q2, Q8										@ MULHIGH(cosb, tr2)
 	VQDMULH.S32		Q11, Q3, Q9										@ MULHIGH(sinb, ti2)
 	VQDMULH.S32		Q12, Q2, Q9										@ MULHIGH(cosb, ti2)
 	VQDMULH.S32		Q13, Q3, Q8										@ MULHIGH(sinb, tr2)
-		
+
 	VADD.S32			Q4, Q10, Q11									@ *buf1-- = MULHIGH(cosa, tr2) + MULHIGH(sina, ti2)@
-	VSUB.S32			Q1, Q13, Q12									@ *buf0++ = MULHIGH(sina, tr2) - MULHIGH(cosa, ti2)@	
-	
+	VSUB.S32			Q1, Q13, Q12									@ *buf0++ = MULHIGH(sina, tr2) - MULHIGH(cosa, ti2)@
+
 	VREV64.32			Q2, Q4
-	VREV64.32			Q3, Q5	
-	
-	sub						r3, r3, #32	
+	VREV64.32			Q3, Q5
+
+	sub						r3, r3, #32
 	VST2.I32			{d0, d1, d2, d3}, [r0]!
-		
-	VST2.I32			{d5, d7}, [r3]!	
-	VST2.I32			{d4, d6}, [r3]! 
-	
+
+	VST2.I32			{d5, d7}, [r3]!
+	VST2.I32			{d4, d6}, [r3]!
+
 	subs     			r1, r1, #4
-	sub		  			r3, r3, #64		
+	sub		  			r3, r3, #64
 	bne       	PostMDCT_LOOP
 
 PostMDCT_END:
+	fldmfdd   sp!, {d8 - d15}
 	ldmia     sp!, {r4 - r11, pc}
 
 	@ENDP  		@ |PostMDCT|
-	.end
\ No newline at end of file
+	.fnend
diff --git a/media/libstagefright/codecs/aacenc/src/asm/ARMV7/R4R8First_v7.s b/media/libstagefright/codecs/aacenc/src/asm/ARMV7/R4R8First_v7.s
index defd45d..03fa6a9 100644
--- a/media/libstagefright/codecs/aacenc/src/asm/ARMV7/R4R8First_v7.s
+++ b/media/libstagefright/codecs/aacenc/src/asm/ARMV7/R4R8First_v7.s
@@ -23,124 +23,135 @@
 
 	.section .text
 	.global	Radix8First
+	.fnstart
 
 Radix8First:
 	stmdb     		sp!, {r4 - r11, lr}
+	.save	  		{r4 - r11, lr}
+	fstmfdd   		sp!, {d8 - d15}
+	.vsave	  		{d8 - d15}
 
 	ldr       		r3, SQRT1_2
 	cmp       		r1, #0
-	
-	VDUP.I32  		Q15, r3	
+
+	VDUP.I32  		Q15, r3
 	beq       		Radix8First_END
-	
+
 Radix8First_LOOP:
 	VLD1.I32			{d0, d1, d2, d3},	[r0]!
 	VLD1.I32			{d8, d9, d10, d11},	[r0]!
-		
+
 	VADD.S32			d4, d0, d1		@ r0 = buf[0] + buf[2]@i0 = buf[1] + buf[3]@
-	VSUB.S32			d5, d0, d1		@ r1 = buf[0] - buf[2]@i1 = buf[1] - buf[3]@	
-	VSUB.S32			d7, d2, d3		@ r2 = buf[4] - buf[6]@i2 = buf[5] - buf[7]@	
+	VSUB.S32			d5, d0, d1		@ r1 = buf[0] - buf[2]@i1 = buf[1] - buf[3]@
+	VSUB.S32			d7, d2, d3		@ r2 = buf[4] - buf[6]@i2 = buf[5] - buf[7]@
 	VADD.S32			d6, d2, d3		@ r3 = buf[4] + buf[6]@i3 = buf[5] + buf[7]@
-	VREV64.I32			d7, d7	
-	
+	VREV64.I32			d7, d7
+
 	VADD.S32			Q0, Q2, Q3		@ r4 = (r0 + r2)@i4 = (i0 + i2)@i6 = (i1 + r3)@r7 = (r1 + i3)
 	VSUB.S32			Q1, Q2, Q3		@ r5 = (r0 - r2)@i5 = (i0 - i2)@r6 = (r1 - i3)@i7 = (i1 - r3)@
 
-	VREV64.I32			d3, d3	
+	VREV64.I32			d3, d3
 
 	VADD.S32			d4, d8, d9		@ r0 = buf[ 8] + buf[10]@i0 = buf[ 9] + buf[11]@
-	VSUB.S32			d7, d10, d11	@ r1 = buf[12] - buf[14]@i1 = buf[13] - buf[15]@	
+	VSUB.S32			d7, d10, d11	@ r1 = buf[12] - buf[14]@i1 = buf[13] - buf[15]@
 	VADD.S32			d6, d10, d11	@ r2 = buf[12] + buf[14]@i2 = buf[13] + buf[15]@
-	VREV64.I32			d7, d7	
+	VREV64.I32			d7, d7
 	VSUB.S32			d5, d8, d9		@ r3 = buf[ 8] - buf[10]@i3 = buf[ 9] - buf[11]@
-	
-	VTRN.32				d1, d3	
-	
+
+	VTRN.32				d1, d3
+
 	VADD.S32			Q4, Q2, Q3		@ t0 = (r0 + r2) >> 1@t1 = (i0 + i2) >> 1@i0 = i1 + r3@r2 = r1 + i3@
 	VSUB.S32			Q5, Q2, Q3		@ t2 = (r0 - r2) >> 1@t3 = (i0 - i2) >> 1@r0 = r1 - i3@i2 = i1 - r3@
-	
+
 	VREV64.I32			d3, d3
-	
-	VSHR.S32			d8, d8, #1		 
+
+	VSHR.S32			d8, d8, #1
 	VSHR.S32			Q0, Q0, #1
 	VREV64.I32			d10, d10
 	VTRN.32				d11, d9
 	VSHR.S32			Q1, Q1, #1
 	VSHR.S32			d10, d10, #1
 	VREV64.I32			d9, d9
-	
+
 	sub       			r0, r0, #0x40
-	
+
 	VADD.S32			d12, d0, d8
-	VSUB.S32			d16, d0, d8	
+	VSUB.S32			d16, d0, d8
 	VADD.S32			d14, d2, d10
 	VSUB.S32			d18, d2, d10
-	
+
 	VSUB.S32			d4, d11, d9
 	VADD.S32			d5, d11, d9
-	
+
 	VREV64.I32			d18, d18
-	
+
 	VQDMULH.S32			Q3, Q2, Q15
 	VTRN.32				d14, d18
 	VTRN.32				d6, d7
-	VREV64.I32			d18, d18	
-	
+	VREV64.I32			d18, d18
+
 	VSUB.S32			d15, d3, d6
 	VREV64.I32			d7, d7
 	VADD.S32			d19, d3, d6
 	VADD.S32			d13, d1, d7
 	VSUB.S32			d17, d1, d7
-	
+
 	VREV64.I32			d17, d17
 	VTRN.32				d13, d17
 	VREV64.I32			d17, d17
-	
-	subs       			r1, r1, #1	
-	
+
+	subs       			r1, r1, #1
+
 	VST1.I32			{d12, d13, d14, d15}, [r0]!
-	VST1.I32			{d16, d17, d18, d19}, [r0]!	
+	VST1.I32			{d16, d17, d18, d19}, [r0]!
 	bne       			Radix8First_LOOP
-	
+
 Radix8First_END:
-	ldmia     sp!, {r4 - r11, pc}	
+	fldmfdd   sp!, {d8 - d15}
+	ldmia     sp!, {r4 - r11, pc}
 SQRT1_2:
 	.word      0x2d413ccd
-	
+
 	@ENDP  @ |Radix8First|
-	
+	.fnend
+
 	.section .text
 	.global	Radix4First
+	.fnstart
 
 Radix4First:
 	stmdb     	sp!, {r4 - r11, lr}
+	.save	  	{r4 - r11, lr}
+	fstmfdd   	sp!, {d8 - d15}
+	.vsave	  	{d8 - d15}
 
 	cmp       	r1, #0
 	beq       	Radix4First_END
-	
+
 Radix4First_LOOP:
-	VLD1.I32			{d0, d1, d2, d3}, [r0]					
-	
-	VADD.S32			d4, d0, d1							@ r0 = buf[0] + buf[2]@ r1 = buf[1] + buf[3]@		
+	VLD1.I32			{d0, d1, d2, d3}, [r0]
+
+	VADD.S32			d4, d0, d1							@ r0 = buf[0] + buf[2]@ r1 = buf[1] + buf[3]@
 	VSUB.S32			d5, d0, d1							@ r2 = buf[0] - buf[2]@ r3 = buf[1] - buf[3]@
 	VSUB.S32			d7, d2, d3							@ r4 = buf[4] + buf[6]@ r5 = buf[5] + buf[7]@
 	VADD.S32			d6, d2, d3							@ r6 = buf[4] - buf[6]@ r7 = buf[5] - buf[7]@
-	
-	VREV64.I32		d7, d7									@ 
-	
+
+	VREV64.I32		d7, d7									@
+
 	VADD.S32			Q4, Q2, Q3
 	VSUB.S32			Q5, Q2, Q3
-	
+
 	VREV64.I32		d11, d11
 	VTRN.32				d9, d11
-	subs       		r1, r1, #1	
+	subs       		r1, r1, #1
 	VREV64.I32		d11, d11
 	VST1.I32			{d8, d9, d10, d11}, [r0]!
 
 	bne       		Radix4First_LOOP
-	
+
 Radix4First_END:
+	fldmfdd   		sp!, {d8 - d15}
 	ldmia    		sp!, {r4 - r11, pc}
 
 	@ENDP  @ |Radix4First|
-	.end
\ No newline at end of file
+	.fnend
diff --git a/media/libstagefright/codecs/aacenc/src/asm/ARMV7/Radix4FFT_v7.s b/media/libstagefright/codecs/aacenc/src/asm/ARMV7/Radix4FFT_v7.s
index 84a4a80..431bc30 100644
--- a/media/libstagefright/codecs/aacenc/src/asm/ARMV7/Radix4FFT_v7.s
+++ b/media/libstagefright/codecs/aacenc/src/asm/ARMV7/Radix4FFT_v7.s
@@ -23,121 +23,126 @@
 
 	.section .text
 	.global	Radix4FFT
+	.fnstart
 
 Radix4FFT:
 	stmdb    sp!, {r4 - r11, lr}
+	.save	 {r4 - r11, lr}
+	fstmfdd  sp!, {d8 - d15}
+	.vsave	 {d8 - d15}
 
 	mov			r1, r1, asr #2
-	cmp     	r1, #0                            
-	beq     	Radix4FFT_END                            
-                        
-Radix4FFT_LOOP1:                         
-	mov     	r5, r2, lsl #1  
-	mov     	r8, r0          
-	mov     	r7, r1  
-	mov     	r5, r5, lsl #2   
-	cmp     	r1, #0          
-	rsbeq   	r12, r5, r5, lsl #2 
-	beq     	Radix4FFT_LOOP1_END              
-                         
-	rsb     	r12, r5, r5, lsl #2   
-	 
-Radix4FFT_LOOP2:                        
-	mov     	r6, r3 
-	mov     	r4, r2  
-	cmp     	r2, #0        
-	beq     	Radix4FFT_LOOP2_END         
-  
-Radix4FFT_LOOP3:                          
+	cmp     	r1, #0
+	beq     	Radix4FFT_END
+
+Radix4FFT_LOOP1:
+	mov     	r5, r2, lsl #1
+	mov     	r8, r0
+	mov     	r7, r1
+	mov     	r5, r5, lsl #2
+	cmp     	r1, #0
+	rsbeq   	r12, r5, r5, lsl #2
+	beq     	Radix4FFT_LOOP1_END
+
+	rsb     	r12, r5, r5, lsl #2
+
+Radix4FFT_LOOP2:
+	mov     	r6, r3
+	mov     	r4, r2
+	cmp     	r2, #0
+	beq     	Radix4FFT_LOOP2_END
+
+Radix4FFT_LOOP3:
 	@r0 = xptr[0]@
 	@r1 = xptr[1]@
-	VLD2.I32			{D0, D1, D2, D3}, [r8]				
+	VLD2.I32			{D0, D1, D2, D3}, [r8]
 	VLD2.I32			{D28, D29, D30, D31}, [r6]!		@ cosx = csptr[0]@ sinx = csptr[1]@
-	
-	add					r8, r8, r5										@ xptr += step@	
+
+	add					r8, r8, r5										@ xptr += step@
 	VLD2.I32			{D4, D5, D6,D7}, [r8]					@ r2 = xptr[0]@ r3 = xptr[1]@
-	
+
 	VQDMULH.S32		Q10, Q2, Q14									@ MULHIGH(cosx, t0)
 	VQDMULH.S32		Q11, Q3, Q15									@ MULHIGH(sinx, t1)
 	VQDMULH.S32		Q12, Q3, Q14									@ MULHIGH(cosx, t1)
 	VQDMULH.S32		Q13, Q2, Q15									@ MULHIGH(sinx, t0)
-		
+
 	VADD.S32			Q2, Q10, Q11									@ MULHIGH(cosx, t0) + MULHIGH(sinx, t1)
 	VSUB.S32			Q3, Q12, Q13									@ MULHIGH(cosx, t1) - MULHIGH(sinx, t0)
-	
+
 	add					r8, r8, r5										@ xptr += step@
 	VSHR.S32			Q10, Q0, #2										@ t0 = r0 >> 2@
 	VSHR.S32			Q11, Q1, #2										@ t1 = r1 >> 2@
-	
+
 	VSUB.S32			Q0,	Q10, Q2										@ r0 = t0 - r2@
 	VSUB.S32			Q1,	Q11, Q3										@ r1 = t1 - r3@
 	VADD.S32			Q2, Q10, Q2										@ r2 = t0 + r2@
 	VADD.S32			Q3, Q11, Q3										@ r3 = t1 + r3@
-		
-	VLD2.I32			{D8, D9, D10, D11}, [r8]	
-	VLD2.I32			{D28, D29, D30, D31}, [r6]!	
+
+	VLD2.I32			{D8, D9, D10, D11}, [r8]
+	VLD2.I32			{D28, D29, D30, D31}, [r6]!
 	add						r8, r8, r5
 
 	VQDMULH.S32		Q10, Q4, Q14									@ MULHIGH(cosx, t0)
 	VQDMULH.S32		Q11, Q5, Q15									@ MULHIGH(sinx, t1)
 	VQDMULH.S32		Q12, Q5, Q14									@ MULHIGH(cosx, t1)
 	VQDMULH.S32		Q13, Q4, Q15									@ MULHIGH(sinx, t0)
-		
+
 	VADD.S32			Q8, Q10, Q11									@ MULHIGH(cosx, t0) + MULHIGH(sinx, t1)
-	VSUB.S32			Q9, Q12, Q13									@ MULHIGH(cosx, t1) - MULHIGH(sinx, t0)	
-	
-	VLD2.I32		{D12, D13, D14, D15}, [r8]	
+	VSUB.S32			Q9, Q12, Q13									@ MULHIGH(cosx, t1) - MULHIGH(sinx, t0)
+
+	VLD2.I32		{D12, D13, D14, D15}, [r8]
 	VLD2.I32		{D28, D29, D30, D31}, [r6]!
-	
+
 	VQDMULH.S32		Q10, Q6, Q14									@ MULHIGH(cosx, t0)
 	VQDMULH.S32		Q11, Q7, Q15									@ MULHIGH(sinx, t1)
 	VQDMULH.S32		Q12, Q7, Q14									@ MULHIGH(cosx, t1)
 	VQDMULH.S32		Q13, Q6, Q15									@ MULHIGH(sinx, t0)
-		
+
 	VADD.S32			Q6, Q10, Q11									@ MULHIGH(cosx, t0) + MULHIGH(sinx, t1)
-	VSUB.S32			Q7, Q12, Q13									@ MULHIGH(cosx, t1) - MULHIGH(sinx, t0)		
-	
+	VSUB.S32			Q7, Q12, Q13									@ MULHIGH(cosx, t1) - MULHIGH(sinx, t0)
+
 	VADD.S32			Q4, Q8, Q6										@ r4 = t0 + r6@
 	VSUB.S32			Q5, Q7, Q9										@ r5 = r7 - t1@
 	VSUB.S32			Q6, Q8, Q6										@ r6 = t0 - r6@
 	VADD.S32			Q7, Q7, Q9										@ r7 = r7 + t1@
-	
+
 	VADD.S32			Q8, Q0, Q5										@ xptr[0] = r0 + r5@
 	VADD.S32			Q9, Q1, Q6										@ xptr[1] = r1 + r6@
 	VST2.I32			{D16, D17, D18, D19}, [r8]
-	
+
 	VSUB.S32			Q10, Q2, Q4										@ xptr[0] = r2 - r4@
 	sub					r8, r8, r5										@ xptr -= step@
 	VSUB.S32			Q11, Q3, Q7										@ xptr[1] = r3 - r7@
 	VST2.I32			{D20, D21, D22, D23}, [r8]
-		
+
 	VSUB.S32			Q8, Q0, Q5										@ xptr[0] = r0 - r5@
 	sub					r8, r8, r5										@ xptr -= step@
 	VSUB.S32			Q9, Q1, Q6										@ xptr[1] = r1 - r6@
 	VST2.I32			{D16, D17, D18, D19}, [r8]
-		
+
 	VADD.S32			Q10, Q2, Q4										@ xptr[0] = r2 + r4@
 	sub					r8, r8, r5										@ xptr -= step@
 	VADD.S32			Q11, Q3, Q7										@ xptr[1] = r3 + r7@
 	VST2.I32			{D20, D21, D22, D23}, [r8]!
-		
-	subs    			r4, r4, #4 
-	bne     			Radix4FFT_LOOP3 
-	                         
-Radix4FFT_LOOP2_END:                         
-	add     			r8, r8, r12    
-	sub    				r7, r7, #1     
+
+	subs    			r4, r4, #4
+	bne     			Radix4FFT_LOOP3
+
+Radix4FFT_LOOP2_END:
+	add     			r8, r8, r12
+	sub    				r7, r7, #1
 	cmp					r7, #0
-	bhi     			Radix4FFT_LOOP2           
-                        
-Radix4FFT_LOOP1_END:                        
-	add     			r3, r12, r3    
-	mov     			r2, r2, lsl #2 
-	movs    			r1, r1, asr #2 
-	bne     			Radix4FFT_LOOP1          
-                        
-Radix4FFT_END:        
+	bhi     			Radix4FFT_LOOP2
+
+Radix4FFT_LOOP1_END:
+	add     			r3, r12, r3
+	mov     			r2, r2, lsl #2
+	movs    			r1, r1, asr #2
+	bne     			Radix4FFT_LOOP1
+
+Radix4FFT_END:
+	fldmfdd   			sp!, {d8 - d15}
 	ldmia   			sp!, {r4 - r11, pc}
-		
+
 	@ENDP  @ |Radix4FFT|
-	.end
\ No newline at end of file
+	.fnend
diff --git a/media/libstagefright/codecs/aacenc/src/band_nrg.c b/media/libstagefright/codecs/aacenc/src/band_nrg.c
index 89c39b6..e4034b8 100644
--- a/media/libstagefright/codecs/aacenc/src/band_nrg.c
+++ b/media/libstagefright/codecs/aacenc/src/band_nrg.c
@@ -37,18 +37,18 @@
                     Word32       *bandEnergySum)
 {
   Word32 i, j;
-  Word32 accuSum = 0;                                            
+  Word32 accuSum = 0;
 
   for (i=0; i<numBands; i++) {
-    Word32 accu = 0;                                             
+    Word32 accu = 0;
     for (j=bandOffset[i]; j<bandOffset[i+1]; j++)
       accu = L_add(accu, MULHIGH(mdctSpectrum[j], mdctSpectrum[j]));
 
 	accu = L_add(accu, accu);
     accuSum = L_add(accuSum, accu);
-    bandEnergy[i] = accu;                                        
+    bandEnergy[i] = accu;
   }
-  *bandEnergySum = accuSum;                                      
+  *bandEnergySum = accuSum;
 }
 
 /********************************************************************************
@@ -68,15 +68,15 @@
 {
 
   Word32 i, j;
-  Word32 accuMidSum = 0;        
-  Word32 accuSideSum = 0;                                          
- 
+  Word32 accuMidSum = 0;
+  Word32 accuSideSum = 0;
+
 
   for(i=0; i<numBands; i++) {
     Word32 accuMid = 0;
-    Word32 accuSide = 0;                                           
+    Word32 accuSide = 0;
     for (j=bandOffset[i]; j<bandOffset[i+1]; j++) {
-      Word32 specm, specs; 
+      Word32 specm, specs;
       Word32 l, r;
 
       l = mdctSpectrumLeft[j] >> 1;
@@ -86,17 +86,17 @@
       accuMid = L_add(accuMid, MULHIGH(specm, specm));
       accuSide = L_add(accuSide, MULHIGH(specs, specs));
     }
-    
+
 	accuMid = L_add(accuMid, accuMid);
 	accuSide = L_add(accuSide, accuSide);
-	bandEnergyMid[i] = accuMid;                                  
+	bandEnergyMid[i] = accuMid;
     accuMidSum = L_add(accuMidSum, accuMid);
-    bandEnergySide[i] = accuSide;                                
+    bandEnergySide[i] = accuSide;
     accuSideSum = L_add(accuSideSum, accuSide);
-    
+
   }
-  *bandEnergyMidSum = accuMidSum;                                
-  *bandEnergySideSum = accuSideSum;                              
+  *bandEnergyMidSum = accuMidSum;
+  *bandEnergySideSum = accuSideSum;
 }
 
-#endif
\ No newline at end of file
+#endif
diff --git a/media/libstagefright/codecs/aacenc/src/bit_cnt.c b/media/libstagefright/codecs/aacenc/src/bit_cnt.c
index 8853efc..9fe511cd 100644
--- a/media/libstagefright/codecs/aacenc/src/bit_cnt.c
+++ b/media/libstagefright/codecs/aacenc/src/bit_cnt.c
@@ -26,14 +26,14 @@
 #define HI_LTAB(a) (a>>8)
 #define LO_LTAB(a) (a & 0xff)
 
-#define EXPAND(a)  ((((Word32)(a&0xff00)) << 8)|(Word32)(a&0xff)) 
+#define EXPAND(a)  ((((Word32)(a&0xff00)) << 8)|(Word32)(a&0xff))
 
 
 /*****************************************************************************
 *
 * function name: count1_2_3_4_5_6_7_8_9_10_11
-* description:  counts tables 1-11 
-* returns:      
+* description:  counts tables 1-11
+* returns:
 * input:        quantized spectrum
 * output:       bitCount for tables 1-11
 *
@@ -46,51 +46,51 @@
   Word32 t0,t1,t2,t3,i;
   Word32 bc1_2,bc3_4,bc5_6,bc7_8,bc9_10;
   Word16 bc11,sc;
-  
-  bc1_2=0;                               
-  bc3_4=0;                               
-  bc5_6=0;                               
-  bc7_8=0;                               
-  bc9_10=0;                              
-  bc11=0;                                
-  sc=0;                                  
+
+  bc1_2=0;
+  bc3_4=0;
+  bc5_6=0;
+  bc7_8=0;
+  bc9_10=0;
+  bc11=0;
+  sc=0;
 
   for(i=0;i<width;i+=4){
-    
-    t0= values[i+0];                     
-    t1= values[i+1];                     
-    t2= values[i+2];                     
-    t3= values[i+3];                     
-  
+
+    t0= values[i+0];
+    t1= values[i+1];
+    t2= values[i+2];
+    t3= values[i+3];
+
     /* 1,2 */
 
-    bc1_2 = bc1_2 + EXPAND(huff_ltab1_2[t0+1][t1+1][t2+1][t3+1]);              
+    bc1_2 = bc1_2 + EXPAND(huff_ltab1_2[t0+1][t1+1][t2+1][t3+1]);
 
     /* 5,6 */
-    bc5_6 = bc5_6 + EXPAND(huff_ltab5_6[t0+4][t1+4]);                          
-    bc5_6 = bc5_6 + EXPAND(huff_ltab5_6[t2+4][t3+4]);                          
+    bc5_6 = bc5_6 + EXPAND(huff_ltab5_6[t0+4][t1+4]);
+    bc5_6 = bc5_6 + EXPAND(huff_ltab5_6[t2+4][t3+4]);
 
     t0=ABS(t0);
     t1=ABS(t1);
     t2=ABS(t2);
     t3=ABS(t3);
 
-    
-    bc3_4 = bc3_4 + EXPAND(huff_ltab3_4[t0][t1][t2][t3]);                      
-    
-    bc7_8 = bc7_8 + EXPAND(huff_ltab7_8[t0][t1]);                              
-    bc7_8 = bc7_8 + EXPAND(huff_ltab7_8[t2][t3]);                              
-    
-    bc9_10 = bc9_10 + EXPAND(huff_ltab9_10[t0][t1]);                           
-    bc9_10 = bc9_10 + EXPAND(huff_ltab9_10[t2][t3]);                           
-    
+
+    bc3_4 = bc3_4 + EXPAND(huff_ltab3_4[t0][t1][t2][t3]);
+
+    bc7_8 = bc7_8 + EXPAND(huff_ltab7_8[t0][t1]);
+    bc7_8 = bc7_8 + EXPAND(huff_ltab7_8[t2][t3]);
+
+    bc9_10 = bc9_10 + EXPAND(huff_ltab9_10[t0][t1]);
+    bc9_10 = bc9_10 + EXPAND(huff_ltab9_10[t2][t3]);
+
     bc11 = bc11 + huff_ltab11[t0][t1];
     bc11 = bc11 + huff_ltab11[t2][t3];
-   
-           
+
+
     sc = sc + (t0>0) + (t1>0) + (t2>0) + (t3>0);
   }
-  
+
   bitCount[1]=extract_h(bc1_2);
   bitCount[2]=extract_l(bc1_2);
   bitCount[3]=extract_h(bc3_4) + sc;
@@ -108,8 +108,8 @@
 /*****************************************************************************
 *
 * function name: count3_4_5_6_7_8_9_10_11
-* description:  counts tables 3-11 
-* returns:      
+* description:  counts tables 3-11
+* returns:
 * input:        quantized spectrum
 * output:       bitCount for tables 3-11
 *
@@ -122,26 +122,26 @@
   Word32 t0,t1,t2,t3, i;
   Word32 bc3_4,bc5_6,bc7_8,bc9_10;
   Word16 bc11,sc;
-    
-  bc3_4=0;                               
-  bc5_6=0;                               
-  bc7_8=0;                               
-  bc9_10=0;                              
-  bc11=0;                                
-  sc=0;                                  
+
+  bc3_4=0;
+  bc5_6=0;
+  bc7_8=0;
+  bc9_10=0;
+  bc11=0;
+  sc=0;
 
   for(i=0;i<width;i+=4){
 
-    t0= values[i+0];                     
-    t1= values[i+1];                     
-    t2= values[i+2];                     
-    t3= values[i+3];                     
-    
+    t0= values[i+0];
+    t1= values[i+1];
+    t2= values[i+2];
+    t3= values[i+3];
+
     /*
       5,6
     */
-    bc5_6 = bc5_6 + EXPAND(huff_ltab5_6[t0+4][t1+4]);                          
-    bc5_6 = bc5_6 + EXPAND(huff_ltab5_6[t2+4][t3+4]);                          
+    bc5_6 = bc5_6 + EXPAND(huff_ltab5_6[t0+4][t1+4]);
+    bc5_6 = bc5_6 + EXPAND(huff_ltab5_6[t2+4][t3+4]);
 
     t0=ABS(t0);
     t1=ABS(t1);
@@ -149,23 +149,23 @@
     t3=ABS(t3);
 
 
-    bc3_4 = bc3_4 + EXPAND(huff_ltab3_4[t0][t1][t2][t3]);                      
-                                                                                                                
-    bc7_8 = bc7_8 + EXPAND(huff_ltab7_8[t0][t1]);                              
-    bc7_8 = bc7_8 + EXPAND(huff_ltab7_8[t2][t3]);                              
-    
-    bc9_10 = bc9_10 + EXPAND(huff_ltab9_10[t0][t1]);                           
-    bc9_10 = bc9_10 + EXPAND(huff_ltab9_10[t2][t3]);                           
-                                                                                                                
+    bc3_4 = bc3_4 + EXPAND(huff_ltab3_4[t0][t1][t2][t3]);
+
+    bc7_8 = bc7_8 + EXPAND(huff_ltab7_8[t0][t1]);
+    bc7_8 = bc7_8 + EXPAND(huff_ltab7_8[t2][t3]);
+
+    bc9_10 = bc9_10 + EXPAND(huff_ltab9_10[t0][t1]);
+    bc9_10 = bc9_10 + EXPAND(huff_ltab9_10[t2][t3]);
+
     bc11 = bc11 + huff_ltab11[t0][t1];
     bc11 = bc11 + huff_ltab11[t2][t3];
 
-           
-    sc = sc + (t0>0) + (t1>0) + (t2>0) + (t3>0);   
+
+    sc = sc + (t0>0) + (t1>0) + (t2>0) + (t3>0);
   }
-  
-  bitCount[1]=INVALID_BITCOUNT;                          
-  bitCount[2]=INVALID_BITCOUNT;                          
+
+  bitCount[1]=INVALID_BITCOUNT;
+  bitCount[2]=INVALID_BITCOUNT;
   bitCount[3]=extract_h(bc3_4) + sc;
   bitCount[4]=extract_l(bc3_4) + sc;
   bitCount[5]=extract_h(bc5_6);
@@ -175,7 +175,7 @@
   bitCount[9]=extract_h(bc9_10) + sc;
   bitCount[10]=extract_l(bc9_10) + sc;
   bitCount[11]=bc11 + sc;
-  
+
 }
 
 
@@ -183,8 +183,8 @@
 /*****************************************************************************
 *
 * function name: count5_6_7_8_9_10_11
-* description:  counts tables 5-11 
-* returns:      
+* description:  counts tables 5-11
+* returns:
 * input:        quantized spectrum
 * output:       bitCount for tables 5-11
 *
@@ -198,33 +198,33 @@
   Word32 bc5_6,bc7_8,bc9_10;
   Word16 bc11,sc;
 
-  bc5_6=0;                               
-  bc7_8=0;                               
-  bc9_10=0;                              
-  bc11=0;                                
-  sc=0;                                  
+  bc5_6=0;
+  bc7_8=0;
+  bc9_10=0;
+  bc11=0;
+  sc=0;
 
   for(i=0;i<width;i+=2){
 
-    t0 = values[i+0];                    
-    t1 = values[i+1];                    
+    t0 = values[i+0];
+    t1 = values[i+1];
 
-    bc5_6 = bc5_6 + EXPAND(huff_ltab5_6[t0+4][t1+4]);                  
+    bc5_6 = bc5_6 + EXPAND(huff_ltab5_6[t0+4][t1+4]);
 
     t0=ABS(t0);
     t1=ABS(t1);
-     
-    bc7_8 = bc7_8 + EXPAND(huff_ltab7_8[t0][t1]);                      
-    bc9_10 = bc9_10 + EXPAND(huff_ltab9_10[t0][t1]);                   
+
+    bc7_8 = bc7_8 + EXPAND(huff_ltab7_8[t0][t1]);
+    bc9_10 = bc9_10 + EXPAND(huff_ltab9_10[t0][t1]);
     bc11 = bc11 + huff_ltab11[t0][t1];
-    
-       
+
+
     sc = sc + (t0>0) + (t1>0);
   }
-  bitCount[1]=INVALID_BITCOUNT;                          
-  bitCount[2]=INVALID_BITCOUNT;                          
-  bitCount[3]=INVALID_BITCOUNT;                          
-  bitCount[4]=INVALID_BITCOUNT;                          
+  bitCount[1]=INVALID_BITCOUNT;
+  bitCount[2]=INVALID_BITCOUNT;
+  bitCount[3]=INVALID_BITCOUNT;
+  bitCount[4]=INVALID_BITCOUNT;
   bitCount[5]=extract_h(bc5_6);
   bitCount[6]=extract_l(bc5_6);
   bitCount[7]=extract_h(bc7_8) + sc;
@@ -232,15 +232,15 @@
   bitCount[9]=extract_h(bc9_10) + sc;
   bitCount[10]=extract_l(bc9_10) + sc;
   bitCount[11]=bc11 + sc;
-  
+
 }
 
 
 /*****************************************************************************
 *
 * function name: count7_8_9_10_11
-* description:  counts tables 7-11 
-* returns:      
+* description:  counts tables 7-11
+* returns:
 * input:        quantized spectrum
 * output:       bitCount for tables 7-11
 *
@@ -253,43 +253,43 @@
   Word32 t0,t1, i;
   Word32 bc7_8,bc9_10;
   Word16 bc11,sc;
-    
-  bc7_8=0;                       
-  bc9_10=0;                      
-  bc11=0;                        
-  sc=0;                          
+
+  bc7_8=0;
+  bc9_10=0;
+  bc11=0;
+  sc=0;
 
   for(i=0;i<width;i+=2){
 
     t0=ABS(values[i+0]);
     t1=ABS(values[i+1]);
 
-    bc7_8 = bc7_8 + EXPAND(huff_ltab7_8[t0][t1]);                      
-    bc9_10 = bc9_10 + EXPAND(huff_ltab9_10[t0][t1]);                   
+    bc7_8 = bc7_8 + EXPAND(huff_ltab7_8[t0][t1]);
+    bc9_10 = bc9_10 + EXPAND(huff_ltab9_10[t0][t1]);
     bc11 = bc11 + huff_ltab11[t0][t1];
-   
-       
+
+
     sc = sc + (t0>0) + (t1>0);
   }
-  bitCount[1]=INVALID_BITCOUNT;                  
-  bitCount[2]=INVALID_BITCOUNT;                  
-  bitCount[3]=INVALID_BITCOUNT;                  
-  bitCount[4]=INVALID_BITCOUNT;                  
-  bitCount[5]=INVALID_BITCOUNT;                  
-  bitCount[6]=INVALID_BITCOUNT;                  
+  bitCount[1]=INVALID_BITCOUNT;
+  bitCount[2]=INVALID_BITCOUNT;
+  bitCount[3]=INVALID_BITCOUNT;
+  bitCount[4]=INVALID_BITCOUNT;
+  bitCount[5]=INVALID_BITCOUNT;
+  bitCount[6]=INVALID_BITCOUNT;
   bitCount[7]=extract_h(bc7_8) + sc;
   bitCount[8]=extract_l(bc7_8) + sc;
   bitCount[9]=extract_h(bc9_10) + sc;
   bitCount[10]=extract_l(bc9_10) + sc;
   bitCount[11]=bc11 + sc;
-  
+
 }
 
 /*****************************************************************************
 *
 * function name: count9_10_11
-* description:  counts tables 9-11 
-* returns:      
+* description:  counts tables 9-11
+* returns:
 * input:        quantized spectrum
 * output:       bitCount for tables 9-11
 *
@@ -299,45 +299,45 @@
                          Word16       *bitCount)
 {
 
-  Word32 t0,t1,i;  
+  Word32 t0,t1,i;
   Word32 bc9_10;
   Word16 bc11,sc;
 
-  bc9_10=0;                              
-  bc11=0;                                
-  sc=0;                                  
+  bc9_10=0;
+  bc11=0;
+  sc=0;
 
   for(i=0;i<width;i+=2){
 
     t0=ABS(values[i+0]);
     t1=ABS(values[i+1]);
-    
 
-    bc9_10 += EXPAND(huff_ltab9_10[t0][t1]);           
+
+    bc9_10 += EXPAND(huff_ltab9_10[t0][t1]);
     bc11 = bc11 + huff_ltab11[t0][t1];
 
-       
+
     sc = sc + (t0>0) + (t1>0);
   }
-  bitCount[1]=INVALID_BITCOUNT;          
-  bitCount[2]=INVALID_BITCOUNT;          
-  bitCount[3]=INVALID_BITCOUNT;          
-  bitCount[4]=INVALID_BITCOUNT;          
-  bitCount[5]=INVALID_BITCOUNT;          
-  bitCount[6]=INVALID_BITCOUNT;          
-  bitCount[7]=INVALID_BITCOUNT;          
-  bitCount[8]=INVALID_BITCOUNT;          
+  bitCount[1]=INVALID_BITCOUNT;
+  bitCount[2]=INVALID_BITCOUNT;
+  bitCount[3]=INVALID_BITCOUNT;
+  bitCount[4]=INVALID_BITCOUNT;
+  bitCount[5]=INVALID_BITCOUNT;
+  bitCount[6]=INVALID_BITCOUNT;
+  bitCount[7]=INVALID_BITCOUNT;
+  bitCount[8]=INVALID_BITCOUNT;
   bitCount[9]=extract_h(bc9_10) + sc;
   bitCount[10]=extract_l(bc9_10) + sc;
   bitCount[11]=bc11 + sc;
-  
+
 }
- 
+
 /*****************************************************************************
 *
 * function name: count11
-* description:  counts table 11 
-* returns:      
+* description:  counts table 11
+* returns:
 * input:        quantized spectrum
 * output:       bitCount for table 11
 *
@@ -347,37 +347,37 @@
                     Word16        *bitCount)
 {
   Word32 t0,t1,i;
-  Word16 bc11,sc;  
+  Word16 bc11,sc;
 
-  bc11=0;                        
-  sc=0;                          
+  bc11=0;
+  sc=0;
   for(i=0;i<width;i+=2){
     t0=ABS(values[i+0]);
     t1=ABS(values[i+1]);
     bc11 = bc11 + huff_ltab11[t0][t1];
 
-       
+
     sc = sc + (t0>0) + (t1>0);
   }
 
-  bitCount[1]=INVALID_BITCOUNT;                  
-  bitCount[2]=INVALID_BITCOUNT;                  
-  bitCount[3]=INVALID_BITCOUNT;                  
-  bitCount[4]=INVALID_BITCOUNT;                  
-  bitCount[5]=INVALID_BITCOUNT;                  
-  bitCount[6]=INVALID_BITCOUNT;                  
-  bitCount[7]=INVALID_BITCOUNT;                  
-  bitCount[8]=INVALID_BITCOUNT;                  
-  bitCount[9]=INVALID_BITCOUNT;                  
-  bitCount[10]=INVALID_BITCOUNT;                 
+  bitCount[1]=INVALID_BITCOUNT;
+  bitCount[2]=INVALID_BITCOUNT;
+  bitCount[3]=INVALID_BITCOUNT;
+  bitCount[4]=INVALID_BITCOUNT;
+  bitCount[5]=INVALID_BITCOUNT;
+  bitCount[6]=INVALID_BITCOUNT;
+  bitCount[7]=INVALID_BITCOUNT;
+  bitCount[8]=INVALID_BITCOUNT;
+  bitCount[9]=INVALID_BITCOUNT;
+  bitCount[10]=INVALID_BITCOUNT;
   bitCount[11]=bc11 + sc;
 }
 
 /*****************************************************************************
 *
 * function name: countEsc
-* description:  counts table 11 (with Esc) 
-* returns:      
+* description:  counts table 11 (with Esc)
+* returns:
 * input:        quantized spectrum
 * output:       bitCount for tables 11 (with Esc)
 *
@@ -388,31 +388,31 @@
                      Word16       *bitCount)
 {
   Word32 t0,t1,t00,t01,i;
-  Word16 bc11,ec,sc;  
+  Word16 bc11,ec,sc;
 
-  bc11=0;                                
-  sc=0;                                  
-  ec=0;                                  
+  bc11=0;
+  sc=0;
+  ec=0;
   for(i=0;i<width;i+=2){
     t0=ABS(values[i+0]);
     t1=ABS(values[i+1]);
-    
-       
+
+
     sc = sc + (t0>0) + (t1>0);
 
     t00 = min(t0,16);
     t01 = min(t1,16);
     bc11 = bc11 + huff_ltab11[t00][t01];
-    
-     
+
+
     if(t0 >= 16){
       ec = ec + 5;
       while(sub(t0=(t0 >> 1), 16) >= 0) {
         ec = ec + 2;
       }
     }
-    
-     
+
+
     if(t1 >= 16){
       ec = ec + 5;
       while(sub(t1=(t1 >> 1), 16) >= 0) {
@@ -420,16 +420,16 @@
       }
     }
   }
-  bitCount[1]=INVALID_BITCOUNT;          
-  bitCount[2]=INVALID_BITCOUNT;          
-  bitCount[3]=INVALID_BITCOUNT;          
-  bitCount[4]=INVALID_BITCOUNT;          
-  bitCount[5]=INVALID_BITCOUNT;          
-  bitCount[6]=INVALID_BITCOUNT;          
-  bitCount[7]=INVALID_BITCOUNT;          
-  bitCount[8]=INVALID_BITCOUNT;          
-  bitCount[9]=INVALID_BITCOUNT;          
-  bitCount[10]=INVALID_BITCOUNT;         
+  bitCount[1]=INVALID_BITCOUNT;
+  bitCount[2]=INVALID_BITCOUNT;
+  bitCount[3]=INVALID_BITCOUNT;
+  bitCount[4]=INVALID_BITCOUNT;
+  bitCount[5]=INVALID_BITCOUNT;
+  bitCount[6]=INVALID_BITCOUNT;
+  bitCount[7]=INVALID_BITCOUNT;
+  bitCount[8]=INVALID_BITCOUNT;
+  bitCount[9]=INVALID_BITCOUNT;
+  bitCount[10]=INVALID_BITCOUNT;
   bitCount[11]=bc11 + sc + ec;
 }
 
@@ -463,7 +463,7 @@
 /*****************************************************************************
 *
 * function name: bitCount
-* description:  count bits 
+* description:  count bits
 *
 *****************************************************************************/
 Word16 bitCount(const Word16 *values,
@@ -474,7 +474,7 @@
   /*
     check if we can use codebook 0
   */
-     
+
   if(maxVal == 0)
     bitCount[0] = 0;
   else
@@ -489,7 +489,7 @@
 /*****************************************************************************
 *
 * function name: codeValues
-* description:  write huffum bits 
+* description:  write huffum bits
 *
 *****************************************************************************/
 Word16 codeValues(Word16 *values, Word16 width, Word16 codeBook, HANDLE_BIT_BUF hBitstream)
@@ -499,85 +499,85 @@
   UWord16 codeWord, codeLength;
   Word16 sign, signLength;
 
-   
+
   switch (codeBook) {
     case CODE_BOOK_ZERO_NO:
       break;
 
     case CODE_BOOK_1_NO:
       for(i=0; i<width; i+=4) {
-        t0         = values[i+0];                                        
-        t1         = values[i+1];                                        
-        t2         = values[i+2];                                        
-        t3         = values[i+3];                                        
-        codeWord   = huff_ctab1[t0+1][t1+1][t2+1][t3+1];                 
-        codeLength = HI_LTAB(huff_ltab1_2[t0+1][t1+1][t2+1][t3+1]);      
-        WriteBits(hBitstream, codeWord, codeLength);        
+        t0         = values[i+0];
+        t1         = values[i+1];
+        t2         = values[i+2];
+        t3         = values[i+3];
+        codeWord   = huff_ctab1[t0+1][t1+1][t2+1][t3+1];
+        codeLength = HI_LTAB(huff_ltab1_2[t0+1][t1+1][t2+1][t3+1]);
+        WriteBits(hBitstream, codeWord, codeLength);
       }
       break;
 
     case CODE_BOOK_2_NO:
       for(i=0; i<width; i+=4) {
-        t0         = values[i+0];                                        
-        t1         = values[i+1];                                        
-        t2         = values[i+2];                                        
-        t3         = values[i+3];                                        
-        codeWord   = huff_ctab2[t0+1][t1+1][t2+1][t3+1];                 
-        codeLength = LO_LTAB(huff_ltab1_2[t0+1][t1+1][t2+1][t3+1]);      
+        t0         = values[i+0];
+        t1         = values[i+1];
+        t2         = values[i+2];
+        t3         = values[i+3];
+        codeWord   = huff_ctab2[t0+1][t1+1][t2+1][t3+1];
+        codeLength = LO_LTAB(huff_ltab1_2[t0+1][t1+1][t2+1][t3+1]);
         WriteBits(hBitstream,codeWord,codeLength);
       }
       break;
 
     case CODE_BOOK_3_NO:
       for(i=0; i<width; i+=4) {
-        sign=0;                                                          
-        signLength=0;                                                    
-        t0 = values[i+0];                                                
-         
+        sign=0;
+        signLength=0;
+        t0 = values[i+0];
+
         if(t0 != 0){
           signLength = signLength + 1;
-          sign = sign << 1; 
-           
+          sign = sign << 1;
+
           if(t0 < 0){
-            sign|=1;                                                     
+            sign|=1;
             t0=-t0;
           }
         }
-        t1 = values[i+1];                                                
-         
+        t1 = values[i+1];
+
         if(t1 != 0){
           signLength = signLength + 1;
-          sign = sign << 1; 
-           
+          sign = sign << 1;
+
           if(t1 < 0){
-            sign|=1;                                                     
+            sign|=1;
             t1=-t1;
           }
         }
-        t2 = values[i+2];                                                
-         
+        t2 = values[i+2];
+
         if(t2 != 0){
           signLength = signLength + 1;
-          sign = sign << 1; 
-           
+          sign = sign << 1;
+
           if(t2 < 0){
-            sign|=1;                                                     
+            sign|=1;
             t2=-t2;
           }
         }
-        t3 = values[i+3];                                                
+        t3 = values[i+3];
         if(t3 != 0){
           signLength = signLength + 1;
-          sign = sign << 1; 
-           
+          sign = sign << 1;
+
           if(t3 < 0){
-            sign|=1;                                                     
+            sign|=1;
             t3=-t3;
           }
         }
 
-        codeWord   = huff_ctab3[t0][t1][t2][t3];                         
-        codeLength = HI_LTAB(huff_ltab3_4[t0][t1][t2][t3]);              
+        codeWord   = huff_ctab3[t0][t1][t2][t3];
+        codeLength = HI_LTAB(huff_ltab3_4[t0][t1][t2][t3]);
         WriteBits(hBitstream,codeWord,codeLength);
         WriteBits(hBitstream,sign,signLength);
       }
@@ -585,107 +585,107 @@
 
     case CODE_BOOK_4_NO:
       for(i=0; i<width; i+=4) {
-        sign=0;                                                          
-        signLength=0;                                                    
-        t0 = values[i+0];                                                
-         
-        if(t0 != 0){                                                             
+        sign=0;
+        signLength=0;
+        t0 = values[i+0];
+
+        if(t0 != 0){
           signLength = signLength + 1;
-          sign = sign << 1; 
-          if(t0 < 0){                                                            
-            sign|=1;                                                     
-            t0=-t0;                                                          
+          sign = sign << 1;
+          if(t0 < 0){
+            sign|=1;
+            t0=-t0;
           }
-        }                                                                        
-        t1 = values[i+1];                                                
-         
-        if(t1 != 0){                                                             
+        }
+        t1 = values[i+1];
+
+        if(t1 != 0){
           signLength = signLength + 1;
-          sign = sign << 1; 
-           
-          if(t1 < 0){                                                            
-            sign|=1;                                                     
-            t1=-t1;                                                          
-          }                                                                      
-        }                                                                        
-        t2 = values[i+2];                                                
-         
-        if(t2 != 0){                                                    
+          sign = sign << 1;
+
+          if(t1 < 0){
+            sign|=1;
+            t1=-t1;
+          }
+        }
+        t2 = values[i+2];
+
+        if(t2 != 0){
           signLength = signLength + 1;
-          sign = sign << 1; 
-           
-          if(t2 < 0){                                                   
-            sign|=1;                                                     
-            t2=-t2;                                                 
-          }                                                             
-        }                                                               
-        t3 = values[i+3];                                                
-         
-        if(t3 != 0){                                                    
+          sign = sign << 1;
+
+          if(t2 < 0){
+            sign|=1;
+            t2=-t2;
+          }
+        }
+        t3 = values[i+3];
+
+        if(t3 != 0){
           signLength = signLength + 1;
-          sign = sign << 1; 
-           
-          if(t3 < 0){                                                   
-            sign|=1;                                                     
-            t3=-t3;                                                 
-          }                                                             
-        }                                                               
-        codeWord   = huff_ctab4[t0][t1][t2][t3];                         
-        codeLength = LO_LTAB(huff_ltab3_4[t0][t1][t2][t3]);              
-        WriteBits(hBitstream,codeWord,codeLength);                      
-        WriteBits(hBitstream,sign,signLength);                          
-      }                                                                 
-      break;                                                            
-                                                                        
-    case CODE_BOOK_5_NO:                                                
-      for(i=0; i<width; i+=2) {                                         
-        t0         = values[i+0];                                         
-        t1         = values[i+1];                                        
-        codeWord   = huff_ctab5[t0+4][t1+4];                             
-        codeLength = HI_LTAB(huff_ltab5_6[t0+4][t1+4]);                  
+          sign = sign << 1;
+
+          if(t3 < 0){
+            sign|=1;
+            t3=-t3;
+          }
+        }
+        codeWord   = huff_ctab4[t0][t1][t2][t3];
+        codeLength = LO_LTAB(huff_ltab3_4[t0][t1][t2][t3]);
+        WriteBits(hBitstream,codeWord,codeLength);
+        WriteBits(hBitstream,sign,signLength);
+      }
+      break;
+
+    case CODE_BOOK_5_NO:
+      for(i=0; i<width; i+=2) {
+        t0         = values[i+0];
+        t1         = values[i+1];
+        codeWord   = huff_ctab5[t0+4][t1+4];
+        codeLength = HI_LTAB(huff_ltab5_6[t0+4][t1+4]);
         WriteBits(hBitstream,codeWord,codeLength);
       }
       break;
 
     case CODE_BOOK_6_NO:
       for(i=0; i<width; i+=2) {
-        t0         = values[i+0];                                        
-        t1         = values[i+1];                                        
-        codeWord   = huff_ctab6[t0+4][t1+4];                             
-        codeLength = LO_LTAB(huff_ltab5_6[t0+4][t1+4]);                  
+        t0         = values[i+0];
+        t1         = values[i+1];
+        codeWord   = huff_ctab6[t0+4][t1+4];
+        codeLength = LO_LTAB(huff_ltab5_6[t0+4][t1+4]);
         WriteBits(hBitstream,codeWord,codeLength);
       }
       break;
 
     case CODE_BOOK_7_NO:
       for(i=0; i<width; i+=2){
-        sign=0;                                                          
-        signLength=0;                                                    
-        t0 = values[i+0];                                                
-         
+        sign=0;
+        signLength=0;
+        t0 = values[i+0];
+
         if(t0 != 0){
           signLength = signLength + 1;
-          sign = sign << 1; 
-           
+          sign = sign << 1;
+
           if(t0 < 0){
-            sign|=1;                                                     
+            sign|=1;
             t0=-t0;
           }
         }
 
-        t1 = values[i+1];                                                
-         
+        t1 = values[i+1];
+
         if(t1 != 0){
           signLength = signLength + 1;
-          sign = sign << 1; 
-           
+          sign = sign << 1;
+
           if(t1 < 0){
-            sign|=1;                                                     
+            sign|=1;
             t1=-t1;
           }
         }
-        codeWord   = huff_ctab7[t0][t1];                                 
-        codeLength = HI_LTAB(huff_ltab7_8[t0][t1]);                      
+        codeWord   = huff_ctab7[t0][t1];
+        codeLength = HI_LTAB(huff_ltab7_8[t0][t1]);
         WriteBits(hBitstream,codeWord,codeLength);
         WriteBits(hBitstream,sign,signLength);
       }
@@ -693,33 +693,33 @@
 
     case CODE_BOOK_8_NO:
       for(i=0; i<width; i+=2) {
-        sign=0;                                                          
-        signLength=0;                                                    
-        t0 = values[i+0];                                                
-                                                                           
-        if(t0 != 0){                                                             
-          signLength = signLength + 1;                                       
-          sign = sign << 1;                                                   
-                                                                           
-          if(t0 < 0){                                                            
-            sign|=1;                                                     
-            t0=-t0;                                                        
-          }                                                                      
-        }                                                                        
-                                                                                 
-        t1 = values[i+1];                                                
-                                                                           
-        if(t1 != 0){                                                             
-          signLength = signLength + 1;                                       
-          sign = sign << 1;                                                   
-                                                                           
-          if(t1 < 0){                                                            
-            sign|=1;                                                     
-            t1=-t1;                                                        
-          }                                                                      
-        }                                                                        
-        codeWord   = huff_ctab8[t0][t1];                                 
-        codeLength = LO_LTAB(huff_ltab7_8[t0][t1]);                      
+        sign=0;
+        signLength=0;
+        t0 = values[i+0];
+
+        if(t0 != 0){
+          signLength = signLength + 1;
+          sign = sign << 1;
+
+          if(t0 < 0){
+            sign|=1;
+            t0=-t0;
+          }
+        }
+
+        t1 = values[i+1];
+
+        if(t1 != 0){
+          signLength = signLength + 1;
+          sign = sign << 1;
+
+          if(t1 < 0){
+            sign|=1;
+            t1=-t1;
+          }
+        }
+        codeWord   = huff_ctab8[t0][t1];
+        codeLength = LO_LTAB(huff_ltab7_8[t0][t1]);
         WriteBits(hBitstream,codeWord,codeLength);
         WriteBits(hBitstream,sign,signLength);
       }
@@ -727,33 +727,33 @@
 
     case CODE_BOOK_9_NO:
       for(i=0; i<width; i+=2) {
-        sign=0;                                                          
-        signLength=0;                                                    
-        t0 = values[i+0];                                                
-                                                                           
-        if(t0 != 0){                                                             
-          signLength = signLength + 1;                                       
-          sign = sign << 1;                                                   
-                                                                           
-          if(t0 < 0){                                                            
-            sign|=1;                                                     
-            t0=-t0;                                                        
-          }                                                                      
-        }                                                                        
-                                                                                 
-        t1 = values[i+1];                                                
-                                                                           
-        if(t1 != 0){                                                             
-          signLength = signLength + 1;                                       
-          sign = sign << 1;                                                   
-                                                                           
-          if(t1 < 0){                                                            
-            sign|=1;                                                     
-            t1=-t1;                                                        
-          }                                                                      
-        }                                                                        
-        codeWord   = huff_ctab9[t0][t1];                                 
-        codeLength = HI_LTAB(huff_ltab9_10[t0][t1]);                     
+        sign=0;
+        signLength=0;
+        t0 = values[i+0];
+
+        if(t0 != 0){
+          signLength = signLength + 1;
+          sign = sign << 1;
+
+          if(t0 < 0){
+            sign|=1;
+            t0=-t0;
+          }
+        }
+
+        t1 = values[i+1];
+
+        if(t1 != 0){
+          signLength = signLength + 1;
+          sign = sign << 1;
+
+          if(t1 < 0){
+            sign|=1;
+            t1=-t1;
+          }
+        }
+        codeWord   = huff_ctab9[t0][t1];
+        codeLength = HI_LTAB(huff_ltab9_10[t0][t1]);
         WriteBits(hBitstream,codeWord,codeLength);
         WriteBits(hBitstream,sign,signLength);
       }
@@ -761,33 +761,33 @@
 
     case CODE_BOOK_10_NO:
       for(i=0; i<width; i+=2) {
-        sign=0;                                                          
-        signLength=0;                                                    
-        t0 = values[i+0];                                                
-                                                                           
-        if(t0 != 0){                                                             
-          signLength = signLength + 1;                                       
-          sign = sign << 1;                                                   
-                                                                           
-          if(t0 < 0){                                                            
-            sign|=1;                                                     
-            t0=-t0;                                                        
-          }                                                                      
-        }                                                                        
-                                                                                 
-        t1 = values[i+1];                                                
-                                                                           
-        if(t1 != 0){                                                             
-          signLength = signLength + 1;                                       
-          sign = sign << 1;                                                   
-                                                                           
-          if(t1 < 0){                                                            
-            sign|=1;                                                     
-            t1=-t1;                                                        
-          }                                                                      
-        }                                                                        
-        codeWord   = huff_ctab10[t0][t1];                                
-        codeLength = LO_LTAB(huff_ltab9_10[t0][t1]);                     
+        sign=0;
+        signLength=0;
+        t0 = values[i+0];
+
+        if(t0 != 0){
+          signLength = signLength + 1;
+          sign = sign << 1;
+
+          if(t0 < 0){
+            sign|=1;
+            t0=-t0;
+          }
+        }
+
+        t1 = values[i+1];
+
+        if(t1 != 0){
+          signLength = signLength + 1;
+          sign = sign << 1;
+
+          if(t1 < 0){
+            sign|=1;
+            t1=-t1;
+          }
+        }
+        codeWord   = huff_ctab10[t0][t1];
+        codeLength = LO_LTAB(huff_ltab9_10[t0][t1]);
         WriteBits(hBitstream,codeWord,codeLength);
         WriteBits(hBitstream,sign,signLength);
       }
@@ -795,45 +795,45 @@
 
     case CODE_BOOK_ESC_NO:
       for(i=0; i<width; i+=2) {
-        sign=0;                                                  
-        signLength=0;                                            
-        t0 = values[i+0];                                        
-                                                                   
-        if(t0 != 0){                                                     
-          signLength = signLength + 1;                               
-          sign = sign << 1;                                           
-                                                                   
-          if(t0 < 0){                                                    
-            sign|=1;                                             
-            t0=-t0;                                                
-          }                                                              
-        }                                                                
-                                                                         
-        t1 = values[i+1];                                        
-                                                                   
-        if(t1 != 0){                                                     
-          signLength = signLength + 1;                               
-          sign = sign << 1;                                           
-                                                                   
-          if(t1 < 0){                                                    
-            sign|=1;                                             
-            t1=-t1;                                                
-          }                                                              
-        }                                                                
+        sign=0;
+        signLength=0;
+        t0 = values[i+0];
+
+        if(t0 != 0){
+          signLength = signLength + 1;
+          sign = sign << 1;
+
+          if(t0 < 0){
+            sign|=1;
+            t0=-t0;
+          }
+        }
+
+        t1 = values[i+1];
+
+        if(t1 != 0){
+          signLength = signLength + 1;
+          sign = sign << 1;
+
+          if(t1 < 0){
+            sign|=1;
+            t1=-t1;
+          }
+        }
         t00 = min(t0,16);
         t01 = min(t1,16);
 
-        codeWord   = huff_ctab11[t00][t01];                      
-        codeLength = huff_ltab11[t00][t01];                      
+        codeWord   = huff_ctab11[t00][t01];
+        codeLength = huff_ltab11[t00][t01];
         WriteBits(hBitstream,codeWord,codeLength);
         WriteBits(hBitstream,sign,signLength);
-         
+
         if(t0 >= 16){
           Word16 n, p;
-          n=0;                                                   
-          p=t0;                                                  
+          n=0;
+          p=t0;
           while(sub(p=(p >> 1), 16) >= 0){
-             
+
             WriteBits(hBitstream,1,1);
             n = n + 1;
           }
@@ -841,13 +841,13 @@
           n = n + 4;
           WriteBits(hBitstream,(t0 - (1 << n)),n);
         }
-         
+
         if(t1 >= 16){
           Word16 n, p;
-          n=0;                                                   
-          p=t1;                                                  
+          n=0;
+          p=t1;
           while(sub(p=(p >> 1), 16) >= 0){
-             
+
             WriteBits(hBitstream,1,1);
             n = n + 1;
           }
@@ -871,15 +871,15 @@
 
 Word16 codeScalefactorDelta(Word16 delta, HANDLE_BIT_BUF hBitstream)
 {
-  Word32 codeWord; 
+  Word32 codeWord;
   Word16 codeLength;
-  
-   
+
+
   if(delta > CODE_BOOK_SCF_LAV || delta < -CODE_BOOK_SCF_LAV)
     return(1);
-  
-  codeWord   = huff_ctabscf[delta + CODE_BOOK_SCF_LAV];            
-  codeLength = huff_ltabscf[delta + CODE_BOOK_SCF_LAV];            
+
+  codeWord   = huff_ctabscf[delta + CODE_BOOK_SCF_LAV];
+  codeLength = huff_ltabscf[delta + CODE_BOOK_SCF_LAV];
   WriteBits(hBitstream,codeWord,codeLength);
   return(0);
 }
diff --git a/media/libstagefright/codecs/aacenc/src/bitbuffer.c b/media/libstagefright/codecs/aacenc/src/bitbuffer.c
index ef13c13..5615ac3 100644
--- a/media/libstagefright/codecs/aacenc/src/bitbuffer.c
+++ b/media/libstagefright/codecs/aacenc/src/bitbuffer.c
@@ -32,15 +32,15 @@
                                 UWord8 **pBitBufWord,
                                 Word16   cnt)
 {
-  *pBitBufWord += cnt;                                                                  
+  *pBitBufWord += cnt;
 
-                                                                                        
+
   if(*pBitBufWord > hBitBuf->pBitBufEnd) {
-    *pBitBufWord -= (hBitBuf->pBitBufEnd - hBitBuf->pBitBufBase + 1);                   
+    *pBitBufWord -= (hBitBuf->pBitBufEnd - hBitBuf->pBitBufBase + 1);
   }
-                                                                                        
+
   if(*pBitBufWord < hBitBuf->pBitBufBase) {
-    *pBitBufWord += (hBitBuf->pBitBufEnd - hBitBuf->pBitBufBase + 1);                   
+    *pBitBufWord += (hBitBuf->pBitBufEnd - hBitBuf->pBitBufBase + 1);
   }
 }
 
@@ -57,18 +57,18 @@
 {
   assert(bitBufSize*8 <= 32768);
 
-  hBitBuf->pBitBufBase = pBitBufBase;                                                    
-  hBitBuf->pBitBufEnd  = pBitBufBase + bitBufSize - 1;                                  
+  hBitBuf->pBitBufBase = pBitBufBase;
+  hBitBuf->pBitBufEnd  = pBitBufBase + bitBufSize - 1;
 
-  hBitBuf->pWriteNext  = pBitBufBase;                                                    
+  hBitBuf->pWriteNext  = pBitBufBase;
 
   hBitBuf->cache       = 0;
-  
-  hBitBuf->wBitPos     = 0;                                                              
-  hBitBuf->cntBits     = 0;   
-  
-  hBitBuf->size        = (bitBufSize << 3);                                             
-  hBitBuf->isValid     = 1;                                                              
+
+  hBitBuf->wBitPos     = 0;
+  hBitBuf->cntBits     = 0;
+
+  hBitBuf->size        = (bitBufSize << 3);
+  hBitBuf->isValid     = 1;
 
   return hBitBuf;
 }
@@ -82,8 +82,8 @@
 void DeleteBitBuffer(HANDLE_BIT_BUF *hBitBuf)
 {
   if(*hBitBuf)
-	(*hBitBuf)->isValid = 0;                                                               
-  *hBitBuf = NULL;                                                                       
+	(*hBitBuf)->isValid = 0;
+  *hBitBuf = NULL;
 }
 
 /*****************************************************************************
@@ -96,15 +96,15 @@
                  UWord8 *pBitBufBase,
                  Word16  bitBufSize)
 {
-  hBitBuf->pBitBufBase = pBitBufBase;                                                    
-  hBitBuf->pBitBufEnd  = pBitBufBase + bitBufSize - 1;                                  
+  hBitBuf->pBitBufBase = pBitBufBase;
+  hBitBuf->pBitBufEnd  = pBitBufBase + bitBufSize - 1;
 
-                                                 
-  hBitBuf->pWriteNext  = pBitBufBase;                                                    
 
-  hBitBuf->wBitPos     = 0;    
-  hBitBuf->cntBits     = 0;    
-  
+  hBitBuf->pWriteNext  = pBitBufBase;
+
+  hBitBuf->wBitPos     = 0;
+  hBitBuf->cntBits     = 0;
+
   hBitBuf->cache	   = 0;
 }
 
@@ -117,7 +117,7 @@
 void CopyBitBuf(HANDLE_BIT_BUF hBitBufSrc,
                 HANDLE_BIT_BUF hBitBufDst)
 {
-  *hBitBufDst = *hBitBufSrc;                                                             
+  *hBitBufDst = *hBitBufSrc;
 }
 
 /*****************************************************************************
@@ -148,25 +148,25 @@
   if(noBitsToWrite == 0)
 	  return noBitsToWrite;
 
-  hBitBuf->cntBits += noBitsToWrite;   
+  hBitBuf->cntBits += noBitsToWrite;
 
   wBitPos = hBitBuf->wBitPos;
   wBitPos += noBitsToWrite;
-  writeValue <<= 32 - wBitPos;	
+  writeValue <<= 32 - wBitPos;
   writeValue |= hBitBuf->cache;
-  
-  while (wBitPos >= 8) 
+
+  while (wBitPos >= 8)
   {
 	  UWord8 tmp;
 	  tmp = (UWord8)((writeValue >> 24) & 0xFF);
-	  
-	  *hBitBuf->pWriteNext++ = tmp;		
+
+	  *hBitBuf->pWriteNext++ = tmp;
 	  writeValue <<= 8;
 	  wBitPos -= 8;
   }
-  
+
   hBitBuf->wBitPos = wBitPos;
   hBitBuf->cache = writeValue;
-                                                                                     
+
   return noBitsToWrite;
 }
diff --git a/media/libstagefright/codecs/aacenc/src/bitenc.c b/media/libstagefright/codecs/aacenc/src/bitenc.c
index ea34407..fcc12dd 100644
--- a/media/libstagefright/codecs/aacenc/src/bitenc.c
+++ b/media/libstagefright/codecs/aacenc/src/bitenc.c
@@ -46,7 +46,7 @@
   Word16 i,sfb;
   Word16 dbgVal;
   SECTION_INFO* psectioninfo;
-  dbgVal = GetBitsAvail(hBitStream);                                     
+  dbgVal = GetBitsAvail(hBitStream);
 
   for(i=0; i<sectionData->noOfSections; i++) {
     psectioninfo = &(sectionData->sectionInfo[i]);
@@ -100,7 +100,7 @@
   WriteBits(hBitStream,blockType,2);
   WriteBits(hBitStream,windowShape,1);
 
-   
+
   switch(blockType){
     case LONG_WINDOW:
     case START_WINDOW:
@@ -137,30 +137,30 @@
   Word16 sectLen;
   Word16 i;
   Word16 dbgVal=GetBitsAvail(hBitStream);
-       
 
-   
+
+
   switch(sectionData->blockType)
   {
     case LONG_WINDOW:
     case START_WINDOW:
     case STOP_WINDOW:
-      sectEscapeVal = SECT_ESC_VAL_LONG;                 
-      sectLenBits   = SECT_BITS_LONG;                    
+      sectEscapeVal = SECT_ESC_VAL_LONG;
+      sectLenBits   = SECT_BITS_LONG;
       break;
 
     case SHORT_WINDOW:
-      sectEscapeVal = SECT_ESC_VAL_SHORT;                
-      sectLenBits   = SECT_BITS_SHORT;                   
+      sectEscapeVal = SECT_ESC_VAL_SHORT;
+      sectLenBits   = SECT_BITS_SHORT;
       break;
   }
 
   for(i=0;i<sectionData->noOfSections;i++) {
     WriteBits(hBitStream,sectionData->sectionInfo[i].codeBook,4);
-    sectLen = sectionData->sectionInfo[i].sfbCnt;        
+    sectLen = sectionData->sectionInfo[i].sfbCnt;
 
     while(sectLen >= sectEscapeVal) {
-       
+
       WriteBits(hBitStream,sectEscapeVal,sectLenBits);
       sectLen = sectLen - sectEscapeVal;
     }
@@ -183,24 +183,24 @@
 {
   Word16 i,j,lastValScf,deltaScf;
   Word16 dbgVal = GetBitsAvail(hBitStream);
-  SECTION_INFO* psectioninfo; 
+  SECTION_INFO* psectioninfo;
 
-  lastValScf=scalefac[sectionData->firstScf];                    
+  lastValScf=scalefac[sectionData->firstScf];
 
   for(i=0;i<sectionData->noOfSections;i++){
-    psectioninfo = &(sectionData->sectionInfo[i]); 
+    psectioninfo = &(sectionData->sectionInfo[i]);
     if (psectioninfo->codeBook != CODE_BOOK_ZERO_NO){
       for (j=psectioninfo->sfbStart;
            j<psectioninfo->sfbStart+psectioninfo->sfbCnt; j++){
-         
+
         if(maxValueInSfb[j] == 0) {
-          deltaScf = 0;                                          
+          deltaScf = 0;
         }
         else {
           deltaScf = lastValScf - scalefac[j];
-          lastValScf = scalefac[j];                              
+          lastValScf = scalefac[j];
         }
-         
+
         if(codeScalefactorDelta(deltaScf,hBitStream)){
           return(1);
         }
@@ -227,7 +227,7 @@
 {
   Word16 sfb, sfbOff;
 
-   
+
   switch(msDigest)
   {
     case MS_NONE:
@@ -242,7 +242,7 @@
       WriteBits(hBitStream,SI_MS_MASK_SOME,2);
       for(sfbOff = 0; sfbOff < sfbCnt; sfbOff+=grpSfb) {
         for(sfb=0; sfb<maxSfb; sfb++) {
-             
+
           if(jsFlags[sfbOff+sfb] & MS_ON) {
             WriteBits(hBitStream,1,1);
           }
@@ -272,7 +272,7 @@
   Word16 coefBits;
   Flag isShort;
 
-       
+
   if (blockType==2) {
     isShort = 1;
     numOfWindows = TRANS_FAC;
@@ -282,52 +282,52 @@
     numOfWindows = 1;
   }
 
-  tnsPresent=0;                                                  
+  tnsPresent=0;
   for (i=0; i<numOfWindows; i++) {
-     
+
     if (tnsInfo.tnsActive[i]) {
-      tnsPresent=1;                                              
+      tnsPresent=1;
     }
   }
-   
+
   if (tnsPresent==0) {
     WriteBits(hBitStream,0,1);
   }
   else{ /* there is data to be written*/
     WriteBits(hBitStream,1,1); /*data_present */
     for (i=0; i<numOfWindows; i++) {
-       
+
       WriteBits(hBitStream,tnsInfo.tnsActive[i],(isShort?1:2));
-       
+
       if (tnsInfo.tnsActive[i]) {
-         
+
         WriteBits(hBitStream,((tnsInfo.coefRes[i] - 4)==0?1:0),1);
-         
+
         WriteBits(hBitStream,tnsInfo.length[i],(isShort?4:6));
-         
+
         WriteBits(hBitStream,tnsInfo.order[i],(isShort?3:5));
-         
+
         if (tnsInfo.order[i]){
           WriteBits(hBitStream, FILTER_DIRECTION, 1);
-           
+
           if(tnsInfo.coefRes[i] == 4) {
-            coefBits = 3;                                                
+            coefBits = 3;
             for(k=0; k<tnsInfo.order[i]; k++) {
-                 
+
               if (tnsInfo.coef[i*TNS_MAX_ORDER_SHORT+k] > 3 ||
                   tnsInfo.coef[i*TNS_MAX_ORDER_SHORT+k] < -4) {
-                coefBits = 4;                                            
+                coefBits = 4;
                 break;
               }
             }
           }
           else {
-            coefBits = 2;                                                
+            coefBits = 2;
             for(k=0; k<tnsInfo.order[i]; k++) {
-                 
+
               if (tnsInfo.coef[i*TNS_MAX_ORDER_SHORT+k] > 1 ||
                   tnsInfo.coef[i*TNS_MAX_ORDER_SHORT+k] < -2) {
-                coefBits = 3;                                            
+                coefBits = 3;
                 break;
               }
             }
@@ -335,7 +335,7 @@
           WriteBits(hBitStream, tnsInfo.coefRes[i] - coefBits, 1); /*coef_compres*/
           for (k=0; k<tnsInfo.order[i]; k++ ) {
             static const Word16 rmask[] = {0,1,3,7,15};
-             
+
             WriteBits(hBitStream,tnsInfo.coef[i*TNS_MAX_ORDER_SHORT+k] & rmask[coefBits],coefBits);
           }
         }
@@ -397,7 +397,7 @@
 
   encodeGlobalGain(globalGain, logNorm,scf[sectionData->firstScf], hBitStream);
 
-   
+
   if(!commonWindow) {
     encodeIcsInfo(sectionData->blockType, windowShape, groupingMask, sectionData, hBitStream);
   }
@@ -536,7 +536,7 @@
     Write fill Element(s):
     amount of a fill element can be 7+X*8 Bits, X element of [0..270]
   */
-    
+
   while(totFillBits >= (3+4)) {
     cnt = min(((totFillBits - (3+4)) >> 3), ((1<<4)-1));
 
@@ -545,7 +545,7 @@
 
     totFillBits = totFillBits - (3+4);
 
-     
+
     if ((cnt == (1<<4)-1)) {
 
       esc_count = min( ((totFillBits >> 3) - ((1<<4)-1)), (1<<8)-1);
@@ -555,7 +555,7 @@
     }
 
     for(i=0;i<cnt;i++) {
-       
+
       if(ancBytes)
         WriteBits(hBitStream, *ancBytes++,8);
       else
@@ -576,7 +576,7 @@
                        ELEMENT_INFO elInfo,
                        QC_OUT *qcOut,
                        PSY_OUT *psyOut,
-                       Word16 *globUsedBits,					   
+                       Word16 *globUsedBits,
                        const UWord8 *ancBytes,
 					   Word16 sampindex
                        ) /* returns error code */
@@ -586,7 +586,7 @@
   Word16 frameBits=0;
 
   /*   struct bitbuffer bsWriteCopy; */
-  bitMarkUp = GetBitsAvail(hBitStream); 
+  bitMarkUp = GetBitsAvail(hBitStream);
   if(qcOut->qcElement.adtsUsed)  /*  write adts header*/
   {
 	  WriteBits(hBitStream, 0xFFF, 12); /* 12 bit Syncword */
@@ -601,23 +601,23 @@
 									6 channels or less, else a channel
 									configuration should be written */
 	  WriteBits(hBitStream, 0, 1); /* original/copy */
-	  WriteBits(hBitStream, 0, 1); /* home */	  
-	  
+	  WriteBits(hBitStream, 0, 1); /* home */
+
 	  /* Variable ADTS header */
 	  WriteBits(hBitStream, 0, 1); /* copyr. id. bit */
 	  WriteBits(hBitStream, 0, 1); /* copyr. id. start */
 	  WriteBits(hBitStream, *globUsedBits >> 3, 13);
 	  WriteBits(hBitStream, 0x7FF, 11); /* buffer fullness (0x7FF for VBR) */
-	  WriteBits(hBitStream, 0, 2); /* raw data blocks (0+1=1) */  
+	  WriteBits(hBitStream, 0, 2); /* raw data blocks (0+1=1) */
   }
 
-  *globUsedBits=0;                                               
+  *globUsedBits=0;
 
   {
 
     Word16 *sfbOffset[2];
     TNS_INFO tnsInfo[2];
-    elementUsedBits = 0;                                         
+    elementUsedBits = 0;
 
     switch (elInfo.elType) {
 
@@ -636,7 +636,7 @@
         {
           Word16 msDigest;
           Word16 *msFlags = psyOut->psyOutElement.toolsInfo.msMask;
-          msDigest = psyOut->psyOutElement.toolsInfo.msDigest;                        
+          msDigest = psyOut->psyOutElement.toolsInfo.msDigest;
           sfbOffset[0] =
             psyOut->psyOutChannel[elInfo.ChannelIndex[0]].sfbOffsets;
           sfbOffset[1] =
@@ -668,20 +668,20 @@
   }
 
   writeFillElement(NULL,
-                   qcOut->totFillBits, 
+                   qcOut->totFillBits,
                    hBitStream);
 
   WriteBits(hBitStream,ID_END,3);
 
   /* byte alignement */
-  WriteBits(hBitStream,0, (8 - (hBitStream->cntBits & 7)) & 7);          
-  
+  WriteBits(hBitStream,0, (8 - (hBitStream->cntBits & 7)) & 7);
+
   *globUsedBits = *globUsedBits- bitMarkUp;
-  bitMarkUp = GetBitsAvail(hBitStream);                                  
+  bitMarkUp = GetBitsAvail(hBitStream);
   *globUsedBits = *globUsedBits + bitMarkUp;
   frameBits = frameBits + *globUsedBits;
 
-   
+
   if (frameBits !=  (qcOut->totStaticBitsUsed+qcOut->totDynBitsUsed + qcOut->totAncBitsUsed +
                      qcOut->totFillBits + qcOut->alignBits)) {
     return(-1);
diff --git a/media/libstagefright/codecs/aacenc/src/block_switch.c b/media/libstagefright/codecs/aacenc/src/block_switch.c
index d54e32f..47fd15e 100644
--- a/media/libstagefright/codecs/aacenc/src/block_switch.c
+++ b/media/libstagefright/codecs/aacenc/src/block_switch.c
@@ -52,7 +52,7 @@
   IIR high pass coeffs
 */
 Word32 hiPassCoeff[BLOCK_SWITCHING_IIR_LEN] = {
-  0xbec8b439, 0x609d4952  /* -0.5095f, 0.7548f */ 
+  0xbec8b439, 0x609d4952  /* -0.5095f, 0.7548f */
 };
 
 static const Word32 accWindowNrgFac = 0x26666666;                   /* factor for accumulating filtered window energies 0.3 */
@@ -76,8 +76,8 @@
                           const Word32 bitRate, const Word16 nChannels)
 {
   /* select attackRatio */
-           
-  if ((sub(nChannels,1)==0 && L_sub(bitRate, 24000) > 0) || 
+
+  if ((sub(nChannels,1)==0 && L_sub(bitRate, 24000) > 0) ||
       (sub(nChannels,1)>0 && bitRate > (nChannels * 16000))) {
     blockSwitchingControl->invAttackRatio = invAttackRatioHighBr;
   }
@@ -116,7 +116,7 @@
 
   /* Reset grouping info */
   for (i=0; i<TRANS_FAC; i++) {
-    blockSwitchingControl->groupLen[i] = 0;                                      
+    blockSwitchingControl->groupLen[i] = 0;
   }
 
 
@@ -125,21 +125,21 @@
                                                           &blockSwitchingControl->attackIndex,
                                                           BLOCK_SWITCH_WINDOWS);
 
-  blockSwitchingControl->attackIndex = blockSwitchingControl->lastAttackIndex;   
+  blockSwitchingControl->attackIndex = blockSwitchingControl->lastAttackIndex;
 
   /* Set grouping info */
-  blockSwitchingControl->noOfGroups = MAX_NO_OF_GROUPS;                          
+  blockSwitchingControl->noOfGroups = MAX_NO_OF_GROUPS;
 
   for (i=0; i<MAX_NO_OF_GROUPS; i++) {
-    blockSwitchingControl->groupLen[i] = suggestedGroupingTable[blockSwitchingControl->attackIndex][i];  
+    blockSwitchingControl->groupLen[i] = suggestedGroupingTable[blockSwitchingControl->attackIndex][i];
   }
-	
+
   /* if the samplerate is less than 16000, it should be all the short block, avoid pre&post echo */
   if(sampleRate >= 16000) {
 	  /* Save current window energy as last window energy */
 	  for (w=0; w<BLOCK_SWITCH_WINDOWS; w++) {
-		  blockSwitchingControl->windowNrg[0][w] = blockSwitchingControl->windowNrg[1][w];             
-		  blockSwitchingControl->windowNrgF[0][w] = blockSwitchingControl->windowNrgF[1][w];           
+		  blockSwitchingControl->windowNrg[0][w] = blockSwitchingControl->windowNrg[1][w];
+		  blockSwitchingControl->windowNrgF[0][w] = blockSwitchingControl->windowNrgF[1][w];
 	  }
 
 
@@ -147,10 +147,10 @@
 	  CalcWindowEnergy(blockSwitchingControl, timeSignal, chIncrement, BLOCK_SWITCH_WINDOW_LEN);
 
 	  /* reset attack */
-	  blockSwitchingControl->attack = FALSE;                                         
+	  blockSwitchingControl->attack = FALSE;
 
-	  enMax = 0;                                                                     
-	  enM1 = blockSwitchingControl->windowNrgF[0][BLOCK_SWITCH_WINDOWS-1];           
+	  enMax = 0;
+	  enM1 = blockSwitchingControl->windowNrgF[0][BLOCK_SWITCH_WINDOWS-1];
 
 	  for (w=0; w<BLOCK_SWITCH_WINDOWS; w++) {
 		  Word32 enM1_Tmp, accWindowNrg_Tmp, windowNrgF_Tmp;
@@ -172,15 +172,15 @@
 		  /* if the energy with the ratio is bigger than the average, and the attack and short block  */
 		  if ((fixmul(windowNrgF_Tmp, blockSwitchingControl->invAttackRatio) >> windowNrgF_Shf) >
 			  blockSwitchingControl->accWindowNrg ) {
-				  blockSwitchingControl->attack = TRUE;                                      
-				  blockSwitchingControl->lastAttackIndex = w;                                
+				  blockSwitchingControl->attack = TRUE;
+				  blockSwitchingControl->lastAttackIndex = w;
 		  }
-		  enM1 = blockSwitchingControl->windowNrgF[1][w];                              
+		  enM1 = blockSwitchingControl->windowNrgF[1][w];
 		  enMax = max(enMax, enM1);
 	  }
 
 	  if (enMax < minAttackNrg) {
-		  blockSwitchingControl->attack = FALSE;                                       
+		  blockSwitchingControl->attack = FALSE;
 	  }
   }
   else
@@ -188,22 +188,22 @@
 	  blockSwitchingControl->attack = TRUE;
   }
 
-  /* Check if attack spreads over frame border */     
+  /* Check if attack spreads over frame border */
   if ((!blockSwitchingControl->attack) && (blockSwitchingControl->lastattack)) {
-     
+
     if (blockSwitchingControl->attackIndex == TRANS_FAC-1) {
-      blockSwitchingControl->attack = TRUE;                                      
+      blockSwitchingControl->attack = TRUE;
     }
 
-    blockSwitchingControl->lastattack = FALSE;                                   
+    blockSwitchingControl->lastattack = FALSE;
   }
   else {
-    blockSwitchingControl->lastattack = blockSwitchingControl->attack;           
+    blockSwitchingControl->lastattack = blockSwitchingControl->attack;
   }
 
-  blockSwitchingControl->windowSequence =  blockSwitchingControl->nextwindowSequence;    
+  blockSwitchingControl->windowSequence =  blockSwitchingControl->nextwindowSequence;
 
-     
+
   if (blockSwitchingControl->attack) {
     blockSwitchingControl->nextwindowSequence = SHORT_WINDOW;
   }
@@ -211,27 +211,27 @@
     blockSwitchingControl->nextwindowSequence = LONG_WINDOW;
   }
 
-  /* update short block group */ 
+  /* update short block group */
   if (blockSwitchingControl->nextwindowSequence == SHORT_WINDOW) {
-     
+
     if (blockSwitchingControl->windowSequence== LONG_WINDOW) {
-      blockSwitchingControl->windowSequence = START_WINDOW;                      
+      blockSwitchingControl->windowSequence = START_WINDOW;
     }
-     
+
     if (blockSwitchingControl->windowSequence == STOP_WINDOW) {
-      blockSwitchingControl->windowSequence = SHORT_WINDOW;                      
-      blockSwitchingControl->noOfGroups = 3;                                     
-      blockSwitchingControl->groupLen[0] = 3;                                    
-      blockSwitchingControl->groupLen[1] = 3;                                    
-      blockSwitchingControl->groupLen[2] = 2;                                    
+      blockSwitchingControl->windowSequence = SHORT_WINDOW;
+      blockSwitchingControl->noOfGroups = 3;
+      blockSwitchingControl->groupLen[0] = 3;
+      blockSwitchingControl->groupLen[1] = 3;
+      blockSwitchingControl->groupLen[2] = 2;
     }
   }
 
-  /* update block type */  
+  /* update block type */
   if (blockSwitchingControl->nextwindowSequence == LONG_WINDOW) {
-     
+
     if (blockSwitchingControl->windowSequence == SHORT_WINDOW) {
-      blockSwitchingControl->nextwindowSequence = STOP_WINDOW;                   
+      blockSwitchingControl->nextwindowSequence = STOP_WINDOW;
     }
   }
 
@@ -252,17 +252,17 @@
   Word32 i, idx;
 
   /* Search maximum value in array and return index and value */
-  max = 0;                                                       
-  idx = 0;                                                       
+  max = 0;
+  idx = 0;
 
   for (i = 0; i < n; i++) {
-     
+
     if (in[i+1]  > max) {
-      max = in[i+1];                                             
-      idx = i;                                                   
+      max = in[i+1];
+      idx = i;
     }
   }
-  *index = idx;                                                  
+  *index = idx;
 
   return(max);
 }
@@ -292,11 +292,11 @@
   states1 = blockSwitchingControl->iirStates[1];
   Coeff0 = hiPassCoeff[0];
   Coeff1 = hiPassCoeff[1];
-  tidx = 0;                                                   
+  tidx = 0;
   for (w=0; w < BLOCK_SWITCH_WINDOWS; w++) {
 
-    accuUE = 0;                                                  
-    accuFE = 0;                                                  
+    accuUE = 0;
+    accuFE = 0;
 
     for(i=0; i<windowLen; i++) {
 	  Word32 accu1, accu2, accu3;
@@ -309,16 +309,16 @@
 	  accu3 = accu1 - states0;
 	  out = accu3 - accu2;
 
-	  states0 = accu1;             
-	  states1 = out;               
+	  states0 = accu1;
+	  states1 = out;
 
-      tempFiltered = extract_h(out);	  
+      tempFiltered = extract_h(out);
       accuUE += (tempUnfiltered * tempUnfiltered) >> ENERGY_SHIFT;
       accuFE += (tempFiltered * tempFiltered) >> ENERGY_SHIFT;
     }
 
-    blockSwitchingControl->windowNrg[1][w] = accuUE;             
-    blockSwitchingControl->windowNrgF[1][w] = accuFE;            
+    blockSwitchingControl->windowNrg[1][w] = accuUE;
+    blockSwitchingControl->windowNrgF[1][w] = accuFE;
 
   }
 
@@ -346,8 +346,8 @@
   accu2 = fixmul( coeff[0], states[1] );
   out = accu3 - accu2;
 
-  states[0] = accu1;             
-  states[1] = out;               
+  states[0] = accu1;
+  states[1] = out;
 
   return round16(out);
 }
@@ -374,54 +374,54 @@
                           const Word16 nChannels)
 {
   Word16 i;
-  Word16 patchType = LONG_WINDOW;                
+  Word16 patchType = LONG_WINDOW;
 
-   
+
   if (nChannels == 1) { /* Mono */
     if (blockSwitchingControlLeft->windowSequence != SHORT_WINDOW) {
-      blockSwitchingControlLeft->noOfGroups = 1;                         
-      blockSwitchingControlLeft->groupLen[0] = 1;                        
+      blockSwitchingControlLeft->noOfGroups = 1;
+      blockSwitchingControlLeft->groupLen[0] = 1;
 
       for (i=1; i<TRANS_FAC; i++) {
-        blockSwitchingControlLeft->groupLen[i] = 0;                      
+        blockSwitchingControlLeft->groupLen[i] = 0;
       }
     }
   }
   else { /* Stereo common Window */
-    patchType = synchronizedBlockTypeTable[patchType][blockSwitchingControlLeft->windowSequence];        
-    patchType = synchronizedBlockTypeTable[patchType][blockSwitchingControlRight->windowSequence];       
+    patchType = synchronizedBlockTypeTable[patchType][blockSwitchingControlLeft->windowSequence];
+    patchType = synchronizedBlockTypeTable[patchType][blockSwitchingControlRight->windowSequence];
 
     /* Set synchronized Blocktype */
-    blockSwitchingControlLeft->windowSequence = patchType;               
-    blockSwitchingControlRight->windowSequence = patchType;              
+    blockSwitchingControlLeft->windowSequence = patchType;
+    blockSwitchingControlRight->windowSequence = patchType;
 
-    /* Synchronize grouping info */     
+    /* Synchronize grouping info */
     if(patchType != SHORT_WINDOW) { /* Long Blocks */
       /* Set grouping info */
-      blockSwitchingControlLeft->noOfGroups = 1;                         
-      blockSwitchingControlRight->noOfGroups = 1;                        
-      blockSwitchingControlLeft->groupLen[0] = 1;                        
-      blockSwitchingControlRight->groupLen[0] = 1;                       
+      blockSwitchingControlLeft->noOfGroups = 1;
+      blockSwitchingControlRight->noOfGroups = 1;
+      blockSwitchingControlLeft->groupLen[0] = 1;
+      blockSwitchingControlRight->groupLen[0] = 1;
 
       for (i=1; i<TRANS_FAC; i++) {
-        blockSwitchingControlLeft->groupLen[i] = 0;                      
-        blockSwitchingControlRight->groupLen[i] = 0;                     
+        blockSwitchingControlLeft->groupLen[i] = 0;
+        blockSwitchingControlRight->groupLen[i] = 0;
       }
     }
     else {
-       
+
       if (blockSwitchingControlLeft->maxWindowNrg > blockSwitchingControlRight->maxWindowNrg) {
         /* Left Channel wins */
-        blockSwitchingControlRight->noOfGroups = blockSwitchingControlLeft->noOfGroups;          
+        blockSwitchingControlRight->noOfGroups = blockSwitchingControlLeft->noOfGroups;
         for (i=0; i<TRANS_FAC; i++) {
-          blockSwitchingControlRight->groupLen[i] = blockSwitchingControlLeft->groupLen[i];      
+          blockSwitchingControlRight->groupLen[i] = blockSwitchingControlLeft->groupLen[i];
         }
       }
       else {
         /* Right Channel wins */
-        blockSwitchingControlLeft->noOfGroups = blockSwitchingControlRight->noOfGroups;          
+        blockSwitchingControlLeft->noOfGroups = blockSwitchingControlRight->noOfGroups;
         for (i=0; i<TRANS_FAC; i++) {
-          blockSwitchingControlLeft->groupLen[i] = blockSwitchingControlRight->groupLen[i];      
+          blockSwitchingControlLeft->groupLen[i] = blockSwitchingControlRight->groupLen[i];
         }
       }
     }
diff --git a/media/libstagefright/codecs/aacenc/src/channel_map.c b/media/libstagefright/codecs/aacenc/src/channel_map.c
index 2d41f8c..f6552ed 100644
--- a/media/libstagefright/codecs/aacenc/src/channel_map.c
+++ b/media/libstagefright/codecs/aacenc/src/channel_map.c
@@ -29,32 +29,32 @@
 
 static Word16 initElement(ELEMENT_INFO* elInfo, ELEMENT_TYPE elType)
 {
-  Word16 error=0;                                    
+  Word16 error=0;
 
-  elInfo->elType=elType;                             
+  elInfo->elType=elType;
 
   switch(elInfo->elType) {
 
     case ID_SCE:
-      elInfo->nChannelsInEl=1;                       
+      elInfo->nChannelsInEl=1;
 
-      elInfo->ChannelIndex[0]=0;                     
+      elInfo->ChannelIndex[0]=0;
 
-      elInfo->instanceTag=0;                         
+      elInfo->instanceTag=0;
       break;
 
     case ID_CPE:
 
-      elInfo->nChannelsInEl=2;                        
+      elInfo->nChannelsInEl=2;
 
-      elInfo->ChannelIndex[0]=0;                      
-      elInfo->ChannelIndex[1]=1;                      
+      elInfo->ChannelIndex[0]=0;
+      elInfo->ChannelIndex[1]=1;
 
-      elInfo->instanceTag=0;                    
+      elInfo->instanceTag=0;
       break;
 
     default:
-      error=1;                                  
+      error=1;
   }
 
   return error;
@@ -64,11 +64,11 @@
 Word16 InitElementInfo (Word16 nChannels, ELEMENT_INFO* elInfo)
 {
   Word16 error;
-  error = 0;                                        
+  error = 0;
 
   switch(nChannels) {
 
-    case 1: 
+    case 1:
       initElement(elInfo, ID_SCE);
       break;
 
@@ -77,7 +77,7 @@
       break;
 
     default:
-      error=4;                                         
+      error=4;
   }
 
   return error;
@@ -91,18 +91,18 @@
                        Word16 staticBitsTot)
 {
   Word16 error;
-  error = 0;                                    
+  error = 0;
 
    switch(elInfo.nChannelsInEl) {
     case 1:
-      elementBits->chBitrate = bitrateTot;                     
+      elementBits->chBitrate = bitrateTot;
       elementBits->averageBits = averageBitsTot - staticBitsTot;
-      elementBits->maxBits = maxChannelBits;                   
+      elementBits->maxBits = maxChannelBits;
 
       elementBits->maxBitResBits = maxChannelBits - averageBitsTot;
-      elementBits->maxBitResBits = elementBits->maxBitResBits - (elementBits->maxBitResBits & 7); 
-      elementBits->bitResLevel = elementBits->maxBitResBits;   
-      elementBits->relativeBits  = 0x4000; /* 1.0f/2 */        
+      elementBits->maxBitResBits = elementBits->maxBitResBits - (elementBits->maxBitResBits & 7);
+      elementBits->bitResLevel = elementBits->maxBitResBits;
+      elementBits->relativeBits  = 0x4000; /* 1.0f/2 */
       break;
 
     case 2:
@@ -111,13 +111,13 @@
       elementBits->maxBits     = maxChannelBits << 1;
 
       elementBits->maxBitResBits = (maxChannelBits << 1) - averageBitsTot;
-      elementBits->maxBitResBits = elementBits->maxBitResBits - (elementBits->maxBitResBits & 7);   
-      elementBits->bitResLevel = elementBits->maxBitResBits;     
-      elementBits->relativeBits = 0x4000; /* 1.0f/2 */           
+      elementBits->maxBitResBits = elementBits->maxBitResBits - (elementBits->maxBitResBits & 7);
+      elementBits->bitResLevel = elementBits->maxBitResBits;
+      elementBits->relativeBits = 0x4000; /* 1.0f/2 */
       break;
 
     default:
-      error = 1;                                                 
+      error = 1;
   }
   return error;
 }
diff --git a/media/libstagefright/codecs/aacenc/src/dyn_bits.c b/media/libstagefright/codecs/aacenc/src/dyn_bits.c
index f3b3e02..3d2efdc 100644
--- a/media/libstagefright/codecs/aacenc/src/dyn_bits.c
+++ b/media/libstagefright/codecs/aacenc/src/dyn_bits.c
@@ -45,12 +45,12 @@
   for (i=0; i<maxSfb; i++) {
     Word16 sfbWidth, maxVal;
 
-    sectionInfo[i].sfbCnt = 1;                                   
-    sectionInfo[i].sfbStart = i;                                 
-    sectionInfo[i].sectionBits = INVALID_BITCOUNT;               
-    sectionInfo[i].codeBook = -1;                                
-    sfbWidth = sfbOffset[i + 1] - sfbOffset[i];              
-    maxVal = sfbMax[i];                                          
+    sectionInfo[i].sfbCnt = 1;
+    sectionInfo[i].sfbStart = i;
+    sectionInfo[i].sectionBits = INVALID_BITCOUNT;
+    sectionInfo[i].codeBook = -1;
+    sfbWidth = sfbOffset[i + 1] - sfbOffset[i];
+    maxVal = sfbMax[i];
     bitCount(quantSpectrum + sfbOffset[i], sfbWidth, maxVal, bitLookUp[i]);
   }
 }
@@ -66,13 +66,13 @@
 findBestBook(const Word16 *bc, Word16 *book)
 {
   Word32 minBits, j;
-  minBits = INVALID_BITCOUNT;                                    
+  minBits = INVALID_BITCOUNT;
 
   for (j=0; j<=CODE_BOOK_ESC_NDX; j++) {
-     
+
     if (bc[j] < minBits) {
-      minBits = bc[j];                                           
-      *book = j;                                                 
+      minBits = bc[j];
+      *book = j;
     }
   }
   return extract_l(minBits);
@@ -82,12 +82,12 @@
 findMinMergeBits(const Word16 *bc1, const Word16 *bc2)
 {
   Word32 minBits, j, sum;
-  minBits = INVALID_BITCOUNT;                                    
+  minBits = INVALID_BITCOUNT;
 
   for (j=0; j<=CODE_BOOK_ESC_NDX; j++) {
     sum = bc1[j] + bc2[j];
     if (sum < minBits) {
-      minBits = sum;                                             
+      minBits = sum;
     }
   }
   return extract_l(minBits);
@@ -109,13 +109,13 @@
              const Word16 maxSfb, Word16 *maxNdx)
 {
   Word32 i, maxMergeGain;
-  maxMergeGain = 0;                                              
+  maxMergeGain = 0;
 
   for (i=0; i+sectionInfo[i].sfbCnt < maxSfb; i += sectionInfo[i].sfbCnt) {
-     
+
     if (mergeGainLookUp[i] > maxMergeGain) {
-      maxMergeGain = mergeGainLookUp[i];                         
-      *maxNdx = i;                                               
+      maxMergeGain = mergeGainLookUp[i];
+      *maxNdx = i;
     }
   }
   return extract_l(maxMergeGain);
@@ -159,7 +159,7 @@
 
   for (i=0; i<maxSfb; i++) {
     /* Side-Info bits will be calculated in Stage 1!  */
-     
+
     if (sectionInfo[i].sectionBits == INVALID_BITCOUNT) {
       sectionInfo[i].sectionBits = findBestBook(bitLookUp[i], &(sectionInfo[i].codeBook));
     }
@@ -180,13 +180,13 @@
   SECTION_INFO * sectionInfo_s;
   SECTION_INFO * sectionInfo_e;
   Word32 mergeStart, mergeEnd;
-  mergeStart = 0;                                                        
+  mergeStart = 0;
 
   do {
 
     sectionInfo_s = sectionInfo + mergeStart;
 	for (mergeEnd=mergeStart+1; mergeEnd<maxSfb; mergeEnd++) {
-      sectionInfo_e = sectionInfo + mergeEnd; 
+      sectionInfo_e = sectionInfo + mergeEnd;
       if (sectionInfo_s->codeBook != sectionInfo_e->codeBook)
         break;
       sectionInfo_s->sfbCnt += 1;
@@ -196,11 +196,11 @@
     }
 
     sectionInfo_s->sectionBits += sideInfoTab[sectionInfo_s->sfbCnt];
-    sectionInfo[mergeEnd - 1].sfbStart = sectionInfo_s->sfbStart;      /* speed up prev search */  
+    sectionInfo[mergeEnd - 1].sfbStart = sectionInfo_s->sfbStart;      /* speed up prev search */
 
-    mergeStart = mergeEnd;                                               
+    mergeStart = mergeEnd;
 
-     
+
   } while (mergeStart - maxSfb < 0);
 }
 
@@ -230,7 +230,7 @@
 
     maxMergeGain = findMaxMerge(mergeGainLookUp, sectionInfo, maxSfb, &maxNdx);
 
-     
+
     if (maxMergeGain <= 0)
       break;
 
@@ -244,7 +244,7 @@
 
     mergeBitLookUp(bitLookUp[maxNdx], bitLookUp[maxNdxNext]);
 
-     
+
     if (maxNdx != 0) {
       maxNdxLast = sectionInfo[maxNdx - 1].sfbStart;
       mergeGainLookUp[maxNdxLast] = CalcMergeGain(sectionInfo,
@@ -255,9 +255,9 @@
     }
     maxNdxNext = maxNdx + sectionInfo[maxNdx].sfbCnt;
 
-    sectionInfo[maxNdxNext - 1].sfbStart = sectionInfo[maxNdx].sfbStart;             
+    sectionInfo[maxNdxNext - 1].sfbStart = sectionInfo[maxNdx].sfbStart;
 
-     
+
     if (maxNdxNext - maxSfb < 0) {
       mergeGainLookUp[maxNdx] = CalcMergeGain(sectionInfo,
                                               bitLookUp,
@@ -286,7 +286,7 @@
 
   /*
     use appropriate side info table
-  */   
+  */
   switch (blockType)
   {
     case LONG_WINDOW:
@@ -300,11 +300,11 @@
   }
 
 
-  sectionData->noOfSections = 0;                                         
-  sectionData->huffmanBits = 0;                                          
-  sectionData->sideInfoBits = 0;                                         
+  sectionData->noOfSections = 0;
+  sectionData->huffmanBits = 0;
+  sectionData->sideInfoBits = 0;
 
-   
+
   if (sectionData->maxSfbPerGroup == 0)
     return;
 
@@ -353,7 +353,7 @@
       sectionData->huffmanBits = (sectionData->huffmanBits +
                                      (sectionInfo[i].sectionBits - sideInfoTab[sectionInfo[i].sfbCnt]));
       sectionData->sideInfoBits = (sectionData->sideInfoBits + sideInfoTab[sectionInfo[i].sfbCnt]);
-      sectionData->sectionInfo[sectionData->noOfSections] = sectionInfo[i];             
+      sectionData->sectionInfo[sectionData->noOfSections] = sectionInfo[i];
       sectionData->noOfSections = sectionData->noOfSections + 1;
     }
   }
@@ -386,25 +386,25 @@
   Word32 lastValScf     = 0;
   Word32 deltaScf       = 0;
   Flag found            = 0;
-  Word32 scfSkipCounter = 0;           
-         
+  Word32 scfSkipCounter = 0;
 
-  sectionData->scalefacBits = 0;                                 
 
-   
+  sectionData->scalefacBits = 0;
+
+
   if (scalefacGain == NULL) {
     return;
   }
 
-  lastValScf = 0;                                                
-  sectionData->firstScf = 0;        
-  
+  lastValScf = 0;
+  sectionData->firstScf = 0;
+
   psectionInfo = sectionData->sectionInfo;
   for (i=0; i<sectionData->noOfSections; i++) {
-     
+
     if (psectionInfo->codeBook != CODE_BOOK_ZERO_NO) {
-      sectionData->firstScf = psectionInfo->sfbStart;      
-      lastValScf = scalefacGain[sectionData->firstScf];                  
+      sectionData->firstScf = psectionInfo->sfbStart;
+      lastValScf = scalefacGain[sectionData->firstScf];
       break;
     }
 	psectionInfo += 1;
@@ -412,38 +412,38 @@
 
   psectionInfo = sectionData->sectionInfo;
   for (i=0; i<sectionData->noOfSections; i++, psectionInfo += 1) {
-       
+
     if (psectionInfo->codeBook != CODE_BOOK_ZERO_NO
         && psectionInfo->codeBook != CODE_BOOK_PNS_NO) {
       for (j = psectionInfo->sfbStart;
            j < (psectionInfo->sfbStart + psectionInfo->sfbCnt); j++) {
         /* check if we can repeat the last value to save bits */
-         
+
         if (maxValueInSfb[j] == 0) {
-          found = 0;                                                     
-           
+          found = 0;
+
           if (scfSkipCounter == 0) {
             /* end of section */
-             
+
             if (j - ((psectionInfo->sfbStart + psectionInfo->sfbCnt) - 1) == 0) {
-              found = 0;                                                 
+              found = 0;
             }
             else {
               for (k = j + 1; k < psectionInfo->sfbStart + psectionInfo->sfbCnt; k++) {
-                 
+
                 if (maxValueInSfb[k] != 0) {
                   int tmp = L_abs(scalefacGain[k] - lastValScf);
-				  found = 1;                                             
-                   
+				  found = 1;
+
                   if ( tmp < CODE_BOOK_SCF_LAV) {
                     /* save bits */
-                    deltaScf = 0;                                        
+                    deltaScf = 0;
                   }
                   else {
                     /* do not save bits */
                     deltaScf = lastValScf - scalefacGain[j];
-                    lastValScf = scalefacGain[j];                        
-                    scfSkipCounter = 0;                                  
+                    lastValScf = scalefacGain[j];
+                    scfSkipCounter = 0;
                   }
                   break;
                 }
@@ -451,26 +451,26 @@
                 scfSkipCounter = scfSkipCounter + 1;
               }
             }
-			
+
 			psectionInfom = psectionInfo + 1;
             /* search for the next maxValueInSfb[] != 0 in all other sections */
             for (m = i + 1; (m < sectionData->noOfSections) && (found == 0); m++) {
-                 
+
               if ((psectionInfom->codeBook != CODE_BOOK_ZERO_NO) &&
                   (psectionInfom->codeBook != CODE_BOOK_PNS_NO)) {
                 for (n = psectionInfom->sfbStart;
                      n < (psectionInfom->sfbStart + psectionInfom->sfbCnt); n++) {
-                   
+
                   if (maxValueInSfb[n] != 0) {
-                    found = 1;                                           
-                     
+                    found = 1;
+
                     if ( (abs_s(scalefacGain[n] - lastValScf) < CODE_BOOK_SCF_LAV)) {
-                      deltaScf = 0;                                      
+                      deltaScf = 0;
                     }
                     else {
                       deltaScf = (lastValScf - scalefacGain[j]);
-                      lastValScf = scalefacGain[j];                      
-                      scfSkipCounter = 0;                                
+                      lastValScf = scalefacGain[j];
+                      scfSkipCounter = 0;
                     }
                     break;
                   }
@@ -481,20 +481,20 @@
 
 			  psectionInfom += 1;
             }
-             
+
             if (found == 0) {
-              deltaScf = 0;                                              
-              scfSkipCounter = 0;                                        
+              deltaScf = 0;
+              scfSkipCounter = 0;
             }
           }
           else {
-            deltaScf = 0;                                                
+            deltaScf = 0;
             scfSkipCounter = scfSkipCounter - 1;
           }
         }
         else {
           deltaScf = lastValScf - scalefacGain[j];
-          lastValScf = scalefacGain[j];                                  
+          lastValScf = scalefacGain[j];
         }
         sectionData->scalefacBits += bitCountScalefactorDelta(deltaScf);
       }
@@ -517,14 +517,14 @@
             const Word16  *sfbOffset,
             SECTION_DATA  *sectionData)
 {
-  sectionData->blockType      = blockType;                       
-  sectionData->sfbCnt         = sfbCnt;                          
-  sectionData->sfbPerGroup    = sfbPerGroup;           
+  sectionData->blockType      = blockType;
+  sectionData->sfbCnt         = sfbCnt;
+  sectionData->sfbPerGroup    = sfbPerGroup;
   if(sfbPerGroup)
-	sectionData->noOfGroups   = sfbCnt/sfbPerGroup; 
+	sectionData->noOfGroups   = sfbCnt/sfbPerGroup;
   else
 	sectionData->noOfGroups   = 0x7fff;
-  sectionData->maxSfbPerGroup = maxSfbPerGroup;                  
+  sectionData->maxSfbPerGroup = maxSfbPerGroup;
 
   noiselessCounter(sectionData,
                    sectionData->mergeGainLookUp,
@@ -539,7 +539,7 @@
            sectionData);
 
 
-  return (sectionData->huffmanBits + sectionData->sideInfoBits + 
+  return (sectionData->huffmanBits + sectionData->sideInfoBits +
 	      sectionData->scalefacBits);
 }
 
diff --git a/media/libstagefright/codecs/aacenc/src/grp_data.c b/media/libstagefright/codecs/aacenc/src/grp_data.c
index fb88654..7861e1c 100644
--- a/media/libstagefright/codecs/aacenc/src/grp_data.c
+++ b/media/libstagefright/codecs/aacenc/src/grp_data.c
@@ -57,29 +57,29 @@
 
   /* for short: regroup and  */
   /* cumulate energies und thresholds group-wise . */
-  
+
   /* calculate sfbCnt */
-  highestSfb = 0;                                        
+  highestSfb = 0;
   for (wnd=0; wnd<TRANS_FAC; wnd++) {
     for (sfb=sfbCnt - 1; sfb>=highestSfb; sfb--) {
       for (line=(sfbOffset[sfb + 1] - 1); line>=sfbOffset[sfb]; line--) {
-        
-        if (mdctSpectrum[wnd*FRAME_LEN_SHORT+line] != 0) break; 
+
+        if (mdctSpectrum[wnd*FRAME_LEN_SHORT+line] != 0) break;
       }
-      
+
       if (line >= sfbOffset[sfb]) break;
     }
     highestSfb = max(highestSfb, sfb);
   }
-  
+
   if (highestSfb < 0) {
-    highestSfb = 0;                                      
+    highestSfb = 0;
   }
   *maxSfbPerGroup = highestSfb + 1;
 
   /* calculate sfbOffset */
-  i = 0;                                                 
-  offset = 0;                                            
+  i = 0;
+  offset = 0;
   for (grp = 0; grp < noOfGroups; grp++) {
     for (sfb = 0; sfb < sfbCnt; sfb++) {
       groupedSfbOffset[i] = offset + sfbOffset[sfb] * groupLen[grp];
@@ -87,15 +87,15 @@
     }
     offset += groupLen[grp] * FRAME_LEN_SHORT;
   }
-  groupedSfbOffset[i] = FRAME_LEN_LONG;                  
+  groupedSfbOffset[i] = FRAME_LEN_LONG;
   i += 1;
 
   /* calculate minSnr */
-  i = 0;                                                 
-  offset = 0;                                            
+  i = 0;
+  offset = 0;
   for (grp = 0; grp < noOfGroups; grp++) {
     for (sfb = 0; sfb < sfbCnt; sfb++) {
-      groupedSfbMinSnr[i] = sfbMinSnr[sfb];              
+      groupedSfbMinSnr[i] = sfbMinSnr[sfb];
       i += 1;
     }
     offset += groupLen[grp] * FRAME_LEN_SHORT;
@@ -103,74 +103,74 @@
 
 
   /* sum up sfbThresholds */
-  wnd = 0;                                                       
-  i = 0;                                                         
+  wnd = 0;
+  i = 0;
   for (grp = 0; grp < noOfGroups; grp++) {
     for (sfb = 0; sfb < sfbCnt; sfb++) {
-      Word32 thresh = sfbThreshold->sfbShort[wnd][sfb];          
+      Word32 thresh = sfbThreshold->sfbShort[wnd][sfb];
       for (j=1; j<groupLen[grp]; j++) {
         thresh = L_add(thresh, sfbThreshold->sfbShort[wnd+j][sfb]);
       }
-      sfbThreshold->sfbLong[i] = thresh;                         
+      sfbThreshold->sfbLong[i] = thresh;
       i += 1;
     }
     wnd += groupLen[grp];
   }
 
   /* sum up sfbEnergies left/right */
-  wnd = 0;                                                       
-  i = 0;                                                         
+  wnd = 0;
+  i = 0;
   for (grp = 0; grp < noOfGroups; grp++) {
     for (sfb = 0; sfb < sfbCnt; sfb++) {
-      Word32 energy = sfbEnergy->sfbShort[wnd][sfb];             
+      Word32 energy = sfbEnergy->sfbShort[wnd][sfb];
       for (j=1; j<groupLen[grp]; j++) {
         energy = L_add(energy, sfbEnergy->sfbShort[wnd+j][sfb]);
       }
-      sfbEnergy->sfbLong[i] = energy;                            
+      sfbEnergy->sfbLong[i] = energy;
       i += 1;
     }
     wnd += groupLen[grp];
   }
 
   /* sum up sfbEnergies mid/side */
-  wnd = 0;                                                       
-  i = 0;                                                         
+  wnd = 0;
+  i = 0;
   for (grp = 0; grp < noOfGroups; grp++) {
     for (sfb = 0; sfb < sfbCnt; sfb++) {
-      Word32 energy = sfbEnergyMS->sfbShort[wnd][sfb];           
+      Word32 energy = sfbEnergyMS->sfbShort[wnd][sfb];
       for (j=1; j<groupLen[grp]; j++) {
         energy = L_add(energy, sfbEnergyMS->sfbShort[wnd+j][sfb]);
       }
-      sfbEnergyMS->sfbLong[i] = energy;                          
+      sfbEnergyMS->sfbLong[i] = energy;
       i += 1;
     }
     wnd += groupLen[grp];
   }
 
   /* sum up sfbSpreadedEnergies */
-  wnd = 0;                                                       
-  i = 0;                                                         
+  wnd = 0;
+  i = 0;
   for (grp = 0; grp < noOfGroups; grp++) {
     for (sfb = 0; sfb < sfbCnt; sfb++) {
-      Word32 energy = sfbSpreadedEnergy->sfbShort[wnd][sfb];     
+      Word32 energy = sfbSpreadedEnergy->sfbShort[wnd][sfb];
       for (j=1; j<groupLen[grp]; j++) {
         energy = L_add(energy, sfbSpreadedEnergy->sfbShort[wnd+j][sfb]);
       }
-      sfbSpreadedEnergy->sfbLong[i] = energy;                    
+      sfbSpreadedEnergy->sfbLong[i] = energy;
       i += 1;
     }
     wnd += groupLen[grp];
   }
 
   /* re-group spectrum */
-  wnd = 0;                                                       
-  i = 0;                                                         
+  wnd = 0;
+  i = 0;
   for (grp = 0; grp < noOfGroups; grp++) {
     for (sfb = 0; sfb < sfbCnt; sfb++) {
       for (j = 0; j < groupLen[grp]; j++) {
         Word16 lineOffset = FRAME_LEN_SHORT * (wnd + j);
         for (line = lineOffset + sfbOffset[sfb]; line < lineOffset + sfbOffset[sfb+1]; line++) {
-          tmpSpectrum[i] = mdctSpectrum[line];                   
+          tmpSpectrum[i] = mdctSpectrum[line];
           i = i + 1;
         }
       }
@@ -179,10 +179,10 @@
   }
 
   for(i=0;i<FRAME_LEN_LONG;i+=4) {
-    mdctSpectrum[i] = tmpSpectrum[i];  
-	mdctSpectrum[i+1] = tmpSpectrum[i+1];  
-	mdctSpectrum[i+2] = tmpSpectrum[i+2];  
-	mdctSpectrum[i+3] = tmpSpectrum[i+3];  	
+    mdctSpectrum[i] = tmpSpectrum[i];
+	mdctSpectrum[i+1] = tmpSpectrum[i+1];
+	mdctSpectrum[i+2] = tmpSpectrum[i+2];
+	mdctSpectrum[i+3] = tmpSpectrum[i+3];
   }
 }
 
diff --git a/media/libstagefright/codecs/aacenc/src/interface.c b/media/libstagefright/codecs/aacenc/src/interface.c
index 34fee00..f2472d8 100644
--- a/media/libstagefright/codecs/aacenc/src/interface.c
+++ b/media/libstagefright/codecs/aacenc/src/interface.c
@@ -49,56 +49,56 @@
                     PSY_OUT_CHANNEL         *psyOutCh)
 {
   Word32 j;
-  Word32 grp; 
+  Word32 grp;
   Word32 mask;
   Word16 *tmpV;
 
   /*
   copy values to psyOut
   */
-  psyOutCh->maxSfbPerGroup    = maxSfbPerGroup;                             
-  psyOutCh->sfbCnt            = groupedSfbCnt;   
+  psyOutCh->maxSfbPerGroup    = maxSfbPerGroup;
+  psyOutCh->sfbCnt            = groupedSfbCnt;
   if(noOfGroups)
 	psyOutCh->sfbPerGroup     = groupedSfbCnt/ noOfGroups;
   else
 	psyOutCh->sfbPerGroup     = 0x7fff;
-  psyOutCh->windowSequence    = windowSequence;                             
-  psyOutCh->windowShape       = windowShape;                                
-  psyOutCh->mdctScale         = mdctScale;                                  
+  psyOutCh->windowSequence    = windowSequence;
+  psyOutCh->windowShape       = windowShape;
+  psyOutCh->mdctScale         = mdctScale;
   psyOutCh->mdctSpectrum      = groupedMdctSpectrum;
   psyOutCh->sfbEnergy         = groupedSfbEnergy->sfbLong;
   psyOutCh->sfbThreshold      = groupedSfbThreshold->sfbLong;
   psyOutCh->sfbSpreadedEnergy = groupedSfbSpreadedEnergy->sfbLong;
-  
+
   tmpV = psyOutCh->sfbOffsets;
   for(j=0; j<groupedSfbCnt + 1; j++) {
       *tmpV++ = groupedSfbOffset[j];
   }
-  
+
   tmpV = psyOutCh->sfbMinSnr;
   for(j=0;j<groupedSfbCnt; j++) {
 	  *tmpV++ =   groupedSfbMinSnr[j];
   }
-  
+
   /* generate grouping mask */
-  mask = 0;                                                                      
+  mask = 0;
   for (grp = 0; grp < noOfGroups; grp++) {
     mask = mask << 1;
     for (j=1; j<groupLen[grp]; j++) {
       mask = mask << 1;
-      mask |= 1;                                                                 
+      mask |= 1;
     }
   }
-  psyOutCh->groupingMask = mask; 
-  
+  psyOutCh->groupingMask = mask;
+
   if (windowSequence != SHORT_WINDOW) {
-    psyOutCh->sfbEnSumLR =  sfbEnergySumLR.sfbLong;                              
-    psyOutCh->sfbEnSumMS =  sfbEnergySumMS.sfbLong;                              
+    psyOutCh->sfbEnSumLR =  sfbEnergySumLR.sfbLong;
+    psyOutCh->sfbEnSumMS =  sfbEnergySumMS.sfbLong;
   }
   else {
     Word32 i;
     Word32 accuSumMS=0;
-    Word32 accuSumLR=0;        
+    Word32 accuSumLR=0;
 	Word32 *pSumMS = sfbEnergySumMS.sfbShort;
 	Word32 *pSumLR = sfbEnergySumLR.sfbShort;
 
@@ -106,7 +106,7 @@
       accuSumLR = L_add(accuSumLR, *pSumLR); pSumLR++;
       accuSumMS = L_add(accuSumMS, *pSumMS); pSumMS++;
     }
-    psyOutCh->sfbEnSumMS = accuSumMS;                                            
-    psyOutCh->sfbEnSumLR = accuSumLR;                                            
+    psyOutCh->sfbEnSumMS = accuSumMS;
+    psyOutCh->sfbEnSumLR = accuSumLR;
   }
 }
diff --git a/media/libstagefright/codecs/aacenc/src/line_pe.c b/media/libstagefright/codecs/aacenc/src/line_pe.c
index 5e93cd0..480dc28 100644
--- a/media/libstagefright/codecs/aacenc/src/line_pe.c
+++ b/media/libstagefright/codecs/aacenc/src/line_pe.c
@@ -45,20 +45,20 @@
                   const Word16 peOffset)
 {
   Word32 sfbGrp, sfb;
-  Word32 ch;     
+  Word32 ch;
 
   for(ch=0; ch<nChannels; ch++) {
     PSY_OUT_CHANNEL *psyOutChan = &psyOutChannel[ch];
     PE_CHANNEL_DATA *peChanData=&peData->peChannelData[ch];
     for(sfbGrp=0;sfbGrp<psyOutChan->sfbCnt; sfbGrp+=psyOutChan->sfbPerGroup){
       for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
-	    peChanData->sfbNLines4[sfbGrp+sfb] = sfbNRelevantLines[ch][sfbGrp+sfb];          
-        sfbNRelevantLines[ch][sfbGrp+sfb] = sfbNRelevantLines[ch][sfbGrp+sfb] >> 2;    
-	    peChanData->sfbLdEnergy[sfbGrp+sfb] = logSfbEnergy[ch][sfbGrp+sfb];              
+	    peChanData->sfbNLines4[sfbGrp+sfb] = sfbNRelevantLines[ch][sfbGrp+sfb];
+        sfbNRelevantLines[ch][sfbGrp+sfb] = sfbNRelevantLines[ch][sfbGrp+sfb] >> 2;
+	    peChanData->sfbLdEnergy[sfbGrp+sfb] = logSfbEnergy[ch][sfbGrp+sfb];
       }
     }
   }
-  peData->offset = peOffset;                                                             
+  peData->offset = peOffset;
 }
 
 
@@ -78,23 +78,23 @@
   Word32 ldThr, ldRatio;
   Word32 pe, constPart, nActiveLines;
 
-  peData->pe = peData->offset;                                           
-  peData->constPart = 0;                                                 
-  peData->nActiveLines = 0;                                              
+  peData->pe = peData->offset;
+  peData->constPart = 0;
+  peData->nActiveLines = 0;
   for(ch=0; ch<nChannels; ch++) {
     PSY_OUT_CHANNEL *psyOutChan = &psyOutChannel[ch];
     PE_CHANNEL_DATA *peChanData = &peData->peChannelData[ch];
     const Word32 *sfbEnergy = psyOutChan->sfbEnergy;
     const Word32 *sfbThreshold = psyOutChan->sfbThreshold;
 
-    pe = 0;                                                  
-    constPart = 0;                                           
-    nActiveLines = 0;                                        
+    pe = 0;
+    constPart = 0;
+    nActiveLines = 0;
 
     for(sfbGrp=0; sfbGrp<psyOutChan->sfbCnt; sfbGrp+=psyOutChan->sfbPerGroup) {
       for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
-        Word32 nrg = sfbEnergy[sfbGrp+sfb];                             
-        Word32 thres = sfbThreshold[sfbGrp+sfb];                           
+        Word32 nrg = sfbEnergy[sfbGrp+sfb];
+        Word32 thres = sfbThreshold[sfbGrp+sfb];
         Word32 sfbLDEn = peChanData->sfbLdEnergy[sfbGrp+sfb];
 
         if (nrg > thres) {
@@ -102,8 +102,8 @@
 
           ldRatio = sfbLDEn - ldThr;
 
-          nLines4 = peChanData->sfbNLines4[sfbGrp+sfb];                    
-           
+          nLines4 = peChanData->sfbNLines4[sfbGrp+sfb];
+
           /* sfbPe = nl*log2(en/thr)*/
 		  if (ldRatio >= C1_I) {
             peChanData->sfbPe[sfbGrp+sfb] = (nLines4*ldRatio + 8) >> 4;
@@ -120,26 +120,26 @@
           peChanData->sfbNActiveLines[sfbGrp+sfb] = nLines4 >> 2;
         }
         else {
-          peChanData->sfbPe[sfbGrp+sfb] = 0;                             
-          peChanData->sfbConstPart[sfbGrp+sfb] = 0;                      
-          peChanData->sfbNActiveLines[sfbGrp+sfb] = 0;                   
+          peChanData->sfbPe[sfbGrp+sfb] = 0;
+          peChanData->sfbConstPart[sfbGrp+sfb] = 0;
+          peChanData->sfbNActiveLines[sfbGrp+sfb] = 0;
         }
         pe = pe + peChanData->sfbPe[sfbGrp+sfb];
         constPart = constPart + peChanData->sfbConstPart[sfbGrp+sfb];
         nActiveLines = nActiveLines + peChanData->sfbNActiveLines[sfbGrp+sfb];
       }
     }
-	
-	peChanData->pe = saturate(pe);                                                  
-    peChanData->constPart = saturate(constPart);                                           
-    peChanData->nActiveLines = saturate(nActiveLines);                                        
 
-    
+	peChanData->pe = saturate(pe);
+    peChanData->constPart = saturate(constPart);
+    peChanData->nActiveLines = saturate(nActiveLines);
+
+
 	pe += peData->pe;
-	peData->pe = saturate(pe); 
+	peData->pe = saturate(pe);
     constPart += peData->constPart;
-	peData->constPart = saturate(constPart); 
+	peData->constPart = saturate(constPart);
     nActiveLines += peData->nActiveLines;
 	peData->nActiveLines = saturate(nActiveLines);
-  } 
+  }
 }
diff --git a/media/libstagefright/codecs/aacenc/src/memalign.c b/media/libstagefright/codecs/aacenc/src/memalign.c
index 44dd4ba..bb266dc 100644
--- a/media/libstagefright/codecs/aacenc/src/memalign.c
+++ b/media/libstagefright/codecs/aacenc/src/memalign.c
@@ -32,7 +32,7 @@
 /*****************************************************************************
 *
 * function name: mem_malloc
-* description:  malloc the alignments memory 
+* description:  malloc the alignments memory
 * returns:      the point of the memory
 *
 **********************************************************************************/
diff --git a/media/libstagefright/codecs/aacenc/src/ms_stereo.c b/media/libstagefright/codecs/aacenc/src/ms_stereo.c
index 44d45cc..2e34f14 100644
--- a/media/libstagefright/codecs/aacenc/src/ms_stereo.c
+++ b/media/libstagefright/codecs/aacenc/src/ms_stereo.c
@@ -30,7 +30,7 @@
 *
 * function name: MsStereoProcessing
 * description:  detect use ms stereo or not
-*				if ((min(thrLn, thrRn)*min(thrLn, thrRn))/(enMn*enSn)) 
+*				if ((min(thrLn, thrRn)*min(thrLn, thrRn))/(enMn*enSn))
 *				>= ((thrLn *thrRn)/(enLn*enRn)) then ms stereo
 *
 **********************************************************************************/
@@ -51,7 +51,7 @@
                         const Word16  maxSfbPerGroup,
                         const Word16 *sfbOffset) {
   Word32 temp;
-  Word32 sfb,sfboffs, j; 
+  Word32 sfb,sfboffs, j;
   Word32 msMaskTrueSomewhere = 0;
   Word32 msMaskFalseSomewhere = 0;
 
@@ -64,12 +64,12 @@
       Word32 thrL, thrR, nrgL, nrgR;
       Word32 idx, shift;
 
-      idx = sfb + sfboffs;                                                                       
+      idx = sfb + sfboffs;
 
-      thrL = sfbThresholdLeft[idx];                                                                 
-      thrR = sfbThresholdRight[idx];                                                                
-      nrgL = sfbEnergyLeft[idx];                                                                    
-      nrgR = sfbEnergyRight[idx];                                                                   
+      thrL = sfbThresholdLeft[idx];
+      thrR = sfbThresholdRight[idx];
+      nrgL = sfbEnergyLeft[idx];
+      nrgR = sfbEnergyRight[idx];
 
       minThreshold = min(thrL, thrR);
 
@@ -82,8 +82,8 @@
 
 	  pnlr = fixmul(nrgL, nrgR);
 
-      nrgL = sfbEnergyMid[idx];                                                                     
-      nrgR = sfbEnergySide[idx];                                                                    
+      nrgL = sfbEnergyMid[idx];
+      nrgR = sfbEnergySide[idx];
 
       nrgL = max(nrgL,minThreshold) + 1;
       shift = norm_l(nrgL);
@@ -97,42 +97,42 @@
 
       temp = (pnlr + 1) / ((pnms >> 8) + 1);
 
-      temp = pnms - pnlr;                                                                     
+      temp = pnms - pnlr;
       if( temp > 0 ){
 
-        msMask[idx] = 1;                                                                            
-        msMaskTrueSomewhere = 1;                                                                    
+        msMask[idx] = 1;
+        msMaskTrueSomewhere = 1;
 
         for (j=sfbOffset[idx]; j<sfbOffset[idx+1]; j++) {
           Word32 left, right;
           left  = (mdctSpectrumLeft[j] >>  1);
           right = (mdctSpectrumRight[j] >> 1);
-          mdctSpectrumLeft[j] =  left + right;                                               
-          mdctSpectrumRight[j] =  left - right;                                              
+          mdctSpectrumLeft[j] =  left + right;
+          mdctSpectrumRight[j] =  left - right;
         }
-        
-        sfbThresholdLeft[idx] = minThreshold;                                                       
-        sfbThresholdRight[idx] = minThreshold;                                                      
-        sfbEnergyLeft[idx] = sfbEnergyMid[idx];                                                     
-        sfbEnergyRight[idx] = sfbEnergySide[idx];                                                   
 
-        sfbSpreadedEnRight[idx] = min(sfbSpreadedEnLeft[idx],sfbSpreadedEnRight[idx]) >> 1;  
-        sfbSpreadedEnLeft[idx] = sfbSpreadedEnRight[idx];                                           
-        
+        sfbThresholdLeft[idx] = minThreshold;
+        sfbThresholdRight[idx] = minThreshold;
+        sfbEnergyLeft[idx] = sfbEnergyMid[idx];
+        sfbEnergyRight[idx] = sfbEnergySide[idx];
+
+        sfbSpreadedEnRight[idx] = min(sfbSpreadedEnLeft[idx],sfbSpreadedEnRight[idx]) >> 1;
+        sfbSpreadedEnLeft[idx] = sfbSpreadedEnRight[idx];
+
       }
       else {
-        msMask[idx]  = 0;                                                                           
-        msMaskFalseSomewhere = 1;                                                                   
+        msMask[idx]  = 0;
+        msMaskFalseSomewhere = 1;
       }
-    }                                                                                               
-    if ( msMaskTrueSomewhere ) {                                                                    
+    }
+    if ( msMaskTrueSomewhere ) {
       if(msMaskFalseSomewhere ) {
-        *msDigest = SI_MS_MASK_SOME;                                                                
+        *msDigest = SI_MS_MASK_SOME;
       } else {
-        *msDigest = SI_MS_MASK_ALL;                                                                 
+        *msDigest = SI_MS_MASK_ALL;
       }
     } else {
-      *msDigest = SI_MS_MASK_NONE;                                                                  
+      *msDigest = SI_MS_MASK_NONE;
     }
   }
 
diff --git a/media/libstagefright/codecs/aacenc/src/pre_echo_control.c b/media/libstagefright/codecs/aacenc/src/pre_echo_control.c
index 1e818a2..1406e11 100644
--- a/media/libstagefright/codecs/aacenc/src/pre_echo_control.c
+++ b/media/libstagefright/codecs/aacenc/src/pre_echo_control.c
@@ -29,7 +29,7 @@
 
 /*****************************************************************************
 *
-* function name:InitPreEchoControl 
+* function name:InitPreEchoControl
 * description: init pre echo control parameter
 *
 *****************************************************************************/
@@ -40,13 +40,13 @@
   Word16 pb;
 
   for(pb=0; pb<numPb; pb++) {
-    pbThresholdNm1[pb] = pbThresholdQuiet[pb];                                   
+    pbThresholdNm1[pb] = pbThresholdQuiet[pb];
   }
 }
 
 /*****************************************************************************
 *
-* function name:PreEchoControl 
+* function name:PreEchoControl
 * description: update shreshold to avoid pre echo
 *			   thr(n) = max(rpmin*thrq(n), min(thrq(n), rpelev*thrq1(n)))
 *
@@ -68,22 +68,22 @@
   (void)maxAllowedIncreaseFactor;
 
   scaling = ((mdctScale - mdctScalenm1) << 1);
-   
+
   if ( scaling > 0 ) {
     for(i = 0; i < numPb; i++) {
       tmpThreshold1 = pbThresholdNm1[i] >> (scaling-1);
       tmpThreshold2 = L_mpy_ls(pbThreshold[i], minRemainingThresholdFactor);
 
       /* copy thresholds to internal memory */
-      pbThresholdNm1[i] = pbThreshold[i];                                        
+      pbThresholdNm1[i] = pbThreshold[i];
 
-       
+
       if(pbThreshold[i] > tmpThreshold1) {
-        pbThreshold[i] = tmpThreshold1;                                          
+        pbThreshold[i] = tmpThreshold1;
       }
-       
+
       if(tmpThreshold2 > pbThreshold[i]) {
-        pbThreshold[i] = tmpThreshold2;                                          
+        pbThreshold[i] = tmpThreshold2;
       }
 
     }
@@ -96,15 +96,15 @@
       tmpThreshold2 = L_mpy_ls(pbThreshold[i], minRemainingThresholdFactor);
 
       /* copy thresholds to internal memory */
-      pbThresholdNm1[i] = pbThreshold[i];                                        
+      pbThresholdNm1[i] = pbThreshold[i];
 
-       
+
       if(((pbThreshold[i] >> scaling) > tmpThreshold1)) {
         pbThreshold[i] = tmpThreshold1 << scaling;
       }
-       
+
       if(tmpThreshold2 > pbThreshold[i]) {
-        pbThreshold[i] = tmpThreshold2;                                          
+        pbThreshold[i] = tmpThreshold2;
       }
 
     }
diff --git a/media/libstagefright/codecs/aacenc/src/psy_configuration.c b/media/libstagefright/codecs/aacenc/src/psy_configuration.c
index 8e599b0..02d92ab 100644
--- a/media/libstagefright/codecs/aacenc/src/psy_configuration.c
+++ b/media/libstagefright/codecs/aacenc/src/psy_configuration.c
@@ -88,17 +88,17 @@
 *
 * function name: atan_1000
 * description:  calculates 1000*atan(x/1000)
-*               based on atan approx for x > 0				
+*               based on atan approx for x > 0
 *				atan(x) = x/((float)1.0f+(float)0.280872f*x*x)  if x < 1
 *						= pi/2 - x/((float)0.280872f +x*x)	    if x >= 1
 * return:       1000*atan(x/1000)
 *
 **********************************************************************************/
-static Word16 atan_1000(Word32 val) 
+static Word16 atan_1000(Word32 val)
 {
   Word32 y;
 
-   
+
   if(L_sub(val, 1000) < 0) {
     y = extract_l(((1000 * val) / (1000 + ((val * val) / ATAN_COEF1))));
   }
@@ -126,9 +126,9 @@
   /* center frequency of fft line */
   center_freq = (fftLine * samplingFreq) / (noOfLines << 1);
   temp =  atan_1000((center_freq << 2) / (3*10));
-  bvalFFTLine = 
+  bvalFFTLine =
     (26600 * atan_1000((center_freq*76) / 100) + 7*temp*temp) / (2*1000*1000 / BARC_SCALE);
-  
+
   return saturate(bvalFFTLine);
 }
 
@@ -148,17 +148,17 @@
   for(i=0; i<numPb; i++) {
     Word16 bv1, bv2;
 
-     
+
     if (i>0)
       bv1 = (pbBarcVal[i] + pbBarcVal[i-1]) >> 1;
     else
       bv1 = pbBarcVal[i] >> 1;
 
-     
+
     if (i < (numPb - 1))
       bv2 = (pbBarcVal[i] + pbBarcVal[i+1]) >> 1;
     else {
-      bv2 = pbBarcVal[i];                                        
+      bv2 = pbBarcVal[i];
     }
 
     bv1 = min((bv1 / BARC_SCALE), max_bark);
@@ -166,9 +166,9 @@
 
     barcThrQuiet = min(BARC_THR_QUIET[bv1], BARC_THR_QUIET[bv2]);
 
-    
+
     /*
-      we calculate 
+      we calculate
       pow(10.0f,(float)(barcThrQuiet - ABS_LEV)*0.1)*(float)ABS_LOW*(pbOffset[i+1] - pbOffset[i]);
     */
 
@@ -196,47 +196,47 @@
   Word16 i;
   Word16 maskLowSprEn, maskHighSprEn;
 
-   
+
   if (sub(blockType, SHORT_WINDOW) != 0) {
-    maskLowSprEn = maskLowSprEnLong;                                     
-       
+    maskLowSprEn = maskLowSprEnLong;
+
     if (bitrate > 22000)
       maskHighSprEn = maskHighSprEnLong;
     else
       maskHighSprEn = maskHighSprEnLongLowBr;
   }
   else {
-    maskLowSprEn = maskLowSprEnShort;            
-    maskHighSprEn = maskHighSprEnShort;          
+    maskLowSprEn = maskLowSprEnShort;
+    maskHighSprEn = maskHighSprEnShort;
   }
 
   for(i=0; i<numPb; i++) {
-     
+
     if (i > 0) {
       Word32 dbVal;
       Word16 dbark = pbBarcValue[i] - pbBarcValue[i-1];
 
       /*
-        we calulate pow(10.0f, -0.1*dbVal/BARC_SCALE) 
+        we calulate pow(10.0f, -0.1*dbVal/BARC_SCALE)
       */
       dbVal = (maskHigh * dbark);
       pbMaskHiFactor[i] = round16(pow2_xy(L_negate(dbVal), (Word32)LOG2_1000));             /* 0.301 log10(2) */
-       
+
       dbVal = (maskLow * dbark);
-      pbMaskLoFactor[i-1] = round16(pow2_xy(L_negate(dbVal),(Word32)LOG2_1000)); 
-       
-      
+      pbMaskLoFactor[i-1] = round16(pow2_xy(L_negate(dbVal),(Word32)LOG2_1000));
+
+
       dbVal = (maskHighSprEn * dbark);
-      pbMaskHiFactorSprEn[i] =  round16(pow2_xy(L_negate(dbVal),(Word32)LOG2_1000)); 
+      pbMaskHiFactorSprEn[i] =  round16(pow2_xy(L_negate(dbVal),(Word32)LOG2_1000));
       dbVal = (maskLowSprEn * dbark);
       pbMaskLoFactorSprEn[i-1] = round16(pow2_xy(L_negate(dbVal),(Word32)LOG2_1000));
     }
     else {
-      pbMaskHiFactor[i] = 0;                     
-      pbMaskLoFactor[numPb-1] = 0;               
+      pbMaskHiFactor[i] = 0;
+      pbMaskLoFactor[numPb-1] = 0;
 
-      pbMaskHiFactorSprEn[i] = 0;                
-      pbMaskLoFactorSprEn[numPb-1] = 0;          
+      pbMaskHiFactorSprEn[i] = 0;
+      pbMaskLoFactorSprEn[numPb-1] = 0;
     }
   }
 
@@ -258,12 +258,12 @@
   Word16 i;
   Word16 pbBval0, pbBval1;
 
-  pbBval0 = 0;                                       
+  pbBval0 = 0;
 
   for(i=0; i<numPb; i++){
     pbBval1 = BarcLineValue(numLines, pbOffset[i+1], samplingFrequency);
     pbBval[i] = (pbBval0 + pbBval1) >> 1;
-    pbBval0 = pbBval1;                              
+    pbBval0 = pbBval1;
   }
 }
 
@@ -295,38 +295,38 @@
 
   pePerWindow = bits2pe(extract_l((bitrate * numLines) / samplerate));
 
-  pbVal0 = 0;                                                    
+  pbVal0 = 0;
 
   for (sfb=0; sfb<sfbActive; sfb++) {
 
     pbVal1 = (pbBarcVal[sfb] << 1) - pbVal0;
     barcWidth = pbVal1 - pbVal0;
-    pbVal0 = pbVal1;                                             
+    pbVal0 = pbVal1;
 
     /* allow at least 2.4% of pe for each active barc */
 	pePart = ((pePerWindow * 24) * (max_bark * barcWidth)) /
         (pbBarcVal[sfbActive-1] * (sfbOffset[sfb+1] - sfbOffset[sfb]));
-   
-      
-    pePart = min(pePart, 8400); 
+
+
+    pePart = min(pePart, 8400);
     pePart = max(pePart, 1400);
 
     /* minSnr(n) = 1/(2^sfbPemin(n)/w(n) - 1.5)*/
 	/* we add an offset of 2^16 to the pow functions */
 	/* 0xc000 = 1.5*(1 << 15)*/
-      
+
     snr = pow2_xy((pePart - 16*1000),1000) - 0x0000c000;
-      
+
     if(snr > 0x00008000)
 	{
 		shift = norm_l(snr);
-		snr = Div_32(0x00008000 << shift, snr << shift);  
+		snr = Div_32(0x00008000 << shift, snr << shift);
 	}
 	else
 	{
 		snr = 0x7fffffff;
 	}
-      
+
     /* upper limit is -1 dB */
     snr = min(snr, c_maxsnr);
     /* lower limit is -25 dB */
@@ -354,7 +354,7 @@
   /*
     init sfb table
   */
-  samplerateindex = GetSRIndex(samplerate);  
+  samplerateindex = GetSRIndex(samplerate);
   psyConf->sfbCnt = sfBandTotalLong[samplerateindex];
   psyConf->sfbOffset = sfBandTabLong + sfBandTabLongOffset[samplerateindex];
   psyConf->sampRateIdx = samplerateindex;
@@ -391,19 +391,19 @@
   /*
     init ratio
   */
-  psyConf->ratio = c_ratio;      
+  psyConf->ratio = c_ratio;
 
-  psyConf->maxAllowedIncreaseFactor = 2;              
-  psyConf->minRemainingThresholdFactor = c_minRemainingThresholdFactor;    /* 0.01 *(1 << 15)*/  
+  psyConf->maxAllowedIncreaseFactor = 2;
+  psyConf->minRemainingThresholdFactor = c_minRemainingThresholdFactor;    /* 0.01 *(1 << 15)*/
 
-  psyConf->clipEnergy = c_maxClipEnergyLong;                   
+  psyConf->clipEnergy = c_maxClipEnergyLong;
   psyConf->lowpassLine = extract_l((bandwidth<<1) * FRAME_LEN_LONG / samplerate);
 
   for (sfb = 0; sfb < psyConf->sfbCnt; sfb++) {
     if (sub(psyConf->sfbOffset[sfb], psyConf->lowpassLine) >= 0)
       break;
   }
-  psyConf->sfbActive = sfb;                 
+  psyConf->sfbActive = sfb;
 
   /*
     calculate minSnr
@@ -429,7 +429,7 @@
 Word16 InitPsyConfigurationShort(Word32 bitrate,
                                  Word32 samplerate,
                                  Word16 bandwidth,
-                                 PSY_CONFIGURATION_SHORT *psyConf) 
+                                 PSY_CONFIGURATION_SHORT *psyConf)
 {
   Word32 samplerateindex;
   Word16 sfbBarcVal[MAX_SFB_SHORT];
@@ -437,7 +437,7 @@
   /*
     init sfb table
   */
-  samplerateindex = GetSRIndex(samplerate);  
+  samplerateindex = GetSRIndex(samplerate);
   psyConf->sfbCnt = sfBandTotalShort[samplerateindex];
   psyConf->sfbOffset = sfBandTabShort + sfBandTabShortOffset[samplerateindex];
   psyConf->sampRateIdx = samplerateindex;
@@ -473,21 +473,21 @@
   /*
     init ratio
   */
-  psyConf->ratio = c_ratio;                                                      
+  psyConf->ratio = c_ratio;
 
-  psyConf->maxAllowedIncreaseFactor = 2;                                         
-  psyConf->minRemainingThresholdFactor = c_minRemainingThresholdFactor;                            	 
+  psyConf->maxAllowedIncreaseFactor = 2;
+  psyConf->minRemainingThresholdFactor = c_minRemainingThresholdFactor;
 
-  psyConf->clipEnergy = c_maxClipEnergyShort;                                    
+  psyConf->clipEnergy = c_maxClipEnergyShort;
 
   psyConf->lowpassLine = extract_l(((bandwidth << 1) * FRAME_LEN_SHORT) / samplerate);
- 
+
   for (sfb = 0; sfb < psyConf->sfbCnt; sfb++) {
-     
+
     if (psyConf->sfbOffset[sfb] >= psyConf->lowpassLine)
       break;
   }
-  psyConf->sfbActive = sfb;                                                      
+  psyConf->sfbActive = sfb;
 
   /*
     calculate minSnr
diff --git a/media/libstagefright/codecs/aacenc/src/psy_main.c b/media/libstagefright/codecs/aacenc/src/psy_main.c
index 3d0a355..085acb8 100644
--- a/media/libstagefright/codecs/aacenc/src/psy_main.c
+++ b/media/libstagefright/codecs/aacenc/src/psy_main.c
@@ -81,7 +81,7 @@
   Word32 *mdctSpectrum;
   Word32 *scratchTNS;
   Word16 *mdctDelayBuffer;
-  
+
   mdctSpectrum = (Word32 *)mem_malloc(pMemOP, nChan * FRAME_LEN_LONG * sizeof(Word32), 32, VO_INDEX_ENC_AAC);
   if(NULL == mdctSpectrum)
 	  return 1;
@@ -99,7 +99,7 @@
   }
 
   for (i=0; i<nChan; i++){
-    hPsy->psyData[i].mdctDelayBuffer = mdctDelayBuffer + i*BLOCK_SWITCHING_OFFSET;      
+    hPsy->psyData[i].mdctDelayBuffer = mdctDelayBuffer + i*BLOCK_SWITCHING_OFFSET;
     hPsy->psyData[i].mdctSpectrum = mdctSpectrum + i*FRAME_LEN_LONG;
   }
 
@@ -124,12 +124,12 @@
   {
 	if(hPsy->psyData[0].mdctDelayBuffer)
 		mem_free(pMemOP, hPsy->psyData[0].mdctDelayBuffer, VO_INDEX_ENC_AAC);
-      
+
     if(hPsy->psyData[0].mdctSpectrum)
 		mem_free(pMemOP, hPsy->psyData[0].mdctSpectrum, VO_INDEX_ENC_AAC);
 
     for (nch=0; nch<MAX_CHANNELS; nch++){
-	  hPsy->psyData[nch].mdctDelayBuffer = NULL;      
+	  hPsy->psyData[nch].mdctDelayBuffer = NULL;
 	  hPsy->psyData[nch].mdctSpectrum = NULL;
 	}
 
@@ -216,14 +216,14 @@
 
   if (!err)
     for(ch=0;ch < channels;ch++){
-  
+
       InitBlockSwitching(&hPsy->psyData[ch].blockSwitchingControl,
                          bitRate, channels);
 
       InitPreEchoControl(hPsy->psyData[ch].sfbThresholdnm1,
                          hPsy->psyConfLong.sfbCnt,
                          hPsy->psyConfLong.sfbThresholdQuiet);
-      hPsy->psyData[ch].mdctScalenm1 = 0;                                
+      hPsy->psyData[ch].mdctScalenm1 = 0;
     }
 
 	return(err);
@@ -241,7 +241,7 @@
 
 Word16 psyMain(Word16                   nChannels,
                ELEMENT_INFO            *elemInfo,
-               Word16                  *timeSignal, 
+               Word16                  *timeSignal,
                PSY_DATA                 psyData[MAX_CHANNELS],
                TNS_DATA                 tnsData[MAX_CHANNELS],
                PSY_CONFIGURATION_LONG  *hPsyConfLong,
@@ -260,8 +260,8 @@
   Word16 channels;
   Word16 maxScale;
 
-  channels = elemInfo->nChannelsInEl;                            
-  maxScale = 0;                                                  
+  channels = elemInfo->nChannelsInEl;
+  maxScale = 0;
 
   /* block switching */
   for(ch = 0; ch < channels; ch++) {
@@ -291,7 +291,7 @@
   /* common scaling for all channels */
   for (ch=0; ch<channels; ch++) {
     Word16 scaleDiff = maxScale - mdctScalingArray[ch];
-     
+
     if (scaleDiff > 0) {
       Word32 *Spectrum = psyData[ch].mdctSpectrum;
 	  for(line=0; line<FRAME_LEN_LONG; line++) {
@@ -299,11 +299,11 @@
 		Spectrum++;
       }
     }
-    psyData[ch].mdctScale = maxScale;                                    
+    psyData[ch].mdctScale = maxScale;
   }
 
   for (ch=0; ch<channels; ch++) {
-     
+
     if(psyData[ch].blockSwitchingControl.windowSequence != SHORT_WINDOW) {
       /* update long block parameter */
 	  advancePsychLong(&psyData[ch],
@@ -317,7 +317,7 @@
       /* determine maxSfb */
       for (sfb=hPsyConfLong->sfbCnt-1; sfb>=0; sfb--) {
         for (line=hPsyConfLong->sfbOffset[sfb+1] - 1; line>=hPsyConfLong->sfbOffset[sfb]; line--) {
-           
+
           if (psyData[ch].mdctSpectrum[line] != 0) break;
         }
         if (line >= hPsyConfLong->sfbOffset[sfb]) break;
@@ -326,7 +326,7 @@
 
       /* Calc bandwise energies for mid and side channel
          Do it only if 2 channels exist */
-       
+
       if (ch == 1)
         advancePsychLongMS(psyData, hPsyConfLong);
     }
@@ -341,7 +341,7 @@
 
       /* Calc bandwise energies for mid and side channel
          Do it only if 2 channels exist */
-       
+
       if (ch == 1)
         advancePsychShortMS (psyData, hPsyConfShort);
     }
@@ -349,7 +349,7 @@
 
   /* group short data */
   for(ch=0; ch<channels; ch++) {
-     
+
     if (psyData[ch].blockSwitchingControl.windowSequence == SHORT_WINDOW) {
       groupShortData(psyData[ch].mdctSpectrum,
                      pScratchTns,
@@ -374,10 +374,10 @@
     stereo Processing
   */
   if (channels == 2) {
-    psyOutElement->toolsInfo.msDigest = MS_NONE;                 
+    psyOutElement->toolsInfo.msDigest = MS_NONE;
     maxSfbPerGroup[0] = maxSfbPerGroup[1] = max(maxSfbPerGroup[0], maxSfbPerGroup[1]);
 
-     
+
     if (psyData[0].blockSwitchingControl.windowSequence != SHORT_WINDOW)
       MsStereoProcessing(psyData[0].sfbEnergy.sfbLong,
                          psyData[1].sfbEnergy.sfbLong,
@@ -420,7 +420,7 @@
     build output
   */
   for(ch=0;ch<channels;ch++) {
-     
+
     if (psyData[ch].blockSwitchingControl.windowSequence != SHORT_WINDOW)
       BuildInterface(psyData[ch].mdctSpectrum,
                      psyData[ch].mdctScale,
@@ -483,7 +483,7 @@
   /* low pass */
   data0 = psyData->mdctSpectrum + hPsyConfLong->lowpassLine;
   for(i=hPsyConfLong->lowpassLine; i<FRAME_LEN_LONG; i++) {
-    *data0++ = 0;                                
+    *data0++ = 0;
   }
 
   /* Calc sfb-bandwise mdct-energies for left and right channel */
@@ -505,7 +505,7 @@
             psyData->blockSwitchingControl.windowSequence,
             psyData->sfbEnergy.sfbLong);
 
-  /*  TnsSync */   
+  /*  TnsSync */
   if (ch == 1) {
     TnsSync(tnsData,
             tnsData2,
@@ -514,7 +514,7 @@
             psyData->blockSwitchingControl.windowSequence);
   }
 
-  /*  Tns Encoder */ 
+  /*  Tns Encoder */
   TnsEncode(&psyOutChannel->tnsInfo,
             tnsData,
             hPsyConfLong->sfbCnt,
@@ -532,15 +532,15 @@
     *data1++ = min(tdata, clipEnergy);
   }
 
-  /* Calc sfb-bandwise mdct-energies for left and right channel again */   
+  /* Calc sfb-bandwise mdct-energies for left and right channel again */
   if (tnsData->dataRaw.tnsLong.subBlockInfo.tnsActive!=0) {
-    Word16 tnsStartBand = hPsyConfLong->tnsConf.tnsStartBand;                            
+    Word16 tnsStartBand = hPsyConfLong->tnsConf.tnsStartBand;
     CalcBandEnergy( psyData->mdctSpectrum,
                     hPsyConfLong->sfbOffset+tnsStartBand,
                     hPsyConfLong->sfbActive - tnsStartBand,
                     psyData->sfbEnergy.sfbLong+tnsStartBand,
                     &psyData->sfbEnergySum.sfbLong);
-    
+
 	data0 = psyData->sfbEnergy.sfbLong;
 	tdata = psyData->sfbEnergySum.sfbLong;
 	for (i=0; i<tnsStartBand; i++)
@@ -565,13 +565,13 @@
 	  data0++; data1++;
   }
 
-  /* preecho control */   
+  /* preecho control */
   if (psyData->blockSwitchingControl.windowSequence == STOP_WINDOW) {
     data0 = psyData->sfbThresholdnm1;
 	for (i=hPsyConfLong->sfbCnt; i; i--) {
-      *data0++ = MAX_32;                              
+      *data0++ = MAX_32;
     }
-    psyData->mdctScalenm1 = 0;                                           
+    psyData->mdctScalenm1 = 0;
   }
 
   PreEchoControl( psyData->sfbThresholdnm1,
@@ -581,15 +581,15 @@
                   psyData->sfbThreshold.sfbLong,
                   psyData->mdctScale,
                   psyData->mdctScalenm1);
-  psyData->mdctScalenm1 = psyData->mdctScale;                            
+  psyData->mdctScalenm1 = psyData->mdctScale;
 
-   
+
   if (psyData->blockSwitchingControl.windowSequence== START_WINDOW) {
     data0 = psyData->sfbThresholdnm1;
 	for (i=hPsyConfLong->sfbCnt; i; i--) {
-      *data0++ = MAX_32;                              
+      *data0++ = MAX_32;
     }
-    psyData->mdctScalenm1 = 0;                                           
+    psyData->mdctScalenm1 = 0;
   }
 
   /* apply tns mult table on cb thresholds */
@@ -603,13 +603,13 @@
   data0 = psyData->sfbSpreadedEnergy.sfbLong;
   data1 = psyData->sfbEnergy.sfbLong;
   for (i=hPsyConfLong->sfbCnt; i; i--) {
-    //psyData->sfbSpreadedEnergy.sfbLong[i] = psyData->sfbEnergy.sfbLong[i];       
+    //psyData->sfbSpreadedEnergy.sfbLong[i] = psyData->sfbEnergy.sfbLong[i];
 	  *data0++ = *data1++;
   }
 
   /* spreading energy */
   SpreadingMax(hPsyConfLong->sfbCnt,
-               hPsyConfLong->sfbMaskLowFactorSprEn, 
+               hPsyConfLong->sfbMaskLowFactorSprEn,
                hPsyConfLong->sfbMaskHighFactorSprEn,
                psyData->sfbSpreadedEnergy.sfbLong);
 
@@ -619,7 +619,7 @@
 /*****************************************************************************
 *
 * function name: advancePsychLongMS
-* description:   update mdct-energies for left add or minus right channel 
+* description:   update mdct-energies for left add or minus right channel
 *				for long block
 *
 *****************************************************************************/
@@ -657,7 +657,7 @@
   Word32 w;
   Word32 normEnergyShift = (psyData->mdctScale + 1) << 1; /* in reference code, mdct spectrum must be multipied with 2, so +1 */
   Word32 clipEnergy = hPsyConfShort->clipEnergy >> normEnergyShift;
-  Word32 wOffset = 0;     
+  Word32 wOffset = 0;
   Word32 *data0, *data1;
 
   for(w = 0; w < TRANS_FAC; w++) {
@@ -666,7 +666,7 @@
     /* low pass */
     data0 = psyData->mdctSpectrum + wOffset + hPsyConfShort->lowpassLine;
 	for(i=hPsyConfShort->lowpassLine; i<FRAME_LEN_SHORT; i++){
-      *data0++ = 0;                                      
+      *data0++ = 0;
     }
 
     /* Calc sfb-bandwise mdct-energies for left and right channel */
@@ -713,9 +713,9 @@
       *data0++ = min(tdata, clipEnergy);
     }
 
-    /* Calc sfb-bandwise mdct-energies for left and right channel again */     
+    /* Calc sfb-bandwise mdct-energies for left and right channel again */
     if (tnsData->dataRaw.tnsShort.subBlockInfo[w].tnsActive != 0) {
-      Word16 tnsStartBand = hPsyConfShort->tnsConf.tnsStartBand;                            
+      Word16 tnsStartBand = hPsyConfShort->tnsConf.tnsStartBand;
       CalcBandEnergy( psyData->mdctSpectrum+wOffset,
                       hPsyConfShort->sfbOffset+tnsStartBand,
                       (hPsyConfShort->sfbActive - tnsStartBand),
@@ -748,7 +748,7 @@
 	}
 
 
-    /* preecho */     
+    /* preecho */
     PreEchoControl( psyData->sfbThresholdnm1,
                     hPsyConfShort->sfbCnt,
                     hPsyConfShort->maxAllowedIncreaseFactor,
@@ -770,14 +770,14 @@
 	  *data0++ = *data1++;
     }
     SpreadingMax(hPsyConfShort->sfbCnt,
-                 hPsyConfShort->sfbMaskLowFactorSprEn, 
+                 hPsyConfShort->sfbMaskLowFactorSprEn,
                  hPsyConfShort->sfbMaskHighFactorSprEn,
                  psyData->sfbSpreadedEnergy.sfbShort[w]);
 
     wOffset += FRAME_LEN_SHORT;
   } /* for TRANS_FAC */
 
-  psyData->mdctScalenm1 = psyData->mdctScale;              
+  psyData->mdctScalenm1 = psyData->mdctScale;
 
   return 0;
 }
@@ -785,7 +785,7 @@
 /*****************************************************************************
 *
 * function name: advancePsychShortMS
-* description:   update mdct-energies for left add or minus right channel 
+* description:   update mdct-energies for left add or minus right channel
 *				for short block
 *
 *****************************************************************************/
@@ -793,7 +793,7 @@
                                    const PSY_CONFIGURATION_SHORT *hPsyConfShort)
 {
   Word32 w, wOffset;
-  wOffset = 0;                                   
+  wOffset = 0;
   for(w=0; w<TRANS_FAC; w++) {
     CalcBandEnergyMS(psyData[0].mdctSpectrum+wOffset,
                      psyData[1].mdctSpectrum+wOffset,
diff --git a/media/libstagefright/codecs/aacenc/src/qc_main.c b/media/libstagefright/codecs/aacenc/src/qc_main.c
index e8c39e4..df6d46e 100644
--- a/media/libstagefright/codecs/aacenc/src/qc_main.c
+++ b/media/libstagefright/codecs/aacenc/src/qc_main.c
@@ -68,12 +68,12 @@
   result = (FRAME_LEN_LONG >> 3) * bitRate;
   quot = result / sampleRate;
 
-   
+
   if (mode == FRAME_LEN_BYTES_MODULO) {
     result -= quot * sampleRate;
   }
   else { /* FRAME_LEN_BYTES_INT */
-    result = quot;                                      
+    result = quot;
   }
 
   return result;
@@ -83,7 +83,7 @@
 *
 *  function name:framePadding
 *  description: Calculates if padding is needed for actual frame
-*  returns: paddingOn or not 
+*  returns: paddingOn or not
 *
 *****************************************************************************/
 static Word16 framePadding(Word32 bitRate,
@@ -93,16 +93,16 @@
   Word16 paddingOn;
   Word16 difference;
 
-  paddingOn = 0;                                                 
+  paddingOn = 0;
 
   difference = calcFrameLen( bitRate,
                              sampleRate,
                              FRAME_LEN_BYTES_MODULO );
   *paddingRest = *paddingRest - difference;
 
-   
+
   if (*paddingRest <= 0 ) {
-    paddingOn = 1;                                               
+    paddingOn = 1;
     *paddingRest = *paddingRest + sampleRate;
   }
 
@@ -123,12 +123,12 @@
   Word32 i;
   Word16 *quantSpec;
   Word16 *scf;
-  UWord16 *maxValueInSfb;	
-	
+  UWord16 *maxValueInSfb;
+
   quantSpec = (Word16 *)mem_malloc(pMemOP, nChannels * FRAME_LEN_LONG * sizeof(Word16), 32, VO_INDEX_ENC_AAC);
   if(NULL == quantSpec)
 	  return 1;
-  scf = (Word16 *)mem_malloc(pMemOP, nChannels * MAX_GROUPED_SFB * sizeof(Word16), 32, VO_INDEX_ENC_AAC);     
+  scf = (Word16 *)mem_malloc(pMemOP, nChannels * MAX_GROUPED_SFB * sizeof(Word16), 32, VO_INDEX_ENC_AAC);
   if(NULL == scf)
   {
 	  return 1;
@@ -141,12 +141,12 @@
 
   for (i=0; i<nChannels; i++) {
     hQC->qcChannel[i].quantSpec = quantSpec + i*FRAME_LEN_LONG;
-    
+
     hQC->qcChannel[i].maxValueInSfb = maxValueInSfb + i*MAX_GROUPED_SFB;
-    
+
     hQC->qcChannel[i].scf = scf + i*MAX_GROUPED_SFB;
   }
- 
+
   return 0;
 }
 
@@ -165,21 +165,21 @@
    {
       if(hQC->qcChannel[0].quantSpec);
 		 mem_free(pMemOP, hQC->qcChannel[0].quantSpec, VO_INDEX_ENC_AAC);
-    
+
       if(hQC->qcChannel[0].maxValueInSfb)
 		  mem_free(pMemOP, hQC->qcChannel[0].maxValueInSfb, VO_INDEX_ENC_AAC);
-    
+
 	  if(hQC->qcChannel[0].scf)
 		  mem_free(pMemOP, hQC->qcChannel[0].scf, VO_INDEX_ENC_AAC);
 
 	  for (i=0; i<MAX_CHANNELS; i++) {
 		  hQC->qcChannel[i].quantSpec = NULL;
-		  
+
 		  hQC->qcChannel[i].maxValueInSfb = NULL;
-		  
+
 		  hQC->qcChannel[i].scf = NULL;
 	  }
-   } 
+   }
 }
 
 /*********************************************************************************
@@ -204,8 +204,8 @@
 **********************************************************************************/
 void QCDelete(QC_STATE *hQC, VO_MEM_OPERATOR *pMemOP)
 {
- 
-  /* 
+
+  /*
      nothing to do
   */
   hQC=NULL;
@@ -221,15 +221,15 @@
 Word16 QCInit(QC_STATE *hQC,
               struct QC_INIT *init)
 {
-  hQC->nChannels       = init->elInfo->nChannelsInEl;              
-  hQC->maxBitsTot      = init->maxBits;                            
+  hQC->nChannels       = init->elInfo->nChannelsInEl;
+  hQC->maxBitsTot      = init->maxBits;
   hQC->bitResTot       = sub(init->bitRes, init->averageBits);
-  hQC->averageBitsTot  = init->averageBits;                        
-  hQC->maxBitFac       = init->maxBitFac;                          
+  hQC->averageBitsTot  = init->averageBits;
+  hQC->maxBitFac       = init->maxBitFac;
 
-  hQC->padding.paddingRest = init->padding.paddingRest;            
+  hQC->padding.paddingRest = init->padding.paddingRest;
 
-  hQC->globStatBits    = 3;                          /* for ID_END */ 
+  hQC->globStatBits    = 3;                          /* for ID_END */
 
   /* channel elements init */
   InitElementBits(&hQC->elementBits,
@@ -248,13 +248,13 @@
 
 
 /*********************************************************************************
-* 
+*
 * function name: QCMain
 * description:  quantization and coding the spectrum
 * returns:      0 if success
 *
 **********************************************************************************/
-Word16 QCMain(QC_STATE* hQC,              
+Word16 QCMain(QC_STATE* hQC,
               ELEMENT_BITS* elBits,
               ATS_ELEMENT* adjThrStateElement,
               PSY_OUT_CHANNEL  psyOutChannel[MAX_CHANNELS],  /* may be modified in-place */
@@ -262,34 +262,34 @@
               QC_OUT_CHANNEL  qcOutChannel[MAX_CHANNELS],    /* out                      */
               QC_OUT_ELEMENT* qcOutElement,
               Word16 nChannels,
-			  Word16 ancillaryDataBytes)      
+			  Word16 ancillaryDataBytes)
 {
   Word16 maxChDynBits[MAX_CHANNELS];
-  Word16 chBitDistribution[MAX_CHANNELS];  
+  Word16 chBitDistribution[MAX_CHANNELS];
   Word32 ch;
-   
+
   if (elBits->bitResLevel < 0) {
     return -1;
   }
-   
+
   if (elBits->bitResLevel > elBits->maxBitResBits) {
     return -1;
   }
 
   qcOutElement->staticBitsUsed = countStaticBitdemand(psyOutChannel,
                                                       psyOutElement,
-                                                      nChannels, 
+                                                      nChannels,
 													  qcOutElement->adtsUsed);
 
-   
+
   if (ancillaryDataBytes) {
     qcOutElement->ancBitsUsed = 7 + (ancillaryDataBytes << 3);
-     
+
     if (ancillaryDataBytes >= 15)
       qcOutElement->ancBitsUsed = qcOutElement->ancBitsUsed + 8;
   }
   else {
-    qcOutElement->ancBitsUsed = 0; 
+    qcOutElement->ancBitsUsed = 0;
   }
 
   CalcFormFactor(hQC->logSfbFormFactor, hQC->sfbNRelevantLines, hQC->logSfbEnergy, psyOutChannel, nChannels);
@@ -301,7 +301,7 @@
                    psyOutElement,
                    chBitDistribution,
                    hQC->logSfbEnergy,
-                   hQC->sfbNRelevantLines,                   
+                   hQC->sfbNRelevantLines,
                    qcOutElement,
 				   elBits,
 				   nChannels,
@@ -323,14 +323,14 @@
     maxChDynBits[ch] = extract_l(chBitDistribution[ch] * maxDynBits / 1000);
   }
 
-  qcOutElement->dynBitsUsed = 0;                                         
+  qcOutElement->dynBitsUsed = 0;
   for (ch = 0; ch < nChannels; ch++) {
     Word32 chDynBits;
     Flag   constraintsFulfilled;
     Word32 iter;
-    iter = 0;                                                          
+    iter = 0;
     do {
-      constraintsFulfilled = 1;                                        
+      constraintsFulfilled = 1;
 
       QuantizeSpectrum(psyOutChannel[ch].sfbCnt,
                        psyOutChannel[ch].maxSfbPerGroup,
@@ -340,14 +340,14 @@
                        qcOutChannel[ch].globalGain,
                        qcOutChannel[ch].scf,
                        qcOutChannel[ch].quantSpec);
-       
+
       if (calcMaxValueInSfb(psyOutChannel[ch].sfbCnt,
                             psyOutChannel[ch].maxSfbPerGroup,
                             psyOutChannel[ch].sfbPerGroup,
                             psyOutChannel[ch].sfbOffsets,
                             qcOutChannel[ch].quantSpec,
                             qcOutChannel[ch].maxValueInSfb) > MAX_QUANT) {
-        constraintsFulfilled = 0;                                        
+        constraintsFulfilled = 0;
       }
 
       chDynBits = dynBitCount(qcOutChannel[ch].quantSpec,
@@ -359,24 +359,24 @@
                               psyOutChannel[ch].sfbPerGroup,
                               psyOutChannel[ch].sfbOffsets,
                               &qcOutChannel[ch].sectionData);
-       
+
       if (chDynBits >= maxChDynBits[ch]) {
-        constraintsFulfilled = 0;                                        
+        constraintsFulfilled = 0;
       }
-       
+
       if (!constraintsFulfilled) {
         qcOutChannel[ch].globalGain = qcOutChannel[ch].globalGain + 1;
       }
 
       iter = iter + 1;
-       
+
     } while(!constraintsFulfilled);
 
     qcOutElement->dynBitsUsed = qcOutElement->dynBitsUsed + chDynBits;
 
-    qcOutChannel[ch].mdctScale    = psyOutChannel[ch].mdctScale;         
-    qcOutChannel[ch].groupingMask = psyOutChannel[ch].groupingMask;      
-    qcOutChannel[ch].windowShape  = psyOutChannel[ch].windowShape;       
+    qcOutChannel[ch].mdctScale    = psyOutChannel[ch].mdctScale;
+    qcOutChannel[ch].groupingMask = psyOutChannel[ch].groupingMask;
+    qcOutChannel[ch].windowShape  = psyOutChannel[ch].windowShape;
   }
 
   /* save dynBitsUsed for correction of bits2pe relation */
@@ -411,13 +411,13 @@
   Word16 sfbOffs, sfb;
   Word16 maxValueAll;
 
-  maxValueAll = 0;                                       
+  maxValueAll = 0;
 
   for(sfbOffs=0;sfbOffs<sfbCnt;sfbOffs+=sfbPerGroup) {
     for (sfb = 0; sfb < maxSfbPerGroup; sfb++) {
       Word16 line;
       Word16 maxThisSfb;
-      maxThisSfb = 0;                                    
+      maxThisSfb = 0;
 
       for (line = sfbOffset[sfbOffs+sfb]; line < sfbOffset[sfbOffs+sfb+1]; line++) {
         Word16 absVal;
@@ -425,7 +425,7 @@
         maxThisSfb = max(maxThisSfb, absVal);
       }
 
-      maxValue[sfbOffs+sfb] = maxThisSfb;                
+      maxValue[sfbOffs+sfb] = maxThisSfb;
       maxValueAll = max(maxValueAll, maxThisSfb);
     }
   }
@@ -441,15 +441,15 @@
 **********************************************************************************/
 void updateBitres(QC_STATE* qcKernel,
                   QC_OUT*   qcOut)
-                  
+
 {
   ELEMENT_BITS *elBits;
- 
-  qcKernel->bitResTot = 0;                               
+
+  qcKernel->bitResTot = 0;
 
   elBits = &qcKernel->elementBits;
 
-   
+
   if (elBits->averageBits > 0) {
     /* constant bitrate */
     Word16 bitsUsed;
@@ -460,8 +460,8 @@
   }
   else {
     /* variable bitrate */
-    elBits->bitResLevel = elBits->maxBits;           
-    qcKernel->bitResTot = qcKernel->maxBitsTot;      
+    elBits->bitResLevel = elBits->maxBits;
+    qcKernel->bitResTot = qcKernel->maxBitsTot;
   }
 }
 
@@ -476,55 +476,55 @@
 {
   Word32 nFullFillElem;
   Word32 totFillBits;
-  Word16 diffBits;  
+  Word16 diffBits;
   Word16 bitsUsed;
 
-  totFillBits = 0;                                       
+  totFillBits = 0;
 
-  qcOut->totStaticBitsUsed = qcKernel->globStatBits;     
+  qcOut->totStaticBitsUsed = qcKernel->globStatBits;
   qcOut->totStaticBitsUsed += qcOut->qcElement.staticBitsUsed;
   qcOut->totDynBitsUsed    = qcOut->qcElement.dynBitsUsed;
   qcOut->totAncBitsUsed    = qcOut->qcElement.ancBitsUsed;
   qcOut->totFillBits       = qcOut->qcElement.fillBits;
-   
+
   if (qcOut->qcElement.fillBits) {
     totFillBits += qcOut->qcElement.fillBits;
   }
 
   nFullFillElem = (max((qcOut->totFillBits - 1), 0) / maxFillElemBits) * maxFillElemBits;
-  
+
   qcOut->totFillBits = qcOut->totFillBits - nFullFillElem;
 
   /* check fill elements */
-   
+
   if (qcOut->totFillBits > 0) {
     /* minimum Fillelement contains 7 (TAG + byte cnt) bits */
     qcOut->totFillBits = max(7, qcOut->totFillBits);
     /* fill element size equals n*8 + 7 */
-    qcOut->totFillBits = qcOut->totFillBits + ((8 - ((qcOut->totFillBits - 7) & 0x0007)) & 0x0007);     
+    qcOut->totFillBits = qcOut->totFillBits + ((8 - ((qcOut->totFillBits - 7) & 0x0007)) & 0x0007);
   }
 
   qcOut->totFillBits = qcOut->totFillBits + nFullFillElem;
 
   /* now distribute extra fillbits and alignbits over channel elements */
   qcOut->alignBits = 7 - ((qcOut->totDynBitsUsed + qcOut->totStaticBitsUsed +
-                           qcOut->totAncBitsUsed + qcOut->totFillBits - 1) & 0x0007);             
+                           qcOut->totAncBitsUsed + qcOut->totFillBits - 1) & 0x0007);
 
-     
+
   if ( (qcOut->alignBits + qcOut->totFillBits - totFillBits == 8) &&
        (qcOut->totFillBits > 8))
     qcOut->totFillBits = qcOut->totFillBits - 8;
 
-   
+
   diffBits = qcOut->alignBits + qcOut->totFillBits - totFillBits;
-   
+
   if(diffBits>=0) {
     qcOut->qcElement.fillBits += diffBits;
   }
 
   bitsUsed = qcOut->totDynBitsUsed + qcOut->totStaticBitsUsed + qcOut->totAncBitsUsed;
   bitsUsed = bitsUsed + qcOut->totFillBits + qcOut->alignBits;
-   
+
   if (bitsUsed > qcKernel->maxBitsTot) {
     return -1;
   }
@@ -564,9 +564,9 @@
   codeBitsLast = hQC->averageBitsTot - hQC->globStatBits;
   codeBits     = frameLen - hQC->globStatBits;
 
-  /* calculate bits for every channel element */   
+  /* calculate bits for every channel element */
   if (codeBits != codeBitsLast) {
-    Word16 totalBits = 0;                                       
+    Word16 totalBits = 0;
 
     hQC->elementBits.averageBits = (hQC->elementBits.relativeBits * codeBits) >> 16; /* relativeBits was scaled down by 2 */
     totalBits += hQC->elementBits.averageBits;
@@ -574,7 +574,7 @@
     hQC->elementBits.averageBits = hQC->elementBits.averageBits + (codeBits - totalBits);
   }
 
-  hQC->averageBitsTot = frameLen;                        
+  hQC->averageBitsTot = frameLen;
 
   return 0;
 }
diff --git a/media/libstagefright/codecs/aacenc/src/quantize.c b/media/libstagefright/codecs/aacenc/src/quantize.c
index 973554e..54add2f 100644
--- a/media/libstagefright/codecs/aacenc/src/quantize.c
+++ b/media/libstagefright/codecs/aacenc/src/quantize.c
@@ -34,32 +34,32 @@
 
 /*****************************************************************************
 *
-* function name:pow34 
-* description: calculate $x^{\frac{3}{4}}, for 0.5 < x < 1.0$.  
+* function name:pow34
+* description: calculate $x^{\frac{3}{4}}, for 0.5 < x < 1.0$.
 *
 *****************************************************************************/
 __inline Word32 pow34(Word32 x)
 {
   /* index table using MANT_DIGITS bits, but mask out the sign bit and the MSB
-     which is always one */   
+     which is always one */
   return mTab_3_4[(x >> (INT_BITS-2-MANT_DIGITS)) & (MANT_SIZE-1)];
 }
 
 
 /*****************************************************************************
 *
-* function name:quantizeSingleLine 
-* description: quantizes spectrum  
-*              quaSpectrum = mdctSpectrum^3/4*2^(-(3/16)*gain)    
+* function name:quantizeSingleLine
+* description: quantizes spectrum
+*              quaSpectrum = mdctSpectrum^3/4*2^(-(3/16)*gain)
 *
 *****************************************************************************/
 static Word16 quantizeSingleLine(const Word16 gain, const Word32 absSpectrum)
 {
   Word32 e, minusFinalExp, finalShift;
   Word32 x;
-  Word16 qua = 0;                        
+  Word16 qua = 0;
 
-   
+
   if (absSpectrum) {
     e = norm_l(absSpectrum);
     x = pow34(absSpectrum << e);
@@ -71,7 +71,7 @@
 
     /* separate the exponent into a shift, and a multiply */
     finalShift = minusFinalExp >> 4;
-     
+
     if (finalShift < INT_BITS) {
       x = L_mpy_wx(x, pow2tominusNover16[minusFinalExp & 15]);
 
@@ -84,7 +84,7 @@
 		  x >>= finalShift;
 	  else
 		  x <<= (-finalShift);
-		
+
 	  qua = saturate(x);
     }
   }
@@ -94,10 +94,10 @@
 
 /*****************************************************************************
 *
-* function name:quantizeLines 
-* description: quantizes spectrum lines  
-*              quaSpectrum = mdctSpectrum^3/4*2^(-(3/16)*gain)    
-*  input: global gain, number of lines to process, spectral data         
+* function name:quantizeLines
+* description: quantizes spectrum lines
+*              quaSpectrum = mdctSpectrum^3/4*2^(-(3/16)*gain)
+*  input: global gain, number of lines to process, spectral data
 *  output: quantized spectrum
 *
 *****************************************************************************/
@@ -116,15 +116,15 @@
   pquat = quantBorders[m];
 
   g += 16;
-  
+
   if(g >= 0)
   {
 	for (line=0; line<noOfLines; line++) {
 	  Word32 qua;
-	  qua = 0;                                                     
-    
+	  qua = 0;
+
 	  mdctSpeL = mdctSpectrum[line];
-	
+
 	  if (mdctSpeL) {
 		Word32 sa;
 		Word32 saShft;
@@ -134,27 +134,27 @@
 	    saShft = sa >> g;
 
         if (saShft > pquat[0]) {
-         
+
           if (saShft < pquat[1]) {
-             
+
             qua = mdctSpeL>0 ? 1 : -1;
 		  }
           else {
-           
+
             if (saShft < pquat[2]) {
-               
+
               qua = mdctSpeL>0 ? 2 : -2;
 			}
             else {
-             
+
               if (saShft < pquat[3]) {
-                 
+
                 qua = mdctSpeL>0 ? 3 : -3;
 			  }
               else {
                 qua = quantizeSingleLine(gain, sa);
                 /* adjust the sign. Since 0 < qua < 1, this cannot overflow. */
-               
+
                 if (mdctSpeL < 0)
                   qua = -qua;
 			  }
@@ -162,17 +162,17 @@
 		  }
 		}
 	  }
-      quaSpectrum[line] = qua ;                                    
+      quaSpectrum[line] = qua ;
 	}
   }
   else
   {
 	for (line=0; line<noOfLines; line++) {
 	  Word32 qua;
-	  qua = 0;                                                     
-    
+	  qua = 0;
+
 	  mdctSpeL = mdctSpectrum[line];
-	
+
 	  if (mdctSpeL) {
 		Word32 sa;
 		Word32 saShft;
@@ -181,27 +181,27 @@
         saShft = sa << g;
 
         if (saShft > pquat[0]) {
-         
+
           if (saShft < pquat[1]) {
-             
+
             qua = mdctSpeL>0 ? 1 : -1;
 		  }
           else {
-           
+
             if (saShft < pquat[2]) {
-               
+
               qua = mdctSpeL>0 ? 2 : -2;
 			}
             else {
-             
+
               if (saShft < pquat[3]) {
-                 
+
                 qua = mdctSpeL>0 ? 3 : -3;
 			  }
               else {
                 qua = quantizeSingleLine(gain, sa);
                 /* adjust the sign. Since 0 < qua < 1, this cannot overflow. */
-               
+
                 if (mdctSpeL < 0)
                   qua = -qua;
 			  }
@@ -209,8 +209,8 @@
 		  }
 		}
 	  }
-      quaSpectrum[line] = qua ;                                    
-	}	  
+      quaSpectrum[line] = qua ;
+	}
   }
 
 }
@@ -218,10 +218,10 @@
 
 /*****************************************************************************
 *
-* function name:iquantizeLines 
+* function name:iquantizeLines
 * description: iquantizes spectrum lines without sign
-*              mdctSpectrum = iquaSpectrum^4/3 *2^(0.25*gain) 
-* input: global gain, number of lines to process,quantized spectrum        
+*              mdctSpectrum = iquaSpectrum^4/3 *2^(0.25*gain)
+* input: global gain, number of lines to process,quantized spectrum
 * output: spectral data
 *
 *****************************************************************************/
@@ -234,11 +234,11 @@
   Word32   iquantizershift;
   Word32   line;
 
-  iquantizermod = gain & 3;                              
+  iquantizermod = gain & 3;
   iquantizershift = gain >> 2;
 
   for (line=0; line<noOfLines; line++) {
-     
+
     if( quantSpectrum[line] != 0 ) {
       Word32 accu;
       Word32 ex;
@@ -252,19 +252,19 @@
       accu = accu << ex;
       specExp = INT_BITS-1 - ex;
 
-      tabIndex = (accu >> (INT_BITS-2-MANT_DIGITS)) & (~MANT_SIZE);        
+      tabIndex = (accu >> (INT_BITS-2-MANT_DIGITS)) & (~MANT_SIZE);
 
       /* calculate "mantissa" ^4/3 */
-      s = mTab_4_3[tabIndex];                                                    
+      s = mTab_4_3[tabIndex];
 
       /* get approperiate exponent multiplier for specExp^3/4 combined with scfMod */
-      t = specExpMantTableComb_enc[iquantizermod][specExp];                      
+      t = specExpMantTableComb_enc[iquantizermod][specExp];
 
       /* multiply "mantissa" ^4/3 with exponent multiplier */
       accu = MULHIGH(s, t);
 
       /* get approperiate exponent shifter */
-      specExp = specExpTableComb_enc[iquantizermod][specExp];                    
+      specExp = specExpTableComb_enc[iquantizermod][specExp];
 
       specExp += iquantizershift + 1;
 	  if(specExp >= 0)
@@ -273,7 +273,7 @@
 		  mdctSpectrum[line] = accu >> (-specExp);
     }
     else {
-      mdctSpectrum[line] = 0;                                                    
+      mdctSpectrum[line] = 0;
     }
   }
 }
@@ -301,7 +301,7 @@
   for(sfbOffs=0;sfbOffs<sfbCnt;sfbOffs+=sfbPerGroup) {
     Word32 sfbNext ;
     for (sfb = 0; sfb < maxSfbPerGroup; sfb = sfbNext) {
-      Word16 scalefactor = scalefactors[sfbOffs+sfb];                          
+      Word16 scalefactor = scalefactors[sfbOffs+sfb];
       /* coalesce sfbs with the same scalefactor */
       for (sfbNext = sfb+1;
            sfbNext < maxSfbPerGroup && scalefactor == scalefactors[sfbOffs+sfbNext];
@@ -318,7 +318,7 @@
 
 /*****************************************************************************
 *
-* function name:calcSfbDist 
+* function name:calcSfbDist
 * description: quantizes and requantizes lines to calculate distortion
 * input:  number of lines to be quantized, ...
 * output: distortion
@@ -338,14 +338,14 @@
 
   pquat = quantBorders[m];
   repquat = quantRecon[m];
-	
-  dist = 0;  
+
+  dist = 0;
   g += 16;
   if(g2 < 0 && g >= 0)
-  {	  
+  {
 	  g2 = -g2;
-	  for(line=0; line<sfbWidth; line++) {		  
-		  if (spec[line]) {			  
+	  for(line=0; line<sfbWidth; line++) {
+		  if (spec[line]) {
 			  Word32 diff;
 			  Word32 distSingle;
 			  Word32 sa;
@@ -359,19 +359,19 @@
 				  distSingle = (saShft * saShft) >> g2;
 			  }
 			  else {
-				  
+
 				  if (saShft < pquat[1]) {
 					  diff = saShft - repquat[0];
 					  distSingle = (diff * diff) >> g2;
 				  }
 				  else {
-					  
+
 					  if (saShft < pquat[2]) {
 						  diff = saShft - repquat[1];
 						  distSingle = (diff * diff) >> g2;
 					  }
 					  else {
-						  
+
 						  if (saShft < pquat[3]) {
 							  diff = saShft - repquat[2];
 							  distSingle = (diff * diff) >> g2;
@@ -387,15 +387,15 @@
 					  }
 				  }
 			  }
-			  
+
 			  dist = L_add(dist, distSingle);
 		  }
 	  }
   }
   else
   {
-	  for(line=0; line<sfbWidth; line++) {		  
-		  if (spec[line]) {			  
+	  for(line=0; line<sfbWidth; line++) {
+		  if (spec[line]) {
 			  Word32 diff;
 			  Word32 distSingle;
 			  Word32 sa;
@@ -408,19 +408,19 @@
 				  distSingle = L_shl((saShft * saShft), g2);
 			  }
 			  else {
-				  
+
 				  if (saShft < pquat[1]) {
 					  diff = saShft - repquat[0];
 					  distSingle = L_shl((diff * diff), g2);
 				  }
 				  else {
-					  
+
 					  if (saShft < pquat[2]) {
 						  diff = saShft - repquat[1];
 						  distSingle = L_shl((diff * diff), g2);
 					  }
 					  else {
-						  
+
 						  if (saShft < pquat[3]) {
 							  diff = saShft - repquat[2];
 							  distSingle = L_shl((diff * diff), g2);
@@ -438,7 +438,7 @@
 			  }
 			  dist = L_add(dist, distSingle);
 		  }
-	  }	  
+	  }
   }
 
   return dist;
diff --git a/media/libstagefright/codecs/aacenc/src/sf_estim.c b/media/libstagefright/codecs/aacenc/src/sf_estim.c
index ffe2e83..fe40137 100644
--- a/media/libstagefright/codecs/aacenc/src/sf_estim.c
+++ b/media/libstagefright/codecs/aacenc/src/sf_estim.c
@@ -30,17 +30,17 @@
 static const Word16 MAX_SCF_DELTA = 60;
 
 /*!
-constants reference in comments 
+constants reference in comments
 
  C0 = 6.75f;
- C1 = -69.33295f;   -16/3*log(MAX_QUANT+0.5-logCon)/log(2) 
+ C1 = -69.33295f;   -16/3*log(MAX_QUANT+0.5-logCon)/log(2)
  C2 = 4.0f;
  C3 = 2.66666666f;
- 
-  PE_C1 = 3.0f;        log(8.0)/log(2) 
-  PE_C2 = 1.3219281f;  log(2.5)/log(2) 
-  PE_C3 = 0.5593573f;  1-C2/C1 
-  
+
+  PE_C1 = 3.0f;        log(8.0)/log(2)
+  PE_C2 = 1.3219281f;  log(2.5)/log(2)
+  PE_C3 = 0.5593573f;  1-C2/C1
+
 */
 
 #define FF_SQRT_BITS                    7
@@ -55,15 +55,15 @@
 /*********************************************************************************
 *
 * function name: formfac_sqrt
-* description:  calculates sqrt(x)/256 
+* description:  calculates sqrt(x)/256
 *
 **********************************************************************************/
 __inline Word32 formfac_sqrt(Word32 x)
 {
 	Word32 y;
 	Word32 preshift, postshift;
-	
-	
+
+
 	if (x==0) return 0;
 	preshift  = norm_l(x) - (INT_BITS-1-FF_SQRT_BITS);
 	postshift = preshift >> 1;
@@ -74,12 +74,12 @@
 	else
 		y = x >> (-preshift);
 	y = formfac_sqrttable[y-32];
-	
+
 	if(postshift >= 0)
 		y = y >> postshift;
 	else
 		y = y << (-postshift);
-	
+
 	return y;
 }
 
@@ -100,19 +100,19 @@
 	Word32 sfbw, sfbw1;
 	Word32 i, j;
 	Word32 sfbOffs, sfb, shift;
-	
+
 	sfbw = sfbw1 = 0;
 	for (sfbOffs=0; sfbOffs<psyOutChan->sfbCnt; sfbOffs+=psyOutChan->sfbPerGroup){
 		for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
-			i = sfbOffs+sfb;      
-			
+			i = sfbOffs+sfb;
+
 			if (psyOutChan->sfbEnergy[i] > psyOutChan->sfbThreshold[i]) {
 				Word32 accu, avgFormFactor,iSfbWidth;
 				Word32 *mdctSpec;
 				sfbw = psyOutChan->sfbOffsets[i+1] - psyOutChan->sfbOffsets[i];
 				iSfbWidth = invSBF[(sfbw >> 2) - 1];
 				mdctSpec = psyOutChan->mdctSpectrum + psyOutChan->sfbOffsets[i];
-				accu = 0;                                                                       
+				accu = 0;
 				/* calc sum of sqrt(spec) */
 				for (j=sfbw; j; j--) {
 					accu += formfac_sqrt(L_abs(*mdctSpec)); mdctSpec++;
@@ -129,7 +129,7 @@
 			}
 			else {
 				/* set number of lines to zero */
-				sfbNRelevantLines[i] = 0;                                                       
+				sfbNRelevantLines[i] = 0;
 			}
 		}
 	}
@@ -141,68 +141,68 @@
 * description:  find better scalefactor with analysis by synthesis
 *
 **********************************************************************************/
-static Word16 improveScf(Word32 *spec, 
-                         Word16  sfbWidth, 
-                         Word32  thresh, 
+static Word16 improveScf(Word32 *spec,
+                         Word16  sfbWidth,
+                         Word32  thresh,
                          Word16  scf,
                          Word16  minScf,
-                         Word32 *dist, 
+                         Word32 *dist,
                          Word16 *minScfCalculated)
 {
 	Word32 cnt;
 	Word32 sfbDist;
 	Word32 scfBest;
 	Word32 thresh125 = L_add(thresh, (thresh >> 2));
-	
-	scfBest = scf;                                                       
-	
+
+	scfBest = scf;
+
 	/* calc real distortion */
 	sfbDist = calcSfbDist(spec, sfbWidth, scf);
-	*minScfCalculated = scf;     
+	*minScfCalculated = scf;
 	if(!sfbDist)
 	  return scfBest;
-	
+
 	if (sfbDist > thresh125) {
 		Word32 scfEstimated;
 		Word32 sfbDistBest;
-		scfEstimated = scf;                                               
-		sfbDistBest = sfbDist;                                            
-		
-		cnt = 0;                                                          
+		scfEstimated = scf;
+		sfbDistBest = sfbDist;
+
+		cnt = 0;
 		while (sfbDist > thresh125 && (cnt < 3)) {
-			
+
 			scf = scf + 1;
 			sfbDist = calcSfbDist(spec, sfbWidth, scf);
-			
+
 			if (sfbDist < sfbDistBest) {
-				scfBest = scf;                                              
-				sfbDistBest = sfbDist;                                      
+				scfBest = scf;
+				sfbDistBest = sfbDist;
 			}
 			cnt = cnt + 1;
 		}
-		cnt = 0;                                                          
-		scf = scfEstimated;                                               
-		sfbDist = sfbDistBest;                                            
+		cnt = 0;
+		scf = scfEstimated;
+		sfbDist = sfbDistBest;
 		while ((sfbDist > thresh125) && (cnt < 1) && (scf > minScf)) {
-			
+
 			scf = scf - 1;
 			sfbDist = calcSfbDist(spec, sfbWidth, scf);
-			
+
 			if (sfbDist < sfbDistBest) {
-				scfBest = scf;                                              
-				sfbDistBest = sfbDist;                                      
+				scfBest = scf;
+				sfbDistBest = sfbDist;
 			}
-			*minScfCalculated = scf;                                       
+			*minScfCalculated = scf;
 			cnt = cnt + 1;
 		}
-		*dist = sfbDistBest;                                              
+		*dist = sfbDistBest;
 	}
 	else {
-		Word32 sfbDistBest; 
+		Word32 sfbDistBest;
 		Word32 sfbDistAllowed;
 		Word32 thresh08 = fixmul(COEF08_31, thresh);
-		sfbDistBest = sfbDist;                                            
-		
+		sfbDistBest = sfbDist;
+
 		if (sfbDist < thresh08)
 			sfbDistAllowed = sfbDist;
 		else
@@ -210,16 +210,16 @@
 		for (cnt=0; cnt<3; cnt++) {
 			scf = scf + 1;
 			sfbDist = calcSfbDist(spec, sfbWidth, scf);
-			
+
 			if (fixmul(COEF08_31,sfbDist) < sfbDistAllowed) {
 				*minScfCalculated = scfBest + 1;
-				scfBest = scf;                                              
-				sfbDistBest = sfbDist;                                      
+				scfBest = scf;
+				sfbDistBest = sfbDist;
 			}
 		}
-		*dist = sfbDistBest;                                              
+		*dist = sfbDistBest;
 	}
-	
+
 	/* return best scalefactor */
 	return scfBest;
 }
@@ -233,10 +233,10 @@
 static Word16 countSingleScfBits(Word16 scf, Word16 scfLeft, Word16 scfRight)
 {
 	Word16 scfBits;
-	
+
 	scfBits = bitCountScalefactorDelta(scfLeft - scf) +
 		bitCountScalefactorDelta(scf - scfRight);
-	
+
 	return scfBits;
 }
 
@@ -245,7 +245,7 @@
 * function name: calcSingleSpecPe
 * description:  ldRatio = log2(en(n)) - 0,375*scfGain(n)
 *				nbits = 0.7*nLines*ldRation for ldRation >= c1
-*				nbits = 0.7*nLines*(c2 + c3*ldRatio) for ldRation < c1 
+*				nbits = 0.7*nLines*(c2 + c3*ldRatio) for ldRation < c1
 *
 **********************************************************************************/
 static Word16 calcSingleSpecPe(Word16 scf, Word16 sfbConstPePart, Word16 nLines)
@@ -253,18 +253,18 @@
 	Word32 specPe;
 	Word32 ldRatio;
 	Word32 scf3;
-	
+
 	ldRatio = sfbConstPePart << 3; /*  (sfbConstPePart -0.375*scf)*8 */
 	scf3 = scf + scf + scf;
 	ldRatio = ldRatio - scf3;
-    
+
 	if (ldRatio < PE_C1_8) {
-		/* 21 : 2*8*PE_C2, 2*PE_C3 ~ 1*/ 
+		/* 21 : 2*8*PE_C2, 2*PE_C3 ~ 1*/
 		ldRatio = (ldRatio + PE_C2_16) >> 1;
 	}
 	specPe = nLines * ldRatio;
 	specPe = (specPe * PE_SCALE) >> 14;
-	
+
 	return saturate(specPe);
 }
 
@@ -275,53 +275,53 @@
 * description:  count different scf bits used
 *
 **********************************************************************************/
-static Word16 countScfBitsDiff(Word16 *scfOld, Word16 *scfNew, 
+static Word16 countScfBitsDiff(Word16 *scfOld, Word16 *scfNew,
                                Word16 sfbCnt, Word16 startSfb, Word16 stopSfb)
 {
 	Word32 scfBitsDiff;
 	Word32 sfb, sfbLast;
 	Word32 sfbPrev, sfbNext;
-	
-	scfBitsDiff = 0;                                                      
-	sfb = 0;                                                              
-	
+
+	scfBitsDiff = 0;
+	sfb = 0;
+
 	/* search for first relevant sfb */
-	sfbLast = startSfb;                                                   
+	sfbLast = startSfb;
 	while (sfbLast < stopSfb && scfOld[sfbLast] == VOAAC_SHRT_MIN) {
-		
+
 		sfbLast = sfbLast + 1;
 	}
 	/* search for previous relevant sfb and count diff */
 	sfbPrev = startSfb - 1;
 	while ((sfbPrev>=0) && scfOld[sfbPrev] == VOAAC_SHRT_MIN) {
-		
+
 		sfbPrev = sfbPrev - 1;
 	}
-	
+
 	if (sfbPrev>=0) {
 		scfBitsDiff += bitCountScalefactorDelta(scfNew[sfbPrev] - scfNew[sfbLast]) -
 			bitCountScalefactorDelta(scfOld[sfbPrev] - scfOld[sfbLast]);
 	}
 	/* now loop through all sfbs and count diffs of relevant sfbs */
 	for (sfb=sfbLast+1; sfb<stopSfb; sfb++) {
-		
+
 		if (scfOld[sfb] != VOAAC_SHRT_MIN) {
 			scfBitsDiff += bitCountScalefactorDelta(scfNew[sfbLast] - scfNew[sfb]) -
 				bitCountScalefactorDelta(scfOld[sfbLast] - scfOld[sfb]);
-			sfbLast = sfb;                                                    
+			sfbLast = sfb;
 		}
 	}
 	/* search for next relevant sfb and count diff */
-	sfbNext = stopSfb;                                                    
+	sfbNext = stopSfb;
 	while (sfbNext < sfbCnt && scfOld[sfbNext] == VOAAC_SHRT_MIN) {
-		
+
 		sfbNext = sfbNext + 1;
 	}
-	
+
 	if (sfbNext < sfbCnt)
 		scfBitsDiff += bitCountScalefactorDelta(scfNew[sfbLast] - scfNew[sfbNext]) -
 		bitCountScalefactorDelta(scfOld[sfbLast] - scfOld[sfbNext]);
-	
+
 	return saturate(scfBitsDiff);
 }
 
@@ -331,52 +331,52 @@
                              Word16 *logSfbEnergy,
                              Word16 *logSfbFormFactor,
                              Word16 *sfbNRelevantLines,
-                             Word16 startSfb, 
+                             Word16 startSfb,
                              Word16 stopSfb)
 {
 	Word32 specPeDiff;
 	Word32 sfb;
-	
-	specPeDiff = 0;                                                       
-	
+
+	specPeDiff = 0;
+
 	/* loop through all sfbs and count pe difference */
 	for (sfb=startSfb; sfb<stopSfb; sfb++) {
-		
-		
+
+
 		if (scfOld[sfb] != VOAAC_SHRT_MIN) {
 			Word32 ldRatioOld, ldRatioNew;
 			Word32 scf3;
-			
-			
+
+
 			if (sfbConstPePart[sfb] == MIN_16) {
 				sfbConstPePart[sfb] = ((logSfbEnergy[sfb] -
 					logSfbFormFactor[sfb]) + 11-8*4+3) >> 2;
 			}
-			
-			
+
+
 			ldRatioOld = sfbConstPePart[sfb] << 3;
 			scf3 = scfOld[sfb] + scfOld[sfb] + scfOld[sfb];
 			ldRatioOld = ldRatioOld - scf3;
 			ldRatioNew = sfbConstPePart[sfb] << 3;
 			scf3 = scfNew[sfb] + scfNew[sfb] + scfNew[sfb];
 			ldRatioNew = ldRatioNew - scf3;
-			
+
 			if (ldRatioOld < PE_C1_8) {
 				/* 21 : 2*8*PE_C2, 2*PE_C3 ~ 1*/
 				ldRatioOld = (ldRatioOld + PE_C2_16) >> 1;
 			}
-			
+
 			if (ldRatioNew < PE_C1_8) {
 				/* 21 : 2*8*PE_C2, 2*PE_C3 ~ 1*/
 				ldRatioNew = (ldRatioNew + PE_C2_16) >> 1;
 			}
-			
+
 			specPeDiff +=  sfbNRelevantLines[sfb] * (ldRatioNew - ldRatioOld);
 		}
 	}
-	
+
 	specPeDiff = (specPeDiff * PE_SCALE) >> 14;
-	
+
 	return saturate(specPeDiff);
 }
 
@@ -390,9 +390,9 @@
 *
 **********************************************************************************/
 static void assimilateSingleScf(PSY_OUT_CHANNEL *psyOutChan,
-                                Word16 *scf, 
+                                Word16 *scf,
                                 Word16 *minScf,
-                                Word32 *sfbDist, 
+                                Word32 *sfbDist,
                                 Word16 *sfbConstPePart,
                                 Word16 *logSfbEnergy,
                                 Word16 *logSfbFormFactor,
@@ -411,94 +411,94 @@
 	Word16 *prevScfNext = psyOutChan->prevScfNext;
 	Word16 *deltaPeLast = psyOutChan->deltaPeLast;
 	Flag   updateMinScfCalculated;
-	
-	success = 0;                                                                  
-	deltaPe = 0;                                                                  
-	
+
+	success = 0;
+	deltaPe = 0;
+
 	for(j=0;j<psyOutChan->sfbCnt;j++){
-		prevScfLast[j] = MAX_16;                                                    
-		prevScfNext[j] = MAX_16;                                                    
-		deltaPeLast[j] = MAX_16;                                                    
+		prevScfLast[j] = MAX_16;
+		prevScfNext[j] = MAX_16;
+		deltaPeLast[j] = MAX_16;
 	}
-	
-	sfbLast = -1;                                                                 
-	sfbAct = -1;                                                                  
-	sfbNext = -1;                                                                 
+
+	sfbLast = -1;
+	sfbAct = -1;
+	sfbNext = -1;
 	scfLast = 0;
 	scfNext = 0;
-	scfMin = MAX_16;                                                              
+	scfMin = MAX_16;
 	do {
 		/* search for new relevant sfb */
 		sfbNext = sfbNext + 1;
 		while (sfbNext < psyOutChan->sfbCnt && scf[sfbNext] == MIN_16) {
-			
+
 			sfbNext = sfbNext + 1;
 		}
-		
+
 		if ((sfbLast>=0) && (sfbAct>=0) && sfbNext < psyOutChan->sfbCnt) {
 			/* relevant scfs to the left and to the right */
-			scfAct  = scf[sfbAct];                                                    
+			scfAct  = scf[sfbAct];
 			scfLast = scf + sfbLast;
 			scfNext = scf + sfbNext;
 			scfMin  = min(*scfLast, *scfNext);
 		}
 		else {
-			
+
 			if (sfbLast == -1 && (sfbAct>=0) && sfbNext < psyOutChan->sfbCnt) {
 				/* first relevant scf */
-				scfAct  = scf[sfbAct];                                                  
+				scfAct  = scf[sfbAct];
 				scfLast = &scfAct;
 				scfNext = scf + sfbNext;
-				scfMin  = *scfNext;                                                     
+				scfMin  = *scfNext;
 			}
 			else {
-				
+
 				if ((sfbLast>=0) && (sfbAct>=0) && sfbNext == psyOutChan->sfbCnt) {
 					/* last relevant scf */
-					scfAct  = scf[sfbAct];                                                
+					scfAct  = scf[sfbAct];
 					scfLast = scf + sfbLast;
 					scfNext = &scfAct;
-					scfMin  = *scfLast;                                                   
+					scfMin  = *scfLast;
 				}
 			}
 		}
-		
+
 		if (sfbAct>=0)
 			scfMin = max(scfMin, minScf[sfbAct]);
-		
-		if ((sfbAct >= 0) && 
-			(sfbLast>=0 || sfbNext < psyOutChan->sfbCnt) && 
-			scfAct > scfMin && 
-			(*scfLast != prevScfLast[sfbAct] || 
-			*scfNext != prevScfNext[sfbAct] || 
+
+		if ((sfbAct >= 0) &&
+			(sfbLast>=0 || sfbNext < psyOutChan->sfbCnt) &&
+			scfAct > scfMin &&
+			(*scfLast != prevScfLast[sfbAct] ||
+			*scfNext != prevScfNext[sfbAct] ||
 			deltaPe < deltaPeLast[sfbAct])) {
-			success = 0;                                                              
-			
-			/* estimate required bits for actual scf */			
+			success = 0;
+
+			/* estimate required bits for actual scf */
 			if (sfbConstPePart[sfbAct] == MIN_16) {
 				sfbConstPePart[sfbAct] = logSfbEnergy[sfbAct] -
 					logSfbFormFactor[sfbAct] + 11-8*4; /* 4*log2(6.75) - 32 */
-				
+
 				if (sfbConstPePart[sfbAct] < 0)
 					sfbConstPePart[sfbAct] = sfbConstPePart[sfbAct] + 3;
 				sfbConstPePart[sfbAct] = sfbConstPePart[sfbAct] >> 2;
 			}
-			
+
 			sfbPeOld = calcSingleSpecPe(scfAct, sfbConstPePart[sfbAct], sfbNRelevantLines[sfbAct]) +
 				countSingleScfBits(scfAct, *scfLast, *scfNext);
-			deltaPeNew = deltaPe;                                                     
-			updateMinScfCalculated = 1;                                               
+			deltaPeNew = deltaPe;
+			updateMinScfCalculated = 1;
 			do {
 				scfAct = scfAct - 1;
 				/* check only if the same check was not done before */
-				
+
 				if (scfAct < minScfCalculated[sfbAct]) {
 					sfbPeNew = calcSingleSpecPe(scfAct, sfbConstPePart[sfbAct], sfbNRelevantLines[sfbAct]) +
 						countSingleScfBits(scfAct, *scfLast, *scfNext);
-					/* use new scf if no increase in pe and 
+					/* use new scf if no increase in pe and
 					quantization error is smaller */
 					deltaPeTmp = deltaPe + sfbPeNew - sfbPeOld;
-					
+
 					if (deltaPeTmp < 10) {
 						sfbDistNew = calcSfbDist(psyOutChan->mdctSpectrum+
 							psyOutChan->sfbOffsets[sfbAct],
@@ -506,46 +506,46 @@
 							scfAct);
 						if (sfbDistNew < sfbDist[sfbAct]) {
 							/* success, replace scf by new one */
-							scf[sfbAct] = scfAct;                                     
-							sfbDist[sfbAct] = sfbDistNew;                             
-							deltaPeNew = deltaPeTmp;                                  
-							success = 1;                                              
+							scf[sfbAct] = scfAct;
+							sfbDist[sfbAct] = sfbDistNew;
+							deltaPeNew = deltaPeTmp;
+							success = 1;
 						}
 						/* mark as already checked */
-						
+
 						if (updateMinScfCalculated) {
-							minScfCalculated[sfbAct] = scfAct;                        
+							minScfCalculated[sfbAct] = scfAct;
 						}
 					}
 					else {
-						updateMinScfCalculated = 0;                                 
+						updateMinScfCalculated = 0;
 					}
 				}
-				
+
 			} while (scfAct > scfMin);
-			deltaPe = deltaPeNew;                                             
+			deltaPe = deltaPeNew;
 			/* save parameters to avoid multiple computations of the same sfb */
-			prevScfLast[sfbAct] = *scfLast;                                   
-			prevScfNext[sfbAct] = *scfNext;                                   
-			deltaPeLast[sfbAct] = deltaPe;                                    
+			prevScfLast[sfbAct] = *scfLast;
+			prevScfNext[sfbAct] = *scfNext;
+			deltaPeLast[sfbAct] = deltaPe;
 		}
-		
+
 		if (success && restartOnSuccess) {
 			/* start again at first sfb */
-			sfbLast = -1;                                                     
-			sfbAct  = -1;                                                     
-			sfbNext = -1;                                                     
+			sfbLast = -1;
+			sfbAct  = -1;
+			sfbNext = -1;
 			scfLast = 0;
 			scfNext = 0;
-			scfMin  = MAX_16;                                                 
-			success = 0;                                                      
+			scfMin  = MAX_16;
+			success = 0;
 		}
 		else {
 			/* shift sfbs for next band */
-			sfbLast = sfbAct;                                                 
-			sfbAct  = sfbNext;                                                
+			sfbLast = sfbAct;
+			sfbAct  = sfbNext;
 		}
-		
+
   } while (sfbNext < psyOutChan->sfbCnt);
 }
 
@@ -557,9 +557,9 @@
 *
 **********************************************************************************/
 static void assimilateMultipleScf(PSY_OUT_CHANNEL *psyOutChan,
-                                  Word16 *scf, 
+                                  Word16 *scf,
                                   Word16 *minScf,
-                                  Word32 *sfbDist, 
+                                  Word32 *sfbDist,
                                   Word16 *sfbConstPePart,
                                   Word16 *logSfbEnergy,
                                   Word16 *logSfbFormFactor,
@@ -574,95 +574,95 @@
 	Word32 *sfbDistNew = psyOutChan->sfbDistNew;
 	Word16 *scfTmp = psyOutChan->prevScfLast;
 
-	deltaPe = 0;                                                          
-	sfbCnt = psyOutChan->sfbCnt;                                          
-	
+	deltaPe = 0;
+	sfbCnt = psyOutChan->sfbCnt;
+
 	/* calc min and max scalfactors */
-	scfMin = MAX_16;                                                      
-	scfMax = MIN_16;                                                      
+	scfMin = MAX_16;
+	scfMax = MIN_16;
 	for (sfb=0; sfb<sfbCnt; sfb++) {
-		
+
 		if (scf[sfb] != MIN_16) {
 			scfMin = min(scfMin, scf[sfb]);
 			scfMax = max(scfMax, scf[sfb]);
 		}
 	}
-	
+
 	if (scfMax !=  MIN_16) {
-		
-		scfAct = scfMax;                                             
-		
+
+		scfAct = scfMax;
+
 		do {
 			scfAct = scfAct - 1;
 			for (sfb=0; sfb<sfbCnt; sfb++) {
-				scfTmp[sfb] = scf[sfb];                                         
+				scfTmp[sfb] = scf[sfb];
 			}
-			stopSfb = 0;                                                      
+			stopSfb = 0;
 			do {
-				sfb = stopSfb;                                                  
-				
+				sfb = stopSfb;
+
 				while (sfb < sfbCnt && (scf[sfb] == MIN_16 || scf[sfb] <= scfAct)) {
 					sfb = sfb + 1;
 				}
-				startSfb = sfb;                                                 
+				startSfb = sfb;
 				sfb = sfb + 1;
-				
+
 				while (sfb < sfbCnt && (scf[sfb] == MIN_16 || scf[sfb] > scfAct)) {
 					sfb = sfb + 1;
 				}
-				stopSfb = sfb;                                                  
-				
-				possibleRegionFound = 0;                                        
-				
+				stopSfb = sfb;
+
+				possibleRegionFound = 0;
+
 				if (startSfb < sfbCnt) {
-					possibleRegionFound = 1;                                      
+					possibleRegionFound = 1;
 					for (sfb=startSfb; sfb<stopSfb; sfb++) {
-						
+
 						if (scf[sfb]!=MIN_16) {
-							
+
 							if (scfAct < minScf[sfb]) {
-								possibleRegionFound = 0;                                
+								possibleRegionFound = 0;
 								break;
 							}
 						}
 					}
 				}
-				
-				
+
+
 				if (possibleRegionFound) { /* region found */
-					
+
 					/* replace scfs in region by scfAct */
 					for (sfb=startSfb; sfb<stopSfb; sfb++) {
-						
+
 						if (scfTmp[sfb]!=MIN_16)
-							scfTmp[sfb] = scfAct;                                     
+							scfTmp[sfb] = scfAct;
 					}
-					
+
 					/* estimate change in bit demand for new scfs */
 					deltaScfBits = countScfBitsDiff(scf,scfTmp,sfbCnt,startSfb,stopSfb);
 					deltaSpecPe = calcSpecPeDiff(scf, scfTmp, sfbConstPePart,
-						logSfbEnergy, logSfbFormFactor, sfbNRelevantLines, 
+						logSfbEnergy, logSfbFormFactor, sfbNRelevantLines,
 						startSfb, stopSfb);
 					deltaPeNew = deltaPe + deltaScfBits + deltaSpecPe;
-					
-					
+
+
 					if (deltaPeNew < 10) {
 						Word32 distOldSum, distNewSum;
-						
+
 						/* quantize and calc sum of new distortion */
-						distOldSum = 0;                                                     
-						distNewSum = 0;                                                     
+						distOldSum = 0;
+						distNewSum = 0;
 						for (sfb=startSfb; sfb<stopSfb; sfb++) {
-							
+
 							if (scfTmp[sfb] != MIN_16) {
 								distOldSum = L_add(distOldSum, sfbDist[sfb]);
-								
+
 								sfbDistNew[sfb] = calcSfbDist(psyOutChan->mdctSpectrum +
-									psyOutChan->sfbOffsets[sfb], 
+									psyOutChan->sfbOffsets[sfb],
 									(psyOutChan->sfbOffsets[sfb+1] - psyOutChan->sfbOffsets[sfb]),
 									scfAct);
-								
-								
+
+
 								if (sfbDistNew[sfb] > psyOutChan->sfbThreshold[sfb]) {
 									distNewSum = distOldSum << 1;
 									break;
@@ -670,20 +670,20 @@
 								distNewSum = L_add(distNewSum, sfbDistNew[sfb]);
 							}
 						}
-						
+
 						if (distNewSum < distOldSum) {
-							deltaPe = deltaPeNew;                                             
+							deltaPe = deltaPeNew;
 							for (sfb=startSfb; sfb<stopSfb; sfb++) {
-								
+
 								if (scf[sfb]!=MIN_16) {
-									scf[sfb] = scfAct;                                            
-									sfbDist[sfb] = sfbDistNew[sfb];                               
+									scf[sfb] = scfAct;
+									sfbDist[sfb] = sfbDistNew[sfb];
 								}
 							}
 						}
 					}
-				}        
-			} while (stopSfb <= sfbCnt);      
+				}
+			} while (stopSfb <= sfbCnt);
 		} while (scfAct > scfMin);
 	}
 }
@@ -710,125 +710,125 @@
 	Word32 *sfbDist = psyOutChan->sfbDist;
 	Word16 *minSfMaxQuant = psyOutChan->minSfMaxQuant;
 	Word16 *minScfCalculated = psyOutChan->minScfCalculated;
-	
-	
+
+
 	for (i=0; i<psyOutChan->sfbCnt; i++) {
 		Word32 sbfwith, sbfStart;
 		Word32 *mdctSpec;
-		thresh = psyOutChan->sfbThreshold[i];                                       
-		energy = psyOutChan->sfbEnergy[i];                                          
-		
+		thresh = psyOutChan->sfbThreshold[i];
+		energy = psyOutChan->sfbEnergy[i];
+
 		sbfStart = psyOutChan->sfbOffsets[i];
 		sbfwith = psyOutChan->sfbOffsets[i+1] - sbfStart;
 		mdctSpec = psyOutChan->mdctSpectrum+sbfStart;
-		
-		maxSpec = 0;                                                                
+
+		maxSpec = 0;
 		/* maximum of spectrum */
 		for (j=sbfwith; j; j-- ) {
 			Word32 absSpec = L_abs(*mdctSpec); mdctSpec++;
-			maxSpec |= absSpec;                                                       
+			maxSpec |= absSpec;
 		}
-		
+
 		/* scfs without energy or with thresh>energy are marked with MIN_16 */
-		scf[i] = MIN_16;                                                            
-		minSfMaxQuant[i] = MIN_16;    
-		
+		scf[i] = MIN_16;
+		minSfMaxQuant[i] = MIN_16;
+
 		if ((maxSpec > 0) && (energy > thresh)) {
-			
-			energyPart = logSfbFormFactor[i];                                         
-			thresholdPart = iLog4(thresh);  
+
+			energyPart = logSfbFormFactor[i];
+			thresholdPart = iLog4(thresh);
 			/* -20 = 4*log2(6.75) - 32 */
 			scfInt = ((thresholdPart - energyPart - 20) * SCALE_ESTIMATE_COEF) >> 15;
-			
+
 			minSfMaxQuant[i] = iLog4(maxSpec) - 68; /* 68  -16/3*log(MAX_QUANT+0.5-logCon)/log(2) + 1 */
-			
-			
+
+
 			if (minSfMaxQuant[i] > scfInt) {
-				scfInt = minSfMaxQuant[i];                                              
+				scfInt = minSfMaxQuant[i];
 			}
-			
+
 			/* find better scalefactor with analysis by synthesis */
 			scfInt = improveScf(psyOutChan->mdctSpectrum+sbfStart,
 				sbfwith,
-				thresh, scfInt, minSfMaxQuant[i], 
+				thresh, scfInt, minSfMaxQuant[i],
 				&sfbDist[i], &minScfCalculated[i]);
-			
-			scf[i] = scfInt;                                                          
+
+			scf[i] = scfInt;
 		}
 	}
-	
-	
+
+
 	/* scalefactor differece reduction  */
 	{
 		Word16 sfbConstPePart[MAX_GROUPED_SFB];
 		for(i=0;i<psyOutChan->sfbCnt;i++) {
-			sfbConstPePart[i] = MIN_16;                                               
+			sfbConstPePart[i] = MIN_16;
 		}
-		
-		assimilateSingleScf(psyOutChan, scf, 
+
+		assimilateSingleScf(psyOutChan, scf,
 			minSfMaxQuant, sfbDist, sfbConstPePart, logSfbEnergy,
 			logSfbFormFactor, sfbNRelevantLines, minScfCalculated, 1);
-		
-		assimilateMultipleScf(psyOutChan, scf, 
+
+		assimilateMultipleScf(psyOutChan, scf,
 			minSfMaxQuant, sfbDist, sfbConstPePart, logSfbEnergy,
 			logSfbFormFactor, sfbNRelevantLines);
 	}
 
 	/* get max scalefac for global gain */
-	maxScf = MIN_16;                                                              
-	minScf = MAX_16;                                                              
+	maxScf = MIN_16;
+	minScf = MAX_16;
 	for (i=0; i<psyOutChan->sfbCnt; i++) {
-		
+
 		if (maxScf < scf[i]) {
-			maxScf = scf[i];                                                          
+			maxScf = scf[i];
 		}
-		
+
 		if ((scf[i] != MIN_16) && (minScf > scf[i])) {
-			minScf = scf[i];                                                          
+			minScf = scf[i];
 		}
 	}
 	/* limit scf delta */
 	maxAllowedScf = minScf + MAX_SCF_DELTA;
 	for(i=0; i<psyOutChan->sfbCnt; i++) {
-		
+
 		if ((scf[i] != MIN_16) && (maxAllowedScf < scf[i])) {
-			scf[i] = maxAllowedScf;                                                   
+			scf[i] = maxAllowedScf;
 		}
 	}
 	/* new maxScf if any scf has been limited */
-	
+
 	if (maxAllowedScf < maxScf) {
-		maxScf = maxAllowedScf;                                                     
+		maxScf = maxAllowedScf;
 	}
-	
+
 	/* calc loop scalefactors */
-	
+
 	if (maxScf > MIN_16) {
-		*globalGain = maxScf;                                                       
-		lastSf = 0;                                                                 
-		
+		*globalGain = maxScf;
+		lastSf = 0;
+
 		for(i=0; i<psyOutChan->sfbCnt; i++) {
-			
+
 			if (scf[i] == MIN_16) {
-				scf[i] = lastSf;                                                        
+				scf[i] = lastSf;
 				/* set band explicitely to zero */
 				for (j=psyOutChan->sfbOffsets[i]; j<psyOutChan->sfbOffsets[i+1]; j++) {
-					psyOutChan->mdctSpectrum[j] = 0;                                      
+					psyOutChan->mdctSpectrum[j] = 0;
 				}
 			}
 			else {
 				scf[i] = maxScf - scf[i];
-				lastSf = scf[i];                                                        
+				lastSf = scf[i];
 			}
 		}
 	}
 	else{
-		*globalGain = 0;                                                            
+		*globalGain = 0;
 		/* set spectrum explicitely to zero */
 		for(i=0; i<psyOutChan->sfbCnt; i++) {
-			scf[i] = 0;                                                               
+			scf[i] = 0;
 			for (j=psyOutChan->sfbOffsets[i]; j<psyOutChan->sfbOffsets[i+1]; j++) {
-				psyOutChan->mdctSpectrum[j] = 0;                                        
+				psyOutChan->mdctSpectrum[j] = 0;
 			}
 		}
 	}
@@ -848,7 +848,7 @@
                const Word16 nChannels)
 {
 	Word16 j;
-	
+
 	for (j=0; j<nChannels; j++) {
 		CalcFormFactorChannel(logSfbFormFactor[j], sfbNRelevantLines[j], logSfbEnergy[j], &psyOutChannel[j]);
 	}
@@ -869,7 +869,7 @@
                      const Word16    nChannels)
 {
 	Word16 j;
-	
+
 	for (j=0; j<nChannels; j++) {
 		EstimateScaleFactorsChannel(&psyOutChannel[j],
 			qcOutChannel[j].scf,
diff --git a/media/libstagefright/codecs/aacenc/src/stat_bits.c b/media/libstagefright/codecs/aacenc/src/stat_bits.c
index baa289c8..c2bd8bd 100644
--- a/media/libstagefright/codecs/aacenc/src/stat_bits.c
+++ b/media/libstagefright/codecs/aacenc/src/stat_bits.c
@@ -52,9 +52,9 @@
                               struct TOOLSINFO *toolsInfo)
 {
   Word16 msBits, sfbOff, sfb;
-  msBits = 0;                                            
+  msBits = 0;
 
-   
+
   switch(toolsInfo->msDigest) {
     case MS_NONE:
     case MS_ALL:
@@ -85,34 +85,34 @@
   Word32 coefBits;
   Word16 *ptcoef;
 
-  count = 0;       
-  
+  count = 0;
+
   if (blockType == 2)
     numOfWindows = 8;
   else
     numOfWindows = 1;
-  tnsPresent = 0;                                        
+  tnsPresent = 0;
 
   for (i=0; i<numOfWindows; i++) {
-     
+
     if (tnsInfo->tnsActive[i]!=0) {
-      tnsPresent = 1;                                    
+      tnsPresent = 1;
     }
   }
-   
+
   if (tnsPresent) {
     /* there is data to be written*/
     /*count += 1; */
     for (i=0; i<numOfWindows; i++) {
-       
+
       if (blockType == 2)
         count += 1;
       else
         count += 2;
-       
+
       if (tnsInfo->tnsActive[i]) {
         count += 1;
-         
+
         if (blockType == 2) {
           count += 4;
           count += 3;
@@ -121,29 +121,29 @@
           count += 6;
           count += 5;
         }
-         
+
         if (tnsInfo->order[i]) {
           count += 1; /*direction*/
-          count += 1; /*coef_compression */	
-           
+          count += 1; /*coef_compression */
+
           if (tnsInfo->coefRes[i] == 4) {
             ptcoef = tnsInfo->coef + i*TNS_MAX_ORDER_SHORT;
-			coefBits = 3;                                        
+			coefBits = 3;
             for(k=0; k<tnsInfo->order[i]; k++) {
-                 
+
               if ((ptcoef[k] > 3) || (ptcoef[k] < -4)) {
-                coefBits = 4;                                    
+                coefBits = 4;
                 break;
               }
             }
           }
           else {
-            coefBits = 2;                                        
+            coefBits = 2;
             ptcoef = tnsInfo->coef + i*TNS_MAX_ORDER_SHORT;
 			for(k=0; k<tnsInfo->order[i]; k++) {
-                 
+
               if ((ptcoef[k] > 1) || (ptcoef[k] < -2)) {
-                coefBits = 3;                                    
+                coefBits = 3;
                 break;
               }
             }
@@ -155,14 +155,14 @@
       }
     }
   }
-  
+
   return count;
 }
 
 /**********************************************************************************
 *
 * function name: countTnsBits
-* description:   count tns bit demand  
+* description:   count tns bit demand
 *
 **********************************************************************************/
 static Word16 countTnsBits(TNS_INFO *tnsInfo,Word16 blockType)
@@ -173,29 +173,29 @@
 /*********************************************************************************
 *
 * function name: countStaticBitdemand
-* description:   count static bit demand include tns  
+* description:   count static bit demand include tns
 *
 **********************************************************************************/
 Word16 countStaticBitdemand(PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS],
                             PSY_OUT_ELEMENT *psyOutElement,
-                            Word16 channels, 
+                            Word16 channels,
 							Word16 adtsUsed)
 {
   Word32 statBits;
   Word32 ch;
-  
-  statBits = 0;                                                  
+
+  statBits = 0;
 
   /* if adts used, add 56 bits */
   if(adtsUsed) statBits += 56;
 
-   
+
   switch (channels) {
     case 1:
       statBits += SI_ID_BITS+SI_SCE_BITS+SI_ICS_BITS;
       statBits += countTnsBits(&(psyOutChannel[0].tnsInfo),
                                psyOutChannel[0].windowSequence);
-       
+
       switch(psyOutChannel[0].windowSequence){
         case LONG_WINDOW:
         case START_WINDOW:
@@ -215,7 +215,7 @@
 								  psyOutChannel[0].sfbPerGroup,
 								  psyOutChannel[0].maxSfbPerGroup,
 								  &psyOutElement->toolsInfo);
-       
+
       switch (psyOutChannel[0].windowSequence) {
         case LONG_WINDOW:
         case START_WINDOW:
diff --git a/media/libstagefright/codecs/aacenc/src/tns.c b/media/libstagefright/codecs/aacenc/src/tns.c
index 473e0a0..455a864 100644
--- a/media/libstagefright/codecs/aacenc/src/tns.c
+++ b/media/libstagefright/codecs/aacenc/src/tns.c
@@ -100,20 +100,20 @@
   /*  assert(freq >= 0);  */
   shift = norm_l(fs);
   lineNumber = (extract_l(fixmul((bandStartOffset[numOfBands] << 2),Div_32(freq << shift,fs << shift))) + 1) >> 1;
- 
+
   /* freq > fs/2 */
-  temp = lineNumber - bandStartOffset[numOfBands] ;                                            
+  temp = lineNumber - bandStartOffset[numOfBands] ;
   if (temp >= 0)
     return numOfBands;
 
   /* find band the line number lies in */
   for (band=0; band<numOfBands; band++) {
-    temp = bandStartOffset[band + 1] - lineNumber;                                           
+    temp = bandStartOffset[band + 1] - lineNumber;
     if (temp > 0) break;
   }
 
   temp = (lineNumber - bandStartOffset[band]);
-  temp = (temp - (bandStartOffset[band + 1] - lineNumber));                                   
+  temp = (temp - (bandStartOffset[band + 1] - lineNumber));
   if ( temp > 0 )
   {
     band = band + 1;
@@ -139,25 +139,25 @@
 {
 
   Word32 bitratePerChannel;
-  tC->maxOrder     = TNS_MAX_ORDER;                                           
+  tC->maxOrder     = TNS_MAX_ORDER;
   tC->tnsStartFreq = 1275;
-  tC->coefRes      = 4;                                                                                 
-  
+  tC->coefRes      = 4;
+
   /* to avoid integer division */
-  if ( sub(channels,2) == 0 ) { 
-    bitratePerChannel = bitRate >> 1;    
+  if ( sub(channels,2) == 0 ) {
+    bitratePerChannel = bitRate >> 1;
   }
   else {
-    bitratePerChannel = bitRate;                                                                    
+    bitratePerChannel = bitRate;
   }
 
   tC->tnsMaxSfb = tnsMaxBandsLongMainLow[pC->sampRateIdx];
 
-  tC->tnsActive = active;                                                                           
+  tC->tnsActive = active;
 
   /* now calc band and line borders */
   tC->tnsStopBand = min(pC->sfbCnt, tC->tnsMaxSfb);
-  tC->tnsStopLine = pC->sfbOffset[tC->tnsStopBand];                                                 
+  tC->tnsStopLine = pC->sfbOffset[tC->tnsStopBand];
 
   tC->tnsStartBand = FreqToBandWithRounding(tC->tnsStartFreq, sampleRate,
                                             pC->sfbCnt, (const Word16*)pC->sfbOffset);
@@ -173,18 +173,18 @@
                                                      (const Word16*)pC->sfbOffset);
 
 
-  tC->tnsStartLine = pC->sfbOffset[tC->tnsStartBand];                                                                                                             
+  tC->tnsStartLine = pC->sfbOffset[tC->tnsStartBand];
 
   tC->lpcStopBand = tnsMaxBandsLongMainLow[pC->sampRateIdx];
   tC->lpcStopBand = min(tC->lpcStopBand, pC->sfbActive);
 
-  tC->lpcStopLine = pC->sfbOffset[tC->lpcStopBand];   
-  
+  tC->lpcStopLine = pC->sfbOffset[tC->lpcStopBand];
+
   tC->lpcStartBand = tnsMinBandNumberLong[pC->sampRateIdx];
 
-  tC->lpcStartLine = pC->sfbOffset[tC->lpcStartBand];                                               
+  tC->lpcStartLine = pC->sfbOffset[tC->lpcStartBand];
 
-  tC->threshold = TNS_GAIN_THRESH;                                                             
+  tC->threshold = TNS_GAIN_THRESH;
 
 
   return(0);
@@ -207,23 +207,23 @@
   Word32 bitratePerChannel;
   tC->maxOrder     = TNS_MAX_ORDER_SHORT;
   tC->tnsStartFreq = 2750;
-  tC->coefRes      = 3;                                                                                 
-  
+  tC->coefRes      = 3;
+
   /* to avoid integer division */
   if ( sub(channels,2) == 0 ) {
-    bitratePerChannel = L_shr(bitRate,1);    
+    bitratePerChannel = L_shr(bitRate,1);
   }
   else {
-    bitratePerChannel = bitRate;                                                                    
+    bitratePerChannel = bitRate;
   }
 
   tC->tnsMaxSfb = tnsMaxBandsShortMainLow[pC->sampRateIdx];
 
-  tC->tnsActive = active;                                                                           
+  tC->tnsActive = active;
 
   /* now calc band and line borders */
   tC->tnsStopBand = min(pC->sfbCnt, tC->tnsMaxSfb);
-  tC->tnsStopLine = pC->sfbOffset[tC->tnsStopBand];                                                 
+  tC->tnsStopLine = pC->sfbOffset[tC->tnsStopBand];
 
   tC->tnsStartBand=FreqToBandWithRounding(tC->tnsStartFreq, sampleRate,
                                           pC->sfbCnt, (const Word16*)pC->sfbOffset);
@@ -239,19 +239,19 @@
                                                      (const Word16*)pC->sfbOffset);
 
 
-  tC->tnsStartLine = pC->sfbOffset[tC->tnsStartBand];                                               
+  tC->tnsStartLine = pC->sfbOffset[tC->tnsStartBand];
 
   tC->lpcStopBand = tnsMaxBandsShortMainLow[pC->sampRateIdx];
 
   tC->lpcStopBand = min(tC->lpcStopBand, pC->sfbActive);
 
-  tC->lpcStopLine = pC->sfbOffset[tC->lpcStopBand];                                                 
+  tC->lpcStopLine = pC->sfbOffset[tC->lpcStopBand];
 
   tC->lpcStartBand = tnsMinBandNumberShort[pC->sampRateIdx];
 
-  tC->lpcStartLine = pC->sfbOffset[tC->lpcStartBand];                                               
+  tC->lpcStartLine = pC->sfbOffset[tC->lpcStartBand];
 
-  tC->threshold = TNS_GAIN_THRESH;                                                             
+  tC->threshold = TNS_GAIN_THRESH;
 
   return(0);
 }
@@ -259,7 +259,7 @@
 /**
 *
 * function name: TnsDetect
-* description:  Calculate TNS filter and decide on TNS usage 
+* description:  Calculate TNS filter and decide on TNS usage
 * returns:		0 if success
 *
 */
@@ -278,7 +278,7 @@
   Word32* pWork32 = &pScratchTns[subBlockNumber >> 8];
   Word16* pWeightedSpectrum = (Word16 *)&pScratchTns[subBlockNumber >> 8];
 
-                                                                                                    
+
   if (tC.tnsActive) {
     CalcWeightedSpectrum(spectrum,
                          pWeightedSpectrum,
@@ -290,7 +290,7 @@
                          tC.lpcStopBand,
                          pWork32);
 
-    temp = blockType - SHORT_WINDOW;                                                          
+    temp = blockType - SHORT_WINDOW;
     if ( temp != 0 ) {
         predictionGain = CalcTnsFilter( &pWeightedSpectrum[tC.lpcStartLine],
                                         tC.acfWindow,
@@ -299,15 +299,15 @@
                                         tnsData->dataRaw.tnsLong.subBlockInfo.parcor);
 
 
-        temp = predictionGain - tC.threshold;                                                  
+        temp = predictionGain - tC.threshold;
         if ( temp > 0 ) {
-          tnsData->dataRaw.tnsLong.subBlockInfo.tnsActive = 1;                                      
+          tnsData->dataRaw.tnsLong.subBlockInfo.tnsActive = 1;
         }
         else {
-          tnsData->dataRaw.tnsLong.subBlockInfo.tnsActive = 0;                                      
+          tnsData->dataRaw.tnsLong.subBlockInfo.tnsActive = 0;
         }
 
-        tnsData->dataRaw.tnsLong.subBlockInfo.predictionGain = predictionGain;                      
+        tnsData->dataRaw.tnsLong.subBlockInfo.predictionGain = predictionGain;
     }
     else{
 
@@ -317,28 +317,28 @@
                                         tC.maxOrder,
                                         tnsData->dataRaw.tnsShort.subBlockInfo[subBlockNumber].parcor);
 
-        temp = predictionGain - tC.threshold;                                                 
+        temp = predictionGain - tC.threshold;
         if ( temp > 0 ) {
-          tnsData->dataRaw.tnsShort.subBlockInfo[subBlockNumber].tnsActive = 1;                     
+          tnsData->dataRaw.tnsShort.subBlockInfo[subBlockNumber].tnsActive = 1;
         }
         else {
-          tnsData->dataRaw.tnsShort.subBlockInfo[subBlockNumber].tnsActive = 0;                     
+          tnsData->dataRaw.tnsShort.subBlockInfo[subBlockNumber].tnsActive = 0;
         }
 
-        tnsData->dataRaw.tnsShort.subBlockInfo[subBlockNumber].predictionGain = predictionGain;     
+        tnsData->dataRaw.tnsShort.subBlockInfo[subBlockNumber].predictionGain = predictionGain;
     }
 
   }
   else{
 
-    temp = blockType - SHORT_WINDOW;                                                          
+    temp = blockType - SHORT_WINDOW;
     if ( temp != 0 ) {
-        tnsData->dataRaw.tnsLong.subBlockInfo.tnsActive = 0;                                        
-        tnsData->dataRaw.tnsLong.subBlockInfo.predictionGain = 0;                                   
+        tnsData->dataRaw.tnsLong.subBlockInfo.tnsActive = 0;
+        tnsData->dataRaw.tnsLong.subBlockInfo.predictionGain = 0;
     }
     else {
-        tnsData->dataRaw.tnsShort.subBlockInfo[subBlockNumber].tnsActive = 0;                       
-        tnsData->dataRaw.tnsShort.subBlockInfo[subBlockNumber].predictionGain = 0;                  
+        tnsData->dataRaw.tnsShort.subBlockInfo[subBlockNumber].tnsActive = 0;
+        tnsData->dataRaw.tnsShort.subBlockInfo[subBlockNumber].predictionGain = 0;
     }
   }
 
@@ -362,21 +362,21 @@
    const TNS_SUBBLOCK_INFO *sbInfoSrc;
    Word32 i, temp;
 
-   temp =  blockType - SHORT_WINDOW;                                                           
+   temp =  blockType - SHORT_WINDOW;
    if ( temp != 0 ) {
-      sbInfoDest = &tnsDataDest->dataRaw.tnsLong.subBlockInfo;                                      
-      sbInfoSrc  = &tnsDataSrc->dataRaw.tnsLong.subBlockInfo;                                       
+      sbInfoDest = &tnsDataDest->dataRaw.tnsLong.subBlockInfo;
+      sbInfoSrc  = &tnsDataSrc->dataRaw.tnsLong.subBlockInfo;
    }
    else {
-      sbInfoDest = &tnsDataDest->dataRaw.tnsShort.subBlockInfo[subBlockNumber];                     
-      sbInfoSrc  = &tnsDataSrc->dataRaw.tnsShort.subBlockInfo[subBlockNumber];                      
+      sbInfoDest = &tnsDataDest->dataRaw.tnsShort.subBlockInfo[subBlockNumber];
+      sbInfoSrc  = &tnsDataSrc->dataRaw.tnsShort.subBlockInfo[subBlockNumber];
    }
 
    if (100*abs_s(sbInfoDest->predictionGain - sbInfoSrc->predictionGain) <
        (3 * sbInfoDest->predictionGain)) {
-      sbInfoDest->tnsActive = sbInfoSrc->tnsActive;                                                 
+      sbInfoDest->tnsActive = sbInfoSrc->tnsActive;
       for ( i=0; i< tC.maxOrder; i++) {
-        sbInfoDest->parcor[i] = sbInfoSrc->parcor[i];                                               
+        sbInfoDest->parcor[i] = sbInfoSrc->parcor[i];
       }
    }
 }
@@ -402,11 +402,11 @@
   Word32 temp;
   TNS_SUBBLOCK_INFO *psubBlockInfo;
 
-  temp_s = blockType - SHORT_WINDOW;                                                             
-  if ( temp_s != 0) {                                                                               
+  temp_s = blockType - SHORT_WINDOW;
+  if ( temp_s != 0) {
     psubBlockInfo = &tnsData->dataRaw.tnsLong.subBlockInfo;
 	if (psubBlockInfo->tnsActive == 0) {
-      tnsInfo->tnsActive[subBlockNumber] = 0;                                                       
+      tnsInfo->tnsActive[subBlockNumber] = 0;
       return(0);
     }
     else {
@@ -422,22 +422,22 @@
                    tC.coefRes);
 
       for (i=tC.maxOrder - 1; i>=0; i--)  {
-        temp = psubBlockInfo->parcor[i] - TNS_PARCOR_THRESH;         
+        temp = psubBlockInfo->parcor[i] - TNS_PARCOR_THRESH;
         if ( temp > 0 )
           break;
-        temp = psubBlockInfo->parcor[i] + TNS_PARCOR_THRESH;         
+        temp = psubBlockInfo->parcor[i] + TNS_PARCOR_THRESH;
         if ( temp < 0 )
           break;
       }
-      tnsInfo->order[subBlockNumber] = i + 1;                                                    
+      tnsInfo->order[subBlockNumber] = i + 1;
 
 
-      tnsInfo->tnsActive[subBlockNumber] = 1;                                                       
+      tnsInfo->tnsActive[subBlockNumber] = 1;
       for (i=subBlockNumber+1; i<TRANS_FAC; i++) {
-        tnsInfo->tnsActive[i] = 0;                                                                  
+        tnsInfo->tnsActive[i] = 0;
       }
-      tnsInfo->coefRes[subBlockNumber] = tC.coefRes;                                                
-      tnsInfo->length[subBlockNumber] = numOfSfb - tC.tnsStartBand;                                 
+      tnsInfo->coefRes[subBlockNumber] = tC.coefRes;
+      tnsInfo->length[subBlockNumber] = numOfSfb - tC.tnsStartBand;
 
 
       AnalysisFilterLattice(&(spectrum[tC.tnsStartLine]),
@@ -448,10 +448,10 @@
 
     }
   }     /* if (blockType!=SHORT_WINDOW) */
-  else /*short block*/ {                                                                            
+  else /*short block*/ {
     psubBlockInfo = &tnsData->dataRaw.tnsShort.subBlockInfo[subBlockNumber];
 	if (psubBlockInfo->tnsActive == 0) {
-      tnsInfo->tnsActive[subBlockNumber] = 0;                                                       
+      tnsInfo->tnsActive[subBlockNumber] = 0;
       return(0);
     }
     else {
@@ -466,19 +466,19 @@
                    tC.maxOrder,
                    tC.coefRes);
       for (i=(tC.maxOrder - 1); i>=0; i--)  {
-        temp = psubBlockInfo->parcor[i] - TNS_PARCOR_THRESH;    
+        temp = psubBlockInfo->parcor[i] - TNS_PARCOR_THRESH;
          if ( temp > 0 )
           break;
 
-        temp = psubBlockInfo->parcor[i] + TNS_PARCOR_THRESH;    
+        temp = psubBlockInfo->parcor[i] + TNS_PARCOR_THRESH;
         if ( temp < 0 )
           break;
       }
-      tnsInfo->order[subBlockNumber] = i + 1;                                                    
+      tnsInfo->order[subBlockNumber] = i + 1;
 
-      tnsInfo->tnsActive[subBlockNumber] = 1;                                                       
-      tnsInfo->coefRes[subBlockNumber] = tC.coefRes;                                                
-      tnsInfo->length[subBlockNumber] = numOfSfb - tC.tnsStartBand;                             
+      tnsInfo->tnsActive[subBlockNumber] = 1;
+      tnsInfo->coefRes[subBlockNumber] = tC.coefRes;
+      tnsInfo->length[subBlockNumber] = numOfSfb - tC.tnsStartBand;
 
 
       AnalysisFilterLattice(&(spectrum[tC.tnsStartLine]), (tC.tnsStopLine - tC.tnsStartLine),
@@ -507,14 +507,14 @@
 {
   Word32 k;
 
-  Word32 accu_y = 0x40000000;                                                                     
+  Word32 accu_y = 0x40000000;
   accu_y = L_shr(accu_y,scale);
 
   for(k=1; k<INT_BITS; k++) {
-    const Word32 z = m_log2_table[k];                                                             
+    const Word32 z = m_log2_table[k];
 
     while(L_sub(x,z) >= 0) {
-       
+
       x = L_sub(x, z);
       accu_y = L_add(accu_y, (accu_y >> k));
     }
@@ -548,43 +548,43 @@
     Word32 maxWS;
     Word32 tnsSfbMean[MAX_SFB];    /* length [lpcStopBand-lpcStartBand] should be sufficient here */
 
-    maxWS = 0;                                                                                   
-  
+    maxWS = 0;
+
     /* calc 1.0*2^-INT_BITS/2/sqrt(en) */
     for( sfb = lpcStartBand; sfb < lpcStopBand; sfb++) {
 
-      tmp2 = sfbEnergy[sfb] - 2;                                                            
+      tmp2 = sfbEnergy[sfb] - 2;
       if( tmp2 > 0) {
         tmp = rsqrt(sfbEnergy[sfb], INT_BITS);
-		if(tmp > INT_BITS_SCAL) 
+		if(tmp > INT_BITS_SCAL)
 		{
 			shift =  norm_l(tmp);
-			tmp = Div_32( INT_BITS_SCAL << shift, tmp << shift ); 
+			tmp = Div_32( INT_BITS_SCAL << shift, tmp << shift );
 		}
 		else
 		{
-			tmp = 0x7fffffff; 
+			tmp = 0x7fffffff;
 		}
       }
       else {
-        tmp = 0x7fffffff;                                                                           
-      } 
-      tnsSfbMean[sfb] = tmp;                                                                        
+        tmp = 0x7fffffff;
+      }
+      tnsSfbMean[sfb] = tmp;
     }
 
     /* spread normalized values from sfbs to lines */
-    sfb = lpcStartBand;                                                                             
-    tmp = tnsSfbMean[sfb];                                                                          
+    sfb = lpcStartBand;
+    tmp = tnsSfbMean[sfb];
     for ( i=lpcStartLine; i<lpcStopLine; i++){
-      tmp_s = sfbOffset[sfb + 1] - i;                                                      
+      tmp_s = sfbOffset[sfb + 1] - i;
       if ( tmp_s == 0 ) {
         sfb = sfb + 1;
-        tmp2_s = sfb + 1 - lpcStopBand;                                                       
+        tmp2_s = sfb + 1 - lpcStopBand;
         if (tmp2_s <= 0) {
-          tmp = tnsSfbMean[sfb];                                                                    
+          tmp = tnsSfbMean[sfb];
         }
       }
-      pWork32[i] = tmp;                                                                    
+      pWork32[i] = tmp;
     }
     /*filter down*/
     for (i=(lpcStopLine - 2); i>=lpcStartLine; i--){
@@ -597,8 +597,8 @@
 
     /* weight and normalize */
     for (i=lpcStartLine; i<lpcStopLine; i++){
-      pWork32[i] = MULHIGH(pWork32[i], spectrum[i]);                               
-      maxWS |= L_abs(pWork32[i]);                                                          
+      pWork32[i] = MULHIGH(pWork32[i], spectrum[i]);
+      maxWS |= L_abs(pWork32[i]);
     }
     maxShift = norm_l(maxWS);
 
@@ -646,7 +646,7 @@
   assert(tnsOrder <= TNS_MAX_ORDER);      /* remove asserts later? (btg) */
 
   for(i=0;i<tnsOrder;i++) {
-    parcor[i] = 0;                               
+    parcor[i] = 0;
   }
 
   AutoCorrelation(signal, parcorWorkBuffer, numOfLines, tnsOrderPlus1);
@@ -678,15 +678,15 @@
   Word32 accu;
   Word32 scf;
 
-  scf = 10 - 1;                                                                                      
+  scf = 10 - 1;
 
   isamples = samples;
   /* calc first corrCoef:  R[0] = sum { t[i] * t[i] } ; i = 0..N-1 */
-  accu = 0;                                                                                      
+  accu = 0;
   for(j=0; j<isamples; j++) {
     accu = L_add(accu, ((input[j] * input[j]) >> scf));
   }
-  corr[0] = accu;                                                                                
+  corr[0] = accu;
 
   /* early termination if all corr coeffs are likely going to be zero */
   if(corr[0] == 0) return ;
@@ -694,13 +694,13 @@
   /* calc all other corrCoef:  R[j] = sum { t[i] * t[i+j] } ; i = 0..(N-j-1), j=1..p */
   for(i=1; i<corrCoeff; i++) {
     isamples = isamples - 1;
-    accu = 0;                                                                                    
+    accu = 0;
     for(j=0; j<isamples; j++) {
       accu = L_add(accu, ((input[j] * input[j+i]) >> scf));
     }
-    corr[i] = accu;                                                                              
+    corr[i] = accu;
   }
-}    
+}
 #endif
 
 /*****************************************************************************
@@ -720,20 +720,20 @@
   Word32 predictionGain = 0;
   Word32 num, denom;
   Word32 temp, workBuffer0;
-   
 
-  num = workBuffer[0];                                                                           
-  temp = workBuffer[numOfCoeff];                                                                 
+
+  num = workBuffer[0];
+  temp = workBuffer[numOfCoeff];
 
   for(i=0; i<numOfCoeff-1; i++) {
-    workBuffer[i + numOfCoeff] = workBuffer[i + 1];                                        
+    workBuffer[i + numOfCoeff] = workBuffer[i + 1];
   }
-  workBuffer[i + numOfCoeff] = temp;                                                                           
-  
+  workBuffer[i + numOfCoeff] = temp;
+
   for(i=0; i<numOfCoeff; i++) {
     Word32 refc;
 
-     
+
     if (workBuffer[0] < L_abs(workBuffer[i + numOfCoeff])) {
       return 0 ;
     }
@@ -742,21 +742,21 @@
     /* calculate refc = -workBuffer[numOfCoeff+i] / workBuffer[0]; -1 <= refc < 1 */
 	refc = L_negate(fixmul(workBuffer[numOfCoeff + i], workBuffer0));
 
-    reflCoeff[i] = refc;                                                                           
+    reflCoeff[i] = refc;
 
-    pWorkBuffer = &(workBuffer[numOfCoeff]);                                                        
+    pWorkBuffer = &(workBuffer[numOfCoeff]);
 
     for(j=i; j<numOfCoeff; j++) {
       Word32 accu1, accu2;
       accu1 = L_add(pWorkBuffer[j], fixmul(refc, workBuffer[j - i]));
       accu2 = L_add(workBuffer[j - i], fixmul(refc, pWorkBuffer[j]));
-      pWorkBuffer[j] = accu1;                                                                       
-      workBuffer[j - i] = accu2;                                                                 
+      pWorkBuffer[j] = accu1;
+      workBuffer[j - i] = accu2;
     }
   }
 
   denom = MULHIGH(workBuffer[0], NORM_COEF);
-   
+
   if (denom != 0) {
     Word32 temp;
 	shift = norm_l(denom);
@@ -774,11 +774,11 @@
   Word32 index = 0;
   Word32 i;
   Word32 temp;
-   
+
   for (i=0;i<8;i++) {
-    temp = L_sub( parcor, tnsCoeff3Borders[i]);                                                     
+    temp = L_sub( parcor, tnsCoeff3Borders[i]);
     if (temp > 0)
-      index=i;                                                                                      
+      index=i;
   }
   return extract_l(index - 4);
 }
@@ -788,12 +788,12 @@
   Word32 index = 0;
   Word32 i;
   Word32 temp;
-   
+
 
   for (i=0;i<16;i++) {
-    temp = L_sub(parcor, tnsCoeff4Borders[i]);                                                      
+    temp = L_sub(parcor, tnsCoeff4Borders[i]);
     if (temp > 0)
-      index=i;                                                                                      
+      index=i;
   }
   return extract_l(index - 8);
 }
@@ -814,12 +814,12 @@
   Word32 temp;
 
   for(i=0; i<order; i++) {
-    temp = bitsPerCoeff - 3;                                                                    
+    temp = bitsPerCoeff - 3;
     if (temp == 0) {
-      index[i] = Search3(parcor[i]);                                                                
-    } 
+      index[i] = Search3(parcor[i]);
+    }
     else {
-      index[i] = Search4(parcor[i]);                                                                
+      index[i] = Search4(parcor[i]);
     }
   }
 }
@@ -839,12 +839,12 @@
   Word32 temp;
 
   for (i=0; i<order; i++) {
-    temp = bitsPerCoeff - 4;                                                                     
+    temp = bitsPerCoeff - 4;
     if ( temp == 0 ) {
-        parcor[i] = tnsCoeff4[index[i] + 8];                                                     
+        parcor[i] = tnsCoeff4[index[i] + 8];
     }
     else {
-        parcor[i] = tnsCoeff3[index[i] + 4];                                                  
+        parcor[i] = tnsCoeff3[index[i] + 4];
     }
   }
 }
@@ -865,20 +865,20 @@
    Word32 accu,tmp,tmpSave;
 
    x = x >> 1;
-   tmpSave = x;                                                                                     
+   tmpSave = x;
 
    for (i=0; i<(order - 1); i++) {
 
      tmp = L_add(fixmul(coef_par[i], x), state_par[i]);
      x   = L_add(fixmul(coef_par[i], state_par[i]), x);
 
-     state_par[i] = tmpSave;                                                                        
-     tmpSave = tmp;                                                                                 
+     state_par[i] = tmpSave;
+     tmpSave = tmp;
   }
 
   /* last stage: only need half operations */
   accu = fixmul(state_par[order - 1], coef_par[(order - 1)]);
-  state_par[(order - 1)] = tmpSave;                                                                
+  state_par[(order - 1)] = tmpSave;
 
   x = L_add(accu, x);
   x = L_add(x, x);
@@ -903,11 +903,11 @@
   Word32 j;
 
   for ( j=0; j<TNS_MAX_ORDER; j++ ) {
-    state_par[j] = 0;                                                                               
+    state_par[j] = 0;
   }
 
   for(j=0; j<numOfLines; j++) {
-    output[j] = FIRLattice(order,signal[j],state_par,parCoeff);                                     
+    output[j] = FIRLattice(order,signal[j],state_par,parCoeff);
   }
 }
 
@@ -922,11 +922,11 @@
                                TNS_SUBBLOCK_INFO subInfo, /*!< TNS subblock info */
                                Word32 *thresholds)        /*!< thresholds (modified) */
 {
-  Word32 i;                                                                                         
+  Word32 i;
   if (subInfo.tnsActive) {
     for(i=startCb; i<stopCb; i++) {
       /* thresholds[i] * 0.25 */
-      thresholds[i] = (thresholds[i] >> 2);                                                      
+      thresholds[i] = (thresholds[i] >> 2);
     }
   }
 }
diff --git a/media/libstagefright/codecs/aacenc/src/transform.c b/media/libstagefright/codecs/aacenc/src/transform.c
index 4d11f78..a154a2f 100644
--- a/media/libstagefright/codecs/aacenc/src/transform.c
+++ b/media/libstagefright/codecs/aacenc/src/transform.c
@@ -31,7 +31,7 @@
 #define swap2(p0,p1) \
 	t = p0; t1 = *(&(p0)+1);	\
 	p0 = p1; *(&(p0)+1) = *(&(p1)+1);	\
-	p1 = t; *(&(p1)+1) = t1	
+	p1 = t; *(&(p1)+1) = t1
 
 /*********************************************************************************
 *
@@ -47,18 +47,18 @@
 
 	part0 = buf;
     part1 = buf + num;
-	
+
 	while ((i = *bitTab++) != 0) {
         j = *bitTab++;
 
-        swap2(part0[4*i+0], part0[4*j+0]);	
-        swap2(part0[4*i+2], part1[4*j+0]);	
-        swap2(part1[4*i+0], part0[4*j+2]);	
-        swap2(part1[4*i+2], part1[4*j+2]);	
+        swap2(part0[4*i+0], part0[4*j+0]);
+        swap2(part0[4*i+2], part1[4*j+0]);
+        swap2(part1[4*i+0], part0[4*j+2]);
+        swap2(part1[4*i+2], part1[4*j+2]);
     }
 
     do {
-        swap2(part0[4*i+2], part1[4*i+0]);	
+        swap2(part0[4*i+2], part1[4*i+0]);
     } while ((i = *bitTab++) != 0);
 }
 
@@ -74,8 +74,8 @@
 {
     int r0, r1, r2, r3;
 	int r4, r5, r6, r7;
-	
-	for (; num != 0; num--) 
+
+	for (; num != 0; num--)
 	{
 		r0 = buf[0] + buf[2];
 		r1 = buf[1] + buf[3];
@@ -113,7 +113,7 @@
    int i4, i5, i6, i7;
    int t0, t1, t2, t3;
 
-	for ( ; num != 0; num--) 
+	for ( ; num != 0; num--)
 	{
 		r0 = buf[0] + buf[2];
 		i0 = buf[1] + buf[3];
@@ -194,23 +194,23 @@
 	int i, j, step;
 	int *xptr, *csptr;
 
-	for (num >>= 2; num != 0; num >>= 2) 
+	for (num >>= 2; num != 0; num >>= 2)
 	{
 		step = 2*bgn;
 		xptr = buf;
 
-    	for (i = num; i != 0; i--) 
+    	for (i = num; i != 0; i--)
 		{
 			csptr = twidTab;
 
-			for (j = bgn; j != 0; j--) 
+			for (j = bgn; j != 0; j--)
 			{
 				r0 = xptr[0];
 				r1 = xptr[1];
 				xptr += step;
-				
+
 				t0 = xptr[0];
-				t1 = xptr[1];				
+				t1 = xptr[1];
 				cosx = csptr[0];
 				sinx = csptr[1];
 				r2 = MULHIGH(cosx, t0) + MULHIGH(sinx, t1);		/* cos*br + sin*bi */
@@ -223,7 +223,7 @@
 				r1 = t1 - r3;
 				r2 = t0 + r2;
 				r3 = t1 + r3;
-				
+
 				t0 = xptr[0];
 				t1 = xptr[1];
 				cosx = csptr[2];
@@ -231,7 +231,7 @@
 				r4 = MULHIGH(cosx, t0) + MULHIGH(sinx, t1);		/* cos*cr + sin*ci */
 				r5 = MULHIGH(cosx, t1) - MULHIGH(sinx, t0);		/* cos*ci - sin*cr */
 				xptr += step;
-				
+
 				t0 = xptr[0];
 				t1 = xptr[1];
 				cosx = csptr[4];
@@ -282,25 +282,25 @@
 	int tr1, ti1, tr2, ti2;
 	int cosa, sina, cosb, sinb;
 	int *buf1;
-	
+
 	buf1 = buf0 + num - 1;
 
 	for(i = num >> 2; i != 0; i--)
 	{
-		cosa = *csptr++;	
-		sina = *csptr++;	
-		cosb = *csptr++;	
-		sinb = *csptr++;		
+		cosa = *csptr++;
+		sina = *csptr++;
+		cosb = *csptr++;
+		sinb = *csptr++;
 
 		tr1 = *(buf0 + 0);
 		ti2 = *(buf0 + 1);
 		tr2 = *(buf1 - 1);
 		ti1 = *(buf1 + 0);
-		
+
 		*buf0++ = MULHIGH(cosa, tr1) + MULHIGH(sina, ti1);
-		*buf0++ = MULHIGH(cosa, ti1) - MULHIGH(sina, tr1);		
-		
-		*buf1-- = MULHIGH(cosb, ti2) - MULHIGH(sinb, tr2);		
+		*buf0++ = MULHIGH(cosa, ti1) - MULHIGH(sina, tr1);
+
+		*buf1-- = MULHIGH(cosb, ti2) - MULHIGH(sinb, tr2);
 		*buf1-- = MULHIGH(cosb, tr2) + MULHIGH(sinb, ti2);
 	}
 }
@@ -319,12 +319,12 @@
 	int *buf1;
 
 	buf1 = buf0 + num - 1;
-	
+
 	for(i = num >> 2; i != 0; i--)
 	{
-		cosa = *csptr++;	
-		sina = *csptr++;	
-		cosb = *csptr++;	
+		cosa = *csptr++;
+		sina = *csptr++;
+		cosb = *csptr++;
 		sinb = *csptr++;
 
 		tr1 = *(buf0 + 0);
@@ -333,10 +333,10 @@
 		tr2 = *(buf1 - 1);
 
 		*buf0++ = MULHIGH(cosa, tr1) + MULHIGH(sina, ti1);
-		*buf1-- = MULHIGH(sina, tr1) - MULHIGH(cosa, ti1);		
-		
+		*buf1-- = MULHIGH(sina, tr1) - MULHIGH(cosa, ti1);
+
 		*buf0++ = MULHIGH(sinb, tr2) - MULHIGH(cosb, ti2);
-		*buf1-- = MULHIGH(cosb, tr2) + MULHIGH(sinb, ti2);	
+		*buf1-- = MULHIGH(cosb, tr2) + MULHIGH(sinb, ti2);
 	}
 }
 #endif
@@ -353,17 +353,17 @@
 	PreMDCT(buf, 1024, cossintab + 128);
 
 	Shuffle(buf, 512, bitrevTab + 17);
-	Radix8First(buf, 512 >> 3);						
+	Radix8First(buf, 512 >> 3);
 	Radix4FFT(buf, 512 >> 3, 8, (int *)twidTab512);
 
-	PostMDCT(buf, 1024, cossintab + 128);	
+	PostMDCT(buf, 1024, cossintab + 128);
 }
 
 
 /**********************************************************************************
 *
 * function name: Mdct_Short
-* description:  the short block mdct 
+* description:  the short block mdct
 *
 **********************************************************************************/
 void Mdct_Short(int *buf)
@@ -371,10 +371,10 @@
 	PreMDCT(buf, 128, cossintab);
 
 	Shuffle(buf, 64, bitrevTab);
-	Radix4First(buf, 64 >> 2);						
-	Radix4FFT(buf, 64 >> 2, 4, (int *)twidTab64);	
+	Radix4First(buf, 64 >> 2);
+	Radix4FFT(buf, 64 >> 2, 4, (int *)twidTab64);
 
-	PostMDCT(buf, 128, cossintab);	
+	PostMDCT(buf, 128, cossintab);
 }
 
 
@@ -382,7 +382,7 @@
 *
 * function name: shiftMdctDelayBuffer
 * description:    the mdct delay buffer has a size of 1600,
-*  so the calculation of LONG,STOP must be  spilt in two 
+*  so the calculation of LONG,STOP must be  spilt in two
 *  passes with 1024 samples and a mid shift,
 *  the SHORT transforms can be completed in the delay buffer,
 *  and afterwards a shift
@@ -409,7 +409,7 @@
 	dsBuf = timeSignal;
 
 	for(i=0; i<FRAME_LEN_LONG; i+=8)
-	{   
+	{
 		*srBuf++ = *dsBuf; dsBuf += chIncrement;
 		*srBuf++ = *dsBuf; dsBuf += chIncrement;
 		*srBuf++ = *dsBuf; dsBuf += chIncrement;
@@ -470,10 +470,10 @@
 
 	Word32 delayBufferSf,timeSignalSf,minSf;
 	Word32 headRoom=0;
-	
+
 	switch(blockType){
-		
-		
+
+
 	case LONG_WINDOW:
 		/*
 		we access BLOCK_SWITCHING_OFFSET (1600 ) delay buffer samples + 448 new timeSignal samples
@@ -483,15 +483,15 @@
 		timeSignalSf  = getScalefactorOfShortVectorStride(timeSignal,2*FRAME_LEN_LONG-BLOCK_SWITCHING_OFFSET,chIncrement);
 		minSf = min(delayBufferSf,timeSignalSf);
 		minSf = min(minSf,14);
-		
+
 		dctIn0 = mdctDelayBuffer;
 		dctIn1 = mdctDelayBuffer + FRAME_LEN_LONG - 1;
 		outData0 = realOut + FRAME_LEN_LONG/2;
-		
+
 		/* add windows and pre add for mdct to last buffer*/
 		winPtr = (int *)LongWindowKBD;
 		for(i=0;i<FRAME_LEN_LONG/2;i++){
-			timeSignalSample = (*dctIn0++) << minSf; 
+			timeSignalSample = (*dctIn0++) << minSf;
 			ws1 = timeSignalSample * (*winPtr >> 16);
 			timeSignalSample = (*dctIn1--) << minSf;
 			ws2 = timeSignalSample * (*winPtr & 0xffff);
@@ -499,30 +499,30 @@
 			/* shift 2 to avoid overflow next */
 			*outData0++ = (ws1 >> 2) - (ws2 >> 2);
 		}
-		
+
 		shiftMdctDelayBuffer(mdctDelayBuffer,timeSignal,chIncrement);
-		
+
 		/* add windows and pre add for mdct to new buffer*/
 		dctIn0 = mdctDelayBuffer;
 		dctIn1 = mdctDelayBuffer + FRAME_LEN_LONG - 1;
-		outData0 = realOut + FRAME_LEN_LONG/2 - 1; 
+		outData0 = realOut + FRAME_LEN_LONG/2 - 1;
 		winPtr = (int *)LongWindowKBD;
-		for(i=0;i<FRAME_LEN_LONG/2;i++){    
+		for(i=0;i<FRAME_LEN_LONG/2;i++){
 			timeSignalSample = (*dctIn0++) << minSf;
 			ws1 = timeSignalSample * (*winPtr & 0xffff);
 			timeSignalSample = (*dctIn1--) << minSf;
 			ws2 = timeSignalSample * (*winPtr >> 16);
 			winPtr++;
 			/* shift 2 to avoid overflow next */
-			*outData0-- = -((ws1 >> 2) + (ws2 >> 2)); 
+			*outData0-- = -((ws1 >> 2) + (ws2 >> 2));
 		}
 
 		Mdct_Long(realOut);
 		/* update scale factor */
 		minSf = 14 - minSf;
-		*mdctScale=minSf; 
+		*mdctScale=minSf;
 		break;
-		
+
 	case START_WINDOW:
 		/*
 		we access BLOCK_SWITCHING_OFFSET (1600 ) delay buffer samples + no timeSignal samples
@@ -533,7 +533,7 @@
 
 		dctIn0 = mdctDelayBuffer;
 		dctIn1 = mdctDelayBuffer + FRAME_LEN_LONG - 1;
-		outData0 = realOut + FRAME_LEN_LONG/2; 		
+		outData0 = realOut + FRAME_LEN_LONG/2;
 		winPtr = (int *)LongWindowKBD;
 
 		/* add windows and pre add for mdct to last buffer*/
@@ -545,18 +545,18 @@
 			winPtr ++;
 			*outData0++ = (ws1 >> 2) - (ws2 >> 2);  /* shift 2 to avoid overflow next */
 		}
-		
+
 		shiftMdctDelayBuffer(mdctDelayBuffer,timeSignal,chIncrement);
-		
-		outData0 = realOut + FRAME_LEN_LONG/2 - 1; 
+
+		outData0 = realOut + FRAME_LEN_LONG/2 - 1;
 		for(i=0;i<LS_TRANS;i++){
-			*outData0-- = -mdctDelayBuffer[i] << (15 - 2 + minSf);  
+			*outData0-- = -mdctDelayBuffer[i] << (15 - 2 + minSf);
 		}
-		
+
 		/* add windows and pre add for mdct to new buffer*/
 		dctIn0 = mdctDelayBuffer + LS_TRANS;
 		dctIn1 = mdctDelayBuffer + FRAME_LEN_LONG - 1 - LS_TRANS;
-		outData0 = realOut + FRAME_LEN_LONG/2 - 1 -LS_TRANS; 
+		outData0 = realOut + FRAME_LEN_LONG/2 - 1 -LS_TRANS;
 		winPtr = (int *)ShortWindowSine;
 		for(i=0;i<FRAME_LEN_SHORT/2;i++){
 			timeSignalSample= (*dctIn0++) << minSf;
@@ -572,7 +572,7 @@
 		minSf = 14 - minSf;
 		*mdctScale= minSf;
 		break;
-		
+
 	case STOP_WINDOW:
 		/*
 		we access BLOCK_SWITCHING_OFFSET-LS_TRANS (1600-448 ) delay buffer samples + 448 new timeSignal samples
@@ -580,19 +580,19 @@
 		*/
 		delayBufferSf = getScalefactorOfShortVectorStride(mdctDelayBuffer+LS_TRANS,BLOCK_SWITCHING_OFFSET-LS_TRANS,1);
 		timeSignalSf  = getScalefactorOfShortVectorStride(timeSignal,2*FRAME_LEN_LONG-BLOCK_SWITCHING_OFFSET,chIncrement);
-		minSf = min(delayBufferSf,timeSignalSf);    
+		minSf = min(delayBufferSf,timeSignalSf);
 		minSf = min(minSf,13);
-		
+
 		outData0 = realOut + FRAME_LEN_LONG/2;
 		dctIn1 = mdctDelayBuffer + FRAME_LEN_LONG - 1;
 		for(i=0;i<LS_TRANS;i++){
-			*outData0++ = -(*dctIn1--) << (15 - 2 + minSf);    
+			*outData0++ = -(*dctIn1--) << (15 - 2 + minSf);
 		}
-		
+
 		/* add windows and pre add for mdct to last buffer*/
 		dctIn0 = mdctDelayBuffer + LS_TRANS;
 		dctIn1 = mdctDelayBuffer + FRAME_LEN_LONG - 1 - LS_TRANS;
-		outData0 = realOut + FRAME_LEN_LONG/2 + LS_TRANS; 
+		outData0 = realOut + FRAME_LEN_LONG/2 + LS_TRANS;
 		winPtr = (int *)ShortWindowSine;
 		for(i=0;i<FRAME_LEN_SHORT/2;i++){
 			timeSignalSample = (*dctIn0++) << minSf;
@@ -602,13 +602,13 @@
 			winPtr++;
 			*outData0++ = (ws1 >> 2) - (ws2 >> 2);  /* shift 2 to avoid overflow next */
 		}
-		
+
 		shiftMdctDelayBuffer(mdctDelayBuffer,timeSignal,chIncrement);
-		
+
 		/* add windows and pre add for mdct to new buffer*/
 		dctIn0 = mdctDelayBuffer;
 		dctIn1 = mdctDelayBuffer + FRAME_LEN_LONG - 1;
-		outData0 = realOut + FRAME_LEN_LONG/2 - 1; 
+		outData0 = realOut + FRAME_LEN_LONG/2 - 1;
 		winPtr = (int *)LongWindowKBD;
 		for(i=0;i<FRAME_LEN_LONG/2;i++){
 			timeSignalSample= (*dctIn0++) << minSf;
@@ -618,26 +618,26 @@
 			*outData0-- =  -((ws1 >> 2) + (ws2 >> 2));  /* shift 2 to avoid overflow next */
 			winPtr++;
 		}
-		
+
 		Mdct_Long(realOut);
 		minSf = 14 - minSf;
 		*mdctScale= minSf; /* update scale factor */
 		break;
-		
+
 	case SHORT_WINDOW:
 		/*
 		we access BLOCK_SWITCHING_OFFSET (1600 ) delay buffer samples + no new timeSignal samples
 		and get the biggest scale factor for next calculate more precise
-		*/		
+		*/
 		minSf = getScalefactorOfShortVectorStride(mdctDelayBuffer+TRANSFORM_OFFSET_SHORT,9*FRAME_LEN_SHORT,1);
 		minSf = min(minSf,10);
-		
-		
+
+
 		for(w=0;w<TRANS_FAC;w++){
 			dctIn0 = mdctDelayBuffer+w*FRAME_LEN_SHORT+TRANSFORM_OFFSET_SHORT;
 			dctIn1 = mdctDelayBuffer+w*FRAME_LEN_SHORT+TRANSFORM_OFFSET_SHORT + FRAME_LEN_SHORT-1;
-			outData0 = realOut + FRAME_LEN_SHORT/2; 
-			outData1 = realOut + FRAME_LEN_SHORT/2 - 1; 
+			outData0 = realOut + FRAME_LEN_SHORT/2;
+			outData1 = realOut + FRAME_LEN_SHORT/2 - 1;
 
 			winPtr = (int *)ShortWindowSine;
 			for(i=0;i<FRAME_LEN_SHORT/2;i++){
@@ -646,7 +646,7 @@
 				timeSignalSample= *dctIn1 << minSf;
 				ws2 = timeSignalSample * (*winPtr & 0xffff);
 				*outData0++ = (ws1 >> 2) - (ws2 >> 2);  /* shift 2 to avoid overflow next */
-				
+
 				timeSignalSample= *(dctIn0 + FRAME_LEN_SHORT) << minSf;
 				ws1 = timeSignalSample * (*winPtr & 0xffff);
 				timeSignalSample= *(dctIn1 + FRAME_LEN_SHORT) << minSf;
@@ -661,10 +661,10 @@
 			Mdct_Short(realOut);
 			realOut += FRAME_LEN_SHORT;
 		}
-		
+
 		minSf = 11 - minSf;
 		*mdctScale = minSf; /* update scale factor */
-		
+
 		shiftMdctDelayBuffer(mdctDelayBuffer,timeSignal,chIncrement);
 		break;
   }
diff --git a/media/libstagefright/codecs/amrnb/enc/Android.mk b/media/libstagefright/codecs/amrnb/enc/Android.mk
index b6aed81..94e8726 100644
--- a/media/libstagefright/codecs/amrnb/enc/Android.mk
+++ b/media/libstagefright/codecs/amrnb/enc/Android.mk
@@ -74,3 +74,30 @@
 LOCAL_MODULE := libstagefright_amrnbenc
 
 include $(BUILD_STATIC_LIBRARY)
+
+################################################################################
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+        SoftAMRNBEncoder.cpp
+
+LOCAL_C_INCLUDES := \
+        frameworks/base/media/libstagefright/include \
+        frameworks/base/include/media/stagefright/openmax \
+        $(LOCAL_PATH)/src \
+        $(LOCAL_PATH)/include \
+        $(LOCAL_PATH)/../common/include \
+        $(LOCAL_PATH)/../common
+
+LOCAL_STATIC_LIBRARIES := \
+        libstagefright_amrnbenc
+
+LOCAL_SHARED_LIBRARIES := \
+        libstagefright_omx libstagefright_foundation libutils \
+        libstagefright_amrnb_common
+
+LOCAL_MODULE := libstagefright_soft_amrnbenc
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/media/libstagefright/codecs/amrnb/enc/SoftAMRNBEncoder.cpp b/media/libstagefright/codecs/amrnb/enc/SoftAMRNBEncoder.cpp
new file mode 100644
index 0000000..07f8b4f
--- /dev/null
+++ b/media/libstagefright/codecs/amrnb/enc/SoftAMRNBEncoder.cpp
@@ -0,0 +1,404 @@
+/*
+ * 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.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "SoftAMRNBEncoder"
+#include <utils/Log.h>
+
+#include "SoftAMRNBEncoder.h"
+
+#include "gsmamr_enc.h"
+
+#include <media/stagefright/foundation/ADebug.h>
+#include <media/stagefright/foundation/hexdump.h>
+
+namespace android {
+
+static const int32_t kSampleRate = 8000;
+
+template<class T>
+static void InitOMXParams(T *params) {
+    params->nSize = sizeof(T);
+    params->nVersion.s.nVersionMajor = 1;
+    params->nVersion.s.nVersionMinor = 0;
+    params->nVersion.s.nRevision = 0;
+    params->nVersion.s.nStep = 0;
+}
+
+SoftAMRNBEncoder::SoftAMRNBEncoder(
+        const char *name,
+        const OMX_CALLBACKTYPE *callbacks,
+        OMX_PTR appData,
+        OMX_COMPONENTTYPE **component)
+    : SimpleSoftOMXComponent(name, callbacks, appData, component),
+      mEncState(NULL),
+      mSidState(NULL),
+      mBitRate(0),
+      mMode(MR475),
+      mInputSize(0),
+      mInputTimeUs(-1ll),
+      mSawInputEOS(false),
+      mSignalledError(false) {
+    initPorts();
+    CHECK_EQ(initEncoder(), (status_t)OK);
+}
+
+SoftAMRNBEncoder::~SoftAMRNBEncoder() {
+    if (mEncState != NULL) {
+        AMREncodeExit(&mEncState, &mSidState);
+        mEncState = mSidState = NULL;
+    }
+}
+
+void SoftAMRNBEncoder::initPorts() {
+    OMX_PARAM_PORTDEFINITIONTYPE def;
+    InitOMXParams(&def);
+
+    def.nPortIndex = 0;
+    def.eDir = OMX_DirInput;
+    def.nBufferCountMin = kNumBuffers;
+    def.nBufferCountActual = def.nBufferCountMin;
+    def.nBufferSize = kNumSamplesPerFrame * sizeof(int16_t);
+    def.bEnabled = OMX_TRUE;
+    def.bPopulated = OMX_FALSE;
+    def.eDomain = OMX_PortDomainAudio;
+    def.bBuffersContiguous = OMX_FALSE;
+    def.nBufferAlignment = 1;
+
+    def.format.audio.cMIMEType = const_cast<char *>("audio/raw");
+    def.format.audio.pNativeRender = NULL;
+    def.format.audio.bFlagErrorConcealment = OMX_FALSE;
+    def.format.audio.eEncoding = OMX_AUDIO_CodingPCM;
+
+    addPort(def);
+
+    def.nPortIndex = 1;
+    def.eDir = OMX_DirOutput;
+    def.nBufferCountMin = kNumBuffers;
+    def.nBufferCountActual = def.nBufferCountMin;
+    def.nBufferSize = 8192;
+    def.bEnabled = OMX_TRUE;
+    def.bPopulated = OMX_FALSE;
+    def.eDomain = OMX_PortDomainAudio;
+    def.bBuffersContiguous = OMX_FALSE;
+    def.nBufferAlignment = 2;
+
+    def.format.audio.cMIMEType = const_cast<char *>("audio/3gpp");
+    def.format.audio.pNativeRender = NULL;
+    def.format.audio.bFlagErrorConcealment = OMX_FALSE;
+    def.format.audio.eEncoding = OMX_AUDIO_CodingAMR;
+
+    addPort(def);
+}
+
+status_t SoftAMRNBEncoder::initEncoder() {
+    if (AMREncodeInit(&mEncState, &mSidState, false /* dtx_enable */) != 0) {
+        return UNKNOWN_ERROR;
+    }
+
+    return OK;
+}
+
+OMX_ERRORTYPE SoftAMRNBEncoder::internalGetParameter(
+        OMX_INDEXTYPE index, OMX_PTR params) {
+    switch (index) {
+        case OMX_IndexParamAudioPortFormat:
+        {
+            OMX_AUDIO_PARAM_PORTFORMATTYPE *formatParams =
+                (OMX_AUDIO_PARAM_PORTFORMATTYPE *)params;
+
+            if (formatParams->nPortIndex > 1) {
+                return OMX_ErrorUndefined;
+            }
+
+            if (formatParams->nIndex > 0) {
+                return OMX_ErrorNoMore;
+            }
+
+            formatParams->eEncoding =
+                (formatParams->nPortIndex == 0)
+                    ? OMX_AUDIO_CodingPCM : OMX_AUDIO_CodingAMR;
+
+            return OMX_ErrorNone;
+        }
+
+        case OMX_IndexParamAudioAmr:
+        {
+            OMX_AUDIO_PARAM_AMRTYPE *amrParams =
+                (OMX_AUDIO_PARAM_AMRTYPE *)params;
+
+            if (amrParams->nPortIndex != 1) {
+                return OMX_ErrorUndefined;
+            }
+
+            amrParams->nChannels = 1;
+            amrParams->nBitRate = mBitRate;
+            amrParams->eAMRBandMode = (OMX_AUDIO_AMRBANDMODETYPE)(mMode + 1);
+            amrParams->eAMRDTXMode = OMX_AUDIO_AMRDTXModeOff;
+            amrParams->eAMRFrameFormat = OMX_AUDIO_AMRFrameFormatFSF;
+
+            return OMX_ErrorNone;
+        }
+
+        case OMX_IndexParamAudioPcm:
+        {
+            OMX_AUDIO_PARAM_PCMMODETYPE *pcmParams =
+                (OMX_AUDIO_PARAM_PCMMODETYPE *)params;
+
+            if (pcmParams->nPortIndex != 0) {
+                return OMX_ErrorUndefined;
+            }
+
+            pcmParams->eNumData = OMX_NumericalDataSigned;
+            pcmParams->eEndian = OMX_EndianBig;
+            pcmParams->bInterleaved = OMX_TRUE;
+            pcmParams->nBitPerSample = 16;
+            pcmParams->ePCMMode = OMX_AUDIO_PCMModeLinear;
+            pcmParams->eChannelMapping[0] = OMX_AUDIO_ChannelCF;
+
+            pcmParams->nChannels = 1;
+            pcmParams->nSamplingRate = kSampleRate;
+
+            return OMX_ErrorNone;
+        }
+
+        default:
+            return SimpleSoftOMXComponent::internalGetParameter(index, params);
+    }
+}
+
+OMX_ERRORTYPE SoftAMRNBEncoder::internalSetParameter(
+        OMX_INDEXTYPE index, const OMX_PTR params) {
+    switch (index) {
+        case OMX_IndexParamStandardComponentRole:
+        {
+            const OMX_PARAM_COMPONENTROLETYPE *roleParams =
+                (const OMX_PARAM_COMPONENTROLETYPE *)params;
+
+            if (strncmp((const char *)roleParams->cRole,
+                        "audio_encoder.amrnb",
+                        OMX_MAX_STRINGNAME_SIZE - 1)) {
+                return OMX_ErrorUndefined;
+            }
+
+            return OMX_ErrorNone;
+        }
+
+        case OMX_IndexParamAudioPortFormat:
+        {
+            const OMX_AUDIO_PARAM_PORTFORMATTYPE *formatParams =
+                (const OMX_AUDIO_PARAM_PORTFORMATTYPE *)params;
+
+            if (formatParams->nPortIndex > 1) {
+                return OMX_ErrorUndefined;
+            }
+
+            if (formatParams->nIndex > 0) {
+                return OMX_ErrorNoMore;
+            }
+
+            if ((formatParams->nPortIndex == 0
+                        && formatParams->eEncoding != OMX_AUDIO_CodingPCM)
+                || (formatParams->nPortIndex == 1
+                        && formatParams->eEncoding != OMX_AUDIO_CodingAMR)) {
+                return OMX_ErrorUndefined;
+            }
+
+            return OMX_ErrorNone;
+        }
+
+        case OMX_IndexParamAudioAmr:
+        {
+            OMX_AUDIO_PARAM_AMRTYPE *amrParams =
+                (OMX_AUDIO_PARAM_AMRTYPE *)params;
+
+            if (amrParams->nPortIndex != 1) {
+                return OMX_ErrorUndefined;
+            }
+
+            if (amrParams->nChannels != 1
+                    || amrParams->eAMRDTXMode != OMX_AUDIO_AMRDTXModeOff
+                    || amrParams->eAMRFrameFormat
+                            != OMX_AUDIO_AMRFrameFormatFSF
+                    || amrParams->eAMRBandMode < OMX_AUDIO_AMRBandModeNB0
+                    || amrParams->eAMRBandMode > OMX_AUDIO_AMRBandModeNB7) {
+                return OMX_ErrorUndefined;
+            }
+
+            mBitRate = amrParams->nBitRate;
+            mMode = amrParams->eAMRBandMode - 1;
+
+            amrParams->eAMRDTXMode = OMX_AUDIO_AMRDTXModeOff;
+            amrParams->eAMRFrameFormat = OMX_AUDIO_AMRFrameFormatFSF;
+
+            return OMX_ErrorNone;
+        }
+
+        case OMX_IndexParamAudioPcm:
+        {
+            OMX_AUDIO_PARAM_PCMMODETYPE *pcmParams =
+                (OMX_AUDIO_PARAM_PCMMODETYPE *)params;
+
+            if (pcmParams->nPortIndex != 0) {
+                return OMX_ErrorUndefined;
+            }
+
+            if (pcmParams->nChannels != 1
+                    || pcmParams->nSamplingRate != kSampleRate) {
+                return OMX_ErrorUndefined;
+            }
+
+            return OMX_ErrorNone;
+        }
+
+
+        default:
+            return SimpleSoftOMXComponent::internalSetParameter(index, params);
+    }
+}
+
+void SoftAMRNBEncoder::onQueueFilled(OMX_U32 portIndex) {
+    if (mSignalledError) {
+        return;
+    }
+
+    List<BufferInfo *> &inQueue = getPortQueue(0);
+    List<BufferInfo *> &outQueue = getPortQueue(1);
+
+    size_t numBytesPerInputFrame = kNumSamplesPerFrame * sizeof(int16_t);
+
+    for (;;) {
+        // We do the following until we run out of buffers.
+
+        while (mInputSize < numBytesPerInputFrame) {
+            // As long as there's still input data to be read we
+            // will drain "kNumSamplesPerFrame" samples
+            // into the "mInputFrame" buffer and then encode those
+            // as a unit into an output buffer.
+
+            if (mSawInputEOS || inQueue.empty()) {
+                return;
+            }
+
+            BufferInfo *inInfo = *inQueue.begin();
+            OMX_BUFFERHEADERTYPE *inHeader = inInfo->mHeader;
+
+            const void *inData = inHeader->pBuffer + inHeader->nOffset;
+
+            size_t copy = numBytesPerInputFrame - mInputSize;
+            if (copy > inHeader->nFilledLen) {
+                copy = inHeader->nFilledLen;
+            }
+
+            if (mInputSize == 0) {
+                mInputTimeUs = inHeader->nTimeStamp;
+            }
+
+            memcpy((uint8_t *)mInputFrame + mInputSize, inData, copy);
+            mInputSize += copy;
+
+            inHeader->nOffset += copy;
+            inHeader->nFilledLen -= copy;
+
+            // "Time" on the input buffer has in effect advanced by the
+            // number of audio frames we just advanced nOffset by.
+            inHeader->nTimeStamp +=
+                (copy * 1000000ll / kSampleRate) / sizeof(int16_t);
+
+            if (inHeader->nFilledLen == 0) {
+                if (inHeader->nFlags & OMX_BUFFERFLAG_EOS) {
+                    ALOGV("saw input EOS");
+                    mSawInputEOS = true;
+
+                    // Pad any remaining data with zeroes.
+                    memset((uint8_t *)mInputFrame + mInputSize,
+                           0,
+                           numBytesPerInputFrame - mInputSize);
+
+                    mInputSize = numBytesPerInputFrame;
+                }
+
+                inQueue.erase(inQueue.begin());
+                inInfo->mOwnedByUs = false;
+                notifyEmptyBufferDone(inHeader);
+
+                inData = NULL;
+                inHeader = NULL;
+                inInfo = NULL;
+            }
+        }
+
+        // At this  point we have all the input data necessary to encode
+        // a single frame, all we need is an output buffer to store the result
+        // in.
+
+        if (outQueue.empty()) {
+            return;
+        }
+
+        BufferInfo *outInfo = *outQueue.begin();
+        OMX_BUFFERHEADERTYPE *outHeader = outInfo->mHeader;
+
+        uint8_t *outPtr = outHeader->pBuffer + outHeader->nOffset;
+        size_t outAvailable = outHeader->nAllocLen - outHeader->nOffset;
+
+        Frame_Type_3GPP frameType;
+        int res = AMREncode(
+                mEncState, mSidState, (Mode)mMode,
+                mInputFrame, outPtr, &frameType, AMR_TX_WMF);
+
+        CHECK_GE(res, 0);
+        CHECK_LE((size_t)res, outAvailable);
+
+        // Convert header byte from WMF to IETF format.
+        outPtr[0] = ((outPtr[0] << 3) | 4) & 0x7c;
+
+        outHeader->nFilledLen = res;
+        outHeader->nFlags = OMX_BUFFERFLAG_ENDOFFRAME;
+
+        if (mSawInputEOS) {
+            // We also tag this output buffer with EOS if it corresponds
+            // to the final input buffer.
+            outHeader->nFlags = OMX_BUFFERFLAG_EOS;
+        }
+
+        outHeader->nTimeStamp = mInputTimeUs;
+
+#if 0
+        ALOGI("sending %d bytes of data (time = %lld us, flags = 0x%08lx)",
+              nOutputBytes, mInputTimeUs, outHeader->nFlags);
+
+        hexdump(outHeader->pBuffer + outHeader->nOffset, outHeader->nFilledLen);
+#endif
+
+        outQueue.erase(outQueue.begin());
+        outInfo->mOwnedByUs = false;
+        notifyFillBufferDone(outHeader);
+
+        outHeader = NULL;
+        outInfo = NULL;
+
+        mInputSize = 0;
+    }
+}
+
+}  // namespace android
+
+android::SoftOMXComponent *createSoftOMXComponent(
+        const char *name, const OMX_CALLBACKTYPE *callbacks,
+        OMX_PTR appData, OMX_COMPONENTTYPE **component) {
+    return new android::SoftAMRNBEncoder(name, callbacks, appData, component);
+}
diff --git a/media/libstagefright/codecs/amrnb/enc/SoftAMRNBEncoder.h b/media/libstagefright/codecs/amrnb/enc/SoftAMRNBEncoder.h
new file mode 100644
index 0000000..50178c4
--- /dev/null
+++ b/media/libstagefright/codecs/amrnb/enc/SoftAMRNBEncoder.h
@@ -0,0 +1,72 @@
+/*
+ * 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.
+ */
+
+#ifndef SOFT_AMRNB_ENCODER_H_
+
+#define SOFT_AMRNB_ENCODER_H_
+
+#include "SimpleSoftOMXComponent.h"
+
+namespace android {
+
+struct SoftAMRNBEncoder : public SimpleSoftOMXComponent {
+    SoftAMRNBEncoder(
+            const char *name,
+            const OMX_CALLBACKTYPE *callbacks,
+            OMX_PTR appData,
+            OMX_COMPONENTTYPE **component);
+
+protected:
+    virtual ~SoftAMRNBEncoder();
+
+    virtual OMX_ERRORTYPE internalGetParameter(
+            OMX_INDEXTYPE index, OMX_PTR params);
+
+    virtual OMX_ERRORTYPE internalSetParameter(
+            OMX_INDEXTYPE index, const OMX_PTR params);
+
+    virtual void onQueueFilled(OMX_U32 portIndex);
+
+private:
+    enum {
+        kNumBuffers             = 4,
+        kNumSamplesPerFrame     = 160,
+    };
+
+    void *mEncState;
+    void *mSidState;
+
+    OMX_U32 mBitRate;
+    int mMode;
+
+    size_t mInputSize;
+    int16_t mInputFrame[kNumSamplesPerFrame];
+    int64_t mInputTimeUs;
+
+    bool mSawInputEOS;
+    bool mSignalledError;
+
+    void initPorts();
+    status_t initEncoder();
+
+    status_t setAudioParams();
+
+    DISALLOW_EVIL_CONSTRUCTORS(SoftAMRNBEncoder);
+};
+
+}  // namespace android
+
+#endif  // SOFT_AMRNB_ENCODER_H_
diff --git a/media/libstagefright/codecs/amrwbenc/Android.mk b/media/libstagefright/codecs/amrwbenc/Android.mk
index 5179380..6ce6171 100644
--- a/media/libstagefright/codecs/amrwbenc/Android.mk
+++ b/media/libstagefright/codecs/amrwbenc/Android.mk
@@ -3,7 +3,7 @@
 include frameworks/base/media/libstagefright/codecs/common/Config.mk
 
 
- 	
+
 LOCAL_SRC_FILES := \
 	AMRWBEncoder.cpp \
 	src/autocorr.c \
@@ -91,7 +91,7 @@
 
 LOCAL_ARM_MODE := arm
 
-LOCAL_STATIC_LIBRARIES := 
+LOCAL_STATIC_LIBRARIES :=
 
 LOCAL_SHARED_LIBRARIES :=
 
@@ -117,4 +117,26 @@
 
 include $(BUILD_STATIC_LIBRARY)
 
+################################################################################
 
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+        SoftAMRWBEncoder.cpp
+
+LOCAL_C_INCLUDES := \
+        frameworks/base/media/libstagefright/include \
+        frameworks/base/include/media/stagefright/openmax \
+	frameworks/base/media/libstagefright/codecs/common/include \
+
+LOCAL_STATIC_LIBRARIES := \
+        libstagefright_amrwbenc
+
+LOCAL_SHARED_LIBRARIES := \
+        libstagefright_omx libstagefright_foundation libutils \
+        libstagefright_enc_common
+
+LOCAL_MODULE := libstagefright_soft_amrwbenc
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/media/libstagefright/codecs/amrwbenc/SoftAMRWBEncoder.cpp b/media/libstagefright/codecs/amrwbenc/SoftAMRWBEncoder.cpp
new file mode 100644
index 0000000..9ccb49c
--- /dev/null
+++ b/media/libstagefright/codecs/amrwbenc/SoftAMRWBEncoder.cpp
@@ -0,0 +1,459 @@
+/*
+ * 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.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "SoftAMRWBEncoder"
+#include <utils/Log.h>
+
+#include "SoftAMRWBEncoder.h"
+
+#include "cmnMemory.h"
+
+#include <media/stagefright/foundation/ADebug.h>
+#include <media/stagefright/foundation/hexdump.h>
+
+namespace android {
+
+static const int32_t kSampleRate = 16000;
+
+template<class T>
+static void InitOMXParams(T *params) {
+    params->nSize = sizeof(T);
+    params->nVersion.s.nVersionMajor = 1;
+    params->nVersion.s.nVersionMinor = 0;
+    params->nVersion.s.nRevision = 0;
+    params->nVersion.s.nStep = 0;
+}
+
+SoftAMRWBEncoder::SoftAMRWBEncoder(
+        const char *name,
+        const OMX_CALLBACKTYPE *callbacks,
+        OMX_PTR appData,
+        OMX_COMPONENTTYPE **component)
+    : SimpleSoftOMXComponent(name, callbacks, appData, component),
+      mEncoderHandle(NULL),
+      mApiHandle(NULL),
+      mMemOperator(NULL),
+      mBitRate(0),
+      mMode(VOAMRWB_MD66),
+      mInputSize(0),
+      mInputTimeUs(-1ll),
+      mSawInputEOS(false),
+      mSignalledError(false) {
+    initPorts();
+    CHECK_EQ(initEncoder(), (status_t)OK);
+}
+
+SoftAMRWBEncoder::~SoftAMRWBEncoder() {
+    if (mEncoderHandle != NULL) {
+        CHECK_EQ(VO_ERR_NONE, mApiHandle->Uninit(mEncoderHandle));
+        mEncoderHandle = NULL;
+    }
+
+    delete mApiHandle;
+    mApiHandle = NULL;
+
+    delete mMemOperator;
+    mMemOperator = NULL;
+}
+
+void SoftAMRWBEncoder::initPorts() {
+    OMX_PARAM_PORTDEFINITIONTYPE def;
+    InitOMXParams(&def);
+
+    def.nPortIndex = 0;
+    def.eDir = OMX_DirInput;
+    def.nBufferCountMin = kNumBuffers;
+    def.nBufferCountActual = def.nBufferCountMin;
+    def.nBufferSize = kNumSamplesPerFrame * sizeof(int16_t);
+    def.bEnabled = OMX_TRUE;
+    def.bPopulated = OMX_FALSE;
+    def.eDomain = OMX_PortDomainAudio;
+    def.bBuffersContiguous = OMX_FALSE;
+    def.nBufferAlignment = 1;
+
+    def.format.audio.cMIMEType = const_cast<char *>("audio/raw");
+    def.format.audio.pNativeRender = NULL;
+    def.format.audio.bFlagErrorConcealment = OMX_FALSE;
+    def.format.audio.eEncoding = OMX_AUDIO_CodingPCM;
+
+    addPort(def);
+
+    def.nPortIndex = 1;
+    def.eDir = OMX_DirOutput;
+    def.nBufferCountMin = kNumBuffers;
+    def.nBufferCountActual = def.nBufferCountMin;
+    def.nBufferSize = 8192;
+    def.bEnabled = OMX_TRUE;
+    def.bPopulated = OMX_FALSE;
+    def.eDomain = OMX_PortDomainAudio;
+    def.bBuffersContiguous = OMX_FALSE;
+    def.nBufferAlignment = 2;
+
+    def.format.audio.cMIMEType = const_cast<char *>("audio/amr-wb");
+    def.format.audio.pNativeRender = NULL;
+    def.format.audio.bFlagErrorConcealment = OMX_FALSE;
+    def.format.audio.eEncoding = OMX_AUDIO_CodingAMR;
+
+    addPort(def);
+}
+
+status_t SoftAMRWBEncoder::initEncoder() {
+    mApiHandle = new VO_AUDIO_CODECAPI;
+
+    if (VO_ERR_NONE != voGetAMRWBEncAPI(mApiHandle)) {
+        ALOGE("Failed to get api handle");
+        return UNKNOWN_ERROR;
+    }
+
+    mMemOperator = new VO_MEM_OPERATOR;
+    mMemOperator->Alloc = cmnMemAlloc;
+    mMemOperator->Copy = cmnMemCopy;
+    mMemOperator->Free = cmnMemFree;
+    mMemOperator->Set = cmnMemSet;
+    mMemOperator->Check = cmnMemCheck;
+
+    VO_CODEC_INIT_USERDATA userData;
+    memset(&userData, 0, sizeof(userData));
+    userData.memflag = VO_IMF_USERMEMOPERATOR;
+    userData.memData = (VO_PTR) mMemOperator;
+
+    if (VO_ERR_NONE != mApiHandle->Init(
+                &mEncoderHandle, VO_AUDIO_CodingAMRWB, &userData)) {
+        ALOGE("Failed to init AMRWB encoder");
+        return UNKNOWN_ERROR;
+    }
+
+    VOAMRWBFRAMETYPE type = VOAMRWB_RFC3267;
+    if (VO_ERR_NONE != mApiHandle->SetParam(
+                mEncoderHandle, VO_PID_AMRWB_FRAMETYPE, &type)) {
+        ALOGE("Failed to set AMRWB encoder frame type to %d", type);
+        return UNKNOWN_ERROR;
+    }
+
+    return OK;
+}
+
+OMX_ERRORTYPE SoftAMRWBEncoder::internalGetParameter(
+        OMX_INDEXTYPE index, OMX_PTR params) {
+    switch (index) {
+        case OMX_IndexParamAudioPortFormat:
+        {
+            OMX_AUDIO_PARAM_PORTFORMATTYPE *formatParams =
+                (OMX_AUDIO_PARAM_PORTFORMATTYPE *)params;
+
+            if (formatParams->nPortIndex > 1) {
+                return OMX_ErrorUndefined;
+            }
+
+            if (formatParams->nIndex > 0) {
+                return OMX_ErrorNoMore;
+            }
+
+            formatParams->eEncoding =
+                (formatParams->nPortIndex == 0)
+                    ? OMX_AUDIO_CodingPCM : OMX_AUDIO_CodingAMR;
+
+            return OMX_ErrorNone;
+        }
+
+        case OMX_IndexParamAudioAmr:
+        {
+            OMX_AUDIO_PARAM_AMRTYPE *amrParams =
+                (OMX_AUDIO_PARAM_AMRTYPE *)params;
+
+            if (amrParams->nPortIndex != 1) {
+                return OMX_ErrorUndefined;
+            }
+
+            amrParams->nChannels = 1;
+            amrParams->nBitRate = mBitRate;
+
+            amrParams->eAMRBandMode =
+                (OMX_AUDIO_AMRBANDMODETYPE)(mMode + OMX_AUDIO_AMRBandModeWB0);
+
+            amrParams->eAMRDTXMode = OMX_AUDIO_AMRDTXModeOff;
+            amrParams->eAMRFrameFormat = OMX_AUDIO_AMRFrameFormatFSF;
+
+            return OMX_ErrorNone;
+        }
+
+        case OMX_IndexParamAudioPcm:
+        {
+            OMX_AUDIO_PARAM_PCMMODETYPE *pcmParams =
+                (OMX_AUDIO_PARAM_PCMMODETYPE *)params;
+
+            if (pcmParams->nPortIndex != 0) {
+                return OMX_ErrorUndefined;
+            }
+
+            pcmParams->eNumData = OMX_NumericalDataSigned;
+            pcmParams->eEndian = OMX_EndianBig;
+            pcmParams->bInterleaved = OMX_TRUE;
+            pcmParams->nBitPerSample = 16;
+            pcmParams->ePCMMode = OMX_AUDIO_PCMModeLinear;
+            pcmParams->eChannelMapping[0] = OMX_AUDIO_ChannelCF;
+
+            pcmParams->nChannels = 1;
+            pcmParams->nSamplingRate = kSampleRate;
+
+            return OMX_ErrorNone;
+        }
+
+        default:
+            return SimpleSoftOMXComponent::internalGetParameter(index, params);
+    }
+}
+
+OMX_ERRORTYPE SoftAMRWBEncoder::internalSetParameter(
+        OMX_INDEXTYPE index, const OMX_PTR params) {
+    switch (index) {
+        case OMX_IndexParamStandardComponentRole:
+        {
+            const OMX_PARAM_COMPONENTROLETYPE *roleParams =
+                (const OMX_PARAM_COMPONENTROLETYPE *)params;
+
+            if (strncmp((const char *)roleParams->cRole,
+                        "audio_encoder.amrwb",
+                        OMX_MAX_STRINGNAME_SIZE - 1)) {
+                return OMX_ErrorUndefined;
+            }
+
+            return OMX_ErrorNone;
+        }
+
+        case OMX_IndexParamAudioPortFormat:
+        {
+            const OMX_AUDIO_PARAM_PORTFORMATTYPE *formatParams =
+                (const OMX_AUDIO_PARAM_PORTFORMATTYPE *)params;
+
+            if (formatParams->nPortIndex > 1) {
+                return OMX_ErrorUndefined;
+            }
+
+            if (formatParams->nIndex > 0) {
+                return OMX_ErrorNoMore;
+            }
+
+            if ((formatParams->nPortIndex == 0
+                        && formatParams->eEncoding != OMX_AUDIO_CodingPCM)
+                || (formatParams->nPortIndex == 1
+                        && formatParams->eEncoding != OMX_AUDIO_CodingAMR)) {
+                return OMX_ErrorUndefined;
+            }
+
+            return OMX_ErrorNone;
+        }
+
+        case OMX_IndexParamAudioAmr:
+        {
+            OMX_AUDIO_PARAM_AMRTYPE *amrParams =
+                (OMX_AUDIO_PARAM_AMRTYPE *)params;
+
+            if (amrParams->nPortIndex != 1) {
+                return OMX_ErrorUndefined;
+            }
+
+            if (amrParams->nChannels != 1
+                    || amrParams->eAMRDTXMode != OMX_AUDIO_AMRDTXModeOff
+                    || amrParams->eAMRFrameFormat
+                            != OMX_AUDIO_AMRFrameFormatFSF
+                    || amrParams->eAMRBandMode < OMX_AUDIO_AMRBandModeWB0
+                    || amrParams->eAMRBandMode > OMX_AUDIO_AMRBandModeWB8) {
+                return OMX_ErrorUndefined;
+            }
+
+            mBitRate = amrParams->nBitRate;
+
+            mMode = (VOAMRWBMODE)(
+                    amrParams->eAMRBandMode - OMX_AUDIO_AMRBandModeWB0);
+
+            amrParams->eAMRDTXMode = OMX_AUDIO_AMRDTXModeOff;
+            amrParams->eAMRFrameFormat = OMX_AUDIO_AMRFrameFormatFSF;
+
+            if (VO_ERR_NONE !=
+                    mApiHandle->SetParam(
+                        mEncoderHandle, VO_PID_AMRWB_MODE,  &mMode)) {
+                ALOGE("Failed to set AMRWB encoder mode to %d", mMode);
+                return OMX_ErrorUndefined;
+            }
+
+            return OMX_ErrorNone;
+        }
+
+        case OMX_IndexParamAudioPcm:
+        {
+            OMX_AUDIO_PARAM_PCMMODETYPE *pcmParams =
+                (OMX_AUDIO_PARAM_PCMMODETYPE *)params;
+
+            if (pcmParams->nPortIndex != 0) {
+                return OMX_ErrorUndefined;
+            }
+
+            if (pcmParams->nChannels != 1
+                    || pcmParams->nSamplingRate != (OMX_U32)kSampleRate) {
+                return OMX_ErrorUndefined;
+            }
+
+            return OMX_ErrorNone;
+        }
+
+
+        default:
+            return SimpleSoftOMXComponent::internalSetParameter(index, params);
+    }
+}
+
+void SoftAMRWBEncoder::onQueueFilled(OMX_U32 portIndex) {
+    if (mSignalledError) {
+        return;
+    }
+
+    List<BufferInfo *> &inQueue = getPortQueue(0);
+    List<BufferInfo *> &outQueue = getPortQueue(1);
+
+    size_t numBytesPerInputFrame = kNumSamplesPerFrame * sizeof(int16_t);
+
+    for (;;) {
+        // We do the following until we run out of buffers.
+
+        while (mInputSize < numBytesPerInputFrame) {
+            // As long as there's still input data to be read we
+            // will drain "kNumSamplesPerFrame" samples
+            // into the "mInputFrame" buffer and then encode those
+            // as a unit into an output buffer.
+
+            if (mSawInputEOS || inQueue.empty()) {
+                return;
+            }
+
+            BufferInfo *inInfo = *inQueue.begin();
+            OMX_BUFFERHEADERTYPE *inHeader = inInfo->mHeader;
+
+            const void *inData = inHeader->pBuffer + inHeader->nOffset;
+
+            size_t copy = numBytesPerInputFrame - mInputSize;
+            if (copy > inHeader->nFilledLen) {
+                copy = inHeader->nFilledLen;
+            }
+
+            if (mInputSize == 0) {
+                mInputTimeUs = inHeader->nTimeStamp;
+            }
+
+            memcpy((uint8_t *)mInputFrame + mInputSize, inData, copy);
+            mInputSize += copy;
+
+            inHeader->nOffset += copy;
+            inHeader->nFilledLen -= copy;
+
+            // "Time" on the input buffer has in effect advanced by the
+            // number of audio frames we just advanced nOffset by.
+            inHeader->nTimeStamp +=
+                (copy * 1000000ll / kSampleRate) / sizeof(int16_t);
+
+            if (inHeader->nFilledLen == 0) {
+                if (inHeader->nFlags & OMX_BUFFERFLAG_EOS) {
+                    ALOGV("saw input EOS");
+                    mSawInputEOS = true;
+
+                    // Pad any remaining data with zeroes.
+                    memset((uint8_t *)mInputFrame + mInputSize,
+                           0,
+                           numBytesPerInputFrame - mInputSize);
+
+                    mInputSize = numBytesPerInputFrame;
+                }
+
+                inQueue.erase(inQueue.begin());
+                inInfo->mOwnedByUs = false;
+                notifyEmptyBufferDone(inHeader);
+
+                inData = NULL;
+                inHeader = NULL;
+                inInfo = NULL;
+            }
+        }
+
+        // At this  point we have all the input data necessary to encode
+        // a single frame, all we need is an output buffer to store the result
+        // in.
+
+        if (outQueue.empty()) {
+            return;
+        }
+
+        BufferInfo *outInfo = *outQueue.begin();
+        OMX_BUFFERHEADERTYPE *outHeader = outInfo->mHeader;
+
+        uint8_t *outPtr = outHeader->pBuffer + outHeader->nOffset;
+        size_t outAvailable = outHeader->nAllocLen - outHeader->nOffset;
+
+        VO_CODECBUFFER inputData;
+        memset(&inputData, 0, sizeof(inputData));
+        inputData.Buffer = (unsigned char *) mInputFrame;
+        inputData.Length = mInputSize;
+
+        CHECK_EQ(VO_ERR_NONE,
+                 mApiHandle->SetInputData(mEncoderHandle, &inputData));
+
+        VO_CODECBUFFER outputData;
+        memset(&outputData, 0, sizeof(outputData));
+        VO_AUDIO_OUTPUTINFO outputInfo;
+        memset(&outputInfo, 0, sizeof(outputInfo));
+
+        outputData.Buffer = outPtr;
+        outputData.Length = outAvailable;
+        VO_U32 ret = mApiHandle->GetOutputData(
+                mEncoderHandle, &outputData, &outputInfo);
+        CHECK(ret == VO_ERR_NONE || ret == VO_ERR_INPUT_BUFFER_SMALL);
+
+        outHeader->nFilledLen = outputData.Length;
+        outHeader->nFlags = OMX_BUFFERFLAG_ENDOFFRAME;
+
+        if (mSawInputEOS) {
+            // We also tag this output buffer with EOS if it corresponds
+            // to the final input buffer.
+            outHeader->nFlags = OMX_BUFFERFLAG_EOS;
+        }
+
+        outHeader->nTimeStamp = mInputTimeUs;
+
+#if 0
+        ALOGI("sending %ld bytes of data (time = %lld us, flags = 0x%08lx)",
+              outHeader->nFilledLen, mInputTimeUs, outHeader->nFlags);
+
+        hexdump(outHeader->pBuffer + outHeader->nOffset, outHeader->nFilledLen);
+#endif
+
+        outQueue.erase(outQueue.begin());
+        outInfo->mOwnedByUs = false;
+        notifyFillBufferDone(outHeader);
+
+        outHeader = NULL;
+        outInfo = NULL;
+
+        mInputSize = 0;
+    }
+}
+
+}  // namespace android
+
+android::SoftOMXComponent *createSoftOMXComponent(
+        const char *name, const OMX_CALLBACKTYPE *callbacks,
+        OMX_PTR appData, OMX_COMPONENTTYPE **component) {
+    return new android::SoftAMRWBEncoder(name, callbacks, appData, component);
+}
diff --git a/media/libstagefright/codecs/amrwbenc/SoftAMRWBEncoder.h b/media/libstagefright/codecs/amrwbenc/SoftAMRWBEncoder.h
new file mode 100644
index 0000000..d0c1dab
--- /dev/null
+++ b/media/libstagefright/codecs/amrwbenc/SoftAMRWBEncoder.h
@@ -0,0 +1,76 @@
+/*
+ * 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.
+ */
+
+#ifndef SOFT_AMRWB_ENCODER_H_
+
+#define SOFT_AMRWB_ENCODER_H_
+
+#include "SimpleSoftOMXComponent.h"
+
+#include "voAMRWB.h"
+
+struct VO_AUDIO_CODECAPI;
+struct VO_MEM_OPERATOR;
+
+namespace android {
+
+struct SoftAMRWBEncoder : public SimpleSoftOMXComponent {
+    SoftAMRWBEncoder(
+            const char *name,
+            const OMX_CALLBACKTYPE *callbacks,
+            OMX_PTR appData,
+            OMX_COMPONENTTYPE **component);
+
+protected:
+    virtual ~SoftAMRWBEncoder();
+
+    virtual OMX_ERRORTYPE internalGetParameter(
+            OMX_INDEXTYPE index, OMX_PTR params);
+
+    virtual OMX_ERRORTYPE internalSetParameter(
+            OMX_INDEXTYPE index, const OMX_PTR params);
+
+    virtual void onQueueFilled(OMX_U32 portIndex);
+
+private:
+    enum {
+        kNumBuffers             = 4,
+        kNumSamplesPerFrame     = 320,
+    };
+
+    void *mEncoderHandle;
+    VO_AUDIO_CODECAPI *mApiHandle;
+    VO_MEM_OPERATOR *mMemOperator;
+
+    OMX_U32 mBitRate;
+    VOAMRWBMODE mMode;
+
+    size_t mInputSize;
+    int16_t mInputFrame[kNumSamplesPerFrame];
+    int64_t mInputTimeUs;
+
+    bool mSawInputEOS;
+    bool mSignalledError;
+
+    void initPorts();
+    status_t initEncoder();
+
+    DISALLOW_EVIL_CONSTRUCTORS(SoftAMRWBEncoder);
+};
+
+}  // namespace android
+
+#endif  // SOFT_AMRWB_ENCODER_H_
diff --git a/media/libstagefright/codecs/amrwbenc/inc/basic_op.h b/media/libstagefright/codecs/amrwbenc/inc/basic_op.h
index 7734913..c23dce6 100644
--- a/media/libstagefright/codecs/amrwbenc/inc/basic_op.h
+++ b/media/libstagefright/codecs/amrwbenc/inc/basic_op.h
@@ -33,7 +33,7 @@
 #define  static_vo  static __inline__
 #else
 #define  static_vo  static __inline
-#endif 
+#endif
 
 #define saturate(L_var1) (((L_var1) > 0X00007fffL) ? (MAX_16): (((L_var1) < (Word32) 0xffff8000L) ? (MIN_16): ((L_var1) & 0xffff)))
 
@@ -87,7 +87,7 @@
 static_vo Word32 L_shr_r (Word32 L_var1, Word16 var2); 				/* Long shift right with round,  3   */
 static_vo Word16 norm_s (Word16 var1);             				/* Short norm,           15  */
 static_vo Word16 div_s (Word16 var1, Word16 var2); 				/* Short division,       18  */
-static_vo Word16 norm_l (Word32 L_var1);           				/* Long norm,            30  */   
+static_vo Word16 norm_l (Word32 L_var1);           				/* Long norm,            30  */
 
 /*___________________________________________________________________________
 |                                                                           |
@@ -1030,8 +1030,8 @@
 				L_num <<= 1;
 				if (L_num >= L_denom)
 				{
-					L_num -= L_denom;      
-					var_out += 1;          
+					L_num -= L_denom;
+					var_out += 1;
 				}
 			}
 		}
diff --git a/media/libstagefright/codecs/amrwbenc/inc/homing.tab b/media/libstagefright/codecs/amrwbenc/inc/homing.tab
index edcccdd..e399fb8 100644
--- a/media/libstagefright/codecs/amrwbenc/inc/homing.tab
+++ b/media/libstagefright/codecs/amrwbenc/inc/homing.tab
@@ -33,89 +33,89 @@
 
 static const Word16 dfh_M7k[PRMN_7k] =
 {
-  3168, 29954, 29213, 16121, 
-	64, 13440, 30624, 16430, 
+  3168, 29954, 29213, 16121,
+	64, 13440, 30624, 16430,
  19008
 };
 
 static const Word16 dfh_M9k[PRMN_9k] =
 {
-   3168, 31665,  9943, 9123, 
-  15599,  4358, 20248, 2048, 
+   3168, 31665,  9943, 9123,
+  15599,  4358, 20248, 2048,
   17040, 27787, 16816, 13888
 };
 
 static const Word16 dfh_M12k[PRMN_12k] =
 {
-  3168, 31665,  9943,  9128, 
-  3647,  8129, 30930, 27926, 
- 18880, 12319,   496,  1042, 
-  4061, 20446, 25629, 28069, 
+  3168, 31665,  9943,  9128,
+  3647,  8129, 30930, 27926,
+ 18880, 12319,   496,  1042,
+  4061, 20446, 25629, 28069,
  13948
 };
 
 static const Word16 dfh_M14k[PRMN_14k] =
 {
-    3168, 31665,  9943,  9131, 
-   24815,   655, 26616, 26764, 
-    7238, 19136,  6144,    88, 
-	4158, 25733, 30567, 30494, 
+    3168, 31665,  9943,  9131,
+   24815,   655, 26616, 26764,
+    7238, 19136,  6144,    88,
+	4158, 25733, 30567, 30494,
 	221, 20321, 17823
 };
 
 static const Word16 dfh_M16k[PRMN_16k] =
 {
-    3168, 31665,  9943,  9131, 
-   24815,   700,  3824,  7271, 
-   26400,  9528,  6594, 26112, 
-     108,  2068, 12867, 16317, 
-   23035, 24632,  7528,  1752, 
+    3168, 31665,  9943,  9131,
+   24815,   700,  3824,  7271,
+   26400,  9528,  6594, 26112,
+     108,  2068, 12867, 16317,
+   23035, 24632,  7528,  1752,
     6759, 24576
 };
 
 static const Word16 dfh_M18k[PRMN_18k] =
 {
-     3168, 31665,  9943,  9135, 
-	14787, 14423, 30477, 24927, 
-	25345, 30154,   916,  5728, 
-	18978,  2048,   528, 16449, 
-	 2436,  3581, 23527, 29479, 
-	 8237, 16810, 27091, 19052, 
+     3168, 31665,  9943,  9135,
+	14787, 14423, 30477, 24927,
+	25345, 30154,   916,  5728,
+	18978,  2048,   528, 16449,
+	 2436,  3581, 23527, 29479,
+	 8237, 16810, 27091, 19052,
 	    0
 };
 
 static const Word16 dfh_M20k[PRMN_20k] =
 {
-     3168, 31665,  9943,  9129, 
-	 8637, 31807, 24646,   736, 
-	28643,  2977,  2566, 25564, 
-	12930, 13960,  2048,   834, 
-	 3270,  4100, 26920, 16237, 
-	31227, 17667, 15059, 20589, 
+     3168, 31665,  9943,  9129,
+	 8637, 31807, 24646,   736,
+	28643,  2977,  2566, 25564,
+	12930, 13960,  2048,   834,
+	 3270,  4100, 26920, 16237,
+	31227, 17667, 15059, 20589,
 	30249, 29123, 0
 };
 
 static const Word16 dfh_M23k[PRMN_23k] =
 {
-	 3168, 31665,  9943,  9132, 
-	16748,  3202, 28179, 16317, 
-	30590, 15857, 19960,  8818, 
-	21711, 21538,  4260, 16690, 
-	20224,  3666,  4194,  9497, 
-	16320, 15388,  5755, 31551, 
-	14080,  3574, 15932,    50, 
+	 3168, 31665,  9943,  9132,
+	16748,  3202, 28179, 16317,
+	30590, 15857, 19960,  8818,
+	21711, 21538,  4260, 16690,
+	20224,  3666,  4194,  9497,
+	16320, 15388,  5755, 31551,
+	14080,  3574, 15932,    50,
 	23392, 26053, 31216
 };
 
 static const Word16 dfh_M24k[PRMN_24k] =
 {
-	 3168, 31665,  9943,  9134, 
-	24776,  5857, 18475, 28535, 
-	29662, 14321, 16725,  4396, 
-	29353, 10003, 17068, 20504, 
-	  720,     0,  8465, 12581, 
-	28863, 24774,  9709, 26043, 
-	 7941, 27649, 13965, 15236, 
+	 3168, 31665,  9943,  9134,
+	24776,  5857, 18475, 28535,
+	29662, 14321, 16725,  4396,
+	29353, 10003, 17068, 20504,
+	  720,     0,  8465, 12581,
+	28863, 24774,  9709, 26043,
+	 7941, 27649, 13965, 15236,
 	18026, 22047, 16681,  3968
 };
 
diff --git a/media/libstagefright/codecs/amrwbenc/inc/isp_isf.tab b/media/libstagefright/codecs/amrwbenc/inc/isp_isf.tab
index 2322845..97c3b68 100644
--- a/media/libstagefright/codecs/amrwbenc/inc/isp_isf.tab
+++ b/media/libstagefright/codecs/amrwbenc/inc/isp_isf.tab
@@ -42,7 +42,7 @@
 
 /* slope in Q11 used to compute y = acos(x) */
 
-const static Word16 slope[128] = { 
+const static Word16 slope[128] = {
  -26214, -9039, -5243, -3799, -2979, -2405, -2064, -1771,
  -1579, -1409, -1279, -1170, -1079, -1004, -933, -880,
  -827, -783, -743, -708, -676, -647, -621, -599,
diff --git a/media/libstagefright/codecs/amrwbenc/inc/log2.h b/media/libstagefright/codecs/amrwbenc/inc/log2.h
index 6a35019..b065eb4 100644
--- a/media/libstagefright/codecs/amrwbenc/inc/log2.h
+++ b/media/libstagefright/codecs/amrwbenc/inc/log2.h
@@ -25,20 +25,20 @@
 */
 #ifndef __LOG2_H__
 #define __LOG2_H__
- 
+
 /*
 ********************************************************************************
 *                         INCLUDE FILES
 ********************************************************************************
 */
 #include "typedef.h"
- 
+
 /*
 ********************************************************************************
 *                         DEFINITION OF DATA TYPES
 ********************************************************************************
 */
- 
+
 /*
 ********************************************************************************
 *                         DECLARATION OF PROTOTYPES
diff --git a/media/libstagefright/codecs/amrwbenc/inc/mime_io.tab b/media/libstagefright/codecs/amrwbenc/inc/mime_io.tab
index 5f85dd0..7b485ea 100644
--- a/media/libstagefright/codecs/amrwbenc/inc/mime_io.tab
+++ b/media/libstagefright/codecs/amrwbenc/inc/mime_io.tab
@@ -98,7 +98,7 @@
    244,  61, 111, 164, 214,  65, 115, 168, 218,  70,
    120, 173, 223,  74, 124, 177, 227,  79, 129, 182,
    232,  83, 133, 186, 236,  88, 138, 191, 241,  92,
-   142, 195, 245                         
+   142, 195, 245
 };
 
 static Word16 sort_1425[285] = {
@@ -205,7 +205,7 @@
    257, 243, 229, 356, 159, 119,  67, 187, 173, 145,
    240,  77, 304, 332, 314, 342, 109, 254,  81, 278,
    105,  91, 346, 318, 183, 250, 197, 328,  95, 155,
-   169, 268, 226, 236, 264                 
+   169, 268, 226, 236, 264
 };
 
 static Word16 sort_1985[397] = {
@@ -248,7 +248,7 @@
    128, 118, 303, 104, 379, 182, 114, 375, 200,  96,
    293, 172, 214, 365, 279,  86, 289, 351, 347, 357,
    261, 186, 176, 271,  90, 100, 147, 322, 275, 361,
-    71, 332,  61, 265, 157, 246, 236         
+    71, 332,  61, 265, 157, 246, 236
 };
 
 static Word16 sort_2305[461] = {
@@ -349,7 +349,7 @@
    132, 453, 336, 425, 325, 347, 126, 104, 137, 458,
    352, 243, 447, 115, 341, 210, 330, 221, 232, 436,
    465, 319, 359, 111, 454, 228, 217, 122, 443, 348,
-   239, 250, 133, 144, 432, 337, 326         
+   239, 250, 133, 144, 432, 337, 326
 };
 
 static Word16 sort_SID[35] = {
diff --git a/media/libstagefright/codecs/amrwbenc/inc/stream.h b/media/libstagefright/codecs/amrwbenc/inc/stream.h
index 3e5336a..4c1d0f0 100644
--- a/media/libstagefright/codecs/amrwbenc/inc/stream.h
+++ b/media/libstagefright/codecs/amrwbenc/inc/stream.h
@@ -26,7 +26,7 @@
 #define __STREAM_H__
 
 #include "voMem.h"
-#define Frame_Maxsize  1024 * 2  //Work Buffer 10K 
+#define Frame_Maxsize  1024 * 2  //Work Buffer 10K
 #define Frame_MaxByte  640        //AMR_WB Encoder one frame 320 samples = 640 Bytes
 #define MIN(a,b)	 ((a) < (b)? (a) : (b))
 
@@ -35,7 +35,7 @@
 	unsigned char *frame_ptr;
 	unsigned char *frame_ptr_bk;
 	int  set_len;
-	int  framebuffer_len; 
+	int  framebuffer_len;
 	int  frame_storelen;
 	int  used_len;
 }FrameStream;
diff --git a/media/libstagefright/codecs/amrwbenc/inc/typedef.h b/media/libstagefright/codecs/amrwbenc/inc/typedef.h
index 533e68b..f08a678 100644
--- a/media/libstagefright/codecs/amrwbenc/inc/typedef.h
+++ b/media/libstagefright/codecs/amrwbenc/inc/typedef.h
@@ -31,7 +31,7 @@
 /*
  * this is the original code from the ETSI file typedef.h
  */
-   
+
 #if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(_MSC_VER) || defined(__ZTC__)
 typedef signed char Word8;
 typedef short Word16;
diff --git a/media/libstagefright/codecs/amrwbenc/inc/typedefs.h b/media/libstagefright/codecs/amrwbenc/inc/typedefs.h
index f30d255..0062584 100644
--- a/media/libstagefright/codecs/amrwbenc/inc/typedefs.h
+++ b/media/libstagefright/codecs/amrwbenc/inc/typedefs.h
@@ -45,7 +45,7 @@
 *        OSF           only defined if the current platform is an Alpha
 *        PC            only defined if the current platform is a PC
 *        SUN           only defined if the current platform is a Sun
-*        
+*
 *        LSBFIRST      is defined if the byte order on this platform is
 *                      "least significant byte first" -> defined on DEC Alpha
 *                      and PC, undefined on Sun
@@ -68,7 +68,7 @@
 
 /*
 ********************************************************************************
-*                         DEFINITION OF CONSTANTS 
+*                         DEFINITION OF CONSTANTS
 ********************************************************************************
 */
 /*
@@ -197,7 +197,7 @@
 #define     Syn_filt_32      voAWB_Syn_filt_32
 #define     Isf_isp          voAWB_Isf_isp
 #define     Levinson         voAWB_Levinson
-#define     median5          voAWB_median5           
+#define     median5          voAWB_median5
 #define     Pred_lt4         voAWB_Pred_lt4
 #define     Reorder_isf      voAWB_Reorder_isf
 #define     Dpisf_2s_36b     voAWB_Dpisf_2s_36b
diff --git a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/Deemph_32_opt.s b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/Deemph_32_opt.s
index c1c74e6..282db92 100644
--- a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/Deemph_32_opt.s
+++ b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/Deemph_32_opt.s
@@ -30,10 +30,10 @@
 
            .section  .text
            .global   Deemph_32_asm
-	   
+
 Deemph_32_asm:
 
-           STMFD   	r13!, {r4 - r12, r14} 
+           STMFD   	r13!, {r4 - r12, r14}
 	   MOV          r4, #2                   @i=0
 	   LDRSH        r6, [r0], #2             @load x_hi[0]
 	   LDRSH        r7, [r1], #2             @load x_lo[0]
@@ -47,9 +47,9 @@
 	   ADD          r12, r10, r7, LSL #4     @L_tmp += x_lo[0] << 4
 	   MOV          r10, r12, LSL #3         @L_tmp <<= 3
 	   MUL          r9, r5, r8
-	   LDRSH        r6, [r0], #2             @load x_hi[1] 
+	   LDRSH        r6, [r0], #2             @load x_hi[1]
 	   QDADD        r10, r10, r9
-	   LDRSH        r7, [r1], #2             @load x_lo[1]  
+	   LDRSH        r7, [r1], #2             @load x_lo[1]
 	   MOV          r12, r10, LSL #1         @L_tmp = L_mac(L_tmp, *mem, fac)
 	   QADD         r10, r12, r11
 	   MOV          r14, r10, ASR #16        @y[0] = round(L_tmp)
@@ -94,9 +94,9 @@
 
            BLT          LOOP
            STR          r14, [r3]
-           STRH         r14, [r2]	   
+           STRH         r14, [r2]
 
-           LDMFD   	r13!, {r4 - r12, r15} 
+           LDMFD   	r13!, {r4 - r12, r15}
 
 	   @ENDP
 	   .END
diff --git a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/Dot_p_opt.s b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/Dot_p_opt.s
index 02bdcab..4aa317e 100644
--- a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/Dot_p_opt.s
+++ b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/Dot_p_opt.s
@@ -31,7 +31,7 @@
 
 Dot_product12_asm:
 
-          STMFD   	    r13!, {r4 - r12, r14} 
+          STMFD   	    r13!, {r4 - r12, r14}
           MOV               r4, #0                                 @ L_sum = 0
           MOV               r5, #0                                 @ i = 0
 
@@ -41,13 +41,13 @@
           LDR           r8, [r0], #4
           SMLABB        r4, r6, r7, r4
           LDR           r9, [r1], #4
-	  SMLATT        r4, r6, r7, r4 
+	  SMLATT        r4, r6, r7, r4
 
 	  LDR           r6, [r0], #4
 	  SMLABB        r4, r8, r9, r4
 
 	  LDR           r7, [r1], #4
-	  SMLATT        r4, r8, r9, r4	  
+	  SMLATT        r4, r8, r9, r4
 	  LDR           r8, [r0], #4
 
 	  SMLABB        r4, r6, r7, r4
@@ -58,7 +58,7 @@
 	  CMP           r5, r2
 	  SMLATT        r4, r8, r9, r4
 	  BLT           LOOP
-              
+
           MOV           r12, r4, LSL #1
           ADD           r12, r12, #1                         @ L_sum = (L_sum << 1)  + 1
 	  MOV           r4, r12
@@ -69,12 +69,12 @@
           SUB           r10, r10, #1                         @ sft = norm_l(L_sum)
           MOV           r0, r12, LSL r10                     @ L_sum = L_sum << sft
           RSB           r11, r10, #30                        @ *exp = 30 - sft
-          STRH          r11, [r3]                     
+          STRH          r11, [r3]
 
 Dot_product12_end:
-		     
-          LDMFD   	    r13!, {r4 - r12, r15} 
+
+          LDMFD   	    r13!, {r4 - r12, r15}
           @ENDFUNC
           .END
- 
+
 
diff --git a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/Filt_6k_7k_opt.s b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/Filt_6k_7k_opt.s
index 1ce2a85..856ada8 100644
--- a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/Filt_6k_7k_opt.s
+++ b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/Filt_6k_7k_opt.s
@@ -23,7 +23,7 @@
 @******************************************************************
 @ r0    ---  signal[]
 @ r1    ---  lg
-@ r2    ---  mem[] 
+@ r2    ---  mem[]
 
           .section  .text
           .global  Filt_6k_7k_asm
@@ -32,7 +32,7 @@
 
 Filt_6k_7k_asm:
 
-          STMFD   		r13!, {r4 - r12, r14} 
+          STMFD   		r13!, {r4 - r12, r14}
           SUB    		r13, r13, #240              @ x[L_SUBFR16k + (L_FIR - 1)]
           MOV     		r8, r0                      @ copy signal[] address
           MOV     		r4, r1                      @ copy lg address
@@ -43,9 +43,9 @@
           MOV     		r2, #30                     @ L_FIR - 1
           BL      		voAWB_Copy                   @ memcpy(x, mem, (L_FIR - 1)<<1)
 
-          LDR     		r10, Lable1                 @ get fir_7k address     
+          LDR     		r10, Lable1                 @ get fir_7k address
 
-          MOV           	r14, #0  
+          MOV           	r14, #0
           MOV                   r3, r8                      @ change myMemCopy to Copy, due to Copy will change r3 content
           ADD     	    	r6, r13, #60                @ get x[L_FIR - 1] address
           MOV           	r7, r3                      @ get signal[i]
@@ -76,14 +76,14 @@
           STRH          	r12, [r6], #2
           ADD           	r14, r14, #8
           CMP           	r14, #80
-          BLT           	LOOP1          
+          BLT           	LOOP1
 
 
           STR     		r5, [sp, #-4]               @ PUSH  r5 to stack
 
           @ not use registers: r4, r10, r12, r14, r5
-          MOV     		r4, r13 
-          MOV     		r5, #0                      @ i = 0              
+          MOV     		r4, r13
+          MOV     		r5, #0                      @ i = 0
 LOOP2:
           LDR           	r0, [r10]
 
@@ -111,13 +111,13 @@
           LDRSH                 r8, [r4, #10]              @ load x[i+5]
           LDRSH                 r9, [r4, #50]              @ load x[i+25]
           SMLABT                r14, r1, r0, r14           @ (x[i+3] + x[i+27]) * fir_7k[3]
-          ADD                   r8, r8, r9                 @ x[i+5] + x[i+25] 
- 
+          ADD                   r8, r8, r9                 @ x[i+5] + x[i+25]
+
           LDR                   r0, [r10, #8]
           LDRSH                 r1, [r4, #12]              @ x[i+6]
           LDRSH                 r2, [r4, #48]              @ x[i+24]
           SMLABB                r14, r6, r0, r14           @ (x[i+4] + x[i+26]) * fir_7k[4]
-          LDRSH                 r6, [r4, #14]              @ x[i+7] 
+          LDRSH                 r6, [r4, #14]              @ x[i+7]
           LDRSH                 r7, [r4, #46]              @ x[i+23]
           SMLABT                r14, r8, r0, r14           @ (x[i+5] + x[i+25]) * fir_7k[5]
           LDR                   r0, [r10, #12]
@@ -125,8 +125,8 @@
           ADD                   r6, r6, r7                 @ (x[i+7] + x[i+23])
           SMLABB                r14, r1, r0, r14           @ (x[i+6] + x[i+24]) * fir_7k[6]
           LDRSH                 r8, [r4, #16]              @ x[i+8]
-          LDRSH                 r9, [r4, #44]              @ x[i+22] 
-          SMLABT                r14, r6, r0, r14           @ (x[i+7] + x[i+23]) * fir_7k[7]  
+          LDRSH                 r9, [r4, #44]              @ x[i+22]
+          SMLABT                r14, r6, r0, r14           @ (x[i+7] + x[i+23]) * fir_7k[7]
           LDR                   r0, [r10, #16]
           LDRSH                 r1, [r4, #18]              @ x[i+9]
           LDRSH                 r2, [r4, #42]              @ x[i+21]
@@ -144,7 +144,7 @@
           LDRSH                 r2, [r4, #36]              @ x[i+18]
           SMLABB                r14, r6, r0, r14           @ (x[i+10] + x[i+20]) * fir_7k[10]
           LDRSH                 r6, [r4, #26]              @ x[i+13]
-          ADD                   r8, r8, r9                 @ (x[i+11] + x[i+19])  
+          ADD                   r8, r8, r9                 @ (x[i+11] + x[i+19])
           LDRSH                 r7, [r4, #34]              @ x[i+17]
           SMLABT                r14, r8, r0, r14           @ (x[i+11] + x[i+19]) * fir_7k[11]
           LDR                   r0, [r10, #24]
@@ -152,31 +152,31 @@
           LDRSH                 r8, [r4, #28]              @ x[i+14]
           SMLABB                r14, r1, r0, r14           @ (x[i+12] + x[i+18]) * fir_7k[12]
           ADD                   r6, r6, r7                 @ (x[i+13] + x[i+17])
-          LDRSH                 r9, [r4, #32]              @ x[i+16] 
+          LDRSH                 r9, [r4, #32]              @ x[i+16]
           SMLABT                r14, r6, r0, r14           @ (x[i+13] + x[i+17]) * fir_7k[13]
-          LDR                   r0, [r10, #28]         
+          LDR                   r0, [r10, #28]
           ADD                   r8, r8, r9                 @ (x[i+14] + x[i+16])
           LDRSH                 r1, [r4, #30]              @ x[i+15]
           SMLABB                r14, r8, r0, r14           @ (x[i+14] + x[i+16]) * fir_7k[14]
-          SMLABT                r14, r1, r0, r14           @ x[i+15] * fir_7k[15]                              
+          SMLABT                r14, r1, r0, r14           @ x[i+15] * fir_7k[15]
 
           ADD     		r5, r5, #1
           ADD     		r14, r14, #0x4000
-          ADD     		r4, r4, #2                
+          ADD     		r4, r4, #2
           MOV     		r1, r14, ASR #15
           CMP     		r5, #80
           STRH    		r1, [r3], #2               @signal[i] = (L_tmp + 0x4000) >> 15
-          BLT     		LOOP2      
-           
+          BLT     		LOOP2
+
           LDR     		r1, [sp, #-4]               @mem address
           ADD     		r0, r13, #160               @x + lg
           MOV     		r2, #30
           BL      		voAWB_Copy
-                    
+
 Filt_6k_7k_end:
-          ADD     		r13, r13, #240  
-          LDMFD   		r13!, {r4 - r12, r15} 
- 
+          ADD     		r13, r13, #240
+          LDMFD   		r13!, {r4 - r12, r15}
+
 Lable1:
           .word   		fir_6k_7k
           @ENDFUNC
diff --git a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/Norm_Corr_opt.s b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/Norm_Corr_opt.s
index b440a31..49bdc2b 100644
--- a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/Norm_Corr_opt.s
+++ b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/Norm_Corr_opt.s
@@ -32,8 +32,8 @@
 @ r6 --- corr_norm[]
 
 
-	.section  .text 
-        .global   Norm_corr_asm 
+	.section  .text
+        .global   Norm_corr_asm
         .extern   Convolve_asm
         .extern   Isqrt_n
 @******************************
@@ -47,17 +47,17 @@
 .equ         T_MIN         ,   212
 .equ         T_MAX         ,   216
 .equ         CORR_NORM     ,   220
-                  
+
 Norm_corr_asm:
 
-        STMFD      r13!, {r4 - r12, r14}  
+        STMFD      r13!, {r4 - r12, r14}
         SUB        r13, r13, #voSTACK
-  
+
         ADD        r8, r13, #20                 @get the excf[L_SUBFR]
         LDR        r4, [r13, #T_MIN]            @get t_min
         RSB        r11, r4, #0                  @k = -t_min
-        ADD        r5, r0, r11, LSL #1          @get the &exc[k]   
-        
+        ADD        r5, r0, r11, LSL #1          @get the &exc[k]
+
         @transfer Convolve function
         STMFD       sp!, {r0 - r3}
         MOV         r0, r5
@@ -68,7 +68,7 @@
 
         @ r8 --- excf[]
 
-	MOV         r14, r1                       @copy xn[] address                      
+	MOV         r14, r1                       @copy xn[] address
         MOV         r5, #64
         MOV         r6, #0                       @L_tmp = 0
         MOV         r7, #1
@@ -93,21 +93,21 @@
 	CLZ         r7, r9
 	SUB         r6, r7, #1                   @exp = norm_l(L_tmp)
         RSB         r7, r6, #32                  @exp = 32 - exp
-	MOV         r6, r7, ASR #1         
+	MOV         r6, r7, ASR #1
 	RSB         r7, r6, #0                   @scale = -(exp >> 1)
-	
+
         @loop for every possible period
 	@for(t = t_min@ t <= t_max@ t++)
 	@r7 --- scale r4 --- t_min r8 --- excf[]
 
-LOOPFOR:	
+LOOPFOR:
         MOV         r5, #0                       @L_tmp  = 0
 	MOV         r6, #0                       @L_tmp1 = 0
-	MOV         r9, #64  
+	MOV         r9, #64
 	MOV         r12, r1                      @copy of xn[]
 	ADD         r14, r13, #20                @copy of excf[]
 	MOV         r8, #0x8000
-        	
+
 LOOPi:
 	LDR         r11, [r14], #4               @load excf[i], excf[i+1]
         LDR         r10, [r12], #4               @load xn[i], xn[i+1]
@@ -128,13 +128,13 @@
 	MOV         r10, #1
 	ADD         r5, r10, r5, LSL #1          @L_tmp = (L_tmp << 1) + 1
 	ADD         r6, r10, r6, LSL #1          @L_tmp1 = (L_tmp1 << 1) + 1
- 
-	CLZ         r10, r5        
+
+	CLZ         r10, r5
 	CMP         r5, #0
 	RSBLT       r11, r5, #0
 	CLZLT       r10, r11
 	SUB         r10, r10, #1                 @exp = norm_l(L_tmp)
-     
+
 	MOV         r5, r5, LSL r10              @L_tmp = (L_tmp << exp)
 	RSB         r10, r10, #30                @exp_corr = 30 - exp
 	MOV         r11, r5, ASR #16             @corr = extract_h(L_tmp)
@@ -150,7 +150,7 @@
 	@Isqrt_n(&L_tmp, &exp_norm)
 
 	MOV         r14, r0
-	MOV         r12, r1 
+	MOV         r12, r1
 
         STMFD       sp!, {r0 - r4, r7 - r12, r14}
 	ADD         r1, sp, #4
@@ -168,7 +168,7 @@
 	MOV         r6, r6, ASR #16              @norm = extract_h(L_tmp)
 	MUL         r12, r6, r11
 	ADD         r12, r12, r12                @L_tmp = vo_L_mult(corr, norm)
-  
+
 	ADD         r6, r10, r5
 	ADD         r6, r6, r7                   @exp_corr + exp_norm + scale
 
@@ -187,9 +187,9 @@
 
 	CMP         r4, r6
 	BEQ         Norm_corr_asm_end
- 
+
 	ADD         r4, r4, #1                   @ t_min ++
-        
+
 	RSB         r5, r4, #0                   @ k
 
 	MOV         r6, #63                      @ i = 63
@@ -216,16 +216,16 @@
 	MUL         r14, r11, r8
         LDR         r6, [r13, #T_MAX]            @ get t_max
 	MOV         r8, r14, ASR #15
-	STRH        r8, [r10]                    
+	STRH        r8, [r10]
 
 	CMP         r4, r6
 	BLE         LOOPFOR
 
-Norm_corr_asm_end: 
-        
-        ADD            r13, r13, #voSTACK      
+Norm_corr_asm_end:
+
+        ADD            r13, r13, #voSTACK
         LDMFD          r13!, {r4 - r12, r15}
-    
+
         .END
 
 
diff --git a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/Syn_filt_32_opt.s b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/Syn_filt_32_opt.s
index 70464e4..3f4930c 100644
--- a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/Syn_filt_32_opt.s
+++ b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/Syn_filt_32_opt.s
@@ -38,7 +38,7 @@
 
 Syn_filt_32_asm:
 
-          STMFD   	r13!, {r4 - r12, r14} 
+          STMFD   	r13!, {r4 - r12, r14}
           LDR           r4,  [r13, #40]                  @ get sig_hi[] address
           LDR           r5,  [r13, #44]                  @ get sig_lo[] address
 
@@ -55,7 +55,7 @@
           AND           r8, r8, r14
           ORR           r10, r6, r7, LSL #16             @ Aq[2] -- Aq[1]
           ORR           r11, r8, r9, LSL #16             @ Aq[4] -- Aq[3]
-          STR           r10, [r13, #-4]                  
+          STR           r10, [r13, #-4]
           STR           r11, [r13, #-8]
 
           LDRSH         r6, [r0, #10]                    @ load Aq[5]
@@ -73,12 +73,12 @@
           LDRSH         r7, [r0, #20]                    @ load Aq[10]
           LDRSH         r8, [r0, #22]                    @ load Aq[11]
           LDRSH         r9, [r0, #24]                    @ load Aq[12]
-          AND           r6, r6, r14 
+          AND           r6, r6, r14
           AND           r8, r8, r14
           ORR           r10, r6, r7, LSL #16             @ Aq[10] -- Aq[9]
           ORR           r11, r8, r9, LSL #16             @ Aq[12] -- Aq[11]
           STR           r10, [r13, #-20]
-          STR           r11, [r13, #-24]  
+          STR           r11, [r13, #-24]
 
           LDRSH         r6, [r0, #26]                    @ load Aq[13]
           LDRSH         r7, [r0, #28]                    @ load Aq[14]
@@ -90,14 +90,14 @@
           ORR           r11, r8, r9, LSL #16             @ Aq[16] -- Aq[15]
           STR           r10, [r13, #-28]
           STR           r11, [r13, #-32]
-          
+
           MOV           r8, #0                           @ i = 0
-              
-LOOP:            
+
+LOOP:
           LDRSH         r6, [r5, #-2]                    @ load sig_lo[i-1]
           LDRSH         r7, [r5, #-4]                    @ load sig_lo[i-2]
 
-          LDR           r11, [r13, #-4]                  @ Aq[2] -- Aq[1]        
+          LDR           r11, [r13, #-4]                  @ Aq[2] -- Aq[1]
           LDRSH         r9, [r5, #-6]                    @ load sig_lo[i-3]
           LDRSH         r10, [r5, #-8]                   @ load sig_lo[i-4]
 
@@ -135,12 +135,12 @@
           LDRSH         r10, [r5, #-32]                  @ load sig_lo[i-16]
           SMLABB        r12, r6, r11, r12                @ sig_lo[i-13] * Aq[13]
           SMLABT        r12, r7, r11, r12                @ sig_lo[i-14] * Aq[14]
- 
+
           LDR           r11, [r13, #-32]                 @ Aq[16] -- Aq[15]
-          LDRSH         r6, [r2],#2                      @ load exc[i] 
+          LDRSH         r6, [r2],#2                      @ load exc[i]
           SMLABB        r12, r9, r11, r12                @ sig_lo[i-15] * Aq[15]
           SMLABT        r12, r10, r11, r12               @ sig_lo[i-16] * Aq[16]
-          MUL           r7, r6, r3                       @ exc[i] * a0 
+          MUL           r7, r6, r3                       @ exc[i] * a0
           RSB           r14, r12, #0                     @ L_tmp
           MOV           r14, r14, ASR #11                @ L_tmp >>= 11
           ADD           r14, r14, r7, LSL #1             @ L_tmp += (exc[i] * a0) << 1
@@ -149,7 +149,7 @@
           LDRSH         r6, [r4, #-2]                    @ load sig_hi[i-1]
           LDRSH         r7, [r4, #-4]                    @ load sig_hi[i-2]
 
-          LDR           r11, [r13, #-4]                  @ Aq[2] -- Aq[1]        
+          LDR           r11, [r13, #-4]                  @ Aq[2] -- Aq[1]
           LDRSH         r9, [r4, #-6]                    @ load sig_hi[i-3]
           LDRSH         r10, [r4, #-8]                   @ load sig_hi[i-4]
           SMULBB        r12, r6, r11                     @ sig_hi[i-1] * Aq[1]
@@ -198,14 +198,14 @@
           LDRSH         r10, [r4, #-32]                  @ load sig_hi[i-16]
           SMLABB        r12, r6, r11, r12                @ sig_hi[i-13] * Aq[13]
           SMLABT        r12, r7, r11, r12                @ sig_hi[i-14] * Aq[14]
- 
+
           LDR           r11, [r13, #-32]                 @ Aq[16] -- Aq[15]
           SMLABB        r12, r9, r11, r12                @ sig_hi[i-15] * Aq[15]
-          SMLABT        r12, r10, r11, r12               @ sig_hi[i-16] * Aq[16]       
+          SMLABT        r12, r10, r11, r12               @ sig_hi[i-16] * Aq[16]
           ADD           r6, r12, r12                     @ r12 << 1
-          SUB           r14, r14, r6                     
+          SUB           r14, r14, r6
           MOV           r14, r14, LSL #3                 @ L_tmp <<=3
-  
+
           MOV           r7, r14, ASR #16                 @ L_tmp >> 16
 
           MOV           r14, r14, ASR #4                 @ L_tmp >>=4
@@ -213,14 +213,14 @@
           SUB           r9, r14, r7, LSL #12             @ sig_lo[i] = L_tmp - (sig_hi[i] << 12)
 
           ADD           r8, r8, #1
-          STRH          r9, [r5], #2   
+          STRH          r9, [r5], #2
           CMP           r8, #64
-          BLT           LOOP                            
-         
+          BLT           LOOP
+
 Syn_filt_32_end:
-		     
-          LDMFD   	    r13!, {r4 - r12, r15} 
+
+          LDMFD   	    r13!, {r4 - r12, r15}
           @ENDFUNC
           .END
- 
+
 
diff --git a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/convolve_opt.s b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/convolve_opt.s
index 0228bda..71bb532 100644
--- a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/convolve_opt.s
+++ b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/convolve_opt.s
@@ -27,24 +27,24 @@
 @  r3 --- L
 
 	.section  .text
-        .global   Convolve_asm 
+        .global   Convolve_asm
 
 Convolve_asm:
 
-        STMFD          r13!, {r4 - r12, r14}  
+        STMFD          r13!, {r4 - r12, r14}
         MOV            r3,  #0                           @ n
 	MOV            r11, #0x8000
-        
-LOOP: 
+
+LOOP:
         ADD            r4, r1, r3, LSL #1                @ tmpH address
         ADD            r5, r3, #1                        @ i = n + 1
         MOV            r6, r0                            @ tmpX = x
         LDRSH          r9,  [r6], #2                     @ *tmpX++
         LDRSH          r10, [r4], #-2                    @ *tmpH--
         SUB            r5, r5, #1
-        MUL            r8,  r9, r10 
+        MUL            r8,  r9, r10
 
-LOOP1:                    
+LOOP1:
         CMP            r5, #0
         BLE            L1
 	LDRSH          r9,  [r6], #2                     @ *tmpX++
@@ -58,12 +58,12 @@
 	LDRSH          r12, [r6], #2                     @ *tmpX++
 	LDRSH          r14, [r4], #-2                    @ *tmpH--
 	MLA            r8, r9, r10, r8
-        SUBS           r5, r5, #4 
+        SUBS           r5, r5, #4
 	MLA            r8, r12, r14, r8
-    
-        B              LOOP1  
 
-L1:                  
+        B              LOOP1
+
+L1:
 
         ADD            r5, r11, r8, LSL #1
         MOV            r5, r5, LSR #16                   @extract_h(s)
@@ -75,14 +75,14 @@
         ADD            r5, r3, #1
         MOV            r6, r0
         LDRSH          r9,  [r6], #2                     @ *tmpX++
-        LDRSH          r10, [r4], #-2                     
+        LDRSH          r10, [r4], #-2
         LDRSH          r12, [r6], #2
         LDRSH          r14, [r4], #-2
 
         MUL            r8, r9, r10
         SUB            r5, r5, #2
         MLA            r8, r12, r14, r8
-        
+
 LOOP2:
         CMP            r5, #0
         BLE            L2
@@ -97,14 +97,14 @@
 	LDRSH          r12, [r6], #2                     @ *tmpX++
 	LDRSH          r14, [r4], #-2                    @ *tmpH--
 	MLA            r8, r9, r10, r8
-        SUBS           r5, r5, #4 
+        SUBS           r5, r5, #4
 	MLA            r8, r12, r14, r8
         B              LOOP2
 
 L2:
         ADD            r8, r11, r8, LSL #1
         MOV            r8, r8, LSR #16                   @extract_h(s)
-        ADD            r3, r3, #1  
+        ADD            r3, r3, #1
         STRH           r8, [r2], #2                      @y[n]
 
         ADD            r4, r1, r3, LSL #1
@@ -117,7 +117,7 @@
         MUL            r8, r9, r10
         LDRSH          r9,  [r6], #2
         LDRSH          r10, [r4], #-2
-        MLA            r8, r12, r14, r8 
+        MLA            r8, r12, r14, r8
         SUB            r5, r5, #3
         MLA            r8, r9, r10, r8
 
@@ -135,9 +135,9 @@
 	LDRSH          r12, [r6], #2                     @ *tmpX++
 	LDRSH          r14, [r4], #-2                    @ *tmpH--
 	MLA            r8, r9, r10, r8
-        SUBS           r5, r5, #4 
-	MLA            r8, r12, r14, r8 
-        B              LOOP3   
+        SUBS           r5, r5, #4
+	MLA            r8, r12, r14, r8
+        B              LOOP3
 
 L3:
         ADD            r8, r11, r8, LSL #1
@@ -150,7 +150,7 @@
         MOV            r6, r0
         MOV            r8, #0
 
-LOOP4:                    
+LOOP4:
         CMP            r5, #0
         BLE            L4
 	LDRSH          r9,  [r6], #2                     @ *tmpX++
@@ -164,22 +164,22 @@
 	LDRSH          r12, [r6], #2                     @ *tmpX++
 	LDRSH          r14, [r4], #-2                    @ *tmpH--
 	MLA            r8, r9, r10, r8
-        SUBS           r5, r5, #4 
-	MLA            r8, r12, r14, r8        
-        B              LOOP4    
-L4:                  
+        SUBS           r5, r5, #4
+	MLA            r8, r12, r14, r8
+        B              LOOP4
+L4:
         ADD            r5, r11, r8, LSL #1
         MOV            r5, r5, LSR #16                   @extract_h(s)
         ADD            r3, r3, #1
         STRH           r5, [r2], #2                      @y[n]
-        
+
         CMP            r3, #64
         BLT            LOOP
-                
-Convolve_asm_end: 
- 
+
+Convolve_asm_end:
+
         LDMFD      r13!, {r4 - r12, r15}
-    
+
         @ENDFUNC
         .END
 
diff --git a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/cor_h_vec_opt.s b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/cor_h_vec_opt.s
index 8f32733..2d4c7cc 100644
--- a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/cor_h_vec_opt.s
+++ b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/cor_h_vec_opt.s
@@ -51,12 +51,12 @@
          RSB           r11, r2, #62                      @j=62-pos
 
 LOOPj1:
-	 LDRSH         r12, [r10], #2  
+	 LDRSH         r12, [r10], #2
 	 LDRSH         r8,  [r9], #2
 	 LDRSH         r14, [r9]
 	 SUBS          r11, r11, #1
          MLA           r5, r12, r8, r5
-         MLA           r6, r12, r14, r6	 
+         MLA           r6, r12, r14, r6
 	 BGE           LOOPj1
 
 	 LDRSH         r12, [r10], #2                     @*p1++
@@ -64,7 +64,7 @@
          MLA           r5, r12, r14, r5
          MOV           r14, #0x8000
          MOV           r5, r5, LSL #2                     @L_sum1 = (L_sum1 << 2)
-         ADD           r10, r6, r14         
+         ADD           r10, r6, r14
          ADD           r9, r5, r14
          MOV           r5, r9, ASR #16
          MOV           r6, r10, ASR #16
@@ -76,7 +76,7 @@
 	 MUL           r14, r6, r11
 	 MOV           r5, r12, ASR #15
 	 MOV           r6, r14, ASR #15
-	 LDR           r9,  [r13, #44]                   
+	 LDR           r9,  [r13, #44]
 	 LDR           r12, [r13, #48]
          LDRSH         r10, [r7], #2                      @*p0++
 	 LDRSH         r11, [r8]                          @*p3++
@@ -88,7 +88,7 @@
 	 STRH          r6, [r12]
 
          ADD           r2, r2, #4
- 
+
          MOV           r5, #0                            @L_sum1 = 0
 	 MOV           r6, #0                            @L_sum2 = 0
 	 ADD           r9, r1, r2, LSL #1                @p2 = &vec[pos]
@@ -97,12 +97,12 @@
 	 ADD           r4, r4, #1                        @i++
 
 LOOPj2:
-	 LDRSH         r12, [r10], #2  
+	 LDRSH         r12, [r10], #2
 	 LDRSH         r8,  [r9], #2
 	 LDRSH         r14, [r9]
 	 SUBS          r11, r11, #1
          MLA           r5, r12, r8, r5
-         MLA           r6, r12, r14, r6	 
+         MLA           r6, r12, r14, r6
 	 BGE           LOOPj2
 
 	 LDRSH         r12, [r10], #2                     @*p1++
@@ -110,7 +110,7 @@
          MLA           r5, r12, r14, r5
          MOV           r14, #0x8000
          MOV           r5, r5, LSL #2                     @L_sum1 = (L_sum1 << 2)
-         ADD           r10, r6, r14        
+         ADD           r10, r6, r14
          ADD           r9, r5, r14
 
          MOV           r5, r9, ASR #16
@@ -123,7 +123,7 @@
 	 MUL           r14, r6, r11
 	 MOV           r5, r12, ASR #15
 	 MOV           r6, r14, ASR #15
-	 LDR           r9,  [r13, #44]                   
+	 LDR           r9,  [r13, #44]
 	 LDR           r12, [r13, #48]
          LDRSH         r10, [r7], #2                      @*p0++
 	 LDRSH         r11, [r8]                          @*p3++
@@ -136,16 +136,16 @@
 	 ADD           r4, r4, #1                         @i+1
 	 ADD           r2, r2, #4                         @pos += STEP
 	 CMP           r4, #16
-	 
+
 	 BLT           LOOPi
-         
+
 the_end:
          LDMFD         r13!, {r4 - r12, r15}
-      
+
          @ENDFUNC
-         .END	 
-        
-	
-	  
+         .END
+
+
+
 
 
diff --git a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/pred_lt4_1_opt.s b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/pred_lt4_1_opt.s
index d7b4509..e0b338d 100644
--- a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/pred_lt4_1_opt.s
+++ b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/pred_lt4_1_opt.s
@@ -35,7 +35,7 @@
 
 pred_lt4_asm:
 
-         STMFD     r13!, {r4 - r12, r14} 
+         STMFD     r13!, {r4 - r12, r14}
          RSB       r4, r1, #0                         @-T0
          RSB       r2, r2, #0                         @frac = -frac
          ADD       r5, r0, r4, LSL #1                 @x = exc - T0
@@ -45,7 +45,7 @@
          SUB       r5, r5, #30                        @x -= 15
          RSB       r4, r2, #3                         @k = 3 - frac
          LDR       r6, Table
-	 MOV       r8, r4, LSL #6                    
+	 MOV       r8, r4, LSL #6
          @MOV       r7, #0                             @j = 0
          ADD       r8, r6, r8                         @ptr2 = &(inter4_2[k][0])
 
@@ -63,7 +63,7 @@
 	 LDRSH     r6, [r1], #2                       @x[1]
 	 LDRSH     r9, [r1], #2                       @x[2]
 
-	 SMULBB    r10, r4, r3                        @x[0] * h[0]                  
+	 SMULBB    r10, r4, r3                        @x[0] * h[0]
 	 SMULBB    r11, r6, r3                        @x[1] * h[0]
 	 SMULBB    r12, r9, r3                        @x[2] * h[0]
 
@@ -285,7 +285,7 @@
 
 	 SMLABB    r10, r9, r3, r10                   @x[2] * h[2]
          SMLABB    r11, r4, r3, r11                   @x[3] * h[2]
-      
+
 	 SMLABT    r10, r4, r3, r10                   @x[3] * h[3]
 	 SMLABT    r11, r6, r3, r11                   @x[4] * h[3]
 
@@ -435,7 +435,7 @@
 	 MOV       r11, r11, LSL #1
 
 	 QADD      r10, r10, r10
-	 QADD      r11, r11, r11 
+	 QADD      r11, r11, r11
 
 	 QADD      r10, r10, r5
 	 QADD      r11, r11, r5
diff --git a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/residu_asm_opt.s b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/residu_asm_opt.s
index 86b3bd6..5ff0964 100644
--- a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/residu_asm_opt.s
+++ b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/residu_asm_opt.s
@@ -34,12 +34,12 @@
 
         LDRH    r5, [r0], #2
         LDRH    r6, [r0], #2
-        ORR     r5, r6, r5, LSL #16                  @r5 --- a0, a1	
+        ORR     r5, r6, r5, LSL #16                  @r5 --- a0, a1
 
         LDRH    r6, [r0], #2
 	LDRH    r7, [r0], #2
 	ORR     r6, r7, r6, LSL #16                  @r6 --- a2, a3
-	
+
         LDRH    r7, [r0], #2
 	LDRH    r8, [r0], #2
 	ORR     r7, r8, r7, LSL #16                  @r7 --- a4, a5
@@ -59,13 +59,13 @@
         LDRH    r11, [r0], #2
 	LDRH    r12, [r0], #2
 	ORR     r11, r12, r11, LSL #16               @r11 --- a12, a13
-	
+
 	LDRH    r12, [r0], #2
 	LDRH    r4, [r0], #2
 	ORR     r12, r4, r12, LSL #16                @r12 --- a14, a15
-	
 
-	STMFD   r13!, {r8 - r12}                     @store r8-r12 
+
+	STMFD   r13!, {r8 - r12}                     @store r8-r12
 	LDRH    r4, [r0], #2                         @load a16
         MOV     r14, r3, ASR #2                      @one loop get 4 outputs
 	ADD     r1, r1, #4
@@ -78,7 +78,7 @@
 	LDR     r2,  [r1], #-4                       @r2   --- x[1], x[0]
 
 	SMULTB  r3, r5, r2                           @i1(0)  --- r3 = x[0] * a0
-        SMULTT  r4, r5, r2                           @i2(0)  --- r4 = x[1] * a0	
+        SMULTT  r4, r5, r2                           @i2(0)  --- r4 = x[1] * a0
 	SMULTB  r11, r5, r10                         @i3(0)  --- r11 = x[2] * a0
 	SMULTT  r12, r5, r10                         @i4(0)  --- r12 = x[3] * a0
 
@@ -88,20 +88,20 @@
 
 	SMLATB  r11, r6, r2, r11                     @i3(2)  --- r11 += x[0] * a2
 	SMLATT  r12, r6, r2, r12                     @i4(2)  --- r12 += x[1] * a2
-	SMLABB  r12, r6, r2, r12                     @i4(3)  --- r12 += x[0] * a3                 
-	
+	SMLABB  r12, r6, r2, r12                     @i4(3)  --- r12 += x[0] * a3
+
 	LDR     r2, [r1], #-4                        @r2 ---- x[-1], x[-2]
 
 	SMLABT  r3, r5, r2, r3                       @i1(1) --- r3 += x[-1] * a1
 	SMLATT  r4, r6, r2, r4                       @i2(2) --- r4 += x[-1] * a2
 	SMLABT  r11, r6, r2, r11                     @i3(3) --- r11 += x[-1] * a3
 	SMLATT  r12, r7, r2, r12                     @i4(4) --- r12 += x[-1] * a4
-        SMLATB  r3, r6, r2, r3                       @i1(2) --- r3 += x[-2] * a2	
+        SMLATB  r3, r6, r2, r3                       @i1(2) --- r3 += x[-2] * a2
 
 	SMLABB	r4, r6, r2, r4				@ i2	(3)
 	SMLATB  r11,r7, r2, r11				@ i3	(4)
 	SMLABB	r12,r7, r2, r12				@ i4	(5)
-	
+
 	LDR	r2,[r1],#-4
 	SMLABT	r3, r6, r2, r3				@ i1	(3)
 	SMLATT	r4, r7, r2, r4				@ i2	(4)
@@ -111,7 +111,7 @@
 	SMLABB	r4, r7, r2, r4				@ i2	(5)
 	SMLATB	r11,r8, r2, r11				@ i3	(6)
 	SMLABB	r12,r8, r2, r12				@ i4	(7)
-		
+
 	LDR	r2,[r1],#-4
 	SMLABT	r3, r7, r2, r3				@ i1	(5)
 	SMLATT	r4, r8, r2, r4				@ i2	(6)
@@ -122,7 +122,7 @@
 	SMLATB	r11,r9, r2, r11				@ i3	(8)
 	SMLABB	r12,r9, r2, r12				@ i4	(9)
 	LDR	r10, [r13, #8]				@ [ a10 | a11]
-	
+
 	LDR	r2,[r1],#-4
 	SMLABT	r3, r8, r2, r3				@ i1	(7)
 	SMLATT	r4, r9, r2, r4				@ i2	(8)
@@ -133,7 +133,7 @@
 	SMLATB	r11,r10, r2, r11			@ i3	(10)
 	SMLABB	r12,r10, r2, r12			@ i4	(11)
 	LDR	r8, [r13, #12]				@ [ a12 | a13 ]
-		
+
 	LDR	r2,[r1],#-4
 	SMLABT	r3, r9, r2, r3				@ i1	(9)
 	SMLATT	r4, r10, r2, r4				@ i2	(10)
@@ -144,7 +144,7 @@
 	SMLATB	r11,r8, r2, r11				@ i3	(12)
 	SMLABB	r12,r8, r2, r12				@ i4	(13)
 	LDR	r9, [r13, #16]				@ [ a14 | a15 ]
-	
+
 	LDR	r2,[r1],#-4
 	SMLABT	r3, r10, r2, r3				@ i1	(11)
 	SMLATT	r4, r8, r2, r4				@ i2	(12)
@@ -154,7 +154,7 @@
 	SMLABB	r4, r8, r2, r4				@ i2	(13)
 	SMLATB	r11,r9, r2, r11				@ i3	(14)
 	SMLABB	r12,r9, r2, r12				@ i4	(15)
-	
+
 
 	LDR	r2,[r1],#-4
 	SMLABT	r3, r8, r2, r3				@ i1	(13)
@@ -165,64 +165,64 @@
 	SMLABB	r4, r9, r2, r4				@ i2	(15)
 	SMLABB	r11,r14, r2, r11			@ i3	(16)
 	LDR		r8, [r13]					@ [ a6 | a7 ]
-			
+
         LDR     r2,[r1],#44         		@ Change
 	SMLABT	r3, r9, r2, r3
 	SMLABB	r3, r14, r2, r3
 	SMLABT	r4, r14, r2, r4
 	LDR		r9, [r13, #4]				@ [ a8 | a9 ]
-	
 
-	QADD	r3,r3,r3					
-	QADD	r4,r4,r4					
-	QADD	r11,r11,r11					
-	QADD	r12,r12,r12					
-		
-	QADD	r3,r3,r3					
-	QADD	r4,r4,r4					
-	QADD	r11,r11,r11					
-	QADD	r12,r12,r12					
-	
-	QADD	r3,r3,r3					
-	QADD	r4,r4,r4					
-	QADD	r11,r11,r11					
-	QADD	r12,r12,r12					
-	
-	QADD	r3,r3,r3					
-	QADD	r4,r4,r4					
-	QADD	r11,r11,r11					
-	QADD	r12,r12,r12					
-	
-	MOV	r2,#32768	
-	
-	QDADD	r3,r2,r3					
-	QDADD	r4,r2,r4					
-	QDADD	r11,r2,r11					
-	QDADD	r12,r2,r12					
-		
-	
+
+	QADD	r3,r3,r3
+	QADD	r4,r4,r4
+	QADD	r11,r11,r11
+	QADD	r12,r12,r12
+
+	QADD	r3,r3,r3
+	QADD	r4,r4,r4
+	QADD	r11,r11,r11
+	QADD	r12,r12,r12
+
+	QADD	r3,r3,r3
+	QADD	r4,r4,r4
+	QADD	r11,r11,r11
+	QADD	r12,r12,r12
+
+	QADD	r3,r3,r3
+	QADD	r4,r4,r4
+	QADD	r11,r11,r11
+	QADD	r12,r12,r12
+
+	MOV	r2,#32768
+
+	QDADD	r3,r2,r3
+	QDADD	r4,r2,r4
+	QDADD	r11,r2,r11
+	QDADD	r12,r2,r12
+
+
 	MOV	r3,r3,asr #16
 	MOV	r4,r4,asr #16
 	MOV	r11,r11,asr #16
 	MOV	r12,r12,asr #16
-	
+
 	STRH	r3,[r0],#2
 	STRH	r4,[r0],#2
 	STRH	r11,[r0],#2
 	STRH	r12,[r0],#2
-	
+
 	MOV	r2,r14,asr #16
 	SUB	r14, r14, #0x10000
 	SUBS	r2,r2,#1
-	BNE	residu_loop	
+	BNE	residu_loop
 end:
-	LDMFD	r13!, {r8 -r12}	
+	LDMFD	r13!, {r8 -r12}
 	LDMFD	r13!, {r4 -r12,pc}
 
         @ENDFUNC
-        .END	 
-        
-	
-	  
+        .END
+
+
+
 
 
diff --git a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/scale_sig_opt.s b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/scale_sig_opt.s
index f83e688..b300224 100644
--- a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/scale_sig_opt.s
+++ b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/scale_sig_opt.s
@@ -38,7 +38,7 @@
 	 MOV           r8, #0x7fffffff
 	 MOV           r9, #0x8000
 	 BLE           LOOP2
-	 
+
 LOOP1:
 
          LDRSH          r5, [r4]                    @load x[i]
@@ -65,11 +65,11 @@
 
 The_end:
          LDMFD         r13!, {r4 - r12, r15}
-     
+
          @ENDFUNC
-         .END	 
-        
-	
-	  
+         .END
+
+
+
 
 
diff --git a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/syn_filt_opt.s b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/syn_filt_opt.s
index f4700cd..0c287a4 100644
--- a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/syn_filt_opt.s
+++ b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV5E/syn_filt_opt.s
@@ -33,18 +33,18 @@
 
 Syn_filt_asm:
 
-          STMFD   	r13!, {r4 - r12, r14} 
+          STMFD   	r13!, {r4 - r12, r14}
           SUB           r13, r13, #700                   @ y_buf[L_FRAME16k + M16k]
-   
+
           MOV           r4, r3                           @ copy mem[] address
           MOV           r5, r13                          @ copy yy = y_buf address
 
           @ for(i = 0@ i < m@ i++)
           @{
           @    *yy++ = mem[i]@
-          @} 
+          @}
 
-          LDRH          r6,  [r4], #2          
+          LDRH          r6,  [r4], #2
           LDRH          r7,  [r4], #2
           LDRH          r8,  [r4], #2
           LDRH          r9,  [r4], #2
@@ -62,7 +62,7 @@
           STRH          r12, [r5], #2
           STRH          r14, [r5], #2
 
-          LDRH          r6,  [r4], #2          
+          LDRH          r6,  [r4], #2
           LDRH          r7,  [r4], #2
           LDRH          r8,  [r4], #2
           LDRH          r9,  [r4], #2
@@ -92,45 +92,45 @@
           LDRSH         r9, [r0, #6]                     @ load a[3]
           LDRSH         r11,[r0, #8]                     @ load a[4]
           AND           r6, r6, r14
-          AND           r9, r9, r14          
+          AND           r9, r9, r14
           ORR           r10, r6, r7, LSL #16             @ -a[2] -- -a[1]
           ORR           r12, r9, r11, LSL #16            @ -a[4] -- -a[3]
           STR           r10, [r13, #-4]
           STR           r12, [r13, #-8]
-          
+
           LDRSH         r6, [r0, #10]                    @ load a[5]
           LDRSH         r7, [r0, #12]                    @ load a[6]
           LDRSH         r9, [r0, #14]                    @ load a[7]
           LDRSH         r11,[r0, #16]                    @ load a[8]
           AND           r6, r6, r14
-          AND           r9, r9, r14          
+          AND           r9, r9, r14
           ORR           r10, r6, r7, LSL #16             @ -a[6] -- -a[5]
           ORR           r12, r9, r11, LSL #16            @ -a[8] -- -a[7]
           STR           r10, [r13, #-12]
-          STR           r12, [r13, #-16]          
-           
+          STR           r12, [r13, #-16]
+
           LDRSH         r6, [r0, #18]                    @ load a[9]
           LDRSH         r7, [r0, #20]                    @ load a[10]
           LDRSH         r9, [r0, #22]                    @ load a[11]
           LDRSH         r11,[r0, #24]                    @ load a[12]
           AND           r6, r6, r14
-          AND           r9, r9, r14          
+          AND           r9, r9, r14
           ORR           r10, r6, r7, LSL #16             @ -a[10] -- -a[9]
           ORR           r12, r9, r11, LSL #16            @ -a[12] -- -a[11]
           STR           r10, [r13, #-20]
-          STR           r12, [r13, #-24]    
+          STR           r12, [r13, #-24]
 
           LDRSH         r6, [r0, #26]                    @ load a[13]
           LDRSH         r7, [r0, #28]                    @ load a[14]
           LDRSH         r9, [r0, #30]                    @ load a[15]
           LDRSH         r11,[r0, #32]                    @ load a[16]
           AND           r6, r6, r14
-          AND           r9, r9, r14          
+          AND           r9, r9, r14
           ORR           r10, r6, r7, LSL #16             @ -a[14] -- -a[13]
           ORR           r12, r9, r11, LSL #16            @ -a[16] -- -a[15]
           STR           r10, [r13, #-28]
-          STR           r12, [r13, #-32]                
-                     
+          STR           r12, [r13, #-32]
+
           ADD           r4, r13, #32
 LOOP:
           LDRSH         r6,  [r1], #2                    @ load x[i]
@@ -155,8 +155,8 @@
           SMLABB        r14, r6, r7, r14                 @ -a[3] * (*(temp_p -3))
 
           LDRSH         r9,  [r10, #-10]                 @ *(temp_p - 5)
-   
-          SMLABT        r14, r11, r7, r14                @ -a[4] * (*(temp_p -4))        
+
+          SMLABT        r14, r11, r7, r14                @ -a[4] * (*(temp_p -4))
 
           LDR           r7,  [r13, #-12]                 @ -a[6]  -a[5]
           LDRSH         r12, [r10, #-12]                 @ *(temp_p - 6)
@@ -169,13 +169,13 @@
 
           LDR           r7,  [r13, #-16]                 @ -a[8] -a[7]
           LDRSH         r11, [r10, #-16]                 @ *(temp_p - 8)
-         
+
           SMLABB        r14, r6, r7, r14                 @ -a[7] * (*(temp_p -7))
 
           LDRSH         r9,  [r10, #-18]                 @ *(temp_p - 9)
 
-          SMLABT        r14, r11, r7, r14                @ -a[8] * (*(temp_p -8))          
- 
+          SMLABT        r14, r11, r7, r14                @ -a[8] * (*(temp_p -8))
+
           LDR           r7,  [r13, #-20]                 @ -a[10]  -a[9]
           LDRSH         r12, [r10, #-20]                 @ *(temp_p - 10)
 
@@ -192,11 +192,11 @@
 
           LDRSH         r9,  [r10, #-26]                 @ *(temp_p - 13)
 
-          SMLABT        r14, r11, r7, r14                @ -a[12] * (*(temp_p -12))           
+          SMLABT        r14, r11, r7, r14                @ -a[12] * (*(temp_p -12))
 
           LDR           r7,  [r13, #-28]                 @ -a[14] -a[13]
           LDRSH         r12, [r10, #-28]                 @ *(temp_p - 14)
- 
+
           SMLABB        r14, r9, r7, r14                 @ -a[13] * (*(temp_p -13))
 
           LDRSH         r6,  [r10, #-30]                 @ *(temp_p - 15)
@@ -211,28 +211,28 @@
           SMLABT        r14, r11, r7, r14                @ -a[16] * (*(temp_p -16))
 
           RSB           r14, r14, r0
-                                  
+
           MOV           r7, r14, LSL #4                  @ L_tmp <<=4
           ADD           r8, r8, #1
-          ADD           r14, r7, #0x8000                 
+          ADD           r14, r7, #0x8000
           MOV           r7, r14, ASR #16                 @ (L_tmp + 0x8000) >> 16
           CMP           r8, #80
           STRH          r7, [r10]                        @ yy[i]
           STRH          r7, [r2], #2                     @ y[i]
           BLT           LOOP
- 
+
           @ update mem[]
           ADD           r5, r13, #160                    @ yy[64] address
           MOV           r1, r3
           MOV           r0, r5
           MOV           r2, #16
-          BL            voAWB_Copy          
+          BL            voAWB_Copy
 
 Syn_filt_asm_end:
- 
-          ADD           r13, r13, #700		     
-          LDMFD   	r13!, {r4 - r12, r15} 
+
+          ADD           r13, r13, #700
+          LDMFD   	r13!, {r4 - r12, r15}
           @ENDFUNC
           .END
- 
+
 
diff --git a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/Deemph_32_neon.s b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/Deemph_32_neon.s
index 2afc146..1d5893f 100644
--- a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/Deemph_32_neon.s
+++ b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/Deemph_32_neon.s
@@ -30,10 +30,10 @@
 
            .section  .text
            .global   Deemph_32_asm
-	   
+
 Deemph_32_asm:
 
-           STMFD   	r13!, {r4 - r12, r14} 
+           STMFD   	r13!, {r4 - r12, r14}
 	   MOV          r4, #2                   @i=0
 	   LDRSH        r6, [r0], #2             @load x_hi[0]
 	   LDRSH        r7, [r1], #2             @load x_lo[0]
@@ -47,9 +47,9 @@
 	   ADD          r12, r10, r7, LSL #4     @L_tmp += x_lo[0] << 4
 	   MOV          r10, r12, LSL #3         @L_tmp <<= 3
 	   MUL          r9, r5, r8
-	   LDRSH        r6, [r0], #2             @load x_hi[1] 
+	   LDRSH        r6, [r0], #2             @load x_hi[1]
 	   QDADD        r10, r10, r9
-	   LDRSH        r7, [r1], #2             @load x_lo[1]  
+	   LDRSH        r7, [r1], #2             @load x_lo[1]
 	   MOV          r12, r10, LSL #1         @L_tmp = L_mac(L_tmp, *mem, fac)
 	   QADD         r10, r12, r11
 	   MOV          r14, r10, ASR #16        @y[0] = round(L_tmp)
@@ -94,9 +94,9 @@
 
            BLT          LOOP
            STR          r14, [r3]
-           STRH         r14, [r2]	   
+           STRH         r14, [r2]
 
-           LDMFD   	r13!, {r4 - r12, r15} 
+           LDMFD   	r13!, {r4 - r12, r15}
 
 	   .END
 
diff --git a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/Dot_p_neon.s b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/Dot_p_neon.s
index 678f1d0..8230944d 100644
--- a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/Dot_p_neon.s
+++ b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/Dot_p_neon.s
@@ -45,14 +45,14 @@
 	  VLD1.S16          {Q12, Q13}, [r1]!             @load 16 Word16 y[]
 
           VMULL.S16         Q15, D16, D0
-          VMLAL.S16         Q15, D17, D1               
+          VMLAL.S16         Q15, D17, D1
           VMLAL.S16         Q15, D18, D2
           VMLAL.S16         Q15, D19, D3
-	  VLD1.S16          {Q0, Q1}, [r1]!               @load 16 Word16 y[]   
-          VMLAL.S16         Q15, D20, D4       
+	  VLD1.S16          {Q0, Q1}, [r1]!               @load 16 Word16 y[]
+          VMLAL.S16         Q15, D20, D4
           VMLAL.S16         Q15, D21, D5
           VMLAL.S16         Q15, D22, D6
-          VMLAL.S16         Q15, D23, D7                                       
+          VMLAL.S16         Q15, D23, D7
           VMLAL.S16         Q15, D24, D8
           VMLAL.S16         Q15, D25, D9
           VMLAL.S16         Q15, D26, D10
@@ -64,9 +64,9 @@
 
           CMP               r2, #64
           BEQ               Lable1
-          VLD1.S16          {Q0, Q1}, [r0]!               @load 16 Word16 x[]  
-	  VLD1.S16          {Q2, Q3}, [r1]! 
-          VMLAL.S16         Q15, D4, D0             
+          VLD1.S16          {Q0, Q1}, [r0]!               @load 16 Word16 x[]
+	  VLD1.S16          {Q2, Q3}, [r1]!
+          VMLAL.S16         Q15, D4, D0
           VMLAL.S16         Q15, D5, D1
           VMLAL.S16         Q15, D6, D2
           VMLAL.S16         Q15, D7, D3
@@ -102,11 +102,11 @@
 	  VMLAL.S16         Q15, D2, D2
 	  VMLAL.S16         Q15, D3, D3
 
-Lable1: 
+Lable1:
 
           VQADD.S32         D30, D30, D31
           VPADD.S32         D30, D30, D30
-          VMOV.S32          r12, D30[0]        
+          VMOV.S32          r12, D30[0]
 
 	  ADD               r12, r12, r12
           ADD               r12, r12, #1                         @ L_sum = (L_sum << 1)  + 1
@@ -117,11 +117,11 @@
           SUB               r10, r10, #1                         @ sft = norm_l(L_sum)
           MOV               r0, r12, LSL r10                     @ L_sum = L_sum << sft
           RSB               r11, r10, #30                        @ *exp = 30 - sft
-          STRH              r11, [r3]                     
+          STRH              r11, [r3]
 
 Dot_product12_end:
-		     
-          LDMFD   	    r13!, {r4 - r12, r15} 
+
+          LDMFD   	    r13!, {r4 - r12, r15}
 
           .END
 
diff --git a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/Filt_6k_7k_neon.s b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/Filt_6k_7k_neon.s
index 5389a1c..14ba828 100644
--- a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/Filt_6k_7k_neon.s
+++ b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/Filt_6k_7k_neon.s
@@ -13,7 +13,7 @@
 @ ** See the License for the specific language governing permissions and
 @ ** limitations under the License.
 @ */
-@                             
+@
 @**********************************************************************/
 @void Filt_6k_7k(
 @     Word16 signal[],                      /* input:  signal                  */
@@ -23,7 +23,7 @@
 @***********************************************************************
 @ r0    ---  signal[]
 @ r1    ---  lg
-@ r2    ---  mem[] 
+@ r2    ---  mem[]
 
           .section  .text
           .global   Filt_6k_7k_asm
@@ -31,7 +31,7 @@
 
 Filt_6k_7k_asm:
 
-          STMFD   		r13!, {r0 - r12, r14} 
+          STMFD   		r13!, {r0 - r12, r14}
           SUB    		r13, r13, #240              @ x[L_SUBFR16k + (L_FIR - 1)]
           MOV     		r8, r0                      @ copy signal[] address
           MOV     		r5, r2                      @ copy mem[] address
@@ -49,7 +49,7 @@
 
 
 
-          LDR     		r10, Lable1                 @ get fir_7k address     
+          LDR     		r10, Lable1                 @ get fir_7k address
           MOV                   r3, r8                      @ change myMemCopy to Copy, due to Copy will change r3 content
           ADD     	    	r6, r13, #60                @ get x[L_FIR - 1] address
           MOV           	r7, r3                      @ get signal[i]
@@ -81,9 +81,9 @@
 	  MOV                   r12, r5
           @STR     		r5, [sp, #-4]               @ PUSH  r5 to stack
           @ not use registers: r4, r10, r12, r14, r5
-          MOV     		r4, r13 
-          MOV     		r5, #0                      @ i = 0    
-         
+          MOV     		r4, r13
+          MOV     		r5, #0                      @ i = 0
+
           @ r4 --- x[i], r10 ---- fir_6k_7k
           VLD1.S16              {Q0, Q1}, [r10]!           @fir_6k_7k[0]  ~ fir_6k_7k[15]
 	  VLD1.S16              {Q2, Q3}, [r10]!           @fir_6k_7k[16] ~ fir_6k_7k[31]
@@ -91,20 +91,20 @@
 
 	  VLD1.S16              {Q4, Q5}, [r4]!            @x[0]  ~ x[15]
 	  VLD1.S16              {Q6, Q7}, [r4]!            @x[16] ~ X[31]
-	  VLD1.S16              {Q8}, [r4]! 
-          VMOV.S16              Q15, #0	  
-          
+	  VLD1.S16              {Q8}, [r4]!
+          VMOV.S16              Q15, #0
+
 LOOP_6K7K:
 
-          VMULL.S16             Q9,D8,D0[0]                 
-          VMULL.S16             Q10,D9,D1[0] 
-          VMULL.S16             Q11,D9,D0[0]                 
+          VMULL.S16             Q9,D8,D0[0]
+          VMULL.S16             Q10,D9,D1[0]
+          VMULL.S16             Q11,D9,D0[0]
           VMULL.S16             Q12,D10,D1[0]
           VEXT.8                Q4,Q4,Q5,#2
           VMLAL.S16             Q9,D10,D2[0]
           VMLAL.S16             Q10,D11,D3[0]
           VMLAL.S16             Q11,D11,D2[0]
-          VMLAL.S16             Q12,D12,D3[0]    
+          VMLAL.S16             Q12,D12,D3[0]
           VEXT.8                Q5,Q5,Q6,#2
           VMLAL.S16             Q9,D12,D4[0]
           VMLAL.S16             Q10,D13,D5[0]
@@ -115,18 +115,18 @@
           VMLAL.S16             Q10,D15,D7[0]
           VMLAL.S16             Q11,D15,D6[0]
 	  VMLAL.S16             Q12,D16,D7[0]
-	  VEXT.8  		Q7,Q7,Q8,#2 
+	  VEXT.8  		Q7,Q7,Q8,#2
 
-	  VMLAL.S16 		Q9,D8,D0[1]                
+	  VMLAL.S16 		Q9,D8,D0[1]
 	  VMLAL.S16     	Q10,D9,D1[1]
-	  VEXT.8 		Q8,Q8,Q15,#2 
-	  VMLAL.S16 		Q11,D9,D0[1]                
+	  VEXT.8 		Q8,Q8,Q15,#2
+	  VMLAL.S16 		Q11,D9,D0[1]
 	  VMLAL.S16 		Q12,D10,D1[1]
 	  VEXT.8  		Q4,Q4,Q5,#2
 	  VMLAL.S16 		Q9,D10,D2[1]
 	  VMLAL.S16 		Q10,D11,D3[1]
 	  VMLAL.S16 		Q11,D11,D2[1]
-	  VMLAL.S16 		Q12,D12,D3[1]    
+	  VMLAL.S16 		Q12,D12,D3[1]
 	  VEXT.8  		Q5,Q5,Q6,#2
 	  VMLAL.S16 		Q9,D12,D4[1]
 	  VMLAL.S16 		Q10,D13,D5[1]
@@ -137,18 +137,18 @@
 	  VMLAL.S16 		Q10,D15,D7[1]
 	  VMLAL.S16 		Q11,D15,D6[1]
 	  VMLAL.S16 		Q12,D16,D7[1]
-	  VEXT.8  		Q7,Q7,Q8,#2 
+	  VEXT.8  		Q7,Q7,Q8,#2
 
-	  VMLAL.S16 		Q9,D8,D0[2]           
+	  VMLAL.S16 		Q9,D8,D0[2]
 	  VMLAL.S16 		Q10,D9,D1[2]
-	  VEXT.8 		Q8,Q8,Q15,#2 
-	  VMLAL.S16 		Q11,D9,D0[2]           
+	  VEXT.8 		Q8,Q8,Q15,#2
+	  VMLAL.S16 		Q11,D9,D0[2]
 	  VMLAL.S16 		Q12,D10,D1[2]
 	  VEXT.8  		Q4,Q4,Q5,#2
 	  VMLAL.S16 		Q9,D10,D2[2]
 	  VMLAL.S16 		Q10,D11,D3[2]
 	  VMLAL.S16 		Q11,D11,D2[2]
-	  VMLAL.S16 		Q12,D12,D3[2]    
+	  VMLAL.S16 		Q12,D12,D3[2]
 	  VEXT.8  		Q5,Q5,Q6,#2
 	  VMLAL.S16 		Q9,D12,D4[2]
 	  VMLAL.S16 		Q10,D13,D5[2]
@@ -159,18 +159,18 @@
 	  VMLAL.S16 		Q10,D15,D7[2]
 	  VMLAL.S16 		Q11,D15,D6[2]
 	  VMLAL.S16 		Q12,D16,D7[2]
-	  VEXT.8  		Q7,Q7,Q8,#2 
+	  VEXT.8  		Q7,Q7,Q8,#2
 
-	  VMLAL.S16 		Q9,D8,D0[3]              
+	  VMLAL.S16 		Q9,D8,D0[3]
 	  VMLAL.S16 		Q10,D9,D1[3]
-	  VEXT.8 		Q8,Q8,Q15,#2 
-	  VMLAL.S16 		Q11,D9,D0[3]              
+	  VEXT.8 		Q8,Q8,Q15,#2
+	  VMLAL.S16 		Q11,D9,D0[3]
 	  VMLAL.S16 		Q12,D10,D1[3]
 	  VEXT.8  		Q4,Q4,Q5,#2
 	  VMLAL.S16 		Q9,D10,D2[3]
 	  VMLAL.S16 		Q10,D11,D3[3]
 	  VMLAL.S16 		Q11,D11,D2[3]
-	  VMLAL.S16 		Q12,D12,D3[3]    
+	  VMLAL.S16 		Q12,D12,D3[3]
 	  VEXT.8  		Q5,Q5,Q6,#2
 	  VMLAL.S16 		Q9,D12,D4[3]
 	  VMLAL.S16 		Q10,D13,D5[3]
@@ -181,10 +181,10 @@
 	  VMLAL.S16 		Q10,D15,D7[3]
 	  VMLAL.S16 		Q11,D15,D6[3]
 	  VMLAL.S16 		Q12,D16,D7[3]
-	  VEXT.8 		Q7,Q7,Q8,#2     
+	  VEXT.8 		Q7,Q7,Q8,#2
 
 	  VMOV.S16  		D8,D9
-	  VEXT.8 		Q8,Q8,Q15,#2 
+	  VEXT.8 		Q8,Q8,Q15,#2
 	  VMOV.S16  		D9,D10
 	  VADD.S32  		Q9,Q9,Q10
 	  VMOV.S16  		D10,D11
@@ -214,12 +214,12 @@
 	  VST1.S16              {D4, D5, D6}, [r1]!
 	  VST1.S16              D7[0], [r1]!
 	  VST1.S16              D7[1], [r1]!
-                    
+
 Filt_6k_7k_end:
 
-          ADD     		r13, r13, #240  
-          LDMFD   		r13!, {r0 - r12, r15} 
- 
+          ADD     		r13, r13, #240
+          LDMFD   		r13!, {r0 - r12, r15}
+
 Lable1:
           .word   		fir_6k_7k
           @ENDFUNC
diff --git a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/Norm_Corr_neon.s b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/Norm_Corr_neon.s
index 60e9ade..4263cd4 100644
--- a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/Norm_Corr_neon.s
+++ b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/Norm_Corr_neon.s
@@ -33,7 +33,7 @@
 
 
 	.section  .text
-        .global    Norm_corr_asm 
+        .global    Norm_corr_asm
         .extern    Convolve_asm
         .extern    Isqrt_n
 @******************************
@@ -47,17 +47,17 @@
 .equ    T_MIN             , 212
 .equ    T_MAX             , 216
 .equ    CORR_NORM         , 220
-                  
+
 Norm_corr_asm:
 
-        STMFD          r13!, {r4 - r12, r14}  
+        STMFD          r13!, {r4 - r12, r14}
         SUB            r13, r13, #voSTACK
-  
+
         ADD            r8, r13, #20                 @get the excf[L_SUBFR]
         LDR            r4, [r13, #T_MIN]            @get t_min
         RSB            r11, r4, #0                  @k = -t_min
-        ADD            r5, r0, r11, LSL #1          @get the &exc[k]   
-        
+        ADD            r5, r0, r11, LSL #1          @get the &exc[k]
+
         @transfer Convolve function
         STMFD          sp!, {r0 - r3}
         MOV            r0, r5
@@ -68,7 +68,7 @@
 
         @ r8 --- excf[]
 
-	MOV            r14, r1                       @copy xn[] address                      
+	MOV            r14, r1                       @copy xn[] address
         MOV            r7, #1
 	VLD1.S16       {Q0, Q1}, [r14]!
 	VLD1.S16       {Q2, Q3}, [r14]!
@@ -95,34 +95,34 @@
         VQADD.S32      D20, D20, D21
         VMOV.S32       r9,  D20[0]
         VMOV.S32       r10, D20[1]
-        QADD           r6, r9, r10 
+        QADD           r6, r9, r10
 	QADD           r6, r6, r6
         QADD           r9, r6, r7                   @L_tmp = (L_tmp << 1) + 1;
 	CLZ            r7, r9
 	SUB            r6, r7, #1                   @exp = norm_l(L_tmp)
         RSB            r7, r6, #32                  @exp = 32 - exp
-	MOV            r6, r7, ASR #1         
+	MOV            r6, r7, ASR #1
 	RSB            r7, r6, #0                   @scale = -(exp >> 1)
-	
+
         @loop for every possible period
 	@for(t = t_min@ t <= t_max@ t++)
 	@r7 --- scale r4 --- t_min r8 --- excf[]
 
-LOOPFOR:	
+LOOPFOR:
 	ADD            r14, r13, #20                @copy of excf[]
 	MOV            r12, r1                      @copy of xn[]
 	MOV            r8, #0x8000
 
         VLD1.S16       {Q0, Q1}, [r14]!                 @ load 16 excf[]
-        VLD1.S16       {Q2, Q3}, [r14]!                 @ load 16 excf[]       
+        VLD1.S16       {Q2, Q3}, [r14]!                 @ load 16 excf[]
         VLD1.S16       {Q4, Q5}, [r12]!                 @ load 16 x[]
 	VLD1.S16       {Q6, Q7}, [r12]!                 @ load 16 x[]
         VMULL.S16    Q10, D0, D0                      @L_tmp1 += excf[] * excf[]
-        VMULL.S16    Q11, D0, D8                      @L_tmp  += x[] * excf[]                   
+        VMULL.S16    Q11, D0, D8                      @L_tmp  += x[] * excf[]
         VMLAL.S16    Q10, D1, D1
         VMLAL.S16    Q11, D1, D9
         VMLAL.S16    Q10, D2, D2
-        VMLAL.S16    Q11, D2, D10        
+        VMLAL.S16    Q11, D2, D10
         VMLAL.S16    Q10, D3, D3
         VMLAL.S16    Q11, D3, D11
         VMLAL.S16    Q10, D4, D4
@@ -143,7 +143,7 @@
         VMLAL.S16    Q10, D1, D1
         VMLAL.S16    Q11, D1, D9
         VMLAL.S16    Q10, D2, D2
-        VMLAL.S16    Q11, D2, D10        
+        VMLAL.S16    Q11, D2, D10
         VMLAL.S16    Q10, D3, D3
         VMLAL.S16    Q11, D3, D11
         VMLAL.S16    Q10, D4, D4
@@ -162,19 +162,19 @@
 	VPADD.S32      D22, D22, D22                   @D22[0] --- L_tmp << 1
 
 	VMOV.S32       r6, D20[0]
-        VMOV.S32       r5, D22[0]	
+        VMOV.S32       r5, D22[0]
 
 	@r5 --- L_tmp, r6 --- L_tmp1
 	MOV            r10, #1
 	ADD            r5, r10, r5, LSL #1                     @L_tmp = (L_tmp << 1) + 1
 	ADD            r6, r10, r6, LSL #1                     @L_tmp1 = (L_tmp1 << 1) + 1
- 
-	CLZ            r10, r5        
+
+	CLZ            r10, r5
 	CMP            r5, #0
 	RSBLT          r11, r5, #0
 	CLZLT          r10, r11
 	SUB            r10, r10, #1                 @exp = norm_l(L_tmp)
-     
+
 	MOV            r5, r5, LSL r10              @L_tmp = (L_tmp << exp)
 	RSB            r10, r10, #30                @exp_corr = 30 - exp
 	MOV            r11, r5, ASR #16             @corr = extract_h(L_tmp)
@@ -190,7 +190,7 @@
 	@Isqrt_n(&L_tmp, &exp_norm)
 
 	MOV            r14, r0
-	MOV            r12, r1 
+	MOV            r12, r1
 
         STMFD          sp!, {r0 - r4, r7 - r12, r14}
 	ADD            r1, sp, #4
@@ -208,7 +208,7 @@
 	MOV            r6, r6, ASR #16              @norm = extract_h(L_tmp)
 	MUL            r12, r6, r11
 	ADD            r12, r12, r12                @L_tmp = vo_L_mult(corr, norm)
-  
+
 	ADD            r6, r10, r5
 	ADD            r6, r6, r7                   @exp_corr + exp_norm + scale
 
@@ -227,8 +227,8 @@
 
 	CMP            r4, r6
 	BEQ            Norm_corr_asm_end
- 
-	ADD            r4, r4, #1                   @ t_min ++ 
+
+	ADD            r4, r4, #1                   @ t_min ++
 	RSB            r5, r4, #0                   @ k
 
 	MOV            r6, #63                      @ i = 63
@@ -255,16 +255,16 @@
 	MUL            r14, r11, r8
         LDR            r6, [r13, #T_MAX]            @ get t_max
 	MOV            r8, r14, ASR #15
-	STRH           r8, [r10]                    
+	STRH           r8, [r10]
 
 	CMP            r4, r6
 	BLE            LOOPFOR
 
-Norm_corr_asm_end: 
-        
-        ADD            r13, r13, #voSTACK      
+Norm_corr_asm_end:
+
+        ADD            r13, r13, #voSTACK
         LDMFD          r13!, {r4 - r12, r15}
-    
+
         .END
 
 
diff --git a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/Syn_filt_32_neon.s b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/Syn_filt_32_neon.s
index 1e65efa..e786dde 100644
--- a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/Syn_filt_32_neon.s
+++ b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/Syn_filt_32_neon.s
@@ -33,12 +33,12 @@
 @ sig_lo[] --- r5
 @ lg       --- r6
 
-          .section  .text 
+          .section  .text
           .global   Syn_filt_32_asm
 
 Syn_filt_32_asm:
 
-          STMFD   	r13!, {r4 - r12, r14} 
+          STMFD   	r13!, {r4 - r12, r14}
           LDR           r4,  [r13, #40]                  @ get sig_hi[] address
           LDR           r5,  [r13, #44]                  @ get sig_lo[] address
 
@@ -49,8 +49,8 @@
 	  SUB           r10, r4, #32                     @ sig_hi[-16] address
 	  SUB           r11, r5, #32                     @ sig_lo[-16] address
 
-	  VLD1.S16      {D0, D1, D2, D3}, [r0]!          @a[1] ~ a[16] 
-  
+	  VLD1.S16      {D0, D1, D2, D3}, [r0]!          @a[1] ~ a[16]
+
           MOV           r8, #0                           @ i = 0
 
 	  VLD1.S16      {D4, D5, D6, D7}, [r10]!         @ sig_hi[-16] ~ sig_hi[-1]
@@ -58,9 +58,9 @@
           VREV64.16     D1, D1
 	  VLD1.S16      {D8, D9, D10, D11}, [r11]!       @ sig_lo[-16] ~ sig_lo[-1]
           VREV64.16     D2, D2
-          VREV64.16     D3, D3	
+          VREV64.16     D3, D3
           VDUP.S32      Q15, r8
-              
+
 SYN_LOOP:
 
           LDRSH         r6, [r2], #2                     @exc[i]
@@ -73,12 +73,12 @@
 
 	  VEXT.8        D9, D9, D10, #2
 	  VEXT.8        D10, D10, D11, #2
-	  
+
 	  VPADD.S32     D28, D20, D21
           MUL           r12, r6, r3                      @exc[i] * a0
 	  VPADD.S32     D29, D28, D28
 	  VDUP.S32      Q10, D29[0]                      @result1
-          
+
 	  VMULL.S16     Q11, D4, D3
 	  VMLAL.S16     Q11, D5, D2
           VSUB.S32      Q10, Q15, Q10
@@ -101,7 +101,7 @@
 
 	  VSHR.S32      Q10, Q10, #11                    @result1 >>= 11
 	  VSHL.S32      Q11, Q11, #1                     @result2 <<= 1
-	  VDUP.S32      Q12, r14                         
+	  VDUP.S32      Q12, r14
 	  VADD.S32      Q12, Q12, Q10                    @L_tmp = L_tmp - (result1 >>= 11) - (result2 <<= 1)
 	  VSUB.S32      Q12, Q12, Q11
 
@@ -122,12 +122,12 @@
 	  STRH          r12, [r5], #2                    @stroe sig_lo[i]
 
           CMP           r8, #64
-          BLT           SYN_LOOP                          
-         
+          BLT           SYN_LOOP
+
 Syn_filt_32_end:
-		     
-          LDMFD   	    r13!, {r4 - r12, r15} 
+
+          LDMFD   	    r13!, {r4 - r12, r15}
           @ENDFUNC
           .END
- 
+
 
diff --git a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/convolve_neon.s b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/convolve_neon.s
index 189e33b..8efa9fb 100644
--- a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/convolve_neon.s
+++ b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/convolve_neon.s
@@ -20,22 +20,22 @@
 @*    Word16 y[],        /* (o)     : output vector                          */
 @*    Word16 L           /* (i)     : vector size                            */
 @*)
-@ 
+@
 @ r0 --- x[]
 @ r1 --- h[]
 @ r2 --- y[]
 @ r3 --- L
 
-	.section  .text 
-        .global   Convolve_asm 
+	.section  .text
+        .global   Convolve_asm
 
 Convolve_asm:
 
-        STMFD          r13!, {r4 - r12, r14}  
-        MOV            r3,  #0                        
+        STMFD          r13!, {r4 - r12, r14}
+        MOV            r3,  #0
 	MOV            r11, #0x8000
-        
-LOOP: 
+
+LOOP:
         @MOV            r8, #0                            @ s = 0
         ADD            r4, r1, r3, LSL #1                @ tmpH address
         ADD            r5, r3, #1                        @ i = n + 1
@@ -43,21 +43,21 @@
         LDRSH          r9,  [r6], #2                     @ *tmpX++
         LDRSH          r10, [r4]                         @ *tmpH--
         SUB            r5, r5, #1
-        VMOV.S32       Q10, #0 
-        MUL            r8,  r9, r10 
+        VMOV.S32       Q10, #0
+        MUL            r8,  r9, r10
 
-LOOP1:                    
+LOOP1:
         CMP            r5, #0
         BLE            L1
         SUB            r4, r4, #8
         MOV            r9, r4
-        VLD1.S16       D0, [r6]!   
+        VLD1.S16       D0, [r6]!
         VLD1.S16       D1, [r9]!
         VREV64.16      D1, D1
-        SUBS           r5, r5, #4  
-        VMLAL.S16      Q10, D0, D1         
-        B              LOOP1    
-L1:                  
+        SUBS           r5, r5, #4
+        VMLAL.S16      Q10, D0, D1
+        B              LOOP1
+L1:
         VADD.S32       D20, D20, D21
         VPADD.S32      D20, D20, D20
         VMOV.S32       r5, D20[0]
@@ -73,25 +73,25 @@
         ADD            r5, r3, #1
         MOV            r6, r0
         LDRSH          r9,  [r6], #2                     @ *tmpX++
-        LDRSH          r10, [r4], #-2                     
+        LDRSH          r10, [r4], #-2
         LDRSH          r12, [r6], #2
         LDRSH          r14, [r4]
 
         MUL            r8, r9, r10
         SUB            r5, r5, #2
         MLA            r8, r12, r14, r8
-        
+
         VMOV.S32       Q10, #0
 LOOP2:
         CMP            r5, #0
         BLE            L2
         SUB            r4, r4, #8
         MOV            r9, r4
-        VLD1.S16       D0, [r6]!   
+        VLD1.S16       D0, [r6]!
         VLD1.S16       D1, [r9]!
         SUBS           r5, r5, #4
         VREV64.16      D1, D1
-        VMLAL.S16      Q10, D0, D1 
+        VMLAL.S16      Q10, D0, D1
         B              LOOP2
 L2:
         VADD.S32       D20, D20, D21
@@ -100,7 +100,7 @@
         ADD            r8, r8, r5
         ADD            r8, r11, r8, LSL #1
         MOV            r8, r8, LSR #16                   @extract_h(s)
-        ADD            r3, r3, #1  
+        ADD            r3, r3, #1
         STRH           r8, [r2], #2                      @y[n]
 
 
@@ -115,7 +115,7 @@
         MUL            r8, r9, r10
         LDRSH          r9,  [r6], #2
         LDRSH          r10, [r4]
-        MLA            r8, r12, r14, r8 
+        MLA            r8, r12, r14, r8
         SUB            r5, r5, #3
         MLA            r8, r9, r10, r8
 
@@ -125,12 +125,12 @@
         BLE            L3
         SUB            r4, r4, #8
         MOV            r9, r4
-        VLD1.S16       D0, [r6]!   
+        VLD1.S16       D0, [r6]!
         VLD1.S16       D1, [r9]!
         VREV64.16      D1, D1
         SUBS           r5, r5, #4
-        VMLAL.S16      Q10, D0, D1 
-        B              LOOP3   
+        VMLAL.S16      Q10, D0, D1
+        B              LOOP3
 
 L3:
         VADD.S32       D20, D20, D21
@@ -146,18 +146,18 @@
         ADD            r4, r1, r5, LSL #1                @ tmpH address
         MOV            r6, r0
         VMOV.S32       Q10, #0
-LOOP4:                    
+LOOP4:
         CMP            r5, #0
         BLE            L4
         SUB            r4, r4, #8
         MOV            r9, r4
-        VLD1.S16       D0, [r6]!   
+        VLD1.S16       D0, [r6]!
         VLD1.S16       D1, [r9]!
         VREV64.16      D1, D1
-        SUBS           r5, r5, #4  
-        VMLAL.S16      Q10, D0, D1         
-        B              LOOP4    
-L4:                  
+        SUBS           r5, r5, #4
+        VMLAL.S16      Q10, D0, D1
+        B              LOOP4
+L4:
         VADD.S32       D20, D20, D21
         VPADD.S32      D20, D20, D20
         VMOV.S32       r5,  D20[0]
@@ -165,14 +165,14 @@
         MOV            r5, r5, LSR #16                   @extract_h(s)
         ADD            r3, r3, #1
         STRH           r5, [r2], #2                      @y[n]
-        
+
         CMP            r3, #64
         BLT            LOOP
-                
-Convolve_asm_end: 
- 
+
+Convolve_asm_end:
+
         LDMFD      r13!, {r4 - r12, r15}
-    
+
         @ENDFUNC
         .END
 
diff --git a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/cor_h_vec_neon.s b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/cor_h_vec_neon.s
index c314a88..8904289 100644
--- a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/cor_h_vec_neon.s
+++ b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/cor_h_vec_neon.s
@@ -31,7 +31,7 @@
 @r5 ---- cor_1[]
 @r6 ---- cor_2[]
 
-              .section .text 
+              .section .text
 	      .global  cor_h_vec_012_asm
 
 cor_h_vec_012_asm:
@@ -52,12 +52,12 @@
 	     RSB           r11, r2, #62                      @j=62-pos
 
 LOOPj1:
-	     LDRSH         r12, [r10], #2  
+	     LDRSH         r12, [r10], #2
 	     LDRSH         r8,  [r9], #2
 	     LDRSH         r14, [r9]
 	     SUBS          r11, r11, #1
              MLA           r5, r12, r8, r5
-             MLA           r6, r12, r14, r6	 
+             MLA           r6, r12, r14, r6
 	     BGE           LOOPj1
 
 	     LDRSH         r12, [r10], #2                     @*p1++
@@ -65,7 +65,7 @@
              MLA           r5, r12, r14, r5
              MOV           r14, #0x8000
              MOV           r5, r5, LSL #2                     @L_sum1 = (L_sum1 << 2)
-             ADD           r10, r6, r14         
+             ADD           r10, r6, r14
              ADD           r9, r5, r14
              MOV           r5, r9, ASR #16
              MOV           r6, r10, ASR #16
@@ -77,7 +77,7 @@
 	     MUL           r14, r6, r11
 	     MOV           r5, r12, ASR #15
 	     MOV           r6, r14, ASR #15
-	     LDR           r9,  [r13, #44]                   
+	     LDR           r9,  [r13, #44]
 	     LDR           r12, [r13, #48]
              LDRSH         r10, [r7], #2                      @*p0++
 	     LDRSH         r11, [r8]                          @*p3++
@@ -89,7 +89,7 @@
 	     STRH          r6, [r12]
 
              ADD           r2, r2, #4
- 
+
              MOV           r5, #0                            @L_sum1 = 0
 	     MOV           r6, #0                            @L_sum2 = 0
 	     ADD           r9, r1, r2, LSL #1                @p2 = &vec[pos]
@@ -98,12 +98,12 @@
 	     ADD           r4, r4, #1                        @i++
 
 LOOPj2:
-	     LDRSH         r12, [r10], #2  
+	     LDRSH         r12, [r10], #2
 	     LDRSH         r8,  [r9], #2
 	     LDRSH         r14, [r9]
 	     SUBS          r11, r11, #1
              MLA           r5, r12, r8, r5
-             MLA           r6, r12, r14, r6	 
+             MLA           r6, r12, r14, r6
 	     BGE           LOOPj2
 
 	     LDRSH         r12, [r10], #2                     @*p1++
@@ -111,7 +111,7 @@
              MLA           r5, r12, r14, r5
              MOV           r14, #0x8000
              MOV           r5, r5, LSL #2                     @L_sum1 = (L_sum1 << 2)
-             ADD           r10, r6, r14        
+             ADD           r10, r6, r14
              ADD           r9, r5, r14
 
              MOV           r5, r9, ASR #16
@@ -124,7 +124,7 @@
 	     MUL           r14, r6, r11
 	     MOV           r5, r12, ASR #15
 	     MOV           r6, r14, ASR #15
-	     LDR           r9,  [r13, #44]                   
+	     LDR           r9,  [r13, #44]
 	     LDR           r12, [r13, #48]
              LDRSH         r10, [r7], #2                      @*p0++
 	     LDRSH         r11, [r8]                          @*p3++
@@ -137,15 +137,15 @@
 	     ADD           r4, r4, #1                         @i+1
 	     ADD           r2, r2, #4                         @pos += STEP
 	     CMP           r4, #16
-	     
+
 	     BLT           LOOPi
-         
+
 the_end:
              LDMFD         r13!, {r4 - r12, r15}
-             
-	     .END	 
-        
-	
-	  
+
+	     .END
+
+
+
 
 
diff --git a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/pred_lt4_1_neon.s b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/pred_lt4_1_neon.s
index dffb750..6b782cb 100644
--- a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/pred_lt4_1_neon.s
+++ b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/pred_lt4_1_neon.s
@@ -25,14 +25,14 @@
 @ r1    ---  T0
 @ r2    ---  frac
 @ r3    ---  L_subfr
- 
-          .section  .text 
+
+          .section  .text
           .global   pred_lt4_asm
           .extern   inter4_2
 
 pred_lt4_asm:
 
-          STMFD   	r13!, {r4 - r12, r14} 
+          STMFD   	r13!, {r4 - r12, r14}
           SUB           r4, r0, r1, LSL #1                        @ x = exc - T0
           RSB           r2, r2, #0                                @ frac = - frac
           SUB           r4, r4, #30                               @ x -= L_INTERPOL2 - 1
@@ -47,8 +47,8 @@
 
 	  VLD1.S16      {Q0, Q1}, [r11]!
 	  VLD1.S16      {Q2, Q3}, [r11]!
-          
-	  MOV           r6, #0x8000 
+
+	  MOV           r6, #0x8000
 
           VLD1.S16      {Q4, Q5}, [r4]!                           @load 16 x[]
           VLD1.S16      {Q6, Q7}, [r4]!                           @load 16 x[]
@@ -58,14 +58,14 @@
           VQDMLAL.S16   Q15, D9, D1
           VQDMLAL.S16   Q15, D10, D2
           VQDMLAL.S16   Q15, D11, D3
-        
+
           VQDMLAL.S16   Q15, D12, D4
           VQDMLAL.S16   Q15, D13, D5
           VQDMLAL.S16   Q15, D14, D6
           VQDMLAL.S16   Q15, D15, D7
 
-          LDRSH         r12, [r4], #2                
-          
+          LDRSH         r12, [r4], #2
+
           VEXT.S16      D8, D8, D9, #1
           VEXT.S16      D9, D9, D10, #1
           VEXT.S16      D10, D10, D11, #1
@@ -73,26 +73,26 @@
           VDUP.S16      D24, r12
           VEXT.S16      D12, D12, D13, #1
           VEXT.S16      D13, D13, D14, #1
-     
+
           VQADD.S32     D30, D30, D31
-	  MOV           r11, #0x8000          
+	  MOV           r11, #0x8000
           VPADD.S32     D30, D30, D30
           ADD           r8, r8, #1
           VMOV.S32      r12, D30[0]
-          VEXT.S16      D14, D14, D15, #1          
+          VEXT.S16      D14, D14, D15, #1
 
           QADD          r1, r12, r12                              @ L_sum = (L_sum << 2)
           VEXT.S16      D15, D15, D24, #1
-          QADD          r5, r1, r6                         
+          QADD          r5, r1, r6
           MOV           r1, r5, ASR #16
           CMP           r8, r3
           STRH          r1, [r0], #2                              @ exc[j] = (L_sum + 0x8000) >> 16
           BLT           LOOP
-                    
+
 pred_lt4_end:
-		     
-          LDMFD   	r13!, {r4 - r12, r15} 
- 
+
+          LDMFD   	r13!, {r4 - r12, r15}
+
 Lable1:
           .word   	inter4_2
           @ENDFUNC
diff --git a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/residu_asm_neon.s b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/residu_asm_neon.s
index b9e6b23..394fa83 100644
--- a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/residu_asm_neon.s
+++ b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/residu_asm_neon.s
@@ -26,17 +26,17 @@
 @lg         RN     r3
 
 	.section   .text
-        .global    Residu_opt 
+        .global    Residu_opt
 
 Residu_opt:
 
-        STMFD          r13!, {r4 - r12, r14} 
+        STMFD          r13!, {r4 - r12, r14}
         SUB            r7, r3, #4                       @i = lg - 4
-        
-        VLD1.S16       {D0, D1, D2, D3}, [r0]!              @get all a[]  
+
+        VLD1.S16       {D0, D1, D2, D3}, [r0]!              @get all a[]
 	VLD1.S16       {D4}, [r0]!
         VMOV.S32       Q8,  #0x8000
-        
+
 LOOP1:
         ADD            r9, r1, r7, LSL #1               @copy the address
         ADD            r10, r2, r7, LSL #1
@@ -45,7 +45,7 @@
         VQDMULL.S16    Q10, D5, D0[0]                  @finish the first L_mult
 
         SUB            r8, r9, #2                       @get the x[i-1] address
-        VLD1.S16       D5, [r8]! 
+        VLD1.S16       D5, [r8]!
         VQDMLAL.S16    Q10, D5, D0[1]
 
         SUB            r8, r9, #4                       @load the x[i-2] address
@@ -53,36 +53,36 @@
         VQDMLAL.S16    Q10, D5, D0[2]
 
         SUB            r8, r9, #6                       @load the x[i-3] address
-        VLD1.S16       D5, [r8]!     
-        VQDMLAL.S16    Q10, D5, D0[3]                    
+        VLD1.S16       D5, [r8]!
+        VQDMLAL.S16    Q10, D5, D0[3]
 
         SUB            r8, r9, #8                       @load the x[i-4] address
-        VLD1.S16       D5, [r8]!     
-        VQDMLAL.S16    Q10, D5, D1[0]  
+        VLD1.S16       D5, [r8]!
+        VQDMLAL.S16    Q10, D5, D1[0]
 
         SUB            r8, r9, #10                      @load the x[i-5] address
-        VLD1.S16       D5, [r8]!     
-        VQDMLAL.S16    Q10, D5, D1[1] 
+        VLD1.S16       D5, [r8]!
+        VQDMLAL.S16    Q10, D5, D1[1]
 
         SUB            r8, r9, #12                      @load the x[i-6] address
-        VLD1.S16       D5, [r8]!     
-        VQDMLAL.S16    Q10, D5, D1[2]  
+        VLD1.S16       D5, [r8]!
+        VQDMLAL.S16    Q10, D5, D1[2]
 
         SUB            r8, r9, #14                      @load the x[i-7] address
-        VLD1.S16       D5, [r8]!     
-        VQDMLAL.S16    Q10, D5, D1[3]  
+        VLD1.S16       D5, [r8]!
+        VQDMLAL.S16    Q10, D5, D1[3]
 
         SUB            r8, r9, #16                      @load the x[i-8] address
-        VLD1.S16       D5, [r8]!     
-        VQDMLAL.S16    Q10, D5, D2[0]  
+        VLD1.S16       D5, [r8]!
+        VQDMLAL.S16    Q10, D5, D2[0]
 
         SUB            r8, r9, #18                      @load the x[i-9] address
-        VLD1.S16       D5, [r8]!     
-        VQDMLAL.S16    Q10, D5, D2[1]         
-           
+        VLD1.S16       D5, [r8]!
+        VQDMLAL.S16    Q10, D5, D2[1]
+
         SUB            r8, r9, #20                      @load the x[i-10] address
-        VLD1.S16       D5, [r8]!     
-        VQDMLAL.S16    Q10, D5, D2[2]  
+        VLD1.S16       D5, [r8]!
+        VQDMLAL.S16    Q10, D5, D2[2]
 
 	SUB            r8, r9, #22                      @load the x[i-11] address
 	VLD1.S16       D5, [r8]!
@@ -117,10 +117,10 @@
 
         BGE            LOOP1
 
-Residu_asm_end: 
- 
+Residu_asm_end:
+
         LDMFD      r13!, {r4 - r12, r15}
-    
+
         @ENDFUNC
         .END
 
diff --git a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/scale_sig_neon.s b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/scale_sig_neon.s
index bbd354d..e45daac 100644
--- a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/scale_sig_neon.s
+++ b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/scale_sig_neon.s
@@ -13,7 +13,7 @@
 @ ** See the License for the specific language governing permissions and
 @ ** limitations under the License.
 @ */
-@                   
+@
 @**********************************************************************/
 @void Scale_sig(
 @               Word16 x[],                           /* (i/o) : signal to scale               */
@@ -25,16 +25,16 @@
 @  lg    ---  r1
 @  exp   ---  r2
 
-          .section  .text 
+          .section  .text
           .global   Scale_sig_opt
 
 Scale_sig_opt:
 
-          STMFD   	r13!, {r4 - r12, r14} 
+          STMFD   	r13!, {r4 - r12, r14}
           MOV           r4, #4
-          VMOV.S32      Q15, #0x8000       
-          VDUP.S32      Q14, r2  
-          MOV           r5, r0                          @ copy x[] address    
+          VMOV.S32      Q15, #0x8000
+          VDUP.S32      Q14, r2
+          MOV           r5, r0                          @ copy x[] address
           CMP           r1, #64
           MOVEQ         r4, #1
           BEQ           LOOP
@@ -48,7 +48,7 @@
 	  BEQ           LOOP1
 
 LOOP1:
-          VLD1.S16      {Q0, Q1}, [r5]!                 @load 16 Word16 x[]     
+          VLD1.S16      {Q0, Q1}, [r5]!                 @load 16 Word16 x[]
           VSHLL.S16     Q10, D0, #16
           VSHLL.S16     Q11, D1, #16
           VSHLL.S16     Q12, D2, #16
@@ -63,7 +63,7 @@
           VADDHN.S32    D19, Q13, Q15
           VST1.S16      {Q8, Q9}, [r0]!                 @store 16 Word16 x[]
 
-LOOP:                
+LOOP:
           VLD1.S16      {Q0, Q1}, [r5]!                 @load 16 Word16 x[]
           VLD1.S16      {Q2, Q3}, [r5]!                 @load 16 Word16 x[]
           VLD1.S16      {Q4, Q5}, [r5]!                 @load 16 Word16 x[]
@@ -72,7 +72,7 @@
           VSHLL.S16     Q8, D0, #16
           VSHLL.S16     Q9, D1, #16
           VSHLL.S16     Q10, D2, #16
-          VSHLL.S16     Q11, D3, #16     
+          VSHLL.S16     Q11, D3, #16
           VSHL.S32      Q8, Q8, Q14
           VSHL.S32      Q9, Q9, Q14
           VSHL.S32      Q10, Q10, Q14
@@ -83,7 +83,7 @@
           VADDHN.S32    D19, Q11, Q15
           VST1.S16      {Q8, Q9}, [r0]!                 @store 16 Word16 x[]
 
-   
+
           VSHLL.S16     Q12, D4, #16
           VSHLL.S16     Q13, D5, #16
           VSHLL.S16     Q10, D6, #16
@@ -112,7 +112,7 @@
           VADDHN.S32    D19, Q13, Q15
           VST1.S16      {Q8, Q9}, [r0]!                 @store 16 Word16 x[]
 
-          VSHLL.S16     Q10, D12, #16   
+          VSHLL.S16     Q10, D12, #16
           VSHLL.S16     Q11, D13, #16
           VSHLL.S16     Q12, D14, #16
           VSHLL.S16     Q13, D15, #16
@@ -123,16 +123,16 @@
           VADDHN.S32    D16, Q10, Q15
           VADDHN.S32    D17, Q11, Q15
           VADDHN.S32    D18, Q12, Q15
-          VADDHN.S32    D19, Q13, Q15 
-          VST1.S16      {Q8, Q9}, [r0]!                 @store 16 Word16 x[]  
+          VADDHN.S32    D19, Q13, Q15
+          VST1.S16      {Q8, Q9}, [r0]!                 @store 16 Word16 x[]
           SUBS          r4, r4, #1
-          BGT           LOOP     
-                
-                          
+          BGT           LOOP
+
+
 Scale_sig_asm_end:
 
-          LDMFD   	r13!, {r4 - r12, r15} 
+          LDMFD   	r13!, {r4 - r12, r15}
           @ENDFUNC
           .END
- 
+
 
diff --git a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/syn_filt_neon.s b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/syn_filt_neon.s
index db4559c..5731bdb 100644
--- a/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/syn_filt_neon.s
+++ b/media/libstagefright/codecs/amrwbenc/src/asm/ARMV7/syn_filt_neon.s
@@ -27,21 +27,21 @@
 @ mem[]  ---   r3
 @ m ---  16  lg --- 80  update --- 1
 
-          .section  .text 
+          .section  .text
           .global   Syn_filt_asm
 
 Syn_filt_asm:
 
-          STMFD   	r13!, {r4 - r12, r14} 
+          STMFD   	r13!, {r4 - r12, r14}
           SUB           r13, r13, #700                   @ y_buf[L_FRAME16k + M16k]
-   
+
           MOV           r4, r3                           @ copy mem[] address
           MOV           r5, r13                          @ copy yy = y_buf address
 
           @ for(i = 0@ i < m@ i++)
           @{
           @    *yy++ = mem[i]@
-          @} 
+          @}
           VLD1.S16      {D0, D1, D2, D3}, [r4]!          @load 16 mems
 	  VST1.S16      {D0, D1, D2, D3}, [r5]!          @store 16 mem[] to *yy
 
@@ -54,7 +54,7 @@
 	  VREV64.16     D0, D0
 	  VREV64.16     D1, D1
 	  VREV64.16     D2, D2
-	  VREV64.16     D3, D3 
+	  VREV64.16     D3, D3
 	  MOV           r8, #0                           @ loop times
 	  MOV           r10, r13                         @ temp = y_buf
 	  ADD           r4, r13, #32                     @ yy[i] address
@@ -68,7 +68,7 @@
 	  ADD           r10, r4, r8, LSL #1              @ y[i], yy[i] address
 
 	  VDUP.S32      Q10, r12
-	  VMULL.S16     Q5, D3, D4                    
+	  VMULL.S16     Q5, D3, D4
           VMLAL.S16     Q5, D2, D5
           VMLAL.S16     Q5, D1, D6
           VMLAL.S16     Q5, D0, D7
@@ -82,25 +82,25 @@
 	  VDUP.S32      Q7, D10[0]
 
 	  VSUB.S32      Q9, Q10, Q7
-          VQRSHRN.S32   D20, Q9, #12   
+          VQRSHRN.S32   D20, Q9, #12
           VMOV.S16      r9, D20[0]
           VEXT.8        D7, D7, D20, #2
           CMP           r8, #80
           STRH          r9, [r10]                        @ yy[i]
-          STRH          r9, [r2], #2                     @ y[i]          	         
-	  
+          STRH          r9, [r2], #2                     @ y[i]
+
           BLT           SYN_LOOP
- 
+
           @ update mem[]
           ADD           r5, r13, #160                    @ yy[64] address
 	  VLD1.S16      {D0, D1, D2, D3}, [r5]!
-	  VST1.S16      {D0, D1, D2, D3}, [r3]!              
+	  VST1.S16      {D0, D1, D2, D3}, [r3]!
 
 Syn_filt_asm_end:
- 
-          ADD           r13, r13, #700		     
-          LDMFD   	r13!, {r4 - r12, r15} 
+
+          ADD           r13, r13, #700
+          LDMFD   	r13!, {r4 - r12, r15}
           @ENDFUNC
           .END
- 
+
 
diff --git a/media/libstagefright/codecs/amrwbenc/src/autocorr.c b/media/libstagefright/codecs/amrwbenc/src/autocorr.c
index 9baa937..8c477ca 100644
--- a/media/libstagefright/codecs/amrwbenc/src/autocorr.c
+++ b/media/libstagefright/codecs/amrwbenc/src/autocorr.c
@@ -70,19 +70,19 @@
 		p1 = y;
 		for (i = 0; i < L_WINDOW; i+=4)
 		{
-			*p1 = vo_shr_r(*p1, shift); 
-			p1++;
-			*p1 = vo_shr_r(*p1, shift); 
+			*p1 = vo_shr_r(*p1, shift);
 			p1++;
 			*p1 = vo_shr_r(*p1, shift);
 			p1++;
-			*p1 = vo_shr_r(*p1, shift); 
+			*p1 = vo_shr_r(*p1, shift);
+			p1++;
+			*p1 = vo_shr_r(*p1, shift);
 			p1++;
 		}
 	}
 
 	/* Compute and normalize r[0] */
-	L_sum = 1; 
+	L_sum = 1;
 	for (i = 0; i < L_WINDOW; i+=4)
 	{
 		L_sum += vo_L_mult(y[i], y[i]);
diff --git a/media/libstagefright/codecs/amrwbenc/src/az_isp.c b/media/libstagefright/codecs/amrwbenc/src/az_isp.c
index 9333d19..43db27a 100644
--- a/media/libstagefright/codecs/amrwbenc/src/az_isp.c
+++ b/media/libstagefright/codecs/amrwbenc/src/az_isp.c
@@ -90,9 +90,9 @@
 		f1[i] = vo_round(t0 + (a[M - i] << 15));        /* =(a[i]+a[M-i])/2 */
 		f2[i] = vo_round(t0 - (a[M - i] << 15));        /* =(a[i]-a[M-i])/2 */
 	}
-	f1[NC] = a[NC];                        
+	f1[NC] = a[NC];
 	for (i = 2; i < NC; i++)               /* Divide by (1-z^-2) */
-		f2[i] = add1(f2[i], f2[i - 2]);     
+		f2[i] = add1(f2[i], f2[i - 2]);
 
 	/*---------------------------------------------------------------------*
 	 * Find the ISPs (roots of F1(z) and F2(z) ) using the                 *
@@ -107,17 +107,17 @@
 	 *---------------------------------------------------------------------*/
 	nf = 0;                                  /* number of found frequencies */
 	ip = 0;                                  /* indicator for f1 or f2      */
-	coef = f1;                             
-	order = NC;                            
-	xlow = vogrid[0];                        
+	coef = f1;
+	order = NC;
+	xlow = vogrid[0];
 	ylow = Chebps2(xlow, coef, order);
 	j = 0;
 	while ((nf < M - 1) && (j < GRID_POINTS))
 	{
 		j ++;
-		xhigh = xlow;                     
-		yhigh = ylow;                      
-		xlow = vogrid[j];                    
+		xhigh = xlow;
+		yhigh = ylow;
+		xlow = vogrid[j];
 		ylow = Chebps2(xlow, coef, order);
 		if ((ylow * yhigh) <= (Word32) 0)
 		{
@@ -128,12 +128,12 @@
 				ymid = Chebps2(xmid, coef, order);
 				if ((ylow * ymid) <= (Word32) 0)
 				{
-					yhigh = ymid;         
-					xhigh = xmid;          
+					yhigh = ymid;
+					xhigh = xmid;
 				} else
 				{
-					ylow = ymid;           
-					xlow = xmid;          
+					ylow = ymid;
+					xlow = xmid;
 				}
 			}
 			/*-------------------------------------------------------------*
@@ -144,10 +144,10 @@
 			y = yhigh - ylow;
 			if (y == 0)
 			{
-				xint = xlow;               
+				xint = xlow;
 			} else
 			{
-				sign = y;                 
+				sign = y;
 				y = abs_s(y);
 				exp = norm_s(y);
 				y = y << exp;
@@ -161,19 +161,19 @@
 				t0 = (t0 >> 10);        /* result in Q15 */
 				xint = vo_sub(xlow, vo_extract_l(t0));        /* xint = xlow - ylow*y */
 			}
-			isp[nf] = xint;                
-			xlow = xint;                   
-			nf++;                          
+			isp[nf] = xint;
+			xlow = xint;
+			nf++;
 			if (ip == 0)
 			{
-				ip = 1;                    
-				coef = f2;                
-				order = NC - 1;           
+				ip = 1;
+				coef = f2;
+				order = NC - 1;
 			} else
 			{
-				ip = 0;                   
-				coef = f1;                 
-				order = NC;              
+				ip = 0;
+				coef = f1;
+				order = NC;
 			}
 			ylow = Chebps2(xlow, coef, order);
 		}
@@ -183,7 +183,7 @@
 	{
 		for (i = 0; i < M; i++)
 		{
-			isp[i] = old_isp[i];          
+			isp[i] = old_isp[i];
 		}
 	} else
 	{
@@ -243,9 +243,9 @@
 		b0_l = (t0 & 0xffff) >> 1;
 
 		b2_l = b1_l;                         /* b2 = b1; */
-		b2_h = b1_h;                       
+		b2_h = b1_h;
 		b1_l = b0_l;                         /* b1 = b0; */
-		b1_h = b0_h;                       
+		b1_h = b0_h;
 	}
 
 	t0 = ((b1_h * x)<<1) + (((b1_l * x)>>15)<<1);
diff --git a/media/libstagefright/codecs/amrwbenc/src/bits.c b/media/libstagefright/codecs/amrwbenc/src/bits.c
index 61cac3d5..e78dc1f 100644
--- a/media/libstagefright/codecs/amrwbenc/src/bits.c
+++ b/media/libstagefright/codecs/amrwbenc/src/bits.c
@@ -34,8 +34,8 @@
 
 int PackBits(Word16 prms[],             /*  i: analysis parameters */
 			 Word16 coding_mode,        /*  i: coding bit-stream ratio mode */
-			 Word16 mode,               /*  i: coding bit-stream ratio mode*/ 
-			 Coder_State *st            /*i/o: coder global parameters struct */           
+			 Word16 mode,               /*  i: coding bit-stream ratio mode*/
+			 Coder_State *st            /*i/o: coder global parameters struct */
 			 )
 {
 	Word16 i, frame_type;
@@ -46,7 +46,7 @@
 	unsigned short* dataOut = st->outputStream;
 
 	if (coding_mode == MRDTX)
-	{	   
+	{
 		st->sid_update_counter--;
 
 		if (st->prev_ft == TX_SPEECH)
@@ -92,7 +92,7 @@
 	} else
 	{
 		if (bitstreamformat == 1)		/* ITU file format */
-		{  						
+		{
 			*(dataOut) = 0x6b21;
 			if(frame_type != TX_NO_DATA && frame_type != TX_SID_FIRST)
 			{
@@ -100,17 +100,17 @@
 				for (i = 0; i < nb_of_bits[coding_mode]; i++)
 				{
 					if(prms[i] == BIT_0){
-						*(dataOut + 2 + i) = BIT_0_ITU;	 			
+						*(dataOut + 2 + i) = BIT_0_ITU;
 					}
 					else{
 						*(dataOut + 2 + i) = BIT_1_ITU;
 					}
 				}
-				return (2 + nb_of_bits[coding_mode])<<1;   
+				return (2 + nb_of_bits[coding_mode])<<1;
 			} else
 			{
 				*(dataOut + 1) = 0;
-				return 2<<1;	   
+				return 2<<1;
 			}
 		} else							/* MIME/storage file format */
 		{
@@ -191,7 +191,7 @@
 		)
 {
 	Word16 i, bit;
-	*prms += no_of_bits;                  
+	*prms += no_of_bits;
 	for (i = 0; i < no_of_bits; i++)
 	{
 		bit = (Word16) (value & 0x0001);    /* get lsb */
@@ -199,9 +199,9 @@
 			*--(*prms) = BIT_0;
 		else
 			*--(*prms) = BIT_1;
-		value >>= 1;          
+		value >>= 1;
 	}
-	*prms += no_of_bits;                  
+	*prms += no_of_bits;
 	return;
 }
 
diff --git a/media/libstagefright/codecs/amrwbenc/src/c2t64fx.c b/media/libstagefright/codecs/amrwbenc/src/c2t64fx.c
index 80990d9..18698e2 100644
--- a/media/libstagefright/codecs/amrwbenc/src/c2t64fx.c
+++ b/media/libstagefright/codecs/amrwbenc/src/c2t64fx.c
@@ -79,7 +79,7 @@
 #endif
 
 	Isqrt_n(&s, &exp);
-	s = L_shl(s, add1(exp, 5));             
+	s = L_shl(s, add1(exp, 5));
 	k_cn = vo_round(s);
 
 	/* set k_dn = 32..512 (ener_dn = 2^30..2^22) */
@@ -107,22 +107,22 @@
 		s = (k_cn* (*p0++))+(k_dn * (*p1++));
 		*p2++ = s >> 7;
 		s = (k_cn* (*p0++))+(k_dn * (*p1++));
-		*p2++ = s >> 7; 
+		*p2++ = s >> 7;
 	}
 
 	/* set sign according to dn2[] = k_cn*cn[] + k_dn*dn[]    */
 	for (i = 0; i < L_SUBFR; i ++)
 	{
-		val = dn[i];                   
-		ps = dn2[i];                   
+		val = dn[i];
+		ps = dn2[i];
 		if (ps >= 0)
 		{
 			sign[i] = 32767;             /* sign = +1 (Q12) */
-			vec[i] = -32768;           
+			vec[i] = -32768;
 		} else
 		{
 			sign[i] = -32768;            /* sign = -1 (Q12) */
-			vec[i] = 32767;            
+			vec[i] = 32767;
 			dn[i] = -val;
 		}
 	}
@@ -130,13 +130,13 @@
 	 * Compute h_inv[i].                                          *
 	 *------------------------------------------------------------*/
 	/* impulse response buffer for fast computation */
-	h = h_buf + L_SUBFR;                             
-	h_inv = h + (L_SUBFR<<1);         
+	h = h_buf + L_SUBFR;
+	h_inv = h + (L_SUBFR<<1);
 
 	for (i = 0; i < L_SUBFR; i++)
 	{
-		h[i] = H[i];                       
-		h_inv[i] = vo_negate(h[i]);           
+		h[i] = H[i];
+		h_inv[i] = vo_negate(h[i]);
 	}
 
 	/*------------------------------------------------------------*
@@ -144,46 +144,46 @@
 	 * Result is multiplied by 0.5                                *
 	 *------------------------------------------------------------*/
 	/* Init pointers to last position of rrixix[] */
-	p0 = &rrixix[0][NB_POS - 1];           
-	p1 = &rrixix[1][NB_POS - 1];           
+	p0 = &rrixix[0][NB_POS - 1];
+	p1 = &rrixix[1][NB_POS - 1];
 
-	ptr_h1 = h;                            
+	ptr_h1 = h;
 	cor = 0x00010000L;                          /* for rounding */
 	for (i = 0; i < NB_POS; i++)
 	{
 		cor += ((*ptr_h1) * (*ptr_h1) << 1);
 		ptr_h1++;
-		*p1-- = (extract_h(cor) >> 1);            
+		*p1-- = (extract_h(cor) >> 1);
 		cor += ((*ptr_h1) * (*ptr_h1) << 1);
 		ptr_h1++;
-		*p0-- = (extract_h(cor) >> 1);            
+		*p0-- = (extract_h(cor) >> 1);
 	}
 
 	/*------------------------------------------------------------*
 	 * Compute rrixiy[][] needed for the codebook search.         *
 	 *------------------------------------------------------------*/
-	pos = MSIZE - 1;                       
-	pos2 = MSIZE - 2;                      
-	ptr_hf = h + 1;                        
+	pos = MSIZE - 1;
+	pos2 = MSIZE - 2;
+	ptr_hf = h + 1;
 
 	for (k = 0; k < NB_POS; k++)
 	{
-		p1 = &rrixiy[pos];                 
-		p0 = &rrixiy[pos2];                
+		p1 = &rrixiy[pos];
+		p0 = &rrixiy[pos2];
 		cor = 0x00008000L;                        /* for rounding */
-		ptr_h1 = h;                        
-		ptr_h2 = ptr_hf;                   
+		ptr_h1 = h;
+		ptr_h2 = ptr_hf;
 
 		for (i = (k + 1); i < NB_POS; i++)
 		{
 			cor += ((*ptr_h1) * (*ptr_h2))<<1;
 			ptr_h1++;
 			ptr_h2++;
-			*p1 = extract_h(cor);          
+			*p1 = extract_h(cor);
 			cor += ((*ptr_h1) * (*ptr_h2))<<1;
 			ptr_h1++;
 			ptr_h2++;
-			*p0 = extract_h(cor);         
+			*p0 = extract_h(cor);
 
 			p1 -= (NB_POS + 1);
 			p0 -= (NB_POS + 1);
@@ -191,7 +191,7 @@
 		cor += ((*ptr_h1) * (*ptr_h2))<<1;
 		ptr_h1++;
 		ptr_h2++;
-		*p1 = extract_h(cor);              
+		*p1 = extract_h(cor);
 
 		pos -= NB_POS;
 		pos2--;
@@ -201,17 +201,17 @@
 	/*------------------------------------------------------------*
 	 * Modification of rrixiy[][] to take signs into account.     *
 	 *------------------------------------------------------------*/
-	p0 = rrixiy;                          
+	p0 = rrixiy;
 	for (i = 0; i < L_SUBFR; i += STEP)
 	{
-		psign = sign;                      
+		psign = sign;
 		if (psign[i] < 0)
 		{
-			psign = vec;                   
+			psign = vec;
 		}
 		for (j = 1; j < L_SUBFR; j += STEP)
 		{
-			*p0 = vo_mult(*p0, psign[j]);     
+			*p0 = vo_mult(*p0, psign[j]);
 			p0++;
 		}
 	}
@@ -220,20 +220,20 @@
 	 * ~@~~~~~~~~~~~~~~                                                  *
 	 * 32 pos x 32 pos = 1024 tests (all combinaisons is tested)         *
 	 *-------------------------------------------------------------------*/
-	p0 = rrixix[0];                        
-	p1 = rrixix[1];                        
-	p2 = rrixiy;                          
+	p0 = rrixix[0];
+	p1 = rrixix[1];
+	p2 = rrixiy;
 
-	psk = -1;                              
-	alpk = 1;                              
-	ix = 0;                                
-	iy = 1;                                
+	psk = -1;
+	alpk = 1;
+	ix = 0;
+	iy = 1;
 
 	for (i0 = 0; i0 < L_SUBFR; i0 += STEP)
 	{
-		ps1 = dn[i0];                      
-		alp1 = (*p0++);                    
-		pos = -1;                          
+		ps1 = dn[i0];
+		alp1 = (*p0++);
+		pos = -1;
 		for (i1 = 1; i1 < L_SUBFR; i1 += STEP)
 		{
 			ps2 = add1(ps1, dn[i1]);
@@ -242,16 +242,16 @@
 			s = vo_L_mult(alpk, sq) - ((psk * alp2)<<1);
 			if (s > 0)
 			{
-				psk = sq;                  
-				alpk = alp2;               
-				pos = i1;                  
+				psk = sq;
+				alpk = alp2;
+				pos = i1;
 			}
 		}
 		p1 -= NB_POS;
 		if (pos >= 0)
 		{
-			ix = i0;                      
-			iy = pos;                      
+			ix = i0;
+			iy = pos;
 		}
 	}
 	/*-------------------------------------------------------------------*
@@ -260,7 +260,7 @@
 
 	for (i = 0; i < L_SUBFR; i++)
 	{
-		code[i] = 0;                       
+		code[i] = 0;
 	}
 
 	i0 = (ix >> 1);                       /* pos of pulse 1 (0..31) */
@@ -268,24 +268,24 @@
 	if (sign[ix] > 0)
 	{
 		code[ix] = 512;                     /* codeword in Q9 format */
-		p0 = h - ix;                       
+		p0 = h - ix;
 	} else
 	{
-		code[ix] = -512;                   
-		i0 += NB_POS;                      
-		p0 = h_inv - ix;                   
+		code[ix] = -512;
+		i0 += NB_POS;
+		p0 = h_inv - ix;
 	}
 	if (sign[iy] > 0)
 	{
-		code[iy] = 512;                    
-		p1 = h - iy;                       
+		code[iy] = 512;
+		p1 = h - iy;
 	} else
 	{
-		code[iy] = -512;                   
-		i1 += NB_POS;                      
-		p1 = h_inv - iy;                   
+		code[iy] = -512;
+		i1 += NB_POS;
+		p1 = h_inv - iy;
 	}
-	*index = add1((i0 << 6), i1);          
+	*index = add1((i0 << 6), i1);
 	for (i = 0; i < L_SUBFR; i++)
 	{
 		y[i] = vo_shr_r(add1((*p0++), (*p1++)), 3);
diff --git a/media/libstagefright/codecs/amrwbenc/src/c4t64fx.c b/media/libstagefright/codecs/amrwbenc/src/c4t64fx.c
index 17f3d47..1ecc11f 100644
--- a/media/libstagefright/codecs/amrwbenc/src/c4t64fx.c
+++ b/media/libstagefright/codecs/amrwbenc/src/c4t64fx.c
@@ -151,58 +151,58 @@
 		case 20:                               /* 20 bits, 4 pulses, 4 tracks */
 			nbiter = 4;                          /* 4x16x16=1024 loop */
 			alp = 8192;                          /* alp = 2.0 (Q12) */
-			nb_pulse = 4;                      
-			nbpos[0] = 4;                      
-			nbpos[1] = 8;                      
+			nb_pulse = 4;
+			nbpos[0] = 4;
+			nbpos[1] = 8;
 			break;
 		case 36:                               /* 36 bits, 8 pulses, 4 tracks */
 			nbiter = 4;                          /* 4x20x16=1280 loop */
 			alp = 4096;                          /* alp = 1.0 (Q12) */
-			nb_pulse = 8;                      
-			nbpos[0] = 4;                      
-			nbpos[1] = 8;                      
-			nbpos[2] = 8;                      
+			nb_pulse = 8;
+			nbpos[0] = 4;
+			nbpos[1] = 8;
+			nbpos[2] = 8;
 			break;
 		case 44:                               /* 44 bits, 10 pulses, 4 tracks */
 			nbiter = 4;                          /* 4x26x16=1664 loop */
 			alp = 4096;                          /* alp = 1.0 (Q12) */
-			nb_pulse = 10;                     
-			nbpos[0] = 4;                      
-			nbpos[1] = 6;                      
-			nbpos[2] = 8;                      
-			nbpos[3] = 8;                      
+			nb_pulse = 10;
+			nbpos[0] = 4;
+			nbpos[1] = 6;
+			nbpos[2] = 8;
+			nbpos[3] = 8;
 			break;
 		case 52:                               /* 52 bits, 12 pulses, 4 tracks */
 			nbiter = 4;                          /* 4x26x16=1664 loop */
 			alp = 4096;                          /* alp = 1.0 (Q12) */
-			nb_pulse = 12;                     
-			nbpos[0] = 4;                      
-			nbpos[1] = 6;                      
-			nbpos[2] = 8;                      
-			nbpos[3] = 8;                      
+			nb_pulse = 12;
+			nbpos[0] = 4;
+			nbpos[1] = 6;
+			nbpos[2] = 8;
+			nbpos[3] = 8;
 			break;
 		case 64:                               /* 64 bits, 16 pulses, 4 tracks */
 			nbiter = 3;                          /* 3x36x16=1728 loop */
 			alp = 3277;                          /* alp = 0.8 (Q12) */
-			nb_pulse = 16;                     
-			nbpos[0] = 4;                      
-			nbpos[1] = 4;                      
-			nbpos[2] = 6;                      
-			nbpos[3] = 6;                      
-			nbpos[4] = 8;                      
-			nbpos[5] = 8;                      
+			nb_pulse = 16;
+			nbpos[0] = 4;
+			nbpos[1] = 4;
+			nbpos[2] = 6;
+			nbpos[3] = 6;
+			nbpos[4] = 8;
+			nbpos[5] = 8;
 			break;
 		case 72:                               /* 72 bits, 18 pulses, 4 tracks */
 			nbiter = 3;                          /* 3x35x16=1680 loop */
 			alp = 3072;                          /* alp = 0.75 (Q12) */
-			nb_pulse = 18;                     
-			nbpos[0] = 2;                      
-			nbpos[1] = 3;                      
-			nbpos[2] = 4;                      
-			nbpos[3] = 5;                      
-			nbpos[4] = 6;                      
-			nbpos[5] = 7;                      
-			nbpos[6] = 8;                      
+			nb_pulse = 18;
+			nbpos[0] = 2;
+			nbpos[1] = 3;
+			nbpos[2] = 4;
+			nbpos[3] = 5;
+			nbpos[4] = 6;
+			nbpos[5] = 7;
+			nbpos[6] = 8;
 			break;
 		case 88:                               /* 88 bits, 24 pulses, 4 tracks */
 			if(ser_size > 462)
@@ -211,17 +211,17 @@
 				nbiter = 2;                    /* 2x53x16=1696 loop */
 
 			alp = 2048;                          /* alp = 0.5 (Q12) */
-			nb_pulse = 24;                     
-			nbpos[0] = 2;                      
-			nbpos[1] = 2;                      
-			nbpos[2] = 3;                      
-			nbpos[3] = 4;                      
-			nbpos[4] = 5;                      
-			nbpos[5] = 6;                      
-			nbpos[6] = 7;                      
-			nbpos[7] = 8;                      
-			nbpos[8] = 8;                      
-			nbpos[9] = 8;                      
+			nb_pulse = 24;
+			nbpos[0] = 2;
+			nbpos[1] = 2;
+			nbpos[2] = 3;
+			nbpos[3] = 4;
+			nbpos[4] = 5;
+			nbpos[5] = 6;
+			nbpos[6] = 7;
+			nbpos[7] = 8;
+			nbpos[8] = 8;
+			nbpos[9] = 8;
 			break;
 		default:
 			nbiter = 0;
@@ -231,7 +231,7 @@
 
 	for (i = 0; i < nb_pulse; i++)
 	{
-		codvec[i] = i;                     
+		codvec[i] = i;
 	}
 
 	/*----------------------------------------------------------------*
@@ -246,7 +246,7 @@
 #endif
 
 	Isqrt_n(&s, &exp);
-	s = L_shl(s, (exp + 5)); 
+	s = L_shl(s, (exp + 5));
 	k_cn = extract_h(L_add(s, 0x8000));
 
 	/* set k_dn = 32..512 (ener_dn = 2^30..2^22) */
@@ -274,22 +274,22 @@
 		s = (k_cn* (*p0++))+(k_dn * (*p1++));
 		*p2++ = s >> 7;
 		s = (k_cn* (*p0++))+(k_dn * (*p1++));
-		*p2++ = s >> 7; 
+		*p2++ = s >> 7;
 	}
 
 	/* set sign according to dn2[] = k_cn*cn[] + k_dn*dn[]    */
 	for(i = 0; i < L_SUBFR; i++)
 	{
-		val = dn[i];                   
-		ps = dn2[i];                   
+		val = dn[i];
+		ps = dn2[i];
 		if (ps >= 0)
 		{
 			sign[i] = 32767;             /* sign = +1 (Q12) */
-			vec[i] = -32768;           
+			vec[i] = -32768;
 		} else
 		{
 			sign[i] = -32768;            /* sign = -1 (Q12) */
-			vec[i] = 32767;            
+			vec[i] = 32767;
 			dn[i] = -val;
 			dn2[i] = -ps;
 		}
@@ -302,19 +302,19 @@
 	{
 		for (k = 0; k < NB_MAX; k++)
 		{
-			ps = -1;                       
+			ps = -1;
 			for (j = i; j < L_SUBFR; j += STEP)
 			{
 				if(dn2[j] > ps)
 				{
-					ps = dn2[j];          
-					pos = j;               
+					ps = dn2[j];
+					pos = j;
 				}
 			}
 			dn2[pos] = (k - NB_MAX);     /* dn2 < 0 when position is selected */
 			if (k == 0)
 			{
-				pos_max[i] = pos;          
+				pos_max[i] = pos;
 			}
 		}
 	}
@@ -335,22 +335,22 @@
 
 	/* impulse response buffer for fast computation */
 
-	h = h_buf;                             
-	h_inv = h_buf + (2 * L_SUBFR);   
+	h = h_buf;
+	h_inv = h_buf + (2 * L_SUBFR);
 	L_tmp = 0;
 	for (i = 0; i < L_SUBFR; i++)
 	{
-		*h++ = 0;                          
-		*h_inv++ = 0;   
+		*h++ = 0;
+		*h_inv++ = 0;
 		L_tmp += (H[i] * H[i]) << 1;
 	}
 	/* scale h[] down (/2) when energy of h[] is high with many pulses used */
 	val = extract_h(L_tmp);
-	h_shift = 0;                           
+	h_shift = 0;
 
 	if ((nb_pulse >= 12) && (val > 1024))
 	{
-		h_shift = 1;                       
+		h_shift = 1;
 	}
 	p0 = H;
 	p1 = h;
@@ -358,14 +358,14 @@
 
 	for (i = 0; i < L_SUBFR/4; i++)
 	{
-		*p1 = *p0++ >> h_shift;         
-		*p2++ = -(*p1++);  
-		*p1 = *p0++ >> h_shift;         
-		*p2++ = -(*p1++); 
-		*p1 = *p0++ >> h_shift;         
-		*p2++ = -(*p1++); 
-		*p1 = *p0++ >> h_shift;         
-		*p2++ = -(*p1++); 
+		*p1 = *p0++ >> h_shift;
+		*p2++ = -(*p1++);
+		*p1 = *p0++ >> h_shift;
+		*p2++ = -(*p1++);
+		*p1 = *p0++ >> h_shift;
+		*p2++ = -(*p1++);
+		*p1 = *p0++ >> h_shift;
+		*p2++ = -(*p1++);
 	}
 
 	/*------------------------------------------------------------*
@@ -377,27 +377,27 @@
 	/* storage order --> i3i3, i2i2, i1i1, i0i0 */
 
 	/* Init pointers to last position of rrixix[] */
-	p0 = &rrixix[0][NB_POS - 1];           
-	p1 = &rrixix[1][NB_POS - 1];           
-	p2 = &rrixix[2][NB_POS - 1];           
-	p3 = &rrixix[3][NB_POS - 1];           
+	p0 = &rrixix[0][NB_POS - 1];
+	p1 = &rrixix[1][NB_POS - 1];
+	p2 = &rrixix[2][NB_POS - 1];
+	p3 = &rrixix[3][NB_POS - 1];
 
-	ptr_h1 = h;                            
+	ptr_h1 = h;
 	cor = 0x00008000L;                             /* for rounding */
 	for (i = 0; i < NB_POS; i++)
 	{
 		cor += vo_L_mult((*ptr_h1), (*ptr_h1));
 		ptr_h1++;
-		*p3-- = extract_h(cor);            
+		*p3-- = extract_h(cor);
 		cor += vo_L_mult((*ptr_h1), (*ptr_h1));
 		ptr_h1++;
-		*p2-- = extract_h(cor);            
+		*p2-- = extract_h(cor);
 		cor += vo_L_mult((*ptr_h1), (*ptr_h1));
 		ptr_h1++;
-		*p1-- = extract_h(cor);            
+		*p1-- = extract_h(cor);
 		cor += vo_L_mult((*ptr_h1), (*ptr_h1));
 		ptr_h1++;
-		*p0-- = extract_h(cor);            
+		*p0-- = extract_h(cor);
 	}
 
 	/*------------------------------------------------------------*
@@ -409,38 +409,38 @@
 
 	/* storage order --> i2i3, i1i2, i0i1, i3i0 */
 
-	pos = MSIZE - 1;                       
-	ptr_hf = h + 1;                        
+	pos = MSIZE - 1;
+	ptr_hf = h + 1;
 
 	for (k = 0; k < NB_POS; k++)
 	{
-		p3 = &rrixiy[2][pos];              
-		p2 = &rrixiy[1][pos];              
-		p1 = &rrixiy[0][pos];              
-		p0 = &rrixiy[3][pos - NB_POS];     
+		p3 = &rrixiy[2][pos];
+		p2 = &rrixiy[1][pos];
+		p1 = &rrixiy[0][pos];
+		p0 = &rrixiy[3][pos - NB_POS];
 
 		cor = 0x00008000L;                   /* for rounding */
-		ptr_h1 = h;                        
-		ptr_h2 = ptr_hf;                   
+		ptr_h1 = h;
+		ptr_h2 = ptr_hf;
 
 		for (i = k + 1; i < NB_POS; i++)
 		{
 			cor += vo_L_mult((*ptr_h1), (*ptr_h2));
 			ptr_h1++;
 			ptr_h2++;
-			*p3 = extract_h(cor);          
+			*p3 = extract_h(cor);
 			cor += vo_L_mult((*ptr_h1), (*ptr_h2));
 			ptr_h1++;
 			ptr_h2++;
-			*p2 = extract_h(cor);          
+			*p2 = extract_h(cor);
 			cor += vo_L_mult((*ptr_h1), (*ptr_h2));
 			ptr_h1++;
 			ptr_h2++;
-			*p1 = extract_h(cor);          
+			*p1 = extract_h(cor);
 			cor += vo_L_mult((*ptr_h1), (*ptr_h2));
 			ptr_h1++;
 			ptr_h2++;
-			*p0 = extract_h(cor);         
+			*p0 = extract_h(cor);
 
 			p3 -= (NB_POS + 1);
 			p2 -= (NB_POS + 1);
@@ -450,15 +450,15 @@
 		cor += vo_L_mult((*ptr_h1), (*ptr_h2));
 		ptr_h1++;
 		ptr_h2++;
-		*p3 = extract_h(cor);              
+		*p3 = extract_h(cor);
 		cor += vo_L_mult((*ptr_h1), (*ptr_h2));
 		ptr_h1++;
 		ptr_h2++;
-		*p2 = extract_h(cor);              
+		*p2 = extract_h(cor);
 		cor += vo_L_mult((*ptr_h1), (*ptr_h2));
 		ptr_h1++;
 		ptr_h2++;
-		*p1 = extract_h(cor);              
+		*p1 = extract_h(cor);
 
 		pos -= NB_POS;
 		ptr_hf += STEP;
@@ -466,38 +466,38 @@
 
 	/* storage order --> i3i0, i2i3, i1i2, i0i1 */
 
-	pos = MSIZE - 1;                       
-	ptr_hf = h + 3;                        
+	pos = MSIZE - 1;
+	ptr_hf = h + 3;
 
 	for (k = 0; k < NB_POS; k++)
 	{
-		p3 = &rrixiy[3][pos];              
-		p2 = &rrixiy[2][pos - 1];          
-		p1 = &rrixiy[1][pos - 1];          
-		p0 = &rrixiy[0][pos - 1];          
+		p3 = &rrixiy[3][pos];
+		p2 = &rrixiy[2][pos - 1];
+		p1 = &rrixiy[1][pos - 1];
+		p0 = &rrixiy[0][pos - 1];
 
 		cor = 0x00008000L;								/* for rounding */
-		ptr_h1 = h;                        
-		ptr_h2 = ptr_hf;                   
+		ptr_h1 = h;
+		ptr_h2 = ptr_hf;
 
 		for (i = k + 1; i < NB_POS; i++)
 		{
 			cor += vo_L_mult((*ptr_h1), (*ptr_h2));
 			ptr_h1++;
 			ptr_h2++;
-			*p3 = extract_h(cor);          
+			*p3 = extract_h(cor);
 			cor += vo_L_mult((*ptr_h1), (*ptr_h2));
 			ptr_h1++;
 			ptr_h2++;
-			*p2 = extract_h(cor);          
+			*p2 = extract_h(cor);
 			cor += vo_L_mult((*ptr_h1), (*ptr_h2));
 			ptr_h1++;
 			ptr_h2++;
-			*p1 = extract_h(cor);          
+			*p1 = extract_h(cor);
 			cor += vo_L_mult((*ptr_h1), (*ptr_h2));
 			ptr_h1++;
 			ptr_h2++;
-			*p0 = extract_h(cor);          
+			*p0 = extract_h(cor);
 
 			p3 -= (NB_POS + 1);
 			p2 -= (NB_POS + 1);
@@ -507,7 +507,7 @@
 		cor += vo_L_mult((*ptr_h1), (*ptr_h2));
 		ptr_h1++;
 		ptr_h2++;
-		*p3 = extract_h(cor);              
+		*p3 = extract_h(cor);
 
 		pos--;
 		ptr_hf += STEP;
@@ -517,22 +517,22 @@
 	 * Modification of rrixiy[][] to take signs into account.     *
 	 *------------------------------------------------------------*/
 
-	p0 = &rrixiy[0][0];                    
+	p0 = &rrixiy[0][0];
 
 	for (k = 0; k < NB_TRACK; k++)
 	{
 		j_temp = (k + 1)&0x03;
 		for (i = k; i < L_SUBFR; i += STEP)
 		{
-			psign = sign;                  
+			psign = sign;
 			if (psign[i] < 0)
 			{
-				psign = vec;               
+				psign = vec;
 			}
 			j = j_temp;
 			for (; j < L_SUBFR; j += STEP)
 			{
-				*p0 = vo_mult(*p0, psign[j]);    
+				*p0 = vo_mult(*p0, psign[j]);
 				p0++;
 			}
 		}
@@ -542,8 +542,8 @@
 	 *                       Deep first search                           *
 	 *-------------------------------------------------------------------*/
 
-	psk = -1;                              
-	alpk = 1;                              
+	psk = -1;
+	alpk = 1;
 
 	for (k = 0; k < nbiter; k++)
 	{
@@ -553,12 +553,12 @@
 
 		if(nbbits == 20)
 		{
-			pos = 0;                       
-			ps = 0;                        
-			alp = 0;                       
+			pos = 0;
+			ps = 0;
+			alp = 0;
 			for (i = 0; i < L_SUBFR; i++)
 			{
-				vec[i] = 0;                
+				vec[i] = 0;
 			}
 		} else if ((nbbits == 36) || (nbbits == 44))
 		{
@@ -591,18 +591,18 @@
 
 			if(nbbits == 44)
 			{
-				ipos[8] = 0;               
-				ipos[9] = 1;               
+				ipos[8] = 0;
+				ipos[9] = 1;
 			}
 		} else
 		{
 			/* first stage: fix 4 pulses */
 			pos = 4;
 
-			ix = ind[0] = pos_max[ipos[0]];  
-			iy = ind[1] = pos_max[ipos[1]];  
-			i = ind[2] = pos_max[ipos[2]];   
-			j = ind[3] = pos_max[ipos[3]];   
+			ix = ind[0] = pos_max[ipos[0]];
+			iy = ind[1] = pos_max[ipos[1]];
+			i = ind[2] = pos_max[ipos[2]];
+			j = ind[3] = pos_max[ipos[3]];
 			ps = add1(add1(add1(dn[ix], dn[iy]), dn[i]), dn[j]);
 
 			if (sign[ix] < 0)
@@ -636,8 +636,8 @@
 
 			if(nbbits == 72)
 			{
-				ipos[16] = 0;              
-				ipos[17] = 1;              
+				ipos[16] = 0;
+				ipos[17] = 1;
 			}
 		}
 
@@ -668,8 +668,8 @@
 			search_ixiy(nbpos[st], ipos[j], ipos[j + 1], &ps, &alp,
 					&ix, &iy, dn, dn2, cor_x, cor_y, rrixiy);
 
-			ind[j] = ix;                   
-			ind[j + 1] = iy;               
+			ind[j] = ix;
+			ind[j + 1] = iy;
 
 			if (sign[ix] < 0)
 				p0 = h_inv - ix;
@@ -682,10 +682,10 @@
 
 			for (i = 0; i < L_SUBFR; i+=4)
 			{
-				vec[i]   += add1((*p0++), (*p1++));       
-				vec[i+1] += add1((*p0++), (*p1++));        
-				vec[i+2] += add1((*p0++), (*p1++));        
-				vec[i+3] += add1((*p0++), (*p1++));      
+				vec[i]   += add1((*p0++), (*p1++));
+				vec[i+1] += add1((*p0++), (*p1++));
+				vec[i+2] += add1((*p0++), (*p1++));
+				vec[i+3] += add1((*p0++), (*p1++));
 			}
 		}
 		/* memorise the best codevector */
@@ -693,15 +693,15 @@
 		s = vo_L_msu(vo_L_mult(alpk, ps), psk, alp);
 		if (s > 0)
 		{
-			psk = ps;                      
-			alpk = alp;                    
+			psk = ps;
+			alpk = alp;
 			for (i = 0; i < nb_pulse; i++)
 			{
-				codvec[i] = ind[i];        
+				codvec[i] = ind[i];
 			}
 			for (i = 0; i < L_SUBFR; i++)
 			{
-				y[i] = vec[i];             
+				y[i] = vec[i];
 			}
 		}
 	}
@@ -710,11 +710,11 @@
 	 *-------------------------------------------------------------------*/
 	for (i = 0; i < NPMAXPT * NB_TRACK; i++)
 	{
-		ind[i] = -1;                       
+		ind[i] = -1;
 	}
 	for (i = 0; i < L_SUBFR; i++)
 	{
-		code[i] = 0;                       
+		code[i] = 0;
 		y[i] = vo_shr_r(y[i], 3);               /* Q12 to Q9 */
 	}
 	val = (512 >> h_shift);               /* codeword in Q9 format */
@@ -727,12 +727,12 @@
 
 		if (j > 0)
 		{
-			code[i] += val;   
-			codvec[k] += 128;  
+			code[i] += val;
+			codvec[k] += 128;
 		} else
 		{
-			code[i] -= val;   
-			index += NB_POS;    
+			code[i] -= val;
+			index += NB_POS;
 		}
 
 		i = (Word16)((vo_L_mult(track, NPMAXPT) >> 1));
@@ -741,10 +741,10 @@
 		{
 			i += 1;
 		}
-		ind[i] = index;                    
+		ind[i] = index;
 	}
 
-	k = 0;                                 
+	k = 0;
 	/* Build index of codevector */
 	if(nbbits == 20)
 	{
@@ -849,20 +849,20 @@
 		p2 = &vec[pos];
 		for (j=pos;j < L_SUBFR; j++)
 		{
-			L_sum1 += *p1 * *p2;		
+			L_sum1 += *p1 * *p2;
 			p2-=3;
-			L_sum2 += *p1++ * *p2;		
+			L_sum2 += *p1++ * *p2;
 			p2+=4;
 		}
 		p2-=3;
-		L_sum2 += *p1++ * *p2++;	
-		L_sum2 += *p1++ * *p2++;	
-		L_sum2 += *p1++ * *p2++;	
+		L_sum2 += *p1++ * *p2++;
+		L_sum2 += *p1++ * *p2++;
+		L_sum2 += *p1++ * *p2++;
 
 		L_sum1 = (L_sum1 << 2);
 		L_sum2 = (L_sum2 << 2);
 
-		corr = vo_round(L_sum1);	
+		corr = vo_round(L_sum1);
 		*cor_x++ = vo_mult(corr, sign[pos]) + (*p0++);
 		corr = vo_round(L_sum2);
 		*cor_y++ = vo_mult(corr, sign[pos-3]) + (*p3++);
@@ -873,20 +873,20 @@
 		p2 = &vec[pos];
 		for (j=pos;j < L_SUBFR; j++)
 		{
-			L_sum1 += *p1 * *p2;		
+			L_sum1 += *p1 * *p2;
 			p2-=3;
-			L_sum2 += *p1++ * *p2;		
+			L_sum2 += *p1++ * *p2;
 			p2+=4;
 		}
 		p2-=3;
-		L_sum2 += *p1++ * *p2++;	
-		L_sum2 += *p1++ * *p2++;	
-		L_sum2 += *p1++ * *p2++;	
+		L_sum2 += *p1++ * *p2++;
+		L_sum2 += *p1++ * *p2++;
+		L_sum2 += *p1++ * *p2++;
 
 		L_sum1 = (L_sum1 << 2);
 		L_sum2 = (L_sum2 << 2);
 
-		corr = vo_round(L_sum1);	
+		corr = vo_round(L_sum1);
 		*cor_x++ = vo_mult(corr, sign[pos]) + (*p0++);
 		corr = vo_round(L_sum2);
 		*cor_y++ = vo_mult(corr, sign[pos-3]) + (*p3++);
@@ -982,17 +982,17 @@
 	Word16 *p0, *p1, *p2;
 	Word32 s, alp0, alp1, alp2;
 
-	p0 = cor_x;                            
-	p1 = cor_y;                            
-	p2 = rrixiy[track_x];                  
+	p0 = cor_x;
+	p1 = cor_y;
+	p2 = rrixiy[track_x];
 
 	thres_ix = nb_pos_ix - NB_MAX;
 
 	alp0 = L_deposit_h(*alp);
 	alp0 = (alp0 + 0x00008000L);       /* for rounding */
 
-	sqk = -1;                              
-	alpk = 1;                              
+	sqk = -1;
+	alpk = 1;
 
 	for (x = track_x; x < L_SUBFR; x += STEP)
 	{
@@ -1014,17 +1014,17 @@
 
 				if (s > 0)
 				{
-					sqk = sq;              
-					alpk = alp_16;         
-					pos = y;               
+					sqk = sq;
+					alpk = alp_16;
+					pos = y;
 				}
 			}
 			p1 -= NB_POS;
 
 			if (pos >= 0)
 			{
-				*ix = x;                   
-				*iy = pos;                 
+				*ix = x;
+				*iy = pos;
 			}
 		} else
 		{
@@ -1032,8 +1032,8 @@
 		}
 	}
 
-	*ps = add1(*ps, add1(dn[*ix], dn[*iy])); 
-	*alp = alpk;                           
+	*ps = add1(*ps, add1(dn[*ix], dn[*iy]));
+	*alp = alpk;
 
 	return;
 }
diff --git a/media/libstagefright/codecs/amrwbenc/src/convolve.c b/media/libstagefright/codecs/amrwbenc/src/convolve.c
index 4f7fd8a..acba532 100644
--- a/media/libstagefright/codecs/amrwbenc/src/convolve.c
+++ b/media/libstagefright/codecs/amrwbenc/src/convolve.c
@@ -49,7 +49,7 @@
 			s += vo_mult32((*tmpX++), (*tmpH--));
 			i -= 4;
 		}
-		y[n] = ((s<<1) + 0x8000)>>16;   
+		y[n] = ((s<<1) + 0x8000)>>16;
 		n++;
 
 		tmpH = h+n;
@@ -66,7 +66,7 @@
 			s += vo_mult32((*tmpX++), (*tmpH--));
 			i -= 4;
 		}
-		y[n] = ((s<<1) + 0x8000)>>16;    
+		y[n] = ((s<<1) + 0x8000)>>16;
 		n++;
 
 		tmpH = h+n;
@@ -84,7 +84,7 @@
 			s += vo_mult32((*tmpX++), (*tmpH--));
 			i -= 4;
 		}
-		y[n] = ((s<<1) + 0x8000)>>16;   
+		y[n] = ((s<<1) + 0x8000)>>16;
 		n++;
 
 		s = 0;
@@ -99,8 +99,8 @@
 			s += vo_mult32((*tmpX++), (*tmpH--));
 			i -= 4;
 		}
-		y[n] = ((s<<1) + 0x8000)>>16;   
-		n++;        
+		y[n] = ((s<<1) + 0x8000)>>16;
+		n++;
 	}
 	return;
 }
diff --git a/media/libstagefright/codecs/amrwbenc/src/cor_h_x.c b/media/libstagefright/codecs/amrwbenc/src/cor_h_x.c
index b645fa3..d9245ed 100644
--- a/media/libstagefright/codecs/amrwbenc/src/cor_h_x.c
+++ b/media/libstagefright/codecs/amrwbenc/src/cor_h_x.c
@@ -18,7 +18,7 @@
 *       File: cor_h_x.c                                                *
 *                                                                      *
 *	   Description:Compute correlation between target "x[]" and "h[]"  *
-*	               Designed for codebook search (24 pulses, 4 tracks,  * 
+*	               Designed for codebook search (24 pulses, 4 tracks,  *
 *				   4 pulses per track, 16 positions in each track) to  *
 *				   avoid saturation.                                   *
 *                                                                      *
@@ -44,8 +44,8 @@
 	Word32 *p3;
 	Word32 L_max, L_max1, L_max2, L_max3;
 	/* first keep the result on 32 bits and find absolute maximum */
-	L_tot  = 1;                            
-	L_max  = 0; 
+	L_tot  = 1;
+	L_max  = 0;
 	L_max1 = 0;
 	L_max2 = 0;
 	L_max3 = 0;
@@ -57,11 +57,11 @@
 		for (j = i; j < L_SUBFR; j++)
 			L_tmp += vo_L_mult(*p1++, *p2++);
 
-		y32[i] = L_tmp;               
+		y32[i] = L_tmp;
 		L_tmp = (L_tmp > 0)? L_tmp:-L_tmp;
 		if(L_tmp > L_max)
 		{
-			L_max = L_tmp;             
+			L_max = L_tmp;
 		}
 
 		L_tmp = 1L;
@@ -70,11 +70,11 @@
 		for (j = i+1; j < L_SUBFR; j++)
 			L_tmp += vo_L_mult(*p1++, *p2++);
 
-		y32[i+1] = L_tmp;               
+		y32[i+1] = L_tmp;
 		L_tmp = (L_tmp > 0)? L_tmp:-L_tmp;
 		if(L_tmp > L_max1)
 		{
-			L_max1 = L_tmp;             
+			L_max1 = L_tmp;
 		}
 
 		L_tmp = 1;
@@ -83,11 +83,11 @@
 		for (j = i+2; j < L_SUBFR; j++)
 			L_tmp += vo_L_mult(*p1++, *p2++);
 
-		y32[i+2] = L_tmp;               
+		y32[i+2] = L_tmp;
 		L_tmp = (L_tmp > 0)? L_tmp:-L_tmp;
 		if(L_tmp > L_max2)
 		{
-			L_max2 = L_tmp;             
+			L_max2 = L_tmp;
 		}
 
 		L_tmp = 1;
@@ -96,11 +96,11 @@
 		for (j = i+3; j < L_SUBFR; j++)
 			L_tmp += vo_L_mult(*p1++, *p2++);
 
-		y32[i+3] = L_tmp;               
+		y32[i+3] = L_tmp;
 		L_tmp = (L_tmp > 0)? L_tmp:-L_tmp;
 		if(L_tmp > L_max3)
 		{
-			L_max3 = L_tmp;             
+			L_max3 = L_tmp;
 		}
 	}
 	/* tot += 3*max / 8 */
diff --git a/media/libstagefright/codecs/amrwbenc/src/decim54.c b/media/libstagefright/codecs/amrwbenc/src/decim54.c
index 7bc5576..3b88514 100644
--- a/media/libstagefright/codecs/amrwbenc/src/decim54.c
+++ b/media/libstagefright/codecs/amrwbenc/src/decim54.c
@@ -136,8 +136,8 @@
 		L_sum += vo_mult32((*x++),(*y++));
 		L_sum += vo_mult32((*x),(*y));
 
-		L_sum = L_shl2(L_sum, 2);              
-		sig_d[j] = extract_h(L_add(L_sum, 0x8000)); 
+		L_sum = L_shl2(L_sum, 2);
+		sig_d[j] = extract_h(L_add(L_sum, 0x8000));
 		pos += FAC5;              /* pos + 5/4 */
 	}
 	return;
diff --git a/media/libstagefright/codecs/amrwbenc/src/deemph.c b/media/libstagefright/codecs/amrwbenc/src/deemph.c
index 4ee1449..0c49d6b 100644
--- a/media/libstagefright/codecs/amrwbenc/src/deemph.c
+++ b/media/libstagefright/codecs/amrwbenc/src/deemph.c
@@ -39,16 +39,16 @@
 
 	L_tmp = L_deposit_h(x[0]);
 	L_tmp = L_mac(L_tmp, *mem, mu);
-	x[0] = vo_round(L_tmp);                   
+	x[0] = vo_round(L_tmp);
 
 	for (i = 1; i < L; i++)
 	{
 		L_tmp = L_deposit_h(x[i]);
 		L_tmp = L_mac(L_tmp, x[i - 1], mu);
-		x[i] = voround(L_tmp);               
+		x[i] = voround(L_tmp);
 	}
 
-	*mem = x[L - 1];                       
+	*mem = x[L - 1];
 
 	return;
 }
@@ -65,14 +65,14 @@
 	Word32 L_tmp;
 	L_tmp = x[0] << 15;
 	L_tmp += ((*mem) * mu)<<1;
-	x[0] = (L_tmp + 0x8000)>>16;                   
+	x[0] = (L_tmp + 0x8000)>>16;
 	for (i = 1; i < L; i++)
 	{
 		L_tmp = x[i] << 15;
 		L_tmp += (x[i - 1] * mu)<<1;
-		x[i] = (L_tmp + 0x8000)>>16;               
+		x[i] = (L_tmp + 0x8000)>>16;
 	}
-	*mem = x[L - 1];                       
+	*mem = x[L - 1];
 	return;
 }
 
@@ -95,8 +95,8 @@
 	L_tmp += (x_lo[0] * 8)<<1;
 	L_tmp = (L_tmp << 3);
 	L_tmp += ((*mem) * fac)<<1;
-	L_tmp = (L_tmp << 1);               
-	y[0] = (L_tmp + 0x8000)>>16;                  
+	L_tmp = (L_tmp << 1);
+	y[0] = (L_tmp + 0x8000)>>16;
 
 	for (i = 1; i < L; i++)
 	{
@@ -104,11 +104,11 @@
 		L_tmp += (x_lo[i] * 8)<<1;
 		L_tmp = (L_tmp << 3);
 		L_tmp += (y[i - 1] * fac)<<1;
-		L_tmp = (L_tmp << 1);           
-		y[i] = (L_tmp + 0x8000)>>16;               
+		L_tmp = (L_tmp << 1);
+		y[i] = (L_tmp + 0x8000)>>16;
 	}
 
-	*mem = y[L - 1];                       
+	*mem = y[L - 1];
 
 	return;
 }
diff --git a/media/libstagefright/codecs/amrwbenc/src/dtx.c b/media/libstagefright/codecs/amrwbenc/src/dtx.c
index df53131..2cfaced 100644
--- a/media/libstagefright/codecs/amrwbenc/src/dtx.c
+++ b/media/libstagefright/codecs/amrwbenc/src/dtx.c
@@ -105,30 +105,30 @@
 		fprintf(stderr, "dtx_enc_reset: invalid parameter\n");
 		return -1;
 	}
-	st->hist_ptr = 0;                      
-	st->log_en_index = 0;                  
+	st->hist_ptr = 0;
+	st->log_en_index = 0;
 
 	/* Init isf_hist[] */
 	for (i = 0; i < DTX_HIST_SIZE; i++)
 	{
 		Copy(isf_init, &st->isf_hist[i * M], M);
 	}
-	st->cng_seed = RANDOM_INITSEED;       
+	st->cng_seed = RANDOM_INITSEED;
 
 	/* Reset energy history */
 	Set_zero(st->log_en_hist, DTX_HIST_SIZE);
 
-	st->dtxHangoverCount = DTX_HANG_CONST; 
-	st->decAnaElapsedCount = 32767;        
+	st->dtxHangoverCount = DTX_HANG_CONST;
+	st->decAnaElapsedCount = 32767;
 
 	for (i = 0; i < 28; i++)
 	{
-		st->D[i] = 0;                      
+		st->D[i] = 0;
 	}
 
 	for (i = 0; i < DTX_HIST_SIZE - 1; i++)
 	{
-		st->sumD[i] = 0;                   
+		st->sumD[i] = 0;
 	}
 
 	return 1;
@@ -279,7 +279,7 @@
 	for (i = 0; i < L_FRAME; i++)
 	{
 		tmp = mult(exc2[i], gain);         /* Q0 * Q15 */
-		exc2[i] = shl(tmp, exp); 
+		exc2[i] = shl(tmp, exp);
 	}
 
 	return 0;
@@ -301,7 +301,7 @@
 
 	Word16 log_en_e;
 	Word16 log_en_m;
-	st->hist_ptr = add(st->hist_ptr, 1); 
+	st->hist_ptr = add(st->hist_ptr, 1);
 	if(st->hist_ptr == DTX_HIST_SIZE)
 	{
 		st->hist_ptr = 0;
@@ -345,7 +345,7 @@
 {
 
 	/* this state machine is in synch with the GSMEFR txDtx machine      */
-	st->decAnaElapsedCount = add(st->decAnaElapsedCount, 1); 
+	st->decAnaElapsedCount = add(st->decAnaElapsedCount, 1);
 
 	if (vad_flag != 0)
 	{
@@ -354,8 +354,8 @@
 	{                                      /* non-speech */
 		if (st->dtxHangoverCount == 0)
 		{                                  /* out of decoder analysis hangover  */
-			st->decAnaElapsedCount = 0;    
-			*usedMode = MRDTX;            
+			st->decAnaElapsedCount = 0;
+			*usedMode = MRDTX;
 		} else
 		{                                  /* in possible analysis hangover */
 			st->dtxHangoverCount = sub(st->dtxHangoverCount, 1);
@@ -394,8 +394,8 @@
 		{
 			for (i = 0; i < M; i++)
 			{
-				isf_tmp[k * M + i] = isf_old[indices[k] * M + i];      
-				isf_old[indices[k] * M + i] = isf_old[indices[2] * M + i];    
+				isf_tmp[k * M + i] = isf_old[indices[k] * M + i];
+				isf_old[indices[k] * M + i] = isf_old[indices[2] * M + i];
 			}
 		}
 	}
@@ -403,13 +403,13 @@
 	/* Perform the ISF averaging */
 	for (j = 0; j < M; j++)
 	{
-		L_tmp = 0;                      
+		L_tmp = 0;
 
 		for (i = 0; i < DTX_HIST_SIZE; i++)
 		{
 			L_tmp = L_add(L_tmp, L_deposit_l(isf_old[i * M + j]));
 		}
-		isf_aver[j] = L_tmp;              
+		isf_aver[j] = L_tmp;
 	}
 
 	/* Retrieve from isf_tmp[][] the ISF vectors saved prior to averaging */
@@ -441,12 +441,12 @@
 	/* sum sumD[0..DTX_HIST_SIZE-1]. sumD[DTX_HIST_SIZE] is    */
 	/* not updated since it will be removed later.           */
 
-	tmp = DTX_HIST_SIZE_MIN_ONE;           
-	j = -1;                                
+	tmp = DTX_HIST_SIZE_MIN_ONE;
+	j = -1;
 	for (i = 0; i < DTX_HIST_SIZE_MIN_ONE; i++)
 	{
 		j = add(j, tmp);
-		st->sumD[i] = L_sub(st->sumD[i], st->D[j]);     
+		st->sumD[i] = L_sub(st->sumD[i], st->D[j]);
 		tmp = sub(tmp, 1);
 	}
 
@@ -458,86 +458,86 @@
 
 	for (i = DTX_HIST_SIZE_MIN_ONE; i > 0; i--)
 	{
-		st->sumD[i] = st->sumD[i - 1];     
+		st->sumD[i] = st->sumD[i - 1];
 	}
-	st->sumD[0] = 0;                       
+	st->sumD[0] = 0;
 
 	/* Remove the oldest frame from the distance matrix.           */
 	/* Note that the distance matrix is replaced by a one-         */
 	/* dimensional array to save static memory.                    */
 
-	tmp = 0;                               
+	tmp = 0;
 	for (i = 27; i >= 12; i = (Word16) (i - tmp))
 	{
 		tmp = add(tmp, 1);
 		for (j = tmp; j > 0; j--)
 		{
-			st->D[i - j + 1] = st->D[i - j - tmp];   
+			st->D[i - j + 1] = st->D[i - j - tmp];
 		}
 	}
 
 	/* Compute the first column of the distance matrix D            */
 	/* (squared Euclidean distances from isf1[] to isf_old_tx[][]). */
 
-	ptr = st->hist_ptr;                 
+	ptr = st->hist_ptr;
 	for (i = 1; i < DTX_HIST_SIZE; i++)
 	{
 		/* Compute the distance between the latest isf and the other isfs. */
 		ptr = sub(ptr, 1);
 		if (ptr < 0)
 		{
-			ptr = DTX_HIST_SIZE_MIN_ONE;   
+			ptr = DTX_HIST_SIZE_MIN_ONE;
 		}
-		L_tmp = 0;                         
+		L_tmp = 0;
 		for (j = 0; j < M; j++)
 		{
 			tmp = sub(isf_old_tx[st->hist_ptr * M + j], isf_old_tx[ptr * M + j]);
 			L_tmp = L_mac(L_tmp, tmp, tmp);
 		}
-		st->D[i - 1] = L_tmp;           
+		st->D[i - 1] = L_tmp;
 
 		/* Update also the column sums. */
-		st->sumD[0] = L_add(st->sumD[0], st->D[i - 1]); 
-		st->sumD[i] = L_add(st->sumD[i], st->D[i - 1]); 
+		st->sumD[0] = L_add(st->sumD[0], st->D[i - 1]);
+		st->sumD[i] = L_add(st->sumD[i], st->D[i - 1]);
 	}
 
 	/* Find the minimum and maximum distances */
-	summax = st->sumD[0];                  
-	summin = st->sumD[0];                  
-	indices[0] = 0;                        
-	indices[2] = 0;                        
+	summax = st->sumD[0];
+	summin = st->sumD[0];
+	indices[0] = 0;
+	indices[2] = 0;
 	for (i = 1; i < DTX_HIST_SIZE; i++)
 	{
 		if (L_sub(st->sumD[i], summax) > 0)
 		{
-			indices[0] = i;                
-			summax = st->sumD[i];          
+			indices[0] = i;
+			summax = st->sumD[i];
 		}
 		if (L_sub(st->sumD[i], summin) < 0)
 		{
-			indices[2] = i;                
-			summin = st->sumD[i];          
+			indices[2] = i;
+			summin = st->sumD[i];
 		}
 	}
 
 	/* Find the second largest distance */
-	summax2nd = -2147483647L;              
-	indices[1] = -1;                       
+	summax2nd = -2147483647L;
+	indices[1] = -1;
 	for (i = 0; i < DTX_HIST_SIZE; i++)
 	{
 		if ((L_sub(st->sumD[i], summax2nd) > 0) && (sub(i, indices[0]) != 0))
 		{
-			indices[1] = i;                
-			summax2nd = st->sumD[i];       
+			indices[1] = i;
+			summax2nd = st->sumD[i];
 		}
 	}
 
 	for (i = 0; i < 3; i++)
 	{
-		indices[i] = sub(st->hist_ptr, indices[i]);     
+		indices[i] = sub(st->hist_ptr, indices[i]);
 		if (indices[i] < 0)
 		{
-			indices[i] = add(indices[i], DTX_HIST_SIZE);       
+			indices[i] = add(indices[i], DTX_HIST_SIZE);
 		}
 	}
 
@@ -549,7 +549,7 @@
 	L_tmp = L_mult(voround(summax), INV_MED_THRESH);
 	if(L_tmp <= summin)
 	{
-		indices[0] = -1; 
+		indices[0] = -1;
 	}
 	/* If second largest distance/MED_THRESH is smaller than     */
 	/* minimum distance then the median ISF vector replacement is    */
@@ -558,7 +558,7 @@
 	L_tmp = L_mult(voround(summax2nd), INV_MED_THRESH);
 	if(L_tmp <= summin)
 	{
-		indices[1] = -1;                 
+		indices[1] = -1;
 	}
 	return;
 }
diff --git a/media/libstagefright/codecs/amrwbenc/src/g_pitch.c b/media/libstagefright/codecs/amrwbenc/src/g_pitch.c
index f5112c5..d681f2e 100644
--- a/media/libstagefright/codecs/amrwbenc/src/g_pitch.c
+++ b/media/libstagefright/codecs/amrwbenc/src/g_pitch.c
@@ -48,10 +48,10 @@
 
 #endif
 
-	g_coeff[0] = yy;                       
-	g_coeff[1] = exp_yy;                   
-	g_coeff[2] = xy;                       
-	g_coeff[3] = exp_xy;                   
+	g_coeff[0] = yy;
+	g_coeff[1] = exp_yy;
+	g_coeff[2] = xy;
+	g_coeff[3] = exp_xy;
 
 	/* If (xy < 0) gain = 0 */
 	if (xy < 0)
@@ -65,12 +65,12 @@
 	i = exp_xy;
 	i -= exp_yy;
 
-	gain = shl(gain, i);                   
+	gain = shl(gain, i);
 
 	/* if (gain > 1.2) gain = 1.2  in Q14 */
 	if(gain > 19661)
 	{
-		gain = 19661;                      
+		gain = 19661;
 	}
 	return (gain);
 }
diff --git a/media/libstagefright/codecs/amrwbenc/src/gpclip.c b/media/libstagefright/codecs/amrwbenc/src/gpclip.c
index 24158e3..800b3f9 100644
--- a/media/libstagefright/codecs/amrwbenc/src/gpclip.c
+++ b/media/libstagefright/codecs/amrwbenc/src/gpclip.c
@@ -22,7 +22,7 @@
 *      case occurs                                                        *
 *      a resonance on LPC filter(lp_disp < 60Hz)                          *
 *      a good pitch prediction (lp_gp > 0.95)                             *
-*                                                                         *   
+*                                                                         *
 ***************************************************************************/
 #include "typedef.h"
 #include "basic_op.h"
@@ -38,8 +38,8 @@
 		Word16 mem[]                          /* (o) : memory of gain of pitch clipping algorithm */
 		)
 {
-	mem[0] = DIST_ISF_MAX;                 
-	mem[1] = GAIN_PIT_MIN;                 
+	mem[0] = DIST_ISF_MAX;
+	mem[1] = GAIN_PIT_MIN;
 }
 
 
@@ -49,7 +49,7 @@
 {
 	Word16 clip = 0;
 	if ((mem[0] < DIST_ISF_THRES) && (mem[1] > GAIN_PIT_THRES))
-		clip = 1;                          
+		clip = 1;
 
 	return (clip);
 }
@@ -70,7 +70,7 @@
 		dist = vo_sub(isf[i], isf[i - 1]);
 		if(dist < dist_min)
 		{
-			dist_min = dist;               
+			dist_min = dist;
 		}
 	}
 
@@ -78,9 +78,9 @@
 
 	if (dist > DIST_ISF_MAX)
 	{
-		dist = DIST_ISF_MAX;               
+		dist = DIST_ISF_MAX;
 	}
-	mem[0] = dist;                        
+	mem[0] = dist;
 
 	return;
 }
@@ -100,9 +100,9 @@
 
 	if(gain < GAIN_PIT_MIN)
 	{
-		gain = GAIN_PIT_MIN;              
+		gain = GAIN_PIT_MIN;
 	}
-	mem[1] = gain;                         
+	mem[1] = gain;
 	return;
 }
 
diff --git a/media/libstagefright/codecs/amrwbenc/src/hp400.c b/media/libstagefright/codecs/amrwbenc/src/hp400.c
index fa66f1a..a6f9701 100644
--- a/media/libstagefright/codecs/amrwbenc/src/hp400.c
+++ b/media/libstagefright/codecs/amrwbenc/src/hp400.c
@@ -68,8 +68,8 @@
 	y2_lo = *mem++;
 	y1_hi = *mem++;
 	y1_lo = *mem++;
-	x0 = *mem++;   
-	x1 = *mem;   
+	x0 = *mem++;
+	x1 = *mem;
 	num = (Word32)lg;
 	do
 	{
@@ -98,7 +98,7 @@
 	*mem-- = y1_lo;
 	*mem-- = y1_hi;
 	*mem-- = y2_lo;
-	*mem   = y2_hi;  
+	*mem   = y2_hi;
 	return;
 }
 
diff --git a/media/libstagefright/codecs/amrwbenc/src/hp50.c b/media/libstagefright/codecs/amrwbenc/src/hp50.c
index 36dd1f1..c1c7b83 100644
--- a/media/libstagefright/codecs/amrwbenc/src/hp50.c
+++ b/media/libstagefright/codecs/amrwbenc/src/hp50.c
@@ -70,7 +70,7 @@
 	y2_lo = *mem++;
 	y1_hi = *mem++;
 	y1_lo = *mem++;
-	x0 = *mem++;   
+	x0 = *mem++;
 	x1 = *mem;
 	num = (Word32)lg;
 	do
@@ -98,7 +98,7 @@
 	*mem-- = y1_lo;
 	*mem-- = y1_hi;
 	*mem-- = y2_lo;
-	*mem-- = y2_hi;  
+	*mem-- = y2_hi;
 
 	return;
 }
diff --git a/media/libstagefright/codecs/amrwbenc/src/hp6k.c b/media/libstagefright/codecs/amrwbenc/src/hp6k.c
index 578633a..8e66eb0 100644
--- a/media/libstagefright/codecs/amrwbenc/src/hp6k.c
+++ b/media/libstagefright/codecs/amrwbenc/src/hp6k.c
@@ -20,7 +20,7 @@
 *	Description:15th order band pass 6kHz to 7kHz FIR filter        *
 *       frequency: 4kHz   5kHz  5.5kHz  6kHz  6.5kHz  7kHz 7.5kHz 8kHz  *
 *	dB loss:  -60dB  -45dB  -13dB   -3dB   0dB    -3dB -13dB  -45dB *
-*	                                                                *                                                                 
+*	                                                                *
 ************************************************************************/
 
 #include "typedef.h"
@@ -63,7 +63,7 @@
 	for (i = lg - 1; i >= 0; i--)
 	{
 		x[i + L_FIR - 1] = signal[i] >> 2;                         /* gain of filter = 4 */
-	}	
+	}
 	for (i = 0; i < lg; i++)
 	{
 		L_tmp =  (x[i] + x[i+ 30]) * fir_6k_7k[0];
diff --git a/media/libstagefright/codecs/amrwbenc/src/hp_wsp.c b/media/libstagefright/codecs/amrwbenc/src/hp_wsp.c
index 3510272..bc1ec49 100644
--- a/media/libstagefright/codecs/amrwbenc/src/hp_wsp.c
+++ b/media/libstagefright/codecs/amrwbenc/src/hp_wsp.c
@@ -88,22 +88,22 @@
 	Word16 y3_hi, y3_lo, y2_hi, y2_lo, y1_hi, y1_lo;
 	Word32 i, L_tmp;
 
-	y3_hi = mem[0];                        
-	y3_lo = mem[1];                        
-	y2_hi = mem[2];                        
-	y2_lo = mem[3];                        
-	y1_hi = mem[4];                        
-	y1_lo = mem[5];                        
-	x0 = mem[6];                           
-	x1 = mem[7];                           
-	x2 = mem[8];                           
+	y3_hi = mem[0];
+	y3_lo = mem[1];
+	y2_hi = mem[2];
+	y2_lo = mem[3];
+	y1_hi = mem[4];
+	y1_lo = mem[5];
+	x0 = mem[6];
+	x1 = mem[7];
+	x2 = mem[8];
 
 	for (i = 0; i < lg; i++)
 	{
-		x3 = x2;                           
-		x2 = x1;                           
-		x1 = x0;                           
-		x0 = wsp[i];                       
+		x3 = x2;
+		x2 = x1;
+		x1 = x0;
+		x0 = wsp[i];
 		/* y[i] = b[0]*x[i] + b[1]*x[i-1] + b140[2]*x[i-2] + b[3]*x[i-3]  */
 		/* + a[1]*y[i-1] + a[2] * y[i-2]  + a[3]*y[i-3]  */
 
@@ -122,25 +122,25 @@
 
 		L_tmp = L_tmp << 2;
 
-		y3_hi = y2_hi;                     
-		y3_lo = y2_lo;                     
-		y2_hi = y1_hi;                     
-		y2_lo = y1_lo; 
+		y3_hi = y2_hi;
+		y3_lo = y2_lo;
+		y2_hi = y1_hi;
+		y2_lo = y1_lo;
 		y1_hi = L_tmp >> 16;
 		y1_lo = (L_tmp & 0xffff) >>1;
 
-		hp_wsp[i] = (L_tmp + 0x4000)>>15;          
+		hp_wsp[i] = (L_tmp + 0x4000)>>15;
 	}
 
-	mem[0] = y3_hi;                        
-	mem[1] = y3_lo;                        
-	mem[2] = y2_hi;                        
-	mem[3] = y2_lo;                        
-	mem[4] = y1_hi;                        
-	mem[5] = y1_lo;                        
-	mem[6] = x0;                           
-	mem[7] = x1;                           
-	mem[8] = x2;                           
+	mem[0] = y3_hi;
+	mem[1] = y3_lo;
+	mem[2] = y2_hi;
+	mem[3] = y2_lo;
+	mem[4] = y1_hi;
+	mem[5] = y1_lo;
+	mem[6] = x0;
+	mem[7] = x1;
+	mem[8] = x2;
 
 	return;
 }
diff --git a/media/libstagefright/codecs/amrwbenc/src/int_lpc.c b/media/libstagefright/codecs/amrwbenc/src/int_lpc.c
index 88285e8..1119bc7 100644
--- a/media/libstagefright/codecs/amrwbenc/src/int_lpc.c
+++ b/media/libstagefright/codecs/amrwbenc/src/int_lpc.c
@@ -36,21 +36,21 @@
 		Word16 Az[]                           /* output: LP coefficients in 4 subframes    */
 	    )
 {
-	Word32 i, k; 
+	Word32 i, k;
 	Word16 fac_old, fac_new;
 	Word16 isp[M];
 	Word32 L_tmp;
 
 	for (k = 0; k < 3; k++)
 	{
-		fac_new = frac[k];                
+		fac_new = frac[k];
 		fac_old = (32767 - fac_new) + 1;  /* 1.0 - fac_new */
 
 		for (i = 0; i < M; i++)
 		{
 			L_tmp = (isp_old[i] * fac_old)<<1;
 			L_tmp += (isp_new[i] * fac_new)<<1;
-			isp[i] = (L_tmp + 0x8000)>>16;        
+			isp[i] = (L_tmp + 0x8000)>>16;
 		}
 		Isp_Az(isp, Az, M, 0);
 		Az += MP1;
diff --git a/media/libstagefright/codecs/amrwbenc/src/isp_az.c b/media/libstagefright/codecs/amrwbenc/src/isp_az.c
index c235c5d..30a8bbd 100644
--- a/media/libstagefright/codecs/amrwbenc/src/isp_az.c
+++ b/media/libstagefright/codecs/amrwbenc/src/isp_az.c
@@ -42,7 +42,7 @@
 		                                      /*     1   : adaptive scaling enabled  */
 	   )
 {
-	Word32 i, j; 
+	Word32 i, j;
 	Word16 hi, lo;
 	Word32 f1[NC16k + 1], f2[NC16k];
 	Word16 nc;
@@ -92,14 +92,14 @@
 		lo = (f1[i] & 0xffff)>>1;
 
 		t0 = Mpy_32_16(hi, lo, isp[m - 1]);
-		f1[i] = vo_L_add(f1[i], t0); 
+		f1[i] = vo_L_add(f1[i], t0);
 
 		/* f2[i] *= (1.0 - isp[M-1]); */
 
 		hi = f2[i] >> 16;
 		lo = (f2[i] & 0xffff)>>1;
 		t0 = Mpy_32_16(hi, lo, isp[m - 1]);
-		f2[i] = vo_L_sub(f2[i], t0); 
+		f2[i] = vo_L_sub(f2[i], t0);
 	}
 
 	/*-----------------------------------------------------*
@@ -108,20 +108,20 @@
 	 *-----------------------------------------------------*/
 
 	/* a[0] = 1.0; */
-	a[0] = 4096;  
-	tmax = 1;                            
+	a[0] = 4096;
+	tmax = 1;
 	for (i = 1, j = m - 1; i < nc; i++, j--)
 	{
 		/* a[i] = 0.5*(f1[i] + f2[i]); */
 
 		t0 = vo_L_add(f1[i], f2[i]);          /* f1[i] + f2[i]             */
-		tmax |= L_abs(t0);                 
+		tmax |= L_abs(t0);
 		a[i] = (Word16)(vo_L_shr_r(t0, 12)); /* from Q23 to Q12 and * 0.5 */
 
 		/* a[j] = 0.5*(f1[i] - f2[i]); */
 
 		t0 = vo_L_sub(f1[i], f2[i]);          /* f1[i] - f2[i]             */
-		tmax |= L_abs(t0);                
+		tmax |= L_abs(t0);
 		a[j] = (Word16)(vo_L_shr_r(t0, 12)); /* from Q23 to Q12 and * 0.5 */
 	}
 
@@ -144,12 +144,12 @@
 			t0 = vo_L_sub(f1[i], f2[i]);          /* f1[i] - f2[i]             */
 			a[j] = (Word16)(vo_L_shr_r(t0, q_sug)); /* from Q23 to Q12 and * 0.5 */
 		}
-		a[0] = shr(a[0], q); 
+		a[0] = shr(a[0], q);
 	}
 	else
 	{
-		q_sug = 12; 
-		q     = 0; 
+		q_sug = 12;
+		q     = 0;
 	}
 	/* a[NC] = 0.5*f1[NC]*(1.0 + isp[M-1]); */
 	hi = f1[nc] >> 16;
@@ -196,7 +196,7 @@
 	isp += 2;                                /* Advance isp pointer        */
 	for (i = 2; i <= n; i++)
 	{
-		*f = f[-2];                        
+		*f = f[-2];
 		for (j = 1; j < i; j++, f--)
 		{
 			hi = f[-1]>>16;
@@ -228,7 +228,7 @@
 
 	for (i = 2; i <= n; i++)
 	{
-		*f = f[-2];                        
+		*f = f[-2];
 		for (j = 1; j < i; j++, f--)
 		{
 			VO_L_Extract(f[-1], &hi, &lo);
diff --git a/media/libstagefright/codecs/amrwbenc/src/isp_isf.c b/media/libstagefright/codecs/amrwbenc/src/isp_isf.c
index fbe80eb..b4ba408 100644
--- a/media/libstagefright/codecs/amrwbenc/src/isp_isf.c
+++ b/media/libstagefright/codecs/amrwbenc/src/isp_isf.c
@@ -51,9 +51,9 @@
 		/* acos(isp[i])= ind*128 + ( ( isp[i]-table[ind] ) * slope[ind] )/2048 */
 		L_tmp = vo_L_mult(vo_sub(isp[i], table[ind]), slope[ind]);
 		isf[i] = vo_round((L_tmp << 4));   /* (isp[i]-table[ind])*slope[ind])>>11 */
-		isf[i] = add1(isf[i], (ind << 7)); 
+		isf[i] = add1(isf[i], (ind << 7));
 	}
-	isf[m - 1] = (isf[m - 1] >> 1);      
+	isf[m - 1] = (isf[m - 1] >> 1);
 	return;
 }
 
@@ -69,7 +69,7 @@
 
 	for (i = 0; i < m - 1; i++)
 	{
-		isp[i] = isf[i];                  
+		isp[i] = isf[i];
 	}
 	isp[m - 1] = (isf[m - 1] << 1);
 
@@ -80,7 +80,7 @@
 
 		/* isp[i] = table[ind]+ ((table[ind+1]-table[ind])*offset) / 128 */
 		L_tmp = vo_L_mult(vo_sub(table[ind + 1], table[ind]), offset);
-		isp[i] = add1(table[ind], (Word16)((L_tmp >> 8)));   
+		isp[i] = add1(table[ind], (Word16)((L_tmp >> 8)));
 	}
 
 	return;
diff --git a/media/libstagefright/codecs/amrwbenc/src/levinson.c b/media/libstagefright/codecs/amrwbenc/src/levinson.c
index a68845f..4b2f8ed 100644
--- a/media/libstagefright/codecs/amrwbenc/src/levinson.c
+++ b/media/libstagefright/codecs/amrwbenc/src/levinson.c
@@ -122,8 +122,8 @@
 	Word16 *old_A, *old_rc;
 
 	/* Last A(z) for case of unstable filter */
-	old_A = mem;                           
-	old_rc = mem + M;                      
+	old_A = mem;
+	old_rc = mem + M;
 
 	/* K = A[1] = -R[1] / R[0] */
 
@@ -135,7 +135,7 @@
 
 	Kh = t0 >> 16;
 	Kl = (t0 & 0xffff)>>1;
-	rc[0] = Kh;                            
+	rc[0] = Kh;
 	t0 = (t0 >> 4);                        /* A[1] in Q27      */
 
 	Ah[1] = t0 >> 16;
@@ -163,7 +163,7 @@
 	for (i = 2; i <= M; i++)
 	{
 		/* t0 = SUM ( R[j]*A[i-j] ,j=1,i-1 ) +  R[i] */
-		t0 = 0;                           
+		t0 = 0;
 		for (j = 1; j < i; j++)
 			t0 = vo_L_add(t0, Mpy_32(Rh[j], Rl[j], Ah[i - j], Al[i - j]));
 
@@ -182,14 +182,14 @@
 		Kh = t2 >> 16;
 		Kl = (t2 & 0xffff)>>1;
 
-		rc[i - 1] = Kh;                   
+		rc[i - 1] = Kh;
 		/* Test for unstable filter. If unstable keep old A(z) */
 		if (abs_s(Kh) > 32750)
 		{
 			A[0] = 4096;                    /* Ai[0] not stored (always 1.0) */
 			for (j = 0; j < M; j++)
 			{
-				A[j + 1] = old_A[j];       
+				A[j + 1] = old_A[j];
 			}
 			rc[0] = old_rc[0];             /* only two rc coefficients are needed */
 			rc[1] = old_rc[1];
@@ -229,19 +229,19 @@
 		/* A[j] = An[j] */
 		for (j = 1; j <= i; j++)
 		{
-			Ah[j] = Anh[j];               
-			Al[j] = Anl[j];                
+			Ah[j] = Anh[j];
+			Al[j] = Anl[j];
 		}
 	}
 	/* Truncate A[i] in Q27 to Q12 with rounding */
-	A[0] = 4096;                          
+	A[0] = 4096;
 	for (i = 1; i <= M; i++)
 	{
 		t0 = (Ah[i] << 16) + (Al[i] << 1);
-		old_A[i - 1] = A[i] = vo_round((t0 << 1));      
+		old_A[i - 1] = A[i] = vo_round((t0 << 1));
 	}
-	old_rc[0] = rc[0];                    
-	old_rc[1] = rc[1];                    
+	old_rc[0] = rc[0];
+	old_rc[1] = rc[1];
 
 	return;
 }
diff --git a/media/libstagefright/codecs/amrwbenc/src/log2.c b/media/libstagefright/codecs/amrwbenc/src/log2.c
index 646d6af..0f65541 100644
--- a/media/libstagefright/codecs/amrwbenc/src/log2.c
+++ b/media/libstagefright/codecs/amrwbenc/src/log2.c
@@ -64,11 +64,11 @@
 	Word32 L_y;
 	if (L_x <= (Word32) 0)
 	{
-		*exponent = 0; 
-		*fraction = 0; 
+		*exponent = 0;
+		*fraction = 0;
 		return;
 	}
-	*exponent = (30 - exp); 
+	*exponent = (30 - exp);
 	L_x = (L_x >> 9);
 	i = extract_h (L_x);                /* Extract b25-b31 */
 	L_x = (L_x >> 1);
@@ -78,7 +78,7 @@
 	L_y = L_deposit_h (table[i]);       /* table[i] << 16        */
 	tmp = vo_sub(table[i], table[i + 1]); /* table[i] - table[i+1] */
 	L_y = vo_L_msu (L_y, tmp, a);          /* L_y -= tmp*a*2        */
-	*fraction = extract_h (L_y); 
+	*fraction = extract_h (L_y);
 
 	return;
 }
diff --git a/media/libstagefright/codecs/amrwbenc/src/lp_dec2.c b/media/libstagefright/codecs/amrwbenc/src/lp_dec2.c
index 29bd46b..1d5d076 100644
--- a/media/libstagefright/codecs/amrwbenc/src/lp_dec2.c
+++ b/media/libstagefright/codecs/amrwbenc/src/lp_dec2.c
@@ -42,25 +42,25 @@
 	Word32 i, j;
 	Word32 L_tmp;
 	/* copy initial filter states into buffer */
-	p_x = x_buf;                           
+	p_x = x_buf;
 	for (i = 0; i < L_MEM; i++)
 	{
-		*p_x++ = mem[i];  
-		mem[i] = x[l - L_MEM + i];  
+		*p_x++ = mem[i];
+		mem[i] = x[l - L_MEM + i];
 	}
 	for (i = 0; i < l; i++)
 	{
-		*p_x++ = x[i];                     
+		*p_x++ = x[i];
 	}
 	for (i = 0, j = 0; i < l; i += 2, j++)
 	{
-		p_x = &x_buf[i];  
+		p_x = &x_buf[i];
 		L_tmp  = ((*p_x++) * h_fir[0]);
 		L_tmp += ((*p_x++) * h_fir[1]);
 		L_tmp += ((*p_x++) * h_fir[2]);
 		L_tmp += ((*p_x++) * h_fir[3]);
 		L_tmp += ((*p_x++) * h_fir[4]);
-		x[j] = (L_tmp + 0x4000)>>15;              
+		x[j] = (L_tmp + 0x4000)>>15;
 	}
 	return;
 }
diff --git a/media/libstagefright/codecs/amrwbenc/src/math_op.c b/media/libstagefright/codecs/amrwbenc/src/math_op.c
index 1a7b513..7affbb2 100644
--- a/media/libstagefright/codecs/amrwbenc/src/math_op.c
+++ b/media/libstagefright/codecs/amrwbenc/src/math_op.c
@@ -106,21 +106,21 @@
 
 	if (*frac <= (Word32) 0)
 	{
-		*exp = 0;                          
-		*frac = 0x7fffffffL;               
+		*exp = 0;
+		*frac = 0x7fffffffL;
 		return;
 	}
 
 	if((*exp & 1) == 1)                       /*If exponant odd -> shift right */
 		*frac = (*frac) >> 1;
 
-	*exp = negate((*exp - 1) >> 1);   
+	*exp = negate((*exp - 1) >> 1);
 
-	*frac = (*frac >> 9);               
+	*frac = (*frac >> 9);
 	i = extract_h(*frac);                  /* Extract b25-b31 */
-	*frac = (*frac >> 1);              
+	*frac = (*frac >> 1);
 	a = (Word16)(*frac);                  /* Extract b10-b24 */
-	a = (Word16) (a & (Word16) 0x7fff);    
+	a = (Word16) (a & (Word16) 0x7fff);
 	i -= 16;
 	*frac = L_deposit_h(table_isqrt[i]);   /* table[i] << 16         */
 	tmp = vo_sub(table_isqrt[i], table_isqrt[i + 1]);      /* table[i] - table[i+1]) */
@@ -167,7 +167,7 @@
 	i = extract_h(L_x);                    /* Extract b10-b16 of fraction */
 	L_x =L_x >> 1;
 	a = (Word16)(L_x);                    /* Extract b0-b9   of fraction */
-	a = (Word16) (a & (Word16) 0x7fff); 
+	a = (Word16) (a & (Word16) 0x7fff);
 
 	L_x = L_deposit_h(table_pow2[i]);      /* table[i] << 16        */
 	tmp = vo_sub(table_pow2[i], table_pow2[i + 1]);        /* table[i] - table[i+1] */
diff --git a/media/libstagefright/codecs/amrwbenc/src/mem_align.c b/media/libstagefright/codecs/amrwbenc/src/mem_align.c
index e58915a..3b7853f 100644
--- a/media/libstagefright/codecs/amrwbenc/src/mem_align.c
+++ b/media/libstagefright/codecs/amrwbenc/src/mem_align.c
@@ -23,11 +23,16 @@
 
 
 #include	"mem_align.h"
+#ifdef _MSC_VER
+#include	<stddef.h>
+#else
+#include	<stdint.h>
+#endif
 
 /*****************************************************************************
 *
 * function name: mem_malloc
-* description:  malloc the alignments memory 
+* description:  malloc the alignments memory
 * returns:      the point of the memory
 *
 **********************************************************************************/
@@ -66,8 +71,8 @@
 		pMemop->Set(CodecID, tmp, 0, size + alignment);
 
 		mem_ptr =
-			(unsigned char *) ((unsigned int) (tmp + alignment - 1) &
-					(~((unsigned int) (alignment - 1))));
+			(unsigned char *) ((intptr_t) (tmp + alignment - 1) &
+					(~((intptr_t) (alignment - 1))));
 
 		if (mem_ptr == tmp)
 			mem_ptr += alignment;
diff --git a/media/libstagefright/codecs/amrwbenc/src/p_med_ol.c b/media/libstagefright/codecs/amrwbenc/src/p_med_ol.c
index 08f430f..b8174b9 100644
--- a/media/libstagefright/codecs/amrwbenc/src/p_med_ol.c
+++ b/media/libstagefright/codecs/amrwbenc/src/p_med_ol.c
@@ -18,7 +18,7 @@
 *      File: p_med_ol.c                                                *
 *                                                                      *
 *      Description: Compute the open loop pitch lag                    *
-*	            output: open loop pitch lag                        *                            
+*	            output: open loop pitch lag                        *
 ************************************************************************/
 
 #include "typedef.h"
@@ -29,7 +29,7 @@
 #include "p_med_ol.tab"
 
 Word16 Pitch_med_ol(
-		   Word16      wsp[],        /*   i: signal used to compute the open loop pitch*/  
+		   Word16      wsp[],        /*   i: signal used to compute the open loop pitch*/
                                      /*      wsp[-pit_max] to wsp[-1] should be known */
 		   Coder_State *st,          /* i/o: codec global structure */
 		   Word16      L_frame       /*   i: length of frame to compute pitch */
@@ -52,8 +52,8 @@
 	ww = &corrweight[198];
 	we = &corrweight[98 + L_max - L_0];
 
-	max = MIN_32;                          
-	Tm = 0;                                
+	max = MIN_32;
+	Tm = 0;
 	for (i = L_max; i > L_min; i--)
 	{
 		/* Compute the correlation */
@@ -65,7 +65,7 @@
 			R0 += vo_L_mult((*p1++), (*p2++));
 			R0 += vo_L_mult((*p1++), (*p2++));
 			R0 += vo_L_mult((*p1++), (*p2++));
-			R0 += vo_L_mult((*p1++), (*p2++));     
+			R0 += vo_L_mult((*p1++), (*p2++));
 		}
 		/* Weighting of the correlation function.   */
 		hi = R0>>16;
@@ -90,13 +90,13 @@
 	}
 
 	/* Hypass the wsp[] vector */
-	hp_wsp = old_hp_wsp + L_max;           
+	hp_wsp = old_hp_wsp + L_max;
 	Hp_wsp(wsp, hp_wsp, L_frame, hp_wsp_mem);
 
 	/* Compute normalize correlation at delay Tm */
-	R0 = 0;                                
-	R1 = 0;                               
-	R2 = 0; 
+	R0 = 0;
+	R1 = 0;
+	R2 = 0;
 	p1 = hp_wsp;
 	p2 = hp_wsp - Tm;
 	for (j = 0; j < L_frame; j+=4)
@@ -174,57 +174,57 @@
 	Word16 x1, x2, x3, x4, x5;
 	Word16 tmp;
 
-	x1 = x[-2];                            
-	x2 = x[-1];                            
-	x3 = x[0];                             
-	x4 = x[1];                             
-	x5 = x[2];                             
+	x1 = x[-2];
+	x2 = x[-1];
+	x3 = x[0];
+	x4 = x[1];
+	x5 = x[2];
 
 	if (x2 < x1)
 	{
 		tmp = x1;
 		x1 = x2;
-		x2 = tmp;                          
+		x2 = tmp;
 	}
 	if (x3 < x1)
 	{
 		tmp = x1;
 		x1 = x3;
-		x3 = tmp;                          
+		x3 = tmp;
 	}
 	if (x4 < x1)
 	{
 		tmp = x1;
 		x1 = x4;
-		x4 = tmp;                          
+		x4 = tmp;
 	}
 	if (x5 < x1)
 	{
-		x5 = x1;                           
+		x5 = x1;
 	}
 	if (x3 < x2)
 	{
 		tmp = x2;
 		x2 = x3;
-		x3 = tmp;                          
+		x3 = tmp;
 	}
 	if (x4 < x2)
 	{
 		tmp = x2;
 		x2 = x4;
-		x4 = tmp;                          
+		x4 = tmp;
 	}
 	if (x5 < x2)
 	{
-		x5 = x2;                           
+		x5 = x2;
 	}
 	if (x4 < x3)
 	{
-		x3 = x4;                           
+		x3 = x4;
 	}
 	if (x5 < x3)
 	{
-		x3 = x5;                           
+		x3 = x5;
 	}
 	return (x3);
 }
@@ -241,10 +241,10 @@
 
 	for (i = 4; i > 0; i--)
 	{
-		old_ol_lag[i] = old_ol_lag[i - 1]; 
+		old_ol_lag[i] = old_ol_lag[i - 1];
 	}
 
-	old_ol_lag[0] = prev_ol_lag;           
+	old_ol_lag[0] = prev_ol_lag;
 
 	i = median5(&old_ol_lag[2]);
 
diff --git a/media/libstagefright/codecs/amrwbenc/src/pitch_f4.c b/media/libstagefright/codecs/amrwbenc/src/pitch_f4.c
index 41d7413..0d66c31 100644
--- a/media/libstagefright/codecs/amrwbenc/src/pitch_f4.c
+++ b/media/libstagefright/codecs/amrwbenc/src/pitch_f4.c
@@ -90,7 +90,7 @@
     Norm_corr_asm(exc, xn, h, L_subfr, t_min, t_max, corr);
 #else
 	Norm_Corr(exc, xn, h, L_subfr, t_min, t_max, corr);
-#endif 
+#endif
 
 	/* Find integer pitch */
 
@@ -100,8 +100,8 @@
 	{
 		if (corr[i] >= max)
 		{
-			max = corr[i];                 
-			t0 = i;                        
+			max = corr[i];
+			t0 = i;
 		}
 	}
 	/* If first subframe and t0 >= t0_fr1, do not search fractionnal pitch */
@@ -182,7 +182,7 @@
 #endif
 
 	/* Compute rounded down 1/sqrt(energy of xn[]) */
-	L_tmp = 0; 
+	L_tmp = 0;
 	for (i = 0; i < 64; i+=4)
 	{
 		L_tmp += (xn[i] * xn[i]);
@@ -202,7 +202,7 @@
 	for (t = t_min; t <= t_max; t++)
 	{
 		/* Compute correlation between xn[] and excf[] */
-		L_tmp  = 0;  
+		L_tmp  = 0;
 		L_tmp1 = 0;
 		for (i = 0; i < 64; i+=4)
 		{
@@ -246,7 +246,7 @@
 			L_tmp = L_tmp << L_tmp2;
 		}
 
-		corr_norm[t] = vo_round(L_tmp);      
+		corr_norm[t] = vo_round(L_tmp);
 		/* modify the filtered excitation excf[] for the next iteration */
 
 		if(t != t_max)
@@ -310,10 +310,10 @@
 	L_sum += vo_mult32(x[1], (*ptr++));
 	L_sum += vo_mult32(x[2], (*ptr++));
 	L_sum += vo_mult32(x[3], (*ptr++));
-	L_sum += vo_mult32(x[4], (*ptr++));  
+	L_sum += vo_mult32(x[4], (*ptr++));
 	L_sum += vo_mult32(x[5], (*ptr++));
 	L_sum += vo_mult32(x[6], (*ptr++));
-	L_sum += vo_mult32(x[7], (*ptr++));   
+	L_sum += vo_mult32(x[7], (*ptr++));
 
 	sum = extract_h(L_add(L_shl2(L_sum, 2), 0x8000));
 	return (sum);
diff --git a/media/libstagefright/codecs/amrwbenc/src/pred_lt4.c b/media/libstagefright/codecs/amrwbenc/src/pred_lt4.c
index b359651..8404cf9 100644
--- a/media/libstagefright/codecs/amrwbenc/src/pred_lt4.c
+++ b/media/libstagefright/codecs/amrwbenc/src/pred_lt4.c
@@ -60,13 +60,13 @@
 	Word16 *ptr, *ptr1;
 	Word16 *ptr2;
 
-	x = exc - T0;   
+	x = exc - T0;
 	frac = -frac;
 	if (frac < 0)
 	{
 		frac += UP_SAMP;
 		x--;
-	}   
+	}
 	x -= 15;                                     /* x = L_INTERPOL2 - 1 */
 	k = 3 - frac;                                /* k = UP_SAMP - 1 - frac */
 
diff --git a/media/libstagefright/codecs/amrwbenc/src/preemph.c b/media/libstagefright/codecs/amrwbenc/src/preemph.c
index 5408617..c867bf7 100644
--- a/media/libstagefright/codecs/amrwbenc/src/preemph.c
+++ b/media/libstagefright/codecs/amrwbenc/src/preemph.c
@@ -35,20 +35,20 @@
 	Word16 temp;
 	Word32 i, L_tmp;
 
-	temp = x[lg - 1];                     
+	temp = x[lg - 1];
 
 	for (i = lg - 1; i > 0; i--)
 	{
 		L_tmp = L_deposit_h(x[i]);
 		L_tmp -= (x[i - 1] * mu)<<1;
-		x[i] = (L_tmp + 0x8000)>>16;               
+		x[i] = (L_tmp + 0x8000)>>16;
 	}
 
 	L_tmp = L_deposit_h(x[0]);
 	L_tmp -= ((*mem) * mu)<<1;
-	x[0] = (L_tmp + 0x8000)>>16;                   
+	x[0] = (L_tmp + 0x8000)>>16;
 
-	*mem = temp;                           
+	*mem = temp;
 
 	return;
 }
@@ -64,22 +64,22 @@
 	Word16 temp;
 	Word32 i, L_tmp;
 
-	temp = x[lg - 1];                     
+	temp = x[lg - 1];
 
 	for (i = (Word16) (lg - 1); i > 0; i--)
 	{
 		L_tmp = L_deposit_h(x[i]);
 		L_tmp -= (x[i - 1] * mu)<<1;
 		L_tmp = (L_tmp << 1);
-		x[i] = (L_tmp + 0x8000)>>16;               
+		x[i] = (L_tmp + 0x8000)>>16;
 	}
 
 	L_tmp = L_deposit_h(x[0]);
 	L_tmp -= ((*mem) * mu)<<1;
 	L_tmp = (L_tmp << 1);
-	x[0] = (L_tmp + 0x8000)>>16;                   
+	x[0] = (L_tmp + 0x8000)>>16;
 
-	*mem = temp;                           
+	*mem = temp;
 
 	return;
 }
diff --git a/media/libstagefright/codecs/amrwbenc/src/q_gain2.c b/media/libstagefright/codecs/amrwbenc/src/q_gain2.c
index 7bc299f..e8ca043 100644
--- a/media/libstagefright/codecs/amrwbenc/src/q_gain2.c
+++ b/media/libstagefright/codecs/amrwbenc/src/q_gain2.c
@@ -83,7 +83,7 @@
 	Word32 i, j, L_tmp, dist_min;
 	Word16 *past_qua_en, *t_qua_gain;
 
-	past_qua_en = mem;                     
+	past_qua_en = mem;
 
 	/*-----------------------------------------------------------------*
 	 * - Find the initial quantization pitch index                     *
@@ -91,9 +91,9 @@
 	 *-----------------------------------------------------------------*/
 	if (nbits == 6)
 	{
-		t_qua_gain = t_qua_gain6b;         
-		min_ind = 0;                       
-		size = RANGE;                      
+		t_qua_gain = t_qua_gain6b;
+		min_ind = 0;
+		size = RANGE;
 
 		if(gp_clip == 1)
 		{
@@ -101,18 +101,18 @@
 		}
 	} else
 	{
-		t_qua_gain = t_qua_gain7b;         
+		t_qua_gain = t_qua_gain7b;
 
 		p = t_qua_gain7b + RANGE;            /* pt at 1/4th of table */
 
-		j = nb_qua_gain7b - RANGE;         
+		j = nb_qua_gain7b - RANGE;
 
 		if (gp_clip == 1)
 		{
 			j = j - 27;                /* limit gain pitch to 1.0 */
 		}
-		min_ind = 0;                       
-		g_pitch = *gain_pit;               
+		min_ind = 0;
+		g_pitch = *gain_pit;
 
 		for (i = 0; i < j; i++, p += 2)
 		{
@@ -121,7 +121,7 @@
 				min_ind = min_ind + 1;
 			}
 		}
-		size = RANGE;                      
+		size = RANGE;
 	}
 
 	/*------------------------------------------------------------------*
@@ -137,10 +137,10 @@
 	 * are in vector g_coeff[].                                         *
 	 *------------------------------------------------------------------*/
 
-	coeff[0] = g_coeff[0];                 
-	exp_coeff[0] = g_coeff[1];             
+	coeff[0] = g_coeff[0];
+	exp_coeff[0] = g_coeff[1];
 	coeff[1] = negate(g_coeff[2]);                    /* coeff[1] = -2 xn y1 */
-	exp_coeff[1] = g_coeff[3] + 1;     
+	exp_coeff[1] = g_coeff[3] + 1;
 
 	/* Compute scalar product <y2[],y2[]> */
 #ifdef ASM_OPT                   /* asm optimization branch */
@@ -242,20 +242,20 @@
 	 *-------------------------------------------------------------------------*/
 
 	exp_code = (exp_gcode0 + 4);
-	exp_max[0] = (exp_coeff[0] - 13);    
-	exp_max[1] = (exp_coeff[1] - 14);    
-	exp_max[2] = (exp_coeff[2] + (15 + (exp_code << 1)));  
-	exp_max[3] = (exp_coeff[3] + exp_code);   
-	exp_max[4] = (exp_coeff[4] + (1 + exp_code));  
+	exp_max[0] = (exp_coeff[0] - 13);
+	exp_max[1] = (exp_coeff[1] - 14);
+	exp_max[2] = (exp_coeff[2] + (15 + (exp_code << 1)));
+	exp_max[3] = (exp_coeff[3] + exp_code);
+	exp_max[4] = (exp_coeff[4] + (1 + exp_code));
 
 	/* Find maximum exponant */
 
-	e_max = exp_max[0];                   
+	e_max = exp_max[0];
 	for (i = 1; i < 5; i++)
 	{
 		if(exp_max[i] > e_max)
 		{
-			e_max = exp_max[i];            
+			e_max = exp_max[i];
 		}
 	}
 
@@ -271,14 +271,14 @@
 	}
 
 	/* Codebook search */
-	dist_min = MAX_32;                     
-	p = &t_qua_gain[min_ind << 1];      
+	dist_min = MAX_32;
+	p = &t_qua_gain[min_ind << 1];
 
-	index = 0;                             
+	index = 0;
 	for (i = 0; i < size; i++)
 	{
-		g_pitch = *p++;                    
-		g_code = *p++;                     
+		g_pitch = *p++;
+		g_code = *p++;
 
 		g_code = ((g_code * gcode0) + 0x4000)>>15;
 		g2_pitch = ((g_pitch * g_pitch) + 0x4000)>>15;
@@ -302,14 +302,14 @@
 
 		if(L_tmp < dist_min)
 		{
-			dist_min = L_tmp;              
-			index = i;                     
+			dist_min = L_tmp;
+			index = i;
 		}
 	}
 
 	/* Read the quantized gains */
 	index = index + min_ind;
-	p = &t_qua_gain[(index + index)];    
+	p = &t_qua_gain[(index + index)];
 	*gain_pit = *p++;                       /* selected pitch gain in Q14 */
 	g_code = *p++;                          /* selected code gain in Q11  */
 
@@ -333,10 +333,10 @@
 
 	/* update table of past quantized energies */
 
-	past_qua_en[3] = past_qua_en[2];       
-	past_qua_en[2] = past_qua_en[1];       
-	past_qua_en[1] = past_qua_en[0];       
-	past_qua_en[0] = qua_ener;             
+	past_qua_en[3] = past_qua_en[2];
+	past_qua_en[2] = past_qua_en[1];
+	past_qua_en[1] = past_qua_en[0];
+	past_qua_en[0] = qua_ener;
 
 	return (index);
 }
diff --git a/media/libstagefright/codecs/amrwbenc/src/q_pulse.c b/media/libstagefright/codecs/amrwbenc/src/q_pulse.c
index 496ca80..80a0b73 100644
--- a/media/libstagefright/codecs/amrwbenc/src/q_pulse.c
+++ b/media/libstagefright/codecs/amrwbenc/src/q_pulse.c
@@ -82,7 +82,7 @@
 		if (vo_sub((Word16) (pos1 & mask), (Word16) (pos2 & mask)) <= 0)
 		{
 			/* index = ((pos2 & mask) << N) + (pos1 & mask); */
-			index = L_deposit_l(add1((((Word16) (pos2 & mask)) << N), ((Word16) (pos1 & mask)))); 
+			index = L_deposit_l(add1((((Word16) (pos2 & mask)) << N), ((Word16) (pos1 & mask))));
 			if ((pos2 & NB_POS) != 0)
 			{
 				tmp = (N << 1);           /* index += 1 << (2*N); */
@@ -91,7 +91,7 @@
 		} else
 		{
 			/* index = ((pos1 & mask) << N) + (pos2 & mask);	 */
-			index = L_deposit_l(add1((((Word16) (pos1 & mask)) << N), ((Word16) (pos2 & mask)))); 
+			index = L_deposit_l(add1((((Word16) (pos1 & mask)) << N), ((Word16) (pos2 & mask))));
 			if ((pos1 & NB_POS) != 0)
 			{
 				tmp = (N << 1);
@@ -120,14 +120,14 @@
 	{
 		index = quant_2p_2N1(pos1, pos2, sub(N, 1));    /* index = quant_2p_2N1(pos1, pos2, (N-1)); */
 		/* index += (pos1 & nb_pos) << N; */
-		index = vo_L_add(index, (L_deposit_l((Word16) (pos1 & nb_pos)) << N));  
+		index = vo_L_add(index, (L_deposit_l((Word16) (pos1 & nb_pos)) << N));
 		/* index += quant_1p_N1(pos3, N) << (2*N); */
 		index = vo_L_add(index, (quant_1p_N1(pos3, N)<<(N << 1)));
 
 	} else if (((pos1 ^ pos3) & nb_pos) == 0)
 	{
 		index = quant_2p_2N1(pos1, pos3, sub(N, 1));    /* index = quant_2p_2N1(pos1, pos3, (N-1)); */
-		index = vo_L_add(index, (L_deposit_l((Word16) (pos1 & nb_pos)) << N)); 
+		index = vo_L_add(index, (L_deposit_l((Word16) (pos1 & nb_pos)) << N));
 		/* index += (pos1 & nb_pos) << N; */
 		index = vo_L_add(index, (quant_1p_N1(pos2, N) << (N << 1)));
 		/* index += quant_1p_N1(pos2, N) <<
@@ -136,7 +136,7 @@
 	{
 		index = quant_2p_2N1(pos2, pos3, (N - 1));    /* index = quant_2p_2N1(pos2, pos3, (N-1)); */
 		/* index += (pos2 & nb_pos) << N;			 */
-		index = vo_L_add(index, (L_deposit_l((Word16) (pos2 & nb_pos)) << N));  
+		index = vo_L_add(index, (L_deposit_l((Word16) (pos2 & nb_pos)) << N));
 		/* index += quant_1p_N1(pos1, N) << (2*N);	 */
 		index = vo_L_add(index, (quant_1p_N1(pos1, N) << (N << 1)));
 	}
@@ -162,21 +162,21 @@
 	{
 		index = quant_2p_2N1(pos1, pos2, sub(N, 1));    /* index = quant_2p_2N1(pos1, pos2, (N-1)); */
 		/* index += (pos1 & nb_pos) << N;	 */
-		index = vo_L_add(index, (L_deposit_l((Word16) (pos1 & nb_pos)) << N));  
+		index = vo_L_add(index, (L_deposit_l((Word16) (pos1 & nb_pos)) << N));
 		/* index += quant_2p_2N1(pos3, pos4, N) << (2*N); */
 		index = vo_L_add(index, (quant_2p_2N1(pos3, pos4, N) << (N << 1)));
 	} else if (((pos1 ^ pos3) & nb_pos) == 0)
 	{
 		index = quant_2p_2N1(pos1, pos3, (N - 1));
 		/* index += (pos1 & nb_pos) << N; */
-		index = vo_L_add(index, (L_deposit_l((Word16) (pos1 & nb_pos)) << N));  
+		index = vo_L_add(index, (L_deposit_l((Word16) (pos1 & nb_pos)) << N));
 		/* index += quant_2p_2N1(pos2, pos4, N) << (2*N); */
 		index = vo_L_add(index, (quant_2p_2N1(pos2, pos4, N) << (N << 1)));
 	} else
 	{
 		index = quant_2p_2N1(pos2, pos3, (N - 1));
 		/* index += (pos2 & nb_pos) << N; */
-		index = vo_L_add(index, (L_deposit_l((Word16) (pos2 & nb_pos)) << N));  
+		index = vo_L_add(index, (L_deposit_l((Word16) (pos2 & nb_pos)) << N));
 		/* index += quant_2p_2N1(pos1, pos4, N) << (2*N); */
 		index = vo_L_add(index, (quant_2p_2N1(pos1, pos4, N) << (N << 1)));
 	}
@@ -192,20 +192,20 @@
 	Word16 posA[4], posB[4];
 	Word32 i, j, k, index;
 
-	n_1 = (Word16) (N - 1);                
+	n_1 = (Word16) (N - 1);
 	nb_pos = (1 << n_1);                  /* nb_pos = (1<<n_1); */
 	mask = vo_sub((1 << N), 1);              /* mask = ((1<<N)-1); */
 
-	i = 0;                                 
-	j = 0;                                 
+	i = 0;
+	j = 0;
 	for (k = 0; k < 4; k++)
 	{
 		if ((pos[k] & nb_pos) == 0)
 		{
-			posA[i++] = pos[k];            
+			posA[i++] = pos[k];
 		} else
 		{
-			posB[j++] = pos[k];            
+			posB[j++] = pos[k];
 		}
 	}
 
@@ -258,19 +258,19 @@
 	Word16 posA[5], posB[5];
 	Word32 i, j, k, index, tmp2;
 
-	n_1 = (Word16) (N - 1);                
+	n_1 = (Word16) (N - 1);
 	nb_pos = (1 << n_1);                  /* nb_pos = (1<<n_1); */
 
-	i = 0;                                 
-	j = 0;                                 
+	i = 0;
+	j = 0;
 	for (k = 0; k < 5; k++)
 	{
 		if ((pos[k] & nb_pos) == 0)
 		{
-			posA[i++] = pos[k];            
+			posA[i++] = pos[k];
 		} else
 		{
-			posB[j++] = pos[k];            
+			posB[j++] = pos[k];
 		}
 	}
 
@@ -333,19 +333,19 @@
 	Word32 i, j, k, index;
 
 	/* !!  N and n_1 are constants -> it doesn't need to be operated by Basic Operators */
-	n_1 = (Word16) (N - 1);                
+	n_1 = (Word16) (N - 1);
 	nb_pos = (1 << n_1);                  /* nb_pos = (1<<n_1); */
 
-	i = 0;                                 
-	j = 0;                                 
+	i = 0;
+	j = 0;
 	for (k = 0; k < 6; k++)
 	{
 		if ((pos[k] & nb_pos) == 0)
 		{
-			posA[i++] = pos[k];            
+			posA[i++] = pos[k];
 		} else
 		{
-			posB[j++] = pos[k];            
+			posB[j++] = pos[k];
 		}
 	}
 
@@ -368,23 +368,23 @@
 			index = vo_L_add(index, quant_2p_2N1(posA[0], posA[1], n_1));      /* index += quant_2p_2N1(posA[0], posA[1], n_1); */
 			break;
 		case 3:
-			index = (quant_3p_3N1(posA[0], posA[1], posA[2], n_1) << (Word16) (3 * n_1 + 1));    
+			index = (quant_3p_3N1(posA[0], posA[1], posA[2], n_1) << (Word16) (3 * n_1 + 1));
 			                                  /* index = quant_3p_3N1(posA[0], posA[1], posA[2], n_1) << ((3*n_1)+1); */
-			index =vo_L_add(index, quant_3p_3N1(posB[0], posB[1], posB[2], n_1));     
+			index =vo_L_add(index, quant_3p_3N1(posB[0], posB[1], posB[2], n_1));
 			                                 /* index += quant_3p_3N1(posB[0], posB[1], posB[2], n_1); */
 			break;
 		case 4:
-			i = 2;                            
+			i = 2;
 			index = (quant_4p_4N(posA, n_1) << (Word16) (2 * n_1 + 1));  /* index = quant_4p_4N(posA, n_1) << ((2*n_1)+1); */
 			index = vo_L_add(index, quant_2p_2N1(posB[0], posB[1], n_1));      /* index += quant_2p_2N1(posB[0], posB[1], n_1); */
 			break;
 		case 5:
-			i = 1;                            
+			i = 1;
 			index = (quant_5p_5N(posA, n_1) << N);       /* index = quant_5p_5N(posA, n_1) << N; */
 			index = vo_L_add(index, quant_1p_N1(posB[0], n_1));        /* index += quant_1p_N1(posB[0], n_1); */
 			break;
 		case 6:
-			i = 0;                             
+			i = 0;
 			index = (quant_5p_5N(posA, n_1) << N);       /* index = quant_5p_5N(posA, n_1) << N; */
 			index = vo_L_add(index, quant_1p_N1(posA[5], n_1));        /* index += quant_1p_N1(posA[5], n_1); */
 			break;
diff --git a/media/libstagefright/codecs/amrwbenc/src/qisf_ns.c b/media/libstagefright/codecs/amrwbenc/src/qisf_ns.c
index f6d53de..fc2f00d 100644
--- a/media/libstagefright/codecs/amrwbenc/src/qisf_ns.c
+++ b/media/libstagefright/codecs/amrwbenc/src/qisf_ns.c
@@ -43,14 +43,14 @@
 
 	for (i = 0; i < ORDER; i++)
 	{
-		isf_q[i] = sub(isf1[i], mean_isf_noise[i]);     
+		isf_q[i] = sub(isf1[i], mean_isf_noise[i]);
 	}
 
-	indice[0] = Sub_VQ(&isf_q[0], dico1_isf_noise, 2, SIZE_BK_NOISE1, &tmp);    
-	indice[1] = Sub_VQ(&isf_q[2], dico2_isf_noise, 3, SIZE_BK_NOISE2, &tmp);    
-	indice[2] = Sub_VQ(&isf_q[5], dico3_isf_noise, 3, SIZE_BK_NOISE3, &tmp);    
-	indice[3] = Sub_VQ(&isf_q[8], dico4_isf_noise, 4, SIZE_BK_NOISE4, &tmp);    
-	indice[4] = Sub_VQ(&isf_q[12], dico5_isf_noise, 4, SIZE_BK_NOISE5, &tmp);   
+	indice[0] = Sub_VQ(&isf_q[0], dico1_isf_noise, 2, SIZE_BK_NOISE1, &tmp);
+	indice[1] = Sub_VQ(&isf_q[2], dico2_isf_noise, 3, SIZE_BK_NOISE2, &tmp);
+	indice[2] = Sub_VQ(&isf_q[5], dico3_isf_noise, 3, SIZE_BK_NOISE3, &tmp);
+	indice[3] = Sub_VQ(&isf_q[8], dico4_isf_noise, 4, SIZE_BK_NOISE4, &tmp);
+	indice[4] = Sub_VQ(&isf_q[12], dico5_isf_noise, 4, SIZE_BK_NOISE5, &tmp);
 
 	/* decoding the ISFs */
 
@@ -78,28 +78,28 @@
 
 	for (i = 0; i < 2; i++)
 	{
-		isf_q[i] = dico1_isf_noise[indice[0] * 2 + i];  
+		isf_q[i] = dico1_isf_noise[indice[0] * 2 + i];
 	}
 	for (i = 0; i < 3; i++)
 	{
-		isf_q[i + 2] = dico2_isf_noise[indice[1] * 3 + i];      
+		isf_q[i + 2] = dico2_isf_noise[indice[1] * 3 + i];
 	}
 	for (i = 0; i < 3; i++)
 	{
-		isf_q[i + 5] = dico3_isf_noise[indice[2] * 3 + i];      
+		isf_q[i + 5] = dico3_isf_noise[indice[2] * 3 + i];
 	}
 	for (i = 0; i < 4; i++)
 	{
-		isf_q[i + 8] = dico4_isf_noise[indice[3] * 4 + i];      
+		isf_q[i + 8] = dico4_isf_noise[indice[3] * 4 + i];
 	}
 	for (i = 0; i < 4; i++)
 	{
-		isf_q[i + 12] = dico5_isf_noise[indice[4] * 4 + i];     
+		isf_q[i + 12] = dico5_isf_noise[indice[4] * 4 + i];
 	}
 
 	for (i = 0; i < ORDER; i++)
 	{
-		isf_q[i] = add(isf_q[i], mean_isf_noise[i]);   
+		isf_q[i] = add(isf_q[i], mean_isf_noise[i]);
 	}
 
 	Reorder_isf(isf_q, ISF_GAP, ORDER);
diff --git a/media/libstagefright/codecs/amrwbenc/src/qpisf_2s.c b/media/libstagefright/codecs/amrwbenc/src/qpisf_2s.c
index ac13a67..c711cd0 100644
--- a/media/libstagefright/codecs/amrwbenc/src/qpisf_2s.c
+++ b/media/libstagefright/codecs/amrwbenc/src/qpisf_2s.c
@@ -70,30 +70,30 @@
 	for (i = 0; i < ORDER; i++)
 	{
 		isf[i] = vo_sub(isf1[i], mean_isf[i]);
-		isf[i] = vo_sub(isf[i], vo_mult(MU, past_isfq[i])); 
+		isf[i] = vo_sub(isf[i], vo_mult(MU, past_isfq[i]));
 	}
 
 	VQ_stage1(&isf[0], dico1_isf, 9, SIZE_BK1, surv1, nb_surv);
 
-	distance = MAX_32;          
+	distance = MAX_32;
 
 	for (k = 0; k < nb_surv; k++)
 	{
 		for (i = 0; i < 9; i++)
 		{
-			isf_stage2[i] = vo_sub(isf[i], dico1_isf[i + surv1[k] * 9]); 
+			isf_stage2[i] = vo_sub(isf[i], dico1_isf[i + surv1[k] * 9]);
 		}
-		tmp_ind[0] = Sub_VQ(&isf_stage2[0], dico21_isf, 3, SIZE_BK21, &min_err); 
+		tmp_ind[0] = Sub_VQ(&isf_stage2[0], dico21_isf, 3, SIZE_BK21, &min_err);
 		temp = min_err;
-		tmp_ind[1] = Sub_VQ(&isf_stage2[3], dico22_isf, 3, SIZE_BK22, &min_err); 
+		tmp_ind[1] = Sub_VQ(&isf_stage2[3], dico22_isf, 3, SIZE_BK22, &min_err);
 		temp = vo_L_add(temp, min_err);
-		tmp_ind[2] = Sub_VQ(&isf_stage2[6], dico23_isf, 3, SIZE_BK23, &min_err);  
+		tmp_ind[2] = Sub_VQ(&isf_stage2[6], dico23_isf, 3, SIZE_BK23, &min_err);
 		temp = vo_L_add(temp, min_err);
 
 		if(temp < distance)
 		{
-			distance = temp;               
-			indice[0] = surv1[k];          
+			distance = temp;
+			indice[0] = surv1[k];
 			for (i = 0; i < 3; i++)
 			{
 				indice[i + 2] = tmp_ind[i];
@@ -104,24 +104,24 @@
 
 	VQ_stage1(&isf[9], dico2_isf, 7, SIZE_BK2, surv1, nb_surv);
 
-	distance = MAX_32;                   
+	distance = MAX_32;
 
 	for (k = 0; k < nb_surv; k++)
 	{
 		for (i = 0; i < 7; i++)
 		{
-			isf_stage2[i] = vo_sub(isf[9 + i], dico2_isf[i + surv1[k] * 7]);       
+			isf_stage2[i] = vo_sub(isf[9 + i], dico2_isf[i + surv1[k] * 7]);
 		}
 
 		tmp_ind[0] = Sub_VQ(&isf_stage2[0], dico24_isf, 3, SIZE_BK24, &min_err);
-		temp = min_err; 
+		temp = min_err;
 		tmp_ind[1] = Sub_VQ(&isf_stage2[3], dico25_isf, 4, SIZE_BK25, &min_err);
 		temp = vo_L_add(temp, min_err);
 
 		if(temp < distance)
 		{
-			distance = temp;               
-			indice[1] = surv1[k];          
+			distance = temp;
+			indice[1] = surv1[k];
 			for (i = 0; i < 2; i++)
 			{
 				indice[i + 5] = tmp_ind[i];
@@ -165,24 +165,24 @@
 
 	VQ_stage1(&isf[0], dico1_isf, 9, SIZE_BK1, surv1, nb_surv);
 
-	distance = MAX_32;                  
+	distance = MAX_32;
 
 	for (k = 0; k < nb_surv; k++)
 	{
 		for (i = 0; i < 9; i++)
 		{
-			isf_stage2[i] = vo_sub(isf[i], dico1_isf[i + surv1[k] * 9]); 
+			isf_stage2[i] = vo_sub(isf[i], dico1_isf[i + surv1[k] * 9]);
 		}
 
-		tmp_ind[0] = Sub_VQ(&isf_stage2[0], dico21_isf_36b, 5, SIZE_BK21_36b, &min_err);        
-		temp = min_err;                  
-		tmp_ind[1] = Sub_VQ(&isf_stage2[5], dico22_isf_36b, 4, SIZE_BK22_36b, &min_err);        
+		tmp_ind[0] = Sub_VQ(&isf_stage2[0], dico21_isf_36b, 5, SIZE_BK21_36b, &min_err);
+		temp = min_err;
+		tmp_ind[1] = Sub_VQ(&isf_stage2[5], dico22_isf_36b, 4, SIZE_BK22_36b, &min_err);
 		temp = vo_L_add(temp, min_err);
 
 		if(temp < distance)
 		{
-			distance = temp;               
-			indice[0] = surv1[k];          
+			distance = temp;
+			indice[0] = surv1[k];
 			for (i = 0; i < 2; i++)
 			{
 				indice[i + 2] = tmp_ind[i];
@@ -191,23 +191,23 @@
 	}
 
 	VQ_stage1(&isf[9], dico2_isf, 7, SIZE_BK2, surv1, nb_surv);
-	distance = MAX_32;                    
+	distance = MAX_32;
 
 	for (k = 0; k < nb_surv; k++)
 	{
 		for (i = 0; i < 7; i++)
 		{
-			isf_stage2[i] = vo_sub(isf[9 + i], dico2_isf[i + surv1[k] * 7]);     
+			isf_stage2[i] = vo_sub(isf[9 + i], dico2_isf[i + surv1[k] * 7]);
 		}
 
-		tmp_ind[0] = Sub_VQ(&isf_stage2[0], dico23_isf_36b, 7, SIZE_BK23_36b, &min_err);  
-		temp = min_err;                  
+		tmp_ind[0] = Sub_VQ(&isf_stage2[0], dico23_isf_36b, 7, SIZE_BK23_36b, &min_err);
+		temp = min_err;
 
 		if(temp < distance)
 		{
-			distance = temp;               
-			indice[1] = surv1[k];          
-			indice[4] = tmp_ind[0];        
+			distance = temp;
+			indice[1] = surv1[k];
+			indice[4] = tmp_ind[0];
 		}
 	}
 
@@ -239,32 +239,32 @@
 	{
 		for (i = 0; i < 9; i++)
 		{
-			isf_q[i] = dico1_isf[indice[0] * 9 + i];    
+			isf_q[i] = dico1_isf[indice[0] * 9 + i];
 		}
 		for (i = 0; i < 7; i++)
 		{
-			isf_q[i + 9] = dico2_isf[indice[1] * 7 + i];       
+			isf_q[i + 9] = dico2_isf[indice[1] * 7 + i];
 		}
 
 		for (i = 0; i < 3; i++)
 		{
-			isf_q[i] = add1(isf_q[i], dico21_isf[indice[2] * 3 + i]);   
-			isf_q[i + 3] = add1(isf_q[i + 3], dico22_isf[indice[3] * 3 + i]);  
-			isf_q[i + 6] = add1(isf_q[i + 6], dico23_isf[indice[4] * 3 + i]); 
-			isf_q[i + 9] = add1(isf_q[i + 9], dico24_isf[indice[5] * 3 + i]); 
+			isf_q[i] = add1(isf_q[i], dico21_isf[indice[2] * 3 + i]);
+			isf_q[i + 3] = add1(isf_q[i + 3], dico22_isf[indice[3] * 3 + i]);
+			isf_q[i + 6] = add1(isf_q[i + 6], dico23_isf[indice[4] * 3 + i]);
+			isf_q[i + 9] = add1(isf_q[i + 9], dico24_isf[indice[5] * 3 + i]);
 		}
 
 		for (i = 0; i < 4; i++)
 		{
-			isf_q[i + 12] = add1(isf_q[i + 12], dico25_isf[indice[6] * 4 + i]);  
+			isf_q[i + 12] = add1(isf_q[i + 12], dico25_isf[indice[6] * 4 + i]);
 		}
 
 		for (i = 0; i < ORDER; i++)
 		{
-			tmp = isf_q[i];               
-			isf_q[i] = add1(tmp, mean_isf[i]);  
+			tmp = isf_q[i];
+			isf_q[i] = add1(tmp, mean_isf[i]);
 			isf_q[i] = add1(isf_q[i], vo_mult(MU, past_isfq[i]));
-			past_isfq[i] = tmp;  
+			past_isfq[i] = tmp;
 		}
 
 		if (enc_dec)
@@ -273,9 +273,9 @@
 			{
 				for (j = (L_MEANBUF - 1); j > 0; j--)
 				{
-					isf_buf[j * M + i] = isf_buf[(j - 1) * M + i]; 
+					isf_buf[j * M + i] = isf_buf[(j - 1) * M + i];
 				}
-				isf_buf[i] = isf_q[i]; 
+				isf_buf[i] = isf_q[i];
 			}
 		}
 	} else
@@ -293,14 +293,14 @@
 		/* use the past ISFs slightly shifted towards their mean */
 		for (i = 0; i < ORDER; i++)
 		{
-			isf_q[i] = add1(vo_mult(ALPHA, isfold[i]), vo_mult(ONE_ALPHA, ref_isf[i])); 
+			isf_q[i] = add1(vo_mult(ALPHA, isfold[i]), vo_mult(ONE_ALPHA, ref_isf[i]));
 		}
 
 		/* estimate past quantized residual to be used in next frame */
 		for (i = 0; i < ORDER; i++)
 		{
 			tmp = add1(ref_isf[i], vo_mult(past_isfq[i], MU));      /* predicted ISF */
-			past_isfq[i] = vo_sub(isf_q[i], tmp); 
+			past_isfq[i] = vo_sub(isf_q[i], tmp);
 			past_isfq[i] = (past_isfq[i] >> 1);        /* past_isfq[i] *= 0.5 */
 		}
 	}
@@ -332,32 +332,32 @@
 	{
 		for (i = 0; i < 9; i++)
 		{
-			isf_q[i] = dico1_isf[indice[0] * 9 + i];    
+			isf_q[i] = dico1_isf[indice[0] * 9 + i];
 		}
 		for (i = 0; i < 7; i++)
 		{
-			isf_q[i + 9] = dico2_isf[indice[1] * 7 + i];       
+			isf_q[i + 9] = dico2_isf[indice[1] * 7 + i];
 		}
 
 		for (i = 0; i < 5; i++)
 		{
-			isf_q[i] = add1(isf_q[i], dico21_isf_36b[indice[2] * 5 + i]);       
+			isf_q[i] = add1(isf_q[i], dico21_isf_36b[indice[2] * 5 + i]);
 		}
 		for (i = 0; i < 4; i++)
 		{
-			isf_q[i + 5] = add1(isf_q[i + 5], dico22_isf_36b[indice[3] * 4 + i]);        
+			isf_q[i + 5] = add1(isf_q[i + 5], dico22_isf_36b[indice[3] * 4 + i]);
 		}
 		for (i = 0; i < 7; i++)
 		{
-			isf_q[i + 9] = add1(isf_q[i + 9], dico23_isf_36b[indice[4] * 7 + i]);       
+			isf_q[i + 9] = add1(isf_q[i + 9], dico23_isf_36b[indice[4] * 7 + i]);
 		}
 
 		for (i = 0; i < ORDER; i++)
 		{
 			tmp = isf_q[i];
-			isf_q[i] = add1(tmp, mean_isf[i]);   
-			isf_q[i] = add1(isf_q[i], vo_mult(MU, past_isfq[i]));   
-			past_isfq[i] = tmp;           
+			isf_q[i] = add1(tmp, mean_isf[i]);
+			isf_q[i] = add1(isf_q[i], vo_mult(MU, past_isfq[i]));
+			past_isfq[i] = tmp;
 		}
 
 
@@ -367,9 +367,9 @@
 			{
 				for (j = (L_MEANBUF - 1); j > 0; j--)
 				{
-					isf_buf[j * M + i] = isf_buf[(j - 1) * M + i];      
+					isf_buf[j * M + i] = isf_buf[(j - 1) * M + i];
 				}
-				isf_buf[i] = isf_q[i];    
+				isf_buf[i] = isf_q[i];
 			}
 		}
 	} else
@@ -381,20 +381,20 @@
 			{
 				L_tmp += (isf_buf[j * M + i] << 14);
 			}
-			ref_isf[i] = vo_round(L_tmp);    
+			ref_isf[i] = vo_round(L_tmp);
 		}
 
 		/* use the past ISFs slightly shifted towards their mean */
 		for (i = 0; i < ORDER; i++)
 		{
-			isf_q[i] = add1(vo_mult(ALPHA, isfold[i]), vo_mult(ONE_ALPHA, ref_isf[i]));        
+			isf_q[i] = add1(vo_mult(ALPHA, isfold[i]), vo_mult(ONE_ALPHA, ref_isf[i]));
 		}
 
 		/* estimate past quantized residual to be used in next frame */
 		for (i = 0; i < ORDER; i++)
 		{
 			tmp = add1(ref_isf[i], vo_mult(past_isfq[i], MU));      /* predicted ISF */
-			past_isfq[i] = vo_sub(isf_q[i], tmp);  
+			past_isfq[i] = vo_sub(isf_q[i], tmp);
 			past_isfq[i] = past_isfq[i] >> 1;         /* past_isfq[i] *= 0.5 */
 		}
 	}
@@ -424,15 +424,15 @@
 		Word16 n                              /* (i)      : number of ISF                        */
 		)
 {
-	Word32 i; 
+	Word32 i;
 	Word16 isf_min;
 
-	isf_min = min_dist;                    
+	isf_min = min_dist;
 	for (i = 0; i < n - 1; i++)
 	{
 		if(isf[i] < isf_min)
 		{
-			isf[i] = isf_min;              
+			isf[i] = isf_min;
 		}
 		isf_min = (isf[i] + min_dist);
 	}
@@ -452,13 +452,13 @@
 	Word32 i, j, index;
 	Word32 dist_min, dist;
 
-	dist_min = MAX_32;                     
-	p_dico = dico;                         
+	dist_min = MAX_32;
+	p_dico = dico;
 
-	index = 0;                             
+	index = 0;
 	for (i = 0; i < dico_size; i++)
 	{
-		dist = 0;  
+		dist = 0;
 
 		for (j = 0; j < dim; j++)
 		{
@@ -468,18 +468,18 @@
 
 		if(dist < dist_min)
 		{
-			dist_min = dist;               
-			index = i;                     
+			dist_min = dist;
+			index = i;
 		}
 	}
 
-	*distance = dist_min;                  
+	*distance = dist_min;
 
 	/* Reading the selected vector */
-	p_dico = &dico[index * dim];           
+	p_dico = &dico[index * dim];
 	for (j = 0; j < dim; j++)
 	{
-		x[j] = *p_dico++;                  
+		x[j] = *p_dico++;
 	}
 
 	return index;
@@ -508,11 +508,11 @@
 	index[2] = 2;
 	index[3] = 3;
 
-	p_dico = dico;                         
+	p_dico = dico;
 
 	for (i = 0; i < dico_size; i++)
 	{
-		dist = 0;                          
+		dist = 0;
 		for (j = 0; j < dim; j++)
 		{
 			temp = x[j] -  (*p_dico++);
@@ -525,11 +525,11 @@
 			{
 				for (l = surv - 1; l > k; l--)
 				{
-					dist_min[l] = dist_min[l - 1];      
-					index[l] = index[l - 1];    
+					dist_min[l] = dist_min[l - 1];
+					index[l] = index[l - 1];
 				}
-				dist_min[k] = dist;        
-				index[k] = i;              
+				dist_min[k] = dist;
+				index[k] = i;
 				break;
 			}
 		}
diff --git a/media/libstagefright/codecs/amrwbenc/src/residu.c b/media/libstagefright/codecs/amrwbenc/src/residu.c
index 328aed2..b0c04b5 100644
--- a/media/libstagefright/codecs/amrwbenc/src/residu.c
+++ b/media/libstagefright/codecs/amrwbenc/src/residu.c
@@ -56,7 +56,7 @@
 		s += vo_mult32((*p1++), (*p2--));
 		s += vo_mult32((*p1), (*p2));
 
-		s = L_shl2(s, 5); 
+		s = L_shl2(s, 5);
 		y[i] = extract_h(L_add(s, 0x8000));
 	}
 
diff --git a/media/libstagefright/codecs/amrwbenc/src/scale.c b/media/libstagefright/codecs/amrwbenc/src/scale.c
index b203bec..418cc06 100644
--- a/media/libstagefright/codecs/amrwbenc/src/scale.c
+++ b/media/libstagefright/codecs/amrwbenc/src/scale.c
@@ -36,8 +36,8 @@
 	{
 		for (i = lg - 1 ; i >= 0; i--)
 		{
-			L_tmp = L_shl2(x[i], 16 + exp);  
-			x[i] = extract_h(L_add(L_tmp, 0x8000));            
+			L_tmp = L_shl2(x[i], 16 + exp);
+			x[i] = extract_h(L_add(L_tmp, 0x8000));
 		}
 	}
 	else
@@ -46,8 +46,8 @@
 		for (i = lg - 1; i >= 0; i--)
 		{
 			L_tmp = x[i] << 16;
-			L_tmp >>= exp; 
-			x[i] = (L_tmp + 0x8000)>>16;            
+			L_tmp >>= exp;
+			x[i] = (L_tmp + 0x8000)>>16;
 		}
 	}
 	return;
diff --git a/media/libstagefright/codecs/amrwbenc/src/stream.c b/media/libstagefright/codecs/amrwbenc/src/stream.c
index bdf0d46..780f009 100644
--- a/media/libstagefright/codecs/amrwbenc/src/stream.c
+++ b/media/libstagefright/codecs/amrwbenc/src/stream.c
@@ -29,11 +29,11 @@
 	stream->frame_ptr_bk = stream->frame_ptr;
 	stream->set_len = 0;
 	stream->framebuffer_len = 0;
-	stream->frame_storelen = 0;	
+	stream->frame_storelen = 0;
 }
 
 void voAWB_UpdateFrameBuffer(
-		FrameStream *stream, 
+		FrameStream *stream,
 		VO_MEM_OPERATOR *pMemOP
 		)
 {
@@ -53,6 +53,6 @@
 	stream->frame_ptr_bk = stream->frame_ptr;
 	stream->set_len = 0;
 	stream->framebuffer_len = 0;
-	stream->frame_storelen = 0;	
+	stream->frame_storelen = 0;
 }
 
diff --git a/media/libstagefright/codecs/amrwbenc/src/syn_filt.c b/media/libstagefright/codecs/amrwbenc/src/syn_filt.c
index 90fafb0..1bda05a 100644
--- a/media/libstagefright/codecs/amrwbenc/src/syn_filt.c
+++ b/media/libstagefright/codecs/amrwbenc/src/syn_filt.c
@@ -39,11 +39,11 @@
 	Word16 y_buf[L_SUBFR16k + M16k];
 	Word32 L_tmp;
 	Word16 *yy, *p1, *p2;
-	yy = &y_buf[0];                        
+	yy = &y_buf[0];
 	/* copy initial filter states into synthesis buffer */
 	for (i = 0; i < 16; i++)
 	{
-		*yy++ = mem[i];                    
+		*yy++ = mem[i];
 	}
 	a0 = (a[0] >> 1);                     /* input / 2 */
 	/* Do the filtering. */
@@ -70,7 +70,7 @@
 		L_tmp -= vo_mult32((*p1), (*p2));
 
 		L_tmp = L_shl2(L_tmp, 4);
-		y[i] = yy[i] = extract_h(L_add(L_tmp, 0x8000));  
+		y[i] = yy[i] = extract_h(L_add(L_tmp, 0x8000));
 	}
 	/* Update memory if required */
 	if (update)
@@ -99,7 +99,7 @@
 	/* Do the filtering. */
 	for (i = 0; i < lg; i++)
 	{
-		L_tmp  = 0; 
+		L_tmp  = 0;
 		L_tmp1 = 0;
 		p1 = a;
 		p2 = &sig_lo[i - 1];
@@ -138,18 +138,18 @@
 		L_tmp  -= vo_mult32((*p2--), (*p1));
 		L_tmp1 -= vo_mult32((*p3--), (*p1++));
 
-		L_tmp = L_tmp >> 11;      
+		L_tmp = L_tmp >> 11;
 		L_tmp += vo_L_mult(exc[i], a0);
 
 		/* sig_hi = bit16 to bit31 of synthesis */
 		L_tmp = L_tmp - (L_tmp1<<1);
 
 		L_tmp = L_tmp >> 3;           /* ai in Q12 */
-		sig_hi[i] = extract_h(L_tmp);      
+		sig_hi[i] = extract_h(L_tmp);
 
 		/* sig_lo = bit4 to bit15 of synthesis */
 		L_tmp >>= 4;           /* 4 : sig_lo[i] >> 4 */
-		sig_lo[i] = (Word16)((L_tmp - (sig_hi[i] << 13)));  
+		sig_lo[i] = (Word16)((L_tmp - (sig_hi[i] << 13)));
 	}
 
 	return;
diff --git a/media/libstagefright/codecs/amrwbenc/src/updt_tar.c b/media/libstagefright/codecs/amrwbenc/src/updt_tar.c
index eda2b1c..96779fd 100644
--- a/media/libstagefright/codecs/amrwbenc/src/updt_tar.c
+++ b/media/libstagefright/codecs/amrwbenc/src/updt_tar.c
@@ -39,7 +39,7 @@
 	{
 		L_tmp = x[i] << 15;
 		L_tmp -= (y[i] * gain)<<1;
-		x2[i] = extract_h(L_shl2(L_tmp, 1)); 
+		x2[i] = extract_h(L_shl2(L_tmp, 1));
 	}
 
 	return;
diff --git a/media/libstagefright/codecs/amrwbenc/src/voAMRWBEnc.c b/media/libstagefright/codecs/amrwbenc/src/voAMRWBEnc.c
index bac00dd..0f4d689 100644
--- a/media/libstagefright/codecs/amrwbenc/src/voAMRWBEnc.c
+++ b/media/libstagefright/codecs/amrwbenc/src/voAMRWBEnc.c
@@ -84,11 +84,11 @@
 	Set_zero(cod_state->old_exc, PIT_MAX + L_INTERPOL);
 	Set_zero(cod_state->mem_syn, M);
 	Set_zero(cod_state->past_isfq, M);
-	cod_state->mem_w0 = 0;                 
-	cod_state->tilt_code = 0;              
-	cod_state->first_frame = 1;            
+	cod_state->mem_w0 = 0;
+	cod_state->tilt_code = 0;
+	cod_state->first_frame = 1;
 	Init_gp_clip(cod_state->gp_clip);
-	cod_state->L_gc_thres = 0;             
+	cod_state->L_gc_thres = 0;
 	if (reset_all != 0)
 	{
 		/* Static vectors to zero */
@@ -105,21 +105,21 @@
 		Copy(isp_init, cod_state->ispold, M);
 		Copy(isp_init, cod_state->ispold_q, M);
 		/* variable initialization */
-		cod_state->mem_preemph = 0;        
-		cod_state->mem_wsp = 0;            
-		cod_state->Q_old = 15;             
-		cod_state->Q_max[0] = 15;          
-		cod_state->Q_max[1] = 15;          
-		cod_state->old_wsp_max = 0;        
-		cod_state->old_wsp_shift = 0;      
+		cod_state->mem_preemph = 0;
+		cod_state->mem_wsp = 0;
+		cod_state->Q_old = 15;
+		cod_state->Q_max[0] = 15;
+		cod_state->Q_max[1] = 15;
+		cod_state->old_wsp_max = 0;
+		cod_state->old_wsp_shift = 0;
 		/* pitch ol initialization */
-		cod_state->old_T0_med = 40;        
-		cod_state->ol_gain = 0;            
-		cod_state->ada_w = 0;              
-		cod_state->ol_wght_flg = 0;        
+		cod_state->old_T0_med = 40;
+		cod_state->ol_gain = 0;
+		cod_state->ada_w = 0;
+		cod_state->ol_wght_flg = 0;
 		for (i = 0; i < 5; i++)
 		{
-			cod_state->old_ol_lag[i] = 40; 
+			cod_state->old_ol_lag[i] = 40;
 		}
 		Set_zero(cod_state->old_hp_wsp, (L_FRAME / 2) / OPL_DECIM + (PIT_MAX / OPL_DECIM));
 		Set_zero(cod_state->mem_syn_hf, M);
@@ -129,10 +129,10 @@
 		Init_Filt_6k_7k(cod_state->mem_hf);
 		Init_HP400_12k8(cod_state->mem_hp400);
 		Copy(isf_init, cod_state->isfold, M);
-		cod_state->mem_deemph = 0;         
-		cod_state->seed2 = 21845;          
+		cod_state->mem_deemph = 0;
+		cod_state->seed2 = 21845;
 		Init_Filt_6k_7k(cod_state->mem_hf2);
-		cod_state->gain_alpha = 32767;     
+		cod_state->gain_alpha = 32767;
 		cod_state->vad_hist = 0;
 		wb_vad_reset(cod_state->vadSt);
 		dtx_enc_reset(cod_state->dtx_encSt, isf_init);
@@ -212,8 +212,8 @@
 
 	st = (Coder_State *) spe_state;
 
-	*ser_size = nb_of_bits[*mode];         
-	codec_mode = *mode;                    
+	*ser_size = nb_of_bits[*mode];
+	codec_mode = *mode;
 
 	/*--------------------------------------------------------------------------*
 	 *          Initialize pointers to speech vector.                           *
@@ -233,10 +233,10 @@
 
 	new_speech = old_speech + L_TOTAL - L_FRAME - L_FILT;         /* New speech     */
 	speech = old_speech + L_TOTAL - L_FRAME - L_NEXT;             /* Present frame  */
-	p_window = old_speech + L_TOTAL - L_WINDOW; 
+	p_window = old_speech + L_TOTAL - L_WINDOW;
 
-	exc = old_exc + PIT_MAX + L_INTERPOL;  
-	wsp = old_wsp + (PIT_MAX / OPL_DECIM); 
+	exc = old_exc + PIT_MAX + L_INTERPOL;
+	wsp = old_wsp + (PIT_MAX / OPL_DECIM);
 
 	/* copy coder memory state into working space */
 	Copy(st->old_speech, old_speech, L_TOTAL - L_FRAME);
@@ -287,7 +287,7 @@
 		L_tmp = L_abs(L_tmp);
 		if(L_tmp > L_max)
 		{
-			L_max = L_tmp;                 
+			L_max = L_tmp;
 		}
 	}
 
@@ -297,50 +297,50 @@
 	tmp = extract_h(L_max);
 	if (tmp == 0)
 	{
-		shift = Q_MAX;                     
+		shift = Q_MAX;
 	} else
 	{
 		shift = norm_s(tmp) - 1;
 		if (shift < 0)
 		{
-			shift = 0;                     
+			shift = 0;
 		}
 		if (shift > Q_MAX)
 		{
-			shift = Q_MAX;                 
+			shift = Q_MAX;
 		}
 	}
-	Q_new = shift;                         
+	Q_new = shift;
 	if (Q_new > st->Q_max[0])
 	{
-		Q_new = st->Q_max[0];              
+		Q_new = st->Q_max[0];
 	}
 	if (Q_new > st->Q_max[1])
 	{
-		Q_new = st->Q_max[1];              
+		Q_new = st->Q_max[1];
 	}
 	exp = (Q_new - st->Q_old);
-	st->Q_old = Q_new;                     
-	st->Q_max[1] = st->Q_max[0];           
-	st->Q_max[0] = shift;                  
+	st->Q_old = Q_new;
+	st->Q_max[1] = st->Q_max[0];
+	st->Q_max[0] = shift;
 
 	/* preemphasis with scaling (L_FRAME+L_FILT) */
-	tmp = new_speech[L_FRAME - 1];         
+	tmp = new_speech[L_FRAME - 1];
 
 	for (i = L_FRAME + L_FILT - 1; i > 0; i--)
 	{
 		L_tmp = new_speech[i] << 15;
 		L_tmp -= (new_speech[i - 1] * mu)<<1;
 		L_tmp = (L_tmp << Q_new);
-		new_speech[i] = vo_round(L_tmp);      
+		new_speech[i] = vo_round(L_tmp);
 	}
 
 	L_tmp = new_speech[0] << 15;
 	L_tmp -= (st->mem_preemph * mu)<<1;
 	L_tmp = (L_tmp << Q_new);
-	new_speech[0] = vo_round(L_tmp);          
+	new_speech[0] = vo_round(L_tmp);
 
-	st->mem_preemph = tmp;                 
+	st->mem_preemph = tmp;
 
 	/* scale previous samples and memory */
 
@@ -364,13 +364,13 @@
 	Scale_sig(buf, L_FRAME, 1 - Q_new);
 #endif
 
-	vad_flag = wb_vad(st->vadSt, buf);          /* Voice Activity Detection */ 
+	vad_flag = wb_vad(st->vadSt, buf);          /* Voice Activity Detection */
 	if (vad_flag == 0)
 	{
-		st->vad_hist = (st->vad_hist + 1);        
+		st->vad_hist = (st->vad_hist + 1);
 	} else
 	{
-		st->vad_hist = 0;             
+		st->vad_hist = 0;
 	}
 
 	/* DTX processing */
@@ -378,7 +378,7 @@
 	{
 		/* Note that mode may change here */
 		tx_dtx_handler(st->dtx_encSt, vad_flag, mode);
-		*ser_size = nb_of_bits[*mode]; 
+		*ser_size = nb_of_bits[*mode];
 	}
 
 	if(*mode != MRDTX)
@@ -423,7 +423,7 @@
 	 * - scale wsp[] to avoid overflow in pitch estimation                  *
 	 * - Find open loop pitch lag for whole speech frame                    *
 	 *----------------------------------------------------------------------*/
-	p_A = A;                             
+	p_A = A;
 	for (i_subfr = 0; i_subfr < L_FRAME; i_subfr += L_SUBFR)
 	{
 		/* Weighting of LPC coefficients */
@@ -435,27 +435,27 @@
 		Residu(Ap, &speech[i_subfr], &wsp[i_subfr], L_SUBFR);
 #endif
 
-		p_A += (M + 1);                    
+		p_A += (M + 1);
 	}
 
 	Deemph2(wsp, TILT_FAC, L_FRAME, &(st->mem_wsp));
 
 	/* find maximum value on wsp[] for 12 bits scaling */
-	max = 0;                              
+	max = 0;
 	for (i = 0; i < L_FRAME; i++)
 	{
 		tmp = abs_s(wsp[i]);
 		if(tmp > max)
 		{
-			max = tmp;                     
+			max = tmp;
 		}
 	}
-	tmp = st->old_wsp_max;                 
+	tmp = st->old_wsp_max;
 	if(max > tmp)
 	{
 		tmp = max;                         /* tmp = max(wsp_max, old_wsp_max) */
 	}
-	st->old_wsp_max = max;                
+	st->old_wsp_max = max;
 
 	shift = norm_s(tmp) - 3;
 	if (shift > 0)
@@ -494,8 +494,8 @@
 
 	if(st->ol_gain > 19661)       /* 0.6 in Q15 */
 	{
-		st->old_T0_med = Med_olag(T_op, st->old_ol_lag);       
-		st->ada_w = 32767;                 
+		st->old_T0_med = Med_olag(T_op, st->old_ol_lag);
+		st->ada_w = 32767;
 	} else
 	{
 		st->ada_w = vo_mult(st->ada_w, 29491);
@@ -507,7 +507,7 @@
 		st->ol_wght_flg = 1;
 
 	wb_vad_tone_detection(st->vadSt, st->ol_gain);
-	T_op *= OPL_DECIM;                     
+	T_op *= OPL_DECIM;
 
 	if(*ser_size != NBBITS_7k)
 	{
@@ -516,11 +516,11 @@
 
 		if(st->ol_gain > 19661)   /* 0.6 in Q15 */
 		{
-			st->old_T0_med = Med_olag(T_op2, st->old_ol_lag);  
-			st->ada_w = 32767;             
+			st->old_T0_med = Med_olag(T_op2, st->old_ol_lag);
+			st->ada_w = 32767;
 		} else
 		{
-			st->ada_w = mult(st->ada_w, 29491); 
+			st->ada_w = mult(st->ada_w, 29491);
 		}
 
 		if(st->ada_w < 26214)
@@ -530,11 +530,11 @@
 
 		wb_vad_tone_detection(st->vadSt, st->ol_gain);
 
-		T_op2 *= OPL_DECIM;                
+		T_op2 *= OPL_DECIM;
 
 	} else
 	{
-		T_op2 = T_op;                      
+		T_op2 = T_op;
 	}
 	/*----------------------------------------------------------------------*
 	 *                              DTX-CNG                                 *
@@ -550,10 +550,10 @@
 
 		for (i = 0; i < L_FRAME; i++)
 		{
-			exc2[i] = shr(exc[i], Q_new);  
+			exc2[i] = shr(exc[i], Q_new);
 		}
 
-		L_tmp = 0;                         
+		L_tmp = 0;
 		for (i = 0; i < L_FRAME; i++)
 			L_tmp += (exc2[i] * exc2[i])<<1;
 
@@ -617,23 +617,23 @@
 
 	/* Check stability on isf : distance between old isf and current isf */
 
-	L_tmp = 0;                           
+	L_tmp = 0;
 	for (i = 0; i < M - 1; i++)
 	{
 		tmp = vo_sub(isf[i], st->isfold[i]);
 		L_tmp += (tmp * tmp)<<1;
 	}
 
-	tmp = extract_h(L_shl2(L_tmp, 8)); 
+	tmp = extract_h(L_shl2(L_tmp, 8));
 
 	tmp = vo_mult(tmp, 26214);                /* tmp = L_tmp*0.8/256 */
 	tmp = vo_sub(20480, tmp);                 /* 1.25 - tmp (in Q14) */
 
-	stab_fac = shl(tmp, 1); 
+	stab_fac = shl(tmp, 1);
 
 	if (stab_fac < 0)
 	{
-		stab_fac = 0;                      
+		stab_fac = 0;
 	}
 	Copy(isf, st->isfold, M);
 
@@ -642,7 +642,7 @@
 
 	if (st->first_frame != 0)
 	{
-		st->first_frame = 0;              
+		st->first_frame = 0;
 		Copy(ispnew_q, st->ispold_q, M);
 	}
 	/* Find the interpolated ISPs and convert to a[] for all subframes */
@@ -660,7 +660,7 @@
 #else
 		Residu(p_Aq, &speech[i_subfr], &exc[i_subfr], L_SUBFR);
 #endif
-		p_Aq += (M + 1);                   
+		p_Aq += (M + 1);
 	}
 
 	/* Buffer isf's and energy for dtx on non-speech frame */
@@ -670,7 +670,7 @@
 		{
 			exc2[i] = exc[i] >> Q_new;
 		}
-		L_tmp = 0;                         
+		L_tmp = 0;
 		for (i = 0; i < L_FRAME; i++)
 			L_tmp += (exc2[i] * exc2[i])<<1;
 		L_tmp >>= 1;
@@ -682,14 +682,14 @@
 	T0_min = T_op - 8;
 	if (T0_min < PIT_MIN)
 	{
-		T0_min = PIT_MIN;                  
+		T0_min = PIT_MIN;
 	}
 	T0_max = (T0_min + 15);
 
 	if(T0_max > PIT_MAX)
 	{
-		T0_max = PIT_MAX;                  
-		T0_min = T0_max - 15;          
+		T0_max = PIT_MAX;
+		T0_min = T0_max - 15;
 	}
 	/*------------------------------------------------------------------------*
 	 *          Loop for every subframe in the analysis frame                 *
@@ -711,25 +711,25 @@
 	 *     - update states of weighting filter                                *
 	 *     - find excitation and synthesis speech                             *
 	 *------------------------------------------------------------------------*/
-	p_A = A;                               
-	p_Aq = Aq;                             
+	p_A = A;
+	p_Aq = Aq;
 	for (i_subfr = 0; i_subfr < L_FRAME; i_subfr += L_SUBFR)
 	{
-		pit_flag = i_subfr;                
+		pit_flag = i_subfr;
 		if ((i_subfr == 2 * L_SUBFR) && (*ser_size > NBBITS_7k))
 		{
-			pit_flag = 0;                 
+			pit_flag = 0;
 			/* range for closed loop pitch search in 3rd subframe */
 			T0_min = (T_op2 - 8);
 
 			if (T0_min < PIT_MIN)
 			{
-				T0_min = PIT_MIN;          
+				T0_min = PIT_MIN;
 			}
 			T0_max = (T0_min + 15);
 			if (T0_max > PIT_MAX)
 			{
-				T0_max = PIT_MAX;         
+				T0_max = PIT_MAX;
 				T0_min = (T0_max - 15);
 			}
 		}
@@ -776,7 +776,7 @@
 		/* first half: xn[] --> cn[] */
 		Set_zero(code, M);
 		Copy(xn, code + M, L_SUBFR / 2);
-		tmp = 0;                          
+		tmp = 0;
 		Preemph2(code + M, TILT_FAC, L_SUBFR / 2, &tmp);
 		Weight_a(p_A, Ap, GAMMA1, M);
 		Syn_filt(Ap,code + M, code + M, L_SUBFR / 2, code, 0);
@@ -791,7 +791,7 @@
 		Copy(&exc[i_subfr + (L_SUBFR / 2)], cn + (L_SUBFR / 2), L_SUBFR / 2);
 
 		/*---------------------------------------------------------------*
-		 * Compute impulse response, h1[], of weighted synthesis filter  * 
+		 * Compute impulse response, h1[], of weighted synthesis filter  *
 		 *---------------------------------------------------------------*/
 
 		Set_zero(error, M + L_SUBFR);
@@ -814,7 +814,7 @@
 			*vo_p3++ = *vo_p0++ = vo_round((L_tmp <<4));
 		}
 		/* deemph without division by 2 -> Q14 to Q15 */
-		tmp = 0; 
+		tmp = 0;
 		Deemph2(h1, TILT_FAC, L_SUBFR, &tmp);   /* h1 in Q14 */
 
 		/* h2 in Q12 for codebook search */
@@ -917,7 +917,7 @@
 				T0_min = (T0 - 8);
 				if (T0_min < PIT_MIN)
 				{
-					T0_min = PIT_MIN; 
+					T0_min = PIT_MIN;
 				}
 				T0_max = T0_min + 15;
 
@@ -964,18 +964,18 @@
 			Convolve_asm(&exc[i_subfr], h1, y1, L_SUBFR);
 #else
 			Convolve(&exc[i_subfr], h1, y1, L_SUBFR);
-#endif 
+#endif
 			gain1 = G_pitch(xn, y1, g_coeff, L_SUBFR);
 			/* clip gain if necessary to avoid problem at decoder */
 			if ((clip_gain != 0) && (gain1 > GP_CLIP))
 			{
-				gain1 = GP_CLIP; 
+				gain1 = GP_CLIP;
 			}
 			/* find energy of new target xn2[] */
 			Updt_tar(xn, dn, y1, gain1, L_SUBFR);       /* dn used temporary */
 		} else
 		{
-			gain1 = 0; 
+			gain1 = 0;
 		}
 		/*-----------------------------------------------------------------*
 		 * - find pitch excitation filtered by 1st order LP filter.        *
@@ -1002,7 +1002,7 @@
 		Convolve_asm(code, h1, y2, L_SUBFR);
 #else
 		Convolve(code, h1, y2, L_SUBFR);
-#endif 
+#endif
 
 		gain2 = G_pitch(xn, y2, g_coeff2, L_SUBFR);
 
@@ -1016,7 +1016,7 @@
 		/*-----------------------------------------------------------------*
 		 * use the best prediction (minimise quadratic error).             *
 		 *-----------------------------------------------------------------*/
-		select = 0; 
+		select = 0;
 		if(*ser_size > NBBITS_9k)
 		{
 			L_tmp = 0L;
@@ -1036,7 +1036,7 @@
 
 			if (L_tmp <= 0)
 			{
-				select = 1; 
+				select = 1;
 			}
 			Parm_serial(select, 1, &prms);
 		}
@@ -1154,7 +1154,7 @@
 		/*-------------------------------------------------------*
 		 * - Add the fixed-gain pitch contribution to code[].    *
 		 *-------------------------------------------------------*/
-		tmp = 0; 
+		tmp = 0;
 		Preemph(code, st->tilt_code, L_SUBFR, &tmp);
 		Pit_shrp(code, T0, PIT_SHARP, L_SUBFR);
 		/*----------------------------------------------------------*
@@ -1175,7 +1175,7 @@
 		/* test quantized gain of pitch for pitch clipping algorithm */
 		Gp_clip_test_gain_pit(gain_pit, st->gp_clip);
 
-		L_tmp = L_shl(L_gain_code, Q_new); 
+		L_tmp = L_shl(L_gain_code, Q_new);
 		gain_code = extract_h(L_add(L_tmp, 0x8000));
 
 		/*----------------------------------------------------------*
@@ -1218,7 +1218,7 @@
 			L_tmp = (gain_code * code[i])<<1;
 			L_tmp = (L_tmp << 5);
 			L_tmp += (exc[i + i_subfr] * gain_pit)<<1;
-			L_tmp = L_shl2(L_tmp, 1); 
+			L_tmp = L_shl2(L_tmp, 1);
 			exc[i + i_subfr] = extract_h(L_add(L_tmp, 0x8000));
 		}
 
@@ -1242,7 +1242,7 @@
 			 *------------------------------------------------------------*/
 			tmp = (16384 - (voice_fac >> 1));        /* 1=unvoiced, 0=voiced */
 			fac = vo_mult(stab_fac, tmp);
-			L_tmp = L_gain_code; 
+			L_tmp = L_gain_code;
 			if(L_tmp < st->L_gc_thres)
 			{
 				L_tmp = vo_L_add(L_tmp, Mpy_32_16(gain_code, gain_code_lo, 6226));
@@ -1276,19 +1276,19 @@
 
 			L_tmp = L_deposit_h(code[0]);
 			L_tmp -= (code[1] * tmp)<<1;
-			code2[0] = vo_round(L_tmp); 
+			code2[0] = vo_round(L_tmp);
 
 			for (i = 1; i < L_SUBFR - 1; i++)
 			{
 				L_tmp = L_deposit_h(code[i]);
 				L_tmp -= (code[i + 1] * tmp)<<1;
 				L_tmp -= (code[i - 1] * tmp)<<1;
-				code2[i] = vo_round(L_tmp); 
+				code2[i] = vo_round(L_tmp);
 			}
 
 			L_tmp = L_deposit_h(code[L_SUBFR - 1]);
 			L_tmp -= (code[L_SUBFR - 2] * tmp)<<1;
-			code2[L_SUBFR - 1] = vo_round(L_tmp); 
+			code2[L_SUBFR - 1] = vo_round(L_tmp);
 
 			/* build excitation */
 			gain_code = vo_round(L_shl(L_gain_code, Q_new));
@@ -1381,7 +1381,7 @@
 	/* Original speech signal as reference for high band gain quantisation */
 	for (i = 0; i < L_SUBFR16k; i++)
 	{
-		HF_SP[i] = synth16k[i]; 
+		HF_SP[i] = synth16k[i];
 	}
 
 	/*------------------------------------------------------*
@@ -1454,7 +1454,7 @@
 		fac = div_s(tmp, ener);
 	} else
 	{
-		fac = 0; 
+		fac = 0;
 	}
 
 	/* modify energy of white noise according to synthesis tilt */
@@ -1550,7 +1550,7 @@
 
 /*************************************************
 *
-* Breif: Codec main function 
+* Breif: Codec main function
 *
 **************************************************/
 
@@ -1622,7 +1622,7 @@
 	else
 	{
 		pMemOP = (VO_MEM_OPERATOR *)pUserData->memData;
-	} 
+	}
 	/*-------------------------------------------------------------------------*
 	 * Memory allocation for coder state.                                      *
 	 *-------------------------------------------------------------------------*/
@@ -1631,8 +1631,8 @@
 		return VO_ERR_OUTOF_MEMORY;
 	}
 
-	st->vadSt = NULL;                      
-	st->dtx_encSt = NULL;                  
+	st->vadSt = NULL;
+	st->dtx_encSt = NULL;
 	st->sid_update_counter = 3;
 	st->sid_handover_debt = 0;
 	st->prev_ft = TX_SPEECH;
@@ -1764,7 +1764,7 @@
 	{
 		pAudioFormat->Format.Channels = 1;
 		pAudioFormat->Format.SampleRate = 8000;
-		pAudioFormat->Format.SampleBits = 16;	
+		pAudioFormat->Format.SampleBits = 16;
 		pAudioFormat->InputUsed = stream->used_len;
 	}
 	return VO_ERR_NONE;
@@ -1792,14 +1792,14 @@
 		/* setting AMR-WB frame type*/
 		case VO_PID_AMRWB_FRAMETYPE:
 			if(*lValue < VOAMRWB_DEFAULT || *lValue > VOAMRWB_RFC3267)
-				return VO_ERR_WRONG_PARAM_ID; 
+				return VO_ERR_WRONG_PARAM_ID;
 			gData->frameType = *lValue;
 			break;
 		/* setting AMR-WB bit rate */
 		case VO_PID_AMRWB_MODE:
 			{
 				if(*lValue < VOAMRWB_MD66 || *lValue > VOAMRWB_MD2385)
-					return VO_ERR_WRONG_PARAM_ID; 
+					return VO_ERR_WRONG_PARAM_ID;
 				gData->mode = *lValue;
 			}
 			break;
@@ -1839,7 +1839,7 @@
 	int    temp;
 	Coder_State* gData = (Coder_State*)hCodec;
 
-	if (gData==NULL) 
+	if (gData==NULL)
 		return VO_ERR_INVALID_ARG;
 	switch(uParamID)
 	{
diff --git a/media/libstagefright/codecs/amrwbenc/src/voicefac.c b/media/libstagefright/codecs/amrwbenc/src/voicefac.c
index 17e4e55..d890044 100644
--- a/media/libstagefright/codecs/amrwbenc/src/voicefac.c
+++ b/media/libstagefright/codecs/amrwbenc/src/voicefac.c
@@ -18,7 +18,7 @@
 *   File: voicefac.c                                                   *
 *                                                                      *
 *   Description: Find the voicing factors (1 = voice to -1 = unvoiced) *
-*                                                                      *                                                 
+*                                                                      *
 ************************************************************************/
 
 #include "typedef.h"
diff --git a/media/libstagefright/codecs/amrwbenc/src/wb_vad.c b/media/libstagefright/codecs/amrwbenc/src/wb_vad.c
index 7e1d673..13dd2aa 100644
--- a/media/libstagefright/codecs/amrwbenc/src/wb_vad.c
+++ b/media/libstagefright/codecs/amrwbenc/src/wb_vad.c
@@ -52,7 +52,7 @@
 
 	if (mant <= 0)
 	{
-		mant = 1;                         
+		mant = 1;
 	}
 	ex = norm_s(mant);
 	mant = mant << ex;
@@ -88,14 +88,14 @@
 
 	temp0 = vo_sub(*in0, vo_mult(COEFF5_1, data[0]));
 	temp1 = add1(data[0], vo_mult(COEFF5_1, temp0));
-	data[0] = temp0;                      
+	data[0] = temp0;
 
 	temp0 = vo_sub(*in1, vo_mult(COEFF5_2, data[1]));
 	temp2 = add1(data[1], vo_mult(COEFF5_2, temp0));
-	data[1] = temp0;                       
+	data[1] = temp0;
 
-	*in0 = extract_h((vo_L_add(temp1, temp2) << 15));   
-	*in1 = extract_h((vo_L_sub(temp1, temp2) << 15));  
+	*in0 = extract_h((vo_L_add(temp1, temp2) << 15));
+	*in1 = extract_h((vo_L_sub(temp1, temp2) << 15));
 }
 
 /******************************************************************************
@@ -116,10 +116,10 @@
 
 	temp1 = vo_sub(*in1, vo_mult(COEFF3, *data));
 	temp2 = add1(*data, vo_mult(COEFF3, temp1));
-	*data = temp1;                        
+	*data = temp1;
 
-	*in1 = extract_h((vo_L_sub(*in0, temp2) << 15));   
-	*in0 = extract_h((vo_L_add(*in0, temp2) << 15));   
+	*in1 = extract_h((vo_L_sub(*in0, temp2) << 15));
+	*in0 = extract_h((vo_L_add(*in0, temp2) << 15));
 }
 
 /******************************************************************************
@@ -149,14 +149,14 @@
 	Word32 i, l_temp1, l_temp2;
 	Word16 level;
 
-	l_temp1 = 0L;                          
+	l_temp1 = 0L;
 	for (i = count1; i < count2; i++)
 	{
 		l_temp1 += (abs_s(data[ind_m * i + ind_a])<<1);
 	}
 
 	l_temp2 = vo_L_add(l_temp1, L_shl(*sub_level, 16 - scale));
-	*sub_level = extract_h(L_shl(l_temp1, scale));      
+	*sub_level = extract_h(L_shl(l_temp1, scale));
 
 	for (i = 0; i < count1; i++)
 	{
@@ -187,7 +187,7 @@
 	/* shift input 1 bit down for safe scaling */
 	for (i = 0; i < FRAME_LEN; i++)
 	{
-		tmp_buf[i] = in[i] >> 1;       
+		tmp_buf[i] = in[i] >> 1;
 	}
 
 	/* run the filter bank */
@@ -222,29 +222,29 @@
 	/* calculate levels in each frequency band */
 
 	/* 4800 - 6400 Hz */
-	level[11] = level_calculation(tmp_buf, &st->sub_level[11], 16, 64, 4, 1, 14);   
+	level[11] = level_calculation(tmp_buf, &st->sub_level[11], 16, 64, 4, 1, 14);
 	/* 4000 - 4800 Hz */
-	level[10] = level_calculation(tmp_buf, &st->sub_level[10], 8, 32, 8, 7, 15);   
+	level[10] = level_calculation(tmp_buf, &st->sub_level[10], 8, 32, 8, 7, 15);
 	/* 3200 - 4000 Hz */
-	level[9] = level_calculation(tmp_buf, &st->sub_level[9],8, 32, 8, 3, 15);   
+	level[9] = level_calculation(tmp_buf, &st->sub_level[9],8, 32, 8, 3, 15);
 	/* 2400 - 3200 Hz */
-	level[8] = level_calculation(tmp_buf, &st->sub_level[8],8, 32, 8, 2, 15);   
+	level[8] = level_calculation(tmp_buf, &st->sub_level[8],8, 32, 8, 2, 15);
 	/* 2000 - 2400 Hz */
-	level[7] = level_calculation(tmp_buf, &st->sub_level[7],4, 16, 16, 14, 16);       
+	level[7] = level_calculation(tmp_buf, &st->sub_level[7],4, 16, 16, 14, 16);
 	/* 1600 - 2000 Hz */
-	level[6] = level_calculation(tmp_buf, &st->sub_level[6],4, 16, 16, 6, 16);        
+	level[6] = level_calculation(tmp_buf, &st->sub_level[6],4, 16, 16, 6, 16);
 	/* 1200 - 1600 Hz */
-	level[5] = level_calculation(tmp_buf, &st->sub_level[5],4, 16, 16, 4, 16);        
+	level[5] = level_calculation(tmp_buf, &st->sub_level[5],4, 16, 16, 4, 16);
 	/* 800 - 1200 Hz */
-	level[4] = level_calculation(tmp_buf, &st->sub_level[4],4, 16, 16, 12, 16);       
+	level[4] = level_calculation(tmp_buf, &st->sub_level[4],4, 16, 16, 12, 16);
 	/* 600 - 800 Hz */
-	level[3] = level_calculation(tmp_buf, &st->sub_level[3],2, 8, 32, 8, 17); 
+	level[3] = level_calculation(tmp_buf, &st->sub_level[3],2, 8, 32, 8, 17);
 	/* 400 - 600 Hz */
-	level[2] = level_calculation(tmp_buf, &st->sub_level[2],2, 8, 32, 24, 17);        
+	level[2] = level_calculation(tmp_buf, &st->sub_level[2],2, 8, 32, 24, 17);
 	/* 200 - 400 Hz */
-	level[1] = level_calculation(tmp_buf, &st->sub_level[1],2, 8, 32, 16, 17);        
+	level[1] = level_calculation(tmp_buf, &st->sub_level[1],2, 8, 32, 16, 17);
 	/* 0 - 200 Hz */
-	level[0] = level_calculation(tmp_buf, &st->sub_level[0],2, 8, 32, 0, 17); 
+	level[0] = level_calculation(tmp_buf, &st->sub_level[0],2, 8, 32, 0, 17);
 }
 
 /******************************************************************************
@@ -266,31 +266,31 @@
 	/* if a tone has been detected for a while, initialize stat_count */
 	if (sub((Word16) (st->tone_flag & 0x7c00), 0x7c00) == 0)
 	{
-		st->stat_count = STAT_COUNT;      
+		st->stat_count = STAT_COUNT;
 	} else
 	{
 		/* if 8 last vad-decisions have been "0", reinitialize stat_count */
 		if ((st->vadreg & 0x7f80) == 0)
 		{
-			st->stat_count = STAT_COUNT;   
+			st->stat_count = STAT_COUNT;
 		} else
 		{
-			stat_rat = 0;                  
+			stat_rat = 0;
 			for (i = 0; i < COMPLEN; i++)
 			{
 				if(level[i] > st->ave_level[i])
 				{
-					num = level[i];        
-					denom = st->ave_level[i];   
+					num = level[i];
+					denom = st->ave_level[i];
 				} else
 				{
 					num = st->ave_level[i];
-					denom = level[i];      
+					denom = level[i];
 				}
 				/* Limit nimimum value of num and denom to STAT_THR_LEVEL */
 				if(num < STAT_THR_LEVEL)
 				{
-					num = STAT_THR_LEVEL;  
+					num = STAT_THR_LEVEL;
 				}
 				if(denom < STAT_THR_LEVEL)
 				{
@@ -307,7 +307,7 @@
 			/* compare stat_rat with a threshold and update stat_count */
 			if(stat_rat > STAT_THR)
 			{
-				st->stat_count = STAT_COUNT;    
+				st->stat_count = STAT_COUNT;
 			} else
 			{
 				if ((st->vadreg & 0x4000) != 0)
@@ -315,7 +315,7 @@
 
 					if (st->stat_count != 0)
 					{
-						st->stat_count = st->stat_count - 1;       
+						st->stat_count = st->stat_count - 1;
 					}
 				}
 			}
@@ -323,17 +323,17 @@
 	}
 
 	/* Update average amplitude estimate for stationarity estimation */
-	alpha = ALPHA4;                        
+	alpha = ALPHA4;
 	if(st->stat_count == STAT_COUNT)
 	{
-		alpha = 32767;                    
+		alpha = 32767;
 	} else if ((st->vadreg & 0x4000) == 0)
 	{
-		alpha = ALPHA5;                   
+		alpha = ALPHA5;
 	}
 	for (i = 0; i < COMPLEN; i++)
 	{
-		st->ave_level[i] = add1(st->ave_level[i], vo_mult_r(alpha, vo_sub(level[i], st->ave_level[i])));   
+		st->ave_level[i] = add1(st->ave_level[i], vo_mult_r(alpha, vo_sub(level[i], st->ave_level[i])));
 	}
 }
 
@@ -354,25 +354,25 @@
 	/* if the input power (pow_sum) is lower than a threshold, clear counters and set VAD_flag to "0"         */
 	if (low_power != 0)
 	{
-		st->burst_count = 0;               
-		st->hang_count = 0;                
+		st->burst_count = 0;
+		st->hang_count = 0;
 		return 0;
 	}
 	/* update the counters (hang_count, burst_count) */
 	if ((st->vadreg & 0x4000) != 0)
 	{
-		st->burst_count = st->burst_count + 1;    
+		st->burst_count = st->burst_count + 1;
 		if(st->burst_count >= burst_len)
 		{
-			st->hang_count = hang_len;     
+			st->hang_count = hang_len;
 		}
 		return 1;
 	} else
 	{
-		st->burst_count = 0;               
+		st->burst_count = 0;
 		if (st->hang_count > 0)
 		{
-			st->hang_count = st->hang_count - 1;    
+			st->hang_count = st->hang_count - 1;
 			return 1;
 		}
 	}
@@ -391,7 +391,7 @@
 		Word16 level[]                        /* i   : sub-band levels of the input frame */
 		)
 {
-	Word32 i; 
+	Word32 i;
 	Word16 alpha_up, alpha_down, bckr_add = 2;
 
 	/* Control update of bckr_est[] */
@@ -400,19 +400,19 @@
 	/* Choose update speed */
 	if ((0x7800 & st->vadreg) == 0)
 	{
-		alpha_up = ALPHA_UP1;              
-		alpha_down = ALPHA_DOWN1;          
+		alpha_up = ALPHA_UP1;
+		alpha_down = ALPHA_DOWN1;
 	} else
 	{
 		if ((st->stat_count == 0))
 		{
-			alpha_up = ALPHA_UP2;          
-			alpha_down = ALPHA_DOWN2;      
+			alpha_up = ALPHA_UP2;
+			alpha_down = ALPHA_DOWN2;
 		} else
 		{
-			alpha_up = 0;                  
-			alpha_down = ALPHA3;           
-			bckr_add = 0;                  
+			alpha_up = 0;
+			alpha_down = ALPHA3;
+			bckr_add = 0;
 		}
 	}
 
@@ -424,20 +424,20 @@
 
 		if (temp < 0)
 		{                                  /* update downwards */
-			st->bckr_est[i] = add1(-2, add(st->bckr_est[i],vo_mult_r(alpha_down, temp))); 
+			st->bckr_est[i] = add1(-2, add(st->bckr_est[i],vo_mult_r(alpha_down, temp)));
 			/* limit minimum value of the noise estimate to NOISE_MIN */
 			if(st->bckr_est[i] < NOISE_MIN)
 			{
-				st->bckr_est[i] = NOISE_MIN;   
+				st->bckr_est[i] = NOISE_MIN;
 			}
 		} else
 		{                                  /* update upwards */
-			st->bckr_est[i] = add1(bckr_add, add1(st->bckr_est[i],vo_mult_r(alpha_up, temp)));   
+			st->bckr_est[i] = add1(bckr_add, add1(st->bckr_est[i],vo_mult_r(alpha_up, temp)));
 
 			/* limit maximum value of the noise estimate to NOISE_MAX */
 			if(st->bckr_est[i] > NOISE_MAX)
 			{
-				st->bckr_est[i] = NOISE_MAX;    
+				st->bckr_est[i] = NOISE_MAX;
 			}
 		}
 	}
@@ -445,7 +445,7 @@
 	/* Update signal levels of the previous frame (old_level) */
 	for (i = 0; i < COMPLEN; i++)
 	{
-		st->old_level[i] = level[i];      
+		st->old_level[i] = level[i];
 	}
 }
 
@@ -473,7 +473,7 @@
 
 	/* Calculate squared sum of the input levels (level) divided by the background noise components
 	 * (bckr_est). */
-	L_snr_sum = 0;                        
+	L_snr_sum = 0;
 	for (i = 0; i < COMPLEN; i++)
 	{
 		Word16 exp;
@@ -486,7 +486,7 @@
 	}
 
 	/* Calculate average level of estimated background noise */
-	L_temp = 0;                           
+	L_temp = 0;
 	for (i = 1; i < COMPLEN; i++)          /* ignore lowest band */
 	{
 		L_temp = vo_L_add(L_temp, st->bckr_est[i]);
@@ -498,7 +498,7 @@
 
 	if(st->speech_level < temp)
 	{
-		st->speech_level = temp;          
+		st->speech_level = temp;
 	}
 	ilog2_noise_level = ilog2(noise_level);
 
@@ -511,33 +511,33 @@
 	temp2 = add1(SP_CH_MIN, vo_mult(SP_SLOPE, (ilog2_speech_level - SP_P1)));
 	if (temp2 < SP_CH_MIN)
 	{
-		temp2 = SP_CH_MIN;                 
+		temp2 = SP_CH_MIN;
 	}
 	if (temp2 > SP_CH_MAX)
 	{
-		temp2 = SP_CH_MAX;                 
+		temp2 = SP_CH_MAX;
 	}
 	vad_thr = temp + temp2;
 
 	if(vad_thr < THR_MIN)
 	{
-		vad_thr = THR_MIN;                 
+		vad_thr = THR_MIN;
 	}
 	/* Shift VAD decision register */
-	st->vadreg = (st->vadreg >> 1);       
+	st->vadreg = (st->vadreg >> 1);
 
 	/* Make intermediate VAD decision */
 	if(L_snr_sum > vo_L_mult(vad_thr, (512 * COMPLEN)))
 	{
-		st->vadreg = (Word16) (st->vadreg | 0x4000); 
+		st->vadreg = (Word16) (st->vadreg | 0x4000);
 	}
 	/* check if the input power (pow_sum) is lower than a threshold" */
 	if(pow_sum < VAD_POW_LOW)
 	{
-		low_power_flag = 1;               
+		low_power_flag = 1;
 	} else
 	{
-		low_power_flag = 0;               
+		low_power_flag = 0;
 	}
 	/* Update background noise estimates */
 	noise_estimate_update(st, level);
@@ -546,7 +546,7 @@
 	hang_len = add1(vo_mult(HANG_SLOPE, (vad_thr - HANG_P1)), HANG_HIGH);
 	if(hang_len < HANG_LOW)
 	{
-		hang_len = HANG_LOW;              
+		hang_len = HANG_LOW;
 	}
 	burst_len = add1(vo_mult(BURST_SLOPE, (vad_thr - BURST_P1)), BURST_HIGH);
 
@@ -575,20 +575,20 @@
 	/* if the required activity count cannot be achieved, reset counters */
 	if((st->sp_est_cnt - st->sp_max_cnt) > (SP_EST_COUNT - SP_ACTIVITY_COUNT))
 	{
-		st->sp_est_cnt = 0;                
-		st->sp_max = 0;                    
-		st->sp_max_cnt = 0;                
+		st->sp_est_cnt = 0;
+		st->sp_max = 0;
+		st->sp_max_cnt = 0;
 	}
-	st->sp_est_cnt += 1; 
+	st->sp_est_cnt += 1;
 
 	if (((st->vadreg & 0x4000)||(in_level > st->speech_level)) && (in_level > MIN_SPEECH_LEVEL1))
 	{
 		/* update sp_max */
 		if(in_level > st->sp_max)
 		{
-			st->sp_max = in_level;         
+			st->sp_max = in_level;
 		}
-		st->sp_max_cnt += 1;        
+		st->sp_max_cnt += 1;
 
 		if(st->sp_max_cnt >= SP_ACTIVITY_COUNT)
 		{
@@ -599,19 +599,19 @@
 			/* select update speed */
 			if(tmp > st->speech_level)
 			{
-				alpha = ALPHA_SP_UP;       
+				alpha = ALPHA_SP_UP;
 			} else
 			{
-				alpha = ALPHA_SP_DOWN;    
+				alpha = ALPHA_SP_DOWN;
 			}
 			if(tmp > MIN_SPEECH_LEVEL2)
 			{
-				st->speech_level = add1(st->speech_level, vo_mult_r(alpha, vo_sub(tmp, st->speech_level))); 
+				st->speech_level = add1(st->speech_level, vo_mult_r(alpha, vo_sub(tmp, st->speech_level)));
 			}
 			/* clear all counters used for speech estimation */
-			st->sp_max = 0;                
-			st->sp_max_cnt = 0;            
-			st->sp_est_cnt = 0;            
+			st->sp_max = 0;
+			st->sp_max_cnt = 0;
+			st->sp_est_cnt = 0;
 		}
 	}
 }
@@ -767,22 +767,22 @@
 	Word32 L_temp, pow_sum;
 
 	/* Calculate power of the input frame. */
-	L_temp = 0L;                           
+	L_temp = 0L;
 	for (i = 0; i < FRAME_LEN; i++)
 	{
 		L_temp = L_mac(L_temp, in_buf[i], in_buf[i]);
 	}
 
 	/* pow_sum = power of current frame and previous frame */
-	pow_sum = L_add(L_temp, st->prev_pow_sum);  
+	pow_sum = L_add(L_temp, st->prev_pow_sum);
 
 	/* save power of current frame for next call */
-	st->prev_pow_sum = L_temp;             
+	st->prev_pow_sum = L_temp;
 
 	/* If input power is very low, clear tone flag */
 	if (pow_sum < POW_TONE_THR)
 	{
-		st->tone_flag = (Word16) (st->tone_flag & 0x1fff);      
+		st->tone_flag = (Word16) (st->tone_flag & 0x1fff);
 	}
 	/* Run the filter bank and calculate signal levels at each band */
 	filter_bank(st, in_buf, level);
@@ -791,7 +791,7 @@
 	VAD_flag = vad_decision(st, level, pow_sum);
 
 	/* Calculate input level */
-	L_temp = 0;                          
+	L_temp = 0;
 	for (i = 1; i < COMPLEN; i++)          /* ignore lowest band */
 	{
 		L_temp = vo_L_add(L_temp, level[i]);
diff --git a/media/libstagefright/codecs/amrwbenc/src/weight_a.c b/media/libstagefright/codecs/amrwbenc/src/weight_a.c
index 8f0fb39..a02b48d 100644
--- a/media/libstagefright/codecs/amrwbenc/src/weight_a.c
+++ b/media/libstagefright/codecs/amrwbenc/src/weight_a.c
@@ -19,7 +19,7 @@
 *                                                                      *
 *       Description:Weighting of LPC coefficients                      *
 *	               ap[i] = a[i] * (gamma ** i)                     *
-*                                                                      * 
+*                                                                      *
 ************************************************************************/
 
 #include "typedef.h"
diff --git a/media/libstagefright/codecs/common/Config.mk b/media/libstagefright/codecs/common/Config.mk
index 3d754e7..187f25c 100644
--- a/media/libstagefright/codecs/common/Config.mk
+++ b/media/libstagefright/codecs/common/Config.mk
@@ -1,8 +1,8 @@
-# 
+#
 # This configure file is just for Linux projects against Android
 #
 
-VOPRJ := 
+VOPRJ :=
 VONJ :=
 
 # WARNING:
@@ -20,5 +20,5 @@
 
 VOTEST := 0
 
-VO_CFLAGS:=-DLINUX 
+VO_CFLAGS:=-DLINUX
 
diff --git a/media/libstagefright/codecs/common/include/voAMRWB.h b/media/libstagefright/codecs/common/include/voAMRWB.h
index 13290c7..d3eb537 100644
--- a/media/libstagefright/codecs/common/include/voAMRWB.h
+++ b/media/libstagefright/codecs/common/include/voAMRWB.h
@@ -29,20 +29,20 @@
 #pragma pack(push, 4)
 
 /*!* the bit rate the codec supports*/
-typedef enum { 
+typedef enum {
 	VOAMRWB_MDNONE		= -1,	/*!< Invalid mode */
 	VOAMRWB_MD66		= 0,	/*!< 6.60kbps   */
-	VOAMRWB_MD885		= 1,    /*!< 8.85kbps   */       
+	VOAMRWB_MD885		= 1,    /*!< 8.85kbps   */
 	VOAMRWB_MD1265		= 2,	/*!< 12.65kbps  */
 	VOAMRWB_MD1425		= 3,	/*!< 14.25kbps  */
 	VOAMRWB_MD1585		= 4,	/*!< 15.85bps   */
 	VOAMRWB_MD1825		= 5,	/*!< 18.25bps   */
 	VOAMRWB_MD1985		= 6,	/*!< 19.85kbps  */
 	VOAMRWB_MD2305		= 7,    /*!< 23.05kbps  */
-	VOAMRWB_MD2385          = 8,    /*!< 23.85kbps> */	
+	VOAMRWB_MD2385          = 8,    /*!< 23.85kbps> */
 	VOAMRWB_N_MODES 	= 9,	/*!< Invalid mode */
 	VOAMRWB_MODE_MAX    = VO_MAX_ENUM_VALUE
-	
+
 }VOAMRWBMODE;
 
 /*!* the frame format the codec supports*/
@@ -51,17 +51,17 @@
 	/*One word (2-byte) for sync word (0x6b21)*/
 	/*One word (2-byte) for frame length N.*/
 	/*N words (2-byte) containing N bits (bit 0 = 0x007f, bit 1 = 0x0081).*/
-	VOAMRWB_ITU         = 1, 
+	VOAMRWB_ITU         = 1,
 	/*One word (2-byte) for sync word (0x6b21).*/
-	/*One word (2-byte) to indicate the frame type.*/	
+	/*One word (2-byte) to indicate the frame type.*/
 	/*One word (2-byte) to indicate the mode.*/
 	/*N words  (2-byte) containing N bits (bit 0 = 0xff81, bit 1 = 0x007f).*/
-	VOAMRWB_RFC3267		= 2,	/* see RFC 3267 */  
-    VOAMRWB_TMAX        = VO_MAX_ENUM_VALUE	
+	VOAMRWB_RFC3267		= 2,	/* see RFC 3267 */
+    VOAMRWB_TMAX        = VO_MAX_ENUM_VALUE
 }VOAMRWBFRAMETYPE;
 
 
-#define    VO_PID_AMRWB_Module							0x42261000 
+#define    VO_PID_AMRWB_Module							0x42261000
 #define    VO_PID_AMRWB_FORMAT                          (VO_PID_AMRWB_Module | 0x0002)
 #define    VO_PID_AMRWB_CHANNELS                        (VO_PID_AMRWB_Module | 0x0003)
 #define    VO_PID_AMRWB_SAMPLERATE                      (VO_PID_AMRWB_Module | 0x0004)
diff --git a/media/libstagefright/codecs/common/include/voAudio.h b/media/libstagefright/codecs/common/include/voAudio.h
index 21d0cf6..d8628ee 100644
--- a/media/libstagefright/codecs/common/include/voAudio.h
+++ b/media/libstagefright/codecs/common/include/voAudio.h
@@ -135,7 +135,7 @@
 	 * \param pOutInfo [OUT] The codec fills audio format and the input data size used in current call.
 	 *						 pOutInfo->InputUsed is total used input data size in byte.
 	 * \retval  VO_ERR_NONE Succeeded.
-	 *			VO_ERR_INPUT_BUFFER_SMALL. The input was finished or the input data was not enought. Continue to input 
+	 *			VO_ERR_INPUT_BUFFER_SMALL. The input was finished or the input data was not enought. Continue to input
 	 *										data before next call.
 	 */
 	VO_U32 (VO_API * GetOutputData) (VO_HANDLE hCodec, VO_CODECBUFFER * pOutBuffer, VO_AUDIO_OUTPUTINFO * pOutInfo);
diff --git a/media/libstagefright/codecs/common/include/voIndex.h b/media/libstagefright/codecs/common/include/voIndex.h
index a409a6e..320a2f8 100644
--- a/media/libstagefright/codecs/common/include/voIndex.h
+++ b/media/libstagefright/codecs/common/include/voIndex.h
@@ -173,7 +173,7 @@
 // Module own error ID
 #define VO_ERR_Module					0x8xxx0X00
 */
- 
+
 #define	VO_PID_COMMON_BASE				 0x40000000						/*!< The base of common param ID */
 #define	VO_PID_COMMON_QUERYMEM			(VO_PID_COMMON_BASE | 0X0001)	/*!< Query the memory needed; Reserved. */
 #define	VO_PID_COMMON_INPUTTYPE			(VO_PID_COMMON_BASE | 0X0002)	/*!< Set or get the input buffer type. VO_INPUT_TYPE */
diff --git a/media/libstagefright/colorconversion/ColorConverter.cpp b/media/libstagefright/colorconversion/ColorConverter.cpp
index 5cc3f78..f3ef3de 100644
--- a/media/libstagefright/colorconversion/ColorConverter.cpp
+++ b/media/libstagefright/colorconversion/ColorConverter.cpp
@@ -144,8 +144,8 @@
         return ERROR_UNSUPPORTED;
     }
 
-    uint32_t *dst_ptr = (uint32_t *)dst.mBits
-        + (dst.mCropTop * dst.mWidth + dst.mCropLeft) / 2;
+    uint16_t *dst_ptr = (uint16_t *)dst.mBits
+        + dst.mCropTop * dst.mWidth + dst.mCropLeft;
 
     const uint8_t *src_ptr = (const uint8_t *)src.mBits
         + (src.mCropTop * dst.mWidth + src.mCropLeft) * 2;
@@ -182,11 +182,15 @@
                 | ((kAdjustedClip[g2] >> 2) << 5)
                 | (kAdjustedClip[b2] >> 3);
 
-            dst_ptr[x / 2] = (rgb2 << 16) | rgb1;
+            if (x + 1 < src.cropWidth()) {
+                *(uint32_t *)(&dst_ptr[x]) = (rgb2 << 16) | rgb1;
+            } else {
+                dst_ptr[x] = rgb1;
+            }
         }
 
         src_ptr += src.mWidth * 2;
-        dst_ptr += dst.mWidth / 2;
+        dst_ptr += dst.mWidth;
     }
 
     return OK;
@@ -290,15 +294,14 @@
         const BitmapParams &src, const BitmapParams &dst) {
     uint8_t *kAdjustedClip = initClip();
 
-    if (!((dst.mWidth & 3) == 0
-            && (src.mCropLeft & 1) == 0
+    if (!((src.mCropLeft & 1) == 0
             && src.cropWidth() == dst.cropWidth()
             && src.cropHeight() == dst.cropHeight())) {
         return ERROR_UNSUPPORTED;
     }
 
-    uint32_t *dst_ptr = (uint32_t *)dst.mBits
-        + (dst.mCropTop * dst.mWidth + dst.mCropLeft) / 2;
+    uint16_t *dst_ptr = (uint16_t *)dst.mBits
+        + dst.mCropTop * dst.mWidth + dst.mCropLeft;
 
     const uint8_t *src_y =
         (const uint8_t *)src.mBits + src.mCropTop * src.mWidth + src.mCropLeft;
@@ -340,7 +343,11 @@
                 | ((kAdjustedClip[g2] >> 2) << 5)
                 | (kAdjustedClip[r2] >> 3);
 
-            dst_ptr[x / 2] = (rgb2 << 16) | rgb1;
+            if (x + 1 < src.cropWidth()) {
+                *(uint32_t *)(&dst_ptr[x]) = (rgb2 << 16) | rgb1;
+            } else {
+                dst_ptr[x] = rgb1;
+            }
         }
 
         src_y += src.mWidth;
@@ -349,7 +356,7 @@
             src_u += src.mWidth;
         }
 
-        dst_ptr += dst.mWidth / 2;
+        dst_ptr += dst.mWidth;
     }
 
     return OK;
@@ -361,15 +368,14 @@
 
     uint8_t *kAdjustedClip = initClip();
 
-    if (!((dst.mWidth & 3) == 0
-            && (src.mCropLeft & 1) == 0
+    if (!((src.mCropLeft & 1) == 0
             && src.cropWidth() == dst.cropWidth()
             && src.cropHeight() == dst.cropHeight())) {
         return ERROR_UNSUPPORTED;
     }
 
-    uint32_t *dst_ptr = (uint32_t *)dst.mBits
-        + (dst.mCropTop * dst.mWidth + dst.mCropLeft) / 2;
+    uint16_t *dst_ptr = (uint16_t *)dst.mBits
+        + dst.mCropTop * dst.mWidth + dst.mCropLeft;
 
     const uint8_t *src_y =
         (const uint8_t *)src.mBits + src.mCropTop * src.mWidth + src.mCropLeft;
@@ -411,7 +417,11 @@
                 | ((kAdjustedClip[g2] >> 2) << 5)
                 | (kAdjustedClip[r2] >> 3);
 
-            dst_ptr[x / 2] = (rgb2 << 16) | rgb1;
+            if (x + 1 < src.cropWidth()) {
+                *(uint32_t *)(&dst_ptr[x]) = (rgb2 << 16) | rgb1;
+            } else {
+                dst_ptr[x] = rgb1;
+            }
         }
 
         src_y += src.mWidth;
@@ -420,7 +430,7 @@
             src_u += src.mWidth;
         }
 
-        dst_ptr += dst.mWidth / 2;
+        dst_ptr += dst.mWidth;
     }
 
     return OK;
@@ -430,15 +440,14 @@
         const BitmapParams &src, const BitmapParams &dst) {
     uint8_t *kAdjustedClip = initClip();
 
-    if (!((dst.mWidth & 3) == 0
-            && (src.mCropLeft & 1) == 0
+    if (!((src.mCropLeft & 1) == 0
             && src.cropWidth() == dst.cropWidth()
             && src.cropHeight() == dst.cropHeight())) {
         return ERROR_UNSUPPORTED;
     }
 
-    uint32_t *dst_ptr = (uint32_t *)dst.mBits
-        + (dst.mCropTop * dst.mWidth + dst.mCropLeft) / 2;
+    uint16_t *dst_ptr = (uint16_t *)dst.mBits
+        + dst.mCropTop * dst.mWidth + dst.mCropLeft;
 
     const uint8_t *src_y = (const uint8_t *)src.mBits;
 
@@ -478,7 +487,11 @@
                 | ((kAdjustedClip[g2] >> 2) << 5)
                 | (kAdjustedClip[b2] >> 3);
 
-            dst_ptr[x / 2] = (rgb2 << 16) | rgb1;
+            if (x + 1 < src.cropWidth()) {
+                *(uint32_t *)(&dst_ptr[x]) = (rgb2 << 16) | rgb1;
+            } else {
+                dst_ptr[x] = rgb1;
+            }
         }
 
         src_y += src.mWidth;
@@ -487,7 +500,7 @@
             src_u += src.mWidth;
         }
 
-        dst_ptr += dst.mWidth / 2;
+        dst_ptr += dst.mWidth;
     }
 
     return OK;
diff --git a/media/libstagefright/include/AwesomePlayer.h b/media/libstagefright/include/AwesomePlayer.h
index 0985f47..a7a3d47 100644
--- a/media/libstagefright/include/AwesomePlayer.h
+++ b/media/libstagefright/include/AwesomePlayer.h
@@ -41,7 +41,7 @@
 class DrmManagerClinet;
 class DecryptHandle;
 
-class TimedTextPlayer;
+class TimedTextDriver;
 struct WVMExtractor;
 
 struct AwesomeRenderer : public RefBase {
@@ -232,7 +232,7 @@
     sp<DecryptHandle> mDecryptHandle;
 
     int64_t mLastVideoTimeUs;
-    TimedTextPlayer *mTextPlayer;
+    TimedTextDriver *mTextDriver;
     mutable Mutex mTimedTextLock;
 
     sp<WVMExtractor> mWVMExtractor;
@@ -290,6 +290,7 @@
 
     bool isStreamingHTTP() const;
     void sendCacheStats();
+    void checkDrmStatus(const sp<DataSource>& dataSource);
 
     enum FlagMode {
         SET,
@@ -325,4 +326,3 @@
 }  // namespace android
 
 #endif  // AWESOME_PLAYER_H_
-
diff --git a/media/libstagefright/include/ChromiumHTTPDataSource.h b/media/libstagefright/include/ChromiumHTTPDataSource.h
index 18f8913..82e08fd 100644
--- a/media/libstagefright/include/ChromiumHTTPDataSource.h
+++ b/media/libstagefright/include/ChromiumHTTPDataSource.h
@@ -43,7 +43,7 @@
     virtual status_t getSize(off64_t *size);
     virtual uint32_t flags();
 
-    virtual sp<DecryptHandle> DrmInitialization();
+    virtual sp<DecryptHandle> DrmInitialization(const char *mime);
 
     virtual void getDrmInfo(sp<DecryptHandle> &handle, DrmManagerClient **client);
 
diff --git a/media/libstagefright/include/NuCachedSource2.h b/media/libstagefright/include/NuCachedSource2.h
index 7a03e7e..c27a29b 100644
--- a/media/libstagefright/include/NuCachedSource2.h
+++ b/media/libstagefright/include/NuCachedSource2.h
@@ -40,7 +40,7 @@
     virtual status_t getSize(off64_t *size);
     virtual uint32_t flags();
 
-    virtual sp<DecryptHandle> DrmInitialization();
+    virtual sp<DecryptHandle> DrmInitialization(const char* mime);
     virtual void getDrmInfo(sp<DecryptHandle> &handle, DrmManagerClient **client);
     virtual String8 getUri();
 
diff --git a/media/libstagefright/include/OMX.h b/media/libstagefright/include/OMX.h
index 53e764f..2c87b34 100644
--- a/media/libstagefright/include/OMX.h
+++ b/media/libstagefright/include/OMX.h
@@ -31,7 +31,7 @@
 public:
     OMX();
 
-    virtual bool livesLocally(pid_t pid);
+    virtual bool livesLocally(node_id node, pid_t pid);
 
     virtual status_t listNodes(List<ComponentInfo> *list);
 
diff --git a/media/libstagefright/include/ThrottledSource.h b/media/libstagefright/include/ThrottledSource.h
index 8928a4a..7fe7c06 100644
--- a/media/libstagefright/include/ThrottledSource.h
+++ b/media/libstagefright/include/ThrottledSource.h
@@ -35,6 +35,11 @@
     virtual status_t getSize(off64_t *size);
     virtual uint32_t flags();
 
+    virtual String8 getMIMEType() const {
+        return mSource->getMIMEType();
+    }
+
+
 private:
     Mutex mLock;
 
diff --git a/media/libstagefright/include/WVMExtractor.h b/media/libstagefright/include/WVMExtractor.h
index deecd25..9f763f9 100644
--- a/media/libstagefright/include/WVMExtractor.h
+++ b/media/libstagefright/include/WVMExtractor.h
@@ -23,6 +23,8 @@
 
 namespace android {
 
+struct AMessage;
+class String8;
 class DataSource;
 
 class WVMLoadableExtractor : public MediaExtractor {
@@ -58,6 +60,8 @@
     // is used.
     void setAdaptiveStreamingMode(bool adaptive);
 
+    static bool getVendorLibHandle();
+
 protected:
     virtual ~WVMExtractor();
 
@@ -69,6 +73,10 @@
     WVMExtractor &operator=(const WVMExtractor &);
 };
 
+bool SniffWVM(
+        const sp<DataSource> &source, String8 *mimeType, float *confidence,
+        sp<AMessage> *);
+
 }  // namespace android
 
 #endif  // DRM_EXTRACTOR_H_
diff --git a/media/libstagefright/matroska/MatroskaExtractor.cpp b/media/libstagefright/matroska/MatroskaExtractor.cpp
index 4fbf47e..a1644d2 100644
--- a/media/libstagefright/matroska/MatroskaExtractor.cpp
+++ b/media/libstagefright/matroska/MatroskaExtractor.cpp
@@ -610,36 +610,41 @@
     return mIsLiveStreaming;
 }
 
-static void addESDSFromAudioSpecificInfo(
-        const sp<MetaData> &meta, const void *asi, size_t asiSize) {
+static void addESDSFromCodecPrivate(
+        const sp<MetaData> &meta,
+        bool isAudio, const void *priv, size_t privSize) {
     static const uint8_t kStaticESDS[] = {
         0x03, 22,
         0x00, 0x00,     // ES_ID
         0x00,           // streamDependenceFlag, URL_Flag, OCRstreamFlag
 
         0x04, 17,
-        0x40,                       // Audio ISO/IEC 14496-3
+        0x40,           // ObjectTypeIndication
         0x00, 0x00, 0x00, 0x00,
         0x00, 0x00, 0x00, 0x00,
         0x00, 0x00, 0x00, 0x00,
 
         0x05,
-        // AudioSpecificInfo (with size prefix) follows
+        // CodecSpecificInfo (with size prefix) follows
     };
 
     // Make sure all sizes can be coded in a single byte.
-    CHECK(asiSize + 22 - 2 < 128);
-    size_t esdsSize = sizeof(kStaticESDS) + asiSize + 1;
+    CHECK(privSize + 22 - 2 < 128);
+    size_t esdsSize = sizeof(kStaticESDS) + privSize + 1;
     uint8_t *esds = new uint8_t[esdsSize];
     memcpy(esds, kStaticESDS, sizeof(kStaticESDS));
     uint8_t *ptr = esds + sizeof(kStaticESDS);
-    *ptr++ = asiSize;
-    memcpy(ptr, asi, asiSize);
+    *ptr++ = privSize;
+    memcpy(ptr, priv, privSize);
 
     // Increment by codecPrivateSize less 2 bytes that are accounted for
     // already in lengths of 22/17
-    esds[1] += asiSize - 2;
-    esds[6] += asiSize - 2;
+    esds[1] += privSize - 2;
+    esds[6] += privSize - 2;
+
+    // Set ObjectTypeIndication.
+    esds[7] = isAudio ? 0x40   // Audio ISO/IEC 14496-3
+                      : 0x20;  // Visual ISO/IEC 14496-2
 
     meta->setData(kKeyESDS, 0, esds, esdsSize);
 
@@ -707,9 +712,21 @@
                 if (!strcmp("V_MPEG4/ISO/AVC", codecID)) {
                     meta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_VIDEO_AVC);
                     meta->setData(kKeyAVCC, 0, codecPrivate, codecPrivateSize);
+                } else if (!strcmp("V_MPEG4/ISO/ASP", codecID)) {
+                    if (codecPrivateSize > 0) {
+                        meta->setCString(
+                                kKeyMIMEType, MEDIA_MIMETYPE_VIDEO_MPEG4);
+                        addESDSFromCodecPrivate(
+                                meta, false, codecPrivate, codecPrivateSize);
+                    } else {
+                        ALOGW("%s is detected, but does not have configuration.",
+                                codecID);
+                        continue;
+                    }
                 } else if (!strcmp("V_VP8", codecID)) {
                     meta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_VIDEO_VPX);
                 } else {
+                    ALOGW("%s is not supported.", codecID);
                     continue;
                 }
 
@@ -727,13 +744,16 @@
                     meta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_AUDIO_AAC);
                     CHECK(codecPrivateSize >= 2);
 
-                    addESDSFromAudioSpecificInfo(
-                            meta, codecPrivate, codecPrivateSize);
+                    addESDSFromCodecPrivate(
+                            meta, true, codecPrivate, codecPrivateSize);
                 } else if (!strcmp("A_VORBIS", codecID)) {
                     meta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_AUDIO_VORBIS);
 
                     addVorbisCodecInfo(meta, codecPrivate, codecPrivateSize);
+                } else if (!strcmp("A_MPEG/L3", codecID)) {
+                    meta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_AUDIO_MPEG);
                 } else {
+                    ALOGW("%s is not supported.", codecID);
                     continue;
                 }
 
diff --git a/media/libstagefright/omx/OMX.cpp b/media/libstagefright/omx/OMX.cpp
index 694b12d8..ace883c 100644
--- a/media/libstagefright/omx/OMX.cpp
+++ b/media/libstagefright/omx/OMX.cpp
@@ -185,7 +185,7 @@
     instance->onObserverDied(mMaster);
 }
 
-bool OMX::livesLocally(pid_t pid) {
+bool OMX::livesLocally(node_id node, pid_t pid) {
     return pid == getpid();
 }
 
diff --git a/media/libstagefright/omx/SimpleSoftOMXComponent.cpp b/media/libstagefright/omx/SimpleSoftOMXComponent.cpp
index 0914f32..c79e01f 100644
--- a/media/libstagefright/omx/SimpleSoftOMXComponent.cpp
+++ b/media/libstagefright/omx/SimpleSoftOMXComponent.cpp
@@ -333,8 +333,9 @@
 
 void SimpleSoftOMXComponent::onMessageReceived(const sp<AMessage> &msg) {
     Mutex::Autolock autoLock(mLock);
-
-    switch (msg->what()) {
+    uint32_t msgType = msg->what();
+    ALOGV("msgType = %d", msgType);
+    switch (msgType) {
         case kWhatSendCommand:
         {
             int32_t cmd, param;
@@ -354,27 +355,27 @@
             CHECK(mState == OMX_StateExecuting && mTargetState == mState);
 
             bool found = false;
-            for (size_t i = 0; i < mPorts.size(); ++i) {
-                PortInfo *port = &mPorts.editItemAt(i);
+            size_t portIndex = (kWhatEmptyThisBuffer == msgType)?
+                    header->nInputPortIndex: header->nOutputPortIndex;
+            PortInfo *port = &mPorts.editItemAt(portIndex);
 
-                for (size_t j = 0; j < port->mBuffers.size(); ++j) {
-                    BufferInfo *buffer = &port->mBuffers.editItemAt(j);
+            for (size_t j = 0; j < port->mBuffers.size(); ++j) {
+                BufferInfo *buffer = &port->mBuffers.editItemAt(j);
 
-                    if (buffer->mHeader == header) {
-                        CHECK(!buffer->mOwnedByUs);
+                if (buffer->mHeader == header) {
+                    CHECK(!buffer->mOwnedByUs);
 
-                        buffer->mOwnedByUs = true;
+                    buffer->mOwnedByUs = true;
 
-                        CHECK((msg->what() == kWhatEmptyThisBuffer
-                                    && port->mDef.eDir == OMX_DirInput)
-                                || (port->mDef.eDir == OMX_DirOutput));
+                    CHECK((msgType == kWhatEmptyThisBuffer
+                            && port->mDef.eDir == OMX_DirInput)
+                            || (port->mDef.eDir == OMX_DirOutput));
 
-                        port->mQueue.push_back(buffer);
-                        onQueueFilled(i);
+                    port->mQueue.push_back(buffer);
+                    onQueueFilled(portIndex);
 
-                        found = true;
-                        break;
-                    }
+                    found = true;
+                    break;
                 }
             }
 
diff --git a/media/libstagefright/omx/SoftOMXPlugin.cpp b/media/libstagefright/omx/SoftOMXPlugin.cpp
index da3ae42..99ffe7d 100644
--- a/media/libstagefright/omx/SoftOMXPlugin.cpp
+++ b/media/libstagefright/omx/SoftOMXPlugin.cpp
@@ -35,8 +35,11 @@
 
 } kComponents[] = {
     { "OMX.google.aac.decoder", "aacdec", "audio_decoder.aac" },
+    { "OMX.google.aac.encoder", "aacenc", "audio_encoder.aac" },
     { "OMX.google.amrnb.decoder", "amrdec", "audio_decoder.amrnb" },
+    { "OMX.google.amrnb.encoder", "amrnbenc", "audio_encoder.amrnb" },
     { "OMX.google.amrwb.decoder", "amrdec", "audio_decoder.amrwb" },
+    { "OMX.google.amrwb.encoder", "amrwbenc", "audio_encoder.amrwb" },
     { "OMX.google.h264.decoder", "h264dec", "video_decoder.avc" },
     { "OMX.google.g711.alaw.decoder", "g711dec", "audio_decoder.g711alaw" },
     { "OMX.google.g711.mlaw.decoder", "g711dec", "audio_decoder.g711mlaw" },
diff --git a/media/libstagefright/omx/tests/Android.mk b/media/libstagefright/omx/tests/Android.mk
index bf69428..41c08be 100644
--- a/media/libstagefright/omx/tests/Android.mk
+++ b/media/libstagefright/omx/tests/Android.mk
@@ -7,11 +7,13 @@
 LOCAL_SHARED_LIBRARIES := \
 	libstagefright libbinder libmedia libutils
 
-LOCAL_C_INCLUDES:= \
+LOCAL_C_INCLUDES := \
 	$(JNI_H_INCLUDE) \
 	frameworks/base/media/libstagefright \
 	$(TOP)/frameworks/base/include/media/stagefright/openmax
 
-LOCAL_MODULE:= omx_tests
+LOCAL_MODULE := omx_tests
+
+LOCAL_MODULE_TAGS := tests
 
 include $(BUILD_EXECUTABLE)
diff --git a/media/libstagefright/rtsp/MyHandler.h b/media/libstagefright/rtsp/MyHandler.h
index 2391c5c..9a7dd70 100644
--- a/media/libstagefright/rtsp/MyHandler.h
+++ b/media/libstagefright/rtsp/MyHandler.h
@@ -122,6 +122,7 @@
           mSetupTracksSuccessful(false),
           mSeekPending(false),
           mFirstAccessUnit(true),
+          mAllTracksHaveTime(false),
           mNTPAnchorUs(-1),
           mMediaAnchorUs(-1),
           mLastMediaTimeUs(0),
@@ -723,6 +724,7 @@
                 mSetupTracksSuccessful = false;
                 mSeekPending = false;
                 mFirstAccessUnit = true;
+                mAllTracksHaveTime = false;
                 mNTPAnchorUs = -1;
                 mMediaAnchorUs = -1;
                 mNumAccessUnitsReceived = 0;
@@ -930,6 +932,7 @@
                     info->mNTPAnchorUs = -1;
                 }
 
+                mAllTracksHaveTime = false;
                 mNTPAnchorUs = -1;
 
                 int64_t timeUs;
@@ -1037,6 +1040,14 @@
                         ALOGW("Never received any data, disconnecting.");
                         (new AMessage('abor', id()))->post();
                     }
+                } else {
+                    if (!mAllTracksHaveTime) {
+                        ALOGW("We received some RTCP packets, but time "
+                              "could not be established on all tracks, now "
+                              "using fake timestamps");
+
+                        fakeTimestamps();
+                    }
                 }
                 break;
             }
@@ -1211,6 +1222,7 @@
     bool mSeekPending;
     bool mFirstAccessUnit;
 
+    bool mAllTracksHaveTime;
     int64_t mNTPAnchorUs;
     int64_t mMediaAnchorUs;
     int64_t mLastMediaTimeUs;
@@ -1357,6 +1369,7 @@
     }
 
     void fakeTimestamps() {
+        mNTPAnchorUs = -1ll;
         for (size_t i = 0; i < mTracks.size(); ++i) {
             onTimeUpdate(i, 0, 0ll);
         }
@@ -1377,6 +1390,21 @@
             mNTPAnchorUs = ntpTimeUs;
             mMediaAnchorUs = mLastMediaTimeUs;
         }
+
+        if (!mAllTracksHaveTime) {
+            bool allTracksHaveTime = true;
+            for (size_t i = 0; i < mTracks.size(); ++i) {
+                TrackInfo *track = &mTracks.editItemAt(i);
+                if (track->mNTPAnchorUs < 0) {
+                    allTracksHaveTime = false;
+                    break;
+                }
+            }
+            if (allTracksHaveTime) {
+                mAllTracksHaveTime = true;
+                ALOGI("Time now established for all tracks.");
+            }
+        }
     }
 
     void onAccessUnitComplete(
@@ -1403,7 +1431,7 @@
 
         TrackInfo *track = &mTracks.editItemAt(trackIndex);
 
-        if (mNTPAnchorUs < 0 || mMediaAnchorUs < 0 || track->mNTPAnchorUs < 0) {
+        if (!mAllTracksHaveTime) {
             ALOGV("storing accessUnit, no time established yet");
             track->mPackets.push_back(accessUnit);
             return;
diff --git a/media/libstagefright/timedtext/Android.mk b/media/libstagefright/timedtext/Android.mk
index 59d0e15..8b23dee 100644
--- a/media/libstagefright/timedtext/Android.mk
+++ b/media/libstagefright/timedtext/Android.mk
@@ -3,7 +3,10 @@
 
 LOCAL_SRC_FILES:=                 \
         TextDescriptions.cpp      \
-        TimedTextParser.cpp       \
+        TimedTextDriver.cpp       \
+        TimedTextInBandSource.cpp \
+        TimedTextSource.cpp       \
+        TimedTextSRTSource.cpp    \
         TimedTextPlayer.cpp
 
 LOCAL_CFLAGS += -Wno-multichar
diff --git a/media/libstagefright/timedtext/TimedTextDriver.cpp b/media/libstagefright/timedtext/TimedTextDriver.cpp
new file mode 100644
index 0000000..9ec9415
--- /dev/null
+++ b/media/libstagefright/timedtext/TimedTextDriver.cpp
@@ -0,0 +1,223 @@
+ /*
+ * 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.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "TimedTextDriver"
+#include <utils/Log.h>
+
+#include <binder/IPCThreadState.h>
+
+#include <media/MediaPlayerInterface.h>
+#include <media/stagefright/MediaErrors.h>
+#include <media/stagefright/MediaSource.h>
+#include <media/stagefright/DataSource.h>
+#include <media/stagefright/Utils.h>
+#include <media/stagefright/foundation/ADebug.h>
+#include <media/stagefright/foundation/ALooper.h>
+
+#include "TimedTextDriver.h"
+
+#include "TextDescriptions.h"
+#include "TimedTextPlayer.h"
+#include "TimedTextSource.h"
+
+namespace android {
+
+TimedTextDriver::TimedTextDriver(
+        const wp<MediaPlayerBase> &listener)
+    : mLooper(new ALooper),
+      mListener(listener),
+      mState(UNINITIALIZED) {
+    mLooper->setName("TimedTextDriver");
+    mLooper->start();
+    mPlayer = new TimedTextPlayer(listener);
+    mLooper->registerHandler(mPlayer);
+}
+
+TimedTextDriver::~TimedTextDriver() {
+    mTextInBandVector.clear();
+    mTextOutOfBandVector.clear();
+    mLooper->stop();
+}
+
+status_t TimedTextDriver::setTimedTextTrackIndex_l(int32_t index) {
+    if (index >=
+            (int)(mTextInBandVector.size() + mTextOutOfBandVector.size())) {
+        return BAD_VALUE;
+    }
+
+    sp<TimedTextSource> source;
+    if (index < mTextInBandVector.size()) {
+        source = mTextInBandVector.itemAt(index);
+    } else {
+        source = mTextOutOfBandVector.itemAt(index - mTextInBandVector.size());
+    }
+    mPlayer->setDataSource(source);
+    return OK;
+}
+
+status_t TimedTextDriver::start() {
+    Mutex::Autolock autoLock(mLock);
+    switch (mState) {
+        case UNINITIALIZED:
+            return INVALID_OPERATION;
+        case STOPPED:
+            mPlayer->start();
+            break;
+        case PLAYING:
+            return OK;
+        case PAUSED:
+            mPlayer->resume();
+            break;
+        default:
+            TRESPASS();
+    }
+    mState = PLAYING;
+    return OK;
+}
+
+status_t TimedTextDriver::stop() {
+    return pause();
+}
+
+// TODO: Test if pause() works properly.
+// Scenario 1: start - pause - resume
+// Scenario 2: start - seek
+// Scenario 3: start - pause - seek - resume
+status_t TimedTextDriver::pause() {
+    Mutex::Autolock autoLock(mLock);
+    switch (mState) {
+        case UNINITIALIZED:
+            return INVALID_OPERATION;
+        case STOPPED:
+            return OK;
+        case PLAYING:
+            mPlayer->pause();
+            break;
+        case PAUSED:
+            return OK;
+        default:
+            TRESPASS();
+    }
+    mState = PAUSED;
+    return OK;
+}
+
+status_t TimedTextDriver::resume() {
+    return start();
+}
+
+status_t TimedTextDriver::seekToAsync(int64_t timeUs) {
+    mPlayer->seekToAsync(timeUs);
+    return OK;
+}
+
+status_t TimedTextDriver::setTimedTextTrackIndex(int32_t index) {
+    // TODO: This is current implementation for MediaPlayer::disableTimedText().
+    // Find better way for readability.
+    if (index < 0) {
+        mPlayer->pause();
+        return OK;
+    }
+
+    status_t ret = OK;
+    Mutex::Autolock autoLock(mLock);
+    switch (mState) {
+        case UNINITIALIZED:
+            ret = INVALID_OPERATION;
+            break;
+        case PAUSED:
+            ret = setTimedTextTrackIndex_l(index);
+            break;
+        case PLAYING:
+            mPlayer->pause();
+            ret = setTimedTextTrackIndex_l(index);
+            if (ret != OK) {
+                break;
+            }
+            mPlayer->start();
+            break;
+        case STOPPED:
+            // TODO: The only difference between STOPPED and PAUSED is this
+            // part. Revise the flow from "MediaPlayer::enableTimedText()" and
+            // remove one of the status, PAUSED and STOPPED, if possible.
+            ret = setTimedTextTrackIndex_l(index);
+            if (ret != OK) {
+                break;
+            }
+            mPlayer->start();
+            break;
+        defaut:
+            TRESPASS();
+    }
+    return ret;
+}
+
+status_t TimedTextDriver::addInBandTextSource(
+        const sp<MediaSource>& mediaSource) {
+    sp<TimedTextSource> source =
+            TimedTextSource::CreateTimedTextSource(mediaSource);
+    if (source == NULL) {
+        return ERROR_UNSUPPORTED;
+    }
+    Mutex::Autolock autoLock(mLock);
+    mTextInBandVector.add(source);
+    if (mState == UNINITIALIZED) {
+        mState = STOPPED;
+    }
+    return OK;
+}
+
+status_t TimedTextDriver::addOutOfBandTextSource(
+        const Parcel &request) {
+    // TODO: Define "TimedTextSource::CreateFromURI(uri)"
+    // and move below lines there..?
+
+    // String values written in Parcel are UTF-16 values.
+    const String16 uri16 = request.readString16();
+    String8 uri = String8(request.readString16());
+
+    uri.toLower();
+    // To support local subtitle file only for now
+    if (strncasecmp("file://", uri.string(), 7)) {
+        return ERROR_UNSUPPORTED;
+    }
+    sp<DataSource> dataSource =
+            DataSource::CreateFromURI(uri);
+    if (dataSource == NULL) {
+        return ERROR_UNSUPPORTED;
+    }
+
+    sp<TimedTextSource> source;
+    if (uri.getPathExtension() == String8(".srt")) {
+        source = TimedTextSource::CreateTimedTextSource(
+                dataSource, TimedTextSource::OUT_OF_BAND_FILE_SRT);
+    }
+
+    if (source == NULL) {
+        return ERROR_UNSUPPORTED;
+    }
+
+    Mutex::Autolock autoLock(mLock);
+
+    mTextOutOfBandVector.add(source);
+    if (mState == UNINITIALIZED) {
+        mState = STOPPED;
+    }
+    return OK;
+}
+
+}  // namespace android
diff --git a/media/libstagefright/timedtext/TimedTextDriver.h b/media/libstagefright/timedtext/TimedTextDriver.h
new file mode 100644
index 0000000..efedb6e
--- /dev/null
+++ b/media/libstagefright/timedtext/TimedTextDriver.h
@@ -0,0 +1,81 @@
+/*
+ * 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.
+ */
+
+#ifndef TIMED_TEXT_DRIVER_H_
+#define TIMED_TEXT_DRIVER_H_
+
+#include <media/stagefright/foundation/ABase.h> // for DISALLOW_* macro
+#include <utils/Errors.h> // for status_t
+#include <utils/RefBase.h>
+#include <utils/threads.h>
+
+namespace android {
+
+class ALooper;
+class MediaPlayerBase;
+class MediaSource;
+class Parcel;
+class TimedTextPlayer;
+class TimedTextSource;
+
+class TimedTextDriver {
+public:
+    TimedTextDriver(const wp<MediaPlayerBase> &listener);
+
+    ~TimedTextDriver();
+
+    // TODO: pause-resume pair seems equivalent to stop-start pair.
+    // Check if it is replaceable with stop-start.
+    status_t start();
+    status_t stop();
+    status_t pause();
+    status_t resume();
+
+    status_t seekToAsync(int64_t timeUs);
+
+    status_t addInBandTextSource(const sp<MediaSource>& source);
+    status_t addOutOfBandTextSource(const Parcel &request);
+
+    status_t setTimedTextTrackIndex(int32_t index);
+
+private:
+    Mutex mLock;
+
+    enum State {
+        UNINITIALIZED,
+        STOPPED,
+        PLAYING,
+        PAUSED,
+    };
+
+    sp<ALooper> mLooper;
+    sp<TimedTextPlayer> mPlayer;
+    wp<MediaPlayerBase> mListener;
+
+    // Variables to be guarded by mLock.
+    State mState;
+    Vector<sp<TimedTextSource> > mTextInBandVector;
+    Vector<sp<TimedTextSource> > mTextOutOfBandVector;
+    // -- End of variables to be guarded by mLock
+
+    status_t setTimedTextTrackIndex_l(int32_t index);
+
+    DISALLOW_EVIL_CONSTRUCTORS(TimedTextDriver);
+};
+
+}  // namespace android
+
+#endif  // TIMED_TEXT_DRIVER_H_
diff --git a/media/libstagefright/timedtext/TimedTextInBandSource.cpp b/media/libstagefright/timedtext/TimedTextInBandSource.cpp
new file mode 100644
index 0000000..f2c4d54
--- /dev/null
+++ b/media/libstagefright/timedtext/TimedTextInBandSource.cpp
@@ -0,0 +1,118 @@
+ /*
+ * 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.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "TimedTextInBandSource"
+#include <utils/Log.h>
+
+#include <binder/Parcel.h>
+#include <media/stagefright/MediaBuffer.h>
+#include <media/stagefright/MediaDebug.h>  // CHECK_XX macro
+#include <media/stagefright/MediaDefs.h>  // for MEDIA_MIMETYPE_xxx
+#include <media/stagefright/MediaErrors.h>
+#include <media/stagefright/MediaSource.h>
+#include <media/stagefright/MetaData.h>
+
+#include "TimedTextInBandSource.h"
+#include "TextDescriptions.h"
+
+namespace android {
+
+TimedTextInBandSource::TimedTextInBandSource(const sp<MediaSource>& mediaSource)
+    : mSource(mediaSource) {
+}
+
+TimedTextInBandSource::~TimedTextInBandSource() {
+}
+
+status_t TimedTextInBandSource::read(
+        int64_t *timeUs, Parcel *parcel, const MediaSource::ReadOptions *options) {
+    MediaBuffer *textBuffer = NULL;
+    status_t err = mSource->read(&textBuffer, options);
+    if (err != OK) {
+        return err;
+    }
+    CHECK(textBuffer != NULL);
+    textBuffer->meta_data()->findInt64(kKeyTime, timeUs);
+    // TODO: this is legacy code. when 'timeUs' can be <= 0?
+    if (*timeUs > 0) {
+        extractAndAppendLocalDescriptions(*timeUs, textBuffer, parcel);
+    }
+    textBuffer->release();
+    return OK;
+}
+
+// Each text sample consists of a string of text, optionally with sample
+// modifier description. The modifier description could specify a new
+// text style for the string of text. These descriptions are present only
+// if they are needed. This method is used to extract the modifier
+// description and append it at the end of the text.
+status_t TimedTextInBandSource::extractAndAppendLocalDescriptions(
+        int64_t timeUs, const MediaBuffer *textBuffer, Parcel *parcel) {
+    const void *data;
+    size_t size = 0;
+    int32_t flag = TextDescriptions::LOCAL_DESCRIPTIONS;
+
+    const char *mime;
+    CHECK(mSource->getFormat()->findCString(kKeyMIMEType, &mime));
+
+    if (strcasecmp(mime, MEDIA_MIMETYPE_TEXT_3GPP) == 0) {
+        data = textBuffer->data();
+        size = textBuffer->size();
+
+        if (size > 0) {
+            parcel->freeData();
+            flag |= TextDescriptions::IN_BAND_TEXT_3GPP;
+            return TextDescriptions::getParcelOfDescriptions(
+                    (const uint8_t *)data, size, flag, timeUs / 1000, parcel);
+        }
+        return OK;
+    }
+    return ERROR_UNSUPPORTED;
+}
+
+// To extract and send the global text descriptions for all the text samples
+// in the text track or text file.
+// TODO: send error message to application via notifyListener()...?
+status_t TimedTextInBandSource::extractGlobalDescriptions(Parcel *parcel) {
+    const void *data;
+    size_t size = 0;
+    int32_t flag = TextDescriptions::GLOBAL_DESCRIPTIONS;
+
+    const char *mime;
+    CHECK(mSource->getFormat()->findCString(kKeyMIMEType, &mime));
+
+    // support 3GPP only for now
+    if (strcasecmp(mime, MEDIA_MIMETYPE_TEXT_3GPP) == 0) {
+        uint32_t type;
+        // get the 'tx3g' box content. This box contains the text descriptions
+        // used to render the text track
+        if (!mSource->getFormat()->findData(
+                kKeyTextFormatData, &type, &data, &size)) {
+            return ERROR_MALFORMED;
+        }
+
+        if (size > 0) {
+            flag |= TextDescriptions::IN_BAND_TEXT_3GPP;
+            return TextDescriptions::getParcelOfDescriptions(
+                    (const uint8_t *)data, size, flag, 0, parcel);
+        }
+        return OK;
+    }
+    return ERROR_UNSUPPORTED;
+}
+
+}  // namespace android
diff --git a/media/libstagefright/timedtext/TimedTextInBandSource.h b/media/libstagefright/timedtext/TimedTextInBandSource.h
new file mode 100644
index 0000000..26e5737
--- /dev/null
+++ b/media/libstagefright/timedtext/TimedTextInBandSource.h
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+
+#ifndef TIMED_TEXT_IN_BAND_SOURCE_H_
+#define TIMED_TEXT_IN_BAND_SOURCE_H_
+
+#include <media/stagefright/MediaErrors.h>
+#include <media/stagefright/MediaSource.h>
+
+#include "TimedTextSource.h"
+
+namespace android {
+
+class MediaBuffer;
+class Parcel;
+
+class TimedTextInBandSource : public TimedTextSource {
+ public:
+  TimedTextInBandSource(const sp<MediaSource>& mediaSource);
+  virtual status_t start() { return mSource->start(); }
+  virtual status_t stop() { return mSource->stop(); }
+  virtual status_t read(
+          int64_t *timeUs,
+          Parcel *parcel,
+          const MediaSource::ReadOptions *options = NULL);
+  virtual status_t extractGlobalDescriptions(Parcel *parcel);
+
+ protected:
+  virtual ~TimedTextInBandSource();
+
+ private:
+  sp<MediaSource> mSource;
+
+  status_t extractAndAppendLocalDescriptions(
+        int64_t timeUs, const MediaBuffer *textBuffer, Parcel *parcel);
+
+  DISALLOW_EVIL_CONSTRUCTORS(TimedTextInBandSource);
+};
+
+}  // namespace android
+
+#endif  // TIMED_TEXT_IN_BAND_SOURCE_H_
diff --git a/media/libstagefright/timedtext/TimedTextParser.cpp b/media/libstagefright/timedtext/TimedTextParser.cpp
deleted file mode 100644
index caea0a4..0000000
--- a/media/libstagefright/timedtext/TimedTextParser.cpp
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * 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.
- */
-
-#include "TimedTextParser.h"
-#include <media/stagefright/DataSource.h>
-
-namespace android {
-
-TimedTextParser::TimedTextParser()
-    : mDataSource(NULL),
-      mOffset(0),
-      mIndex(0) {
-}
-
-TimedTextParser::~TimedTextParser() {
-    reset();
-}
-
-status_t TimedTextParser::init(
-        const sp<DataSource> &dataSource, FileType fileType) {
-    mDataSource = dataSource;
-    mFileType = fileType;
-
-    status_t err;
-    if ((err = scanFile()) != OK) {
-        reset();
-        return err;
-    }
-
-    return OK;
-}
-
-void TimedTextParser::reset() {
-    mDataSource.clear();
-    mTextVector.clear();
-    mOffset = 0;
-    mIndex = 0;
-}
-
-// scan the text file to get start/stop time and the
-// offset of each piece of text content
-status_t TimedTextParser::scanFile() {
-    if (mFileType != OUT_OF_BAND_FILE_SRT) {
-        return ERROR_UNSUPPORTED;
-    }
-
-    off64_t offset = 0;
-    int64_t startTimeUs;
-    bool endOfFile = false;
-
-    while (!endOfFile) {
-        TextInfo info;
-        status_t err = getNextInSrtFileFormat(&offset, &startTimeUs, &info);
-
-        if (err != OK) {
-            if (err == ERROR_END_OF_STREAM) {
-                endOfFile = true;
-            } else {
-                return err;
-            }
-        } else {
-            mTextVector.add(startTimeUs, info);
-        }
-    }
-
-    if (mTextVector.isEmpty()) {
-        return ERROR_MALFORMED;
-    }
-    return OK;
-}
-
-// read one line started from *offset and store it into data.
-status_t TimedTextParser::readNextLine(off64_t *offset, AString *data) {
-    char character;
-
-    data->clear();
-
-    while (true) {
-        ssize_t err;
-        if ((err = mDataSource->readAt(*offset, &character, 1)) < 1) {
-            if (err == 0) {
-                return ERROR_END_OF_STREAM;
-            }
-            return ERROR_IO;
-        }
-
-        (*offset) ++;
-
-        // a line could end with CR, LF or CR + LF
-        if (character == 10) {
-            break;
-        } else if (character == 13) {
-            if ((err = mDataSource->readAt(*offset, &character, 1)) < 1) {
-                if (err == 0) { // end of the stream
-                    return OK;
-                }
-                return ERROR_IO;
-            }
-
-            (*offset) ++;
-
-            if (character != 10) {
-                (*offset) --;
-            }
-            break;
-        }
-
-        data->append(character);
-    }
-
-    return OK;
-}
-
-/* SRT format:
- *  Subtitle number
- *  Start time --> End time
- *  Text of subtitle (one or more lines)
- *  Blank lines
- *
- * .srt file example:
- *  1
- *  00:00:20,000 --> 00:00:24,400
- *  Altocumulus clouds occur between six thousand
- *
- *  2
- *  00:00:24,600 --> 00:00:27,800
- *  and twenty thousand feet above ground level.
- */
-status_t TimedTextParser::getNextInSrtFileFormat(
-        off64_t *offset, int64_t *startTimeUs, TextInfo *info) {
-    AString data;
-    status_t err;
-
-    // To skip blank lines.
-    do {
-        if ((err = readNextLine(offset, &data)) != OK) {
-            return err;
-        }
-        data.trim();
-    } while(data.empty());
-
-    // Just ignore the first non-blank line which is subtitle sequence number.
-
-    if ((err = readNextLine(offset, &data)) != OK) {
-        return err;
-    }
-    int hour1, hour2, min1, min2, sec1, sec2, msec1, msec2;
-    // the start time format is: hours:minutes:seconds,milliseconds
-    // 00:00:24,600 --> 00:00:27,800
-    if (sscanf(data.c_str(), "%02d:%02d:%02d,%03d --> %02d:%02d:%02d,%03d",
-                &hour1, &min1, &sec1, &msec1, &hour2, &min2, &sec2, &msec2) != 8) {
-        return ERROR_MALFORMED;
-    }
-
-    *startTimeUs = ((hour1 * 3600 + min1 * 60 + sec1) * 1000 + msec1) * 1000ll;
-    info->endTimeUs = ((hour2 * 3600 + min2 * 60 + sec2) * 1000 + msec2) * 1000ll;
-    if (info->endTimeUs <= *startTimeUs) {
-        return ERROR_MALFORMED;
-    }
-
-    info->offset = *offset;
-
-    bool needMoreData = true;
-    while (needMoreData) {
-        if ((err = readNextLine(offset, &data)) != OK) {
-            if (err == ERROR_END_OF_STREAM) {
-                needMoreData = false;
-            } else {
-                return err;
-            }
-        }
-
-        if (needMoreData) {
-            data.trim();
-            if (data.empty()) {
-                // it's an empty line used to separate two subtitles
-                needMoreData = false;
-            }
-        }
-    }
-
-    info->textLen = *offset - info->offset;
-
-    return OK;
-}
-
-status_t TimedTextParser::getText(
-        AString *text, int64_t *startTimeUs, int64_t *endTimeUs,
-        const MediaSource::ReadOptions *options) {
-    Mutex::Autolock autoLock(mLock);
-
-    text->clear();
-
-    int64_t seekTimeUs;
-    MediaSource::ReadOptions::SeekMode mode;
-    if (options && options->getSeekTo(&seekTimeUs, &mode)) {
-        int64_t lastEndTimeUs = mTextVector.valueAt(mTextVector.size() - 1).endTimeUs;
-        int64_t firstStartTimeUs = mTextVector.keyAt(0);
-
-        if (seekTimeUs < 0 || seekTimeUs > lastEndTimeUs) {
-            return ERROR_OUT_OF_RANGE;
-        } else if (seekTimeUs < firstStartTimeUs) {
-            mIndex = 0;
-        } else {
-            // binary search
-            ssize_t low = 0;
-            ssize_t high = mTextVector.size() - 1;
-            ssize_t mid = 0;
-            int64_t currTimeUs;
-
-            while (low <= high) {
-                mid = low + (high - low)/2;
-                currTimeUs = mTextVector.keyAt(mid);
-                const int diff = currTimeUs - seekTimeUs;
-
-                if (diff == 0) {
-                    break;
-                } else if (diff < 0) {
-                    low = mid + 1;
-                } else {
-                    if ((high == mid + 1)
-                            && (seekTimeUs < mTextVector.keyAt(high))) {
-                        break;
-                    }
-                    high = mid - 1;
-                }
-            }
-
-            mIndex = mid;
-        }
-    }
-
-    TextInfo info = mTextVector.valueAt(mIndex);
-    *startTimeUs = mTextVector.keyAt(mIndex);
-    *endTimeUs = info.endTimeUs;
-    mIndex ++;
-
-    char *str = new char[info.textLen];
-    if (mDataSource->readAt(info.offset, str, info.textLen) < info.textLen) {
-        delete[] str;
-        return ERROR_IO;
-    }
-
-    text->append(str, info.textLen);
-    delete[] str;
-    return OK;
-}
-
-}  // namespace android
diff --git a/media/libstagefright/timedtext/TimedTextParser.h b/media/libstagefright/timedtext/TimedTextParser.h
deleted file mode 100644
index 44774c2..0000000
--- a/media/libstagefright/timedtext/TimedTextParser.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef TIMED_TEXT_PARSER_H_
-
-#define TIMED_TEXT_PARSER_H_
-
-#include <media/MediaPlayerInterface.h>
-#include <media/stagefright/foundation/ABase.h>
-#include <media/stagefright/foundation/AString.h>
-#include <media/stagefright/MediaSource.h>
-
-namespace android {
-
-class DataSource;
-
-class TimedTextParser : public RefBase {
-public:
-    TimedTextParser();
-    virtual ~TimedTextParser();
-
-    enum FileType {
-        OUT_OF_BAND_FILE_SRT = 1,
-    };
-
-    status_t getText(AString *text, int64_t *startTimeUs, int64_t *endTimeUs,
-                     const MediaSource::ReadOptions *options = NULL);
-    status_t init(const sp<DataSource> &dataSource, FileType fileType);
-    void reset();
-
-private:
-    Mutex mLock;
-
-    sp<DataSource> mDataSource;
-    off64_t mOffset;
-
-    struct TextInfo {
-        int64_t endTimeUs;
-        // the offset of the text in the original file
-        off64_t offset;
-        int textLen;
-    };
-
-    int mIndex;
-    FileType mFileType;
-
-    // the key indicated the start time of the text
-    KeyedVector<int64_t, TextInfo> mTextVector;
-
-    status_t getNextInSrtFileFormat(
-            off64_t *offset, int64_t *startTimeUs, TextInfo *info);
-    status_t readNextLine(off64_t *offset, AString *data);
-
-    status_t scanFile();
-
-    DISALLOW_EVIL_CONSTRUCTORS(TimedTextParser);
-};
-
-}  // namespace android
-
-#endif  // TIMED_TEXT_PARSER_H_
-
diff --git a/media/libstagefright/timedtext/TimedTextPlayer.cpp b/media/libstagefright/timedtext/TimedTextPlayer.cpp
index 3014b0b..8c2df88 100644
--- a/media/libstagefright/timedtext/TimedTextPlayer.cpp
+++ b/media/libstagefright/timedtext/TimedTextPlayer.cpp
@@ -1,5 +1,5 @@
  /*
- * Copyright (C) 2011 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.
@@ -18,399 +18,164 @@
 #define LOG_TAG "TimedTextPlayer"
 #include <utils/Log.h>
 
-#include <binder/IPCThreadState.h>
-
+#include <media/stagefright/foundation/AMessage.h>
 #include <media/stagefright/MediaDebug.h>
-#include <media/stagefright/MediaDefs.h>
 #include <media/stagefright/MediaErrors.h>
-#include <media/stagefright/MediaSource.h>
-#include <media/stagefright/MetaData.h>
-#include <media/stagefright/MediaBuffer.h>
-#include <media/stagefright/FileSource.h>
-#include <media/stagefright/Utils.h>
+#include <media/MediaPlayerInterface.h>
 
-#include "include/AwesomePlayer.h"
 #include "TimedTextPlayer.h"
-#include "TimedTextParser.h"
-#include "TextDescriptions.h"
+
+#include "TimedTextDriver.h"
+#include "TimedTextSource.h"
 
 namespace android {
 
-struct TimedTextEvent : public TimedEventQueue::Event {
-    TimedTextEvent(
-            TimedTextPlayer *player,
-            void (TimedTextPlayer::*method)())
-        : mPlayer(player),
-          mMethod(method) {
-    }
+static const int64_t kAdjustmentProcessingTimeUs = 100000ll;
 
-protected:
-    virtual ~TimedTextEvent() {}
-
-    virtual void fire(TimedEventQueue *queue, int64_t /* now_us */) {
-        (mPlayer->*mMethod)();
-    }
-
-private:
-    TimedTextPlayer *mPlayer;
-    void (TimedTextPlayer::*mMethod)();
-
-    TimedTextEvent(const TimedTextEvent &);
-    TimedTextEvent &operator=(const TimedTextEvent &);
-};
-
-TimedTextPlayer::TimedTextPlayer(
-        AwesomePlayer *observer,
-        const wp<MediaPlayerBase> &listener,
-        TimedEventQueue *queue)
-    : mSource(NULL),
-      mOutOfBandSource(NULL),
-      mSeekTimeUs(0),
-      mStarted(false),
-      mTextEventPending(false),
-      mQueue(queue),
-      mListener(listener),
-      mObserver(observer),
-      mTextBuffer(NULL),
-      mTextParser(NULL),
-      mTextType(kNoText) {
-    mTextEvent = new TimedTextEvent(this, &TimedTextPlayer::onTextEvent);
+TimedTextPlayer::TimedTextPlayer(const wp<MediaPlayerBase> &listener)
+    : mListener(listener),
+      mSource(NULL),
+      mSendSubtitleGeneration(0) {
 }
 
 TimedTextPlayer::~TimedTextPlayer() {
-    if (mStarted) {
-        reset();
+    if (mSource != NULL) {
+        mSource->stop();
+        mSource.clear();
+        mSource = NULL;
     }
-
-    mTextTrackVector.clear();
-    mTextOutOfBandVector.clear();
 }
 
-status_t TimedTextPlayer::start(uint8_t index) {
-    CHECK(!mStarted);
-
-    if (index >=
-            mTextTrackVector.size() + mTextOutOfBandVector.size()) {
-        ALOGE("Incorrect text track index: %d", index);
-        return BAD_VALUE;
-    }
-
-    status_t err;
-    if (index < mTextTrackVector.size()) { // start an in-band text
-        mSource = mTextTrackVector.itemAt(index);
-
-        err = mSource->start();
-
-        if (err != OK) {
-            return err;
-        }
-        mTextType = kInBandText;
-    } else { // start an out-of-band text
-        OutOfBandText text =
-            mTextOutOfBandVector.itemAt(index - mTextTrackVector.size());
-
-        mOutOfBandSource = text.source;
-        TimedTextParser::FileType fileType = text.type;
-
-        if (mTextParser == NULL) {
-            mTextParser = new TimedTextParser();
-        }
-
-        if ((err = mTextParser->init(mOutOfBandSource, fileType)) != OK) {
-            return err;
-        }
-        mTextType = kOutOfBandText;
-    }
-
-    // send sample description format
-    if ((err = extractAndSendGlobalDescriptions()) != OK) {
-        return err;
-    }
-
-    int64_t positionUs;
-    mObserver->getPosition(&positionUs);
-    seekTo(positionUs);
-
-    postTextEvent();
-
-    mStarted = true;
-
-    return OK;
+void TimedTextPlayer::start() {
+    sp<AMessage> msg = new AMessage(kWhatSeek, id());
+    msg->setInt64("seekTimeUs", -1);
+    msg->post();
 }
 
 void TimedTextPlayer::pause() {
-    CHECK(mStarted);
-
-    cancelTextEvent();
+    (new AMessage(kWhatPause, id()))->post();
 }
 
 void TimedTextPlayer::resume() {
-    CHECK(mStarted);
-
-    postTextEvent();
+    start();
 }
 
-void TimedTextPlayer::reset() {
-    CHECK(mStarted);
+void TimedTextPlayer::seekToAsync(int64_t timeUs) {
+    sp<AMessage> msg = new AMessage(kWhatSeek, id());
+    msg->setInt64("seekTimeUs", timeUs);
+    msg->post();
+}
 
-    // send an empty text to clear the screen
-    notifyListener(MEDIA_TIMED_TEXT);
+void TimedTextPlayer::setDataSource(sp<TimedTextSource> source) {
+    sp<AMessage> msg = new AMessage(kWhatSetSource, id());
+    msg->setObject("source", source);
+    msg->post();
+}
 
-    cancelTextEvent();
-
-    mSeeking = false;
-    mStarted = false;
-
-    if (mTextType == kInBandText) {
-        if (mTextBuffer != NULL) {
-            mTextBuffer->release();
-            mTextBuffer = NULL;
+void TimedTextPlayer::onMessageReceived(const sp<AMessage> &msg) {
+    switch (msg->what()) {
+        case kWhatPause: {
+            mSendSubtitleGeneration++;
+            break;
         }
-
-        if (mSource != NULL) {
-            mSource->stop();
-            mSource.clear();
-            mSource = NULL;
+        case kWhatSeek: {
+            int64_t seekTimeUs = 0;
+            msg->findInt64("seekTimeUs", &seekTimeUs);
+            if (seekTimeUs < 0) {
+                sp<MediaPlayerBase> listener = mListener.promote();
+                if (listener != NULL) {
+                    int32_t positionMs = 0;
+                    listener->getCurrentPosition(&positionMs);
+                    seekTimeUs = positionMs * 1000ll;
+                }
+            }
+            doSeekAndRead(seekTimeUs);
+            break;
         }
-    } else {
-        if (mTextParser != NULL) {
-            mTextParser.clear();
-            mTextParser = NULL;
+        case kWhatSendSubtitle: {
+            int32_t generation;
+            CHECK(msg->findInt32("generation", &generation));
+            if (generation != mSendSubtitleGeneration) {
+              // Drop obsolete msg.
+              break;
+            }
+            sp<RefBase> obj;
+            msg->findObject("subtitle", &obj);
+            if (obj != NULL) {
+                sp<ParcelEvent> parcelEvent;
+                parcelEvent = static_cast<ParcelEvent*>(obj.get());
+                notifyListener(MEDIA_TIMED_TEXT, &(parcelEvent->parcel));
+            } else {
+                notifyListener(MEDIA_TIMED_TEXT);
+            }
+            doRead();
+            break;
         }
-        if (mOutOfBandSource != NULL) {
-            mOutOfBandSource.clear();
-            mOutOfBandSource = NULL;
+        case kWhatSetSource: {
+            sp<RefBase> obj;
+            msg->findObject("source", &obj);
+            if (obj == NULL) break;
+            if (mSource != NULL) {
+                mSource->stop();
+            }
+            mSource = static_cast<TimedTextSource*>(obj.get());
+            mSource->start();
+            Parcel parcel;
+            if (mSource->extractGlobalDescriptions(&parcel) == OK &&
+                parcel.dataSize() > 0) {
+                notifyListener(MEDIA_TIMED_TEXT, &parcel);
+            } else {
+                notifyListener(MEDIA_TIMED_TEXT);
+            }
+            break;
         }
     }
 }
 
-status_t TimedTextPlayer::seekTo(int64_t time_us) {
-    Mutex::Autolock autoLock(mLock);
-
-    mSeeking = true;
-    mSeekTimeUs = time_us;
-
-    postTextEvent();
-
-    return OK;
-}
-
-status_t TimedTextPlayer::setTimedTextTrackIndex(int32_t index) {
-    if (index >=
-            (int)(mTextTrackVector.size() + mTextOutOfBandVector.size())) {
-        return BAD_VALUE;
-    }
-
-    if (mStarted) {
-        reset();
-    }
-
-    if (index >= 0) {
-        return start(index);
-    }
-    return OK;
-}
-
-void TimedTextPlayer::onTextEvent() {
-    Mutex::Autolock autoLock(mLock);
-
-    if (!mTextEventPending) {
-        return;
-    }
-    mTextEventPending = false;
-
-    if (mData.dataSize() > 0) {
-        notifyListener(MEDIA_TIMED_TEXT, &mData);
-        mData.freeData();
-    }
-
+void TimedTextPlayer::doSeekAndRead(int64_t seekTimeUs) {
     MediaSource::ReadOptions options;
-    if (mSeeking) {
-        options.setSeekTo(mSeekTimeUs,
-                MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC);
-        mSeeking = false;
-
-        notifyListener(MEDIA_TIMED_TEXT); //empty text to clear the screen
-    }
-
-    int64_t positionUs, timeUs;
-    mObserver->getPosition(&positionUs);
-
-    if (mTextType == kInBandText) {
-        if (mSource->read(&mTextBuffer, &options) != OK) {
-            return;
-        }
-
-        mTextBuffer->meta_data()->findInt64(kKeyTime, &timeUs);
-    } else {
-        int64_t endTimeUs;
-        if (mTextParser->getText(
-                    &mText, &timeUs, &endTimeUs, &options) != OK) {
-            return;
-        }
-    }
-
-    if (timeUs > 0) {
-        extractAndAppendLocalDescriptions(timeUs);
-    }
-
-    if (mTextType == kInBandText) {
-        if (mTextBuffer != NULL) {
-            mTextBuffer->release();
-            mTextBuffer = NULL;
-        }
-    } else {
-        mText.clear();
-    }
-
-    //send the text now
-    if (timeUs <= positionUs + 100000ll) {
-        postTextEvent();
-    } else {
-        postTextEvent(timeUs - positionUs - 100000ll);
-    }
+    options.setSeekTo(seekTimeUs, MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC);
+    doRead(&options);
 }
 
-void TimedTextPlayer::postTextEvent(int64_t delayUs) {
-    if (mTextEventPending) {
-        return;
-    }
-
-    mTextEventPending = true;
-    mQueue->postEventWithDelay(mTextEvent, delayUs < 0 ? 10000 : delayUs);
+void TimedTextPlayer::doRead(MediaSource::ReadOptions* options) {
+    int64_t timeUs = 0;
+    sp<ParcelEvent> parcelEvent = new ParcelEvent();
+    mSource->read(&timeUs, &(parcelEvent->parcel), options);
+    postTextEvent(parcelEvent, timeUs);
 }
 
-void TimedTextPlayer::cancelTextEvent() {
-    mQueue->cancelEvent(mTextEvent->eventID());
-    mTextEventPending = false;
-}
+void TimedTextPlayer::postTextEvent(const sp<ParcelEvent>& parcel, int64_t timeUs) {
+    sp<MediaPlayerBase> listener = mListener.promote();
+    if (listener != NULL) {
+        int64_t positionUs, delayUs;
+        int32_t positionMs = 0;
+        listener->getCurrentPosition(&positionMs);
+        positionUs = positionMs * 1000;
 
-void TimedTextPlayer::addTextSource(sp<MediaSource> source) {
-    Mutex::Autolock autoLock(mLock);
-    mTextTrackVector.add(source);
-}
-
-status_t TimedTextPlayer::setParameter(int key, const Parcel &request) {
-    Mutex::Autolock autoLock(mLock);
-
-    if (key == KEY_PARAMETER_TIMED_TEXT_ADD_OUT_OF_BAND_SOURCE) {
-        const String16 uri16 = request.readString16();
-        String8 uri = String8(uri16);
-        KeyedVector<String8, String8> headers;
-
-        // To support local subtitle file only for now
-        if (strncasecmp("file://", uri.string(), 7)) {
-            return INVALID_OPERATION;
-        }
-        sp<DataSource> dataSource =
-            DataSource::CreateFromURI(uri, &headers);
-        status_t err = dataSource->initCheck();
-
-        if (err != OK) {
-            return err;
-        }
-
-        OutOfBandText text;
-        text.source = dataSource;
-        if (uri.getPathExtension() == String8(".srt")) {
-            text.type = TimedTextParser::OUT_OF_BAND_FILE_SRT;
+        if (timeUs <= positionUs + kAdjustmentProcessingTimeUs) {
+            delayUs = 0;
         } else {
-            return ERROR_UNSUPPORTED;
+            delayUs = timeUs - positionUs - kAdjustmentProcessingTimeUs;
         }
-
-        mTextOutOfBandVector.add(text);
-
-        return OK;
+        sp<AMessage> msg = new AMessage(kWhatSendSubtitle, id());
+        msg->setInt32("generation", mSendSubtitleGeneration);
+        if (parcel != NULL) {
+            msg->setObject("subtitle", parcel);
+        }
+        msg->post(delayUs);
     }
-    return INVALID_OPERATION;
 }
 
 void TimedTextPlayer::notifyListener(int msg, const Parcel *parcel) {
-    if (mListener != NULL) {
-        sp<MediaPlayerBase> listener = mListener.promote();
-
-        if (listener != NULL) {
-            if (parcel && (parcel->dataSize() > 0)) {
-                listener->sendEvent(msg, 0, 0, parcel);
-            } else { // send an empty timed text to clear the screen
-                listener->sendEvent(msg);
-            }
+    sp<MediaPlayerBase> listener = mListener.promote();
+    if (listener != NULL) {
+        if (parcel != NULL && (parcel->dataSize() > 0)) {
+            listener->sendEvent(msg, 0, 0, parcel);
+        } else {  // send an empty timed text to clear the screen
+            listener->sendEvent(msg);
         }
     }
 }
 
-// Each text sample consists of a string of text, optionally with sample
-// modifier description. The modifier description could specify a new
-// text style for the string of text. These descriptions are present only
-// if they are needed. This method is used to extract the modifier
-// description and append it at the end of the text.
-status_t TimedTextPlayer::extractAndAppendLocalDescriptions(int64_t timeUs) {
-    const void *data;
-    size_t size = 0;
-    int32_t flag = TextDescriptions::LOCAL_DESCRIPTIONS;
-
-    if (mTextType == kInBandText) {
-        const char *mime;
-        CHECK(mSource->getFormat()->findCString(kKeyMIMEType, &mime));
-
-        if (!strcasecmp(mime, MEDIA_MIMETYPE_TEXT_3GPP)) {
-            flag |= TextDescriptions::IN_BAND_TEXT_3GPP;
-            data = mTextBuffer->data();
-            size = mTextBuffer->size();
-        } else {
-            // support 3GPP only for now
-            return ERROR_UNSUPPORTED;
-        }
-    } else {
-        data = mText.c_str();
-        size = mText.size();
-        flag |= TextDescriptions::OUT_OF_BAND_TEXT_SRT;
-    }
-
-    if ((size > 0) && (flag != TextDescriptions::LOCAL_DESCRIPTIONS)) {
-        mData.freeData();
-        return TextDescriptions::getParcelOfDescriptions(
-                (const uint8_t *)data, size, flag, timeUs / 1000, &mData);
-    }
-
-    return OK;
-}
-
-// To extract and send the global text descriptions for all the text samples
-// in the text track or text file.
-status_t TimedTextPlayer::extractAndSendGlobalDescriptions() {
-    const void *data;
-    size_t size = 0;
-    int32_t flag = TextDescriptions::GLOBAL_DESCRIPTIONS;
-
-    if (mTextType == kInBandText) {
-        const char *mime;
-        CHECK(mSource->getFormat()->findCString(kKeyMIMEType, &mime));
-
-        // support 3GPP only for now
-        if (!strcasecmp(mime, MEDIA_MIMETYPE_TEXT_3GPP)) {
-            uint32_t type;
-            // get the 'tx3g' box content. This box contains the text descriptions
-            // used to render the text track
-            if (!mSource->getFormat()->findData(
-                        kKeyTextFormatData, &type, &data, &size)) {
-                return ERROR_MALFORMED;
-            }
-
-            flag |= TextDescriptions::IN_BAND_TEXT_3GPP;
-        }
-    }
-
-    if ((size > 0) && (flag != TextDescriptions::GLOBAL_DESCRIPTIONS)) {
-        Parcel parcel;
-        if (TextDescriptions::getParcelOfDescriptions(
-                (const uint8_t *)data, size, flag, 0, &parcel) == OK) {
-            if (parcel.dataSize() > 0) {
-                notifyListener(MEDIA_TIMED_TEXT, &parcel);
-            }
-        }
-    }
-
-    return OK;
-}
-}
+}  // namespace android
diff --git a/media/libstagefright/timedtext/TimedTextPlayer.h b/media/libstagefright/timedtext/TimedTextPlayer.h
index a744db5..837beeb 100644
--- a/media/libstagefright/timedtext/TimedTextPlayer.h
+++ b/media/libstagefright/timedtext/TimedTextPlayer.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 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.
@@ -15,99 +15,61 @@
  */
 
 #ifndef TIMEDTEXT_PLAYER_H_
-
 #define TIMEDTEXT_PLAYER_H_
 
-#include <media/MediaPlayerInterface.h>
+#include <binder/Parcel.h>
 #include <media/stagefright/foundation/ABase.h>
-#include <media/stagefright/foundation/AString.h>
+#include <media/stagefright/foundation/AHandler.h>
+#include <media/stagefright/MediaSource.h>
+#include <utils/RefBase.h>
 
-#include "include/TimedEventQueue.h"
-#include "TimedTextParser.h"
+#include "TimedTextSource.h"
 
 namespace android {
 
-class MediaSource;
-class AwesomePlayer;
-class MediaBuffer;
+class AMessage;
+class MediaPlayerBase;
+class TimedTextDriver;
+class TimedTextSource;
 
-class TimedTextPlayer {
+class TimedTextPlayer : public AHandler {
 public:
-    TimedTextPlayer(AwesomePlayer *observer,
-                    const wp<MediaPlayerBase> &listener,
-                    TimedEventQueue *queue);
+    TimedTextPlayer(const wp<MediaPlayerBase> &listener);
 
     virtual ~TimedTextPlayer();
 
-    // index: the index of the text track which will
-    // be turned on
-    status_t start(uint8_t index);
-
+    void start();
     void pause();
-
     void resume();
+    void seekToAsync(int64_t timeUs);
+    void setDataSource(sp<TimedTextSource> source);
 
-    status_t seekTo(int64_t time_us);
-
-    void addTextSource(sp<MediaSource> source);
-
-    status_t setTimedTextTrackIndex(int32_t index);
-    status_t setParameter(int key, const Parcel &request);
+protected:
+    virtual void onMessageReceived(const sp<AMessage> &msg);
 
 private:
-    enum TextType {
-        kNoText        = 0,
-        kInBandText    = 1,
-        kOutOfBandText = 2,
+    enum {
+        kWhatPause = 'paus',
+        kWhatSeek = 'seek',
+        kWhatSendSubtitle = 'send',
+        kWhatSetSource = 'ssrc',
     };
 
-    Mutex mLock;
-
-    sp<MediaSource> mSource;
-    sp<DataSource> mOutOfBandSource;
-
-    bool mSeeking;
-    int64_t mSeekTimeUs;
-
-    bool mStarted;
-
-    sp<TimedEventQueue::Event> mTextEvent;
-    bool mTextEventPending;
-
-    TimedEventQueue *mQueue;
+    // To add Parcel into an AMessage as an object, it should be 'RefBase'.
+    struct ParcelEvent : public RefBase {
+        Parcel parcel;
+    };
 
     wp<MediaPlayerBase> mListener;
-    AwesomePlayer *mObserver;
+    sp<TimedTextSource> mSource;
+    int32_t mSendSubtitleGeneration;
 
-    MediaBuffer *mTextBuffer;
-    Parcel mData;
-
-    // for in-band timed text
-    Vector<sp<MediaSource> > mTextTrackVector;
-
-    // for out-of-band timed text
-    struct OutOfBandText {
-        TimedTextParser::FileType type;
-        sp<DataSource> source;
-    };
-    Vector<OutOfBandText > mTextOutOfBandVector;
-
-    sp<TimedTextParser> mTextParser;
-    AString mText;
-
-    TextType mTextType;
-
-    void reset();
-
+    void doSeekAndRead(int64_t seekTimeUs);
+    void doRead(MediaSource::ReadOptions* options = NULL);
     void onTextEvent();
-    void postTextEvent(int64_t delayUs = -1);
-    void cancelTextEvent();
-
+    void postTextEvent(const sp<ParcelEvent>& parcel = NULL, int64_t timeUs = -1);
     void notifyListener(int msg, const Parcel *parcel = NULL);
 
-    status_t extractAndAppendLocalDescriptions(int64_t timeUs);
-    status_t extractAndSendGlobalDescriptions();
-
     DISALLOW_EVIL_CONSTRUCTORS(TimedTextPlayer);
 };
 
diff --git a/media/libstagefright/timedtext/TimedTextSRTSource.cpp b/media/libstagefright/timedtext/TimedTextSRTSource.cpp
new file mode 100644
index 0000000..3752d34
--- /dev/null
+++ b/media/libstagefright/timedtext/TimedTextSRTSource.cpp
@@ -0,0 +1,275 @@
+ /*
+ * 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.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "TimedTextSRTSource"
+#include <utils/Log.h>
+
+#include <binder/Parcel.h>
+#include <media/stagefright/foundation/AString.h>
+#include <media/stagefright/DataSource.h>
+#include <media/stagefright/MediaErrors.h>
+#include <media/stagefright/MediaSource.h>
+
+#include "TimedTextSRTSource.h"
+#include "TextDescriptions.h"
+
+namespace android {
+
+TimedTextSRTSource::TimedTextSRTSource(const sp<DataSource>& dataSource)
+        : mSource(dataSource),
+          mIndex(0) {
+}
+
+TimedTextSRTSource::~TimedTextSRTSource() {
+}
+
+status_t TimedTextSRTSource::start() {
+    status_t err = scanFile();
+    if (err != OK) {
+        reset();
+    }
+    return err;
+}
+
+void TimedTextSRTSource::reset() {
+    mTextVector.clear();
+    mIndex = 0;
+}
+
+status_t TimedTextSRTSource::stop() {
+    reset();
+    return OK;
+}
+
+status_t TimedTextSRTSource::read(
+        int64_t *timeUs,
+        Parcel *parcel,
+        const MediaSource::ReadOptions *options) {
+    int64_t endTimeUs;
+    AString text;
+    status_t err = getText(options, &text, timeUs, &endTimeUs);
+    if (err != OK) {
+        return err;
+    }
+
+    if (*timeUs > 0) {
+        extractAndAppendLocalDescriptions(*timeUs, text, parcel);
+    }
+    return OK;
+}
+
+status_t TimedTextSRTSource::scanFile() {
+    off64_t offset = 0;
+    int64_t startTimeUs;
+    bool endOfFile = false;
+
+    while (!endOfFile) {
+        TextInfo info;
+        status_t err = getNextSubtitleInfo(&offset, &startTimeUs, &info);
+        switch (err) {
+            case OK:
+                mTextVector.add(startTimeUs, info);
+                break;
+            case ERROR_END_OF_STREAM:
+                endOfFile = true;
+                break;
+            default:
+                return err;
+        }
+    }
+    if (mTextVector.isEmpty()) {
+        return ERROR_MALFORMED;
+    }
+    return OK;
+}
+
+/* SRT format:
+ *   Subtitle number
+ *   Start time --> End time
+ *   Text of subtitle (one or more lines)
+ *   Blank lines
+ *
+ * .srt file example:
+ * 1
+ * 00:00:20,000 --> 00:00:24,400
+ * Altocumulus clouds occr between six thousand
+ *
+ * 2
+ * 00:00:24,600 --> 00:00:27,800
+ * and twenty thousand feet above ground level.
+ */
+status_t TimedTextSRTSource::getNextSubtitleInfo(
+          off64_t *offset, int64_t *startTimeUs, TextInfo *info) {
+    AString data;
+    status_t err;
+
+    // To skip blank lines.
+    do {
+        if ((err = readNextLine(offset, &data)) != OK) {
+            return err;
+        }
+        data.trim();
+    } while (data.empty());
+
+    // Just ignore the first non-blank line which is subtitle sequence number.
+    if ((err = readNextLine(offset, &data)) != OK) {
+        return err;
+    }
+    int hour1, hour2, min1, min2, sec1, sec2, msec1, msec2;
+    // the start time format is: hours:minutes:seconds,milliseconds
+    // 00:00:24,600 --> 00:00:27,800
+    if (sscanf(data.c_str(), "%02d:%02d:%02d,%03d --> %02d:%02d:%02d,%03d",
+               &hour1, &min1, &sec1, &msec1, &hour2, &min2, &sec2, &msec2) != 8) {
+        return ERROR_MALFORMED;
+    }
+
+    *startTimeUs = ((hour1 * 3600 + min1 * 60 + sec1) * 1000 + msec1) * 1000ll;
+    info->endTimeUs = ((hour2 * 3600 + min2 * 60 + sec2) * 1000 + msec2) * 1000ll;
+    if (info->endTimeUs <= *startTimeUs) {
+        return ERROR_MALFORMED;
+    }
+
+    info->offset = *offset;
+    bool needMoreData = true;
+    while (needMoreData) {
+        if ((err = readNextLine(offset, &data)) != OK) {
+            if (err == ERROR_END_OF_STREAM) {
+                needMoreData = false;
+            } else {
+                return err;
+            }
+        }
+
+        if (needMoreData) {
+            data.trim();
+            if (data.empty()) {
+                // it's an empty line used to separate two subtitles
+                needMoreData = false;
+            }
+        }
+    }
+    info->textLen = *offset - info->offset;
+    return OK;
+}
+
+status_t TimedTextSRTSource::readNextLine(off64_t *offset, AString *data) {
+    data->clear();
+    while (true) {
+        ssize_t readSize;
+        char character;
+        if ((readSize = mSource->readAt(*offset, &character, 1)) < 1) {
+            if (readSize == 0) {
+                return ERROR_END_OF_STREAM;
+            }
+            return ERROR_IO;
+        }
+
+        (*offset)++;
+
+        // a line could end with CR, LF or CR + LF
+        if (character == 10) {
+            break;
+        } else if (character == 13) {
+            if ((readSize = mSource->readAt(*offset, &character, 1)) < 1) {
+                if (readSize == 0) {  // end of the stream
+                    return OK;
+                }
+                return ERROR_IO;
+            }
+
+            (*offset)++;
+            if (character != 10) {
+                (*offset)--;
+            }
+            break;
+        }
+        data->append(character);
+    }
+    return OK;
+}
+
+status_t TimedTextSRTSource::getText(
+        const MediaSource::ReadOptions *options,
+        AString *text, int64_t *startTimeUs, int64_t *endTimeUs) {
+    text->clear();
+    int64_t seekTimeUs;
+    MediaSource::ReadOptions::SeekMode mode;
+    if (options != NULL && options->getSeekTo(&seekTimeUs, &mode)) {
+        int64_t lastEndTimeUs =
+                mTextVector.valueAt(mTextVector.size() - 1).endTimeUs;
+        int64_t firstStartTimeUs = mTextVector.keyAt(0);
+        if (seekTimeUs < 0 || seekTimeUs > lastEndTimeUs) {
+            return ERROR_OUT_OF_RANGE;
+        } else if (seekTimeUs < firstStartTimeUs) {
+            mIndex = 0;
+        } else {
+            // binary search
+            ssize_t low = 0;
+            ssize_t high = mTextVector.size() - 1;
+            ssize_t mid = 0;
+            int64_t currTimeUs;
+
+            while (low <= high) {
+                mid = low + (high - low)/2;
+                currTimeUs = mTextVector.keyAt(mid);
+                const int diff = currTimeUs - seekTimeUs;
+
+                if (diff == 0) {
+                    break;
+                } else if (diff < 0) {
+                    low = mid + 1;
+                } else {
+                    if ((high == mid + 1)
+                        && (seekTimeUs < mTextVector.keyAt(high))) {
+                        break;
+                    }
+                    high = mid - 1;
+                }
+            }
+            mIndex = mid;
+        }
+    }
+    const TextInfo &info = mTextVector.valueAt(mIndex);
+    *startTimeUs = mTextVector.keyAt(mIndex);
+    *endTimeUs = info.endTimeUs;
+    mIndex++;
+
+    char *str = new char[info.textLen];
+    if (mSource->readAt(info.offset, str, info.textLen) < info.textLen) {
+        delete[] str;
+        return ERROR_IO;
+    }
+    text->append(str, info.textLen);
+    delete[] str;
+    return OK;
+}
+
+status_t TimedTextSRTSource::extractAndAppendLocalDescriptions(
+        int64_t timeUs, const AString &text, Parcel *parcel) {
+    const void *data = text.c_str();
+    size_t size = text.size();
+    int32_t flag = TextDescriptions::LOCAL_DESCRIPTIONS |
+                   TextDescriptions::OUT_OF_BAND_TEXT_SRT;
+
+    if (size > 0) {
+        return TextDescriptions::getParcelOfDescriptions(
+                (const uint8_t *)data, size, flag, timeUs / 1000, parcel);
+    }
+    return OK;
+}
+
+}  // namespace android
diff --git a/media/libstagefright/timedtext/TimedTextSRTSource.h b/media/libstagefright/timedtext/TimedTextSRTSource.h
new file mode 100644
index 0000000..a0734d9
--- /dev/null
+++ b/media/libstagefright/timedtext/TimedTextSRTSource.h
@@ -0,0 +1,75 @@
+/*
+ * 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.
+ */
+
+#ifndef TIMED_TEXT_SRT_SOURCE_H_
+#define TIMED_TEXT_SRT_SOURCE_H_
+
+#include <media/stagefright/MediaErrors.h>
+#include <media/stagefright/MediaSource.h>
+#include <utils/Compat.h>  // off64_t
+
+#include "TimedTextSource.h"
+
+namespace android {
+
+class AString;
+class DataSource;
+class MediaBuffer;
+class Parcel;
+
+class TimedTextSRTSource : public TimedTextSource {
+ public:
+  TimedTextSRTSource(const sp<DataSource>& dataSource);
+  virtual status_t start();
+  virtual status_t stop();
+  virtual status_t read(
+          int64_t *timeUs,
+          Parcel *parcel,
+          const MediaSource::ReadOptions *options = NULL);
+
+ protected:
+  virtual ~TimedTextSRTSource();
+
+ private:
+  sp<DataSource> mSource;
+
+  struct TextInfo {
+      int64_t endTimeUs;
+      // The offset of the text in the original file.
+      off64_t offset;
+      int textLen;
+  };
+
+  int mIndex;
+  KeyedVector<int64_t, TextInfo> mTextVector;
+
+  void reset();
+  status_t scanFile();
+  status_t getNextSubtitleInfo(
+          off64_t *offset, int64_t *startTimeUs, TextInfo *info);
+  status_t readNextLine(off64_t *offset, AString *data);
+  status_t getText(
+          const MediaSource::ReadOptions *options,
+          AString *text, int64_t *startTimeUs, int64_t *endTimeUs);
+  status_t extractAndAppendLocalDescriptions(
+          int64_t timeUs, const AString &text, Parcel *parcel);
+
+  DISALLOW_EVIL_CONSTRUCTORS(TimedTextSRTSource);
+};
+
+}  // namespace android
+
+#endif  // TIMED_TEXT_SRT_SOURCE_H_
diff --git a/media/libstagefright/timedtext/TimedTextSource.cpp b/media/libstagefright/timedtext/TimedTextSource.cpp
new file mode 100644
index 0000000..9efe67c
--- /dev/null
+++ b/media/libstagefright/timedtext/TimedTextSource.cpp
@@ -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.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "TimedTextSource"
+#include <utils/Log.h>
+
+#include <media/stagefright/DataSource.h>
+#include <media/stagefright/MediaSource.h>
+
+#include "TimedTextSource.h"
+
+#include "TimedTextInBandSource.h"
+#include "TimedTextSRTSource.h"
+
+namespace android {
+
+// static
+sp<TimedTextSource> TimedTextSource::CreateTimedTextSource(
+        const sp<MediaSource>& mediaSource) {
+    return new TimedTextInBandSource(mediaSource);
+}
+
+// static
+sp<TimedTextSource> TimedTextSource::CreateTimedTextSource(
+        const sp<DataSource>& dataSource, FileType filetype) {
+    switch(filetype) {
+        case OUT_OF_BAND_FILE_SRT:
+            return new TimedTextSRTSource(dataSource);
+        case OUT_OF_BAND_FILE_SMI:
+            // TODO: Implement for SMI.
+            ALOGE("Supporting SMI is not implemented yet");
+            break;
+        default:
+            ALOGE("Undefined subtitle format. : %d", filetype);
+    }
+    return NULL;
+}
+
+}  // namespace android
diff --git a/media/libstagefright/timedtext/TimedTextSource.h b/media/libstagefright/timedtext/TimedTextSource.h
new file mode 100644
index 0000000..06bae71
--- /dev/null
+++ b/media/libstagefright/timedtext/TimedTextSource.h
@@ -0,0 +1,61 @@
+/*
+ * 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.
+ */
+
+#ifndef TIMED_TEXT_SOURCE_H_
+#define TIMED_TEXT_SOURCE_H_
+
+#include <media/stagefright/foundation/ABase.h>  // for DISALLOW_XXX macro.
+#include <media/stagefright/MediaErrors.h>
+#include <media/stagefright/MediaSource.h>  // for MediaSource::ReadOptions
+#include <utils/RefBase.h>
+
+namespace android {
+
+class DataSource;
+class Parcel;
+
+class TimedTextSource : public RefBase {
+ public:
+  enum FileType {
+      OUT_OF_BAND_FILE_SRT = 1,
+      OUT_OF_BAND_FILE_SMI = 2,
+  };
+  static sp<TimedTextSource> CreateTimedTextSource(
+      const sp<MediaSource>& source);
+  static sp<TimedTextSource> CreateTimedTextSource(
+      const sp<DataSource>& source, FileType filetype);
+  TimedTextSource() {}
+  virtual status_t start() = 0;
+  virtual status_t stop() = 0;
+  // Returns subtitle parcel and its start time.
+  virtual status_t read(
+          int64_t *timeUs,
+          Parcel *parcel,
+          const MediaSource::ReadOptions *options = NULL) = 0;
+  virtual status_t extractGlobalDescriptions(Parcel *parcel) {
+      return INVALID_OPERATION;
+  }
+
+ protected:
+  virtual ~TimedTextSource() { }
+
+ private:
+  DISALLOW_EVIL_CONSTRUCTORS(TimedTextSource);
+};
+
+}  // namespace android
+
+#endif  // TIMED_TEXT_SOURCE_H_
diff --git a/media/mediaserver/main_mediaserver.cpp b/media/mediaserver/main_mediaserver.cpp
index 21496a9..1520c01 100644
--- a/media/mediaserver/main_mediaserver.cpp
+++ b/media/mediaserver/main_mediaserver.cpp
@@ -15,6 +15,8 @@
 ** limitations under the License.
 */
 
+#define LOG_TAG "mediaserver"
+
 #include <binder/IPCThreadState.h>
 #include <binder/ProcessState.h>
 #include <binder/IServiceManager.h>
diff --git a/media/mtp/Android.mk b/media/mtp/Android.mk
index e590bab..fc7fc4f 100644
--- a/media/mtp/Android.mk
+++ b/media/mtp/Android.mk
@@ -39,6 +39,9 @@
 
 LOCAL_CFLAGS := -DMTP_DEVICE -DMTP_HOST
 
+# Needed for <bionic_time.h>
+LOCAL_C_INCLUDES := bionic/libc/private
+
 LOCAL_SHARED_LIBRARIES := libutils libcutils libusbhost libbinder
 
 include $(BUILD_SHARED_LIBRARY)
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/audio/MediaAudioManagerTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/audio/MediaAudioManagerTest.java
index c9087d1..7967ce7 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/audio/MediaAudioManagerTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/audio/MediaAudioManagerTest.java
@@ -19,8 +19,13 @@
 import com.android.mediaframeworktest.MediaFrameworkTest;
 import android.content.Context;
 import android.media.AudioManager;
+import android.media.MediaPlayer;
+import android.media.AudioManager.OnAudioFocusChangeListener;
+import android.os.Looper;
 import android.test.ActivityInstrumentationTestCase2;
 import android.test.suitebuilder.annotation.MediumTest;
+import android.test.suitebuilder.annotation.LargeTest;
+import android.util.Log;
 
 /**
  * Junit / Instrumentation test case for the media AudioManager api
@@ -28,8 +33,13 @@
 
 public class MediaAudioManagerTest extends ActivityInstrumentationTestCase2<MediaFrameworkTest> {
 
-    private String TAG = "MediaAudioManagerTest";
+    private final static String TAG = "MediaAudioManagerTest";
+    // the AudioManager used throughout the test
     private AudioManager mAudioManager;
+    // keep track of looper for AudioManager so we can terminate it
+    private Looper mAudioManagerLooper;
+    private final Object mLooperLock = new Object();
+    private final static int WAIT_FOR_LOOPER_TO_INITIALIZE_MS = 60000;  // 60s
     private int[] ringtoneMode = {AudioManager.RINGER_MODE_NORMAL,
              AudioManager.RINGER_MODE_SILENT, AudioManager.RINGER_MODE_VIBRATE};
 
@@ -37,17 +47,48 @@
         super("com.android.mediaframeworktest", MediaFrameworkTest.class);
     }
 
+    private void initializeAudioManagerWithLooper() {
+        new Thread() {
+            @Override
+            public void run() {
+                Looper.prepare();
+                mAudioManagerLooper = Looper.myLooper();
+                mAudioManager = (AudioManager)getActivity().getSystemService(Context.AUDIO_SERVICE);
+                synchronized (mLooperLock) {
+                    mLooperLock.notify();
+                }
+                Looper.loop();
+            }
+        }.start();
+    }
+
     @Override
     protected void setUp() throws Exception {
         super.setUp();
-        mAudioManager = (AudioManager) getActivity().getSystemService(Context.AUDIO_SERVICE);
+        synchronized(mLooperLock) {
+            initializeAudioManagerWithLooper();
+            try {
+                mLooperLock.wait(WAIT_FOR_LOOPER_TO_INITIALIZE_MS);
+            } catch (Exception e) {
+                assertTrue("initializeAudioManagerWithLooper() failed to complete in time", false);
+            }
+        }
      }
 
      @Override
      protected void tearDown() throws Exception {
          super.tearDown();
+         synchronized(mLooperLock) {
+             if (mAudioManagerLooper != null) {
+                 mAudioManagerLooper.quit();
+             }
+         }
      }
 
+     //-----------------------------------------------------------------
+     //      Ringer Mode
+     //----------------------------------
+
      public boolean validateSetRingTone(int i) {
          int getRingtone = mAudioManager.getRingerMode();
          if (i != getRingtone)
@@ -67,4 +108,136 @@
              assertTrue("SetRingtoneMode : " + ringtoneMode[i], result);
          }
      }
+
+    //-----------------------------------------------------------------
+    //      AudioFocus
+    //----------------------------------
+
+    private static AudioFocusListener mAudioFocusListener;
+    private final static int INVALID_FOCUS = -80; // initialized to magic invalid focus change type
+    private final static int WAIT_FOR_AUDIOFOCUS_LOSS_MS = 10;
+
+    private static class AudioFocusListener implements OnAudioFocusChangeListener {
+        public int mLastFocusChange = INVALID_FOCUS;
+        public int mFocusChangeCounter = 0;
+        public AudioFocusListener() {
+        }
+        public void onAudioFocusChange(int focusChange) {
+            mLastFocusChange = focusChange;
+            mFocusChangeCounter++;
+        }
+    }
+
+    /**
+     * Fails the test if expectedFocusLossMode != mAudioFocusListener.mLastFocusChange
+     */
+    private void verifyAudioFocusLoss(int focusGainMode, int expectedFocusLossMode)
+            throws Exception {
+        // request AudioFocus so we can test that mAudioFocusListener loses it when another
+        //     request comes in
+        int result = mAudioManager.requestAudioFocus(mAudioFocusListener,
+                AudioManager.STREAM_MUSIC,
+                AudioManager.AUDIOFOCUS_GAIN);
+        assertTrue("requestAudioFocus returned " + result,
+                result == AudioManager.AUDIOFOCUS_REQUEST_GRANTED);
+        // cause mAudioFocusListener to lose AudioFocus
+        result = mAudioManager.requestAudioFocus(null, AudioManager.STREAM_MUSIC,
+                focusGainMode);
+        assertTrue("requestAudioFocus returned " + result,
+                result == AudioManager.AUDIOFOCUS_REQUEST_GRANTED);
+        // the audio focus request is async, so wait a bit to verify it had the expected effect
+        java.lang.Thread.sleep(WAIT_FOR_AUDIOFOCUS_LOSS_MS);
+        // test successful if the expected focus loss was recorded
+        assertEquals("listener lost focus",
+                mAudioFocusListener.mLastFocusChange, expectedFocusLossMode);
+    }
+
+    private void setupAudioFocusListener() {
+        mAudioFocusListener = new AudioFocusListener();
+        mAudioManager.registerAudioFocusListener(mAudioFocusListener);
+    }
+
+    private void cleanupAudioFocusListener() {
+        // clean up
+        mAudioManager.abandonAudioFocus(mAudioFocusListener);
+        mAudioManager.unregisterAudioFocusListener(mAudioFocusListener);
+    }
+
+    //----------------------------------
+
+    //Test case 1: test audio focus listener loses audio focus:
+    //   AUDIOFOCUS_GAIN causes AUDIOFOCUS_LOSS
+    @MediumTest
+    public void testAudioFocusLoss() throws Exception {
+        setupAudioFocusListener();
+
+        verifyAudioFocusLoss(AudioManager.AUDIOFOCUS_GAIN, AudioManager.AUDIOFOCUS_LOSS);
+
+        cleanupAudioFocusListener();
+    }
+
+    //Test case 2: test audio focus listener loses audio focus:
+    //   AUDIOFOCUS_GAIN_TRANSIENT causes AUDIOFOCUS_LOSS_TRANSIENT
+    @MediumTest
+    public void testAudioFocusLossTransient() throws Exception {
+        setupAudioFocusListener();
+
+        verifyAudioFocusLoss(AudioManager.AUDIOFOCUS_GAIN_TRANSIENT,
+                AudioManager.AUDIOFOCUS_LOSS_TRANSIENT);
+
+        cleanupAudioFocusListener();
+    }
+
+    //Test case 3: test audio focus listener loses audio focus:
+    //   AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK causes AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK
+    @MediumTest
+    public void testAudioFocusLossTransientDuck() throws Exception {
+        setupAudioFocusListener();
+
+        verifyAudioFocusLoss(AudioManager.AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK,
+                AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK);
+
+        cleanupAudioFocusListener();
+    }
+
+    //Test case 4: test audio focus registering and use over 3000 iterations
+    @LargeTest
+    public void testAudioFocusStressListenerRequestAbandon() throws Exception {
+        final int ITERATIONS = 3000;
+        // here we only test the life cycle of a focus listener, and make sure we don't crash
+        // when doing it many times without waiting
+        for (int i = 0 ; i < ITERATIONS ; i++) {
+            setupAudioFocusListener();
+            int result = mAudioManager.requestAudioFocus(mAudioFocusListener,
+                    AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN);
+            assertTrue("audio focus request was not granted",
+                    result == AudioManager.AUDIOFOCUS_REQUEST_GRANTED);
+            cleanupAudioFocusListener();
+        }
+        assertTrue("testAudioFocusListenerLifeCycle : tested" + ITERATIONS +" iterations", true);
+    }
+
+    //Test case 5: test audio focus use without listener
+    @LargeTest
+    public void testAudioFocusStressNoListenerRequestAbandon() throws Exception {
+        final int ITERATIONS = 1000;
+        // make sure we have a listener in the stack
+        setupAudioFocusListener();
+        mAudioManager.requestAudioFocus(mAudioFocusListener, AudioManager.STREAM_MUSIC,
+                AudioManager.AUDIOFOCUS_GAIN);
+        // keep making the current owner lose and gain audio focus repeatedly
+        for (int i = 0 ; i < ITERATIONS ; i++) {
+            mAudioManager.requestAudioFocus(null, AudioManager.STREAM_MUSIC,
+                    AudioManager.AUDIOFOCUS_GAIN_TRANSIENT);
+            mAudioManager.abandonAudioFocus(null);
+            // the audio focus request is async, so wait a bit to verify it had the expected effect
+            java.lang.Thread.sleep(WAIT_FOR_AUDIOFOCUS_LOSS_MS);
+        }
+        // verify there were 2 audio focus changes per iteration (one loss + one gain)
+        assertTrue("testAudioFocusListenerLifeCycle : observed " +
+                mAudioFocusListener.mFocusChangeCounter + " AudioFocus changes",
+                mAudioFocusListener.mFocusChangeCounter == ITERATIONS * 2);
+        mAudioManager.abandonAudioFocus(mAudioFocusListener);
+        mAudioManager.unregisterAudioFocusListener(mAudioFocusListener);
+    }
  }
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/MediaItemThumbnailTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/MediaItemThumbnailTest.java
index 80a3bcd..7dfab7d 100755
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/MediaItemThumbnailTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/MediaItemThumbnailTest.java
@@ -82,7 +82,6 @@
     /**
      * To test thumbnail / frame extraction on H.263 QCIF.
      */
-    // TODO : TC_TN_001
     @LargeTest
     public void testThumbnailForH263QCIF() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
@@ -104,7 +103,6 @@
     /**
      * To test thumbnail / frame extraction on MPEG4 VGA .
      */
-    // TODO : TC_TN_002
     @LargeTest
     public void testThumbnailForMPEG4VGA() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH +
@@ -124,7 +122,6 @@
     /**
      * To test thumbnail / frame extraction on MPEG4 NTSC.
      */
-    // TODO : TC_TN_003
     @LargeTest
     public void testThumbnailForMPEG4NTSC() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
@@ -144,7 +141,6 @@
     /**
      * To test thumbnail / frame extraction on MPEG4 WVGA.
      */
-    // TODO : TC_TN_004
     @LargeTest
     public void testThumbnailForMPEG4WVGA() throws Exception {
 
@@ -165,7 +161,6 @@
     /**
      * To test thumbnail / frame extraction on MPEG4 QCIF.
      */
-    // TODO : TC_TN_005
     @LargeTest
     public void testThumbnailForMPEG4QCIF() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
@@ -186,7 +181,6 @@
     /**
      * To test thumbnail / frame extraction on H264 QCIF.
      */
-    // TODO : TC_TN_006
     @LargeTest
     public void testThumbnailForH264QCIF() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
@@ -207,7 +201,6 @@
     /**
      * To test thumbnail / frame extraction on H264 VGA.
      */
-    // TODO : TC_TN_007
     @LargeTest
     public void testThumbnailForH264VGA() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH +
@@ -228,7 +221,6 @@
     /**
      * To test thumbnail / frame extraction on H264 WVGA.
      */
-    // TODO : TC_TN_008
     @LargeTest
     public void testThumbnailForH264WVGA() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH +
@@ -248,7 +240,6 @@
     /**
      * To test thumbnail / frame extraction on H264 854x480.
      */
-    // TODO : TC_TN_009
     @LargeTest
     public void testThumbnailForH264854_480() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
@@ -269,7 +260,6 @@
     /**
      * To test thumbnail / frame extraction on H264 960x720.
      */
-    // TODO : TC_TN_010
     @LargeTest
     public void testThumbnailForH264HD960() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH +
@@ -290,7 +280,6 @@
     /**
      * To test thumbnail / frame extraction on H264 1080x720 .
      */
-    // TODO : TC_TN_011
     @LargeTest
     public void testThumbnailForH264HD1080() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH +
@@ -310,7 +299,6 @@
     /**
      * Check the thumbnail / frame extraction precision at 0,100 and 200 ms
      */
-    // TODO : TC_TN_012
     @LargeTest
     public void testThumbnailForH264VGADifferentDuration() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH +
@@ -345,7 +333,6 @@
      *Check the thumbnail / frame extraction precision at
      * FileDuration,FileDuration/2 + 100 andFileDuration/2 + 200 ms
      */
-    // TODO : TC_TN_013
     @LargeTest
     public void testThumbnailForMP4VGA() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH +
@@ -379,7 +366,6 @@
     /**
      * Check the thumbnail / frame extraction on JPEG file
      */
-    // TODO : TC_TN_014
     @LargeTest
     public void testThumbnailForImage() throws Exception {
         final String imageItemFilename = INPUT_FILE_PATH + "IMG_640x480.jpg";
@@ -402,7 +388,6 @@
     /**
      *To test ThumbnailList for H263 QCIF
      */
-    // TODO : TC_TN_015
     @LargeTest
     public void testThumbnailListH263QCIF() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
@@ -432,7 +417,6 @@
     /**
      *To test ThumbnailList for MPEG4 QCIF
      */
-    // TODO : TC_TN_016
     @LargeTest
     public void testThumbnailListMPEG4QCIF() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
@@ -463,7 +447,6 @@
     /**
      *To test ThumbnailList for H264 VGA
      */
-    // TODO : TC_TN_017
     @LargeTest
     public void testThumbnailListH264VGA() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH +
@@ -492,7 +475,6 @@
     /**
      *To test ThumbnailList for H264 WVGA
      */
-    // TODO : TC_TN_018
     @LargeTest
     public void testThumbnailListH264WVGA() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH +
@@ -521,7 +503,6 @@
     /**
      *To test ThumbnailList for H264 VGA ,Time exceeding file duration
      */
-    // TODO : TC_TN_019
     @LargeTest
     public void testThumbnailH264VGAExceedingFileDuration() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH +
@@ -547,7 +528,6 @@
     /**
      *To test ThumbnailList for VGA Image
      */
-    // TODO : TC_TN_020
     @LargeTest
     public void testThumbnailListVGAImage() throws Exception {
         final String imageItemFilename = INPUT_FILE_PATH + "IMG_640x480.jpg";
@@ -576,7 +556,6 @@
     /**
      *To test ThumbnailList for Invalid file path
      */
-    // TODO : TC_TN_021
     @LargeTest
     public void testThumbnailForInvalidFilePath() throws Exception {
         final String imageItemFileName = INPUT_FILE_PATH + "/sdcard/abc.jpg";
@@ -596,7 +575,6 @@
     /**
      * To test thumbnail / frame extraction with setBoundaries
      */
-    // TODO : TC_TN_022
     @LargeTest
     public void testThumbnailForMPEG4WVGAWithSetBoundaries() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH +
@@ -620,7 +598,6 @@
     /**
      *To test ThumbnailList for H264 WVGA with setExtractboundaries
      */
-    // TODO : TC_TN_023
     @LargeTest
     public void testThumbnailListForH264WVGAWithSetBoundaries() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH +
@@ -652,7 +629,6 @@
     /**
      *To test ThumbnailList for H264 WVGA with count > frame available
      */
-    // TODO : TC_TN_024
     @LargeTest
     public void testThumbnailListForH264WVGAWithCount() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH +
@@ -684,7 +660,6 @@
     /**
      *To test ThumbnailList for H264 WVGA with startTime > End Time
      */
-    // TODO : TC_TN_025
     @LargeTest
     public void testThumbnailListH264WVGAWithStartGreaterEnd() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH +
@@ -710,9 +685,8 @@
     }
 
     /**
-     *To test ThumbnailList TC_TN_026 for H264 WVGA with startTime = End Time
+     *To test ThumbnailList for H264 WVGA with startTime = End Time
      */
-    // TODO : TC_TN_026
     @LargeTest
     public void testThumbnailListH264WVGAWithStartEqualEnd() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH +
@@ -738,10 +712,9 @@
     }
 
     /**
-     *To test ThumbnailList TC_TN_027 for file where video duration is less
+     *To test ThumbnailList for file where video duration is less
      * than file duration.
      */
-    // TODO : TC_TN_027
     @LargeTest
     public void testThumbnailForVideoDurationLessFileDuration() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
@@ -760,9 +733,8 @@
     }
 
     /**
-     *To test ThumbnailList TC_TN_028 for file which has video part corrupted
+     *To test ThumbnailList for file which has video part corrupted
      */
-    // TODO : TC_TN_028
     @LargeTest
     public void testThumbnailWithCorruptedVideoPart() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH +
@@ -787,7 +759,6 @@
     /**
      * Check the thumbnail / frame list extraction for Height as Negative Value
      */
-    // TODO : TC_TN_029
     @LargeTest
     public void testThumbnailWithNegativeHeight() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
@@ -815,7 +786,6 @@
     /**
      * Check the thumbnail for Height as Zero
      */
-    // TODO : TC_TN_030
     @LargeTest
     public void testThumbnailWithHeightAsZero() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
@@ -839,7 +809,6 @@
     /**
      * Check the thumbnail for Height = 10
      */
-    // TODO : TC_TN_031
     @LargeTest
     public void testThumbnailWithHeight() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
@@ -859,7 +828,6 @@
     /**
      * Check the thumbnail / frame list extraction for Width as Negative Value
      */
-    // TODO : TC_TN_032
     @LargeTest
     public void testThumbnailWithNegativeWidth() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
@@ -887,7 +855,6 @@
     /**
      * Check the thumbnail / frame list extraction for Width zero
      */
-    // TODO : TC_TN_033
     @LargeTest
     public void testThumbnailWithWidthAsZero() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
@@ -911,7 +878,6 @@
     /**
      * Check the thumbnail for Width = 10
      */
-    // TODO : TC_TN_034
     @LargeTest
     public void testThumbnailWithWidth() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
@@ -931,7 +897,6 @@
     /**
      * To test thumbnail / frame extraction on MPEG4 (time beyond file duration).
      */
-    // TODO : TC_TN_035
     @LargeTest
     public void testThumbnailMPEG4withMorethanFileDuration() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/MediaPropertiesTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/MediaPropertiesTest.java
index e2f6863..34cf9f0 100755
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/MediaPropertiesTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/MediaPropertiesTest.java
@@ -130,7 +130,6 @@
     /**
      *To test Media Properties for file MPEG4 854 x 480
      */
-    // TODO : Remove TC_MP_001
     @LargeTest
     public void testPropertiesMPEG4854_480() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
@@ -163,7 +162,6 @@
     /**
      *To test Media Properties for file MPEG4 WVGA
      */
-    // TODO : Remove TC_MP_002
     @LargeTest
     public void testPropertiesMPEGWVGA() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
@@ -195,7 +193,6 @@
     /**
      *To test media properties for MPEG4 720x480 (NTSC) + AAC file.
      */
-    // TODO : Remove TC_MP_003
     @LargeTest
     public void testPropertiesMPEGNTSC() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
@@ -227,7 +224,6 @@
     /**
      *To test Media Properties for file MPEG4 VGA
      */
-    // TODO : Remove TC_MP_004
     @LargeTest
     public void testPropertiesMPEGVGA() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
@@ -259,7 +255,6 @@
     /**
      *To test Media Properties for file MPEG4 QCIF
      */
-    // TODO : Remove TC_MP_005
     @LargeTest
     public void testPropertiesMPEGQCIF() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
@@ -291,7 +286,6 @@
     /**
      *To To test media properties for H263 176x144 (QCIF) + AAC (mono) file.
      */
-    // TODO : Remove TC_MP_006
     @LargeTest
     public void testPropertiesH263QCIF() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
@@ -322,7 +316,6 @@
     /**
      *To test Media Properties for file H264 VGA
      */
-    // TODO : Remove TC_MP_007
     @LargeTest
     public void testPropertiesH264VGA() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
@@ -353,7 +346,6 @@
     /**
      *To test Media Properties for file H264 NTSC
      */
-    // TODO : Remove TC_MP_008
     @LargeTest
     public void testPropertiesH264NTSC() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
@@ -385,7 +377,6 @@
     /**
      *To test media properties for H264 800x480 (WVGA) + AAC file.
      */
-    // TODO : Remove TC_MP_009
     @LargeTest
     public void testPropertiesH264WVGA() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH +
@@ -417,7 +408,6 @@
     /**
      *To test Media Properties for file H264 HD1280
      */
-    // TODO : Remove TC_MP_010
     @LargeTest
     public void testPropertiesH264HD1280() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
@@ -449,7 +439,6 @@
     /**
      *To test media properties for H264 1080x720 + AAC file
      */
-    // TODO : Remove TC_MP_011
     @LargeTest
     public void testPropertiesH264HD1080WithAudio() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
@@ -481,7 +470,6 @@
     /**
      *To test Media Properties for file WMV - Unsupported type
      */
-    // TODO : Remove TC_MP_012
     @LargeTest
     public void testPropertiesWMVFile() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH +
@@ -506,7 +494,6 @@
     /**
      *To test media properties for H.264 Main/Advanced profile.
      */
-    // TODO : Remove TC_MP_013
     @LargeTest
     public void testPropertiesH264MainLineProfile() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH
@@ -539,7 +526,6 @@
     /**
      *To test Media Properties for non existing file.
      */
-    // TODO : Remove TC_MP_014
     @LargeTest
     public void testPropertiesForNonExsitingFile() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH + "abc.3gp";
@@ -559,7 +545,6 @@
     /**
      *To test Media Properties for file H264 HD1080
      */
-    // TODO : Remove TC_MP_015
     @LargeTest
     public void testPropertiesH264HD1080WithoutAudio() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH +
@@ -591,7 +576,6 @@
     /**
      *To test Media Properties for Image file of JPEG Type
      */
-    // TODO : Remove TC_MP_016
     @LargeTest
     public void testPropertiesVGAImage() throws Exception {
         final String imageItemFilename = INPUT_FILE_PATH + "IMG_640x480.jpg";
@@ -611,7 +595,6 @@
     /**
      *To test Media Properties for Image file of PNG Type
      */
-    // TODO : Remove TC_MP_017
     @LargeTest
     public void testPropertiesPNG() throws Exception {
         final String imageItemFilename = INPUT_FILE_PATH + "IMG_640x480.png";
@@ -630,7 +613,6 @@
     /**
      *To test Media Properties for file GIF - Unsupported type
      */
-    // TODO : Remove TC_MP_018
     @LargeTest
     public void testPropertiesGIFFile() throws Exception {
 
@@ -651,7 +633,6 @@
     /**
      *To test Media Properties for file Text file named as 3GP
      */
-    // TODO : Remove TC_MP_019
     @LargeTest
     public void testPropertiesofDirtyFile() throws Exception {
 
@@ -672,7 +653,6 @@
     /**
      *To test Media Properties for file name as NULL
      */
-    // TODO : Remove TC_MP_020
     @LargeTest
     public void testPropertieNULLFile() throws Exception {
         final String videoItemFilename = null;
@@ -691,7 +671,6 @@
     /**
      *To test Media Properties for file which is of type MPEG2
      */
-    // TODO : Remove TC_MP_021
     @LargeTest
     public void testPropertiesMPEG2File() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH +
@@ -709,9 +688,8 @@
     }
 
     /**
-     *To test Media Properties TC_MP_023 for file without Video only Audio
+     *To test Media Properties for file without Video only Audio
      */
-    // TODO : Remove TC_MP_023
     @LargeTest
     public void testProperties3GPWithoutVideoMediaItem() throws Exception {
         final String audioFilename = INPUT_FILE_PATH +
@@ -731,7 +709,6 @@
     /**
      *To test media properties for Audio Track file. (No Video, AAC Audio)
      */
-    // TODO : Remove TC_MP_024
     @LargeTest
     public void testProperties3GPWithoutVideoAudioTrack() throws Exception {
 
@@ -753,7 +730,6 @@
         /**
      *To test media properties for Audio Track file. MP3 file
      */
-    // TODO : Remove TC_MP_025
     @LargeTest
     public void testPropertiesMP3AudioTrack() throws Exception {
 
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/VideoEditorAPITest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/VideoEditorAPITest.java
index b32d865..6e520c3 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/VideoEditorAPITest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/VideoEditorAPITest.java
@@ -88,7 +88,6 @@
     /**
      * To Test Creation of Media Video Item.
      */
-    // TODO : remove TC_API_001
     @LargeTest
     public void testMediaVideoItem() throws Exception {
         final String videoItemFileName = INPUT_FILE_PATH
@@ -130,7 +129,6 @@
      * To test creation of Media Video Item with Set Extract Boundaries With Get
      * the Begin and End Time.
      */
-    // TODO : remove TC_API_002
     @LargeTest
     public void testMediaVideoItemExtractBoundaries() throws Exception {
         final String videoItemFileName = INPUT_FILE_PATH
@@ -199,7 +197,6 @@
     /**
      * To test creation of Media Video Item with Set and Get rendering Mode
      */
-    // TODO : remove TC_API_003
     @LargeTest
     public void testMediaVideoItemRenderingModes() throws Exception {
         final String videoItemFileName = INPUT_FILE_PATH
@@ -238,12 +235,10 @@
             mediaVideoItem1.getRenderingMode());
     }
 
-    /** Test Case  TC_API_004 is removed */
 
     /**
      * To Test the Media Video API : Set Audio Volume, Get Audio Volume and Mute
      */
-    // TODO : remove TC_API_005
     @LargeTest
     public void testMediaVideoItemAudioFeatures() throws Exception {
         final String videoItemFileName = INPUT_FILE_PATH
@@ -301,7 +296,6 @@
      * extractAudioWaveFormData
      */
 
-    // TODO : remove TC_API_006
     @LargeTest
     public void testMediaVideoItemGetWaveformData() throws Exception {
 
@@ -343,7 +337,6 @@
      * To Test the Media Video API : Get Effect, GetAllEffects, remove Effect
      */
 
-    // TODO : remove TC_API_007
     @LargeTest
     public void testMediaVideoItemEffect() throws Exception {
         final String videoItemFileName = INPUT_FILE_PATH
@@ -384,7 +377,6 @@
      * To Test the Media Video API : Get Before and after transition
      */
 
-    // TODO : remove TC_API_008
     @LargeTest
     public void testMediaVideoItemTransitions() throws Exception {
         final String videoItemFileName = INPUT_FILE_PATH
@@ -431,7 +423,6 @@
      *
      */
 
-    // TODO : remove TC_API_009
     @LargeTest
     public void testMediaVideoItemOverlays() throws Exception {
         final String videoItemFileName = INPUT_FILE_PATH
@@ -474,7 +465,6 @@
     /**
      * To Test Creation of Media Image Item.
      */
-    // TODO : remove TC_API_010
     @LargeTest
     public void testMediaImageItem() throws Exception {
         final String imageItemFileName = INPUT_FILE_PATH + "IMG_1600x1200.jpg";
@@ -511,7 +501,6 @@
     /**
      * To Test the Media Image API : Get and Set rendering Mode
      */
-    // TODO : remove TC_API_011
     @LargeTest
     public void testMediaImageItemRenderingModes() throws Exception {
         final String imageItemFileName = INPUT_FILE_PATH + "IMG_1600x1200.jpg";
@@ -554,7 +543,6 @@
     /**
      * To Test the Media Image API : GetHeight and GetWidth
      */
-    // TODO : remove TC_API_012
     @LargeTest
     public void testMediaImageItemHeightWidth() throws Exception {
         final String imageItemFileName = INPUT_FILE_PATH + "IMG_640x480.jpg";
@@ -576,7 +564,6 @@
     /**
      * To Test the Media Image API : Scaled Height and Scaled GetWidth
      */
-    // TODO : remove TC_API_013
     @LargeTest
     public void testMediaImageItemScaledHeightWidth() throws Exception {
         final String imageItemFileName = INPUT_FILE_PATH + "IMG_1600x1200.jpg";
@@ -597,7 +584,6 @@
      * To Test the Media Image API : Get Effect, GetAllEffects, remove Effect
      */
 
-    // TODO : remove TC_API_014
     @LargeTest
     public void testMediaImageItemEffect() throws Exception {
         final String imageItemFileName = INPUT_FILE_PATH + "IMG_1600x1200.jpg";
@@ -637,7 +623,6 @@
      * To Test the Media Image API : Get Before and after transition
      */
 
-    // TODO : remove TC_API_015
     @LargeTest
     public void testMediaImageItemTransitions() throws Exception {
         final String imageItemFileName = INPUT_FILE_PATH + "IMG_1600x1200.jpg";
@@ -685,7 +670,6 @@
      * Overlay
      */
 
-    // TODO : remove TC_API_016
     @LargeTest
     public void testMediaImageItemOverlays() throws Exception {
         final String imageItemFileName = INPUT_FILE_PATH + "IMG_640x480.jpg";
@@ -729,7 +713,6 @@
      * To test creation of Audio Track
      */
 
-    // TODO : remove TC_API_017
     @LargeTest
     public void testAudioTrack() throws Exception {
         final String audioFileName = INPUT_FILE_PATH +
@@ -756,7 +739,6 @@
     /**
      * To test creation of Audio Track with set extract boundaries
      */
-    // TODO : remove TC_API_018
     @LargeTest
     public void testAudioTrackExtractBoundaries() throws Exception {
         final String audioFileName = INPUT_FILE_PATH +
@@ -824,7 +806,6 @@
     /**
      * To test creation of Audio Track with set Start Time and Get Time
      */
-    // TODO : remove TC_API_019
     @LargeTest
     public void testAudioTrackSetGetTime() throws Exception {
         final String audioFileName = INPUT_FILE_PATH +
@@ -840,7 +821,6 @@
     /**
      * To Test the Audio Track API: Enable Ducking
      */
-    // TODO : remove TC_API_020
     @LargeTest
     public void testAudioTrackEnableDucking() throws Exception {
         final String audioFileName = INPUT_FILE_PATH +
@@ -910,7 +890,6 @@
     /**
      * To Test the Audio Track API: Looping
      */
-    // TODO : remove TC_API_021
     @LargeTest
     public void testAudioTrackLooping() throws Exception {
         final String audioFileName = INPUT_FILE_PATH +
@@ -928,7 +907,6 @@
     /**
      * To Test the Audio Track API:Extract waveform data
      */
-    // TODO : remove TC_API_022
 
     @LargeTest
     public void testAudioTrackWaveFormData() throws Exception {
@@ -984,7 +962,6 @@
     /**
      * To Test the Audio Track API: Mute
      */
-    // TODO : remove TC_API_023
     @LargeTest
     public void testAudioTrackMute() throws Exception {
         final String audioFileName = INPUT_FILE_PATH +
@@ -1001,7 +978,6 @@
     /**
      * To Test the Audio Track API: Get Volume and Set Volume
      */
-    // TODO : remove TC_API_024
     @LargeTest
     public void testAudioTrackGetSetVolume() throws Exception {
         final String audioFileName = INPUT_FILE_PATH +
@@ -1042,7 +1018,6 @@
     /**
      * To test Effect Color.
      */
-    // TODO : remove TC_API_025
     @LargeTest
     public void testAllEffects() throws Exception {
         final String videoItemFileName = INPUT_FILE_PATH +
@@ -1206,7 +1181,6 @@
     /**
      * To test Effect Color : Set duration and Get Duration
      */
-    // TODO : remove TC_API_026
     @LargeTest
     public void testEffectSetgetDuration() throws Exception {
         final String videoItemFileName = INPUT_FILE_PATH +
@@ -1246,7 +1220,6 @@
     /**
      * To test Effect Color : UNDEFINED color param value
      */
-    // TODO : remove TC_API_027
     @LargeTest
     public void testEffectUndefinedColorParam() throws Exception {
         final String videoItemFileName = INPUT_FILE_PATH +
@@ -1269,7 +1242,6 @@
     /**
      * To test Effect Color : with Invalid StartTime and Duration
      */
-    // TODO : remove TC_API_028
     @LargeTest
     public void testEffectInvalidStartTimeAndDuration() throws Exception {
         final String videoItemFileName = INPUT_FILE_PATH +
@@ -1315,7 +1287,6 @@
     /**
      * To test Effect : with NULL Media Item
      */
-    // TODO : remove TC_API_034
     @LargeTest
     public void testEffectNullMediaItem() throws Exception {
         boolean flagForException = false;
@@ -1331,7 +1302,6 @@
     /**
      * To test Effect : KenBurn Effect
      */
-    // TODO : remove TC_API_035
     @LargeTest
     public void testEffectKenBurn() throws Exception {
         // Test ken burn effect using a JPEG file.
@@ -1375,7 +1345,6 @@
      * To test KenBurnEffect : Set StartRect and EndRect
      */
 
-    // TODO : remove TC_API_036
     @LargeTest
     public void testEffectKenBurnSet() throws Exception {
         final String imageItemFileName = INPUT_FILE_PATH + "IMG_640x480.jpg";
@@ -1443,7 +1412,6 @@
      * SPEED_UP/SPEED_DOWN/LINEAR/MIDDLE_SLOW/MIDDLE_FAST
      */
 
-    // TODO : remove TC_API_037
     @LargeTest
     public void testTransitionFadeBlack() throws Exception {
 
@@ -1591,7 +1559,6 @@
      * SPEED_UP/SPEED_DOWN/LINEAR/MIDDLE_SLOW/MIDDLE_FAST
      */
 
-    // TODO : remove TC_API_038
     @LargeTest
     public void testTransitionCrossFade() throws Exception {
 
@@ -1742,7 +1709,6 @@
      * ,DIRECTION_BOTTOM_OUT_TOP_IN
      */
 
-    // TODO : remove TC_API_039
     @LargeTest
     public void testTransitionSliding() throws Exception {
         final String videoItemFilename1 = INPUT_FILE_PATH +
@@ -1932,7 +1898,6 @@
      * SPEED_UP/SPEED_DOWN/LINEAR/MIDDLE_SLOW/MIDDLE_FAST
      */
 
-    // TODO : remove TC_API_040
     @LargeTest
     public void testTransitionAlpha() throws Exception {
 
@@ -2111,7 +2076,6 @@
      * To test Frame Overlay for Media Video Item
      */
 
-    // TODO : remove TC_API_041
     @LargeTest
     public void testFrameOverlayVideoItem() throws Exception {
         final String videoItemFilename1 = INPUT_FILE_PATH +
@@ -2147,7 +2111,6 @@
      * Duration
      */
 
-    // TODO : remove TC_API_042
     @LargeTest
     public void testFrameOverlaySetAndGet() throws Exception {
         final String videoItemFilename1 = INPUT_FILE_PATH +
@@ -2193,7 +2156,6 @@
      * Duration
      */
 
-    // TODO : remove TC_API_043
     @LargeTest
     public void testFrameOverlayInvalidTime() throws Exception {
         final String videoItemFilename1 = INPUT_FILE_PATH +
@@ -2242,7 +2204,6 @@
     /**
      * To test Frame Overlay for Media Image Item
      */
-    // TODO : remove TC_API_045
     @LargeTest
     public void testFrameOverlayImageItem() throws Exception {
         final String imageItemFilename1 = INPUT_FILE_PATH + "IMG_640x480.jpg";
@@ -2278,7 +2239,6 @@
      * Duration
      */
 
-    // TODO : remove TC_API_046
     @LargeTest
     public void testFrameOverlaySetAndGetImage() throws Exception {
         final String videoItemFilename1 = INPUT_FILE_PATH + "IMG_640x480.jpg";
@@ -2321,7 +2281,6 @@
      * Duration
      */
 
-    // TODO : remove TC_API_047
     @LargeTest
     public void testFrameOverlayInvalidTimeImage() throws Exception {
         final String videoItemFilename1 = INPUT_FILE_PATH + "IMG_640x480.jpg";
@@ -2370,7 +2329,6 @@
      * To Test Frame Overlay Media Image Item :JPG File
      */
 
-    // TODO : remove TC_API_048
     @LargeTest
     public void testFrameOverlayJPGImage() throws Exception {
 
@@ -2392,7 +2350,6 @@
      *
      * @throws Exception
      */
-    // TODO : remove TC_API_049
     @LargeTest
     public void testVideoEditorAPI() throws Exception {
 
@@ -2555,7 +2512,6 @@
      *
      * @throws Exception
      */
-    // TODO : remove TC_API_050
     @LargeTest
     public void testVideoLessThanAudio() throws Exception {
         final String videoItemFileName1 = INPUT_FILE_PATH
@@ -2583,7 +2539,6 @@
      *
      * @throws Exception
      */
-    // TODO : remove TC_API_051
     @LargeTest
     public void testVideoContentHD() throws Exception {
         final String videoItemFileName1 = INPUT_FILE_PATH
@@ -2609,7 +2564,6 @@
      *
      * @throws Exception
      */
-    // TODO : remove TC_API_052
     @LargeTest
     public void testRemoveAudioTrack() throws Exception {
         final String audioFileName = INPUT_FILE_PATH +
@@ -2638,7 +2592,6 @@
      *
      * @throws Exception
      */
-    // TODO : remove TC_API_053
     @LargeTest
     public void testAudioDuckingDisable() throws Exception {
         final String audioFileName = INPUT_FILE_PATH +
@@ -2653,8 +2606,6 @@
     }
 
 
-    // TODO : remove TC_API_054
-    /** This test case is added with Test case ID TC_API_010 */
 
       /**
      * To test: Need a basic test case for the get value for TransitionAlpha
@@ -2662,7 +2613,6 @@
      *
      * @throws Exception
      */
-    // TODO : remove TC_API_055
     @LargeTest
     public void testTransitionAlphaBasic() throws Exception {
 
@@ -2700,7 +2650,6 @@
      *
      * @throws Exception
      */
-    // TODO : remove TC_API_056
     @LargeTest
     public void testNullAPIs() throws Exception {
 
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/VideoEditorExportTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/VideoEditorExportTest.java
index 57a1c75..69ecf0d 100755
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/VideoEditorExportTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/VideoEditorExportTest.java
@@ -91,7 +91,6 @@
     /**
      * To Test export : Merge and Trim different types of Video and Image files
      */
-    // TODO :remove TC_EXP_001
     @LargeTest
     public void testExportMergeTrim() throws Exception {
         final String videoItemFilename1 = INPUT_FILE_PATH
@@ -173,7 +172,6 @@
     /**
      *To Test export : With Effect and Overlays on Different Media Items
      */
-    // TODO :remove TC_EXP_002
     @LargeTest
     public void testExportEffectOverlay() throws Exception {
           final String videoItemFilename1 = INPUT_FILE_PATH
@@ -301,7 +299,6 @@
     /**
      * To test export : with Image with KenBurnEffect
      */
-    // TODO : remove TC_EXP_003
     @LargeTest
     public void testExportEffectKenBurn() throws Exception {
         final String imageItemFileName = INPUT_FILE_PATH + "IMG_640x480.jpg";
@@ -359,7 +356,6 @@
     /**
      * To Test Export : With Video and Image and An Audio BackGround Track
      */
-    // TODO : remove TC_EXP_004
     @LargeTest
     public void testExportAudio() throws Exception {
         final String videoItemFileName = INPUT_FILE_PATH
@@ -420,7 +416,6 @@
     /**
      *To Test export : With Transition on Different Media Items
      */
-    // TODO :remove TC_EXP_005
     @LargeTest
     public void testExportTransition() throws Exception {
         final String videoItemFilename1 = INPUT_FILE_PATH
@@ -540,7 +535,6 @@
      *
      * @throws Exception
      */
-    // TODO :remove TC_EXP_006
     @LargeTest
     public void testExportWithoutMediaItems() throws Exception {
         boolean flagForException = false;
@@ -566,7 +560,6 @@
      *
      * @throws Exception
      */
-    // TODO :remove TC_EXP_007
     @LargeTest
     public void testExportWithoutMediaItemsAddRemove() throws Exception {
         final String videoItemFilename1 = INPUT_FILE_PATH +
@@ -621,7 +614,6 @@
      *
      * @throws Exception
      */
-    // TODO :remove TC_EXP_008
     @LargeTest
     public void testExportMMS() throws Exception {
         final String videoItemFilename1 = INPUT_FILE_PATH
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/VideoEditorPreviewTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/VideoEditorPreviewTest.java
index 4181903..7965b0a 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/VideoEditorPreviewTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/VideoEditorPreviewTest.java
@@ -216,7 +216,6 @@
     /**
      *To test Preview : FULL Preview of current work (beginning till end)
      */
-    // TODO : remove TC_PRV_001
     @LargeTest
     public void testPreviewTheStoryBoard() throws Exception {
         final String videoItemFileName1 = INPUT_FILE_PATH
@@ -275,7 +274,6 @@
     /**
      * To test Preview : Preview of start + 10 sec till end of story board
      */
-    // TODO : remove TC_PRV_002
     @LargeTest
     public void testPreviewTheStoryBoardFromDuration() throws Exception {
         final String videoItemFileName1 = INPUT_FILE_PATH
@@ -336,7 +334,6 @@
     /**
      * To test Preview : Preview of current Effects applied
      */
-    // TODO : remove TC_PRV_003
     @LargeTest
     public void testPreviewOfEffects() throws Exception {
         final String videoItemFileName1 = INPUT_FILE_PATH +
@@ -394,7 +391,6 @@
      *To test Preview : Preview of current Transitions applied (with multiple
      * generatePreview)
      */
-    // TODO : remove TC_PRV_004
     @LargeTest
     public void testPreviewWithTransition() throws Exception {
 
@@ -547,7 +543,6 @@
     /**
      * To test Preview : Preview of current Overlay applied
      */
-    // TODO : remove TC_PRV_005
     @LargeTest
     public void testPreviewWithOverlay() throws Exception {
         final String videoItemFileName = INPUT_FILE_PATH
@@ -601,7 +596,6 @@
      * To test Preview : Preview of current Trim applied (with default aspect
      * ratio)
      */
-    // TODO : remove TC_PRV_006
     @LargeTest
     public void testPreviewWithTrim() throws Exception {
         final String videoItemFileName = INPUT_FILE_PATH +
@@ -625,7 +619,6 @@
      * applied
      */
 
-    // TODO : remove TC_PRV_007
     @LargeTest
     public void testPreviewWithOverlayEffectKenBurn() throws Exception {
 
@@ -684,7 +677,6 @@
     /**
      *To test Preview : Export during preview
      */
-    // TODO : remove TC_PRV_008
     @LargeTest
     public void testPreviewDuringExport() throws Exception {
         final String videoItemFileName = INPUT_FILE_PATH +
@@ -765,7 +757,6 @@
      * To test Preview : Preview of current Effects applied (with from time >
      * total duration)
      */
-    // TODO : remove TC_PRV_009
     @LargeTest
     public void testPreviewWithDurationGreaterThanMediaDuration()
         throws Exception {
@@ -826,7 +817,6 @@
      * To test Preview : Preview of current Effects applied (with Render Preview
      * Frame)
      */
-    // TODO : remove TC_PRV_010
     @LargeTest
     public void testPreviewWithRenderPreviewFrame() throws Exception {
         final String videoItemFileName = INPUT_FILE_PATH +
@@ -873,7 +863,6 @@
      * To test Preview : Preview of current work from selected jump location
      * till end with Audio Track
      */
-    // TODO : remove TC_PRV_011
     @LargeTest
     public void testPreviewWithEndAudioTrack() throws Exception {
         final String imageItemFilename1 = INPUT_FILE_PATH + "IMG_1600x1200.jpg";
@@ -917,7 +906,6 @@
     /**
      * To test render Preview Frame
      */
-    // TODO : remove TC_PRV_012
     @LargeTest
     public void testRenderPreviewFrame() throws Exception {
         final String videoItemFileName1 = INPUT_FILE_PATH
@@ -1031,7 +1019,6 @@
     /**
      * To Test Preview : Without any Media Items in the story Board
      */
-    // TODO : remove TC_PRV_013
     @LargeTest
     public void testStartPreviewWithoutMediaItems() throws Exception {
         boolean flagForException = false;
@@ -1064,7 +1051,6 @@
      * To Test Preview : Add Media and Remove Media Item (Without any Media
      * Items in the story Board)
      */
-    // TODO : remove TC_PRV_014
     @LargeTest
     public void testStartPreviewAddRemoveMediaItems() throws Exception {
         final String videoItemFilename1 = INPUT_FILE_PATH
@@ -1134,7 +1120,6 @@
      * To test Preview : Preview of current Effects applied (with Render Preview
      * Frame)
      */
-    // TODO : remove TC_PRV_015
     @LargeTest
     public void testPreviewWithRenderPreviewFrameWithoutGenerate() throws Exception {
         final String videoItemFileName = INPUT_FILE_PATH +
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/VideoEditorPerformance.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/VideoEditorPerformance.java
index 3d0be4f..6f1959c 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/VideoEditorPerformance.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/VideoEditorPerformance.java
@@ -931,7 +931,6 @@
     /**
      *To test ThumbnailList for H264
      */
-    // TODO : TC_PRF_12
     @LargeTest
     public void testThumbnailH264NonIFrame() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH +
@@ -962,7 +961,6 @@
     /**
      *To test ThumbnailList for H264
      */
-    // TODO : TC_PRF_13
     @LargeTest
     public void testThumbnailH264AnIFrame() throws Exception {
         final String videoItemFilename = INPUT_FILE_PATH +
diff --git a/native/include/android/configuration.h b/native/include/android/configuration.h
index 4d683fb..06cd3da 100644
--- a/native/include/android/configuration.h
+++ b/native/include/android/configuration.h
@@ -42,6 +42,8 @@
     ACONFIGURATION_DENSITY_MEDIUM = 160,
     ACONFIGURATION_DENSITY_TV = 213,
     ACONFIGURATION_DENSITY_HIGH = 240,
+    ACONFIGURATION_DENSITY_XHIGH = 320,
+    ACONFIGURATION_DENSITY_XXHIGH = 480,
     ACONFIGURATION_DENSITY_NONE = 0xffff,
 
     ACONFIGURATION_KEYBOARD_ANY  = 0x0000,
diff --git a/opengl/include/GLES/glext.h b/opengl/include/GLES/glext.h
index 65ab5e4..54afaab 100644
--- a/opengl/include/GLES/glext.h
+++ b/opengl/include/GLES/glext.h
@@ -1,7 +1,7 @@
 #ifndef __glext_h_
 #define __glext_h_
 
-/* $Revision: 10965 $ on $Date:: 2010-04-09 02:11:29 -0700 #$ */
+/* $Revision: 16481 $ on $Date:: 2012-01-04 10:43:56 -0800 #$ */
 
 #ifdef __cplusplus
 extern "C" {
@@ -68,6 +68,14 @@
 typedef void* GLeglImageOES;
 #endif
 
+/* GL_OES_EGL_image_external */
+#ifndef GL_OES_EGL_image_external
+/* GLeglImageOES defined in GL_OES_EGL_image already. */
+#define GL_TEXTURE_EXTERNAL_OES                                 0x8D65
+#define GL_TEXTURE_BINDING_EXTERNAL_OES                         0x8D67
+#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES                     0x8D68
+#endif
+
 /* GL_OES_element_index_uint */
 #ifndef GL_OES_element_index_uint
 #define GL_UNSIGNED_INT                                         0x1405
@@ -211,14 +219,6 @@
 #define GL_VERTEX_ARRAY_BINDING_OES                             0x85B5
 #endif
 
-/* GL_OES_EGL_image_external */
-#ifndef GL_OES_EGL_image_external
-#define GL_TEXTURE_EXTERNAL_OES                                 0x8D65
-#define GL_SAMPLER_EXTERNAL_OES                                 0x8D66
-#define GL_TEXTURE_BINDING_EXTERNAL_OES                         0x8D67
-#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES                     0x8D68
-#endif
-
 /*------------------------------------------------------------------------*
  * AMD extension tokens
  *------------------------------------------------------------------------*/
@@ -243,6 +243,34 @@
 /* GL_APPLE_texture_2D_limited_npot */
 /* No new tokens introduced by this extension. */
 
+/* GL_APPLE_framebuffer_multisample */
+#ifndef GL_APPLE_framebuffer_multisample
+#define GL_RENDERBUFFER_SAMPLES_APPLE                           0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE             0x8D56
+#define GL_MAX_SAMPLES_APPLE                                    0x8D57
+#define GL_READ_FRAMEBUFFER_APPLE                               0x8CA8
+#define GL_DRAW_FRAMEBUFFER_APPLE                               0x8CA9
+#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE                       0x8CA6
+#define GL_READ_FRAMEBUFFER_BINDING_APPLE                       0x8CAA
+#endif
+
+/* GL_APPLE_texture_format_BGRA8888 */
+#ifndef GL_APPLE_texture_format_BGRA8888
+#define GL_BGRA_EXT                                             0x80E1
+#endif
+
+/* GL_APPLE_texture_max_level */
+#ifndef GL_APPLE_texture_max_level
+#define GL_TEXTURE_MAX_LEVEL_APPLE                              0x813D
+#endif
+
+/*------------------------------------------------------------------------*
+ * ARM extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_ARM_rgba8 */
+/* No new tokens introduced by this extension. */
+
 /*------------------------------------------------------------------------*
  * EXT extension tokens
  *------------------------------------------------------------------------*/
@@ -260,6 +288,14 @@
 #define GL_STENCIL_EXT                                          0x1802
 #endif
 
+/* GL_EXT_multisampled_render_to_texture */
+#ifndef GL_EXT_multisampled_render_to_texture
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT           0x8D6C
+#define GL_RENDERBUFFER_SAMPLES_EXT                             0x9133
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT               0x9134
+#define GL_MAX_SAMPLES_EXT                                      0x9135
+#endif
+
 /* GL_EXT_multi_draw_arrays */
 /* No new tokens introduced by this extension. */
 
@@ -270,6 +306,32 @@
 #define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT                       0x8366
 #endif
 
+/* GL_EXT_robustness */
+#ifndef GL_EXT_robustness
+/* reuse GL_NO_ERROR */
+#define GL_GUILTY_CONTEXT_RESET_EXT                             0x8253
+#define GL_INNOCENT_CONTEXT_RESET_EXT                           0x8254
+#define GL_UNKNOWN_CONTEXT_RESET_EXT                            0x8255
+#define GL_CONTEXT_ROBUST_ACCESS_EXT                            0x90F3
+#define GL_RESET_NOTIFICATION_STRATEGY_EXT                      0x8256
+#define GL_LOSE_CONTEXT_ON_RESET_EXT                            0x8252
+#define GL_NO_RESET_NOTIFICATION_EXT                            0x8261
+#endif
+
+/* GL_EXT_sRGB */
+#ifndef GL_EXT_sRGB
+#define GL_SRGB_EXT                                             0x8C40
+#define GL_SRGB_ALPHA_EXT                                       0x8C42
+#define GL_SRGB8_ALPHA8_EXT                                     0x8C43
+#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT            0x8210
+#endif
+
+/* GL_EXT_texture_compression_dxt1 */
+#ifndef GL_EXT_texture_compression_dxt1
+#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT                         0x83F0
+#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT                        0x83F1
+#endif
+
 /* GL_EXT_texture_filter_anisotropic */
 #ifndef GL_EXT_texture_filter_anisotropic
 #define GL_TEXTURE_MAX_ANISOTROPY_EXT                           0x84FE
@@ -288,6 +350,27 @@
 #define GL_TEXTURE_LOD_BIAS_EXT                                 0x8501
 #endif
 
+/* GL_EXT_texture_storage */
+#ifndef GL_EXT_texture_storage
+#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT                         0x912F
+#define GL_ALPHA8_EXT                                           0x803C  
+#define GL_LUMINANCE8_EXT                                       0x8040
+#define GL_LUMINANCE8_ALPHA8_EXT                                0x8045
+#define GL_RGBA32F_EXT                                          0x8814  
+#define GL_RGB32F_EXT                                           0x8815
+#define GL_ALPHA32F_EXT                                         0x8816
+#define GL_LUMINANCE32F_EXT                                     0x8818
+#define GL_LUMINANCE_ALPHA32F_EXT                               0x8819
+/* reuse GL_RGBA16F_EXT */
+#define GL_RGB16F_EXT                                           0x881B
+#define GL_ALPHA16F_EXT                                         0x881C
+#define GL_LUMINANCE16F_EXT                                     0x881E
+#define GL_LUMINANCE_ALPHA16F_EXT                               0x881F
+#define GL_RGB10_A2_EXT                                         0x8059  
+#define GL_RGB10_EXT                                            0x8052
+#define GL_BGRA8_EXT                                            0x93A1
+#endif
+
 /*------------------------------------------------------------------------*
  * IMG extension tokens
  *------------------------------------------------------------------------*/
@@ -507,6 +590,12 @@
 typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
 #endif
 
+/* GL_OES_EGL_image_external */
+#ifndef GL_OES_EGL_image_external
+#define GL_OES_EGL_image_external 1
+/* glEGLImageTargetTexture2DOES defined in GL_OES_EGL_image already. */
+#endif
+
 /* GL_OES_element_index_uint */
 #ifndef GL_OES_element_index_uint
 #define GL_OES_element_index_uint 1
@@ -785,11 +874,6 @@
 typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array);
 #endif
 
-/* GL_OES_EGL_image_external */
-#ifndef GL_OES_EGL_image_external
-#define GL_OES_EGL_image_external 1
-#endif
-
 /*------------------------------------------------------------------------*
  * AMD extension functions
  *------------------------------------------------------------------------*/
@@ -813,6 +897,36 @@
 #define GL_APPLE_texture_2D_limited_npot 1
 #endif
 
+/* GL_APPLE_framebuffer_multisample */
+#ifndef GL_APPLE_framebuffer_multisample
+#define GL_APPLE_framebuffer_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GL_API void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void);
+#endif
+
+/* GL_APPLE_texture_format_BGRA8888 */
+#ifndef GL_APPLE_texture_format_BGRA8888
+#define GL_APPLE_texture_format_BGRA8888 1
+#endif
+
+/* GL_APPLE_texture_max_level */
+#ifndef GL_APPLE_texture_max_level
+#define GL_APPLE_texture_max_level 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * ARM extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_ARM_rgba8 */
+#ifndef GL_ARM_rgba8
+#define GL_ARM_rgba8 1
+#endif
+
 /*------------------------------------------------------------------------*
  * EXT extension functions
  *------------------------------------------------------------------------*/
@@ -831,6 +945,17 @@
 typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
 #endif
 
+/* GL_EXT_multisampled_render_to_texture */
+#ifndef GL_EXT_multisampled_render_to_texture
+#define GL_EXT_multisampled_render_to_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GL_API void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+#endif
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+#endif
+
 /* GL_EXT_multi_draw_arrays */
 #ifndef GL_EXT_multi_draw_arrays
 #define GL_EXT_multi_draw_arrays 1
@@ -847,6 +972,31 @@
 #define GL_EXT_read_format_bgra 1
 #endif
 
+/* GL_EXT_robustness */
+#ifndef GL_EXT_robustness
+#define GL_EXT_robustness 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void);
+GL_API void GL_APIENTRY glReadnPixelsEXT (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+GL_API void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, float *params);
+GL_API void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+#endif
+typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void);
+typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, float *params);
+typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+#endif
+
+/* GL_EXT_sRGB */
+#ifndef GL_EXT_sRGB
+#define GL_EXT_sRGB 1
+#endif
+
+/* GL_EXT_texture_compression_dxt1 */
+#ifndef GL_EXT_texture_compression_dxt1
+#define GL_EXT_texture_compression_dxt1 1
+#endif
+
 /* GL_EXT_texture_filter_anisotropic */
 #ifndef GL_EXT_texture_filter_anisotropic
 #define GL_EXT_texture_filter_anisotropic 1
@@ -862,6 +1012,25 @@
 #define GL_EXT_texture_lod_bias 1
 #endif
 
+/* GL_EXT_texture_storage */
+#ifndef GL_EXT_texture_storage
+#define GL_EXT_texture_storage 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+GL_API void GL_APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+GL_API void GL_APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+GL_API void GL_APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+GL_API void GL_APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+GL_API void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+#endif
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+#endif
+
 /*------------------------------------------------------------------------*
  * IMG extension functions
  *------------------------------------------------------------------------*/
diff --git a/opengl/include/GLES2/gl2ext.h b/opengl/include/GLES2/gl2ext.h
index 9db4e252c..8f8d80a1 100644
--- a/opengl/include/GLES2/gl2ext.h
+++ b/opengl/include/GLES2/gl2ext.h
@@ -1,7 +1,7 @@
 #ifndef __gl2ext_h_
 #define __gl2ext_h_
 
-/* $Revision: 10969 $ on $Date:: 2010-04-09 02:27:15 -0700 #$ */
+/* $Revision: 16619 $ on $Date:: 2012-01-18 10:00:14 -0800 #$ */
 
 #ifdef __cplusplus
 extern "C" {
@@ -57,6 +57,15 @@
 typedef void* GLeglImageOES;
 #endif
 
+/* GL_OES_EGL_image_external */
+#ifndef GL_OES_EGL_image_external
+/* GLeglImageOES defined in GL_OES_EGL_image already. */
+#define GL_TEXTURE_EXTERNAL_OES                                 0x8D65
+#define GL_SAMPLER_EXTERNAL_OES                                 0x8D66
+#define GL_TEXTURE_BINDING_EXTERNAL_OES                         0x8D67
+#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES                     0x8D68
+#endif
+
 /* GL_OES_element_index_uint */
 #ifndef GL_OES_element_index_uint
 #define GL_UNSIGNED_INT                                         0x1405
@@ -146,14 +155,6 @@
 #define GL_INT_10_10_10_2_OES                                   0x8DF7
 #endif
 
-/* GL_OES_EGL_image_external */
-#ifndef GL_OES_EGL_image_external
-#define GL_TEXTURE_EXTERNAL_OES                                 0x8D65
-#define GL_SAMPLER_EXTERNAL_OES                                 0x8D66
-#define GL_TEXTURE_BINDING_EXTERNAL_OES                         0x8D67
-#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES                     0x8D68
-#endif
-
 /*------------------------------------------------------------------------*
  * AMD extension tokens
  *------------------------------------------------------------------------*/
@@ -188,6 +189,69 @@
 #endif
 
 /*------------------------------------------------------------------------*
+ * ANGLE extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_ANGLE_framebuffer_blit */
+#ifndef GL_ANGLE_framebuffer_blit
+#define GL_READ_FRAMEBUFFER_ANGLE                               0x8CA8
+#define GL_DRAW_FRAMEBUFFER_ANGLE                               0x8CA9
+#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE                       0x8CA6
+#define GL_READ_FRAMEBUFFER_BINDING_ANGLE                       0x8CAA
+#endif
+
+/* GL_ANGLE_framebuffer_multisample */
+#ifndef GL_ANGLE_framebuffer_multisample
+#define GL_RENDERBUFFER_SAMPLES_ANGLE                           0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE             0x8D56
+#define GL_MAX_SAMPLES_ANGLE                                    0x8D57
+#endif
+
+/*------------------------------------------------------------------------*
+ * APPLE extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_APPLE_rgb_422 */
+#ifndef GL_APPLE_rgb_422
+#define GL_RGB_422_APPLE                                        0x8A1F
+#define GL_UNSIGNED_SHORT_8_8_APPLE                             0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_APPLE                         0x85BB
+#endif
+
+/* GL_APPLE_framebuffer_multisample */
+#ifndef GL_APPLE_framebuffer_multisample
+#define GL_RENDERBUFFER_SAMPLES_APPLE                           0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE             0x8D56
+#define GL_MAX_SAMPLES_APPLE                                    0x8D57
+#define GL_READ_FRAMEBUFFER_APPLE                               0x8CA8
+#define GL_DRAW_FRAMEBUFFER_APPLE                               0x8CA9
+#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE                       0x8CA6
+#define GL_READ_FRAMEBUFFER_BINDING_APPLE                       0x8CAA
+#endif
+
+/* GL_APPLE_texture_format_BGRA8888 */
+#ifndef GL_APPLE_texture_format_BGRA8888
+#define GL_BGRA_EXT                                             0x80E1
+#endif
+
+/* GL_APPLE_texture_max_level */
+#ifndef GL_APPLE_texture_max_level
+#define GL_TEXTURE_MAX_LEVEL_APPLE                              0x813D
+#endif
+
+/*------------------------------------------------------------------------*
+ * ARM extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_ARM_mali_shader_binary */
+#ifndef GL_ARM_mali_shader_binary
+#define GL_MALI_SHADER_BINARY_ARM                               0x8F60
+#endif
+
+/* GL_ARM_rgba8 */
+/* No new tokens introduced by this extension. */
+
+/*------------------------------------------------------------------------*
  * EXT extension tokens
  *------------------------------------------------------------------------*/
 
@@ -197,6 +261,29 @@
 #define GL_MAX_EXT                                              0x8008
 #endif
 
+/* GL_EXT_color_buffer_half_float */
+#ifndef GL_EXT_color_buffer_half_float
+#define GL_RGBA16F_EXT                                          0x881A
+#define GL_RGB16F_EXT                                           0x881B
+#define GL_RG16F_EXT                                            0x822F
+#define GL_R16F_EXT                                             0x822D
+#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT            0x8211
+#define GL_UNSIGNED_NORMALIZED_EXT                              0x8C17
+#endif
+
+/* GL_EXT_debug_label */
+#ifndef GL_EXT_debug_label
+#define GL_PROGRAM_PIPELINE_OBJECT_EXT                          0x8A4F
+#define GL_PROGRAM_OBJECT_EXT                                   0x8B40
+#define GL_SHADER_OBJECT_EXT                                    0x8B48
+#define GL_BUFFER_OBJECT_EXT                                    0x9151
+#define GL_QUERY_OBJECT_EXT                                     0x9153
+#define GL_VERTEX_ARRAY_OBJECT_EXT                              0x9154
+#endif
+
+/* GL_EXT_debug_marker */
+/* No new tokens introduced by this extension. */
+
 /* GL_EXT_discard_framebuffer */
 #ifndef GL_EXT_discard_framebuffer
 #define GL_COLOR_EXT                                            0x1800
@@ -204,9 +291,26 @@
 #define GL_STENCIL_EXT                                          0x1802
 #endif
 
+/* GL_EXT_multisampled_render_to_texture */
+#ifndef GL_EXT_multisampled_render_to_texture
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT           0x8D6C
+#define GL_RENDERBUFFER_SAMPLES_EXT                             0x9133
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT               0x9134
+#define GL_MAX_SAMPLES_EXT                                      0x9135
+#endif
+
 /* GL_EXT_multi_draw_arrays */
 /* No new tokens introduced by this extension. */
 
+/* GL_EXT_occlusion_query_boolean */
+#ifndef GL_EXT_occlusion_query_boolean
+#define GL_ANY_SAMPLES_PASSED_EXT                               0x8C2F
+#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT                  0x8D6A
+#define GL_CURRENT_QUERY_EXT                                    0x8865
+#define GL_QUERY_RESULT_EXT                                     0x8866
+#define GL_QUERY_RESULT_AVAILABLE_EXT                           0x8867
+#endif
+
 /* GL_EXT_read_format_bgra */
 #ifndef GL_EXT_read_format_bgra
 #define GL_BGRA_EXT                                             0x80E1
@@ -214,6 +318,53 @@
 #define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT                       0x8366
 #endif
 
+/* GL_EXT_robustness */
+#ifndef GL_EXT_robustness
+/* reuse GL_NO_ERROR */
+#define GL_GUILTY_CONTEXT_RESET_EXT                             0x8253
+#define GL_INNOCENT_CONTEXT_RESET_EXT                           0x8254
+#define GL_UNKNOWN_CONTEXT_RESET_EXT                            0x8255
+#define GL_CONTEXT_ROBUST_ACCESS_EXT                            0x90F3
+#define GL_RESET_NOTIFICATION_STRATEGY_EXT                      0x8256
+#define GL_LOSE_CONTEXT_ON_RESET_EXT                            0x8252
+#define GL_NO_RESET_NOTIFICATION_EXT                            0x8261
+#endif
+
+/* GL_EXT_separate_shader_objects */
+#ifndef GL_EXT_separate_shader_objects
+#define GL_VERTEX_SHADER_BIT_EXT                                0x00000001
+#define GL_FRAGMENT_SHADER_BIT_EXT                              0x00000002
+#define GL_ALL_SHADER_BITS_EXT                                  0xFFFFFFFF
+#define GL_PROGRAM_SEPARABLE_EXT                                0x8258
+#define GL_ACTIVE_PROGRAM_EXT                                   0x8259
+#define GL_PROGRAM_PIPELINE_BINDING_EXT                         0x825A
+#endif
+
+/* GL_EXT_shader_texture_lod */
+/* No new tokens introduced by this extension. */
+
+/* GL_EXT_shadow_samplers */
+#ifndef GL_EXT_shadow_samplers
+#define GL_TEXTURE_COMPARE_MODE_EXT                             0x884C
+#define GL_TEXTURE_COMPARE_FUNC_EXT                             0x884D
+#define GL_COMPARE_REF_TO_TEXTURE_EXT                           0x884E
+#define GL_SAMPLER_2D_SHADOW_EXT                                0x8B62
+#endif
+
+/* GL_EXT_sRGB */
+#ifndef GL_EXT_sRGB
+#define GL_SRGB_EXT                                             0x8C40
+#define GL_SRGB_ALPHA_EXT                                       0x8C42
+#define GL_SRGB8_ALPHA8_EXT                                     0x8C43
+#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT            0x8210
+#endif
+
+/* GL_EXT_texture_compression_dxt1 */
+#ifndef GL_EXT_texture_compression_dxt1
+#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT                         0x83F0
+#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT                        0x83F1
+#endif
+
 /* GL_EXT_texture_filter_anisotropic */
 #ifndef GL_EXT_texture_filter_anisotropic
 #define GL_TEXTURE_MAX_ANISOTROPY_EXT                           0x84FE
@@ -225,15 +376,54 @@
 #define GL_BGRA_EXT                                             0x80E1
 #endif
 
+/* GL_EXT_texture_rg */
+#ifndef GL_EXT_texture_rg
+#define GL_RED_EXT                                              0x1903
+#define GL_RG_EXT                                               0x8227
+#define GL_R8_EXT                                               0x8229
+#define GL_RG8_EXT                                              0x822B
+#endif
+
+/* GL_EXT_texture_storage */
+#ifndef GL_EXT_texture_storage
+#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT                         0x912F
+#define GL_ALPHA8_EXT                                           0x803C  
+#define GL_LUMINANCE8_EXT                                       0x8040
+#define GL_LUMINANCE8_ALPHA8_EXT                                0x8045
+#define GL_RGBA32F_EXT                                          0x8814  
+#define GL_RGB32F_EXT                                           0x8815
+#define GL_ALPHA32F_EXT                                         0x8816
+#define GL_LUMINANCE32F_EXT                                     0x8818
+#define GL_LUMINANCE_ALPHA32F_EXT                               0x8819
+/* reuse GL_RGBA16F_EXT */
+#define GL_RGB16F_EXT                                           0x881B
+#define GL_ALPHA16F_EXT                                         0x881C
+#define GL_LUMINANCE16F_EXT                                     0x881E
+#define GL_LUMINANCE_ALPHA16F_EXT                               0x881F
+#define GL_RGB10_A2_EXT                                         0x8059  
+#define GL_RGB10_EXT                                            0x8052
+#define GL_BGRA8_EXT                                            0x93A1
+#endif
+
 /* GL_EXT_texture_type_2_10_10_10_REV */
 #ifndef GL_EXT_texture_type_2_10_10_10_REV
 #define GL_UNSIGNED_INT_2_10_10_10_REV_EXT                      0x8368
 #endif
 
-/* GL_EXT_texture_compression_dxt1 */
-#ifndef GL_EXT_texture_compression_dxt1
-#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT                         0x83F0
-#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT                        0x83F1
+/* GL_EXT_unpack_subimage */
+#ifndef GL_EXT_unpack_subimage
+#define GL_UNPACK_ROW_LENGTH                                    0x0CF2
+#define GL_UNPACK_SKIP_ROWS                                     0x0CF3
+#define GL_UNPACK_SKIP_PIXELS                                   0x0CF4
+#endif
+
+/*------------------------------------------------------------------------*
+ * DMP extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_DMP_shader_binary */
+#ifndef GL_DMP_shader_binary
+#define GL_SHADER_BINARY_DMP                                    0x9250
 #endif
 
 /*------------------------------------------------------------------------*
@@ -276,13 +466,6 @@
  * NV extension tokens
  *------------------------------------------------------------------------*/
 
-/* GL_NV_fence */
-#ifndef GL_NV_fence
-#define GL_ALL_COMPLETED_NV                                     0x84F2
-#define GL_FENCE_STATUS_NV                                      0x84F3
-#define GL_FENCE_CONDITION_NV                                   0x84F4
-#endif
-
 /* GL_NV_coverage_sample */
 #ifndef GL_NV_coverage_sample
 #define GL_COVERAGE_COMPONENT_NV                                0x8ED0
@@ -301,10 +484,90 @@
 #define GL_DEPTH_COMPONENT16_NONLINEAR_NV                       0x8E2C
 #endif
 
+/* GL_NV_draw_buffers */
+#ifndef GL_NV_draw_buffers
+#define GL_MAX_DRAW_BUFFERS_NV                                  0x8824
+#define GL_DRAW_BUFFER0_NV                                      0x8825
+#define GL_DRAW_BUFFER1_NV                                      0x8826
+#define GL_DRAW_BUFFER2_NV                                      0x8827
+#define GL_DRAW_BUFFER3_NV                                      0x8828
+#define GL_DRAW_BUFFER4_NV                                      0x8829
+#define GL_DRAW_BUFFER5_NV                                      0x882A
+#define GL_DRAW_BUFFER6_NV                                      0x882B
+#define GL_DRAW_BUFFER7_NV                                      0x882C
+#define GL_DRAW_BUFFER8_NV                                      0x882D
+#define GL_DRAW_BUFFER9_NV                                      0x882E
+#define GL_DRAW_BUFFER10_NV                                     0x882F
+#define GL_DRAW_BUFFER11_NV                                     0x8830
+#define GL_DRAW_BUFFER12_NV                                     0x8831
+#define GL_DRAW_BUFFER13_NV                                     0x8832
+#define GL_DRAW_BUFFER14_NV                                     0x8833
+#define GL_DRAW_BUFFER15_NV                                     0x8834
+#define GL_COLOR_ATTACHMENT0_NV                                 0x8CE0
+#define GL_COLOR_ATTACHMENT1_NV                                 0x8CE1
+#define GL_COLOR_ATTACHMENT2_NV                                 0x8CE2
+#define GL_COLOR_ATTACHMENT3_NV                                 0x8CE3
+#define GL_COLOR_ATTACHMENT4_NV                                 0x8CE4
+#define GL_COLOR_ATTACHMENT5_NV                                 0x8CE5
+#define GL_COLOR_ATTACHMENT6_NV                                 0x8CE6
+#define GL_COLOR_ATTACHMENT7_NV                                 0x8CE7
+#define GL_COLOR_ATTACHMENT8_NV                                 0x8CE8
+#define GL_COLOR_ATTACHMENT9_NV                                 0x8CE9
+#define GL_COLOR_ATTACHMENT10_NV                                0x8CEA
+#define GL_COLOR_ATTACHMENT11_NV                                0x8CEB
+#define GL_COLOR_ATTACHMENT12_NV                                0x8CEC
+#define GL_COLOR_ATTACHMENT13_NV                                0x8CED
+#define GL_COLOR_ATTACHMENT14_NV                                0x8CEE
+#define GL_COLOR_ATTACHMENT15_NV                                0x8CEF
+#endif
+
+/* GL_NV_fbo_color_attachments */
+#ifndef GL_NV_fbo_color_attachments
+#define GL_MAX_COLOR_ATTACHMENTS_NV                             0x8CDF
+/* GL_COLOR_ATTACHMENT{0-15}_NV defined in GL_NV_draw_buffers already. */
+#endif
+
+/* GL_NV_fence */
+#ifndef GL_NV_fence
+#define GL_ALL_COMPLETED_NV                                     0x84F2
+#define GL_FENCE_STATUS_NV                                      0x84F3
+#define GL_FENCE_CONDITION_NV                                   0x84F4
+#endif
+
+/* GL_NV_read_buffer */
+#ifndef GL_NV_read_buffer
+#define GL_READ_BUFFER_NV                                       0x0C02
+#endif
+
+/* GL_NV_read_buffer_front */
+/* No new tokens introduced by this extension. */
+
+/* GL_NV_read_depth */
+/* No new tokens introduced by this extension. */
+
+/* GL_NV_read_depth_stencil */
+/* No new tokens introduced by this extension. */
+
+/* GL_NV_read_stencil */
+/* No new tokens introduced by this extension. */
+
+/* GL_NV_texture_compression_s3tc_update */
+/* No new tokens introduced by this extension. */
+
+/* GL_NV_texture_npot_2D_mipmap */
+/* No new tokens introduced by this extension. */
+
 /*------------------------------------------------------------------------*
  * QCOM extension tokens
  *------------------------------------------------------------------------*/
 
+/* GL_QCOM_alpha_test */
+#ifndef GL_QCOM_alpha_test
+#define GL_ALPHA_TEST_QCOM                                      0x0BC0
+#define GL_ALPHA_TEST_FUNC_QCOM                                 0x0BC1
+#define GL_ALPHA_TEST_REF_QCOM                                  0x0BC2
+#endif
+
 /* GL_QCOM_driver_control */
 /* No new tokens introduced by this extension. */
 
@@ -373,6 +636,15 @@
 #endif
 
 /*------------------------------------------------------------------------*
+ * VIV extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_VIV_shader_binary */
+#ifndef GL_VIV_shader_binary
+#define GL_SHADER_BINARY_VIV                                    0x8FC4
+#endif
+
+/*------------------------------------------------------------------------*
  * End of extension tokens, start of corresponding extension functions
  *------------------------------------------------------------------------*/
 
@@ -416,6 +688,12 @@
 typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
 #endif
 
+/* GL_OES_EGL_image_external */
+#ifndef GL_OES_EGL_image_external
+#define GL_OES_EGL_image_external 1
+/* glEGLImageTargetTexture2DOES defined in GL_OES_EGL_image already. */
+#endif
+
 /* GL_OES_element_index_uint */
 #ifndef GL_OES_element_index_uint
 #define GL_OES_element_index_uint 1
@@ -549,11 +827,6 @@
 #define GL_OES_vertex_type_10_10_10_2 1
 #endif
 
-/* GL_OES_EGL_image_external */
-#ifndef GL_OES_EGL_image_external
-#define GL_OES_EGL_image_external 1
-#endif
-
 /*------------------------------------------------------------------------*
  * AMD extension functions
  *------------------------------------------------------------------------*/
@@ -603,6 +876,72 @@
 #endif
 
 /*------------------------------------------------------------------------*
+ * ANGLE extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_ANGLE_framebuffer_blit */
+#ifndef GL_ANGLE_framebuffer_blit
+#define GL_ANGLE_framebuffer_blit 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glBlitFramebufferANGLE (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif
+typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif
+
+/* GL_ANGLE_framebuffer_multisample */
+#ifndef GL_ANGLE_framebuffer_multisample
+#define GL_ANGLE_framebuffer_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+
+/*------------------------------------------------------------------------*
+ * APPLE extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_APPLE_rgb_422 */
+#ifndef GL_APPLE_rgb_422
+#define GL_APPLE_rgb_422 1
+#endif
+
+/* GL_APPLE_framebuffer_multisample */
+#ifndef GL_APPLE_framebuffer_multisample
+#define GL_APPLE_framebuffer_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void);
+#endif
+
+/* GL_APPLE_texture_format_BGRA8888 */
+#ifndef GL_APPLE_texture_format_BGRA8888
+#define GL_APPLE_texture_format_BGRA8888 1
+#endif
+
+/* GL_APPLE_texture_max_level */
+#ifndef GL_APPLE_texture_max_level
+#define GL_APPLE_texture_max_level 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * ARM extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_ARM_mali_shader_binary */
+#ifndef GL_ARM_mali_shader_binary
+#define GL_ARM_mali_shader_binary 1
+#endif
+
+/* GL_ARM_rgba8 */
+#ifndef GL_ARM_rgba8
+#define GL_ARM_rgba8 1
+#endif
+
+/*------------------------------------------------------------------------*
  * EXT extension functions
  *------------------------------------------------------------------------*/
 
@@ -611,6 +950,35 @@
 #define GL_EXT_blend_minmax 1
 #endif
 
+/* GL_EXT_color_buffer_half_float */
+#ifndef GL_EXT_color_buffer_half_float
+#define GL_EXT_color_buffer_half_float 1
+#endif
+
+/* GL_EXT_debug_label */
+#ifndef GL_EXT_debug_label
+#define GL_EXT_debug_label 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label);
+GL_APICALL void GL_APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
+#endif
+typedef void (GL_APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label);
+typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
+#endif
+
+/* GL_EXT_debug_marker */
+#ifndef GL_EXT_debug_marker
+#define GL_EXT_debug_marker 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker);
+GL_APICALL void GL_APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker);
+GL_APICALL void GL_APIENTRY glPopGroupMarkerEXT (void);
+#endif
+typedef void (GL_APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker);
+typedef void (GL_APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker);
+typedef void (GL_APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void);
+#endif
+
 /* GL_EXT_discard_framebuffer */
 #ifndef GL_EXT_discard_framebuffer
 #define GL_EXT_discard_framebuffer 1
@@ -620,6 +988,17 @@
 typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
 #endif
 
+/* GL_EXT_multisampled_render_to_texture */
+#ifndef GL_EXT_multisampled_render_to_texture
+#define GL_EXT_multisampled_render_to_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+#endif
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+#endif
+
 #ifndef GL_EXT_multi_draw_arrays
 #define GL_EXT_multi_draw_arrays 1
 #ifdef GL_GLEXT_PROTOTYPES
@@ -630,11 +1009,134 @@
 typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
 #endif
 
+/* GL_EXT_occlusion_query_boolean */
+#ifndef GL_EXT_occlusion_query_boolean
+#define GL_EXT_occlusion_query_boolean 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGenQueriesEXT (GLsizei n, GLuint *ids);
+GL_APICALL void GL_APIENTRY glDeleteQueriesEXT (GLsizei n, const GLuint *ids);
+GL_APICALL GLboolean GL_APIENTRY glIsQueryEXT (GLuint id);
+GL_APICALL void GL_APIENTRY glBeginQueryEXT (GLenum target, GLuint id);
+GL_APICALL void GL_APIENTRY glEndQueryEXT (GLenum target);
+GL_APICALL void GL_APIENTRY glGetQueryivEXT (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT (GLuint id, GLenum pname, GLuint *params);
+#endif
+typedef void (GL_APIENTRYP PFNGLGENQUERIESEXTPROC) (GLsizei n, GLuint *ids);
+typedef void (GL_APIENTRYP PFNGLDELETEQUERIESEXTPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (GL_APIENTRYP PFNGLISQUERYEXTPROC) (GLuint id);
+typedef void (GL_APIENTRYP PFNGLBEGINQUERYEXTPROC) (GLenum target, GLuint id);
+typedef void (GL_APIENTRYP PFNGLENDQUERYEXTPROC) (GLenum target);
+typedef void (GL_APIENTRYP PFNGLGETQUERYIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVEXTPROC) (GLuint id, GLenum pname, GLuint *params);
+#endif
+
 /* GL_EXT_read_format_bgra */
 #ifndef GL_EXT_read_format_bgra
 #define GL_EXT_read_format_bgra 1
 #endif
 
+/* GL_EXT_robustness */
+#ifndef GL_EXT_robustness
+#define GL_EXT_robustness 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void);
+GL_APICALL void GL_APIENTRY glReadnPixelsEXT (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+GL_APICALL void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, float *params);
+GL_APICALL void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+#endif
+typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void);
+typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, float *params);
+typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+#endif
+
+/* GL_EXT_separate_shader_objects */
+#ifndef GL_EXT_separate_shader_objects
+#define GL_EXT_separate_shader_objects 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glUseProgramStagesEXT (GLuint pipeline, GLbitfield stages, GLuint program);
+GL_APICALL void GL_APIENTRY glActiveShaderProgramEXT (GLuint pipeline, GLuint program);
+GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramvEXT (GLenum type, GLsizei count, const GLchar **strings);
+GL_APICALL void GL_APIENTRY glBindProgramPipelineEXT (GLuint pipeline);
+GL_APICALL void GL_APIENTRY glDeleteProgramPipelinesEXT (GLsizei n, const GLuint *pipelines);
+GL_APICALL void GL_APIENTRY glGenProgramPipelinesEXT (GLsizei n, GLuint *pipelines);
+GL_APICALL GLboolean GL_APIENTRY glIsProgramPipelineEXT (GLuint pipeline);
+GL_APICALL void GL_APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value);
+GL_APICALL void GL_APIENTRY glGetProgramPipelineivEXT (GLuint pipeline, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint x);
+GL_APICALL void GL_APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint x, GLint y);
+GL_APICALL void GL_APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint x, GLint y, GLint z);
+GL_APICALL void GL_APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w);
+GL_APICALL void GL_APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat x);
+GL_APICALL void GL_APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat x, GLfloat y);
+GL_APICALL void GL_APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GL_APICALL void GL_APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glValidateProgramPipelineEXT (GLuint pipeline);
+GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLogEXT (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+#endif
+typedef void (GL_APIENTRYP PFNGLUSEPROGRAMSTAGESEXTPROC) (GLuint pipeline, GLbitfield stages, GLuint program);
+typedef void (GL_APIENTRYP PFNGLACTIVESHADERPROGRAMEXTPROC) (GLuint pipeline, GLuint program);
+typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC) (GLenum type, GLsizei count, const GLchar **strings);
+typedef void (GL_APIENTRYP PFNGLBINDPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
+typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPIPELINESEXTPROC) (GLsizei n, const GLuint *pipelines);
+typedef void (GL_APIENTRYP PFNGLGENPROGRAMPIPELINESEXTPROC) (GLsizei n, GLuint *pipelines);
+typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
+typedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);
+typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEIVEXTPROC) (GLuint pipeline, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint x);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint x, GLint y);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat x);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
+typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+#endif
+
+/* GL_EXT_shader_texture_lod */
+#ifndef GL_EXT_shader_texture_lod
+#define GL_EXT_shader_texture_lod 1
+#endif
+
+/* GL_EXT_shadow_samplers */
+#ifndef GL_EXT_shadow_samplers
+#define GL_EXT_shadow_samplers 1
+#endif
+
+/* GL_EXT_sRGB */
+#ifndef GL_EXT_sRGB
+#define GL_EXT_sRGB 1
+#endif
+
+/* GL_EXT_texture_compression_dxt1 */
+#ifndef GL_EXT_texture_compression_dxt1
+#define GL_EXT_texture_compression_dxt1 1
+#endif
+
 /* GL_EXT_texture_filter_anisotropic */
 #ifndef GL_EXT_texture_filter_anisotropic
 #define GL_EXT_texture_filter_anisotropic 1
@@ -645,14 +1147,47 @@
 #define GL_EXT_texture_format_BGRA8888 1
 #endif
 
+/* GL_EXT_texture_rg */
+#ifndef GL_EXT_texture_rg
+#define GL_EXT_texture_rg 1
+#endif
+
+/* GL_EXT_texture_storage */
+#ifndef GL_EXT_texture_storage
+#define GL_EXT_texture_storage 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+GL_APICALL void GL_APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+GL_APICALL void GL_APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+GL_APICALL void GL_APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+#endif
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+#endif
+
 /* GL_EXT_texture_type_2_10_10_10_REV */
 #ifndef GL_EXT_texture_type_2_10_10_10_REV
 #define GL_EXT_texture_type_2_10_10_10_REV 1
 #endif
 
-/* GL_EXT_texture_compression_dxt1 */
-#ifndef GL_EXT_texture_compression_dxt1
-#define GL_EXT_texture_compression_dxt1 1
+/* GL_EXT_unpack_subimage */
+#ifndef GL_EXT_unpack_subimage
+#define GL_EXT_unpack_subimage 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * DMP extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_DMP_shader_binary */
+#ifndef GL_DMP_shader_binary
+#define GL_DMP_shader_binary 1
 #endif
 
 /*------------------------------------------------------------------------*
@@ -694,6 +1229,36 @@
  * NV extension functions
  *------------------------------------------------------------------------*/
 
+/* GL_NV_coverage_sample */
+#ifndef GL_NV_coverage_sample
+#define GL_NV_coverage_sample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask);
+GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation);
+#endif
+typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask);
+typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation);
+#endif
+
+/* GL_NV_depth_nonlinear */
+#ifndef GL_NV_depth_nonlinear
+#define GL_NV_depth_nonlinear 1
+#endif
+
+/* GL_NV_draw_buffers */
+#ifndef GL_NV_draw_buffers
+#define GL_NV_draw_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDrawBuffersNV (GLsizei n, const GLenum *bufs);
+#endif
+typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum *bufs);
+#endif
+
+/* GL_NV_fbo_color_attachments */
+#ifndef GL_NV_fbo_color_attachments
+#define GL_NV_fbo_color_attachments 1
+#endif
+
 /* GL_NV_fence */
 #ifndef GL_NV_fence
 #define GL_NV_fence 1
@@ -715,26 +1280,58 @@
 typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
 #endif
 
-/* GL_NV_coverage_sample */
-#ifndef GL_NV_coverage_sample
-#define GL_NV_coverage_sample 1
+/* GL_NV_read_buffer */
+#ifndef GL_NV_read_buffer
+#define GL_NV_read_buffer 1
 #ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask);
-GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation);
+GL_APICALL void GL_APIENTRY glReadBufferNV (GLenum mode);
 #endif
-typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask);
-typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation);
+typedef void (GL_APIENTRYP PFNGLREADBUFFERNVPROC) (GLenum mode);
 #endif
 
-/* GL_NV_depth_nonlinear */
-#ifndef GL_NV_depth_nonlinear
-#define GL_NV_depth_nonlinear 1
+/* GL_NV_read_buffer_front */
+#ifndef GL_NV_read_buffer_front
+#define GL_NV_read_buffer_front 1
+#endif
+
+/* GL_NV_read_depth */
+#ifndef GL_NV_read_depth
+#define GL_NV_read_depth 1
+#endif
+
+/* GL_NV_read_depth_stencil */
+#ifndef GL_NV_read_depth_stencil
+#define GL_NV_read_depth_stencil 1
+#endif
+
+/* GL_NV_read_stencil */
+#ifndef GL_NV_read_stencil
+#define GL_NV_read_stencil 1
+#endif
+
+/* GL_NV_texture_compression_s3tc_update */
+#ifndef GL_NV_texture_compression_s3tc_update
+#define GL_NV_texture_compression_s3tc_update 1
+#endif
+
+/* GL_NV_texture_npot_2D_mipmap */
+#ifndef GL_NV_texture_npot_2D_mipmap
+#define GL_NV_texture_npot_2D_mipmap 1
 #endif
 
 /*------------------------------------------------------------------------*
  * QCOM extension functions
  *------------------------------------------------------------------------*/
 
+/* GL_QCOM_alpha_test */
+#ifndef GL_QCOM_alpha_test
+#define GL_QCOM_alpha_test 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glAlphaFuncQCOM (GLenum func, GLclampf ref);
+#endif
+typedef void (GL_APIENTRYP PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref);
+#endif
+
 /* GL_QCOM_driver_control */
 #ifndef GL_QCOM_driver_control
 #define GL_QCOM_driver_control 1
@@ -809,6 +1406,15 @@
 typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask);
 #endif
 
+/*------------------------------------------------------------------------*
+ * VIV extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_VIV_shader_binary */
+#ifndef GL_VIV_shader_binary
+#define GL_VIV_shader_binary 1
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp
index 2fc6125..06be2ef 100644
--- a/opengl/libs/EGL/Loader.cpp
+++ b/opengl/libs/EGL/Loader.cpp
@@ -253,6 +253,19 @@
         if (f == NULL) {
             //ALOGD("%s", name);
             f = (__eglMustCastToProperFunctionPointerType)gl_unimplemented;
+
+            /*
+             * GL_EXT_debug_label is special, we always report it as
+             * supported, it's handled by GLES_trace. If GLES_trace is not
+             * enabled, then these are no-ops.
+             */
+            if (!strcmp(name, "glInsertEventMarkerEXT")) {
+                f = (__eglMustCastToProperFunctionPointerType)gl_noop;
+            } else if (!strcmp(name, "glPushGroupMarkerEXT")) {
+                f = (__eglMustCastToProperFunctionPointerType)gl_noop;
+            } else if (!strcmp(name, "glPopGroupMarkerEXT")) {
+                f = (__eglMustCastToProperFunctionPointerType)gl_noop;
+            }
         }
         *curr++ = f;
         api++;
diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp
index e053589..83933e5 100644
--- a/opengl/libs/EGL/egl.cpp
+++ b/opengl/libs/EGL/egl.cpp
@@ -233,6 +233,26 @@
 
 // ----------------------------------------------------------------------------
 
+const GLubyte * egl_get_string_for_current_context(GLenum name) {
+    // NOTE: returning NULL here will fall-back to the default
+    // implementation.
+
+    EGLContext context = egl_tls_t::getContext();
+    if (context == EGL_NO_CONTEXT)
+        return NULL;
+
+    egl_context_t const * const c = get_context(context);
+    if (c == NULL) // this should never happen, by construction
+        return NULL;
+
+    if (name != GL_EXTENSIONS)
+        return NULL;
+
+    return (const GLubyte *)c->gl_extensions.string();
+}
+
+// ----------------------------------------------------------------------------
+
 // this mutex protects:
 //    d->disp[]
 //    egl_init_drivers_locked()
@@ -290,6 +310,9 @@
     ALOGE("called unimplemented OpenGL ES API");
 }
 
+void gl_noop() {
+}
+
 // ----------------------------------------------------------------------------
 
 #if USE_FAST_TLS_KEY
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
index 664f258..73aab26 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -477,6 +477,26 @@
     return result;
 }
 
+void EGLAPI eglBeginFrame(EGLDisplay dpy, EGLSurface surface) {
+    clearError();
+
+    egl_display_t const * const dp = validate_display(dpy);
+    if (!dp) {
+        return;
+    }
+
+    SurfaceRef _s(dp, surface);
+    if (!_s.get()) {
+        setError(EGL_BAD_SURFACE, EGL_FALSE);
+        return;
+    }
+
+    int64_t timestamp = systemTime(SYSTEM_TIME_MONOTONIC);
+
+    egl_surface_t const * const s = get_surface(surface);
+    native_window_set_buffers_timestamp(s->win.get(), timestamp);
+}
+
 // ----------------------------------------------------------------------------
 // Contexts
 // ----------------------------------------------------------------------------
@@ -546,27 +566,6 @@
     return result;
 }
 
-static void loseCurrent(egl_context_t * cur_c)
-{
-    if (cur_c) {
-        egl_surface_t * cur_r = get_surface(cur_c->read);
-        egl_surface_t * cur_d = get_surface(cur_c->draw);
-
-        // by construction, these are either 0 or valid (possibly terminated)
-        // it should be impossible for these to be invalid
-        ContextRef _cur_c(cur_c);
-        SurfaceRef _cur_r(cur_r);
-        SurfaceRef _cur_d(cur_d);
-
-        cur_c->read = NULL;
-        cur_c->draw = NULL;
-
-        _cur_c.release();
-        _cur_r.release();
-        _cur_d.release();
-    }
-}
-
 EGLBoolean eglMakeCurrent(  EGLDisplay dpy, EGLSurface draw,
                             EGLSurface read, EGLContext ctx)
 {
@@ -643,21 +642,13 @@
         impl_read = r->surface;
     }
 
-    EGLBoolean result;
 
-    if (c) {
-        result = c->cnx->egl.eglMakeCurrent(
-                dp->disp[c->impl].dpy, impl_draw, impl_read, impl_ctx);
-    } else {
-        result = cur_c->cnx->egl.eglMakeCurrent(
-                dp->disp[cur_c->impl].dpy, impl_draw, impl_read, impl_ctx);
-    }
+    EGLBoolean result = const_cast<egl_display_t*>(dp)->makeCurrent(c, cur_c,
+            draw, read, ctx,
+            impl_draw, impl_read, impl_ctx);
 
     if (result == EGL_TRUE) {
-
-        loseCurrent(cur_c);
-
-        if (ctx != EGL_NO_CONTEXT) {
+        if (c) {
             setGLHooksThreadSpecific(c->cnx->hooks[c->version]);
             egl_tls_t::setContext(ctx);
 #if EGL_TRACE
@@ -667,8 +658,6 @@
             _c.acquire();
             _r.acquire();
             _d.acquire();
-            c->read = read;
-            c->draw = draw;
         } else {
             setGLHooksThreadSpecific(&gHooksNoContext);
             egl_tls_t::setContext(EGL_NO_CONTEXT);
@@ -904,7 +893,8 @@
                     cnx->hooks[GLESv1_INDEX]->ext.extensions[slot] =
                     cnx->hooks[GLESv2_INDEX]->ext.extensions[slot] =
 #if EGL_TRACE
-                    debugHooks->ext.extensions[slot] = gHooksTrace.ext.extensions[slot] =
+                    debugHooks->ext.extensions[slot] =
+                    gHooksTrace.ext.extensions[slot] =
 #endif
                             cnx->egl.eglGetProcAddress(procname);
                 }
@@ -1160,7 +1150,7 @@
     clearError();
 
     // If there is context bound to the thread, release it
-    loseCurrent(get_context(getContext()));
+    egl_display_t::loseCurrent(get_context(getContext()));
 
     for (int i=0 ; i<IMPL_NUM_IMPLEMENTATIONS ; i++) {
         egl_connection_t* const cnx = &gEGLImpl[i];
diff --git a/opengl/libs/EGL/egl_display.cpp b/opengl/libs/EGL/egl_display.cpp
index 53eaf9a..6b2ae51 100644
--- a/opengl/libs/EGL/egl_display.cpp
+++ b/opengl/libs/EGL/egl_display.cpp
@@ -342,6 +342,78 @@
     return res;
 }
 
+void egl_display_t::loseCurrent(egl_context_t * cur_c)
+{
+    if (cur_c) {
+        egl_display_t* display = cur_c->getDisplay();
+        if (display) {
+            display->loseCurrentImpl(cur_c);
+        }
+    }
+}
+
+void egl_display_t::loseCurrentImpl(egl_context_t * cur_c)
+{
+    // by construction, these are either 0 or valid (possibly terminated)
+    // it should be impossible for these to be invalid
+    ContextRef _cur_c(cur_c);
+    SurfaceRef _cur_r(cur_c ? get_surface(cur_c->read) : NULL);
+    SurfaceRef _cur_d(cur_c ? get_surface(cur_c->draw) : NULL);
+
+    { // scope for the lock
+        Mutex::Autolock _l(lock);
+        cur_c->onLooseCurrent();
+
+    }
+
+    // This cannot be called with the lock held because it might end-up
+    // calling back into EGL (in particular when a surface is destroyed
+    // it calls ANativeWindow::disconnect
+    _cur_c.release();
+    _cur_r.release();
+    _cur_d.release();
+}
+
+EGLBoolean egl_display_t::makeCurrent(egl_context_t* c, egl_context_t* cur_c,
+        EGLSurface draw, EGLSurface read, EGLContext ctx,
+        EGLSurface impl_draw, EGLSurface impl_read, EGLContext impl_ctx)
+{
+    EGLBoolean result;
+
+    // by construction, these are either 0 or valid (possibly terminated)
+    // it should be impossible for these to be invalid
+    ContextRef _cur_c(cur_c);
+    SurfaceRef _cur_r(cur_c ? get_surface(cur_c->read) : NULL);
+    SurfaceRef _cur_d(cur_c ? get_surface(cur_c->draw) : NULL);
+
+    { // scope for the lock
+        Mutex::Autolock _l(lock);
+        if (c) {
+            result = c->cnx->egl.eglMakeCurrent(
+                    disp[c->impl].dpy, impl_draw, impl_read, impl_ctx);
+            if (result == EGL_TRUE) {
+                c->onMakeCurrent(draw, read);
+            }
+        } else {
+            result = cur_c->cnx->egl.eglMakeCurrent(
+                    disp[cur_c->impl].dpy, impl_draw, impl_read, impl_ctx);
+            if (result == EGL_TRUE) {
+                cur_c->onLooseCurrent();
+            }
+        }
+    }
+
+    if (result == EGL_TRUE) {
+        // This cannot be called with the lock held because it might end-up
+        // calling back into EGL (in particular when a surface is destroyed
+        // it calls ANativeWindow::disconnect
+        _cur_c.release();
+        _cur_r.release();
+        _cur_d.release();
+    }
+
+    return result;
+}
 
 // ----------------------------------------------------------------------------
 }; // namespace android
diff --git a/opengl/libs/EGL/egl_display.h b/opengl/libs/EGL/egl_display.h
index 042ae07..f3c4ddf 100644
--- a/opengl/libs/EGL/egl_display.h
+++ b/opengl/libs/EGL/egl_display.h
@@ -39,6 +39,7 @@
 // ----------------------------------------------------------------------------
 
 class egl_object_t;
+class egl_context_t;
 class egl_connection_t;
 
 // ----------------------------------------------------------------------------
@@ -63,6 +64,7 @@
 class EGLAPI egl_display_t { // marked as EGLAPI for testing purposes
     static egl_display_t sDisplay[NUM_DISPLAYS];
     EGLDisplay getDisplay(EGLNativeDisplayType display);
+    void loseCurrentImpl(egl_context_t * cur_c);
 
 public:
     enum {
@@ -84,10 +86,14 @@
     // add reference to this object. returns true if this is a valid object.
     bool getObject(egl_object_t* object) const;
 
-
     static egl_display_t* get(EGLDisplay dpy);
     static EGLDisplay getFromNativeDisplay(EGLNativeDisplayType disp);
 
+    EGLBoolean makeCurrent(egl_context_t* c, egl_context_t* cur_c,
+            EGLSurface draw, EGLSurface read, EGLContext ctx,
+            EGLSurface impl_draw, EGLSurface impl_read, EGLContext impl_ctx);
+    static void loseCurrent(egl_context_t * cur_c);
+
     inline bool isReady() const { return (refs > 0); }
     inline bool isValid() const { return magic == '_dpy'; }
     inline bool isAlive() const { return isValid(); }
diff --git a/opengl/libs/EGL/egl_object.cpp b/opengl/libs/EGL/egl_object.cpp
index 26e8c3e..b660c53 100644
--- a/opengl/libs/EGL/egl_object.cpp
+++ b/opengl/libs/EGL/egl_object.cpp
@@ -62,5 +62,41 @@
 }
 
 // ----------------------------------------------------------------------------
+
+egl_context_t::egl_context_t(EGLDisplay dpy, EGLContext context, EGLConfig config,
+        int impl, egl_connection_t const* cnx, int version) :
+    egl_object_t(get_display(dpy)), dpy(dpy), context(context),
+            config(config), read(0), draw(0), impl(impl), cnx(cnx),
+            version(version)
+{
+}
+
+void egl_context_t::onLooseCurrent() {
+    read = NULL;
+    draw = NULL;
+}
+
+void egl_context_t::onMakeCurrent(EGLSurface draw, EGLSurface read) {
+    this->read = read;
+    this->draw = draw;
+
+    /*
+     * Here we cache the GL_EXTENSIONS string for this context and we
+     * add the extensions always handled by the wrapper
+     */
+
+    if (gl_extensions.isEmpty()) {
+        // call the implementation's glGetString(GL_EXTENSIONS)
+        const char* exts = (const char *)gEGLImpl[impl].hooks[version]->gl.glGetString(GL_EXTENSIONS);
+        gl_extensions.setTo(exts);
+        if (gl_extensions.find("GL_EXT_debug_marker") < 0) {
+            String8 temp("GL_EXT_debug_marker ");
+            temp.append(gl_extensions);
+            gl_extensions.setTo(temp);
+        }
+    }
+}
+
+// ----------------------------------------------------------------------------
 }; // namespace android
 // ----------------------------------------------------------------------------
diff --git a/opengl/libs/EGL/egl_object.h b/opengl/libs/EGL/egl_object.h
index 7106fa5..abd4cbb 100644
--- a/opengl/libs/EGL/egl_object.h
+++ b/opengl/libs/EGL/egl_object.h
@@ -28,6 +28,7 @@
 #include <GLES/glext.h>
 
 #include <utils/threads.h>
+#include <utils/String8.h>
 
 #include <system/window.h>
 
@@ -158,11 +159,11 @@
     typedef egl_object_t::LocalRef<egl_context_t, EGLContext> Ref;
 
     egl_context_t(EGLDisplay dpy, EGLContext context, EGLConfig config,
-            int impl, egl_connection_t const* cnx, int version) :
-        egl_object_t(get_display(dpy)), dpy(dpy), context(context),
-                config(config), read(0), draw(0), impl(impl), cnx(cnx),
-                version(version) {
-    }
+            int impl, egl_connection_t const* cnx, int version);
+
+    void onLooseCurrent();
+    void onMakeCurrent(EGLSurface draw, EGLSurface read);
+
     EGLDisplay dpy;
     EGLContext context;
     EGLConfig config;
@@ -171,6 +172,7 @@
     int impl;
     egl_connection_t const* cnx;
     int version;
+    String8 gl_extensions;
 };
 
 class egl_image_t: public egl_object_t {
diff --git a/opengl/libs/EGL/egldefs.h b/opengl/libs/EGL/egldefs.h
index 107acd9..ff20957 100644
--- a/opengl/libs/EGL/egldefs.h
+++ b/opengl/libs/EGL/egldefs.h
@@ -58,6 +58,7 @@
 extern gl_hooks_t gHooksNoContext;
 extern pthread_key_t gGLWrapperKey;
 extern "C" void gl_unimplemented();
+extern "C" void gl_noop();
 
 extern char const * const gl_names[];
 extern char const * const egl_names[];
diff --git a/opengl/libs/EGL/getProcAddress.cpp b/opengl/libs/EGL/getProcAddress.cpp
index f89c865..8dcf38d 100644
--- a/opengl/libs/EGL/getProcAddress.cpp
+++ b/opengl/libs/EGL/getProcAddress.cpp
@@ -82,23 +82,41 @@
 
 #endif
 
+
 #define GL_EXTENSION_LIST(name) \
-        name(0)   name(1)   name(2)   name(3)   \
-        name(4)   name(5)   name(6)   name(7)   \
-        name(8)   name(9)   name(10)  name(11)  \
-        name(12)  name(13)  name(14)  name(15)  \
-        name(16)  name(17)  name(18)  name(19)  \
-        name(20)  name(21)  name(22)  name(23)  \
-        name(24)  name(25)  name(26)  name(27)  \
-        name(28)  name(29)  name(30)  name(31)  \
-        name(32)  name(33)  name(34)  name(35)  \
-        name(36)  name(37)  name(38)  name(39)  \
-        name(40)  name(41)  name(42)  name(43)  \
-        name(44)  name(45)  name(46)  name(47)  \
-        name(48)  name(49)  name(50)  name(51)  \
-        name(52)  name(53)  name(54)  name(55)  \
-        name(56)  name(57)  name(58)  name(59)  \
-        name(60)  name(61)  name(62)  name(63)
+    name(0)   name(1)   name(2)   name(3)   name(4)   name(5)   name(6)   name(7)  \
+    name(8)   name(9)   name(10)  name(11)  name(12)  name(13)  name(14)  name(15) \
+    name(16)  name(17)  name(18)  name(19)  name(20)  name(21)  name(22)  name(23) \
+    name(24)  name(25)  name(26)  name(27)  name(28)  name(29)  name(30)  name(31) \
+    name(32)  name(33)  name(34)  name(35)  name(36)  name(37)  name(38)  name(39) \
+    name(40)  name(41)  name(42)  name(43)  name(44)  name(45)  name(46)  name(47) \
+    name(48)  name(49)  name(50)  name(51)  name(52)  name(53)  name(54)  name(55) \
+    name(56)  name(57)  name(58)  name(59)  name(60)  name(61)  name(62)  name(63) \
+    name(64)  name(65)  name(66)  name(67)  name(68)  name(69)  name(70)  name(71) \
+    name(72)  name(73)  name(74)  name(75)  name(76)  name(77)  name(78)  name(79) \
+    name(80)  name(81)  name(82)  name(83)  name(84)  name(85)  name(86)  name(87) \
+    name(88)  name(89)  name(90)  name(91)  name(92)  name(93)  name(94)  name(95) \
+    name(96)  name(97)  name(98)  name(99)  \
+    name(100) name(101) name(102) name(103) name(104) name(105) name(106) name(107) \
+    name(108) name(109) name(110) name(111) name(112) name(113) name(114) name(115) \
+    name(116) name(117) name(118) name(119) name(120) name(121) name(122) name(123) \
+    name(124) name(125) name(126) name(127) name(128) name(129) name(130) name(131) \
+    name(132) name(133) name(134) name(135) name(136) name(137) name(138) name(139) \
+    name(140) name(141) name(142) name(143) name(144) name(145) name(146) name(147) \
+    name(148) name(149) name(150) name(151) name(152) name(153) name(154) name(155) \
+    name(156) name(157) name(158) name(159) name(160) name(161) name(162) name(163) \
+    name(164) name(165) name(166) name(167) name(168) name(169) name(170) name(171) \
+    name(172) name(173) name(174) name(175) name(176) name(177) name(178) name(179) \
+    name(180) name(181) name(182) name(183) name(184) name(185) name(186) name(187) \
+    name(188) name(189) name(190) name(191) name(192) name(193) name(194) name(195) \
+    name(196) name(197) name(198) name(199) \
+    name(200) name(201) name(202) name(203) name(204) name(205) name(206) name(207) \
+    name(208) name(209) name(210) name(211) name(212) name(213) name(214) name(215) \
+    name(216) name(217) name(218) name(219) name(220) name(221) name(222) name(223) \
+    name(224) name(225) name(226) name(227) name(228) name(229) name(230) name(231) \
+    name(232) name(233) name(234) name(235) name(236) name(237) name(238) name(239) \
+    name(240) name(241) name(242) name(243) name(244) name(245) name(246) name(247) \
+    name(248) name(249) name(250) name(251) name(252) name(253) name(254) name(255)
 
 
 GL_EXTENSION_LIST( GL_EXTENSION )
diff --git a/opengl/libs/GLES2/gl2.cpp b/opengl/libs/GLES2/gl2.cpp
index df22b96..79aa3cd 100644
--- a/opengl/libs/GLES2/gl2.cpp
+++ b/opengl/libs/GLES2/gl2.cpp
@@ -110,6 +110,20 @@
 #undef CALL_GL_API
 #undef CALL_GL_API_RETURN
 
+/*
+ * glGetString() is special because we expose some extensions in the wrapper
+ */
+
+extern "C" const GLubyte * __glGetString(GLenum name);
+
+const GLubyte * glGetString(GLenum name)
+{
+    const GLubyte * ret = egl_get_string_for_current_context(name);
+    if (ret == NULL) {
+        ret = __glGetString(name);
+    }
+    return ret;
+}
 
 /*
  * These GL calls are special because they need to EGL to retrieve some
diff --git a/opengl/libs/GLES2/gl2_api.in b/opengl/libs/GLES2/gl2_api.in
index 5164450..9a89a52 100644
--- a/opengl/libs/GLES2/gl2_api.in
+++ b/opengl/libs/GLES2/gl2_api.in
@@ -211,7 +211,7 @@
 void API_ENTRY(glGetShaderSource)(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source) {
     CALL_GL_API(glGetShaderSource, shader, bufsize, length, source);
 }
-const GLubyte* API_ENTRY(glGetString)(GLenum name) {
+const GLubyte* API_ENTRY(__glGetString)(GLenum name) {
     CALL_GL_API_RETURN(glGetString, name);
 }
 void API_ENTRY(glGetTexParameterfv)(GLenum target, GLenum pname, GLfloat* params) {
diff --git a/opengl/libs/GLES2/gl2ext_api.in b/opengl/libs/GLES2/gl2ext_api.in
index e965625..a8907fd 100644
--- a/opengl/libs/GLES2/gl2ext_api.in
+++ b/opengl/libs/GLES2/gl2ext_api.in
@@ -82,21 +82,204 @@
 void API_ENTRY(glGetPerfMonitorCounterDataAMD)(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten) {
     CALL_GL_API(glGetPerfMonitorCounterDataAMD, monitor, pname, dataSize, data, bytesWritten);
 }
+void API_ENTRY(glBlitFramebufferANGLE)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {
+    CALL_GL_API(glBlitFramebufferANGLE, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
+}
+void API_ENTRY(glRenderbufferStorageMultisampleANGLE)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
+    CALL_GL_API(glRenderbufferStorageMultisampleANGLE, target, samples, internalformat, width, height);
+}
+void API_ENTRY(glRenderbufferStorageMultisampleAPPLE)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
+    CALL_GL_API(glRenderbufferStorageMultisampleAPPLE, target, samples, internalformat, width, height);
+}
+void API_ENTRY(glResolveMultisampleFramebufferAPPLE)(void) {
+    CALL_GL_API(glResolveMultisampleFramebufferAPPLE);
+}
+void API_ENTRY(glLabelObjectEXT)(GLenum type, GLuint object, GLsizei length, const GLchar *label) {
+    CALL_GL_API(glLabelObjectEXT, type, object, length, label);
+}
+void API_ENTRY(glGetObjectLabelEXT)(GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label) {
+    CALL_GL_API(glGetObjectLabelEXT, type, object, bufSize, length, label);
+}
+void API_ENTRY(glInsertEventMarkerEXT)(GLsizei length, const GLchar *marker) {
+    CALL_GL_API(glInsertEventMarkerEXT, length, marker);
+}
+void API_ENTRY(glPushGroupMarkerEXT)(GLsizei length, const GLchar *marker) {
+    CALL_GL_API(glPushGroupMarkerEXT, length, marker);
+}
+void API_ENTRY(glPopGroupMarkerEXT)(void) {
+    CALL_GL_API(glPopGroupMarkerEXT);
+}
 void API_ENTRY(glDiscardFramebufferEXT)(GLenum target, GLsizei numAttachments, const GLenum *attachments) {
     CALL_GL_API(glDiscardFramebufferEXT, target, numAttachments, attachments);
 }
+void API_ENTRY(glRenderbufferStorageMultisampleEXT)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
+    CALL_GL_API(glRenderbufferStorageMultisampleEXT, target, samples, internalformat, width, height);
+}
+void API_ENTRY(glFramebufferTexture2DMultisampleEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) {
+    CALL_GL_API(glFramebufferTexture2DMultisampleEXT, target, attachment, textarget, texture, level, samples);
+}
 void API_ENTRY(glMultiDrawArraysEXT)(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount) {
     CALL_GL_API(glMultiDrawArraysEXT, mode, first, count, primcount);
 }
 void API_ENTRY(glMultiDrawElementsEXT)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount) {
     CALL_GL_API(glMultiDrawElementsEXT, mode, count, type, indices, primcount);
 }
+void API_ENTRY(glGenQueriesEXT)(GLsizei n, GLuint *ids) {
+    CALL_GL_API(glGenQueriesEXT, n, ids);
+}
+void API_ENTRY(glDeleteQueriesEXT)(GLsizei n, const GLuint *ids) {
+    CALL_GL_API(glDeleteQueriesEXT, n, ids);
+}
+GLboolean API_ENTRY(glIsQueryEXT)(GLuint id) {
+    CALL_GL_API_RETURN(glIsQueryEXT, id);
+}
+void API_ENTRY(glBeginQueryEXT)(GLenum target, GLuint id) {
+    CALL_GL_API(glBeginQueryEXT, target, id);
+}
+void API_ENTRY(glEndQueryEXT)(GLenum target) {
+    CALL_GL_API(glEndQueryEXT, target);
+}
+void API_ENTRY(glGetQueryivEXT)(GLenum target, GLenum pname, GLint *params) {
+    CALL_GL_API(glGetQueryivEXT, target, pname, params);
+}
+void API_ENTRY(glGetQueryObjectuivEXT)(GLuint id, GLenum pname, GLuint *params) {
+    CALL_GL_API(glGetQueryObjectuivEXT, id, pname, params);
+}
+GLenum API_ENTRY(glGetGraphicsResetStatusEXT)(void) {
+    CALL_GL_API_RETURN(glGetGraphicsResetStatusEXT);
+}
+void API_ENTRY(glReadnPixelsEXT)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data) {
+    CALL_GL_API(glReadnPixelsEXT, x, y, width, height, format, type, bufSize, data);
+}
+void API_ENTRY(glGetnUniformfvEXT)(GLuint program, GLint location, GLsizei bufSize, float *params) {
+    CALL_GL_API(glGetnUniformfvEXT, program, location, bufSize, params);
+}
+void API_ENTRY(glGetnUniformivEXT)(GLuint program, GLint location, GLsizei bufSize, GLint *params) {
+    CALL_GL_API(glGetnUniformivEXT, program, location, bufSize, params);
+}
+void API_ENTRY(glUseProgramStagesEXT)(GLuint pipeline, GLbitfield stages, GLuint program) {
+    CALL_GL_API(glUseProgramStagesEXT, pipeline, stages, program);
+}
+void API_ENTRY(glActiveShaderProgramEXT)(GLuint pipeline, GLuint program) {
+    CALL_GL_API(glActiveShaderProgramEXT, pipeline, program);
+}
+GLuint API_ENTRY(glCreateShaderProgramvEXT)(GLenum type, GLsizei count, const GLchar **strings) {
+    CALL_GL_API_RETURN(glCreateShaderProgramvEXT, type, count, strings);
+}
+void API_ENTRY(glBindProgramPipelineEXT)(GLuint pipeline) {
+    CALL_GL_API(glBindProgramPipelineEXT, pipeline);
+}
+void API_ENTRY(glDeleteProgramPipelinesEXT)(GLsizei n, const GLuint *pipelines) {
+    CALL_GL_API(glDeleteProgramPipelinesEXT, n, pipelines);
+}
+void API_ENTRY(glGenProgramPipelinesEXT)(GLsizei n, GLuint *pipelines) {
+    CALL_GL_API(glGenProgramPipelinesEXT, n, pipelines);
+}
+GLboolean API_ENTRY(glIsProgramPipelineEXT)(GLuint pipeline) {
+    CALL_GL_API_RETURN(glIsProgramPipelineEXT, pipeline);
+}
+void API_ENTRY(glProgramParameteriEXT)(GLuint program, GLenum pname, GLint value) {
+    CALL_GL_API(glProgramParameteriEXT, program, pname, value);
+}
+void API_ENTRY(glGetProgramPipelineivEXT)(GLuint pipeline, GLenum pname, GLint *params) {
+    CALL_GL_API(glGetProgramPipelineivEXT, pipeline, pname, params);
+}
+void API_ENTRY(glProgramUniform1iEXT)(GLuint program, GLint location, GLint x) {
+    CALL_GL_API(glProgramUniform1iEXT, program, location, x);
+}
+void API_ENTRY(glProgramUniform2iEXT)(GLuint program, GLint location, GLint x, GLint y) {
+    CALL_GL_API(glProgramUniform2iEXT, program, location, x, y);
+}
+void API_ENTRY(glProgramUniform3iEXT)(GLuint program, GLint location, GLint x, GLint y, GLint z) {
+    CALL_GL_API(glProgramUniform3iEXT, program, location, x, y, z);
+}
+void API_ENTRY(glProgramUniform4iEXT)(GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w) {
+    CALL_GL_API(glProgramUniform4iEXT, program, location, x, y, z, w);
+}
+void API_ENTRY(glProgramUniform1fEXT)(GLuint program, GLint location, GLfloat x) {
+    CALL_GL_API(glProgramUniform1fEXT, program, location, x);
+}
+void API_ENTRY(glProgramUniform2fEXT)(GLuint program, GLint location, GLfloat x, GLfloat y) {
+    CALL_GL_API(glProgramUniform2fEXT, program, location, x, y);
+}
+void API_ENTRY(glProgramUniform3fEXT)(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z) {
+    CALL_GL_API(glProgramUniform3fEXT, program, location, x, y, z);
+}
+void API_ENTRY(glProgramUniform4fEXT)(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
+    CALL_GL_API(glProgramUniform4fEXT, program, location, x, y, z, w);
+}
+void API_ENTRY(glProgramUniform1ivEXT)(GLuint program, GLint location, GLsizei count, const GLint *value) {
+    CALL_GL_API(glProgramUniform1ivEXT, program, location, count, value);
+}
+void API_ENTRY(glProgramUniform2ivEXT)(GLuint program, GLint location, GLsizei count, const GLint *value) {
+    CALL_GL_API(glProgramUniform2ivEXT, program, location, count, value);
+}
+void API_ENTRY(glProgramUniform3ivEXT)(GLuint program, GLint location, GLsizei count, const GLint *value) {
+    CALL_GL_API(glProgramUniform3ivEXT, program, location, count, value);
+}
+void API_ENTRY(glProgramUniform4ivEXT)(GLuint program, GLint location, GLsizei count, const GLint *value) {
+    CALL_GL_API(glProgramUniform4ivEXT, program, location, count, value);
+}
+void API_ENTRY(glProgramUniform1fvEXT)(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
+    CALL_GL_API(glProgramUniform1fvEXT, program, location, count, value);
+}
+void API_ENTRY(glProgramUniform2fvEXT)(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
+    CALL_GL_API(glProgramUniform2fvEXT, program, location, count, value);
+}
+void API_ENTRY(glProgramUniform3fvEXT)(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
+    CALL_GL_API(glProgramUniform3fvEXT, program, location, count, value);
+}
+void API_ENTRY(glProgramUniform4fvEXT)(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
+    CALL_GL_API(glProgramUniform4fvEXT, program, location, count, value);
+}
+void API_ENTRY(glProgramUniformMatrix2fvEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
+    CALL_GL_API(glProgramUniformMatrix2fvEXT, program, location, count, transpose, value);
+}
+void API_ENTRY(glProgramUniformMatrix3fvEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
+    CALL_GL_API(glProgramUniformMatrix3fvEXT, program, location, count, transpose, value);
+}
+void API_ENTRY(glProgramUniformMatrix4fvEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
+    CALL_GL_API(glProgramUniformMatrix4fvEXT, program, location, count, transpose, value);
+}
+void API_ENTRY(glValidateProgramPipelineEXT)(GLuint pipeline) {
+    CALL_GL_API(glValidateProgramPipelineEXT, pipeline);
+}
+void API_ENTRY(glGetProgramPipelineInfoLogEXT)(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog) {
+    CALL_GL_API(glGetProgramPipelineInfoLogEXT, pipeline, bufSize, length, infoLog);
+}
+void API_ENTRY(glTexStorage1DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) {
+    CALL_GL_API(glTexStorage1DEXT, target, levels, internalformat, width);
+}
+void API_ENTRY(glTexStorage2DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
+    CALL_GL_API(glTexStorage2DEXT, target, levels, internalformat, width, height);
+}
+void API_ENTRY(glTexStorage3DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
+    CALL_GL_API(glTexStorage3DEXT, target, levels, internalformat, width, height, depth);
+}
+void API_ENTRY(glTextureStorage1DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) {
+    CALL_GL_API(glTextureStorage1DEXT, texture, target, levels, internalformat, width);
+}
+void API_ENTRY(glTextureStorage2DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
+    CALL_GL_API(glTextureStorage2DEXT, texture, target, levels, internalformat, width, height);
+}
+void API_ENTRY(glTextureStorage3DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
+    CALL_GL_API(glTextureStorage3DEXT, texture, target, levels, internalformat, width, height, depth);
+}
 void API_ENTRY(glRenderbufferStorageMultisampleIMG)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
     CALL_GL_API(glRenderbufferStorageMultisampleIMG, target, samples, internalformat, width, height);
 }
 void API_ENTRY(glFramebufferTexture2DMultisampleIMG)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) {
     CALL_GL_API(glFramebufferTexture2DMultisampleIMG, target, attachment, textarget, texture, level, samples);
 }
+void API_ENTRY(glCoverageMaskNV)(GLboolean mask) {
+    CALL_GL_API(glCoverageMaskNV, mask);
+}
+void API_ENTRY(glCoverageOperationNV)(GLenum operation) {
+    CALL_GL_API(glCoverageOperationNV, operation);
+}
+void API_ENTRY(glDrawBuffersNV)(GLsizei n, const GLenum *bufs) {
+    CALL_GL_API(glDrawBuffersNV, n, bufs);
+}
 void API_ENTRY(glDeleteFencesNV)(GLsizei n, const GLuint *fences) {
     CALL_GL_API(glDeleteFencesNV, n, fences);
 }
@@ -118,11 +301,11 @@
 void API_ENTRY(glSetFenceNV)(GLuint fence, GLenum condition) {
     CALL_GL_API(glSetFenceNV, fence, condition);
 }
-void API_ENTRY(glCoverageMaskNV)(GLboolean mask) {
-    CALL_GL_API(glCoverageMaskNV, mask);
+void API_ENTRY(glReadBufferNV)(GLenum mode) {
+    CALL_GL_API(glReadBufferNV, mode);
 }
-void API_ENTRY(glCoverageOperationNV)(GLenum operation) {
-    CALL_GL_API(glCoverageOperationNV, operation);
+void API_ENTRY(glAlphaFuncQCOM)(GLenum func, GLclampf ref) {
+    CALL_GL_API(glAlphaFuncQCOM, func, ref);
 }
 void API_ENTRY(glGetDriverControlsQCOM)(GLint *num, GLsizei size, GLuint *driverControls) {
     CALL_GL_API(glGetDriverControlsQCOM, num, size, driverControls);
diff --git a/opengl/libs/GLES2_dbg/generate_api_cpp.py b/opengl/libs/GLES2_dbg/generate_api_cpp.py
deleted file mode 100755
index 96cde57..0000000
--- a/opengl/libs/GLES2_dbg/generate_api_cpp.py
+++ /dev/null
@@ -1,219 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
-#
-# Copyright 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.
-#
-
-import os
-import sys
-
-def RemoveAnnotation(line):
-    if line.find(":") >= 0:
-        annotation = line[line.find(":"): line.find(" ", line.find(":"))]
-        return line.replace(annotation, "*")
-    else:
-        return line
-
-def generate_api(lines):
-    externs = []
-    i = 0
-    # these have been hand written
-    skipFunctions = ["glDrawArrays", "glDrawElements"]
-
-    # these have an EXTEND_Debug_* macro for getting data
-    extendFunctions = ["glCopyTexImage2D", "glCopyTexSubImage2D", "glReadPixels",
-"glShaderSource", "glTexImage2D", "glTexSubImage2D"]
-
-    # these also needs to be forwarded to DbgContext
-    contextFunctions = ["glUseProgram", "glEnableVertexAttribArray", "glDisableVertexAttribArray",
-"glVertexAttribPointer", "glBindBuffer", "glBufferData", "glBufferSubData", "glDeleteBuffers",]
-
-    for line in lines:
-        if line.find("API_ENTRY(") >= 0: # a function prototype
-            returnType = line[0: line.find(" API_ENTRY(")]
-            functionName = line[line.find("(") + 1: line.find(")")] #extract GL function name
-            parameterList = line[line.find(")(") + 2: line.find(") {")]
-
-            #if line.find("*") >= 0:
-            #    extern = "%s Debug_%s(%s);" % (returnType, functionName, parameterList)
-            #    externs.append(extern)
-            #    continue
-
-            if functionName in skipFunctions:
-                sys.stderr.write("!\n! skipping function '%s'\n!\n" % (functionName))
-                continue
-
-            parameters = parameterList.split(',')
-            paramIndex = 0
-            if line.find("*") >= 0 and (line.find("*") < line.find(":") or line.find("*") > line.rfind(":")): # unannotated pointer
-                if not functionName in extendFunctions:
-                    # add function to list of functions that should be hand written, but generate code anyways
-                    extern = "%s Debug_%s(%s);" % (returnType, functionName, RemoveAnnotation(parameterList))
-                    sys.stderr.write("%s should be hand written\n" % (extern))
-                    print "// FIXME: this function has pointers, it should be hand written"
-                    externs.append(extern)
-
-            print "%s Debug_%s(%s)\n{" % (returnType, functionName, RemoveAnnotation(parameterList))
-            print "    glesv2debugger::Message msg;"
-
-            if parameterList == "void":
-                parameters = []
-            arguments = ""
-            paramNames = []
-            inout = ""
-            getData = ""
-
-            callerMembers = ""
-            setCallerMembers = ""
-            setMsgParameters = ""
-
-            for parameter in parameters:
-                const = parameter.find("const")
-                parameter = parameter.replace("const", "")
-                parameter = parameter.strip()
-                paramType = parameter.split(' ')[0]
-                paramName = parameter.split(' ')[1]
-                annotation = ""
-                arguments += paramName
-                if parameter.find(":") >= 0: # has annotation
-                    assert inout == "" # only one parameter should be annotated
-                    sys.stderr.write("%s is annotated: %s \n" % (functionName, paramType))
-                    inout = paramType.split(":")[2]
-                    annotation = paramType.split(":")[1]
-                    paramType = paramType.split(":")[0]
-                    count = 1
-                    countArg = ""
-                    if annotation.find("*") >= 0: # [1,n] * param
-                        count = int(annotation.split("*")[0])
-                        countArg = annotation.split("*")[1]
-                        assert countArg in paramNames
-                    elif annotation in paramNames:
-                        count = 1
-                        countArg = annotation
-                    elif annotation == "GLstring":
-                        annotation = "strlen(%s)" % (paramName)
-                    else:
-                        count = int(annotation)
-
-                    setMsgParameters += "    msg.set_arg%d(ToInt(%s));\n" % (paramIndex, paramName)
-                    if paramType.find("void") >= 0:
-                        getData += "    msg.mutable_data()->assign(reinterpret_cast<const char *>(%s), %s * sizeof(char));" % (paramName, annotation)
-                    else:
-                        getData += "    msg.mutable_data()->assign(reinterpret_cast<const char *>(%s), %s * sizeof(%s));" % (paramName, annotation, paramType)
-                    paramType += "*"
-                else:
-                    if paramType == "GLfloat" or paramType == "GLclampf" or paramType.find("*") >= 0:
-                        setMsgParameters += "    msg.set_arg%d(ToInt(%s));\n" % (paramIndex, paramName)
-                    else:
-                        setMsgParameters += "    msg.set_arg%d(%s);\n" % (paramIndex, paramName)
-                if paramIndex < len(parameters) - 1:
-                        arguments += ', '
-                if const >= 0:
-                    paramType = "const " + paramType
-                paramNames.append(paramName)
-                paramIndex += 1
-                callerMembers += "        %s %s;\n" % (paramType, paramName)
-                setCallerMembers += "    caller.%s = %s;\n" % (paramName, paramName)
-
-            print "    struct : public FunctionCall {"
-            print callerMembers
-            print "        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {"
-            if inout in ["out", "inout"]: # get timing excluding output data copy
-                print "            nsecs_t c0 = systemTime(timeMode);"
-            if returnType == "void":
-                print "            _c->%s(%s);" % (functionName, arguments)
-            else:
-                print "            const int * ret = reinterpret_cast<const int *>(_c->%s(%s));" % (functionName, arguments)
-                print "            msg.set_ret(ToInt(ret));"
-            if inout in ["out", "inout"]:
-                print "            msg.set_time((systemTime(timeMode) - c0) * 1e-6f);"
-                print "        " + getData
-            if functionName in extendFunctions:
-                print "\
-#ifdef EXTEND_AFTER_CALL_Debug_%s\n\
-            EXTEND_AFTER_CALL_Debug_%s;\n\
-#endif" % (functionName, functionName)
-            if functionName in contextFunctions:
-                print "            getDbgContextThreadSpecific()->%s(%s);" % (functionName, arguments)
-            if returnType == "void":
-                print "            return 0;"
-            else:
-                print "            return ret;"
-            print """        }
-    } caller;"""
-            print setCallerMembers
-            print setMsgParameters
-
-            if line.find("*") >= 0 or line.find(":") >= 0:
-                print "    // FIXME: check for pointer usage"
-            if inout in ["in", "inout"]:
-                print getData
-            if functionName in extendFunctions:
-                print "\
-#ifdef EXTEND_Debug_%s\n\
-    EXTEND_Debug_%s;\n\
-#endif" % (functionName, functionName)
-            print "    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_%s);"\
-                % (functionName)
-            if returnType != "void":
-                if returnType == "GLboolean":
-                    print "    return static_cast<GLboolean>(reinterpret_cast<int>(ret));"
-                else:
-                    print "    return reinterpret_cast<%s>(ret);" % (returnType)
-            print "}\n"
-
-
-    print "// FIXME: the following functions should be written by hand"
-    for extern in externs:
-        print extern
-
-if __name__ == "__main__":
-    print """\
-/*
- ** Copyright 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.
- */
-
-// auto generated by generate_api_cpp.py
-
-#include <utils/Debug.h>
-
-#include "src/header.h"
-#include "src/api.h"
-
-template<typename T> static int ToInt(const T & t)
-{
-    COMPILE_TIME_ASSERT_FUNCTION_SCOPE(sizeof(T) == sizeof(int));
-    return (int &)t;
-}
-"""
-    lines = open("gl2_api_annotated.in").readlines()
-    generate_api(lines)
-    #lines = open("gl2ext_api.in").readlines()
-    #generate_api(lines)
-
-
diff --git a/opengl/libs/GLES2_dbg/generate_caller_cpp.py b/opengl/libs/GLES2_dbg/generate_caller_cpp.py
deleted file mode 100755
index ee4208d..0000000
--- a/opengl/libs/GLES2_dbg/generate_caller_cpp.py
+++ /dev/null
@@ -1,199 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
-#
-# Copyright 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.
-#
-
-import os
-import sys
-
-externs = []
-    
-def generate_caller(lines):
-    i = 0
-    output = ""
-    skipFunctions = []
-    
-    for line in lines:
-        if line.find("API_ENTRY(") >= 0: # a function prototype
-            returnType = line[0: line.find(" API_ENTRY(")]
-            functionName = line[line.find("(") + 1: line.find(")")] #extract GL function name
-            parameterList = line[line.find(")(") + 2: line.find(") {")]
-            
-            #if line.find("*") >= 0:
-            #    extern = "%s Debug_%s(%s);" % (returnType, functionName, parameterList)
-            #    externs.append(extern)
-            #    continue
-            
-            if functionName in skipFunctions:
-                sys.stderr.write("!\n! skipping function '%s'\n!\n" % functionName)
-                continue
-            output += "\
-    case glesv2debugger::Message_Function_%s:\n" % functionName
-            parameters = parameterList.split(',')
-            paramIndex = 0
-            if line.find("*") >= 0 and (line.find("*") < line.find(":") or line.find("*") > line.rfind(":")): # unannotated pointer
-                # add function to list of functions that should be hand written, but generate code anyways
-                externs.append(functionName)
-                output += "\
-        ret = GenerateCall_%s(dbg, cmd, msg, prevRet);\n\
-        break;\n" % (functionName)
-                continue
-            elif line.find(":out") >= 0 or line.find(":inout") >= 0:
-                externs.append(functionName)
-                output += "\
-        ret = GenerateCall_%s(dbg, cmd, msg, prevRet);\n\
-        break; // annotated output pointers\n" % (functionName)
-                continue
-                
-            if parameterList == "void":
-                parameters = []
-            arguments = ""
-            paramNames = []
-            inout = ""
-            getData = ""
-            
-            callerMembers = ""
-
-            for parameter in parameters:
-                const = parameter.find("const")
-                parameter = parameter.replace("const", "")
-                parameter = parameter.strip()
-                paramType = parameter.split(' ')[0]
-                paramName = parameter.split(' ')[1]
-                annotation = ""
-                if parameter.find(":") >= 0: # has annotation
-                    assert inout == "" # only one parameter should be annotated
-                    sys.stderr.write("%s is annotated: %s \n" % (functionName, paramType))
-                    inout = paramType.split(":")[2]
-                    annotation = paramType.split(":")[1]
-                    paramType = paramType.split(":")[0]
-                    count = 1
-                    countArg = ""
-                    if annotation.find("*") >= 0: # [1,n] * param
-                        count = int(annotation.split("*")[0])
-                        countArg = annotation.split("*")[1]
-                        assert countArg in paramNames
-                    elif annotation in paramNames:
-                        count = 1
-                        countArg = annotation
-                    elif annotation == "GLstring":
-                        annotation = "strlen(%s)" % (paramName)
-                    else:
-                        count = int(annotation)
-            
-                    paramType += "*"
-                    arguments += "reinterpret_cast<%s>(const_cast<char *>(cmd.data().data()))" % (paramType)
-                elif paramType == "GLboolean":
-                    arguments += "GLboolean(cmd.arg%d())" % (paramIndex)
-                else:
-                    arguments += "static_cast<%s>(cmd.arg%d())" % (paramType, paramIndex)
-
-                if paramIndex < len(parameters) - 1:
-                        arguments += ", "
-                if len(arguments) - arguments.rfind("\n") > 60 :
-                    arguments += "\n\
-            "
-                if const >= 0:
-                    paramType = "const " + paramType
-                paramNames.append(paramName)
-                paramIndex += 1
-                
-            if returnType == "void":
-                output += "\
-        dbg->hooks->gl.%s(\n\
-            %s);\n\
-        break;\n" % (functionName, arguments)
-            else:
-                output += "\
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.%s(\n\
-            %s)));\n\
-        if (cmd.has_ret())\n\
-            ret = reinterpret_cast<int *>(msg.ret());\n\
-        break;\n" % (functionName, arguments)
-    return output
-
-if __name__ == "__main__":
-
-    lines = open("gl2_api_annotated.in").readlines()
-    output = generate_caller(lines)
-    
-    out = open("src/caller.cpp", "w")
-    out.write("""\
-/*
- ** Copyright 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.
- */
-
-// auto generated by generate_caller_cpp.py
-// implement declarations in caller.h
-
-#include "header.h"
-
-namespace android {
-
-""")
-
-    for extern in externs:
-        out.write("\
-static const int * GenerateCall_%s(DbgContext * const dbg,\n\
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);\n" % (extern))
-        print("\
-static const int * GenerateCall_%s(DbgContext * const dbg,\n\
-                            const glesv2debugger::Message & cmd,\n\
-                            glesv2debugger::Message & msg, const int * const prevRet)\n\
-{ assert(0); return prevRet; }\n" % (extern))
-                     
-    out.write(
-"""
-#include "caller.h"
-
-const int * GenerateCall(DbgContext * const dbg, const glesv2debugger::Message & cmd,
-                  glesv2debugger::Message & msg, const int * const prevRet)
-{
-    LOGD("GenerateCall function=%u", cmd.function());
-    const int * ret = prevRet; // only some functions have return value
-    nsecs_t c0 = systemTime(timeMode);
-    switch (cmd.function()) {""")
-    
-    out.write(output)
-    
-    out.write("""\
-    default:
-        assert(0);
-    }
-    msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-    msg.set_context_id(reinterpret_cast<int>(dbg));
-    msg.set_function(cmd.function());
-    msg.set_type(glesv2debugger::Message_Type_AfterCall);
-    return ret;
-}
-
-}; // name space android {
-""")           
-    
-            
diff --git a/opengl/libs/GLES2_dbg/generate_debug_in.py b/opengl/libs/GLES2_dbg/generate_debug_in.py
deleted file mode 100755
index 1280c6f..0000000
--- a/opengl/libs/GLES2_dbg/generate_debug_in.py
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
-#
-# Copyright 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.
-#
-
-import os
-import sys
-
-def append_functions(functions, lines):
-	i = 0
-	for line in lines:
-		if line.find("API_ENTRY(") >= 0: # a function prototype
-			returnType = line[0: line.find(" API_ENTRY(")]
-			functionName = line[line.find("(") + 1: line.find(")")] #extract GL function name
-			parameterList = line[line.find(")(") + 2: line.find(") {")]
-			
-			functions.append(functionName)
-			#print functionName
-			continue
-				
-			parameters = parameterList.split(',')
-			paramIndex = 0
-			if line.find("*") >= 0:
-				print "// FIXME: this function has pointers, it should be hand written"
-				externs.append("%s Tracing_%s(%s);" % (returnType, functionName, parameterList))
-			print "%s Tracing_%s(%s)\n{" % (returnType, functionName, parameterList)
-			
-			if parameterList == "void":
-				parameters = []
-			
-			arguments = ""
-			 
-			for parameter in parameters:
-				parameter = parameter.replace("const", "")
-				parameter = parameter.strip()
-				paramType = parameter.split(' ')[0]
-				paramName = parameter.split(' ')[1]
-				
-				paramIndex += 1
-				
-	return functions
-	
-
-
-if __name__ == "__main__":
-	definedFunctions = []
-	lines = open("gl2_api_annotated.in").readlines()
-	definedFunctions = append_functions(definedFunctions, lines)
-	
-	output = open("../debug.in", "w")
-	lines = open("../trace.in").readlines()
-	output.write("// the following functions are not defined in GLESv2_dbg\n")
-	for line in lines:
-		functionName = ""
-		if line.find("TRACE_GL(") >= 0: # a function prototype
-			functionName = line.split(',')[1].strip()
-		elif line.find("TRACE_GL_VOID(") >= 0: # a function prototype
-			functionName = line[line.find("(") + 1: line.find(",")] #extract GL function name
-		else:
-			continue
-		if functionName in definedFunctions:
-			#print functionName
-			continue
-		else:
-			output.write(line)
-	
diff --git a/opengl/libs/GLES2_dbg/generate_debugger_message_proto.py b/opengl/libs/GLES2_dbg/generate_debugger_message_proto.py
deleted file mode 100755
index 535b13e..0000000
--- a/opengl/libs/GLES2_dbg/generate_debugger_message_proto.py
+++ /dev/null
@@ -1,155 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
-#
-# Copyright 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.
-#
-
-import os
-
-def generate_egl_entries(output, lines, i):
-    for line in lines:
-        if line.find("EGL_ENTRY(") >= 0:
-            line = line.split(",")[1].strip() #extract EGL function name
-            output.write("        %s = %d;\n" % (line, i))
-            i += 1
-    return i
-
-
-def generate_gl_entries(output,lines,i):
-    for line in lines:
-        if line.find("API_ENTRY(") >= 0:
-            line = line[line.find("(") + 1: line.find(")")] #extract GL function name
-            output.write("        %s = %d;\n" % (line, i))
-            i += 1
-    return i
-
-
-if __name__ == "__main__":
-    output = open("debugger_message.proto",'w')
-    output.write("""\
-/*
- * 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.
- */
-
-// do not edit; auto generated by generate_debugger_message_proto.py
-
-package com.android.glesv2debugger;
-
-option optimize_for = LITE_RUNTIME;
-
-message Message
-{
-    required int32 context_id = 1; // GL context id
-    enum Function
-    {
-""")
-
-    i = 0;
-
-    lines = open("gl2_api_annotated.in").readlines()
-    i = generate_gl_entries(output, lines, i)
-    output.write("        // end of GL functions\n")
-
-    #lines = open("gl2ext_api.in").readlines()
-    #i = generate_gl_entries(output, lines, i)
-    #output.write("        // end of GL EXT functions\n")
-
-    lines = open("../EGL/egl_entries.in").readlines()
-    i = generate_egl_entries(output, lines, i)
-    output.write("        // end of GL EXT functions\n")
-
-    output.write("        ACK = %d;\n" % (i))
-    i += 1
-
-    output.write("        NEG = %d;\n" % (i))
-    i += 1
-
-    output.write("        CONTINUE = %d;\n" % (i))
-    i += 1
-
-    output.write("        SKIP = %d;\n" % (i))
-    i += 1
-
-    output.write("        SETPROP = %d;\n" % (i))
-    i += 1
-
-    output.write("""    }
-    required Function function = 2 [default = NEG]; // type/function of message
-    enum Type
-    {
-        BeforeCall = 0;
-        AfterCall = 1;
-        AfterGeneratedCall = 2;
-        Response = 3; // currently used for misc messages
-        CompleteCall = 4; // BeforeCall and AfterCall merged
-    }
-    required Type type = 3;
-    required bool expect_response = 4;
-    optional int32 ret = 5; // return value from previous GL call
-    optional int32 arg0 = 6; // args to GL call
-    optional int32 arg1 = 7;
-    optional int32 arg2 = 8;
-    optional int32 arg3 = 9;
-    optional int32 arg4 = 16;
-    optional int32 arg5 = 17;
-    optional int32 arg6 = 18;
-    optional int32 arg7 = 19; // glDrawArrays/Elements sets this to active number of attributes
-    optional int32 arg8 = 20;
-
-    optional bytes data = 10; // variable length data used for GL call
-    enum DataType
-    {
-        ReferencedImage = 0; // for image sourced from ReadPixels
-        NonreferencedImage = 1; // for image sourced from ReadPixels
-    };
-    // most data types can be inferred from function
-    optional DataType data_type = 23;
-    // these are used for image data when they cannot be determined from args
-    optional int32 pixel_format = 24;
-    optional int32 pixel_type = 25;
-    optional int32 image_width = 26;
-    optional int32 image_height = 27;
-
-    optional float time = 11; // duration of previous GL call (ms)
-    enum Prop
-    {
-        CaptureDraw = 0; // arg0 = number of glDrawArrays/Elements to glReadPixels
-        TimeMode = 1; // arg0 = SYSTEM_TIME_* in utils/Timers.h
-        ExpectResponse = 2; // arg0 = enum Function, arg1 = true/false
-        CaptureSwap = 3; // arg0 = number of eglSwapBuffers to glReadPixels
-        GLConstant = 4; // arg0 = GLenum, arg1 = constant; send GL impl. constants
-    };
-    optional Prop prop = 21; // used with SETPROP, value in arg0
-    optional float clock = 22; // wall clock in seconds
-}
-""")
-
-    output.close()
-
-    os.system("aprotoc --cpp_out=src --java_out=../../../../../development/tools/glesv2debugger/src debugger_message.proto")
-    os.system('mv -f "src/debugger_message.pb.cc" "src/debugger_message.pb.cpp"')
diff --git a/opengl/libs/GLES2_dbg/gl2_api_annotated.in b/opengl/libs/GLES2_dbg/gl2_api_annotated.in
deleted file mode 100644
index 227e2eb..0000000
--- a/opengl/libs/GLES2_dbg/gl2_api_annotated.in
+++ /dev/null
@@ -1,426 +0,0 @@
-void API_ENTRY(glActiveTexture)(GLenum texture) {
-    CALL_GL_API(glActiveTexture, texture);
-}
-void API_ENTRY(glAttachShader)(GLuint program, GLuint shader) {
-    CALL_GL_API(glAttachShader, program, shader);
-}
-void API_ENTRY(glBindAttribLocation)(GLuint program, GLuint index, const GLchar:GLstring:in name) {
-    CALL_GL_API(glBindAttribLocation, program, index, name);
-}
-void API_ENTRY(glBindBuffer)(GLenum target, GLuint buffer) {
-    CALL_GL_API(glBindBuffer, target, buffer);
-}
-void API_ENTRY(glBindFramebuffer)(GLenum target, GLuint framebuffer) {
-    CALL_GL_API(glBindFramebuffer, target, framebuffer);
-}
-void API_ENTRY(glBindRenderbuffer)(GLenum target, GLuint renderbuffer) {
-    CALL_GL_API(glBindRenderbuffer, target, renderbuffer);
-}
-void API_ENTRY(glBindTexture)(GLenum target, GLuint texture) {
-    CALL_GL_API(glBindTexture, target, texture);
-}
-void API_ENTRY(glBlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
-    CALL_GL_API(glBlendColor, red, green, blue, alpha);
-}
-void API_ENTRY(glBlendEquation)( GLenum mode ) {
-    CALL_GL_API(glBlendEquation, mode);
-}
-void API_ENTRY(glBlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha) {
-    CALL_GL_API(glBlendEquationSeparate, modeRGB, modeAlpha);
-}
-void API_ENTRY(glBlendFunc)(GLenum sfactor, GLenum dfactor) {
-    CALL_GL_API(glBlendFunc, sfactor, dfactor);
-}
-void API_ENTRY(glBlendFuncSeparate)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) {
-    CALL_GL_API(glBlendFuncSeparate, srcRGB, dstRGB, srcAlpha, dstAlpha);
-}
-void API_ENTRY(glBufferData)(GLenum target, GLsizeiptr size, const GLvoid:size:in data, GLenum usage) {
-    CALL_GL_API(glBufferData, target, size, data, usage);
-}
-void API_ENTRY(glBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid:size:in data) {
-    CALL_GL_API(glBufferSubData, target, offset, size, data);
-}
-GLenum API_ENTRY(glCheckFramebufferStatus)(GLenum target) {
-    CALL_GL_API_RETURN(glCheckFramebufferStatus, target);
-}
-void API_ENTRY(glClear)(GLbitfield mask) {
-    CALL_GL_API(glClear, mask);
-}
-void API_ENTRY(glClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
-    CALL_GL_API(glClearColor, red, green, blue, alpha);
-}
-void API_ENTRY(glClearDepthf)(GLclampf depth) {
-    CALL_GL_API(glClearDepthf, depth);
-}
-void API_ENTRY(glClearStencil)(GLint s) {
-    CALL_GL_API(glClearStencil, s);
-}
-void API_ENTRY(glColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) {
-    CALL_GL_API(glColorMask, red, green, blue, alpha);
-}
-void API_ENTRY(glCompileShader)(GLuint shader) {
-    CALL_GL_API(glCompileShader, shader);
-}
-void API_ENTRY(glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data) {
-    CALL_GL_API(glCompressedTexImage2D, target, level, internalformat, width, height, border, imageSize, data);
-}
-void API_ENTRY(glCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data) {
-    CALL_GL_API(glCompressedTexSubImage2D, target, level, xoffset, yoffset, width, height, format, imageSize, data);
-}
-void API_ENTRY(glCopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
-    CALL_GL_API(glCopyTexImage2D, target, level, internalformat, x, y, width, height, border);
-}
-void API_ENTRY(glCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
-    CALL_GL_API(glCopyTexSubImage2D, target, level, xoffset, yoffset, x, y, width, height);
-}
-GLuint API_ENTRY(glCreateProgram)(void) {
-    CALL_GL_API_RETURN(glCreateProgram);
-}
-GLuint API_ENTRY(glCreateShader)(GLenum type) {
-    CALL_GL_API_RETURN(glCreateShader, type);
-}
-void API_ENTRY(glCullFace)(GLenum mode) {
-    CALL_GL_API(glCullFace, mode);
-}
-void API_ENTRY(glDeleteBuffers)(GLsizei n, const GLuint:n:in buffers) {
-    CALL_GL_API(glDeleteBuffers, n, buffers);
-}
-void API_ENTRY(glDeleteFramebuffers)(GLsizei n, const GLuint:n:in framebuffers) {
-    CALL_GL_API(glDeleteFramebuffers, n, framebuffers);
-}
-void API_ENTRY(glDeleteProgram)(GLuint program) {
-    CALL_GL_API(glDeleteProgram, program);
-}
-void API_ENTRY(glDeleteRenderbuffers)(GLsizei n, const GLuint:n:in renderbuffers) {
-    CALL_GL_API(glDeleteRenderbuffers, n, renderbuffers);
-}
-void API_ENTRY(glDeleteShader)(GLuint shader) {
-    CALL_GL_API(glDeleteShader, shader);
-}
-void API_ENTRY(glDeleteTextures)(GLsizei n, const GLuint:n:in textures) {
-    CALL_GL_API(glDeleteTextures, n, textures);
-}
-void API_ENTRY(glDepthFunc)(GLenum func) {
-    CALL_GL_API(glDepthFunc, func);
-}
-void API_ENTRY(glDepthMask)(GLboolean flag) {
-    CALL_GL_API(glDepthMask, flag);
-}
-void API_ENTRY(glDepthRangef)(GLclampf zNear, GLclampf zFar) {
-    CALL_GL_API(glDepthRangef, zNear, zFar);
-}
-void API_ENTRY(glDetachShader)(GLuint program, GLuint shader) {
-    CALL_GL_API(glDetachShader, program, shader);
-}
-void API_ENTRY(glDisable)(GLenum cap) {
-    CALL_GL_API(glDisable, cap);
-}
-void API_ENTRY(glDisableVertexAttribArray)(GLuint index) {
-    CALL_GL_API(glDisableVertexAttribArray, index);
-}
-void API_ENTRY(glDrawArrays)(GLenum mode, GLint first, GLsizei count) {
-    CALL_GL_API(glDrawArrays, mode, first, count);
-}
-void API_ENTRY(glDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) {
-    CALL_GL_API(glDrawElements, mode, count, type, indices);
-}
-void API_ENTRY(glEnable)(GLenum cap) {
-    CALL_GL_API(glEnable, cap);
-}
-void API_ENTRY(glEnableVertexAttribArray)(GLuint index) {
-    CALL_GL_API(glEnableVertexAttribArray, index);
-}
-void API_ENTRY(glFinish)(void) {
-    CALL_GL_API(glFinish);
-}
-void API_ENTRY(glFlush)(void) {
-    CALL_GL_API(glFlush);
-}
-void API_ENTRY(glFramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
-    CALL_GL_API(glFramebufferRenderbuffer, target, attachment, renderbuffertarget, renderbuffer);
-}
-void API_ENTRY(glFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
-    CALL_GL_API(glFramebufferTexture2D, target, attachment, textarget, texture, level);
-}
-void API_ENTRY(glFrontFace)(GLenum mode) {
-    CALL_GL_API(glFrontFace, mode);
-}
-void API_ENTRY(glGenBuffers)(GLsizei n, GLuint:n:out buffers) {
-    CALL_GL_API(glGenBuffers, n, buffers);
-}
-void API_ENTRY(glGenerateMipmap)(GLenum target) {
-    CALL_GL_API(glGenerateMipmap, target);
-}
-void API_ENTRY(glGenFramebuffers)(GLsizei n, GLuint:n:out framebuffers) {
-    CALL_GL_API(glGenFramebuffers, n, framebuffers);
-}
-void API_ENTRY(glGenRenderbuffers)(GLsizei n, GLuint:n:out renderbuffers) {
-    CALL_GL_API(glGenRenderbuffers, n, renderbuffers);
-}
-void API_ENTRY(glGenTextures)(GLsizei n, GLuint:n:out textures) {
-    CALL_GL_API(glGenTextures, n, textures);
-}
-void API_ENTRY(glGetActiveAttrib)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar:GLstring:in name) {
-    CALL_GL_API(glGetActiveAttrib, program, index, bufsize, length, size, type, name);
-}
-void API_ENTRY(glGetActiveUniform)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar:GLstring:in name) {
-    CALL_GL_API(glGetActiveUniform, program, index, bufsize, length, size, type, name);
-}
-void API_ENTRY(glGetAttachedShaders)(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) {
-    CALL_GL_API(glGetAttachedShaders, program, maxcount, count, shaders);
-}
-int API_ENTRY(glGetAttribLocation)(GLuint program, const GLchar:GLstring:in name) {
-    CALL_GL_API_RETURN(glGetAttribLocation, program, name);
-}
-void API_ENTRY(glGetBooleanv)(GLenum pname, GLboolean* params) {
-    CALL_GL_API(glGetBooleanv, pname, params);
-}
-void API_ENTRY(glGetBufferParameteriv)(GLenum target, GLenum pname, GLint* params) {
-    CALL_GL_API(glGetBufferParameteriv, target, pname, params);
-}
-GLenum API_ENTRY(glGetError)(void) {
-    CALL_GL_API_RETURN(glGetError);
-}
-void API_ENTRY(glGetFloatv)(GLenum pname, GLfloat* params) {
-    CALL_GL_API(glGetFloatv, pname, params);
-}
-void API_ENTRY(glGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint* params) {
-    CALL_GL_API(glGetFramebufferAttachmentParameteriv, target, attachment, pname, params);
-}
-void API_ENTRY(glGetIntegerv)(GLenum pname, GLint* params) {
-    CALL_GL_API(glGetIntegerv, pname, params);
-}
-void API_ENTRY(glGetProgramiv)(GLuint program, GLenum pname, GLint:1:out params) {
-    CALL_GL_API(glGetProgramiv, program, pname, params);
-}
-void API_ENTRY(glGetProgramInfoLog)(GLuint program, GLsizei bufsize, GLsizei* length, GLchar:GLstring:out infolog) {
-    CALL_GL_API(glGetProgramInfoLog, program, bufsize, length, infolog);
-}
-void API_ENTRY(glGetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint* params) {
-    CALL_GL_API(glGetRenderbufferParameteriv, target, pname, params);
-}
-void API_ENTRY(glGetShaderiv)(GLuint shader, GLenum pname, GLint:1:out params) {
-    CALL_GL_API(glGetShaderiv, shader, pname, params);
-}
-void API_ENTRY(glGetShaderInfoLog)(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar:GLstring:out infolog) {
-    CALL_GL_API(glGetShaderInfoLog, shader, bufsize, length, infolog);
-}
-void API_ENTRY(glGetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) {
-    CALL_GL_API(glGetShaderPrecisionFormat, shadertype, precisiontype, range, precision);
-}
-void API_ENTRY(glGetShaderSource)(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar:GLstring:out source) {
-    CALL_GL_API(glGetShaderSource, shader, bufsize, length, source);
-}
-const GLubyte* API_ENTRY(glGetString)(GLenum name) {
-    CALL_GL_API_RETURN(glGetString, name);
-}
-void API_ENTRY(glGetTexParameterfv)(GLenum target, GLenum pname, GLfloat* params) {
-    CALL_GL_API(glGetTexParameterfv, target, pname, params);
-}
-void API_ENTRY(glGetTexParameteriv)(GLenum target, GLenum pname, GLint* params) {
-    CALL_GL_API(glGetTexParameteriv, target, pname, params);
-}
-void API_ENTRY(glGetUniformfv)(GLuint program, GLint location, GLfloat* params) {
-    CALL_GL_API(glGetUniformfv, program, location, params);
-}
-void API_ENTRY(glGetUniformiv)(GLuint program, GLint location, GLint* params) {
-    CALL_GL_API(glGetUniformiv, program, location, params);
-}
-int API_ENTRY(glGetUniformLocation)(GLuint program, const GLchar:GLstring:in name) {
-    CALL_GL_API_RETURN(glGetUniformLocation, program, name);
-}
-void API_ENTRY(glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat* params) {
-    CALL_GL_API(glGetVertexAttribfv, index, pname, params);
-}
-void API_ENTRY(glGetVertexAttribiv)(GLuint index, GLenum pname, GLint* params) {
-    CALL_GL_API(glGetVertexAttribiv, index, pname, params);
-}
-void API_ENTRY(glGetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid** pointer) {
-    CALL_GL_API(glGetVertexAttribPointerv, index, pname, pointer);
-}
-void API_ENTRY(glHint)(GLenum target, GLenum mode) {
-    CALL_GL_API(glHint, target, mode);
-}
-GLboolean API_ENTRY(glIsBuffer)(GLuint buffer) {
-    CALL_GL_API_RETURN(glIsBuffer, buffer);
-}
-GLboolean API_ENTRY(glIsEnabled)(GLenum cap) {
-    CALL_GL_API_RETURN(glIsEnabled, cap);
-}
-GLboolean API_ENTRY(glIsFramebuffer)(GLuint framebuffer) {
-    CALL_GL_API_RETURN(glIsFramebuffer, framebuffer);
-}
-GLboolean API_ENTRY(glIsProgram)(GLuint program) {
-    CALL_GL_API_RETURN(glIsProgram, program);
-}
-GLboolean API_ENTRY(glIsRenderbuffer)(GLuint renderbuffer) {
-    CALL_GL_API_RETURN(glIsRenderbuffer, renderbuffer);
-}
-GLboolean API_ENTRY(glIsShader)(GLuint shader) {
-    CALL_GL_API_RETURN(glIsShader, shader);
-}
-GLboolean API_ENTRY(glIsTexture)(GLuint texture) {
-    CALL_GL_API_RETURN(glIsTexture, texture);
-}
-void API_ENTRY(glLineWidth)(GLfloat width) {
-    CALL_GL_API(glLineWidth, width);
-}
-void API_ENTRY(glLinkProgram)(GLuint program) {
-    CALL_GL_API(glLinkProgram, program);
-}
-void API_ENTRY(glPixelStorei)(GLenum pname, GLint param) {
-    CALL_GL_API(glPixelStorei, pname, param);
-}
-void API_ENTRY(glPolygonOffset)(GLfloat factor, GLfloat units) {
-    CALL_GL_API(glPolygonOffset, factor, units);
-}
-void API_ENTRY(glReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels) {
-    CALL_GL_API(glReadPixels, x, y, width, height, format, type, pixels);
-}
-void API_ENTRY(glReleaseShaderCompiler)(void) {
-    CALL_GL_API(glReleaseShaderCompiler);
-}
-void API_ENTRY(glRenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
-    CALL_GL_API(glRenderbufferStorage, target, internalformat, width, height);
-}
-void API_ENTRY(glSampleCoverage)(GLclampf value, GLboolean invert) {
-    CALL_GL_API(glSampleCoverage, value, invert);
-}
-void API_ENTRY(glScissor)(GLint x, GLint y, GLsizei width, GLsizei height) {
-    CALL_GL_API(glScissor, x, y, width, height);
-}
-void API_ENTRY(glShaderBinary)(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length) {
-    CALL_GL_API(glShaderBinary, n, shaders, binaryformat, binary, length);
-}
-void API_ENTRY(glShaderSource)(GLuint shader, GLsizei count, const GLchar** string, const GLint* length) {
-    CALL_GL_API(glShaderSource, shader, count, string, length);
-}
-void API_ENTRY(glStencilFunc)(GLenum func, GLint ref, GLuint mask) {
-    CALL_GL_API(glStencilFunc, func, ref, mask);
-}
-void API_ENTRY(glStencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask) {
-    CALL_GL_API(glStencilFuncSeparate, face, func, ref, mask);
-}
-void API_ENTRY(glStencilMask)(GLuint mask) {
-    CALL_GL_API(glStencilMask, mask);
-}
-void API_ENTRY(glStencilMaskSeparate)(GLenum face, GLuint mask) {
-    CALL_GL_API(glStencilMaskSeparate, face, mask);
-}
-void API_ENTRY(glStencilOp)(GLenum fail, GLenum zfail, GLenum zpass) {
-    CALL_GL_API(glStencilOp, fail, zfail, zpass);
-}
-void API_ENTRY(glStencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) {
-    CALL_GL_API(glStencilOpSeparate, face, fail, zfail, zpass);
-}
-void API_ENTRY(glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels) {
-    CALL_GL_API(glTexImage2D, target, level, internalformat, width, height, border, format, type, pixels);
-}
-void API_ENTRY(glTexParameterf)(GLenum target, GLenum pname, GLfloat param) {
-    CALL_GL_API(glTexParameterf, target, pname, param);
-}
-void API_ENTRY(glTexParameterfv)(GLenum target, GLenum pname, const GLfloat* params) {
-    CALL_GL_API(glTexParameterfv, target, pname, params);
-}
-void API_ENTRY(glTexParameteri)(GLenum target, GLenum pname, GLint param) {
-    CALL_GL_API(glTexParameteri, target, pname, param);
-}
-void API_ENTRY(glTexParameteriv)(GLenum target, GLenum pname, const GLint* params) {
-    CALL_GL_API(glTexParameteriv, target, pname, params);
-}
-void API_ENTRY(glTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels) {
-    CALL_GL_API(glTexSubImage2D, target, level, xoffset, yoffset, width, height, format, type, pixels);
-}
-void API_ENTRY(glUniform1f)(GLint location, GLfloat x) {
-    CALL_GL_API(glUniform1f, location, x);
-}
-void API_ENTRY(glUniform1fv)(GLint location, GLsizei count, const GLfloat:1*count:in v) {
-    CALL_GL_API(glUniform1fv, location, count, v);
-}
-void API_ENTRY(glUniform1i)(GLint location, GLint x) {
-    CALL_GL_API(glUniform1i, location, x);
-}
-void API_ENTRY(glUniform1iv)(GLint location, GLsizei count, const GLint:1*count:in v) {
-    CALL_GL_API(glUniform1iv, location, count, v);
-}
-void API_ENTRY(glUniform2f)(GLint location, GLfloat x, GLfloat y) {
-    CALL_GL_API(glUniform2f, location, x, y);
-}
-void API_ENTRY(glUniform2fv)(GLint location, GLsizei count, const GLfloat:2*count:in v) {
-    CALL_GL_API(glUniform2fv, location, count, v);
-}
-void API_ENTRY(glUniform2i)(GLint location, GLint x, GLint y) {
-    CALL_GL_API(glUniform2i, location, x, y);
-}
-void API_ENTRY(glUniform2iv)(GLint location, GLsizei count, const GLint:2*count:in v) {
-    CALL_GL_API(glUniform2iv, location, count, v);
-}
-void API_ENTRY(glUniform3f)(GLint location, GLfloat x, GLfloat y, GLfloat z) {
-    CALL_GL_API(glUniform3f, location, x, y, z);
-}
-void API_ENTRY(glUniform3fv)(GLint location, GLsizei count, const GLfloat:3*count:in v) {
-    CALL_GL_API(glUniform3fv, location, count, v);
-}
-void API_ENTRY(glUniform3i)(GLint location, GLint x, GLint y, GLint z) {
-    CALL_GL_API(glUniform3i, location, x, y, z);
-}
-void API_ENTRY(glUniform3iv)(GLint location, GLsizei count, const GLint:3*count:in v) {
-    CALL_GL_API(glUniform3iv, location, count, v);
-}
-void API_ENTRY(glUniform4f)(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
-    CALL_GL_API(glUniform4f, location, x, y, z, w);
-}
-void API_ENTRY(glUniform4fv)(GLint location, GLsizei count, const GLfloat:4*count:in v) {
-    CALL_GL_API(glUniform4fv, location, count, v);
-}
-void API_ENTRY(glUniform4i)(GLint location, GLint x, GLint y, GLint z, GLint w) {
-    CALL_GL_API(glUniform4i, location, x, y, z, w);
-}
-void API_ENTRY(glUniform4iv)(GLint location, GLsizei count, const GLint:4*count:in v) {
-    CALL_GL_API(glUniform4iv, location, count, v);
-}
-void API_ENTRY(glUniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat:4*count:in value) {
-    CALL_GL_API(glUniformMatrix2fv, location, count, transpose, value);
-}
-void API_ENTRY(glUniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat:9*count:in value) {
-    CALL_GL_API(glUniformMatrix3fv, location, count, transpose, value);
-}
-void API_ENTRY(glUniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat:16*count:in value) {
-    CALL_GL_API(glUniformMatrix4fv, location, count, transpose, value);
-}
-void API_ENTRY(glUseProgram)(GLuint program) {
-    CALL_GL_API(glUseProgram, program);
-}
-void API_ENTRY(glValidateProgram)(GLuint program) {
-    CALL_GL_API(glValidateProgram, program);
-}
-void API_ENTRY(glVertexAttrib1f)(GLuint indx, GLfloat x) {
-    CALL_GL_API(glVertexAttrib1f, indx, x);
-}
-void API_ENTRY(glVertexAttrib1fv)(GLuint indx, const GLfloat:1:in values) {
-    CALL_GL_API(glVertexAttrib1fv, indx, values);
-}
-void API_ENTRY(glVertexAttrib2f)(GLuint indx, GLfloat x, GLfloat y) {
-    CALL_GL_API(glVertexAttrib2f, indx, x, y);
-}
-void API_ENTRY(glVertexAttrib2fv)(GLuint indx, const GLfloat:2:in values) {
-    CALL_GL_API(glVertexAttrib2fv, indx, values);
-}
-void API_ENTRY(glVertexAttrib3f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z) {
-    CALL_GL_API(glVertexAttrib3f, indx, x, y, z);
-}
-void API_ENTRY(glVertexAttrib3fv)(GLuint indx, const GLfloat:3:in values) {
-    CALL_GL_API(glVertexAttrib3fv, indx, values);
-}
-void API_ENTRY(glVertexAttrib4f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
-    CALL_GL_API(glVertexAttrib4f, indx, x, y, z, w);
-}
-void API_ENTRY(glVertexAttrib4fv)(GLuint indx, const GLfloat:4:in values) {
-    CALL_GL_API(glVertexAttrib4fv, indx, values);
-}
-void API_ENTRY(glVertexAttribPointer)(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr) {
-    CALL_GL_API(glVertexAttribPointer, indx, size, type, normalized, stride, ptr);
-}
-void API_ENTRY(glViewport)(GLint x, GLint y, GLsizei width, GLsizei height) {
-    CALL_GL_API(glViewport, x, y, width, height);
-}
diff --git a/opengl/libs/GLES2_dbg/src/api.cpp b/opengl/libs/GLES2_dbg/src/api.cpp
deleted file mode 100644
index c483547..0000000
--- a/opengl/libs/GLES2_dbg/src/api.cpp
+++ /dev/null
@@ -1,3540 +0,0 @@
-/*
- ** Copyright 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.
- */
- 
-// auto generated by generate_api_cpp.py
-
-#include <utils/Debug.h>
-
-#include "src/header.h"
-#include "src/api.h"
-
-template<typename T> static int ToInt(const T & t)
-{
-    COMPILE_TIME_ASSERT_FUNCTION_SCOPE(sizeof(T) == sizeof(int));
-    return (int &)t;
-}
-
-void Debug_glActiveTexture(GLenum texture)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum texture;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glActiveTexture(texture);
-            return 0;
-        }
-    } caller;
-    caller.texture = texture;
-
-    msg.set_arg0(texture);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glActiveTexture);
-}
-
-void Debug_glAttachShader(GLuint program, GLuint shader)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-        GLuint shader;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glAttachShader(program, shader);
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-    caller.shader = shader;
-
-    msg.set_arg0(program);
-    msg.set_arg1(shader);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glAttachShader);
-}
-
-void Debug_glBindAttribLocation(GLuint program, GLuint index, const GLchar* name)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-        GLuint index;
-        const GLchar* name;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glBindAttribLocation(program, index, name);
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-    caller.index = index;
-    caller.name = name;
-
-    msg.set_arg0(program);
-    msg.set_arg1(index);
-    msg.set_arg2(ToInt(name));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(name), strlen(name) * sizeof(GLchar));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBindAttribLocation);
-}
-
-void Debug_glBindBuffer(GLenum target, GLuint buffer)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLuint buffer;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glBindBuffer(target, buffer);
-            getDbgContextThreadSpecific()->glBindBuffer(target, buffer);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.buffer = buffer;
-
-    msg.set_arg0(target);
-    msg.set_arg1(buffer);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBindBuffer);
-}
-
-void Debug_glBindFramebuffer(GLenum target, GLuint framebuffer)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLuint framebuffer;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glBindFramebuffer(target, framebuffer);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.framebuffer = framebuffer;
-
-    msg.set_arg0(target);
-    msg.set_arg1(framebuffer);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBindFramebuffer);
-}
-
-void Debug_glBindRenderbuffer(GLenum target, GLuint renderbuffer)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLuint renderbuffer;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glBindRenderbuffer(target, renderbuffer);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.renderbuffer = renderbuffer;
-
-    msg.set_arg0(target);
-    msg.set_arg1(renderbuffer);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBindRenderbuffer);
-}
-
-void Debug_glBindTexture(GLenum target, GLuint texture)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLuint texture;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glBindTexture(target, texture);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.texture = texture;
-
-    msg.set_arg0(target);
-    msg.set_arg1(texture);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBindTexture);
-}
-
-void Debug_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLclampf red;
-        GLclampf green;
-        GLclampf blue;
-        GLclampf alpha;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glBlendColor(red, green, blue, alpha);
-            return 0;
-        }
-    } caller;
-    caller.red = red;
-    caller.green = green;
-    caller.blue = blue;
-    caller.alpha = alpha;
-
-    msg.set_arg0(ToInt(red));
-    msg.set_arg1(ToInt(green));
-    msg.set_arg2(ToInt(blue));
-    msg.set_arg3(ToInt(alpha));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBlendColor);
-}
-
-void Debug_glBlendEquation( GLenum mode )
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum mode;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glBlendEquation(mode);
-            return 0;
-        }
-    } caller;
-    caller.mode = mode;
-
-    msg.set_arg0(mode);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBlendEquation);
-}
-
-void Debug_glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum modeRGB;
-        GLenum modeAlpha;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glBlendEquationSeparate(modeRGB, modeAlpha);
-            return 0;
-        }
-    } caller;
-    caller.modeRGB = modeRGB;
-    caller.modeAlpha = modeAlpha;
-
-    msg.set_arg0(modeRGB);
-    msg.set_arg1(modeAlpha);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBlendEquationSeparate);
-}
-
-void Debug_glBlendFunc(GLenum sfactor, GLenum dfactor)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum sfactor;
-        GLenum dfactor;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glBlendFunc(sfactor, dfactor);
-            return 0;
-        }
-    } caller;
-    caller.sfactor = sfactor;
-    caller.dfactor = dfactor;
-
-    msg.set_arg0(sfactor);
-    msg.set_arg1(dfactor);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBlendFunc);
-}
-
-void Debug_glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum srcRGB;
-        GLenum dstRGB;
-        GLenum srcAlpha;
-        GLenum dstAlpha;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
-            return 0;
-        }
-    } caller;
-    caller.srcRGB = srcRGB;
-    caller.dstRGB = dstRGB;
-    caller.srcAlpha = srcAlpha;
-    caller.dstAlpha = dstAlpha;
-
-    msg.set_arg0(srcRGB);
-    msg.set_arg1(dstRGB);
-    msg.set_arg2(srcAlpha);
-    msg.set_arg3(dstAlpha);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBlendFuncSeparate);
-}
-
-void Debug_glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLsizeiptr size;
-        const GLvoid* data;
-        GLenum usage;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glBufferData(target, size, data, usage);
-            getDbgContextThreadSpecific()->glBufferData(target, size, data, usage);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.size = size;
-    caller.data = data;
-    caller.usage = usage;
-
-    msg.set_arg0(target);
-    msg.set_arg1(size);
-    msg.set_arg2(ToInt(data));
-    msg.set_arg3(usage);
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(data), size * sizeof(char));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBufferData);
-}
-
-void Debug_glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLintptr offset;
-        GLsizeiptr size;
-        const GLvoid* data;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glBufferSubData(target, offset, size, data);
-            getDbgContextThreadSpecific()->glBufferSubData(target, offset, size, data);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.offset = offset;
-    caller.size = size;
-    caller.data = data;
-
-    msg.set_arg0(target);
-    msg.set_arg1(offset);
-    msg.set_arg2(size);
-    msg.set_arg3(ToInt(data));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(data), size * sizeof(char));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBufferSubData);
-}
-
-GLenum Debug_glCheckFramebufferStatus(GLenum target)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glCheckFramebufferStatus(target));
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-    caller.target = target;
-
-    msg.set_arg0(target);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCheckFramebufferStatus);
-    return reinterpret_cast<GLenum>(ret);
-}
-
-void Debug_glClear(GLbitfield mask)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLbitfield mask;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glClear(mask);
-            return 0;
-        }
-    } caller;
-    caller.mask = mask;
-
-    msg.set_arg0(mask);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glClear);
-}
-
-void Debug_glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLclampf red;
-        GLclampf green;
-        GLclampf blue;
-        GLclampf alpha;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glClearColor(red, green, blue, alpha);
-            return 0;
-        }
-    } caller;
-    caller.red = red;
-    caller.green = green;
-    caller.blue = blue;
-    caller.alpha = alpha;
-
-    msg.set_arg0(ToInt(red));
-    msg.set_arg1(ToInt(green));
-    msg.set_arg2(ToInt(blue));
-    msg.set_arg3(ToInt(alpha));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glClearColor);
-}
-
-void Debug_glClearDepthf(GLclampf depth)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLclampf depth;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glClearDepthf(depth);
-            return 0;
-        }
-    } caller;
-    caller.depth = depth;
-
-    msg.set_arg0(ToInt(depth));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glClearDepthf);
-}
-
-void Debug_glClearStencil(GLint s)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint s;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glClearStencil(s);
-            return 0;
-        }
-    } caller;
-    caller.s = s;
-
-    msg.set_arg0(s);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glClearStencil);
-}
-
-void Debug_glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLboolean red;
-        GLboolean green;
-        GLboolean blue;
-        GLboolean alpha;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glColorMask(red, green, blue, alpha);
-            return 0;
-        }
-    } caller;
-    caller.red = red;
-    caller.green = green;
-    caller.blue = blue;
-    caller.alpha = alpha;
-
-    msg.set_arg0(red);
-    msg.set_arg1(green);
-    msg.set_arg2(blue);
-    msg.set_arg3(alpha);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glColorMask);
-}
-
-void Debug_glCompileShader(GLuint shader)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint shader;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glCompileShader(shader);
-            return 0;
-        }
-    } caller;
-    caller.shader = shader;
-
-    msg.set_arg0(shader);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCompileShader);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLint level;
-        GLenum internalformat;
-        GLsizei width;
-        GLsizei height;
-        GLint border;
-        GLsizei imageSize;
-        const GLvoid* data;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.level = level;
-    caller.internalformat = internalformat;
-    caller.width = width;
-    caller.height = height;
-    caller.border = border;
-    caller.imageSize = imageSize;
-    caller.data = data;
-
-    msg.set_arg0(target);
-    msg.set_arg1(level);
-    msg.set_arg2(internalformat);
-    msg.set_arg3(width);
-    msg.set_arg4(height);
-    msg.set_arg5(border);
-    msg.set_arg6(imageSize);
-    msg.set_arg7(ToInt(data));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCompressedTexImage2D);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLint level;
-        GLint xoffset;
-        GLint yoffset;
-        GLsizei width;
-        GLsizei height;
-        GLenum format;
-        GLsizei imageSize;
-        const GLvoid* data;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.level = level;
-    caller.xoffset = xoffset;
-    caller.yoffset = yoffset;
-    caller.width = width;
-    caller.height = height;
-    caller.format = format;
-    caller.imageSize = imageSize;
-    caller.data = data;
-
-    msg.set_arg0(target);
-    msg.set_arg1(level);
-    msg.set_arg2(xoffset);
-    msg.set_arg3(yoffset);
-    msg.set_arg4(width);
-    msg.set_arg5(height);
-    msg.set_arg6(format);
-    msg.set_arg7(imageSize);
-    msg.set_arg8(ToInt(data));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCompressedTexSubImage2D);
-}
-
-void Debug_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLint level;
-        GLenum internalformat;
-        GLint x;
-        GLint y;
-        GLsizei width;
-        GLsizei height;
-        GLint border;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
-#ifdef EXTEND_AFTER_CALL_Debug_glCopyTexImage2D
-            EXTEND_AFTER_CALL_Debug_glCopyTexImage2D;
-#endif
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.level = level;
-    caller.internalformat = internalformat;
-    caller.x = x;
-    caller.y = y;
-    caller.width = width;
-    caller.height = height;
-    caller.border = border;
-
-    msg.set_arg0(target);
-    msg.set_arg1(level);
-    msg.set_arg2(internalformat);
-    msg.set_arg3(x);
-    msg.set_arg4(y);
-    msg.set_arg5(width);
-    msg.set_arg6(height);
-    msg.set_arg7(border);
-
-#ifdef EXTEND_Debug_glCopyTexImage2D
-    EXTEND_Debug_glCopyTexImage2D;
-#endif
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCopyTexImage2D);
-}
-
-void Debug_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLint level;
-        GLint xoffset;
-        GLint yoffset;
-        GLint x;
-        GLint y;
-        GLsizei width;
-        GLsizei height;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
-#ifdef EXTEND_AFTER_CALL_Debug_glCopyTexSubImage2D
-            EXTEND_AFTER_CALL_Debug_glCopyTexSubImage2D;
-#endif
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.level = level;
-    caller.xoffset = xoffset;
-    caller.yoffset = yoffset;
-    caller.x = x;
-    caller.y = y;
-    caller.width = width;
-    caller.height = height;
-
-    msg.set_arg0(target);
-    msg.set_arg1(level);
-    msg.set_arg2(xoffset);
-    msg.set_arg3(yoffset);
-    msg.set_arg4(x);
-    msg.set_arg5(y);
-    msg.set_arg6(width);
-    msg.set_arg7(height);
-
-#ifdef EXTEND_Debug_glCopyTexSubImage2D
-    EXTEND_Debug_glCopyTexSubImage2D;
-#endif
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCopyTexSubImage2D);
-}
-
-GLuint Debug_glCreateProgram(void)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glCreateProgram());
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCreateProgram);
-    return reinterpret_cast<GLuint>(ret);
-}
-
-GLuint Debug_glCreateShader(GLenum type)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum type;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glCreateShader(type));
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-    caller.type = type;
-
-    msg.set_arg0(type);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCreateShader);
-    return reinterpret_cast<GLuint>(ret);
-}
-
-void Debug_glCullFace(GLenum mode)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum mode;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glCullFace(mode);
-            return 0;
-        }
-    } caller;
-    caller.mode = mode;
-
-    msg.set_arg0(mode);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCullFace);
-}
-
-void Debug_glDeleteBuffers(GLsizei n, const GLuint* buffers)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLsizei n;
-        const GLuint* buffers;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glDeleteBuffers(n, buffers);
-            getDbgContextThreadSpecific()->glDeleteBuffers(n, buffers);
-            return 0;
-        }
-    } caller;
-    caller.n = n;
-    caller.buffers = buffers;
-
-    msg.set_arg0(n);
-    msg.set_arg1(ToInt(buffers));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(buffers), n * sizeof(GLuint));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDeleteBuffers);
-}
-
-void Debug_glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLsizei n;
-        const GLuint* framebuffers;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glDeleteFramebuffers(n, framebuffers);
-            return 0;
-        }
-    } caller;
-    caller.n = n;
-    caller.framebuffers = framebuffers;
-
-    msg.set_arg0(n);
-    msg.set_arg1(ToInt(framebuffers));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(framebuffers), n * sizeof(GLuint));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDeleteFramebuffers);
-}
-
-void Debug_glDeleteProgram(GLuint program)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glDeleteProgram(program);
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-
-    msg.set_arg0(program);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDeleteProgram);
-}
-
-void Debug_glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLsizei n;
-        const GLuint* renderbuffers;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glDeleteRenderbuffers(n, renderbuffers);
-            return 0;
-        }
-    } caller;
-    caller.n = n;
-    caller.renderbuffers = renderbuffers;
-
-    msg.set_arg0(n);
-    msg.set_arg1(ToInt(renderbuffers));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(renderbuffers), n * sizeof(GLuint));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDeleteRenderbuffers);
-}
-
-void Debug_glDeleteShader(GLuint shader)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint shader;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glDeleteShader(shader);
-            return 0;
-        }
-    } caller;
-    caller.shader = shader;
-
-    msg.set_arg0(shader);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDeleteShader);
-}
-
-void Debug_glDeleteTextures(GLsizei n, const GLuint* textures)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLsizei n;
-        const GLuint* textures;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glDeleteTextures(n, textures);
-            return 0;
-        }
-    } caller;
-    caller.n = n;
-    caller.textures = textures;
-
-    msg.set_arg0(n);
-    msg.set_arg1(ToInt(textures));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(textures), n * sizeof(GLuint));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDeleteTextures);
-}
-
-void Debug_glDepthFunc(GLenum func)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum func;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glDepthFunc(func);
-            return 0;
-        }
-    } caller;
-    caller.func = func;
-
-    msg.set_arg0(func);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDepthFunc);
-}
-
-void Debug_glDepthMask(GLboolean flag)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLboolean flag;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glDepthMask(flag);
-            return 0;
-        }
-    } caller;
-    caller.flag = flag;
-
-    msg.set_arg0(flag);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDepthMask);
-}
-
-void Debug_glDepthRangef(GLclampf zNear, GLclampf zFar)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLclampf zNear;
-        GLclampf zFar;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glDepthRangef(zNear, zFar);
-            return 0;
-        }
-    } caller;
-    caller.zNear = zNear;
-    caller.zFar = zFar;
-
-    msg.set_arg0(ToInt(zNear));
-    msg.set_arg1(ToInt(zFar));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDepthRangef);
-}
-
-void Debug_glDetachShader(GLuint program, GLuint shader)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-        GLuint shader;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glDetachShader(program, shader);
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-    caller.shader = shader;
-
-    msg.set_arg0(program);
-    msg.set_arg1(shader);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDetachShader);
-}
-
-void Debug_glDisable(GLenum cap)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum cap;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glDisable(cap);
-            return 0;
-        }
-    } caller;
-    caller.cap = cap;
-
-    msg.set_arg0(cap);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDisable);
-}
-
-void Debug_glDisableVertexAttribArray(GLuint index)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint index;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glDisableVertexAttribArray(index);
-            getDbgContextThreadSpecific()->glDisableVertexAttribArray(index);
-            return 0;
-        }
-    } caller;
-    caller.index = index;
-
-    msg.set_arg0(index);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDisableVertexAttribArray);
-}
-
-void Debug_glEnable(GLenum cap)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum cap;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glEnable(cap);
-            return 0;
-        }
-    } caller;
-    caller.cap = cap;
-
-    msg.set_arg0(cap);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glEnable);
-}
-
-void Debug_glEnableVertexAttribArray(GLuint index)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint index;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glEnableVertexAttribArray(index);
-            getDbgContextThreadSpecific()->glEnableVertexAttribArray(index);
-            return 0;
-        }
-    } caller;
-    caller.index = index;
-
-    msg.set_arg0(index);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glEnableVertexAttribArray);
-}
-
-void Debug_glFinish(void)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glFinish();
-            return 0;
-        }
-    } caller;
-
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glFinish);
-}
-
-void Debug_glFlush(void)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glFlush();
-            return 0;
-        }
-    } caller;
-
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glFlush);
-}
-
-void Debug_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum attachment;
-        GLenum renderbuffertarget;
-        GLuint renderbuffer;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.attachment = attachment;
-    caller.renderbuffertarget = renderbuffertarget;
-    caller.renderbuffer = renderbuffer;
-
-    msg.set_arg0(target);
-    msg.set_arg1(attachment);
-    msg.set_arg2(renderbuffertarget);
-    msg.set_arg3(renderbuffer);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glFramebufferRenderbuffer);
-}
-
-void Debug_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum attachment;
-        GLenum textarget;
-        GLuint texture;
-        GLint level;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glFramebufferTexture2D(target, attachment, textarget, texture, level);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.attachment = attachment;
-    caller.textarget = textarget;
-    caller.texture = texture;
-    caller.level = level;
-
-    msg.set_arg0(target);
-    msg.set_arg1(attachment);
-    msg.set_arg2(textarget);
-    msg.set_arg3(texture);
-    msg.set_arg4(level);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glFramebufferTexture2D);
-}
-
-void Debug_glFrontFace(GLenum mode)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum mode;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glFrontFace(mode);
-            return 0;
-        }
-    } caller;
-    caller.mode = mode;
-
-    msg.set_arg0(mode);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glFrontFace);
-}
-
-void Debug_glGenBuffers(GLsizei n, GLuint* buffers)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLsizei n;
-        GLuint* buffers;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            nsecs_t c0 = systemTime(timeMode);
-            _c->glGenBuffers(n, buffers);
-            msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-            msg.mutable_data()->assign(reinterpret_cast<const char *>(buffers), n * sizeof(GLuint));
-            return 0;
-        }
-    } caller;
-    caller.n = n;
-    caller.buffers = buffers;
-
-    msg.set_arg0(n);
-    msg.set_arg1(ToInt(buffers));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGenBuffers);
-}
-
-void Debug_glGenerateMipmap(GLenum target)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGenerateMipmap(target);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-
-    msg.set_arg0(target);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGenerateMipmap);
-}
-
-void Debug_glGenFramebuffers(GLsizei n, GLuint* framebuffers)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLsizei n;
-        GLuint* framebuffers;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            nsecs_t c0 = systemTime(timeMode);
-            _c->glGenFramebuffers(n, framebuffers);
-            msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-            msg.mutable_data()->assign(reinterpret_cast<const char *>(framebuffers), n * sizeof(GLuint));
-            return 0;
-        }
-    } caller;
-    caller.n = n;
-    caller.framebuffers = framebuffers;
-
-    msg.set_arg0(n);
-    msg.set_arg1(ToInt(framebuffers));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGenFramebuffers);
-}
-
-void Debug_glGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLsizei n;
-        GLuint* renderbuffers;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            nsecs_t c0 = systemTime(timeMode);
-            _c->glGenRenderbuffers(n, renderbuffers);
-            msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-            msg.mutable_data()->assign(reinterpret_cast<const char *>(renderbuffers), n * sizeof(GLuint));
-            return 0;
-        }
-    } caller;
-    caller.n = n;
-    caller.renderbuffers = renderbuffers;
-
-    msg.set_arg0(n);
-    msg.set_arg1(ToInt(renderbuffers));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGenRenderbuffers);
-}
-
-void Debug_glGenTextures(GLsizei n, GLuint* textures)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLsizei n;
-        GLuint* textures;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            nsecs_t c0 = systemTime(timeMode);
-            _c->glGenTextures(n, textures);
-            msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-            msg.mutable_data()->assign(reinterpret_cast<const char *>(textures), n * sizeof(GLuint));
-            return 0;
-        }
-    } caller;
-    caller.n = n;
-    caller.textures = textures;
-
-    msg.set_arg0(n);
-    msg.set_arg1(ToInt(textures));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGenTextures);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-        GLuint index;
-        GLsizei bufsize;
-        GLsizei* length;
-        GLint* size;
-        GLenum* type;
-        GLchar* name;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetActiveAttrib(program, index, bufsize, length, size, type, name);
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-    caller.index = index;
-    caller.bufsize = bufsize;
-    caller.length = length;
-    caller.size = size;
-    caller.type = type;
-    caller.name = name;
-
-    msg.set_arg0(program);
-    msg.set_arg1(index);
-    msg.set_arg2(bufsize);
-    msg.set_arg3(ToInt(length));
-    msg.set_arg4(ToInt(size));
-    msg.set_arg5(ToInt(type));
-    msg.set_arg6(ToInt(name));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(name), strlen(name) * sizeof(GLchar));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetActiveAttrib);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-        GLuint index;
-        GLsizei bufsize;
-        GLsizei* length;
-        GLint* size;
-        GLenum* type;
-        GLchar* name;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetActiveUniform(program, index, bufsize, length, size, type, name);
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-    caller.index = index;
-    caller.bufsize = bufsize;
-    caller.length = length;
-    caller.size = size;
-    caller.type = type;
-    caller.name = name;
-
-    msg.set_arg0(program);
-    msg.set_arg1(index);
-    msg.set_arg2(bufsize);
-    msg.set_arg3(ToInt(length));
-    msg.set_arg4(ToInt(size));
-    msg.set_arg5(ToInt(type));
-    msg.set_arg6(ToInt(name));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(name), strlen(name) * sizeof(GLchar));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetActiveUniform);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-        GLsizei maxcount;
-        GLsizei* count;
-        GLuint* shaders;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetAttachedShaders(program, maxcount, count, shaders);
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-    caller.maxcount = maxcount;
-    caller.count = count;
-    caller.shaders = shaders;
-
-    msg.set_arg0(program);
-    msg.set_arg1(maxcount);
-    msg.set_arg2(ToInt(count));
-    msg.set_arg3(ToInt(shaders));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetAttachedShaders);
-}
-
-int Debug_glGetAttribLocation(GLuint program, const GLchar* name)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-        const GLchar* name;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glGetAttribLocation(program, name));
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-    caller.program = program;
-    caller.name = name;
-
-    msg.set_arg0(program);
-    msg.set_arg1(ToInt(name));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(name), strlen(name) * sizeof(GLchar));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetAttribLocation);
-    return reinterpret_cast<int>(ret);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetBooleanv(GLenum pname, GLboolean* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum pname;
-        GLboolean* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetBooleanv(pname, params);
-            return 0;
-        }
-    } caller;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(pname);
-    msg.set_arg1(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetBooleanv);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum pname;
-        GLint* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetBufferParameteriv(target, pname, params);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(target);
-    msg.set_arg1(pname);
-    msg.set_arg2(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetBufferParameteriv);
-}
-
-GLenum Debug_glGetError(void)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glGetError());
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetError);
-    return reinterpret_cast<GLenum>(ret);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetFloatv(GLenum pname, GLfloat* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum pname;
-        GLfloat* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetFloatv(pname, params);
-            return 0;
-        }
-    } caller;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(pname);
-    msg.set_arg1(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetFloatv);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum attachment;
-        GLenum pname;
-        GLint* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.attachment = attachment;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(target);
-    msg.set_arg1(attachment);
-    msg.set_arg2(pname);
-    msg.set_arg3(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetFramebufferAttachmentParameteriv);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetIntegerv(GLenum pname, GLint* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum pname;
-        GLint* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetIntegerv(pname, params);
-            return 0;
-        }
-    } caller;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(pname);
-    msg.set_arg1(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetIntegerv);
-}
-
-void Debug_glGetProgramiv(GLuint program, GLenum pname, GLint* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-        GLenum pname;
-        GLint* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            nsecs_t c0 = systemTime(timeMode);
-            _c->glGetProgramiv(program, pname, params);
-            msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-            msg.mutable_data()->assign(reinterpret_cast<const char *>(params), 1 * sizeof(GLint));
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(program);
-    msg.set_arg1(pname);
-    msg.set_arg2(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetProgramiv);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-        GLsizei bufsize;
-        GLsizei* length;
-        GLchar* infolog;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            nsecs_t c0 = systemTime(timeMode);
-            _c->glGetProgramInfoLog(program, bufsize, length, infolog);
-            msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-            msg.mutable_data()->assign(reinterpret_cast<const char *>(infolog), strlen(infolog) * sizeof(GLchar));
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-    caller.bufsize = bufsize;
-    caller.length = length;
-    caller.infolog = infolog;
-
-    msg.set_arg0(program);
-    msg.set_arg1(bufsize);
-    msg.set_arg2(ToInt(length));
-    msg.set_arg3(ToInt(infolog));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetProgramInfoLog);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum pname;
-        GLint* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetRenderbufferParameteriv(target, pname, params);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(target);
-    msg.set_arg1(pname);
-    msg.set_arg2(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetRenderbufferParameteriv);
-}
-
-void Debug_glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint shader;
-        GLenum pname;
-        GLint* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            nsecs_t c0 = systemTime(timeMode);
-            _c->glGetShaderiv(shader, pname, params);
-            msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-            msg.mutable_data()->assign(reinterpret_cast<const char *>(params), 1 * sizeof(GLint));
-            return 0;
-        }
-    } caller;
-    caller.shader = shader;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(shader);
-    msg.set_arg1(pname);
-    msg.set_arg2(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetShaderiv);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint shader;
-        GLsizei bufsize;
-        GLsizei* length;
-        GLchar* infolog;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            nsecs_t c0 = systemTime(timeMode);
-            _c->glGetShaderInfoLog(shader, bufsize, length, infolog);
-            msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-            msg.mutable_data()->assign(reinterpret_cast<const char *>(infolog), strlen(infolog) * sizeof(GLchar));
-            return 0;
-        }
-    } caller;
-    caller.shader = shader;
-    caller.bufsize = bufsize;
-    caller.length = length;
-    caller.infolog = infolog;
-
-    msg.set_arg0(shader);
-    msg.set_arg1(bufsize);
-    msg.set_arg2(ToInt(length));
-    msg.set_arg3(ToInt(infolog));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetShaderInfoLog);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum shadertype;
-        GLenum precisiontype;
-        GLint* range;
-        GLint* precision;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
-            return 0;
-        }
-    } caller;
-    caller.shadertype = shadertype;
-    caller.precisiontype = precisiontype;
-    caller.range = range;
-    caller.precision = precision;
-
-    msg.set_arg0(shadertype);
-    msg.set_arg1(precisiontype);
-    msg.set_arg2(ToInt(range));
-    msg.set_arg3(ToInt(precision));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetShaderPrecisionFormat);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint shader;
-        GLsizei bufsize;
-        GLsizei* length;
-        GLchar* source;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            nsecs_t c0 = systemTime(timeMode);
-            _c->glGetShaderSource(shader, bufsize, length, source);
-            msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-            msg.mutable_data()->assign(reinterpret_cast<const char *>(source), strlen(source) * sizeof(GLchar));
-            return 0;
-        }
-    } caller;
-    caller.shader = shader;
-    caller.bufsize = bufsize;
-    caller.length = length;
-    caller.source = source;
-
-    msg.set_arg0(shader);
-    msg.set_arg1(bufsize);
-    msg.set_arg2(ToInt(length));
-    msg.set_arg3(ToInt(source));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetShaderSource);
-}
-
-// FIXME: this function has pointers, it should be hand written
-const GLubyte* Debug_glGetString(GLenum name)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum name;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glGetString(name));
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-    caller.name = name;
-
-    msg.set_arg0(name);
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetString);
-    return reinterpret_cast<const GLubyte*>(ret);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum pname;
-        GLfloat* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetTexParameterfv(target, pname, params);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(target);
-    msg.set_arg1(pname);
-    msg.set_arg2(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetTexParameterfv);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetTexParameteriv(GLenum target, GLenum pname, GLint* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum pname;
-        GLint* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetTexParameteriv(target, pname, params);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(target);
-    msg.set_arg1(pname);
-    msg.set_arg2(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetTexParameteriv);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetUniformfv(GLuint program, GLint location, GLfloat* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-        GLint location;
-        GLfloat* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetUniformfv(program, location, params);
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-    caller.location = location;
-    caller.params = params;
-
-    msg.set_arg0(program);
-    msg.set_arg1(location);
-    msg.set_arg2(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetUniformfv);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetUniformiv(GLuint program, GLint location, GLint* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-        GLint location;
-        GLint* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetUniformiv(program, location, params);
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-    caller.location = location;
-    caller.params = params;
-
-    msg.set_arg0(program);
-    msg.set_arg1(location);
-    msg.set_arg2(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetUniformiv);
-}
-
-int Debug_glGetUniformLocation(GLuint program, const GLchar* name)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-        const GLchar* name;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glGetUniformLocation(program, name));
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-    caller.program = program;
-    caller.name = name;
-
-    msg.set_arg0(program);
-    msg.set_arg1(ToInt(name));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(name), strlen(name) * sizeof(GLchar));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetUniformLocation);
-    return reinterpret_cast<int>(ret);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint index;
-        GLenum pname;
-        GLfloat* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetVertexAttribfv(index, pname, params);
-            return 0;
-        }
-    } caller;
-    caller.index = index;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(index);
-    msg.set_arg1(pname);
-    msg.set_arg2(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetVertexAttribfv);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint index;
-        GLenum pname;
-        GLint* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetVertexAttribiv(index, pname, params);
-            return 0;
-        }
-    } caller;
-    caller.index = index;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(index);
-    msg.set_arg1(pname);
-    msg.set_arg2(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetVertexAttribiv);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** pointer)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint index;
-        GLenum pname;
-        GLvoid** pointer;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetVertexAttribPointerv(index, pname, pointer);
-            return 0;
-        }
-    } caller;
-    caller.index = index;
-    caller.pname = pname;
-    caller.pointer = pointer;
-
-    msg.set_arg0(index);
-    msg.set_arg1(pname);
-    msg.set_arg2(ToInt(pointer));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetVertexAttribPointerv);
-}
-
-void Debug_glHint(GLenum target, GLenum mode)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum mode;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glHint(target, mode);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.mode = mode;
-
-    msg.set_arg0(target);
-    msg.set_arg1(mode);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glHint);
-}
-
-GLboolean Debug_glIsBuffer(GLuint buffer)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint buffer;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glIsBuffer(buffer));
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-    caller.buffer = buffer;
-
-    msg.set_arg0(buffer);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glIsBuffer);
-    return static_cast<GLboolean>(reinterpret_cast<int>(ret));
-}
-
-GLboolean Debug_glIsEnabled(GLenum cap)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum cap;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glIsEnabled(cap));
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-    caller.cap = cap;
-
-    msg.set_arg0(cap);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glIsEnabled);
-    return static_cast<GLboolean>(reinterpret_cast<int>(ret));
-}
-
-GLboolean Debug_glIsFramebuffer(GLuint framebuffer)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint framebuffer;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glIsFramebuffer(framebuffer));
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-    caller.framebuffer = framebuffer;
-
-    msg.set_arg0(framebuffer);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glIsFramebuffer);
-    return static_cast<GLboolean>(reinterpret_cast<int>(ret));
-}
-
-GLboolean Debug_glIsProgram(GLuint program)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glIsProgram(program));
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-    caller.program = program;
-
-    msg.set_arg0(program);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glIsProgram);
-    return static_cast<GLboolean>(reinterpret_cast<int>(ret));
-}
-
-GLboolean Debug_glIsRenderbuffer(GLuint renderbuffer)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint renderbuffer;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glIsRenderbuffer(renderbuffer));
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-    caller.renderbuffer = renderbuffer;
-
-    msg.set_arg0(renderbuffer);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glIsRenderbuffer);
-    return static_cast<GLboolean>(reinterpret_cast<int>(ret));
-}
-
-GLboolean Debug_glIsShader(GLuint shader)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint shader;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glIsShader(shader));
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-    caller.shader = shader;
-
-    msg.set_arg0(shader);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glIsShader);
-    return static_cast<GLboolean>(reinterpret_cast<int>(ret));
-}
-
-GLboolean Debug_glIsTexture(GLuint texture)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint texture;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glIsTexture(texture));
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-    caller.texture = texture;
-
-    msg.set_arg0(texture);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glIsTexture);
-    return static_cast<GLboolean>(reinterpret_cast<int>(ret));
-}
-
-void Debug_glLineWidth(GLfloat width)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLfloat width;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glLineWidth(width);
-            return 0;
-        }
-    } caller;
-    caller.width = width;
-
-    msg.set_arg0(ToInt(width));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glLineWidth);
-}
-
-void Debug_glLinkProgram(GLuint program)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glLinkProgram(program);
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-
-    msg.set_arg0(program);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glLinkProgram);
-}
-
-void Debug_glPixelStorei(GLenum pname, GLint param)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum pname;
-        GLint param;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glPixelStorei(pname, param);
-            return 0;
-        }
-    } caller;
-    caller.pname = pname;
-    caller.param = param;
-
-    msg.set_arg0(pname);
-    msg.set_arg1(param);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glPixelStorei);
-}
-
-void Debug_glPolygonOffset(GLfloat factor, GLfloat units)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLfloat factor;
-        GLfloat units;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glPolygonOffset(factor, units);
-            return 0;
-        }
-    } caller;
-    caller.factor = factor;
-    caller.units = units;
-
-    msg.set_arg0(ToInt(factor));
-    msg.set_arg1(ToInt(units));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glPolygonOffset);
-}
-
-void Debug_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint x;
-        GLint y;
-        GLsizei width;
-        GLsizei height;
-        GLenum format;
-        GLenum type;
-        GLvoid* pixels;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glReadPixels(x, y, width, height, format, type, pixels);
-#ifdef EXTEND_AFTER_CALL_Debug_glReadPixels
-            EXTEND_AFTER_CALL_Debug_glReadPixels;
-#endif
-            return 0;
-        }
-    } caller;
-    caller.x = x;
-    caller.y = y;
-    caller.width = width;
-    caller.height = height;
-    caller.format = format;
-    caller.type = type;
-    caller.pixels = pixels;
-
-    msg.set_arg0(x);
-    msg.set_arg1(y);
-    msg.set_arg2(width);
-    msg.set_arg3(height);
-    msg.set_arg4(format);
-    msg.set_arg5(type);
-    msg.set_arg6(ToInt(pixels));
-
-    // FIXME: check for pointer usage
-#ifdef EXTEND_Debug_glReadPixels
-    EXTEND_Debug_glReadPixels;
-#endif
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glReadPixels);
-}
-
-void Debug_glReleaseShaderCompiler(void)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glReleaseShaderCompiler();
-            return 0;
-        }
-    } caller;
-
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glReleaseShaderCompiler);
-}
-
-void Debug_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum internalformat;
-        GLsizei width;
-        GLsizei height;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glRenderbufferStorage(target, internalformat, width, height);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.internalformat = internalformat;
-    caller.width = width;
-    caller.height = height;
-
-    msg.set_arg0(target);
-    msg.set_arg1(internalformat);
-    msg.set_arg2(width);
-    msg.set_arg3(height);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glRenderbufferStorage);
-}
-
-void Debug_glSampleCoverage(GLclampf value, GLboolean invert)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLclampf value;
-        GLboolean invert;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glSampleCoverage(value, invert);
-            return 0;
-        }
-    } caller;
-    caller.value = value;
-    caller.invert = invert;
-
-    msg.set_arg0(ToInt(value));
-    msg.set_arg1(invert);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glSampleCoverage);
-}
-
-void Debug_glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint x;
-        GLint y;
-        GLsizei width;
-        GLsizei height;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glScissor(x, y, width, height);
-            return 0;
-        }
-    } caller;
-    caller.x = x;
-    caller.y = y;
-    caller.width = width;
-    caller.height = height;
-
-    msg.set_arg0(x);
-    msg.set_arg1(y);
-    msg.set_arg2(width);
-    msg.set_arg3(height);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glScissor);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLsizei n;
-        const GLuint* shaders;
-        GLenum binaryformat;
-        const GLvoid* binary;
-        GLsizei length;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glShaderBinary(n, shaders, binaryformat, binary, length);
-            return 0;
-        }
-    } caller;
-    caller.n = n;
-    caller.shaders = shaders;
-    caller.binaryformat = binaryformat;
-    caller.binary = binary;
-    caller.length = length;
-
-    msg.set_arg0(n);
-    msg.set_arg1(ToInt(shaders));
-    msg.set_arg2(binaryformat);
-    msg.set_arg3(ToInt(binary));
-    msg.set_arg4(length);
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glShaderBinary);
-}
-
-void Debug_glShaderSource(GLuint shader, GLsizei count, const GLchar** string, const GLint* length)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint shader;
-        GLsizei count;
-        const GLchar** string;
-        const GLint* length;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glShaderSource(shader, count, string, length);
-#ifdef EXTEND_AFTER_CALL_Debug_glShaderSource
-            EXTEND_AFTER_CALL_Debug_glShaderSource;
-#endif
-            return 0;
-        }
-    } caller;
-    caller.shader = shader;
-    caller.count = count;
-    caller.string = string;
-    caller.length = length;
-
-    msg.set_arg0(shader);
-    msg.set_arg1(count);
-    msg.set_arg2(ToInt(string));
-    msg.set_arg3(ToInt(length));
-
-    // FIXME: check for pointer usage
-#ifdef EXTEND_Debug_glShaderSource
-    EXTEND_Debug_glShaderSource;
-#endif
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glShaderSource);
-}
-
-void Debug_glStencilFunc(GLenum func, GLint ref, GLuint mask)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum func;
-        GLint ref;
-        GLuint mask;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glStencilFunc(func, ref, mask);
-            return 0;
-        }
-    } caller;
-    caller.func = func;
-    caller.ref = ref;
-    caller.mask = mask;
-
-    msg.set_arg0(func);
-    msg.set_arg1(ref);
-    msg.set_arg2(mask);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glStencilFunc);
-}
-
-void Debug_glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum face;
-        GLenum func;
-        GLint ref;
-        GLuint mask;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glStencilFuncSeparate(face, func, ref, mask);
-            return 0;
-        }
-    } caller;
-    caller.face = face;
-    caller.func = func;
-    caller.ref = ref;
-    caller.mask = mask;
-
-    msg.set_arg0(face);
-    msg.set_arg1(func);
-    msg.set_arg2(ref);
-    msg.set_arg3(mask);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glStencilFuncSeparate);
-}
-
-void Debug_glStencilMask(GLuint mask)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint mask;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glStencilMask(mask);
-            return 0;
-        }
-    } caller;
-    caller.mask = mask;
-
-    msg.set_arg0(mask);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glStencilMask);
-}
-
-void Debug_glStencilMaskSeparate(GLenum face, GLuint mask)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum face;
-        GLuint mask;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glStencilMaskSeparate(face, mask);
-            return 0;
-        }
-    } caller;
-    caller.face = face;
-    caller.mask = mask;
-
-    msg.set_arg0(face);
-    msg.set_arg1(mask);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glStencilMaskSeparate);
-}
-
-void Debug_glStencilOp(GLenum fail, GLenum zfail, GLenum zpass)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum fail;
-        GLenum zfail;
-        GLenum zpass;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glStencilOp(fail, zfail, zpass);
-            return 0;
-        }
-    } caller;
-    caller.fail = fail;
-    caller.zfail = zfail;
-    caller.zpass = zpass;
-
-    msg.set_arg0(fail);
-    msg.set_arg1(zfail);
-    msg.set_arg2(zpass);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glStencilOp);
-}
-
-void Debug_glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum face;
-        GLenum fail;
-        GLenum zfail;
-        GLenum zpass;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glStencilOpSeparate(face, fail, zfail, zpass);
-            return 0;
-        }
-    } caller;
-    caller.face = face;
-    caller.fail = fail;
-    caller.zfail = zfail;
-    caller.zpass = zpass;
-
-    msg.set_arg0(face);
-    msg.set_arg1(fail);
-    msg.set_arg2(zfail);
-    msg.set_arg3(zpass);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glStencilOpSeparate);
-}
-
-void Debug_glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLint level;
-        GLint internalformat;
-        GLsizei width;
-        GLsizei height;
-        GLint border;
-        GLenum format;
-        GLenum type;
-        const GLvoid* pixels;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
-#ifdef EXTEND_AFTER_CALL_Debug_glTexImage2D
-            EXTEND_AFTER_CALL_Debug_glTexImage2D;
-#endif
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.level = level;
-    caller.internalformat = internalformat;
-    caller.width = width;
-    caller.height = height;
-    caller.border = border;
-    caller.format = format;
-    caller.type = type;
-    caller.pixels = pixels;
-
-    msg.set_arg0(target);
-    msg.set_arg1(level);
-    msg.set_arg2(internalformat);
-    msg.set_arg3(width);
-    msg.set_arg4(height);
-    msg.set_arg5(border);
-    msg.set_arg6(format);
-    msg.set_arg7(type);
-    msg.set_arg8(ToInt(pixels));
-
-    // FIXME: check for pointer usage
-#ifdef EXTEND_Debug_glTexImage2D
-    EXTEND_Debug_glTexImage2D;
-#endif
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glTexImage2D);
-}
-
-void Debug_glTexParameterf(GLenum target, GLenum pname, GLfloat param)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum pname;
-        GLfloat param;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glTexParameterf(target, pname, param);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.pname = pname;
-    caller.param = param;
-
-    msg.set_arg0(target);
-    msg.set_arg1(pname);
-    msg.set_arg2(ToInt(param));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glTexParameterf);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum pname;
-        const GLfloat* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glTexParameterfv(target, pname, params);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(target);
-    msg.set_arg1(pname);
-    msg.set_arg2(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glTexParameterfv);
-}
-
-void Debug_glTexParameteri(GLenum target, GLenum pname, GLint param)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum pname;
-        GLint param;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glTexParameteri(target, pname, param);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.pname = pname;
-    caller.param = param;
-
-    msg.set_arg0(target);
-    msg.set_arg1(pname);
-    msg.set_arg2(param);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glTexParameteri);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glTexParameteriv(GLenum target, GLenum pname, const GLint* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum pname;
-        const GLint* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glTexParameteriv(target, pname, params);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(target);
-    msg.set_arg1(pname);
-    msg.set_arg2(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glTexParameteriv);
-}
-
-void Debug_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLint level;
-        GLint xoffset;
-        GLint yoffset;
-        GLsizei width;
-        GLsizei height;
-        GLenum format;
-        GLenum type;
-        const GLvoid* pixels;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
-#ifdef EXTEND_AFTER_CALL_Debug_glTexSubImage2D
-            EXTEND_AFTER_CALL_Debug_glTexSubImage2D;
-#endif
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.level = level;
-    caller.xoffset = xoffset;
-    caller.yoffset = yoffset;
-    caller.width = width;
-    caller.height = height;
-    caller.format = format;
-    caller.type = type;
-    caller.pixels = pixels;
-
-    msg.set_arg0(target);
-    msg.set_arg1(level);
-    msg.set_arg2(xoffset);
-    msg.set_arg3(yoffset);
-    msg.set_arg4(width);
-    msg.set_arg5(height);
-    msg.set_arg6(format);
-    msg.set_arg7(type);
-    msg.set_arg8(ToInt(pixels));
-
-    // FIXME: check for pointer usage
-#ifdef EXTEND_Debug_glTexSubImage2D
-    EXTEND_Debug_glTexSubImage2D;
-#endif
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glTexSubImage2D);
-}
-
-void Debug_glUniform1f(GLint location, GLfloat x)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLfloat x;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform1f(location, x);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.x = x;
-
-    msg.set_arg0(location);
-    msg.set_arg1(ToInt(x));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform1f);
-}
-
-void Debug_glUniform1fv(GLint location, GLsizei count, const GLfloat* v)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLsizei count;
-        const GLfloat* v;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform1fv(location, count, v);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.count = count;
-    caller.v = v;
-
-    msg.set_arg0(location);
-    msg.set_arg1(count);
-    msg.set_arg2(ToInt(v));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(v), 1*count * sizeof(GLfloat));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform1fv);
-}
-
-void Debug_glUniform1i(GLint location, GLint x)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLint x;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform1i(location, x);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.x = x;
-
-    msg.set_arg0(location);
-    msg.set_arg1(x);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform1i);
-}
-
-void Debug_glUniform1iv(GLint location, GLsizei count, const GLint* v)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLsizei count;
-        const GLint* v;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform1iv(location, count, v);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.count = count;
-    caller.v = v;
-
-    msg.set_arg0(location);
-    msg.set_arg1(count);
-    msg.set_arg2(ToInt(v));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(v), 1*count * sizeof(GLint));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform1iv);
-}
-
-void Debug_glUniform2f(GLint location, GLfloat x, GLfloat y)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLfloat x;
-        GLfloat y;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform2f(location, x, y);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.x = x;
-    caller.y = y;
-
-    msg.set_arg0(location);
-    msg.set_arg1(ToInt(x));
-    msg.set_arg2(ToInt(y));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform2f);
-}
-
-void Debug_glUniform2fv(GLint location, GLsizei count, const GLfloat* v)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLsizei count;
-        const GLfloat* v;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform2fv(location, count, v);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.count = count;
-    caller.v = v;
-
-    msg.set_arg0(location);
-    msg.set_arg1(count);
-    msg.set_arg2(ToInt(v));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(v), 2*count * sizeof(GLfloat));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform2fv);
-}
-
-void Debug_glUniform2i(GLint location, GLint x, GLint y)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLint x;
-        GLint y;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform2i(location, x, y);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.x = x;
-    caller.y = y;
-
-    msg.set_arg0(location);
-    msg.set_arg1(x);
-    msg.set_arg2(y);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform2i);
-}
-
-void Debug_glUniform2iv(GLint location, GLsizei count, const GLint* v)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLsizei count;
-        const GLint* v;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform2iv(location, count, v);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.count = count;
-    caller.v = v;
-
-    msg.set_arg0(location);
-    msg.set_arg1(count);
-    msg.set_arg2(ToInt(v));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(v), 2*count * sizeof(GLint));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform2iv);
-}
-
-void Debug_glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLfloat x;
-        GLfloat y;
-        GLfloat z;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform3f(location, x, y, z);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.x = x;
-    caller.y = y;
-    caller.z = z;
-
-    msg.set_arg0(location);
-    msg.set_arg1(ToInt(x));
-    msg.set_arg2(ToInt(y));
-    msg.set_arg3(ToInt(z));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform3f);
-}
-
-void Debug_glUniform3fv(GLint location, GLsizei count, const GLfloat* v)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLsizei count;
-        const GLfloat* v;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform3fv(location, count, v);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.count = count;
-    caller.v = v;
-
-    msg.set_arg0(location);
-    msg.set_arg1(count);
-    msg.set_arg2(ToInt(v));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(v), 3*count * sizeof(GLfloat));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform3fv);
-}
-
-void Debug_glUniform3i(GLint location, GLint x, GLint y, GLint z)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLint x;
-        GLint y;
-        GLint z;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform3i(location, x, y, z);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.x = x;
-    caller.y = y;
-    caller.z = z;
-
-    msg.set_arg0(location);
-    msg.set_arg1(x);
-    msg.set_arg2(y);
-    msg.set_arg3(z);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform3i);
-}
-
-void Debug_glUniform3iv(GLint location, GLsizei count, const GLint* v)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLsizei count;
-        const GLint* v;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform3iv(location, count, v);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.count = count;
-    caller.v = v;
-
-    msg.set_arg0(location);
-    msg.set_arg1(count);
-    msg.set_arg2(ToInt(v));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(v), 3*count * sizeof(GLint));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform3iv);
-}
-
-void Debug_glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLfloat x;
-        GLfloat y;
-        GLfloat z;
-        GLfloat w;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform4f(location, x, y, z, w);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.x = x;
-    caller.y = y;
-    caller.z = z;
-    caller.w = w;
-
-    msg.set_arg0(location);
-    msg.set_arg1(ToInt(x));
-    msg.set_arg2(ToInt(y));
-    msg.set_arg3(ToInt(z));
-    msg.set_arg4(ToInt(w));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform4f);
-}
-
-void Debug_glUniform4fv(GLint location, GLsizei count, const GLfloat* v)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLsizei count;
-        const GLfloat* v;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform4fv(location, count, v);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.count = count;
-    caller.v = v;
-
-    msg.set_arg0(location);
-    msg.set_arg1(count);
-    msg.set_arg2(ToInt(v));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(v), 4*count * sizeof(GLfloat));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform4fv);
-}
-
-void Debug_glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLint x;
-        GLint y;
-        GLint z;
-        GLint w;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform4i(location, x, y, z, w);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.x = x;
-    caller.y = y;
-    caller.z = z;
-    caller.w = w;
-
-    msg.set_arg0(location);
-    msg.set_arg1(x);
-    msg.set_arg2(y);
-    msg.set_arg3(z);
-    msg.set_arg4(w);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform4i);
-}
-
-void Debug_glUniform4iv(GLint location, GLsizei count, const GLint* v)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLsizei count;
-        const GLint* v;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform4iv(location, count, v);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.count = count;
-    caller.v = v;
-
-    msg.set_arg0(location);
-    msg.set_arg1(count);
-    msg.set_arg2(ToInt(v));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(v), 4*count * sizeof(GLint));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform4iv);
-}
-
-void Debug_glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLsizei count;
-        GLboolean transpose;
-        const GLfloat* value;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniformMatrix2fv(location, count, transpose, value);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.count = count;
-    caller.transpose = transpose;
-    caller.value = value;
-
-    msg.set_arg0(location);
-    msg.set_arg1(count);
-    msg.set_arg2(transpose);
-    msg.set_arg3(ToInt(value));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(value), 4*count * sizeof(GLfloat));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniformMatrix2fv);
-}
-
-void Debug_glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLsizei count;
-        GLboolean transpose;
-        const GLfloat* value;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniformMatrix3fv(location, count, transpose, value);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.count = count;
-    caller.transpose = transpose;
-    caller.value = value;
-
-    msg.set_arg0(location);
-    msg.set_arg1(count);
-    msg.set_arg2(transpose);
-    msg.set_arg3(ToInt(value));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(value), 9*count * sizeof(GLfloat));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniformMatrix3fv);
-}
-
-void Debug_glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLsizei count;
-        GLboolean transpose;
-        const GLfloat* value;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniformMatrix4fv(location, count, transpose, value);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.count = count;
-    caller.transpose = transpose;
-    caller.value = value;
-
-    msg.set_arg0(location);
-    msg.set_arg1(count);
-    msg.set_arg2(transpose);
-    msg.set_arg3(ToInt(value));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(value), 16*count * sizeof(GLfloat));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniformMatrix4fv);
-}
-
-void Debug_glUseProgram(GLuint program)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUseProgram(program);
-            getDbgContextThreadSpecific()->glUseProgram(program);
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-
-    msg.set_arg0(program);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUseProgram);
-}
-
-void Debug_glValidateProgram(GLuint program)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glValidateProgram(program);
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-
-    msg.set_arg0(program);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glValidateProgram);
-}
-
-void Debug_glVertexAttrib1f(GLuint indx, GLfloat x)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint indx;
-        GLfloat x;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glVertexAttrib1f(indx, x);
-            return 0;
-        }
-    } caller;
-    caller.indx = indx;
-    caller.x = x;
-
-    msg.set_arg0(indx);
-    msg.set_arg1(ToInt(x));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttrib1f);
-}
-
-void Debug_glVertexAttrib1fv(GLuint indx, const GLfloat* values)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint indx;
-        const GLfloat* values;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glVertexAttrib1fv(indx, values);
-            return 0;
-        }
-    } caller;
-    caller.indx = indx;
-    caller.values = values;
-
-    msg.set_arg0(indx);
-    msg.set_arg1(ToInt(values));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(values), 1 * sizeof(GLfloat));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttrib1fv);
-}
-
-void Debug_glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint indx;
-        GLfloat x;
-        GLfloat y;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glVertexAttrib2f(indx, x, y);
-            return 0;
-        }
-    } caller;
-    caller.indx = indx;
-    caller.x = x;
-    caller.y = y;
-
-    msg.set_arg0(indx);
-    msg.set_arg1(ToInt(x));
-    msg.set_arg2(ToInt(y));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttrib2f);
-}
-
-void Debug_glVertexAttrib2fv(GLuint indx, const GLfloat* values)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint indx;
-        const GLfloat* values;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glVertexAttrib2fv(indx, values);
-            return 0;
-        }
-    } caller;
-    caller.indx = indx;
-    caller.values = values;
-
-    msg.set_arg0(indx);
-    msg.set_arg1(ToInt(values));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(values), 2 * sizeof(GLfloat));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttrib2fv);
-}
-
-void Debug_glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint indx;
-        GLfloat x;
-        GLfloat y;
-        GLfloat z;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glVertexAttrib3f(indx, x, y, z);
-            return 0;
-        }
-    } caller;
-    caller.indx = indx;
-    caller.x = x;
-    caller.y = y;
-    caller.z = z;
-
-    msg.set_arg0(indx);
-    msg.set_arg1(ToInt(x));
-    msg.set_arg2(ToInt(y));
-    msg.set_arg3(ToInt(z));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttrib3f);
-}
-
-void Debug_glVertexAttrib3fv(GLuint indx, const GLfloat* values)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint indx;
-        const GLfloat* values;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glVertexAttrib3fv(indx, values);
-            return 0;
-        }
-    } caller;
-    caller.indx = indx;
-    caller.values = values;
-
-    msg.set_arg0(indx);
-    msg.set_arg1(ToInt(values));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(values), 3 * sizeof(GLfloat));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttrib3fv);
-}
-
-void Debug_glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint indx;
-        GLfloat x;
-        GLfloat y;
-        GLfloat z;
-        GLfloat w;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glVertexAttrib4f(indx, x, y, z, w);
-            return 0;
-        }
-    } caller;
-    caller.indx = indx;
-    caller.x = x;
-    caller.y = y;
-    caller.z = z;
-    caller.w = w;
-
-    msg.set_arg0(indx);
-    msg.set_arg1(ToInt(x));
-    msg.set_arg2(ToInt(y));
-    msg.set_arg3(ToInt(z));
-    msg.set_arg4(ToInt(w));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttrib4f);
-}
-
-void Debug_glVertexAttrib4fv(GLuint indx, const GLfloat* values)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint indx;
-        const GLfloat* values;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glVertexAttrib4fv(indx, values);
-            return 0;
-        }
-    } caller;
-    caller.indx = indx;
-    caller.values = values;
-
-    msg.set_arg0(indx);
-    msg.set_arg1(ToInt(values));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(values), 4 * sizeof(GLfloat));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttrib4fv);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint indx;
-        GLint size;
-        GLenum type;
-        GLboolean normalized;
-        GLsizei stride;
-        const GLvoid* ptr;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glVertexAttribPointer(indx, size, type, normalized, stride, ptr);
-            getDbgContextThreadSpecific()->glVertexAttribPointer(indx, size, type, normalized, stride, ptr);
-            return 0;
-        }
-    } caller;
-    caller.indx = indx;
-    caller.size = size;
-    caller.type = type;
-    caller.normalized = normalized;
-    caller.stride = stride;
-    caller.ptr = ptr;
-
-    msg.set_arg0(indx);
-    msg.set_arg1(size);
-    msg.set_arg2(type);
-    msg.set_arg3(normalized);
-    msg.set_arg4(stride);
-    msg.set_arg5(ToInt(ptr));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttribPointer);
-}
-
-void Debug_glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint x;
-        GLint y;
-        GLsizei width;
-        GLsizei height;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glViewport(x, y, width, height);
-            return 0;
-        }
-    } caller;
-    caller.x = x;
-    caller.y = y;
-    caller.width = width;
-    caller.height = height;
-
-    msg.set_arg0(x);
-    msg.set_arg1(y);
-    msg.set_arg2(width);
-    msg.set_arg3(height);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glViewport);
-}
-
-// FIXME: the following functions should be written by hand
-void Debug_glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
-void Debug_glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
-void Debug_glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
-void Debug_glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
-void Debug_glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
-void Debug_glGetBooleanv(GLenum pname, GLboolean* params);
-void Debug_glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params);
-void Debug_glGetFloatv(GLenum pname, GLfloat* params);
-void Debug_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params);
-void Debug_glGetIntegerv(GLenum pname, GLint* params);
-void Debug_glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);
-void Debug_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params);
-void Debug_glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog);
-void Debug_glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
-void Debug_glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
-const GLubyte* Debug_glGetString(GLenum name);
-void Debug_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params);
-void Debug_glGetTexParameteriv(GLenum target, GLenum pname, GLint* params);
-void Debug_glGetUniformfv(GLuint program, GLint location, GLfloat* params);
-void Debug_glGetUniformiv(GLuint program, GLint location, GLint* params);
-void Debug_glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params);
-void Debug_glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params);
-void Debug_glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** pointer);
-void Debug_glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
-void Debug_glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params);
-void Debug_glTexParameteriv(GLenum target, GLenum pname, const GLint* params);
-void Debug_glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);
diff --git a/opengl/libs/GLES2_dbg/src/api.h b/opengl/libs/GLES2_dbg/src/api.h
deleted file mode 100644
index 0b227bc..0000000
--- a/opengl/libs/GLES2_dbg/src/api.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- ** Copyright 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.
- */
-
-#define EXTEND_Debug_glCopyTexImage2D \
-    DbgContext * const dbg = getDbgContextThreadSpecific(); \
-    void * readData = dbg->GetReadPixelsBuffer(4 * width * height); \
-    /* pick easy format for client to convert */ \
-    dbg->hooks->gl.glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, readData); \
-    dbg->CompressReadPixelBuffer(msg.mutable_data()); \
-    msg.set_data_type(msg.ReferencedImage); \
-    msg.set_pixel_format(GL_RGBA); \
-    msg.set_pixel_type(GL_UNSIGNED_BYTE);
-
-#define EXTEND_Debug_glCopyTexSubImage2D EXTEND_Debug_glCopyTexImage2D
-
-#define EXTEND_AFTER_CALL_Debug_glReadPixels \
-    { \
-        DbgContext * const dbg = getDbgContextThreadSpecific(); \
-        if (dbg->IsReadPixelBuffer(pixels)) { \
-            dbg->CompressReadPixelBuffer(msg.mutable_data()); \
-            msg.set_data_type(msg.ReferencedImage); \
-        } else { \
-            const unsigned int size = width * height * GetBytesPerPixel(format, type); \
-            dbg->Compress(pixels, size, msg.mutable_data()); \
-            msg.set_data_type(msg.NonreferencedImage); \
-        } \
-    }
-
-#define EXTEND_Debug_glShaderSource \
-    std::string * const data = msg.mutable_data(); \
-    for (unsigned i = 0; i < count; i++) \
-        if (!length || length[i] < 0) \
-            data->append(string[i]); \
-        else \
-            data->append(string[i], length[i]);
-
-#define EXTEND_Debug_glTexImage2D \
-    if (pixels) { \
-        DbgContext * const dbg = getDbgContextThreadSpecific(); \
-        const unsigned size = GetBytesPerPixel(format, type) * width * height; \
-        assert(0 < size); \
-        dbg->Compress(pixels, size, msg.mutable_data()); \
-    }
-
-#define EXTEND_Debug_glTexSubImage2D EXTEND_Debug_glTexImage2D
diff --git a/opengl/libs/GLES2_dbg/src/caller.cpp b/opengl/libs/GLES2_dbg/src/caller.cpp
deleted file mode 100644
index 70d23d6..0000000
--- a/opengl/libs/GLES2_dbg/src/caller.cpp
+++ /dev/null
@@ -1,778 +0,0 @@
-/*
- ** Copyright 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.
- */
-
-// auto generated by generate_caller_cpp.py
-// implement declarations in caller.h
-
-#include "header.h"
-
-namespace android {
-
-static const int * GenerateCall_glCompressedTexImage2D(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glCompressedTexSubImage2D(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glDrawElements(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGenBuffers(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGenFramebuffers(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGenRenderbuffers(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGenTextures(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetActiveAttrib(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetActiveUniform(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetAttachedShaders(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetBooleanv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetBufferParameteriv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetFloatv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetFramebufferAttachmentParameteriv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetIntegerv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetProgramiv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetProgramInfoLog(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetRenderbufferParameteriv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetShaderiv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetShaderInfoLog(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetShaderPrecisionFormat(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetShaderSource(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetString(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetTexParameterfv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetTexParameteriv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetUniformfv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetUniformiv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetVertexAttribfv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetVertexAttribiv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetVertexAttribPointerv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glReadPixels(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glShaderBinary(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glShaderSource(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glTexImage2D(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glTexParameterfv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glTexParameteriv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glTexSubImage2D(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glVertexAttribPointer(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-
-#include "caller.h"
-
-const int * GenerateCall(DbgContext * const dbg, const glesv2debugger::Message & cmd,
-                  glesv2debugger::Message & msg, const int * const prevRet)
-{
-    ALOGD("GenerateCall function=%u", cmd.function());
-    const int * ret = prevRet; // only some functions have return value
-    nsecs_t c0 = systemTime(timeMode);
-    switch (cmd.function()) {    case glesv2debugger::Message_Function_glActiveTexture:
-        dbg->hooks->gl.glActiveTexture(
-            static_cast<GLenum>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glAttachShader:
-        dbg->hooks->gl.glAttachShader(
-            static_cast<GLuint>(cmd.arg0()), static_cast<GLuint>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glBindAttribLocation:
-        dbg->hooks->gl.glBindAttribLocation(
-            static_cast<GLuint>(cmd.arg0()), static_cast<GLuint>(cmd.arg1()), 
-            reinterpret_cast<GLchar*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glBindBuffer:
-        dbg->hooks->gl.glBindBuffer(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLuint>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glBindFramebuffer:
-        dbg->hooks->gl.glBindFramebuffer(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLuint>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glBindRenderbuffer:
-        dbg->hooks->gl.glBindRenderbuffer(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLuint>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glBindTexture:
-        dbg->hooks->gl.glBindTexture(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLuint>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glBlendColor:
-        dbg->hooks->gl.glBlendColor(
-            static_cast<GLclampf>(cmd.arg0()), static_cast<GLclampf>(cmd.arg1()), 
-            static_cast<GLclampf>(cmd.arg2()), static_cast<GLclampf>(cmd.arg3())
-            );
-        break;
-    case glesv2debugger::Message_Function_glBlendEquation:
-        dbg->hooks->gl.glBlendEquation(
-            static_cast<GLenum>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glBlendEquationSeparate:
-        dbg->hooks->gl.glBlendEquationSeparate(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glBlendFunc:
-        dbg->hooks->gl.glBlendFunc(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glBlendFuncSeparate:
-        dbg->hooks->gl.glBlendFuncSeparate(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()), 
-            static_cast<GLenum>(cmd.arg2()), static_cast<GLenum>(cmd.arg3())
-            );
-        break;
-    case glesv2debugger::Message_Function_glBufferData:
-        dbg->hooks->gl.glBufferData(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLsizeiptr>(cmd.arg1()), 
-            reinterpret_cast<GLvoid*>(const_cast<char *>(cmd.data().data())), 
-            static_cast<GLenum>(cmd.arg3()));
-        break;
-    case glesv2debugger::Message_Function_glBufferSubData:
-        dbg->hooks->gl.glBufferSubData(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLintptr>(cmd.arg1()), 
-            static_cast<GLsizeiptr>(cmd.arg2()), reinterpret_cast<GLvoid*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glCheckFramebufferStatus:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glCheckFramebufferStatus(
-            static_cast<GLenum>(cmd.arg0()))));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glClear:
-        dbg->hooks->gl.glClear(
-            static_cast<GLbitfield>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glClearColor:
-        dbg->hooks->gl.glClearColor(
-            static_cast<GLclampf>(cmd.arg0()), static_cast<GLclampf>(cmd.arg1()), 
-            static_cast<GLclampf>(cmd.arg2()), static_cast<GLclampf>(cmd.arg3())
-            );
-        break;
-    case glesv2debugger::Message_Function_glClearDepthf:
-        dbg->hooks->gl.glClearDepthf(
-            static_cast<GLclampf>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glClearStencil:
-        dbg->hooks->gl.glClearStencil(
-            static_cast<GLint>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glColorMask:
-        dbg->hooks->gl.glColorMask(
-            GLboolean(cmd.arg0()), GLboolean(cmd.arg1()), GLboolean(cmd.arg2()), 
-            GLboolean(cmd.arg3()));
-        break;
-    case glesv2debugger::Message_Function_glCompileShader:
-        dbg->hooks->gl.glCompileShader(
-            static_cast<GLuint>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glCompressedTexImage2D:
-        ret = GenerateCall_glCompressedTexImage2D(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glCompressedTexSubImage2D:
-        ret = GenerateCall_glCompressedTexSubImage2D(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glCopyTexImage2D:
-        dbg->hooks->gl.glCopyTexImage2D(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLint>(cmd.arg1()), 
-            static_cast<GLenum>(cmd.arg2()), static_cast<GLint>(cmd.arg3()), 
-            static_cast<GLint>(cmd.arg4()), static_cast<GLsizei>(cmd.arg5()), 
-            static_cast<GLsizei>(cmd.arg6()), static_cast<GLint>(cmd.arg7())
-            );
-        break;
-    case glesv2debugger::Message_Function_glCopyTexSubImage2D:
-        dbg->hooks->gl.glCopyTexSubImage2D(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLint>(cmd.arg1()), 
-            static_cast<GLint>(cmd.arg2()), static_cast<GLint>(cmd.arg3()), 
-            static_cast<GLint>(cmd.arg4()), static_cast<GLint>(cmd.arg5()), 
-            static_cast<GLsizei>(cmd.arg6()), static_cast<GLsizei>(cmd.arg7())
-            );
-        break;
-    case glesv2debugger::Message_Function_glCreateProgram:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glCreateProgram(
-            )));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glCreateShader:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glCreateShader(
-            static_cast<GLenum>(cmd.arg0()))));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glCullFace:
-        dbg->hooks->gl.glCullFace(
-            static_cast<GLenum>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glDeleteBuffers:
-        dbg->hooks->gl.glDeleteBuffers(
-            static_cast<GLsizei>(cmd.arg0()), reinterpret_cast<GLuint*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glDeleteFramebuffers:
-        dbg->hooks->gl.glDeleteFramebuffers(
-            static_cast<GLsizei>(cmd.arg0()), reinterpret_cast<GLuint*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glDeleteProgram:
-        dbg->hooks->gl.glDeleteProgram(
-            static_cast<GLuint>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glDeleteRenderbuffers:
-        dbg->hooks->gl.glDeleteRenderbuffers(
-            static_cast<GLsizei>(cmd.arg0()), reinterpret_cast<GLuint*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glDeleteShader:
-        dbg->hooks->gl.glDeleteShader(
-            static_cast<GLuint>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glDeleteTextures:
-        dbg->hooks->gl.glDeleteTextures(
-            static_cast<GLsizei>(cmd.arg0()), reinterpret_cast<GLuint*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glDepthFunc:
-        dbg->hooks->gl.glDepthFunc(
-            static_cast<GLenum>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glDepthMask:
-        dbg->hooks->gl.glDepthMask(
-            GLboolean(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glDepthRangef:
-        dbg->hooks->gl.glDepthRangef(
-            static_cast<GLclampf>(cmd.arg0()), static_cast<GLclampf>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glDetachShader:
-        dbg->hooks->gl.glDetachShader(
-            static_cast<GLuint>(cmd.arg0()), static_cast<GLuint>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glDisable:
-        dbg->hooks->gl.glDisable(
-            static_cast<GLenum>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glDisableVertexAttribArray:
-        dbg->hooks->gl.glDisableVertexAttribArray(
-            static_cast<GLuint>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glDrawArrays:
-        dbg->hooks->gl.glDrawArrays(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLint>(cmd.arg1()), 
-            static_cast<GLsizei>(cmd.arg2()));
-        break;
-    case glesv2debugger::Message_Function_glDrawElements:
-        ret = GenerateCall_glDrawElements(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glEnable:
-        dbg->hooks->gl.glEnable(
-            static_cast<GLenum>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glEnableVertexAttribArray:
-        dbg->hooks->gl.glEnableVertexAttribArray(
-            static_cast<GLuint>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glFinish:
-        dbg->hooks->gl.glFinish(
-            );
-        break;
-    case glesv2debugger::Message_Function_glFlush:
-        dbg->hooks->gl.glFlush(
-            );
-        break;
-    case glesv2debugger::Message_Function_glFramebufferRenderbuffer:
-        dbg->hooks->gl.glFramebufferRenderbuffer(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()), 
-            static_cast<GLenum>(cmd.arg2()), static_cast<GLuint>(cmd.arg3())
-            );
-        break;
-    case glesv2debugger::Message_Function_glFramebufferTexture2D:
-        dbg->hooks->gl.glFramebufferTexture2D(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()), 
-            static_cast<GLenum>(cmd.arg2()), static_cast<GLuint>(cmd.arg3()), 
-            static_cast<GLint>(cmd.arg4()));
-        break;
-    case glesv2debugger::Message_Function_glFrontFace:
-        dbg->hooks->gl.glFrontFace(
-            static_cast<GLenum>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glGenBuffers:
-        ret = GenerateCall_glGenBuffers(dbg, cmd, msg, prevRet);
-        break; // annotated output pointers
-    case glesv2debugger::Message_Function_glGenerateMipmap:
-        dbg->hooks->gl.glGenerateMipmap(
-            static_cast<GLenum>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glGenFramebuffers:
-        ret = GenerateCall_glGenFramebuffers(dbg, cmd, msg, prevRet);
-        break; // annotated output pointers
-    case glesv2debugger::Message_Function_glGenRenderbuffers:
-        ret = GenerateCall_glGenRenderbuffers(dbg, cmd, msg, prevRet);
-        break; // annotated output pointers
-    case glesv2debugger::Message_Function_glGenTextures:
-        ret = GenerateCall_glGenTextures(dbg, cmd, msg, prevRet);
-        break; // annotated output pointers
-    case glesv2debugger::Message_Function_glGetActiveAttrib:
-        ret = GenerateCall_glGetActiveAttrib(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetActiveUniform:
-        ret = GenerateCall_glGetActiveUniform(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetAttachedShaders:
-        ret = GenerateCall_glGetAttachedShaders(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetAttribLocation:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glGetAttribLocation(
-            static_cast<GLuint>(cmd.arg0()), reinterpret_cast<GLchar*>(const_cast<char *>(cmd.data().data()))
-            )));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glGetBooleanv:
-        ret = GenerateCall_glGetBooleanv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetBufferParameteriv:
-        ret = GenerateCall_glGetBufferParameteriv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetError:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glGetError(
-            )));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glGetFloatv:
-        ret = GenerateCall_glGetFloatv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetFramebufferAttachmentParameteriv:
-        ret = GenerateCall_glGetFramebufferAttachmentParameteriv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetIntegerv:
-        ret = GenerateCall_glGetIntegerv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetProgramiv:
-        ret = GenerateCall_glGetProgramiv(dbg, cmd, msg, prevRet);
-        break; // annotated output pointers
-    case glesv2debugger::Message_Function_glGetProgramInfoLog:
-        ret = GenerateCall_glGetProgramInfoLog(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetRenderbufferParameteriv:
-        ret = GenerateCall_glGetRenderbufferParameteriv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetShaderiv:
-        ret = GenerateCall_glGetShaderiv(dbg, cmd, msg, prevRet);
-        break; // annotated output pointers
-    case glesv2debugger::Message_Function_glGetShaderInfoLog:
-        ret = GenerateCall_glGetShaderInfoLog(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetShaderPrecisionFormat:
-        ret = GenerateCall_glGetShaderPrecisionFormat(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetShaderSource:
-        ret = GenerateCall_glGetShaderSource(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetString:
-        ret = GenerateCall_glGetString(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetTexParameterfv:
-        ret = GenerateCall_glGetTexParameterfv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetTexParameteriv:
-        ret = GenerateCall_glGetTexParameteriv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetUniformfv:
-        ret = GenerateCall_glGetUniformfv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetUniformiv:
-        ret = GenerateCall_glGetUniformiv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetUniformLocation:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glGetUniformLocation(
-            static_cast<GLuint>(cmd.arg0()), reinterpret_cast<GLchar*>(const_cast<char *>(cmd.data().data()))
-            )));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glGetVertexAttribfv:
-        ret = GenerateCall_glGetVertexAttribfv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetVertexAttribiv:
-        ret = GenerateCall_glGetVertexAttribiv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetVertexAttribPointerv:
-        ret = GenerateCall_glGetVertexAttribPointerv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glHint:
-        dbg->hooks->gl.glHint(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glIsBuffer:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glIsBuffer(
-            static_cast<GLuint>(cmd.arg0()))));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glIsEnabled:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glIsEnabled(
-            static_cast<GLenum>(cmd.arg0()))));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glIsFramebuffer:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glIsFramebuffer(
-            static_cast<GLuint>(cmd.arg0()))));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glIsProgram:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glIsProgram(
-            static_cast<GLuint>(cmd.arg0()))));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glIsRenderbuffer:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glIsRenderbuffer(
-            static_cast<GLuint>(cmd.arg0()))));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glIsShader:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glIsShader(
-            static_cast<GLuint>(cmd.arg0()))));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glIsTexture:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glIsTexture(
-            static_cast<GLuint>(cmd.arg0()))));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glLineWidth:
-        dbg->hooks->gl.glLineWidth(
-            static_cast<GLfloat>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glLinkProgram:
-        dbg->hooks->gl.glLinkProgram(
-            static_cast<GLuint>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glPixelStorei:
-        dbg->hooks->gl.glPixelStorei(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLint>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glPolygonOffset:
-        dbg->hooks->gl.glPolygonOffset(
-            static_cast<GLfloat>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glReadPixels:
-        ret = GenerateCall_glReadPixels(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glReleaseShaderCompiler:
-        dbg->hooks->gl.glReleaseShaderCompiler(
-            );
-        break;
-    case glesv2debugger::Message_Function_glRenderbufferStorage:
-        dbg->hooks->gl.glRenderbufferStorage(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()), 
-            static_cast<GLsizei>(cmd.arg2()), static_cast<GLsizei>(cmd.arg3())
-            );
-        break;
-    case glesv2debugger::Message_Function_glSampleCoverage:
-        dbg->hooks->gl.glSampleCoverage(
-            static_cast<GLclampf>(cmd.arg0()), GLboolean(cmd.arg1()));
-        break;
-    case glesv2debugger::Message_Function_glScissor:
-        dbg->hooks->gl.glScissor(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLint>(cmd.arg1()), 
-            static_cast<GLsizei>(cmd.arg2()), static_cast<GLsizei>(cmd.arg3())
-            );
-        break;
-    case glesv2debugger::Message_Function_glShaderBinary:
-        ret = GenerateCall_glShaderBinary(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glShaderSource:
-        ret = GenerateCall_glShaderSource(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glStencilFunc:
-        dbg->hooks->gl.glStencilFunc(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLint>(cmd.arg1()), 
-            static_cast<GLuint>(cmd.arg2()));
-        break;
-    case glesv2debugger::Message_Function_glStencilFuncSeparate:
-        dbg->hooks->gl.glStencilFuncSeparate(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()), 
-            static_cast<GLint>(cmd.arg2()), static_cast<GLuint>(cmd.arg3())
-            );
-        break;
-    case glesv2debugger::Message_Function_glStencilMask:
-        dbg->hooks->gl.glStencilMask(
-            static_cast<GLuint>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glStencilMaskSeparate:
-        dbg->hooks->gl.glStencilMaskSeparate(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLuint>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glStencilOp:
-        dbg->hooks->gl.glStencilOp(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()), 
-            static_cast<GLenum>(cmd.arg2()));
-        break;
-    case glesv2debugger::Message_Function_glStencilOpSeparate:
-        dbg->hooks->gl.glStencilOpSeparate(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()), 
-            static_cast<GLenum>(cmd.arg2()), static_cast<GLenum>(cmd.arg3())
-            );
-        break;
-    case glesv2debugger::Message_Function_glTexImage2D:
-        ret = GenerateCall_glTexImage2D(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glTexParameterf:
-        dbg->hooks->gl.glTexParameterf(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()), 
-            static_cast<GLfloat>(cmd.arg2()));
-        break;
-    case glesv2debugger::Message_Function_glTexParameterfv:
-        ret = GenerateCall_glTexParameterfv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glTexParameteri:
-        dbg->hooks->gl.glTexParameteri(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()), 
-            static_cast<GLint>(cmd.arg2()));
-        break;
-    case glesv2debugger::Message_Function_glTexParameteriv:
-        ret = GenerateCall_glTexParameteriv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glTexSubImage2D:
-        ret = GenerateCall_glTexSubImage2D(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glUniform1f:
-        dbg->hooks->gl.glUniform1f(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniform1fv:
-        dbg->hooks->gl.glUniform1fv(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()), 
-            reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniform1i:
-        dbg->hooks->gl.glUniform1i(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLint>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniform1iv:
-        dbg->hooks->gl.glUniform1iv(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()), 
-            reinterpret_cast<GLint*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniform2f:
-        dbg->hooks->gl.glUniform2f(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1()), 
-            static_cast<GLfloat>(cmd.arg2()));
-        break;
-    case glesv2debugger::Message_Function_glUniform2fv:
-        dbg->hooks->gl.glUniform2fv(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()), 
-            reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniform2i:
-        dbg->hooks->gl.glUniform2i(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLint>(cmd.arg1()), 
-            static_cast<GLint>(cmd.arg2()));
-        break;
-    case glesv2debugger::Message_Function_glUniform2iv:
-        dbg->hooks->gl.glUniform2iv(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()), 
-            reinterpret_cast<GLint*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniform3f:
-        dbg->hooks->gl.glUniform3f(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1()), 
-            static_cast<GLfloat>(cmd.arg2()), static_cast<GLfloat>(cmd.arg3())
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniform3fv:
-        dbg->hooks->gl.glUniform3fv(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()), 
-            reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniform3i:
-        dbg->hooks->gl.glUniform3i(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLint>(cmd.arg1()), 
-            static_cast<GLint>(cmd.arg2()), static_cast<GLint>(cmd.arg3())
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniform3iv:
-        dbg->hooks->gl.glUniform3iv(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()), 
-            reinterpret_cast<GLint*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniform4f:
-        dbg->hooks->gl.glUniform4f(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1()), 
-            static_cast<GLfloat>(cmd.arg2()), static_cast<GLfloat>(cmd.arg3()), 
-            static_cast<GLfloat>(cmd.arg4()));
-        break;
-    case glesv2debugger::Message_Function_glUniform4fv:
-        dbg->hooks->gl.glUniform4fv(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()), 
-            reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniform4i:
-        dbg->hooks->gl.glUniform4i(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLint>(cmd.arg1()), 
-            static_cast<GLint>(cmd.arg2()), static_cast<GLint>(cmd.arg3()), 
-            static_cast<GLint>(cmd.arg4()));
-        break;
-    case glesv2debugger::Message_Function_glUniform4iv:
-        dbg->hooks->gl.glUniform4iv(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()), 
-            reinterpret_cast<GLint*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniformMatrix2fv:
-        dbg->hooks->gl.glUniformMatrix2fv(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()), 
-            GLboolean(cmd.arg2()), reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniformMatrix3fv:
-        dbg->hooks->gl.glUniformMatrix3fv(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()), 
-            GLboolean(cmd.arg2()), reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniformMatrix4fv:
-        dbg->hooks->gl.glUniformMatrix4fv(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()), 
-            GLboolean(cmd.arg2()), reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glUseProgram:
-        dbg->hooks->gl.glUseProgram(
-            static_cast<GLuint>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glValidateProgram:
-        dbg->hooks->gl.glValidateProgram(
-            static_cast<GLuint>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glVertexAttrib1f:
-        dbg->hooks->gl.glVertexAttrib1f(
-            static_cast<GLuint>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glVertexAttrib1fv:
-        dbg->hooks->gl.glVertexAttrib1fv(
-            static_cast<GLuint>(cmd.arg0()), reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glVertexAttrib2f:
-        dbg->hooks->gl.glVertexAttrib2f(
-            static_cast<GLuint>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1()), 
-            static_cast<GLfloat>(cmd.arg2()));
-        break;
-    case glesv2debugger::Message_Function_glVertexAttrib2fv:
-        dbg->hooks->gl.glVertexAttrib2fv(
-            static_cast<GLuint>(cmd.arg0()), reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glVertexAttrib3f:
-        dbg->hooks->gl.glVertexAttrib3f(
-            static_cast<GLuint>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1()), 
-            static_cast<GLfloat>(cmd.arg2()), static_cast<GLfloat>(cmd.arg3())
-            );
-        break;
-    case glesv2debugger::Message_Function_glVertexAttrib3fv:
-        dbg->hooks->gl.glVertexAttrib3fv(
-            static_cast<GLuint>(cmd.arg0()), reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glVertexAttrib4f:
-        dbg->hooks->gl.glVertexAttrib4f(
-            static_cast<GLuint>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1()), 
-            static_cast<GLfloat>(cmd.arg2()), static_cast<GLfloat>(cmd.arg3()), 
-            static_cast<GLfloat>(cmd.arg4()));
-        break;
-    case glesv2debugger::Message_Function_glVertexAttrib4fv:
-        dbg->hooks->gl.glVertexAttrib4fv(
-            static_cast<GLuint>(cmd.arg0()), reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glVertexAttribPointer:
-        ret = GenerateCall_glVertexAttribPointer(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glViewport:
-        dbg->hooks->gl.glViewport(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLint>(cmd.arg1()), 
-            static_cast<GLsizei>(cmd.arg2()), static_cast<GLsizei>(cmd.arg3())
-            );
-        break;
-    default:
-        assert(0);
-    }
-    msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-    msg.set_context_id(reinterpret_cast<int>(dbg));
-    msg.set_function(cmd.function());
-    msg.set_type(glesv2debugger::Message_Type_AfterGeneratedCall);
-    return ret;
-}
-
-}; // name space android {
diff --git a/opengl/libs/GLES2_dbg/src/caller.h b/opengl/libs/GLES2_dbg/src/caller.h
deleted file mode 100644
index e8111b3..0000000
--- a/opengl/libs/GLES2_dbg/src/caller.h
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- ** Copyright 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.
- */
-
-static const int * GenerateCall_glCompressedTexImage2D(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glCompressedTexSubImage2D(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glDrawElements(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGenBuffers(DbgContext * const dbg,
-                                       const glesv2debugger::Message & cmd,
-                                       glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGenFramebuffers(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGenRenderbuffers(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGenTextures(DbgContext * const dbg,
-                                        const glesv2debugger::Message & cmd,
-                                        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetActiveAttrib(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetActiveUniform(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetAttachedShaders(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetBooleanv(DbgContext * const dbg,
-                                        const glesv2debugger::Message & cmd,
-                                        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetBufferParameteriv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetFloatv(DbgContext * const dbg,
-                                      const glesv2debugger::Message & cmd,
-                                      glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetFramebufferAttachmentParameteriv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetIntegerv(DbgContext * const dbg,
-                                        const glesv2debugger::Message & cmd,
-                                        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetProgramiv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    GLint params = -1;
-    dbg->hooks->gl.glGetProgramiv(cmd.arg0(), cmd.arg1(), &params);
-    msg.mutable_data()->append(reinterpret_cast<char *>(&params), sizeof(params));
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetProgramInfoLog(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    const GLsizei bufSize = static_cast<GLsizei>(dbg->GetBufferSize());
-    GLsizei length = -1;
-    dbg->hooks->gl.glGetProgramInfoLog(cmd.arg0(), bufSize, &length, dbg->GetBuffer());
-    msg.mutable_data()->append(dbg->GetBuffer(), length);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetRenderbufferParameteriv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetShaderiv(DbgContext * const dbg,
-                                        const glesv2debugger::Message & cmd,
-                                        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    GLint params = -1;
-    dbg->hooks->gl.glGetShaderiv(cmd.arg0(), cmd.arg1(), &params);
-    msg.mutable_data()->append(reinterpret_cast<char *>(&params), sizeof(params));
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetShaderInfoLog(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    const GLsizei bufSize = static_cast<GLsizei>(dbg->GetBufferSize());
-    GLsizei length = -1;
-    dbg->hooks->gl.glGetShaderInfoLog(cmd.arg0(), bufSize, &length, dbg->GetBuffer());
-    msg.mutable_data()->append(dbg->GetBuffer(), length);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetShaderPrecisionFormat(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetShaderSource(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetString(DbgContext * const dbg,
-                                      const glesv2debugger::Message & cmd,
-                                      glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetTexParameterfv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetTexParameteriv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetUniformfv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetUniformiv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetVertexAttribfv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetVertexAttribiv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetVertexAttribPointerv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glReadPixels(DbgContext * const dbg,
-                                       const glesv2debugger::Message & cmd,
-                                       glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glShaderBinary(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glShaderSource(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    const char * string = cmd.data().data();
-    dbg->hooks->gl.glShaderSource(cmd.arg0(), 1, &string, NULL);
-    return prevRet;
-}
-
-static const int * GenerateCall_glTexImage2D(DbgContext * const dbg,
-                                       const glesv2debugger::Message & cmd,
-                                       glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glTexParameterfv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glTexParameteriv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glTexSubImage2D(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glVertexAttribPointer(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
diff --git a/opengl/libs/GLES2_dbg/src/dbgcontext.cpp b/opengl/libs/GLES2_dbg/src/dbgcontext.cpp
deleted file mode 100644
index 7bbaa18..0000000
--- a/opengl/libs/GLES2_dbg/src/dbgcontext.cpp
+++ /dev/null
@@ -1,427 +0,0 @@
-/*
- ** Copyright 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.
- */
-
-#include "header.h"
-
-extern "C" {
-#include "liblzf/lzf.h"
-}
-
-namespace android {
-
-static pthread_key_t dbgEGLThreadLocalStorageKey = -1;
-static pthread_mutex_t gThreadLocalStorageKeyMutex = PTHREAD_MUTEX_INITIALIZER;
-
-DbgContext * getDbgContextThreadSpecific() {
-    return (DbgContext*)pthread_getspecific(dbgEGLThreadLocalStorageKey);
-}
-
-DbgContext::DbgContext(const unsigned version, const gl_hooks_t * const hooks,
-                       const unsigned MAX_VERTEX_ATTRIBS)
-        : lzf_buf(NULL), lzf_readIndex(0), lzf_refSize(0), lzf_refBufSize(0)
-        , version(version), hooks(hooks)
-        , MAX_VERTEX_ATTRIBS(MAX_VERTEX_ATTRIBS)
-        , readBytesPerPixel(4)
-        , captureSwap(0), captureDraw(0)
-        , vertexAttribs(new VertexAttrib[MAX_VERTEX_ATTRIBS])
-        , hasNonVBOAttribs(false), indexBuffers(NULL), indexBuffer(NULL)
-        , program(0), maxAttrib(0)
-{
-    lzf_ref[0] = lzf_ref[1] = NULL;
-    for (unsigned i = 0; i < MAX_VERTEX_ATTRIBS; i++)
-        vertexAttribs[i] = VertexAttrib();
-    memset(&expectResponse, 0, sizeof(expectResponse));
-}
-
-DbgContext::~DbgContext()
-{
-    delete vertexAttribs;
-    free(lzf_buf);
-    free(lzf_ref[0]);
-    free(lzf_ref[1]);
-}
-
-DbgContext* CreateDbgContext(const unsigned version, const gl_hooks_t * const hooks)
-{
-    pthread_mutex_lock(&gThreadLocalStorageKeyMutex);
-    if (dbgEGLThreadLocalStorageKey == -1)
-        pthread_key_create(&dbgEGLThreadLocalStorageKey, NULL);
-    pthread_mutex_unlock(&gThreadLocalStorageKeyMutex);
-
-    assert(version < 2);
-    assert(GL_NO_ERROR == hooks->gl.glGetError());
-    GLint MAX_VERTEX_ATTRIBS = 0;
-    hooks->gl.glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &MAX_VERTEX_ATTRIBS);
-    DbgContext* dbg = new DbgContext(version, hooks, MAX_VERTEX_ATTRIBS);
-    glesv2debugger::Message msg, cmd;
-    msg.set_context_id(reinterpret_cast<int>(dbg));
-    msg.set_expect_response(false);
-    msg.set_type(msg.Response);
-    msg.set_function(msg.SETPROP);
-    msg.set_prop(msg.GLConstant);
-    msg.set_arg0(GL_MAX_VERTEX_ATTRIBS);
-    msg.set_arg1(MAX_VERTEX_ATTRIBS);
-    Send(msg, cmd);
-
-    GLint MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0;
-    hooks->gl.glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &MAX_COMBINED_TEXTURE_IMAGE_UNITS);
-    msg.set_arg0(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS);
-    msg.set_arg1(MAX_COMBINED_TEXTURE_IMAGE_UNITS);
-    Send(msg, cmd);
-
-    pthread_setspecific(dbgEGLThreadLocalStorageKey, dbg);
-    return dbg;
-}
-
-void dbgReleaseThread() {
-    delete getDbgContextThreadSpecific();
-}
-
-unsigned GetBytesPerPixel(const GLenum format, const GLenum type)
-{
-    switch (type) {
-    case GL_UNSIGNED_SHORT_5_6_5:
-    case GL_UNSIGNED_SHORT_4_4_4_4:
-    case GL_UNSIGNED_SHORT_5_5_5_1:
-        return 2;
-    case GL_UNSIGNED_BYTE:
-        break;
-    default:
-        ALOGE("GetBytesPerPixel: unknown type %x", type);
-    }
-
-    switch (format) {
-    case GL_ALPHA:
-    case GL_LUMINANCE:
-        return 1;
-    case GL_LUMINANCE_ALPHA:
-        return 2;
-    case GL_RGB:
-        return 3;
-    case GL_RGBA:
-    case 0x80E1:   // GL_BGRA_EXT
-        return 4;
-    default:
-        ALOGE("GetBytesPerPixel: unknown format %x", format);
-    }
-
-    return 1; // in doubt...
-}
-
-void DbgContext::Fetch(const unsigned index, std::string * const data) const
-{
-    // VBO data is already on client, just send user pointer data
-    for (unsigned i = 0; i < maxAttrib; i++) {
-        if (!vertexAttribs[i].enabled)
-            continue;
-        if (vertexAttribs[i].buffer > 0)
-            continue;
-        const char * ptr = (const char *)vertexAttribs[i].ptr;
-        ptr += index * vertexAttribs[i].stride;
-        data->append(ptr, vertexAttribs[i].elemSize);
-    }
-}
-
-void DbgContext::Compress(const void * in_data, unsigned int in_len,
-                          std::string * const outStr)
-{
-    if (!lzf_buf)
-        lzf_buf = (char *)malloc(LZF_CHUNK_SIZE);
-    assert(lzf_buf);
-    const uint32_t totalDecompSize = in_len;
-    outStr->append((const char *)&totalDecompSize, sizeof(totalDecompSize));
-    for (unsigned int i = 0; i < in_len; i += LZF_CHUNK_SIZE) {
-        uint32_t chunkSize = LZF_CHUNK_SIZE;
-        if (i + LZF_CHUNK_SIZE > in_len)
-            chunkSize = in_len - i;
-        const uint32_t compSize = lzf_compress((const char *)in_data + i, chunkSize,
-                                               lzf_buf, LZF_CHUNK_SIZE);
-        outStr->append((const char *)&chunkSize, sizeof(chunkSize));
-        outStr->append((const char *)&compSize, sizeof(compSize));
-        if (compSize > 0)
-            outStr->append(lzf_buf, compSize);
-        else // compressed chunk bigger than LZF_CHUNK_SIZE (and uncompressed)
-            outStr->append((const char *)in_data + i, chunkSize);
-    }
-}
-
-unsigned char * DbgContext::Decompress(const void * in, const unsigned int inLen,
-                                       unsigned int * const outLen)
-{
-    assert(inLen > 4 * 3);
-    if (inLen < 4 * 3)
-        return NULL;
-    *outLen = *(uint32_t *)in;
-    unsigned char * const out = (unsigned char *)malloc(*outLen);
-    unsigned int outPos = 0;
-    const unsigned char * const end = (const unsigned char *)in + inLen;
-    for (const unsigned char * inData = (const unsigned char *)in + 4; inData < end; ) {
-        const uint32_t chunkOut = *(uint32_t *)inData;
-        inData += 4;
-        const uint32_t chunkIn = *(uint32_t *)inData;
-        inData += 4;
-        if (chunkIn > 0) {
-            assert(inData + chunkIn <= end);
-            assert(outPos + chunkOut <= *outLen);
-            outPos += lzf_decompress(inData, chunkIn, out + outPos, chunkOut);
-            inData += chunkIn;
-        } else {
-            assert(inData + chunkOut <= end);
-            assert(outPos + chunkOut <= *outLen);
-            memcpy(out + outPos, inData, chunkOut);
-            inData += chunkOut;
-            outPos += chunkOut;
-        }
-    }
-    return out;
-}
-
-void * DbgContext::GetReadPixelsBuffer(const unsigned size)
-{
-    if (lzf_refBufSize < size + 8) {
-        lzf_refBufSize = size + 8;
-        lzf_ref[0] = (unsigned *)realloc(lzf_ref[0], lzf_refBufSize);
-        assert(lzf_ref[0]);
-        memset(lzf_ref[0], 0, lzf_refBufSize);
-        lzf_ref[1] = (unsigned *)realloc(lzf_ref[1], lzf_refBufSize);
-        assert(lzf_ref[1]);
-        memset(lzf_ref[1], 0, lzf_refBufSize);
-    }
-    if (lzf_refSize != size) // need to clear unused ref to maintain consistency
-    { // since ref and src are swapped each time
-        memset((char *)lzf_ref[0] + lzf_refSize, 0, lzf_refBufSize - lzf_refSize);
-        memset((char *)lzf_ref[1] + lzf_refSize, 0, lzf_refBufSize - lzf_refSize);
-    }
-    lzf_refSize = size;
-    lzf_readIndex ^= 1;
-    return lzf_ref[lzf_readIndex];
-}
-
-void DbgContext::CompressReadPixelBuffer(std::string * const outStr)
-{
-    assert(lzf_ref[0] && lzf_ref[1]);
-    unsigned * const ref = lzf_ref[lzf_readIndex ^ 1];
-    unsigned * const src = lzf_ref[lzf_readIndex];
-    for (unsigned i = 0; i < lzf_refSize / sizeof(*ref) + 1; i++)
-        ref[i] ^= src[i];
-    Compress(ref, lzf_refSize, outStr);
-}
-
-char * DbgContext::GetBuffer()
-{
-    if (!lzf_buf)
-        lzf_buf = (char *)malloc(LZF_CHUNK_SIZE);
-    assert(lzf_buf);
-    return lzf_buf;
-}
-
-unsigned int DbgContext::GetBufferSize()
-{
-    if (!lzf_buf)
-        lzf_buf = (char *)malloc(LZF_CHUNK_SIZE);
-    assert(lzf_buf);
-    if (lzf_buf)
-        return LZF_CHUNK_SIZE;
-    else
-        return 0;
-}
-
-void DbgContext::glUseProgram(GLuint program)
-{
-    while (GLenum error = hooks->gl.glGetError())
-        ALOGD("DbgContext::glUseProgram(%u): before glGetError() = 0x%.4X",
-             program, error);
-    this->program = program;
-    maxAttrib = 0;
-    if (program == 0)
-        return;
-    GLint activeAttributes = 0;
-    hooks->gl.glGetProgramiv(program, GL_ACTIVE_ATTRIBUTES, &activeAttributes);
-    maxAttrib = 0;
-    GLint maxNameLen = -1;
-    hooks->gl.glGetProgramiv(program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &maxNameLen);
-    char * name = new char [maxNameLen + 1];
-    name[maxNameLen] = 0;
-    // find total number of attribute slots used
-    for (unsigned i = 0; i < activeAttributes; i++) {
-        GLint size = -1;
-        GLenum type = -1;
-        hooks->gl.glGetActiveAttrib(program, i, maxNameLen + 1, NULL, &size, &type, name);
-        GLint slot = hooks->gl.glGetAttribLocation(program, name);
-        assert(slot >= 0);
-        switch (type) {
-        case GL_FLOAT:
-        case GL_FLOAT_VEC2:
-        case GL_FLOAT_VEC3:
-        case GL_FLOAT_VEC4:
-            slot += size;
-            break;
-        case GL_FLOAT_MAT2:
-            slot += size * 2;
-            break;
-        case GL_FLOAT_MAT3:
-            slot += size * 3;
-            break;
-        case GL_FLOAT_MAT4:
-            slot += size * 4;
-            break;
-        default:
-            assert(0);
-        }
-        if (slot > maxAttrib)
-            maxAttrib = slot;
-    }
-    delete name;
-    while (GLenum error = hooks->gl.glGetError())
-        ALOGD("DbgContext::glUseProgram(%u): after glGetError() = 0x%.4X",
-             program, error);
-}
-
-static bool HasNonVBOAttribs(const DbgContext * const ctx)
-{
-    bool need = false;
-    for (unsigned i = 0; !need && i < ctx->maxAttrib; i++)
-        if (ctx->vertexAttribs[i].enabled && ctx->vertexAttribs[i].buffer == 0)
-            need = true;
-    return need;
-}
-
-void DbgContext::glVertexAttribPointer(GLuint indx, GLint size, GLenum type,
-                                       GLboolean normalized, GLsizei stride, const GLvoid* ptr)
-{
-    assert(GL_NO_ERROR == hooks->gl.glGetError());
-    assert(indx < MAX_VERTEX_ATTRIBS);
-    vertexAttribs[indx].size = size;
-    vertexAttribs[indx].type = type;
-    vertexAttribs[indx].normalized = normalized;
-    switch (type) {
-    case GL_FLOAT:
-        vertexAttribs[indx].elemSize = sizeof(GLfloat) * size;
-        break;
-    case GL_INT:
-    case GL_UNSIGNED_INT:
-        vertexAttribs[indx].elemSize = sizeof(GLint) * size;
-        break;
-    case GL_SHORT:
-    case GL_UNSIGNED_SHORT:
-        vertexAttribs[indx].elemSize = sizeof(GLshort) * size;
-        break;
-    case GL_BYTE:
-    case GL_UNSIGNED_BYTE:
-        vertexAttribs[indx].elemSize = sizeof(GLbyte) * size;
-        break;
-    default:
-        assert(0);
-    }
-    if (0 == stride)
-        stride = vertexAttribs[indx].elemSize;
-    vertexAttribs[indx].stride = stride;
-    vertexAttribs[indx].ptr = ptr;
-    hooks->gl.glGetVertexAttribiv(indx, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING,
-                                  (GLint *)&vertexAttribs[indx].buffer);
-    hasNonVBOAttribs = HasNonVBOAttribs(this);
-}
-
-void DbgContext::glEnableVertexAttribArray(GLuint index)
-{
-    if (index >= MAX_VERTEX_ATTRIBS)
-        return;
-    vertexAttribs[index].enabled = true;
-    hasNonVBOAttribs = HasNonVBOAttribs(this);
-}
-
-void DbgContext::glDisableVertexAttribArray(GLuint index)
-{
-    if (index >= MAX_VERTEX_ATTRIBS)
-        return;
-    vertexAttribs[index].enabled = false;
-    hasNonVBOAttribs = HasNonVBOAttribs(this);
-}
-
-void DbgContext::glBindBuffer(GLenum target, GLuint buffer)
-{
-    if (GL_ELEMENT_ARRAY_BUFFER != target)
-        return;
-    if (0 == buffer) {
-        indexBuffer = NULL;
-        return;
-    }
-    VBO * b = indexBuffers;
-    indexBuffer = NULL;
-    while (b) {
-        if (b->name == buffer) {
-            assert(GL_ELEMENT_ARRAY_BUFFER == b->target);
-            indexBuffer = b;
-            break;
-        }
-        b = b->next;
-    }
-    if (!indexBuffer)
-        indexBuffer = indexBuffers = new VBO(buffer, target, indexBuffers);
-}
-
-void DbgContext::glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage)
-{
-    if (GL_ELEMENT_ARRAY_BUFFER != target)
-        return;
-    assert(indexBuffer);
-    assert(size >= 0);
-    indexBuffer->size = size;
-    indexBuffer->data = realloc(indexBuffer->data, size);
-    memcpy(indexBuffer->data, data, size);
-}
-
-void DbgContext::glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data)
-{
-    if (GL_ELEMENT_ARRAY_BUFFER != target)
-        return;
-    assert(indexBuffer);
-    assert(size >= 0);
-    assert(offset >= 0);
-    assert(offset + size <= indexBuffer->size);
-    memcpy((char *)indexBuffer->data + offset, data, size);
-}
-
-void DbgContext::glDeleteBuffers(GLsizei n, const GLuint *buffers)
-{
-    for (unsigned i = 0; i < n; i++) {
-        for (unsigned j = 0; j < MAX_VERTEX_ATTRIBS; j++)
-            if (buffers[i] == vertexAttribs[j].buffer) {
-                vertexAttribs[j].buffer = 0;
-                vertexAttribs[j].enabled = false;
-            }
-        VBO * b = indexBuffers, * previous = NULL;
-        while (b) {
-            if (b->name == buffers[i]) {
-                assert(GL_ELEMENT_ARRAY_BUFFER == b->target);
-                if (indexBuffer == b)
-                    indexBuffer = NULL;
-                if (previous)
-                    previous->next = b->next;
-                else
-                    indexBuffers = b->next;
-                free(b->data);
-                delete b;
-                break;
-            }
-            previous = b;
-            b = b->next;
-        }
-    }
-    hasNonVBOAttribs = HasNonVBOAttribs(this);
-}
-
-}; // namespace android
diff --git a/opengl/libs/GLES2_dbg/src/debugger_message.pb.cpp b/opengl/libs/GLES2_dbg/src/debugger_message.pb.cpp
deleted file mode 100644
index 50f70f7..0000000
--- a/opengl/libs/GLES2_dbg/src/debugger_message.pb.cpp
+++ /dev/null
@@ -1,1455 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-
-#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
-#include "debugger_message.pb.h"
-#include <google/protobuf/stubs/once.h>
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
-// @@protoc_insertion_point(includes)
-
-namespace com {
-namespace android {
-namespace glesv2debugger {
-
-void protobuf_ShutdownFile_debugger_5fmessage_2eproto() {
-  delete Message::default_instance_;
-}
-
-void protobuf_AddDesc_debugger_5fmessage_2eproto() {
-  static bool already_here = false;
-  if (already_here) return;
-  already_here = true;
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-  Message::default_instance_ = new Message();
-  Message::default_instance_->InitAsDefaultInstance();
-  ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_debugger_5fmessage_2eproto);
-}
-
-// Force AddDescriptors() to be called at static initialization time.
-struct StaticDescriptorInitializer_debugger_5fmessage_2eproto {
-  StaticDescriptorInitializer_debugger_5fmessage_2eproto() {
-    protobuf_AddDesc_debugger_5fmessage_2eproto();
-  }
-} static_descriptor_initializer_debugger_5fmessage_2eproto_;
-
-
-// ===================================================================
-
-bool Message_Function_IsValid(int value) {
-  switch(value) {
-    case 0:
-    case 1:
-    case 2:
-    case 3:
-    case 4:
-    case 5:
-    case 6:
-    case 7:
-    case 8:
-    case 9:
-    case 10:
-    case 11:
-    case 12:
-    case 13:
-    case 14:
-    case 15:
-    case 16:
-    case 17:
-    case 18:
-    case 19:
-    case 20:
-    case 21:
-    case 22:
-    case 23:
-    case 24:
-    case 25:
-    case 26:
-    case 27:
-    case 28:
-    case 29:
-    case 30:
-    case 31:
-    case 32:
-    case 33:
-    case 34:
-    case 35:
-    case 36:
-    case 37:
-    case 38:
-    case 39:
-    case 40:
-    case 41:
-    case 42:
-    case 43:
-    case 44:
-    case 45:
-    case 46:
-    case 47:
-    case 48:
-    case 49:
-    case 50:
-    case 51:
-    case 52:
-    case 53:
-    case 54:
-    case 55:
-    case 56:
-    case 57:
-    case 58:
-    case 59:
-    case 60:
-    case 61:
-    case 62:
-    case 63:
-    case 64:
-    case 65:
-    case 66:
-    case 67:
-    case 68:
-    case 69:
-    case 70:
-    case 71:
-    case 72:
-    case 73:
-    case 74:
-    case 75:
-    case 76:
-    case 77:
-    case 78:
-    case 79:
-    case 80:
-    case 81:
-    case 82:
-    case 83:
-    case 84:
-    case 85:
-    case 86:
-    case 87:
-    case 88:
-    case 89:
-    case 90:
-    case 91:
-    case 92:
-    case 93:
-    case 94:
-    case 95:
-    case 96:
-    case 97:
-    case 98:
-    case 99:
-    case 100:
-    case 101:
-    case 102:
-    case 103:
-    case 104:
-    case 105:
-    case 106:
-    case 107:
-    case 108:
-    case 109:
-    case 110:
-    case 111:
-    case 112:
-    case 113:
-    case 114:
-    case 115:
-    case 116:
-    case 117:
-    case 118:
-    case 119:
-    case 120:
-    case 121:
-    case 122:
-    case 123:
-    case 124:
-    case 125:
-    case 126:
-    case 127:
-    case 128:
-    case 129:
-    case 130:
-    case 131:
-    case 132:
-    case 133:
-    case 134:
-    case 135:
-    case 136:
-    case 137:
-    case 138:
-    case 139:
-    case 140:
-    case 141:
-    case 142:
-    case 143:
-    case 144:
-    case 145:
-    case 146:
-    case 147:
-    case 148:
-    case 149:
-    case 150:
-    case 151:
-    case 152:
-    case 153:
-    case 154:
-    case 155:
-    case 156:
-    case 157:
-    case 158:
-    case 159:
-    case 160:
-    case 161:
-    case 162:
-    case 163:
-    case 164:
-    case 165:
-    case 166:
-    case 167:
-    case 168:
-    case 169:
-    case 170:
-    case 171:
-    case 172:
-    case 173:
-    case 174:
-    case 175:
-    case 176:
-    case 177:
-    case 178:
-    case 179:
-    case 180:
-    case 181:
-    case 182:
-    case 183:
-    case 184:
-    case 185:
-    case 186:
-    case 187:
-    case 188:
-    case 189:
-    case 190:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#ifndef _MSC_VER
-const Message_Function Message::glActiveTexture;
-const Message_Function Message::glAttachShader;
-const Message_Function Message::glBindAttribLocation;
-const Message_Function Message::glBindBuffer;
-const Message_Function Message::glBindFramebuffer;
-const Message_Function Message::glBindRenderbuffer;
-const Message_Function Message::glBindTexture;
-const Message_Function Message::glBlendColor;
-const Message_Function Message::glBlendEquation;
-const Message_Function Message::glBlendEquationSeparate;
-const Message_Function Message::glBlendFunc;
-const Message_Function Message::glBlendFuncSeparate;
-const Message_Function Message::glBufferData;
-const Message_Function Message::glBufferSubData;
-const Message_Function Message::glCheckFramebufferStatus;
-const Message_Function Message::glClear;
-const Message_Function Message::glClearColor;
-const Message_Function Message::glClearDepthf;
-const Message_Function Message::glClearStencil;
-const Message_Function Message::glColorMask;
-const Message_Function Message::glCompileShader;
-const Message_Function Message::glCompressedTexImage2D;
-const Message_Function Message::glCompressedTexSubImage2D;
-const Message_Function Message::glCopyTexImage2D;
-const Message_Function Message::glCopyTexSubImage2D;
-const Message_Function Message::glCreateProgram;
-const Message_Function Message::glCreateShader;
-const Message_Function Message::glCullFace;
-const Message_Function Message::glDeleteBuffers;
-const Message_Function Message::glDeleteFramebuffers;
-const Message_Function Message::glDeleteProgram;
-const Message_Function Message::glDeleteRenderbuffers;
-const Message_Function Message::glDeleteShader;
-const Message_Function Message::glDeleteTextures;
-const Message_Function Message::glDepthFunc;
-const Message_Function Message::glDepthMask;
-const Message_Function Message::glDepthRangef;
-const Message_Function Message::glDetachShader;
-const Message_Function Message::glDisable;
-const Message_Function Message::glDisableVertexAttribArray;
-const Message_Function Message::glDrawArrays;
-const Message_Function Message::glDrawElements;
-const Message_Function Message::glEnable;
-const Message_Function Message::glEnableVertexAttribArray;
-const Message_Function Message::glFinish;
-const Message_Function Message::glFlush;
-const Message_Function Message::glFramebufferRenderbuffer;
-const Message_Function Message::glFramebufferTexture2D;
-const Message_Function Message::glFrontFace;
-const Message_Function Message::glGenBuffers;
-const Message_Function Message::glGenerateMipmap;
-const Message_Function Message::glGenFramebuffers;
-const Message_Function Message::glGenRenderbuffers;
-const Message_Function Message::glGenTextures;
-const Message_Function Message::glGetActiveAttrib;
-const Message_Function Message::glGetActiveUniform;
-const Message_Function Message::glGetAttachedShaders;
-const Message_Function Message::glGetAttribLocation;
-const Message_Function Message::glGetBooleanv;
-const Message_Function Message::glGetBufferParameteriv;
-const Message_Function Message::glGetError;
-const Message_Function Message::glGetFloatv;
-const Message_Function Message::glGetFramebufferAttachmentParameteriv;
-const Message_Function Message::glGetIntegerv;
-const Message_Function Message::glGetProgramiv;
-const Message_Function Message::glGetProgramInfoLog;
-const Message_Function Message::glGetRenderbufferParameteriv;
-const Message_Function Message::glGetShaderiv;
-const Message_Function Message::glGetShaderInfoLog;
-const Message_Function Message::glGetShaderPrecisionFormat;
-const Message_Function Message::glGetShaderSource;
-const Message_Function Message::glGetString;
-const Message_Function Message::glGetTexParameterfv;
-const Message_Function Message::glGetTexParameteriv;
-const Message_Function Message::glGetUniformfv;
-const Message_Function Message::glGetUniformiv;
-const Message_Function Message::glGetUniformLocation;
-const Message_Function Message::glGetVertexAttribfv;
-const Message_Function Message::glGetVertexAttribiv;
-const Message_Function Message::glGetVertexAttribPointerv;
-const Message_Function Message::glHint;
-const Message_Function Message::glIsBuffer;
-const Message_Function Message::glIsEnabled;
-const Message_Function Message::glIsFramebuffer;
-const Message_Function Message::glIsProgram;
-const Message_Function Message::glIsRenderbuffer;
-const Message_Function Message::glIsShader;
-const Message_Function Message::glIsTexture;
-const Message_Function Message::glLineWidth;
-const Message_Function Message::glLinkProgram;
-const Message_Function Message::glPixelStorei;
-const Message_Function Message::glPolygonOffset;
-const Message_Function Message::glReadPixels;
-const Message_Function Message::glReleaseShaderCompiler;
-const Message_Function Message::glRenderbufferStorage;
-const Message_Function Message::glSampleCoverage;
-const Message_Function Message::glScissor;
-const Message_Function Message::glShaderBinary;
-const Message_Function Message::glShaderSource;
-const Message_Function Message::glStencilFunc;
-const Message_Function Message::glStencilFuncSeparate;
-const Message_Function Message::glStencilMask;
-const Message_Function Message::glStencilMaskSeparate;
-const Message_Function Message::glStencilOp;
-const Message_Function Message::glStencilOpSeparate;
-const Message_Function Message::glTexImage2D;
-const Message_Function Message::glTexParameterf;
-const Message_Function Message::glTexParameterfv;
-const Message_Function Message::glTexParameteri;
-const Message_Function Message::glTexParameteriv;
-const Message_Function Message::glTexSubImage2D;
-const Message_Function Message::glUniform1f;
-const Message_Function Message::glUniform1fv;
-const Message_Function Message::glUniform1i;
-const Message_Function Message::glUniform1iv;
-const Message_Function Message::glUniform2f;
-const Message_Function Message::glUniform2fv;
-const Message_Function Message::glUniform2i;
-const Message_Function Message::glUniform2iv;
-const Message_Function Message::glUniform3f;
-const Message_Function Message::glUniform3fv;
-const Message_Function Message::glUniform3i;
-const Message_Function Message::glUniform3iv;
-const Message_Function Message::glUniform4f;
-const Message_Function Message::glUniform4fv;
-const Message_Function Message::glUniform4i;
-const Message_Function Message::glUniform4iv;
-const Message_Function Message::glUniformMatrix2fv;
-const Message_Function Message::glUniformMatrix3fv;
-const Message_Function Message::glUniformMatrix4fv;
-const Message_Function Message::glUseProgram;
-const Message_Function Message::glValidateProgram;
-const Message_Function Message::glVertexAttrib1f;
-const Message_Function Message::glVertexAttrib1fv;
-const Message_Function Message::glVertexAttrib2f;
-const Message_Function Message::glVertexAttrib2fv;
-const Message_Function Message::glVertexAttrib3f;
-const Message_Function Message::glVertexAttrib3fv;
-const Message_Function Message::glVertexAttrib4f;
-const Message_Function Message::glVertexAttrib4fv;
-const Message_Function Message::glVertexAttribPointer;
-const Message_Function Message::glViewport;
-const Message_Function Message::eglGetDisplay;
-const Message_Function Message::eglInitialize;
-const Message_Function Message::eglTerminate;
-const Message_Function Message::eglGetConfigs;
-const Message_Function Message::eglChooseConfig;
-const Message_Function Message::eglGetConfigAttrib;
-const Message_Function Message::eglCreateWindowSurface;
-const Message_Function Message::eglCreatePixmapSurface;
-const Message_Function Message::eglCreatePbufferSurface;
-const Message_Function Message::eglDestroySurface;
-const Message_Function Message::eglQuerySurface;
-const Message_Function Message::eglCreateContext;
-const Message_Function Message::eglDestroyContext;
-const Message_Function Message::eglMakeCurrent;
-const Message_Function Message::eglGetCurrentContext;
-const Message_Function Message::eglGetCurrentSurface;
-const Message_Function Message::eglGetCurrentDisplay;
-const Message_Function Message::eglQueryContext;
-const Message_Function Message::eglWaitGL;
-const Message_Function Message::eglWaitNative;
-const Message_Function Message::eglSwapBuffers;
-const Message_Function Message::eglCopyBuffers;
-const Message_Function Message::eglGetError;
-const Message_Function Message::eglQueryString;
-const Message_Function Message::eglGetProcAddress;
-const Message_Function Message::eglSurfaceAttrib;
-const Message_Function Message::eglBindTexImage;
-const Message_Function Message::eglReleaseTexImage;
-const Message_Function Message::eglSwapInterval;
-const Message_Function Message::eglBindAPI;
-const Message_Function Message::eglQueryAPI;
-const Message_Function Message::eglWaitClient;
-const Message_Function Message::eglReleaseThread;
-const Message_Function Message::eglCreatePbufferFromClientBuffer;
-const Message_Function Message::eglLockSurfaceKHR;
-const Message_Function Message::eglUnlockSurfaceKHR;
-const Message_Function Message::eglCreateImageKHR;
-const Message_Function Message::eglDestroyImageKHR;
-const Message_Function Message::eglCreateSyncKHR;
-const Message_Function Message::eglDestroySyncKHR;
-const Message_Function Message::eglClientWaitSyncKHR;
-const Message_Function Message::eglGetSyncAttribKHR;
-const Message_Function Message::eglSetSwapRectangleANDROID;
-const Message_Function Message::eglGetRenderBufferANDROID;
-const Message_Function Message::ACK;
-const Message_Function Message::NEG;
-const Message_Function Message::CONTINUE;
-const Message_Function Message::SKIP;
-const Message_Function Message::SETPROP;
-const Message_Function Message::Function_MIN;
-const Message_Function Message::Function_MAX;
-const int Message::Function_ARRAYSIZE;
-#endif  // _MSC_VER
-bool Message_Type_IsValid(int value) {
-  switch(value) {
-    case 0:
-    case 1:
-    case 2:
-    case 3:
-    case 4:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#ifndef _MSC_VER
-const Message_Type Message::BeforeCall;
-const Message_Type Message::AfterCall;
-const Message_Type Message::AfterGeneratedCall;
-const Message_Type Message::Response;
-const Message_Type Message::CompleteCall;
-const Message_Type Message::Type_MIN;
-const Message_Type Message::Type_MAX;
-const int Message::Type_ARRAYSIZE;
-#endif  // _MSC_VER
-bool Message_DataType_IsValid(int value) {
-  switch(value) {
-    case 0:
-    case 1:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#ifndef _MSC_VER
-const Message_DataType Message::ReferencedImage;
-const Message_DataType Message::NonreferencedImage;
-const Message_DataType Message::DataType_MIN;
-const Message_DataType Message::DataType_MAX;
-const int Message::DataType_ARRAYSIZE;
-#endif  // _MSC_VER
-bool Message_Prop_IsValid(int value) {
-  switch(value) {
-    case 0:
-    case 1:
-    case 2:
-    case 3:
-    case 4:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#ifndef _MSC_VER
-const Message_Prop Message::CaptureDraw;
-const Message_Prop Message::TimeMode;
-const Message_Prop Message::ExpectResponse;
-const Message_Prop Message::CaptureSwap;
-const Message_Prop Message::GLConstant;
-const Message_Prop Message::Prop_MIN;
-const Message_Prop Message::Prop_MAX;
-const int Message::Prop_ARRAYSIZE;
-#endif  // _MSC_VER
-const ::std::string Message::_default_data_;
-#ifndef _MSC_VER
-const int Message::kContextIdFieldNumber;
-const int Message::kFunctionFieldNumber;
-const int Message::kTypeFieldNumber;
-const int Message::kExpectResponseFieldNumber;
-const int Message::kRetFieldNumber;
-const int Message::kArg0FieldNumber;
-const int Message::kArg1FieldNumber;
-const int Message::kArg2FieldNumber;
-const int Message::kArg3FieldNumber;
-const int Message::kArg4FieldNumber;
-const int Message::kArg5FieldNumber;
-const int Message::kArg6FieldNumber;
-const int Message::kArg7FieldNumber;
-const int Message::kArg8FieldNumber;
-const int Message::kDataFieldNumber;
-const int Message::kDataTypeFieldNumber;
-const int Message::kPixelFormatFieldNumber;
-const int Message::kPixelTypeFieldNumber;
-const int Message::kImageWidthFieldNumber;
-const int Message::kImageHeightFieldNumber;
-const int Message::kTimeFieldNumber;
-const int Message::kPropFieldNumber;
-const int Message::kClockFieldNumber;
-#endif  // !_MSC_VER
-
-Message::Message()
-  : ::google::protobuf::MessageLite() {
-  SharedCtor();
-}
-
-void Message::InitAsDefaultInstance() {
-}
-
-Message::Message(const Message& from)
-  : ::google::protobuf::MessageLite() {
-  SharedCtor();
-  MergeFrom(from);
-}
-
-void Message::SharedCtor() {
-  _cached_size_ = 0;
-  context_id_ = 0;
-  function_ = 187;
-  type_ = 0;
-  expect_response_ = false;
-  ret_ = 0;
-  arg0_ = 0;
-  arg1_ = 0;
-  arg2_ = 0;
-  arg3_ = 0;
-  arg4_ = 0;
-  arg5_ = 0;
-  arg6_ = 0;
-  arg7_ = 0;
-  arg8_ = 0;
-  data_ = const_cast< ::std::string*>(&_default_data_);
-  data_type_ = 0;
-  pixel_format_ = 0;
-  pixel_type_ = 0;
-  image_width_ = 0;
-  image_height_ = 0;
-  time_ = 0;
-  prop_ = 0;
-  clock_ = 0;
-  ::memset(_has_bits_, 0, sizeof(_has_bits_));
-}
-
-Message::~Message() {
-  SharedDtor();
-}
-
-void Message::SharedDtor() {
-  if (data_ != &_default_data_) {
-    delete data_;
-  }
-  if (this != default_instance_) {
-  }
-}
-
-void Message::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const Message& Message::default_instance() {
-  if (default_instance_ == NULL) protobuf_AddDesc_debugger_5fmessage_2eproto();  return *default_instance_;
-}
-
-Message* Message::default_instance_ = NULL;
-
-Message* Message::New() const {
-  return new Message;
-}
-
-void Message::Clear() {
-  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
-    context_id_ = 0;
-    function_ = 187;
-    type_ = 0;
-    expect_response_ = false;
-    ret_ = 0;
-    arg0_ = 0;
-    arg1_ = 0;
-    arg2_ = 0;
-  }
-  if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) {
-    arg3_ = 0;
-    arg4_ = 0;
-    arg5_ = 0;
-    arg6_ = 0;
-    arg7_ = 0;
-    arg8_ = 0;
-    if (_has_bit(14)) {
-      if (data_ != &_default_data_) {
-        data_->clear();
-      }
-    }
-    data_type_ = 0;
-  }
-  if (_has_bits_[16 / 32] & (0xffu << (16 % 32))) {
-    pixel_format_ = 0;
-    pixel_type_ = 0;
-    image_width_ = 0;
-    image_height_ = 0;
-    time_ = 0;
-    prop_ = 0;
-    clock_ = 0;
-  }
-  ::memset(_has_bits_, 0, sizeof(_has_bits_));
-}
-
-bool Message::MergePartialFromCodedStream(
-    ::google::protobuf::io::CodedInputStream* input) {
-#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
-  ::google::protobuf::uint32 tag;
-  while ((tag = input->ReadTag()) != 0) {
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // required int32 context_id = 1;
-      case 1: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &context_id_)));
-          _set_bit(0);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(16)) goto parse_function;
-        break;
-      }
-      
-      // required .com.android.glesv2debugger.Message.Function function = 2 [default = NEG];
-      case 2: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_function:
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::com::android::glesv2debugger::Message_Function_IsValid(value)) {
-            set_function(static_cast< ::com::android::glesv2debugger::Message_Function >(value));
-          }
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(24)) goto parse_type;
-        break;
-      }
-      
-      // required .com.android.glesv2debugger.Message.Type type = 3;
-      case 3: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_type:
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::com::android::glesv2debugger::Message_Type_IsValid(value)) {
-            set_type(static_cast< ::com::android::glesv2debugger::Message_Type >(value));
-          }
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(32)) goto parse_expect_response;
-        break;
-      }
-      
-      // required bool expect_response = 4;
-      case 4: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_expect_response:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &expect_response_)));
-          _set_bit(3);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(40)) goto parse_ret;
-        break;
-      }
-      
-      // optional int32 ret = 5;
-      case 5: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_ret:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &ret_)));
-          _set_bit(4);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(48)) goto parse_arg0;
-        break;
-      }
-      
-      // optional int32 arg0 = 6;
-      case 6: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_arg0:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &arg0_)));
-          _set_bit(5);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(56)) goto parse_arg1;
-        break;
-      }
-      
-      // optional int32 arg1 = 7;
-      case 7: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_arg1:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &arg1_)));
-          _set_bit(6);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(64)) goto parse_arg2;
-        break;
-      }
-      
-      // optional int32 arg2 = 8;
-      case 8: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_arg2:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &arg2_)));
-          _set_bit(7);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(72)) goto parse_arg3;
-        break;
-      }
-      
-      // optional int32 arg3 = 9;
-      case 9: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_arg3:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &arg3_)));
-          _set_bit(8);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(82)) goto parse_data;
-        break;
-      }
-      
-      // optional bytes data = 10;
-      case 10: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
-         parse_data:
-          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
-                input, this->mutable_data()));
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(93)) goto parse_time;
-        break;
-      }
-      
-      // optional float time = 11;
-      case 11: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
-         parse_time:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &time_)));
-          _set_bit(20);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(128)) goto parse_arg4;
-        break;
-      }
-      
-      // optional int32 arg4 = 16;
-      case 16: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_arg4:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &arg4_)));
-          _set_bit(9);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(136)) goto parse_arg5;
-        break;
-      }
-      
-      // optional int32 arg5 = 17;
-      case 17: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_arg5:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &arg5_)));
-          _set_bit(10);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(144)) goto parse_arg6;
-        break;
-      }
-      
-      // optional int32 arg6 = 18;
-      case 18: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_arg6:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &arg6_)));
-          _set_bit(11);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(152)) goto parse_arg7;
-        break;
-      }
-      
-      // optional int32 arg7 = 19;
-      case 19: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_arg7:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &arg7_)));
-          _set_bit(12);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(160)) goto parse_arg8;
-        break;
-      }
-      
-      // optional int32 arg8 = 20;
-      case 20: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_arg8:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &arg8_)));
-          _set_bit(13);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(168)) goto parse_prop;
-        break;
-      }
-      
-      // optional .com.android.glesv2debugger.Message.Prop prop = 21;
-      case 21: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_prop:
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::com::android::glesv2debugger::Message_Prop_IsValid(value)) {
-            set_prop(static_cast< ::com::android::glesv2debugger::Message_Prop >(value));
-          }
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(181)) goto parse_clock;
-        break;
-      }
-      
-      // optional float clock = 22;
-      case 22: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
-         parse_clock:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &clock_)));
-          _set_bit(22);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(184)) goto parse_data_type;
-        break;
-      }
-      
-      // optional .com.android.glesv2debugger.Message.DataType data_type = 23;
-      case 23: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_data_type:
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::com::android::glesv2debugger::Message_DataType_IsValid(value)) {
-            set_data_type(static_cast< ::com::android::glesv2debugger::Message_DataType >(value));
-          }
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(192)) goto parse_pixel_format;
-        break;
-      }
-      
-      // optional int32 pixel_format = 24;
-      case 24: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_pixel_format:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &pixel_format_)));
-          _set_bit(16);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(200)) goto parse_pixel_type;
-        break;
-      }
-      
-      // optional int32 pixel_type = 25;
-      case 25: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_pixel_type:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &pixel_type_)));
-          _set_bit(17);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(208)) goto parse_image_width;
-        break;
-      }
-      
-      // optional int32 image_width = 26;
-      case 26: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_image_width:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &image_width_)));
-          _set_bit(18);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(216)) goto parse_image_height;
-        break;
-      }
-      
-      // optional int32 image_height = 27;
-      case 27: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_image_height:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &image_height_)));
-          _set_bit(19);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectAtEnd()) return true;
-        break;
-      }
-      
-      default: {
-      handle_uninterpreted:
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
-          return true;
-        }
-        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
-        break;
-      }
-    }
-  }
-  return true;
-#undef DO_
-}
-
-void Message::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // required int32 context_id = 1;
-  if (_has_bit(0)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->context_id(), output);
-  }
-  
-  // required .com.android.glesv2debugger.Message.Function function = 2 [default = NEG];
-  if (_has_bit(1)) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      2, this->function(), output);
-  }
-  
-  // required .com.android.glesv2debugger.Message.Type type = 3;
-  if (_has_bit(2)) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      3, this->type(), output);
-  }
-  
-  // required bool expect_response = 4;
-  if (_has_bit(3)) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->expect_response(), output);
-  }
-  
-  // optional int32 ret = 5;
-  if (_has_bit(4)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->ret(), output);
-  }
-  
-  // optional int32 arg0 = 6;
-  if (_has_bit(5)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->arg0(), output);
-  }
-  
-  // optional int32 arg1 = 7;
-  if (_has_bit(6)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(7, this->arg1(), output);
-  }
-  
-  // optional int32 arg2 = 8;
-  if (_has_bit(7)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(8, this->arg2(), output);
-  }
-  
-  // optional int32 arg3 = 9;
-  if (_has_bit(8)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(9, this->arg3(), output);
-  }
-  
-  // optional bytes data = 10;
-  if (_has_bit(14)) {
-    ::google::protobuf::internal::WireFormatLite::WriteBytes(
-      10, this->data(), output);
-  }
-  
-  // optional float time = 11;
-  if (_has_bit(20)) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(11, this->time(), output);
-  }
-  
-  // optional int32 arg4 = 16;
-  if (_has_bit(9)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(16, this->arg4(), output);
-  }
-  
-  // optional int32 arg5 = 17;
-  if (_has_bit(10)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(17, this->arg5(), output);
-  }
-  
-  // optional int32 arg6 = 18;
-  if (_has_bit(11)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(18, this->arg6(), output);
-  }
-  
-  // optional int32 arg7 = 19;
-  if (_has_bit(12)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(19, this->arg7(), output);
-  }
-  
-  // optional int32 arg8 = 20;
-  if (_has_bit(13)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(20, this->arg8(), output);
-  }
-  
-  // optional .com.android.glesv2debugger.Message.Prop prop = 21;
-  if (_has_bit(21)) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      21, this->prop(), output);
-  }
-  
-  // optional float clock = 22;
-  if (_has_bit(22)) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(22, this->clock(), output);
-  }
-  
-  // optional .com.android.glesv2debugger.Message.DataType data_type = 23;
-  if (_has_bit(15)) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      23, this->data_type(), output);
-  }
-  
-  // optional int32 pixel_format = 24;
-  if (_has_bit(16)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(24, this->pixel_format(), output);
-  }
-  
-  // optional int32 pixel_type = 25;
-  if (_has_bit(17)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(25, this->pixel_type(), output);
-  }
-  
-  // optional int32 image_width = 26;
-  if (_has_bit(18)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(26, this->image_width(), output);
-  }
-  
-  // optional int32 image_height = 27;
-  if (_has_bit(19)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(27, this->image_height(), output);
-  }
-  
-}
-
-int Message::ByteSize() const {
-  int total_size = 0;
-  
-  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
-    // required int32 context_id = 1;
-    if (has_context_id()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->context_id());
-    }
-    
-    // required .com.android.glesv2debugger.Message.Function function = 2 [default = NEG];
-    if (has_function()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->function());
-    }
-    
-    // required .com.android.glesv2debugger.Message.Type type = 3;
-    if (has_type()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->type());
-    }
-    
-    // required bool expect_response = 4;
-    if (has_expect_response()) {
-      total_size += 1 + 1;
-    }
-    
-    // optional int32 ret = 5;
-    if (has_ret()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->ret());
-    }
-    
-    // optional int32 arg0 = 6;
-    if (has_arg0()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->arg0());
-    }
-    
-    // optional int32 arg1 = 7;
-    if (has_arg1()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->arg1());
-    }
-    
-    // optional int32 arg2 = 8;
-    if (has_arg2()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->arg2());
-    }
-    
-  }
-  if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) {
-    // optional int32 arg3 = 9;
-    if (has_arg3()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->arg3());
-    }
-    
-    // optional int32 arg4 = 16;
-    if (has_arg4()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->arg4());
-    }
-    
-    // optional int32 arg5 = 17;
-    if (has_arg5()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->arg5());
-    }
-    
-    // optional int32 arg6 = 18;
-    if (has_arg6()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->arg6());
-    }
-    
-    // optional int32 arg7 = 19;
-    if (has_arg7()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->arg7());
-    }
-    
-    // optional int32 arg8 = 20;
-    if (has_arg8()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->arg8());
-    }
-    
-    // optional bytes data = 10;
-    if (has_data()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::BytesSize(
-          this->data());
-    }
-    
-    // optional .com.android.glesv2debugger.Message.DataType data_type = 23;
-    if (has_data_type()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->data_type());
-    }
-    
-  }
-  if (_has_bits_[16 / 32] & (0xffu << (16 % 32))) {
-    // optional int32 pixel_format = 24;
-    if (has_pixel_format()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->pixel_format());
-    }
-    
-    // optional int32 pixel_type = 25;
-    if (has_pixel_type()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->pixel_type());
-    }
-    
-    // optional int32 image_width = 26;
-    if (has_image_width()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->image_width());
-    }
-    
-    // optional int32 image_height = 27;
-    if (has_image_height()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->image_height());
-    }
-    
-    // optional float time = 11;
-    if (has_time()) {
-      total_size += 1 + 4;
-    }
-    
-    // optional .com.android.glesv2debugger.Message.Prop prop = 21;
-    if (has_prop()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->prop());
-    }
-    
-    // optional float clock = 22;
-    if (has_clock()) {
-      total_size += 2 + 4;
-    }
-    
-  }
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = total_size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-  return total_size;
-}
-
-void Message::CheckTypeAndMergeFrom(
-    const ::google::protobuf::MessageLite& from) {
-  MergeFrom(*::google::protobuf::down_cast<const Message*>(&from));
-}
-
-void Message::MergeFrom(const Message& from) {
-  GOOGLE_CHECK_NE(&from, this);
-  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
-    if (from._has_bit(0)) {
-      set_context_id(from.context_id());
-    }
-    if (from._has_bit(1)) {
-      set_function(from.function());
-    }
-    if (from._has_bit(2)) {
-      set_type(from.type());
-    }
-    if (from._has_bit(3)) {
-      set_expect_response(from.expect_response());
-    }
-    if (from._has_bit(4)) {
-      set_ret(from.ret());
-    }
-    if (from._has_bit(5)) {
-      set_arg0(from.arg0());
-    }
-    if (from._has_bit(6)) {
-      set_arg1(from.arg1());
-    }
-    if (from._has_bit(7)) {
-      set_arg2(from.arg2());
-    }
-  }
-  if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) {
-    if (from._has_bit(8)) {
-      set_arg3(from.arg3());
-    }
-    if (from._has_bit(9)) {
-      set_arg4(from.arg4());
-    }
-    if (from._has_bit(10)) {
-      set_arg5(from.arg5());
-    }
-    if (from._has_bit(11)) {
-      set_arg6(from.arg6());
-    }
-    if (from._has_bit(12)) {
-      set_arg7(from.arg7());
-    }
-    if (from._has_bit(13)) {
-      set_arg8(from.arg8());
-    }
-    if (from._has_bit(14)) {
-      set_data(from.data());
-    }
-    if (from._has_bit(15)) {
-      set_data_type(from.data_type());
-    }
-  }
-  if (from._has_bits_[16 / 32] & (0xffu << (16 % 32))) {
-    if (from._has_bit(16)) {
-      set_pixel_format(from.pixel_format());
-    }
-    if (from._has_bit(17)) {
-      set_pixel_type(from.pixel_type());
-    }
-    if (from._has_bit(18)) {
-      set_image_width(from.image_width());
-    }
-    if (from._has_bit(19)) {
-      set_image_height(from.image_height());
-    }
-    if (from._has_bit(20)) {
-      set_time(from.time());
-    }
-    if (from._has_bit(21)) {
-      set_prop(from.prop());
-    }
-    if (from._has_bit(22)) {
-      set_clock(from.clock());
-    }
-  }
-}
-
-void Message::CopyFrom(const Message& from) {
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool Message::IsInitialized() const {
-  if ((_has_bits_[0] & 0x0000000f) != 0x0000000f) return false;
-  
-  return true;
-}
-
-void Message::Swap(Message* other) {
-  if (other != this) {
-    std::swap(context_id_, other->context_id_);
-    std::swap(function_, other->function_);
-    std::swap(type_, other->type_);
-    std::swap(expect_response_, other->expect_response_);
-    std::swap(ret_, other->ret_);
-    std::swap(arg0_, other->arg0_);
-    std::swap(arg1_, other->arg1_);
-    std::swap(arg2_, other->arg2_);
-    std::swap(arg3_, other->arg3_);
-    std::swap(arg4_, other->arg4_);
-    std::swap(arg5_, other->arg5_);
-    std::swap(arg6_, other->arg6_);
-    std::swap(arg7_, other->arg7_);
-    std::swap(arg8_, other->arg8_);
-    std::swap(data_, other->data_);
-    std::swap(data_type_, other->data_type_);
-    std::swap(pixel_format_, other->pixel_format_);
-    std::swap(pixel_type_, other->pixel_type_);
-    std::swap(image_width_, other->image_width_);
-    std::swap(image_height_, other->image_height_);
-    std::swap(time_, other->time_);
-    std::swap(prop_, other->prop_);
-    std::swap(clock_, other->clock_);
-    std::swap(_has_bits_[0], other->_has_bits_[0]);
-    std::swap(_cached_size_, other->_cached_size_);
-  }
-}
-
-::std::string Message::GetTypeName() const {
-  return "com.android.glesv2debugger.Message";
-}
-
-
-// @@protoc_insertion_point(namespace_scope)
-
-}  // namespace glesv2debugger
-}  // namespace android
-}  // namespace com
-
-// @@protoc_insertion_point(global_scope)
diff --git a/opengl/libs/GLES2_dbg/src/debugger_message.pb.h b/opengl/libs/GLES2_dbg/src/debugger_message.pb.h
deleted file mode 100644
index 5c94664..0000000
--- a/opengl/libs/GLES2_dbg/src/debugger_message.pb.h
+++ /dev/null
@@ -1,1187 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: debugger_message.proto
-
-#ifndef PROTOBUF_debugger_5fmessage_2eproto__INCLUDED
-#define PROTOBUF_debugger_5fmessage_2eproto__INCLUDED
-
-#include <string>
-
-#include <google/protobuf/stubs/common.h>
-
-#if GOOGLE_PROTOBUF_VERSION < 2003000
-#error This file was generated by a newer version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please update
-#error your headers.
-#endif
-#if 2003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
-#error This file was generated by an older version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please
-#error regenerate this file with a newer version of protoc.
-#endif
-
-#include <google/protobuf/generated_message_util.h>
-#include <google/protobuf/repeated_field.h>
-#include <google/protobuf/extension_set.h>
-// @@protoc_insertion_point(includes)
-
-namespace com {
-namespace android {
-namespace glesv2debugger {
-
-// Internal implementation detail -- do not call these.
-void  protobuf_AddDesc_debugger_5fmessage_2eproto();
-void protobuf_AssignDesc_debugger_5fmessage_2eproto();
-void protobuf_ShutdownFile_debugger_5fmessage_2eproto();
-
-class Message;
-
-enum Message_Function {
-  Message_Function_glActiveTexture = 0,
-  Message_Function_glAttachShader = 1,
-  Message_Function_glBindAttribLocation = 2,
-  Message_Function_glBindBuffer = 3,
-  Message_Function_glBindFramebuffer = 4,
-  Message_Function_glBindRenderbuffer = 5,
-  Message_Function_glBindTexture = 6,
-  Message_Function_glBlendColor = 7,
-  Message_Function_glBlendEquation = 8,
-  Message_Function_glBlendEquationSeparate = 9,
-  Message_Function_glBlendFunc = 10,
-  Message_Function_glBlendFuncSeparate = 11,
-  Message_Function_glBufferData = 12,
-  Message_Function_glBufferSubData = 13,
-  Message_Function_glCheckFramebufferStatus = 14,
-  Message_Function_glClear = 15,
-  Message_Function_glClearColor = 16,
-  Message_Function_glClearDepthf = 17,
-  Message_Function_glClearStencil = 18,
-  Message_Function_glColorMask = 19,
-  Message_Function_glCompileShader = 20,
-  Message_Function_glCompressedTexImage2D = 21,
-  Message_Function_glCompressedTexSubImage2D = 22,
-  Message_Function_glCopyTexImage2D = 23,
-  Message_Function_glCopyTexSubImage2D = 24,
-  Message_Function_glCreateProgram = 25,
-  Message_Function_glCreateShader = 26,
-  Message_Function_glCullFace = 27,
-  Message_Function_glDeleteBuffers = 28,
-  Message_Function_glDeleteFramebuffers = 29,
-  Message_Function_glDeleteProgram = 30,
-  Message_Function_glDeleteRenderbuffers = 31,
-  Message_Function_glDeleteShader = 32,
-  Message_Function_glDeleteTextures = 33,
-  Message_Function_glDepthFunc = 34,
-  Message_Function_glDepthMask = 35,
-  Message_Function_glDepthRangef = 36,
-  Message_Function_glDetachShader = 37,
-  Message_Function_glDisable = 38,
-  Message_Function_glDisableVertexAttribArray = 39,
-  Message_Function_glDrawArrays = 40,
-  Message_Function_glDrawElements = 41,
-  Message_Function_glEnable = 42,
-  Message_Function_glEnableVertexAttribArray = 43,
-  Message_Function_glFinish = 44,
-  Message_Function_glFlush = 45,
-  Message_Function_glFramebufferRenderbuffer = 46,
-  Message_Function_glFramebufferTexture2D = 47,
-  Message_Function_glFrontFace = 48,
-  Message_Function_glGenBuffers = 49,
-  Message_Function_glGenerateMipmap = 50,
-  Message_Function_glGenFramebuffers = 51,
-  Message_Function_glGenRenderbuffers = 52,
-  Message_Function_glGenTextures = 53,
-  Message_Function_glGetActiveAttrib = 54,
-  Message_Function_glGetActiveUniform = 55,
-  Message_Function_glGetAttachedShaders = 56,
-  Message_Function_glGetAttribLocation = 57,
-  Message_Function_glGetBooleanv = 58,
-  Message_Function_glGetBufferParameteriv = 59,
-  Message_Function_glGetError = 60,
-  Message_Function_glGetFloatv = 61,
-  Message_Function_glGetFramebufferAttachmentParameteriv = 62,
-  Message_Function_glGetIntegerv = 63,
-  Message_Function_glGetProgramiv = 64,
-  Message_Function_glGetProgramInfoLog = 65,
-  Message_Function_glGetRenderbufferParameteriv = 66,
-  Message_Function_glGetShaderiv = 67,
-  Message_Function_glGetShaderInfoLog = 68,
-  Message_Function_glGetShaderPrecisionFormat = 69,
-  Message_Function_glGetShaderSource = 70,
-  Message_Function_glGetString = 71,
-  Message_Function_glGetTexParameterfv = 72,
-  Message_Function_glGetTexParameteriv = 73,
-  Message_Function_glGetUniformfv = 74,
-  Message_Function_glGetUniformiv = 75,
-  Message_Function_glGetUniformLocation = 76,
-  Message_Function_glGetVertexAttribfv = 77,
-  Message_Function_glGetVertexAttribiv = 78,
-  Message_Function_glGetVertexAttribPointerv = 79,
-  Message_Function_glHint = 80,
-  Message_Function_glIsBuffer = 81,
-  Message_Function_glIsEnabled = 82,
-  Message_Function_glIsFramebuffer = 83,
-  Message_Function_glIsProgram = 84,
-  Message_Function_glIsRenderbuffer = 85,
-  Message_Function_glIsShader = 86,
-  Message_Function_glIsTexture = 87,
-  Message_Function_glLineWidth = 88,
-  Message_Function_glLinkProgram = 89,
-  Message_Function_glPixelStorei = 90,
-  Message_Function_glPolygonOffset = 91,
-  Message_Function_glReadPixels = 92,
-  Message_Function_glReleaseShaderCompiler = 93,
-  Message_Function_glRenderbufferStorage = 94,
-  Message_Function_glSampleCoverage = 95,
-  Message_Function_glScissor = 96,
-  Message_Function_glShaderBinary = 97,
-  Message_Function_glShaderSource = 98,
-  Message_Function_glStencilFunc = 99,
-  Message_Function_glStencilFuncSeparate = 100,
-  Message_Function_glStencilMask = 101,
-  Message_Function_glStencilMaskSeparate = 102,
-  Message_Function_glStencilOp = 103,
-  Message_Function_glStencilOpSeparate = 104,
-  Message_Function_glTexImage2D = 105,
-  Message_Function_glTexParameterf = 106,
-  Message_Function_glTexParameterfv = 107,
-  Message_Function_glTexParameteri = 108,
-  Message_Function_glTexParameteriv = 109,
-  Message_Function_glTexSubImage2D = 110,
-  Message_Function_glUniform1f = 111,
-  Message_Function_glUniform1fv = 112,
-  Message_Function_glUniform1i = 113,
-  Message_Function_glUniform1iv = 114,
-  Message_Function_glUniform2f = 115,
-  Message_Function_glUniform2fv = 116,
-  Message_Function_glUniform2i = 117,
-  Message_Function_glUniform2iv = 118,
-  Message_Function_glUniform3f = 119,
-  Message_Function_glUniform3fv = 120,
-  Message_Function_glUniform3i = 121,
-  Message_Function_glUniform3iv = 122,
-  Message_Function_glUniform4f = 123,
-  Message_Function_glUniform4fv = 124,
-  Message_Function_glUniform4i = 125,
-  Message_Function_glUniform4iv = 126,
-  Message_Function_glUniformMatrix2fv = 127,
-  Message_Function_glUniformMatrix3fv = 128,
-  Message_Function_glUniformMatrix4fv = 129,
-  Message_Function_glUseProgram = 130,
-  Message_Function_glValidateProgram = 131,
-  Message_Function_glVertexAttrib1f = 132,
-  Message_Function_glVertexAttrib1fv = 133,
-  Message_Function_glVertexAttrib2f = 134,
-  Message_Function_glVertexAttrib2fv = 135,
-  Message_Function_glVertexAttrib3f = 136,
-  Message_Function_glVertexAttrib3fv = 137,
-  Message_Function_glVertexAttrib4f = 138,
-  Message_Function_glVertexAttrib4fv = 139,
-  Message_Function_glVertexAttribPointer = 140,
-  Message_Function_glViewport = 141,
-  Message_Function_eglGetDisplay = 142,
-  Message_Function_eglInitialize = 143,
-  Message_Function_eglTerminate = 144,
-  Message_Function_eglGetConfigs = 145,
-  Message_Function_eglChooseConfig = 146,
-  Message_Function_eglGetConfigAttrib = 147,
-  Message_Function_eglCreateWindowSurface = 148,
-  Message_Function_eglCreatePixmapSurface = 149,
-  Message_Function_eglCreatePbufferSurface = 150,
-  Message_Function_eglDestroySurface = 151,
-  Message_Function_eglQuerySurface = 152,
-  Message_Function_eglCreateContext = 153,
-  Message_Function_eglDestroyContext = 154,
-  Message_Function_eglMakeCurrent = 155,
-  Message_Function_eglGetCurrentContext = 156,
-  Message_Function_eglGetCurrentSurface = 157,
-  Message_Function_eglGetCurrentDisplay = 158,
-  Message_Function_eglQueryContext = 159,
-  Message_Function_eglWaitGL = 160,
-  Message_Function_eglWaitNative = 161,
-  Message_Function_eglSwapBuffers = 162,
-  Message_Function_eglCopyBuffers = 163,
-  Message_Function_eglGetError = 164,
-  Message_Function_eglQueryString = 165,
-  Message_Function_eglGetProcAddress = 166,
-  Message_Function_eglSurfaceAttrib = 167,
-  Message_Function_eglBindTexImage = 168,
-  Message_Function_eglReleaseTexImage = 169,
-  Message_Function_eglSwapInterval = 170,
-  Message_Function_eglBindAPI = 171,
-  Message_Function_eglQueryAPI = 172,
-  Message_Function_eglWaitClient = 173,
-  Message_Function_eglReleaseThread = 174,
-  Message_Function_eglCreatePbufferFromClientBuffer = 175,
-  Message_Function_eglLockSurfaceKHR = 176,
-  Message_Function_eglUnlockSurfaceKHR = 177,
-  Message_Function_eglCreateImageKHR = 178,
-  Message_Function_eglDestroyImageKHR = 179,
-  Message_Function_eglCreateSyncKHR = 180,
-  Message_Function_eglDestroySyncKHR = 181,
-  Message_Function_eglClientWaitSyncKHR = 182,
-  Message_Function_eglGetSyncAttribKHR = 183,
-  Message_Function_eglSetSwapRectangleANDROID = 184,
-  Message_Function_eglGetRenderBufferANDROID = 185,
-  Message_Function_ACK = 186,
-  Message_Function_NEG = 187,
-  Message_Function_CONTINUE = 188,
-  Message_Function_SKIP = 189,
-  Message_Function_SETPROP = 190
-};
-bool Message_Function_IsValid(int value);
-const Message_Function Message_Function_Function_MIN = Message_Function_glActiveTexture;
-const Message_Function Message_Function_Function_MAX = Message_Function_SETPROP;
-const int Message_Function_Function_ARRAYSIZE = Message_Function_Function_MAX + 1;
-
-enum Message_Type {
-  Message_Type_BeforeCall = 0,
-  Message_Type_AfterCall = 1,
-  Message_Type_AfterGeneratedCall = 2,
-  Message_Type_Response = 3,
-  Message_Type_CompleteCall = 4
-};
-bool Message_Type_IsValid(int value);
-const Message_Type Message_Type_Type_MIN = Message_Type_BeforeCall;
-const Message_Type Message_Type_Type_MAX = Message_Type_CompleteCall;
-const int Message_Type_Type_ARRAYSIZE = Message_Type_Type_MAX + 1;
-
-enum Message_DataType {
-  Message_DataType_ReferencedImage = 0,
-  Message_DataType_NonreferencedImage = 1
-};
-bool Message_DataType_IsValid(int value);
-const Message_DataType Message_DataType_DataType_MIN = Message_DataType_ReferencedImage;
-const Message_DataType Message_DataType_DataType_MAX = Message_DataType_NonreferencedImage;
-const int Message_DataType_DataType_ARRAYSIZE = Message_DataType_DataType_MAX + 1;
-
-enum Message_Prop {
-  Message_Prop_CaptureDraw = 0,
-  Message_Prop_TimeMode = 1,
-  Message_Prop_ExpectResponse = 2,
-  Message_Prop_CaptureSwap = 3,
-  Message_Prop_GLConstant = 4
-};
-bool Message_Prop_IsValid(int value);
-const Message_Prop Message_Prop_Prop_MIN = Message_Prop_CaptureDraw;
-const Message_Prop Message_Prop_Prop_MAX = Message_Prop_GLConstant;
-const int Message_Prop_Prop_ARRAYSIZE = Message_Prop_Prop_MAX + 1;
-
-// ===================================================================
-
-class Message : public ::google::protobuf::MessageLite {
- public:
-  Message();
-  virtual ~Message();
-  
-  Message(const Message& from);
-  
-  inline Message& operator=(const Message& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  
-  static const Message& default_instance();
-  
-  void Swap(Message* other);
-  
-  // implements Message ----------------------------------------------
-  
-  Message* New() const;
-  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
-  void CopyFrom(const Message& from);
-  void MergeFrom(const Message& from);
-  void Clear();
-  bool IsInitialized() const;
-  
-  int ByteSize() const;
-  bool MergePartialFromCodedStream(
-      ::google::protobuf::io::CodedInputStream* input);
-  void SerializeWithCachedSizes(
-      ::google::protobuf::io::CodedOutputStream* output) const;
-  int GetCachedSize() const { return _cached_size_; }
-  private:
-  void SharedCtor();
-  void SharedDtor();
-  void SetCachedSize(int size) const;
-  public:
-  
-  ::std::string GetTypeName() const;
-  
-  // nested types ----------------------------------------------------
-  
-  typedef Message_Function Function;
-  static const Function glActiveTexture = Message_Function_glActiveTexture;
-  static const Function glAttachShader = Message_Function_glAttachShader;
-  static const Function glBindAttribLocation = Message_Function_glBindAttribLocation;
-  static const Function glBindBuffer = Message_Function_glBindBuffer;
-  static const Function glBindFramebuffer = Message_Function_glBindFramebuffer;
-  static const Function glBindRenderbuffer = Message_Function_glBindRenderbuffer;
-  static const Function glBindTexture = Message_Function_glBindTexture;
-  static const Function glBlendColor = Message_Function_glBlendColor;
-  static const Function glBlendEquation = Message_Function_glBlendEquation;
-  static const Function glBlendEquationSeparate = Message_Function_glBlendEquationSeparate;
-  static const Function glBlendFunc = Message_Function_glBlendFunc;
-  static const Function glBlendFuncSeparate = Message_Function_glBlendFuncSeparate;
-  static const Function glBufferData = Message_Function_glBufferData;
-  static const Function glBufferSubData = Message_Function_glBufferSubData;
-  static const Function glCheckFramebufferStatus = Message_Function_glCheckFramebufferStatus;
-  static const Function glClear = Message_Function_glClear;
-  static const Function glClearColor = Message_Function_glClearColor;
-  static const Function glClearDepthf = Message_Function_glClearDepthf;
-  static const Function glClearStencil = Message_Function_glClearStencil;
-  static const Function glColorMask = Message_Function_glColorMask;
-  static const Function glCompileShader = Message_Function_glCompileShader;
-  static const Function glCompressedTexImage2D = Message_Function_glCompressedTexImage2D;
-  static const Function glCompressedTexSubImage2D = Message_Function_glCompressedTexSubImage2D;
-  static const Function glCopyTexImage2D = Message_Function_glCopyTexImage2D;
-  static const Function glCopyTexSubImage2D = Message_Function_glCopyTexSubImage2D;
-  static const Function glCreateProgram = Message_Function_glCreateProgram;
-  static const Function glCreateShader = Message_Function_glCreateShader;
-  static const Function glCullFace = Message_Function_glCullFace;
-  static const Function glDeleteBuffers = Message_Function_glDeleteBuffers;
-  static const Function glDeleteFramebuffers = Message_Function_glDeleteFramebuffers;
-  static const Function glDeleteProgram = Message_Function_glDeleteProgram;
-  static const Function glDeleteRenderbuffers = Message_Function_glDeleteRenderbuffers;
-  static const Function glDeleteShader = Message_Function_glDeleteShader;
-  static const Function glDeleteTextures = Message_Function_glDeleteTextures;
-  static const Function glDepthFunc = Message_Function_glDepthFunc;
-  static const Function glDepthMask = Message_Function_glDepthMask;
-  static const Function glDepthRangef = Message_Function_glDepthRangef;
-  static const Function glDetachShader = Message_Function_glDetachShader;
-  static const Function glDisable = Message_Function_glDisable;
-  static const Function glDisableVertexAttribArray = Message_Function_glDisableVertexAttribArray;
-  static const Function glDrawArrays = Message_Function_glDrawArrays;
-  static const Function glDrawElements = Message_Function_glDrawElements;
-  static const Function glEnable = Message_Function_glEnable;
-  static const Function glEnableVertexAttribArray = Message_Function_glEnableVertexAttribArray;
-  static const Function glFinish = Message_Function_glFinish;
-  static const Function glFlush = Message_Function_glFlush;
-  static const Function glFramebufferRenderbuffer = Message_Function_glFramebufferRenderbuffer;
-  static const Function glFramebufferTexture2D = Message_Function_glFramebufferTexture2D;
-  static const Function glFrontFace = Message_Function_glFrontFace;
-  static const Function glGenBuffers = Message_Function_glGenBuffers;
-  static const Function glGenerateMipmap = Message_Function_glGenerateMipmap;
-  static const Function glGenFramebuffers = Message_Function_glGenFramebuffers;
-  static const Function glGenRenderbuffers = Message_Function_glGenRenderbuffers;
-  static const Function glGenTextures = Message_Function_glGenTextures;
-  static const Function glGetActiveAttrib = Message_Function_glGetActiveAttrib;
-  static const Function glGetActiveUniform = Message_Function_glGetActiveUniform;
-  static const Function glGetAttachedShaders = Message_Function_glGetAttachedShaders;
-  static const Function glGetAttribLocation = Message_Function_glGetAttribLocation;
-  static const Function glGetBooleanv = Message_Function_glGetBooleanv;
-  static const Function glGetBufferParameteriv = Message_Function_glGetBufferParameteriv;
-  static const Function glGetError = Message_Function_glGetError;
-  static const Function glGetFloatv = Message_Function_glGetFloatv;
-  static const Function glGetFramebufferAttachmentParameteriv = Message_Function_glGetFramebufferAttachmentParameteriv;
-  static const Function glGetIntegerv = Message_Function_glGetIntegerv;
-  static const Function glGetProgramiv = Message_Function_glGetProgramiv;
-  static const Function glGetProgramInfoLog = Message_Function_glGetProgramInfoLog;
-  static const Function glGetRenderbufferParameteriv = Message_Function_glGetRenderbufferParameteriv;
-  static const Function glGetShaderiv = Message_Function_glGetShaderiv;
-  static const Function glGetShaderInfoLog = Message_Function_glGetShaderInfoLog;
-  static const Function glGetShaderPrecisionFormat = Message_Function_glGetShaderPrecisionFormat;
-  static const Function glGetShaderSource = Message_Function_glGetShaderSource;
-  static const Function glGetString = Message_Function_glGetString;
-  static const Function glGetTexParameterfv = Message_Function_glGetTexParameterfv;
-  static const Function glGetTexParameteriv = Message_Function_glGetTexParameteriv;
-  static const Function glGetUniformfv = Message_Function_glGetUniformfv;
-  static const Function glGetUniformiv = Message_Function_glGetUniformiv;
-  static const Function glGetUniformLocation = Message_Function_glGetUniformLocation;
-  static const Function glGetVertexAttribfv = Message_Function_glGetVertexAttribfv;
-  static const Function glGetVertexAttribiv = Message_Function_glGetVertexAttribiv;
-  static const Function glGetVertexAttribPointerv = Message_Function_glGetVertexAttribPointerv;
-  static const Function glHint = Message_Function_glHint;
-  static const Function glIsBuffer = Message_Function_glIsBuffer;
-  static const Function glIsEnabled = Message_Function_glIsEnabled;
-  static const Function glIsFramebuffer = Message_Function_glIsFramebuffer;
-  static const Function glIsProgram = Message_Function_glIsProgram;
-  static const Function glIsRenderbuffer = Message_Function_glIsRenderbuffer;
-  static const Function glIsShader = Message_Function_glIsShader;
-  static const Function glIsTexture = Message_Function_glIsTexture;
-  static const Function glLineWidth = Message_Function_glLineWidth;
-  static const Function glLinkProgram = Message_Function_glLinkProgram;
-  static const Function glPixelStorei = Message_Function_glPixelStorei;
-  static const Function glPolygonOffset = Message_Function_glPolygonOffset;
-  static const Function glReadPixels = Message_Function_glReadPixels;
-  static const Function glReleaseShaderCompiler = Message_Function_glReleaseShaderCompiler;
-  static const Function glRenderbufferStorage = Message_Function_glRenderbufferStorage;
-  static const Function glSampleCoverage = Message_Function_glSampleCoverage;
-  static const Function glScissor = Message_Function_glScissor;
-  static const Function glShaderBinary = Message_Function_glShaderBinary;
-  static const Function glShaderSource = Message_Function_glShaderSource;
-  static const Function glStencilFunc = Message_Function_glStencilFunc;
-  static const Function glStencilFuncSeparate = Message_Function_glStencilFuncSeparate;
-  static const Function glStencilMask = Message_Function_glStencilMask;
-  static const Function glStencilMaskSeparate = Message_Function_glStencilMaskSeparate;
-  static const Function glStencilOp = Message_Function_glStencilOp;
-  static const Function glStencilOpSeparate = Message_Function_glStencilOpSeparate;
-  static const Function glTexImage2D = Message_Function_glTexImage2D;
-  static const Function glTexParameterf = Message_Function_glTexParameterf;
-  static const Function glTexParameterfv = Message_Function_glTexParameterfv;
-  static const Function glTexParameteri = Message_Function_glTexParameteri;
-  static const Function glTexParameteriv = Message_Function_glTexParameteriv;
-  static const Function glTexSubImage2D = Message_Function_glTexSubImage2D;
-  static const Function glUniform1f = Message_Function_glUniform1f;
-  static const Function glUniform1fv = Message_Function_glUniform1fv;
-  static const Function glUniform1i = Message_Function_glUniform1i;
-  static const Function glUniform1iv = Message_Function_glUniform1iv;
-  static const Function glUniform2f = Message_Function_glUniform2f;
-  static const Function glUniform2fv = Message_Function_glUniform2fv;
-  static const Function glUniform2i = Message_Function_glUniform2i;
-  static const Function glUniform2iv = Message_Function_glUniform2iv;
-  static const Function glUniform3f = Message_Function_glUniform3f;
-  static const Function glUniform3fv = Message_Function_glUniform3fv;
-  static const Function glUniform3i = Message_Function_glUniform3i;
-  static const Function glUniform3iv = Message_Function_glUniform3iv;
-  static const Function glUniform4f = Message_Function_glUniform4f;
-  static const Function glUniform4fv = Message_Function_glUniform4fv;
-  static const Function glUniform4i = Message_Function_glUniform4i;
-  static const Function glUniform4iv = Message_Function_glUniform4iv;
-  static const Function glUniformMatrix2fv = Message_Function_glUniformMatrix2fv;
-  static const Function glUniformMatrix3fv = Message_Function_glUniformMatrix3fv;
-  static const Function glUniformMatrix4fv = Message_Function_glUniformMatrix4fv;
-  static const Function glUseProgram = Message_Function_glUseProgram;
-  static const Function glValidateProgram = Message_Function_glValidateProgram;
-  static const Function glVertexAttrib1f = Message_Function_glVertexAttrib1f;
-  static const Function glVertexAttrib1fv = Message_Function_glVertexAttrib1fv;
-  static const Function glVertexAttrib2f = Message_Function_glVertexAttrib2f;
-  static const Function glVertexAttrib2fv = Message_Function_glVertexAttrib2fv;
-  static const Function glVertexAttrib3f = Message_Function_glVertexAttrib3f;
-  static const Function glVertexAttrib3fv = Message_Function_glVertexAttrib3fv;
-  static const Function glVertexAttrib4f = Message_Function_glVertexAttrib4f;
-  static const Function glVertexAttrib4fv = Message_Function_glVertexAttrib4fv;
-  static const Function glVertexAttribPointer = Message_Function_glVertexAttribPointer;
-  static const Function glViewport = Message_Function_glViewport;
-  static const Function eglGetDisplay = Message_Function_eglGetDisplay;
-  static const Function eglInitialize = Message_Function_eglInitialize;
-  static const Function eglTerminate = Message_Function_eglTerminate;
-  static const Function eglGetConfigs = Message_Function_eglGetConfigs;
-  static const Function eglChooseConfig = Message_Function_eglChooseConfig;
-  static const Function eglGetConfigAttrib = Message_Function_eglGetConfigAttrib;
-  static const Function eglCreateWindowSurface = Message_Function_eglCreateWindowSurface;
-  static const Function eglCreatePixmapSurface = Message_Function_eglCreatePixmapSurface;
-  static const Function eglCreatePbufferSurface = Message_Function_eglCreatePbufferSurface;
-  static const Function eglDestroySurface = Message_Function_eglDestroySurface;
-  static const Function eglQuerySurface = Message_Function_eglQuerySurface;
-  static const Function eglCreateContext = Message_Function_eglCreateContext;
-  static const Function eglDestroyContext = Message_Function_eglDestroyContext;
-  static const Function eglMakeCurrent = Message_Function_eglMakeCurrent;
-  static const Function eglGetCurrentContext = Message_Function_eglGetCurrentContext;
-  static const Function eglGetCurrentSurface = Message_Function_eglGetCurrentSurface;
-  static const Function eglGetCurrentDisplay = Message_Function_eglGetCurrentDisplay;
-  static const Function eglQueryContext = Message_Function_eglQueryContext;
-  static const Function eglWaitGL = Message_Function_eglWaitGL;
-  static const Function eglWaitNative = Message_Function_eglWaitNative;
-  static const Function eglSwapBuffers = Message_Function_eglSwapBuffers;
-  static const Function eglCopyBuffers = Message_Function_eglCopyBuffers;
-  static const Function eglGetError = Message_Function_eglGetError;
-  static const Function eglQueryString = Message_Function_eglQueryString;
-  static const Function eglGetProcAddress = Message_Function_eglGetProcAddress;
-  static const Function eglSurfaceAttrib = Message_Function_eglSurfaceAttrib;
-  static const Function eglBindTexImage = Message_Function_eglBindTexImage;
-  static const Function eglReleaseTexImage = Message_Function_eglReleaseTexImage;
-  static const Function eglSwapInterval = Message_Function_eglSwapInterval;
-  static const Function eglBindAPI = Message_Function_eglBindAPI;
-  static const Function eglQueryAPI = Message_Function_eglQueryAPI;
-  static const Function eglWaitClient = Message_Function_eglWaitClient;
-  static const Function eglReleaseThread = Message_Function_eglReleaseThread;
-  static const Function eglCreatePbufferFromClientBuffer = Message_Function_eglCreatePbufferFromClientBuffer;
-  static const Function eglLockSurfaceKHR = Message_Function_eglLockSurfaceKHR;
-  static const Function eglUnlockSurfaceKHR = Message_Function_eglUnlockSurfaceKHR;
-  static const Function eglCreateImageKHR = Message_Function_eglCreateImageKHR;
-  static const Function eglDestroyImageKHR = Message_Function_eglDestroyImageKHR;
-  static const Function eglCreateSyncKHR = Message_Function_eglCreateSyncKHR;
-  static const Function eglDestroySyncKHR = Message_Function_eglDestroySyncKHR;
-  static const Function eglClientWaitSyncKHR = Message_Function_eglClientWaitSyncKHR;
-  static const Function eglGetSyncAttribKHR = Message_Function_eglGetSyncAttribKHR;
-  static const Function eglSetSwapRectangleANDROID = Message_Function_eglSetSwapRectangleANDROID;
-  static const Function eglGetRenderBufferANDROID = Message_Function_eglGetRenderBufferANDROID;
-  static const Function ACK = Message_Function_ACK;
-  static const Function NEG = Message_Function_NEG;
-  static const Function CONTINUE = Message_Function_CONTINUE;
-  static const Function SKIP = Message_Function_SKIP;
-  static const Function SETPROP = Message_Function_SETPROP;
-  static inline bool Function_IsValid(int value) {
-    return Message_Function_IsValid(value);
-  }
-  static const Function Function_MIN =
-    Message_Function_Function_MIN;
-  static const Function Function_MAX =
-    Message_Function_Function_MAX;
-  static const int Function_ARRAYSIZE =
-    Message_Function_Function_ARRAYSIZE;
-  
-  typedef Message_Type Type;
-  static const Type BeforeCall = Message_Type_BeforeCall;
-  static const Type AfterCall = Message_Type_AfterCall;
-  static const Type AfterGeneratedCall = Message_Type_AfterGeneratedCall;
-  static const Type Response = Message_Type_Response;
-  static const Type CompleteCall = Message_Type_CompleteCall;
-  static inline bool Type_IsValid(int value) {
-    return Message_Type_IsValid(value);
-  }
-  static const Type Type_MIN =
-    Message_Type_Type_MIN;
-  static const Type Type_MAX =
-    Message_Type_Type_MAX;
-  static const int Type_ARRAYSIZE =
-    Message_Type_Type_ARRAYSIZE;
-  
-  typedef Message_DataType DataType;
-  static const DataType ReferencedImage = Message_DataType_ReferencedImage;
-  static const DataType NonreferencedImage = Message_DataType_NonreferencedImage;
-  static inline bool DataType_IsValid(int value) {
-    return Message_DataType_IsValid(value);
-  }
-  static const DataType DataType_MIN =
-    Message_DataType_DataType_MIN;
-  static const DataType DataType_MAX =
-    Message_DataType_DataType_MAX;
-  static const int DataType_ARRAYSIZE =
-    Message_DataType_DataType_ARRAYSIZE;
-  
-  typedef Message_Prop Prop;
-  static const Prop CaptureDraw = Message_Prop_CaptureDraw;
-  static const Prop TimeMode = Message_Prop_TimeMode;
-  static const Prop ExpectResponse = Message_Prop_ExpectResponse;
-  static const Prop CaptureSwap = Message_Prop_CaptureSwap;
-  static const Prop GLConstant = Message_Prop_GLConstant;
-  static inline bool Prop_IsValid(int value) {
-    return Message_Prop_IsValid(value);
-  }
-  static const Prop Prop_MIN =
-    Message_Prop_Prop_MIN;
-  static const Prop Prop_MAX =
-    Message_Prop_Prop_MAX;
-  static const int Prop_ARRAYSIZE =
-    Message_Prop_Prop_ARRAYSIZE;
-  
-  // accessors -------------------------------------------------------
-  
-  // required int32 context_id = 1;
-  inline bool has_context_id() const;
-  inline void clear_context_id();
-  static const int kContextIdFieldNumber = 1;
-  inline ::google::protobuf::int32 context_id() const;
-  inline void set_context_id(::google::protobuf::int32 value);
-  
-  // required .com.android.glesv2debugger.Message.Function function = 2 [default = NEG];
-  inline bool has_function() const;
-  inline void clear_function();
-  static const int kFunctionFieldNumber = 2;
-  inline ::com::android::glesv2debugger::Message_Function function() const;
-  inline void set_function(::com::android::glesv2debugger::Message_Function value);
-  
-  // required .com.android.glesv2debugger.Message.Type type = 3;
-  inline bool has_type() const;
-  inline void clear_type();
-  static const int kTypeFieldNumber = 3;
-  inline ::com::android::glesv2debugger::Message_Type type() const;
-  inline void set_type(::com::android::glesv2debugger::Message_Type value);
-  
-  // required bool expect_response = 4;
-  inline bool has_expect_response() const;
-  inline void clear_expect_response();
-  static const int kExpectResponseFieldNumber = 4;
-  inline bool expect_response() const;
-  inline void set_expect_response(bool value);
-  
-  // optional int32 ret = 5;
-  inline bool has_ret() const;
-  inline void clear_ret();
-  static const int kRetFieldNumber = 5;
-  inline ::google::protobuf::int32 ret() const;
-  inline void set_ret(::google::protobuf::int32 value);
-  
-  // optional int32 arg0 = 6;
-  inline bool has_arg0() const;
-  inline void clear_arg0();
-  static const int kArg0FieldNumber = 6;
-  inline ::google::protobuf::int32 arg0() const;
-  inline void set_arg0(::google::protobuf::int32 value);
-  
-  // optional int32 arg1 = 7;
-  inline bool has_arg1() const;
-  inline void clear_arg1();
-  static const int kArg1FieldNumber = 7;
-  inline ::google::protobuf::int32 arg1() const;
-  inline void set_arg1(::google::protobuf::int32 value);
-  
-  // optional int32 arg2 = 8;
-  inline bool has_arg2() const;
-  inline void clear_arg2();
-  static const int kArg2FieldNumber = 8;
-  inline ::google::protobuf::int32 arg2() const;
-  inline void set_arg2(::google::protobuf::int32 value);
-  
-  // optional int32 arg3 = 9;
-  inline bool has_arg3() const;
-  inline void clear_arg3();
-  static const int kArg3FieldNumber = 9;
-  inline ::google::protobuf::int32 arg3() const;
-  inline void set_arg3(::google::protobuf::int32 value);
-  
-  // optional int32 arg4 = 16;
-  inline bool has_arg4() const;
-  inline void clear_arg4();
-  static const int kArg4FieldNumber = 16;
-  inline ::google::protobuf::int32 arg4() const;
-  inline void set_arg4(::google::protobuf::int32 value);
-  
-  // optional int32 arg5 = 17;
-  inline bool has_arg5() const;
-  inline void clear_arg5();
-  static const int kArg5FieldNumber = 17;
-  inline ::google::protobuf::int32 arg5() const;
-  inline void set_arg5(::google::protobuf::int32 value);
-  
-  // optional int32 arg6 = 18;
-  inline bool has_arg6() const;
-  inline void clear_arg6();
-  static const int kArg6FieldNumber = 18;
-  inline ::google::protobuf::int32 arg6() const;
-  inline void set_arg6(::google::protobuf::int32 value);
-  
-  // optional int32 arg7 = 19;
-  inline bool has_arg7() const;
-  inline void clear_arg7();
-  static const int kArg7FieldNumber = 19;
-  inline ::google::protobuf::int32 arg7() const;
-  inline void set_arg7(::google::protobuf::int32 value);
-  
-  // optional int32 arg8 = 20;
-  inline bool has_arg8() const;
-  inline void clear_arg8();
-  static const int kArg8FieldNumber = 20;
-  inline ::google::protobuf::int32 arg8() const;
-  inline void set_arg8(::google::protobuf::int32 value);
-  
-  // optional bytes data = 10;
-  inline bool has_data() const;
-  inline void clear_data();
-  static const int kDataFieldNumber = 10;
-  inline const ::std::string& data() const;
-  inline void set_data(const ::std::string& value);
-  inline void set_data(const char* value);
-  inline void set_data(const void* value, size_t size);
-  inline ::std::string* mutable_data();
-  
-  // optional .com.android.glesv2debugger.Message.DataType data_type = 23;
-  inline bool has_data_type() const;
-  inline void clear_data_type();
-  static const int kDataTypeFieldNumber = 23;
-  inline ::com::android::glesv2debugger::Message_DataType data_type() const;
-  inline void set_data_type(::com::android::glesv2debugger::Message_DataType value);
-  
-  // optional int32 pixel_format = 24;
-  inline bool has_pixel_format() const;
-  inline void clear_pixel_format();
-  static const int kPixelFormatFieldNumber = 24;
-  inline ::google::protobuf::int32 pixel_format() const;
-  inline void set_pixel_format(::google::protobuf::int32 value);
-  
-  // optional int32 pixel_type = 25;
-  inline bool has_pixel_type() const;
-  inline void clear_pixel_type();
-  static const int kPixelTypeFieldNumber = 25;
-  inline ::google::protobuf::int32 pixel_type() const;
-  inline void set_pixel_type(::google::protobuf::int32 value);
-  
-  // optional int32 image_width = 26;
-  inline bool has_image_width() const;
-  inline void clear_image_width();
-  static const int kImageWidthFieldNumber = 26;
-  inline ::google::protobuf::int32 image_width() const;
-  inline void set_image_width(::google::protobuf::int32 value);
-  
-  // optional int32 image_height = 27;
-  inline bool has_image_height() const;
-  inline void clear_image_height();
-  static const int kImageHeightFieldNumber = 27;
-  inline ::google::protobuf::int32 image_height() const;
-  inline void set_image_height(::google::protobuf::int32 value);
-  
-  // optional float time = 11;
-  inline bool has_time() const;
-  inline void clear_time();
-  static const int kTimeFieldNumber = 11;
-  inline float time() const;
-  inline void set_time(float value);
-  
-  // optional .com.android.glesv2debugger.Message.Prop prop = 21;
-  inline bool has_prop() const;
-  inline void clear_prop();
-  static const int kPropFieldNumber = 21;
-  inline ::com::android::glesv2debugger::Message_Prop prop() const;
-  inline void set_prop(::com::android::glesv2debugger::Message_Prop value);
-  
-  // optional float clock = 22;
-  inline bool has_clock() const;
-  inline void clear_clock();
-  static const int kClockFieldNumber = 22;
-  inline float clock() const;
-  inline void set_clock(float value);
-  
-  // @@protoc_insertion_point(class_scope:com.android.glesv2debugger.Message)
- private:
-  mutable int _cached_size_;
-  
-  ::google::protobuf::int32 context_id_;
-  int function_;
-  int type_;
-  bool expect_response_;
-  ::google::protobuf::int32 ret_;
-  ::google::protobuf::int32 arg0_;
-  ::google::protobuf::int32 arg1_;
-  ::google::protobuf::int32 arg2_;
-  ::google::protobuf::int32 arg3_;
-  ::google::protobuf::int32 arg4_;
-  ::google::protobuf::int32 arg5_;
-  ::google::protobuf::int32 arg6_;
-  ::google::protobuf::int32 arg7_;
-  ::google::protobuf::int32 arg8_;
-  ::std::string* data_;
-  static const ::std::string _default_data_;
-  int data_type_;
-  ::google::protobuf::int32 pixel_format_;
-  ::google::protobuf::int32 pixel_type_;
-  ::google::protobuf::int32 image_width_;
-  ::google::protobuf::int32 image_height_;
-  float time_;
-  int prop_;
-  float clock_;
-  friend void  protobuf_AddDesc_debugger_5fmessage_2eproto();
-  friend void protobuf_AssignDesc_debugger_5fmessage_2eproto();
-  friend void protobuf_ShutdownFile_debugger_5fmessage_2eproto();
-  
-  ::google::protobuf::uint32 _has_bits_[(23 + 31) / 32];
-  
-  // WHY DOES & HAVE LOWER PRECEDENCE THAN != !?
-  inline bool _has_bit(int index) const {
-    return (_has_bits_[index / 32] & (1u << (index % 32))) != 0;
-  }
-  inline void _set_bit(int index) {
-    _has_bits_[index / 32] |= (1u << (index % 32));
-  }
-  inline void _clear_bit(int index) {
-    _has_bits_[index / 32] &= ~(1u << (index % 32));
-  }
-  
-  void InitAsDefaultInstance();
-  static Message* default_instance_;
-};
-// ===================================================================
-
-
-// ===================================================================
-
-// Message
-
-// required int32 context_id = 1;
-inline bool Message::has_context_id() const {
-  return _has_bit(0);
-}
-inline void Message::clear_context_id() {
-  context_id_ = 0;
-  _clear_bit(0);
-}
-inline ::google::protobuf::int32 Message::context_id() const {
-  return context_id_;
-}
-inline void Message::set_context_id(::google::protobuf::int32 value) {
-  _set_bit(0);
-  context_id_ = value;
-}
-
-// required .com.android.glesv2debugger.Message.Function function = 2 [default = NEG];
-inline bool Message::has_function() const {
-  return _has_bit(1);
-}
-inline void Message::clear_function() {
-  function_ = 187;
-  _clear_bit(1);
-}
-inline ::com::android::glesv2debugger::Message_Function Message::function() const {
-  return static_cast< ::com::android::glesv2debugger::Message_Function >(function_);
-}
-inline void Message::set_function(::com::android::glesv2debugger::Message_Function value) {
-  GOOGLE_DCHECK(::com::android::glesv2debugger::Message_Function_IsValid(value));
-  _set_bit(1);
-  function_ = value;
-}
-
-// required .com.android.glesv2debugger.Message.Type type = 3;
-inline bool Message::has_type() const {
-  return _has_bit(2);
-}
-inline void Message::clear_type() {
-  type_ = 0;
-  _clear_bit(2);
-}
-inline ::com::android::glesv2debugger::Message_Type Message::type() const {
-  return static_cast< ::com::android::glesv2debugger::Message_Type >(type_);
-}
-inline void Message::set_type(::com::android::glesv2debugger::Message_Type value) {
-  GOOGLE_DCHECK(::com::android::glesv2debugger::Message_Type_IsValid(value));
-  _set_bit(2);
-  type_ = value;
-}
-
-// required bool expect_response = 4;
-inline bool Message::has_expect_response() const {
-  return _has_bit(3);
-}
-inline void Message::clear_expect_response() {
-  expect_response_ = false;
-  _clear_bit(3);
-}
-inline bool Message::expect_response() const {
-  return expect_response_;
-}
-inline void Message::set_expect_response(bool value) {
-  _set_bit(3);
-  expect_response_ = value;
-}
-
-// optional int32 ret = 5;
-inline bool Message::has_ret() const {
-  return _has_bit(4);
-}
-inline void Message::clear_ret() {
-  ret_ = 0;
-  _clear_bit(4);
-}
-inline ::google::protobuf::int32 Message::ret() const {
-  return ret_;
-}
-inline void Message::set_ret(::google::protobuf::int32 value) {
-  _set_bit(4);
-  ret_ = value;
-}
-
-// optional int32 arg0 = 6;
-inline bool Message::has_arg0() const {
-  return _has_bit(5);
-}
-inline void Message::clear_arg0() {
-  arg0_ = 0;
-  _clear_bit(5);
-}
-inline ::google::protobuf::int32 Message::arg0() const {
-  return arg0_;
-}
-inline void Message::set_arg0(::google::protobuf::int32 value) {
-  _set_bit(5);
-  arg0_ = value;
-}
-
-// optional int32 arg1 = 7;
-inline bool Message::has_arg1() const {
-  return _has_bit(6);
-}
-inline void Message::clear_arg1() {
-  arg1_ = 0;
-  _clear_bit(6);
-}
-inline ::google::protobuf::int32 Message::arg1() const {
-  return arg1_;
-}
-inline void Message::set_arg1(::google::protobuf::int32 value) {
-  _set_bit(6);
-  arg1_ = value;
-}
-
-// optional int32 arg2 = 8;
-inline bool Message::has_arg2() const {
-  return _has_bit(7);
-}
-inline void Message::clear_arg2() {
-  arg2_ = 0;
-  _clear_bit(7);
-}
-inline ::google::protobuf::int32 Message::arg2() const {
-  return arg2_;
-}
-inline void Message::set_arg2(::google::protobuf::int32 value) {
-  _set_bit(7);
-  arg2_ = value;
-}
-
-// optional int32 arg3 = 9;
-inline bool Message::has_arg3() const {
-  return _has_bit(8);
-}
-inline void Message::clear_arg3() {
-  arg3_ = 0;
-  _clear_bit(8);
-}
-inline ::google::protobuf::int32 Message::arg3() const {
-  return arg3_;
-}
-inline void Message::set_arg3(::google::protobuf::int32 value) {
-  _set_bit(8);
-  arg3_ = value;
-}
-
-// optional int32 arg4 = 16;
-inline bool Message::has_arg4() const {
-  return _has_bit(9);
-}
-inline void Message::clear_arg4() {
-  arg4_ = 0;
-  _clear_bit(9);
-}
-inline ::google::protobuf::int32 Message::arg4() const {
-  return arg4_;
-}
-inline void Message::set_arg4(::google::protobuf::int32 value) {
-  _set_bit(9);
-  arg4_ = value;
-}
-
-// optional int32 arg5 = 17;
-inline bool Message::has_arg5() const {
-  return _has_bit(10);
-}
-inline void Message::clear_arg5() {
-  arg5_ = 0;
-  _clear_bit(10);
-}
-inline ::google::protobuf::int32 Message::arg5() const {
-  return arg5_;
-}
-inline void Message::set_arg5(::google::protobuf::int32 value) {
-  _set_bit(10);
-  arg5_ = value;
-}
-
-// optional int32 arg6 = 18;
-inline bool Message::has_arg6() const {
-  return _has_bit(11);
-}
-inline void Message::clear_arg6() {
-  arg6_ = 0;
-  _clear_bit(11);
-}
-inline ::google::protobuf::int32 Message::arg6() const {
-  return arg6_;
-}
-inline void Message::set_arg6(::google::protobuf::int32 value) {
-  _set_bit(11);
-  arg6_ = value;
-}
-
-// optional int32 arg7 = 19;
-inline bool Message::has_arg7() const {
-  return _has_bit(12);
-}
-inline void Message::clear_arg7() {
-  arg7_ = 0;
-  _clear_bit(12);
-}
-inline ::google::protobuf::int32 Message::arg7() const {
-  return arg7_;
-}
-inline void Message::set_arg7(::google::protobuf::int32 value) {
-  _set_bit(12);
-  arg7_ = value;
-}
-
-// optional int32 arg8 = 20;
-inline bool Message::has_arg8() const {
-  return _has_bit(13);
-}
-inline void Message::clear_arg8() {
-  arg8_ = 0;
-  _clear_bit(13);
-}
-inline ::google::protobuf::int32 Message::arg8() const {
-  return arg8_;
-}
-inline void Message::set_arg8(::google::protobuf::int32 value) {
-  _set_bit(13);
-  arg8_ = value;
-}
-
-// optional bytes data = 10;
-inline bool Message::has_data() const {
-  return _has_bit(14);
-}
-inline void Message::clear_data() {
-  if (data_ != &_default_data_) {
-    data_->clear();
-  }
-  _clear_bit(14);
-}
-inline const ::std::string& Message::data() const {
-  return *data_;
-}
-inline void Message::set_data(const ::std::string& value) {
-  _set_bit(14);
-  if (data_ == &_default_data_) {
-    data_ = new ::std::string;
-  }
-  data_->assign(value);
-}
-inline void Message::set_data(const char* value) {
-  _set_bit(14);
-  if (data_ == &_default_data_) {
-    data_ = new ::std::string;
-  }
-  data_->assign(value);
-}
-inline void Message::set_data(const void* value, size_t size) {
-  _set_bit(14);
-  if (data_ == &_default_data_) {
-    data_ = new ::std::string;
-  }
-  data_->assign(reinterpret_cast<const char*>(value), size);
-}
-inline ::std::string* Message::mutable_data() {
-  _set_bit(14);
-  if (data_ == &_default_data_) {
-    data_ = new ::std::string;
-  }
-  return data_;
-}
-
-// optional .com.android.glesv2debugger.Message.DataType data_type = 23;
-inline bool Message::has_data_type() const {
-  return _has_bit(15);
-}
-inline void Message::clear_data_type() {
-  data_type_ = 0;
-  _clear_bit(15);
-}
-inline ::com::android::glesv2debugger::Message_DataType Message::data_type() const {
-  return static_cast< ::com::android::glesv2debugger::Message_DataType >(data_type_);
-}
-inline void Message::set_data_type(::com::android::glesv2debugger::Message_DataType value) {
-  GOOGLE_DCHECK(::com::android::glesv2debugger::Message_DataType_IsValid(value));
-  _set_bit(15);
-  data_type_ = value;
-}
-
-// optional int32 pixel_format = 24;
-inline bool Message::has_pixel_format() const {
-  return _has_bit(16);
-}
-inline void Message::clear_pixel_format() {
-  pixel_format_ = 0;
-  _clear_bit(16);
-}
-inline ::google::protobuf::int32 Message::pixel_format() const {
-  return pixel_format_;
-}
-inline void Message::set_pixel_format(::google::protobuf::int32 value) {
-  _set_bit(16);
-  pixel_format_ = value;
-}
-
-// optional int32 pixel_type = 25;
-inline bool Message::has_pixel_type() const {
-  return _has_bit(17);
-}
-inline void Message::clear_pixel_type() {
-  pixel_type_ = 0;
-  _clear_bit(17);
-}
-inline ::google::protobuf::int32 Message::pixel_type() const {
-  return pixel_type_;
-}
-inline void Message::set_pixel_type(::google::protobuf::int32 value) {
-  _set_bit(17);
-  pixel_type_ = value;
-}
-
-// optional int32 image_width = 26;
-inline bool Message::has_image_width() const {
-  return _has_bit(18);
-}
-inline void Message::clear_image_width() {
-  image_width_ = 0;
-  _clear_bit(18);
-}
-inline ::google::protobuf::int32 Message::image_width() const {
-  return image_width_;
-}
-inline void Message::set_image_width(::google::protobuf::int32 value) {
-  _set_bit(18);
-  image_width_ = value;
-}
-
-// optional int32 image_height = 27;
-inline bool Message::has_image_height() const {
-  return _has_bit(19);
-}
-inline void Message::clear_image_height() {
-  image_height_ = 0;
-  _clear_bit(19);
-}
-inline ::google::protobuf::int32 Message::image_height() const {
-  return image_height_;
-}
-inline void Message::set_image_height(::google::protobuf::int32 value) {
-  _set_bit(19);
-  image_height_ = value;
-}
-
-// optional float time = 11;
-inline bool Message::has_time() const {
-  return _has_bit(20);
-}
-inline void Message::clear_time() {
-  time_ = 0;
-  _clear_bit(20);
-}
-inline float Message::time() const {
-  return time_;
-}
-inline void Message::set_time(float value) {
-  _set_bit(20);
-  time_ = value;
-}
-
-// optional .com.android.glesv2debugger.Message.Prop prop = 21;
-inline bool Message::has_prop() const {
-  return _has_bit(21);
-}
-inline void Message::clear_prop() {
-  prop_ = 0;
-  _clear_bit(21);
-}
-inline ::com::android::glesv2debugger::Message_Prop Message::prop() const {
-  return static_cast< ::com::android::glesv2debugger::Message_Prop >(prop_);
-}
-inline void Message::set_prop(::com::android::glesv2debugger::Message_Prop value) {
-  GOOGLE_DCHECK(::com::android::glesv2debugger::Message_Prop_IsValid(value));
-  _set_bit(21);
-  prop_ = value;
-}
-
-// optional float clock = 22;
-inline bool Message::has_clock() const {
-  return _has_bit(22);
-}
-inline void Message::clear_clock() {
-  clock_ = 0;
-  _clear_bit(22);
-}
-inline float Message::clock() const {
-  return clock_;
-}
-inline void Message::set_clock(float value) {
-  _set_bit(22);
-  clock_ = value;
-}
-
-
-// @@protoc_insertion_point(namespace_scope)
-
-}  // namespace glesv2debugger
-}  // namespace android
-}  // namespace com
-
-// @@protoc_insertion_point(global_scope)
-
-#endif  // PROTOBUF_debugger_5fmessage_2eproto__INCLUDED
diff --git a/opengl/libs/GLES2_dbg/src/egl.cpp b/opengl/libs/GLES2_dbg/src/egl.cpp
deleted file mode 100644
index bbea3bd..0000000
--- a/opengl/libs/GLES2_dbg/src/egl.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- ** Copyright 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.
- */
-
-#include "header.h"
-
-EGLBoolean Debug_eglSwapBuffers(EGLDisplay dpy, EGLSurface draw)
-{
-    DbgContext * const dbg = getDbgContextThreadSpecific();
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        EGLDisplay dpy;
-        EGLSurface draw;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            msg.set_time(-1);
-            return reinterpret_cast<const int *>(true);
-        }
-    } caller;
-    caller.dpy = dpy;
-    caller.draw = draw;
-
-    msg.set_arg0(reinterpret_cast<int>(dpy));
-    msg.set_arg1(reinterpret_cast<int>(draw));
-    if (dbg->captureSwap > 0) {
-        dbg->captureSwap--;
-        int viewport[4] = {};
-        dbg->hooks->gl.glGetIntegerv(GL_VIEWPORT, viewport);
-        void * pixels = dbg->GetReadPixelsBuffer(viewport[2] * viewport[3] *
-                        dbg->readBytesPerPixel);
-        dbg->hooks->gl.glReadPixels(viewport[0], viewport[1], viewport[2],
-                                    viewport[3], GL_RGBA, GL_UNSIGNED_BYTE, pixels);
-        dbg->CompressReadPixelBuffer(msg.mutable_data());
-        msg.set_data_type(msg.ReferencedImage);
-        msg.set_pixel_format(GL_RGBA);
-        msg.set_pixel_type(GL_UNSIGNED_BYTE);
-        msg.set_image_width(viewport[2]);
-        msg.set_image_height(viewport[3]);
-    }
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_eglSwapBuffers);
-    return static_cast<EGLBoolean>(reinterpret_cast<int>(ret));
-}
diff --git a/opengl/libs/GLES2_dbg/src/header.h b/opengl/libs/GLES2_dbg/src/header.h
deleted file mode 100644
index 0ab4890..0000000
--- a/opengl/libs/GLES2_dbg/src/header.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- ** Copyright 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.
- */
-
-#ifndef ANDROID_GLES2_DBG_HEADER_H
-#define ANDROID_GLES2_DBG_HEADER_H
-
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
-
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include <cutils/log.h>
-#include <utils/Timers.h>
-
-#include "hooks.h"
-
-#include "glesv2dbg.h"
-
-#define GL_ENTRY(_r, _api, ...) _r Debug_##_api ( __VA_ARGS__ );
-#include "glesv2dbg_functions.h"
-
-#include "debugger_message.pb.h"
-
-using namespace android;
-using namespace com::android;
-
-#ifndef __location__
-#define __HIERALLOC_STRING_0__(s)   #s
-#define __HIERALLOC_STRING_1__(s)   __HIERALLOC_STRING_0__(s)
-#define __HIERALLOC_STRING_2__      __HIERALLOC_STRING_1__(__LINE__)
-#define __location__                __FILE__ ":" __HIERALLOC_STRING_2__
-#endif
-
-#undef assert
-#define assert(expr) if (!(expr)) { ALOGD("\n*\n*\n* assert: %s at %s \n*\n*", #expr, __location__); int * x = 0; *x = 5; }
-//#undef ALOGD
-//#define ALOGD(...)
-
-namespace android
-{
-
-struct GLFunctionBitfield {
-    unsigned char field [24]; // 8 * 24 = 192
-
-    void Bit(const glesv2debugger::Message_Function function, bool bit) {
-        const unsigned byte = function / 8, mask = 1 << (function % 8);
-        if (bit)
-            field[byte] |= mask;
-        else
-            field[byte] &= ~mask;
-    }
-
-    bool Bit(const glesv2debugger::Message_Function function) const {
-        const unsigned byte = function / 8, mask = 1 << (function % 8);
-        return field[byte] & mask;
-    }
-};
-
-struct DbgContext {
-    static const unsigned int LZF_CHUNK_SIZE = 256 * 1024;
-
-private:
-    char * lzf_buf; // malloc / free; for lzf chunk compression and other uses
-
-    // used as buffer and reference frame for ReadPixels; malloc/free
-    unsigned * lzf_ref [2];
-    unsigned lzf_readIndex; // 0 or 1
-    unsigned lzf_refSize, lzf_refBufSize; // bytes
-
-public:
-    const unsigned int version; // 0 is GLES1, 1 is GLES2
-    const gl_hooks_t * const hooks;
-    const unsigned int MAX_VERTEX_ATTRIBS;
-    const unsigned int readBytesPerPixel;
-
-    unsigned int captureSwap; // number of eglSwapBuffers to glReadPixels
-    unsigned int captureDraw; // number of glDrawArrays/Elements to glReadPixels
-
-    GLFunctionBitfield expectResponse;
-
-    struct VertexAttrib {
-        GLenum type; // element data type
-        unsigned size; // number of data per element
-        unsigned stride; // calculated number of bytes between elements
-        const void * ptr;
-        unsigned elemSize; // calculated number of bytes per element
-        GLuint buffer; // buffer name
-        GLboolean normalized : 1;
-        GLboolean enabled : 1;
-        VertexAttrib() : type(0), size(0), stride(0), ptr(NULL), elemSize(0),
-                buffer(0), normalized(0), enabled(0) {}
-    } * vertexAttribs;
-    bool hasNonVBOAttribs; // whether any enabled vertexAttrib is user pointer
-
-    struct VBO {
-        const GLuint name;
-        const GLenum target;
-        VBO * next;
-        void * data; // malloc/free
-        unsigned size; // in bytes
-        VBO(const GLuint name, const GLenum target, VBO * head) : name(name),
-                target(target), next(head), data(NULL), size(0) {}
-    } * indexBuffers; // linked list of all index buffers
-    VBO * indexBuffer; // currently bound index buffer
-
-    GLuint program;
-    unsigned maxAttrib; // number of slots used by program
-
-    DbgContext(const unsigned version, const gl_hooks_t * const hooks,
-               const unsigned MAX_VERTEX_ATTRIBS);
-    ~DbgContext();
-
-    void Fetch(const unsigned index, std::string * const data) const;
-    void Compress(const void * in_data, unsigned in_len, std::string * const outStr);
-    static unsigned char * Decompress(const void * in, const unsigned int inLen,
-                                      unsigned int * const outLen); // malloc/free
-    void * GetReadPixelsBuffer(const unsigned size);
-    bool IsReadPixelBuffer(const void * const ptr)  {
-        return ptr == lzf_ref[lzf_readIndex];
-    }
-    void CompressReadPixelBuffer(std::string * const outStr);
-    char * GetBuffer(); // allocates lzf_buf if NULL
-    unsigned int GetBufferSize(); // allocates lzf_buf if NULL
-
-    void glUseProgram(GLuint program);
-    void glEnableVertexAttribArray(GLuint index);
-    void glDisableVertexAttribArray(GLuint index);
-    void glVertexAttribPointer(GLuint indx, GLint size, GLenum type,
-                               GLboolean normalized, GLsizei stride, const GLvoid* ptr);
-    void glBindBuffer(GLenum target, GLuint buffer);
-    void glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
-    void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
-    void glDeleteBuffers(GLsizei n, const GLuint *buffers);
-};
-
-DbgContext * getDbgContextThreadSpecific();
-
-struct FunctionCall {
-    virtual const int * operator()(gl_hooks_t::gl_t const * const _c,
-                                   glesv2debugger::Message & msg) = 0;
-    virtual ~FunctionCall() {}
-};
-
-// move these into DbgContext as static
-extern int timeMode; // SYSTEM_TIME_
-
-extern int clientSock, serverSock;
-
-unsigned GetBytesPerPixel(const GLenum format, const GLenum type);
-
-// every Debug_gl* function calls this to send message to client and possibly receive commands
-int * MessageLoop(FunctionCall & functionCall, glesv2debugger::Message & msg,
-                  const glesv2debugger::Message_Function function);
-
-void Receive(glesv2debugger::Message & cmd);
-float Send(const glesv2debugger::Message & msg, glesv2debugger::Message & cmd);
-void SetProp(DbgContext * const dbg, const glesv2debugger::Message & cmd);
-const int * GenerateCall(DbgContext * const dbg, const glesv2debugger::Message & cmd,
-                         glesv2debugger::Message & msg, const int * const prevRet);
-}; // namespace android {
-
-#endif // #ifndef ANDROID_GLES2_DBG_HEADER_H
diff --git a/opengl/libs/GLES2_dbg/src/server.cpp b/opengl/libs/GLES2_dbg/src/server.cpp
deleted file mode 100644
index 3e93697..0000000
--- a/opengl/libs/GLES2_dbg/src/server.cpp
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- ** Copyright 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.
- */
-
-#include <sys/ioctl.h>
-#include <unistd.h>
-#include <sys/socket.h>
-#include <fcntl.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <pthread.h>
-
-#include "header.h"
-
-namespace android
-{
-
-int serverSock = -1, clientSock = -1;
-FILE * file = NULL;
-unsigned int MAX_FILE_SIZE = 0;
-int timeMode = SYSTEM_TIME_THREAD;
-
-static void Die(const char * msg)
-{
-    ALOGD("\n*\n*\n* GLESv2_dbg: Die: %s \n*\n*", msg);
-    StopDebugServer();
-    exit(1);
-}
-
-void StartDebugServer(const unsigned short port, const bool forceUseFile,
-                      const unsigned int maxFileSize, const char * const filePath)
-{
-    MAX_FILE_SIZE = maxFileSize;
-
-    ALOGD("GLESv2_dbg: StartDebugServer");
-    if (serverSock >= 0 || file)
-        return;
-
-    ALOGD("GLESv2_dbg: StartDebugServer create socket");
-    struct sockaddr_in server = {}, client = {};
-
-    /* Create the TCP socket */
-    if (forceUseFile || (serverSock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) {
-        file = fopen(filePath, "wb");
-        if (!file)
-            Die("Failed to create socket and file");
-        else
-            return;
-    }
-    /* Construct the server sockaddr_in structure */
-    server.sin_family = AF_INET;                  /* Internet/IP */
-    server.sin_addr.s_addr = htonl(INADDR_LOOPBACK);   /* Incoming addr */
-    server.sin_port = htons(port);       /* server port */
-
-    /* Bind the server socket */
-    socklen_t sizeofSockaddr_in = sizeof(sockaddr_in);
-    if (bind(serverSock, (struct sockaddr *) &server,
-             sizeof(server)) < 0) {
-        Die("Failed to bind the server socket");
-    }
-    /* Listen on the server socket */
-    if (listen(serverSock, 1) < 0) {
-        Die("Failed to listen on server socket");
-    }
-
-    ALOGD("server started on %d \n", server.sin_port);
-
-
-    /* Wait for client connection */
-    if ((clientSock =
-                accept(serverSock, (struct sockaddr *) &client,
-                       &sizeofSockaddr_in)) < 0) {
-        Die("Failed to accept client connection");
-    }
-
-    ALOGD("Client connected: %s\n", inet_ntoa(client.sin_addr));
-//    fcntl(clientSock, F_SETFL, O_NONBLOCK);
-}
-
-void StopDebugServer()
-{
-    ALOGD("GLESv2_dbg: StopDebugServer");
-    if (clientSock > 0) {
-        close(clientSock);
-        clientSock = -1;
-    }
-    if (serverSock > 0) {
-        close(serverSock);
-        serverSock = -1;
-    }
-    if (file) {
-        fclose(file);
-        file = NULL;
-    }
-}
-
-void Receive(glesv2debugger::Message & cmd)
-{
-    if (clientSock < 0)
-        return;
-    unsigned len = 0;
-    int received = recv(clientSock, &len, 4, MSG_WAITALL);
-    if (received < 0)
-        Die("Failed to receive response length");
-    else if (4 != received) {
-        ALOGD("received %dB: %.8X", received, len);
-        Die("Received length mismatch, expected 4");
-    }
-    static void * buffer = NULL;
-    static unsigned bufferSize = 0;
-    if (bufferSize < len) {
-        buffer = realloc(buffer, len);
-        assert(buffer);
-        bufferSize = len;
-    }
-    received = recv(clientSock, buffer, len, MSG_WAITALL);
-    if (received < 0)
-        Die("Failed to receive response");
-    else if (len != received)
-        Die("Received length mismatch");
-    cmd.Clear();
-    cmd.ParseFromArray(buffer, len);
-}
-
-bool TryReceive(glesv2debugger::Message & cmd)
-{
-    if (clientSock < 0)
-        return false;
-    fd_set readSet;
-    FD_ZERO(&readSet);
-    FD_SET(clientSock, &readSet);
-    timeval timeout;
-    timeout.tv_sec = timeout.tv_usec = 0;
-
-    int rc = select(clientSock + 1, &readSet, NULL, NULL, &timeout);
-    if (rc < 0)
-        Die("failed to select clientSock");
-
-    bool received = false;
-    if (FD_ISSET(clientSock, &readSet)) {
-        ALOGD("TryReceive: avaiable for read");
-        Receive(cmd);
-        return true;
-    }
-    return false;
-}
-
-float Send(const glesv2debugger::Message & msg, glesv2debugger::Message & cmd)
-{
-    // TODO: use per DbgContext send/receive buffer and async socket
-    //  instead of mutex and blocking io; watch out for large messages
-    static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
-    struct Autolock {
-        Autolock() {
-            pthread_mutex_lock(&mutex);
-        }
-        ~Autolock() {
-            pthread_mutex_unlock(&mutex);
-        }
-    } autolock;
-
-    if (msg.function() != glesv2debugger::Message_Function_ACK)
-        assert(msg.has_context_id() && msg.context_id() != 0);
-    static std::string str;
-    msg.SerializeToString(&str);
-    const uint32_t len = str.length();
-    if (clientSock < 0) {
-        if (file) {
-            fwrite(&len, sizeof(len), 1, file);
-            fwrite(str.data(), len, 1, file);
-            if (ftell(file) >= MAX_FILE_SIZE) {
-                fclose(file);
-                Die("MAX_FILE_SIZE reached");
-            }
-        }
-        return 0;
-    }
-    int sent = -1;
-    sent = send(clientSock, &len, sizeof(len), 0);
-    if (sent != sizeof(len)) {
-        ALOGD("actual sent=%d expected=%d clientSock=%d", sent, sizeof(len), clientSock);
-        Die("Failed to send message length");
-    }
-    nsecs_t c0 = systemTime(timeMode);
-    sent = send(clientSock, str.data(), str.length(), 0);
-    float t = (float)ns2ms(systemTime(timeMode) - c0);
-    if (sent != str.length()) {
-        ALOGD("actual sent=%d expected=%d clientSock=%d", sent, str.length(), clientSock);
-        Die("Failed to send message");
-    }
-    // TODO: factor Receive & TryReceive out and into MessageLoop, or add control argument.
-    // mean while, if server is sending a SETPROP then don't try to receive,
-    //  because server will not be processing received command
-    if (msg.function() == msg.SETPROP)
-        return t;
-    // try to receive commands even though not expecting response,
-    //  since client can send SETPROP and other commands anytime
-    if (!msg.expect_response()) {
-        if (TryReceive(cmd)) {
-            if (glesv2debugger::Message_Function_SETPROP == cmd.function())
-                ALOGD("Send: TryReceived SETPROP");
-            else
-                ALOGD("Send: TryReceived %u", cmd.function());
-        }
-    } else
-        Receive(cmd);
-    return t;
-}
-
-void SetProp(DbgContext * const dbg, const glesv2debugger::Message & cmd)
-{
-    switch (cmd.prop()) {
-    case glesv2debugger::Message_Prop_CaptureDraw:
-        ALOGD("SetProp Message_Prop_CaptureDraw %d", cmd.arg0());
-        dbg->captureDraw = cmd.arg0();
-        break;
-    case glesv2debugger::Message_Prop_TimeMode:
-        ALOGD("SetProp Message_Prop_TimeMode %d", cmd.arg0());
-        timeMode = cmd.arg0();
-        break;
-    case glesv2debugger::Message_Prop_ExpectResponse:
-        ALOGD("SetProp Message_Prop_ExpectResponse %d=%d", cmd.arg0(), cmd.arg1());
-        dbg->expectResponse.Bit((glesv2debugger::Message_Function)cmd.arg0(), cmd.arg1());
-        break;
-    case glesv2debugger::Message_Prop_CaptureSwap:
-        ALOGD("SetProp CaptureSwap %d", cmd.arg0());
-        dbg->captureSwap = cmd.arg0();
-        break;
-    default:
-        assert(0);
-    }
-}
-
-int * MessageLoop(FunctionCall & functionCall, glesv2debugger::Message & msg,
-                  const glesv2debugger::Message_Function function)
-{
-    DbgContext * const dbg = getDbgContextThreadSpecific();
-    const int * ret = 0;
-    glesv2debugger::Message cmd;
-    msg.set_context_id(reinterpret_cast<int>(dbg));
-    msg.set_type(glesv2debugger::Message_Type_BeforeCall);
-    bool expectResponse = dbg->expectResponse.Bit(function);
-    msg.set_expect_response(expectResponse);
-    msg.set_function(function);
-
-    // when not exectResponse, set cmd to CONTINUE then SKIP
-    // cmd will be overwritten by received command
-    cmd.set_function(glesv2debugger::Message_Function_CONTINUE);
-    cmd.set_expect_response(expectResponse);
-    glesv2debugger::Message_Function oldCmd = cmd.function();
-    Send(msg, cmd);
-    expectResponse = cmd.expect_response();
-    while (true) {
-        msg.Clear();
-        nsecs_t c0 = systemTime(timeMode);
-        switch (cmd.function()) {
-        case glesv2debugger::Message_Function_CONTINUE:
-            ret = functionCall(&dbg->hooks->gl, msg);
-            while (GLenum error = dbg->hooks->gl.glGetError())
-                ALOGD("Function=%u glGetError() = 0x%.4X", function, error);
-            if (!msg.has_time()) // some has output data copy, so time inside call
-                msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-            msg.set_context_id(reinterpret_cast<int>(dbg));
-            msg.set_function(function);
-            msg.set_type(glesv2debugger::Message_Type_AfterCall);
-            msg.set_expect_response(expectResponse);
-            if (!expectResponse) {
-                cmd.set_function(glesv2debugger::Message_Function_SKIP);
-                cmd.set_expect_response(false);
-            }
-            oldCmd = cmd.function();
-            Send(msg, cmd);
-            expectResponse = cmd.expect_response();
-            break;
-        case glesv2debugger::Message_Function_SKIP:
-            return const_cast<int *>(ret);
-        case glesv2debugger::Message_Function_SETPROP:
-            SetProp(dbg, cmd);
-            expectResponse = cmd.expect_response();
-            if (!expectResponse) // SETPROP is "out of band"
-                cmd.set_function(oldCmd);
-            else
-                Receive(cmd);
-            break;
-        default:
-            ret = GenerateCall(dbg, cmd, msg, ret);
-            msg.set_expect_response(expectResponse);
-            if (!expectResponse) {
-                cmd.set_function(cmd.SKIP);
-                cmd.set_expect_response(expectResponse);
-            }
-            oldCmd = cmd.function();
-            Send(msg, cmd);
-            expectResponse = cmd.expect_response();
-            break;
-        }
-    }
-    return 0;
-}
-}; // namespace android {
diff --git a/opengl/libs/GLES2_dbg/src/vertex.cpp b/opengl/libs/GLES2_dbg/src/vertex.cpp
deleted file mode 100644
index 70c3433..0000000
--- a/opengl/libs/GLES2_dbg/src/vertex.cpp
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- ** Copyright 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.
- */
-
-#include "header.h"
-
-namespace android
-{
-bool capture; // capture after each glDraw*
-}
-
-void Debug_glDrawArrays(GLenum mode, GLint first, GLsizei count)
-{
-    DbgContext * const dbg = getDbgContextThreadSpecific();
-    glesv2debugger::Message msg, cmd;
-    msg.set_context_id(reinterpret_cast<int>(dbg));
-    msg.set_type(glesv2debugger::Message_Type_BeforeCall);
-    bool expectResponse = dbg->expectResponse.Bit(glesv2debugger::Message_Function_glDrawArrays);
-    msg.set_expect_response(expectResponse);
-    msg.set_function(glesv2debugger::Message_Function_glDrawArrays);
-    msg.set_arg0(mode);
-    msg.set_arg1(first);
-    msg.set_arg2(count);
-
-    msg.set_arg7(dbg->maxAttrib); // indicate capturing vertex data
-    if (dbg->hasNonVBOAttribs) {
-        std::string * const data = msg.mutable_data();
-        for (unsigned i = 0; i < count; i++)
-            dbg->Fetch(i + first, data);
-    }
-
-    void * pixels = NULL;
-    int viewport[4] = {};
-    cmd.set_function(glesv2debugger::Message_Function_CONTINUE);
-    cmd.set_expect_response(expectResponse);
-    glesv2debugger::Message_Function oldCmd = cmd.function();
-    Send(msg, cmd);
-    expectResponse = cmd.expect_response();
-    while (true) {
-        msg.Clear();
-        nsecs_t c0 = systemTime(timeMode);
-        switch (cmd.function()) {
-        case glesv2debugger::Message_Function_CONTINUE:
-            dbg->hooks->gl.glDrawArrays(mode, first, count);
-            msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-            msg.set_context_id(reinterpret_cast<int>(dbg));
-            msg.set_function(glesv2debugger::Message_Function_glDrawArrays);
-            msg.set_type(glesv2debugger::Message_Type_AfterCall);
-            msg.set_expect_response(expectResponse);
-            if (!expectResponse) {
-                cmd.set_function(glesv2debugger::Message_Function_SKIP);
-                cmd.set_expect_response(false);
-            }
-            oldCmd = cmd.function();
-            Send(msg, cmd);
-            expectResponse = cmd.expect_response();
-            // TODO: pack glReadPixels data with vertex data instead of
-            //  relying on sperate call for transport, this would allow
-            //  auto generated message loop using EXTEND_Debug macro
-            if (dbg->captureDraw > 0) {
-                dbg->captureDraw--;
-                dbg->hooks->gl.glGetIntegerv(GL_VIEWPORT, viewport);
-//                ALOGD("glDrawArrays CAPTURE: x=%d y=%d width=%d height=%d format=0x%.4X type=0x%.4X",
-//                     viewport[0], viewport[1], viewport[2], viewport[3], readFormat, readType);
-                pixels = dbg->GetReadPixelsBuffer(viewport[2] * viewport[3] *
-                                                  dbg->readBytesPerPixel);
-                Debug_glReadPixels(viewport[0], viewport[1], viewport[2], viewport[3],
-                        GL_RGBA, GL_UNSIGNED_BYTE, pixels);
-            }
-            break;
-        case glesv2debugger::Message_Function_SKIP:
-            return;
-        case glesv2debugger::Message_Function_SETPROP:
-            SetProp(dbg, cmd);
-            expectResponse = cmd.expect_response();
-            if (!expectResponse) // SETPROP is "out of band"
-                cmd.set_function(oldCmd);
-            else
-                Receive(cmd);
-            break;
-        default:
-            GenerateCall(dbg, cmd, msg, NULL);
-            msg.set_expect_response(expectResponse);
-            if (!expectResponse) {
-                cmd.set_function(cmd.SKIP);
-                cmd.set_expect_response(expectResponse);
-            }
-            oldCmd = cmd.function();
-            Send(msg, cmd);
-            expectResponse = cmd.expect_response();
-            break;
-        }
-    }
-}
-
-template<typename T>
-static inline void FetchIndexed(const unsigned count, const T * indices,
-                                std::string * const data, const DbgContext * const ctx)
-{
-    for (unsigned i = 0; i < count; i++) {
-        if (!ctx->indexBuffer)
-            data->append((const char *)(indices + i), sizeof(*indices));
-        if (ctx->hasNonVBOAttribs)
-            ctx->Fetch(indices[i], data);
-    }
-}
-
-void Debug_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices)
-{
-    DbgContext * const dbg = getDbgContextThreadSpecific();
-    glesv2debugger::Message msg, cmd;
-    msg.set_context_id(reinterpret_cast<int>(dbg));
-    msg.set_type(glesv2debugger::Message_Type_BeforeCall);
-    bool expectResponse = dbg->expectResponse.Bit(glesv2debugger::Message_Function_glDrawElements);
-    msg.set_expect_response(expectResponse);
-    msg.set_function(glesv2debugger::Message_Function_glDrawElements);
-    msg.set_arg0(mode);
-    msg.set_arg1(count);
-    msg.set_arg2(type);
-    msg.set_arg3(reinterpret_cast<int>(indices));
-
-    msg.set_arg7(dbg->maxAttrib); // indicate capturing vertex data
-    std::string * const data = msg.mutable_data();
-    if (GL_UNSIGNED_BYTE == type) {
-        if (dbg->indexBuffer) {
-            FetchIndexed(count, (unsigned char *)dbg->indexBuffer->data +
-                         (unsigned long)indices, data, dbg);
-        } else {
-            FetchIndexed(count, (unsigned char *)indices, data, dbg);
-        }
-    } else if (GL_UNSIGNED_SHORT == type) {
-        if (dbg->indexBuffer) {
-            FetchIndexed(count, (unsigned short *)((char *)dbg->indexBuffer->data +
-                                                   (unsigned long)indices), data, dbg);
-        } else {
-            FetchIndexed(count, (unsigned short *)indices, data, dbg);
-        }
-    } else {
-        assert(0);
-    }
-
-    void * pixels = NULL;
-    int viewport[4] = {};
-    cmd.set_function(glesv2debugger::Message_Function_CONTINUE);
-    cmd.set_expect_response(expectResponse);
-    glesv2debugger::Message_Function oldCmd = cmd.function();
-    Send(msg, cmd);
-    expectResponse = cmd.expect_response();
-    while (true) {
-        msg.Clear();
-        nsecs_t c0 = systemTime(timeMode);
-        switch (cmd.function()) {
-        case glesv2debugger::Message_Function_CONTINUE:
-            dbg->hooks->gl.glDrawElements(mode, count, type, indices);
-            msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-            msg.set_context_id(reinterpret_cast<int>(dbg));
-            msg.set_function(glesv2debugger::Message_Function_glDrawElements);
-            msg.set_type(glesv2debugger::Message_Type_AfterCall);
-            msg.set_expect_response(expectResponse);
-            if (!expectResponse) {
-                cmd.set_function(glesv2debugger::Message_Function_SKIP);
-                cmd.set_expect_response(false);
-            }
-            oldCmd = cmd.function();
-            Send(msg, cmd);
-            expectResponse = cmd.expect_response();
-            // TODO: pack glReadPixels data with vertex data instead of
-            //  relying on separate call for transport, this would allow
-            //  auto generated message loop using EXTEND_Debug macro
-            if (dbg->captureDraw > 0) {
-                dbg->captureDraw--;
-                dbg->hooks->gl.glGetIntegerv(GL_VIEWPORT, viewport);
-                pixels = dbg->GetReadPixelsBuffer(viewport[2] * viewport[3] *
-                                                  dbg->readBytesPerPixel);
-                Debug_glReadPixels(viewport[0], viewport[1], viewport[2], viewport[3],
-                        GL_RGBA, GL_UNSIGNED_BYTE, pixels);
-            }
-            break;
-        case glesv2debugger::Message_Function_SKIP:
-            return;
-        case glesv2debugger::Message_Function_SETPROP:
-            SetProp(dbg, cmd);
-            expectResponse = cmd.expect_response();
-            if (!expectResponse) // SETPROP is "out of band"
-                cmd.set_function(oldCmd);
-            else
-                Receive(cmd);
-            break;
-        default:
-            GenerateCall(dbg, cmd, msg, NULL);
-            msg.set_expect_response(expectResponse);
-            if (!expectResponse) {
-                cmd.set_function(cmd.SKIP);
-                cmd.set_expect_response(expectResponse);
-            }
-            oldCmd = cmd.function();
-            Send(msg, cmd);
-            expectResponse = cmd.expect_response();
-            break;
-        }
-    }
-}
diff --git a/opengl/libs/GLES2_dbg/test/Android.mk b/opengl/libs/GLES2_dbg/test/Android.mk
deleted file mode 100644
index 8708d43..0000000
--- a/opengl/libs/GLES2_dbg/test/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_C_INCLUDES := \
-    $(LOCAL_PATH) \
-    $(LOCAL_PATH)/../src \
-    $(LOCAL_PATH)/../../ \
-    external/gtest/include \
-    external/stlport/stlport \
-    external/protobuf/src \
-    bionic \
-    external \
-#
-
-LOCAL_SRC_FILES:= \
-    test_main.cpp \
-    test_server.cpp \
-    test_socket.cpp \
-#
-
-LOCAL_SHARED_LIBRARIES := libcutils libutils libGLESv2_dbg libstlport
-LOCAL_STATIC_LIBRARIES := libgtest libprotobuf-cpp-2.3.0-lite liblzf
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE:= libGLESv2_dbg_test
-
-ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
-    LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
-endif
-LOCAL_C_INCLUDES += bionic/libc/private
-
-LOCAL_CFLAGS += -DLOG_TAG=\"libEGL\"
-LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-LOCAL_CFLAGS += -fvisibility=hidden
-
-include $(BUILD_EXECUTABLE)
-
diff --git a/opengl/libs/GLES2_dbg/test/test_main.cpp b/opengl/libs/GLES2_dbg/test/test_main.cpp
deleted file mode 100644
index 183bf8e..0000000
--- a/opengl/libs/GLES2_dbg/test/test_main.cpp
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- ** Copyright 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.
- */
-
-#include "header.h"
-#include "gtest/gtest.h"
-#include "hooks.h"
-
-namespace
-{
-
-// The fixture for testing class Foo.
-class DbgContextTest : public ::testing::Test
-{
-protected:
-    android::DbgContext dbg;
-    gl_hooks_t hooks;
-
-    DbgContextTest()
-            : dbg(1, &hooks, 32) {
-        // You can do set-up work for each test here.
-        hooks.gl.glGetError = GetError;
-    }
-
-    static GLenum GetError() {
-        return GL_NO_ERROR;
-    }
-
-    virtual ~DbgContextTest() {
-        // You can do clean-up work that doesn't throw exceptions here.
-    }
-
-    // If the constructor and destructor are not enough for setting up
-    // and cleaning up each test, you can define the following methods:
-
-    virtual void SetUp() {
-        // Code here will be called immediately after the constructor (right
-        // before each test).
-    }
-
-    virtual void TearDown() {
-        // Code here will be called immediately after each test (right
-        // before the destructor).
-    }
-};
-
-TEST_F(DbgContextTest, GetReadPixelBuffer)
-{
-    const unsigned int bufferSize = 512;
-    // test that it's allocating two buffers and swapping them
-    void * const buffer0 = dbg.GetReadPixelsBuffer(bufferSize);
-    ASSERT_NE((void *)NULL, buffer0);
-    for (unsigned int i = 0; i < bufferSize / sizeof(unsigned int); i++) {
-        EXPECT_EQ(0, ((unsigned int *)buffer0)[i])
-        << "GetReadPixelsBuffer should allocate and zero";
-        ((unsigned int *)buffer0)[i] = i * 13;
-    }
-
-    void * const buffer1 = dbg.GetReadPixelsBuffer(bufferSize);
-    ASSERT_NE((void *)NULL, buffer1);
-    EXPECT_NE(buffer0, buffer1);
-    for (unsigned int i = 0; i < bufferSize / sizeof(unsigned int); i++) {
-        EXPECT_EQ(0, ((unsigned int *)buffer1)[i])
-        << "GetReadPixelsBuffer should allocate and zero";
-        ((unsigned int *)buffer1)[i] = i * 17;
-    }
-
-    void * const buffer2 = dbg.GetReadPixelsBuffer(bufferSize);
-    EXPECT_EQ(buffer2, buffer0);
-    for (unsigned int i = 0; i < bufferSize / sizeof(unsigned int); i++)
-        EXPECT_EQ(i * 13, ((unsigned int *)buffer2)[i])
-        << "GetReadPixelsBuffer should swap buffers";
-
-    void * const buffer3 = dbg.GetReadPixelsBuffer(bufferSize);
-    EXPECT_EQ(buffer3, buffer1);
-    for (unsigned int i = 0; i < bufferSize / sizeof(unsigned int); i++)
-        EXPECT_EQ(i * 17, ((unsigned int *)buffer3)[i])
-        << "GetReadPixelsBuffer should swap buffers";
-
-    void * const buffer4 = dbg.GetReadPixelsBuffer(bufferSize);
-    EXPECT_NE(buffer3, buffer4);
-    EXPECT_EQ(buffer0, buffer2);
-    EXPECT_EQ(buffer1, buffer3);
-    EXPECT_EQ(buffer2, buffer4);
-
-    // it reallocs as necessary; 0 size may result in NULL
-    for (unsigned int i = 0; i < 42; i++) {
-        void * const buffer = dbg.GetReadPixelsBuffer(((i & 7)) << 20);
-        EXPECT_NE((void *)NULL, buffer)
-        << "should be able to get a variety of reasonable sizes";
-        EXPECT_TRUE(dbg.IsReadPixelBuffer(buffer));
-    }
-}
-
-TEST_F(DbgContextTest, CompressReadPixelBuffer)
-{
-    const unsigned int bufferSize = dbg.LZF_CHUNK_SIZE * 4 + 33;
-    std::string out;
-    unsigned char * buffer = (unsigned char *)dbg.GetReadPixelsBuffer(bufferSize);
-    for (unsigned int i = 0; i < bufferSize; i++)
-        buffer[i] = i * 13;
-    dbg.CompressReadPixelBuffer(&out);
-    uint32_t decompSize = 0;
-    ASSERT_LT(12, out.length()); // at least written chunk header
-    ASSERT_EQ(bufferSize, *(uint32_t *)out.data())
-    << "total decompressed size should be as requested in GetReadPixelsBuffer";
-    for (unsigned int i = 4; i < out.length();) {
-        const uint32_t outSize = *(uint32_t *)(out.data() + i);
-        i += 4;
-        const uint32_t inSize = *(uint32_t *)(out.data() + i);
-        i += 4;
-        if (inSize == 0)
-            i += outSize; // chunk not compressed
-        else
-            i += inSize; // skip the actual compressed chunk
-        decompSize += outSize;
-    }
-    ASSERT_EQ(bufferSize, decompSize);
-    decompSize = 0;
-
-    unsigned char * decomp = dbg.Decompress(out.data(), out.length(), &decompSize);
-    ASSERT_EQ(decompSize, bufferSize);
-    for (unsigned int i = 0; i < bufferSize; i++)
-        EXPECT_EQ((unsigned char)(i * 13), decomp[i]) << "xor with 0 ref is identity";
-    free(decomp);
-
-    buffer = (unsigned char *)dbg.GetReadPixelsBuffer(bufferSize);
-    for (unsigned int i = 0; i < bufferSize; i++)
-        buffer[i] = i * 13;
-    out.clear();
-    dbg.CompressReadPixelBuffer(&out);
-    decompSize = 0;
-    decomp = dbg.Decompress(out.data(), out.length(), &decompSize);
-    ASSERT_EQ(decompSize, bufferSize);
-    for (unsigned int i = 0; i < bufferSize; i++)
-        EXPECT_EQ(0, decomp[i]) << "xor with same ref is 0";
-    free(decomp);
-
-    buffer = (unsigned char *)dbg.GetReadPixelsBuffer(bufferSize);
-    for (unsigned int i = 0; i < bufferSize; i++)
-        buffer[i] = i * 19;
-    out.clear();
-    dbg.CompressReadPixelBuffer(&out);
-    decompSize = 0;
-    decomp = dbg.Decompress(out.data(), out.length(), &decompSize);
-    ASSERT_EQ(decompSize, bufferSize);
-    for (unsigned int i = 0; i < bufferSize; i++)
-        EXPECT_EQ((unsigned char)(i * 13) ^ (unsigned char)(i * 19), decomp[i])
-        << "xor ref";
-    free(decomp);
-}
-
-TEST_F(DbgContextTest, UseProgram)
-{
-    static const GLuint _program = 74568;
-    static const struct Attribute {
-        const char * name;
-        GLint location;
-        GLint size;
-        GLenum type;
-    } _attributes [] = {
-        {"aaa", 2, 2, GL_FLOAT_VEC2},
-        {"bb", 6, 2, GL_FLOAT_MAT2},
-        {"c", 1, 1, GL_FLOAT},
-    };
-    static const unsigned int _attributeCount = sizeof(_attributes) / sizeof(*_attributes);
-    struct GL {
-        static void GetProgramiv(GLuint program, GLenum pname, GLint* params) {
-            EXPECT_EQ(_program, program);
-            ASSERT_NE((GLint *)NULL, params);
-            switch (pname) {
-            case GL_ACTIVE_ATTRIBUTES:
-                *params = _attributeCount;
-                return;
-            case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH:
-                *params = 4; // includes NULL terminator
-                return;
-            default:
-                ADD_FAILURE() << "not handled pname: " << pname;
-            }
-        }
-
-        static GLint GetAttribLocation(GLuint program, const GLchar* name) {
-            EXPECT_EQ(_program, program);
-            for (unsigned int i = 0; i < _attributeCount; i++)
-                if (!strcmp(name, _attributes[i].name))
-                    return _attributes[i].location;
-            ADD_FAILURE() << "unknown attribute name: " << name;
-            return -1;
-        }
-
-        static void GetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize,
-                                    GLsizei* length, GLint* size, GLenum* type, GLchar* name) {
-            EXPECT_EQ(_program, program);
-            ASSERT_LT(index, _attributeCount);
-            const Attribute & att = _attributes[index];
-            ASSERT_GE(bufsize, strlen(att.name) + 1);
-            ASSERT_NE((GLint *)NULL, size);
-            ASSERT_NE((GLenum *)NULL, type);
-            ASSERT_NE((GLchar *)NULL, name);
-            strcpy(name, att.name);
-            if (length)
-                *length = strlen(name) + 1;
-            *size = att.size;
-            *type = att.type;
-        }
-    };
-    hooks.gl.glGetProgramiv = GL::GetProgramiv;
-    hooks.gl.glGetAttribLocation = GL::GetAttribLocation;
-    hooks.gl.glGetActiveAttrib = GL::GetActiveAttrib;
-    dbg.glUseProgram(_program);
-    EXPECT_EQ(10, dbg.maxAttrib);
-    dbg.glUseProgram(0);
-    EXPECT_EQ(0, dbg.maxAttrib);
-}
-}  // namespace
-
-int main(int argc, char **argv)
-{
-    ::testing::InitGoogleTest(&argc, argv);
-    return RUN_ALL_TESTS();
-}
diff --git a/opengl/libs/GLES2_dbg/test/test_server.cpp b/opengl/libs/GLES2_dbg/test/test_server.cpp
deleted file mode 100644
index 0ab87b0..0000000
--- a/opengl/libs/GLES2_dbg/test/test_server.cpp
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- ** Copyright 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.
- */
-
-#include "header.h"
-#include "gtest/gtest.h"
-#include "hooks.h"
-
-namespace android
-{
-extern FILE * file;
-extern unsigned int MAX_FILE_SIZE;
-};
-
-// tmpfile fails, so need to manually make a writable file first
-static const char * filePath = "/data/local/tmp/dump.gles2dbg";
-
-class ServerFileTest : public ::testing::Test
-{
-protected:
-    ServerFileTest() { }
-
-    virtual ~ServerFileTest() { }
-
-    virtual void SetUp() {
-        MAX_FILE_SIZE = 8 << 20;
-        ASSERT_EQ((FILE *)NULL, file);
-        file = fopen("/data/local/tmp/dump.gles2dbg", "wb+");
-        ASSERT_NE((FILE *)NULL, file) << "make sure file is writable: "
-        << filePath;
-    }
-
-    virtual void TearDown() {
-        ASSERT_NE((FILE *)NULL, file);
-        fclose(file);
-        file = NULL;
-    }
-
-    void Read(glesv2debugger::Message & msg) const {
-        msg.Clear();
-        uint32_t len = 0;
-        ASSERT_EQ(sizeof(len), fread(&len, 1, sizeof(len), file));
-        ASSERT_GT(len, 0u);
-        char * buffer = new char [len];
-        ASSERT_EQ(len, fread(buffer, 1, len, file));
-        msg.ParseFromArray(buffer, len);
-        delete buffer;
-    }
-
-    void CheckNoAvailable() {
-        const long pos = ftell(file);
-        fseek(file, 0, SEEK_END);
-        EXPECT_EQ(pos, ftell(file)) << "check no available";
-    }
-};
-
-TEST_F(ServerFileTest, Send)
-{
-    glesv2debugger::Message msg, cmd, read;
-    msg.set_context_id(1);
-    msg.set_function(msg.glFinish);
-    msg.set_expect_response(false);
-    msg.set_type(msg.BeforeCall);
-    rewind(file);
-    android::Send(msg, cmd);
-    rewind(file);
-    Read(read);
-    EXPECT_EQ(msg.context_id(), read.context_id());
-    EXPECT_EQ(msg.function(), read.function());
-    EXPECT_EQ(msg.expect_response(), read.expect_response());
-    EXPECT_EQ(msg.type(), read.type());
-}
-
-TEST_F(ServerFileTest, CreateDbgContext)
-{
-    gl_hooks_t hooks;
-    struct Constant {
-        GLenum pname;
-        GLint param;
-    };
-    static const Constant constants [] = {
-        {GL_MAX_VERTEX_ATTRIBS, 16},
-        {GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, 32},
-        {GL_IMPLEMENTATION_COLOR_READ_FORMAT, GL_RGBA},
-        {GL_IMPLEMENTATION_COLOR_READ_TYPE, GL_UNSIGNED_BYTE},
-    };
-    struct HookMock {
-        static void GetIntegerv(GLenum pname, GLint* params) {
-            ASSERT_TRUE(params != NULL);
-            for (unsigned int i = 0; i < sizeof(constants) / sizeof(*constants); i++)
-                if (pname == constants[i].pname) {
-                    *params = constants[i].param;
-                    return;
-                }
-            FAIL() << "GetIntegerv unknown pname: " << pname;
-        }
-        static GLenum GetError() {
-            return GL_NO_ERROR;
-        }
-    };
-    hooks.gl.glGetError = HookMock::GetError;
-    hooks.gl.glGetIntegerv = HookMock::GetIntegerv;
-    DbgContext * const dbg = CreateDbgContext(1, &hooks);
-    ASSERT_TRUE(dbg != NULL);
-    EXPECT_TRUE(dbg->vertexAttribs != NULL);
-
-    rewind(file);
-    glesv2debugger::Message read;
-    for (unsigned int i = 0; i < 2; i++) {
-        Read(read);
-        EXPECT_EQ(reinterpret_cast<int>(dbg), read.context_id());
-        EXPECT_FALSE(read.expect_response());
-        EXPECT_EQ(read.Response, read.type());
-        EXPECT_EQ(read.SETPROP, read.function());
-        EXPECT_EQ(read.GLConstant, read.prop());
-        GLint expectedConstant = 0;
-        HookMock::GetIntegerv(read.arg0(), &expectedConstant);
-        EXPECT_EQ(expectedConstant, read.arg1());
-    }
-    CheckNoAvailable();
-    dbgReleaseThread();
-}
-
-void * glNoop()
-{
-    return 0;
-}
-
-class ServerFileContextTest : public ServerFileTest
-{
-protected:
-    DbgContext* dbg;
-    gl_hooks_t hooks;
-
-    ServerFileContextTest() { }
-
-    virtual ~ServerFileContextTest() { }
-
-    virtual void SetUp() {
-        ServerFileTest::SetUp();
-
-        dbg = new DbgContext(1, &hooks, 32);
-        ASSERT_NE((void *)NULL, dbg);
-        for (unsigned int i = 0; i < sizeof(hooks) / sizeof(void *); i++)
-            ((void **)&hooks)[i] = reinterpret_cast<void *>(glNoop);
-    }
-
-    virtual void TearDown() {
-        ServerFileTest::TearDown();
-    }
-};
-
-TEST_F(ServerFileContextTest, MessageLoop)
-{
-    static const int arg0 = 45;
-    static const float arg7 = -87.2331f;
-    static const int arg8 = -3;
-    static const int * ret = reinterpret_cast<int *>(870);
-
-    struct Caller : public FunctionCall {
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            msg.set_arg0(arg0);
-            msg.set_arg7((int &)arg7);
-            msg.set_arg8(arg8);
-            return ret;
-        }
-    } caller;
-    const int contextId = reinterpret_cast<int>(dbg);
-    glesv2debugger::Message msg, read;
-
-    EXPECT_EQ(ret, MessageLoop(caller, msg, msg.glFinish));
-
-    rewind(file);
-    Read(read);
-    EXPECT_EQ(contextId, read.context_id());
-    EXPECT_EQ(read.glFinish, read.function());
-    EXPECT_EQ(false, read.expect_response());
-    EXPECT_EQ(read.BeforeCall, read.type());
-
-    Read(read);
-    EXPECT_EQ(contextId, read.context_id());
-    EXPECT_EQ(read.glFinish, read.function());
-    EXPECT_EQ(false, read.expect_response());
-    EXPECT_EQ(read.AfterCall, read.type());
-    EXPECT_TRUE(read.has_time());
-    EXPECT_EQ(arg0, read.arg0());
-    const int readArg7 = read.arg7();
-    EXPECT_EQ(arg7, (float &)readArg7);
-    EXPECT_EQ(arg8, read.arg8());
-
-    const long pos = ftell(file);
-    fseek(file, 0, SEEK_END);
-    EXPECT_EQ(pos, ftell(file))
-    << "should only write the BeforeCall and AfterCall messages";
-}
-
-TEST_F(ServerFileContextTest, DisableEnableVertexAttribArray)
-{
-    Debug_glEnableVertexAttribArray(dbg->MAX_VERTEX_ATTRIBS + 2); // should just ignore invalid index
-
-    glesv2debugger::Message read;
-    rewind(file);
-    Read(read);
-    EXPECT_EQ(read.glEnableVertexAttribArray, read.function());
-    EXPECT_EQ(dbg->MAX_VERTEX_ATTRIBS + 2, read.arg0());
-    Read(read);
-
-    rewind(file);
-    Debug_glDisableVertexAttribArray(dbg->MAX_VERTEX_ATTRIBS + 4); // should just ignore invalid index
-    rewind(file);
-    Read(read);
-    Read(read);
-
-    for (unsigned int i = 0; i < dbg->MAX_VERTEX_ATTRIBS; i += 5) {
-        rewind(file);
-        Debug_glEnableVertexAttribArray(i);
-        EXPECT_TRUE(dbg->vertexAttribs[i].enabled);
-        rewind(file);
-        Read(read);
-        EXPECT_EQ(read.glEnableVertexAttribArray, read.function());
-        EXPECT_EQ(i, read.arg0());
-        Read(read);
-
-        rewind(file);
-        Debug_glDisableVertexAttribArray(i);
-        EXPECT_FALSE(dbg->vertexAttribs[i].enabled);
-        rewind(file);
-        Read(read);
-        EXPECT_EQ(read.glDisableVertexAttribArray, read.function());
-        EXPECT_EQ(i, read.arg0());
-        Read(read);
-    }
-}
diff --git a/opengl/libs/GLES2_dbg/test/test_socket.cpp b/opengl/libs/GLES2_dbg/test/test_socket.cpp
deleted file mode 100644
index 9f815e2..0000000
--- a/opengl/libs/GLES2_dbg/test/test_socket.cpp
+++ /dev/null
@@ -1,468 +0,0 @@
-/*
- ** Copyright 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.
- */
-
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-
-#include "header.h"
-#include "gtest/gtest.h"
-#include "hooks.h"
-
-namespace android
-{
-extern int serverSock, clientSock;
-};
-
-void * glNoop();
-
-class SocketContextTest : public ::testing::Test
-{
-protected:
-    DbgContext* dbg;
-    gl_hooks_t hooks;
-    int sock;
-    char * buffer;
-    unsigned int bufferSize;
-
-    SocketContextTest() : sock(-1) {
-    }
-
-    virtual ~SocketContextTest() {
-    }
-
-    virtual void SetUp() {
-        dbg = new DbgContext(1, &hooks, 32);
-        ASSERT_TRUE(dbg != NULL);
-        for (unsigned int i = 0; i < sizeof(hooks) / sizeof(void *); i++)
-            ((void **)&hooks)[i] = (void *)glNoop;
-
-        int socks[2] = {-1, -1};
-        ASSERT_EQ(0, socketpair(AF_UNIX, SOCK_STREAM, 0, socks));
-        clientSock = socks[0];
-        sock = socks[1];
-
-        bufferSize = 128;
-        buffer = new char [128];
-        ASSERT_NE((char *)NULL, buffer);
-    }
-
-    virtual void TearDown() {
-        close(sock);
-        close(clientSock);
-        clientSock = -1;
-        delete buffer;
-    }
-
-    void Write(glesv2debugger::Message & msg) const {
-        msg.set_context_id((int)dbg);
-        msg.set_type(msg.Response);
-        ASSERT_TRUE(msg.has_context_id());
-        ASSERT_TRUE(msg.has_function());
-        ASSERT_TRUE(msg.has_type());
-        ASSERT_TRUE(msg.has_expect_response());
-        static std::string str;
-        msg.SerializeToString(&str);
-        const uint32_t len = str.length();
-        ASSERT_EQ(sizeof(len), send(sock, &len, sizeof(len), 0));
-        ASSERT_EQ(str.length(), send(sock, str.data(), str.length(), 0));
-    }
-
-    void Read(glesv2debugger::Message & msg) {
-        int available = 0;
-        ASSERT_EQ(0, ioctl(sock, FIONREAD, &available));
-        ASSERT_GT(available, 0);
-        uint32_t len = 0;
-        ASSERT_EQ(sizeof(len), recv(sock, &len, sizeof(len), 0));
-        if (len > bufferSize) {
-            bufferSize = len;
-            buffer = new char[bufferSize];
-            ASSERT_TRUE(buffer != NULL);
-        }
-        ASSERT_EQ(len, recv(sock, buffer, len, 0));
-        msg.Clear();
-        msg.ParseFromArray(buffer, len);
-        ASSERT_TRUE(msg.has_context_id());
-        ASSERT_TRUE(msg.has_function());
-        ASSERT_TRUE(msg.has_type());
-        ASSERT_TRUE(msg.has_expect_response());
-    }
-
-    void CheckNoAvailable() {
-        int available = 0;
-        ASSERT_EQ(0, ioctl(sock, FIONREAD, &available));
-        ASSERT_EQ(available, 0);
-    }
-};
-
-TEST_F(SocketContextTest, MessageLoopSkip)
-{
-    static const int arg0 = 45;
-    static const float arg7 = -87.2331f;
-    static const int arg8 = -3;
-    static const int * ret = (int *)870;
-
-    struct Caller : public FunctionCall {
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            msg.set_arg0(arg0);
-            msg.set_arg7((int &)arg7);
-            msg.set_arg8(arg8);
-            return ret;
-        }
-    } caller;
-    glesv2debugger::Message msg, read, cmd;
-    dbg->expectResponse.Bit(msg.glFinish, true);
-
-    cmd.set_function(cmd.SKIP);
-    cmd.set_expect_response(false);
-    Write(cmd);
-
-    EXPECT_NE(ret, MessageLoop(caller, msg, msg.glFinish));
-
-    Read(read);
-    EXPECT_EQ(read.glFinish, read.function());
-    EXPECT_EQ(read.BeforeCall, read.type());
-    EXPECT_NE(arg0, read.arg0());
-    EXPECT_NE((int &)arg7, read.arg7());
-    EXPECT_NE(arg8, read.arg8());
-
-    CheckNoAvailable();
-}
-
-TEST_F(SocketContextTest, MessageLoopContinue)
-{
-    static const int arg0 = GL_FRAGMENT_SHADER;
-    static const int ret = -342;
-    struct Caller : public FunctionCall {
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            msg.set_ret(ret);
-            return (int *)ret;
-        }
-    } caller;
-    glesv2debugger::Message msg, read, cmd;
-    dbg->expectResponse.Bit(msg.glCreateShader, true);
-
-    cmd.set_function(cmd.CONTINUE);
-    cmd.set_expect_response(false); // MessageLoop should automatically skip after continue
-    Write(cmd);
-
-    msg.set_arg0(arg0);
-    EXPECT_EQ((int *)ret, MessageLoop(caller, msg, msg.glCreateShader));
-
-    Read(read);
-    EXPECT_EQ(read.glCreateShader, read.function());
-    EXPECT_EQ(read.BeforeCall, read.type());
-    EXPECT_EQ(arg0, read.arg0());
-
-    Read(read);
-    EXPECT_EQ(read.glCreateShader, read.function());
-    EXPECT_EQ(read.AfterCall, read.type());
-    EXPECT_EQ(ret, read.ret());
-
-    CheckNoAvailable();
-}
-
-TEST_F(SocketContextTest, MessageLoopGenerateCall)
-{
-    static const int ret = -342;
-    static unsigned int createShader, createProgram;
-    createShader = 0;
-    createProgram = 0;
-    struct Caller : public FunctionCall {
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int r = (int)_c->glCreateProgram();
-            msg.set_ret(r);
-            return (int *)r;
-        }
-        static GLuint CreateShader(const GLenum type) {
-            createShader++;
-            return type;
-        }
-        static GLuint CreateProgram() {
-            createProgram++;
-            return ret;
-        }
-    } caller;
-    glesv2debugger::Message msg, read, cmd;
-    hooks.gl.glCreateShader = caller.CreateShader;
-    hooks.gl.glCreateProgram = caller.CreateProgram;
-    dbg->expectResponse.Bit(msg.glCreateProgram, true);
-
-    cmd.set_function(cmd.glCreateShader);
-    cmd.set_arg0(GL_FRAGMENT_SHADER);
-    cmd.set_expect_response(true);
-    Write(cmd);
-
-    cmd.Clear();
-    cmd.set_function(cmd.CONTINUE);
-    cmd.set_expect_response(true);
-    Write(cmd);
-
-    cmd.set_function(cmd.glCreateShader);
-    cmd.set_arg0(GL_VERTEX_SHADER);
-    cmd.set_expect_response(false); // MessageLoop should automatically skip afterwards
-    Write(cmd);
-
-    EXPECT_EQ((int *)ret, MessageLoop(caller, msg, msg.glCreateProgram));
-
-    Read(read);
-    EXPECT_EQ(read.glCreateProgram, read.function());
-    EXPECT_EQ(read.BeforeCall, read.type());
-
-    Read(read);
-    EXPECT_EQ(read.glCreateShader, read.function());
-    EXPECT_EQ(read.AfterGeneratedCall, read.type());
-    EXPECT_EQ(GL_FRAGMENT_SHADER, read.ret());
-
-    Read(read);
-    EXPECT_EQ(read.glCreateProgram, read.function());
-    EXPECT_EQ(read.AfterCall, read.type());
-    EXPECT_EQ(ret, read.ret());
-
-    Read(read);
-    EXPECT_EQ(read.glCreateShader, read.function());
-    EXPECT_EQ(read.AfterGeneratedCall, read.type());
-    EXPECT_EQ(GL_VERTEX_SHADER, read.ret());
-
-    EXPECT_EQ(2, createShader);
-    EXPECT_EQ(1, createProgram);
-
-    CheckNoAvailable();
-}
-
-TEST_F(SocketContextTest, MessageLoopSetProp)
-{
-    static const int ret = -342;
-    static unsigned int createShader, createProgram;
-    createShader = 0;
-    createProgram = 0;
-    struct Caller : public FunctionCall {
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int r = (int)_c->glCreateProgram();
-            msg.set_ret(r);
-            return (int *)r;
-        }
-        static GLuint CreateShader(const GLenum type) {
-            createShader++;
-            return type;
-        }
-        static GLuint CreateProgram() {
-            createProgram++;
-            return ret;
-        }
-    } caller;
-    glesv2debugger::Message msg, read, cmd;
-    hooks.gl.glCreateShader = caller.CreateShader;
-    hooks.gl.glCreateProgram = caller.CreateProgram;
-    dbg->expectResponse.Bit(msg.glCreateProgram, false);
-
-    cmd.set_function(cmd.SETPROP);
-    cmd.set_prop(cmd.ExpectResponse);
-    cmd.set_arg0(cmd.glCreateProgram);
-    cmd.set_arg1(true);
-    cmd.set_expect_response(true);
-    Write(cmd);
-
-    cmd.Clear();
-    cmd.set_function(cmd.glCreateShader);
-    cmd.set_arg0(GL_FRAGMENT_SHADER);
-    cmd.set_expect_response(true);
-    Write(cmd);
-
-    cmd.set_function(cmd.SETPROP);
-    cmd.set_prop(cmd.CaptureDraw);
-    cmd.set_arg0(819);
-    cmd.set_expect_response(true);
-    Write(cmd);
-
-    cmd.Clear();
-    cmd.set_function(cmd.CONTINUE);
-    cmd.set_expect_response(true);
-    Write(cmd);
-
-    cmd.set_function(cmd.glCreateShader);
-    cmd.set_arg0(GL_VERTEX_SHADER);
-    cmd.set_expect_response(false); // MessageLoop should automatically skip afterwards
-    Write(cmd);
-
-    EXPECT_EQ((int *)ret, MessageLoop(caller, msg, msg.glCreateProgram));
-
-    EXPECT_TRUE(dbg->expectResponse.Bit(msg.glCreateProgram));
-    EXPECT_EQ(819, dbg->captureDraw);
-
-    Read(read);
-    EXPECT_EQ(read.glCreateProgram, read.function());
-    EXPECT_EQ(read.BeforeCall, read.type());
-
-    Read(read);
-    EXPECT_EQ(read.glCreateShader, read.function());
-    EXPECT_EQ(read.AfterGeneratedCall, read.type());
-    EXPECT_EQ(GL_FRAGMENT_SHADER, read.ret());
-
-    Read(read);
-    EXPECT_EQ(read.glCreateProgram, read.function());
-    EXPECT_EQ(read.AfterCall, read.type());
-    EXPECT_EQ(ret, read.ret());
-
-    Read(read);
-    EXPECT_EQ(read.glCreateShader, read.function());
-    EXPECT_EQ(read.AfterGeneratedCall, read.type());
-    EXPECT_EQ(GL_VERTEX_SHADER, read.ret());
-
-    EXPECT_EQ(2, createShader);
-    EXPECT_EQ(1, createProgram);
-
-    CheckNoAvailable();
-}
-
-TEST_F(SocketContextTest, TexImage2D)
-{
-    static const GLenum _target = GL_TEXTURE_2D;
-    static const GLint _level = 1, _internalformat = GL_RGBA;
-    static const GLsizei _width = 2, _height = 2;
-    static const GLint _border = 333;
-    static const GLenum _format = GL_RGB, _type = GL_UNSIGNED_SHORT_5_6_5;
-    static const short _pixels [_width * _height] = {11, 22, 33, 44};
-    static unsigned int texImage2D;
-    texImage2D = 0;
-
-    struct Caller {
-        static void TexImage2D(GLenum target, GLint level, GLint internalformat,
-                               GLsizei width, GLsizei height, GLint border,
-                               GLenum format, GLenum type, const GLvoid* pixels) {
-            EXPECT_EQ(_target, target);
-            EXPECT_EQ(_level, level);
-            EXPECT_EQ(_internalformat, internalformat);
-            EXPECT_EQ(_width, width);
-            EXPECT_EQ(_height, height);
-            EXPECT_EQ(_border, border);
-            EXPECT_EQ(_format, format);
-            EXPECT_EQ(_type, type);
-            EXPECT_EQ(0, memcmp(_pixels, pixels, sizeof(_pixels)));
-            texImage2D++;
-        }
-    } caller;
-    glesv2debugger::Message msg, read, cmd;
-    hooks.gl.glTexImage2D = caller.TexImage2D;
-    dbg->expectResponse.Bit(msg.glTexImage2D, false);
-
-    Debug_glTexImage2D(_target, _level, _internalformat, _width, _height, _border,
-                       _format, _type, _pixels);
-    EXPECT_EQ(1, texImage2D);
-
-    Read(read);
-    EXPECT_EQ(read.glTexImage2D, read.function());
-    EXPECT_EQ(read.BeforeCall, read.type());
-    EXPECT_EQ(_target, read.arg0());
-    EXPECT_EQ(_level, read.arg1());
-    EXPECT_EQ(_internalformat, read.arg2());
-    EXPECT_EQ(_width, read.arg3());
-    EXPECT_EQ(_height, read.arg4());
-    EXPECT_EQ(_border, read.arg5());
-    EXPECT_EQ(_format, read.arg6());
-    EXPECT_EQ(_type, read.arg7());
-
-    EXPECT_TRUE(read.has_data());
-    uint32_t dataLen = 0;
-    const unsigned char * data = dbg->Decompress(read.data().data(),
-                                 read.data().length(), &dataLen);
-    EXPECT_EQ(sizeof(_pixels), dataLen);
-    if (sizeof(_pixels) == dataLen)
-        EXPECT_EQ(0, memcmp(_pixels, data, sizeof(_pixels)));
-
-    Read(read);
-    EXPECT_EQ(read.glTexImage2D, read.function());
-    EXPECT_EQ(read.AfterCall, read.type());
-
-    CheckNoAvailable();
-}
-
-TEST_F(SocketContextTest, CopyTexImage2D)
-{
-    static const GLenum _target = GL_TEXTURE_2D;
-    static const GLint _level = 1, _internalformat = GL_RGBA;
-    static const GLint _x = 9, _y = 99;
-    static const GLsizei _width = 2, _height = 3;
-    static const GLint _border = 333;
-    static const int _pixels [_width * _height] = {11, 22, 33, 44, 55, 66};
-    static unsigned int copyTexImage2D, readPixels;
-    copyTexImage2D = 0, readPixels = 0;
-
-    struct Caller {
-        static void CopyTexImage2D(GLenum target, GLint level, GLenum internalformat,
-                                   GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
-            EXPECT_EQ(_target, target);
-            EXPECT_EQ(_level, level);
-            EXPECT_EQ(_internalformat, internalformat);
-            EXPECT_EQ(_x, x);
-            EXPECT_EQ(_y, y);
-            EXPECT_EQ(_width, width);
-            EXPECT_EQ(_height, height);
-            EXPECT_EQ(_border, border);
-            copyTexImage2D++;
-        }
-        static void ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
-                               GLenum format, GLenum type, GLvoid* pixels) {
-            EXPECT_EQ(_x, x);
-            EXPECT_EQ(_y, y);
-            EXPECT_EQ(_width, width);
-            EXPECT_EQ(_height, height);
-            EXPECT_EQ(GL_RGBA, format);
-            EXPECT_EQ(GL_UNSIGNED_BYTE, type);
-            ASSERT_TRUE(pixels != NULL);
-            memcpy(pixels, _pixels, sizeof(_pixels));
-            readPixels++;
-        }
-    } caller;
-    glesv2debugger::Message msg, read, cmd;
-    hooks.gl.glCopyTexImage2D = caller.CopyTexImage2D;
-    hooks.gl.glReadPixels = caller.ReadPixels;
-    dbg->expectResponse.Bit(msg.glCopyTexImage2D, false);
-
-    Debug_glCopyTexImage2D(_target, _level, _internalformat, _x, _y, _width, _height,
-                           _border);
-    ASSERT_EQ(1, copyTexImage2D);
-    ASSERT_EQ(1, readPixels);
-
-    Read(read);
-    EXPECT_EQ(read.glCopyTexImage2D, read.function());
-    EXPECT_EQ(read.BeforeCall, read.type());
-    EXPECT_EQ(_target, read.arg0());
-    EXPECT_EQ(_level, read.arg1());
-    EXPECT_EQ(_internalformat, read.arg2());
-    EXPECT_EQ(_x, read.arg3());
-    EXPECT_EQ(_y, read.arg4());
-    EXPECT_EQ(_width, read.arg5());
-    EXPECT_EQ(_height, read.arg6());
-    EXPECT_EQ(_border, read.arg7());
-
-    EXPECT_TRUE(read.has_data());
-    EXPECT_EQ(read.ReferencedImage, read.data_type());
-    EXPECT_EQ(GL_RGBA, read.pixel_format());
-    EXPECT_EQ(GL_UNSIGNED_BYTE, read.pixel_type());
-    uint32_t dataLen = 0;
-    unsigned char * const data = dbg->Decompress(read.data().data(),
-                                 read.data().length(), &dataLen);
-    ASSERT_EQ(sizeof(_pixels), dataLen);
-    for (unsigned i = 0; i < sizeof(_pixels) / sizeof(*_pixels); i++)
-        EXPECT_EQ(_pixels[i], ((const int *)data)[i]) << "xor with 0 ref is identity";
-    free(data);
-
-    Read(read);
-    EXPECT_EQ(read.glCopyTexImage2D, read.function());
-    EXPECT_EQ(read.AfterCall, read.type());
-
-    CheckNoAvailable();
-}
diff --git a/opengl/libs/GLES_CM/gl.cpp b/opengl/libs/GLES_CM/gl.cpp
index 2d31a35..adeaa5b 100644
--- a/opengl/libs/GLES_CM/gl.cpp
+++ b/opengl/libs/GLES_CM/gl.cpp
@@ -165,6 +165,20 @@
 #undef CALL_GL_API
 #undef CALL_GL_API_RETURN
 
+/*
+ * glGetString() is special because we expose some extensions in the wrapper
+ */
+
+extern "C" const GLubyte * __glGetString(GLenum name);
+
+const GLubyte * glGetString(GLenum name)
+{
+    const GLubyte * ret = egl_get_string_for_current_context(name);
+    if (ret == NULL) {
+        ret = __glGetString(name);
+    }
+    return ret;
+}
 
 /*
  * These GL calls are special because they need to EGL to retrieve some
diff --git a/opengl/libs/GLES_CM/gl_api.in b/opengl/libs/GLES_CM/gl_api.in
index 7f20c4f..c8f6b0c 100644
--- a/opengl/libs/GLES_CM/gl_api.in
+++ b/opengl/libs/GLES_CM/gl_api.in
@@ -262,7 +262,7 @@
 void API_ENTRY(glGetPointerv)(GLenum pname, GLvoid **params) {
     CALL_GL_API(glGetPointerv, pname, params);
 }
-const GLubyte * API_ENTRY(glGetString)(GLenum name) {
+const GLubyte * API_ENTRY(__glGetString)(GLenum name) {
     CALL_GL_API_RETURN(glGetString, name);
 }
 void API_ENTRY(glGetTexEnviv)(GLenum env, GLenum pname, GLint *params) {
diff --git a/opengl/libs/GLES_CM/glext_api.in b/opengl/libs/GLES_CM/glext_api.in
index 5393fa6..268a535 100644
--- a/opengl/libs/GLES_CM/glext_api.in
+++ b/opengl/libs/GLES_CM/glext_api.in
@@ -280,15 +280,57 @@
 GLboolean API_ENTRY(glIsVertexArrayOES)(GLuint array) {
     CALL_GL_API_RETURN(glIsVertexArrayOES, array);
 }
+void API_ENTRY(glRenderbufferStorageMultisampleAPPLE)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
+    CALL_GL_API(glRenderbufferStorageMultisampleAPPLE, target, samples, internalformat, width, height);
+}
+void API_ENTRY(glResolveMultisampleFramebufferAPPLE)(void) {
+    CALL_GL_API(glResolveMultisampleFramebufferAPPLE);
+}
 void API_ENTRY(glDiscardFramebufferEXT)(GLenum target, GLsizei numAttachments, const GLenum *attachments) {
     CALL_GL_API(glDiscardFramebufferEXT, target, numAttachments, attachments);
 }
+void API_ENTRY(glRenderbufferStorageMultisampleEXT)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
+    CALL_GL_API(glRenderbufferStorageMultisampleEXT, target, samples, internalformat, width, height);
+}
+void API_ENTRY(glFramebufferTexture2DMultisampleEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) {
+    CALL_GL_API(glFramebufferTexture2DMultisampleEXT, target, attachment, textarget, texture, level, samples);
+}
 void API_ENTRY(glMultiDrawArraysEXT)(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount) {
     CALL_GL_API(glMultiDrawArraysEXT, mode, first, count, primcount);
 }
 void API_ENTRY(glMultiDrawElementsEXT)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount) {
     CALL_GL_API(glMultiDrawElementsEXT, mode, count, type, indices, primcount);
 }
+GLenum API_ENTRY(glGetGraphicsResetStatusEXT)(void) {
+    CALL_GL_API_RETURN(glGetGraphicsResetStatusEXT);
+}
+void API_ENTRY(glReadnPixelsEXT)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data) {
+    CALL_GL_API(glReadnPixelsEXT, x, y, width, height, format, type, bufSize, data);
+}
+void API_ENTRY(glGetnUniformfvEXT)(GLuint program, GLint location, GLsizei bufSize, float *params) {
+    CALL_GL_API(glGetnUniformfvEXT, program, location, bufSize, params);
+}
+void API_ENTRY(glGetnUniformivEXT)(GLuint program, GLint location, GLsizei bufSize, GLint *params) {
+    CALL_GL_API(glGetnUniformivEXT, program, location, bufSize, params);
+}
+void API_ENTRY(glTexStorage1DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) {
+    CALL_GL_API(glTexStorage1DEXT, target, levels, internalformat, width);
+}
+void API_ENTRY(glTexStorage2DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
+    CALL_GL_API(glTexStorage2DEXT, target, levels, internalformat, width, height);
+}
+void API_ENTRY(glTexStorage3DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
+    CALL_GL_API(glTexStorage3DEXT, target, levels, internalformat, width, height, depth);
+}
+void API_ENTRY(glTextureStorage1DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) {
+    CALL_GL_API(glTextureStorage1DEXT, texture, target, levels, internalformat, width);
+}
+void API_ENTRY(glTextureStorage2DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
+    CALL_GL_API(glTextureStorage2DEXT, texture, target, levels, internalformat, width, height);
+}
+void API_ENTRY(glTextureStorage3DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
+    CALL_GL_API(glTextureStorage3DEXT, texture, target, levels, internalformat, width, height, depth);
+}
 void API_ENTRY(glClipPlanefIMG)(GLenum p, const GLfloat *eqn) {
     CALL_GL_API(glClipPlanefIMG, p, eqn);
 }
diff --git a/opengl/libs/GLES_trace/gltrace.proto b/opengl/libs/GLES_trace/gltrace.proto
index 7dde69f..11cf24f 100644
--- a/opengl/libs/GLES_trace/gltrace.proto
+++ b/opengl/libs/GLES_trace/gltrace.proto
@@ -400,6 +400,68 @@
         glViewport = 374;
         glWeightPointerOES = 375;
 
+        glActiveShaderProgramEXT = 502;
+        glAlphaFuncQCOM = 503;
+        glBeginQueryEXT = 504;
+        glBindProgramPipelineEXT = 505;
+        glBlitFramebufferANGLE = 506;
+        glCreateShaderProgramvEXT = 507;
+        glDeleteProgramPipelinesEXT = 508;
+        glDeleteQueriesEXT = 509;
+        glDrawBuffersNV = 510;
+        glEndQueryEXT = 511;
+        glFramebufferTexture2DMultisampleEXT = 512;
+        glGenProgramPipelinesEXT = 513;
+        glGenQueriesEXT = 514;
+        glGetGraphicsResetStatusEXT = 515;
+        glGetObjectLabelEXT = 516;
+        glGetProgramPipelineInfoLogEXT = 517;
+        glGetProgramPipelineivEXT = 518;
+        glGetQueryObjectuivEXT = 519;
+        glGetQueryivEXT = 520;
+        glGetnUniformfvEXT = 521;
+        glGetnUniformivEXT = 521;
+        glInsertEventMarkerEXT = 522;
+        glIsProgramPipelineEXT = 523;
+        glIsQueryEXT = 524;
+        glLabelObjectEXT = 525;
+        glPopGroupMarkerEXT = 526;
+        glProgramParameteriEXT = 527;
+        glProgramUniform1fEXT = 528;
+        glProgramUniform1fvEXT = 529;
+        glProgramUniform1iEXT = 530;
+        glProgramUniform1ivEXT = 531;
+        glProgramUniform2fEXT = 532;
+        glProgramUniform2fvEXT = 533;
+        glProgramUniform2iEXT = 534;
+        glProgramUniform2ivEXT = 535;
+        glProgramUniform3fEXT = 536;
+        glProgramUniform3fvEXT = 537;
+        glProgramUniform3iEXT = 538;
+        glProgramUniform3ivEXT = 539;
+        glProgramUniform4fEXT = 540;
+        glProgramUniform4fvEXT = 541;
+        glProgramUniform4iEXT = 542;
+        glProgramUniform4ivEXT = 543;
+        glProgramUniformMatrix2fvEXT = 544;
+        glProgramUniformMatrix3fvEXT = 545;
+        glProgramUniformMatrix4fvEXT = 546;
+        glPushGroupMarkerEXT = 547;
+        glReadBufferNV = 548;
+        glReadnPixelsEXT = 549;
+        glRenderbufferStorageMultisampleANGLE = 550;
+        glRenderbufferStorageMultisampleAPPLE = 551;
+        glRenderbufferStorageMultisampleEXT = 552;
+        glResolveMultisampleFramebufferAPPLE = 553;
+        glTexStorage1DEXT = 554;
+        glTexStorage2DEXT = 555;
+        glTexStorage3DEXT = 556;
+        glTextureStorage1DEXT = 557;
+        glTextureStorage2DEXT = 558;
+        glTextureStorage3DEXT = 559;
+        glUseProgramStagesEXT = 560;
+        glValidateProgramPipelineEXT = 561;
+
         eglGetDisplay = 2000;
         eglInitialize = 2001;
         eglTerminate = 2002;
diff --git a/opengl/libs/GLES_trace/src/gltrace.pb.cpp b/opengl/libs/GLES_trace/src/gltrace.pb.cpp
index 9a90603..bb9d4a7 100644
--- a/opengl/libs/GLES_trace/src/gltrace.pb.cpp
+++ b/opengl/libs/GLES_trace/src/gltrace.pb.cpp
@@ -419,6 +419,66 @@
     case 373:
     case 374:
     case 375:
+    case 502:
+    case 503:
+    case 504:
+    case 505:
+    case 506:
+    case 507:
+    case 508:
+    case 509:
+    case 510:
+    case 511:
+    case 512:
+    case 513:
+    case 514:
+    case 515:
+    case 516:
+    case 517:
+    case 518:
+    case 519:
+    case 520:
+    case 521:
+    case 522:
+    case 523:
+    case 524:
+    case 525:
+    case 526:
+    case 527:
+    case 528:
+    case 529:
+    case 530:
+    case 531:
+    case 532:
+    case 533:
+    case 534:
+    case 535:
+    case 536:
+    case 537:
+    case 538:
+    case 539:
+    case 540:
+    case 541:
+    case 542:
+    case 543:
+    case 544:
+    case 545:
+    case 546:
+    case 547:
+    case 548:
+    case 549:
+    case 550:
+    case 551:
+    case 552:
+    case 553:
+    case 554:
+    case 555:
+    case 556:
+    case 557:
+    case 558:
+    case 559:
+    case 560:
+    case 561:
     case 2000:
     case 2001:
     case 2002:
@@ -850,6 +910,67 @@
 const GLMessage_Function GLMessage::glVertexPointer;
 const GLMessage_Function GLMessage::glViewport;
 const GLMessage_Function GLMessage::glWeightPointerOES;
+const GLMessage_Function GLMessage::glActiveShaderProgramEXT;
+const GLMessage_Function GLMessage::glAlphaFuncQCOM;
+const GLMessage_Function GLMessage::glBeginQueryEXT;
+const GLMessage_Function GLMessage::glBindProgramPipelineEXT;
+const GLMessage_Function GLMessage::glBlitFramebufferANGLE;
+const GLMessage_Function GLMessage::glCreateShaderProgramvEXT;
+const GLMessage_Function GLMessage::glDeleteProgramPipelinesEXT;
+const GLMessage_Function GLMessage::glDeleteQueriesEXT;
+const GLMessage_Function GLMessage::glDrawBuffersNV;
+const GLMessage_Function GLMessage::glEndQueryEXT;
+const GLMessage_Function GLMessage::glFramebufferTexture2DMultisampleEXT;
+const GLMessage_Function GLMessage::glGenProgramPipelinesEXT;
+const GLMessage_Function GLMessage::glGenQueriesEXT;
+const GLMessage_Function GLMessage::glGetGraphicsResetStatusEXT;
+const GLMessage_Function GLMessage::glGetObjectLabelEXT;
+const GLMessage_Function GLMessage::glGetProgramPipelineInfoLogEXT;
+const GLMessage_Function GLMessage::glGetProgramPipelineivEXT;
+const GLMessage_Function GLMessage::glGetQueryObjectuivEXT;
+const GLMessage_Function GLMessage::glGetQueryivEXT;
+const GLMessage_Function GLMessage::glGetnUniformfvEXT;
+const GLMessage_Function GLMessage::glGetnUniformivEXT;
+const GLMessage_Function GLMessage::glInsertEventMarkerEXT;
+const GLMessage_Function GLMessage::glIsProgramPipelineEXT;
+const GLMessage_Function GLMessage::glIsQueryEXT;
+const GLMessage_Function GLMessage::glLabelObjectEXT;
+const GLMessage_Function GLMessage::glPopGroupMarkerEXT;
+const GLMessage_Function GLMessage::glProgramParameteriEXT;
+const GLMessage_Function GLMessage::glProgramUniform1fEXT;
+const GLMessage_Function GLMessage::glProgramUniform1fvEXT;
+const GLMessage_Function GLMessage::glProgramUniform1iEXT;
+const GLMessage_Function GLMessage::glProgramUniform1ivEXT;
+const GLMessage_Function GLMessage::glProgramUniform2fEXT;
+const GLMessage_Function GLMessage::glProgramUniform2fvEXT;
+const GLMessage_Function GLMessage::glProgramUniform2iEXT;
+const GLMessage_Function GLMessage::glProgramUniform2ivEXT;
+const GLMessage_Function GLMessage::glProgramUniform3fEXT;
+const GLMessage_Function GLMessage::glProgramUniform3fvEXT;
+const GLMessage_Function GLMessage::glProgramUniform3iEXT;
+const GLMessage_Function GLMessage::glProgramUniform3ivEXT;
+const GLMessage_Function GLMessage::glProgramUniform4fEXT;
+const GLMessage_Function GLMessage::glProgramUniform4fvEXT;
+const GLMessage_Function GLMessage::glProgramUniform4iEXT;
+const GLMessage_Function GLMessage::glProgramUniform4ivEXT;
+const GLMessage_Function GLMessage::glProgramUniformMatrix2fvEXT;
+const GLMessage_Function GLMessage::glProgramUniformMatrix3fvEXT;
+const GLMessage_Function GLMessage::glProgramUniformMatrix4fvEXT;
+const GLMessage_Function GLMessage::glPushGroupMarkerEXT;
+const GLMessage_Function GLMessage::glReadBufferNV;
+const GLMessage_Function GLMessage::glReadnPixelsEXT;
+const GLMessage_Function GLMessage::glRenderbufferStorageMultisampleANGLE;
+const GLMessage_Function GLMessage::glRenderbufferStorageMultisampleAPPLE;
+const GLMessage_Function GLMessage::glRenderbufferStorageMultisampleEXT;
+const GLMessage_Function GLMessage::glResolveMultisampleFramebufferAPPLE;
+const GLMessage_Function GLMessage::glTexStorage1DEXT;
+const GLMessage_Function GLMessage::glTexStorage2DEXT;
+const GLMessage_Function GLMessage::glTexStorage3DEXT;
+const GLMessage_Function GLMessage::glTextureStorage1DEXT;
+const GLMessage_Function GLMessage::glTextureStorage2DEXT;
+const GLMessage_Function GLMessage::glTextureStorage3DEXT;
+const GLMessage_Function GLMessage::glUseProgramStagesEXT;
+const GLMessage_Function GLMessage::glValidateProgramPipelineEXT;
 const GLMessage_Function GLMessage::eglGetDisplay;
 const GLMessage_Function GLMessage::eglInitialize;
 const GLMessage_Function GLMessage::eglTerminate;
diff --git a/opengl/libs/GLES_trace/src/gltrace.pb.h b/opengl/libs/GLES_trace/src/gltrace.pb.h
index 5a7a16f..e3b8990 100644
--- a/opengl/libs/GLES_trace/src/gltrace.pb.h
+++ b/opengl/libs/GLES_trace/src/gltrace.pb.h
@@ -427,6 +427,67 @@
   GLMessage_Function_glVertexPointer = 373,
   GLMessage_Function_glViewport = 374,
   GLMessage_Function_glWeightPointerOES = 375,
+  GLMessage_Function_glActiveShaderProgramEXT = 502,
+  GLMessage_Function_glAlphaFuncQCOM = 503,
+  GLMessage_Function_glBeginQueryEXT = 504,
+  GLMessage_Function_glBindProgramPipelineEXT = 505,
+  GLMessage_Function_glBlitFramebufferANGLE = 506,
+  GLMessage_Function_glCreateShaderProgramvEXT = 507,
+  GLMessage_Function_glDeleteProgramPipelinesEXT = 508,
+  GLMessage_Function_glDeleteQueriesEXT = 509,
+  GLMessage_Function_glDrawBuffersNV = 510,
+  GLMessage_Function_glEndQueryEXT = 511,
+  GLMessage_Function_glFramebufferTexture2DMultisampleEXT = 512,
+  GLMessage_Function_glGenProgramPipelinesEXT = 513,
+  GLMessage_Function_glGenQueriesEXT = 514,
+  GLMessage_Function_glGetGraphicsResetStatusEXT = 515,
+  GLMessage_Function_glGetObjectLabelEXT = 516,
+  GLMessage_Function_glGetProgramPipelineInfoLogEXT = 517,
+  GLMessage_Function_glGetProgramPipelineivEXT = 518,
+  GLMessage_Function_glGetQueryObjectuivEXT = 519,
+  GLMessage_Function_glGetQueryivEXT = 520,
+  GLMessage_Function_glGetnUniformfvEXT = 521,
+  GLMessage_Function_glGetnUniformivEXT = 521,
+  GLMessage_Function_glInsertEventMarkerEXT = 522,
+  GLMessage_Function_glIsProgramPipelineEXT = 523,
+  GLMessage_Function_glIsQueryEXT = 524,
+  GLMessage_Function_glLabelObjectEXT = 525,
+  GLMessage_Function_glPopGroupMarkerEXT = 526,
+  GLMessage_Function_glProgramParameteriEXT = 527,
+  GLMessage_Function_glProgramUniform1fEXT = 528,
+  GLMessage_Function_glProgramUniform1fvEXT = 529,
+  GLMessage_Function_glProgramUniform1iEXT = 530,
+  GLMessage_Function_glProgramUniform1ivEXT = 531,
+  GLMessage_Function_glProgramUniform2fEXT = 532,
+  GLMessage_Function_glProgramUniform2fvEXT = 533,
+  GLMessage_Function_glProgramUniform2iEXT = 534,
+  GLMessage_Function_glProgramUniform2ivEXT = 535,
+  GLMessage_Function_glProgramUniform3fEXT = 536,
+  GLMessage_Function_glProgramUniform3fvEXT = 537,
+  GLMessage_Function_glProgramUniform3iEXT = 538,
+  GLMessage_Function_glProgramUniform3ivEXT = 539,
+  GLMessage_Function_glProgramUniform4fEXT = 540,
+  GLMessage_Function_glProgramUniform4fvEXT = 541,
+  GLMessage_Function_glProgramUniform4iEXT = 542,
+  GLMessage_Function_glProgramUniform4ivEXT = 543,
+  GLMessage_Function_glProgramUniformMatrix2fvEXT = 544,
+  GLMessage_Function_glProgramUniformMatrix3fvEXT = 545,
+  GLMessage_Function_glProgramUniformMatrix4fvEXT = 546,
+  GLMessage_Function_glPushGroupMarkerEXT = 547,
+  GLMessage_Function_glReadBufferNV = 548,
+  GLMessage_Function_glReadnPixelsEXT = 549,
+  GLMessage_Function_glRenderbufferStorageMultisampleANGLE = 550,
+  GLMessage_Function_glRenderbufferStorageMultisampleAPPLE = 551,
+  GLMessage_Function_glRenderbufferStorageMultisampleEXT = 552,
+  GLMessage_Function_glResolveMultisampleFramebufferAPPLE = 553,
+  GLMessage_Function_glTexStorage1DEXT = 554,
+  GLMessage_Function_glTexStorage2DEXT = 555,
+  GLMessage_Function_glTexStorage3DEXT = 556,
+  GLMessage_Function_glTextureStorage1DEXT = 557,
+  GLMessage_Function_glTextureStorage2DEXT = 558,
+  GLMessage_Function_glTextureStorage3DEXT = 559,
+  GLMessage_Function_glUseProgramStagesEXT = 560,
+  GLMessage_Function_glValidateProgramPipelineEXT = 561,
   GLMessage_Function_eglGetDisplay = 2000,
   GLMessage_Function_eglInitialize = 2001,
   GLMessage_Function_eglTerminate = 2002,
@@ -1182,6 +1243,67 @@
   static const Function glVertexPointer = GLMessage_Function_glVertexPointer;
   static const Function glViewport = GLMessage_Function_glViewport;
   static const Function glWeightPointerOES = GLMessage_Function_glWeightPointerOES;
+  static const Function glActiveShaderProgramEXT = GLMessage_Function_glActiveShaderProgramEXT;
+  static const Function glAlphaFuncQCOM = GLMessage_Function_glAlphaFuncQCOM;
+  static const Function glBeginQueryEXT = GLMessage_Function_glBeginQueryEXT;
+  static const Function glBindProgramPipelineEXT = GLMessage_Function_glBindProgramPipelineEXT;
+  static const Function glBlitFramebufferANGLE = GLMessage_Function_glBlitFramebufferANGLE;
+  static const Function glCreateShaderProgramvEXT = GLMessage_Function_glCreateShaderProgramvEXT;
+  static const Function glDeleteProgramPipelinesEXT = GLMessage_Function_glDeleteProgramPipelinesEXT;
+  static const Function glDeleteQueriesEXT = GLMessage_Function_glDeleteQueriesEXT;
+  static const Function glDrawBuffersNV = GLMessage_Function_glDrawBuffersNV;
+  static const Function glEndQueryEXT = GLMessage_Function_glEndQueryEXT;
+  static const Function glFramebufferTexture2DMultisampleEXT = GLMessage_Function_glFramebufferTexture2DMultisampleEXT;
+  static const Function glGenProgramPipelinesEXT = GLMessage_Function_glGenProgramPipelinesEXT;
+  static const Function glGenQueriesEXT = GLMessage_Function_glGenQueriesEXT;
+  static const Function glGetGraphicsResetStatusEXT = GLMessage_Function_glGetGraphicsResetStatusEXT;
+  static const Function glGetObjectLabelEXT = GLMessage_Function_glGetObjectLabelEXT;
+  static const Function glGetProgramPipelineInfoLogEXT = GLMessage_Function_glGetProgramPipelineInfoLogEXT;
+  static const Function glGetProgramPipelineivEXT = GLMessage_Function_glGetProgramPipelineivEXT;
+  static const Function glGetQueryObjectuivEXT = GLMessage_Function_glGetQueryObjectuivEXT;
+  static const Function glGetQueryivEXT = GLMessage_Function_glGetQueryivEXT;
+  static const Function glGetnUniformfvEXT = GLMessage_Function_glGetnUniformfvEXT;
+  static const Function glGetnUniformivEXT = GLMessage_Function_glGetnUniformivEXT;
+  static const Function glInsertEventMarkerEXT = GLMessage_Function_glInsertEventMarkerEXT;
+  static const Function glIsProgramPipelineEXT = GLMessage_Function_glIsProgramPipelineEXT;
+  static const Function glIsQueryEXT = GLMessage_Function_glIsQueryEXT;
+  static const Function glLabelObjectEXT = GLMessage_Function_glLabelObjectEXT;
+  static const Function glPopGroupMarkerEXT = GLMessage_Function_glPopGroupMarkerEXT;
+  static const Function glProgramParameteriEXT = GLMessage_Function_glProgramParameteriEXT;
+  static const Function glProgramUniform1fEXT = GLMessage_Function_glProgramUniform1fEXT;
+  static const Function glProgramUniform1fvEXT = GLMessage_Function_glProgramUniform1fvEXT;
+  static const Function glProgramUniform1iEXT = GLMessage_Function_glProgramUniform1iEXT;
+  static const Function glProgramUniform1ivEXT = GLMessage_Function_glProgramUniform1ivEXT;
+  static const Function glProgramUniform2fEXT = GLMessage_Function_glProgramUniform2fEXT;
+  static const Function glProgramUniform2fvEXT = GLMessage_Function_glProgramUniform2fvEXT;
+  static const Function glProgramUniform2iEXT = GLMessage_Function_glProgramUniform2iEXT;
+  static const Function glProgramUniform2ivEXT = GLMessage_Function_glProgramUniform2ivEXT;
+  static const Function glProgramUniform3fEXT = GLMessage_Function_glProgramUniform3fEXT;
+  static const Function glProgramUniform3fvEXT = GLMessage_Function_glProgramUniform3fvEXT;
+  static const Function glProgramUniform3iEXT = GLMessage_Function_glProgramUniform3iEXT;
+  static const Function glProgramUniform3ivEXT = GLMessage_Function_glProgramUniform3ivEXT;
+  static const Function glProgramUniform4fEXT = GLMessage_Function_glProgramUniform4fEXT;
+  static const Function glProgramUniform4fvEXT = GLMessage_Function_glProgramUniform4fvEXT;
+  static const Function glProgramUniform4iEXT = GLMessage_Function_glProgramUniform4iEXT;
+  static const Function glProgramUniform4ivEXT = GLMessage_Function_glProgramUniform4ivEXT;
+  static const Function glProgramUniformMatrix2fvEXT = GLMessage_Function_glProgramUniformMatrix2fvEXT;
+  static const Function glProgramUniformMatrix3fvEXT = GLMessage_Function_glProgramUniformMatrix3fvEXT;
+  static const Function glProgramUniformMatrix4fvEXT = GLMessage_Function_glProgramUniformMatrix4fvEXT;
+  static const Function glPushGroupMarkerEXT = GLMessage_Function_glPushGroupMarkerEXT;
+  static const Function glReadBufferNV = GLMessage_Function_glReadBufferNV;
+  static const Function glReadnPixelsEXT = GLMessage_Function_glReadnPixelsEXT;
+  static const Function glRenderbufferStorageMultisampleANGLE = GLMessage_Function_glRenderbufferStorageMultisampleANGLE;
+  static const Function glRenderbufferStorageMultisampleAPPLE = GLMessage_Function_glRenderbufferStorageMultisampleAPPLE;
+  static const Function glRenderbufferStorageMultisampleEXT = GLMessage_Function_glRenderbufferStorageMultisampleEXT;
+  static const Function glResolveMultisampleFramebufferAPPLE = GLMessage_Function_glResolveMultisampleFramebufferAPPLE;
+  static const Function glTexStorage1DEXT = GLMessage_Function_glTexStorage1DEXT;
+  static const Function glTexStorage2DEXT = GLMessage_Function_glTexStorage2DEXT;
+  static const Function glTexStorage3DEXT = GLMessage_Function_glTexStorage3DEXT;
+  static const Function glTextureStorage1DEXT = GLMessage_Function_glTextureStorage1DEXT;
+  static const Function glTextureStorage2DEXT = GLMessage_Function_glTextureStorage2DEXT;
+  static const Function glTextureStorage3DEXT = GLMessage_Function_glTextureStorage3DEXT;
+  static const Function glUseProgramStagesEXT = GLMessage_Function_glUseProgramStagesEXT;
+  static const Function glValidateProgramPipelineEXT = GLMessage_Function_glValidateProgramPipelineEXT;
   static const Function eglGetDisplay = GLMessage_Function_eglGetDisplay;
   static const Function eglInitialize = GLMessage_Function_eglInitialize;
   static const Function eglTerminate = GLMessage_Function_eglTerminate;
diff --git a/opengl/libs/GLES_trace/src/gltrace_api.cpp b/opengl/libs/GLES_trace/src/gltrace_api.cpp
index c8e820d..a2366ac 100644
--- a/opengl/libs/GLES_trace/src/gltrace_api.cpp
+++ b/opengl/libs/GLES_trace/src/gltrace_api.cpp
@@ -5809,6 +5809,339 @@
     glContext->traceGLMessage(&glmsg);
 }
 
+void GLTrace_glBlitFramebufferANGLE(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glBlitFramebufferANGLE);
+
+    // copy argument srcX0
+    GLMessage_DataType *arg_srcX0 = glmsg.add_args();
+    arg_srcX0->set_isarray(false);
+    arg_srcX0->set_type(GLMessage::DataType::INT);
+    arg_srcX0->add_intvalue(srcX0);
+
+    // copy argument srcY0
+    GLMessage_DataType *arg_srcY0 = glmsg.add_args();
+    arg_srcY0->set_isarray(false);
+    arg_srcY0->set_type(GLMessage::DataType::INT);
+    arg_srcY0->add_intvalue(srcY0);
+
+    // copy argument srcX1
+    GLMessage_DataType *arg_srcX1 = glmsg.add_args();
+    arg_srcX1->set_isarray(false);
+    arg_srcX1->set_type(GLMessage::DataType::INT);
+    arg_srcX1->add_intvalue(srcX1);
+
+    // copy argument srcY1
+    GLMessage_DataType *arg_srcY1 = glmsg.add_args();
+    arg_srcY1->set_isarray(false);
+    arg_srcY1->set_type(GLMessage::DataType::INT);
+    arg_srcY1->add_intvalue(srcY1);
+
+    // copy argument dstX0
+    GLMessage_DataType *arg_dstX0 = glmsg.add_args();
+    arg_dstX0->set_isarray(false);
+    arg_dstX0->set_type(GLMessage::DataType::INT);
+    arg_dstX0->add_intvalue(dstX0);
+
+    // copy argument dstY0
+    GLMessage_DataType *arg_dstY0 = glmsg.add_args();
+    arg_dstY0->set_isarray(false);
+    arg_dstY0->set_type(GLMessage::DataType::INT);
+    arg_dstY0->add_intvalue(dstY0);
+
+    // copy argument dstX1
+    GLMessage_DataType *arg_dstX1 = glmsg.add_args();
+    arg_dstX1->set_isarray(false);
+    arg_dstX1->set_type(GLMessage::DataType::INT);
+    arg_dstX1->add_intvalue(dstX1);
+
+    // copy argument dstY1
+    GLMessage_DataType *arg_dstY1 = glmsg.add_args();
+    arg_dstY1->set_isarray(false);
+    arg_dstY1->set_type(GLMessage::DataType::INT);
+    arg_dstY1->add_intvalue(dstY1);
+
+    // copy argument mask
+    GLMessage_DataType *arg_mask = glmsg.add_args();
+    arg_mask->set_isarray(false);
+    arg_mask->set_type(GLMessage::DataType::INT);
+    arg_mask->add_intvalue(mask);
+
+    // copy argument filter
+    GLMessage_DataType *arg_filter = glmsg.add_args();
+    arg_filter->set_isarray(false);
+    arg_filter->set_type(GLMessage::DataType::ENUM);
+    arg_filter->add_intvalue((int)filter);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glBlitFramebufferANGLE(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glRenderbufferStorageMultisampleANGLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glRenderbufferStorageMultisampleANGLE);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument samples
+    GLMessage_DataType *arg_samples = glmsg.add_args();
+    arg_samples->set_isarray(false);
+    arg_samples->set_type(GLMessage::DataType::INT);
+    arg_samples->add_intvalue(samples);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::ENUM);
+    arg_internalformat->add_intvalue((int)internalformat);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glRenderbufferStorageMultisampleANGLE(target, samples, internalformat, width, height);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glRenderbufferStorageMultisampleAPPLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glRenderbufferStorageMultisampleAPPLE);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument samples
+    GLMessage_DataType *arg_samples = glmsg.add_args();
+    arg_samples->set_isarray(false);
+    arg_samples->set_type(GLMessage::DataType::INT);
+    arg_samples->add_intvalue(samples);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::ENUM);
+    arg_internalformat->add_intvalue((int)internalformat);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glRenderbufferStorageMultisampleAPPLE(target, samples, internalformat, width, height);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glResolveMultisampleFramebufferAPPLE(void) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glResolveMultisampleFramebufferAPPLE);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glResolveMultisampleFramebufferAPPLE();
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLabelObjectEXT(GLenum type, GLuint object, GLsizei length, const GLchar *label) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glLabelObjectEXT);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::ENUM);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument object
+    GLMessage_DataType *arg_object = glmsg.add_args();
+    arg_object->set_isarray(false);
+    arg_object->set_type(GLMessage::DataType::INT);
+    arg_object->add_intvalue(object);
+
+    // copy argument length
+    GLMessage_DataType *arg_length = glmsg.add_args();
+    arg_length->set_isarray(false);
+    arg_length->set_type(GLMessage::DataType::INT);
+    arg_length->add_intvalue(length);
+
+    // copy argument label
+    GLMessage_DataType *arg_label = glmsg.add_args();
+    arg_label->set_isarray(false);
+    arg_label->set_type(GLMessage::DataType::INT);
+    arg_label->add_intvalue((int)label);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glLabelObjectEXT(type, object, length, label);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetObjectLabelEXT(GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetObjectLabelEXT);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::ENUM);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument object
+    GLMessage_DataType *arg_object = glmsg.add_args();
+    arg_object->set_isarray(false);
+    arg_object->set_type(GLMessage::DataType::INT);
+    arg_object->add_intvalue(object);
+
+    // copy argument bufSize
+    GLMessage_DataType *arg_bufSize = glmsg.add_args();
+    arg_bufSize->set_isarray(false);
+    arg_bufSize->set_type(GLMessage::DataType::INT);
+    arg_bufSize->add_intvalue(bufSize);
+
+    // copy argument length
+    GLMessage_DataType *arg_length = glmsg.add_args();
+    arg_length->set_isarray(false);
+    arg_length->set_type(GLMessage::DataType::INT);
+    arg_length->add_intvalue((int)length);
+
+    // copy argument label
+    GLMessage_DataType *arg_label = glmsg.add_args();
+    arg_label->set_isarray(false);
+    arg_label->set_type(GLMessage::DataType::INT);
+    arg_label->add_intvalue((int)label);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetObjectLabelEXT(type, object, bufSize, length, label);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glInsertEventMarkerEXT(GLsizei length, const GLchar *marker) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glInsertEventMarkerEXT);
+
+    // copy argument length
+    GLMessage_DataType *arg_length = glmsg.add_args();
+    arg_length->set_isarray(false);
+    arg_length->set_type(GLMessage::DataType::INT);
+    arg_length->add_intvalue(length);
+
+    // copy argument marker
+    GLMessage_DataType *arg_marker = glmsg.add_args();
+    arg_marker->set_isarray(false);
+    arg_marker->set_type(GLMessage::DataType::INT);
+    arg_marker->add_intvalue((int)marker);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glInsertEventMarkerEXT(length, marker);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPushGroupMarkerEXT(GLsizei length, const GLchar *marker) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glPushGroupMarkerEXT);
+
+    // copy argument length
+    GLMessage_DataType *arg_length = glmsg.add_args();
+    arg_length->set_isarray(false);
+    arg_length->set_type(GLMessage::DataType::INT);
+    arg_length->add_intvalue(length);
+
+    // copy argument marker
+    GLMessage_DataType *arg_marker = glmsg.add_args();
+    arg_marker->set_isarray(false);
+    arg_marker->set_type(GLMessage::DataType::INT);
+    arg_marker->add_intvalue((int)marker);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glPushGroupMarkerEXT(length, marker);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPopGroupMarkerEXT(void) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glPopGroupMarkerEXT);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glPopGroupMarkerEXT();
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
 void GLTrace_glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum *attachments) {
     GLMessage glmsg;
     GLTraceContext *glContext = getGLTraceContext();
@@ -5842,6 +6175,102 @@
     glContext->traceGLMessage(&glmsg);
 }
 
+void GLTrace_glRenderbufferStorageMultisampleEXT(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glRenderbufferStorageMultisampleEXT);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument samples
+    GLMessage_DataType *arg_samples = glmsg.add_args();
+    arg_samples->set_isarray(false);
+    arg_samples->set_type(GLMessage::DataType::INT);
+    arg_samples->add_intvalue(samples);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::ENUM);
+    arg_internalformat->add_intvalue((int)internalformat);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glRenderbufferStorageMultisampleEXT(target, samples, internalformat, width, height);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFramebufferTexture2DMultisampleEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glFramebufferTexture2DMultisampleEXT);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument attachment
+    GLMessage_DataType *arg_attachment = glmsg.add_args();
+    arg_attachment->set_isarray(false);
+    arg_attachment->set_type(GLMessage::DataType::ENUM);
+    arg_attachment->add_intvalue((int)attachment);
+
+    // copy argument textarget
+    GLMessage_DataType *arg_textarget = glmsg.add_args();
+    arg_textarget->set_isarray(false);
+    arg_textarget->set_type(GLMessage::DataType::ENUM);
+    arg_textarget->add_intvalue((int)textarget);
+
+    // copy argument texture
+    GLMessage_DataType *arg_texture = glmsg.add_args();
+    arg_texture->set_isarray(false);
+    arg_texture->set_type(GLMessage::DataType::INT);
+    arg_texture->add_intvalue(texture);
+
+    // copy argument level
+    GLMessage_DataType *arg_level = glmsg.add_args();
+    arg_level->set_isarray(false);
+    arg_level->set_type(GLMessage::DataType::INT);
+    arg_level->add_intvalue(level);
+
+    // copy argument samples
+    GLMessage_DataType *arg_samples = glmsg.add_args();
+    arg_samples->set_isarray(false);
+    arg_samples->set_type(GLMessage::DataType::INT);
+    arg_samples->add_intvalue(samples);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glFramebufferTexture2DMultisampleEXT(target, attachment, textarget, texture, level, samples);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
 void GLTrace_glMultiDrawArraysEXT(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount) {
     GLMessage glmsg;
     GLTraceContext *glContext = getGLTraceContext();
@@ -5926,6 +6355,1769 @@
     glContext->traceGLMessage(&glmsg);
 }
 
+void GLTrace_glGenQueriesEXT(GLsizei n, GLuint *ids) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGenQueriesEXT);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument ids
+    GLMessage_DataType *arg_ids = glmsg.add_args();
+    arg_ids->set_isarray(false);
+    arg_ids->set_type(GLMessage::DataType::INT);
+    arg_ids->add_intvalue((int)ids);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGenQueriesEXT(n, ids);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeleteQueriesEXT(GLsizei n, const GLuint *ids) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDeleteQueriesEXT);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument ids
+    GLMessage_DataType *arg_ids = glmsg.add_args();
+    arg_ids->set_isarray(false);
+    arg_ids->set_type(GLMessage::DataType::INT);
+    arg_ids->add_intvalue((int)ids);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDeleteQueriesEXT(n, ids);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+GLboolean GLTrace_glIsQueryEXT(GLuint id) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glIsQueryEXT);
+
+    // copy argument id
+    GLMessage_DataType *arg_id = glmsg.add_args();
+    arg_id->set_isarray(false);
+    arg_id->set_type(GLMessage::DataType::INT);
+    arg_id->add_intvalue(id);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLboolean retValue = glContext->hooks->gl.glIsQueryEXT(id);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glBeginQueryEXT(GLenum target, GLuint id) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glBeginQueryEXT);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument id
+    GLMessage_DataType *arg_id = glmsg.add_args();
+    arg_id->set_isarray(false);
+    arg_id->set_type(GLMessage::DataType::INT);
+    arg_id->add_intvalue(id);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glBeginQueryEXT(target, id);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glEndQueryEXT(GLenum target) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glEndQueryEXT);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glEndQueryEXT(target);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetQueryivEXT(GLenum target, GLenum pname, GLint *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetQueryivEXT);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetQueryivEXT(target, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetQueryObjectuivEXT);
+
+    // copy argument id
+    GLMessage_DataType *arg_id = glmsg.add_args();
+    arg_id->set_isarray(false);
+    arg_id->set_type(GLMessage::DataType::INT);
+    arg_id->add_intvalue(id);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetQueryObjectuivEXT(id, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+GLenum GLTrace_glGetGraphicsResetStatusEXT(void) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetGraphicsResetStatusEXT);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLenum retValue = glContext->hooks->gl.glGetGraphicsResetStatusEXT();
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::ENUM);
+    rt->add_intvalue((int)retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glReadnPixelsEXT(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glReadnPixelsEXT);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // copy argument format
+    GLMessage_DataType *arg_format = glmsg.add_args();
+    arg_format->set_isarray(false);
+    arg_format->set_type(GLMessage::DataType::ENUM);
+    arg_format->add_intvalue((int)format);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::ENUM);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument bufSize
+    GLMessage_DataType *arg_bufSize = glmsg.add_args();
+    arg_bufSize->set_isarray(false);
+    arg_bufSize->set_type(GLMessage::DataType::INT);
+    arg_bufSize->add_intvalue(bufSize);
+
+    // copy argument data
+    GLMessage_DataType *arg_data = glmsg.add_args();
+    arg_data->set_isarray(false);
+    arg_data->set_type(GLMessage::DataType::INT);
+    arg_data->add_intvalue((int)data);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glReadnPixelsEXT(x, y, width, height, format, type, bufSize, data);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetnUniformfvEXT(GLuint program, GLint location, GLsizei bufSize, float *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetnUniformfvEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument bufSize
+    GLMessage_DataType *arg_bufSize = glmsg.add_args();
+    arg_bufSize->set_isarray(false);
+    arg_bufSize->set_type(GLMessage::DataType::INT);
+    arg_bufSize->add_intvalue(bufSize);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetnUniformfvEXT(program, location, bufSize, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetnUniformivEXT(GLuint program, GLint location, GLsizei bufSize, GLint *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetnUniformivEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument bufSize
+    GLMessage_DataType *arg_bufSize = glmsg.add_args();
+    arg_bufSize->set_isarray(false);
+    arg_bufSize->set_type(GLMessage::DataType::INT);
+    arg_bufSize->add_intvalue(bufSize);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetnUniformivEXT(program, location, bufSize, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUseProgramStagesEXT(GLuint pipeline, GLbitfield stages, GLuint program) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glUseProgramStagesEXT);
+
+    // copy argument pipeline
+    GLMessage_DataType *arg_pipeline = glmsg.add_args();
+    arg_pipeline->set_isarray(false);
+    arg_pipeline->set_type(GLMessage::DataType::INT);
+    arg_pipeline->add_intvalue(pipeline);
+
+    // copy argument stages
+    GLMessage_DataType *arg_stages = glmsg.add_args();
+    arg_stages->set_isarray(false);
+    arg_stages->set_type(GLMessage::DataType::INT);
+    arg_stages->add_intvalue(stages);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glUseProgramStagesEXT(pipeline, stages, program);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glActiveShaderProgramEXT(GLuint pipeline, GLuint program) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glActiveShaderProgramEXT);
+
+    // copy argument pipeline
+    GLMessage_DataType *arg_pipeline = glmsg.add_args();
+    arg_pipeline->set_isarray(false);
+    arg_pipeline->set_type(GLMessage::DataType::INT);
+    arg_pipeline->add_intvalue(pipeline);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glActiveShaderProgramEXT(pipeline, program);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+GLuint GLTrace_glCreateShaderProgramvEXT(GLenum type, GLsizei count, const GLchar **strings) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glCreateShaderProgramvEXT);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::ENUM);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument strings
+    GLMessage_DataType *arg_strings = glmsg.add_args();
+    arg_strings->set_isarray(false);
+    arg_strings->set_type(GLMessage::DataType::INT);
+    arg_strings->add_intvalue((int)strings);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLuint retValue = glContext->hooks->gl.glCreateShaderProgramvEXT(type, count, strings);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::INT);
+    rt->add_intvalue(retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glBindProgramPipelineEXT(GLuint pipeline) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glBindProgramPipelineEXT);
+
+    // copy argument pipeline
+    GLMessage_DataType *arg_pipeline = glmsg.add_args();
+    arg_pipeline->set_isarray(false);
+    arg_pipeline->set_type(GLMessage::DataType::INT);
+    arg_pipeline->add_intvalue(pipeline);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glBindProgramPipelineEXT(pipeline);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeleteProgramPipelinesEXT(GLsizei n, const GLuint *pipelines) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDeleteProgramPipelinesEXT);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument pipelines
+    GLMessage_DataType *arg_pipelines = glmsg.add_args();
+    arg_pipelines->set_isarray(false);
+    arg_pipelines->set_type(GLMessage::DataType::INT);
+    arg_pipelines->add_intvalue((int)pipelines);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDeleteProgramPipelinesEXT(n, pipelines);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGenProgramPipelinesEXT(GLsizei n, GLuint *pipelines) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGenProgramPipelinesEXT);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument pipelines
+    GLMessage_DataType *arg_pipelines = glmsg.add_args();
+    arg_pipelines->set_isarray(false);
+    arg_pipelines->set_type(GLMessage::DataType::INT);
+    arg_pipelines->add_intvalue((int)pipelines);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGenProgramPipelinesEXT(n, pipelines);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+GLboolean GLTrace_glIsProgramPipelineEXT(GLuint pipeline) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glIsProgramPipelineEXT);
+
+    // copy argument pipeline
+    GLMessage_DataType *arg_pipeline = glmsg.add_args();
+    arg_pipeline->set_isarray(false);
+    arg_pipeline->set_type(GLMessage::DataType::INT);
+    arg_pipeline->add_intvalue(pipeline);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLboolean retValue = glContext->hooks->gl.glIsProgramPipelineEXT(pipeline);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glProgramParameteriEXT(GLuint program, GLenum pname, GLint value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramParameteriEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue(value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramParameteriEXT(program, pname, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetProgramPipelineivEXT(GLuint pipeline, GLenum pname, GLint *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetProgramPipelineivEXT);
+
+    // copy argument pipeline
+    GLMessage_DataType *arg_pipeline = glmsg.add_args();
+    arg_pipeline->set_isarray(false);
+    arg_pipeline->set_type(GLMessage::DataType::INT);
+    arg_pipeline->add_intvalue(pipeline);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetProgramPipelineivEXT(pipeline, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform1iEXT(GLuint program, GLint location, GLint x) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform1iEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform1iEXT(program, location, x);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform2iEXT(GLuint program, GLint location, GLint x, GLint y) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform2iEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform2iEXT(program, location, x, y);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform3iEXT(GLuint program, GLint location, GLint x, GLint y, GLint z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform3iEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::INT);
+    arg_z->add_intvalue(z);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform3iEXT(program, location, x, y, z);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform4iEXT(GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform4iEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::INT);
+    arg_z->add_intvalue(z);
+
+    // copy argument w
+    GLMessage_DataType *arg_w = glmsg.add_args();
+    arg_w->set_isarray(false);
+    arg_w->set_type(GLMessage::DataType::INT);
+    arg_w->add_intvalue(w);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform4iEXT(program, location, x, y, z, w);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform1fEXT(GLuint program, GLint location, GLfloat x) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform1fEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::FLOAT);
+    arg_x->add_floatvalue(x);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform1fEXT(program, location, x);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform2fEXT(GLuint program, GLint location, GLfloat x, GLfloat y) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform2fEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::FLOAT);
+    arg_x->add_floatvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::FLOAT);
+    arg_y->add_floatvalue(y);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform2fEXT(program, location, x, y);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform3fEXT(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform3fEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::FLOAT);
+    arg_x->add_floatvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::FLOAT);
+    arg_y->add_floatvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::FLOAT);
+    arg_z->add_floatvalue(z);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform3fEXT(program, location, x, y, z);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform4fEXT(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform4fEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::FLOAT);
+    arg_x->add_floatvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::FLOAT);
+    arg_y->add_floatvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::FLOAT);
+    arg_z->add_floatvalue(z);
+
+    // copy argument w
+    GLMessage_DataType *arg_w = glmsg.add_args();
+    arg_w->set_isarray(false);
+    arg_w->set_type(GLMessage::DataType::FLOAT);
+    arg_w->add_floatvalue(w);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform4fEXT(program, location, x, y, z, w);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform1ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform1ivEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue((int)value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform1ivEXT(program, location, count, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform2ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform2ivEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue((int)value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform2ivEXT(program, location, count, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform3ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform3ivEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue((int)value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform3ivEXT(program, location, count, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform4ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform4ivEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue((int)value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform4ivEXT(program, location, count, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform1fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform1fvEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue((int)value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform1fvEXT(program, location, count, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform2fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform2fvEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue((int)value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform2fvEXT(program, location, count, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform3fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform3fvEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue((int)value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform3fvEXT(program, location, count, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform4fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform4fvEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue((int)value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform4fvEXT(program, location, count, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniformMatrix2fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniformMatrix2fvEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument transpose
+    GLMessage_DataType *arg_transpose = glmsg.add_args();
+    arg_transpose->set_isarray(false);
+    arg_transpose->set_type(GLMessage::DataType::BOOL);
+    arg_transpose->add_boolvalue(transpose);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue((int)value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniformMatrix2fvEXT(program, location, count, transpose, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniformMatrix3fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniformMatrix3fvEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument transpose
+    GLMessage_DataType *arg_transpose = glmsg.add_args();
+    arg_transpose->set_isarray(false);
+    arg_transpose->set_type(GLMessage::DataType::BOOL);
+    arg_transpose->add_boolvalue(transpose);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue((int)value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniformMatrix3fvEXT(program, location, count, transpose, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniformMatrix4fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniformMatrix4fvEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument transpose
+    GLMessage_DataType *arg_transpose = glmsg.add_args();
+    arg_transpose->set_isarray(false);
+    arg_transpose->set_type(GLMessage::DataType::BOOL);
+    arg_transpose->add_boolvalue(transpose);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue((int)value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniformMatrix4fvEXT(program, location, count, transpose, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glValidateProgramPipelineEXT(GLuint pipeline) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glValidateProgramPipelineEXT);
+
+    // copy argument pipeline
+    GLMessage_DataType *arg_pipeline = glmsg.add_args();
+    arg_pipeline->set_isarray(false);
+    arg_pipeline->set_type(GLMessage::DataType::INT);
+    arg_pipeline->add_intvalue(pipeline);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glValidateProgramPipelineEXT(pipeline);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetProgramPipelineInfoLogEXT(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetProgramPipelineInfoLogEXT);
+
+    // copy argument pipeline
+    GLMessage_DataType *arg_pipeline = glmsg.add_args();
+    arg_pipeline->set_isarray(false);
+    arg_pipeline->set_type(GLMessage::DataType::INT);
+    arg_pipeline->add_intvalue(pipeline);
+
+    // copy argument bufSize
+    GLMessage_DataType *arg_bufSize = glmsg.add_args();
+    arg_bufSize->set_isarray(false);
+    arg_bufSize->set_type(GLMessage::DataType::INT);
+    arg_bufSize->add_intvalue(bufSize);
+
+    // copy argument length
+    GLMessage_DataType *arg_length = glmsg.add_args();
+    arg_length->set_isarray(false);
+    arg_length->set_type(GLMessage::DataType::INT);
+    arg_length->add_intvalue((int)length);
+
+    // copy argument infoLog
+    GLMessage_DataType *arg_infoLog = glmsg.add_args();
+    arg_infoLog->set_isarray(false);
+    arg_infoLog->set_type(GLMessage::DataType::INT);
+    arg_infoLog->add_intvalue((int)infoLog);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetProgramPipelineInfoLogEXT(pipeline, bufSize, length, infoLog);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexStorage1DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexStorage1DEXT);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument levels
+    GLMessage_DataType *arg_levels = glmsg.add_args();
+    arg_levels->set_isarray(false);
+    arg_levels->set_type(GLMessage::DataType::INT);
+    arg_levels->add_intvalue(levels);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::ENUM);
+    arg_internalformat->add_intvalue((int)internalformat);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexStorage1DEXT(target, levels, internalformat, width);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexStorage2DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexStorage2DEXT);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument levels
+    GLMessage_DataType *arg_levels = glmsg.add_args();
+    arg_levels->set_isarray(false);
+    arg_levels->set_type(GLMessage::DataType::INT);
+    arg_levels->add_intvalue(levels);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::ENUM);
+    arg_internalformat->add_intvalue((int)internalformat);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexStorage2DEXT(target, levels, internalformat, width, height);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexStorage3DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexStorage3DEXT);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument levels
+    GLMessage_DataType *arg_levels = glmsg.add_args();
+    arg_levels->set_isarray(false);
+    arg_levels->set_type(GLMessage::DataType::INT);
+    arg_levels->add_intvalue(levels);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::ENUM);
+    arg_internalformat->add_intvalue((int)internalformat);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // copy argument depth
+    GLMessage_DataType *arg_depth = glmsg.add_args();
+    arg_depth->set_isarray(false);
+    arg_depth->set_type(GLMessage::DataType::INT);
+    arg_depth->add_intvalue(depth);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexStorage3DEXT(target, levels, internalformat, width, height, depth);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTextureStorage1DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTextureStorage1DEXT);
+
+    // copy argument texture
+    GLMessage_DataType *arg_texture = glmsg.add_args();
+    arg_texture->set_isarray(false);
+    arg_texture->set_type(GLMessage::DataType::INT);
+    arg_texture->add_intvalue(texture);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument levels
+    GLMessage_DataType *arg_levels = glmsg.add_args();
+    arg_levels->set_isarray(false);
+    arg_levels->set_type(GLMessage::DataType::INT);
+    arg_levels->add_intvalue(levels);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::ENUM);
+    arg_internalformat->add_intvalue((int)internalformat);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTextureStorage1DEXT(texture, target, levels, internalformat, width);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTextureStorage2DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTextureStorage2DEXT);
+
+    // copy argument texture
+    GLMessage_DataType *arg_texture = glmsg.add_args();
+    arg_texture->set_isarray(false);
+    arg_texture->set_type(GLMessage::DataType::INT);
+    arg_texture->add_intvalue(texture);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument levels
+    GLMessage_DataType *arg_levels = glmsg.add_args();
+    arg_levels->set_isarray(false);
+    arg_levels->set_type(GLMessage::DataType::INT);
+    arg_levels->add_intvalue(levels);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::ENUM);
+    arg_internalformat->add_intvalue((int)internalformat);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTextureStorage2DEXT(texture, target, levels, internalformat, width, height);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTextureStorage3DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTextureStorage3DEXT);
+
+    // copy argument texture
+    GLMessage_DataType *arg_texture = glmsg.add_args();
+    arg_texture->set_isarray(false);
+    arg_texture->set_type(GLMessage::DataType::INT);
+    arg_texture->add_intvalue(texture);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument levels
+    GLMessage_DataType *arg_levels = glmsg.add_args();
+    arg_levels->set_isarray(false);
+    arg_levels->set_type(GLMessage::DataType::INT);
+    arg_levels->add_intvalue(levels);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::ENUM);
+    arg_internalformat->add_intvalue((int)internalformat);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // copy argument depth
+    GLMessage_DataType *arg_depth = glmsg.add_args();
+    arg_depth->set_isarray(false);
+    arg_depth->set_type(GLMessage::DataType::INT);
+    arg_depth->add_intvalue(depth);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTextureStorage3DEXT(texture, target, levels, internalformat, width, height, depth);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
 void GLTrace_glRenderbufferStorageMultisampleIMG(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
     GLMessage glmsg;
     GLTraceContext *glContext = getGLTraceContext();
@@ -6022,6 +8214,75 @@
     glContext->traceGLMessage(&glmsg);
 }
 
+void GLTrace_glCoverageMaskNV(GLboolean mask) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glCoverageMaskNV);
+
+    // copy argument mask
+    GLMessage_DataType *arg_mask = glmsg.add_args();
+    arg_mask->set_isarray(false);
+    arg_mask->set_type(GLMessage::DataType::BOOL);
+    arg_mask->add_boolvalue(mask);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glCoverageMaskNV(mask);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glCoverageOperationNV(GLenum operation) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glCoverageOperationNV);
+
+    // copy argument operation
+    GLMessage_DataType *arg_operation = glmsg.add_args();
+    arg_operation->set_isarray(false);
+    arg_operation->set_type(GLMessage::DataType::ENUM);
+    arg_operation->add_intvalue((int)operation);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glCoverageOperationNV(operation);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDrawBuffersNV(GLsizei n, const GLenum *bufs) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDrawBuffersNV);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument bufs
+    GLMessage_DataType *arg_bufs = glmsg.add_args();
+    arg_bufs->set_isarray(false);
+    arg_bufs->set_type(GLMessage::DataType::INT);
+    arg_bufs->add_intvalue((int)bufs);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDrawBuffersNV(n, bufs);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
 void GLTrace_glDeleteFencesNV(GLsizei n, const GLuint *fences) {
     GLMessage glmsg;
     GLTraceContext *glContext = getGLTraceContext();
@@ -6215,42 +8476,48 @@
     glContext->traceGLMessage(&glmsg);
 }
 
-void GLTrace_glCoverageMaskNV(GLboolean mask) {
+void GLTrace_glReadBufferNV(GLenum mode) {
     GLMessage glmsg;
     GLTraceContext *glContext = getGLTraceContext();
 
-    glmsg.set_function(GLMessage::glCoverageMaskNV);
+    glmsg.set_function(GLMessage::glReadBufferNV);
 
-    // copy argument mask
-    GLMessage_DataType *arg_mask = glmsg.add_args();
-    arg_mask->set_isarray(false);
-    arg_mask->set_type(GLMessage::DataType::BOOL);
-    arg_mask->add_boolvalue(mask);
+    // copy argument mode
+    GLMessage_DataType *arg_mode = glmsg.add_args();
+    arg_mode->set_isarray(false);
+    arg_mode->set_type(GLMessage::DataType::ENUM);
+    arg_mode->add_intvalue((int)mode);
 
     // call function
     nsecs_t start_time = systemTime();
-    glContext->hooks->gl.glCoverageMaskNV(mask);
+    glContext->hooks->gl.glReadBufferNV(mode);
     nsecs_t end_time = systemTime();
 
     fixupGLMessage(glContext, start_time, end_time, &glmsg);
     glContext->traceGLMessage(&glmsg);
 }
 
-void GLTrace_glCoverageOperationNV(GLenum operation) {
+void GLTrace_glAlphaFuncQCOM(GLenum func, GLclampf ref) {
     GLMessage glmsg;
     GLTraceContext *glContext = getGLTraceContext();
 
-    glmsg.set_function(GLMessage::glCoverageOperationNV);
+    glmsg.set_function(GLMessage::glAlphaFuncQCOM);
 
-    // copy argument operation
-    GLMessage_DataType *arg_operation = glmsg.add_args();
-    arg_operation->set_isarray(false);
-    arg_operation->set_type(GLMessage::DataType::ENUM);
-    arg_operation->add_intvalue((int)operation);
+    // copy argument func
+    GLMessage_DataType *arg_func = glmsg.add_args();
+    arg_func->set_isarray(false);
+    arg_func->set_type(GLMessage::DataType::ENUM);
+    arg_func->add_intvalue((int)func);
+
+    // copy argument ref
+    GLMessage_DataType *arg_ref = glmsg.add_args();
+    arg_ref->set_isarray(false);
+    arg_ref->set_type(GLMessage::DataType::FLOAT);
+    arg_ref->add_floatvalue(ref);
 
     // call function
     nsecs_t start_time = systemTime();
-    glContext->hooks->gl.glCoverageOperationNV(operation);
+    glContext->hooks->gl.glAlphaFuncQCOM(func, ref);
     nsecs_t end_time = systemTime();
 
     fixupGLMessage(glContext, start_time, end_time, &glmsg);
diff --git a/opengl/libs/GLES_trace/src/gltrace_api.h b/opengl/libs/GLES_trace/src/gltrace_api.h
index 71b5a584..debcac0 100644
--- a/opengl/libs/GLES_trace/src/gltrace_api.h
+++ b/opengl/libs/GLES_trace/src/gltrace_api.h
@@ -194,11 +194,72 @@
 void GLTrace_glBeginPerfMonitorAMD(GLuint monitor);
 void GLTrace_glEndPerfMonitorAMD(GLuint monitor);
 void GLTrace_glGetPerfMonitorCounterDataAMD(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
+void GLTrace_glBlitFramebufferANGLE(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+void GLTrace_glRenderbufferStorageMultisampleANGLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+void GLTrace_glRenderbufferStorageMultisampleAPPLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+void GLTrace_glResolveMultisampleFramebufferAPPLE(void);
+void GLTrace_glLabelObjectEXT(GLenum type, GLuint object, GLsizei length, const GLchar *label);
+void GLTrace_glGetObjectLabelEXT(GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
+void GLTrace_glInsertEventMarkerEXT(GLsizei length, const GLchar *marker);
+void GLTrace_glPushGroupMarkerEXT(GLsizei length, const GLchar *marker);
+void GLTrace_glPopGroupMarkerEXT(void);
 void GLTrace_glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum *attachments);
+void GLTrace_glRenderbufferStorageMultisampleEXT(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+void GLTrace_glFramebufferTexture2DMultisampleEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
 void GLTrace_glMultiDrawArraysEXT(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
 void GLTrace_glMultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+void GLTrace_glGenQueriesEXT(GLsizei n, GLuint *ids);
+void GLTrace_glDeleteQueriesEXT(GLsizei n, const GLuint *ids);
+GLboolean GLTrace_glIsQueryEXT(GLuint id);
+void GLTrace_glBeginQueryEXT(GLenum target, GLuint id);
+void GLTrace_glEndQueryEXT(GLenum target);
+void GLTrace_glGetQueryivEXT(GLenum target, GLenum pname, GLint *params);
+void GLTrace_glGetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint *params);
+GLenum GLTrace_glGetGraphicsResetStatusEXT(void);
+void GLTrace_glReadnPixelsEXT(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+void GLTrace_glGetnUniformfvEXT(GLuint program, GLint location, GLsizei bufSize, float *params);
+void GLTrace_glGetnUniformivEXT(GLuint program, GLint location, GLsizei bufSize, GLint *params);
+void GLTrace_glUseProgramStagesEXT(GLuint pipeline, GLbitfield stages, GLuint program);
+void GLTrace_glActiveShaderProgramEXT(GLuint pipeline, GLuint program);
+GLuint GLTrace_glCreateShaderProgramvEXT(GLenum type, GLsizei count, const GLchar **strings);
+void GLTrace_glBindProgramPipelineEXT(GLuint pipeline);
+void GLTrace_glDeleteProgramPipelinesEXT(GLsizei n, const GLuint *pipelines);
+void GLTrace_glGenProgramPipelinesEXT(GLsizei n, GLuint *pipelines);
+GLboolean GLTrace_glIsProgramPipelineEXT(GLuint pipeline);
+void GLTrace_glProgramParameteriEXT(GLuint program, GLenum pname, GLint value);
+void GLTrace_glGetProgramPipelineivEXT(GLuint pipeline, GLenum pname, GLint *params);
+void GLTrace_glProgramUniform1iEXT(GLuint program, GLint location, GLint x);
+void GLTrace_glProgramUniform2iEXT(GLuint program, GLint location, GLint x, GLint y);
+void GLTrace_glProgramUniform3iEXT(GLuint program, GLint location, GLint x, GLint y, GLint z);
+void GLTrace_glProgramUniform4iEXT(GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w);
+void GLTrace_glProgramUniform1fEXT(GLuint program, GLint location, GLfloat x);
+void GLTrace_glProgramUniform2fEXT(GLuint program, GLint location, GLfloat x, GLfloat y);
+void GLTrace_glProgramUniform3fEXT(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z);
+void GLTrace_glProgramUniform4fEXT(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+void GLTrace_glProgramUniform1ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value);
+void GLTrace_glProgramUniform2ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value);
+void GLTrace_glProgramUniform3ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value);
+void GLTrace_glProgramUniform4ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value);
+void GLTrace_glProgramUniform1fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+void GLTrace_glProgramUniform2fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+void GLTrace_glProgramUniform3fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+void GLTrace_glProgramUniform4fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+void GLTrace_glProgramUniformMatrix2fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+void GLTrace_glProgramUniformMatrix3fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+void GLTrace_glProgramUniformMatrix4fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+void GLTrace_glValidateProgramPipelineEXT(GLuint pipeline);
+void GLTrace_glGetProgramPipelineInfoLogEXT(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+void GLTrace_glTexStorage1DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+void GLTrace_glTexStorage2DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+void GLTrace_glTexStorage3DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+void GLTrace_glTextureStorage1DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+void GLTrace_glTextureStorage2DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+void GLTrace_glTextureStorage3DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
 void GLTrace_glRenderbufferStorageMultisampleIMG(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
 void GLTrace_glFramebufferTexture2DMultisampleIMG(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+void GLTrace_glCoverageMaskNV(GLboolean mask);
+void GLTrace_glCoverageOperationNV(GLenum operation);
+void GLTrace_glDrawBuffersNV(GLsizei n, const GLenum *bufs);
 void GLTrace_glDeleteFencesNV(GLsizei n, const GLuint *fences);
 void GLTrace_glGenFencesNV(GLsizei n, GLuint *fences);
 GLboolean GLTrace_glIsFenceNV(GLuint fence);
@@ -206,8 +267,8 @@
 void GLTrace_glGetFenceivNV(GLuint fence, GLenum pname, GLint *params);
 void GLTrace_glFinishFenceNV(GLuint fence);
 void GLTrace_glSetFenceNV(GLuint fence, GLenum condition);
-void GLTrace_glCoverageMaskNV(GLboolean mask);
-void GLTrace_glCoverageOperationNV(GLenum operation);
+void GLTrace_glReadBufferNV(GLenum mode);
+void GLTrace_glAlphaFuncQCOM(GLenum func, GLclampf ref);
 void GLTrace_glGetDriverControlsQCOM(GLint *num, GLsizei size, GLuint *driverControls);
 void GLTrace_glGetDriverControlStringQCOM(GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
 void GLTrace_glEnableDriverControlQCOM(GLuint driverControl);
diff --git a/opengl/libs/GLES_trace/src/gltrace_eglapi.cpp b/opengl/libs/GLES_trace/src/gltrace_eglapi.cpp
index c237d75..c442153 100644
--- a/opengl/libs/GLES_trace/src/gltrace_eglapi.cpp
+++ b/opengl/libs/GLES_trace/src/gltrace_eglapi.cpp
@@ -77,12 +77,10 @@
 }
 
 void GLTrace_start() {
-    char value[PROPERTY_VALUE_MAX];
+    char udsName[PROPERTY_VALUE_MAX];
 
-    property_get("debug.egl.debug_port", value, "5039");
-    const unsigned short port = (unsigned short)atoi(value);
-
-    int clientSocket = gltrace::acceptClientConnection(port);
+    property_get("debug.egl.debug_portname", udsName, "gltrace");
+    int clientSocket = gltrace::acceptClientConnection(udsName);
     if (clientSocket < 0) {
         ALOGE("Error creating GLTrace server socket. Quitting application.");
         exit(-1);
diff --git a/opengl/libs/GLES_trace/src/gltrace_fixup.cpp b/opengl/libs/GLES_trace/src/gltrace_fixup.cpp
index 5220aa4..871b5dc 100644
--- a/opengl/libs/GLES_trace/src/gltrace_fixup.cpp
+++ b/opengl/libs/GLES_trace/src/gltrace_fixup.cpp
@@ -107,19 +107,11 @@
     fb->add_contents(fbcontents, fbsize);
 }
 
-void fixup_glTexImage2D(GLMessage *glmsg) {
-    /* void glTexImage2D(GLenum target,
-                        GLint level,
-                        GLint internalformat,
-                        GLsizei width,
-                        GLsizei height,
-                        GLint border,
-                        GLenum format,
-                        GLenum type,
-                        const GLvoid *data); 
-     */
-    GLMessage_DataType arg_width  = glmsg->args(3);
-    GLMessage_DataType arg_height = glmsg->args(4);
+/** Common fixup routing for glTexImage2D & glTexSubImage2D. */
+void fixup_glTexImage(int widthIndex, int heightIndex, GLMessage *glmsg) {
+    GLMessage_DataType arg_width  = glmsg->args(widthIndex);
+    GLMessage_DataType arg_height = glmsg->args(heightIndex);
+
     GLMessage_DataType arg_format = glmsg->args(6);
     GLMessage_DataType arg_type   = glmsg->args(7);
     GLMessage_DataType *arg_data  = glmsg->mutable_args(8);
@@ -133,21 +125,51 @@
     int bytesPerTexel = getBytesPerTexel(format, type);
 
     arg_data->set_type(GLMessage::DataType::BYTE);
-    arg_data->set_isarray(true);
     arg_data->clear_rawbytes();
 
     if (data != NULL) {
+        arg_data->set_isarray(true);
         arg_data->add_rawbytes(data, bytesPerTexel * width * height);
     } else {
-        ALOGE("fixup_glTexImage2D: image data is NULL.\n");
+        arg_data->set_isarray(false);
         arg_data->set_type(GLMessage::DataType::VOID);
-        // FIXME:
-        // This will create the texture, but it will be uninitialized. 
-        // It can later be initialized with glTexSubImage2D or by
-        // attaching an FBO to it and rendering into the FBO.
     }
 }
 
+
+void fixup_glTexImage2D(GLMessage *glmsg) {
+    /* void glTexImage2D(GLenum target,
+                        GLint level,
+                        GLint internalformat,
+                        GLsizei width,
+                        GLsizei height,
+                        GLint border,
+                        GLenum format,
+                        GLenum type,
+                        const GLvoid *data); 
+    */
+    int widthIndex = 3;
+    int heightIndex = 4;
+    fixup_glTexImage(widthIndex, heightIndex, glmsg);
+}
+
+void fixup_glTexSubImage2D(GLMessage *glmsg) {
+    /*
+    void glTexSubImage2D(GLenum target,
+                        GLint level,
+                        GLint xoffset,
+                        GLint yoffset,
+                        GLsizei width,
+                        GLsizei height,
+                        GLenum format,
+                        GLenum type,
+                        const GLvoid * data);
+    */
+    int widthIndex = 4;
+    int heightIndex = 5;
+    fixup_glTexImage(widthIndex, heightIndex, glmsg);
+}
+
 void fixup_glShaderSource(GLMessage *glmsg) {
     /* void glShaderSource(GLuint shader, GLsizei count, const GLchar** string, 
                                     const GLint* length) */
@@ -218,6 +240,14 @@
     fixup_GenericIntArray(1, n, glmsg);
 }
 
+void fixup_glDeleteGeneric(GLMessage *glmsg) {
+    /* void glDelete*(GLsizei n, GLuint *buffers); */
+    GLMessage_DataType arg_n  = glmsg->args(0);
+    GLsizei n = arg_n.intvalue(0);
+
+    fixup_GenericIntArray(1, n, glmsg);
+}
+
 void fixup_glGetBooleanv(GLMessage *glmsg) {
     /* void glGetBooleanv(GLenum pname, GLboolean *params); */
     GLMessage_DataType *arg_params = glmsg->mutable_args(1);
@@ -250,10 +280,16 @@
 
     // do any custom message dependent processing
     switch (glmsg->function()) {
-    case GLMessage::glGenBuffers:        /* void glGenBuffers(GLsizei n, GLuint * buffers); */
-    case GLMessage::glGenFramebuffers:   /* void glGenFramebuffers(GLsizei n, GLuint * buffers); */
-    case GLMessage::glGenRenderbuffers:  /* void glGenFramebuffers(GLsizei n, GLuint * buffers); */
-    case GLMessage::glGenTextures:       /* void glGenTextures(GLsizei n, GLuint * buffers); */
+    case GLMessage::glDeleteBuffers:      /* glDeleteBuffers(GLsizei n, GLuint *buffers); */
+    case GLMessage::glDeleteFramebuffers: /* glDeleteFramebuffers(GLsizei n, GLuint *buffers); */
+    case GLMessage::glDeleteRenderbuffers:/* glDeleteRenderbuffers(GLsizei n, GLuint *buffers); */
+    case GLMessage::glDeleteTextures:     /* glDeleteTextures(GLsizei n, GLuint *textures); */
+        fixup_glDeleteGeneric(glmsg);
+        break;
+    case GLMessage::glGenBuffers:        /* void glGenBuffers(GLsizei n, GLuint *buffers); */
+    case GLMessage::glGenFramebuffers:   /* void glGenFramebuffers(GLsizei n, GLuint *buffers); */
+    case GLMessage::glGenRenderbuffers:  /* void glGenFramebuffers(GLsizei n, GLuint *buffers); */
+    case GLMessage::glGenTextures:       /* void glGenTextures(GLsizei n, GLuint *textures); */
         fixup_glGenGeneric(glmsg);
         break;
     case GLMessage::glGetAttribLocation:  
@@ -287,6 +323,11 @@
             fixup_glTexImage2D(glmsg);
         }
         break;
+    case GLMessage::glTexSubImage2D:
+        if (context->getGlobalTraceState()->shouldCollectTextureDataOnGlTexImage()) {
+            fixup_glTexSubImage2D(glmsg);
+        }
+        break;
     case GLMessage::glShaderSource:
         fixup_glShaderSource(glmsg);
         break;
@@ -317,6 +358,14 @@
             fixup_addFBContents(context, glmsg, CURRENTLY_BOUND_FB);
         }
         break;
+    case GLMessage::glPushGroupMarkerEXT:
+        /* void PushGroupMarkerEXT(sizei length, const char *marker); */
+        fixup_CStringPtr(1, glmsg);
+        break;
+    case GLMessage::glInsertEventMarkerEXT:
+        /* void InsertEventMarkerEXT(sizei length, const char *marker); */
+        fixup_CStringPtr(1, glmsg);
+        break;
     default:
         break;
     }
diff --git a/opengl/libs/GLES_trace/src/gltrace_transport.cpp b/opengl/libs/GLES_trace/src/gltrace_transport.cpp
index ce3fae5..5251b12 100644
--- a/opengl/libs/GLES_trace/src/gltrace_transport.cpp
+++ b/opengl/libs/GLES_trace/src/gltrace_transport.cpp
@@ -17,9 +17,10 @@
 #include <stdlib.h>
 #include <unistd.h>
 
+#include <unistd.h>
 #include <sys/socket.h>
+#include <sys/un.h>
 #include <netinet/in.h>
-#include <arpa/inet.h>
 
 #include <cutils/log.h>
 
@@ -28,22 +29,24 @@
 namespace android {
 namespace gltrace {
 
-int acceptClientConnection(int serverPort) {
-    int serverSocket = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
+int acceptClientConnection(char *sockname) {
+    int serverSocket = socket(AF_LOCAL, SOCK_STREAM, 0);
     if (serverSocket < 0) {
         ALOGE("Error (%d) while creating socket. Check if app has network permissions.",
                                                                             serverSocket);
         return -1;
     }
 
-    struct sockaddr_in server, client;
+    struct sockaddr_un server, client;
 
-    server.sin_family = AF_INET;
-    server.sin_addr.s_addr = htonl(INADDR_ANY);
-    server.sin_port = htons(serverPort);
+    memset(&server, 0, sizeof server);
+    server.sun_family = AF_UNIX;
+    // the first byte of sun_path should be '\0' for abstract namespace
+    strcpy(server.sun_path + 1, sockname);
 
-    socklen_t sockaddr_len = sizeof(sockaddr_in);
-    if (bind(serverSocket, (struct sockaddr *) &server, sizeof(server)) < 0) {
+    // note that sockaddr_len should be set to the exact size of the buffer that is used.
+    socklen_t sockaddr_len = sizeof(server.sun_family) + strlen(sockname) + 1;
+    if (bind(serverSocket, (struct sockaddr *) &server, sockaddr_len) < 0) {
         close(serverSocket);
         ALOGE("Failed to bind the server socket");
         return -1;
@@ -55,7 +58,7 @@
         return -1;
     }
 
-    ALOGD("gltrace::waitForClientConnection: server listening @ port %d", serverPort);
+    ALOGD("gltrace::waitForClientConnection: server listening @ path %s", sockname);
 
     int clientSocket = accept(serverSocket, (struct sockaddr *)&client, &sockaddr_len);
     if (clientSocket < 0) {
@@ -64,7 +67,7 @@
         return -1;
     }
 
-    ALOGD("gltrace::waitForClientConnection: client connected: %s", inet_ntoa(client.sin_addr));
+    ALOGD("gltrace::waitForClientConnection: client connected.");
 
     // do not accept any more incoming connections
     close(serverSocket);
diff --git a/opengl/libs/GLES_trace/src/gltrace_transport.h b/opengl/libs/GLES_trace/src/gltrace_transport.h
index d31df7b..3665035 100644
--- a/opengl/libs/GLES_trace/src/gltrace_transport.h
+++ b/opengl/libs/GLES_trace/src/gltrace_transport.h
@@ -76,10 +76,11 @@
 };
 
 /**
- * Utility method: start a server at @serverPort, and wait for a client
- * connection. Returns the connected client socket on success, or -1 on failure.
+ * Utility method: start a server listening at @sockName (unix domain socket,
+ * abstract namespace path), and wait for a client connection.
+ * Returns the connected client socket on success, or -1 on failure.
  */
-int acceptClientConnection(int serverPort);
+int acceptClientConnection(char *sockName);
 
 };
 };
diff --git a/opengl/libs/GLES_trace/tools/genapi.py b/opengl/libs/GLES_trace/tools/genapi.py
index 9b7a1cf..557e407 100755
--- a/opengl/libs/GLES_trace/tools/genapi.py
+++ b/opengl/libs/GLES_trace/tools/genapi.py
@@ -26,11 +26,11 @@
 #   module. The only reason to use pyratemp is that it is extremly
 #   simple to install:
 #   $ wget http://www.simple-is-better.org/template/pyratemp-current/pyratemp.py
-#   Put the file in the GLES2_trace/tools folder, or update PYTHONPATH
+#   Put the file in the GLES_trace/tools folder, or update PYTHONPATH
 #   to point to wherever it was downloaded.
 #
 # USAGE
-#   $ cd GLES2_trace      - run the program from GLES2_trace folder
+#   $ cd GLES_trace       - run the program from GLES2_trace folder
 #   $ ./tools/genapi.py   - generates a .cpp and .h file
 #   $ mv *.cpp *.h src/   - move the generated files into the src folder
 
diff --git a/opengl/libs/GLES_trace/tools/testgenapi.py b/opengl/libs/GLES_trace/tools/testgenapi.py
index 58a12a8..fe14954 100644
--- a/opengl/libs/GLES_trace/tools/testgenapi.py
+++ b/opengl/libs/GLES_trace/tools/testgenapi.py
@@ -15,7 +15,7 @@
 # limitations under the License.
 #
 # USAGE
-#   $ cd GLES2_trace/tools
+#   $ cd GLES_trace/tools
 #   $ python testgenapi.py
 
 import unittest
@@ -45,9 +45,9 @@
         glext_apis = getApis('../../GLES_CM/glext_api.in', 'GL1Ext')
 
         self.assertEqual(len(gl2_apis), 142)
-        self.assertEqual(len(gl2ext_apis), 60)
+        self.assertEqual(len(gl2ext_apis), 121)
         self.assertEqual(len(gl_apis), 145)
-        self.assertEqual(len(glext_apis), 126)
+        self.assertEqual(len(glext_apis), 140)
 
     def test_parseArgs(self):
         args = parseArgs("void")
diff --git a/opengl/libs/egl_impl.h b/opengl/libs/egl_impl.h
index a809316..8ff51ec 100644
--- a/opengl/libs/egl_impl.h
+++ b/opengl/libs/egl_impl.h
@@ -29,6 +29,7 @@
 namespace android {
 // ----------------------------------------------------------------------------
 
+EGLAPI const GLubyte * egl_get_string_for_current_context(GLenum name);
 EGLAPI EGLImageKHR egl_get_image_for_current_context(EGLImageKHR image);
 
 // ----------------------------------------------------------------------------
diff --git a/opengl/libs/entries.in b/opengl/libs/entries.in
index 61acb5f..6316d78 100644
--- a/opengl/libs/entries.in
+++ b/opengl/libs/entries.in
@@ -1,13 +1,17 @@
+GL_ENTRY(void, glActiveShaderProgramEXT, GLuint pipeline, GLuint program)
 GL_ENTRY(void, glActiveTexture, GLenum texture)
 GL_ENTRY(void, glAlphaFunc, GLenum func, GLclampf ref)
+GL_ENTRY(void, glAlphaFuncQCOM, GLenum func, GLclampf ref)
 GL_ENTRY(void, glAlphaFuncx, GLenum func, GLclampx ref)
 GL_ENTRY(void, glAlphaFuncxOES, GLenum func, GLclampx ref)
 GL_ENTRY(void, glAttachShader, GLuint program, GLuint shader)
 GL_ENTRY(void, glBeginPerfMonitorAMD, GLuint monitor)
+GL_ENTRY(void, glBeginQueryEXT, GLenum target, GLuint id)
 GL_ENTRY(void, glBindAttribLocation, GLuint program, GLuint index, const GLchar* name)
 GL_ENTRY(void, glBindBuffer, GLenum target, GLuint buffer)
 GL_ENTRY(void, glBindFramebuffer, GLenum target, GLuint framebuffer)
 GL_ENTRY(void, glBindFramebufferOES, GLenum target, GLuint framebuffer)
+GL_ENTRY(void, glBindProgramPipelineEXT, GLuint pipeline)
 GL_ENTRY(void, glBindRenderbuffer, GLenum target, GLuint renderbuffer)
 GL_ENTRY(void, glBindRenderbufferOES, GLenum target, GLuint renderbuffer)
 GL_ENTRY(void, glBindTexture, GLenum target, GLuint texture)
@@ -20,6 +24,7 @@
 GL_ENTRY(void, glBlendFunc, GLenum sfactor, GLenum dfactor)
 GL_ENTRY(void, glBlendFuncSeparate, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
 GL_ENTRY(void, glBlendFuncSeparateOES, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
+GL_ENTRY(void, glBlitFramebufferANGLE, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
 GL_ENTRY(void, glBufferData, GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage)
 GL_ENTRY(void, glBufferSubData, GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data)
 GL_ENTRY(GLenum, glCheckFramebufferStatus, GLenum target)
@@ -58,6 +63,7 @@
 GL_ENTRY(void, glCoverageOperationNV, GLenum operation)
 GL_ENTRY(GLuint, glCreateProgram, void)
 GL_ENTRY(GLuint, glCreateShader, GLenum type)
+GL_ENTRY(GLuint, glCreateShaderProgramvEXT, GLenum type, GLsizei count, const GLchar **strings)
 GL_ENTRY(void, glCullFace, GLenum mode)
 GL_ENTRY(void, glCurrentPaletteMatrixOES, GLuint matrixpaletteindex)
 GL_ENTRY(void, glDeleteBuffers, GLsizei n, const GLuint *buffers)
@@ -66,6 +72,8 @@
 GL_ENTRY(void, glDeleteFramebuffersOES, GLsizei n, const GLuint* framebuffers)
 GL_ENTRY(void, glDeletePerfMonitorsAMD, GLsizei n, GLuint *monitors)
 GL_ENTRY(void, glDeleteProgram, GLuint program)
+GL_ENTRY(void, glDeleteProgramPipelinesEXT, GLsizei n, const GLuint *pipelines)
+GL_ENTRY(void, glDeleteQueriesEXT, GLsizei n, const GLuint *ids)
 GL_ENTRY(void, glDeleteRenderbuffers, GLsizei n, const GLuint* renderbuffers)
 GL_ENTRY(void, glDeleteRenderbuffersOES, GLsizei n, const GLuint* renderbuffers)
 GL_ENTRY(void, glDeleteShader, GLuint shader)
@@ -84,6 +92,7 @@
 GL_ENTRY(void, glDisableVertexAttribArray, GLuint index)
 GL_ENTRY(void, glDiscardFramebufferEXT, GLenum target, GLsizei numAttachments, const GLenum *attachments)
 GL_ENTRY(void, glDrawArrays, GLenum mode, GLint first, GLsizei count)
+GL_ENTRY(void, glDrawBuffersNV, GLsizei n, const GLenum *bufs)
 GL_ENTRY(void, glDrawElements, GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
 GL_ENTRY(void, glDrawTexfOES, GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height)
 GL_ENTRY(void, glDrawTexfvOES, const GLfloat *coords)
@@ -100,6 +109,7 @@
 GL_ENTRY(void, glEnableDriverControlQCOM, GLuint driverControl)
 GL_ENTRY(void, glEnableVertexAttribArray, GLuint index)
 GL_ENTRY(void, glEndPerfMonitorAMD, GLuint monitor)
+GL_ENTRY(void, glEndQueryEXT, GLenum target)
 GL_ENTRY(void, glEndTilingQCOM, GLbitfield preserveMask)
 GL_ENTRY(void, glExtGetBufferPointervQCOM, GLenum target, GLvoid **params)
 GL_ENTRY(void, glExtGetBuffersQCOM, GLuint *buffers, GLint maxBuffers, GLint *numBuffers)
@@ -125,6 +135,7 @@
 GL_ENTRY(void, glFramebufferRenderbuffer, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
 GL_ENTRY(void, glFramebufferRenderbufferOES, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
 GL_ENTRY(void, glFramebufferTexture2D, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+GL_ENTRY(void, glFramebufferTexture2DMultisampleEXT, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
 GL_ENTRY(void, glFramebufferTexture2DMultisampleIMG, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
 GL_ENTRY(void, glFramebufferTexture2DOES, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
 GL_ENTRY(void, glFramebufferTexture3DOES, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
@@ -138,6 +149,8 @@
 GL_ENTRY(void, glGenFramebuffers, GLsizei n, GLuint* framebuffers)
 GL_ENTRY(void, glGenFramebuffersOES, GLsizei n, GLuint* framebuffers)
 GL_ENTRY(void, glGenPerfMonitorsAMD, GLsizei n, GLuint *monitors)
+GL_ENTRY(void, glGenProgramPipelinesEXT, GLsizei n, GLuint *pipelines)
+GL_ENTRY(void, glGenQueriesEXT, GLsizei n, GLuint *ids)
 GL_ENTRY(void, glGenRenderbuffers, GLsizei n, GLuint* renderbuffers)
 GL_ENTRY(void, glGenRenderbuffersOES, GLsizei n, GLuint* renderbuffers)
 GL_ENTRY(void, glGenTextures, GLsizei n, GLuint *textures)
@@ -164,6 +177,7 @@
 GL_ENTRY(void, glGetFloatv, GLenum pname, GLfloat *params)
 GL_ENTRY(void, glGetFramebufferAttachmentParameteriv, GLenum target, GLenum attachment, GLenum pname, GLint* params)
 GL_ENTRY(void, glGetFramebufferAttachmentParameterivOES, GLenum target, GLenum attachment, GLenum pname, GLint* params)
+GL_ENTRY(GLenum, glGetGraphicsResetStatusEXT, void)
 GL_ENTRY(void, glGetIntegerv, GLenum pname, GLint *params)
 GL_ENTRY(void, glGetLightfv, GLenum light, GLenum pname, GLfloat *params)
 GL_ENTRY(void, glGetLightxv, GLenum light, GLenum pname, GLfixed *params)
@@ -171,6 +185,7 @@
 GL_ENTRY(void, glGetMaterialfv, GLenum face, GLenum pname, GLfloat *params)
 GL_ENTRY(void, glGetMaterialxv, GLenum face, GLenum pname, GLfixed *params)
 GL_ENTRY(void, glGetMaterialxvOES, GLenum face, GLenum pname, GLfixed *params)
+GL_ENTRY(void, glGetObjectLabelEXT, GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label)
 GL_ENTRY(void, glGetPerfMonitorCounterDataAMD, GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten)
 GL_ENTRY(void, glGetPerfMonitorCounterInfoAMD, GLuint group, GLuint counter, GLenum pname, GLvoid *data)
 GL_ENTRY(void, glGetPerfMonitorCounterStringAMD, GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString)
@@ -180,7 +195,11 @@
 GL_ENTRY(void, glGetPointerv, GLenum pname, GLvoid **params)
 GL_ENTRY(void, glGetProgramBinaryOES, GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary)
 GL_ENTRY(void, glGetProgramInfoLog, GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog)
+GL_ENTRY(void, glGetProgramPipelineInfoLogEXT, GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog)
+GL_ENTRY(void, glGetProgramPipelineivEXT, GLuint pipeline, GLenum pname, GLint *params)
 GL_ENTRY(void, glGetProgramiv, GLuint program, GLenum pname, GLint* params)
+GL_ENTRY(void, glGetQueryObjectuivEXT, GLuint id, GLenum pname, GLuint *params)
+GL_ENTRY(void, glGetQueryivEXT, GLenum target, GLenum pname, GLint *params)
 GL_ENTRY(void, glGetRenderbufferParameteriv, GLenum target, GLenum pname, GLint* params)
 GL_ENTRY(void, glGetRenderbufferParameterivOES, GLenum target, GLenum pname, GLint* params)
 GL_ENTRY(void, glGetShaderInfoLog, GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog)
@@ -205,18 +224,24 @@
 GL_ENTRY(void, glGetVertexAttribPointerv, GLuint index, GLenum pname, GLvoid** pointer)
 GL_ENTRY(void, glGetVertexAttribfv, GLuint index, GLenum pname, GLfloat* params)
 GL_ENTRY(void, glGetVertexAttribiv, GLuint index, GLenum pname, GLint* params)
+GL_ENTRY(void, glGetnUniformfvEXT, GLuint program, GLint location, GLsizei bufSize, float *params)
+GL_ENTRY(void, glGetnUniformivEXT, GLuint program, GLint location, GLsizei bufSize, GLint *params)
 GL_ENTRY(void, glHint, GLenum target, GLenum mode)
+GL_ENTRY(void, glInsertEventMarkerEXT, GLsizei length, const GLchar *marker)
 GL_ENTRY(GLboolean, glIsBuffer, GLuint buffer)
 GL_ENTRY(GLboolean, glIsEnabled, GLenum cap)
 GL_ENTRY(GLboolean, glIsFenceNV, GLuint fence)
 GL_ENTRY(GLboolean, glIsFramebuffer, GLuint framebuffer)
 GL_ENTRY(GLboolean, glIsFramebufferOES, GLuint framebuffer)
 GL_ENTRY(GLboolean, glIsProgram, GLuint program)
+GL_ENTRY(GLboolean, glIsProgramPipelineEXT, GLuint pipeline)
+GL_ENTRY(GLboolean, glIsQueryEXT, GLuint id)
 GL_ENTRY(GLboolean, glIsRenderbuffer, GLuint renderbuffer)
 GL_ENTRY(GLboolean, glIsRenderbufferOES, GLuint renderbuffer)
 GL_ENTRY(GLboolean, glIsShader, GLuint shader)
 GL_ENTRY(GLboolean, glIsTexture, GLuint texture)
 GL_ENTRY(GLboolean, glIsVertexArrayOES, GLuint array)
+GL_ENTRY(void, glLabelObjectEXT, GLenum type, GLuint object, GLsizei length, const GLchar *label)
 GL_ENTRY(void, glLightModelf, GLenum pname, GLfloat param)
 GL_ENTRY(void, glLightModelfv, GLenum pname, const GLfloat *params)
 GL_ENTRY(void, glLightModelx, GLenum pname, GLfixed param)
@@ -278,15 +303,43 @@
 GL_ENTRY(void, glPolygonOffset, GLfloat factor, GLfloat units)
 GL_ENTRY(void, glPolygonOffsetx, GLfixed factor, GLfixed units)
 GL_ENTRY(void, glPolygonOffsetxOES, GLfixed factor, GLfixed units)
+GL_ENTRY(void, glPopGroupMarkerEXT, void)
 GL_ENTRY(void, glPopMatrix, void)
 GL_ENTRY(void, glProgramBinaryOES, GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length)
+GL_ENTRY(void, glProgramParameteriEXT, GLuint program, GLenum pname, GLint value)
+GL_ENTRY(void, glProgramUniform1fEXT, GLuint program, GLint location, GLfloat x)
+GL_ENTRY(void, glProgramUniform1fvEXT, GLuint program, GLint location, GLsizei count, const GLfloat *value)
+GL_ENTRY(void, glProgramUniform1iEXT, GLuint program, GLint location, GLint x)
+GL_ENTRY(void, glProgramUniform1ivEXT, GLuint program, GLint location, GLsizei count, const GLint *value)
+GL_ENTRY(void, glProgramUniform2fEXT, GLuint program, GLint location, GLfloat x, GLfloat y)
+GL_ENTRY(void, glProgramUniform2fvEXT, GLuint program, GLint location, GLsizei count, const GLfloat *value)
+GL_ENTRY(void, glProgramUniform2iEXT, GLuint program, GLint location, GLint x, GLint y)
+GL_ENTRY(void, glProgramUniform2ivEXT, GLuint program, GLint location, GLsizei count, const GLint *value)
+GL_ENTRY(void, glProgramUniform3fEXT, GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z)
+GL_ENTRY(void, glProgramUniform3fvEXT, GLuint program, GLint location, GLsizei count, const GLfloat *value)
+GL_ENTRY(void, glProgramUniform3iEXT, GLuint program, GLint location, GLint x, GLint y, GLint z)
+GL_ENTRY(void, glProgramUniform3ivEXT, GLuint program, GLint location, GLsizei count, const GLint *value)
+GL_ENTRY(void, glProgramUniform4fEXT, GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+GL_ENTRY(void, glProgramUniform4fvEXT, GLuint program, GLint location, GLsizei count, const GLfloat *value)
+GL_ENTRY(void, glProgramUniform4iEXT, GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w)
+GL_ENTRY(void, glProgramUniform4ivEXT, GLuint program, GLint location, GLsizei count, const GLint *value)
+GL_ENTRY(void, glProgramUniformMatrix2fvEXT, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+GL_ENTRY(void, glProgramUniformMatrix3fvEXT, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+GL_ENTRY(void, glProgramUniformMatrix4fvEXT, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+GL_ENTRY(void, glPushGroupMarkerEXT, GLsizei length, const GLchar *marker)
 GL_ENTRY(void, glPushMatrix, void)
 GL_ENTRY(GLbitfield, glQueryMatrixxOES, GLfixed mantissa[16], GLint exponent[16])
+GL_ENTRY(void, glReadBufferNV, GLenum mode)
 GL_ENTRY(void, glReadPixels, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)
+GL_ENTRY(void, glReadnPixelsEXT, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data)
 GL_ENTRY(void, glReleaseShaderCompiler, void)
 GL_ENTRY(void, glRenderbufferStorage, GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
+GL_ENTRY(void, glRenderbufferStorageMultisampleANGLE, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+GL_ENTRY(void, glRenderbufferStorageMultisampleAPPLE, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+GL_ENTRY(void, glRenderbufferStorageMultisampleEXT, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
 GL_ENTRY(void, glRenderbufferStorageMultisampleIMG, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
 GL_ENTRY(void, glRenderbufferStorageOES, GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
+GL_ENTRY(void, glResolveMultisampleFramebufferAPPLE, void)
 GL_ENTRY(void, glRotatef, GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
 GL_ENTRY(void, glRotatex, GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
 GL_ENTRY(void, glRotatexOES, GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
@@ -335,8 +388,14 @@
 GL_ENTRY(void, glTexParameterxOES, GLenum target, GLenum pname, GLfixed param)
 GL_ENTRY(void, glTexParameterxv, GLenum target, GLenum pname, const GLfixed *params)
 GL_ENTRY(void, glTexParameterxvOES, GLenum target, GLenum pname, const GLfixed *params)
+GL_ENTRY(void, glTexStorage1DEXT, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width)
+GL_ENTRY(void, glTexStorage2DEXT, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
+GL_ENTRY(void, glTexStorage3DEXT, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
 GL_ENTRY(void, glTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
 GL_ENTRY(void, glTexSubImage3DOES, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels)
+GL_ENTRY(void, glTextureStorage1DEXT, GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width)
+GL_ENTRY(void, glTextureStorage2DEXT, GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
+GL_ENTRY(void, glTextureStorage3DEXT, GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
 GL_ENTRY(void, glTranslatef, GLfloat x, GLfloat y, GLfloat z)
 GL_ENTRY(void, glTranslatex, GLfixed x, GLfixed y, GLfixed z)
 GL_ENTRY(void, glTranslatexOES, GLfixed x, GLfixed y, GLfixed z)
@@ -361,7 +420,9 @@
 GL_ENTRY(void, glUniformMatrix4fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
 GL_ENTRY(GLboolean, glUnmapBufferOES, GLenum target)
 GL_ENTRY(void, glUseProgram, GLuint program)
+GL_ENTRY(void, glUseProgramStagesEXT, GLuint pipeline, GLbitfield stages, GLuint program)
 GL_ENTRY(void, glValidateProgram, GLuint program)
+GL_ENTRY(void, glValidateProgramPipelineEXT, GLuint pipeline)
 GL_ENTRY(void, glVertexAttrib1f, GLuint indx, GLfloat x)
 GL_ENTRY(void, glVertexAttrib1fv, GLuint indx, const GLfloat* values)
 GL_ENTRY(void, glVertexAttrib2f, GLuint indx, GLfloat x, GLfloat y)
diff --git a/opengl/libs/enums.in b/opengl/libs/enums.in
index f9752c2..bfbc866 100644
--- a/opengl/libs/enums.in
+++ b/opengl/libs/enums.in
@@ -1,4 +1,6 @@
 GL_ENUM(0x0000,GL_POINTS)
+GL_ENUM(0x00000001,GL_VERTEX_SHADER_BIT_EXT)
+GL_ENUM(0x00000002,GL_FRAGMENT_SHADER_BIT_EXT)
 GL_ENUM(0x0001,GL_LINES)
 GL_ENUM(0x0002,GL_LINE_LOOP)
 GL_ENUM(0x0003,GL_LINE_STRIP)
@@ -92,6 +94,7 @@
 GL_ENUM(0x0BE2,GL_BLEND)
 GL_ENUM(0x0BF0,GL_LOGIC_OP_MODE)
 GL_ENUM(0x0BF2,GL_COLOR_LOGIC_OP)
+GL_ENUM(0x0C02,GL_READ_BUFFER_NV)
 GL_ENUM(0x0C10,GL_SCISSOR_BOX)
 GL_ENUM(0x0C11,GL_SCISSOR_TEST)
 GL_ENUM(0x0C22,GL_COLOR_CLEAR_VALUE)
@@ -100,6 +103,9 @@
 GL_ENUM(0x0C51,GL_POINT_SMOOTH_HINT)
 GL_ENUM(0x0C52,GL_LINE_SMOOTH_HINT)
 GL_ENUM(0x0C54,GL_FOG_HINT)
+GL_ENUM(0x0CF2,GL_UNPACK_ROW_LENGTH)
+GL_ENUM(0x0CF3,GL_UNPACK_SKIP_ROWS)
+GL_ENUM(0x0CF4,GL_UNPACK_SKIP_PIXELS)
 GL_ENUM(0x0CF5,GL_UNPACK_ALIGNMENT)
 GL_ENUM(0x0D05,GL_PACK_ALIGNMENT)
 GL_ENUM(0x0D1C,GL_ALPHA_SCALE)
@@ -166,6 +172,7 @@
 GL_ENUM(0x1802,GL_STENCIL_EXT)
 GL_ENUM(0x1901,GL_STENCIL_INDEX)
 GL_ENUM(0x1902,GL_DEPTH_COMPONENT)
+GL_ENUM(0x1903,GL_RED_EXT)
 GL_ENUM(0x1906,GL_ALPHA)
 GL_ENUM(0x1907,GL_RGB)
 GL_ENUM(0x1908,GL_RGBA)
@@ -230,10 +237,15 @@
 GL_ENUM(0x8037,GL_POLYGON_OFFSET_FILL)
 GL_ENUM(0x8038,GL_POLYGON_OFFSET_FACTOR)
 GL_ENUM(0x803A,GL_RESCALE_NORMAL)
+GL_ENUM(0x803C,GL_ALPHA8_EXT)
+GL_ENUM(0x8040,GL_LUMINANCE8_EXT)
+GL_ENUM(0x8045,GL_LUMINANCE8_ALPHA8_EXT)
 GL_ENUM(0x8051,GL_RGB8_OES)
+GL_ENUM(0x8052,GL_RGB10_EXT)
 GL_ENUM(0x8056,GL_RGBA4_OES)
 GL_ENUM(0x8057,GL_RGB5_A1_OES)
 GL_ENUM(0x8058,GL_RGBA8_OES)
+GL_ENUM(0x8059,GL_RGB10_A2_EXT)
 GL_ENUM(0x8069,GL_TEXTURE_BINDING_2D)
 GL_ENUM(0x806A,GL_TEXTURE_BINDING_3D_OES)
 GL_ENUM(0x806F,GL_TEXTURE_3D_OES)
@@ -276,11 +288,28 @@
 GL_ENUM(0x8128,GL_POINT_FADE_THRESHOLD_SIZE)
 GL_ENUM(0x8129,GL_POINT_DISTANCE_ATTENUATION)
 GL_ENUM(0x812F,GL_CLAMP_TO_EDGE)
+GL_ENUM(0x813D,GL_TEXTURE_MAX_LEVEL_APPLE)
 GL_ENUM(0x8191,GL_GENERATE_MIPMAP)
 GL_ENUM(0x8192,GL_GENERATE_MIPMAP_HINT)
 GL_ENUM(0x81A5,GL_DEPTH_COMPONENT16_OES)
 GL_ENUM(0x81A6,GL_DEPTH_COMPONENT24_OES)
 GL_ENUM(0x81A7,GL_DEPTH_COMPONENT32_OES)
+GL_ENUM(0x8210,GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT)
+GL_ENUM(0x8211,GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT)
+GL_ENUM(0x8227,GL_RG_EXT)
+GL_ENUM(0x8229,GL_R8_EXT)
+GL_ENUM(0x822B,GL_RG8_EXT)
+GL_ENUM(0x822D,GL_R16F_EXT)
+GL_ENUM(0x822F,GL_RG16F_EXT)
+GL_ENUM(0x8252,GL_LOSE_CONTEXT_ON_RESET_EXT)
+GL_ENUM(0x8253,GL_GUILTY_CONTEXT_RESET_EXT)
+GL_ENUM(0x8254,GL_INNOCENT_CONTEXT_RESET_EXT)
+GL_ENUM(0x8255,GL_UNKNOWN_CONTEXT_RESET_EXT)
+GL_ENUM(0x8256,GL_RESET_NOTIFICATION_STRATEGY_EXT)
+GL_ENUM(0x8258,GL_PROGRAM_SEPARABLE_EXT)
+GL_ENUM(0x8259,GL_ACTIVE_PROGRAM_EXT)
+GL_ENUM(0x825A,GL_PROGRAM_PIPELINE_BINDING_EXT)
+GL_ENUM(0x8261,GL_NO_RESET_NOTIFICATION_EXT)
 GL_ENUM(0x8363,GL_UNSIGNED_SHORT_5_6_5)
 GL_ENUM(0x8365,GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT)
 GL_ENUM(0x8366,GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT)
@@ -372,6 +401,8 @@
 GL_ENUM(0x8599,GL_OPERAND1_ALPHA)
 GL_ENUM(0x859A,GL_OPERAND2_ALPHA)
 GL_ENUM(0x85B5,GL_VERTEX_ARRAY_BINDING_OES)
+GL_ENUM(0x85BA,GL_UNSIGNED_SHORT_8_8_APPLE)
+GL_ENUM(0x85BB,GL_UNSIGNED_SHORT_8_8_REV_APPLE)
 GL_ENUM(0x8622,GL_VERTEX_ATTRIB_ARRAY_ENABLED)
 GL_ENUM(0x8623,GL_VERTEX_ATTRIB_ARRAY_SIZE)
 GL_ENUM(0x8624,GL_VERTEX_ATTRIB_ARRAY_STRIDE)
@@ -401,7 +432,34 @@
 GL_ENUM(0x8801,GL_STENCIL_BACK_FAIL)
 GL_ENUM(0x8802,GL_STENCIL_BACK_PASS_DEPTH_FAIL)
 GL_ENUM(0x8803,GL_STENCIL_BACK_PASS_DEPTH_PASS)
+GL_ENUM(0x8814,GL_RGBA32F_EXT)
+GL_ENUM(0x8815,GL_RGB32F_EXT)
+GL_ENUM(0x8816,GL_ALPHA32F_EXT)
+GL_ENUM(0x8818,GL_LUMINANCE32F_EXT)
+GL_ENUM(0x8819,GL_LUMINANCE_ALPHA32F_EXT)
+GL_ENUM(0x881A,GL_RGBA16F_EXT)
+GL_ENUM(0x881B,GL_RGB16F_EXT)
+GL_ENUM(0x881C,GL_ALPHA16F_EXT)
+GL_ENUM(0x881E,GL_LUMINANCE16F_EXT)
+GL_ENUM(0x881F,GL_LUMINANCE_ALPHA16F_EXT)
 GL_ENUM(0x8823,GL_WRITEONLY_RENDERING_QCOM)
+GL_ENUM(0x8824,GL_MAX_DRAW_BUFFERS_NV)
+GL_ENUM(0x8825,GL_DRAW_BUFFER0_NV)
+GL_ENUM(0x8826,GL_DRAW_BUFFER1_NV)
+GL_ENUM(0x8827,GL_DRAW_BUFFER2_NV)
+GL_ENUM(0x8828,GL_DRAW_BUFFER3_NV)
+GL_ENUM(0x8829,GL_DRAW_BUFFER4_NV)
+GL_ENUM(0x882A,GL_DRAW_BUFFER5_NV)
+GL_ENUM(0x882B,GL_DRAW_BUFFER6_NV)
+GL_ENUM(0x882C,GL_DRAW_BUFFER7_NV)
+GL_ENUM(0x882D,GL_DRAW_BUFFER8_NV)
+GL_ENUM(0x882E,GL_DRAW_BUFFER9_NV)
+GL_ENUM(0x882F,GL_DRAW_BUFFER10_NV)
+GL_ENUM(0x8830,GL_DRAW_BUFFER11_NV)
+GL_ENUM(0x8831,GL_DRAW_BUFFER12_NV)
+GL_ENUM(0x8832,GL_DRAW_BUFFER13_NV)
+GL_ENUM(0x8833,GL_DRAW_BUFFER14_NV)
+GL_ENUM(0x8834,GL_DRAW_BUFFER15_NV)
 GL_ENUM(0x883D,GL_BLEND_EQUATION_ALPHA_OES)
 GL_ENUM(0x8840,GL_MATRIX_PALETTE_OES)
 GL_ENUM(0x8842,GL_MAX_PALETTE_MATRICES_OES)
@@ -411,8 +469,14 @@
 GL_ENUM(0x8847,GL_MATRIX_INDEX_ARRAY_TYPE_OES)
 GL_ENUM(0x8848,GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
 GL_ENUM(0x8849,GL_MATRIX_INDEX_ARRAY_POINTER_OES)
+GL_ENUM(0x884C,GL_TEXTURE_COMPARE_MODE_EXT)
+GL_ENUM(0x884D,GL_TEXTURE_COMPARE_FUNC_EXT)
+GL_ENUM(0x884E,GL_COMPARE_REF_TO_TEXTURE_EXT)
 GL_ENUM(0x8861,GL_POINT_SPRITE_OES)
 GL_ENUM(0x8862,GL_COORD_REPLACE_OES)
+GL_ENUM(0x8865,GL_CURRENT_QUERY_EXT)
+GL_ENUM(0x8866,GL_QUERY_RESULT_EXT)
+GL_ENUM(0x8867,GL_QUERY_RESULT_AVAILABLE_EXT)
 GL_ENUM(0x8869,GL_MAX_VERTEX_ATTRIBS)
 GL_ENUM(0x886A,GL_VERTEX_ATTRIB_ARRAY_NORMALIZED)
 GL_ENUM(0x8872,GL_MAX_TEXTURE_IMAGE_UNITS)
@@ -440,8 +504,12 @@
 GL_ENUM(0x898D,GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
 GL_ENUM(0x898E,GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
 GL_ENUM(0x898F,GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
+GL_ENUM(0x8A1F,GL_RGB_422_APPLE)
+GL_ENUM(0x8A4F,GL_PROGRAM_PIPELINE_OBJECT_EXT)
 GL_ENUM(0x8B30,GL_FRAGMENT_SHADER)
 GL_ENUM(0x8B31,GL_VERTEX_SHADER)
+GL_ENUM(0x8B40,GL_PROGRAM_OBJECT_EXT)
+GL_ENUM(0x8B48,GL_SHADER_OBJECT_EXT)
 GL_ENUM(0x8B4C,GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS)
 GL_ENUM(0x8B4D,GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS)
 GL_ENUM(0x8B4F,GL_SHADER_TYPE)
@@ -461,6 +529,7 @@
 GL_ENUM(0x8B5E,GL_SAMPLER_2D)
 GL_ENUM(0x8B5F,GL_SAMPLER_3D_OES)
 GL_ENUM(0x8B60,GL_SAMPLER_CUBE)
+GL_ENUM(0x8B62,GL_SAMPLER_2D_SHADOW_EXT)
 GL_ENUM(0x8B80,GL_DELETE_STATUS)
 GL_ENUM(0x8B81,GL_COMPILE_STATUS)
 GL_ENUM(0x8B82,GL_LINK_STATUS)
@@ -520,6 +589,11 @@
 GL_ENUM(0x8C08,GL_FRAGMENT_ALPHA_MODULATE_IMG)
 GL_ENUM(0x8C09,GL_ADD_BLEND_IMG)
 GL_ENUM(0x8C0A,GL_SGX_BINARY_IMG)
+GL_ENUM(0x8C17,GL_UNSIGNED_NORMALIZED_EXT)
+GL_ENUM(0x8C2F,GL_ANY_SAMPLES_PASSED_EXT)
+GL_ENUM(0x8C40,GL_SRGB_EXT)
+GL_ENUM(0x8C42,GL_SRGB_ALPHA_EXT)
+GL_ENUM(0x8C43,GL_SRGB8_ALPHA8_EXT)
 GL_ENUM(0x8C92,GL_ATC_RGB_AMD)
 GL_ENUM(0x8C93,GL_ATC_RGBA_EXPLICIT_ALPHA_AMD)
 GL_ENUM(0x8CA3,GL_STENCIL_BACK_REF)
@@ -527,6 +601,10 @@
 GL_ENUM(0x8CA5,GL_STENCIL_BACK_WRITEMASK)
 GL_ENUM(0x8CA6,GL_FRAMEBUFFER_BINDING_OES)
 GL_ENUM(0x8CA7,GL_RENDERBUFFER_BINDING_OES)
+GL_ENUM(0x8CA8,GL_READ_FRAMEBUFFER_APPLE)
+GL_ENUM(0x8CA9,GL_DRAW_FRAMEBUFFER_APPLE)
+GL_ENUM(0x8CAA,GL_READ_FRAMEBUFFER_BINDING_APPLE)
+GL_ENUM(0x8CAB,GL_RENDERBUFFER_SAMPLES_APPLE)
 GL_ENUM(0x8CD0,GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES)
 GL_ENUM(0x8CD1,GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES)
 GL_ENUM(0x8CD2,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES)
@@ -538,7 +616,23 @@
 GL_ENUM(0x8CD9,GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES)
 GL_ENUM(0x8CDA,GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES)
 GL_ENUM(0x8CDD,GL_FRAMEBUFFER_UNSUPPORTED_OES)
+GL_ENUM(0x8CDF,GL_MAX_COLOR_ATTACHMENTS_NV)
 GL_ENUM(0x8CE0,GL_COLOR_ATTACHMENT0_OES)
+GL_ENUM(0x8CE1,GL_COLOR_ATTACHMENT1_NV)
+GL_ENUM(0x8CE2,GL_COLOR_ATTACHMENT2_NV)
+GL_ENUM(0x8CE3,GL_COLOR_ATTACHMENT3_NV)
+GL_ENUM(0x8CE4,GL_COLOR_ATTACHMENT4_NV)
+GL_ENUM(0x8CE5,GL_COLOR_ATTACHMENT5_NV)
+GL_ENUM(0x8CE6,GL_COLOR_ATTACHMENT6_NV)
+GL_ENUM(0x8CE7,GL_COLOR_ATTACHMENT7_NV)
+GL_ENUM(0x8CE8,GL_COLOR_ATTACHMENT8_NV)
+GL_ENUM(0x8CE9,GL_COLOR_ATTACHMENT9_NV)
+GL_ENUM(0x8CEA,GL_COLOR_ATTACHMENT10_NV)
+GL_ENUM(0x8CEB,GL_COLOR_ATTACHMENT11_NV)
+GL_ENUM(0x8CEC,GL_COLOR_ATTACHMENT12_NV)
+GL_ENUM(0x8CED,GL_COLOR_ATTACHMENT13_NV)
+GL_ENUM(0x8CEE,GL_COLOR_ATTACHMENT14_NV)
+GL_ENUM(0x8CEF,GL_COLOR_ATTACHMENT15_NV)
 GL_ENUM(0x8D00,GL_DEPTH_ATTACHMENT_OES)
 GL_ENUM(0x8D20,GL_STENCIL_ATTACHMENT_OES)
 GL_ENUM(0x8D40,GL_FRAMEBUFFER_OES)
@@ -555,6 +649,8 @@
 GL_ENUM(0x8D53,GL_RENDERBUFFER_ALPHA_SIZE_OES)
 GL_ENUM(0x8D54,GL_RENDERBUFFER_DEPTH_SIZE_OES)
 GL_ENUM(0x8D55,GL_RENDERBUFFER_STENCIL_SIZE_OES)
+GL_ENUM(0x8D56,GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE)
+GL_ENUM(0x8D57,GL_MAX_SAMPLES_APPLE)
 GL_ENUM(0x8D60,GL_TEXTURE_GEN_STR_OES)
 GL_ENUM(0x8D61,GL_HALF_FLOAT_OES)
 GL_ENUM(0x8D62,GL_RGB565_OES)
@@ -563,6 +659,8 @@
 GL_ENUM(0x8D66,GL_SAMPLER_EXTERNAL_OES)
 GL_ENUM(0x8D67,GL_TEXTURE_BINDING_EXTERNAL_OES)
 GL_ENUM(0x8D68,GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES)
+GL_ENUM(0x8D6A,GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT)
+GL_ENUM(0x8D6C,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT)
 GL_ENUM(0x8DF0,GL_LOW_FLOAT)
 GL_ENUM(0x8DF1,GL_MEDIUM_FLOAT)
 GL_ENUM(0x8DF2,GL_HIGH_FLOAT)
@@ -586,9 +684,19 @@
 GL_ENUM(0x8ED5,GL_COVERAGE_ALL_FRAGMENTS_NV)
 GL_ENUM(0x8ED6,GL_COVERAGE_EDGE_FRAGMENTS_NV)
 GL_ENUM(0x8ED7,GL_COVERAGE_AUTOMATIC_NV)
+GL_ENUM(0x8F60,GL_MALI_SHADER_BINARY_ARM)
 GL_ENUM(0x8FA0,GL_PERFMON_GLOBAL_MODE_QCOM)
+GL_ENUM(0x8FC4,GL_SHADER_BINARY_VIV)
+GL_ENUM(0x90F3,GL_CONTEXT_ROBUST_ACCESS_EXT)
+GL_ENUM(0x912F,GL_TEXTURE_IMMUTABLE_FORMAT_EXT)
 GL_ENUM(0x9130,GL_SGX_PROGRAM_BINARY_IMG)
-GL_ENUM(0x9133,GL_RENDERBUFFER_SAMPLES_IMG)
-GL_ENUM(0x9134,GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG)
-GL_ENUM(0x9135,GL_MAX_SAMPLES_IMG)
+GL_ENUM(0x9133,GL_RENDERBUFFER_SAMPLES_EXT)
+GL_ENUM(0x9134,GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT)
+GL_ENUM(0x9135,GL_MAX_SAMPLES_EXT)
 GL_ENUM(0x9136,GL_TEXTURE_SAMPLES_IMG)
+GL_ENUM(0x9151,GL_BUFFER_OBJECT_EXT)
+GL_ENUM(0x9153,GL_QUERY_OBJECT_EXT)
+GL_ENUM(0x9154,GL_VERTEX_ARRAY_OBJECT_EXT)
+GL_ENUM(0x9250,GL_SHADER_BINARY_DMP)
+GL_ENUM(0x93A1,GL_BGRA8_EXT)
+GL_ENUM(0xFFFFFFFF,GL_ALL_SHADER_BITS_EXT)
diff --git a/opengl/libs/hooks.h b/opengl/libs/hooks.h
index 7ac88cd..8b1b389 100644
--- a/opengl/libs/hooks.h
+++ b/opengl/libs/hooks.h
@@ -37,7 +37,12 @@
 #endif
 #undef NELEM
 #define NELEM(x)                    (sizeof(x)/sizeof(*(x)))
-#define MAX_NUMBER_OF_GL_EXTENSIONS 64
+
+// maximum number of GL extensions that can be used simultaneously in
+// a given process. this limitation exists because we need to have
+// a static function for each extension and currently these static functions
+// are generated at compile time.
+#define MAX_NUMBER_OF_GL_EXTENSIONS 256
 
 
 #if defined(HAVE_ANDROID_OS) && !USE_SLOW_BINDING && __OPTIMIZE__
diff --git a/opengl/libs/tools/glapigen b/opengl/libs/tools/glapigen
index bd8dda3..9be40cf 100755
--- a/opengl/libs/tools/glapigen
+++ b/opengl/libs/tools/glapigen
@@ -43,6 +43,9 @@
   if ($name eq "glEGLImageTargetRenderbufferStorageOES") {
     $prefix = "__";
   }
+  if ($name eq "glGetString") {
+    $prefix = "__";
+  }
   
   printf("%s API_ENTRY(%s%s)(%s)", $type, $prefix, $name, $args);
   
diff --git a/opengl/libs/trace.in b/opengl/libs/trace.in
index 3d492af..a5c5c84 100644
--- a/opengl/libs/trace.in
+++ b/opengl/libs/trace.in
@@ -1,13 +1,17 @@
+TRACE_GL_VOID(glActiveShaderProgramEXT, (GLuint pipeline, GLuint program), (pipeline, program), 2, "GLuint", pipeline, "GLuint", program)
 TRACE_GL_VOID(glActiveTexture, (GLenum texture), (texture), 1, "GLenum", texture)
 TRACE_GL_VOID(glAlphaFunc, (GLenum func, GLclampf ref), (func, ref), 2, "GLenum", func, "GLclampf", ref)
+TRACE_GL_VOID(glAlphaFuncQCOM, (GLenum func, GLclampf ref), (func, ref), 2, "GLenum", func, "GLclampf", ref)
 TRACE_GL_VOID(glAlphaFuncx, (GLenum func, GLclampx ref), (func, ref), 2, "GLenum", func, "GLclampx", ref)
 TRACE_GL_VOID(glAlphaFuncxOES, (GLenum func, GLclampx ref), (func, ref), 2, "GLenum", func, "GLclampx", ref)
 TRACE_GL_VOID(glAttachShader, (GLuint program, GLuint shader), (program, shader), 2, "GLuint", program, "GLuint", shader)
 TRACE_GL_VOID(glBeginPerfMonitorAMD, (GLuint monitor), (monitor), 1, "GLuint", monitor)
+TRACE_GL_VOID(glBeginQueryEXT, (GLenum target, GLuint id), (target, id), 2, "GLenum", target, "GLuint", id)
 TRACE_GL_VOID(glBindAttribLocation, (GLuint program, GLuint index, const GLchar* name), (program, index, name), 3, "GLuint", program, "GLuint", index, "const GLchar*", name)
 TRACE_GL_VOID(glBindBuffer, (GLenum target, GLuint buffer), (target, buffer), 2, "GLenum", target, "GLuint", buffer)
 TRACE_GL_VOID(glBindFramebuffer, (GLenum target, GLuint framebuffer), (target, framebuffer), 2, "GLenum", target, "GLuint", framebuffer)
 TRACE_GL_VOID(glBindFramebufferOES, (GLenum target, GLuint framebuffer), (target, framebuffer), 2, "GLenum", target, "GLuint", framebuffer)
+TRACE_GL_VOID(glBindProgramPipelineEXT, (GLuint pipeline), (pipeline), 1, "GLuint", pipeline)
 TRACE_GL_VOID(glBindRenderbuffer, (GLenum target, GLuint renderbuffer), (target, renderbuffer), 2, "GLenum", target, "GLuint", renderbuffer)
 TRACE_GL_VOID(glBindRenderbufferOES, (GLenum target, GLuint renderbuffer), (target, renderbuffer), 2, "GLenum", target, "GLuint", renderbuffer)
 TRACE_GL_VOID(glBindTexture, (GLenum target, GLuint texture), (target, texture), 2, "GLenum", target, "GLuint", texture)
@@ -20,6 +24,7 @@
 TRACE_GL_VOID(glBlendFunc, (GLenum sfactor, GLenum dfactor), (sfactor, dfactor), 2, "GLenum", sfactor, "GLenum", dfactor)
 TRACE_GL_VOID(glBlendFuncSeparate, (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha), (srcRGB, dstRGB, srcAlpha, dstAlpha), 4, "GLenum", srcRGB, "GLenum", dstRGB, "GLenum", srcAlpha, "GLenum", dstAlpha)
 TRACE_GL_VOID(glBlendFuncSeparateOES, (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha), (srcRGB, dstRGB, srcAlpha, dstAlpha), 4, "GLenum", srcRGB, "GLenum", dstRGB, "GLenum", srcAlpha, "GLenum", dstAlpha)
+TRACE_GL_VOID(glBlitFramebufferANGLE, (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter), (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), 10, "GLint", srcX0, "GLint", srcY0, "GLint", srcX1, "GLint", srcY1, "GLint", dstX0, "GLint", dstY0, "GLint", dstX1, "GLint", dstY1, "GLbitfield", mask, "GLenum", filter)
 TRACE_GL_VOID(glBufferData, (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage), (target, size, data, usage), 4, "GLenum", target, "GLsizeiptr", size, "const GLvoid *", data, "GLenum", usage)
 TRACE_GL_VOID(glBufferSubData, (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data), (target, offset, size, data), 4, "GLenum", target, "GLintptr", offset, "GLsizeiptr", size, "const GLvoid *", data)
 TRACE_GL(GLenum, glCheckFramebufferStatus, (GLenum target), (target), 1, "GLenum", target)
@@ -58,6 +63,7 @@
 TRACE_GL_VOID(glCoverageOperationNV, (GLenum operation), (operation), 1, "GLenum", operation)
 TRACE_GL(GLuint, glCreateProgram, (void), (), 0)
 TRACE_GL(GLuint, glCreateShader, (GLenum type), (type), 1, "GLenum", type)
+TRACE_GL(GLuint, glCreateShaderProgramvEXT, (GLenum type, GLsizei count, const GLchar **strings), (type, count, strings), 3, "GLenum", type, "GLsizei", count, "const GLchar **", strings)
 TRACE_GL_VOID(glCullFace, (GLenum mode), (mode), 1, "GLenum", mode)
 TRACE_GL_VOID(glCurrentPaletteMatrixOES, (GLuint matrixpaletteindex), (matrixpaletteindex), 1, "GLuint", matrixpaletteindex)
 TRACE_GL_VOID(glDeleteBuffers, (GLsizei n, const GLuint *buffers), (n, buffers), 2, "GLsizei", n, "const GLuint *", buffers)
@@ -66,6 +72,8 @@
 TRACE_GL_VOID(glDeleteFramebuffersOES, (GLsizei n, const GLuint* framebuffers), (n, framebuffers), 2, "GLsizei", n, "const GLuint*", framebuffers)
 TRACE_GL_VOID(glDeletePerfMonitorsAMD, (GLsizei n, GLuint *monitors), (n, monitors), 2, "GLsizei", n, "GLuint *", monitors)
 TRACE_GL_VOID(glDeleteProgram, (GLuint program), (program), 1, "GLuint", program)
+TRACE_GL_VOID(glDeleteProgramPipelinesEXT, (GLsizei n, const GLuint *pipelines), (n, pipelines), 2, "GLsizei", n, "const GLuint *", pipelines)
+TRACE_GL_VOID(glDeleteQueriesEXT, (GLsizei n, const GLuint *ids), (n, ids), 2, "GLsizei", n, "const GLuint *", ids)
 TRACE_GL_VOID(glDeleteRenderbuffers, (GLsizei n, const GLuint* renderbuffers), (n, renderbuffers), 2, "GLsizei", n, "const GLuint*", renderbuffers)
 TRACE_GL_VOID(glDeleteRenderbuffersOES, (GLsizei n, const GLuint* renderbuffers), (n, renderbuffers), 2, "GLsizei", n, "const GLuint*", renderbuffers)
 TRACE_GL_VOID(glDeleteShader, (GLuint shader), (shader), 1, "GLuint", shader)
@@ -84,6 +92,7 @@
 TRACE_GL_VOID(glDisableVertexAttribArray, (GLuint index), (index), 1, "GLuint", index)
 TRACE_GL_VOID(glDiscardFramebufferEXT, (GLenum target, GLsizei numAttachments, const GLenum *attachments), (target, numAttachments, attachments), 3, "GLenum", target, "GLsizei", numAttachments, "const GLenum *", attachments)
 TRACE_GL_VOID(glDrawArrays, (GLenum mode, GLint first, GLsizei count), (mode, first, count), 3, "GLenum", mode, "GLint", first, "GLsizei", count)
+TRACE_GL_VOID(glDrawBuffersNV, (GLsizei n, const GLenum *bufs), (n, bufs), 2, "GLsizei", n, "const GLenum *", bufs)
 TRACE_GL_VOID(glDrawElements, (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices), (mode, count, type, indices), 4, "GLenum", mode, "GLsizei", count, "GLenum", type, "const GLvoid *", indices)
 TRACE_GL_VOID(glDrawTexfOES, (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height), (x, y, z, width, height), 5, "GLfloat", x, "GLfloat", y, "GLfloat", z, "GLfloat", width, "GLfloat", height)
 TRACE_GL_VOID(glDrawTexfvOES, (const GLfloat *coords), (coords), 1, "const GLfloat *", coords)
@@ -100,6 +109,7 @@
 TRACE_GL_VOID(glEnableDriverControlQCOM, (GLuint driverControl), (driverControl), 1, "GLuint", driverControl)
 TRACE_GL_VOID(glEnableVertexAttribArray, (GLuint index), (index), 1, "GLuint", index)
 TRACE_GL_VOID(glEndPerfMonitorAMD, (GLuint monitor), (monitor), 1, "GLuint", monitor)
+TRACE_GL_VOID(glEndQueryEXT, (GLenum target), (target), 1, "GLenum", target)
 TRACE_GL_VOID(glEndTilingQCOM, (GLbitfield preserveMask), (preserveMask), 1, "GLbitfield", preserveMask)
 TRACE_GL_VOID(glExtGetBufferPointervQCOM, (GLenum target, GLvoid **params), (target, params), 2, "GLenum", target, "GLvoid **", params)
 TRACE_GL_VOID(glExtGetBuffersQCOM, (GLuint *buffers, GLint maxBuffers, GLint *numBuffers), (buffers, maxBuffers, numBuffers), 3, "GLuint *", buffers, "GLint", maxBuffers, "GLint *", numBuffers)
@@ -125,6 +135,7 @@
 TRACE_GL_VOID(glFramebufferRenderbuffer, (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer), (target, attachment, renderbuffertarget, renderbuffer), 4, "GLenum", target, "GLenum", attachment, "GLenum", renderbuffertarget, "GLuint", renderbuffer)
 TRACE_GL_VOID(glFramebufferRenderbufferOES, (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer), (target, attachment, renderbuffertarget, renderbuffer), 4, "GLenum", target, "GLenum", attachment, "GLenum", renderbuffertarget, "GLuint", renderbuffer)
 TRACE_GL_VOID(glFramebufferTexture2D, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level), (target, attachment, textarget, texture, level), 5, "GLenum", target, "GLenum", attachment, "GLenum", textarget, "GLuint", texture, "GLint", level)
+TRACE_GL_VOID(glFramebufferTexture2DMultisampleEXT, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples), (target, attachment, textarget, texture, level, samples), 6, "GLenum", target, "GLenum", attachment, "GLenum", textarget, "GLuint", texture, "GLint", level, "GLsizei", samples)
 TRACE_GL_VOID(glFramebufferTexture2DMultisampleIMG, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples), (target, attachment, textarget, texture, level, samples), 6, "GLenum", target, "GLenum", attachment, "GLenum", textarget, "GLuint", texture, "GLint", level, "GLsizei", samples)
 TRACE_GL_VOID(glFramebufferTexture2DOES, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level), (target, attachment, textarget, texture, level), 5, "GLenum", target, "GLenum", attachment, "GLenum", textarget, "GLuint", texture, "GLint", level)
 TRACE_GL_VOID(glFramebufferTexture3DOES, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset), (target, attachment, textarget, texture, level, zoffset), 6, "GLenum", target, "GLenum", attachment, "GLenum", textarget, "GLuint", texture, "GLint", level, "GLint", zoffset)
@@ -138,6 +149,8 @@
 TRACE_GL_VOID(glGenFramebuffers, (GLsizei n, GLuint* framebuffers), (n, framebuffers), 2, "GLsizei", n, "GLuint*", framebuffers)
 TRACE_GL_VOID(glGenFramebuffersOES, (GLsizei n, GLuint* framebuffers), (n, framebuffers), 2, "GLsizei", n, "GLuint*", framebuffers)
 TRACE_GL_VOID(glGenPerfMonitorsAMD, (GLsizei n, GLuint *monitors), (n, monitors), 2, "GLsizei", n, "GLuint *", monitors)
+TRACE_GL_VOID(glGenProgramPipelinesEXT, (GLsizei n, GLuint *pipelines), (n, pipelines), 2, "GLsizei", n, "GLuint *", pipelines)
+TRACE_GL_VOID(glGenQueriesEXT, (GLsizei n, GLuint *ids), (n, ids), 2, "GLsizei", n, "GLuint *", ids)
 TRACE_GL_VOID(glGenRenderbuffers, (GLsizei n, GLuint* renderbuffers), (n, renderbuffers), 2, "GLsizei", n, "GLuint*", renderbuffers)
 TRACE_GL_VOID(glGenRenderbuffersOES, (GLsizei n, GLuint* renderbuffers), (n, renderbuffers), 2, "GLsizei", n, "GLuint*", renderbuffers)
 TRACE_GL_VOID(glGenTextures, (GLsizei n, GLuint *textures), (n, textures), 2, "GLsizei", n, "GLuint *", textures)
@@ -164,6 +177,7 @@
 TRACE_GL_VOID(glGetFloatv, (GLenum pname, GLfloat *params), (pname, params), 2, "GLenum", pname, "GLfloat *", params)
 TRACE_GL_VOID(glGetFramebufferAttachmentParameteriv, (GLenum target, GLenum attachment, GLenum pname, GLint* params), (target, attachment, pname, params), 4, "GLenum", target, "GLenum", attachment, "GLenum", pname, "GLint*", params)
 TRACE_GL_VOID(glGetFramebufferAttachmentParameterivOES, (GLenum target, GLenum attachment, GLenum pname, GLint* params), (target, attachment, pname, params), 4, "GLenum", target, "GLenum", attachment, "GLenum", pname, "GLint*", params)
+TRACE_GL(GLenum, glGetGraphicsResetStatusEXT, (void), (), 0)
 TRACE_GL_VOID(glGetIntegerv, (GLenum pname, GLint *params), (pname, params), 2, "GLenum", pname, "GLint *", params)
 TRACE_GL_VOID(glGetLightfv, (GLenum light, GLenum pname, GLfloat *params), (light, pname, params), 3, "GLenum", light, "GLenum", pname, "GLfloat *", params)
 TRACE_GL_VOID(glGetLightxv, (GLenum light, GLenum pname, GLfixed *params), (light, pname, params), 3, "GLenum", light, "GLenum", pname, "GLfixed *", params)
@@ -171,6 +185,7 @@
 TRACE_GL_VOID(glGetMaterialfv, (GLenum face, GLenum pname, GLfloat *params), (face, pname, params), 3, "GLenum", face, "GLenum", pname, "GLfloat *", params)
 TRACE_GL_VOID(glGetMaterialxv, (GLenum face, GLenum pname, GLfixed *params), (face, pname, params), 3, "GLenum", face, "GLenum", pname, "GLfixed *", params)
 TRACE_GL_VOID(glGetMaterialxvOES, (GLenum face, GLenum pname, GLfixed *params), (face, pname, params), 3, "GLenum", face, "GLenum", pname, "GLfixed *", params)
+TRACE_GL_VOID(glGetObjectLabelEXT, (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label), (type, object, bufSize, length, label), 5, "GLenum", type, "GLuint", object, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", label)
 TRACE_GL_VOID(glGetPerfMonitorCounterDataAMD, (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten), (monitor, pname, dataSize, data, bytesWritten), 5, "GLuint", monitor, "GLenum", pname, "GLsizei", dataSize, "GLuint *", data, "GLint *", bytesWritten)
 TRACE_GL_VOID(glGetPerfMonitorCounterInfoAMD, (GLuint group, GLuint counter, GLenum pname, GLvoid *data), (group, counter, pname, data), 4, "GLuint", group, "GLuint", counter, "GLenum", pname, "GLvoid *", data)
 TRACE_GL_VOID(glGetPerfMonitorCounterStringAMD, (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString), (group, counter, bufSize, length, counterString), 5, "GLuint", group, "GLuint", counter, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", counterString)
@@ -180,7 +195,11 @@
 TRACE_GL_VOID(glGetPointerv, (GLenum pname, GLvoid **params), (pname, params), 2, "GLenum", pname, "GLvoid **", params)
 TRACE_GL_VOID(glGetProgramBinaryOES, (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary), (program, bufSize, length, binaryFormat, binary), 5, "GLuint", program, "GLsizei", bufSize, "GLsizei *", length, "GLenum *", binaryFormat, "GLvoid *", binary)
 TRACE_GL_VOID(glGetProgramInfoLog, (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog), (program, bufsize, length, infolog), 4, "GLuint", program, "GLsizei", bufsize, "GLsizei*", length, "GLchar*", infolog)
+TRACE_GL_VOID(glGetProgramPipelineInfoLogEXT, (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog), (pipeline, bufSize, length, infoLog), 4, "GLuint", pipeline, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", infoLog)
+TRACE_GL_VOID(glGetProgramPipelineivEXT, (GLuint pipeline, GLenum pname, GLint *params), (pipeline, pname, params), 3, "GLuint", pipeline, "GLenum", pname, "GLint *", params)
 TRACE_GL_VOID(glGetProgramiv, (GLuint program, GLenum pname, GLint* params), (program, pname, params), 3, "GLuint", program, "GLenum", pname, "GLint*", params)
+TRACE_GL_VOID(glGetQueryObjectuivEXT, (GLuint id, GLenum pname, GLuint *params), (id, pname, params), 3, "GLuint", id, "GLenum", pname, "GLuint *", params)
+TRACE_GL_VOID(glGetQueryivEXT, (GLenum target, GLenum pname, GLint *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLint *", params)
 TRACE_GL_VOID(glGetRenderbufferParameteriv, (GLenum target, GLenum pname, GLint* params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLint*", params)
 TRACE_GL_VOID(glGetRenderbufferParameterivOES, (GLenum target, GLenum pname, GLint* params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLint*", params)
 TRACE_GL_VOID(glGetShaderInfoLog, (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog), (shader, bufsize, length, infolog), 4, "GLuint", shader, "GLsizei", bufsize, "GLsizei*", length, "GLchar*", infolog)
@@ -205,18 +224,24 @@
 TRACE_GL_VOID(glGetVertexAttribPointerv, (GLuint index, GLenum pname, GLvoid** pointer), (index, pname, pointer), 3, "GLuint", index, "GLenum", pname, "GLvoid**", pointer)
 TRACE_GL_VOID(glGetVertexAttribfv, (GLuint index, GLenum pname, GLfloat* params), (index, pname, params), 3, "GLuint", index, "GLenum", pname, "GLfloat*", params)
 TRACE_GL_VOID(glGetVertexAttribiv, (GLuint index, GLenum pname, GLint* params), (index, pname, params), 3, "GLuint", index, "GLenum", pname, "GLint*", params)
+TRACE_GL_VOID(glGetnUniformfvEXT, (GLuint program, GLint location, GLsizei bufSize, float *params), (program, location, bufSize, params), 4, "GLuint", program, "GLint", location, "GLsizei", bufSize, "float *", params)
+TRACE_GL_VOID(glGetnUniformivEXT, (GLuint program, GLint location, GLsizei bufSize, GLint *params), (program, location, bufSize, params), 4, "GLuint", program, "GLint", location, "GLsizei", bufSize, "GLint *", params)
 TRACE_GL_VOID(glHint, (GLenum target, GLenum mode), (target, mode), 2, "GLenum", target, "GLenum", mode)
+TRACE_GL_VOID(glInsertEventMarkerEXT, (GLsizei length, const GLchar *marker), (length, marker), 2, "GLsizei", length, "const GLchar *", marker)
 TRACE_GL(GLboolean, glIsBuffer, (GLuint buffer), (buffer), 1, "GLuint", buffer)
 TRACE_GL(GLboolean, glIsEnabled, (GLenum cap), (cap), 1, "GLenum", cap)
 TRACE_GL(GLboolean, glIsFenceNV, (GLuint fence), (fence), 1, "GLuint", fence)
 TRACE_GL(GLboolean, glIsFramebuffer, (GLuint framebuffer), (framebuffer), 1, "GLuint", framebuffer)
 TRACE_GL(GLboolean, glIsFramebufferOES, (GLuint framebuffer), (framebuffer), 1, "GLuint", framebuffer)
 TRACE_GL(GLboolean, glIsProgram, (GLuint program), (program), 1, "GLuint", program)
+TRACE_GL(GLboolean, glIsProgramPipelineEXT, (GLuint pipeline), (pipeline), 1, "GLuint", pipeline)
+TRACE_GL(GLboolean, glIsQueryEXT, (GLuint id), (id), 1, "GLuint", id)
 TRACE_GL(GLboolean, glIsRenderbuffer, (GLuint renderbuffer), (renderbuffer), 1, "GLuint", renderbuffer)
 TRACE_GL(GLboolean, glIsRenderbufferOES, (GLuint renderbuffer), (renderbuffer), 1, "GLuint", renderbuffer)
 TRACE_GL(GLboolean, glIsShader, (GLuint shader), (shader), 1, "GLuint", shader)
 TRACE_GL(GLboolean, glIsTexture, (GLuint texture), (texture), 1, "GLuint", texture)
 TRACE_GL(GLboolean, glIsVertexArrayOES, (GLuint array), (array), 1, "GLuint", array)
+TRACE_GL_VOID(glLabelObjectEXT, (GLenum type, GLuint object, GLsizei length, const GLchar *label), (type, object, length, label), 4, "GLenum", type, "GLuint", object, "GLsizei", length, "const GLchar *", label)
 TRACE_GL_VOID(glLightModelf, (GLenum pname, GLfloat param), (pname, param), 2, "GLenum", pname, "GLfloat", param)
 TRACE_GL_VOID(glLightModelfv, (GLenum pname, const GLfloat *params), (pname, params), 2, "GLenum", pname, "const GLfloat *", params)
 TRACE_GL_VOID(glLightModelx, (GLenum pname, GLfixed param), (pname, param), 2, "GLenum", pname, "GLfixed", param)
@@ -278,15 +303,43 @@
 TRACE_GL_VOID(glPolygonOffset, (GLfloat factor, GLfloat units), (factor, units), 2, "GLfloat", factor, "GLfloat", units)
 TRACE_GL_VOID(glPolygonOffsetx, (GLfixed factor, GLfixed units), (factor, units), 2, "GLfixed", factor, "GLfixed", units)
 TRACE_GL_VOID(glPolygonOffsetxOES, (GLfixed factor, GLfixed units), (factor, units), 2, "GLfixed", factor, "GLfixed", units)
+TRACE_GL_VOID(glPopGroupMarkerEXT, (void), (), 0)
 TRACE_GL_VOID(glPopMatrix, (void), (), 0)
 TRACE_GL_VOID(glProgramBinaryOES, (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length), (program, binaryFormat, binary, length), 4, "GLuint", program, "GLenum", binaryFormat, "const GLvoid *", binary, "GLint", length)
+TRACE_GL_VOID(glProgramParameteriEXT, (GLuint program, GLenum pname, GLint value), (program, pname, value), 3, "GLuint", program, "GLenum", pname, "GLint", value)
+TRACE_GL_VOID(glProgramUniform1fEXT, (GLuint program, GLint location, GLfloat x), (program, location, x), 3, "GLuint", program, "GLint", location, "GLfloat", x)
+TRACE_GL_VOID(glProgramUniform1fvEXT, (GLuint program, GLint location, GLsizei count, const GLfloat *value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLfloat *", value)
+TRACE_GL_VOID(glProgramUniform1iEXT, (GLuint program, GLint location, GLint x), (program, location, x), 3, "GLuint", program, "GLint", location, "GLint", x)
+TRACE_GL_VOID(glProgramUniform1ivEXT, (GLuint program, GLint location, GLsizei count, const GLint *value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLint *", value)
+TRACE_GL_VOID(glProgramUniform2fEXT, (GLuint program, GLint location, GLfloat x, GLfloat y), (program, location, x, y), 4, "GLuint", program, "GLint", location, "GLfloat", x, "GLfloat", y)
+TRACE_GL_VOID(glProgramUniform2fvEXT, (GLuint program, GLint location, GLsizei count, const GLfloat *value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLfloat *", value)
+TRACE_GL_VOID(glProgramUniform2iEXT, (GLuint program, GLint location, GLint x, GLint y), (program, location, x, y), 4, "GLuint", program, "GLint", location, "GLint", x, "GLint", y)
+TRACE_GL_VOID(glProgramUniform2ivEXT, (GLuint program, GLint location, GLsizei count, const GLint *value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLint *", value)
+TRACE_GL_VOID(glProgramUniform3fEXT, (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z), (program, location, x, y, z), 5, "GLuint", program, "GLint", location, "GLfloat", x, "GLfloat", y, "GLfloat", z)
+TRACE_GL_VOID(glProgramUniform3fvEXT, (GLuint program, GLint location, GLsizei count, const GLfloat *value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLfloat *", value)
+TRACE_GL_VOID(glProgramUniform3iEXT, (GLuint program, GLint location, GLint x, GLint y, GLint z), (program, location, x, y, z), 5, "GLuint", program, "GLint", location, "GLint", x, "GLint", y, "GLint", z)
+TRACE_GL_VOID(glProgramUniform3ivEXT, (GLuint program, GLint location, GLsizei count, const GLint *value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLint *", value)
+TRACE_GL_VOID(glProgramUniform4fEXT, (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w), (program, location, x, y, z, w), 6, "GLuint", program, "GLint", location, "GLfloat", x, "GLfloat", y, "GLfloat", z, "GLfloat", w)
+TRACE_GL_VOID(glProgramUniform4fvEXT, (GLuint program, GLint location, GLsizei count, const GLfloat *value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLfloat *", value)
+TRACE_GL_VOID(glProgramUniform4iEXT, (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w), (program, location, x, y, z, w), 6, "GLuint", program, "GLint", location, "GLint", x, "GLint", y, "GLint", z, "GLint", w)
+TRACE_GL_VOID(glProgramUniform4ivEXT, (GLuint program, GLint location, GLsizei count, const GLint *value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLint *", value)
+TRACE_GL_VOID(glProgramUniformMatrix2fvEXT, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
+TRACE_GL_VOID(glProgramUniformMatrix3fvEXT, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
+TRACE_GL_VOID(glProgramUniformMatrix4fvEXT, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
+TRACE_GL_VOID(glPushGroupMarkerEXT, (GLsizei length, const GLchar *marker), (length, marker), 2, "GLsizei", length, "const GLchar *", marker)
 TRACE_GL_VOID(glPushMatrix, (void), (), 0)
 TRACE_GL(GLbitfield, glQueryMatrixxOES, (GLfixed mantissa[16], GLint exponent[16]), (mantissa, exponent), 2, "GLfixed", mantissa, "GLint", exponent)
+TRACE_GL_VOID(glReadBufferNV, (GLenum mode), (mode), 1, "GLenum", mode)
 TRACE_GL_VOID(glReadPixels, (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels), (x, y, width, height, format, type, pixels), 7, "GLint", x, "GLint", y, "GLsizei", width, "GLsizei", height, "GLenum", format, "GLenum", type, "GLvoid *", pixels)
+TRACE_GL_VOID(glReadnPixelsEXT, (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data), (x, y, width, height, format, type, bufSize, data), 8, "GLint", x, "GLint", y, "GLsizei", width, "GLsizei", height, "GLenum", format, "GLenum", type, "GLsizei", bufSize, "void *", data)
 TRACE_GL_VOID(glReleaseShaderCompiler, (void), (), 0)
 TRACE_GL_VOID(glRenderbufferStorage, (GLenum target, GLenum internalformat, GLsizei width, GLsizei height), (target, internalformat, width, height), 4, "GLenum", target, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
+TRACE_GL_VOID(glRenderbufferStorageMultisampleANGLE, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height), (target, samples, internalformat, width, height), 5, "GLenum", target, "GLsizei", samples, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
+TRACE_GL_VOID(glRenderbufferStorageMultisampleAPPLE, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height), (target, samples, internalformat, width, height), 5, "GLenum", target, "GLsizei", samples, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
+TRACE_GL_VOID(glRenderbufferStorageMultisampleEXT, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height), (target, samples, internalformat, width, height), 5, "GLenum", target, "GLsizei", samples, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
 TRACE_GL_VOID(glRenderbufferStorageMultisampleIMG, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height), (target, samples, internalformat, width, height), 5, "GLenum", target, "GLsizei", samples, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
 TRACE_GL_VOID(glRenderbufferStorageOES, (GLenum target, GLenum internalformat, GLsizei width, GLsizei height), (target, internalformat, width, height), 4, "GLenum", target, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
+TRACE_GL_VOID(glResolveMultisampleFramebufferAPPLE, (void), (), 0)
 TRACE_GL_VOID(glRotatef, (GLfloat angle, GLfloat x, GLfloat y, GLfloat z), (angle, x, y, z), 4, "GLfloat", angle, "GLfloat", x, "GLfloat", y, "GLfloat", z)
 TRACE_GL_VOID(glRotatex, (GLfixed angle, GLfixed x, GLfixed y, GLfixed z), (angle, x, y, z), 4, "GLfixed", angle, "GLfixed", x, "GLfixed", y, "GLfixed", z)
 TRACE_GL_VOID(glRotatexOES, (GLfixed angle, GLfixed x, GLfixed y, GLfixed z), (angle, x, y, z), 4, "GLfixed", angle, "GLfixed", x, "GLfixed", y, "GLfixed", z)
@@ -335,8 +388,14 @@
 TRACE_GL_VOID(glTexParameterxOES, (GLenum target, GLenum pname, GLfixed param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLfixed", param)
 TRACE_GL_VOID(glTexParameterxv, (GLenum target, GLenum pname, const GLfixed *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLfixed *", params)
 TRACE_GL_VOID(glTexParameterxvOES, (GLenum target, GLenum pname, const GLfixed *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLfixed *", params)
+TRACE_GL_VOID(glTexStorage1DEXT, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width), (target, levels, internalformat, width), 4, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width)
+TRACE_GL_VOID(glTexStorage2DEXT, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height), (target, levels, internalformat, width, height), 5, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
+TRACE_GL_VOID(glTexStorage3DEXT, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth), (target, levels, internalformat, width, height, depth), 6, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width, "GLsizei", height, "GLsizei", depth)
 TRACE_GL_VOID(glTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels), (target, level, xoffset, yoffset, width, height, format, type, pixels), 9, "GLenum", target, "GLint", level, "GLint", xoffset, "GLint", yoffset, "GLsizei", width, "GLsizei", height, "GLenum", format, "GLenum", type, "const GLvoid *", pixels)
 TRACE_GL_VOID(glTexSubImage3DOES, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels), (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels), 11, "GLenum", target, "GLint", level, "GLint", xoffset, "GLint", yoffset, "GLint", zoffset, "GLsizei", width, "GLsizei", height, "GLsizei", depth, "GLenum", format, "GLenum", type, "const GLvoid*", pixels)
+TRACE_GL_VOID(glTextureStorage1DEXT, (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width), (texture, target, levels, internalformat, width), 5, "GLuint", texture, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width)
+TRACE_GL_VOID(glTextureStorage2DEXT, (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height), (texture, target, levels, internalformat, width, height), 6, "GLuint", texture, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
+TRACE_GL_VOID(glTextureStorage3DEXT, (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth), (texture, target, levels, internalformat, width, height, depth), 7, "GLuint", texture, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width, "GLsizei", height, "GLsizei", depth)
 TRACE_GL_VOID(glTranslatef, (GLfloat x, GLfloat y, GLfloat z), (x, y, z), 3, "GLfloat", x, "GLfloat", y, "GLfloat", z)
 TRACE_GL_VOID(glTranslatex, (GLfixed x, GLfixed y, GLfixed z), (x, y, z), 3, "GLfixed", x, "GLfixed", y, "GLfixed", z)
 TRACE_GL_VOID(glTranslatexOES, (GLfixed x, GLfixed y, GLfixed z), (x, y, z), 3, "GLfixed", x, "GLfixed", y, "GLfixed", z)
@@ -361,7 +420,9 @@
 TRACE_GL_VOID(glUniformMatrix4fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value), (location, count, transpose, value), 4, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat*", value)
 TRACE_GL(GLboolean, glUnmapBufferOES, (GLenum target), (target), 1, "GLenum", target)
 TRACE_GL_VOID(glUseProgram, (GLuint program), (program), 1, "GLuint", program)
+TRACE_GL_VOID(glUseProgramStagesEXT, (GLuint pipeline, GLbitfield stages, GLuint program), (pipeline, stages, program), 3, "GLuint", pipeline, "GLbitfield", stages, "GLuint", program)
 TRACE_GL_VOID(glValidateProgram, (GLuint program), (program), 1, "GLuint", program)
+TRACE_GL_VOID(glValidateProgramPipelineEXT, (GLuint pipeline), (pipeline), 1, "GLuint", pipeline)
 TRACE_GL_VOID(glVertexAttrib1f, (GLuint indx, GLfloat x), (indx, x), 2, "GLuint", indx, "GLfloat", x)
 TRACE_GL_VOID(glVertexAttrib1fv, (GLuint indx, const GLfloat* values), (indx, values), 2, "GLuint", indx, "const GLfloat*", values)
 TRACE_GL_VOID(glVertexAttrib2f, (GLuint indx, GLfloat x, GLfloat y), (indx, x, y), 3, "GLuint", indx, "GLfloat", x, "GLfloat", y)
diff --git a/packages/SystemUI/lint.xml b/packages/SystemUI/lint.xml
new file mode 100644
index 0000000..59a7109
--- /dev/null
+++ b/packages/SystemUI/lint.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<lint>
+    <issue id="PrivateResource" severity="ignore" />
+</lint>
\ No newline at end of file
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_0.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_0.png
index f24d801..55272f5 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_0.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_0.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_0_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_0_fully.png
index 66eb5db..e5e6305 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_0_fully.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_0_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_1.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_1.png
index edff74a..f595ae1 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_1.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_1.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_1_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_1_fully.png
index 1cdd4eb..f555fc9 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_1_fully.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_1_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_2.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_2.png
index 95fdaf9..ecf1349 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_2.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_2.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_2_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_2_fully.png
index 8678e39..918a9f9 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_2_fully.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_2_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_3.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_3.png
index 1d2d290..f5d1479 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_3.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_3.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_3_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_3_fully.png
index c2e4b78..f58a19c 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_3_fully.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_3_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_disconnected.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_disconnected.png
index 51b839f..744b1fa 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_disconnected.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_disconnected.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_idle.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_idle.png
index b20c5c7..bef4358 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_idle.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_wimax_signal_idle.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0.png
index b0e1424..a2ba6c4 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully.png
index 797b1eb..00b560c 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1.png
index 7c479e8..fd8d2f2 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully.png
index c60def1..92364d2 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2.png
index 1cef87b..3b4aaa1 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully.png
index 61e0e95..8cea4e9 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3.png
index 48c3490..873a317 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully.png
index 71205bf..94a4a35 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4.png
index e5b0e2d..d2381fcc 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully.png
index 5e74e44..93552cb 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_null.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_null.png
new file mode 100644
index 0000000..daf18c7
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_null.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_0.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_0.png
new file mode 100644
index 0000000..a0c7a99
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_0.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_0_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_0_fully.png
new file mode 100644
index 0000000..b1f1e5b
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_0_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_1.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_1.png
new file mode 100644
index 0000000..8b31618
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_1.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_1_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_1_fully.png
new file mode 100644
index 0000000..1a62682
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_1_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_2.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_2.png
new file mode 100644
index 0000000..ff51551
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_2.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_2_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_2_fully.png
new file mode 100644
index 0000000..0374142
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_2_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_3.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_3.png
new file mode 100644
index 0000000..8f881f2
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_3.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_3_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_3_fully.png
new file mode 100644
index 0000000..7870cee
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_3_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_disconnected.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_disconnected.png
new file mode 100644
index 0000000..65404c2
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_disconnected.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_idle.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_idle.png
new file mode 100644
index 0000000..327f89d
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_wimax_signal_idle.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0.png
index 76b272e..d93a661 100644
--- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0.png
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully.png
index 18c603d..b39cc04 100644
--- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully.png
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1.png
index 89274b1..4305351 100644
--- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1.png
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully.png
index ae8e70a..4305be2 100644
--- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully.png
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2.png
index 35ec9bd..beb641b 100644
--- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2.png
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully.png
index b082e9f..7b8ddc2 100644
--- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully.png
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3.png
index a2c7ed8..a4028cd 100644
--- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3.png
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully.png
index e12ecbf..fad1873 100644
--- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully.png
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4.png
index f08b75e..b5ed22b 100644
--- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4.png
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully.png
index 12581d5..cca7bf3 100644
--- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully.png
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_null.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_null.png
new file mode 100644
index 0000000..5292998
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_null.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_0.png b/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_0.png
index a290cf0..ac322ba 100644
--- a/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_0.png
+++ b/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_0.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_0_fully.png b/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_0_fully.png
index 09314e9..ac322ba 100644
--- a/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_0_fully.png
+++ b/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_0_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_1.png b/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_1.png
index 90de934..f139bbe 100644
--- a/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_1.png
+++ b/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_1.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_1_fully.png b/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_1_fully.png
index cdcac61..af67018 100644
--- a/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_1_fully.png
+++ b/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_1_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_2.png b/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_2.png
index 570a9b5..fe404e2 100644
--- a/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_2.png
+++ b/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_2.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_2_fully.png b/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_2_fully.png
index 68f3075..1ffa9b6 100644
--- a/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_2_fully.png
+++ b/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_2_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_3.png b/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_3.png
index 07b03fa..75cd8ee 100644
--- a/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_3.png
+++ b/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_3.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_3_fully.png b/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_3_fully.png
index 9dff62d..666d1f6 100644
--- a/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_3_fully.png
+++ b/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_3_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_4.png b/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_4.png
index f855c1c..da9607b 100644
--- a/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_4.png
+++ b/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_4.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_4_fully.png b/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_4_fully.png
index 119ce32..d05297f 100644
--- a/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_4_fully.png
+++ b/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_4_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_null.png b/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_null.png
new file mode 100644
index 0000000..3733a38
--- /dev/null
+++ b/packages/SystemUI/res/drawable-sw600dp-hdpi/stat_sys_signal_null.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_0.png b/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_0.png
index 926b081..f931c60 100644
--- a/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_0.png
+++ b/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_0.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_0_fully.png b/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_0_fully.png
index 4498bed..f931c60 100644
--- a/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_0_fully.png
+++ b/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_0_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_1.png b/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_1.png
index 60b00a8..398f4d5 100644
--- a/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_1.png
+++ b/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_1.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_1_fully.png b/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_1_fully.png
index 8e9be27..a0fc3f2 100644
--- a/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_1_fully.png
+++ b/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_1_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_2.png b/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_2.png
index 014d838..5fe96a3 100644
--- a/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_2.png
+++ b/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_2.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_2_fully.png b/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_2_fully.png
index 1755088..8a66255 100644
--- a/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_2_fully.png
+++ b/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_2_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_3.png b/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_3.png
index 44e7905..e785a7a 100644
--- a/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_3.png
+++ b/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_3.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_3_fully.png b/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_3_fully.png
index bfc17dd..63be95d 100644
--- a/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_3_fully.png
+++ b/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_3_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_4.png b/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_4.png
index e39d7d7..533bcdc 100644
--- a/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_4.png
+++ b/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_4.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_4_fully.png b/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_4_fully.png
index 466d3b5..566172e 100644
--- a/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_4_fully.png
+++ b/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_4_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_null.png b/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_null.png
new file mode 100644
index 0000000..ab718ad
--- /dev/null
+++ b/packages/SystemUI/res/drawable-sw600dp-mdpi/stat_sys_signal_null.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_0.png b/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_0.png
index 1744f65..ccf1ba1 100644
--- a/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_0.png
+++ b/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_0.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_0_fully.png b/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_0_fully.png
index 6270e51..ccf1ba1 100644
--- a/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_0_fully.png
+++ b/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_0_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_1.png b/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_1.png
index b47624f..07937fe 100644
--- a/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_1.png
+++ b/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_1.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_1_fully.png b/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_1_fully.png
index 9fd562d..ba1b077 100644
--- a/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_1_fully.png
+++ b/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_1_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_2.png b/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_2.png
index 42630a2..a705a89 100644
--- a/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_2.png
+++ b/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_2.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_2_fully.png b/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_2_fully.png
index 1777ce7..0187d12 100644
--- a/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_2_fully.png
+++ b/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_2_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_3.png b/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_3.png
index d35d546..0ed7d6f4 100644
--- a/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_3.png
+++ b/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_3.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_3_fully.png b/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_3_fully.png
index 324ec32..24a6e5a 100644
--- a/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_3_fully.png
+++ b/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_3_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_4.png b/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_4.png
index 54f3ae7..1a47801 100644
--- a/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_4.png
+++ b/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_4.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_4_fully.png b/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_4_fully.png
index 290dafa..d9648b6f 100644
--- a/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_4_fully.png
+++ b/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_4_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_null.png b/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_null.png
new file mode 100644
index 0000000..023bbe6
--- /dev/null
+++ b/packages/SystemUI/res/drawable-sw600dp-xhdpi/stat_sys_signal_null.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_0.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_0.png
new file mode 100644
index 0000000..7a8d1f3
--- /dev/null
+++ b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_0.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_0_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_0_fully.png
new file mode 100644
index 0000000..5f86bbb
--- /dev/null
+++ b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_0_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_1.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_1.png
new file mode 100644
index 0000000..70e2011
--- /dev/null
+++ b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_1.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_1_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_1_fully.png
new file mode 100644
index 0000000..c1d1cc3
--- /dev/null
+++ b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_1_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_2.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_2.png
new file mode 100644
index 0000000..c62d977
--- /dev/null
+++ b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_2.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_2_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_2_fully.png
new file mode 100644
index 0000000..86d30df
--- /dev/null
+++ b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_2_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_3.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_3.png
new file mode 100644
index 0000000..b112748
--- /dev/null
+++ b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_3.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_3_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_3_fully.png
new file mode 100644
index 0000000..bfc7d81
--- /dev/null
+++ b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_3_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_disconnected.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_disconnected.png
new file mode 100644
index 0000000..bea643f3a
--- /dev/null
+++ b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_disconnected.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_idle.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_idle.png
new file mode 100644
index 0000000..a8a89d6
--- /dev/null
+++ b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_wimax_signal_idle.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0.png
index 9c80517..0a28885 100644
--- a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0.png
+++ b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_fully.png
index b144e18..bbe70cc 100644
--- a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_fully.png
+++ b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1.png
index 32762da..9943613 100644
--- a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1.png
+++ b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_fully.png
index ae02c8f..e25a55c 100644
--- a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_fully.png
+++ b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2.png
index f95f677..1fc1775 100644
--- a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2.png
+++ b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_fully.png
index 23343e9..d1aefca 100644
--- a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_fully.png
+++ b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3.png
index d72d42b..82b9741 100644
--- a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3.png
+++ b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_fully.png
index 3e5eaf4..c8c2c63 100644
--- a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_fully.png
+++ b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4.png
index bf8ca9f..9f4979c 100644
--- a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4.png
+++ b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_fully.png
index e9de257..b2e64b9 100644
--- a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_fully.png
+++ b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_fully.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_null.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_null.png
new file mode 100644
index 0000000..3e7fefd
--- /dev/null
+++ b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_null.png
Binary files differ
diff --git a/packages/SystemUI/res/layout-sw600dp/status_bar_notification_panel_title.xml b/packages/SystemUI/res/layout-sw600dp/status_bar_notification_panel_title.xml
index 46f4c39..b985aaf 100644
--- a/packages/SystemUI/res/layout-sw600dp/status_bar_notification_panel_title.xml
+++ b/packages/SystemUI/res/layout-sw600dp/status_bar_notification_panel_title.xml
@@ -25,120 +25,166 @@
     android:background="@drawable/notify_panel_clock_bg"
     >
 
-    <LinearLayout
+    <TableLayout
         android:id="@+id/icons"
-        android:layout_width="wrap_content"
+        android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_alignParentLeft="true"
         android:layout_alignParentBottom="true"
-        android:baselineAlignedChildIndex="0"
         android:layout_marginLeft="16dp"
         android:layout_marginTop="16dp"
         android:layout_marginBottom="16dp"
+        android:shrinkColumns="2,4"
+        android:stretchColumns="7"
         >
+        <TableRow>
 
-        <ImageView
-            android:id="@+id/bluetooth"
-            android:layout_height="wrap_content"
-            android:layout_width="wrap_content"
-            android:scaleType="centerInside"
-            android:baseline="18dp"
-            android:visibility="gone"
-            android:contentDescription="@null"
-            />
-
-        <FrameLayout
-            android:id="@+id/netwerk"
-            android:layout_height="wrap_content"
-            android:layout_width="wrap_content"
-            android:layout_marginRight="4dp"
-            >
-
-            <ImageView
-                android:id="@+id/network_signal"
+            <!-- to keep the column ids stable we wrap disappearing views in
+                 frames -->
+            <FrameLayout
                 android:layout_height="wrap_content"
                 android:layout_width="wrap_content"
-                android:contentDescription="@null"
+                android:layout_gravity="center_vertical"
+                >
+                <ImageView
+                    android:id="@+id/bluetooth"
+                    android:layout_height="wrap_content"
+                    android:layout_width="wrap_content"
+                    android:paddingRight="16dp"
+                    android:visibility="gone"
+                    android:contentDescription="@null"
+                    android:layout_gravity="center_vertical"
+                    />
+            </FrameLayout>
+
+            <!-- mobile data -->
+            <FrameLayout
+                android:id="@+id/mobile_icon"
+                android:layout_height="wrap_content"
+                android:layout_width="wrap_content"
+                android:layout_gravity="center_vertical"
+                android:paddingRight="6dp"
+                >
+
+                <ImageView
+                    android:id="@+id/mobile_signal"
+                    android:layout_height="wrap_content"
+                    android:layout_width="wrap_content"
+                    android:contentDescription="@null"
+                    />
+
+                <ImageView
+                    android:id="@+id/mobile_type"
+                    android:layout_height="wrap_content"
+                    android:layout_width="wrap_content"
+                    android:contentDescription="@null"
+                    />
+
+            </FrameLayout>
+            <TextView
+                android:id="@+id/mobile_text"
+                style="@style/StatusBarNotificationText"
+                android:layout_gravity="left|center_vertical"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:paddingRight="12dp"
+                android:singleLine="true"
+                android:ellipsize="end"
+                android:text="@string/status_bar_settings_settings_button"
+                />
+
+            <!-- wifi -->
+            <FrameLayout
+                android:id="@+id/wifi_icon"
+                android:layout_height="wrap_content"
+                android:layout_width="wrap_content"
+                android:layout_gravity="center_vertical"
+                android:paddingRight="6dp"
+                >
+
+                <ImageView
+                    android:id="@+id/wifi_signal"
+                    android:layout_height="wrap_content"
+                    android:layout_width="wrap_content"
+                    android:contentDescription="@null"
+                    />
+
+                <ImageView
+                    android:id="@+id/wifi_direction"
+                    android:layout_height="wrap_content"
+                    android:layout_width="wrap_content"
+                    android:contentDescription="@null"
+                    />
+
+            </FrameLayout>
+            <TextView
+                android:id="@+id/wifi_text"
+                style="@style/StatusBarNotificationText"
+                android:layout_gravity="left|center_vertical"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:paddingRight="12dp"
+                android:singleLine="true"
+                android:ellipsize="end"
+                android:text="@string/status_bar_settings_settings_button"
                 />
 
             <ImageView
-                android:id="@+id/network_type"
+                android:id="@+id/battery"
                 android:layout_height="wrap_content"
                 android:layout_width="wrap_content"
+                android:scaleType="centerInside"
+                android:layout_gravity="center_vertical"
+                android:layout_alignBaseline="@id/wifi_signal"
+                android:paddingRight="6dp"
                 android:contentDescription="@null"
                 />
 
-            <ImageView
-                android:id="@+id/network_direction"
-                android:layout_height="wrap_content"
+            <TextView
+                android:id="@+id/battery_text"
+                style="@style/StatusBarNotificationText"
                 android:layout_width="wrap_content"
-                android:contentDescription="@null"
+                android:layout_height="wrap_content"
+                android:layout_gravity="left|center_vertical"
+                android:paddingRight="2dp"
+                android:singleLine="true"
+                android:text="@string/status_bar_settings_settings_button"
                 />
 
-        </FrameLayout>
-            
-        <TextView
-            android:id="@+id/network_text"
-            style="@style/StatusBarNotificationText"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_toRightOf="@id/netwerk"
-            android:layout_marginRight="8dp"
-            android:layout_alignBaseline="@id/network_signal"
-            android:singleLine="true"
-            android:text="@string/status_bar_settings_settings_button"
-            />
+            <!-- this will stretch to eat up available space -->
+            <View
+                android:layout_width="0dp"
+                android:layout_height="0dp"
+                />
 
-        <ImageView
-            android:id="@+id/battery"
-            android:layout_height="wrap_content"
-            android:layout_width="wrap_content"
-            android:scaleType="centerInside"
-            android:layout_toRightOf="@id/network_text"
-            android:layout_alignBaseline="@id/network_signal"
-            android:baseline="18dp"
-            android:layout_marginLeft="8dp"
-            android:layout_marginRight="8dp"
-            android:contentDescription="@null"
-            />
+            <FrameLayout
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center_vertical"
+                >
 
-        <TextView
-            android:id="@+id/battery_text"
-            style="@style/StatusBarNotificationText"
-            android:layout_width="56dp"
-            android:layout_height="wrap_content"
-            android:layout_toRightOf="@id/battery"
-            android:layout_alignBaseline="@id/battery"
-            android:layout_marginRight="8dp"
-            android:singleLine="true"
-            android:text="@string/status_bar_settings_settings_button"
-            />
-    </LinearLayout>
+                <ImageView
+                    android:id="@+id/settings_button"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:paddingRight="16dp"
+                    android:src="@drawable/ic_sysbar_quicksettings"
+                    android:contentDescription="@string/accessibility_settings_button"
+                    />
 
-    <ImageView
-        android:id="@+id/settings_button"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignBaseline="@id/icons"
-        android:layout_alignParentRight="true"
-        android:paddingRight="16dp"
-        android:src="@drawable/ic_sysbar_quicksettings"
-        android:baseline="21dp"
-        android:contentDescription="@string/accessibility_settings_button"
-        />
+                <ImageView
+                    android:id="@+id/notification_button"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:paddingRight="16dp"
+                    android:src="@drawable/ic_notification_open"
+                    android:visibility="invisible"
+                    android:contentDescription="@string/accessibility_notifications_button"
+                    />
+            </FrameLayout>
 
-    <ImageView
-        android:id="@+id/notification_button"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignBaseline="@id/icons"
-        android:layout_alignParentRight="true"
-        android:paddingRight="16dp"
-        android:src="@drawable/ic_notification_open"
-        android:baseline="21dp"
-        android:visibility="invisible"
-        android:contentDescription="@string/accessibility_notifications_button"
-        />
+        </TableRow>
+    </TableLayout>
 
     <com.android.systemui.statusbar.tablet.HoloClock
         android:id="@+id/clock"
diff --git a/packages/SystemUI/res/values-be/strings.xml b/packages/SystemUI/res/values-be/strings.xml
index a6c64ad..d083467 100644
--- a/packages/SystemUI/res/values-be/strings.xml
+++ b/packages/SystemUI/res/values-be/strings.xml
@@ -101,7 +101,12 @@
     <string name="accessibility_wifi_one_bar" msgid="6854947280074467207">"Wi-Fi, адзiн слупок."</string>
     <string name="accessibility_wifi_two_bars" msgid="3344340012058984348">"Wi-Fi, два слупкi."</string>
     <string name="accessibility_wifi_three_bars" msgid="928322805193265041">"Wi-Fi, тры слупкi."</string>
-    <string name="accessibility_wifi_signal_full" msgid="4826278754383492058">"Моцны сiгнал Wi-Fi."</string>
+    <string name="accessibility_wifi_signal_full" msgid="1275764416228473932">"Поўны сігнал Wi-Fi."</string>
+    <string name="accessibility_no_wimax" msgid="4329180129727630368">"Няма сiгналу WiMAX."</string>
+    <string name="accessibility_wimax_one_bar" msgid="4170994299011863648">"Адзiн слупок сiгналу WiMAX."</string>
+    <string name="accessibility_wimax_two_bars" msgid="9176236858336502288">"Два слупкi сiгналу WiMAX."</string>
+    <string name="accessibility_wimax_three_bars" msgid="6116551636752103927">"Тры слупкi сiгналу WiMAX."</string>
+    <string name="accessibility_wimax_signal_full" msgid="2768089986795579558">"Моцны сiгнал WiMAX."</string>
     <string name="accessibility_data_connection_gprs" msgid="1606477224486747751">"GPRS"</string>
     <string name="accessibility_data_connection_3g" msgid="8628562305003568260">"3G"</string>
     <string name="accessibility_data_connection_3.5g" msgid="8664845609981692001">"3.5G"</string>
@@ -135,4 +140,5 @@
     <string name="gps_notification_searching_text" msgid="8574247005642736060">"Пошук GPS"</string>
     <string name="gps_notification_found_text" msgid="4619274244146446464">"Месца задана праз GPS"</string>
     <string name="accessibility_clear_all" msgid="5235938559247164925">"Выдалiць усе апавяшчэннi."</string>
+    <string name="dreams_dock_launcher" msgid="3541196417659166245">"Актывацыя экраннай застаўкі"</string>
 </resources>
diff --git a/packages/SystemUI/res/values-de/strings.xml b/packages/SystemUI/res/values-de/strings.xml
index e84f40f..ab4eeb4 100644
--- a/packages/SystemUI/res/values-de/strings.xml
+++ b/packages/SystemUI/res/values-de/strings.xml
@@ -133,7 +133,7 @@
     <string name="data_usage_disabled_dialog_4g_title" msgid="4789143363492682629">"4G-Daten deaktiviert"</string>
     <string name="data_usage_disabled_dialog_mobile_title" msgid="1046047248844821202">"Mobile Daten deaktiviert"</string>
     <string name="data_usage_disabled_dialog_title" msgid="2086815304858964954">"Daten deaktiviert"</string>
-    <string name="data_usage_disabled_dialog" msgid="3853117269051806280">"Sie haben die angegebenen Grenze für die Datennutzung erreicht."\n\n"Wenn Sie die Datennutzung erneut aktivieren, berechnet Ihr Mobilfunkanbieter unter Umständen zusätzliche Gebühren."</string>
+    <string name="data_usage_disabled_dialog" msgid="3853117269051806280">"Sie haben die angegebenen Grenze für den Datenverbrauch erreicht."\n\n"Wenn Sie die Datennutzung erneut aktivieren, berechnet Ihr Mobilfunkanbieter unter Umständen zusätzliche Gebühren."</string>
     <string name="data_usage_disabled_dialog_enable" msgid="7729772039208664606">"Daten erneut aktivieren"</string>
     <string name="status_bar_settings_signal_meter_disconnected" msgid="1940231521274147771">"Keine Internetverbindung"</string>
     <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="6557486452774597820">"WLAN verbunden"</string>
diff --git a/packages/SystemUI/res/values-es-rUS-large/strings.xml b/packages/SystemUI/res/values-es-rUS-large/strings.xml
index 3f96e87..dd44b28 100644
--- a/packages/SystemUI/res/values-es-rUS-large/strings.xml
+++ b/packages/SystemUI/res/values-es-rUS-large/strings.xml
@@ -19,7 +19,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="status_bar_clear_all_button" msgid="4661583896803349732">"Borrar todas"</string>
+    <string name="status_bar_clear_all_button" msgid="4661583896803349732">"Eliminar todas"</string>
     <string name="notifications_off_title" msgid="1860117696034775851">"Notificaciones desactivadas"</string>
     <string name="notifications_off_text" msgid="1439152806320786912">"Toca aquí para volver a activar las notificaciones."</string>
 </resources>
diff --git a/packages/SystemUI/res/values-es-rUS/strings.xml b/packages/SystemUI/res/values-es-rUS/strings.xml
index 85818ae..a700908 100644
--- a/packages/SystemUI/res/values-es-rUS/strings.xml
+++ b/packages/SystemUI/res/values-es-rUS/strings.xml
@@ -20,7 +20,7 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="app_label" msgid="7164937344850004466">"IU del sistema"</string>
-    <string name="status_bar_clear_all_button" msgid="7774721344716731603">"Borrar"</string>
+    <string name="status_bar_clear_all_button" msgid="7774721344716731603">"Eliminar"</string>
     <string name="status_bar_do_not_disturb_button" msgid="5812628897510997853">"No molestar"</string>
     <string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Mostrar notificaciones"</string>
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Eliminar de la lista"</string>
@@ -122,7 +122,7 @@
     <skip />
     <string name="accessibility_settings_button" msgid="799583911231893380">"Configuración del sistema"</string>
     <string name="accessibility_notifications_button" msgid="4498000369779421892">"Notificaciones"</string>
-    <string name="accessibility_remove_notification" msgid="3603099514902182350">"Borrar notificación"</string>
+    <string name="accessibility_remove_notification" msgid="3603099514902182350">"Eliminar notificación"</string>
     <string name="accessibility_gps_enabled" msgid="3511469499240123019">"GPS habilitado"</string>
     <string name="accessibility_gps_acquiring" msgid="8959333351058967158">"Adquisición de GPS"</string>
     <string name="accessibility_tty_enabled" msgid="4613200365379426561">"TeleTypewriter habilitado"</string>
@@ -133,12 +133,12 @@
     <string name="data_usage_disabled_dialog_4g_title" msgid="4789143363492682629">"Datos de 4G inhabilitados"</string>
     <string name="data_usage_disabled_dialog_mobile_title" msgid="1046047248844821202">"Se inhabilitaron los datos móviles"</string>
     <string name="data_usage_disabled_dialog_title" msgid="2086815304858964954">"Datos inhabilitados"</string>
-    <string name="data_usage_disabled_dialog" msgid="3853117269051806280">"Alcanzaste el límite de uso de datos especificado."\n\n"Puede que tu operador te cobre por volver a habilitar datos."</string>
-    <string name="data_usage_disabled_dialog_enable" msgid="7729772039208664606">"Volver a habilitar datos"</string>
+    <string name="data_usage_disabled_dialog" msgid="3853117269051806280">"Alcanzaste el límite de uso de datos especificado."\n\n"Puede que tu operador te cobre por volver a activar datos."</string>
+    <string name="data_usage_disabled_dialog_enable" msgid="7729772039208664606">"Volver a activar datos"</string>
     <string name="status_bar_settings_signal_meter_disconnected" msgid="1940231521274147771">"Sin conexión a Internet"</string>
     <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="6557486452774597820">"Wi-Fi conectado"</string>
     <string name="gps_notification_searching_text" msgid="8574247005642736060">"Buscando GPS"</string>
     <string name="gps_notification_found_text" msgid="4619274244146446464">"La ubicación se estableció por GPS"</string>
-    <string name="accessibility_clear_all" msgid="5235938559247164925">"Borrar todas las notificaciones"</string>
+    <string name="accessibility_clear_all" msgid="5235938559247164925">"Eliminar todas las notificaciones"</string>
     <string name="dreams_dock_launcher" msgid="3541196417659166245">"Activar el protector de pantalla"</string>
 </resources>
diff --git a/packages/SystemUI/res/values-et/strings.xml b/packages/SystemUI/res/values-et/strings.xml
index 943b8ca..a5bfb4a 100644
--- a/packages/SystemUI/res/values-et/strings.xml
+++ b/packages/SystemUI/res/values-et/strings.xml
@@ -101,7 +101,12 @@
     <string name="accessibility_wifi_one_bar" msgid="6854947280074467207">"WiFi signaal: üks post."</string>
     <string name="accessibility_wifi_two_bars" msgid="3344340012058984348">"WiFi signaal: kaks posti."</string>
     <string name="accessibility_wifi_three_bars" msgid="928322805193265041">"WiFi signaal: kolm posti."</string>
-    <string name="accessibility_wifi_signal_full" msgid="4826278754383492058">"WiFi signaal on täis."</string>
+    <string name="accessibility_wifi_signal_full" msgid="1275764416228473932">"WiFi-signaal on tugev."</string>
+    <string name="accessibility_no_wimax" msgid="4329180129727630368">"WiMAX-i pole."</string>
+    <string name="accessibility_wimax_one_bar" msgid="4170994299011863648">"WiMAX-i on üks riba."</string>
+    <string name="accessibility_wimax_two_bars" msgid="9176236858336502288">"WiMAX-i on kaks riba."</string>
+    <string name="accessibility_wimax_three_bars" msgid="6116551636752103927">"WiMAX-i on kolm riba."</string>
+    <string name="accessibility_wimax_signal_full" msgid="2768089986795579558">"WiMAX-i signaal on tugev."</string>
     <string name="accessibility_data_connection_gprs" msgid="1606477224486747751">"GPRS"</string>
     <string name="accessibility_data_connection_3g" msgid="8628562305003568260">"3G"</string>
     <string name="accessibility_data_connection_3.5g" msgid="8664845609981692001">"3,5G"</string>
@@ -133,4 +138,5 @@
     <string name="gps_notification_searching_text" msgid="8574247005642736060">"GPS-i otsimine"</string>
     <string name="gps_notification_found_text" msgid="4619274244146446464">"GPS-i määratud asukoht"</string>
     <string name="accessibility_clear_all" msgid="5235938559247164925">"Kustuta kõik teatised."</string>
+    <string name="dreams_dock_launcher" msgid="3541196417659166245">"Aktiveeri ekraanisäästja"</string>
 </resources>
diff --git a/packages/SystemUI/res/values-pt/strings.xml b/packages/SystemUI/res/values-pt/strings.xml
index 545d54e..dec4def 100644
--- a/packages/SystemUI/res/values-pt/strings.xml
+++ b/packages/SystemUI/res/values-pt/strings.xml
@@ -115,7 +115,7 @@
     <string name="accessibility_data_connection_edge" msgid="4477457051631979278">"Edge"</string>
     <string name="accessibility_data_connection_wifi" msgid="2324496756590645221">"Wi-Fi"</string>
     <string name="accessibility_no_sim" msgid="8274017118472455155">"Sem SIM."</string>
-    <string name="accessibility_bluetooth_tether" msgid="4102784498140271969">"Vínculo Bluetooth."</string>
+    <string name="accessibility_bluetooth_tether" msgid="4102784498140271969">"Tethering Bluetooth."</string>
     <string name="accessibility_airplane_mode" msgid="834748999790763092">"Modo de avião."</string>
     <!-- String.format failed for translation -->
     <!-- no translation found for accessibility_battery_level (7451474187113371965) -->
diff --git a/packages/SystemUI/res/values-rm/strings.xml b/packages/SystemUI/res/values-rm/strings.xml
index 2106b89..983df47 100644
--- a/packages/SystemUI/res/values-rm/strings.xml
+++ b/packages/SystemUI/res/values-rm/strings.xml
@@ -39,8 +39,10 @@
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Nagins avis"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Actual"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Avis"</string>
-    <!-- outdated translation 7923774589611311406 -->     <string name="battery_low_title" msgid="2783104807551211639">"Connectar il chargiabattarias"</string>
-    <!-- outdated translation 7388781709819722764 -->     <string name="battery_low_subtitle" msgid="1752040062087829196">"L\'accu è prest vid."</string>
+    <!-- no translation found for battery_low_title (2783104807551211639) -->
+    <skip />
+    <!-- no translation found for battery_low_subtitle (1752040062087829196) -->
+    <skip />
     <!-- no translation found for battery_low_percent_format (1077244949318261761) -->
     <skip />
     <!-- no translation found for invalid_charger (4549105996740522523) -->
diff --git a/packages/SystemUI/res/values-ru/strings.xml b/packages/SystemUI/res/values-ru/strings.xml
index 17330b1..963976d 100644
--- a/packages/SystemUI/res/values-ru/strings.xml
+++ b/packages/SystemUI/res/values-ru/strings.xml
@@ -36,7 +36,7 @@
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Уведомления"</string>
     <string name="battery_low_title" msgid="2783104807551211639">"Подключите зарядное устройство"</string>
     <string name="battery_low_subtitle" msgid="1752040062087829196">"Батарея разряжена."</string>
-    <string name="battery_low_percent_format" msgid="1077244949318261761">"Осталось: <xliff:g id="NUMBER">%d%%</xliff:g>"</string>
+    <string name="battery_low_percent_format" msgid="1077244949318261761">"Осталось <xliff:g id="NUMBER">%d%%</xliff:g>"</string>
     <string name="invalid_charger" msgid="4549105996740522523">"Зарядка через порт USB не поддерживается."\n"Используйте только зарядное устройство из комплекта поставки."</string>
     <string name="battery_low_why" msgid="7279169609518386372">"Расход заряда батареи"</string>
     <string name="status_bar_settings_settings_button" msgid="3023889916699270224">"Настройки"</string>
diff --git a/packages/SystemUI/res/values-sw/strings.xml b/packages/SystemUI/res/values-sw/strings.xml
index 3843ea9..70e29eb 100644
--- a/packages/SystemUI/res/values-sw/strings.xml
+++ b/packages/SystemUI/res/values-sw/strings.xml
@@ -26,7 +26,7 @@
     <string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Ondoa kwenye orodha"</string>
     <string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Taarifa za programu-matumizi"</string>
     <string name="status_bar_no_recent_apps" msgid="6576392951053994640">"Hakuna programu za sasa"</string>
-    <string name="status_bar_accessibility_dismiss_recents" msgid="4576076075226540105">"Ondosha programu za hivi karibuni"</string>
+    <string name="status_bar_accessibility_dismiss_recents" msgid="4576076075226540105">"Ondosha prog za hivi karibuni"</string>
     <!-- String.format failed for translation -->
     <!-- no translation found for status_bar_accessibility_recent_apps:other (1040784359794890744) -->
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"Hakuna arifa"</string>
diff --git a/packages/SystemUI/src/com/android/systemui/net/NetworkOverLimitActivity.java b/packages/SystemUI/src/com/android/systemui/net/NetworkOverLimitActivity.java
index 723e338..888b76e 100644
--- a/packages/SystemUI/src/com/android/systemui/net/NetworkOverLimitActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/net/NetworkOverLimitActivity.java
@@ -77,7 +77,7 @@
         final INetworkPolicyManager policyService = INetworkPolicyManager.Stub.asInterface(
                 ServiceManager.getService(Context.NETWORK_POLICY_SERVICE));
         try {
-            policyService.snoozePolicy(template);
+            policyService.snoozeLimit(template);
         } catch (RemoteException e) {
             Slog.w(TAG, "problem snoozing network policy", e);
         }
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java b/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java
index dcda9c2..4145fc4 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java
@@ -68,22 +68,13 @@
 
         // get the icon size we want -- on tablets, we use bigger icons
         boolean isTablet = res.getBoolean(R.bool.config_recents_interface_for_tablets);
-        int density = res.getDisplayMetrics().densityDpi;
         if (isTablet) {
-            if (density == DisplayMetrics.DENSITY_LOW) {
-                mIconDpi = DisplayMetrics.DENSITY_MEDIUM;
-            } else if (density == DisplayMetrics.DENSITY_MEDIUM) {
-                mIconDpi = DisplayMetrics.DENSITY_HIGH;
-            } else if (density == DisplayMetrics.DENSITY_HIGH) {
-                mIconDpi = DisplayMetrics.DENSITY_XHIGH;
-            } else if (density == DisplayMetrics.DENSITY_XHIGH) {
-                // We'll need to use a denser icon, or some sort of a mipmap
-                mIconDpi = DisplayMetrics.DENSITY_XHIGH;
-            }
+            ActivityManager activityManager =
+                    (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
+            mIconDpi = activityManager.getLauncherLargeIconDensity();
         } else {
             mIconDpi = res.getDisplayMetrics().densityDpi;
         }
-        mIconDpi = isTablet ? DisplayMetrics.DENSITY_HIGH : res.getDisplayMetrics().densityDpi;
 
         // Render the default thumbnail background
         int width = (int) res.getDimensionPixelSize(com.android.internal.R.dimen.thumbnail_width);
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
index 4aec22c..a10e363 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
@@ -181,7 +181,14 @@
     }
 
     public boolean isInContentArea(int x, int y) {
-        return pointInside(x, y, mRecentsContainer) || pointInside(x, y, mStatusBarTouchProxy);
+        if (pointInside(x, y, mRecentsContainer)) {
+            return true;
+        } else if (mStatusBarTouchProxy != null &&
+                pointInside(x, y, mStatusBarTouchProxy)) {
+            return true;
+        } else {
+            return false;
+        }
     }
 
     public void show(boolean show, boolean animate) {
@@ -390,8 +397,10 @@
 
         mPreloadTasksRunnable = new Runnable() {
             public void run() {
-                setVisibility(INVISIBLE);
-                refreshRecentTasksList();
+                if (!mShowing) {
+                    setVisibility(INVISIBLE);
+                    refreshRecentTasksList();
+                }
             }
         };
     }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
index 69a247d..d33ed3f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
@@ -23,6 +23,8 @@
 import android.content.Context;
 import android.content.res.Resources;
 import android.graphics.Rect;
+import android.os.Handler;
+import android.os.Message;
 import android.os.ServiceManager;
 import android.util.AttributeSet;
 import android.util.Slog;
@@ -66,6 +68,35 @@
     int mDisabledFlags = 0;
     int mNavigationIconHints = 0;
 
+    // workaround for LayoutTransitions leaving the nav buttons in a weird state (bug 5549288)
+    final static boolean WORKAROUND_INVALID_LAYOUT = true;
+    final static int MSG_CHECK_INVALID_LAYOUT = 8686;
+
+    private class H extends Handler {
+        public void handleMessage(Message m) {
+            switch (m.what) {
+                case MSG_CHECK_INVALID_LAYOUT:
+                    final String how = "" + m.obj;
+                    final int w = getWidth();
+                    final int h = getHeight();
+                    final int vw = mCurrentView.getWidth();
+                    final int vh = mCurrentView.getHeight();
+
+                    if (h != vh || w != vw) {
+                        Slog.w(TAG, String.format(
+                            "*** Invalid layout in navigation bar (%s this=%dx%d cur=%dx%d)",
+                            how, w, h, vw, vh));
+                        if (WORKAROUND_INVALID_LAYOUT) {
+                            requestLayout();
+                        }
+                    }
+                    break;
+            }
+        }
+    }
+
+    private H mHandler = new H();
+
     public View getRecentsButton() {
         return mCurrentView.findViewById(R.id.recent_apps);
     }
@@ -275,6 +306,36 @@
         }
     }
 
+    @Override
+    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
+        if (DEBUG) Slog.d(TAG, String.format(
+                    "onSizeChanged: (%dx%d) old: (%dx%d)", w, h, oldw, oldh));
+        postCheckForInvalidLayout("sizeChanged");
+        super.onSizeChanged(w, h, oldw, oldh);
+    }
+
+    /*
+    @Override
+    protected void onLayout (boolean changed, int left, int top, int right, int bottom) {
+        if (DEBUG) Slog.d(TAG, String.format(
+                    "onLayout: %s (%d,%d,%d,%d)", 
+                    changed?"changed":"notchanged", left, top, right, bottom));
+        super.onLayout(changed, left, top, right, bottom);
+    }
+
+    // uncomment this for extra defensiveness in WORKAROUND_INVALID_LAYOUT situations: if all else
+    // fails, any touch on the display will fix the layout.
+    @Override
+    public boolean onInterceptTouchEvent(MotionEvent ev) {
+        if (DEBUG) Slog.d(TAG, "onInterceptTouchEvent: " + ev.toString());
+        if (ev.getAction() == MotionEvent.ACTION_DOWN) {
+            postCheckForInvalidLayout("touch");
+        }
+        return super.onInterceptTouchEvent(ev);
+    }
+    */
+        
+
     private String getResourceName(int resId) {
         if (resId != 0) {
             final android.content.res.Resources res = mContext.getResources();
@@ -288,6 +349,10 @@
         }
     }
 
+    private void postCheckForInvalidLayout(final String how) {
+        mHandler.obtainMessage(MSG_CHECK_INVALID_LAYOUT, 0, 0, how).sendToTarget();
+    }
+
     private static String visibilityToString(int vis) {
         switch (vis) {
             case View.INVISIBLE:
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
index 5e5bc1a..cc07240 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
@@ -55,6 +55,7 @@
     float mGlowAlpha = 0f, mGlowScale = 1f, mDrawingAlpha = 1f;
     boolean mSupportsLongpress = true;
     RectF mRect = new RectF(0f,0f,0f,0f);
+    AnimatorSet mPressedAnim;
 
     Runnable mCheckLongPress = new Runnable() {
         public void run() {
@@ -87,7 +88,7 @@
 
         mGlowBG = a.getDrawable(R.styleable.KeyButtonView_glowBackground);
         if (mGlowBG != null) {
-            mDrawingAlpha = BUTTON_QUIESCENT_ALPHA;
+            setDrawingAlpha(BUTTON_QUIESCENT_ALPHA);
         }
         
         a.recycle();
@@ -107,17 +108,13 @@
             final int h = getHeight();
             canvas.scale(mGlowScale, mGlowScale, w*0.5f, h*0.5f);
             mGlowBG.setBounds(0, 0, w, h);
-            mGlowBG.setAlpha((int)(mGlowAlpha * 255));
+            mGlowBG.setAlpha((int)(mDrawingAlpha * mGlowAlpha * 255));
             mGlowBG.draw(canvas);
             canvas.restore();
             mRect.right = w;
             mRect.bottom = h;
-            canvas.saveLayerAlpha(mRect, (int)(mDrawingAlpha * 255), Canvas.ALL_SAVE_FLAG);
         }
         super.onDraw(canvas);
-        if (mGlowBG != null) {
-            canvas.restore();
-        }
     }
 
     public float getDrawingAlpha() {
@@ -127,8 +124,11 @@
 
     public void setDrawingAlpha(float x) {
         if (mGlowBG == null) return;
+        // Calling setAlpha(int), which is an ImageView-specific
+        // method that's different from setAlpha(float). This sets
+        // the alpha on this ImageView's drawable directly
+        setAlpha((int) (x * 255));
         mDrawingAlpha = x;
-        invalidate();
     }
 
     public float getGlowAlpha() {
@@ -174,7 +174,10 @@
     public void setPressed(boolean pressed) {
         if (mGlowBG != null) {
             if (pressed != isPressed()) {
-                AnimatorSet as = new AnimatorSet();
+                if (mPressedAnim != null && mPressedAnim.isRunning()) {
+                    mPressedAnim.cancel();
+                }
+                final AnimatorSet as = mPressedAnim = new AnimatorSet();
                 if (pressed) {
                     if (mGlowScale < GLOW_MAX_SCALE_FACTOR) 
                         mGlowScale = GLOW_MAX_SCALE_FACTOR;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
index 135a04c..d787e10 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
@@ -135,7 +135,9 @@
     ArrayList<ImageView> mWimaxIconViews = new ArrayList<ImageView>();
     ArrayList<ImageView> mCombinedSignalIconViews = new ArrayList<ImageView>();
     ArrayList<ImageView> mDataTypeIconViews = new ArrayList<ImageView>();
-    ArrayList<TextView> mLabelViews = new ArrayList<TextView>();
+    ArrayList<TextView> mCombinedLabelViews = new ArrayList<TextView>();
+    ArrayList<TextView> mMobileLabelViews = new ArrayList<TextView>();
+    ArrayList<TextView> mWifiLabelViews = new ArrayList<TextView>();
     ArrayList<SignalCluster> mSignalClusters = new ArrayList<SignalCluster>();
     int mLastPhoneSignalIconId = -1;
     int mLastDataDirectionIconId = -1;
@@ -144,7 +146,7 @@
     int mLastWimaxIconId = -1;
     int mLastCombinedSignalIconId = -1;
     int mLastDataTypeIconId = -1;
-    String mLastLabel = "";
+    String mLastCombinedLabel = "";
 
     private boolean mHasMobileDataFeature;
 
@@ -257,8 +259,16 @@
         mDataTypeIconViews.add(v);
     }
 
-    public void addLabelView(TextView v) {
-        mLabelViews.add(v);
+    public void addCombinedLabelView(TextView v) {
+        mCombinedLabelViews.add(v);
+    }
+
+    public void addMobileLabelView(TextView v) {
+        mMobileLabelViews.add(v);
+    }
+
+    public void addWifiLabelView(TextView v) {
+        mWifiLabelViews.add(v);
     }
 
     public void addSignalCluster(SignalCluster cluster) {
@@ -447,13 +457,13 @@
     private final void updateTelephonySignalStrength() {
         if (!hasService()) {
             if (CHATTY) Slog.d(TAG, "updateTelephonySignalStrength: !hasService()");
-            mPhoneSignalIconId = R.drawable.stat_sys_signal_0;
-            mDataSignalIconId = R.drawable.stat_sys_signal_0;
+            mPhoneSignalIconId = R.drawable.stat_sys_signal_null;
+            mDataSignalIconId = R.drawable.stat_sys_signal_null;
         } else {
             if (mSignalStrength == null) {
                 if (CHATTY) Slog.d(TAG, "updateTelephonySignalStrength: mSignalStrength == null");
-                mPhoneSignalIconId = R.drawable.stat_sys_signal_0;
-                mDataSignalIconId = R.drawable.stat_sys_signal_0;
+                mPhoneSignalIconId = R.drawable.stat_sys_signal_null;
+                mDataSignalIconId = R.drawable.stat_sys_signal_null;
                 mContentDescriptionPhoneSignal = mContext.getString(
                         AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0]);
             } else {
@@ -578,8 +588,12 @@
             }
         }
 
-        if ((isCdma() && isCdmaEri()) || mPhone.isNetworkRoaming()) {
-            mDataTypeIconId = R.drawable.stat_sys_data_connected_roam;
+        if (isCdma()) {
+            if (isCdmaEri()) {
+                mDataTypeIconId = R.drawable.stat_sys_data_connected_roam;
+            }
+        } else if (mPhone.isNetworkRoaming()) {
+                mDataTypeIconId = R.drawable.stat_sys_data_connected_roam;
         }
     }
 
@@ -840,8 +854,10 @@
             Slog.d(TAG, "updateConnectivity: intent=" + intent);
         }
 
-        NetworkInfo info = (NetworkInfo)(intent.getParcelableExtra(
-                ConnectivityManager.EXTRA_NETWORK_INFO));
+        final ConnectivityManager connManager = (ConnectivityManager) mContext
+                .getSystemService(Context.CONNECTIVITY_SERVICE);
+        final NetworkInfo info = connManager.getActiveNetworkInfo();
+
         int connectionStatus = intent.getIntExtra(ConnectivityManager.EXTRA_INET_CONDITION, 0);
 
         if (CHATTY) {
@@ -873,38 +889,69 @@
 
         int combinedSignalIconId = 0;
         int combinedActivityIconId = 0;
-        String label = "";
+        String combinedLabel = "";
+        String wifiLabel = "";
+        String mobileLabel = "";
         int N;
 
-        if (mDataConnected) {
-            label = mNetworkName;
-            combinedSignalIconId = mDataSignalIconId;
-            switch (mDataActivity) {
-                case TelephonyManager.DATA_ACTIVITY_IN:
-                    mMobileActivityIconId = R.drawable.stat_sys_signal_in;
-                    break;
-                case TelephonyManager.DATA_ACTIVITY_OUT:
-                    mMobileActivityIconId = R.drawable.stat_sys_signal_out;
-                    break;
-                case TelephonyManager.DATA_ACTIVITY_INOUT:
-                    mMobileActivityIconId = R.drawable.stat_sys_signal_inout;
-                    break;
-                default:
-                    mMobileActivityIconId = 0;
-                    break;
+        if (!mHasMobileDataFeature) {
+            mDataSignalIconId = mPhoneSignalIconId = 0;
+            mobileLabel = "";
+        } else {
+            // We want to show the carrier name if in service and either:
+            //   - We are connected to mobile data, or
+            //   - We are not connected to mobile data, as long as the *reason* packets are not
+            //     being routed over that link is that we have better connectivity via wifi.
+            // If data is disconnected for some other reason but wifi is connected, we show nothing.
+            // Otherwise (nothing connected) we show "No internet connection".
+
+            if (mDataConnected) {
+                mobileLabel = mNetworkName;
+            } else if (mWifiConnected) {
+                if (hasService()) {
+                    mobileLabel = mNetworkName;
+                } else {
+                    mobileLabel = "";
+                }
+            } else {
+                mobileLabel 
+                    = context.getString(R.string.status_bar_settings_signal_meter_disconnected);
             }
 
-            combinedActivityIconId = mMobileActivityIconId;
-            combinedSignalIconId = mDataSignalIconId; // set by updateDataIcon()
-            mContentDescriptionCombinedSignal = mContentDescriptionDataType;
+            // Now for things that should only be shown when actually using mobile data.
+            if (mDataConnected) {
+                combinedSignalIconId = mDataSignalIconId;
+                switch (mDataActivity) {
+                    case TelephonyManager.DATA_ACTIVITY_IN:
+                        mMobileActivityIconId = R.drawable.stat_sys_signal_in;
+                        break;
+                    case TelephonyManager.DATA_ACTIVITY_OUT:
+                        mMobileActivityIconId = R.drawable.stat_sys_signal_out;
+                        break;
+                    case TelephonyManager.DATA_ACTIVITY_INOUT:
+                        mMobileActivityIconId = R.drawable.stat_sys_signal_inout;
+                        break;
+                    default:
+                        mMobileActivityIconId = 0;
+                        break;
+                }
+
+                combinedLabel = mobileLabel;
+                combinedActivityIconId = mMobileActivityIconId;
+                combinedSignalIconId = mDataSignalIconId; // set by updateDataIcon()
+                mContentDescriptionCombinedSignal = mContentDescriptionDataType;
+            }
         }
 
         if (mWifiConnected) {
             if (mWifiSsid == null) {
-                label = context.getString(R.string.status_bar_settings_signal_meter_wifi_nossid);
+                wifiLabel = context.getString(R.string.status_bar_settings_signal_meter_wifi_nossid);
                 mWifiActivityIconId = 0; // no wifis, no bits
             } else {
-                label = mWifiSsid;
+                wifiLabel = mWifiSsid;
+                if (DEBUG) {
+                    wifiLabel += "xxxxXXXXxxxxXXXX";
+                }
                 switch (mWifiActivity) {
                     case WifiManager.DATA_ACTIVITY_IN:
                         mWifiActivityIconId = R.drawable.stat_sys_wifi_in;
@@ -922,12 +969,19 @@
             }
 
             combinedActivityIconId = mWifiActivityIconId;
+            combinedLabel = wifiLabel;
             combinedSignalIconId = mWifiIconId; // set by updateWifiIcons()
             mContentDescriptionCombinedSignal = mContentDescriptionWifi;
+        } else {
+            if (mHasMobileDataFeature) {
+                wifiLabel = "";
+            } else {
+                wifiLabel = context.getString(R.string.status_bar_settings_signal_meter_disconnected);
+            }
         }
 
         if (mBluetoothTethered) {
-            label = mContext.getString(R.string.bluetooth_tethered);
+            combinedLabel = mContext.getString(R.string.bluetooth_tethered);
             combinedSignalIconId = mBluetoothTetherIconId;
             mContentDescriptionCombinedSignal = mContext.getString(
                     R.string.accessibility_bluetooth_tether);
@@ -944,8 +998,17 @@
             mDataTypeIconId = 0;
 
             // combined values from connected wifi take precedence over airplane mode
-            if (!mWifiConnected) {
-                label = context.getString(R.string.status_bar_settings_signal_meter_disconnected);
+            if (mWifiConnected) {
+                // Suppress "No internet connection." from mobile if wifi connected.
+                mobileLabel = "";
+            } else {
+                if (mHasMobileDataFeature) {
+                    // let the mobile icon show "No internet connection."
+                    wifiLabel = "";
+                } else {
+                    wifiLabel = context.getString(R.string.status_bar_settings_signal_meter_disconnected);
+                    combinedLabel = wifiLabel;
+                }
                 mContentDescriptionCombinedSignal = mContentDescriptionPhoneSignal;
                 combinedSignalIconId = mDataSignalIconId;
             }
@@ -953,17 +1016,20 @@
         else if (!mDataConnected && !mWifiConnected && !mBluetoothTethered && !mWimaxConnected) {
             // pretty much totally disconnected
 
-            label = context.getString(R.string.status_bar_settings_signal_meter_disconnected);
+            combinedLabel = context.getString(R.string.status_bar_settings_signal_meter_disconnected);
             // On devices without mobile radios, we want to show the wifi icon
             combinedSignalIconId =
                 mHasMobileDataFeature ? mDataSignalIconId : mWifiIconId;
             mContentDescriptionCombinedSignal = mHasMobileDataFeature
                 ? mContentDescriptionDataType : mContentDescriptionWifi;
 
-            if ((isCdma() && isCdmaEri()) || mPhone.isNetworkRoaming()) {
+            mDataTypeIconId = 0;
+            if (isCdma()) {
+                if (isCdmaEri()) {
+                    mDataTypeIconId = R.drawable.stat_sys_data_connected_roam;
+                }
+            } else if (mPhone.isNetworkRoaming()) {
                 mDataTypeIconId = R.drawable.stat_sys_data_connected_roam;
-            } else {
-                mDataTypeIconId = 0;
             }
         }
 
@@ -1005,8 +1071,13 @@
             N = mPhoneSignalIconViews.size();
             for (int i=0; i<N; i++) {
                 final ImageView v = mPhoneSignalIconViews.get(i);
-                v.setImageResource(mPhoneSignalIconId);
-                v.setContentDescription(mContentDescriptionPhoneSignal);
+                if (mPhoneSignalIconId == 0) {
+                    v.setVisibility(View.GONE);
+                } else {
+                    v.setVisibility(View.VISIBLE);
+                    v.setImageResource(mPhoneSignalIconId);
+                    v.setContentDescription(mContentDescriptionPhoneSignal);
+                }
             }
         }
 
@@ -1028,7 +1099,7 @@
             for (int i=0; i<N; i++) {
                 final ImageView v = mWifiIconViews.get(i);
                 if (mWifiIconId == 0) {
-                    v.setVisibility(View.INVISIBLE);
+                    v.setVisibility(View.GONE);
                 } else {
                     v.setVisibility(View.VISIBLE);
                     v.setImageResource(mWifiIconId);
@@ -1044,7 +1115,7 @@
             for (int i=0; i<N; i++) {
                 final ImageView v = mWimaxIconViews.get(i);
                 if (mWimaxIconId == 0) {
-                    v.setVisibility(View.INVISIBLE);
+                    v.setVisibility(View.GONE);
                 } else {
                     v.setVisibility(View.VISIBLE);
                     v.setImageResource(mWimaxIconId);
@@ -1070,7 +1141,7 @@
             for (int i=0; i<N; i++) {
                 final ImageView v = mDataTypeIconViews.get(i);
                 if (mDataTypeIconId == 0) {
-                    v.setVisibility(View.INVISIBLE);
+                    v.setVisibility(View.GONE);
                 } else {
                     v.setVisibility(View.VISIBLE);
                     v.setImageResource(mDataTypeIconId);
@@ -1089,7 +1160,7 @@
             for (int i=0; i<N; i++) {
                 final ImageView v = mDataDirectionOverlayIconViews.get(i);
                 if (combinedActivityIconId == 0) {
-                    v.setVisibility(View.INVISIBLE);
+                    v.setVisibility(View.GONE);
                 } else {
                     v.setVisibility(View.VISIBLE);
                     v.setImageResource(combinedActivityIconId);
@@ -1098,13 +1169,37 @@
             }
         }
 
-        // the label in the notification panel
-        if (!mLastLabel.equals(label)) {
-            mLastLabel = label;
-            N = mLabelViews.size();
+        // the combinedLabel in the notification panel
+        if (!mLastCombinedLabel.equals(combinedLabel)) {
+            mLastCombinedLabel = combinedLabel;
+            N = mCombinedLabelViews.size();
             for (int i=0; i<N; i++) {
-                TextView v = mLabelViews.get(i);
-                v.setText(label);
+                TextView v = mCombinedLabelViews.get(i);
+                v.setText(combinedLabel);
+            }
+        }
+
+        // wifi label
+        N = mWifiLabelViews.size();
+        for (int i=0; i<N; i++) {
+            TextView v = mWifiLabelViews.get(i);
+            if ("".equals(wifiLabel)) {
+                v.setVisibility(View.GONE);
+            } else {
+                v.setVisibility(View.VISIBLE);
+                v.setText(wifiLabel);
+            }
+        }
+        
+        // mobile label
+        N = mMobileLabelViews.size();
+        for (int i=0; i<N; i++) {
+            TextView v = mMobileLabelViews.get(i);
+            if ("".equals(mobileLabel)) {
+                v.setVisibility(View.GONE);
+            } else {
+                v.setVisibility(View.VISIBLE);
+                v.setText(mobileLabel);
             }
         }
     }
@@ -1220,8 +1315,8 @@
         pw.print(Integer.toHexString(mLastDataTypeIconId));
         pw.print("/");
         pw.println(getResourceName(mLastDataTypeIconId));
-        pw.print("  mLastLabel=");
-        pw.print(mLastLabel);
+        pw.print("  mLastCombinedLabel=");
+        pw.print(mLastCombinedLabel);
         pw.println("");
     }
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
index 510fd3b..8e58649 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
@@ -316,8 +316,8 @@
 
     public void updatePanelModeButtons() {
         final boolean settingsVisible = (mSettingsView != null);
-        mSettingsButton.setVisibility(!settingsVisible ? View.VISIBLE : View.INVISIBLE);
-        mNotificationButton.setVisibility(settingsVisible ? View.VISIBLE : View.INVISIBLE);
+        mSettingsButton.setVisibility(!settingsVisible ? View.VISIBLE : View.GONE);
+        mNotificationButton.setVisibility(settingsVisible ? View.VISIBLE : View.GONE);
     }
 
     public boolean isInContentArea(int x, int y) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
index 9919d825..6287408 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -222,11 +222,6 @@
 
         // network icons: either a combo icon that switches between mobile and data, or distinct
         // mobile and data icons
-        final ImageView comboRSSI = 
-                (ImageView)mNotificationPanel.findViewById(R.id.network_signal);
-        if (comboRSSI != null) {
-            mNetworkController.addCombinedSignalIconView(comboRSSI);
-        }
         final ImageView mobileRSSI = 
                 (ImageView)mNotificationPanel.findViewById(R.id.mobile_signal);
         if (mobileRSSI != null) {
@@ -237,14 +232,14 @@
         if (wifiRSSI != null) {
             mNetworkController.addWifiIconView(wifiRSSI);
         }
+        mNetworkController.addWifiLabelView(
+                (TextView)mNotificationPanel.findViewById(R.id.wifi_text));
 
         mNetworkController.addDataTypeIconView(
-                (ImageView)mNotificationPanel.findViewById(R.id.network_type));
-        mNetworkController.addDataDirectionOverlayIconView(
-                (ImageView)mNotificationPanel.findViewById(R.id.network_direction));
-        mNetworkController.addLabelView(
-                (TextView)mNotificationPanel.findViewById(R.id.network_text));
-        mNetworkController.addLabelView(
+                (ImageView)mNotificationPanel.findViewById(R.id.mobile_type));
+        mNetworkController.addMobileLabelView(
+                (TextView)mNotificationPanel.findViewById(R.id.mobile_text));
+        mNetworkController.addCombinedLabelView(
                 (TextView)mBarContents.findViewById(R.id.network_text));
 
         mStatusBarView.setIgnoreChildren(0, mNotificationTrigger, mNotificationPanel);
diff --git a/packages/VpnDialogs/AndroidManifest.xml b/packages/VpnDialogs/AndroidManifest.xml
index 8e062b7..46c0f83 100644
--- a/packages/VpnDialogs/AndroidManifest.xml
+++ b/packages/VpnDialogs/AndroidManifest.xml
@@ -5,7 +5,7 @@
     <application android:label="VpnDialogs"
             android:allowBackup="false" >
         <activity android:name=".ConfirmDialog"
-                android:theme="@style/transparent">
+                android:theme="@*android:style/Theme.Holo.Dialog.Alert">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN"/>
                 <category android:name="android.intent.category.DEFAULT"/>
@@ -13,7 +13,7 @@
         </activity>
 
         <activity android:name=".ManageDialog"
-                android:theme="@style/transparent"
+                android:theme="@*android:style/Theme.Holo.Dialog.Alert"
                 android:noHistory="true">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN"/>
diff --git a/packages/VpnDialogs/res/values/styles.xml b/packages/VpnDialogs/res/values/styles.xml
index cf10596..e3469ec 100644
--- a/packages/VpnDialogs/res/values/styles.xml
+++ b/packages/VpnDialogs/res/values/styles.xml
@@ -15,13 +15,6 @@
 -->
 
 <resources>
-
-    <style name="transparent">
-        <item name="android:windowBackground">@android:color/transparent</item>
-        <item name="android:windowNoTitle">true</item>
-        <item name="android:windowIsFloating">true</item>
-    </style>
-
     <style name="label">
         <item name="android:gravity">center_vertical|right</item>
         <item name="android:paddingRight">2mm</item>
diff --git a/packages/VpnDialogs/src/com/android/vpndialogs/ConfirmDialog.java b/packages/VpnDialogs/src/com/android/vpndialogs/ConfirmDialog.java
index c7b4a5f..13d8019 100644
--- a/packages/VpnDialogs/src/com/android/vpndialogs/ConfirmDialog.java
+++ b/packages/VpnDialogs/src/com/android/vpndialogs/ConfirmDialog.java
@@ -16,8 +16,6 @@
 
 package com.android.vpndialogs;
 
-import android.app.Activity;
-import android.app.AlertDialog;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
@@ -32,15 +30,16 @@
 import android.widget.ImageView;
 import android.widget.TextView;
 
-public class ConfirmDialog extends Activity implements CompoundButton.OnCheckedChangeListener,
-        DialogInterface.OnClickListener, DialogInterface.OnDismissListener {
+import com.android.internal.app.AlertActivity;
+
+public class ConfirmDialog extends AlertActivity implements
+        CompoundButton.OnCheckedChangeListener, DialogInterface.OnClickListener {
     private static final String TAG = "VpnConfirm";
 
     private String mPackage;
 
     private IConnectivityManager mService;
 
-    private AlertDialog mDialog;
     private Button mButton;
 
     @Override
@@ -67,18 +66,17 @@
                     getString(R.string.prompt, app.loadLabel(pm)));
             ((CompoundButton) view.findViewById(R.id.check)).setOnCheckedChangeListener(this);
 
-            mDialog = new AlertDialog.Builder(this)
-                    .setIcon(android.R.drawable.ic_dialog_alert)
-                    .setTitle(android.R.string.dialog_alert_title)
-                    .setView(view)
-                    .setPositiveButton(android.R.string.ok, this)
-                    .setNegativeButton(android.R.string.cancel, this)
-                    .setCancelable(false)
-                    .create();
-            mDialog.setOnDismissListener(this);
-            mDialog.show();
+            mAlertParams.mIconId = android.R.drawable.ic_dialog_alert;
+            mAlertParams.mTitle = getText(android.R.string.dialog_alert_title);
+            mAlertParams.mPositiveButtonText = getText(android.R.string.ok);
+            mAlertParams.mPositiveButtonListener = this;
+            mAlertParams.mNegativeButtonText = getText(android.R.string.cancel);
+            mAlertParams.mNegativeButtonListener = this;
+            mAlertParams.mView = view;
+            setupAlert();
 
-            mButton = mDialog.getButton(DialogInterface.BUTTON_POSITIVE);
+            getWindow().setCloseOnTouchOutside(false);
+            mButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE);
             mButton.setEnabled(false);
         } catch (Exception e) {
             Log.e(TAG, "onResume", e);
@@ -87,12 +85,7 @@
     }
 
     @Override
-    protected void onPause() {
-        super.onPause();
-        if (mDialog != null) {
-            mDialog.setOnDismissListener(null);
-            mDialog.dismiss();
-        }
+    public void onBackPressed() {
     }
 
     @Override
@@ -103,16 +96,11 @@
     @Override
     public void onClick(DialogInterface dialog, int which) {
         try {
-            if (which == AlertDialog.BUTTON_POSITIVE && mService.prepareVpn(null, mPackage)) {
+            if (which == DialogInterface.BUTTON_POSITIVE && mService.prepareVpn(null, mPackage)) {
                 setResult(RESULT_OK);
             }
         } catch (Exception e) {
             Log.e(TAG, "onClick", e);
         }
     }
-
-    @Override
-    public void onDismiss(DialogInterface dialog) {
-        finish();
-    }
 }
diff --git a/packages/VpnDialogs/src/com/android/vpndialogs/ManageDialog.java b/packages/VpnDialogs/src/com/android/vpndialogs/ManageDialog.java
index 7fb1417..2de0251 100644
--- a/packages/VpnDialogs/src/com/android/vpndialogs/ManageDialog.java
+++ b/packages/VpnDialogs/src/com/android/vpndialogs/ManageDialog.java
@@ -16,8 +16,6 @@
 
 package com.android.vpndialogs;
 
-import android.app.Activity;
-import android.app.AlertDialog;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
@@ -35,20 +33,20 @@
 import android.widget.ImageView;
 import android.widget.TextView;
 
+import com.android.internal.app.AlertActivity;
 import com.android.internal.net.VpnConfig;
 
 import java.io.DataInputStream;
 import java.io.FileInputStream;
 
-public class ManageDialog extends Activity implements Handler.Callback,
-        DialogInterface.OnClickListener, DialogInterface.OnDismissListener {
+public class ManageDialog extends AlertActivity implements
+        DialogInterface.OnClickListener, Handler.Callback {
     private static final String TAG = "VpnManage";
 
     private VpnConfig mConfig;
 
     private IConnectivityManager mService;
 
-    private AlertDialog mDialog;
     private TextView mDuration;
     private TextView mDataTransmitted;
     private TextView mDataReceived;
@@ -80,31 +78,24 @@
             mDataReceived = (TextView) view.findViewById(R.id.data_received);
 
             if (mConfig.user.equals(VpnConfig.LEGACY_VPN)) {
-                mDialog = new AlertDialog.Builder(this)
-                        .setIcon(android.R.drawable.ic_dialog_info)
-                        .setTitle(R.string.legacy_title)
-                        .setView(view)
-                        .setNeutralButton(R.string.disconnect, this)
-                        .setNegativeButton(android.R.string.cancel, this)
-                        .create();
+                mAlertParams.mIconId = android.R.drawable.ic_dialog_info;
+                mAlertParams.mTitle = getText(R.string.legacy_title);
             } else {
                 PackageManager pm = getPackageManager();
                 ApplicationInfo app = pm.getApplicationInfo(mConfig.user, 0);
-                mDialog = new AlertDialog.Builder(this)
-                        .setIcon(app.loadIcon(pm))
-                        .setTitle(app.loadLabel(pm))
-                        .setView(view)
-                        .setNeutralButton(R.string.disconnect, this)
-                        .setNegativeButton(android.R.string.cancel, this)
-                        .create();
+                mAlertParams.mIcon = app.loadIcon(pm);
+                mAlertParams.mTitle = app.loadLabel(pm);
             }
-
             if (mConfig.configureIntent != null) {
-                mDialog.setButton(DialogInterface.BUTTON_POSITIVE,
-                        getText(R.string.configure), this);
+                mAlertParams.mPositiveButtonText = getText(R.string.configure);
+                mAlertParams.mPositiveButtonListener = this;
             }
-            mDialog.setOnDismissListener(this);
-            mDialog.show();
+            mAlertParams.mNeutralButtonText = getText(R.string.disconnect);
+            mAlertParams.mNeutralButtonListener = this;
+            mAlertParams.mNegativeButtonText = getText(android.R.string.cancel);
+            mAlertParams.mNegativeButtonListener = this;
+            mAlertParams.mView = view;
+            setupAlert();
 
             if (mHandler == null) {
                 mHandler = new Handler(this);
@@ -119,18 +110,17 @@
     @Override
     protected void onPause() {
         super.onPause();
-        if (mDialog != null) {
-            mDialog.setOnDismissListener(null);
-            mDialog.dismiss();
+        if (!isFinishing()) {
+            finish();
         }
     }
 
     @Override
     public void onClick(DialogInterface dialog, int which) {
         try {
-            if (which == AlertDialog.BUTTON_POSITIVE) {
+            if (which == DialogInterface.BUTTON_POSITIVE) {
                 mConfig.configureIntent.send();
-            } else if (which == AlertDialog.BUTTON_NEUTRAL) {
+            } else if (which == DialogInterface.BUTTON_NEUTRAL) {
                 mService.prepareVpn(mConfig.user, VpnConfig.LEGACY_VPN);
             }
         } catch (Exception e) {
@@ -140,15 +130,10 @@
     }
 
     @Override
-    public void onDismiss(DialogInterface dialog) {
-        finish();
-    }
-
-    @Override
     public boolean handleMessage(Message message) {
         mHandler.removeMessages(0);
 
-        if (mDialog.isShowing()) {
+        if (!isFinishing()) {
             if (mConfig.startTime != 0) {
                 long seconds = (SystemClock.elapsedRealtime() - mConfig.startTime) / 1000;
                 mDuration.setText(String.format("%02d:%02d:%02d",
diff --git a/policy/src/com/android/internal/policy/impl/GlobalActions.java b/policy/src/com/android/internal/policy/impl/GlobalActions.java
index 38c85bb..bcba3c2 100644
--- a/policy/src/com/android/internal/policy/impl/GlobalActions.java
+++ b/policy/src/com/android/internal/policy/impl/GlobalActions.java
@@ -16,16 +16,23 @@
 
 package com.android.internal.policy.impl;
 
-import android.app.Activity;
+import com.android.internal.app.ShutdownThread;
+import com.android.internal.telephony.TelephonyIntents;
+import com.android.internal.telephony.TelephonyProperties;
+import com.android.internal.R;
+
+import android.app.ActivityManagerNative;
 import android.app.AlertDialog;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.IntentFilter;
+import android.content.pm.UserInfo;
 import android.media.AudioManager;
 import android.os.Handler;
 import android.os.Message;
+import android.os.RemoteException;
 import android.os.SystemProperties;
 import android.provider.Settings;
 import android.telephony.PhoneStateListener;
@@ -39,13 +46,9 @@
 import android.widget.BaseAdapter;
 import android.widget.ImageView;
 import android.widget.TextView;
-import com.android.internal.R;
-import com.android.internal.app.ShutdownThread;
-import com.android.internal.telephony.TelephonyIntents;
-import com.android.internal.telephony.TelephonyProperties;
-import com.google.android.collect.Lists;
 
 import java.util.ArrayList;
+import java.util.List;
 
 /**
  * Helper to show the global actions dialog.  Each item is an {@link Action} that
@@ -101,9 +104,10 @@
     public void showDialog(boolean keyguardShowing, boolean isDeviceProvisioned) {
         mKeyguardShowing = keyguardShowing;
         mDeviceProvisioned = isDeviceProvisioned;
-        if (mDialog == null) {
-            mDialog = createDialog();
+        if (mDialog != null) {
+            mDialog.dismiss();
         }
+        mDialog = createDialog();
         prepareDialog();
 
         mDialog.show();
@@ -187,6 +191,31 @@
             mItems.add(mSilentModeAction);
         }
 
+        List<UserInfo> users = mContext.getPackageManager().getUsers();
+        if (users.size() > 1) {
+            for (final UserInfo user : users) {
+                SinglePressAction switchToUser = new SinglePressAction(
+                        com.android.internal.R.drawable.ic_menu_cc,
+                        user.name != null ? user.name : "Primary") {
+                    public void onPress() {
+                        try {
+                            ActivityManagerNative.getDefault().switchUser(user.id);
+                        } catch (RemoteException re) {
+                            Log.e(TAG, "Couldn't switch user " + re);
+                        }
+                    }
+
+                    public boolean showDuringKeyguard() {
+                        return true;
+                    }
+
+                    public boolean showBeforeProvisioning() {
+                        return false;
+                    }
+                };
+                mItems.add(switchToUser);
+            }
+        }
         mAdapter = new MyAdapter();
 
         final AlertDialog.Builder ab = new AlertDialog.Builder(mContext);
@@ -341,12 +370,19 @@
     private static abstract class SinglePressAction implements Action {
         private final int mIconResId;
         private final int mMessageResId;
+        private final CharSequence mMessage;
 
         protected SinglePressAction(int iconResId, int messageResId) {
             mIconResId = iconResId;
             mMessageResId = messageResId;
+            mMessage = null;
         }
 
+        protected SinglePressAction(int iconResId, CharSequence message) {
+            mIconResId = iconResId;
+            mMessageResId = 0;
+            mMessage = message;
+        }
         public boolean isEnabled() {
             return true;
         }
@@ -363,7 +399,11 @@
             v.findViewById(R.id.status).setVisibility(View.GONE);
 
             icon.setImageDrawable(context.getResources().getDrawable(mIconResId));
-            messageView.setText(mMessageResId);
+            if (mMessage != null) {
+                messageView.setText(mMessage);
+            } else {
+                messageView.setText(mMessageResId);
+            }
 
             return v;
         }
diff --git a/policy/src/com/android/internal/policy/impl/KeyguardStatusViewManager.java b/policy/src/com/android/internal/policy/impl/KeyguardStatusViewManager.java
index f45556f..9f3de69 100644
--- a/policy/src/com/android/internal/policy/impl/KeyguardStatusViewManager.java
+++ b/policy/src/com/android/internal/policy/impl/KeyguardStatusViewManager.java
@@ -19,6 +19,7 @@
 import com.android.internal.R;
 import com.android.internal.telephony.IccCard;
 import com.android.internal.telephony.IccCard.State;
+import com.android.internal.widget.DigitalClock;
 import com.android.internal.widget.LockPatternUtils;
 import com.android.internal.widget.TransportControlView;
 import com.android.internal.policy.impl.KeyguardUpdateMonitor.SimStateCallback;
@@ -105,6 +106,7 @@
     private CharSequence mPlmn;
     private CharSequence mSpn;
     protected int mPhoneState;
+    private DigitalClock mDigitalClock;
 
     private class TransientTextManager {
         private TextView mTextView;
@@ -181,6 +183,7 @@
         mTransportView = (TransportControlView) findViewById(R.id.transport);
         mEmergencyCallButton = (Button) findViewById(R.id.emergencyCallButton);
         mEmergencyCallButtonEnabledInScreen = emergencyButtonEnabledInScreen;
+        mDigitalClock = (DigitalClock) findViewById(R.id.time);
 
         // Hide transport control view until we know we need to show it.
         if (mTransportView != null) {
@@ -290,6 +293,12 @@
     /** {@inheritDoc} */
     public void onResume() {
         if (DEBUG) Log.v(TAG, "onResume()");
+
+        // First update the clock, if present.
+        if (mDigitalClock != null) {
+            mDigitalClock.updateTime();
+        }
+
         mUpdateMonitor.registerInfoCallback(mInfoCallback);
         mUpdateMonitor.registerSimStateCallback(mSimStateCallback);
         resetStatusInfo();
diff --git a/policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java b/policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java
index 1d6f39a..91ab053 100644
--- a/policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java
+++ b/policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java
@@ -585,8 +585,7 @@
      * through mHandler, this *must* be called from the UI thread.
      */
     public void reportSimUnlocked() {
-        mSimState = IccCard.State.READY;
-        handleSimStateChange(new SimArgs(mSimState));
+        handleSimStateChange(new SimArgs(IccCard.State.READY));
     }
 
     public boolean isKeyguardBypassEnabled() {
diff --git a/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java b/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
index b514689..52d6d24 100644
--- a/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
+++ b/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
@@ -350,6 +350,12 @@
             mScreenOn = false;
             if (DEBUG) Log.d(TAG, "onScreenTurnedOff(" + why + ")");
 
+            // Lock immediately based on setting if secure (user has a pin/pattern/password).
+            // This also "locks" the device when not secure to provide easy access to the
+            // camera while preventing unwanted input.
+            final boolean lockImmediately =
+                mLockPatternUtils.getPowerButtonInstantlyLocks() || !mLockPatternUtils.isSecure();
+
             if (mExitSecureCallback != null) {
                 if (DEBUG) Log.d(TAG, "pending exit secure callback cancelled");
                 mExitSecureCallback.onKeyguardExitResult(false);
@@ -360,8 +366,10 @@
             } else if (mShowing) {
                 notifyScreenOffLocked();
                 resetStateLocked();
-            } else if (why == WindowManagerPolicy.OFF_BECAUSE_OF_TIMEOUT) {
-                // if the screen turned off because of timeout, set an alarm
+            } else if (why == WindowManagerPolicy.OFF_BECAUSE_OF_TIMEOUT
+                   || (why == WindowManagerPolicy.OFF_BECAUSE_OF_USER && !lockImmediately)) {
+                // if the screen turned off because of timeout or the user hit the power button
+                // and we don't need to lock immediately, set an alarm
                 // to enable it a little bit later (i.e, give the user a chance
                 // to turn the screen back on within a certain window without
                 // having to unlock the screen)
@@ -400,8 +408,7 @@
                     intent.putExtra("seq", mDelayedShowingSequence);
                     PendingIntent sender = PendingIntent.getBroadcast(mContext,
                             0, intent, PendingIntent.FLAG_CANCEL_CURRENT);
-                    mAlarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, when,
-                            sender);
+                    mAlarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, when, sender);
                     if (DEBUG) Log.d(TAG, "setting alarm to turn off keyguard, seq = "
                                      + mDelayedShowingSequence);
                 }
diff --git a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
index 0d0461b..1e9784c 100644
--- a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
+++ b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
@@ -855,6 +855,9 @@
             case Password:
                 secure = mLockPatternUtils.isLockPasswordEnabled();
                 break;
+            case Unknown:
+                // This means no security is set up
+                break;
             default:
                 throw new IllegalStateException("unknown unlock mode " + unlockMode);
         }
@@ -877,8 +880,8 @@
 
         // Re-create the unlock screen if necessary. This is primarily required to properly handle
         // SIM state changes. This typically happens when this method is called by reset()
-        if (mode == Mode.UnlockScreen) {
-            final UnlockMode unlockMode = getUnlockMode();
+        final UnlockMode unlockMode = getUnlockMode();
+        if (mode == Mode.UnlockScreen && unlockMode != UnlockMode.Unknown) {
             if (force || mUnlockScreen == null || unlockMode != mUnlockScreenMode) {
                 boolean restartFaceLock = stopFaceLockIfRunning();
                 recreateUnlockScreen(unlockMode);
@@ -1052,11 +1055,15 @@
                     break;
                 case DevicePolicyManager.PASSWORD_QUALITY_SOMETHING:
                 case DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED:
-                    // "forgot pattern" button is only available in the pattern mode...
-                    if (mForgotPattern || mLockPatternUtils.isPermanentlyLocked()) {
-                        currentMode = UnlockMode.Account;
+                    if (mLockPatternUtils.isLockPatternEnabled()) {
+                        // "forgot pattern" button is only available in the pattern mode...
+                        if (mForgotPattern || mLockPatternUtils.isPermanentlyLocked()) {
+                            currentMode = UnlockMode.Account;
+                        } else {
+                            currentMode = UnlockMode.Pattern;
+                        }
                     } else {
-                        currentMode = UnlockMode.Pattern;
+                        currentMode = UnlockMode.Unknown;
                     }
                     break;
                 default:
diff --git a/policy/src/com/android/internal/policy/impl/LockScreen.java b/policy/src/com/android/internal/policy/impl/LockScreen.java
index 24a2420..3384661 100644
--- a/policy/src/com/android/internal/policy/impl/LockScreen.java
+++ b/policy/src/com/android/internal/policy/impl/LockScreen.java
@@ -23,6 +23,8 @@
 import com.android.internal.widget.multiwaveview.MultiWaveView;
 
 import android.app.ActivityManager;
+import android.app.ActivityManagerNative;
+import android.content.ActivityNotFoundException;
 import android.content.Context;
 import android.content.Intent;
 import android.content.res.Configuration;
@@ -34,6 +36,7 @@
 import android.widget.*;
 import android.util.Log;
 import android.media.AudioManager;
+import android.os.RemoteException;
 import android.provider.MediaStore;
 import android.provider.Settings;
 
@@ -229,8 +232,16 @@
                     // Start the Camera
                     Intent intent = new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
                     intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-                    mContext.startActivity(intent);
-                    mCallback.goToUnlockScreen();
+                    try {
+                        ActivityManagerNative.getDefault().dismissKeyguardOnNextActivity();
+                    } catch (RemoteException e) {
+                        Log.w(TAG, "can't dismiss keyguard on launch");
+                    }
+                    try {
+                        mContext.startActivity(intent);
+                    } catch (ActivityNotFoundException e) {
+                        Log.w(TAG, "Camera application not found");
+                    }
                 } else {
                     toggleRingMode();
                     mUnlockWidgetMethods.updateResources();
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 468f0d5..d34ed177 100755
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -2044,6 +2044,12 @@
                         mTmpNavigationFrame.offset(mNavigationBarWidth, 0);
                     }
                 }
+                // Make sure the content and current rectangles are updated to
+                // account for the restrictions from the navigation bar.
+                mContentTop = mCurTop = mDockTop;
+                mContentBottom = mCurBottom = mDockBottom;
+                mContentLeft = mCurLeft = mDockLeft;
+                mContentRight = mCurRight = mDockRight;
                 // And compute the final frame.
                 mNavigationBar.computeFrameLw(mTmpNavigationFrame, mTmpNavigationFrame,
                         mTmpNavigationFrame, mTmpNavigationFrame);
@@ -2383,8 +2389,9 @@
     }
 
     /** {@inheritDoc} */
-    public int finishLayoutLw() {
-        return 0;
+    @Override
+    public void finishLayoutLw() {
+        return;
     }
 
     /** {@inheritDoc} */
@@ -2403,7 +2410,7 @@
         if (DEBUG_LAYOUT) Slog.i(TAG, "Win " + win + ": isVisibleOrBehindKeyguardLw="
                 + win.isVisibleOrBehindKeyguardLw());
         if (mTopFullscreenOpaqueWindowState == null &&
-                win.isVisibleOrBehindKeyguardLw()) {
+                win.isVisibleOrBehindKeyguardLw() && !win.isGoneForLayoutLw()) {
             if ((attrs.flags & FLAG_FORCE_NOT_FULLSCREEN) != 0) {
                 mForceStatusBar = true;
             }
@@ -2458,7 +2465,7 @@
                 // case though.
                 if (topIsFullscreen) {
                     if (mStatusBarCanHide) {
-                        if (DEBUG_LAYOUT) Log.v(TAG, "Hiding status bar");
+                        if (DEBUG_LAYOUT) Log.v(TAG, "** HIDING status bar");
                         if (mStatusBar.hideLw(true)) {
                             changes |= FINISH_LAYOUT_REDO_LAYOUT;
 
@@ -2474,7 +2481,7 @@
                         Log.v(TAG, "Preventing status bar from hiding by policy");
                     }
                 } else {
-                    if (DEBUG_LAYOUT) Log.v(TAG, "Showing status bar: top is not fullscreen");
+                    if (DEBUG_LAYOUT) Log.v(TAG, "** SHOWING status bar: top is not fullscreen");
                     if (mStatusBar.showLw(true)) changes |= FINISH_LAYOUT_REDO_LAYOUT;
                 }
             }
@@ -3456,7 +3463,6 @@
     public void systemReady() {
         // tell the keyguard
         mKeyguardMediator.onSystemReady();
-        android.os.SystemProperties.set("dev.bootcomplete", "1"); 
         synchronized (mLock) {
             updateOrientationListenerLp();
             mSystemReady = true;
@@ -3648,6 +3654,12 @@
         }
     };
 
+    public void lockNow() {
+        mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DEVICE_POWER, null);
+        mHandler.removeCallbacks(mScreenLockTimeout);
+        mHandler.post(mScreenLockTimeout);
+    }
+
     private void updateLockScreenTimeout() {
         synchronized (mScreenLockTimeout) {
             boolean enable = (mAllowLockscreenWhenOn && mScreenOnEarly && mKeyguardMediator.isSecure());
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 72525cd..3cd094b 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -37,8 +37,6 @@
 #include <cutils/properties.h>
 #include <cutils/compiler.h>
 
-#include <media/AudioTrack.h>
-#include <media/AudioRecord.h>
 #include <media/IMediaPlayerService.h>
 #include <media/IMediaDeathNotifier.h>
 
@@ -72,7 +70,7 @@
 
 //static const nsecs_t kStandbyTimeInNsecs = seconds(3);
 static const float MAX_GAIN = 4096.0f;
-static const float MAX_GAIN_INT = 0x1000;
+static const uint32_t MAX_GAIN_INT = 0x1000;
 
 // retry counts for buffer fill timeout
 // 50 * ~20msecs = 1 second
@@ -162,7 +160,10 @@
 
 AudioFlinger::AudioFlinger()
     : BnAudioFlinger(),
-        mPrimaryHardwareDev(NULL), mMasterVolume(1.0f), mMasterMute(false), mNextUniqueId(1),
+        mPrimaryHardwareDev(NULL),
+        mHardwareStatus(AUDIO_HW_IDLE), // see also onFirstRef()
+        mMasterVolume(1.0f), mMasterMute(false), mNextUniqueId(1),
+        mMode(AUDIO_MODE_INVALID),
         mBtNrecIsOff(false)
 {
 }
@@ -174,7 +175,6 @@
     Mutex::Autolock _l(mLock);
 
     /* TODO: move all this work into an Init() function */
-    mHardwareStatus = AUDIO_HW_IDLE;
 
     for (size_t i = 0; i < ARRAY_SIZE(audio_interfaces); i++) {
         const hw_module_t *mod;
@@ -267,13 +267,10 @@
 
     result.append("Clients:\n");
     for (size_t i = 0; i < mClients.size(); ++i) {
-        wp<Client> wClient = mClients.valueAt(i);
-        if (wClient != 0) {
-            sp<Client> client = wClient.promote();
-            if (client != 0) {
-                snprintf(buffer, SIZE, "  pid: %d\n", client->pid());
-                result.append(buffer);
-            }
+        sp<Client> client = mClients.valueAt(i).promote();
+        if (client != 0) {
+            snprintf(buffer, SIZE, "  pid: %d\n", client->pid());
+            result.append(buffer);
         }
     }
 
@@ -294,7 +291,7 @@
     const size_t SIZE = 256;
     char buffer[SIZE];
     String8 result;
-    int hardwareStatus = mHardwareStatus;
+    hardware_call_state hardwareStatus = mHardwareStatus;
 
     snprintf(buffer, SIZE, "Hardware status: %d\n", hardwareStatus);
     result.append(buffer);
@@ -331,7 +328,7 @@
 
 status_t AudioFlinger::dump(int fd, const Vector<String16>& args)
 {
-    if (checkCallingPermission(String16("android.permission.DUMP")) == false) {
+    if (!checkCallingPermission(String16("android.permission.DUMP"))) {
         dumpPermissionDenial(fd, args);
     } else {
         // get state of hardware lock
@@ -380,9 +377,9 @@
 
 sp<IAudioTrack> AudioFlinger::createTrack(
         pid_t pid,
-        int streamType,
+        audio_stream_type_t streamType,
         uint32_t sampleRate,
-        uint32_t format,
+        audio_format_t format,
         uint32_t channelMask,
         int frameCount,
         uint32_t flags,
@@ -398,7 +395,9 @@
     status_t lStatus;
     int lSessionId;
 
-    if (streamType >= AUDIO_STREAM_CNT) {
+    // client AudioTrack::set already implements AUDIO_STREAM_DEFAULT => AUDIO_STREAM_MUSIC,
+    // but if someone uses binder directly they could bypass that and cause us to crash
+    if (uint32_t(streamType) >= AUDIO_STREAM_CNT) {
         ALOGE("createTrack() invalid stream type %d", streamType);
         lStatus = BAD_VALUE;
         goto Exit;
@@ -500,13 +499,13 @@
     return thread->channelCount();
 }
 
-uint32_t AudioFlinger::format(int output) const
+audio_format_t AudioFlinger::format(int output) const
 {
     Mutex::Autolock _l(mLock);
     PlaybackThread *thread = checkPlaybackThread_l(output);
     if (thread == NULL) {
         ALOGW("format() unknown thread %d", output);
-        return 0;
+        return AUDIO_FORMAT_INVALID;
     }
     return thread->format();
 }
@@ -563,7 +562,7 @@
     return NO_ERROR;
 }
 
-status_t AudioFlinger::setMode(int mode)
+status_t AudioFlinger::setMode(audio_mode_t mode)
 {
     status_t ret = initCheck();
     if (ret != NO_ERROR) {
@@ -574,7 +573,7 @@
     if (!settingsAllowed()) {
         return PERMISSION_DENIED;
     }
-    if ((mode < 0) || (mode >= AUDIO_MODE_CNT)) {
+    if (uint32_t(mode) >= AUDIO_MODE_CNT) {
         ALOGW("Illegal value: setMode(%d)", mode);
         return BAD_VALUE;
     }
@@ -646,22 +645,24 @@
 
 float AudioFlinger::masterVolume() const
 {
-    return mMasterVolume;
+    Mutex::Autolock _l(mLock);
+    return masterVolume_l();
 }
 
 bool AudioFlinger::masterMute() const
 {
-    return mMasterMute;
+    Mutex::Autolock _l(mLock);
+    return masterMute_l();
 }
 
-status_t AudioFlinger::setStreamVolume(int stream, float value, int output)
+status_t AudioFlinger::setStreamVolume(audio_stream_type_t stream, float value, int output)
 {
     // check calling permissions
     if (!settingsAllowed()) {
         return PERMISSION_DENIED;
     }
 
-    if (stream < 0 || uint32_t(stream) >= AUDIO_STREAM_CNT) {
+    if (uint32_t(stream) >= AUDIO_STREAM_CNT) {
         ALOGE("setStreamVolume() invalid stream %d", stream);
         return BAD_VALUE;
     }
@@ -688,14 +689,14 @@
     return NO_ERROR;
 }
 
-status_t AudioFlinger::setStreamMute(int stream, bool muted)
+status_t AudioFlinger::setStreamMute(audio_stream_type_t stream, bool muted)
 {
     // check calling permissions
     if (!settingsAllowed()) {
         return PERMISSION_DENIED;
     }
 
-    if (stream < 0 || uint32_t(stream) >= AUDIO_STREAM_CNT ||
+    if (uint32_t(stream) >= AUDIO_STREAM_CNT ||
         uint32_t(stream) == AUDIO_STREAM_ENFORCED_AUDIBLE) {
         ALOGE("setStreamMute() invalid stream %d", stream);
         return BAD_VALUE;
@@ -709,9 +710,9 @@
     return NO_ERROR;
 }
 
-float AudioFlinger::streamVolume(int stream, int output) const
+float AudioFlinger::streamVolume(audio_stream_type_t stream, int output) const
 {
-    if (stream < 0 || uint32_t(stream) >= AUDIO_STREAM_CNT) {
+    if (uint32_t(stream) >= AUDIO_STREAM_CNT) {
         return 0.0f;
     }
 
@@ -730,9 +731,9 @@
     return volume;
 }
 
-bool AudioFlinger::streamMute(int stream) const
+bool AudioFlinger::streamMute(audio_stream_type_t stream) const
 {
-    if (stream < 0 || stream >= (int)AUDIO_STREAM_CNT) {
+    if (uint32_t(stream) >= AUDIO_STREAM_CNT) {
         return true;
     }
 
@@ -797,7 +798,7 @@
         thread = checkPlaybackThread_l(ioHandle);
         if (thread == NULL) {
             thread = checkRecordThread_l(ioHandle);
-        } else if (thread.get() == primaryPlaybackThread_l()) {
+        } else if (thread == primaryPlaybackThread_l()) {
             // indicate output device change to all input threads for pre processing
             AudioParameter param = AudioParameter(keyValuePairs);
             int value;
@@ -808,14 +809,13 @@
             }
         }
     }
-    if (thread != NULL) {
-        result = thread->setParameters(keyValuePairs);
-        return result;
+    if (thread != 0) {
+        return thread->setParameters(keyValuePairs);
     }
     return BAD_VALUE;
 }
 
-String8 AudioFlinger::getParameters(int ioHandle, const String8& keys)
+String8 AudioFlinger::getParameters(int ioHandle, const String8& keys) const
 {
 //    ALOGV("getParameters() io %d, keys %s, tid %d, calling tid %d",
 //            ioHandle, keys.string(), gettid(), IPCThreadState::self()->getCallingPid());
@@ -845,7 +845,7 @@
     return String8("");
 }
 
-size_t AudioFlinger::getInputBufferSize(uint32_t sampleRate, int format, int channelCount)
+size_t AudioFlinger::getInputBufferSize(uint32_t sampleRate, audio_format_t format, int channelCount) const
 {
     status_t ret = initCheck();
     if (ret != NO_ERROR) {
@@ -855,7 +855,7 @@
     return mPrimaryHardwareDev->get_input_buffer_size(mPrimaryHardwareDev, sampleRate, format, channelCount);
 }
 
-unsigned int AudioFlinger::getInputFramesLost(int ioHandle)
+unsigned int AudioFlinger::getInputFramesLost(int ioHandle) const
 {
     if (ioHandle == 0) {
         return 0;
@@ -890,7 +890,7 @@
     return ret;
 }
 
-status_t AudioFlinger::getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, int output)
+status_t AudioFlinger::getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, int output) const
 {
     status_t status;
 
@@ -909,7 +909,7 @@
 
     Mutex::Autolock _l(mLock);
 
-    int pid = IPCThreadState::self()->getCallingPid();
+    pid_t pid = IPCThreadState::self()->getCallingPid();
     if (mNotificationClients.indexOfKey(pid) < 0) {
         sp<NotificationClient> notificationClient = new NotificationClient(this,
                                                                             client,
@@ -969,7 +969,8 @@
 {
     size_t size = mNotificationClients.size();
     for (size_t i = 0; i < size; i++) {
-        mNotificationClients.valueAt(i)->client()->ioConfigChanged(event, ioHandle, param2);
+        mNotificationClients.valueAt(i)->audioFlingerClient()->ioConfigChanged(event, ioHandle,
+                                                                               param2);
     }
 }
 
@@ -983,13 +984,19 @@
 
 // ----------------------------------------------------------------------------
 
-AudioFlinger::ThreadBase::ThreadBase(const sp<AudioFlinger>& audioFlinger, int id, uint32_t device)
+AudioFlinger::ThreadBase::ThreadBase(const sp<AudioFlinger>& audioFlinger, int id, uint32_t device,
+        type_t type)
     :   Thread(false),
-        mAudioFlinger(audioFlinger), mSampleRate(0), mFrameCount(0), mChannelCount(0),
-        mFrameSize(1), mFormat(0), mStandby(false), mId(id), mExiting(false),
-        mDevice(device)
+        mType(type),
+        mAudioFlinger(audioFlinger), mSampleRate(0), mFrameCount(0),
+        // mChannelMask
+        mChannelCount(0),
+        mFrameSize(1), mFormat(AUDIO_FORMAT_INVALID),
+        mParamStatus(NO_ERROR),
+        mStandby(false), mId(id), mExiting(false),
+        mDevice(device),
+        mDeathRecipient(new PMDeathRecipient(this))
 {
-    mDeathRecipient = new PMDeathRecipient(this);
 }
 
 AudioFlinger::ThreadBase::~ThreadBase()
@@ -1011,7 +1018,7 @@
 
     ALOGV("ThreadBase::exit");
     {
-        AutoMutex lock(&mLock);
+        AutoMutex lock(mLock);
         mExiting = true;
         requestExit();
         mWaitWorkCV.signal();
@@ -1019,26 +1026,6 @@
     requestExitAndWait();
 }
 
-uint32_t AudioFlinger::ThreadBase::sampleRate() const
-{
-    return mSampleRate;
-}
-
-int AudioFlinger::ThreadBase::channelCount() const
-{
-    return (int)mChannelCount;
-}
-
-uint32_t AudioFlinger::ThreadBase::format() const
-{
-    return mFormat;
-}
-
-size_t AudioFlinger::ThreadBase::frameCount() const
-{
-    return mFrameCount;
-}
-
 status_t AudioFlinger::ThreadBase::setParameters(const String8& keyValuePairs)
 {
     status_t status;
@@ -1118,7 +1105,7 @@
     result.append(buffer);
     snprintf(buffer, SIZE, "Format: %d\n", mFormat);
     result.append(buffer);
-    snprintf(buffer, SIZE, "Frame size: %d\n", mFrameSize);
+    snprintf(buffer, SIZE, "Frame size: %u\n", mFrameSize);
     result.append(buffer);
 
     snprintf(buffer, SIZE, "\nPending setParameters commands: \n");
@@ -1240,8 +1227,7 @@
 void AudioFlinger::ThreadBase::setEffectSuspended_l(
         const effect_uuid_t *type, bool suspend, int sessionId)
 {
-    sp<EffectChain> chain;
-    chain = getEffectChain_l(sessionId);
+    sp<EffectChain> chain = getEffectChain_l(sessionId);
     if (chain != 0) {
         if (type != NULL) {
             chain->setEffectSuspended_l(type, suspend);
@@ -1370,22 +1356,32 @@
 AudioFlinger::PlaybackThread::PlaybackThread(const sp<AudioFlinger>& audioFlinger,
                                              AudioStreamOut* output,
                                              int id,
-                                             uint32_t device)
-    :   ThreadBase(audioFlinger, id, device),
-        mMixBuffer(NULL), mSuspended(0), mBytesWritten(0), mOutput(output),
+                                             uint32_t device,
+                                             type_t type)
+    :   ThreadBase(audioFlinger, id, device, type),
+        mMixBuffer(NULL), mSuspended(0), mBytesWritten(0),
+        // Assumes constructor is called by AudioFlinger with it's mLock held,
+        // but it would be safer to explicitly pass initial masterMute as parameter
+        mMasterMute(audioFlinger->masterMute_l()),
+        // mStreamTypes[] initialized in constructor body
+        mOutput(output),
+        // Assumes constructor is called by AudioFlinger with it's mLock held,
+        // but it would be safer to explicitly pass initial masterVolume as parameter
+        mMasterVolume(audioFlinger->masterVolume_l()),
         mLastWriteTime(0), mNumWrites(0), mNumDelayedWrites(0), mInWrite(false)
 {
     snprintf(mName, kNameLength, "AudioOut_%d", id);
 
     readOutputParameters();
 
-    mMasterVolume = mAudioFlinger->masterVolume();
-    mMasterMute = mAudioFlinger->masterMute();
-
-    for (int stream = 0; stream < AUDIO_STREAM_CNT; stream++) {
+    // mStreamTypes[AUDIO_STREAM_CNT] is initialized by stream_type_t default constructor
+    // There is no AUDIO_STREAM_MIN, and ++ operator does not compile
+    for (audio_stream_type_t stream = (audio_stream_type_t) 0; stream < AUDIO_STREAM_CNT;
+            stream = (audio_stream_type_t) (stream + 1)) {
         mStreamTypes[stream].volume = mAudioFlinger->streamVolumeInternal(stream);
         mStreamTypes[stream].mute = mAudioFlinger->streamMute(stream);
-        mStreamTypes[stream].valid = true;
+        // initialized by stream_type_t default constructor
+        // mStreamTypes[stream].valid = true;
     }
 }
 
@@ -1423,13 +1419,10 @@
     result.append(buffer);
     result.append("   Name  Clien Typ Fmt Chn mask   Session Buf  S M F SRate LeftV RighV  Serv       User       Main buf   Aux Buf\n");
     for (size_t i = 0; i < mActiveTracks.size(); ++i) {
-        wp<Track> wTrack = mActiveTracks[i];
-        if (wTrack != 0) {
-            sp<Track> track = wTrack.promote();
-            if (track != 0) {
-                track->dump(buffer, SIZE);
-                result.append(buffer);
-            }
+        sp<Track> track = mActiveTracks[i].promote();
+        if (track != 0) {
+            track->dump(buffer, SIZE);
+            result.append(buffer);
         }
     }
     write(fd, result.string(), result.size());
@@ -1483,9 +1476,9 @@
 // PlaybackThread::createTrack_l() must be called with AudioFlinger::mLock held
 sp<AudioFlinger::PlaybackThread::Track>  AudioFlinger::PlaybackThread::createTrack_l(
         const sp<AudioFlinger::Client>& client,
-        int streamType,
+        audio_stream_type_t streamType,
         uint32_t sampleRate,
-        uint32_t format,
+        audio_format_t format,
         uint32_t channelMask,
         int frameCount,
         const sp<IMemory>& sharedBuffer,
@@ -1596,34 +1589,24 @@
     return NO_ERROR;
 }
 
-float AudioFlinger::PlaybackThread::masterVolume() const
-{
-    return mMasterVolume;
-}
-
-bool AudioFlinger::PlaybackThread::masterMute() const
-{
-    return mMasterMute;
-}
-
-status_t AudioFlinger::PlaybackThread::setStreamVolume(int stream, float value)
+status_t AudioFlinger::PlaybackThread::setStreamVolume(audio_stream_type_t stream, float value)
 {
     mStreamTypes[stream].volume = value;
     return NO_ERROR;
 }
 
-status_t AudioFlinger::PlaybackThread::setStreamMute(int stream, bool muted)
+status_t AudioFlinger::PlaybackThread::setStreamMute(audio_stream_type_t stream, bool muted)
 {
     mStreamTypes[stream].mute = muted;
     return NO_ERROR;
 }
 
-float AudioFlinger::PlaybackThread::streamVolume(int stream) const
+float AudioFlinger::PlaybackThread::streamVolume(audio_stream_type_t stream) const
 {
     return mStreamTypes[stream].volume;
 }
 
-bool AudioFlinger::PlaybackThread::streamMute(int stream) const
+bool AudioFlinger::PlaybackThread::streamMute(audio_stream_type_t stream) const
 {
     return mStreamTypes[stream].mute;
 }
@@ -1697,7 +1680,7 @@
 // audioConfigChanged_l() must be called with AudioFlinger::mLock held
 void AudioFlinger::PlaybackThread::audioConfigChanged_l(int event, int param) {
     AudioSystem::OutputDescriptor desc;
-    void *param2 = 0;
+    void *param2 = NULL;
 
     ALOGV("PlaybackThread::audioConfigChanged_l, thread %p, event %d, param %d", this, event, param);
 
@@ -1727,12 +1710,12 @@
     mChannelMask = mOutput->stream->common.get_channels(&mOutput->stream->common);
     mChannelCount = (uint16_t)popcount(mChannelMask);
     mFormat = mOutput->stream->common.get_format(&mOutput->stream->common);
-    mFrameSize = (uint16_t)audio_stream_frame_size(&mOutput->stream->common);
+    mFrameSize = audio_stream_frame_size(&mOutput->stream->common);
     mFrameCount = mOutput->stream->common.get_buffer_size(&mOutput->stream->common) / mFrameSize;
 
     // FIXME - Current mixer implementation only supports stereo output: Always
     // Allocate a stereo buffer even if HW output is mono.
-    if (mMixBuffer != NULL) delete[] mMixBuffer;
+    delete[] mMixBuffer;
     mMixBuffer = new int16_t[mFrameCount * 2];
     memset(mMixBuffer, 0, mFrameCount * 2 * sizeof(int16_t));
 
@@ -1750,7 +1733,7 @@
 
 status_t AudioFlinger::PlaybackThread::getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames)
 {
-    if (halFrames == 0 || dspFrames == 0) {
+    if (halFrames == NULL || dspFrames == NULL) {
         return BAD_VALUE;
     }
     Mutex::Autolock _l(mLock);
@@ -1800,7 +1783,7 @@
 }
 
 
-AudioFlinger::AudioStreamOut* AudioFlinger::PlaybackThread::getOutput()
+AudioFlinger::AudioStreamOut* AudioFlinger::PlaybackThread::getOutput() const
 {
     Mutex::Autolock _l(mLock);
     return mOutput;
@@ -1837,13 +1820,12 @@
 
 // ----------------------------------------------------------------------------
 
-AudioFlinger::MixerThread::MixerThread(const sp<AudioFlinger>& audioFlinger, AudioStreamOut* output, int id, uint32_t device)
-    :   PlaybackThread(audioFlinger, output, id, device),
-        mAudioMixer(NULL)
+AudioFlinger::MixerThread::MixerThread(const sp<AudioFlinger>& audioFlinger, AudioStreamOut* output,
+        int id, uint32_t device, type_t type)
+    :   PlaybackThread(audioFlinger, output, id, device, type),
+        mAudioMixer(new AudioMixer(mFrameCount, mSampleRate)),
+        mPrevMixerStatus(MIXER_IDLE)
 {
-    mType = ThreadBase::MIXER;
-    mAudioMixer = new AudioMixer(mFrameCount, mSampleRate);
-
     // FIXME - Current mixer implementation only supports stereo output
     if (mChannelCount == 1) {
         ALOGE("Invalid audio hardware channel count");
@@ -1858,7 +1840,7 @@
 bool AudioFlinger::MixerThread::threadLoop()
 {
     Vector< sp<Track> > tracksToRemove;
-    uint32_t mixerStatus = MIXER_IDLE;
+    mixer_state mixerStatus = MIXER_IDLE;
     nsecs_t standbyTime = systemTime();
     size_t mixBufferSize = mFrameCount * mFrameSize;
     // FIXME: Relaxed timing because of a certain device that can't meet latency
@@ -1952,7 +1934,8 @@
                     ALOGV("MixerThread %p TID %d waking up\n", this, gettid());
                     acquireWakeLock_l();
 
-                    if (mMasterMute == false) {
+                    mPrevMixerStatus = MIXER_IDLE;
+                    if (!mMasterMute) {
                         char value[PROPERTY_VALUE_MAX];
                         property_get("ro.audio.silent", value, "0");
                         if (atoi(value)) {
@@ -1979,11 +1962,14 @@
         if (CC_LIKELY(mixerStatus == MIXER_TRACKS_READY)) {
             // mix buffers...
             mAudioMixer->process();
-            sleepTime = 0;
-            // increase sleep time progressively when application underrun condition clears
-            if (sleepTimeShift > 0) {
+            // increase sleep time progressively when application underrun condition clears.
+            // Only increase sleep time if the mixer is ready for two consecutive times to avoid
+            // that a steady state of alternating ready/not ready conditions keeps the sleep time
+            // such that we would underrun the audio HAL.
+            if ((sleepTime == 0) && (sleepTimeShift > 0)) {
                 sleepTimeShift--;
             }
+            sleepTime = 0;
             standbyTime = systemTime() + kStandbyTimeInNsecs;
             //TODO: delay standby when effects have a tail
         } else {
@@ -2073,10 +2059,11 @@
 }
 
 // prepareTracks_l() must be called with ThreadBase::mLock held
-uint32_t AudioFlinger::MixerThread::prepareTracks_l(const SortedVector< wp<Track> >& activeTracks, Vector< sp<Track> > *tracksToRemove)
+AudioFlinger::PlaybackThread::mixer_state AudioFlinger::MixerThread::prepareTracks_l(
+        const SortedVector< wp<Track> >& activeTracks, Vector< sp<Track> > *tracksToRemove)
 {
 
-    uint32_t mixerStatus = MIXER_IDLE;
+    mixer_state mixerStatus = MIXER_IDLE;
     // find out which tracks need to be processed
     size_t count = activeTracks.size();
     size_t mixedTracks = 0;
@@ -2111,11 +2098,11 @@
         // make sure that we have enough frames to mix one full buffer.
         // enforce this condition only once to enable draining the buffer in case the client
         // app does not call stop() and relies on underrun to stop:
-        // hence the test on (track->mRetryCount >= kMaxTrackRetries) meaning the track was mixed
+        // hence the test on (mPrevMixerStatus == MIXER_TRACKS_READY) meaning the track was mixed
         // during last round
         uint32_t minFrames = 1;
         if (!track->isStopped() && !track->isPausing() &&
-                (track->mRetryCount >= kMaxTrackRetries)) {
+                (mPrevMixerStatus == MIXER_TRACKS_READY)) {
             if (t->sampleRate() == (int)mSampleRate) {
                 minFrames = mFrameCount;
             } else {
@@ -2127,7 +2114,7 @@
                 // the minimum track buffer size is normally twice the number of frames necessary
                 // to fill one buffer and the resampler should not leave more than one buffer worth
                 // of unreleased frames after each pass, but just in case...
-                LOG_ASSERT(minFrames <= cblk->frameCount);
+                ALOG_ASSERT(minFrames <= cblk->frameCount);
             }
         }
         if ((cblk->framesReady() >= minFrames) && track->isReady() &&
@@ -2180,10 +2167,31 @@
                 // read original volumes with volume control
                 float typeVolume = mStreamTypes[track->type()].volume;
                 float v = masterVolume * typeVolume;
-                vl = (uint32_t)(v * cblk->volume[0]) << 12;
-                vr = (uint32_t)(v * cblk->volume[1]) << 12;
+                uint32_t vlr = cblk->getVolumeLR();
+                vl = vlr & 0xFFFF;
+                vr = vlr >> 16;
+                // track volumes come from shared memory, so can't be trusted and must be clamped
+                if (vl > MAX_GAIN_INT) {
+                    ALOGV("Track left volume out of range: %04X", vl);
+                    vl = MAX_GAIN_INT;
+                }
+                if (vr > MAX_GAIN_INT) {
+                    ALOGV("Track right volume out of range: %04X", vr);
+                    vr = MAX_GAIN_INT;
+                }
+                // now apply the master volume and stream type volume
+                vl = (uint32_t)(v * vl) << 12;
+                vr = (uint32_t)(v * vr) << 12;
+                // assuming master volume and stream type volume each go up to 1.0,
+                // vl and vr are now in 8.24 format
 
-                va = (uint32_t)(v * cblk->sendLevel);
+                uint16_t sendLevel = cblk->getSendLevel_U4_12();
+                // send level comes from shared memory and so may be corrupt
+                if (sendLevel >= MAX_GAIN_INT) {
+                    ALOGV("Track send level out of range: %04X", sendLevel);
+                    sendLevel = MAX_GAIN_INT;
+                }
+                va = (uint32_t)(v * sendLevel);
             }
             // Delegate volume control to effect in track effect chain if needed
             if (chain != 0 && chain->setVolume_l(&vl, &vr)) {
@@ -2201,6 +2209,7 @@
 
             // Convert volumes from 8.24 to 4.12 format
             int16_t left, right, aux;
+            // This additional clamping is needed in case chain->setVolume_l() overshot
             uint32_t v_clamped = (vl + (1 << 11)) >> 12;
             if (v_clamped > MAX_GAIN_INT) v_clamped = MAX_GAIN_INT;
             left = int16_t(v_clamped);
@@ -2242,7 +2251,13 @@
 
             // reset retry count
             track->mRetryCount = kMaxTrackRetries;
-            mixerStatus = MIXER_TRACKS_READY;
+            // If one track is ready, set the mixer ready if:
+            //  - the mixer was not ready during previous round OR
+            //  - no other track is not ready
+            if (mPrevMixerStatus != MIXER_TRACKS_READY ||
+                    mixerStatus != MIXER_TRACKS_ENABLED) {
+                mixerStatus = MIXER_TRACKS_READY;
+            }
         } else {
             //ALOGV("track %d u=%08x, s=%08x [NOT READY] on thread %p", name, cblk->user, cblk->server, this);
             if (track->isStopped()) {
@@ -2260,7 +2275,11 @@
                     tracksToRemove->add(track);
                     // indicate to client process that the track was disabled because of underrun
                     android_atomic_or(CBLK_DISABLED_ON, &cblk->flags);
-                } else if (mixerStatus != MIXER_TRACKS_READY) {
+                // If one track is not ready, mark the mixer also not ready if:
+                //  - the mixer was ready during previous round OR
+                //  - no other track is ready
+                } else if (mPrevMixerStatus == MIXER_TRACKS_READY ||
+                                mixerStatus != MIXER_TRACKS_READY) {
                     mixerStatus = MIXER_TRACKS_ENABLED;
                 }
             }
@@ -2294,10 +2313,11 @@
         memset(mMixBuffer, 0, mFrameCount * mChannelCount * sizeof(int16_t));
     }
 
+    mPrevMixerStatus = mixerStatus;
     return mixerStatus;
 }
 
-void AudioFlinger::MixerThread::invalidateTracks(int streamType)
+void AudioFlinger::MixerThread::invalidateTracks(audio_stream_type_t streamType)
 {
     ALOGV ("MixerThread::invalidateTracks() mixer %p, streamType %d, mTracks.size %d",
             this,  streamType, mTracks.size());
@@ -2313,7 +2333,7 @@
     }
 }
 
-void AudioFlinger::PlaybackThread::setStreamValid(int streamType, bool valid)
+void AudioFlinger::PlaybackThread::setStreamValid(audio_stream_type_t streamType, bool valid)
 {
     ALOGV ("PlaybackThread::setStreamValid() thread %p, streamType %d, valid %d",
             this,  streamType, valid);
@@ -2350,7 +2370,7 @@
             reconfig = true;
         }
         if (param.getInt(String8(AudioParameter::keyFormat), value) == NO_ERROR) {
-            if (value != AUDIO_FORMAT_PCM_16_BIT) {
+            if ((audio_format_t) value != AUDIO_FORMAT_PCM_16_BIT) {
                 status = BAD_VALUE;
             } else {
                 reconfig = true;
@@ -2415,6 +2435,8 @@
             }
             if (status == NO_ERROR && reconfig) {
                 delete mAudioMixer;
+                // for safety in case readOutputParameters() accesses mAudioMixer (it doesn't)
+                mAudioMixer = NULL;
                 readOutputParameters();
                 mAudioMixer = new AudioMixer(mFrameCount, mSampleRate);
                 for (size_t i = 0; i < mTracks.size() ; i++) {
@@ -2467,9 +2489,10 @@
 
 // ----------------------------------------------------------------------------
 AudioFlinger::DirectOutputThread::DirectOutputThread(const sp<AudioFlinger>& audioFlinger, AudioStreamOut* output, int id, uint32_t device)
-    :   PlaybackThread(audioFlinger, output, id, device)
+    :   PlaybackThread(audioFlinger, output, id, device, DIRECT)
+        // mLeftVolFloat, mRightVolFloat
+        // mLeftVolShort, mRightVolShort
 {
-    mType = ThreadBase::DIRECT;
 }
 
 AudioFlinger::DirectOutputThread::~DirectOutputThread()
@@ -2567,7 +2590,7 @@
 
 bool AudioFlinger::DirectOutputThread::threadLoop()
 {
-    uint32_t mixerStatus = MIXER_IDLE;
+    mixer_state mixerStatus = MIXER_IDLE;
     sp<Track> trackToRemove;
     sp<Track> activeTrack;
     nsecs_t standbyTime = systemTime();
@@ -2627,7 +2650,7 @@
                     ALOGV("DirectOutputThread %p TID %d waking up in active mode\n", this, gettid());
                     acquireWakeLock_l();
 
-                    if (mMasterMute == false) {
+                    if (!mMasterMute) {
                         char value[PROPERTY_VALUE_MAX];
                         property_get("ro.audio.silent", value, "0");
                         if (atoi(value)) {
@@ -2683,10 +2706,11 @@
                     } else {
                         float typeVolume = mStreamTypes[track->type()].volume;
                         float v = mMasterVolume * typeVolume;
-                        float v_clamped = v * cblk->volume[0];
+                        uint32_t vlr = cblk->getVolumeLR();
+                        float v_clamped = v * (vlr & 0xFFFF);
                         if (v_clamped > MAX_GAIN) v_clamped = MAX_GAIN;
                         left = v_clamped/MAX_GAIN;
-                        v_clamped = v * cblk->volume[1];
+                        v_clamped = v * (vlr >> 16);
                         if (v_clamped > MAX_GAIN) v_clamped = MAX_GAIN;
                         right = v_clamped/MAX_GAIN;
                     }
@@ -2945,10 +2969,11 @@
 
 // ----------------------------------------------------------------------------
 
-AudioFlinger::DuplicatingThread::DuplicatingThread(const sp<AudioFlinger>& audioFlinger, AudioFlinger::MixerThread* mainThread, int id)
-    :   MixerThread(audioFlinger, mainThread->getOutput(), id, mainThread->device()), mWaitTimeMs(UINT_MAX)
+AudioFlinger::DuplicatingThread::DuplicatingThread(const sp<AudioFlinger>& audioFlinger,
+        AudioFlinger::MixerThread* mainThread, int id)
+    :   MixerThread(audioFlinger, mainThread->getOutput(), id, mainThread->device(), DUPLICATING),
+        mWaitTimeMs(UINT_MAX)
 {
-    mType = ThreadBase::DUPLICATING;
     addOutputTrack(mainThread);
 }
 
@@ -2963,7 +2988,7 @@
 bool AudioFlinger::DuplicatingThread::threadLoop()
 {
     Vector< sp<Track> > tracksToRemove;
-    uint32_t mixerStatus = MIXER_IDLE;
+    mixer_state mixerStatus = MIXER_IDLE;
     nsecs_t standbyTime = systemTime();
     size_t mixBufferSize = mFrameCount*mFrameSize;
     SortedVector< sp<OutputTrack> > outputTracks;
@@ -3021,7 +3046,8 @@
                     ALOGV("DuplicatingThread %p TID %d waking up\n", this, gettid());
                     acquireWakeLock_l();
 
-                    if (mMasterMute == false) {
+                    mPrevMixerStatus = MIXER_IDLE;
+                    if (!mMasterMute) {
                         char value[PROPERTY_VALUE_MAX];
                         property_get("ro.audio.silent", value, "0");
                         if (atoi(value)) {
@@ -3148,7 +3174,7 @@
     mWaitTimeMs = UINT_MAX;
     for (size_t i = 0; i < mOutputTracks.size(); i++) {
         sp<ThreadBase> strong = mOutputTracks[i]->thread().promote();
-        if (strong != NULL) {
+        if (strong != 0) {
             uint32_t waitTimeMs = (strong->frameCount() * 2 * 1000) / strong->sampleRate();
             if (waitTimeMs < mWaitTimeMs) {
                 mWaitTimeMs = waitTimeMs;
@@ -3187,7 +3213,7 @@
             const wp<ThreadBase>& thread,
             const sp<Client>& client,
             uint32_t sampleRate,
-            uint32_t format,
+            audio_format_t format,
             uint32_t channelMask,
             int frameCount,
             uint32_t flags,
@@ -3196,13 +3222,16 @@
     :   RefBase(),
         mThread(thread),
         mClient(client),
-        mCblk(0),
+        mCblk(NULL),
+        // mBuffer
+        // mBufferEnd
         mFrameCount(0),
         mState(IDLE),
-        mClientTid(-1),
         mFormat(format),
         mFlags(flags & ~SYSTEM_FLAGS_MASK),
         mSessionId(sessionId)
+        // mChannelCount
+        // mChannelMask
 {
     ALOGV_IF(sharedBuffer != 0, "sharedBuffer: %p, size: %d", sharedBuffer->pointer(), sharedBuffer->size());
 
@@ -3218,7 +3247,7 @@
         mCblkMemory = client->heap()->allocate(size);
         if (mCblkMemory != 0) {
             mCblk = static_cast<audio_track_cblk_t *>(mCblkMemory->pointer());
-            if (mCblk) { // construct the shared structure in-place.
+            if (mCblk != NULL) { // construct the shared structure in-place.
                 new(mCblk) audio_track_cblk_t();
                 // clear all buffers
                 mCblk->frameCount = frameCount;
@@ -3243,7 +3272,7 @@
         }
    } else {
        mCblk = (audio_track_cblk_t *)(new uint8_t[size]);
-       if (mCblk) { // construct the shared structure in-place.
+           // construct the shared structure in-place.
            new(mCblk) audio_track_cblk_t();
            // clear all buffers
            mCblk->frameCount = frameCount;
@@ -3256,21 +3285,25 @@
            // written to buffer (other flags are cleared)
            mCblk->flags = CBLK_UNDERRUN_ON;
            mBufferEnd = (uint8_t *)mBuffer + bufferSize;
-       }
    }
 }
 
 AudioFlinger::ThreadBase::TrackBase::~TrackBase()
 {
-    if (mCblk) {
-        mCblk->~audio_track_cblk_t();   // destroy our shared-structure.
-        if (mClient == NULL) {
+    if (mCblk != NULL) {
+        if (mClient == 0) {
             delete mCblk;
+        } else {
+            mCblk->~audio_track_cblk_t();   // destroy our shared-structure.
         }
     }
     mCblkMemory.clear();            // and free the shared memory
-    if (mClient != NULL) {
+    if (mClient != 0) {
+        // Client destructor must run with AudioFlinger mutex locked
         Mutex::Autolock _l(mClient->audioFlinger()->mLock);
+        // If the client's reference count drops to zero, the associated destructor
+        // must run with AudioFlinger lock held. Thus the explicit clear() rather than
+        // relying on the automatic clear() at end of scope.
         mClient.clear();
     }
 }
@@ -3306,36 +3339,24 @@
     ALOGV("TrackBase::reset");
 }
 
-sp<IMemory> AudioFlinger::ThreadBase::TrackBase::getCblk() const
-{
-    return mCblkMemory;
-}
-
 int AudioFlinger::ThreadBase::TrackBase::sampleRate() const {
     return (int)mCblk->sampleRate;
 }
 
-int AudioFlinger::ThreadBase::TrackBase::channelCount() const {
-    return (const int)mChannelCount;
-}
-
-uint32_t AudioFlinger::ThreadBase::TrackBase::channelMask() const {
-    return mChannelMask;
-}
-
 void* AudioFlinger::ThreadBase::TrackBase::getBuffer(uint32_t offset, uint32_t frames) const {
     audio_track_cblk_t* cblk = this->cblk();
-    int8_t *bufferStart = (int8_t *)mBuffer + (offset-cblk->serverBase)*cblk->frameSize;
-    int8_t *bufferEnd = bufferStart + frames * cblk->frameSize;
+    size_t frameSize = cblk->frameSize;
+    int8_t *bufferStart = (int8_t *)mBuffer + (offset-cblk->serverBase)*frameSize;
+    int8_t *bufferEnd = bufferStart + frames * frameSize;
 
     // Check validity of returned pointer in case the track control block would have been corrupted.
     if (bufferStart < mBuffer || bufferStart > bufferEnd || bufferEnd > mBufferEnd ||
-        ((unsigned long)bufferStart & (unsigned long)(cblk->frameSize - 1))) {
+        ((unsigned long)bufferStart & (unsigned long)(frameSize - 1))) {
         ALOGE("TrackBase::getBuffer buffer out of range:\n    start: %p, end %p , mBuffer %p mBufferEnd %p\n    \
                 server %d, serverBase %d, user %d, userBase %d",
                 bufferStart, bufferEnd, mBuffer, mBufferEnd,
                 cblk->server, cblk->serverBase, cblk->user, cblk->userBase);
-        return 0;
+        return NULL;
     }
 
     return bufferStart;
@@ -3347,9 +3368,9 @@
 AudioFlinger::PlaybackThread::Track::Track(
             const wp<ThreadBase>& thread,
             const sp<Client>& client,
-            int streamType,
+            audio_stream_type_t streamType,
             uint32_t sampleRate,
-            uint32_t format,
+            audio_format_t format,
             uint32_t channelMask,
             int frameCount,
             const sp<IMemory>& sharedBuffer,
@@ -3369,8 +3390,6 @@
         if (mName < 0) {
             ALOGE("no more track names available");
         }
-        mVolume[0] = 1.0f;
-        mVolume[1] = 1.0f;
         mStreamType = streamType;
         // NOTE: audio_track_cblk_t::frameSize for 8 bit PCM data is based on a sample size of
         // 16 bit because data is converted to 16 bit before being stored in buffer by AudioTrack
@@ -3422,9 +3441,10 @@
 
 void AudioFlinger::PlaybackThread::Track::dump(char* buffer, size_t size)
 {
+    uint32_t vlr = mCblk->getVolumeLR();
     snprintf(buffer, size, "   %05d %05d %03u %03u 0x%08x %05u   %04u %1d %1d %1d %05u %05u %05u  0x%08x 0x%08x 0x%08x 0x%08x\n",
             mName - AudioMixer::TRACK0,
-            (mClient == NULL) ? getpid() : mClient->pid(),
+            (mClient == 0) ? getpid() : mClient->pid(),
             mStreamType,
             mFormat,
             mChannelMask,
@@ -3434,8 +3454,8 @@
             mMute,
             mFillingUpStatus,
             mCblk->sampleRate,
-            mCblk->volume[0],
-            mCblk->volume[1],
+            vlr & 0xFFFF,
+            vlr >> 16,
             mCblk->server,
             mCblk->user,
             (int)mMainBuffer,
@@ -3503,7 +3523,7 @@
     sp<ThreadBase> thread = mThread.promote();
     if (thread != 0) {
         Mutex::Autolock _l(thread->mLock);
-        int state = mState;
+        track_state state = mState;
         // here the track could be either new, or restarted
         // in both cases "unstop" the track
         if (mState == PAUSED) {
@@ -3544,7 +3564,7 @@
     sp<ThreadBase> thread = mThread.promote();
     if (thread != 0) {
         Mutex::Autolock _l(thread->mLock);
-        int state = mState;
+        track_state state = mState;
         if (mState > STOPPED) {
             mState = STOPPED;
             // If the track is not active (PAUSED and buffers full), flush buffers
@@ -3632,12 +3652,6 @@
     mMute = muted;
 }
 
-void AudioFlinger::PlaybackThread::Track::setVolume(float left, float right)
-{
-    mVolume[0] = left;
-    mVolume[1] = right;
-}
-
 status_t AudioFlinger::PlaybackThread::Track::attachAuxEffect(int EffectId)
 {
     status_t status = DEAD_OBJECT;
@@ -3662,7 +3676,7 @@
             const wp<ThreadBase>& thread,
             const sp<Client>& client,
             uint32_t sampleRate,
-            uint32_t format,
+            audio_format_t format,
             uint32_t channelMask,
             int frameCount,
             uint32_t flags,
@@ -3757,7 +3771,7 @@
 void AudioFlinger::RecordThread::RecordTrack::dump(char* buffer, size_t size)
 {
     snprintf(buffer, size, "   %05d %03u 0x%08x %05d   %04u %01d %05u  %08x %08x\n",
-            (mClient == NULL) ? getpid() : mClient->pid(),
+            (mClient == 0) ? getpid() : mClient->pid(),
             mFormat,
             mChannelMask,
             mSessionId,
@@ -3775,7 +3789,7 @@
             const wp<ThreadBase>& thread,
             DuplicatingThread *sourceThread,
             uint32_t sampleRate,
-            uint32_t format,
+            audio_format_t format,
             uint32_t channelMask,
             int frameCount)
     :   Track(thread, NULL, AUDIO_STREAM_CNT, sampleRate, format, channelMask, frameCount, NULL, 0),
@@ -3786,7 +3800,6 @@
     if (mCblk != NULL) {
         mCblk->flags |= CBLK_DIRECTION_OUT;
         mCblk->buffers = (char*)mCblk + sizeof(audio_track_cblk_t);
-        mCblk->volume[0] = mCblk->volume[1] = 0x1000;
         mOutBuffer.frameCount = 0;
         playbackThread->mTracks.add(this);
         ALOGV("OutputTrack constructor mCblk %p, mBuffer %p, mCblk->buffers %p, " \
@@ -3870,7 +3883,7 @@
         if (mOutBuffer.frameCount == 0) {
             mOutBuffer.frameCount = pInBuffer->frameCount;
             nsecs_t startTime = systemTime();
-            if (obtainBuffer(&mOutBuffer, waitTimeLeftMs) == (status_t)AudioTrack::NO_MORE_BUFFERS) {
+            if (obtainBuffer(&mOutBuffer, waitTimeLeftMs) == (status_t)NO_MORE_BUFFERS) {
                 ALOGV ("OutputTrack::write() %p thread %p no more output buffers", this, mThread.unsafe_get());
                 outputBufferFull = true;
                 break;
@@ -3961,11 +3974,11 @@
             active = mActive;
             if (CC_UNLIKELY(!active)) {
                 ALOGV("Not active and NO_MORE_BUFFERS");
-                return AudioTrack::NO_MORE_BUFFERS;
+                return NO_MORE_BUFFERS;
             }
             result = cblk->cv.waitRelative(cblk->lock, milliseconds(waitTimeMs));
             if (result != NO_ERROR) {
-                return AudioTrack::NO_MORE_BUFFERS;
+                return NO_MORE_BUFFERS;
             }
             // read the server count again
         start_loop_here:
@@ -3974,7 +3987,7 @@
     }
 
 //    if (framesAvail < framesReq) {
-//        return AudioTrack::NO_MORE_BUFFERS;
+//        return NO_MORE_BUFFERS;
 //    }
 
     if (framesReq > framesAvail) {
@@ -4024,7 +4037,7 @@
     mAudioFlinger->removeClient_l(mPid);
 }
 
-const sp<MemoryDealer>& AudioFlinger::Client::heap() const
+sp<MemoryDealer> AudioFlinger::Client::heap() const
 {
     return mMemoryDealer;
 }
@@ -4034,13 +4047,12 @@
 AudioFlinger::NotificationClient::NotificationClient(const sp<AudioFlinger>& audioFlinger,
                                                      const sp<IAudioFlingerClient>& client,
                                                      pid_t pid)
-    : mAudioFlinger(audioFlinger), mPid(pid), mClient(client)
+    : mAudioFlinger(audioFlinger), mPid(pid), mAudioFlingerClient(client)
 {
 }
 
 AudioFlinger::NotificationClient::~NotificationClient()
 {
-    mClient.clear();
 }
 
 void AudioFlinger::NotificationClient::binderDied(const wp<IBinder>& who)
@@ -4067,6 +4079,10 @@
     mTrack->destroy();
 }
 
+sp<IMemory> AudioFlinger::TrackHandle::getCblk() const {
+    return mTrack->getCblk();
+}
+
 status_t AudioFlinger::TrackHandle::start() {
     return mTrack->start();
 }
@@ -4087,14 +4103,6 @@
     mTrack->pause();
 }
 
-void AudioFlinger::TrackHandle::setVolume(float left, float right) {
-    mTrack->setVolume(left, right);
-}
-
-sp<IMemory> AudioFlinger::TrackHandle::getCblk() const {
-    return mTrack->getCblk();
-}
-
 status_t AudioFlinger::TrackHandle::attachAuxEffect(int EffectId)
 {
     return mTrack->attachAuxEffect(EffectId);
@@ -4112,7 +4120,7 @@
         pid_t pid,
         int input,
         uint32_t sampleRate,
-        uint32_t format,
+        audio_format_t format,
         uint32_t channelMask,
         int frameCount,
         uint32_t flags,
@@ -4201,6 +4209,10 @@
     stop();
 }
 
+sp<IMemory> AudioFlinger::RecordHandle::getCblk() const {
+    return mRecordTrack->getCblk();
+}
+
 status_t AudioFlinger::RecordHandle::start() {
     ALOGV("RecordHandle::start()");
     return mRecordTrack->start();
@@ -4211,10 +4223,6 @@
     mRecordTrack->stop();
 }
 
-sp<IMemory> AudioFlinger::RecordHandle::getCblk() const {
-    return mRecordTrack->getCblk();
-}
-
 status_t AudioFlinger::RecordHandle::onTransact(
     uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
 {
@@ -4229,15 +4237,16 @@
                                          uint32_t channels,
                                          int id,
                                          uint32_t device) :
-    ThreadBase(audioFlinger, id, device),
-    mInput(input), mTrack(NULL), mResampler(NULL), mRsmpOutBuffer(NULL), mRsmpInBuffer(NULL)
+    ThreadBase(audioFlinger, id, device, RECORD),
+    mInput(input), mTrack(NULL), mResampler(NULL), mRsmpOutBuffer(NULL), mRsmpInBuffer(NULL),
+    // mRsmpInIndex and mInputBytes set by readInputParameters()
+    mReqChannelCount(popcount(channels)),
+    mReqSampleRate(sampleRate)
+    // mBytesRead is only meaningful while active, and so is cleared in start()
+    // (but might be better to also clear here for dump?)
 {
-    mType = ThreadBase::RECORD;
-
     snprintf(mName, kNameLength, "AudioIn_%d", id);
 
-    mReqChannelCount = popcount(channels);
-    mReqSampleRate = sampleRate;
     readInputParameters();
 }
 
@@ -4245,10 +4254,8 @@
 AudioFlinger::RecordThread::~RecordThread()
 {
     delete[] mRsmpInBuffer;
-    if (mResampler != NULL) {
-        delete mResampler;
-        delete[] mRsmpOutBuffer;
-    }
+    delete mResampler;
+    delete[] mRsmpOutBuffer;
 }
 
 void AudioFlinger::RecordThread::onFirstRef()
@@ -4457,7 +4464,7 @@
 sp<AudioFlinger::RecordThread::RecordTrack>  AudioFlinger::RecordThread::createRecordTrack_l(
         const sp<AudioFlinger::Client>& client,
         uint32_t sampleRate,
-        int format,
+        audio_format_t format,
         int channelMask,
         int frameCount,
         uint32_t flags,
@@ -4479,7 +4486,7 @@
         track = new RecordTrack(this, client, sampleRate,
                       format, channelMask, frameCount, flags, sessionId);
 
-        if (track->getCblk() == NULL) {
+        if (track->getCblk() == 0) {
             lStatus = NO_MEMORY;
             goto Exit;
         }
@@ -4506,7 +4513,7 @@
     sp <ThreadBase> strongMe = this;
     status_t status = NO_ERROR;
     {
-        AutoMutex lock(&mLock);
+        AutoMutex lock(mLock);
         if (mActiveTrack != 0) {
             if (recordTrack != mActiveTrack.get()) {
                 status = -EBUSY;
@@ -4558,7 +4565,7 @@
     ALOGV("RecordThread::stop");
     sp <ThreadBase> strongMe = this;
     {
-        AutoMutex lock(&mLock);
+        AutoMutex lock(mLock);
         if (mActiveTrack != 0 && recordTrack == mActiveTrack.get()) {
             mActiveTrack->mState = TrackBase::PAUSING;
             // do not wait for mStartStopCond if exiting
@@ -4582,7 +4589,6 @@
     const size_t SIZE = 256;
     char buffer[SIZE];
     String8 result;
-    pid_t pid = 0;
 
     snprintf(buffer, SIZE, "\nInput thread %p internals\n", this);
     result.append(buffer);
@@ -4669,7 +4675,7 @@
         String8 keyValuePair = mNewParameters[0];
         AudioParameter param = AudioParameter(keyValuePair);
         int value;
-        int reqFormat = mFormat;
+        audio_format_t reqFormat = mFormat;
         int reqSamplingRate = mReqSampleRate;
         int reqChannelCount = mReqChannelCount;
 
@@ -4678,7 +4684,7 @@
             reconfig = true;
         }
         if (param.getInt(String8(AudioParameter::keyFormat), value) == NO_ERROR) {
-            reqFormat = value;
+            reqFormat = (audio_format_t) value;
             reconfig = true;
         }
         if (param.getInt(String8(AudioParameter::keyChannels), value) == NO_ERROR) {
@@ -4770,7 +4776,7 @@
 
 void AudioFlinger::RecordThread::audioConfigChanged_l(int event, int param) {
     AudioSystem::OutputDescriptor desc;
-    void *param2 = 0;
+    void *param2 = NULL;
 
     switch (event) {
     case AudioSystem::INPUT_OPENED:
@@ -4792,16 +4798,18 @@
 
 void AudioFlinger::RecordThread::readInputParameters()
 {
-    if (mRsmpInBuffer) delete mRsmpInBuffer;
-    if (mRsmpOutBuffer) delete mRsmpOutBuffer;
-    if (mResampler) delete mResampler;
+    delete mRsmpInBuffer;
+    // mRsmpInBuffer is always assigned a new[] below
+    delete mRsmpOutBuffer;
+    mRsmpOutBuffer = NULL;
+    delete mResampler;
     mResampler = NULL;
 
     mSampleRate = mInput->stream->common.get_sample_rate(&mInput->stream->common);
     mChannelMask = mInput->stream->common.get_channels(&mInput->stream->common);
     mChannelCount = (uint16_t)popcount(mChannelMask);
     mFormat = mInput->stream->common.get_format(&mInput->stream->common);
-    mFrameSize = (uint16_t)audio_stream_frame_size(&mInput->stream->common);
+    mFrameSize = audio_stream_frame_size(&mInput->stream->common);
     mInputBytes = mInput->stream->common.get_buffer_size(&mInput->stream->common);
     mFrameCount = mInputBytes / mFrameSize;
     mRsmpInBuffer = new int16_t[mFrameCount * mChannelCount];
@@ -4861,7 +4869,7 @@
     return mTrack;
 }
 
-AudioFlinger::AudioStreamIn* AudioFlinger::RecordThread::getInput()
+AudioFlinger::AudioStreamIn* AudioFlinger::RecordThread::getInput() const
 {
     Mutex::Autolock _l(mLock);
     return mInput;
@@ -4889,7 +4897,7 @@
 
 int AudioFlinger::openOutput(uint32_t *pDevices,
                                 uint32_t *pSamplingRate,
-                                uint32_t *pFormat,
+                                audio_format_t *pFormat,
                                 uint32_t *pChannels,
                                 uint32_t *pLatencyMs,
                                 uint32_t flags)
@@ -4898,7 +4906,7 @@
     PlaybackThread *thread = NULL;
     mHardwareStatus = AUDIO_HW_OUTPUT_OPEN;
     uint32_t samplingRate = pSamplingRate ? *pSamplingRate : 0;
-    uint32_t format = pFormat ? *pFormat : 0;
+    audio_format_t format = pFormat ? *pFormat : AUDIO_FORMAT_DEFAULT;
     uint32_t channels = pChannels ? *pChannels : 0;
     uint32_t latency = pLatencyMs ? *pLatencyMs : 0;
     audio_stream_out_t *outStream;
@@ -4921,7 +4929,7 @@
     if (outHwDev == NULL)
         return 0;
 
-    status = outHwDev->open_output_stream(outHwDev, *pDevices, (int *)&format,
+    status = outHwDev->open_output_stream(outHwDev, *pDevices, &format,
                                           &channels, &samplingRate, &outStream);
     ALOGV("openOutput() openOutputStream returned output %p, SamplingRate %d, Format %d, Channels %x, status %d",
             outStream,
@@ -4946,10 +4954,10 @@
         }
         mPlaybackThreads.add(id, thread);
 
-        if (pSamplingRate) *pSamplingRate = samplingRate;
-        if (pFormat) *pFormat = format;
-        if (pChannels) *pChannels = channels;
-        if (pLatencyMs) *pLatencyMs = thread->latency();
+        if (pSamplingRate != NULL) *pSamplingRate = samplingRate;
+        if (pFormat != NULL) *pFormat = format;
+        if (pChannels != NULL) *pChannels = channels;
+        if (pLatencyMs != NULL) *pLatencyMs = thread->latency();
 
         // notify client processes of the new output creation
         thread->audioConfigChanged_l(AudioSystem::OUTPUT_OPENED);
@@ -5001,7 +5009,7 @@
                 }
             }
         }
-        void *param2 = 0;
+        void *param2 = NULL;
         audioConfigChanged_l(AudioSystem::OUTPUT_CLOSED, output, param2);
         mPlaybackThreads.removeItem(output);
     }
@@ -5009,6 +5017,7 @@
 
     if (thread->type() != ThreadBase::DUPLICATING) {
         AudioStreamOut *out = thread->clearOutput();
+        assert(out != NULL);
         // from now on thread->mOutput is NULL
         out->hwDev->close_output_stream(out->hwDev, out->stream);
         delete out;
@@ -5049,17 +5058,17 @@
 
 int AudioFlinger::openInput(uint32_t *pDevices,
                                 uint32_t *pSamplingRate,
-                                uint32_t *pFormat,
+                                audio_format_t *pFormat,
                                 uint32_t *pChannels,
-                                uint32_t acoustics)
+                                audio_in_acoustics_t acoustics)
 {
     status_t status;
     RecordThread *thread = NULL;
     uint32_t samplingRate = pSamplingRate ? *pSamplingRate : 0;
-    uint32_t format = pFormat ? *pFormat : 0;
+    audio_format_t format = pFormat ? *pFormat : AUDIO_FORMAT_DEFAULT;
     uint32_t channels = pChannels ? *pChannels : 0;
     uint32_t reqSamplingRate = samplingRate;
-    uint32_t reqFormat = format;
+    audio_format_t reqFormat = format;
     uint32_t reqChannels = channels;
     audio_stream_in_t *inStream;
     audio_hw_device_t *inHwDev;
@@ -5074,9 +5083,9 @@
     if (inHwDev == NULL)
         return 0;
 
-    status = inHwDev->open_input_stream(inHwDev, *pDevices, (int *)&format,
+    status = inHwDev->open_input_stream(inHwDev, *pDevices, &format,
                                         &channels, &samplingRate,
-                                        (audio_in_acoustics_t)acoustics,
+                                        acoustics,
                                         &inStream);
     ALOGV("openInput() openInputStream returned input %p, SamplingRate %d, Format %d, Channels %x, acoustics %x, status %d",
             inStream,
@@ -5094,9 +5103,9 @@
         (samplingRate <= 2 * reqSamplingRate) &&
         (popcount(channels) < 3) && (popcount(reqChannels) < 3)) {
         ALOGV("openInput() reopening with proposed sampling rate and channels");
-        status = inHwDev->open_input_stream(inHwDev, *pDevices, (int *)&format,
+        status = inHwDev->open_input_stream(inHwDev, *pDevices, &format,
                                             &channels, &samplingRate,
-                                            (audio_in_acoustics_t)acoustics,
+                                            acoustics,
                                             &inStream);
     }
 
@@ -5116,9 +5125,9 @@
                                   device);
         mRecordThreads.add(id, thread);
         ALOGV("openInput() created record thread: ID %d thread %p", id, thread);
-        if (pSamplingRate) *pSamplingRate = reqSamplingRate;
-        if (pFormat) *pFormat = format;
-        if (pChannels) *pChannels = reqChannels;
+        if (pSamplingRate != NULL) *pSamplingRate = reqSamplingRate;
+        if (pFormat != NULL) *pFormat = format;
+        if (pChannels != NULL) *pChannels = reqChannels;
 
         input->stream->common.standby(&input->stream->common);
 
@@ -5143,13 +5152,14 @@
         }
 
         ALOGV("closeInput() %d", input);
-        void *param2 = 0;
+        void *param2 = NULL;
         audioConfigChanged_l(AudioSystem::INPUT_CLOSED, input, param2);
         mRecordThreads.removeItem(input);
     }
     thread->exit();
 
     AudioStreamIn *in = thread->clearInput();
+    assert(in != NULL);
     // from now on thread->mInput is NULL
     in->hwDev->close_input_stream(in->hwDev, in->stream);
     delete in;
@@ -5157,7 +5167,7 @@
     return NO_ERROR;
 }
 
-status_t AudioFlinger::setStreamOutput(uint32_t stream, int output)
+status_t AudioFlinger::setStreamOutput(audio_stream_type_t stream, int output)
 {
     Mutex::Autolock _l(mLock);
     MixerThread *dstThread = checkMixerThread_l(output);
@@ -5193,7 +5203,7 @@
 void AudioFlinger::acquireAudioSessionId(int audioSession)
 {
     Mutex::Autolock _l(mLock);
-    int caller = IPCThreadState::self()->getCallingPid();
+    pid_t caller = IPCThreadState::self()->getCallingPid();
     ALOGV("acquiring %d from %d", audioSession, caller);
     int num = mAudioSessionRefs.size();
     for (int i = 0; i< num; i++) {
@@ -5204,18 +5214,14 @@
             return;
         }
     }
-    AudioSessionRef *ref = new AudioSessionRef();
-    ref->sessionid = audioSession;
-    ref->pid = caller;
-    ref->cnt = 1;
-    mAudioSessionRefs.push(ref);
-    ALOGV(" added new entry for %d", ref->sessionid);
+    mAudioSessionRefs.push(new AudioSessionRef(audioSession, caller));
+    ALOGV(" added new entry for %d", audioSession);
 }
 
 void AudioFlinger::releaseAudioSessionId(int audioSession)
 {
     Mutex::Autolock _l(mLock);
-    int caller = IPCThreadState::self()->getCallingPid();
+    pid_t caller = IPCThreadState::self()->getCallingPid();
     ALOGV("releasing %d from %d", audioSession, caller);
     int num = mAudioSessionRefs.size();
     for (int i = 0; i< num; i++) {
@@ -5364,19 +5370,20 @@
 // ----------------------------------------------------------------------------
 
 
-status_t AudioFlinger::queryNumberEffects(uint32_t *numEffects)
+status_t AudioFlinger::queryNumberEffects(uint32_t *numEffects) const
 {
     Mutex::Autolock _l(mLock);
     return EffectQueryNumberEffects(numEffects);
 }
 
-status_t AudioFlinger::queryEffect(uint32_t index, effect_descriptor_t *descriptor)
+status_t AudioFlinger::queryEffect(uint32_t index, effect_descriptor_t *descriptor) const
 {
     Mutex::Autolock _l(mLock);
     return EffectQueryEffect(index, descriptor);
 }
 
-status_t AudioFlinger::getEffectDescriptor(effect_uuid_t *pUuid, effect_descriptor_t *descriptor)
+status_t AudioFlinger::getEffectDescriptor(effect_uuid_t *pUuid,
+        effect_descriptor_t *descriptor) const
 {
     Mutex::Autolock _l(mLock);
     return EffectGetDescriptor(pUuid, descriptor);
@@ -5725,7 +5732,7 @@
             effect = chain->getEffectFromDesc_l(desc);
         }
 
-        ALOGV("createEffect_l() got effect %p on chain %p", effect == 0 ? 0 : effect.get(), chain.get());
+        ALOGV("createEffect_l() got effect %p on chain %p", effect.get(), chain.get());
 
         if (effect == 0) {
             int id = mAudioFlinger->nextUniqueId();
@@ -5753,7 +5760,7 @@
         // create effect handle and connect it to effect module
         handle = new EffectHandle(effect, client, effectClient, priority);
         lStatus = effect->addHandle(handle);
-        if (enabled) {
+        if (enabled != NULL) {
             *enabled = (int)effect->isEnabled();
         }
     }
@@ -5781,13 +5788,8 @@
 
 sp<AudioFlinger::EffectModule> AudioFlinger::ThreadBase::getEffect_l(int sessionId, int effectId)
 {
-    sp<EffectModule> effect;
-
     sp<EffectChain> chain = getEffectChain_l(sessionId);
-    if (chain != 0) {
-        effect = chain->getEffectFromId_l(effectId);
-    }
-    return effect;
+    return chain != 0 ? chain->getEffectFromId_l(effectId) : 0;
 }
 
 // PlaybackThread::addEffect_l() must be called with AudioFlinger::mLock and
@@ -5872,19 +5874,16 @@
 
 sp<AudioFlinger::EffectChain> AudioFlinger::ThreadBase::getEffectChain_l(int sessionId)
 {
-    sp<EffectChain> chain;
-
     size_t size = mEffectChains.size();
     for (size_t i = 0; i < size; i++) {
         if (mEffectChains[i]->sessionId() == sessionId) {
-            chain = mEffectChains[i];
-            break;
+            return mEffectChains[i];
         }
     }
-    return chain;
+    return 0;
 }
 
-void AudioFlinger::ThreadBase::setMode(uint32_t mode)
+void AudioFlinger::ThreadBase::setMode(audio_mode_t mode)
 {
     Mutex::Autolock _l(mLock);
     size_t size = mEffectChains.size();
@@ -6140,7 +6139,7 @@
     }
 }
 
-status_t AudioFlinger::EffectModule::addHandle(sp<EffectHandle>& handle)
+status_t AudioFlinger::EffectModule::addHandle(const sp<EffectHandle>& handle)
 {
     status_t status;
 
@@ -6187,7 +6186,7 @@
 
     bool enabled = false;
     EffectHandle *hdl = handle.unsafe_get();
-    if (hdl) {
+    if (hdl != NULL) {
         ALOGV("removeHandle() unsafe_get OK");
         enabled = hdl->enabled();
     }
@@ -6214,11 +6213,7 @@
 sp<AudioFlinger::EffectHandle> AudioFlinger::EffectModule::controlHandle()
 {
     Mutex::Autolock _l(mLock);
-    sp<EffectHandle> handle;
-    if (mHandles.size() != 0) {
-        handle = mHandles[0].promote();
-    }
-    return handle;
+    return mHandles.size() != 0 ? mHandles[0].promote() : 0;
 }
 
 void AudioFlinger::EffectModule::disconnect(const wp<EffectHandle>& handle, bool unpiniflast)
@@ -6573,7 +6568,7 @@
     return NO_ERROR;
 }
 
-bool AudioFlinger::EffectModule::isEnabled()
+bool AudioFlinger::EffectModule::isEnabled() const
 {
     switch (mState) {
     case RESTART:
@@ -6589,7 +6584,7 @@
     }
 }
 
-bool AudioFlinger::EffectModule::isProcessEnabled()
+bool AudioFlinger::EffectModule::isProcessEnabled() const
 {
     switch (mState) {
     case RESTART:
@@ -6682,7 +6677,7 @@
     return status;
 }
 
-status_t AudioFlinger::EffectModule::setMode(uint32_t mode)
+status_t AudioFlinger::EffectModule::setMode(audio_mode_t mode)
 {
     Mutex::Autolock _l(mLock);
     status_t status = NO_ERROR;
@@ -6691,7 +6686,7 @@
         uint32_t size = sizeof(status_t);
         status = (*mEffectInterface)->command(mEffectInterface,
                                               EFFECT_CMD_SET_AUDIO_MODE,
-                                              sizeof(int),
+                                              sizeof(audio_mode_t),
                                               &mode,
                                               &size,
                                               &cmdStatus);
@@ -6823,7 +6818,7 @@
     if (mCblkMemory != 0) {
         mCblk = static_cast<effect_param_cblk_t *>(mCblkMemory->pointer());
 
-        if (mCblk) {
+        if (mCblk != NULL) {
             new(mCblk) effect_param_cblk_t();
             mBuffer = (uint8_t *)mCblk + bufOffset;
          }
@@ -6920,7 +6915,8 @@
     // release sp on module => module destructor can be called now
     mEffect.clear();
     if (mClient != 0) {
-        if (mCblk) {
+        if (mCblk != NULL) {
+            // unlike ~TrackBase(), mCblk is never a local new, so don't delete
             mCblk->~effect_param_cblk_t();   // destroy our shared-structure.
         }
         mCblkMemory.clear();            // and free the shared memory
@@ -7005,10 +7001,6 @@
     return mEffect->command(cmdCode, cmdSize, pCmdData, replySize, pReplyData);
 }
 
-sp<IMemory> AudioFlinger::EffectHandle::getCblk() const {
-    return mCblkMemory;
-}
-
 void AudioFlinger::EffectHandle::setControl(bool hasControl, bool signal, bool enabled)
 {
     ALOGV("setControl %p control %d", this, hasControl);
@@ -7050,10 +7042,10 @@
 
 void AudioFlinger::EffectHandle::dump(char* buffer, size_t size)
 {
-    bool locked = mCblk ? tryLock(mCblk->lock) : false;
+    bool locked = mCblk != NULL && tryLock(mCblk->lock);
 
     snprintf(buffer, size, "\t\t\t%05d %05d    %01u    %01u      %05u  %05u\n",
-            (mClient == NULL) ? getpid() : mClient->pid(),
+            (mClient == 0) ? getpid() : mClient->pid(),
             mPriority,
             mHasControl,
             !locked,
@@ -7095,48 +7087,42 @@
 // getEffectFromDesc_l() must be called with ThreadBase::mLock held
 sp<AudioFlinger::EffectModule> AudioFlinger::EffectChain::getEffectFromDesc_l(effect_descriptor_t *descriptor)
 {
-    sp<EffectModule> effect;
     size_t size = mEffects.size();
 
     for (size_t i = 0; i < size; i++) {
         if (memcmp(&mEffects[i]->desc().uuid, &descriptor->uuid, sizeof(effect_uuid_t)) == 0) {
-            effect = mEffects[i];
-            break;
+            return mEffects[i];
         }
     }
-    return effect;
+    return 0;
 }
 
 // getEffectFromId_l() must be called with ThreadBase::mLock held
 sp<AudioFlinger::EffectModule> AudioFlinger::EffectChain::getEffectFromId_l(int id)
 {
-    sp<EffectModule> effect;
     size_t size = mEffects.size();
 
     for (size_t i = 0; i < size; i++) {
         // by convention, return first effect if id provided is 0 (0 is never a valid id)
         if (id == 0 || mEffects[i]->id() == id) {
-            effect = mEffects[i];
-            break;
+            return mEffects[i];
         }
     }
-    return effect;
+    return 0;
 }
 
 // getEffectFromType_l() must be called with ThreadBase::mLock held
 sp<AudioFlinger::EffectModule> AudioFlinger::EffectChain::getEffectFromType_l(
         const effect_uuid_t *type)
 {
-    sp<EffectModule> effect;
     size_t size = mEffects.size();
 
     for (size_t i = 0; i < size; i++) {
         if (memcmp(&mEffects[i]->desc().type, type, sizeof(effect_uuid_t)) == 0) {
-            effect = mEffects[i];
-            break;
+            return mEffects[i];
         }
     }
-    return effect;
+    return 0;
 }
 
 // Must be called with EffectChain::mLock locked
@@ -7341,7 +7327,7 @@
 }
 
 // setMode_l() must be called with PlaybackThread::mLock held
-void AudioFlinger::EffectChain::setMode_l(uint32_t mode)
+void AudioFlinger::EffectChain::setMode_l(audio_mode_t mode)
 {
     size_t size = mEffects.size();
     for (size_t i = 0; i < size; i++) {
@@ -7512,7 +7498,8 @@
             ALOGV("setEffectSuspendedAll_l() add entry for 0");
         }
         if (desc->mRefCount++ == 0) {
-            Vector< sp<EffectModule> > effects = getSuspendEligibleEffects();
+            Vector< sp<EffectModule> > effects;
+            getSuspendEligibleEffects(effects);
             for (size_t i = 0; i < effects.size(); i++) {
                 setEffectSuspended_l(&effects[i]->desc().type, true);
             }
@@ -7563,27 +7550,21 @@
     return true;
 }
 
-Vector< sp<AudioFlinger::EffectModule> > AudioFlinger::EffectChain::getSuspendEligibleEffects()
+void AudioFlinger::EffectChain::getSuspendEligibleEffects(Vector< sp<AudioFlinger::EffectModule> > &effects)
 {
-    Vector< sp<EffectModule> > effects;
+    effects.clear();
     for (size_t i = 0; i < mEffects.size(); i++) {
-        if (!isEffectEligibleForSuspend(mEffects[i]->desc())) {
-            continue;
+        if (isEffectEligibleForSuspend(mEffects[i]->desc())) {
+            effects.add(mEffects[i]);
         }
-        effects.add(mEffects[i]);
     }
-    return effects;
 }
 
 sp<AudioFlinger::EffectModule> AudioFlinger::EffectChain::getEffectIfEnabled(
                                                             const effect_uuid_t *type)
 {
-    sp<EffectModule> effect;
-    effect = getEffectFromType_l(type);
-    if (effect != 0 && !effect->isEnabled()) {
-        effect.clear();
-    }
-    return effect;
+    sp<EffectModule> effect = getEffectFromType_l(type);
+    return effect != 0 && effect->isEnabled() ? effect : 0;
 }
 
 void AudioFlinger::EffectChain::checkSuspendOnEffectEnabled(const sp<EffectModule>& effect,
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index ff8dedb..f63c9ec 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -26,7 +26,7 @@
 #include <media/IAudioFlingerClient.h>
 #include <media/IAudioTrack.h>
 #include <media/IAudioRecord.h>
-#include <media/AudioTrack.h>
+#include <media/AudioSystem.h>
 
 #include <utils/Atomic.h>
 #include <utils/Errors.h>
@@ -70,9 +70,9 @@
     // IAudioFlinger interface
     virtual sp<IAudioTrack> createTrack(
                                 pid_t pid,
-                                int streamType,
+                                audio_stream_type_t streamType,
                                 uint32_t sampleRate,
-                                uint32_t format,
+                                audio_format_t format,
                                 uint32_t channelMask,
                                 int frameCount,
                                 uint32_t flags,
@@ -83,7 +83,7 @@
 
     virtual     uint32_t    sampleRate(int output) const;
     virtual     int         channelCount(int output) const;
-    virtual     uint32_t    format(int output) const;
+    virtual     audio_format_t format(int output) const;
     virtual     size_t      frameCount(int output) const;
     virtual     uint32_t    latency(int output) const;
 
@@ -93,28 +93,28 @@
     virtual     float       masterVolume() const;
     virtual     bool        masterMute() const;
 
-    virtual     status_t    setStreamVolume(int stream, float value, int output);
-    virtual     status_t    setStreamMute(int stream, bool muted);
+    virtual     status_t    setStreamVolume(audio_stream_type_t stream, float value, int output);
+    virtual     status_t    setStreamMute(audio_stream_type_t stream, bool muted);
 
-    virtual     float       streamVolume(int stream, int output) const;
-    virtual     bool        streamMute(int stream) const;
+    virtual     float       streamVolume(audio_stream_type_t stream, int output) const;
+    virtual     bool        streamMute(audio_stream_type_t stream) const;
 
-    virtual     status_t    setMode(int mode);
+    virtual     status_t    setMode(audio_mode_t mode);
 
     virtual     status_t    setMicMute(bool state);
     virtual     bool        getMicMute() const;
 
     virtual     status_t    setParameters(int ioHandle, const String8& keyValuePairs);
-    virtual     String8     getParameters(int ioHandle, const String8& keys);
+    virtual     String8     getParameters(int ioHandle, const String8& keys) const;
 
     virtual     void        registerClient(const sp<IAudioFlingerClient>& client);
 
-    virtual     size_t      getInputBufferSize(uint32_t sampleRate, int format, int channelCount);
-    virtual     unsigned int  getInputFramesLost(int ioHandle);
+    virtual     size_t      getInputBufferSize(uint32_t sampleRate, audio_format_t format, int channelCount) const;
+    virtual     unsigned int  getInputFramesLost(int ioHandle) const;
 
     virtual int openOutput(uint32_t *pDevices,
                                     uint32_t *pSamplingRate,
-                                    uint32_t *pFormat,
+                                    audio_format_t *pFormat,
                                     uint32_t *pChannels,
                                     uint32_t *pLatencyMs,
                                     uint32_t flags);
@@ -129,17 +129,17 @@
 
     virtual int openInput(uint32_t *pDevices,
                             uint32_t *pSamplingRate,
-                            uint32_t *pFormat,
+                            audio_format_t *pFormat,
                             uint32_t *pChannels,
-                            uint32_t acoustics);
+                            audio_in_acoustics_t acoustics);
 
     virtual status_t closeInput(int input);
 
-    virtual status_t setStreamOutput(uint32_t stream, int output);
+    virtual status_t setStreamOutput(audio_stream_type_t stream, int output);
 
     virtual status_t setVoiceVolume(float volume);
 
-    virtual status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, int output);
+    virtual status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, int output) const;
 
     virtual int newAudioSessionId();
 
@@ -147,11 +147,12 @@
 
     virtual void releaseAudioSessionId(int audioSession);
 
-    virtual status_t queryNumberEffects(uint32_t *numEffects);
+    virtual status_t queryNumberEffects(uint32_t *numEffects) const;
 
-    virtual status_t queryEffect(uint32_t index, effect_descriptor_t *descriptor);
+    virtual status_t queryEffect(uint32_t index, effect_descriptor_t *descriptor) const;
 
-    virtual status_t getEffectDescriptor(effect_uuid_t *pUuid, effect_descriptor_t *descriptor);
+    virtual status_t getEffectDescriptor(effect_uuid_t *pUuid,
+                                         effect_descriptor_t *descriptor) const;
 
     virtual sp<IEffect> createEffect(pid_t pid,
                         effect_descriptor_t *pDesc,
@@ -189,7 +190,7 @@
                                 pid_t pid,
                                 int input,
                                 uint32_t sampleRate,
-                                uint32_t format,
+                                audio_format_t format,
                                 uint32_t channelMask,
                                 int frameCount,
                                 uint32_t flags,
@@ -202,11 +203,12 @@
                                 Parcel* reply,
                                 uint32_t flags);
 
-                uint32_t    getMode() { return mMode; }
+               audio_mode_t getMode() const { return mMode; }
 
-                bool        btNrecIsOff() { return mBtNrecIsOff; }
+                bool        btNrecIsOff() const { return mBtNrecIsOff; }
 
 private:
+
                             AudioFlinger();
     virtual                 ~AudioFlinger();
 
@@ -225,16 +227,16 @@
     public:
                             Client(const sp<AudioFlinger>& audioFlinger, pid_t pid);
         virtual             ~Client();
-        const sp<MemoryDealer>&     heap() const;
+        sp<MemoryDealer>    heap() const;
         pid_t               pid() const { return mPid; }
-        sp<AudioFlinger>    audioFlinger() { return mAudioFlinger; }
+        sp<AudioFlinger>    audioFlinger() const { return mAudioFlinger; }
 
     private:
                             Client(const Client&);
                             Client& operator = (const Client&);
-        sp<AudioFlinger>    mAudioFlinger;
-        sp<MemoryDealer>    mMemoryDealer;
-        pid_t               mPid;
+        const sp<AudioFlinger> mAudioFlinger;
+        const sp<MemoryDealer> mMemoryDealer;
+        const pid_t         mPid;
     };
 
     // --- Notification Client ---
@@ -245,7 +247,7 @@
                                                 pid_t pid);
         virtual             ~NotificationClient();
 
-                sp<IAudioFlingerClient>    client() { return mClient; }
+                sp<IAudioFlingerClient> audioFlingerClient() const { return mAudioFlingerClient; }
 
                 // IBinder::DeathRecipient
                 virtual     void        binderDied(const wp<IBinder>& who);
@@ -254,9 +256,9 @@
                             NotificationClient(const NotificationClient&);
                             NotificationClient& operator = (const NotificationClient&);
 
-        sp<AudioFlinger>        mAudioFlinger;
-        pid_t                   mPid;
-        sp<IAudioFlingerClient> mClient;
+        const sp<AudioFlinger>  mAudioFlinger;
+        const pid_t             mPid;
+        const sp<IAudioFlingerClient> mAudioFlingerClient;
     };
 
     class TrackHandle;
@@ -276,17 +278,17 @@
 
     class ThreadBase : public Thread {
     public:
-        ThreadBase (const sp<AudioFlinger>& audioFlinger, int id, uint32_t device);
-        virtual             ~ThreadBase();
 
-
-        enum type {
+        enum type_t {
             MIXER,              // Thread class is MixerThread
             DIRECT,             // Thread class is DirectOutputThread
             DUPLICATING,        // Thread class is DuplicatingThread
             RECORD              // Thread class is RecordThread
         };
 
+        ThreadBase (const sp<AudioFlinger>& audioFlinger, int id, uint32_t device, type_t type);
+        virtual             ~ThreadBase();
+
         status_t dumpBase(int fd, const Vector<String16>& args);
         status_t dumpEffectChains(int fd, const Vector<String16>& args);
 
@@ -315,19 +317,19 @@
                                 TrackBase(const wp<ThreadBase>& thread,
                                         const sp<Client>& client,
                                         uint32_t sampleRate,
-                                        uint32_t format,
+                                        audio_format_t format,
                                         uint32_t channelMask,
                                         int frameCount,
                                         uint32_t flags,
                                         const sp<IMemory>& sharedBuffer,
                                         int sessionId);
-                                ~TrackBase();
+            virtual             ~TrackBase();
 
             virtual status_t    start() = 0;
             virtual void        stop() = 0;
-                    sp<IMemory> getCblk() const;
+                    sp<IMemory> getCblk() const { return mCblkMemory; }
                     audio_track_cblk_t* cblk() const { return mCblk; }
-                    int         sessionId() { return mSessionId; }
+                    int         sessionId() const { return mSessionId; }
 
         protected:
             friend class ThreadBase;
@@ -343,15 +345,15 @@
             virtual status_t getNextBuffer(AudioBufferProvider::Buffer* buffer) = 0;
             virtual void releaseBuffer(AudioBufferProvider::Buffer* buffer);
 
-            uint32_t format() const {
+            audio_format_t format() const {
                 return mFormat;
             }
 
-            int channelCount() const ;
+            int channelCount() const { return mChannelCount; }
 
-            uint32_t channelMask() const;
+            uint32_t channelMask() const { return mChannelMask; }
 
-            int sampleRate() const;
+            int sampleRate() const; // FIXME inline after cblk sr moved
 
             void* getBuffer(uint32_t offset, uint32_t frames) const;
 
@@ -366,19 +368,18 @@
             bool step();
             void reset();
 
-            wp<ThreadBase>      mThread;
-            sp<Client>          mClient;
+            const wp<ThreadBase> mThread;
+            /*const*/ sp<Client> mClient;   // see explanation at ~TrackBase() why not const
             sp<IMemory>         mCblkMemory;
             audio_track_cblk_t* mCblk;
             void*               mBuffer;
             void*               mBufferEnd;
             uint32_t            mFrameCount;
             // we don't really need a lock for these
-            int                 mState;
-            int                 mClientTid;
-            uint32_t            mFormat;
+            track_state         mState;
+            const audio_format_t mFormat;
             uint32_t            mFlags;
-            int                 mSessionId;
+            const int           mSessionId;
             uint8_t             mChannelCount;
             uint32_t            mChannelMask;
         };
@@ -407,11 +408,11 @@
         };
 
         virtual     status_t    initCheck() const = 0;
-                    int         type() const { return mType; }
-                    uint32_t    sampleRate() const;
-                    int         channelCount() const;
-                    uint32_t    format() const;
-                    size_t      frameCount() const;
+                    type_t      type() const { return mType; }
+                    uint32_t    sampleRate() const { return mSampleRate; }
+                    int         channelCount() const { return mChannelCount; }
+                    audio_format_t format() const { return mFormat; }
+                    size_t      frameCount() const { return mFrameCount; }
                     void        wakeUp()    { mWaitWorkCV.broadcast(); }
                     void        exit();
         virtual     bool        checkForNewParameters_l() = 0;
@@ -461,7 +462,7 @@
                     // unlock effect chains after process
                     void unlockEffectChains(Vector<sp <EffectChain> >& effectChains);
                     // set audio mode to all effect chains
-                    void setMode(uint32_t mode);
+                    void setMode(audio_mode_t mode);
                     // get effect module with corresponding ID on specified audio session
                     sp<AudioFlinger::EffectModule> getEffect_l(int sessionId, int effectId);
                     // add and effect module. Also creates the effect chain is none exists for
@@ -529,15 +530,15 @@
         friend class RecordThread;
         friend class RecordTrack;
 
-                    int                     mType;
+                    const type_t            mType;
                     Condition               mWaitWorkCV;
-                    sp<AudioFlinger>        mAudioFlinger;
+                    const sp<AudioFlinger>  mAudioFlinger;
                     uint32_t                mSampleRate;
                     size_t                  mFrameCount;
                     uint32_t                mChannelMask;
                     uint16_t                mChannelCount;
-                    uint16_t                mFrameSize;
-                    uint32_t                mFormat;
+                    size_t                  mFrameSize;
+                    audio_format_t          mFormat;
                     Condition               mParamCond;
                     Vector<String8>         mNewParameters;
                     status_t                mParamStatus;
@@ -552,7 +553,7 @@
                     char                    mName[kNameLength];
                     sp<IPowerManager>       mPowerManager;
                     sp<IBinder>             mWakeLockToken;
-                    sp<PMDeathRecipient>    mDeathRecipient;
+                    const sp<PMDeathRecipient> mDeathRecipient;
                     // list of suspended effects per session and per type. The first vector is
                     // keyed by session ID, the second by type UUID timeLow field
                     KeyedVector< int, KeyedVector< int, sp<SuspendedSessionDesc> > >  mSuspendedSessions;
@@ -573,14 +574,14 @@
         public:
                                 Track(  const wp<ThreadBase>& thread,
                                         const sp<Client>& client,
-                                        int streamType,
+                                        audio_stream_type_t streamType,
                                         uint32_t sampleRate,
-                                        uint32_t format,
+                                        audio_format_t format,
                                         uint32_t channelMask,
                                         int frameCount,
                                         const sp<IMemory>& sharedBuffer,
                                         int sessionId);
-                                ~Track();
+            virtual             ~Track();
 
                     void        dump(char* buffer, size_t size);
             virtual status_t    start();
@@ -590,20 +591,19 @@
                     void        flush();
                     void        destroy();
                     void        mute(bool);
-                    void        setVolume(float left, float right);
                     int name() const {
                         return mName;
                     }
 
-                    int type() const {
+                    audio_stream_type_t type() const {
                         return mStreamType;
                     }
                     status_t    attachAuxEffect(int EffectId);
                     void        setAuxBuffer(int EffectId, int32_t *buffer);
-                    int32_t     *auxBuffer() { return mAuxBuffer; }
+                    int32_t     *auxBuffer() const { return mAuxBuffer; }
                     void        setMainBuffer(int16_t *buffer) { mMainBuffer = buffer; }
-                    int16_t     *mainBuffer() { return mMainBuffer; }
-                    int         auxEffectId() { return mAuxEffectId; }
+                    int16_t     *mainBuffer() const { return mMainBuffer; }
+                    int         auxEffectId() const { return mAuxEffectId; }
 
 
         protected:
@@ -617,7 +617,7 @@
                                 Track& operator = (const Track&);
 
             virtual status_t getNextBuffer(AudioBufferProvider::Buffer* buffer);
-            bool isMuted() { return mMute; }
+            bool isMuted() const { return mMute; }
             bool isPausing() const {
                 return mState == PAUSING;
             }
@@ -633,7 +633,6 @@
             }
 
             // we don't really need a lock for these
-            float               mVolume[2];
             volatile bool       mMute;
             // FILLED state is used for suppressing volume ramp at begin of playing
             enum {FS_FILLING, FS_FILLED, FS_ACTIVE};
@@ -641,7 +640,7 @@
             int8_t              mRetryCount;
             sp<IMemory>         mSharedBuffer;
             bool                mResetDone;
-            int                 mStreamType;
+            audio_stream_type_t mStreamType;
             int                 mName;
             int16_t             *mMainBuffer;
             int32_t             *mAuxBuffer;
@@ -662,20 +661,24 @@
                                 OutputTrack(  const wp<ThreadBase>& thread,
                                         DuplicatingThread *sourceThread,
                                         uint32_t sampleRate,
-                                        uint32_t format,
+                                        audio_format_t format,
                                         uint32_t channelMask,
                                         int frameCount);
-                                ~OutputTrack();
+            virtual             ~OutputTrack();
 
             virtual status_t    start();
             virtual void        stop();
                     bool        write(int16_t* data, uint32_t frames);
-                    bool        bufferQueueEmpty() { return (mBufferQueue.size() == 0) ? true : false; }
-                    bool        isActive() { return mActive; }
-            wp<ThreadBase>&     thread()  { return mThread; }
+                    bool        bufferQueueEmpty() const { return (mBufferQueue.size() == 0) ? true : false; }
+                    bool        isActive() const { return mActive; }
+            const wp<ThreadBase>& thread() const { return mThread; }
 
         private:
 
+            enum {
+                NO_MORE_BUFFERS = 0x80000001,   // same in AudioTrack.h, ok to be different value
+            };
+
             status_t            obtainBuffer(AudioBufferProvider::Buffer* buffer, uint32_t waitTimeMs);
             void                clearBufferQueue();
 
@@ -685,10 +688,11 @@
             Vector < Buffer* >          mBufferQueue;
             AudioBufferProvider::Buffer mOutBuffer;
             bool                        mActive;
-            DuplicatingThread*          mSourceThread;
+            DuplicatingThread* const mSourceThread; // for waitTimeMs() in write()
         };  // end of OutputTrack
 
-        PlaybackThread (const sp<AudioFlinger>& audioFlinger, AudioStreamOut* output, int id, uint32_t device);
+        PlaybackThread (const sp<AudioFlinger>& audioFlinger, AudioStreamOut* output, int id,
+                        uint32_t device, type_t type);
         virtual             ~PlaybackThread();
 
         virtual     status_t    dump(int fd, const Vector<String16>& args);
@@ -704,27 +708,27 @@
         virtual     status_t    setMasterVolume(float value);
         virtual     status_t    setMasterMute(bool muted);
 
-        virtual     float       masterVolume() const;
-        virtual     bool        masterMute() const;
+        virtual     float       masterVolume() const { return mMasterVolume; }
+        virtual     bool        masterMute() const { return mMasterMute; }
 
-        virtual     status_t    setStreamVolume(int stream, float value);
-        virtual     status_t    setStreamMute(int stream, bool muted);
+        virtual     status_t    setStreamVolume(audio_stream_type_t stream, float value);
+        virtual     status_t    setStreamMute(audio_stream_type_t stream, bool muted);
 
-        virtual     float       streamVolume(int stream) const;
-        virtual     bool        streamMute(int stream) const;
+        virtual     float       streamVolume(audio_stream_type_t stream) const;
+        virtual     bool        streamMute(audio_stream_type_t stream) const;
 
                     sp<Track>   createTrack_l(
                                     const sp<AudioFlinger::Client>& client,
-                                    int streamType,
+                                    audio_stream_type_t streamType,
                                     uint32_t sampleRate,
-                                    uint32_t format,
+                                    audio_format_t format,
                                     uint32_t channelMask,
                                     int frameCount,
                                     const sp<IMemory>& sharedBuffer,
                                     int sessionId,
                                     status_t *status);
 
-                    AudioStreamOut* getOutput();
+                    AudioStreamOut* getOutput() const;
                     AudioStreamOut* clearOutput();
                     virtual audio_stream_t* stream();
 
@@ -734,7 +738,7 @@
         virtual     String8     getParameters(const String8& keys);
         virtual     void        audioConfigChanged_l(int event, int param = 0);
         virtual     status_t    getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames);
-                    int16_t     *mixBuffer() { return mMixBuffer; };
+                    int16_t     *mixBuffer() const { return mMixBuffer; };
 
         virtual     void detachAuxEffect_l(int effectId);
                     status_t attachAuxEffect(const sp<AudioFlinger::PlaybackThread::Track> track,
@@ -747,7 +751,7 @@
                     virtual uint32_t hasAudioSession(int sessionId);
                     virtual uint32_t getStrategyForSession_l(int sessionId);
 
-                            void setStreamValid(int streamType, bool valid);
+                            void setStreamValid(audio_stream_type_t streamType, bool valid);
 
         struct  stream_type_t {
             stream_type_t()
@@ -765,7 +769,9 @@
         int16_t*                        mMixBuffer;
         int                             mSuspended;
         int                             mBytesWritten;
+    private:
         bool                            mMasterMute;
+    protected:
         SortedVector< wp<Track> >       mActiveTracks;
 
         virtual int             getTrackName_l() = 0;
@@ -797,9 +803,9 @@
         status_t    dumpTracks(int fd, const Vector<String16>& args);
 
         SortedVector< sp<Track> >       mTracks;
-        // mStreamTypes[] uses 1 additionnal stream type internally for the OutputTrack used by DuplicatingThread
+        // mStreamTypes[] uses 1 additional stream type internally for the OutputTrack used by DuplicatingThread
         stream_type_t                   mStreamTypes[AUDIO_STREAM_CNT + 1];
-        AudioStreamOut*                 mOutput;
+        AudioStreamOut                  *mOutput;
         float                           mMasterVolume;
         nsecs_t                         mLastWriteTime;
         int                             mNumWrites;
@@ -812,32 +818,34 @@
         MixerThread (const sp<AudioFlinger>& audioFlinger,
                      AudioStreamOut* output,
                      int id,
-                     uint32_t device);
+                     uint32_t device,
+                     type_t type = MIXER);
         virtual             ~MixerThread();
 
         // Thread virtuals
         virtual     bool        threadLoop();
 
-                    void        invalidateTracks(int streamType);
+                    void        invalidateTracks(audio_stream_type_t streamType);
         virtual     bool        checkForNewParameters_l();
         virtual     status_t    dumpInternals(int fd, const Vector<String16>& args);
 
     protected:
-                    uint32_t    prepareTracks_l(const SortedVector< wp<Track> >& activeTracks,
+                    mixer_state prepareTracks_l(const SortedVector< wp<Track> >& activeTracks,
                                                 Vector< sp<Track> > *tracksToRemove);
         virtual     int         getTrackName_l();
         virtual     void        deleteTrackName_l(int name);
         virtual     uint32_t    idleSleepTimeUs();
         virtual     uint32_t    suspendSleepTimeUs();
 
-        AudioMixer*                     mAudioMixer;
+                    AudioMixer* mAudioMixer;
+                    mixer_state mPrevMixerStatus; // previous status returned by prepareTracks_l()
     };
 
     class DirectOutputThread : public PlaybackThread {
     public:
 
         DirectOutputThread (const sp<AudioFlinger>& audioFlinger, AudioStreamOut* output, int id, uint32_t device);
-        ~DirectOutputThread();
+        virtual                 ~DirectOutputThread();
 
         // Thread virtuals
         virtual     bool        threadLoop();
@@ -863,7 +871,7 @@
     class DuplicatingThread : public MixerThread {
     public:
         DuplicatingThread (const sp<AudioFlinger>& audioFlinger, MixerThread* mainThread, int id);
-        ~DuplicatingThread();
+        virtual                 ~DuplicatingThread();
 
         // Thread virtuals
         virtual     bool        threadLoop();
@@ -884,7 +892,7 @@
               PlaybackThread *checkPlaybackThread_l(int output) const;
               MixerThread *checkMixerThread_l(int output) const;
               RecordThread *checkRecordThread_l(int input) const;
-              float streamVolumeInternal(int stream) const { return mStreamTypes[stream].volume; }
+              float streamVolumeInternal(audio_stream_type_t stream) const { return mStreamTypes[stream].volume; }
               void audioConfigChanged_l(int event, int ioHandle, void *param2);
 
               uint32_t nextUniqueId();
@@ -901,18 +909,17 @@
     public:
                             TrackHandle(const sp<PlaybackThread::Track>& track);
         virtual             ~TrackHandle();
+        virtual sp<IMemory> getCblk() const;
         virtual status_t    start();
         virtual void        stop();
         virtual void        flush();
         virtual void        mute(bool);
         virtual void        pause();
-        virtual void        setVolume(float left, float right);
-        virtual sp<IMemory> getCblk() const;
         virtual status_t    attachAuxEffect(int effectId);
         virtual status_t onTransact(
             uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags);
     private:
-        sp<PlaybackThread::Track> mTrack;
+        const sp<PlaybackThread::Track> mTrack;
     };
 
     friend class Client;
@@ -934,12 +941,12 @@
                                 RecordTrack(const wp<ThreadBase>& thread,
                                         const sp<Client>& client,
                                         uint32_t sampleRate,
-                                        uint32_t format,
+                                        audio_format_t format,
                                         uint32_t channelMask,
                                         int frameCount,
                                         uint32_t flags,
                                         int sessionId);
-                                ~RecordTrack();
+            virtual             ~RecordTrack();
 
             virtual status_t    start();
             virtual void        stop();
@@ -968,7 +975,7 @@
                         uint32_t channels,
                         int id,
                         uint32_t device);
-                ~RecordThread();
+                virtual     ~RecordThread();
 
         virtual bool        threadLoop();
         virtual status_t    readyToRun();
@@ -978,7 +985,7 @@
                 sp<AudioFlinger::RecordThread::RecordTrack>  createRecordTrack_l(
                         const sp<AudioFlinger::Client>& client,
                         uint32_t sampleRate,
-                        int format,
+                        audio_format_t format,
                         int channelMask,
                         int frameCount,
                         uint32_t flags,
@@ -988,7 +995,7 @@
                 status_t    start(RecordTrack* recordTrack);
                 void        stop(RecordTrack* recordTrack);
                 status_t    dump(int fd, const Vector<String16>& args);
-                AudioStreamIn* getInput();
+                AudioStreamIn* getInput() const;
                 AudioStreamIn* clearInput();
                 virtual audio_stream_t* stream();
 
@@ -1016,8 +1023,8 @@
                 int16_t                             *mRsmpInBuffer;
                 size_t                              mRsmpInIndex;
                 size_t                              mInputBytes;
-                int                                 mReqChannelCount;
-                uint32_t                            mReqSampleRate;
+                const int                           mReqChannelCount;
+                const uint32_t                      mReqSampleRate;
                 ssize_t                             mBytesRead;
     };
 
@@ -1025,13 +1032,13 @@
     public:
         RecordHandle(const sp<RecordThread::RecordTrack>& recordTrack);
         virtual             ~RecordHandle();
+        virtual sp<IMemory> getCblk() const;
         virtual status_t    start();
         virtual void        stop();
-        virtual sp<IMemory> getCblk() const;
         virtual status_t onTransact(
             uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags);
     private:
-        sp<RecordThread::RecordTrack> mRecordTrack;
+        const sp<RecordThread::RecordTrack> mRecordTrack;
     };
 
     //--- Audio Effect Management
@@ -1057,7 +1064,7 @@
                         effect_descriptor_t *desc,
                         int id,
                         int sessionId);
-        ~EffectModule();
+        virtual ~EffectModule();
 
         enum effect_state {
             IDLE,
@@ -1069,7 +1076,7 @@
             DESTROYED
         };
 
-        int         id() { return mId; }
+        int         id() const { return mId; }
         void process();
         void updateState();
         status_t command(uint32_t cmdCode,
@@ -1081,18 +1088,18 @@
         void reset_l();
         status_t configure();
         status_t init();
-        uint32_t state() {
+        effect_state state() const {
             return mState;
         }
         uint32_t status() {
             return mStatus;
         }
-        int sessionId() {
+        int sessionId() const {
             return mSessionId;
         }
         status_t    setEnabled(bool enabled);
-        bool isEnabled();
-        bool isProcessEnabled();
+        bool isEnabled() const;
+        bool isProcessEnabled() const;
 
         void        setInBuffer(int16_t *buffer) { mConfig.inputCfg.buffer.s16 = buffer; }
         int16_t     *inBuffer() { return mConfig.inputCfg.buffer.s16; }
@@ -1100,9 +1107,9 @@
         int16_t     *outBuffer() { return mConfig.outputCfg.buffer.s16; }
         void        setChain(const wp<EffectChain>& chain) { mChain = chain; }
         void        setThread(const wp<ThreadBase>& thread) { mThread = thread; }
-        wp<ThreadBase>& thread() { return mThread; }
+        const wp<ThreadBase>& thread() { return mThread; }
 
-        status_t addHandle(sp<EffectHandle>& handle);
+        status_t addHandle(const sp<EffectHandle>& handle);
         void disconnect(const wp<EffectHandle>& handle, bool unpiniflast);
         size_t removeHandle (const wp<EffectHandle>& handle);
 
@@ -1111,7 +1118,7 @@
 
         status_t         setDevice(uint32_t device);
         status_t         setVolume(uint32_t *left, uint32_t *right, bool controller);
-        status_t         setMode(uint32_t mode);
+        status_t         setMode(audio_mode_t mode);
         status_t         start();
         status_t         stop();
         void             setSuspended(bool suspended);
@@ -1119,7 +1126,7 @@
 
         sp<EffectHandle> controlHandle();
 
-        bool             isPinned() { return mPinned; }
+        bool             isPinned() const { return mPinned; }
         void             unPin() { mPinned = false; }
 
         status_t         dump(int fd, const Vector<String16>& args);
@@ -1146,8 +1153,8 @@
         effect_descriptor_t mDescriptor;// effect descriptor received from effect engine
         effect_config_t     mConfig;    // input and output audio configuration
         effect_handle_t  mEffectInterface; // Effect module C API
-        status_t mStatus;               // initialization status
-        uint32_t mState;                // current activation state (effect_state)
+        status_t            mStatus;    // initialization status
+        effect_state        mState;     // current activation state
         Vector< wp<EffectHandle> > mHandles;    // list of client handles
         uint32_t mMaxDisableWaitCnt;    // maximum grace period before forcing an effect off after
                                         // sending disable command.
@@ -1180,7 +1187,7 @@
                                  void *pReplyData);
         virtual void disconnect();
         virtual void disconnect(bool unpiniflast);
-        virtual sp<IMemory> getCblk() const;
+        virtual sp<IMemory> getCblk() const { return mCblkMemory; }
         virtual status_t onTransact(uint32_t code, const Parcel& data,
                 Parcel* reply, uint32_t flags);
 
@@ -1196,13 +1203,13 @@
                              uint32_t replySize,
                              void *pReplyData);
         void setEnabled(bool enabled);
-        bool enabled() { return mEnabled; }
+        bool enabled() const { return mEnabled; }
 
         // Getters
-        int id() { return mEffect->id(); }
-        int priority() { return mPriority; }
-        bool hasControl() { return mHasControl; }
-        sp<EffectModule> effect() { return mEffect; }
+        int id() const { return mEffect->id(); }
+        int priority() const { return mPriority; }
+        bool hasControl() const { return mHasControl; }
+        sp<EffectModule> effect() const { return mEffect; }
 
         void dump(char* buffer, size_t size);
 
@@ -1234,7 +1241,7 @@
     class EffectChain: public RefBase {
     public:
         EffectChain(const wp<ThreadBase>& wThread, int sessionId);
-        ~EffectChain();
+        virtual ~EffectChain();
 
         // special key used for an entry in mSuspendedEffects keyed vector
         // corresponding to a suspend all request.
@@ -1256,7 +1263,7 @@
         status_t addEffect_l(const sp<EffectModule>& handle);
         size_t removeEffect_l(const sp<EffectModule>& handle);
 
-        int sessionId() { return mSessionId; }
+        int sessionId() const { return mSessionId; }
         void setSessionId(int sessionId) { mSessionId = sessionId; }
 
         sp<EffectModule> getEffectFromDesc_l(effect_descriptor_t *descriptor);
@@ -1264,32 +1271,32 @@
         sp<EffectModule> getEffectFromType_l(const effect_uuid_t *type);
         bool setVolume_l(uint32_t *left, uint32_t *right);
         void setDevice_l(uint32_t device);
-        void setMode_l(uint32_t mode);
+        void setMode_l(audio_mode_t mode);
 
         void setInBuffer(int16_t *buffer, bool ownsBuffer = false) {
             mInBuffer = buffer;
             mOwnInBuffer = ownsBuffer;
         }
-        int16_t *inBuffer() {
+        int16_t *inBuffer() const {
             return mInBuffer;
         }
         void setOutBuffer(int16_t *buffer) {
             mOutBuffer = buffer;
         }
-        int16_t *outBuffer() {
+        int16_t *outBuffer() const {
             return mOutBuffer;
         }
 
         void incTrackCnt() { android_atomic_inc(&mTrackCnt); }
         void decTrackCnt() { android_atomic_dec(&mTrackCnt); }
-        int32_t trackCnt() { return mTrackCnt;}
+        int32_t trackCnt() const { return mTrackCnt;}
 
         void incActiveTrackCnt() { android_atomic_inc(&mActiveTrackCnt);
                                    mTailBufferCount = mMaxTailBuffers; }
         void decActiveTrackCnt() { android_atomic_dec(&mActiveTrackCnt); }
-        int32_t activeTrackCnt() { return mActiveTrackCnt;}
+        int32_t activeTrackCnt() const { return mActiveTrackCnt;}
 
-        uint32_t strategy() { return mStrategy; }
+        uint32_t strategy() const { return mStrategy; }
         void setStrategy(uint32_t strategy)
                  { mStrategy = strategy; }
 
@@ -1320,7 +1327,8 @@
 
         // get a list of effect modules to suspend when an effect of the type
         // passed is enabled.
-        Vector< sp<EffectModule> > getSuspendEligibleEffects();
+        void                       getSuspendEligibleEffects(Vector< sp<EffectModule> > &effects);
+
         // get an effect module if it is currently enable
         sp<EffectModule> getEffectIfEnabled(const effect_uuid_t *type);
         // true if the effect whose descriptor is passed can be suspended
@@ -1351,25 +1359,32 @@
         KeyedVector< int, sp<SuspendedEffectDesc> > mSuspendedEffects;
     };
 
+    // AudioStreamOut and AudioStreamIn are immutable, so their fields are const.
+    // For emphasis, we could also make all pointers to them be "const *",
+    // but that would clutter the code unnecessarily.
+
     struct AudioStreamOut {
-        audio_hw_device_t   *hwDev;
-        audio_stream_out_t  *stream;
+        audio_hw_device_t*  const hwDev;
+        audio_stream_out_t* const stream;
 
         AudioStreamOut(audio_hw_device_t *dev, audio_stream_out_t *out) :
             hwDev(dev), stream(out) {}
     };
 
     struct AudioStreamIn {
-        audio_hw_device_t   *hwDev;
-        audio_stream_in_t   *stream;
+        audio_hw_device_t* const hwDev;
+        audio_stream_in_t* const stream;
 
         AudioStreamIn(audio_hw_device_t *dev, audio_stream_in_t *in) :
             hwDev(dev), stream(in) {}
     };
 
     struct AudioSessionRef {
-        int sessionid;
-        pid_t pid;
+        // FIXME rename parameter names when fields get "m" prefix
+        AudioSessionRef(int sessionid_, pid_t pid_) :
+            sessionid(sessionid_), pid(pid_), cnt(1) {}
+        const int sessionid;
+        const pid_t pid;
         int cnt;
     };
 
@@ -1383,11 +1398,13 @@
                 mutable     Mutex                   mHardwareLock;
                 audio_hw_device_t*                  mPrimaryHardwareDev;
                 Vector<audio_hw_device_t*>          mAudioHwDevs;
-    mutable     int                                 mHardwareStatus;
+    mutable     hardware_call_state                 mHardwareStatus;    // for dump only
 
 
                 DefaultKeyedVector< int, sp<PlaybackThread> >  mPlaybackThreads;
                 PlaybackThread::stream_type_t       mStreamTypes[AUDIO_STREAM_CNT];
+
+                // both are protected by mLock
                 float                               mMasterVolume;
                 bool                                mMasterMute;
 
@@ -1395,10 +1412,13 @@
 
                 DefaultKeyedVector< pid_t, sp<NotificationClient> >    mNotificationClients;
                 volatile int32_t                    mNextUniqueId;
-                uint32_t                            mMode;
+                audio_mode_t                        mMode;
                 bool                                mBtNrecIsOff;
 
                 Vector<AudioSessionRef*> mAudioSessionRefs;
+
+                float       masterVolume_l() const  { return mMasterVolume; }
+                bool        masterMute_l() const    { return mMasterMute; }
 };
 
 
diff --git a/services/audioflinger/AudioMixer.cpp b/services/audioflinger/AudioMixer.cpp
index 8df4605..191520a 100644
--- a/services/audioflinger/AudioMixer.cpp
+++ b/services/audioflinger/AudioMixer.cpp
@@ -48,9 +48,10 @@
     mState.enabledTracks= 0;
     mState.needsChanged = 0;
     mState.frameCount   = frameCount;
+    mState.hook         = process__nop;
     mState.outputTemp   = NULL;
     mState.resampleTemp = NULL;
-    mState.hook         = process__nop;
+    // mState.reserved
     track_t* t = mState.tracks;
     for (unsigned i=0 ; i < MAX_NUM_TRACKS ; i++) {
         t->needs = 0;
@@ -67,15 +68,16 @@
         // t->prevAuxLevel
         // t->frameCount
         t->channelCount = 2;
-        t->enabled = 0;
+        t->enabled = false;
         t->format = 16;
         t->channelMask = AUDIO_CHANNEL_OUT_STEREO;
-        t->buffer.raw = 0;
         t->bufferProvider = NULL;
+        t->buffer.raw = NULL;
+        // t->buffer.frameCount
         t->hook = NULL;
+        t->in = NULL;
         t->resampler = NULL;
         t->sampleRate = mSampleRate;
-        t->in = NULL;
         t->mainBuffer = NULL;
         t->auxBuffer = NULL;
         t++;
@@ -119,11 +121,11 @@
     assert(uint32_t(name) < MAX_NUM_TRACKS);
     ALOGV("deleteTrackName(%d)", name);
     track_t& track(mState.tracks[ name ]);
-    if (track.enabled != 0) {
-        track.enabled = 0;
+    if (track.enabled) {
+        track.enabled = false;
         invalidateState(1<<name);
     }
-    if (track.resampler) {
+    if (track.resampler != NULL) {
         // delete  the resampler
         delete track.resampler;
         track.resampler = NULL;
@@ -141,8 +143,8 @@
     assert(uint32_t(name) < MAX_NUM_TRACKS);
     track_t& track = mState.tracks[name];
 
-    if (track.enabled != 1) {
-        track.enabled = 1;
+    if (!track.enabled) {
+        track.enabled = true;
         ALOGV("enable(%d)", name);
         invalidateState(1 << name);
     }
@@ -154,8 +156,8 @@
     assert(uint32_t(name) < MAX_NUM_TRACKS);
     track_t& track = mState.tracks[name];
 
-    if (track.enabled != 0) {
-        track.enabled = 0;
+    if (track.enabled) {
+        track.enabled = false;
         ALOGV("disable(%d)", name);
         invalidateState(1 << name);
     }
@@ -294,22 +296,10 @@
     return false;
 }
 
-bool AudioMixer::track_t::doesResample() const
-{
-    return resampler != NULL;
-}
-
-void AudioMixer::track_t::resetResampler()
-{
-    if (resampler != NULL) {
-        resampler->reset();
-    }
-}
-
 inline
 void AudioMixer::track_t::adjustVolumeRamp(bool aux)
 {
-    for (int i=0 ; i<MAX_NUM_CHANNELS ; i++) {
+    for (uint32_t i=0 ; i<MAX_NUM_CHANNELS ; i++) {
         if (((volumeInc[i]>0) && (((prevVolume[i]+volumeInc[i])>>16) >= volume[i])) ||
             ((volumeInc[i]<0) && (((prevVolume[i]+volumeInc[i])>>16) <= volume[i]))) {
             volumeInc[i] = 0;
@@ -325,20 +315,11 @@
     }
 }
 
-size_t AudioMixer::track_t::getUnreleasedFrames()
-{
-    if (resampler != NULL) {
-        return resampler->getUnreleasedFrames();
-    }
-    return 0;
-}
-
-size_t AudioMixer::getUnreleasedFrames(int name)
+size_t AudioMixer::getUnreleasedFrames(int name) const
 {
     name -= TRACK0;
     if (uint32_t(name) < MAX_NUM_TRACKS) {
-        track_t& track(mState.tracks[name]);
-        return track.getUnreleasedFrames();
+        return mState.tracks[name].getUnreleasedFrames();
     }
     return 0;
 }
@@ -381,9 +362,9 @@
 
     // compute everything we need...
     int countActiveTracks = 0;
-    int all16BitsStereoNoResample = 1;
-    int resampling = 0;
-    int volumeRamp = 0;
+    bool all16BitsStereoNoResample = true;
+    bool resampling = false;
+    bool volumeRamp = false;
     uint32_t en = state->enabledTracks;
     while (en) {
         const int i = 31 - __builtin_clz(en);
@@ -400,7 +381,7 @@
         }
 
         if (t.volumeInc[0]|t.volumeInc[1]) {
-            volumeRamp = 1;
+            volumeRamp = true;
         } else if (!t.doesResample() && t.volumeRL == 0) {
             n |= NEEDS_MUTE_ENABLED;
         }
@@ -410,16 +391,16 @@
             t.hook = track__nop;
         } else {
             if ((n & NEEDS_AUX__MASK) == NEEDS_AUX_ENABLED) {
-                all16BitsStereoNoResample = 0;
+                all16BitsStereoNoResample = false;
             }
             if ((n & NEEDS_RESAMPLE__MASK) == NEEDS_RESAMPLE_ENABLED) {
-                all16BitsStereoNoResample = 0;
-                resampling = 1;
+                all16BitsStereoNoResample = false;
+                resampling = true;
                 t.hook = track__genericResample;
             } else {
                 if ((n & NEEDS_CHANNEL_COUNT__MASK) == NEEDS_CHANNEL_1){
                     t.hook = track__16BitsMono;
-                    all16BitsStereoNoResample = 0;
+                    all16BitsStereoNoResample = false;
                 }
                 if ((n & NEEDS_CHANNEL_COUNT__MASK) == NEEDS_CHANNEL_2){
                     t.hook = track__16BitsStereo;
@@ -467,7 +448,7 @@
     // Now that the volume ramp has been done, set optimal state and
     // track hooks for subsequent mixer process
     if (countActiveTracks) {
-        int allMuted = 1;
+        bool allMuted = true;
         uint32_t en = state->enabledTracks;
         while (en) {
             const int i = 31 - __builtin_clz(en);
@@ -478,7 +459,7 @@
                 t.needs |= NEEDS_MUTE_ENABLED;
                 t.hook = track__nop;
             } else {
-                allMuted = 0;
+                allMuted = false;
             }
         }
         if (allMuted) {
@@ -807,7 +788,7 @@
             while (outFrames) {
                 t1.buffer.frameCount = outFrames;
                 t1.bufferProvider->getNextBuffer(&t1.buffer);
-                if (!t1.buffer.raw) break;
+                if (t1.buffer.raw == NULL) break;
                 outFrames -= t1.buffer.frameCount;
                 t1.bufferProvider->releaseBuffer(&t1.buffer);
             }
@@ -1127,9 +1108,7 @@
         }
     }
 
-    if (buff != NULL) {
-        delete [] buff;
-    }
+    delete [] buff;
 }
 #endif
 
diff --git a/services/audioflinger/AudioMixer.h b/services/audioflinger/AudioMixer.h
index 84f6330..c709686 100644
--- a/services/audioflinger/AudioMixer.h
+++ b/services/audioflinger/AudioMixer.h
@@ -33,7 +33,7 @@
 public:
                             AudioMixer(size_t frameCount, uint32_t sampleRate);
 
-                            ~AudioMixer();
+    /*virtual*/             ~AudioMixer();  // non-virtual saves a v-table, restore if sub-classed
 
     static const uint32_t MAX_NUM_TRACKS = 32;
     static const uint32_t MAX_NUM_CHANNELS = 2;
@@ -83,7 +83,7 @@
 
     uint32_t    trackNames() const { return mTrackNames; }
 
-    size_t      getUnreleasedFrames(int name);
+    size_t      getUnreleasedFrames(int name) const;
 
 private:
 
@@ -153,10 +153,11 @@
         int32_t*           auxBuffer;
 
         bool        setResampler(uint32_t sampleRate, uint32_t devSampleRate);
-        bool        doesResample() const;
-        void        resetResampler();
+        bool        doesResample() const { return resampler != NULL; }
+        void        resetResampler() { if (resampler != NULL) resampler->reset(); }
         void        adjustVolumeRamp(bool aux);
-        size_t      getUnreleasedFrames();
+        size_t      getUnreleasedFrames() const { return resampler != NULL ?
+                                                    resampler->getUnreleasedFrames() : 0; };
     };
 
     // pad to 32-bytes to fill cache line
diff --git a/services/audioflinger/AudioPolicyService.cpp b/services/audioflinger/AudioPolicyService.cpp
index f572fce..755f51f 100644
--- a/services/audioflinger/AudioPolicyService.cpp
+++ b/services/audioflinger/AudioPolicyService.cpp
@@ -43,11 +43,11 @@
 
 namespace android {
 
-static const char *kDeadlockedString = "AudioPolicyService may be deadlocked\n";
-static const char *kCmdDeadlockedString = "AudioPolicyService command thread may be deadlocked\n";
+static const char kDeadlockedString[] = "AudioPolicyService may be deadlocked\n";
+static const char kCmdDeadlockedString[] = "AudioPolicyService command thread may be deadlocked\n";
 
 static const int kDumpLockRetries = 50;
-static const int kDumpLockSleep = 20000;
+static const int kDumpLockSleepUs = 20000;
 
 static bool checkPermission() {
     if (getpid() == IPCThreadState::self()->getCallingPid()) return true;
@@ -144,9 +144,9 @@
     }
     mInputs.clear();
 
-    if (mpAudioPolicy && mpAudioPolicyDev)
+    if (mpAudioPolicy != NULL && mpAudioPolicyDev != NULL)
         mpAudioPolicyDev->destroy_audio_policy(mpAudioPolicyDev, mpAudioPolicy);
-    if (mpAudioPolicyDev)
+    if (mpAudioPolicyDev != NULL)
         audio_policy_dev_close(mpAudioPolicyDev);
 }
 
@@ -185,7 +185,7 @@
                                                       device_address);
 }
 
-status_t AudioPolicyService::setPhoneState(int state)
+status_t AudioPolicyService::setPhoneState(audio_mode_t state)
 {
     if (mpAudioPolicy == NULL) {
         return NO_INIT;
@@ -193,7 +193,7 @@
     if (!checkPermission()) {
         return PERMISSION_DENIED;
     }
-    if (state < 0 || state >= AUDIO_MODE_CNT) {
+    if (uint32_t(state) >= AUDIO_MODE_CNT) {
         return BAD_VALUE;
     }
 
@@ -207,19 +207,6 @@
     return NO_ERROR;
 }
 
-status_t AudioPolicyService::setRingerMode(uint32_t mode, uint32_t mask)
-{
-    if (mpAudioPolicy == NULL) {
-        return NO_INIT;
-    }
-    if (!checkPermission()) {
-        return PERMISSION_DENIED;
-    }
-
-    mpAudioPolicy->set_ringer_mode(mpAudioPolicy, mode, mask);
-    return NO_ERROR;
-}
-
 status_t AudioPolicyService::setForceUse(audio_policy_force_use_t usage,
                                          audio_policy_forced_cfg_t config)
 {
@@ -254,7 +241,7 @@
 
 audio_io_handle_t AudioPolicyService::getOutput(audio_stream_type_t stream,
                                     uint32_t samplingRate,
-                                    uint32_t format,
+                                    audio_format_t format,
                                     uint32_t channels,
                                     audio_policy_output_flags_t flags)
 {
@@ -300,9 +287,9 @@
     mpAudioPolicy->release_output(mpAudioPolicy, output);
 }
 
-audio_io_handle_t AudioPolicyService::getInput(int inputSource,
+audio_io_handle_t AudioPolicyService::getInput(audio_source_t inputSource,
                                     uint32_t samplingRate,
-                                    uint32_t format,
+                                    audio_format_t format,
                                     uint32_t channels,
                                     audio_in_acoustics_t acoustics,
                                     int audioSession)
@@ -310,6 +297,10 @@
     if (mpAudioPolicy == NULL) {
         return 0;
     }
+    // already checked by client, but double-check in case the client wrapper is bypassed
+    if (uint32_t(inputSource) >= AUDIO_SOURCE_CNT) {
+        return 0;
+    }
     Mutex::Autolock _l(mLock);
     audio_io_handle_t input = mpAudioPolicy->get_input(mpAudioPolicy, inputSource, samplingRate,
                                                        format, channels, acoustics);
@@ -318,7 +309,7 @@
         return input;
     }
     // create audio pre processors according to input source
-    ssize_t index = mInputSources.indexOfKey((audio_source_t)inputSource);
+    ssize_t index = mInputSources.indexOfKey(inputSource);
     if (index < 0) {
         return input;
     }
@@ -400,14 +391,16 @@
     if (!checkPermission()) {
         return PERMISSION_DENIED;
     }
-    if (stream < 0 || stream >= AUDIO_STREAM_CNT) {
+    if (uint32_t(stream) >= AUDIO_STREAM_CNT) {
         return BAD_VALUE;
     }
     mpAudioPolicy->init_stream_volume(mpAudioPolicy, stream, indexMin, indexMax);
     return NO_ERROR;
 }
 
-status_t AudioPolicyService::setStreamVolumeIndex(audio_stream_type_t stream, int index)
+status_t AudioPolicyService::setStreamVolumeIndex(audio_stream_type_t stream,
+                                                  int index,
+                                                  audio_devices_t device)
 {
     if (mpAudioPolicy == NULL) {
         return NO_INIT;
@@ -415,22 +408,38 @@
     if (!checkPermission()) {
         return PERMISSION_DENIED;
     }
-    if (stream < 0 || stream >= AUDIO_STREAM_CNT) {
+    if (uint32_t(stream) >= AUDIO_STREAM_CNT) {
         return BAD_VALUE;
     }
 
-    return mpAudioPolicy->set_stream_volume_index(mpAudioPolicy, stream, index);
+    if (mpAudioPolicy->set_stream_volume_index_for_device) {
+        return mpAudioPolicy->set_stream_volume_index_for_device(mpAudioPolicy,
+                                                                stream,
+                                                                index,
+                                                                device);
+    } else {
+        return mpAudioPolicy->set_stream_volume_index(mpAudioPolicy, stream, index);
+    }
 }
 
-status_t AudioPolicyService::getStreamVolumeIndex(audio_stream_type_t stream, int *index)
+status_t AudioPolicyService::getStreamVolumeIndex(audio_stream_type_t stream,
+                                                  int *index,
+                                                  audio_devices_t device)
 {
     if (mpAudioPolicy == NULL) {
         return NO_INIT;
     }
-    if (stream < 0 || stream >= AUDIO_STREAM_CNT) {
+    if (uint32_t(stream) >= AUDIO_STREAM_CNT) {
         return BAD_VALUE;
     }
-    return mpAudioPolicy->get_stream_volume_index(mpAudioPolicy, stream, index);
+    if (mpAudioPolicy->get_stream_volume_index_for_device) {
+        return mpAudioPolicy->get_stream_volume_index_for_device(mpAudioPolicy,
+                                                                stream,
+                                                                index,
+                                                                device);
+    } else {
+        return mpAudioPolicy->get_stream_volume_index(mpAudioPolicy, stream, index);
+    }
 }
 
 uint32_t AudioPolicyService::getStrategyForStream(audio_stream_type_t stream)
@@ -486,7 +495,7 @@
     return mpAudioPolicy->set_effect_enabled(mpAudioPolicy, id, enabled);
 }
 
-bool AudioPolicyService::isStreamActive(int stream, uint32_t inPastMs) const
+bool AudioPolicyService::isStreamActive(audio_stream_type_t stream, uint32_t inPastMs) const
 {
     if (mpAudioPolicy == NULL) {
         return 0;
@@ -545,7 +554,7 @@
             locked = true;
             break;
         }
-        usleep(kDumpLockSleep);
+        usleep(kDumpLockSleepUs);
     }
     return locked;
 }
@@ -569,7 +578,7 @@
 
 status_t AudioPolicyService::dump(int fd, const Vector<String16>& args)
 {
-    if (checkCallingPermission(String16("android.permission.DUMP")) == false) {
+    if (!checkCallingPermission(String16("android.permission.DUMP"))) {
         dumpPermissionDenial(fd);
     } else {
         bool locked = tryLock(mLock);
@@ -640,7 +649,7 @@
         release_wake_lock(mName.string());
     }
     mAudioCommands.clear();
-    if (mpToneGenerator != NULL) delete mpToneGenerator;
+    delete mpToneGenerator;
 }
 
 void AudioPolicyService::AudioCommandThread::onFirstRef()
@@ -673,8 +682,7 @@
                     ToneData *data = (ToneData *)command->mParam;
                     ALOGV("AudioCommandThread() processing start tone %d on stream %d",
                             data->mType, data->mStream);
-                    if (mpToneGenerator != NULL)
-                        delete mpToneGenerator;
+                    delete mpToneGenerator;
                     mpToneGenerator = new ToneGenerator(data->mStream, 1.0);
                     mpToneGenerator->startTone(data->mType);
                     delete data;
@@ -781,7 +789,8 @@
     return NO_ERROR;
 }
 
-void AudioPolicyService::AudioCommandThread::startToneCommand(int type, int stream)
+void AudioPolicyService::AudioCommandThread::startToneCommand(ToneGenerator::tone_type type,
+        audio_stream_type_t stream)
 {
     AudioCommand *command = new AudioCommand();
     command->mCommand = START_TONE;
@@ -808,7 +817,7 @@
     mWaitWorkCV.signal();
 }
 
-status_t AudioPolicyService::AudioCommandThread::volumeCommand(int stream,
+status_t AudioPolicyService::AudioCommandThread::volumeCommand(audio_stream_type_t stream,
                                                                float volume,
                                                                int output,
                                                                int delayMs)
@@ -1019,7 +1028,7 @@
                                         audio_io_handle_t output,
                                         int delayMs)
 {
-    return (int)mAudioCommandThread->volumeCommand((int)stream, volume,
+    return (int)mAudioCommandThread->volumeCommand(stream, volume,
                                                    (int)output, delayMs);
 }
 
@@ -1051,7 +1060,7 @@
 // Audio pre-processing configuration
 // ----------------------------------------------------------------------------
 
-const char *AudioPolicyService::kInputSourceNames[AUDIO_SOURCE_CNT -1] = {
+/*static*/ const char * const AudioPolicyService::kInputSourceNames[AUDIO_SOURCE_CNT -1] = {
     MIC_SRC_TAG,
     VOICE_UL_SRC_TAG,
     VOICE_DL_SRC_TAG,
@@ -1151,7 +1160,7 @@
     if (param == NULL && value == NULL) {
         // try to parse simple parameter form {int int}
         param = root->first_child;
-        if (param) {
+        if (param != NULL) {
             // Note: that a pair of random strings is read as 0 0
             int *ptr = (int *)fx_param->data;
             int *ptr2 = (int *)((char *)param + sizeof(effect_param_t));
@@ -1347,13 +1356,13 @@
 static audio_io_handle_t aps_open_output(void *service,
                                              uint32_t *pDevices,
                                              uint32_t *pSamplingRate,
-                                             uint32_t *pFormat,
+                                             audio_format_t *pFormat,
                                              uint32_t *pChannels,
                                              uint32_t *pLatencyMs,
                                              audio_policy_output_flags_t flags)
 {
     sp<IAudioFlinger> af = AudioSystem::get_audio_flinger();
-    if (af == NULL) {
+    if (af == 0) {
         ALOGW("%s: could not get AudioFlinger", __func__);
         return 0;
     }
@@ -1367,7 +1376,7 @@
                                                  audio_io_handle_t output2)
 {
     sp<IAudioFlinger> af = AudioSystem::get_audio_flinger();
-    if (af == NULL) {
+    if (af == 0) {
         ALOGW("%s: could not get AudioFlinger", __func__);
         return 0;
     }
@@ -1377,7 +1386,7 @@
 static int aps_close_output(void *service, audio_io_handle_t output)
 {
     sp<IAudioFlinger> af = AudioSystem::get_audio_flinger();
-    if (af == NULL)
+    if (af == 0)
         return PERMISSION_DENIED;
 
     return af->closeOutput(output);
@@ -1386,7 +1395,7 @@
 static int aps_suspend_output(void *service, audio_io_handle_t output)
 {
     sp<IAudioFlinger> af = AudioSystem::get_audio_flinger();
-    if (af == NULL) {
+    if (af == 0) {
         ALOGW("%s: could not get AudioFlinger", __func__);
         return PERMISSION_DENIED;
     }
@@ -1397,7 +1406,7 @@
 static int aps_restore_output(void *service, audio_io_handle_t output)
 {
     sp<IAudioFlinger> af = AudioSystem::get_audio_flinger();
-    if (af == NULL) {
+    if (af == 0) {
         ALOGW("%s: could not get AudioFlinger", __func__);
         return PERMISSION_DENIED;
     }
@@ -1408,12 +1417,12 @@
 static audio_io_handle_t aps_open_input(void *service,
                                             uint32_t *pDevices,
                                             uint32_t *pSamplingRate,
-                                            uint32_t *pFormat,
+                                            audio_format_t *pFormat,
                                             uint32_t *pChannels,
-                                            uint32_t acoustics)
+                                            audio_in_acoustics_t acoustics)
 {
     sp<IAudioFlinger> af = AudioSystem::get_audio_flinger();
-    if (af == NULL) {
+    if (af == 0) {
         ALOGW("%s: could not get AudioFlinger", __func__);
         return 0;
     }
@@ -1425,7 +1434,7 @@
 static int aps_close_input(void *service, audio_io_handle_t input)
 {
     sp<IAudioFlinger> af = AudioSystem::get_audio_flinger();
-    if (af == NULL)
+    if (af == 0)
         return PERMISSION_DENIED;
 
     return af->closeInput(input);
@@ -1435,7 +1444,7 @@
                                      audio_io_handle_t output)
 {
     sp<IAudioFlinger> af = AudioSystem::get_audio_flinger();
-    if (af == NULL)
+    if (af == 0)
         return PERMISSION_DENIED;
 
     return af->setStreamOutput(stream, output);
@@ -1446,7 +1455,7 @@
                                 audio_io_handle_t dst_output)
 {
     sp<IAudioFlinger> af = AudioSystem::get_audio_flinger();
-    if (af == NULL)
+    if (af == 0)
         return PERMISSION_DENIED;
 
     return af->moveEffects(session, (int)src_output, (int)dst_output);
diff --git a/services/audioflinger/AudioPolicyService.h b/services/audioflinger/AudioPolicyService.h
index 88cb1e9..62219e5 100644
--- a/services/audioflinger/AudioPolicyService.h
+++ b/services/audioflinger/AudioPolicyService.h
@@ -58,13 +58,12 @@
     virtual audio_policy_dev_state_t getDeviceConnectionState(
                                                                 audio_devices_t device,
                                                                 const char *device_address);
-    virtual status_t setPhoneState(int state);
-    virtual status_t setRingerMode(uint32_t mode, uint32_t mask);
+    virtual status_t setPhoneState(audio_mode_t state);
     virtual status_t setForceUse(audio_policy_force_use_t usage, audio_policy_forced_cfg_t config);
     virtual audio_policy_forced_cfg_t getForceUse(audio_policy_force_use_t usage);
     virtual audio_io_handle_t getOutput(audio_stream_type_t stream,
                                         uint32_t samplingRate = 0,
-                                        uint32_t format = AUDIO_FORMAT_DEFAULT,
+                                        audio_format_t format = AUDIO_FORMAT_DEFAULT,
                                         uint32_t channels = 0,
                                         audio_policy_output_flags_t flags =
                                             AUDIO_POLICY_OUTPUT_FLAG_INDIRECT);
@@ -75,12 +74,12 @@
                                 audio_stream_type_t stream,
                                 int session = 0);
     virtual void releaseOutput(audio_io_handle_t output);
-    virtual audio_io_handle_t getInput(int inputSource,
+    virtual audio_io_handle_t getInput(audio_source_t inputSource,
                                     uint32_t samplingRate = 0,
-                                    uint32_t format = AUDIO_FORMAT_DEFAULT,
+                                    audio_format_t format = AUDIO_FORMAT_DEFAULT,
                                     uint32_t channels = 0,
                                     audio_in_acoustics_t acoustics =
-                                            (audio_in_acoustics_t)0,
+                                            (audio_in_acoustics_t)0 /*AUDIO_IN_ACOUSTICS_NONE*/,
                                     int audioSession = 0);
     virtual status_t startInput(audio_io_handle_t input);
     virtual status_t stopInput(audio_io_handle_t input);
@@ -88,8 +87,12 @@
     virtual status_t initStreamVolume(audio_stream_type_t stream,
                                       int indexMin,
                                       int indexMax);
-    virtual status_t setStreamVolumeIndex(audio_stream_type_t stream, int index);
-    virtual status_t getStreamVolumeIndex(audio_stream_type_t stream, int *index);
+    virtual status_t setStreamVolumeIndex(audio_stream_type_t stream,
+                                          int index,
+                                          audio_devices_t device);
+    virtual status_t getStreamVolumeIndex(audio_stream_type_t stream,
+                                          int *index,
+                                          audio_devices_t device);
 
     virtual uint32_t getStrategyForStream(audio_stream_type_t stream);
     virtual uint32_t getDevicesForStream(audio_stream_type_t stream);
@@ -102,7 +105,7 @@
                                     int id);
     virtual status_t unregisterEffect(int id);
     virtual status_t setEffectEnabled(int id, bool enabled);
-    virtual bool isStreamActive(int stream, uint32_t inPastMs = 0) const;
+    virtual bool isStreamActive(audio_stream_type_t stream, uint32_t inPastMs = 0) const;
 
     virtual status_t queryDefaultPreProcessing(int audioSession,
                                               effect_descriptor_t *descriptors,
@@ -168,9 +171,10 @@
         virtual     bool        threadLoop();
 
                     void        exit();
-                    void        startToneCommand(int type = 0, int stream = 0);
+                    void        startToneCommand(ToneGenerator::tone_type type,
+                                                 audio_stream_type_t stream);
                     void        stopToneCommand();
-                    status_t    volumeCommand(int stream, float volume, int output, int delayMs = 0);
+                    status_t    volumeCommand(audio_stream_type_t stream, float volume, int output, int delayMs = 0);
                     status_t    parametersCommand(int ioHandle, const char *keyValuePairs, int delayMs = 0);
                     status_t    voiceVolumeCommand(float volume, int delayMs = 0);
                     void        insertCommand_l(AudioCommand *command, int delayMs = 0);
@@ -195,13 +199,13 @@
 
         class ToneData {
         public:
-            int mType;      // tone type (START_TONE only)
-            int mStream;    // stream type (START_TONE only)
+            ToneGenerator::tone_type mType; // tone type (START_TONE only)
+            audio_stream_type_t mStream;    // stream type (START_TONE only)
         };
 
         class VolumeData {
         public:
-            int mStream;
+            audio_stream_type_t mStream;
             float mVolume;
             int mIO;
         };
@@ -250,7 +254,7 @@
         Vector< sp<AudioEffect> >mEffects;
     };
 
-    static const char *kInputSourceNames[AUDIO_SOURCE_CNT -1];
+    static const char * const kInputSourceNames[AUDIO_SOURCE_CNT -1];
 
     void setPreProcessorEnabled(InputDesc *inputDesc, bool enabled);
     status_t loadPreProcessorConfig(const char *path);
diff --git a/services/audioflinger/AudioResampler.cpp b/services/audioflinger/AudioResampler.cpp
index fbdcb62..6e17a4a3 100644
--- a/services/audioflinger/AudioResampler.cpp
+++ b/services/audioflinger/AudioResampler.cpp
@@ -123,19 +123,13 @@
     if ((bitDepth != 16) ||(inChannelCount < 1) || (inChannelCount > 2)) {
         ALOGE("Unsupported sample format, %d bits, %d channels", bitDepth,
                 inChannelCount);
-        // LOG_ASSERT(0);
+        // ALOG_ASSERT(0);
     }
 
     // initialize common members
     mVolume[0] = mVolume[1] = 0;
     mBuffer.frameCount = 0;
 
-    // save format for quick lookup
-    if (inChannelCount == 1) {
-        mFormat = MONO_16_BIT;
-    } else {
-        mFormat = STEREO_16_BIT;
-    }
 }
 
 AudioResampler::~AudioResampler() {
@@ -164,7 +158,7 @@
         AudioBufferProvider* provider) {
 
     // should never happen, but we overflow if it does
-    // LOG_ASSERT(outFrameCount < 32767);
+    // ALOG_ASSERT(outFrameCount < 32767);
 
     // select the appropriate resampler
     switch (mChannelCount) {
@@ -261,7 +255,7 @@
             provider->releaseBuffer(&mBuffer);
 
             // verify that the releaseBuffer resets the buffer frameCount
-            // LOG_ASSERT(mBuffer.frameCount == 0);
+            // ALOG_ASSERT(mBuffer.frameCount == 0);
         }
     }
 
@@ -355,7 +349,7 @@
             provider->releaseBuffer(&mBuffer);
 
             // verify that the releaseBuffer resets the buffer frameCount
-            // LOG_ASSERT(mBuffer.frameCount == 0);
+            // ALOG_ASSERT(mBuffer.frameCount == 0);
         }
     }
 
diff --git a/services/audioflinger/AudioResampler.h b/services/audioflinger/AudioResampler.h
index ffa690a..ee171ff 100644
--- a/services/audioflinger/AudioResampler.h
+++ b/services/audioflinger/AudioResampler.h
@@ -54,7 +54,7 @@
             AudioBufferProvider* provider) = 0;
 
     virtual void reset();
-    virtual size_t getUnreleasedFrames() { return mInputIndex; }
+    virtual size_t getUnreleasedFrames() const { return mInputIndex; }
 
 protected:
     // number of bits for phase fraction - 30 bits allows nearly 2x downsampling
@@ -66,7 +66,6 @@
     // multiplier to calculate fixed point phase increment
     static const double kPhaseMultiplier = 1L << kNumPhaseBits;
 
-    enum format {MONO_16_BIT, STEREO_16_BIT};
     AudioResampler(int bitDepth, int inChannelCount, int32_t sampleRate);
 
     // prevent copying
@@ -83,7 +82,6 @@
         uint32_t mVolumeRL;
     };
     int16_t mTargetVolume[2];
-    format mFormat;
     size_t mInputIndex;
     int32_t mPhaseIncrement;
     uint32_t mPhaseFraction;
diff --git a/services/audioflinger/AudioResamplerCubic.cpp b/services/audioflinger/AudioResamplerCubic.cpp
index 587c7be..47205ba 100644
--- a/services/audioflinger/AudioResamplerCubic.cpp
+++ b/services/audioflinger/AudioResamplerCubic.cpp
@@ -36,7 +36,7 @@
         AudioBufferProvider* provider) {
 
     // should never happen, but we overflow if it does
-    // LOG_ASSERT(outFrameCount < 32767);
+    // ALOG_ASSERT(outFrameCount < 32767);
 
     // select the appropriate resampler
     switch (mChannelCount) {
diff --git a/services/audioflinger/AudioResamplerSinc.h b/services/audioflinger/AudioResamplerSinc.h
index 0e1bc44..f0a07b8 100644
--- a/services/audioflinger/AudioResamplerSinc.h
+++ b/services/audioflinger/AudioResamplerSinc.h
@@ -31,7 +31,7 @@
 public:
     AudioResamplerSinc(int bitDepth, int inChannelCount, int32_t sampleRate);
 
-    ~AudioResamplerSinc();
+    virtual ~AudioResamplerSinc();
 
     virtual void resample(int32_t* out, size_t outFrameCount,
             AudioBufferProvider* provider);
diff --git a/services/camera/libcameraservice/CameraHardwareInterface.h b/services/camera/libcameraservice/CameraHardwareInterface.h
index 34087b5..2ac69f7 100644
--- a/services/camera/libcameraservice/CameraHardwareInterface.h
+++ b/services/camera/libcameraservice/CameraHardwareInterface.h
@@ -635,6 +635,12 @@
         return native_window_set_crop(a, &crop);
     }
 
+    static int __set_timestamp(struct preview_stream_ops *w,
+                               int64_t timestamp) {
+        ANativeWindow *a = anw(w);
+        return native_window_set_buffers_timestamp(a, timestamp);
+    }
+
     static int __set_usage(struct preview_stream_ops* w, int usage)
     {
         ANativeWindow *a = anw(w);
@@ -664,6 +670,7 @@
         mHalPreviewWindow.nw.set_buffer_count = __set_buffer_count;
         mHalPreviewWindow.nw.set_buffers_geometry = __set_buffers_geometry;
         mHalPreviewWindow.nw.set_crop = __set_crop;
+        mHalPreviewWindow.nw.set_timestamp = __set_timestamp;
         mHalPreviewWindow.nw.set_usage = __set_usage;
         mHalPreviewWindow.nw.set_swap_interval = __set_swap_interval;
 
diff --git a/services/input/EventHub.cpp b/services/input/EventHub.cpp
index 6db750ee..296c95e 100644
--- a/services/input/EventHub.cpp
+++ b/services/input/EventHub.cpp
@@ -156,8 +156,6 @@
         mPendingEventCount(0), mPendingEventIndex(0), mPendingINotify(false) {
     acquire_wake_lock(PARTIAL_WAKE_LOCK, WAKE_LOCK_ID);
 
-    mNumCpus = sysconf(_SC_NPROCESSORS_ONLN);
-
     mEpollFd = epoll_create(EPOLL_SIZE_HINT);
     LOG_ALWAYS_FATAL_IF(mEpollFd < 0, "Could not create epoll instance.  errno=%d", errno);
 
@@ -535,7 +533,7 @@
 }
 
 size_t EventHub::getEvents(int timeoutMillis, RawEvent* buffer, size_t bufferSize) {
-    LOG_ASSERT(bufferSize >= 1);
+    ALOG_ASSERT(bufferSize >= 1);
 
     AutoMutex _l(mLock);
 
@@ -648,8 +646,9 @@
                         sizeof(struct input_event) * capacity);
                 if (readSize == 0 || (readSize < 0 && errno == ENODEV)) {
                     // Device was removed before INotify noticed.
-                    ALOGW("could not get event, removed? (fd: %d size: %d bufferSize: %d capacity: %d errno: %d)\n",
-                         device->fd, readSize, bufferSize, capacity, errno);
+                    ALOGW("could not get event, removed? (fd: %d size: %d bufferSize: %d "
+                            "capacity: %d errno: %d)\n",
+                            device->fd, readSize, bufferSize, capacity, errno);
                     deviceChanged = true;
                     closeDeviceLocked(device);
                 } else if (readSize < 0) {
@@ -774,19 +773,6 @@
         } else {
             // Some events occurred.
             mPendingEventCount = size_t(pollResult);
-
-            // On an SMP system, it is possible for the framework to read input events
-            // faster than the kernel input device driver can produce a complete packet.
-            // Because poll() wakes up as soon as the first input event becomes available,
-            // the framework will often end up reading one event at a time until the
-            // packet is complete.  Instead of one call to read() returning 71 events,
-            // it could take 71 calls to read() each returning 1 event.
-            //
-            // Sleep for a short period of time after waking up from the poll() to give
-            // the kernel time to finish writing the entire packet of input events.
-            if (mNumCpus > 1) {
-                usleep(250);
-            }
         }
     }
 
@@ -845,7 +831,7 @@
 
     ALOGV("Opening device: %s", devicePath);
 
-    int fd = open(devicePath, O_RDWR);
+    int fd = open(devicePath, O_RDWR | O_CLOEXEC);
     if(fd < 0) {
         ALOGE("could not open %s, %s\n", devicePath, strerror(errno));
         return -1;
@@ -1077,14 +1063,20 @@
         return -1;
     }
 
+    // Enable wake-lock behavior on kernels that support it.
+    // TODO: Only need this for devices that can really wake the system.
+    bool usingSuspendBlock = ioctl(fd, EVIOCSSUSPENDBLOCK, 1) == 0;
+
     ALOGI("New device: id=%d, fd=%d, path='%s', name='%s', classes=0x%x, "
-            "configuration='%s', keyLayout='%s', keyCharacterMap='%s', builtinKeyboard=%s",
+            "configuration='%s', keyLayout='%s', keyCharacterMap='%s', builtinKeyboard=%s, "
+            "usingSuspendBlock=%s",
          deviceId, fd, devicePath, device->identifier.name.string(),
          device->classes,
          device->configurationFile.string(),
          device->keyMap.keyLayoutFile.string(),
          device->keyMap.keyCharacterMapFile.string(),
-         toString(mBuiltInKeyboardId == deviceId));
+         toString(mBuiltInKeyboardId == deviceId),
+         toString(usingSuspendBlock));
 
     mDevices.add(deviceId, device);
 
diff --git a/services/input/EventHub.h b/services/input/EventHub.h
index 9d8252e..8a2afd3 100644
--- a/services/input/EventHub.h
+++ b/services/input/EventHub.h
@@ -367,9 +367,6 @@
     size_t mPendingEventCount;
     size_t mPendingEventIndex;
     bool mPendingINotify;
-
-    // Set to the number of CPUs.
-    int32_t mNumCpus;
 };
 
 }; // namespace android
diff --git a/services/input/InputDispatcher.cpp b/services/input/InputDispatcher.cpp
index f2994ab..ad64ccd 100644
--- a/services/input/InputDispatcher.cpp
+++ b/services/input/InputDispatcher.cpp
@@ -238,6 +238,8 @@
     nsecs_t nextWakeupTime = LONG_LONG_MAX;
     { // acquire lock
         AutoMutex _l(mLock);
+        mDispatcherIsAliveCondition.broadcast();
+
         dispatchOnceInnerLocked(&nextWakeupTime);
 
         if (runCommandsLockedInterruptible()) {
@@ -376,7 +378,7 @@
 
     // Now we have an event to dispatch.
     // All events are eventually dequeued and processed this way, even if we intend to drop them.
-    LOG_ASSERT(mPendingEvent != NULL);
+    ALOG_ASSERT(mPendingEvent != NULL);
     bool done = false;
     DropReason dropReason = DROP_REASON_NOT_DROPPED;
     if (!(mPendingEvent->policyFlags & POLICY_FLAG_PASS_TO_USER)) {
@@ -445,7 +447,7 @@
     }
 
     default:
-        LOG_ASSERT(false);
+        ALOG_ASSERT(false);
         break;
     }
 
@@ -582,7 +584,7 @@
         reason = "inbound event was dropped because it is stale";
         break;
     default:
-        LOG_ASSERT(false);
+        ALOG_ASSERT(false);
         return;
     }
 
@@ -1017,7 +1019,7 @@
             toString(resumeWithAppendedMotionSample));
 #endif
 
-    LOG_ASSERT(eventEntry->dispatchInProgress); // should already have been set to true
+    ALOG_ASSERT(eventEntry->dispatchInProgress); // should already have been set to true
 
     pokeUserActivityLocked(eventEntry);
 
@@ -1878,7 +1880,7 @@
 
     // Make sure we are never called for streaming when splitting across multiple windows.
     bool isSplit = inputTarget->flags & InputTarget::FLAG_SPLIT;
-    LOG_ASSERT(! (resumeWithAppendedMotionSample && isSplit));
+    ALOG_ASSERT(! (resumeWithAppendedMotionSample && isSplit));
 
     // Skip this event if the connection status is not normal.
     // We don't want to enqueue additional outbound events if the connection is broken.
@@ -1892,7 +1894,7 @@
 
     // Split a motion event if needed.
     if (isSplit) {
-        LOG_ASSERT(eventEntry->type == EventEntry::TYPE_MOTION);
+        ALOG_ASSERT(eventEntry->type == EventEntry::TYPE_MOTION);
 
         MotionEntry* originalMotionEntry = static_cast<MotionEntry*>(eventEntry);
         if (inputTarget->pointerIds.count() != originalMotionEntry->pointerCount) {
@@ -1906,10 +1908,21 @@
                     connection->getInputChannelName());
             logOutboundMotionDetailsLocked("  ", splitMotionEntry);
 #endif
-            eventEntry = splitMotionEntry;
+            enqueueDispatchEntriesLocked(currentTime, connection,
+                    splitMotionEntry, inputTarget, resumeWithAppendedMotionSample);
+            splitMotionEntry->release();
+            return;
         }
     }
 
+    // Not splitting.  Enqueue dispatch entries for the event as is.
+    enqueueDispatchEntriesLocked(currentTime, connection, eventEntry, inputTarget,
+            resumeWithAppendedMotionSample);
+}
+
+void InputDispatcher::enqueueDispatchEntriesLocked(nsecs_t currentTime,
+        const sp<Connection>& connection, EventEntry* eventEntry, const InputTarget* inputTarget,
+        bool resumeWithAppendedMotionSample) {
     // Resume the dispatch cycle with a freshly appended motion sample.
     // First we check that the last dispatch entry in the outbound queue is for the same
     // motion event to which we appended the motion sample.  If we find such a dispatch
@@ -2046,9 +2059,6 @@
     DispatchEntry* dispatchEntry = new DispatchEntry(eventEntry, // increments ref
             inputTargetFlags, inputTarget->xOffset, inputTarget->yOffset,
             inputTarget->scaleFactor);
-    if (dispatchEntry->hasForegroundTarget()) {
-        incrementPendingForegroundDispatchesLocked(eventEntry);
-    }
 
     // Handle the case where we could not stream a new motion sample because the consumer has
     // already consumed the motion event (otherwise the corresponding dispatch entry would
@@ -2077,6 +2087,7 @@
             ALOGD("channel '%s' ~ enqueueDispatchEntryLocked: skipping inconsistent key event",
                     connection->getInputChannelName());
 #endif
+            delete dispatchEntry;
             return; // skip the inconsistent event
         }
         break;
@@ -2118,12 +2129,18 @@
             ALOGD("channel '%s' ~ enqueueDispatchEntryLocked: skipping inconsistent motion event",
                     connection->getInputChannelName());
 #endif
+            delete dispatchEntry;
             return; // skip the inconsistent event
         }
         break;
     }
     }
 
+    // Remember that we are waiting for this dispatch to complete.
+    if (dispatchEntry->hasForegroundTarget()) {
+        incrementPendingForegroundDispatchesLocked(eventEntry);
+    }
+
     // Enqueue the dispatch entry.
     connection->outboundQueue.enqueueAtTail(dispatchEntry);
 }
@@ -2135,11 +2152,11 @@
             connection->getInputChannelName());
 #endif
 
-    LOG_ASSERT(connection->status == Connection::STATUS_NORMAL);
-    LOG_ASSERT(! connection->outboundQueue.isEmpty());
+    ALOG_ASSERT(connection->status == Connection::STATUS_NORMAL);
+    ALOG_ASSERT(! connection->outboundQueue.isEmpty());
 
     DispatchEntry* dispatchEntry = connection->outboundQueue.head;
-    LOG_ASSERT(! dispatchEntry->inProgress);
+    ALOG_ASSERT(! dispatchEntry->inProgress);
 
     // Mark the dispatch entry as in progress.
     dispatchEntry->inProgress = true;
@@ -2271,7 +2288,7 @@
     }
 
     default: {
-        LOG_ASSERT(false);
+        ALOG_ASSERT(false);
     }
     }
 
@@ -2462,14 +2479,17 @@
 
 void InputDispatcher::synthesizeCancelationEventsForConnectionLocked(
         const sp<Connection>& connection, const CancelationOptions& options) {
+    if (connection->status == Connection::STATUS_BROKEN) {
+        return;
+    }
+
     nsecs_t currentTime = now();
 
     mTempCancelationEvents.clear();
     connection->inputState.synthesizeCancelationEvents(currentTime,
             mTempCancelationEvents, options);
 
-    if (! mTempCancelationEvents.isEmpty()
-            && connection->status != Connection::STATUS_BROKEN) {
+    if (!mTempCancelationEvents.isEmpty()) {
 #if DEBUG_OUTBOUND_EVENT_DETAILS
         ALOGD("channel '%s' ~ Synthesized %d cancelation events to bring channel back in sync "
                 "with reality: %s, mode=%d.",
@@ -2518,7 +2538,7 @@
 
 InputDispatcher::MotionEntry*
 InputDispatcher::splitMotionEvent(const MotionEntry* originalMotionEntry, BitSet32 pointerIds) {
-    LOG_ASSERT(pointerIds.value != 0);
+    ALOG_ASSERT(pointerIds.value != 0);
 
     uint32_t splitPointerIndexMap[MAX_POINTERS];
     PointerProperties splitPointerProperties[MAX_POINTERS];
@@ -3936,7 +3956,7 @@
                 return true; // skip next cycle
             }
 
-            LOG_ASSERT(connection->outboundQueue.head == dispatchEntry);
+            ALOG_ASSERT(connection->outboundQueue.head == dispatchEntry);
 
             // Latch the fallback keycode for this key on an initial down.
             // The fallback keycode cannot change at any other point in the lifecycle.
@@ -3949,7 +3969,7 @@
                 connection->inputState.setFallbackKey(originalKeyCode, fallbackKeyCode);
             }
 
-            LOG_ASSERT(fallbackKeyCode != -1);
+            ALOG_ASSERT(fallbackKeyCode != -1);
 
             // Cancel the fallback key if the policy decides not to send it anymore.
             // We will continue to dispatch the key to the policy but we will no
@@ -4068,6 +4088,8 @@
 void InputDispatcher::monitor() {
     // Acquire and release the lock to ensure that the dispatcher has not deadlocked.
     mLock.lock();
+    mLooper->wake();
+    mDispatcherIsAliveCondition.wait(mLock);
     mLock.unlock();
 }
 
@@ -4101,7 +4123,7 @@
     if (refCount == 0) {
         delete this;
     } else {
-        LOG_ASSERT(refCount > 0);
+        ALOG_ASSERT(refCount > 0);
     }
 }
 
@@ -4122,7 +4144,7 @@
     if (refCount == 0) {
         delete this;
     } else {
-        LOG_ASSERT(refCount > 0);
+        ALOG_ASSERT(refCount > 0);
     }
 }
 
diff --git a/services/input/InputDispatcher.h b/services/input/InputDispatcher.h
index 8ae5a56..a1d42e1 100644
--- a/services/input/InputDispatcher.h
+++ b/services/input/InputDispatcher.h
@@ -862,6 +862,8 @@
 
     Mutex mLock;
 
+    Condition mDispatcherIsAliveCondition;
+
     sp<Looper> mLooper;
 
     EventEntry* mPendingEvent;
@@ -1070,6 +1072,9 @@
     void prepareDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection,
             EventEntry* eventEntry, const InputTarget* inputTarget,
             bool resumeWithAppendedMotionSample);
+    void enqueueDispatchEntriesLocked(nsecs_t currentTime, const sp<Connection>& connection,
+            EventEntry* eventEntry, const InputTarget* inputTarget,
+            bool resumeWithAppendedMotionSample);
     void enqueueDispatchEntryLocked(const sp<Connection>& connection,
             EventEntry* eventEntry, const InputTarget* inputTarget,
             bool resumeWithAppendedMotionSample, int32_t dispatchMode);
diff --git a/services/input/InputReader.cpp b/services/input/InputReader.cpp
index bc17272..4be06e4 100644
--- a/services/input/InputReader.cpp
+++ b/services/input/InputReader.cpp
@@ -278,17 +278,20 @@
 
     { // acquire lock
         AutoMutex _l(mLock);
+        mReaderIsAliveCondition.broadcast();
 
         if (count) {
             processEventsLocked(mEventBuffer, count);
         }
         if (!count || timeoutMillis == 0) {
             nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
+            if (now >= mNextTimeout) {
 #if DEBUG_RAW_EVENTS
-            ALOGD("Timeout expired, latency=%0.3fms", (now - mNextTimeout) * 0.000001f);
+                ALOGD("Timeout expired, latency=%0.3fms", (now - mNextTimeout) * 0.000001f);
 #endif
-            mNextTimeout = LLONG_MAX;
-            timeoutExpiredLocked(now);
+                mNextTimeout = LLONG_MAX;
+                timeoutExpiredLocked(now);
+            }
         }
     } // release lock
 
@@ -331,7 +334,7 @@
                 handleConfigurationChangedLocked(rawEvent->when);
                 break;
             default:
-                LOG_ASSERT(false); // can't happen
+                ALOG_ASSERT(false); // can't happen
                 break;
             }
         }
@@ -772,6 +775,8 @@
 void InputReader::monitor() {
     // Acquire and release the lock to ensure that the reader has not deadlocked.
     mLock.lock();
+    mEventHub->wake();
+    mReaderIsAliveCondition.wait(mLock);
     mLock.unlock();
 
     // Check the EventHub
@@ -2148,7 +2153,7 @@
         dump.append(INDENT4 "Mode: navigation\n");
         break;
     default:
-        LOG_ASSERT(false);
+        ALOG_ASSERT(false);
     }
 
     dump.appendFormat(INDENT4 "OrientationAware: %s\n",
@@ -2605,7 +2610,7 @@
         dump.append(INDENT4 "DeviceType: pointer\n");
         break;
     default:
-        LOG_ASSERT(false);
+        ALOG_ASSERT(false);
     }
 
     dump.appendFormat(INDENT4 "AssociatedDisplay: id=%d, isExternal=%s\n",
@@ -3187,7 +3192,7 @@
         dump.append(INDENT4 "touch.size.calibration: area\n");
         break;
     default:
-        LOG_ASSERT(false);
+        ALOG_ASSERT(false);
     }
 
     if (mCalibration.haveSizeScale) {
@@ -3217,7 +3222,7 @@
         dump.append(INDENT4 "touch.pressure.calibration: amplitude\n");
         break;
     default:
-        LOG_ASSERT(false);
+        ALOG_ASSERT(false);
     }
 
     if (mCalibration.havePressureScale) {
@@ -3237,7 +3242,7 @@
         dump.append(INDENT4 "touch.orientation.calibration: vector\n");
         break;
     default:
-        LOG_ASSERT(false);
+        ALOG_ASSERT(false);
     }
 
     // Distance
@@ -3249,7 +3254,7 @@
         dump.append(INDENT4 "touch.distance.calibration: scaled\n");
         break;
     default:
-        LOG_ASSERT(false);
+        ALOG_ASSERT(false);
     }
 
     if (mCalibration.haveDistanceScale) {
@@ -3643,7 +3648,7 @@
         // Although applications receive new locations as part of individual pointer up
         // events, they do not generally handle them except when presented in a move event.
         if (moveNeeded) {
-            LOG_ASSERT(moveIdBits.value == dispatchedIdBits.value);
+            ALOG_ASSERT(moveIdBits.value == dispatchedIdBits.value);
             dispatchMotion(when, policyFlags, mSource,
                     AMOTION_EVENT_ACTION_MOVE, 0, metaState, buttonState, 0,
                     mCurrentCookedPointerData.pointerProperties,
@@ -3754,7 +3759,7 @@
                 size = mRawPointerAxes.toolMinor.valid
                         ? avg(in.toolMajor, in.toolMinor) : in.toolMajor;
             } else {
-                LOG_ASSERT(false, "No touch or tool axes.  "
+                ALOG_ASSERT(false, "No touch or tool axes.  "
                         "Size calibration should have been resolved to NONE.");
                 touchMajor = 0;
                 touchMinor = 0;
@@ -4473,7 +4478,7 @@
         // The pointer follows the active touch point.
         // When in HOVER, emit HOVER_MOVE events at the pointer location.
         // When in TAP_DRAG, emit MOVE events at the pointer location.
-        LOG_ASSERT(activeTouchId >= 0);
+        ALOG_ASSERT(activeTouchId >= 0);
 
         mPointerGesture.currentGestureMode = PointerGesture::HOVER;
         if (mPointerGesture.lastGestureMode == PointerGesture::TAP) {
@@ -4573,7 +4578,7 @@
         //
         // When the two fingers move enough or when additional fingers are added, we make
         // a decision to transition into SWIPE or FREEFORM mode accordingly.
-        LOG_ASSERT(activeTouchId >= 0);
+        ALOG_ASSERT(activeTouchId >= 0);
 
         bool settled = when >= mPointerGesture.firstTouchTime
                 + mConfig.pointerGestureMultitouchSettleInterval;
@@ -4782,7 +4787,7 @@
                     "activeGestureId=%d, currentTouchPointerCount=%d",
                     activeTouchId, mPointerGesture.activeGestureId, currentFingerCount);
 #endif
-            LOG_ASSERT(mPointerGesture.activeGestureId >= 0);
+            ALOG_ASSERT(mPointerGesture.activeGestureId >= 0);
 
             mPointerGesture.currentGestureIdBits.clear();
             mPointerGesture.currentGestureIdBits.markBit(mPointerGesture.activeGestureId);
@@ -4804,7 +4809,7 @@
                     "activeGestureId=%d, currentTouchPointerCount=%d",
                     activeTouchId, mPointerGesture.activeGestureId, currentFingerCount);
 #endif
-            LOG_ASSERT(mPointerGesture.activeGestureId >= 0);
+            ALOG_ASSERT(mPointerGesture.activeGestureId >= 0);
 
             mPointerGesture.currentGestureIdBits.clear();
 
@@ -5172,7 +5177,7 @@
         pointerCount += 1;
     }
 
-    LOG_ASSERT(pointerCount != 0);
+    ALOG_ASSERT(pointerCount != 0);
 
     if (changedId >= 0 && pointerCount == 1) {
         // Replace initial down and final up action.
@@ -5184,7 +5189,7 @@
             action = AMOTION_EVENT_ACTION_UP;
         } else {
             // Can't happen.
-            LOG_ASSERT(false);
+            ALOG_ASSERT(false);
         }
     }
 
diff --git a/services/input/InputReader.h b/services/input/InputReader.h
index a122c97..ad89a22 100644
--- a/services/input/InputReader.h
+++ b/services/input/InputReader.h
@@ -363,6 +363,8 @@
 private:
     Mutex mLock;
 
+    Condition mReaderIsAliveCondition;
+
     sp<EventHubInterface> mEventHub;
     sp<InputReaderPolicyInterface> mPolicy;
     sp<QueuedInputListener> mQueuedListener;
diff --git a/services/java/com/android/server/AppWidgetService.java b/services/java/com/android/server/AppWidgetService.java
index 4f81178..081f1f4 100644
--- a/services/java/com/android/server/AppWidgetService.java
+++ b/services/java/com/android/server/AppWidgetService.java
@@ -24,67 +24,35 @@
 import android.content.ComponentName;
 import android.content.Context;
 import android.content.Intent;
-import android.content.Intent.FilterComparison;
 import android.content.IntentFilter;
 import android.content.ServiceConnection;
-import android.content.pm.ActivityInfo;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageInfo;
 import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-import android.content.pm.ServiceInfo;
-import android.content.res.Resources;
-import android.content.res.TypedArray;
-import android.content.res.XmlResourceParser;
-import android.net.Uri;
 import android.os.Binder;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.HandlerThread;
 import android.os.IBinder;
 import android.os.RemoteException;
-import android.os.SystemClock;
-import android.util.AttributeSet;
-import android.util.Log;
 import android.util.Pair;
 import android.util.Slog;
-import android.util.TypedValue;
-import android.util.Xml;
+import android.util.SparseArray;
 import android.widget.RemoteViews;
 
 import com.android.internal.appwidget.IAppWidgetHost;
 import com.android.internal.appwidget.IAppWidgetService;
-import com.android.internal.os.AtomicFile;
-import com.android.internal.util.FastXmlSerializer;
 import com.android.internal.widget.IRemoteViewsAdapterConnection;
-import com.android.internal.widget.IRemoteViewsFactory;
 
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-import org.xmlpull.v1.XmlSerializer;
-
-import java.io.File;
 import java.io.FileDescriptor;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
 import java.io.PrintWriter;
 import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
-import java.util.Set;
 
+
+/**
+ * Redirects calls to this service to the instance of the service for the appropriate user.
+ */
 class AppWidgetService extends IAppWidgetService.Stub
 {
     private static final String TAG = "AppWidgetService";
 
-    private static final String SETTINGS_FILENAME = "appwidgets.xml";
-    private static final int MIN_UPDATE_PERIOD = 30 * 60 * 1000; // 30 minutes
-
     /*
      * When identifying a Host or Provider based on the calling process, use the uid field.
      * When identifying a Host or Provider based on a package manager broadcast, use the
@@ -125,11 +93,9 @@
      * globally and may lead us to leak AppWidgetService instances (if there were more than one).
      */
     static class ServiceConnectionProxy implements ServiceConnection {
-        private final Pair<Integer, Intent.FilterComparison> mKey;
         private final IBinder mConnectionCb;
 
         ServiceConnectionProxy(Pair<Integer, Intent.FilterComparison> key, IBinder connectionCb) {
-            mKey = key;
             mConnectionCb = connectionCb;
         }
         public void onServiceConnected(ComponentName name, IBinder service) {
@@ -155,13 +121,6 @@
         }
     }
 
-    // Manages active connections to RemoteViewsServices
-    private final HashMap<Pair<Integer, FilterComparison>, ServiceConnection>
-        mBoundRemoteViewsServices = new HashMap<Pair<Integer,FilterComparison>,ServiceConnection>();
-    // Manages persistent references to RemoteViewsServices from different App Widgets
-    private final HashMap<FilterComparison, HashSet<Integer>>
-        mRemoteViewsServicesAppWidgets = new HashMap<FilterComparison, HashSet<Integer>>();
-
     Context mContext;
     Locale mLocale;
     PackageManager mPackageManager;
@@ -171,35 +130,32 @@
     final ArrayList<AppWidgetId> mAppWidgetIds = new ArrayList<AppWidgetId>();
     ArrayList<Host> mHosts = new ArrayList<Host>();
     boolean mSafeMode;
-    boolean mStateLoaded;
 
-    // These are for debugging only -- widgets are going missing in some rare instances
-    ArrayList<Provider> mDeletedProviders = new ArrayList<Provider>();
-    ArrayList<Host> mDeletedHosts = new ArrayList<Host>();
+
+    private final SparseArray<AppWidgetServiceImpl> mAppWidgetServices;
 
     AppWidgetService(Context context) {
         mContext = context;
-        mPackageManager = context.getPackageManager();
-        mAlarmManager = (AlarmManager)mContext.getSystemService(Context.ALARM_SERVICE);
+        mAppWidgetServices = new SparseArray<AppWidgetServiceImpl>(5);
+        AppWidgetServiceImpl primary = new AppWidgetServiceImpl(context, 0);
+        mAppWidgetServices.append(0, primary);
     }
 
     public void systemReady(boolean safeMode) {
         mSafeMode = safeMode;
 
-        synchronized (mAppWidgetIds) {
-            ensureStateLoadedLocked();
-        }
+        mAppWidgetServices.get(0).systemReady(safeMode);
 
         // Register for the boot completed broadcast, so we can send the
-        // ENABLE broacasts.  If we try to send them now, they time out,
+        // ENABLE broacasts. If we try to send them now, they time out,
         // because the system isn't ready to handle them yet.
         mContext.registerReceiver(mBroadcastReceiver,
                 new IntentFilter(Intent.ACTION_BOOT_COMPLETED), null, null);
 
         // Register for configuration changes so we can update the names
         // of the widgets when the locale changes.
-        mContext.registerReceiver(mBroadcastReceiver,
-                new IntentFilter(Intent.ACTION_CONFIGURATION_CHANGED), null, null);
+        mContext.registerReceiver(mBroadcastReceiver, new IntentFilter(
+                Intent.ACTION_CONFIGURATION_CHANGED), null, null);
 
         // Register for broadcasts about package install, etc., so we can
         // update the provider list.
@@ -216,216 +172,24 @@
         mContext.registerReceiver(mBroadcastReceiver, sdFilter);
     }
 
-    private void ensureStateLoadedLocked() {
-        if (!mStateLoaded) {
-            loadAppWidgetList();
-            loadStateLocked();
-            mStateLoaded = true;
-        }
+    @Override
+    public int allocateAppWidgetId(String packageName, int hostId) throws RemoteException {
+        return getImplForUser().allocateAppWidgetId(packageName, hostId);
     }
-
-    private void dumpProvider(Provider p, int index, PrintWriter pw) {
-        AppWidgetProviderInfo info = p.info;
-        pw.print("  ["); pw.print(index); pw.print("] provider ");
-                pw.print(info.provider.flattenToShortString());
-                pw.println(':');
-        pw.print("    min=("); pw.print(info.minWidth);
-                pw.print("x"); pw.print(info.minHeight);
-        pw.print(")   minResize=("); pw.print(info.minResizeWidth);
-                pw.print("x"); pw.print(info.minResizeHeight);
-                pw.print(") updatePeriodMillis=");
-                pw.print(info.updatePeriodMillis);
-                pw.print(" resizeMode=");
-                pw.print(info.resizeMode);
-                pw.print(" autoAdvanceViewId=");
-                pw.print(info.autoAdvanceViewId);
-                pw.print(" initialLayout=#");
-                pw.print(Integer.toHexString(info.initialLayout));
-                pw.print(" zombie="); pw.println(p.zombie);
-    }
-
-    private void dumpHost(Host host, int index, PrintWriter pw) {
-        pw.print("  ["); pw.print(index); pw.print("] hostId=");
-                pw.print(host.hostId); pw.print(' ');
-                pw.print(host.packageName); pw.print('/');
-        pw.print(host.uid); pw.println(':');
-        pw.print("    callbacks="); pw.println(host.callbacks);
-        pw.print("    instances.size="); pw.print(host.instances.size());
-                pw.print(" zombie="); pw.println(host.zombie);
-    }
-
-    private void dumpAppWidgetId(AppWidgetId id, int index, PrintWriter pw) {
-        pw.print("  ["); pw.print(index); pw.print("] id=");
-                pw.println(id.appWidgetId);
-        pw.print("    hostId=");
-                pw.print(id.host.hostId); pw.print(' ');
-                pw.print(id.host.packageName); pw.print('/');
-                pw.println(id.host.uid);
-        if (id.provider != null) {
-            pw.print("    provider=");
-                    pw.println(id.provider.info.provider.flattenToShortString());
-        }
-        if (id.host != null) {
-            pw.print("    host.callbacks="); pw.println(id.host.callbacks);
-        }
-        if (id.views != null) {
-            pw.print("    views="); pw.println(id.views);
-        }
+    
+    @Override
+    public void deleteAppWidgetId(int appWidgetId) throws RemoteException {
+        getImplForUser().deleteAppWidgetId(appWidgetId);
     }
 
     @Override
-    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
-        if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DUMP)
-                != PackageManager.PERMISSION_GRANTED) {
-            pw.println("Permission Denial: can't dump from from pid="
-                    + Binder.getCallingPid()
-                    + ", uid=" + Binder.getCallingUid());
-            return;
-        }
-
-        synchronized (mAppWidgetIds) {
-            int N = mInstalledProviders.size();
-            pw.println("Providers:");
-            for (int i=0; i<N; i++) {
-                dumpProvider(mInstalledProviders.get(i), i, pw);
-            }
-
-            N = mAppWidgetIds.size();
-            pw.println(" ");
-            pw.println("AppWidgetIds:");
-            for (int i=0; i<N; i++) {
-                dumpAppWidgetId(mAppWidgetIds.get(i), i, pw);
-            }
-
-            N = mHosts.size();
-            pw.println(" ");
-            pw.println("Hosts:");
-            for (int i=0; i<N; i++) {
-                dumpHost(mHosts.get(i), i, pw);
-            }
-
-            N = mDeletedProviders.size();
-            pw.println(" ");
-            pw.println("Deleted Providers:");
-            for (int i=0; i<N; i++) {
-                dumpProvider(mDeletedProviders.get(i), i, pw);
-            }
-
-            N = mDeletedHosts.size();
-            pw.println(" ");
-            pw.println("Deleted Hosts:");
-            for (int i=0; i<N; i++) {
-                dumpHost(mDeletedHosts.get(i), i, pw);
-            }
-        }
+    public void deleteHost(int hostId) throws RemoteException {
+        getImplForUser().deleteHost(hostId);
     }
 
-    public int allocateAppWidgetId(String packageName, int hostId) {
-        int callingUid = enforceCallingUid(packageName);
-        synchronized (mAppWidgetIds) {
-            ensureStateLoadedLocked();
-            int appWidgetId = mNextAppWidgetId++;
-
-            Host host = lookupOrAddHostLocked(callingUid, packageName, hostId);
-
-            AppWidgetId id = new AppWidgetId();
-            id.appWidgetId = appWidgetId;
-            id.host = host;
-
-            host.instances.add(id);
-            mAppWidgetIds.add(id);
-
-            saveStateLocked();
-
-            return appWidgetId;
-        }
-    }
-
-    public void deleteAppWidgetId(int appWidgetId) {
-        synchronized (mAppWidgetIds) {
-            ensureStateLoadedLocked();
-            AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
-            if (id != null) {
-                deleteAppWidgetLocked(id);
-                saveStateLocked();
-            }
-        }
-    }
-
-    public void deleteHost(int hostId) {
-        synchronized (mAppWidgetIds) {
-            ensureStateLoadedLocked();
-            int callingUid = getCallingUid();
-            Host host = lookupHostLocked(callingUid, hostId);
-            if (host != null) {
-                deleteHostLocked(host);
-                saveStateLocked();
-            }
-        }
-    }
-
-    public void deleteAllHosts() {
-        synchronized (mAppWidgetIds) {
-            ensureStateLoadedLocked();
-            int callingUid = getCallingUid();
-            final int N = mHosts.size();
-            boolean changed = false;
-            for (int i=N-1; i>=0; i--) {
-                Host host = mHosts.get(i);
-                if (host.uid == callingUid) {
-                    deleteHostLocked(host);
-                    changed = true;
-                }
-            }
-            if (changed) {
-                saveStateLocked();
-            }
-        }
-    }
-
-    void deleteHostLocked(Host host) {
-        final int N = host.instances.size();
-        for (int i=N-1; i>=0; i--) {
-            AppWidgetId id = host.instances.get(i);
-            deleteAppWidgetLocked(id);
-        }
-        host.instances.clear();
-        mHosts.remove(host);
-        mDeletedHosts.add(host);
-        // it's gone or going away, abruptly drop the callback connection
-        host.callbacks = null;
-    }
-
-    void deleteAppWidgetLocked(AppWidgetId id) {
-        // We first unbind all services that are bound to this id
-        unbindAppWidgetRemoteViewsServicesLocked(id);
-
-        Host host = id.host;
-        host.instances.remove(id);
-        pruneHostLocked(host);
-
-        mAppWidgetIds.remove(id);
-
-        Provider p = id.provider;
-        if (p != null) {
-            p.instances.remove(id);
-            if (!p.zombie) {
-                // send the broacast saying that this appWidgetId has been deleted
-                Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_DELETED);
-                intent.setComponent(p.info.provider);
-                intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, id.appWidgetId);
-                mContext.sendBroadcast(intent);
-                if (p.instances.size() == 0) {
-                    // cancel the future updates
-                    cancelBroadcasts(p);
-
-                    // send the broacast saying that the provider is not in use any more
-                    intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_DISABLED);
-                    intent.setComponent(p.info.provider);
-                    mContext.sendBroadcast(intent);
-                }
-            }
-        }
+    @Override
+    public void deleteAllHosts() throws RemoteException {
+        getImplForUser().deleteAllHosts();
     }
 
     void cancelBroadcasts(Provider p) {
@@ -441,617 +205,58 @@
         }
     }
 
-    public void bindAppWidgetId(int appWidgetId, ComponentName provider) {
-        mContext.enforceCallingPermission(android.Manifest.permission.BIND_APPWIDGET,
-                "bindGagetId appWidgetId=" + appWidgetId + " provider=" + provider);
-        
-        final long ident = Binder.clearCallingIdentity();
-        try {
-            synchronized (mAppWidgetIds) {
-                ensureStateLoadedLocked();
-                AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
-                if (id == null) {
-                    throw new IllegalArgumentException("bad appWidgetId");
-                }
-                if (id.provider != null) {
-                    throw new IllegalArgumentException("appWidgetId " + appWidgetId + " already bound to "
-                            + id.provider.info.provider);
-                }
-                Provider p = lookupProviderLocked(provider);
-                if (p == null) {
-                    throw new IllegalArgumentException("not a appwidget provider: " + provider);
-                }
-                if (p.zombie) {
-                    throw new IllegalArgumentException("can't bind to a 3rd party provider in"
-                            + " safe mode: " + provider);
-                }
-    
-                id.provider = p;
-                p.instances.add(id);
-                int instancesSize = p.instances.size();
-                if (instancesSize == 1) {
-                    // tell the provider that it's ready
-                    sendEnableIntentLocked(p);
-                }
-    
-                // send an update now -- We need this update now, and just for this appWidgetId.
-                // It's less critical when the next one happens, so when we schdule the next one,
-                // we add updatePeriodMillis to its start time.  That time will have some slop,
-                // but that's okay.
-                sendUpdateIntentLocked(p, new int[] { appWidgetId });
-    
-                // schedule the future updates
-                registerForBroadcastsLocked(p, getAppWidgetIds(p));
-                saveStateLocked();
-            }
-        } finally {
-            Binder.restoreCallingIdentity(ident);
-        }
+    @Override
+    public void bindAppWidgetId(int appWidgetId, ComponentName provider) throws RemoteException {
+        getImplForUser().bindAppWidgetId(appWidgetId, provider);
     }
 
-    // Binds to a specific RemoteViewsService
-    public void bindRemoteViewsService(int appWidgetId, Intent intent, IBinder connection) {
-        synchronized (mAppWidgetIds) {
-            ensureStateLoadedLocked();
-            AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
-            if (id == null) {
-                throw new IllegalArgumentException("bad appWidgetId");
-            }
-            final ComponentName componentName = intent.getComponent();
-            try {
-                final ServiceInfo si = mContext.getPackageManager().getServiceInfo(componentName,
-                        PackageManager.GET_PERMISSIONS);
-                if (!android.Manifest.permission.BIND_REMOTEVIEWS.equals(si.permission)) {
-                    throw new SecurityException("Selected service does not require "
-                            + android.Manifest.permission.BIND_REMOTEVIEWS
-                            + ": " + componentName);
-                }
-            } catch (PackageManager.NameNotFoundException e) {
-                throw new IllegalArgumentException("Unknown component " + componentName);
-            }
-
-            // If there is already a connection made for this service intent, then disconnect from
-            // that first.  (This does not allow multiple connections to the same service under
-            // the same key)
-            ServiceConnectionProxy conn = null;
-            FilterComparison fc = new FilterComparison(intent);
-            Pair<Integer, FilterComparison> key = Pair.create(appWidgetId, fc);
-            if (mBoundRemoteViewsServices.containsKey(key)) {
-                conn = (ServiceConnectionProxy) mBoundRemoteViewsServices.get(key);
-                conn.disconnect();
-                mContext.unbindService(conn);
-                mBoundRemoteViewsServices.remove(key);
-            }
-
-            // Bind to the RemoteViewsService (which will trigger a callback to the
-            // RemoteViewsAdapter.onServiceConnected())
-            final long token = Binder.clearCallingIdentity();
-            try {
-                conn = new ServiceConnectionProxy(key, connection);
-                mContext.bindService(intent, conn, Context.BIND_AUTO_CREATE);
-                mBoundRemoteViewsServices.put(key, conn);
-            } finally {
-                Binder.restoreCallingIdentity(token);
-            }
-
-            // Add it to the mapping of RemoteViewsService to appWidgetIds so that we can determine
-            // when we can call back to the RemoteViewsService later to destroy associated
-            // factories.
-            incrementAppWidgetServiceRefCount(appWidgetId, fc);
-        }
+    @Override
+    public void bindRemoteViewsService(int appWidgetId, Intent intent, IBinder connection)
+            throws RemoteException {
+        getImplForUser().bindRemoteViewsService(appWidgetId, intent, connection);
     }
 
-    // Unbinds from a specific RemoteViewsService
-    public void unbindRemoteViewsService(int appWidgetId, Intent intent) {
-        synchronized (mAppWidgetIds) {
-            ensureStateLoadedLocked();
-            // Unbind from the RemoteViewsService (which will trigger a callback to the bound
-            // RemoteViewsAdapter)
-            Pair<Integer, FilterComparison> key = Pair.create(appWidgetId,
-                    new FilterComparison(intent));
-            if (mBoundRemoteViewsServices.containsKey(key)) {
-                // We don't need to use the appWidgetId until after we are sure there is something
-                // to unbind.  Note that this may mask certain issues with apps calling unbind()
-                // more than necessary.
-                AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
-                if (id == null) {
-                    throw new IllegalArgumentException("bad appWidgetId");
-                }
-
-                ServiceConnectionProxy conn =
-                    (ServiceConnectionProxy) mBoundRemoteViewsServices.get(key);
-                conn.disconnect();
-                mContext.unbindService(conn);
-                mBoundRemoteViewsServices.remove(key);
-            } else {
-                Log.e("AppWidgetService", "Error (unbindRemoteViewsService): Connection not bound");
-            }
-        }
+    @Override
+    public int[] startListening(IAppWidgetHost host, String packageName, int hostId,
+            List<RemoteViews> updatedViews) throws RemoteException {
+        return getImplForUser().startListening(host, packageName, hostId, updatedViews);
     }
 
-    // Unbinds from a RemoteViewsService when we delete an app widget
-    private void unbindAppWidgetRemoteViewsServicesLocked(AppWidgetId id) {
-        int appWidgetId = id.appWidgetId;
-        // Unbind all connections to Services bound to this AppWidgetId
-        Iterator<Pair<Integer, Intent.FilterComparison>> it =
-            mBoundRemoteViewsServices.keySet().iterator();
-        while (it.hasNext()) {
-            final Pair<Integer, Intent.FilterComparison> key = it.next();
-            if (key.first.intValue() == appWidgetId) {
-                final ServiceConnectionProxy conn = (ServiceConnectionProxy)
-                        mBoundRemoteViewsServices.get(key);
-                conn.disconnect();
-                mContext.unbindService(conn);
-                it.remove();
-            }
-        }
-
-        // Check if we need to destroy any services (if no other app widgets are
-        // referencing the same service)
-        decrementAppWidgetServiceRefCount(appWidgetId);
+    // TODO: Call this from PackageManagerService when a user is removed
+    public void removeUser(int userId) {
     }
 
-    // Destroys the cached factory on the RemoteViewsService's side related to the specified intent
-    private void destroyRemoteViewsService(final Intent intent) {
-        final ServiceConnection conn = new ServiceConnection() {
-            @Override
-            public void onServiceConnected(ComponentName name, IBinder service) {
-                final IRemoteViewsFactory cb =
-                    IRemoteViewsFactory.Stub.asInterface(service);
-                try {
-                    cb.onDestroy(intent);
-                } catch (RemoteException e) {
-                    e.printStackTrace();
-                } catch (RuntimeException e) {
-                    e.printStackTrace();
-                }
-                mContext.unbindService(this);
-            }
-            @Override
-            public void onServiceDisconnected(android.content.ComponentName name) {
-                // Do nothing
-            }
-        };
-
-        // Bind to the service and remove the static intent->factory mapping in the
-        // RemoteViewsService.
-        final long token = Binder.clearCallingIdentity();
-        try {
-            mContext.bindService(intent, conn, Context.BIND_AUTO_CREATE);
-        } finally {
-            Binder.restoreCallingIdentity(token);
+    private AppWidgetServiceImpl getImplForUser() {
+        final int userId = Binder.getOrigCallingUser();
+        AppWidgetServiceImpl service = mAppWidgetServices.get(userId);
+        if (service == null) {
+            Slog.e(TAG, "Unable to find AppWidgetServiceImpl for the current user");
+            // TODO: Verify that it's a valid user
+            service = new AppWidgetServiceImpl(mContext, userId);
+            service.systemReady(mSafeMode);
+            // Assume that BOOT_COMPLETED was received, as this is a non-primary user.
+            service.sendInitialBroadcasts();
+            mAppWidgetServices.append(userId, service);
         }
+
+        return service;
     }
 
-    // Adds to the ref-count for a given RemoteViewsService intent
-    private void incrementAppWidgetServiceRefCount(int appWidgetId, FilterComparison fc) {
-        HashSet<Integer> appWidgetIds = null;
-        if (mRemoteViewsServicesAppWidgets.containsKey(fc)) {
-            appWidgetIds = mRemoteViewsServicesAppWidgets.get(fc);
-        } else {
-            appWidgetIds = new HashSet<Integer>();
-            mRemoteViewsServicesAppWidgets.put(fc, appWidgetIds);
-        }
-        appWidgetIds.add(appWidgetId);
+    @Override
+    public int[] getAppWidgetIds(ComponentName provider) throws RemoteException {
+        return getImplForUser().getAppWidgetIds(provider);
     }
 
-    // Subtracts from the ref-count for a given RemoteViewsService intent, prompting a delete if
-    // the ref-count reaches zero.
-    private void decrementAppWidgetServiceRefCount(int appWidgetId) {
-        Iterator<FilterComparison> it =
-            mRemoteViewsServicesAppWidgets.keySet().iterator();
-        while (it.hasNext()) {
-            final FilterComparison key = it.next();
-            final HashSet<Integer> ids = mRemoteViewsServicesAppWidgets.get(key);
-            if (ids.remove(appWidgetId)) {
-                // If we have removed the last app widget referencing this service, then we
-                // should destroy it and remove it from this set
-                if (ids.isEmpty()) {
-                    destroyRemoteViewsService(key.getIntent());
-                    it.remove();
-                }
-            }
-        }
+    @Override
+    public AppWidgetProviderInfo getAppWidgetInfo(int appWidgetId) throws RemoteException {
+        return getImplForUser().getAppWidgetInfo(appWidgetId);
     }
 
-    public AppWidgetProviderInfo getAppWidgetInfo(int appWidgetId) {
-        synchronized (mAppWidgetIds) {
-            ensureStateLoadedLocked();
-            AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
-            if (id != null && id.provider != null && !id.provider.zombie) {
-                return id.provider.info;
-            }
-            return null;
-        }
+    @Override
+    public RemoteViews getAppWidgetViews(int appWidgetId) throws RemoteException {
+        return getImplForUser().getAppWidgetViews(appWidgetId);
     }
 
-    public RemoteViews getAppWidgetViews(int appWidgetId) {
-        synchronized (mAppWidgetIds) {
-            ensureStateLoadedLocked();
-            AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
-            if (id != null) {
-                return id.views;
-            }
-            return null;
-        }
-    }
-
-    public List<AppWidgetProviderInfo> getInstalledProviders() {
-        synchronized (mAppWidgetIds) {
-            ensureStateLoadedLocked();
-            final int N = mInstalledProviders.size();
-            ArrayList<AppWidgetProviderInfo> result = new ArrayList<AppWidgetProviderInfo>(N);
-            for (int i=0; i<N; i++) {
-                Provider p = mInstalledProviders.get(i);
-                if (!p.zombie) {
-                    result.add(p.info);
-                }
-            }
-            return result;
-        }
-    }
-
-    public void updateAppWidgetIds(int[] appWidgetIds, RemoteViews views) {
-        if (appWidgetIds == null) {
-            return;
-        }
-        if (appWidgetIds.length == 0) {
-            return;
-        }
-        final int N = appWidgetIds.length;
-
-        synchronized (mAppWidgetIds) {
-            ensureStateLoadedLocked();
-            for (int i=0; i<N; i++) {
-                AppWidgetId id = lookupAppWidgetIdLocked(appWidgetIds[i]);
-                updateAppWidgetInstanceLocked(id, views);
-            }
-        }
-    }
-
-    public void partiallyUpdateAppWidgetIds(int[] appWidgetIds, RemoteViews views) {
-        if (appWidgetIds == null) {
-            return;
-        }
-        if (appWidgetIds.length == 0) {
-            return;
-        }
-        final int N = appWidgetIds.length;
-
-        synchronized (mAppWidgetIds) {
-            ensureStateLoadedLocked();
-            for (int i=0; i<N; i++) {
-                AppWidgetId id = lookupAppWidgetIdLocked(appWidgetIds[i]);
-                updateAppWidgetInstanceLocked(id, views, true);
-            }
-        }
-    }
-
-    public void notifyAppWidgetViewDataChanged(int[] appWidgetIds, int viewId) {
-        if (appWidgetIds == null) {
-            return;
-        }
-        if (appWidgetIds.length == 0) {
-            return;
-        }
-        final int N = appWidgetIds.length;
-
-        synchronized (mAppWidgetIds) {
-            ensureStateLoadedLocked();
-            for (int i=0; i<N; i++) {
-                AppWidgetId id = lookupAppWidgetIdLocked(appWidgetIds[i]);
-                notifyAppWidgetViewDataChangedInstanceLocked(id, viewId);
-            }
-        }
-    }
-
-    public void updateAppWidgetProvider(ComponentName provider, RemoteViews views) {
-        synchronized (mAppWidgetIds) {
-            ensureStateLoadedLocked();
-            Provider p = lookupProviderLocked(provider);
-            if (p == null) {
-                Slog.w(TAG, "updateAppWidgetProvider: provider doesn't exist: " + provider);
-                return;
-            }
-            ArrayList<AppWidgetId> instances = p.instances;
-            final int callingUid = getCallingUid();
-            final int N = instances.size();
-            for (int i=0; i<N; i++) {
-                AppWidgetId id = instances.get(i);
-                if (canAccessAppWidgetId(id, callingUid)) {
-                    updateAppWidgetInstanceLocked(id, views);
-                }
-            }
-        }
-    }
-
-    void updateAppWidgetInstanceLocked(AppWidgetId id, RemoteViews views) {
-        updateAppWidgetInstanceLocked(id, views, false);
-    }
-
-    void updateAppWidgetInstanceLocked(AppWidgetId id, RemoteViews views, boolean isPartialUpdate) {
-        // allow for stale appWidgetIds and other badness
-        // lookup also checks that the calling process can access the appWidgetId
-        // drop unbound appWidgetIds (shouldn't be possible under normal circumstances)
-        if (id != null && id.provider != null && !id.provider.zombie && !id.host.zombie) {
-
-            // We do not want to save this RemoteViews
-            if (!isPartialUpdate) id.views = views;
-
-            // is anyone listening?
-            if (id.host.callbacks != null) {
-                try {
-                    // the lock is held, but this is a oneway call
-                    id.host.callbacks.updateAppWidget(id.appWidgetId, views);
-                } catch (RemoteException e) {
-                    // It failed; remove the callback. No need to prune because
-                    // we know that this host is still referenced by this instance.
-                    id.host.callbacks = null;
-                }
-            }
-        }
-    }
-
-    void notifyAppWidgetViewDataChangedInstanceLocked(AppWidgetId id, int viewId) {
-        // allow for stale appWidgetIds and other badness
-        // lookup also checks that the calling process can access the appWidgetId
-        // drop unbound appWidgetIds (shouldn't be possible under normal circumstances)
-        if (id != null && id.provider != null && !id.provider.zombie && !id.host.zombie) {
-            // is anyone listening?
-            if (id.host.callbacks != null) {
-                try {
-                    // the lock is held, but this is a oneway call
-                    id.host.callbacks.viewDataChanged(id.appWidgetId, viewId);
-                } catch (RemoteException e) {
-                    // It failed; remove the callback. No need to prune because
-                    // we know that this host is still referenced by this instance.
-                    id.host.callbacks = null;
-                }
-            }
-
-            // If the host is unavailable, then we call the associated
-            // RemoteViewsFactory.onDataSetChanged() directly
-            if (id.host.callbacks == null) {
-                Set<FilterComparison> keys = mRemoteViewsServicesAppWidgets.keySet();
-                for (FilterComparison key : keys) {
-                    if (mRemoteViewsServicesAppWidgets.get(key).contains(id.appWidgetId)) {
-                        Intent intent = key.getIntent();
-
-                        final ServiceConnection conn = new ServiceConnection() {
-                            @Override
-                            public void onServiceConnected(ComponentName name, IBinder service) {
-                                IRemoteViewsFactory cb =
-                                    IRemoteViewsFactory.Stub.asInterface(service);
-                                try {
-                                    cb.onDataSetChangedAsync();
-                                } catch (RemoteException e) {
-                                    e.printStackTrace();
-                                } catch (RuntimeException e) {
-                                    e.printStackTrace();
-                                }
-                                mContext.unbindService(this);
-                            }
-                            @Override
-                            public void onServiceDisconnected(android.content.ComponentName name) {
-                                // Do nothing
-                            }
-                        };
-
-                        // Bind to the service and call onDataSetChanged()
-                        final long token = Binder.clearCallingIdentity();
-                        try {
-                            mContext.bindService(intent, conn, Context.BIND_AUTO_CREATE);
-                        } finally {
-                            Binder.restoreCallingIdentity(token);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    public int[] startListening(IAppWidgetHost callbacks, String packageName, int hostId,
-            List<RemoteViews> updatedViews) {
-        int callingUid = enforceCallingUid(packageName);
-        synchronized (mAppWidgetIds) {
-            ensureStateLoadedLocked();
-            Host host = lookupOrAddHostLocked(callingUid, packageName, hostId);
-            host.callbacks = callbacks;
-
-            updatedViews.clear();
-
-            ArrayList<AppWidgetId> instances = host.instances;
-            int N = instances.size();
-            int[] updatedIds = new int[N];
-            for (int i=0; i<N; i++) {
-                AppWidgetId id = instances.get(i);
-                updatedIds[i] = id.appWidgetId;
-                updatedViews.add(id.views);
-            }
-            return updatedIds;
-        }
-    }
-
-    public void stopListening(int hostId) {
-        synchronized (mAppWidgetIds) {
-            ensureStateLoadedLocked();
-            Host host = lookupHostLocked(getCallingUid(), hostId);
-            if (host != null) {
-                host.callbacks = null;
-                pruneHostLocked(host);
-            }
-        }
-    }
-
-    boolean canAccessAppWidgetId(AppWidgetId id, int callingUid) {
-        if (id.host.uid == callingUid) {
-            // Apps hosting the AppWidget have access to it.
-            return true;
-        }
-        if (id.provider != null && id.provider.uid == callingUid) {
-            // Apps providing the AppWidget have access to it (if the appWidgetId has been bound)
-            return true;
-        }
-        if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.BIND_APPWIDGET)
-                == PackageManager.PERMISSION_GRANTED) {
-            // Apps that can bind have access to all appWidgetIds.
-            return true;
-        }
-        // Nobody else can access it.
-        return false;
-    }
-
-   AppWidgetId lookupAppWidgetIdLocked(int appWidgetId) {
-        int callingUid = getCallingUid();
-        final int N = mAppWidgetIds.size();
-        for (int i=0; i<N; i++) {
-            AppWidgetId id = mAppWidgetIds.get(i);
-            if (id.appWidgetId == appWidgetId && canAccessAppWidgetId(id, callingUid)) {
-                return id;
-            }
-        }
-        return null;
-    }
-
-    Provider lookupProviderLocked(ComponentName provider) {
-        final int N = mInstalledProviders.size();
-        for (int i=0; i<N; i++) {
-            Provider p = mInstalledProviders.get(i);
-            if (p.info.provider.equals(provider)) {
-                return p;
-            }
-        }
-        return null;
-    }
-
-    Host lookupHostLocked(int uid, int hostId) {
-        final int N = mHosts.size();
-        for (int i=0; i<N; i++) {
-            Host h = mHosts.get(i);
-            if (h.uid == uid && h.hostId == hostId) {
-                return h;
-            }
-        }
-        return null;
-    }
-
-    Host lookupOrAddHostLocked(int uid, String packageName, int hostId) {
-        final int N = mHosts.size();
-        for (int i=0; i<N; i++) {
-            Host h = mHosts.get(i);
-            if (h.hostId == hostId && h.packageName.equals(packageName)) {
-                return h;
-            }
-        }
-        Host host = new Host();
-        host.packageName = packageName;
-        host.uid = uid;
-        host.hostId = hostId;
-        mHosts.add(host);
-        return host;
-    }
-
-    void pruneHostLocked(Host host) {
-        if (host.instances.size() == 0 && host.callbacks == null) {
-            mHosts.remove(host);
-        }
-    }
-
-    void loadAppWidgetList() {
-        PackageManager pm = mPackageManager;
-
-        Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
-        List<ResolveInfo> broadcastReceivers = pm.queryBroadcastReceivers(intent,
-                PackageManager.GET_META_DATA);
-
-        final int N = broadcastReceivers == null ? 0 : broadcastReceivers.size();
-        for (int i=0; i<N; i++) {
-            ResolveInfo ri = broadcastReceivers.get(i);
-            addProviderLocked(ri);
-        }
-    }
-
-    boolean addProviderLocked(ResolveInfo ri) {
-        if ((ri.activityInfo.applicationInfo.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0) {
-            return false;
-        }
-        if (!ri.activityInfo.isEnabled()) {
-            return false;
-        }
-        Provider p = parseProviderInfoXml(new ComponentName(ri.activityInfo.packageName,
-                    ri.activityInfo.name), ri);
-        if (p != null) {
-            mInstalledProviders.add(p);
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    void removeProviderLocked(int index, Provider p) {
-        int N = p.instances.size();
-        for (int i=0; i<N; i++) {
-            AppWidgetId id = p.instances.get(i);
-            // Call back with empty RemoteViews
-            updateAppWidgetInstanceLocked(id, null);
-            // Stop telling the host about updates for this from now on
-            cancelBroadcasts(p);
-            // clear out references to this appWidgetId
-            id.host.instances.remove(id);
-            mAppWidgetIds.remove(id);
-            id.provider = null;
-            pruneHostLocked(id.host);
-            id.host = null;
-        }
-        p.instances.clear();
-        mInstalledProviders.remove(index);
-        mDeletedProviders.add(p);
-        // no need to send the DISABLE broadcast, since the receiver is gone anyway
-        cancelBroadcasts(p);
-    }
-
-    void sendEnableIntentLocked(Provider p) {
-        Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_ENABLED);
-        intent.setComponent(p.info.provider);
-        mContext.sendBroadcast(intent);
-    }
-
-    void sendUpdateIntentLocked(Provider p, int[] appWidgetIds) {
-        if (appWidgetIds != null && appWidgetIds.length > 0) {
-            Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
-            intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, appWidgetIds);
-            intent.setComponent(p.info.provider);
-            mContext.sendBroadcast(intent);
-        }
-    }
-
-    void registerForBroadcastsLocked(Provider p, int[] appWidgetIds) {
-        if (p.info.updatePeriodMillis > 0) {
-            // if this is the first instance, set the alarm.  otherwise,
-            // rely on the fact that we've already set it and that
-            // PendingIntent.getBroadcast will update the extras.
-            boolean alreadyRegistered = p.broadcast != null;
-            Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
-            intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, appWidgetIds);
-            intent.setComponent(p.info.provider);
-            long token = Binder.clearCallingIdentity();
-            try {
-                p.broadcast = PendingIntent.getBroadcast(mContext, 1, intent,
-                        PendingIntent.FLAG_UPDATE_CURRENT);
-            } finally {
-                Binder.restoreCallingIdentity(token);
-            }
-            if (!alreadyRegistered) {
-                long period = p.info.updatePeriodMillis;
-                if (period < MIN_UPDATE_PERIOD) {
-                    period = MIN_UPDATE_PERIOD;
-                }
-                mAlarmManager.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,
-                        SystemClock.elapsedRealtime() + period, period, p.broadcast);
-            }
-        }
-    }
-    
     static int[] getAppWidgetIds(Provider p) {
         int instancesSize = p.instances.size();
         int appWidgetIds[] = new int[instancesSize];
@@ -1060,570 +265,70 @@
         }
         return appWidgetIds;
     }
-    
-    public int[] getAppWidgetIds(ComponentName provider) {
-        synchronized (mAppWidgetIds) {
-            ensureStateLoadedLocked();
-            Provider p = lookupProviderLocked(provider);
-            if (p != null && getCallingUid() == p.uid) {
-                return getAppWidgetIds(p);                
-            } else {
-                return new int[0];
-            }
-        }
+
+    @Override
+    public List<AppWidgetProviderInfo> getInstalledProviders() throws RemoteException {
+        return getImplForUser().getInstalledProviders();
     }
 
-    private Provider parseProviderInfoXml(ComponentName component, ResolveInfo ri) {
-        Provider p = null;
-
-        ActivityInfo activityInfo = ri.activityInfo;
-        XmlResourceParser parser = null;
-        try {
-            parser = activityInfo.loadXmlMetaData(mPackageManager,
-                    AppWidgetManager.META_DATA_APPWIDGET_PROVIDER);
-            if (parser == null) {
-                Slog.w(TAG, "No " + AppWidgetManager.META_DATA_APPWIDGET_PROVIDER + " meta-data for "
-                        + "AppWidget provider '" + component + '\'');
-                return null;
-            }
-
-            AttributeSet attrs = Xml.asAttributeSet(parser);
-
-            int type;
-            while ((type=parser.next()) != XmlPullParser.END_DOCUMENT
-                    && type != XmlPullParser.START_TAG) {
-                // drain whitespace, comments, etc.
-            }
-
-            String nodeName = parser.getName();
-            if (!"appwidget-provider".equals(nodeName)) {
-                Slog.w(TAG, "Meta-data does not start with appwidget-provider tag for"
-                        + " AppWidget provider '" + component + '\'');
-                return null;
-            }
-
-            p = new Provider();
-            AppWidgetProviderInfo info = p.info = new AppWidgetProviderInfo();
-            info.provider = component;
-            p.uid = activityInfo.applicationInfo.uid;
-
-            Resources res = mPackageManager.getResourcesForApplication(
-                    activityInfo.applicationInfo);
-
-            TypedArray sa = res.obtainAttributes(attrs,
-                    com.android.internal.R.styleable.AppWidgetProviderInfo);
-
-            // These dimensions has to be resolved in the application's context.
-            // We simply send back the raw complex data, which will be
-            // converted to dp in {@link AppWidgetManager#getAppWidgetInfo}.
-            TypedValue value = sa.peekValue(
-                    com.android.internal.R.styleable.AppWidgetProviderInfo_minWidth);
-            info.minWidth = value != null ? value.data : 0; 
-            value = sa.peekValue(com.android.internal.R.styleable.AppWidgetProviderInfo_minHeight);
-            info.minHeight = value != null ? value.data : 0;
-            value = sa.peekValue(
-                    com.android.internal.R.styleable.AppWidgetProviderInfo_minResizeWidth);
-            info.minResizeWidth = value != null ? value.data : info.minWidth;
-            value = sa.peekValue(
-                    com.android.internal.R.styleable.AppWidgetProviderInfo_minResizeHeight);
-            info.minResizeHeight = value != null ? value.data : info.minHeight;
-
-            info.updatePeriodMillis = sa.getInt(
-                    com.android.internal.R.styleable.AppWidgetProviderInfo_updatePeriodMillis, 0);
-            info.initialLayout = sa.getResourceId(
-                    com.android.internal.R.styleable.AppWidgetProviderInfo_initialLayout, 0);
-            String className = sa.getString(
-                    com.android.internal.R.styleable.AppWidgetProviderInfo_configure);
-            if (className != null) {
-                info.configure = new ComponentName(component.getPackageName(), className);
-            }
-            info.label = activityInfo.loadLabel(mPackageManager).toString();
-            info.icon = ri.getIconResource();
-            info.previewImage = sa.getResourceId(
-            		com.android.internal.R.styleable.AppWidgetProviderInfo_previewImage, 0);
-            info.autoAdvanceViewId = sa.getResourceId(
-                    com.android.internal.R.styleable.AppWidgetProviderInfo_autoAdvanceViewId, -1);
-            info.resizeMode = sa.getInt(
-                    com.android.internal.R.styleable.AppWidgetProviderInfo_resizeMode,
-                    AppWidgetProviderInfo.RESIZE_NONE);
-
-            sa.recycle();
-        } catch (Exception e) {
-            // Ok to catch Exception here, because anything going wrong because
-            // of what a client process passes to us should not be fatal for the
-            // system process.
-            Slog.w(TAG, "XML parsing failed for AppWidget provider '" + component + '\'', e);
-            return null;
-        } finally {
-            if (parser != null) parser.close();
-        }
-        return p;
+    @Override
+    public void notifyAppWidgetViewDataChanged(int[] appWidgetIds, int viewId)
+            throws RemoteException {
+        getImplForUser().notifyAppWidgetViewDataChanged(appWidgetIds, viewId);
     }
 
-    int getUidForPackage(String packageName) throws PackageManager.NameNotFoundException {
-        PackageInfo pkgInfo = mPackageManager.getPackageInfo(packageName, 0);
-        if (pkgInfo == null || pkgInfo.applicationInfo == null) {
-            throw new PackageManager.NameNotFoundException();
-        }
-        return pkgInfo.applicationInfo.uid;
+    @Override
+    public void partiallyUpdateAppWidgetIds(int[] appWidgetIds, RemoteViews views)
+            throws RemoteException {
+        getImplForUser().partiallyUpdateAppWidgetIds(appWidgetIds, views);
     }
 
-    int enforceCallingUid(String packageName) throws IllegalArgumentException {
-        int callingUid = getCallingUid();
-        int packageUid;
-        try {
-            packageUid = getUidForPackage(packageName);
-        } catch (PackageManager.NameNotFoundException ex) {
-            throw new IllegalArgumentException("packageName and uid don't match packageName="
-                    + packageName);
-        }
-        if (callingUid != packageUid) {
-            throw new IllegalArgumentException("packageName and uid don't match packageName="
-                    + packageName);
-        }
-        return callingUid;
+    @Override
+    public void stopListening(int hostId) throws RemoteException {
+        getImplForUser().stopListening(hostId);
     }
 
-    void sendInitialBroadcasts() {
-        synchronized (mAppWidgetIds) {
-            ensureStateLoadedLocked();
-            final int N = mInstalledProviders.size();
-            for (int i=0; i<N; i++) {
-                Provider p = mInstalledProviders.get(i);
-                if (p.instances.size() > 0) {
-                    sendEnableIntentLocked(p);
-                    int[] appWidgetIds = getAppWidgetIds(p);
-                    sendUpdateIntentLocked(p, appWidgetIds);
-                    registerForBroadcastsLocked(p, appWidgetIds);
-                }
-            }
-        }
+    @Override
+    public void unbindRemoteViewsService(int appWidgetId, Intent intent) throws RemoteException {
+        getImplForUser().unbindRemoteViewsService(appWidgetId, intent);
     }
 
-    // only call from initialization -- it assumes that the data structures are all empty
-    void loadStateLocked() {
-        AtomicFile file = savedStateFile();
-        try {
-            FileInputStream stream = file.openRead();
-            readStateFromFileLocked(stream);
-
-            if (stream != null) {
-                try {
-                    stream.close();
-                } catch (IOException e) {
-                    Slog.w(TAG, "Failed to close state FileInputStream " + e);
-                }
-            }
-        } catch (FileNotFoundException e) {
-            Slog.w(TAG, "Failed to read state: " + e);
-        }
+    @Override
+    public void updateAppWidgetIds(int[] appWidgetIds, RemoteViews views) throws RemoteException {
+        getImplForUser().updateAppWidgetIds(appWidgetIds, views);
     }
 
-    void saveStateLocked() {
-        AtomicFile file = savedStateFile();
-        FileOutputStream stream;
-        try {
-            stream = file.startWrite();
-            if (writeStateToFileLocked(stream)) {
-                file.finishWrite(stream);
-            } else {
-                file.failWrite(stream);
-                Slog.w(TAG, "Failed to save state, restoring backup.");
-            }
-        } catch (IOException e) {
-            Slog.w(TAG, "Failed open state file for write: " + e);
-        }
+    @Override
+    public void updateAppWidgetProvider(ComponentName provider, RemoteViews views)
+            throws RemoteException {
+        getImplForUser().updateAppWidgetProvider(provider, views);
     }
 
-    boolean writeStateToFileLocked(FileOutputStream stream) {
-        int N;
-
-        try {
-            XmlSerializer out = new FastXmlSerializer();
-            out.setOutput(stream, "utf-8");
-            out.startDocument(null, true);
-            out.startTag(null, "gs");
-
-            int providerIndex = 0;
-            N = mInstalledProviders.size();
-            for (int i=0; i<N; i++) {
-                Provider p = mInstalledProviders.get(i);
-                if (p.instances.size() > 0) {
-                    out.startTag(null, "p");
-                    out.attribute(null, "pkg", p.info.provider.getPackageName());
-                    out.attribute(null, "cl", p.info.provider.getClassName());
-                    out.endTag(null, "p");
-                    p.tag = providerIndex;
-                    providerIndex++;
-                }
-            }
-
-            N = mHosts.size();
-            for (int i=0; i<N; i++) {
-                Host host = mHosts.get(i);
-                out.startTag(null, "h");
-                out.attribute(null, "pkg", host.packageName);
-                out.attribute(null, "id", Integer.toHexString(host.hostId));
-                out.endTag(null, "h");
-                host.tag = i;
-            }
-
-            N = mAppWidgetIds.size();
-            for (int i=0; i<N; i++) {
-                AppWidgetId id = mAppWidgetIds.get(i);
-                out.startTag(null, "g");
-                out.attribute(null, "id", Integer.toHexString(id.appWidgetId));
-                out.attribute(null, "h", Integer.toHexString(id.host.tag));
-                if (id.provider != null) {
-                    out.attribute(null, "p", Integer.toHexString(id.provider.tag));
-                }
-                out.endTag(null, "g");
-            }
-
-            out.endTag(null, "gs");
-
-            out.endDocument();
-            return true;
-        } catch (IOException e) {
-            Slog.w(TAG, "Failed to write state: " + e);
-            return false;
+    @Override
+    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
+        // Dump the state of all the app widget providers
+        for (int i = 0; i < mAppWidgetServices.size(); i++) {
+            AppWidgetServiceImpl service = mAppWidgetServices.valueAt(i);
+            service.dump(fd, pw, args);
         }
     }
 
-    void readStateFromFileLocked(FileInputStream stream) {
-        boolean success = false;
-
-        try {
-            XmlPullParser parser = Xml.newPullParser();
-            parser.setInput(stream, null);
-
-            int type;
-            int providerIndex = 0;
-            HashMap<Integer,Provider> loadedProviders = new HashMap<Integer, Provider>();
-            do {
-                type = parser.next();
-                if (type == XmlPullParser.START_TAG) {
-                    String tag = parser.getName();
-                    if ("p".equals(tag)) {
-                        // TODO: do we need to check that this package has the same signature
-                        // as before?
-                        String pkg = parser.getAttributeValue(null, "pkg");
-                        String cl = parser.getAttributeValue(null, "cl");
-
-                        final PackageManager packageManager = mContext.getPackageManager();
-                        try {
-                            packageManager.getReceiverInfo(new ComponentName(pkg, cl), 0);
-                        } catch (PackageManager.NameNotFoundException e) {
-                            String[] pkgs = packageManager.currentToCanonicalPackageNames(
-                                    new String[] { pkg });
-                            pkg = pkgs[0];
-                        }
-
-                        Provider p = lookupProviderLocked(new ComponentName(pkg, cl));
-                        if (p == null && mSafeMode) {
-                            // if we're in safe mode, make a temporary one
-                            p = new Provider();
-                            p.info = new AppWidgetProviderInfo();
-                            p.info.provider = new ComponentName(pkg, cl);
-                            p.zombie = true;
-                            mInstalledProviders.add(p);
-                        }
-                        if (p != null) {
-                            // if it wasn't uninstalled or something
-                            loadedProviders.put(providerIndex, p);
-                        }
-                        providerIndex++;
-                    }
-                    else if ("h".equals(tag)) {
-                        Host host = new Host();
-
-                        // TODO: do we need to check that this package has the same signature
-                        // as before?
-                        host.packageName = parser.getAttributeValue(null, "pkg");
-                        try {
-                            host.uid = getUidForPackage(host.packageName);
-                        } catch (PackageManager.NameNotFoundException ex) {
-                            host.zombie = true;
-                        }
-                        if (!host.zombie || mSafeMode) {
-                            // In safe mode, we don't discard the hosts we don't recognize
-                            // so that they're not pruned from our list.  Otherwise, we do.
-                            host.hostId = Integer.parseInt(
-                                    parser.getAttributeValue(null, "id"), 16);
-                            mHosts.add(host);
-                        }
-                    }
-                    else if ("g".equals(tag)) {
-                        AppWidgetId id = new AppWidgetId();
-                        id.appWidgetId = Integer.parseInt(parser.getAttributeValue(null, "id"), 16);
-                        if (id.appWidgetId >= mNextAppWidgetId) {
-                            mNextAppWidgetId = id.appWidgetId + 1;
-                        }
-
-                        String providerString = parser.getAttributeValue(null, "p");
-                        if (providerString != null) {
-                            // there's no provider if it hasn't been bound yet.
-                            // maybe we don't have to save this, but it brings the system
-                            // to the state it was in.
-                            int pIndex = Integer.parseInt(providerString, 16);
-                            id.provider = loadedProviders.get(pIndex);
-                            if (false) {
-                                Slog.d(TAG, "bound appWidgetId=" + id.appWidgetId + " to provider "
-                                        + pIndex + " which is " + id.provider);
-                            }
-                            if (id.provider == null) {
-                                // This provider is gone.  We just let the host figure out
-                                // that this happened when it fails to load it.
-                                continue;
-                            }
-                        }
-
-                        int hIndex = Integer.parseInt(parser.getAttributeValue(null, "h"), 16);
-                        id.host = mHosts.get(hIndex);
-                        if (id.host == null) {
-                            // This host is gone.
-                            continue;
-                        }
-
-                        if (id.provider != null) {
-                            id.provider.instances.add(id);
-                        }
-                        id.host.instances.add(id);
-                        mAppWidgetIds.add(id);
-                    }
-                }
-            } while (type != XmlPullParser.END_DOCUMENT);
-            success = true;
-        } catch (NullPointerException e) {
-            Slog.w(TAG, "failed parsing " + e);
-        } catch (NumberFormatException e) {
-            Slog.w(TAG, "failed parsing " + e);
-        } catch (XmlPullParserException e) {
-            Slog.w(TAG, "failed parsing " + e);
-        } catch (IOException e) {
-            Slog.w(TAG, "failed parsing " + e);
-        } catch (IndexOutOfBoundsException e) {
-            Slog.w(TAG, "failed parsing " + e);
-        }
-
-        if (success) {
-            // delete any hosts that didn't manage to get connected (should happen)
-            // if it matters, they'll be reconnected.
-            for (int i=mHosts.size()-1; i>=0; i--) {
-                pruneHostLocked(mHosts.get(i));
-            }
-        } else {
-            // failed reading, clean up
-            Slog.w(TAG, "Failed to read state, clearing widgets and hosts.");
-
-            mAppWidgetIds.clear();
-            mHosts.clear();
-            final int N = mInstalledProviders.size();
-            for (int i=0; i<N; i++) {
-                mInstalledProviders.get(i).instances.clear();
-            }
-        }
-    }
-
-    AtomicFile savedStateFile() {
-        return new AtomicFile(new File("/data/system/" + SETTINGS_FILENAME));
-    }
-
     BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
         public void onReceive(Context context, Intent intent) {
             String action = intent.getAction();
-            //Slog.d(TAG, "received " + action);
+            // Slog.d(TAG, "received " + action);
             if (Intent.ACTION_BOOT_COMPLETED.equals(action)) {
-                sendInitialBroadcasts();
+                getImplForUser().sendInitialBroadcasts();
             } else if (Intent.ACTION_CONFIGURATION_CHANGED.equals(action)) {
-                Locale revised = Locale.getDefault();
-                if (revised == null || mLocale == null ||
-                    !(revised.equals(mLocale))) {
-                    mLocale = revised;
-
-                    synchronized (mAppWidgetIds) {
-                        ensureStateLoadedLocked();
-                        int N = mInstalledProviders.size();
-                        for (int i=N-1; i>=0; i--) {
-                            Provider p = mInstalledProviders.get(i);
-                            String pkgName = p.info.provider.getPackageName();
-                            updateProvidersForPackageLocked(pkgName);
-                        }
-                        saveStateLocked();
-                    }
+                for (int i = 0; i < mAppWidgetServices.size(); i++) {
+                    AppWidgetServiceImpl service = mAppWidgetServices.valueAt(i);
+                    service.onConfigurationChanged();
                 }
             } else {
-                boolean added = false;
-                boolean changed = false;
-                String pkgList[] = null;
-                if (Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE.equals(action)) {
-                    pkgList = intent.getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST);
-                    added = true;
-                } else if (Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE.equals(action)) {
-                    pkgList = intent.getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST);
-                    added = false;
-                } else  {
-                    Uri uri = intent.getData();
-                    if (uri == null) {
-                        return;
-                    }
-                    String pkgName = uri.getSchemeSpecificPart();
-                    if (pkgName == null) {
-                        return;
-                    }
-                    pkgList = new String[] { pkgName };
-                    added = Intent.ACTION_PACKAGE_ADDED.equals(action);
-                    changed = Intent.ACTION_PACKAGE_CHANGED.equals(action);
-                }
-                if (pkgList == null || pkgList.length == 0) {
-                    return;
-                }
-                if (added || changed) {
-                    synchronized (mAppWidgetIds) {
-                        ensureStateLoadedLocked();
-                        Bundle extras = intent.getExtras();
-                        if (changed || (extras != null &&
-                                    extras.getBoolean(Intent.EXTRA_REPLACING, false))) {
-                            for (String pkgName : pkgList) {
-                                // The package was just upgraded
-                                updateProvidersForPackageLocked(pkgName);
-                            }
-                        } else {
-                            // The package was just added
-                            for (String pkgName : pkgList) {
-                                addProvidersForPackageLocked(pkgName);
-                            }
-                        }
-                        saveStateLocked();
-                    }
-                } else {
-                    Bundle extras = intent.getExtras();
-                    if (extras != null && extras.getBoolean(Intent.EXTRA_REPLACING, false)) {
-                        // The package is being updated.  We'll receive a PACKAGE_ADDED shortly.
-                    } else {
-                        synchronized (mAppWidgetIds) {
-                            ensureStateLoadedLocked();
-                            for (String pkgName : pkgList) {
-                                removeProvidersForPackageLocked(pkgName);
-                                saveStateLocked();
-                            }
-                        }
-                    }
-                }
+                // TODO: Verify that this only needs to be delivered for the related user and not
+                // all the users
+                getImplForUser().onBroadcastReceived(intent);
             }
         }
     };
-
-    void addProvidersForPackageLocked(String pkgName) {
-        Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
-        intent.setPackage(pkgName);
-        List<ResolveInfo> broadcastReceivers = mPackageManager.queryBroadcastReceivers(intent,
-                PackageManager.GET_META_DATA);
-
-        final int N = broadcastReceivers == null ? 0 : broadcastReceivers.size();
-        for (int i=0; i<N; i++) {
-            ResolveInfo ri = broadcastReceivers.get(i);
-            ActivityInfo ai = ri.activityInfo;
-            if ((ai.applicationInfo.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0) {
-                continue;
-            }
-            if (pkgName.equals(ai.packageName)) {
-                addProviderLocked(ri);
-            }
-        }
-    }
-
-    void updateProvidersForPackageLocked(String pkgName) {
-        HashSet<String> keep = new HashSet<String>();
-        Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
-        intent.setPackage(pkgName);
-        List<ResolveInfo> broadcastReceivers = mPackageManager.queryBroadcastReceivers(intent,
-                PackageManager.GET_META_DATA);
-
-        // add the missing ones and collect which ones to keep
-        int N = broadcastReceivers == null ? 0 : broadcastReceivers.size();
-        for (int i=0; i<N; i++) {
-            ResolveInfo ri = broadcastReceivers.get(i);
-            ActivityInfo ai = ri.activityInfo;
-            if ((ai.applicationInfo.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0) {
-                continue;
-            }
-            if (pkgName.equals(ai.packageName)) {
-                ComponentName component = new ComponentName(ai.packageName, ai.name);
-                Provider p = lookupProviderLocked(component);
-                if (p == null) {
-                    if (addProviderLocked(ri)) {
-                        keep.add(ai.name);
-                    }
-                } else {
-                    Provider parsed = parseProviderInfoXml(component, ri);
-                    if (parsed != null) {
-                        keep.add(ai.name);
-                        // Use the new AppWidgetProviderInfo.
-                        p.info = parsed.info;
-                        // If it's enabled
-                        final int M = p.instances.size();
-                        if (M > 0) {
-                            int[] appWidgetIds = getAppWidgetIds(p);
-                            // Reschedule for the new updatePeriodMillis (don't worry about handling
-                            // it specially if updatePeriodMillis didn't change because we just sent
-                            // an update, and the next one will be updatePeriodMillis from now).
-                            cancelBroadcasts(p);
-                            registerForBroadcastsLocked(p, appWidgetIds);
-                            // If it's currently showing, call back with the new AppWidgetProviderInfo.
-                            for (int j=0; j<M; j++) {
-                                AppWidgetId id = p.instances.get(j);
-                                id.views = null;
-                                if (id.host != null && id.host.callbacks != null) {
-                                    try {
-                                        id.host.callbacks.providerChanged(id.appWidgetId, p.info);
-                                    } catch (RemoteException ex) {
-                                        // It failed; remove the callback. No need to prune because
-                                        // we know that this host is still referenced by this
-                                        // instance.
-                                        id.host.callbacks = null;
-                                    }
-                                }
-                            }
-                            // Now that we've told the host, push out an update.
-                            sendUpdateIntentLocked(p, appWidgetIds);
-                        }
-                    }
-                }
-            }
-        }
-
-        // prune the ones we don't want to keep
-        N = mInstalledProviders.size();
-        for (int i=N-1; i>=0; i--) {
-            Provider p = mInstalledProviders.get(i);
-            if (pkgName.equals(p.info.provider.getPackageName())
-                    && !keep.contains(p.info.provider.getClassName())) {
-                removeProviderLocked(i, p);
-            }
-        }
-    }
-
-    void removeProvidersForPackageLocked(String pkgName) {
-        int N = mInstalledProviders.size();
-        for (int i=N-1; i>=0; i--) {
-            Provider p = mInstalledProviders.get(i);
-            if (pkgName.equals(p.info.provider.getPackageName())) {
-                removeProviderLocked(i, p);
-            }
-        }
-
-        // Delete the hosts for this package too
-        //
-        // By now, we have removed any AppWidgets that were in any hosts here,
-        // so we don't need to worry about sending DISABLE broadcasts to them.
-        N = mHosts.size();
-        for (int i=N-1; i>=0; i--) {
-            Host host = mHosts.get(i);
-            if (pkgName.equals(host.packageName)) {
-                deleteHostLocked(host);
-            }
-        }
-    }
 }
-
diff --git a/services/java/com/android/server/AppWidgetServiceImpl.java b/services/java/com/android/server/AppWidgetServiceImpl.java
new file mode 100644
index 0000000..250386f
--- /dev/null
+++ b/services/java/com/android/server/AppWidgetServiceImpl.java
@@ -0,0 +1,1606 @@
+/*
+ * 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.server;
+
+import android.app.AlarmManager;
+import android.app.PendingIntent;
+import android.appwidget.AppWidgetManager;
+import android.appwidget.AppWidgetProviderInfo;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.ServiceConnection;
+import android.content.Intent.FilterComparison;
+import android.content.pm.ActivityInfo;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.content.pm.ServiceInfo;
+import android.content.res.Resources;
+import android.content.res.TypedArray;
+import android.content.res.XmlResourceParser;
+import android.net.Uri;
+import android.os.Binder;
+import android.os.Bundle;
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.os.SystemClock;
+import android.os.UserId;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.util.Pair;
+import android.util.Slog;
+import android.util.TypedValue;
+import android.util.Xml;
+import android.widget.RemoteViews;
+
+import com.android.internal.appwidget.IAppWidgetHost;
+import com.android.internal.os.AtomicFile;
+import com.android.internal.util.FastXmlSerializer;
+import com.android.internal.widget.IRemoteViewsAdapterConnection;
+import com.android.internal.widget.IRemoteViewsFactory;
+import com.android.server.am.ActivityManagerService;
+
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+import org.xmlpull.v1.XmlSerializer;
+
+import java.io.File;
+import java.io.FileDescriptor;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Set;
+
+class AppWidgetServiceImpl {
+
+    private static final String TAG = "AppWidgetServiceImpl";
+    private static final String SETTINGS_FILENAME = "appwidgets.xml";
+    private static final int MIN_UPDATE_PERIOD = 30 * 60 * 1000; // 30 minutes
+
+    /*
+     * When identifying a Host or Provider based on the calling process, use the uid field. When
+     * identifying a Host or Provider based on a package manager broadcast, use the package given.
+     */
+
+    static class Provider {
+        int uid;
+        AppWidgetProviderInfo info;
+        ArrayList<AppWidgetId> instances = new ArrayList<AppWidgetId>();
+        PendingIntent broadcast;
+        boolean zombie; // if we're in safe mode, don't prune this just because nobody references it
+
+        int tag; // for use while saving state (the index)
+    }
+
+    static class Host {
+        int uid;
+        int hostId;
+        String packageName;
+        ArrayList<AppWidgetId> instances = new ArrayList<AppWidgetId>();
+        IAppWidgetHost callbacks;
+        boolean zombie; // if we're in safe mode, don't prune this just because nobody references it
+
+        int tag; // for use while saving state (the index)
+    }
+
+    static class AppWidgetId {
+        int appWidgetId;
+        Provider provider;
+        RemoteViews views;
+        Host host;
+    }
+
+    /**
+     * Acts as a proxy between the ServiceConnection and the RemoteViewsAdapterConnection. This
+     * needs to be a static inner class since a reference to the ServiceConnection is held globally
+     * and may lead us to leak AppWidgetService instances (if there were more than one).
+     */
+    static class ServiceConnectionProxy implements ServiceConnection {
+        private final IBinder mConnectionCb;
+
+        ServiceConnectionProxy(Pair<Integer, Intent.FilterComparison> key, IBinder connectionCb) {
+            mConnectionCb = connectionCb;
+        }
+
+        public void onServiceConnected(ComponentName name, IBinder service) {
+            final IRemoteViewsAdapterConnection cb = IRemoteViewsAdapterConnection.Stub
+                    .asInterface(mConnectionCb);
+            try {
+                cb.onServiceConnected(service);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+
+        public void onServiceDisconnected(ComponentName name) {
+            disconnect();
+        }
+
+        public void disconnect() {
+            final IRemoteViewsAdapterConnection cb = IRemoteViewsAdapterConnection.Stub
+                    .asInterface(mConnectionCb);
+            try {
+                cb.onServiceDisconnected();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    // Manages active connections to RemoteViewsServices
+    private final HashMap<Pair<Integer, FilterComparison>, ServiceConnection> mBoundRemoteViewsServices = new HashMap<Pair<Integer, FilterComparison>, ServiceConnection>();
+    // Manages persistent references to RemoteViewsServices from different App Widgets
+    private final HashMap<FilterComparison, HashSet<Integer>> mRemoteViewsServicesAppWidgets = new HashMap<FilterComparison, HashSet<Integer>>();
+
+    Context mContext;
+    Locale mLocale;
+    PackageManager mPackageManager;
+    AlarmManager mAlarmManager;
+    ArrayList<Provider> mInstalledProviders = new ArrayList<Provider>();
+    int mNextAppWidgetId = AppWidgetManager.INVALID_APPWIDGET_ID + 1;
+    final ArrayList<AppWidgetId> mAppWidgetIds = new ArrayList<AppWidgetId>();
+    ArrayList<Host> mHosts = new ArrayList<Host>();
+    boolean mSafeMode;
+    int mUserId;
+    boolean mStateLoaded;
+
+    // These are for debugging only -- widgets are going missing in some rare instances
+    ArrayList<Provider> mDeletedProviders = new ArrayList<Provider>();
+    ArrayList<Host> mDeletedHosts = new ArrayList<Host>();
+
+    AppWidgetServiceImpl(Context context, int userId) {
+        mContext = context;
+        mPackageManager = context.getPackageManager();
+        mAlarmManager = (AlarmManager) mContext.getSystemService(Context.ALARM_SERVICE);
+        mUserId = userId;
+    }
+
+    public void systemReady(boolean safeMode) {
+        mSafeMode = safeMode;
+
+        synchronized (mAppWidgetIds) {
+            ensureStateLoadedLocked();
+        }
+    }
+
+    void onConfigurationChanged() {
+        Locale revised = Locale.getDefault();
+        if (revised == null || mLocale == null || !(revised.equals(mLocale))) {
+            mLocale = revised;
+
+            synchronized (mAppWidgetIds) {
+                ensureStateLoadedLocked();
+                int N = mInstalledProviders.size();
+                for (int i = N - 1; i >= 0; i--) {
+                    Provider p = mInstalledProviders.get(i);
+                    String pkgName = p.info.provider.getPackageName();
+                    updateProvidersForPackageLocked(pkgName);
+                }
+                saveStateLocked();
+            }
+        }
+    }
+
+    void onBroadcastReceived(Intent intent) {
+        final String action = intent.getAction();
+        boolean added = false;
+        boolean changed = false;
+        String pkgList[] = null;
+        if (Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE.equals(action)) {
+            pkgList = intent.getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST);
+            added = true;
+        } else if (Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE.equals(action)) {
+            pkgList = intent.getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST);
+            added = false;
+        } else {
+            Uri uri = intent.getData();
+            if (uri == null) {
+                return;
+            }
+            String pkgName = uri.getSchemeSpecificPart();
+            if (pkgName == null) {
+                return;
+            }
+            pkgList = new String[] { pkgName };
+            added = Intent.ACTION_PACKAGE_ADDED.equals(action);
+            changed = Intent.ACTION_PACKAGE_CHANGED.equals(action);
+        }
+        if (pkgList == null || pkgList.length == 0) {
+            return;
+        }
+        if (added || changed) {
+            synchronized (mAppWidgetIds) {
+                ensureStateLoadedLocked();
+                Bundle extras = intent.getExtras();
+                if (changed
+                        || (extras != null && extras.getBoolean(Intent.EXTRA_REPLACING, false))) {
+                    for (String pkgName : pkgList) {
+                        // The package was just upgraded
+                        updateProvidersForPackageLocked(pkgName);
+                    }
+                } else {
+                    // The package was just added
+                    for (String pkgName : pkgList) {
+                        addProvidersForPackageLocked(pkgName);
+                    }
+                }
+                saveStateLocked();
+            }
+        } else {
+            Bundle extras = intent.getExtras();
+            if (extras != null && extras.getBoolean(Intent.EXTRA_REPLACING, false)) {
+                // The package is being updated. We'll receive a PACKAGE_ADDED shortly.
+            } else {
+                synchronized (mAppWidgetIds) {
+                    ensureStateLoadedLocked();
+                    for (String pkgName : pkgList) {
+                        removeProvidersForPackageLocked(pkgName);
+                        saveStateLocked();
+                    }
+                }
+            }
+        }
+    }
+
+    private void dumpProvider(Provider p, int index, PrintWriter pw) {
+        AppWidgetProviderInfo info = p.info;
+        pw.print("  ["); pw.print(index); pw.print("] provider ");
+                pw.print(info.provider.flattenToShortString());
+                pw.println(':');
+        pw.print("    min=("); pw.print(info.minWidth);
+                pw.print("x"); pw.print(info.minHeight);
+        pw.print(")   minResize=("); pw.print(info.minResizeWidth);
+                pw.print("x"); pw.print(info.minResizeHeight);
+                pw.print(") updatePeriodMillis=");
+                pw.print(info.updatePeriodMillis);
+                pw.print(" resizeMode=");
+                pw.print(info.resizeMode);
+                pw.print(" autoAdvanceViewId=");
+                pw.print(info.autoAdvanceViewId);
+                pw.print(" initialLayout=#");
+                pw.print(Integer.toHexString(info.initialLayout));
+                pw.print(" zombie="); pw.println(p.zombie);
+    }
+
+    private void dumpHost(Host host, int index, PrintWriter pw) {
+        pw.print("  ["); pw.print(index); pw.print("] hostId=");
+                pw.print(host.hostId); pw.print(' ');
+                pw.print(host.packageName); pw.print('/');
+        pw.print(host.uid); pw.println(':');
+        pw.print("    callbacks="); pw.println(host.callbacks);
+        pw.print("    instances.size="); pw.print(host.instances.size());
+                pw.print(" zombie="); pw.println(host.zombie);
+    }
+
+    private void dumpAppWidgetId(AppWidgetId id, int index, PrintWriter pw) {
+        pw.print("  ["); pw.print(index); pw.print("] id=");
+                pw.println(id.appWidgetId);
+        pw.print("    hostId=");
+                pw.print(id.host.hostId); pw.print(' ');
+                pw.print(id.host.packageName); pw.print('/');
+                pw.println(id.host.uid);
+        if (id.provider != null) {
+            pw.print("    provider=");
+                    pw.println(id.provider.info.provider.flattenToShortString());
+        }
+        if (id.host != null) {
+            pw.print("    host.callbacks="); pw.println(id.host.callbacks);
+        }
+        if (id.views != null) {
+            pw.print("    views="); pw.println(id.views);
+        }
+    }
+
+    void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
+        if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DUMP)
+                != PackageManager.PERMISSION_GRANTED) {
+            pw.println("Permission Denial: can't dump from from pid="
+                    + Binder.getCallingPid()
+                    + ", uid=" + Binder.getCallingUid());
+            return;
+        }
+
+        synchronized (mAppWidgetIds) {
+            int N = mInstalledProviders.size();
+            pw.println("Providers:");
+            for (int i=0; i<N; i++) {
+                dumpProvider(mInstalledProviders.get(i), i, pw);
+            }
+
+            N = mAppWidgetIds.size();
+            pw.println(" ");
+            pw.println("AppWidgetIds:");
+            for (int i=0; i<N; i++) {
+                dumpAppWidgetId(mAppWidgetIds.get(i), i, pw);
+            }
+
+            N = mHosts.size();
+            pw.println(" ");
+            pw.println("Hosts:");
+            for (int i=0; i<N; i++) {
+                dumpHost(mHosts.get(i), i, pw);
+            }
+
+            N = mDeletedProviders.size();
+            pw.println(" ");
+            pw.println("Deleted Providers:");
+            for (int i=0; i<N; i++) {
+                dumpProvider(mDeletedProviders.get(i), i, pw);
+            }
+
+            N = mDeletedHosts.size();
+            pw.println(" ");
+            pw.println("Deleted Hosts:");
+            for (int i=0; i<N; i++) {
+                dumpHost(mDeletedHosts.get(i), i, pw);
+            }
+        }
+    }
+
+    private void ensureStateLoadedLocked() {
+        if (!mStateLoaded) {
+            loadAppWidgetList();
+            loadStateLocked();
+            mStateLoaded = true;
+        }
+    }
+
+    public int allocateAppWidgetId(String packageName, int hostId) {
+        int callingUid = enforceCallingUid(packageName);
+        synchronized (mAppWidgetIds) {
+            ensureStateLoadedLocked();
+            int appWidgetId = mNextAppWidgetId++;
+
+            Host host = lookupOrAddHostLocked(callingUid, packageName, hostId);
+
+            AppWidgetId id = new AppWidgetId();
+            id.appWidgetId = appWidgetId;
+            id.host = host;
+
+            host.instances.add(id);
+            mAppWidgetIds.add(id);
+
+            saveStateLocked();
+
+            return appWidgetId;
+        }
+    }
+
+    public void deleteAppWidgetId(int appWidgetId) {
+        synchronized (mAppWidgetIds) {
+            ensureStateLoadedLocked();
+            AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
+            if (id != null) {
+                deleteAppWidgetLocked(id);
+                saveStateLocked();
+            }
+        }
+    }
+
+    public void deleteHost(int hostId) {
+        synchronized (mAppWidgetIds) {
+            ensureStateLoadedLocked();
+            int callingUid = Binder.getCallingUid();
+            Host host = lookupHostLocked(callingUid, hostId);
+            if (host != null) {
+                deleteHostLocked(host);
+                saveStateLocked();
+            }
+        }
+    }
+
+    public void deleteAllHosts() {
+        synchronized (mAppWidgetIds) {
+            ensureStateLoadedLocked();
+            int callingUid = Binder.getCallingUid();
+            final int N = mHosts.size();
+            boolean changed = false;
+            for (int i = N - 1; i >= 0; i--) {
+                Host host = mHosts.get(i);
+                if (host.uid == callingUid) {
+                    deleteHostLocked(host);
+                    changed = true;
+                }
+            }
+            if (changed) {
+                saveStateLocked();
+            }
+        }
+    }
+
+    void deleteHostLocked(Host host) {
+        final int N = host.instances.size();
+        for (int i = N - 1; i >= 0; i--) {
+            AppWidgetId id = host.instances.get(i);
+            deleteAppWidgetLocked(id);
+        }
+        host.instances.clear();
+        mHosts.remove(host);
+        mDeletedHosts.add(host);
+        // it's gone or going away, abruptly drop the callback connection
+        host.callbacks = null;
+    }
+
+    void deleteAppWidgetLocked(AppWidgetId id) {
+        // We first unbind all services that are bound to this id
+        unbindAppWidgetRemoteViewsServicesLocked(id);
+
+        Host host = id.host;
+        host.instances.remove(id);
+        pruneHostLocked(host);
+
+        mAppWidgetIds.remove(id);
+
+        Provider p = id.provider;
+        if (p != null) {
+            p.instances.remove(id);
+            if (!p.zombie) {
+                // send the broacast saying that this appWidgetId has been deleted
+                Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_DELETED);
+                intent.setComponent(p.info.provider);
+                intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, id.appWidgetId);
+                mContext.sendBroadcast(intent);
+                if (p.instances.size() == 0) {
+                    // cancel the future updates
+                    cancelBroadcasts(p);
+
+                    // send the broacast saying that the provider is not in use any more
+                    intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_DISABLED);
+                    intent.setComponent(p.info.provider);
+                    mContext.sendBroadcast(intent);
+                }
+            }
+        }
+    }
+
+    void cancelBroadcasts(Provider p) {
+        if (p.broadcast != null) {
+            mAlarmManager.cancel(p.broadcast);
+            long token = Binder.clearCallingIdentity();
+            try {
+                p.broadcast.cancel();
+            } finally {
+                Binder.restoreCallingIdentity(token);
+            }
+            p.broadcast = null;
+        }
+    }
+
+    public void bindAppWidgetId(int appWidgetId, ComponentName provider) {
+        mContext.enforceCallingPermission(android.Manifest.permission.BIND_APPWIDGET,
+                "bindGagetId appWidgetId=" + appWidgetId + " provider=" + provider);
+
+        final long ident = Binder.clearCallingIdentity();
+        try {
+            synchronized (mAppWidgetIds) {
+                ensureStateLoadedLocked();
+                AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
+                if (id == null) {
+                    throw new IllegalArgumentException("bad appWidgetId");
+                }
+                if (id.provider != null) {
+                    throw new IllegalArgumentException("appWidgetId " + appWidgetId
+                            + " already bound to " + id.provider.info.provider);
+                }
+                Provider p = lookupProviderLocked(provider);
+                if (p == null) {
+                    throw new IllegalArgumentException("not a appwidget provider: " + provider);
+                }
+                if (p.zombie) {
+                    throw new IllegalArgumentException("can't bind to a 3rd party provider in"
+                            + " safe mode: " + provider);
+                }
+
+                Binder.restoreCallingIdentity(ident);
+
+                id.provider = p;
+                p.instances.add(id);
+                int instancesSize = p.instances.size();
+                if (instancesSize == 1) {
+                    // tell the provider that it's ready
+                    sendEnableIntentLocked(p);
+                }
+
+                // send an update now -- We need this update now, and just for this appWidgetId.
+                // It's less critical when the next one happens, so when we schedule the next one,
+                // we add updatePeriodMillis to its start time. That time will have some slop,
+                // but that's okay.
+                sendUpdateIntentLocked(p, new int[] { appWidgetId });
+
+                // schedule the future updates
+                registerForBroadcastsLocked(p, getAppWidgetIds(p));
+                saveStateLocked();
+            }
+        } finally {
+            Binder.restoreCallingIdentity(ident);
+        }
+    }
+
+    // Binds to a specific RemoteViewsService
+    public void bindRemoteViewsService(int appWidgetId, Intent intent, IBinder connection) {
+        synchronized (mAppWidgetIds) {
+            ensureStateLoadedLocked();
+            AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
+            if (id == null) {
+                throw new IllegalArgumentException("bad appWidgetId");
+            }
+            final ComponentName componentName = intent.getComponent();
+            try {
+                final ServiceInfo si = mContext.getPackageManager().getServiceInfo(componentName,
+                        PackageManager.GET_PERMISSIONS);
+                if (!android.Manifest.permission.BIND_REMOTEVIEWS.equals(si.permission)) {
+                    throw new SecurityException("Selected service does not require "
+                            + android.Manifest.permission.BIND_REMOTEVIEWS + ": " + componentName);
+                }
+            } catch (PackageManager.NameNotFoundException e) {
+                throw new IllegalArgumentException("Unknown component " + componentName);
+            }
+
+            // If there is already a connection made for this service intent, then disconnect from
+            // that first. (This does not allow multiple connections to the same service under
+            // the same key)
+            ServiceConnectionProxy conn = null;
+            FilterComparison fc = new FilterComparison(intent);
+            Pair<Integer, FilterComparison> key = Pair.create(appWidgetId, fc);
+            if (mBoundRemoteViewsServices.containsKey(key)) {
+                conn = (ServiceConnectionProxy) mBoundRemoteViewsServices.get(key);
+                conn.disconnect();
+                mContext.unbindService(conn);
+                mBoundRemoteViewsServices.remove(key);
+            }
+
+            // Bind to the RemoteViewsService (which will trigger a callback to the
+            // RemoteViewsAdapter.onServiceConnected())
+            final long token = Binder.clearCallingIdentity();
+            try {
+                conn = new ServiceConnectionProxy(key, connection);
+                mContext.bindService(intent, conn, Context.BIND_AUTO_CREATE);
+                mBoundRemoteViewsServices.put(key, conn);
+            } finally {
+                Binder.restoreCallingIdentity(token);
+            }
+
+            // Add it to the mapping of RemoteViewsService to appWidgetIds so that we can determine
+            // when we can call back to the RemoteViewsService later to destroy associated
+            // factories.
+            incrementAppWidgetServiceRefCount(appWidgetId, fc);
+        }
+    }
+
+    // Unbinds from a specific RemoteViewsService
+    public void unbindRemoteViewsService(int appWidgetId, Intent intent) {
+        synchronized (mAppWidgetIds) {
+            ensureStateLoadedLocked();
+            // Unbind from the RemoteViewsService (which will trigger a callback to the bound
+            // RemoteViewsAdapter)
+            Pair<Integer, FilterComparison> key = Pair.create(appWidgetId, new FilterComparison(
+                    intent));
+            if (mBoundRemoteViewsServices.containsKey(key)) {
+                // We don't need to use the appWidgetId until after we are sure there is something
+                // to unbind. Note that this may mask certain issues with apps calling unbind()
+                // more than necessary.
+                AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
+                if (id == null) {
+                    throw new IllegalArgumentException("bad appWidgetId");
+                }
+
+                ServiceConnectionProxy conn = (ServiceConnectionProxy) mBoundRemoteViewsServices
+                        .get(key);
+                conn.disconnect();
+                mContext.unbindService(conn);
+                mBoundRemoteViewsServices.remove(key);
+            } else {
+                Log.e("AppWidgetService", "Error (unbindRemoteViewsService): Connection not bound");
+            }
+        }
+    }
+
+    // Unbinds from a RemoteViewsService when we delete an app widget
+    private void unbindAppWidgetRemoteViewsServicesLocked(AppWidgetId id) {
+        int appWidgetId = id.appWidgetId;
+        // Unbind all connections to Services bound to this AppWidgetId
+        Iterator<Pair<Integer, Intent.FilterComparison>> it = mBoundRemoteViewsServices.keySet()
+                .iterator();
+        while (it.hasNext()) {
+            final Pair<Integer, Intent.FilterComparison> key = it.next();
+            if (key.first.intValue() == appWidgetId) {
+                final ServiceConnectionProxy conn = (ServiceConnectionProxy) mBoundRemoteViewsServices
+                        .get(key);
+                conn.disconnect();
+                mContext.unbindService(conn);
+                it.remove();
+            }
+        }
+
+        // Check if we need to destroy any services (if no other app widgets are
+        // referencing the same service)
+        decrementAppWidgetServiceRefCount(appWidgetId);
+    }
+
+    // Destroys the cached factory on the RemoteViewsService's side related to the specified intent
+    private void destroyRemoteViewsService(final Intent intent) {
+        final ServiceConnection conn = new ServiceConnection() {
+            @Override
+            public void onServiceConnected(ComponentName name, IBinder service) {
+                final IRemoteViewsFactory cb = IRemoteViewsFactory.Stub.asInterface(service);
+                try {
+                    cb.onDestroy(intent);
+                } catch (RemoteException e) {
+                    e.printStackTrace();
+                } catch (RuntimeException e) {
+                    e.printStackTrace();
+                }
+                mContext.unbindService(this);
+            }
+
+            @Override
+            public void onServiceDisconnected(android.content.ComponentName name) {
+                // Do nothing
+            }
+        };
+
+        // Bind to the service and remove the static intent->factory mapping in the
+        // RemoteViewsService.
+        final long token = Binder.clearCallingIdentity();
+        try {
+            mContext.bindService(intent, conn, Context.BIND_AUTO_CREATE);
+        } finally {
+            Binder.restoreCallingIdentity(token);
+        }
+    }
+
+    // Adds to the ref-count for a given RemoteViewsService intent
+    private void incrementAppWidgetServiceRefCount(int appWidgetId, FilterComparison fc) {
+        HashSet<Integer> appWidgetIds = null;
+        if (mRemoteViewsServicesAppWidgets.containsKey(fc)) {
+            appWidgetIds = mRemoteViewsServicesAppWidgets.get(fc);
+        } else {
+            appWidgetIds = new HashSet<Integer>();
+            mRemoteViewsServicesAppWidgets.put(fc, appWidgetIds);
+        }
+        appWidgetIds.add(appWidgetId);
+    }
+
+    // Subtracts from the ref-count for a given RemoteViewsService intent, prompting a delete if
+    // the ref-count reaches zero.
+    private void decrementAppWidgetServiceRefCount(int appWidgetId) {
+        Iterator<FilterComparison> it = mRemoteViewsServicesAppWidgets.keySet().iterator();
+        while (it.hasNext()) {
+            final FilterComparison key = it.next();
+            final HashSet<Integer> ids = mRemoteViewsServicesAppWidgets.get(key);
+            if (ids.remove(appWidgetId)) {
+                // If we have removed the last app widget referencing this service, then we
+                // should destroy it and remove it from this set
+                if (ids.isEmpty()) {
+                    destroyRemoteViewsService(key.getIntent());
+                    it.remove();
+                }
+            }
+        }
+    }
+
+    public AppWidgetProviderInfo getAppWidgetInfo(int appWidgetId) {
+        synchronized (mAppWidgetIds) {
+            ensureStateLoadedLocked();
+            AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
+            if (id != null && id.provider != null && !id.provider.zombie) {
+                return id.provider.info;
+            }
+            return null;
+        }
+    }
+
+    public RemoteViews getAppWidgetViews(int appWidgetId) {
+        synchronized (mAppWidgetIds) {
+            ensureStateLoadedLocked();
+            AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
+            if (id != null) {
+                return id.views;
+            }
+            return null;
+        }
+    }
+
+    public List<AppWidgetProviderInfo> getInstalledProviders() {
+        synchronized (mAppWidgetIds) {
+            ensureStateLoadedLocked();
+            final int N = mInstalledProviders.size();
+            ArrayList<AppWidgetProviderInfo> result = new ArrayList<AppWidgetProviderInfo>(N);
+            for (int i = 0; i < N; i++) {
+                Provider p = mInstalledProviders.get(i);
+                if (!p.zombie) {
+                    result.add(p.info);
+                }
+            }
+            return result;
+        }
+    }
+
+    public void updateAppWidgetIds(int[] appWidgetIds, RemoteViews views) {
+        if (appWidgetIds == null) {
+            return;
+        }
+        if (appWidgetIds.length == 0) {
+            return;
+        }
+        final int N = appWidgetIds.length;
+
+        synchronized (mAppWidgetIds) {
+            ensureStateLoadedLocked();
+            for (int i = 0; i < N; i++) {
+                AppWidgetId id = lookupAppWidgetIdLocked(appWidgetIds[i]);
+                updateAppWidgetInstanceLocked(id, views);
+            }
+        }
+    }
+
+    public void partiallyUpdateAppWidgetIds(int[] appWidgetIds, RemoteViews views) {
+        if (appWidgetIds == null) {
+            return;
+        }
+        if (appWidgetIds.length == 0) {
+            return;
+        }
+        final int N = appWidgetIds.length;
+
+        synchronized (mAppWidgetIds) {
+            ensureStateLoadedLocked();
+            for (int i = 0; i < N; i++) {
+                AppWidgetId id = lookupAppWidgetIdLocked(appWidgetIds[i]);
+                updateAppWidgetInstanceLocked(id, views, true);
+            }
+        }
+    }
+
+    public void notifyAppWidgetViewDataChanged(int[] appWidgetIds, int viewId) {
+        if (appWidgetIds == null) {
+            return;
+        }
+        if (appWidgetIds.length == 0) {
+            return;
+        }
+        final int N = appWidgetIds.length;
+
+        synchronized (mAppWidgetIds) {
+            ensureStateLoadedLocked();
+            for (int i = 0; i < N; i++) {
+                AppWidgetId id = lookupAppWidgetIdLocked(appWidgetIds[i]);
+                notifyAppWidgetViewDataChangedInstanceLocked(id, viewId);
+            }
+        }
+    }
+
+    public void updateAppWidgetProvider(ComponentName provider, RemoteViews views) {
+        synchronized (mAppWidgetIds) {
+            ensureStateLoadedLocked();
+            Provider p = lookupProviderLocked(provider);
+            if (p == null) {
+                Slog.w(TAG, "updateAppWidgetProvider: provider doesn't exist: " + provider);
+                return;
+            }
+            ArrayList<AppWidgetId> instances = p.instances;
+            final int callingUid = Binder.getCallingUid();
+            final int N = instances.size();
+            for (int i = 0; i < N; i++) {
+                AppWidgetId id = instances.get(i);
+                if (canAccessAppWidgetId(id, callingUid)) {
+                    updateAppWidgetInstanceLocked(id, views);
+                }
+            }
+        }
+    }
+
+    void updateAppWidgetInstanceLocked(AppWidgetId id, RemoteViews views) {
+        updateAppWidgetInstanceLocked(id, views, false);
+    }
+
+    void updateAppWidgetInstanceLocked(AppWidgetId id, RemoteViews views, boolean isPartialUpdate) {
+        // allow for stale appWidgetIds and other badness
+        // lookup also checks that the calling process can access the appWidgetId
+        // drop unbound appWidgetIds (shouldn't be possible under normal circumstances)
+        if (id != null && id.provider != null && !id.provider.zombie && !id.host.zombie) {
+
+            // We do not want to save this RemoteViews
+            if (!isPartialUpdate)
+                id.views = views;
+
+            // is anyone listening?
+            if (id.host.callbacks != null) {
+                try {
+                    // the lock is held, but this is a oneway call
+                    id.host.callbacks.updateAppWidget(id.appWidgetId, views);
+                } catch (RemoteException e) {
+                    // It failed; remove the callback. No need to prune because
+                    // we know that this host is still referenced by this instance.
+                    id.host.callbacks = null;
+                }
+            }
+        }
+    }
+
+    void notifyAppWidgetViewDataChangedInstanceLocked(AppWidgetId id, int viewId) {
+        // allow for stale appWidgetIds and other badness
+        // lookup also checks that the calling process can access the appWidgetId
+        // drop unbound appWidgetIds (shouldn't be possible under normal circumstances)
+        if (id != null && id.provider != null && !id.provider.zombie && !id.host.zombie) {
+            // is anyone listening?
+            if (id.host.callbacks != null) {
+                try {
+                    // the lock is held, but this is a oneway call
+                    id.host.callbacks.viewDataChanged(id.appWidgetId, viewId);
+                } catch (RemoteException e) {
+                    // It failed; remove the callback. No need to prune because
+                    // we know that this host is still referenced by this instance.
+                    id.host.callbacks = null;
+                }
+            }
+
+            // If the host is unavailable, then we call the associated
+            // RemoteViewsFactory.onDataSetChanged() directly
+            if (id.host.callbacks == null) {
+                Set<FilterComparison> keys = mRemoteViewsServicesAppWidgets.keySet();
+                for (FilterComparison key : keys) {
+                    if (mRemoteViewsServicesAppWidgets.get(key).contains(id.appWidgetId)) {
+                        Intent intent = key.getIntent();
+
+                        final ServiceConnection conn = new ServiceConnection() {
+                            @Override
+                            public void onServiceConnected(ComponentName name, IBinder service) {
+                                IRemoteViewsFactory cb = IRemoteViewsFactory.Stub
+                                        .asInterface(service);
+                                try {
+                                    cb.onDataSetChangedAsync();
+                                } catch (RemoteException e) {
+                                    e.printStackTrace();
+                                } catch (RuntimeException e) {
+                                    e.printStackTrace();
+                                }
+                                mContext.unbindService(this);
+                            }
+
+                            @Override
+                            public void onServiceDisconnected(android.content.ComponentName name) {
+                                // Do nothing
+                            }
+                        };
+
+                        // Bind to the service and call onDataSetChanged()
+                        final long token = Binder.clearCallingIdentity();
+                        try {
+                            mContext.bindService(intent, conn, Context.BIND_AUTO_CREATE);
+                        } finally {
+                            Binder.restoreCallingIdentity(token);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    public int[] startListening(IAppWidgetHost callbacks, String packageName, int hostId,
+            List<RemoteViews> updatedViews) {
+        int callingUid = enforceCallingUid(packageName);
+        synchronized (mAppWidgetIds) {
+            ensureStateLoadedLocked();
+            Host host = lookupOrAddHostLocked(callingUid, packageName, hostId);
+            host.callbacks = callbacks;
+
+            updatedViews.clear();
+
+            ArrayList<AppWidgetId> instances = host.instances;
+            int N = instances.size();
+            int[] updatedIds = new int[N];
+            for (int i = 0; i < N; i++) {
+                AppWidgetId id = instances.get(i);
+                updatedIds[i] = id.appWidgetId;
+                updatedViews.add(id.views);
+            }
+            return updatedIds;
+        }
+    }
+
+    public void stopListening(int hostId) {
+        synchronized (mAppWidgetIds) {
+            ensureStateLoadedLocked();
+            Host host = lookupHostLocked(Binder.getCallingUid(), hostId);
+            if (host != null) {
+                host.callbacks = null;
+                pruneHostLocked(host);
+            }
+        }
+    }
+
+    boolean canAccessAppWidgetId(AppWidgetId id, int callingUid) {
+        if (id.host.uid == callingUid) {
+            // Apps hosting the AppWidget have access to it.
+            return true;
+        }
+        if (id.provider != null && id.provider.uid == callingUid) {
+            // Apps providing the AppWidget have access to it (if the appWidgetId has been bound)
+            return true;
+        }
+        if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.BIND_APPWIDGET) == PackageManager.PERMISSION_GRANTED) {
+            // Apps that can bind have access to all appWidgetIds.
+            return true;
+        }
+        // Nobody else can access it.
+        return false;
+    }
+
+    AppWidgetId lookupAppWidgetIdLocked(int appWidgetId) {
+        int callingUid = Binder.getCallingUid();
+        final int N = mAppWidgetIds.size();
+        for (int i = 0; i < N; i++) {
+            AppWidgetId id = mAppWidgetIds.get(i);
+            if (id.appWidgetId == appWidgetId && canAccessAppWidgetId(id, callingUid)) {
+                return id;
+            }
+        }
+        return null;
+    }
+
+    Provider lookupProviderLocked(ComponentName provider) {
+        final int N = mInstalledProviders.size();
+        for (int i = 0; i < N; i++) {
+            Provider p = mInstalledProviders.get(i);
+            if (p.info.provider.equals(provider)) {
+                return p;
+            }
+        }
+        return null;
+    }
+
+    Host lookupHostLocked(int uid, int hostId) {
+        final int N = mHosts.size();
+        for (int i = 0; i < N; i++) {
+            Host h = mHosts.get(i);
+            if (h.uid == uid && h.hostId == hostId) {
+                return h;
+            }
+        }
+        return null;
+    }
+
+    Host lookupOrAddHostLocked(int uid, String packageName, int hostId) {
+        final int N = mHosts.size();
+        for (int i = 0; i < N; i++) {
+            Host h = mHosts.get(i);
+            if (h.hostId == hostId && h.packageName.equals(packageName)) {
+                return h;
+            }
+        }
+        Host host = new Host();
+        host.packageName = packageName;
+        host.uid = uid;
+        host.hostId = hostId;
+        mHosts.add(host);
+        return host;
+    }
+
+    void pruneHostLocked(Host host) {
+        if (host.instances.size() == 0 && host.callbacks == null) {
+            mHosts.remove(host);
+        }
+    }
+
+    void loadAppWidgetList() {
+        PackageManager pm = mPackageManager;
+
+        Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
+        List<ResolveInfo> broadcastReceivers = pm.queryBroadcastReceivers(intent,
+                PackageManager.GET_META_DATA);
+
+        final int N = broadcastReceivers == null ? 0 : broadcastReceivers.size();
+        for (int i = 0; i < N; i++) {
+            ResolveInfo ri = broadcastReceivers.get(i);
+            addProviderLocked(ri);
+        }
+    }
+
+    boolean addProviderLocked(ResolveInfo ri) {
+        if ((ri.activityInfo.applicationInfo.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0) {
+            return false;
+        }
+        if (!ri.activityInfo.isEnabled()) {
+            return false;
+        }
+        Provider p = parseProviderInfoXml(new ComponentName(ri.activityInfo.packageName,
+                ri.activityInfo.name), ri);
+        if (p != null) {
+            mInstalledProviders.add(p);
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    void removeProviderLocked(int index, Provider p) {
+        int N = p.instances.size();
+        for (int i = 0; i < N; i++) {
+            AppWidgetId id = p.instances.get(i);
+            // Call back with empty RemoteViews
+            updateAppWidgetInstanceLocked(id, null);
+            // Stop telling the host about updates for this from now on
+            cancelBroadcasts(p);
+            // clear out references to this appWidgetId
+            id.host.instances.remove(id);
+            mAppWidgetIds.remove(id);
+            id.provider = null;
+            pruneHostLocked(id.host);
+            id.host = null;
+        }
+        p.instances.clear();
+        mInstalledProviders.remove(index);
+        mDeletedProviders.add(p);
+        // no need to send the DISABLE broadcast, since the receiver is gone anyway
+        cancelBroadcasts(p);
+    }
+
+    void sendEnableIntentLocked(Provider p) {
+        Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_ENABLED);
+        intent.setComponent(p.info.provider);
+        mContext.sendBroadcast(intent);
+    }
+
+    void sendUpdateIntentLocked(Provider p, int[] appWidgetIds) {
+        if (appWidgetIds != null && appWidgetIds.length > 0) {
+            Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
+            intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, appWidgetIds);
+            intent.setComponent(p.info.provider);
+            mContext.sendBroadcast(intent);
+        }
+    }
+
+    void registerForBroadcastsLocked(Provider p, int[] appWidgetIds) {
+        if (p.info.updatePeriodMillis > 0) {
+            // if this is the first instance, set the alarm. otherwise,
+            // rely on the fact that we've already set it and that
+            // PendingIntent.getBroadcast will update the extras.
+            boolean alreadyRegistered = p.broadcast != null;
+            Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
+            intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, appWidgetIds);
+            intent.setComponent(p.info.provider);
+            long token = Binder.clearCallingIdentity();
+            try {
+                p.broadcast = PendingIntent.getBroadcast(mContext, 1, intent,
+                        PendingIntent.FLAG_UPDATE_CURRENT);
+            } finally {
+                Binder.restoreCallingIdentity(token);
+            }
+            if (!alreadyRegistered) {
+                long period = p.info.updatePeriodMillis;
+                if (period < MIN_UPDATE_PERIOD) {
+                    period = MIN_UPDATE_PERIOD;
+                }
+                mAlarmManager.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock
+                        .elapsedRealtime()
+                        + period, period, p.broadcast);
+            }
+        }
+    }
+
+    static int[] getAppWidgetIds(Provider p) {
+        int instancesSize = p.instances.size();
+        int appWidgetIds[] = new int[instancesSize];
+        for (int i = 0; i < instancesSize; i++) {
+            appWidgetIds[i] = p.instances.get(i).appWidgetId;
+        }
+        return appWidgetIds;
+    }
+
+    public int[] getAppWidgetIds(ComponentName provider) {
+        synchronized (mAppWidgetIds) {
+            ensureStateLoadedLocked();
+            Provider p = lookupProviderLocked(provider);
+            if (p != null && Binder.getCallingUid() == p.uid) {
+                return getAppWidgetIds(p);
+            } else {
+                return new int[0];
+            }
+        }
+    }
+
+    private Provider parseProviderInfoXml(ComponentName component, ResolveInfo ri) {
+        Provider p = null;
+
+        ActivityInfo activityInfo = ri.activityInfo;
+        XmlResourceParser parser = null;
+        try {
+            parser = activityInfo.loadXmlMetaData(mPackageManager,
+                    AppWidgetManager.META_DATA_APPWIDGET_PROVIDER);
+            if (parser == null) {
+                Slog.w(TAG, "No " + AppWidgetManager.META_DATA_APPWIDGET_PROVIDER
+                        + " meta-data for " + "AppWidget provider '" + component + '\'');
+                return null;
+            }
+
+            AttributeSet attrs = Xml.asAttributeSet(parser);
+
+            int type;
+            while ((type = parser.next()) != XmlPullParser.END_DOCUMENT
+                    && type != XmlPullParser.START_TAG) {
+                // drain whitespace, comments, etc.
+            }
+
+            String nodeName = parser.getName();
+            if (!"appwidget-provider".equals(nodeName)) {
+                Slog.w(TAG, "Meta-data does not start with appwidget-provider tag for"
+                        + " AppWidget provider '" + component + '\'');
+                return null;
+            }
+
+            p = new Provider();
+            AppWidgetProviderInfo info = p.info = new AppWidgetProviderInfo();
+            info.provider = component;
+            p.uid = activityInfo.applicationInfo.uid;
+
+            Resources res = mPackageManager
+                    .getResourcesForApplication(activityInfo.applicationInfo);
+
+            TypedArray sa = res.obtainAttributes(attrs,
+                    com.android.internal.R.styleable.AppWidgetProviderInfo);
+
+            // These dimensions has to be resolved in the application's context.
+            // We simply send back the raw complex data, which will be
+            // converted to dp in {@link AppWidgetManager#getAppWidgetInfo}.
+            TypedValue value = sa
+                    .peekValue(com.android.internal.R.styleable.AppWidgetProviderInfo_minWidth);
+            info.minWidth = value != null ? value.data : 0;
+            value = sa.peekValue(com.android.internal.R.styleable.AppWidgetProviderInfo_minHeight);
+            info.minHeight = value != null ? value.data : 0;
+            value = sa.peekValue(
+                    com.android.internal.R.styleable.AppWidgetProviderInfo_minResizeWidth);
+            info.minResizeWidth = value != null ? value.data : info.minWidth;
+            value = sa.peekValue(
+                    com.android.internal.R.styleable.AppWidgetProviderInfo_minResizeHeight);
+            info.minResizeHeight = value != null ? value.data : info.minHeight;
+            info.updatePeriodMillis = sa.getInt(
+                    com.android.internal.R.styleable.AppWidgetProviderInfo_updatePeriodMillis, 0);
+            info.initialLayout = sa.getResourceId(
+                    com.android.internal.R.styleable.AppWidgetProviderInfo_initialLayout, 0);
+            String className = sa
+                    .getString(com.android.internal.R.styleable.AppWidgetProviderInfo_configure);
+            if (className != null) {
+                info.configure = new ComponentName(component.getPackageName(), className);
+            }
+            info.label = activityInfo.loadLabel(mPackageManager).toString();
+            info.icon = ri.getIconResource();
+            info.previewImage = sa.getResourceId(
+                    com.android.internal.R.styleable.AppWidgetProviderInfo_previewImage, 0);
+            info.autoAdvanceViewId = sa.getResourceId(
+                    com.android.internal.R.styleable.AppWidgetProviderInfo_autoAdvanceViewId, -1);
+            info.resizeMode = sa.getInt(
+                    com.android.internal.R.styleable.AppWidgetProviderInfo_resizeMode,
+                    AppWidgetProviderInfo.RESIZE_NONE);
+
+            sa.recycle();
+        } catch (Exception e) {
+            // Ok to catch Exception here, because anything going wrong because
+            // of what a client process passes to us should not be fatal for the
+            // system process.
+            Slog.w(TAG, "XML parsing failed for AppWidget provider '" + component + '\'', e);
+            return null;
+        } finally {
+            if (parser != null)
+                parser.close();
+        }
+        return p;
+    }
+
+    int getUidForPackage(String packageName) throws PackageManager.NameNotFoundException {
+        PackageInfo pkgInfo = mPackageManager.getPackageInfo(packageName, 0);
+        if (pkgInfo == null || pkgInfo.applicationInfo == null) {
+            throw new PackageManager.NameNotFoundException();
+        }
+        return pkgInfo.applicationInfo.uid;
+    }
+
+    int enforceCallingUid(String packageName) throws IllegalArgumentException {
+        int callingUid = Binder.getCallingUid();
+        int packageUid;
+        try {
+            packageUid = getUidForPackage(packageName);
+        } catch (PackageManager.NameNotFoundException ex) {
+            throw new IllegalArgumentException("packageName and uid don't match packageName="
+                    + packageName);
+        }
+        if (!UserId.isSameApp(callingUid, packageUid)) {
+            throw new IllegalArgumentException("packageName and uid don't match packageName="
+                    + packageName);
+        }
+        return callingUid;
+    }
+
+    void sendInitialBroadcasts() {
+        synchronized (mAppWidgetIds) {
+            ensureStateLoadedLocked();
+            final int N = mInstalledProviders.size();
+            for (int i = 0; i < N; i++) {
+                Provider p = mInstalledProviders.get(i);
+                if (p.instances.size() > 0) {
+                    sendEnableIntentLocked(p);
+                    int[] appWidgetIds = getAppWidgetIds(p);
+                    sendUpdateIntentLocked(p, appWidgetIds);
+                    registerForBroadcastsLocked(p, appWidgetIds);
+                }
+            }
+        }
+    }
+
+    // only call from initialization -- it assumes that the data structures are all empty
+    void loadStateLocked() {
+        AtomicFile file = savedStateFile();
+        try {
+            FileInputStream stream = file.openRead();
+            readStateFromFileLocked(stream);
+
+            if (stream != null) {
+                try {
+                    stream.close();
+                } catch (IOException e) {
+                    Slog.w(TAG, "Failed to close state FileInputStream " + e);
+                }
+            }
+        } catch (FileNotFoundException e) {
+            Slog.w(TAG, "Failed to read state: " + e);
+        }
+    }
+
+    void saveStateLocked() {
+        AtomicFile file = savedStateFile();
+        FileOutputStream stream;
+        try {
+            stream = file.startWrite();
+            if (writeStateToFileLocked(stream)) {
+                file.finishWrite(stream);
+            } else {
+                file.failWrite(stream);
+                Slog.w(TAG, "Failed to save state, restoring backup.");
+            }
+        } catch (IOException e) {
+            Slog.w(TAG, "Failed open state file for write: " + e);
+        }
+    }
+
+    boolean writeStateToFileLocked(FileOutputStream stream) {
+        int N;
+
+        try {
+            XmlSerializer out = new FastXmlSerializer();
+            out.setOutput(stream, "utf-8");
+            out.startDocument(null, true);
+            out.startTag(null, "gs");
+
+            int providerIndex = 0;
+            N = mInstalledProviders.size();
+            for (int i = 0; i < N; i++) {
+                Provider p = mInstalledProviders.get(i);
+                if (p.instances.size() > 0) {
+                    out.startTag(null, "p");
+                    out.attribute(null, "pkg", p.info.provider.getPackageName());
+                    out.attribute(null, "cl", p.info.provider.getClassName());
+                    out.endTag(null, "p");
+                    p.tag = providerIndex;
+                    providerIndex++;
+                }
+            }
+
+            N = mHosts.size();
+            for (int i = 0; i < N; i++) {
+                Host host = mHosts.get(i);
+                out.startTag(null, "h");
+                out.attribute(null, "pkg", host.packageName);
+                out.attribute(null, "id", Integer.toHexString(host.hostId));
+                out.endTag(null, "h");
+                host.tag = i;
+            }
+
+            N = mAppWidgetIds.size();
+            for (int i = 0; i < N; i++) {
+                AppWidgetId id = mAppWidgetIds.get(i);
+                out.startTag(null, "g");
+                out.attribute(null, "id", Integer.toHexString(id.appWidgetId));
+                out.attribute(null, "h", Integer.toHexString(id.host.tag));
+                if (id.provider != null) {
+                    out.attribute(null, "p", Integer.toHexString(id.provider.tag));
+                }
+                out.endTag(null, "g");
+            }
+
+            out.endTag(null, "gs");
+
+            out.endDocument();
+            return true;
+        } catch (IOException e) {
+            Slog.w(TAG, "Failed to write state: " + e);
+            return false;
+        }
+    }
+
+    void readStateFromFileLocked(FileInputStream stream) {
+        boolean success = false;
+
+        try {
+            XmlPullParser parser = Xml.newPullParser();
+            parser.setInput(stream, null);
+
+            int type;
+            int providerIndex = 0;
+            HashMap<Integer, Provider> loadedProviders = new HashMap<Integer, Provider>();
+            do {
+                type = parser.next();
+                if (type == XmlPullParser.START_TAG) {
+                    String tag = parser.getName();
+                    if ("p".equals(tag)) {
+                        // TODO: do we need to check that this package has the same signature
+                        // as before?
+                        String pkg = parser.getAttributeValue(null, "pkg");
+                        String cl = parser.getAttributeValue(null, "cl");
+
+                        final PackageManager packageManager = mContext.getPackageManager();
+                        try {
+                            packageManager.getReceiverInfo(new ComponentName(pkg, cl), 0);
+                        } catch (PackageManager.NameNotFoundException e) {
+                            String[] pkgs = packageManager
+                                    .currentToCanonicalPackageNames(new String[] { pkg });
+                            pkg = pkgs[0];
+                        }
+
+                        Provider p = lookupProviderLocked(new ComponentName(pkg, cl));
+                        if (p == null && mSafeMode) {
+                            // if we're in safe mode, make a temporary one
+                            p = new Provider();
+                            p.info = new AppWidgetProviderInfo();
+                            p.info.provider = new ComponentName(pkg, cl);
+                            p.zombie = true;
+                            mInstalledProviders.add(p);
+                        }
+                        if (p != null) {
+                            // if it wasn't uninstalled or something
+                            loadedProviders.put(providerIndex, p);
+                        }
+                        providerIndex++;
+                    } else if ("h".equals(tag)) {
+                        Host host = new Host();
+
+                        // TODO: do we need to check that this package has the same signature
+                        // as before?
+                        host.packageName = parser.getAttributeValue(null, "pkg");
+                        try {
+                            host.uid = getUidForPackage(host.packageName);
+                        } catch (PackageManager.NameNotFoundException ex) {
+                            host.zombie = true;
+                        }
+                        if (!host.zombie || mSafeMode) {
+                            // In safe mode, we don't discard the hosts we don't recognize
+                            // so that they're not pruned from our list. Otherwise, we do.
+                            host.hostId = Integer
+                                    .parseInt(parser.getAttributeValue(null, "id"), 16);
+                            mHosts.add(host);
+                        }
+                    } else if ("g".equals(tag)) {
+                        AppWidgetId id = new AppWidgetId();
+                        id.appWidgetId = Integer.parseInt(parser.getAttributeValue(null, "id"), 16);
+                        if (id.appWidgetId >= mNextAppWidgetId) {
+                            mNextAppWidgetId = id.appWidgetId + 1;
+                        }
+
+                        String providerString = parser.getAttributeValue(null, "p");
+                        if (providerString != null) {
+                            // there's no provider if it hasn't been bound yet.
+                            // maybe we don't have to save this, but it brings the system
+                            // to the state it was in.
+                            int pIndex = Integer.parseInt(providerString, 16);
+                            id.provider = loadedProviders.get(pIndex);
+                            if (false) {
+                                Slog.d(TAG, "bound appWidgetId=" + id.appWidgetId + " to provider "
+                                        + pIndex + " which is " + id.provider);
+                            }
+                            if (id.provider == null) {
+                                // This provider is gone. We just let the host figure out
+                                // that this happened when it fails to load it.
+                                continue;
+                            }
+                        }
+
+                        int hIndex = Integer.parseInt(parser.getAttributeValue(null, "h"), 16);
+                        id.host = mHosts.get(hIndex);
+                        if (id.host == null) {
+                            // This host is gone.
+                            continue;
+                        }
+
+                        if (id.provider != null) {
+                            id.provider.instances.add(id);
+                        }
+                        id.host.instances.add(id);
+                        mAppWidgetIds.add(id);
+                    }
+                }
+            } while (type != XmlPullParser.END_DOCUMENT);
+            success = true;
+        } catch (NullPointerException e) {
+            Slog.w(TAG, "failed parsing " + e);
+        } catch (NumberFormatException e) {
+            Slog.w(TAG, "failed parsing " + e);
+        } catch (XmlPullParserException e) {
+            Slog.w(TAG, "failed parsing " + e);
+        } catch (IOException e) {
+            Slog.w(TAG, "failed parsing " + e);
+        } catch (IndexOutOfBoundsException e) {
+            Slog.w(TAG, "failed parsing " + e);
+        }
+
+        if (success) {
+            // delete any hosts that didn't manage to get connected (should happen)
+            // if it matters, they'll be reconnected.
+            for (int i = mHosts.size() - 1; i >= 0; i--) {
+                pruneHostLocked(mHosts.get(i));
+            }
+        } else {
+            // failed reading, clean up
+            Slog.w(TAG, "Failed to read state, clearing widgets and hosts.");
+
+            mAppWidgetIds.clear();
+            mHosts.clear();
+            final int N = mInstalledProviders.size();
+            for (int i = 0; i < N; i++) {
+                mInstalledProviders.get(i).instances.clear();
+            }
+        }
+    }
+
+    AtomicFile savedStateFile() {
+        int userId = Binder.getOrigCallingUser();
+        File dir = new File("/data/system/users/" + userId);
+        File settingsFile = new File(dir, SETTINGS_FILENAME);
+        if (!dir.exists()) {
+            dir.mkdirs();
+            if (userId == 0) {
+                // Migrate old data
+                File oldFile = new File("/data/system/" + SETTINGS_FILENAME);
+                // Method doesn't throw an exception on failure. Ignore any errors
+                // in moving the file (like non-existence)
+                oldFile.renameTo(settingsFile);
+            }
+        }
+        return new AtomicFile(settingsFile);
+    }
+
+    void addProvidersForPackageLocked(String pkgName) {
+        Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
+        intent.setPackage(pkgName);
+        List<ResolveInfo> broadcastReceivers = mPackageManager.queryBroadcastReceivers(intent,
+                PackageManager.GET_META_DATA);
+
+        final int N = broadcastReceivers == null ? 0 : broadcastReceivers.size();
+        for (int i = 0; i < N; i++) {
+            ResolveInfo ri = broadcastReceivers.get(i);
+            ActivityInfo ai = ri.activityInfo;
+            if ((ai.applicationInfo.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0) {
+                continue;
+            }
+            if (pkgName.equals(ai.packageName)) {
+                addProviderLocked(ri);
+            }
+        }
+    }
+
+    void updateProvidersForPackageLocked(String pkgName) {
+        HashSet<String> keep = new HashSet<String>();
+        Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
+        intent.setPackage(pkgName);
+        List<ResolveInfo> broadcastReceivers = mPackageManager.queryBroadcastReceivers(intent,
+                PackageManager.GET_META_DATA);
+
+        // add the missing ones and collect which ones to keep
+        int N = broadcastReceivers == null ? 0 : broadcastReceivers.size();
+        for (int i = 0; i < N; i++) {
+            ResolveInfo ri = broadcastReceivers.get(i);
+            ActivityInfo ai = ri.activityInfo;
+            if ((ai.applicationInfo.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0) {
+                continue;
+            }
+            if (pkgName.equals(ai.packageName)) {
+                ComponentName component = new ComponentName(ai.packageName, ai.name);
+                Provider p = lookupProviderLocked(component);
+                if (p == null) {
+                    if (addProviderLocked(ri)) {
+                        keep.add(ai.name);
+                    }
+                } else {
+                    Provider parsed = parseProviderInfoXml(component, ri);
+                    if (parsed != null) {
+                        keep.add(ai.name);
+                        // Use the new AppWidgetProviderInfo.
+                        p.info = parsed.info;
+                        // If it's enabled
+                        final int M = p.instances.size();
+                        if (M > 0) {
+                            int[] appWidgetIds = getAppWidgetIds(p);
+                            // Reschedule for the new updatePeriodMillis (don't worry about handling
+                            // it specially if updatePeriodMillis didn't change because we just sent
+                            // an update, and the next one will be updatePeriodMillis from now).
+                            cancelBroadcasts(p);
+                            registerForBroadcastsLocked(p, appWidgetIds);
+                            // If it's currently showing, call back with the new
+                            // AppWidgetProviderInfo.
+                            for (int j = 0; j < M; j++) {
+                                AppWidgetId id = p.instances.get(j);
+                                id.views = null;
+                                if (id.host != null && id.host.callbacks != null) {
+                                    try {
+                                        id.host.callbacks.providerChanged(id.appWidgetId, p.info);
+                                    } catch (RemoteException ex) {
+                                        // It failed; remove the callback. No need to prune because
+                                        // we know that this host is still referenced by this
+                                        // instance.
+                                        id.host.callbacks = null;
+                                    }
+                                }
+                            }
+                            // Now that we've told the host, push out an update.
+                            sendUpdateIntentLocked(p, appWidgetIds);
+                        }
+                    }
+                }
+            }
+        }
+
+        // prune the ones we don't want to keep
+        N = mInstalledProviders.size();
+        for (int i = N - 1; i >= 0; i--) {
+            Provider p = mInstalledProviders.get(i);
+            if (pkgName.equals(p.info.provider.getPackageName())
+                    && !keep.contains(p.info.provider.getClassName())) {
+                removeProviderLocked(i, p);
+            }
+        }
+    }
+
+    void removeProvidersForPackageLocked(String pkgName) {
+        int N = mInstalledProviders.size();
+        for (int i = N - 1; i >= 0; i--) {
+            Provider p = mInstalledProviders.get(i);
+            if (pkgName.equals(p.info.provider.getPackageName())) {
+                removeProviderLocked(i, p);
+            }
+        }
+
+        // Delete the hosts for this package too
+        //
+        // By now, we have removed any AppWidgets that were in any hosts here,
+        // so we don't need to worry about sending DISABLE broadcasts to them.
+        N = mHosts.size();
+        for (int i = N - 1; i >= 0; i--) {
+            Host host = mHosts.get(i);
+            if (pkgName.equals(host.packageName)) {
+                deleteHostLocked(host);
+            }
+        }
+    }
+}
diff --git a/services/java/com/android/server/BackupManagerService.java b/services/java/com/android/server/BackupManagerService.java
index 4ef8837..a7b08f5 100644
--- a/services/java/com/android/server/BackupManagerService.java
+++ b/services/java/com/android/server/BackupManagerService.java
@@ -140,6 +140,8 @@
     static final int BACKUP_FILE_VERSION = 1;
     static final boolean COMPRESS_FULL_BACKUPS = true; // should be true in production
 
+    static final String SHARED_BACKUP_AGENT_PACKAGE = "com.android.sharedstoragebackup";
+
     // How often we perform a backup pass.  Privileged external callers can
     // trigger an immediate pass.
     private static final long BACKUP_INTERVAL = AlarmManager.INTERVAL_HOUR;
@@ -195,7 +197,7 @@
     boolean mProvisioned;
     boolean mAutoRestore;
     PowerManager.WakeLock mWakelock;
-    HandlerThread mHandlerThread = new HandlerThread("backup", Process.THREAD_PRIORITY_BACKGROUND);
+    HandlerThread mHandlerThread;
     BackupHandler mBackupHandler;
     PendingIntent mRunBackupIntent, mRunInitIntent;
     BroadcastReceiver mRunBackupReceiver, mRunInitReceiver;
@@ -235,6 +237,10 @@
     volatile long mLastBackupPass;
     volatile long mNextBackupPass;
 
+    // For debugging, we maintain a progress trace of operations during backup
+    static final boolean DEBUG_BACKUP_TRACE = true;
+    final List<String> mBackupTrace = new ArrayList<String>();
+
     // A similar synchronization mechanism around clearing apps' data for restore
     final Object mClearDataLock = new Object();
     volatile boolean mClearingData;
@@ -652,6 +658,23 @@
         }
     }
 
+    // ----- Debug-only backup operation trace -----
+    void addBackupTrace(String s) {
+        if (DEBUG_BACKUP_TRACE) {
+            synchronized (mBackupTrace) {
+                mBackupTrace.add(s);
+            }
+        }
+    }
+
+    void clearBackupTrace() {
+        if (DEBUG_BACKUP_TRACE) {
+            synchronized (mBackupTrace) {
+                mBackupTrace.clear();
+            }
+        }
+    }
+
     // ----- Main service implementation -----
 
     public BackupManagerService(Context context) {
@@ -1310,14 +1333,10 @@
             }
             if (added) {
                 synchronized (mBackupParticipants) {
-                    for (String pkgName : pkgList) {
-                        if (replacing) {
-                            // The package was just upgraded
-                            updatePackageParticipantsLocked(pkgName);
-                        } else {
-                            // The package was just added
-                            addPackageParticipantsLocked(pkgName);
-                        }
+                    if (replacing) {
+                        updatePackageParticipantsLocked(pkgList);
+                    } else {
+                        addPackageParticipantsLocked(pkgList);
                     }
                 }
             } else {
@@ -1325,9 +1344,7 @@
                     // The package is being updated.  We'll receive a PACKAGE_ADDED shortly.
                 } else {
                     synchronized (mBackupParticipants) {
-                        for (String pkgName : pkgList) {
-                            removePackageParticipantsLocked(pkgName);
-                        }
+                        removePackageParticipantsLocked(pkgList);
                     }
                 }
             }
@@ -1349,26 +1366,26 @@
         }
     };
 
-    // Add the backup agents in the given package to our set of known backup participants.
-    // If 'packageName' is null, adds all backup agents in the whole system.
-    void addPackageParticipantsLocked(String packageName) {
+    // Add the backup agents in the given packages to our set of known backup participants.
+    // If 'packageNames' is null, adds all backup agents in the whole system.
+    void addPackageParticipantsLocked(String[] packageNames) {
         // Look for apps that define the android:backupAgent attribute
-        if (DEBUG) Slog.v(TAG, "addPackageParticipantsLocked: " + packageName);
         List<PackageInfo> targetApps = allAgentPackages();
-        addPackageParticipantsLockedInner(packageName, targetApps);
+        if (packageNames != null) {
+            if (DEBUG) Slog.v(TAG, "addPackageParticipantsLocked: #" + packageNames.length);
+            for (String packageName : packageNames) {
+                addPackageParticipantsLockedInner(packageName, targetApps);
+            }
+        } else {
+            if (DEBUG) Slog.v(TAG, "addPackageParticipantsLocked: all");
+            addPackageParticipantsLockedInner(null, targetApps);
+        }
     }
 
     private void addPackageParticipantsLockedInner(String packageName,
             List<PackageInfo> targetPkgs) {
         if (MORE_DEBUG) {
-            Slog.v(TAG, "Adding " + targetPkgs.size() + " backup participants:");
-            for (PackageInfo p : targetPkgs) {
-                Slog.v(TAG, "    " + p + " agent=" + p.applicationInfo.backupAgentName
-                        + " uid=" + p.applicationInfo.uid
-                        + " killAfterRestore="
-                        + (((p.applicationInfo.flags & ApplicationInfo.FLAG_KILL_AFTER_RESTORE) != 0) ? "true" : "false")
-                        );
-            }
+            Slog.v(TAG, "Examining " + packageName + " for backup agent");
         }
 
         for (PackageInfo pkg : targetPkgs) {
@@ -1380,6 +1397,7 @@
                     mBackupParticipants.put(uid, set);
                 }
                 set.add(pkg.applicationInfo);
+                if (MORE_DEBUG) Slog.v(TAG, "Agent found; added");
 
                 // If we've never seen this app before, schedule a backup for it
                 if (!mEverStoredApps.contains(pkg.packageName)) {
@@ -1391,34 +1409,32 @@
         }
     }
 
-    // Remove the given package's entry from our known active set.  If
-    // 'packageName' is null, *all* participating apps will be removed.
-    void removePackageParticipantsLocked(String packageName) {
-        if (DEBUG) Slog.v(TAG, "removePackageParticipantsLocked: " + packageName);
-        List<String> allApps = new ArrayList<String>();
-        if (packageName != null) {
-            allApps.add(packageName);
-        } else {
-            // all apps with agents
-            List<PackageInfo> knownPackages = allAgentPackages();
-            for (PackageInfo pkg : knownPackages) {
-                allApps.add(pkg.packageName);
-            }
+    // Remove the given packages' entries from our known active set.
+    void removePackageParticipantsLocked(String[] packageNames) {
+        if (packageNames == null) {
+            Slog.w(TAG, "removePackageParticipants with null list");
+            return;
         }
-        removePackageParticipantsLockedInner(packageName, allApps);
+
+        if (DEBUG) Slog.v(TAG, "removePackageParticipantsLocked: #" + packageNames.length);
+        List<PackageInfo> knownPackages = allAgentPackages();
+        for (String pkg : packageNames) {
+            removePackageParticipantsLockedInner(pkg, knownPackages);
+        }
     }
 
     private void removePackageParticipantsLockedInner(String packageName,
-            List<String> allPackageNames) {
+            List<PackageInfo> allPackages) {
         if (MORE_DEBUG) {
             Slog.v(TAG, "removePackageParticipantsLockedInner (" + packageName
-                    + ") removing " + allPackageNames.size() + " entries");
-            for (String p : allPackageNames) {
-                Slog.v(TAG, "    - " + p);
+                    + ") removing from " + allPackages.size() + " entries");
+            for (PackageInfo p : allPackages) {
+                Slog.v(TAG, "    - " + p.packageName);
             }
         }
-        for (String pkg : allPackageNames) {
-            if (packageName == null || pkg.equals(packageName)) {
+        for (PackageInfo pkg : allPackages) {
+            if (packageName == null || pkg.packageName.equals(packageName)) {
+                /*
                 int uid = -1;
                 try {
                     PackageInfo info = mPackageManager.getPackageInfo(packageName, 0);
@@ -1427,22 +1443,28 @@
                     // we don't know this package name, so just skip it for now
                     continue;
                 }
+                */
+                final int uid = pkg.applicationInfo.uid;
+                if (MORE_DEBUG) Slog.i(TAG, "   found pkg " + packageName + " uid=" + uid);
 
                 HashSet<ApplicationInfo> set = mBackupParticipants.get(uid);
                 if (set != null) {
                     // Find the existing entry with the same package name, and remove it.
                     // We can't just remove(app) because the instances are different.
                     for (ApplicationInfo entry: set) {
+                        if (MORE_DEBUG) Slog.i(TAG, "      checking against " + entry.packageName);
                         if (entry.packageName.equals(pkg)) {
                             if (MORE_DEBUG) Slog.v(TAG, "  removing participant " + pkg);
                             set.remove(entry);
-                            removeEverBackedUp(pkg);
+                            removeEverBackedUp(pkg.packageName);
                             break;
                         }
                     }
                     if (set.size() == 0) {
                         mBackupParticipants.delete(uid);
                     }
+                } else {
+                    if (MORE_DEBUG) Slog.i(TAG, "   ... not found in uid mapping");
                 }
             }
         }
@@ -1477,21 +1499,20 @@
 
     // Reset the given package's known backup participants.  Unlike add/remove, the update
     // action cannot be passed a null package name.
-    void updatePackageParticipantsLocked(String packageName) {
-        if (packageName == null) {
-            Slog.e(TAG, "updatePackageParticipants called with null package name");
+    void updatePackageParticipantsLocked(String[] packageNames) {
+        if (packageNames == null) {
+            Slog.e(TAG, "updatePackageParticipants called with null package list");
             return;
         }
-        if (DEBUG) Slog.v(TAG, "updatePackageParticipantsLocked: " + packageName);
+        if (DEBUG) Slog.v(TAG, "updatePackageParticipantsLocked: #" + packageNames.length);
 
-        // brute force but small code size
-        List<PackageInfo> allApps = allAgentPackages();
-        List<String> allAppNames = new ArrayList<String>();
-        for (PackageInfo pkg : allApps) {
-            allAppNames.add(pkg.packageName);
+        if (packageNames.length > 0) {
+            List<PackageInfo> allApps = allAgentPackages();
+            for (String packageName : packageNames) {
+                removePackageParticipantsLockedInner(packageName, allApps);
+                addPackageParticipantsLockedInner(packageName, allApps);
+            }
         }
-        removePackageParticipantsLockedInner(packageName, allAppNames);
-        addPackageParticipantsLockedInner(packageName, allApps);
     }
 
     // Called from the backup task: record that the given app has been successfully
@@ -1614,6 +1635,7 @@
                             mAgentConnectLock.wait(5000);
                         } catch (InterruptedException e) {
                             // just bail
+                            if (DEBUG) Slog.w(TAG, "Interrupted: " + e);
                             return null;
                         }
                     }
@@ -1623,6 +1645,7 @@
                         Slog.w(TAG, "Timeout waiting for agent " + app);
                         return null;
                     }
+                    if (DEBUG) Slog.i(TAG, "got agent " + mConnectedAgent);
                     agent = mConnectedAgent;
                 }
             } catch (RemoteException e) {
@@ -1652,7 +1675,8 @@
         synchronized(mClearDataLock) {
             mClearingData = true;
             try {
-                mActivityManager.clearApplicationUserData(packageName, observer);
+                mActivityManager.clearApplicationUserData(packageName, observer,
+                        Binder.getOrigCallingUser());
             } catch (RemoteException e) {
                 // can't happen because the activity manager is in this process
             }
@@ -1816,6 +1840,8 @@
 
             mCurrentState = BackupState.INITIAL;
             mFinished = false;
+
+            addBackupTrace("STATE => INITIAL");
         }
 
         // Main entry point: perform one chunk of work, updating the state as appropriate
@@ -1844,11 +1870,25 @@
         // We're starting a backup pass.  Initialize the transport and send
         // the PM metadata blob if we haven't already.
         void beginBackup() {
+            if (DEBUG_BACKUP_TRACE) {
+                clearBackupTrace();
+                StringBuilder b = new StringBuilder(256);
+                b.append("beginBackup: [");
+                for (BackupRequest req : mOriginalQueue) {
+                    b.append(' ');
+                    b.append(req.packageName);
+                }
+                b.append(" ]");
+                addBackupTrace(b.toString());
+            }
+
             mStatus = BackupConstants.TRANSPORT_OK;
 
             // Sanity check: if the queue is empty we have no work to do.
             if (mOriginalQueue.isEmpty()) {
                 Slog.w(TAG, "Backup begun with an empty queue - nothing to do.");
+                addBackupTrace("queue empty at begin");
+                executeNextState(BackupState.FINAL);
                 return;
             }
 
@@ -1861,13 +1901,17 @@
 
             File pmState = new File(mStateDir, PACKAGE_MANAGER_SENTINEL);
             try {
-                EventLog.writeEvent(EventLogTags.BACKUP_START, mTransport.transportDirName());
+                final String transportName = mTransport.transportDirName();
+                EventLog.writeEvent(EventLogTags.BACKUP_START, transportName);
 
                 // If we haven't stored package manager metadata yet, we must init the transport.
                 if (mStatus == BackupConstants.TRANSPORT_OK && pmState.length() <= 0) {
                     Slog.i(TAG, "Initializing (wiping) backup state and transport storage");
+                    addBackupTrace("initializing transport " + transportName);
                     resetBackupState(mStateDir);  // Just to make sure.
                     mStatus = mTransport.initializeDevice();
+
+                    addBackupTrace("transport.initializeDevice() == " + mStatus);
                     if (mStatus == BackupConstants.TRANSPORT_OK) {
                         EventLog.writeEvent(EventLogTags.BACKUP_INITIALIZE);
                     } else {
@@ -1886,6 +1930,7 @@
                             mPackageManager, allAgentPackages());
                     mStatus = invokeAgentForBackup(PACKAGE_MANAGER_SENTINEL,
                             IBackupAgent.Stub.asInterface(pmAgent.onBind()), mTransport);
+                    addBackupTrace("PMBA invoke: " + mStatus);
                 }
 
                 if (mStatus == BackupConstants.TRANSPORT_NOT_INITIALIZED) {
@@ -1896,11 +1941,13 @@
                 }
             } catch (Exception e) {
                 Slog.e(TAG, "Error in backup thread", e);
+                addBackupTrace("Exception in backup thread: " + e);
                 mStatus = BackupConstants.TRANSPORT_ERROR;
             } finally {
                 // If we've succeeded so far, invokeAgentForBackup() will have run the PM
                 // metadata and its completion/timeout callback will continue the state
                 // machine chain.  If it failed that won't happen; we handle that now.
+                addBackupTrace("exiting prelim: " + mStatus);
                 if (mStatus != BackupConstants.TRANSPORT_OK) {
                     // if things went wrong at this point, we need to
                     // restage everything and try again later.
@@ -1914,11 +1961,12 @@
         // if that was warranted.  Now we process the single next thing in the queue.
         void invokeNextAgent() {
             mStatus = BackupConstants.TRANSPORT_OK;
+            addBackupTrace("invoke q=" + mQueue.size());
 
             // Sanity check that we have work to do.  If not, skip to the end where
             // we reestablish the wakelock invariants etc.
             if (mQueue.isEmpty()) {
-                Slog.e(TAG, "Running queue but it's empty!");
+                if (DEBUG) Slog.i(TAG, "queue now empty");
                 executeNextState(BackupState.FINAL);
                 return;
             }
@@ -1928,6 +1976,7 @@
             mQueue.remove(0);
 
             Slog.d(TAG, "starting agent for backup of " + request);
+            addBackupTrace("launch agent for " + request.packageName);
 
             // Verify that the requested app exists; it might be something that
             // requested a backup but was then uninstalled.  The request was
@@ -1943,6 +1992,7 @@
                     mWakelock.setWorkSource(new WorkSource(mCurrentPackage.applicationInfo.uid));
                     agent = bindToAgentSynchronous(mCurrentPackage.applicationInfo,
                             IApplicationThread.BACKUP_MODE_INCREMENTAL);
+                    addBackupTrace("agent bound; a? = " + (agent != null));
                     if (agent != null) {
                         mStatus = invokeAgentForBackup(request.packageName, agent, mTransport);
                         // at this point we'll either get a completion callback from the
@@ -1956,14 +2006,17 @@
                     // Try for the next one.
                     Slog.d(TAG, "error in bind/backup", ex);
                     mStatus = BackupConstants.AGENT_ERROR;
+                            addBackupTrace("agent SE");
                 }
             } catch (NameNotFoundException e) {
                 Slog.d(TAG, "Package does not exist; skipping");
+                addBackupTrace("no such package");
+                mStatus = BackupConstants.AGENT_UNKNOWN;
             } finally {
                 mWakelock.setWorkSource(null);
 
                 // If there was an agent error, no timeout/completion handling will occur.
-                // That means we need to deal with the next state ourselves.
+                // That means we need to direct to the next state ourselves.
                 if (mStatus != BackupConstants.TRANSPORT_OK) {
                     BackupState nextState = BackupState.RUNNING_QUEUE;
 
@@ -1975,18 +2028,26 @@
                         dataChangedImpl(request.packageName);
                         mStatus = BackupConstants.TRANSPORT_OK;
                         if (mQueue.isEmpty()) nextState = BackupState.FINAL;
-                    } else if (mStatus != BackupConstants.TRANSPORT_OK) {
+                    } else if (mStatus == BackupConstants.AGENT_UNKNOWN) {
+                        // Failed lookup of the app, so we couldn't bring up an agent, but
+                        // we're otherwise fine.  Just drop it and go on to the next as usual.
+                        mStatus = BackupConstants.TRANSPORT_OK;
+                    } else {
                         // Transport-level failure means we reenqueue everything
                         revertAndEndBackup();
                         nextState = BackupState.FINAL;
                     }
 
                     executeNextState(nextState);
+                } else {
+                    addBackupTrace("expecting completion/timeout callback");
                 }
             }
         }
 
         void finalizeBackup() {
+            addBackupTrace("finishing");
+
             // Either backup was successful, in which case we of course do not need
             // this pass's journal any more; or it failed, in which case we just
             // re-enqueued all of these packages in the current active journal.
@@ -1999,6 +2060,7 @@
             // done a backup, we can now record what the current backup dataset token
             // is.
             if ((mCurrentToken == 0) && (mStatus == BackupConstants.TRANSPORT_OK)) {
+                addBackupTrace("success; recording token");
                 try {
                     mCurrentToken = mTransport.getCurrentRestoreSet();
                 } catch (RemoteException e) {} // can't happen
@@ -2014,11 +2076,13 @@
                     // Make sure we back up everything and perform the one-time init
                     clearMetadata();
                     if (DEBUG) Slog.d(TAG, "Server requires init; rerunning");
+                    addBackupTrace("init required; rerunning");
                     backupNow();
                 }
             }
 
             // Only once we're entirely finished do we release the wakelock
+            clearBackupTrace();
             Slog.i(TAG, "Backup pass finished.");
             mWakelock.release();
         }
@@ -2033,7 +2097,8 @@
         // handler in case it doesn't get back to us.
         int invokeAgentForBackup(String packageName, IBackupAgent agent,
                 IBackupTransport transport) {
-            if (DEBUG) Slog.d(TAG, "processOneBackup doBackup() on " + packageName);
+            if (DEBUG) Slog.d(TAG, "invokeAgentForBackup on " + packageName);
+            addBackupTrace("invoking " + packageName);
 
             mSavedStateName = new File(mStateDir, packageName);
             mBackupDataName = new File(mDataDir, packageName + ".data");
@@ -2073,10 +2138,13 @@
                         ParcelFileDescriptor.MODE_TRUNCATE);
 
                 // Initiate the target's backup pass
+                addBackupTrace("setting timeout");
                 prepareOperationTimeout(token, TIMEOUT_BACKUP_INTERVAL, this);
+                addBackupTrace("calling agent doBackup()");
                 agent.doBackup(mSavedState, mBackupData, mNewState, token, mBackupManagerBinder);
             } catch (Exception e) {
                 Slog.e(TAG, "Error invoking for backup on " + packageName);
+                addBackupTrace("exception: " + e);
                 EventLog.writeEvent(EventLogTags.BACKUP_AGENT_FAILURE, packageName,
                         e.toString());
                 agentErrorCleanup();
@@ -2087,6 +2155,7 @@
             // either be a callback from the agent, at which point we'll process its data
             // for transport, or a timeout.  Either way the next phase will happen in
             // response to the TimeoutHandler interface callbacks.
+            addBackupTrace("invoke success");
             return BackupConstants.TRANSPORT_OK;
         }
 
@@ -2098,6 +2167,7 @@
                     + mCurrentPackage.packageName);
             mBackupHandler.removeMessages(MSG_TIMEOUT);
             clearAgentState();
+            addBackupTrace("operation complete");
 
             ParcelFileDescriptor backupData = null;
             mStatus = BackupConstants.TRANSPORT_OK;
@@ -2107,6 +2177,7 @@
                     if (mStatus == BackupConstants.TRANSPORT_OK) {
                         backupData = ParcelFileDescriptor.open(mBackupDataName,
                                 ParcelFileDescriptor.MODE_READ_ONLY);
+                        addBackupTrace("sending data to transport");
                         mStatus = mTransport.performBackup(mCurrentPackage, backupData);
                     }
 
@@ -2115,11 +2186,15 @@
                     // hold off on finishBackup() until the end, which implies holding off on
                     // renaming *all* the output state files (see below) until that happens.
 
+                    addBackupTrace("data delivered: " + mStatus);
                     if (mStatus == BackupConstants.TRANSPORT_OK) {
+                        addBackupTrace("finishing op on transport");
                         mStatus = mTransport.finishBackup();
+                        addBackupTrace("finished: " + mStatus);
                     }
                 } else {
                     if (DEBUG) Slog.i(TAG, "no backup data written; not calling transport");
+                    addBackupTrace("no data to send");
                 }
 
                 // After successful transport, delete the now-stale data
@@ -2167,12 +2242,14 @@
             Slog.e(TAG, "Timeout backing up " + mCurrentPackage.packageName);
             EventLog.writeEvent(EventLogTags.BACKUP_AGENT_FAILURE, mCurrentPackage.packageName,
                     "timeout");
+            addBackupTrace("timeout of " + mCurrentPackage.packageName);
             agentErrorCleanup();
             dataChangedImpl(mCurrentPackage.packageName);
         }
 
         void revertAndEndBackup() {
             if (MORE_DEBUG) Slog.i(TAG, "Reverting backup queue - restaging everything");
+            addBackupTrace("transport error; reverting");
             for (BackupRequest request : mOriginalQueue) {
                 dataChangedImpl(request.packageName);
             }
@@ -2201,6 +2278,7 @@
 
             // If this was a pseudopackage there's no associated Activity Manager state
             if (mCurrentPackage.applicationInfo != null) {
+                addBackupTrace("unbinding " + mCurrentPackage.packageName);
                 try {  // unbind even on timeout, just in case
                     mActivityManager.unbindBackupAgent(mCurrentPackage.applicationInfo);
                 } catch (RemoteException e) {}
@@ -2208,6 +2286,7 @@
         }
 
         void restartBackupAlarm() {
+            addBackupTrace("setting backup trigger");
             synchronized (mQueueLock) {
                 try {
                     startBackupAlarmsLocked(mTransport.requestBackupTime());
@@ -2218,6 +2297,7 @@
         void executeNextState(BackupState nextState) {
             if (MORE_DEBUG) Slog.i(TAG, " => executing next step on "
                     + this + " nextState=" + nextState);
+            addBackupTrace("executeNextState => " + nextState);
             mCurrentState = nextState;
             Message msg = mBackupHandler.obtainMessage(MSG_BACKUP_RESTORE_STEP, this);
             mBackupHandler.sendMessage(msg);
@@ -2248,14 +2328,16 @@
             ParcelFileDescriptor mPipe;
             int mToken;
             boolean mSendApk;
+            boolean mWriteManifest;
 
             FullBackupRunner(PackageInfo pack, IBackupAgent agent, ParcelFileDescriptor pipe,
-                    int token, boolean sendApk)  throws IOException {
+                    int token, boolean sendApk, boolean writeManifest)  throws IOException {
                 mPackage = pack;
                 mAgent = agent;
                 mPipe = ParcelFileDescriptor.dup(pipe.getFileDescriptor());
                 mToken = token;
                 mSendApk = sendApk;
+                mWriteManifest = writeManifest;
             }
 
             @Override
@@ -2264,12 +2346,14 @@
                     BackupDataOutput output = new BackupDataOutput(
                             mPipe.getFileDescriptor());
 
-                    if (MORE_DEBUG) Slog.d(TAG, "Writing manifest for " + mPackage.packageName);
-                    writeAppManifest(mPackage, mManifestFile, mSendApk);
-                    FullBackup.backupToTar(mPackage.packageName, null, null,
-                            mFilesDir.getAbsolutePath(),
-                            mManifestFile.getAbsolutePath(),
-                            output);
+                    if (mWriteManifest) {
+                        if (MORE_DEBUG) Slog.d(TAG, "Writing manifest for " + mPackage.packageName);
+                        writeAppManifest(mPackage, mManifestFile, mSendApk);
+                        FullBackup.backupToTar(mPackage.packageName, null, null,
+                                mFilesDir.getAbsolutePath(),
+                                mManifestFile.getAbsolutePath(),
+                                output);
+                    }
 
                     if (mSendApk) {
                         writeApkToBackup(mPackage, output);
@@ -2356,10 +2440,13 @@
                 }
             }
 
-            // Cull any packages that have indicated that backups are not permitted.
+            // Cull any packages that have indicated that backups are not permitted, as well
+            // as any explicit mention of the 'special' shared-storage agent package (we
+            // handle that one at the end).
             for (int i = 0; i < packagesToBackup.size(); ) {
                 PackageInfo pkg = packagesToBackup.get(i);
-                if ((pkg.applicationInfo.flags & ApplicationInfo.FLAG_ALLOW_BACKUP) == 0) {
+                if ((pkg.applicationInfo.flags & ApplicationInfo.FLAG_ALLOW_BACKUP) == 0
+                        || pkg.packageName.equals(SHARED_BACKUP_AGENT_PACKAGE)) {
                     packagesToBackup.remove(i);
                 } else {
                     i++;
@@ -2439,6 +2526,16 @@
                     return;
                 }
 
+                // Shared storage if requested
+                if (mIncludeShared) {
+                    try {
+                        pkg = mPackageManager.getPackageInfo(SHARED_BACKUP_AGENT_PACKAGE, 0);
+                        packagesToBackup.add(pkg);
+                    } catch (NameNotFoundException e) {
+                        Slog.e(TAG, "Unable to find shared-storage backup handler");
+                    }
+                }
+
                 // Now back up the app data via the agent mechanism
                 int N = packagesToBackup.size();
                 for (int i = 0; i < N; i++) {
@@ -2446,11 +2543,6 @@
                     backupOnePackage(pkg, out);
                 }
 
-                // Shared storage if requested
-                if (mIncludeShared) {
-                    backupSharedStorage();
-                }
-
                 // Done!
                 finalizeBackup(out);
             } catch (RemoteException e) {
@@ -2556,19 +2648,21 @@
             if (agent != null) {
                 ParcelFileDescriptor[] pipes = null;
                 try {
-                     pipes = ParcelFileDescriptor.createPipe();
+                    pipes = ParcelFileDescriptor.createPipe();
 
                     ApplicationInfo app = pkg.applicationInfo;
+                    final boolean isSharedStorage = pkg.packageName.equals(SHARED_BACKUP_AGENT_PACKAGE);
                     final boolean sendApk = mIncludeApks
+                            && !isSharedStorage
                             && ((app.flags & ApplicationInfo.FLAG_FORWARD_LOCK) == 0)
                             && ((app.flags & ApplicationInfo.FLAG_SYSTEM) == 0 ||
                                 (app.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0);
 
-                    sendOnBackupPackage(pkg.packageName);
+                    sendOnBackupPackage(isSharedStorage ? "Shared storage" : pkg.packageName);
 
                     final int token = generateToken();
                     FullBackupRunner runner = new FullBackupRunner(pkg, agent, pipes[1],
-                            token, sendApk);
+                            token, sendApk, !isSharedStorage);
                     pipes[1].close();   // the runner has dup'd it
                     pipes[1] = null;
                     Thread t = new Thread(runner);
@@ -2643,33 +2737,6 @@
             }
         }
 
-        private void backupSharedStorage() throws RemoteException {
-            PackageInfo pkg = null;
-            try {
-                pkg = mPackageManager.getPackageInfo("com.android.sharedstoragebackup", 0);
-                IBackupAgent agent = bindToAgentSynchronous(pkg.applicationInfo,
-                        IApplicationThread.BACKUP_MODE_FULL);
-                if (agent != null) {
-                    sendOnBackupPackage("Shared storage");
-
-                    final int token = generateToken();
-                    prepareOperationTimeout(token, TIMEOUT_SHARED_BACKUP_INTERVAL, null);
-                    agent.doFullBackup(mOutputFile, token, mBackupManagerBinder);
-                    if (!waitUntilOperationComplete(token)) {
-                        Slog.e(TAG, "Full backup failed on shared storage");
-                    } else {
-                        if (DEBUG) Slog.d(TAG, "Full shared storage backup success");
-                    }
-                } else {
-                    Slog.e(TAG, "Could not bind to shared storage backup agent");
-                }
-            } catch (NameNotFoundException e) {
-                Slog.e(TAG, "Shared storage backup package not found");
-            } finally {
-                tearDown(pkg);
-            }
-        }
-
         private void finalizeBackup(OutputStream out) {
             try {
                 // A standard 'tar' EOF sequence: two 512-byte blocks of all zeroes.
@@ -2895,7 +2962,7 @@
 
             // Are we able to restore shared-storage data?
             if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
-                mPackagePolicies.put("com.android.sharedstoragebackup", RestorePolicy.ACCEPT);
+                mPackagePolicies.put(SHARED_BACKUP_AGENT_PACKAGE, RestorePolicy.ACCEPT);
             }
 
             FileInputStream rawInStream = null;
@@ -3773,7 +3840,7 @@
                             info.path, 0, FullBackup.SHARED_PREFIX.length())) {
                         // File in shared storage.  !!! TODO: implement this.
                         info.path = info.path.substring(FullBackup.SHARED_PREFIX.length());
-                        info.packageName = "com.android.sharedstoragebackup";
+                        info.packageName = SHARED_BACKUP_AGENT_PACKAGE;
                         info.domain = FullBackup.SHARED_STORAGE_TOKEN;
                         if (DEBUG) Slog.i(TAG, "File in shared storage: " + info.path);
                     } else if (FullBackup.APPS_PREFIX.regionMatches(0,
@@ -4717,6 +4784,8 @@
                     // one already there, then overwrite it, but no harm done.
                     BackupRequest req = new BackupRequest(packageName);
                     if (mPendingBackups.put(app.packageName, req) == null) {
+                        if (DEBUG) Slog.d(TAG, "Now staging backup of " + packageName);
+
                         // Journal this request in case of crash.  The put()
                         // operation returned null when this package was not already
                         // in the set; we want to avoid touching the disk redundantly.
@@ -5738,6 +5807,17 @@
                 pw.println("    " + s);
             }
 
+            if (DEBUG_BACKUP_TRACE) {
+                synchronized (mBackupTrace) {
+                    if (!mBackupTrace.isEmpty()) {
+                        pw.println("Most recent backup trace:");
+                        for (String s : mBackupTrace) {
+                            pw.println("   " + s);
+                        }
+                    }
+                }
+            }
+
             int N = mBackupParticipants.size();
             pw.println("Participants:");
             for (int i=0; i<N; i++) {
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java
index 6e4aca7..eab60a7 100644
--- a/services/java/com/android/server/ConnectivityService.java
+++ b/services/java/com/android/server/ConnectivityService.java
@@ -992,11 +992,15 @@
                 NetworkInfo ni = network.getNetworkInfo();
 
                 if (ni.isAvailable() == false) {
-                    if (DBG) log("special network not available");
                     if (!TextUtils.equals(feature,Phone.FEATURE_ENABLE_DUN_ALWAYS)) {
+                        if (DBG) log("special network not available ni=" + ni.getTypeName());
                         return Phone.APN_TYPE_NOT_AVAILABLE;
                     } else {
                         // else make the attempt anyway - probably giving REQUEST_STARTED below
+                        if (DBG) {
+                            log("special network not available, but try anyway ni=" +
+                                    ni.getTypeName());
+                        }
                     }
                 }
 
@@ -1031,9 +1035,14 @@
                 if ((ni.isConnectedOrConnecting() == true) &&
                         !network.isTeardownRequested()) {
                     if (ni.isConnected() == true) {
-                        // add the pid-specific dns
-                        handleDnsConfigurationChange(usedNetworkType);
-                        if (VDBG) log("special network already active");
+                        final long token = Binder.clearCallingIdentity();
+                        try {
+                            // add the pid-specific dns
+                            handleDnsConfigurationChange(usedNetworkType);
+                            if (VDBG) log("special network already active");
+                        } finally {
+                            Binder.restoreCallingIdentity(token);
+                        }
                         return Phone.APN_ALREADY_ACTIVE;
                     }
                     if (VDBG) log("special network already connecting");
@@ -1221,6 +1230,7 @@
         }
 
         if (!ConnectivityManager.isNetworkTypeValid(networkType)) {
+            if (DBG) log("requestRouteToHostAddress on invalid network: " + networkType);
             return false;
         }
         NetworkStateTracker tracker = mNetTrackers[networkType];
@@ -1233,11 +1243,16 @@
             }
             return false;
         }
+        final long token = Binder.clearCallingIdentity();
         try {
             InetAddress addr = InetAddress.getByAddress(hostAddress);
             LinkProperties lp = tracker.getLinkProperties();
             return addRouteToAddress(lp, addr);
-        } catch (UnknownHostException e) {}
+        } catch (UnknownHostException e) {
+            if (DBG) log("requestRouteToHostAddress got " + e.toString());
+        } finally {
+            Binder.restoreCallingIdentity(token);
+        }
         return false;
     }
 
@@ -1277,7 +1292,10 @@
 
     private boolean modifyRoute(String ifaceName, LinkProperties lp, RouteInfo r, int cycleCount,
             boolean doAdd, boolean toDefaultTable) {
-        if ((ifaceName == null) || (lp == null) || (r == null)) return false;
+        if ((ifaceName == null) || (lp == null) || (r == null)) {
+            if (DBG) log("modifyRoute got unexpected null: " + ifaceName + ", " + lp + ", " + r);
+            return false;
+        }
 
         if (cycleCount > MAX_HOSTROUTE_CYCLE_COUNT) {
             loge("Error modifying route - too much recursion");
@@ -1309,7 +1327,7 @@
                 }
             } catch (Exception e) {
                 // never crash - catch them all
-                if (VDBG) loge("Exception trying to add a route: " + e);
+                if (DBG) loge("Exception trying to add a route: " + e);
                 return false;
             }
         } else {
@@ -1323,7 +1341,7 @@
                         mNetd.removeRoute(ifaceName, r);
                     } catch (Exception e) {
                         // never crash - catch them all
-                        if (VDBG) loge("Exception trying to remove a route: " + e);
+                        if (DBG) loge("Exception trying to remove a route: " + e);
                         return false;
                     }
                 } else {
@@ -1335,7 +1353,7 @@
                     mNetd.removeSecondaryRoute(ifaceName, r);
                 } catch (Exception e) {
                     // never crash - catch them all
-                    if (VDBG) loge("Exception trying to remove a route: " + e);
+                    if (DBG) loge("Exception trying to remove a route: " + e);
                     return false;
                 }
             }
@@ -1376,9 +1394,7 @@
     private INetworkPolicyListener mPolicyListener = new INetworkPolicyListener.Stub() {
         @Override
         public void onUidRulesChanged(int uid, int uidRules) {
-            // only someone like NPMS should only be calling us
-            mContext.enforceCallingOrSelfPermission(MANAGE_NETWORK_POLICY, TAG);
-
+            // caller is NPMS, since we only register with them
             if (LOGD_RULES) {
                 log("onUidRulesChanged(uid=" + uid + ", uidRules=" + uidRules + ")");
             }
@@ -1397,9 +1413,7 @@
 
         @Override
         public void onMeteredIfacesChanged(String[] meteredIfaces) {
-            // only someone like NPMS should only be calling us
-            mContext.enforceCallingOrSelfPermission(MANAGE_NETWORK_POLICY, TAG);
-
+            // caller is NPMS, since we only register with them
             if (LOGD_RULES) {
                 log("onMeteredIfacesChanged(ifaces=" + Arrays.toString(meteredIfaces) + ")");
             }
@@ -1411,6 +1425,27 @@
                 }
             }
         }
+
+        @Override
+        public void onRestrictBackgroundChanged(boolean restrictBackground) {
+            // caller is NPMS, since we only register with them
+            if (LOGD_RULES) {
+                log("onRestrictBackgroundChanged(restrictBackground=" + restrictBackground + ")");
+            }
+
+            // kick off connectivity change broadcast for active network, since
+            // global background policy change is radical.
+            final int networkType = mActiveDefaultNetwork;
+            if (isNetworkTypeValid(networkType)) {
+                final NetworkStateTracker tracker = mNetTrackers[networkType];
+                if (tracker != null) {
+                    final NetworkInfo info = tracker.getNetworkInfo();
+                    if (info != null && info.isConnected()) {
+                        sendConnectedBroadcast(info);
+                    }
+                }
+            }
+        }
     };
 
     /**
@@ -1431,6 +1466,12 @@
             }
             mNetTrackers[ConnectivityManager.TYPE_MOBILE].setUserDataEnable(enabled);
         }
+        if (mNetTrackers[ConnectivityManager.TYPE_WIMAX] != null) {
+            if (VDBG) {
+                log(mNetTrackers[ConnectivityManager.TYPE_WIMAX].toString() + enabled);
+            }
+            mNetTrackers[ConnectivityManager.TYPE_WIMAX].setUserDataEnable(enabled);
+        }
     }
 
     @Override
@@ -1998,7 +2039,7 @@
                         mNetd.removeRoute(ifaceName, r);
                     } catch (Exception e) {
                         // never crash - catch them all
-                        if (VDBG) loge("Exception trying to remove a route: " + e);
+                        if (DBG) loge("Exception trying to remove a route: " + e);
                     }
                 }
             }
@@ -2212,7 +2253,7 @@
                 mNetd.setDnsServersForInterface(iface, NetworkUtils.makeStrings(dnses));
                 mNetd.setDefaultInterfaceForDns(iface);
             } catch (Exception e) {
-                if (VDBG) loge("exception setting default dns interface: " + e);
+                if (DBG) loge("exception setting default dns interface: " + e);
             }
         }
         if (!domains.equals(SystemProperties.get("net.dns.search"))) {
@@ -2242,7 +2283,7 @@
                     mNetd.setDnsServersForInterface(p.getInterfaceName(),
                             NetworkUtils.makeStrings(dnses));
                 } catch (Exception e) {
-                    if (VDBG) loge("exception setting dns servers: " + e);
+                    if (DBG) loge("exception setting dns servers: " + e);
                 }
                 // set per-pid dns for attached secondary nets
                 List pids = mNetRequestersPids[netType];
diff --git a/services/java/com/android/server/DevicePolicyManagerService.java b/services/java/com/android/server/DevicePolicyManagerService.java
index e8ca3ce..d8e3d59 100644
--- a/services/java/com/android/server/DevicePolicyManagerService.java
+++ b/services/java/com/android/server/DevicePolicyManagerService.java
@@ -60,6 +60,7 @@
 import android.util.Printer;
 import android.util.Slog;
 import android.util.Xml;
+import android.view.IWindowManager;
 import android.view.WindowManagerPolicy;
 
 import java.io.File;
@@ -96,6 +97,7 @@
     final PowerManager.WakeLock mWakeLock;
 
     IPowerManager mIPowerManager;
+    IWindowManager mIWindowManager;
 
     int mActivePasswordQuality = DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED;
     int mActivePasswordLength = 0;
@@ -506,6 +508,14 @@
         return mIPowerManager;
     }
 
+    private IWindowManager getWindowManager() {
+        if (mIWindowManager == null) {
+            IBinder b = ServiceManager.getService(Context.WINDOW_SERVICE);
+            mIWindowManager = IWindowManager.Stub.asInterface(b);
+        }
+        return mIWindowManager;
+    }
+
     ActiveAdmin getActiveAdminUncheckedLocked(ComponentName who) {
         ActiveAdmin admin = mAdminMap.get(who);
         if (admin != null
@@ -1649,8 +1659,11 @@
                     DeviceAdminInfo.USES_POLICY_FORCE_LOCK);
             long ident = Binder.clearCallingIdentity();
             try {
+                // Power off the display
                 mIPowerManager.goToSleepWithReason(SystemClock.uptimeMillis(),
                         WindowManagerPolicy.OFF_BECAUSE_OF_ADMIN);
+                // Ensure the device is locked
+                getWindowManager().lockNow();
             } catch (RemoteException e) {
             } finally {
                 Binder.restoreCallingIdentity(ident);
diff --git a/services/java/com/android/server/EventLogTags.logtags b/services/java/com/android/server/EventLogTags.logtags
index 4dad209..0bcec2e 100644
--- a/services/java/com/android/server/EventLogTags.logtags
+++ b/services/java/com/android/server/EventLogTags.logtags
@@ -142,5 +142,5 @@
 # ---------------------------
 # NetworkStatsService.java
 # ---------------------------
-51100 netstats_mobile_sample (dev_rx_bytes|2|2),(dev_tx_bytes|2|2),(dev_rx_pkts|2|1),(dev_tx_pkts|2|1),(xt_rx_bytes|2|2),(xt_tx_bytes|2|2),(xt_rx_pkts|2|1),(xt_tx_pkts|2|1),(uid_rx_bytes|2|2),(uid_tx_bytes|2|2),(uid_rx_pkts|2|1),(uid_tx_pkts|2|1),(trusted_time|2|3),(dev_history_start|2|3)
-51101 netstats_wifi_sample (dev_rx_bytes|2|2),(dev_tx_bytes|2|2),(dev_rx_pkts|2|1),(dev_tx_pkts|2|1),(xt_rx_bytes|2|2),(xt_tx_bytes|2|2),(xt_rx_pkts|2|1),(xt_tx_pkts|2|1),(uid_rx_bytes|2|2),(uid_tx_bytes|2|2),(uid_rx_pkts|2|1),(uid_tx_pkts|2|1),(trusted_time|2|3),(dev_history_start|2|3)
+51100 netstats_mobile_sample (dev_rx_bytes|2|2),(dev_tx_bytes|2|2),(dev_rx_pkts|2|1),(dev_tx_pkts|2|1),(xt_rx_bytes|2|2),(xt_tx_bytes|2|2),(xt_rx_pkts|2|1),(xt_tx_pkts|2|1),(uid_rx_bytes|2|2),(uid_tx_bytes|2|2),(uid_rx_pkts|2|1),(uid_tx_pkts|2|1),(trusted_time|2|3)
+51101 netstats_wifi_sample (dev_rx_bytes|2|2),(dev_tx_bytes|2|2),(dev_rx_pkts|2|1),(dev_tx_pkts|2|1),(xt_rx_bytes|2|2),(xt_tx_bytes|2|2),(xt_rx_pkts|2|1),(xt_tx_pkts|2|1),(uid_rx_bytes|2|2),(uid_tx_bytes|2|2),(uid_rx_pkts|2|1),(uid_tx_pkts|2|1),(trusted_time|2|3)
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java
index f5c4ed4..aba1bc6 100644
--- a/services/java/com/android/server/InputMethodManagerService.java
+++ b/services/java/com/android/server/InputMethodManagerService.java
@@ -142,6 +142,9 @@
     private static final String SUBTYPE_MODE_KEYBOARD = "keyboard";
     private static final String SUBTYPE_MODE_VOICE = "voice";
     private static final String TAG_TRY_SUPPRESSING_IME_SWITCHER = "TrySuppressingImeSwitcher";
+    private static final String TAG_ENABLED_WHEN_DEFAULT_IS_NOT_ASCII_CAPABLE =
+            "EnabledWhenDefaultIsNotAsciiCapable";
+    private static final String TAG_ASCII_CAPABLE = "AsciiCapable";
 
     final Context mContext;
     final Resources mRes;
@@ -2163,6 +2166,15 @@
                 }
             }
 
+            if (lastInputMethodSubtypeId == NOT_A_SUBTYPE_ID) {
+                final InputMethodSubtype currentSubtype = getCurrentInputMethodSubtype();
+                if (currentSubtype != null) {
+                    final InputMethodInfo currentImi = mMethodMap.get(mCurMethodId);
+                    lastInputMethodSubtypeId =
+                            getSubtypeIdFromHashCode(currentImi, currentSubtype.hashCode());
+                }
+            }
+
             final int N = imList.size();
             mIms = new InputMethodInfo[N];
             mSubtypeIds = new int[N];
@@ -2472,7 +2484,6 @@
         final HashMap<String, InputMethodSubtype> applicableModeAndSubtypesMap =
                 new HashMap<String, InputMethodSubtype>();
         final int N = subtypes.size();
-        boolean containsKeyboardSubtype = false;
         for (int i = 0; i < N; ++i) {
             // scan overriding implicitly enabled subtypes.
             InputMethodSubtype subtype = subtypes.get(i);
@@ -2506,15 +2517,23 @@
                     if (!systemLocale.equals(locale)) continue;
                 }
                 applicableModeAndSubtypesMap.put(mode, subtype);
-                if (!containsKeyboardSubtype
-                        && SUBTYPE_MODE_KEYBOARD.equalsIgnoreCase(subtype.getMode())) {
-                    containsKeyboardSubtype = true;
+            }
+        }
+        final InputMethodSubtype keyboardSubtype
+                = applicableModeAndSubtypesMap.get(SUBTYPE_MODE_KEYBOARD);
+        final ArrayList<InputMethodSubtype> applicableSubtypes = new ArrayList<InputMethodSubtype>(
+                applicableModeAndSubtypesMap.values());
+        if (keyboardSubtype != null && !keyboardSubtype.containsExtraValueKey(TAG_ASCII_CAPABLE)) {
+            for (int i = 0; i < N; ++i) {
+                final InputMethodSubtype subtype = subtypes.get(i);
+                final String mode = subtype.getMode();
+                if (SUBTYPE_MODE_KEYBOARD.equals(mode) && subtype.containsExtraValueKey(
+                        TAG_ENABLED_WHEN_DEFAULT_IS_NOT_ASCII_CAPABLE)) {
+                    applicableSubtypes.add(subtype);
                 }
             }
         }
-        final ArrayList<InputMethodSubtype> applicableSubtypes = new ArrayList<InputMethodSubtype>(
-                applicableModeAndSubtypesMap.values());
-        if (!containsKeyboardSubtype) {
+        if (keyboardSubtype == null) {
             InputMethodSubtype lastResortKeyboardSubtype = findLastResortApplicableSubtypeLocked(
                     res, subtypes, SUBTYPE_MODE_KEYBOARD, systemLocale, true);
             if (lastResortKeyboardSubtype != null) {
diff --git a/services/java/com/android/server/LocationManagerService.java b/services/java/com/android/server/LocationManagerService.java
index 56afe7f..8cb9d99b 100644
--- a/services/java/com/android/server/LocationManagerService.java
+++ b/services/java/com/android/server/LocationManagerService.java
@@ -1962,8 +1962,10 @@
                 } else {
                     mNetworkState = LocationProvider.TEMPORARILY_UNAVAILABLE;
                 }
-                NetworkInfo info =
-                    (NetworkInfo)intent.getExtra(ConnectivityManager.EXTRA_NETWORK_INFO);
+
+                final ConnectivityManager connManager = (ConnectivityManager) context
+                        .getSystemService(Context.CONNECTIVITY_SERVICE);
+                final NetworkInfo info = connManager.getActiveNetworkInfo();
 
                 // Notify location providers of current network state
                 synchronized (mLock) {
diff --git a/services/java/com/android/server/MountService.java b/services/java/com/android/server/MountService.java
index a32e9f5..366160b 100644
--- a/services/java/com/android/server/MountService.java
+++ b/services/java/com/android/server/MountService.java
@@ -1169,7 +1169,7 @@
          * amount of containers we'd ever expect to have. This keeps an
          * "asec list" from blocking a thread repeatedly.
          */
-        mConnector = new NativeDaemonConnector(this, "vold", MAX_CONTAINERS * 2, VOLD_TAG);
+        mConnector = new NativeDaemonConnector(this, "vold", MAX_CONTAINERS * 2, VOLD_TAG, 25);
         mReady = false;
         Thread thread = new Thread(mConnector, VOLD_TAG);
         thread.start();
@@ -2429,6 +2429,10 @@
                 pw.println(v.toString());
             }
         }
+
+        pw.println();
+        pw.println("  mConnection:");
+        mConnector.dump(fd, pw, args);
     }
 
     /** {@inheritDoc} */
diff --git a/services/java/com/android/server/NativeDaemonConnector.java b/services/java/com/android/server/NativeDaemonConnector.java
index cc2bcd9..308661f 100644
--- a/services/java/com/android/server/NativeDaemonConnector.java
+++ b/services/java/com/android/server/NativeDaemonConnector.java
@@ -22,14 +22,17 @@
 import android.os.HandlerThread;
 import android.os.Message;
 import android.os.SystemClock;
+import android.util.LocalLog;
 import android.util.Slog;
 
 import com.google.android.collect.Lists;
 
+import java.nio.charset.Charsets;
+import java.io.FileDescriptor;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.nio.charset.Charsets;
+import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.LinkedBlockingQueue;
@@ -45,6 +48,7 @@
 
     private String mSocket;
     private OutputStream mOutputStream;
+    private LocalLog mLocalLog;
 
     private final BlockingQueue<NativeDaemonEvent> mResponseQueue;
 
@@ -57,11 +61,12 @@
     private final int BUFFER_SIZE = 4096;
 
     NativeDaemonConnector(INativeDaemonConnectorCallbacks callbacks, String socket,
-            int responseQueueSize, String logTag) {
+            int responseQueueSize, String logTag, int maxLogSize) {
         mCallbacks = callbacks;
         mSocket = socket;
         mResponseQueue = new LinkedBlockingQueue<NativeDaemonEvent>(responseQueueSize);
         TAG = logTag != null ? logTag : "NativeDaemonConnector";
+        mLocalLog = new LocalLog(maxLogSize);
     }
 
     @Override
@@ -125,7 +130,7 @@
                     if (buffer[i] == 0) {
                         final String rawEvent = new String(
                                 buffer, start, i - start, Charsets.UTF_8);
-                        if (LOGD) Slog.d(TAG, "RCV <- " + rawEvent);
+                        log("RCV <- {" + rawEvent + "}");
 
                         try {
                             final NativeDaemonEvent event = NativeDaemonEvent.parseRawEvent(
@@ -148,6 +153,10 @@
                         start = i + 1;
                     }
                 }
+                if (start == 0) {
+                    final String rawEvent = new String(buffer, start, count, Charsets.UTF_8);
+                    log("RCV incomplete <- {" + rawEvent + "}");
+                }
 
                 // We should end at the amount we read. If not, compact then
                 // buffer and read again.
@@ -208,7 +217,7 @@
         }
 
         final String unterminated = builder.toString();
-        if (LOGD) Slog.d(TAG, "SND -> " + unterminated);
+        log("SND -> {" + unterminated + "}");
 
         builder.append('\0');
 
@@ -292,7 +301,11 @@
             throws NativeDaemonConnectorException {
         final ArrayList<NativeDaemonEvent> events = Lists.newArrayList();
 
-        mResponseQueue.clear();
+        while (mResponseQueue.size() > 0) {
+            try {
+                log("ignoring {" + mResponseQueue.take() + "}");
+            } catch (Exception e) {}
+        }
 
         final String sentCommand = sendCommandLocked(cmd, args);
 
@@ -432,4 +445,13 @@
     public void monitor() {
         synchronized (mDaemonLock) { }
     }
+
+    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
+        mLocalLog.dump(fd, pw, args);
+    }
+
+    private void log(String logstring) {
+        if (LOGD) Slog.d(TAG, logstring);
+        mLocalLog.log(logstring);
+    }
 }
diff --git a/services/java/com/android/server/NetworkManagementService.java b/services/java/com/android/server/NetworkManagementService.java
index c1d8a13..7bb7938 100644
--- a/services/java/com/android/server/NetworkManagementService.java
+++ b/services/java/com/android/server/NetworkManagementService.java
@@ -163,7 +163,7 @@
         }
 
         mConnector = new NativeDaemonConnector(
-                new NetdCallbackReceiver(), "netd", 10, NETD_TAG);
+                new NetdCallbackReceiver(), "netd", 10, NETD_TAG, 50);
         mThread = new Thread(mConnector, NETD_TAG);
 
         // Add ourself to the Watchdog monitors.
@@ -1265,6 +1265,10 @@
     protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
         mContext.enforceCallingOrSelfPermission(DUMP, TAG);
 
+        pw.println("NetworkManagementService NativeDaemonConnector Log:");
+        mConnector.dump(fd, pw, args);
+        pw.println();
+
         pw.print("Bandwidth control enabled: "); pw.println(mBandwidthControlEnabled);
 
         synchronized (mQuotaLock) {
diff --git a/services/java/com/android/server/NetworkTimeUpdateService.java b/services/java/com/android/server/NetworkTimeUpdateService.java
index f7fe39e..a7d1992 100644
--- a/services/java/com/android/server/NetworkTimeUpdateService.java
+++ b/services/java/com/android/server/NetworkTimeUpdateService.java
@@ -234,8 +234,9 @@
             String action = intent.getAction();
             if (ConnectivityManager.CONNECTIVITY_ACTION.equals(action)) {
                 // There is connectivity
-                NetworkInfo netInfo = (NetworkInfo)intent.getParcelableExtra(
-                        ConnectivityManager.EXTRA_NETWORK_INFO);
+                final ConnectivityManager connManager = (ConnectivityManager) context
+                        .getSystemService(Context.CONNECTIVITY_SERVICE);
+                final NetworkInfo netInfo = connManager.getActiveNetworkInfo();
                 if (netInfo != null) {
                     // Verify that it's a WIFI connection
                     if (netInfo.getState() == NetworkInfo.State.CONNECTED &&
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java
index 5039294..34a8a02 100755
--- a/services/java/com/android/server/NotificationManagerService.java
+++ b/services/java/com/android/server/NotificationManagerService.java
@@ -45,6 +45,7 @@
 import android.os.Message;
 import android.os.Process;
 import android.os.RemoteException;
+import android.os.UserId;
 import android.os.Vibrator;
 import android.provider.Settings;
 import android.telephony.TelephonyManager;
@@ -1034,7 +1035,7 @@
         try {
             ApplicationInfo ai = mContext.getPackageManager().getApplicationInfo(
                     pkg, 0);
-            if (ai.uid != uid) {
+            if (!UserId.isSameApp(ai.uid, uid)) {
                 throw new SecurityException("Calling uid " + uid + " gave package"
                         + pkg + " which is owned by uid " + ai.uid);
             }
diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java
index 774495a..bb0ac3e 100644
--- a/services/java/com/android/server/PowerManagerService.java
+++ b/services/java/com/android/server/PowerManagerService.java
@@ -51,7 +51,6 @@
 import android.os.RemoteException;
 import android.os.SystemClock;
 import android.os.WorkSource;
-import android.provider.Settings.SettingNotFoundException;
 import android.provider.Settings;
 import android.util.EventLog;
 import android.util.Log;
@@ -60,6 +59,7 @@
 import static android.provider.Settings.System.DIM_SCREEN;
 import static android.provider.Settings.System.SCREEN_BRIGHTNESS;
 import static android.provider.Settings.System.SCREEN_BRIGHTNESS_MODE;
+import static android.provider.Settings.System.SCREEN_AUTO_BRIGHTNESS_ADJ;
 import static android.provider.Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC;
 import static android.provider.Settings.System.SCREEN_OFF_TIMEOUT;
 import static android.provider.Settings.System.STAY_ON_WHILE_PLUGGED_IN;
@@ -106,6 +106,14 @@
     // light sensor events rate in microseconds
     private static final int LIGHT_SENSOR_RATE = 1000000;
 
+    // Expansion of range of light values when applying scale from light
+    // sensor brightness setting, in the [0..255] brightness range.
+    private static final int LIGHT_SENSOR_RANGE_EXPANSION = 20;
+
+    // Scaling factor of the light sensor brightness setting when applying
+    // it to the final brightness.
+    private static final int LIGHT_SENSOR_OFFSET_SCALE = 8;
+
     // For debouncing the proximity sensor in milliseconds
     private static final int PROXIMITY_SENSOR_DELAY = 1000;
 
@@ -118,6 +126,9 @@
     // Default timeout for screen off, if not found in settings database = 15 seconds.
     private static final int DEFAULT_SCREEN_OFF_TIMEOUT = 15000;
 
+    // Screen brightness should always have a value, but just in case...
+    private static final int DEFAULT_SCREEN_BRIGHTNESS = 192;
+
     // flags for setPowerState
     private static final int SCREEN_ON_BIT          = 0x00000001;
     private static final int SCREEN_BRIGHT_BIT      = 0x00000002;
@@ -150,6 +161,8 @@
     static final int ANIM_STEPS = 60/4;
     // Slower animation for autobrightness changes
     static final int AUTOBRIGHTNESS_ANIM_STEPS = 60;
+    // Number of steps when performing a more immediate brightness change.
+    static final int IMMEDIATE_ANIM_STEPS = 4;
 
     // These magic numbers are the initial state of the LEDs at boot.  Ideally
     // we should read them from the driver, but our current hardware returns 0
@@ -227,6 +240,7 @@
     private boolean mLightSensorPendingDecrease = false;
     private boolean mLightSensorPendingIncrease = false;
     private float mLightSensorPendingValue = -1;
+    private float mLightSensorAdjustSetting = 0;
     private int mLightSensorScreenBrightness = -1;
     private int mLightSensorButtonBrightness = -1;
     private int mLightSensorKeyboardBrightness = -1;
@@ -240,6 +254,7 @@
     // mLastScreenOnTime is the time the screen was last turned on
     private long mLastScreenOnTime;
     private boolean mPreventScreenOn;
+    private int mScreenBrightnessSetting = DEFAULT_SCREEN_BRIGHTNESS;
     private int mScreenBrightnessOverride = -1;
     private int mButtonBrightnessOverride = -1;
     private int mScreenBrightnessDim;
@@ -460,6 +475,9 @@
                 // DIM_SCREEN
                 //mDimScreen = getInt(DIM_SCREEN) != 0;
 
+                mScreenBrightnessSetting = getInt(SCREEN_BRIGHTNESS, DEFAULT_SCREEN_BRIGHTNESS);
+                mLightSensorAdjustSetting = getFloat(SCREEN_AUTO_BRIGHTNESS_ADJ, 0);
+
                 // SCREEN_BRIGHTNESS_MODE, default to manual
                 setScreenBrightnessMode(getInt(SCREEN_BRIGHTNESS_MODE,
                         Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL));
@@ -624,9 +642,12 @@
                         + Settings.System.NAME + "=?) or ("
                         + Settings.System.NAME + "=?) or ("
                         + Settings.System.NAME + "=?) or ("
+                        + Settings.System.NAME + "=?) or ("
+                        + Settings.System.NAME + "=?) or ("
                         + Settings.System.NAME + "=?)",
-                new String[]{STAY_ON_WHILE_PLUGGED_IN, SCREEN_OFF_TIMEOUT, DIM_SCREEN,
-                        SCREEN_BRIGHTNESS_MODE, WINDOW_ANIMATION_SCALE, TRANSITION_ANIMATION_SCALE},
+                new String[]{STAY_ON_WHILE_PLUGGED_IN, SCREEN_OFF_TIMEOUT, DIM_SCREEN, SCREEN_BRIGHTNESS,
+                        SCREEN_BRIGHTNESS_MODE, SCREEN_AUTO_BRIGHTNESS_ADJ,
+                        WINDOW_ANIMATION_SCALE, TRANSITION_ANIMATION_SCALE},
                 null);
         mSettings = new ContentQueryMap(settingsCursor, Settings.System.NAME, true, mHandler);
         SettingsObserver settingsObserver = new SettingsObserver();
@@ -1163,7 +1184,8 @@
             pw.println("  mProximitySensorActive=" + mProximitySensorActive);
             pw.println("  mProximityPendingValue=" + mProximityPendingValue);
             pw.println("  mLastProximityEventTime=" + mLastProximityEventTime);
-            pw.println("  mLightSensorEnabled=" + mLightSensorEnabled);
+            pw.println("  mLightSensorEnabled=" + mLightSensorEnabled
+                    + " mLightSensorAdjustSetting=" + mLightSensorAdjustSetting);
             pw.println("  mLightSensorValue=" + mLightSensorValue
                     + " mLightSensorPendingValue=" + mLightSensorPendingValue);
             pw.println("  mLightSensorPendingDecrease=" + mLightSensorPendingDecrease
@@ -2230,20 +2252,15 @@
     }
 
     private int getPreferredBrightness() {
-        try {
-            if (mScreenBrightnessOverride >= 0) {
-                return mScreenBrightnessOverride;
-            } else if (mLightSensorScreenBrightness >= 0 && mUseSoftwareAutoBrightness
-                    && mAutoBrightessEnabled) {
-                return mLightSensorScreenBrightness;
-            }
-            final int brightness = Settings.System.getInt(mContext.getContentResolver(),
-                                                          SCREEN_BRIGHTNESS);
-             // Don't let applications turn the screen all the way off
-            return Math.max(brightness, mScreenBrightnessDim);
-        } catch (SettingNotFoundException snfe) {
-            return Power.BRIGHTNESS_ON;
+        if (mScreenBrightnessOverride >= 0) {
+            return mScreenBrightnessOverride;
+        } else if (mLightSensorScreenBrightness >= 0 && mUseSoftwareAutoBrightness
+                && mAutoBrightessEnabled) {
+            return mLightSensorScreenBrightness;
         }
+        final int brightness = mScreenBrightnessSetting;
+         // Don't let applications turn the screen all the way off
+        return Math.max(brightness, mScreenBrightnessDim);
     }
 
     private int applyButtonState(int state) {
@@ -2439,7 +2456,34 @@
                     break;
                 }
             }
-            return values[i];
+            // This is the range of brightness values that we can use.
+            final int minval = values[0];
+            final int maxval = values[mAutoBrightnessLevels.length];
+            // This is the range we will be scaling.  We put some padding
+            // at the low and high end to give the adjustment a little better
+            // impact on the actual observed value.
+            final int range = (maxval-minval) + LIGHT_SENSOR_RANGE_EXPANSION;
+            // This is the desired brightness value from 0.0 to 1.0.
+            float valf = ((values[i]-minval+(LIGHT_SENSOR_RANGE_EXPANSION/2))/(float)range);
+            // Apply a scaling to the value based on the adjustment.
+            if (mLightSensorAdjustSetting > 0 && mLightSensorAdjustSetting <= 1) {
+                float adj = (float)Math.sqrt(1.0f-mLightSensorAdjustSetting);
+                if (adj <= .00001) {
+                    valf = 1;
+                } else {
+                    valf /= adj;
+                }
+            } else if (mLightSensorAdjustSetting < 0 && mLightSensorAdjustSetting >= -1) {
+                float adj = (float)Math.sqrt(1.0f+mLightSensorAdjustSetting);
+                valf *= adj;
+            }
+            // Apply an additional offset to the value based on the adjustment.
+            valf += mLightSensorAdjustSetting/LIGHT_SENSOR_OFFSET_SCALE;
+            // Convert the 0.0-1.0 value back to a brightness integer.
+            int val = (int)((valf*range)+minval) - (LIGHT_SENSOR_RANGE_EXPANSION/2);
+            if (val < minval) val = minval;
+            else if (val > maxval) val = maxval;
+            return val;
         } catch (Exception e) {
             // guard against null pointer or index out of bounds errors
             Slog.e(TAG, "getAutoBrightnessValue", e);
@@ -2468,7 +2512,7 @@
                     int value = (int)mLightSensorPendingValue;
                     mLightSensorPendingDecrease = false;
                     mLightSensorPendingIncrease = false;
-                    lightSensorChangedLocked(value);
+                    lightSensorChangedLocked(value, false);
                 }
             }
         }
@@ -2485,12 +2529,12 @@
                 // force lights recalculation
                 int value = (int)mLightSensorValue;
                 mLightSensorValue = -1;
-                lightSensorChangedLocked(value);
+                lightSensorChangedLocked(value, false);
             }
         }
     }
 
-    private void lightSensorChangedLocked(int value) {
+    private void lightSensorChangedLocked(int value, boolean immediate) {
         if (mDebugLightSensor) {
             Slog.d(TAG, "lightSensorChangedLocked " + value);
         }
@@ -2536,7 +2580,8 @@
 
                 if (mAutoBrightessEnabled && mScreenBrightnessOverride < 0) {
                     if (!mSkippedScreenOn) {
-                        mScreenBrightness.setTargetLocked(lcdValue, AUTOBRIGHTNESS_ANIM_STEPS,
+                        mScreenBrightness.setTargetLocked(lcdValue,
+                                immediate ? IMMEDIATE_ANIM_STEPS : AUTOBRIGHTNESS_ANIM_STEPS,
                                 INITIAL_SCREEN_BRIGHTNESS, (int)mScreenBrightness.curValue);
                     }
                 }
@@ -2684,7 +2729,7 @@
                         if (mLightSensorValue >= 0) {
                             int value = (int)mLightSensorValue;
                             mLightSensorValue = -1;
-                            lightSensorChangedLocked(value);
+                            lightSensorChangedLocked(value, false);
                         }
                     }
                     userActivity(SystemClock.uptimeMillis(), false, BUTTON_EVENT, true);
@@ -2944,10 +2989,28 @@
                 Binder.restoreCallingIdentity(identity);
             }
 
-            // update our animation state
-            synchronized (mLocks) {
-                mScreenBrightness.targetValue = brightness;
-                mScreenBrightness.jumpToTargetLocked();
+            mScreenBrightness.targetValue = brightness;
+            mScreenBrightness.jumpToTargetLocked();
+        }
+    }
+
+    public void setAutoBrightnessAdjustment(float adj) {
+        mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DEVICE_POWER, null);
+        synchronized (mLocks) {
+            mLightSensorAdjustSetting = adj;
+            if (mSensorManager != null && mLightSensorEnabled) {
+                // clear calling identity so sensor manager battery stats are accurate
+                long identity = Binder.clearCallingIdentity();
+                try {
+                    // force recompute of backlight values
+                    if (mLightSensorValue >= 0) {
+                        int value = (int)mLightSensorValue;
+                        mLightSensorValue = -1;
+                        handleLightSensorValue(value, true);
+                    }
+                } finally {
+                    Binder.restoreCallingIdentity(identity);
+                }
             }
         }
     }
@@ -3062,7 +3125,7 @@
                     if (mLightSensorValue >= 0) {
                         int value = (int)mLightSensorValue;
                         mLightSensorValue = -1;
-                        handleLightSensorValue(value);
+                        handleLightSensorValue(value, true);
                     }
                     mSensorManager.registerListener(mLightListener, mLightSensor,
                             LIGHT_SENSOR_RATE);
@@ -3122,7 +3185,7 @@
         }
     };
 
-    private void handleLightSensorValue(int value) {
+    private void handleLightSensorValue(int value, boolean immediate) {
         long milliseconds = SystemClock.elapsedRealtime();
         if (mLightSensorValue == -1 ||
                 milliseconds < mLastScreenOnTime + mLightSensorWarmupTime) {
@@ -3130,7 +3193,7 @@
             mHandler.removeCallbacks(mAutoBrightnessTask);
             mLightSensorPendingDecrease = false;
             mLightSensorPendingIncrease = false;
-            lightSensorChangedLocked(value);
+            lightSensorChangedLocked(value, immediate);
         } else {
             if ((value > mLightSensorValue && mLightSensorPendingDecrease) ||
                     (value < mLightSensorValue && mLightSensorPendingIncrease) ||
@@ -3160,7 +3223,7 @@
                 if (isScreenTurningOffLocked()) {
                     return;
                 }
-                handleLightSensorValue((int)event.values[0]);
+                handleLightSensorValue((int)event.values[0], false);
             }
         }
 
diff --git a/services/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/java/com/android/server/accessibility/AccessibilityManagerService.java
index 23fa94a..8bda755 100644
--- a/services/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -46,7 +46,6 @@
 import android.util.Slog;
 import android.util.SparseArray;
 import android.view.IWindow;
-import android.view.View;
 import android.view.accessibility.AccessibilityEvent;
 import android.view.accessibility.AccessibilityManager;
 import android.view.accessibility.AccessibilityNodeInfo;
@@ -96,6 +95,10 @@
 
     private static final int DO_SET_SERVICE_INFO = 10;
 
+    public static final int ACTIVE_WINDOW_ID = -1;
+
+    public static final long ROOT_NODE_ID = -1;
+
     private static int sNextWindowId;
 
     final HandlerCaller mCaller;
@@ -467,7 +470,8 @@
         }
     }
 
-    public void registerEventListener(IEventListener listener) {
+    public void registerUiTestAutomationService(IEventListener listener,
+            AccessibilityServiceInfo accessibilityServiceInfo) {
         mSecurityPolicy.enforceCallingPermission(Manifest.permission.RETRIEVE_WINDOW_CONTENT,
                 FUNCTION_REGISTER_EVENT_LISTENER);
         ComponentName componentName = new ComponentName("foo.bar",
@@ -490,13 +494,23 @@
             }
         }
         // Hook the automation service up.
-        AccessibilityServiceInfo accessibilityServiceInfo = new AccessibilityServiceInfo();
-        accessibilityServiceInfo.eventTypes = AccessibilityEvent.TYPES_ALL_MASK;
-        accessibilityServiceInfo.feedbackType = AccessibilityServiceInfo.FEEDBACK_GENERIC;
         Service service = new Service(componentName, accessibilityServiceInfo, true);
         service.onServiceConnected(componentName, listener.asBinder());
     }
 
+    public void unregisterUiTestAutomationService(IEventListener listener) {
+        synchronized (mLock) {
+            final int serviceCount = mServices.size();
+            for (int i = 0; i < serviceCount; i++) {
+                Service service = mServices.get(i);
+                if (service.mServiceInterface == listener && service.mIsAutomation) {
+                    // Automation service is not bound, so pretend it died to perform clean up.
+                    service.binderDied();
+                }
+            }
+        }
+    }
+
     /**
      * Removes an AccessibilityInteractionConnection.
      *
@@ -1070,10 +1084,11 @@
             }
         }
 
-        public float findAccessibilityNodeInfoByViewIdInActiveWindow(int viewId,
-                int interactionId, IAccessibilityInteractionConnectionCallback callback,
-                long interrogatingTid)
+        public float findAccessibilityNodeInfoByViewId(int accessibilityWindowId,
+                long accessibilityNodeId, int viewId, int interactionId,
+                IAccessibilityInteractionConnectionCallback callback, long interrogatingTid)
                 throws RemoteException {
+            final int resolvedWindowId = resolveAccessibilityWindowId(accessibilityWindowId);
             IAccessibilityInteractionConnection connection = null;
             synchronized (mLock) {
                 mSecurityPolicy.enforceCanRetrieveWindowContent(this);
@@ -1081,12 +1096,8 @@
                 if (!permissionGranted) {
                     return 0;
                 } else {
-                    connection = getConnectionToRetrievalAllowingWindowLocked();
+                    connection = getConnectionLocked(resolvedWindowId);
                     if (connection == null) {
-                        if (DEBUG) {
-                            Slog.e(LOG_TAG, "No interaction connection to a retrieve "
-                                    + "allowing window.");
-                        }
                         return 0;
                     }
                 }
@@ -1094,44 +1105,33 @@
             final int interrogatingPid = Binder.getCallingPid();
             final long identityToken = Binder.clearCallingIdentity();
             try {
-                connection.findAccessibilityNodeInfoByViewId(viewId, interactionId, callback,
-                        interrogatingPid, interrogatingTid);
+                connection.findAccessibilityNodeInfoByViewId(accessibilityNodeId, viewId,
+                        interactionId, callback, interrogatingPid, interrogatingTid);
             } catch (RemoteException re) {
                 if (DEBUG) {
-                    Slog.e(LOG_TAG, "Error finding node.");
+                    Slog.e(LOG_TAG, "Error findAccessibilityNodeInfoByViewId().");
                 }
             } finally {
                 Binder.restoreCallingIdentity(identityToken);
             }
-            return getCompatibilityScale(mSecurityPolicy.getRetrievalAllowingWindowLocked());
+            return getCompatibilityScale(resolvedWindowId);
         }
 
-        public float findAccessibilityNodeInfosByTextInActiveWindow(
-                String text, int interactionId,
-                IAccessibilityInteractionConnectionCallback callback, long threadId)
-                throws RemoteException {
-            return findAccessibilityNodeInfosByText(text,
-                    mSecurityPolicy.mRetrievalAlowingWindowId, View.NO_ID, interactionId, callback,
-                    threadId);
-        }
-
-        public float findAccessibilityNodeInfosByText(String text,
-                int accessibilityWindowId, long accessibilityNodeId, int interactionId,
+        public float findAccessibilityNodeInfosByText(int accessibilityWindowId,
+                long accessibilityNodeId, String text, int interactionId,
                 IAccessibilityInteractionConnectionCallback callback, long interrogatingTid)
                 throws RemoteException {
+            final int resolvedWindowId = resolveAccessibilityWindowId(accessibilityWindowId);
             IAccessibilityInteractionConnection connection = null;
             synchronized (mLock) {
                 mSecurityPolicy.enforceCanRetrieveWindowContent(this);
                 final boolean permissionGranted =
-                    mSecurityPolicy.canGetAccessibilityNodeInfoLocked(this, accessibilityWindowId);
+                    mSecurityPolicy.canGetAccessibilityNodeInfoLocked(this, resolvedWindowId);
                 if (!permissionGranted) {
                     return 0;
                 } else {
-                    connection = getConnectionToRetrievalAllowingWindowLocked();
+                    connection = getConnectionLocked(resolvedWindowId);
                     if (connection == null) {
-                        if (DEBUG) {
-                            Slog.e(LOG_TAG, "No interaction connection to focused window.");
-                        }
                         return 0;
                     }
                 }
@@ -1139,40 +1139,35 @@
             final int interrogatingPid = Binder.getCallingPid();
             final long identityToken = Binder.clearCallingIdentity();
             try {
-                connection.findAccessibilityNodeInfosByText(text, accessibilityNodeId,
+                connection.findAccessibilityNodeInfosByText(accessibilityNodeId, text,
                         interactionId, callback, interrogatingPid, interrogatingTid);
             } catch (RemoteException re) {
                 if (DEBUG) {
-                    Slog.e(LOG_TAG, "Error finding node.");
+                    Slog.e(LOG_TAG, "Error calling findAccessibilityNodeInfosByText()");
                 }
             } finally {
                 Binder.restoreCallingIdentity(identityToken);
             }
-            return getCompatibilityScale(accessibilityWindowId);
+            return getCompatibilityScale(resolvedWindowId);
         }
 
         public float findAccessibilityNodeInfoByAccessibilityId(int accessibilityWindowId,
                 long accessibilityNodeId, int interactionId,
                 IAccessibilityInteractionConnectionCallback callback, long interrogatingTid)
                 throws RemoteException {
+            final int resolvedWindowId = resolveAccessibilityWindowId(accessibilityWindowId);
             IAccessibilityInteractionConnection connection = null;
             synchronized (mLock) {
                 mSecurityPolicy.enforceCanRetrieveWindowContent(this);
                 final boolean permissionGranted =
-                    mSecurityPolicy.canGetAccessibilityNodeInfoLocked(this, accessibilityWindowId);
+                    mSecurityPolicy.canGetAccessibilityNodeInfoLocked(this, resolvedWindowId);
                 if (!permissionGranted) {
                     return 0;
                 } else {
-                    AccessibilityConnectionWrapper wrapper =
-                        mWindowIdToInteractionConnectionWrapperMap.get(accessibilityWindowId);
-                    if (wrapper == null) {
-                        if (DEBUG) {
-                            Slog.e(LOG_TAG, "No interaction connection to window: "
-                                    + accessibilityWindowId);
-                        }
+                    connection = getConnectionLocked(resolvedWindowId);
+                    if (connection == null) {
                         return 0;
                     }
-                    connection = wrapper.mConnection;
                 }
             }
             final int interrogatingPid = Binder.getCallingPid();
@@ -1182,35 +1177,29 @@
                         interactionId, callback, interrogatingPid, interrogatingTid);
             } catch (RemoteException re) {
                 if (DEBUG) {
-                    Slog.e(LOG_TAG, "Error requesting node with accessibilityNodeId: "
-                            + accessibilityNodeId);
+                    Slog.e(LOG_TAG, "Error calling findAccessibilityNodeInfoByAccessibilityId()");
                 }
             } finally {
                 Binder.restoreCallingIdentity(identityToken);
             }
-            return getCompatibilityScale(accessibilityWindowId);
+            return getCompatibilityScale(resolvedWindowId);
         }
 
         public boolean performAccessibilityAction(int accessibilityWindowId,
                 long accessibilityNodeId, int action, int interactionId,
                 IAccessibilityInteractionConnectionCallback callback, long interrogatingTid) {
+            final int resolvedWindowId = resolveAccessibilityWindowId(accessibilityWindowId);
             IAccessibilityInteractionConnection connection = null;
             synchronized (mLock) {
                 final boolean permissionGranted = mSecurityPolicy.canPerformActionLocked(this,
-                        accessibilityWindowId, action);
+                        resolvedWindowId, action);
                 if (!permissionGranted) {
                     return false;
                 } else {
-                    AccessibilityConnectionWrapper wrapper =
-                        mWindowIdToInteractionConnectionWrapperMap.get(accessibilityWindowId);
-                    if (wrapper == null) {
-                        if (DEBUG) {
-                            Slog.e(LOG_TAG, "No interaction connection to window: "
-                                    + accessibilityWindowId);
-                        }
+                    connection = getConnectionLocked(resolvedWindowId);
+                    if (connection == null) {
                         return false;
                     }
-                    connection = wrapper.mConnection;
                 }
             }
             final int interrogatingPid = Binder.getCallingPid();
@@ -1220,8 +1209,7 @@
                         callback, interrogatingPid, interrogatingTid);
             } catch (RemoteException re) {
                 if (DEBUG) {
-                    Slog.e(LOG_TAG, "Error requesting node with accessibilityNodeId: "
-                            + accessibilityNodeId);
+                    Slog.e(LOG_TAG, "Error calling performAccessibilityAction()");
                 }
             } finally {
                 Binder.restoreCallingIdentity(identityToken);
@@ -1265,14 +1253,26 @@
             }
         }
 
-        private IAccessibilityInteractionConnection getConnectionToRetrievalAllowingWindowLocked() {
-            final int windowId = mSecurityPolicy.getRetrievalAllowingWindowLocked();
+        private IAccessibilityInteractionConnection getConnectionLocked(int windowId) {
             if (DEBUG) {
                 Slog.i(LOG_TAG, "Trying to get interaction connection to windowId: " + windowId);
             }
-            AccessibilityConnectionWrapper wrapper =
-                mWindowIdToInteractionConnectionWrapperMap.get(windowId);
-            return (wrapper != null) ? wrapper.mConnection : null;
+            AccessibilityConnectionWrapper wrapper = mWindowIdToInteractionConnectionWrapperMap.get(
+                    windowId);
+            if (wrapper != null && wrapper.mConnection != null) {
+                return wrapper.mConnection;
+            }
+            if (DEBUG) {
+                Slog.e(LOG_TAG, "No interaction connection to window: " + windowId);
+            }
+            return null;
+        }
+
+        private int resolveAccessibilityWindowId(int accessibilityWindowId) {
+            if (accessibilityWindowId == ACTIVE_WINDOW_ID) {
+                return mSecurityPolicy.mRetrievalAlowingWindowId;
+            }
+            return accessibilityWindowId;
         }
 
         private float getCompatibilityScale(int windowId) {
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index bbb4917..e6a1e68 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -75,6 +75,7 @@
 import android.content.pm.ProviderInfo;
 import android.content.pm.ResolveInfo;
 import android.content.pm.ServiceInfo;
+import android.content.pm.UserInfo;
 import android.content.pm.PackageManager.NameNotFoundException;
 import android.content.res.CompatibilityInfo;
 import android.content.res.Configuration;
@@ -104,6 +105,7 @@
 import android.os.StrictMode;
 import android.os.SystemClock;
 import android.os.SystemProperties;
+import android.os.UserId;
 import android.provider.Settings;
 import android.util.EventLog;
 import android.util.Pair;
@@ -111,6 +113,7 @@
 import android.util.Log;
 import android.util.PrintWriterPrinter;
 import android.util.SparseArray;
+import android.util.SparseIntArray;
 import android.util.TimeUtils;
 import android.view.Gravity;
 import android.view.LayoutInflater;
@@ -135,6 +138,7 @@
 import java.lang.IllegalStateException;
 import java.lang.ref.WeakReference;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
@@ -149,7 +153,9 @@
 
 public final class ActivityManagerService extends ActivityManagerNative
         implements Watchdog.Monitor, BatteryStatsImpl.BatteryCallback {
+    private static final String USER_DATA_DIR = "/data/user/";
     static final String TAG = "ActivityManager";
+    static final String TAG_MU = "ActivityManagerServiceMU";
     static final boolean DEBUG = false;
     static final boolean localLOGV = DEBUG;
     static final boolean DEBUG_SWITCH = localLOGV || false;
@@ -158,6 +164,7 @@
     static final boolean DEBUG_OOM_ADJ = localLOGV || false;
     static final boolean DEBUG_TRANSITION = localLOGV || false;
     static final boolean DEBUG_BROADCAST = localLOGV || false;
+    static final boolean DEBUG_BACKGROUND_BROADCAST = DEBUG_BROADCAST || false;
     static final boolean DEBUG_BROADCAST_LIGHT = DEBUG_BROADCAST || false;
     static final boolean DEBUG_SERVICE = localLOGV || false;
     static final boolean DEBUG_SERVICE_EXECUTING = localLOGV || false;
@@ -171,6 +178,7 @@
     static final boolean DEBUG_CONFIGURATION = localLOGV || false;
     static final boolean DEBUG_POWER = localLOGV || false;
     static final boolean DEBUG_POWER_QUICK = DEBUG_POWER || false;
+    static final boolean DEBUG_MU = localLOGV || false;
     static final boolean VALIDATE_TOKENS = false;
     static final boolean SHOW_ACTIVITY_START_TIME = true;
     
@@ -221,7 +229,8 @@
     static final int CPU_MIN_CHECK_DURATION = (DEBUG_POWER_QUICK ? 1 : 5) * 60*1000;
 
     // How long we allow a receiver to run before giving up on it.
-    static final int BROADCAST_TIMEOUT = 10*1000;
+    static final int BROADCAST_FG_TIMEOUT = 10*1000;
+    static final int BROADCAST_BG_TIMEOUT = 60*1000;
 
     // How long we wait for a service to finish executing.
     static final int SERVICE_TIMEOUT = 20*1000;
@@ -276,33 +285,832 @@
             = new ArrayList<PendingActivityLaunch>();
     
     /**
-     * List of all active broadcasts that are to be executed immediately
-     * (without waiting for another broadcast to finish).  Currently this only
-     * contains broadcasts to registered receivers, to avoid spinning up
-     * a bunch of processes to execute IntentReceiver components.
+     * BROADCASTS
+     *
+     * We keep two broadcast queues and associated bookkeeping, one for those at
+     * foreground priority, and one for normal (background-priority) broadcasts.
      */
-    final ArrayList<BroadcastRecord> mParallelBroadcasts
-            = new ArrayList<BroadcastRecord>();
+    public class BroadcastQueue {
+        static final String TAG = "BroadcastQueue";
 
-    /**
-     * List of all active broadcasts that are to be executed one at a time.
-     * The object at the top of the list is the currently activity broadcasts;
-     * those after it are waiting for the top to finish..
-     */
-    final ArrayList<BroadcastRecord> mOrderedBroadcasts
-            = new ArrayList<BroadcastRecord>();
+        static final int MAX_BROADCAST_HISTORY = 25;
 
-    /**
-     * Historical data of past broadcasts, for debugging.
-     */
-    static final int MAX_BROADCAST_HISTORY = 25;
-    final BroadcastRecord[] mBroadcastHistory
-            = new BroadcastRecord[MAX_BROADCAST_HISTORY];
+        /**
+         * Recognizable moniker for this queue
+         */
+        String mQueueName;
 
-    /**
-     * Set when we current have a BROADCAST_INTENT_MSG in flight.
-     */
-    boolean mBroadcastsScheduled = false;
+        /**
+         * Timeout period for this queue's broadcasts
+         */
+        long mTimeoutPeriod;
+
+        /**
+         * Lists of all active broadcasts that are to be executed immediately
+         * (without waiting for another broadcast to finish).  Currently this only
+         * contains broadcasts to registered receivers, to avoid spinning up
+         * a bunch of processes to execute IntentReceiver components.  Background-
+         * and foreground-priority broadcasts are queued separately.
+         */
+        final ArrayList<BroadcastRecord> mParallelBroadcasts
+                = new ArrayList<BroadcastRecord>();
+        /**
+         * List of all active broadcasts that are to be executed one at a time.
+         * The object at the top of the list is the currently activity broadcasts;
+         * those after it are waiting for the top to finish.  As with parallel
+         * broadcasts, separate background- and foreground-priority queues are
+         * maintained.
+         */
+        final ArrayList<BroadcastRecord> mOrderedBroadcasts
+                = new ArrayList<BroadcastRecord>();
+
+        /**
+         * Historical data of past broadcasts, for debugging.
+         */
+        final BroadcastRecord[] mBroadcastHistory
+                = new BroadcastRecord[MAX_BROADCAST_HISTORY];
+
+        /**
+         * Set when we current have a BROADCAST_INTENT_MSG in flight.
+         */
+        boolean mBroadcastsScheduled = false;
+
+        /**
+         * True if we have a pending unexpired BROADCAST_TIMEOUT_MSG posted to our handler.
+         */
+        boolean mPendingBroadcastTimeoutMessage;
+
+        /**
+         * Intent broadcasts that we have tried to start, but are
+         * waiting for the application's process to be created.  We only
+         * need one per scheduling class (instead of a list) because we always
+         * process broadcasts one at a time, so no others can be started while
+         * waiting for this one.
+         */
+        BroadcastRecord mPendingBroadcast = null;
+
+        /**
+         * The receiver index that is pending, to restart the broadcast if needed.
+         */
+        int mPendingBroadcastRecvIndex;
+
+        BroadcastQueue(String name, long timeoutPeriod) {
+            mQueueName = name;
+            mTimeoutPeriod = timeoutPeriod;
+        }
+
+        public boolean isPendingBroadcastProcessLocked(int pid) {
+            return mPendingBroadcast != null && mPendingBroadcast.curApp.pid == pid;
+        }
+
+        public void enqueueParallelBroadcastLocked(BroadcastRecord r) {
+            mParallelBroadcasts.add(r);
+        }
+
+        public void enqueueOrderedBroadcastLocked(BroadcastRecord r) {
+            mOrderedBroadcasts.add(r);
+        }
+
+        public final boolean replaceParallelBroadcastLocked(BroadcastRecord r) {
+            for (int i=mParallelBroadcasts.size()-1; i>=0; i--) {
+                if (r.intent.filterEquals(mParallelBroadcasts.get(i).intent)) {
+                    if (DEBUG_BROADCAST) Slog.v(TAG,
+                            "***** DROPPING PARALLEL ["
+                    + mQueueName + "]: " + r.intent);
+                    mParallelBroadcasts.set(i, r);
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public final boolean replaceOrderedBroadcastLocked(BroadcastRecord r) {
+            for (int i=mOrderedBroadcasts.size()-1; i>0; i--) {
+                if (r.intent.filterEquals(mOrderedBroadcasts.get(i).intent)) {
+                    if (DEBUG_BROADCAST) Slog.v(TAG,
+                            "***** DROPPING ORDERED ["
+                            + mQueueName + "]: " + r.intent);
+                    mOrderedBroadcasts.set(i, r);
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public boolean sendPendingBroadcastsLocked(ProcessRecord app) {
+            boolean didSomething = false;
+            final BroadcastRecord br = mPendingBroadcast;
+            if (br != null && br.curApp.pid == app.pid) {
+                try {
+                    mPendingBroadcast = null;
+                    processCurBroadcastLocked(br, app);
+                    didSomething = true;
+                } catch (Exception e) {
+                    Slog.w(TAG, "Exception in new application when starting receiver "
+                            + br.curComponent.flattenToShortString(), e);
+                    logBroadcastReceiverDiscardLocked(br);
+                    finishReceiverLocked(br, br.resultCode, br.resultData,
+                            br.resultExtras, br.resultAbort, true);
+                    scheduleBroadcastsLocked();
+                    // We need to reset the state if we fails to start the receiver.
+                    br.state = BroadcastRecord.IDLE;
+                    throw new RuntimeException(e.getMessage());
+                }
+            }
+            return didSomething;
+        }
+
+        public void skipPendingBroadcastLocked(int pid) {
+            final BroadcastRecord br = mPendingBroadcast;
+            if (br != null && br.curApp.pid == pid) {
+                br.state = BroadcastRecord.IDLE;
+                br.nextReceiver = mPendingBroadcastRecvIndex;
+                mPendingBroadcast = null;
+                scheduleBroadcastsLocked();
+            }
+        }
+
+        public void skipCurrentReceiverLocked(ProcessRecord app) {
+            boolean reschedule = false;
+            BroadcastRecord r = app.curReceiver;
+            if (r != null) {
+                // The current broadcast is waiting for this app's receiver
+                // to be finished.  Looks like that's not going to happen, so
+                // let the broadcast continue.
+                logBroadcastReceiverDiscardLocked(r);
+                finishReceiverLocked(r, r.resultCode, r.resultData,
+                        r.resultExtras, r.resultAbort, true);
+                reschedule = true;
+            }
+
+            r = mPendingBroadcast;
+            if (r != null && r.curApp == app) {
+                if (DEBUG_BROADCAST) Slog.v(TAG,
+                        "[" + mQueueName + "] skip & discard pending app " + r);
+                logBroadcastReceiverDiscardLocked(r);
+                finishReceiverLocked(r, r.resultCode, r.resultData,
+                        r.resultExtras, r.resultAbort, true);
+                reschedule = true;
+            }
+            if (reschedule) {
+                scheduleBroadcastsLocked();
+            }
+        }
+
+        public void scheduleBroadcastsLocked() {
+            if (DEBUG_BROADCAST) Slog.v(TAG, "Schedule broadcasts ["
+                    + mQueueName + "]: current="
+                    + mBroadcastsScheduled);
+
+            if (mBroadcastsScheduled) {
+                return;
+            }
+            mHandler.sendMessage(mHandler.obtainMessage(BROADCAST_INTENT_MSG, this));
+            mBroadcastsScheduled = true;
+        }
+
+        public BroadcastRecord getMatchingOrderedReceiver(IBinder receiver) {
+            if (mOrderedBroadcasts.size() > 0) {
+                final BroadcastRecord r = mOrderedBroadcasts.get(0);
+                if (r != null && r.receiver == receiver) {
+                    return r;
+                }
+            }
+            return null;
+        }
+
+        public boolean finishReceiverLocked(BroadcastRecord r, int resultCode,
+                String resultData, Bundle resultExtras, boolean resultAbort,
+                boolean explicit) {
+            int state = r.state;
+            r.state = BroadcastRecord.IDLE;
+            if (state == BroadcastRecord.IDLE) {
+                if (explicit) {
+                    Slog.w(TAG, "finishReceiver [" + mQueueName + "] called but state is IDLE");
+                }
+            }
+            r.receiver = null;
+            r.intent.setComponent(null);
+            if (r.curApp != null) {
+                r.curApp.curReceiver = null;
+            }
+            if (r.curFilter != null) {
+                r.curFilter.receiverList.curBroadcast = null;
+            }
+            r.curFilter = null;
+            r.curApp = null;
+            r.curComponent = null;
+            r.curReceiver = null;
+            mPendingBroadcast = null;
+
+            r.resultCode = resultCode;
+            r.resultData = resultData;
+            r.resultExtras = resultExtras;
+            r.resultAbort = resultAbort;
+
+            // We will process the next receiver right now if this is finishing
+            // an app receiver (which is always asynchronous) or after we have
+            // come back from calling a receiver.
+            return state == BroadcastRecord.APP_RECEIVE
+                    || state == BroadcastRecord.CALL_DONE_RECEIVE;
+        }
+
+        private final void processNextBroadcast(boolean fromMsg) {
+            synchronized(ActivityManagerService.this) {
+                BroadcastRecord r;
+
+                if (DEBUG_BROADCAST) Slog.v(TAG, "processNextBroadcast ["
+                        + mQueueName + "]: "
+                        + mParallelBroadcasts.size() + " broadcasts, "
+                        + mOrderedBroadcasts.size() + " ordered broadcasts");
+
+                updateCpuStats();
+
+                if (fromMsg) {
+                    mBroadcastsScheduled = false;
+                }
+
+                // First, deliver any non-serialized broadcasts right away.
+                while (mParallelBroadcasts.size() > 0) {
+                    r = mParallelBroadcasts.remove(0);
+                    r.dispatchTime = SystemClock.uptimeMillis();
+                    r.dispatchClockTime = System.currentTimeMillis();
+                    final int N = r.receivers.size();
+                    if (DEBUG_BROADCAST_LIGHT) Slog.v(TAG, "Processing parallel broadcast ["
+                            + mQueueName + "] " + r);
+                    for (int i=0; i<N; i++) {
+                        Object target = r.receivers.get(i);
+                        if (DEBUG_BROADCAST)  Slog.v(TAG,
+                                "Delivering non-ordered on [" + mQueueName + "] to registered "
+                                + target + ": " + r);
+                        deliverToRegisteredReceiverLocked(r, (BroadcastFilter)target, false);
+                    }
+                    addBroadcastToHistoryLocked(r);
+                    if (DEBUG_BROADCAST_LIGHT) Slog.v(TAG, "Done with parallel broadcast ["
+                            + mQueueName + "] " + r);
+                }
+
+                // Now take care of the next serialized one...
+
+                // If we are waiting for a process to come up to handle the next
+                // broadcast, then do nothing at this point.  Just in case, we
+                // check that the process we're waiting for still exists.
+                if (mPendingBroadcast != null) {
+                    if (DEBUG_BROADCAST_LIGHT) {
+                        Slog.v(TAG, "processNextBroadcast ["
+                                + mQueueName + "]: waiting for "
+                                + mPendingBroadcast.curApp);
+                    }
+
+                    boolean isDead;
+                    synchronized (mPidsSelfLocked) {
+                        isDead = (mPidsSelfLocked.get(mPendingBroadcast.curApp.pid) == null);
+                    }
+                    if (!isDead) {
+                        // It's still alive, so keep waiting
+                        return;
+                    } else {
+                        Slog.w(TAG, "pending app  ["
+                                + mQueueName + "]" + mPendingBroadcast.curApp
+                                + " died before responding to broadcast");
+                        mPendingBroadcast.state = BroadcastRecord.IDLE;
+                        mPendingBroadcast.nextReceiver = mPendingBroadcastRecvIndex;
+                        mPendingBroadcast = null;
+                    }
+                }
+
+                boolean looped = false;
+                
+                do {
+                    if (mOrderedBroadcasts.size() == 0) {
+                        // No more broadcasts pending, so all done!
+                        scheduleAppGcsLocked();
+                        if (looped) {
+                            // If we had finished the last ordered broadcast, then
+                            // make sure all processes have correct oom and sched
+                            // adjustments.
+                            updateOomAdjLocked();
+                        }
+                        return;
+                    }
+                    r = mOrderedBroadcasts.get(0);
+                    boolean forceReceive = false;
+
+                    // Ensure that even if something goes awry with the timeout
+                    // detection, we catch "hung" broadcasts here, discard them,
+                    // and continue to make progress.
+                    //
+                    // This is only done if the system is ready so that PRE_BOOT_COMPLETED
+                    // receivers don't get executed with timeouts. They're intended for
+                    // one time heavy lifting after system upgrades and can take
+                    // significant amounts of time.
+                    int numReceivers = (r.receivers != null) ? r.receivers.size() : 0;
+                    if (mProcessesReady && r.dispatchTime > 0) {
+                        long now = SystemClock.uptimeMillis();
+                        if ((numReceivers > 0) &&
+                                (now > r.dispatchTime + (2*mTimeoutPeriod*numReceivers))) {
+                            Slog.w(TAG, "Hung broadcast ["
+                                    + mQueueName + "] discarded after timeout failure:"
+                                    + " now=" + now
+                                    + " dispatchTime=" + r.dispatchTime
+                                    + " startTime=" + r.receiverTime
+                                    + " intent=" + r.intent
+                                    + " numReceivers=" + numReceivers
+                                    + " nextReceiver=" + r.nextReceiver
+                                    + " state=" + r.state);
+                            broadcastTimeoutLocked(false); // forcibly finish this broadcast
+                            forceReceive = true;
+                            r.state = BroadcastRecord.IDLE;
+                        }
+                    }
+
+                    if (r.state != BroadcastRecord.IDLE) {
+                        if (DEBUG_BROADCAST) Slog.d(TAG,
+                                "processNextBroadcast("
+                                + mQueueName + ") called when not idle (state="
+                                + r.state + ")");
+                        return;
+                    }
+
+                    if (r.receivers == null || r.nextReceiver >= numReceivers
+                            || r.resultAbort || forceReceive) {
+                        // No more receivers for this broadcast!  Send the final
+                        // result if requested...
+                        if (r.resultTo != null) {
+                            try {
+                                if (DEBUG_BROADCAST) {
+                                    int seq = r.intent.getIntExtra("seq", -1);
+                                    Slog.i(TAG, "Finishing broadcast ["
+                                            + mQueueName + "] " + r.intent.getAction()
+                                            + " seq=" + seq + " app=" + r.callerApp);
+                                }
+                                performReceiveLocked(r.callerApp, r.resultTo,
+                                    new Intent(r.intent), r.resultCode,
+                                    r.resultData, r.resultExtras, false, false);
+                                // Set this to null so that the reference
+                                // (local and remote) isnt kept in the mBroadcastHistory.
+                                r.resultTo = null;
+                            } catch (RemoteException e) {
+                                Slog.w(TAG, "Failure ["
+                                        + mQueueName + "] sending broadcast result of "
+                                        + r.intent, e);
+                            }
+                        }
+
+                        if (DEBUG_BROADCAST) Slog.v(TAG, "Cancelling BROADCAST_TIMEOUT_MSG");
+                        cancelBroadcastTimeoutLocked();
+
+                        if (DEBUG_BROADCAST_LIGHT) Slog.v(TAG, "Finished with ordered broadcast "
+                                + r);
+
+                        // ... and on to the next...
+                        addBroadcastToHistoryLocked(r);
+                        mOrderedBroadcasts.remove(0);
+                        r = null;
+                        looped = true;
+                        continue;
+                    }
+                } while (r == null);
+
+                // Get the next receiver...
+                int recIdx = r.nextReceiver++;
+
+                // Keep track of when this receiver started, and make sure there
+                // is a timeout message pending to kill it if need be.
+                r.receiverTime = SystemClock.uptimeMillis();
+                if (recIdx == 0) {
+                    r.dispatchTime = r.receiverTime;
+                    r.dispatchClockTime = System.currentTimeMillis();
+                    if (DEBUG_BROADCAST_LIGHT) Slog.v(TAG, "Processing ordered broadcast ["
+                            + mQueueName + "] " + r);
+                }
+                if (! mPendingBroadcastTimeoutMessage) {
+                    long timeoutTime = r.receiverTime + mTimeoutPeriod;
+                    if (DEBUG_BROADCAST) Slog.v(TAG,
+                            "Submitting BROADCAST_TIMEOUT_MSG ["
+                            + mQueueName + "] for " + r + " at " + timeoutTime);
+                    setBroadcastTimeoutLocked(timeoutTime);
+                }
+
+                Object nextReceiver = r.receivers.get(recIdx);
+                if (nextReceiver instanceof BroadcastFilter) {
+                    // Simple case: this is a registered receiver who gets
+                    // a direct call.
+                    BroadcastFilter filter = (BroadcastFilter)nextReceiver;
+                    if (DEBUG_BROADCAST)  Slog.v(TAG,
+                            "Delivering ordered ["
+                            + mQueueName + "] to registered "
+                            + filter + ": " + r);
+                    deliverToRegisteredReceiverLocked(r, filter, r.ordered);
+                    if (r.receiver == null || !r.ordered) {
+                        // The receiver has already finished, so schedule to
+                        // process the next one.
+                        if (DEBUG_BROADCAST) Slog.v(TAG, "Quick finishing ["
+                                + mQueueName + "]: ordered="
+                                + r.ordered + " receiver=" + r.receiver);
+                        r.state = BroadcastRecord.IDLE;
+                        scheduleBroadcastsLocked();
+                    }
+                    return;
+                }
+
+                // Hard case: need to instantiate the receiver, possibly
+                // starting its application process to host it.
+
+                ResolveInfo info =
+                    (ResolveInfo)nextReceiver;
+
+                boolean skip = false;
+                int perm = checkComponentPermission(info.activityInfo.permission,
+                        r.callingPid, r.callingUid, info.activityInfo.applicationInfo.uid,
+                        info.activityInfo.exported);
+                if (perm != PackageManager.PERMISSION_GRANTED) {
+                    if (!info.activityInfo.exported) {
+                        Slog.w(TAG, "Permission Denial: broadcasting "
+                                + r.intent.toString()
+                                + " from " + r.callerPackage + " (pid=" + r.callingPid
+                                + ", uid=" + r.callingUid + ")"
+                                + " is not exported from uid " + info.activityInfo.applicationInfo.uid
+                                + " due to receiver " + info.activityInfo.packageName
+                                + "/" + info.activityInfo.name);
+                    } else {
+                        Slog.w(TAG, "Permission Denial: broadcasting "
+                                + r.intent.toString()
+                                + " from " + r.callerPackage + " (pid=" + r.callingPid
+                                + ", uid=" + r.callingUid + ")"
+                                + " requires " + info.activityInfo.permission
+                                + " due to receiver " + info.activityInfo.packageName
+                                + "/" + info.activityInfo.name);
+                    }
+                    skip = true;
+                }
+                if (info.activityInfo.applicationInfo.uid != Process.SYSTEM_UID &&
+                    r.requiredPermission != null) {
+                    try {
+                        perm = AppGlobals.getPackageManager().
+                                checkPermission(r.requiredPermission,
+                                        info.activityInfo.applicationInfo.packageName);
+                    } catch (RemoteException e) {
+                        perm = PackageManager.PERMISSION_DENIED;
+                    }
+                    if (perm != PackageManager.PERMISSION_GRANTED) {
+                        Slog.w(TAG, "Permission Denial: receiving "
+                                + r.intent + " to "
+                                + info.activityInfo.applicationInfo.packageName
+                                + " requires " + r.requiredPermission
+                                + " due to sender " + r.callerPackage
+                                + " (uid " + r.callingUid + ")");
+                        skip = true;
+                    }
+                }
+                if (r.curApp != null && r.curApp.crashing) {
+                    // If the target process is crashing, just skip it.
+                    if (DEBUG_BROADCAST)  Slog.v(TAG,
+                            "Skipping deliver ordered ["
+                            + mQueueName + "] " + r + " to " + r.curApp
+                            + ": process crashing");
+                    skip = true;
+                }
+
+                if (skip) {
+                    if (DEBUG_BROADCAST)  Slog.v(TAG,
+                            "Skipping delivery of ordered ["
+                            + mQueueName + "] " + r + " for whatever reason");
+                    r.receiver = null;
+                    r.curFilter = null;
+                    r.state = BroadcastRecord.IDLE;
+                    scheduleBroadcastsLocked();
+                    return;
+                }
+
+                r.state = BroadcastRecord.APP_RECEIVE;
+                String targetProcess = info.activityInfo.processName;
+                r.curComponent = new ComponentName(
+                        info.activityInfo.applicationInfo.packageName,
+                        info.activityInfo.name);
+                if (r.callingUid != Process.SYSTEM_UID) {
+                    info.activityInfo = getActivityInfoForUser(info.activityInfo, UserId
+                            .getUserId(r.callingUid));
+                }
+                r.curReceiver = info.activityInfo;
+                if (DEBUG_MU && r.callingUid > UserId.PER_USER_RANGE) {
+                    Slog.v(TAG_MU, "Updated broadcast record activity info for secondary user, "
+                            + info.activityInfo + ", callingUid = " + r.callingUid + ", uid = "
+                            + info.activityInfo.applicationInfo.uid);
+                }
+
+                // Broadcast is being executed, its package can't be stopped.
+                try {
+                    AppGlobals.getPackageManager().setPackageStoppedState(
+                            r.curComponent.getPackageName(), false);
+                } catch (RemoteException e) {
+                } catch (IllegalArgumentException e) {
+                    Slog.w(TAG, "Failed trying to unstop package "
+                            + r.curComponent.getPackageName() + ": " + e);
+                }
+
+                // Is this receiver's application already running?
+                ProcessRecord app = getProcessRecordLocked(targetProcess,
+                        info.activityInfo.applicationInfo.uid);
+                if (app != null && app.thread != null) {
+                    try {
+                        app.addPackage(info.activityInfo.packageName);
+                        processCurBroadcastLocked(r, app);
+                        return;
+                    } catch (RemoteException e) {
+                        Slog.w(TAG, "Exception when sending broadcast to "
+                              + r.curComponent, e);
+                    }
+
+                    // If a dead object exception was thrown -- fall through to
+                    // restart the application.
+                }
+
+                // Not running -- get it started, to be executed when the app comes up.
+                if (DEBUG_BROADCAST)  Slog.v(TAG,
+                        "Need to start app ["
+                        + mQueueName + "] " + targetProcess + " for broadcast " + r);
+                if ((r.curApp=startProcessLocked(targetProcess,
+                        info.activityInfo.applicationInfo, true,
+                        r.intent.getFlags() | Intent.FLAG_FROM_BACKGROUND,
+                        "broadcast", r.curComponent,
+                        (r.intent.getFlags()&Intent.FLAG_RECEIVER_BOOT_UPGRADE) != 0))
+                                == null) {
+                    // Ah, this recipient is unavailable.  Finish it if necessary,
+                    // and mark the broadcast record as ready for the next.
+                    Slog.w(TAG, "Unable to launch app "
+                            + info.activityInfo.applicationInfo.packageName + "/"
+                            + info.activityInfo.applicationInfo.uid + " for broadcast "
+                            + r.intent + ": process is bad");
+                    logBroadcastReceiverDiscardLocked(r);
+                    finishReceiverLocked(r, r.resultCode, r.resultData,
+                            r.resultExtras, r.resultAbort, true);
+                    scheduleBroadcastsLocked();
+                    r.state = BroadcastRecord.IDLE;
+                    return;
+                }
+
+                mPendingBroadcast = r;
+                mPendingBroadcastRecvIndex = recIdx;
+            }
+        }
+
+        final void setBroadcastTimeoutLocked(long timeoutTime) {
+            if (! mPendingBroadcastTimeoutMessage) {
+                Message msg = mHandler.obtainMessage(BROADCAST_TIMEOUT_MSG, this);
+                mHandler.sendMessageAtTime(msg, timeoutTime);
+                mPendingBroadcastTimeoutMessage = true;
+            }
+        }
+
+        final void cancelBroadcastTimeoutLocked() {
+            if (mPendingBroadcastTimeoutMessage) {
+                mHandler.removeMessages(BROADCAST_TIMEOUT_MSG, this);
+                mPendingBroadcastTimeoutMessage = false;
+            }
+        }
+
+        final void broadcastTimeoutLocked(boolean fromMsg) {
+            if (fromMsg) {
+                mPendingBroadcastTimeoutMessage = false;
+            }
+
+            if (mOrderedBroadcasts.size() == 0) {
+                return;
+            }
+
+            long now = SystemClock.uptimeMillis();
+            BroadcastRecord r = mOrderedBroadcasts.get(0);
+            if (fromMsg) {
+                if (mDidDexOpt) {
+                    // Delay timeouts until dexopt finishes.
+                    mDidDexOpt = false;
+                    long timeoutTime = SystemClock.uptimeMillis() + mTimeoutPeriod;
+                    setBroadcastTimeoutLocked(timeoutTime);
+                    return;
+                }
+                if (! mProcessesReady) {
+                    // Only process broadcast timeouts if the system is ready. That way
+                    // PRE_BOOT_COMPLETED broadcasts can't timeout as they are intended
+                    // to do heavy lifting for system up.
+                    return;
+                }
+
+                long timeoutTime = r.receiverTime + mTimeoutPeriod;
+                if (timeoutTime > now) {
+                    // We can observe premature timeouts because we do not cancel and reset the
+                    // broadcast timeout message after each receiver finishes.  Instead, we set up
+                    // an initial timeout then kick it down the road a little further as needed
+                    // when it expires.
+                    if (DEBUG_BROADCAST) Slog.v(TAG,
+                            "Premature timeout ["
+                            + mQueueName + "] @ " + now + ": resetting BROADCAST_TIMEOUT_MSG for "
+                            + timeoutTime);
+                    setBroadcastTimeoutLocked(timeoutTime);
+                    return;
+                }
+            }
+
+            Slog.w(TAG, "Timeout of broadcast " + r + " - receiver=" + r.receiver
+                    + ", started " + (now - r.receiverTime) + "ms ago");
+            r.receiverTime = now;
+            r.anrCount++;
+
+            // Current receiver has passed its expiration date.
+            if (r.nextReceiver <= 0) {
+                Slog.w(TAG, "Timeout on receiver with nextReceiver <= 0");
+                return;
+            }
+
+            ProcessRecord app = null;
+            String anrMessage = null;
+
+            Object curReceiver = r.receivers.get(r.nextReceiver-1);
+            Slog.w(TAG, "Receiver during timeout: " + curReceiver);
+            logBroadcastReceiverDiscardLocked(r);
+            if (curReceiver instanceof BroadcastFilter) {
+                BroadcastFilter bf = (BroadcastFilter)curReceiver;
+                if (bf.receiverList.pid != 0
+                        && bf.receiverList.pid != MY_PID) {
+                    synchronized (ActivityManagerService.this.mPidsSelfLocked) {
+                        app = ActivityManagerService.this.mPidsSelfLocked.get(
+                                bf.receiverList.pid);
+                    }
+                }
+            } else {
+                app = r.curApp;
+            }
+
+            if (app != null) {
+                anrMessage = "Broadcast of " + r.intent.toString();
+            }
+
+            if (mPendingBroadcast == r) {
+                mPendingBroadcast = null;
+            }
+
+            // Move on to the next receiver.
+            finishReceiverLocked(r, r.resultCode, r.resultData,
+                    r.resultExtras, r.resultAbort, true);
+            scheduleBroadcastsLocked();
+
+            if (anrMessage != null) {
+                // Post the ANR to the handler since we do not want to process ANRs while
+                // potentially holding our lock.
+                mHandler.post(new AppNotResponding(app, anrMessage));
+            }
+        }
+
+        private final void addBroadcastToHistoryLocked(BroadcastRecord r) {
+            if (r.callingUid < 0) {
+                // This was from a registerReceiver() call; ignore it.
+                return;
+            }
+            System.arraycopy(mBroadcastHistory, 0, mBroadcastHistory, 1,
+                    MAX_BROADCAST_HISTORY-1);
+            r.finishTime = SystemClock.uptimeMillis();
+            mBroadcastHistory[0] = r;
+        }
+
+        final void logBroadcastReceiverDiscardLocked(BroadcastRecord r) {
+            if (r.nextReceiver > 0) {
+                Object curReceiver = r.receivers.get(r.nextReceiver-1);
+                if (curReceiver instanceof BroadcastFilter) {
+                    BroadcastFilter bf = (BroadcastFilter) curReceiver;
+                    EventLog.writeEvent(EventLogTags.AM_BROADCAST_DISCARD_FILTER,
+                            System.identityHashCode(r),
+                            r.intent.getAction(),
+                            r.nextReceiver - 1,
+                            System.identityHashCode(bf));
+                } else {
+                    EventLog.writeEvent(EventLogTags.AM_BROADCAST_DISCARD_APP,
+                            System.identityHashCode(r),
+                            r.intent.getAction(),
+                            r.nextReceiver - 1,
+                            ((ResolveInfo)curReceiver).toString());
+                }
+            } else {
+                Slog.w(TAG, "Discarding broadcast before first receiver is invoked: "
+                        + r);
+                EventLog.writeEvent(EventLogTags.AM_BROADCAST_DISCARD_APP,
+                        System.identityHashCode(r),
+                        r.intent.getAction(),
+                        r.nextReceiver,
+                        "NONE");
+            }
+        }
+
+        final boolean dumpLocked(FileDescriptor fd, PrintWriter pw, String[] args,
+                int opti, boolean dumpAll, String dumpPackage, boolean needSep) {
+            if (mParallelBroadcasts.size() > 0 || mOrderedBroadcasts.size() > 0
+                    || mPendingBroadcast != null) {
+                boolean printed = false;
+                for (int i=mParallelBroadcasts.size()-1; i>=0; i--) {
+                    BroadcastRecord br = mParallelBroadcasts.get(i);
+                    if (dumpPackage != null && !dumpPackage.equals(br.callerPackage)) {
+                        continue;
+                    }
+                    if (!printed) {
+                        if (needSep) {
+                            pw.println();
+                            needSep = false;
+                        }
+                        printed = true;
+                        pw.println("  Active broadcasts [" + mQueueName + "]:");
+                    }
+                    pw.println("  Broadcast #" + i + ":");
+                    br.dump(pw, "    ");
+                }
+                printed = false;
+                needSep = true;
+                for (int i=mOrderedBroadcasts.size()-1; i>=0; i--) {
+                    BroadcastRecord br = mOrderedBroadcasts.get(i);
+                    if (dumpPackage != null && !dumpPackage.equals(br.callerPackage)) {
+                        continue;
+                    }
+                    if (!printed) {
+                        if (needSep) {
+                            pw.println();
+                        }
+                        needSep = true;
+                        pw.println("  Active ordered broadcasts [" + mQueueName + "]:");
+                    }
+                    pw.println("  Ordered Broadcast #" + i + ":");
+                    mOrderedBroadcasts.get(i).dump(pw, "    ");
+                }
+                if (dumpPackage == null || (mPendingBroadcast != null
+                        && dumpPackage.equals(mPendingBroadcast.callerPackage))) {
+                    if (needSep) {
+                        pw.println();
+                    }
+                    pw.println("  Pending broadcast [" + mQueueName + "]:");
+                    if (mPendingBroadcast != null) {
+                        mPendingBroadcast.dump(pw, "    ");
+                    } else {
+                        pw.println("    (null)");
+                    }
+                    needSep = true;
+                }
+            }
+
+            boolean printed = false;
+            for (int i=0; i<MAX_BROADCAST_HISTORY; i++) {
+                BroadcastRecord r = mBroadcastHistory[i];
+                if (r == null) {
+                    break;
+                }
+                if (dumpPackage != null && !dumpPackage.equals(r.callerPackage)) {
+                    continue;
+                }
+                if (!printed) {
+                    if (needSep) {
+                        pw.println();
+                    }
+                    needSep = true;
+                    pw.println("  Historical broadcasts [" + mQueueName + "]:");
+                    printed = true;
+                }
+                if (dumpAll) {
+                    pw.print("  Historical Broadcast #"); pw.print(i); pw.println(":");
+                    r.dump(pw, "    ");
+                } else {
+                    if (i >= 50) {
+                        pw.println("  ...");
+                        break;
+                    }
+                    pw.print("  #"); pw.print(i); pw.print(": "); pw.println(r);
+                }
+            }
+
+            return needSep;
+        }
+    }
+
+    final BroadcastQueue mFgBroadcastQueue = new BroadcastQueue("foreground", BROADCAST_FG_TIMEOUT);
+    final BroadcastQueue mBgBroadcastQueue = new BroadcastQueue("background", BROADCAST_BG_TIMEOUT);
+    // Convenient for easy iteration over the queues. Foreground is first
+    // so that dispatch of foreground broadcasts gets precedence.
+    final BroadcastQueue[] mBroadcastQueues = { mFgBroadcastQueue, mBgBroadcastQueue };
+
+    BroadcastQueue broadcastQueueForIntent(Intent intent) {
+        final boolean isFg = (intent.getFlags() & Intent.FLAG_RECEIVER_FOREGROUND) != 0;
+        if (DEBUG_BACKGROUND_BROADCAST) {
+            Slog.i(TAG, "Broadcast intent " + intent + " on "
+                    + (isFg ? "foreground" : "background")
+                    + " queue");
+        }
+        return (isFg) ? mFgBroadcastQueue : mBgBroadcastQueue;
+    }
+
+    BroadcastRecord broadcastRecordForReceiverLocked(IBinder receiver) {
+        for (BroadcastQueue queue : mBroadcastQueues) {
+            BroadcastRecord r = queue.getMatchingOrderedReceiver(receiver);
+            if (r != null) {
+                return r;
+            }
+        }
+        return null;
+    }
 
     /**
      * Activity we have told the window manager to have key focus.
@@ -456,25 +1264,6 @@
     private final StringBuilder mStrictModeBuffer = new StringBuilder();
 
     /**
-     * True if we have a pending unexpired BROADCAST_TIMEOUT_MSG posted to our handler.
-     */
-    private boolean mPendingBroadcastTimeoutMessage;
-
-    /**
-     * Intent broadcast that we have tried to start, but are
-     * waiting for its application's process to be created.  We only
-     * need one (instead of a list) because we always process broadcasts
-     * one at a time, so no others can be started while waiting for this
-     * one.
-     */
-    BroadcastRecord mPendingBroadcast = null;
-
-    /**
-     * The receiver index that is pending, to restart the broadcast if needed.
-     */
-    int mPendingBroadcastRecvIndex;
-
-    /**
      * Keeps track of all IIntentReceivers that have been registered for
      * broadcasts.  Hash keys are the receiver IBinder, hash value is
      * a ReceiverList.
@@ -513,17 +1302,7 @@
     final HashMap<String, ArrayList<Intent>> mStickyBroadcasts =
             new HashMap<String, ArrayList<Intent>>();
 
-    /**
-     * All currently running services.
-     */
-    final HashMap<ComponentName, ServiceRecord> mServices =
-        new HashMap<ComponentName, ServiceRecord>();
-
-    /**
-     * All currently running services indexed by the Intent used to start them.
-     */
-    final HashMap<Intent.FilterComparison, ServiceRecord> mServicesByIntent =
-        new HashMap<Intent.FilterComparison, ServiceRecord>();
+    final ServiceMap mServiceMap = new ServiceMap();
 
     /**
      * All currently bound service connections.  Keys are the IBinder of
@@ -589,6 +1368,8 @@
     final HashMap<ComponentName, ContentProviderRecord> mProvidersByClass
             = new HashMap<ComponentName, ContentProviderRecord>();
 
+    final ProviderMap mProviderMap = new ProviderMap();
+
     /**
      * List of content providers who have clients waiting for them.  The
      * application is currently being launched and the provider will be
@@ -619,6 +1400,7 @@
             uid = _uid;
         }
     }
+
     private static ThreadLocal<Identity> sCallerIdentity = new ThreadLocal<Identity>();
 
     /**
@@ -910,11 +1692,12 @@
                     
                     Intent intent = new Intent("android.intent.action.ANR");
                     if (!mProcessesReady) {
-                        intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
+                        intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY
+                                | Intent.FLAG_RECEIVER_FOREGROUND);
                     }
                     broadcastIntentLocked(null, null, intent,
                             null, null, 0, null, null, null,
-                            false, false, MY_PID, Process.SYSTEM_UID);
+                            false, false, MY_PID, Process.SYSTEM_UID, 0 /* TODO: Verify */);
 
                     Dialog d = new AppNotRespondingDialog(ActivityManagerService.this,
                             mContext, proc, (ActivityRecord)data.get("activity"));
@@ -987,11 +1770,13 @@
             case BROADCAST_INTENT_MSG: {
                 if (DEBUG_BROADCAST) Slog.v(
                         TAG, "Received BROADCAST_INTENT_MSG");
-                processNextBroadcast(true);
+                BroadcastQueue queue = (BroadcastQueue) msg.obj;
+                queue.processNextBroadcast(true);
             } break;
             case BROADCAST_TIMEOUT_MSG: {
+                final BroadcastQueue queue = (BroadcastQueue) msg.obj;
                 synchronized (ActivityManagerService.this) {
-                    broadcastTimeoutLocked(true);
+                    queue.broadcastTimeoutLocked(true);
                 }
             } break;
             case SERVICE_TIMEOUT_MSG: {
@@ -1811,6 +2596,7 @@
                     processName);
             return procs != null ? procs.valueAt(0) : null;
         }
+        // uid = applyUserId(uid);
         ProcessRecord proc = mProcessNames.get(processName, uid);
         return proc;
     }
@@ -1940,6 +2726,7 @@
         
         try {
             int uid = app.info.uid;
+
             int[] gids = null;
             try {
                 gids = mContext.getPackageManager().getPackageGids(
@@ -2051,7 +2838,7 @@
         }
     }
 
-    boolean startHomeActivityLocked() {
+    boolean startHomeActivityLocked(int userId) {
         if (mFactoryTest == SystemServer.FACTORY_TEST_LOW_LEVEL
                 && mTopAction == null) {
             // We are running in factory test mode, but unable to find
@@ -2074,6 +2861,8 @@
                     aInfo.applicationInfo.packageName, aInfo.name));
             // Don't do this if the home app is currently being
             // instrumented.
+            aInfo = new ActivityInfo(aInfo);
+            aInfo.applicationInfo = getAppInfoForUser(aInfo.applicationInfo, userId);
             ProcessRecord app = getProcessRecordLocked(aInfo.processName,
                     aInfo.applicationInfo.uid);
             if (app == null || app.instrumentationClass == null) {
@@ -2082,11 +2871,10 @@
                         null, null, 0, 0, 0, false, false, null);
             }
         }
-        
-        
+
         return true;
     }
-    
+
     /**
      * Starts the "new version setup screen" if appropriate.
      */
@@ -2250,10 +3038,23 @@
             int grantedMode, IBinder resultTo,
             String resultWho, int requestCode, boolean onlyIfNeeded, boolean debug,
             String profileFile, ParcelFileDescriptor profileFd, boolean autoStopProfiler) {
+        int userId = 0;
+        if (intent.getCategories() != null && intent.getCategories().contains(Intent.CATEGORY_HOME)) {
+            // Requesting home, set the identity to the current user
+            // HACK!
+            userId = mCurrentUserId;
+        } else {
+            // TODO: Fix this in a better way - calls coming from SystemUI should probably carry
+            // the current user's userId
+            if (Binder.getCallingUid() < Process.FIRST_APPLICATION_UID) {
+                userId = 0;
+            } else {
+                userId = Binder.getOrigCallingUser();
+            }
+        }
         return mMainStack.startActivityMayWait(caller, -1, intent, resolvedType,
-                grantedUriPermissions, grantedMode, resultTo, resultWho,
-                requestCode, onlyIfNeeded, debug, profileFile, profileFd, autoStopProfiler,
-                null, null);
+                grantedUriPermissions, grantedMode, resultTo, resultWho, requestCode, onlyIfNeeded,
+                debug, profileFile, profileFd, autoStopProfiler, null, null, userId);
     }
 
     public final WaitResult startActivityAndWait(IApplicationThread caller,
@@ -2262,10 +3063,11 @@
             String resultWho, int requestCode, boolean onlyIfNeeded, boolean debug,
             String profileFile, ParcelFileDescriptor profileFd, boolean autoStopProfiler) {
         WaitResult res = new WaitResult();
+        int userId = Binder.getOrigCallingUser();
         mMainStack.startActivityMayWait(caller, -1, intent, resolvedType,
                 grantedUriPermissions, grantedMode, resultTo, resultWho,
                 requestCode, onlyIfNeeded, debug, profileFile, profileFd, autoStopProfiler,
-                res, null);
+                res, null, userId);
         return res;
     }
     
@@ -2274,9 +3076,11 @@
             int grantedMode, IBinder resultTo,
             String resultWho, int requestCode, boolean onlyIfNeeded,
             boolean debug, Configuration config) {
-        return mMainStack.startActivityMayWait(caller, -1, intent, resolvedType,
+        int ret = mMainStack.startActivityMayWait(caller, -1, intent, resolvedType,
                 grantedUriPermissions, grantedMode, resultTo, resultWho,
-                requestCode, onlyIfNeeded, debug, null, null, false, null, config);
+                requestCode, onlyIfNeeded,
+                debug, null, null, false, null, config, Binder.getOrigCallingUser());
+        return ret;
     }
 
     public int startActivityIntentSender(IApplicationThread caller,
@@ -2304,9 +3108,9 @@
                 mAppSwitchesAllowedTime = 0;
             }
         }
-        
-        return pir.sendInner(0, fillInIntent, resolvedType, null,
+        int ret = pir.sendInner(0, fillInIntent, resolvedType, null,
                 null, resultTo, resultWho, requestCode, flagsMask, flagsValues);
+        return ret;
     }
     
     public boolean startNextMatchingActivity(IBinder callingActivity,
@@ -2409,20 +3213,24 @@
         
         // This is so super not safe, that only the system (or okay root)
         // can do it.
+        int userId = Binder.getOrigCallingUser();
         final int callingUid = Binder.getCallingUid();
         if (callingUid != 0 && callingUid != Process.myUid()) {
             throw new SecurityException(
                     "startActivityInPackage only available to the system");
         }
 
-        return mMainStack.startActivityMayWait(null, uid, intent, resolvedType,
+        int ret = mMainStack.startActivityMayWait(null, uid, intent, resolvedType,
                 null, 0, resultTo, resultWho, requestCode, onlyIfNeeded, false,
-                null, null, false, null, null);
+                null, null, false, null, null, userId);
+        return ret;
     }
 
     public final int startActivities(IApplicationThread caller,
             Intent[] intents, String[] resolvedTypes, IBinder resultTo) {
-        return mMainStack.startActivities(caller, -1, intents, resolvedTypes, resultTo);
+        int ret = mMainStack.startActivities(caller, -1, intents, resolvedTypes, resultTo,
+                Binder.getOrigCallingUser());
+        return ret;
     }
 
     public final int startActivitiesInPackage(int uid,
@@ -2435,8 +3243,9 @@
             throw new SecurityException(
                     "startActivityInPackage only available to the system");
         }
-
-        return mMainStack.startActivities(null, uid, intents, resolvedTypes, resultTo);
+        int ret = mMainStack.startActivities(null, uid, intents, resolvedTypes, resultTo,
+                UserId.getUserId(uid));
+        return ret;
     }
 
     final void addRecentTaskLocked(TaskRecord task) {
@@ -2448,8 +3257,9 @@
         // Remove any existing entries that are the same kind of task.
         for (int i=0; i<N; i++) {
             TaskRecord tr = mRecentTasks.get(i);
-            if ((task.affinity != null && task.affinity.equals(tr.affinity))
-                    || (task.intent != null && task.intent.filterEquals(tr.intent))) {
+            if (task.userId == tr.userId
+                    && ((task.affinity != null && task.affinity.equals(tr.affinity))
+                    || (task.intent != null && task.intent.filterEquals(tr.intent)))) {
                 mRecentTasks.remove(i);
                 i--;
                 N--;
@@ -2808,7 +3618,6 @@
 
     private final int getLRURecordIndexForAppLocked(IApplicationThread thread) {
         IBinder threadBinder = thread.asBinder();
-
         // Find the application record.
         for (int i=mLruProcesses.size()-1; i>=0; i--) {
             ProcessRecord rec = mLruProcesses.get(i);
@@ -3185,7 +3994,7 @@
     }
     
     public boolean clearApplicationUserData(final String packageName,
-            final IPackageDataObserver observer) {
+            final IPackageDataObserver observer, final int userId) {
         int uid = Binder.getCallingUid();
         int pid = Binder.getCallingPid();
         long callingId = Binder.clearCallingIdentity();
@@ -3220,7 +4029,7 @@
                         Uri.fromParts("package", packageName, null));
                 intent.putExtra(Intent.EXTRA_UID, pkgUid);
                 broadcastIntentInPackage("android", Process.SYSTEM_UID, intent,
-                        null, null, 0, null, null, null, false, false);
+                        null, null, 0, null, null, null, false, false, userId);
             } catch (RemoteException e) {
             }
         } finally {
@@ -3315,7 +4124,7 @@
             Slog.w(TAG, msg);
             throw new SecurityException(msg);
         }
-        
+        final int userId = Binder.getOrigCallingUser();
         long callingId = Binder.clearCallingIdentity();
         try {
             IPackageManager pm = AppGlobals.getPackageManager();
@@ -3323,6 +4132,8 @@
             synchronized(this) {
                 try {
                     pkgUid = pm.getPackageUid(packageName);
+                    // Convert the uid to the one for the calling user
+                    pkgUid = UserId.getUid(userId, pkgUid);
                 } catch (RemoteException e) {
                 }
                 if (pkgUid == -1) {
@@ -3405,7 +4216,7 @@
             }
             
             broadcastIntentLocked(null, null, intent, null,
-                    null, 0, null, null, null, false, false, -1, uid);
+                    null, 0, null, null, null, false, false, -1, uid, 0 /* TODO: Verify */);
         }
         Binder.restoreCallingIdentity(origId);
     }
@@ -3465,7 +4276,8 @@
         intent.putExtra(Intent.EXTRA_UID, uid);
         broadcastIntentLocked(null, null, intent,
                 null, null, 0, null, null, null,
-                false, false, MY_PID, Process.SYSTEM_UID);
+                false, false,
+                MY_PID, Process.SYSTEM_UID, UserId.getUserId(uid));
     }
     
     private final boolean killPackageProcessesLocked(String packageName, int uid,
@@ -3569,7 +4381,8 @@
         }
 
         ArrayList<ServiceRecord> services = new ArrayList<ServiceRecord>();
-        for (ServiceRecord service : mServices.values()) {
+        int userId = UserId.getUserId(uid);
+        for (ServiceRecord service : mServiceMap.getAllServices(userId)) {
             if (service.packageName.equals(name)
                     && (service.app == null || evenPersistent || !service.app.persistent)) {
                 if (!doit) {
@@ -3708,12 +4521,9 @@
                     // Can't happen; the backup manager is local
                 }
             }
-            if (mPendingBroadcast != null && mPendingBroadcast.curApp.pid == pid) {
+            if (isPendingBroadcastProcessLocked(pid)) {
                 Slog.w(TAG, "Unattached app died before broadcast acknowledged, skipping");
-                mPendingBroadcast.state = BroadcastRecord.IDLE;
-                mPendingBroadcast.nextReceiver = mPendingBroadcastRecvIndex;
-                mPendingBroadcast = null;
-                scheduleBroadcastsLocked();
+                skipPendingBroadcastLocked(pid);
             }
         } else {
             Slog.w(TAG, "Spurious process start timeout - pid not known for " + app);
@@ -3912,23 +4722,13 @@
             }
         }
 
-        // Check if the next broadcast receiver is in this process...
-        BroadcastRecord br = mPendingBroadcast;
-        if (!badApp && br != null && br.curApp == app) {
+        // Check if a next-broadcast receiver is in this process...
+        if (!badApp && isPendingBroadcastProcessLocked(pid)) {
             try {
-                mPendingBroadcast = null;
-                processCurBroadcastLocked(br, app);
-                didSomething = true;
+                didSomething = sendPendingBroadcastsLocked(app);
             } catch (Exception e) {
-                Slog.w(TAG, "Exception in new application when starting receiver "
-                      + br.curComponent.flattenToShortString(), e);
+                // If the app died trying to launch the receiver we declare it 'bad'
                 badApp = true;
-                logBroadcastReceiverDiscardLocked(br);
-                finishReceiverLocked(br.receiver, br.resultCode, br.resultData,
-                        br.resultExtras, br.resultAbort, true);
-                scheduleBroadcastsLocked();
-                // We need to reset the state if we fails to start the receiver.
-                br.state = BroadcastRecord.IDLE;
             }
         }
 
@@ -4045,11 +4845,13 @@
                 mHandler.sendMessageDelayed(nmsg, POWER_CHECK_DELAY);
                 // Tell anyone interested that we are done booting!
                 SystemProperties.set("sys.boot_completed", "1");
+                SystemProperties.set("dev.bootcomplete", "1");
+                /* TODO: Send this to all users that are to be logged in on startup */
                 broadcastIntentLocked(null, null,
                         new Intent(Intent.ACTION_BOOT_COMPLETED, null),
                         null, null, 0, null, null,
                         android.Manifest.permission.RECEIVE_BOOT_COMPLETED,
-                        false, false, MY_PID, Process.SYSTEM_UID);
+                        false, false, MY_PID, Process.SYSTEM_UID, Binder.getOrigCallingUser());
             }
         }
     }
@@ -4190,7 +4992,7 @@
                 if (callingUid != 0 && callingUid != Process.SYSTEM_UID) {
                     int uid = AppGlobals.getPackageManager()
                             .getPackageUid(packageName);
-                    if (uid != Binder.getCallingUid()) {
+                    if (UserId.getAppId(callingUid) != uid) {
                         String msg = "Permission Denial: getIntentSender() from pid="
                             + Binder.getCallingPid()
                             + ", uid=" + Binder.getCallingUid()
@@ -4201,7 +5003,10 @@
                     }
                 }
                 
-                return getIntentSenderLocked(type, packageName, callingUid,
+                if (DEBUG_MU)
+                    Slog.i(TAG_MU, "Getting intent sender for origCallingUid="
+                            + Binder.getOrigCallingUid());
+                return getIntentSenderLocked(type, packageName, Binder.getOrigCallingUid(),
                         token, resultWho, requestCode, intents, resolvedTypes, flags);
                 
             } catch (RemoteException e) {
@@ -4213,6 +5018,8 @@
     IIntentSender getIntentSenderLocked(int type,
             String packageName, int callingUid, IBinder token, String resultWho,
             int requestCode, Intent[] intents, String[] resolvedTypes, int flags) {
+        if (DEBUG_MU)
+            Slog.v(TAG_MU, "getIntentSenderLocked(): uid=" + callingUid);
         ActivityRecord activity = null;
         if (type == INTENT_SENDER_ACTIVITY_RESULT) {
             activity = mMainStack.isInStackLocked(token);
@@ -4456,7 +5263,7 @@
         }
         // If there is a uid that owns whatever is being accessed, it has
         // blanket access to it regardless of the permissions it requires.
-        if (owningUid >= 0 && uid == owningUid) {
+        if (owningUid >= 0 && UserId.isSameApp(uid, owningUid)) {
             return PackageManager.PERMISSION_GRANTED;
         }
         // If the target is not exported, then nobody else can get to it.
@@ -4490,7 +5297,7 @@
         if (permission == null) {
             return PackageManager.PERMISSION_DENIED;
         }
-        return checkComponentPermission(permission, pid, uid, -1, true);
+        return checkComponentPermission(permission, pid, UserId.getAppId(uid), -1, true);
     }
 
     /**
@@ -4500,7 +5307,7 @@
     int checkCallingPermission(String permission) {
         return checkPermission(permission,
                 Binder.getCallingPid(),
-                Binder.getCallingUid());
+                UserId.getAppId(Binder.getCallingUid()));
     }
 
     /**
@@ -4614,6 +5421,7 @@
             pid = tlsIdentity.pid;
         }
 
+        uid = UserId.getAppId(uid);
         // Our own process gets to do everything.
         if (pid == MY_PID) {
             return PackageManager.PERMISSION_GRANTED;
@@ -4656,7 +5464,8 @@
 
         String name = uri.getAuthority();
         ProviderInfo pi = null;
-        ContentProviderRecord cpr = mProvidersByName.get(name);
+        ContentProviderRecord cpr = mProviderMap.getProviderByName(name,
+                UserId.getUserId(callingUid));
         if (cpr != null) {
             pi = cpr.info;
         } else {
@@ -4912,7 +5721,8 @@
 
         final String authority = uri.getAuthority();
         ProviderInfo pi = null;
-        ContentProviderRecord cpr = mProvidersByName.get(authority);
+        ContentProviderRecord cpr = mProviderMap.getProviderByName(authority,
+                UserId.getUserId(callingUid));
         if (cpr != null) {
             pi = cpr.info;
         } else {
@@ -5006,7 +5816,8 @@
 
             final String authority = uri.getAuthority();
             ProviderInfo pi = null;
-            ContentProviderRecord cpr = mProvidersByName.get(authority);
+            ContentProviderRecord cpr = mProviderMap.getProviderByName(authority,
+                    UserId.getUserId(r.info.uid));
             if (cpr != null) {
                 pi = cpr.info;
             } else {
@@ -5245,6 +6056,12 @@
 
     public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum,
             int flags) {
+        final int callingUid = Binder.getCallingUid();
+        // If it's the system uid asking, then use the current user id.
+        // TODO: Make sure that there aren't any other legitimate calls from the system uid that
+        // require the entire list.
+        final int callingUserId = callingUid == Process.SYSTEM_UID
+                ? mCurrentUserId : UserId.getUserId(callingUid);
         synchronized (this) {
             enforceCallingPermission(android.Manifest.permission.GET_TASKS,
                     "getRecentTasks()");
@@ -5257,11 +6074,14 @@
                             maxNum < N ? maxNum : N);
             for (int i=0; i<N && maxNum > 0; i++) {
                 TaskRecord tr = mRecentTasks.get(i);
+                // Only add calling user's recent tasks
+                if (tr.userId != callingUserId) continue;
                 // Return the entry if desired by the caller.  We always return
                 // the first entry, because callers always expect this to be the
-                // forground app.  We may filter others if the caller has
+                // foreground app.  We may filter others if the caller has
                 // not supplied RECENT_WITH_EXCLUDED and there is some reason
                 // we should exclude the entry.
+
                 if (i == 0
                         || ((flags&ActivityManager.RECENT_WITH_EXCLUDED) != 0)
                         || (tr.intent == null)
@@ -5350,7 +6170,7 @@
 
         // Find any running services associated with this app.
         ArrayList<ServiceRecord> services = new ArrayList<ServiceRecord>();
-        for (ServiceRecord sr : mServices.values()) {
+        for (ServiceRecord sr : mServiceMap.getAllServices(root.userId)) {
             if (sr.packageName.equals(component.getPackageName())) {
                 services.add(sr);
             }
@@ -5721,17 +6541,23 @@
                         STOCK_PM_FLAGS | PackageManager.GET_URI_PERMISSION_PATTERNS);
         } catch (RemoteException ex) {
         }
+        if (DEBUG_MU)
+            Slog.v(TAG_MU, "generateApplicationProvidersLocked, app.info.uid = " + app.info.uid);
+        int userId = UserId.getUserId(app.info.uid);
         if (providers != null) {
             final int N = providers.size();
             for (int i=0; i<N; i++) {
                 ProviderInfo cpi =
                     (ProviderInfo)providers.get(i);
+
                 ComponentName comp = new ComponentName(cpi.packageName, cpi.name);
-                ContentProviderRecord cpr = mProvidersByClass.get(comp);
+                ContentProviderRecord cpr = mProviderMap.getProviderByClass(comp, userId);
                 if (cpr == null) {
                     cpr = new ContentProviderRecord(cpi, app.info, comp);
-                    mProvidersByClass.put(comp, cpr);
+                    mProviderMap.putProviderByClass(comp, cpr);
                 }
+                if (DEBUG_MU)
+                    Slog.v(TAG_MU, "generateApplicationProvidersLocked, cpi.uid = " + cpr.uid);
                 app.pubProviders.put(cpi.name, cpr);
                 app.addPackage(cpi.applicationInfo.packageName);
                 ensurePackageDexOpt(cpi.applicationInfo.packageName);
@@ -5841,8 +6667,8 @@
         return false;
     }
 
-    private final ContentProviderHolder getContentProviderImpl(
-        IApplicationThread caller, String name) {
+    private final ContentProviderHolder getContentProviderImpl(IApplicationThread caller,
+            String name) {
         ContentProviderRecord cpr;
         ProviderInfo cpi = null;
 
@@ -5859,7 +6685,8 @@
             }
 
             // First check if this content provider has been published...
-            cpr = mProvidersByName.get(name);
+            int userId = UserId.getUserId(r != null ? r.info.uid : Binder.getCallingUid());
+            cpr = mProviderMap.getProviderByName(name, userId);
             boolean providerRunning = cpr != null;
             if (providerRunning) {
                 cpi = cpr.info;
@@ -5944,6 +6771,9 @@
                     return null;
                 }
 
+                cpi.applicationInfo = getAppInfoForUser(cpi.applicationInfo,
+                        Binder.getOrigCallingUser());
+
                 String msg;
                 if ((msg=checkContentProviderPermissionLocked(cpi, r)) != null) {
                     throw new SecurityException(msg);
@@ -5959,7 +6789,7 @@
                 }
 
                 ComponentName comp = new ComponentName(cpi.packageName, cpi.name);
-                cpr = mProvidersByClass.get(comp);
+                cpr = mProviderMap.getProviderByClass(comp, Binder.getOrigCallingUser());
                 final boolean firstClass = cpr == null;
                 if (firstClass) {
                     try {
@@ -5973,6 +6803,7 @@
                                     + cpi.name);
                             return null;
                         }
+                        ai = getAppInfoForUser(ai, Binder.getOrigCallingUser());
                         cpr = new ContentProviderRecord(cpi, ai, comp);
                     } catch (RemoteException ex) {
                         // pm is in same process, this will never happen.
@@ -6041,9 +6872,9 @@
                 // Make sure the provider is published (the same provider class
                 // may be published under multiple names).
                 if (firstClass) {
-                    mProvidersByClass.put(comp, cpr);
+                    mProviderMap.putProviderByClass(comp, cpr);
                 }
-                mProvidersByName.put(name, cpr);
+                mProviderMap.putProviderByName(name, cpr);
                 incProviderCount(r, cpr);
             }
         }
@@ -6062,6 +6893,10 @@
                     return null;
                 }
                 try {
+                    if (DEBUG_MU) {
+                        Slog.v(TAG_MU, "Waiting to start provider " + cpr + " launchingApp="
+                                + cpr.launchingApp);
+                    }
                     cpr.wait();
                 } catch (InterruptedException ex) {
                 }
@@ -6079,7 +6914,8 @@
             throw new SecurityException(msg);
         }
 
-        return getContentProviderImpl(caller, name);
+        ContentProviderHolder contentProvider = getContentProviderImpl(caller, name);
+        return contentProvider;
     }
 
     private ContentProviderHolder getContentProviderExternal(String name) {
@@ -6092,7 +6928,8 @@
      */
     public void removeContentProvider(IApplicationThread caller, String name) {
         synchronized (this) {
-            ContentProviderRecord cpr = mProvidersByName.get(name);
+            int userId = UserId.getUserId(Binder.getCallingUid());
+            ContentProviderRecord cpr = mProviderMap.getProviderByName(name, userId);
             if(cpr == null) {
                 // remove from mProvidersByClass
                 if (DEBUG_PROVIDER) Slog.v(TAG, name +
@@ -6107,8 +6944,11 @@
             }
             //update content provider record entry info
             ComponentName comp = new ComponentName(cpr.info.packageName, cpr.info.name);
-            ContentProviderRecord localCpr = mProvidersByClass.get(comp);
-            if (localCpr.proc == r) {
+            ContentProviderRecord localCpr = mProviderMap.getProviderByClass(comp, userId);
+            if (DEBUG_PROVIDER) Slog.v(TAG, "Removing provider requested by "
+                    + r.info.processName + " from process "
+                    + localCpr.appInfo.processName);
+            if (localCpr.launchingApp == r) {
                 //should not happen. taken care of as a local provider
                 Slog.w(TAG, "removeContentProvider called on local provider: "
                         + cpr.info.name + " in process " + r.processName);
@@ -6123,7 +6963,8 @@
 
     private void removeContentProviderExternal(String name) {
         synchronized (this) {
-            ContentProviderRecord cpr = mProvidersByName.get(name);
+            ContentProviderRecord cpr = mProviderMap.getProviderByName(name,
+                    Binder.getOrigCallingUser());
             if(cpr == null) {
                 //remove from mProvidersByClass
                 if(localLOGV) Slog.v(TAG, name+" content provider not found in providers list");
@@ -6132,7 +6973,8 @@
 
             //update content provider record entry info
             ComponentName comp = new ComponentName(cpr.info.packageName, cpr.info.name);
-            ContentProviderRecord localCpr = mProvidersByClass.get(comp);
+            ContentProviderRecord localCpr = mProviderMap.getProviderByClass(comp,
+                    Binder.getOrigCallingUser());
             localCpr.externals--;
             if (localCpr.externals < 0) {
                 Slog.e(TAG, "Externals < 0 for content provider " + localCpr);
@@ -6149,6 +6991,8 @@
 
         synchronized(this) {
             final ProcessRecord r = getRecordForAppLocked(caller);
+            if (DEBUG_MU)
+                Slog.v(TAG_MU, "ProcessRecord uid = " + r.info.uid);
             if (r == null) {
                 throw new SecurityException(
                         "Unable to find app for caller " + caller
@@ -6165,12 +7009,14 @@
                     continue;
                 }
                 ContentProviderRecord dst = r.pubProviders.get(src.info.name);
+                if (DEBUG_MU)
+                    Slog.v(TAG_MU, "ContentProviderRecord uid = " + dst.uid);
                 if (dst != null) {
                     ComponentName comp = new ComponentName(dst.info.packageName, dst.info.name);
-                    mProvidersByClass.put(comp, dst);
+                    mProviderMap.putProviderByClass(comp, dst);
                     String names[] = dst.info.authority.split(";");
                     for (int j = 0; j < names.length; j++) {
-                        mProvidersByName.put(names[j], dst);
+                        mProviderMap.putProviderByName(names[j], dst);
                     }
 
                     int NL = mLaunchingProviders.size();
@@ -6915,8 +7761,10 @@
                             };
                         }
                         Slog.i(TAG, "Sending system update to: " + intent.getComponent());
+                        /* TODO: Send this to all users */
                         broadcastIntentLocked(null, null, intent, null, finisher,
-                                0, null, null, null, true, false, MY_PID, Process.SYSTEM_UID);
+                                0, null, null, null, true, false, MY_PID, Process.SYSTEM_UID,
+                                Process.SYSTEM_UID);
                         if (finisher != null) {
                             mWaitingUpdate = true;
                         }
@@ -7226,28 +8074,8 @@
     }
 
     void skipCurrentReceiverLocked(ProcessRecord app) {
-        boolean reschedule = false;
-        BroadcastRecord r = app.curReceiver;
-        if (r != null) {
-            // The current broadcast is waiting for this app's receiver
-            // to be finished.  Looks like that's not going to happen, so
-            // let the broadcast continue.
-            logBroadcastReceiverDiscardLocked(r);
-            finishReceiverLocked(r.receiver, r.resultCode, r.resultData,
-                    r.resultExtras, r.resultAbort, true);
-            reschedule = true;
-        }
-        r = mPendingBroadcast;
-        if (r != null && r.curApp == app) {
-            if (DEBUG_BROADCAST) Slog.v(TAG,
-                    "skip & discard pending app " + r);
-            logBroadcastReceiverDiscardLocked(r);
-            finishReceiverLocked(r.receiver, r.resultCode, r.resultData,
-                    r.resultExtras, r.resultAbort, true);
-            reschedule = true;
-        }
-        if (reschedule) {
-            scheduleBroadcastsLocked();
+        for (BroadcastQueue queue : mBroadcastQueues) {
+            queue.skipCurrentReceiverLocked(app);
         }
     }
 
@@ -8562,8 +9390,14 @@
 
         if ("all".equals(name)) {
             synchronized (this) {
-                for (ServiceRecord r1 : mServices.values()) {
-                    services.add(r1);
+                try {
+                    List<UserInfo> users = AppGlobals.getPackageManager().getUsers();
+                    for (UserInfo user : users) {
+                        for (ServiceRecord r1 : mServiceMap.getAllServices(user.id)) {
+                            services.add(r1);
+                        }
+                    }
+                } catch (RemoteException re) {
                 }
             }
         } else {
@@ -8581,18 +9415,24 @@
             }
 
             synchronized (this) {
-                for (ServiceRecord r1 : mServices.values()) {
-                    if (componentName != null) {
-                        if (r1.name.equals(componentName)) {
-                            services.add(r1);
+                try {
+                    List<UserInfo> users = AppGlobals.getPackageManager().getUsers();
+                    for (UserInfo user : users) {
+                        for (ServiceRecord r1 : mServiceMap.getAllServices(user.id)) {
+                            if (componentName != null) {
+                                if (r1.name.equals(componentName)) {
+                                    services.add(r1);
+                                }
+                            } else if (name != null) {
+                                if (r1.name.flattenToString().contains(name)) {
+                                    services.add(r1);
+                                }
+                            } else if (System.identityHashCode(r1) == objectId) {
+                                services.add(r1);
+                            }
                         }
-                    } else if (name != null) {
-                        if (r1.name.flattenToString().contains(name)) {
-                            services.add(r1);
-                        }
-                    } else if (System.identityHashCode(r1) == objectId) {
-                        services.add(r1);
                     }
+                } catch (RemoteException re) {
                 }
             }
         }
@@ -8970,84 +9810,11 @@
                 needSep = true;
             }
         }
-        
-        if (mParallelBroadcasts.size() > 0 || mOrderedBroadcasts.size() > 0
-                || mPendingBroadcast != null) {
-            boolean printed = false;
-            for (int i=mParallelBroadcasts.size()-1; i>=0; i--) {
-                BroadcastRecord br = mParallelBroadcasts.get(i);
-                if (dumpPackage != null && !dumpPackage.equals(br.callerPackage)) {
-                    continue;
-                }
-                if (!printed) {
-                    if (needSep) {
-                        pw.println();
-                    }
-                    needSep = true;
-                    pw.println("  Active broadcasts:");
-                }
-                pw.println("  Broadcast #" + i + ":");
-                br.dump(pw, "    ");
-            }
-            printed = false;
-            for (int i=mOrderedBroadcasts.size()-1; i>=0; i--) {
-                BroadcastRecord br = mOrderedBroadcasts.get(i);
-                if (dumpPackage != null && !dumpPackage.equals(br.callerPackage)) {
-                    continue;
-                }
-                if (!printed) {
-                    if (needSep) {
-                        pw.println();
-                    }
-                    needSep = true;
-                    pw.println("  Active ordered broadcasts:");
-                }
-                pw.println("  Ordered Broadcast #" + i + ":");
-                mOrderedBroadcasts.get(i).dump(pw, "    ");
-            }
-            if (dumpPackage == null || (mPendingBroadcast != null
-                    && dumpPackage.equals(mPendingBroadcast.callerPackage))) {
-                if (needSep) {
-                    pw.println();
-                }
-                pw.println("  Pending broadcast:");
-                if (mPendingBroadcast != null) {
-                    mPendingBroadcast.dump(pw, "    ");
-                } else {
-                    pw.println("    (null)");
-                }
-                needSep = true;
-            }
+
+        for (BroadcastQueue q : mBroadcastQueues) {
+            needSep = q.dumpLocked(fd, pw, args, opti, dumpAll, dumpPackage, needSep);
         }
 
-        boolean printed = false;
-        for (int i=0; i<MAX_BROADCAST_HISTORY; i++) {
-            BroadcastRecord r = mBroadcastHistory[i];
-            if (r == null) {
-                break;
-            }
-            if (dumpPackage != null && !dumpPackage.equals(r.callerPackage)) {
-                continue;
-            }
-            if (!printed) {
-                if (needSep) {
-                    pw.println();
-                }
-                needSep = true;
-                pw.println("  Historical broadcasts:");
-                printed = true;
-            }
-            if (dumpAll) {
-                pw.print("  Historical Broadcast #"); pw.print(i); pw.println(":");
-                r.dump(pw, "    ");
-            } else {
-                if (i >= 50) {
-                    pw.println("  ...");
-                    break;
-                }
-                pw.print("  #"); pw.print(i); pw.print(": "); pw.println(r);
-            }
-        }
         needSep = true;
         
         if (mStickyBroadcasts != null && dumpPackage == null) {
@@ -9084,7 +9851,10 @@
         
         if (dumpAll) {
             pw.println();
-            pw.println("  mBroadcastsScheduled=" + mBroadcastsScheduled);
+            for (BroadcastQueue queue : mBroadcastQueues) {
+                pw.println("  mBroadcastsScheduled [" + queue.mQueueName + "]="
+                        + queue.mBroadcastsScheduled);
+            }
             pw.println("  mHandler:");
             mHandler.dump(new PrintWriterPrinter(pw), "    ");
             needSep = true;
@@ -9104,75 +9874,87 @@
         matcher.build(args, opti);
 
         pw.println("ACTIVITY MANAGER SERVICES (dumpsys activity services)");
-        if (mServices.size() > 0) {
-            boolean printed = false;
-            long nowReal = SystemClock.elapsedRealtime();
-            Iterator<ServiceRecord> it = mServices.values().iterator();
-            needSep = false;
-            while (it.hasNext()) {
-                ServiceRecord r = it.next();
-                if (!matcher.match(r, r.name)) {
-                    continue;
-                }
-                if (dumpPackage != null && !dumpPackage.equals(r.appInfo.packageName)) {
-                    continue;
-                }
-                if (!printed) {
-                    pw.println("  Active services:");
-                    printed = true;
-                }
-                if (needSep) {
-                    pw.println();
-                }
-                pw.print("  * "); pw.println(r);
-                if (dumpAll) {
-                    r.dump(pw, "    ");
-                    needSep = true;
-                } else {
-                    pw.print("    app="); pw.println(r.app);
-                    pw.print("    created=");
-                        TimeUtils.formatDuration(r.createTime, nowReal, pw);
-                        pw.print(" started="); pw.print(r.startRequested);
-                        pw.print(" connections="); pw.println(r.connections.size());
-                    if (r.connections.size() > 0) {
-                        pw.println("    Connections:");
-                        for (ArrayList<ConnectionRecord> clist : r.connections.values()) {
-                            for (int i=0; i<clist.size(); i++) {
-                                ConnectionRecord conn = clist.get(i);
-                                pw.print("      ");
-                                pw.print(conn.binding.intent.intent.getIntent().toShortString(
-                                        false, false, false));
-                                pw.print(" -> ");
-                                ProcessRecord proc = conn.binding.client;
-                                pw.println(proc != null ? proc.toShortString() : "null");
+        try {
+            List<UserInfo> users = AppGlobals.getPackageManager().getUsers();
+            for (UserInfo user : users) {
+                if (mServiceMap.getAllServices(user.id).size() > 0) {
+                    boolean printed = false;
+                    long nowReal = SystemClock.elapsedRealtime();
+                    Iterator<ServiceRecord> it = mServiceMap.getAllServices(
+                            user.id).iterator();
+                    needSep = false;
+                    while (it.hasNext()) {
+                        ServiceRecord r = it.next();
+                        if (!matcher.match(r, r.name)) {
+                            continue;
+                        }
+                        if (dumpPackage != null && !dumpPackage.equals(r.appInfo.packageName)) {
+                            continue;
+                        }
+                        if (!printed) {
+                            pw.println("  Active services:");
+                            printed = true;
+                        }
+                        if (needSep) {
+                            pw.println();
+                        }
+                        pw.print("  * ");
+                        pw.println(r);
+                        if (dumpAll) {
+                            r.dump(pw, "    ");
+                            needSep = true;
+                        } else {
+                            pw.print("    app=");
+                            pw.println(r.app);
+                            pw.print("    created=");
+                            TimeUtils.formatDuration(r.createTime, nowReal, pw);
+                            pw.print(" started=");
+                            pw.print(r.startRequested);
+                            pw.print(" connections=");
+                            pw.println(r.connections.size());
+                            if (r.connections.size() > 0) {
+                                pw.println("    Connections:");
+                                for (ArrayList<ConnectionRecord> clist : r.connections.values()) {
+                                    for (int i = 0; i < clist.size(); i++) {
+                                        ConnectionRecord conn = clist.get(i);
+                                        pw.print("      ");
+                                        pw.print(conn.binding.intent.intent.getIntent()
+                                                .toShortString(false, false, false));
+                                        pw.print(" -> ");
+                                        ProcessRecord proc = conn.binding.client;
+                                        pw.println(proc != null ? proc.toShortString() : "null");
+                                    }
+                                }
                             }
                         }
-                    }
-                }
-                if (dumpClient && r.app != null && r.app.thread != null) {
-                    pw.println("    Client:");
-                    pw.flush();
-                    try {
-                        TransferPipe tp = new TransferPipe();
-                        try {
-                            r.app.thread.dumpService(
-                                    tp.getWriteFd().getFileDescriptor(), r, args);
-                            tp.setBufferPrefix("      ");
-                            // Short timeout, since blocking here can
-                            // deadlock with the application.
-                            tp.go(fd, 2000);
-                        } finally {
-                            tp.kill();
+                        if (dumpClient && r.app != null && r.app.thread != null) {
+                            pw.println("    Client:");
+                            pw.flush();
+                            try {
+                                TransferPipe tp = new TransferPipe();
+                                try {
+                                    r.app.thread.dumpService(tp.getWriteFd().getFileDescriptor(),
+                                            r, args);
+                                    tp.setBufferPrefix("      ");
+                                    // Short timeout, since blocking here can
+                                    // deadlock with the application.
+                                    tp.go(fd, 2000);
+                                } finally {
+                                    tp.kill();
+                                }
+                            } catch (IOException e) {
+                                pw.println("      Failure while dumping the service: " + e);
+                            } catch (RemoteException e) {
+                                pw.println("      Got a RemoteException while dumping the service");
+                            }
+                            needSep = true;
                         }
-                    } catch (IOException e) {
-                        pw.println("      Failure while dumping the service: " + e);
-                    } catch (RemoteException e) {
-                        pw.println("      Got a RemoteException while dumping the service");
                     }
-                    needSep = true;
+                    needSep = printed;
                 }
             }
-            needSep = printed;
+        } catch (RemoteException re) {
+
         }
 
         if (mPendingServices.size() > 0) {
@@ -9282,76 +10064,8 @@
         matcher.build(args, opti);
 
         pw.println("ACTIVITY MANAGER CONTENT PROVIDERS (dumpsys activity providers)");
-        if (mProvidersByClass.size() > 0) {
-            boolean printed = false;
-            Iterator<Map.Entry<ComponentName, ContentProviderRecord>> it
-                    = mProvidersByClass.entrySet().iterator();
-            while (it.hasNext()) {
-                Map.Entry<ComponentName, ContentProviderRecord> e = it.next();
-                ContentProviderRecord r = e.getValue();
-                ComponentName comp = e.getKey();
-                String cls = comp.getClassName();
-                int end = cls.lastIndexOf('.');
-                if (end > 0 && end < (cls.length()-2)) {
-                    cls = cls.substring(end+1);
-                }
-                if (!matcher.match(r, comp)) {
-                    continue;
-                }
-                if (dumpPackage != null && !dumpPackage.equals(comp.getPackageName())) {
-                    continue;
-                }
-                if (!printed) {
-                    if (needSep) pw.println(" ");
-                    needSep = true;
-                    pw.println("  Published content providers (by class):");
-                    printed = true;
-                }
-                pw.print("  * "); pw.print(cls); pw.print(" (");
-                        pw.print(comp.flattenToShortString()); pw.println(")");
-                if (dumpAll) {
-                    r.dump(pw, "      ");
-                } else {
-                    if (r.proc != null) {
-                        pw.print("      "); pw.println(r.proc);
-                    } else {
-                        pw.println();
-                    }
-                    if (r.clients.size() > 0) {
-                        pw.println("      Clients:");
-                        for (ProcessRecord cproc : r.clients) {
-                            pw.print("        - "); pw.println(cproc);
-                        }
-                    }
-                }
-            }
-        }
-    
-        if (dumpAll) {
-            if (mProvidersByName.size() > 0) {
-                boolean printed = false;
-                Iterator<Map.Entry<String, ContentProviderRecord>> it
-                        = mProvidersByName.entrySet().iterator();
-                while (it.hasNext()) {
-                    Map.Entry<String, ContentProviderRecord> e = it.next();
-                    ContentProviderRecord r = e.getValue();
-                    if (!matcher.match(r, r.name)) {
-                        continue;
-                    }
-                    if (dumpPackage != null && !dumpPackage.equals(r.name.getPackageName())) {
-                        continue;
-                    }
-                    if (!printed) {
-                        if (needSep) pw.println(" ");
-                        needSep = true;
-                        pw.println("  Authority to provider mappings:");
-                        printed = true;
-                    }
-                    pw.print("  "); pw.print(e.getKey()); pw.println(":");
-                    pw.print("    "); pw.println(r);
-                }
-            }
-        }
+
+        mProviderMap.dumpProvidersLocked(pw, dumpAll);
 
         if (mLaunchingProviders.size() > 0) {
             boolean printed = false;
@@ -10237,10 +10951,10 @@
             cpr.notifyAll();
         }
         
-        mProvidersByClass.remove(cpr.name);
+        mProviderMap.removeProviderByClass(cpr.name, UserId.getUserId(cpr.uid));
         String names[] = cpr.info.authority.split(";");
         for (int j = 0; j < names.length; j++) {
-            mProvidersByName.remove(names[j]);
+            mProviderMap.removeProviderByName(names[j], UserId.getUserId(cpr.uid));
         }
         
         Iterator<ProcessRecord> cit = cpr.clients.iterator();
@@ -10516,8 +11230,10 @@
             ArrayList<ActivityManager.RunningServiceInfo> res
                     = new ArrayList<ActivityManager.RunningServiceInfo>();
             
-            if (mServices.size() > 0) {
-                Iterator<ServiceRecord> it = mServices.values().iterator();
+            int userId = UserId.getUserId(Binder.getCallingUid());
+            if (mServiceMap.getAllServices(userId).size() > 0) {
+                Iterator<ServiceRecord> it
+                        = mServiceMap.getAllServices(userId).iterator();
                 while (it.hasNext() && res.size() < maxNum) {
                     res.add(makeRunningServiceInfoLocked(it.next()));
                 }
@@ -10537,7 +11253,8 @@
 
     public PendingIntent getRunningServiceControlPanel(ComponentName name) {
         synchronized (this) {
-            ServiceRecord r = mServices.get(name);
+            int userId = UserId.getUserId(Binder.getCallingUid());
+            ServiceRecord r = mServiceMap.getServiceByName(name, userId);
             if (r != null) {
                 for (ArrayList<ConnectionRecord> conn : r.connections.values()) {
                     for (int i=0; i<conn.size(); i++) {
@@ -10553,7 +11270,7 @@
     
     private final ServiceRecord findServiceLocked(ComponentName name,
             IBinder token) {
-        ServiceRecord r = mServices.get(name);
+        ServiceRecord r = mServiceMap.getServiceByName(name, Binder.getOrigCallingUser());
         return r == token ? r : null;
     }
 
@@ -10571,11 +11288,11 @@
             String resolvedType) {
         ServiceRecord r = null;
         if (service.getComponent() != null) {
-            r = mServices.get(service.getComponent());
+            r = mServiceMap.getServiceByName(service.getComponent(), Binder.getOrigCallingUser());
         }
         if (r == null) {
             Intent.FilterComparison filter = new Intent.FilterComparison(service);
-            r = mServicesByIntent.get(filter);
+            r = mServiceMap.getServiceByIntent(filter, Binder.getOrigCallingUser());
         }
 
         if (r == null) {
@@ -10591,7 +11308,7 @@
 
                 ComponentName name = new ComponentName(
                         sInfo.applicationInfo.packageName, sInfo.name);
-                r = mServices.get(name);
+                r = mServiceMap.getServiceByName(name, Binder.getOrigCallingUser());
             } catch (RemoteException ex) {
                 // pm is in same process, this will never happen.
             }
@@ -10638,11 +11355,17 @@
     private ServiceLookupResult retrieveServiceLocked(Intent service,
             String resolvedType, int callingPid, int callingUid) {
         ServiceRecord r = null;
+        if (DEBUG_SERVICE)
+            Slog.v(TAG, "retrieveServiceLocked: " + service + " type=" + resolvedType
+                    + " origCallingUid=" + callingUid);
+
         if (service.getComponent() != null) {
-            r = mServices.get(service.getComponent());
+            r = mServiceMap.getServiceByName(service.getComponent(), Binder.getOrigCallingUser());
         }
-        Intent.FilterComparison filter = new Intent.FilterComparison(service);
-        r = mServicesByIntent.get(filter);
+        if (r == null) {
+            Intent.FilterComparison filter = new Intent.FilterComparison(service);
+            r = mServiceMap.getServiceByIntent(filter, Binder.getOrigCallingUser());
+        }
         if (r == null) {
             try {
                 ResolveInfo rInfo =
@@ -10655,12 +11378,16 @@
                           ": not found");
                     return null;
                 }
-
+                if (Binder.getOrigCallingUser() > 0) {
+                    sInfo.applicationInfo = getAppInfoForUser(sInfo.applicationInfo,
+                            Binder.getOrigCallingUser());
+                }
                 ComponentName name = new ComponentName(
                         sInfo.applicationInfo.packageName, sInfo.name);
-                r = mServices.get(name);
+                r = mServiceMap.getServiceByName(name, Binder.getOrigCallingUser());
                 if (r == null) {
-                    filter = new Intent.FilterComparison(service.cloneFilter());
+                    Intent.FilterComparison filter = new Intent.FilterComparison(
+                            service.cloneFilter());
                     ServiceRestarter res = new ServiceRestarter();
                     BatteryStatsImpl.Uid.Pkg.Serv ss = null;
                     BatteryStatsImpl stats = mBatteryStatsService.getActiveStatistics();
@@ -10671,8 +11398,8 @@
                     }
                     r = new ServiceRecord(this, ss, name, filter, sInfo, res);
                     res.setService(r);
-                    mServices.put(name, r);
-                    mServicesByIntent.put(filter, r);
+                    mServiceMap.putServiceByName(name, UserId.getUserId(r.appInfo.uid), r);
+                    mServiceMap.putServiceByIntent(filter, UserId.getUserId(r.appInfo.uid), r);
                     
                     // Make sure this component isn't in the pending list.
                     int N = mPendingServices.size();
@@ -10819,7 +11546,9 @@
         if (app.thread == null) {
             throw new RemoteException();
         }
-
+        if (DEBUG_MU)
+            Slog.v(TAG_MU, "realStartServiceLocked, ServiceRecord.uid = " + r.appInfo.uid
+                    + ", ProcessRecord.uid = " + app.info.uid);
         r.app = app;
         r.restartTime = r.lastActivity = SystemClock.uptimeMillis();
 
@@ -11016,6 +11745,8 @@
 
         final String appName = r.processName;
         ProcessRecord app = getProcessRecordLocked(appName, r.appInfo.uid);
+        if (DEBUG_MU)
+            Slog.v(TAG_MU, "bringUpServiceLocked: appInfo.uid=" + r.appInfo.uid + " app=" + app);
         if (app != null && app.thread != null) {
             try {
                 app.addPackage(r.appInfo.packageName);
@@ -11120,8 +11851,8 @@
                 System.identityHashCode(r), r.shortName,
                 (r.app != null) ? r.app.pid : -1);
 
-        mServices.remove(r.name);
-        mServicesByIntent.remove(r.intent);
+        mServiceMap.removeServiceByName(r.name, r.userId);
+        mServiceMap.removeServiceByIntent(r.intent, r.userId);
         r.totalRestartCount = 0;
         unscheduleServiceRestartLocked(r);
 
@@ -11235,6 +11966,8 @@
             throw new IllegalArgumentException("File descriptors passed in Intent");
         }
 
+        if (DEBUG_SERVICE)
+            Slog.v(TAG, "startService: " + service + " type=" + resolvedType);
         synchronized(this) {
             final int callingPid = Binder.getCallingPid();
             final int callingUid = Binder.getCallingUid();
@@ -11249,6 +11982,8 @@
     ComponentName startServiceInPackage(int uid,
             Intent service, String resolvedType) {
         synchronized(this) {
+            if (DEBUG_SERVICE)
+                Slog.v(TAG, "startServiceInPackage: " + service + " type=" + resolvedType);
             final long origId = Binder.clearCallingIdentity();
             ComponentName res = startServiceLocked(null, service,
                     resolvedType, -1, uid);
@@ -11452,6 +12187,9 @@
             if (DEBUG_SERVICE) Slog.v(TAG, "bindService: " + service
                     + " type=" + resolvedType + " conn=" + connection.asBinder()
                     + " flags=0x" + Integer.toHexString(flags));
+            if (DEBUG_MU)
+                Slog.i(TAG_MU, "bindService uid=" + Binder.getCallingUid() + " origUid="
+                        + Binder.getOrigCallingUid());
             final ProcessRecord callerApp = getRecordForAppLocked(caller);
             if (callerApp == null) {
                 throw new SecurityException(
@@ -11494,7 +12232,7 @@
             
             ServiceLookupResult res =
                 retrieveServiceLocked(service, resolvedType,
-                        Binder.getCallingPid(), Binder.getCallingUid());
+                        Binder.getCallingPid(), Binder.getOrigCallingUid());
             if (res == null) {
                 return 0;
             }
@@ -11840,7 +12578,9 @@
                         r.callStart = false;
                     }
                 }
-                
+                if (DEBUG_MU)
+                    Slog.v(TAG_MU, "before serviceDontExecutingLocked, uid="
+                            + Binder.getOrigCallingUid());
                 final long origId = Binder.clearCallingIdentity();
                 serviceDoneExecutingLocked(r, inStopping);
                 Binder.restoreCallingIdentity(origId);
@@ -12071,15 +12811,25 @@
         return cur;
     }
 
-    private final void scheduleBroadcastsLocked() {
-        if (DEBUG_BROADCAST) Slog.v(TAG, "Schedule broadcasts: current="
-                + mBroadcastsScheduled);
+    boolean isPendingBroadcastProcessLocked(int pid) {
+        return mFgBroadcastQueue.isPendingBroadcastProcessLocked(pid)
+                || mBgBroadcastQueue.isPendingBroadcastProcessLocked(pid);
+    }
 
-        if (mBroadcastsScheduled) {
-            return;
+    void skipPendingBroadcastLocked(int pid) {
+            Slog.w(TAG, "Unattached app died before broadcast acknowledged, skipping");
+            for (BroadcastQueue queue : mBroadcastQueues) {
+                queue.skipPendingBroadcastLocked(pid);
+            }
+    }
+
+    // The app just attached; send any pending broadcasts that it should receive
+    boolean sendPendingBroadcastsLocked(ProcessRecord app) {
+        boolean didSomething = false;
+        for (BroadcastQueue queue : mBroadcastQueues) {
+            didSomething |= queue.sendPendingBroadcastsLocked(app);
         }
-        mHandler.sendEmptyMessage(BROADCAST_INTENT_MSG);
-        mBroadcastsScheduled = true;
+        return didSomething;
     }
 
     public Intent registerReceiver(IApplicationThread caller, String callerPackage,
@@ -12161,13 +12911,12 @@
                 int N = allSticky.size();
                 for (int i=0; i<N; i++) {
                     Intent intent = (Intent)allSticky.get(i);
-                    BroadcastRecord r = new BroadcastRecord(intent, null,
+                    BroadcastQueue queue = broadcastQueueForIntent(intent);
+                    BroadcastRecord r = new BroadcastRecord(queue, intent, null,
                             null, -1, -1, null, receivers, null, 0, null, null,
                             false, true, true);
-                    if (mParallelBroadcasts.size() == 0) {
-                        scheduleBroadcastsLocked();
-                    }
-                    mParallelBroadcasts.add(r);
+                    queue.enqueueParallelBroadcastLocked(r);
+                    queue.scheduleBroadcastsLocked();
                 }
             }
 
@@ -12178,38 +12927,46 @@
     public void unregisterReceiver(IIntentReceiver receiver) {
         if (DEBUG_BROADCAST) Slog.v(TAG, "Unregister receiver: " + receiver);
 
-        boolean doNext = false;
+        final long origId = Binder.clearCallingIdentity();
+        try {
+            boolean doTrim = false;
 
-        synchronized(this) {
-            ReceiverList rl
+            synchronized(this) {
+                ReceiverList rl
                 = (ReceiverList)mRegisteredReceivers.get(receiver.asBinder());
-            if (rl != null) {
-                if (rl.curBroadcast != null) {
-                    BroadcastRecord r = rl.curBroadcast;
-                    doNext = finishReceiverLocked(
-                        receiver.asBinder(), r.resultCode, r.resultData,
-                        r.resultExtras, r.resultAbort, true);
-                }
+                if (rl != null) {
+                    if (rl.curBroadcast != null) {
+                        BroadcastRecord r = rl.curBroadcast;
+                        final boolean doNext = finishReceiverLocked(
+                                receiver.asBinder(), r.resultCode, r.resultData,
+                                r.resultExtras, r.resultAbort, true);
+                        if (doNext) {
+                            doTrim = true;
+                            r.queue.processNextBroadcast(false);
+                        }
+                    }
 
-                if (rl.app != null) {
-                    rl.app.receivers.remove(rl);
-                }
-                removeReceiverLocked(rl);
-                if (rl.linkedToDeath) {
-                    rl.linkedToDeath = false;
-                    rl.receiver.asBinder().unlinkToDeath(rl, 0);
+                    if (rl.app != null) {
+                        rl.app.receivers.remove(rl);
+                    }
+                    removeReceiverLocked(rl);
+                    if (rl.linkedToDeath) {
+                        rl.linkedToDeath = false;
+                        rl.receiver.asBinder().unlinkToDeath(rl, 0);
+                    }
                 }
             }
-        }
 
-        if (!doNext) {
-            return;
+            // If we actually concluded any broadcasts, we might now be able
+            // to trim the recipients' apps from our working set
+            if (doTrim) {
+                trimApplications();
+                return;
+            }
+
+        } finally {
+            Binder.restoreCallingIdentity(origId);
         }
-        
-        final long origId = Binder.clearCallingIdentity();
-        processNextBroadcast(false);
-        trimApplications();
-        Binder.restoreCallingIdentity(origId);
     }
 
     void removeReceiverLocked(ReceiverList rl) {
@@ -12236,7 +12993,8 @@
             String callerPackage, Intent intent, String resolvedType,
             IIntentReceiver resultTo, int resultCode, String resultData,
             Bundle map, String requiredPermission,
-            boolean ordered, boolean sticky, int callingPid, int callingUid) {
+            boolean ordered, boolean sticky, int callingPid, int callingUid,
+            int userId) {
         intent = new Intent(intent);
 
         // By default broadcasts do not go to stopped apps.
@@ -12411,10 +13169,11 @@
                 if (ai != null) {
                     receivers = new ArrayList();
                     ResolveInfo ri = new ResolveInfo();
-                    ri.activityInfo = ai;
+                    ri.activityInfo = getActivityInfoForUser(ai, userId);
                     receivers.add(ri);
                 }
             } else {
+                // TODO: Apply userId
                 // Need to resolve the intent to interested receivers...
                 if ((intent.getFlags()&Intent.FLAG_RECEIVER_REGISTERED_ONLY)
                          == 0) {
@@ -12439,28 +13198,17 @@
             // If we are not serializing this broadcast, then send the
             // registered receivers separately so they don't wait for the
             // components to be launched.
-            BroadcastRecord r = new BroadcastRecord(intent, callerApp,
+            final BroadcastQueue queue = broadcastQueueForIntent(intent);
+            BroadcastRecord r = new BroadcastRecord(queue, intent, callerApp,
                     callerPackage, callingPid, callingUid, requiredPermission,
                     registeredReceivers, resultTo, resultCode, resultData, map,
                     ordered, sticky, false);
             if (DEBUG_BROADCAST) Slog.v(
-                    TAG, "Enqueueing parallel broadcast " + r
-                    + ": prev had " + mParallelBroadcasts.size());
-            boolean replaced = false;
-            if (replacePending) {
-                for (int i=mParallelBroadcasts.size()-1; i>=0; i--) {
-                    if (intent.filterEquals(mParallelBroadcasts.get(i).intent)) {
-                        if (DEBUG_BROADCAST) Slog.v(TAG,
-                                "***** DROPPING PARALLEL: " + intent);
-                        mParallelBroadcasts.set(i, r);
-                        replaced = true;
-                        break;
-                    }
-                }
-            }
+                    TAG, "Enqueueing parallel broadcast " + r);
+            final boolean replaced = replacePending && queue.replaceParallelBroadcastLocked(r);
             if (!replaced) {
-                mParallelBroadcasts.add(r);
-                scheduleBroadcastsLocked();
+                queue.enqueueParallelBroadcastLocked(r);
+                queue.scheduleBroadcastsLocked();
             }
             registeredReceivers = null;
             NR = 0;
@@ -12540,32 +13288,22 @@
 
         if ((receivers != null && receivers.size() > 0)
                 || resultTo != null) {
-            BroadcastRecord r = new BroadcastRecord(intent, callerApp,
+            BroadcastQueue queue = broadcastQueueForIntent(intent);
+            BroadcastRecord r = new BroadcastRecord(queue, intent, callerApp,
                     callerPackage, callingPid, callingUid, requiredPermission,
                     receivers, resultTo, resultCode, resultData, map, ordered,
                     sticky, false);
             if (DEBUG_BROADCAST) Slog.v(
                     TAG, "Enqueueing ordered broadcast " + r
-                    + ": prev had " + mOrderedBroadcasts.size());
+                    + ": prev had " + queue.mOrderedBroadcasts.size());
             if (DEBUG_BROADCAST) {
                 int seq = r.intent.getIntExtra("seq", -1);
                 Slog.i(TAG, "Enqueueing broadcast " + r.intent.getAction() + " seq=" + seq);
             }
-            boolean replaced = false;
-            if (replacePending) {
-                for (int i=mOrderedBroadcasts.size()-1; i>0; i--) {
-                    if (intent.filterEquals(mOrderedBroadcasts.get(i).intent)) {
-                        if (DEBUG_BROADCAST) Slog.v(TAG,
-                                "***** DROPPING ORDERED: " + intent);
-                        mOrderedBroadcasts.set(i, r);
-                        replaced = true;
-                        break;
-                    }
-                }
-            }
+            boolean replaced = replacePending && queue.replaceOrderedBroadcastLocked(r); 
             if (!replaced) {
-                mOrderedBroadcasts.add(r);
-                scheduleBroadcastsLocked();
+                queue.enqueueOrderedBroadcastLocked(r);
+                queue.scheduleBroadcastsLocked();
             }
         }
 
@@ -12604,7 +13342,7 @@
     public final int broadcastIntent(IApplicationThread caller,
             Intent intent, String resolvedType, IIntentReceiver resultTo,
             int resultCode, String resultData, Bundle map,
-            String requiredPermission, boolean serialized, boolean sticky) {
+            String requiredPermission, boolean serialized, boolean sticky, int userId) {
         synchronized(this) {
             intent = verifyBroadcastLocked(intent);
             
@@ -12615,8 +13353,8 @@
             int res = broadcastIntentLocked(callerApp,
                     callerApp != null ? callerApp.info.packageName : null,
                     intent, resolvedType, resultTo,
-                    resultCode, resultData, map, requiredPermission, serialized,
-                    sticky, callingPid, callingUid);
+                    resultCode, resultData, map, requiredPermission, serialized, sticky,
+                    callingPid, callingUid, userId);
             Binder.restoreCallingIdentity(origId);
             return res;
         }
@@ -12625,21 +13363,21 @@
     int broadcastIntentInPackage(String packageName, int uid,
             Intent intent, String resolvedType, IIntentReceiver resultTo,
             int resultCode, String resultData, Bundle map,
-            String requiredPermission, boolean serialized, boolean sticky) {
+            String requiredPermission, boolean serialized, boolean sticky, int userId) {
         synchronized(this) {
             intent = verifyBroadcastLocked(intent);
 
             final long origId = Binder.clearCallingIdentity();
             int res = broadcastIntentLocked(null, packageName, intent, resolvedType,
                     resultTo, resultCode, resultData, map, requiredPermission,
-                    serialized, sticky, -1, uid);
+                    serialized, sticky, -1, uid, userId);
             Binder.restoreCallingIdentity(origId);
             return res;
         }
     }
 
-    public final void unbroadcastIntent(IApplicationThread caller,
-            Intent intent) {
+    // TODO: Use the userId; maybe mStickyBroadcasts need to be tied to the user.
+    public final void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId) {
         // Refuse possible leaked file descriptors
         if (intent != null && intent.hasFileDescriptors() == true) {
             throw new IllegalArgumentException("File descriptors passed in Intent");
@@ -12672,54 +13410,14 @@
     private final boolean finishReceiverLocked(IBinder receiver, int resultCode,
             String resultData, Bundle resultExtras, boolean resultAbort,
             boolean explicit) {
-        if (mOrderedBroadcasts.size() == 0) {
-            if (explicit) {
-                Slog.w(TAG, "finishReceiver called but no pending broadcasts");
-            }
+        final BroadcastRecord r = broadcastRecordForReceiverLocked(receiver);
+        if (r == null) {
+            Slog.w(TAG, "finishReceiver called but not found on queue");
             return false;
         }
-        BroadcastRecord r = mOrderedBroadcasts.get(0);
-        if (r.receiver == null) {
-            if (explicit) {
-                Slog.w(TAG, "finishReceiver called but none active");
-            }
-            return false;
-        }
-        if (r.receiver != receiver) {
-            Slog.w(TAG, "finishReceiver called but active receiver is different");
-            return false;
-        }
-        int state = r.state;
-        r.state = BroadcastRecord.IDLE;
-        if (state == BroadcastRecord.IDLE) {
-            if (explicit) {
-                Slog.w(TAG, "finishReceiver called but state is IDLE");
-            }
-        }
-        r.receiver = null;
-        r.intent.setComponent(null);
-        if (r.curApp != null) {
-            r.curApp.curReceiver = null;
-        }
-        if (r.curFilter != null) {
-            r.curFilter.receiverList.curBroadcast = null;
-        }
-        r.curFilter = null;
-        r.curApp = null;
-        r.curComponent = null;
-        r.curReceiver = null;
-        mPendingBroadcast = null;
 
-        r.resultCode = resultCode;
-        r.resultData = resultData;
-        r.resultExtras = resultExtras;
-        r.resultAbort = resultAbort;
-
-        // We will process the next receiver right now if this is finishing
-        // an app receiver (which is always asynchronous) or after we have
-        // come back from calling a receiver.
-        return state == BroadcastRecord.APP_RECEIVE
-                || state == BroadcastRecord.CALL_DONE_RECEIVE;
+        return r.queue.finishReceiverLocked(r, resultCode, resultData, resultExtras, resultAbort,
+                explicit);
     }
 
     public void finishReceiver(IBinder who, int resultCode, String resultData,
@@ -12731,153 +13429,25 @@
             throw new IllegalArgumentException("File descriptors passed in Bundle");
         }
 
-        boolean doNext;
-
         final long origId = Binder.clearCallingIdentity();
+        try {
+            boolean doNext = false;
+            BroadcastRecord r = null;
 
-        synchronized(this) {
-            doNext = finishReceiverLocked(
-                who, resultCode, resultData, resultExtras, resultAbort, true);
-        }
-
-        if (doNext) {
-            processNextBroadcast(false);
-        }
-        trimApplications();
-
-        Binder.restoreCallingIdentity(origId);
-    }
-
-    private final void logBroadcastReceiverDiscardLocked(BroadcastRecord r) {
-        if (r.nextReceiver > 0) {
-            Object curReceiver = r.receivers.get(r.nextReceiver-1);
-            if (curReceiver instanceof BroadcastFilter) {
-                BroadcastFilter bf = (BroadcastFilter) curReceiver;
-                EventLog.writeEvent(EventLogTags.AM_BROADCAST_DISCARD_FILTER,
-                        System.identityHashCode(r),
-                        r.intent.getAction(),
-                        r.nextReceiver - 1,
-                        System.identityHashCode(bf));
-            } else {
-                EventLog.writeEvent(EventLogTags.AM_BROADCAST_DISCARD_APP,
-                        System.identityHashCode(r),
-                        r.intent.getAction(),
-                        r.nextReceiver - 1,
-                        ((ResolveInfo)curReceiver).toString());
-            }
-        } else {
-            Slog.w(TAG, "Discarding broadcast before first receiver is invoked: "
-                    + r);
-            EventLog.writeEvent(EventLogTags.AM_BROADCAST_DISCARD_APP,
-                    System.identityHashCode(r),
-                    r.intent.getAction(),
-                    r.nextReceiver,
-                    "NONE");
-        }
-    }
-
-    private final void setBroadcastTimeoutLocked(long timeoutTime) {
-        if (! mPendingBroadcastTimeoutMessage) {
-            Message msg = mHandler.obtainMessage(BROADCAST_TIMEOUT_MSG);
-            mHandler.sendMessageAtTime(msg, timeoutTime);
-            mPendingBroadcastTimeoutMessage = true;
-        }
-    }
-
-    private final void cancelBroadcastTimeoutLocked() {
-        if (mPendingBroadcastTimeoutMessage) {
-            mHandler.removeMessages(BROADCAST_TIMEOUT_MSG);
-            mPendingBroadcastTimeoutMessage = false;
-        }
-    }
-
-    private final void broadcastTimeoutLocked(boolean fromMsg) {
-        if (fromMsg) {
-            mPendingBroadcastTimeoutMessage = false;
-        }
-
-        if (mOrderedBroadcasts.size() == 0) {
-            return;
-        }
-
-        long now = SystemClock.uptimeMillis();
-        BroadcastRecord r = mOrderedBroadcasts.get(0);
-        if (fromMsg) {
-            if (mDidDexOpt) {
-                // Delay timeouts until dexopt finishes.
-                mDidDexOpt = false;
-                long timeoutTime = SystemClock.uptimeMillis() + BROADCAST_TIMEOUT;
-                setBroadcastTimeoutLocked(timeoutTime);
-                return;
-            }
-            if (! mProcessesReady) {
-                // Only process broadcast timeouts if the system is ready. That way
-                // PRE_BOOT_COMPLETED broadcasts can't timeout as they are intended
-                // to do heavy lifting for system up.
-                return;
-            }
-
-            long timeoutTime = r.receiverTime + BROADCAST_TIMEOUT;
-            if (timeoutTime > now) {
-                // We can observe premature timeouts because we do not cancel and reset the
-                // broadcast timeout message after each receiver finishes.  Instead, we set up
-                // an initial timeout then kick it down the road a little further as needed
-                // when it expires.
-                if (DEBUG_BROADCAST) Slog.v(TAG,
-                        "Premature timeout @ " + now + ": resetting BROADCAST_TIMEOUT_MSG for "
-                        + timeoutTime);
-                setBroadcastTimeoutLocked(timeoutTime);
-                return;
-            }
-        }
-
-        Slog.w(TAG, "Timeout of broadcast " + r + " - receiver=" + r.receiver
-                + ", started " + (now - r.receiverTime) + "ms ago");
-        r.receiverTime = now;
-        r.anrCount++;
-
-        // Current receiver has passed its expiration date.
-        if (r.nextReceiver <= 0) {
-            Slog.w(TAG, "Timeout on receiver with nextReceiver <= 0");
-            return;
-        }
-
-        ProcessRecord app = null;
-        String anrMessage = null;
-
-        Object curReceiver = r.receivers.get(r.nextReceiver-1);
-        Slog.w(TAG, "Receiver during timeout: " + curReceiver);
-        logBroadcastReceiverDiscardLocked(r);
-        if (curReceiver instanceof BroadcastFilter) {
-            BroadcastFilter bf = (BroadcastFilter)curReceiver;
-            if (bf.receiverList.pid != 0
-                    && bf.receiverList.pid != MY_PID) {
-                synchronized (this.mPidsSelfLocked) {
-                    app = this.mPidsSelfLocked.get(
-                            bf.receiverList.pid);
+            synchronized(this) {
+                r = broadcastRecordForReceiverLocked(who);
+                if (r != null) {
+                    doNext = r.queue.finishReceiverLocked(r, resultCode,
+                        resultData, resultExtras, resultAbort, true);
                 }
             }
-        } else {
-            app = r.curApp;
-        }
-        
-        if (app != null) {
-            anrMessage = "Broadcast of " + r.intent.toString();
-        }
 
-        if (mPendingBroadcast == r) {
-            mPendingBroadcast = null;
-        }
-
-        // Move on to the next receiver.
-        finishReceiverLocked(r.receiver, r.resultCode, r.resultData,
-                r.resultExtras, r.resultAbort, true);
-        scheduleBroadcastsLocked();
-
-        if (anrMessage != null) {
-            // Post the ANR to the handler since we do not want to process ANRs while
-            // potentially holding our lock.
-            mHandler.post(new AppNotResponding(app, anrMessage));
+            if (doNext) {
+                r.queue.processNextBroadcast(false);
+            }
+            trimApplications();
+        } finally {
+            Binder.restoreCallingIdentity(origId);
         }
     }
 
@@ -13012,334 +13582,6 @@
         }
     }
 
-    private final void addBroadcastToHistoryLocked(BroadcastRecord r) {
-        if (r.callingUid < 0) {
-            // This was from a registerReceiver() call; ignore it.
-            return;
-        }
-        System.arraycopy(mBroadcastHistory, 0, mBroadcastHistory, 1,
-                MAX_BROADCAST_HISTORY-1);
-        r.finishTime = SystemClock.uptimeMillis();
-        mBroadcastHistory[0] = r;
-    }
-    
-    private final void processNextBroadcast(boolean fromMsg) {
-        synchronized(this) {
-            BroadcastRecord r;
-
-            if (DEBUG_BROADCAST) Slog.v(TAG, "processNextBroadcast: "
-                    + mParallelBroadcasts.size() + " broadcasts, "
-                    + mOrderedBroadcasts.size() + " ordered broadcasts");
-
-            updateCpuStats();
-            
-            if (fromMsg) {
-                mBroadcastsScheduled = false;
-            }
-
-            // First, deliver any non-serialized broadcasts right away.
-            while (mParallelBroadcasts.size() > 0) {
-                r = mParallelBroadcasts.remove(0);
-                r.dispatchTime = SystemClock.uptimeMillis();
-                r.dispatchClockTime = System.currentTimeMillis();
-                final int N = r.receivers.size();
-                if (DEBUG_BROADCAST_LIGHT) Slog.v(TAG, "Processing parallel broadcast "
-                        + r);
-                for (int i=0; i<N; i++) {
-                    Object target = r.receivers.get(i);
-                    if (DEBUG_BROADCAST)  Slog.v(TAG,
-                            "Delivering non-ordered to registered "
-                            + target + ": " + r);
-                    deliverToRegisteredReceiverLocked(r, (BroadcastFilter)target, false);
-                }
-                addBroadcastToHistoryLocked(r);
-                if (DEBUG_BROADCAST_LIGHT) Slog.v(TAG, "Done with parallel broadcast "
-                        + r);
-            }
-
-            // Now take care of the next serialized one...
-
-            // If we are waiting for a process to come up to handle the next
-            // broadcast, then do nothing at this point.  Just in case, we
-            // check that the process we're waiting for still exists.
-            if (mPendingBroadcast != null) {
-                if (DEBUG_BROADCAST_LIGHT) {
-                    Slog.v(TAG, "processNextBroadcast: waiting for "
-                            + mPendingBroadcast.curApp);
-                }
-
-                boolean isDead;
-                synchronized (mPidsSelfLocked) {
-                    isDead = (mPidsSelfLocked.get(mPendingBroadcast.curApp.pid) == null);
-                }
-                if (!isDead) {
-                    // It's still alive, so keep waiting
-                    return;
-                } else {
-                    Slog.w(TAG, "pending app " + mPendingBroadcast.curApp
-                            + " died before responding to broadcast");
-                    mPendingBroadcast.state = BroadcastRecord.IDLE;
-                    mPendingBroadcast.nextReceiver = mPendingBroadcastRecvIndex;
-                    mPendingBroadcast = null;
-                }
-            }
-
-            boolean looped = false;
-            
-            do {
-                if (mOrderedBroadcasts.size() == 0) {
-                    // No more broadcasts pending, so all done!
-                    scheduleAppGcsLocked();
-                    if (looped) {
-                        // If we had finished the last ordered broadcast, then
-                        // make sure all processes have correct oom and sched
-                        // adjustments.
-                        updateOomAdjLocked();
-                    }
-                    return;
-                }
-                r = mOrderedBroadcasts.get(0);
-                boolean forceReceive = false;
-
-                // Ensure that even if something goes awry with the timeout
-                // detection, we catch "hung" broadcasts here, discard them,
-                // and continue to make progress.
-                //
-                // This is only done if the system is ready so that PRE_BOOT_COMPLETED
-                // receivers don't get executed with timeouts. They're intended for
-                // one time heavy lifting after system upgrades and can take
-                // significant amounts of time.
-                int numReceivers = (r.receivers != null) ? r.receivers.size() : 0;
-                if (mProcessesReady && r.dispatchTime > 0) {
-                    long now = SystemClock.uptimeMillis();
-                    if ((numReceivers > 0) &&
-                            (now > r.dispatchTime + (2*BROADCAST_TIMEOUT*numReceivers))) {
-                        Slog.w(TAG, "Hung broadcast discarded after timeout failure:"
-                                + " now=" + now
-                                + " dispatchTime=" + r.dispatchTime
-                                + " startTime=" + r.receiverTime
-                                + " intent=" + r.intent
-                                + " numReceivers=" + numReceivers
-                                + " nextReceiver=" + r.nextReceiver
-                                + " state=" + r.state);
-                        broadcastTimeoutLocked(false); // forcibly finish this broadcast
-                        forceReceive = true;
-                        r.state = BroadcastRecord.IDLE;
-                    }
-                }
-
-                if (r.state != BroadcastRecord.IDLE) {
-                    if (DEBUG_BROADCAST) Slog.d(TAG,
-                            "processNextBroadcast() called when not idle (state="
-                            + r.state + ")");
-                    return;
-                }
-
-                if (r.receivers == null || r.nextReceiver >= numReceivers
-                        || r.resultAbort || forceReceive) {
-                    // No more receivers for this broadcast!  Send the final
-                    // result if requested...
-                    if (r.resultTo != null) {
-                        try {
-                            if (DEBUG_BROADCAST) {
-                                int seq = r.intent.getIntExtra("seq", -1);
-                                Slog.i(TAG, "Finishing broadcast " + r.intent.getAction()
-                                        + " seq=" + seq + " app=" + r.callerApp);
-                            }
-                            performReceiveLocked(r.callerApp, r.resultTo,
-                                new Intent(r.intent), r.resultCode,
-                                r.resultData, r.resultExtras, false, false);
-                            // Set this to null so that the reference
-                            // (local and remote) isnt kept in the mBroadcastHistory.
-                            r.resultTo = null;
-                        } catch (RemoteException e) {
-                            Slog.w(TAG, "Failure sending broadcast result of " + r.intent, e);
-                        }
-                    }
-                    
-                    if (DEBUG_BROADCAST) Slog.v(TAG, "Cancelling BROADCAST_TIMEOUT_MSG");
-                    cancelBroadcastTimeoutLocked();
-
-                    if (DEBUG_BROADCAST_LIGHT) Slog.v(TAG, "Finished with ordered broadcast "
-                            + r);
-                    
-                    // ... and on to the next...
-                    addBroadcastToHistoryLocked(r);
-                    mOrderedBroadcasts.remove(0);
-                    r = null;
-                    looped = true;
-                    continue;
-                }
-            } while (r == null);
-
-            // Get the next receiver...
-            int recIdx = r.nextReceiver++;
-
-            // Keep track of when this receiver started, and make sure there
-            // is a timeout message pending to kill it if need be.
-            r.receiverTime = SystemClock.uptimeMillis();
-            if (recIdx == 0) {
-                r.dispatchTime = r.receiverTime;
-                r.dispatchClockTime = System.currentTimeMillis();
-                if (DEBUG_BROADCAST_LIGHT) Slog.v(TAG, "Processing ordered broadcast "
-                        + r);
-            }
-            if (! mPendingBroadcastTimeoutMessage) {
-                long timeoutTime = r.receiverTime + BROADCAST_TIMEOUT;
-                if (DEBUG_BROADCAST) Slog.v(TAG,
-                        "Submitting BROADCAST_TIMEOUT_MSG for " + r + " at " + timeoutTime);
-                setBroadcastTimeoutLocked(timeoutTime);
-            }
-
-            Object nextReceiver = r.receivers.get(recIdx);
-            if (nextReceiver instanceof BroadcastFilter) {
-                // Simple case: this is a registered receiver who gets
-                // a direct call.
-                BroadcastFilter filter = (BroadcastFilter)nextReceiver;
-                if (DEBUG_BROADCAST)  Slog.v(TAG,
-                        "Delivering ordered to registered "
-                        + filter + ": " + r);
-                deliverToRegisteredReceiverLocked(r, filter, r.ordered);
-                if (r.receiver == null || !r.ordered) {
-                    // The receiver has already finished, so schedule to
-                    // process the next one.
-                    if (DEBUG_BROADCAST) Slog.v(TAG, "Quick finishing: ordered="
-                            + r.ordered + " receiver=" + r.receiver);
-                    r.state = BroadcastRecord.IDLE;
-                    scheduleBroadcastsLocked();
-                }
-                return;
-            }
-
-            // Hard case: need to instantiate the receiver, possibly
-            // starting its application process to host it.
-
-            ResolveInfo info =
-                (ResolveInfo)nextReceiver;
-
-            boolean skip = false;
-            int perm = checkComponentPermission(info.activityInfo.permission,
-                    r.callingPid, r.callingUid, info.activityInfo.applicationInfo.uid,
-                    info.activityInfo.exported);
-            if (perm != PackageManager.PERMISSION_GRANTED) {
-                if (!info.activityInfo.exported) {
-                    Slog.w(TAG, "Permission Denial: broadcasting "
-                            + r.intent.toString()
-                            + " from " + r.callerPackage + " (pid=" + r.callingPid
-                            + ", uid=" + r.callingUid + ")"
-                            + " is not exported from uid " + info.activityInfo.applicationInfo.uid
-                            + " due to receiver " + info.activityInfo.packageName
-                            + "/" + info.activityInfo.name);
-                } else {
-                    Slog.w(TAG, "Permission Denial: broadcasting "
-                            + r.intent.toString()
-                            + " from " + r.callerPackage + " (pid=" + r.callingPid
-                            + ", uid=" + r.callingUid + ")"
-                            + " requires " + info.activityInfo.permission
-                            + " due to receiver " + info.activityInfo.packageName
-                            + "/" + info.activityInfo.name);
-                }
-                skip = true;
-            }
-            if (info.activityInfo.applicationInfo.uid != Process.SYSTEM_UID &&
-                r.requiredPermission != null) {
-                try {
-                    perm = AppGlobals.getPackageManager().
-                            checkPermission(r.requiredPermission,
-                                    info.activityInfo.applicationInfo.packageName);
-                } catch (RemoteException e) {
-                    perm = PackageManager.PERMISSION_DENIED;
-                }
-                if (perm != PackageManager.PERMISSION_GRANTED) {
-                    Slog.w(TAG, "Permission Denial: receiving "
-                            + r.intent + " to "
-                            + info.activityInfo.applicationInfo.packageName
-                            + " requires " + r.requiredPermission
-                            + " due to sender " + r.callerPackage
-                            + " (uid " + r.callingUid + ")");
-                    skip = true;
-                }
-            }
-            if (r.curApp != null && r.curApp.crashing) {
-                // If the target process is crashing, just skip it.
-                if (DEBUG_BROADCAST)  Slog.v(TAG,
-                        "Skipping deliver ordered " + r + " to " + r.curApp
-                        + ": process crashing");
-                skip = true;
-            }
-
-            if (skip) {
-                if (DEBUG_BROADCAST)  Slog.v(TAG,
-                        "Skipping delivery of ordered " + r + " for whatever reason");
-                r.receiver = null;
-                r.curFilter = null;
-                r.state = BroadcastRecord.IDLE;
-                scheduleBroadcastsLocked();
-                return;
-            }
-
-            r.state = BroadcastRecord.APP_RECEIVE;
-            String targetProcess = info.activityInfo.processName;
-            r.curComponent = new ComponentName(
-                    info.activityInfo.applicationInfo.packageName,
-                    info.activityInfo.name);
-            r.curReceiver = info.activityInfo;
-
-            // Broadcast is being executed, its package can't be stopped.
-            try {
-                AppGlobals.getPackageManager().setPackageStoppedState(
-                        r.curComponent.getPackageName(), false);
-            } catch (RemoteException e) {
-            } catch (IllegalArgumentException e) {
-                Slog.w(TAG, "Failed trying to unstop package "
-                        + r.curComponent.getPackageName() + ": " + e);
-            }
-
-            // Is this receiver's application already running?
-            ProcessRecord app = getProcessRecordLocked(targetProcess,
-                    info.activityInfo.applicationInfo.uid);
-            if (app != null && app.thread != null) {
-                try {
-                    app.addPackage(info.activityInfo.packageName);
-                    processCurBroadcastLocked(r, app);
-                    return;
-                } catch (RemoteException e) {
-                    Slog.w(TAG, "Exception when sending broadcast to "
-                          + r.curComponent, e);
-                }
-
-                // If a dead object exception was thrown -- fall through to
-                // restart the application.
-            }
-
-            // Not running -- get it started, to be executed when the app comes up.
-            if (DEBUG_BROADCAST)  Slog.v(TAG,
-                    "Need to start app " + targetProcess + " for broadcast " + r);
-            if ((r.curApp=startProcessLocked(targetProcess,
-                    info.activityInfo.applicationInfo, true,
-                    r.intent.getFlags() | Intent.FLAG_FROM_BACKGROUND,
-                    "broadcast", r.curComponent,
-                    (r.intent.getFlags()&Intent.FLAG_RECEIVER_BOOT_UPGRADE) != 0))
-                            == null) {
-                // Ah, this recipient is unavailable.  Finish it if necessary,
-                // and mark the broadcast record as ready for the next.
-                Slog.w(TAG, "Unable to launch app "
-                        + info.activityInfo.applicationInfo.packageName + "/"
-                        + info.activityInfo.applicationInfo.uid + " for broadcast "
-                        + r.intent + ": process is bad");
-                logBroadcastReceiverDiscardLocked(r);
-                finishReceiverLocked(r.receiver, r.resultCode, r.resultData,
-                        r.resultExtras, r.resultAbort, true);
-                scheduleBroadcastsLocked();
-                r.state = BroadcastRecord.IDLE;
-                return;
-            }
-
-            mPendingBroadcast = r;
-            mPendingBroadcastRecvIndex = recIdx;
-        }
-    }
-
     // =========================================================
     // INSTRUMENTATION
     // =========================================================
@@ -13611,12 +13853,12 @@
                 intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY
                         | Intent.FLAG_RECEIVER_REPLACE_PENDING);
                 broadcastIntentLocked(null, null, intent, null, null, 0, null, null,
-                        null, false, false, MY_PID, Process.SYSTEM_UID);
+                        null, false, false, MY_PID, Process.SYSTEM_UID, 0 /* TODO: Verify */);
                 if ((changes&ActivityInfo.CONFIG_LOCALE) != 0) {
                     broadcastIntentLocked(null, null,
                             new Intent(Intent.ACTION_LOCALE_CHANGED),
                             null, null, 0, null, null,
-                            null, false, false, MY_PID, Process.SYSTEM_UID);
+                            null, false, false, MY_PID, Process.SYSTEM_UID, 0 /* TODO: Verify */);
                 }
             }
         }
@@ -13662,6 +13904,28 @@
     // LIFETIME MANAGEMENT
     // =========================================================
 
+    // Returns which broadcast queue the app is the current [or imminent] receiver
+    // on, or 'null' if the app is not an active broadcast recipient.
+    private BroadcastQueue isReceivingBroadcast(ProcessRecord app) {
+        BroadcastRecord r = app.curReceiver;
+        if (r != null) {
+            return r.queue;
+        }
+
+        // It's not the current receiver, but it might be starting up to become one
+        synchronized (this) {
+            for (BroadcastQueue queue : mBroadcastQueues) {
+                r = queue.mPendingBroadcast;
+                if (r != null && r.curApp == app) {
+                    // found it; report which queue it's in
+                    return queue;
+                }
+            }
+        }
+
+        return null;
+    }
+
     private final int computeOomAdjLocked(ProcessRecord app, int hiddenAdj,
             ProcessRecord TOP_APP, boolean recursed, boolean doingAll) {
         if (mAdjSeq == app.adjSeq) {
@@ -13727,6 +13991,7 @@
         // important to least, and assign an appropriate OOM adjustment.
         int adj;
         int schedGroup;
+        BroadcastQueue queue;
         if (app == TOP_APP) {
             // The last app on the list is the foreground app.
             adj = ProcessList.FOREGROUND_APP_ADJ;
@@ -13738,12 +14003,14 @@
             adj = ProcessList.FOREGROUND_APP_ADJ;
             schedGroup = Process.THREAD_GROUP_DEFAULT;
             app.adjType = "instrumentation";
-        } else if (app.curReceiver != null ||
-                (mPendingBroadcast != null && mPendingBroadcast.curApp == app)) {
+        } else if ((queue = isReceivingBroadcast(app)) != null) {
             // An app that is currently receiving a broadcast also
-            // counts as being in the foreground.
+            // counts as being in the foreground for OOM killer purposes.
+            // It's placed in a sched group based on the nature of the
+            // broadcast as reflected by which queue it's active in.
             adj = ProcessList.FOREGROUND_APP_ADJ;
-            schedGroup = Process.THREAD_GROUP_DEFAULT;
+            schedGroup = (queue == mFgBroadcastQueue)
+                    ? Process.THREAD_GROUP_DEFAULT : Process.THREAD_GROUP_BG_NONINTERACTIVE;
             app.adjType = "broadcast";
         } else if (app.executingServices.size() > 0) {
             // An app that is currently executing a service callback also
@@ -14184,8 +14451,13 @@
      * Returns true if things are idle enough to perform GCs.
      */
     private final boolean canGcNowLocked() {
-        return mParallelBroadcasts.size() == 0
-                && mOrderedBroadcasts.size() == 0
+        boolean processingBroadcasts = false;
+        for (BroadcastQueue q : mBroadcastQueues) {
+            if (q.mParallelBroadcasts.size() != 0 || q.mOrderedBroadcasts.size() != 0) {
+                processingBroadcasts = true;
+            }
+        }
+        return !processingBroadcasts
                 && (mSleeping || (mMainStack.mResumedActivity != null &&
                         mMainStack.mResumedActivity.idle));
     }
@@ -14929,8 +15201,158 @@
 
     // Multi-user methods
 
-    public boolean switchUser(int userid) {
-        // TODO
+    private int mCurrentUserId;
+    private SparseIntArray mLoggedInUsers = new SparseIntArray(5);
+
+    public boolean switchUser(int userId) {
+        final int callingUid = Binder.getCallingUid();
+        if (callingUid != 0 && callingUid != Process.myUid()) {
+            Slog.e(TAG, "Trying to switch user from unauthorized app");
+            return false;
+        }
+        if (mCurrentUserId == userId)
+            return true;
+
+        synchronized (this) {
+            // Check if user is already logged in, otherwise check if user exists first before
+            // adding to the list of logged in users.
+            if (mLoggedInUsers.indexOfKey(userId) < 0) {
+                if (!userExists(userId)) {
+                    return false;
+                }
+                mLoggedInUsers.append(userId, userId);
+            }
+
+            mCurrentUserId = userId;
+            boolean haveActivities = mMainStack.switchUser(userId);
+            if (!haveActivities) {
+                startHomeActivityLocked(userId);
+            }
+        }
         return true;
     }
+
+    private boolean userExists(int userId) {
+        try {
+            List<UserInfo> users = AppGlobals.getPackageManager().getUsers();
+            for (UserInfo user : users) {
+                if (user.id == userId) {
+                    return true;
+                }
+            }
+        } catch (RemoteException re) {
+            // Won't happen, in same process
+        }
+
+        return false;
+    }
+
+
+    private int applyUserId(int uid, int userId) {
+        return UserId.getUid(userId, uid);
+    }
+
+    private ApplicationInfo getAppInfoForUser(ApplicationInfo info, int userId) {
+        if (info == null) return null;
+        ApplicationInfo newInfo = new ApplicationInfo(info);
+        newInfo.uid = applyUserId(info.uid, userId);
+        if (newInfo.uid >= Process.FIRST_APPLICATION_UID) {
+            newInfo.dataDir = USER_DATA_DIR + userId + "/"
+                    + info.packageName;
+        }
+        return newInfo;
+    }
+
+    ActivityInfo getActivityInfoForUser(ActivityInfo aInfo, int userId) {
+        if (aInfo == null || aInfo.applicationInfo.uid < Process.FIRST_APPLICATION_UID
+                || userId < 1) {
+            return aInfo;
+        }
+
+        ActivityInfo info = new ActivityInfo(aInfo);
+        info.applicationInfo = getAppInfoForUser(info.applicationInfo, userId);
+        return info;
+    }
+
+    static class ServiceMap {
+
+        private final SparseArray<HashMap<ComponentName, ServiceRecord>> mServicesByNamePerUser
+                = new SparseArray<HashMap<ComponentName, ServiceRecord>>();
+        private final SparseArray<HashMap<Intent.FilterComparison, ServiceRecord>>
+                mServicesByIntentPerUser = new SparseArray<
+                    HashMap<Intent.FilterComparison, ServiceRecord>>();
+
+        ServiceRecord getServiceByName(ComponentName name, int callingUser) {
+            // TODO: Deal with global services
+            if (DEBUG_MU)
+                Slog.v(TAG_MU, "getServiceByName(" + name + "), callingUser = " + callingUser);
+            return getServices(callingUser).get(name);
+        }
+
+        ServiceRecord getServiceByName(ComponentName name) {
+            return getServiceByName(name, -1);
+        }
+
+        ServiceRecord getServiceByIntent(Intent.FilterComparison filter, int callingUser) {
+            // TODO: Deal with global services
+            if (DEBUG_MU)
+                Slog.v(TAG_MU, "getServiceByIntent(" + filter + "), callingUser = " + callingUser);
+            return getServicesByIntent(callingUser).get(filter);
+        }
+
+        ServiceRecord getServiceByIntent(Intent.FilterComparison filter) {
+            return getServiceByIntent(filter, -1);
+        }
+
+        void putServiceByName(ComponentName name, int callingUser, ServiceRecord value) {
+            // TODO: Deal with global services
+            getServices(callingUser).put(name, value);
+        }
+
+        void putServiceByIntent(Intent.FilterComparison filter, int callingUser,
+                ServiceRecord value) {
+            // TODO: Deal with global services
+            getServicesByIntent(callingUser).put(filter, value);
+        }
+
+        void removeServiceByName(ComponentName name, int callingUser) {
+            // TODO: Deal with global services
+            ServiceRecord removed = getServices(callingUser).remove(name);
+            if (DEBUG_MU)
+                Slog.v(TAG, "removeServiceByName user=" + callingUser + " name=" + name
+                        + " removed=" + removed);
+        }
+
+        void removeServiceByIntent(Intent.FilterComparison filter, int callingUser) {
+            // TODO: Deal with global services
+            ServiceRecord removed = getServicesByIntent(callingUser).remove(filter);
+            if (DEBUG_MU)
+                Slog.v(TAG_MU, "removeServiceByIntent user=" + callingUser + " intent=" + filter
+                        + " removed=" + removed);
+        }
+
+        Collection<ServiceRecord> getAllServices(int callingUser) {
+            // TODO: Deal with global services
+            return getServices(callingUser).values();
+        }
+
+        private HashMap<ComponentName, ServiceRecord> getServices(int callingUser) {
+            HashMap map = mServicesByNamePerUser.get(callingUser);
+            if (map == null) {
+                map = new HashMap<ComponentName, ServiceRecord>();
+                mServicesByNamePerUser.put(callingUser, map);
+            }
+            return map;
+        }
+
+        private HashMap<Intent.FilterComparison, ServiceRecord> getServicesByIntent(
+                int callingUser) {
+            HashMap map = mServicesByIntentPerUser.get(callingUser);
+            if (map == null) {
+                map = new HashMap<Intent.FilterComparison, ServiceRecord>();
+                mServicesByIntentPerUser.put(callingUser, map);
+            }
+            return map;
+        }
+    }
 }
diff --git a/services/java/com/android/server/am/ActivityRecord.java b/services/java/com/android/server/am/ActivityRecord.java
index c819114..cdab6c6 100644
--- a/services/java/com/android/server/am/ActivityRecord.java
+++ b/services/java/com/android/server/am/ActivityRecord.java
@@ -25,6 +25,7 @@
 import android.content.pm.ActivityInfo;
 import android.content.pm.ApplicationInfo;
 import android.content.res.CompatibilityInfo;
+import android.content.pm.PackageManager;
 import android.content.res.Configuration;
 import android.graphics.Bitmap;
 import android.os.Build;
@@ -34,6 +35,7 @@
 import android.os.Process;
 import android.os.RemoteException;
 import android.os.SystemClock;
+import android.os.UserId;
 import android.util.EventLog;
 import android.util.Log;
 import android.util.Slog;
@@ -55,6 +57,7 @@
     final IApplicationToken.Stub appToken; // window manager token
     final ActivityInfo info; // all about me
     final int launchedFromUid; // always the uid who started the activity.
+    final int userId;          // Which user is this running for?
     final Intent intent;    // the original intent that generated us
     final ComponentName realActivity;  // the intent component, or target of an alias.
     final String shortComponentName; // the short component name of the intent
@@ -124,6 +127,7 @@
         pw.print(prefix); pw.print("packageName="); pw.print(packageName);
                 pw.print(" processName="); pw.println(processName);
         pw.print(prefix); pw.print("launchedFromUid="); pw.print(launchedFromUid);
+        pw.print(prefix); pw.print("userId="); pw.print(userId);
                 pw.print(" app="); pw.println(app);
         pw.print(prefix); pw.println(intent.toInsecureString());
         pw.print(prefix); pw.print("frontOfTask="); pw.print(frontOfTask);
@@ -281,6 +285,7 @@
         appToken = new Token(this);
         info = aInfo;
         launchedFromUid = _launchedFromUid;
+        userId = UserId.getUserId(aInfo.applicationInfo.uid);
         intent = _intent;
         shortComponentName = _intent.getComponent().flattenToShortString();
         resolvedType = _resolvedType;
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java
index 6c11953..c3ae6a1 100644
--- a/services/java/com/android/server/am/ActivityStack.java
+++ b/services/java/com/android/server/am/ActivityStack.java
@@ -60,6 +60,7 @@
 import android.os.PowerManager;
 import android.os.RemoteException;
 import android.os.SystemClock;
+import android.os.UserId;
 import android.util.EventLog;
 import android.util.Log;
 import android.util.Slog;
@@ -274,6 +275,8 @@
     int mThumbnailWidth = -1;
     int mThumbnailHeight = -1;
 
+    private int mCurrentUser;
+
     static final int SLEEP_TIMEOUT_MSG = 8;
     static final int PAUSE_TIMEOUT_MSG = 9;
     static final int IDLE_TIMEOUT_MSG = 10;
@@ -365,6 +368,7 @@
     }
     
     final ActivityRecord topRunningActivityLocked(ActivityRecord notTop) {
+        // TODO: Don't look for any tasks from other users
         int i = mHistory.size()-1;
         while (i >= 0) {
             ActivityRecord r = mHistory.get(i);
@@ -377,6 +381,7 @@
     }
 
     final ActivityRecord topRunningNonDelayedActivityLocked(ActivityRecord notTop) {
+        // TODO: Don't look for any tasks from other users
         int i = mHistory.size()-1;
         while (i >= 0) {
             ActivityRecord r = mHistory.get(i);
@@ -398,6 +403,7 @@
      * @return Returns the HistoryRecord of the next activity on the stack.
      */
     final ActivityRecord topRunningActivityLocked(IBinder token, int taskId) {
+        // TODO: Don't look for any tasks from other users
         int i = mHistory.size()-1;
         while (i >= 0) {
             ActivityRecord r = mHistory.get(i);
@@ -444,10 +450,11 @@
 
         TaskRecord cp = null;
 
+        final int userId = UserId.getUserId(info.applicationInfo.uid);
         final int N = mHistory.size();
         for (int i=(N-1); i>=0; i--) {
             ActivityRecord r = mHistory.get(i);
-            if (!r.finishing && r.task != cp
+            if (!r.finishing && r.task != cp && r.userId == userId
                     && r.launchMode != ActivityInfo.LAUNCH_SINGLE_INSTANCE) {
                 cp = r.task;
                 //Slog.i(TAG, "Comparing existing cls=" + r.task.intent.getComponent().flattenToShortString()
@@ -487,12 +494,13 @@
         if (info.targetActivity != null) {
             cls = new ComponentName(info.packageName, info.targetActivity);
         }
+        final int userId = UserId.getUserId(info.applicationInfo.uid);
 
         final int N = mHistory.size();
         for (int i=(N-1); i>=0; i--) {
             ActivityRecord r = mHistory.get(i);
             if (!r.finishing) {
-                if (r.intent.getComponent().equals(cls)) {
+                if (r.intent.getComponent().equals(cls) && r.userId == userId) {
                     //Slog.i(TAG, "Found matching class!");
                     //dump();
                     //Slog.i(TAG, "For Intent " + intent + " bringing to top: " + r.intent);
@@ -511,6 +519,43 @@
         mService.mHandler.sendMessage(msg);
     }
 
+    /*
+     * Move the activities around in the stack to bring a user to the foreground.
+     * @return whether there are any activities for the specified user.
+     */
+    final boolean switchUser(int userId) {
+        synchronized (mService) {
+            mCurrentUser = userId;
+
+            // Only one activity? Nothing to do...
+            if (mHistory.size() < 2)
+                return false;
+
+            boolean haveActivities = false;
+            // Check if the top activity is from the new user.
+            ActivityRecord top = mHistory.get(mHistory.size() - 1);
+            if (top.userId == userId) return true;
+            // Otherwise, move the user's activities to the top.
+            int N = mHistory.size();
+            int i = 0;
+            while (i < N) {
+                ActivityRecord r = mHistory.get(i);
+                if (r.userId == userId) {
+                    ActivityRecord moveToTop = mHistory.remove(i);
+                    mHistory.add(moveToTop);
+                    // No need to check the top one now
+                    N--;
+                    haveActivities = true;
+                } else {
+                    i++;
+                }
+            }
+            // Transition from the old top to the new top
+            resumeTopActivityLocked(top);
+            return haveActivities;
+        }
+    }
+
     final boolean realStartActivityLocked(ActivityRecord r,
             ProcessRecord app, boolean andResume, boolean checkConfig)
             throws RemoteException {
@@ -1272,7 +1317,7 @@
             // There are no more activities!  Let's just start up the
             // Launcher...
             if (mMainStack) {
-                return mService.startHomeActivityLocked();
+                return mService.startHomeActivityLocked(0);
             }
         }
 
@@ -1384,6 +1429,7 @@
         // Launching this app's activity, make sure the app is no longer
         // considered stopped.
         try {
+            // TODO: Apply to the correct userId
             AppGlobals.getPackageManager().setPackageStoppedState(
                     next.packageName, false);
         } catch (RemoteException e1) {
@@ -2354,7 +2400,7 @@
                 }
             }
         }
-        
+
         ActivityRecord r = new ActivityRecord(mService, this, callerApp, callingUid,
                 intent, resolvedType, aInfo, mService.mConfiguration,
                 resultRecord, resultWho, requestCode, componentSpecified);
@@ -2420,7 +2466,8 @@
             int grantedMode, boolean onlyIfNeeded, boolean doResume) {
         final Intent intent = r.intent;
         final int callingUid = r.launchedFromUid;
-        
+        final int userId = r.userId;
+
         int launchFlags = intent.getFlags();
         
         // We'll invoke onUserLeaving before onPause only if the launching
@@ -2648,7 +2695,7 @@
             // once.
             ActivityRecord top = topRunningNonDelayedActivityLocked(notTop);
             if (top != null && r.resultTo == null) {
-                if (top.realActivity.equals(r.realActivity)) {
+                if (top.realActivity.equals(r.realActivity) && top.userId == r.userId) {
                     if (top.app != null && top.app.thread != null) {
                         if ((launchFlags&Intent.FLAG_ACTIVITY_SINGLE_TOP) != 0
                             || r.launchMode == ActivityInfo.LAUNCH_SINGLE_TOP
@@ -2821,12 +2868,12 @@
             int grantedMode, IBinder resultTo,
             String resultWho, int requestCode, boolean onlyIfNeeded,
             boolean debug, String profileFile, ParcelFileDescriptor profileFd,
-            boolean autoStopProfiler, WaitResult outResult, Configuration config) {
+            boolean autoStopProfiler,
+            WaitResult outResult, Configuration config, int userId) {
         // Refuse possible leaked file descriptors
         if (intent != null && intent.hasFileDescriptors()) {
             throw new IllegalArgumentException("File descriptors passed in Intent");
         }
-
         boolean componentSpecified = intent.getComponent() != null;
 
         // Don't modify the client's object!
@@ -2835,6 +2882,7 @@
         // Collect information about the target of the Intent.
         ActivityInfo aInfo = resolveActivity(intent, resolvedType, debug,
                 profileFile, profileFd, autoStopProfiler);
+        aInfo = mService.getActivityInfoForUser(aInfo, userId);
 
         synchronized (mService) {
             int callingPid;
@@ -2915,6 +2963,7 @@
                                         PackageManager.MATCH_DEFAULT_ONLY
                                         | ActivityManagerService.STOCK_PM_FLAGS);
                             aInfo = rInfo != null ? rInfo.activityInfo : null;
+                            aInfo = mService.getActivityInfoForUser(aInfo, userId);
                         } catch (RemoteException e) {
                             aInfo = null;
                         }
@@ -2977,7 +3026,8 @@
     }
     
     final int startActivities(IApplicationThread caller, int callingUid,
-            Intent[] intents, String[] resolvedTypes, IBinder resultTo) {
+            Intent[] intents,
+            String[] resolvedTypes, IBinder resultTo, int userId) {
         if (intents == null) {
             throw new NullPointerException("intents is null");
         }
@@ -3022,6 +3072,8 @@
                     // Collect information about the target of the Intent.
                     ActivityInfo aInfo = resolveActivity(intent, resolvedTypes[i], false,
                             null, null, false);
+                    // TODO: New, check if this is correct
+                    aInfo = mService.getActivityInfoForUser(aInfo, userId);
 
                     if (mMainStack && aInfo != null && (aInfo.applicationInfo.flags
                             & ApplicationInfo.FLAG_CANT_SAVE_STATE) != 0) {
diff --git a/services/java/com/android/server/am/BroadcastRecord.java b/services/java/com/android/server/am/BroadcastRecord.java
index bcb0134..6738e4f 100644
--- a/services/java/com/android/server/am/BroadcastRecord.java
+++ b/services/java/com/android/server/am/BroadcastRecord.java
@@ -59,6 +59,7 @@
     IBinder receiver;       // who is currently running, null if none.
     int state;
     int anrCount;           // has this broadcast record hit any ANRs?
+    ActivityManagerService.BroadcastQueue queue;   // the outbound queue handling this broadcast
 
     static final int IDLE = 0;
     static final int APP_RECEIVE = 1;
@@ -161,11 +162,13 @@
         }
     }
 
-    BroadcastRecord(Intent _intent, ProcessRecord _callerApp, String _callerPackage,
+    BroadcastRecord(ActivityManagerService.BroadcastQueue _queue,
+            Intent _intent, ProcessRecord _callerApp, String _callerPackage,
             int _callingPid, int _callingUid, String _requiredPermission,
             List _receivers, IIntentReceiver _resultTo, int _resultCode,
             String _resultData, Bundle _resultExtras, boolean _serialized,
             boolean _sticky, boolean _initialSticky) {
+        queue = _queue;
         intent = _intent;
         callerApp = _callerApp;
         callerPackage = _callerPackage;
diff --git a/services/java/com/android/server/am/PendingIntentRecord.java b/services/java/com/android/server/am/PendingIntentRecord.java
index abd2a1f..3b6a97c 100644
--- a/services/java/com/android/server/am/PendingIntentRecord.java
+++ b/services/java/com/android/server/am/PendingIntentRecord.java
@@ -24,6 +24,7 @@
 import android.os.Binder;
 import android.os.IBinder;
 import android.os.RemoteException;
+import android.os.UserId;
 import android.util.Slog;
 
 import java.io.PrintWriter;
@@ -248,7 +249,8 @@
                             owner.broadcastIntentInPackage(key.packageName, uid,
                                     finalIntent, resolvedType,
                                     finishedReceiver, code, null, null,
-                                    requiredPermission, (finishedReceiver != null), false);
+                                requiredPermission, (finishedReceiver != null), false, UserId
+                                        .getUserId(uid));
                             sendFinish = false;
                         } catch (RuntimeException e) {
                             Slog.w(ActivityManagerService.TAG,
diff --git a/services/java/com/android/server/am/ProviderMap.java b/services/java/com/android/server/am/ProviderMap.java
new file mode 100644
index 0000000..44e7ecc
--- /dev/null
+++ b/services/java/com/android/server/am/ProviderMap.java
@@ -0,0 +1,244 @@
+/*
+ * 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.server.am;
+
+import android.content.ComponentName;
+import android.content.pm.PackageManager;
+import android.os.Binder;
+import android.os.Process;
+import android.os.UserId;
+import android.util.Slog;
+import android.util.SparseArray;
+
+import java.io.PrintWriter;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * Keeps track of content providers by authority (name) and class. It separates the mapping by
+ * user and ones that are not user-specific (system providers).
+ */
+public class ProviderMap {
+
+    private static final String TAG = "ProviderMap";
+
+    private static final boolean DBG = false;
+
+    private final HashMap<String, ContentProviderRecord> mGlobalByName
+            = new HashMap<String, ContentProviderRecord>();
+    private final HashMap<ComponentName, ContentProviderRecord> mGlobalByClass
+            = new HashMap<ComponentName, ContentProviderRecord>();
+
+    private final SparseArray<HashMap<String, ContentProviderRecord>> mProvidersByNamePerUser
+            = new SparseArray<HashMap<String, ContentProviderRecord>>();
+    private final SparseArray<HashMap<ComponentName, ContentProviderRecord>> mProvidersByClassPerUser
+            = new SparseArray<HashMap<ComponentName, ContentProviderRecord>>();
+
+    ContentProviderRecord getProviderByName(String name) {
+        return getProviderByName(name, -1);
+    }
+
+    ContentProviderRecord getProviderByName(String name, int userId) {
+        if (DBG) {
+            Slog.i(TAG, "getProviderByName: " + name + " , callingUid = " + Binder.getCallingUid());
+        }
+        // Try to find it in the global list
+        ContentProviderRecord record = mGlobalByName.get(name);
+        if (record != null) {
+            return record;
+        }
+
+        // Check the current user's list
+        return getProvidersByName(userId).get(name);
+    }
+
+    ContentProviderRecord getProviderByClass(ComponentName name) {
+        return getProviderByClass(name, -1);
+    }
+
+    ContentProviderRecord getProviderByClass(ComponentName name, int userId) {
+        if (DBG) {
+            Slog.i(TAG, "getProviderByClass: " + name + ", callingUid = " + Binder.getCallingUid());
+        }
+        // Try to find it in the global list
+        ContentProviderRecord record = mGlobalByClass.get(name);
+        if (record != null) {
+            return record;
+        }
+
+        // Check the current user's list
+        return getProvidersByClass(userId).get(name);
+    }
+
+    void putProviderByName(String name, ContentProviderRecord record) {
+        if (DBG) {
+            Slog.i(TAG, "putProviderByName: " + name + " , callingUid = " + Binder.getCallingUid()
+                + ", record uid = " + record.appInfo.uid);
+        }
+        if (record.appInfo.uid < Process.FIRST_APPLICATION_UID) {
+            mGlobalByName.put(name, record);
+        } else {
+            final int userId = UserId.getUserId(record.appInfo.uid);
+            getProvidersByName(userId).put(name, record);
+        }
+    }
+
+    void putProviderByClass(ComponentName name, ContentProviderRecord record) {
+        if (DBG) {
+            Slog.i(TAG, "putProviderByClass: " + name + " , callingUid = " + Binder.getCallingUid()
+                + ", record uid = " + record.appInfo.uid);
+        }
+        if (record.appInfo.uid < Process.FIRST_APPLICATION_UID) {
+            mGlobalByClass.put(name, record);
+        } else {
+            final int userId = UserId.getUserId(record.appInfo.uid);
+            getProvidersByClass(userId).put(name, record);
+        }
+    }
+
+    void removeProviderByName(String name, int optionalUserId) {
+        if (mGlobalByName.containsKey(name)) {
+            if (DBG)
+                Slog.i(TAG, "Removing from globalByName name=" + name);
+            mGlobalByName.remove(name);
+        } else {
+            // TODO: Verify this works, i.e., the caller happens to be from the correct user
+            if (DBG)
+                Slog.i(TAG,
+                        "Removing from providersByName name=" + name + " user="
+                        + (optionalUserId == -1 ? Binder.getOrigCallingUser() : optionalUserId));
+            getProvidersByName(optionalUserId).remove(name);
+        }
+    }
+
+    void removeProviderByClass(ComponentName name, int optionalUserId) {
+        if (mGlobalByClass.containsKey(name)) {
+            if (DBG)
+                Slog.i(TAG, "Removing from globalByClass name=" + name);
+            mGlobalByClass.remove(name);
+        } else {
+            if (DBG)
+                Slog.i(TAG,
+                        "Removing from providersByClass name=" + name + " user="
+                        + (optionalUserId == -1 ? Binder.getOrigCallingUser() : optionalUserId));
+            getProvidersByClass(optionalUserId).remove(name);
+        }
+    }
+
+    private HashMap<String, ContentProviderRecord> getProvidersByName(int optionalUserId) {
+        final int userId = optionalUserId >= 0
+                ? optionalUserId : Binder.getOrigCallingUser();
+        final HashMap<String, ContentProviderRecord> map = mProvidersByNamePerUser.get(userId);
+        if (map == null) {
+            HashMap<String, ContentProviderRecord> newMap = new HashMap<String, ContentProviderRecord>();
+            mProvidersByNamePerUser.put(userId, newMap);
+            return newMap;
+        } else {
+            return map;
+        }
+    }
+
+    private HashMap<ComponentName, ContentProviderRecord> getProvidersByClass(int optionalUserId) {
+        final int userId = optionalUserId >= 0
+                ? optionalUserId : Binder.getOrigCallingUser();
+        final HashMap<ComponentName, ContentProviderRecord> map = mProvidersByClassPerUser.get(userId);
+        if (map == null) {
+            HashMap<ComponentName, ContentProviderRecord> newMap = new HashMap<ComponentName, ContentProviderRecord>();
+            mProvidersByClassPerUser.put(userId, newMap);
+            return newMap;
+        } else {
+            return map;
+        }
+    }
+
+    private void dumpProvidersByClassLocked(PrintWriter pw, boolean dumpAll,
+            HashMap<ComponentName, ContentProviderRecord> map) {
+        Iterator<Map.Entry<ComponentName, ContentProviderRecord>> it = map.entrySet().iterator();
+        while (it.hasNext()) {
+            Map.Entry<ComponentName, ContentProviderRecord> e = it.next();
+            ContentProviderRecord r = e.getValue();
+            if (dumpAll) {
+                pw.print("  * ");
+                pw.println(r);
+                r.dump(pw, "    ");
+            } else {
+                pw.print("  * ");
+                pw.print(r.name.toShortString());
+                /*
+                if (r.app != null) {
+                    pw.println(":");
+                    pw.print("      ");
+                    pw.println(r.app);
+                } else {
+                    pw.println();
+                }
+                */
+            }
+        }
+    }
+
+    private void dumpProvidersByNameLocked(PrintWriter pw,
+            HashMap<String, ContentProviderRecord> map) {
+        Iterator<Map.Entry<String, ContentProviderRecord>> it = map.entrySet().iterator();
+        while (it.hasNext()) {
+            Map.Entry<String, ContentProviderRecord> e = it.next();
+            ContentProviderRecord r = e.getValue();
+            pw.print("  ");
+            pw.print(e.getKey());
+            pw.print(": ");
+            pw.println(r);
+        }
+    }
+
+    void dumpProvidersLocked(PrintWriter pw, boolean dumpAll) {
+        boolean needSep = false;
+        if (mGlobalByClass.size() > 0) {
+            if (needSep)
+                pw.println(" ");
+            pw.println("  Published content providers (by class):");
+            dumpProvidersByClassLocked(pw, dumpAll, mGlobalByClass);
+            pw.println(" ");
+        }
+
+        if (mProvidersByClassPerUser.size() > 1) {
+            for (int i = 0; i < mProvidersByClassPerUser.size(); i++) {
+                HashMap<ComponentName, ContentProviderRecord> map = mProvidersByClassPerUser.valueAt(i);
+                pw.println("  User " + mProvidersByClassPerUser.keyAt(i) + ":");
+                dumpProvidersByClassLocked(pw, dumpAll, map);
+                pw.println(" ");
+            }
+        } else if (mProvidersByClassPerUser.size() == 1) {
+            HashMap<ComponentName, ContentProviderRecord> map = mProvidersByClassPerUser.valueAt(0);
+            dumpProvidersByClassLocked(pw, dumpAll, map);
+        }
+        needSep = true;
+
+        if (dumpAll) {
+            pw.println(" ");
+            pw.println("  Authority to provider mappings:");
+            dumpProvidersByNameLocked(pw, mGlobalByName);
+
+            for (int i = 0; i < mProvidersByNamePerUser.size(); i++) {
+                if (i > 0) {
+                    pw.println("  User " + mProvidersByNamePerUser.keyAt(i) + ":");
+                }
+                dumpProvidersByNameLocked(pw, mProvidersByNamePerUser.valueAt(i));
+            }
+        }
+    }
+}
diff --git a/services/java/com/android/server/am/ServiceRecord.java b/services/java/com/android/server/am/ServiceRecord.java
index 257113b..75ba947 100644
--- a/services/java/com/android/server/am/ServiceRecord.java
+++ b/services/java/com/android/server/am/ServiceRecord.java
@@ -25,11 +25,13 @@
 import android.content.ComponentName;
 import android.content.Intent;
 import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManager;
 import android.content.pm.ServiceInfo;
 import android.os.Binder;
 import android.os.IBinder;
 import android.os.RemoteException;
 import android.os.SystemClock;
+import android.os.UserId;
 import android.util.Slog;
 import android.util.TimeUtils;
 
@@ -60,6 +62,7 @@
                             // all information about the service.
     final ApplicationInfo appInfo;
                             // information about service's app.
+    final int userId;       // user that this service is running as
     final String packageName; // the package implementing intent's component
     final String processName; // process where this component wants to run
     final String permission;// permission needed to access service
@@ -289,6 +292,7 @@
         this.restarter = restarter;
         createTime = SystemClock.elapsedRealtime();
         lastActivity = SystemClock.uptimeMillis();
+        userId = UserId.getUserId(appInfo.uid);
     }
 
     public AppBindRecord retrieveAppBindingLocked(Intent intent,
diff --git a/services/java/com/android/server/am/TaskRecord.java b/services/java/com/android/server/am/TaskRecord.java
index de3129b..47ec218 100644
--- a/services/java/com/android/server/am/TaskRecord.java
+++ b/services/java/com/android/server/am/TaskRecord.java
@@ -19,7 +19,9 @@
 import android.content.ComponentName;
 import android.content.Intent;
 import android.content.pm.ActivityInfo;
+import android.content.pm.PackageManager;
 import android.graphics.Bitmap;
+import android.os.UserId;
 
 import java.io.PrintWriter;
 
@@ -37,6 +39,7 @@
     boolean askedCompatMode;// Have asked the user about compat mode for this task.
 
     String stringName;      // caching of toString() result.
+    int userId; // user for which this task was created
     
     TaskRecord(int _taskId, ActivityInfo info, Intent _intent) {
         taskId = _taskId;
@@ -84,13 +87,17 @@
                 origActivity = new ComponentName(info.packageName, info.name);
             }
         }
-        
+
         if (intent != null &&
                 (intent.getFlags()&Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED) != 0) {
             // Once we are set to an Intent with this flag, we count this
             // task as having a true root activity.
             rootWasReset = true;
         }
+
+        if (info.applicationInfo != null) {
+            userId = UserId.getUserId(info.applicationInfo.uid);
+        }
     }
     
     void dump(PrintWriter pw, String prefix) {
@@ -154,6 +161,8 @@
         } else {
             sb.append(" ??");
         }
+        sb.append(" U ");
+        sb.append(userId);
         sb.append('}');
         return stringName = sb.toString();
     }
diff --git a/services/java/com/android/server/connectivity/Vpn.java b/services/java/com/android/server/connectivity/Vpn.java
index efa05ba..c4f9ce1 100644
--- a/services/java/com/android/server/connectivity/Vpn.java
+++ b/services/java/com/android/server/connectivity/Vpn.java
@@ -322,7 +322,7 @@
                     .setContentTitle(title)
                     .setContentText(text)
                     .setContentIntent(VpnConfig.getIntentForStatusPanel(mContext, config))
-                    .setDefaults(Notification.DEFAULT_ALL)
+                    .setDefaults(0)
                     .setOngoing(true)
                     .getNotification();
             nm.notify(R.drawable.vpn_connected, notification);
diff --git a/services/java/com/android/server/net/NetworkPolicyManagerService.java b/services/java/com/android/server/net/NetworkPolicyManagerService.java
index 51adebe..a890068 100644
--- a/services/java/com/android/server/net/NetworkPolicyManagerService.java
+++ b/services/java/com/android/server/net/NetworkPolicyManagerService.java
@@ -48,6 +48,7 @@
 import static android.net.NetworkTemplate.MATCH_MOBILE_ALL;
 import static android.net.NetworkTemplate.MATCH_WIFI;
 import static android.net.NetworkTemplate.buildTemplateMobileAll;
+import static android.net.TrafficStats.MB_IN_BYTES;
 import static android.text.format.DateUtils.DAY_IN_MILLIS;
 import static com.android.internal.util.Preconditions.checkNotNull;
 import static com.android.server.NetworkManagementService.LIMIT_GLOBAL_ALERT;
@@ -154,10 +155,7 @@
     private static final int VERSION_ADDED_SNOOZE = 2;
     private static final int VERSION_ADDED_RESTRICT_BACKGROUND = 3;
     private static final int VERSION_ADDED_METERED = 4;
-
-    private static final long KB_IN_BYTES = 1024;
-    private static final long MB_IN_BYTES = KB_IN_BYTES * 1024;
-    private static final long GB_IN_BYTES = MB_IN_BYTES * 1024;
+    private static final int VERSION_SPLIT_SNOOZE = 5;
 
     // @VisibleForTesting
     public static final int TYPE_WARNING = 0x1;
@@ -176,6 +174,8 @@
     private static final String ATTR_WARNING_BYTES = "warningBytes";
     private static final String ATTR_LIMIT_BYTES = "limitBytes";
     private static final String ATTR_LAST_SNOOZE = "lastSnooze";
+    private static final String ATTR_LAST_WARNING_SNOOZE = "lastWarningSnooze";
+    private static final String ATTR_LAST_LIMIT_SNOOZE = "lastLimitSnooze";
     private static final String ATTR_METERED = "metered";
     private static final String ATTR_UID = "uid";
     private static final String ATTR_POLICY = "policy";
@@ -184,7 +184,9 @@
 
     // @VisibleForTesting
     public static final String ACTION_ALLOW_BACKGROUND =
-            "com.android.server.action.ACTION_ALLOW_BACKGROUND";
+            "com.android.server.net.action.ALLOW_BACKGROUND";
+    public static final String ACTION_SNOOZE_WARNING =
+            "com.android.server.net.action.SNOOZE_WARNING";
 
     private static final long TIME_CACHE_MAX_AGE = DAY_IN_MILLIS;
 
@@ -193,6 +195,7 @@
     private static final int MSG_FOREGROUND_ACTIVITIES_CHANGED = 3;
     private static final int MSG_PROCESS_DIED = 4;
     private static final int MSG_LIMIT_REACHED = 5;
+    private static final int MSG_RESTRICT_BACKGROUND_CHANGED = 6;
 
     private final Context mContext;
     private final IActivityManager mActivityManager;
@@ -333,6 +336,11 @@
         final IntentFilter allowFilter = new IntentFilter(ACTION_ALLOW_BACKGROUND);
         mContext.registerReceiver(mAllowReceiver, allowFilter, MANAGE_NETWORK_POLICY, mHandler);
 
+        // listen for snooze warning from notifications
+        final IntentFilter snoozeWarningFilter = new IntentFilter(ACTION_SNOOZE_WARNING);
+        mContext.registerReceiver(mSnoozeWarningReceiver, snoozeWarningFilter,
+                MANAGE_NETWORK_POLICY, mHandler);
+
     }
 
     private IProcessObserver mProcessObserver = new IProcessObserver.Stub() {
@@ -418,6 +426,21 @@
     };
 
     /**
+     * Receiver that watches for {@link Notification} control of
+     * {@link NetworkPolicy#lastWarningSnooze}.
+     */
+    private BroadcastReceiver mSnoozeWarningReceiver = new BroadcastReceiver() {
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            // on background handler thread, and verified MANAGE_NETWORK_POLICY
+            // permission above.
+
+            final NetworkTemplate template = intent.getParcelableExtra(EXTRA_NETWORK_TEMPLATE);
+            performSnooze(template, TYPE_WARNING);
+        }
+    };
+
+    /**
      * Observer that watches for {@link INetworkManagementService} alerts.
      */
     private INetworkManagementEventObserver mAlertObserver = new NetworkAlertObserver() {
@@ -458,7 +481,7 @@
             final long totalBytes = getTotalBytes(policy.template, start, end);
 
             if (policy.isOverLimit(totalBytes)) {
-                if (policy.lastSnooze >= start) {
+                if (policy.lastLimitSnooze >= start) {
                     enqueueNotification(policy, TYPE_LIMIT_SNOOZED, totalBytes);
                 } else {
                     enqueueNotification(policy, TYPE_LIMIT, totalBytes);
@@ -468,7 +491,7 @@
             } else {
                 notifyUnderLimitLocked(policy.template);
 
-                if (policy.warningBytes != WARNING_DISABLED && totalBytes >= policy.warningBytes) {
+                if (policy.isOverWarning(totalBytes) && policy.lastWarningSnooze < start) {
                     enqueueNotification(policy, TYPE_WARNING, totalBytes);
                 }
             }
@@ -534,7 +557,7 @@
         final String tag = buildNotificationTag(policy, type);
         final Notification.Builder builder = new Notification.Builder(mContext);
         builder.setOnlyAlertOnce(true);
-        builder.setOngoing(true);
+        builder.setWhen(0L);
 
         final Resources res = mContext.getResources();
         switch (type) {
@@ -547,9 +570,14 @@
                 builder.setContentTitle(title);
                 builder.setContentText(body);
 
-                final Intent intent = buildViewDataUsageIntent(policy.template);
+                final Intent snoozeIntent = buildSnoozeWarningIntent(policy.template);
+                builder.setDeleteIntent(PendingIntent.getBroadcast(
+                        mContext, 0, snoozeIntent, PendingIntent.FLAG_UPDATE_CURRENT));
+
+                final Intent viewIntent = buildViewDataUsageIntent(policy.template);
                 builder.setContentIntent(PendingIntent.getActivity(
-                        mContext, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT));
+                        mContext, 0, viewIntent, PendingIntent.FLAG_UPDATE_CURRENT));
+
                 break;
             }
             case TYPE_LIMIT: {
@@ -574,6 +602,7 @@
                         break;
                 }
 
+                builder.setOngoing(true);
                 builder.setSmallIcon(R.drawable.stat_notify_disabled);
                 builder.setTicker(title);
                 builder.setContentTitle(title);
@@ -608,6 +637,7 @@
                         break;
                 }
 
+                builder.setOngoing(true);
                 builder.setSmallIcon(R.drawable.stat_notify_error);
                 builder.setTicker(title);
                 builder.setContentTitle(title);
@@ -720,10 +750,11 @@
             final long totalBytes = getTotalBytes(policy.template, start, end);
 
             // disable data connection when over limit and not snoozed
-            final boolean overLimit = policy.isOverLimit(totalBytes) && policy.lastSnooze < start;
-            final boolean enabled = !overLimit;
+            final boolean overLimitWithoutSnooze = policy.isOverLimit(totalBytes)
+                    && policy.lastLimitSnooze < start;
+            final boolean networkEnabled = !overLimitWithoutSnooze;
 
-            setNetworkTemplateEnabled(policy.template, enabled);
+            setNetworkTemplateEnabled(policy.template, networkEnabled);
         }
     }
 
@@ -827,7 +858,7 @@
                     // metered network, but no policy limit; we still need to
                     // restrict apps, so push really high quota.
                     quotaBytes = Long.MAX_VALUE;
-                } else if (policy.lastSnooze >= start) {
+                } else if (policy.lastLimitSnooze >= start) {
                     // snoozing past quota, but we still need to restrict apps,
                     // so push really high quota.
                     quotaBytes = Long.MAX_VALUE;
@@ -896,8 +927,8 @@
             final int cycleDay = time.monthDay;
 
             final NetworkTemplate template = buildTemplateMobileAll(subscriberId);
-            mNetworkPolicy.put(template, new NetworkPolicy(
-                    template, cycleDay, warningBytes, LIMIT_DISABLED, SNOOZE_NEVER, true));
+            mNetworkPolicy.put(template, new NetworkPolicy(template, cycleDay, warningBytes,
+                    LIMIT_DISABLED, SNOOZE_NEVER, SNOOZE_NEVER, true));
             writePolicyLocked();
         }
     }
@@ -935,11 +966,13 @@
                         final int cycleDay = readIntAttribute(in, ATTR_CYCLE_DAY);
                         final long warningBytes = readLongAttribute(in, ATTR_WARNING_BYTES);
                         final long limitBytes = readLongAttribute(in, ATTR_LIMIT_BYTES);
-                        final long lastSnooze;
-                        if (version >= VERSION_ADDED_SNOOZE) {
-                            lastSnooze = readLongAttribute(in, ATTR_LAST_SNOOZE);
+                        final long lastLimitSnooze;
+                        if (version >= VERSION_SPLIT_SNOOZE) {
+                            lastLimitSnooze = readLongAttribute(in, ATTR_LAST_LIMIT_SNOOZE);
+                        } else if (version >= VERSION_ADDED_SNOOZE) {
+                            lastLimitSnooze = readLongAttribute(in, ATTR_LAST_SNOOZE);
                         } else {
-                            lastSnooze = SNOOZE_NEVER;
+                            lastLimitSnooze = SNOOZE_NEVER;
                         }
                         final boolean metered;
                         if (version >= VERSION_ADDED_METERED) {
@@ -955,11 +988,18 @@
                                     metered = false;
                             }
                         }
+                        final long lastWarningSnooze;
+                        if (version >= VERSION_SPLIT_SNOOZE) {
+                            lastWarningSnooze = readLongAttribute(in, ATTR_LAST_WARNING_SNOOZE);
+                        } else {
+                            lastWarningSnooze = SNOOZE_NEVER;
+                        }
 
                         final NetworkTemplate template = new NetworkTemplate(
                                 networkTemplate, subscriberId);
-                        mNetworkPolicy.put(template, new NetworkPolicy(
-                                template, cycleDay, warningBytes, limitBytes, lastSnooze, metered));
+                        mNetworkPolicy.put(template, new NetworkPolicy(template, cycleDay,
+                                warningBytes, limitBytes, lastWarningSnooze, lastLimitSnooze,
+                                metered));
 
                     } else if (TAG_UID_POLICY.equals(tag)) {
                         final int uid = readIntAttribute(in, ATTR_UID);
@@ -1014,7 +1054,7 @@
             out.startDocument(null, true);
 
             out.startTag(null, TAG_POLICY_LIST);
-            writeIntAttribute(out, ATTR_VERSION, VERSION_ADDED_METERED);
+            writeIntAttribute(out, ATTR_VERSION, VERSION_SPLIT_SNOOZE);
             writeBooleanAttribute(out, ATTR_RESTRICT_BACKGROUND, mRestrictBackground);
 
             // write all known network policies
@@ -1030,7 +1070,8 @@
                 writeIntAttribute(out, ATTR_CYCLE_DAY, policy.cycleDay);
                 writeLongAttribute(out, ATTR_WARNING_BYTES, policy.warningBytes);
                 writeLongAttribute(out, ATTR_LIMIT_BYTES, policy.limitBytes);
-                writeLongAttribute(out, ATTR_LAST_SNOOZE, policy.lastSnooze);
+                writeLongAttribute(out, ATTR_LAST_WARNING_SNOOZE, policy.lastWarningSnooze);
+                writeLongAttribute(out, ATTR_LAST_LIMIT_SNOOZE, policy.lastLimitSnooze);
                 writeBooleanAttribute(out, ATTR_METERED, policy.metered);
                 out.endTag(null, TAG_NETWORK_POLICY);
             }
@@ -1141,9 +1182,12 @@
     }
 
     @Override
-    public void snoozePolicy(NetworkTemplate template) {
+    public void snoozeLimit(NetworkTemplate template) {
         mContext.enforceCallingOrSelfPermission(MANAGE_NETWORK_POLICY, TAG);
+        performSnooze(template, TYPE_LIMIT);
+    }
 
+    private void performSnooze(NetworkTemplate template, int type) {
         maybeRefreshTrustedTime();
         final long currentTime = currentTimeMillis();
         synchronized (mRulesLock) {
@@ -1153,7 +1197,16 @@
                 throw new IllegalArgumentException("unable to find policy for " + template);
             }
 
-            policy.lastSnooze = currentTime;
+            switch (type) {
+                case TYPE_WARNING:
+                    policy.lastWarningSnooze = currentTime;
+                    break;
+                case TYPE_LIMIT:
+                    policy.lastLimitSnooze = currentTime;
+                    break;
+                default:
+                    throw new IllegalArgumentException("unexpected type");
+            }
 
             updateNetworkEnabledLocked();
             updateNetworkRulesLocked();
@@ -1173,6 +1226,9 @@
             updateNotificationsLocked();
             writePolicyLocked();
         }
+
+        mHandler.obtainMessage(MSG_RESTRICT_BACKGROUND_CHANGED, restrictBackground ? 1 : 0, 0)
+                .sendToTarget();
     }
 
     @Override
@@ -1246,12 +1302,17 @@
         }
 
         synchronized (mRulesLock) {
-            if (argSet.contains("unsnooze")) {
+            if (argSet.contains("--unsnooze")) {
                 for (NetworkPolicy policy : mNetworkPolicy.values()) {
-                    policy.lastSnooze = SNOOZE_NEVER;
+                    policy.clearSnooze();
                 }
+
+                updateNetworkEnabledLocked();
+                updateNetworkRulesLocked();
+                updateNotificationsLocked();
                 writePolicyLocked();
-                fout.println("Wiped snooze timestamps");
+
+                fout.println("Cleared snooze timestamps");
                 return;
             }
 
@@ -1516,6 +1577,20 @@
                     }
                     return true;
                 }
+                case MSG_RESTRICT_BACKGROUND_CHANGED: {
+                    final boolean restrictBackground = msg.arg1 != 0;
+                    final int length = mListeners.beginBroadcast();
+                    for (int i = 0; i < length; i++) {
+                        final INetworkPolicyListener listener = mListeners.getBroadcastItem(i);
+                        if (listener != null) {
+                            try {
+                                listener.onRestrictBackgroundChanged(restrictBackground);
+                            } catch (RemoteException e) {
+                            }
+                        }
+                    }
+                    mListeners.finishBroadcast();
+                }
                 default: {
                     return false;
                 }
@@ -1573,6 +1648,9 @@
     private long getTotalBytes(NetworkTemplate template, long start, long end) {
         try {
             return mNetworkStats.getSummaryForNetwork(template, start, end).getTotalBytes();
+        } catch (RuntimeException e) {
+            Slog.w(TAG, "problem reading network stats: " + e);
+            return 0;
         } catch (RemoteException e) {
             // ignored; service lives in system_server
             return 0;
@@ -1596,6 +1674,12 @@
         return new Intent(ACTION_ALLOW_BACKGROUND);
     }
 
+    private static Intent buildSnoozeWarningIntent(NetworkTemplate template) {
+        final Intent intent = new Intent(ACTION_SNOOZE_WARNING);
+        intent.putExtra(EXTRA_NETWORK_TEMPLATE, template);
+        return intent;
+    }
+
     private static Intent buildNetworkOverLimitIntent(NetworkTemplate template) {
         final Intent intent = new Intent();
         intent.setComponent(new ComponentName(
diff --git a/services/java/com/android/server/net/NetworkStatsCollection.java b/services/java/com/android/server/net/NetworkStatsCollection.java
new file mode 100644
index 0000000..70038d9
--- /dev/null
+++ b/services/java/com/android/server/net/NetworkStatsCollection.java
@@ -0,0 +1,510 @@
+/*
+ * 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.server.net;
+
+import static android.net.NetworkStats.IFACE_ALL;
+import static android.net.NetworkStats.SET_ALL;
+import static android.net.NetworkStats.SET_DEFAULT;
+import static android.net.NetworkStats.TAG_NONE;
+import static android.net.NetworkStats.UID_ALL;
+import static android.net.TrafficStats.UID_REMOVED;
+
+import android.net.NetworkIdentity;
+import android.net.NetworkStats;
+import android.net.NetworkStatsHistory;
+import android.net.NetworkTemplate;
+import android.net.TrafficStats;
+import android.text.format.DateUtils;
+
+import com.android.internal.os.AtomicFile;
+import com.android.internal.util.FileRotator;
+import com.android.internal.util.IndentingPrintWriter;
+import com.android.internal.util.Objects;
+import com.google.android.collect.Lists;
+import com.google.android.collect.Maps;
+
+import java.io.BufferedInputStream;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.ProtocolException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import libcore.io.IoUtils;
+
+/**
+ * Collection of {@link NetworkStatsHistory}, stored based on combined key of
+ * {@link NetworkIdentitySet}, UID, set, and tag. Knows how to persist itself.
+ */
+public class NetworkStatsCollection implements FileRotator.Reader {
+    private static final String TAG = "NetworkStatsCollection";
+
+    /** File header magic number: "ANET" */
+    private static final int FILE_MAGIC = 0x414E4554;
+
+    private static final int VERSION_NETWORK_INIT = 1;
+
+    private static final int VERSION_UID_INIT = 1;
+    private static final int VERSION_UID_WITH_IDENT = 2;
+    private static final int VERSION_UID_WITH_TAG = 3;
+    private static final int VERSION_UID_WITH_SET = 4;
+
+    private static final int VERSION_UNIFIED_INIT = 16;
+
+    private HashMap<Key, NetworkStatsHistory> mStats = Maps.newHashMap();
+
+    private long mBucketDuration;
+
+    private long mStartMillis;
+    private long mEndMillis;
+    private long mTotalBytes;
+    private boolean mDirty;
+
+    public NetworkStatsCollection(long bucketDuration) {
+        mBucketDuration = bucketDuration;
+        reset();
+    }
+
+    public void reset() {
+        mStats.clear();
+        mStartMillis = Long.MAX_VALUE;
+        mEndMillis = Long.MIN_VALUE;
+        mTotalBytes = 0;
+        mDirty = false;
+    }
+
+    public long getStartMillis() {
+        return mStartMillis;
+    }
+
+    public long getEndMillis() {
+        return mEndMillis;
+    }
+
+    public long getTotalBytes() {
+        return mTotalBytes;
+    }
+
+    public boolean isDirty() {
+        return mDirty;
+    }
+
+    public void clearDirty() {
+        mDirty = false;
+    }
+
+    public boolean isEmpty() {
+        return mStartMillis == Long.MAX_VALUE && mEndMillis == Long.MIN_VALUE;
+    }
+
+    /**
+     * Combine all {@link NetworkStatsHistory} in this collection which match
+     * the requested parameters.
+     */
+    public NetworkStatsHistory getHistory(
+            NetworkTemplate template, int uid, int set, int tag, int fields) {
+        final NetworkStatsHistory combined = new NetworkStatsHistory(
+                mBucketDuration, estimateBuckets(), fields);
+        for (Map.Entry<Key, NetworkStatsHistory> entry : mStats.entrySet()) {
+            final Key key = entry.getKey();
+            final boolean setMatches = set == SET_ALL || key.set == set;
+            if (key.uid == uid && setMatches && key.tag == tag
+                    && templateMatches(template, key.ident)) {
+                combined.recordEntireHistory(entry.getValue());
+            }
+        }
+        return combined;
+    }
+
+    /**
+     * Summarize all {@link NetworkStatsHistory} in this collection which match
+     * the requested parameters.
+     */
+    public NetworkStats getSummary(NetworkTemplate template, long start, long end) {
+        final long now = System.currentTimeMillis();
+
+        final NetworkStats stats = new NetworkStats(end - start, 24);
+        final NetworkStats.Entry entry = new NetworkStats.Entry();
+        NetworkStatsHistory.Entry historyEntry = null;
+
+        for (Map.Entry<Key, NetworkStatsHistory> mapEntry : mStats.entrySet()) {
+            final Key key = mapEntry.getKey();
+            if (templateMatches(template, key.ident)) {
+                final NetworkStatsHistory history = mapEntry.getValue();
+                historyEntry = history.getValues(start, end, now, historyEntry);
+
+                entry.iface = IFACE_ALL;
+                entry.uid = key.uid;
+                entry.set = key.set;
+                entry.tag = key.tag;
+                entry.rxBytes = historyEntry.rxBytes;
+                entry.rxPackets = historyEntry.rxPackets;
+                entry.txBytes = historyEntry.txBytes;
+                entry.txPackets = historyEntry.txPackets;
+                entry.operations = historyEntry.operations;
+
+                if (!entry.isEmpty()) {
+                    stats.combineValues(entry);
+                }
+            }
+        }
+
+        return stats;
+    }
+
+    /**
+     * Record given {@link NetworkStats.Entry} into this collection.
+     */
+    public void recordData(NetworkIdentitySet ident, int uid, int set, int tag, long start,
+            long end, NetworkStats.Entry entry) {
+        noteRecordedHistory(start, end, entry.rxBytes + entry.txBytes);
+        findOrCreateHistory(ident, uid, set, tag).recordData(start, end, entry);
+    }
+
+    /**
+     * Record given {@link NetworkStatsHistory} into this collection.
+     */
+    private void recordHistory(Key key, NetworkStatsHistory history) {
+        if (history.size() == 0) return;
+        noteRecordedHistory(history.getStart(), history.getEnd(), history.getTotalBytes());
+
+        final NetworkStatsHistory existing = mStats.get(key);
+        if (existing != null) {
+            existing.recordEntireHistory(history);
+        } else {
+            mStats.put(key, history);
+        }
+    }
+
+    /**
+     * Record all {@link NetworkStatsHistory} contained in the given collection
+     * into this collection.
+     */
+    public void recordCollection(NetworkStatsCollection another) {
+        for (Map.Entry<Key, NetworkStatsHistory> entry : another.mStats.entrySet()) {
+            recordHistory(entry.getKey(), entry.getValue());
+        }
+    }
+
+    private NetworkStatsHistory findOrCreateHistory(
+            NetworkIdentitySet ident, int uid, int set, int tag) {
+        final Key key = new Key(ident, uid, set, tag);
+        final NetworkStatsHistory existing = mStats.get(key);
+
+        // update when no existing, or when bucket duration changed
+        NetworkStatsHistory updated = null;
+        if (existing == null) {
+            updated = new NetworkStatsHistory(mBucketDuration, 10);
+        } else if (existing.getBucketDuration() != mBucketDuration) {
+            updated = new NetworkStatsHistory(existing, mBucketDuration);
+        }
+
+        if (updated != null) {
+            mStats.put(key, updated);
+            return updated;
+        } else {
+            return existing;
+        }
+    }
+
+    /** {@inheritDoc} */
+    public void read(InputStream in) throws IOException {
+        read(new DataInputStream(in));
+    }
+
+    public void read(DataInputStream in) throws IOException {
+        // verify file magic header intact
+        final int magic = in.readInt();
+        if (magic != FILE_MAGIC) {
+            throw new ProtocolException("unexpected magic: " + magic);
+        }
+
+        final int version = in.readInt();
+        switch (version) {
+            case VERSION_UNIFIED_INIT: {
+                // uid := size *(NetworkIdentitySet size *(uid set tag NetworkStatsHistory))
+                final int identSize = in.readInt();
+                for (int i = 0; i < identSize; i++) {
+                    final NetworkIdentitySet ident = new NetworkIdentitySet(in);
+
+                    final int size = in.readInt();
+                    for (int j = 0; j < size; j++) {
+                        final int uid = in.readInt();
+                        final int set = in.readInt();
+                        final int tag = in.readInt();
+
+                        final Key key = new Key(ident, uid, set, tag);
+                        final NetworkStatsHistory history = new NetworkStatsHistory(in);
+                        recordHistory(key, history);
+                    }
+                }
+                break;
+            }
+            default: {
+                throw new ProtocolException("unexpected version: " + version);
+            }
+        }
+    }
+
+    public void write(DataOutputStream out) throws IOException {
+        // cluster key lists grouped by ident
+        final HashMap<NetworkIdentitySet, ArrayList<Key>> keysByIdent = Maps.newHashMap();
+        for (Key key : mStats.keySet()) {
+            ArrayList<Key> keys = keysByIdent.get(key.ident);
+            if (keys == null) {
+                keys = Lists.newArrayList();
+                keysByIdent.put(key.ident, keys);
+            }
+            keys.add(key);
+        }
+
+        out.writeInt(FILE_MAGIC);
+        out.writeInt(VERSION_UNIFIED_INIT);
+
+        out.writeInt(keysByIdent.size());
+        for (NetworkIdentitySet ident : keysByIdent.keySet()) {
+            final ArrayList<Key> keys = keysByIdent.get(ident);
+            ident.writeToStream(out);
+
+            out.writeInt(keys.size());
+            for (Key key : keys) {
+                final NetworkStatsHistory history = mStats.get(key);
+                out.writeInt(key.uid);
+                out.writeInt(key.set);
+                out.writeInt(key.tag);
+                history.writeToStream(out);
+            }
+        }
+
+        out.flush();
+    }
+
+    @Deprecated
+    public void readLegacyNetwork(File file) throws IOException {
+        final AtomicFile inputFile = new AtomicFile(file);
+
+        DataInputStream in = null;
+        try {
+            in = new DataInputStream(new BufferedInputStream(inputFile.openRead()));
+
+            // verify file magic header intact
+            final int magic = in.readInt();
+            if (magic != FILE_MAGIC) {
+                throw new ProtocolException("unexpected magic: " + magic);
+            }
+
+            final int version = in.readInt();
+            switch (version) {
+                case VERSION_NETWORK_INIT: {
+                    // network := size *(NetworkIdentitySet NetworkStatsHistory)
+                    final int size = in.readInt();
+                    for (int i = 0; i < size; i++) {
+                        final NetworkIdentitySet ident = new NetworkIdentitySet(in);
+                        final NetworkStatsHistory history = new NetworkStatsHistory(in);
+
+                        final Key key = new Key(ident, UID_ALL, SET_ALL, TAG_NONE);
+                        recordHistory(key, history);
+                    }
+                    break;
+                }
+                default: {
+                    throw new ProtocolException("unexpected version: " + version);
+                }
+            }
+        } catch (FileNotFoundException e) {
+            // missing stats is okay, probably first boot
+        } finally {
+            IoUtils.closeQuietly(in);
+        }
+    }
+
+    @Deprecated
+    public void readLegacyUid(File file, boolean onlyTags) throws IOException {
+        final AtomicFile inputFile = new AtomicFile(file);
+
+        DataInputStream in = null;
+        try {
+            in = new DataInputStream(new BufferedInputStream(inputFile.openRead()));
+
+            // verify file magic header intact
+            final int magic = in.readInt();
+            if (magic != FILE_MAGIC) {
+                throw new ProtocolException("unexpected magic: " + magic);
+            }
+
+            final int version = in.readInt();
+            switch (version) {
+                case VERSION_UID_INIT: {
+                    // uid := size *(UID NetworkStatsHistory)
+
+                    // drop this data version, since we don't have a good
+                    // mapping into NetworkIdentitySet.
+                    break;
+                }
+                case VERSION_UID_WITH_IDENT: {
+                    // uid := size *(NetworkIdentitySet size *(UID NetworkStatsHistory))
+
+                    // drop this data version, since this version only existed
+                    // for a short time.
+                    break;
+                }
+                case VERSION_UID_WITH_TAG:
+                case VERSION_UID_WITH_SET: {
+                    // uid := size *(NetworkIdentitySet size *(uid set tag NetworkStatsHistory))
+                    final int identSize = in.readInt();
+                    for (int i = 0; i < identSize; i++) {
+                        final NetworkIdentitySet ident = new NetworkIdentitySet(in);
+
+                        final int size = in.readInt();
+                        for (int j = 0; j < size; j++) {
+                            final int uid = in.readInt();
+                            final int set = (version >= VERSION_UID_WITH_SET) ? in.readInt()
+                                    : SET_DEFAULT;
+                            final int tag = in.readInt();
+
+                            final Key key = new Key(ident, uid, set, tag);
+                            final NetworkStatsHistory history = new NetworkStatsHistory(in);
+
+                            if ((tag == TAG_NONE) != onlyTags) {
+                                recordHistory(key, history);
+                            }
+                        }
+                    }
+                    break;
+                }
+                default: {
+                    throw new ProtocolException("unexpected version: " + version);
+                }
+            }
+        } catch (FileNotFoundException e) {
+            // missing stats is okay, probably first boot
+        } finally {
+            IoUtils.closeQuietly(in);
+        }
+    }
+
+    /**
+     * Remove any {@link NetworkStatsHistory} attributed to the requested UID,
+     * moving any {@link NetworkStats#TAG_NONE} series to
+     * {@link TrafficStats#UID_REMOVED}.
+     */
+    public void removeUid(int uid) {
+        final ArrayList<Key> knownKeys = Lists.newArrayList();
+        knownKeys.addAll(mStats.keySet());
+
+        // migrate all UID stats into special "removed" bucket
+        for (Key key : knownKeys) {
+            if (key.uid == uid) {
+                // only migrate combined TAG_NONE history
+                if (key.tag == TAG_NONE) {
+                    final NetworkStatsHistory uidHistory = mStats.get(key);
+                    final NetworkStatsHistory removedHistory = findOrCreateHistory(
+                            key.ident, UID_REMOVED, SET_DEFAULT, TAG_NONE);
+                    removedHistory.recordEntireHistory(uidHistory);
+                }
+                mStats.remove(key);
+                mDirty = true;
+            }
+        }
+    }
+
+    private void noteRecordedHistory(long startMillis, long endMillis, long totalBytes) {
+        if (startMillis < mStartMillis) mStartMillis = startMillis;
+        if (endMillis > mEndMillis) mEndMillis = endMillis;
+        mTotalBytes += totalBytes;
+        mDirty = true;
+    }
+
+    private int estimateBuckets() {
+        return (int) (Math.min(mEndMillis - mStartMillis, DateUtils.WEEK_IN_MILLIS * 5)
+                / mBucketDuration);
+    }
+
+    public void dump(IndentingPrintWriter pw) {
+        final ArrayList<Key> keys = Lists.newArrayList();
+        keys.addAll(mStats.keySet());
+        Collections.sort(keys);
+
+        for (Key key : keys) {
+            pw.print("ident="); pw.print(key.ident.toString());
+            pw.print(" uid="); pw.print(key.uid);
+            pw.print(" set="); pw.print(NetworkStats.setToString(key.set));
+            pw.print(" tag="); pw.println(NetworkStats.tagToString(key.tag));
+
+            final NetworkStatsHistory history = mStats.get(key);
+            pw.increaseIndent();
+            history.dump(pw, true);
+            pw.decreaseIndent();
+        }
+    }
+
+    /**
+     * Test if given {@link NetworkTemplate} matches any {@link NetworkIdentity}
+     * in the given {@link NetworkIdentitySet}.
+     */
+    private static boolean templateMatches(NetworkTemplate template, NetworkIdentitySet identSet) {
+        for (NetworkIdentity ident : identSet) {
+            if (template.matches(ident)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private static class Key implements Comparable<Key> {
+        public final NetworkIdentitySet ident;
+        public final int uid;
+        public final int set;
+        public final int tag;
+
+        private final int hashCode;
+
+        public Key(NetworkIdentitySet ident, int uid, int set, int tag) {
+            this.ident = ident;
+            this.uid = uid;
+            this.set = set;
+            this.tag = tag;
+            hashCode = Objects.hashCode(ident, uid, set, tag);
+        }
+
+        @Override
+        public int hashCode() {
+            return hashCode;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (obj instanceof Key) {
+                final Key key = (Key) obj;
+                return uid == key.uid && set == key.set && tag == key.tag
+                        && Objects.equal(ident, key.ident);
+            }
+            return false;
+        }
+
+        /** {@inheritDoc} */
+        public int compareTo(Key another) {
+            return Integer.compare(uid, another.uid);
+        }
+    }
+}
diff --git a/services/java/com/android/server/net/NetworkStatsRecorder.java b/services/java/com/android/server/net/NetworkStatsRecorder.java
new file mode 100644
index 0000000..240cc1c
--- /dev/null
+++ b/services/java/com/android/server/net/NetworkStatsRecorder.java
@@ -0,0 +1,342 @@
+/*
+ * 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.server.net;
+
+import static android.net.NetworkStats.TAG_NONE;
+import static com.android.internal.util.Preconditions.checkNotNull;
+
+import android.net.NetworkStats;
+import android.net.NetworkStats.NonMonotonicObserver;
+import android.net.NetworkStatsHistory;
+import android.net.NetworkTemplate;
+import android.net.TrafficStats;
+import android.util.Log;
+import android.util.Slog;
+
+import com.android.internal.util.FileRotator;
+import com.android.internal.util.IndentingPrintWriter;
+import com.google.android.collect.Sets;
+
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.lang.ref.WeakReference;
+import java.util.HashSet;
+import java.util.Map;
+
+/**
+ * Logic to record deltas between periodic {@link NetworkStats} snapshots into
+ * {@link NetworkStatsHistory} that belong to {@link NetworkStatsCollection}.
+ * Keeps pending changes in memory until they pass a specific threshold, in
+ * bytes. Uses {@link FileRotator} for persistence logic.
+ * <p>
+ * Not inherently thread safe.
+ */
+public class NetworkStatsRecorder {
+    private static final String TAG = "NetworkStatsRecorder";
+    private static final boolean LOGD = true;
+    private static final boolean LOGV = false;
+
+    private final FileRotator mRotator;
+    private final NonMonotonicObserver<String> mObserver;
+    private final String mCookie;
+
+    private final long mBucketDuration;
+    private final long mPersistThresholdBytes;
+    private final boolean mOnlyTags;
+
+    private NetworkStats mLastSnapshot;
+
+    private final NetworkStatsCollection mPending;
+    private final NetworkStatsCollection mSinceBoot;
+
+    private final CombiningRewriter mPendingRewriter;
+
+    private WeakReference<NetworkStatsCollection> mComplete;
+
+    public NetworkStatsRecorder(FileRotator rotator, NonMonotonicObserver<String> observer,
+            String cookie, long bucketDuration, long persistThresholdBytes, boolean onlyTags) {
+        mRotator = checkNotNull(rotator, "missing FileRotator");
+        mObserver = checkNotNull(observer, "missing NonMonotonicObserver");
+        mCookie = cookie;
+
+        mBucketDuration = bucketDuration;
+        mPersistThresholdBytes = persistThresholdBytes;
+        mOnlyTags = onlyTags;
+
+        mPending = new NetworkStatsCollection(bucketDuration);
+        mSinceBoot = new NetworkStatsCollection(bucketDuration);
+
+        mPendingRewriter = new CombiningRewriter(mPending);
+    }
+
+    public void resetLocked() {
+        mLastSnapshot = null;
+        mPending.reset();
+        mSinceBoot.reset();
+        mComplete.clear();
+    }
+
+    public NetworkStats.Entry getTotalSinceBootLocked(NetworkTemplate template) {
+        return mSinceBoot.getSummary(template, Long.MIN_VALUE, Long.MAX_VALUE).getTotal(null);
+    }
+
+    /**
+     * Load complete history represented by {@link FileRotator}. Caches
+     * internally as a {@link WeakReference}, and updated with future
+     * {@link #recordSnapshotLocked(NetworkStats, Map, long)} snapshots as long
+     * as reference is valid.
+     */
+    public NetworkStatsCollection getOrLoadCompleteLocked() {
+        NetworkStatsCollection complete = mComplete != null ? mComplete.get() : null;
+        if (complete == null) {
+            if (LOGD) Slog.d(TAG, "getOrLoadCompleteLocked() reading from disk for " + mCookie);
+            try {
+                complete = new NetworkStatsCollection(mBucketDuration);
+                mRotator.readMatching(complete, Long.MIN_VALUE, Long.MAX_VALUE);
+                complete.recordCollection(mPending);
+                mComplete = new WeakReference<NetworkStatsCollection>(complete);
+            } catch (IOException e) {
+                Log.wtf(TAG, "problem completely reading network stats", e);
+            }
+        }
+        return complete;
+    }
+
+    /**
+     * Record any delta that occurred since last {@link NetworkStats} snapshot,
+     * using the given {@link Map} to identify network interfaces. First
+     * snapshot is considered bootstrap, and is not counted as delta.
+     */
+    public void recordSnapshotLocked(NetworkStats snapshot,
+            Map<String, NetworkIdentitySet> ifaceIdent, long currentTimeMillis) {
+        final HashSet<String> unknownIfaces = Sets.newHashSet();
+
+        // assume first snapshot is bootstrap and don't record
+        if (mLastSnapshot == null) {
+            mLastSnapshot = snapshot;
+            return;
+        }
+
+        final NetworkStatsCollection complete = mComplete != null ? mComplete.get() : null;
+
+        final NetworkStats delta = NetworkStats.subtract(
+                snapshot, mLastSnapshot, mObserver, mCookie);
+        final long end = currentTimeMillis;
+        final long start = end - delta.getElapsedRealtime();
+
+        NetworkStats.Entry entry = null;
+        for (int i = 0; i < delta.size(); i++) {
+            entry = delta.getValues(i, entry);
+            final NetworkIdentitySet ident = ifaceIdent.get(entry.iface);
+            if (ident == null) {
+                unknownIfaces.add(entry.iface);
+                continue;
+            }
+
+            // skip when no delta occured
+            if (entry.isEmpty()) continue;
+
+            // only record tag data when requested
+            if ((entry.tag == TAG_NONE) != mOnlyTags) {
+                mPending.recordData(ident, entry.uid, entry.set, entry.tag, start, end, entry);
+
+                // also record against boot stats when present
+                if (mSinceBoot != null) {
+                    mSinceBoot.recordData(ident, entry.uid, entry.set, entry.tag, start, end, entry);
+                }
+
+                // also record against complete dataset when present
+                if (complete != null) {
+                    complete.recordData(ident, entry.uid, entry.set, entry.tag, start, end, entry);
+                }
+            }
+        }
+
+        mLastSnapshot = snapshot;
+
+        if (LOGV && unknownIfaces.size() > 0) {
+            Slog.w(TAG, "unknown interfaces " + unknownIfaces + ", ignoring those stats");
+        }
+    }
+
+    /**
+     * Consider persisting any pending deltas, if they are beyond
+     * {@link #mPersistThresholdBytes}.
+     */
+    public void maybePersistLocked(long currentTimeMillis) {
+        final long pendingBytes = mPending.getTotalBytes();
+        if (pendingBytes >= mPersistThresholdBytes) {
+            forcePersistLocked(currentTimeMillis);
+        } else {
+            mRotator.maybeRotate(currentTimeMillis);
+        }
+    }
+
+    /**
+     * Force persisting any pending deltas.
+     */
+    public void forcePersistLocked(long currentTimeMillis) {
+        if (mPending.isDirty()) {
+            if (LOGD) Slog.d(TAG, "forcePersistLocked() writing for " + mCookie);
+            try {
+                mRotator.rewriteActive(mPendingRewriter, currentTimeMillis);
+                mRotator.maybeRotate(currentTimeMillis);
+                mPending.reset();
+            } catch (IOException e) {
+                Log.wtf(TAG, "problem persisting pending stats", e);
+            }
+        }
+    }
+
+    /**
+     * Remove the given UID from all {@link FileRotator} history, migrating it
+     * to {@link TrafficStats#UID_REMOVED}.
+     */
+    public void removeUidLocked(int uid) {
+        try {
+            // process all existing data to migrate uid
+            mRotator.rewriteAll(new RemoveUidRewriter(mBucketDuration, uid));
+        } catch (IOException e) {
+            Log.wtf(TAG, "problem removing UID " + uid, e);
+        }
+
+        // clear UID from current stats snapshot
+        if (mLastSnapshot != null) {
+            mLastSnapshot = mLastSnapshot.withoutUid(uid);
+        }
+    }
+
+    /**
+     * Rewriter that will combine current {@link NetworkStatsCollection} values
+     * with anything read from disk, and write combined set to disk. Clears the
+     * original {@link NetworkStatsCollection} when finished writing.
+     */
+    private static class CombiningRewriter implements FileRotator.Rewriter {
+        private final NetworkStatsCollection mCollection;
+
+        public CombiningRewriter(NetworkStatsCollection collection) {
+            mCollection = checkNotNull(collection, "missing NetworkStatsCollection");
+        }
+
+        /** {@inheritDoc} */
+        public void reset() {
+            // ignored
+        }
+
+        /** {@inheritDoc} */
+        public void read(InputStream in) throws IOException {
+            mCollection.read(in);
+        }
+
+        /** {@inheritDoc} */
+        public boolean shouldWrite() {
+            return true;
+        }
+
+        /** {@inheritDoc} */
+        public void write(OutputStream out) throws IOException {
+            mCollection.write(new DataOutputStream(out));
+            mCollection.reset();
+        }
+    }
+
+    /**
+     * Rewriter that will remove any {@link NetworkStatsHistory} attributed to
+     * the requested UID, only writing data back when modified.
+     */
+    public static class RemoveUidRewriter implements FileRotator.Rewriter {
+        private final NetworkStatsCollection mTemp;
+        private final int mUid;
+
+        public RemoveUidRewriter(long bucketDuration, int uid) {
+            mTemp = new NetworkStatsCollection(bucketDuration);
+            mUid = uid;
+        }
+
+        /** {@inheritDoc} */
+        public void reset() {
+            mTemp.reset();
+        }
+
+        /** {@inheritDoc} */
+        public void read(InputStream in) throws IOException {
+            mTemp.read(in);
+            mTemp.clearDirty();
+            mTemp.removeUid(mUid);
+        }
+
+        /** {@inheritDoc} */
+        public boolean shouldWrite() {
+            return mTemp.isDirty();
+        }
+
+        /** {@inheritDoc} */
+        public void write(OutputStream out) throws IOException {
+            mTemp.write(new DataOutputStream(out));
+        }
+    }
+
+    public void importLegacyNetworkLocked(File file) throws IOException {
+        // legacy file still exists; start empty to avoid double importing
+        mRotator.deleteAll();
+
+        final NetworkStatsCollection collection = new NetworkStatsCollection(mBucketDuration);
+        collection.readLegacyNetwork(file);
+
+        final long startMillis = collection.getStartMillis();
+        final long endMillis = collection.getEndMillis();
+
+        if (!collection.isEmpty()) {
+            // process legacy data, creating active file at starting time, then
+            // using end time to possibly trigger rotation.
+            mRotator.rewriteActive(new CombiningRewriter(collection), startMillis);
+            mRotator.maybeRotate(endMillis);
+        }
+    }
+
+    public void importLegacyUidLocked(File file) throws IOException {
+        // legacy file still exists; start empty to avoid double importing
+        mRotator.deleteAll();
+
+        final NetworkStatsCollection collection = new NetworkStatsCollection(mBucketDuration);
+        collection.readLegacyUid(file, mOnlyTags);
+
+        final long startMillis = collection.getStartMillis();
+        final long endMillis = collection.getEndMillis();
+
+        if (!collection.isEmpty()) {
+            // process legacy data, creating active file at starting time, then
+            // using end time to possibly trigger rotation.
+            mRotator.rewriteActive(new CombiningRewriter(collection), startMillis);
+            mRotator.maybeRotate(endMillis);
+        }
+    }
+
+    public void dumpLocked(IndentingPrintWriter pw, boolean fullHistory) {
+        pw.print("Pending bytes: "); pw.println(mPending.getTotalBytes());
+        if (fullHistory) {
+            pw.println("Complete history:");
+            getOrLoadCompleteLocked().dump(pw);
+        } else {
+            pw.println("History since boot:");
+            mSinceBoot.dump(pw);
+        }
+    }
+}
diff --git a/services/java/com/android/server/net/NetworkStatsService.java b/services/java/com/android/server/net/NetworkStatsService.java
index 6a82679..13c0640 100644
--- a/services/java/com/android/server/net/NetworkStatsService.java
+++ b/services/java/com/android/server/net/NetworkStatsService.java
@@ -34,14 +34,19 @@
 import static android.net.NetworkStats.UID_ALL;
 import static android.net.NetworkTemplate.buildTemplateMobileAll;
 import static android.net.NetworkTemplate.buildTemplateWifi;
-import static android.net.TrafficStats.UID_REMOVED;
-import static android.provider.Settings.Secure.NETSTATS_NETWORK_BUCKET_DURATION;
-import static android.provider.Settings.Secure.NETSTATS_NETWORK_MAX_HISTORY;
-import static android.provider.Settings.Secure.NETSTATS_PERSIST_THRESHOLD;
+import static android.net.TrafficStats.MB_IN_BYTES;
+import static android.provider.Settings.Secure.NETSTATS_DEV_BUCKET_DURATION;
+import static android.provider.Settings.Secure.NETSTATS_DEV_DELETE_AGE;
+import static android.provider.Settings.Secure.NETSTATS_DEV_PERSIST_BYTES;
+import static android.provider.Settings.Secure.NETSTATS_DEV_ROTATE_AGE;
+import static android.provider.Settings.Secure.NETSTATS_GLOBAL_ALERT_BYTES;
 import static android.provider.Settings.Secure.NETSTATS_POLL_INTERVAL;
-import static android.provider.Settings.Secure.NETSTATS_TAG_MAX_HISTORY;
+import static android.provider.Settings.Secure.NETSTATS_SAMPLE_ENABLED;
+import static android.provider.Settings.Secure.NETSTATS_TIME_CACHE_MAX_AGE;
 import static android.provider.Settings.Secure.NETSTATS_UID_BUCKET_DURATION;
-import static android.provider.Settings.Secure.NETSTATS_UID_MAX_HISTORY;
+import static android.provider.Settings.Secure.NETSTATS_UID_DELETE_AGE;
+import static android.provider.Settings.Secure.NETSTATS_UID_PERSIST_BYTES;
+import static android.provider.Settings.Secure.NETSTATS_UID_ROTATE_AGE;
 import static android.telephony.PhoneStateListener.LISTEN_DATA_CONNECTION_STATE;
 import static android.telephony.PhoneStateListener.LISTEN_NONE;
 import static android.text.format.DateUtils.DAY_IN_MILLIS;
@@ -61,19 +66,18 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
 import android.net.IConnectivityManager;
 import android.net.INetworkManagementEventObserver;
 import android.net.INetworkStatsService;
+import android.net.LinkProperties;
 import android.net.NetworkIdentity;
 import android.net.NetworkInfo;
 import android.net.NetworkState;
 import android.net.NetworkStats;
-import android.net.NetworkStats.NonMonotonicException;
+import android.net.NetworkStats.NonMonotonicObserver;
 import android.net.NetworkStatsHistory;
 import android.net.NetworkTemplate;
+import android.net.TrafficStats;
 import android.os.Binder;
 import android.os.DropBoxManager;
 import android.os.Environment;
@@ -94,32 +98,18 @@
 import android.util.SparseIntArray;
 import android.util.TrustedTime;
 
-import com.android.internal.os.AtomicFile;
-import com.android.internal.util.Objects;
+import com.android.internal.util.FileRotator;
+import com.android.internal.util.IndentingPrintWriter;
 import com.android.server.EventLogTags;
 import com.android.server.connectivity.Tethering;
-import com.google.android.collect.Lists;
 import com.google.android.collect.Maps;
-import com.google.android.collect.Sets;
 
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
 import java.io.File;
 import java.io.FileDescriptor;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.PrintWriter;
-import java.net.ProtocolException;
-import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Random;
-
-import libcore.io.IoUtils;
 
 /**
  * Collect and persist detailed network statistics, and provide this data to
@@ -127,19 +117,11 @@
  */
 public class NetworkStatsService extends INetworkStatsService.Stub {
     private static final String TAG = "NetworkStats";
-    private static final boolean LOGD = false;
     private static final boolean LOGV = false;
 
-    /** File header magic number: "ANET" */
-    private static final int FILE_MAGIC = 0x414E4554;
-    private static final int VERSION_NETWORK_INIT = 1;
-    private static final int VERSION_UID_INIT = 1;
-    private static final int VERSION_UID_WITH_IDENT = 2;
-    private static final int VERSION_UID_WITH_TAG = 3;
-    private static final int VERSION_UID_WITH_SET = 4;
-
     private static final int MSG_PERFORM_POLL = 1;
     private static final int MSG_UPDATE_IFACES = 2;
+    private static final int MSG_REGISTER_GLOBAL_ALERT = 3;
 
     /** Flags to control detail level of poll event. */
     private static final int FLAG_PERSIST_NETWORK = 0x1;
@@ -147,9 +129,6 @@
     private static final int FLAG_PERSIST_ALL = FLAG_PERSIST_NETWORK | FLAG_PERSIST_UID;
     private static final int FLAG_PERSIST_FORCE = 0x100;
 
-    /** Sample recent usage after each poll event. */
-    private static final boolean ENABLE_SAMPLE_AFTER_POLL = true;
-
     private static final String TAG_NETSTATS_ERROR = "netstats_error";
 
     private final Context mContext;
@@ -159,10 +138,12 @@
     private final TelephonyManager mTeleManager;
     private final NetworkStatsSettings mSettings;
 
+    private final File mSystemDir;
+    private final File mBaseDir;
+
     private final PowerManager.WakeLock mWakeLock;
 
     private IConnectivityManager mConnManager;
-    private DropBoxManager mDropBox;
 
     // @VisibleForTesting
     public static final String ACTION_NETWORK_STATS_POLL =
@@ -172,71 +153,72 @@
 
     private PendingIntent mPollIntent;
 
-    // TODO: trim empty history objects entirely
-
-    private static final long KB_IN_BYTES = 1024;
-    private static final long MB_IN_BYTES = 1024 * KB_IN_BYTES;
-    private static final long GB_IN_BYTES = 1024 * MB_IN_BYTES;
+    private static final String PREFIX_DEV = "dev";
+    private static final String PREFIX_UID = "uid";
+    private static final String PREFIX_UID_TAG = "uid_tag";
 
     /**
      * Settings that can be changed externally.
      */
     public interface NetworkStatsSettings {
         public long getPollInterval();
-        public long getPersistThreshold();
-        public long getNetworkBucketDuration();
-        public long getNetworkMaxHistory();
-        public long getUidBucketDuration();
-        public long getUidMaxHistory();
-        public long getTagMaxHistory();
         public long getTimeCacheMaxAge();
+        public long getGlobalAlertBytes();
+        public boolean getSampleEnabled();
+
+        public static class Config {
+            public final long bucketDuration;
+            public final long persistBytes;
+            public final long rotateAgeMillis;
+            public final long deleteAgeMillis;
+
+            public Config(long bucketDuration, long persistBytes, long rotateAgeMillis,
+                    long deleteAgeMillis) {
+                this.bucketDuration = bucketDuration;
+                this.persistBytes = persistBytes;
+                this.rotateAgeMillis = rotateAgeMillis;
+                this.deleteAgeMillis = deleteAgeMillis;
+            }
+        }
+
+        public Config getDevConfig();
+        public Config getUidConfig();
+        public Config getUidTagConfig();
     }
 
     private final Object mStatsLock = new Object();
 
     /** Set of currently active ifaces. */
     private HashMap<String, NetworkIdentitySet> mActiveIfaces = Maps.newHashMap();
-    /** Set of historical {@code dev} stats for known networks. */
-    private HashMap<NetworkIdentitySet, NetworkStatsHistory> mNetworkDevStats = Maps.newHashMap();
-    /** Set of historical {@code xtables} stats for known networks. */
-    private HashMap<NetworkIdentitySet, NetworkStatsHistory> mNetworkXtStats = Maps.newHashMap();
-    /** Set of historical {@code xtables} stats for known UIDs. */
-    private HashMap<UidStatsKey, NetworkStatsHistory> mUidStats = Maps.newHashMap();
+    /** Current default active iface. */
+    private String mActiveIface;
 
-    /** Flag if {@link #mNetworkDevStats} have been loaded from disk. */
-    private boolean mNetworkStatsLoaded = false;
-    /** Flag if {@link #mUidStats} have been loaded from disk. */
-    private boolean mUidStatsLoaded = false;
+    private final DropBoxNonMonotonicObserver mNonMonotonicObserver =
+            new DropBoxNonMonotonicObserver();
 
-    private NetworkStats mLastPollNetworkDevSnapshot;
-    private NetworkStats mLastPollNetworkXtSnapshot;
-    private NetworkStats mLastPollUidSnapshot;
-    private NetworkStats mLastPollOperationsSnapshot;
+    private NetworkStatsRecorder mDevRecorder;
+    private NetworkStatsRecorder mUidRecorder;
+    private NetworkStatsRecorder mUidTagRecorder;
 
-    private NetworkStats mLastPersistNetworkDevSnapshot;
-    private NetworkStats mLastPersistNetworkXtSnapshot;
-    private NetworkStats mLastPersistUidSnapshot;
+    /** Cached {@link #mDevRecorder} stats. */
+    private NetworkStatsCollection mDevStatsCached;
 
     /** Current counter sets for each UID. */
     private SparseIntArray mActiveUidCounterSet = new SparseIntArray();
 
     /** Data layer operation counters for splicing into other structures. */
-    private NetworkStats mOperations = new NetworkStats(0L, 10);
+    private NetworkStats mUidOperations = new NetworkStats(0L, 10);
 
     private final HandlerThread mHandlerThread;
     private final Handler mHandler;
 
-    private final AtomicFile mNetworkDevFile;
-    private final AtomicFile mNetworkXtFile;
-    private final AtomicFile mUidFile;
-
     public NetworkStatsService(
             Context context, INetworkManagementService networkManager, IAlarmManager alarmManager) {
         this(context, networkManager, alarmManager, NtpTrustedTime.getInstance(context),
-                getSystemDir(), new DefaultNetworkStatsSettings(context));
+                getDefaultSystemDir(), new DefaultNetworkStatsSettings(context));
     }
 
-    private static File getSystemDir() {
+    private static File getDefaultSystemDir() {
         return new File(Environment.getDataDirectory(), "system");
     }
 
@@ -258,9 +240,9 @@
         mHandlerThread.start();
         mHandler = new Handler(mHandlerThread.getLooper(), mHandlerCallback);
 
-        mNetworkDevFile = new AtomicFile(new File(systemDir, "netstats.bin"));
-        mNetworkXtFile = new AtomicFile(new File(systemDir, "netstats_xt.bin"));
-        mUidFile = new AtomicFile(new File(systemDir, "netstats_uid.bin"));
+        mSystemDir = checkNotNull(systemDir);
+        mBaseDir = new File(systemDir, "netstats");
+        mBaseDir.mkdirs();
     }
 
     public void bindConnectivityManager(IConnectivityManager connManager) {
@@ -273,17 +255,22 @@
             return;
         }
 
-        synchronized (mStatsLock) {
-            // read historical network stats from disk, since policy service
-            // might need them right away. we delay loading detailed UID stats
-            // until actually needed.
-            readNetworkDevStatsLocked();
-            readNetworkXtStatsLocked();
-            mNetworkStatsLoaded = true;
-        }
+        // create data recorders along with historical rotators
+        mDevRecorder = buildRecorder(PREFIX_DEV, mSettings.getDevConfig(), false);
+        mUidRecorder = buildRecorder(PREFIX_UID, mSettings.getUidConfig(), false);
+        mUidTagRecorder = buildRecorder(PREFIX_UID_TAG, mSettings.getUidTagConfig(), true);
 
-        // bootstrap initial stats to prevent double-counting later
-        bootstrapStats();
+        synchronized (mStatsLock) {
+            // upgrade any legacy stats, migrating them to rotated files
+            maybeUpgradeLegacyStatsLocked();
+
+            // read historical network stats from disk, since policy service
+            // might need them right away.
+            mDevStatsCached = mDevRecorder.getOrLoadCompleteLocked();
+
+            // bootstrap initial stats to prevent double-counting later
+            bootstrapStatsLocked();
+        }
 
         // watch for network interfaces to be claimed
         final IntentFilter connFilter = new IntentFilter(CONNECTIVITY_ACTION_IMMEDIATE);
@@ -317,8 +304,14 @@
 
         registerPollAlarmLocked();
         registerGlobalAlert();
+    }
 
-        mDropBox = (DropBoxManager) mContext.getSystemService(Context.DROPBOX_SERVICE);
+    private NetworkStatsRecorder buildRecorder(
+            String prefix, NetworkStatsSettings.Config config, boolean includeTags) {
+        return new NetworkStatsRecorder(
+                new FileRotator(mBaseDir, prefix, config.rotateAgeMillis, config.deleteAgeMillis),
+                mNonMonotonicObserver, prefix, config.bucketDuration, config.persistBytes,
+                includeTags);
     }
 
     private void shutdownLocked() {
@@ -330,18 +323,44 @@
 
         mTeleManager.listen(mPhoneListener, LISTEN_NONE);
 
-        if (mNetworkStatsLoaded) {
-            writeNetworkDevStatsLocked();
-            writeNetworkXtStatsLocked();
+        final long currentTime = mTime.hasCache() ? mTime.currentTimeMillis()
+                : System.currentTimeMillis();
+
+        // persist any pending stats
+        mDevRecorder.forcePersistLocked(currentTime);
+        mUidRecorder.forcePersistLocked(currentTime);
+        mUidTagRecorder.forcePersistLocked(currentTime);
+
+        mDevRecorder = null;
+        mUidRecorder = null;
+        mUidTagRecorder = null;
+
+        mDevStatsCached = null;
+    }
+
+    private void maybeUpgradeLegacyStatsLocked() {
+        File file;
+        try {
+            file = new File(mSystemDir, "netstats.bin");
+            if (file.exists()) {
+                mDevRecorder.importLegacyNetworkLocked(file);
+                file.delete();
+            }
+
+            file = new File(mSystemDir, "netstats_xt.bin");
+            if (file.exists()) {
+                file.delete();
+            }
+
+            file = new File(mSystemDir, "netstats_uid.bin");
+            if (file.exists()) {
+                mUidRecorder.importLegacyUidLocked(file);
+                mUidTagRecorder.importLegacyUidLocked(file);
+                file.delete();
+            }
+        } catch (IOException e) {
+            Log.wtf(TAG, "problem during legacy upgrade", e);
         }
-        if (mUidStatsLoaded) {
-            writeUidStatsLocked();
-        }
-        mNetworkDevStats.clear();
-        mNetworkXtStats.clear();
-        mUidStats.clear();
-        mNetworkStatsLoaded = false;
-        mUidStatsLoaded = false;
     }
 
     /**
@@ -372,7 +391,7 @@
      */
     private void registerGlobalAlert() {
         try {
-            final long alertBytes = mSettings.getPersistThreshold();
+            final long alertBytes = mSettings.getGlobalAlertBytes();
             mNetworkManager.setGlobalAlert(alertBytes);
         } catch (IllegalStateException e) {
             Slog.w(TAG, "problem registering for global alert: " + e);
@@ -383,161 +402,39 @@
 
     @Override
     public NetworkStatsHistory getHistoryForNetwork(NetworkTemplate template, int fields) {
-        mContext.enforceCallingOrSelfPermission(READ_NETWORK_USAGE_HISTORY, TAG);
-        return getHistoryForNetworkDev(template, fields);
+        return mDevStatsCached.getHistory(template, UID_ALL, SET_ALL, TAG_NONE, fields);
     }
 
-    private NetworkStatsHistory getHistoryForNetworkDev(NetworkTemplate template, int fields) {
-        return getHistoryForNetwork(template, fields, mNetworkDevStats);
-    }
-
-    private NetworkStatsHistory getHistoryForNetworkXt(NetworkTemplate template, int fields) {
-        return getHistoryForNetwork(template, fields, mNetworkXtStats);
-    }
-
-    private NetworkStatsHistory getHistoryForNetwork(NetworkTemplate template, int fields,
-            HashMap<NetworkIdentitySet, NetworkStatsHistory> source) {
-        synchronized (mStatsLock) {
-            // combine all interfaces that match template
-            final NetworkStatsHistory combined = new NetworkStatsHistory(
-                    mSettings.getNetworkBucketDuration(), estimateNetworkBuckets(), fields);
-            for (NetworkIdentitySet ident : source.keySet()) {
-                if (templateMatches(template, ident)) {
-                    final NetworkStatsHistory history = source.get(ident);
-                    if (history != null) {
-                        combined.recordEntireHistory(history);
-                    }
-                }
-            }
-            return combined;
-        }
+    @Override
+    public NetworkStats getSummaryForNetwork(NetworkTemplate template, long start, long end) {
+        return mDevStatsCached.getSummary(template, start, end);
     }
 
     @Override
     public NetworkStatsHistory getHistoryForUid(
             NetworkTemplate template, int uid, int set, int tag, int fields) {
-        mContext.enforceCallingOrSelfPermission(READ_NETWORK_USAGE_HISTORY, TAG);
-
-        synchronized (mStatsLock) {
-            ensureUidStatsLoadedLocked();
-
-            // combine all interfaces that match template
-            final NetworkStatsHistory combined = new NetworkStatsHistory(
-                    mSettings.getUidBucketDuration(), estimateUidBuckets(), fields);
-            for (UidStatsKey key : mUidStats.keySet()) {
-                final boolean setMatches = set == SET_ALL || key.set == set;
-                if (templateMatches(template, key.ident) && key.uid == uid && setMatches
-                        && key.tag == tag) {
-                    final NetworkStatsHistory history = mUidStats.get(key);
-                    combined.recordEntireHistory(history);
-                }
-            }
-
-            return combined;
+        // TODO: transition to stats sessions to avoid WeakReferences
+        if (tag == TAG_NONE) {
+            return mUidRecorder.getOrLoadCompleteLocked().getHistory(
+                    template, uid, set, tag, fields);
+        } else {
+            return mUidTagRecorder.getOrLoadCompleteLocked().getHistory(
+                    template, uid, set, tag, fields);
         }
     }
 
     @Override
-    public NetworkStats getSummaryForNetwork(NetworkTemplate template, long start, long end) {
-        mContext.enforceCallingOrSelfPermission(READ_NETWORK_USAGE_HISTORY, TAG);
-        return getSummaryForNetworkDev(template, start, end);
-    }
-
-    private NetworkStats getSummaryForNetworkDev(NetworkTemplate template, long start, long end) {
-        return getSummaryForNetwork(template, start, end, mNetworkDevStats);
-    }
-
-    private NetworkStats getSummaryForNetworkXt(NetworkTemplate template, long start, long end) {
-        return getSummaryForNetwork(template, start, end, mNetworkXtStats);
-    }
-
-    private NetworkStats getSummaryForNetwork(NetworkTemplate template, long start, long end,
-            HashMap<NetworkIdentitySet, NetworkStatsHistory> source) {
-        synchronized (mStatsLock) {
-            // use system clock to be externally consistent
-            final long now = System.currentTimeMillis();
-
-            final NetworkStats stats = new NetworkStats(end - start, 1);
-            final NetworkStats.Entry entry = new NetworkStats.Entry();
-            NetworkStatsHistory.Entry historyEntry = null;
-
-            // combine total from all interfaces that match template
-            for (NetworkIdentitySet ident : source.keySet()) {
-                if (templateMatches(template, ident)) {
-                    final NetworkStatsHistory history = source.get(ident);
-                    historyEntry = history.getValues(start, end, now, historyEntry);
-
-                    entry.iface = IFACE_ALL;
-                    entry.uid = UID_ALL;
-                    entry.tag = TAG_NONE;
-                    entry.rxBytes = historyEntry.rxBytes;
-                    entry.rxPackets = historyEntry.rxPackets;
-                    entry.txBytes = historyEntry.txBytes;
-                    entry.txPackets = historyEntry.txPackets;
-
-                    stats.combineValues(entry);
-                }
-            }
-
-            return stats;
-        }
-    }
-
-    private long getHistoryStartLocked(
-            NetworkTemplate template, HashMap<NetworkIdentitySet, NetworkStatsHistory> source) {
-        long start = Long.MAX_VALUE;
-        for (NetworkIdentitySet ident : source.keySet()) {
-            if (templateMatches(template, ident)) {
-                final NetworkStatsHistory history = source.get(ident);
-                start = Math.min(start, history.getStart());
-            }
-        }
-        return start;
-    }
-
-    @Override
     public NetworkStats getSummaryForAllUid(
             NetworkTemplate template, long start, long end, boolean includeTags) {
-        mContext.enforceCallingOrSelfPermission(READ_NETWORK_USAGE_HISTORY, TAG);
-
-        synchronized (mStatsLock) {
-            ensureUidStatsLoadedLocked();
-
-            // use system clock to be externally consistent
-            final long now = System.currentTimeMillis();
-
-            final NetworkStats stats = new NetworkStats(end - start, 24);
-            final NetworkStats.Entry entry = new NetworkStats.Entry();
-            NetworkStatsHistory.Entry historyEntry = null;
-
-            for (UidStatsKey key : mUidStats.keySet()) {
-                if (templateMatches(template, key.ident)) {
-                    // always include summary under TAG_NONE, and include
-                    // other tags when requested.
-                    if (key.tag == TAG_NONE || includeTags) {
-                        final NetworkStatsHistory history = mUidStats.get(key);
-                        historyEntry = history.getValues(start, end, now, historyEntry);
-
-                        entry.iface = IFACE_ALL;
-                        entry.uid = key.uid;
-                        entry.set = key.set;
-                        entry.tag = key.tag;
-                        entry.rxBytes = historyEntry.rxBytes;
-                        entry.rxPackets = historyEntry.rxPackets;
-                        entry.txBytes = historyEntry.txBytes;
-                        entry.txPackets = historyEntry.txPackets;
-                        entry.operations = historyEntry.operations;
-
-                        if (entry.rxBytes > 0 || entry.rxPackets > 0 || entry.txBytes > 0
-                                || entry.txPackets > 0 || entry.operations > 0) {
-                            stats.combineValues(entry);
-                        }
-                    }
-                }
-            }
-
-            return stats;
+        // TODO: transition to stats sessions to avoid WeakReferences
+        final NetworkStats stats = mUidRecorder.getOrLoadCompleteLocked().getSummary(
+                template, start, end);
+        if (includeTags) {
+            final NetworkStats tagStats = mUidTagRecorder.getOrLoadCompleteLocked().getSummary(
+                    template, start, end);
+            stats.combineAllValues(tagStats);
         }
+        return stats;
     }
 
     @Override
@@ -567,7 +464,7 @@
         }
 
         // splice in operation counts
-        dataLayer.spliceOperationsFrom(mOperations);
+        dataLayer.spliceOperationsFrom(mUidOperations);
         return dataLayer;
     }
 
@@ -586,8 +483,10 @@
 
         synchronized (mStatsLock) {
             final int set = mActiveUidCounterSet.get(uid, SET_DEFAULT);
-            mOperations.combineValues(IFACE_ALL, uid, set, tag, 0L, 0L, 0L, 0L, operationCount);
-            mOperations.combineValues(IFACE_ALL, uid, set, TAG_NONE, 0L, 0L, 0L, 0L, operationCount);
+            mUidOperations.combineValues(
+                    mActiveIface, uid, set, tag, 0L, 0L, 0L, 0L, operationCount);
+            mUidOperations.combineValues(
+                    mActiveIface, uid, set, TAG_NONE, 0L, 0L, 0L, 0L, operationCount);
         }
     }
 
@@ -608,7 +507,13 @@
     @Override
     public void forceUpdate() {
         mContext.enforceCallingOrSelfPermission(READ_NETWORK_USAGE_HISTORY, TAG);
-        performPoll(FLAG_PERSIST_ALL);
+
+        final long token = Binder.clearCallingIdentity();
+        try {
+            performPoll(FLAG_PERSIST_ALL);
+        } finally {
+            Binder.restoreCallingIdentity(token);
+        }
     }
 
     /**
@@ -692,7 +597,7 @@
                 mHandler.obtainMessage(MSG_PERFORM_POLL, flags, 0).sendToTarget();
 
                 // re-arm global alert for next update
-                registerGlobalAlert();
+                mHandler.obtainMessage(MSG_REGISTER_GLOBAL_ALERT).sendToTarget();
             }
         }
     };
@@ -755,13 +660,17 @@
         performPollLocked(FLAG_PERSIST_NETWORK);
 
         final NetworkState[] states;
+        final LinkProperties activeLink;
         try {
             states = mConnManager.getAllNetworkState();
+            activeLink = mConnManager.getActiveLinkProperties();
         } catch (RemoteException e) {
             // ignored; service lives in system_server
             return;
         }
 
+        mActiveIface = activeLink != null ? activeLink.getInterfaceName() : null;
+
         // rebuild active interfaces based on connected networks
         mActiveIfaces.clear();
 
@@ -785,12 +694,20 @@
      * Bootstrap initial stats snapshot, usually during {@link #systemReady()}
      * so we have baseline values without double-counting.
      */
-    private void bootstrapStats() {
+    private void bootstrapStatsLocked() {
+        final long currentTime = mTime.hasCache() ? mTime.currentTimeMillis()
+                : System.currentTimeMillis();
+
         try {
-            mLastPollUidSnapshot = mNetworkManager.getNetworkStatsUidDetail(UID_ALL);
-            mLastPollNetworkDevSnapshot = mNetworkManager.getNetworkStatsSummary();
-            mLastPollNetworkXtSnapshot = computeNetworkXtSnapshotFromUid(mLastPollUidSnapshot);
-            mLastPollOperationsSnapshot = new NetworkStats(0L, 0);
+            // snapshot and record current counters; read UID stats first to
+            // avoid overcounting dev stats.
+            final NetworkStats uidSnapshot = getNetworkStatsUidDetail();
+            final NetworkStats devSnapshot = getNetworkStatsSummary();
+
+            mDevRecorder.recordSnapshotLocked(devSnapshot, mActiveIfaces, currentTime);
+            mUidRecorder.recordSnapshotLocked(uidSnapshot, mActiveIfaces, currentTime);
+            mUidTagRecorder.recordSnapshotLocked(uidSnapshot, mActiveIfaces, currentTime);
+
         } catch (IllegalStateException e) {
             Slog.w(TAG, "problem reading network stats: " + e);
         } catch (RemoteException e) {
@@ -830,27 +747,16 @@
         // TODO: consider marking "untrusted" times in historical stats
         final long currentTime = mTime.hasCache() ? mTime.currentTimeMillis()
                 : System.currentTimeMillis();
-        final long threshold = mSettings.getPersistThreshold();
 
-        final NetworkStats uidSnapshot;
-        final NetworkStats networkXtSnapshot;
-        final NetworkStats networkDevSnapshot;
         try {
-            // collect any tethering stats
-            final NetworkStats tetherSnapshot = getNetworkStatsTethering();
+            // snapshot and record current counters; read UID stats first to
+            // avoid overcounting dev stats.
+            final NetworkStats uidSnapshot = getNetworkStatsUidDetail();
+            final NetworkStats devSnapshot = getNetworkStatsSummary();
 
-            // record uid stats, folding in tethering stats
-            uidSnapshot = mNetworkManager.getNetworkStatsUidDetail(UID_ALL);
-            uidSnapshot.combineAllValues(tetherSnapshot);
-            performUidPollLocked(uidSnapshot, currentTime);
-
-            // record dev network stats
-            networkDevSnapshot = mNetworkManager.getNetworkStatsSummary();
-            performNetworkDevPollLocked(networkDevSnapshot, currentTime);
-
-            // record xt network stats
-            networkXtSnapshot = computeNetworkXtSnapshotFromUid(uidSnapshot);
-            performNetworkXtPollLocked(networkXtSnapshot, currentTime);
+            mDevRecorder.recordSnapshotLocked(devSnapshot, mActiveIfaces, currentTime);
+            mUidRecorder.recordSnapshotLocked(uidSnapshot, mActiveIfaces, currentTime);
+            mUidTagRecorder.recordSnapshotLocked(uidSnapshot, mActiveIfaces, currentTime);
 
         } catch (IllegalStateException e) {
             Log.wtf(TAG, "problem reading network stats", e);
@@ -860,26 +766,19 @@
             return;
         }
 
-        // persist when enough network data has occurred
-        final long persistNetworkDevDelta = computeStatsDelta(
-                mLastPersistNetworkDevSnapshot, networkDevSnapshot, true, "devp").getTotalBytes();
-        final long persistNetworkXtDelta = computeStatsDelta(
-                mLastPersistNetworkXtSnapshot, networkXtSnapshot, true, "xtp").getTotalBytes();
-        final boolean networkOverThreshold = persistNetworkDevDelta > threshold
-                || persistNetworkXtDelta > threshold;
-        if (persistForce || (persistNetwork && networkOverThreshold)) {
-            writeNetworkDevStatsLocked();
-            writeNetworkXtStatsLocked();
-            mLastPersistNetworkDevSnapshot = networkDevSnapshot;
-            mLastPersistNetworkXtSnapshot = networkXtSnapshot;
-        }
-
-        // persist when enough uid data has occurred
-        final long persistUidDelta = computeStatsDelta(
-                mLastPersistUidSnapshot, uidSnapshot, true, "uidp").getTotalBytes();
-        if (persistForce || (persistUid && persistUidDelta > threshold)) {
-            writeUidStatsLocked();
-            mLastPersistUidSnapshot = uidSnapshot;
+        // persist any pending data depending on requested flags
+        if (persistForce) {
+            mDevRecorder.forcePersistLocked(currentTime);
+            mUidRecorder.forcePersistLocked(currentTime);
+            mUidTagRecorder.forcePersistLocked(currentTime);
+        } else {
+            if (persistNetwork) {
+                mDevRecorder.maybePersistLocked(currentTime);
+            }
+            if (persistUid) {
+                mUidRecorder.maybePersistLocked(currentTime);
+                mUidTagRecorder.maybePersistLocked(currentTime);
+            }
         }
 
         if (LOGV) {
@@ -887,9 +786,9 @@
             Slog.v(TAG, "performPollLocked() took " + duration + "ms");
         }
 
-        if (ENABLE_SAMPLE_AFTER_POLL) {
+        if (mSettings.getSampleEnabled()) {
             // sample stats after each full poll
-            performSample();
+            performSampleLocked();
         }
 
         // finally, dispatch updated event to any listeners
@@ -899,511 +798,58 @@
     }
 
     /**
-     * Update {@link #mNetworkDevStats} historical usage.
-     */
-    private void performNetworkDevPollLocked(NetworkStats networkDevSnapshot, long currentTime) {
-        final HashSet<String> unknownIface = Sets.newHashSet();
-
-        final NetworkStats delta = computeStatsDelta(
-                mLastPollNetworkDevSnapshot, networkDevSnapshot, false, "dev");
-        final long timeStart = currentTime - delta.getElapsedRealtime();
-
-        NetworkStats.Entry entry = null;
-        for (int i = 0; i < delta.size(); i++) {
-            entry = delta.getValues(i, entry);
-            final NetworkIdentitySet ident = mActiveIfaces.get(entry.iface);
-            if (ident == null) {
-                unknownIface.add(entry.iface);
-                continue;
-            }
-
-            final NetworkStatsHistory history = findOrCreateNetworkDevStatsLocked(ident);
-            history.recordData(timeStart, currentTime, entry);
-        }
-
-        mLastPollNetworkDevSnapshot = networkDevSnapshot;
-
-        if (LOGD && unknownIface.size() > 0) {
-            Slog.w(TAG, "unknown dev interfaces " + unknownIface + ", ignoring those stats");
-        }
-    }
-
-    /**
-     * Update {@link #mNetworkXtStats} historical usage.
-     */
-    private void performNetworkXtPollLocked(NetworkStats networkXtSnapshot, long currentTime) {
-        final HashSet<String> unknownIface = Sets.newHashSet();
-
-        final NetworkStats delta = computeStatsDelta(
-                mLastPollNetworkXtSnapshot, networkXtSnapshot, false, "xt");
-        final long timeStart = currentTime - delta.getElapsedRealtime();
-
-        NetworkStats.Entry entry = null;
-        for (int i = 0; i < delta.size(); i++) {
-            entry = delta.getValues(i, entry);
-            final NetworkIdentitySet ident = mActiveIfaces.get(entry.iface);
-            if (ident == null) {
-                unknownIface.add(entry.iface);
-                continue;
-            }
-
-            final NetworkStatsHistory history = findOrCreateNetworkXtStatsLocked(ident);
-            history.recordData(timeStart, currentTime, entry);
-        }
-
-        mLastPollNetworkXtSnapshot = networkXtSnapshot;
-
-        if (LOGD && unknownIface.size() > 0) {
-            Slog.w(TAG, "unknown xt interfaces " + unknownIface + ", ignoring those stats");
-        }
-    }
-
-    /**
-     * Update {@link #mUidStats} historical usage.
-     */
-    private void performUidPollLocked(NetworkStats uidSnapshot, long currentTime) {
-        ensureUidStatsLoadedLocked();
-
-        final NetworkStats delta = computeStatsDelta(
-                mLastPollUidSnapshot, uidSnapshot, false, "uid");
-        final NetworkStats operationsDelta = computeStatsDelta(
-                mLastPollOperationsSnapshot, mOperations, false, "uidop");
-        final long timeStart = currentTime - delta.getElapsedRealtime();
-
-        NetworkStats.Entry entry = null;
-        NetworkStats.Entry operationsEntry = null;
-        for (int i = 0; i < delta.size(); i++) {
-            entry = delta.getValues(i, entry);
-            final NetworkIdentitySet ident = mActiveIfaces.get(entry.iface);
-            if (ident == null) {
-                if (entry.rxBytes > 0 || entry.rxPackets > 0 || entry.txBytes > 0
-                        || entry.txPackets > 0) {
-                    Log.w(TAG, "dropping UID delta from unknown iface: " + entry);
-                }
-                continue;
-            }
-
-            // splice in operation counts since last poll
-            final int j = operationsDelta.findIndex(IFACE_ALL, entry.uid, entry.set, entry.tag);
-            if (j != -1) {
-                operationsEntry = operationsDelta.getValues(j, operationsEntry);
-                entry.operations = operationsEntry.operations;
-            }
-
-            final NetworkStatsHistory history = findOrCreateUidStatsLocked(
-                    ident, entry.uid, entry.set, entry.tag);
-            history.recordData(timeStart, currentTime, entry);
-        }
-
-        mLastPollUidSnapshot = uidSnapshot;
-        mLastPollOperationsSnapshot = mOperations.clone();
-    }
-
-    /**
      * Sample recent statistics summary into {@link EventLog}.
      */
-    private void performSample() {
-        final long largestBucketSize = Math.max(
-                mSettings.getNetworkBucketDuration(), mSettings.getUidBucketDuration());
-
-        // take sample as atomic buckets
-        final long now = mTime.hasCache() ? mTime.currentTimeMillis() : System.currentTimeMillis();
-        final long end = now - (now % largestBucketSize) + largestBucketSize;
-        final long start = end - largestBucketSize;
-
+    private void performSampleLocked() {
+        // TODO: migrate trustedtime fixes to separate binary log events
         final long trustedTime = mTime.hasCache() ? mTime.currentTimeMillis() : -1;
-        long devHistoryStart = Long.MAX_VALUE;
 
-        NetworkTemplate template = null;
-        NetworkStats.Entry devTotal = null;
-        NetworkStats.Entry xtTotal = null;
-        NetworkStats.Entry uidTotal = null;
+        NetworkTemplate template;
+        NetworkStats.Entry devTotal;
+        NetworkStats.Entry xtTotal;
+        NetworkStats.Entry uidTotal;
 
         // collect mobile sample
         template = buildTemplateMobileAll(getActiveSubscriberId(mContext));
-        devTotal = getSummaryForNetworkDev(template, start, end).getTotal(devTotal);
-        devHistoryStart = getHistoryStartLocked(template, mNetworkDevStats);
-        xtTotal = getSummaryForNetworkXt(template, start, end).getTotal(xtTotal);
-        uidTotal = getSummaryForAllUid(template, start, end, false).getTotal(uidTotal);
+        devTotal = mDevRecorder.getTotalSinceBootLocked(template);
+        xtTotal = new NetworkStats.Entry();
+        uidTotal = mUidRecorder.getTotalSinceBootLocked(template);
 
         EventLogTags.writeNetstatsMobileSample(
                 devTotal.rxBytes, devTotal.rxPackets, devTotal.txBytes, devTotal.txPackets,
                 xtTotal.rxBytes, xtTotal.rxPackets, xtTotal.txBytes, xtTotal.txPackets,
                 uidTotal.rxBytes, uidTotal.rxPackets, uidTotal.txBytes, uidTotal.txPackets,
-                trustedTime, devHistoryStart);
+                trustedTime);
 
         // collect wifi sample
         template = buildTemplateWifi();
-        devTotal = getSummaryForNetworkDev(template, start, end).getTotal(devTotal);
-        devHistoryStart = getHistoryStartLocked(template, mNetworkDevStats);
-        xtTotal = getSummaryForNetworkXt(template, start, end).getTotal(xtTotal);
-        uidTotal = getSummaryForAllUid(template, start, end, false).getTotal(uidTotal);
+        devTotal = mDevRecorder.getTotalSinceBootLocked(template);
+        xtTotal = new NetworkStats.Entry();
+        uidTotal = mUidRecorder.getTotalSinceBootLocked(template);
+
         EventLogTags.writeNetstatsWifiSample(
                 devTotal.rxBytes, devTotal.rxPackets, devTotal.txBytes, devTotal.txPackets,
                 xtTotal.rxBytes, xtTotal.rxPackets, xtTotal.txBytes, xtTotal.txPackets,
                 uidTotal.rxBytes, uidTotal.rxPackets, uidTotal.txBytes, uidTotal.txPackets,
-                trustedTime, devHistoryStart);
+                trustedTime);
     }
 
     /**
-     * Clean up {@link #mUidStats} after UID is removed.
+     * Clean up {@link #mUidRecorder} after UID is removed.
      */
     private void removeUidLocked(int uid) {
-        ensureUidStatsLoadedLocked();
-
         // perform one last poll before removing
         performPollLocked(FLAG_PERSIST_ALL);
 
-        final ArrayList<UidStatsKey> knownKeys = Lists.newArrayList();
-        knownKeys.addAll(mUidStats.keySet());
-
-        // migrate all UID stats into special "removed" bucket
-        for (UidStatsKey key : knownKeys) {
-            if (key.uid == uid) {
-                // only migrate combined TAG_NONE history
-                if (key.tag == TAG_NONE) {
-                    final NetworkStatsHistory uidHistory = mUidStats.get(key);
-                    final NetworkStatsHistory removedHistory = findOrCreateUidStatsLocked(
-                            key.ident, UID_REMOVED, SET_DEFAULT, TAG_NONE);
-                    removedHistory.recordEntireHistory(uidHistory);
-                }
-                mUidStats.remove(key);
-            }
-        }
-
-        // clear UID from current stats snapshot
-        if (mLastPollUidSnapshot != null) {
-            mLastPollUidSnapshot = mLastPollUidSnapshot.withoutUid(uid);
-            mLastPollNetworkXtSnapshot = computeNetworkXtSnapshotFromUid(mLastPollUidSnapshot);
-        }
+        mUidRecorder.removeUidLocked(uid);
+        mUidTagRecorder.removeUidLocked(uid);
 
         // clear kernel stats associated with UID
         resetKernelUidStats(uid);
-
-        // since this was radical rewrite, push to disk
-        writeUidStatsLocked();
-    }
-
-    private NetworkStatsHistory findOrCreateNetworkXtStatsLocked(NetworkIdentitySet ident) {
-        return findOrCreateNetworkStatsLocked(ident, mNetworkXtStats);
-    }
-
-    private NetworkStatsHistory findOrCreateNetworkDevStatsLocked(NetworkIdentitySet ident) {
-        return findOrCreateNetworkStatsLocked(ident, mNetworkDevStats);
-    }
-
-    private NetworkStatsHistory findOrCreateNetworkStatsLocked(
-            NetworkIdentitySet ident, HashMap<NetworkIdentitySet, NetworkStatsHistory> source) {
-        final NetworkStatsHistory existing = source.get(ident);
-
-        // update when no existing, or when bucket duration changed
-        final long bucketDuration = mSettings.getNetworkBucketDuration();
-        NetworkStatsHistory updated = null;
-        if (existing == null) {
-            updated = new NetworkStatsHistory(bucketDuration, 10);
-        } else if (existing.getBucketDuration() != bucketDuration) {
-            updated = new NetworkStatsHistory(
-                    bucketDuration, estimateResizeBuckets(existing, bucketDuration));
-            updated.recordEntireHistory(existing);
-        }
-
-        if (updated != null) {
-            source.put(ident, updated);
-            return updated;
-        } else {
-            return existing;
-        }
-    }
-
-    private NetworkStatsHistory findOrCreateUidStatsLocked(
-            NetworkIdentitySet ident, int uid, int set, int tag) {
-        ensureUidStatsLoadedLocked();
-
-        final UidStatsKey key = new UidStatsKey(ident, uid, set, tag);
-        final NetworkStatsHistory existing = mUidStats.get(key);
-
-        // update when no existing, or when bucket duration changed
-        final long bucketDuration = mSettings.getUidBucketDuration();
-        NetworkStatsHistory updated = null;
-        if (existing == null) {
-            updated = new NetworkStatsHistory(bucketDuration, 10);
-        } else if (existing.getBucketDuration() != bucketDuration) {
-            updated = new NetworkStatsHistory(
-                    bucketDuration, estimateResizeBuckets(existing, bucketDuration));
-            updated.recordEntireHistory(existing);
-        }
-
-        if (updated != null) {
-            mUidStats.put(key, updated);
-            return updated;
-        } else {
-            return existing;
-        }
-    }
-
-    private void readNetworkDevStatsLocked() {
-        if (LOGV) Slog.v(TAG, "readNetworkDevStatsLocked()");
-        readNetworkStats(mNetworkDevFile, mNetworkDevStats);
-    }
-
-    private void readNetworkXtStatsLocked() {
-        if (LOGV) Slog.v(TAG, "readNetworkXtStatsLocked()");
-        readNetworkStats(mNetworkXtFile, mNetworkXtStats);
-    }
-
-    private static void readNetworkStats(
-            AtomicFile inputFile, HashMap<NetworkIdentitySet, NetworkStatsHistory> output) {
-        // clear any existing stats and read from disk
-        output.clear();
-
-        DataInputStream in = null;
-        try {
-            in = new DataInputStream(new BufferedInputStream(inputFile.openRead()));
-
-            // verify file magic header intact
-            final int magic = in.readInt();
-            if (magic != FILE_MAGIC) {
-                throw new ProtocolException("unexpected magic: " + magic);
-            }
-
-            final int version = in.readInt();
-            switch (version) {
-                case VERSION_NETWORK_INIT: {
-                    // network := size *(NetworkIdentitySet NetworkStatsHistory)
-                    final int size = in.readInt();
-                    for (int i = 0; i < size; i++) {
-                        final NetworkIdentitySet ident = new NetworkIdentitySet(in);
-                        final NetworkStatsHistory history = new NetworkStatsHistory(in);
-                        output.put(ident, history);
-                    }
-                    break;
-                }
-                default: {
-                    throw new ProtocolException("unexpected version: " + version);
-                }
-            }
-        } catch (FileNotFoundException e) {
-            // missing stats is okay, probably first boot
-        } catch (IOException e) {
-            Log.wtf(TAG, "problem reading network stats", e);
-        } finally {
-            IoUtils.closeQuietly(in);
-        }
-    }
-
-    private void ensureUidStatsLoadedLocked() {
-        if (!mUidStatsLoaded) {
-            readUidStatsLocked();
-            mUidStatsLoaded = true;
-        }
-    }
-
-    private void readUidStatsLocked() {
-        if (LOGV) Slog.v(TAG, "readUidStatsLocked()");
-
-        // clear any existing stats and read from disk
-        mUidStats.clear();
-
-        DataInputStream in = null;
-        try {
-            in = new DataInputStream(new BufferedInputStream(mUidFile.openRead()));
-
-            // verify file magic header intact
-            final int magic = in.readInt();
-            if (magic != FILE_MAGIC) {
-                throw new ProtocolException("unexpected magic: " + magic);
-            }
-
-            final int version = in.readInt();
-            switch (version) {
-                case VERSION_UID_INIT: {
-                    // uid := size *(UID NetworkStatsHistory)
-
-                    // drop this data version, since we don't have a good
-                    // mapping into NetworkIdentitySet.
-                    break;
-                }
-                case VERSION_UID_WITH_IDENT: {
-                    // uid := size *(NetworkIdentitySet size *(UID NetworkStatsHistory))
-
-                    // drop this data version, since this version only existed
-                    // for a short time.
-                    break;
-                }
-                case VERSION_UID_WITH_TAG:
-                case VERSION_UID_WITH_SET: {
-                    // uid := size *(NetworkIdentitySet size *(uid set tag NetworkStatsHistory))
-                    final int identSize = in.readInt();
-                    for (int i = 0; i < identSize; i++) {
-                        final NetworkIdentitySet ident = new NetworkIdentitySet(in);
-
-                        final int size = in.readInt();
-                        for (int j = 0; j < size; j++) {
-                            final int uid = in.readInt();
-                            final int set = (version >= VERSION_UID_WITH_SET) ? in.readInt()
-                                    : SET_DEFAULT;
-                            final int tag = in.readInt();
-
-                            final UidStatsKey key = new UidStatsKey(ident, uid, set, tag);
-                            final NetworkStatsHistory history = new NetworkStatsHistory(in);
-                            mUidStats.put(key, history);
-                        }
-                    }
-                    break;
-                }
-                default: {
-                    throw new ProtocolException("unexpected version: " + version);
-                }
-            }
-        } catch (FileNotFoundException e) {
-            // missing stats is okay, probably first boot
-        } catch (IOException e) {
-            Log.wtf(TAG, "problem reading uid stats", e);
-        } finally {
-            IoUtils.closeQuietly(in);
-        }
-    }
-
-    private void writeNetworkDevStatsLocked() {
-        if (LOGV) Slog.v(TAG, "writeNetworkDevStatsLocked()");
-        writeNetworkStats(mNetworkDevStats, mNetworkDevFile);
-    }
-
-    private void writeNetworkXtStatsLocked() {
-        if (LOGV) Slog.v(TAG, "writeNetworkXtStatsLocked()");
-        writeNetworkStats(mNetworkXtStats, mNetworkXtFile);
-    }
-
-    private void writeNetworkStats(
-            HashMap<NetworkIdentitySet, NetworkStatsHistory> input, AtomicFile outputFile) {
-        // TODO: consider duplicating stats and releasing lock while writing
-
-        // trim any history beyond max
-        if (mTime.hasCache()) {
-            final long systemCurrentTime = System.currentTimeMillis();
-            final long trustedCurrentTime = mTime.currentTimeMillis();
-
-            final long currentTime = Math.min(systemCurrentTime, trustedCurrentTime);
-            final long maxHistory = mSettings.getNetworkMaxHistory();
-
-            for (NetworkStatsHistory history : input.values()) {
-                final int beforeSize = history.size();
-                history.removeBucketsBefore(currentTime - maxHistory);
-                final int afterSize = history.size();
-
-                if (beforeSize > 24 && afterSize < beforeSize / 2) {
-                    // yikes, dropping more than half of significant history
-                    final StringBuilder builder = new StringBuilder();
-                    builder.append("yikes, dropping more than half of history").append('\n');
-                    builder.append("systemCurrentTime=").append(systemCurrentTime).append('\n');
-                    builder.append("trustedCurrentTime=").append(trustedCurrentTime).append('\n');
-                    builder.append("maxHistory=").append(maxHistory).append('\n');
-                    builder.append("beforeSize=").append(beforeSize).append('\n');
-                    builder.append("afterSize=").append(afterSize).append('\n');
-                    mDropBox.addText(TAG_NETSTATS_ERROR, builder.toString());
-                }
-            }
-        }
-
-        FileOutputStream fos = null;
-        try {
-            fos = outputFile.startWrite();
-            final DataOutputStream out = new DataOutputStream(new BufferedOutputStream(fos));
-
-            out.writeInt(FILE_MAGIC);
-            out.writeInt(VERSION_NETWORK_INIT);
-
-            out.writeInt(input.size());
-            for (NetworkIdentitySet ident : input.keySet()) {
-                final NetworkStatsHistory history = input.get(ident);
-                ident.writeToStream(out);
-                history.writeToStream(out);
-            }
-
-            out.flush();
-            outputFile.finishWrite(fos);
-        } catch (IOException e) {
-            Log.wtf(TAG, "problem writing stats", e);
-            if (fos != null) {
-                outputFile.failWrite(fos);
-            }
-        }
-    }
-
-    private void writeUidStatsLocked() {
-        if (LOGV) Slog.v(TAG, "writeUidStatsLocked()");
-
-        if (!mUidStatsLoaded) {
-            Slog.w(TAG, "asked to write UID stats when not loaded; skipping");
-            return;
-        }
-
-        // TODO: consider duplicating stats and releasing lock while writing
-
-        // trim any history beyond max
-        if (mTime.hasCache()) {
-            final long currentTime = Math.min(
-                    System.currentTimeMillis(), mTime.currentTimeMillis());
-            final long maxUidHistory = mSettings.getUidMaxHistory();
-            final long maxTagHistory = mSettings.getTagMaxHistory();
-            for (UidStatsKey key : mUidStats.keySet()) {
-                final NetworkStatsHistory history = mUidStats.get(key);
-
-                // detailed tags are trimmed sooner than summary in TAG_NONE
-                if (key.tag == TAG_NONE) {
-                    history.removeBucketsBefore(currentTime - maxUidHistory);
-                } else {
-                    history.removeBucketsBefore(currentTime - maxTagHistory);
-                }
-            }
-        }
-
-        // build UidStatsKey lists grouped by ident
-        final HashMap<NetworkIdentitySet, ArrayList<UidStatsKey>> keysByIdent = Maps.newHashMap();
-        for (UidStatsKey key : mUidStats.keySet()) {
-            ArrayList<UidStatsKey> keys = keysByIdent.get(key.ident);
-            if (keys == null) {
-                keys = Lists.newArrayList();
-                keysByIdent.put(key.ident, keys);
-            }
-            keys.add(key);
-        }
-
-        FileOutputStream fos = null;
-        try {
-            fos = mUidFile.startWrite();
-            final DataOutputStream out = new DataOutputStream(new BufferedOutputStream(fos));
-
-            out.writeInt(FILE_MAGIC);
-            out.writeInt(VERSION_UID_WITH_SET);
-
-            out.writeInt(keysByIdent.size());
-            for (NetworkIdentitySet ident : keysByIdent.keySet()) {
-                final ArrayList<UidStatsKey> keys = keysByIdent.get(ident);
-                ident.writeToStream(out);
-
-                out.writeInt(keys.size());
-                for (UidStatsKey key : keys) {
-                    final NetworkStatsHistory history = mUidStats.get(key);
-                    out.writeInt(key.uid);
-                    out.writeInt(key.set);
-                    out.writeInt(key.tag);
-                    history.writeToStream(out);
-                }
-            }
-
-            out.flush();
-            mUidFile.finishWrite(fos);
-        } catch (IOException e) {
-            Log.wtf(TAG, "problem writing stats", e);
-            if (fos != null) {
-                mUidFile.failWrite(fos);
-            }
-        }
     }
 
     @Override
-    protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
+    protected void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
         mContext.enforceCallingOrSelfPermission(DUMP, TAG);
 
         final HashSet<String> argSet = new HashSet<String>();
@@ -1411,182 +857,80 @@
             argSet.add(arg);
         }
 
-        final boolean fullHistory = argSet.contains("full");
+        // usage: dumpsys netstats --full --uid --tag --poll --checkin
+        final boolean poll = argSet.contains("--poll") || argSet.contains("poll");
+        final boolean checkin = argSet.contains("--checkin");
+        final boolean fullHistory = argSet.contains("--full") || argSet.contains("full");
+        final boolean includeUid = argSet.contains("--uid") || argSet.contains("detail");
+        final boolean includeTag = argSet.contains("--tag") || argSet.contains("detail");
+
+        final IndentingPrintWriter pw = new IndentingPrintWriter(writer, "  ");
 
         synchronized (mStatsLock) {
-            // TODO: remove this testing code, since it corrupts stats
-            if (argSet.contains("generate")) {
-                generateRandomLocked(args);
-                pw.println("Generated stub stats");
-                return;
-            }
-
-            if (argSet.contains("poll")) {
+            if (poll) {
                 performPollLocked(FLAG_PERSIST_ALL | FLAG_PERSIST_FORCE);
                 pw.println("Forced poll");
                 return;
             }
 
+            if (checkin) {
+                // list current stats files to verify rotation
+                pw.println("Current files:");
+                pw.increaseIndent();
+                for (String file : mBaseDir.list()) {
+                    pw.println(file);
+                }
+                pw.decreaseIndent();
+                return;
+            }
+
             pw.println("Active interfaces:");
+            pw.increaseIndent();
             for (String iface : mActiveIfaces.keySet()) {
                 final NetworkIdentitySet ident = mActiveIfaces.get(iface);
-                pw.print("  iface="); pw.print(iface);
+                pw.print("iface="); pw.print(iface);
                 pw.print(" ident="); pw.println(ident.toString());
             }
+            pw.decreaseIndent();
 
-            pw.println("Known historical dev stats:");
-            for (NetworkIdentitySet ident : mNetworkDevStats.keySet()) {
-                final NetworkStatsHistory history = mNetworkDevStats.get(ident);
-                pw.print("  ident="); pw.println(ident.toString());
-                history.dump("  ", pw, fullHistory);
+            pw.println("Dev stats:");
+            pw.increaseIndent();
+            mDevRecorder.dumpLocked(pw, fullHistory);
+            pw.decreaseIndent();
+
+            if (includeUid) {
+                pw.println("UID stats:");
+                pw.increaseIndent();
+                mUidRecorder.dumpLocked(pw, fullHistory);
+                pw.decreaseIndent();
             }
 
-            pw.println("Known historical xt stats:");
-            for (NetworkIdentitySet ident : mNetworkXtStats.keySet()) {
-                final NetworkStatsHistory history = mNetworkXtStats.get(ident);
-                pw.print("  ident="); pw.println(ident.toString());
-                history.dump("  ", pw, fullHistory);
-            }
-
-            if (argSet.contains("detail")) {
-                // since explicitly requested with argument, we're okay to load
-                // from disk if not already in memory.
-                ensureUidStatsLoadedLocked();
-
-                final ArrayList<UidStatsKey> keys = Lists.newArrayList();
-                keys.addAll(mUidStats.keySet());
-                Collections.sort(keys);
-
-                pw.println("Detailed UID stats:");
-                for (UidStatsKey key : keys) {
-                    pw.print("  ident="); pw.print(key.ident.toString());
-                    pw.print(" uid="); pw.print(key.uid);
-                    pw.print(" set="); pw.print(NetworkStats.setToString(key.set));
-                    pw.print(" tag="); pw.println(NetworkStats.tagToString(key.tag));
-
-                    final NetworkStatsHistory history = mUidStats.get(key);
-                    history.dump("    ", pw, fullHistory);
-                }
+            if (includeTag) {
+                pw.println("UID tag stats:");
+                pw.increaseIndent();
+                mUidTagRecorder.dumpLocked(pw, fullHistory);
+                pw.decreaseIndent();
             }
         }
     }
 
-    /**
-     * @deprecated only for temporary testing
-     */
-    @Deprecated
-    private void generateRandomLocked(String[] args) {
-        final long totalBytes = Long.parseLong(args[1]);
-        final long totalTime = Long.parseLong(args[2]);
-        
-        final PackageManager pm = mContext.getPackageManager();
-        final ArrayList<Integer> specialUidList = Lists.newArrayList();
-        for (int i = 3; i < args.length; i++) {
-            try {
-                specialUidList.add(pm.getApplicationInfo(args[i], 0).uid);
-            } catch (NameNotFoundException e) {
-                throw new RuntimeException(e);
-            }
-        }
-
-        final HashSet<Integer> otherUidSet = Sets.newHashSet();
-        for (ApplicationInfo info : pm.getInstalledApplications(0)) {
-            if (pm.checkPermission(android.Manifest.permission.INTERNET, info.packageName)
-                    == PackageManager.PERMISSION_GRANTED && !specialUidList.contains(info.uid)) {
-                otherUidSet.add(info.uid);
-            }
-        }
-
-        final ArrayList<Integer> otherUidList = new ArrayList<Integer>(otherUidSet);
-
-        final long end = System.currentTimeMillis();
-        final long start = end - totalTime;
-
-        mNetworkDevStats.clear();
-        mNetworkXtStats.clear();
-        mUidStats.clear();
-
-        final Random r = new Random();
-        for (NetworkIdentitySet ident : mActiveIfaces.values()) {
-            final NetworkStatsHistory devHistory = findOrCreateNetworkDevStatsLocked(ident);
-            final NetworkStatsHistory xtHistory = findOrCreateNetworkXtStatsLocked(ident);
-
-            final ArrayList<Integer> uidList = new ArrayList<Integer>();
-            uidList.addAll(specialUidList);
-
-            if (uidList.size() == 0) {
-                Collections.shuffle(otherUidList);
-                uidList.addAll(otherUidList);
-            }
-
-            boolean first = true;
-            long remainingBytes = totalBytes;
-            for (int uid : uidList) {
-                final NetworkStatsHistory defaultHistory = findOrCreateUidStatsLocked(
-                        ident, uid, SET_DEFAULT, TAG_NONE);
-                final NetworkStatsHistory foregroundHistory = findOrCreateUidStatsLocked(
-                        ident, uid, SET_FOREGROUND, TAG_NONE);
-
-                final long uidBytes = totalBytes / uidList.size();
-
-                final float fractionDefault = r.nextFloat();
-                final long defaultBytes = (long) (uidBytes * fractionDefault);
-                final long foregroundBytes = (long) (uidBytes * (1 - fractionDefault));
-
-                defaultHistory.generateRandom(start, end, defaultBytes);
-                foregroundHistory.generateRandom(start, end, foregroundBytes);
-
-                if (first) {
-                    final long bumpTime = (start + end) / 2;
-                    defaultHistory.recordData(
-                            bumpTime, bumpTime + DAY_IN_MILLIS, 200 * MB_IN_BYTES, 0);
-                    first = false;
-                }
-
-                devHistory.recordEntireHistory(defaultHistory);
-                devHistory.recordEntireHistory(foregroundHistory);
-                xtHistory.recordEntireHistory(defaultHistory);
-                xtHistory.recordEntireHistory(foregroundHistory);
-            }
-        }
+    private NetworkStats getNetworkStatsSummary() throws RemoteException {
+        return mNetworkManager.getNetworkStatsSummary();
     }
 
     /**
-     * Return the delta between two {@link NetworkStats} snapshots, where {@code
-     * before} can be {@code null}.
+     * Return snapshot of current UID statistics, including any
+     * {@link TrafficStats#UID_TETHERING} and {@link #mUidOperations} values.
      */
-    private NetworkStats computeStatsDelta(
-            NetworkStats before, NetworkStats current, boolean collectStale, String type) {
-        if (before != null) {
-            try {
-                return current.subtract(before, false);
-            } catch (NonMonotonicException e) {
-                Log.w(TAG, "found non-monotonic values; saving to dropbox");
+    private NetworkStats getNetworkStatsUidDetail() throws RemoteException {
+        final NetworkStats uidSnapshot = mNetworkManager.getNetworkStatsUidDetail(UID_ALL);
 
-                // record error for debugging
-                final StringBuilder builder = new StringBuilder();
-                builder.append("found non-monotonic " + type + " values at left[" + e.leftIndex
-                        + "] - right[" + e.rightIndex + "]\n");
-                builder.append("left=").append(e.left).append('\n');
-                builder.append("right=").append(e.right).append('\n');
-                mDropBox.addText(TAG_NETSTATS_ERROR, builder.toString());
+        // fold tethering stats and operations into uid snapshot
+        final NetworkStats tetherSnapshot = getNetworkStatsTethering();
+        uidSnapshot.combineAllValues(tetherSnapshot);
+        uidSnapshot.combineAllValues(mUidOperations);
 
-                try {
-                    // return clamped delta to help recover
-                    return current.subtract(before, true);
-                } catch (NonMonotonicException e1) {
-                    Log.wtf(TAG, "found non-monotonic values; returning empty delta", e1);
-                    return new NetworkStats(0L, 10);
-                }
-            }
-        } else if (collectStale) {
-            // caller is okay collecting stale stats for first call.
-            return current;
-        } else {
-            // this is first snapshot; to prevent from double-counting we only
-            // observe traffic occuring between known snapshots.
-            return new NetworkStats(0L, 10);
-        }
+        return uidSnapshot;
     }
 
     /**
@@ -1603,35 +947,6 @@
         }
     }
 
-    private static NetworkStats computeNetworkXtSnapshotFromUid(NetworkStats uidSnapshot) {
-        return uidSnapshot.groupedByIface();
-    }
-
-    private int estimateNetworkBuckets() {
-        return (int) (mSettings.getNetworkMaxHistory() / mSettings.getNetworkBucketDuration());
-    }
-
-    private int estimateUidBuckets() {
-        return (int) (mSettings.getUidMaxHistory() / mSettings.getUidBucketDuration());
-    }
-
-    private static int estimateResizeBuckets(NetworkStatsHistory existing, long newBucketDuration) {
-        return (int) (existing.size() * existing.getBucketDuration() / newBucketDuration);
-    }
-
-    /**
-     * Test if given {@link NetworkTemplate} matches any {@link NetworkIdentity}
-     * in the given {@link NetworkIdentitySet}.
-     */
-    private static boolean templateMatches(NetworkTemplate template, NetworkIdentitySet identSet) {
-        for (NetworkIdentity ident : identSet) {
-            if (template.matches(ident)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
     private Handler.Callback mHandlerCallback = new Handler.Callback() {
         /** {@inheritDoc} */
         public boolean handleMessage(Message msg) {
@@ -1645,6 +960,10 @@
                     updateIfaces();
                     return true;
                 }
+                case MSG_REGISTER_GLOBAL_ALERT: {
+                    registerGlobalAlert();
+                    return true;
+                }
                 default: {
                     return false;
                 }
@@ -1667,40 +986,22 @@
         }
     }
 
-    /**
-     * Key uniquely identifying a {@link NetworkStatsHistory} for a UID.
-     */
-    private static class UidStatsKey implements Comparable<UidStatsKey> {
-        public final NetworkIdentitySet ident;
-        public final int uid;
-        public final int set;
-        public final int tag;
-
-        public UidStatsKey(NetworkIdentitySet ident, int uid, int set, int tag) {
-            this.ident = ident;
-            this.uid = uid;
-            this.set = set;
-            this.tag = tag;
-        }
-
-        @Override
-        public int hashCode() {
-            return Objects.hashCode(ident, uid, set, tag);
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (obj instanceof UidStatsKey) {
-                final UidStatsKey key = (UidStatsKey) obj;
-                return Objects.equal(ident, key.ident) && uid == key.uid && set == key.set
-                        && tag == key.tag;
-            }
-            return false;
-        }
-
+    private class DropBoxNonMonotonicObserver implements NonMonotonicObserver<String> {
         /** {@inheritDoc} */
-        public int compareTo(UidStatsKey another) {
-            return Integer.compare(uid, another.uid);
+        public void foundNonMonotonic(NetworkStats left, int leftIndex, NetworkStats right,
+                int rightIndex, String cookie) {
+            Log.w(TAG, "found non-monotonic values; saving to dropbox");
+
+            // record error for debugging
+            final StringBuilder builder = new StringBuilder();
+            builder.append("found non-monotonic " + cookie + " values at left[" + leftIndex
+                    + "] - right[" + rightIndex + "]\n");
+            builder.append("left=").append(left).append('\n');
+            builder.append("right=").append(right).append('\n');
+
+            final DropBoxManager dropBox = (DropBoxManager) mContext.getSystemService(
+                    Context.DROPBOX_SERVICE);
+            dropBox.addText(TAG_NETSTATS_ERROR, builder.toString());
         }
     }
 
@@ -1726,26 +1027,35 @@
         public long getPollInterval() {
             return getSecureLong(NETSTATS_POLL_INTERVAL, 30 * MINUTE_IN_MILLIS);
         }
-        public long getPersistThreshold() {
-            return getSecureLong(NETSTATS_PERSIST_THRESHOLD, 2 * MB_IN_BYTES);
-        }
-        public long getNetworkBucketDuration() {
-            return getSecureLong(NETSTATS_NETWORK_BUCKET_DURATION, HOUR_IN_MILLIS);
-        }
-        public long getNetworkMaxHistory() {
-            return getSecureLong(NETSTATS_NETWORK_MAX_HISTORY, 90 * DAY_IN_MILLIS);
-        }
-        public long getUidBucketDuration() {
-            return getSecureLong(NETSTATS_UID_BUCKET_DURATION, 2 * HOUR_IN_MILLIS);
-        }
-        public long getUidMaxHistory() {
-            return getSecureLong(NETSTATS_UID_MAX_HISTORY, 90 * DAY_IN_MILLIS);
-        }
-        public long getTagMaxHistory() {
-            return getSecureLong(NETSTATS_TAG_MAX_HISTORY, 30 * DAY_IN_MILLIS);
-        }
         public long getTimeCacheMaxAge() {
-            return DAY_IN_MILLIS;
+            return getSecureLong(NETSTATS_TIME_CACHE_MAX_AGE, DAY_IN_MILLIS);
+        }
+        public long getGlobalAlertBytes() {
+            return getSecureLong(NETSTATS_GLOBAL_ALERT_BYTES, 2 * MB_IN_BYTES);
+        }
+        public boolean getSampleEnabled() {
+            return getSecureBoolean(NETSTATS_SAMPLE_ENABLED, true);
+        }
+
+        public Config getDevConfig() {
+            return new Config(getSecureLong(NETSTATS_DEV_BUCKET_DURATION, HOUR_IN_MILLIS),
+                    getSecureLong(NETSTATS_DEV_PERSIST_BYTES, 2 * MB_IN_BYTES),
+                    getSecureLong(NETSTATS_DEV_ROTATE_AGE, 15 * DAY_IN_MILLIS),
+                    getSecureLong(NETSTATS_DEV_DELETE_AGE, 90 * DAY_IN_MILLIS));
+        }
+
+        public Config getUidConfig() {
+            return new Config(getSecureLong(NETSTATS_UID_BUCKET_DURATION, 2 * HOUR_IN_MILLIS),
+                    getSecureLong(NETSTATS_UID_PERSIST_BYTES, 2 * MB_IN_BYTES),
+                    getSecureLong(NETSTATS_UID_ROTATE_AGE, 15 * DAY_IN_MILLIS),
+                    getSecureLong(NETSTATS_UID_DELETE_AGE, 90 * DAY_IN_MILLIS));
+        }
+
+        public Config getUidTagConfig() {
+            return new Config(getSecureLong(NETSTATS_UID_BUCKET_DURATION, 2 * HOUR_IN_MILLIS),
+                    getSecureLong(NETSTATS_UID_PERSIST_BYTES, 2 * MB_IN_BYTES),
+                    getSecureLong(NETSTATS_UID_ROTATE_AGE, 5 * DAY_IN_MILLIS),
+                    getSecureLong(NETSTATS_UID_DELETE_AGE, 15 * DAY_IN_MILLIS));
         }
     }
 }
diff --git a/services/java/com/android/server/pm/Installer.java b/services/java/com/android/server/pm/Installer.java
index 11ccd60..9b1973e 100644
--- a/services/java/com/android/server/pm/Installer.java
+++ b/services/java/com/android/server/pm/Installer.java
@@ -277,6 +277,27 @@
         return execute(builder.toString());
     }
 
+    /**
+     * Clone all the package data directories from srcUserId to targetUserId. If copyData is true,
+     * some of the data is also copied, otherwise just empty directories are created with the
+     * correct access rights.
+     * @param srcUserId user to copy the data directories from
+     * @param targetUserId user to copy the data directories to
+     * @param copyData whether the data itself is to be copied. If false, empty directories are
+     * created.
+     * @return success/error code
+     */
+    public int cloneUserData(int srcUserId, int targetUserId, boolean copyData) {
+        StringBuilder builder = new StringBuilder("cloneuserdata");
+        builder.append(' ');
+        builder.append(srcUserId);
+        builder.append(' ');
+        builder.append(targetUserId);
+        builder.append(' ');
+        builder.append(copyData ? '1' : '0');
+        return execute(builder.toString());
+    }
+
     public boolean ping() {
         if (execute("ping") < 0) {
             return false;
diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java
index 6b61c47..38c128c 100644
--- a/services/java/com/android/server/pm/PackageManagerService.java
+++ b/services/java/com/android/server/pm/PackageManagerService.java
@@ -92,6 +92,7 @@
 import android.os.ServiceManager;
 import android.os.SystemClock;
 import android.os.SystemProperties;
+import android.os.UserId;
 import android.security.SystemKeyStore;
 import android.util.DisplayMetrics;
 import android.util.EventLog;
@@ -620,11 +621,11 @@
                         packages = new String[size];
                         components = new ArrayList[size];
                         uids = new int[size];
-                        Iterator<HashMap.Entry<String, ArrayList<String>>>
+                        Iterator<Map.Entry<String, ArrayList<String>>>
                                 it = mPendingBroadcasts.entrySet().iterator();
                         int i = 0;
                         while (it.hasNext() && i < size) {
-                            HashMap.Entry<String, ArrayList<String>> ent = it.next();
+                            Map.Entry<String, ArrayList<String>> ent = it.next();
                             packages[i] = ent.getKey();
                             components[i] = ent.getValue();
                             PackageSetting ps = mSettings.mPackages.get(ent.getKey());
@@ -1743,12 +1744,16 @@
     }
 
     public ActivityInfo getActivityInfo(ComponentName component, int flags) {
+        return getActivityInfo(component, flags, Binder.getOrigCallingUser());
+    }
+
+    ActivityInfo getActivityInfo(ComponentName component, int flags, int userId) {
         synchronized (mPackages) {
             PackageParser.Activity a = mActivities.mActivities.get(component);
 
             if (DEBUG_PACKAGE_INFO) Log.v(TAG, "getActivityInfo " + component + ": " + a);
             if (a != null && mSettings.isEnabledLPr(a.info, flags)) {
-                return PackageParser.generateActivityInfo(a, flags);
+                return PackageParser.generateActivityInfo(a, flags, userId);
             }
             if (mResolveComponentName.equals(component)) {
                 return mResolveActivity;
@@ -1758,36 +1763,48 @@
     }
 
     public ActivityInfo getReceiverInfo(ComponentName component, int flags) {
+        return getReceiverInfo(component, flags, Binder.getOrigCallingUser());
+    }
+
+    ActivityInfo getReceiverInfo(ComponentName component, int flags, int userId) {
         synchronized (mPackages) {
             PackageParser.Activity a = mReceivers.mActivities.get(component);
             if (DEBUG_PACKAGE_INFO) Log.v(
                 TAG, "getReceiverInfo " + component + ": " + a);
             if (a != null && mSettings.isEnabledLPr(a.info, flags)) {
-                return PackageParser.generateActivityInfo(a, flags);
+                return PackageParser.generateActivityInfo(a, flags, userId);
             }
         }
         return null;
     }
 
     public ServiceInfo getServiceInfo(ComponentName component, int flags) {
+        return getServiceInfo(component, flags, Binder.getOrigCallingUser());
+    }
+
+    ServiceInfo getServiceInfo(ComponentName component, int flags, int userId) {
         synchronized (mPackages) {
             PackageParser.Service s = mServices.mServices.get(component);
             if (DEBUG_PACKAGE_INFO) Log.v(
                 TAG, "getServiceInfo " + component + ": " + s);
             if (s != null && mSettings.isEnabledLPr(s.info, flags)) {
-                return PackageParser.generateServiceInfo(s, flags);
+                return PackageParser.generateServiceInfo(s, flags, userId);
             }
         }
         return null;
     }
 
     public ProviderInfo getProviderInfo(ComponentName component, int flags) {
+        return getProviderInfo(component, flags, UserId.getUserId(Binder.getCallingUid()));
+    }
+
+    ProviderInfo getProviderInfo(ComponentName component, int flags, int userId) {
         synchronized (mPackages) {
             PackageParser.Provider p = mProvidersByComponent.get(component);
             if (DEBUG_PACKAGE_INFO) Log.v(
                 TAG, "getProviderInfo " + component + ": " + p);
             if (p != null && mSettings.isEnabledLPr(p.info, flags)) {
-                return PackageParser.generateProviderInfo(p, flags);
+                return PackageParser.generateProviderInfo(p, flags, userId);
             }
         }
         return null;
@@ -1850,7 +1867,7 @@
 
     public int checkUidPermission(String permName, int uid) {
         synchronized (mPackages) {
-            Object obj = mSettings.getUserIdLPr(uid);
+            Object obj = mSettings.getUserIdLPr(UserId.getAppId(uid));
             if (obj != null) {
                 GrantedPermissions gp = (GrantedPermissions)obj;
                 if (gp.grantedPermissions.contains(permName)) {
@@ -1881,7 +1898,7 @@
         if (permName != null) {
             BasePermission bp = findPermissionTreeLP(permName);
             if (bp != null) {
-                if (bp.uid == Binder.getCallingUid()) {
+                if (bp.uid == UserId.getAppId(Binder.getCallingUid())) {
                     return bp;
                 }
                 throw new SecurityException("Calling uid "
@@ -2010,6 +2027,9 @@
     }
 
     public int checkUidSignatures(int uid1, int uid2) {
+        // Map to base uids.
+        uid1 = UserId.getAppId(uid1);
+        uid2 = UserId.getAppId(uid2);
         // reader
         synchronized (mPackages) {
             Signature[] s1;
@@ -2067,6 +2087,7 @@
     }
 
     public String[] getPackagesForUid(int uid) {
+        uid = UserId.getAppId(uid);
         // reader
         synchronized (mPackages) {
             Object obj = mSettings.getUserIdLPr(uid);
@@ -2091,7 +2112,7 @@
     public String getNameForUid(int uid) {
         // reader
         synchronized (mPackages) {
-            Object obj = mSettings.getUserIdLPr(uid);
+            Object obj = mSettings.getUserIdLPr(UserId.getAppId(uid));
             if (obj instanceof SharedUserSetting) {
                 final SharedUserSetting sus = (SharedUserSetting) obj;
                 return sus.name + ":" + sus.userId;
@@ -2110,7 +2131,7 @@
         // reader
         synchronized (mPackages) {
             final SharedUserSetting suid = mSettings.getSharedUserLPw(sharedUserName, 0, false);
-            if(suid == null) {
+            if (suid == null) {
                 return -1;
             }
             return suid.userId;
@@ -2252,6 +2273,9 @@
                 comp = intent.getComponent();
             }
         }
+
+        final int userId = UserId.getUserId(Binder.getCallingUid());
+
         if (comp != null) {
             final List<ResolveInfo> list = new ArrayList<ResolveInfo>(1);
             final ActivityInfo ai = getActivityInfo(comp, flags);
@@ -2603,6 +2627,7 @@
             Arrays.sort(keys);
             int i = getContinuationPoint(keys, lastRead);
             final int N = keys.length;
+            final int userId = UserId.getUserId(Binder.getCallingUid());
 
             while (i < N) {
                 final String packageName = keys[i++];
@@ -2616,7 +2641,7 @@
                 } else {
                     final PackageParser.Package p = mPackages.get(packageName);
                     if (p != null) {
-                        ai = PackageParser.generateApplicationInfo(p, flags);
+                        ai = PackageParser.generateApplicationInfo(p, flags, userId);
                     }
                 }
 
@@ -2639,12 +2664,13 @@
         // reader
         synchronized (mPackages) {
             final Iterator<PackageParser.Package> i = mPackages.values().iterator();
+            final int userId = UserId.getUserId(Binder.getCallingUid());
             while (i.hasNext()) {
                 final PackageParser.Package p = i.next();
                 if (p.applicationInfo != null
                         && (p.applicationInfo.flags&ApplicationInfo.FLAG_PERSISTENT) != 0
                         && (!mSafeMode || isSystemApp(p))) {
-                    finalList.add(PackageParser.generateApplicationInfo(p, flags));
+                    finalList.add(PackageParser.generateApplicationInfo(p, flags, userId));
                 }
             }
         }
@@ -2660,7 +2686,8 @@
                     && mSettings.isEnabledLPr(provider.info, flags)
                     && (!mSafeMode || (provider.info.applicationInfo.flags
                             &ApplicationInfo.FLAG_SYSTEM) != 0)
-                    ? PackageParser.generateProviderInfo(provider, flags)
+                    ? PackageParser.generateProviderInfo(provider, flags,
+                            UserId.getUserId(Binder.getCallingUid()))
                     : null;
         }
     }
@@ -2674,7 +2701,7 @@
         synchronized (mPackages) {
             final Iterator<Map.Entry<String, PackageParser.Provider>> i = mProviders.entrySet()
                     .iterator();
-
+            final int userId = UserId.getUserId(Binder.getCallingUid());
             while (i.hasNext()) {
                 Map.Entry<String, PackageParser.Provider> entry = i.next();
                 PackageParser.Provider p = entry.getValue();
@@ -2683,7 +2710,7 @@
                         && (!mSafeMode || (p.info.applicationInfo.flags
                                 &ApplicationInfo.FLAG_SYSTEM) != 0)) {
                     outNames.add(entry.getKey());
-                    outInfo.add(PackageParser.generateProviderInfo(p, 0));
+                    outInfo.add(PackageParser.generateProviderInfo(p, 0, userId));
                 }
             }
         }
@@ -2696,19 +2723,21 @@
         // reader
         synchronized (mPackages) {
             final Iterator<PackageParser.Provider> i = mProvidersByComponent.values().iterator();
+            final int userId = UserId.getUserId(Binder.getCallingUid());
             while (i.hasNext()) {
                 final PackageParser.Provider p = i.next();
                 if (p.info.authority != null
                         && (processName == null
                                 || (p.info.processName.equals(processName)
-                                        && p.info.applicationInfo.uid == uid))
+                                        && UserId.getAppId(p.info.applicationInfo.uid)
+                                            == UserId.getAppId(uid)))
                         && mSettings.isEnabledLPr(p.info, flags)
                         && (!mSafeMode
                                 || (p.info.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0)) {
                     if (finalList == null) {
                         finalList = new ArrayList<ProviderInfo>(3);
                     }
-                    finalList.add(PackageParser.generateProviderInfo(p, flags));
+                    finalList.add(PackageParser.generateProviderInfo(p, flags, userId));
                 }
             }
         }
@@ -4461,8 +4490,8 @@
                 return null;
             }
             final ResolveInfo res = new ResolveInfo();
-            res.activityInfo = PackageParser.generateActivityInfo(activity,
-                    mFlags);
+            res.activityInfo = PackageParser.generateActivityInfo(activity, mFlags,
+                    Binder.getOrigCallingUser());
             if ((mFlags&PackageManager.GET_RESOLVED_FILTER) != 0) {
                 res.filter = info;
             }
@@ -4637,8 +4666,8 @@
                 return null;
             }
             final ResolveInfo res = new ResolveInfo();
-            res.serviceInfo = PackageParser.generateServiceInfo(service,
-                    mFlags);
+            res.serviceInfo = PackageParser.generateServiceInfo(service, mFlags,
+                    Binder.getOrigCallingUser());
             if ((mFlags&PackageManager.GET_RESOLVED_FILTER) != 0) {
                 res.filter = filter;
             }
@@ -4742,8 +4771,10 @@
                     intent.setPackage(targetPkg);
                 }
                 intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
+                // TODO: Fix the userId argument
                 am.broadcastIntent(null, intent, null, finishedReceiver,
-                        0, null, null, null, finishedReceiver != null, false);
+                        0, null, null, null, finishedReceiver != null, false,
+                        Binder.getOrigCallingUser());
             } catch (RemoteException ex) {
             }
         }
@@ -7584,7 +7615,7 @@
                         "Unknown component: " + packageName
                         + "/" + className);
             }
-            if (!allowedByPermission && (uid != pkgSetting.userId)) {
+            if (!allowedByPermission && (!UserId.isSameApp(uid, pkgSetting.userId))) {
                 throw new SecurityException(
                         "Permission Denial: attempt to change component state from pid="
                         + Binder.getCallingPid()
@@ -8673,4 +8704,8 @@
             return mSettings.getVerifierDeviceIdentityLPw();
         }
     }
+
+    public List<UserInfo> getUsers() {
+        return mUserManager.getUsers();
+    }
 }
diff --git a/services/java/com/android/server/pm/Settings.java b/services/java/com/android/server/pm/Settings.java
index 32aa7a4..3616aa2 100644
--- a/services/java/com/android/server/pm/Settings.java
+++ b/services/java/com/android/server/pm/Settings.java
@@ -62,6 +62,7 @@
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.Map;
 
 import libcore.io.IoUtils;
 
@@ -929,7 +930,7 @@
             }
             
             if (mRenamedPackages.size() > 0) {
-                for (HashMap.Entry<String, String> e : mRenamedPackages.entrySet()) {
+                for (Map.Entry<String, String> e : mRenamedPackages.entrySet()) {
                     serializer.startTag(null, "renamed-package");
                     serializer.attribute(null, "new", e.getKey());
                     serializer.attribute(null, "old", e.getValue());
@@ -2144,7 +2145,7 @@
 
         printedSomething = false;
         if (mRenamedPackages.size() > 0) {
-            for (final HashMap.Entry<String, String> e : mRenamedPackages.entrySet()) {
+            for (final Map.Entry<String, String> e : mRenamedPackages.entrySet()) {
                 if (packageName != null && !packageName.equals(e.getKey())
                         && !packageName.equals(e.getValue())) {
                     continue;
@@ -2258,4 +2259,4 @@
         pw.println("Settings parse messages:");
         pw.print(mReadMessages.toString());
     }
-}
\ No newline at end of file
+}
diff --git a/services/java/com/android/server/pm/UserManager.java b/services/java/com/android/server/pm/UserManager.java
index 2687728..5eacf4a 100644
--- a/services/java/com/android/server/pm/UserManager.java
+++ b/services/java/com/android/server/pm/UserManager.java
@@ -24,6 +24,7 @@
 import android.os.Environment;
 import android.os.FileUtils;
 import android.os.SystemClock;
+import android.os.UserId;
 import android.util.Log;
 import android.util.Slog;
 import android.util.SparseArray;
@@ -169,9 +170,10 @@
      * </user>
      */
     private void writeUser(UserInfo userInfo) {
+        FileOutputStream fos = null;
         try {
             final File mUserFile = new File(mUsersDir, userInfo.id + ".xml");
-            final FileOutputStream fos = new FileOutputStream(mUserFile);
+            fos = new FileOutputStream(mUserFile);
             final BufferedOutputStream bos = new BufferedOutputStream(fos);
 
             // XmlSerializer serializer = XmlUtils.serializerInstance();
@@ -193,6 +195,13 @@
             serializer.endDocument();
         } catch (IOException ioe) {
             Slog.e(LOG_TAG, "Error writing user info " + userInfo.id + "\n" + ioe);
+        } finally {
+            if (fos != null) {
+                try {
+                    fos.close();
+                } catch (IOException ioe) {
+                }
+            }
         }
     }
 
@@ -205,8 +214,9 @@
      * </users>
      */
     private void writeUserList() {
+        FileOutputStream fos = null;
         try {
-            final FileOutputStream fos = new FileOutputStream(mUserListFile);
+            fos = new FileOutputStream(mUserListFile);
             final BufferedOutputStream bos = new BufferedOutputStream(fos);
 
             // XmlSerializer serializer = XmlUtils.serializerInstance();
@@ -229,6 +239,13 @@
             serializer.endDocument();
         } catch (IOException ioe) {
             Slog.e(LOG_TAG, "Error writing user list");
+        } finally {
+            if (fos != null) {
+                try {
+                    fos.close();
+                } catch (IOException ioe) {
+                }
+            }
         }
     }
 
@@ -330,7 +347,7 @@
             // Don't do it for the primary user, it will become recursive.
             if (userId == 0)
                 continue;
-            mInstaller.createUserData(packageName, PackageManager.getUid(userId, uid),
+            mInstaller.createUserData(packageName, UserId.getUid(userId, uid),
                     userId);
         }
     }
@@ -367,6 +384,8 @@
 
     /**
      * Returns the next available user id, filling in any holes in the ids.
+     * TODO: May not be a good idea to recycle ids, in case it results in confusion
+     * for data and battery stats collection, or unexpected cross-talk.
      * @return
      */
     private int getNextAvailableId() {
@@ -390,14 +409,8 @@
         FileUtils.setPermissions(userPath.toString(), FileUtils.S_IRWXU | FileUtils.S_IRWXG
                 | FileUtils.S_IXOTH, -1, -1);
 
-        // Create the individual data directories
-        for (ApplicationInfo app : apps) {
-            if (app.uid > android.os.Process.FIRST_APPLICATION_UID
-                    && app.uid < PackageManager.PER_USER_RANGE) {
-                mInstaller.createUserData(app.packageName,
-                        PackageManager.getUid(id, app.uid), id);
-            }
-        }
+        mInstaller.cloneUserData(0, id, false);
+
         final long stopTime = SystemClock.elapsedRealtime();
         Log.i(LOG_TAG,
                 "Time to create " + apps.size() + " packages = " + (stopTime - startTime) + "ms");
diff --git a/services/java/com/android/server/wm/ScreenRotationAnimation.java b/services/java/com/android/server/wm/ScreenRotationAnimation.java
index 8fc9a70..55fb038 100644
--- a/services/java/com/android/server/wm/ScreenRotationAnimation.java
+++ b/services/java/com/android/server/wm/ScreenRotationAnimation.java
@@ -17,13 +17,8 @@
 package com.android.server.wm;
 
 import android.content.Context;
-import android.graphics.Bitmap;
-import android.graphics.Canvas;
 import android.graphics.Matrix;
-import android.graphics.Paint;
 import android.graphics.PixelFormat;
-import android.graphics.PorterDuff;
-import android.graphics.PorterDuffXfermode;
 import android.graphics.Rect;
 import android.util.Slog;
 import android.view.Surface;
@@ -34,7 +29,8 @@
 
 class ScreenRotationAnimation {
     static final String TAG = "ScreenRotationAnimation";
-    static final boolean DEBUG = false;
+    static final boolean DEBUG_STATE = false;
+    static final boolean DEBUG_TRANSFORMS = false;
 
     static final int FREEZE_LAYER = WindowManagerService.TYPE_LAYER_MULTIPLIER * 200;
 
@@ -49,11 +45,51 @@
     int mOriginalWidth, mOriginalHeight;
     int mCurRotation;
 
-    Animation mExitAnimation;
+    // For all animations, "exit" is for the UI elements that are going
+    // away (that is the snapshot of the old screen), and "enter" is for
+    // the new UI elements that are appearing (that is the active windows
+    // in their final orientation).
+
+    // The starting animation for the exiting and entering elements.  This
+    // animation applies a transformation while the rotation is in progress.
+    // It is started immediately, before the new entering UI is ready.
+    Animation mStartExitAnimation;
+    final Transformation mStartExitTransformation = new Transformation();
+    Animation mStartEnterAnimation;
+    final Transformation mStartEnterTransformation = new Transformation();
+
+    // The finishing animation for the exiting and entering elements.  This
+    // animation needs to undo the transformation of the starting animation.
+    // It starts running once the new rotation UI elements are ready to be
+    // displayed.
+    Animation mFinishExitAnimation;
+    final Transformation mFinishExitTransformation = new Transformation();
+    Animation mFinishEnterAnimation;
+    final Transformation mFinishEnterTransformation = new Transformation();
+
+    // The current active animation to move from the old to the new rotated
+    // state.  Which animation is run here will depend on the old and new
+    // rotations.
+    Animation mRotateExitAnimation;
+    final Transformation mRotateExitTransformation = new Transformation();
+    Animation mRotateEnterAnimation;
+    final Transformation mRotateEnterTransformation = new Transformation();
+
+    // A previously running rotate animation.  This will be used if we need
+    // to switch to a new rotation before finishing the previous one.
+    Animation mLastRotateExitAnimation;
+    final Transformation mLastRotateExitTransformation = new Transformation();
+    Animation mLastRotateEnterAnimation;
+    final Transformation mLastRotateEnterTransformation = new Transformation();
+
+    // Complete transformations being applied.
     final Transformation mExitTransformation = new Transformation();
-    Animation mEnterAnimation;
     final Transformation mEnterTransformation = new Transformation();
+
     boolean mStarted;
+    boolean mAnimRunning;
+    boolean mFinishAnimReady;
+    long mFinishAnimStartTime;
 
     final Matrix mSnapshotInitialMatrix = new Matrix();
     final Matrix mSnapshotFinalMatrix = new Matrix();
@@ -133,7 +169,7 @@
                     mTmpFloats[Matrix.MSCALE_X], mTmpFloats[Matrix.MSKEW_Y],
                     mTmpFloats[Matrix.MSKEW_X], mTmpFloats[Matrix.MSCALE_Y]);
             mSurface.setAlpha(alpha);
-            if (DEBUG) {
+            if (DEBUG_TRANSFORMS) {
                 float[] srcPnts = new float[] { 0, 0, mWidth, mHeight };
                 float[] dstPnts = new float[4];
                 matrix.mapPoints(dstPnts, srcPnts);
@@ -167,7 +203,7 @@
     }
 
     // Must be called while in a transaction.
-    public void setRotation(int rotation) {
+    private void setRotation(int rotation) {
         mCurRotation = rotation;
 
         // Compute the transformation matrix that must be applied
@@ -176,46 +212,78 @@
         int delta = deltaRotation(rotation, mSnapshotRotation);
         createRotationMatrix(delta, mWidth, mHeight, mSnapshotInitialMatrix);
 
-        if (DEBUG) Slog.v(TAG, "**** ROTATION: " + delta);
+        if (DEBUG_STATE) Slog.v(TAG, "**** ROTATION: " + delta);
         setSnapshotTransform(mSnapshotInitialMatrix, 1.0f);
     }
 
+    // Must be called while in a transaction.
+    public boolean setRotation(int rotation, SurfaceSession session,
+            long maxAnimationDuration, float animationScale, int finalWidth, int finalHeight) {
+        setRotation(rotation);
+        return startAnimation(session, maxAnimationDuration, animationScale,
+                finalWidth, finalHeight, false);
+    }
+
     /**
      * Returns true if animating.
      */
-    public boolean dismiss(SurfaceSession session, long maxAnimationDuration,
-            float animationScale, int finalWidth, int finalHeight) {
+    private boolean startAnimation(SurfaceSession session, long maxAnimationDuration,
+            float animationScale, int finalWidth, int finalHeight, boolean dismissing) {
         if (mSurface == null) {
             // Can't do animation.
             return false;
         }
+        if (mStarted) {
+            return true;
+        }
+
+        mStarted = true;
+
+        boolean firstStart = false;
 
         // Figure out how the screen has moved from the original rotation.
         int delta = deltaRotation(mCurRotation, mOriginalRotation);
 
+        if (mFinishExitAnimation == null && (!dismissing || delta != Surface.ROTATION_0)) {
+            if (DEBUG_STATE) Slog.v(TAG, "Creating start and finish animations");
+            firstStart = true;
+            mStartExitAnimation = AnimationUtils.loadAnimation(mContext,
+                    com.android.internal.R.anim.screen_rotate_start_exit);
+            mStartEnterAnimation = AnimationUtils.loadAnimation(mContext,
+                    com.android.internal.R.anim.screen_rotate_start_enter);
+            mFinishExitAnimation = AnimationUtils.loadAnimation(mContext,
+                    com.android.internal.R.anim.screen_rotate_finish_exit);
+            mFinishEnterAnimation = AnimationUtils.loadAnimation(mContext,
+                    com.android.internal.R.anim.screen_rotate_finish_enter);
+        }
+
+        if (DEBUG_STATE) Slog.v(TAG, "Rotation delta: " + delta + " finalWidth="
+                + finalWidth + " finalHeight=" + finalHeight
+                + " origWidth=" + mOriginalWidth + " origHeight=" + mOriginalHeight);
+
         switch (delta) {
             case Surface.ROTATION_0:
-                mExitAnimation = AnimationUtils.loadAnimation(mContext,
+                mRotateExitAnimation = AnimationUtils.loadAnimation(mContext,
                         com.android.internal.R.anim.screen_rotate_0_exit);
-                mEnterAnimation = AnimationUtils.loadAnimation(mContext,
+                mRotateEnterAnimation = AnimationUtils.loadAnimation(mContext,
                         com.android.internal.R.anim.screen_rotate_0_enter);
                 break;
             case Surface.ROTATION_90:
-                mExitAnimation = AnimationUtils.loadAnimation(mContext,
+                mRotateExitAnimation = AnimationUtils.loadAnimation(mContext,
                         com.android.internal.R.anim.screen_rotate_plus_90_exit);
-                mEnterAnimation = AnimationUtils.loadAnimation(mContext,
+                mRotateEnterAnimation = AnimationUtils.loadAnimation(mContext,
                         com.android.internal.R.anim.screen_rotate_plus_90_enter);
                 break;
             case Surface.ROTATION_180:
-                mExitAnimation = AnimationUtils.loadAnimation(mContext,
+                mRotateExitAnimation = AnimationUtils.loadAnimation(mContext,
                         com.android.internal.R.anim.screen_rotate_180_exit);
-                mEnterAnimation = AnimationUtils.loadAnimation(mContext,
+                mRotateEnterAnimation = AnimationUtils.loadAnimation(mContext,
                         com.android.internal.R.anim.screen_rotate_180_enter);
                 break;
             case Surface.ROTATION_270:
-                mExitAnimation = AnimationUtils.loadAnimation(mContext,
+                mRotateExitAnimation = AnimationUtils.loadAnimation(mContext,
                         com.android.internal.R.anim.screen_rotate_minus_90_exit);
-                mEnterAnimation = AnimationUtils.loadAnimation(mContext,
+                mRotateEnterAnimation = AnimationUtils.loadAnimation(mContext,
                         com.android.internal.R.anim.screen_rotate_minus_90_enter);
                 break;
         }
@@ -224,35 +292,85 @@
         // means to allow supplying the last and next size.  In this definition
         // "%p" is the original (let's call it "previous") size, and "%" is the
         // screen's current/new size.
-        mEnterAnimation.initialize(finalWidth, finalHeight, mOriginalWidth, mOriginalHeight);
-        mExitAnimation.initialize(finalWidth, finalHeight, mOriginalWidth, mOriginalHeight);
-        mStarted = false;
+        if (firstStart) {
+            if (DEBUG_STATE) Slog.v(TAG, "Initializing start and finish animations");
+            mStartEnterAnimation.initialize(finalWidth, finalHeight,
+                    mOriginalWidth, mOriginalHeight);
+            mStartExitAnimation.initialize(finalWidth, finalHeight,
+                    mOriginalWidth, mOriginalHeight);
+            mFinishEnterAnimation.initialize(finalWidth, finalHeight,
+                    mOriginalWidth, mOriginalHeight);
+            mFinishExitAnimation.initialize(finalWidth, finalHeight,
+                    mOriginalWidth, mOriginalHeight);
+        }
+        mRotateEnterAnimation.initialize(finalWidth, finalHeight, mOriginalWidth, mOriginalHeight);
+        mRotateExitAnimation.initialize(finalWidth, finalHeight, mOriginalWidth, mOriginalHeight);
+        mAnimRunning = false;
+        mFinishAnimReady = false;
+        mFinishAnimStartTime = -1;
 
-        mExitAnimation.restrictDuration(maxAnimationDuration);
-        mExitAnimation.scaleCurrentDuration(animationScale);
-        mEnterAnimation.restrictDuration(maxAnimationDuration);
-        mEnterAnimation.scaleCurrentDuration(animationScale);
+        if (firstStart) {
+            mStartExitAnimation.restrictDuration(maxAnimationDuration);
+            mStartExitAnimation.scaleCurrentDuration(animationScale);
+            mStartEnterAnimation.restrictDuration(maxAnimationDuration);
+            mStartEnterAnimation.scaleCurrentDuration(animationScale);
+            mFinishExitAnimation.restrictDuration(maxAnimationDuration);
+            mFinishExitAnimation.scaleCurrentDuration(animationScale);
+            mFinishEnterAnimation.restrictDuration(maxAnimationDuration);
+            mFinishEnterAnimation.scaleCurrentDuration(animationScale);
+        }
+        mRotateExitAnimation.restrictDuration(maxAnimationDuration);
+        mRotateExitAnimation.scaleCurrentDuration(animationScale);
+        mRotateEnterAnimation.restrictDuration(maxAnimationDuration);
+        mRotateEnterAnimation.scaleCurrentDuration(animationScale);
 
-        if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS) Slog.i(WindowManagerService.TAG,
-                ">>> OPEN TRANSACTION ScreenRotationAnimation.dismiss");
-        Surface.openTransaction();
+        if (mBlackFrame == null) {
+            if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS || DEBUG_STATE) Slog.i(
+                    WindowManagerService.TAG,
+                    ">>> OPEN TRANSACTION ScreenRotationAnimation.startAnimation");
+            Surface.openTransaction();
 
-        try {
-            Rect outer = new Rect(-finalWidth, -finalHeight, finalWidth * 2, finalHeight * 2);
-            Rect inner = new Rect(0, 0, finalWidth, finalHeight);
-            mBlackFrame = new BlackFrame(session, outer, inner, FREEZE_LAYER);
-        } catch (Surface.OutOfResourcesException e) {
-            Slog.w(TAG, "Unable to allocate black surface", e);
-        } finally {
-            Surface.closeTransaction();
-            if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS) Slog.i(WindowManagerService.TAG,
-                    "<<< CLOSE TRANSACTION ScreenRotationAnimation.dismiss");
+            try {
+                Rect outer = new Rect(-finalWidth*1, -finalHeight*1, finalWidth*2, finalHeight*2);
+                Rect inner = new Rect(0, 0, finalWidth, finalHeight);
+                mBlackFrame = new BlackFrame(session, outer, inner, FREEZE_LAYER);
+            } catch (Surface.OutOfResourcesException e) {
+                Slog.w(TAG, "Unable to allocate black surface", e);
+            } finally {
+                Surface.closeTransaction();
+                if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS || DEBUG_STATE) Slog.i(
+                        WindowManagerService.TAG,
+                        "<<< CLOSE TRANSACTION ScreenRotationAnimation.startAnimation");
+            }
         }
 
         return true;
     }
 
+    /**
+     * Returns true if animating.
+     */
+    public boolean dismiss(SurfaceSession session, long maxAnimationDuration,
+            float animationScale, int finalWidth, int finalHeight) {
+        if (DEBUG_STATE) Slog.v(TAG, "Dismiss!");
+        if (mSurface == null) {
+            // Can't do animation.
+            return false;
+        }
+        if (!mStarted) {
+            startAnimation(session, maxAnimationDuration, animationScale, finalWidth, finalHeight,
+                    true);
+        }
+        if (!mStarted) {
+            return false;
+        }
+        if (DEBUG_STATE) Slog.v(TAG, "Setting mFinishAnimReady = true");
+        mFinishAnimReady = true;
+        return true;
+    }
+
     public void kill() {
+        if (DEBUG_STATE) Slog.v(TAG, "Kill!");
         if (mSurface != null) {
             if (WindowManagerService.SHOW_TRANSACTIONS ||
                     WindowManagerService.SHOW_SURFACE_ALLOC) Slog.i(WindowManagerService.TAG,
@@ -262,74 +380,198 @@
         }
         if (mBlackFrame != null) {
             mBlackFrame.kill();
+            mBlackFrame = null;
         }
-        if (mExitAnimation != null) {
-            mExitAnimation.cancel();
-            mExitAnimation = null;
+        if (mStartExitAnimation != null) {
+            mStartExitAnimation.cancel();
+            mStartExitAnimation = null;
         }
-        if (mEnterAnimation != null) {
-            mEnterAnimation.cancel();
-            mEnterAnimation = null;
+        if (mStartEnterAnimation != null) {
+            mStartEnterAnimation.cancel();
+            mStartEnterAnimation = null;
+        }
+        if (mFinishExitAnimation != null) {
+            mFinishExitAnimation.cancel();
+            mFinishExitAnimation = null;
+        }
+        if (mStartEnterAnimation != null) {
+            mStartEnterAnimation.cancel();
+            mStartEnterAnimation = null;
+        }
+        if (mRotateExitAnimation != null) {
+            mRotateExitAnimation.cancel();
+            mRotateExitAnimation = null;
+        }
+        if (mRotateEnterAnimation != null) {
+            mRotateEnterAnimation.cancel();
+            mRotateEnterAnimation = null;
         }
     }
 
     public boolean isAnimating() {
-        return mEnterAnimation != null || mExitAnimation != null;
+        return mStartEnterAnimation != null || mStartExitAnimation != null
+                && mFinishEnterAnimation != null || mFinishExitAnimation != null
+                && mRotateEnterAnimation != null || mRotateExitAnimation != null;
     }
 
     public boolean stepAnimation(long now) {
-        if (mEnterAnimation == null && mExitAnimation == null) {
+        if (!isAnimating()) {
+            if (DEBUG_STATE) Slog.v(TAG, "Step: no animations running");
             return false;
         }
 
-        if (!mStarted) {
-            if (mEnterAnimation != null) {
-                mEnterAnimation.setStartTime(now);
+        if (!mAnimRunning) {
+            if (DEBUG_STATE) Slog.v(TAG, "Step: starting start, finish, rotate");
+            if (mStartEnterAnimation != null) {
+                mStartEnterAnimation.setStartTime(now);
             }
-            if (mExitAnimation != null) {
-                mExitAnimation.setStartTime(now);
+            if (mStartExitAnimation != null) {
+                mStartExitAnimation.setStartTime(now);
             }
-            mStarted = true;
+            if (mFinishEnterAnimation != null) {
+                mFinishEnterAnimation.setStartTime(0);
+            }
+            if (mFinishExitAnimation != null) {
+                mFinishExitAnimation.setStartTime(0);
+            }
+            if (mRotateEnterAnimation != null) {
+                mRotateEnterAnimation.setStartTime(now);
+            }
+            if (mRotateExitAnimation != null) {
+                mRotateExitAnimation.setStartTime(now);
+            }
+            mAnimRunning = true;
         }
 
-        mExitTransformation.clear();
-        boolean moreExit = false;
-        if (mExitAnimation != null) {
-            moreExit = mExitAnimation.getTransformation(now, mExitTransformation);
-            if (DEBUG) Slog.v(TAG, "Stepped exit: " + mExitTransformation);
-            if (!moreExit) {
-                if (DEBUG) Slog.v(TAG, "Exit animation done!");
-                mExitAnimation.cancel();
-                mExitAnimation = null;
-                mExitTransformation.clear();
-                if (mSurface != null) {
-                    mSurface.hide();
-                }
+        if (mFinishAnimReady && mFinishAnimStartTime < 0) {
+            if (DEBUG_STATE) Slog.v(TAG, "Step: finish anim now ready");
+            mFinishAnimStartTime = now;
+        }
+
+        // If the start animation is no longer running, we want to keep its
+        // transformation intact until the finish animation also completes.
+
+        boolean moreStartExit = false;
+        if (mStartExitAnimation != null) {
+            mStartExitTransformation.clear();
+            moreStartExit = mStartExitAnimation.getTransformation(now, mStartExitTransformation);
+            if (DEBUG_TRANSFORMS) Slog.v(TAG, "Stepped start exit: " + mStartExitTransformation);
+            if (!moreStartExit) {
+                if (DEBUG_STATE) Slog.v(TAG, "Start exit animation done!");
+                mStartExitAnimation.cancel();
+                mStartExitAnimation = null;
             }
         }
 
-        mEnterTransformation.clear();
-        boolean moreEnter = false;
-        if (mEnterAnimation != null) {
-            moreEnter = mEnterAnimation.getTransformation(now, mEnterTransformation);
-            if (!moreEnter) {
-                mEnterAnimation.cancel();
-                mEnterAnimation = null;
-                mEnterTransformation.clear();
-                if (mBlackFrame != null) {
-                    mBlackFrame.hide();
-                }
-            } else {
-                if (mBlackFrame != null) {
-                    mBlackFrame.setMatrix(mEnterTransformation.getMatrix());
-                }
+        boolean moreStartEnter = false;
+        if (mStartEnterAnimation != null) {
+            mStartEnterTransformation.clear();
+            moreStartEnter = mStartEnterAnimation.getTransformation(now, mStartEnterTransformation);
+            if (DEBUG_TRANSFORMS) Slog.v(TAG, "Stepped start enter: " + mStartEnterTransformation);
+            if (!moreStartEnter) {
+                if (DEBUG_STATE) Slog.v(TAG, "Start enter animation done!");
+                mStartEnterAnimation.cancel();
+                mStartEnterAnimation = null;
+            }
+        }
+
+        long finishNow = mFinishAnimReady ? (now - mFinishAnimStartTime) : 0;
+        if (DEBUG_STATE) Slog.v(TAG, "Step: finishNow=" + finishNow);
+
+        mFinishExitTransformation.clear();
+        boolean moreFinishExit = false;
+        if (mFinishExitAnimation != null) {
+            moreFinishExit = mFinishExitAnimation.getTransformation(finishNow, mFinishExitTransformation);
+            if (DEBUG_TRANSFORMS) Slog.v(TAG, "Stepped finish exit: " + mFinishExitTransformation);
+            if (!moreStartExit && !moreFinishExit) {
+                if (DEBUG_STATE) Slog.v(TAG, "Finish exit animation done, clearing start/finish anims!");
+                mStartExitTransformation.clear();
+                mFinishExitAnimation.cancel();
+                mFinishExitAnimation = null;
+                mFinishExitTransformation.clear();
+            }
+        }
+
+        mFinishEnterTransformation.clear();
+        boolean moreFinishEnter = false;
+        if (mFinishEnterAnimation != null) {
+            moreFinishEnter = mFinishEnterAnimation.getTransformation(finishNow, mFinishEnterTransformation);
+            if (DEBUG_TRANSFORMS) Slog.v(TAG, "Stepped finish enter: " + mFinishEnterTransformation);
+            if (!moreStartEnter && !moreFinishEnter) {
+                if (DEBUG_STATE) Slog.v(TAG, "Finish enter animation done, clearing start/finish anims!");
+                mStartEnterTransformation.clear();
+                mFinishEnterAnimation.cancel();
+                mFinishEnterAnimation = null;
+                mFinishEnterTransformation.clear();
+            }
+        }
+
+        mRotateExitTransformation.clear();
+        boolean moreRotateExit = false;
+        if (mRotateExitAnimation != null) {
+            moreRotateExit = mRotateExitAnimation.getTransformation(now, mRotateExitTransformation);
+            if (DEBUG_TRANSFORMS) Slog.v(TAG, "Stepped rotate exit: " + mRotateExitTransformation);
+        }
+
+        if (!moreFinishExit && !moreRotateExit) {
+            if (DEBUG_STATE) Slog.v(TAG, "Rotate exit animation done!");
+            mRotateExitAnimation.cancel();
+            mRotateExitAnimation = null;
+            mRotateExitTransformation.clear();
+        }
+
+        mRotateEnterTransformation.clear();
+        boolean moreRotateEnter = false;
+        if (mRotateEnterAnimation != null) {
+            moreRotateEnter = mRotateEnterAnimation.getTransformation(now, mRotateEnterTransformation);
+            if (DEBUG_TRANSFORMS) Slog.v(TAG, "Stepped rotate enter: " + mRotateEnterTransformation);
+        }
+
+        if (!moreFinishEnter && !moreRotateEnter) {
+            if (DEBUG_STATE) Slog.v(TAG, "Rotate enter animation done!");
+            mRotateEnterAnimation.cancel();
+            mRotateEnterAnimation = null;
+            mRotateEnterTransformation.clear();
+        }
+
+        mExitTransformation.set(mRotateExitTransformation);
+        mExitTransformation.compose(mStartExitTransformation);
+        mExitTransformation.compose(mFinishExitTransformation);
+
+        mEnterTransformation.set(mRotateEnterTransformation);
+        mEnterTransformation.compose(mStartEnterTransformation);
+        mEnterTransformation.compose(mFinishEnterTransformation);
+
+        if (DEBUG_TRANSFORMS) Slog.v(TAG, "Final exit: " + mExitTransformation);
+        if (DEBUG_TRANSFORMS) Slog.v(TAG, "Final enter: " + mEnterTransformation);
+
+        if (!moreStartExit && !moreFinishExit && !moreRotateExit) {
+            if (mSurface != null) {
+                if (DEBUG_STATE) Slog.v(TAG, "Exit animations done, hiding screenshot surface");
+                mSurface.hide();
+            }
+        }
+
+        if (!moreStartEnter && !moreFinishEnter && !moreRotateEnter) {
+            if (mBlackFrame != null) {
+                if (DEBUG_STATE) Slog.v(TAG, "Enter animations done, hiding black frame");
+                mBlackFrame.hide();
+            }
+        } else {
+            if (mBlackFrame != null) {
+                mBlackFrame.setMatrix(mEnterTransformation.getMatrix());
             }
         }
 
         mSnapshotFinalMatrix.setConcat(mExitTransformation.getMatrix(), mSnapshotInitialMatrix);
         setSnapshotTransform(mSnapshotFinalMatrix, mExitTransformation.getAlpha());
 
-        return moreEnter || moreExit;
+        final boolean more = moreStartEnter || moreStartExit || moreFinishEnter || moreFinishExit
+                || moreRotateEnter || moreRotateExit || !mFinishAnimReady;
+
+        if (DEBUG_STATE) Slog.v(TAG, "Step: more=" + more);
+
+        return more;
     }
 
     public Transformation getEnterTransformation() {
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 75ace4f..04c1c98 100644
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -95,6 +95,7 @@
 import android.util.Slog;
 import android.util.SparseIntArray;
 import android.util.TypedValue;
+import android.view.Choreographer;
 import android.view.Display;
 import android.view.Gravity;
 import android.view.IApplicationToken;
@@ -141,7 +142,8 @@
 
 /** {@hide} */
 public class WindowManagerService extends IWindowManager.Stub
-        implements Watchdog.Monitor, WindowManagerPolicy.WindowManagerFuncs {
+        implements Watchdog.Monitor, WindowManagerPolicy.WindowManagerFuncs,
+        Choreographer.OnAnimateListener {
     static final String TAG = "WindowManager";
     static final boolean DEBUG = false;
     static final boolean DEBUG_ADD_REMOVE = false;
@@ -456,7 +458,7 @@
     int mDeferredRotationPauseCount;
 
     boolean mLayoutNeeded = true;
-    boolean mAnimationPending = false;
+    boolean mTraversalScheduled = false;
     boolean mDisplayFrozen = false;
     boolean mWaitingForConfig = false;
     boolean mWindowsFreezingScreen = false;
@@ -503,14 +505,18 @@
     final DisplayMetrics mTmpDisplayMetrics = new DisplayMetrics();
     final DisplayMetrics mCompatDisplayMetrics = new DisplayMetrics();
 
-    H mH = new H();
+    final H mH = new H();
+
+    final Choreographer mChoreographer = Choreographer.getInstance();
 
     WindowState mCurrentFocus = null;
     WindowState mLastFocus = null;
 
-    // This just indicates the window the input method is on top of, not
-    // necessarily the window its input is going to.
+    /** This just indicates the window the input method is on top of, not
+     * necessarily the window its input is going to. */
     WindowState mInputMethodTarget = null;
+
+    /** If true hold off on modifying the animation layer of mInputMethodTarget */
     boolean mInputMethodTargetWaitingAnim;
     int mInputMethodAnimLayerAdjustment;
 
@@ -559,6 +565,7 @@
 
     float mWindowAnimationScale = 1.0f;
     float mTransitionAnimationScale = 1.0f;
+    float mAnimatorDurationScale = 1.0f;
 
     final InputManager mInputManager;
 
@@ -570,6 +577,29 @@
 
     DragState mDragState = null;
 
+    /** Pulled out of performLayoutAndPlaceSurfacesLockedInner in order to refactor into multiple
+     * methods. */
+    private class LayoutAndSurfaceFields {
+        private boolean mAnimating = false;
+        private boolean mWallpaperForceHidingChanged = false;
+        private boolean mTokenMayBeDrawn = false;
+        private boolean mWallpaperMayChange = false;
+        private boolean mForceHiding = false;
+        private WindowState mDetachedWallpaper = null;
+        private WindowState mWindowAnimationBackground = null;
+        private int mWindowAnimationBackgroundColor = 0;
+        private boolean mOrientationChangeComplete = true;
+        private int mAdjResult = 0;
+        private Session mHoldScreen = null;
+        private boolean mObscured = false;
+        private boolean mBlurring = false;
+        private boolean mDimming = false;
+        private boolean mSyswin = false;
+        private float mScreenBrightness = -1;
+        private float mButtonBrightness = -1;
+    }
+    private LayoutAndSurfaceFields mInnerFields = new LayoutAndSurfaceFields();
+
     final class DragInputEventReceiver extends InputEventReceiver {
         public DragInputEventReceiver(InputChannel inputChannel, Looper looper) {
             super(inputChannel, looper);
@@ -691,6 +721,7 @@
             Looper.prepare();
             WindowManagerService s = new WindowManagerService(mContext, mPM,
                     mHaveInputMethods, mAllowBootMessages);
+            s.mChoreographer.addOnAnimateListener(s);
             android.os.Process.setThreadPriority(
                     android.os.Process.THREAD_PRIORITY_DISPLAY);
             android.os.Process.setCanSelfBackground(false);
@@ -774,6 +805,8 @@
                 Settings.System.WINDOW_ANIMATION_SCALE, mWindowAnimationScale);
         mTransitionAnimationScale = Settings.System.getFloat(context.getContentResolver(),
                 Settings.System.TRANSITION_ANIMATION_SCALE, mTransitionAnimationScale);
+        mAnimatorDurationScale = Settings.System.getFloat(context.getContentResolver(),
+                Settings.System.ANIMATOR_DURATION_SCALE, mTransitionAnimationScale);
 
         // Track changes to DevicePolicyManager state so we can enable/disable keyguard.
         IntentFilter filter = new IntentFilter();
@@ -1082,6 +1115,11 @@
         return false;
     }
 
+    /**
+     * Dig through the WindowStates and find the one that the Input Method will target.
+     * @param willMove
+     * @return The index+1 in mWindows of the discovered target.
+     */
     int findDesiredInputMethodWindowIndexLocked(boolean willMove) {
         final ArrayList<WindowState> localmWindows = mWindows;
         final int N = localmWindows.size();
@@ -1114,8 +1152,10 @@
             }
         }
 
+        // Now w is either mWindows[0] or an IME (or null if mWindows is empty).
+
         if (DEBUG_INPUT_METHOD && willMove) Slog.v(TAG, "Proposed new IME target: " + w);
-        
+
         // Now, a special case -- if the last target's window is in the
         // process of exiting, and is above the new target, keep on the
         // last target to avoid flicker.  Consider for example a Dialog with
@@ -1147,8 +1187,7 @@
                 WindowState highestTarget = null;
                 int highestPos = 0;
                 if (token.animating || token.animation != null) {
-                    int pos = 0;
-                    pos = localmWindows.indexOf(curTarget);
+                    int pos = localmWindows.indexOf(curTarget);
                     while (pos >= 0) {
                         WindowState win = localmWindows.get(pos);
                         if (win.mAppToken != token) {
@@ -2543,8 +2582,12 @@
             if (win == null) {
                 return 0;
             }
-            win.mRequestedWidth = requestedWidth;
-            win.mRequestedHeight = requestedHeight;
+            if (win.mRequestedWidth != requestedWidth
+                    || win.mRequestedHeight != requestedHeight) {
+                win.mLayoutNeeded = true;
+                win.mRequestedWidth = requestedWidth;
+                win.mRequestedHeight = requestedHeight;
+            }
             if (attrs != null && seq == win.mSeq) {
                 win.mSystemUiVisibility = systemUiVisibility;
             }
@@ -2565,6 +2608,9 @@
                 }
                 flagChanges = win.mAttrs.flags ^= attrs.flags;
                 attrChanges = win.mAttrs.copyFrom(attrs);
+                if ((attrChanges&WindowManager.LayoutParams.LAYOUT_CHANGED) != 0) {
+                    win.mLayoutNeeded = true;
+                }
             }
 
             if (DEBUG_LAYOUT) Slog.v(TAG, "Relayout " + win + ": " + win.mAttrs);
@@ -3446,7 +3492,7 @@
             // the value of the previous configuration.
             mTempConfiguration.setToDefaults();
             mTempConfiguration.fontScale = currentConfig.fontScale;
-            if (computeNewConfigurationLocked(mTempConfiguration)) {
+            if (computeScreenConfigurationLocked(mTempConfiguration)) {
                 if (currentConfig.diff(mTempConfiguration) != 0) {
                     mWaitingForConfig = true;
                     mLayoutNeeded = true;
@@ -4650,6 +4696,7 @@
         switch (which) {
             case 0: mWindowAnimationScale = fixScale(scale); break;
             case 1: mTransitionAnimationScale = fixScale(scale); break;
+            case 2: mAnimatorDurationScale = fixScale(scale); break;
         }
 
         // Persist setting
@@ -4669,6 +4716,9 @@
             if (scales.length >= 2) {
                 mTransitionAnimationScale = fixScale(scales[1]);
             }
+            if (scales.length >= 3) {
+                mAnimatorDurationScale = fixScale(scales[2]);
+            }
         }
 
         // Persist setting
@@ -4679,12 +4729,14 @@
         switch (which) {
             case 0: return mWindowAnimationScale;
             case 1: return mTransitionAnimationScale;
+            case 2: return mAnimatorDurationScale;
         }
         return 0;
     }
 
     public float[] getAnimationScales() {
-        return new float[] { mWindowAnimationScale, mTransitionAnimationScale };
+        return new float[] { mWindowAnimationScale, mTransitionAnimationScale,
+                mAnimatorDurationScale };
     }
 
     public int getSwitchState(int sw) {
@@ -5362,6 +5414,14 @@
         startFreezingDisplayLocked(inTransaction);
         mInputManager.setDisplayOrientation(0, rotation);
 
+        // We need to update our screen size information to match the new
+        // rotation.  Note that this is redundant with the later call to
+        // sendNewConfiguration() that must be called after this function
+        // returns...  however we need to do the screen size part of that
+        // before then so we have the correct size to use when initializiation
+        // the rotation animation for the new rotation.
+        computeScreenConfigurationLocked(null);
+
         if (!inTransaction) {
             if (SHOW_TRANSACTIONS)  Slog.i(TAG,
                     ">>> OPEN TRANSACTION setRotationUnchecked");
@@ -5372,7 +5432,11 @@
             //       it doesn't support hardware OpenGL emulation yet.
             if (CUSTOM_SCREEN_ROTATION && mScreenRotationAnimation != null
                     && mScreenRotationAnimation.hasScreenshot()) {
-                mScreenRotationAnimation.setRotation(rotation);
+                if (mScreenRotationAnimation.setRotation(rotation, mFxSession,
+                        MAX_ANIMATION_DURATION, mTransitionAnimationScale,
+                        mCurDisplayWidth, mCurDisplayHeight)) {
+                    mChoreographer.scheduleAnimation();
+                }
             }
             Surface.setOrientation(0, rotation);
         } finally {
@@ -5860,7 +5924,7 @@
     Configuration computeNewConfigurationLocked() {
         Configuration config = new Configuration();
         config.fontScale = 0;
-        if (!computeNewConfigurationLocked(config)) {
+        if (!computeScreenConfigurationLocked(config)) {
             return null;
         }
         return config;
@@ -6011,12 +6075,10 @@
         return sw;
     }
 
-    boolean computeNewConfigurationLocked(Configuration config) {
+    boolean computeScreenConfigurationLocked(Configuration config) {
         if (mDisplay == null) {
             return false;
         }
-        
-        mInputManager.getInputConfiguration(config);
 
         // Use the effective "visual" dimensions based on current rotation
         final boolean rotated = (mRotation == Surface.ROTATION_90
@@ -6050,13 +6112,17 @@
         final int dw = mCurDisplayWidth;
         final int dh = mCurDisplayHeight;
 
-        int orientation = Configuration.ORIENTATION_SQUARE;
-        if (dw < dh) {
-            orientation = Configuration.ORIENTATION_PORTRAIT;
-        } else if (dw > dh) {
-            orientation = Configuration.ORIENTATION_LANDSCAPE;
+        if (config != null) {
+            mInputManager.getInputConfiguration(config);
+
+            int orientation = Configuration.ORIENTATION_SQUARE;
+            if (dw < dh) {
+                orientation = Configuration.ORIENTATION_PORTRAIT;
+            } else if (dw > dh) {
+                orientation = Configuration.ORIENTATION_LANDSCAPE;
+            }
+            config.orientation = orientation;
         }
-        config.orientation = orientation;
 
         // Update real display metrics.
         mDisplay.getMetricsWithSize(mRealDisplayMetrics, mCurDisplayWidth, mCurDisplayHeight);
@@ -6078,36 +6144,39 @@
         mCompatibleScreenScale = CompatibilityInfo.computeCompatibleScaling(dm,
                 mCompatDisplayMetrics);
 
-        config.screenWidthDp = (int)(mPolicy.getConfigDisplayWidth(dw, dh, mRotation)
-                / dm.density);
-        config.screenHeightDp = (int)(mPolicy.getConfigDisplayHeight(dw, dh, mRotation)
-                / dm.density);
-        computeSmallestWidthAndScreenLayout(rotated, dw, dh, dm.density, config);
+        if (config != null) {
+            config.screenWidthDp = (int)(mPolicy.getConfigDisplayWidth(dw, dh, mRotation)
+                    / dm.density);
+            config.screenHeightDp = (int)(mPolicy.getConfigDisplayHeight(dw, dh, mRotation)
+                    / dm.density);
+            computeSmallestWidthAndScreenLayout(rotated, dw, dh, dm.density, config);
 
-        config.compatScreenWidthDp = (int)(config.screenWidthDp / mCompatibleScreenScale);
-        config.compatScreenHeightDp = (int)(config.screenHeightDp / mCompatibleScreenScale);
-        config.compatSmallestScreenWidthDp = computeCompatSmallestWidth(rotated, dm, dw, dh);
+            config.compatScreenWidthDp = (int)(config.screenWidthDp / mCompatibleScreenScale);
+            config.compatScreenHeightDp = (int)(config.screenHeightDp / mCompatibleScreenScale);
+            config.compatSmallestScreenWidthDp = computeCompatSmallestWidth(rotated, dm, dw, dh);
 
-        // Determine whether a hard keyboard is available and enabled.
-        boolean hardKeyboardAvailable = config.keyboard != Configuration.KEYBOARD_NOKEYS;
-        if (hardKeyboardAvailable != mHardKeyboardAvailable) {
-            mHardKeyboardAvailable = hardKeyboardAvailable;
-            mHardKeyboardEnabled = hardKeyboardAvailable;
+            // Determine whether a hard keyboard is available and enabled.
+            boolean hardKeyboardAvailable = config.keyboard != Configuration.KEYBOARD_NOKEYS;
+            if (hardKeyboardAvailable != mHardKeyboardAvailable) {
+                mHardKeyboardAvailable = hardKeyboardAvailable;
+                mHardKeyboardEnabled = hardKeyboardAvailable;
 
-            mH.removeMessages(H.REPORT_HARD_KEYBOARD_STATUS_CHANGE);
-            mH.sendEmptyMessage(H.REPORT_HARD_KEYBOARD_STATUS_CHANGE);
-        }
-        if (!mHardKeyboardEnabled) {
-            config.keyboard = Configuration.KEYBOARD_NOKEYS;
+                mH.removeMessages(H.REPORT_HARD_KEYBOARD_STATUS_CHANGE);
+                mH.sendEmptyMessage(H.REPORT_HARD_KEYBOARD_STATUS_CHANGE);
+            }
+            if (!mHardKeyboardEnabled) {
+                config.keyboard = Configuration.KEYBOARD_NOKEYS;
+            }
+
+            // Update value of keyboardHidden, hardKeyboardHidden and navigationHidden
+            // based on whether a hard or soft keyboard is present, whether navigation keys
+            // are present and the lid switch state.
+            config.keyboardHidden = Configuration.KEYBOARDHIDDEN_NO;
+            config.hardKeyboardHidden = Configuration.HARDKEYBOARDHIDDEN_NO;
+            config.navigationHidden = Configuration.NAVIGATIONHIDDEN_NO;
+            mPolicy.adjustConfigurationLw(config);
         }
 
-        // Update value of keyboardHidden, hardKeyboardHidden and navigationHidden
-        // based on whether a hard or soft keyboard is present, whether navigation keys
-        // are present and the lid switch state.
-        config.keyboardHidden = Configuration.KEYBOARDHIDDEN_NO;
-        config.hardKeyboardHidden = Configuration.HARDKEYBOARDHIDDEN_NO;
-        config.navigationHidden = Configuration.NAVIGATIONHIDDEN_NO;
-        mPolicy.adjustConfigurationLw(config);
         return true;
     }
 
@@ -6180,7 +6249,6 @@
                         final IBinder winBinder = window.asBinder();
                         token = new Binder();
                         mDragState = new DragState(this, token, surface, /*flags*/ 0, winBinder);
-                        mDragState.mSurface = surface;
                         token = mDragState.mToken = new Binder();
 
                         // 5 second timeout for this window to actually begin the drag
@@ -6489,7 +6557,7 @@
     final class H extends Handler {
         public static final int REPORT_FOCUS_CHANGE = 2;
         public static final int REPORT_LOSING_FOCUS = 3;
-        public static final int ANIMATE = 4;
+        public static final int DO_TRAVERSAL = 4;
         public static final int ADD_STARTING = 5;
         public static final int REMOVE_STARTING = 6;
         public static final int FINISHED_STARTING = 7;
@@ -6583,9 +6651,9 @@
                     }
                 } break;
 
-                case ANIMATE: {
+                case DO_TRAVERSAL: {
                     synchronized(mWindowMap) {
-                        mAnimationPending = false;
+                        mTraversalScheduled = false;
                         performLayoutAndPlaceSurfacesLocked();
                     }
                 } break;
@@ -6801,12 +6869,14 @@
                             Settings.System.WINDOW_ANIMATION_SCALE, mWindowAnimationScale);
                     Settings.System.putFloat(mContext.getContentResolver(),
                             Settings.System.TRANSITION_ANIMATION_SCALE, mTransitionAnimationScale);
+                    Settings.System.putFloat(mContext.getContentResolver(),
+                            Settings.System.ANIMATOR_DURATION_SCALE, mAnimatorDurationScale);
                     break;
                 }
 
                 case FORCE_GC: {
                     synchronized(mWindowMap) {
-                        if (mAnimationPending) {
+                        if (mChoreographer.isAnimationScheduled()) {
                             // If we are animating, don't do the gc now but
                             // delay a bit so we don't interrupt the animation.
                             mH.sendMessageDelayed(mH.obtainMessage(H.FORCE_GC),
@@ -7114,7 +7184,7 @@
         boolean configChanged = updateOrientationFromAppTokensLocked(false);
         mTempConfiguration.setToDefaults();
         mTempConfiguration.fontScale = mCurConfiguration.fontScale;
-        if (computeNewConfigurationLocked(mTempConfiguration)) {
+        if (computeScreenConfigurationLocked(mTempConfiguration)) {
             if (mCurConfiguration.diff(mTempConfiguration) != 0) {
                 configChanged = true;
             }
@@ -7345,7 +7415,7 @@
         try {
             performLayoutAndPlaceSurfacesLockedInner(recoveringMemory);
 
-            int N = mPendingRemove.size();
+            final int N = mPendingRemove.size();
             if (N > 0) {
                 if (mPendingRemoveTmp.length < N) {
                     mPendingRemoveTmp = new WindowState[N+10];
@@ -7365,7 +7435,7 @@
             } else {
                 mInLayout = false;
                 if (mLayoutNeeded) {
-                    requestAnimationLocked(0);
+                    requestTraversalLocked();
                 }
             }
             if (mWindowsChanged && !mWindowChangeListeners.isEmpty()) {
@@ -7378,9 +7448,9 @@
         }
     }
 
-    private final int performLayoutLockedInner(boolean initial, boolean updateInputWindows) {
+    private final void performLayoutLockedInner(boolean initial, boolean updateInputWindows) {
         if (!mLayoutNeeded) {
-            return 0;
+            return;
         }
         
         mLayoutNeeded = false;
@@ -7396,8 +7466,11 @@
         final int N = mWindows.size();
         int i;
 
-        if (DEBUG_LAYOUT) Slog.v(TAG, "performLayout: needed="
-                + mLayoutNeeded + " dw=" + dw + " dh=" + dh);
+        if (DEBUG_LAYOUT) {
+            Slog.v(TAG, "-------------------------------------");
+            Slog.v(TAG, "performLayout: needed="
+                    + mLayoutNeeded + " dw=" + dw + " dh=" + dh);
+        }
         
         mPolicy.beginLayoutLw(dw, dh, mRotation);
 
@@ -7409,24 +7482,25 @@
         // to another window).
         int topAttached = -1;
         for (i = N-1; i >= 0; i--) {
-            WindowState win = mWindows.get(i);
+            final WindowState win = mWindows.get(i);
 
             // Don't do layout of a window if it is not visible, or
             // soon won't be visible, to avoid wasting time and funky
             // changes while a window is animating away.
-            final AppWindowToken atoken = win.mAppToken;
-            final boolean gone = win.mViewVisibility == View.GONE
-                    || !win.mRelayoutCalled
-                    || (atoken == null && win.mRootToken.hidden)
-                    || (atoken != null && atoken.hiddenRequested)
-                    || win.mAttachedHidden
-                    || win.mExiting || win.mDestroying;
+            final boolean gone = win.isGoneForLayoutLw();
 
             if (DEBUG_LAYOUT && !win.mLayoutAttached) {
-                Slog.v(TAG, "First pass " + win
+                Slog.v(TAG, "1ST PASS " + win
                         + ": gone=" + gone + " mHaveFrame=" + win.mHaveFrame
                         + " mLayoutAttached=" + win.mLayoutAttached);
-                if (gone) Slog.v(TAG, "  (mViewVisibility="
+                final AppWindowToken atoken = win.mAppToken;
+                if (gone) Slog.v(TAG, "  GONE: mViewVisibility="
+                        + win.mViewVisibility + " mRelayoutCalled="
+                        + win.mRelayoutCalled + " hidden="
+                        + win.mRootToken.hidden + " hiddenRequested="
+                        + (atoken != null && atoken.hiddenRequested)
+                        + " mAttachedHidden=" + win.mAttachedHidden);
+                else Slog.v(TAG, "  VIS: mViewVisibility="
                         + win.mViewVisibility + " mRelayoutCalled="
                         + win.mRelayoutCalled + " hidden="
                         + win.mRootToken.hidden + " hiddenRequested="
@@ -7439,16 +7513,17 @@
             // if they want.  (We do the normal layout for INVISIBLE
             // windows, since that means "perform layout as normal,
             // just don't display").
-            if (!gone || !win.mHaveFrame) {
+            if (!gone || !win.mHaveFrame || win.mLayoutNeeded) {
                 if (!win.mLayoutAttached) {
                     if (initial) {
                         //Slog.i(TAG, "Window " + this + " clearing mContentChanged - initial");
                         win.mContentChanged = false;
                     }
+                    win.mLayoutNeeded = false;
                     win.prelayout();
                     mPolicy.layoutWindowLw(win, win.mAttrs, null);
                     win.mLayoutSeq = seq;
-                    if (DEBUG_LAYOUT) Slog.v(TAG, "-> mFrame="
+                    if (DEBUG_LAYOUT) Slog.v(TAG, "  LAYOUT: mFrame="
                             + win.mFrame + " mContainingFrame="
                             + win.mContainingFrame + " mDisplayFrame="
                             + win.mDisplayFrame);
@@ -7463,10 +7538,10 @@
         // XXX does not deal with windows that are attached to windows
         // that are themselves attached.
         for (i = topAttached; i >= 0; i--) {
-            WindowState win = mWindows.get(i);
+            final WindowState win = mWindows.get(i);
 
             if (win.mLayoutAttached) {
-                if (DEBUG_LAYOUT) Slog.v(TAG, "Second pass " + win
+                if (DEBUG_LAYOUT) Slog.v(TAG, "2ND PASS " + win
                         + " mHaveFrame=" + win.mHaveFrame
                         + " mViewVisibility=" + win.mViewVisibility
                         + " mRelayoutCalled=" + win.mRelayoutCalled);
@@ -7476,15 +7551,16 @@
                 // windows, since that means "perform layout as normal,
                 // just don't display").
                 if ((win.mViewVisibility != View.GONE && win.mRelayoutCalled)
-                        || !win.mHaveFrame) {
+                        || !win.mHaveFrame || win.mLayoutNeeded) {
                     if (initial) {
                         //Slog.i(TAG, "Window " + this + " clearing mContentChanged - initial");
                         win.mContentChanged = false;
                     }
+                    win.mLayoutNeeded = false;
                     win.prelayout();
                     mPolicy.layoutWindowLw(win, win.mAttrs, win.mAttachedWindow);
                     win.mLayoutSeq = seq;
-                    if (DEBUG_LAYOUT) Slog.v(TAG, "-> mFrame="
+                    if (DEBUG_LAYOUT) Slog.v(TAG, "  LAYOUT: mFrame="
                             + win.mFrame + " mContainingFrame="
                             + win.mContainingFrame + " mDisplayFrame="
                             + win.mDisplayFrame);
@@ -7498,7 +7574,7 @@
             mInputMonitor.updateInputWindowsLw(false /*force*/);
         }
 
-        return mPolicy.finishLayoutLw();
+        mPolicy.finishLayoutLw();
     }
 
     void makeWindowFreezingScreenIfNeededLocked(WindowState w) {
@@ -7520,6 +7596,1006 @@
         }
     }
 
+    /**
+     * Extracted from {@link #performLayoutAndPlaceSurfacesLockedInner} to reduce size of method.
+     * Update animations of all applications, including those associated with exiting/removed apps.
+     *
+     * @param currentTime The time which animations use for calculating transitions.
+     * @param innerDw Width of app window.
+     * @param innerDh Height of app window.
+     * @return true if rotation has stopped, false otherwise
+     */
+    private boolean updateAppsAndRotationAnimationsLocked(long currentTime,
+                                                          int innerDw, int innerDh) {
+        int i;
+        final int NAT = mAppTokens.size();
+        for (i=0; i<NAT; i++) {
+            if (mAppTokens.get(i).stepAnimationLocked(currentTime,
+                    innerDw, innerDh)) {
+                mInnerFields.mAnimating = true;
+            }
+        }
+        final int NEAT = mExitingAppTokens.size();
+        for (i=0; i<NEAT; i++) {
+            if (mExitingAppTokens.get(i).stepAnimationLocked(currentTime,
+                    innerDw, innerDh)) {
+                mInnerFields.mAnimating = true;
+            }
+        }
+
+        boolean updateRotation = false;
+        if (mScreenRotationAnimation != null) {
+            if (mScreenRotationAnimation.isAnimating()) {
+                if (mScreenRotationAnimation.stepAnimation(currentTime)) {
+                    mInnerFields.mAnimating = true;
+                } else {
+                    updateRotation = true;
+                }
+            }
+        }
+
+        return updateRotation;
+    }
+
+    /**
+     * Extracted from {@link #performLayoutAndPlaceSurfacesLockedInner} to reduce size of method.
+     *
+     * @param currentTime The time which animations use for calculating transitions.
+     * @param innerDw Width of app window.
+     * @param innerDh Height of app window.
+     */
+    private void updateWindowsAndWallpaperLocked(final long currentTime,
+                                                 final int innerDw, final int innerDh) {
+        int i;
+        final int N = mWindows.size();
+
+        for (i=N-1; i>=0; i--) {
+            WindowState w = mWindows.get(i);
+
+            final WindowManager.LayoutParams attrs = w.mAttrs;
+
+            if (w.mSurface != null) {
+                // Take care of the window being ready to display.
+                if (w.commitFinishDrawingLocked(currentTime)) {
+                    if ((w.mAttrs.flags
+                            & WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER) != 0) {
+                        if (DEBUG_WALLPAPER) Slog.v(TAG,
+                                "First draw done in potential wallpaper target " + w);
+                        mInnerFields.mWallpaperMayChange = true;
+                    }
+                }
+
+                final boolean wasAnimating = w.mAnimating;
+
+                int animDw = innerDw;
+                int animDh = innerDh;
+
+                // If the window has moved due to its containing
+                // content frame changing, then we'd like to animate
+                // it.  The checks here are ordered by what is least
+                // likely to be true first.
+                if (w.shouldAnimateMove()) {
+                    // Frame has moved, containing content frame
+                    // has also moved, and we're not currently animating...
+                    // let's do something.
+                    Animation a = AnimationUtils.loadAnimation(mContext,
+                            com.android.internal.R.anim.window_move_from_decor);
+                    w.setAnimation(a);
+                    animDw = w.mLastFrame.left - w.mFrame.left;
+                    animDh = w.mLastFrame.top - w.mFrame.top;
+                }
+
+                // Execute animation.
+                final boolean nowAnimating = w.stepAnimationLocked(currentTime,
+                        animDw, animDh);
+
+                // If this window is animating, make a note that we have
+                // an animating window and take care of a request to run
+                // a detached wallpaper animation.
+                if (nowAnimating) {
+                    if (w.mAnimation != null) {
+                        if ((w.mAttrs.flags&FLAG_SHOW_WALLPAPER) != 0
+                                && w.mAnimation.getDetachWallpaper()) {
+                            mInnerFields.mDetachedWallpaper = w;
+                        }
+                        if (w.mAnimation.getBackgroundColor() != 0) {
+                            if (mInnerFields.mWindowAnimationBackground == null
+                                    || (w.mAnimLayer <
+                                            mInnerFields.mWindowAnimationBackground.mAnimLayer)) {
+                                mInnerFields.mWindowAnimationBackground = w;
+                                mInnerFields.mWindowAnimationBackgroundColor =
+                                        w.mAnimation.getBackgroundColor();
+                            }
+                        }
+                    }
+                    mInnerFields.mAnimating = true;
+                }
+
+                // If this window's app token is running a detached wallpaper
+                // animation, make a note so we can ensure the wallpaper is
+                // displayed behind it.
+                if (w.mAppToken != null && w.mAppToken.animation != null
+                        && w.mAppToken.animating) {
+                    if ((w.mAttrs.flags&FLAG_SHOW_WALLPAPER) != 0
+                            && w.mAppToken.animation.getDetachWallpaper()) {
+                        mInnerFields.mDetachedWallpaper = w;
+                    }
+                    if (w.mAppToken.animation.getBackgroundColor() != 0) {
+                        if (mInnerFields.mWindowAnimationBackground == null
+                                || (w.mAnimLayer <
+                                        mInnerFields.mWindowAnimationBackground.mAnimLayer)) {
+                            mInnerFields.mWindowAnimationBackground = w;
+                            mInnerFields.mWindowAnimationBackgroundColor =
+                                    w.mAppToken.animation.getBackgroundColor();
+                        }
+                    }
+                }
+
+                if (wasAnimating && !w.mAnimating && mWallpaperTarget == w) {
+                    mInnerFields.mWallpaperMayChange = true;
+                }
+
+                if (mPolicy.doesForceHide(w, attrs)) {
+                    if (!wasAnimating && nowAnimating) {
+                        if (DEBUG_VISIBILITY) Slog.v(TAG,
+                                "Animation started that could impact force hide: "
+                                + w);
+                        mInnerFields.mWallpaperForceHidingChanged = true;
+                        mFocusMayChange = true;
+                    } else if (w.isReadyForDisplay() && w.mAnimation == null) {
+                        mInnerFields.mForceHiding = true;
+                    }
+                } else if (mPolicy.canBeForceHidden(w, attrs)) {
+                    boolean changed;
+                    if (mInnerFields.mForceHiding) {
+                        changed = w.hideLw(false, false);
+                        if (DEBUG_VISIBILITY && changed) Slog.v(TAG,
+                                "Now policy hidden: " + w);
+                    } else {
+                        changed = w.showLw(false, false);
+                        if (DEBUG_VISIBILITY && changed) Slog.v(TAG,
+                                "Now policy shown: " + w);
+                        if (changed) {
+                            if (mInnerFields.mWallpaperForceHidingChanged
+                                    && w.isVisibleNow() /*w.isReadyForDisplay()*/) {
+                                // Assume we will need to animate.  If
+                                // we don't (because the wallpaper will
+                                // stay with the lock screen), then we will
+                                // clean up later.
+                                Animation a = mPolicy.createForceHideEnterAnimation();
+                                if (a != null) {
+                                    w.setAnimation(a);
+                                }
+                            }
+                            if (mCurrentFocus == null ||
+                                    mCurrentFocus.mLayer < w.mLayer) {
+                                // We are showing on to of the current
+                                // focus, so re-evaluate focus to make
+                                // sure it is correct.
+                                mFocusMayChange = true;
+                            }
+                        }
+                    }
+                    if (changed && (attrs.flags
+                            & WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER) != 0) {
+                        mInnerFields.mWallpaperMayChange = true;
+                    }
+                }
+
+                mPolicy.animatingWindowLw(w, attrs);
+            }
+
+            final AppWindowToken atoken = w.mAppToken;
+            if (atoken != null && (!atoken.allDrawn || atoken.freezingScreen)) {
+                if (atoken.lastTransactionSequence != mTransactionSequence) {
+                    atoken.lastTransactionSequence = mTransactionSequence;
+                    atoken.numInterestingWindows = atoken.numDrawnWindows = 0;
+                    atoken.startingDisplayed = false;
+                }
+                if ((w.isOnScreen() || w.mAttrs.type
+                        == WindowManager.LayoutParams.TYPE_BASE_APPLICATION)
+                        && !w.mExiting && !w.mDestroying) {
+                    if (DEBUG_VISIBILITY || DEBUG_ORIENTATION) {
+                        Slog.v(TAG, "Eval win " + w + ": isDrawn="
+                                + w.isDrawnLw()
+                                + ", isAnimating=" + w.isAnimating());
+                        if (!w.isDrawnLw()) {
+                            Slog.v(TAG, "Not displayed: s=" + w.mSurface
+                                    + " pv=" + w.mPolicyVisibility
+                                    + " dp=" + w.mDrawPending
+                                    + " cdp=" + w.mCommitDrawPending
+                                    + " ah=" + w.mAttachedHidden
+                                    + " th=" + atoken.hiddenRequested
+                                    + " a=" + w.mAnimating);
+                        }
+                    }
+                    if (w != atoken.startingWindow) {
+                        if (!atoken.freezingScreen || !w.mAppFreezing) {
+                            atoken.numInterestingWindows++;
+                            if (w.isDrawnLw()) {
+                                atoken.numDrawnWindows++;
+                                if (DEBUG_VISIBILITY || DEBUG_ORIENTATION) Slog.v(TAG,
+                                        "tokenMayBeDrawn: " + atoken
+                                        + " freezingScreen=" + atoken.freezingScreen
+                                        + " mAppFreezing=" + w.mAppFreezing);
+                                mInnerFields.mTokenMayBeDrawn = true;
+                            }
+                        }
+                    } else if (w.isDrawnLw()) {
+                        atoken.startingDisplayed = true;
+                    }
+                }
+            } else if (w.mReadyToShow) {
+                w.performShowLocked();
+            }
+        } // end forall windows
+    }
+
+    /**
+     * Extracted from {@link #performLayoutAndPlaceSurfacesLockedInner} to reduce size of method.
+     *
+     * @return bitmap indicating if another pass through layout must be made.
+     */
+    private int testTokenMayBeDrawnLocked() {
+        int changes = 0;
+        // See if any windows have been drawn, so they (and others
+        // associated with them) can now be shown.
+        final int NT = mAppTokens.size();
+        for (int i=0; i<NT; i++) {
+            AppWindowToken wtoken = mAppTokens.get(i);
+            if (wtoken.freezingScreen) {
+                int numInteresting = wtoken.numInterestingWindows;
+                if (numInteresting > 0 && wtoken.numDrawnWindows >= numInteresting) {
+                    if (DEBUG_VISIBILITY) Slog.v(TAG,
+                            "allDrawn: " + wtoken
+                            + " interesting=" + numInteresting
+                            + " drawn=" + wtoken.numDrawnWindows);
+                    wtoken.showAllWindowsLocked();
+                    unsetAppFreezingScreenLocked(wtoken, false, true);
+                    if (DEBUG_ORIENTATION) Slog.i(TAG,
+                            "Setting mOrientationChangeComplete=true because wtoken "
+                            + wtoken + " numInteresting=" + numInteresting
+                            + " numDrawn=" + wtoken.numDrawnWindows);
+                    mInnerFields.mOrientationChangeComplete = true;
+                }
+            } else if (!wtoken.allDrawn) {
+                int numInteresting = wtoken.numInterestingWindows;
+                if (numInteresting > 0 && wtoken.numDrawnWindows >= numInteresting) {
+                    if (DEBUG_VISIBILITY) Slog.v(TAG,
+                            "allDrawn: " + wtoken
+                            + " interesting=" + numInteresting
+                            + " drawn=" + wtoken.numDrawnWindows);
+                    wtoken.allDrawn = true;
+                    changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_ANIM;
+
+                    // We can now show all of the drawn windows!
+                    if (!mOpeningApps.contains(wtoken)) {
+                        wtoken.showAllWindowsLocked();
+                    }
+                }
+            }
+        }
+
+        return changes;
+    }
+
+    /**
+     * Extracted from {@link #performLayoutAndPlaceSurfacesLockedInner} to reduce size of method.
+     *
+     * @return bitmap indicating if another pass through layout must be made.
+     */
+    public int handleAppTransitionReadyLocked() {
+        int changes = 0;
+        int i;
+        int NN = mOpeningApps.size();
+        boolean goodToGo = true;
+        if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
+                "Checking " + NN + " opening apps (frozen="
+                + mDisplayFrozen + " timeout="
+                + mAppTransitionTimeout + ")...");
+        if (!mDisplayFrozen && !mAppTransitionTimeout) {
+            // If the display isn't frozen, wait to do anything until
+            // all of the apps are ready.  Otherwise just go because
+            // we'll unfreeze the display when everyone is ready.
+            for (i=0; i<NN && goodToGo; i++) {
+                AppWindowToken wtoken = mOpeningApps.get(i);
+                if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
+                        "Check opening app" + wtoken + ": allDrawn="
+                        + wtoken.allDrawn + " startingDisplayed="
+                        + wtoken.startingDisplayed);
+                if (!wtoken.allDrawn && !wtoken.startingDisplayed
+                        && !wtoken.startingMoved) {
+                    goodToGo = false;
+                }
+            }
+        }
+        if (goodToGo) {
+            if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "**** GOOD TO GO");
+            int transit = mNextAppTransition;
+            if (mSkipAppTransitionAnimation) {
+                transit = WindowManagerPolicy.TRANSIT_UNSET;
+            }
+            mNextAppTransition = WindowManagerPolicy.TRANSIT_UNSET;
+            mAppTransitionReady = false;
+            mAppTransitionRunning = true;
+            mAppTransitionTimeout = false;
+            mStartingIconInTransition = false;
+            mSkipAppTransitionAnimation = false;
+
+            mH.removeMessages(H.APP_TRANSITION_TIMEOUT);
+
+            // If there are applications waiting to come to the
+            // top of the stack, now is the time to move their windows.
+            // (Note that we don't do apps going to the bottom
+            // here -- we want to keep their windows in the old
+            // Z-order until the animation completes.)
+            if (mToTopApps.size() > 0) {
+                NN = mAppTokens.size();
+                for (i=0; i<NN; i++) {
+                    AppWindowToken wtoken = mAppTokens.get(i);
+                    if (wtoken.sendingToTop) {
+                        wtoken.sendingToTop = false;
+                        moveAppWindowsLocked(wtoken, NN, false);
+                    }
+                }
+                mToTopApps.clear();
+            }
+
+            WindowState oldWallpaper = mWallpaperTarget;
+
+            adjustWallpaperWindowsLocked();
+            mInnerFields.mWallpaperMayChange = false;
+
+            // The top-most window will supply the layout params,
+            // and we will determine it below.
+            LayoutParams animLp = null;
+            int bestAnimLayer = -1;
+            boolean fullscreenAnim = false;
+
+            if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
+                    "New wallpaper target=" + mWallpaperTarget
+                    + ", lower target=" + mLowerWallpaperTarget
+                    + ", upper target=" + mUpperWallpaperTarget);
+            int foundWallpapers = 0;
+            // Do a first pass through the tokens for two
+            // things:
+            // (1) Determine if both the closing and opening
+            // app token sets are wallpaper targets, in which
+            // case special animations are needed
+            // (since the wallpaper needs to stay static
+            // behind them).
+            // (2) Find the layout params of the top-most
+            // application window in the tokens, which is
+            // what will control the animation theme.
+            final int NC = mClosingApps.size();
+            NN = NC + mOpeningApps.size();
+            for (i=0; i<NN; i++) {
+                AppWindowToken wtoken;
+                int mode;
+                if (i < NC) {
+                    wtoken = mClosingApps.get(i);
+                    mode = 1;
+                } else {
+                    wtoken = mOpeningApps.get(i-NC);
+                    mode = 2;
+                }
+                if (mLowerWallpaperTarget != null) {
+                    if (mLowerWallpaperTarget.mAppToken == wtoken
+                            || mUpperWallpaperTarget.mAppToken == wtoken) {
+                        foundWallpapers |= mode;
+                    }
+                }
+                if (wtoken.appFullscreen) {
+                    WindowState ws = wtoken.findMainWindow();
+                    if (ws != null) {
+                        animLp = ws.mAttrs;
+                        bestAnimLayer = ws.mLayer;
+                        fullscreenAnim = true;
+                    }
+                } else if (!fullscreenAnim) {
+                    WindowState ws = wtoken.findMainWindow();
+                    if (ws != null) {
+                        if (ws.mLayer > bestAnimLayer) {
+                            animLp = ws.mAttrs;
+                            bestAnimLayer = ws.mLayer;
+                        }
+                    }
+                }
+            }
+
+            if (foundWallpapers == 3) {
+                if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
+                        "Wallpaper animation!");
+                switch (transit) {
+                    case WindowManagerPolicy.TRANSIT_ACTIVITY_OPEN:
+                    case WindowManagerPolicy.TRANSIT_TASK_OPEN:
+                    case WindowManagerPolicy.TRANSIT_TASK_TO_FRONT:
+                        transit = WindowManagerPolicy.TRANSIT_WALLPAPER_INTRA_OPEN;
+                        break;
+                    case WindowManagerPolicy.TRANSIT_ACTIVITY_CLOSE:
+                    case WindowManagerPolicy.TRANSIT_TASK_CLOSE:
+                    case WindowManagerPolicy.TRANSIT_TASK_TO_BACK:
+                        transit = WindowManagerPolicy.TRANSIT_WALLPAPER_INTRA_CLOSE;
+                        break;
+                }
+                if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
+                        "New transit: " + transit);
+            } else if (oldWallpaper != null) {
+                // We are transitioning from an activity with
+                // a wallpaper to one without.
+                transit = WindowManagerPolicy.TRANSIT_WALLPAPER_CLOSE;
+                if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
+                        "New transit away from wallpaper: " + transit);
+            } else if (mWallpaperTarget != null) {
+                // We are transitioning from an activity without
+                // a wallpaper to now showing the wallpaper
+                transit = WindowManagerPolicy.TRANSIT_WALLPAPER_OPEN;
+                if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
+                        "New transit into wallpaper: " + transit);
+            }
+
+            // If all closing windows are obscured, then there is
+            // no need to do an animation.  This is the case, for
+            // example, when this transition is being done behind
+            // the lock screen.
+            if (!mPolicy.allowAppAnimationsLw()) {
+                animLp = null;
+            }
+
+            NN = mOpeningApps.size();
+            for (i=0; i<NN; i++) {
+                AppWindowToken wtoken = mOpeningApps.get(i);
+                if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
+                        "Now opening app" + wtoken);
+                wtoken.reportedVisible = false;
+                wtoken.inPendingTransaction = false;
+                wtoken.animation = null;
+                setTokenVisibilityLocked(wtoken, animLp, true,
+                        transit, false);
+                wtoken.updateReportedVisibilityLocked();
+                wtoken.waitingToShow = false;
+                wtoken.showAllWindowsLocked();
+            }
+            NN = mClosingApps.size();
+            for (i=0; i<NN; i++) {
+                AppWindowToken wtoken = mClosingApps.get(i);
+                if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
+                        "Now closing app" + wtoken);
+                wtoken.inPendingTransaction = false;
+                wtoken.animation = null;
+                setTokenVisibilityLocked(wtoken, animLp, false,
+                        transit, false);
+                wtoken.updateReportedVisibilityLocked();
+                wtoken.waitingToHide = false;
+                // Force the allDrawn flag, because we want to start
+                // this guy's animations regardless of whether it's
+                // gotten drawn.
+                wtoken.allDrawn = true;
+            }
+
+            mNextAppTransitionPackage = null;
+
+            mOpeningApps.clear();
+            mClosingApps.clear();
+
+            // This has changed the visibility of windows, so perform
+            // a new layout to get them all up-to-date.
+            changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_LAYOUT
+                    | WindowManagerPolicy.FINISH_LAYOUT_REDO_CONFIG;
+            mLayoutNeeded = true;
+            if (!moveInputMethodWindowsIfNeededLocked(true)) {
+                assignLayersLocked();
+            }
+            updateFocusedWindowLocked(UPDATE_FOCUS_PLACING_SURFACES,
+                    false /*updateInputWindows*/);
+            mFocusMayChange = false;
+        }
+
+        return changes;
+    }
+
+    /**
+     * Extracted from {@link #performLayoutAndPlaceSurfacesLockedInner} to reduce size of method.
+     *
+     * @return bitmap indicating if another pass through layout must be made.
+     */
+    private int handleAnimatingAndTransitionLocked() {
+        int changes = 0;
+
+        mAppTransitionRunning = false;
+        // Clear information about apps that were moving.
+        mToBottomApps.clear();
+
+        rebuildAppWindowListLocked();
+        changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_LAYOUT;
+        mInnerFields.mAdjResult |= ADJUST_WALLPAPER_LAYERS_CHANGED;
+        moveInputMethodWindowsIfNeededLocked(false);
+        mInnerFields.mWallpaperMayChange = true;
+        // Since the window list has been rebuilt, focus might
+        // have to be recomputed since the actual order of windows
+        // might have changed again.
+        mFocusMayChange = true;
+
+        return changes;
+    }
+
+    /**
+     * Extracted from {@link #performLayoutAndPlaceSurfacesLockedInner} to reduce size of method.
+     *
+     * @return bitmap indicating if another pass through layout must be made.
+     */
+    private int animateAwayWallpaperLocked() {
+        int changes = 0;
+        WindowState oldWallpaper = mWallpaperTarget;
+        if (mLowerWallpaperTarget != null
+                && mLowerWallpaperTarget.mAppToken != null) {
+            if (DEBUG_WALLPAPER) Slog.v(TAG,
+                    "wallpaperForceHiding changed with lower="
+                    + mLowerWallpaperTarget);
+            if (DEBUG_WALLPAPER) Slog.v(TAG,
+                    "hidden=" + mLowerWallpaperTarget.mAppToken.hidden +
+                    " hiddenRequested=" + mLowerWallpaperTarget.mAppToken.hiddenRequested);
+            if (mLowerWallpaperTarget.mAppToken.hidden) {
+                // The lower target has become hidden before we
+                // actually started the animation...  let's completely
+                // re-evaluate everything.
+                mLowerWallpaperTarget = mUpperWallpaperTarget = null;
+                changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_ANIM;
+            }
+        }
+        mInnerFields.mAdjResult |= adjustWallpaperWindowsLocked();
+        mInnerFields.mWallpaperMayChange = false;
+        mInnerFields.mWallpaperForceHidingChanged = false;
+        if (DEBUG_WALLPAPER) Slog.v(TAG, "****** OLD: " + oldWallpaper
+                + " NEW: " + mWallpaperTarget
+                + " LOWER: " + mLowerWallpaperTarget);
+        if (mLowerWallpaperTarget == null) {
+            // Whoops, we don't need a special wallpaper animation.
+            // Clear them out.
+            mInnerFields.mForceHiding = false;
+            for (int i=mWindows.size()-1; i>=0; i--) {
+                WindowState w = mWindows.get(i);
+                if (w.mSurface != null) {
+                    final WindowManager.LayoutParams attrs = w.mAttrs;
+                    if (mPolicy.doesForceHide(w, attrs) && w.isVisibleLw()) {
+                        if (DEBUG_FOCUS) Slog.i(TAG, "win=" + w + " force hides other windows");
+                        mInnerFields.mForceHiding = true;
+                    } else if (mPolicy.canBeForceHidden(w, attrs)) {
+                        if (!w.mAnimating) {
+                            // We set the animation above so it
+                            // is not yet running.
+                            w.clearAnimation();
+                        }
+                    }
+                }
+            }
+        }
+        return changes;
+    }
+
+    /**
+     * Extracted from {@link #performLayoutAndPlaceSurfacesLockedInner} to reduce size of method.
+     *
+     * @return bitmap indicating if another pass through layout must be made.
+     */
+    private int testWallpaperAndBackgroundLocked() {
+        int changes = 0;
+
+        if (mWindowDetachedWallpaper != mInnerFields.mDetachedWallpaper) {
+            if (DEBUG_WALLPAPER) Slog.v(TAG,
+                    "Detached wallpaper changed from " + mWindowDetachedWallpaper
+                    + " to " + mInnerFields.mDetachedWallpaper);
+            mWindowDetachedWallpaper = mInnerFields.mDetachedWallpaper;
+            mInnerFields.mWallpaperMayChange = true;
+        }
+
+        if (mInnerFields.mWindowAnimationBackgroundColor != 0) {
+            // If the window that wants black is the current wallpaper
+            // target, then the black goes *below* the wallpaper so we
+            // don't cause the wallpaper to suddenly disappear.
+            WindowState target = mInnerFields.mWindowAnimationBackground;
+            if (mWallpaperTarget == mInnerFields.mWindowAnimationBackground
+                    || mLowerWallpaperTarget == mInnerFields.mWindowAnimationBackground
+                    || mUpperWallpaperTarget == mInnerFields.mWindowAnimationBackground) {
+                for (int i=0; i<mWindows.size(); i++) {
+                    WindowState w = mWindows.get(i);
+                    if (w.mIsWallpaper) {
+                        target = w;
+                        break;
+                    }
+                }
+            }
+            if (mWindowAnimationBackgroundSurface == null) {
+                mWindowAnimationBackgroundSurface = new DimSurface(mFxSession);
+            }
+            final int dw = mCurDisplayWidth;
+            final int dh = mCurDisplayHeight;
+            mWindowAnimationBackgroundSurface.show(dw, dh,
+                    target.mAnimLayer - LAYER_OFFSET_DIM,
+                    mInnerFields.mWindowAnimationBackgroundColor);
+        } else if (mWindowAnimationBackgroundSurface != null) {
+            mWindowAnimationBackgroundSurface.hide();
+        }
+
+        if (mInnerFields.mWallpaperMayChange) {
+            if (DEBUG_WALLPAPER) Slog.v(TAG,
+                    "Wallpaper may change!  Adjusting");
+            mInnerFields.mAdjResult |= adjustWallpaperWindowsLocked();
+        }
+
+        if ((mInnerFields.mAdjResult&ADJUST_WALLPAPER_LAYERS_CHANGED) != 0) {
+            if (DEBUG_WALLPAPER) Slog.v(TAG,
+                    "Wallpaper layer changed: assigning layers + relayout");
+            changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_LAYOUT;
+            assignLayersLocked();
+        } else if ((mInnerFields.mAdjResult&ADJUST_WALLPAPER_VISIBILITY_CHANGED) != 0) {
+            if (DEBUG_WALLPAPER) Slog.v(TAG,
+                    "Wallpaper visibility changed: relayout");
+            changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_LAYOUT;
+        }
+
+        if (mFocusMayChange) {
+            mFocusMayChange = false;
+            if (updateFocusedWindowLocked(UPDATE_FOCUS_PLACING_SURFACES,
+                    false /*updateInputWindows*/)) {
+                changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_ANIM;
+                mInnerFields.mAdjResult = 0;
+            }
+        }
+
+        return changes;
+    }
+
+    /**
+     * Extracted from {@link #performLayoutAndPlaceSurfacesLockedInner} to reduce size of method.
+     *
+     * @param w WindowState whos Surface is being prepared.
+     * @param recoveringMemory true if the caller will reclaim surface memory on error.
+     */
+    public void prepareSurfaceLocked(final WindowState w, final boolean recoveringMemory) {
+        // XXX NOTE: The logic here could be improved.  We have
+        // the decision about whether to resize a window separated
+        // from whether to hide the surface.  This can cause us to
+        // resize a surface even if we are going to hide it.  You
+        // can see this by (1) holding device in landscape mode on
+        // home screen; (2) tapping browser icon (device will rotate
+        // to landscape; (3) tap home.  The wallpaper will be resized
+        // in step 2 but then immediately hidden, causing us to
+        // have to resize and then redraw it again in step 3.  It
+        // would be nice to figure out how to avoid this, but it is
+        // difficult because we do need to resize surfaces in some
+        // cases while they are hidden such as when first showing a
+        // window.
+        boolean displayed = false;
+
+        w.computeShownFrameLocked();
+
+        int width, height;
+        if ((w.mAttrs.flags & w.mAttrs.FLAG_SCALED) != 0) {
+            // for a scaled surface, we just want to use
+            // the requested size.
+            width  = w.mRequestedWidth;
+            height = w.mRequestedHeight;
+        } else {
+            width = w.mCompatFrame.width();
+            height = w.mCompatFrame.height();
+        }
+
+        if (width < 1) {
+            width = 1;
+        }
+        if (height < 1) {
+            height = 1;
+        }
+        final boolean surfaceResized = w.mSurfaceW != width || w.mSurfaceH != height;
+        if (surfaceResized) {
+            w.mSurfaceW = width;
+            w.mSurfaceH = height;
+        }
+
+        if (w.mSurfaceX != w.mShownFrame.left
+                || w.mSurfaceY != w.mShownFrame.top) {
+            try {
+                if (SHOW_TRANSACTIONS) logSurface(w,
+                        "POS " + w.mShownFrame.left
+                        + ", " + w.mShownFrame.top, null);
+                w.mSurfaceX = w.mShownFrame.left;
+                w.mSurfaceY = w.mShownFrame.top;
+                w.mSurface.setPosition(w.mShownFrame.left, w.mShownFrame.top);
+            } catch (RuntimeException e) {
+                Slog.w(TAG, "Error positioning surface of " + w
+                        + " pos=(" + w.mShownFrame.left
+                        + "," + w.mShownFrame.top + ")", e);
+                if (!recoveringMemory) {
+                    reclaimSomeSurfaceMemoryLocked(w, "position", true);
+                }
+            }
+        }
+
+        if (surfaceResized) {
+            try {
+                if (SHOW_TRANSACTIONS) logSurface(w,
+                        "SIZE " + width + "x" + height, null);
+                w.mSurfaceResized = true;
+                w.mSurface.setSize(width, height);
+            } catch (RuntimeException e) {
+                // If something goes wrong with the surface (such
+                // as running out of memory), don't take down the
+                // entire system.
+                Slog.e(TAG, "Error resizing surface of " + w
+                        + " size=(" + width + "x" + height + ")", e);
+                if (!recoveringMemory) {
+                    reclaimSomeSurfaceMemoryLocked(w, "size", true);
+                }
+            }
+        }
+
+        if (!w.mAppFreezing && w.mLayoutSeq == mLayoutSeq) {
+            w.mContentInsetsChanged |=
+                !w.mLastContentInsets.equals(w.mContentInsets);
+            w.mVisibleInsetsChanged |=
+                !w.mLastVisibleInsets.equals(w.mVisibleInsets);
+            boolean configChanged =
+                w.mConfiguration != mCurConfiguration
+                && (w.mConfiguration == null
+                        || mCurConfiguration.diff(w.mConfiguration) != 0);
+            if (DEBUG_CONFIGURATION && configChanged) {
+                Slog.v(TAG, "Win " + w + " config changed: "
+                        + mCurConfiguration);
+            }
+            if (localLOGV) Slog.v(TAG, "Resizing " + w
+                    + ": configChanged=" + configChanged
+                    + " last=" + w.mLastFrame + " frame=" + w.mFrame);
+            w.mLastFrame.set(w.mFrame);
+            if (w.mContentInsetsChanged
+                    || w.mVisibleInsetsChanged
+                    || w.mSurfaceResized
+                    || configChanged) {
+                if (DEBUG_RESIZE || DEBUG_ORIENTATION) {
+                    Slog.v(TAG, "Resize reasons: "
+                            + " contentInsetsChanged=" + w.mContentInsetsChanged
+                            + " visibleInsetsChanged=" + w.mVisibleInsetsChanged
+                            + " surfaceResized=" + w.mSurfaceResized
+                            + " configChanged=" + configChanged);
+                }
+
+                w.mLastContentInsets.set(w.mContentInsets);
+                w.mLastVisibleInsets.set(w.mVisibleInsets);
+                makeWindowFreezingScreenIfNeededLocked(w);
+                // If the orientation is changing, then we need to
+                // hold off on unfreezing the display until this
+                // window has been redrawn; to do that, we need
+                // to go through the process of getting informed
+                // by the application when it has finished drawing.
+                if (w.mOrientationChanging) {
+                    if (DEBUG_ORIENTATION) Slog.v(TAG,
+                            "Orientation start waiting for draw in "
+                            + w + ", surface " + w.mSurface);
+                    w.mDrawPending = true;
+                    w.mCommitDrawPending = false;
+                    w.mReadyToShow = false;
+                    if (w.mAppToken != null) {
+                        w.mAppToken.allDrawn = false;
+                    }
+                }
+                if (!mResizingWindows.contains(w)) {
+                    if (DEBUG_RESIZE || DEBUG_ORIENTATION) Slog.v(TAG,
+                            "Resizing window " + w + " to " + w.mSurfaceW
+                            + "x" + w.mSurfaceH);
+                    mResizingWindows.add(w);
+                }
+            } else if (w.mOrientationChanging) {
+                if (!w.mDrawPending && !w.mCommitDrawPending) {
+                    if (DEBUG_ORIENTATION) Slog.v(TAG,
+                            "Orientation not waiting for draw in "
+                            + w + ", surface " + w.mSurface);
+                    w.mOrientationChanging = false;
+                }
+            }
+        }
+
+        if (w.mAttachedHidden || !w.isReadyForDisplay()) {
+            if (!w.mLastHidden) {
+                //dump();
+                w.mLastHidden = true;
+                if (SHOW_TRANSACTIONS) logSurface(w,
+                        "HIDE (performLayout)", null);
+                if (w.mSurface != null) {
+                    w.mSurfaceShown = false;
+                    try {
+                        w.mSurface.hide();
+                    } catch (RuntimeException e) {
+                        Slog.w(TAG, "Exception hiding surface in " + w);
+                    }
+                }
+            }
+            // If we are waiting for this window to handle an
+            // orientation change, well, it is hidden, so
+            // doesn't really matter.  Note that this does
+            // introduce a potential glitch if the window
+            // becomes unhidden before it has drawn for the
+            // new orientation.
+            if (w.mOrientationChanging) {
+                w.mOrientationChanging = false;
+                if (DEBUG_ORIENTATION) Slog.v(TAG,
+                        "Orientation change skips hidden " + w);
+            }
+        } else if (w.mLastLayer != w.mAnimLayer
+                || w.mLastAlpha != w.mShownAlpha
+                || w.mLastDsDx != w.mDsDx
+                || w.mLastDtDx != w.mDtDx
+                || w.mLastDsDy != w.mDsDy
+                || w.mLastDtDy != w.mDtDy
+                || w.mLastHScale != w.mHScale
+                || w.mLastVScale != w.mVScale
+                || w.mLastHidden) {
+            displayed = true;
+            w.mLastAlpha = w.mShownAlpha;
+            w.mLastLayer = w.mAnimLayer;
+            w.mLastDsDx = w.mDsDx;
+            w.mLastDtDx = w.mDtDx;
+            w.mLastDsDy = w.mDsDy;
+            w.mLastDtDy = w.mDtDy;
+            w.mLastHScale = w.mHScale;
+            w.mLastVScale = w.mVScale;
+            if (SHOW_TRANSACTIONS) logSurface(w,
+                    "alpha=" + w.mShownAlpha + " layer=" + w.mAnimLayer
+                    + " matrix=[" + (w.mDsDx*w.mHScale)
+                    + "," + (w.mDtDx*w.mVScale)
+                    + "][" + (w.mDsDy*w.mHScale)
+                    + "," + (w.mDtDy*w.mVScale) + "]", null);
+            if (w.mSurface != null) {
+                try {
+                    w.mSurfaceAlpha = w.mShownAlpha;
+                    w.mSurface.setAlpha(w.mShownAlpha);
+                    w.mSurfaceLayer = w.mAnimLayer;
+                    w.mSurface.setLayer(w.mAnimLayer);
+                    w.mSurface.setMatrix(
+                            w.mDsDx*w.mHScale, w.mDtDx*w.mVScale,
+                            w.mDsDy*w.mHScale, w.mDtDy*w.mVScale);
+                } catch (RuntimeException e) {
+                    Slog.w(TAG, "Error updating surface in " + w, e);
+                    if (!recoveringMemory) {
+                        reclaimSomeSurfaceMemoryLocked(w, "update", true);
+                    }
+                }
+            }
+
+            if (w.mLastHidden && !w.mDrawPending
+                    && !w.mCommitDrawPending
+                    && !w.mReadyToShow) {
+                if (SHOW_TRANSACTIONS) logSurface(w,
+                        "SHOW (performLayout)", null);
+                if (DEBUG_VISIBILITY) Slog.v(TAG, "Showing " + w
+                        + " during relayout");
+                if (showSurfaceRobustlyLocked(w)) {
+                    w.mHasDrawn = true;
+                    w.mLastHidden = false;
+                } else {
+                    w.mOrientationChanging = false;
+                }
+            }
+            if (w.mSurface != null) {
+                w.mToken.hasVisible = true;
+            }
+        } else {
+            displayed = true;
+        }
+
+        if (displayed) {
+            if (w.mOrientationChanging) {
+                if (w.mDrawPending || w.mCommitDrawPending) {
+                    mInnerFields.mOrientationChangeComplete = false;
+                    if (DEBUG_ORIENTATION) Slog.v(TAG,
+                            "Orientation continue waiting for draw in " + w);
+                } else {
+                    w.mOrientationChanging = false;
+                    if (DEBUG_ORIENTATION) Slog.v(TAG,
+                            "Orientation change complete in " + w);
+                }
+            }
+            w.mToken.hasVisible = true;
+        }
+    }
+
+    /**
+     * Extracted from {@link #performLayoutAndPlaceSurfacesLockedInner} to reduce size of method.
+     *
+     * @param w WindowState this method is applied to.
+     * @param currentTime The time which animations use for calculating transitions.
+     * @param innerDw Width of app window.
+     * @param innerDh Height of app window.
+     */
+    private void handleNotObscuredLocked(final WindowState w, final long currentTime,
+                                         final int innerDw, final int innerDh) {
+        final WindowManager.LayoutParams attrs = w.mAttrs;
+        final int attrFlags = attrs.flags;
+        final boolean canBeSeen = w.isDisplayedLw();
+
+        if (w.mSurface != null) {
+            if ((attrFlags&FLAG_KEEP_SCREEN_ON) != 0) {
+                mInnerFields.mHoldScreen = w.mSession;
+            }
+            if (!mInnerFields.mSyswin && w.mAttrs.screenBrightness >= 0
+                    && mInnerFields.mScreenBrightness < 0) {
+                mInnerFields.mScreenBrightness = w.mAttrs.screenBrightness;
+            }
+            if (!mInnerFields.mSyswin && w.mAttrs.buttonBrightness >= 0
+                    && mInnerFields.mButtonBrightness < 0) {
+                mInnerFields.mButtonBrightness = w.mAttrs.buttonBrightness;
+            }
+            if (canBeSeen
+                    && (attrs.type == WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG
+                     || attrs.type == WindowManager.LayoutParams.TYPE_KEYGUARD
+                     || attrs.type == WindowManager.LayoutParams.TYPE_SYSTEM_ERROR)) {
+                mInnerFields.mSyswin = true;
+            }
+        }
+
+        boolean opaqueDrawn = canBeSeen && w.isOpaqueDrawn();
+        if (opaqueDrawn && w.isFullscreen(innerDw, innerDh)) {
+            // This window completely covers everything behind it,
+            // so we want to leave all of them as unblurred (for
+            // performance reasons).
+            mInnerFields.mObscured = true;
+        } else if (canBeSeen && (attrFlags & FLAG_BLUR_BEHIND | FLAG_DIM_BEHIND) != 0) {
+            if (localLOGV) Slog.v(TAG, "Win " + w
+                    + ": blurring=" + mInnerFields.mBlurring
+                    + " obscured=" + mInnerFields.mObscured);
+            if ((attrFlags&FLAG_DIM_BEHIND) != 0) {
+                if (!mInnerFields.mDimming) {
+                    //Slog.i(TAG, "DIM BEHIND: " + w);
+                    mInnerFields.mDimming = true;
+                    if (mDimAnimator == null) {
+                        mDimAnimator = new DimAnimator(mFxSession);
+                    }
+                    mDimAnimator.show(innerDw, innerDh);
+                    mDimAnimator.updateParameters(mContext.getResources(),
+                            w, currentTime);
+                }
+            }
+            if ((attrFlags & FLAG_BLUR_BEHIND) != 0) {
+                if (!mInnerFields.mBlurring) {
+                    //Slog.i(TAG, "BLUR BEHIND: " + w);
+                    mInnerFields.mBlurring = true;
+                    if (mBlurSurface == null) {
+                        try {
+                            mBlurSurface = new Surface(mFxSession, 0,
+                                    "BlurSurface",
+                                    -1, 16, 16,
+                                    PixelFormat.OPAQUE,
+                                    Surface.FX_SURFACE_BLUR);
+                        } catch (Exception e) {
+                            Slog.e(TAG, "Exception creating Blur surface", e);
+                        }
+                        if (SHOW_TRANSACTIONS) Slog.i(TAG, "  BLUR "
+                                + mBlurSurface + ": CREATE");
+                    }
+                    final int dw = mCurDisplayWidth;
+                    final int dh = mCurDisplayHeight;
+                    if (mBlurSurface != null) {
+                        if (SHOW_TRANSACTIONS) Slog.i(TAG, "  BLUR "
+                                + mBlurSurface + ": pos=(0,0) (" +
+                                dw + "x" + dh + "), layer=" + (w.mAnimLayer-1));
+                        mBlurSurface.setPosition(0, 0);
+                        mBlurSurface.setSize(dw, dh);
+                        mBlurSurface.setLayer(w.mAnimLayer-LAYER_OFFSET_BLUR);
+                        if (!mBlurShown) {
+                            try {
+                                if (SHOW_TRANSACTIONS) Slog.i(TAG, "  BLUR "
+                                        + mBlurSurface + ": SHOW");
+                                mBlurSurface.show();
+                            } catch (RuntimeException e) {
+                                Slog.w(TAG, "Failure showing blur surface", e);
+                            }
+                            mBlurShown = true;
+                        }
+                    }
+                }
+            }
+        }
+    }
+
     // "Something has changed!  Let's make it correct now."
     private final void performLayoutAndPlaceSurfacesLockedInner(
             boolean recoveringMemory) {
@@ -7552,15 +8628,14 @@
             mExitingAppTokens.get(i).hasVisible = false;
         }
 
-        boolean orientationChangeComplete = true;
-        Session holdScreen = null;
-        float screenBrightness = -1;
-        float buttonBrightness = -1;
+        mInnerFields.mOrientationChangeComplete = true;
+        mInnerFields.mHoldScreen = null;
+        mInnerFields.mScreenBrightness = -1;
+        mInnerFields.mButtonBrightness = -1;
         boolean focusDisplayed = false;
-        boolean animating = false;
+        mInnerFields.mAnimating = false;
         boolean createWatermark = false;
         boolean updateRotation = false;
-        boolean screenRotationFinished = false;
 
         if (mFxSession == null) {
             mFxSession = new SurfaceSession();
@@ -7583,7 +8658,7 @@
         }
 
         try {
-            boolean wallpaperForceHidingChanged = false;
+            mInnerFields.mWallpaperForceHidingChanged = false;
             int repeats = 0;
             int changes = 0;
             
@@ -7594,655 +8669,93 @@
                     mLayoutNeeded = false;
                     break;
                 }
-                
-                if ((changes&(WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER
-                        | WindowManagerPolicy.FINISH_LAYOUT_REDO_CONFIG
-                        | WindowManagerPolicy.FINISH_LAYOUT_REDO_LAYOUT)) != 0) {
-                    if ((changes&WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER) != 0) {
-                        if ((adjustWallpaperWindowsLocked()&ADJUST_WALLPAPER_LAYERS_CHANGED) != 0) {
-                            assignLayersLocked();
-                            mLayoutNeeded = true;
-                        }
-                    }
-                    if ((changes&WindowManagerPolicy.FINISH_LAYOUT_REDO_CONFIG) != 0) {
-                        if (DEBUG_LAYOUT) Slog.v(TAG, "Computing new config from layout");
-                        if (updateOrientationFromAppTokensLocked(true)) {
-                            mLayoutNeeded = true;
-                            mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION);
-                        }
-                    }
-                    if ((changes&WindowManagerPolicy.FINISH_LAYOUT_REDO_LAYOUT) != 0) {
+
+                if ((changes & WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER) != 0) {
+                    if ((adjustWallpaperWindowsLocked()&ADJUST_WALLPAPER_LAYERS_CHANGED) != 0) {
+                        assignLayersLocked();
                         mLayoutNeeded = true;
                     }
                 }
-                
+                if ((changes & WindowManagerPolicy.FINISH_LAYOUT_REDO_CONFIG) != 0) {
+                    if (DEBUG_LAYOUT) Slog.v(TAG, "Computing new config from layout");
+                    if (updateOrientationFromAppTokensLocked(true)) {
+                        mLayoutNeeded = true;
+                        mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION);
+                    }
+                }
+                if ((changes & WindowManagerPolicy.FINISH_LAYOUT_REDO_LAYOUT) != 0) {
+                    mLayoutNeeded = true;
+                }
+
                 // FIRST LOOP: Perform a layout, if needed.
                 if (repeats < 4) {
-                    changes = performLayoutLockedInner(repeats == 0, false /*updateInputWindows*/);
-                    if (changes != 0) {
-                        continue;
-                    }
+                    performLayoutLockedInner(repeats == 0, false /*updateInputWindows*/);
                 } else {
                     Slog.w(TAG, "Layout repeat skipped after too many iterations");
-                    changes = 0;
                 }
-                
-                final int transactionSequence = ++mTransactionSequence;
+
+                changes = 0;
+                ++mTransactionSequence;
 
                 // Update animations of all applications, including those
                 // associated with exiting/removed apps
-                boolean tokensAnimating = false;
-                final int NAT = mAppTokens.size();
-                for (i=0; i<NAT; i++) {
-                    if (mAppTokens.get(i).stepAnimationLocked(currentTime,
-                            innerDw, innerDh)) {
-                        tokensAnimating = true;
-                    }
-                }
-                final int NEAT = mExitingAppTokens.size();
-                for (i=0; i<NEAT; i++) {
-                    if (mExitingAppTokens.get(i).stepAnimationLocked(currentTime,
-                            innerDw, innerDh)) {
-                        tokensAnimating = true;
-                    }
-                }
+                mInnerFields.mAnimating = false;
 
                 // SECOND LOOP: Execute animations and update visibility of windows.
-                
+                updateRotation =
+                        updateAppsAndRotationAnimationsLocked(currentTime, innerDw, innerDh);
+
                 if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "*** ANIM STEP: seq="
-                        + transactionSequence + " tokensAnimating="
-                        + tokensAnimating);
-                        
-                animating = tokensAnimating;
+                        + mTransactionSequence + " mAnimating="
+                        + mInnerFields.mAnimating);
 
-                if (mScreenRotationAnimation != null) {
-                    if (mScreenRotationAnimation.isAnimating()) {
-                        if (mScreenRotationAnimation.stepAnimation(currentTime)) {
-                            animating = true;
-                        } else {
-                            screenRotationFinished = true;
-                            updateRotation = true;
-                        }
-                    }
-                }
-
-                boolean tokenMayBeDrawn = false;
-                boolean wallpaperMayChange = false;
-                boolean forceHiding = false;
-                WindowState windowDetachedWallpaper = null;
-                WindowState windowAnimationBackground = null;
-                int windowAnimationBackgroundColor = 0;
+                mInnerFields.mTokenMayBeDrawn = false;
+                mInnerFields.mWallpaperMayChange = false;
+                mInnerFields.mForceHiding = false;
+                mInnerFields.mDetachedWallpaper = null;
+                mInnerFields.mWindowAnimationBackground = null;
+                mInnerFields.mWindowAnimationBackgroundColor = 0;
 
                 mPolicy.beginAnimationLw(dw, dh);
 
-                final int N = mWindows.size();
-
-                for (i=N-1; i>=0; i--) {
-                    WindowState w = mWindows.get(i);
-
-                    final WindowManager.LayoutParams attrs = w.mAttrs;
-
-                    if (w.mSurface != null) {
-                        // Take care of the window being ready to display.
-                        if (w.commitFinishDrawingLocked(currentTime)) {
-                            if ((w.mAttrs.flags
-                                    & WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER) != 0) {
-                                if (DEBUG_WALLPAPER) Slog.v(TAG,
-                                        "First draw done in potential wallpaper target " + w);
-                                wallpaperMayChange = true;
-                            }
-                        }
-
-                        final boolean wasAnimating = w.mAnimating;
-
-                        int animDw = innerDw;
-                        int animDh = innerDh;
-
-                        // If the window has moved due to its containing
-                        // content frame changing, then we'd like to animate
-                        // it.  The checks here are ordered by what is least
-                        // likely to be true first.
-                        if (w.shouldAnimateMove()) {
-                            // Frame has moved, containing content frame
-                            // has also moved, and we're not currently animating...
-                            // let's do something.
-                            Animation a = AnimationUtils.loadAnimation(mContext,
-                                    com.android.internal.R.anim.window_move_from_decor);
-                            w.setAnimation(a);
-                            animDw = w.mLastFrame.left - w.mFrame.left;
-                            animDh = w.mLastFrame.top - w.mFrame.top;
-                        }
-
-                        // Execute animation.
-                        final boolean nowAnimating = w.stepAnimationLocked(currentTime,
-                                animDw, animDh);
-
-                        // If this window is animating, make a note that we have
-                        // an animating window and take care of a request to run
-                        // a detached wallpaper animation.
-                        if (nowAnimating) {
-                            if (w.mAnimation != null) {
-                                if ((w.mAttrs.flags&FLAG_SHOW_WALLPAPER) != 0
-                                        && w.mAnimation.getDetachWallpaper()) {
-                                    windowDetachedWallpaper = w;
-                                }
-                                if (w.mAnimation.getBackgroundColor() != 0) {
-                                    if (windowAnimationBackground == null || w.mAnimLayer <
-                                            windowAnimationBackground.mAnimLayer) {
-                                        windowAnimationBackground = w;
-                                        windowAnimationBackgroundColor =
-                                                w.mAnimation.getBackgroundColor();
-                                    }
-                                }
-                            }
-                            animating = true;
-                        }
-
-                        // If this window's app token is running a detached wallpaper
-                        // animation, make a note so we can ensure the wallpaper is
-                        // displayed behind it.
-                        if (w.mAppToken != null && w.mAppToken.animation != null
-                                && w.mAppToken.animating) {
-                            if ((w.mAttrs.flags&FLAG_SHOW_WALLPAPER) != 0
-                                    && w.mAppToken.animation.getDetachWallpaper()) {
-                                windowDetachedWallpaper = w;
-                            }
-                            if (w.mAppToken.animation.getBackgroundColor() != 0) {
-                                if (windowAnimationBackground == null || w.mAnimLayer <
-                                        windowAnimationBackground.mAnimLayer) {
-                                    windowAnimationBackground = w;
-                                    windowAnimationBackgroundColor =
-                                            w.mAppToken.animation.getBackgroundColor();
-                                }
-                            }
-                        }
-
-                        if (wasAnimating && !w.mAnimating && mWallpaperTarget == w) {
-                            wallpaperMayChange = true;
-                        }
-
-                        if (mPolicy.doesForceHide(w, attrs)) {
-                            if (!wasAnimating && nowAnimating) {
-                                if (DEBUG_VISIBILITY) Slog.v(TAG,
-                                        "Animation started that could impact force hide: "
-                                        + w);
-                                wallpaperForceHidingChanged = true;
-                                mFocusMayChange = true;
-                            } else if (w.isReadyForDisplay() && w.mAnimation == null) {
-                                forceHiding = true;
-                            }
-                        } else if (mPolicy.canBeForceHidden(w, attrs)) {
-                            boolean changed;
-                            if (forceHiding) {
-                                changed = w.hideLw(false, false);
-                                if (DEBUG_VISIBILITY && changed) Slog.v(TAG,
-                                        "Now policy hidden: " + w);
-                            } else {
-                                changed = w.showLw(false, false);
-                                if (DEBUG_VISIBILITY && changed) Slog.v(TAG,
-                                        "Now policy shown: " + w);
-                                if (changed) {
-                                    if (wallpaperForceHidingChanged
-                                            && w.isVisibleNow() /*w.isReadyForDisplay()*/) {
-                                        // Assume we will need to animate.  If
-                                        // we don't (because the wallpaper will
-                                        // stay with the lock screen), then we will
-                                        // clean up later.
-                                        Animation a = mPolicy.createForceHideEnterAnimation();
-                                        if (a != null) {
-                                            w.setAnimation(a);
-                                        }
-                                    }
-                                    if (mCurrentFocus == null ||
-                                            mCurrentFocus.mLayer < w.mLayer) {
-                                        // We are showing on to of the current
-                                        // focus, so re-evaluate focus to make
-                                        // sure it is correct.
-                                        mFocusMayChange = true;
-                                    }
-                                }
-                            }
-                            if (changed && (attrs.flags
-                                    & WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER) != 0) {
-                                wallpaperMayChange = true;
-                            }
-                        }
-
-                        mPolicy.animatingWindowLw(w, attrs);
-                    }
-
-                    final AppWindowToken atoken = w.mAppToken;
-                    if (atoken != null && (!atoken.allDrawn || atoken.freezingScreen)) {
-                        if (atoken.lastTransactionSequence != transactionSequence) {
-                            atoken.lastTransactionSequence = transactionSequence;
-                            atoken.numInterestingWindows = atoken.numDrawnWindows = 0;
-                            atoken.startingDisplayed = false;
-                        }
-                        if ((w.isOnScreen() || w.mAttrs.type
-                                == WindowManager.LayoutParams.TYPE_BASE_APPLICATION)
-                                && !w.mExiting && !w.mDestroying) {
-                            if (DEBUG_VISIBILITY || DEBUG_ORIENTATION) {
-                                Slog.v(TAG, "Eval win " + w + ": isDrawn="
-                                        + w.isDrawnLw()
-                                        + ", isAnimating=" + w.isAnimating());
-                                if (!w.isDrawnLw()) {
-                                    Slog.v(TAG, "Not displayed: s=" + w.mSurface
-                                            + " pv=" + w.mPolicyVisibility
-                                            + " dp=" + w.mDrawPending
-                                            + " cdp=" + w.mCommitDrawPending
-                                            + " ah=" + w.mAttachedHidden
-                                            + " th=" + atoken.hiddenRequested
-                                            + " a=" + w.mAnimating);
-                                }
-                            }
-                            if (w != atoken.startingWindow) {
-                                if (!atoken.freezingScreen || !w.mAppFreezing) {
-                                    atoken.numInterestingWindows++;
-                                    if (w.isDrawnLw()) {
-                                        atoken.numDrawnWindows++;
-                                        if (DEBUG_VISIBILITY || DEBUG_ORIENTATION) Slog.v(TAG,
-                                                "tokenMayBeDrawn: " + atoken
-                                                + " freezingScreen=" + atoken.freezingScreen
-                                                + " mAppFreezing=" + w.mAppFreezing);
-                                        tokenMayBeDrawn = true;
-                                    }
-                                }
-                            } else if (w.isDrawnLw()) {
-                                atoken.startingDisplayed = true;
-                            }
-                        }
-                    } else if (w.mReadyToShow) {
-                        w.performShowLocked();
-                    }
-                }
+                updateWindowsAndWallpaperLocked(currentTime, innerDw, innerDh);
 
                 changes |= mPolicy.finishAnimationLw();
 
-                if (tokenMayBeDrawn) {
-                    // See if any windows have been drawn, so they (and others
-                    // associated with them) can now be shown.
-                    final int NT = mAppTokens.size();
-                    for (i=0; i<NT; i++) {
-                        AppWindowToken wtoken = mAppTokens.get(i);
-                        if (wtoken.freezingScreen) {
-                            int numInteresting = wtoken.numInterestingWindows;
-                            if (numInteresting > 0 && wtoken.numDrawnWindows >= numInteresting) {
-                                if (DEBUG_VISIBILITY) Slog.v(TAG,
-                                        "allDrawn: " + wtoken
-                                        + " interesting=" + numInteresting
-                                        + " drawn=" + wtoken.numDrawnWindows);
-                                wtoken.showAllWindowsLocked();
-                                unsetAppFreezingScreenLocked(wtoken, false, true);
-                                if (DEBUG_ORIENTATION) Slog.i(TAG,
-                                        "Setting orientationChangeComplete=true because wtoken "
-                                        + wtoken + " numInteresting=" + numInteresting
-                                        + " numDrawn=" + wtoken.numDrawnWindows);
-                                orientationChangeComplete = true;
-                            }
-                        } else if (!wtoken.allDrawn) {
-                            int numInteresting = wtoken.numInterestingWindows;
-                            if (numInteresting > 0 && wtoken.numDrawnWindows >= numInteresting) {
-                                if (DEBUG_VISIBILITY) Slog.v(TAG,
-                                        "allDrawn: " + wtoken
-                                        + " interesting=" + numInteresting
-                                        + " drawn=" + wtoken.numDrawnWindows);
-                                wtoken.allDrawn = true;
-                                changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_ANIM;
-
-                                // We can now show all of the drawn windows!
-                                if (!mOpeningApps.contains(wtoken)) {
-                                    wtoken.showAllWindowsLocked();
-                                }
-                            }
-                        }
-                    }
+                if (mInnerFields.mTokenMayBeDrawn) {
+                    changes |= testTokenMayBeDrawnLocked();
                 }
 
                 // If we are ready to perform an app transition, check through
                 // all of the app tokens to be shown and see if they are ready
                 // to go.
                 if (mAppTransitionReady) {
-                    int NN = mOpeningApps.size();
-                    boolean goodToGo = true;
-                    if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
-                            "Checking " + NN + " opening apps (frozen="
-                            + mDisplayFrozen + " timeout="
-                            + mAppTransitionTimeout + ")...");
-                    if (!mDisplayFrozen && !mAppTransitionTimeout) {
-                        // If the display isn't frozen, wait to do anything until
-                        // all of the apps are ready.  Otherwise just go because
-                        // we'll unfreeze the display when everyone is ready.
-                        for (i=0; i<NN && goodToGo; i++) {
-                            AppWindowToken wtoken = mOpeningApps.get(i);
-                            if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
-                                    "Check opening app" + wtoken + ": allDrawn="
-                                    + wtoken.allDrawn + " startingDisplayed="
-                                    + wtoken.startingDisplayed);
-                            if (!wtoken.allDrawn && !wtoken.startingDisplayed
-                                    && !wtoken.startingMoved) {
-                                goodToGo = false;
-                            }
-                        }
-                    }
-                    if (goodToGo) {
-                        if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "**** GOOD TO GO");
-                        int transit = mNextAppTransition;
-                        if (mSkipAppTransitionAnimation) {
-                            transit = WindowManagerPolicy.TRANSIT_UNSET;
-                        }
-                        mNextAppTransition = WindowManagerPolicy.TRANSIT_UNSET;
-                        mAppTransitionReady = false;
-                        mAppTransitionRunning = true;
-                        mAppTransitionTimeout = false;
-                        mStartingIconInTransition = false;
-                        mSkipAppTransitionAnimation = false;
-
-                        mH.removeMessages(H.APP_TRANSITION_TIMEOUT);
-
-                        // If there are applications waiting to come to the
-                        // top of the stack, now is the time to move their windows.
-                        // (Note that we don't do apps going to the bottom
-                        // here -- we want to keep their windows in the old
-                        // Z-order until the animation completes.)
-                        if (mToTopApps.size() > 0) {
-                            NN = mAppTokens.size();
-                            for (i=0; i<NN; i++) {
-                                AppWindowToken wtoken = mAppTokens.get(i);
-                                if (wtoken.sendingToTop) {
-                                    wtoken.sendingToTop = false;
-                                    moveAppWindowsLocked(wtoken, NN, false);
-                                }
-                            }
-                            mToTopApps.clear();
-                        }
-
-                        WindowState oldWallpaper = mWallpaperTarget;
-
-                        adjustWallpaperWindowsLocked();
-                        wallpaperMayChange = false;
-
-                        // The top-most window will supply the layout params,
-                        // and we will determine it below.
-                        LayoutParams animLp = null;
-                        int bestAnimLayer = -1;
-                        boolean fullscreenAnim = false;
-
-                        if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
-                                "New wallpaper target=" + mWallpaperTarget
-                                + ", lower target=" + mLowerWallpaperTarget
-                                + ", upper target=" + mUpperWallpaperTarget);
-                        int foundWallpapers = 0;
-                        // Do a first pass through the tokens for two
-                        // things:
-                        // (1) Determine if both the closing and opening
-                        // app token sets are wallpaper targets, in which
-                        // case special animations are needed
-                        // (since the wallpaper needs to stay static
-                        // behind them).
-                        // (2) Find the layout params of the top-most
-                        // application window in the tokens, which is
-                        // what will control the animation theme.
-                        final int NC = mClosingApps.size();
-                        NN = NC + mOpeningApps.size();
-                        for (i=0; i<NN; i++) {
-                            AppWindowToken wtoken;
-                            int mode;
-                            if (i < NC) {
-                                wtoken = mClosingApps.get(i);
-                                mode = 1;
-                            } else {
-                                wtoken = mOpeningApps.get(i-NC);
-                                mode = 2;
-                            }
-                            if (mLowerWallpaperTarget != null) {
-                                if (mLowerWallpaperTarget.mAppToken == wtoken
-                                        || mUpperWallpaperTarget.mAppToken == wtoken) {
-                                    foundWallpapers |= mode;
-                                }
-                            }
-                            if (wtoken.appFullscreen) {
-                                WindowState ws = wtoken.findMainWindow();
-                                if (ws != null) {
-                                    animLp = ws.mAttrs;
-                                    bestAnimLayer = ws.mLayer;
-                                    fullscreenAnim = true;
-                                }
-                            } else if (!fullscreenAnim) {
-                                WindowState ws = wtoken.findMainWindow();
-                                if (ws != null) {
-                                    if (ws.mLayer > bestAnimLayer) {
-                                        animLp = ws.mAttrs;
-                                        bestAnimLayer = ws.mLayer;
-                                    }
-                                }
-                            }
-                        }
-
-                        if (foundWallpapers == 3) {
-                            if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
-                                    "Wallpaper animation!");
-                            switch (transit) {
-                                case WindowManagerPolicy.TRANSIT_ACTIVITY_OPEN:
-                                case WindowManagerPolicy.TRANSIT_TASK_OPEN:
-                                case WindowManagerPolicy.TRANSIT_TASK_TO_FRONT:
-                                    transit = WindowManagerPolicy.TRANSIT_WALLPAPER_INTRA_OPEN;
-                                    break;
-                                case WindowManagerPolicy.TRANSIT_ACTIVITY_CLOSE:
-                                case WindowManagerPolicy.TRANSIT_TASK_CLOSE:
-                                case WindowManagerPolicy.TRANSIT_TASK_TO_BACK:
-                                    transit = WindowManagerPolicy.TRANSIT_WALLPAPER_INTRA_CLOSE;
-                                    break;
-                            }
-                            if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
-                                    "New transit: " + transit);
-                        } else if (oldWallpaper != null) {
-                            // We are transitioning from an activity with
-                            // a wallpaper to one without.
-                            transit = WindowManagerPolicy.TRANSIT_WALLPAPER_CLOSE;
-                            if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
-                                    "New transit away from wallpaper: " + transit);
-                        } else if (mWallpaperTarget != null) {
-                            // We are transitioning from an activity without
-                            // a wallpaper to now showing the wallpaper
-                            transit = WindowManagerPolicy.TRANSIT_WALLPAPER_OPEN;
-                            if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
-                                    "New transit into wallpaper: " + transit);
-                        }
-
-                        // If all closing windows are obscured, then there is
-                        // no need to do an animation.  This is the case, for
-                        // example, when this transition is being done behind
-                        // the lock screen.
-                        if (!mPolicy.allowAppAnimationsLw()) {
-                            animLp = null;
-                        }
-                        
-                        NN = mOpeningApps.size();
-                        for (i=0; i<NN; i++) {
-                            AppWindowToken wtoken = mOpeningApps.get(i);
-                            if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
-                                    "Now opening app" + wtoken);
-                            wtoken.reportedVisible = false;
-                            wtoken.inPendingTransaction = false;
-                            wtoken.animation = null;
-                            setTokenVisibilityLocked(wtoken, animLp, true,
-                                    transit, false);
-                            wtoken.updateReportedVisibilityLocked();
-                            wtoken.waitingToShow = false;
-                            wtoken.showAllWindowsLocked();
-                        }
-                        NN = mClosingApps.size();
-                        for (i=0; i<NN; i++) {
-                            AppWindowToken wtoken = mClosingApps.get(i);
-                            if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
-                                    "Now closing app" + wtoken);
-                            wtoken.inPendingTransaction = false;
-                            wtoken.animation = null;
-                            setTokenVisibilityLocked(wtoken, animLp, false,
-                                    transit, false);
-                            wtoken.updateReportedVisibilityLocked();
-                            wtoken.waitingToHide = false;
-                            // Force the allDrawn flag, because we want to start
-                            // this guy's animations regardless of whether it's
-                            // gotten drawn.
-                            wtoken.allDrawn = true;
-                        }
-
-                        mNextAppTransitionPackage = null;
-
-                        mOpeningApps.clear();
-                        mClosingApps.clear();
-
-                        // This has changed the visibility of windows, so perform
-                        // a new layout to get them all up-to-date.
-                        changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_LAYOUT
-                                | WindowManagerPolicy.FINISH_LAYOUT_REDO_CONFIG;
-                        mLayoutNeeded = true;
-                        if (!moveInputMethodWindowsIfNeededLocked(true)) {
-                            assignLayersLocked();
-                        }
-                        updateFocusedWindowLocked(UPDATE_FOCUS_PLACING_SURFACES,
-                                false /*updateInputWindows*/);
-                        mFocusMayChange = false;
-                    }
+                    changes |= handleAppTransitionReadyLocked();
                 }
 
-                int adjResult = 0;
+                mInnerFields.mAdjResult = 0;
 
-                if (!animating && mAppTransitionRunning) {
+                if (!mInnerFields.mAnimating && mAppTransitionRunning) {
                     // We have finished the animation of an app transition.  To do
                     // this, we have delayed a lot of operations like showing and
                     // hiding apps, moving apps in Z-order, etc.  The app token list
                     // reflects the correct Z-order, but the window list may now
                     // be out of sync with it.  So here we will just rebuild the
                     // entire app window list.  Fun!
-                    mAppTransitionRunning = false;
-                    // Clear information about apps that were moving.
-                    mToBottomApps.clear();
-
-                    rebuildAppWindowListLocked();
-                    changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_LAYOUT;
-                    adjResult |= ADJUST_WALLPAPER_LAYERS_CHANGED;
-                    moveInputMethodWindowsIfNeededLocked(false);
-                    wallpaperMayChange = true;
-                    // Since the window list has been rebuilt, focus might
-                    // have to be recomputed since the actual order of windows
-                    // might have changed again.
-                    mFocusMayChange = true;
+                    changes |= handleAnimatingAndTransitionLocked();
                 }
 
-                if (wallpaperForceHidingChanged && changes == 0 && !mAppTransitionReady) {
+                if (mInnerFields.mWallpaperForceHidingChanged && changes == 0 && !mAppTransitionReady) {
                     // At this point, there was a window with a wallpaper that
                     // was force hiding other windows behind it, but now it
                     // is going away.  This may be simple -- just animate
                     // away the wallpaper and its window -- or it may be
                     // hard -- the wallpaper now needs to be shown behind
                     // something that was hidden.
-                    WindowState oldWallpaper = mWallpaperTarget;
-                    if (mLowerWallpaperTarget != null
-                            && mLowerWallpaperTarget.mAppToken != null) {
-                        if (DEBUG_WALLPAPER) Slog.v(TAG,
-                                "wallpaperForceHiding changed with lower="
-                                + mLowerWallpaperTarget);
-                        if (DEBUG_WALLPAPER) Slog.v(TAG,
-                                "hidden=" + mLowerWallpaperTarget.mAppToken.hidden +
-                                " hiddenRequested=" + mLowerWallpaperTarget.mAppToken.hiddenRequested);
-                        if (mLowerWallpaperTarget.mAppToken.hidden) {
-                            // The lower target has become hidden before we
-                            // actually started the animation...  let's completely
-                            // re-evaluate everything.
-                            mLowerWallpaperTarget = mUpperWallpaperTarget = null;
-                            changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_ANIM;
-                        }
-                    }
-                    adjResult |= adjustWallpaperWindowsLocked();
-                    wallpaperMayChange = false;
-                    wallpaperForceHidingChanged = false;
-                    if (DEBUG_WALLPAPER) Slog.v(TAG, "****** OLD: " + oldWallpaper
-                            + " NEW: " + mWallpaperTarget
-                            + " LOWER: " + mLowerWallpaperTarget);
-                    if (mLowerWallpaperTarget == null) {
-                        // Whoops, we don't need a special wallpaper animation.
-                        // Clear them out.
-                        forceHiding = false;
-                        for (i=N-1; i>=0; i--) {
-                            WindowState w = mWindows.get(i);
-                            if (w.mSurface != null) {
-                                final WindowManager.LayoutParams attrs = w.mAttrs;
-                                if (mPolicy.doesForceHide(w, attrs) && w.isVisibleLw()) {
-                                    if (DEBUG_FOCUS) Slog.i(TAG, "win=" + w + " force hides other windows");
-                                    forceHiding = true;
-                                } else if (mPolicy.canBeForceHidden(w, attrs)) {
-                                    if (!w.mAnimating) {
-                                        // We set the animation above so it
-                                        // is not yet running.
-                                        w.clearAnimation();
-                                    }
-                                }
-                            }
-                        }
-                    }
+                    changes |= animateAwayWallpaperLocked();
                 }
 
-                if (mWindowDetachedWallpaper != windowDetachedWallpaper) {
-                    if (DEBUG_WALLPAPER) Slog.v(TAG,
-                            "Detached wallpaper changed from " + mWindowDetachedWallpaper
-                            + " to " + windowDetachedWallpaper);
-                    mWindowDetachedWallpaper = windowDetachedWallpaper;
-                    wallpaperMayChange = true;
-                }
-
-                if (windowAnimationBackgroundColor != 0) {
-                    // If the window that wants black is the current wallpaper
-                    // target, then the black goes *below* the wallpaper so we
-                    // don't cause the wallpaper to suddenly disappear.
-                    WindowState target = windowAnimationBackground;
-                    if (mWallpaperTarget == windowAnimationBackground
-                            || mLowerWallpaperTarget == windowAnimationBackground
-                            || mUpperWallpaperTarget == windowAnimationBackground) {
-                        for (i=0; i<mWindows.size(); i++) {
-                            WindowState w = mWindows.get(i);
-                            if (w.mIsWallpaper) {
-                                target = w;
-                                break;
-                            }
-                        }
-                    }
-                    if (mWindowAnimationBackgroundSurface == null) {
-                        mWindowAnimationBackgroundSurface = new DimSurface(mFxSession);
-                    }
-                    mWindowAnimationBackgroundSurface.show(dw, dh,
-                            target.mAnimLayer - LAYER_OFFSET_DIM,
-                            windowAnimationBackgroundColor);
-                } else if (mWindowAnimationBackgroundSurface != null) {
-                    mWindowAnimationBackgroundSurface.hide();
-                }
-
-                if (wallpaperMayChange) {
-                    if (DEBUG_WALLPAPER) Slog.v(TAG,
-                            "Wallpaper may change!  Adjusting");
-                    adjResult |= adjustWallpaperWindowsLocked();
-                }
-
-                if ((adjResult&ADJUST_WALLPAPER_LAYERS_CHANGED) != 0) {
-                    if (DEBUG_WALLPAPER) Slog.v(TAG,
-                            "Wallpaper layer changed: assigning layers + relayout");
-                    changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_LAYOUT;
-                    assignLayersLocked();
-                } else if ((adjResult&ADJUST_WALLPAPER_VISIBILITY_CHANGED) != 0) {
-                    if (DEBUG_WALLPAPER) Slog.v(TAG,
-                            "Wallpaper visibility changed: relayout");
-                    changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_LAYOUT;
-                }
-
-                if (mFocusMayChange) {
-                    mFocusMayChange = false;
-                    if (updateFocusedWindowLocked(UPDATE_FOCUS_PLACING_SURFACES,
-                            false /*updateInputWindows*/)) {
-                        changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_ANIM;
-                        adjResult = 0;
-                    }
-                }
+                changes |= testWallpaperAndBackgroundLocked();
 
                 if (mLayoutNeeded) {
                     changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_LAYOUT;
@@ -8256,278 +8769,22 @@
 
             final boolean someoneLosingFocus = mLosingFocus.size() != 0;
 
-            boolean obscured = false;
-            boolean blurring = false;
-            boolean dimming = false;
-            boolean covered = false;
-            boolean syswin = false;
+            mInnerFields.mObscured = false;
+            mInnerFields.mBlurring = false;
+            mInnerFields.mDimming = false;
+            mInnerFields.mSyswin = false;
 
             final int N = mWindows.size();
 
             for (i=N-1; i>=0; i--) {
                 WindowState w = mWindows.get(i);
 
-                boolean displayed = false;
-                final WindowManager.LayoutParams attrs = w.mAttrs;
-                final int attrFlags = attrs.flags;
-
                 if (w.mSurface != null) {
-                    // XXX NOTE: The logic here could be improved.  We have
-                    // the decision about whether to resize a window separated
-                    // from whether to hide the surface.  This can cause us to
-                    // resize a surface even if we are going to hide it.  You
-                    // can see this by (1) holding device in landscape mode on
-                    // home screen; (2) tapping browser icon (device will rotate
-                    // to landscape; (3) tap home.  The wallpaper will be resized
-                    // in step 2 but then immediately hidden, causing us to
-                    // have to resize and then redraw it again in step 3.  It
-                    // would be nice to figure out how to avoid this, but it is
-                    // difficult because we do need to resize surfaces in some
-                    // cases while they are hidden such as when first showing a
-                    // window.
-                    
-                    w.computeShownFrameLocked();
-                    if (localLOGV) Slog.v(
-                            TAG, "Placing surface #" + i + " " + w.mSurface
-                            + ": new=" + w.mShownFrame);
-
-                    if (w.mSurface != null) {
-                        int width, height;
-                        if ((w.mAttrs.flags & w.mAttrs.FLAG_SCALED) != 0) {
-                            // for a scaled surface, we just want to use
-                            // the requested size.
-                            width  = w.mRequestedWidth;
-                            height = w.mRequestedHeight;
-                        } else {
-                            width = w.mCompatFrame.width();
-                            height = w.mCompatFrame.height();
-                        }
-
-                        if (width < 1) {
-                            width = 1;
-                        }
-                        if (height < 1) {
-                            height = 1;
-                        }
-                        final boolean surfaceResized = w.mSurfaceW != width || w.mSurfaceH != height;
-                        if (surfaceResized) {
-                            w.mSurfaceW = width;
-                            w.mSurfaceH = height;
-                        }
-
-                        if (w.mSurfaceX != w.mShownFrame.left
-                                || w.mSurfaceY != w.mShownFrame.top) {
-                            try {
-                                if (SHOW_TRANSACTIONS) logSurface(w,
-                                        "POS " + w.mShownFrame.left
-                                        + ", " + w.mShownFrame.top, null);
-                                w.mSurfaceX = w.mShownFrame.left;
-                                w.mSurfaceY = w.mShownFrame.top;
-                                w.mSurface.setPosition(w.mShownFrame.left, w.mShownFrame.top);
-                            } catch (RuntimeException e) {
-                                Slog.w(TAG, "Error positioning surface of " + w
-                                        + " pos=(" + w.mShownFrame.left
-                                        + "," + w.mShownFrame.top + ")", e);
-                                if (!recoveringMemory) {
-                                    reclaimSomeSurfaceMemoryLocked(w, "position", true);
-                                }
-                            }
-                        }
-
-                        if (surfaceResized) {
-                            try {
-                                if (SHOW_TRANSACTIONS) logSurface(w,
-                                        "SIZE " + width + "x" + height, null);
-                                w.mSurfaceResized = true;
-                                w.mSurface.setSize(width, height);
-                            } catch (RuntimeException e) {
-                                // If something goes wrong with the surface (such
-                                // as running out of memory), don't take down the
-                                // entire system.
-                                Slog.e(TAG, "Error resizing surface of " + w
-                                        + " size=(" + width + "x" + height + ")", e);
-                                if (!recoveringMemory) {
-                                    reclaimSomeSurfaceMemoryLocked(w, "size", true);
-                                }
-                            }
-                        }
-                    }
-
-                    if (!w.mAppFreezing && w.mLayoutSeq == mLayoutSeq) {
-                        w.mContentInsetsChanged |=
-                            !w.mLastContentInsets.equals(w.mContentInsets);
-                        w.mVisibleInsetsChanged |=
-                            !w.mLastVisibleInsets.equals(w.mVisibleInsets);
-                        boolean configChanged =
-                            w.mConfiguration != mCurConfiguration
-                            && (w.mConfiguration == null
-                                    || mCurConfiguration.diff(w.mConfiguration) != 0);
-                        if (DEBUG_CONFIGURATION && configChanged) {
-                            Slog.v(TAG, "Win " + w + " config changed: "
-                                    + mCurConfiguration);
-                        }
-                        if (localLOGV) Slog.v(TAG, "Resizing " + w
-                                + ": configChanged=" + configChanged
-                                + " last=" + w.mLastFrame + " frame=" + w.mFrame);
-                        w.mLastFrame.set(w.mFrame);
-                        if (w.mContentInsetsChanged
-                                || w.mVisibleInsetsChanged
-                                || w.mSurfaceResized
-                                || configChanged) {
-                            if (DEBUG_RESIZE || DEBUG_ORIENTATION) {
-                                Slog.v(TAG, "Resize reasons: "
-                                        + " contentInsetsChanged=" + w.mContentInsetsChanged
-                                        + " visibleInsetsChanged=" + w.mVisibleInsetsChanged
-                                        + " surfaceResized=" + w.mSurfaceResized
-                                        + " configChanged=" + configChanged);
-                            }
-
-                            w.mLastContentInsets.set(w.mContentInsets);
-                            w.mLastVisibleInsets.set(w.mVisibleInsets);
-                            makeWindowFreezingScreenIfNeededLocked(w);
-                            // If the orientation is changing, then we need to
-                            // hold off on unfreezing the display until this
-                            // window has been redrawn; to do that, we need
-                            // to go through the process of getting informed
-                            // by the application when it has finished drawing.
-                            if (w.mOrientationChanging) {
-                                if (DEBUG_ORIENTATION) Slog.v(TAG,
-                                        "Orientation start waiting for draw in "
-                                        + w + ", surface " + w.mSurface);
-                                w.mDrawPending = true;
-                                w.mCommitDrawPending = false;
-                                w.mReadyToShow = false;
-                                if (w.mAppToken != null) {
-                                    w.mAppToken.allDrawn = false;
-                                }
-                            }
-                            if (!mResizingWindows.contains(w)) {
-                                if (DEBUG_RESIZE || DEBUG_ORIENTATION) Slog.v(TAG,
-                                        "Resizing window " + w + " to " + w.mSurfaceW
-                                        + "x" + w.mSurfaceH);
-                                mResizingWindows.add(w);
-                            }
-                        } else if (w.mOrientationChanging) {
-                            if (!w.mDrawPending && !w.mCommitDrawPending) {
-                                if (DEBUG_ORIENTATION) Slog.v(TAG,
-                                        "Orientation not waiting for draw in "
-                                        + w + ", surface " + w.mSurface);
-                                w.mOrientationChanging = false;
-                            }
-                        }
-                    }
-
-                    if (w.mAttachedHidden || !w.isReadyForDisplay()) {
-                        if (!w.mLastHidden) {
-                            //dump();
-                            w.mLastHidden = true;
-                            if (SHOW_TRANSACTIONS) logSurface(w,
-                                    "HIDE (performLayout)", null);
-                            if (w.mSurface != null) {
-                                w.mSurfaceShown = false;
-                                try {
-                                    w.mSurface.hide();
-                                } catch (RuntimeException e) {
-                                    Slog.w(TAG, "Exception hiding surface in " + w);
-                                }
-                            }
-                        }
-                        // If we are waiting for this window to handle an
-                        // orientation change, well, it is hidden, so
-                        // doesn't really matter.  Note that this does
-                        // introduce a potential glitch if the window
-                        // becomes unhidden before it has drawn for the
-                        // new orientation.
-                        if (w.mOrientationChanging) {
-                            w.mOrientationChanging = false;
-                            if (DEBUG_ORIENTATION) Slog.v(TAG,
-                                    "Orientation change skips hidden " + w);
-                        }
-                    } else if (w.mLastLayer != w.mAnimLayer
-                            || w.mLastAlpha != w.mShownAlpha
-                            || w.mLastDsDx != w.mDsDx
-                            || w.mLastDtDx != w.mDtDx
-                            || w.mLastDsDy != w.mDsDy
-                            || w.mLastDtDy != w.mDtDy
-                            || w.mLastHScale != w.mHScale
-                            || w.mLastVScale != w.mVScale
-                            || w.mLastHidden) {
-                        displayed = true;
-                        w.mLastAlpha = w.mShownAlpha;
-                        w.mLastLayer = w.mAnimLayer;
-                        w.mLastDsDx = w.mDsDx;
-                        w.mLastDtDx = w.mDtDx;
-                        w.mLastDsDy = w.mDsDy;
-                        w.mLastDtDy = w.mDtDy;
-                        w.mLastHScale = w.mHScale;
-                        w.mLastVScale = w.mVScale;
-                        if (SHOW_TRANSACTIONS) logSurface(w,
-                                "alpha=" + w.mShownAlpha + " layer=" + w.mAnimLayer
-                                + " matrix=[" + (w.mDsDx*w.mHScale)
-                                + "," + (w.mDtDx*w.mVScale)
-                                + "][" + (w.mDsDy*w.mHScale)
-                                + "," + (w.mDtDy*w.mVScale) + "]", null);
-                        if (w.mSurface != null) {
-                            try {
-                                w.mSurfaceAlpha = w.mShownAlpha;
-                                w.mSurface.setAlpha(w.mShownAlpha);
-                                w.mSurfaceLayer = w.mAnimLayer;
-                                w.mSurface.setLayer(w.mAnimLayer);
-                                w.mSurface.setMatrix(
-                                        w.mDsDx*w.mHScale, w.mDtDx*w.mVScale,
-                                        w.mDsDy*w.mHScale, w.mDtDy*w.mVScale);
-                            } catch (RuntimeException e) {
-                                Slog.w(TAG, "Error updating surface in " + w, e);
-                                if (!recoveringMemory) {
-                                    reclaimSomeSurfaceMemoryLocked(w, "update", true);
-                                }
-                            }
-                        }
-
-                        if (w.mLastHidden && !w.mDrawPending
-                                && !w.mCommitDrawPending
-                                && !w.mReadyToShow) {
-                            if (SHOW_TRANSACTIONS) logSurface(w,
-                                    "SHOW (performLayout)", null);
-                            if (DEBUG_VISIBILITY) Slog.v(TAG, "Showing " + w
-                                    + " during relayout");
-                            if (showSurfaceRobustlyLocked(w)) {
-                                w.mHasDrawn = true;
-                                w.mLastHidden = false;
-                            } else {
-                                w.mOrientationChanging = false;
-                            }
-                        }
-                        if (w.mSurface != null) {
-                            w.mToken.hasVisible = true;
-                        }
-                    } else {
-                        displayed = true;
-                    }
-
-                    if (displayed) {
-                        if (!covered) {
-                            if (attrs.width == LayoutParams.MATCH_PARENT
-                                    && attrs.height == LayoutParams.MATCH_PARENT) {
-                                covered = true;
-                            }
-                        }
-                        if (w.mOrientationChanging) {
-                            if (w.mDrawPending || w.mCommitDrawPending) {
-                                orientationChangeComplete = false;
-                                if (DEBUG_ORIENTATION) Slog.v(TAG,
-                                        "Orientation continue waiting for draw in " + w);
-                            } else {
-                                w.mOrientationChanging = false;
-                                if (DEBUG_ORIENTATION) Slog.v(TAG,
-                                        "Orientation change complete in " + w);
-                            }
-                        }
-                        w.mToken.hasVisible = true;
-                    }
+                    prepareSurfaceLocked(w, recoveringMemory);
                 } else if (w.mOrientationChanging) {
-                    if (DEBUG_ORIENTATION) Slog.v(TAG,
-                            "Orientation change skips hidden " + w);
+                    if (DEBUG_ORIENTATION) {
+                        Slog.v(TAG, "Orientation change skips hidden " + w);
+                    }
                     w.mOrientationChanging = false;
                 }
 
@@ -8542,92 +8799,12 @@
                     focusDisplayed = true;
                 }
 
-                final boolean obscuredChanged = w.mObscured != obscured;
+                final boolean obscuredChanged = w.mObscured != mInnerFields.mObscured;
 
                 // Update effect.
-                if (!(w.mObscured=obscured)) {
-                    if (w.mSurface != null) {
-                        if ((attrFlags&FLAG_KEEP_SCREEN_ON) != 0) {
-                            holdScreen = w.mSession;
-                        }
-                        if (!syswin && w.mAttrs.screenBrightness >= 0
-                                && screenBrightness < 0) {
-                            screenBrightness = w.mAttrs.screenBrightness;
-                        }
-                        if (!syswin && w.mAttrs.buttonBrightness >= 0
-                                && buttonBrightness < 0) {
-                            buttonBrightness = w.mAttrs.buttonBrightness;
-                        }
-                        if (canBeSeen
-                                && (attrs.type == WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG
-                                 || attrs.type == WindowManager.LayoutParams.TYPE_KEYGUARD
-                                 || attrs.type == WindowManager.LayoutParams.TYPE_SYSTEM_ERROR)) {
-                            syswin = true;
-                        }
-                    }
-
-                    boolean opaqueDrawn = canBeSeen && w.isOpaqueDrawn();
-                    if (opaqueDrawn && w.isFullscreen(innerDw, innerDh)) {
-                        // This window completely covers everything behind it,
-                        // so we want to leave all of them as unblurred (for
-                        // performance reasons).
-                        obscured = true;
-                    } else if (canBeSeen && !obscured &&
-                            (attrFlags&FLAG_BLUR_BEHIND|FLAG_DIM_BEHIND) != 0) {
-                        if (localLOGV) Slog.v(TAG, "Win " + w
-                                + ": blurring=" + blurring
-                                + " obscured=" + obscured
-                                + " displayed=" + displayed);
-                        if ((attrFlags&FLAG_DIM_BEHIND) != 0) {
-                            if (!dimming) {
-                                //Slog.i(TAG, "DIM BEHIND: " + w);
-                                dimming = true;
-                                if (mDimAnimator == null) {
-                                    mDimAnimator = new DimAnimator(mFxSession);
-                                }
-                                mDimAnimator.show(innerDw, innerDh);
-                                mDimAnimator.updateParameters(mContext.getResources(),
-                                        w, currentTime);
-                            }
-                        }
-                        if ((attrFlags&FLAG_BLUR_BEHIND) != 0) {
-                            if (!blurring) {
-                                //Slog.i(TAG, "BLUR BEHIND: " + w);
-                                blurring = true;
-                                if (mBlurSurface == null) {
-                                    try {
-                                        mBlurSurface = new Surface(mFxSession, 0,
-                                                "BlurSurface",
-                                                -1, 16, 16,
-                                                PixelFormat.OPAQUE,
-                                                Surface.FX_SURFACE_BLUR);
-                                    } catch (Exception e) {
-                                        Slog.e(TAG, "Exception creating Blur surface", e);
-                                    }
-                                    if (SHOW_TRANSACTIONS) Slog.i(TAG, "  BLUR "
-                                            + mBlurSurface + ": CREATE");
-                                }
-                                if (mBlurSurface != null) {
-                                    if (SHOW_TRANSACTIONS) Slog.i(TAG, "  BLUR "
-                                            + mBlurSurface + ": pos=(0,0) (" +
-                                            dw + "x" + dh + "), layer=" + (w.mAnimLayer-1));
-                                    mBlurSurface.setPosition(0, 0);
-                                    mBlurSurface.setSize(dw, dh);
-                                    mBlurSurface.setLayer(w.mAnimLayer-LAYER_OFFSET_BLUR);
-                                    if (!mBlurShown) {
-                                        try {
-                                            if (SHOW_TRANSACTIONS) Slog.i(TAG, "  BLUR "
-                                                    + mBlurSurface + ": SHOW");
-                                            mBlurSurface.show();
-                                        } catch (RuntimeException e) {
-                                            Slog.w(TAG, "Failure showing blur surface", e);
-                                        }
-                                        mBlurShown = true;
-                                    }
-                                }
-                            }
-                        }
-                    }
+                w.mObscured = mInnerFields.mObscured;
+                if (!mInnerFields.mObscured) {
+                    handleNotObscuredLocked(w, currentTime, innerDw, innerDh);
                 }
 
                 if (obscuredChanged && mWallpaperTarget == w) {
@@ -8639,11 +8816,12 @@
             }
 
             if (mDimAnimator != null && mDimAnimator.mDimShown) {
-                animating |= mDimAnimator.updateSurface(dimming, currentTime,
-                        mDisplayFrozen || !mDisplayEnabled || !mPolicy.isScreenOnFully());
+                mInnerFields.mAnimating |=
+                        mDimAnimator.updateSurface(mInnerFields.mDimming, currentTime,
+                            mDisplayFrozen || !mDisplayEnabled || !mPolicy.isScreenOnFully());
             }
 
-            if (!blurring && mBlurShown) {
+            if (!mInnerFields.mBlurring && mBlurShown) {
                 if (SHOW_TRANSACTIONS) Slog.i(TAG, "  BLUR " + mBlurSurface
                         + ": HIDE");
                 try {
@@ -8677,8 +8855,8 @@
 
         if (DEBUG_ORIENTATION && mDisplayFrozen) Slog.v(TAG,
                 "With display frozen, orientationChangeComplete="
-                + orientationChangeComplete);
-        if (orientationChangeComplete) {
+                + mInnerFields.mOrientationChangeComplete);
+        if (mInnerFields.mOrientationChangeComplete) {
             if (mWindowsFreezingScreen) {
                 mWindowsFreezingScreen = false;
                 mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT);
@@ -8770,7 +8948,7 @@
 
         boolean needRelayout = false;
 
-        if (!animating && mAppTransitionRunning) {
+        if (!mInnerFields.mAnimating && mAppTransitionRunning) {
             // We have finished the animation of an app transition.  To do
             // this, we have delayed a lot of operations like showing and
             // hiding apps, moving apps in Z-order, etc.  The app token list
@@ -8792,33 +8970,32 @@
             needRelayout = adjustWallpaperWindowsLocked() != 0;
         }
         if (needRelayout) {
-            requestAnimationLocked(0);
-        } else if (animating) {
-            final int refreshTimeUs = (int)(1000 / mDisplay.getRefreshRate());
-            requestAnimationLocked(currentTime + refreshTimeUs - SystemClock.uptimeMillis());
+            requestTraversalLocked();
+        } else if (mInnerFields.mAnimating) {
+            mChoreographer.scheduleAnimation();
         }
 
         // Finally update all input windows now that the window changes have stabilized.
         mInputMonitor.updateInputWindowsLw(true /*force*/);
 
-        setHoldScreenLocked(holdScreen != null);
+        setHoldScreenLocked(mInnerFields.mHoldScreen != null);
         if (!mDisplayFrozen) {
-            if (screenBrightness < 0 || screenBrightness > 1.0f) {
+            if (mInnerFields.mScreenBrightness < 0 || mInnerFields.mScreenBrightness > 1.0f) {
                 mPowerManager.setScreenBrightnessOverride(-1);
             } else {
                 mPowerManager.setScreenBrightnessOverride((int)
-                        (screenBrightness * Power.BRIGHTNESS_ON));
+                        (mInnerFields.mScreenBrightness * Power.BRIGHTNESS_ON));
             }
-            if (buttonBrightness < 0 || buttonBrightness > 1.0f) {
+            if (mInnerFields.mButtonBrightness < 0 || mInnerFields.mButtonBrightness > 1.0f) {
                 mPowerManager.setButtonBrightnessOverride(-1);
             } else {
                 mPowerManager.setButtonBrightnessOverride((int)
-                        (buttonBrightness * Power.BRIGHTNESS_ON));
+                        (mInnerFields.mButtonBrightness * Power.BRIGHTNESS_ON));
             }
         }
-        if (holdScreen != mHoldingScreenOn) {
-            mHoldingScreenOn = holdScreen;
-            Message m = mH.obtainMessage(H.HOLD_SCREEN_CHANGED, holdScreen);
+        if (mInnerFields.mHoldScreen != mHoldingScreenOn) {
+            mHoldingScreenOn = mInnerFields.mHoldScreen;
+            Message m = mH.obtainMessage(H.HOLD_SCREEN_CHANGED, mInnerFields.mHoldScreen);
             mH.sendMessage(m);
         }
 
@@ -8828,23 +9005,22 @@
                     LocalPowerManager.BUTTON_EVENT, true);
             mTurnOnScreen = false;
         }
-        
-        if (screenRotationFinished && mScreenRotationAnimation != null) {
+
+        if (updateRotation && mScreenRotationAnimation != null) {
             mScreenRotationAnimation.kill();
             mScreenRotationAnimation = null;
         }
 
         if (updateRotation) {
             if (DEBUG_ORIENTATION) Slog.d(TAG, "Performing post-rotate rotation");
-            boolean changed = updateRotationUncheckedLocked(false);
-            if (changed) {
+            if (updateRotationUncheckedLocked(false)) {
                 mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION);
             } else {
                 updateRotation = false;
             }
         }
 
-        if (orientationChangeComplete && !needRelayout && !updateRotation) {
+        if (mInnerFields.mOrientationChangeComplete && !needRelayout && !updateRotation) {
             checkDrawnWindowsLocked();
         }
 
@@ -8914,10 +9090,17 @@
         }
     }
 
-    void requestAnimationLocked(long delay) {
-        if (!mAnimationPending) {
-            mAnimationPending = true;
-            mH.sendMessageDelayed(mH.obtainMessage(H.ANIMATE), delay);
+    void requestTraversalLocked() {
+        if (!mTraversalScheduled) {
+            mTraversalScheduled = true;
+            mH.sendEmptyMessage(H.DO_TRAVERSAL);
+        }
+    }
+
+    @Override
+    public void onAnimate() {
+        synchronized(mWindowMap) {
+            performLayoutAndPlaceSurfacesLocked();
         }
     }
 
@@ -9237,7 +9420,7 @@
             if (DEBUG_ORIENTATION) Slog.i(TAG, "**** Dismissing screen rotation animation");
             if (mScreenRotationAnimation.dismiss(mFxSession, MAX_ANIMATION_DURATION,
                     mTransitionAnimationScale, mCurDisplayWidth, mCurDisplayHeight)) {
-                requestAnimationLocked(0);
+                mChoreographer.scheduleAnimation();
             } else {
                 mScreenRotationAnimation = null;
                 updateRotation = true;
@@ -9418,6 +9601,10 @@
         return mPolicy.hasNavigationBar();
     }
 
+    public void lockNow() {
+        mPolicy.lockNow();
+    }
+
     void dumpInput(FileDescriptor fd, PrintWriter pw, boolean dumpAll) {
         pw.println("WINDOW MANAGER INPUT (dumpsys window input)");
         mInputManager.dump(pw);
@@ -9725,9 +9912,10 @@
             pw.print("  mLastWindowForcedOrientation"); pw.print(mLastWindowForcedOrientation);
                     pw.print(" mForcedAppOrientation="); pw.println(mForcedAppOrientation);
             pw.print("  mDeferredRotationPauseCount="); pw.println(mDeferredRotationPauseCount);
-            pw.print("  mAnimationPending="); pw.print(mAnimationPending);
+            pw.print("  mTraversalScheduled="); pw.print(mTraversalScheduled);
                     pw.print(" mWindowAnimationScale="); pw.print(mWindowAnimationScale);
                     pw.print(" mTransitionWindowAnimationScale="); pw.println(mTransitionAnimationScale);
+                    pw.print(" mAnimatorDurationScale="); pw.println(mAnimatorDurationScale);
             pw.print("  mNextAppTransition=0x");
                     pw.print(Integer.toHexString(mNextAppTransition));
                     pw.print(" mAppTransitionReady="); pw.println(mAppTransitionReady);
diff --git a/services/java/com/android/server/wm/WindowState.java b/services/java/com/android/server/wm/WindowState.java
index 75bda41..6868cf6 100644
--- a/services/java/com/android/server/wm/WindowState.java
+++ b/services/java/com/android/server/wm/WindowState.java
@@ -238,6 +238,12 @@
     // we can give the window focus before waiting for the relayout.
     boolean mRelayoutCalled;
 
+    // If the application has called relayout() with changes that can
+    // impact its window's size, we need to perform a layout pass on it
+    // even if it is not currently visible for layout.  This is set
+    // when in that case until the layout is done.
+    boolean mLayoutNeeded;
+
     // This is set after the Surface has been created but before the
     // window has been drawn.  During this time the surface is hidden.
     boolean mDrawPending;
@@ -1444,6 +1450,16 @@
                     || mAnimating);
     }
 
+    public boolean isGoneForLayoutLw() {
+        final AppWindowToken atoken = mAppToken;
+        return mViewVisibility == View.GONE
+                || !mRelayoutCalled
+                || (atoken == null && mRootToken.hidden)
+                || (atoken != null && (atoken.hiddenRequested || atoken.hidden))
+                || mAttachedHidden
+                || mExiting || mDestroying;
+    }
+
     /**
      * Returns true if the window has a surface that it has drawn a
      * complete UI in to.
@@ -1577,7 +1593,7 @@
             mService.applyAnimationLocked(this, WindowManagerPolicy.TRANSIT_ENTER, true);
         }
         if (requestAnim) {
-            mService.requestAnimationLocked(0);
+            mService.mChoreographer.scheduleAnimation();
         }
         return true;
     }
@@ -1618,7 +1634,7 @@
             }
         }
         if (requestAnim) {
-            mService.requestAnimationLocked(0);
+            mService.mChoreographer.scheduleAnimation();
         }
         return true;
     }
@@ -1718,8 +1734,9 @@
                     pw.print(mPolicyVisibilityAfterAnim);
                     pw.print(" mAttachedHidden="); pw.println(mAttachedHidden);
         }
-        if (!mRelayoutCalled) {
-            pw.print(prefix); pw.print("mRelayoutCalled="); pw.println(mRelayoutCalled);
+        if (!mRelayoutCalled || mLayoutNeeded) {
+            pw.print(prefix); pw.print("mRelayoutCalled="); pw.print(mRelayoutCalled);
+                    pw.print(" mLayoutNeeded="); pw.println(mLayoutNeeded);
         }
         if (mSurfaceResized || mSurfaceDestroyDeferred) {
             pw.print(prefix); pw.print("mSurfaceResized="); pw.print(mSurfaceResized);
diff --git a/services/jni/onload.cpp b/services/jni/onload.cpp
index 286ae91..c7beb5f 100644
--- a/services/jni/onload.cpp
+++ b/services/jni/onload.cpp
@@ -46,7 +46,7 @@
         ALOGE("GetEnv failed!");
         return result;
     }
-    LOG_ASSERT(env, "Could not retrieve the env!");
+    ALOG_ASSERT(env, "Could not retrieve the env!");
 
     register_android_server_PowerManagerService(env);
     register_android_server_InputApplicationHandle(env);
diff --git a/services/surfaceflinger/Android.mk b/services/surfaceflinger/Android.mk
index 95d651a..42e280f 100644
--- a/services/surfaceflinger/Android.mk
+++ b/services/surfaceflinger/Android.mk
@@ -23,18 +23,21 @@
 LOCAL_CFLAGS:= -DLOG_TAG=\"SurfaceFlinger\"
 LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
 
+ifeq ($(TARGET_HAS_WAITFORVSYNC), true)
+	LOCAL_CFLAGS += -DHAS_WAITFORVSYNC
+endif
+
 ifeq ($(TARGET_BOARD_PLATFORM), omap3)
 	LOCAL_CFLAGS += -DNO_RGBX_8888
 endif
 ifeq ($(TARGET_BOARD_PLATFORM), omap4)
 	LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
+	LOCAL_CFLAGS += -DUSE_TRIPLE_BUFFERING
 endif
 ifeq ($(TARGET_BOARD_PLATFORM), s5pc110)
 	LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY -DNEVER_DEFAULT_TO_ASYNC_MODE
-	LOCAL_CFLAGS += -DREFRESH_RATE=56
 endif
 
-
 LOCAL_SHARED_LIBRARIES := \
 	libcutils \
 	libhardware \
diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp b/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp
index cf131b1..986aec5 100644
--- a/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp
+++ b/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp
@@ -350,15 +350,28 @@
 }
 
 // this needs to be thread safe
-nsecs_t DisplayHardware::waitForVSync() const {
+nsecs_t DisplayHardware::waitForRefresh() const {
     nsecs_t timestamp;
     if (mVSync.wait(&timestamp) < 0) {
         // vsync not supported!
         usleep( getDelayToNextVSyncUs(&timestamp) );
     }
+    mLastHwVSync = timestamp; // FIXME: Not thread safe
     return timestamp;
 }
 
+nsecs_t DisplayHardware::getRefreshTimestamp() const {
+    // this returns the last refresh timestamp.
+    // if the last one is not available, we estimate it based on
+    // the refresh period and whatever closest timestamp we have.
+    nsecs_t now = systemTime();
+    return now - ((now - mLastHwVSync) %  mRefreshPeriod);
+}
+
+nsecs_t DisplayHardware::getRefreshPeriod() const {
+    return mRefreshPeriod;
+}
+
 int32_t DisplayHardware::getDelayToNextVSyncUs(nsecs_t* timestamp) const {
     Mutex::Autolock _l(mFakeVSyncMutex);
     const nsecs_t period = mRefreshPeriod;
@@ -384,10 +397,6 @@
     return mNativeWindow->compositionComplete();
 }
 
-int DisplayHardware::getCurrentBufferIndex() const {
-    return mNativeWindow->getCurrentBufferIndex();
-}
-
 void DisplayHardware::flip(const Region& dirty) const
 {
     checkGLErrors();
diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardware.h b/services/surfaceflinger/DisplayHardware/DisplayHardware.h
index 45d4b45..02be4dc 100644
--- a/services/surfaceflinger/DisplayHardware/DisplayHardware.h
+++ b/services/surfaceflinger/DisplayHardware/DisplayHardware.h
@@ -76,7 +76,9 @@
     uint32_t    getMaxViewportDims() const;
 
     // waits for the next vsync and returns the timestamp of when it happened
-    nsecs_t        waitForVSync() const;
+    nsecs_t     waitForRefresh() const;
+    nsecs_t     getRefreshPeriod() const;
+    nsecs_t     getRefreshTimestamp() const;
 
     uint32_t getPageFlipCount() const;
     EGLDisplay getEGLDisplay() const { return mDisplay; }
@@ -93,9 +95,6 @@
     }
     inline Rect bounds() const { return getBounds(); }
 
-    // only for debugging
-    int getCurrentBufferIndex() const;
-
 private:
     void init(uint32_t displayIndex) __attribute__((noinline));
     void fini() __attribute__((noinline));
@@ -122,6 +121,7 @@
     mutable Mutex   mFakeVSyncMutex;
     mutable nsecs_t mNextFakeVSync;
     nsecs_t         mRefreshPeriod;
+    mutable nsecs_t mLastHwVSync;
 
     HWComposer*     mHwc;
 
diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp b/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp
index f4afeea..69f1aca 100644
--- a/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp
+++ b/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007 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.
@@ -14,7 +14,6 @@
  * limitations under the License.
  */
 
-#include <assert.h>
 #include <errno.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -22,15 +21,6 @@
 
 #include <unistd.h>
 #include <fcntl.h>
-#include <signal.h>
-#include <termios.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/resource.h>
-
-#include <linux/unistd.h>
 
 #include <utils/Log.h>
 
@@ -45,39 +35,22 @@
 
 // ----------------------------------------------------------------------------
 
-DisplayHardwareBase::DisplayEventThreadBase::DisplayEventThreadBase(
+DisplayHardwareBase::DisplayEventThread::DisplayEventThread(
         const sp<SurfaceFlinger>& flinger)
     : Thread(false), mFlinger(flinger) {
 }
 
-DisplayHardwareBase::DisplayEventThreadBase::~DisplayEventThreadBase() {
+DisplayHardwareBase::DisplayEventThread::~DisplayEventThread() {
 }
 
-// ----------------------------------------------------------------------------
-
-DisplayHardwareBase::DisplayEventThread::DisplayEventThread(
-        const sp<SurfaceFlinger>& flinger)
-    : DisplayEventThreadBase(flinger)
-{
+status_t DisplayHardwareBase::DisplayEventThread::initCheck() const {
+    return ((access(kSleepFileName, R_OK) == 0 &&
+            access(kWakeFileName, R_OK) == 0)) ? NO_ERROR : NO_INIT;
 }
 
-DisplayHardwareBase::DisplayEventThread::~DisplayEventThread()
-{
-}
+bool DisplayHardwareBase::DisplayEventThread::threadLoop() {
 
-bool DisplayHardwareBase::DisplayEventThread::threadLoop()
-{
-    int err = 0;
-    char buf;
-    int fd;
-
-    fd = open(kSleepFileName, O_RDONLY, 0);
-    do {
-      err = read(fd, &buf, 1);
-    } while (err < 0 && errno == EINTR);
-    close(fd);
-    ALOGW_IF(err<0, "ANDROID_WAIT_FOR_FB_SLEEP failed (%s)", strerror(errno));
-    if (err >= 0) {
+    if (waitForFbSleep() == NO_ERROR) {
         sp<SurfaceFlinger> flinger = mFlinger.promote();
         ALOGD("About to give-up screen, flinger = %p", flinger.get());
         if (flinger != 0) {
@@ -85,39 +58,51 @@
             flinger->screenReleased(0);
             mBarrier.wait();
         }
+        if (waitForFbWake() == NO_ERROR) {
+            sp<SurfaceFlinger> flinger = mFlinger.promote();
+            ALOGD("Screen about to return, flinger = %p", flinger.get());
+            if (flinger != 0) {
+                flinger->screenAcquired(0);
+            }
+            return true;
+        }
     }
-    fd = open(kWakeFileName, O_RDONLY, 0);
+
+    // error, exit the thread
+    return false;
+}
+
+status_t DisplayHardwareBase::DisplayEventThread::waitForFbSleep() {
+    int err = 0;
+    char buf;
+    int fd = open(kSleepFileName, O_RDONLY, 0);
+    // if the file doesn't exist, the error will be caught in read() below
     do {
-      err = read(fd, &buf, 1);
+        err = read(fd, &buf, 1);
     } while (err < 0 && errno == EINTR);
     close(fd);
-    ALOGW_IF(err<0, "ANDROID_WAIT_FOR_FB_WAKE failed (%s)", strerror(errno));
-    if (err >= 0) {
-        sp<SurfaceFlinger> flinger = mFlinger.promote();
-        ALOGD("Screen about to return, flinger = %p", flinger.get());
-        if (flinger != 0)
-            flinger->screenAcquired(0);
-    }
-    return true;
+    ALOGE_IF(err<0, "*** ANDROID_WAIT_FOR_FB_SLEEP failed (%s)", strerror(errno));
+    return err < 0 ? -errno : int(NO_ERROR);
 }
 
-status_t DisplayHardwareBase::DisplayEventThread::releaseScreen() const
-{
+status_t DisplayHardwareBase::DisplayEventThread::waitForFbWake() {
+    int err = 0;
+    char buf;
+    int fd = open(kWakeFileName, O_RDONLY, 0);
+    // if the file doesn't exist, the error will be caught in read() below
+    do {
+        err = read(fd, &buf, 1);
+    } while (err < 0 && errno == EINTR);
+    close(fd);
+    ALOGE_IF(err<0, "*** ANDROID_WAIT_FOR_FB_WAKE failed (%s)", strerror(errno));
+    return err < 0 ? -errno : int(NO_ERROR);
+}
+
+status_t DisplayHardwareBase::DisplayEventThread::releaseScreen() const {
     mBarrier.open();
     return NO_ERROR;
 }
 
-status_t DisplayHardwareBase::DisplayEventThread::readyToRun()
-{
-    return NO_ERROR;
-}
-
-status_t DisplayHardwareBase::DisplayEventThread::initCheck() const
-{
-    return ((access(kSleepFileName, R_OK) == 0 &&
-            access(kWakeFileName, R_OK) == 0)) ? NO_ERROR : NO_INIT;
-}
-
 // ----------------------------------------------------------------------------
 
 DisplayHardwareBase::DisplayHardwareBase(const sp<SurfaceFlinger>& flinger,
@@ -127,35 +112,35 @@
     mDisplayEventThread = new DisplayEventThread(flinger);
 }
 
-DisplayHardwareBase::~DisplayHardwareBase()
-{
+void DisplayHardwareBase::startSleepManagement() const {
+    if (mDisplayEventThread->initCheck() == NO_ERROR) {
+        mDisplayEventThread->run("DisplayEventThread", PRIORITY_URGENT_DISPLAY);
+    } else {
+        ALOGW("/sys/power/wait_for_fb_{wake|sleep} don't exist");
+    }
+}
+
+DisplayHardwareBase::~DisplayHardwareBase() {
     // request exit
     mDisplayEventThread->requestExitAndWait();
 }
 
-bool DisplayHardwareBase::canDraw() const
-{
+bool DisplayHardwareBase::canDraw() const {
     return mScreenAcquired;
 }
 
-void DisplayHardwareBase::releaseScreen() const
-{
+void DisplayHardwareBase::releaseScreen() const {
     status_t err = mDisplayEventThread->releaseScreen();
     if (err >= 0) {
         mScreenAcquired = false;
     }
 }
 
-void DisplayHardwareBase::acquireScreen() const
-{
-    status_t err = mDisplayEventThread->acquireScreen();
-    if (err >= 0) {
-        mScreenAcquired = true;
-    }
+void DisplayHardwareBase::acquireScreen() const {
+    mScreenAcquired = true;
 }
 
-bool DisplayHardwareBase::isScreenAcquired() const
-{
+bool DisplayHardwareBase::isScreenAcquired() const {
     return mScreenAcquired;
 }
 
diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.h b/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.h
index ef2df43..fba211b 100644
--- a/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.h
+++ b/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007 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.
@@ -20,8 +20,6 @@
 #include <stdint.h>
 #include <utils/RefBase.h>
 #include <utils/threads.h>
-#include <linux/kd.h>
-#include <linux/vt.h>
 #include "Barrier.h"
 
 namespace android {
@@ -31,11 +29,13 @@
 class DisplayHardwareBase
 {
 public:
-                DisplayHardwareBase(
-                        const sp<SurfaceFlinger>& flinger,
-                        uint32_t displayIndex);
+    DisplayHardwareBase(
+            const sp<SurfaceFlinger>& flinger,
+            uint32_t displayIndex);
 
-                ~DisplayHardwareBase();
+    ~DisplayHardwareBase();
+
+    void startSleepManagement() const;
 
     // console management
     void releaseScreen() const;
@@ -46,34 +46,21 @@
 
 
 private:
-    class DisplayEventThreadBase : public Thread {
-    protected:
+    class DisplayEventThread : public Thread {
         wp<SurfaceFlinger> mFlinger;
-    public:
-        DisplayEventThreadBase(const sp<SurfaceFlinger>& flinger);
-        virtual ~DisplayEventThreadBase();
-        virtual void onFirstRef() {
-            run("DisplayEventThread", PRIORITY_URGENT_DISPLAY);
-        }
-        virtual status_t acquireScreen() const { return NO_ERROR; };
-        virtual status_t releaseScreen() const { return NO_ERROR; };
-        virtual status_t initCheck() const = 0;
-    };
-
-    class DisplayEventThread : public DisplayEventThreadBase 
-    {
         mutable Barrier mBarrier;
+        status_t waitForFbSleep();
+        status_t waitForFbWake();
     public:
-                DisplayEventThread(const sp<SurfaceFlinger>& flinger);
+        DisplayEventThread(const sp<SurfaceFlinger>& flinger);
         virtual ~DisplayEventThread();
         virtual bool threadLoop();
-        virtual status_t readyToRun();
-        virtual status_t releaseScreen() const;
-        virtual status_t initCheck() const;
+        status_t releaseScreen() const;
+        status_t initCheck() const;
     };
 
-    sp<DisplayEventThreadBase>  mDisplayEventThread;
-    mutable int                 mScreenAcquired;
+    sp<DisplayEventThread>  mDisplayEventThread;
+    mutable int             mScreenAcquired;
 };
 
 }; // namespace android
diff --git a/services/surfaceflinger/EventThread.cpp b/services/surfaceflinger/EventThread.cpp
index 9245781..af0da0b 100644
--- a/services/surfaceflinger/EventThread.cpp
+++ b/services/surfaceflinger/EventThread.cpp
@@ -36,6 +36,7 @@
 EventThread::EventThread(const sp<SurfaceFlinger>& flinger)
     : mFlinger(flinger),
       mHw(flinger->graphicPlane(0).displayHardware()),
+      mLastVSyncTimestamp(0),
       mDeliveredEvents(0)
 {
 }
@@ -44,6 +45,20 @@
     run("EventThread", PRIORITY_URGENT_DISPLAY + PRIORITY_MORE_FAVORABLE);
 }
 
+sp<DisplayEventConnection> EventThread::createEventConnection() const {
+    return new DisplayEventConnection(const_cast<EventThread*>(this));
+}
+
+nsecs_t EventThread::getLastVSyncTimestamp() const {
+    Mutex::Autolock _l(mLock);
+    return mLastVSyncTimestamp;
+}
+
+nsecs_t EventThread::getVSyncPeriod() const {
+    return mHw.getRefreshPeriod();
+
+}
+
 status_t EventThread::registerDisplayEventConnection(
         const sp<DisplayEventConnection>& connection) {
     Mutex::Autolock _l(mLock);
@@ -80,8 +95,11 @@
         Mutex::Autolock _l(mLock);
         ConnectionInfo* info = getConnectionInfoLocked(connection);
         if (info) {
-            info->count = (count == 0) ? -1 : count;
-            mCondition.signal();
+            const int32_t new_count = (count == 0) ? -1 : count;
+            if (info->count != new_count) {
+                info->count = new_count;
+                mCondition.signal();
+            }
         }
     }
 }
@@ -90,10 +108,8 @@
         const wp<DisplayEventConnection>& connection) {
     Mutex::Autolock _l(mLock);
     ConnectionInfo* info = getConnectionInfoLocked(connection);
-    if (info) {
-        if (info->count < 0) {
-            info->count = 0;
-        }
+    if (info && info->count < 0) {
+        info->count = 0;
         mCondition.signal();
     }
 }
@@ -102,32 +118,22 @@
 
     nsecs_t timestamp;
     DisplayEventReceiver::Event vsync;
-    KeyedVector< wp<DisplayEventConnection>, ConnectionInfo > displayEventConnections;
+    Vector< wp<DisplayEventConnection> > displayEventConnections;
 
     { // scope for the lock
         Mutex::Autolock _l(mLock);
         do {
-            // wait for listeners
+            // see if we need to wait for the VSYNC at all
             do {
                 bool waitForNextVsync = false;
                 size_t count = mDisplayEventConnections.size();
                 for (size_t i=0 ; i<count ; i++) {
                     const ConnectionInfo& info(
                             mDisplayEventConnections.valueAt(i));
-                    if (info.count >= 1) {
-                        // continuous mode
+                    if (info.count >= 0) {
+                        // at least one continuous mode or active one-shot event
                         waitForNextVsync = true;
-                    } else {
-                        // one-shot event
-                        if (info.count >= -1) {
-                            ConnectionInfo& info(
-                                    mDisplayEventConnections.editValueAt(i));
-                            info.count--;
-                            if (info.count == -1) {
-                                // fired this time around
-                                waitForNextVsync = true;
-                            }
-                        }
+                        break;
                     }
                 }
 
@@ -137,51 +143,50 @@
                 mCondition.wait(mLock);
             } while(true);
 
-            // wait for vsync
+            // at least one listener requested VSYNC
             mLock.unlock();
-            timestamp = mHw.waitForVSync();
+            timestamp = mHw.waitForRefresh();
             mLock.lock();
             mDeliveredEvents++;
+            mLastVSyncTimestamp = timestamp;
 
-            // make sure we still have some listeners
-        } while (!mDisplayEventConnections.size());
+            // now see if we still need to report this VSYNC event
+            const size_t count = mDisplayEventConnections.size();
+            for (size_t i=0 ; i<count ; i++) {
+                bool reportVsync = false;
+                const ConnectionInfo& info(
+                        mDisplayEventConnections.valueAt(i));
+                if (info.count >= 1) {
+                    if (info.count==1 || (mDeliveredEvents % info.count) == 0) {
+                        // continuous event, and time to report it
+                        reportVsync = true;
+                    }
+                } else if (info.count >= -1) {
+                    ConnectionInfo& info(
+                            mDisplayEventConnections.editValueAt(i));
+                    if (info.count == 0) {
+                        // fired this time around
+                        reportVsync = true;
+                    }
+                    info.count--;
+                }
+                if (reportVsync) {
+                    displayEventConnections.add(mDisplayEventConnections.keyAt(i));
+                }
+            }
+        } while (!displayEventConnections.size());
 
         // dispatch vsync events to listeners...
         vsync.header.type = DisplayEventReceiver::DISPLAY_EVENT_VSYNC;
         vsync.header.timestamp = timestamp;
         vsync.vsync.count = mDeliveredEvents;
-
-        // make a copy of our connection list, so we can
-        // dispatch events without holding mLock
-        displayEventConnections = mDisplayEventConnections;
     }
 
     const size_t count = displayEventConnections.size();
     for (size_t i=0 ; i<count ; i++) {
-        sp<DisplayEventConnection> conn(displayEventConnections.keyAt(i).promote());
+        sp<DisplayEventConnection> conn(displayEventConnections[i].promote());
         // make sure the connection didn't die
         if (conn != NULL) {
-
-            const ConnectionInfo& info(
-                    displayEventConnections.valueAt(i));
-
-            if ((info.count > 1) && (mDeliveredEvents % info.count)) {
-                // continuous event, but not time to send this event yet
-                continue;
-            } else if (info.count < -1) {
-                // disabled event
-                continue;
-            } else if (info.count == 0) {
-                // impossible by construction. but we prefer to be safe.
-                continue;
-            }
-
-            // here, either:
-            // count = -1 : one-shot scheduled this time around
-            // count =  1 : continuous not rate-limited
-            // count >  1 : continuous, rate-limited
-            // Note: count == 0 is not possible by construction
-
             status_t err = conn->postEvent(vsync);
             if (err == -EAGAIN || err == -EWOULDBLOCK) {
                 // The destination doesn't accept events anymore, it's probably
@@ -193,12 +198,12 @@
                 // handle any other error on the pipe as fatal. the only
                 // reasonable thing to do is to clean-up this connection.
                 // The most common error we'll get here is -EPIPE.
-                removeDisplayEventConnection(displayEventConnections.keyAt(i));
+                removeDisplayEventConnection(displayEventConnections[i]);
             }
         } else {
             // somehow the connection is dead, but we still have it in our list
             // just clean the list.
-            removeDisplayEventConnection(displayEventConnections.keyAt(i));
+            removeDisplayEventConnection(displayEventConnections[i]);
         }
     }
 
diff --git a/services/surfaceflinger/EventThread.h b/services/surfaceflinger/EventThread.h
index 35bd299..3a3071e 100644
--- a/services/surfaceflinger/EventThread.h
+++ b/services/surfaceflinger/EventThread.h
@@ -36,6 +36,7 @@
 
 class SurfaceFlinger;
 class DisplayHardware;
+class DisplayEventConnection;
 
 // ---------------------------------------------------------------------------
 
@@ -45,6 +46,8 @@
 public:
     EventThread(const sp<SurfaceFlinger>& flinger);
 
+    sp<DisplayEventConnection> createEventConnection() const;
+
     status_t registerDisplayEventConnection(
             const sp<DisplayEventConnection>& connection);
 
@@ -56,6 +59,10 @@
 
     void requestNextVsync(const wp<DisplayEventConnection>& connection);
 
+    nsecs_t getLastVSyncTimestamp() const;
+
+    nsecs_t getVSyncPeriod() const;
+
     void dump(String8& result, char* buffer, size_t SIZE) const;
 
 private:
@@ -88,6 +95,7 @@
 
     // protected by mLock
     KeyedVector< wp<DisplayEventConnection>, ConnectionInfo > mDisplayEventConnections;
+    nsecs_t mLastVSyncTimestamp;
 
     // main thread only
     size_t mDeliveredEvents;
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index d4c4b1f..3e6b872 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -38,6 +38,7 @@
 #include "Layer.h"
 #include "SurfaceFlinger.h"
 #include "SurfaceTextureLayer.h"
+#include <math.h>
 
 #define DEBUG_RESIZE    0
 
@@ -54,6 +55,9 @@
         mCurrentTransform(0),
         mCurrentScalingMode(NATIVE_WINDOW_SCALING_MODE_FREEZE),
         mCurrentOpacity(true),
+        mRefreshPending(0),
+        mFrameLatencyNeeded(false),
+        mFrameLatencyOffset(0),
         mFormat(PIXEL_FORMAT_NONE),
         mGLExtensions(GLExtensions::getInstance()),
         mOpaqueLayer(true),
@@ -65,6 +69,17 @@
     glGenTextures(1, &mTextureName);
 }
 
+void Layer::onLayerDisplayed() {
+    if (mFrameLatencyNeeded) {
+        const DisplayHardware& hw(graphicPlane(0).displayHardware());
+        mFrameStats[mFrameLatencyOffset].timestamp = mSurfaceTexture->getTimestamp();
+        mFrameStats[mFrameLatencyOffset].set = systemTime();
+        mFrameStats[mFrameLatencyOffset].vsync = hw.getRefreshTimestamp();
+        mFrameLatencyOffset = (mFrameLatencyOffset + 1) % 128;
+        mFrameLatencyNeeded = false;
+    }
+}
+
 void Layer::onFirstRef()
 {
     LayerBaseClient::onFirstRef();
@@ -83,7 +98,12 @@
     mSurfaceTexture = new SurfaceTextureLayer(mTextureName, this);
     mSurfaceTexture->setFrameAvailableListener(new FrameQueuedListener(this));
     mSurfaceTexture->setSynchronousMode(true);
+#ifdef USE_TRIPLE_BUFFERING
+#warning "using triple buffering"
+    mSurfaceTexture->setBufferCountServer(3);
+#else
     mSurfaceTexture->setBufferCountServer(2);
+#endif
 }
 
 Layer::~Layer()
@@ -94,7 +114,7 @@
 
 void Layer::onFrameQueued() {
     android_atomic_inc(&mQueuedFrames);
-    mFlinger->signalEvent();
+    mFlinger->signalLayerUpdate();
 }
 
 // called with SurfaceFlinger::mStateLock as soon as the layer is entered
@@ -388,16 +408,37 @@
 // pageflip handling...
 // ----------------------------------------------------------------------------
 
+bool Layer::onPreComposition()
+{
+    // if there was more than one pending update, request a refresh
+    if (mRefreshPending >= 2) {
+        mRefreshPending = 0;
+        return true;
+    }
+    mRefreshPending = 0;
+    return false;
+}
+
 void Layer::lockPageFlip(bool& recomputeVisibleRegions)
 {
     if (mQueuedFrames > 0) {
+
+        // if we've already called updateTexImage() without going through
+        // a composition step, we have to skip this layer at this point
+        // because we cannot call updateTeximage() without a corresponding
+        // compositionComplete() call.
+        // we'll trigger an update in onPreComposition().
+        if (mRefreshPending++) {
+            return;
+        }
+
         // Capture the old state of the layer for comparisons later
         const bool oldOpacity = isOpaque();
         sp<GraphicBuffer> oldActiveBuffer = mActiveBuffer;
 
         // signal another event if we have more frames pending
         if (android_atomic_dec(&mQueuedFrames) > 1) {
-            mFlinger->signalEvent();
+            mFlinger->signalLayerUpdate();
         }
 
         if (mSurfaceTexture->updateTexImage() < NO_ERROR) {
@@ -408,6 +449,7 @@
 
         // update the active buffer
         mActiveBuffer = mSurfaceTexture->getCurrentBuffer();
+        mFrameLatencyNeeded = true;
 
         const Rect crop(mSurfaceTexture->getCurrentCrop());
         const uint32_t transform(mSurfaceTexture->getCurrentTransform());
@@ -499,6 +541,10 @@
 void Layer::unlockPageFlip(
         const Transform& planeTransform, Region& outDirtyRegion)
 {
+    if (mRefreshPending >= 2) {
+        return;
+    }
+
     Region dirtyRegion(mPostedDirtyRegion);
     if (!dirtyRegion.isEmpty()) {
         mPostedDirtyRegion.clear();
@@ -532,9 +578,9 @@
     snprintf(buffer, SIZE,
             "      "
             "format=%2d, activeBuffer=[%4ux%4u:%4u,%3X],"
-            " transform-hint=0x%02x, queued-frames=%d\n",
+            " transform-hint=0x%02x, queued-frames=%d, mRefreshPending=%d\n",
             mFormat, w0, h0, s0,f0,
-            getTransformHint(), mQueuedFrames);
+            getTransformHint(), mQueuedFrames, mRefreshPending);
 
     result.append(buffer);
 
@@ -543,6 +589,32 @@
     }
 }
 
+void Layer::dumpStats(String8& result, char* buffer, size_t SIZE) const
+{
+    LayerBaseClient::dumpStats(result, buffer, SIZE);
+    const size_t o = mFrameLatencyOffset;
+    const DisplayHardware& hw(graphicPlane(0).displayHardware());
+    const nsecs_t period = hw.getRefreshPeriod();
+    result.appendFormat("%lld\n", period);
+    for (size_t i=0 ; i<128 ; i++) {
+        const size_t index = (o+i) % 128;
+        const nsecs_t time_app   = mFrameStats[index].timestamp;
+        const nsecs_t time_set   = mFrameStats[index].set;
+        const nsecs_t time_vsync = mFrameStats[index].vsync;
+        result.appendFormat("%lld\t%lld\t%lld\n",
+                time_app,
+                time_vsync,
+                time_set);
+    }
+    result.append("\n");
+}
+
+void Layer::clearStats()
+{
+    LayerBaseClient::clearStats();
+    memset(mFrameStats, 0, sizeof(mFrameStats));
+}
+
 uint32_t Layer::getEffectiveUsage(uint32_t usage) const
 {
     // TODO: should we do something special if mSecure is set?
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 2b9471b..bf30608 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -34,6 +34,7 @@
 #include "LayerBase.h"
 #include "SurfaceTextureLayer.h"
 #include "Transform.h"
+#include <utils/Timers.h>
 
 namespace android {
 
@@ -78,12 +79,17 @@
     // LayerBaseClient interface
     virtual wp<IBinder> getSurfaceTextureBinder() const;
 
+    virtual void onLayerDisplayed();
+    virtual bool onPreComposition();
+
     // only for debugging
     inline const sp<GraphicBuffer>& getActiveBuffer() const { return mActiveBuffer; }
 
 protected:
     virtual void onFirstRef();
     virtual void dump(String8& result, char* scratch, size_t size) const;
+    virtual void dumpStats(String8& result, char* buffer, size_t SIZE) const;
+    virtual void clearStats();
 
 private:
     friend class SurfaceTextureLayer;
@@ -110,6 +116,19 @@
     uint32_t mCurrentTransform;
     uint32_t mCurrentScalingMode;
     bool mCurrentOpacity;
+    size_t mRefreshPending;
+    bool mFrameLatencyNeeded;
+    int mFrameLatencyOffset;
+
+    struct Statistics {
+        Statistics() : timestamp(0), set(0), vsync(0) { }
+        nsecs_t timestamp;  // buffer timestamp
+        nsecs_t set;        // buffer displayed timestamp
+        nsecs_t vsync;      // vsync immediately before set
+    };
+
+    // protected by mLock
+    Statistics mFrameStats[128];
 
     // constants
     PixelFormat mFormat;
@@ -121,9 +140,6 @@
     bool mSecure;         // no screenshots
     bool mProtectedByApp; // application requires protected path to external sink
     Region mPostedDirtyRegion;
-
-    // binder thread, transaction thread
-    mutable Mutex mLock;
 };
 
 // ---------------------------------------------------------------------------
diff --git a/services/surfaceflinger/LayerBase.cpp b/services/surfaceflinger/LayerBase.cpp
index 37879f1..e764001 100644
--- a/services/surfaceflinger/LayerBase.cpp
+++ b/services/surfaceflinger/LayerBase.cpp
@@ -47,8 +47,7 @@
       mOrientation(0),
       mPlaneOrientation(0),
       mTransactionFlags(0),
-      mPremultipliedAlpha(true), mName("unnamed"), mDebug(false),
-      mInvalidate(0)
+      mPremultipliedAlpha(true), mName("unnamed"), mDebug(false)
 {
     const DisplayHardware& hw(flinger->graphicPlane(0).displayHardware());
     mFlags = hw.getFlags();
@@ -262,23 +261,11 @@
     mTransformedBounds = tr.makeBounds(w, h);
 }
 
-void LayerBase::lockPageFlip(bool& recomputeVisibleRegions)
-{
+void LayerBase::lockPageFlip(bool& recomputeVisibleRegions) {
 }
 
 void LayerBase::unlockPageFlip(
-        const Transform& planeTransform, Region& outDirtyRegion)
-{
-    if ((android_atomic_and(~1, &mInvalidate)&1) == 1) {
-        outDirtyRegion.orSelf(visibleRegionScreen);
-    }
-}
-
-void LayerBase::invalidate()
-{
-    if ((android_atomic_or(1, &mInvalidate)&1) == 0) {
-        mFlinger->signalEvent();
-    }
+        const Transform& planeTransform, Region& outDirtyRegion) {
 }
 
 void LayerBase::drawRegion(const Region& reg) const
@@ -471,13 +458,21 @@
 void LayerBase::dump(String8& result, char* buffer, size_t SIZE) const
 {
     const Layer::State& s(drawingState());
+
     snprintf(buffer, SIZE,
-            "+ %s %p (%s)\n"
+            "+ %s %p (%s)\n",
+            getTypeId(), this, getName().string());
+    result.append(buffer);
+
+    s.transparentRegion.dump(result, "transparentRegion");
+    transparentRegionScreen.dump(result, "transparentRegionScreen");
+    visibleRegionScreen.dump(result, "visibleRegionScreen");
+
+    snprintf(buffer, SIZE,
             "      "
             "z=%9d, pos=(%g,%g), size=(%4d,%4d), "
             "isOpaque=%1d, needsDithering=%1d, invalidate=%1d, "
             "alpha=0x%02x, flags=0x%08x, tr=[%.2f, %.2f][%.2f, %.2f]\n",
-            getTypeId(), this, getName().string(),
             s.z, s.transform.tx(), s.transform.ty(), s.w, s.h,
             isOpaque(), needsDithering(), contentDirty,
             s.alpha, s.flags,
@@ -486,11 +481,15 @@
     result.append(buffer);
 }
 
-void LayerBase::shortDump(String8& result, char* scratch, size_t size) const
-{
+void LayerBase::shortDump(String8& result, char* scratch, size_t size) const {
     LayerBase::dump(result, scratch, size);
 }
 
+void LayerBase::dumpStats(String8& result, char* scratch, size_t SIZE) const {
+}
+
+void LayerBase::clearStats() {
+}
 
 // ---------------------------------------------------------------------------
 
diff --git a/services/surfaceflinger/LayerBase.h b/services/surfaceflinger/LayerBase.h
index 7f62145..b8f7680 100644
--- a/services/surfaceflinger/LayerBase.h
+++ b/services/surfaceflinger/LayerBase.h
@@ -103,8 +103,6 @@
             Rect visibleBounds() const;
             void drawRegion(const Region& reg) const;
 
-            void invalidate();
-
     virtual sp<LayerBaseClient> getLayerBaseClient() const { return 0; }
     virtual sp<Layer> getLayer() const { return 0; }
 
@@ -204,11 +202,22 @@
 
     /** called with the state lock when the surface is removed from the
      *  current list */
-    virtual void onRemoved() { };
-    
+    virtual void onRemoved() { }
+
+    /** called after page-flip
+     */
+    virtual void onLayerDisplayed() { }
+
+    /** called before composition.
+     * returns true if the layer has pending updates.
+     */
+    virtual bool onPreComposition() { return false; }
+
     /** always call base class first */
     virtual void dump(String8& result, char* scratch, size_t size) const;
     virtual void shortDump(String8& result, char* scratch, size_t size) const;
+    virtual void dumpStats(String8& result, char* buffer, size_t SIZE) const;
+    virtual void clearStats();
 
 
     enum { // flags for doTransaction()
@@ -271,10 +280,6 @@
     mutable     bool            mDebug;
 
 
-                // atomic
-    volatile    int32_t         mInvalidate;
-                
-
 public:
     // called from class SurfaceFlinger
     virtual ~LayerBase();
diff --git a/services/surfaceflinger/MessageQueue.cpp b/services/surfaceflinger/MessageQueue.cpp
index cbd530c..290fff4 100644
--- a/services/surfaceflinger/MessageQueue.cpp
+++ b/services/surfaceflinger/MessageQueue.cpp
@@ -18,12 +18,18 @@
 #include <errno.h>
 #include <sys/types.h>
 
+#include <binder/IPCThreadState.h>
+
 #include <utils/threads.h>
 #include <utils/Timers.h>
 #include <utils/Log.h>
-#include <binder/IPCThreadState.h>
+
+#include <gui/IDisplayEventConnection.h>
+#include <gui/BitTube.h>
 
 #include "MessageQueue.h"
+#include "EventThread.h"
+#include "SurfaceFlinger.h"
 
 namespace android {
 
@@ -43,36 +49,69 @@
 
 // ---------------------------------------------------------------------------
 
+void MessageQueue::Handler::signalRefresh() {
+    if ((android_atomic_or(eventMaskRefresh, &mEventMask) & eventMaskRefresh) == 0) {
+        mQueue.mLooper->sendMessage(this, Message(MessageQueue::REFRESH));
+    }
+}
+
+void MessageQueue::Handler::signalInvalidate() {
+    if ((android_atomic_or(eventMaskInvalidate, &mEventMask) & eventMaskInvalidate) == 0) {
+        mQueue.mLooper->sendMessage(this, Message(MessageQueue::INVALIDATE));
+    }
+}
+
+void MessageQueue::Handler::handleMessage(const Message& message) {
+    switch (message.what) {
+        case INVALIDATE:
+            android_atomic_and(~eventMaskInvalidate, &mEventMask);
+            mQueue.mFlinger->onMessageReceived(message.what);
+            break;
+        case REFRESH:
+            android_atomic_and(~eventMaskRefresh, &mEventMask);
+            mQueue.mFlinger->onMessageReceived(message.what);
+            break;
+    }
+}
+
+// ---------------------------------------------------------------------------
+
 MessageQueue::MessageQueue()
-    : mLooper(new Looper(true)), mWorkPending(0)
 {
 }
 
 MessageQueue::~MessageQueue() {
 }
 
+void MessageQueue::init(const sp<SurfaceFlinger>& flinger)
+{
+    mFlinger = flinger;
+    mLooper = new Looper(true);
+    mHandler = new Handler(*this);
+}
+
+void MessageQueue::setEventThread(const sp<EventThread>& eventThread)
+{
+    mEventThread = eventThread;
+    mEvents = eventThread->createEventConnection();
+    mEventTube = mEvents->getDataChannel();
+    mLooper->addFd(mEventTube->getFd(), 0, ALOOPER_EVENT_INPUT,
+            MessageQueue::cb_eventReceiver, this);
+}
+
 void MessageQueue::waitMessage() {
     do {
         IPCThreadState::self()->flushCommands();
-
         int32_t ret = mLooper->pollOnce(-1);
         switch (ret) {
             case ALOOPER_POLL_WAKE:
             case ALOOPER_POLL_CALLBACK:
-                // callback and/or wake
-                if (android_atomic_and(0, &mWorkPending)) {
-                    return;
-                }
                 continue;
-
+            case ALOOPER_POLL_ERROR:
+                ALOGE("ALOOPER_POLL_ERROR");
             case ALOOPER_POLL_TIMEOUT:
                 // timeout (should not happen)
                 continue;
-
-            case ALOOPER_POLL_ERROR:
-                ALOGE("ALOOPER_POLL_ERROR");
-                continue;
-
             default:
                 // should not happen
                 ALOGE("Looper::pollOnce() returned unknown status %d", ret);
@@ -93,11 +132,32 @@
     return NO_ERROR;
 }
 
-status_t MessageQueue::invalidate() {
-    if (android_atomic_or(1, &mWorkPending) == 0) {
-        mLooper->wake();
+void MessageQueue::invalidate() {
+//    mHandler->signalInvalidate();
+    mEvents->requestNextVsync();
+}
+
+void MessageQueue::refresh() {
+    mEvents->requestNextVsync();
+}
+
+int MessageQueue::cb_eventReceiver(int fd, int events, void* data) {
+    MessageQueue* queue = reinterpret_cast<MessageQueue *>(data);
+    return queue->eventReceiver(fd, events);
+}
+
+int MessageQueue::eventReceiver(int fd, int events) {
+    ssize_t n;
+    DisplayEventReceiver::Event buffer[8];
+    while ((n = DisplayEventReceiver::getEvents(mEventTube, buffer, 8)) > 0) {
+        for (int i=0 ; i<n ; i++) {
+            if (buffer[i].header.type == DisplayEventReceiver::DISPLAY_EVENT_VSYNC) {
+                mHandler->signalRefresh();
+                break;
+            }
+        }
     }
-    return NO_ERROR;
+    return 1;
 }
 
 // ---------------------------------------------------------------------------
diff --git a/services/surfaceflinger/MessageQueue.h b/services/surfaceflinger/MessageQueue.h
index 2317d81..ea29e7e 100644
--- a/services/surfaceflinger/MessageQueue.h
+++ b/services/surfaceflinger/MessageQueue.h
@@ -25,10 +25,16 @@
 #include <utils/Timers.h>
 #include <utils/Looper.h>
 
+#include <gui/DisplayEventReceiver.h>
+
 #include "Barrier.h"
 
 namespace android {
 
+class IDisplayEventConnection;
+class EventThread;
+class SurfaceFlinger;
+
 // ---------------------------------------------------------------------------
 
 class MessageBase : public MessageHandler
@@ -54,16 +60,48 @@
 // ---------------------------------------------------------------------------
 
 class MessageQueue {
+    class Handler : public MessageHandler {
+        enum {
+            eventMaskInvalidate = 0x1,
+            eventMaskRefresh    = 0x2
+        };
+        MessageQueue& mQueue;
+        int32_t mEventMask;
+    public:
+        Handler(MessageQueue& queue) : mQueue(queue), mEventMask(0) { }
+        virtual void handleMessage(const Message& message);
+        void signalRefresh();
+        void signalInvalidate();
+    };
+
+    friend class Handler;
+
+    sp<SurfaceFlinger> mFlinger;
     sp<Looper> mLooper;
-    volatile int32_t mWorkPending;
+    sp<EventThread> mEventThread;
+    sp<IDisplayEventConnection> mEvents;
+    sp<BitTube> mEventTube;
+    sp<Handler> mHandler;
+
+
+    static int cb_eventReceiver(int fd, int events, void* data);
+    int eventReceiver(int fd, int events);
 
 public:
+    enum {
+        INVALIDATE = 0,
+        REFRESH    = 1,
+    };
+
     MessageQueue();
     ~MessageQueue();
+    void init(const sp<SurfaceFlinger>& flinger);
+    void setEventThread(const sp<EventThread>& events);
 
     void waitMessage();
     status_t postMessage(const sp<MessageBase>& message, nsecs_t reltime=0);
-    status_t invalidate();
+    void invalidate();
+    void refresh();
 };
 
 // ---------------------------------------------------------------------------
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index bbb30b0..40717f4 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -41,7 +41,6 @@
 #include <utils/StopWatch.h>
 
 #include <ui/GraphicBufferAllocator.h>
-#include <ui/GraphicLog.h>
 #include <ui/PixelFormat.h>
 
 #include <pixelflinger/pixelflinger.h>
@@ -60,15 +59,9 @@
 #include "DisplayHardware/DisplayHardware.h"
 #include "DisplayHardware/HWComposer.h"
 
+#include <private/android_filesystem_config.h>
 #include <private/surfaceflinger/SharedBufferStack.h>
 
-/* ideally AID_GRAPHICS would be in a semi-public header
- * or there would be a way to map a user/group name to its id
- */
-#ifndef AID_GRAPHICS
-#define AID_GRAPHICS 1003
-#endif
-
 #define EGL_VERSION_HW_ANDROID  0x3143
 
 #define DISPLAY_COUNT       1
@@ -132,11 +125,34 @@
     ALOGI_IF(mDebugDDMS,         "DDMS debugging enabled");
 }
 
+void SurfaceFlinger::onFirstRef()
+{
+    mEventQueue.init(this);
+
+    run("SurfaceFlinger", PRIORITY_URGENT_DISPLAY);
+
+    // Wait for the main thread to be done with its initialization
+    mReadyToRunBarrier.wait();
+}
+
+
 SurfaceFlinger::~SurfaceFlinger()
 {
     glDeleteTextures(1, &mWormholeTexName);
 }
 
+void SurfaceFlinger::binderDied(const wp<IBinder>& who)
+{
+    // the window manager died on us. prepare its eulogy.
+
+    // reset screen orientation
+    Vector<ComposerState> state;
+    setTransactionState(state, eOrientationDefault, 0);
+
+    // restart the boot-animation
+    property_set("ctl.start", "bootanim");
+}
+
 sp<IMemoryHeap> SurfaceFlinger::getCblk() const
 {
     return mServerHeap;
@@ -190,25 +206,6 @@
     property_set("ctl.stop", "bootanim");
 }
 
-void SurfaceFlinger::binderDied(const wp<IBinder>& who)
-{
-    // the window manager died on us. prepare its eulogy.
-
-    // reset screen orientation
-    setOrientation(0, eOrientationDefault, 0);
-
-    // restart the boot-animation
-    property_set("ctl.start", "bootanim");
-}
-
-void SurfaceFlinger::onFirstRef()
-{
-    run("SurfaceFlinger", PRIORITY_URGENT_DISPLAY);
-
-    // Wait for the main thread to be done with its initialization
-    mReadyToRunBarrier.wait();
-}
-
 static inline uint16_t pack565(int r, int g, int b) {
     return (r<<11)|(g<<5)|b;
 }
@@ -302,6 +299,8 @@
 
     // start the EventThread
     mEventThread = new EventThread(this);
+    mEventQueue.setEventThread(mEventThread);
+    hw.startSleepManagement();
 
     /*
      *  We're now ready to accept clients...
@@ -316,34 +315,6 @@
 }
 
 // ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark Events Handler
-#endif
-
-void SurfaceFlinger::waitForEvent() {
-    mEventQueue.waitMessage();
-}
-
-void SurfaceFlinger::signalEvent() {
-    mEventQueue.invalidate();
-}
-
-status_t SurfaceFlinger::postMessageAsync(const sp<MessageBase>& msg,
-        nsecs_t reltime, uint32_t flags) {
-    return mEventQueue.postMessage(msg, reltime);
-}
-
-status_t SurfaceFlinger::postMessageSync(const sp<MessageBase>& msg,
-        nsecs_t reltime, uint32_t flags) {
-    status_t res = mEventQueue.postMessage(msg, reltime);
-    if (res == NO_ERROR) {
-        msg->wait();
-    }
-    return res;
-}
-
-// ----------------------------------------------------------------------------
 
 bool SurfaceFlinger::authenticateSurfaceTexture(
         const sp<ISurfaceTexture>& surfaceTexture) const {
@@ -389,80 +360,118 @@
 // ----------------------------------------------------------------------------
 
 sp<IDisplayEventConnection> SurfaceFlinger::createDisplayEventConnection() {
-    sp<DisplayEventConnection> result(new DisplayEventConnection(mEventThread));
-    return result;
+    return mEventThread->createEventConnection();
 }
 
 // ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark Main loop
-#endif
+
+void SurfaceFlinger::waitForEvent() {
+    mEventQueue.waitMessage();
+}
+
+void SurfaceFlinger::signalTransaction() {
+    mEventQueue.invalidate();
+}
+
+void SurfaceFlinger::signalLayerUpdate() {
+    mEventQueue.invalidate();
+}
+
+void SurfaceFlinger::signalRefresh() {
+    mEventQueue.refresh();
+}
+
+status_t SurfaceFlinger::postMessageAsync(const sp<MessageBase>& msg,
+        nsecs_t reltime, uint32_t flags) {
+    return mEventQueue.postMessage(msg, reltime);
+}
+
+status_t SurfaceFlinger::postMessageSync(const sp<MessageBase>& msg,
+        nsecs_t reltime, uint32_t flags) {
+    status_t res = mEventQueue.postMessage(msg, reltime);
+    if (res == NO_ERROR) {
+        msg->wait();
+    }
+    return res;
+}
 
 bool SurfaceFlinger::threadLoop()
 {
     waitForEvent();
-
-    // check for transactions
-    if (CC_UNLIKELY(mConsoleSignals)) {
-        handleConsoleEvents();
-    }
-
-    // if we're in a global transaction, don't do anything.
-    const uint32_t mask = eTransactionNeeded | eTraversalNeeded;
-    uint32_t transactionFlags = peekTransactionFlags(mask);
-    if (CC_UNLIKELY(transactionFlags)) {
-        handleTransaction(transactionFlags);
-    }
-
-    // post surfaces (if needed)
-    handlePageFlip();
-
-    if (mDirtyRegion.isEmpty()) {
-        // nothing new to do.
-        return true;
-    }
-
-    if (CC_UNLIKELY(mHwWorkListDirty)) {
-        // build the h/w work list
-        handleWorkList();
-    }
-
-    const DisplayHardware& hw(graphicPlane(0).displayHardware());
-    if (CC_LIKELY(hw.canDraw())) {
-        // repaint the framebuffer (if needed)
-
-        const int index = hw.getCurrentBufferIndex();
-        GraphicLog& logger(GraphicLog::getInstance());
-
-        logger.log(GraphicLog::SF_REPAINT, index);
-        handleRepaint();
-
-        // inform the h/w that we're done compositing
-        logger.log(GraphicLog::SF_COMPOSITION_COMPLETE, index);
-        hw.compositionComplete();
-
-        logger.log(GraphicLog::SF_SWAP_BUFFERS, index);
-        postFramebuffer();
-
-        logger.log(GraphicLog::SF_REPAINT_DONE, index);
-    } else {
-        // pretend we did the post
-        hw.compositionComplete();
-        hw.waitForVSync();
-    }
     return true;
 }
 
+void SurfaceFlinger::onMessageReceived(int32_t what)
+{
+    switch (what) {
+        case MessageQueue::REFRESH: {
+//        case MessageQueue::INVALIDATE: {
+            // check for transactions
+            if (CC_UNLIKELY(mConsoleSignals)) {
+                handleConsoleEvents();
+            }
+
+            // if we're in a global transaction, don't do anything.
+            const uint32_t mask = eTransactionNeeded | eTraversalNeeded;
+            uint32_t transactionFlags = peekTransactionFlags(mask);
+            if (CC_UNLIKELY(transactionFlags)) {
+                handleTransaction(transactionFlags);
+            }
+
+            // post surfaces (if needed)
+            handlePageFlip();
+
+//            signalRefresh();
+//
+//        } break;
+//
+//        case MessageQueue::REFRESH: {
+
+            handleRefresh();
+
+            const DisplayHardware& hw(graphicPlane(0).displayHardware());
+
+//            if (mDirtyRegion.isEmpty()) {
+//                return;
+//            }
+
+            if (CC_UNLIKELY(mHwWorkListDirty)) {
+                // build the h/w work list
+                handleWorkList();
+            }
+
+            if (CC_LIKELY(hw.canDraw())) {
+                // repaint the framebuffer (if needed)
+                handleRepaint();
+                // inform the h/w that we're done compositing
+                hw.compositionComplete();
+                postFramebuffer();
+            } else {
+                // pretend we did the post
+                hw.compositionComplete();
+            }
+
+        } break;
+    }
+}
+
 void SurfaceFlinger::postFramebuffer()
 {
-    // this should never happen. we do the flip anyways so we don't
-    // risk to cause a deadlock with hwc
-    ALOGW_IF(mSwapRegion.isEmpty(), "mSwapRegion is empty");
+    // mSwapRegion can be empty here is some cases, for instance if a hidden
+    // or fully transparent window is updating.
+    // in that case, we need to flip anyways to not risk a deadlock with
+    // h/w composer.
+
     const DisplayHardware& hw(graphicPlane(0).displayHardware());
     const nsecs_t now = systemTime();
     mDebugInSwapBuffers = now;
     hw.flip(mSwapRegion);
+
+    size_t numLayers = mVisibleLayersSortedByZ.size();
+    for (size_t i = 0; i < numLayers; i++) {
+        mVisibleLayersSortedByZ[i]->onLayerDisplayed();
+    }
+
     mLastSwapBufferTime = systemTime() - now;
     mDebugInSwapBuffers = 0;
     mSwapRegion.clear();
@@ -729,13 +738,13 @@
 
 void SurfaceFlinger::handlePageFlip()
 {
-    bool visibleRegions = mVisibleRegionsDirty;
-    const LayerVector& currentLayers(mDrawingState.layersSortedByZ);
-    visibleRegions |= lockPageFlip(currentLayers);
+    const DisplayHardware& hw = graphicPlane(0).displayHardware();
+    const Region screenRegion(hw.bounds());
 
-        const DisplayHardware& hw = graphicPlane(0).displayHardware();
-        const Region screenRegion(hw.bounds());
-        if (visibleRegions) {
+    const LayerVector& currentLayers(mDrawingState.layersSortedByZ);
+    const bool visibleRegions = lockPageFlip(currentLayers);
+
+        if (visibleRegions || mVisibleRegionsDirty) {
             Region opaqueRegion;
             computeVisibleRegions(currentLayers, mDirtyRegion, opaqueRegion);
 
@@ -782,7 +791,7 @@
 {
     const GraphicPlane& plane(graphicPlane(0));
     const Transform& planeTransform(plane.transform());
-    size_t count = currentLayers.size();
+    const size_t count = currentLayers.size();
     sp<LayerBase> const* layers = currentLayers.array();
     for (size_t i=0 ; i<count ; i++) {
         const sp<LayerBase>& layer(layers[i]);
@@ -790,6 +799,23 @@
     }
 }
 
+void SurfaceFlinger::handleRefresh()
+{
+    bool needInvalidate = false;
+    const LayerVector& currentLayers(mDrawingState.layersSortedByZ);
+    const size_t count = currentLayers.size();
+    for (size_t i=0 ; i<count ; i++) {
+        const sp<LayerBase>& layer(currentLayers[i]);
+        if (layer->onPreComposition()) {
+            needInvalidate = true;
+        }
+    }
+    if (needInvalidate) {
+        signalLayerUpdate();
+    }
+}
+
+
 void SurfaceFlinger::handleWorkList()
 {
     mHwWorkListDirty = false;
@@ -1097,23 +1123,6 @@
     }
 }
 
-void SurfaceFlinger::debugShowFPS() const
-{
-    static int mFrameCount;
-    static int mLastFrameCount = 0;
-    static nsecs_t mLastFpsTime = 0;
-    static float mFps = 0;
-    mFrameCount++;
-    nsecs_t now = systemTime();
-    nsecs_t diff = now - mLastFpsTime;
-    if (diff > ms2ns(250)) {
-        mFps =  ((mFrameCount - mLastFrameCount) * float(s2ns(1))) / diff;
-        mLastFpsTime = now;
-        mLastFrameCount = mFrameCount;
-    }
-    // XXX: mFPS has the value we want
- }
-
 status_t SurfaceFlinger::addLayer(const sp<LayerBase>& layer)
 {
     Mutex::Autolock _l(mStateLock);
@@ -1204,7 +1213,7 @@
 {
     uint32_t old = android_atomic_or(flags, &mTransactionFlags);
     if ((old & flags)==0) { // wake the server up
-        signalEvent();
+        signalTransaction();
     }
     return old;
 }
@@ -1254,26 +1263,6 @@
     }
 }
 
-int SurfaceFlinger::setOrientation(DisplayID dpy,
-        int orientation, uint32_t flags)
-{
-    if (CC_UNLIKELY(uint32_t(dpy) >= DISPLAY_COUNT))
-        return BAD_VALUE;
-
-    Mutex::Autolock _l(mStateLock);
-    if (mCurrentState.orientation != orientation) {
-        if (uint32_t(orientation)<=eOrientation270 || orientation==42) {
-            mCurrentState.orientationFlags = flags;
-            mCurrentState.orientation = orientation;
-            setTransactionFlags(eTransactionNeeded);
-            mTransactionCV.wait(mStateLock);
-        } else {
-            orientation = BAD_VALUE;
-        }
-    }
-    return orientation;
-}
-
 sp<ISurface> SurfaceFlinger::createSurface(
         ISurfaceComposerClient::surface_data_t* params,
         const String8& name,
@@ -1475,14 +1464,14 @@
 {
     // this may be called by a signal handler, we can't do too much in here
     android_atomic_or(eConsoleReleased, &mConsoleSignals);
-    signalEvent();
+    signalTransaction();
 }
 
 void SurfaceFlinger::screenAcquired(int dpy)
 {
     // this may be called by a signal handler, we can't do too much in here
     android_atomic_or(eConsoleAcquired, &mConsoleSignals);
-    signalEvent();
+    signalTransaction();
 }
 
 status_t SurfaceFlinger::dump(int fd, const Vector<String16>& args)
@@ -1498,14 +1487,6 @@
                 IPCThreadState::self()->getCallingUid());
         result.append(buffer);
     } else {
-
-        // figure out if we're stuck somewhere
-        const nsecs_t now = systemTime();
-        const nsecs_t inSwapBuffers(mDebugInSwapBuffers);
-        const nsecs_t inTransaction(mDebugInTransaction);
-        nsecs_t inSwapBuffersDuration = (inSwapBuffers) ? now-inSwapBuffers : 0;
-        nsecs_t inTransactionDuration = (inTransaction) ? now-inTransaction : 0;
-
         // Try to get the main lock, but don't insist if we can't
         // (this would indicate SF is stuck, but we want to be able to
         // print something in dumpsys).
@@ -1521,111 +1502,35 @@
             result.append(buffer);
         }
 
-        /*
-         * Dump the visible layer list
-         */
-        const LayerVector& currentLayers = mCurrentState.layersSortedByZ;
-        const size_t count = currentLayers.size();
-        snprintf(buffer, SIZE, "Visible layers (count = %d)\n", count);
-        result.append(buffer);
-        for (size_t i=0 ; i<count ; i++) {
-            const sp<LayerBase>& layer(currentLayers[i]);
-            layer->dump(result, buffer, SIZE);
-            const Layer::State& s(layer->drawingState());
-            s.transparentRegion.dump(result, "transparentRegion");
-            layer->transparentRegionScreen.dump(result, "transparentRegionScreen");
-            layer->visibleRegionScreen.dump(result, "visibleRegionScreen");
+        bool dumpAll = true;
+        size_t index = 0;
+        size_t numArgs = args.size();
+        if (numArgs) {
+            dumpAll = false;
+
+            if ((index < numArgs) &&
+                    (args[index] == String16("--list"))) {
+                index++;
+                listLayersLocked(args, index, result, buffer, SIZE);
+            }
+
+            if ((index < numArgs) &&
+                    (args[index] == String16("--latency"))) {
+                index++;
+                dumpStatsLocked(args, index, result, buffer, SIZE);
+            }
+
+            if ((index < numArgs) &&
+                    (args[index] == String16("--latency-clear"))) {
+                index++;
+                clearStatsLocked(args, index, result, buffer, SIZE);
+            }
         }
 
-        /*
-         * Dump the layers in the purgatory
-         */
-
-        const size_t purgatorySize = mLayerPurgatory.size();
-        snprintf(buffer, SIZE, "Purgatory state (%d entries)\n", purgatorySize);
-        result.append(buffer);
-        for (size_t i=0 ; i<purgatorySize ; i++) {
-            const sp<LayerBase>& layer(mLayerPurgatory.itemAt(i));
-            layer->shortDump(result, buffer, SIZE);
+        if (dumpAll) {
+            dumpAllLocked(result, buffer, SIZE);
         }
 
-        /*
-         * Dump SurfaceFlinger global state
-         */
-
-        snprintf(buffer, SIZE, "SurfaceFlinger global state:\n");
-        result.append(buffer);
-
-        const GLExtensions& extensions(GLExtensions::getInstance());
-        snprintf(buffer, SIZE, "GLES: %s, %s, %s\n",
-                extensions.getVendor(),
-                extensions.getRenderer(),
-                extensions.getVersion());
-        result.append(buffer);
-
-        snprintf(buffer, SIZE, "EGL : %s\n",
-                eglQueryString(graphicPlane(0).getEGLDisplay(),
-                        EGL_VERSION_HW_ANDROID));
-        result.append(buffer);
-
-        snprintf(buffer, SIZE, "EXTS: %s\n", extensions.getExtension());
-        result.append(buffer);
-
-        mWormholeRegion.dump(result, "WormholeRegion");
-        const DisplayHardware& hw(graphicPlane(0).displayHardware());
-        snprintf(buffer, SIZE,
-                "  orientation=%d, canDraw=%d\n",
-                mCurrentState.orientation, hw.canDraw());
-        result.append(buffer);
-        snprintf(buffer, SIZE,
-                "  last eglSwapBuffers() time: %f us\n"
-                "  last transaction time     : %f us\n"
-                "  refresh-rate              : %f fps\n"
-                "  x-dpi                     : %f\n"
-                "  y-dpi                     : %f\n",
-                mLastSwapBufferTime/1000.0,
-                mLastTransactionTime/1000.0,
-                hw.getRefreshRate(),
-                hw.getDpiX(),
-                hw.getDpiY());
-        result.append(buffer);
-
-        if (inSwapBuffersDuration || !locked) {
-            snprintf(buffer, SIZE, "  eglSwapBuffers time: %f us\n",
-                    inSwapBuffersDuration/1000.0);
-            result.append(buffer);
-        }
-
-        if (inTransactionDuration || !locked) {
-            snprintf(buffer, SIZE, "  transaction time: %f us\n",
-                    inTransactionDuration/1000.0);
-            result.append(buffer);
-        }
-
-        /*
-         * VSYNC state
-         */
-        mEventThread->dump(result, buffer, SIZE);
-
-        /*
-         * Dump HWComposer state
-         */
-        HWComposer& hwc(hw.getHwComposer());
-        snprintf(buffer, SIZE, "h/w composer state:\n");
-        result.append(buffer);
-        snprintf(buffer, SIZE, "  h/w composer %s and %s\n",
-                hwc.initCheck()==NO_ERROR ? "present" : "not present",
-                (mDebugDisableHWC || mDebugRegion) ? "disabled" : "enabled");
-        result.append(buffer);
-        hwc.dump(result, buffer, SIZE, mVisibleLayersSortedByZ);
-
-        /*
-         * Dump gralloc state
-         */
-        const GraphicBufferAllocator& alloc(GraphicBufferAllocator::get());
-        alloc.dump(result);
-        hw.dump(result);
-
         if (locked) {
             mStateLock.unlock();
         }
@@ -1634,6 +1539,170 @@
     return NO_ERROR;
 }
 
+void SurfaceFlinger::listLayersLocked(const Vector<String16>& args, size_t& index,
+        String8& result, char* buffer, size_t SIZE) const
+{
+    const LayerVector& currentLayers = mCurrentState.layersSortedByZ;
+    const size_t count = currentLayers.size();
+    for (size_t i=0 ; i<count ; i++) {
+        const sp<LayerBase>& layer(currentLayers[i]);
+        snprintf(buffer, SIZE, "%s\n", layer->getName().string());
+        result.append(buffer);
+    }
+}
+
+void SurfaceFlinger::dumpStatsLocked(const Vector<String16>& args, size_t& index,
+        String8& result, char* buffer, size_t SIZE) const
+{
+    String8 name;
+    if (index < args.size()) {
+        name = String8(args[index]);
+        index++;
+    }
+
+    const LayerVector& currentLayers = mCurrentState.layersSortedByZ;
+    const size_t count = currentLayers.size();
+    for (size_t i=0 ; i<count ; i++) {
+        const sp<LayerBase>& layer(currentLayers[i]);
+        if (name.isEmpty()) {
+            snprintf(buffer, SIZE, "%s\n", layer->getName().string());
+            result.append(buffer);
+        }
+        if (name.isEmpty() || (name == layer->getName())) {
+            layer->dumpStats(result, buffer, SIZE);
+        }
+    }
+}
+
+void SurfaceFlinger::clearStatsLocked(const Vector<String16>& args, size_t& index,
+        String8& result, char* buffer, size_t SIZE) const
+{
+    String8 name;
+    if (index < args.size()) {
+        name = String8(args[index]);
+        index++;
+    }
+
+    const LayerVector& currentLayers = mCurrentState.layersSortedByZ;
+    const size_t count = currentLayers.size();
+    for (size_t i=0 ; i<count ; i++) {
+        const sp<LayerBase>& layer(currentLayers[i]);
+        if (name.isEmpty() || (name == layer->getName())) {
+            layer->clearStats();
+        }
+    }
+}
+
+void SurfaceFlinger::dumpAllLocked(
+        String8& result, char* buffer, size_t SIZE) const
+{
+    // figure out if we're stuck somewhere
+    const nsecs_t now = systemTime();
+    const nsecs_t inSwapBuffers(mDebugInSwapBuffers);
+    const nsecs_t inTransaction(mDebugInTransaction);
+    nsecs_t inSwapBuffersDuration = (inSwapBuffers) ? now-inSwapBuffers : 0;
+    nsecs_t inTransactionDuration = (inTransaction) ? now-inTransaction : 0;
+
+    /*
+     * Dump the visible layer list
+     */
+    const LayerVector& currentLayers = mCurrentState.layersSortedByZ;
+    const size_t count = currentLayers.size();
+    snprintf(buffer, SIZE, "Visible layers (count = %d)\n", count);
+    result.append(buffer);
+    for (size_t i=0 ; i<count ; i++) {
+        const sp<LayerBase>& layer(currentLayers[i]);
+        layer->dump(result, buffer, SIZE);
+    }
+
+    /*
+     * Dump the layers in the purgatory
+     */
+
+    const size_t purgatorySize = mLayerPurgatory.size();
+    snprintf(buffer, SIZE, "Purgatory state (%d entries)\n", purgatorySize);
+    result.append(buffer);
+    for (size_t i=0 ; i<purgatorySize ; i++) {
+        const sp<LayerBase>& layer(mLayerPurgatory.itemAt(i));
+        layer->shortDump(result, buffer, SIZE);
+    }
+
+    /*
+     * Dump SurfaceFlinger global state
+     */
+
+    snprintf(buffer, SIZE, "SurfaceFlinger global state:\n");
+    result.append(buffer);
+
+    const GLExtensions& extensions(GLExtensions::getInstance());
+    snprintf(buffer, SIZE, "GLES: %s, %s, %s\n",
+            extensions.getVendor(),
+            extensions.getRenderer(),
+            extensions.getVersion());
+    result.append(buffer);
+
+    snprintf(buffer, SIZE, "EGL : %s\n",
+            eglQueryString(graphicPlane(0).getEGLDisplay(),
+                    EGL_VERSION_HW_ANDROID));
+    result.append(buffer);
+
+    snprintf(buffer, SIZE, "EXTS: %s\n", extensions.getExtension());
+    result.append(buffer);
+
+    mWormholeRegion.dump(result, "WormholeRegion");
+    const DisplayHardware& hw(graphicPlane(0).displayHardware());
+    snprintf(buffer, SIZE,
+            "  orientation=%d, canDraw=%d\n",
+            mCurrentState.orientation, hw.canDraw());
+    result.append(buffer);
+    snprintf(buffer, SIZE,
+            "  last eglSwapBuffers() time: %f us\n"
+            "  last transaction time     : %f us\n"
+            "  transaction-flags         : %08x\n"
+            "  refresh-rate              : %f fps\n"
+            "  x-dpi                     : %f\n"
+            "  y-dpi                     : %f\n",
+            mLastSwapBufferTime/1000.0,
+            mLastTransactionTime/1000.0,
+            mTransactionFlags,
+            hw.getRefreshRate(),
+            hw.getDpiX(),
+            hw.getDpiY());
+    result.append(buffer);
+
+    snprintf(buffer, SIZE, "  eglSwapBuffers time: %f us\n",
+            inSwapBuffersDuration/1000.0);
+    result.append(buffer);
+
+    snprintf(buffer, SIZE, "  transaction time: %f us\n",
+            inTransactionDuration/1000.0);
+    result.append(buffer);
+
+    /*
+     * VSYNC state
+     */
+    mEventThread->dump(result, buffer, SIZE);
+
+    /*
+     * Dump HWComposer state
+     */
+    HWComposer& hwc(hw.getHwComposer());
+    snprintf(buffer, SIZE, "h/w composer state:\n");
+    result.append(buffer);
+    snprintf(buffer, SIZE, "  h/w composer %s and %s\n",
+            hwc.initCheck()==NO_ERROR ? "present" : "not present",
+                    (mDebugDisableHWC || mDebugRegion) ? "disabled" : "enabled");
+    result.append(buffer);
+    hwc.dump(result, buffer, SIZE, mVisibleLayersSortedByZ);
+
+    /*
+     * Dump gralloc state
+     */
+    const GraphicBufferAllocator& alloc(GraphicBufferAllocator::get());
+    alloc.dump(result);
+    hw.dump(result);
+}
+
 status_t SurfaceFlinger::onTransact(
     uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
 {
@@ -1707,11 +1776,6 @@
                 setTransactionFlags(eTransactionNeeded|eTraversalNeeded);
                 return NO_ERROR;
             }
-            case 1006:{ // enable/disable GraphicLog
-                int enabled = data.readInt32();
-                GraphicLog::getInstance().setEnabled(enabled);
-                return NO_ERROR;
-            }
             case 1008:  // toggle use of hw composer
                 n = data.readInt32();
                 mDebugDisableHWC = n ? 1 : 0;
@@ -1729,6 +1793,7 @@
                 reply->writeInt32(0);
                 reply->writeInt32(mDebugRegion);
                 reply->writeInt32(mDebugBackground);
+                reply->writeInt32(mDebugDisableHWC);
                 return NO_ERROR;
             case 1013: {
                 Mutex::Autolock _l(mStateLock);
@@ -1745,7 +1810,7 @@
     const DisplayHardware& hw(graphicPlane(0).displayHardware());
     const Rect bounds(hw.getBounds());
     setInvalidateRegion(Region(bounds));
-    signalEvent();
+    signalTransaction();
 }
 
 void SurfaceFlinger::setInvalidateRegion(const Region& reg) {
@@ -2221,7 +2286,7 @@
 
     // make sure to redraw the whole screen when the animation is done
     mDirtyRegion.set(hw.bounds());
-    signalEvent();
+    signalTransaction();
 
     return NO_ERROR;
 }
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index ffd3ac9..fcd9361 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -170,7 +170,6 @@
     virtual void                        bootFinished();
     virtual void                        setTransactionState(const Vector<ComposerState>& state,
                                                             int orientation, uint32_t flags);
-    virtual int                         setOrientation(DisplayID dpy, int orientation, uint32_t flags);
     virtual bool                        authenticateSurfaceTexture(const sp<ISurfaceTexture>& surface) const;
     virtual sp<IDisplayEventConnection> createDisplayEventConnection();
 
@@ -191,6 +190,8 @@
             status_t renderScreenToTextureLocked(DisplayID dpy,
                     GLuint* textureName, GLfloat* uOut, GLfloat* vOut);
 
+            void onMessageReceived(int32_t what);
+
             status_t postMessageAsync(const sp<MessageBase>& msg,
                     nsecs_t reltime=0, uint32_t flags = 0);
 
@@ -284,7 +285,10 @@
 public:     // hack to work around gcc 4.0.3 bug
     const GraphicPlane&     graphicPlane(int dpy) const;
           GraphicPlane&     graphicPlane(int dpy);
-          void              signalEvent();
+
+          void              signalTransaction();
+          void              signalLayerUpdate();
+          void              signalRefresh();
           void              repaintEverything();
 
 private:
@@ -301,6 +305,7 @@
             void        handlePageFlip();
             bool        lockPageFlip(const LayerVector& currentLayers);
             void        unlockPageFlip(const LayerVector& currentLayers);
+            void        handleRefresh();
             void        handleWorkList();
             void        handleRepaint();
             void        postFramebuffer();
@@ -335,9 +340,15 @@
             status_t electronBeamOnAnimationImplLocked();
 
             void        debugFlashRegions();
-            void        debugShowFPS() const;
             void        drawWormhole() const;
            
+            void listLayersLocked(const Vector<String16>& args, size_t& index,
+                    String8& result, char* buffer, size_t SIZE) const;
+            void dumpStatsLocked(const Vector<String16>& args, size_t& index,
+                    String8& result, char* buffer, size_t SIZE) const;
+            void clearStatsLocked(const Vector<String16>& args, size_t& index,
+                    String8& result, char* buffer, size_t SIZE) const;
+            void dumpAllLocked(String8& result, char* buffer, size_t SIZE) const;
 
     mutable     MessageQueue    mEventQueue;
 
diff --git a/services/surfaceflinger/SurfaceTextureLayer.cpp b/services/surfaceflinger/SurfaceTextureLayer.cpp
index 259b937..49e8e63 100644
--- a/services/surfaceflinger/SurfaceTextureLayer.cpp
+++ b/services/surfaceflinger/SurfaceTextureLayer.cpp
@@ -94,6 +94,10 @@
             *outTransform = orientation;
         }
         switch(api) {
+            case NATIVE_WINDOW_API_CPU:
+                // SurfaceTextureClient supports only 2 buffers for CPU connections
+                this->setBufferCountServer(2);
+                break;
             case NATIVE_WINDOW_API_MEDIA:
             case NATIVE_WINDOW_API_CAMERA:
                 // Camera preview and videos are rate-limited on the producer
diff --git a/services/surfaceflinger/tests/vsync/vsync.cpp b/services/surfaceflinger/tests/vsync/vsync.cpp
index 4f79080..b0d54c4 100644
--- a/services/surfaceflinger/tests/vsync/vsync.cpp
+++ b/services/surfaceflinger/tests/vsync/vsync.cpp
@@ -55,6 +55,8 @@
     loop->addFd(myDisplayEvent.getFd(), 0, ALOOPER_EVENT_INPUT, receiver,
             &myDisplayEvent);
 
+    myDisplayEvent.setVsyncRate(1);
+
     do {
         //printf("about to poll...\n");
         int32_t ret = loop->pollOnce(-1);
diff --git a/services/tests/servicestests/res/raw/netstats_uid_v4 b/services/tests/servicestests/res/raw/netstats_uid_v4
new file mode 100644
index 0000000..e75fc1c
--- /dev/null
+++ b/services/tests/servicestests/res/raw/netstats_uid_v4
Binary files differ
diff --git a/services/tests/servicestests/res/raw/netstats_v1 b/services/tests/servicestests/res/raw/netstats_v1
new file mode 100644
index 0000000..e80860a
--- /dev/null
+++ b/services/tests/servicestests/res/raw/netstats_v1
Binary files differ
diff --git a/services/tests/servicestests/src/com/android/server/NetworkPolicyManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/NetworkPolicyManagerServiceTest.java
index 36a2567..e863f8b 100644
--- a/services/tests/servicestests/src/com/android/server/NetworkPolicyManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/NetworkPolicyManagerServiceTest.java
@@ -21,7 +21,6 @@
 import static android.net.ConnectivityManager.CONNECTIVITY_ACTION_IMMEDIATE;
 import static android.net.ConnectivityManager.TYPE_WIFI;
 import static android.net.NetworkPolicy.LIMIT_DISABLED;
-import static android.net.NetworkPolicy.SNOOZE_NEVER;
 import static android.net.NetworkPolicy.WARNING_DISABLED;
 import static android.net.NetworkPolicyManager.POLICY_NONE;
 import static android.net.NetworkPolicyManager.POLICY_REJECT_METERED_BACKGROUND;
@@ -29,6 +28,8 @@
 import static android.net.NetworkPolicyManager.RULE_REJECT_METERED;
 import static android.net.NetworkPolicyManager.computeLastCycleBoundary;
 import static android.net.NetworkPolicyManager.computeNextCycleBoundary;
+import static android.net.TrafficStats.KB_IN_BYTES;
+import static android.net.TrafficStats.MB_IN_BYTES;
 import static android.text.format.DateUtils.DAY_IN_MILLIS;
 import static android.text.format.DateUtils.MINUTE_IN_MILLIS;
 import static com.android.server.net.NetworkPolicyManagerService.TYPE_LIMIT;
@@ -101,10 +102,6 @@
     private static final long TEST_START = 1194220800000L;
     private static final String TEST_IFACE = "test0";
 
-    private static final long KB_IN_BYTES = 1024;
-    private static final long MB_IN_BYTES = KB_IN_BYTES * 1024;
-    private static final long GB_IN_BYTES = MB_IN_BYTES * 1024;
-
     private static NetworkTemplate sTemplateWifi = NetworkTemplate.buildTemplateWifi();
 
     private BroadcastInterceptingContext mServiceContext;
@@ -256,41 +253,49 @@
     }
 
     public void testPidForegroundCombined() throws Exception {
+        IdleFuture idle;
+
         // push all uid into background
+        idle = expectIdle();
         mProcessObserver.onForegroundActivitiesChanged(PID_1, UID_A, false);
         mProcessObserver.onForegroundActivitiesChanged(PID_2, UID_A, false);
         mProcessObserver.onForegroundActivitiesChanged(PID_3, UID_B, false);
-        waitUntilIdle();
+        idle.get();
         assertFalse(mService.isUidForeground(UID_A));
         assertFalse(mService.isUidForeground(UID_B));
 
         // push one of the shared pids into foreground
+        idle = expectIdle();
         mProcessObserver.onForegroundActivitiesChanged(PID_2, UID_A, true);
-        waitUntilIdle();
+        idle.get();
         assertTrue(mService.isUidForeground(UID_A));
         assertFalse(mService.isUidForeground(UID_B));
 
         // and swap another uid into foreground
+        idle = expectIdle();
         mProcessObserver.onForegroundActivitiesChanged(PID_2, UID_A, false);
         mProcessObserver.onForegroundActivitiesChanged(PID_3, UID_B, true);
-        waitUntilIdle();
+        idle.get();
         assertFalse(mService.isUidForeground(UID_A));
         assertTrue(mService.isUidForeground(UID_B));
 
         // push both pid into foreground
+        idle = expectIdle();
         mProcessObserver.onForegroundActivitiesChanged(PID_1, UID_A, true);
         mProcessObserver.onForegroundActivitiesChanged(PID_2, UID_A, true);
-        waitUntilIdle();
+        idle.get();
         assertTrue(mService.isUidForeground(UID_A));
 
         // pull one out, should still be foreground
+        idle = expectIdle();
         mProcessObserver.onForegroundActivitiesChanged(PID_1, UID_A, false);
-        waitUntilIdle();
+        idle.get();
         assertTrue(mService.isUidForeground(UID_A));
 
         // pull final pid out, should now be background
+        idle = expectIdle();
         mProcessObserver.onForegroundActivitiesChanged(PID_2, UID_A, false);
-        waitUntilIdle();
+        idle.get();
         assertFalse(mService.isUidForeground(UID_A));
     }
 
@@ -434,7 +439,7 @@
         final long expectedCycle = parseTime("2007-11-05T00:00:00.000Z");
 
         final NetworkPolicy policy = new NetworkPolicy(
-                sTemplateWifi, 5, 1024L, 1024L, SNOOZE_NEVER, false);
+                sTemplateWifi, 5, 1024L, 1024L, false);
         final long actualCycle = computeLastCycleBoundary(currentTime, policy);
         assertTimeEquals(expectedCycle, actualCycle);
     }
@@ -445,7 +450,7 @@
         final long expectedCycle = parseTime("2007-10-20T00:00:00.000Z");
 
         final NetworkPolicy policy = new NetworkPolicy(
-                sTemplateWifi, 20, 1024L, 1024L, SNOOZE_NEVER, false);
+                sTemplateWifi, 20, 1024L, 1024L, false);
         final long actualCycle = computeLastCycleBoundary(currentTime, policy);
         assertTimeEquals(expectedCycle, actualCycle);
     }
@@ -456,7 +461,7 @@
         final long expectedCycle = parseTime("2007-01-30T00:00:00.000Z");
 
         final NetworkPolicy policy = new NetworkPolicy(
-                sTemplateWifi, 30, 1024L, 1024L, SNOOZE_NEVER, false);
+                sTemplateWifi, 30, 1024L, 1024L, false);
         final long actualCycle = computeLastCycleBoundary(currentTime, policy);
         assertTimeEquals(expectedCycle, actualCycle);
     }
@@ -467,14 +472,14 @@
         final long expectedCycle = parseTime("2007-02-28T23:59:59.000Z");
 
         final NetworkPolicy policy = new NetworkPolicy(
-                sTemplateWifi, 30, 1024L, 1024L, SNOOZE_NEVER, false);
+                sTemplateWifi, 30, 1024L, 1024L, false);
         final long actualCycle = computeLastCycleBoundary(currentTime, policy);
         assertTimeEquals(expectedCycle, actualCycle);
     }
 
     public void testNextCycleSane() throws Exception {
         final NetworkPolicy policy = new NetworkPolicy(
-                sTemplateWifi, 31, WARNING_DISABLED, LIMIT_DISABLED, SNOOZE_NEVER, false);
+                sTemplateWifi, 31, WARNING_DISABLED, LIMIT_DISABLED, false);
         final LinkedHashSet<Long> seen = new LinkedHashSet<Long>();
 
         // walk forwards, ensuring that cycle boundaries don't get stuck
@@ -489,7 +494,7 @@
 
     public void testLastCycleSane() throws Exception {
         final NetworkPolicy policy = new NetworkPolicy(
-                sTemplateWifi, 31, WARNING_DISABLED, LIMIT_DISABLED, SNOOZE_NEVER, false);
+                sTemplateWifi, 31, WARNING_DISABLED, LIMIT_DISABLED, false);
         final LinkedHashSet<Long> seen = new LinkedHashSet<Long>();
 
         // walk backwards, ensuring that cycle boundaries look sane
@@ -547,7 +552,7 @@
 
         replay();
         setNetworkPolicies(new NetworkPolicy(
-                sTemplateWifi, CYCLE_DAY, 1 * MB_IN_BYTES, 2 * MB_IN_BYTES, SNOOZE_NEVER, false));
+                sTemplateWifi, CYCLE_DAY, 1 * MB_IN_BYTES, 2 * MB_IN_BYTES, false));
         future.get();
         verifyAndReset();
     }
@@ -604,9 +609,8 @@
             future = expectMeteredIfacesChanged();
 
             replay();
-            setNetworkPolicies(
-                    new NetworkPolicy(sTemplateWifi, CYCLE_DAY, 1 * MB_IN_BYTES, 2 * MB_IN_BYTES,
-                            SNOOZE_NEVER, false));
+            setNetworkPolicies(new NetworkPolicy(sTemplateWifi, CYCLE_DAY, 1 * MB_IN_BYTES,
+                    2 * MB_IN_BYTES, false));
             future.get();
             verifyAndReset();
         }
@@ -698,7 +702,7 @@
             tagFuture = expectEnqueueNotification();
 
             replay();
-            mService.snoozePolicy(sTemplateWifi);
+            mService.snoozeLimit(sTemplateWifi);
             assertNotificationType(TYPE_LIMIT_SNOOZED, tagFuture.get());
             future.get();
             verifyAndReset();
@@ -736,9 +740,8 @@
             future = expectMeteredIfacesChanged(TEST_IFACE);
 
             replay();
-            setNetworkPolicies(
-                    new NetworkPolicy(sTemplateWifi, CYCLE_DAY, WARNING_DISABLED, LIMIT_DISABLED,
-                            SNOOZE_NEVER, true));
+            setNetworkPolicies(new NetworkPolicy(sTemplateWifi, CYCLE_DAY, WARNING_DISABLED,
+                    LIMIT_DISABLED, true));
             future.get();
             verifyAndReset();
         }
@@ -890,10 +893,10 @@
     /**
      * Wait until {@link #mService} internal {@link Handler} is idle.
      */
-    private void waitUntilIdle() throws Exception {
+    private IdleFuture expectIdle() {
         final IdleFuture future = new IdleFuture();
         mService.addIdleHandler(future);
-        future.get();
+        return future;
     }
 
     private static void assertTimeEquals(long expected, long actual) {
diff --git a/services/tests/servicestests/src/com/android/server/NetworkStatsServiceTest.java b/services/tests/servicestests/src/com/android/server/NetworkStatsServiceTest.java
index 90b5a2e..daf2018 100644
--- a/services/tests/servicestests/src/com/android/server/NetworkStatsServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/NetworkStatsServiceTest.java
@@ -31,6 +31,7 @@
 import static android.net.NetworkStatsHistory.FIELD_ALL;
 import static android.net.NetworkTemplate.buildTemplateMobileAll;
 import static android.net.NetworkTemplate.buildTemplateWifi;
+import static android.net.TrafficStats.MB_IN_BYTES;
 import static android.net.TrafficStats.UID_REMOVED;
 import static android.net.TrafficStats.UID_TETHERING;
 import static android.text.format.DateUtils.DAY_IN_MILLIS;
@@ -39,6 +40,7 @@
 import static android.text.format.DateUtils.WEEK_IN_MILLIS;
 import static com.android.server.net.NetworkStatsService.ACTION_NETWORK_STATS_POLL;
 import static org.easymock.EasyMock.anyLong;
+import static org.easymock.EasyMock.aryEq;
 import static org.easymock.EasyMock.capture;
 import static org.easymock.EasyMock.createMock;
 import static org.easymock.EasyMock.eq;
@@ -63,10 +65,12 @@
 import android.telephony.TelephonyManager;
 import android.test.AndroidTestCase;
 import android.test.suitebuilder.annotation.LargeTest;
+import android.test.suitebuilder.annotation.Suppress;
 import android.util.TrustedTime;
 
 import com.android.server.net.NetworkStatsService;
 import com.android.server.net.NetworkStatsService.NetworkStatsSettings;
+import com.android.server.net.NetworkStatsService.NetworkStatsSettings.Config;
 
 import org.easymock.Capture;
 import org.easymock.EasyMock;
@@ -282,13 +286,6 @@
         mServiceContext.sendBroadcast(new Intent(Intent.ACTION_SHUTDOWN));
         verifyAndReset();
 
-        // talk with zombie service to assert stats have gone; and assert that
-        // we persisted them to file.
-        expectDefaultSettings();
-        replay();
-        assertNetworkTotal(sTemplateWifi, 0L, 0L, 0L, 0L, 0);
-        verifyAndReset();
-
         assertStatsFilesExist(true);
 
         // boot through serviceReady() again
@@ -319,6 +316,8 @@
 
     }
 
+    // TODO: simulate reboot to test bucket resize
+    @Suppress
     public void testStatsBucketResize() throws Exception {
         NetworkStatsHistory history = null;
 
@@ -602,7 +601,6 @@
         assertUidTotal(sTemplateImsi1, UID_RED, 1536L, 12L, 1280L, 10L, 10);
 
         verifyAndReset();
-
     }
 
     public void testSummaryForAllUid() throws Exception {
@@ -755,11 +753,15 @@
         expectDefaultSettings();
         expectNetworkStatsSummary(new NetworkStats(getElapsedRealtime(), 1)
                 .addIfaceValues(TEST_IFACE, 2048L, 16L, 512L, 4L));
-        expectNetworkStatsUidDetail(new NetworkStats(getElapsedRealtime(), 1)
-                .addValues(TEST_IFACE, UID_RED, SET_DEFAULT, TAG_NONE, 128L, 2L, 128L, 2L, 0L));
+
+        final NetworkStats uidStats = new NetworkStats(getElapsedRealtime(), 1)
+                .addValues(TEST_IFACE, UID_RED, SET_DEFAULT, TAG_NONE, 128L, 2L, 128L, 2L, 0L);
         final String[] tetherIfacePairs = new String[] { TEST_IFACE, "wlan0" };
-        expectNetworkStatsPoll(tetherIfacePairs, new NetworkStats(getElapsedRealtime(), 1)
-                .addValues(TEST_IFACE, UID_TETHERING, SET_DEFAULT, TAG_NONE, 1920L, 14L, 384L, 2L, 0L));
+        final NetworkStats tetherStats = new NetworkStats(getElapsedRealtime(), 1)
+                .addValues(TEST_IFACE, UID_TETHERING, SET_DEFAULT, TAG_NONE, 1920L, 14L, 384L, 2L, 0L);
+
+        expectNetworkStatsUidDetail(uidStats, tetherIfacePairs, tetherStats);
+        expectNetworkStatsPoll();
 
         replay();
         mServiceContext.sendBroadcast(new Intent(ACTION_NETWORK_STATS_POLL));
@@ -808,6 +810,9 @@
 
     private void expectNetworkState(NetworkState... state) throws Exception {
         expect(mConnManager.getAllNetworkState()).andReturn(state).atLeastOnce();
+
+        final LinkProperties linkProp = state.length > 0 ? state[0].linkProperties : null;
+        expect(mConnManager.getActiveLinkProperties()).andReturn(linkProp).atLeastOnce();
     }
 
     private void expectNetworkStatsSummary(NetworkStats summary) throws Exception {
@@ -815,23 +820,35 @@
     }
 
     private void expectNetworkStatsUidDetail(NetworkStats detail) throws Exception {
+        expectNetworkStatsUidDetail(detail, new String[0], new NetworkStats(0L, 0));
+    }
+
+    private void expectNetworkStatsUidDetail(
+            NetworkStats detail, String[] tetherIfacePairs, NetworkStats tetherStats)
+            throws Exception {
         expect(mNetManager.getNetworkStatsUidDetail(eq(UID_ALL))).andReturn(detail).atLeastOnce();
+
+        // also include tethering details, since they are folded into UID
+        expect(mConnManager.getTetheredIfacePairs()).andReturn(tetherIfacePairs).atLeastOnce();
+        expect(mNetManager.getNetworkStatsTethering(aryEq(tetherIfacePairs)))
+                .andReturn(tetherStats).atLeastOnce();
     }
 
     private void expectDefaultSettings() throws Exception {
         expectSettings(0L, HOUR_IN_MILLIS, WEEK_IN_MILLIS);
     }
 
-    private void expectSettings(long persistThreshold, long bucketDuration, long maxHistory)
+    private void expectSettings(long persistBytes, long bucketDuration, long deleteAge)
             throws Exception {
         expect(mSettings.getPollInterval()).andReturn(HOUR_IN_MILLIS).anyTimes();
-        expect(mSettings.getPersistThreshold()).andReturn(persistThreshold).anyTimes();
-        expect(mSettings.getNetworkBucketDuration()).andReturn(bucketDuration).anyTimes();
-        expect(mSettings.getNetworkMaxHistory()).andReturn(maxHistory).anyTimes();
-        expect(mSettings.getUidBucketDuration()).andReturn(bucketDuration).anyTimes();
-        expect(mSettings.getUidMaxHistory()).andReturn(maxHistory).anyTimes();
-        expect(mSettings.getTagMaxHistory()).andReturn(maxHistory).anyTimes();
         expect(mSettings.getTimeCacheMaxAge()).andReturn(DAY_IN_MILLIS).anyTimes();
+        expect(mSettings.getGlobalAlertBytes()).andReturn(MB_IN_BYTES).anyTimes();
+        expect(mSettings.getSampleEnabled()).andReturn(true).anyTimes();
+
+        final Config config = new Config(bucketDuration, persistBytes, deleteAge, deleteAge);
+        expect(mSettings.getDevConfig()).andReturn(config).anyTimes();
+        expect(mSettings.getUidConfig()).andReturn(config).anyTimes();
+        expect(mSettings.getUidTagConfig()).andReturn(config).anyTimes();
     }
 
     private void expectCurrentTime() throws Exception {
@@ -843,27 +860,16 @@
     }
 
     private void expectNetworkStatsPoll() throws Exception {
-        expectNetworkStatsPoll(new String[0], new NetworkStats(getElapsedRealtime(), 0));
-    }
-
-    private void expectNetworkStatsPoll(String[] tetherIfacePairs, NetworkStats tetherStats)
-            throws Exception {
         mNetManager.setGlobalAlert(anyLong());
         expectLastCall().anyTimes();
-        expect(mConnManager.getTetheredIfacePairs()).andReturn(tetherIfacePairs).anyTimes();
-        expect(mNetManager.getNetworkStatsTethering(eq(tetherIfacePairs)))
-                .andReturn(tetherStats).anyTimes();
     }
 
     private void assertStatsFilesExist(boolean exist) {
-        final File networkFile = new File(mStatsDir, "netstats.bin");
-        final File uidFile = new File(mStatsDir, "netstats_uid.bin");
+        final File basePath = new File(mStatsDir, "netstats");
         if (exist) {
-            assertTrue(networkFile.exists());
-            assertTrue(uidFile.exists());
+            assertTrue(basePath.list().length > 0);
         } else {
-            assertFalse(networkFile.exists());
-            assertFalse(uidFile.exists());
+            assertTrue(basePath.list().length == 0);
         }
     }
 
diff --git a/services/tests/servicestests/src/com/android/server/net/NetworkStatsCollectionTest.java b/services/tests/servicestests/src/com/android/server/net/NetworkStatsCollectionTest.java
new file mode 100644
index 0000000..7f05f56
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/net/NetworkStatsCollectionTest.java
@@ -0,0 +1,175 @@
+/*
+ * 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.server.net;
+
+import static android.net.NetworkTemplate.buildTemplateMobileAll;
+import static android.text.format.DateUtils.MINUTE_IN_MILLIS;
+
+import android.content.res.Resources;
+import android.net.ConnectivityManager;
+import android.net.NetworkIdentity;
+import android.net.NetworkStats;
+import android.net.NetworkTemplate;
+import android.test.AndroidTestCase;
+import android.test.suitebuilder.annotation.MediumTest;
+
+import com.android.frameworks.servicestests.R;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import libcore.io.IoUtils;
+import libcore.io.Streams;
+
+/**
+ * Tests for {@link NetworkStatsCollection}.
+ */
+@MediumTest
+public class NetworkStatsCollectionTest extends AndroidTestCase {
+    
+    private static final String TEST_FILE = "test.bin";
+    private static final String TEST_IMSI = "310260000000000";
+
+    public void testReadLegacyNetwork() throws Exception {
+        final File testFile = new File(getContext().getFilesDir(), TEST_FILE);
+        stageFile(R.raw.netstats_v1, testFile);
+
+        final NetworkStatsCollection collection = new NetworkStatsCollection(30 * MINUTE_IN_MILLIS);
+        collection.readLegacyNetwork(testFile);
+        
+        // verify that history read correctly
+        assertSummaryTotal(collection, buildTemplateMobileAll(TEST_IMSI),
+                636014522L, 709291L, 88037144L, 518820L);
+
+        // now export into a unified format
+        final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        collection.write(new DataOutputStream(bos));
+
+        // clear structure completely
+        collection.reset();
+        assertSummaryTotal(collection, buildTemplateMobileAll(TEST_IMSI),
+                0L, 0L, 0L, 0L);
+
+        // and read back into structure, verifying that totals are same
+        collection.read(new ByteArrayInputStream(bos.toByteArray()));
+        assertSummaryTotal(collection, buildTemplateMobileAll(TEST_IMSI),
+                636014522L, 709291L, 88037144L, 518820L);
+    }
+
+    public void testReadLegacyUid() throws Exception {
+        final File testFile = new File(getContext().getFilesDir(), TEST_FILE);
+        stageFile(R.raw.netstats_uid_v4, testFile);
+
+        final NetworkStatsCollection collection = new NetworkStatsCollection(30 * MINUTE_IN_MILLIS);
+        collection.readLegacyUid(testFile, false);
+
+        // verify that history read correctly
+        assertSummaryTotal(collection, buildTemplateMobileAll(TEST_IMSI),
+                637073904L, 711398L, 88342093L, 521006L);
+
+        // now export into a unified format
+        final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        collection.write(new DataOutputStream(bos));
+
+        // clear structure completely
+        collection.reset();
+        assertSummaryTotal(collection, buildTemplateMobileAll(TEST_IMSI),
+                0L, 0L, 0L, 0L);
+
+        // and read back into structure, verifying that totals are same
+        collection.read(new ByteArrayInputStream(bos.toByteArray()));
+        assertSummaryTotal(collection, buildTemplateMobileAll(TEST_IMSI),
+                637073904L, 711398L, 88342093L, 521006L);
+    }
+
+    public void testReadLegacyUidTags() throws Exception {
+        final File testFile = new File(getContext().getFilesDir(), TEST_FILE);
+        stageFile(R.raw.netstats_uid_v4, testFile);
+
+        final NetworkStatsCollection collection = new NetworkStatsCollection(30 * MINUTE_IN_MILLIS);
+        collection.readLegacyUid(testFile, true);
+
+        // verify that history read correctly
+        assertSummaryTotalIncludingTags(collection, buildTemplateMobileAll(TEST_IMSI),
+                77017831L, 100995L, 35436758L, 92344L);
+
+        // now export into a unified format
+        final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        collection.write(new DataOutputStream(bos));
+
+        // clear structure completely
+        collection.reset();
+        assertSummaryTotalIncludingTags(collection, buildTemplateMobileAll(TEST_IMSI),
+                0L, 0L, 0L, 0L);
+
+        // and read back into structure, verifying that totals are same
+        collection.read(new ByteArrayInputStream(bos.toByteArray()));
+        assertSummaryTotalIncludingTags(collection, buildTemplateMobileAll(TEST_IMSI),
+                77017831L, 100995L, 35436758L, 92344L);
+    }
+
+    /**
+     * Copy a {@link Resources#openRawResource(int)} into {@link File} for
+     * testing purposes.
+     */
+    private void stageFile(int rawId, File file) throws Exception {
+        new File(file.getParent()).mkdirs();
+        InputStream in = null;
+        OutputStream out = null;
+        try {
+            in = getContext().getResources().openRawResource(rawId);
+            out = new FileOutputStream(file);
+            Streams.copy(in, out);
+        } finally {
+            IoUtils.closeQuietly(in);
+            IoUtils.closeQuietly(out);
+        }
+    }
+
+    public static NetworkIdentitySet buildWifiIdent() {
+        final NetworkIdentitySet set = new NetworkIdentitySet();
+        set.add(new NetworkIdentity(ConnectivityManager.TYPE_WIFI, 0, null, false));
+        return set;
+    }
+
+    private static void assertSummaryTotal(NetworkStatsCollection collection,
+            NetworkTemplate template, long rxBytes, long rxPackets, long txBytes, long txPackets) {
+        final NetworkStats.Entry entry = collection.getSummary(
+                template, Long.MIN_VALUE, Long.MAX_VALUE).getTotal(null);
+        assertEntry(entry, rxBytes, rxPackets, txBytes, txPackets);
+    }
+
+    private static void assertSummaryTotalIncludingTags(NetworkStatsCollection collection,
+            NetworkTemplate template, long rxBytes, long rxPackets, long txBytes, long txPackets) {
+        final NetworkStats.Entry entry = collection.getSummary(
+                template, Long.MIN_VALUE, Long.MAX_VALUE).getTotalIncludingTags(null);
+        assertEntry(entry, rxBytes, rxPackets, txBytes, txPackets);
+    }
+
+    private static void assertEntry(
+            NetworkStats.Entry entry, long rxBytes, long rxPackets, long txBytes, long txPackets) {
+        assertEquals("unexpected rxBytes", rxBytes, entry.rxBytes);
+        assertEquals("unexpected rxPackets", rxPackets, entry.rxPackets);
+        assertEquals("unexpected txBytes", txBytes, entry.txBytes);
+        assertEquals("unexpected txPackets", txPackets, entry.txPackets);
+    }
+}
diff --git a/telephony/java/android/telephony/SignalStrength.java b/telephony/java/android/telephony/SignalStrength.java
index a88825b..1049669 100644
--- a/telephony/java/android/telephony/SignalStrength.java
+++ b/telephony/java/android/telephony/SignalStrength.java
@@ -47,6 +47,9 @@
         "none", "poor", "moderate", "good", "great"
     };
 
+    /** @hide */
+    public static final int INVALID_SNR = 0x7FFFFFFF;
+
     private int mGsmSignalStrength; // Valid values are (0-31, 99) as defined in TS 27.007 8.5
     private int mGsmBitErrorRate;   // bit error rate (0-7, 99) as defined in TS 27.007 8.5
     private int mCdmaDbm;   // This value is the RSSI value
@@ -96,7 +99,7 @@
         mLteSignalStrength = -1;
         mLteRsrp = -1;
         mLteRsrq = -1;
-        mLteRssnr = -1;
+        mLteRssnr = INVALID_SNR;
         mLteCqi = -1;
         isGsm = true;
     }
@@ -136,7 +139,8 @@
             int evdoDbm, int evdoEcio, int evdoSnr,
             boolean gsm) {
         this(gsmSignalStrength, gsmBitErrorRate, cdmaDbm, cdmaEcio,
-                evdoDbm, evdoEcio, evdoSnr, -1, -1, -1, -1, -1, gsm);
+                evdoDbm, evdoEcio, evdoSnr, -1, -1,
+                -1, INVALID_SNR, -1, gsm);
     }
 
     /**
@@ -289,10 +293,11 @@
         int level;
 
         if (isGsm) {
+            // TODO Need solve the discrepancy of invalid values between
+            // RIL_LTE_SignalStrength and here.
             if ((mLteSignalStrength == -1)
                     && (mLteRsrp == -1)
                     && (mLteRsrq == -1)
-                    && (mLteRssnr == -1)
                     && (mLteCqi == -1)) {
                 level = getGsmLevel();
             } else {
@@ -327,7 +332,6 @@
             if ((mLteSignalStrength == -1)
                     && (mLteRsrp == -1)
                     && (mLteRsrq == -1)
-                    && (mLteRssnr == -1)
                     && (mLteCqi == -1)) {
                 asuLevel = getGsmAsuLevel();
             } else {
@@ -363,7 +367,6 @@
             if ((mLteSignalStrength == -1)
                     && (mLteRsrp == -1)
                     && (mLteRsrq == -1)
-                    && (mLteRssnr == -1)
                     && (mLteCqi == -1)) {
                 dBm = getGsmDbm();
             } else {
@@ -566,16 +569,31 @@
      */
     public int getLteLevel() {
         int levelLteRsrp = 0;
+        int levelLteRssnr = 0;
 
         if (mLteRsrp == -1) levelLteRsrp = 0;
-        else if (mLteRsrp >= -85) levelLteRsrp = SIGNAL_STRENGTH_GREAT;
-        else if (mLteRsrp >= -95) levelLteRsrp = SIGNAL_STRENGTH_GOOD;
-        else if (mLteRsrp >= -105) levelLteRsrp = SIGNAL_STRENGTH_MODERATE;
-        else if (mLteRsrp >= -115) levelLteRsrp = SIGNAL_STRENGTH_POOR;
-        else levelLteRsrp = 0;
+        else if (mLteRsrp >= -95) levelLteRsrp = SIGNAL_STRENGTH_GREAT;
+        else if (mLteRsrp >= -105) levelLteRsrp = SIGNAL_STRENGTH_GOOD;
+        else if (mLteRsrp >= -115) levelLteRsrp = SIGNAL_STRENGTH_MODERATE;
+        else levelLteRsrp = SIGNAL_STRENGTH_POOR;
 
-        if (DBG) log("Lte level: "+levelLteRsrp);
-        return levelLteRsrp;
+        if (mLteRssnr == INVALID_SNR) levelLteRssnr = 0;
+        else if (mLteRssnr >= 45) levelLteRssnr = SIGNAL_STRENGTH_GREAT;
+        else if (mLteRssnr >= 10) levelLteRssnr = SIGNAL_STRENGTH_GOOD;
+        else if (mLteRssnr >= -30) levelLteRssnr = SIGNAL_STRENGTH_MODERATE;
+        else levelLteRssnr = SIGNAL_STRENGTH_POOR;
+
+        int level;
+        if (mLteRsrp == -1)
+            level = levelLteRssnr;
+        else if (mLteRssnr == INVALID_SNR)
+            level = levelLteRsrp;
+        else
+            level = (levelLteRssnr < levelLteRsrp) ? levelLteRssnr : levelLteRsrp;
+
+        if (DBG) log("Lte rsrp level: "+levelLteRsrp
+                + " snr level: " + levelLteRssnr + " level: " + level);
+        return level;
     }
 
     /**
diff --git a/telephony/java/com/android/internal/telephony/ApnSetting.java b/telephony/java/com/android/internal/telephony/ApnSetting.java
index 980bb49..ad69fdb 100755
--- a/telephony/java/com/android/internal/telephony/ApnSetting.java
+++ b/telephony/java/com/android/internal/telephony/ApnSetting.java
@@ -181,9 +181,10 @@
     public boolean canHandleType(String type) {
         for (String t : types) {
             // DEFAULT handles all, and HIPRI is handled by DEFAULT
-            if (t.equals(type) || t.equals(Phone.APN_TYPE_ALL) ||
-                    (t.equals(Phone.APN_TYPE_DEFAULT) &&
-                    type.equals(Phone.APN_TYPE_HIPRI))) {
+            if (t.equalsIgnoreCase(type) ||
+                    t.equalsIgnoreCase(Phone.APN_TYPE_ALL) ||
+                    (t.equalsIgnoreCase(Phone.APN_TYPE_DEFAULT) &&
+                    type.equalsIgnoreCase(Phone.APN_TYPE_HIPRI))) {
                 return true;
             }
         }
diff --git a/telephony/java/com/android/internal/telephony/CallManager.java b/telephony/java/com/android/internal/telephony/CallManager.java
index 3dd57ee..f825f31 100644
--- a/telephony/java/com/android/internal/telephony/CallManager.java
+++ b/telephony/java/com/android/internal/telephony/CallManager.java
@@ -373,10 +373,19 @@
         AudioManager audioManager = (AudioManager)
                 context.getSystemService(Context.AUDIO_SERVICE);
 
-        int mode = AudioManager.MODE_NORMAL;
+        // change the audio mode and request/abandon audio focus according to phone state,
+        // but only on audio mode transitions
         switch (getState()) {
             case RINGING:
-                mode = AudioManager.MODE_RINGTONE;
+                if (audioManager.getMode() != AudioManager.MODE_RINGTONE) {
+                    // only request audio focus if the ringtone is going to be heard
+                    if (audioManager.getStreamVolume(AudioManager.STREAM_RING) > 0) {
+                        if (VDBG) Log.d(LOG_TAG, "requestAudioFocus on STREAM_RING");
+                        audioManager.requestAudioFocusForCall(AudioManager.STREAM_RING,
+                                AudioManager.AUDIOFOCUS_GAIN_TRANSIENT);
+                    }
+                    audioManager.setMode(AudioManager.MODE_RINGTONE);
+                }
                 break;
             case OFFHOOK:
                 Phone offhookPhone = getFgPhone();
@@ -386,18 +395,28 @@
                     offhookPhone = getBgPhone();
                 }
 
+                int newAudioMode = AudioManager.MODE_IN_CALL;
                 if (offhookPhone instanceof SipPhone) {
-                    // enable IN_COMMUNICATION audio mode for sipPhone
-                    mode = AudioManager.MODE_IN_COMMUNICATION;
-                } else {
-                    // enable IN_CALL audio mode for telephony
-                    mode = AudioManager.MODE_IN_CALL;
+                    // enable IN_COMMUNICATION audio mode instead for sipPhone
+                    newAudioMode = AudioManager.MODE_IN_COMMUNICATION;
+                }
+                if (audioManager.getMode() != newAudioMode) {
+                    // request audio focus before setting the new mode
+                    if (VDBG) Log.d(LOG_TAG, "requestAudioFocus on STREAM_VOICE_CALL");
+                    audioManager.requestAudioFocusForCall(AudioManager.STREAM_VOICE_CALL,
+                            AudioManager.AUDIOFOCUS_GAIN_TRANSIENT);
+                    audioManager.setMode(newAudioMode);
+                }
+                break;
+            case IDLE:
+                if (audioManager.getMode() != AudioManager.MODE_NORMAL) {
+                    audioManager.setMode(AudioManager.MODE_NORMAL);
+                    if (VDBG) Log.d(LOG_TAG, "abandonAudioFocus");
+                    // abandon audio focus after the mode has been set back to normal
+                    audioManager.abandonAudioFocusForCall();
                 }
                 break;
         }
-        // calling audioManager.setMode() multiple times in a short period of
-        // time seems to break the audio recorder in in-call mode
-        if (audioManager.getMode() != mode) audioManager.setMode(mode);
     }
 
     private Context getContext() {
diff --git a/telephony/java/com/android/internal/telephony/CommandsInterface.java b/telephony/java/com/android/internal/telephony/CommandsInterface.java
index 4abb20f..f7757b3 100644
--- a/telephony/java/com/android/internal/telephony/CommandsInterface.java
+++ b/telephony/java/com/android/internal/telephony/CommandsInterface.java
@@ -93,11 +93,6 @@
     static final int USSD_MODE_NOTIFY       = 0;
     static final int USSD_MODE_REQUEST      = 1;
 
-    // SIM Refresh results, passed up from RIL.
-    static final int SIM_REFRESH_FILE_UPDATED   = 0;  // Single file updated
-    static final int SIM_REFRESH_INIT           = 1;  // SIM initialized; reload all
-    static final int SIM_REFRESH_RESET          = 2;  // SIM reset; may be locked
-
     // GSM SMS fail cause for acknowledgeLastIncomingSMS. From TS 23.040, 9.2.3.22.
     static final int GSM_SMS_FAIL_CAUSE_MEMORY_CAPACITY_EXCEEDED    = 0xD3;
     static final int GSM_SMS_FAIL_CAUSE_USIM_APP_TOOLKIT_BUSY       = 0xD4;
@@ -764,6 +759,15 @@
      *  retMsg.obj = AsyncResult ar
      *  ar.exception carries exception on failure
      *  ar.userObject contains the orignal value of result.obj
+     *  ar.result is String containing IMSI on success
+     */
+    void getIMSIForApp(String aid, Message result);
+
+    /**
+     *  returned message
+     *  retMsg.obj = AsyncResult ar
+     *  ar.exception carries exception on failure
+     *  ar.userObject contains the orignal value of result.obj
      *  ar.result is String containing IMEI on success
      */
     void getIMEI(Message result);
@@ -1055,6 +1059,14 @@
             String data, String pin2, Message response);
 
     /**
+     * parameters equivalent to 27.007 AT+CRSM command
+     * response.obj will be an AsyncResult
+     * response.obj.userObj will be a IccIoResult on success
+     */
+    void iccIOForApp (int command, int fileid, String path, int p1, int p2, int p3,
+            String data, String pin2, String aid, Message response);
+
+    /**
      * (AsyncResult)response.obj).result is an int[] with element [0] set to
      * 1 for "CLIP is provisioned", and 0 for "CLIP is not provisioned".
      *
diff --git a/telephony/java/com/android/internal/telephony/DataConnection.java b/telephony/java/com/android/internal/telephony/DataConnection.java
index ffe848d..d0e304f 100644
--- a/telephony/java/com/android/internal/telephony/DataConnection.java
+++ b/telephony/java/com/android/internal/telephony/DataConnection.java
@@ -68,6 +68,8 @@
     private List<ApnContext> mApnList = null;
     PendingIntent mReconnectIntent = null;
 
+    private DataConnectionTracker mDataConnectionTracker = null;
+
     /**
      * Used internally for saving connecting parameters.
      */
@@ -202,6 +204,7 @@
     protected static final int EVENT_DEACTIVATE_DONE = BASE + 3;
     protected static final int EVENT_DISCONNECT = BASE + 4;
     protected static final int EVENT_RIL_CONNECTED = BASE + 5;
+    protected static final int EVENT_DISCONNECT_ALL = BASE + 6;
 
     //***** Tag IDs for EventLog
     protected static final int EVENT_LOG_BAD_DNS_ADDRESS = 50100;
@@ -234,10 +237,12 @@
 
 
    //***** Constructor
-    protected DataConnection(PhoneBase phone, String name, int id, RetryManager rm) {
+    protected DataConnection(PhoneBase phone, String name, int id, RetryManager rm,
+            DataConnectionTracker dct) {
         super(name);
         if (DBG) log("DataConnection constructor E");
         this.phone = phone;
+        this.mDataConnectionTracker = dct;
         mId = id;
         mRetryMgr = rm;
         this.cid = -1;
@@ -316,11 +321,19 @@
      *
      * @param dp is the DisconnectParams.
      */
-    private void notifyDisconnectCompleted(DisconnectParams dp) {
+    private void notifyDisconnectCompleted(DisconnectParams dp, boolean sendAll) {
         if (VDBG) log("NotifyDisconnectCompleted");
 
+        ApnContext alreadySent = null;
+        String reason = null;
+
         if (dp.onCompletedMsg != null) {
+            // Get ApnContext, but only valid on GSM devices this is a string on CDMA devices.
             Message msg = dp.onCompletedMsg;
+            if (msg.obj instanceof ApnContext) {
+                alreadySent = (ApnContext)msg.obj;
+            }
+            reason = dp.reason;
             if (VDBG) {
                 log(String.format("msg=%s msg.obj=%s", msg.toString(),
                     ((msg.obj instanceof String) ? (String) msg.obj : "<no-reason>")));
@@ -328,6 +341,17 @@
             AsyncResult.forMessage(msg);
             msg.sendToTarget();
         }
+        if (sendAll) {
+            for (ApnContext a : mApnList) {
+                if (a == alreadySent) continue;
+                if (reason != null) a.setReason(reason);
+                Message msg = mDataConnectionTracker.obtainMessage(
+                        DataConnectionTracker.EVENT_DISCONNECT_DONE, a);
+                AsyncResult.forMessage(msg);
+                msg.sendToTarget();
+            }
+        }
+
         if (DBG) log("NotifyDisconnectCompleted DisconnectParams=" + dp);
     }
 
@@ -706,6 +730,13 @@
                     deferMessage(msg);
                     break;
 
+                case EVENT_DISCONNECT_ALL:
+                    if (DBG) {
+                        log("DcDefaultState deferring msg.what=EVENT_DISCONNECT_ALL" + mRefCount);
+                    }
+                    deferMessage(msg);
+                    break;
+
                 case EVENT_RIL_CONNECTED:
                     ar = (AsyncResult)msg.obj;
                     if (ar.exception == null) {
@@ -771,7 +802,7 @@
             }
             if (mDisconnectParams != null) {
                 if (VDBG) log("DcInactiveState: enter notifyDisconnectCompleted");
-                notifyDisconnectCompleted(mDisconnectParams);
+                notifyDisconnectCompleted(mDisconnectParams, true);
             }
             clearSettings();
         }
@@ -812,7 +843,13 @@
 
                 case EVENT_DISCONNECT:
                     if (DBG) log("DcInactiveState: msg.what=EVENT_DISCONNECT");
-                    notifyDisconnectCompleted((DisconnectParams)msg.obj);
+                    notifyDisconnectCompleted((DisconnectParams)msg.obj, false);
+                    retVal = HANDLED;
+                    break;
+
+                case EVENT_DISCONNECT_ALL:
+                    if (DBG) log("DcInactiveState: msg.what=EVENT_DISCONNECT_ALL");
+                    notifyDisconnectCompleted((DisconnectParams)msg.obj, false);
                     retVal = HANDLED;
                     break;
 
@@ -989,12 +1026,24 @@
                         transitionTo(mDisconnectingState);
                     } else {
                         if (msg.obj != null) {
-                            notifyDisconnectCompleted((DisconnectParams) msg.obj);
+                            notifyDisconnectCompleted((DisconnectParams) msg.obj, false);
                         }
                     }
                     retVal = HANDLED;
                     break;
 
+                case EVENT_DISCONNECT_ALL:
+                    if (DBG) {
+                        log("DcActiveState msg.what=EVENT_DISCONNECT_ALL RefCount=" + mRefCount);
+                    }
+                    mRefCount = 0;
+                    DisconnectParams dp = (DisconnectParams) msg.obj;
+                    dp.tag = mTag;
+                    tearDownData(dp);
+                    transitionTo(mDisconnectingState);
+                    retVal = HANDLED;
+                    break;
+
                 default:
                     if (VDBG) {
                         log("DcActiveState not handled msg.what=0x" +
@@ -1124,4 +1173,16 @@
     public void tearDown(String reason, Message onCompletedMsg) {
         sendMessage(obtainMessage(EVENT_DISCONNECT, new DisconnectParams(reason, onCompletedMsg)));
     }
+
+    /**
+     * Tear down the connection through the apn on the network.  Ignores refcount and
+     * and always tears down.
+     *
+     * @param onCompletedMsg is sent with its msg.obj as an AsyncResult object.
+     *        With AsyncResult.userObj set to the original msg.obj.
+     */
+    public void tearDownAll(String reason, Message onCompletedMsg) {
+        sendMessage(obtainMessage(EVENT_DISCONNECT_ALL,
+                new DisconnectParams(reason, onCompletedMsg)));
+    }
 }
diff --git a/telephony/java/com/android/internal/telephony/DataConnectionTracker.java b/telephony/java/com/android/internal/telephony/DataConnectionTracker.java
index dab72a9..5d76484 100644
--- a/telephony/java/com/android/internal/telephony/DataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/DataConnectionTracker.java
@@ -225,7 +225,8 @@
     //       having to have different values for GSM and
     //       CDMA. If so we can then remove the need for
     //       getActionIntentReconnectAlarm.
-    protected static final String INTENT_RECONNECT_ALARM_EXTRA_REASON = "reason";
+    protected static final String INTENT_RECONNECT_ALARM_EXTRA_REASON =
+        "reconnect_alarm_extra_reason";
 
     // Used for debugging. Send the INTENT with an optional counter value with the number
     // of times the setup is to fail before succeeding. If the counter isn't passed the
@@ -1038,8 +1039,10 @@
                     didDisable = true;
                 }
             }
-            if (didDisable && enabledCount == 0) {
-                onCleanUpConnection(true, apnId, Phone.REASON_DATA_DISABLED);
+            if (didDisable) {
+                if (enabledCount == 0) {
+                    onCleanUpConnection(true, apnId, Phone.REASON_DATA_DISABLED);
+                }
 
                 // send the disconnect msg manually, since the normal route wont send
                 // it (it's not enabled)
diff --git a/telephony/java/com/android/internal/telephony/IccCard.java b/telephony/java/com/android/internal/telephony/IccCard.java
index f4308a0..a9ef762 100644
--- a/telephony/java/com/android/internal/telephony/IccCard.java
+++ b/telephony/java/com/android/internal/telephony/IccCard.java
@@ -48,7 +48,7 @@
     protected String mLogTag;
     protected boolean mDbg;
 
-    private IccCardStatus mIccCardStatus = null;
+    protected IccCardStatus mIccCardStatus = null;
     protected State mState = null;
     private final Object mStateMonitor = new Object();
 
@@ -911,4 +911,24 @@
     private void log(String msg) {
         Log.d(mLogTag, "[IccCard] " + msg);
     }
+
+    protected abstract int getCurrentApplicationIndex();
+
+    public String getAid() {
+        String aid = "";
+        int appIndex = getCurrentApplicationIndex();
+
+        if (appIndex >= 0 && appIndex < IccCardStatus.CARD_MAX_APPS) {
+            IccCardApplication app = mIccCardStatus.getApplication(appIndex);
+            if (app != null) {
+                aid = app.aid;
+            } else {
+                Log.e(mLogTag, "[IccCard] getAid: no current application index=" + appIndex);
+            }
+        } else {
+            Log.e(mLogTag, "[IccCard] getAid: Invalid Subscription Application index=" + appIndex);
+        }
+
+        return aid;
+    }
 }
diff --git a/telephony/java/com/android/internal/telephony/IccCardStatus.java b/telephony/java/com/android/internal/telephony/IccCardStatus.java
index c751a21..a3bdd76 100644
--- a/telephony/java/com/android/internal/telephony/IccCardStatus.java
+++ b/telephony/java/com/android/internal/telephony/IccCardStatus.java
@@ -24,7 +24,7 @@
  * {@hide}
  */
 public class IccCardStatus {
-    static final int CARD_MAX_APPS = 8;
+    public static final int CARD_MAX_APPS = 8;
 
     public enum CardState {
         CARDSTATE_ABSENT,
diff --git a/telephony/java/com/android/internal/telephony/IccFileHandler.java b/telephony/java/com/android/internal/telephony/IccFileHandler.java
index 93b9b79..380bfd1 100644
--- a/telephony/java/com/android/internal/telephony/IccFileHandler.java
+++ b/telephony/java/com/android/internal/telephony/IccFileHandler.java
@@ -145,8 +145,9 @@
             = obtainMessage(EVENT_GET_RECORD_SIZE_DONE,
                         new LoadLinearFixedContext(fileid, recordNum, onLoaded));
 
-        phone.mCM.iccIO(COMMAND_GET_RESPONSE, fileid, getEFPath(fileid),
-                        0, 0, GET_RESPONSE_EF_SIZE_BYTES, null, null, response);
+        phone.mCM.iccIOForApp(COMMAND_GET_RESPONSE, fileid, getEFPath(fileid),
+                        0, 0, GET_RESPONSE_EF_SIZE_BYTES, null, null,
+                        phone.getIccCard().getAid(), response);
     }
 
     /**
@@ -164,9 +165,10 @@
                         onLoaded));
 
         // TODO(): Verify when path changes are done.
-        phone.mCM.iccIO(COMMAND_GET_RESPONSE, IccConstants.EF_IMG, "img",
+        phone.mCM.iccIOForApp(COMMAND_GET_RESPONSE, IccConstants.EF_IMG, "img",
                 recordNum, READ_RECORD_MODE_ABSOLUTE,
-                GET_RESPONSE_EF_IMG_SIZE_BYTES, null, null, response);
+                GET_RESPONSE_EF_IMG_SIZE_BYTES, null, null,
+                phone.getIccCard().getAid(), response);
     }
 
     /**
@@ -182,8 +184,9 @@
         Message response
                 = obtainMessage(EVENT_GET_EF_LINEAR_RECORD_SIZE_DONE,
                         new LoadLinearFixedContext(fileid, onLoaded));
-        phone.mCM.iccIO(COMMAND_GET_RESPONSE, fileid, getEFPath(fileid),
-                    0, 0, GET_RESPONSE_EF_SIZE_BYTES, null, null, response);
+        phone.mCM.iccIOForApp(COMMAND_GET_RESPONSE, fileid, getEFPath(fileid),
+                    0, 0, GET_RESPONSE_EF_SIZE_BYTES, null, null, phone.getIccCard().getAid(),
+                    response);
     }
 
     /**
@@ -199,8 +202,9 @@
         Message response = obtainMessage(EVENT_GET_RECORD_SIZE_DONE,
                         new LoadLinearFixedContext(fileid,onLoaded));
 
-        phone.mCM.iccIO(COMMAND_GET_RESPONSE, fileid, getEFPath(fileid),
-                        0, 0, GET_RESPONSE_EF_SIZE_BYTES, null, null, response);
+        phone.mCM.iccIOForApp(COMMAND_GET_RESPONSE, fileid, getEFPath(fileid),
+                        0, 0, GET_RESPONSE_EF_SIZE_BYTES, null, null,
+                        phone.getIccCard().getAid(), response);
     }
 
     /**
@@ -217,8 +221,9 @@
         Message response = obtainMessage(EVENT_GET_BINARY_SIZE_DONE,
                         fileid, 0, onLoaded);
 
-        phone.mCM.iccIO(COMMAND_GET_RESPONSE, fileid, getEFPath(fileid),
-                        0, 0, GET_RESPONSE_EF_SIZE_BYTES, null, null, response);
+        phone.mCM.iccIOForApp(COMMAND_GET_RESPONSE, fileid, getEFPath(fileid),
+                        0, 0, GET_RESPONSE_EF_SIZE_BYTES, null, null,
+                        phone.getIccCard().getAid(), response);
     }
 
     /**
@@ -236,8 +241,8 @@
         Message response = obtainMessage(EVENT_READ_ICON_DONE, fileid, 0,
                 onLoaded);
 
-        phone.mCM.iccIO(COMMAND_READ_BINARY, fileid, "img", highOffset, lowOffset,
-                length, null, null, response);
+        phone.mCM.iccIOForApp(COMMAND_READ_BINARY, fileid, "img", highOffset, lowOffset,
+                length, null, null, phone.getIccCard().getAid(), response);
     }
 
     /**
@@ -251,9 +256,10 @@
      */
     public void updateEFLinearFixed(int fileid, int recordNum, byte[] data,
             String pin2, Message onComplete) {
-        phone.mCM.iccIO(COMMAND_UPDATE_RECORD, fileid, getEFPath(fileid),
+        phone.mCM.iccIOForApp(COMMAND_UPDATE_RECORD, fileid, getEFPath(fileid),
                         recordNum, READ_RECORD_MODE_ABSOLUTE, data.length,
-                        IccUtils.bytesToHexString(data), pin2, onComplete);
+                        IccUtils.bytesToHexString(data), pin2,
+                        phone.getIccCard().getAid(), onComplete);
     }
 
     /**
@@ -262,9 +268,10 @@
      * @param data must be exactly as long as the EF
      */
     public void updateEFTransparent(int fileid, byte[] data, Message onComplete) {
-        phone.mCM.iccIO(COMMAND_UPDATE_BINARY, fileid, getEFPath(fileid),
+        phone.mCM.iccIOForApp(COMMAND_UPDATE_BINARY, fileid, getEFPath(fileid),
                         0, 0, data.length,
-                        IccUtils.bytesToHexString(data), null, onComplete);
+                        IccUtils.bytesToHexString(data), null,
+                        phone.getIccCard().getAid(), onComplete);
     }
 
 
@@ -395,10 +402,11 @@
                      lc.results = new ArrayList<byte[]>(lc.countRecords);
                  }
 
-                 phone.mCM.iccIO(COMMAND_READ_RECORD, lc.efid, getEFPath(lc.efid),
+                 phone.mCM.iccIOForApp(COMMAND_READ_RECORD, lc.efid, getEFPath(lc.efid),
                          lc.recordNum,
                          READ_RECORD_MODE_ABSOLUTE,
                          lc.recordSize, null, null,
+                         phone.getIccCard().getAid(),
                          obtainMessage(EVENT_READ_RECORD_DONE, lc));
                  break;
             case EVENT_GET_BINARY_SIZE_DONE:
@@ -433,8 +441,9 @@
                 size = ((data[RESPONSE_DATA_FILE_SIZE_1] & 0xff) << 8)
                        + (data[RESPONSE_DATA_FILE_SIZE_2] & 0xff);
 
-                phone.mCM.iccIO(COMMAND_READ_BINARY, fileid, getEFPath(fileid),
+                phone.mCM.iccIOForApp(COMMAND_READ_BINARY, fileid, getEFPath(fileid),
                                 0, 0, size, null, null,
+                                phone.getIccCard().getAid(),
                                 obtainMessage(EVENT_READ_BINARY_DONE,
                                               fileid, 0, response));
             break;
@@ -468,10 +477,11 @@
                     if (lc.recordNum > lc.countRecords) {
                         sendResult(response, lc.results, null);
                     } else {
-                        phone.mCM.iccIO(COMMAND_READ_RECORD, lc.efid, getEFPath(lc.efid),
+                        phone.mCM.iccIOForApp(COMMAND_READ_RECORD, lc.efid, getEFPath(lc.efid),
                                     lc.recordNum,
                                     READ_RECORD_MODE_ABSOLUTE,
                                     lc.recordSize, null, null,
+                                    phone.getIccCard().getAid(),
                                     obtainMessage(EVENT_READ_RECORD_DONE, lc));
                     }
                 }
diff --git a/telephony/java/com/android/internal/telephony/IccRefreshResponse.java b/telephony/java/com/android/internal/telephony/IccRefreshResponse.java
new file mode 100644
index 0000000..6806703
--- /dev/null
+++ b/telephony/java/com/android/internal/telephony/IccRefreshResponse.java
@@ -0,0 +1,42 @@
+/*
+ * 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.telephony;
+
+/**
+ * See also RIL_SimRefresh in include/telephony/ril.h
+ *
+ * {@hide}
+ */
+
+public class IccRefreshResponse {
+
+    public static final int REFRESH_RESULT_FILE_UPDATE = 0; /* Single file was updated */
+    public static final int REFRESH_RESULT_INIT = 1;        /* The Icc has been initialized */
+    public static final int REFRESH_RESULT_RESET = 2;       /* The Icc was reset */
+
+    public int             refreshResult;      /* Sim Refresh result */
+    public int             efId;               /* EFID */
+    public String          aid;                /* null terminated string, e.g.,
+                                                  from 0xA0, 0x00 -> 0x41,
+                                                  0x30, 0x30, 0x30 */
+                                               /* Example: a0000000871002f310ffff89080000ff */
+
+    @Override
+    public String toString() {
+        return "{" + refreshResult + ", " + aid +", " + efId + "}";
+    }
+}
diff --git a/telephony/java/com/android/internal/telephony/RIL.java b/telephony/java/com/android/internal/telephony/RIL.java
index 95842bb..5afc1f3 100644
--- a/telephony/java/com/android/internal/telephony/RIL.java
+++ b/telephony/java/com/android/internal/telephony/RIL.java
@@ -52,6 +52,7 @@
 import com.android.internal.telephony.gsm.SuppServiceNotification;
 import com.android.internal.telephony.cdma.CdmaCallWaitingNotification;
 import com.android.internal.telephony.cdma.CdmaInformationRecords;
+import com.android.internal.telephony.IccRefreshResponse;
 
 import java.io.ByteArrayInputStream;
 import java.io.DataInputStream;
@@ -883,9 +884,19 @@
 
     public void
     getIMSI(Message result) {
+        getIMSIForApp(null, result);
+    }
+
+    public void
+    getIMSIForApp(String aid, Message result) {
         RILRequest rr = RILRequest.obtain(RIL_REQUEST_GET_IMSI, result);
 
-        if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
+        rr.mp.writeInt(1);
+        rr.mp.writeString(aid);
+
+        if (RILJ_LOGD) riljLog(rr.serialString() +
+                              "> getIMSI: " + requestToString(rr.mRequest)
+                              + " aid: " + aid);
 
         send(rr);
     }
@@ -1438,6 +1449,11 @@
     public void
     iccIO (int command, int fileid, String path, int p1, int p2, int p3,
             String data, String pin2, Message result) {
+        iccIOForApp(command, fileid, path, p1, p2, p3, data, pin2, null, result);
+    }
+    public void
+    iccIOForApp (int command, int fileid, String path, int p1, int p2, int p3,
+            String data, String pin2, String aid, Message result) {
         //Note: This RIL request has not been renamed to ICC,
         //       but this request is also valid for SIM and RUIM
         RILRequest rr
@@ -1451,12 +1467,15 @@
         rr.mp.writeInt(p3);
         rr.mp.writeString(data);
         rr.mp.writeString(pin2);
+        rr.mp.writeString(aid);
 
-        if (RILJ_LOGD) riljLog(rr.serialString() + "> iccIO: " + requestToString(rr.mRequest)
+        if (RILJ_LOGD) riljLog(rr.serialString() + "> iccIO: "
+                + requestToString(rr.mRequest)
                 + " 0x" + Integer.toHexString(command)
                 + " 0x" + Integer.toHexString(fileid) + " "
                 + " path: " + path + ","
-                + p1 + "," + p2 + "," + p3);
+                + p1 + "," + p2 + "," + p3
+                + " aid: " + aid);
 
         send(rr);
     }
@@ -2432,7 +2451,7 @@
             case RIL_UNSOL_STK_EVENT_NOTIFY: ret = responseString(p); break;
             case RIL_UNSOL_STK_CALL_SETUP: ret = responseInts(p); break;
             case RIL_UNSOL_SIM_SMS_STORAGE_FULL: ret =  responseVoid(p); break;
-            case RIL_UNSOL_SIM_REFRESH: ret =  responseInts(p); break;
+            case RIL_UNSOL_SIM_REFRESH: ret =  responseSimRefresh(p); break;
             case RIL_UNSOL_CALL_RING: ret =  responseCallRing(p); break;
             case RIL_UNSOL_RESTRICTED_STATE_CHANGED: ret = responseInts(p); break;
             case RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED:  ret =  responseVoid(p); break;
@@ -2989,6 +3008,16 @@
     }
 
     private Object
+    responseSimRefresh(Parcel p) {
+        IccRefreshResponse response = new IccRefreshResponse();
+
+        response.refreshResult = p.readInt();
+        response.efId   = p.readInt();
+        response.aid = p.readString();
+        return response;
+    }
+
+    private Object
     responseCallList(Parcel p) {
         int num;
         int voiceSettings;
diff --git a/telephony/java/com/android/internal/telephony/cat/BerTlv.java b/telephony/java/com/android/internal/telephony/cat/BerTlv.java
index 774bfa3..095e65b 100644
--- a/telephony/java/com/android/internal/telephony/cat/BerTlv.java
+++ b/telephony/java/com/android/internal/telephony/cat/BerTlv.java
@@ -81,12 +81,18 @@
                     temp = data[curIndex++] & 0xff;
                     if (temp < 0x80) {
                         throw new ResultException(
-                                ResultCode.CMD_DATA_NOT_UNDERSTOOD);
+                                ResultCode.CMD_DATA_NOT_UNDERSTOOD,
+                                "length < 0x80 length=" + Integer.toHexString(length) +
+                                " curIndex=" + curIndex + " endIndex=" + endIndex);
+
                     }
                     length = temp;
                 } else {
                     throw new ResultException(
-                            ResultCode.CMD_DATA_NOT_UNDERSTOOD);
+                            ResultCode.CMD_DATA_NOT_UNDERSTOOD,
+                            "Expected first byte to be length or a length tag and < 0x81" +
+                            " byte= " + Integer.toHexString(temp) + " curIndex=" + curIndex +
+                            " endIndex=" + endIndex);
                 }
             } else {
                 if (ComprehensionTlvTag.COMMAND_DETAILS.value() == (tag & ~0x80)) {
@@ -95,14 +101,18 @@
                 }
             }
         } catch (IndexOutOfBoundsException e) {
-            throw new ResultException(ResultCode.REQUIRED_VALUES_MISSING);
+            throw new ResultException(ResultCode.REQUIRED_VALUES_MISSING,
+                    "IndexOutOfBoundsException " +
+                    " curIndex=" + curIndex + " endIndex=" + endIndex);
         } catch (ResultException e) {
-            throw new ResultException(ResultCode.CMD_DATA_NOT_UNDERSTOOD);
+            throw new ResultException(ResultCode.CMD_DATA_NOT_UNDERSTOOD, e.explanation());
         }
 
         /* COMPREHENSION-TLVs */
         if (endIndex - curIndex < length) {
-            throw new ResultException(ResultCode.CMD_DATA_NOT_UNDERSTOOD);
+            throw new ResultException(ResultCode.CMD_DATA_NOT_UNDERSTOOD,
+                    "Command had extra data endIndex=" + endIndex + " curIndex=" + curIndex +
+                    " length=" + length);
         }
 
         List<ComprehensionTlv> ctlvs = ComprehensionTlv.decodeMany(data,
diff --git a/telephony/java/com/android/internal/telephony/cat/CatService.java b/telephony/java/com/android/internal/telephony/cat/CatService.java
index 97fb73d..2b37072 100644
--- a/telephony/java/com/android/internal/telephony/cat/CatService.java
+++ b/telephony/java/com/android/internal/telephony/cat/CatService.java
@@ -427,11 +427,11 @@
                     }
                     break;
                 default:
-                    CatLog.d(this, "encodeOptionalTags() Unsupported Cmd:" + cmdDet.typeOfCommand);
+                    CatLog.d(this, "encodeOptionalTags() Unsupported Cmd details=" + cmdDet);
                     break;
             }
         } else {
-            CatLog.d(this, "encodeOptionalTags() bad Cmd:" + cmdDet.typeOfCommand);
+            CatLog.d(this, "encodeOptionalTags() bad Cmd details=" + cmdDet);
         }
     }
 
diff --git a/telephony/java/com/android/internal/telephony/cat/CommandDetails.java b/telephony/java/com/android/internal/telephony/cat/CommandDetails.java
index e3f0798..8579535 100644
--- a/telephony/java/com/android/internal/telephony/cat/CommandDetails.java
+++ b/telephony/java/com/android/internal/telephony/cat/CommandDetails.java
@@ -74,6 +74,14 @@
     public int describeContents() {
         return 0;
     }
+
+    @Override
+    public String toString() {
+        return "CmdDetails: compRequired=" + compRequired +
+                " commandNumber=" + commandNumber +
+                " typeOfCommand=" + typeOfCommand +
+                " commandQualifier=" + commandQualifier;
+    }
 }
 
 class DeviceIdentities extends ValueObject {
diff --git a/telephony/java/com/android/internal/telephony/cat/CommandParams.java b/telephony/java/com/android/internal/telephony/cat/CommandParams.java
index 959c9e2..79f6ad2 100644
--- a/telephony/java/com/android/internal/telephony/cat/CommandParams.java
+++ b/telephony/java/com/android/internal/telephony/cat/CommandParams.java
@@ -34,6 +34,11 @@
     }
 
     boolean setIcon(Bitmap icon) { return true; }
+
+    @Override
+    public String toString() {
+        return cmdDet.toString();
+    }
 }
 
 class DisplayTextParams extends CommandParams {
diff --git a/telephony/java/com/android/internal/telephony/cat/CommandParamsFactory.java b/telephony/java/com/android/internal/telephony/cat/CommandParamsFactory.java
index 89c1329..a554012 100644
--- a/telephony/java/com/android/internal/telephony/cat/CommandParamsFactory.java
+++ b/telephony/java/com/android/internal/telephony/cat/CommandParamsFactory.java
@@ -83,7 +83,8 @@
                 try {
                     cmdDet = ValueParser.retrieveCommandDetails(ctlvCmdDet);
                 } catch (ResultException e) {
-                    CatLog.d(this, "Failed to procees command details");
+                    CatLog.d(this,
+                            "processCommandDetails: Failed to procees command details e=" + e);
                 }
             }
         }
@@ -178,6 +179,7 @@
                 return;
             }
         } catch (ResultException e) {
+            CatLog.d(this, "make: caught ResultException e=" + e);
             mCmdParams = new CommandParams(cmdDet);
             sendCmdParams(e.result());
             return;
diff --git a/telephony/java/com/android/internal/telephony/cat/ComprehensionTlv.java b/telephony/java/com/android/internal/telephony/cat/ComprehensionTlv.java
index ab26d13..22cd5a4 100644
--- a/telephony/java/com/android/internal/telephony/cat/ComprehensionTlv.java
+++ b/telephony/java/com/android/internal/telephony/cat/ComprehensionTlv.java
@@ -16,6 +16,8 @@
 
 package com.android.internal.telephony.cat;
 
+import android.util.Log;
+
 import java.util.ArrayList;
 import java.util.List;
 
@@ -94,7 +96,6 @@
                 startIndex = ctlv.mValueIndex + ctlv.mLength;
             } else {
                 CatLog.d(LOG_TAG, "decodeMany: ctlv is null, stop decoding");
-                items.clear();
                 break;
             }
         }
@@ -112,10 +113,10 @@
      */
     public static ComprehensionTlv decode(byte[] data, int startIndex)
             throws ResultException {
-        try {
-            int curIndex = startIndex;
-            int endIndex = data.length;
+        int curIndex = startIndex;
+        int endIndex = data.length;
 
+        try {
             /* tag */
             int tag;
             boolean cr; // Comprehension required flag
@@ -124,9 +125,11 @@
             case 0:
             case 0xff:
             case 0x80:
-                // for error handling
-                // these one make exception while decoding the abnormal command.
-                // (in case of Ghana MTN simcard , JDI simcard)
+                Log.d("CAT     ", "decode: unexpected first tag byte=" + Integer.toHexString(temp) +
+                        ", startIndex=" + startIndex + " curIndex=" + curIndex +
+                        " endIndex=" + endIndex);
+                // Return null which will stop decoding, this has occurred
+                // with Ghana MTN simcard and JDI simcard.
                 return null;
 
             case 0x7f: // tag is in three-byte format
@@ -153,7 +156,10 @@
                 length = data[curIndex++] & 0xff;
                 if (length < 0x80) {
                     throw new ResultException(
-                            ResultCode.CMD_DATA_NOT_UNDERSTOOD);
+                            ResultCode.CMD_DATA_NOT_UNDERSTOOD,
+                            "length < 0x80 length=" + Integer.toHexString(length) +
+                            " startIndex=" + startIndex + " curIndex=" + curIndex +
+                            " endIndex=" + endIndex);
                 }
             } else if (temp == 0x82) {
                 length = ((data[curIndex] & 0xff) << 8)
@@ -161,7 +167,10 @@
                 curIndex += 2;
                 if (length < 0x100) {
                     throw new ResultException(
-                            ResultCode.CMD_DATA_NOT_UNDERSTOOD);
+                            ResultCode.CMD_DATA_NOT_UNDERSTOOD,
+                            "two byte length < 0x100 length=" + Integer.toHexString(length) +
+                            " startIndex=" + startIndex + " curIndex=" + curIndex +
+                            " endIndex=" + endIndex);
                 }
             } else if (temp == 0x83) {
                 length = ((data[curIndex] & 0xff) << 16)
@@ -170,16 +179,25 @@
                 curIndex += 3;
                 if (length < 0x10000) {
                     throw new ResultException(
-                            ResultCode.CMD_DATA_NOT_UNDERSTOOD);
+                            ResultCode.CMD_DATA_NOT_UNDERSTOOD,
+                            "three byte length < 0x10000 length=0x" + Integer.toHexString(length) +
+                            " startIndex=" + startIndex + " curIndex=" + curIndex +
+                            " endIndex=" + endIndex);
                 }
             } else {
-                throw new ResultException(ResultCode.CMD_DATA_NOT_UNDERSTOOD);
+                throw new ResultException(ResultCode.CMD_DATA_NOT_UNDERSTOOD,
+                        "Bad length modifer=" + temp +
+                        " startIndex=" + startIndex + " curIndex=" + curIndex +
+                        " endIndex=" + endIndex);
+
             }
 
             return new ComprehensionTlv(tag, cr, length, data, curIndex);
 
         } catch (IndexOutOfBoundsException e) {
-            throw new ResultException(ResultCode.CMD_DATA_NOT_UNDERSTOOD);
+            throw new ResultException(ResultCode.CMD_DATA_NOT_UNDERSTOOD,
+                    "IndexOutOfBoundsException" + " startIndex=" + startIndex +
+                    " curIndex=" + curIndex + " endIndex=" + endIndex);
         }
     }
 }
diff --git a/telephony/java/com/android/internal/telephony/cat/ResultException.java b/telephony/java/com/android/internal/telephony/cat/ResultException.java
index 1c2cb63..84879c2 100644
--- a/telephony/java/com/android/internal/telephony/cat/ResultException.java
+++ b/telephony/java/com/android/internal/telephony/cat/ResultException.java
@@ -25,6 +25,7 @@
 public class ResultException extends CatException {
     private ResultCode mResult;
     private int mAdditionalInfo;
+    private String mExplanation;
 
     public ResultException(ResultCode result) {
         super();
@@ -48,20 +49,30 @@
 
         mResult = result;
         mAdditionalInfo = -1;
+        mExplanation = "";
+    }
+
+    public ResultException(ResultCode result, String explanation) {
+        this(result);
+        mExplanation = explanation;
     }
 
     public ResultException(ResultCode result, int additionalInfo) {
-        super();
+        this(result);
 
         if (additionalInfo < 0) {
             throw new AssertionError(
                     "Additional info must be greater than zero!");
         }
 
-        mResult = result;
         mAdditionalInfo = additionalInfo;
     }
 
+    public ResultException(ResultCode result, int additionalInfo, String explanation) {
+        this(result, additionalInfo);
+        mExplanation = explanation;
+    }
+
     public ResultCode result() {
         return mResult;
     }
@@ -73,4 +84,14 @@
     public int additionalInfo() {
         return mAdditionalInfo;
     }
+
+    public String explanation() {
+        return mExplanation;
+    }
+
+    @Override
+    public String toString() {
+        return "result=" + mResult + " additionalInfo=" + mAdditionalInfo +
+                " explantion=" + mExplanation;
+    }
 }
diff --git a/telephony/java/com/android/internal/telephony/cat/RilMessageDecoder.java b/telephony/java/com/android/internal/telephony/cat/RilMessageDecoder.java
index 2a1f508..fb33a8e 100644
--- a/telephony/java/com/android/internal/telephony/cat/RilMessageDecoder.java
+++ b/telephony/java/com/android/internal/telephony/cat/RilMessageDecoder.java
@@ -162,6 +162,7 @@
                 decodingStarted = true;
             } catch (ResultException e) {
                 // send to Service for proper RIL communication.
+                CatLog.d(this, "decodeMessageParams: caught ResultException e=" + e);
                 mCurrentRilMessage.mResCode = e.result();
                 sendCmdForExecution(mCurrentRilMessage);
                 decodingStarted = false;
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnection.java b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnection.java
index d55f346..a93d94f 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnection.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnection.java
@@ -20,6 +20,7 @@
 import android.util.Log;
 
 import com.android.internal.telephony.DataConnection;
+import com.android.internal.telephony.DataConnectionTracker;
 import com.android.internal.telephony.Phone;
 import com.android.internal.telephony.RILConstants;
 import com.android.internal.telephony.RetryManager;
@@ -32,8 +33,9 @@
     private static final String LOG_TAG = "CDMA";
 
     // ***** Constructor
-    private CdmaDataConnection(CDMAPhone phone, String name, int id, RetryManager rm) {
-        super(phone, name, id, rm);
+    private CdmaDataConnection(CDMAPhone phone, String name, int id, RetryManager rm,
+            DataConnectionTracker dct) {
+        super(phone, name, id, rm, dct);
     }
 
     /**
@@ -44,12 +46,13 @@
      * @param rm the RetryManager
      * @return CdmaDataConnection that was created.
      */
-    static CdmaDataConnection makeDataConnection(CDMAPhone phone, int id, RetryManager rm) {
+    static CdmaDataConnection makeDataConnection(CDMAPhone phone, int id, RetryManager rm,
+            DataConnectionTracker dct) {
         synchronized (mCountLock) {
             mCount += 1;
         }
         CdmaDataConnection cdmaDc = new CdmaDataConnection(phone, "CdmaDC-" + mCount,
-                id, rm);
+                id, rm, dct);
         cdmaDc.start();
         if (DBG) cdmaDc.log("Made " + cdmaDc.getName());
         return cdmaDc;
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
index e16a081..3fe57ae 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
@@ -794,7 +794,7 @@
             }
 
             int id = mUniqueIdGenerator.getAndIncrement();
-            dataConn = CdmaDataConnection.makeDataConnection(mCdmaPhone, id, rm);
+            dataConn = CdmaDataConnection.makeDataConnection(mCdmaPhone, id, rm, this);
             mDataConnections.put(id, dataConn);
             DataConnectionAc dcac = new DataConnectionAc(dataConn, LOG_TAG);
             int status = dcac.fullyConnectSync(mPhone.getContext(), this, dataConn.getHandler());
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaLteServiceStateTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaLteServiceStateTracker.java
index 6b73cc5..7da23d0 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaLteServiceStateTracker.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaLteServiceStateTracker.java
@@ -124,7 +124,9 @@
 
     @Override
     protected void setSignalStrengthDefaultValues() {
-        mSignalStrength = new SignalStrength(99, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, false);
+        // TODO Make a constructor only has boolean gsm as parameter
+        mSignalStrength = new SignalStrength(99, -1, -1, -1, -1, -1, -1,
+                -1, -1, -1, SignalStrength.INVALID_SNR, -1, false);
     }
 
     @Override
@@ -429,8 +431,13 @@
             setSignalStrengthDefaultValues();
         } else {
             int[] ints = (int[])ar.result;
-            int lteCqi = 99, lteRsrp = -1;
-            int lteRssi = 99;
+
+            int lteRssi = -1;
+            int lteRsrp = -1;
+            int lteRsrq = -1;
+            int lteRssnr = SignalStrength.INVALID_SNR;
+            int lteCqi = -1;
+
             int offset = 2;
             int cdmaDbm = (ints[offset] > 0) ? -ints[offset] : -120;
             int cdmaEcio = (ints[offset + 1] > 0) ? -ints[offset + 1] : -160;
@@ -438,10 +445,13 @@
             int evdoEcio = (ints[offset + 3] > 0) ? -ints[offset + 3] : -1;
             int evdoSnr = ((ints[offset + 4] > 0) && (ints[offset + 4] <= 8)) ? ints[offset + 4]
                     : -1;
+
             if (networkType == ServiceState.RADIO_TECHNOLOGY_LTE) {
-                lteRssi = (ints[offset + 5] >= 0) ? ints[offset + 5] : 99;
-                lteRsrp = (ints[offset + 6] < 0) ? ints[offset + 6] : -1;
-                lteCqi = (ints[offset + 7] >= 0) ? ints[offset + 7] : 99;
+                lteRssi = ints[offset+5];
+                lteRsrp = ints[offset+6];
+                lteRsrq = ints[offset+7];
+                lteRssnr = ints[offset+8];
+                lteCqi = ints[offset+9];
             }
 
             if (networkType != ServiceState.RADIO_TECHNOLOGY_LTE) {
@@ -449,7 +459,7 @@
                         evdoSnr, false);
             } else {
                 mSignalStrength = new SignalStrength(99, -1, cdmaDbm, cdmaEcio, evdoRssi, evdoEcio,
-                        evdoSnr, lteRssi, lteRsrp, -1, -1, lteCqi, true);
+                        evdoSnr, lteRssi, lteRsrp, lteRsrq, lteRssnr, lteCqi, true);
             }
         }
 
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaLteUiccFileHandler.java b/telephony/java/com/android/internal/telephony/cdma/CdmaLteUiccFileHandler.java
index b57af0e..8375fd0 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaLteUiccFileHandler.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaLteUiccFileHandler.java
@@ -55,8 +55,8 @@
         if (fileid == EF_CSIM_EPRL) {
             // Entire PRL could be huge. We are only interested in
             // the first 4 bytes of the record.
-            phone.mCM.iccIO(COMMAND_READ_BINARY, fileid, getEFPath(fileid),
-                            0, 0, 4, null, null,
+            phone.mCM.iccIOForApp(COMMAND_READ_BINARY, fileid, getEFPath(fileid),
+                            0, 0, 4, null, null, phone.getIccCard().getAid(),
                             obtainMessage(EVENT_READ_BINARY_DONE,
                                           fileid, 0, onLoaded));
         } else {
diff --git a/telephony/java/com/android/internal/telephony/cdma/RuimCard.java b/telephony/java/com/android/internal/telephony/cdma/RuimCard.java
index 02eb86d..674fada 100644
--- a/telephony/java/com/android/internal/telephony/cdma/RuimCard.java
+++ b/telephony/java/com/android/internal/telephony/cdma/RuimCard.java
@@ -44,5 +44,13 @@
     public String getServiceProviderName () {
         return mPhone.mIccRecords.getServiceProviderName();
     }
+
+    @Override
+    protected int getCurrentApplicationIndex() {
+        if (mIccCardStatus == null) {
+            return -1;
+        }
+        return mIccCardStatus.getCdmaSubscriptionAppIndex();
+    }
  }
 
diff --git a/telephony/java/com/android/internal/telephony/cdma/RuimFileHandler.java b/telephony/java/com/android/internal/telephony/cdma/RuimFileHandler.java
index 3e2a29b..375cc07 100644
--- a/telephony/java/com/android/internal/telephony/cdma/RuimFileHandler.java
+++ b/telephony/java/com/android/internal/telephony/cdma/RuimFileHandler.java
@@ -57,8 +57,9 @@
         Message response = obtainMessage(EVENT_READ_ICON_DONE, fileid, 0,
                 onLoaded);
 
-        phone.mCM.iccIO(COMMAND_GET_RESPONSE, fileid, "img", 0, 0,
-                GET_RESPONSE_EF_IMG_SIZE_BYTES, null, null, response);
+        phone.mCM.iccIOForApp(COMMAND_GET_RESPONSE, fileid, "img", 0, 0,
+                GET_RESPONSE_EF_IMG_SIZE_BYTES, null, null,
+                phone.getIccCard().getAid(), response);
     }
 
     @Override
diff --git a/telephony/java/com/android/internal/telephony/cdma/RuimRecords.java b/telephony/java/com/android/internal/telephony/cdma/RuimRecords.java
index b057e46..17a200e 100755
--- a/telephony/java/com/android/internal/telephony/cdma/RuimRecords.java
+++ b/telephony/java/com/android/internal/telephony/cdma/RuimRecords.java
@@ -29,6 +29,7 @@
 import com.android.internal.telephony.AdnRecordCache;
 import com.android.internal.telephony.AdnRecordLoader;
 import com.android.internal.telephony.CommandsInterface;
+import com.android.internal.telephony.IccRefreshResponse;
 import com.android.internal.telephony.TelephonyProperties;
 import com.android.internal.telephony.cdma.RuimCard;
 import com.android.internal.telephony.MccTable;
@@ -300,7 +301,7 @@
                 isRecordLoadResponse = false;
                 ar = (AsyncResult)msg.obj;
                 if (ar.exception == null) {
-                    handleRuimRefresh((int[])(ar.result));
+                    handleRuimRefresh((IccRefreshResponse)ar.result);
                 }
                 break;
 
@@ -409,24 +410,30 @@
         ((CDMAPhone) phone).notifyMessageWaitingIndicator();
     }
 
-    private void handleRuimRefresh(int[] result) {
-        if (result == null || result.length == 0) {
-            if (DBG) log("handleRuimRefresh without input");
+    private void handleRuimRefresh(IccRefreshResponse refreshResponse) {
+        if (refreshResponse == null) {
+            if (DBG) log("handleRuimRefresh received without input");
             return;
         }
 
-        switch ((result[0])) {
-            case CommandsInterface.SIM_REFRESH_FILE_UPDATED:
+        if (refreshResponse.aid != null &&
+                !refreshResponse.aid.equals(phone.getIccCard().getAid())) {
+            // This is for different app. Ignore.
+            return;
+        }
+
+        switch (refreshResponse.refreshResult) {
+            case IccRefreshResponse.REFRESH_RESULT_FILE_UPDATE:
                 if (DBG) log("handleRuimRefresh with SIM_REFRESH_FILE_UPDATED");
                 adnCache.reset();
                 fetchRuimRecords();
                 break;
-            case CommandsInterface.SIM_REFRESH_INIT:
+            case IccRefreshResponse.REFRESH_RESULT_INIT:
                 if (DBG) log("handleRuimRefresh with SIM_REFRESH_INIT");
                 // need to reload all files (that we care about)
                 fetchRuimRecords();
                 break;
-            case CommandsInterface.SIM_REFRESH_RESET:
+            case IccRefreshResponse.REFRESH_RESULT_RESET:
                 if (DBG) log("handleRuimRefresh with SIM_REFRESH_RESET");
                 phone.mCM.setRadioPower(false, null);
                 /* Note: no need to call setRadioPower(true).  Assuming the desired
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnection.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnection.java
index dbb35f2..1f28280 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnection.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnection.java
@@ -22,6 +22,7 @@
 import android.text.TextUtils;
 
 import com.android.internal.telephony.DataConnection;
+import com.android.internal.telephony.DataConnectionTracker;
 import com.android.internal.telephony.Phone;
 import com.android.internal.telephony.PhoneBase;
 import com.android.internal.telephony.RILConstants;
@@ -37,8 +38,9 @@
     //***** Instance Variables
     protected int mProfileId = RILConstants.DATA_PROFILE_DEFAULT;
     //***** Constructor
-    private GsmDataConnection(PhoneBase phone, String name, int id, RetryManager rm) {
-        super(phone, name, id, rm);
+    private GsmDataConnection(PhoneBase phone, String name, int id, RetryManager rm,
+            DataConnectionTracker dct) {
+        super(phone, name, id, rm, dct);
     }
 
     /**
@@ -49,11 +51,12 @@
      * @param rm the RetryManager
      * @return GsmDataConnection that was created.
      */
-    static GsmDataConnection makeDataConnection(PhoneBase phone, int id, RetryManager rm) {
+    static GsmDataConnection makeDataConnection(PhoneBase phone, int id, RetryManager rm,
+            DataConnectionTracker dct) {
         synchronized (mCountLock) {
             mCount += 1;
         }
-        GsmDataConnection gsmDc = new GsmDataConnection(phone, "GsmDC-" + mCount, id, rm);
+        GsmDataConnection gsmDc = new GsmDataConnection(phone, "GsmDC-" + mCount, id, rm, dct);
         gsmDc.start();
         if (DBG) gsmDc.log("Made " + gsmDc.getName());
         return gsmDc;
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
index 6096cb0..66e9487 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
@@ -131,12 +131,13 @@
 
     private static final String INTENT_RECONNECT_ALARM =
         "com.android.internal.telephony.gprs-reconnect";
-    private static final String INTENT_RECONNECT_ALARM_EXTRA_TYPE = "type";
+    private static final String INTENT_RECONNECT_ALARM_EXTRA_TYPE = "reconnect_alarm_extra_type";
 
     private static final String INTENT_DATA_STALL_ALARM =
         "com.android.internal.telephony.gprs-data-stall";
 
-    static final Uri PREFERAPN_URI = Uri.parse("content://telephony/carriers/preferapn");
+    static final Uri PREFERAPN_NO_UPDATE_URI =
+                        Uri.parse("content://telephony/carriers/preferapn_no_update");
     static final String APN_ID = "apn_id";
     private boolean canSetPreferApn = false;
 
@@ -849,9 +850,28 @@
                 // Connection is still there. Try to clean up.
                 if (dcac != null) {
                     if (apnContext.getState() != State.DISCONNECTING) {
-                        if (DBG) log("cleanUpConnection: tearing down");
+                        boolean disconnectAll = false;
+                        if (Phone.APN_TYPE_DUN.equals(apnContext.getApnType())) {
+                            ApnSetting dunSetting = fetchDunApn();
+                            if (dunSetting != null &&
+                                    dunSetting.equals(apnContext.getApnSetting())) {
+                                if (DBG) log("tearing down dedicated DUN connection");
+                                // we need to tear it down - we brought it up just for dun and
+                                // other people are camped on it and now dun is done.  We need
+                                // to stop using it and let the normal apn list get used to find
+                                // connections for the remaining desired connections
+                                disconnectAll = true;
+                            }
+                        }
+                        if (DBG) {
+                            log("cleanUpConnection: tearing down" + (disconnectAll ? " all" :""));
+                        }
                         Message msg = obtainMessage(EVENT_DISCONNECT_DONE, apnContext);
-                        apnContext.getDataConnection().tearDown(apnContext.getReason(), msg);
+                        if (disconnectAll) {
+                            apnContext.getDataConnection().tearDownAll(apnContext.getReason(), msg);
+                        } else {
+                            apnContext.getDataConnection().tearDown(apnContext.getReason(), msg);
+                        }
                         apnContext.setState(State.DISCONNECTING);
                     }
                 } else {
@@ -2227,7 +2247,7 @@
 
         RetryManager rm = new RetryManager();
         int id = mUniqueIdGenerator.getAndIncrement();
-        GsmDataConnection conn = GsmDataConnection.makeDataConnection(mPhone, id, rm);
+        GsmDataConnection conn = GsmDataConnection.makeDataConnection(mPhone, id, rm, this);
         mDataConnections.put(id, conn);
         DataConnectionAc dcac = new DataConnectionAc(conn, LOG_TAG);
         int status = dcac.fullyConnectSync(mPhone.getContext(), this, conn.getHandler());
@@ -2357,26 +2377,30 @@
 
     private void setPreferredApn(int pos) {
         if (!canSetPreferApn) {
+            log("setPreferredApn: X !canSEtPreferApn");
             return;
         }
 
+        log("setPreferredApn: delete");
         ContentResolver resolver = mPhone.getContext().getContentResolver();
-        resolver.delete(PREFERAPN_URI, null, null);
+        resolver.delete(PREFERAPN_NO_UPDATE_URI, null, null);
 
         if (pos >= 0) {
+            log("setPreferredApn: insert");
             ContentValues values = new ContentValues();
             values.put(APN_ID, pos);
-            resolver.insert(PREFERAPN_URI, values);
+            resolver.insert(PREFERAPN_NO_UPDATE_URI, values);
         }
     }
 
     private ApnSetting getPreferredApn() {
         if (mAllApns.isEmpty()) {
+            log("getPreferredApn: X not found mAllApns.isEmpty");
             return null;
         }
 
         Cursor cursor = mPhone.getContext().getContentResolver().query(
-                PREFERAPN_URI, new String[] { "_id", "name", "apn" },
+                PREFERAPN_NO_UPDATE_URI, new String[] { "_id", "name", "apn" },
                 null, null, Telephony.Carriers.DEFAULT_SORT_ORDER);
 
         if (cursor != null) {
@@ -2391,6 +2415,7 @@
             pos = cursor.getInt(cursor.getColumnIndexOrThrow(Telephony.Carriers._ID));
             for(ApnSetting p:mAllApns) {
                 if (p.id == pos && p.canHandleType(mRequestedApnType)) {
+                    log("getPreferredApn: X found apnSetting" + p);
                     cursor.close();
                     return p;
                 }
@@ -2401,6 +2426,7 @@
             cursor.close();
         }
 
+        log("getPreferredApn: X not found");
         return null;
     }
 
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
index 92e16ce..0ebeabe 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
@@ -675,7 +675,9 @@
     }
 
     private void setSignalStrengthDefaultValues() {
-        mSignalStrength = new SignalStrength(99, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, true);
+        // TODO Make a constructor only has boolean gsm as parameter
+        mSignalStrength = new SignalStrength(99, -1, -1, -1, -1, -1, -1,
+                -1, -1, -1, SignalStrength.INVALID_SNR, -1, true);
     }
 
     /**
@@ -1013,7 +1015,7 @@
         int lteSignalStrength = -1;
         int lteRsrp = -1;
         int lteRsrq = -1;
-        int lteRssnr = -1;
+        int lteRssnr = SignalStrength.INVALID_SNR;
         int lteCqi = -1;
 
         if (ar.exception != null) {
diff --git a/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java b/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java
index 7c423c7..de8401e 100755
--- a/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java
+++ b/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java
@@ -39,6 +39,7 @@
 import com.android.internal.telephony.Phone;
 import com.android.internal.telephony.PhoneBase;
 import com.android.internal.telephony.SmsMessageBase;
+import com.android.internal.telephony.IccRefreshResponse;
 
 import java.util.ArrayList;
 
@@ -1049,7 +1050,7 @@
                 ar = (AsyncResult)msg.obj;
                 if (DBG) log("Sim REFRESH with exception: " + ar.exception);
                 if (ar.exception == null) {
-                    handleSimRefresh((int[])(ar.result));
+                    handleSimRefresh((IccRefreshResponse)ar.result);
                 }
                 break;
             case EVENT_GET_CFIS_DONE:
@@ -1130,27 +1131,31 @@
         }
     }
 
-    private void handleSimRefresh(int[] result) {
-        if (result == null || result.length == 0) {
-	    if (DBG) log("handleSimRefresh without input");
+    private void handleSimRefresh(IccRefreshResponse refreshResponse){
+        if (refreshResponse == null) {
+            if (DBG) log("handleSimRefresh received without input");
             return;
         }
 
-        switch ((result[0])) {
-            case CommandsInterface.SIM_REFRESH_FILE_UPDATED:
- 		if (DBG) log("handleSimRefresh with SIM_REFRESH_FILE_UPDATED");
-                // result[1] contains the EFID of the updated file.
-                int efid = result[1];
-                handleFileUpdate(efid);
+        if (refreshResponse.aid != null &&
+                !refreshResponse.aid.equals(phone.getIccCard().getAid())) {
+            // This is for different app. Ignore.
+            return;
+        }
+
+        switch (refreshResponse.refreshResult) {
+            case IccRefreshResponse.REFRESH_RESULT_FILE_UPDATE:
+                if (DBG) log("handleSimRefresh with SIM_FILE_UPDATED");
+                handleFileUpdate(refreshResponse.efId);
                 break;
-            case CommandsInterface.SIM_REFRESH_INIT:
-		if (DBG) log("handleSimRefresh with SIM_REFRESH_INIT");
+            case IccRefreshResponse.REFRESH_RESULT_INIT:
+                if (DBG) log("handleSimRefresh with SIM_REFRESH_INIT");
                 // need to reload all files (that we care about)
                 adnCache.reset();
                 fetchSimRecords();
                 break;
-            case CommandsInterface.SIM_REFRESH_RESET:
-		if (DBG) log("handleSimRefresh with SIM_REFRESH_RESET");
+            case IccRefreshResponse.REFRESH_RESULT_RESET:
+                if (DBG) log("handleSimRefresh with SIM_REFRESH_RESET");
                 phone.mCM.setRadioPower(false, null);
                 /* Note: no need to call setRadioPower(true).  Assuming the desired
                 * radio power state is still ON (as tracked by ServiceStateTracker),
@@ -1162,7 +1167,7 @@
                 break;
             default:
                 // unknown refresh operation
-		if (DBG) log("handleSimRefresh with unknown operation");
+                if (DBG) log("handleSimRefresh with unknown operation");
                 break;
         }
     }
@@ -1304,7 +1309,7 @@
 
         logv("fetchSimRecords " + recordsToLoad);
 
-        phone.mCM.getIMSI(obtainMessage(EVENT_GET_IMSI_DONE));
+        phone.mCM.getIMSIForApp(phone.getIccCard().getAid(), obtainMessage(EVENT_GET_IMSI_DONE));
         recordsToLoad++;
 
         iccFh.loadEFTransparent(EF_ICCID, obtainMessage(EVENT_GET_ICCID_DONE));
diff --git a/telephony/java/com/android/internal/telephony/gsm/SimCard.java b/telephony/java/com/android/internal/telephony/gsm/SimCard.java
index e34e10a..0e68e07 100644
--- a/telephony/java/com/android/internal/telephony/gsm/SimCard.java
+++ b/telephony/java/com/android/internal/telephony/gsm/SimCard.java
@@ -39,4 +39,11 @@
         return mPhone.mIccRecords.getServiceProviderName();
     }
 
+    @Override
+    protected int getCurrentApplicationIndex() {
+        if (mIccCardStatus == null) {
+            return -1;
+        }
+        return mIccCardStatus.getGsmUmtsSubscriptionAppIndex();
+    }
 }
diff --git a/telephony/java/com/android/internal/telephony/sip/SipCommandInterface.java b/telephony/java/com/android/internal/telephony/sip/SipCommandInterface.java
index 9201984..99f4e0f 100644
--- a/telephony/java/com/android/internal/telephony/sip/SipCommandInterface.java
+++ b/telephony/java/com/android/internal/telephony/sip/SipCommandInterface.java
@@ -84,6 +84,9 @@
     public void getIMSI(Message result) {
     }
 
+    public void getIMSIForApp(String aid, Message result) {
+    }
+
     public void getIMEI(Message result) {
     }
 
@@ -213,6 +216,9 @@
     public void iccIO (int command, int fileid, String path, int p1, int p2,
             int p3, String data, String pin2, Message result) {
     }
+    public void iccIOForApp (int command, int fileid, String path, int p1, int p2,
+            int p3, String data, String pin2, String aid, Message result) {
+    }
 
     public void getCLIR(Message result) {
     }
diff --git a/telephony/java/com/android/internal/telephony/test/SimulatedCommands.java b/telephony/java/com/android/internal/telephony/test/SimulatedCommands.java
index 60d9d24..4f61509 100644
--- a/telephony/java/com/android/internal/telephony/test/SimulatedCommands.java
+++ b/telephony/java/com/android/internal/telephony/test/SimulatedCommands.java
@@ -504,6 +504,9 @@
         resultSuccess(result, null);
     }
 
+    public void getIMSI(Message result) {
+        getIMSIForApp(null, result);
+    }
     /**
      *  returned message
      *  retMsg.obj = AsyncResult ar
@@ -511,7 +514,7 @@
      *  ar.userObject contains the original value of result.obj
      *  ar.result is String containing IMSI on success
      */
-    public void getIMSI(Message result) {
+    public void getIMSIForApp(String aid, Message result) {
         resultSuccess(result, "012345678901234");
     }
 
@@ -1042,13 +1045,18 @@
         unimplemented(result);
     }
 
+    public void iccIO(int command, int fileid, String path, int p1, int p2, int p3, String data,
+            String pin2, Message response) {
+        iccIOForApp(command, fileid, path, p1, p2, p3, data,pin2, null, response);
+    }
+
     /**
      * parameters equivalent to 27.007 AT+CRSM command
      * response.obj will be an AsyncResult
      * response.obj.userObj will be a SimIoResult on success
      */
-    public void iccIO (int command, int fileid, String path, int p1, int p2,
-                       int p3, String data, String pin2, Message result) {
+    public void iccIOForApp (int command, int fileid, String path, int p1, int p2,
+                       int p3, String data, String pin2, String aid, Message result) {
         unimplemented(result);
     }
 
diff --git a/telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberUtilsTest.java b/telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberUtilsTest.java
index a385f55..5b76272 100644
--- a/telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberUtilsTest.java
+++ b/telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberUtilsTest.java
@@ -511,8 +511,9 @@
     @SmallTest
     public void testFormatNumber() {
         assertEquals("(650) 291-0000", PhoneNumberUtils.formatNumber("650 2910000", "US"));
-        assertEquals("123-4567", PhoneNumberUtils.formatNumber("1234567", "US"));
-        assertEquals("(800) 466-4114", PhoneNumberUtils.formatNumber("800-GOOG-114", "US"));
+        assertEquals("223-4567", PhoneNumberUtils.formatNumber("2234567", "US"));
+        // formatNumber doesn't format alpha numbers, but keep them as they are.
+        assertEquals("800-GOOG-114", PhoneNumberUtils.formatNumber("800-GOOG-114", "US"));
     }
 
     @SmallTest
@@ -592,9 +593,12 @@
         // addressing that, they are also classified as "potential" emergency numbers in the US.
         assertTrue(PhoneNumberUtils.isPotentialEmergencyNumber("91112345", "US"));
         assertTrue(PhoneNumberUtils.isPotentialEmergencyNumber("11212345", "US"));
+
         // A valid mobile phone number from Singapore shouldn't be classified as an emergency number
         // in Singapore, as 911 is not an emergency number there.
-        assertFalse(PhoneNumberUtils.isPotentialEmergencyNumber("91121234", "SG"));
+        // This test fails on devices that have ecclist property preloaded with 911.
+        // assertFalse(PhoneNumberUtils.isPotentialEmergencyNumber("91121234", "SG"));
+
         // A valid fixed-line phone number from Brazil shouldn't be classified as an emergency number
         // in Brazil, as 112 is not an emergency number there.
         assertFalse(PhoneNumberUtils.isPotentialEmergencyNumber("1121234567", "BR"));
diff --git a/telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberWatcherTest.java b/telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberWatcherTest.java
index d2e573c..6f0175e 100644
--- a/telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberWatcherTest.java
+++ b/telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberWatcherTest.java
@@ -64,7 +64,7 @@
         assertEquals(result1, number.toString());
         assertEquals(result1.length(), Selection.getSelectionEnd(number));
         // Remove last 5 chars
-        final String result2 = "(650) 123";
+        final String result2 = "650-123";
         textWatcher.beforeTextChanged(number, number.length() - 4, 4, 0);
         number.delete(number.length() - 5, number.length());
         Selection.setSelection(number, number.length());
@@ -75,26 +75,26 @@
     }
 
     public void testInsertChars() {
-        final String init = "(650) 23";
-        final String expected1 = "(650) 123";
+        final String init = "650-23";
+        final String expected1 = "650-123";
         TextWatcher textWatcher = getTextWatcher();
 
         // Insert one char
         SpannableStringBuilder number = new SpannableStringBuilder(init);
-        textWatcher.beforeTextChanged(number, 4, 0, 1);
-        number.insert(4, "1"); // (6501) 23
-        Selection.setSelection(number, 5); // make the cursor at right of 1
-        textWatcher.onTextChanged(number, 4, 0, 1);
+        textWatcher.beforeTextChanged(number, 3, 0, 1);
+        number.insert(3, "1"); // 6501-23
+        Selection.setSelection(number, 4); // make the cursor at right of 1
+        textWatcher.onTextChanged(number, 3, 0, 1);
         textWatcher.afterTextChanged(number);
         assertEquals(expected1, number.toString());
         // the cursor should still at the right of '1'
-        assertEquals(7, Selection.getSelectionEnd(number));
+        assertEquals(5, Selection.getSelectionEnd(number));
 
         // Insert multiple chars
         final String expected2 = "(650) 145-6723";
-        textWatcher.beforeTextChanged(number, 7, 0, 4);
-        number.insert(7, "4567"); // change to (650) 1456723
-        Selection.setSelection(number, 11); // the cursor is at the right of '7'.
+        textWatcher.beforeTextChanged(number, 5, 0, 4);
+        number.insert(5, "4567"); // change to 650-1456723
+        Selection.setSelection(number, 9); // the cursor is at the right of '7'.
         textWatcher.onTextChanged(number, 7, 0, 4);
         textWatcher.afterTextChanged(number);
         assertEquals(expected2, number.toString());
@@ -168,7 +168,7 @@
         textWatcher.onTextChanged(number, 0, len, 0);
         textWatcher.afterTextChanged(number);
 
-        final String expected2 = "(650) 123-4";
+        final String expected2 = "650-1234";
         number = new SpannableStringBuilder(init);
         textWatcher.beforeTextChanged(number, 9, 0, 1);
         number.insert(9, "4"); // (650) 1234
diff --git a/telephony/tests/telephonytests/src/com/android/internal/telephony/gsm/UsimDataDownloadCommands.java b/telephony/tests/telephonytests/src/com/android/internal/telephony/gsm/UsimDataDownloadCommands.java
index b385cee..ea6836d 100644
--- a/telephony/tests/telephonytests/src/com/android/internal/telephony/gsm/UsimDataDownloadCommands.java
+++ b/telephony/tests/telephonytests/src/com/android/internal/telephony/gsm/UsimDataDownloadCommands.java
@@ -612,4 +612,13 @@
     @Override
     public void getVoiceRadioTechnology(Message response) {
     }
+
+    @Override
+    public void getIMSIForApp(String aid, Message result) {
+    }
+
+    @Override
+    public void iccIOForApp(int command, int fileid, String path, int p1, int p2, int p3,
+            String data, String pin2, String aid, Message response) {
+    }
 }
diff --git a/test-runner/src/android/test/mock/MockContentProvider.java b/test-runner/src/android/test/mock/MockContentProvider.java
index e0ce322..a8c388e 100644
--- a/test-runner/src/android/test/mock/MockContentProvider.java
+++ b/test-runner/src/android/test/mock/MockContentProvider.java
@@ -21,6 +21,7 @@
 import android.content.ContentProviderResult;
 import android.content.ContentValues;
 import android.content.Context;
+import android.content.ICancellationSignal;
 import android.content.IContentProvider;
 import android.content.OperationApplicationException;
 import android.content.pm.PathPermission;
@@ -92,7 +93,7 @@
 
         @Override
         public Cursor query(Uri url, String[] projection, String selection, String[] selectionArgs,
-                String sortOrder) throws RemoteException {
+                String sortOrder, ICancellationSignal cancellationSignal) throws RemoteException {
             return MockContentProvider.this.query(url, projection, selection,
                     selectionArgs, sortOrder);
         }
@@ -124,6 +125,11 @@
                 throws RemoteException, FileNotFoundException {
             return MockContentProvider.this.openTypedAssetFile(url, mimeType, opts);
         }
+
+        @Override
+        public ICancellationSignal createCancellationSignal() throws RemoteException {
+            return null;
+        }
     }
     private final InversionIContentProvider mIContentProvider = new InversionIContentProvider();
 
diff --git a/test-runner/src/android/test/mock/MockIContentProvider.java b/test-runner/src/android/test/mock/MockIContentProvider.java
index b7733a4..1aa0448 100644
--- a/test-runner/src/android/test/mock/MockIContentProvider.java
+++ b/test-runner/src/android/test/mock/MockIContentProvider.java
@@ -21,6 +21,7 @@
 import android.content.ContentValues;
 import android.content.EntityIterator;
 import android.content.IContentProvider;
+import android.content.ICancellationSignal;
 import android.content.res.AssetFileDescriptor;
 import android.database.Cursor;
 import android.net.Uri;
@@ -72,7 +73,7 @@
     }
 
     public Cursor query(Uri url, String[] projection, String selection, String[] selectionArgs,
-            String sortOrder) {
+            String sortOrder, ICancellationSignal cancellationSignal) {
         throw new UnsupportedOperationException("unimplemented mock method");
     }
 
@@ -103,4 +104,9 @@
             throws RemoteException, FileNotFoundException {
         throw new UnsupportedOperationException("unimplemented mock method");
     }
+
+    @Override
+    public ICancellationSignal createCancellationSignal() throws RemoteException {
+        throw new UnsupportedOperationException("unimplemented mock method");
+    }
 }
diff --git a/tests/ActivityTests/res/anim/slow_enter.xml b/tests/ActivityTests/res/anim/slow_enter.xml
new file mode 100644
index 0000000..0309643
--- /dev/null
+++ b/tests/ActivityTests/res/anim/slow_enter.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 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.
+*/
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+        android:shareInterpolator="false" >
+    <scale android:fromXScale="0.9" android:toXScale="1.5"
+           android:fromYScale="0.9" android:toYScale="1.5"
+           android:pivotX="50%" android:pivotY="50%"
+           android:interpolator="@interpolator/slow_enter"
+           android:duration="40000" />
+    <alpha android:fromAlpha="0.0" android:toAlpha="1.0"
+            android:interpolator="@android:interpolator/decelerate_cubic"
+            android:duration="1000" />
+</set>
diff --git a/tests/ActivityTests/res/anim/slow_exit.xml b/tests/ActivityTests/res/anim/slow_exit.xml
new file mode 100644
index 0000000..6cd3114
--- /dev/null
+++ b/tests/ActivityTests/res/anim/slow_exit.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 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.
+*/
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+        android:shareInterpolator="false" >
+    <scale android:fromXScale="1.0" android:toXScale="0.9"
+            android:fromYScale="1.0" android:toYScale="0.9"
+            android:pivotX="50%" android:pivotY="50%"
+            android:interpolator="@android:interpolator/decelerate_quint"
+            android:duration="300" />
+    <alpha android:fromAlpha="1.0" android:toAlpha="0.0"
+            android:interpolator="@android:interpolator/decelerate_cubic"
+            android:duration="300"/>
+</set>
diff --git a/tests/ActivityTests/res/interpolator/slow_enter.xml b/tests/ActivityTests/res/interpolator/slow_enter.xml
new file mode 100644
index 0000000..ddab1aa
--- /dev/null
+++ b/tests/ActivityTests/res/interpolator/slow_enter.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 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.
+*/
+-->
+
+<cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
+    android:cycles="10" />
diff --git a/tests/ActivityTests/res/values/themes.xml b/tests/ActivityTests/res/values/themes.xml
new file mode 100644
index 0000000..67f5938
--- /dev/null
+++ b/tests/ActivityTests/res/values/themes.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<resources>
+    <style name="SlowDialog" parent="@android:style/Theme.Holo.Dialog">
+        <item name="android:windowAnimationStyle">@style/SlowDialog</item>
+    </style>
+    <style name="SlowDialog">
+        <item name="android:windowEnterAnimation">@anim/slow_enter</item>
+        <item name="android:windowExitAnimation">@anim/slow_exit</item>
+    </style>
+</resources>
diff --git a/tests/ActivityTests/src/com/google/android/test/activity/ActivityTestMain.java b/tests/ActivityTests/src/com/google/android/test/activity/ActivityTestMain.java
index 583c13c..ae42e29 100644
--- a/tests/ActivityTests/src/com/google/android/test/activity/ActivityTestMain.java
+++ b/tests/ActivityTests/src/com/google/android/test/activity/ActivityTestMain.java
@@ -22,6 +22,7 @@
 import android.app.Activity;
 import android.app.ActivityManager;
 import android.app.ActivityThread;
+import android.app.AlertDialog;
 import android.app.Application;
 import android.content.ActivityNotFoundException;
 import android.os.Bundle;
@@ -35,6 +36,8 @@
 import android.widget.TextView;
 import android.widget.ScrollView;
 import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuItem;
 import android.view.View;
 import android.content.Context;
 import android.content.pm.ApplicationInfo;
@@ -101,6 +104,20 @@
     }
 
     @Override
+    public boolean onCreateOptionsMenu(Menu menu) {
+        menu.add("Animate!").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
+            @Override public boolean onMenuItemClick(MenuItem item) {
+                AlertDialog.Builder builder = new AlertDialog.Builder(ActivityTestMain.this,
+                        R.style.SlowDialog);
+                builder.setTitle("This is a title");
+                builder.show();
+                return true;
+            }
+        });
+        return true;
+    }
+
+    @Override
     protected void onStart() {
         super.onStart();
         buildUi();
diff --git a/tests/BiDiTests/res/layout/basic.xml b/tests/BiDiTests/res/layout/basic.xml
index f503658..7d4d4db 100644
--- a/tests/BiDiTests/res/layout/basic.xml
+++ b/tests/BiDiTests/res/layout/basic.xml
@@ -19,6 +19,10 @@
         android:layout_width="fill_parent"
         android:layout_height="fill_parent">
 
+    <ScrollView
+            android:layout_width="fill_parent"
+            android:layout_height="fill_parent">
+
     <LinearLayout android:orientation="vertical"
                   android:layout_width="match_parent"
                   android:layout_height="match_parent">
@@ -131,4 +135,6 @@
 
     </LinearLayout>
 
+    </ScrollView>
+
 </FrameLayout>
diff --git a/tests/BiDiTests/res/layout/grid_layout_locale.xml b/tests/BiDiTests/res/layout/grid_layout_locale.xml
new file mode 100644
index 0000000..4198898
--- /dev/null
+++ b/tests/BiDiTests/res/layout/grid_layout_locale.xml
@@ -0,0 +1,74 @@
+<?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.
+-->
+
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:id="@+id/grid_layout_locale"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent">
+
+
+    <GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:useDefaultMargins="true"
+            android:alignmentMode="alignBounds"
+            android:columnOrderPreserved="false"
+            android:columnCount="4"
+            android:layoutDirection="locale">
+
+        <TextView
+                android:text="Email setup"
+                android:textSize="32dip"
+
+                android:layout_columnSpan="4"
+                android:layout_gravity="center_horizontal"/>
+
+        <TextView
+                android:text="You can configure email in just a few steps:"
+                android:textSize="16dip"
+                android:layout_columnSpan="4"
+                android:layout_gravity="left"/>
+
+        <TextView
+                android:text="Email address:"
+                android:layout_gravity="right"/>
+
+        <EditText
+                android:ems="10"/>
+
+        <TextView
+                android:text="Password:"
+                android:layout_column="0"
+                android:layout_gravity="right"/>
+
+        <EditText
+                android:ems="8"/>
+
+        <Space
+                android:layout_row="4"
+                android:layout_column="0"
+                android:layout_columnSpan="3"
+                android:layout_gravity="fill"
+                />
+
+        <Button
+                android:text="Next"
+                android:layout_row="5"
+                android:layout_column="3"/>
+
+    </GridLayout>
+
+</FrameLayout>
\ No newline at end of file
diff --git a/tests/BiDiTests/res/layout/grid_layout_ltr.xml b/tests/BiDiTests/res/layout/grid_layout_ltr.xml
new file mode 100644
index 0000000..46ea658
--- /dev/null
+++ b/tests/BiDiTests/res/layout/grid_layout_ltr.xml
@@ -0,0 +1,74 @@
+<?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.
+-->
+
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:id="@+id/grid_layout_ltr"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent">
+
+
+    <GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:useDefaultMargins="true"
+            android:alignmentMode="alignBounds"
+            android:columnOrderPreserved="false"
+            android:columnCount="4"
+            android:layoutDirection="ltr">
+
+        <TextView
+                android:text="Email setup"
+                android:textSize="32dip"
+
+                android:layout_columnSpan="4"
+                android:layout_gravity="center_horizontal"/>
+
+        <TextView
+                android:text="You can configure email in just a few steps:"
+                android:textSize="16dip"
+                android:layout_columnSpan="4"
+                android:layout_gravity="left"/>
+
+        <TextView
+                android:text="Email address:"
+                android:layout_gravity="right"/>
+
+        <EditText
+                android:ems="10"/>
+
+        <TextView
+                android:text="Password:"
+                android:layout_column="0"
+                android:layout_gravity="right"/>
+
+        <EditText
+                android:ems="8"/>
+
+        <Space
+                android:layout_row="4"
+                android:layout_column="0"
+                android:layout_columnSpan="3"
+                android:layout_gravity="fill"
+                />
+
+        <Button
+                android:text="Next"
+                android:layout_row="5"
+                android:layout_column="3"/>
+
+    </GridLayout>
+
+</FrameLayout>
\ No newline at end of file
diff --git a/tests/BiDiTests/res/layout/grid_layout_rtl.xml b/tests/BiDiTests/res/layout/grid_layout_rtl.xml
new file mode 100644
index 0000000..947e13c
--- /dev/null
+++ b/tests/BiDiTests/res/layout/grid_layout_rtl.xml
@@ -0,0 +1,74 @@
+<?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.
+-->
+
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:id="@+id/grid_layout_rtl"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent">
+
+
+    <GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:useDefaultMargins="true"
+            android:alignmentMode="alignBounds"
+            android:columnOrderPreserved="false"
+            android:columnCount="4"
+            android:layoutDirection="rtl">
+
+        <TextView
+                android:text="Email setup"
+                android:textSize="32dip"
+
+                android:layout_columnSpan="4"
+                android:layout_gravity="center_horizontal"/>
+
+        <TextView
+                android:text="You can configure email in just a few steps:"
+                android:textSize="16dip"
+                android:layout_columnSpan="4"
+                android:layout_gravity="left"/>
+
+        <TextView
+                android:text="Email address:"
+                android:layout_gravity="right"/>
+
+        <EditText
+                android:ems="10"/>
+
+        <TextView
+                android:text="Password:"
+                android:layout_column="0"
+                android:layout_gravity="right"/>
+
+        <EditText
+                android:ems="8"/>
+
+        <Space
+                android:layout_row="4"
+                android:layout_column="0"
+                android:layout_columnSpan="3"
+                android:layout_gravity="fill"
+                />
+
+        <Button
+                android:text="Next"
+                android:layout_row="5"
+                android:layout_column="3"/>
+
+    </GridLayout>
+
+</FrameLayout>
\ No newline at end of file
diff --git a/tests/BiDiTests/res/values/strings.xml b/tests/BiDiTests/res/values/strings.xml
index b1f5e50e..233cd0d 100644
--- a/tests/BiDiTests/res/values/strings.xml
+++ b/tests/BiDiTests/res/values/strings.xml
@@ -24,11 +24,11 @@
     <string name="button_before_text">Start</string>
     <string name="button_requestlayout_text">Request Layout</string>
     <string name="button_alert_dialog_text">AlertDialog</string>
-    <string name="textview_text">This is a text for a TextView</string>
-    <string name="textview_ltr_text">This is a text for a LTR TextView</string>
-    <string name="textview_rtl_text">This is a text for a RTL TextView</string>
-    <string name="textview_default_text">This is a text for a default TextView</string>
-    <string name="textview_password_default_text">This is a text for a password TextView</string>
+    <string name="textview_text">TextView</string>
+    <string name="textview_ltr_text">LTR TextView</string>
+    <string name="textview_rtl_text">RTL TextView</string>
+    <string name="textview_default_text">Default TextView</string>
+    <string name="textview_password_default_text">Password TextView</string>
     <string name="edittext_text">mmmmmmmmmmmmmmmmmmmmmmmm</string>
     <string name="normal_text">Normal String</string>
     <string name="normal_long_text">mmmmmmmmmmmmmmmmmmmmmmmm</string>
@@ -50,5 +50,6 @@
     <string name="rtl">"والحق أن تترك ونص"</string>
     <string name="composing">"\u0644\u0627"</string>
     <string name="url">www.amazon.co.uk/gp/aw/h.html/275-8912818-8203452</string>
+    <string name="pointer_location" msgid="6084434787496938001">"ตำแหน่งของตัวชี้"</string>
 </resources>
 
diff --git a/tests/BiDiTests/src/com/android/bidi/BiDiTestActivity.java b/tests/BiDiTests/src/com/android/bidi/BiDiTestActivity.java
index b45b98f..4d7ace1 100644
--- a/tests/BiDiTests/src/com/android/bidi/BiDiTestActivity.java
+++ b/tests/BiDiTests/src/com/android/bidi/BiDiTestActivity.java
@@ -108,6 +108,10 @@
         addItem(result, "Linear RTL", BiDiTestLinearLayoutRtl.class, R.id.linear_layout_rtl);
         addItem(result, "Linear LOC", BiDiTestLinearLayoutLocale.class, R.id.linear_layout_locale);
 
+        addItem(result, "Grid LTR", BiDiTestGridLayoutLtr.class, R.id.grid_layout_ltr);
+        addItem(result, "Grid RTL", BiDiTestGridLayoutRtl.class, R.id.grid_layout_rtl);
+        addItem(result, "Grid LOC", BiDiTestGridLayoutLocale.class, R.id.grid_layout_locale);
+
         addItem(result, "Frame LTR", BiDiTestFrameLayoutLtr.class, R.id.frame_layout_ltr);
         addItem(result, "Frame RTL", BiDiTestFrameLayoutRtl.class, R.id.frame_layout_rtl);
         addItem(result, "Frame LOC", BiDiTestFrameLayoutLocale.class, R.id.frame_layout_locale);
diff --git a/tests/BiDiTests/src/com/android/bidi/BiDiTestGridLayoutLocale.java b/tests/BiDiTests/src/com/android/bidi/BiDiTestGridLayoutLocale.java
new file mode 100644
index 0000000..16e61ad
--- /dev/null
+++ b/tests/BiDiTests/src/com/android/bidi/BiDiTestGridLayoutLocale.java
@@ -0,0 +1,32 @@
+/*
+ * 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.bidi;
+
+import android.app.Fragment;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+public class BiDiTestGridLayoutLocale extends Fragment {
+
+    @Override
+    public View onCreateView(LayoutInflater inflater, ViewGroup container,
+            Bundle savedInstanceState) {
+        return inflater.inflate(R.layout.grid_layout_locale, container, false);
+    }
+}
diff --git a/tests/BiDiTests/src/com/android/bidi/BiDiTestGridLayoutLtr.java b/tests/BiDiTests/src/com/android/bidi/BiDiTestGridLayoutLtr.java
new file mode 100644
index 0000000..df6c9fe
--- /dev/null
+++ b/tests/BiDiTests/src/com/android/bidi/BiDiTestGridLayoutLtr.java
@@ -0,0 +1,32 @@
+/*
+ * 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.bidi;
+
+import android.app.Fragment;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+public class BiDiTestGridLayoutLtr extends Fragment {
+
+    @Override
+    public View onCreateView(LayoutInflater inflater, ViewGroup container,
+            Bundle savedInstanceState) {
+        return inflater.inflate(R.layout.grid_layout_ltr, container, false);
+    }
+}
diff --git a/tests/BiDiTests/src/com/android/bidi/BiDiTestGridLayoutRtl.java b/tests/BiDiTests/src/com/android/bidi/BiDiTestGridLayoutRtl.java
new file mode 100644
index 0000000..8bed113
--- /dev/null
+++ b/tests/BiDiTests/src/com/android/bidi/BiDiTestGridLayoutRtl.java
@@ -0,0 +1,32 @@
+/*
+ * 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.bidi;
+
+import android.app.Fragment;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+public class BiDiTestGridLayoutRtl extends Fragment {
+
+    @Override
+    public View onCreateView(LayoutInflater inflater, ViewGroup container,
+            Bundle savedInstanceState) {
+        return inflater.inflate(R.layout.grid_layout_rtl, container, false);
+    }
+}
diff --git a/tests/BiDiTests/src/com/android/bidi/BiDiTestView.java b/tests/BiDiTests/src/com/android/bidi/BiDiTestView.java
index 0126dea..0b1974a 100644
--- a/tests/BiDiTests/src/com/android/bidi/BiDiTestView.java
+++ b/tests/BiDiTests/src/com/android/bidi/BiDiTestView.java
@@ -51,6 +51,7 @@
     private String MIXED_TEXT_1;
     private String HEBREW_TEXT;
     private String RTL_TEXT;
+    private String THAI_TEXT;
 
     private int currentTextSize;
 
@@ -82,6 +83,7 @@
         MIXED_TEXT_1 = context.getString(R.string.mixed_text_1);
         HEBREW_TEXT = context.getString(R.string.hebrew_text);
         RTL_TEXT = context.getString(R.string.rtl);
+        THAI_TEXT = context.getString(R.string.pointer_location);
     }
 
     public void setCurrentTextSize(int size) {
@@ -134,6 +136,10 @@
         // Test Hebrew
         deltaX = testString(canvas, RTL_TEXT, ORIGIN, ORIGIN + 14 * currentTextSize,
                 false, false,  Paint.DIRECTION_RTL, currentTextSize);
+
+        // Test Thai
+        deltaX = testString(canvas, THAI_TEXT, ORIGIN, ORIGIN + 16 * currentTextSize,
+                false, false,  Paint.DIRECTION_LTR, currentTextSize);
     }
 
     private int testString(Canvas canvas, String text, int x, int y,
diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/FsUtils.java b/tests/DumpRenderTree/src/com/android/dumprendertree/FsUtils.java
index 5e2a9fd..b7d2c26 100644
--- a/tests/DumpRenderTree/src/com/android/dumprendertree/FsUtils.java
+++ b/tests/DumpRenderTree/src/com/android/dumprendertree/FsUtils.java
@@ -141,7 +141,7 @@
             } else if (!path.startsWith(HTTP_LOCAL_TESTS_PREFIX)
                     && !path.startsWith(HTTP_MEDIA_TESTS_PREFIX)
                     && !path.startsWith(HTTP_WML_TESTS_PREFIX)) {
-                url = "http://127.0.0.1:18000/" + path.substring(HTTP_TESTS_PREFIX.length());
+                url = "http://127.0.0.1:8000/" + path.substring(HTTP_TESTS_PREFIX.length());
             } else {
                 url = "file://" + path;
             }
diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/forwarder/ForwardService.java b/tests/DumpRenderTree/src/com/android/dumprendertree/forwarder/ForwardService.java
index 7a277d7..25dd04fd 100644
--- a/tests/DumpRenderTree/src/com/android/dumprendertree/forwarder/ForwardService.java
+++ b/tests/DumpRenderTree/src/com/android/dumprendertree/forwarder/ForwardService.java
@@ -26,7 +26,7 @@
 
 public class ForwardService {
 
-    private ForwardServer fs18000, fs8080, fs8443;
+    private ForwardServer fs8000, fs8080, fs8443;
 
     private static ForwardService inst;
 
@@ -40,7 +40,7 @@
     private ForwardService() {
         int addr = getForwardHostAddr();
         if (addr != -1) {
-            fs18000 = new ForwardServer(18000, addr, 8000);
+            fs8000 = new ForwardServer(8000, addr, 8000);
             fs8080 = new ForwardServer(8080, addr, 8080);
             fs8443 = new ForwardServer(8443, addr, 8443);
         }
@@ -55,8 +55,8 @@
 
     public void startForwardService() {
         try {
-            if (fs18000 != null)
-                fs18000.start();
+            if (fs8000 != null)
+                fs8000.start();
             if (fs8080 != null)
                 fs8080.start();
             if (fs8443 != null)
@@ -68,9 +68,9 @@
     }
 
     public void stopForwardService() {
-        if (fs18000 != null) {
-            fs18000.stop();
-            fs18000 = null;
+        if (fs8000 != null) {
+            fs8000.stop();
+            fs8000 = null;
         }
         if (fs8080 != null) {
             fs8080.stop();
diff --git a/tests/HwAccelerationTest/AndroidManifest.xml b/tests/HwAccelerationTest/AndroidManifest.xml
index 929b103..3904c21 100644
--- a/tests/HwAccelerationTest/AndroidManifest.xml
+++ b/tests/HwAccelerationTest/AndroidManifest.xml
@@ -30,6 +30,26 @@
         android:label="HwUi"
         android:hardwareAccelerated="true">
 
+        <meta-data android:name="android.graphics.renderThread" android:value="true" />
+
+        <activity
+                android:name="PaintDrawFilterActivity"
+                android:label="_DrawFilter">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+
+        <activity
+                android:name="ClipRegionActivity"
+                android:label="_ClipRegion">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+        
         <activity
                 android:name="DisplayListLayersActivity"
                 android:label="__DisplayListLayers">
@@ -38,6 +58,15 @@
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
+
+        <activity
+                android:name="MatrixActivity"
+                android:label="_Matrix">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
         
         <activity
                 android:name="TextFadeActivity"
@@ -466,6 +495,16 @@
         </activity>
 
         <activity
+                android:name="PosTextActivity"
+                android:label="_PosText"
+                android:theme="@android:style/Theme.NoTitleBar">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+
+        <activity
                 android:name="ListActivity"
                 android:label="__List">
             <intent-filter>
diff --git a/tests/HwAccelerationTest/res/values/strings.xml b/tests/HwAccelerationTest/res/values/strings.xml
new file mode 100644
index 0000000..69e58aa
--- /dev/null
+++ b/tests/HwAccelerationTest/res/values/strings.xml
@@ -0,0 +1,19 @@
+<?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.
+-->
+
+<resources>
+    <string name="complex_string">"ตำแหน่งของตัวชี้"</string>
+</resources>
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ClipRegionActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ClipRegionActivity.java
new file mode 100644
index 0000000..b2a508b
--- /dev/null
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ClipRegionActivity.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2010 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.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.Canvas;
+import android.graphics.Paint;
+import android.graphics.Path;
+import android.graphics.PorterDuff;
+import android.graphics.PorterDuffXfermode;
+import android.graphics.Region;
+import android.os.Bundle;
+import android.view.View;
+
+@SuppressWarnings({"UnusedDeclaration"})
+public class ClipRegionActivity extends Activity {
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        final RegionView view = new RegionView(this);
+        setContentView(view);
+    }
+
+    public static class RegionView extends View {
+        public RegionView(Context c) {
+            super(c);
+        }
+
+        @Override
+        protected void onDraw(Canvas canvas) {
+            super.onDraw(canvas);
+
+            canvas.save();
+            canvas.clipRect(100.0f, 100.0f, getWidth() - 100.0f, getHeight() - 100.0f,
+                    Region.Op.DIFFERENCE);
+            canvas.drawARGB(255, 255, 0, 0);
+            canvas.restore();
+        }
+    }
+}
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/MatrixActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/MatrixActivity.java
new file mode 100644
index 0000000..1906b9d
--- /dev/null
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/MatrixActivity.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2010 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.Paint;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+
+@SuppressWarnings({"UnusedDeclaration"})
+public class MatrixActivity extends Activity {
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(new MatrixView(this));
+    }
+
+    static class MatrixView extends View {
+        MatrixView(Context c) {
+            super(c);
+        }
+
+        @Override
+        protected void onDraw(Canvas canvas) {
+            super.onDraw(canvas);
+            canvas.drawRGB(255, 255, 255);
+
+            Log.d("Matrix", "m1=" + canvas.getMatrix());
+
+            canvas.save();
+            canvas.translate(10.0f, 10.0f);
+            Log.d("Matrix", "m2=" + canvas.getMatrix());
+            canvas.translate(20.0f, 20.0f);
+            Log.d("Matrix", "m3=" + canvas.getMatrix());
+            canvas.restore();
+        }
+    }
+}
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/PaintDrawFilterActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/PaintDrawFilterActivity.java
new file mode 100644
index 0000000..8523272
--- /dev/null
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/PaintDrawFilterActivity.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2010 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.Paint;
+import android.graphics.PaintFlagsDrawFilter;
+import android.os.Bundle;
+import android.view.View;
+
+@SuppressWarnings({"UnusedDeclaration"})
+public class PaintDrawFilterActivity extends Activity {
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(new CustomTextView(this));
+    }
+
+    static class CustomTextView extends View {
+        private final Paint mMediumPaint;
+        private final PaintFlagsDrawFilter mDrawFilter;
+
+        CustomTextView(Context c) {
+            super(c);
+
+            mMediumPaint = new Paint();
+            mMediumPaint.setAntiAlias(true);
+            mMediumPaint.setColor(0xff000000);
+            mMediumPaint.setFakeBoldText(true);
+            mMediumPaint.setTextSize(24.0f);
+
+            mDrawFilter = new PaintFlagsDrawFilter(
+                    Paint.FAKE_BOLD_TEXT_FLAG, Paint.UNDERLINE_TEXT_FLAG);
+        }
+
+        @Override
+        protected void onDraw(Canvas canvas) {
+            super.onDraw(canvas);
+            canvas.drawRGB(255, 255, 255);
+
+            canvas.setDrawFilter(null);
+            canvas.drawText("Hello OpenGL renderer!", 100, 120, mMediumPaint);
+            canvas.setDrawFilter(mDrawFilter);
+            canvas.drawText("Hello OpenGL renderer!", 100, 220, mMediumPaint);
+        }
+    }
+}
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/PosTextActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/PosTextActivity.java
new file mode 100644
index 0000000..1c868d2
--- /dev/null
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/PosTextActivity.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2010 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.Paint;
+import android.os.Bundle;
+import android.view.View;
+
+@SuppressWarnings({"UnusedDeclaration"})
+public class PosTextActivity extends Activity {
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(new CustomTextView(this));
+    }
+
+    static class CustomTextView extends View {
+        private final Paint mLargePaint;
+        private final String mText;
+        private final float[] mPos;
+
+        CustomTextView(Context c) {
+            super(c);
+
+            mText = c.getResources().getString(R.string.complex_string);
+            mPos = new float[mText.length() * 2];
+            for (int i = 0; i < mPos.length; i += 2) {
+                mPos[i] = i * 30.0f;
+                mPos[i + 1] = i * 10.0f;
+            }
+
+            mLargePaint = new Paint();
+            mLargePaint.setAntiAlias(true);
+            mLargePaint.setTextSize(36.0f);
+        }
+
+        @Override
+        protected void onDraw(Canvas canvas) {
+            super.onDraw(canvas);
+            canvas.drawRGB(255, 255, 255);
+            
+            canvas.save();
+
+            canvas.drawLine(100.0f, 0.0f, 100.0f, getHeight(), mLargePaint);
+            
+            canvas.translate(100.0f, 100.0f);
+            mLargePaint.setTextAlign(Paint.Align.LEFT);
+            canvas.drawPosText(mText, mPos, mLargePaint);
+
+            canvas.translate(0.0f, 50.0f);
+            mLargePaint.setTextAlign(Paint.Align.CENTER);
+            canvas.drawPosText(mText, mPos, mLargePaint);
+
+            canvas.translate(0.0f, 50.0f);
+            mLargePaint.setTextAlign(Paint.Align.RIGHT);
+            canvas.drawPosText(mText, mPos, mLargePaint);
+
+            canvas.restore();
+        }
+    }
+}
diff --git a/tests/RenderScriptTests/ComputePerf/src/com/example/android/rs/computeperf/ComputePerf.java b/tests/RenderScriptTests/ComputePerf/src/com/example/android/rs/computeperf/ComputePerf.java
index f7abe8b..5446f66 100644
--- a/tests/RenderScriptTests/ComputePerf/src/com/example/android/rs/computeperf/ComputePerf.java
+++ b/tests/RenderScriptTests/ComputePerf/src/com/example/android/rs/computeperf/ComputePerf.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 The Android Open Source Project
+ * Copyright (C) 2011-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.
@@ -22,10 +22,10 @@
 import android.graphics.Bitmap;
 import android.renderscript.RenderScript;
 import android.renderscript.Allocation;
+import android.util.Log;
 import android.widget.ImageView;
 
 public class ComputePerf extends Activity {
-
     private LaunchTest mLT;
     private Mandelbrot mMandel;
     private RenderScript mRS;
@@ -35,14 +35,28 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);
 
+        final int numTries = 100;
+
+        long timesXLW = 0;
+        long timesXYW = 0;
+
         mRS = RenderScript.create(this);
         mLT = new LaunchTest(mRS, getResources());
-        mLT.run();
-        mLT.run();
+        mLT.XLW();
+        mLT.XYW();
+        for (int i = 0; i < numTries; i++) {
+            timesXLW += mLT.XLW();
+            timesXYW += mLT.XYW();
+        }
+
+        timesXLW /= numTries;
+        timesXYW /= numTries;
+
+        // XLW and XYW running times should match pretty closely
+        Log.v("ComputePerf", "xlw launch test " + timesXLW + "ms");
+        Log.v("ComputePerf", "xyw launch test " + timesXYW + "ms");
 
         mMandel = new Mandelbrot(mRS, getResources());
         mMandel.run();
-
     }
-
 }
diff --git a/tests/RenderScriptTests/ComputePerf/src/com/example/android/rs/computeperf/LaunchTest.java b/tests/RenderScriptTests/ComputePerf/src/com/example/android/rs/computeperf/LaunchTest.java
index 0c29ce1..e2312ba 100644
--- a/tests/RenderScriptTests/ComputePerf/src/com/example/android/rs/computeperf/LaunchTest.java
+++ b/tests/RenderScriptTests/ComputePerf/src/com/example/android/rs/computeperf/LaunchTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 The Android Open Source Project
+ * Copyright (C) 2011-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.
@@ -19,7 +19,7 @@
 import android.content.res.Resources;
 import android.renderscript.*;
 
-public class LaunchTest implements Runnable {
+public class LaunchTest {
     private RenderScript mRS;
     private Allocation mAllocationX;
     private Allocation mAllocationXY;
@@ -40,18 +40,19 @@
         mScript_xlw.bind_buf(mAllocationXY);
     }
 
-    public void run() {
+    public long XLW() {
         long t = java.lang.System.currentTimeMillis();
         mScript_xlw.forEach_root(mAllocationX);
         mRS.finish();
         t = java.lang.System.currentTimeMillis() - t;
-        android.util.Log.v("ComputePerf", "xlw launch test  ms " + t);
+        return t;
+    }
 
-        t = java.lang.System.currentTimeMillis();
+    public long XYW() {
+        long t = java.lang.System.currentTimeMillis();
         mScript_xyw.forEach_root(mAllocationXY);
         mRS.finish();
         t = java.lang.System.currentTimeMillis() - t;
-        android.util.Log.v("ComputePerf", "xyw launch test  ms " + t);
+        return t;
     }
-
 }
diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingTest.java b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingTest.java
index d2298da..912d863 100644
--- a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingTest.java
+++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingTest.java
@@ -41,6 +41,7 @@
 public class ImageProcessingTest extends ActivityInstrumentationTestCase2<ImageProcessingActivity> {
     private final String TAG = "ImageProcessingTest";
     private final String RESULT_FILE = "image_processing_result.txt";
+    private int ITERATION = 5;
     private ImageProcessingActivity mAct;
 
     public ImageProcessingTest() {
@@ -63,9 +64,8 @@
      */
     @LargeTest
     public void testImageProcessingBench() {
-        long t = mAct.getBenchmark();
-        Log.v(TAG, "t = " + t);
-
+        long t = 0;
+        long sum = 0;
         // write result into a file
         File externalStorage = Environment.getExternalStorageDirectory();
         if (!externalStorage.canWrite()) {
@@ -75,10 +75,18 @@
         File resultFile = new File(externalStorage, RESULT_FILE);
         resultFile.setWritable(true, false);
         try {
-            BufferedWriter results = new BufferedWriter(new FileWriter(resultFile));
-            results.write("Renderscript frame time core: " + t + " ms");
-            results.close();
+            BufferedWriter rsWriter = new BufferedWriter(new FileWriter(resultFile));
             Log.v(TAG, "Saved results in: " + resultFile.getAbsolutePath());
+            for (int i = 0; i < ITERATION; i++ ) {
+                t = mAct.getBenchmark();
+                sum += t;
+                rsWriter.write("Renderscript frame time core: " + t + " ms\n");
+                Log.v(TAG, "RenderScript framew time core: " + t + " ms");
+            }
+            long avgValue = sum/ITERATION;
+            rsWriter.write("Average frame time: " + avgValue + " ms\n");
+            Log.v(TAG, "Average frame time: " + avgValue + " ms");
+            rsWriter.close();
         } catch (IOException e) {
             Log.v(TAG, "Unable to write result file " + e.getMessage());
         }
diff --git a/tests/RenderScriptTests/tests/src/com/android/rs/test/RSTestCore.java b/tests/RenderScriptTests/tests/src/com/android/rs/test/RSTestCore.java
index c038478..2293678 100644
--- a/tests/RenderScriptTests/tests/src/com/android/rs/test/RSTestCore.java
+++ b/tests/RenderScriptTests/tests/src/com/android/rs/test/RSTestCore.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008-2011 The Android Open Source Project
+ * Copyright (C) 2008-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.
@@ -65,6 +65,7 @@
         unitTests = new ArrayList<UnitTest>();
 
         unitTests.add(new UT_primitives(this, mRes, mCtx));
+        unitTests.add(new UT_constant(this, mRes, mCtx));
         unitTests.add(new UT_vector(this, mRes, mCtx));
         unitTests.add(new UT_rsdebug(this, mRes, mCtx));
         unitTests.add(new UT_rstime(this, mRes, mCtx));
@@ -72,6 +73,8 @@
         unitTests.add(new UT_alloc(this, mRes, mCtx));
         unitTests.add(new UT_refcount(this, mRes, mCtx));
         unitTests.add(new UT_foreach(this, mRes, mCtx));
+        unitTests.add(new UT_atomic(this, mRes, mCtx));
+        unitTests.add(new UT_struct(this, mRes, mCtx));
         unitTests.add(new UT_math(this, mRes, mCtx));
         unitTests.add(new UT_fp_mad(this, mRes, mCtx));
         /*
@@ -91,7 +94,7 @@
         for (int i = 0; i < uta.length; i++) {
             ScriptField_ListAllocs_s.Item listElem = new ScriptField_ListAllocs_s.Item();
             listElem.text = Allocation.createFromString(mRS, uta[i].name, Allocation.USAGE_SCRIPT);
-            listElem.result = uta[i].result;
+            listElem.result = uta[i].getResult();
             mListAllocs.set(listElem, i, false);
             uta[i].setItem(listElem);
         }
diff --git a/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_atomic.java b/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_atomic.java
new file mode 100644
index 0000000..267c5b2
--- /dev/null
+++ b/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_atomic.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.test;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.renderscript.*;
+
+public class UT_atomic extends UnitTest {
+    private Resources mRes;
+
+    protected UT_atomic(RSTestCore rstc, Resources res, Context ctx) {
+        super(rstc, "Atomics", ctx);
+        mRes = res;
+    }
+
+    public void run() {
+        RenderScript pRS = RenderScript.create(mCtx);
+        ScriptC_atomic s = new ScriptC_atomic(pRS, mRes, R.raw.atomic);
+        pRS.setMessageHandler(mRsMessage);
+        s.invoke_atomic_test();
+        pRS.finish();
+        waitForMessage();
+        pRS.destroy();
+    }
+}
diff --git a/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_constant.java b/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_constant.java
new file mode 100644
index 0000000..adda5a3
--- /dev/null
+++ b/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_constant.java
@@ -0,0 +1,57 @@
+/*
+ * 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.test;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.renderscript.*;
+
+public class UT_constant extends UnitTest {
+    private Resources mRes;
+
+    protected UT_constant(RSTestCore rstc, Resources res, Context ctx) {
+        super(rstc, "Const", ctx);
+        mRes = res;
+    }
+
+    private void Assert(boolean b) {
+        if (!b) {
+            failTest();
+        }
+    }
+
+    public void run() {
+        Assert(ScriptC_constant.const_floatTest == 1.99f);
+        Assert(ScriptC_constant.const_doubleTest == 2.05);
+        Assert(ScriptC_constant.const_charTest == -8);
+        Assert(ScriptC_constant.const_shortTest == -16);
+        Assert(ScriptC_constant.const_intTest == -32);
+        Assert(ScriptC_constant.const_longTest == 17179869184l);
+        Assert(ScriptC_constant.const_longlongTest == 68719476736l);
+
+        Assert(ScriptC_constant.const_ucharTest == 8);
+        Assert(ScriptC_constant.const_ushortTest == 16);
+        Assert(ScriptC_constant.const_uintTest == 32);
+        Assert(ScriptC_constant.const_ulongTest == 4611686018427387904L);
+        Assert(ScriptC_constant.const_int64_tTest == -17179869184l);
+        Assert(ScriptC_constant.const_uint64_tTest == 117179869184l);
+
+        Assert(ScriptC_constant.const_boolTest == true);
+
+        passTest();
+    }
+}
diff --git a/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_primitives.java b/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_primitives.java
index b7a65a5..18829c2 100644
--- a/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_primitives.java
+++ b/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_primitives.java
@@ -92,8 +92,7 @@
         ScriptC_primitives s = new ScriptC_primitives(pRS, mRes, R.raw.primitives);
         pRS.setMessageHandler(mRsMessage);
         if (!initializeGlobals(s)) {
-            // initializeGlobals failed
-            result = -1;
+            failTest();
         } else {
             s.invoke_primitives_test(0, 0);
             pRS.finish();
diff --git a/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_struct.java b/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_struct.java
new file mode 100644
index 0000000..2a55686
--- /dev/null
+++ b/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_struct.java
@@ -0,0 +1,55 @@
+/*
+ * 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.test;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.renderscript.*;
+
+public class UT_struct extends UnitTest {
+    private Resources mRes;
+
+    protected UT_struct(RSTestCore rstc, Resources res, Context ctx) {
+        super(rstc, "Struct", ctx);
+        mRes = res;
+    }
+
+    public void run() {
+        RenderScript pRS = RenderScript.create(mCtx);
+        ScriptC_struct s = new ScriptC_struct(pRS, mRes, R.raw.struct);
+        pRS.setMessageHandler(mRsMessage);
+
+        ScriptField_Point2 p = new ScriptField_Point2(pRS, 1);
+        ScriptField_Point2.Item i = new ScriptField_Point2.Item();
+        int val = 100;
+        i.x = val;
+        i.y = val;
+        p.set(i, 0, true);
+        s.bind_point2(p);
+        s.invoke_struct_test(val);
+        pRS.finish();
+        waitForMessage();
+
+        val = 200;
+        p.set_x(0, val, true);
+        p.set_y(0, val, true);
+        s.invoke_struct_test(val);
+        pRS.finish();
+        waitForMessage();
+        pRS.destroy();
+    }
+}
diff --git a/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_vector.java b/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_vector.java
index 748701d..0ac09ca 100644
--- a/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_vector.java
+++ b/tests/RenderScriptTests/tests/src/com/android/rs/test/UT_vector.java
@@ -307,7 +307,7 @@
         ScriptC_vector s = new ScriptC_vector(pRS, mRes, R.raw.vector);
         pRS.setMessageHandler(mRsMessage);
         if (!initializeGlobals(s)) {
-            result = -1;
+            failTest();
         } else {
             s.invoke_vector_test();
             pRS.finish();
diff --git a/tests/RenderScriptTests/tests/src/com/android/rs/test/UnitTest.java b/tests/RenderScriptTests/tests/src/com/android/rs/test/UnitTest.java
index a97ffa7..edff83f 100644
--- a/tests/RenderScriptTests/tests/src/com/android/rs/test/UnitTest.java
+++ b/tests/RenderScriptTests/tests/src/com/android/rs/test/UnitTest.java
@@ -21,7 +21,7 @@
 
 public class UnitTest extends Thread {
     public String name;
-    public int result;
+    private int result;
     private ScriptField_ListAllocs_s.Item mItem;
     private RSTestCore mRSTC;
     private boolean msgHandled;
@@ -63,7 +63,7 @@
         }
     }
 
-    protected void updateUI() {
+    private void updateUI() {
         if (mItem != null) {
             mItem.result = result;
             msgHandled = true;
@@ -104,6 +104,22 @@
         }
     }
 
+    public int getResult() {
+        return result;
+    }
+
+    public void failTest() {
+        result = -1;
+        updateUI();
+    }
+
+    public void passTest() {
+        if (result != -1) {
+            result = 1;
+        }
+        updateUI();
+    }
+
     public void setItem(ScriptField_ListAllocs_s.Item item) {
         mItem = item;
     }
diff --git a/tests/RenderScriptTests/tests/src/com/android/rs/test/atomic.rs b/tests/RenderScriptTests/tests/src/com/android/rs/test/atomic.rs
new file mode 100644
index 0000000..f0a5041
--- /dev/null
+++ b/tests/RenderScriptTests/tests/src/com/android/rs/test/atomic.rs
@@ -0,0 +1,77 @@
+#include "shared.rsh"
+
+// Testing atomic operations
+static bool testUMax(uint32_t dst, uint32_t src) {
+    bool failed = false;
+    uint32_t old = dst;
+    uint32_t expect = (dst > src ? dst : src);
+    uint32_t ret = rsAtomicMax(&dst, src);
+    _RS_ASSERT(old == ret);
+    _RS_ASSERT(dst == expect);
+    return failed;
+}
+
+static bool testUMin(uint32_t dst, uint32_t src) {
+    bool failed = false;
+    uint32_t old = dst;
+    uint32_t expect = (dst < src ? dst : src);
+    uint32_t ret = rsAtomicMin(&dst, src);
+    _RS_ASSERT(old == ret);
+    _RS_ASSERT(dst == expect);
+    return failed;
+}
+
+static bool testUCas(uint32_t dst, uint32_t cmp, uint32_t swp) {
+    bool failed = false;
+    uint32_t old = dst;
+    uint32_t expect = (dst == cmp ? swp : dst);
+    uint32_t ret = rsAtomicCas(&dst, cmp, swp);
+    _RS_ASSERT(old == ret);
+    _RS_ASSERT(dst == expect);
+    return failed;
+}
+
+static bool test_atomics() {
+    bool failed = false;
+
+    failed |= testUMax(5, 6);
+    failed |= testUMax(6, 5);
+    failed |= testUMax(5, 0xf0000006);
+    failed |= testUMax(0xf0000006, 5);
+
+    failed |= testUMin(5, 6);
+    failed |= testUMin(6, 5);
+    failed |= testUMin(5, 0xf0000006);
+    failed |= testUMin(0xf0000006, 5);
+
+    failed |= testUCas(4, 4, 5);
+    failed |= testUCas(4, 5, 5);
+    failed |= testUCas(5, 5, 4);
+    failed |= testUCas(5, 4, 4);
+    failed |= testUCas(0xf0000004, 0xf0000004, 0xf0000005);
+    failed |= testUCas(0xf0000004, 0xf0000005, 0xf0000005);
+    failed |= testUCas(0xf0000005, 0xf0000005, 0xf0000004);
+    failed |= testUCas(0xf0000005, 0xf0000004, 0xf0000004);
+
+    if (failed) {
+        rsDebug("test_atomics FAILED", 0);
+    }
+    else {
+        rsDebug("test_atomics PASSED", 0);
+    }
+
+    return failed;
+}
+
+void atomic_test() {
+    bool failed = false;
+    failed |= test_atomics();
+
+    if (failed) {
+        rsSendToClientBlocking(RS_MSG_TEST_FAILED);
+    }
+    else {
+        rsSendToClientBlocking(RS_MSG_TEST_PASSED);
+    }
+}
+
diff --git a/tests/RenderScriptTests/tests/src/com/android/rs/test/constant.rs b/tests/RenderScriptTests/tests/src/com/android/rs/test/constant.rs
new file mode 100644
index 0000000..732eaef
--- /dev/null
+++ b/tests/RenderScriptTests/tests/src/com/android/rs/test/constant.rs
@@ -0,0 +1,19 @@
+#include "shared.rsh"
+
+const float floatTest = 1.99f;
+const double doubleTest = 2.05;
+const char charTest = -8;
+const short shortTest = -16;
+const int intTest = -32;
+const long longTest = 17179869184l; // 1 << 34
+const long long longlongTest = 68719476736l; // 1 << 36
+
+const uchar ucharTest = 8;
+const ushort ushortTest = 16;
+const uint uintTest = 32;
+const ulong ulongTest = 4611686018427387904L;
+const int64_t int64_tTest = -17179869184l; // - 1 << 34
+const uint64_t uint64_tTest = 117179869184l;
+
+const bool boolTest = true;
+
diff --git a/tests/RenderScriptTests/tests/src/com/android/rs/test/struct.rs b/tests/RenderScriptTests/tests/src/com/android/rs/test/struct.rs
new file mode 100644
index 0000000..1cd728e
--- /dev/null
+++ b/tests/RenderScriptTests/tests/src/com/android/rs/test/struct.rs
@@ -0,0 +1,37 @@
+#include "shared.rsh"
+
+typedef struct Point2 {
+   int x;
+   int y;
+} Point_2;
+Point_2 *point2;
+
+static bool test_Point_2(int expected) {
+    bool failed = false;
+
+    rsDebug("Point: ", point2[0].x, point2[0].y);
+    _RS_ASSERT(point2[0].x == expected);
+    _RS_ASSERT(point2[0].y == expected);
+
+    if (failed) {
+        rsDebug("test_Point_2 FAILED", 0);
+    }
+    else {
+        rsDebug("test_Point_2 PASSED", 0);
+    }
+
+    return failed;
+}
+
+void struct_test(int expected) {
+    bool failed = false;
+    failed |= test_Point_2(expected);
+
+    if (failed) {
+        rsSendToClientBlocking(RS_MSG_TEST_FAILED);
+    }
+    else {
+        rsSendToClientBlocking(RS_MSG_TEST_PASSED);
+    }
+}
+
diff --git a/tests/TileBenchmark/res/values/strings.xml b/tests/TileBenchmark/res/values/strings.xml
index 5af52dc..6c7055b 100644
--- a/tests/TileBenchmark/res/values/strings.xml
+++ b/tests/TileBenchmark/res/values/strings.xml
@@ -49,8 +49,9 @@
     <!-- Drop down menu entry - automatically scroll to the end of the page
     with scrollBy() [CHAR LIMIT=15] -->
     <string name="movement_auto_scroll">Auto-scroll</string>
-    <!-- Drop down menu entry -  [CHAR LIMIT=15] -->
-    <string name="movement_auto_fling">Auto-fling</string>
+    <!-- Drop down menu entry - automatically record for a set time before
+    stopping [CHAR LIMIT=15] -->
+    <string name="movement_timed">Timed</string>
     <!-- Drop down menu entry - manually navigate the page(s), hit 'capture'
     button [CHAR LIMIT=15] -->
     <string name="movement_manual">Manual</string>
@@ -67,14 +68,21 @@
     <!-- 75th percentile - 75% of frames fall below this value [CHAR LIMIT=12]
     -->
     <string name="percentile_75">75%ile</string>
+    <!-- standard deviation [CHAR LIMIT=12] -->
+    <string name="std_dev">StdDev</string>
+    <!-- mean [CHAR LIMIT=12] -->
+    <string name="mean">mean</string>
+
+
+
     <!-- Frame rate [CHAR LIMIT=15] -->
     <string name="frames_per_second">Frames/sec</string>
     <!-- Portion of viewport covered by good tiles [CHAR LIMIT=15] -->
     <string name="viewport_coverage">Coverage</string>
     <!-- Milliseconds taken to inval, and re-render the page [CHAR LIMIT=15] -->
     <string name="render_millis">RenderMillis</string>
-    <!-- Number of rendering stalls while running the test [CHAR LIMIT=15] -->
-    <string name="render_stalls">Stalls</string>
+    <!-- Animation Framerate [CHAR LIMIT=15] -->
+    <string name="animation_framerate">AnimFramerate</string>
     <!-- Format string for stat value overlay [CHAR LIMIT=15] -->
     <string name="format_stat">%4.4f</string>
 
diff --git a/tests/TileBenchmark/src/com/test/tilebenchmark/PerformanceTest.java b/tests/TileBenchmark/src/com/test/tilebenchmark/PerformanceTest.java
index cc39b75..6356cc1 100644
--- a/tests/TileBenchmark/src/com/test/tilebenchmark/PerformanceTest.java
+++ b/tests/TileBenchmark/src/com/test/tilebenchmark/PerformanceTest.java
@@ -27,17 +27,57 @@
 import android.os.Environment;
 import android.test.ActivityInstrumentationTestCase2;
 import android.util.Log;
+import android.webkit.WebSettings;
+import android.widget.Spinner;
 
 public class PerformanceTest extends
         ActivityInstrumentationTestCase2<ProfileActivity> {
 
+    public static class AnimStat {
+        double aggVal = 0;
+        double aggSqrVal = 0;
+        double count = 0;
+    }
+
     private class StatAggregator extends PlaybackGraphs {
         private HashMap<String, Double> mDataMap = new HashMap<String, Double>();
+        private HashMap<String, AnimStat> mAnimDataMap = new HashMap<String, AnimStat>();
         private int mCount = 0;
 
+
         public void aggregate() {
+            boolean inAnimTests = mAnimTests != null;
+            Resources resources = mWeb.getResources();
+            String animFramerateString = resources.getString(R.string.animation_framerate);
+            for (Map.Entry<String, Double> e : mSingleStats.entrySet()) {
+                String name = e.getKey();
+                if (inAnimTests) {
+                    if (name.equals(animFramerateString)) {
+                        // in animation testing phase, record animation framerate and aggregate
+                        // stats, differentiating on values of mAnimTestNr and mDoubleBuffering
+                        String fullName = ANIM_TEST_NAMES[mAnimTestNr] + " " + name;
+                        fullName += mDoubleBuffering ? " tiled" : " webkit";
+
+                        if (!mAnimDataMap.containsKey(fullName)) {
+                            mAnimDataMap.put(fullName, new AnimStat());
+                        }
+                        AnimStat statVals = mAnimDataMap.get(fullName);
+                        statVals.aggVal += e.getValue();
+                        statVals.aggSqrVal += e.getValue() * e.getValue();
+                        statVals.count += 1;
+                    }
+                } else {
+                    double aggVal = mDataMap.containsKey(name)
+                            ? mDataMap.get(name) : 0;
+                    mDataMap.put(name, aggVal + e.getValue());
+                }
+            }
+
+            if (inAnimTests) {
+                return;
+            }
+
             mCount++;
-            Resources resources = mView.getResources();
             for (int metricIndex = 0; metricIndex < Metrics.length; metricIndex++) {
                 for (int statIndex = 0; statIndex < Stats.length; statIndex++) {
                     String metricLabel = resources.getString(
@@ -53,34 +93,47 @@
                     mDataMap.put(label, aggVal);
                 }
             }
-            for (Map.Entry<String, Double> e : mSingleStats.entrySet()) {
-                double aggVal = mDataMap.containsKey(e.getKey())
-                        ? mDataMap.get(e.getKey()) : 0;
-                mDataMap.put(e.getKey(), aggVal + e.getValue());
-            }
+
         }
 
+        // build the final bundle of results
         public Bundle getBundle() {
             Bundle b = new Bundle();
-            int count = 0 == mCount ? Integer.MAX_VALUE : mCount;
+            int count = (0 == mCount) ? Integer.MAX_VALUE : mCount;
             for (Map.Entry<String, Double> e : mDataMap.entrySet()) {
                 b.putDouble(e.getKey(), e.getValue() / count);
             }
+
+            for (Map.Entry<String, AnimStat> e : mAnimDataMap.entrySet()) {
+                String statName = e.getKey();
+                AnimStat statVals = e.getValue();
+
+                double avg = statVals.aggVal/statVals.count;
+                double stdDev = Math.sqrt((statVals.aggSqrVal / statVals.count) - avg * avg);
+
+                b.putDouble(statName, avg);
+                b.putDouble(statName + " STD DEV", stdDev);
+            }
+
             return b;
         }
     }
 
     ProfileActivity mActivity;
-    ProfiledWebView mView;
-    StatAggregator mStats = new StatAggregator();
+    ProfiledWebView mWeb;
+    Spinner mMovementSpinner;
+    StatAggregator mStats;
 
     private static final String LOGTAG = "PerformanceTest";
     private static final String TEST_LOCATION = "webkit/page_cycler";
     private static final String URL_PREFIX = "file://";
     private static final String URL_POSTFIX = "/index.html?skip=true";
     private static final int MAX_ITERATIONS = 4;
-    private static final String TEST_DIRS[] = {
-        "alexa25_2011"//, "alexa_us", "android", "dom", "intl2", "moz", "moz2"
+    private static final String SCROLL_TEST_DIRS[] = {
+        "alexa25_2011"
+    };
+    private static final String ANIM_TEST_DIRS[] = {
+        "dhtml"
     };
 
     public PerformanceTest() {
@@ -91,7 +144,22 @@
     protected void setUp() throws Exception {
         super.setUp();
         mActivity = getActivity();
-        mView = (ProfiledWebView) mActivity.findViewById(R.id.web);
+        mWeb = (ProfiledWebView) mActivity.findViewById(R.id.web);
+        mMovementSpinner = (Spinner) mActivity.findViewById(R.id.movement);
+        mStats = new StatAggregator();
+
+        // use mStats as a condition variable between the UI thread and
+        // this(the testing) thread
+        mActivity.setCallback(new ProfileCallback() {
+            @Override
+            public void profileCallback(RunData data) {
+                mStats.setData(data);
+                synchronized (mStats) {
+                    mStats.notify();
+                }
+            }
+        });
+
     }
 
     private boolean loadUrl(final String url) {
@@ -100,12 +168,13 @@
             mActivity.runOnUiThread(new Runnable() {
                 @Override
                 public void run() {
-                    mView.loadUrl(url);
+                    mWeb.loadUrl(url);
                 }
             });
             synchronized (mStats) {
                 mStats.wait();
             }
+
             mStats.aggregate();
         } catch (InterruptedException e) {
             e.printStackTrace();
@@ -114,15 +183,30 @@
         return true;
     }
 
-    private boolean runIteration() {
+    private boolean validTest(String nextTest) {
+        // if testing animations, test must be in mAnimTests
+        if (mAnimTests == null)
+            return true;
+
+        for (String test : mAnimTests) {
+            if (test.equals(nextTest)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private boolean runIteration(String[] testDirs) {
         File sdFile = Environment.getExternalStorageDirectory();
-        for (String testDirName : TEST_DIRS) {
+        for (String testDirName : testDirs) {
             File testDir = new File(sdFile, TEST_LOCATION + "/" + testDirName);
             Log.d(LOGTAG, "Testing dir: '" + testDir.getAbsolutePath()
                     + "', exists=" + testDir.exists());
+
             for (File siteDir : testDir.listFiles()) {
-                if (!siteDir.isDirectory())
+                if (!siteDir.isDirectory() || !validTest(siteDir.getName())) {
                     continue;
+                }
 
                 if (!loadUrl(URL_PREFIX + siteDir.getAbsolutePath()
                         + URL_POSTFIX)) {
@@ -133,7 +217,44 @@
         return true;
     }
 
-    public void testMetrics() {
+    private boolean  runTestDirs(String[] testDirs) {
+        for (int i = 0; i < MAX_ITERATIONS; i++)
+            if (!runIteration(testDirs)) {
+                return false;
+            }
+        return true;
+    }
+
+    private void pushDoubleBuffering() {
+        getInstrumentation().runOnMainSync(new Runnable() {
+            public void run() {
+                mWeb.setDoubleBuffering(mDoubleBuffering);
+            }
+        });
+    }
+
+    private void setScrollingTestingMode(final boolean scrolled) {
+        getInstrumentation().runOnMainSync(new Runnable() {
+            public void run() {
+                mMovementSpinner.setSelection(scrolled ? 0 : 2);
+            }
+        });
+    }
+
+
+    private String[] mAnimTests = null;
+    private int mAnimTestNr = -1;
+    private boolean mDoubleBuffering = true;
+    private static final String[] ANIM_TEST_NAMES = {
+        "slow", "fast"
+    };
+    private static final String[][] ANIM_TESTS = {
+        {"scrolling", "replaceimages", "layers5", "layers1"},
+        {"slidingballs", "meter", "slidein", "fadespacing", "colorfade",
+                "mozilla", "movingtext", "diagball", "zoom", "imageslide"},
+    };
+
+    private boolean checkMedia() {
         String state = Environment.getExternalStorageState();
 
         if (!Environment.MEDIA_MOUNTED.equals(state)
@@ -141,27 +262,43 @@
             Log.d(LOGTAG, "ARG Can't access sd card!");
             // Can't read the SD card, fail and die!
             getInstrumentation().sendStatus(1, null);
-            return;
+            return false;
         }
+        return true;
+    }
 
-        // use mGraphs as a condition variable between the UI thread and
-        // this(the testing) thread
-        mActivity.setCallback(new ProfileCallback() {
-            @Override
-            public void profileCallback(RunData data) {
-                Log.d(LOGTAG, "test completion callback");
-                mStats.setData(data);
-                synchronized (mStats) {
-                    mStats.notify();
+    public void testMetrics() {
+        setScrollingTestingMode(true);
+        if (checkMedia() && runTestDirs(SCROLL_TEST_DIRS)) {
+            getInstrumentation().sendStatus(0, mStats.getBundle());
+        } else {
+            getInstrumentation().sendStatus(1, null);
+        }
+    }
+
+    private boolean runAnimationTests() {
+        for (int doubleBuffer = 0; doubleBuffer <= 1; doubleBuffer++) {
+            mDoubleBuffering = doubleBuffer == 1;
+            pushDoubleBuffering();
+            for (mAnimTestNr = 0; mAnimTestNr < ANIM_TESTS.length; mAnimTestNr++) {
+                mAnimTests = ANIM_TESTS[mAnimTestNr];
+                if (!runTestDirs(ANIM_TEST_DIRS)) {
+                    return false;
                 }
             }
-        });
+        }
+        return true;
+    }
 
-        for (int i = 0; i < MAX_ITERATIONS; i++)
-            if (!runIteration()) {
-                getInstrumentation().sendStatus(1, null);
-                return;
-            }
-        getInstrumentation().sendStatus(0, mStats.getBundle());
+    public void testAnimations() {
+        // instead of autoscrolling, load each page until either an timer fires,
+        // or the animation signals complete via javascript
+        setScrollingTestingMode(false);
+
+        if (checkMedia() && runAnimationTests()) {
+            getInstrumentation().sendStatus(0, mStats.getBundle());
+        } else {
+            getInstrumentation().sendStatus(1, null);
+        }
     }
 }
diff --git a/tests/TileBenchmark/src/com/test/tilebenchmark/PlaybackGraphs.java b/tests/TileBenchmark/src/com/test/tilebenchmark/PlaybackGraphs.java
index 9ea90f8..a3ae9be 100644
--- a/tests/TileBenchmark/src/com/test/tilebenchmark/PlaybackGraphs.java
+++ b/tests/TileBenchmark/src/com/test/tilebenchmark/PlaybackGraphs.java
@@ -80,7 +80,7 @@
                     for (int tileID = 1; tileID < frame.length; tileID++) {
                         TileData data = frame[tileID];
                         double coverage = viewportCoverage(frame[0], data);
-                        total += coverage * (data.isReady ? 1 : 0);
+                        total += coverage * (data.isReady ? 100 : 0);
                         totalCount += coverage;
                     }
                     if (totalCount == 0) {
@@ -91,7 +91,7 @@
 
                 @Override
                 public double getMax() {
-                    return 1;
+                    return 100;
                 }
 
                 @Override
@@ -108,6 +108,9 @@
     }
 
     public static double getPercentile(double sortedValues[], double ratioAbove) {
+        if (sortedValues.length == 0)
+            return -1;
+
         double index = ratioAbove * (sortedValues.length - 1);
         int intIndex = (int) Math.floor(index);
         if (index == intIndex) {
@@ -118,6 +121,31 @@
                 + sortedValues[intIndex + 1] * (alpha);
     }
 
+    public static double getMean(double sortedValues[]) {
+        if (sortedValues.length == 0)
+            return -1;
+
+        double agg = 0;
+        for (double val : sortedValues) {
+            agg += val;
+        }
+        return agg / sortedValues.length;
+    }
+
+    public static double getStdDev(double sortedValues[]) {
+        if (sortedValues.length == 0)
+            return -1;
+
+        double agg = 0;
+        double sqrAgg = 0;
+        for (double val : sortedValues) {
+            agg += val;
+            sqrAgg += val*val;
+        }
+        double mean = agg / sortedValues.length;
+        return Math.sqrt((sqrAgg / sortedValues.length) - (mean * mean));
+    }
+
     protected static StatGen[] Stats = new StatGen[] {
             new StatGen() {
                 @Override
@@ -149,6 +177,26 @@
                 public int getLabelId() {
                     return R.string.percentile_75;
                 }
+            }, new StatGen() {
+                @Override
+                public double getValue(double[] sortedValues) {
+                    return getStdDev(sortedValues);
+                }
+
+                @Override
+                public int getLabelId() {
+                    return R.string.std_dev;
+                }
+            }, new StatGen() {
+                @Override
+                public double getValue(double[] sortedValues) {
+                    return getMean(sortedValues);
+                }
+
+                @Override
+                public int getLabelId() {
+                    return R.string.mean;
+                }
             },
     };
 
@@ -159,40 +207,47 @@
     }
 
     private ArrayList<ShapeDrawable> mShapes = new ArrayList<ShapeDrawable>();
-    protected double[][] mStats = new double[Metrics.length][Stats.length];
+    protected final double[][] mStats = new double[Metrics.length][Stats.length];
     protected HashMap<String, Double> mSingleStats;
 
+    private void gatherFrameMetric(int metricIndex, double metricValues[], RunData data) {
+        // create graph out of rectangles, one per frame
+        int lastBar = 0;
+        for (int frameIndex = 0; frameIndex < data.frames.length; frameIndex++) {
+            TileData frame[] = data.frames[frameIndex];
+            int newBar = (frame[0].top + frame[0].bottom) / 2;
+
+            MetricGen s = Metrics[metricIndex];
+            double absoluteValue = s.getValue(frame);
+            double relativeValue = absoluteValue / s.getMax();
+            relativeValue = Math.min(1,relativeValue);
+            relativeValue = Math.max(0,relativeValue);
+            int rightPos = (int) (-BAR_WIDTH * metricIndex);
+            int leftPos = (int) (-BAR_WIDTH * (metricIndex + relativeValue));
+
+            ShapeDrawable graphBar = new ShapeDrawable();
+            graphBar.getPaint().setColor(Color.BLUE);
+            graphBar.setBounds(leftPos, lastBar, rightPos, newBar);
+
+            mShapes.add(graphBar);
+            metricValues[frameIndex] = absoluteValue;
+            lastBar = newBar;
+        }
+    }
+
     public void setData(RunData data) {
         mShapes.clear();
         double metricValues[] = new double[data.frames.length];
 
+        mSingleStats = data.singleStats;
+
         if (data.frames.length == 0) {
             return;
         }
 
         for (int metricIndex = 0; metricIndex < Metrics.length; metricIndex++) {
-            // create graph out of rectangles, one per frame
-            int lastBar = 0;
-            for (int frameIndex = 0; frameIndex < data.frames.length; frameIndex++) {
-                TileData frame[] = data.frames[frameIndex];
-                int newBar = (frame[0].top + frame[0].bottom) / 2;
-
-                MetricGen s = Metrics[metricIndex];
-                double absoluteValue = s.getValue(frame);
-                double relativeValue = absoluteValue / s.getMax();
-                relativeValue = Math.min(1,relativeValue);
-                relativeValue = Math.max(0,relativeValue);
-                int rightPos = (int) (-BAR_WIDTH * metricIndex);
-                int leftPos = (int) (-BAR_WIDTH * (metricIndex + relativeValue));
-
-                ShapeDrawable graphBar = new ShapeDrawable();
-                graphBar.getPaint().setColor(Color.BLUE);
-                graphBar.setBounds(leftPos, lastBar, rightPos, newBar);
-
-                mShapes.add(graphBar);
-                metricValues[frameIndex] = absoluteValue;
-                lastBar = newBar;
-            }
+            // calculate metric based on list of frames
+            gatherFrameMetric(metricIndex, metricValues, data);
 
             // store aggregate statistics per metric (median, and similar)
             Arrays.sort(metricValues);
@@ -200,8 +255,6 @@
                 mStats[metricIndex][statIndex] =
                         Stats[statIndex].getValue(metricValues);
             }
-
-            mSingleStats = data.singleStats;
         }
     }
 
diff --git a/tests/TileBenchmark/src/com/test/tilebenchmark/ProfileActivity.java b/tests/TileBenchmark/src/com/test/tilebenchmark/ProfileActivity.java
index d38d006..2e77157 100644
--- a/tests/TileBenchmark/src/com/test/tilebenchmark/ProfileActivity.java
+++ b/tests/TileBenchmark/src/com/test/tilebenchmark/ProfileActivity.java
@@ -22,11 +22,12 @@
 import android.graphics.Bitmap;
 import android.os.AsyncTask;
 import android.os.Bundle;
+import android.os.CountDownTimer;
+import android.util.Log;
 import android.util.Pair;
 import android.view.KeyEvent;
 import android.view.View;
 import android.view.View.OnClickListener;
-import android.webkit.WebSettings;
 import android.webkit.WebView;
 import android.webkit.WebViewClient;
 import android.widget.AdapterView;
@@ -49,6 +50,8 @@
  */
 public class ProfileActivity extends Activity {
 
+    private static final int TIMED_RECORD_MILLIS = 2000;
+
     public interface ProfileCallback {
         public void profileCallback(RunData data);
     }
@@ -65,6 +68,7 @@
 
     LoggingWebViewClient mLoggingWebViewClient = new LoggingWebViewClient();
     AutoLoggingWebViewClient mAutoLoggingWebViewClient = new AutoLoggingWebViewClient();
+    TimedLoggingWebViewClient mTimedLoggingWebViewClient = new TimedLoggingWebViewClient();
 
     private enum TestingState {
         NOT_TESTING,
@@ -93,18 +97,18 @@
         public void onItemSelected(AdapterView<?> parent, View view,
                 int position, long id) {
             String movementStr = parent.getItemAtPosition(position).toString();
-            if (movementStr == getResources().getString(
-                    R.string.movement_auto_scroll)
-                    || movementStr == getResources().getString(
-                            R.string.movement_auto_fling)) {
+            if (movementStr == getResources().getString(R.string.movement_auto_scroll)) {
                 mWeb.setWebViewClient(mAutoLoggingWebViewClient);
                 mCaptureButton.setEnabled(false);
                 mVelocitySpinner.setEnabled(true);
-            } else if (movementStr == getResources().getString(
-                    R.string.movement_manual)) {
+            } else if (movementStr == getResources().getString(R.string.movement_manual)) {
                 mWeb.setWebViewClient(mLoggingWebViewClient);
                 mCaptureButton.setEnabled(true);
                 mVelocitySpinner.setEnabled(false);
+            } else if (movementStr == getResources().getString(R.string.movement_timed)) {
+                mWeb.setWebViewClient(mTimedLoggingWebViewClient);
+                mCaptureButton.setEnabled(false);
+                mVelocitySpinner.setEnabled(false);
             }
         }
 
@@ -124,15 +128,19 @@
             super.onPageStarted(view, url, favicon);
             mUrl.setText(url);
         }
-    }
-
-    private class AutoLoggingWebViewClient extends LoggingWebViewClient {
 
         @Override
         public void onPageFinished(WebView view, String url) {
             super.onPageFinished(view, url);
             view.requestFocus();
+            ((ProfiledWebView)view).onPageFinished();
+        }
+    }
 
+    private class AutoLoggingWebViewClient extends LoggingWebViewClient {
+        @Override
+        public void onPageFinished(WebView view, String url) {
+            super.onPageFinished(view, url);
             startViewProfiling(true);
         }
 
@@ -143,6 +151,32 @@
         }
     }
 
+    private class TimedLoggingWebViewClient extends LoggingWebViewClient {
+        @Override
+        public void onPageFinished(WebView view, String url) {
+            super.onPageFinished(view, url);
+            startViewProfiling(false);
+
+            // after a fixed time after page finished, stop testing
+            new CountDownTimer(TIMED_RECORD_MILLIS, TIMED_RECORD_MILLIS) {
+                @Override
+                public void onTick(long millisUntilFinished) {
+                }
+
+                @Override
+                public void onFinish() {
+                    mWeb.stopScrollTest();
+                }
+            }.start();
+        }
+
+        @Override
+        public void onPageStarted(WebView view, String url, Bitmap favicon) {
+            super.onPageStarted(view, url, favicon);
+            setTestingState(TestingState.PRE_TESTING);
+        }
+    }
+
     private class StoreFileTask extends
             AsyncTask<Pair<String, RunData>, Void, Void> {
 
@@ -178,11 +212,13 @@
                 mMovementSpinner.setEnabled(false);
                 break;
             case START_TESTING:
+                mCaptureButton.setChecked(true);
                 mUrl.setBackgroundResource(R.color.background_start_testing);
                 mInspectButton.setEnabled(false);
                 mMovementSpinner.setEnabled(false);
                 break;
             case STOP_TESTING:
+                mCaptureButton.setChecked(false);
                 mUrl.setBackgroundResource(R.color.background_stop_testing);
                 break;
             case SAVED_TESTING:
@@ -195,7 +231,6 @@
     /** auto - automatically scroll. */
     private void startViewProfiling(boolean auto) {
         // toggle capture button to indicate capture state to user
-        mCaptureButton.setChecked(true);
         mWeb.startScrollTest(mCallback, auto);
         setTestingState(TestingState.START_TESTING);
     }
@@ -217,7 +252,7 @@
             public void profileCallback(RunData data) {
                 new StoreFileTask().execute(new Pair<String, RunData>(
                         TEMP_FILENAME, data));
-                mCaptureButton.setChecked(false);
+                Log.d("ProfileActivity", "stored " + data.frames.length + " frames in file");
                 setTestingState(TestingState.STOP_TESTING);
             }
         });
@@ -245,8 +280,8 @@
         // Movement spinner
         String content[] = {
                 getResources().getString(R.string.movement_auto_scroll),
-                getResources().getString(R.string.movement_auto_fling),
-                getResources().getString(R.string.movement_manual)
+                getResources().getString(R.string.movement_manual),
+                getResources().getString(R.string.movement_timed)
         };
         adapter = new ArrayAdapter<CharSequence>(this,
                 android.R.layout.simple_spinner_item, content);
@@ -270,13 +305,7 @@
         });
 
         // Custom profiling WebView
-        WebSettings settings = mWeb.getSettings();
-        settings.setJavaScriptEnabled(true);
-        settings.setSupportZoom(true);
-        settings.setEnableSmoothTransition(true);
-        settings.setBuiltInZoomControls(true);
-        settings.setLoadWithOverviewMode(true);
-        settings.setProperty("use_minimal_memory", "false"); // prefetch tiles, as browser does
+        mWeb.init(this);
         mWeb.setWebViewClient(new LoggingWebViewClient());
 
         // URL text entry
diff --git a/tests/TileBenchmark/src/com/test/tilebenchmark/ProfiledWebView.java b/tests/TileBenchmark/src/com/test/tilebenchmark/ProfiledWebView.java
index 83f1668..a38ac25 100644
--- a/tests/TileBenchmark/src/com/test/tilebenchmark/ProfiledWebView.java
+++ b/tests/TileBenchmark/src/com/test/tilebenchmark/ProfiledWebView.java
@@ -20,22 +20,32 @@
 import android.os.CountDownTimer;
 import android.util.AttributeSet;
 import android.util.Log;
+import android.webkit.WebSettings;
 import android.webkit.WebView;
+import android.widget.Toast;
+
+import java.util.ArrayList;
 
 import com.test.tilebenchmark.ProfileActivity.ProfileCallback;
 import com.test.tilebenchmark.RunData.TileData;
 
 public class ProfiledWebView extends WebView {
+    private static final String LOGTAG = "ProfiledWebView";
+
     private int mSpeed;
 
     private boolean mIsTesting = false;
     private boolean mIsScrolling = false;
     private ProfileCallback mCallback;
     private long mContentInvalMillis;
-    private boolean mHadToBeForced = false;
     private static final int LOAD_STALL_MILLIS = 2000; // nr of millis after load,
                                                        // before test is forced
 
+    // ignore anim end events until this many millis after load
+    private static final long ANIM_SAFETY_THRESHOLD = 200;
+    private long mLoadTime;
+    private long mAnimationTime;
+
     public ProfiledWebView(Context context) {
         super(context);
     }
@@ -53,6 +63,39 @@
         super(context, attrs, defStyle, privateBrowsing);
     }
 
+    private class JavaScriptInterface {
+        Context mContext;
+
+        /** Instantiate the interface and set the context */
+        JavaScriptInterface(Context c) {
+            mContext = c;
+        }
+
+        /** Show a toast from the web page */
+        public void animationComplete() {
+            Toast.makeText(mContext, "Animation complete!", Toast.LENGTH_SHORT).show();
+            //Log.d(LOGTAG, "anim complete");
+            mAnimationTime = System.currentTimeMillis();
+        }
+    }
+
+    public void init(Context c) {
+        WebSettings settings = getSettings();
+        settings.setJavaScriptEnabled(true);
+        settings.setSupportZoom(true);
+        settings.setEnableSmoothTransition(true);
+        settings.setBuiltInZoomControls(true);
+        settings.setLoadWithOverviewMode(true);
+        settings.setProperty("use_minimal_memory", "false"); // prefetch tiles, as browser does
+        addJavascriptInterface(new JavaScriptInterface(c), "Android");
+        mAnimationTime = 0;
+        mLoadTime = 0;
+    }
+
+    public void onPageFinished() {
+        mLoadTime = System.currentTimeMillis();
+    }
+
     @Override
     protected void onDraw(android.graphics.Canvas canvas) {
         if (mIsTesting && mIsScrolling) {
@@ -72,9 +115,12 @@
      * scrolling, invalidate all content and redraw it, measuring time taken.
      */
     public void startScrollTest(ProfileCallback callback, boolean autoScrolling) {
-        mIsScrolling = autoScrolling;
         mCallback = callback;
         mIsTesting = false;
+        mIsScrolling = false;
+        WebSettings settings = getSettings();
+        settings.setProperty("tree_updates", "0");
+
 
         if (autoScrolling) {
             // after a while, force it to start even if the pages haven't swapped
@@ -86,13 +132,17 @@
                 @Override
                 public void onFinish() {
                     // invalidate all content, and kick off redraw
-                    registerPageSwapCallback();
+                    Log.d("ProfiledWebView",
+                            "kicking off test with callback registration, and tile discard...");
                     discardAllTextures();
                     invalidate();
-
+                    mIsScrolling = true;
                     mContentInvalMillis = System.currentTimeMillis();
                 }
             }.start();
+        } else {
+            mIsTesting = true;
+            tileProfilingStart();
         }
     }
 
@@ -102,13 +152,36 @@
      */
     @Override
     protected void pageSwapCallback(boolean startAnim) {
-        mContentInvalMillis = System.currentTimeMillis() - mContentInvalMillis;
         super.pageSwapCallback(startAnim);
-        Log.d("ProfiledWebView", "REDRAW TOOK " + mContentInvalMillis
-                + "millis");
-        mIsTesting = true;
-        invalidate(); // ensure a redraw so that auto-scrolling can occur
-        tileProfilingStart();
+
+        if (!mIsTesting && mIsScrolling) {
+            // kick off testing
+            mContentInvalMillis = System.currentTimeMillis() - mContentInvalMillis;
+            Log.d("ProfiledWebView", "REDRAW TOOK " + mContentInvalMillis + "millis");
+            mIsTesting = true;
+            invalidate(); // ensure a redraw so that auto-scrolling can occur
+            tileProfilingStart();
+        }
+    }
+
+    private double animFramerate() {
+        WebSettings settings = getSettings();
+        String updatesString = settings.getProperty("tree_updates");
+        int updates = (updatesString == null) ? -1 : Integer.parseInt(updatesString);
+
+        long animationTime;
+        if (mAnimationTime == 0 || mAnimationTime - mLoadTime < ANIM_SAFETY_THRESHOLD) {
+            animationTime = System.currentTimeMillis() - mLoadTime;
+        } else {
+            animationTime = mAnimationTime - mLoadTime;
+        }
+
+        return updates * 1000.0 / animationTime;
+    }
+
+    public void setDoubleBuffering(boolean useDoubleBuffering) {
+        WebSettings settings = getSettings();
+        settings.setProperty("use_double_buffering", useDoubleBuffering ? "true" : "false");
     }
 
     /*
@@ -127,11 +200,12 @@
         // record the time spent (before scrolling) rendering the page
         data.singleStats.put(getResources().getString(R.string.render_millis),
                 (double)mContentInvalMillis);
-        // record if the page render timed out
-        Log.d("ProfiledWebView", "hadtobeforced = " + mHadToBeForced);
-        data.singleStats.put(getResources().getString(R.string.render_stalls),
-                             mHadToBeForced ? 1.0 : 0.0);
-        mHadToBeForced = false;
+
+        // record framerate
+        double framerate = animFramerate();
+        Log.d(LOGTAG, "anim framerate was "+framerate);
+        data.singleStats.put(getResources().getString(R.string.animation_framerate),
+                framerate);
 
         for (int frame = 0; frame < data.frames.length; frame++) {
             data.frames[frame] = new TileData[
@@ -159,6 +233,8 @@
 
     @Override
     public void loadUrl(String url) {
+        mAnimationTime = 0;
+        mLoadTime = 0;
         if (!url.startsWith("http://") && !url.startsWith("file://")) {
             url = "http://" + url;
         }
diff --git a/tests/TtsTests/Android.mk b/tests/TtsTests/Android.mk
new file mode 100644
index 0000000..e049c90
--- /dev/null
+++ b/tests/TtsTests/Android.mk
@@ -0,0 +1,28 @@
+#
+# 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.
+#
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := tests
+
+LOCAL_SRC_FILES := $(call all-subdir-java-files)
+
+LOCAL_STATIC_JAVA_LIBRARIES := littlemock
+LOCAL_JAVA_LIBRARIES := android.test.runner
+
+LOCAL_PACKAGE_NAME := TtsTests
+
+include $(BUILD_PACKAGE)
diff --git a/tests/TtsTests/AndroidManifest.xml b/tests/TtsTests/AndroidManifest.xml
new file mode 100644
index 0000000..b6d5111
--- /dev/null
+++ b/tests/TtsTests/AndroidManifest.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+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.
+-->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.speech.tts">
+    <application>
+        <uses-library android:name="android.test.runner" />
+
+
+        <service android:name=".MockableTextToSpeechService"
+                 android:label="Mockable Text-to-speech Service">
+            <intent-filter>
+                <action android:name="android.intent.action.TTS_SERVICE" />
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
+        </service>
+
+        <activity android:name=".MockableCheckVoiceData"
+                  android:theme="@android:style/Theme.NoDisplay">
+            <intent-filter>
+                <action android:name="android.speech.tts.engine.CHECK_TTS_DATA" />
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
+        </activity>
+    </application>
+
+    <instrumentation android:name="android.test.InstrumentationTestRunner"
+                     android:targetPackage="com.android.speech.tts"
+                     android:label="Tests for android.speech.tts" />
+</manifest>
diff --git a/tests/TtsTests/src/com/android/speech/tts/MockableCheckVoiceData.java b/tests/TtsTests/src/com/android/speech/tts/MockableCheckVoiceData.java
new file mode 100644
index 0000000..0ab8ed6
--- /dev/null
+++ b/tests/TtsTests/src/com/android/speech/tts/MockableCheckVoiceData.java
@@ -0,0 +1,58 @@
+/*
+ * 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.speech.tts;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.speech.tts.TextToSpeech;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class MockableCheckVoiceData extends Activity {
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        MockableTextToSpeechService.IDelegate delegate =
+                MockableTextToSpeechService.getMocker();
+
+        ArrayList<String> availableLangs = delegate.getAvailableVoices();
+        ArrayList<String> unavailableLangs = delegate.getUnavailableVoices();
+
+        final Intent returnVal = new Intent();
+
+        // Returns early.
+        if (availableLangs == null) {
+            setResult(TextToSpeech.Engine.CHECK_VOICE_DATA_FAIL, returnVal);
+            finish();
+            return;
+        }
+
+        returnVal.putStringArrayListExtra(TextToSpeech.Engine.EXTRA_AVAILABLE_VOICES,
+                    availableLangs);
+
+        if (unavailableLangs != null && unavailableLangs.size() > 0) {
+            returnVal.putStringArrayListExtra(TextToSpeech.Engine.EXTRA_UNAVAILABLE_VOICES,
+                    unavailableLangs);
+        }
+
+        setResult(TextToSpeech.Engine.CHECK_VOICE_DATA_PASS, returnVal);
+        finish();
+    }
+
+}
diff --git a/tests/TtsTests/src/com/android/speech/tts/MockableTextToSpeechService.java b/tests/TtsTests/src/com/android/speech/tts/MockableTextToSpeechService.java
new file mode 100644
index 0000000..20648a4
--- /dev/null
+++ b/tests/TtsTests/src/com/android/speech/tts/MockableTextToSpeechService.java
@@ -0,0 +1,78 @@
+/*
+ * 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.speech.tts;
+
+import android.speech.tts.SynthesisCallback;
+import android.speech.tts.SynthesisRequest;
+import android.speech.tts.TextToSpeechService;
+
+import java.util.ArrayList;
+
+public class MockableTextToSpeechService extends TextToSpeechService {
+
+    private static IDelegate sDelegate;
+
+    public static void setMocker(IDelegate delegate) {
+        sDelegate = delegate;
+    }
+
+    static IDelegate getMocker() {
+        return sDelegate;
+    }
+
+    @Override
+    protected int onIsLanguageAvailable(String lang, String country, String variant) {
+        return sDelegate.onIsLanguageAvailable(lang, country, variant);
+    }
+
+    @Override
+    protected String[] onGetLanguage() {
+        return sDelegate.onGetLanguage();
+    }
+
+    @Override
+    protected int onLoadLanguage(String lang, String country, String variant) {
+        return sDelegate.onLoadLanguage(lang, country, variant);
+    }
+
+    @Override
+    protected void onStop() {
+        sDelegate.onStop();
+    }
+
+    @Override
+    protected void onSynthesizeText(SynthesisRequest request, SynthesisCallback callback) {
+        sDelegate.onSynthesizeText(request, callback);
+    }
+
+    public static interface IDelegate {
+        int onIsLanguageAvailable(String lang, String country, String variant);
+
+        String[] onGetLanguage();
+
+        int onLoadLanguage(String lang, String country, String variant);
+
+        void onStop();
+
+        void onSynthesizeText(SynthesisRequest request, SynthesisCallback callback);
+
+        ArrayList<String> getAvailableVoices();
+
+        ArrayList<String> getUnavailableVoices();
+    }
+
+}
diff --git a/tests/TtsTests/src/com/android/speech/tts/TextToSpeechTests.java b/tests/TtsTests/src/com/android/speech/tts/TextToSpeechTests.java
new file mode 100644
index 0000000..b736e9f
--- /dev/null
+++ b/tests/TtsTests/src/com/android/speech/tts/TextToSpeechTests.java
@@ -0,0 +1,229 @@
+/*
+ * 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.speech.tts;
+
+import android.speech.tts.SynthesisCallback;
+import android.speech.tts.SynthesisRequest;
+import android.speech.tts.TextToSpeech;
+import android.test.InstrumentationTestCase;
+
+import com.android.speech.tts.MockableTextToSpeechService.IDelegate;
+import com.google.testing.littlemock.ArgumentCaptor;
+import com.google.testing.littlemock.Behaviour;
+import com.google.testing.littlemock.LittleMock;
+import junit.framework.Assert;
+
+import java.util.Locale;
+import java.util.concurrent.Callable;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+public class TextToSpeechTests extends InstrumentationTestCase {
+    private static final String MOCK_ENGINE = "com.android.speech.tts";
+    private static final String MOCK_PACKAGE = "com.android.speech.tts.__testpackage__";
+
+    private TextToSpeech mTts;
+
+    @Override
+    public void setUp() throws Exception {
+        IDelegate passThrough = LittleMock.mock(IDelegate.class);
+        MockableTextToSpeechService.setMocker(passThrough);
+
+        blockingInitAndVerify(MOCK_ENGINE, TextToSpeech.SUCCESS);
+        assertEquals(MOCK_ENGINE, mTts.getCurrentEngine());
+    }
+
+
+    @Override
+    public void tearDown() {
+        if (mTts != null) {
+            mTts.shutdown();
+        }
+    }
+
+    public void testEngineInitialized() throws Exception {
+        // Fail on an engine that doesn't exist.
+        blockingInitAndVerify("__DOES_NOT_EXIST__", TextToSpeech.ERROR);
+
+        // Also, the "current engine" must be null
+        assertNull(mTts.getCurrentEngine());
+    }
+
+    public void testSetLanguage_delegation() {
+        IDelegate delegate = LittleMock.mock(IDelegate.class);
+        MockableTextToSpeechService.setMocker(delegate);
+
+        // Test 1 :Tests that calls to onLoadLanguage( ) are delegated through to the
+        // service without any caching or intermediate steps.
+        mTts.setLanguage(new Locale("eng", "USA", "variant"));
+        LittleMock.verify(delegate, LittleMock.times(1)).onLoadLanguage(
+                "eng", "USA", "variant");
+    }
+
+    public void testSetLanguage_availableLanguage() throws Exception {
+        IDelegate delegate = LittleMock.mock(IDelegate.class);
+        MockableTextToSpeechService.setMocker(delegate);
+
+        // ---------------------------------------------------------
+        // Test 2 : Tests that when the language is successfully set
+        // like above (returns LANG_COUNTRY_AVAILABLE). That the
+        // request language changes from that point on.
+        LittleMock.doReturn(TextToSpeech.LANG_COUNTRY_AVAILABLE).when(delegate).onLoadLanguage(
+                "eng", "USA", "variant");
+        mTts.setLanguage(new Locale("eng", "USA", "variant"));
+        blockingCallSpeak("foo bar", delegate);
+        ArgumentCaptor<SynthesisRequest> req = LittleMock.createCaptor();
+        LittleMock.verify(delegate, LittleMock.times(1)).onSynthesizeText(req.capture(),
+                LittleMock.<SynthesisCallback>anyObject());
+
+        assertEquals("eng", req.getValue().getLanguage());
+        assertEquals("USA", req.getValue().getCountry());
+        assertEquals("", req.getValue().getVariant());
+    }
+
+    public void testSetLanguage_unavailableLanguage() throws Exception {
+        IDelegate delegate = LittleMock.mock(IDelegate.class);
+        MockableTextToSpeechService.setMocker(delegate);
+
+        // ---------------------------------------------------------
+        // TEST 3 : Tests that the language that is set does not change when the
+        // engine reports it could not load the specified language.
+        LittleMock.doReturn(TextToSpeech.LANG_NOT_SUPPORTED).when(
+                delegate).onLoadLanguage("fra", "FRA", "");
+        mTts.setLanguage(Locale.FRANCE);
+        blockingCallSpeak("le fou barre", delegate);
+        ArgumentCaptor<SynthesisRequest> req2 = LittleMock.createCaptor();
+        LittleMock.verify(delegate, LittleMock.times(1)).onSynthesizeText(req2.capture(),
+                        LittleMock.<SynthesisCallback>anyObject());
+
+        // The params are basically unchanged.
+        assertEquals("eng", req2.getValue().getLanguage());
+        assertEquals("USA", req2.getValue().getCountry());
+        assertEquals("", req2.getValue().getVariant());
+    }
+
+
+    public void testGetLanguage_invalidReturnValues() {
+        IDelegate delegate = LittleMock.mock(IDelegate.class);
+        MockableTextToSpeechService.setMocker(delegate);
+
+        // Test1: Simple end to end test. Ensure that bad return values
+        // are dealt with appropriately.
+        LittleMock.doReturn(null).when(delegate).onGetLanguage();
+        Locale returnVal = mTts.getLanguage();
+        assertNull(returnVal);
+
+
+        // Bad value 2. An array of length < 3.
+        LittleMock.doReturn(new String[] {"eng", "usa"}).when(delegate).onGetLanguage();
+        returnVal = mTts.getLanguage();
+        assertNull(returnVal);
+    }
+
+    public void testGetLanguage_validReturnValues() {
+        IDelegate delegate = LittleMock.mock(IDelegate.class);
+        MockableTextToSpeechService.setMocker(delegate);
+
+        // A correct value.
+        LittleMock.doReturn(new String[] {"eng", "usa", ""}).when(delegate).onGetLanguage();
+        Locale returnVal = mTts.getLanguage();
+
+        // Note: This is not the same as Locale.US . Well tough luck for
+        // being the only component of the entire framework that standardized
+        // three letter country and language codes.
+        assertEquals(new Locale("eng", "USA", ""), returnVal);
+    }
+
+    public void testIsLanguageAvailable() {
+        IDelegate delegate = LittleMock.mock(IDelegate.class);
+        MockableTextToSpeechService.setMocker(delegate);
+
+        // Test1: Simple end to end test.
+        LittleMock.doReturn(TextToSpeech.LANG_COUNTRY_AVAILABLE).when(
+                delegate).onIsLanguageAvailable("eng", "USA", "");
+
+        assertEquals(TextToSpeech.LANG_COUNTRY_AVAILABLE, mTts.isLanguageAvailable(Locale.US));
+        LittleMock.verify(delegate, LittleMock.times(1)).onIsLanguageAvailable(
+                "eng", "USA", "");
+    }
+
+
+    private void blockingCallSpeak(String speech, IDelegate mock) throws
+            InterruptedException {
+        final CountDownLatch latch = new CountDownLatch(1);
+        doCountDown(latch).when(mock).onSynthesizeText(LittleMock.<SynthesisRequest>anyObject(),
+                LittleMock.<SynthesisCallback>anyObject());
+        mTts.speak(speech, TextToSpeech.QUEUE_ADD, null);
+
+        awaitCountDown(latch, 5, TimeUnit.SECONDS);
+    }
+
+    private void blockingInitAndVerify(final String engine, int errorCode) throws
+            InterruptedException {
+        TextToSpeech.OnInitListener listener = LittleMock.mock(
+                TextToSpeech.OnInitListener.class);
+
+        final CountDownLatch latch = new CountDownLatch(1);
+        doCountDown(latch).when(listener).onInit(errorCode);
+
+        mTts = new TextToSpeech(getInstrumentation().getTargetContext(),
+                listener, engine, MOCK_PACKAGE, false /* use fallback package */);
+
+        awaitCountDown(latch, 5, TimeUnit.SECONDS);
+    }
+
+    public interface CountDownBehaviour extends Behaviour {
+        /** Used to mock methods that return a result. */
+        Behaviour andReturn(Object result);
+    }
+
+    public static CountDownBehaviour doCountDown(final CountDownLatch latch) {
+        return new CountDownBehaviour() {
+            @Override
+            public <T> T when(T mock) {
+                return LittleMock.doAnswer(new Callable<Void>() {
+                    @Override
+                    public Void call() throws Exception {
+                        latch.countDown();
+                        return null;
+                    }
+                }).when(mock);
+            }
+
+            @Override
+            public Behaviour andReturn(final Object result) {
+                return new Behaviour() {
+                    @Override
+                    public <T> T when(T mock) {
+                        return LittleMock.doAnswer(new Callable<Object>() {
+                            @Override
+                            public Object call() throws Exception {
+                                latch.countDown();
+                                return result;
+                            }
+                        }).when(mock);
+                    }
+                };
+            }
+        };
+    }
+
+    public static void awaitCountDown(CountDownLatch latch, long timeout, TimeUnit unit)
+            throws InterruptedException {
+        Assert.assertTrue("Waited too long for method call", latch.await(timeout, unit));
+    }
+}
diff --git a/tests/WebViewTests/src/com/android/webviewtests/JavaBridgeCoercionTest.java b/tests/WebViewTests/src/com/android/webviewtests/JavaBridgeCoercionTest.java
index 9aed888..a0f78a4 100644
--- a/tests/WebViewTests/src/com/android/webviewtests/JavaBridgeCoercionTest.java
+++ b/tests/WebViewTests/src/com/android/webviewtests/JavaBridgeCoercionTest.java
@@ -47,7 +47,6 @@
         private long mLongValue;
         private float mFloatValue;
         private double mDoubleValue;
-        // TODO: Test passing to methods with array parameters.
         private String mStringValue;
         private Object mObjectValue;
         private CustomType mCustomTypeValue;
@@ -100,7 +99,6 @@
             mDoubleValue = x;
             notifyResultIsReady();
         }
-        // TODO: Test passing to methods with array parameters.
         public synchronized void setStringValue(String x) {
             mStringValue = x;
             notifyResultIsReady();
@@ -146,7 +144,6 @@
             waitForResult();
             return mDoubleValue;
         }
-        // TODO: Test passing to methods with array parameters.
         public synchronized String waitForStringValue() {
             waitForResult();
             return mStringValue;
@@ -472,8 +469,6 @@
         assertNull(mTestObject.waitForCustomTypeValue());
     }
 
-    // TODO: Test passing arrays.
-
     // Test passing a JavaScript object to a method of an injected object.
     public void testPassJavaScriptObject() throws Throwable {
         // LIVECONNECT_COMPLIANCE: Should raise a JavaScript exception.
diff --git a/tests/touchlag/Android.mk b/tests/touchlag/Android.mk
new file mode 100644
index 0000000..4f8aa1e
--- /dev/null
+++ b/tests/touchlag/Android.mk
@@ -0,0 +1,14 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+	touchlag.cpp
+
+LOCAL_SHARED_LIBRARIES := \
+	libcutils libutils \
+
+LOCAL_MODULE:= test-touchlag
+
+LOCAL_MODULE_TAGS := tests
+
+include $(BUILD_EXECUTABLE)
diff --git a/tests/touchlag/touchlag.cpp b/tests/touchlag/touchlag.cpp
new file mode 100644
index 0000000..df4befb
--- /dev/null
+++ b/tests/touchlag/touchlag.cpp
@@ -0,0 +1,294 @@
+/*
+ * 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.
+ */
+
+#include <stdint.h>
+#include <sys/types.h>
+
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <linux/fb.h>
+#include <linux/input.h>
+#include <errno.h>
+#include <string.h>
+#include <stdio.h>
+#include <cutils/memory.h>
+#include <asm-generic/mman.h>
+#include <sys/mman.h>
+#include <utils/threads.h>
+#include <unistd.h>
+#include <math.h>
+
+using namespace android;
+
+#ifndef FBIO_WAITFORVSYNC
+#define FBIO_WAITFORVSYNC   _IOW('F', 0x20, __u32)
+#endif
+
+struct Buffer {
+    size_t w;
+    size_t h;
+    size_t s;
+    union {
+        void* addr;
+        uint32_t* pixels;
+    };
+};
+
+void clearBuffer(Buffer* buf, uint32_t pixel) {
+    android_memset32(buf->pixels, pixel, buf->s * buf->h * 4);
+}
+
+void drawTwoPixels(Buffer* buf, uint32_t pixel, ssize_t x, ssize_t y, size_t w) {
+    if (y>0 && y<ssize_t(buf->h)) {
+        uint32_t* bits = buf->pixels + y * buf->s;
+        if (x>=0 && x<buf->w) {
+            bits[x] = pixel;
+        }
+        ssize_t W(w);
+        if ((x+W)>=0 && (x+W)<buf->w) {
+            bits[x+W] = pixel;
+        }
+    }
+}
+
+void drawHLine(Buffer* buf, uint32_t pixel, ssize_t x, ssize_t y, size_t w) {
+    if (y>0 && y<ssize_t(buf->h)) {
+        ssize_t W(w);
+        if (x<0) {
+            W += x;
+            x = 0;
+        }
+        if (x+w > buf->w) {
+            W = buf->w - x;
+        }
+        if (W>0) {
+            uint32_t* bits = buf->pixels + y * buf->s + x;
+            android_memset32(bits, pixel, W*4);
+        }
+    }
+}
+
+void drawRect(Buffer* buf, uint32_t pixel, ssize_t x, ssize_t y, size_t w, size_t h) {
+    ssize_t W(w), H(h);
+    if (x<0) {
+        w += x;
+        x = 0;
+    }
+    if (y<0) {
+        h += y;
+        y = 0;
+    }
+    if (x+w > buf->w)   W = buf->w - x;
+    if (y+h > buf->h)   H = buf->h - y;
+    if (W>0 && H>0) {
+        uint32_t* bits = buf->pixels + y * buf->s + x;
+        for (ssize_t i=0 ; i<H ; i++) {
+            android_memset32(bits, pixel, W*4);
+            bits += buf->s;
+        }
+    }
+}
+
+void drawCircle(Buffer* buf, uint32_t pixel,
+        size_t x0, size_t y0, size_t radius, bool filled = false) {
+    ssize_t f = 1 - radius;
+    ssize_t ddF_x = 1;
+    ssize_t ddF_y = -2 * radius;
+    ssize_t x = 0;
+    ssize_t y = radius;
+    if (filled) {
+        drawHLine(buf, pixel, x0-radius, y0, 2*radius);
+    } else {
+        drawTwoPixels(buf, pixel, x0-radius, y0, 2*radius);
+    }
+    while (x < y) {
+        if (f >= 0) {
+            y--;
+            ddF_y += 2;
+            f += ddF_y;
+        }
+        x++;
+        ddF_x += 2;
+        f += ddF_x;
+        if (filled) {
+            drawHLine(buf, pixel, x0-x, y0+y, 2*x);
+            drawHLine(buf, pixel, x0-x, y0-y, 2*x);
+            drawHLine(buf, pixel, x0-y, y0+x, 2*y);
+            drawHLine(buf, pixel, x0-y, y0-x, 2*y);
+        } else {
+            drawTwoPixels(buf, pixel, x0-x, y0+y, 2*x);
+            drawTwoPixels(buf, pixel, x0-x, y0-y, 2*x);
+            drawTwoPixels(buf, pixel, x0-y, y0+x, 2*y);
+            drawTwoPixels(buf, pixel, x0-y, y0-x, 2*y);
+        }
+    }
+}
+
+class TouchEvents {
+    class EventThread : public Thread {
+        int fd;
+
+        virtual bool threadLoop() {
+            input_event event;
+            int first_down = 0;
+            do {
+                read(fd, &event, sizeof(event));
+                if (event.type == EV_ABS) {
+                    if (event.code == ABS_MT_TRACKING_ID) {
+                        down = event.value == -1 ? 0 : 1;
+                        first_down = down;
+                    }
+                    if (event.code == ABS_MT_POSITION_X) {
+                        x = event.value;
+                    }
+                    if (event.code == ABS_MT_POSITION_Y) {
+                        y = event.value;
+                    }
+                }
+            } while (event.type == EV_SYN);
+            return true;
+        }
+
+    public:
+        int x, y, down;
+        EventThread() : Thread(false),
+                x(0), y(0), down(0)
+        {
+            fd = open("/dev/input/event1", O_RDONLY);
+        }
+};
+    sp<EventThread> thread;
+
+public:
+    TouchEvents() {
+        thread = new EventThread();
+        thread->run("EventThread", PRIORITY_URGENT_DISPLAY);
+    }
+
+    int getMostRecentPosition(int* x, int* y) {
+        *x = thread->x;
+        *y = thread->y;
+        return thread->down;
+    }
+};
+
+
+struct Queue {
+    struct position {
+        int x, y;
+    };
+    int index;
+    position q[16];
+    Queue() : index(0) { }
+    void push(int x, int y) {
+        index++;
+        index &= 0xF;
+        q[index].x = x;
+        q[index].y = y;
+    }
+    void get(int lag, int* x, int* y) {
+        const int i = (index - lag) & 0xF;
+        *x = q[i].x;
+        *y = q[i].y;
+    }
+};
+
+extern char *optarg;
+extern int optind;
+extern int optopt;
+extern int opterr;
+extern int optreset;
+
+void usage(const char* name) {
+    printf("\nusage: %s [-h] [-l lag]\n", name);
+}
+
+int main(int argc, char** argv) {
+    fb_var_screeninfo vi;
+    fb_fix_screeninfo fi;
+
+    int lag = 0;
+    int fd = open("/dev/graphics/fb0", O_RDWR);
+    ioctl(fd, FBIOGET_VSCREENINFO, &vi);
+    ioctl(fd, FBIOGET_FSCREENINFO, &fi);
+    void* bits = mmap(0, fi.smem_len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+    Buffer framebuffer;
+    framebuffer.w = vi.xres;
+    framebuffer.h = vi.yres;
+    framebuffer.s = fi.line_length / (vi.bits_per_pixel >> 3);
+    framebuffer.addr = bits;
+
+    int ch;
+    while ((ch = getopt(argc, argv, "hl:")) != -1) {
+        switch (ch) {
+            case 'l':
+                lag = atoi(optarg);
+                break;
+            case 'h':
+            default:
+                usage(argv[0]);
+                exit(0);
+        }
+    }
+    argc -= optind;
+    argv += optind;
+
+
+    TouchEvents touch;
+    Queue queue;
+
+
+    int x=0, y=0, down=0;
+    int lag_x=0, lag_y=0;
+
+    clearBuffer(&framebuffer, 0);
+    while (true) {
+        uint32_t crt = 0;
+        int err = ioctl(fd, FBIO_WAITFORVSYNC, &crt);
+
+        // draw beam marker
+        drawRect(&framebuffer, 0x400000, framebuffer.w-2, 0, 2, framebuffer.h);
+        // erase screen
+        if (lag) {
+            drawCircle(&framebuffer, 0, lag_x, lag_y, 100);
+            drawHLine(&framebuffer, 0, 0, lag_y, 32);
+        }
+        drawCircle(&framebuffer, 0, x, y, 100, true);
+        drawHLine(&framebuffer, 0, 0, y, 32);
+
+        // draw a line at y=1000
+        drawHLine(&framebuffer, 0x808080, 0, 1000, framebuffer.w);
+
+        // get touch events
+        touch.getMostRecentPosition(&x, &y);
+        queue.push(x, y);
+        queue.get(lag, &lag_x, &lag_y);
+
+        if (lag) {
+            drawCircle(&framebuffer, 0x00FF00, lag_x, lag_y, 100);
+            drawHLine(&framebuffer, 0x00FF00, 0, lag_y, 32);
+        }
+
+        drawCircle(&framebuffer, 0xFFFFFF, x, y, 100, true);
+        drawHLine(&framebuffer, 0xFFFFFF, 0, y, 32);
+
+        // draw end of frame beam marker
+        drawRect(&framebuffer, 0x004000, framebuffer.w-2, 0, 2, framebuffer.h);
+    }
+
+    close(fd);
+    return 0;
+}
diff --git a/tools/aapt/AaptAssets.cpp b/tools/aapt/AaptAssets.cpp
index f0c215e..ec61403 100644
--- a/tools/aapt/AaptAssets.cpp
+++ b/tools/aapt/AaptAssets.cpp
@@ -1084,12 +1084,17 @@
         if (out) out->density = ResTable_config::DENSITY_HIGH;
         return true;
     }
-    
+
     if (strcmp(name, "xhdpi") == 0) {
-        if (out) out->density = ResTable_config::DENSITY_MEDIUM*2;
+        if (out) out->density = ResTable_config::DENSITY_XHIGH;
         return true;
     }
-    
+
+    if (strcmp(name, "xxhdpi") == 0) {
+        if (out) out->density = ResTable_config::DENSITY_XXHIGH;
+        return true;
+    }
+
     char* c = (char*)name;
     while (*c >= '0' && *c <= '9') {
         c++;
@@ -1832,6 +1837,49 @@
 // =========================================================================
 // =========================================================================
 
+status_t AaptSymbols::applyJavaSymbols(const sp<AaptSymbols>& javaSymbols)
+{
+    status_t err = NO_ERROR;
+    size_t N = javaSymbols->mSymbols.size();
+    for (size_t i=0; i<N; i++) {
+        const String8& name = javaSymbols->mSymbols.keyAt(i);
+        const AaptSymbolEntry& entry = javaSymbols->mSymbols.valueAt(i);
+        ssize_t pos = mSymbols.indexOfKey(name);
+        if (pos < 0) {
+            entry.sourcePos.error("Symbol '%s' declared with <java-symbol> not defined\n", name.string());
+            err = UNKNOWN_ERROR;
+            continue;
+        }
+        //printf("**** setting symbol #%d/%d %s to isJavaSymbol=%d\n",
+        //        i, N, name.string(), entry.isJavaSymbol ? 1 : 0);
+        mSymbols.editValueAt(pos).isJavaSymbol = entry.isJavaSymbol;
+    }
+
+    N = javaSymbols->mNestedSymbols.size();
+    for (size_t i=0; i<N; i++) {
+        const String8& name = javaSymbols->mNestedSymbols.keyAt(i);
+        const sp<AaptSymbols>& symbols = javaSymbols->mNestedSymbols.valueAt(i);
+        ssize_t pos = mNestedSymbols.indexOfKey(name);
+        if (pos < 0) {
+            SourcePos pos;
+            pos.error("Java symbol dir %s not defined\n", name.string());
+            err = UNKNOWN_ERROR;
+            continue;
+        }
+        //printf("**** applying java symbols in dir %s\n", name.string());
+        status_t myerr = mNestedSymbols.valueAt(pos)->applyJavaSymbols(symbols);
+        if (myerr != NO_ERROR) {
+            err = myerr;
+        }
+    }
+
+    return err;
+}
+
+// =========================================================================
+// =========================================================================
+// =========================================================================
+
 AaptAssets::AaptAssets()
     : AaptDir(String8(), String8()),
       mChanged(false), mHaveIncludedAssets(false), mRes(NULL)
@@ -2399,6 +2447,48 @@
     return sym;
 }
 
+sp<AaptSymbols> AaptAssets::getJavaSymbolsFor(const String8& name)
+{
+    sp<AaptSymbols> sym = mJavaSymbols.valueFor(name);
+    if (sym == NULL) {
+        sym = new AaptSymbols();
+        mJavaSymbols.add(name, sym);
+    }
+    return sym;
+}
+
+status_t AaptAssets::applyJavaSymbols()
+{
+    size_t N = mJavaSymbols.size();
+    for (size_t i=0; i<N; i++) {
+        const String8& name = mJavaSymbols.keyAt(i);
+        const sp<AaptSymbols>& symbols = mJavaSymbols.valueAt(i);
+        ssize_t pos = mSymbols.indexOfKey(name);
+        if (pos < 0) {
+            SourcePos pos;
+            pos.error("Java symbol dir %s not defined\n", name.string());
+            return UNKNOWN_ERROR;
+        }
+        //printf("**** applying java symbols in dir %s\n", name.string());
+        status_t err = mSymbols.valueAt(pos)->applyJavaSymbols(symbols);
+        if (err != NO_ERROR) {
+            return err;
+        }
+    }
+
+    return NO_ERROR;
+}
+
+bool AaptAssets::isJavaSymbol(const AaptSymbolEntry& sym, bool includePrivate) const {
+    //printf("isJavaSymbol %s: public=%d, includePrivate=%d, isJavaSymbol=%d\n",
+    //        sym.name.string(), sym.isPublic ? 1 : 0, includePrivate ? 1 : 0,
+    //        sym.isJavaSymbol ? 1 : 0);
+    if (!mHavePrivateSymbols) return true;
+    if (sym.isPublic) return true;
+    if (includePrivate && sym.isJavaSymbol) return true;
+    return false;
+}
+
 status_t AaptAssets::buildIncludedResources(Bundle* bundle)
 {
     if (!mHaveIncludedAssets) {
diff --git a/tools/aapt/AaptAssets.h b/tools/aapt/AaptAssets.h
index d5345b2..1c653e1 100644
--- a/tools/aapt/AaptAssets.h
+++ b/tools/aapt/AaptAssets.h
@@ -53,17 +53,6 @@
     AXIS_END = AXIS_VERSION,
 };
 
-enum {
-    SDK_CUPCAKE = 3,
-    SDK_DONUT = 4,
-    SDK_ECLAIR = 5,
-    SDK_ECLAIR_0_1 = 6,
-    SDK_MR1 = 7,
-    SDK_FROYO = 8,
-    SDK_HONEYCOMB_MR2 = 13,
-    SDK_ICE_CREAM_SANDWICH = 14,
-};
-
 /**
  * This structure contains a specific variation of a single file out
  * of all the variations it can have that we can have.
@@ -326,16 +315,16 @@
 {
 public:
     AaptSymbolEntry()
-        : isPublic(false), typeCode(TYPE_UNKNOWN)
+        : isPublic(false), isJavaSymbol(false), typeCode(TYPE_UNKNOWN)
     {
     }
     AaptSymbolEntry(const String8& _name)
-        : name(_name), isPublic(false), typeCode(TYPE_UNKNOWN)
+        : name(_name), isPublic(false), isJavaSymbol(false), typeCode(TYPE_UNKNOWN)
     {
     }
     AaptSymbolEntry(const AaptSymbolEntry& o)
         : name(o.name), sourcePos(o.sourcePos), isPublic(o.isPublic)
-        , comment(o.comment), typeComment(o.typeComment)
+        , isJavaSymbol(o.isJavaSymbol), comment(o.comment), typeComment(o.typeComment)
         , typeCode(o.typeCode), int32Val(o.int32Val), stringVal(o.stringVal)
     {
     }
@@ -343,6 +332,7 @@
     {
         sourcePos = o.sourcePos;
         isPublic = o.isPublic;
+        isJavaSymbol = o.isJavaSymbol;
         comment = o.comment;
         typeComment = o.typeComment;
         typeCode = o.typeCode;
@@ -355,6 +345,7 @@
     
     SourcePos sourcePos;
     bool isPublic;
+    bool isJavaSymbol;
     
     String16 comment;
     String16 typeComment;
@@ -412,6 +403,15 @@
         return NO_ERROR;
     }
 
+    status_t makeSymbolJavaSymbol(const String8& name, const SourcePos& pos) {
+        if (!check_valid_symbol_name(name, pos, "symbol")) {
+            return BAD_VALUE;
+        }
+        AaptSymbolEntry& sym = edit_symbol(name, &pos);
+        sym.isJavaSymbol = true;
+        return NO_ERROR;
+    }
+
     void appendComment(const String8& name, const String16& comment, const SourcePos& pos) {
         if (comment.size() <= 0) {
             return;
@@ -452,6 +452,8 @@
         return sym;
     }
 
+    status_t applyJavaSymbols(const sp<AaptSymbols>& javaSymbols);
+
     const KeyedVector<String8, AaptSymbolEntry>& getSymbols() const
         { return mSymbols; }
     const DefaultKeyedVector<String8, sp<AaptSymbols> >& getNestedSymbols() const
@@ -520,7 +522,11 @@
     virtual ~AaptAssets() { delete mRes; }
 
     const String8& getPackage() const { return mPackage; }
-    void setPackage(const String8& package) { mPackage = package; mSymbolsPrivatePackage = package; }
+    void setPackage(const String8& package) {
+        mPackage = package;
+        mSymbolsPrivatePackage = package;
+        mHavePrivateSymbols = false;
+    }
 
     const SortedVector<AaptGroupEntry>& getGroupEntries() const;
 
@@ -543,11 +549,22 @@
 
     sp<AaptSymbols> getSymbolsFor(const String8& name);
 
+    sp<AaptSymbols> getJavaSymbolsFor(const String8& name);
+
+    status_t applyJavaSymbols();
+
     const DefaultKeyedVector<String8, sp<AaptSymbols> >& getSymbols() const { return mSymbols; }
 
     String8 getSymbolsPrivatePackage() const { return mSymbolsPrivatePackage; }
-    void setSymbolsPrivatePackage(const String8& pkg) { mSymbolsPrivatePackage = pkg; }
-    
+    void setSymbolsPrivatePackage(const String8& pkg) {
+        mSymbolsPrivatePackage = pkg;
+        mHavePrivateSymbols = mSymbolsPrivatePackage != mPackage;
+    }
+
+    bool havePrivateSymbols() const { return mHavePrivateSymbols; }
+
+    bool isJavaSymbol(const AaptSymbolEntry& sym, bool includePrivate) const;
+
     status_t buildIncludedResources(Bundle* bundle);
     status_t addIncludedResources(const sp<AaptFile>& file);
     const ResTable& getIncludedResources() const;
@@ -587,7 +604,9 @@
     String8 mPackage;
     SortedVector<AaptGroupEntry> mGroupEntries;
     DefaultKeyedVector<String8, sp<AaptSymbols> > mSymbols;
+    DefaultKeyedVector<String8, sp<AaptSymbols> > mJavaSymbols;
     String8 mSymbolsPrivatePackage;
+    bool mHavePrivateSymbols;
 
     Vector<sp<AaptDir> > mResDirs;
 
diff --git a/tools/aapt/Bundle.h b/tools/aapt/Bundle.h
index 2d1060b..8e3a1c9 100644
--- a/tools/aapt/Bundle.h
+++ b/tools/aapt/Bundle.h
@@ -14,6 +14,18 @@
 #include <utils/String8.h>
 #include <utils/Vector.h>
 
+enum {
+    SDK_CUPCAKE = 3,
+    SDK_DONUT = 4,
+    SDK_ECLAIR = 5,
+    SDK_ECLAIR_0_1 = 6,
+    SDK_MR1 = 7,
+    SDK_FROYO = 8,
+    SDK_HONEYCOMB_MR2 = 13,
+    SDK_ICE_CREAM_SANDWICH = 14,
+    SDK_ICE_CREAM_SANDWICH_MR1 = 15,
+};
+
 /*
  * Things we can do.
  */
@@ -82,7 +94,6 @@
     void setRequireLocalization(bool val) { mRequireLocalization = val; }
     bool getPseudolocalize(void) const { return mPseudolocalize; }
     void setPseudolocalize(bool val) { mPseudolocalize = val; }
-    bool getWantUTF16(void) const { return mWantUTF16; }
     void setWantUTF16(bool val) { mWantUTF16 = val; }
     bool getValues(void) const { return mValues; }
     void setValues(bool val) { mValues = val; }
@@ -103,6 +114,10 @@
     bool getGenDependencies() { return mGenDependencies; }
     void setGenDependencies(bool val) { mGenDependencies = val; }
 
+    bool getUTF16StringsOption() {
+        return mWantUTF16 || !isMinSdkAtLeast(SDK_FROYO);
+    }
+
     /*
      * Input options.
      */
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp
index 89942de..c79e243 100644
--- a/tools/aapt/Command.cpp
+++ b/tools/aapt/Command.cpp
@@ -479,6 +479,11 @@
 #ifndef HAVE_ANDROID_OS
         res.print(bundle->getValues());
 #endif
+
+    } else if (strcmp("strings", option) == 0) {
+        const ResStringPool* pool = res.getTableStringBlock(0);
+        printStringPool(pool);
+
     } else if (strcmp("xmltree", option) == 0) {
         if (bundle->getFileSpecCount() < 3) {
             fprintf(stderr, "ERROR: no dump xmltree resource file specified\n");
@@ -1382,7 +1387,7 @@
                 delete dir;
             }
         } else if (strcmp("badger", option) == 0) {
-            printf(CONSOLE_DATA);
+            printf("%s", CONSOLE_DATA);
         } else if (strcmp("configurations", option) == 0) {
             Vector<ResTable_config> configs;
             res.getConfigurations(&configs);
@@ -1612,6 +1617,12 @@
         goto bail;
     }
 
+    // Update symbols with information about which ones are needed as Java symbols.
+    assets->applyJavaSymbols();
+    if (SourcePos::hasErrors()) {
+        goto bail;
+    }
+
     // If we've been asked to generate a dependency file, do that here
     if (bundle->getGenDependencies()) {
         // If this is the packaging step, generate the dependency file next to
@@ -1633,7 +1644,7 @@
     }
 
     // Write out R.java constants
-    if (assets->getPackage() == assets->getSymbolsPrivatePackage()) {
+    if (!assets->havePrivateSymbols()) {
         if (bundle->getCustomPackage() == NULL) {
             // Write the R.java file into the appropriate class directory
             // e.g. gen/com/foo/app/R.java
diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp
index 1ecf7da..7eaf528 100644
--- a/tools/aapt/Resource.cpp
+++ b/tools/aapt/Resource.cpp
@@ -847,8 +847,7 @@
      * request UTF-16 encoding and the parameters of this package
      * allow UTF-8 to be used.
      */
-    if (!bundle->getWantUTF16()
-            && bundle->isMinSdkAtLeast(SDK_FROYO)) {
+    if (!bundle->getUTF16StringsOption()) {
         xmlFlags |= XML_COMPILE_UTF8;
     }
 
@@ -1809,7 +1808,7 @@
         if (sym.typeCode != AaptSymbolEntry::TYPE_INT32) {
             continue;
         }
-        if (!includePrivate && !sym.isPublic) {
+        if (!assets->isJavaSymbol(sym, includePrivate)) {
             continue;
         }
         String16 name(sym.name);
@@ -1865,7 +1864,7 @@
         if (sym.typeCode != AaptSymbolEntry::TYPE_STRING) {
             continue;
         }
-        if (!includePrivate && !sym.isPublic) {
+        if (!assets->isJavaSymbol(sym, includePrivate)) {
             continue;
         }
         String16 name(sym.name);
@@ -1977,7 +1976,8 @@
         "\n"
         "package %s;\n\n", package.string());
 
-        status_t err = writeSymbolClass(fp, assets, includePrivate, symbols, className, 0, bundle->getNonConstantId());
+        status_t err = writeSymbolClass(fp, assets, includePrivate, symbols,
+                className, 0, bundle->getNonConstantId());
         if (err != NO_ERROR) {
             return err;
         }
diff --git a/tools/aapt/ResourceTable.cpp b/tools/aapt/ResourceTable.cpp
index fdb39ca..7a0499c 100644
--- a/tools/aapt/ResourceTable.cpp
+++ b/tools/aapt/ResourceTable.cpp
@@ -753,6 +753,7 @@
     const String16 public16("public");
     const String16 public_padding16("public-padding");
     const String16 private_symbols16("private-symbols");
+    const String16 java_symbol16("java-symbol");
     const String16 add_resource16("add-resource");
     const String16 skip16("skip");
     const String16 eat_comment16("eat-comment");
@@ -1058,6 +1059,49 @@
                 }
                 continue;
 
+            } else if (strcmp16(block.getElementName(&len), java_symbol16.string()) == 0) {
+                SourcePos srcPos(in->getPrintableSource(), block.getLineNumber());
+            
+                String16 type;
+                ssize_t typeIdx = block.indexOfAttribute(NULL, "type");
+                if (typeIdx < 0) {
+                    srcPos.error("A 'type' attribute is required for <public>\n");
+                    hasErrors = localHasErrors = true;
+                }
+                type = String16(block.getAttributeStringValue(typeIdx, &len));
+
+                String16 name;
+                ssize_t nameIdx = block.indexOfAttribute(NULL, "name");
+                if (nameIdx < 0) {
+                    srcPos.error("A 'name' attribute is required for <public>\n");
+                    hasErrors = localHasErrors = true;
+                }
+                name = String16(block.getAttributeStringValue(nameIdx, &len));
+
+                sp<AaptSymbols> symbols = assets->getJavaSymbolsFor(String8("R"));
+                if (symbols != NULL) {
+                    symbols = symbols->addNestedSymbol(String8(type), srcPos);
+                }
+                if (symbols != NULL) {
+                    symbols->makeSymbolJavaSymbol(String8(name), srcPos);
+                    String16 comment(
+                        block.getComment(&len) ? block.getComment(&len) : nulStr);
+                    symbols->appendComment(String8(name), comment, srcPos);
+                } else {
+                    srcPos.error("Unable to create symbols!\n");
+                    hasErrors = localHasErrors = true;
+                }
+
+                while ((code=block.next()) != ResXMLTree::END_DOCUMENT && code != ResXMLTree::BAD_DOCUMENT) {
+                    if (code == ResXMLTree::END_TAG) {
+                        if (strcmp16(block.getElementName(&len), java_symbol16.string()) == 0) {
+                            break;
+                        }
+                    }
+                }
+                continue;
+
+
             } else if (strcmp16(block.getElementName(&len), add_resource16.string()) == 0) {
                 SourcePos srcPos(in->getPrintableSource(), block.getLineNumber());
             
@@ -2047,7 +2091,8 @@
                                   uint32_t attrID,
                                   const Vector<StringPool::entry_style_span>* style,
                                   String16* outStr, void* accessorCookie,
-                                  uint32_t attrType)
+                                  uint32_t attrType, const String8* configTypeName,
+                                  const ConfigDescription* config)
 {
     String16 finalStr;
 
@@ -2075,10 +2120,19 @@
     if (outValue->dataType == outValue->TYPE_STRING) {
         // Should do better merging styles.
         if (pool) {
-            if (style != NULL && style->size() > 0) {
-                outValue->data = pool->add(finalStr, *style);
+            String8 configStr;
+            if (config != NULL) {
+                configStr = config->toString();
             } else {
-                outValue->data = pool->add(finalStr, true);
+                configStr = "(null)";
+            }
+            NOISY(printf("Adding to pool string style #%d config %s: %s\n",
+                    style != NULL ? style->size() : 0,
+                    configStr.string(), String8(finalStr).string()));
+            if (style != NULL && style->size() > 0) {
+                outValue->data = pool->add(finalStr, *style, configTypeName, config);
+            } else {
+                outValue->data = pool->add(finalStr, true, configTypeName, config);
             }
         } else {
             // Caller will fill this in later.
@@ -2537,16 +2591,19 @@
         return err;
     }
 
+    const ConfigDescription nullConfig;
+
     const size_t N = mOrderedPackages.size();
     size_t pi;
 
     const static String16 mipmap16("mipmap");
 
-    bool useUTF8 = !bundle->getWantUTF16() && bundle->isMinSdkAtLeast(SDK_FROYO);
+    bool useUTF8 = !bundle->getUTF16StringsOption();
 
     // Iterate through all data, collecting all values (strings,
     // references, etc).
     StringPool valueStrings = StringPool(false, useUTF8);
+    Vector<sp<Entry> > allEntries;
     for (pi=0; pi<N; pi++) {
         sp<Package> p = mOrderedPackages.itemAt(pi);
         if (p->getTypes().size() == 0) {
@@ -2567,6 +2624,19 @@
             const String16 typeName(t->getName());
             typeStrings.add(typeName, false);
 
+            // This is a hack to tweak the sorting order of the final strings,
+            // to put stuff that is generally not language-specific first.
+            String8 configTypeName(typeName);
+            if (configTypeName == "drawable" || configTypeName == "layout"
+                    || configTypeName == "color" || configTypeName == "anim"
+                    || configTypeName == "interpolator" || configTypeName == "animator"
+                    || configTypeName == "xml" || configTypeName == "menu"
+                    || configTypeName == "mipmap" || configTypeName == "raw") {
+                configTypeName = "1complex";
+            } else {
+                configTypeName = "2value";
+            }
+
             const bool filterable = (typeName != mipmap16);
 
             const size_t N = t->getOrderedConfigs().size();
@@ -2586,10 +2656,21 @@
                         continue;
                     }
                     e->setNameIndex(keyStrings.add(e->getName(), true));
-                    status_t err = e->prepareFlatten(&valueStrings, this);
+
+                    // If this entry has no values for other configs,
+                    // and is the default config, then it is special.  Otherwise
+                    // we want to add it with the config info.
+                    ConfigDescription* valueConfig = NULL;
+                    if (N != 1 || config == nullConfig) {
+                        valueConfig = &config;
+                    }
+
+                    status_t err = e->prepareFlatten(&valueStrings, this,
+                            &configTypeName, &config);
                     if (err != NO_ERROR) {
                         return err;
                     }
+                    allEntries.add(e);
                 }
             }
         }
@@ -2598,6 +2679,17 @@
         p->setKeyStrings(keyStrings.createStringBlock());
     }
 
+    if (bundle->getOutputAPKFile() != NULL) {
+        // Now we want to sort the value strings for better locality.  This will
+        // cause the positions of the strings to change, so we need to go back
+        // through out resource entries and update them accordingly.  Only need
+        // to do this if actually writing the output file.
+        valueStrings.sortByConfig();
+        for (pi=0; pi<allEntries.size(); pi++) {
+            allEntries[pi]->remapStringValue(&valueStrings);
+        }
+    }
+
     ssize_t strAmt = 0;
     
     // Now build the array of package chunks.
@@ -3137,14 +3229,16 @@
     return hasErrors ? UNKNOWN_ERROR : NO_ERROR;
 }
 
-status_t ResourceTable::Entry::prepareFlatten(StringPool* strings, ResourceTable* table)
+status_t ResourceTable::Entry::prepareFlatten(StringPool* strings, ResourceTable* table,
+        const String8* configTypeName, const ConfigDescription* config)
 {
     if (mType == TYPE_ITEM) {
         Item& it = mItem;
         AccessorCookie ac(it.sourcePos, String8(mName), String8(it.value));
         if (!table->stringToValue(&it.parsedValue, strings,
                                   it.value, false, true, 0,
-                                  &it.style, NULL, &ac, mItemFormat)) {
+                                  &it.style, NULL, &ac, mItemFormat,
+                                  configTypeName, config)) {
             return UNKNOWN_ERROR;
         }
     } else if (mType == TYPE_BAG) {
@@ -3155,7 +3249,8 @@
             AccessorCookie ac(it.sourcePos, String8(key), String8(it.value));
             if (!table->stringToValue(&it.parsedValue, strings,
                                       it.value, false, true, it.bagKeyId,
-                                      &it.style, NULL, &ac, it.format)) {
+                                      &it.style, NULL, &ac, it.format,
+                                      configTypeName, config)) {
                 return UNKNOWN_ERROR;
             }
         }
@@ -3167,6 +3262,29 @@
     return NO_ERROR;
 }
 
+status_t ResourceTable::Entry::remapStringValue(StringPool* strings)
+{
+    if (mType == TYPE_ITEM) {
+        Item& it = mItem;
+        if (it.parsedValue.dataType == Res_value::TYPE_STRING) {
+            it.parsedValue.data = strings->mapOriginalPosToNewPos(it.parsedValue.data);
+        }
+    } else if (mType == TYPE_BAG) {
+        const size_t N = mBag.size();
+        for (size_t i=0; i<N; i++) {
+            Item& it = mBag.editValueAt(i);
+            if (it.parsedValue.dataType == Res_value::TYPE_STRING) {
+                it.parsedValue.data = strings->mapOriginalPosToNewPos(it.parsedValue.data);
+            }
+        }
+    } else {
+        mPos.error("Error: entry %s is not a single item or a bag.\n",
+                   String8(mName).string());
+        return UNKNOWN_ERROR;
+    }
+    return NO_ERROR;
+}
+
 ssize_t ResourceTable::Entry::flatten(Bundle* bundle, const sp<AaptFile>& data, bool isPublic)
 {
     size_t amt = 0;
diff --git a/tools/aapt/ResourceTable.h b/tools/aapt/ResourceTable.h
index 8123bb3..a3e0666 100644
--- a/tools/aapt/ResourceTable.h
+++ b/tools/aapt/ResourceTable.h
@@ -76,6 +76,37 @@
     class Type;
     class Entry;
 
+    struct ConfigDescription : public ResTable_config {
+        ConfigDescription() {
+            memset(this, 0, sizeof(*this));
+            size = sizeof(ResTable_config);
+        }
+        ConfigDescription(const ResTable_config&o) {
+            *static_cast<ResTable_config*>(this) = o;
+            size = sizeof(ResTable_config);
+        }
+        ConfigDescription(const ConfigDescription&o) {
+            *static_cast<ResTable_config*>(this) = o;
+        }
+
+        ConfigDescription& operator=(const ResTable_config& o) {
+            *static_cast<ResTable_config*>(this) = o;
+            size = sizeof(ResTable_config);
+            return *this;
+        }
+        ConfigDescription& operator=(const ConfigDescription& o) {
+            *static_cast<ResTable_config*>(this) = o;
+            return *this;
+        }
+
+        inline bool operator<(const ConfigDescription& o) const { return compare(o) < 0; }
+        inline bool operator<=(const ConfigDescription& o) const { return compare(o) <= 0; }
+        inline bool operator==(const ConfigDescription& o) const { return compare(o) == 0; }
+        inline bool operator!=(const ConfigDescription& o) const { return compare(o) != 0; }
+        inline bool operator>=(const ConfigDescription& o) const { return compare(o) >= 0; }
+        inline bool operator>(const ConfigDescription& o) const { return compare(o) > 0; }
+    };
+
     ResourceTable(Bundle* bundle, const String16& assetsPackage);
 
     status_t addIncludedResources(Bundle* bundle, const sp<AaptAssets>& assets);
@@ -183,7 +214,9 @@
                        uint32_t attrID,
                        const Vector<StringPool::entry_style_span>* style = NULL,
                        String16* outStr = NULL, void* accessorCookie = NULL,
-                       uint32_t attrType = ResTable_map::TYPE_ANY);
+                       uint32_t attrType = ResTable_map::TYPE_ANY,
+                       const String8* configTypeName = NULL,
+                       const ConfigDescription* config = NULL);
 
     status_t assignResourceIds();
     status_t addSymbols(const sp<AaptSymbols>& outSymbols = NULL);
@@ -305,7 +338,10 @@
         status_t assignResourceIds(ResourceTable* table,
                                    const String16& package);
 
-        status_t prepareFlatten(StringPool* strings, ResourceTable* table);
+        status_t prepareFlatten(StringPool* strings, ResourceTable* table,
+               const String8* configTypeName, const ConfigDescription* config);
+
+        status_t remapStringValue(StringPool* strings);
 
         ssize_t flatten(Bundle*, const sp<AaptFile>& data, bool isPublic);
 
@@ -322,37 +358,6 @@
         uint32_t mParentId;
         SourcePos mPos;
     };
-
-    struct ConfigDescription : public ResTable_config {
-        ConfigDescription() {
-            memset(this, 0, sizeof(*this));
-            size = sizeof(ResTable_config);
-        }
-        ConfigDescription(const ResTable_config&o) {
-            *static_cast<ResTable_config*>(this) = o;
-            size = sizeof(ResTable_config);
-        }
-        ConfigDescription(const ConfigDescription&o) {
-            *static_cast<ResTable_config*>(this) = o;
-        }
-        
-        ConfigDescription& operator=(const ResTable_config& o) {
-            *static_cast<ResTable_config*>(this) = o;
-            size = sizeof(ResTable_config);
-            return *this;
-        }
-        ConfigDescription& operator=(const ConfigDescription& o) {
-            *static_cast<ResTable_config*>(this) = o;
-            return *this;
-        }
-        
-        inline bool operator<(const ConfigDescription& o) const { return compare(o) < 0; }
-        inline bool operator<=(const ConfigDescription& o) const { return compare(o) <= 0; }
-        inline bool operator==(const ConfigDescription& o) const { return compare(o) == 0; }
-        inline bool operator!=(const ConfigDescription& o) const { return compare(o) != 0; }
-        inline bool operator>=(const ConfigDescription& o) const { return compare(o) >= 0; }
-        inline bool operator>(const ConfigDescription& o) const { return compare(o) > 0; }
-    };
     
     class ConfigList : public RefBase {
     public:
diff --git a/tools/aapt/StringPool.cpp b/tools/aapt/StringPool.cpp
index 9a0a1c4..fe88e37 100644
--- a/tools/aapt/StringPool.cpp
+++ b/tools/aapt/StringPool.cpp
@@ -5,8 +5,10 @@
 //
 
 #include "StringPool.h"
+#include "ResourceTable.h"
 
 #include <utils/ByteOrder.h>
+#include <utils/SortedVector.h>
 
 #if HAVE_PRINTF_ZD
 #  define ZD "%zd"
@@ -30,31 +32,87 @@
 
 void printStringPool(const ResStringPool* pool)
 {
+    SortedVector<const void*> uniqueStrings;
+    const size_t N = pool->size();
+    for (size_t i=0; i<N; i++) {
+        size_t len;
+        if (pool->isUTF8()) {
+            uniqueStrings.add(pool->string8At(i, &len));
+        } else {
+            uniqueStrings.add(pool->stringAt(i, &len));
+        }
+    }
+
+    printf("String pool of " ZD " unique %s %s strings, " ZD " entries and "
+            ZD " styles using " ZD " bytes:\n",
+            (ZD_TYPE)uniqueStrings.size(), pool->isUTF8() ? "UTF-8" : "UTF-16",
+            pool->isSorted() ? "sorted" : "non-sorted",
+            (ZD_TYPE)N, (ZD_TYPE)pool->styleCount(), (ZD_TYPE)pool->bytes());
+
     const size_t NS = pool->size();
     for (size_t s=0; s<NS; s++) {
-        size_t len;
-        const char *str = (const char*)pool->string8At(s, &len);
-        if (str == NULL) {
-            str = String8(pool->stringAt(s, &len)).string();
-        }
-
-        printf("String #" ZD ": %s\n", (ZD_TYPE) s, str);
+        String8 str = pool->string8ObjectAt(s);
+        printf("String #" ZD ": %s\n", (ZD_TYPE) s, str.string());
     }
 }
 
+String8 StringPool::entry::makeConfigsString() const {
+    String8 configStr(configTypeName);
+    if (configStr.size() > 0) configStr.append(" ");
+    if (configs.size() > 0) {
+        for (size_t j=0; j<configs.size(); j++) {
+            if (j > 0) configStr.append(", ");
+            configStr.append(configs[j].toString());
+        }
+    } else {
+        configStr = "(none)";
+    }
+    return configStr;
+}
+
+int StringPool::entry::compare(const entry& o) const {
+    // Strings with styles go first, to reduce the size of the
+    // styles array.
+    if (hasStyles) {
+        return o.hasStyles ? 0 : -1;
+    }
+    if (o.hasStyles) {
+        return 1;
+    }
+    int comp = configTypeName.compare(o.configTypeName);
+    if (comp != 0) {
+        return comp;
+    }
+    const size_t LHN = configs.size();
+    const size_t RHN = o.configs.size();
+    size_t i=0;
+    while (i < LHN && i < RHN) {
+        comp = configs[i].compareLogical(o.configs[i]);
+        if (comp != 0) {
+            return comp;
+        }
+        i++;
+    }
+    if (LHN < RHN) return -1;
+    else if (LHN > RHN) return 1;
+    return 0;
+}
+
 StringPool::StringPool(bool sorted, bool utf8)
     : mSorted(sorted), mUTF8(utf8), mValues(-1), mIdents(-1)
 {
 }
 
-ssize_t StringPool::add(const String16& value, bool mergeDuplicates)
+ssize_t StringPool::add(const String16& value, bool mergeDuplicates,
+        const String8* configTypeName, const ResTable_config* config)
 {
-    return add(String16(), value, mergeDuplicates);
+    return add(String16(), value, mergeDuplicates, configTypeName, config);
 }
 
-ssize_t StringPool::add(const String16& value, const Vector<entry_style_span>& spans)
+ssize_t StringPool::add(const String16& value, const Vector<entry_style_span>& spans,
+        const String8* configTypeName, const ResTable_config* config)
 {
-    ssize_t res = add(String16(), value, false);
+    ssize_t res = add(String16(), value, false, configTypeName, config);
     if (res >= 0) {
         addStyleSpans(res, spans);
     }
@@ -62,7 +120,7 @@
 }
 
 ssize_t StringPool::add(const String16& ident, const String16& value,
-                        bool mergeDuplicates)
+        bool mergeDuplicates, const String8* configTypeName, const ResTable_config* config)
 {
     if (ident.size() > 0) {
         ssize_t idx = mIdents.valueFor(ident);
@@ -84,20 +142,43 @@
         }
     }
 
+    if (configTypeName != NULL) {
+        entry& ent = mEntries.editItemAt(eidx);
+        NOISY(printf("*** adding config type name %s, was %s\n",
+                configTypeName->string(), ent.configTypeName.string()));
+        if (ent.configTypeName.size() <= 0) {
+            ent.configTypeName = *configTypeName;
+        } else if (ent.configTypeName != *configTypeName) {
+            ent.configTypeName = " ";
+        }
+    }
+
+    if (config != NULL) {
+        // Add this to the set of configs associated with the string.
+        entry& ent = mEntries.editItemAt(eidx);
+        size_t addPos;
+        for (addPos=0; addPos<ent.configs.size(); addPos++) {
+            int cmp = ent.configs.itemAt(addPos).compareLogical(*config);
+            if (cmp >= 0) {
+                if (cmp > 0) {
+                    NOISY(printf("*** inserting config: %s\n", config->toString().string()));
+                    ent.configs.insertAt(*config, addPos);
+                }
+                break;
+            }
+        }
+        if (addPos >= ent.configs.size()) {
+            NOISY(printf("*** adding config: %s\n", config->toString().string()));
+            ent.configs.add(*config);
+        }
+    }
+
     const bool first = vidx < 0;
     if (first || !mergeDuplicates) {
         pos = mEntryArray.add(eidx);
         if (first) {
             vidx = mValues.add(value, pos);
-            const size_t N = mEntryArrayToValues.size();
-            for (size_t i=0; i<N; i++) {
-                size_t& e = mEntryArrayToValues.editItemAt(i);
-                if ((ssize_t)e >= vidx) {
-                    e++;
-                }
-            }
         }
-        mEntryArrayToValues.add(vidx);
         if (!mSorted) {
             entry& ent = mEntries.editItemAt(eidx);
             ent.indices.add(pos);
@@ -147,6 +228,7 @@
 
     entry_style& style = mEntryStyleArray.editItemAt(idx);
     style.spans.add(span);
+    mEntries.editItemAt(mEntryArray[idx]).hasStyles = true;
     return NO_ERROR;
 }
 
@@ -169,6 +251,132 @@
     return mIdents.size();
 }
 
+int StringPool::config_sort(const size_t* lhs, const size_t* rhs, void* state)
+{
+    StringPool* pool = (StringPool*)state;
+    const entry& lhe = pool->mEntries[pool->mEntryArray[*lhs]];
+    const entry& rhe = pool->mEntries[pool->mEntryArray[*rhs]];
+    return lhe.compare(rhe);
+}
+
+void StringPool::sortByConfig()
+{
+    LOG_ALWAYS_FATAL_IF(mSorted, "Can't sort string pool containing identifiers.");
+    LOG_ALWAYS_FATAL_IF(mIdents.size() > 0, "Can't sort string pool containing identifiers.");
+    LOG_ALWAYS_FATAL_IF(mOriginalPosToNewPos.size() > 0, "Can't sort string pool after already sorted.");
+
+    const size_t N = mEntryArray.size();
+
+    // This is a vector that starts out with a 1:1 mapping to entries
+    // in the array, which we will sort to come up with the desired order.
+    // At that point it maps from the new position in the array to the
+    // original position the entry appeared.
+    Vector<size_t> newPosToOriginalPos;
+    for (size_t i=0; i<mEntryArray.size(); i++) {
+        newPosToOriginalPos.add(i);
+    }
+
+    // Sort the array.
+    NOISY(printf("SORTING STRINGS BY CONFIGURATION...\n"));
+    newPosToOriginalPos.sort(config_sort, this);
+    NOISY(printf("DONE SORTING STRINGS BY CONFIGURATION.\n"));
+
+    // Create the reverse mapping from the original position in the array
+    // to the new position where it appears in the sorted array.  This is
+    // so that clients can re-map any positions they had previously stored.
+    mOriginalPosToNewPos = newPosToOriginalPos;
+    for (size_t i=0; i<N; i++) {
+        mOriginalPosToNewPos.editItemAt(newPosToOriginalPos[i]) = i;
+    }
+
+#if 0
+    SortedVector<entry> entries;
+
+    for (size_t i=0; i<N; i++) {
+        printf("#%d was %d: %s\n", i, newPosToOriginalPos[i],
+                mEntries[mEntryArray[newPosToOriginalPos[i]]].makeConfigsString().string());
+        entries.add(mEntries[mEntryArray[i]]);
+    }
+
+    for (size_t i=0; i<entries.size(); i++) {
+        printf("Sorted config #%d: %s\n", i,
+                entries[i].makeConfigsString().string());
+    }
+#endif
+
+    // Now we rebuild the arrays.
+    Vector<entry> newEntries;
+    Vector<size_t> newEntryArray;
+    Vector<entry_style> newEntryStyleArray;
+    DefaultKeyedVector<size_t, size_t> origOffsetToNewOffset;
+
+    for (size_t i=0; i<N; i++) {
+        // We are filling in new offset 'i'; oldI is where we can find it
+        // in the original data structure.
+        size_t oldI = newPosToOriginalPos[i];
+        // This is the actual entry associated with the old offset.
+        const entry& oldEnt = mEntries[mEntryArray[oldI]];
+        // This is the same entry the last time we added it to the
+        // new entry array, if any.
+        ssize_t newIndexOfOffset = origOffsetToNewOffset.indexOfKey(oldI);
+        size_t newOffset;
+        if (newIndexOfOffset < 0) {
+            // This is the first time we have seen the entry, so add
+            // it.
+            newOffset = newEntries.add(oldEnt);
+            newEntries.editItemAt(newOffset).indices.clear();
+        } else {
+            // We have seen this entry before, use the existing one
+            // instead of adding it again.
+            newOffset = origOffsetToNewOffset.valueAt(newIndexOfOffset);
+        }
+        // Update the indices to include this new position.
+        newEntries.editItemAt(newOffset).indices.add(i);
+        // And add the offset of the entry to the new entry array.
+        newEntryArray.add(newOffset);
+        // Add any old style to the new style array.
+        if (mEntryStyleArray.size() > 0) {
+            if (oldI < mEntryStyleArray.size()) {
+                newEntryStyleArray.add(mEntryStyleArray[oldI]);
+            } else {
+                newEntryStyleArray.add(entry_style());
+            }
+        }
+    }
+
+    // Now trim any entries at the end of the new style array that are
+    // not needed.
+    for (ssize_t i=newEntryStyleArray.size()-1; i>=0; i--) {
+        const entry_style& style = newEntryStyleArray[i];
+        if (style.spans.size() > 0) {
+            // That's it.
+            break;
+        }
+        // This one is not needed; remove.
+        newEntryStyleArray.removeAt(i);
+    }
+
+    // All done, install the new data structures and upate mValues with
+    // the new positions.
+    mEntries = newEntries;
+    mEntryArray = newEntryArray;
+    mEntryStyleArray = newEntryStyleArray;
+    mValues.clear();
+    for (size_t i=0; i<mEntries.size(); i++) {
+        const entry& ent = mEntries[i];
+        mValues.add(ent.value, ent.indices[0]);
+    }
+
+#if 0
+    printf("FINAL SORTED STRING CONFIGS:\n");
+    for (size_t i=0; i<mEntries.size(); i++) {
+        const entry& ent = mEntries[i];
+        printf("#" ZD " %s: %s\n", (ZD_TYPE)i, ent.makeConfigsString().string(),
+                String8(ent.value).string());
+    }
+#endif
+}
+
 sp<AaptFile> StringPool::createStringBlock()
 {
     sp<AaptFile> pool = new AaptFile(String8(), AaptGroupEntry(),
diff --git a/tools/aapt/StringPool.h b/tools/aapt/StringPool.h
index 7275259..255bdbf 100644
--- a/tools/aapt/StringPool.h
+++ b/tools/aapt/StringPool.h
@@ -40,12 +40,28 @@
 public:
     struct entry {
         entry() : offset(0) { }
-        entry(const String16& _value) : value(_value), offset(0) { }
-        entry(const entry& o) : value(o.value), offset(o.offset), indices(o.indices) { }
+        entry(const String16& _value) : value(_value), offset(0), hasStyles(false) { }
+        entry(const entry& o) : value(o.value), offset(o.offset),
+                hasStyles(o.hasStyles), indices(o.indices),
+                configTypeName(o.configTypeName), configs(o.configs) { }
 
         String16 value;
         size_t offset;
+        bool hasStyles;
         Vector<size_t> indices;
+        String8 configTypeName;
+        Vector<ResTable_config> configs;
+
+        String8 makeConfigsString() const;
+
+        int compare(const entry& o) const;
+
+        inline bool operator<(const entry& o) const { return compare(o) < 0; }
+        inline bool operator<=(const entry& o) const { return compare(o) <= 0; }
+        inline bool operator==(const entry& o) const { return compare(o) == 0; }
+        inline bool operator!=(const entry& o) const { return compare(o) != 0; }
+        inline bool operator>=(const entry& o) const { return compare(o) >= 0; }
+        inline bool operator>(const entry& o) const { return compare(o) > 0; }
     };
 
     struct entry_style_span {
@@ -84,12 +100,15 @@
      * if this string pool is sorted, the returned index will not be valid
      * when the pool is finally written.
      */
-    ssize_t add(const String16& value, bool mergeDuplicates = false);
+    ssize_t add(const String16& value, bool mergeDuplicates = false,
+            const String8* configTypeName = NULL, const ResTable_config* config = NULL);
 
-    ssize_t add(const String16& value, const Vector<entry_style_span>& spans);
+    ssize_t add(const String16& value, const Vector<entry_style_span>& spans,
+            const String8* configTypeName = NULL, const ResTable_config* config = NULL);
 
     ssize_t add(const String16& ident, const String16& value,
-                bool mergeDuplicates = false);
+                bool mergeDuplicates = false,
+                const String8* configTypeName = NULL, const ResTable_config* config = NULL);
 
     status_t addStyleSpan(size_t idx, const String16& name,
                           uint32_t start, uint32_t end);
@@ -102,6 +121,18 @@
 
     size_t countIdentifiers() const;
 
+    // Sort the contents of the string block by the configuration associated
+    // with each item.  After doing this you can use mapOriginalPosToNewPos()
+    // to find out the new position given the position originall returned by
+    // add().
+    void sortByConfig();
+
+    // For use after sortByConfig() to map from the original position of
+    // a string to its new sorted position.
+    size_t mapOriginalPosToNewPos(size_t originalPos) const {
+        return mOriginalPosToNewPos.itemAt(originalPos);
+    }
+
     sp<AaptFile> createStringBlock();
 
     status_t writeStringBlock(const sp<AaptFile>& pool);
@@ -125,27 +156,41 @@
     const Vector<size_t>* offsetsForString(const String16& val) const;
 
 private:
+    static int config_sort(const size_t* lhs, const size_t* rhs, void* state);
+
     const bool                              mSorted;
     const bool                              mUTF8;
-    // Raw array of unique strings, in some arbitrary order.
+
+    // The following data structures represent the actual structures
+    // that will be generated for the final string pool.
+
+    // Raw array of unique strings, in some arbitrary order.  This is the
+    // actual strings that appear in the final string pool, in the order
+    // that they will be written.
     Vector<entry>                           mEntries;
     // Array of indices into mEntries, in the order they were
     // added to the pool.  This can be different than mEntries
     // if the same string was added multiple times (it will appear
     // once in mEntries, with multiple occurrences in this array).
+    // This is the lookup array that will be written for finding
+    // the string for each offset/position in the string pool.
     Vector<size_t>                          mEntryArray;
     // Optional style span information associated with each index of
     // mEntryArray.
     Vector<entry_style>                     mEntryStyleArray;
-    // Mapping from indices in mEntryArray to indices in mValues.
-    Vector<size_t>                          mEntryArrayToValues;
+
+    // The following data structures are used for book-keeping as the
+    // string pool is constructed.
+
     // Unique set of all the strings added to the pool, mapped to
     // the first index of mEntryArray where the value was added.
     DefaultKeyedVector<String16, ssize_t>   mValues;
     // Unique set of all (optional) identifiers of strings in the
     // pool, mapping to indices in mEntries.
     DefaultKeyedVector<String16, ssize_t>   mIdents;
-
+    // This array maps from the original position a string was placed at
+    // in mEntryArray to its new position after being sorted with sortByConfig().
+    Vector<size_t>                          mOriginalPosToNewPos;
 };
 
 #endif
diff --git a/tools/aapt/XMLNode.cpp b/tools/aapt/XMLNode.cpp
index c0d7427..95a68d1 100644
--- a/tools/aapt/XMLNode.cpp
+++ b/tools/aapt/XMLNode.cpp
@@ -45,6 +45,7 @@
 
 static const String16 RESOURCES_PREFIX(RESOURCES_ROOT_NAMESPACE);
 static const String16 RESOURCES_PRV_PREFIX(RESOURCES_ROOT_PRV_NAMESPACE);
+static const String16 RESOURCES_TOOLS_NAMESPACE("http://schemas.android.com/tools");
 
 String16 getNamespaceResourcePackage(String16 namespaceUri, bool* outIsPublic)
 {
@@ -761,13 +762,16 @@
         SourcePos(mFilename, getStartLineNumber()).error("Child to CDATA node.");
         return UNKNOWN_ERROR;
     }
-    attribute_entry e;
-    e.index = mNextAttributeIndex++;
-    e.ns = ns;
-    e.name = name;
-    e.string = value;
-    mAttributes.add(e);
-    mAttributeOrder.add(e.index, mAttributes.size()-1);
+
+    if (ns != RESOURCES_TOOLS_NAMESPACE) {
+        attribute_entry e;
+        e.index = mNextAttributeIndex++;
+        e.ns = ns;
+        e.name = name;
+        e.string = value;
+        mAttributes.add(e);
+        mAttributeOrder.add(e.index, mAttributes.size()-1);
+    }
     return NO_ERROR;
 }
 
@@ -1215,11 +1219,13 @@
     collect_attr_strings(dest, outResIds, true);
     
     int i;
-    if (mNamespacePrefix.size() > 0) {
-        dest->add(mNamespacePrefix, true);
-    }
-    if (mNamespaceUri.size() > 0) {
-        dest->add(mNamespaceUri, true);
+    if (RESOURCES_TOOLS_NAMESPACE != mNamespaceUri) {
+        if (mNamespacePrefix.size() > 0) {
+            dest->add(mNamespacePrefix, true);
+        }
+        if (mNamespaceUri.size() > 0) {
+            dest->add(mNamespaceUri, true);
+        }
     }
     if (mElementName.size() > 0) {
         dest->add(mElementName, true);
@@ -1338,6 +1344,7 @@
     const void* extData = NULL;
     size_t extSize = 0;
     ResXMLTree_attribute attr;
+    bool writeCurrentNode = true;
 
     const size_t NA = mAttributes.size();
     const size_t NC = mChildren.size();
@@ -1350,7 +1357,7 @@
     const String16 style16("style");
 
     const type type = getType();
-    
+
     memset(&node, 0, sizeof(node));
     memset(&attr, 0, sizeof(attr));
     node.header.headerSize = htods(sizeof(node));
@@ -1395,17 +1402,21 @@
             }
         }
     } else if (type == TYPE_NAMESPACE) {
-        node.header.type = htods(RES_XML_START_NAMESPACE_TYPE);
-        extData = &namespaceExt;
-        extSize = sizeof(namespaceExt);
-        memset(&namespaceExt, 0, sizeof(namespaceExt));
-        if (mNamespacePrefix.size() > 0) {
-            namespaceExt.prefix.index = htodl(strings.offsetForString(mNamespacePrefix));
+        if (mNamespaceUri == RESOURCES_TOOLS_NAMESPACE) {
+            writeCurrentNode = false;
         } else {
-            namespaceExt.prefix.index = htodl((uint32_t)-1);
+            node.header.type = htods(RES_XML_START_NAMESPACE_TYPE);
+            extData = &namespaceExt;
+            extSize = sizeof(namespaceExt);
+            memset(&namespaceExt, 0, sizeof(namespaceExt));
+            if (mNamespacePrefix.size() > 0) {
+                namespaceExt.prefix.index = htodl(strings.offsetForString(mNamespacePrefix));
+            } else {
+                namespaceExt.prefix.index = htodl((uint32_t)-1);
+            }
+            namespaceExt.prefix.index = htodl(strings.offsetForString(mNamespacePrefix));
+            namespaceExt.uri.index = htodl(strings.offsetForString(mNamespaceUri));
         }
-        namespaceExt.prefix.index = htodl(strings.offsetForString(mNamespacePrefix));
-        namespaceExt.uri.index = htodl(strings.offsetForString(mNamespaceUri));
         LOG_ALWAYS_FATAL_IF(NA != 0, "Namespace nodes can't have attributes!");
     } else if (type == TYPE_CDATA) {
         node.header.type = htods(RES_XML_CDATA_TYPE);
@@ -1422,9 +1433,11 @@
 
     node.header.size = htodl(sizeof(node) + extSize + (sizeof(attr)*NA));
 
-    dest->writeData(&node, sizeof(node));
-    if (extSize > 0) {
-        dest->writeData(extData, extSize);
+    if (writeCurrentNode) {
+        dest->writeData(&node, sizeof(node));
+        if (extSize > 0) {
+            dest->writeData(extData, extSize);
+        }
     }
 
     for (i=0; i<NA; i++) {
@@ -1476,12 +1489,14 @@
         dest->writeData(&node, sizeof(node));
         dest->writeData(&endElementExt, sizeof(endElementExt));
     } else if (type == TYPE_NAMESPACE) {
-        node.header.type = htods(RES_XML_END_NAMESPACE_TYPE);
-        node.lineNumber = htodl(getEndLineNumber());
-        node.comment.index = htodl((uint32_t)-1);
-        node.header.size = htodl(sizeof(node)+extSize);
-        dest->writeData(&node, sizeof(node));
-        dest->writeData(extData, extSize);
+        if (writeCurrentNode) {
+            node.header.type = htods(RES_XML_END_NAMESPACE_TYPE);
+            node.lineNumber = htodl(getEndLineNumber());
+            node.comment.index = htodl((uint32_t)-1);
+            node.header.size = htodl(sizeof(node)+extSize);
+            dest->writeData(&node, sizeof(node));
+            dest->writeData(extData, extSize);
+        }
     }
 
     return NO_ERROR;
diff --git a/tools/layoutlib/bridge/.settings/README.txt b/tools/layoutlib/bridge/.settings/README.txt
new file mode 100644
index 0000000..9120b20
--- /dev/null
+++ b/tools/layoutlib/bridge/.settings/README.txt
@@ -0,0 +1,2 @@
+Copy this in eclipse project as a .settings folder at the root.
+This ensure proper compilation compliance and warning/error levels.
\ No newline at end of file
diff --git a/tools/layoutlib/bridge/.settings/org.eclipse.jdt.core.prefs b/tools/layoutlib/bridge/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..5381a0e
--- /dev/null
+++ b/tools/layoutlib/bridge/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,93 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
+org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/tools/layoutlib/bridge/resources/bars/action_bar.xml b/tools/layoutlib/bridge/resources/bars/action_bar.xml
index 51983f2..7adc5af 100644
--- a/tools/layoutlib/bridge/resources/bars/action_bar.xml
+++ b/tools/layoutlib/bridge/resources/bars/action_bar.xml
@@ -1,9 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <merge xmlns:android="http://schemas.android.com/apk/res/android">
-	<ImageView
-			android:layout_height="wrap_content"
-			android:layout_width="wrap_content"/>
-	<TextView
-			android:layout_width="wrap_content"
-			android:layout_height="wrap_content"/>
+    <include layout="@android:layout/action_bar_home" />
+    <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"/>
 </merge>
diff --git a/tools/layoutlib/bridge/src/android/animation/AnimationThread.java b/tools/layoutlib/bridge/src/android/animation/AnimationThread.java
index af83c61..b46134a 100644
--- a/tools/layoutlib/bridge/src/android/animation/AnimationThread.java
+++ b/tools/layoutlib/bridge/src/android/animation/AnimationThread.java
@@ -23,11 +23,10 @@
 import com.android.layoutlib.bridge.Bridge;
 import com.android.layoutlib.bridge.impl.RenderSessionImpl;
 
-import android.animation.ValueAnimator;
 import android.os.Handler;
 import android.os.Handler_Delegate;
-import android.os.Message;
 import android.os.Handler_Delegate.IHandlerCallback;
+import android.os.Message;
 
 import java.util.PriorityQueue;
 import java.util.Queue;
@@ -57,6 +56,7 @@
             mUptimeMillis = uptimeMillis;
         }
 
+        @Override
         public int compareTo(MessageBundle bundle) {
             if (mUptimeMillis < bundle.mUptimeMillis) {
                 return -1;
@@ -85,6 +85,7 @@
         Bridge.prepareThread();
         try {
             Handler_Delegate.setCallback(new IHandlerCallback() {
+                @Override
                 public void sendMessageAtTime(Handler handler, Message msg, long uptimeMillis) {
                     if (msg.what == ValueAnimator.ANIMATION_START /*||
                             FIXME: The ANIMATION_FRAME message no longer exists.  Instead,
diff --git a/tools/layoutlib/bridge/src/android/graphics/BitmapShader_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/BitmapShader_Delegate.java
index 9a8cf04..65a75b0 100644
--- a/tools/layoutlib/bridge/src/android/graphics/BitmapShader_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/BitmapShader_Delegate.java
@@ -105,6 +105,7 @@
             mTileModeY = tileModeY;
         }
 
+        @Override
         public java.awt.PaintContext createContext(
                 java.awt.image.ColorModel      colorModel,
                 java.awt.Rectangle             deviceBounds,
@@ -148,13 +149,16 @@
                 mColorModel = colorModel;
             }
 
+            @Override
             public void dispose() {
             }
 
+            @Override
             public java.awt.image.ColorModel getColorModel() {
                 return mColorModel;
             }
 
+            @Override
             public java.awt.image.Raster getRaster(int x, int y, int w, int h) {
                 java.awt.image.BufferedImage image = new java.awt.image.BufferedImage(w, h,
                         java.awt.image.BufferedImage.TYPE_INT_ARGB);
@@ -240,6 +244,7 @@
         }
 
 
+        @Override
         public int getTransparency() {
             return java.awt.Paint.TRANSLUCENT;
         }
diff --git a/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
index 8e3ed93..16f1575 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
@@ -291,6 +291,7 @@
             Paint paint) {
         draw(thisCanvas.mNativeCanvas, paint.mNativePaint, false /*compositeOnly*/,
                 false /*forceSrcMode*/, new GcSnapshot.Drawable() {
+                    @Override
                     public void draw(Graphics2D graphics, Paint_Delegate paintDelegate) {
                         for (int i = 0 ; i < count ; i += 4) {
                             graphics.drawLine((int)pts[i + offset], (int)pts[i + offset + 1],
@@ -619,6 +620,7 @@
         final int h = canvasDelegate.mBitmap.getImage().getHeight();
         draw(nativeCanvas, new GcSnapshot.Drawable() {
 
+            @Override
             public void draw(Graphics2D graphics, Paint_Delegate paint) {
                 // reset its transform just in case
                 graphics.setTransform(new AffineTransform());
@@ -651,6 +653,7 @@
 
         draw(nativeCanvas, paint, false /*compositeOnly*/, false /*forceSrcMode*/,
                 new GcSnapshot.Drawable() {
+                    @Override
                     public void draw(Graphics2D graphics, Paint_Delegate paintDelegate) {
                         graphics.drawLine((int)startX, (int)startY, (int)stopX, (int)stopY);
                     }
@@ -669,6 +672,7 @@
 
         draw(nativeCanvas, paint, false /*compositeOnly*/, false /*forceSrcMode*/,
                 new GcSnapshot.Drawable() {
+                    @Override
                     public void draw(Graphics2D graphics, Paint_Delegate paintDelegate) {
                         int style = paintDelegate.getStyle();
 
@@ -693,6 +697,7 @@
         if (oval.right > oval.left && oval.bottom > oval.top) {
             draw(nativeCanvas, paint, false /*compositeOnly*/, false /*forceSrcMode*/,
                     new GcSnapshot.Drawable() {
+                        @Override
                         public void draw(Graphics2D graphics, Paint_Delegate paintDelegate) {
                             int style = paintDelegate.getStyle();
 
@@ -717,7 +722,7 @@
     /*package*/ static void native_drawCircle(int nativeCanvas,
             float cx, float cy, float radius, int paint) {
         native_drawOval(nativeCanvas,
-                new RectF(cx - radius, cy - radius, radius, radius),
+                new RectF(cx - radius, cy - radius, cx + radius, cy + radius),
                 paint);
     }
 
@@ -728,6 +733,7 @@
         if (oval.right > oval.left && oval.bottom > oval.top) {
             draw(nativeCanvas, paint, false /*compositeOnly*/, false /*forceSrcMode*/,
                     new GcSnapshot.Drawable() {
+                        @Override
                         public void draw(Graphics2D graphics, Paint_Delegate paintDelegate) {
                             int style = paintDelegate.getStyle();
 
@@ -757,6 +763,7 @@
 
         draw(nativeCanvas, paint, false /*compositeOnly*/, false /*forceSrcMode*/,
                 new GcSnapshot.Drawable() {
+                    @Override
                     public void draw(Graphics2D graphics, Paint_Delegate paintDelegate) {
                         int style = paintDelegate.getStyle();
 
@@ -789,6 +796,7 @@
 
         draw(nativeCanvas, paint, false /*compositeOnly*/, false /*forceSrcMode*/,
                 new GcSnapshot.Drawable() {
+                    @Override
                     public void draw(Graphics2D graphics, Paint_Delegate paintDelegate) {
                         Shape shape = pathDelegate.getJavaShape();
                         int style = paintDelegate.getStyle();
@@ -892,6 +900,7 @@
 
         draw(nativeCanvas, nativePaintOrZero, true /*compositeOnly*/, false /*forceSrcMode*/,
                 new GcSnapshot.Drawable() {
+                    @Override
                     public void draw(Graphics2D graphics, Paint_Delegate paint) {
                         if (paint != null && paint.isFilterBitmap()) {
                             graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
@@ -931,6 +940,7 @@
         final AffineTransform mtx = matrixDelegate.getAffineTransform();
 
         canvasDelegate.getSnapshot().draw(new GcSnapshot.Drawable() {
+                @Override
                 public void draw(Graphics2D graphics, Paint_Delegate paint) {
                     if (paint != null && paint.isFilterBitmap()) {
                         graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
@@ -970,6 +980,7 @@
             final float startX, final float startY, int flags, int paint) {
         draw(nativeCanvas, paint, false /*compositeOnly*/, false /*forceSrcMode*/,
                 new GcSnapshot.Drawable() {
+            @Override
             public void draw(Graphics2D graphics, Paint_Delegate paintDelegate) {
                 // WARNING: the logic in this method is similar to Paint_Delegate.measureText.
                 // Any change to this method should be reflected in Paint.measureText
@@ -1279,6 +1290,7 @@
 
         draw(nativeCanvas, nativePaintOrZero, true /*compositeOnly*/, sBoolOut[0],
                 new GcSnapshot.Drawable() {
+                    @Override
                     public void draw(Graphics2D graphics, Paint_Delegate paint) {
                         if (paint != null && paint.isFilterBitmap()) {
                             graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
diff --git a/tools/layoutlib/bridge/src/android/graphics/Gradient_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Gradient_Delegate.java
index 38c092d..7475c22 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Gradient_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Gradient_Delegate.java
@@ -87,6 +87,7 @@
             mTileMode = tileMode;
         }
 
+        @Override
         public int getTransparency() {
             return java.awt.Paint.TRANSLUCENT;
         }
diff --git a/tools/layoutlib/bridge/src/android/graphics/LinearGradient_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/LinearGradient_Delegate.java
index a2ba758..f117fca 100644
--- a/tools/layoutlib/bridge/src/android/graphics/LinearGradient_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/LinearGradient_Delegate.java
@@ -132,6 +132,7 @@
             mDSize2 = mDx * mDx + mDy * mDy;
         }
 
+        @Override
         public java.awt.PaintContext createContext(
                 java.awt.image.ColorModel      colorModel,
                 java.awt.Rectangle             deviceBounds,
@@ -176,13 +177,16 @@
                 mColorModel = colorModel;
             }
 
+            @Override
             public void dispose() {
             }
 
+            @Override
             public java.awt.image.ColorModel getColorModel() {
                 return mColorModel;
             }
 
+            @Override
             public java.awt.image.Raster getRaster(int x, int y, int w, int h) {
                 java.awt.image.BufferedImage image = new java.awt.image.BufferedImage(w, h,
                         java.awt.image.BufferedImage.TYPE_INT_ARGB);
diff --git a/tools/layoutlib/bridge/src/android/graphics/Matrix_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Matrix_Delegate.java
index 451edd2..5df2a21 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Matrix_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Matrix_Delegate.java
@@ -474,7 +474,7 @@
         }
 
         Matrix_Delegate other = sManager.getDelegate(other_matrix);
-        if (d == null) {
+        if (other == null) {
             return false;
         }
 
@@ -570,7 +570,7 @@
         }
 
         Matrix_Delegate other = sManager.getDelegate(other_matrix);
-        if (d == null) {
+        if (other == null) {
             return false;
         }
 
diff --git a/tools/layoutlib/bridge/src/android/graphics/NinePatch_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/NinePatch_Delegate.java
index 5e882ce..be27b54 100644
--- a/tools/layoutlib/bridge/src/android/graphics/NinePatch_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/NinePatch_Delegate.java
@@ -215,6 +215,7 @@
         Paint_Delegate paint_delegate = Paint_Delegate.getDelegate(paint_instance_or_null);
 
         canvas_delegate.getSnapshot().draw(new GcSnapshot.Drawable() {
+                @Override
                 public void draw(Graphics2D graphics, Paint_Delegate paint) {
                     chunkObject.draw(bitmap_delegate.getImage(), graphics,
                             left, top, right - left, bottom - top, destDensity, srcDensity);
diff --git a/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java
index 1523823..9ebec61 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java
@@ -904,17 +904,6 @@
     }
 
     @LayoutlibDelegate
-    /*package*/ static float native_getFontMetrics(int native_paint, FontMetrics metrics) {
-        // get the delegate from the native int.
-        Paint_Delegate delegate = sManager.getDelegate(native_paint);
-        if (delegate == null) {
-            return 0.f;
-        }
-
-        return delegate.getFontMetrics(metrics);
-    }
-
-    @LayoutlibDelegate
     /*package*/ static int native_getTextWidths(int native_object, char[] text, int index,
             int count, float[] widths) {
         // get the delegate from the native int.
diff --git a/tools/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
index 9bf78b4..3fe45fa 100644
--- a/tools/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
@@ -118,6 +118,7 @@
             mRadius = radius;
         }
 
+        @Override
         public java.awt.PaintContext createContext(
                 java.awt.image.ColorModel     colorModel,
                 java.awt.Rectangle            deviceBounds,
@@ -162,13 +163,16 @@
                 mColorModel = colorModel;
             }
 
+            @Override
             public void dispose() {
             }
 
+            @Override
             public java.awt.image.ColorModel getColorModel() {
                 return mColorModel;
             }
 
+            @Override
             public java.awt.image.Raster getRaster(int x, int y, int w, int h) {
                 java.awt.image.BufferedImage image = new java.awt.image.BufferedImage(w, h,
                         java.awt.image.BufferedImage.TYPE_INT_ARGB);
diff --git a/tools/layoutlib/bridge/src/android/graphics/SweepGradient_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/SweepGradient_Delegate.java
index 966e06e..13ae12e 100644
--- a/tools/layoutlib/bridge/src/android/graphics/SweepGradient_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/SweepGradient_Delegate.java
@@ -110,6 +110,7 @@
             mCy = cy;
         }
 
+        @Override
         public java.awt.PaintContext createContext(
                 java.awt.image.ColorModel     colorModel,
                 java.awt.Rectangle            deviceBounds,
@@ -154,13 +155,16 @@
                 mColorModel = colorModel;
             }
 
+            @Override
             public void dispose() {
             }
 
+            @Override
             public java.awt.image.ColorModel getColorModel() {
                 return mColorModel;
             }
 
+            @Override
             public java.awt.image.Raster getRaster(int x, int y, int w, int h) {
                 java.awt.image.BufferedImage image = new java.awt.image.BufferedImage(w, h,
                         java.awt.image.BufferedImage.TYPE_INT_ARGB);
diff --git a/tools/layoutlib/bridge/src/android/view/SurfaceView.java b/tools/layoutlib/bridge/src/android/view/SurfaceView.java
index ce32da9..6aa4b3b 100644
--- a/tools/layoutlib/bridge/src/android/view/SurfaceView.java
+++ b/tools/layoutlib/bridge/src/android/view/SurfaceView.java
@@ -27,7 +27,7 @@
  * Mock version of the SurfaceView.
  * Only non override public methods from the real SurfaceView have been added in there.
  * Methods that take an unknown class as parameter or as return object, have been removed for now.
- * 
+ *
  * TODO: generate automatically.
  *
  */
@@ -36,7 +36,7 @@
     public SurfaceView(Context context) {
         this(context, null);
     }
-    
+
     public SurfaceView(Context context, AttributeSet attrs) {
         this(context, attrs , 0);
     }
@@ -44,53 +44,66 @@
     public SurfaceView(Context context, AttributeSet attrs, int defStyle) {
         super(context, attrs, defStyle);
     }
-    
+
     public SurfaceHolder getHolder() {
         return mSurfaceHolder;
     }
 
     private SurfaceHolder mSurfaceHolder = new SurfaceHolder() {
-        
+
+        @Override
         public boolean isCreating() {
             return false;
         }
 
+        @Override
         public void addCallback(Callback callback) {
         }
 
+        @Override
         public void removeCallback(Callback callback) {
         }
-        
+
+        @Override
         public void setFixedSize(int width, int height) {
         }
 
+        @Override
         public void setSizeFromLayout() {
         }
 
+        @Override
         public void setFormat(int format) {
         }
 
+        @Override
         public void setType(int type) {
         }
 
+        @Override
         public void setKeepScreenOn(boolean screenOn) {
         }
-        
+
+        @Override
         public Canvas lockCanvas() {
             return null;
         }
 
+        @Override
         public Canvas lockCanvas(Rect dirty) {
             return null;
         }
 
+        @Override
         public void unlockCanvasAndPost(Canvas canvas) {
         }
 
+        @Override
         public Surface getSurface() {
             return null;
         }
 
+        @Override
         public Rect getSurfaceFrame() {
             return null;
         }
diff --git a/tools/layoutlib/bridge/src/com/android/internal/textservice/ITextServicesManager_Stub_Delegate.java b/tools/layoutlib/bridge/src/com/android/internal/textservice/ITextServicesManager_Stub_Delegate.java
index 9efdcaf..3017292 100644
--- a/tools/layoutlib/bridge/src/com/android/internal/textservice/ITextServicesManager_Stub_Delegate.java
+++ b/tools/layoutlib/bridge/src/com/android/internal/textservice/ITextServicesManager_Stub_Delegate.java
@@ -43,28 +43,33 @@
 
     private static class FakeTextServicesManager implements ITextServicesManager {
 
+        @Override
         public void finishSpellCheckerService(ISpellCheckerSessionListener arg0)
                 throws RemoteException {
             // TODO Auto-generated method stub
 
         }
 
+        @Override
         public SpellCheckerInfo getCurrentSpellChecker(String arg0) throws RemoteException {
             // TODO Auto-generated method stub
             return null;
         }
 
+        @Override
         public SpellCheckerSubtype getCurrentSpellCheckerSubtype(String arg0, boolean arg1)
                 throws RemoteException {
             // TODO Auto-generated method stub
             return null;
         }
 
+        @Override
         public SpellCheckerInfo[] getEnabledSpellCheckers() throws RemoteException {
             // TODO Auto-generated method stub
             return null;
         }
 
+        @Override
         public void getSpellCheckerService(String arg0, String arg1,
                 ITextServicesSessionListener arg2, ISpellCheckerSessionListener arg3, Bundle arg4)
                 throws RemoteException {
@@ -72,26 +77,31 @@
 
         }
 
+        @Override
         public boolean isSpellCheckerEnabled() throws RemoteException {
             // TODO Auto-generated method stub
             return false;
         }
 
+        @Override
         public void setCurrentSpellChecker(String arg0, String arg1) throws RemoteException {
             // TODO Auto-generated method stub
 
         }
 
+        @Override
         public void setCurrentSpellCheckerSubtype(String arg0, int arg1) throws RemoteException {
             // TODO Auto-generated method stub
 
         }
 
+        @Override
         public void setSpellCheckerEnabled(boolean arg0) throws RemoteException {
             // TODO Auto-generated method stub
 
         }
 
+        @Override
         public IBinder asBinder() {
             // TODO Auto-generated method stub
             return null;
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContentProvider.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContentProvider.java
index c91a3bf..e28866e 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContentProvider.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContentProvider.java
@@ -19,6 +19,7 @@
 import android.content.ContentProviderOperation;
 import android.content.ContentProviderResult;
 import android.content.ContentValues;
+import android.content.ICancellationSignal;
 import android.content.IContentProvider;
 import android.content.OperationApplicationException;
 import android.content.res.AssetFileDescriptor;
@@ -90,8 +91,8 @@
     }
 
     @Override
-    public Cursor query(Uri arg0, String[] arg1, String arg2, String[] arg3, String arg4)
-            throws RemoteException {
+    public Cursor query(Uri arg0, String[] arg1, String arg2, String[] arg3, String arg4,
+            ICancellationSignal arg5) throws RemoteException {
         // TODO Auto-generated method stub
         return null;
     }
@@ -122,4 +123,9 @@
         return null;
     }
 
+    @Override
+    public ICancellationSignal createCancellationSignal() throws RemoteException {
+        // TODO Auto-generated method stub
+        return null;
+    }
 }
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java
index 2a52888..db0694c 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java
@@ -37,151 +37,179 @@
  */
 public class BridgeIInputMethodManager implements IInputMethodManager {
 
+    @Override
     public void addClient(IInputMethodClient arg0, IInputContext arg1, int arg2, int arg3)
             throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void finishInput(IInputMethodClient arg0) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public InputMethodSubtype getCurrentInputMethodSubtype() throws RemoteException {
         // TODO Auto-generated method stub
         return null;
     }
 
+    @Override
     public List<InputMethodInfo> getEnabledInputMethodList() throws RemoteException {
         // TODO Auto-generated method stub
         return null;
     }
 
+    @Override
     public List<InputMethodSubtype> getEnabledInputMethodSubtypeList(InputMethodInfo arg0,
             boolean arg1) throws RemoteException {
         // TODO Auto-generated method stub
         return null;
     }
 
+    @Override
     public List<InputMethodInfo> getInputMethodList() throws RemoteException {
         // TODO Auto-generated method stub
         return null;
     }
 
+    @Override
     public InputMethodSubtype getLastInputMethodSubtype() throws RemoteException {
         // TODO Auto-generated method stub
         return null;
     }
 
+    @Override
     public List getShortcutInputMethodsAndSubtypes() throws RemoteException {
         // TODO Auto-generated method stub
         return null;
     }
 
+    @Override
     public void hideMySoftInput(IBinder arg0, int arg1) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public boolean hideSoftInput(IInputMethodClient arg0, int arg1, ResultReceiver arg2)
             throws RemoteException {
         // TODO Auto-generated method stub
         return false;
     }
 
+    @Override
     public boolean notifySuggestionPicked(SuggestionSpan arg0, String arg1, int arg2)
             throws RemoteException {
         // TODO Auto-generated method stub
         return false;
     }
 
+    @Override
     public void registerSuggestionSpansForNotification(SuggestionSpan[] arg0)
             throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void removeClient(IInputMethodClient arg0) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void setAdditionalInputMethodSubtypes(String arg0, InputMethodSubtype[] arg1)
             throws RemoteException {
         // TODO Auto-generated method stub
     }
 
+    @Override
     public boolean setCurrentInputMethodSubtype(InputMethodSubtype arg0) throws RemoteException {
         // TODO Auto-generated method stub
         return false;
     }
 
+    @Override
     public void setImeWindowStatus(IBinder arg0, int arg1, int arg2) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void setInputMethod(IBinder arg0, String arg1) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void setInputMethodAndSubtype(IBinder arg0, String arg1, InputMethodSubtype arg2)
             throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public boolean setInputMethodEnabled(String arg0, boolean arg1) throws RemoteException {
         // TODO Auto-generated method stub
         return false;
     }
 
+    @Override
     public void showInputMethodAndSubtypeEnablerFromClient(IInputMethodClient arg0, String arg1)
             throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void showInputMethodPickerFromClient(IInputMethodClient arg0) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void showMySoftInput(IBinder arg0, int arg1) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public boolean showSoftInput(IInputMethodClient arg0, int arg1, ResultReceiver arg2)
             throws RemoteException {
         // TODO Auto-generated method stub
         return false;
     }
 
+    @Override
     public InputBindResult startInput(IInputMethodClient arg0, IInputContext arg1, EditorInfo arg2,
             boolean arg3, boolean arg4) throws RemoteException {
         // TODO Auto-generated method stub
         return null;
     }
 
+    @Override
     public boolean switchToLastInputMethod(IBinder arg0) throws RemoteException {
         // TODO Auto-generated method stub
         return false;
     }
 
+    @Override
     public void updateStatusIcon(IBinder arg0, String arg1, int arg2) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void windowGainedFocus(IInputMethodClient arg0, IBinder arg1, boolean arg2,
             boolean arg3, int arg4, boolean arg5, int arg6) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public IBinder asBinder() {
         // TODO Auto-generated method stub
         return null;
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeLayoutParamsMapAttributes.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeLayoutParamsMapAttributes.java
index d208408..f5912e7 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeLayoutParamsMapAttributes.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeLayoutParamsMapAttributes.java
@@ -37,6 +37,7 @@
         mAttributes = attributes;
     }
 
+    @Override
     public String getAttributeValue(String namespace, String name) {
         if (BridgeConstants.NS_RESOURCES.equals(namespace)) {
             return mAttributes.get(name);
@@ -49,93 +50,114 @@
     // BridgeContext#obtainStyledAttributes(AttributeSet, int[], int, int)
     // Should they ever be called, we'll just implement them on a need basis.
 
+    @Override
     public int getAttributeCount() {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public String getAttributeName(int index) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public String getAttributeValue(int index) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public String getPositionDescription() {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public int getAttributeNameResource(int index) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public int getAttributeListValue(String namespace, String attribute,
             String[] options, int defaultValue) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public boolean getAttributeBooleanValue(String namespace, String attribute,
             boolean defaultValue) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public int getAttributeResourceValue(String namespace, String attribute,
             int defaultValue) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public int getAttributeIntValue(String namespace, String attribute,
             int defaultValue) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public int getAttributeUnsignedIntValue(String namespace, String attribute,
             int defaultValue) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public float getAttributeFloatValue(String namespace, String attribute,
             float defaultValue) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public int getAttributeListValue(int index,
             String[] options, int defaultValue) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public boolean getAttributeBooleanValue(int index, boolean defaultValue) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public int getAttributeResourceValue(int index, int defaultValue) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public int getAttributeIntValue(int index, int defaultValue) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public int getAttributeUnsignedIntValue(int index, int defaultValue) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public float getAttributeFloatValue(int index, float defaultValue) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public String getIdAttribute() {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public String getClassAttribute() {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public int getIdAttributeResourceValue(int defaultValue) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public int getStyleAttribute() {
         throw new UnsupportedOperationException();
     }
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindow.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindow.java
index e13380e..79606a4 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindow.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindow.java
@@ -24,72 +24,67 @@
 import android.os.RemoteException;
 import android.view.DragEvent;
 import android.view.IWindow;
-import android.view.KeyEvent;
-import android.view.MotionEvent;
 
 /**
  * Implementation of {@link IWindow} to pass to the AttachInfo.
  */
 public final class BridgeWindow implements IWindow {
 
+    @Override
     public void dispatchAppVisibility(boolean arg0) throws RemoteException {
         // pass for now.
     }
 
+    @Override
     public void dispatchGetNewSurface() throws RemoteException {
         // pass for now.
     }
-
-    public void dispatchKey(KeyEvent arg0) throws RemoteException {
-        // pass for now.
-    }
-
-    public void dispatchPointer(MotionEvent arg0, long arg1, boolean arg2) throws RemoteException {
-        // pass for now.
-    }
-
-    public void dispatchTrackball(MotionEvent arg0, long arg1, boolean arg2)
-    throws RemoteException {
-        // pass for now.
-    }
-
+    @Override
     public void executeCommand(String arg0, String arg1, ParcelFileDescriptor arg2)
             throws RemoteException {
         // pass for now.
     }
 
+    @Override
     public void resized(int arg0, int arg1, Rect arg2, Rect arg3, boolean arg4, Configuration arg5)
             throws RemoteException {
         // pass for now.
     }
 
+    @Override
     public void windowFocusChanged(boolean arg0, boolean arg1) throws RemoteException {
         // pass for now.
     }
 
+    @Override
     public void dispatchWallpaperOffsets(float x, float y, float xStep, float yStep,
             boolean sync) {
         // pass for now.
     }
 
+    @Override
     public void dispatchWallpaperCommand(String action, int x, int y,
             int z, Bundle extras, boolean sync) {
         // pass for now.
     }
 
+    @Override
     public void closeSystemDialogs(String reason) {
         // pass for now.
     }
 
+    @Override
     public void dispatchDragEvent(DragEvent event) {
         // pass for now.
     }
 
+    @Override
     public void dispatchSystemUiVisibilityChanged(int seq, int globalUi,
             int localValue, int localChanges) {
         // pass for now.
     }
 
+    @Override
     public IBinder asBinder() {
         // pass for now.
         return null;
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowManager.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowManager.java
index 1e66ca2..bef2c95 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowManager.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowManager.java
@@ -67,288 +67,345 @@
 
     // ---- implementation of IWindowManager that we care about ----
 
+    @Override
     public int getRotation() throws RemoteException {
         return mRotation;
     }
 
+    @Override
     public int getMaximumSizeDimension() throws RemoteException {
         return 0;
     }
 
+    @Override
     public void getDisplaySize(Point arg0) throws RemoteException {
     }
 
+    @Override
     public void getRealDisplaySize(Point arg0) throws RemoteException {
     }
 
     // ---- unused implementation of IWindowManager ----
 
+    @Override
     public boolean canStatusBarHide() throws RemoteException {
         // TODO Auto-generated method stub
         return false;
     }
 
+    @Override
     public void addAppToken(int arg0, IApplicationToken arg1, int arg2, int arg3, boolean arg4)
             throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void addWindowToken(IBinder arg0, int arg1) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void clearForcedDisplaySize() throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void closeSystemDialogs(String arg0) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void disableKeyguard(IBinder arg0, String arg1) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void executeAppTransition() throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void exitKeyguardSecurely(IOnKeyguardExitResult arg0) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void freezeRotation(int arg0) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public float getAnimationScale(int arg0) throws RemoteException {
         // TODO Auto-generated method stub
         return 0;
     }
 
+    @Override
     public float[] getAnimationScales() throws RemoteException {
         // TODO Auto-generated method stub
         return null;
     }
 
+    @Override
     public int getAppOrientation(IApplicationToken arg0) throws RemoteException {
         // TODO Auto-generated method stub
         return 0;
     }
 
+    @Override
     public int getDPadKeycodeState(int arg0) throws RemoteException {
         // TODO Auto-generated method stub
         return 0;
     }
 
+    @Override
     public int getDPadScancodeState(int arg0) throws RemoteException {
         // TODO Auto-generated method stub
         return 0;
     }
 
 
+    @Override
     public InputDevice getInputDevice(int arg0) throws RemoteException {
         // TODO Auto-generated method stub
         return null;
     }
 
+    @Override
     public int[] getInputDeviceIds() throws RemoteException {
         // TODO Auto-generated method stub
         return null;
     }
 
+    @Override
     public int getKeycodeState(int arg0) throws RemoteException {
         // TODO Auto-generated method stub
         return 0;
     }
 
+    @Override
     public int getKeycodeStateForDevice(int arg0, int arg1) throws RemoteException {
         // TODO Auto-generated method stub
         return 0;
     }
 
 
+    @Override
     public int getPendingAppTransition() throws RemoteException {
         // TODO Auto-generated method stub
         return 0;
     }
 
 
+    @Override
     public int getScancodeState(int arg0) throws RemoteException {
         // TODO Auto-generated method stub
         return 0;
     }
 
+    @Override
     public int getScancodeStateForDevice(int arg0, int arg1) throws RemoteException {
         // TODO Auto-generated method stub
         return 0;
     }
 
+    @Override
     public int getSwitchState(int arg0) throws RemoteException {
         // TODO Auto-generated method stub
         return 0;
     }
 
+    @Override
     public int getSwitchStateForDevice(int arg0, int arg1) throws RemoteException {
         // TODO Auto-generated method stub
         return 0;
     }
 
+    @Override
     public int getTrackballKeycodeState(int arg0) throws RemoteException {
         // TODO Auto-generated method stub
         return 0;
     }
 
+    @Override
     public int getTrackballScancodeState(int arg0) throws RemoteException {
         // TODO Auto-generated method stub
         return 0;
     }
 
+    @Override
     public boolean hasKeys(int[] arg0, boolean[] arg1) throws RemoteException {
         // TODO Auto-generated method stub
         return false;
     }
 
+    @Override
     public boolean inKeyguardRestrictedInputMode() throws RemoteException {
         // TODO Auto-generated method stub
         return false;
     }
 
+    @Override
     public boolean injectInputEventNoWait(InputEvent arg0) throws RemoteException {
         // TODO Auto-generated method stub
         return false;
     }
 
+    @Override
     public boolean injectKeyEvent(KeyEvent arg0, boolean arg1) throws RemoteException {
         // TODO Auto-generated method stub
         return false;
     }
 
+    @Override
     public boolean injectPointerEvent(MotionEvent arg0, boolean arg1) throws RemoteException {
         // TODO Auto-generated method stub
         return false;
     }
 
+    @Override
     public boolean injectTrackballEvent(MotionEvent arg0, boolean arg1) throws RemoteException {
         // TODO Auto-generated method stub
         return false;
     }
 
+    @Override
     public boolean inputMethodClientHasFocus(IInputMethodClient arg0) throws RemoteException {
         // TODO Auto-generated method stub
         return false;
     }
 
+    @Override
     public boolean isKeyguardLocked() throws RemoteException {
         // TODO Auto-generated method stub
         return false;
     }
 
+    @Override
     public boolean isKeyguardSecure() throws RemoteException {
         // TODO Auto-generated method stub
         return false;
     }
 
+    @Override
     public boolean isViewServerRunning() throws RemoteException {
         // TODO Auto-generated method stub
         return false;
     }
 
+    @Override
     public InputChannel monitorInput(String arg0) throws RemoteException {
         // TODO Auto-generated method stub
         return null;
     }
 
+    @Override
     public void moveAppToken(int arg0, IBinder arg1) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void moveAppTokensToBottom(List<IBinder> arg0) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void moveAppTokensToTop(List<IBinder> arg0) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public IWindowSession openSession(IInputMethodClient arg0, IInputContext arg1)
             throws RemoteException {
         // TODO Auto-generated method stub
         return null;
     }
 
+    @Override
     public void overridePendingAppTransition(String arg0, int arg1, int arg2)
             throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void pauseKeyDispatching(IBinder arg0) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void prepareAppTransition(int arg0, boolean arg1) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void reenableKeyguard(IBinder arg0) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void removeAppToken(IBinder arg0) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void removeWindowToken(IBinder arg0) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void resumeKeyDispatching(IBinder arg0) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public Bitmap screenshotApplications(IBinder arg0, int arg1, int arg2) throws RemoteException {
         // TODO Auto-generated method stub
         return null;
     }
 
+    @Override
     public void setAnimationScale(int arg0, float arg1) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void setAnimationScales(float[] arg0) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void setAppGroupId(IBinder arg0, int arg1) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void setAppOrientation(IApplicationToken arg0, int arg1) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void setAppStartingWindow(IBinder arg0, String arg1, int arg2, CompatibilityInfo arg3,
             CharSequence arg4, int arg5, int arg6, int arg7, IBinder arg8, boolean arg9)
             throws RemoteException {
@@ -356,119 +413,148 @@
 
     }
 
+    @Override
     public void setAppVisibility(IBinder arg0, boolean arg1) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void setAppWillBeHidden(IBinder arg0) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void setEventDispatching(boolean arg0) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void setFocusedApp(IBinder arg0, boolean arg1) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void setForcedDisplaySize(int arg0, int arg1) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void setInTouchMode(boolean arg0) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void setNewConfiguration(Configuration arg0) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void setPointerSpeed(int arg0) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void updateRotation(boolean arg0) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void setStrictModeVisualIndicatorPreference(String arg0) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void showStrictModeViolation(boolean arg0) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void startAppFreezingScreen(IBinder arg0, int arg1) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public boolean startViewServer(int arg0) throws RemoteException {
         // TODO Auto-generated method stub
         return false;
     }
 
+    @Override
     public void statusBarVisibilityChanged(int arg0) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public void stopAppFreezingScreen(IBinder arg0, boolean arg1) throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public boolean stopViewServer() throws RemoteException {
         // TODO Auto-generated method stub
         return false;
     }
 
+    @Override
     public void thawRotation() throws RemoteException {
         // TODO Auto-generated method stub
 
     }
 
+    @Override
     public Configuration updateOrientationFromAppTokens(Configuration arg0, IBinder arg1)
             throws RemoteException {
         // TODO Auto-generated method stub
         return null;
     }
 
+    @Override
     public int watchRotation(IRotationWatcher arg0) throws RemoteException {
         // TODO Auto-generated method stub
         return 0;
     }
 
+    @Override
     public void waitForWindowDrawn(IBinder token, IRemoteCallback callback) {
         // TODO Auto-generated method stub
     }
-    
+
+    @Override
     public IBinder asBinder() {
         // TODO Auto-generated method stub
         return null;
     }
 
+    @Override
     public int getPreferredOptionsPanelGravity() throws RemoteException {
         return Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM;
     }
 
+    @Override
     public void dismissKeyguard() {
     }
 
+    @Override
     public boolean hasNavigationBar() {
         return false; // should this return something else?
     }
+
+    @Override
+    public void lockNow() {
+        // TODO Auto-generated method stub
+    }
 }
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowSession.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowSession.java
index a640a91..d3721ed 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowSession.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowSession.java
@@ -26,7 +26,6 @@
 import android.view.IWindow;
 import android.view.IWindowSession;
 import android.view.InputChannel;
-import android.view.MotionEvent;
 import android.view.Surface;
 import android.view.SurfaceView;
 import android.view.WindowManager.LayoutParams;
@@ -37,6 +36,7 @@
  */
 public final class BridgeWindowSession implements IWindowSession {
 
+    @Override
     public int add(IWindow arg0, int seq, LayoutParams arg1, int arg2, Rect arg3,
             InputChannel outInputchannel)
             throws RemoteException {
@@ -44,40 +44,30 @@
         return 0;
     }
 
+    @Override
     public int addWithoutInputChannel(IWindow arg0, int seq, LayoutParams arg1, int arg2, Rect arg3)
             throws RemoteException {
         // pass for now.
         return 0;
     }
 
+    @Override
     public void finishDrawing(IWindow arg0) throws RemoteException {
         // pass for now.
     }
 
-    public void finishKey(IWindow arg0) throws RemoteException {
-        // pass for now.
-    }
-
+    @Override
     public boolean getInTouchMode() throws RemoteException {
         // pass for now.
         return false;
     }
 
+    @Override
     public boolean performHapticFeedback(IWindow window, int effectId, boolean always) {
         // pass for now.
         return false;
     }
-
-    public MotionEvent getPendingPointerMove(IWindow arg0) throws RemoteException {
-        // pass for now.
-        return null;
-    }
-
-    public MotionEvent getPendingTrackballMove(IWindow arg0) throws RemoteException {
-        // pass for now.
-        return null;
-    }
-
+    @Override
     public int relayout(IWindow arg0, int seq, LayoutParams arg1, int arg2, int arg3, int arg4,
             int arg4_5, Rect arg5, Rect arg6, Rect arg7, Configuration arg7b, Surface arg8)
             throws RemoteException {
@@ -85,35 +75,43 @@
         return 0;
     }
 
+    @Override
     public void performDeferredDestroy(IWindow window) {
         // pass for now.
     }
 
+    @Override
     public boolean outOfMemory(IWindow window) throws RemoteException {
         return false;
     }
 
+    @Override
     public void getDisplayFrame(IWindow window, Rect outDisplayFrame) {
         // pass for now.
     }
 
+    @Override
     public void remove(IWindow arg0) throws RemoteException {
         // pass for now.
     }
 
+    @Override
     public void setInTouchMode(boolean arg0) throws RemoteException {
         // pass for now.
     }
 
+    @Override
     public void setTransparentRegion(IWindow arg0, Region arg1) throws RemoteException {
         // pass for now.
     }
 
+    @Override
     public void setInsets(IWindow window, int touchable, Rect contentInsets,
             Rect visibleInsets, Region touchableRegion) {
         // pass for now.
     }
 
+    @Override
     public IBinder prepareDrag(IWindow window, int flags,
             int thumbnailWidth, int thumbnailHeight, Surface outSurface)
             throws RemoteException {
@@ -121,6 +119,7 @@
         return null;
     }
 
+    @Override
     public boolean performDrag(IWindow window, IBinder dragToken,
             float touchX, float touchY, float thumbCenterX, float thumbCenterY,
             ClipData data)
@@ -129,49 +128,47 @@
         return false;
     }
 
+    @Override
     public void reportDropResult(IWindow window, boolean consumed) throws RemoteException {
         // pass for now
     }
 
+    @Override
     public void dragRecipientEntered(IWindow window) throws RemoteException {
         // pass for now
     }
 
+    @Override
     public void dragRecipientExited(IWindow window) throws RemoteException {
         // pass for now
     }
 
+    @Override
     public void setWallpaperPosition(IBinder window, float x, float y,
         float xStep, float yStep) {
         // pass for now.
     }
 
+    @Override
     public void wallpaperOffsetsComplete(IBinder window) {
         // pass for now.
     }
 
+    @Override
     public Bundle sendWallpaperCommand(IBinder window, String action, int x, int y,
             int z, Bundle extras, boolean sync) {
         // pass for now.
         return null;
     }
 
+    @Override
     public void wallpaperCommandComplete(IBinder window, Bundle result) {
         // pass for now.
     }
 
-    public void closeSystemDialogs(String reason) {
-        // pass for now.
-    }
-
+    @Override
     public IBinder asBinder() {
         // pass for now.
         return null;
     }
-
-    public IBinder prepareDrag(IWindow arg0, boolean arg1, int arg2, int arg3, Surface arg4)
-            throws RemoteException {
-        // TODO Auto-generated method stub
-        return null;
-    }
 }
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeXmlBlockParser.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeXmlBlockParser.java
index f8ed4f7..ac8712e 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeXmlBlockParser.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeXmlBlockParser.java
@@ -95,6 +95,7 @@
 
     // ------- XmlResourceParser implementation
 
+    @Override
     public void setFeature(String name, boolean state)
             throws XmlPullParserException {
         if (FEATURE_PROCESS_NAMESPACES.equals(name) && state) {
@@ -106,6 +107,7 @@
         throw new XmlPullParserException("Unsupported feature: " + name);
     }
 
+    @Override
     public boolean getFeature(String name) {
         if (FEATURE_PROCESS_NAMESPACES.equals(name)) {
             return true;
@@ -116,82 +118,101 @@
         return false;
     }
 
+    @Override
     public void setProperty(String name, Object value) throws XmlPullParserException {
         throw new XmlPullParserException("setProperty() not supported");
     }
 
+    @Override
     public Object getProperty(String name) {
         return null;
     }
 
+    @Override
     public void setInput(Reader in) throws XmlPullParserException {
         mParser.setInput(in);
     }
 
+    @Override
     public void setInput(InputStream inputStream, String inputEncoding)
             throws XmlPullParserException {
         mParser.setInput(inputStream, inputEncoding);
     }
 
+    @Override
     public void defineEntityReplacementText(String entityName,
             String replacementText) throws XmlPullParserException {
         throw new XmlPullParserException(
                 "defineEntityReplacementText() not supported");
     }
 
+    @Override
     public String getNamespacePrefix(int pos) throws XmlPullParserException {
         throw new XmlPullParserException("getNamespacePrefix() not supported");
     }
 
+    @Override
     public String getInputEncoding() {
         return null;
     }
 
+    @Override
     public String getNamespace(String prefix) {
         throw new RuntimeException("getNamespace() not supported");
     }
 
+    @Override
     public int getNamespaceCount(int depth) throws XmlPullParserException {
         throw new XmlPullParserException("getNamespaceCount() not supported");
     }
 
+    @Override
     public String getPositionDescription() {
         return "Binary XML file line #" + getLineNumber();
     }
 
+    @Override
     public String getNamespaceUri(int pos) throws XmlPullParserException {
         throw new XmlPullParserException("getNamespaceUri() not supported");
     }
 
+    @Override
     public int getColumnNumber() {
         return -1;
     }
 
+    @Override
     public int getDepth() {
         return mParser.getDepth();
     }
 
+    @Override
     public String getText() {
         return mParser.getText();
     }
 
+    @Override
     public int getLineNumber() {
         return mParser.getLineNumber();
     }
 
+    @Override
     public int getEventType() {
         return mEventType;
     }
 
+    @Override
     public boolean isWhitespace() throws XmlPullParserException {
         // Original comment: whitespace was stripped by aapt.
         return mParser.isWhitespace();
     }
 
+    @Override
     public String getPrefix() {
         throw new RuntimeException("getPrefix not supported");
     }
 
+    @Override
     public char[] getTextCharacters(int[] holderForStartAndLength) {
         String txt = getText();
         char[] chars = null;
@@ -204,55 +225,68 @@
         return chars;
     }
 
+    @Override
     public String getNamespace() {
         return mParser.getNamespace();
     }
 
+    @Override
     public String getName() {
         return mParser.getName();
     }
 
+    @Override
     public String getAttributeNamespace(int index) {
         return mParser.getAttributeNamespace(index);
     }
 
+    @Override
     public String getAttributeName(int index) {
         return mParser.getAttributeName(index);
     }
 
+    @Override
     public String getAttributePrefix(int index) {
         throw new RuntimeException("getAttributePrefix not supported");
     }
 
+    @Override
     public boolean isEmptyElementTag() {
         // XXX Need to detect this.
         return false;
     }
 
+    @Override
     public int getAttributeCount() {
         return mParser.getAttributeCount();
     }
 
+    @Override
     public String getAttributeValue(int index) {
         return mParser.getAttributeValue(index);
     }
 
+    @Override
     public String getAttributeType(int index) {
         return "CDATA";
     }
 
+    @Override
     public boolean isAttributeDefault(int index) {
         return false;
     }
 
+    @Override
     public int nextToken() throws XmlPullParserException, IOException {
         return next();
     }
 
+    @Override
     public String getAttributeValue(String namespace, String name) {
         return mParser.getAttributeValue(namespace, name);
     }
 
+    @Override
     public int next() throws XmlPullParserException, IOException {
         if (!mStarted) {
             mStarted = true;
@@ -313,6 +347,7 @@
         return "????";
     }
 
+    @Override
     public void require(int type, String namespace, String name)
             throws XmlPullParserException {
         if (type != getEventType()
@@ -322,6 +357,7 @@
                     + getPositionDescription());
     }
 
+    @Override
     public String nextText() throws XmlPullParserException, IOException {
         if (getEventType() != START_TAG) {
             throw new XmlPullParserException(getPositionDescription()
@@ -348,6 +384,7 @@
         }
     }
 
+    @Override
     public int nextTag() throws XmlPullParserException, IOException {
         int eventType = next();
         if (eventType == TEXT && isWhitespace()) { // skip whitespace
@@ -363,76 +400,94 @@
     // AttributeSet implementation
 
 
+    @Override
     public void close() {
         // pass
     }
 
+    @Override
     public boolean getAttributeBooleanValue(int index, boolean defaultValue) {
         return mAttrib.getAttributeBooleanValue(index, defaultValue);
     }
 
+    @Override
     public boolean getAttributeBooleanValue(String namespace, String attribute,
             boolean defaultValue) {
         return mAttrib.getAttributeBooleanValue(namespace, attribute, defaultValue);
     }
 
+    @Override
     public float getAttributeFloatValue(int index, float defaultValue) {
         return mAttrib.getAttributeFloatValue(index, defaultValue);
     }
 
+    @Override
     public float getAttributeFloatValue(String namespace, String attribute, float defaultValue) {
         return mAttrib.getAttributeFloatValue(namespace, attribute, defaultValue);
     }
 
+    @Override
     public int getAttributeIntValue(int index, int defaultValue) {
         return mAttrib.getAttributeIntValue(index, defaultValue);
     }
 
+    @Override
     public int getAttributeIntValue(String namespace, String attribute, int defaultValue) {
         return mAttrib.getAttributeIntValue(namespace, attribute, defaultValue);
     }
 
+    @Override
     public int getAttributeListValue(int index, String[] options, int defaultValue) {
         return mAttrib.getAttributeListValue(index, options, defaultValue);
     }
 
+    @Override
     public int getAttributeListValue(String namespace, String attribute,
             String[] options, int defaultValue) {
         return mAttrib.getAttributeListValue(namespace, attribute, options, defaultValue);
     }
 
+    @Override
     public int getAttributeNameResource(int index) {
         return mAttrib.getAttributeNameResource(index);
     }
 
+    @Override
     public int getAttributeResourceValue(int index, int defaultValue) {
         return mAttrib.getAttributeResourceValue(index, defaultValue);
     }
 
+    @Override
     public int getAttributeResourceValue(String namespace, String attribute, int defaultValue) {
         return mAttrib.getAttributeResourceValue(namespace, attribute, defaultValue);
     }
 
+    @Override
     public int getAttributeUnsignedIntValue(int index, int defaultValue) {
         return mAttrib.getAttributeUnsignedIntValue(index, defaultValue);
     }
 
+    @Override
     public int getAttributeUnsignedIntValue(String namespace, String attribute, int defaultValue) {
         return mAttrib.getAttributeUnsignedIntValue(namespace, attribute, defaultValue);
     }
 
+    @Override
     public String getClassAttribute() {
         return mAttrib.getClassAttribute();
     }
 
+    @Override
     public String getIdAttribute() {
         return mAttrib.getIdAttribute();
     }
 
+    @Override
     public int getIdAttributeResourceValue(int defaultValue) {
         return mAttrib.getIdAttributeResourceValue(defaultValue);
     }
 
+    @Override
     public int getStyleAttribute() {
         return mAttrib.getStyleAttribute();
     }
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/CustomBar.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/CustomBar.java
index 72ed351..1817ab5 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/CustomBar.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/CustomBar.java
@@ -132,7 +132,7 @@
                 if (bitmap != null) {
                     BitmapDrawable drawable = new BitmapDrawable(getContext().getResources(),
                             bitmap);
-                    imageView.setBackgroundDrawable(drawable);
+                    imageView.setImageDrawable(drawable);
                 }
             }
         }
@@ -145,6 +145,14 @@
         }
     }
 
+    protected void loadIconById(int id, String iconReference) {
+        ResourceValue value = getResourceValue(iconReference);
+        if (value != null) {
+            loadIconById(id, value);
+        }
+    }
+
+
     protected Drawable loadIcon(int index, ResourceType type, String name) {
         BridgeContext bridgeContext = (BridgeContext) mContext;
         RenderResources res = bridgeContext.getRenderResources();
@@ -162,34 +170,64 @@
         if (child instanceof ImageView) {
             ImageView imageView = (ImageView) child;
 
-            Drawable drawable = ResourceHelper.getDrawable(
-                    value, (BridgeContext) mContext);
-            if (drawable != null) {
-                imageView.setBackgroundDrawable(drawable);
-            }
-
-            return drawable;
+            return loadIcon(imageView, value);
         }
 
         return null;
     }
 
+    private Drawable loadIconById(int id, ResourceValue value) {
+        View child = findViewById(id);
+        if (child instanceof ImageView) {
+            ImageView imageView = (ImageView) child;
+
+            return loadIcon(imageView, value);
+        }
+
+        return null;
+    }
+
+
+    private Drawable loadIcon(ImageView imageView, ResourceValue value) {
+        Drawable drawable = ResourceHelper.getDrawable(value, (BridgeContext) mContext);
+        if (drawable != null) {
+            imageView.setImageDrawable(drawable);
+        }
+
+        return drawable;
+    }
+
     protected TextView setText(int index, String stringReference) {
         View child = getChildAt(index);
         if (child instanceof TextView) {
             TextView textView = (TextView) child;
-            ResourceValue value = getResourceValue(stringReference);
-            if (value != null) {
-                textView.setText(value.getValue());
-            } else {
-                textView.setText(stringReference);
-            }
+            setText(textView, stringReference);
             return textView;
         }
 
         return null;
     }
 
+    protected TextView setTextById(int id, String stringReference) {
+        View child = findViewById(id);
+        if (child instanceof TextView) {
+            TextView textView = (TextView) child;
+            setText(textView, stringReference);
+            return textView;
+        }
+
+        return null;
+    }
+
+    private void setText(TextView textView, String stringReference) {
+        ResourceValue value = getResourceValue(stringReference);
+        if (value != null) {
+            textView.setText(value.getValue());
+        } else {
+            textView.setText(stringReference);
+        }
+    }
+
     protected void setStyle(String themeEntryName) {
 
         BridgeContext bridgeContext = (BridgeContext) mContext;
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/FakeActionBar.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/FakeActionBar.java
index f6edea4..68f5aba 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/FakeActionBar.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/FakeActionBar.java
@@ -34,7 +34,7 @@
         // Cannot access the inside items through id because no R.id values have been
         // created for them.
         // We do know the order though.
-        loadIcon(0, icon);
+        loadIconById(android.R.id.home, icon);
         mTextView = setText(1, label);
 
         setStyle("actionBarStyle");
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
index d5400d7..6840f46 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
@@ -33,10 +33,10 @@
 import com.android.ide.common.rendering.api.ResourceReference;
 import com.android.ide.common.rendering.api.ResourceValue;
 import com.android.ide.common.rendering.api.Result;
-import com.android.ide.common.rendering.api.SessionParams;
-import com.android.ide.common.rendering.api.ViewInfo;
 import com.android.ide.common.rendering.api.Result.Status;
+import com.android.ide.common.rendering.api.SessionParams;
 import com.android.ide.common.rendering.api.SessionParams.RenderingMode;
+import com.android.ide.common.rendering.api.ViewInfo;
 import com.android.internal.util.XmlUtils;
 import com.android.layoutlib.bridge.Bridge;
 import com.android.layoutlib.bridge.android.BridgeContext;
@@ -69,8 +69,8 @@
 import android.view.AttachInfo_Accessor;
 import android.view.BridgeInflater;
 import android.view.View;
-import android.view.ViewGroup;
 import android.view.View.MeasureSpec;
+import android.view.ViewGroup;
 import android.view.ViewGroup.LayoutParams;
 import android.view.ViewGroup.MarginLayoutParams;
 import android.widget.AbsListView;
@@ -82,8 +82,8 @@
 import android.widget.ListView;
 import android.widget.QuickContactBadge;
 import android.widget.TabHost;
-import android.widget.TabWidget;
 import android.widget.TabHost.TabSpec;
+import android.widget.TabWidget;
 
 import java.awt.AlphaComposite;
 import java.awt.Color;
@@ -835,6 +835,7 @@
                 previousTransition.addTransitionListener(new TransitionListener() {
                     private int mChangeDisappearingCount = 0;
 
+                    @Override
                     public void startTransition(LayoutTransition transition, ViewGroup container,
                             View view, int transitionType) {
                         if (transitionType == LayoutTransition.CHANGE_DISAPPEARING) {
@@ -842,6 +843,7 @@
                         }
                     }
 
+                    @Override
                     public void endTransition(LayoutTransition transition, ViewGroup container,
                             View view, int transitionType) {
                         if (transitionType == LayoutTransition.CHANGE_DISAPPEARING) {
@@ -1227,6 +1229,7 @@
             TabSpec spec = tabHost.newTabSpec("tag").setIndicator("Tab Label",
                     tabHost.getResources().getDrawable(android.R.drawable.ic_menu_info_details))
                     .setContent(new TabHost.TabContentFactory() {
+                        @Override
                         public View createTabContent(String tag) {
                             return new LinearLayout(getContext());
                         }
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/binding/FakeAdapter.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/binding/FakeAdapter.java
index c9bb424..22570b9 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/binding/FakeAdapter.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/binding/FakeAdapter.java
@@ -74,38 +74,46 @@
         }
     }
 
+    @Override
     public boolean isEnabled(int position) {
         return true;
     }
 
+    @Override
     public int getCount() {
         return mItems.size();
     }
 
+    @Override
     public Object getItem(int position) {
         return mItems.get(position);
     }
 
+    @Override
     public long getItemId(int position) {
         return position;
     }
 
+    @Override
     public int getItemViewType(int position) {
         return mItems.get(position).getType();
     }
 
+    @Override
     public View getView(int position, View convertView, ViewGroup parent) {
         // we don't care about recycling here because we never scroll.
         AdapterItem item = mItems.get(position);
         return getView(item, null /*parentGroup*/, convertView, parent);
     }
 
+    @Override
     public int getViewTypeCount() {
         return mTypes.size();
     }
 
     // ---- SpinnerAdapter
 
+    @Override
     public View getDropDownView(int position, View convertView, ViewGroup parent) {
         // pass
         return null;
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/binding/FakeExpandableAdapter.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/binding/FakeExpandableAdapter.java
index 2c492e3..199e040 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/binding/FakeExpandableAdapter.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/binding/FakeExpandableAdapter.java
@@ -99,23 +99,28 @@
 
     // ---- ExpandableListAdapter
 
+    @Override
     public int getGroupCount() {
         return mItems.size();
     }
 
+    @Override
     public int getChildrenCount(int groupPosition) {
         AdapterItem item = mItems.get(groupPosition);
         return item.getChildren().size();
     }
 
+    @Override
     public Object getGroup(int groupPosition) {
         return mItems.get(groupPosition);
     }
 
+    @Override
     public Object getChild(int groupPosition, int childPosition) {
         return getChildItem(groupPosition, childPosition);
     }
 
+    @Override
     public View getGroupView(int groupPosition, boolean isExpanded, View convertView,
             ViewGroup parent) {
         // we don't care about recycling here because we never scroll.
@@ -123,6 +128,7 @@
         return getView(item, null /*parentItem*/, convertView, parent);
     }
 
+    @Override
     public View getChildView(int groupPosition, int childPosition, boolean isLastChild,
             View convertView, ViewGroup parent) {
         // we don't care about recycling here because we never scroll.
@@ -131,48 +137,59 @@
         return getView(item, parentItem, convertView, parent);
     }
 
+    @Override
     public long getGroupId(int groupPosition) {
         return groupPosition;
     }
 
+    @Override
     public long getChildId(int groupPosition, int childPosition) {
         return childPosition;
     }
 
+    @Override
     public long getCombinedGroupId(long groupId) {
         return groupId << 16 | 0x0000FFFF;
     }
 
+    @Override
     public long getCombinedChildId(long groupId, long childId) {
         return groupId << 16 | childId;
     }
 
+    @Override
     public boolean isChildSelectable(int groupPosition, int childPosition) {
         return true;
     }
 
+    @Override
     public void onGroupCollapsed(int groupPosition) {
         // pass
     }
 
+    @Override
     public void onGroupExpanded(int groupPosition) {
         // pass
     }
 
     // ---- HeterogeneousExpandableList
 
+    @Override
     public int getChildType(int groupPosition, int childPosition) {
         return getChildItem(groupPosition, childPosition).getType();
     }
 
+    @Override
     public int getChildTypeCount() {
         return mChildrenTypes.size();
     }
 
+    @Override
     public int getGroupType(int groupPosition) {
         return mItems.get(groupPosition).getType();
     }
 
+    @Override
     public int getGroupTypeCount() {
         return mGroupTypes.size();
     }
diff --git a/tools/layoutlib/create/.settings/README.txt b/tools/layoutlib/create/.settings/README.txt
new file mode 100644
index 0000000..9120b20
--- /dev/null
+++ b/tools/layoutlib/create/.settings/README.txt
@@ -0,0 +1,2 @@
+Copy this in eclipse project as a .settings folder at the root.
+This ensure proper compilation compliance and warning/error levels.
\ No newline at end of file
diff --git a/tools/layoutlib/create/.settings/org.eclipse.jdt.core.prefs b/tools/layoutlib/create/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..5381a0e
--- /dev/null
+++ b/tools/layoutlib/create/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,93 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
+org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java
index 70c8a00..4b33474 100644
--- a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java
+++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java
@@ -27,6 +27,7 @@
      * Returns the list of class from layoutlib_create to inject in layoutlib.
      * The list can be empty but must not be null.
      */
+    @Override
     public Class<?>[] getInjectedClasses() {
         return INJECTED_CLASSES;
     }
@@ -35,6 +36,7 @@
      * Returns the list of methods to rewrite as delegates.
      * The list can be empty but must not be null.
      */
+    @Override
     public String[] getDelegateMethods() {
         return DELEGATE_METHODS;
     }
@@ -43,6 +45,7 @@
      * Returns the list of classes on which to delegate all native methods.
      * The list can be empty but must not be null.
      */
+    @Override
     public String[] getDelegateClassNatives() {
         return DELEGATE_CLASS_NATIVES;
     }
@@ -54,6 +57,7 @@
      * <p/>
      * This usage is deprecated. Please use method 'delegates' instead.
      */
+    @Override
     public String[] getOverriddenMethods() {
         return OVERRIDDEN_METHODS;
     }
@@ -63,6 +67,7 @@
      * of class to replace followed by the new FQCN.
      * The list can be empty but must not be null.
      */
+    @Override
     public String[] getRenamedClasses() {
         return RENAMED_CLASSES;
     }
@@ -74,6 +79,7 @@
      * the methods to delete.
      * The list can be empty but must not be null.
      */
+    @Override
     public String[] getDeleteReturns() {
         return DELETE_RETURNS;
     }
diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/MethodAdapter.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/MethodAdapter.java
index 627ea17..7d1e4cf 100644
--- a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/MethodAdapter.java
+++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/MethodAdapter.java
@@ -28,13 +28,14 @@
      * A stub method is being invoked.
      * <p/>
      * Known limitation: caller arguments are not available.
-     *  
+     *
      * @param signature The signature of the method being invoked, composed of the
      *                  binary class name followed by the method descriptor (aka argument
      *                  types). Example: "com/foo/MyClass/InnerClass/printInt(I)V".
      * @param isNative True if the method was a native method.
      * @param caller The calling object. Null for static methods, "this" for instance methods.
      */
+    @Override
     public void onInvokeV(String signature, boolean isNative, Object caller) {
     }
 
@@ -43,6 +44,7 @@
      * @see #onInvokeV(String, boolean, Object)
      * @return an integer, or a boolean, or a short or a byte.
      */
+    @Override
     public int onInvokeI(String signature, boolean isNative, Object caller) {
         onInvokeV(signature, isNative, caller);
         return 0;
@@ -53,6 +55,7 @@
      * @see #onInvokeV(String, boolean, Object)
      * @return a long.
      */
+    @Override
     public long onInvokeL(String signature, boolean isNative, Object caller) {
         onInvokeV(signature, isNative, caller);
         return 0;
@@ -63,6 +66,7 @@
      * @see #onInvokeV(String, boolean, Object)
      * @return a float.
      */
+    @Override
     public float onInvokeF(String signature, boolean isNative, Object caller) {
         onInvokeV(signature, isNative, caller);
         return 0;
@@ -73,6 +77,7 @@
      * @see #onInvokeV(String, boolean, Object)
      * @return a double.
      */
+    @Override
     public double onInvokeD(String signature, boolean isNative, Object caller) {
         onInvokeV(signature, isNative, caller);
         return 0;
@@ -83,6 +88,7 @@
      * @see #onInvokeV(String, boolean, Object)
      * @return an object.
      */
+    @Override
     public Object onInvokeA(String signature, boolean isNative, Object caller) {
         onInvokeV(signature, isNative, caller);
         return null;
diff --git a/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/AsmGeneratorTest.java b/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/AsmGeneratorTest.java
index f4ff389..7b76a5b 100644
--- a/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/AsmGeneratorTest.java
+++ b/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/AsmGeneratorTest.java
@@ -65,24 +65,29 @@
     public void testClassRenaming() throws IOException, LogAbortException {
 
         ICreateInfo ci = new ICreateInfo() {
+            @Override
             public Class<?>[] getInjectedClasses() {
                 // classes to inject in the final JAR
                 return new Class<?>[0];
             }
 
+            @Override
             public String[] getDelegateMethods() {
                 return new String[0];
             }
 
+            @Override
             public String[] getDelegateClassNatives() {
                 return new String[0];
             }
 
+            @Override
             public String[] getOverriddenMethods() {
                 // methods to force override
                 return new String[0];
             }
 
+            @Override
             public String[] getRenamedClasses() {
                 // classes to rename (so that we can replace them)
                 return new String[] {
@@ -91,6 +96,7 @@
                 };
             }
 
+            @Override
             public String[] getDeleteReturns() {
                  // methods deleted from their return type.
                 return new String[0];
diff --git a/tools/orientationplot/orientationplot.py b/tools/orientationplot/orientationplot.py
index 3a44cb2..f4e6b45 100755
--- a/tools/orientationplot/orientationplot.py
+++ b/tools/orientationplot/orientationplot.py
@@ -82,6 +82,7 @@
     self.raw_acceleration_x = self._make_timeseries()
     self.raw_acceleration_y = self._make_timeseries()
     self.raw_acceleration_z = self._make_timeseries()
+    self.raw_acceleration_magnitude = self._make_timeseries()
     self.raw_acceleration_axes = self._add_timeseries_axes(
         1, 'Raw Acceleration', 'm/s^2', [-20, 20],
         yticks=range(-15, 16, 5))
@@ -91,6 +92,8 @@
         self.raw_acceleration_axes, 'y', 'green')
     self.raw_acceleration_line_z = self._add_timeseries_line(
         self.raw_acceleration_axes, 'z', 'blue')
+    self.raw_acceleration_line_magnitude = self._add_timeseries_line(
+        self.raw_acceleration_axes, 'magnitude', 'orange', linewidth=2)
     self._add_timeseries_legend(self.raw_acceleration_axes)
 
     shared_axis = self.raw_acceleration_axes
@@ -98,7 +101,7 @@
     self.filtered_acceleration_x = self._make_timeseries()
     self.filtered_acceleration_y = self._make_timeseries()
     self.filtered_acceleration_z = self._make_timeseries()
-    self.magnitude = self._make_timeseries()
+    self.filtered_acceleration_magnitude = self._make_timeseries()
     self.filtered_acceleration_axes = self._add_timeseries_axes(
         2, 'Filtered Acceleration', 'm/s^2', [-20, 20],
         sharex=shared_axis,
@@ -109,7 +112,7 @@
         self.filtered_acceleration_axes, 'y', 'green')
     self.filtered_acceleration_line_z = self._add_timeseries_line(
         self.filtered_acceleration_axes, 'z', 'blue')
-    self.magnitude_line = self._add_timeseries_line(
+    self.filtered_acceleration_line_magnitude = self._add_timeseries_line(
         self.filtered_acceleration_axes, 'magnitude', 'orange', linewidth=2)
     self._add_timeseries_legend(self.filtered_acceleration_axes)
 
@@ -133,32 +136,46 @@
 
     self.current_rotation = self._make_timeseries()
     self.proposed_rotation = self._make_timeseries()
-    self.proposal_rotation = self._make_timeseries()
+    self.predicted_rotation = self._make_timeseries()
     self.orientation_axes = self._add_timeseries_axes(
-        5, 'Current / Proposed Orientation and Confidence', 'rotation', [-1, 4],
+        5, 'Current / Proposed Orientation', 'rotation', [-1, 4],
         sharex=shared_axis,
         yticks=range(0, 4))
     self.current_rotation_line = self._add_timeseries_line(
         self.orientation_axes, 'current', 'black', linewidth=2)
-    self.proposal_rotation_line = self._add_timeseries_line(
-        self.orientation_axes, 'proposal', 'purple', linewidth=3)
+    self.predicted_rotation_line = self._add_timeseries_line(
+        self.orientation_axes, 'predicted', 'purple', linewidth=3)
     self.proposed_rotation_line = self._add_timeseries_line(
         self.orientation_axes, 'proposed', 'green', linewidth=3)
     self._add_timeseries_legend(self.orientation_axes)
 
-    self.proposal_confidence = [[self._make_timeseries(), self._make_timeseries()]
-      for i in range(0, 4)]
-    self.proposal_confidence_polys = []
+    self.time_until_settled = self._make_timeseries()
+    self.time_until_flat_delay_expired = self._make_timeseries()
+    self.time_until_swing_delay_expired = self._make_timeseries()
+    self.stability_axes = self._add_timeseries_axes(
+        6, 'Proposal Stability', 'ms', [-10, 600],
+        sharex=shared_axis,
+        yticks=range(0, 600, 100))
+    self.time_until_settled_line = self._add_timeseries_line(
+        self.stability_axes, 'time until settled', 'black', linewidth=2)
+    self.time_until_flat_delay_expired_line = self._add_timeseries_line(
+        self.stability_axes, 'time until flat delay expired', 'green')
+    self.time_until_swing_delay_expired_line = self._add_timeseries_line(
+        self.stability_axes, 'time until swing delay expired', 'blue')
+    self._add_timeseries_legend(self.stability_axes)
 
     self.sample_latency = self._make_timeseries()
     self.sample_latency_axes = self._add_timeseries_axes(
-        6, 'Accelerometer Sampling Latency', 'ms', [-10, 500],
+        7, 'Accelerometer Sampling Latency', 'ms', [-10, 500],
         sharex=shared_axis,
         yticks=range(0, 500, 100))
     self.sample_latency_line = self._add_timeseries_line(
         self.sample_latency_axes, 'latency', 'black')
     self._add_timeseries_legend(self.sample_latency_axes)
 
+    self.fig.canvas.mpl_connect('button_press_event', self._on_click)
+    self.paused = False
+
     self.timer = self.fig.canvas.new_timer(interval=100)
     self.timer.add_callback(lambda: self.update())
     self.timer.start()
@@ -166,13 +183,22 @@
     self.timebase = None
     self._reset_parse_state()
 
+  # Handle a click event to pause or restart the timer.
+  def _on_click(self, ev):
+    if not self.paused:
+      self.paused = True
+      self.timer.stop()
+    else:
+      self.paused = False
+      self.timer.start()
+
   # Initialize a time series.
   def _make_timeseries(self):
     return [[], []]
 
   # Add a subplot to the figure for a time series.
   def _add_timeseries_axes(self, index, title, ylabel, ylim, yticks, sharex=None):
-    num_graphs = 6
+    num_graphs = 7
     height = 0.9 / num_graphs
     top = 0.95 - height * index
     axes = self.fig.add_axes([0.1, top, 0.8, height],
@@ -214,16 +240,19 @@
     self.parse_raw_acceleration_x = None
     self.parse_raw_acceleration_y = None
     self.parse_raw_acceleration_z = None
+    self.parse_raw_acceleration_magnitude = None
     self.parse_filtered_acceleration_x = None
     self.parse_filtered_acceleration_y = None
     self.parse_filtered_acceleration_z = None
-    self.parse_magnitude = None
+    self.parse_filtered_acceleration_magnitude = None
     self.parse_tilt_angle = None
     self.parse_orientation_angle = None
     self.parse_current_rotation = None
     self.parse_proposed_rotation = None
-    self.parse_proposal_rotation = None
-    self.parse_proposal_confidence = None
+    self.parse_predicted_rotation = None
+    self.parse_time_until_settled = None
+    self.parse_time_until_flat_delay_expired = None
+    self.parse_time_until_swing_delay_expired = None
     self.parse_sample_latency = None
 
   # Update samples.
@@ -252,14 +281,13 @@
         self.parse_raw_acceleration_x = self._get_following_number(line, 'x=')
         self.parse_raw_acceleration_y = self._get_following_number(line, 'y=')
         self.parse_raw_acceleration_z = self._get_following_number(line, 'z=')
+        self.parse_raw_acceleration_magnitude = self._get_following_number(line, 'magnitude=')
 
       if line.find('Filtered acceleration vector:') != -1:
         self.parse_filtered_acceleration_x = self._get_following_number(line, 'x=')
         self.parse_filtered_acceleration_y = self._get_following_number(line, 'y=')
         self.parse_filtered_acceleration_z = self._get_following_number(line, 'z=')
-
-      if line.find('magnitude=') != -1:
-        self.parse_magnitude = self._get_following_number(line, 'magnitude=')
+        self.parse_filtered_acceleration_magnitude = self._get_following_number(line, 'magnitude=')
 
       if line.find('tiltAngle=') != -1:
         self.parse_tilt_angle = self._get_following_number(line, 'tiltAngle=')
@@ -270,17 +298,20 @@
       if line.find('Result:') != -1:
         self.parse_current_rotation = self._get_following_number(line, 'currentRotation=')
         self.parse_proposed_rotation = self._get_following_number(line, 'proposedRotation=')
-        self.parse_proposal_rotation = self._get_following_number(line, 'proposalRotation=')
-        self.parse_proposal_confidence = self._get_following_number(line, 'proposalConfidence=')
+        self.parse_predicted_rotation = self._get_following_number(line, 'predictedRotation=')
         self.parse_sample_latency = self._get_following_number(line, 'timeDeltaMS=')
+        self.parse_time_until_settled = self._get_following_number(line, 'timeUntilSettledMS=')
+        self.parse_time_until_flat_delay_expired = self._get_following_number(line, 'timeUntilFlatDelayExpiredMS=')
+        self.parse_time_until_swing_delay_expired = self._get_following_number(line, 'timeUntilSwingDelayExpiredMS=')
 
         self._append(self.raw_acceleration_x, timeindex, self.parse_raw_acceleration_x)
         self._append(self.raw_acceleration_y, timeindex, self.parse_raw_acceleration_y)
         self._append(self.raw_acceleration_z, timeindex, self.parse_raw_acceleration_z)
+        self._append(self.raw_acceleration_magnitude, timeindex, self.parse_raw_acceleration_magnitude)
         self._append(self.filtered_acceleration_x, timeindex, self.parse_filtered_acceleration_x)
         self._append(self.filtered_acceleration_y, timeindex, self.parse_filtered_acceleration_y)
         self._append(self.filtered_acceleration_z, timeindex, self.parse_filtered_acceleration_z)
-        self._append(self.magnitude, timeindex, self.parse_magnitude)
+        self._append(self.filtered_acceleration_magnitude, timeindex, self.parse_filtered_acceleration_magnitude)
         self._append(self.tilt_angle, timeindex, self.parse_tilt_angle)
         self._append(self.orientation_angle, timeindex, self.parse_orientation_angle)
         self._append(self.current_rotation, timeindex, self.parse_current_rotation)
@@ -288,17 +319,13 @@
           self._append(self.proposed_rotation, timeindex, self.parse_proposed_rotation)
         else:
           self._append(self.proposed_rotation, timeindex, None)
-        if self.parse_proposal_rotation >= 0:
-          self._append(self.proposal_rotation, timeindex, self.parse_proposal_rotation)
+        if self.parse_predicted_rotation >= 0:
+          self._append(self.predicted_rotation, timeindex, self.parse_predicted_rotation)
         else:
-          self._append(self.proposal_rotation, timeindex, None)
-        for i in range(0, 4):
-          self._append(self.proposal_confidence[i][0], timeindex, i)
-          if i == self.parse_proposal_rotation:
-            self._append(self.proposal_confidence[i][1], timeindex,
-              i + self.parse_proposal_confidence)
-          else:
-            self._append(self.proposal_confidence[i][1], timeindex, i)
+          self._append(self.predicted_rotation, timeindex, None)
+        self._append(self.time_until_settled, timeindex, self.parse_time_until_settled)
+        self._append(self.time_until_flat_delay_expired, timeindex, self.parse_time_until_flat_delay_expired)
+        self._append(self.time_until_swing_delay_expired, timeindex, self.parse_time_until_swing_delay_expired)
         self._append(self.sample_latency, timeindex, self.parse_sample_latency)
         self._reset_parse_state()
 
@@ -309,45 +336,40 @@
       self._scroll(self.raw_acceleration_x, bottom)
       self._scroll(self.raw_acceleration_y, bottom)
       self._scroll(self.raw_acceleration_z, bottom)
+      self._scroll(self.raw_acceleration_magnitude, bottom)
       self._scroll(self.filtered_acceleration_x, bottom)
       self._scroll(self.filtered_acceleration_y, bottom)
       self._scroll(self.filtered_acceleration_z, bottom)
-      self._scroll(self.magnitude, bottom)
+      self._scroll(self.filtered_acceleration_magnitude, bottom)
       self._scroll(self.tilt_angle, bottom)
       self._scroll(self.orientation_angle, bottom)
       self._scroll(self.current_rotation, bottom)
       self._scroll(self.proposed_rotation, bottom)
-      self._scroll(self.proposal_rotation, bottom)
-      for i in range(0, 4):
-        self._scroll(self.proposal_confidence[i][0], bottom)
-        self._scroll(self.proposal_confidence[i][1], bottom)
+      self._scroll(self.predicted_rotation, bottom)
+      self._scroll(self.time_until_settled, bottom)
+      self._scroll(self.time_until_flat_delay_expired, bottom)
+      self._scroll(self.time_until_swing_delay_expired, bottom)
       self._scroll(self.sample_latency, bottom)
 
     # Redraw the plots.
     self.raw_acceleration_line_x.set_data(self.raw_acceleration_x)
     self.raw_acceleration_line_y.set_data(self.raw_acceleration_y)
     self.raw_acceleration_line_z.set_data(self.raw_acceleration_z)
+    self.raw_acceleration_line_magnitude.set_data(self.raw_acceleration_magnitude)
     self.filtered_acceleration_line_x.set_data(self.filtered_acceleration_x)
     self.filtered_acceleration_line_y.set_data(self.filtered_acceleration_y)
     self.filtered_acceleration_line_z.set_data(self.filtered_acceleration_z)
-    self.magnitude_line.set_data(self.magnitude)
+    self.filtered_acceleration_line_magnitude.set_data(self.filtered_acceleration_magnitude)
     self.tilt_angle_line.set_data(self.tilt_angle)
     self.orientation_angle_line.set_data(self.orientation_angle)
     self.current_rotation_line.set_data(self.current_rotation)
     self.proposed_rotation_line.set_data(self.proposed_rotation)
-    self.proposal_rotation_line.set_data(self.proposal_rotation)
+    self.predicted_rotation_line.set_data(self.predicted_rotation)
+    self.time_until_settled_line.set_data(self.time_until_settled)
+    self.time_until_flat_delay_expired_line.set_data(self.time_until_flat_delay_expired)
+    self.time_until_swing_delay_expired_line.set_data(self.time_until_swing_delay_expired)
     self.sample_latency_line.set_data(self.sample_latency)
 
-    for poly in self.proposal_confidence_polys:
-      poly.remove()
-    self.proposal_confidence_polys = []
-    for i in range(0, 4):
-      self.proposal_confidence_polys.append(self.orientation_axes.fill_between(
-        self.proposal_confidence[i][0][0],
-        self.proposal_confidence[i][0][1],
-        self.proposal_confidence[i][1][1],
-        facecolor='goldenrod', edgecolor='goldenrod'))
-
     self.fig.canvas.draw_idle()
 
   # Scroll a time series.
diff --git a/voip/jni/rtp/AudioGroup.cpp b/voip/jni/rtp/AudioGroup.cpp
index 4db5738..1139577 100644
--- a/voip/jni/rtp/AudioGroup.cpp
+++ b/voip/jni/rtp/AudioGroup.cpp
@@ -1008,7 +1008,7 @@
     delete stream;
     delete codec;
     close(socket);
-    env->SetIntField(thiz, gNative, NULL);
+    env->SetIntField(thiz, gNative, 0);
 }
 
 void remove(JNIEnv *env, jobject thiz, jint socket)
@@ -1017,7 +1017,7 @@
     if (group) {
         if (socket == -1 || !group->remove(socket)) {
             delete group;
-            env->SetIntField(thiz, gNative, NULL);
+            env->SetIntField(thiz, gNative, 0);
         }
     }
 }
diff --git a/wifi/java/android/net/wifi/SupplicantStateTracker.java b/wifi/java/android/net/wifi/SupplicantStateTracker.java
index cbd284c..104a02d 100644
--- a/wifi/java/android/net/wifi/SupplicantStateTracker.java
+++ b/wifi/java/android/net/wifi/SupplicantStateTracker.java
@@ -39,6 +39,7 @@
     private static final boolean DBG = false;
 
     private WifiStateMachine mWifiStateMachine;
+    private WifiConfigStore mWifiConfigStore;
     private int mAuthenticationFailuresCount = 0;
     /* Indicates authentication failure in supplicant broadcast.
      * TODO: enhance auth failure reporting to include notification
@@ -62,11 +63,12 @@
     private State mCompletedState = new CompletedState();
     private State mDormantState = new DormantState();
 
-    public SupplicantStateTracker(Context context, WifiStateMachine wsm, Handler target) {
-        super(TAG, target.getLooper());
+    public SupplicantStateTracker(Context c, WifiStateMachine wsm, WifiConfigStore wcs, Handler t) {
+        super(TAG, t.getLooper());
 
-        mContext = context;
+        mContext = c;
         mWifiStateMachine = wsm;
+        mWifiConfigStore = wcs;
         addState(mDefaultState);
             addState(mUninitializedState, mDefaultState);
             addState(mInactiveState, mDefaultState);
@@ -85,11 +87,11 @@
     private void handleNetworkConnectionFailure(int netId) {
         /* If other networks disabled during connection, enable them */
         if (mNetworksDisabledDuringConnect) {
-            WifiConfigStore.enableAllNetworks();
+            mWifiConfigStore.enableAllNetworks();
             mNetworksDisabledDuringConnect = false;
         }
         /* Disable failed network */
-        WifiConfigStore.disableNetwork(netId, WifiConfiguration.DISABLED_AUTH_FAILURE);
+        mWifiConfigStore.disableNetwork(netId, WifiConfiguration.DISABLED_AUTH_FAILURE);
     }
 
     private void transitionOnSupplicantStateChange(StateChangeResult stateChangeResult) {
@@ -285,7 +287,7 @@
              /* Reset authentication failure count */
              mAuthenticationFailuresCount = 0;
              if (mNetworksDisabledDuringConnect) {
-                 WifiConfigStore.enableAllNetworks();
+                 mWifiConfigStore.enableAllNetworks();
                  mNetworksDisabledDuringConnect = false;
              }
         }
diff --git a/wifi/java/android/net/wifi/WifiConfigStore.java b/wifi/java/android/net/wifi/WifiConfigStore.java
index cba0fba..5dffa60 100644
--- a/wifi/java/android/net/wifi/WifiConfigStore.java
+++ b/wifi/java/android/net/wifi/WifiConfigStore.java
@@ -103,12 +103,12 @@
  */
 class WifiConfigStore {
 
-    private static Context sContext;
+    private Context mContext;
     private static final String TAG = "WifiConfigStore";
     private static final boolean DBG = false;
 
     /* configured networks with network id as the key */
-    private static HashMap<Integer, WifiConfiguration> sConfiguredNetworks =
+    private HashMap<Integer, WifiConfiguration> mConfiguredNetworks =
             new HashMap<Integer, WifiConfiguration>();
 
     /* A network id is a unique identifier for a network configured in the
@@ -118,11 +118,11 @@
      * that is generated from SSID and security type of the network. A mapping
      * from the generated unique id to network id of the network is needed to
      * map supplicant config to IP configuration. */
-    private static HashMap<Integer, Integer> sNetworkIds =
+    private HashMap<Integer, Integer> mNetworkIds =
             new HashMap<Integer, Integer>();
 
     /* Tracks the highest priority of configured networks */
-    private static int sLastPriority = -1;
+    private int mLastPriority = -1;
 
     private static final String ipConfigFile = Environment.getDataDirectory() +
             "/misc/wifi/ipconfig.txt";
@@ -141,20 +141,19 @@
     private static final String EXCLUSION_LIST_KEY = "exclusionList";
     private static final String EOS = "eos";
 
-    private static HandlerThread sDiskWriteHandlerThread;
-    private static DiskWriteHandler sDiskWriteHandler;
-    private static Object sDiskWriteHandlerSync = new Object();
-    /* Tracks multiple writes on the same thread */
-    private static int sWriteSequence = 0;
-    private static final int WRITE = 1;
+    private WifiNative mWifiNative;
+
+    WifiConfigStore(Context c, WifiNative wn) {
+        mContext = c;
+        mWifiNative = wn;
+    }
 
     /**
-     * Initialize context, fetch the list of configured networks
+     * Fetch the list of configured networks
      * and enable all stored networks in supplicant.
      */
-    static void initialize(Context context) {
+    void initialize() {
         if (DBG) log("Loading config and enabling all networks");
-        sContext = context;
         loadConfiguredNetworks();
         enableAllNetworks();
     }
@@ -163,9 +162,9 @@
      * Fetch the list of currently configured networks
      * @return List of networks
      */
-    static List<WifiConfiguration> getConfiguredNetworks() {
+    List<WifiConfiguration> getConfiguredNetworks() {
         List<WifiConfiguration> networks = new ArrayList<WifiConfiguration>();
-        for(WifiConfiguration config : sConfiguredNetworks.values()) {
+        for(WifiConfiguration config : mConfiguredNetworks.values()) {
             networks.add(new WifiConfiguration(config));
         }
         return networks;
@@ -175,11 +174,11 @@
      * enable all networks and save config. This will be a no-op if the list
      * of configured networks indicates all networks as being enabled
      */
-    static void enableAllNetworks() {
+    void enableAllNetworks() {
         boolean networkEnabledStateChanged = false;
-        for(WifiConfiguration config : sConfiguredNetworks.values()) {
+        for(WifiConfiguration config : mConfiguredNetworks.values()) {
             if(config != null && config.status == Status.DISABLED) {
-                if(WifiNative.enableNetwork(config.networkId, false)) {
+                if(mWifiNative.enableNetwork(config.networkId, false)) {
                     networkEnabledStateChanged = true;
                     config.status = Status.ENABLED;
                 } else {
@@ -189,7 +188,7 @@
         }
 
         if (networkEnabledStateChanged) {
-            WifiNative.saveConfig();
+            mWifiNative.saveConfig();
             sendConfiguredNetworksChangedBroadcast();
         }
     }
@@ -206,7 +205,7 @@
      * @param config The configuration details in WifiConfiguration
      * @return the networkId now associated with the specified configuration
      */
-    static int selectNetwork(WifiConfiguration config) {
+    int selectNetwork(WifiConfiguration config) {
         if (config != null) {
             NetworkUpdateResult result = addOrUpdateNetworkNative(config);
             int netId = result.getNetworkId();
@@ -231,25 +230,25 @@
      *
      * @param netId network to select for connection
      */
-    static void selectNetwork(int netId) {
+    void selectNetwork(int netId) {
         // Reset the priority of each network at start or if it goes too high.
-        if (sLastPriority == -1 || sLastPriority > 1000000) {
-            for(WifiConfiguration config : sConfiguredNetworks.values()) {
+        if (mLastPriority == -1 || mLastPriority > 1000000) {
+            for(WifiConfiguration config : mConfiguredNetworks.values()) {
                 if (config.networkId != INVALID_NETWORK_ID) {
                     config.priority = 0;
                     addOrUpdateNetworkNative(config);
                 }
             }
-            sLastPriority = 0;
+            mLastPriority = 0;
         }
 
         // Set to the highest priority and save the configuration.
         WifiConfiguration config = new WifiConfiguration();
         config.networkId = netId;
-        config.priority = ++sLastPriority;
+        config.priority = ++mLastPriority;
 
         addOrUpdateNetworkNative(config);
-        WifiNative.saveConfig();
+        mWifiNative.saveConfig();
 
         /* Enable the given network while disabling all other networks */
         enableNetworkWithoutBroadcast(netId, true);
@@ -263,23 +262,23 @@
      *
      * @param config WifiConfiguration to be saved
      */
-    static NetworkUpdateResult saveNetwork(WifiConfiguration config) {
+    NetworkUpdateResult saveNetwork(WifiConfiguration config) {
         boolean newNetwork = (config.networkId == INVALID_NETWORK_ID);
         NetworkUpdateResult result = addOrUpdateNetworkNative(config);
         int netId = result.getNetworkId();
         /* enable a new network */
         if (newNetwork && netId != INVALID_NETWORK_ID) {
-            WifiNative.enableNetwork(netId, false);
-            sConfiguredNetworks.get(netId).status = Status.ENABLED;
+            mWifiNative.enableNetwork(netId, false);
+            mConfiguredNetworks.get(netId).status = Status.ENABLED;
         }
-        WifiNative.saveConfig();
+        mWifiNative.saveConfig();
         sendConfiguredNetworksChangedBroadcast();
         return result;
     }
 
-    static void updateStatus(int netId, DetailedState state) {
+    void updateStatus(int netId, DetailedState state) {
         if (netId != INVALID_NETWORK_ID) {
-            WifiConfiguration config = sConfiguredNetworks.get(netId);
+            WifiConfiguration config = mConfiguredNetworks.get(netId);
             if (config == null) return;
             switch (state) {
                 case CONNECTED:
@@ -300,13 +299,13 @@
      *
      * @param netId network to forget
      */
-    static void forgetNetwork(int netId) {
-        if (WifiNative.removeNetwork(netId)) {
-            WifiNative.saveConfig();
-            WifiConfiguration config = sConfiguredNetworks.get(netId);
+    void forgetNetwork(int netId) {
+        if (mWifiNative.removeNetwork(netId)) {
+            mWifiNative.saveConfig();
+            WifiConfiguration config = mConfiguredNetworks.get(netId);
             if (config != null) {
-                sConfiguredNetworks.remove(netId);
-                sNetworkIds.remove(configKey(config));
+                mConfiguredNetworks.remove(netId);
+                mNetworkIds.remove(configKey(config));
             }
             writeIpAndProxyConfigurations();
             sendConfiguredNetworksChangedBroadcast();
@@ -323,7 +322,7 @@
      *
      * @param config wifi configuration to add/update
      */
-    static int addOrUpdateNetwork(WifiConfiguration config) {
+    int addOrUpdateNetwork(WifiConfiguration config) {
         NetworkUpdateResult result = addOrUpdateNetworkNative(config);
         sendConfiguredNetworksChangedBroadcast();
         return result.getNetworkId();
@@ -337,13 +336,13 @@
      *
      * @param netId network to be removed
      */
-    static boolean removeNetwork(int netId) {
-        boolean ret = WifiNative.removeNetwork(netId);
+    boolean removeNetwork(int netId) {
+        boolean ret = mWifiNative.removeNetwork(netId);
         if (ret) {
-            WifiConfiguration config = sConfiguredNetworks.get(netId);
+            WifiConfiguration config = mConfiguredNetworks.get(netId);
             if (config != null) {
-                sConfiguredNetworks.remove(netId);
-                sNetworkIds.remove(configKey(config));
+                mConfiguredNetworks.remove(netId);
+                mNetworkIds.remove(configKey(config));
             }
         }
         sendConfiguredNetworksChangedBroadcast();
@@ -358,16 +357,16 @@
      *
      * @param netId network to be removed
      */
-    static boolean enableNetwork(int netId, boolean disableOthers) {
+    boolean enableNetwork(int netId, boolean disableOthers) {
         boolean ret = enableNetworkWithoutBroadcast(netId, disableOthers);
         sendConfiguredNetworksChangedBroadcast();
         return ret;
     }
 
-    static boolean enableNetworkWithoutBroadcast(int netId, boolean disableOthers) {
-        boolean ret = WifiNative.enableNetwork(netId, disableOthers);
+    boolean enableNetworkWithoutBroadcast(int netId, boolean disableOthers) {
+        boolean ret = mWifiNative.enableNetwork(netId, disableOthers);
 
-        WifiConfiguration config = sConfiguredNetworks.get(netId);
+        WifiConfiguration config = mConfiguredNetworks.get(netId);
         if (config != null) config.status = Status.ENABLED;
 
         if (disableOthers) {
@@ -380,7 +379,7 @@
      * Disable a network. Note that there is no saveConfig operation.
      * @param netId network to be disabled
      */
-    static boolean disableNetwork(int netId) {
+    boolean disableNetwork(int netId) {
         return disableNetwork(netId, WifiConfiguration.DISABLED_UNKNOWN_REASON);
     }
 
@@ -389,9 +388,9 @@
      * @param netId network to be disabled
      * @param reason reason code network was disabled
      */
-    static boolean disableNetwork(int netId, int reason) {
-        boolean ret = WifiNative.disableNetwork(netId);
-        WifiConfiguration config = sConfiguredNetworks.get(netId);
+    boolean disableNetwork(int netId, int reason) {
+        boolean ret = mWifiNative.disableNetwork(netId);
+        WifiConfiguration config = mConfiguredNetworks.get(netId);
         /* Only change the reason if the network was not previously disabled */
         if (config != null && config.status != Status.DISABLED) {
             config.status = Status.DISABLED;
@@ -404,17 +403,17 @@
     /**
      * Save the configured networks in supplicant to disk
      */
-    static boolean saveConfig() {
-        return WifiNative.saveConfig();
+    boolean saveConfig() {
+        return mWifiNative.saveConfig();
     }
 
     /**
      * Start WPS pin method configuration with pin obtained
      * from the access point
      */
-    static WpsResult startWpsWithPinFromAccessPoint(WpsInfo config) {
+    WpsResult startWpsWithPinFromAccessPoint(WpsInfo config) {
         WpsResult result = new WpsResult();
-        if (WifiNative.startWpsRegistrar(config.BSSID, config.pin)) {
+        if (mWifiNative.startWpsRegistrar(config.BSSID, config.pin)) {
             /* WPS leaves all networks disabled */
             markAllNetworksDisabled();
             result.status = WpsResult.Status.SUCCESS;
@@ -430,9 +429,9 @@
      * from the device
      * @return WpsResult indicating status and pin
      */
-    static WpsResult startWpsWithPinFromDevice(WpsInfo config) {
+    WpsResult startWpsWithPinFromDevice(WpsInfo config) {
         WpsResult result = new WpsResult();
-        result.pin = WifiNative.startWpsPinDisplay(config.BSSID);
+        result.pin = mWifiNative.startWpsPinDisplay(config.BSSID);
         /* WPS leaves all networks disabled */
         if (!TextUtils.isEmpty(result.pin)) {
             markAllNetworksDisabled();
@@ -447,9 +446,9 @@
     /**
      * Start WPS push button configuration
      */
-    static WpsResult startWpsPbc(WpsInfo config) {
+    WpsResult startWpsPbc(WpsInfo config) {
         WpsResult result = new WpsResult();
-        if (WifiNative.startWpsPbc(config.BSSID)) {
+        if (mWifiNative.startWpsPbc(config.BSSID)) {
             /* WPS leaves all networks disabled */
             markAllNetworksDisabled();
             result.status = WpsResult.Status.SUCCESS;
@@ -463,8 +462,8 @@
     /**
      * Fetch the link properties for a given network id
      */
-    static LinkProperties getLinkProperties(int netId) {
-        WifiConfiguration config = sConfiguredNetworks.get(netId);
+    LinkProperties getLinkProperties(int netId) {
+        WifiConfiguration config = mConfiguredNetworks.get(netId);
         if (config != null) return new LinkProperties(config.linkProperties);
         return null;
     }
@@ -476,7 +475,7 @@
      *       that, we should remove handling DhcpInfo and move
      *       to using LinkProperties
      */
-    static DhcpInfoInternal getIpConfiguration(int netId) {
+    DhcpInfoInternal getIpConfiguration(int netId) {
         DhcpInfoInternal dhcpInfoInternal = new DhcpInfoInternal();
         LinkProperties linkProperties = getLinkProperties(netId);
 
@@ -502,10 +501,10 @@
     /**
      * set IP configuration for a given network id
      */
-    static void setIpConfiguration(int netId, DhcpInfoInternal dhcpInfo) {
+    void setIpConfiguration(int netId, DhcpInfoInternal dhcpInfo) {
         LinkProperties linkProperties = dhcpInfo.makeLinkProperties();
 
-        WifiConfiguration config = sConfiguredNetworks.get(netId);
+        WifiConfiguration config = mConfiguredNetworks.get(netId);
         if (config != null) {
             // add old proxy details
             if(config.linkProperties != null) {
@@ -518,8 +517,8 @@
     /**
      * clear IP configuration for a given network id
      */
-    static void clearIpConfiguration(int netId) {
-        WifiConfiguration config = sConfiguredNetworks.get(netId);
+    void clearIpConfiguration(int netId) {
+        WifiConfiguration config = mConfiguredNetworks.get(netId);
         if (config != null && config.linkProperties != null) {
             // Clear everything except proxy
             ProxyProperties proxy = config.linkProperties.getHttpProxy();
@@ -532,7 +531,7 @@
     /**
      * Fetch the proxy properties for a given network id
      */
-    static ProxyProperties getProxyProperties(int netId) {
+    ProxyProperties getProxyProperties(int netId) {
         LinkProperties linkProperties = getLinkProperties(netId);
         if (linkProperties != null) {
             return new ProxyProperties(linkProperties.getHttpProxy());
@@ -543,26 +542,26 @@
     /**
      * Return if the specified network is using static IP
      */
-    static boolean isUsingStaticIp(int netId) {
-        WifiConfiguration config = sConfiguredNetworks.get(netId);
+    boolean isUsingStaticIp(int netId) {
+        WifiConfiguration config = mConfiguredNetworks.get(netId);
         if (config != null && config.ipAssignment == IpAssignment.STATIC) {
             return true;
         }
         return false;
     }
 
-    private static void sendConfiguredNetworksChangedBroadcast() {
+    private void sendConfiguredNetworksChangedBroadcast() {
         Intent intent = new Intent(WifiManager.CONFIGURED_NETWORKS_CHANGED_ACTION);
         intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
-        sContext.sendBroadcast(intent);
+        mContext.sendBroadcast(intent);
     }
 
-    static void loadConfiguredNetworks() {
-        String listStr = WifiNative.listNetworks();
-        sLastPriority = 0;
+    void loadConfiguredNetworks() {
+        String listStr = mWifiNative.listNetworks();
+        mLastPriority = 0;
 
-        sConfiguredNetworks.clear();
-        sNetworkIds.clear();
+        mConfiguredNetworks.clear();
+        mNetworkIds.clear();
 
         if (listStr == null)
             return;
@@ -589,19 +588,19 @@
                 config.status = WifiConfiguration.Status.ENABLED;
             }
             readNetworkVariables(config);
-            if (config.priority > sLastPriority) {
-                sLastPriority = config.priority;
+            if (config.priority > mLastPriority) {
+                mLastPriority = config.priority;
             }
-            sConfiguredNetworks.put(config.networkId, config);
-            sNetworkIds.put(configKey(config), config.networkId);
+            mConfiguredNetworks.put(config.networkId, config);
+            mNetworkIds.put(configKey(config), config.networkId);
         }
 
         readIpAndProxyConfigurations();
         sendConfiguredNetworksChangedBroadcast();
     }
 
-    static void updateIpAndProxyFromWpsConfig(int netId, WpsInfo wpsConfig) {
-        WifiConfiguration config = sConfiguredNetworks.get(netId);
+    void updateIpAndProxyFromWpsConfig(int netId, WpsInfo wpsConfig) {
+        WifiConfiguration config = mConfiguredNetworks.get(netId);
         if (config != null) {
             config.ipAssignment = wpsConfig.ipAssignment;
             config.proxySettings = wpsConfig.proxySettings;
@@ -611,8 +610,8 @@
     }
 
     /* Mark all networks except specified netId as disabled */
-    private static void markAllNetworksDisabledExcept(int netId) {
-        for(WifiConfiguration config : sConfiguredNetworks.values()) {
+    private void markAllNetworksDisabledExcept(int netId) {
+        for(WifiConfiguration config : mConfiguredNetworks.values()) {
             if(config != null && config.networkId != netId) {
                 if (config.status != Status.DISABLED) {
                     config.status = Status.DISABLED;
@@ -622,43 +621,49 @@
         }
     }
 
-    private static void markAllNetworksDisabled() {
+    private void markAllNetworksDisabled() {
         markAllNetworksDisabledExcept(INVALID_NETWORK_ID);
     }
 
-    private static void writeIpAndProxyConfigurations() {
+    private void writeIpAndProxyConfigurations() {
 
         /* Make a copy */
         List<WifiConfiguration> networks = new ArrayList<WifiConfiguration>();
-        for(WifiConfiguration config : sConfiguredNetworks.values()) {
+        for(WifiConfiguration config : mConfiguredNetworks.values()) {
             networks.add(new WifiConfiguration(config));
         }
 
-        /* Do a delayed write to disk on a seperate handler thread */
-        synchronized (sDiskWriteHandlerSync) {
-            if (++sWriteSequence == 1) {
-                sDiskWriteHandlerThread = new HandlerThread("WifiConfigThread");
-                sDiskWriteHandlerThread.start();
-                sDiskWriteHandler = new DiskWriteHandler(sDiskWriteHandlerThread.getLooper());
-            }
-        }
-
-        sDiskWriteHandler.sendMessage(Message.obtain(sDiskWriteHandler, WRITE, networks));
+        DelayedDiskWrite.write(networks);
     }
 
-    private static class DiskWriteHandler extends Handler {
+    private static class DelayedDiskWrite {
 
-        DiskWriteHandler(android.os.Looper l) {
-            super(l);
-        }
+        private static HandlerThread sDiskWriteHandlerThread;
+        private static Handler sDiskWriteHandler;
+        /* Tracks multiple writes on the same thread */
+        private static int sWriteSequence = 0;
+        private static final String TAG = "DelayedDiskWrite";
 
-        public void handleMessage(Message msg) {
+        static void write (final List<WifiConfiguration> networks) {
 
-            if (msg.what != WRITE) {
-                throw new RuntimeException("Unsupported message in WifiConfigStore: " + msg);
+            /* Do a delayed write to disk on a seperate handler thread */
+            synchronized (DelayedDiskWrite.class) {
+                if (++sWriteSequence == 1) {
+                    sDiskWriteHandlerThread = new HandlerThread("WifiConfigThread");
+                    sDiskWriteHandlerThread.start();
+                    sDiskWriteHandler = new Handler(sDiskWriteHandlerThread.getLooper());
+                }
             }
 
-            List<WifiConfiguration> networks = (List<WifiConfiguration>) msg.obj;
+            sDiskWriteHandler.post(new Runnable() {
+                    @Override
+                    public void run() {
+                        onWriteCalled(networks);
+                    }
+                });
+        }
+
+        private static void onWriteCalled(List<WifiConfiguration> networks) {
 
             DataOutputStream out = null;
             try {
@@ -740,7 +745,7 @@
                                 /* Ignore */
                                 break;
                             default:
-                                loge("Ignore invalid proxy settings while writing");
+                                loge("Ignthisore invalid proxy settings while writing");
                                 break;
                         }
                         if (writeToFile) {
@@ -763,18 +768,22 @@
                 }
 
                 //Quit if no more writes sent
-                synchronized (sDiskWriteHandlerSync) {
+                synchronized (DelayedDiskWrite.class) {
                     if (--sWriteSequence == 0) {
-                        getLooper().quit();
+                        sDiskWriteHandler.getLooper().quit();
+                        sDiskWriteHandler = null;
                         sDiskWriteHandlerThread = null;
-                        sDiskWriteHandler= null;
                     }
                 }
             }
-       }
+        }
+
+        private static void loge(String s) {
+            Log.e(TAG, s);
+        }
     }
 
-    private static void readIpAndProxyConfigurations() {
+    private void readIpAndProxyConfigurations() {
 
         DataInputStream in = null;
         try {
@@ -847,8 +856,8 @@
                 } while (true);
 
                 if (id != -1) {
-                    WifiConfiguration config = sConfiguredNetworks.get(
-                            sNetworkIds.get(id));
+                    WifiConfiguration config = mConfiguredNetworks.get(
+                            mNetworkIds.get(id));
 
                     if (config == null) {
                         loge("configuration found for missing network, ignored");
@@ -901,7 +910,7 @@
         }
     }
 
-    private static NetworkUpdateResult addOrUpdateNetworkNative(WifiConfiguration config) {
+    private NetworkUpdateResult addOrUpdateNetworkNative(WifiConfiguration config) {
         /*
          * If the supplied networkId is INVALID_NETWORK_ID, we create a new empty
          * network configuration. Otherwise, the networkId should
@@ -911,12 +920,12 @@
         boolean newNetwork = false;
         // networkId of INVALID_NETWORK_ID means we want to create a new network
         if (netId == INVALID_NETWORK_ID) {
-            Integer savedNetId = sNetworkIds.get(configKey(config));
+            Integer savedNetId = mNetworkIds.get(configKey(config));
             if (savedNetId != null) {
                 netId = savedNetId;
             } else {
                 newNetwork = true;
-                netId = WifiNative.addNetwork();
+                netId = mWifiNative.addNetwork();
                 if (netId < 0) {
                     loge("Failed to add a network!");
                     return new NetworkUpdateResult(INVALID_NETWORK_ID);
@@ -929,7 +938,7 @@
         setVariables: {
 
             if (config.SSID != null &&
-                    !WifiNative.setNetworkVariable(
+                    !mWifiNative.setNetworkVariable(
                         netId,
                         WifiConfiguration.ssidVarName,
                         config.SSID)) {
@@ -938,7 +947,7 @@
             }
 
             if (config.BSSID != null &&
-                    !WifiNative.setNetworkVariable(
+                    !mWifiNative.setNetworkVariable(
                         netId,
                         WifiConfiguration.bssidVarName,
                         config.BSSID)) {
@@ -949,7 +958,7 @@
             String allowedKeyManagementString =
                 makeString(config.allowedKeyManagement, WifiConfiguration.KeyMgmt.strings);
             if (config.allowedKeyManagement.cardinality() != 0 &&
-                    !WifiNative.setNetworkVariable(
+                    !mWifiNative.setNetworkVariable(
                         netId,
                         WifiConfiguration.KeyMgmt.varName,
                         allowedKeyManagementString)) {
@@ -961,7 +970,7 @@
             String allowedProtocolsString =
                 makeString(config.allowedProtocols, WifiConfiguration.Protocol.strings);
             if (config.allowedProtocols.cardinality() != 0 &&
-                    !WifiNative.setNetworkVariable(
+                    !mWifiNative.setNetworkVariable(
                         netId,
                         WifiConfiguration.Protocol.varName,
                         allowedProtocolsString)) {
@@ -973,7 +982,7 @@
             String allowedAuthAlgorithmsString =
                 makeString(config.allowedAuthAlgorithms, WifiConfiguration.AuthAlgorithm.strings);
             if (config.allowedAuthAlgorithms.cardinality() != 0 &&
-                    !WifiNative.setNetworkVariable(
+                    !mWifiNative.setNetworkVariable(
                         netId,
                         WifiConfiguration.AuthAlgorithm.varName,
                         allowedAuthAlgorithmsString)) {
@@ -986,7 +995,7 @@
                     makeString(config.allowedPairwiseCiphers,
                     WifiConfiguration.PairwiseCipher.strings);
             if (config.allowedPairwiseCiphers.cardinality() != 0 &&
-                    !WifiNative.setNetworkVariable(
+                    !mWifiNative.setNetworkVariable(
                         netId,
                         WifiConfiguration.PairwiseCipher.varName,
                         allowedPairwiseCiphersString)) {
@@ -998,7 +1007,7 @@
             String allowedGroupCiphersString =
                 makeString(config.allowedGroupCiphers, WifiConfiguration.GroupCipher.strings);
             if (config.allowedGroupCiphers.cardinality() != 0 &&
-                    !WifiNative.setNetworkVariable(
+                    !mWifiNative.setNetworkVariable(
                         netId,
                         WifiConfiguration.GroupCipher.varName,
                         allowedGroupCiphersString)) {
@@ -1010,7 +1019,7 @@
             // Prevent client screw-up by passing in a WifiConfiguration we gave it
             // by preventing "*" as a key.
             if (config.preSharedKey != null && !config.preSharedKey.equals("*") &&
-                    !WifiNative.setNetworkVariable(
+                    !mWifiNative.setNetworkVariable(
                         netId,
                         WifiConfiguration.pskVarName,
                         config.preSharedKey)) {
@@ -1024,7 +1033,7 @@
                     // Prevent client screw-up by passing in a WifiConfiguration we gave it
                     // by preventing "*" as a key.
                     if (config.wepKeys[i] != null && !config.wepKeys[i].equals("*")) {
-                        if (!WifiNative.setNetworkVariable(
+                        if (!mWifiNative.setNetworkVariable(
                                     netId,
                                     WifiConfiguration.wepKeyVarNames[i],
                                     config.wepKeys[i])) {
@@ -1037,7 +1046,7 @@
             }
 
             if (hasSetKey) {
-                if (!WifiNative.setNetworkVariable(
+                if (!mWifiNative.setNetworkVariable(
                             netId,
                             WifiConfiguration.wepTxKeyIdxVarName,
                             Integer.toString(config.wepTxKeyIndex))) {
@@ -1046,7 +1055,7 @@
                 }
             }
 
-            if (!WifiNative.setNetworkVariable(
+            if (!mWifiNative.setNetworkVariable(
                         netId,
                         WifiConfiguration.priorityVarName,
                         Integer.toString(config.priority))) {
@@ -1055,7 +1064,7 @@
                 break setVariables;
             }
 
-            if (config.hiddenSSID && !WifiNative.setNetworkVariable(
+            if (config.hiddenSSID && !mWifiNative.setNetworkVariable(
                         netId,
                         WifiConfiguration.hiddenSSIDVarName,
                         Integer.toString(config.hiddenSSID ? 1 : 0))) {
@@ -1072,7 +1081,7 @@
                     if (field != config.eap) {
                         value = (value.length() == 0) ? "NULL" : convertToQuotedString(value);
                     }
-                    if (!WifiNative.setNetworkVariable(
+                    if (!mWifiNative.setNetworkVariable(
                                 netId,
                                 varName,
                                 value)) {
@@ -1087,37 +1096,37 @@
 
         if (updateFailed) {
             if (newNetwork) {
-                WifiNative.removeNetwork(netId);
+                mWifiNative.removeNetwork(netId);
                 loge("Failed to set a network variable, removed network: " + netId);
             }
             return new NetworkUpdateResult(INVALID_NETWORK_ID);
         }
 
         /* An update of the network variables requires reading them
-         * back from the supplicant to update sConfiguredNetworks.
+         * back from the supplicant to update mConfiguredNetworks.
          * This is because some of the variables (SSID, wep keys &
          * passphrases) reflect different values when read back than
          * when written. For example, wep key is stored as * irrespective
          * of the value sent to the supplicant
          */
-        WifiConfiguration sConfig = sConfiguredNetworks.get(netId);
-        if (sConfig == null) {
-            sConfig = new WifiConfiguration();
-            sConfig.networkId = netId;
+        WifiConfiguration currentConfig = mConfiguredNetworks.get(netId);
+        if (currentConfig == null) {
+            currentConfig = new WifiConfiguration();
+            currentConfig.networkId = netId;
         }
 
-        readNetworkVariables(sConfig);
+        readNetworkVariables(currentConfig);
 
-        sConfiguredNetworks.put(netId, sConfig);
-        sNetworkIds.put(configKey(sConfig), netId);
+        mConfiguredNetworks.put(netId, currentConfig);
+        mNetworkIds.put(configKey(currentConfig), netId);
 
-        NetworkUpdateResult result = writeIpAndProxyConfigurationsOnChange(sConfig, config);
+        NetworkUpdateResult result = writeIpAndProxyConfigurationsOnChange(currentConfig, config);
         result.setNetworkId(netId);
         return result;
     }
 
     /* Compare current and new configuration and write to file on change */
-    private static NetworkUpdateResult writeIpAndProxyConfigurationsOnChange(
+    private NetworkUpdateResult writeIpAndProxyConfigurationsOnChange(
             WifiConfiguration currentConfig,
             WifiConfiguration newConfig) {
         boolean ipChanged = false;
@@ -1216,7 +1225,7 @@
         return new NetworkUpdateResult(ipChanged, proxyChanged);
     }
 
-    private static void addIpSettingsFromConfig(LinkProperties linkProperties,
+    private void addIpSettingsFromConfig(LinkProperties linkProperties,
             WifiConfiguration config) {
         for (LinkAddress linkAddr : config.linkProperties.getLinkAddresses()) {
             linkProperties.addLinkAddress(linkAddr);
@@ -1235,7 +1244,7 @@
      *
      * @param config the {@link WifiConfiguration} object to be filled in.
      */
-    private static void readNetworkVariables(WifiConfiguration config) {
+    private void readNetworkVariables(WifiConfiguration config) {
 
         int netId = config.networkId;
         if (netId < 0)
@@ -1248,21 +1257,21 @@
          */
         String value;
 
-        value = WifiNative.getNetworkVariable(netId, WifiConfiguration.ssidVarName);
+        value = mWifiNative.getNetworkVariable(netId, WifiConfiguration.ssidVarName);
         if (!TextUtils.isEmpty(value)) {
             config.SSID = value;
         } else {
             config.SSID = null;
         }
 
-        value = WifiNative.getNetworkVariable(netId, WifiConfiguration.bssidVarName);
+        value = mWifiNative.getNetworkVariable(netId, WifiConfiguration.bssidVarName);
         if (!TextUtils.isEmpty(value)) {
             config.BSSID = value;
         } else {
             config.BSSID = null;
         }
 
-        value = WifiNative.getNetworkVariable(netId, WifiConfiguration.priorityVarName);
+        value = mWifiNative.getNetworkVariable(netId, WifiConfiguration.priorityVarName);
         config.priority = -1;
         if (!TextUtils.isEmpty(value)) {
             try {
@@ -1271,7 +1280,7 @@
             }
         }
 
-        value = WifiNative.getNetworkVariable(netId, WifiConfiguration.hiddenSSIDVarName);
+        value = mWifiNative.getNetworkVariable(netId, WifiConfiguration.hiddenSSIDVarName);
         config.hiddenSSID = false;
         if (!TextUtils.isEmpty(value)) {
             try {
@@ -1280,7 +1289,7 @@
             }
         }
 
-        value = WifiNative.getNetworkVariable(netId, WifiConfiguration.wepTxKeyIdxVarName);
+        value = mWifiNative.getNetworkVariable(netId, WifiConfiguration.wepTxKeyIdxVarName);
         config.wepTxKeyIndex = -1;
         if (!TextUtils.isEmpty(value)) {
             try {
@@ -1290,7 +1299,7 @@
         }
 
         for (int i = 0; i < 4; i++) {
-            value = WifiNative.getNetworkVariable(netId,
+            value = mWifiNative.getNetworkVariable(netId,
                     WifiConfiguration.wepKeyVarNames[i]);
             if (!TextUtils.isEmpty(value)) {
                 config.wepKeys[i] = value;
@@ -1299,14 +1308,14 @@
             }
         }
 
-        value = WifiNative.getNetworkVariable(netId, WifiConfiguration.pskVarName);
+        value = mWifiNative.getNetworkVariable(netId, WifiConfiguration.pskVarName);
         if (!TextUtils.isEmpty(value)) {
             config.preSharedKey = value;
         } else {
             config.preSharedKey = null;
         }
 
-        value = WifiNative.getNetworkVariable(config.networkId,
+        value = mWifiNative.getNetworkVariable(config.networkId,
                 WifiConfiguration.Protocol.varName);
         if (!TextUtils.isEmpty(value)) {
             String vals[] = value.split(" ");
@@ -1319,7 +1328,7 @@
             }
         }
 
-        value = WifiNative.getNetworkVariable(config.networkId,
+        value = mWifiNative.getNetworkVariable(config.networkId,
                 WifiConfiguration.KeyMgmt.varName);
         if (!TextUtils.isEmpty(value)) {
             String vals[] = value.split(" ");
@@ -1332,7 +1341,7 @@
             }
         }
 
-        value = WifiNative.getNetworkVariable(config.networkId,
+        value = mWifiNative.getNetworkVariable(config.networkId,
                 WifiConfiguration.AuthAlgorithm.varName);
         if (!TextUtils.isEmpty(value)) {
             String vals[] = value.split(" ");
@@ -1345,7 +1354,7 @@
             }
         }
 
-        value = WifiNative.getNetworkVariable(config.networkId,
+        value = mWifiNative.getNetworkVariable(config.networkId,
                 WifiConfiguration.PairwiseCipher.varName);
         if (!TextUtils.isEmpty(value)) {
             String vals[] = value.split(" ");
@@ -1358,7 +1367,7 @@
             }
         }
 
-        value = WifiNative.getNetworkVariable(config.networkId,
+        value = mWifiNative.getNetworkVariable(config.networkId,
                 WifiConfiguration.GroupCipher.varName);
         if (!TextUtils.isEmpty(value)) {
             String vals[] = value.split(" ");
@@ -1373,7 +1382,7 @@
 
         for (WifiConfiguration.EnterpriseField field :
                 config.enterpriseFields) {
-            value = WifiNative.getNetworkVariable(netId,
+            value = mWifiNative.getNetworkVariable(netId,
                     field.varName());
             if (!TextUtils.isEmpty(value)) {
                 if (field != config.eap) value = removeDoubleQuotes(value);
@@ -1382,16 +1391,16 @@
         }
     }
 
-    private static String removeDoubleQuotes(String string) {
+    private String removeDoubleQuotes(String string) {
         if (string.length() <= 2) return "";
         return string.substring(1, string.length() - 1);
     }
 
-    private static String convertToQuotedString(String string) {
+    private String convertToQuotedString(String string) {
         return "\"" + string + "\"";
     }
 
-    private static String makeString(BitSet set, String[] strings) {
+    private String makeString(BitSet set, String[] strings) {
         StringBuffer buf = new StringBuffer();
         int nextSetBit = -1;
 
@@ -1411,7 +1420,7 @@
         return buf.toString();
     }
 
-    private static int lookupString(String string, String[] strings) {
+    private int lookupString(String string, String[] strings) {
         int size = strings.length;
 
         string = string.replace('-', '_');
@@ -1446,10 +1455,10 @@
         return key.hashCode();
     }
 
-    static String dump() {
+    String dump() {
         StringBuffer sb = new StringBuffer();
         String LS = System.getProperty("line.separator");
-        sb.append("sLastPriority ").append(sLastPriority).append(LS);
+        sb.append("mLastPriority ").append(mLastPriority).append(LS);
         sb.append("Configured networks ").append(LS);
         for (WifiConfiguration conf : getConfiguredNetworks()) {
             sb.append(conf).append(LS);
@@ -1457,15 +1466,15 @@
         return sb.toString();
     }
 
-    public static String getConfigFile() {
+    public String getConfigFile() {
         return ipConfigFile;
     }
 
-    private static void loge(String s) {
+    private void loge(String s) {
         Log.e(TAG, s);
     }
 
-    private static void log(String s) {
+    private void log(String s) {
         Log.d(TAG, s);
     }
 }
diff --git a/wifi/java/android/net/wifi/WifiMonitor.java b/wifi/java/android/net/wifi/WifiMonitor.java
index 05b8fe1..bbb74d1 100644
--- a/wifi/java/android/net/wifi/WifiMonitor.java
+++ b/wifi/java/android/net/wifi/WifiMonitor.java
@@ -202,6 +202,7 @@
     private static final String AP_STA_DISCONNECTED_STR = "AP-STA-DISCONNECTED";
 
     private final StateMachine mStateMachine;
+    private final WifiNative mWifiNative;
 
     /* Supplicant events reported to a state machine */
     private static final int BASE = Protocol.BASE_WIFI_MONITOR;
@@ -266,8 +267,9 @@
      */
     private static final int MAX_RECV_ERRORS    = 10;
 
-    public WifiMonitor(StateMachine wifiStateMachine) {
+    public WifiMonitor(StateMachine wifiStateMachine, WifiNative wifiNative) {
         mStateMachine = wifiStateMachine;
+        mWifiNative = wifiNative;
     }
 
     public void startMonitoring() {
@@ -292,7 +294,7 @@
 
             //noinspection InfiniteLoopStatement
             for (;;) {
-                String eventStr = WifiNative.waitForEvent();
+                String eventStr = mWifiNative.waitForEvent();
 
                 // Skip logging the common but mostly uninteresting scan-results event
                 if (false && eventStr.indexOf(SCAN_RESULTS_STR) == -1) {
@@ -406,7 +408,7 @@
             int connectTries = 0;
 
             while (true) {
-                if (WifiNative.connectToSupplicant()) {
+                if (mWifiNative.connectToSupplicant()) {
                     return true;
                 }
                 if (connectTries++ < 5) {
diff --git a/wifi/java/android/net/wifi/WifiNative.java b/wifi/java/android/net/wifi/WifiNative.java
index f8eafde..48a785c 100644
--- a/wifi/java/android/net/wifi/WifiNative.java
+++ b/wifi/java/android/net/wifi/WifiNative.java
@@ -39,11 +39,13 @@
  */
 public class WifiNative {
 
+    private static final int DEFAULT_GROUP_OWNER_INTENT = 7;
+
     static final int BLUETOOTH_COEXISTENCE_MODE_ENABLED = 0;
     static final int BLUETOOTH_COEXISTENCE_MODE_DISABLED = 1;
     static final int BLUETOOTH_COEXISTENCE_MODE_SENSE = 2;
 
-    static String sDefaultInterface;
+    String mInterface = "";
 
     public native static boolean loadDriver();
 
@@ -59,60 +61,60 @@
        or when the supplicant is hung */
     public native static boolean killSupplicant();
 
-    public native static boolean connectToSupplicant(String iface);
+    private native boolean connectToSupplicant(String iface);
 
-    public native static void closeSupplicantConnection(String iface);
+    private native void closeSupplicantConnection(String iface);
 
     /**
      * Wait for the supplicant to send an event, returning the event string.
      * @return the event string sent by the supplicant.
      */
-    public native static String waitForEvent(String iface);
+    private native String waitForEvent(String iface);
 
-    private native static boolean doBooleanCommand(String iface, String command);
+    private native boolean doBooleanCommand(String iface, String command);
 
-    private native static int doIntCommand(String iface, String command);
+    private native int doIntCommand(String iface, String command);
 
-    private native static String doStringCommand(String iface, String command);
+    private native String doStringCommand(String iface, String command);
 
-    public static void setDefaultInterface(String iface) {
-        sDefaultInterface = iface;
+    public WifiNative(String iface) {
+        mInterface = iface;
     }
 
-    public static boolean connectToSupplicant() {
-        return connectToSupplicant(sDefaultInterface);
+    public boolean connectToSupplicant() {
+        return connectToSupplicant(mInterface);
     }
 
-    public static void closeSupplicantConnection() {
-        closeSupplicantConnection(sDefaultInterface);
+    public void closeSupplicantConnection() {
+        closeSupplicantConnection(mInterface);
     }
 
-    public static String waitForEvent() {
-        return waitForEvent(sDefaultInterface);
+    public String waitForEvent() {
+        return waitForEvent(mInterface);
     }
 
-    private static boolean doBooleanCommand(String command) {
-        return doBooleanCommand(sDefaultInterface, command);
+    private boolean doBooleanCommand(String command) {
+        return doBooleanCommand(mInterface, command);
     }
 
-    private static int doIntCommand(String command) {
-        return doIntCommand(sDefaultInterface, command);
+    private int doIntCommand(String command) {
+        return doIntCommand(mInterface, command);
     }
 
-    private static String doStringCommand(String command) {
-        return doStringCommand(sDefaultInterface, command);
+    private String doStringCommand(String command) {
+        return doStringCommand(mInterface, command);
     }
 
-    public static boolean ping() {
+    public boolean ping() {
         String pong = doStringCommand("PING");
         return (pong != null && pong.equals("PONG"));
     }
 
-    public static boolean scan() {
+    public boolean scan() {
        return doBooleanCommand("SCAN");
     }
 
-    public static boolean setScanMode(boolean setActive) {
+    public boolean setScanMode(boolean setActive) {
         if (setActive) {
             return doBooleanCommand("DRIVER SCAN-ACTIVE");
         } else {
@@ -126,33 +128,33 @@
      * for a graceful stop and a mild-sounding "stop" interface
      * to kill the process
      */
-    public static boolean stopSupplicant() {
+    public boolean stopSupplicant() {
         return doBooleanCommand("TERMINATE");
     }
 
-    public static String listNetworks() {
+    public String listNetworks() {
         return doStringCommand("LIST_NETWORKS");
     }
 
-    public static int addNetwork() {
+    public int addNetwork() {
         return doIntCommand("ADD_NETWORK");
     }
 
-    public static boolean setNetworkVariable(int netId, String name, String value) {
+    public boolean setNetworkVariable(int netId, String name, String value) {
         if (TextUtils.isEmpty(name) || TextUtils.isEmpty(value)) return false;
         return doBooleanCommand("SET_NETWORK " + netId + " " + name + " " + value);
     }
 
-    public static String getNetworkVariable(int netId, String name) {
+    public String getNetworkVariable(int netId, String name) {
         if (TextUtils.isEmpty(name)) return null;
         return doStringCommand("GET_NETWORK " + netId + " " + name);
     }
 
-    public static boolean removeNetwork(int netId) {
+    public boolean removeNetwork(int netId) {
         return doBooleanCommand("REMOVE_NETWORK " + netId);
     }
 
-    public static boolean enableNetwork(int netId, boolean disableOthers) {
+    public boolean enableNetwork(int netId, boolean disableOthers) {
         if (disableOthers) {
             return doBooleanCommand("SELECT_NETWORK " + netId);
         } else {
@@ -160,27 +162,27 @@
         }
     }
 
-    public static boolean disableNetwork(int netId) {
+    public boolean disableNetwork(int netId) {
         return doBooleanCommand("DISABLE_NETWORK " + netId);
     }
 
-    public static boolean reconnect() {
+    public boolean reconnect() {
         return doBooleanCommand("RECONNECT");
     }
 
-    public static boolean reassociate() {
+    public boolean reassociate() {
         return doBooleanCommand("REASSOCIATE");
     }
 
-    public static boolean disconnect() {
+    public boolean disconnect() {
         return doBooleanCommand("DISCONNECT");
     }
 
-    public static String status() {
+    public String status() {
         return doStringCommand("STATUS");
     }
 
-    public static String getMacAddress() {
+    public String getMacAddress() {
         //Macaddr = XX.XX.XX.XX.XX.XX
         String ret = doStringCommand("DRIVER MACADDR");
         if (!TextUtils.isEmpty(ret)) {
@@ -190,15 +192,15 @@
         return null;
     }
 
-    public static String scanResults() {
+    public String scanResults() {
         return doStringCommand("SCAN_RESULTS");
     }
 
-    public static boolean startDriver() {
+    public boolean startDriver() {
         return doBooleanCommand("DRIVER START");
     }
 
-    public static boolean stopDriver() {
+    public boolean stopDriver() {
         return doBooleanCommand("DRIVER STOP");
     }
 
@@ -227,7 +229,7 @@
      *
      * The  SETSUSPENDOPT driver command overrides the filtering rules
      */
-    public static boolean startFilteringMulticastV4Packets() {
+    public boolean startFilteringMulticastV4Packets() {
         return doBooleanCommand("DRIVER RXFILTER-STOP")
             && doBooleanCommand("DRIVER RXFILTER-REMOVE 2")
             && doBooleanCommand("DRIVER RXFILTER-START");
@@ -237,7 +239,7 @@
      * Stop filtering out Multicast V4 packets.
      * @return {@code true} if the operation succeeded, {@code false} otherwise
      */
-    public static boolean stopFilteringMulticastV4Packets() {
+    public boolean stopFilteringMulticastV4Packets() {
         return doBooleanCommand("DRIVER RXFILTER-STOP")
             && doBooleanCommand("DRIVER RXFILTER-ADD 2")
             && doBooleanCommand("DRIVER RXFILTER-START");
@@ -247,7 +249,7 @@
      * Start filtering out Multicast V6 packets
      * @return {@code true} if the operation succeeded, {@code false} otherwise
      */
-    public static boolean startFilteringMulticastV6Packets() {
+    public boolean startFilteringMulticastV6Packets() {
         return doBooleanCommand("DRIVER RXFILTER-STOP")
             && doBooleanCommand("DRIVER RXFILTER-REMOVE 3")
             && doBooleanCommand("DRIVER RXFILTER-START");
@@ -257,13 +259,13 @@
      * Stop filtering out Multicast V6 packets.
      * @return {@code true} if the operation succeeded, {@code false} otherwise
      */
-    public static boolean stopFilteringMulticastV6Packets() {
+    public boolean stopFilteringMulticastV6Packets() {
         return doBooleanCommand("DRIVER RXFILTER-STOP")
             && doBooleanCommand("DRIVER RXFILTER-ADD 3")
             && doBooleanCommand("DRIVER RXFILTER-START");
     }
 
-    public static int getPowerMode() {
+    public int getPowerMode() {
         String ret = doStringCommand("DRIVER GETPOWER");
         if (!TextUtils.isEmpty(ret)) {
             // reply comes back in the form "powermode = XX" where XX is the
@@ -278,11 +280,11 @@
         return -1;
     }
 
-    public static boolean setPowerMode(int mode) {
+    public boolean setPowerMode(int mode) {
         return doBooleanCommand("DRIVER POWERMODE " + mode);
     }
 
-    public static int getBand() {
+    public int getBand() {
        String ret = doStringCommand("DRIVER GETBAND");
         if (!TextUtils.isEmpty(ret)) {
             //reply is "BAND X" where X is the band
@@ -296,7 +298,7 @@
         return -1;
     }
 
-    public static boolean setBand(int band) {
+    public boolean setBand(int band) {
         return doBooleanCommand("DRIVER SETBAND " + band);
     }
 
@@ -308,7 +310,7 @@
      *            {@link #BLUETOOTH_COEXISTENCE_MODE_SENSE}.
      * @return Whether the mode was successfully set.
      */
-    public static boolean setBluetoothCoexistenceMode(int mode) {
+    public boolean setBluetoothCoexistenceMode(int mode) {
         return doBooleanCommand("DRIVER BTCOEXMODE " + mode);
     }
 
@@ -320,7 +322,7 @@
      * @param isSet whether to enable or disable this mode
      * @return {@code true} if the command succeeded, {@code false} otherwise.
      */
-    public static boolean setBluetoothCoexistenceScanMode(boolean setCoexScanMode) {
+    public boolean setBluetoothCoexistenceScanMode(boolean setCoexScanMode) {
         if (setCoexScanMode) {
             return doBooleanCommand("DRIVER BTCOEXSCAN-START");
         } else {
@@ -328,25 +330,25 @@
         }
     }
 
-    public static boolean saveConfig() {
+    public boolean saveConfig() {
         // Make sure we never write out a value for AP_SCAN other than 1
         return doBooleanCommand("AP_SCAN 1") && doBooleanCommand("SAVE_CONFIG");
     }
 
-    public static boolean setScanResultHandling(int mode) {
+    public boolean setScanResultHandling(int mode) {
         return doBooleanCommand("AP_SCAN " + mode);
     }
 
-    public static boolean addToBlacklist(String bssid) {
+    public boolean addToBlacklist(String bssid) {
         if (TextUtils.isEmpty(bssid)) return false;
         return doBooleanCommand("BLACKLIST " + bssid);
     }
 
-    public static boolean clearBlacklist() {
+    public boolean clearBlacklist() {
         return doBooleanCommand("BLACKLIST clear");
     }
 
-    public static boolean setSuspendOptimizations(boolean enabled) {
+    public boolean setSuspendOptimizations(boolean enabled) {
         if (enabled) {
             return doBooleanCommand("DRIVER SETSUSPENDOPT 0");
         } else {
@@ -354,11 +356,11 @@
         }
     }
 
-    public static boolean setCountryCode(String countryCode) {
+    public boolean setCountryCode(String countryCode) {
         return doBooleanCommand("DRIVER COUNTRY " + countryCode);
     }
 
-    public static void enableBackgroundScan(boolean enable) {
+    public void enableBackgroundScan(boolean enable) {
         //Note: BGSCAN-START and BGSCAN-STOP are documented in core/res/res/values/config.xml
         //and will need an update if the names are changed
         if (enable) {
@@ -368,7 +370,7 @@
         }
     }
 
-    public static void setScanInterval(int scanInterval) {
+    public void setScanInterval(int scanInterval) {
         doBooleanCommand("SCAN_INTERVAL " + scanInterval);
     }
 
@@ -378,81 +380,81 @@
      * NOISE=9999
      * FREQUENCY=0
      */
-    public static String signalPoll() {
+    public String signalPoll() {
         return doStringCommand("SIGNAL_POLL");
     }
 
-    public static boolean startWpsPbc() {
+    public boolean startWpsPbc() {
         return doBooleanCommand("WPS_PBC");
     }
 
-    public static boolean startWpsPbc(String bssid) {
+    public boolean startWpsPbc(String bssid) {
         return doBooleanCommand("WPS_PBC " + bssid);
     }
 
-    public static boolean startWpsPinKeypad(String pin) {
+    public boolean startWpsPinKeypad(String pin) {
         return doBooleanCommand("WPS_PIN any " + pin);
     }
 
-    public static String startWpsPinDisplay(String bssid) {
+    public String startWpsPinDisplay(String bssid) {
         return doStringCommand("WPS_PIN " + bssid);
     }
 
     /* Configures an access point connection */
-    public static boolean startWpsRegistrar(String bssid, String pin) {
+    public boolean startWpsRegistrar(String bssid, String pin) {
         return doBooleanCommand("WPS_REG " + bssid + " " + pin);
     }
 
-    public static boolean setPersistentReconnect(boolean enabled) {
+    public boolean setPersistentReconnect(boolean enabled) {
         int value = (enabled == true) ? 1 : 0;
         return doBooleanCommand("SET persistent_reconnect " + value);
     }
 
-    public static boolean setDeviceName(String name) {
+    public boolean setDeviceName(String name) {
         return doBooleanCommand("SET device_name " + name);
     }
 
-    public static boolean setDeviceType(String type) {
+    public boolean setDeviceType(String type) {
         return doBooleanCommand("SET device_type " + type);
     }
 
-    public static boolean setConfigMethods(String cfg) {
+    public boolean setConfigMethods(String cfg) {
         return doBooleanCommand("SET config_methods " + cfg);
     }
 
-    public static boolean setP2pSsidPostfix(String postfix) {
+    public boolean setP2pSsidPostfix(String postfix) {
         return doBooleanCommand("SET p2p_ssid_postfix " + postfix);
     }
 
-    public static boolean p2pFind() {
+    public boolean p2pFind() {
         return doBooleanCommand("P2P_FIND");
     }
 
-    public static boolean p2pFind(int timeout) {
+    public boolean p2pFind(int timeout) {
         if (timeout <= 0) {
             return p2pFind();
         }
         return doBooleanCommand("P2P_FIND " + timeout);
     }
 
-    public static boolean p2pListen() {
+    public boolean p2pListen() {
         return doBooleanCommand("P2P_LISTEN");
     }
 
-    public static boolean p2pListen(int timeout) {
+    public boolean p2pListen(int timeout) {
         if (timeout <= 0) {
             return p2pListen();
         }
         return doBooleanCommand("P2P_LISTEN " + timeout);
     }
 
-    public static boolean p2pFlush() {
+    public boolean p2pFlush() {
         return doBooleanCommand("P2P_FLUSH");
     }
 
     /* p2p_connect <peer device address> <pbc|pin|PIN#> [label|display|keypad]
         [persistent] [join|auth] [go_intent=<0..15>] [freq=<in MHz>] */
-    public static String p2pConnect(WifiP2pConfig config, boolean joinExistingGroup) {
+    public String p2pConnect(WifiP2pConfig config, boolean joinExistingGroup) {
         if (config == null) return null;
         List<String> args = new ArrayList<String>();
         WpsInfo wps = config.wps;
@@ -492,7 +494,7 @@
         //device battery state
         int groupOwnerIntent = config.groupOwnerIntent;
         if (groupOwnerIntent < 0 || groupOwnerIntent > 15) {
-            groupOwnerIntent = 7; //default value
+            groupOwnerIntent = DEFAULT_GROUP_OWNER_INTENT;
         }
         args.add("go_intent=" + groupOwnerIntent);
 
@@ -502,11 +504,11 @@
         return doStringCommand(command);
     }
 
-    public static boolean p2pCancelConnect() {
+    public boolean p2pCancelConnect() {
         return doBooleanCommand("P2P_CANCEL");
     }
 
-    public static boolean p2pProvisionDiscovery(WifiP2pConfig config) {
+    public boolean p2pProvisionDiscovery(WifiP2pConfig config) {
         if (config == null) return false;
 
         switch (config.wps.setup) {
@@ -524,21 +526,21 @@
         return false;
     }
 
-    public static boolean p2pGroupAdd() {
+    public boolean p2pGroupAdd() {
         return doBooleanCommand("P2P_GROUP_ADD");
     }
 
-    public static boolean p2pGroupRemove(String iface) {
+    public boolean p2pGroupRemove(String iface) {
         if (iface == null) return false;
         return doBooleanCommand("P2P_GROUP_REMOVE " + iface);
     }
 
-    public static boolean p2pReject(String deviceAddress) {
+    public boolean p2pReject(String deviceAddress) {
         return doBooleanCommand("P2P_REJECT " + deviceAddress);
     }
 
     /* Invite a peer to a group */
-    public static boolean p2pInvite(WifiP2pGroup group, String deviceAddress) {
+    public boolean p2pInvite(WifiP2pGroup group, String deviceAddress) {
         if (deviceAddress == null) return false;
 
         if (group == null) {
@@ -550,14 +552,14 @@
     }
 
     /* Reinvoke a persistent connection */
-    public static boolean p2pReinvoke(int netId, String deviceAddress) {
+    public boolean p2pReinvoke(int netId, String deviceAddress) {
         if (deviceAddress == null || netId < 0) return false;
 
         return doBooleanCommand("P2P_INVITE persistent=" + netId + " peer=" + deviceAddress);
     }
 
 
-    public static String p2pGetInterfaceAddress(String deviceAddress) {
+    public String p2pGetInterfaceAddress(String deviceAddress) {
         if (deviceAddress == null) return null;
 
         //  "p2p_peer deviceAddress" returns a multi-line result containing
@@ -577,7 +579,7 @@
         return null;
     }
 
-    public static String p2pGetDeviceAddress() {
+    public String p2pGetDeviceAddress() {
         String status = status();
         if (status == null) return "";
 
@@ -592,7 +594,7 @@
         return "";
     }
 
-    public static String p2pPeer(String deviceAddress) {
+    public String p2pPeer(String deviceAddress) {
         return doStringCommand("P2P_PEER " + deviceAddress);
     }
 }
diff --git a/wifi/java/android/net/wifi/WifiStateMachine.java b/wifi/java/android/net/wifi/WifiStateMachine.java
index 1a85529..b8b7c0e 100644
--- a/wifi/java/android/net/wifi/WifiStateMachine.java
+++ b/wifi/java/android/net/wifi/WifiStateMachine.java
@@ -113,6 +113,8 @@
     private static final String SOFTAP_IFACE = "wl0.1";
 
     private WifiMonitor mWifiMonitor;
+    private WifiNative mWifiNative;
+    private WifiConfigStore mWifiConfigStore;
     private INetworkManagementService mNwService;
     private ConnectivityManager mCm;
 
@@ -554,11 +556,14 @@
         IBinder b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE);
         mNwService = INetworkManagementService.Stub.asInterface(b);
 
-        mWifiMonitor = new WifiMonitor(this);
+        mWifiNative = new WifiNative(mInterfaceName);
+        mWifiConfigStore = new WifiConfigStore(context, mWifiNative);
+        mWifiMonitor = new WifiMonitor(this, mWifiNative);
         mDhcpInfoInternal = new DhcpInfoInternal();
         mWifiInfo = new WifiInfo();
-        mSupplicantStateTracker = new SupplicantStateTracker(context, this, getHandler());
-        mWpsStateMachine = new WpsStateMachine(context, this, getHandler());
+        mSupplicantStateTracker = new SupplicantStateTracker(context, this, mWifiConfigStore,
+                getHandler());
+        mWpsStateMachine = new WpsStateMachine(context, this, mWifiConfigStore, getHandler());
         mLinkProperties = new LinkProperties();
 
         WifiApConfigStore wifiApConfigStore = WifiApConfigStore.makeWifiApConfigStore(
@@ -572,9 +577,6 @@
         mLastNetworkId = WifiConfiguration.INVALID_NETWORK_ID;
         mLastSignalLevel = -1;
 
-        /* Set default interface for all primary socket communication */
-        WifiNative.setDefaultInterface(mInterfaceName);
-
         mAlarmManager = (AlarmManager)mContext.getSystemService(Context.ALARM_SERVICE);
         Intent scanIntent = new Intent(ACTION_START_SCAN, null);
         mScanIntent = PendingIntent.getBroadcast(mContext, SCAN_REQUEST, scanIntent, 0);
@@ -1044,7 +1046,7 @@
      * Returns the wifi configuration file
      */
     public String getConfigFile() {
-        return WifiConfigStore.getConfigFile();
+        return mWifiConfigStore.getConfigFile();
     }
 
     /**
@@ -1118,9 +1120,9 @@
         sb.append("mReconnectCount ").append(mReconnectCount).append(LS);
         sb.append("mIsScanMode ").append(mIsScanMode).append(LS);
         sb.append("Supplicant status").append(LS)
-                .append(WifiNative.status()).append(LS).append(LS);
+                .append(mWifiNative.status()).append(LS).append(LS);
 
-        sb.append(WifiConfigStore.dump());
+        sb.append(mWifiConfigStore.dump());
         return sb.toString();
     }
 
@@ -1413,7 +1415,7 @@
     }
 
     private String fetchSSID() {
-        String status = WifiNative.status();
+        String status = mWifiNative.status();
         if (status == null) {
             return null;
         }
@@ -1436,7 +1438,7 @@
         int newRssi = -1;
         int newLinkSpeed = -1;
 
-        String signalPoll = WifiNative.signalPoll();
+        String signalPoll = mWifiNative.signalPoll();
 
         if (signalPoll != null) {
             String[] lines = signalPoll.split("\n");
@@ -1486,28 +1488,28 @@
     }
 
     private void setHighPerfModeEnabledNative(boolean enable) {
-        if(!WifiNative.setSuspendOptimizations(!enable)) {
+        if(!mWifiNative.setSuspendOptimizations(!enable)) {
             loge("set suspend optimizations failed!");
         }
         if (enable) {
-            if (!WifiNative.setPowerMode(POWER_MODE_ACTIVE)) {
+            if (!mWifiNative.setPowerMode(POWER_MODE_ACTIVE)) {
                 loge("set power mode active failed!");
             }
         } else {
-            if (!WifiNative.setPowerMode(POWER_MODE_AUTO)) {
+            if (!mWifiNative.setPowerMode(POWER_MODE_AUTO)) {
                 loge("set power mode auto failed!");
             }
         }
     }
 
     private void configureLinkProperties() {
-        if (WifiConfigStore.isUsingStaticIp(mLastNetworkId)) {
-            mLinkProperties = WifiConfigStore.getLinkProperties(mLastNetworkId);
+        if (mWifiConfigStore.isUsingStaticIp(mLastNetworkId)) {
+            mLinkProperties = mWifiConfigStore.getLinkProperties(mLastNetworkId);
         } else {
             synchronized (mDhcpInfoInternal) {
                 mLinkProperties = mDhcpInfoInternal.makeLinkProperties();
             }
-            mLinkProperties.setHttpProxy(WifiConfigStore.getProxyProperties(mLastNetworkId));
+            mLinkProperties.setHttpProxy(mWifiConfigStore.getProxyProperties(mLastNetworkId));
         }
         mLinkProperties.setInterfaceName(mInterfaceName);
         if (DBG) {
@@ -1623,6 +1625,10 @@
     private void handleNetworkDisconnect() {
         if (DBG) log("Stopping DHCP and clearing IP");
 
+        /* In case we were in middle of DHCP operation
+           restore back powermode */
+        handlePostDhcpSetup();
+
         /*
          * stop DHCP
          */
@@ -1648,7 +1654,7 @@
         mWifiInfo.setLinkSpeed(-1);
 
         setNetworkDetailedState(DetailedState.DISCONNECTED);
-        WifiConfigStore.updateStatus(mLastNetworkId, DetailedState.DISCONNECTED);
+        mWifiConfigStore.updateStatus(mLastNetworkId, DetailedState.DISCONNECTED);
 
         /* send event to CM & network change broadcast */
         sendNetworkStateChangeBroadcast(mLastBssid);
@@ -1656,8 +1662,8 @@
         /* Clear network properties */
         mLinkProperties.clear();
         /* Clear IP settings if the network used DHCP */
-        if (!WifiConfigStore.isUsingStaticIp(mLastNetworkId)) {
-            WifiConfigStore.clearIpConfiguration(mLastNetworkId);
+        if (!mWifiConfigStore.isUsingStaticIp(mLastNetworkId)) {
+            mWifiConfigStore.clearIpConfiguration(mLastNetworkId);
         }
 
         mLastBssid= null;
@@ -1683,29 +1689,29 @@
              * coexistence would interrupt that connection.
              */
             // Disable the coexistence mode
-            WifiNative.setBluetoothCoexistenceMode(
-                    WifiNative.BLUETOOTH_COEXISTENCE_MODE_DISABLED);
+            mWifiNative.setBluetoothCoexistenceMode(
+                    mWifiNative.BLUETOOTH_COEXISTENCE_MODE_DISABLED);
         }
 
-        mPowerMode =  WifiNative.getPowerMode();
+        mPowerMode =  mWifiNative.getPowerMode();
         if (mPowerMode < 0) {
             // Handle the case where supplicant driver does not support
             // getPowerModeCommand.
             mPowerMode = WifiStateMachine.POWER_MODE_AUTO;
         }
         if (mPowerMode != WifiStateMachine.POWER_MODE_ACTIVE) {
-            WifiNative.setPowerMode(WifiStateMachine.POWER_MODE_ACTIVE);
+            mWifiNative.setPowerMode(WifiStateMachine.POWER_MODE_ACTIVE);
         }
     }
 
 
     void handlePostDhcpSetup() {
         /* restore power mode */
-        WifiNative.setPowerMode(mPowerMode);
+        mWifiNative.setPowerMode(mPowerMode);
 
         // Set the coexistence mode back to its default value
-        WifiNative.setBluetoothCoexistenceMode(
-                WifiNative.BLUETOOTH_COEXISTENCE_MODE_SENSE);
+        mWifiNative.setBluetoothCoexistenceMode(
+                mWifiNative.BLUETOOTH_COEXISTENCE_MODE_SENSE);
     }
 
     private void handleSuccessfulIpConfiguration(DhcpInfoInternal dhcpInfoInternal) {
@@ -1714,13 +1720,13 @@
         }
         mLastSignalLevel = -1; // force update of signal strength
         mReconnectCount = 0; //Reset IP failure tracking
-        WifiConfigStore.setIpConfiguration(mLastNetworkId, dhcpInfoInternal);
+        mWifiConfigStore.setIpConfiguration(mLastNetworkId, dhcpInfoInternal);
         InetAddress addr = NetworkUtils.numericToInetAddress(dhcpInfoInternal.ipAddress);
         mWifiInfo.setInetAddress(addr);
         if (getNetworkDetailedState() == DetailedState.CONNECTED) {
             //DHCP renewal in connected state
             LinkProperties linkProperties = dhcpInfoInternal.makeLinkProperties();
-            linkProperties.setHttpProxy(WifiConfigStore.getProxyProperties(mLastNetworkId));
+            linkProperties.setHttpProxy(mWifiConfigStore.getProxyProperties(mLastNetworkId));
             linkProperties.setInterfaceName(mInterfaceName);
             if (!linkProperties.equals(mLinkProperties)) {
                 if (DBG) {
@@ -1733,7 +1739,7 @@
         } else {
             configureLinkProperties();
             setNetworkDetailedState(DetailedState.CONNECTED);
-            WifiConfigStore.updateStatus(mLastNetworkId, DetailedState.CONNECTED);
+            mWifiConfigStore.updateStatus(mLastNetworkId, DetailedState.CONNECTED);
             sendNetworkStateChangeBroadcast(mLastBssid);
         }
     }
@@ -1749,7 +1755,7 @@
         if (++mReconnectCount > getMaxDhcpRetries()) {
             loge("Failed " +
                     mReconnectCount + " times, Disabling " + mLastNetworkId);
-            WifiConfigStore.disableNetwork(mLastNetworkId,
+            mWifiConfigStore.disableNetwork(mLastNetworkId,
                     WifiConfiguration.DISABLED_DHCP_FAILURE);
             mReconnectCount = 0;
         }
@@ -1757,8 +1763,8 @@
         /* DHCP times out after about 30 seconds, we do a
          * disconnect and an immediate reconnect to try again
          */
-        WifiNative.disconnect();
-        WifiNative.reconnect();
+        mWifiNative.disconnect();
+        mWifiNative.reconnect();
     }
 
     /* Current design is to not set the config on a running hostapd but instead
@@ -1826,7 +1832,7 @@
                     break;
                 case CMD_GET_CONFIGURED_NETWORKS:
                     mReplyChannel.replyToMessage(message, message.what,
-                            WifiConfigStore.getConfiguredNetworks());
+                            mWifiConfigStore.getConfiguredNetworks());
                     break;
                 case CMD_ENABLE_RSSI_POLL:
                     mEnableRssiPolling = (message.arg1 == 1);
@@ -1913,7 +1919,7 @@
             // 50021 wifi_state_changed (custom|1|5)
             EventLog.writeEvent(EVENTLOG_WIFI_STATE_CHANGED, getName());
 
-            if (WifiNative.isDriverLoaded()) {
+            if (mWifiNative.isDriverLoaded()) {
                 transitionTo(mDriverLoadedState);
             }
             else {
@@ -1966,7 +1972,7 @@
                             break;
                     }
 
-                    if(WifiNative.loadDriver()) {
+                    if(mWifiNative.loadDriver()) {
                         if (DBG) log("Driver load successful");
                         sendMessage(CMD_LOAD_DRIVER_SUCCESS);
                     } else {
@@ -2054,7 +2060,7 @@
                         loge("Unable to change interface settings: " + ie);
                     }
 
-                    if(WifiNative.startSupplicant()) {
+                    if(mWifiNative.startSupplicant()) {
                         if (DBG) log("Supplicant start successful");
                         mWifiMonitor.startMonitoring();
                         transitionTo(mSupplicantStartingState);
@@ -2086,7 +2092,7 @@
                 public void run() {
                     if (DBG) log(getName() + message.toString() + "\n");
                     mWakeLock.acquire();
-                    if(WifiNative.unloadDriver()) {
+                    if(mWifiNative.unloadDriver()) {
                         if (DBG) log("Driver unload successful");
                         sendMessage(CMD_UNLOAD_DRIVER_SUCCESS);
 
@@ -2217,9 +2223,9 @@
                     mLastNetworkId = WifiConfiguration.INVALID_NETWORK_ID;
                     mLastSignalLevel = -1;
 
-                    mWifiInfo.setMacAddress(WifiNative.getMacAddress());
+                    mWifiInfo.setMacAddress(mWifiNative.getMacAddress());
 
-                    WifiConfigStore.initialize(mContext);
+                    mWifiConfigStore.initialize();
 
                     sendSupplicantConnectionChangedBroadcast(true);
                     transitionTo(mDriverStartedState);
@@ -2227,7 +2233,7 @@
                 case WifiMonitor.SUP_DISCONNECTION_EVENT:
                     if (++mSupplicantRestartCount <= SUPPLICANT_RESTART_TRIES) {
                         loge("Failed to setup control channel, restart supplicant");
-                        WifiNative.killSupplicant();
+                        mWifiNative.killSupplicant();
                         transitionTo(mDriverLoadedState);
                         sendMessageDelayed(CMD_START_SUPPLICANT, SUPPLICANT_RESTART_INTERVAL_MSECS);
                     } else {
@@ -2276,7 +2282,7 @@
             long supplicantScanIntervalMs = Settings.Secure.getLong(mContext.getContentResolver(),
                     Settings.Secure.WIFI_SUPPLICANT_SCAN_INTERVAL_MS,
                     mDefaultSupplicantScanIntervalMs);
-            WifiNative.setScanInterval((int)supplicantScanIntervalMs / 1000);
+            mWifiNative.setScanInterval((int)supplicantScanIntervalMs / 1000);
         }
         @Override
         public boolean processMessage(Message message) {
@@ -2289,8 +2295,8 @@
                     break;
                 case WifiMonitor.SUP_DISCONNECTION_EVENT:  /* Supplicant connection lost */
                     loge("Connection lost, restart supplicant");
-                    WifiNative.killSupplicant();
-                    WifiNative.closeSupplicantConnection();
+                    mWifiNative.killSupplicant();
+                    mWifiNative.closeSupplicantConnection();
                     mNetworkInfo.setIsAvailable(false);
                     handleNetworkDisconnect();
                     sendSupplicantConnectionChangedBroadcast(false);
@@ -2301,46 +2307,46 @@
                     break;
                 case WifiMonitor.SCAN_RESULTS_EVENT:
                     eventLoggingEnabled = false;
-                    setScanResults(WifiNative.scanResults());
+                    setScanResults(mWifiNative.scanResults());
                     sendScanResultsAvailableBroadcast();
                     mScanResultIsPending = false;
                     break;
                 case CMD_PING_SUPPLICANT:
-                    boolean ok = WifiNative.ping();
+                    boolean ok = mWifiNative.ping();
                     mReplyChannel.replyToMessage(message, message.what, ok ? SUCCESS : FAILURE);
                     break;
                 case CMD_ADD_OR_UPDATE_NETWORK:
                     config = (WifiConfiguration) message.obj;
                     mReplyChannel.replyToMessage(message, CMD_ADD_OR_UPDATE_NETWORK,
-                            WifiConfigStore.addOrUpdateNetwork(config));
+                            mWifiConfigStore.addOrUpdateNetwork(config));
                     break;
                 case CMD_REMOVE_NETWORK:
-                    ok = WifiConfigStore.removeNetwork(message.arg1);
+                    ok = mWifiConfigStore.removeNetwork(message.arg1);
                     mReplyChannel.replyToMessage(message, message.what, ok ? SUCCESS : FAILURE);
                     break;
                 case CMD_ENABLE_NETWORK:
-                    ok = WifiConfigStore.enableNetwork(message.arg1, message.arg2 == 1);
+                    ok = mWifiConfigStore.enableNetwork(message.arg1, message.arg2 == 1);
                     mReplyChannel.replyToMessage(message, message.what, ok ? SUCCESS : FAILURE);
                     break;
                 case CMD_ENABLE_ALL_NETWORKS:
                     long time =  android.os.SystemClock.elapsedRealtime();
                     if (time - mLastEnableAllNetworksTime > MIN_INTERVAL_ENABLE_ALL_NETWORKS_MS) {
-                        WifiConfigStore.enableAllNetworks();
+                        mWifiConfigStore.enableAllNetworks();
                         mLastEnableAllNetworksTime = time;
                     }
                     break;
                 case CMD_DISABLE_NETWORK:
-                    ok = WifiConfigStore.disableNetwork(message.arg1, message.arg2);
+                    ok = mWifiConfigStore.disableNetwork(message.arg1, message.arg2);
                     mReplyChannel.replyToMessage(message, message.what, ok ? SUCCESS : FAILURE);
                     break;
                 case CMD_BLACKLIST_NETWORK:
-                    WifiNative.addToBlacklist((String)message.obj);
+                    mWifiNative.addToBlacklist((String)message.obj);
                     break;
                 case CMD_CLEAR_BLACKLIST:
-                    WifiNative.clearBlacklist();
+                    mWifiNative.clearBlacklist();
                     break;
                 case CMD_SAVE_CONFIG:
-                    ok = WifiConfigStore.saveConfig();
+                    ok = mWifiConfigStore.saveConfig();
                     mReplyChannel.replyToMessage(message, CMD_SAVE_CONFIG, ok ? SUCCESS : FAILURE);
 
                     // Inform the backup manager about a data change
@@ -2364,10 +2370,10 @@
                     break;
                 case CMD_SAVE_NETWORK:
                     config = (WifiConfiguration) message.obj;
-                    WifiConfigStore.saveNetwork(config);
+                    mWifiConfigStore.saveNetwork(config);
                     break;
                 case CMD_FORGET_NETWORK:
-                    WifiConfigStore.forgetNetwork(message.arg1);
+                    mWifiConfigStore.forgetNetwork(message.arg1);
                     break;
                 default:
                     return NOT_HANDLED;
@@ -2390,7 +2396,7 @@
             if (DBG) log(getName() + "\n");
             EventLog.writeEvent(EVENTLOG_WIFI_STATE_CHANGED, getName());
             if (DBG) log("stopping supplicant");
-            if (!WifiNative.stopSupplicant()) {
+            if (!mWifiNative.stopSupplicant()) {
                 loge("Failed to stop supplicant");
             }
 
@@ -2417,15 +2423,15 @@
                     /* Socket connection can be lost when we do a graceful shutdown
                      * or when the driver is hung. Ensure supplicant is stopped here.
                      */
-                    WifiNative.killSupplicant();
-                    WifiNative.closeSupplicantConnection();
+                    mWifiNative.killSupplicant();
+                    mWifiNative.closeSupplicantConnection();
                     transitionTo(mDriverLoadedState);
                     break;
                 case CMD_STOP_SUPPLICANT_FAILED:
                     if (message.arg1 == mSupplicantStopFailureToken) {
                         loge("Timed out on a supplicant stop, kill and proceed");
-                        WifiNative.killSupplicant();
-                        WifiNative.closeSupplicantConnection();
+                        mWifiNative.killSupplicant();
+                        mWifiNative.closeSupplicantConnection();
                         transitionTo(mDriverLoadedState);
                     }
                     break;
@@ -2516,7 +2522,7 @@
              * When this mode is on, some of the low-level scan parameters used by the
              * driver are changed to reduce interference with bluetooth
              */
-            WifiNative.setBluetoothCoexistenceScanMode(mBluetoothConnectionActive);
+            mWifiNative.setBluetoothCoexistenceScanMode(mBluetoothConnectionActive);
             /* set country code */
             setCountryCode();
             /* set frequency band of operation */
@@ -2525,22 +2531,26 @@
             setNetworkDetailedState(DetailedState.DISCONNECTED);
 
             /* Remove any filtering on Multicast v6 at start */
-            WifiNative.stopFilteringMulticastV6Packets();
+            mWifiNative.stopFilteringMulticastV6Packets();
 
             /* Reset Multicast v4 filtering state */
             if (mFilteringMulticastV4Packets.get()) {
-                WifiNative.startFilteringMulticastV4Packets();
+                mWifiNative.startFilteringMulticastV4Packets();
             } else {
-                WifiNative.stopFilteringMulticastV4Packets();
+                mWifiNative.stopFilteringMulticastV4Packets();
             }
 
             if (mIsScanMode) {
-                WifiNative.setScanResultHandling(SCAN_ONLY_MODE);
-                WifiNative.disconnect();
+                mWifiNative.setScanResultHandling(SCAN_ONLY_MODE);
+                mWifiNative.disconnect();
                 transitionTo(mScanModeState);
             } else {
-                WifiNative.setScanResultHandling(CONNECT_MODE);
-                WifiNative.reconnect();
+                mWifiNative.setScanResultHandling(CONNECT_MODE);
+                mWifiNative.reconnect();
+                // Status pulls in the current supplicant state and network connection state
+                // events over the monitor connection. This helps framework sync up with
+                // current supplicant state
+                mWifiNative.status();
                 transitionTo(mDisconnectedState);
             }
         }
@@ -2551,17 +2561,17 @@
             switch(message.what) {
                 case CMD_SET_SCAN_TYPE:
                     mSetScanActive = (message.arg1 == SCAN_ACTIVE);
-                    WifiNative.setScanMode(mSetScanActive);
+                    mWifiNative.setScanMode(mSetScanActive);
                     break;
                 case CMD_START_SCAN:
                     eventLoggingEnabled = false;
                     boolean forceActive = (message.arg1 == SCAN_ACTIVE);
                     if (forceActive && !mSetScanActive) {
-                        WifiNative.setScanMode(forceActive);
+                        mWifiNative.setScanMode(forceActive);
                     }
-                    WifiNative.scan();
+                    mWifiNative.scan();
                     if (forceActive && !mSetScanActive) {
-                        WifiNative.setScanMode(mSetScanActive);
+                        mWifiNative.setScanMode(mSetScanActive);
                     }
                     mScanResultIsPending = true;
                     break;
@@ -2571,14 +2581,14 @@
                 case CMD_SET_COUNTRY_CODE:
                     String country = (String) message.obj;
                     if (DBG) log("set country code " + country);
-                    if (!WifiNative.setCountryCode(country.toUpperCase())) {
+                    if (!mWifiNative.setCountryCode(country.toUpperCase())) {
                         loge("Failed to set country code " + country);
                     }
                     break;
                 case CMD_SET_FREQUENCY_BAND:
                     int band =  message.arg1;
                     if (DBG) log("set frequency band " + band);
-                    if (WifiNative.setBand(band)) {
+                    if (mWifiNative.setBand(band)) {
                         mFrequencyBand.set(band);
                         //Fetch the latest scan results when frequency band is set
                         startScan(true);
@@ -2589,7 +2599,7 @@
                 case CMD_BLUETOOTH_ADAPTER_STATE_CHANGE:
                     mBluetoothConnectionActive = (message.arg1 !=
                             BluetoothAdapter.STATE_DISCONNECTED);
-                    WifiNative.setBluetoothCoexistenceScanMode(mBluetoothConnectionActive);
+                    mWifiNative.setBluetoothCoexistenceScanMode(mBluetoothConnectionActive);
                     break;
                 case CMD_STOP_DRIVER:
                     int mode = message.arg1;
@@ -2622,28 +2632,28 @@
                 case CMD_DELAYED_STOP_DRIVER:
                     if (message.arg1 != mDelayedStopCounter) break;
                     if (getCurrentState() != mDisconnectedState) {
-                        WifiNative.disconnect();
+                        mWifiNative.disconnect();
                         handleNetworkDisconnect();
                     }
                     mWakeLock.acquire();
-                    WifiNative.stopDriver();
+                    mWifiNative.stopDriver();
                     transitionTo(mDriverStoppingState);
                     mWakeLock.release();
                     break;
                 case CMD_START_PACKET_FILTERING:
                     if (message.arg1 == MULTICAST_V6) {
-                        WifiNative.startFilteringMulticastV6Packets();
+                        mWifiNative.startFilteringMulticastV6Packets();
                     } else if (message.arg1 == MULTICAST_V4) {
-                        WifiNative.startFilteringMulticastV4Packets();
+                        mWifiNative.startFilteringMulticastV4Packets();
                     } else {
                         loge("Illegal arugments to CMD_START_PACKET_FILTERING");
                     }
                     break;
                 case CMD_STOP_PACKET_FILTERING:
                     if (message.arg1 == MULTICAST_V6) {
-                        WifiNative.stopFilteringMulticastV6Packets();
+                        mWifiNative.stopFilteringMulticastV6Packets();
                     } else if (message.arg1 == MULTICAST_V4) {
-                        WifiNative.stopFilteringMulticastV4Packets();
+                        mWifiNative.stopFilteringMulticastV4Packets();
                     } else {
                         loge("Illegal arugments to CMD_STOP_PACKET_FILTERING");
                     }
@@ -2725,7 +2735,7 @@
                     break;
                 case CMD_START_DRIVER:
                     mWakeLock.acquire();
-                    WifiNative.startDriver();
+                    mWifiNative.startDriver();
                     mWakeLock.release();
                     transitionTo(mDriverStartingState);
                     break;
@@ -2752,8 +2762,8 @@
                         /* Ignore */
                         return HANDLED;
                     } else {
-                        WifiNative.setScanResultHandling(message.arg1);
-                        WifiNative.reconnect();
+                        mWifiNative.setScanResultHandling(message.arg1);
+                        mWifiNative.reconnect();
                         mIsScanMode = false;
                         transitionTo(mDisconnectedState);
                     }
@@ -2820,13 +2830,13 @@
                     break;
                     /* Do a redundant disconnect without transition */
                 case CMD_DISCONNECT:
-                    WifiNative.disconnect();
+                    mWifiNative.disconnect();
                     break;
                 case CMD_RECONNECT:
-                    WifiNative.reconnect();
+                    mWifiNative.reconnect();
                     break;
                 case CMD_REASSOCIATE:
-                    WifiNative.reassociate();
+                    mWifiNative.reassociate();
                     break;
                 case CMD_CONNECT_NETWORK:
                     int netId = message.arg1;
@@ -2840,15 +2850,15 @@
                      * a connection to the enabled network.
                      */
                     if (config != null) {
-                        netId = WifiConfigStore.selectNetwork(config);
+                        netId = mWifiConfigStore.selectNetwork(config);
                     } else {
-                        WifiConfigStore.selectNetwork(netId);
+                        mWifiConfigStore.selectNetwork(netId);
                     }
 
                     /* The state tracker handles enabling networks upon completion/failure */
                     mSupplicantStateTracker.sendMessage(CMD_CONNECT_NETWORK);
 
-                    WifiNative.reconnect();
+                    mWifiNative.reconnect();
                     /* Expect a disconnection from the old connection */
                     transitionTo(mDisconnectingState);
                     break;
@@ -2858,7 +2868,7 @@
                     break;
                 case WifiMonitor.SCAN_RESULTS_EVENT:
                     /* Set the scan setting back to "connect" mode */
-                    WifiNative.setScanResultHandling(CONNECT_MODE);
+                    mWifiNative.setScanResultHandling(CONNECT_MODE);
                     /* Handle scan results */
                     return NOT_HANDLED;
                 case WifiMonitor.NETWORK_CONNECTION_EVENT:
@@ -2903,14 +2913,14 @@
                 loge("Failed to enable IPv6: " + e);
             }
 
-            if (!WifiConfigStore.isUsingStaticIp(mLastNetworkId)) {
+            if (!mWifiConfigStore.isUsingStaticIp(mLastNetworkId)) {
                 //start DHCP
                 mDhcpStateMachine = DhcpStateMachine.makeDhcpStateMachine(
                         mContext, WifiStateMachine.this, mInterfaceName);
                 mDhcpStateMachine.registerForPreDhcpNotification();
                 mDhcpStateMachine.sendMessage(DhcpStateMachine.CMD_START_DHCP);
             } else {
-                DhcpInfoInternal dhcpInfoInternal = WifiConfigStore.getIpConfiguration(
+                DhcpInfoInternal dhcpInfoInternal = mWifiConfigStore.getIpConfiguration(
                         mLastNetworkId);
                 InterfaceConfiguration ifcg = new InterfaceConfiguration();
                 ifcg.setLinkAddress(dhcpInfoInternal.makeLinkAddress());
@@ -2956,7 +2966,7 @@
                   transitionTo(mDisconnectingState);
                   break;
               case CMD_DISCONNECT:
-                  WifiNative.disconnect();
+                  mWifiNative.disconnect();
                   transitionTo(mDisconnectingState);
                   break;
                   /* Ignore connection to same network */
@@ -3023,7 +3033,7 @@
                   }
                   break;
                 case CMD_DISCONNECT:
-                    WifiNative.disconnect();
+                    mWifiNative.disconnect();
                     transitionTo(mDisconnectingState);
                     break;
                 case CMD_SET_SCAN_MODE:
@@ -3039,7 +3049,7 @@
                      * When scan results are received, the mode is switched
                      * back to CONNECT_MODE.
                      */
-                    WifiNative.setScanResultHandling(SCAN_ONLY_MODE);
+                    mWifiNative.setScanResultHandling(SCAN_ONLY_MODE);
                     /* Have the parent state handle the rest */
                     return NOT_HANDLED;
                     /* Ignore connection to same network */
@@ -3051,7 +3061,7 @@
                     return NOT_HANDLED;
                 case CMD_SAVE_NETWORK:
                     WifiConfiguration config = (WifiConfiguration) message.obj;
-                    NetworkUpdateResult result = WifiConfigStore.saveNetwork(config);
+                    NetworkUpdateResult result = mWifiConfigStore.saveNetwork(config);
                     if (mWifiInfo.getNetworkId() == result.getNetworkId()) {
                         if (result.hasIpChanged()) {
                             log("Reconfiguring IP on connection");
@@ -3107,7 +3117,7 @@
              * is in SCAN_ONLY_MODE. Restore CONNECT_MODE on exit
              */
             if (mScanResultIsPending) {
-                WifiNative.setScanResultHandling(CONNECT_MODE);
+                mWifiNative.setScanResultHandling(CONNECT_MODE);
             }
         }
     }
@@ -3188,7 +3198,7 @@
                  * cleared
                  */
                 if (!mScanResultIsPending) {
-                    WifiNative.enableBackgroundScan(true);
+                    mWifiNative.enableBackgroundScan(true);
                 }
             } else {
                 setScanAlarm(true);
@@ -3200,9 +3210,9 @@
             switch (message.what) {
                 case CMD_SET_SCAN_MODE:
                     if (message.arg1 == SCAN_ONLY_MODE) {
-                        WifiNative.setScanResultHandling(message.arg1);
+                        mWifiNative.setScanResultHandling(message.arg1);
                         //Supplicant disconnect to prevent further connects
-                        WifiNative.disconnect();
+                        mWifiNative.disconnect();
                         mIsScanMode = true;
                         transitionTo(mScanModeState);
                     }
@@ -3210,10 +3220,10 @@
                 case CMD_ENABLE_BACKGROUND_SCAN:
                     mEnableBackgroundScan = (message.arg1 == 1);
                     if (mEnableBackgroundScan) {
-                        WifiNative.enableBackgroundScan(true);
+                        mWifiNative.enableBackgroundScan(true);
                         setScanAlarm(false);
                     } else {
-                        WifiNative.enableBackgroundScan(false);
+                        mWifiNative.enableBackgroundScan(false);
                         setScanAlarm(true);
                     }
                     break;
@@ -3228,14 +3238,14 @@
                 case CMD_START_SCAN:
                     /* Disable background scan temporarily during a regular scan */
                     if (mEnableBackgroundScan) {
-                        WifiNative.enableBackgroundScan(false);
+                        mWifiNative.enableBackgroundScan(false);
                     }
                     /* Handled in parent state */
                     return NOT_HANDLED;
                 case WifiMonitor.SCAN_RESULTS_EVENT:
                     /* Re-enable background scan when a pending scan result is received */
                     if (mEnableBackgroundScan && mScanResultIsPending) {
-                        WifiNative.enableBackgroundScan(true);
+                        mWifiNative.enableBackgroundScan(true);
                     }
                     /* Handled in parent state */
                     return NOT_HANDLED;
@@ -3250,7 +3260,7 @@
         public void exit() {
             /* No need for a background scan upon exit from a disconnected state */
             if (mEnableBackgroundScan) {
-                WifiNative.enableBackgroundScan(false);
+                mWifiNative.enableBackgroundScan(false);
             }
             setScanAlarm(false);
         }
diff --git a/wifi/java/android/net/wifi/WpsStateMachine.java b/wifi/java/android/net/wifi/WpsStateMachine.java
index c14a8db..441a3b0 100644
--- a/wifi/java/android/net/wifi/WpsStateMachine.java
+++ b/wifi/java/android/net/wifi/WpsStateMachine.java
@@ -52,6 +52,7 @@
     private static final boolean DBG = false;
 
     private WifiStateMachine mWifiStateMachine;
+    private WifiConfigStore mWifiConfigStore;
 
     private WpsInfo mWpsInfo;
 
@@ -62,11 +63,12 @@
     private State mInactiveState = new InactiveState();
     private State mActiveState = new ActiveState();
 
-    public WpsStateMachine(Context context, WifiStateMachine wsm, Handler target) {
-        super(TAG, target.getLooper());
+    public WpsStateMachine(Context context, WifiStateMachine wsm, WifiConfigStore wcs, Handler t) {
+        super(TAG, t.getLooper());
 
         mContext = context;
         mWifiStateMachine = wsm;
+        mWifiConfigStore = wcs;
         addState(mDefaultState);
             addState(mInactiveState, mDefaultState);
             addState(mActiveState, mDefaultState);
@@ -97,13 +99,13 @@
                     WpsResult result;
                     switch (mWpsInfo.setup) {
                         case WpsInfo.PBC:
-                            result = WifiConfigStore.startWpsPbc(mWpsInfo);
+                            result = mWifiConfigStore.startWpsPbc(mWpsInfo);
                             break;
                         case WpsInfo.KEYPAD:
-                            result = WifiConfigStore.startWpsWithPinFromAccessPoint(mWpsInfo);
+                            result = mWifiConfigStore.startWpsWithPinFromAccessPoint(mWpsInfo);
                             break;
                         case WpsInfo.DISPLAY:
-                            result = WifiConfigStore.startWpsWithPinFromDevice(mWpsInfo);
+                            result = mWifiConfigStore.startWpsWithPinFromDevice(mWpsInfo);
                             break;
                         default:
                             result = new WpsResult(Status.FAILURE);
@@ -151,9 +153,9 @@
                              * and the configuration list needs to be reloaded from the supplicant.
                              */
                             Log.d(TAG, "WPS set up successful");
-                            WifiConfigStore.enableAllNetworks();
-                            WifiConfigStore.loadConfiguredNetworks();
-                            WifiConfigStore.updateIpAndProxyFromWpsConfig(
+                            mWifiConfigStore.enableAllNetworks();
+                            mWifiConfigStore.loadConfiguredNetworks();
+                            mWifiConfigStore.updateIpAndProxyFromWpsConfig(
                                     stateChangeResult.networkId, mWpsInfo);
                             mWifiStateMachine.sendMessage(WifiStateMachine.WPS_COMPLETED_EVENT);
                             transitionTo(mInactiveState);
@@ -161,7 +163,7 @@
                         case INACTIVE:
                             /* A failed WPS connection */
                             Log.d(TAG, "WPS set up failed, enabling other networks");
-                            WifiConfigStore.enableAllNetworks();
+                            mWifiConfigStore.enableAllNetworks();
                             mWifiStateMachine.sendMessage(WifiStateMachine.WPS_COMPLETED_EVENT);
                             transitionTo(mInactiveState);
                             break;
diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pService.java b/wifi/java/android/net/wifi/p2p/WifiP2pService.java
index 1ad6336..69cbb5c 100644
--- a/wifi/java/android/net/wifi/p2p/WifiP2pService.java
+++ b/wifi/java/android/net/wifi/p2p/WifiP2pService.java
@@ -166,7 +166,8 @@
     public WifiP2pService(Context context) {
         mContext = context;
 
-        mInterface = SystemProperties.get("wifi.interface", "wlan0");
+        //STOPSHIP: fix this
+        mInterface = "p2p0";
         mNetworkInfo = new NetworkInfo(ConnectivityManager.TYPE_WIFI_P2P, 0, NETWORKTYPE, "");
 
         mP2pSupported = mContext.getPackageManager().hasSystemFeature(
@@ -278,7 +279,8 @@
         private GroupCreatedState mGroupCreatedState = new GroupCreatedState();
         private UserAuthorizingJoinState mUserAuthorizingJoinState = new UserAuthorizingJoinState();
 
-        private WifiMonitor mWifiMonitor = new WifiMonitor(this);
+        private WifiNative mWifiNative = new WifiNative(mInterface);
+        private WifiMonitor mWifiMonitor = new WifiMonitor(this, mWifiNative);
 
         private WifiP2pDeviceList mPeers = new WifiP2pDeviceList();
         private WifiP2pInfo mWifiP2pInfo = new WifiP2pInfo();
@@ -456,9 +458,9 @@
         public void enter() {
             if (DBG) logd(getName());
             logd("stopping supplicant");
-            if (!WifiNative.stopSupplicant()) {
+            if (!mWifiNative.stopSupplicant()) {
                 loge("Failed to stop supplicant, issue kill");
-                WifiNative.killSupplicant();
+                mWifiNative.killSupplicant();
             }
         }
 
@@ -468,7 +470,7 @@
             switch (message.what) {
                 case WifiMonitor.SUP_DISCONNECTION_EVENT:
                     logd("Supplicant connection lost");
-                    WifiNative.closeSupplicantConnection();
+                    mWifiNative.closeSupplicantConnection();
                     transitionTo(mP2pDisabledState);
                     break;
                 case WifiP2pManager.ENABLE_P2P:
@@ -594,7 +596,7 @@
                         if (DBG) Slog.w(TAG, "Unable to bring down wlan interface: " + e);
                     }
 
-                    if (WifiNative.startP2pSupplicant()) {
+                    if (mWifiNative.startP2pSupplicant()) {
                         mWifiMonitor.startMonitoring();
                         transitionTo(mP2pEnablingState);
                     } else {
@@ -630,7 +632,7 @@
                 case WifiMonitor.SUP_DISCONNECTION_EVENT:
                     if (++mP2pRestartCount <= P2P_RESTART_TRIES) {
                         loge("Failed to start p2p, retry");
-                        WifiNative.killSupplicant();
+                        mWifiNative.killSupplicant();
                         sendMessageDelayed(WifiP2pManager.ENABLE_P2P, P2P_RESTART_INTERVAL_MSECS);
                     } else {
                         loge("Failed " + mP2pRestartCount + " times to start p2p, quit ");
@@ -673,7 +675,7 @@
                     break;
                 case WifiP2pManager.DISCOVER_PEERS:
                     int timeout = message.arg1;
-                    if (WifiNative.p2pFind(timeout)) {
+                    if (mWifiNative.p2pFind(timeout)) {
                         replyToMessage(message, WifiP2pManager.DISCOVER_PEERS_SUCCEEDED);
                     } else {
                         replyToMessage(message, WifiP2pManager.DISCOVER_PEERS_FAILED,
@@ -692,8 +694,8 @@
                     break;
                case WifiMonitor.SUP_DISCONNECTION_EVENT:  /* Supplicant died */
                     loge("Connection lost, restart p2p");
-                    WifiNative.killSupplicant();
-                    WifiNative.closeSupplicantConnection();
+                    mWifiNative.killSupplicant();
+                    mWifiNative.closeSupplicantConnection();
                     if (mPeers.clear()) sendP2pPeersChangedBroadcast();
                     transitionTo(mP2pDisabledState);
                     sendMessageDelayed(WifiP2pManager.ENABLE_P2P, P2P_RESTART_INTERVAL_MSECS);
@@ -717,7 +719,7 @@
         public void enter() {
             if (DBG) logd(getName());
             //Start listening every time we get inactive
-            WifiNative.p2pListen();
+            mWifiNative.p2pListen();
         }
 
         @Override
@@ -727,13 +729,13 @@
                 case WifiP2pManager.CONNECT:
                     if (DBG) logd(getName() + " sending connect");
                     mSavedPeerConfig = (WifiP2pConfig) message.obj;
-                    String updatedPeerDetails = WifiNative.p2pPeer(mSavedPeerConfig.deviceAddress);
+                    String updatedPeerDetails = mWifiNative.p2pPeer(mSavedPeerConfig.deviceAddress);
                     mPeers.update(new WifiP2pDevice(updatedPeerDetails));
                     mPersistGroup = false;
                     int netId = configuredNetworkId(mSavedPeerConfig.deviceAddress);
                     if (netId >= 0) {
                         //TODO: if failure, remove config and do a regular p2pConnect()
-                        WifiNative.p2pReinvoke(netId, mSavedPeerConfig.deviceAddress);
+                        mWifiNative.p2pReinvoke(netId, mSavedPeerConfig.deviceAddress);
                     } else {
                         //If peer is a GO, we do not need to send provisional discovery,
                         //the supplicant takes care of it.
@@ -798,7 +800,7 @@
                     break;
                 case WifiP2pManager.CREATE_GROUP:
                     mPersistGroup = true;
-                    if (WifiNative.p2pGroupAdd()) {
+                    if (mWifiNative.p2pGroupAdd()) {
                         replyToMessage(message, WifiP2pManager.CREATE_GROUP_SUCCEEDED);
                     } else {
                         replyToMessage(message, WifiP2pManager.CREATE_GROUP_FAILED,
@@ -840,7 +842,7 @@
                             WifiP2pManager.BUSY);
                     break;
                 case WifiP2pManager.CANCEL_CONNECT:
-                    if (WifiNative.p2pCancelConnect()) {
+                    if (mWifiNative.p2pCancelConnect()) {
                         replyToMessage(message, WifiP2pManager.CANCEL_CONNECT_SUCCEEDED);
                     } else {
                         replyToMessage(message, WifiP2pManager.CANCEL_CONNECT_FAILED,
@@ -897,7 +899,7 @@
         @Override
         public void enter() {
             if (DBG) logd(getName());
-            WifiNative.p2pProvisionDiscovery(mSavedPeerConfig);
+            mWifiNative.p2pProvisionDiscovery(mSavedPeerConfig);
         }
 
         @Override
@@ -913,7 +915,7 @@
 
                     if (mSavedPeerConfig.wps.setup == WpsInfo.PBC) {
                         if (DBG) logd("Found a match " + mSavedPeerConfig);
-                        WifiNative.p2pConnect(mSavedPeerConfig, FORM_GROUP);
+                        mWifiNative.p2pConnect(mSavedPeerConfig, FORM_GROUP);
                         transitionTo(mGroupNegotiationState);
                     }
                     break;
@@ -926,7 +928,7 @@
                         if (DBG) logd("Found a match " + mSavedPeerConfig);
                         /* we already have the pin */
                         if (!TextUtils.isEmpty(mSavedPeerConfig.wps.pin)) {
-                            WifiNative.p2pConnect(mSavedPeerConfig, FORM_GROUP);
+                            mWifiNative.p2pConnect(mSavedPeerConfig, FORM_GROUP);
                             transitionTo(mGroupNegotiationState);
                         } else {
                             transitionTo(mUserAuthorizingInvitationState);
@@ -941,7 +943,7 @@
                     if (mSavedPeerConfig.wps.setup == WpsInfo.DISPLAY) {
                         if (DBG) logd("Found a match " + mSavedPeerConfig);
                         mSavedPeerConfig.wps.pin = provDisc.pin;
-                        WifiNative.p2pConnect(mSavedPeerConfig, FORM_GROUP);
+                        mWifiNative.p2pConnect(mSavedPeerConfig, FORM_GROUP);
                         notifyInvitationSent(provDisc.pin, device.deviceAddress);
                         transitionTo(mGroupNegotiationState);
                     }
@@ -1045,7 +1047,7 @@
                             if (DBG) logd("Removed client " + deviceAddress);
                             if (!mPersistGroup && mGroup.isClientListEmpty()) {
                                 Slog.d(TAG, "Client list empty, remove non-persistent p2p group");
-                                WifiNative.p2pGroupRemove(mGroup.getInterface());
+                                mWifiNative.p2pGroupRemove(mGroup.getInterface());
                             }
                         } else {
                             if (DBG) logd("Failed to remove client " + deviceAddress);
@@ -1067,12 +1069,12 @@
                         setWifiP2pInfoOnGroupFormation(dhcpInfo.serverAddress);
                         sendP2pConnectionChangedBroadcast();
                     } else {
-                        WifiNative.p2pGroupRemove(mGroup.getInterface());
+                        mWifiNative.p2pGroupRemove(mGroup.getInterface());
                     }
                     break;
                 case WifiP2pManager.REMOVE_GROUP:
                     if (DBG) loge(getName() + " remove group");
-                    if (WifiNative.p2pGroupRemove(mGroup.getInterface())) {
+                    if (mWifiNative.p2pGroupRemove(mGroup.getInterface())) {
                         replyToMessage(message, WifiP2pManager.REMOVE_GROUP_SUCCEEDED);
                     } else {
                         replyToMessage(message, WifiP2pManager.REMOVE_GROUP_FAILED,
@@ -1119,7 +1121,7 @@
                 case WifiP2pManager.CONNECT:
                     WifiP2pConfig config = (WifiP2pConfig) message.obj;
                     logd("Inviting device : " + config.deviceAddress);
-                    if (WifiNative.p2pInvite(mGroup, config.deviceAddress)) {
+                    if (mWifiNative.p2pInvite(mGroup, config.deviceAddress)) {
                         updateDeviceStatus(config.deviceAddress, WifiP2pDevice.INVITED);
                         sendP2pPeersChangedBroadcast();
                         replyToMessage(message, WifiP2pManager.CONNECT_SUCCEEDED);
@@ -1180,9 +1182,9 @@
                     break;
                 case PEER_CONNECTION_USER_ACCEPT:
                     if (mSavedPeerConfig.wps.setup == WpsInfo.PBC) {
-                        WifiNative.startWpsPbc();
+                        mWifiNative.startWpsPbc();
                     } else {
-                        WifiNative.startWpsPinKeypad(mSavedPeerConfig.wps.pin);
+                        mWifiNative.startWpsPinKeypad(mSavedPeerConfig.wps.pin);
                     }
                     mSavedPeerConfig = null;
                     transitionTo(mGroupCreatedState);
@@ -1422,7 +1424,7 @@
     }
 
     private void p2pConnectWithPinDisplay(WifiP2pConfig config, boolean join) {
-        String pin = WifiNative.p2pConnect(config, join);
+        String pin = mWifiNative.p2pConnect(config, join);
         try {
             Integer.parseInt(pin);
             notifyInvitationSent(pin, config.deviceAddress);
@@ -1432,16 +1434,16 @@
     }
 
     private void initializeP2pSettings() {
-        WifiNative.setPersistentReconnect(true);
-        WifiNative.setDeviceName(mThisDevice.deviceName);
+        mWifiNative.setPersistentReconnect(true);
+        mWifiNative.setDeviceName(mThisDevice.deviceName);
         //DIRECT-XY-DEVICENAME (XY is randomly generated)
-        WifiNative.setP2pSsidPostfix("-" + mThisDevice.deviceName);
-        WifiNative.setDeviceType(mThisDevice.primaryDeviceType);
+        mWifiNative.setP2pSsidPostfix("-" + mThisDevice.deviceName);
+        mWifiNative.setDeviceType(mThisDevice.primaryDeviceType);
         //The supplicant default is to support everything, but a bug necessitates
         //the framework to specify this explicitly
-        WifiNative.setConfigMethods("keypad display push_button");
+        mWifiNative.setConfigMethods("keypad display push_button");
 
-        mThisDevice.deviceAddress = WifiNative.p2pGetDeviceAddress();
+        mThisDevice.deviceAddress = mWifiNative.p2pGetDeviceAddress();
         updateThisDevice(WifiP2pDevice.AVAILABLE);
         if (DBG) Slog.d(TAG, "DeviceAddress: " + mThisDevice.deviceAddress);
     }