Merge "pseudo random number generator in shader with limited precisions" into jb-dev
diff --git a/Android.mk b/Android.mk
index 678ae55..eef900a 100644
--- a/Android.mk
+++ b/Android.mk
@@ -94,7 +94,6 @@
 	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 \
@@ -126,6 +125,7 @@
 	core/java/android/nfc/INfcAdapter.aidl \
 	core/java/android/nfc/INfcAdapterExtras.aidl \
 	core/java/android/nfc/INfcTag.aidl \
+	core/java/android/os/ICancellationSignal.aidl \
 	core/java/android/os/IHardwareService.aidl \
 	core/java/android/os/IMessenger.aidl \
 	core/java/android/os/INetworkManagementService.aidl \
diff --git a/api/current.txt b/api/current.txt
index dfe439e..b10c107 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -315,7 +315,6 @@
     field public static final int cacheColorHint = 16843009; // 0x1010101
     field public static final int calendarViewShown = 16843596; // 0x101034c
     field public static final int calendarViewStyle = 16843613; // 0x101035d
-    field public static final int canHandleGestures = 16843691; // 0x10103ab
     field public static final int canRetrieveWindowContent = 16843653; // 0x1010385
     field public static final int candidatesTextStyleSpans = 16843312; // 0x1010230
     field public static final deprecated int capitalize = 16843113; // 0x1010169
@@ -754,7 +753,7 @@
     field public static final int pathPrefix = 16842795; // 0x101002b
     field public static final int permission = 16842758; // 0x1010006
     field public static final int permissionGroup = 16842762; // 0x101000a
-    field public static final int permissionGroupFlags = 16843692; // 0x10103ac
+    field public static final int permissionGroupFlags = 16843691; // 0x10103ab
     field public static final int persistent = 16842765; // 0x101000d
     field public static final int persistentDrawingCache = 16842990; // 0x10100ee
     field public static final deprecated int phoneNumber = 16843111; // 0x1010167
@@ -2033,8 +2032,6 @@
     field public static final int GESTURE_SWIPE_UP_AND_DOWN = 7; // 0x7
     field public static final int GESTURE_SWIPE_UP_AND_LEFT = 13; // 0xd
     field public static final int GESTURE_SWIPE_UP_AND_RIGHT = 14; // 0xe
-    field public static final int GESTURE_TWO_FINGER_LONG_PRESS = 18; // 0x12
-    field public static final int GESTURE_TWO_FINGER_TAP = 17; // 0x11
     field public static final int GLOBAL_ACTION_BACK = 1; // 0x1
     field public static final int GLOBAL_ACTION_HOME = 2; // 0x2
     field public static final int GLOBAL_ACTION_NOTIFICATIONS = 4; // 0x4
@@ -2048,7 +2045,6 @@
     method public int describeContents();
     method public static java.lang.String feedbackTypeToString(int);
     method public static java.lang.String flagToString(int);
-    method public boolean getCanHandleGestures();
     method public boolean getCanRetrieveWindowContent();
     method public deprecated java.lang.String getDescription();
     method public java.lang.String getId();
@@ -2064,7 +2060,8 @@
     field public static final int FEEDBACK_HAPTIC = 2; // 0x2
     field public static final int FEEDBACK_SPOKEN = 1; // 0x1
     field public static final int FEEDBACK_VISUAL = 8; // 0x8
-    field public static final int INCLUDE_NOT_IMPORTANT_VIEWS = 2; // 0x2
+    field public static final int FLAG_INCLUDE_NOT_IMPORTANT_VIEWS = 2; // 0x2
+    field public static final int FLAG_REQUEST_TOUCH_EXPLORATION_MODE = 4; // 0x4
     field public int eventTypes;
     field public int feedbackType;
     field public int flags;
@@ -2823,6 +2820,7 @@
     field public long availMem;
     field public boolean lowMemory;
     field public long threshold;
+    field public long totalMem;
   }
 
   public static class ActivityManager.ProcessErrorStateInfo implements android.os.Parcelable {
@@ -4909,18 +4907,6 @@
     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);
@@ -5051,7 +5037,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 public android.database.Cursor query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, android.os.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);
@@ -5075,7 +5061,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 android.database.Cursor query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, android.os.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;
   }
@@ -5133,6 +5119,8 @@
     ctor public ContentResolver(android.content.Context);
     method public final android.content.ContentProviderClient acquireContentProviderClient(android.net.Uri);
     method public final android.content.ContentProviderClient acquireContentProviderClient(java.lang.String);
+    method public final android.content.ContentProviderClient acquireUnstableContentProviderClient(android.net.Uri);
+    method public final android.content.ContentProviderClient acquireUnstableContentProviderClient(java.lang.String);
     method public static void addPeriodicSync(android.accounts.Account, java.lang.String, android.os.Bundle, long);
     method public static java.lang.Object addStatusChangeListener(int, android.content.SyncStatusObserver);
     method public android.content.ContentProviderResult[] applyBatch(java.lang.String, java.util.ArrayList<android.content.ContentProviderOperation>) throws android.content.OperationApplicationException, android.os.RemoteException;
@@ -5162,7 +5150,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 android.database.Cursor query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, android.os.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);
@@ -6039,11 +6027,6 @@
     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();
@@ -7033,9 +7016,9 @@
     method public void unregisterDataSetObserver(android.database.DataSetObserver);
     field protected boolean mClosed;
     field protected android.content.ContentResolver mContentResolver;
-    field protected java.lang.Long mCurrentRowID;
+    field protected deprecated java.lang.Long mCurrentRowID;
     field protected int mPos;
-    field protected int mRowIdColumnIndex;
+    field protected deprecated int mRowIdColumnIndex;
     field protected deprecated java.util.HashMap mUpdatedRows;
   }
 
@@ -7503,15 +7486,15 @@
     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(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.os.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 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.os.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 rawQuery(java.lang.String, java.lang.String[], android.os.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 android.database.Cursor rawQueryWithFactory(android.database.sqlite.SQLiteDatabase.CursorFactory, java.lang.String, java.lang.String[], java.lang.String, android.os.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;
@@ -7637,7 +7620,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 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.os.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>);
@@ -11253,7 +11236,6 @@
     method public void unselectTrack(int);
     field public static final int SAMPLE_FLAG_ENCRYPTED = 2; // 0x2
     field public static final int SAMPLE_FLAG_SYNC = 1; // 0x1
-    field public static final int SEEK_TO_CLOSEST = 3; // 0x3
     field public static final int SEEK_TO_CLOSEST_SYNC = 2; // 0x2
     field public static final int SEEK_TO_NEXT_SYNC = 1; // 0x1
     field public static final int SEEK_TO_PREVIOUS_SYNC = 0; // 0x0
@@ -11280,6 +11262,7 @@
     field public static final java.lang.String KEY_CHANNEL_MASK = "channel-mask";
     field public static final java.lang.String KEY_COLOR_FORMAT = "color-format";
     field public static final java.lang.String KEY_DURATION = "durationUs";
+    field public static final java.lang.String KEY_FLAC_COMPRESSION_LEVEL = "flac-compression-level";
     field public static final java.lang.String KEY_FRAME_RATE = "frame-rate";
     field public static final java.lang.String KEY_HEIGHT = "height";
     field public static final java.lang.String KEY_IS_ADTS = "is-adts";
@@ -12726,8 +12709,45 @@
 
 package android.net.nsd {
 
-  public class DnsSdServiceInfo implements android.os.Parcelable {
-    ctor public DnsSdServiceInfo();
+  public final class NsdManager {
+    method public void discoverServices(java.lang.String, int, android.net.nsd.NsdManager.DiscoveryListener);
+    method public void registerService(android.net.nsd.NsdServiceInfo, int, android.net.nsd.NsdManager.RegistrationListener);
+    method public void resolveService(android.net.nsd.NsdServiceInfo, android.net.nsd.NsdManager.ResolveListener);
+    method public void stopServiceDiscovery(android.net.nsd.NsdManager.DiscoveryListener);
+    method public void unregisterService(android.net.nsd.NsdManager.RegistrationListener);
+    field public static final java.lang.String ACTION_NSD_STATE_CHANGED = "android.net.nsd.STATE_CHANGED";
+    field public static final java.lang.String EXTRA_NSD_STATE = "nsd_state";
+    field public static final int FAILURE_ALREADY_ACTIVE = 3; // 0x3
+    field public static final int FAILURE_INTERNAL_ERROR = 0; // 0x0
+    field public static final int FAILURE_MAX_LIMIT = 4; // 0x4
+    field public static final int NSD_STATE_DISABLED = 1; // 0x1
+    field public static final int NSD_STATE_ENABLED = 2; // 0x2
+    field public static final int PROTOCOL_DNS_SD = 1; // 0x1
+  }
+
+  public static abstract interface NsdManager.DiscoveryListener {
+    method public abstract void onDiscoveryStarted(java.lang.String);
+    method public abstract void onDiscoveryStopped(java.lang.String);
+    method public abstract void onServiceFound(android.net.nsd.NsdServiceInfo);
+    method public abstract void onServiceLost(android.net.nsd.NsdServiceInfo);
+    method public abstract void onStartDiscoveryFailed(java.lang.String, int);
+    method public abstract void onStopDiscoveryFailed(java.lang.String, int);
+  }
+
+  public static abstract interface NsdManager.RegistrationListener {
+    method public abstract void onRegistrationFailed(android.net.nsd.NsdServiceInfo, int);
+    method public abstract void onServiceRegistered(android.net.nsd.NsdServiceInfo);
+    method public abstract void onServiceUnregistered(android.net.nsd.NsdServiceInfo);
+    method public abstract void onUnregistrationFailed(android.net.nsd.NsdServiceInfo, int);
+  }
+
+  public static abstract interface NsdManager.ResolveListener {
+    method public abstract void onResolveFailed(android.net.nsd.NsdServiceInfo, int);
+    method public abstract void onServiceResolved(android.net.nsd.NsdServiceInfo);
+  }
+
+  public final class NsdServiceInfo implements android.os.Parcelable {
+    ctor public NsdServiceInfo();
     method public int describeContents();
     method public java.net.InetAddress getHost();
     method public int getPort();
@@ -12741,71 +12761,6 @@
     field public static final android.os.Parcelable.Creator CREATOR;
   }
 
-  public class DnsSdTxtRecord implements android.os.Parcelable {
-    ctor public DnsSdTxtRecord();
-    ctor public DnsSdTxtRecord(byte[]);
-    ctor public DnsSdTxtRecord(android.net.nsd.DnsSdTxtRecord);
-    method public boolean contains(java.lang.String);
-    method public int describeContents();
-    method public java.lang.String get(java.lang.String);
-    method public byte[] getRawData();
-    method public int keyCount();
-    method public int remove(java.lang.String);
-    method public void set(java.lang.String, java.lang.String);
-    method public int size();
-    method public void writeToParcel(android.os.Parcel, int);
-    field public static final android.os.Parcelable.Creator CREATOR;
-  }
-
-  public class NsdManager {
-    method public void deinitialize(android.net.nsd.NsdManager.Channel);
-    method public void discoverServices(android.net.nsd.NsdManager.Channel, java.lang.String, android.net.nsd.NsdManager.DnsSdDiscoveryListener);
-    method public void initialize(android.content.Context, android.os.Looper, android.net.nsd.NsdManager.ChannelListener);
-    method public void registerService(android.net.nsd.NsdManager.Channel, java.lang.String, java.lang.String, int, android.net.nsd.NsdManager.DnsSdRegisterListener);
-    method public void resolveService(android.net.nsd.NsdManager.Channel, java.lang.String, java.lang.String, android.net.nsd.NsdManager.DnsSdResolveListener);
-    method public void stopServiceDiscovery(android.net.nsd.NsdManager.Channel, android.net.nsd.NsdManager.ActionListener);
-    method public void unregisterService(android.net.nsd.NsdManager.Channel, int, android.net.nsd.NsdManager.ActionListener);
-    field public static final java.lang.String ACTION_NSD_STATE_CHANGED = "android.net.nsd.STATE_CHANGED";
-    field public static final int ALREADY_ACTIVE = 3; // 0x3
-    field public static final int BUSY = 2; // 0x2
-    field public static final int ERROR = 0; // 0x0
-    field public static final java.lang.String EXTRA_NSD_STATE = "nsd_state";
-    field public static final int MAX_REGS_REACHED = 4; // 0x4
-    field public static final int NSD_STATE_DISABLED = 1; // 0x1
-    field public static final int NSD_STATE_ENABLED = 2; // 0x2
-    field public static final int UNSUPPORTED = 1; // 0x1
-  }
-
-  public static abstract interface NsdManager.ActionListener {
-    method public abstract void onFailure(int);
-    method public abstract void onSuccess();
-  }
-
-  public static class NsdManager.Channel {
-  }
-
-  public static abstract interface NsdManager.ChannelListener {
-    method public abstract void onChannelConnected(android.net.nsd.NsdManager.Channel);
-    method public abstract void onChannelDisconnected();
-  }
-
-  public static abstract interface NsdManager.DnsSdDiscoveryListener {
-    method public abstract void onFailure(int);
-    method public abstract void onServiceFound(android.net.nsd.DnsSdServiceInfo);
-    method public abstract void onServiceLost(android.net.nsd.DnsSdServiceInfo);
-    method public abstract void onStarted(java.lang.String);
-  }
-
-  public static abstract interface NsdManager.DnsSdRegisterListener {
-    method public abstract void onFailure(int);
-    method public abstract void onServiceRegistered(int, android.net.nsd.DnsSdServiceInfo);
-  }
-
-  public static abstract interface NsdManager.DnsSdResolveListener {
-    method public abstract void onFailure(int);
-    method public abstract void onServiceResolved(android.net.nsd.DnsSdServiceInfo);
-  }
-
 }
 
 package android.net.rtp {
@@ -13375,7 +13330,7 @@
   }
 
   public static abstract interface WifiP2pManager.DnsSdTxtRecordListener {
-    method public abstract void onDnsSdTxtRecordAvailable(java.lang.String, android.net.nsd.DnsSdTxtRecord, android.net.wifi.p2p.WifiP2pDevice);
+    method public abstract void onDnsSdTxtRecordAvailable(java.lang.String, java.util.Map<java.lang.String, java.lang.String>, android.net.wifi.p2p.WifiP2pDevice);
   }
 
   public static abstract interface WifiP2pManager.GroupInfoListener {
@@ -13399,7 +13354,7 @@
 package android.net.wifi.p2p.nsd {
 
   public class WifiP2pDnsSdServiceInfo extends android.net.wifi.p2p.nsd.WifiP2pServiceInfo {
-    method public static android.net.wifi.p2p.nsd.WifiP2pDnsSdServiceInfo newInstance(java.lang.String, java.lang.String, android.net.nsd.DnsSdTxtRecord);
+    method public static android.net.wifi.p2p.nsd.WifiP2pDnsSdServiceInfo newInstance(java.lang.String, java.lang.String, java.util.Map<java.lang.String, java.lang.String>);
   }
 
   public class WifiP2pDnsSdServiceRequest extends android.net.wifi.p2p.nsd.WifiP2pServiceRequest {
@@ -15364,6 +15319,18 @@
     field public static final android.os.Bundle EMPTY;
   }
 
+  public final class CancellationSignal {
+    ctor public CancellationSignal();
+    method public void cancel();
+    method public boolean isCanceled();
+    method public void setOnCancelListener(android.os.CancellationSignal.OnCancelListener);
+    method public void throwIfCanceled();
+  }
+
+  public static abstract interface CancellationSignal.OnCancelListener {
+    method public abstract void onCancel();
+  }
+
   public class ConditionVariable {
     ctor public ConditionVariable();
     ctor public ConditionVariable(boolean);
@@ -15728,6 +15695,11 @@
     ctor public NetworkOnMainThreadException();
   }
 
+  public class OperationCanceledException extends java.lang.RuntimeException {
+    ctor public OperationCanceledException();
+    ctor public OperationCanceledException(java.lang.String);
+  }
+
   public final class Parcel {
     method public final void appendFrom(android.os.Parcel, int, int);
     method public final android.os.IBinder[] createBinderArray();
@@ -18423,7 +18395,6 @@
     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
@@ -18585,95 +18556,104 @@
 
 package android.renderscript {
 
-  public deprecated class Allocation extends android.renderscript.BaseObj {
-    method public deprecated void copy1DRangeFrom(int, int, int[]);
-    method public deprecated void copy1DRangeFrom(int, int, short[]);
-    method public deprecated void copy1DRangeFrom(int, int, byte[]);
-    method public deprecated void copy1DRangeFrom(int, int, float[]);
-    method public deprecated void copy1DRangeFrom(int, int, android.renderscript.Allocation, int);
-    method public deprecated void copy1DRangeFromUnchecked(int, int, int[]);
-    method public deprecated void copy1DRangeFromUnchecked(int, int, short[]);
-    method public deprecated void copy1DRangeFromUnchecked(int, int, byte[]);
-    method public deprecated void copy1DRangeFromUnchecked(int, int, float[]);
-    method public deprecated void copy2DRangeFrom(int, int, int, int, byte[]);
-    method public deprecated void copy2DRangeFrom(int, int, int, int, short[]);
-    method public deprecated void copy2DRangeFrom(int, int, int, int, int[]);
-    method public deprecated void copy2DRangeFrom(int, int, int, int, float[]);
-    method public deprecated void copy2DRangeFrom(int, int, int, int, android.renderscript.Allocation, int, int);
-    method public deprecated void copy2DRangeFrom(int, int, android.graphics.Bitmap);
-    method public deprecated void copyFrom(android.renderscript.BaseObj[]);
-    method public deprecated void copyFrom(int[]);
-    method public deprecated void copyFrom(short[]);
-    method public deprecated void copyFrom(byte[]);
-    method public deprecated void copyFrom(float[]);
-    method public deprecated void copyFrom(android.graphics.Bitmap);
-    method public deprecated void copyFromUnchecked(int[]);
-    method public deprecated void copyFromUnchecked(short[]);
-    method public deprecated void copyFromUnchecked(byte[]);
-    method public deprecated void copyFromUnchecked(float[]);
-    method public deprecated void copyTo(android.graphics.Bitmap);
-    method public deprecated void copyTo(byte[]);
-    method public deprecated void copyTo(short[]);
-    method public deprecated void copyTo(int[]);
-    method public deprecated void copyTo(float[]);
-    method public static deprecated android.renderscript.Allocation createCubemapFromBitmap(android.renderscript.RenderScript, android.graphics.Bitmap, android.renderscript.Allocation.MipmapControl, int);
-    method public static deprecated android.renderscript.Allocation createCubemapFromBitmap(android.renderscript.RenderScript, android.graphics.Bitmap);
-    method public static deprecated android.renderscript.Allocation createCubemapFromCubeFaces(android.renderscript.RenderScript, android.graphics.Bitmap, android.graphics.Bitmap, android.graphics.Bitmap, android.graphics.Bitmap, android.graphics.Bitmap, android.graphics.Bitmap, android.renderscript.Allocation.MipmapControl, int);
-    method public static deprecated android.renderscript.Allocation createCubemapFromCubeFaces(android.renderscript.RenderScript, android.graphics.Bitmap, android.graphics.Bitmap, android.graphics.Bitmap, android.graphics.Bitmap, android.graphics.Bitmap, android.graphics.Bitmap);
-    method public static deprecated android.renderscript.Allocation createFromBitmap(android.renderscript.RenderScript, android.graphics.Bitmap, android.renderscript.Allocation.MipmapControl, int);
-    method public static deprecated android.renderscript.Allocation createFromBitmap(android.renderscript.RenderScript, android.graphics.Bitmap);
-    method public static deprecated android.renderscript.Allocation createFromBitmapResource(android.renderscript.RenderScript, android.content.res.Resources, int, android.renderscript.Allocation.MipmapControl, int);
-    method public static deprecated android.renderscript.Allocation createFromBitmapResource(android.renderscript.RenderScript, android.content.res.Resources, int);
-    method public static deprecated android.renderscript.Allocation createFromString(android.renderscript.RenderScript, java.lang.String, int);
-    method public static deprecated android.renderscript.Allocation createSized(android.renderscript.RenderScript, android.renderscript.Element, int, int);
-    method public static deprecated android.renderscript.Allocation createSized(android.renderscript.RenderScript, android.renderscript.Element, int);
-    method public static deprecated android.renderscript.Allocation createTyped(android.renderscript.RenderScript, android.renderscript.Type, android.renderscript.Allocation.MipmapControl, int);
-    method public static deprecated android.renderscript.Allocation createTyped(android.renderscript.RenderScript, android.renderscript.Type, int);
-    method public static deprecated android.renderscript.Allocation createTyped(android.renderscript.RenderScript, android.renderscript.Type);
-    method public deprecated void generateMipmaps();
-    method public deprecated android.renderscript.Type getType();
-    method public deprecated synchronized void resize(int);
-    method public deprecated void setFromFieldPacker(int, android.renderscript.FieldPacker);
-    method public deprecated void setFromFieldPacker(int, int, android.renderscript.FieldPacker);
-    method public deprecated void syncAll(int);
-    field public static final deprecated int USAGE_GRAPHICS_CONSTANTS = 8; // 0x8
-    field public static final deprecated int USAGE_GRAPHICS_RENDER_TARGET = 16; // 0x10
-    field public static final deprecated int USAGE_GRAPHICS_TEXTURE = 2; // 0x2
-    field public static final deprecated int USAGE_GRAPHICS_VERTEX = 4; // 0x4
-    field public static final deprecated int USAGE_SCRIPT = 1; // 0x1
+  public class Allocation extends android.renderscript.BaseObj {
+    method public void copy1DRangeFrom(int, int, int[]);
+    method public void copy1DRangeFrom(int, int, short[]);
+    method public void copy1DRangeFrom(int, int, byte[]);
+    method public void copy1DRangeFrom(int, int, float[]);
+    method public void copy1DRangeFrom(int, int, android.renderscript.Allocation, int);
+    method public void copy1DRangeFromUnchecked(int, int, int[]);
+    method public void copy1DRangeFromUnchecked(int, int, short[]);
+    method public void copy1DRangeFromUnchecked(int, int, byte[]);
+    method public void copy1DRangeFromUnchecked(int, int, float[]);
+    method public void copy2DRangeFrom(int, int, int, int, byte[]);
+    method public void copy2DRangeFrom(int, int, int, int, short[]);
+    method public void copy2DRangeFrom(int, int, int, int, int[]);
+    method public void copy2DRangeFrom(int, int, int, int, float[]);
+    method public void copy2DRangeFrom(int, int, int, int, android.renderscript.Allocation, int, int);
+    method public void copy2DRangeFrom(int, int, android.graphics.Bitmap);
+    method public void copyFrom(android.renderscript.BaseObj[]);
+    method public void copyFrom(int[]);
+    method public void copyFrom(short[]);
+    method public void copyFrom(byte[]);
+    method public void copyFrom(float[]);
+    method public void copyFrom(android.graphics.Bitmap);
+    method public void copyFromUnchecked(int[]);
+    method public void copyFromUnchecked(short[]);
+    method public void copyFromUnchecked(byte[]);
+    method public void copyFromUnchecked(float[]);
+    method public void copyTo(android.graphics.Bitmap);
+    method public void copyTo(byte[]);
+    method public void copyTo(short[]);
+    method public void copyTo(int[]);
+    method public void copyTo(float[]);
+    method public static android.renderscript.Allocation createCubemapFromBitmap(android.renderscript.RenderScript, android.graphics.Bitmap, android.renderscript.Allocation.MipmapControl, int);
+    method public static android.renderscript.Allocation createCubemapFromBitmap(android.renderscript.RenderScript, android.graphics.Bitmap);
+    method public static android.renderscript.Allocation createCubemapFromCubeFaces(android.renderscript.RenderScript, android.graphics.Bitmap, android.graphics.Bitmap, android.graphics.Bitmap, android.graphics.Bitmap, android.graphics.Bitmap, android.graphics.Bitmap, android.renderscript.Allocation.MipmapControl, int);
+    method public static android.renderscript.Allocation createCubemapFromCubeFaces(android.renderscript.RenderScript, android.graphics.Bitmap, android.graphics.Bitmap, android.graphics.Bitmap, android.graphics.Bitmap, android.graphics.Bitmap, android.graphics.Bitmap);
+    method public static android.renderscript.Allocation createFromBitmap(android.renderscript.RenderScript, android.graphics.Bitmap, android.renderscript.Allocation.MipmapControl, int);
+    method public static android.renderscript.Allocation createFromBitmap(android.renderscript.RenderScript, android.graphics.Bitmap);
+    method public static android.renderscript.Allocation createFromBitmapResource(android.renderscript.RenderScript, android.content.res.Resources, int, android.renderscript.Allocation.MipmapControl, int);
+    method public static android.renderscript.Allocation createFromBitmapResource(android.renderscript.RenderScript, android.content.res.Resources, int);
+    method public static android.renderscript.Allocation createFromString(android.renderscript.RenderScript, java.lang.String, int);
+    method public static android.renderscript.Allocation createSized(android.renderscript.RenderScript, android.renderscript.Element, int, int);
+    method public static android.renderscript.Allocation createSized(android.renderscript.RenderScript, android.renderscript.Element, int);
+    method public static android.renderscript.Allocation createTyped(android.renderscript.RenderScript, android.renderscript.Type, android.renderscript.Allocation.MipmapControl, int);
+    method public static android.renderscript.Allocation createTyped(android.renderscript.RenderScript, android.renderscript.Type, int);
+    method public static android.renderscript.Allocation createTyped(android.renderscript.RenderScript, android.renderscript.Type);
+    method public void generateMipmaps();
+    method public int getBytesSize();
+    method public android.renderscript.Element getElement();
+    method public android.view.Surface getSurface();
+    method public android.renderscript.Type getType();
+    method public int getUsage();
+    method public void ioReceive();
+    method public void ioSend();
+    method public synchronized void resize(int);
+    method public void setFromFieldPacker(int, android.renderscript.FieldPacker);
+    method public void setFromFieldPacker(int, int, android.renderscript.FieldPacker);
+    method public void setSurface(android.view.Surface);
+    method public void syncAll(int);
+    field public static final int USAGE_GRAPHICS_CONSTANTS = 8; // 0x8
+    field public static final int USAGE_GRAPHICS_RENDER_TARGET = 16; // 0x10
+    field public static final int USAGE_GRAPHICS_TEXTURE = 2; // 0x2
+    field public static final int USAGE_GRAPHICS_VERTEX = 4; // 0x4
+    field public static final int USAGE_IO_INPUT = 32; // 0x20
+    field public static final int USAGE_IO_OUTPUT = 64; // 0x40
+    field public static final int USAGE_SCRIPT = 1; // 0x1
   }
 
-  public static final deprecated class Allocation.MipmapControl extends java.lang.Enum {
+  public static final class Allocation.MipmapControl extends java.lang.Enum {
     method public static android.renderscript.Allocation.MipmapControl valueOf(java.lang.String);
     method public static final android.renderscript.Allocation.MipmapControl[] values();
-    enum_constant public static final deprecated android.renderscript.Allocation.MipmapControl MIPMAP_FULL;
-    enum_constant public static final deprecated android.renderscript.Allocation.MipmapControl MIPMAP_NONE;
-    enum_constant public static final deprecated android.renderscript.Allocation.MipmapControl MIPMAP_ON_SYNC_TO_TEXTURE;
+    enum_constant public static final android.renderscript.Allocation.MipmapControl MIPMAP_FULL;
+    enum_constant public static final android.renderscript.Allocation.MipmapControl MIPMAP_NONE;
+    enum_constant public static final android.renderscript.Allocation.MipmapControl MIPMAP_ON_SYNC_TO_TEXTURE;
   }
 
-  public deprecated class AllocationAdapter extends android.renderscript.Allocation {
-    method public static deprecated android.renderscript.AllocationAdapter create1D(android.renderscript.RenderScript, android.renderscript.Allocation);
-    method public static deprecated android.renderscript.AllocationAdapter create2D(android.renderscript.RenderScript, android.renderscript.Allocation);
-    method public deprecated void setFace(android.renderscript.Type.CubemapFace);
-    method public deprecated void setLOD(int);
-    method public deprecated void setY(int);
-    method public deprecated void setZ(int);
+  public class AllocationAdapter extends android.renderscript.Allocation {
+    method public static android.renderscript.AllocationAdapter create1D(android.renderscript.RenderScript, android.renderscript.Allocation);
+    method public static android.renderscript.AllocationAdapter create2D(android.renderscript.RenderScript, android.renderscript.Allocation);
+    method public void setFace(android.renderscript.Type.CubemapFace);
+    method public void setLOD(int);
+    method public void setY(int);
+    method public void setZ(int);
   }
 
-  public deprecated class BaseObj {
-    method public deprecated synchronized void destroy();
-    method public deprecated java.lang.String getName();
-    method public deprecated void setName(java.lang.String);
+  public class BaseObj {
+    method public synchronized void destroy();
+    method public java.lang.String getName();
+    method public void setName(java.lang.String);
   }
 
-  public deprecated class Byte2 {
+  public class Byte2 {
     ctor public Byte2();
     ctor public Byte2(byte, byte);
     field public byte x;
     field public byte y;
   }
 
-  public deprecated class Byte3 {
+  public class Byte3 {
     ctor public Byte3();
     ctor public Byte3(byte, byte, byte);
     field public byte x;
@@ -18681,7 +18661,7 @@
     field public byte z;
   }
 
-  public deprecated class Byte4 {
+  public class Byte4 {
     ctor public Byte4();
     ctor public Byte4(byte, byte, byte, byte);
     field public byte w;
@@ -18690,14 +18670,14 @@
     field public byte z;
   }
 
-  public deprecated class Double2 {
+  public class Double2 {
     ctor public Double2();
     ctor public Double2(double, double);
     field public double x;
     field public double y;
   }
 
-  public deprecated class Double3 {
+  public class Double3 {
     ctor public Double3();
     ctor public Double3(double, double, double);
     field public double x;
@@ -18705,7 +18685,7 @@
     field public double z;
   }
 
-  public deprecated class Double4 {
+  public class Double4 {
     ctor public Double4();
     ctor public Double4(double, double, double, double);
     field public double w;
@@ -18714,83 +18694,92 @@
     field public double z;
   }
 
-  public deprecated class Element extends android.renderscript.BaseObj {
-    method public static deprecated android.renderscript.Element ALLOCATION(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element A_8(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element BOOLEAN(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element ELEMENT(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element F32(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element F32_2(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element F32_3(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element F32_4(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element F64(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element F64_2(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element F64_3(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element F64_4(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element FONT(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element I16(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element I16_2(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element I16_3(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element I16_4(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element I32(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element I32_2(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element I32_3(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element I32_4(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element I64(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element I64_2(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element I64_3(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element I64_4(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element I8(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element I8_2(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element I8_3(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element I8_4(android.renderscript.RenderScript);
+  public class Element extends android.renderscript.BaseObj {
+    method public static android.renderscript.Element ALLOCATION(android.renderscript.RenderScript);
+    method public static android.renderscript.Element A_8(android.renderscript.RenderScript);
+    method public static android.renderscript.Element BOOLEAN(android.renderscript.RenderScript);
+    method public static android.renderscript.Element ELEMENT(android.renderscript.RenderScript);
+    method public static android.renderscript.Element F32(android.renderscript.RenderScript);
+    method public static android.renderscript.Element F32_2(android.renderscript.RenderScript);
+    method public static android.renderscript.Element F32_3(android.renderscript.RenderScript);
+    method public static android.renderscript.Element F32_4(android.renderscript.RenderScript);
+    method public static android.renderscript.Element F64(android.renderscript.RenderScript);
+    method public static android.renderscript.Element F64_2(android.renderscript.RenderScript);
+    method public static android.renderscript.Element F64_3(android.renderscript.RenderScript);
+    method public static android.renderscript.Element F64_4(android.renderscript.RenderScript);
+    method public static android.renderscript.Element FONT(android.renderscript.RenderScript);
+    method public static android.renderscript.Element I16(android.renderscript.RenderScript);
+    method public static android.renderscript.Element I16_2(android.renderscript.RenderScript);
+    method public static android.renderscript.Element I16_3(android.renderscript.RenderScript);
+    method public static android.renderscript.Element I16_4(android.renderscript.RenderScript);
+    method public static android.renderscript.Element I32(android.renderscript.RenderScript);
+    method public static android.renderscript.Element I32_2(android.renderscript.RenderScript);
+    method public static android.renderscript.Element I32_3(android.renderscript.RenderScript);
+    method public static android.renderscript.Element I32_4(android.renderscript.RenderScript);
+    method public static android.renderscript.Element I64(android.renderscript.RenderScript);
+    method public static android.renderscript.Element I64_2(android.renderscript.RenderScript);
+    method public static android.renderscript.Element I64_3(android.renderscript.RenderScript);
+    method public static android.renderscript.Element I64_4(android.renderscript.RenderScript);
+    method public static android.renderscript.Element I8(android.renderscript.RenderScript);
+    method public static android.renderscript.Element I8_2(android.renderscript.RenderScript);
+    method public static android.renderscript.Element I8_3(android.renderscript.RenderScript);
+    method public static android.renderscript.Element I8_4(android.renderscript.RenderScript);
     method public static deprecated android.renderscript.Element MATRIX4X4(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element MATRIX_2X2(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element MATRIX_3X3(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element MATRIX_4X4(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element MESH(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element PROGRAM_FRAGMENT(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element PROGRAM_RASTER(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element PROGRAM_STORE(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element PROGRAM_VERTEX(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element RGBA_4444(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element RGBA_5551(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element RGBA_8888(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element RGB_565(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element RGB_888(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element SAMPLER(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element SCRIPT(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element TYPE(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element U16(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element U16_2(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element U16_3(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element U16_4(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element U32(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element U32_2(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element U32_3(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element U32_4(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element U64(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element U64_2(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element U64_3(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element U64_4(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element U8(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element U8_2(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element U8_3(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element U8_4(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Element createPixel(android.renderscript.RenderScript, android.renderscript.Element.DataType, android.renderscript.Element.DataKind);
-    method public static deprecated android.renderscript.Element createVector(android.renderscript.RenderScript, android.renderscript.Element.DataType, int);
-    method public deprecated boolean isCompatible(android.renderscript.Element);
-    method public deprecated boolean isComplex();
+    method public static android.renderscript.Element MATRIX_2X2(android.renderscript.RenderScript);
+    method public static android.renderscript.Element MATRIX_3X3(android.renderscript.RenderScript);
+    method public static android.renderscript.Element MATRIX_4X4(android.renderscript.RenderScript);
+    method public static android.renderscript.Element MESH(android.renderscript.RenderScript);
+    method public static android.renderscript.Element PROGRAM_FRAGMENT(android.renderscript.RenderScript);
+    method public static android.renderscript.Element PROGRAM_RASTER(android.renderscript.RenderScript);
+    method public static android.renderscript.Element PROGRAM_STORE(android.renderscript.RenderScript);
+    method public static android.renderscript.Element PROGRAM_VERTEX(android.renderscript.RenderScript);
+    method public static android.renderscript.Element RGBA_4444(android.renderscript.RenderScript);
+    method public static android.renderscript.Element RGBA_5551(android.renderscript.RenderScript);
+    method public static android.renderscript.Element RGBA_8888(android.renderscript.RenderScript);
+    method public static android.renderscript.Element RGB_565(android.renderscript.RenderScript);
+    method public static android.renderscript.Element RGB_888(android.renderscript.RenderScript);
+    method public static android.renderscript.Element SAMPLER(android.renderscript.RenderScript);
+    method public static android.renderscript.Element SCRIPT(android.renderscript.RenderScript);
+    method public static android.renderscript.Element TYPE(android.renderscript.RenderScript);
+    method public static android.renderscript.Element U16(android.renderscript.RenderScript);
+    method public static android.renderscript.Element U16_2(android.renderscript.RenderScript);
+    method public static android.renderscript.Element U16_3(android.renderscript.RenderScript);
+    method public static android.renderscript.Element U16_4(android.renderscript.RenderScript);
+    method public static android.renderscript.Element U32(android.renderscript.RenderScript);
+    method public static android.renderscript.Element U32_2(android.renderscript.RenderScript);
+    method public static android.renderscript.Element U32_3(android.renderscript.RenderScript);
+    method public static android.renderscript.Element U32_4(android.renderscript.RenderScript);
+    method public static android.renderscript.Element U64(android.renderscript.RenderScript);
+    method public static android.renderscript.Element U64_2(android.renderscript.RenderScript);
+    method public static android.renderscript.Element U64_3(android.renderscript.RenderScript);
+    method public static android.renderscript.Element U64_4(android.renderscript.RenderScript);
+    method public static android.renderscript.Element U8(android.renderscript.RenderScript);
+    method public static android.renderscript.Element U8_2(android.renderscript.RenderScript);
+    method public static android.renderscript.Element U8_3(android.renderscript.RenderScript);
+    method public static android.renderscript.Element U8_4(android.renderscript.RenderScript);
+    method public static android.renderscript.Element createPixel(android.renderscript.RenderScript, android.renderscript.Element.DataType, android.renderscript.Element.DataKind);
+    method public static android.renderscript.Element createVector(android.renderscript.RenderScript, android.renderscript.Element.DataType, int);
+    method public int getBytesSize();
+    method public android.renderscript.Element.DataKind getDataKind();
+    method public android.renderscript.Element.DataType getDataType();
+    method public android.renderscript.Element getSubElement(int);
+    method public int getSubElementArraySize(int);
+    method public int getSubElementCount();
+    method public java.lang.String getSubElementName(int);
+    method public int getSubElementOffsetBytes(int);
+    method public int getVectorSize();
+    method public boolean isCompatible(android.renderscript.Element);
+    method public boolean isComplex();
   }
 
-  public static deprecated class Element.Builder {
-    ctor public deprecated Element.Builder(android.renderscript.RenderScript);
-    method public deprecated android.renderscript.Element.Builder add(android.renderscript.Element, java.lang.String, int);
-    method public deprecated android.renderscript.Element.Builder add(android.renderscript.Element, java.lang.String);
-    method public deprecated android.renderscript.Element create();
+  public static class Element.Builder {
+    ctor public Element.Builder(android.renderscript.RenderScript);
+    method public android.renderscript.Element.Builder add(android.renderscript.Element, java.lang.String, int);
+    method public android.renderscript.Element.Builder add(android.renderscript.Element, java.lang.String);
+    method public android.renderscript.Element create();
   }
 
-  public static final deprecated class Element.DataKind extends java.lang.Enum {
+  public static final class Element.DataKind extends java.lang.Enum {
     method public static android.renderscript.Element.DataKind valueOf(java.lang.String);
     method public static final android.renderscript.Element.DataKind[] values();
     enum_constant public static final android.renderscript.Element.DataKind PIXEL_A;
@@ -18802,7 +18791,7 @@
     enum_constant public static final android.renderscript.Element.DataKind USER;
   }
 
-  public static final deprecated class Element.DataType extends java.lang.Enum {
+  public static final class Element.DataType extends java.lang.Enum {
     method public static android.renderscript.Element.DataType valueOf(java.lang.String);
     method public static final android.renderscript.Element.DataType[] values();
     enum_constant public static final android.renderscript.Element.DataType BOOLEAN;
@@ -18811,6 +18800,7 @@
     enum_constant public static final android.renderscript.Element.DataType MATRIX_2X2;
     enum_constant public static final android.renderscript.Element.DataType MATRIX_3X3;
     enum_constant public static final android.renderscript.Element.DataType MATRIX_4X4;
+    enum_constant public static final android.renderscript.Element.DataType NONE;
     enum_constant public static final android.renderscript.Element.DataType RS_ALLOCATION;
     enum_constant public static final android.renderscript.Element.DataType RS_ELEMENT;
     enum_constant public static final android.renderscript.Element.DataType RS_FONT;
@@ -18835,7 +18825,7 @@
     enum_constant public static final android.renderscript.Element.DataType UNSIGNED_8;
   }
 
-  public deprecated class FieldPacker {
+  public class FieldPacker {
     ctor public FieldPacker(int);
     method public void addBoolean(boolean);
     method public void addF32(float);
@@ -18912,14 +18902,14 @@
     method public deprecated android.renderscript.BaseObj getObject();
   }
 
-  public deprecated class Float2 {
+  public class Float2 {
     ctor public Float2();
     ctor public Float2(float, float);
     field public float x;
     field public float y;
   }
 
-  public deprecated class Float3 {
+  public class Float3 {
     ctor public Float3();
     ctor public Float3(float, float, float);
     field public float x;
@@ -18927,7 +18917,7 @@
     field public float z;
   }
 
-  public deprecated class Float4 {
+  public class Float4 {
     ctor public Float4();
     ctor public Float4(float, float, float, float);
     field public float w;
@@ -18953,14 +18943,14 @@
     enum_constant public static final deprecated android.renderscript.Font.Style NORMAL;
   }
 
-  public deprecated class Int2 {
+  public class Int2 {
     ctor public Int2();
     ctor public Int2(int, int);
     field public int x;
     field public int y;
   }
 
-  public deprecated class Int3 {
+  public class Int3 {
     ctor public Int3();
     ctor public Int3(int, int, int);
     field public int x;
@@ -18968,7 +18958,7 @@
     field public int z;
   }
 
-  public deprecated class Int4 {
+  public class Int4 {
     ctor public Int4();
     ctor public Int4(int, int, int, int);
     field public int w;
@@ -18977,14 +18967,14 @@
     field public int z;
   }
 
-  public deprecated class Long2 {
+  public class Long2 {
     ctor public Long2();
     ctor public Long2(long, long);
     field public long x;
     field public long y;
   }
 
-  public deprecated class Long3 {
+  public class Long3 {
     ctor public Long3();
     ctor public Long3(long, long, long);
     field public long x;
@@ -18992,7 +18982,7 @@
     field public long z;
   }
 
-  public deprecated class Long4 {
+  public class Long4 {
     ctor public Long4();
     ctor public Long4(long, long, long, long);
     field public long w;
@@ -19001,70 +18991,70 @@
     field public long z;
   }
 
-  public deprecated class Matrix2f {
-    ctor public deprecated Matrix2f();
-    ctor public deprecated Matrix2f(float[]);
-    method public deprecated float get(int, int);
-    method public deprecated float[] getArray();
-    method public deprecated void load(android.renderscript.Matrix2f);
-    method public deprecated void loadIdentity();
-    method public deprecated void loadMultiply(android.renderscript.Matrix2f, android.renderscript.Matrix2f);
-    method public deprecated void loadRotate(float);
-    method public deprecated void loadScale(float, float);
-    method public deprecated void multiply(android.renderscript.Matrix2f);
-    method public deprecated void rotate(float);
-    method public deprecated void scale(float, float);
-    method public deprecated void set(int, int, float);
-    method public deprecated void transpose();
+  public class Matrix2f {
+    ctor public Matrix2f();
+    ctor public Matrix2f(float[]);
+    method public float get(int, int);
+    method public float[] getArray();
+    method public void load(android.renderscript.Matrix2f);
+    method public void loadIdentity();
+    method public void loadMultiply(android.renderscript.Matrix2f, android.renderscript.Matrix2f);
+    method public void loadRotate(float);
+    method public void loadScale(float, float);
+    method public void multiply(android.renderscript.Matrix2f);
+    method public void rotate(float);
+    method public void scale(float, float);
+    method public void set(int, int, float);
+    method public void transpose();
   }
 
-  public deprecated class Matrix3f {
-    ctor public deprecated Matrix3f();
-    ctor public deprecated Matrix3f(float[]);
-    method public deprecated float get(int, int);
-    method public deprecated float[] getArray();
-    method public deprecated void load(android.renderscript.Matrix3f);
-    method public deprecated void loadIdentity();
-    method public deprecated void loadMultiply(android.renderscript.Matrix3f, android.renderscript.Matrix3f);
-    method public deprecated void loadRotate(float, float, float, float);
-    method public deprecated void loadRotate(float);
-    method public deprecated void loadScale(float, float);
-    method public deprecated void loadScale(float, float, float);
-    method public deprecated void loadTranslate(float, float);
-    method public deprecated void multiply(android.renderscript.Matrix3f);
-    method public deprecated void rotate(float, float, float, float);
-    method public deprecated void rotate(float);
-    method public deprecated void scale(float, float);
-    method public deprecated void scale(float, float, float);
-    method public deprecated void set(int, int, float);
-    method public deprecated void translate(float, float);
-    method public deprecated void transpose();
+  public class Matrix3f {
+    ctor public Matrix3f();
+    ctor public Matrix3f(float[]);
+    method public float get(int, int);
+    method public float[] getArray();
+    method public void load(android.renderscript.Matrix3f);
+    method public void loadIdentity();
+    method public void loadMultiply(android.renderscript.Matrix3f, android.renderscript.Matrix3f);
+    method public void loadRotate(float, float, float, float);
+    method public void loadRotate(float);
+    method public void loadScale(float, float);
+    method public void loadScale(float, float, float);
+    method public void loadTranslate(float, float);
+    method public void multiply(android.renderscript.Matrix3f);
+    method public void rotate(float, float, float, float);
+    method public void rotate(float);
+    method public void scale(float, float);
+    method public void scale(float, float, float);
+    method public void set(int, int, float);
+    method public void translate(float, float);
+    method public void transpose();
   }
 
-  public deprecated class Matrix4f {
-    ctor public deprecated Matrix4f();
-    ctor public deprecated Matrix4f(float[]);
-    method public deprecated float get(int, int);
-    method public deprecated float[] getArray();
-    method public deprecated boolean inverse();
-    method public deprecated boolean inverseTranspose();
-    method public deprecated void load(android.renderscript.Matrix4f);
-    method public deprecated void loadFrustum(float, float, float, float, float, float);
-    method public deprecated void loadIdentity();
-    method public deprecated void loadMultiply(android.renderscript.Matrix4f, android.renderscript.Matrix4f);
-    method public deprecated void loadOrtho(float, float, float, float, float, float);
-    method public deprecated void loadOrthoWindow(int, int);
-    method public deprecated void loadPerspective(float, float, float, float);
-    method public deprecated void loadProjectionNormalized(int, int);
-    method public deprecated void loadRotate(float, float, float, float);
-    method public deprecated void loadScale(float, float, float);
-    method public deprecated void loadTranslate(float, float, float);
-    method public deprecated void multiply(android.renderscript.Matrix4f);
-    method public deprecated void rotate(float, float, float, float);
-    method public deprecated void scale(float, float, float);
-    method public deprecated void set(int, int, float);
-    method public deprecated void translate(float, float, float);
-    method public deprecated void transpose();
+  public class Matrix4f {
+    ctor public Matrix4f();
+    ctor public Matrix4f(float[]);
+    method public float get(int, int);
+    method public float[] getArray();
+    method public boolean inverse();
+    method public boolean inverseTranspose();
+    method public void load(android.renderscript.Matrix4f);
+    method public void loadFrustum(float, float, float, float, float, float);
+    method public void loadIdentity();
+    method public void loadMultiply(android.renderscript.Matrix4f, android.renderscript.Matrix4f);
+    method public void loadOrtho(float, float, float, float, float, float);
+    method public void loadOrthoWindow(int, int);
+    method public void loadPerspective(float, float, float, float);
+    method public void loadProjectionNormalized(int, int);
+    method public void loadRotate(float, float, float, float);
+    method public void loadScale(float, float, float);
+    method public void loadTranslate(float, float, float);
+    method public void multiply(android.renderscript.Matrix4f);
+    method public void rotate(float, float, float, float);
+    method public void scale(float, float, float);
+    method public void set(int, int, float);
+    method public void translate(float, float, float);
+    method public void transpose();
   }
 
   public deprecated class Mesh extends android.renderscript.BaseObj {
@@ -19122,34 +19112,40 @@
     field public static final deprecated int TEXTURE_0 = 256; // 0x100
   }
 
-  public deprecated class Program extends android.renderscript.BaseObj {
-    method public deprecated void bindConstants(android.renderscript.Allocation, int);
-    method public deprecated void bindSampler(android.renderscript.Sampler, int) throws java.lang.IllegalArgumentException;
-    method public deprecated void bindTexture(android.renderscript.Allocation, int) throws java.lang.IllegalArgumentException;
+  public class Program extends android.renderscript.BaseObj {
+    method public void bindConstants(android.renderscript.Allocation, int);
+    method public void bindSampler(android.renderscript.Sampler, int) throws java.lang.IllegalArgumentException;
+    method public void bindTexture(android.renderscript.Allocation, int) throws java.lang.IllegalArgumentException;
+    method public android.renderscript.Type getConstant(int);
+    method public int getConstantCount();
+    method public int getTextureCount();
+    method public java.lang.String getTextureName(int);
+    method public android.renderscript.Program.TextureType getTextureType(int);
   }
 
   public static class Program.BaseProgramBuilder {
-    ctor protected deprecated Program.BaseProgramBuilder(android.renderscript.RenderScript);
-    method public deprecated android.renderscript.Program.BaseProgramBuilder addConstant(android.renderscript.Type) throws java.lang.IllegalStateException;
-    method public deprecated android.renderscript.Program.BaseProgramBuilder addTexture(android.renderscript.Program.TextureType) throws java.lang.IllegalArgumentException;
-    method public deprecated int getCurrentConstantIndex();
-    method public deprecated int getCurrentTextureIndex();
-    method protected deprecated void initProgram(android.renderscript.Program);
-    method public deprecated android.renderscript.Program.BaseProgramBuilder setShader(java.lang.String);
-    method public deprecated android.renderscript.Program.BaseProgramBuilder setShader(android.content.res.Resources, int);
+    ctor protected Program.BaseProgramBuilder(android.renderscript.RenderScript);
+    method public android.renderscript.Program.BaseProgramBuilder addConstant(android.renderscript.Type) throws java.lang.IllegalStateException;
+    method public android.renderscript.Program.BaseProgramBuilder addTexture(android.renderscript.Program.TextureType) throws java.lang.IllegalArgumentException;
+    method public android.renderscript.Program.BaseProgramBuilder addTexture(android.renderscript.Program.TextureType, java.lang.String) throws java.lang.IllegalArgumentException;
+    method public int getCurrentConstantIndex();
+    method public int getCurrentTextureIndex();
+    method protected void initProgram(android.renderscript.Program);
+    method public android.renderscript.Program.BaseProgramBuilder setShader(java.lang.String);
+    method public android.renderscript.Program.BaseProgramBuilder setShader(android.content.res.Resources, int);
   }
 
-  public static final deprecated class Program.TextureType extends java.lang.Enum {
+  public static final class Program.TextureType extends java.lang.Enum {
     method public static android.renderscript.Program.TextureType valueOf(java.lang.String);
     method public static final android.renderscript.Program.TextureType[] values();
-    enum_constant public static final deprecated android.renderscript.Program.TextureType TEXTURE_2D;
-    enum_constant public static final deprecated android.renderscript.Program.TextureType TEXTURE_CUBE;
+    enum_constant public static final android.renderscript.Program.TextureType TEXTURE_2D;
+    enum_constant public static final android.renderscript.Program.TextureType TEXTURE_CUBE;
   }
 
   public deprecated class ProgramFragment extends android.renderscript.Program {
   }
 
-  public static class ProgramFragment.Builder extends android.renderscript.Program.BaseProgramBuilder {
+  public static deprecated class ProgramFragment.Builder extends android.renderscript.Program.BaseProgramBuilder {
     ctor public deprecated ProgramFragment.Builder(android.renderscript.RenderScript);
     method public deprecated android.renderscript.ProgramFragment create();
   }
@@ -19157,7 +19153,7 @@
   public deprecated class ProgramFragmentFixedFunction extends android.renderscript.ProgramFragment {
   }
 
-  public static class ProgramFragmentFixedFunction.Builder {
+  public static deprecated class ProgramFragmentFixedFunction.Builder {
     ctor public deprecated ProgramFragmentFixedFunction.Builder(android.renderscript.RenderScript);
     method public deprecated android.renderscript.ProgramFragmentFixedFunction create();
     method public deprecated android.renderscript.ProgramFragmentFixedFunction.Builder setPointSpriteTexCoordinateReplacement(boolean);
@@ -19187,6 +19183,8 @@
     method public static deprecated android.renderscript.ProgramRaster CULL_BACK(android.renderscript.RenderScript);
     method public static deprecated android.renderscript.ProgramRaster CULL_FRONT(android.renderscript.RenderScript);
     method public static deprecated android.renderscript.ProgramRaster CULL_NONE(android.renderscript.RenderScript);
+    method public deprecated android.renderscript.ProgramRaster.CullMode getCullMode();
+    method public deprecated boolean isPointSpriteEnabled();
   }
 
   public static deprecated class ProgramRaster.Builder {
@@ -19204,63 +19202,74 @@
     enum_constant public static final deprecated android.renderscript.ProgramRaster.CullMode NONE;
   }
 
-  public deprecated class ProgramStore extends android.renderscript.BaseObj {
-    method public static deprecated android.renderscript.ProgramStore BLEND_ALPHA_DEPTH_NONE(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.ProgramStore BLEND_ALPHA_DEPTH_TEST(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.ProgramStore BLEND_NONE_DEPTH_NONE(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.ProgramStore BLEND_NONE_DEPTH_TEST(android.renderscript.RenderScript);
+  public class ProgramStore extends android.renderscript.BaseObj {
+    method public static android.renderscript.ProgramStore BLEND_ALPHA_DEPTH_NONE(android.renderscript.RenderScript);
+    method public static android.renderscript.ProgramStore BLEND_ALPHA_DEPTH_TEST(android.renderscript.RenderScript);
+    method public static android.renderscript.ProgramStore BLEND_NONE_DEPTH_NONE(android.renderscript.RenderScript);
+    method public static android.renderscript.ProgramStore BLEND_NONE_DEPTH_TEST(android.renderscript.RenderScript);
+    method public android.renderscript.ProgramStore.BlendDstFunc getBlendDstFunc();
+    method public android.renderscript.ProgramStore.BlendSrcFunc getBlendSrcFunc();
+    method public android.renderscript.ProgramStore.DepthFunc getDepthFunc();
+    method public boolean isColorMaskAlphaEnabled();
+    method public boolean isColorMaskBlueEnabled();
+    method public boolean isColorMaskGreenEnabled();
+    method public boolean isColorMaskRedEnabled();
+    method public boolean isDepthMaskEnabled();
+    method public boolean isDitherEnabled();
   }
 
-  public static final deprecated class ProgramStore.BlendDstFunc extends java.lang.Enum {
+  public static final class ProgramStore.BlendDstFunc extends java.lang.Enum {
     method public static android.renderscript.ProgramStore.BlendDstFunc valueOf(java.lang.String);
     method public static final android.renderscript.ProgramStore.BlendDstFunc[] values();
-    enum_constant public static final deprecated android.renderscript.ProgramStore.BlendDstFunc DST_ALPHA;
-    enum_constant public static final deprecated android.renderscript.ProgramStore.BlendDstFunc ONE;
-    enum_constant public static final deprecated android.renderscript.ProgramStore.BlendDstFunc ONE_MINUS_DST_ALPHA;
-    enum_constant public static final deprecated android.renderscript.ProgramStore.BlendDstFunc ONE_MINUS_SRC_ALPHA;
-    enum_constant public static final deprecated android.renderscript.ProgramStore.BlendDstFunc ONE_MINUS_SRC_COLOR;
-    enum_constant public static final deprecated android.renderscript.ProgramStore.BlendDstFunc SRC_ALPHA;
-    enum_constant public static final deprecated android.renderscript.ProgramStore.BlendDstFunc SRC_COLOR;
-    enum_constant public static final deprecated android.renderscript.ProgramStore.BlendDstFunc ZERO;
+    enum_constant public static final android.renderscript.ProgramStore.BlendDstFunc DST_ALPHA;
+    enum_constant public static final android.renderscript.ProgramStore.BlendDstFunc ONE;
+    enum_constant public static final android.renderscript.ProgramStore.BlendDstFunc ONE_MINUS_DST_ALPHA;
+    enum_constant public static final android.renderscript.ProgramStore.BlendDstFunc ONE_MINUS_SRC_ALPHA;
+    enum_constant public static final android.renderscript.ProgramStore.BlendDstFunc ONE_MINUS_SRC_COLOR;
+    enum_constant public static final android.renderscript.ProgramStore.BlendDstFunc SRC_ALPHA;
+    enum_constant public static final android.renderscript.ProgramStore.BlendDstFunc SRC_COLOR;
+    enum_constant public static final android.renderscript.ProgramStore.BlendDstFunc ZERO;
   }
 
-  public static final deprecated class ProgramStore.BlendSrcFunc extends java.lang.Enum {
+  public static final class ProgramStore.BlendSrcFunc extends java.lang.Enum {
     method public static android.renderscript.ProgramStore.BlendSrcFunc valueOf(java.lang.String);
     method public static final android.renderscript.ProgramStore.BlendSrcFunc[] values();
-    enum_constant public static final deprecated android.renderscript.ProgramStore.BlendSrcFunc DST_ALPHA;
-    enum_constant public static final deprecated android.renderscript.ProgramStore.BlendSrcFunc DST_COLOR;
-    enum_constant public static final deprecated android.renderscript.ProgramStore.BlendSrcFunc ONE;
-    enum_constant public static final deprecated android.renderscript.ProgramStore.BlendSrcFunc ONE_MINUS_DST_ALPHA;
-    enum_constant public static final deprecated android.renderscript.ProgramStore.BlendSrcFunc ONE_MINUS_DST_COLOR;
-    enum_constant public static final deprecated android.renderscript.ProgramStore.BlendSrcFunc ONE_MINUS_SRC_ALPHA;
-    enum_constant public static final deprecated android.renderscript.ProgramStore.BlendSrcFunc SRC_ALPHA;
-    enum_constant public static final deprecated android.renderscript.ProgramStore.BlendSrcFunc SRC_ALPHA_SATURATE;
-    enum_constant public static final deprecated android.renderscript.ProgramStore.BlendSrcFunc ZERO;
+    enum_constant public static final android.renderscript.ProgramStore.BlendSrcFunc DST_ALPHA;
+    enum_constant public static final android.renderscript.ProgramStore.BlendSrcFunc DST_COLOR;
+    enum_constant public static final android.renderscript.ProgramStore.BlendSrcFunc ONE;
+    enum_constant public static final android.renderscript.ProgramStore.BlendSrcFunc ONE_MINUS_DST_ALPHA;
+    enum_constant public static final android.renderscript.ProgramStore.BlendSrcFunc ONE_MINUS_DST_COLOR;
+    enum_constant public static final android.renderscript.ProgramStore.BlendSrcFunc ONE_MINUS_SRC_ALPHA;
+    enum_constant public static final android.renderscript.ProgramStore.BlendSrcFunc SRC_ALPHA;
+    enum_constant public static final android.renderscript.ProgramStore.BlendSrcFunc SRC_ALPHA_SATURATE;
+    enum_constant public static final android.renderscript.ProgramStore.BlendSrcFunc ZERO;
   }
 
-  public static deprecated class ProgramStore.Builder {
+  public static class ProgramStore.Builder {
     ctor public ProgramStore.Builder(android.renderscript.RenderScript);
-    method public deprecated android.renderscript.ProgramStore create();
-    method public deprecated android.renderscript.ProgramStore.Builder setBlendFunc(android.renderscript.ProgramStore.BlendSrcFunc, android.renderscript.ProgramStore.BlendDstFunc);
-    method public deprecated android.renderscript.ProgramStore.Builder setColorMaskEnabled(boolean, boolean, boolean, boolean);
-    method public deprecated android.renderscript.ProgramStore.Builder setDepthFunc(android.renderscript.ProgramStore.DepthFunc);
-    method public deprecated android.renderscript.ProgramStore.Builder setDepthMaskEnabled(boolean);
-    method public deprecated android.renderscript.ProgramStore.Builder setDitherEnabled(boolean);
+    method public android.renderscript.ProgramStore create();
+    method public android.renderscript.ProgramStore.Builder setBlendFunc(android.renderscript.ProgramStore.BlendSrcFunc, android.renderscript.ProgramStore.BlendDstFunc);
+    method public android.renderscript.ProgramStore.Builder setColorMaskEnabled(boolean, boolean, boolean, boolean);
+    method public android.renderscript.ProgramStore.Builder setDepthFunc(android.renderscript.ProgramStore.DepthFunc);
+    method public android.renderscript.ProgramStore.Builder setDepthMaskEnabled(boolean);
+    method public android.renderscript.ProgramStore.Builder setDitherEnabled(boolean);
   }
 
-  public static final deprecated class ProgramStore.DepthFunc extends java.lang.Enum {
+  public static final class ProgramStore.DepthFunc extends java.lang.Enum {
     method public static android.renderscript.ProgramStore.DepthFunc valueOf(java.lang.String);
     method public static final android.renderscript.ProgramStore.DepthFunc[] values();
-    enum_constant public static final deprecated android.renderscript.ProgramStore.DepthFunc ALWAYS;
-    enum_constant public static final deprecated android.renderscript.ProgramStore.DepthFunc EQUAL;
-    enum_constant public static final deprecated android.renderscript.ProgramStore.DepthFunc GREATER;
-    enum_constant public static final deprecated android.renderscript.ProgramStore.DepthFunc GREATER_OR_EQUAL;
-    enum_constant public static final deprecated android.renderscript.ProgramStore.DepthFunc LESS;
-    enum_constant public static final deprecated android.renderscript.ProgramStore.DepthFunc LESS_OR_EQUAL;
-    enum_constant public static final deprecated android.renderscript.ProgramStore.DepthFunc NOT_EQUAL;
+    enum_constant public static final android.renderscript.ProgramStore.DepthFunc ALWAYS;
+    enum_constant public static final android.renderscript.ProgramStore.DepthFunc EQUAL;
+    enum_constant public static final android.renderscript.ProgramStore.DepthFunc GREATER;
+    enum_constant public static final android.renderscript.ProgramStore.DepthFunc GREATER_OR_EQUAL;
+    enum_constant public static final android.renderscript.ProgramStore.DepthFunc LESS;
+    enum_constant public static final android.renderscript.ProgramStore.DepthFunc LESS_OR_EQUAL;
+    enum_constant public static final android.renderscript.ProgramStore.DepthFunc NOT_EQUAL;
   }
 
   public deprecated class ProgramVertex extends android.renderscript.Program {
+    method public deprecated android.renderscript.Element getInput(int);
+    method public deprecated int getInputCount();
   }
 
   public static deprecated class ProgramVertex.Builder extends android.renderscript.Program.BaseProgramBuilder {
@@ -19273,7 +19282,7 @@
     method public deprecated void bindConstants(android.renderscript.ProgramVertexFixedFunction.Constants);
   }
 
-  public static class ProgramVertexFixedFunction.Builder {
+  public static deprecated class ProgramVertexFixedFunction.Builder {
     ctor public deprecated ProgramVertexFixedFunction.Builder(android.renderscript.RenderScript);
     method public deprecated android.renderscript.ProgramVertexFixedFunction create();
     method public deprecated android.renderscript.ProgramVertexFixedFunction.Builder setTextureMatrixEnable(boolean);
@@ -19287,31 +19296,31 @@
     method public deprecated void setTexture(android.renderscript.Matrix4f);
   }
 
-  public deprecated class RSDriverException extends android.renderscript.RSRuntimeException {
+  public class RSDriverException extends android.renderscript.RSRuntimeException {
     ctor public RSDriverException(java.lang.String);
   }
 
-  public deprecated class RSIllegalArgumentException extends android.renderscript.RSRuntimeException {
-    ctor public deprecated RSIllegalArgumentException(java.lang.String);
+  public class RSIllegalArgumentException extends android.renderscript.RSRuntimeException {
+    ctor public RSIllegalArgumentException(java.lang.String);
   }
 
-  public deprecated class RSInvalidStateException extends android.renderscript.RSRuntimeException {
-    ctor public deprecated RSInvalidStateException(java.lang.String);
+  public class RSInvalidStateException extends android.renderscript.RSRuntimeException {
+    ctor public RSInvalidStateException(java.lang.String);
   }
 
-  public deprecated class RSRuntimeException extends java.lang.RuntimeException {
-    ctor public deprecated RSRuntimeException(java.lang.String);
+  public class RSRuntimeException extends java.lang.RuntimeException {
+    ctor public RSRuntimeException(java.lang.String);
   }
 
   public deprecated class RSSurfaceView extends android.view.SurfaceView implements android.view.SurfaceHolder.Callback {
     ctor public deprecated RSSurfaceView(android.content.Context);
     ctor public deprecated RSSurfaceView(android.content.Context, android.util.AttributeSet);
-    method public android.renderscript.RenderScriptGL createRenderScriptGL(android.renderscript.RenderScriptGL.SurfaceConfig);
-    method public void destroyRenderScriptGL();
-    method public android.renderscript.RenderScriptGL getRenderScriptGL();
+    method public deprecated android.renderscript.RenderScriptGL createRenderScriptGL(android.renderscript.RenderScriptGL.SurfaceConfig);
+    method public deprecated void destroyRenderScriptGL();
+    method public deprecated android.renderscript.RenderScriptGL getRenderScriptGL();
     method public deprecated void pause();
     method public deprecated void resume();
-    method public void setRenderScriptGL(android.renderscript.RenderScriptGL);
+    method public deprecated void setRenderScriptGL(android.renderscript.RenderScriptGL);
     method public deprecated void surfaceChanged(android.view.SurfaceHolder, int, int, int);
     method public deprecated void surfaceCreated(android.view.SurfaceHolder);
     method public deprecated void surfaceDestroyed(android.view.SurfaceHolder);
@@ -19323,43 +19332,43 @@
     method public deprecated android.renderscript.RenderScriptGL createRenderScriptGL(android.renderscript.RenderScriptGL.SurfaceConfig);
     method public deprecated void destroyRenderScriptGL();
     method public deprecated android.renderscript.RenderScriptGL getRenderScriptGL();
-    method public void onSurfaceTextureAvailable(android.graphics.SurfaceTexture, int, int);
-    method public boolean onSurfaceTextureDestroyed(android.graphics.SurfaceTexture);
-    method public void onSurfaceTextureSizeChanged(android.graphics.SurfaceTexture, int, int);
-    method public void onSurfaceTextureUpdated(android.graphics.SurfaceTexture);
+    method public deprecated void onSurfaceTextureAvailable(android.graphics.SurfaceTexture, int, int);
+    method public deprecated boolean onSurfaceTextureDestroyed(android.graphics.SurfaceTexture);
+    method public deprecated void onSurfaceTextureSizeChanged(android.graphics.SurfaceTexture, int, int);
+    method public deprecated void onSurfaceTextureUpdated(android.graphics.SurfaceTexture);
     method public deprecated void pause();
     method public deprecated void resume();
     method public deprecated void setRenderScriptGL(android.renderscript.RenderScriptGL);
   }
 
-  public deprecated class RenderScript {
-    method public deprecated void contextDump();
-    method public static deprecated android.renderscript.RenderScript create(android.content.Context);
-    method public deprecated void destroy();
-    method public deprecated void finish();
-    method public final deprecated android.content.Context getApplicationContext();
+  public class RenderScript {
+    method public void contextDump();
+    method public static android.renderscript.RenderScript create(android.content.Context);
+    method public void destroy();
+    method public void finish();
+    method public final android.content.Context getApplicationContext();
     method public android.renderscript.RenderScript.RSErrorHandler getErrorHandler();
     method public android.renderscript.RenderScript.RSMessageHandler getMessageHandler();
     method public void setErrorHandler(android.renderscript.RenderScript.RSErrorHandler);
     method public void setMessageHandler(android.renderscript.RenderScript.RSMessageHandler);
-    method public deprecated void setPriority(android.renderscript.RenderScript.Priority);
+    method public void setPriority(android.renderscript.RenderScript.Priority);
   }
 
-  public static final deprecated class RenderScript.Priority extends java.lang.Enum {
+  public static final class RenderScript.Priority extends java.lang.Enum {
     method public static android.renderscript.RenderScript.Priority valueOf(java.lang.String);
     method public static final android.renderscript.RenderScript.Priority[] values();
     enum_constant public static final android.renderscript.RenderScript.Priority LOW;
     enum_constant public static final android.renderscript.RenderScript.Priority NORMAL;
   }
 
-  public static deprecated class RenderScript.RSErrorHandler implements java.lang.Runnable {
+  public static class RenderScript.RSErrorHandler implements java.lang.Runnable {
     ctor public RenderScript.RSErrorHandler();
     method public void run();
     field protected java.lang.String mErrorMessage;
     field protected int mErrorNum;
   }
 
-  public static deprecated class RenderScript.RSMessageHandler implements java.lang.Runnable {
+  public static class RenderScript.RSMessageHandler implements java.lang.Runnable {
     ctor public RenderScript.RSMessageHandler();
     method public void run();
     field protected int[] mData;
@@ -19383,24 +19392,29 @@
   }
 
   public static deprecated class RenderScriptGL.SurfaceConfig {
-    ctor public RenderScriptGL.SurfaceConfig();
-    ctor public RenderScriptGL.SurfaceConfig(android.renderscript.RenderScriptGL.SurfaceConfig);
+    ctor public deprecated RenderScriptGL.SurfaceConfig();
+    ctor public deprecated RenderScriptGL.SurfaceConfig(android.renderscript.RenderScriptGL.SurfaceConfig);
     method public deprecated void setAlpha(int, int);
     method public deprecated void setColor(int, int);
     method public deprecated void setDepth(int, int);
     method public deprecated void setSamples(int, int, float);
   }
 
-  public deprecated class Sampler extends android.renderscript.BaseObj {
-    method public static deprecated android.renderscript.Sampler CLAMP_LINEAR(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Sampler CLAMP_LINEAR_MIP_LINEAR(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Sampler CLAMP_NEAREST(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Sampler WRAP_LINEAR(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Sampler WRAP_LINEAR_MIP_LINEAR(android.renderscript.RenderScript);
-    method public static deprecated android.renderscript.Sampler WRAP_NEAREST(android.renderscript.RenderScript);
+  public class Sampler extends android.renderscript.BaseObj {
+    method public static android.renderscript.Sampler CLAMP_LINEAR(android.renderscript.RenderScript);
+    method public static android.renderscript.Sampler CLAMP_LINEAR_MIP_LINEAR(android.renderscript.RenderScript);
+    method public static android.renderscript.Sampler CLAMP_NEAREST(android.renderscript.RenderScript);
+    method public static android.renderscript.Sampler WRAP_LINEAR(android.renderscript.RenderScript);
+    method public static android.renderscript.Sampler WRAP_LINEAR_MIP_LINEAR(android.renderscript.RenderScript);
+    method public static android.renderscript.Sampler WRAP_NEAREST(android.renderscript.RenderScript);
+    method public float getAnisotropy();
+    method public android.renderscript.Sampler.Value getMagnification();
+    method public android.renderscript.Sampler.Value getMinification();
+    method public android.renderscript.Sampler.Value getWrapS();
+    method public android.renderscript.Sampler.Value getWrapT();
   }
 
-  public static deprecated class Sampler.Builder {
+  public static class Sampler.Builder {
     ctor public Sampler.Builder(android.renderscript.RenderScript);
     method public android.renderscript.Sampler create();
     method public void setAnisotropy(float);
@@ -19410,31 +19424,31 @@
     method public void setWrapT(android.renderscript.Sampler.Value);
   }
 
-  public static final deprecated class Sampler.Value extends java.lang.Enum {
+  public static final class Sampler.Value extends java.lang.Enum {
     method public static android.renderscript.Sampler.Value valueOf(java.lang.String);
     method public static final android.renderscript.Sampler.Value[] values();
-    enum_constant public static final deprecated android.renderscript.Sampler.Value CLAMP;
-    enum_constant public static final deprecated android.renderscript.Sampler.Value LINEAR;
-    enum_constant public static final deprecated android.renderscript.Sampler.Value LINEAR_MIP_LINEAR;
-    enum_constant public static final deprecated android.renderscript.Sampler.Value LINEAR_MIP_NEAREST;
-    enum_constant public static final deprecated android.renderscript.Sampler.Value NEAREST;
-    enum_constant public static final deprecated android.renderscript.Sampler.Value WRAP;
+    enum_constant public static final android.renderscript.Sampler.Value CLAMP;
+    enum_constant public static final android.renderscript.Sampler.Value LINEAR;
+    enum_constant public static final android.renderscript.Sampler.Value LINEAR_MIP_LINEAR;
+    enum_constant public static final android.renderscript.Sampler.Value LINEAR_MIP_NEAREST;
+    enum_constant public static final android.renderscript.Sampler.Value NEAREST;
+    enum_constant public static final android.renderscript.Sampler.Value WRAP;
   }
 
-  public deprecated class Script extends android.renderscript.BaseObj {
-    method public deprecated void bindAllocation(android.renderscript.Allocation, int);
-    method protected deprecated void forEach(int, android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.FieldPacker);
-    method protected deprecated void invoke(int);
-    method protected deprecated void invoke(int, android.renderscript.FieldPacker);
-    method public deprecated void setTimeZone(java.lang.String);
-    method public deprecated void setVar(int, float);
-    method public deprecated void setVar(int, double);
-    method public deprecated void setVar(int, int);
-    method public deprecated void setVar(int, long);
-    method public deprecated void setVar(int, boolean);
-    method public deprecated void setVar(int, android.renderscript.BaseObj);
-    method public deprecated void setVar(int, android.renderscript.FieldPacker);
-    method public deprecated void setVar(int, android.renderscript.FieldPacker, android.renderscript.Element, int[]);
+  public class Script extends android.renderscript.BaseObj {
+    method public void bindAllocation(android.renderscript.Allocation, int);
+    method protected void forEach(int, android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.FieldPacker);
+    method protected void invoke(int);
+    method protected void invoke(int, android.renderscript.FieldPacker);
+    method public void setTimeZone(java.lang.String);
+    method public void setVar(int, float);
+    method public void setVar(int, double);
+    method public void setVar(int, int);
+    method public void setVar(int, long);
+    method public void setVar(int, boolean);
+    method public void setVar(int, android.renderscript.BaseObj);
+    method public void setVar(int, android.renderscript.FieldPacker);
+    method public void setVar(int, android.renderscript.FieldPacker, android.renderscript.Element, int[]);
   }
 
   public static class Script.Builder {
@@ -19452,19 +19466,19 @@
     field protected android.renderscript.Element mElement;
   }
 
-  public deprecated class ScriptC extends android.renderscript.Script {
-    ctor protected deprecated ScriptC(int, android.renderscript.RenderScript);
-    ctor protected deprecated ScriptC(android.renderscript.RenderScript, android.content.res.Resources, int);
+  public class ScriptC extends android.renderscript.Script {
+    ctor protected ScriptC(int, android.renderscript.RenderScript);
+    ctor protected ScriptC(android.renderscript.RenderScript, android.content.res.Resources, int);
   }
 
-  public deprecated class Short2 {
+  public class Short2 {
     ctor public Short2();
     ctor public Short2(short, short);
     field public short x;
     field public short y;
   }
 
-  public deprecated class Short3 {
+  public class Short3 {
     ctor public Short3();
     ctor public Short3(short, short, short);
     field public short x;
@@ -19472,7 +19486,7 @@
     field public short z;
   }
 
-  public deprecated class Short4 {
+  public class Short4 {
     ctor public Short4();
     ctor public Short4(short, short, short, short);
     field public short w;
@@ -19481,22 +19495,22 @@
     field public short z;
   }
 
-  public deprecated class Type extends android.renderscript.BaseObj {
-    method public deprecated int getCount();
-    method public deprecated android.renderscript.Element getElement();
-    method public deprecated int getX();
-    method public deprecated int getY();
-    method public deprecated int getZ();
-    method public deprecated boolean hasFaces();
-    method public deprecated boolean hasMipmaps();
+  public class Type extends android.renderscript.BaseObj {
+    method public int getCount();
+    method public android.renderscript.Element getElement();
+    method public int getX();
+    method public int getY();
+    method public int getZ();
+    method public boolean hasFaces();
+    method public boolean hasMipmaps();
   }
 
-  public static deprecated class Type.Builder {
-    ctor public deprecated Type.Builder(android.renderscript.RenderScript, android.renderscript.Element);
-    method public deprecated android.renderscript.Type create();
+  public static class Type.Builder {
+    ctor public Type.Builder(android.renderscript.RenderScript, android.renderscript.Element);
+    method public android.renderscript.Type create();
     method public android.renderscript.Type.Builder setFaces(boolean);
     method public android.renderscript.Type.Builder setMipmaps(boolean);
-    method public deprecated android.renderscript.Type.Builder setX(int);
+    method public android.renderscript.Type.Builder setX(int);
     method public android.renderscript.Type.Builder setY(int);
   }
 
@@ -24380,6 +24394,7 @@
     method public void onInitializeAccessibilityNodeInfo(android.view.View, android.view.accessibility.AccessibilityNodeInfo);
     method public void onPopulateAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent);
     method public boolean onRequestSendAccessibilityEvent(android.view.ViewGroup, android.view.View, android.view.accessibility.AccessibilityEvent);
+    method public boolean performAccessibilityAction(android.view.View, int, android.os.Bundle);
     method public void sendAccessibilityEvent(android.view.View, int);
     method public void sendAccessibilityEventUnchecked(android.view.View, android.view.accessibility.AccessibilityEvent);
   }
@@ -25180,6 +25195,7 @@
     method public boolean isPassword();
     method public boolean isScrollable();
     method public boolean isSelected();
+    method public boolean isVisibleToUser();
     method public static android.view.accessibility.AccessibilityNodeInfo obtain(android.view.View);
     method public static android.view.accessibility.AccessibilityNodeInfo obtain(android.view.View, int);
     method public static android.view.accessibility.AccessibilityNodeInfo obtain();
@@ -25209,6 +25225,7 @@
     method public void setSource(android.view.View);
     method public void setSource(android.view.View, int);
     method public void setText(java.lang.CharSequence);
+    method public void setVisibleToUser(boolean);
     method public void writeToParcel(android.os.Parcel, int);
     field public static final int ACTION_ACCESSIBILITY_FOCUS = 64; // 0x40
     field public static final java.lang.String ACTION_ARGUMENT_HTML_ELEMENT_STRING = "ACTION_ARGUMENT_HTML_ELEMENT_STRING";
@@ -25238,7 +25255,7 @@
     ctor public AccessibilityNodeProvider();
     method public android.view.accessibility.AccessibilityNodeInfo accessibilityFocusSearch(int, int);
     method public android.view.accessibility.AccessibilityNodeInfo createAccessibilityNodeInfo(int);
-    method public android.view.accessibility.AccessibilityNodeInfo findAccessibilitiyFocus(int);
+    method public android.view.accessibility.AccessibilityNodeInfo findAccessibilityFocus(int);
     method public java.util.List<android.view.accessibility.AccessibilityNodeInfo> findAccessibilityNodeInfosByText(java.lang.String, int);
     method public boolean performAction(int, int, android.os.Bundle);
   }
diff --git a/cmds/input/src/com/android/commands/input/Input.java b/cmds/input/src/com/android/commands/input/Input.java
index fcf3c7e..341f30f 100755
--- a/cmds/input/src/com/android/commands/input/Input.java
+++ b/cmds/input/src/com/android/commands/input/Input.java
@@ -17,8 +17,6 @@
 package com.android.commands.input;
 
 import android.hardware.input.InputManager;
-import android.os.RemoteException;
-import android.os.ServiceManager;
 import android.os.SystemClock;
 import android.util.Log;
 import android.view.InputDevice;
@@ -59,7 +57,11 @@
                 }
             } else if (command.equals("keyevent")) {
                 if (args.length == 2) {
-                    sendKeyEvent(Integer.parseInt(args[1]));
+                    int keyCode = KeyEvent.keyCodeFromString(args[1]);
+                    if (keyCode == KeyEvent.KEYCODE_UNKNOWN) {
+                        keyCode = KeyEvent.keyCodeFromString("KEYCODE_" + args[1]);
+                    }
+                    sendKeyEvent(keyCode);
                     return;
                 }
             } else if (command.equals("tap")) {
@@ -163,7 +165,7 @@
     private void showUsage() {
         System.err.println("usage: input ...");
         System.err.println("       input text <string>");
-        System.err.println("       input keyevent <key code>");
+        System.err.println("       input keyevent <key code number or name>");
         System.err.println("       input tap <x> <y>");
         System.err.println("       input swipe <x1> <y1> <x2> <y2>");
     }
diff --git a/core/java/android/accessibilityservice/AccessibilityService.java b/core/java/android/accessibilityservice/AccessibilityService.java
index b644dd1..850fe48 100644
--- a/core/java/android/accessibilityservice/AccessibilityService.java
+++ b/core/java/android/accessibilityservice/AccessibilityService.java
@@ -284,16 +284,6 @@
     public static final int GESTURE_SWIPE_DOWN_AND_RIGHT = 16;
 
     /**
-     * The user has performed a two finger tap gesture on the touch screen.
-     */
-    public static final int GESTURE_TWO_FINGER_TAP = 17;
-
-    /**
-     * The user has performed a two finger long press gesture on the touch screen.
-     */
-    public static final int GESTURE_TWO_FINGER_LONG_PRESS = 18;
-
-    /**
      * The {@link Intent} that must be declared as handled by the service.
      */
     public static final String SERVICE_INTERFACE =
@@ -377,14 +367,12 @@
 
     /**
      * Called by the system when the user performs a specific gesture on the
-     * touch screen. If the gesture is not handled in this callback the system
-     * may provide default handing. Therefore, one should return true from this
-     * function if overriding of default behavior is desired.
+     * touch screen.
      *
-     * <strong>Note:</strong> To receive gestures an accessibility service
-     *         must declare that it can handle such by specifying the
-     *         <code>&lt;{@link android.R.styleable#AccessibilityService_canHandleGestures
-     *         canHandleGestures}&gt;</code> attribute.
+     * <strong>Note:</strong> To receive gestures an accessibility service must
+     * request that the device is in touch exploration mode by setting the
+     * {@link android.accessibilityservice.AccessibilityServiceInfo#FLAG_INCLUDE_NOT_IMPORTANT_VIEWS}
+     * flag.
      *
      * @param gestureId The unique id of the performed gesture.
      *
@@ -406,13 +394,8 @@
      * @see #GESTURE_SWIPE_RIGHT_AND_UP
      * @see #GESTURE_SWIPE_RIGHT_AND_LEFT
      * @see #GESTURE_SWIPE_RIGHT_AND_DOWN
-     * @see #GESTURE_CLOCKWISE_CIRCLE
-     * @see #GESTURE_COUNTER_CLOCKWISE_CIRCLE
-     * @see #GESTURE_TWO_FINGER_TAP
-     * @see #GESTURE_TWO_FINGER_LONG_PRESS
      */
     protected boolean onGesture(int gestureId) {
-        // TODO: Describe the default gesture processing in the javaDoc once it is finalized.
         return false;
     }
 
diff --git a/core/java/android/accessibilityservice/AccessibilityServiceInfo.java b/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
index 7e6786b..10ea0fe 100644
--- a/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
+++ b/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
@@ -131,7 +131,19 @@
      * elements.
      * </p>
      */
-    public static final int INCLUDE_NOT_IMPORTANT_VIEWS = 0x0000002;
+    public static final int FLAG_INCLUDE_NOT_IMPORTANT_VIEWS = 0x0000002;
+
+    /**
+     * This flag requests that the system gets into touch exploration mode.
+     * In this mode a single finger moving on the screen behaves as a mouse
+     * pointer hovering over the user interface. The system will also detect
+     * certain gestures performed on the touch screen and notify this service.
+     * The system will enable touch exploration mode if there is at least one
+     * accessibility service that has this flag set. Hence, clearing this
+     * flag does not guarantee that the device will not be in touch exploration
+     * mode since there may be another enabled service that requested it.
+     */
+    public static final int FLAG_REQUEST_TOUCH_EXPLORATION_MODE= 0x0000004;
 
     /**
      * The event types an {@link AccessibilityService} is interested in.
@@ -198,7 +210,8 @@
      *   <strong>Can be dynamically set at runtime.</strong>
      * </p>
      * @see #DEFAULT
-     * @see #INCLUDE_NOT_IMPORTANT_VIEWS
+     * @see #FLAG_INCLUDE_NOT_IMPORTANT_VIEWS
+     * @see #FLAG_REQUEST_TOUCH_EXPLORATION_MODE
      */
     public int flags;
 
@@ -224,11 +237,6 @@
     private boolean mCanRetrieveWindowContent;
 
     /**
-     * Flag whether this accessibility service can handle gestures.
-     */
-    private boolean mCanHandleGestures;
-
-    /**
      * Resource id of the description of the accessibility service.
      */
     private int mDescriptionResId;
@@ -308,8 +316,6 @@
             mCanRetrieveWindowContent = asAttributes.getBoolean(
                     com.android.internal.R.styleable.AccessibilityService_canRetrieveWindowContent,
                     false);
-            mCanHandleGestures = asAttributes.getBoolean(
-                    com.android.internal.R.styleable.AccessibilityService_canHandleGestures, false);
             TypedValue peekedValue = asAttributes.peekValue(
                     com.android.internal.R.styleable.AccessibilityService_description);
             if (peekedValue != null) {
@@ -392,18 +398,6 @@
     }
 
     /**
-     * Whether this service can handle gestures.
-     * <p>
-     *    <strong>Statically set from
-     *    {@link AccessibilityService#SERVICE_META_DATA meta-data}.</strong>
-     * </p>
-     * @return True if the service can handle gestures.
-     */
-    public boolean getCanHandleGestures() {
-        return mCanHandleGestures;
-    }
-
-    /**
      * Gets the non-localized description of the accessibility service.
      * <p>
      *    <strong>Statically set from
@@ -614,8 +608,10 @@
         switch (flag) {
             case DEFAULT:
                 return "DEFAULT";
-            case INCLUDE_NOT_IMPORTANT_VIEWS:
-                return "REGARD_VIEWS_NOT_IMPORTANT_FOR_ACCESSIBILITY";
+            case FLAG_INCLUDE_NOT_IMPORTANT_VIEWS:
+                return "FLAG_INCLUDE_NOT_IMPORTANT_VIEWS";
+            case FLAG_REQUEST_TOUCH_EXPLORATION_MODE:
+                return "FLAG_REQUEST_TOUCH_EXPLORATION_MODE";
             default:
                 return null;
         }
diff --git a/core/java/android/accessibilityservice/UiTestAutomationBridge.java b/core/java/android/accessibilityservice/UiTestAutomationBridge.java
index 4d4bfeb..6837386 100644
--- a/core/java/android/accessibilityservice/UiTestAutomationBridge.java
+++ b/core/java/android/accessibilityservice/UiTestAutomationBridge.java
@@ -83,7 +83,7 @@
      * @return The event.
      */
     public AccessibilityEvent getLastAccessibilityEvent() {
-        return mLastEvent; 
+        return mLastEvent;
     }
 
     /**
@@ -142,7 +142,7 @@
 
             @Override
             public void onInterrupt() {
-                UiTestAutomationBridge.this.onInterrupt();  
+                UiTestAutomationBridge.this.onInterrupt();
             }
 
             @Override
@@ -189,6 +189,7 @@
         final AccessibilityServiceInfo info = new AccessibilityServiceInfo();
         info.eventTypes = AccessibilityEvent.TYPES_ALL_MASK;
         info.feedbackType = AccessibilityServiceInfo.FEEDBACK_GENERIC;
+        info.flags |= AccessibilityServiceInfo.FLAG_INCLUDE_NOT_IMPORTANT_VIEWS;
 
         try {
             manager.registerUiTestAutomationService(mListener, info);
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index 781eea5..ac55abe 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -2493,7 +2493,7 @@
         if (featureId == Window.FEATURE_OPTIONS_PANEL && menu != null) {
             boolean goforit = onPrepareOptionsMenu(menu);
             goforit |= mFragments.dispatchPrepareOptionsMenu(menu);
-            return goforit && menu.hasVisibleItems();
+            return goforit;
         }
         return true;
     }
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index 7746ca9..4e61c3c 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -1078,13 +1078,20 @@
      */
     public static class MemoryInfo implements Parcelable {
         /**
-         * The total available memory on the system.  This number should not
+         * The available memory on the system.  This number should not
          * be considered absolute: due to the nature of the kernel, a significant
          * portion of this memory is actually in use and needed for the overall
          * system to run well.
          */
         public long availMem;
-        
+
+        /**
+         * The total memory accessible by the kernel.  This is basically the
+         * RAM size of the device, not including below-kernel fixed allocations
+         * like DMA buffers, RAM for the baseband CPU, etc.
+         */
+        public long totalMem;
+
         /**
          * The threshold of {@link #availMem} at which we consider memory to be
          * low and start killing background services and other non-extraneous
@@ -1116,6 +1123,7 @@
 
         public void writeToParcel(Parcel dest, int flags) {
             dest.writeLong(availMem);
+            dest.writeLong(totalMem);
             dest.writeLong(threshold);
             dest.writeInt(lowMemory ? 1 : 0);
             dest.writeLong(hiddenAppThreshold);
@@ -1126,6 +1134,7 @@
         
         public void readFromParcel(Parcel source) {
             availMem = source.readLong();
+            totalMem = source.readLong();
             threshold = source.readLong();
             lowMemory = source.readInt() != 0;
             hiddenAppThreshold = source.readLong();
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 314f5c2..e2ebeba 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -2639,6 +2639,7 @@
                     if (DEBUG_CONFIGURATION) Slog.v(TAG, "Resuming activity "
                             + r.activityInfo.name + " with newConfig " + r.newConfig);
                     performConfigurationChanged(r.activity, r.newConfig);
+                    freeTextLayoutCachesIfNeeded(r.activity.mCurrentConfig.diff(r.newConfig));
                     r.newConfig = null;
                 }
                 if (localLOGV) Slog.v(TAG, "Resuming " + r + " with isForward="
@@ -2955,6 +2956,7 @@
                     if (DEBUG_CONFIGURATION) Slog.v(TAG, "Updating activity vis "
                             + r.activityInfo.name + " with new config " + r.newConfig);
                     performConfigurationChanged(r.activity, r.newConfig);
+                    freeTextLayoutCachesIfNeeded(r.activity.mCurrentConfig.diff(r.newConfig));
                     r.newConfig = null;
                 }
             } else {
@@ -3669,6 +3671,7 @@
     final void handleConfigurationChanged(Configuration config, CompatibilityInfo compat) {
 
         ArrayList<ComponentCallbacks2> callbacks = null;
+        int configDiff = 0;
 
         synchronized (mPackages) {
             if (mPendingConfiguration != null) {
@@ -3693,6 +3696,7 @@
             if (!mConfiguration.isOtherSeqNewer(config) && compat == null) {
                 return;
             }
+            configDiff = mConfiguration.diff(config);
             mConfiguration.updateFrom(config);
             config = applyCompatConfiguration();
             callbacks = collectComponentCallbacksLocked(false, config);
@@ -3701,6 +3705,8 @@
         // Cleanup hardware accelerated stuff
         WindowManagerImpl.getDefault().trimLocalMemory();
 
+        freeTextLayoutCachesIfNeeded(configDiff);
+
         if (callbacks != null) {
             final int N = callbacks.size();
             for (int i=0; i<N; i++) {
@@ -3709,6 +3715,17 @@
         }
     }
 
+    final void freeTextLayoutCachesIfNeeded(int configDiff) {
+        if (configDiff != 0) {
+            // Ask text layout engine to free its caches if there is a locale change
+            boolean hasLocaleConfigChange = ((configDiff & ActivityInfo.CONFIG_LOCALE) != 0);
+            if (hasLocaleConfigChange) {
+                Canvas.freeTextLayoutCaches();
+                if (DEBUG_CONFIGURATION) Slog.v(TAG, "Cleared TextLayout Caches");
+            }
+        }
+    }
+
     final void handleActivityConfigurationChanged(IBinder token) {
         ActivityClientRecord r = mActivities.get(token);
         if (r == null || r.activity == null) {
@@ -3719,6 +3736,8 @@
                 + r.activityInfo.name);
         
         performConfigurationChanged(r.activity, mCompatConfiguration);
+
+        freeTextLayoutCachesIfNeeded(r.activity.mCurrentConfig.diff(mCompatConfiguration));
     }
 
     final void handleProfilerControl(boolean start, ProfilerControlData pcd, int profileType) {
@@ -3821,6 +3840,9 @@
         // Ask graphics to free up as much as possible (font/image caches)
         Canvas.freeCaches();
 
+        // Ask text layout engine to free also as much as possible
+        Canvas.freeTextLayoutCaches();
+
         BinderInternal.forceGc("mem");
     }
 
@@ -4256,6 +4278,14 @@
         }
     }
 
+    public final IContentProvider acquireUnstableProvider(Context c, String name) {
+        return acquireProvider(c, name);
+    }
+
+    public final boolean releaseUnstableProvider(IContentProvider provider) {
+        return releaseProvider(provider);
+    }
+
     final void completeRemoveProvider(IContentProvider provider) {
         IBinder jBinder = provider.asBinder();
         String remoteProviderName = null;
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index 64a05a8..299e408 100644
--- a/core/java/android/app/ContextImpl.java
+++ b/core/java/android/app/ContextImpl.java
@@ -387,7 +387,7 @@
                 public Object createService(ContextImpl ctx) {
                     IBinder b = ServiceManager.getService(NSD_SERVICE);
                     INsdManager service = INsdManager.Stub.asInterface(b);
-                    return new NsdManager(service);
+                    return new NsdManager(ctx.getOuterContext(), service);
                 }});
 
         // Note: this was previously cached in a static variable, but
@@ -1692,6 +1692,16 @@
             return mMainThread.releaseProvider(provider);
         }
 
+        @Override
+        protected IContentProvider acquireUnstableProvider(Context c, String name) {
+            return mMainThread.acquireUnstableProvider(c, name);
+        }
+
+        @Override
+        public boolean releaseUnstableProvider(IContentProvider icp) {
+            return mMainThread.releaseUnstableProvider(icp);
+        }
+
         private final ActivityThread mMainThread;
     }
 }
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index f962259..edeeee2 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -796,6 +796,12 @@
         if (this.icon != 0) {
             contentView.setImageViewResource(R.id.icon, this.icon);
         }
+        if (priority < PRIORITY_LOW) {
+            contentView.setInt(R.id.icon,
+                    "setBackgroundResource", R.drawable.notification_template_icon_low_bg);
+            contentView.setInt(R.id.status_bar_latest_event_content,
+                    "setBackgroundResource", R.drawable.notification_bg_low);
+        }
         if (contentTitle != null) {
             contentView.setTextViewText(R.id.title, contentTitle);
         }
@@ -1364,6 +1370,12 @@
                 contentView.setImageViewBitmap(R.id.icon, mLargeIcon);
                 smallIconImageViewId = R.id.right_icon;
             }
+            if (mPriority < PRIORITY_LOW) {
+                contentView.setInt(R.id.icon,
+                        "setBackgroundResource", R.drawable.notification_template_icon_low_bg);
+                contentView.setInt(R.id.status_bar_latest_event_content,
+                        "setBackgroundResource", R.drawable.notification_bg_low);
+            }
             if (mSmallIcon != 0) {
                 contentView.setImageViewResource(smallIconImageViewId, mSmallIcon);
                 contentView.setViewVisibility(smallIconImageViewId, View.VISIBLE);
diff --git a/core/java/android/app/TaskStackBuilder.java b/core/java/android/app/TaskStackBuilder.java
index e546f6c..14c5736 100644
--- a/core/java/android/app/TaskStackBuilder.java
+++ b/core/java/android/app/TaskStackBuilder.java
@@ -196,18 +196,12 @@
         try {
             ActivityInfo info = pm.getActivityInfo(sourceActivityName, 0);
             String parentActivity = info.parentActivityName;
-            Intent parent = new Intent().setComponent(
-                    new ComponentName(info.packageName, parentActivity));
-            while (parent != null) {
+            while (parentActivity != null) {
+                Intent parent = new Intent().setComponent(
+                        new ComponentName(info.packageName, parentActivity));
                 mIntents.add(insertAt, parent);
                 info = pm.getActivityInfo(parent.getComponent(), 0);
                 parentActivity = info.parentActivityName;
-                if (parentActivity != null) {
-                    parent = new Intent().setComponent(
-                            new ComponentName(info.packageName, parentActivity));
-                } else {
-                    parent = null;
-                }
             }
         } catch (NameNotFoundException e) {
             Log.e(TAG, "Bad ComponentName while traversing activity parent metadata");
diff --git a/core/java/android/appwidget/AppWidgetHostView.java b/core/java/android/appwidget/AppWidgetHostView.java
index c9bacba..01b68d4 100644
--- a/core/java/android/appwidget/AppWidgetHostView.java
+++ b/core/java/android/appwidget/AppWidgetHostView.java
@@ -208,8 +208,10 @@
     }
 
     /**
-     * Provide guidance about the size of this widget to the AppWidgetManager. This information
-     * gets embedded into the AppWidgetExtras and causes a callback to the AppWidgetProvider.
+     * Provide guidance about the size of this widget to the AppWidgetManager. The widths and
+     * heights should correspond to the full area the AppWidgetHostView is given. Padding added by
+     * the framework will be accounted for automatically. This information gets embedded into the
+     * AppWidget options and causes a callback to the AppWidgetProvider.
      * @see AppWidgetProvider#onAppWidgetOptionsChanged(Context, AppWidgetManager, int, Bundle)
      *
      * @param options The bundle of options, in addition to the size information,
@@ -225,10 +227,20 @@
         if (options == null) {
             options = new Bundle();
         }
-        options.putInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH, minWidth);
-        options.putInt(AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT, minHeight);
-        options.putInt(AppWidgetManager.OPTION_APPWIDGET_MAX_WIDTH, maxWidth);
-        options.putInt(AppWidgetManager.OPTION_APPWIDGET_MAX_HEIGHT, maxHeight);
+
+        Rect padding = new Rect();
+        if (mInfo != null) {
+            padding = getDefaultPaddingForWidget(mContext, mInfo.provider, padding);
+        }
+        float density = getResources().getDisplayMetrics().density;
+
+        int xPaddingDips = (int) ((padding.left + padding.right) / density);
+        int yPaddingDips = (int) ((padding.top + padding.bottom) / density);
+
+        options.putInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH, minWidth - xPaddingDips);
+        options.putInt(AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT, minHeight - yPaddingDips);
+        options.putInt(AppWidgetManager.OPTION_APPWIDGET_MAX_WIDTH, maxWidth - xPaddingDips);
+        options.putInt(AppWidgetManager.OPTION_APPWIDGET_MAX_HEIGHT, maxHeight - yPaddingDips);
         updateAppWidgetOptions(options);
     }
 
diff --git a/core/java/android/content/AsyncTaskLoader.java b/core/java/android/content/AsyncTaskLoader.java
index da51952..f9025d9 100644
--- a/core/java/android/content/AsyncTaskLoader.java
+++ b/core/java/android/content/AsyncTaskLoader.java
@@ -18,6 +18,7 @@
 
 import android.os.AsyncTask;
 import android.os.Handler;
+import android.os.OperationCanceledException;
 import android.os.SystemClock;
 import android.util.Slog;
 import android.util.TimeUtils;
diff --git a/core/java/android/content/ContentProvider.java b/core/java/android/content/ContentProvider.java
index 1206056..b22179e 100644
--- a/core/java/android/content/ContentProvider.java
+++ b/core/java/android/content/ContentProvider.java
@@ -29,6 +29,9 @@
 import android.os.AsyncTask;
 import android.os.Binder;
 import android.os.Bundle;
+import android.os.CancellationSignal;
+import android.os.ICancellationSignal;
+import android.os.OperationCanceledException;
 import android.os.ParcelFileDescriptor;
 import android.os.Process;
 import android.os.RemoteException;
diff --git a/core/java/android/content/ContentProviderClient.java b/core/java/android/content/ContentProviderClient.java
index 3ac5e07..423f1f6 100644
--- a/core/java/android/content/ContentProviderClient.java
+++ b/core/java/android/content/ContentProviderClient.java
@@ -19,6 +19,8 @@
 import android.database.Cursor;
 import android.net.Uri;
 import android.os.Bundle;
+import android.os.CancellationSignal;
+import android.os.ICancellationSignal;
 import android.os.RemoteException;
 import android.os.ParcelFileDescriptor;
 import android.content.res.AssetFileDescriptor;
@@ -35,13 +37,16 @@
 public class ContentProviderClient {
     private final IContentProvider mContentProvider;
     private final ContentResolver mContentResolver;
+    private final boolean mStable;
 
     /**
      * @hide
      */
-    ContentProviderClient(ContentResolver contentResolver, IContentProvider contentProvider) {
+    ContentProviderClient(ContentResolver contentResolver,
+            IContentProvider contentProvider, boolean stable) {
         mContentProvider = contentProvider;
         mContentResolver = contentResolver;
+        mStable = stable;
     }
 
     /** See {@link ContentProvider#query ContentProvider.query} */
@@ -139,7 +144,11 @@
      * @return true if this was release, false if it was already released
      */
     public boolean release() {
-        return mContentResolver.releaseProvider(mContentProvider);
+        if (mStable) {
+            return mContentResolver.releaseProvider(mContentProvider);
+        } else {
+            return mContentResolver.releaseUnstableProvider(mContentProvider);
+        }
     }
 
     /**
diff --git a/core/java/android/content/ContentProviderNative.java b/core/java/android/content/ContentProviderNative.java
index 4b31552..550a1c9 100644
--- a/core/java/android/content/ContentProviderNative.java
+++ b/core/java/android/content/ContentProviderNative.java
@@ -30,6 +30,7 @@
 import android.os.Bundle;
 import android.os.RemoteException;
 import android.os.IBinder;
+import android.os.ICancellationSignal;
 import android.os.Parcel;
 import android.os.ParcelFileDescriptor;
 import android.os.Parcelable;
diff --git a/core/java/android/content/ContentResolver.java b/core/java/android/content/ContentResolver.java
index 722fdc6..f509fd8 100644
--- a/core/java/android/content/ContentResolver.java
+++ b/core/java/android/content/ContentResolver.java
@@ -33,7 +33,10 @@
 import android.database.IContentObserver;
 import android.net.Uri;
 import android.os.Bundle;
+import android.os.CancellationSignal;
 import android.os.IBinder;
+import android.os.ICancellationSignal;
+import android.os.OperationCanceledException;
 import android.os.ParcelFileDescriptor;
 import android.os.RemoteException;
 import android.os.ServiceManager;
@@ -195,6 +198,10 @@
     }
     /** @hide */
     public abstract boolean releaseProvider(IContentProvider icp);
+    /** @hide */
+    protected abstract IContentProvider acquireUnstableProvider(Context c, String name);
+    /** @hide */
+    public abstract boolean releaseUnstableProvider(IContentProvider icp);
 
     /**
      * Return the MIME type of the given content URL.
@@ -585,34 +592,48 @@
             if ("r".equals(mode)) {
                 return openTypedAssetFileDescriptor(uri, "*/*", null);
             } else {
-                IContentProvider provider = acquireProvider(uri);
-                if (provider == null) {
-                    throw new FileNotFoundException("No content provider: " + uri);
-                }
-                try {
-                    AssetFileDescriptor fd = provider.openAssetFile(uri, mode);
-                    if(fd == null) {
-                        // The provider will be released by the finally{} clause
-                        return null;
+                int n = 0;
+                while (true) {
+                    n++;
+                    IContentProvider provider = acquireUnstableProvider(uri);
+                    if (provider == null) {
+                        throw new FileNotFoundException("No content provider: " + uri);
                     }
-                    ParcelFileDescriptor pfd = new ParcelFileDescriptorInner(
-                            fd.getParcelFileDescriptor(), provider);
+                    try {
+                        AssetFileDescriptor fd = provider.openAssetFile(uri, mode);
+                        if (fd == null) {
+                            // The provider will be released by the finally{} clause
+                            return null;
+                        }
+                        ParcelFileDescriptor pfd = new ParcelFileDescriptorInner(
+                                fd.getParcelFileDescriptor(), provider);
 
-                    // Success!  Don't release the provider when exiting, let
-                    // ParcelFileDescriptorInner do that when it is closed.
-                    provider = null;
+                        // Success!  Don't release the provider when exiting, let
+                        // ParcelFileDescriptorInner do that when it is closed.
+                        provider = null;
 
-                    return new AssetFileDescriptor(pfd, fd.getStartOffset(),
-                            fd.getDeclaredLength());
-                } catch (RemoteException e) {
-                    // Somewhat pointless, as Activity Manager will kill this
-                    // process shortly anyway if the depdendent ContentProvider dies.
-                    throw new FileNotFoundException("Dead content provider: " + uri);
-                } catch (FileNotFoundException e) {
-                    throw e;
-                } finally {
-                    if (provider != null) {
-                        releaseProvider(provider);
+                        return new AssetFileDescriptor(pfd, fd.getStartOffset(),
+                                fd.getDeclaredLength());
+                    } catch (RemoteException e) {
+                        // The provider died for some reason.  Since we are
+                        // acquiring it unstable, its process could have gotten
+                        // killed and need to be restarted.  We'll retry a couple
+                        // times and if still can't succeed then fail.
+                        if (n <= 2) {
+                            try {
+                                Thread.sleep(100);
+                            } catch (InterruptedException e1) {
+                            }
+                            continue;
+                        }
+                        // Whatever, whatever, we'll go away.
+                        throw new FileNotFoundException("Dead content provider: " + uri);
+                    } catch (FileNotFoundException e) {
+                        throw e;
+                    } finally {
+                        if (provider != null) {
+                            releaseUnstableProvider(provider);
+                        }
                     }
                 }
             }
@@ -649,32 +670,48 @@
      */
     public final AssetFileDescriptor openTypedAssetFileDescriptor(Uri uri,
             String mimeType, Bundle opts) throws FileNotFoundException {
-        IContentProvider provider = acquireProvider(uri);
-        if (provider == null) {
-            throw new FileNotFoundException("No content provider: " + uri);
-        }
-        try {
-            AssetFileDescriptor fd = provider.openTypedAssetFile(uri, mimeType, opts);
-            if (fd == null) {
-                // The provider will be released by the finally{} clause
-                return null;
+        int n = 0;
+        while (true) {
+            n++;
+            IContentProvider provider = acquireUnstableProvider(uri);
+            if (provider == null) {
+                throw new FileNotFoundException("No content provider: " + uri);
             }
-            ParcelFileDescriptor pfd = new ParcelFileDescriptorInner(
-                    fd.getParcelFileDescriptor(), provider);
+            try {
+                AssetFileDescriptor fd = provider.openTypedAssetFile(uri, mimeType, opts);
+                if (fd == null) {
+                    // The provider will be released by the finally{} clause
+                    return null;
+                }
+                ParcelFileDescriptor pfd = new ParcelFileDescriptorInner(
+                        fd.getParcelFileDescriptor(), provider);
 
-            // Success!  Don't release the provider when exiting, let
-            // ParcelFileDescriptorInner do that when it is closed.
-            provider = null;
+                // Success!  Don't release the provider when exiting, let
+                // ParcelFileDescriptorInner do that when it is closed.
+                provider = null;
 
-            return new AssetFileDescriptor(pfd, fd.getStartOffset(),
-                    fd.getDeclaredLength());
-        } catch (RemoteException e) {
-            throw new FileNotFoundException("Dead content provider: " + uri);
-        } catch (FileNotFoundException e) {
-            throw e;
-        } finally {
-            if (provider != null) {
-                releaseProvider(provider);
+                return new AssetFileDescriptor(pfd, fd.getStartOffset(),
+                        fd.getDeclaredLength());
+            } catch (RemoteException e) {
+                // The provider died for some reason.  Since we are
+                // acquiring it unstable, its process could have gotten
+                // killed and need to be restarted.  We'll retry a couple
+                // times and if still can't succeed then fail.
+                if (n <= 2) {
+                    try {
+                        Thread.sleep(100);
+                    } catch (InterruptedException e1) {
+                    }
+                    continue;
+                }
+                // Whatever, whatever, we'll go away.
+                throw new FileNotFoundException("Dead content provider: " + uri);
+            } catch (FileNotFoundException e) {
+                throw e;
+            } finally {
+                if (provider != null) {
+                    releaseUnstableProvider(provider);
+                }
             }
         }
     }
@@ -1000,6 +1037,34 @@
     }
 
     /**
+     * Returns the content provider for the given content URI.
+     *
+     * @param uri The URI to a content provider
+     * @return The ContentProvider for the given URI, or null if no content provider is found.
+     * @hide
+     */
+    public final IContentProvider acquireUnstableProvider(Uri uri) {
+        if (!SCHEME_CONTENT.equals(uri.getScheme())) {
+            return null;
+        }
+        String auth = uri.getAuthority();
+        if (auth != null) {
+            return acquireUnstableProvider(mContext, uri.getAuthority());
+        }
+        return null;
+    }
+
+    /**
+     * @hide
+     */
+    public final IContentProvider acquireUnstableProvider(String name) {
+        if (name == null) {
+            return null;
+        }
+        return acquireProvider(mContext, name);
+    }
+
+    /**
      * Returns a {@link ContentProviderClient} that is associated with the {@link ContentProvider}
      * that services the content at uri, starting the provider if necessary. Returns
      * null if there is no provider associated wih the uri. The caller must indicate that they are
@@ -1013,7 +1078,7 @@
     public final ContentProviderClient acquireContentProviderClient(Uri uri) {
         IContentProvider provider = acquireProvider(uri);
         if (provider != null) {
-            return new ContentProviderClient(this, provider);
+            return new ContentProviderClient(this, provider, true);
         }
 
         return null;
@@ -1033,7 +1098,47 @@
     public final ContentProviderClient acquireContentProviderClient(String name) {
         IContentProvider provider = acquireProvider(name);
         if (provider != null) {
-            return new ContentProviderClient(this, provider);
+            return new ContentProviderClient(this, provider, true);
+        }
+
+        return null;
+    }
+
+    /**
+     * Like {@link #acquireContentProviderClient(Uri)}, but for use when you do
+     * not trust the stability of the target content provider.  This turns off
+     * the mechanism in the platform clean up processes that are dependent on
+     * a content provider if that content provider's process goes away.  Normally
+     * you can safely assume that once you have acquired a provider, you can freely
+     * use it as needed and it won't disappear, even if your process is in the
+     * background.  If using this method, you need to take care to deal with any
+     * failures when communicating with the provider, and be sure to close it
+     * so that it can be re-opened later.
+     */
+    public final ContentProviderClient acquireUnstableContentProviderClient(Uri uri) {
+        IContentProvider provider = acquireProvider(uri);
+        if (provider != null) {
+            return new ContentProviderClient(this, provider, false);
+        }
+
+        return null;
+    }
+
+    /**
+     * Like {@link #acquireContentProviderClient(String)}, but for use when you do
+     * not trust the stability of the target content provider.  This turns off
+     * the mechanism in the platform clean up processes that are dependent on
+     * a content provider if that content provider's process goes away.  Normally
+     * you can safely assume that once you have acquired a provider, you can freely
+     * use it as needed and it won't disappear, even if your process is in the
+     * background.  If using this method, you need to take care to deal with any
+     * failures when communicating with the provider, and be sure to close it
+     * so that it can be re-opened later.
+     */
+    public final ContentProviderClient acquireUnstableContentProviderClient(String name) {
+        IContentProvider provider = acquireProvider(name);
+        if (provider != null) {
+            return new ContentProviderClient(this, provider, false);
         }
 
         return null;
@@ -1687,7 +1792,7 @@
         public void close() throws IOException {
             if(!mReleaseProviderFlag) {
                 super.close();
-                ContentResolver.this.releaseProvider(mContentProvider);
+                ContentResolver.this.releaseUnstableProvider(mContentProvider);
                 mReleaseProviderFlag = true;
             }
         }
diff --git a/core/java/android/content/CursorLoader.java b/core/java/android/content/CursorLoader.java
index aed3728..9f7a104 100644
--- a/core/java/android/content/CursorLoader.java
+++ b/core/java/android/content/CursorLoader.java
@@ -19,6 +19,8 @@
 import android.database.ContentObserver;
 import android.database.Cursor;
 import android.net.Uri;
+import android.os.CancellationSignal;
+import android.os.OperationCanceledException;
 
 import java.io.FileDescriptor;
 import java.io.PrintWriter;
diff --git a/core/java/android/content/IContentProvider.java b/core/java/android/content/IContentProvider.java
index 16478b7..eeba1e0 100644
--- a/core/java/android/content/IContentProvider.java
+++ b/core/java/android/content/IContentProvider.java
@@ -21,6 +21,7 @@
 import android.net.Uri;
 import android.os.Bundle;
 import android.os.IBinder;
+import android.os.ICancellationSignal;
 import android.os.IInterface;
 import android.os.ParcelFileDescriptor;
 import android.os.RemoteException;
diff --git a/core/java/android/content/SyncStorageEngine.java b/core/java/android/content/SyncStorageEngine.java
index 6c7e940..226e107 100644
--- a/core/java/android/content/SyncStorageEngine.java
+++ b/core/java/android/content/SyncStorageEngine.java
@@ -197,6 +197,29 @@
         long delayUntil;
         final ArrayList<Pair<Bundle, Long>> periodicSyncs;
 
+        /**
+         * Copy constructor for making deep-ish copies. Only the bundles stored
+         * in periodic syncs can make unexpected changes.
+         *
+         * @param toCopy AuthorityInfo to be copied.
+         */
+        AuthorityInfo(AuthorityInfo toCopy) {
+            account = toCopy.account;
+            userId = toCopy.userId;
+            authority = toCopy.authority;
+            ident = toCopy.ident;
+            enabled = toCopy.enabled;
+            syncable = toCopy.syncable;
+            backoffTime = toCopy.backoffTime;
+            backoffDelay = toCopy.backoffDelay;
+            delayUntil = toCopy.delayUntil;
+            periodicSyncs = new ArrayList<Pair<Bundle, Long>>();
+            for (Pair<Bundle, Long> sync : toCopy.periodicSyncs) {
+                // Still not a perfect copy, because we are just copying the mappings.
+                periodicSyncs.add(Pair.create(new Bundle(sync.first), sync.second));
+            }
+        }
+
         AuthorityInfo(Account account, int userId, String authority, int ident) {
             this.account = account;
             this.userId = userId;
@@ -1212,7 +1235,8 @@
             final int N = mAuthorities.size();
             ArrayList<AuthorityInfo> infos = new ArrayList<AuthorityInfo>(N);
             for (int i=0; i<N; i++) {
-                infos.add(mAuthorities.valueAt(i));
+                // Make deep copy because AuthorityInfo syncs are liable to change.
+                infos.add(new AuthorityInfo(mAuthorities.valueAt(i)));
             }
             return infos;
         }
diff --git a/core/java/android/content/res/AssetFileDescriptor.java b/core/java/android/content/res/AssetFileDescriptor.java
index 9893133..7d46710 100644
--- a/core/java/android/content/res/AssetFileDescriptor.java
+++ b/core/java/android/content/res/AssetFileDescriptor.java
@@ -52,6 +52,9 @@
      */
     public AssetFileDescriptor(ParcelFileDescriptor fd, long startOffset,
             long length) {
+        if (fd == null) {
+            throw new IllegalArgumentException("fd must not be null");
+        }
         if (length < 0 && startOffset != 0) {
             throw new IllegalArgumentException(
                     "startOffset must be 0 when using UNKNOWN_LENGTH");
diff --git a/core/java/android/database/AbstractCursor.java b/core/java/android/database/AbstractCursor.java
index dd6692c..fb04817 100644
--- a/core/java/android/database/AbstractCursor.java
+++ b/core/java/android/database/AbstractCursor.java
@@ -44,14 +44,20 @@
     /**
      * This must be set to the index of the row ID column by any
      * subclass that wishes to support updates.
+     *
+     * @deprecated This field should not be used.
      */
+    @Deprecated
     protected int mRowIdColumnIndex;
 
     /**
      * If {@link #mRowIdColumnIndex} is not -1 this contains contains the value of
      * the column at {@link #mRowIdColumnIndex} for the current row this cursor is
      * pointing at.
+     *
+     * @deprecated This field should not be used.
      */
+    @Deprecated
     protected Long mCurrentRowID;
 
     protected boolean mClosed;
@@ -62,8 +68,8 @@
     private ContentObserver mSelfObserver;
     private boolean mSelfObserverRegistered;
 
-    private DataSetObservable mDataSetObservable = new DataSetObservable();
-    private ContentObservable mContentObservable = new ContentObservable();
+    private final DataSetObservable mDataSetObservable = new DataSetObservable();
+    private final ContentObservable mContentObservable = new ContentObservable();
 
     private Bundle mExtras = Bundle.EMPTY;
 
diff --git a/core/java/android/database/DatabaseUtils.java b/core/java/android/database/DatabaseUtils.java
index 40a54cf..a6af5c2 100644
--- a/core/java/android/database/DatabaseUtils.java
+++ b/core/java/android/database/DatabaseUtils.java
@@ -21,7 +21,6 @@
 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;
@@ -31,6 +30,7 @@
 import android.database.sqlite.SQLiteFullException;
 import android.database.sqlite.SQLiteProgram;
 import android.database.sqlite.SQLiteStatement;
+import android.os.OperationCanceledException;
 import android.os.Parcel;
 import android.os.ParcelFileDescriptor;
 import android.text.TextUtils;
diff --git a/core/java/android/database/sqlite/SQLiteConnection.java b/core/java/android/database/sqlite/SQLiteConnection.java
index acdc488..6f7c1f3 100644
--- a/core/java/android/database/sqlite/SQLiteConnection.java
+++ b/core/java/android/database/sqlite/SQLiteConnection.java
@@ -19,12 +19,12 @@
 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.CancellationSignal;
+import android.os.OperationCanceledException;
 import android.os.ParcelFileDescriptor;
 import android.util.Log;
 import android.util.LruCache;
diff --git a/core/java/android/database/sqlite/SQLiteConnectionPool.java b/core/java/android/database/sqlite/SQLiteConnectionPool.java
index a175662..3a1714c 100644
--- a/core/java/android/database/sqlite/SQLiteConnectionPool.java
+++ b/core/java/android/database/sqlite/SQLiteConnectionPool.java
@@ -18,9 +18,9 @@
 
 import dalvik.system.CloseGuard;
 
-import android.content.CancellationSignal;
-import android.content.OperationCanceledException;
 import android.database.sqlite.SQLiteDebug.DbStats;
+import android.os.CancellationSignal;
+import android.os.OperationCanceledException;
 import android.os.SystemClock;
 import android.util.Log;
 import android.util.PrefixPrinter;
diff --git a/core/java/android/database/sqlite/SQLiteDatabase.java b/core/java/android/database/sqlite/SQLiteDatabase.java
index 7bd0c8d..e2d44f2 100644
--- a/core/java/android/database/sqlite/SQLiteDatabase.java
+++ b/core/java/android/database/sqlite/SQLiteDatabase.java
@@ -16,16 +16,16 @@
 
 package android.database.sqlite;
 
-import android.content.CancellationSignal;
 import android.content.ContentValues;
-import android.content.OperationCanceledException;
 import android.database.Cursor;
 import android.database.DatabaseErrorHandler;
 import android.database.DatabaseUtils;
 import android.database.DefaultDatabaseErrorHandler;
 import android.database.SQLException;
 import android.database.sqlite.SQLiteDebug.DbStats;
+import android.os.CancellationSignal;
 import android.os.Looper;
+import android.os.OperationCanceledException;
 import android.text.TextUtils;
 import android.util.EventLog;
 import android.util.Log;
diff --git a/core/java/android/database/sqlite/SQLiteDirectCursorDriver.java b/core/java/android/database/sqlite/SQLiteDirectCursorDriver.java
index 294edc4..797430a 100644
--- a/core/java/android/database/sqlite/SQLiteDirectCursorDriver.java
+++ b/core/java/android/database/sqlite/SQLiteDirectCursorDriver.java
@@ -16,9 +16,9 @@
 
 package android.database.sqlite;
 
-import android.content.CancellationSignal;
 import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase.CursorFactory;
+import android.os.CancellationSignal;
 
 /**
  * A cursor driver that uses the given query directly.
diff --git a/core/java/android/database/sqlite/SQLiteProgram.java b/core/java/android/database/sqlite/SQLiteProgram.java
index e9b06c6..26e8c31 100644
--- a/core/java/android/database/sqlite/SQLiteProgram.java
+++ b/core/java/android/database/sqlite/SQLiteProgram.java
@@ -16,8 +16,8 @@
 
 package android.database.sqlite;
 
-import android.content.CancellationSignal;
 import android.database.DatabaseUtils;
+import android.os.CancellationSignal;
 
 import java.util.Arrays;
 
diff --git a/core/java/android/database/sqlite/SQLiteQuery.java b/core/java/android/database/sqlite/SQLiteQuery.java
index 30e77b5..62bcc20 100644
--- a/core/java/android/database/sqlite/SQLiteQuery.java
+++ b/core/java/android/database/sqlite/SQLiteQuery.java
@@ -16,9 +16,9 @@
 
 package android.database.sqlite;
 
-import android.content.CancellationSignal;
-import android.content.OperationCanceledException;
 import android.database.CursorWindow;
+import android.os.CancellationSignal;
+import android.os.OperationCanceledException;
 import android.util.Log;
 
 /**
diff --git a/core/java/android/database/sqlite/SQLiteQueryBuilder.java b/core/java/android/database/sqlite/SQLiteQueryBuilder.java
index 6f84b5e..91884ab 100644
--- a/core/java/android/database/sqlite/SQLiteQueryBuilder.java
+++ b/core/java/android/database/sqlite/SQLiteQueryBuilder.java
@@ -16,10 +16,10 @@
 
 package android.database.sqlite;
 
-import android.content.CancellationSignal;
-import android.content.OperationCanceledException;
 import android.database.Cursor;
 import android.database.DatabaseUtils;
+import android.os.CancellationSignal;
+import android.os.OperationCanceledException;
 import android.provider.BaseColumns;
 import android.text.TextUtils;
 import android.util.Log;
diff --git a/core/java/android/database/sqlite/SQLiteSession.java b/core/java/android/database/sqlite/SQLiteSession.java
index 9410243..beb5b3a 100644
--- a/core/java/android/database/sqlite/SQLiteSession.java
+++ b/core/java/android/database/sqlite/SQLiteSession.java
@@ -16,10 +16,10 @@
 
 package android.database.sqlite;
 
-import android.content.CancellationSignal;
-import android.content.OperationCanceledException;
 import android.database.CursorWindow;
 import android.database.DatabaseUtils;
+import android.os.CancellationSignal;
+import android.os.OperationCanceledException;
 import android.os.ParcelFileDescriptor;
 
 /**
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java
index 332f40a..33dea6c 100644
--- a/core/java/android/inputmethodservice/InputMethodService.java
+++ b/core/java/android/inputmethodservice/InputMethodService.java
@@ -402,7 +402,7 @@
             mShowInputFlags = 0;
             mShowInputRequested = false;
             mShowInputForced = false;
-            hideWindow();
+            doHideWindow();
             if (resultReceiver != null) {
                 resultReceiver.send(wasVis != isInputViewShown()
                         ? InputMethodManager.RESULT_HIDDEN
@@ -737,7 +737,7 @@
                         onDisplayCompletions(completions);
                     }
                 } else {
-                    hideWindow();
+                    doHideWindow();
                 }
             } else if (mCandidatesVisibility == View.VISIBLE) {
                 // If the candidates are currently visible, make sure the
@@ -745,7 +745,7 @@
                 showWindow(false);
             } else {
                 // Otherwise hide the window.
-                hideWindow();
+                doHideWindow();
             }
             // If user uses hard keyboard, IME button should always be shown.
             boolean showing = onEvaluateInputViewShown();
@@ -1096,7 +1096,7 @@
             if (shown) {
                 showWindow(false);
             } else {
-                hideWindow();
+                doHideWindow();
             }
         }
     }
@@ -1449,9 +1449,13 @@
         mCandidatesViewStarted = false;
     }
 
+    private void doHideWindow() {
+        mImm.setImeWindowStatus(mToken, 0, mBackDisposition);
+        hideWindow();
+    }
+
     public void hideWindow() {
         finishViews();
-        mImm.setImeWindowStatus(mToken, 0, mBackDisposition);
         if (mWindowVisible) {
             mWindow.hide();
             mWindowVisible = false;
@@ -1703,7 +1707,7 @@
                 // If we have the window visible for some other reason --
                 // most likely to show candidates -- then just get rid
                 // of it.  This really shouldn't happen, but just in case...
-                if (doIt) hideWindow();
+                if (doIt) doHideWindow();
             }
             return true;
         }
diff --git a/core/java/android/net/nsd/DnsSdTxtRecord.java b/core/java/android/net/nsd/DnsSdTxtRecord.java
index ccb9a91..2f20d44 100644
--- a/core/java/android/net/nsd/DnsSdTxtRecord.java
+++ b/core/java/android/net/nsd/DnsSdTxtRecord.java
@@ -36,6 +36,7 @@
  *
  * The DnsSdTxtRecord object stores the entire TXT data as a single byte array, traversing it
  * as need be to implement its various methods.
+ * @hide
  *
  */
 public class DnsSdTxtRecord implements Parcelable {
diff --git a/core/java/android/net/nsd/NetworkServiceInfo.java b/core/java/android/net/nsd/NetworkServiceInfo.java
deleted file mode 100644
index 34d83d1..0000000
--- a/core/java/android/net/nsd/NetworkServiceInfo.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.net.nsd;
-
-/**
- * Interface for a network service.
- *
- * {@hide}
- */
-public interface NetworkServiceInfo {
-
-    String getServiceName();
-    void setServiceName(String s);
-
-    String getServiceType();
-    void setServiceType(String s);
-
-}
diff --git a/core/java/android/net/nsd/NsdManager.java b/core/java/android/net/nsd/NsdManager.java
index 77e97e1..08ba728 100644
--- a/core/java/android/net/nsd/NsdManager.java
+++ b/core/java/android/net/nsd/NsdManager.java
@@ -22,12 +22,16 @@
 import android.os.Binder;
 import android.os.IBinder;
 import android.os.Handler;
+import android.os.HandlerThread;
 import android.os.Looper;
 import android.os.Message;
 import android.os.RemoteException;
 import android.os.Messenger;
 import android.text.TextUtils;
 import android.util.Log;
+import android.util.SparseArray;
+
+import java.util.concurrent.CountDownLatch;
 
 import com.android.internal.util.AsyncChannel;
 import com.android.internal.util.Protocol;
@@ -39,88 +43,73 @@
  * B. Another example use case is an application discovering printers on the network.
  *
  * <p> The API currently supports DNS based service discovery and discovery is currently
- * limited to a local network over Multicast DNS. In future, it will be extended to
- * support wide area discovery and other service discovery mechanisms.
- * DNS service discovery is described at http://files.dns-sd.org/draft-cheshire-dnsext-dns-sd.txt
+ * limited to a local network over Multicast DNS. DNS service discovery is described at
+ * http://files.dns-sd.org/draft-cheshire-dnsext-dns-sd.txt
  *
  * <p> The API is asynchronous and responses to requests from an application are on listener
- * callbacks provided by the application. The application must invoke {@link #initialize} before
- * doing any other operation.
+ * callbacks on a seperate thread.
  *
  * <p> There are three main operations the API supports - registration, discovery and resolution.
  * <pre>
  *                          Application start
  *                                 |
- *                                 |         <----------------------------------------------
- *                             initialize()                                                 |
- *                                 |                                                        |
- *                                 | Wait until channel connects                            |
- *                                 | before doing any operation                             |
- *                                 |                                                        |
- *                           onChannelConnected()                    __________             |
- *                                 |                                           |            |
- *                                 |                                           |            |
- *                                 |                  onServiceRegistered()    |            |
- *                     Register any local services  /                          |            |
- *                      to be advertised with       \                          |            | If application needs to
- *                       registerService()            onFailure()              |            | do any further operations
- *                                 |                                           |            | again, it needs to
- *                                 |                                           |            | initialize() connection
- *                          discoverServices()                                 |            | to framework again
- *                                 |                                           |            |
- *                      Maintain a list to track                               |            |
- *                        discovered services                                  |            |
- *                                 |                                           |            |
- *                                 |--------->                                 |-> onChannelDisconnected()
- *                                 |          |                                |
- *                                 |      onServiceFound()                     |
- *                                 |          |                                |
- *                                 |     add service to list                   |
- *                                 |          |                                |
- *                                 |<----------                                |
- *                                 |                                           |
- *                                 |--------->                                 |
- *                                 |          |                                |
- *                                 |      onServiceLost()                      |
- *                                 |          |                                |
- *                                 |   remove service from list                |
- *                                 |          |                                |
- *                                 |<----------                                |
- *                                 |                                           |
- *                                 |                                           |
- *                                 | Connect to a service                      |
- *                                 | from list ?                               |
- *                                 |                                           |
- *                          resolveService()                                   |
- *                                 |                                           |
- *                         onServiceResolved()                                 |
- *                                 |                                           |
- *                     Establish connection to service                         |
- *                     with the host and port information                      |
- *                                 |                                           |
- *                                 |                                ___________|
- *                           deinitialize()
- *                    when done with all operations
- *                          or before quit
+ *                                 |
+ *                                 |                  onServiceRegistered()
+ *                     Register any local services  /
+ *                      to be advertised with       \
+ *                       registerService()            onRegistrationFailed()
+ *                                 |
+ *                                 |
+ *                          discoverServices()
+ *                                 |
+ *                      Maintain a list to track
+ *                        discovered services
+ *                                 |
+ *                                 |--------->
+ *                                 |          |
+ *                                 |      onServiceFound()
+ *                                 |          |
+ *                                 |     add service to list
+ *                                 |          |
+ *                                 |<----------
+ *                                 |
+ *                                 |--------->
+ *                                 |          |
+ *                                 |      onServiceLost()
+ *                                 |          |
+ *                                 |   remove service from list
+ *                                 |          |
+ *                                 |<----------
+ *                                 |
+ *                                 |
+ *                                 | Connect to a service
+ *                                 | from list ?
+ *                                 |
+ *                          resolveService()
+ *                                 |
+ *                         onServiceResolved()
+ *                                 |
+ *                     Establish connection to service
+ *                     with the host and port information
  *
  * </pre>
  * An application that needs to advertise itself over a network for other applications to
  * discover it can do so with a call to {@link #registerService}. If Example is a http based
  * application that can provide HTML data to peer services, it can register a name "Example"
  * with service type "_http._tcp". A successful registration is notified with a callback to
- * {@link DnsSdRegisterListener#onServiceRegistered} and a failure to register is notified
- * over {@link DnsSdRegisterListener#onFailure}
+ * {@link RegistrationListener#onServiceRegistered} and a failure to register is notified
+ * over {@link RegistrationListener#onRegistrationFailed}
  *
  * <p> A peer application looking for http services can initiate a discovery for "_http._tcp"
  * with a call to {@link #discoverServices}. A service found is notified with a callback
- * to {@link DnsSdDiscoveryListener#onServiceFound} and a service lost is notified on
- * {@link DnsSdDiscoveryListener#onServiceLost}.
+ * to {@link DiscoveryListener#onServiceFound} and a service lost is notified on
+ * {@link DiscoveryListener#onServiceLost}.
  *
  * <p> Once the peer application discovers the "Example" http srevice, and needs to receive data
  * from the "Example" application, it can initiate a resolve with {@link #resolveService} to
  * resolve the host and port details for the purpose of establishing a connection. A successful
- * resolve is notified on {@link DnsSdResolveListener#onServiceResolved} and a failure is notified
- * on {@link DnsSdResolveListener#onFailure}.
+ * resolve is notified on {@link ResolveListener#onServiceResolved} and a failure is notified
+ * on {@link ResolveListener#onResolveFailed}.
  *
  * Applications can reserve for a service type at
  * http://www.iana.org/form/ports-service. Existing services can be found at
@@ -129,9 +118,9 @@
  * Get an instance of this class by calling {@link android.content.Context#getSystemService(String)
  * Context.getSystemService(Context.NSD_SERVICE)}.
  *
- * {@see DnsSdServiceInfo}
+ * {@see NsdServiceInfo}
  */
-public class NsdManager {
+public final class NsdManager {
     private static final String TAG = "NsdManager";
     INsdManager mService;
 
@@ -204,13 +193,6 @@
     public static final int UNREGISTER_SERVICE_SUCCEEDED            = BASE + 14;
 
     /** @hide */
-    public static final int UPDATE_SERVICE                          = BASE + 15;
-    /** @hide */
-    public static final int UPDATE_SERVICE_FAILED                   = BASE + 16;
-    /** @hide */
-    public static final int UPDATE_SERVICE_SUCCEEDED                = BASE + 17;
-
-    /** @hide */
     public static final int RESOLVE_SERVICE                         = BASE + 18;
     /** @hide */
     public static final int RESOLVE_SERVICE_FAILED                  = BASE + 19;
@@ -218,17 +200,27 @@
     public static final int RESOLVE_SERVICE_SUCCEEDED               = BASE + 20;
 
     /** @hide */
-    public static final int STOP_RESOLVE                            = BASE + 21;
-    /** @hide */
-    public static final int STOP_RESOLVE_FAILED                     = BASE + 22;
-    /** @hide */
-    public static final int STOP_RESOLVE_SUCCEEDED                  = BASE + 23;
-
-    /** @hide */
     public static final int ENABLE                                  = BASE + 24;
     /** @hide */
     public static final int DISABLE                                 = BASE + 25;
 
+    /** @hide */
+    public static final int NATIVE_DAEMON_EVENT                     = BASE + 26;
+
+    /** Dns based service discovery protocol */
+    public static final int PROTOCOL_DNS_SD = 0x0001;
+
+    private Context mContext;
+
+    private static final int INVALID_LISTENER_KEY = 0;
+    private int mListenerKey = 1;
+    private final SparseArray mListenerMap = new SparseArray();
+    private final SparseArray<NsdServiceInfo> mServiceMap = new SparseArray<NsdServiceInfo>();
+    private final Object mMapLock = new Object();
+
+    private final AsyncChannel mAsyncChannel = new AsyncChannel();
+    private ServiceHandler mHandler;
+    private final CountDownLatch mConnected = new CountDownLatch(1);
 
     /**
      * Create a new Nsd instance. Applications use
@@ -238,271 +230,213 @@
      * @hide - hide this because it takes in a parameter of type INsdManager, which
      * is a system private class.
      */
-    public NsdManager(INsdManager service) {
+    public NsdManager(Context context, INsdManager service) {
         mService = service;
+        mContext = context;
+        init();
     }
 
     /**
-     * Passed with onFailure() calls.
+     * Failures are passed with {@link RegistrationListener#onRegistrationFailed},
+     * {@link RegistrationListener#onUnregistrationFailed},
+     * {@link DiscoveryListener#onStartDiscoveryFailed},
+     * {@link DiscoveryListener#onStopDiscoveryFailed} or {@link ResolveListener#onResolveFailed}.
+     *
      * Indicates that the operation failed due to an internal error.
      */
-    public static final int ERROR               = 0;
+    public static final int FAILURE_INTERNAL_ERROR               = 0;
 
     /**
-     * Passed with onFailure() calls.
-     * Indicates that the operation failed because service discovery
-     * is unsupported on the device.
-     */
-    public static final int UNSUPPORTED         = 1;
-
-    /**
-     * Passed with onFailure() calls.
-     * Indicates that the operation failed because the framework is
-     * busy and unable to service the request.
-     */
-    public static final int BUSY                = 2;
-
-    /**
-     * Passed with onFailure() calls.
      * Indicates that the operation failed because it is already active.
      */
-    public static final int ALREADY_ACTIVE      = 3;
+    public static final int FAILURE_ALREADY_ACTIVE              = 3;
 
     /**
-     * Passed with onFailure() calls.
-     * Indicates that the operation failed because maximum limit on
-     * service registrations has reached.
+     * Indicates that the operation failed because the maximum outstanding
+     * requests from the applications have reached.
      */
-    public static final int MAX_REGS_REACHED    = 4;
-
-    /** Interface for callback invocation when framework channel is connected or lost */
-    public interface ChannelListener {
-       /**
-         * The channel to the framework is connected.
-         * Application can initiate calls into the framework using the channel instance passed.
-         */
-        public void onChannelConnected(Channel c);
-        /**
-         * The channel to the framework has been disconnected.
-         * Application could try re-initializing using {@link #initialize}
-         */
-        public void onChannelDisconnected();
-    }
-
-    /** Generic interface for callback invocation for a success or failure */
-    public interface ActionListener {
-
-        public void onFailure(int errorCode);
-
-        public void onSuccess();
-    }
+    public static final int FAILURE_MAX_LIMIT                   = 4;
 
     /** Interface for callback invocation for service discovery */
-    public interface DnsSdDiscoveryListener {
+    public interface DiscoveryListener {
 
-        public void onFailure(int errorCode);
+        public void onStartDiscoveryFailed(String serviceType, int errorCode);
 
-        public void onStarted(String serviceType);
+        public void onStopDiscoveryFailed(String serviceType, int errorCode);
 
-        public void onServiceFound(DnsSdServiceInfo serviceInfo);
+        public void onDiscoveryStarted(String serviceType);
 
-        public void onServiceLost(DnsSdServiceInfo serviceInfo);
+        public void onDiscoveryStopped(String serviceType);
+
+        public void onServiceFound(NsdServiceInfo serviceInfo);
+
+        public void onServiceLost(NsdServiceInfo serviceInfo);
 
     }
 
     /** Interface for callback invocation for service registration */
-    public interface DnsSdRegisterListener {
+    public interface RegistrationListener {
 
-        public void onFailure(int errorCode);
+        public void onRegistrationFailed(NsdServiceInfo serviceInfo, int errorCode);
 
-        public void onServiceRegistered(int registeredId, DnsSdServiceInfo serviceInfo);
-    }
+        public void onUnregistrationFailed(NsdServiceInfo serviceInfo, int errorCode);
 
-    /** @hide */
-    public interface DnsSdUpdateRegistrationListener {
+        public void onServiceRegistered(NsdServiceInfo serviceInfo);
 
-        public void onFailure(int errorCode);
-
-        public void onServiceUpdated(int registeredId, DnsSdTxtRecord txtRecord);
+        public void onServiceUnregistered(NsdServiceInfo serviceInfo);
     }
 
     /** Interface for callback invocation for service resolution */
-    public interface DnsSdResolveListener {
+    public interface ResolveListener {
 
-        public void onFailure(int errorCode);
+        public void onResolveFailed(NsdServiceInfo serviceInfo, int errorCode);
 
-        public void onServiceResolved(DnsSdServiceInfo serviceInfo);
+        public void onServiceResolved(NsdServiceInfo serviceInfo);
     }
 
-    /**
-     * A channel that connects the application to the NetworkService framework.
-     * Most service operations require a Channel as an argument. An instance of Channel is obtained
-     * by doing a call on {@link #initialize}
-     */
-    public static class Channel {
-        Channel(Looper looper, ChannelListener l) {
-            mAsyncChannel = new AsyncChannel();
-            mHandler = new ServiceHandler(looper);
-            mChannelListener = l;
+    private class ServiceHandler extends Handler {
+        ServiceHandler(Looper looper) {
+            super(looper);
         }
-        private ChannelListener mChannelListener;
-        private DnsSdDiscoveryListener mDnsSdDiscoveryListener;
-        private ActionListener mDnsSdStopDiscoveryListener;
-        private DnsSdRegisterListener mDnsSdRegisterListener;
-        private ActionListener mDnsSdUnregisterListener;
-        private DnsSdUpdateRegistrationListener mDnsSdUpdateListener;
-        private DnsSdResolveListener mDnsSdResolveListener;
-        private ActionListener mDnsSdStopResolveListener;
 
-        private AsyncChannel mAsyncChannel;
-        private ServiceHandler mHandler;
-        class ServiceHandler extends Handler {
-            ServiceHandler(Looper looper) {
-                super(looper);
+        @Override
+        public void handleMessage(Message message) {
+            Object listener = getListener(message.arg2);
+            boolean listenerRemove = true;
+            switch (message.what) {
+                case AsyncChannel.CMD_CHANNEL_HALF_CONNECTED:
+                    mAsyncChannel.sendMessage(AsyncChannel.CMD_CHANNEL_FULL_CONNECTION);
+                    mConnected.countDown();
+                    break;
+                case AsyncChannel.CMD_CHANNEL_FULLY_CONNECTED:
+                    // Ignore
+                    break;
+                case AsyncChannel.CMD_CHANNEL_DISCONNECTED:
+                    Log.e(TAG, "Channel lost");
+                    break;
+                case DISCOVER_SERVICES_STARTED:
+                    String s = ((NsdServiceInfo) message.obj).getServiceType();
+                    ((DiscoveryListener) listener).onDiscoveryStarted(s);
+                    // Keep listener until stop discovery
+                    listenerRemove = false;
+                    break;
+                case DISCOVER_SERVICES_FAILED:
+                    ((DiscoveryListener) listener).onStartDiscoveryFailed(
+                            getNsdService(message.arg2).getServiceType(), message.arg1);
+                    break;
+                case SERVICE_FOUND:
+                    ((DiscoveryListener) listener).onServiceFound((NsdServiceInfo) message.obj);
+                    // Keep listener until stop discovery
+                    listenerRemove = false;
+                    break;
+                case SERVICE_LOST:
+                    ((DiscoveryListener) listener).onServiceLost((NsdServiceInfo) message.obj);
+                    // Keep listener until stop discovery
+                    listenerRemove = false;
+                    break;
+                case STOP_DISCOVERY_FAILED:
+                    ((DiscoveryListener) listener).onStopDiscoveryFailed(
+                            getNsdService(message.arg2).getServiceType(), message.arg1);
+                    break;
+                case STOP_DISCOVERY_SUCCEEDED:
+                    ((DiscoveryListener) listener).onDiscoveryStopped(
+                            getNsdService(message.arg2).getServiceType());
+                    break;
+                case REGISTER_SERVICE_FAILED:
+                    ((RegistrationListener) listener).onRegistrationFailed(
+                            getNsdService(message.arg2), message.arg1);
+                    break;
+                case REGISTER_SERVICE_SUCCEEDED:
+                    ((RegistrationListener) listener).onServiceRegistered(
+                            (NsdServiceInfo) message.obj);
+                    // Keep listener until unregister
+                    listenerRemove = false;
+                    break;
+                case UNREGISTER_SERVICE_FAILED:
+                    ((RegistrationListener) listener).onUnregistrationFailed(
+                            getNsdService(message.arg2), message.arg1);
+                    break;
+                case UNREGISTER_SERVICE_SUCCEEDED:
+                    ((RegistrationListener) listener).onServiceUnregistered(
+                            getNsdService(message.arg2));
+                    break;
+                case RESOLVE_SERVICE_FAILED:
+                    ((ResolveListener) listener).onResolveFailed(
+                            getNsdService(message.arg2), message.arg1);
+                    break;
+                case RESOLVE_SERVICE_SUCCEEDED:
+                    ((ResolveListener) listener).onServiceResolved((NsdServiceInfo) message.obj);
+                    break;
+                default:
+                    Log.d(TAG, "Ignored " + message);
+                    break;
             }
-
-            @Override
-            public void handleMessage(Message message) {
-                switch (message.what) {
-                    case AsyncChannel.CMD_CHANNEL_HALF_CONNECTED:
-                        mAsyncChannel.sendMessage(AsyncChannel.CMD_CHANNEL_FULL_CONNECTION);
-                        break;
-                    case AsyncChannel.CMD_CHANNEL_FULLY_CONNECTED:
-                        if (mChannelListener != null) {
-                            mChannelListener.onChannelConnected(Channel.this);
-                        }
-                        break;
-                    case AsyncChannel.CMD_CHANNEL_DISCONNECTED:
-                        if (mChannelListener != null) {
-                            mChannelListener.onChannelDisconnected();
-                            mChannelListener = null;
-                        }
-                        break;
-                    case DISCOVER_SERVICES_STARTED:
-                        if (mDnsSdDiscoveryListener != null) {
-                            mDnsSdDiscoveryListener.onStarted((String) message.obj);
-                        }
-                        break;
-                    case DISCOVER_SERVICES_FAILED:
-                        if (mDnsSdDiscoveryListener != null) {
-                            mDnsSdDiscoveryListener.onFailure(message.arg1);
-                        }
-                        break;
-                    case SERVICE_FOUND:
-                        if (mDnsSdDiscoveryListener != null) {
-                            mDnsSdDiscoveryListener.onServiceFound(
-                                    (DnsSdServiceInfo) message.obj);
-                        }
-                        break;
-                    case SERVICE_LOST:
-                        if (mDnsSdDiscoveryListener != null) {
-                            mDnsSdDiscoveryListener.onServiceLost(
-                                    (DnsSdServiceInfo) message.obj);
-                        }
-                        break;
-                    case STOP_DISCOVERY_FAILED:
-                        if (mDnsSdStopDiscoveryListener != null) {
-                            mDnsSdStopDiscoveryListener.onFailure(message.arg1);
-                        }
-                        break;
-                    case STOP_DISCOVERY_SUCCEEDED:
-                        if (mDnsSdStopDiscoveryListener != null) {
-                            mDnsSdStopDiscoveryListener.onSuccess();
-                        }
-                        break;
-                    case REGISTER_SERVICE_FAILED:
-                        if (mDnsSdRegisterListener != null) {
-                            mDnsSdRegisterListener.onFailure(message.arg1);
-                        }
-                        break;
-                    case REGISTER_SERVICE_SUCCEEDED:
-                        if (mDnsSdRegisterListener != null) {
-                            mDnsSdRegisterListener.onServiceRegistered(message.arg1,
-                                    (DnsSdServiceInfo) message.obj);
-                        }
-                        break;
-                    case UNREGISTER_SERVICE_FAILED:
-                        if (mDnsSdUnregisterListener != null) {
-                            mDnsSdUnregisterListener.onFailure(message.arg1);
-                        }
-                        break;
-                    case UNREGISTER_SERVICE_SUCCEEDED:
-                        if (mDnsSdUnregisterListener != null) {
-                            mDnsSdUnregisterListener.onSuccess();
-                        }
-                        break;
-                   case UPDATE_SERVICE_FAILED:
-                        if (mDnsSdUpdateListener != null) {
-                            mDnsSdUpdateListener.onFailure(message.arg1);
-                        }
-                        break;
-                    case UPDATE_SERVICE_SUCCEEDED:
-                        if (mDnsSdUpdateListener != null) {
-                            mDnsSdUpdateListener.onServiceUpdated(message.arg1,
-                                    (DnsSdTxtRecord) message.obj);
-                        }
-                        break;
-                    case RESOLVE_SERVICE_FAILED:
-                        if (mDnsSdResolveListener != null) {
-                            mDnsSdResolveListener.onFailure(message.arg1);
-                        }
-                        break;
-                    case RESOLVE_SERVICE_SUCCEEDED:
-                        if (mDnsSdResolveListener != null) {
-                            mDnsSdResolveListener.onServiceResolved(
-                                    (DnsSdServiceInfo) message.obj);
-                        }
-                        break;
-                    case STOP_RESOLVE_FAILED:
-                        if (mDnsSdStopResolveListener!= null) {
-                            mDnsSdStopResolveListener.onFailure(message.arg1);
-                        }
-                        break;
-                    case STOP_RESOLVE_SUCCEEDED:
-                        if (mDnsSdStopResolveListener != null) {
-                            mDnsSdStopResolveListener.onSuccess();
-                        }
-                        break;
-                    default:
-                        Log.d(TAG, "Ignored " + message);
-                        break;
-                }
+            if (listenerRemove) {
+                removeListener(message.arg2);
             }
         }
-   }
-
-    private static void checkChannel(Channel c) {
-        if (c == null) throw new IllegalArgumentException("Channel needs to be initialized");
     }
 
+    private int putListener(Object listener, NsdServiceInfo s) {
+        if (listener == null) return INVALID_LISTENER_KEY;
+        int key;
+        synchronized (mMapLock) {
+            do {
+                key = mListenerKey++;
+            } while (key == INVALID_LISTENER_KEY);
+            mListenerMap.put(key, listener);
+            mServiceMap.put(key, s);
+        }
+        return key;
+    }
+
+    private Object getListener(int key) {
+        if (key == INVALID_LISTENER_KEY) return null;
+        synchronized (mMapLock) {
+            return mListenerMap.get(key);
+        }
+    }
+
+    private NsdServiceInfo getNsdService(int key) {
+        synchronized (mMapLock) {
+            return mServiceMap.get(key);
+        }
+    }
+
+    private void removeListener(int key) {
+        if (key == INVALID_LISTENER_KEY) return;
+        synchronized (mMapLock) {
+            mListenerMap.remove(key);
+            mServiceMap.remove(key);
+        }
+    }
+
+    private int getListenerKey(Object listener) {
+        synchronized (mMapLock) {
+            int valueIndex = mListenerMap.indexOfValue(listener);
+            if (valueIndex != -1) {
+                return mListenerMap.keyAt(valueIndex);
+            }
+        }
+        return INVALID_LISTENER_KEY;
+    }
+
+
     /**
-     * Registers the application with the service discovery framework. This function
-     * must be the first to be called before any other operations are performed. No service
-     * discovery operations must be performed until the ChannelListener callback notifies
-     * that the channel is connected
-     *
-     * @param srcContext is the context of the source
-     * @param srcLooper is the Looper on which the callbacks are receivied
-     * @param listener for callback at loss of framework communication. Cannot be null.
+     * Initialize AsyncChannel
      */
-    public void initialize(Context srcContext, Looper srcLooper, ChannelListener listener) {
-        Messenger messenger = getMessenger();
+    private void init() {
+        final Messenger messenger = getMessenger();
         if (messenger == null) throw new RuntimeException("Failed to initialize");
-        if (listener == null) throw new IllegalArgumentException("ChannelListener cannot be null");
-
-        Channel c = new Channel(srcLooper, listener);
-        c.mAsyncChannel.connect(srcContext, c.mHandler, messenger);
-    }
-
-    /**
-     * Disconnects application from service discovery framework. No further operations
-     * will succeed until a {@link #initialize} is called again.
-     *
-     * @param c channel initialized with {@link #initialize}
-     */
-    public void deinitialize(Channel c) {
-        checkChannel(c);
-        c.mAsyncChannel.disconnect();
+        HandlerThread t = new HandlerThread("NsdManager");
+        t.start();
+        mHandler = new ServiceHandler(t.getLooper());
+        mAsyncChannel.connect(mContext, mHandler, messenger);
+        try {
+            mConnected.await();
+        } catch (InterruptedException e) {
+            Log.e(TAG, "interrupted wait at init");
+        }
     }
 
     /**
@@ -510,45 +444,51 @@
      *
      * <p> The function call immediately returns after sending a request to register service
      * to the framework. The application is notified of a success to initiate
-     * discovery through the callback {@link DnsSdRegisterListener#onServiceRegistered} or a failure
-     * through {@link DnsSdRegisterListener#onFailure}.
+     * discovery through the callback {@link RegistrationListener#onServiceRegistered} or a failure
+     * through {@link RegistrationListener#onRegistrationFailed}.
      *
-     * @param c is the channel created at {@link #initialize}
-     * @param serviceType The service type being advertised.
-     * @param port on which the service is listenering for incoming connections
-     * @param listener for success or failure callback. Can be null.
+     * @param serviceInfo The service being registered
+     * @param protocolType The service discovery protocol
+     * @param listener The listener notifies of a successful registration and is used to
+     * unregister this service through a call on {@link #unregisterService}. Cannot be null.
      */
-    public void registerService(Channel c, String serviceName, String serviceType, int port,
-            DnsSdRegisterListener listener) {
-        checkChannel(c);
-        if (TextUtils.isEmpty(serviceName) || TextUtils.isEmpty(serviceType)) {
+    public void registerService(NsdServiceInfo serviceInfo, int protocolType,
+            RegistrationListener listener) {
+        if (TextUtils.isEmpty(serviceInfo.getServiceName()) ||
+                TextUtils.isEmpty(serviceInfo.getServiceType())) {
             throw new IllegalArgumentException("Service name or type cannot be empty");
         }
-        if (port <= 0) {
+        if (serviceInfo.getPort() <= 0) {
             throw new IllegalArgumentException("Invalid port number");
         }
-        DnsSdServiceInfo serviceInfo = new DnsSdServiceInfo(serviceName, serviceType, null);
-        serviceInfo.setPort(port);
-        c.mDnsSdRegisterListener = listener;
-        c.mAsyncChannel.sendMessage(REGISTER_SERVICE, serviceInfo);
+        if (listener == null) {
+            throw new IllegalArgumentException("listener cannot be null");
+        }
+        if (protocolType != PROTOCOL_DNS_SD) {
+            throw new IllegalArgumentException("Unsupported protocol");
+        }
+        mAsyncChannel.sendMessage(REGISTER_SERVICE, 0, putListener(listener, serviceInfo),
+                serviceInfo);
     }
 
     /**
-     * Unregister a service registered through {@link #registerService}
-     * @param c is the channel created at {@link #initialize}
-     * @param registeredId is obtained at {@link DnsSdRegisterListener#onServiceRegistered}
-     * @param listener provides callbacks for success or failure. Can be null.
+     * Unregister a service registered through {@link #registerService}. A successful
+     * unregister is notified to the application with a call to
+     * {@link RegistrationListener#onServiceUnregistered}.
+     *
+     * @param listener This should be the listener object that was passed to
+     * {@link #registerService}. It identifies the service that should be unregistered
+     * and notifies of a successful unregistration.
      */
-    public void unregisterService(Channel c, int registeredId, ActionListener listener) {
-        checkChannel(c);
-        c.mDnsSdUnregisterListener = listener;
-        c.mAsyncChannel.sendMessage(UNREGISTER_SERVICE, registeredId);
-    }
-
-    /** @hide */
-    public void updateService(Channel c, int registeredId, DnsSdTxtRecord txtRecord) {
-        checkChannel(c);
-        c.mAsyncChannel.sendMessage(UPDATE_SERVICE, registeredId, 0, txtRecord);
+    public void unregisterService(RegistrationListener listener) {
+        int id = getListenerKey(listener);
+        if (id == INVALID_LISTENER_KEY) {
+            throw new IllegalArgumentException("listener not registered");
+        }
+        if (listener == null) {
+            throw new IllegalArgumentException("listener cannot be null");
+        }
+        mAsyncChannel.sendMessage(UNREGISTER_SERVICE, 0, id);
     }
 
     /**
@@ -558,51 +498,61 @@
      *
      * <p> The function call immediately returns after sending a request to start service
      * discovery to the framework. The application is notified of a success to initiate
-     * discovery through the callback {@link DnsSdDiscoveryListener#onStarted} or a failure
-     * through {@link DnsSdDiscoveryListener#onFailure}.
+     * discovery through the callback {@link DiscoveryListener#onDiscoveryStarted} or a failure
+     * through {@link DiscoveryListener#onStartDiscoveryFailed}.
      *
      * <p> Upon successful start, application is notified when a service is found with
-     * {@link DnsSdDiscoveryListener#onServiceFound} or when a service is lost with
-     * {@link DnsSdDiscoveryListener#onServiceLost}.
+     * {@link DiscoveryListener#onServiceFound} or when a service is lost with
+     * {@link DiscoveryListener#onServiceLost}.
      *
      * <p> Upon failure to start, service discovery is not active and application does
      * not need to invoke {@link #stopServiceDiscovery}
      *
-     * @param c is the channel created at {@link #initialize}
      * @param serviceType The service type being discovered. Examples include "_http._tcp" for
      * http services or "_ipp._tcp" for printers
-     * @param listener provides callbacks when service is found or lost. Cannot be null.
+     * @param protocolType The service discovery protocol
+     * @param listener  The listener notifies of a successful discovery and is used
+     * to stop discovery on this serviceType through a call on {@link #stopServiceDiscovery}.
+     * Cannot be null.
      */
-    public void discoverServices(Channel c, String serviceType, DnsSdDiscoveryListener listener) {
-        checkChannel(c);
+    public void discoverServices(String serviceType, int protocolType, DiscoveryListener listener) {
         if (listener == null) {
-            throw new IllegalStateException("Discovery listener needs to be set first");
+            throw new IllegalArgumentException("listener cannot be null");
         }
         if (TextUtils.isEmpty(serviceType)) {
-            throw new IllegalStateException("Service type cannot be empty");
+            throw new IllegalArgumentException("Service type cannot be empty");
         }
-        DnsSdServiceInfo s = new DnsSdServiceInfo();
+
+        if (protocolType != PROTOCOL_DNS_SD) {
+            throw new IllegalArgumentException("Unsupported protocol");
+        }
+
+        NsdServiceInfo s = new NsdServiceInfo();
         s.setServiceType(serviceType);
-        c.mDnsSdDiscoveryListener = listener;
-        c.mAsyncChannel.sendMessage(DISCOVER_SERVICES, s);
+        mAsyncChannel.sendMessage(DISCOVER_SERVICES, 0, putListener(listener, s), s);
     }
 
     /**
      * Stop service discovery initiated with {@link #discoverServices}. An active service
-     * discovery is notified to the application with {@link DnsSdDiscoveryListener#onStarted}
-     * and it stays active until the application invokes a stop service discovery.
+     * discovery is notified to the application with {@link DiscoveryListener#onDiscoveryStarted}
+     * and it stays active until the application invokes a stop service discovery. A successful
+     * stop is notified to with a call to {@link DiscoveryListener#onDiscoveryStopped}.
      *
-     * <p> Upon failure to start service discovery notified through
-     * {@link DnsSdDiscoveryListener#onFailure} service discovery is not active and
-     * application does not need to stop it.
+     * <p> Upon failure to stop service discovery, application is notified through
+     * {@link DiscoveryListener#onStopDiscoveryFailed}.
      *
-     * @param c is the channel created at {@link #initialize}
-     * @param listener notifies success or failure. Can be null.
+     * @param listener This should be the listener object that was passed to {@link #discoverServices}.
+     * It identifies the discovery that should be stopped and notifies of a successful stop.
      */
-    public void stopServiceDiscovery(Channel c, ActionListener listener) {
-        checkChannel(c);
-        c.mDnsSdStopDiscoveryListener = listener;
-        c.mAsyncChannel.sendMessage(STOP_DISCOVERY);
+    public void stopServiceDiscovery(DiscoveryListener listener) {
+        int id = getListenerKey(listener);
+        if (id == INVALID_LISTENER_KEY) {
+            throw new IllegalArgumentException("service discovery not active on listener");
+        }
+        if (listener == null) {
+            throw new IllegalArgumentException("listener cannot be null");
+        }
+        mAsyncChannel.sendMessage(STOP_DISCOVERY, 0, id);
     }
 
     /**
@@ -610,30 +560,19 @@
      * establishing a connection to fetch the IP and port details on which to setup
      * the connection.
      *
-     * @param c is the channel created at {@link #initialize}
-     * @param serviceName of the the service
-     * @param serviceType of the service
+     * @param serviceInfo service to be resolved
      * @param listener to receive callback upon success or failure. Cannot be null.
      */
-    public void resolveService(Channel c, String serviceName, String serviceType,
-            DnsSdResolveListener listener) {
-        checkChannel(c);
-        if (TextUtils.isEmpty(serviceName) || TextUtils.isEmpty(serviceType)) {
+    public void resolveService(NsdServiceInfo serviceInfo, ResolveListener listener) {
+        if (TextUtils.isEmpty(serviceInfo.getServiceName()) ||
+                TextUtils.isEmpty(serviceInfo.getServiceType())) {
             throw new IllegalArgumentException("Service name or type cannot be empty");
         }
-        if (listener == null) throw new
-                IllegalStateException("Resolve listener cannot be null");
-        c.mDnsSdResolveListener = listener;
-        DnsSdServiceInfo serviceInfo = new DnsSdServiceInfo(serviceName, serviceType, null);
-        c.mAsyncChannel.sendMessage(RESOLVE_SERVICE, serviceInfo);
-    }
-
-    /** @hide */
-    public void stopServiceResolve(Channel c) {
-        checkChannel(c);
-        if (c.mDnsSdResolveListener == null) throw new
-                IllegalStateException("Resolve listener needs to be set first");
-        c.mAsyncChannel.sendMessage(STOP_RESOLVE);
+        if (listener == null) {
+            throw new IllegalArgumentException("listener cannot be null");
+        }
+        mAsyncChannel.sendMessage(RESOLVE_SERVICE, 0, putListener(listener, serviceInfo),
+                serviceInfo);
     }
 
     /** Internal use only @hide */
diff --git a/core/java/android/net/nsd/DnsSdServiceInfo.java b/core/java/android/net/nsd/NsdServiceInfo.java
similarity index 86%
rename from core/java/android/net/nsd/DnsSdServiceInfo.java
rename to core/java/android/net/nsd/NsdServiceInfo.java
index 66abd3a..205a21d 100644
--- a/core/java/android/net/nsd/DnsSdServiceInfo.java
+++ b/core/java/android/net/nsd/NsdServiceInfo.java
@@ -25,7 +25,7 @@
  * A class representing service information for network service discovery
  * {@see NsdManager}
  */
-public class DnsSdServiceInfo implements NetworkServiceInfo, Parcelable {
+public final class NsdServiceInfo implements Parcelable {
 
     private String mServiceName;
 
@@ -37,36 +37,32 @@
 
     private int mPort;
 
-    public DnsSdServiceInfo() {
+    public NsdServiceInfo() {
     }
 
     /** @hide */
-    public DnsSdServiceInfo(String sn, String rt, DnsSdTxtRecord tr) {
+    public NsdServiceInfo(String sn, String rt, DnsSdTxtRecord tr) {
         mServiceName = sn;
         mServiceType = rt;
         mTxtRecord = tr;
     }
 
     /** Get the service name */
-    @Override
     public String getServiceName() {
         return mServiceName;
     }
 
     /** Set the service name */
-    @Override
     public void setServiceName(String s) {
         mServiceName = s;
     }
 
     /** Get the service type */
-    @Override
     public String getServiceType() {
         return mServiceType;
     }
 
     /** Set the service type */
-    @Override
     public void setServiceType(String s) {
         mServiceType = s;
     }
@@ -132,10 +128,10 @@
     }
 
     /** Implement the Parcelable interface */
-    public static final Creator<DnsSdServiceInfo> CREATOR =
-        new Creator<DnsSdServiceInfo>() {
-            public DnsSdServiceInfo createFromParcel(Parcel in) {
-                DnsSdServiceInfo info = new DnsSdServiceInfo();
+    public static final Creator<NsdServiceInfo> CREATOR =
+        new Creator<NsdServiceInfo>() {
+            public NsdServiceInfo createFromParcel(Parcel in) {
+                NsdServiceInfo info = new NsdServiceInfo();
                 info.mServiceName = in.readString();
                 info.mServiceType = in.readString();
                 info.mTxtRecord = in.readParcelable(null);
@@ -150,8 +146,8 @@
                 return info;
             }
 
-            public DnsSdServiceInfo[] newArray(int size) {
-                return new DnsSdServiceInfo[size];
+            public NsdServiceInfo[] newArray(int size) {
+                return new NsdServiceInfo[size];
             }
         };
 }
diff --git a/core/java/android/content/CancellationSignal.java b/core/java/android/os/CancellationSignal.java
similarity index 98%
rename from core/java/android/content/CancellationSignal.java
rename to core/java/android/os/CancellationSignal.java
index dcaeeb7..dcba9b7 100644
--- a/core/java/android/content/CancellationSignal.java
+++ b/core/java/android/os/CancellationSignal.java
@@ -14,9 +14,10 @@
  * limitations under the License.
  */
 
-package android.content;
+package android.os;
 
-import android.os.RemoteException;
+import android.os.ICancellationSignal;
+import android.os.ICancellationSignal.Stub;
 
 /**
  * Provides the ability to cancel an operation in progress.
diff --git a/core/java/android/os/IBinder.java b/core/java/android/os/IBinder.java
index 0586d9e..b7bc45f 100644
--- a/core/java/android/os/IBinder.java
+++ b/core/java/android/os/IBinder.java
@@ -140,6 +140,9 @@
      */
     int LIKE_TRANSACTION   = ('_'<<24)|('L'<<16)|('I'<<8)|'K';
 
+    /** @hide */
+    int SYSPROPS_TRANSACTION = ('_'<<24)|('S'<<16)|('P'<<8)|'R';
+
     /**
      * Flag to {@link #transact}: this is a one-way call, meaning that the
      * caller returns immediately, without waiting for a result from the
diff --git a/core/java/android/content/ICancellationSignal.aidl b/core/java/android/os/ICancellationSignal.aidl
similarity index 96%
rename from core/java/android/content/ICancellationSignal.aidl
rename to core/java/android/os/ICancellationSignal.aidl
index cf1c5d3..d92464c 100644
--- a/core/java/android/content/ICancellationSignal.aidl
+++ b/core/java/android/os/ICancellationSignal.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.content;
+package android.os;
 
 /**
  * @hide
diff --git a/core/java/android/content/OperationCanceledException.java b/core/java/android/os/OperationCanceledException.java
similarity index 97%
rename from core/java/android/content/OperationCanceledException.java
rename to core/java/android/os/OperationCanceledException.java
index d783a07..b0cd663 100644
--- a/core/java/android/content/OperationCanceledException.java
+++ b/core/java/android/os/OperationCanceledException.java
@@ -14,7 +14,8 @@
  * limitations under the License.
  */
 
-package android.content;
+package android.os;
+
 
 /**
  * An exception type that is thrown when an operation in progress is canceled.
diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java
index 1df53e8..18fd3cb 100644
--- a/core/java/android/os/Process.java
+++ b/core/java/android/os/Process.java
@@ -897,6 +897,9 @@
     public static final native long getFreeMemory();
     
     /** @hide */
+    public static final native long getTotalMemory();
+    
+    /** @hide */
     public static final native void readProcLines(String path,
             String[] reqFields, long[] outSizes);
     
diff --git a/core/java/android/os/ServiceManagerNative.java b/core/java/android/os/ServiceManagerNative.java
index 43b5128..be24426 100644
--- a/core/java/android/os/ServiceManagerNative.java
+++ b/core/java/android/os/ServiceManagerNative.java
@@ -16,6 +16,8 @@
 
 package android.os;
 
+import java.util.ArrayList;
+
 
 /**
  * Native implementation of the service manager.  Most clients will only
@@ -151,14 +153,32 @@
     }
     
     public String[] listServices() throws RemoteException {
-        Parcel data = Parcel.obtain();
-        Parcel reply = Parcel.obtain();
-        data.writeInterfaceToken(IServiceManager.descriptor);
-        mRemote.transact(LIST_SERVICES_TRANSACTION, data, reply, 0);
-        String[] list = reply.readStringArray();
-        reply.recycle();
-        data.recycle();
-        return list;
+        ArrayList<String> services = new ArrayList<String>();
+        int n = 0;
+        while (true) {
+            Parcel data = Parcel.obtain();
+            Parcel reply = Parcel.obtain();
+            data.writeInterfaceToken(IServiceManager.descriptor);
+            data.writeInt(n);
+            n++;
+            try {
+                boolean res = mRemote.transact(LIST_SERVICES_TRANSACTION, data, reply, 0);
+                if (!res) {
+                    break;
+                }
+            } catch (RuntimeException e) {
+                // The result code that is returned by the C++ code can
+                // cause the call to throw an exception back instead of
+                // returning a nice result...  so eat it here and go on.
+                break;
+            }
+            services.add(reply.readString());
+            reply.recycle();
+            data.recycle();
+        }
+        String[] array = new String[services.size()];
+        services.toArray(array);
+        return array;
     }
 
     public void setPermissionController(IPermissionController controller)
diff --git a/core/java/android/os/SystemProperties.java b/core/java/android/os/SystemProperties.java
index 619bf8d..156600e 100644
--- a/core/java/android/os/SystemProperties.java
+++ b/core/java/android/os/SystemProperties.java
@@ -16,6 +16,10 @@
 
 package android.os;
 
+import java.util.ArrayList;
+
+import android.util.Log;
+
 
 /**
  * Gives access to the system properties store.  The system properties
@@ -28,12 +32,15 @@
     public static final int PROP_NAME_MAX = 31;
     public static final int PROP_VALUE_MAX = 91;
 
+    private static final ArrayList<Runnable> sChangeCallbacks = new ArrayList<Runnable>();
+
     private static native String native_get(String key);
     private static native String native_get(String key, String def);
     private static native int native_get_int(String key, int def);
     private static native long native_get_long(String key, long def);
     private static native boolean native_get_boolean(String key, boolean def);
     private static native void native_set(String key, String def);
+    private static native void native_add_change_callback();
 
     /**
      * Get the value for the given key.
@@ -124,4 +131,26 @@
         }
         native_set(key, val);
     }
+
+    public static void addChangeCallback(Runnable callback) {
+        synchronized (sChangeCallbacks) {
+            if (sChangeCallbacks.size() == 0) {
+                native_add_change_callback();
+            }
+            sChangeCallbacks.add(callback);
+        }
+    }
+
+    static void callChangeCallbacks() {
+        synchronized (sChangeCallbacks) {
+            //Log.i("foo", "Calling " + sChangeCallbacks.size() + " change callbacks!");
+            if (sChangeCallbacks.size() == 0) {
+                return;
+            }
+            ArrayList<Runnable> callbacks = new ArrayList<Runnable>(sChangeCallbacks);
+            for (int i=0; i<callbacks.size(); i++) {
+                callbacks.get(i).run();
+            }
+        }
+    }
 }
diff --git a/core/java/android/os/Trace.java b/core/java/android/os/Trace.java
index ac9ee26..911183d 100644
--- a/core/java/android/os/Trace.java
+++ b/core/java/android/os/Trace.java
@@ -39,13 +39,29 @@
     public static final long TRACE_TAG_SYNC_MANAGER = 1L << 7;
     public static final long TRACE_TAG_AUDIO = 1L << 8;
 
-    private static final long sEnabledTags = nativeGetEnabledTags();
+    public static final int TRACE_FLAGS_START_BIT = 1;
+    public static final String[] TRACE_TAGS = {
+        "Graphics", "Input", "View", "WebView", "Window Manager",
+        "Activity Manager", "Sync Manager", "Audio"
+    };
+
+    public static final String PROPERTY_TRACE_TAG_ENABLEFLAGS = "debug.atrace.tags.enableflags";
+
+    private static long sEnabledTags = nativeGetEnabledTags();
 
     private static native long nativeGetEnabledTags();
     private static native void nativeTraceCounter(long tag, String name, int value);
     private static native void nativeTraceBegin(long tag, String name);
     private static native void nativeTraceEnd(long tag);
 
+    static {
+        SystemProperties.addChangeCallback(new Runnable() {
+            @Override public void run() {
+                sEnabledTags = nativeGetEnabledTags();
+            }
+        });
+    }
+
     private Trace() {
     }
 
diff --git a/core/java/android/preference/MultiCheckPreference.java b/core/java/android/preference/MultiCheckPreference.java
new file mode 100644
index 0000000..6953075
--- /dev/null
+++ b/core/java/android/preference/MultiCheckPreference.java
@@ -0,0 +1,327 @@
+/*
+ * 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.preference;
+
+import java.util.Arrays;
+
+import android.app.AlertDialog.Builder;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.res.TypedArray;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.util.AttributeSet;
+
+/**
+ * @hide
+ * A {@link Preference} that displays a list of entries as
+ * a dialog which allow the user to toggle each individually on and off.
+ * 
+ * @attr ref android.R.styleable#ListPreference_entries
+ * @attr ref android.R.styleable#ListPreference_entryValues
+ */
+public class MultiCheckPreference extends DialogPreference {
+    private CharSequence[] mEntries;
+    private String[] mEntryValues;
+    private boolean[] mSetValues;
+    private boolean[] mOrigValues;
+    private String mSummary;
+    
+    public MultiCheckPreference(Context context, AttributeSet attrs) {
+        super(context, attrs);
+        
+        TypedArray a = context.obtainStyledAttributes(attrs,
+                com.android.internal.R.styleable.ListPreference, 0, 0);
+        mEntries = a.getTextArray(com.android.internal.R.styleable.ListPreference_entries);
+        if (mEntries != null) {
+            setEntries(mEntries);
+        }
+        setEntryValuesCS(a.getTextArray(
+                com.android.internal.R.styleable.ListPreference_entryValues));
+        a.recycle();
+
+        /* Retrieve the Preference summary attribute since it's private
+         * in the Preference class.
+         */
+        a = context.obtainStyledAttributes(attrs,
+                com.android.internal.R.styleable.Preference, 0, 0);
+        mSummary = a.getString(com.android.internal.R.styleable.Preference_summary);
+        a.recycle();
+    }
+
+    public MultiCheckPreference(Context context) {
+        this(context, null);
+    }
+
+    /**
+     * Sets the human-readable entries to be shown in the list. This will be
+     * shown in subsequent dialogs.
+     * <p>
+     * Each entry must have a corresponding index in
+     * {@link #setEntryValues(CharSequence[])}.
+     * 
+     * @param entries The entries.
+     * @see #setEntryValues(CharSequence[])
+     */
+    public void setEntries(CharSequence[] entries) {
+        mEntries = entries;
+        mSetValues = new boolean[entries.length];
+        mOrigValues = new boolean[entries.length];
+    }
+    
+    /**
+     * @see #setEntries(CharSequence[])
+     * @param entriesResId The entries array as a resource.
+     */
+    public void setEntries(int entriesResId) {
+        setEntries(getContext().getResources().getTextArray(entriesResId));
+    }
+    
+    /**
+     * The list of entries to be shown in the list in subsequent dialogs.
+     * 
+     * @return The list as an array.
+     */
+    public CharSequence[] getEntries() {
+        return mEntries;
+    }
+    
+    /**
+     * The array to find the value to save for a preference when an entry from
+     * entries is selected. If a user clicks on the second item in entries, the
+     * second item in this array will be saved to the preference.
+     * 
+     * @param entryValues The array to be used as values to save for the preference.
+     */
+    public void setEntryValues(String[] entryValues) {
+        mEntryValues = entryValues;
+        Arrays.fill(mSetValues, false);
+        Arrays.fill(mOrigValues, false);
+    }
+
+    /**
+     * @see #setEntryValues(CharSequence[])
+     * @param entryValuesResId The entry values array as a resource.
+     */
+    public void setEntryValues(int entryValuesResId) {
+        setEntryValuesCS(getContext().getResources().getTextArray(entryValuesResId));
+    }
+
+    private void setEntryValuesCS(CharSequence[] values) {
+        setValues(null);
+        if (values != null) {
+            mEntryValues = new String[values.length];
+            for (int i=0; i<values.length; i++) {
+                mEntryValues[i] = values[i].toString();
+            }
+        }
+    }
+
+    /**
+     * Returns the array of values to be saved for the preference.
+     * 
+     * @return The array of values.
+     */
+    public String[] getEntryValues() {
+        return mEntryValues;
+    }
+
+    /**
+     * Get the boolean state of a given value.
+     */
+    public boolean getValue(int index) {
+        return mSetValues[index];
+    }
+
+    /**
+     * Set the boolean state of a given value.
+     */
+    public void setValue(int index, boolean state) {
+        mSetValues[index] = state;
+    }
+
+    /**
+     * Sets the current values.
+     */
+    public void setValues(boolean[] values) {
+        if (mSetValues != null) {
+            Arrays.fill(mSetValues, false);
+            Arrays.fill(mOrigValues, false);
+            if (values != null) {
+                System.arraycopy(values, 0, mSetValues, 0,
+                        values.length < mSetValues.length ? values.length : mSetValues.length);
+            }
+        }
+    }
+
+    /**
+     * Returns the summary of this ListPreference. If the summary
+     * has a {@linkplain java.lang.String#format String formatting}
+     * marker in it (i.e. "%s" or "%1$s"), then the current entry
+     * value will be substituted in its place.
+     *
+     * @return the summary with appropriate string substitution
+     */
+    @Override
+    public CharSequence getSummary() {
+        if (mSummary == null) {
+            return super.getSummary();
+        } else {
+            return mSummary;
+        }
+    }
+
+    /**
+     * Sets the summary for this Preference with a CharSequence.
+     * If the summary has a
+     * {@linkplain java.lang.String#format String formatting}
+     * marker in it (i.e. "%s" or "%1$s"), then the current entry
+     * value will be substituted in its place when it's retrieved.
+     *
+     * @param summary The summary for the preference.
+     */
+    @Override
+    public void setSummary(CharSequence summary) {
+        super.setSummary(summary);
+        if (summary == null && mSummary != null) {
+            mSummary = null;
+        } else if (summary != null && !summary.equals(mSummary)) {
+            mSummary = summary.toString();
+        }
+    }
+    
+    /**
+     * Returns the currently selected values.
+     */
+    public boolean[] getValues() {
+        return mSetValues;
+    }
+    
+    /**
+     * Returns the index of the given value (in the entry values array).
+     * 
+     * @param value The value whose index should be returned.
+     * @return The index of the value, or -1 if not found.
+     */
+    public int findIndexOfValue(String value) {
+        if (value != null && mEntryValues != null) {
+            for (int i = mEntryValues.length - 1; i >= 0; i--) {
+                if (mEntryValues[i].equals(value)) {
+                    return i;
+                }
+            }
+        }
+        return -1;
+    }
+    
+    @Override
+    protected void onPrepareDialogBuilder(Builder builder) {
+        super.onPrepareDialogBuilder(builder);
+        
+        if (mEntries == null || mEntryValues == null) {
+            throw new IllegalStateException(
+                    "ListPreference requires an entries array and an entryValues array.");
+        }
+
+        mOrigValues = Arrays.copyOf(mSetValues, mSetValues.length);
+        builder.setMultiChoiceItems(mEntries, mSetValues,
+                new DialogInterface.OnMultiChoiceClickListener() {
+                    @Override
+                    public void onClick(DialogInterface dialog, int which, boolean isChecked) {
+                        mSetValues[which] = isChecked;
+                    }
+        });
+    }
+
+    @Override
+    protected void onDialogClosed(boolean positiveResult) {
+        super.onDialogClosed(positiveResult);
+
+        if (positiveResult) {
+            if (callChangeListener(getValues())) {
+                return;
+            }
+        }
+        System.arraycopy(mOrigValues, 0, mSetValues, 0, mSetValues.length);
+    }
+
+    @Override
+    protected Object onGetDefaultValue(TypedArray a, int index) {
+        return a.getString(index);
+    }
+
+    @Override
+    protected void onSetInitialValue(boolean restoreValue, Object defaultValue) {
+    }
+
+    @Override
+    protected Parcelable onSaveInstanceState() {
+        final Parcelable superState = super.onSaveInstanceState();
+        if (isPersistent()) {
+            // No need to save instance state since it's persistent
+            return superState;
+        }
+        
+        final SavedState myState = new SavedState(superState);
+        myState.values = getValues();
+        return myState;
+    }
+
+    @Override
+    protected void onRestoreInstanceState(Parcelable state) {
+        if (state == null || !state.getClass().equals(SavedState.class)) {
+            // Didn't save state for us in onSaveInstanceState
+            super.onRestoreInstanceState(state);
+            return;
+        }
+         
+        SavedState myState = (SavedState) state;
+        super.onRestoreInstanceState(myState.getSuperState());
+        setValues(myState.values);
+    }
+    
+    private static class SavedState extends BaseSavedState {
+        boolean[] values;
+        
+        public SavedState(Parcel source) {
+            super(source);
+            values = source.createBooleanArray();
+        }
+
+        @Override
+        public void writeToParcel(Parcel dest, int flags) {
+            super.writeToParcel(dest, flags);
+            dest.writeBooleanArray(values);
+        }
+
+        public SavedState(Parcelable superState) {
+            super(superState);
+        }
+
+        public static final Parcelable.Creator<SavedState> CREATOR =
+                new Parcelable.Creator<SavedState>() {
+            public SavedState createFromParcel(Parcel in) {
+                return new SavedState(in);
+            }
+
+            public SavedState[] newArray(int size) {
+                return new SavedState[size];
+            }
+        };
+    }
+    
+}
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 2c49bd2..497e66e8 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -1410,6 +1410,7 @@
         /**
          * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
          * or less (<0.0 >-1.0) bright.
+         * @hide
          */
         public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
 
@@ -1557,6 +1558,9 @@
          * will likely be removed in a future release with support for
          * audio/vibe feedback profiles.
          *
+         * Not used anymore. On devices with vibrator, the user explicitly selects
+         * silent or vibrate mode.
+         * Kept for use by legacy database upgrade code in DatabaseHelper.
          * @hide
          */
         public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
@@ -1746,6 +1750,20 @@
         public static final String USER_ROTATION = "user_rotation";
 
         /**
+         * Whether the phone vibrates when it is ringing due to an incoming call. This will
+         * be used by Phone and Setting apps; it shouldn't affect other apps.
+         * The value is boolean (1 or 0).
+         *
+         * Note: this is not same as "vibrate on ring", which had been available until ICS.
+         * It was about AudioManager's setting and thus affected all the applications which
+         * relied on the setting, while this is purely about the vibration setting for incoming
+         * calls.
+         *
+         * @hide
+         */
+        public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
+
+        /**
          * Whether the audible DTMF tones are played by the dialer when dialing. The value is
          * boolean (1 or 0).
          */
@@ -1983,7 +2001,6 @@
             SCREEN_BRIGHTNESS,
             SCREEN_BRIGHTNESS_MODE,
             SCREEN_AUTO_BRIGHTNESS_ADJ,
-            VIBRATE_ON,
             VIBRATE_INPUT_DEVICES,
             MODE_RINGER,
             MODE_RINGER_STREAMS_AFFECTED,
@@ -2002,7 +2019,6 @@
             VOLUME_ALARM + APPEND_FOR_LAST_AUDIBLE,
             VOLUME_NOTIFICATION + APPEND_FOR_LAST_AUDIBLE,
             VOLUME_BLUETOOTH_SCO + APPEND_FOR_LAST_AUDIBLE,
-            VIBRATE_IN_SILENT,
             TEXT_AUTO_REPLACE,
             TEXT_AUTO_CAPS,
             TEXT_AUTO_PUNCTUATE,
@@ -2029,6 +2045,7 @@
             SIP_CALL_OPTIONS,
             SIP_RECEIVE_CALLS,
             POINTER_SPEED,
+            VIBRATE_WHEN_RINGING
         };
 
         // Settings moved to Settings.Secure
diff --git a/core/java/android/view/AccessibilityInteractionController.java b/core/java/android/view/AccessibilityInteractionController.java
index 6387148..d42757d 100644
--- a/core/java/android/view/AccessibilityInteractionController.java
+++ b/core/java/android/view/AccessibilityInteractionController.java
@@ -126,6 +126,16 @@
         }
     }
 
+    private boolean isShown(View view) {
+        // The first two checks are made also made by isShown() which
+        // however traverses the tree up to the parent to catch that.
+        // Therefore, we do some fail fast check to minimize the up
+        // tree traversal.
+        return (view.mAttachInfo != null
+                && view.mAttachInfo.mWindowVisibility == View.VISIBLE
+                && view.isShown());
+    }
+
     public void findAccessibilityNodeInfoByAccessibilityIdClientThread(
             long accessibilityNodeId, int interactionId,
             IAccessibilityInteractionConnectionCallback callback, int flags, int interrogatingPid,
@@ -174,7 +184,7 @@
             } else {
                 root = findViewByAccessibilityId(accessibilityViewId);
             }
-            if (root != null && root.isDisplayedOnScreen()) {
+            if (root != null && isShown(root)) {
                 mPrefetcher.prefetchAccessibilityNodeInfos(root, virtualDescendantId, flags, infos);
             }
         } finally {
@@ -236,7 +246,7 @@
             }
             if (root != null) {
                 View target = root.findViewById(viewId);
-                if (target != null && target.isDisplayedOnScreen()) {
+                if (target != null && isShown(target)) {
                     info = target.createAccessibilityNodeInfo();
                 }
             }
@@ -298,7 +308,7 @@
             } else {
                 root = mViewRootImpl.mView;
             }
-            if (root != null && root.isDisplayedOnScreen()) {
+            if (root != null && isShown(root)) {
                 AccessibilityNodeProvider provider = root.getAccessibilityNodeProvider();
                 if (provider != null) {
                     infos = provider.findAccessibilityNodeInfosByText(text,
@@ -315,7 +325,7 @@
                         final int viewCount = foundViews.size();
                         for (int i = 0; i < viewCount; i++) {
                             View foundView = foundViews.get(i);
-                            if (foundView.isDisplayedOnScreen()) {
+                            if (isShown(foundView)) {
                                 provider = foundView.getAccessibilityNodeProvider();
                                 if (provider != null) {
                                     List<AccessibilityNodeInfo> infosFromProvider =
@@ -390,7 +400,7 @@
             } else {
                 root = mViewRootImpl.mView;
             }
-            if (root != null && root.isDisplayedOnScreen()) {
+            if (root != null && isShown(root)) {
                 switch (focusType) {
                     case AccessibilityNodeInfo.FOCUS_ACCESSIBILITY: {
                         View host = mViewRootImpl.mAccessibilityFocusedHost;
@@ -403,7 +413,7 @@
                         // focus instead fetching all provider nodes to do the search here.
                         AccessibilityNodeProvider provider = host.getAccessibilityNodeProvider();
                         if (provider != null) {
-                            focused = provider.findAccessibilitiyFocus(virtualDescendantId);
+                            focused = provider.findAccessibilityFocus(virtualDescendantId);
                         } else if (virtualDescendantId == View.NO_ID) {
                             focused = host.createAccessibilityNodeInfo();
                         }
@@ -411,7 +421,7 @@
                     case AccessibilityNodeInfo.FOCUS_INPUT: {
                         // Input focus cannot go to virtual views.
                         View target = root.findFocus();
-                        if (target != null && target.isDisplayedOnScreen()) {
+                        if (target != null && isShown(target)) {
                             focused = target.createAccessibilityNodeInfo();
                         }
                     } break;
@@ -477,7 +487,7 @@
             } else {
                 root = mViewRootImpl.mView;
             }
-            if (root != null && root.isDisplayedOnScreen()) {
+            if (root != null && isShown(root)) {
                 if ((direction & View.FOCUS_ACCESSIBILITY) ==  View.FOCUS_ACCESSIBILITY) {
                     AccessibilityNodeProvider provider = root.getAccessibilityNodeProvider();
                     if (provider != null) {
@@ -565,7 +575,7 @@
             } else {
                 target = mViewRootImpl.mView;
             }
-            if (target != null && target.isDisplayedOnScreen()) {
+            if (target != null && isShown(target)) {
                 AccessibilityNodeProvider provider = target.getAccessibilityNodeProvider();
                 if (provider != null) {
                     succeeded = provider.performAction(virtualDescendantId, action,
@@ -590,7 +600,7 @@
             return null;
         }
         View foundView = root.findViewByAccessibilityId(accessibilityId);
-        if (foundView != null && !foundView.isDisplayedOnScreen()) {
+        if (foundView != null && !isShown(foundView)) {
             return null;
         }
         return foundView;
@@ -670,7 +680,7 @@
                         }
                         View child = children.getChildAt(i);
                         if (child.getAccessibilityViewId() != current.getAccessibilityViewId()
-                                &&  child.isDisplayedOnScreen()) {
+                                &&  isShown(child)) {
                             AccessibilityNodeInfo info = null;
                             AccessibilityNodeProvider provider = child.getAccessibilityNodeProvider();
                             if (provider == null) {
@@ -706,7 +716,7 @@
                         return;
                     }
                     View child = children.getChildAt(i);
-                    if (child.isDisplayedOnScreen()) {
+                    if (isShown(child)) {
                         AccessibilityNodeProvider provider = child.getAccessibilityNodeProvider();
                         if (provider == null) {
                             AccessibilityNodeInfo info = child.createAccessibilityNodeInfo();
diff --git a/core/java/android/view/KeyCharacterMap.java b/core/java/android/view/KeyCharacterMap.java
index 5b371eb..2cb724f 100644
--- a/core/java/android/view/KeyCharacterMap.java
+++ b/core/java/android/view/KeyCharacterMap.java
@@ -386,19 +386,19 @@
      *
      * @param keyCode The key code.
      * @param metaState The meta key modifier state.
-     * @param outFallbackAction The fallback action object to populate.
-     * @return True if a fallback action was found, false otherwise.
+     * @return The fallback action, or null if none.  Remember to recycle the fallback action.
      *
      * @hide
      */
-    public boolean getFallbackAction(int keyCode, int metaState,
-            FallbackAction outFallbackAction) {
-        if (outFallbackAction == null) {
-            throw new IllegalArgumentException("fallbackAction must not be null");
-        }
-
+    public FallbackAction getFallbackAction(int keyCode, int metaState) {
+        FallbackAction action = FallbackAction.obtain();
         metaState = KeyEvent.normalizeMetaState(metaState);
-        return nativeGetFallbackAction(mPtr, keyCode, metaState, outFallbackAction);
+        if (nativeGetFallbackAction(mPtr, keyCode, metaState, action)) {
+            action.metaState = KeyEvent.normalizeMetaState(action.metaState);
+            return action;
+        }
+        action.recycle();
+        return null;
     }
 
     /**
@@ -727,7 +727,44 @@
      * @hide
      */
     public static final class FallbackAction {
+        private static final int MAX_RECYCLED = 10;
+        private static final Object sRecycleLock = new Object();
+        private static FallbackAction sRecycleBin;
+        private static int sRecycledCount;
+
+        private FallbackAction next;
+
         public int keyCode;
         public int metaState;
+
+        private FallbackAction() {
+        }
+
+        public static FallbackAction obtain() {
+            final FallbackAction target;
+            synchronized (sRecycleLock) {
+                if (sRecycleBin == null) {
+                    target = new FallbackAction();
+                } else {
+                    target = sRecycleBin;
+                    sRecycleBin = target.next;
+                    sRecycledCount--;
+                    target.next = null;
+                }
+            }
+            return target;
+        }
+
+        public void recycle() {
+            synchronized (sRecycleLock) {
+                if (sRecycledCount < MAX_RECYCLED) {
+                    next = sRecycleBin;
+                    sRecycleBin = this;
+                    sRecycledCount += 1;
+                } else {
+                    next = null;
+                }
+            }
+        }
     }
 }
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 2972774..aad6756 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -4666,6 +4666,51 @@
     }
 
     /**
+     * Gets the location of this view in screen coordintates.
+     *
+     * @param outRect The output location
+     */
+    private void getBoundsOnScreen(Rect outRect) {
+        if (mAttachInfo == null) {
+            return;
+        }
+
+        RectF position = mAttachInfo.mTmpTransformRect;
+        position.set(0, 0, mRight - mLeft, mBottom - mTop);
+
+        if (!hasIdentityMatrix()) {
+            getMatrix().mapRect(position);
+        }
+
+        position.offset(mLeft, mTop);
+
+        ViewParent parent = mParent;
+        while (parent instanceof View) {
+            View parentView = (View) parent;
+
+            position.offset(-parentView.mScrollX, -parentView.mScrollY);
+
+            if (!parentView.hasIdentityMatrix()) {
+                parentView.getMatrix().mapRect(position);
+            }
+
+            position.offset(parentView.mLeft, parentView.mTop);
+
+            parent = parentView.mParent;
+        }
+
+        if (parent instanceof ViewRootImpl) {
+            ViewRootImpl viewRootImpl = (ViewRootImpl) parent;
+            position.offset(0, -viewRootImpl.mCurScrollY);
+        }
+
+        position.offset(mAttachInfo.mWindowLeft, mAttachInfo.mWindowTop);
+
+        outRect.set((int) (position.left + 0.5f), (int) (position.top + 0.5f),
+                (int) (position.right + 0.5f), (int) (position.bottom + 0.5f));
+    }
+
+    /**
      * @see #onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo)
      *
      * Note: Called from the default {@link AccessibilityDelegate}.
@@ -4675,8 +4720,7 @@
         getDrawingRect(bounds);
         info.setBoundsInParent(bounds);
 
-        getGlobalVisibleRect(bounds);
-        bounds.offset(mAttachInfo.mWindowLeft, mAttachInfo.mWindowTop);
+        getBoundsOnScreen(bounds);
         info.setBoundsInScreen(bounds);
 
         if ((mPrivateFlags & IS_ROOT_NAMESPACE) == 0) {
@@ -4686,6 +4730,8 @@
             }
         }
 
+        info.setVisibleToUser(isVisibleToUser());
+
         info.setPackageName(mContext.getPackageName());
         info.setClassName(View.class.getName());
         info.setContentDescription(getContentDescription());
@@ -4736,11 +4782,13 @@
     }
 
     /**
-     * Computes whether this view is visible on the screen.
+     * Computes whether this view is visible to the user. Such a view is
+     * attached, visible, all its predecessors are visible, it is not clipped
+     * entirely by its predecessors, and has an alpha greater than zero.
      *
      * @return Whether the view is visible on the screen.
      */
-    boolean isDisplayedOnScreen() {
+    private boolean isVisibleToUser() {
         // The first two checks are made also made by isShown() which
         // however traverses the tree up to the parent to catch that.
         // Therefore, we do some fail fast check to minimize the up
@@ -6395,9 +6443,9 @@
     boolean includeForAccessibility() {
         if (mAttachInfo != null) {
             if (!mAttachInfo.mIncludeNotImportantViews) {
-                return isImportantForAccessibility() && isDisplayedOnScreen();
+                return isImportantForAccessibility();
             } else {
-                return isDisplayedOnScreen();
+                return true;
             }
         }
         return false;
@@ -6463,12 +6511,31 @@
     /**
      * Performs the specified accessibility action on the view. For
      * possible accessibility actions look at {@link AccessibilityNodeInfo}.
+    * <p>
+    * If an {@link AccessibilityDelegate} has been specified via calling
+    * {@link #setAccessibilityDelegate(AccessibilityDelegate)} its
+    * {@link AccessibilityDelegate#performAccessibilityAction(View, int, Bundle)}
+    * is responsible for handling this call.
+    * </p>
      *
      * @param action The action to perform.
      * @param arguments Optional action arguments.
      * @return Whether the action was performed.
      */
     public boolean performAccessibilityAction(int action, Bundle arguments) {
+      if (mAccessibilityDelegate != null) {
+          return mAccessibilityDelegate.performAccessibilityAction(this, action, arguments);
+      } else {
+          return performAccessibilityActionInternal(action, arguments);
+      }
+    }
+
+   /**
+    * @see #performAccessibilityAction(int, Bundle)
+    *
+    * Note: Called from the default {@link AccessibilityDelegate}.
+    */
+    boolean performAccessibilityActionInternal(int action, Bundle arguments) {
         switch (action) {
             case AccessibilityNodeInfo.ACTION_CLICK: {
                 if (isClickable()) {
@@ -6665,6 +6732,7 @@
      * @hide
      */
     public void dispatchStartTemporaryDetach() {
+        clearAccessibilityFocus();
         onStartTemporaryDetach();
     }
 
@@ -11028,22 +11096,30 @@
         if ((mPrivateFlags & REQUEST_TRANSPARENT_REGIONS) != 0) {
             mParent.requestTransparentRegion(this);
         }
+
         if ((mPrivateFlags & AWAKEN_SCROLL_BARS_ON_ATTACH) != 0) {
             initialAwakenScrollBars();
             mPrivateFlags &= ~AWAKEN_SCROLL_BARS_ON_ATTACH;
         }
+
         jumpDrawablesToCurrentState();
+
         // Order is important here: LayoutDirection MUST be resolved before Padding
         // and TextDirection
         resolveLayoutDirection();
         resolvePadding();
         resolveTextDirection();
         resolveTextAlignment();
+
         clearAccessibilityFocus();
         if (isFocused()) {
             InputMethodManager imm = InputMethodManager.peekInstance();
             imm.focusIn(this);
         }
+
+        if (mAttachInfo != null && mDisplayList != null) {
+            mAttachInfo.mViewRootImpl.dequeueDisplayList(mDisplayList);
+        }
     }
 
     /**
@@ -11264,7 +11340,7 @@
 
         if (mAttachInfo != null) {
             if (mDisplayList != null) {
-                mAttachInfo.mViewRootImpl.invalidateDisplayList(mDisplayList);
+                mAttachInfo.mViewRootImpl.enqueueDisplayList(mDisplayList);
             }
             mAttachInfo.mViewRootImpl.cancelInvalidate(this);
         } else {
@@ -11279,7 +11355,6 @@
         resetResolvedLayoutDirection();
         resetResolvedTextAlignment();
         resetAccessibilityStateChanged();
-        clearAccessibilityFocus();
     }
 
     /**
@@ -11959,7 +12034,6 @@
 
             boolean caching = false;
             final HardwareCanvas canvas = displayList.start();
-            int restoreCount = 0;
             int width = mRight - mLeft;
             int height = mBottom - mTop;
 
@@ -12592,10 +12666,6 @@
         return more;
     }
 
-    void setDisplayListProperties() {
-        setDisplayListProperties(mDisplayList);
-    }
-
     /**
      * This method is called by getDisplayList() when a display list is created or re-rendered.
      * It sets or resets the current value of all properties on that display list (resetting is
@@ -17180,7 +17250,7 @@
         /**
          * Show where the margins, bounds and layout bounds are for each view.
          */
-        final boolean mDebugLayout = SystemProperties.getBoolean(DEBUG_LAYOUT_PROPERTY, false);
+        boolean mDebugLayout = SystemProperties.getBoolean(DEBUG_LAYOUT_PROPERTY, false);
 
         /**
          * Point used to compute visible regions.
@@ -17412,6 +17482,26 @@
         }
 
         /**
+         * Performs the specified accessibility action on the view. For
+         * possible accessibility actions look at {@link AccessibilityNodeInfo}.
+         * <p>
+         * The default implementation behaves as
+         * {@link View#performAccessibilityAction(int, Bundle)
+         *  View#performAccessibilityAction(int, Bundle)} for the case of
+         *  no accessibility delegate been set.
+         * </p>
+         *
+         * @param action The action to perform.
+         * @return Whether the action was performed.
+         *
+         * @see View#performAccessibilityAction(int, Bundle)
+         *      View#performAccessibilityAction(int, Bundle)
+         */
+        public boolean performAccessibilityAction(View host, int action, Bundle args) {
+            return host.performAccessibilityActionInternal(action, args);
+        }
+
+        /**
          * Sends an accessibility event. This method behaves exactly as
          * {@link #sendAccessibilityEvent(View, int)} but takes as an argument an
          * empty {@link AccessibilityEvent} and does not perform a check whether
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 29613d5..acfca26 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -3586,6 +3586,8 @@
             clearChildFocus = true;
         }
 
+        view.clearAccessibilityFocus();
+
         cancelTouchTarget(view);
         cancelHoverTarget(view);
 
@@ -3669,6 +3671,8 @@
                 clearChildFocus = view;
             }
 
+            view.clearAccessibilityFocus();
+
             cancelTouchTarget(view);
             cancelHoverTarget(view);
 
@@ -3742,6 +3746,8 @@
                 clearChildFocus = view;
             }
 
+            view.clearAccessibilityFocus();
+
             cancelTouchTarget(view);
             cancelHoverTarget(view);
 
@@ -3790,6 +3796,8 @@
             child.clearFocus();
         }
 
+        child.clearAccessibilityFocus();
+
         cancelTouchTarget(child);
         cancelHoverTarget(child);
 
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index ec6bd81..b43db14 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -328,8 +328,6 @@
 
     private final int mDensity;
 
-    final KeyCharacterMap.FallbackAction mFallbackAction = new KeyCharacterMap.FallbackAction();
-
     /**
      * Consistency verifier for debugging purposes.
      */
@@ -408,6 +406,7 @@
 
         PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
         mAttachInfo.mScreenOn = powerManager.isScreenOn();
+        loadSystemProperties();
     }
 
     /**
@@ -846,6 +845,16 @@
         scheduleTraversals();
     }
 
+    void invalidateWorld(View view) {
+        view.invalidate();
+        if (view instanceof ViewGroup) {
+            ViewGroup parent = (ViewGroup)view;
+            for (int i=0; i<parent.getChildCount(); i++) {
+                invalidateWorld(parent.getChildAt(i));
+            }
+        }
+    }
+
     public void invalidateChild(View child, Rect dirty) {
         invalidateChildInParent(null, dirty);
     }
@@ -2373,7 +2382,7 @@
             }
         } else {
             if (mAccessibilityFocusedVirtualView == null) {
-                mAccessibilityFocusedVirtualView = provider.findAccessibilitiyFocus(View.NO_ID);
+                mAccessibilityFocusedVirtualView = provider.findAccessibilityFocus(View.NO_ID);
             }
             if (mAccessibilityFocusedVirtualView == null) {
                 return;
@@ -2730,6 +2739,7 @@
     private final static int MSG_INVALIDATE_DISPLAY_LIST = 21;
     private final static int MSG_CLEAR_ACCESSIBILITY_FOCUS_HOST = 22;
     private final static int MSG_DISPATCH_DONE_ANIMATING = 23;
+    private final static int MSG_INVALIDATE_WORLD = 24;
 
     final class ViewRootHandler extends Handler {
         @Override
@@ -2997,6 +3007,9 @@
             case MSG_DISPATCH_DONE_ANIMATING: {
                 handleDispatchDoneAnimating();
             } break;
+            case MSG_INVALIDATE_WORLD: {
+                invalidateWorld(mView);
+            } break;
             }
         }
     }
@@ -4016,6 +4029,17 @@
         mHandler.sendMessage(msg);
     }
 
+    public void loadSystemProperties() {
+        boolean layout = SystemProperties.getBoolean(
+                View.DEBUG_LAYOUT_PROPERTY, false);
+        if (layout != mAttachInfo.mDebugLayout) {
+            mAttachInfo.mDebugLayout = layout;
+            if (!mHandler.hasMessages(MSG_INVALIDATE_WORLD)) {
+                mHandler.sendEmptyMessageDelayed(MSG_INVALIDATE_WORLD, 200);
+            }
+        }
+    }
+
     private void destroyHardwareRenderer() {
         AttachInfo attachInfo = mAttachInfo;
         HardwareRenderer hardwareRenderer = attachInfo.mHardwareRenderer;
@@ -4412,14 +4436,23 @@
         mInvalidateOnAnimationRunnable.addViewRect(info);
     }
 
-    public void invalidateDisplayList(DisplayList displayList) {
+    public void enqueueDisplayList(DisplayList displayList) {
         mDisplayLists.add(displayList);
 
         mHandler.removeMessages(MSG_INVALIDATE_DISPLAY_LIST);
         Message msg = mHandler.obtainMessage(MSG_INVALIDATE_DISPLAY_LIST);
         mHandler.sendMessage(msg);
     }
-    
+
+    public void dequeueDisplayList(DisplayList displayList) {
+        if (mDisplayLists.remove(displayList)) {
+            displayList.invalidate();
+            if (mDisplayLists.size() == 0) {
+                mHandler.removeMessages(MSG_INVALIDATE_DISPLAY_LIST);
+            }
+        }
+    }
+
     public void cancelInvalidate(View view) {
         mHandler.removeMessages(MSG_INVALIDATE, view);
         // fixme: might leak the AttachInfo.InvalidateInfo objects instead of returning
@@ -4446,20 +4479,19 @@
             final int keyCode = event.getKeyCode();
             final int metaState = event.getMetaState();
 
-            KeyEvent fallbackEvent = null;
-            synchronized (mFallbackAction) {
-                // Check for fallback actions specified by the key character map.
-                if (kcm.getFallbackAction(keyCode, metaState, mFallbackAction)) {
-                    int flags = event.getFlags() | KeyEvent.FLAG_FALLBACK;
-                    fallbackEvent = KeyEvent.obtain(
-                            event.getDownTime(), event.getEventTime(),
-                            event.getAction(), mFallbackAction.keyCode,
-                            event.getRepeatCount(), mFallbackAction.metaState,
-                            event.getDeviceId(), event.getScanCode(),
-                            flags, event.getSource(), null);
-                }
-            }
-            if (fallbackEvent != null) {
+            // Check for fallback actions specified by the key character map.
+            KeyCharacterMap.FallbackAction fallbackAction =
+                    kcm.getFallbackAction(keyCode, metaState);
+            if (fallbackAction != null) {
+                final int flags = event.getFlags() | KeyEvent.FLAG_FALLBACK;
+                KeyEvent fallbackEvent = KeyEvent.obtain(
+                        event.getDownTime(), event.getEventTime(),
+                        event.getAction(), fallbackAction.keyCode,
+                        event.getRepeatCount(), fallbackAction.metaState,
+                        event.getDeviceId(), event.getScanCode(),
+                        flags, event.getSource(), null);
+                fallbackAction.recycle();
+
                 dispatchKey(fallbackEvent);
             }
         }
diff --git a/core/java/android/view/WindowManagerImpl.java b/core/java/android/view/WindowManagerImpl.java
index b5690e9..5d33cec 100644
--- a/core/java/android/view/WindowManagerImpl.java
+++ b/core/java/android/view/WindowManagerImpl.java
@@ -23,6 +23,7 @@
 import android.graphics.PixelFormat;
 import android.opengl.ManagedEGLContext;
 import android.os.IBinder;
+import android.os.SystemProperties;
 import android.util.AndroidRuntimeException;
 import android.util.Log;
 import android.view.inputmethod.InputMethodManager;
@@ -112,6 +113,8 @@
     private WindowManager.LayoutParams[] mParams;
     private boolean mNeedsEglTerminate;
 
+    private Runnable mSystemPropertyUpdater = null;
+
     private final static Object sLock = new Object();
     private final static WindowManagerImpl sWindowManager = new WindowManagerImpl();
     private final static HashMap<CompatibilityInfo, WindowManager> sCompatWindowManagers
@@ -237,6 +240,22 @@
         View panelParentView = null;
         
         synchronized (this) {
+            // Start watching for system property changes.
+            if (mSystemPropertyUpdater == null) {
+                mSystemPropertyUpdater = new Runnable() {
+                    @Override public void run() {
+                        synchronized (this) {
+                            synchronized (this) {
+                                for (ViewRootImpl root : mRoots) {
+                                    root.loadSystemProperties();
+                                }
+                            }
+                        }
+                    }
+                };
+                SystemProperties.addChangeCallback(mSystemPropertyUpdater);
+            }
+
             // Here's an odd/questionable case: if someone tries to add a
             // view multiple times, then we simply bump up a nesting count
             // and they need to remove the view the corresponding number of
diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java
index e725e75..388cfb3 100644
--- a/core/java/android/view/WindowManagerPolicy.java
+++ b/core/java/android/view/WindowManagerPolicy.java
@@ -1017,7 +1017,7 @@
 
     /**
      * Called when we have finished booting and can now display the home
-     * screen to the user.  This wilWl happen after systemReady(), and at
+     * screen to the user.  This will happen after systemReady(), and at
      * this point the display is active.
      */
     public void enableScreenAfterBoot();
diff --git a/core/java/android/view/accessibility/AccessibilityNodeInfo.java b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
index fef24e2..6b14ba5 100644
--- a/core/java/android/view/accessibility/AccessibilityNodeInfo.java
+++ b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
@@ -287,6 +287,8 @@
 
     private static final int PROPERTY_ACCESSIBILITY_FOCUSED = 0x00000400;
 
+    private static final int PROPERTY_VISIBLE_TO_USER = 0x00000800;
+
     /**
      * Bits that provide the id of a virtual descendant of a view.
      */
@@ -910,6 +912,31 @@
     }
 
     /**
+     * Sets whether this node is visible to the user.
+     *
+     * @return Whether the node is visible to the user.
+     */
+    public boolean isVisibleToUser() {
+        return getBooleanProperty(PROPERTY_VISIBLE_TO_USER);
+    }
+
+    /**
+     * Sets whether this node is visible to the user.
+     * <p>
+     *   <strong>Note:</strong> Cannot be called from an
+     *   {@link android.accessibilityservice.AccessibilityService}.
+     *   This class is made immutable before being delivered to an AccessibilityService.
+     * </p>
+     *
+     * @param visibleToUser Whether the node is visible to the user.
+     *
+     * @throws IllegalStateException If called from an AccessibilityService.
+     */
+    public void setVisibleToUser(boolean visibleToUser) {
+        setBooleanProperty(PROPERTY_VISIBLE_TO_USER, visibleToUser);
+    }
+
+    /**
      * Gets whether this node is accessibility focused.
      *
      * @return True if the node is accessibility focused.
diff --git a/core/java/android/view/accessibility/AccessibilityNodeProvider.java b/core/java/android/view/accessibility/AccessibilityNodeProvider.java
index a2e0d88..e60716d 100644
--- a/core/java/android/view/accessibility/AccessibilityNodeProvider.java
+++ b/core/java/android/view/accessibility/AccessibilityNodeProvider.java
@@ -151,7 +151,7 @@
      * @see #createAccessibilityNodeInfo(int)
      * @see AccessibilityNodeInfo
      */
-    public AccessibilityNodeInfo findAccessibilitiyFocus(int virtualViewId) {
+    public AccessibilityNodeInfo findAccessibilityFocus(int virtualViewId) {
         return null;
     }
 
diff --git a/core/java/android/webkit/WebViewClassic.java b/core/java/android/webkit/WebViewClassic.java
index 92143203..057c3d1 100644
--- a/core/java/android/webkit/WebViewClassic.java
+++ b/core/java/android/webkit/WebViewClassic.java
@@ -609,6 +609,10 @@
     // The presumed scroll rate for the first scroll of edit text
     static private final long TEXT_SCROLL_FIRST_SCROLL_MS = 16;
 
+    // Buffer pixels of the caret rectangle when moving edit text into view
+    // after resize.
+    static private final int EDIT_RECT_BUFFER = 10;
+
     // true means redraw the screen all-the-time. Only with AUTO_REDRAW_HACK
     private boolean mAutoRedraw;
 
@@ -2000,11 +2004,6 @@
     }
 
     private void destroyImpl() {
-        int drawGLFunction = nativeGetDrawGLFunction(mNativeClass);
-        ViewRootImpl viewRoot = mWebView.getViewRootImpl();
-        Log.d(LOGTAG, String.format("destroyImpl, drawGLFunction %x,  viewroot == null %b, isHWAccel %b",
-                                    drawGLFunction, (viewRoot == null), mWebView.isHardwareAccelerated()));
-
         mCallbackProxy.blockMessages();
         clearHelpers();
         if (mListBoxDialog != null) {
@@ -3299,7 +3298,8 @@
     }
 
     public int getPageBackgroundColor() {
-        return nativeGetBackgroundColor();
+        if (mNativeClass == 0) return Color.WHITE;
+        return nativeGetBackgroundColor(mNativeClass);
     }
 
     /**
@@ -4456,7 +4456,7 @@
         if (mNativeClass == 0) {
             return 0;
         }
-        return nativeGetBaseLayer();
+        return nativeGetBaseLayer(mNativeClass);
     }
 
     private void onZoomAnimationStart() {
@@ -5392,11 +5392,9 @@
         removeAccessibilityApisFromJavaScript();
         updateHwAccelerated();
 
-        int drawGLFunction = nativeGetDrawGLFunction(mNativeClass);
-        ViewRootImpl viewRoot = mWebView.getViewRootImpl();
-        Log.d(LOGTAG, String.format("onDetachedFromWindow, drawGLFunction %x,  viewroot == null %b, isHWAccel %b",
-                                    drawGLFunction, (viewRoot == null), mWebView.isHardwareAccelerated()));
         if (mWebView.isHardwareAccelerated()) {
+            int drawGLFunction = nativeGetDrawGLFunction(mNativeClass);
+            ViewRootImpl viewRoot = mWebView.getViewRootImpl();
             if (drawGLFunction != 0 && viewRoot != null) {
                 viewRoot.detachFunctor(drawGLFunction);
             }
@@ -5581,9 +5579,76 @@
             // However, do not update the base layer as that hasn't changed
             setNewPicture(mLoadedPicture, false);
         }
+        if (mIsEditingText) {
+            scrollEditIntoView();
+        }
         relocateAutoCompletePopup();
     }
 
+    /**
+     * Scrolls the edit field into view using the minimum scrolling necessary.
+     * If the edit field is too large to fit in the visible window, the caret
+     * dimensions are used so that at least the caret is visible.
+     * A buffer of EDIT_RECT_BUFFER in view pixels is used to offset the
+     * edit rectangle to ensure a margin with the edge of the screen.
+     */
+    private void scrollEditIntoView() {
+        Rect visibleRect = new Rect(viewToContentX(getScrollX()),
+                viewToContentY(getScrollY()),
+                viewToContentX(getScrollX() + getWidth()),
+                viewToContentY(getScrollY() + getViewHeightWithTitle()));
+        if (visibleRect.contains(mEditTextContentBounds)) {
+            return; // no need to scroll
+        }
+        syncSelectionCursors();
+        final int buffer = Math.max(1, viewToContentDimension(EDIT_RECT_BUFFER));
+        Rect showRect = new Rect(
+                Math.max(0, mEditTextContentBounds.left - buffer),
+                Math.max(0, mEditTextContentBounds.top - buffer),
+                mEditTextContentBounds.right + buffer,
+                mEditTextContentBounds.bottom + buffer);
+        Point caretTop = calculateCaretTop();
+        if (visibleRect.width() < mEditTextContentBounds.width()) {
+            // The whole edit won't fit in the width, so use the caret rect
+            if (mSelectCursorBase.x < caretTop.x) {
+                showRect.left = Math.max(0, mSelectCursorBase.x - buffer);
+                showRect.right = caretTop.x + buffer;
+            } else {
+                showRect.left = Math.max(0, caretTop.x - buffer);
+                showRect.right = mSelectCursorBase.x + buffer;
+            }
+        }
+        if (visibleRect.height() < mEditTextContentBounds.height()) {
+            // The whole edit won't fit in the height, so use the caret rect
+            if (mSelectCursorBase.y > caretTop.y) {
+                showRect.top = Math.max(0, caretTop.y - buffer);
+                showRect.bottom = mSelectCursorBase.y + buffer;
+            } else {
+                showRect.top = Math.max(0, mSelectCursorBase.y - buffer);
+                showRect.bottom = caretTop.y + buffer;
+            }
+        }
+
+        if (visibleRect.contains(showRect)) {
+            return; // no need to scroll
+        }
+
+        int scrollX = visibleRect.left;
+        if (visibleRect.left > showRect.left) {
+            scrollX = showRect.left;
+        } else if (visibleRect.right < showRect.right) {
+            scrollX = Math.max(0, showRect.right - visibleRect.width());
+        }
+        int scrollY = visibleRect.top;
+        if (visibleRect.top > showRect.top) {
+            scrollY = showRect.top;
+        } else if (visibleRect.bottom < showRect.bottom) {
+            scrollY = Math.max(0, showRect.bottom - visibleRect.height());
+        }
+
+        contentScrollTo(scrollX, scrollY, false);
+    }
+
     @Override
     public void onScrollChanged(int l, int t, int oldl, int oldt) {
         if (!mInOverScrollMode) {
@@ -8593,7 +8658,7 @@
     private native void     nativeSetHeightCanMeasure(boolean measure);
     private native boolean  nativeSetBaseLayer(int nativeInstance,
             int layer, boolean showVisualIndicator, boolean isPictureAfterFirstLayout);
-    private native int      nativeGetBaseLayer();
+    private native int      nativeGetBaseLayer(int nativeInstance);
     private native void     nativeCopyBaseContentToPicture(Picture pict);
     private native boolean  nativeHasContent();
     private native void     nativeStopGL();
@@ -8621,7 +8686,7 @@
      */
     private native boolean  nativeScrollLayer(int nativeInstance, int layer, int newX, int newY);
     private native void     nativeSetIsScrolling(boolean isScrolling);
-    private native int      nativeGetBackgroundColor();
+    private native int      nativeGetBackgroundColor(int nativeInstance);
     native boolean  nativeSetProperty(String key, String value);
     native String   nativeGetProperty(String key);
     /**
diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java
index 661bbf8..4adfd6a 100644
--- a/core/java/android/webkit/WebViewCore.java
+++ b/core/java/android/webkit/WebViewCore.java
@@ -2176,11 +2176,12 @@
 
     DrawData mLastDrawData = null;
 
-    private Boolean m_skipDrawFlag = false;
+    private Object m_skipDrawFlagLock = new Object();
+    private boolean m_skipDrawFlag = false;
     private boolean m_drawWasSkipped = false;
 
     void pauseWebKitDraw() {
-        synchronized (m_skipDrawFlag) {
+        synchronized (m_skipDrawFlagLock) {
             if (!m_skipDrawFlag) {
                 m_skipDrawFlag = true;
             }
@@ -2188,7 +2189,7 @@
     }
 
     void resumeWebKitDraw() {
-        synchronized (m_skipDrawFlag) {
+        synchronized (m_skipDrawFlagLock) {
             if (m_skipDrawFlag && m_drawWasSkipped) {
                 // a draw was dropped, send a retry
                 m_drawWasSkipped = false;
@@ -2199,7 +2200,7 @@
     }
 
     private void webkitDraw() {
-        synchronized (m_skipDrawFlag) {
+        synchronized (m_skipDrawFlagLock) {
             if (m_skipDrawFlag) {
                 m_drawWasSkipped = true;
                 return;
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index a3b613b..3aafba5 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -25,6 +25,7 @@
 import android.graphics.Rect;
 import android.graphics.drawable.Drawable;
 import android.graphics.drawable.TransitionDrawable;
+import android.os.Bundle;
 import android.os.Debug;
 import android.os.Handler;
 import android.os.Parcel;
@@ -57,6 +58,7 @@
 import android.view.ViewParent;
 import android.view.ViewTreeObserver;
 import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityManager;
 import android.view.accessibility.AccessibilityNodeInfo;
 import android.view.animation.Interpolator;
 import android.view.animation.LinearInterpolator;
@@ -648,6 +650,11 @@
     private int mGlowPaddingLeft;
     private int mGlowPaddingRight;
 
+    /**
+     * Used for interacting with list items from an accessibility service.
+     */
+    private ListItemAccessibilityDelegate mAccessibilityDelegate;
+
     private int mLastAccessibilityScrollEventFromIndex;
     private int mLastAccessibilityScrollEventToIndex;
 
@@ -2121,9 +2128,77 @@
             child.setLayoutParams(lp);
         }
 
+        if (AccessibilityManager.getInstance(mContext).isEnabled()) {
+            if (mAccessibilityDelegate == null) {
+                mAccessibilityDelegate = new ListItemAccessibilityDelegate();
+            }
+            child.setAccessibilityDelegate(mAccessibilityDelegate);
+        }
+
         return child;
     }
 
+    class ListItemAccessibilityDelegate extends AccessibilityDelegate {
+        @Override
+        public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
+            super.onInitializeAccessibilityNodeInfo(host, info);
+
+            final int position = getPositionForView(host);
+
+            if (position == INVALID_POSITION) {
+                return;
+            }
+
+            if (isClickable()) {
+                info.addAction(AccessibilityNodeInfo.ACTION_CLICK);
+                info.setClickable(true);
+            }
+
+            if (isLongClickable()) {
+                info.addAction(AccessibilityNodeInfo.ACTION_LONG_CLICK);
+                info.setLongClickable(true);
+            }
+
+            info.addAction(AccessibilityNodeInfo.ACTION_SELECT);
+
+            if (position == getSelectedItemPosition()) {
+                info.setSelected(true);
+            }
+        }
+
+        @Override
+        public boolean performAccessibilityAction(View host, int action, Bundle arguments) {
+            final int position = getPositionForView(host);
+
+            if (position == INVALID_POSITION) {
+                return false;
+            }
+
+            final long id = getItemIdAtPosition(position);
+
+            switch (action) {
+                case AccessibilityNodeInfo.ACTION_SELECT:
+                    setSelection(position);
+                    return true;
+                case AccessibilityNodeInfo.ACTION_CLICK:
+                    if (!super.performAccessibilityAction(host, action, arguments)) {
+                        return performItemClick(host, position, id);
+                    }
+                    return true;
+                case AccessibilityNodeInfo.ACTION_LONG_CLICK:
+                    if (!super.performAccessibilityAction(host, action, arguments)) {
+                        return performLongPress(host, position, id);
+                    }
+                    return true;
+                case AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS:
+                    smoothScrollToPosition(position);
+                    break;
+            }
+
+            return super.performAccessibilityAction(host, action, arguments);
+        }
+    }
+
     void positionSelector(int position, View sel) {
         if (position != INVALID_POSITION) {
             mSelectorPosition = position;
@@ -4009,17 +4084,19 @@
         void start(final int position) {
             stop();
 
+            if (mDataChanged) {
+                // Wait until we're back in a stable state to try this.
+                post(new Runnable() {
+                    @Override public void run() {
+                        start(position);
+                    }
+                });
+                return;
+            }
+
             final int childCount = getChildCount();
             if (childCount == 0) {
                 // Can't scroll without children.
-                if (mDataChanged) {
-                    // But we might have something in a minute.
-                    post(new Runnable() {
-                        @Override public void run() {
-                            start(position);
-                        }
-                    });
-                }
                 return;
             }
 
@@ -4058,17 +4135,19 @@
                 return;
             }
 
+            if (mDataChanged) {
+                // Wait until we're back in a stable state to try this.
+                post(new Runnable() {
+                    @Override public void run() {
+                        start(position, boundPosition);
+                    }
+                });
+                return;
+            }
+
             final int childCount = getChildCount();
             if (childCount == 0) {
                 // Can't scroll without children.
-                if (mDataChanged) {
-                    // But we might have something in a minute.
-                    post(new Runnable() {
-                        @Override public void run() {
-                            start(position, boundPosition);
-                        }
-                    });
-                }
                 return;
             }
 
@@ -4129,9 +4208,26 @@
             startWithOffset(position, offset, SCROLL_DURATION);
         }
 
-        void startWithOffset(int position, int offset, int duration) {
+        void startWithOffset(final int position, int offset, final int duration) {
             stop();
 
+            if (mDataChanged) {
+                // Wait until we're back in a stable state to try this.
+                final int postOffset = offset;
+                post(new Runnable() {
+                    @Override public void run() {
+                        startWithOffset(position, postOffset, duration);
+                    }
+                });
+                return;
+            }
+
+            final int childCount = getChildCount();
+            if (childCount == 0) {
+                // Can't scroll without children.
+                return;
+            }
+
             offset += getPaddingTop();
 
             mTargetPos = position;
@@ -4141,7 +4237,6 @@
             mMode = MOVE_OFFSET;
 
             final int firstPos = mFirstPosition;
-            final int childCount = getChildCount();
             final int lastPos = firstPos + childCount - 1;
 
             int viewTravelCount;
@@ -4514,7 +4609,7 @@
 
         if (distance == 0 || mItemCount == 0 || childCount == 0 ||
                 (firstPos == 0 && getChildAt(0).getTop() == topLimit && distance < 0) ||
-                (lastPos == mItemCount - 1 &&
+                (lastPos == mItemCount &&
                         getChildAt(childCount - 1).getBottom() == bottomLimit && distance > 0)) {
             mFlingRunnable.endFling();
             if (mPositionScroller != null) {
@@ -5651,6 +5746,7 @@
             // Don't reclaim header or footer views, or views that should be ignored
             if (lp != null && mRecycler.shouldRecycleViewType(lp.viewType)) {
                 views.add(child);
+                child.setAccessibilityDelegate(null);
                 if (listener != null) {
                     // Pretend they went through the scrap heap
                     listener.onMovedToScrapHeap(child);
@@ -6206,6 +6302,7 @@
                 mScrapViews[viewType].add(scrap);
             }
 
+            scrap.setAccessibilityDelegate(null);
             if (mRecyclerListener != null) {
                 mRecyclerListener.onMovedToScrapHeap(scrap);
             }
@@ -6267,6 +6364,7 @@
                     lp.scrappedFromPosition = mFirstActivePosition + i;
                     scrapViews.add(victim);
 
+                    victim.setAccessibilityDelegate(null);
                     if (hasListener) {
                         mRecyclerListener.onMovedToScrapHeap(victim);
                     }
diff --git a/core/java/android/widget/SpellChecker.java b/core/java/android/widget/SpellChecker.java
index e1103dd..ebf8a4a 100644
--- a/core/java/android/widget/SpellChecker.java
+++ b/core/java/android/widget/SpellChecker.java
@@ -427,12 +427,6 @@
         if (spellCheckSpanStart < 0 || spellCheckSpanEnd <= spellCheckSpanStart)
             return; // span was removed in the meantime
 
-        final int suggestionsCount = suggestionsInfo.getSuggestionsCount();
-        if (suggestionsCount <= 0) {
-            // A negative suggestion count is possible
-            return;
-        }
-
         final int start;
         final int end;
         if (offset != USE_SPAN_RANGE && length != USE_SPAN_RANGE) {
@@ -443,9 +437,15 @@
             end = spellCheckSpanEnd;
         }
 
-        String[] suggestions = new String[suggestionsCount];
-        for (int i = 0; i < suggestionsCount; i++) {
-            suggestions[i] = suggestionsInfo.getSuggestionAt(i);
+        final int suggestionsCount = suggestionsInfo.getSuggestionsCount();
+        String[] suggestions;
+        if (suggestionsCount > 0) {
+            suggestions = new String[suggestionsCount];
+            for (int i = 0; i < suggestionsCount; i++) {
+                suggestions[i] = suggestionsInfo.getSuggestionAt(i);
+            }
+        } else {
+            suggestions = ArrayUtils.emptyArray(String.class);
         }
 
         SuggestionSpan suggestionSpan = new SuggestionSpan(mTextView.getContext(), suggestions,
@@ -453,7 +453,7 @@
         // TODO: Remove mIsSentenceSpellCheckSupported by extracting an interface
         // to share the logic of word level spell checker and sentence level spell checker
         if (mIsSentenceSpellCheckSupported) {
-            final long key = TextUtils.packRangeInLong(start, end);
+            final Long key = Long.valueOf(TextUtils.packRangeInLong(start, end));
             final SuggestionSpan tempSuggestionSpan = mSuggestionSpanCache.get(key);
             if (tempSuggestionSpan != null) {
                 if (DBG) {
@@ -611,6 +611,9 @@
                     if (spellCheckEnd < start) {
                         break;
                     }
+                    if (spellCheckEnd <= spellCheckStart) {
+                        break;
+                    }
                     if (createSpellCheckSpan) {
                         addSpellCheckSpan(editable, spellCheckStart, spellCheckEnd);
                     }
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index f2334aea..555c974 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -397,7 +397,7 @@
 
     /**
      * EditText specific data, created on demand when one of the Editor fields is used.
-     * See {@link #createEditorIfNeeded(String)}.
+     * See {@link #createEditorIfNeeded()}.
      */
     private Editor mEditor;
 
@@ -798,20 +798,20 @@
                 break;
 
             case com.android.internal.R.styleable.TextView_imeOptions:
-                createEditorIfNeeded("IME options specified in constructor");
+                createEditorIfNeeded();
                 mEditor.createInputContentTypeIfNeeded();
                 mEditor.mInputContentType.imeOptions = a.getInt(attr,
                         mEditor.mInputContentType.imeOptions);
                 break;
 
             case com.android.internal.R.styleable.TextView_imeActionLabel:
-                createEditorIfNeeded("IME action label specified in constructor");
+                createEditorIfNeeded();
                 mEditor.createInputContentTypeIfNeeded();
                 mEditor.mInputContentType.imeActionLabel = a.getText(attr);
                 break;
 
             case com.android.internal.R.styleable.TextView_imeActionId:
-                createEditorIfNeeded("IME action id specified in constructor");
+                createEditorIfNeeded();
                 mEditor.createInputContentTypeIfNeeded();
                 mEditor.mInputContentType.imeActionId = a.getInt(attr,
                         mEditor.mInputContentType.imeActionId);
@@ -883,7 +883,7 @@
             }
 
             try {
-                createEditorIfNeeded("inputMethod in ctor");
+                createEditorIfNeeded();
                 mEditor.mKeyListener = (KeyListener) c.newInstance();
             } catch (InstantiationException ex) {
                 throw new RuntimeException(ex);
@@ -898,7 +898,7 @@
                 mEditor.mInputType = EditorInfo.TYPE_CLASS_TEXT;
             }
         } else if (digits != null) {
-            createEditorIfNeeded("digits in ctor");
+            createEditorIfNeeded();
             mEditor.mKeyListener = DigitsKeyListener.getInstance(digits.toString());
             // If no input type was specified, we will default to generic
             // text, since we can't tell the IME about the set of digits
@@ -910,11 +910,11 @@
             // If set, the input type overrides what was set using the deprecated singleLine flag.
             singleLine = !isMultilineInputType(inputType);
         } else if (phone) {
-            createEditorIfNeeded("dialer in ctor");
+            createEditorIfNeeded();
             mEditor.mKeyListener = DialerKeyListener.getInstance();
             mEditor.mInputType = inputType = EditorInfo.TYPE_CLASS_PHONE;
         } else if (numeric != 0) {
-            createEditorIfNeeded("numeric in ctor");
+            createEditorIfNeeded();
             mEditor.mKeyListener = DigitsKeyListener.getInstance((numeric & SIGNED) != 0,
                                                    (numeric & DECIMAL) != 0);
             inputType = EditorInfo.TYPE_CLASS_NUMBER;
@@ -951,7 +951,7 @@
                 break;
             }
 
-            createEditorIfNeeded("text input in ctor");
+            createEditorIfNeeded();
             mEditor.mKeyListener = TextKeyListener.getInstance(autotext, cap);
             mEditor.mInputType = inputType;
         } else if (isTextSelectable()) {
@@ -964,7 +964,7 @@
             // So that selection can be changed using arrow keys and touch is handled.
             setMovementMethod(ArrowKeyMovementMethod.getInstance());
         } else if (editable) {
-            createEditorIfNeeded("editable input in ctor");
+            createEditorIfNeeded();
             mEditor.mKeyListener = TextKeyListener.getInstance();
             mEditor.mInputType = EditorInfo.TYPE_CLASS_TEXT;
         } else {
@@ -987,7 +987,7 @@
                 webPasswordInputType, numberPasswordInputType);
 
         if (selectallonfocus) {
-            createEditorIfNeeded("selectallonfocus in constructor");
+            createEditorIfNeeded();
             mEditor.mSelectAllOnFocus = true;
 
             if (bufferType == BufferType.NORMAL)
@@ -1335,7 +1335,7 @@
         fixFocusableAndClickableSettings();
 
         if (input != null) {
-            createEditorIfNeeded("input is not null");
+            createEditorIfNeeded();
             try {
                 mEditor.mInputType = mEditor.mKeyListener.getInputType();
             } catch (IncompatibleClassChangeError e) {
@@ -1355,7 +1355,7 @@
     private void setKeyListenerOnly(KeyListener input) {
         if (mEditor == null && input == null) return; // null is the default value
 
-        createEditorIfNeeded("setKeyListenerOnly");
+        createEditorIfNeeded();
         if (mEditor.mKeyListener != input) {
             mEditor.mKeyListener = input;
             if (input != null && !(mText instanceof Editable)) {
@@ -2383,7 +2383,7 @@
      */
     @android.view.RemotableViewMethod
     public final void setShowSoftInputOnFocus(boolean show) {
-        createEditorIfNeeded("setShowSoftInputOnFocus");
+        createEditorIfNeeded();
         mEditor.mShowSoftInputOnFocus = show;
     }
 
@@ -3263,7 +3263,7 @@
                     Selection.setSelection((Spannable) mText, ss.selStart, ss.selEnd);
 
                     if (ss.frozenWithFocus) {
-                        createEditorIfNeeded("restore instance with focus");
+                        createEditorIfNeeded();
                         mEditor.mFrozenWithFocus = true;
                     }
                 }
@@ -3424,7 +3424,7 @@
 
         if (type == BufferType.EDITABLE || getKeyListener() != null ||
                 needEditableForNotification) {
-            createEditorIfNeeded("setText with BufferType.EDITABLE or non null mInput");
+            createEditorIfNeeded();
             Editable t = mEditableFactory.newEditable(text);
             text = t;
             setFilters(t, mFilters);
@@ -3768,7 +3768,7 @@
      */
     public void setRawInputType(int type) {
         if (type == InputType.TYPE_NULL && mEditor == null) return; //TYPE_NULL is the default value
-        createEditorIfNeeded("non null input type");
+        createEditorIfNeeded();
         mEditor.mInputType = type;
     }
 
@@ -3811,7 +3811,7 @@
         }
         setRawInputType(type);
         if (direct) {
-            createEditorIfNeeded("setInputType");
+            createEditorIfNeeded();
             mEditor.mKeyListener = input;
         } else {
             setKeyListenerOnly(input);
@@ -3837,7 +3837,7 @@
      * @attr ref android.R.styleable#TextView_imeOptions
      */
     public void setImeOptions(int imeOptions) {
-        createEditorIfNeeded("IME options specified");
+        createEditorIfNeeded();
         mEditor.createInputContentTypeIfNeeded();
         mEditor.mInputContentType.imeOptions = imeOptions;
     }
@@ -3864,7 +3864,7 @@
      * @attr ref android.R.styleable#TextView_imeActionId
      */
     public void setImeActionLabel(CharSequence label, int actionId) {
-        createEditorIfNeeded("IME action label specified");
+        createEditorIfNeeded();
         mEditor.createInputContentTypeIfNeeded();
         mEditor.mInputContentType.imeActionLabel = label;
         mEditor.mInputContentType.imeActionId = actionId;
@@ -3901,7 +3901,7 @@
      * modifier will, however, allow the user to insert a newline character.
      */
     public void setOnEditorActionListener(OnEditorActionListener l) {
-        createEditorIfNeeded("Editor action listener set");
+        createEditorIfNeeded();
         mEditor.createInputContentTypeIfNeeded();
         mEditor.mInputContentType.onEditorActionListener = l;
     }
@@ -3998,7 +3998,7 @@
      * @attr ref android.R.styleable#TextView_privateImeOptions
      */
     public void setPrivateImeOptions(String type) {
-        createEditorIfNeeded("Private IME option set");
+        createEditorIfNeeded();
         mEditor.createInputContentTypeIfNeeded();
         mEditor.mInputContentType.privateImeOptions = type;
     }
@@ -4026,7 +4026,7 @@
      * @attr ref android.R.styleable#TextView_editorExtras
      */
     public void setInputExtras(int xmlResId) throws XmlPullParserException, IOException {
-        createEditorIfNeeded("Input extra set");
+        createEditorIfNeeded();
         XmlResourceParser parser = getResources().getXml(xmlResId);
         mEditor.createInputContentTypeIfNeeded();
         mEditor.mInputContentType.extras = new Bundle();
@@ -4045,7 +4045,7 @@
      */
     public Bundle getInputExtras(boolean create) {
         if (mEditor == null && !create) return null;
-        createEditorIfNeeded("get Input extra");
+        createEditorIfNeeded();
         if (mEditor.mInputContentType == null) {
             if (!create) return null;
             mEditor.createInputContentTypeIfNeeded();
@@ -4097,7 +4097,7 @@
      * be cleared (and you should provide a <code>null</code> icon as well).
      */
     public void setError(CharSequence error, Drawable icon) {
-        createEditorIfNeeded("setError");
+        createEditorIfNeeded();
         mEditor.setError(error, icon);
     }
 
@@ -4609,7 +4609,7 @@
     public void setTextIsSelectable(boolean selectable) {
         if (!selectable && mEditor == null) return; // false is default value with no edit data
 
-        createEditorIfNeeded("setTextIsSelectable");
+        createEditorIfNeeded();
         if (mEditor.mTextIsSelectable == selectable) return;
 
         mEditor.mTextIsSelectable = selectable;
@@ -5422,7 +5422,7 @@
      * @return Returns true if the text was successfully extracted, else false.
      */
     public boolean extractText(ExtractedTextRequest request, ExtractedText outText) {
-        createEditorIfNeeded("extractText");
+        createEditorIfNeeded();
         return mEditor.extractText(request, outText);
     }
 
@@ -6836,7 +6836,7 @@
      */
     @android.view.RemotableViewMethod
     public void setSelectAllOnFocus(boolean selectAllOnFocus) {
-        createEditorIfNeeded("setSelectAllOnFocus");
+        createEditorIfNeeded();
         mEditor.mSelectAllOnFocus = selectAllOnFocus;
 
         if (selectAllOnFocus && !(mText instanceof Spannable)) {
@@ -6855,7 +6855,7 @@
     @android.view.RemotableViewMethod
     public void setCursorVisible(boolean visible) {
         if (visible && mEditor == null) return; // visible is the default value with no edit data
-        createEditorIfNeeded("setCursorVisible");
+        createEditorIfNeeded();
         if (mEditor.mCursorVisible != visible) {
             mEditor.mCursorVisible = visible;
             invalidate();
@@ -7914,7 +7914,7 @@
      * that case, to allow for quick replacement.
      */
     public void setCustomSelectionActionModeCallback(ActionMode.Callback actionModeCallback) {
-        createEditorIfNeeded("custom selection action mode set");
+        createEditorIfNeeded();
         mEditor.mCustomSelectionActionModeCallback = actionModeCallback;
     }
 
@@ -8285,16 +8285,9 @@
      * Also note that for performance reasons, the mEditor is created when needed, but not
      * reset when no more edit-specific fields are needed.
      */
-    private void createEditorIfNeeded(String reason) {
+    private void createEditorIfNeeded() {
         if (mEditor == null) {
-            if (!(this instanceof EditText)) {
-                Log.e(LOG_TAG + " EDITOR", "Creating an Editor on a regular TextView. " + reason);
-            }
             mEditor = new Editor(this);
-        } else {
-            if (!(this instanceof EditText)) {
-                Log.d(LOG_TAG + " EDITOR", "Redundant Editor creation. " + reason);
-            }
         }
     }
 
diff --git a/core/java/com/android/internal/app/ResolverActivity.java b/core/java/com/android/internal/app/ResolverActivity.java
index 4f2afa7..614f73f 100644
--- a/core/java/com/android/internal/app/ResolverActivity.java
+++ b/core/java/com/android/internal/app/ResolverActivity.java
@@ -210,12 +210,29 @@
     }
 
     @Override
+    protected void onRestoreInstanceState(Bundle savedInstanceState) {
+        super.onRestoreInstanceState(savedInstanceState);
+        if (mAlwaysUseOption) {
+            final int checkedPos = mGrid.getCheckedItemPosition();
+            final boolean enabled = checkedPos != GridView.INVALID_POSITION;
+            mAlwaysButton.setEnabled(enabled);
+            mOnceButton.setEnabled(enabled);
+            if (enabled) {
+                mGrid.setSelection(checkedPos);
+            }
+        }
+    }
+
+    @Override
     public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
         if (mAlwaysUseOption) {
             final int checkedPos = mGrid.getCheckedItemPosition();
             final boolean enabled = checkedPos != GridView.INVALID_POSITION;
             mAlwaysButton.setEnabled(enabled);
             mOnceButton.setEnabled(enabled);
+            if (enabled) {
+                mGrid.smoothScrollToPosition(checkedPos);
+            }
         } else {
             startSelected(position, false);
         }
diff --git a/core/java/com/android/internal/content/PackageHelper.java b/core/java/com/android/internal/content/PackageHelper.java
index 48ed561..246b0c9 100644
--- a/core/java/com/android/internal/content/PackageHelper.java
+++ b/core/java/com/android/internal/content/PackageHelper.java
@@ -57,25 +57,25 @@
     public static final int APP_INSTALL_INTERNAL = 1;
     public static final int APP_INSTALL_EXTERNAL = 2;
 
-    public static IMountService getMountService() {
+    public static IMountService getMountService() throws RemoteException {
         IBinder service = ServiceManager.getService("mount");
         if (service != null) {
             return IMountService.Stub.asInterface(service);
         } else {
             Log.e(TAG, "Can't get mount service");
+            throw new RemoteException("Could not contact mount service");
         }
-        return null;
     }
 
     public static String createSdDir(int sizeMb, String cid, String sdEncKey, int uid,
             boolean isExternal) {
         // Create mount point via MountService
-        IMountService mountService = getMountService();
-
-        if (localLOGV)
-            Log.i(TAG, "Size of container " + sizeMb + " MB");
-
         try {
+            IMountService mountService = getMountService();
+
+            if (localLOGV)
+                Log.i(TAG, "Size of container " + sizeMb + " MB");
+
             int rc = mountService.createSecureContainer(cid, sizeMb, "ext4", sdEncKey, uid,
                     isExternal);
             if (rc != StorageResultCode.OperationSucceeded) {
diff --git a/core/java/com/android/internal/policy/IFaceLockCallback.aidl b/core/java/com/android/internal/policy/IFaceLockCallback.aidl
index a7b01b2..eb902fd 100644
--- a/core/java/com/android/internal/policy/IFaceLockCallback.aidl
+++ b/core/java/com/android/internal/policy/IFaceLockCallback.aidl
@@ -23,5 +23,5 @@
     void cancel();
     void reportFailedAttempt();
     void exposeFallback();
-    void pokeWakelock();
+    void pokeWakelock(int millis);
 }
diff --git a/core/java/com/android/internal/util/FileRotator.java b/core/java/com/android/internal/util/FileRotator.java
index 6cfb97d..26235f1 100644
--- a/core/java/com/android/internal/util/FileRotator.java
+++ b/core/java/com/android/internal/util/FileRotator.java
@@ -19,8 +19,6 @@
 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;
@@ -29,8 +27,11 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
 
 import libcore.io.IoUtils;
+import libcore.io.Streams;
 
 /**
  * Utility that rotates files over time, similar to {@code logrotate}. There is
@@ -137,10 +138,38 @@
     public void deleteAll() {
         final FileInfo info = new FileInfo(mPrefix);
         for (String name : mBasePath.list()) {
-            if (!info.parse(name)) continue;
+            if (info.parse(name)) {
+                // delete each file that matches parser
+                new File(mBasePath, name).delete();
+            }
+        }
+    }
 
-            // delete each file that matches parser
-            new File(mBasePath, name).delete();
+    /**
+     * Dump all files managed by this rotator for debugging purposes.
+     */
+    public void dumpAll(OutputStream os) throws IOException {
+        final ZipOutputStream zos = new ZipOutputStream(os);
+        try {
+            final FileInfo info = new FileInfo(mPrefix);
+            for (String name : mBasePath.list()) {
+                if (info.parse(name)) {
+                    final ZipEntry entry = new ZipEntry(name);
+                    zos.putNextEntry(entry);
+
+                    final File file = new File(mBasePath, name);
+                    final FileInputStream is = new FileInputStream(file);
+                    try {
+                        Streams.copy(is, zos);
+                    } finally {
+                        IoUtils.closeQuietly(is);
+                    }
+
+                    zos.closeEntry();
+                }
+            }
+        } finally {
+            IoUtils.closeQuietly(zos);
         }
     }
 
@@ -159,22 +188,22 @@
     public void combineActive(final Reader reader, final Writer writer, long currentTimeMillis)
             throws IOException {
         rewriteActive(new Rewriter() {
-            /** {@inheritDoc} */
+            @Override
             public void reset() {
                 // ignored
             }
 
-            /** {@inheritDoc} */
+            @Override
             public void read(InputStream in) throws IOException {
                 reader.read(in);
             }
 
-            /** {@inheritDoc} */
+            @Override
             public boolean shouldWrite() {
                 return true;
             }
 
-            /** {@inheritDoc} */
+            @Override
             public void write(OutputStream out) throws IOException {
                 writer.write(out);
             }
@@ -224,11 +253,11 @@
 
                 // write success, delete backup
                 backupFile.delete();
-            } catch (IOException e) {
+            } catch (Throwable t) {
                 // write failed, delete file and restore backup
                 file.delete();
                 backupFile.renameTo(file);
-                throw e;
+                throw rethrowAsIoException(t);
             }
 
         } else {
@@ -241,11 +270,11 @@
 
                 // write success, delete empty backup
                 backupFile.delete();
-            } catch (IOException e) {
+            } catch (Throwable t) {
                 // write failed, delete file and empty backup
                 file.delete();
                 backupFile.delete();
-                throw e;
+                throw rethrowAsIoException(t);
             }
         }
     }
@@ -353,6 +382,14 @@
         }
     }
 
+    private static IOException rethrowAsIoException(Throwable t) throws IOException {
+        if (t instanceof IOException) {
+            throw (IOException) t;
+        } else {
+            throw new IOException(t.getMessage(), t);
+        }
+    }
+
     /**
      * Details for a rotated file, either parsed from an existing filename, or
      * ready to be built into a new filename.
diff --git a/core/java/com/android/internal/view/menu/ListMenuPresenter.java b/core/java/com/android/internal/view/menu/ListMenuPresenter.java
index a331bec..b3e2d27 100644
--- a/core/java/com/android/internal/view/menu/ListMenuPresenter.java
+++ b/core/java/com/android/internal/view/menu/ListMenuPresenter.java
@@ -220,7 +220,6 @@
         private int mExpandedIndex = -1;
 
         public MenuAdapter() {
-            registerDataSetObserver(new ExpandedIndexObserver());
             findExpandedIndex();
         }
 
@@ -273,12 +272,11 @@
             }
             mExpandedIndex = -1;
         }
-    }
 
-    private class ExpandedIndexObserver extends DataSetObserver {
         @Override
-        public void onChanged() {
-            mAdapter.findExpandedIndex();
+        public void notifyDataSetChanged() {
+            findExpandedIndex();
+            super.notifyDataSetChanged();
         }
     }
 }
diff --git a/core/java/com/android/internal/view/menu/MenuPopupHelper.java b/core/java/com/android/internal/view/menu/MenuPopupHelper.java
index 329b457..cacc86b 100644
--- a/core/java/com/android/internal/view/menu/MenuPopupHelper.java
+++ b/core/java/com/android/internal/view/menu/MenuPopupHelper.java
@@ -307,7 +307,6 @@
 
         public MenuAdapter(MenuBuilder menu) {
             mAdapterMenu = menu;
-            registerDataSetObserver(new ExpandedIndexObserver());
             findExpandedIndex();
         }
 
@@ -363,12 +362,11 @@
             }
             mExpandedIndex = -1;
         }
-    }
 
-    private class ExpandedIndexObserver extends DataSetObserver {
         @Override
-        public void onChanged() {
-            mAdapter.findExpandedIndex();
+        public void notifyDataSetChanged() {
+            findExpandedIndex();
+            super.notifyDataSetChanged();
         }
     }
 }
diff --git a/core/jni/android/graphics/BitmapFactory.cpp b/core/jni/android/graphics/BitmapFactory.cpp
index 3a6c5b0..416370e 100644
--- a/core/jni/android/graphics/BitmapFactory.cpp
+++ b/core/jni/android/graphics/BitmapFactory.cpp
@@ -317,8 +317,6 @@
             env->SetObjectField(javaBitmap, gBitmap_layoutBoundsFieldID, layoutBounds);
         }
     }
-    // detach bitmap from its autodeleter, since we want to own it now
-    adb.detach();
 
     if (willScale) {
         // This is weird so let me explain: we could use the scale parameter
@@ -369,6 +367,9 @@
         pr->setImmutable();
     }
 
+    // detach bitmap from its autodeleter, since we want to own it now
+    adb.detach();
+
     if (javaBitmap != NULL) {
         // If a java bitmap was passed in for reuse, pass it back
         return javaBitmap;
diff --git a/core/jni/android/graphics/Canvas.cpp b/core/jni/android/graphics/Canvas.cpp
index ef6af74..6b74705 100644
--- a/core/jni/android/graphics/Canvas.cpp
+++ b/core/jni/android/graphics/Canvas.cpp
@@ -69,7 +69,11 @@
         SkImageRef_GlobalPool::SetRAMUsed(0);
         SkGraphics::PurgeFontCache();
     }
-    
+
+    static void freeTextLayoutCaches(JNIEnv* env, jobject) {
+        TextLayoutEngine::getInstance().purgeCaches();
+    }
+
     static jboolean isOpaque(JNIEnv* env, jobject jcanvas) {
         NPE_CHECK_RETURN_ZERO(env, jcanvas);
         SkCanvas* canvas = GraphicsJNI::getNativeCanvas(env, jcanvas);
@@ -986,7 +990,9 @@
         (void*) SkCanvasGlue::drawTextOnPath__StringPathFFPaint},
     {"native_drawPicture", "(II)V", (void*) SkCanvasGlue::drawPicture},
 
-    {"freeCaches", "()V", (void*) SkCanvasGlue::freeCaches}
+    {"freeCaches", "()V", (void*) SkCanvasGlue::freeCaches},
+
+    {"freeTextLayoutCaches", "()V", (void*) SkCanvasGlue::freeTextLayoutCaches}
 };
 
 ///////////////////////////////////////////////////////////////////////////////
diff --git a/core/jni/android/graphics/TextLayoutCache.cpp b/core/jni/android/graphics/TextLayoutCache.cpp
index 16f377d..673c38d 100644
--- a/core/jni/android/graphics/TextLayoutCache.cpp
+++ b/core/jni/android/graphics/TextLayoutCache.cpp
@@ -1015,4 +1015,11 @@
     return value;
 }
 
+void TextLayoutEngine::purgeCaches() {
+#if USE_TEXT_LAYOUT_CACHE
+    mTextLayoutCache->clear();
+#endif
+}
+
+
 } // namespace android
diff --git a/core/jni/android/graphics/TextLayoutCache.h b/core/jni/android/graphics/TextLayoutCache.h
index 0be61c65..027e888 100644
--- a/core/jni/android/graphics/TextLayoutCache.h
+++ b/core/jni/android/graphics/TextLayoutCache.h
@@ -310,6 +310,9 @@
 
     sp<TextLayoutValue> getValue(const SkPaint* paint, const jchar* text, jint start,
             jint count, jint contextCount, jint dirFlags);
+
+    void purgeCaches();
+
 private:
     TextLayoutCache* mTextLayoutCache;
     TextLayoutShaper* mShaper;
diff --git a/core/jni/android_database_SQLiteCommon.cpp b/core/jni/android_database_SQLiteCommon.cpp
index 3484467..06bff19 100644
--- a/core/jni/android_database_SQLiteCommon.cpp
+++ b/core/jni/android_database_SQLiteCommon.cpp
@@ -110,7 +110,7 @@
             exceptionClass = "android/database/sqlite/SQLiteDatatypeMismatchException";
             break;
         case SQLITE_INTERRUPT:
-            exceptionClass = "android/content/OperationCanceledException";
+            exceptionClass = "android/os/OperationCanceledException";
             break;
         default:
             exceptionClass = "android/database/sqlite/SQLiteException";
diff --git a/core/jni/android_os_Power.cpp b/core/jni/android_os_Power.cpp
index a201d8b..373abd4 100644
--- a/core/jni/android_os_Power.cpp
+++ b/core/jni/android_os_Power.cpp
@@ -72,11 +72,15 @@
 setScreenState(JNIEnv *env, jobject clazz, jboolean on)
 {
     if (on) {
-	autosuspend_disable();
-	sPowerModule->setInteractive(sPowerModule, true);
+        autosuspend_disable();
+        if (sPowerModule) {
+            sPowerModule->setInteractive(sPowerModule, true);
+        }
     } else {
-	sPowerModule->setInteractive(sPowerModule, false);
-	autosuspend_enable();
+        if (sPowerModule) {
+            sPowerModule->setInteractive(sPowerModule, false);
+        }
+        autosuspend_enable();
     }
 
     return 0;
diff --git a/core/jni/android_os_SystemProperties.cpp b/core/jni/android_os_SystemProperties.cpp
index 66af965..677396d1 100644
--- a/core/jni/android_os_SystemProperties.cpp
+++ b/core/jni/android_os_SystemProperties.cpp
@@ -15,7 +15,11 @@
 ** limitations under the License.
 */
 
+#define LOG_TAG "SysPropJNI"
+
 #include "cutils/properties.h"
+#include "utils/misc.h"
+#include <utils/Log.h>
 #include "jni.h"
 #include "android_runtime/AndroidRuntime.h"
 #include <nativehelper/JNIHelp.h>
@@ -65,6 +69,7 @@
     int len;
     const char* key;
     char buf[PROPERTY_VALUE_MAX];
+    char* end;
     jint result = defJ;
 
     if (keyJ == NULL) {
@@ -76,9 +81,10 @@
 
     len = property_get(key, buf, "");
     if (len > 0) {
-        jint temp;
-        if (sscanf(buf, "%d", &temp) == 1)
-            result = temp;
+        result = strtol(buf, &end, 0);
+        if (end == buf) {
+            result = defJ;
+        }
     }
 
     env->ReleaseStringUTFChars(keyJ, key);
@@ -93,6 +99,7 @@
     int len;
     const char* key;
     char buf[PROPERTY_VALUE_MAX];
+    char* end;
     jlong result = defJ;
 
     if (keyJ == NULL) {
@@ -104,9 +111,10 @@
 
     len = property_get(key, buf, "");
     if (len > 0) {
-        jlong temp;
-        if (sscanf(buf, "%lld", &temp) == 1)
-            result = temp;
+        result = strtoll(buf, &end, 0);
+        if (end == buf) {
+            result = defJ;
+        }
     }
 
     env->ReleaseStringUTFChars(keyJ, key);
@@ -184,6 +192,34 @@
     }
 }
 
+static JavaVM* sVM = NULL;
+static jclass sClazz = NULL;
+static jmethodID sCallChangeCallbacks;
+
+static void do_report_sysprop_change() {
+    //ALOGI("Java SystemProperties: VM=%p, Clazz=%p", sVM, sClazz);
+    if (sVM != NULL && sClazz != NULL) {
+        JNIEnv* env;
+        if (sVM->GetEnv((void **)&env, JNI_VERSION_1_4) >= 0) {
+            //ALOGI("Java SystemProperties: calling %p", sCallChangeCallbacks);
+            env->CallStaticVoidMethod(sClazz, sCallChangeCallbacks);
+        }
+    }
+}
+
+static void SystemProperties_add_change_callback(JNIEnv *env, jobject clazz)
+{
+    // This is called with the Java lock held.
+    if (sVM == NULL) {
+        env->GetJavaVM(&sVM);
+    }
+    if (sClazz == NULL) {
+        sClazz = (jclass) env->NewGlobalRef(clazz);
+        sCallChangeCallbacks = env->GetStaticMethodID(sClazz, "callChangeCallbacks", "()V");
+        add_sysprop_change_callback(do_report_sysprop_change, -10000);
+    }
+}
+
 static JNINativeMethod method_table[] = {
     { "native_get", "(Ljava/lang/String;)Ljava/lang/String;",
       (void*) SystemProperties_getS },
@@ -197,6 +233,8 @@
       (void*) SystemProperties_get_boolean },
     { "native_set", "(Ljava/lang/String;Ljava/lang/String;)V",
       (void*) SystemProperties_set },
+    { "native_add_change_callback", "()V",
+      (void*) SystemProperties_add_change_callback },
 };
 
 int register_android_os_SystemProperties(JNIEnv *env)
diff --git a/core/jni/android_util_Binder.cpp b/core/jni/android_util_Binder.cpp
index 0f99fb2..04dc49f 100644
--- a/core/jni/android_util_Binder.cpp
+++ b/core/jni/android_util_Binder.cpp
@@ -308,6 +308,12 @@
             env->DeleteLocalRef(excep2);
         }
 
+        // Need to always call through the native implementation of
+        // SYSPROPS_TRANSACTION.
+        if (code == SYSPROPS_TRANSACTION) {
+            BBinder::onTransact(code, data, reply, flags);
+        }
+
         //aout << "onTransact to Java code; result=" << res << endl
         //    << "Transact from " << this << " to Java code returning "
         //    << reply << ": " << *reply << endl;
diff --git a/core/jni/android_util_Process.cpp b/core/jni/android_util_Process.cpp
index d20cc9e..027ed16 100644
--- a/core/jni/android_util_Process.cpp
+++ b/core/jni/android_util_Process.cpp
@@ -402,7 +402,7 @@
     return *((const jint*)v1) - *((const jint*)v2);
 }
 
-static jlong android_os_Process_getFreeMemory(JNIEnv* env, jobject clazz)
+static jlong getFreeMemoryImpl(const char* const sums[], const int sumsLen[], int num)
 {
     int fd = open("/proc/meminfo", O_RDONLY);
 
@@ -424,11 +424,8 @@
     int numFound = 0;
     jlong mem = 0;
 
-    static const char* const sums[] = { "MemFree:", "Cached:", NULL };
-    static const int sumsLen[] = { strlen("MemFree:"), strlen("Cached:"), 0 };
-
     char* p = buffer;
-    while (*p && numFound < 2) {
+    while (*p && numFound < num) {
         int i = 0;
         while (sums[i]) {
             if (strncmp(p, sums[i], sumsLen[i]) == 0) {
@@ -453,6 +450,20 @@
     return numFound > 0 ? mem : -1;
 }
 
+static jlong android_os_Process_getFreeMemory(JNIEnv* env, jobject clazz)
+{
+    static const char* const sums[] = { "MemFree:", "Cached:", NULL };
+    static const int sumsLen[] = { strlen("MemFree:"), strlen("Cached:"), 0 };
+    return getFreeMemoryImpl(sums, sumsLen, 2);
+}
+
+static jlong android_os_Process_getTotalMemory(JNIEnv* env, jobject clazz)
+{
+    static const char* const sums[] = { "MemTotal:", NULL };
+    static const int sumsLen[] = { strlen("MemTotal:"), 0 };
+    return getFreeMemoryImpl(sums, sumsLen, 1);
+}
+
 void android_os_Process_readProcLines(JNIEnv* env, jobject clazz, jstring fileStr,
                                       jobjectArray reqFields, jlongArray outFields)
 {
@@ -901,6 +912,7 @@
     {"sendSignal", "(II)V", (void*)android_os_Process_sendSignal},
     {"sendSignalQuiet", "(II)V", (void*)android_os_Process_sendSignalQuiet},
     {"getFreeMemory", "()J", (void*)android_os_Process_getFreeMemory},
+    {"getTotalMemory", "()J", (void*)android_os_Process_getTotalMemory},
     {"readProcLines", "(Ljava/lang/String;[Ljava/lang/String;[J)V", (void*)android_os_Process_readProcLines},
     {"getPids", "(Ljava/lang/String;[I)[I", (void*)android_os_Process_getPids},
     {"readProcFile", "(Ljava/lang/String;[I[Ljava/lang/String;[J[F)Z", (void*)android_os_Process_readProcFile},
diff --git a/core/res/res/drawable-hdpi/notification_bg_low_normal.9.png b/core/res/res/drawable-hdpi/notification_bg_low_normal.9.png
new file mode 100644
index 0000000..af91f5e
--- /dev/null
+++ b/core/res/res/drawable-hdpi/notification_bg_low_normal.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/notification_bg_low_pressed.9.png b/core/res/res/drawable-hdpi/notification_bg_low_pressed.9.png
new file mode 100644
index 0000000..1602ab87
--- /dev/null
+++ b/core/res/res/drawable-hdpi/notification_bg_low_pressed.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/notification_bg_normal.9.png b/core/res/res/drawable-hdpi/notification_bg_normal.9.png
new file mode 100644
index 0000000..6ebed8b
--- /dev/null
+++ b/core/res/res/drawable-hdpi/notification_bg_normal.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/notification_bg_normal_pressed.9.png b/core/res/res/drawable-hdpi/notification_bg_normal_pressed.9.png
new file mode 100644
index 0000000..6193822
--- /dev/null
+++ b/core/res/res/drawable-hdpi/notification_bg_normal_pressed.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/notification_bg_low_normal.9.png b/core/res/res/drawable-mdpi/notification_bg_low_normal.9.png
new file mode 100644
index 0000000..62de9d7
--- /dev/null
+++ b/core/res/res/drawable-mdpi/notification_bg_low_normal.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/notification_bg_low_pressed.9.png b/core/res/res/drawable-mdpi/notification_bg_low_pressed.9.png
new file mode 100644
index 0000000..eaabd93
--- /dev/null
+++ b/core/res/res/drawable-mdpi/notification_bg_low_pressed.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/notification_bg_normal.9.png b/core/res/res/drawable-mdpi/notification_bg_normal.9.png
new file mode 100644
index 0000000..aa239b3
--- /dev/null
+++ b/core/res/res/drawable-mdpi/notification_bg_normal.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/notification_bg_normal_pressed.9.png b/core/res/res/drawable-mdpi/notification_bg_normal_pressed.9.png
new file mode 100644
index 0000000..62d8622
--- /dev/null
+++ b/core/res/res/drawable-mdpi/notification_bg_normal_pressed.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/notification_bg_low_normal.9.png b/core/res/res/drawable-xhdpi/notification_bg_low_normal.9.png
new file mode 100644
index 0000000..8c884de
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/notification_bg_low_normal.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/notification_bg_low_pressed.9.png b/core/res/res/drawable-xhdpi/notification_bg_low_pressed.9.png
new file mode 100644
index 0000000..32e00be
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/notification_bg_low_pressed.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/notification_bg_normal.9.png b/core/res/res/drawable-xhdpi/notification_bg_normal.9.png
new file mode 100644
index 0000000..bdf477b
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/notification_bg_normal.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/notification_bg_normal_pressed.9.png b/core/res/res/drawable-xhdpi/notification_bg_normal_pressed.9.png
new file mode 100644
index 0000000..5c4da74
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/notification_bg_normal_pressed.9.png
Binary files differ
diff --git a/core/res/res/drawable/notification_bg.xml b/core/res/res/drawable/notification_bg.xml
index 1bb2172..362a524 100644
--- a/core/res/res/drawable/notification_bg.xml
+++ b/core/res/res/drawable/notification_bg.xml
@@ -17,6 +17,6 @@
 <selector xmlns:android="http://schemas.android.com/apk/res/android"
         android:exitFadeDuration="@android:integer/config_mediumAnimTime">
 
-    <item android:state_pressed="true"  android:drawable="@drawable/notification_item_background_color_pressed" />
-    <item android:state_pressed="false" android:drawable="@drawable/notification_item_background_color" />
+    <item android:state_pressed="true"  android:drawable="@drawable/notification_bg_normal_pressed" />
+    <item android:state_pressed="false" android:drawable="@drawable/notification_bg_normal" />
 </selector>
diff --git a/core/res/res/drawable/notification_bg_low.xml b/core/res/res/drawable/notification_bg_low.xml
new file mode 100644
index 0000000..466a885
--- /dev/null
+++ b/core/res/res/drawable/notification_bg_low.xml
@@ -0,0 +1,22 @@
+<?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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:exitFadeDuration="@android:integer/config_mediumAnimTime">
+
+    <item android:state_pressed="true"  android:drawable="@drawable/notification_bg_low_pressed" />
+    <item android:state_pressed="false" android:drawable="@drawable/notification_bg_low_normal" />
+</selector>
diff --git a/core/res/res/layout/notification_action.xml b/core/res/res/layout/notification_action.xml
index 785da7c..36982ca 100644
--- a/core/res/res/layout/notification_action.xml
+++ b/core/res/res/layout/notification_action.xml
@@ -17,7 +17,10 @@
 <Button xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/action0"
     android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    style="@android:style/Widget.Holo.Button.Small"
+    android:layout_height="48dp"
     android:gravity="left|center_vertical"
-    />
\ No newline at end of file
+    android:drawablePadding="8dp"
+    android:paddingLeft="8dp"
+    android:textColor="#ccc"
+    android:textSize="14dp"
+    />
diff --git a/tools/localize/testdata/merge_xx_old.xml b/core/res/res/layout/notification_action_tombstone.xml
similarity index 60%
copy from tools/localize/testdata/merge_xx_old.xml
copy to core/res/res/layout/notification_action_tombstone.xml
index 9d3a7d8..e61e15f 100644
--- a/tools/localize/testdata/merge_xx_old.xml
+++ b/core/res/res/layout/notification_action_tombstone.xml
@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
      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.
@@ -14,8 +14,13 @@
      limitations under the License.
 -->
 
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="changed_in_xx">aaa</string>
-    <string name="previously_translated">CCC</string>
-</resources>
-
+<Button xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/action0"
+    android:layout_width="match_parent"
+    android:layout_height="48dp"
+    android:gravity="left|center_vertical"
+    android:drawablePadding="8dp"
+    android:paddingLeft="8dp"
+    android:textColor="#666"
+    android:textSize="14dp"
+    />
diff --git a/core/res/res/layout/notification_template_base.xml b/core/res/res/layout/notification_template_base.xml
index 63d20e4..3692a4d 100644
--- a/core/res/res/layout/notification_template_base.xml
+++ b/core/res/res/layout/notification_template_base.xml
@@ -26,7 +26,7 @@
     <ImageView android:id="@+id/icon"
         android:layout_width="@dimen/notification_large_icon_width"
         android:layout_height="@dimen/notification_large_icon_height"
-        android:background="@android:drawable/notify_panel_notification_icon_bg_tile"
+        android:background="@android:drawable/notification_template_icon_bg"
         android:scaleType="center"
         />
     <LinearLayout
diff --git a/core/res/res/layout/notification_template_big_base.xml b/core/res/res/layout/notification_template_big_base.xml
index f8b24e2..378161c 100644
--- a/core/res/res/layout/notification_template_big_base.xml
+++ b/core/res/res/layout/notification_template_big_base.xml
@@ -26,7 +26,7 @@
     <ImageView android:id="@+id/icon"
         android:layout_width="@dimen/notification_large_icon_width"
         android:layout_height="@dimen/notification_large_icon_height"
-        android:background="@android:drawable/notify_panel_notification_icon_bg_tile"
+        android:background="@android:drawable/notification_template_icon_bg"
         android:scaleType="center"
         />
     <LinearLayout
diff --git a/core/res/res/layout/notification_template_big_text.xml b/core/res/res/layout/notification_template_big_text.xml
index a225ab1..d0549cf 100644
--- a/core/res/res/layout/notification_template_big_text.xml
+++ b/core/res/res/layout/notification_template_big_text.xml
@@ -25,7 +25,7 @@
     <ImageView android:id="@+id/icon"
         android:layout_width="@dimen/notification_large_icon_width"
         android:layout_height="@dimen/notification_large_icon_height"
-        android:background="@android:drawable/notify_panel_notification_icon_bg_tile"
+        android:background="@android:drawable/notification_template_icon_bg"
         android:scaleType="center"
         />
     <LinearLayout
diff --git a/core/res/res/layout/notification_template_inbox.xml b/core/res/res/layout/notification_template_inbox.xml
index 05a3d62..7b63ac5 100644
--- a/core/res/res/layout/notification_template_inbox.xml
+++ b/core/res/res/layout/notification_template_inbox.xml
@@ -15,14 +15,18 @@
 -->
 
 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:internal="http://schemas.android.com/apk/prv/res/android"
     android:id="@+id/status_bar_latest_event_content"
+    android:background="@android:drawable/notification_bg"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
+    internal:layout_minHeight="65dp"
+    internal:layout_maxHeight="unbounded"
     >
     <ImageView android:id="@+id/icon"
         android:layout_width="@dimen/notification_large_icon_width"
         android:layout_height="@dimen/notification_large_icon_height"
-        android:background="@android:drawable/notify_panel_notification_icon_bg_tile"
+        android:background="@android:drawable/notification_template_icon_bg"
         android:scaleType="center"
         />
     <LinearLayout
diff --git a/core/res/res/layout/resolver_grid.xml b/core/res/res/layout/resolver_grid.xml
index f10a59f0..4a0e84a 100644
--- a/core/res/res/layout/resolver_grid.xml
+++ b/core/res/res/layout/resolver_grid.xml
@@ -23,15 +23,20 @@
               android:divider="?android:attr/dividerHorizontal"
               android:showDividers="middle"
               android:dividerPadding="0dip">
-    <GridView
-        android:layout_gravity="center"
-        android:layout_height="wrap_content"
-        android:layout_width="wrap_content"
-        android:id="@+id/resolver_grid"
-        android:numColumns="4"
-        android:columnWidth="128dp"
-        android:padding="16dp"
-        android:clipToPadding="false" />
+    <FrameLayout android:layout_width="match_parent"
+                 android:layout_height="wrap_content"
+                 android:layout_weight="1">
+        <GridView
+            android:layout_gravity="center"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:id="@+id/resolver_grid"
+            android:numColumns="4"
+            android:columnWidth="128dp"
+            android:padding="16dp"
+            android:clipToPadding="false"
+            android:scrollbarStyle="outsideOverlay" />
+    </FrameLayout>
     <LinearLayout
         android:id="@+id/button_bar"
         android:visibility="gone"
diff --git a/core/res/res/values-af/strings.xml b/core/res/res/values-af/strings.xml
index 7fa95c9..ad7a228 100644
--- a/core/res/res/values-af/strings.xml
+++ b/core/res/res/values-af/strings.xml
@@ -168,12 +168,9 @@
     <string name="permgrouplab_messages" msgid="7521249148445456662">"Jou boodskappe"</string>
     <string name="permgroupdesc_messages" msgid="7821999071003699236">"Lees en skryf jou SMS, e-pos en ander boodskappe."</string>
     <string name="permgrouplab_personalInfo" msgid="3519163141070533474">"Jou persoonlike inligting"</string>
-    <!-- no translation found for permgroupdesc_personalInfo (8426453129788861338) -->
-    <skip />
-    <!-- no translation found for permgrouplab_socialInfo (5799096623412043791) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_socialInfo (7129842457611643493) -->
-    <skip />
+    <string name="permgroupdesc_personalInfo" msgid="8426453129788861338">"Direkte toegang tot inligting oor jou, gestoor in jou kontakkaart."</string>
+    <string name="permgrouplab_socialInfo" msgid="5799096623412043791">"Jou sosiale inligting"</string>
+    <string name="permgroupdesc_socialInfo" msgid="7129842457611643493">"Direkte toegang tot inligting oor jou kontakte en sosiale verbindings."</string>
     <string name="permgrouplab_location" msgid="635149742436692049">"Jou ligging"</string>
     <string name="permgroupdesc_location" msgid="5704679763124170100">"Monitor jou fisiese ligging."</string>
     <string name="permgrouplab_network" msgid="5808983377727109831">"Netwerkkommunikasie"</string>
@@ -186,18 +183,12 @@
     <skip />
     <!-- no translation found for permgroupdesc_shortrangeNetwork (1884069062653436007) -->
     <skip />
-    <!-- no translation found for permgrouplab_audioSettings (8329261670151871235) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_audioSettings (2641515403347568130) -->
-    <skip />
-    <!-- no translation found for permgrouplab_affectsBattery (6209246653424798033) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_affectsBattery (6441275320638916947) -->
-    <skip />
-    <!-- no translation found for permgrouplab_calendar (5863508437783683902) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_calendar (5777534316982184416) -->
-    <skip />
+    <string name="permgrouplab_audioSettings" msgid="8329261670151871235">"Oudio-instellings"</string>
+    <string name="permgroupdesc_audioSettings" msgid="2641515403347568130">"Verander oudio-instellings."</string>
+    <string name="permgrouplab_affectsBattery" msgid="6209246653424798033">"Affekteer battery"</string>
+    <string name="permgroupdesc_affectsBattery" msgid="6441275320638916947">"Gebruik kenmerke wat vinnig die battery opgebruik."</string>
+    <string name="permgrouplab_calendar" msgid="5863508437783683902">"Kalender"</string>
+    <string name="permgroupdesc_calendar" msgid="5777534316982184416">"Direkte toegang tot kalender en gebeurtenisse."</string>
     <!-- no translation found for permgrouplab_dictionary (4148597128843641379) -->
     <skip />
     <!-- no translation found for permgroupdesc_dictionary (7921166355964764490) -->
@@ -206,46 +197,26 @@
     <skip />
     <!-- no translation found for permgroupdesc_writeDictionary (2711561994497361646) -->
     <skip />
-    <!-- no translation found for permgrouplab_bookmarks (1949519673103968229) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_bookmarks (4169771606257963028) -->
-    <skip />
-    <!-- no translation found for permgrouplab_deviceAlarms (6117704629728824101) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_deviceAlarms (4769356362251641175) -->
-    <skip />
-    <!-- no translation found for permgrouplab_voicemail (4162237145027592133) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_voicemail (2498403969862951393) -->
-    <skip />
-    <!-- no translation found for permgrouplab_microphone (171539900250043464) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_microphone (7106618286905738408) -->
-    <skip />
-    <!-- no translation found for permgrouplab_camera (4820372495894586615) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_camera (2933667372289567714) -->
-    <skip />
-    <!-- no translation found for permgrouplab_appInfo (8028789762634147725) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_appInfo (3950378538049625907) -->
-    <skip />
-    <!-- no translation found for permgrouplab_wallpaper (3850280158041175998) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_wallpaper (5630417854750540154) -->
-    <skip />
-    <!-- no translation found for permgrouplab_systemClock (406535759236612992) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_systemClock (3944359833624094992) -->
-    <skip />
-    <!-- no translation found for permgrouplab_statusBar (2095862568113945398) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_statusBar (6242593432226807171) -->
-    <skip />
-    <!-- no translation found for permgrouplab_syncSettings (3341990986147826541) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_syncSettings (7603195265129031797) -->
-    <skip />
+    <string name="permgrouplab_bookmarks" msgid="1949519673103968229">"Boekmerke en geskiedenis"</string>
+    <string name="permgroupdesc_bookmarks" msgid="4169771606257963028">"Direkte toegang tot boekmerke en blaaiergeskiedenis."</string>
+    <string name="permgrouplab_deviceAlarms" msgid="6117704629728824101">"Wekker"</string>
+    <string name="permgroupdesc_deviceAlarms" msgid="4769356362251641175">"Stel die wekker."</string>
+    <string name="permgrouplab_voicemail" msgid="4162237145027592133">"Stemboodskapdiens"</string>
+    <string name="permgroupdesc_voicemail" msgid="2498403969862951393">"Direkte toegang tot stemboodskapdiens."</string>
+    <string name="permgrouplab_microphone" msgid="171539900250043464">"Mikrofoon"</string>
+    <string name="permgroupdesc_microphone" msgid="7106618286905738408">"Direkte toegang tot die mikrofoon om oudio op te neem."</string>
+    <string name="permgrouplab_camera" msgid="4820372495894586615">"Kamera"</string>
+    <string name="permgroupdesc_camera" msgid="2933667372289567714">"Direkte toegang tot kamera vir die neem van foto of video."</string>
+    <string name="permgrouplab_appInfo" msgid="8028789762634147725">"Jou programme-inligting"</string>
+    <string name="permgroupdesc_appInfo" msgid="3950378538049625907">"Vermoë om die gedrag van ander programme op jou toestel te beïnvloed."</string>
+    <string name="permgrouplab_wallpaper" msgid="3850280158041175998">"Muurpapier"</string>
+    <string name="permgroupdesc_wallpaper" msgid="5630417854750540154">"Verander die toestel se muurpapier-instellings."</string>
+    <string name="permgrouplab_systemClock" msgid="406535759236612992">"Klok"</string>
+    <string name="permgroupdesc_systemClock" msgid="3944359833624094992">"Verander die toestel se tyd of tydsone."</string>
+    <string name="permgrouplab_statusBar" msgid="2095862568113945398">"Statusbalk"</string>
+    <string name="permgroupdesc_statusBar" msgid="6242593432226807171">"Verander die toestel se statusbalk-instellings."</string>
+    <string name="permgrouplab_syncSettings" msgid="3341990986147826541">"Sinkronisasie-instellings"</string>
+    <string name="permgroupdesc_syncSettings" msgid="7603195265129031797">"Gaan in by die sinkronisasie-instellings."</string>
     <string name="permgrouplab_accounts" msgid="3359646291125325519">"Jou rekeninge"</string>
     <string name="permgroupdesc_accounts" msgid="4948732641827091312">"Kry toegang tot beskikbare rekeninge."</string>
     <string name="permgrouplab_hardwareControls" msgid="7998214968791599326">"Hardewarekontroles"</string>
@@ -256,10 +227,8 @@
     <string name="permgroupdesc_systemTools" msgid="8162102602190734305">"Laervlak-toegang en -beheer van die stelsel."</string>
     <string name="permgrouplab_developmentTools" msgid="3446164584710596513">"Ontwikkelingshulpmiddels"</string>
     <string name="permgroupdesc_developmentTools" msgid="7058828032358142018">"Kenmerke net nodig vir programontwikkelaars."</string>
-    <!-- no translation found for permgrouplab_display (4279909676036402636) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_display (6051002031933013714) -->
-    <skip />
+    <string name="permgrouplab_display" msgid="4279909676036402636">"Ander program-UI"</string>
+    <string name="permgroupdesc_display" msgid="6051002031933013714">"Affekteer ander programme se UI"</string>
     <string name="permgrouplab_storage" msgid="1971118770546336966">"Stoor"</string>
     <string name="permgroupdesc_storage" product="nosdcard" msgid="7442318502446874999">"Gebruik die USB-berging."</string>
     <string name="permgroupdesc_storage" product="default" msgid="9203302214915355774">"Lees die SD-kaart."</string>
@@ -779,8 +748,7 @@
     <string name="lockscreen_missing_sim_message" product="default" msgid="2186920585695169078">"Geen SIM-kaart in foon nie."</string>
     <string name="lockscreen_missing_sim_instructions" msgid="5372787138023272615">"Steek \'n SIM-kaart in."</string>
     <string name="lockscreen_missing_sim_instructions_long" msgid="3526573099019319472">"Die SIM-kaart is weg of nie leesbaar nie. Steek \'n SIM-kaart in."</string>
-    <!-- no translation found for lockscreen_permanent_disabled_sim_message_short (5096149665138916184) -->
-    <skip />
+    <string name="lockscreen_permanent_disabled_sim_message_short" msgid="5096149665138916184">"Onbruikbare SIM-kaart."</string>
     <string name="lockscreen_permanent_disabled_sim_instructions" msgid="910904643433151371">"Jou SIM-kaart is permanent gedeaktiveer."\n" Kontak jou draadlose diensverskaffer vir \'n ander SIM-kaart."</string>
     <string name="lockscreen_transport_prev_description" msgid="201594905152746886">"Vorigesnit-knoppie"</string>
     <string name="lockscreen_transport_next_description" msgid="6089297650481292363">"Volgendesnit-knoppie"</string>
@@ -1353,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Stuur tans…"</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Begin webblaaier?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Aanvaar oproep?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-am/strings.xml b/core/res/res/values-am/strings.xml
index 42c88ae..c0c0c9c 100644
--- a/core/res/res/values-am/strings.xml
+++ b/core/res/res/values-am/strings.xml
@@ -201,16 +201,16 @@
     <string name="permgroupdesc_bookmarks" msgid="4169771606257963028">"ወደ ዕልባቶችና የአሳሽ ታሪክ ቀጥተኛ መዳረሻ።"</string>
     <string name="permgrouplab_deviceAlarms" msgid="6117704629728824101">"ማንቂያ"</string>
     <string name="permgroupdesc_deviceAlarms" msgid="4769356362251641175">"የማንቂያ ሰዓቱን አዘጋጅ።"</string>
-    <string name="permgrouplab_voicemail" msgid="4162237145027592133">"የድምፅ ፖስታ"</string>
-    <string name="permgroupdesc_voicemail" msgid="2498403969862951393">"ወደ የድምጽ ፖስታ ቀጥተኛ መዳረሻ።"</string>
+    <string name="permgrouplab_voicemail" msgid="4162237145027592133">"የድምጽ መልዕክት"</string>
+    <string name="permgroupdesc_voicemail" msgid="2498403969862951393">"ወደ የድምጽ መልዕክት ቀጥተኛ መዳረሻ።"</string>
     <string name="permgrouplab_microphone" msgid="171539900250043464">"ማይክሮፎን"</string>
     <string name="permgroupdesc_microphone" msgid="7106618286905738408">"ድምጽ ለመቅረጽ ወደ ማይክሮፎኑ ቀጥተኛ መዳረሻ።"</string>
     <string name="permgrouplab_camera" msgid="4820372495894586615">"ካሜራ"</string>
-    <string name="permgroupdesc_camera" msgid="2933667372289567714">"ለምስል ወይም ቪዲዮ ለመቅረጽ ቀጥተና መዳረሻ ለካሜራ።"</string>
+    <string name="permgroupdesc_camera" msgid="2933667372289567714">"ለካሜራ ምስል ወይም ቪዲዮ ለመቅረጽ ቀጥተኛ መዳረሻ።"</string>
     <string name="permgrouplab_appInfo" msgid="8028789762634147725">"የመተግበሪያዎችህ መረጃ"</string>
     <string name="permgroupdesc_appInfo" msgid="3950378538049625907">"በመሣሪያህ ላይ ያሉ የሌሎች መተግበሪያዎች ባህሪዎች ላይ ተፅዕኖ የማሳረፍ ችሎታ።"</string>
     <string name="permgrouplab_wallpaper" msgid="3850280158041175998">"ልጣፍ"</string>
-    <string name="permgroupdesc_wallpaper" msgid="5630417854750540154">"የመሣሪያው ልጣፍ ቅንብሮቹን ቀይር።"</string>
+    <string name="permgroupdesc_wallpaper" msgid="5630417854750540154">"የመሣሪያውን ልጣፍ ቅንብሮች ቀይር።"</string>
     <string name="permgrouplab_systemClock" msgid="406535759236612992">"ሰዓት"</string>
     <string name="permgroupdesc_systemClock" msgid="3944359833624094992">"የመሣሪያውን ሰዓት ወይም የሰዓት ሰቁን ቀይር።"</string>
     <string name="permgrouplab_statusBar" msgid="2095862568113945398">"የሁኔታ አሞሌ"</string>
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"በመላክ ላይ…"</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"ማሰሺያን አስነሳ?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"ጥሪ ተቀበል?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-ar/strings.xml b/core/res/res/values-ar/strings.xml
index 35123de..4196052 100644
--- a/core/res/res/values-ar/strings.xml
+++ b/core/res/res/values-ar/strings.xml
@@ -175,28 +175,20 @@
     <string name="permgroupdesc_location" msgid="5704679763124170100">"يمكنك مراقبة موقعك الفعلي."</string>
     <string name="permgrouplab_network" msgid="5808983377727109831">"اتصال الشبكة"</string>
     <string name="permgroupdesc_network" msgid="4478299413241861987">"يمكنك الدخول إلى ميزات متعددة عبر الشبكة."</string>
-    <!-- no translation found for permgrouplab_bluetoothNetwork (1585403544162128109) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_bluetoothNetwork (5625288577164282391) -->
-    <skip />
-    <!-- no translation found for permgrouplab_shortrangeNetwork (130808676377486118) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_shortrangeNetwork (1884069062653436007) -->
-    <skip />
+    <string name="permgrouplab_bluetoothNetwork" msgid="1585403544162128109">"بلوتوث"</string>
+    <string name="permgroupdesc_bluetoothNetwork" msgid="5625288577164282391">"الدخول إلى الأجهزة والشبكات من خلال البلوتوث."</string>
+    <string name="permgrouplab_shortrangeNetwork" msgid="130808676377486118">"الشبكات قصيرة المدى"</string>
+    <string name="permgroupdesc_shortrangeNetwork" msgid="1884069062653436007">"الدخول إلى الأجهزة من خلال الشبكات قصيرة المدى مثل الاتصالات قريبة المدى (NFC)."</string>
     <string name="permgrouplab_audioSettings" msgid="8329261670151871235">"إعدادات الصوت"</string>
     <string name="permgroupdesc_audioSettings" msgid="2641515403347568130">"تغيير إعدادات الصوت"</string>
     <string name="permgrouplab_affectsBattery" msgid="6209246653424798033">"التأثير على البطارية"</string>
     <string name="permgroupdesc_affectsBattery" msgid="6441275320638916947">"استخدم الميزات التي يمكن أن تؤدي إلى نفاد طاقة البطارية بسرعة."</string>
     <string name="permgrouplab_calendar" msgid="5863508437783683902">"التقويم"</string>
     <string name="permgroupdesc_calendar" msgid="5777534316982184416">"الدخول المباشر إلى التقويم والأحداث."</string>
-    <!-- no translation found for permgrouplab_dictionary (4148597128843641379) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_dictionary (7921166355964764490) -->
-    <skip />
-    <!-- no translation found for permgrouplab_writeDictionary (8090237702432576788) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_writeDictionary (2711561994497361646) -->
-    <skip />
+    <string name="permgrouplab_dictionary" msgid="4148597128843641379">"قراءة قاموس المستخدم"</string>
+    <string name="permgroupdesc_dictionary" msgid="7921166355964764490">"قراءة الكلمات في قاموس المستخدم."</string>
+    <string name="permgrouplab_writeDictionary" msgid="8090237702432576788">"كتابة قاموس المستخدم"</string>
+    <string name="permgroupdesc_writeDictionary" msgid="2711561994497361646">"إضافة الكلمات إلى قاموس المستخدم."</string>
     <string name="permgrouplab_bookmarks" msgid="1949519673103968229">"الإشارات المرجعية والسجل"</string>
     <string name="permgroupdesc_bookmarks" msgid="4169771606257963028">"الدخول المباشر إلى الإشارات المرجعية وسجل المتصفح."</string>
     <string name="permgrouplab_deviceAlarms" msgid="6117704629728824101">"المنبه"</string>
@@ -569,8 +561,7 @@
     <string name="permdesc_sdcardRead" product="nosdcard" msgid="3530894470637667917">"يسمح للتطبيق بقراءة محتويات وحدة تخزين USB، والتي قد تتضمن صورًا ووسائط."</string>
     <string name="permdesc_sdcardRead" product="default" msgid="2555811422562526606">"يسمح للتطبيق بقراءة محتويات بطاقة SD، والتي قد تتضمن صورًا ووسائط."</string>
     <string name="permlab_sdcardWrite" product="nosdcard" msgid="8485979062254666748">"تعديل محتويات وحدة تخزين USB أو حذفها"</string>
-    <!-- no translation found for permlab_sdcardWrite (8805693630050458763) -->
-    <skip />
+    <string name="permlab_sdcardWrite" product="default" msgid="8805693630050458763">"تعديل محتويات بطاقة SD أو حذفها"</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>
@@ -1090,8 +1081,7 @@
     <string name="date_time_set" msgid="5777075614321087758">"تعيين"</string>
     <string name="date_time_done" msgid="2507683751759308828">"تم"</string>
     <string name="perms_new_perm_prefix" msgid="8257740710754301407"><font size="12" fgcolor="#ff900000">"جديد: "</font></string>
-    <!-- no translation found for perms_description_app (5139836143293299417) -->
-    <skip />
+    <string name="perms_description_app" msgid="5139836143293299417">"يقدمه <xliff:g id="APP_NAME">%1$s</xliff:g>."</string>
     <string name="no_permissions" msgid="7283357728219338112">"لا أذونات مطلوبة"</string>
     <string name="usb_storage_activity_title" msgid="4465055157209648641">"تخزين USB كبير السعة"</string>
     <string name="usb_storage_title" msgid="5901459041398751495">"USB متصل"</string>
@@ -1321,8 +1311,7 @@
     <string name="sending" msgid="3245653681008218030">"جارٍ الإرسال..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"تشغيل المتصفح؟"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"هل تريد قبول المكالمة؟"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
-    <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
-    <skip />
+    <string name="activity_resolver_use_once" msgid="405646673463328329">"مرة واحدة فقط"</string>
 </resources>
diff --git a/core/res/res/values-be/strings.xml b/core/res/res/values-be/strings.xml
index bc50211..446f113 100644
--- a/core/res/res/values-be/strings.xml
+++ b/core/res/res/values-be/strings.xml
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Адпраўка..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Запусцiць браўзер?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Прыняць выклік?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-bg/strings.xml b/core/res/res/values-bg/strings.xml
index 90462b3..b35eae5 100644
--- a/core/res/res/values-bg/strings.xml
+++ b/core/res/res/values-bg/strings.xml
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Изпраща се..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Да се стартира ли браузърът?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Да се приеме ли обаждането?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-ca/strings.xml b/core/res/res/values-ca/strings.xml
index 69d982b..5766f15f 100644
--- a/core/res/res/values-ca/strings.xml
+++ b/core/res/res/values-ca/strings.xml
@@ -175,28 +175,20 @@
     <string name="permgroupdesc_location" msgid="5704679763124170100">"Supervisa la teva ubicació física."</string>
     <string name="permgrouplab_network" msgid="5808983377727109831">"Comunicació de xarxa"</string>
     <string name="permgroupdesc_network" msgid="4478299413241861987">"Accedeix a diverses funcions de xarxa."</string>
-    <!-- no translation found for permgrouplab_bluetoothNetwork (1585403544162128109) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_bluetoothNetwork (5625288577164282391) -->
-    <skip />
-    <!-- no translation found for permgrouplab_shortrangeNetwork (130808676377486118) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_shortrangeNetwork (1884069062653436007) -->
-    <skip />
+    <string name="permgrouplab_bluetoothNetwork" msgid="1585403544162128109">"Bluetooth"</string>
+    <string name="permgroupdesc_bluetoothNetwork" msgid="5625288577164282391">"Accés a dispositius i a xarxes mitjançant Bluetooth."</string>
+    <string name="permgrouplab_shortrangeNetwork" msgid="130808676377486118">"Xarxes de poc abast"</string>
+    <string name="permgroupdesc_shortrangeNetwork" msgid="1884069062653436007">"Accés a dispositius mitjançant xarxes de poc abast, com ara NFC."</string>
     <string name="permgrouplab_audioSettings" msgid="8329261670151871235">"Configuració d\'àudio"</string>
     <string name="permgroupdesc_audioSettings" msgid="2641515403347568130">"Canviar la configuració de l\'àudio."</string>
     <string name="permgrouplab_affectsBattery" msgid="6209246653424798033">"Afectar la bateria"</string>
     <string name="permgroupdesc_affectsBattery" msgid="6441275320638916947">"Fer servir funcions que poden consumir bateria ràpidament."</string>
     <string name="permgrouplab_calendar" msgid="5863508437783683902">"Calendari"</string>
     <string name="permgroupdesc_calendar" msgid="5777534316982184416">"Accés directe a calendaris i a esdeveniments."</string>
-    <!-- no translation found for permgrouplab_dictionary (4148597128843641379) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_dictionary (7921166355964764490) -->
-    <skip />
-    <!-- no translation found for permgrouplab_writeDictionary (8090237702432576788) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_writeDictionary (2711561994497361646) -->
-    <skip />
+    <string name="permgrouplab_dictionary" msgid="4148597128843641379">"Llegeix el diccionari de l\'usuari"</string>
+    <string name="permgroupdesc_dictionary" msgid="7921166355964764490">"Llegeix paraules al diccionari de l\'usuari."</string>
+    <string name="permgrouplab_writeDictionary" msgid="8090237702432576788">"Escriu al diccionari de l\'usuari"</string>
+    <string name="permgroupdesc_writeDictionary" msgid="2711561994497361646">"Afegeix paraules al diccionari de l\'usuari."</string>
     <string name="permgrouplab_bookmarks" msgid="1949519673103968229">"Marcadors i historial"</string>
     <string name="permgroupdesc_bookmarks" msgid="4169771606257963028">"Accés directe a l\'historial de marcadors i de navegació."</string>
     <string name="permgrouplab_deviceAlarms" msgid="6117704629728824101">"Alarma"</string>
@@ -569,8 +561,7 @@
     <string name="permdesc_sdcardRead" product="nosdcard" msgid="3530894470637667917">"Permet que l\'aplicació llegeixi el contingut de l\'emmagatzematge USB, incloses les fotos i els fitxers multimèdia."</string>
     <string name="permdesc_sdcardRead" product="default" msgid="2555811422562526606">"Permet que l\'aplicació llegeixi el contingut de la targeta SD, incloses les fotos i els fitxers multimèdia."</string>
     <string name="permlab_sdcardWrite" product="nosdcard" msgid="8485979062254666748">"modificació o supressió del contingut de l\'emmagatzematge USB"</string>
-    <!-- no translation found for permlab_sdcardWrite (8805693630050458763) -->
-    <skip />
+    <string name="permlab_sdcardWrite" product="default" msgid="8805693630050458763">"modifica o suprimeix el contingut de la targeta SD"</string>
     <string name="permdesc_sdcardWrite" product="nosdcard" msgid="6175406299445710888">"Permet que l\'aplicació escrigui a l\'emmagatzematge USB."</string>
     <string name="permdesc_sdcardWrite" product="default" msgid="4337417790936632090">"Permet a l\'aplicació escriure a la targeta SD."</string>
     <string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"Canvia/esborra emmagatz. intern"</string>
@@ -1090,8 +1081,7 @@
     <string name="date_time_set" msgid="5777075614321087758">"Defineix"</string>
     <string name="date_time_done" msgid="2507683751759308828">"Fet"</string>
     <string name="perms_new_perm_prefix" msgid="8257740710754301407"><font size="12" fgcolor="#ff900000">"NOU: "</font></string>
-    <!-- no translation found for perms_description_app (5139836143293299417) -->
-    <skip />
+    <string name="perms_description_app" msgid="5139836143293299417">"Proporcionat per <xliff:g id="APP_NAME">%1$s</xliff:g>."</string>
     <string name="no_permissions" msgid="7283357728219338112">"No cal cap permís"</string>
     <string name="usb_storage_activity_title" msgid="4465055157209648641">"Emmagatzematge massiu USB"</string>
     <string name="usb_storage_title" msgid="5901459041398751495">"USB connectat"</string>
@@ -1321,8 +1311,6 @@
     <string name="sending" msgid="3245653681008218030">"S\'està enviant…"</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Vols iniciar el navegador?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Vols acceptar la trucada?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
-    <skip />
-    <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
-    <skip />
+    <string name="activity_resolver_use_always" msgid="8017770747801494933">"Sempre"</string>
+    <string name="activity_resolver_use_once" msgid="405646673463328329">"Només una vegada"</string>
 </resources>
diff --git a/core/res/res/values-cs/strings.xml b/core/res/res/values-cs/strings.xml
index c77a21a..dd6d0b1 100644
--- a/core/res/res/values-cs/strings.xml
+++ b/core/res/res/values-cs/strings.xml
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Odesílání..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Spustit prohlížeč?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Přijmout hovor?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-da/strings.xml b/core/res/res/values-da/strings.xml
index 5a5cda3..e46ff7c 100644
--- a/core/res/res/values-da/strings.xml
+++ b/core/res/res/values-da/strings.xml
@@ -1321,8 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Sender..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Vil du starte browseren?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Vil du besvare opkaldet?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
-    <skip />
+    <string name="activity_resolver_use_always" msgid="8017770747801494933">"Altid"</string>
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
 </resources>
diff --git a/core/res/res/values-de/strings.xml b/core/res/res/values-de/strings.xml
index 398313b..9145263 100644
--- a/core/res/res/values-de/strings.xml
+++ b/core/res/res/values-de/strings.xml
@@ -1321,8 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Wird gesendet..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Browser starten?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Anruf annehmen?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
-    <skip />
+    <string name="activity_resolver_use_always" msgid="8017770747801494933">"Immer"</string>
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
 </resources>
diff --git a/core/res/res/values-el/strings.xml b/core/res/res/values-el/strings.xml
index 05dcf69..08e2389 100644
--- a/core/res/res/values-el/strings.xml
+++ b/core/res/res/values-el/strings.xml
@@ -175,28 +175,20 @@
     <string name="permgroupdesc_location" msgid="5704679763124170100">"Παρακολούθηση της φυσικής τοποθεσίας σας."</string>
     <string name="permgrouplab_network" msgid="5808983377727109831">"Επικοινωνία δικτύου"</string>
     <string name="permgroupdesc_network" msgid="4478299413241861987">"Πρόσβαση σε διάφορες λειτουργίες δικτύου."</string>
-    <!-- no translation found for permgrouplab_bluetoothNetwork (1585403544162128109) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_bluetoothNetwork (5625288577164282391) -->
-    <skip />
-    <!-- no translation found for permgrouplab_shortrangeNetwork (130808676377486118) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_shortrangeNetwork (1884069062653436007) -->
-    <skip />
+    <string name="permgrouplab_bluetoothNetwork" msgid="1585403544162128109">"Bluetooth"</string>
+    <string name="permgroupdesc_bluetoothNetwork" msgid="5625288577164282391">"Πρόσβαση σε συσκευές και δίκτυα μέσω Bluetooth."</string>
+    <string name="permgrouplab_shortrangeNetwork" msgid="130808676377486118">"Δίκτυα μικρού εύρους"</string>
+    <string name="permgroupdesc_shortrangeNetwork" msgid="1884069062653436007">"Πρόσβαση σε συσκευές μέσω δικτύων μικρού εύρους όπως NFC."</string>
     <string name="permgrouplab_audioSettings" msgid="8329261670151871235">"Ρυθμίσεις ήχου"</string>
     <string name="permgroupdesc_audioSettings" msgid="2641515403347568130">"Αλλαγή ρυθμίσεων ήχου."</string>
     <string name="permgrouplab_affectsBattery" msgid="6209246653424798033">"Επηρεάζει την μπαταρία"</string>
     <string name="permgroupdesc_affectsBattery" msgid="6441275320638916947">"Χρήση λειτουργιών που μπορούν να εξαντλήσουν γρήγορα την μπαταρία."</string>
     <string name="permgrouplab_calendar" msgid="5863508437783683902">"Ημερολόγιο"</string>
     <string name="permgroupdesc_calendar" msgid="5777534316982184416">"Άμεση πρόσβαση σε ημερολόγιο και συμβάντα."</string>
-    <!-- no translation found for permgrouplab_dictionary (4148597128843641379) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_dictionary (7921166355964764490) -->
-    <skip />
-    <!-- no translation found for permgrouplab_writeDictionary (8090237702432576788) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_writeDictionary (2711561994497361646) -->
-    <skip />
+    <string name="permgrouplab_dictionary" msgid="4148597128843641379">"Ανάγνωση λεξικού χρήστη"</string>
+    <string name="permgroupdesc_dictionary" msgid="7921166355964764490">"Ανάγνωση λέξεων στο λεξικό χρήστη."</string>
+    <string name="permgrouplab_writeDictionary" msgid="8090237702432576788">"Εγγραφή στο λεξικό χρήστη"</string>
+    <string name="permgroupdesc_writeDictionary" msgid="2711561994497361646">"Προσθήκη λέξεων στο λεξικό χρήστη."</string>
     <string name="permgrouplab_bookmarks" msgid="1949519673103968229">"Σελιδοδείκτες και ιστορικό"</string>
     <string name="permgroupdesc_bookmarks" msgid="4169771606257963028">"Άμεση πρόσβαση σε σελιδοδείκτες και ιστορικού προγράμματος περιήγησης."</string>
     <string name="permgrouplab_deviceAlarms" msgid="6117704629728824101">"Ξυπνητήρι"</string>
@@ -569,8 +561,7 @@
     <string name="permdesc_sdcardRead" product="nosdcard" msgid="3530894470637667917">"Επιτρ. η ανάγν. περ. αποθ. χώρ. USB, με φωτ. και μέσα"</string>
     <string name="permdesc_sdcardRead" product="default" msgid="2555811422562526606">"Επιτρέπει στην εφαρμογή την ανάγνωση του περιεχομένου της κάρτας SD, το οποίο μπορεί να περιλαμβάνει φωτογραφίες και μέσα."</string>
     <string name="permlab_sdcardWrite" product="nosdcard" msgid="8485979062254666748">"τροπ. ή διαγρ. περιεχ. αποθ. χώρ. USB"</string>
-    <!-- no translation found for permlab_sdcardWrite (8805693630050458763) -->
-    <skip />
+    <string name="permlab_sdcardWrite" product="default" msgid="8805693630050458763">"τροποποίηση ή διαγραφή των περιεχομένων της κάρτας SD"</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>
@@ -1090,8 +1081,7 @@
     <string name="date_time_set" msgid="5777075614321087758">"Ορισμός"</string>
     <string name="date_time_done" msgid="2507683751759308828">"Τέλος"</string>
     <string name="perms_new_perm_prefix" msgid="8257740710754301407"><font size="12" fgcolor="#ff900000">"ΝΕΟ: "</font></string>
-    <!-- no translation found for perms_description_app (5139836143293299417) -->
-    <skip />
+    <string name="perms_description_app" msgid="5139836143293299417">"Παρέχεται από την εφαρμογή <xliff:g id="APP_NAME">%1$s</xliff:g>."</string>
     <string name="no_permissions" msgid="7283357728219338112">"Δεν απαιτούνται άδειες"</string>
     <string name="usb_storage_activity_title" msgid="4465055157209648641">"Μαζική αποθήκευση USB"</string>
     <string name="usb_storage_title" msgid="5901459041398751495">"Το USB είναι συνδεδεμένο"</string>
@@ -1321,8 +1311,6 @@
     <string name="sending" msgid="3245653681008218030">"Γίνεται αποστολή…"</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Εκκίνηση προγράμματος περιήγησης;"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Αποδοχή κλήσης;"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
-    <skip />
-    <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
-    <skip />
+    <string name="activity_resolver_use_always" msgid="8017770747801494933">"Πάντα"</string>
+    <string name="activity_resolver_use_once" msgid="405646673463328329">"Μόνο μία φορά"</string>
 </resources>
diff --git a/core/res/res/values-en-rGB/strings.xml b/core/res/res/values-en-rGB/strings.xml
index 4af21ed..c991437 100644
--- a/core/res/res/values-en-rGB/strings.xml
+++ b/core/res/res/values-en-rGB/strings.xml
@@ -175,28 +175,20 @@
     <string name="permgroupdesc_location" msgid="5704679763124170100">"Monitor your physical location."</string>
     <string name="permgrouplab_network" msgid="5808983377727109831">"Network communication"</string>
     <string name="permgroupdesc_network" msgid="4478299413241861987">"Access various network features."</string>
-    <!-- no translation found for permgrouplab_bluetoothNetwork (1585403544162128109) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_bluetoothNetwork (5625288577164282391) -->
-    <skip />
-    <!-- no translation found for permgrouplab_shortrangeNetwork (130808676377486118) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_shortrangeNetwork (1884069062653436007) -->
-    <skip />
+    <string name="permgrouplab_bluetoothNetwork" msgid="1585403544162128109">"Bluetooth"</string>
+    <string name="permgroupdesc_bluetoothNetwork" msgid="5625288577164282391">"Access devices and networks through Bluetooth."</string>
+    <string name="permgrouplab_shortrangeNetwork" msgid="130808676377486118">"Short-range Networks"</string>
+    <string name="permgroupdesc_shortrangeNetwork" msgid="1884069062653436007">"Access devices through short-range networks such as NFC."</string>
     <string name="permgrouplab_audioSettings" msgid="8329261670151871235">"Audio Settings"</string>
     <string name="permgroupdesc_audioSettings" msgid="2641515403347568130">"Change audio settings."</string>
     <string name="permgrouplab_affectsBattery" msgid="6209246653424798033">"Affects Battery"</string>
     <string name="permgroupdesc_affectsBattery" msgid="6441275320638916947">"Use features that can quickly drain battery."</string>
     <string name="permgrouplab_calendar" msgid="5863508437783683902">"Calendar"</string>
     <string name="permgroupdesc_calendar" msgid="5777534316982184416">"Direct access to calendar and events."</string>
-    <!-- no translation found for permgrouplab_dictionary (4148597128843641379) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_dictionary (7921166355964764490) -->
-    <skip />
-    <!-- no translation found for permgrouplab_writeDictionary (8090237702432576788) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_writeDictionary (2711561994497361646) -->
-    <skip />
+    <string name="permgrouplab_dictionary" msgid="4148597128843641379">"Read User Dictionary"</string>
+    <string name="permgroupdesc_dictionary" msgid="7921166355964764490">"Read words in user dictionary."</string>
+    <string name="permgrouplab_writeDictionary" msgid="8090237702432576788">"Write User Dictionary"</string>
+    <string name="permgroupdesc_writeDictionary" msgid="2711561994497361646">"Add words to the user dictionary."</string>
     <string name="permgrouplab_bookmarks" msgid="1949519673103968229">"Bookmarks and History"</string>
     <string name="permgroupdesc_bookmarks" msgid="4169771606257963028">"Direct access to bookmarks and browser history."</string>
     <string name="permgrouplab_deviceAlarms" msgid="6117704629728824101">"Alarm"</string>
@@ -569,8 +561,7 @@
     <string name="permdesc_sdcardRead" product="nosdcard" msgid="3530894470637667917">"Allows the app to read contents of USB storage, which may include photos and media."</string>
     <string name="permdesc_sdcardRead" product="default" msgid="2555811422562526606">"Allows the app to read contents of SD card, which may include photos and media."</string>
     <string name="permlab_sdcardWrite" product="nosdcard" msgid="8485979062254666748">"modify or delete the contents of your USB storage"</string>
-    <!-- no translation found for permlab_sdcardWrite (8805693630050458763) -->
-    <skip />
+    <string name="permlab_sdcardWrite" product="default" msgid="8805693630050458763">"modify or delete the contents of your SD card"</string>
     <string name="permdesc_sdcardWrite" product="nosdcard" msgid="6175406299445710888">"Allows the app to write to the USB storage."</string>
     <string name="permdesc_sdcardWrite" product="default" msgid="4337417790936632090">"Allows the app to write to the SD card."</string>
     <string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"modify/delete internal media storage contents"</string>
@@ -1090,8 +1081,7 @@
     <string name="date_time_set" msgid="5777075614321087758">"Set"</string>
     <string name="date_time_done" msgid="2507683751759308828">"Done"</string>
     <string name="perms_new_perm_prefix" msgid="8257740710754301407"><font size="12" fgcolor="#ff900000">"NEW: "</font></string>
-    <!-- no translation found for perms_description_app (5139836143293299417) -->
-    <skip />
+    <string name="perms_description_app" msgid="5139836143293299417">"Provided by <xliff:g id="APP_NAME">%1$s</xliff:g>."</string>
     <string name="no_permissions" msgid="7283357728219338112">"No permission required"</string>
     <string name="usb_storage_activity_title" msgid="4465055157209648641">"USB mass storage"</string>
     <string name="usb_storage_title" msgid="5901459041398751495">"USB connected"</string>
@@ -1321,8 +1311,6 @@
     <string name="sending" msgid="3245653681008218030">"Sending…"</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Launch Browser?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Accept call?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
-    <skip />
-    <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
-    <skip />
+    <string name="activity_resolver_use_always" msgid="8017770747801494933">"Always"</string>
+    <string name="activity_resolver_use_once" msgid="405646673463328329">"Just Once"</string>
 </resources>
diff --git a/core/res/res/values-es-rUS/strings.xml b/core/res/res/values-es-rUS/strings.xml
index a3eb0f9..94d7a4b 100644
--- a/core/res/res/values-es-rUS/strings.xml
+++ b/core/res/res/values-es-rUS/strings.xml
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Enviando..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"¿Deseas iniciar el navegador?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"¿Aceptar la llamada?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml
index fd28787..ea1f3c4 100644
--- a/core/res/res/values-es/strings.xml
+++ b/core/res/res/values-es/strings.xml
@@ -175,28 +175,20 @@
     <string name="permgroupdesc_location" msgid="5704679763124170100">"Controlar tu ubicación física"</string>
     <string name="permgrouplab_network" msgid="5808983377727109831">"Comunicación de red"</string>
     <string name="permgroupdesc_network" msgid="4478299413241861987">"Acceder a distintas funciones de red"</string>
-    <!-- no translation found for permgrouplab_bluetoothNetwork (1585403544162128109) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_bluetoothNetwork (5625288577164282391) -->
-    <skip />
-    <!-- no translation found for permgrouplab_shortrangeNetwork (130808676377486118) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_shortrangeNetwork (1884069062653436007) -->
-    <skip />
+    <string name="permgrouplab_bluetoothNetwork" msgid="1585403544162128109">"Bluetooth"</string>
+    <string name="permgroupdesc_bluetoothNetwork" msgid="5625288577164282391">"Acceder a dispositivos y redes a través de Bluetooth"</string>
+    <string name="permgrouplab_shortrangeNetwork" msgid="130808676377486118">"Redes de corto alcance"</string>
+    <string name="permgroupdesc_shortrangeNetwork" msgid="1884069062653436007">"Acceder a dispositivos a través de redes de corto alcance, como NFC"</string>
     <string name="permgrouplab_audioSettings" msgid="8329261670151871235">"Ajustes de audio"</string>
     <string name="permgroupdesc_audioSettings" msgid="2641515403347568130">"Modificar ajustes de audio"</string>
     <string name="permgrouplab_affectsBattery" msgid="6209246653424798033">"Afectar a la batería"</string>
     <string name="permgroupdesc_affectsBattery" msgid="6441275320638916947">"Usar funciones que agotan la batería rápidamente"</string>
     <string name="permgrouplab_calendar" msgid="5863508437783683902">"Calendario"</string>
     <string name="permgroupdesc_calendar" msgid="5777534316982184416">"Acceder directamente al calendario y a los eventos"</string>
-    <!-- no translation found for permgrouplab_dictionary (4148597128843641379) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_dictionary (7921166355964764490) -->
-    <skip />
-    <!-- no translation found for permgrouplab_writeDictionary (8090237702432576788) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_writeDictionary (2711561994497361646) -->
-    <skip />
+    <string name="permgrouplab_dictionary" msgid="4148597128843641379">"Leer el diccionario del usuario"</string>
+    <string name="permgroupdesc_dictionary" msgid="7921166355964764490">"Leer palabras del diccionario del usuario"</string>
+    <string name="permgrouplab_writeDictionary" msgid="8090237702432576788">"Escribir en el diccionario del usuario"</string>
+    <string name="permgroupdesc_writeDictionary" msgid="2711561994497361646">"Añadir palabras al diccionario del usuario"</string>
     <string name="permgrouplab_bookmarks" msgid="1949519673103968229">"Marcadores e historial"</string>
     <string name="permgroupdesc_bookmarks" msgid="4169771606257963028">"Acceder directamente a los marcadores y al historial del navegador"</string>
     <string name="permgrouplab_deviceAlarms" msgid="6117704629728824101">"Alarma"</string>
@@ -569,8 +561,7 @@
     <string name="permdesc_sdcardRead" product="nosdcard" msgid="3530894470637667917">"Permite que la aplicación lea el contenido del almacenamiento USB que puede incluir fotos y archivos multimedia."</string>
     <string name="permdesc_sdcardRead" product="default" msgid="2555811422562526606">"Permite que la aplicación lea el contenido de la tarjeta SD que puede incluir fotos y archivos multimedia."</string>
     <string name="permlab_sdcardWrite" product="nosdcard" msgid="8485979062254666748">"editar o borrar contenido de USB"</string>
-    <!-- no translation found for permlab_sdcardWrite (8805693630050458763) -->
-    <skip />
+    <string name="permlab_sdcardWrite" product="default" msgid="8805693630050458763">"modificar o eliminar el contenido de la tarjeta SD"</string>
     <string name="permdesc_sdcardWrite" product="nosdcard" msgid="6175406299445710888">"Permite escribir en el almacenamiento USB."</string>
     <string name="permdesc_sdcardWrite" product="default" msgid="4337417790936632090">"Permite que la aplicación escriba en la tarjeta SD."</string>
     <string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"modificar o eliminar el contenido del almacenamiento de medios interno"</string>
@@ -1090,8 +1081,7 @@
     <string name="date_time_set" msgid="5777075614321087758">"Establecer"</string>
     <string name="date_time_done" msgid="2507683751759308828">"Listo"</string>
     <string name="perms_new_perm_prefix" msgid="8257740710754301407"><font size="12" fgcolor="#ff900000">"NUEVO:"</font></string>
-    <!-- no translation found for perms_description_app (5139836143293299417) -->
-    <skip />
+    <string name="perms_description_app" msgid="5139836143293299417">"Proporcionado por <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
     <string name="no_permissions" msgid="7283357728219338112">"No es necesario ningún permiso"</string>
     <string name="usb_storage_activity_title" msgid="4465055157209648641">"Almacenamiento USB masivo"</string>
     <string name="usb_storage_title" msgid="5901459041398751495">"Conexión por USB"</string>
@@ -1321,8 +1311,6 @@
     <string name="sending" msgid="3245653681008218030">"Enviando..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"¿Iniciar el navegador?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"¿Aceptar la llamada?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
-    <skip />
-    <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
-    <skip />
+    <string name="activity_resolver_use_always" msgid="8017770747801494933">"Siempre"</string>
+    <string name="activity_resolver_use_once" msgid="405646673463328329">"Solo una vez"</string>
 </resources>
diff --git a/core/res/res/values-et/strings.xml b/core/res/res/values-et/strings.xml
index 82e76e0..c87b0cc 100644
--- a/core/res/res/values-et/strings.xml
+++ b/core/res/res/values-et/strings.xml
@@ -1321,7 +1321,7 @@
     <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>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-fa/strings.xml b/core/res/res/values-fa/strings.xml
index 1c0ef97..77bba4d 100644
--- a/core/res/res/values-fa/strings.xml
+++ b/core/res/res/values-fa/strings.xml
@@ -168,84 +168,47 @@
     <string name="permgrouplab_messages" msgid="7521249148445456662">"پیام های شما"</string>
     <string name="permgroupdesc_messages" msgid="7821999071003699236">"پیام کوتاه، ایمیل و دیگر پیامها را بخوانید."</string>
     <string name="permgrouplab_personalInfo" msgid="3519163141070533474">"اطلاعات شخصی شما"</string>
-    <!-- no translation found for permgroupdesc_personalInfo (8426453129788861338) -->
-    <skip />
-    <!-- no translation found for permgrouplab_socialInfo (5799096623412043791) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_socialInfo (7129842457611643493) -->
-    <skip />
+    <string name="permgroupdesc_personalInfo" msgid="8426453129788861338">"مستقیم به اطلاعات مربوط به خود، ذخیره شده در روی کارت تماس خود دسترسی داشته باشید."</string>
+    <string name="permgrouplab_socialInfo" msgid="5799096623412043791">"اطلاعات اجتماعی شما"</string>
+    <string name="permgroupdesc_socialInfo" msgid="7129842457611643493">"مستقیم به اطلاعات مخاطبین و روابط اجتماعی دسترسی داشته باشید."</string>
     <string name="permgrouplab_location" msgid="635149742436692049">"موقعیت مکانی شما"</string>
     <string name="permgroupdesc_location" msgid="5704679763124170100">"بر موقعیت مکانی فیزیکی خود نظارت داشته باشید."</string>
     <string name="permgrouplab_network" msgid="5808983377727109831">"ارتباط شبکه"</string>
     <string name="permgroupdesc_network" msgid="4478299413241861987">"به ویژگی‎های مختلف شبکه دسترسی داشته باشید."</string>
-    <!-- no translation found for permgrouplab_bluetoothNetwork (1585403544162128109) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_bluetoothNetwork (5625288577164282391) -->
-    <skip />
-    <!-- no translation found for permgrouplab_shortrangeNetwork (130808676377486118) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_shortrangeNetwork (1884069062653436007) -->
-    <skip />
-    <!-- no translation found for permgrouplab_audioSettings (8329261670151871235) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_audioSettings (2641515403347568130) -->
-    <skip />
-    <!-- no translation found for permgrouplab_affectsBattery (6209246653424798033) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_affectsBattery (6441275320638916947) -->
-    <skip />
-    <!-- no translation found for permgrouplab_calendar (5863508437783683902) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_calendar (5777534316982184416) -->
-    <skip />
-    <!-- no translation found for permgrouplab_dictionary (4148597128843641379) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_dictionary (7921166355964764490) -->
-    <skip />
-    <!-- no translation found for permgrouplab_writeDictionary (8090237702432576788) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_writeDictionary (2711561994497361646) -->
-    <skip />
-    <!-- no translation found for permgrouplab_bookmarks (1949519673103968229) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_bookmarks (4169771606257963028) -->
-    <skip />
-    <!-- no translation found for permgrouplab_deviceAlarms (6117704629728824101) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_deviceAlarms (4769356362251641175) -->
-    <skip />
-    <!-- no translation found for permgrouplab_voicemail (4162237145027592133) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_voicemail (2498403969862951393) -->
-    <skip />
-    <!-- no translation found for permgrouplab_microphone (171539900250043464) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_microphone (7106618286905738408) -->
-    <skip />
-    <!-- no translation found for permgrouplab_camera (4820372495894586615) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_camera (2933667372289567714) -->
-    <skip />
-    <!-- no translation found for permgrouplab_appInfo (8028789762634147725) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_appInfo (3950378538049625907) -->
-    <skip />
-    <!-- no translation found for permgrouplab_wallpaper (3850280158041175998) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_wallpaper (5630417854750540154) -->
-    <skip />
-    <!-- no translation found for permgrouplab_systemClock (406535759236612992) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_systemClock (3944359833624094992) -->
-    <skip />
-    <!-- no translation found for permgrouplab_statusBar (2095862568113945398) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_statusBar (6242593432226807171) -->
-    <skip />
-    <!-- no translation found for permgrouplab_syncSettings (3341990986147826541) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_syncSettings (7603195265129031797) -->
-    <skip />
+    <string name="permgrouplab_bluetoothNetwork" msgid="1585403544162128109">"بلوتوث"</string>
+    <string name="permgroupdesc_bluetoothNetwork" msgid="5625288577164282391">"از طریق بلوتوث به دستگاه‌ها و شبکه‌ها دسترسی داشته باشد."</string>
+    <string name="permgrouplab_shortrangeNetwork" msgid="130808676377486118">"شبکه‌های نزدیک"</string>
+    <string name="permgroupdesc_shortrangeNetwork" msgid="1884069062653436007">"از طریق شبکه‌های نزدیک مانند NFC، به دستگاه‌ها دسترسی داشته باشد."</string>
+    <string name="permgrouplab_audioSettings" msgid="8329261670151871235">"تنظیمات صدا"</string>
+    <string name="permgroupdesc_audioSettings" msgid="2641515403347568130">"تنظیمات صوتی را تغییر دهید."</string>
+    <string name="permgrouplab_affectsBattery" msgid="6209246653424798033">"روی باتری اثر دارد"</string>
+    <string name="permgroupdesc_affectsBattery" msgid="6441275320638916947">"از ویژگی‌هایی استفاده کنید که باتری را سریع خالی می‌کند."</string>
+    <string name="permgrouplab_calendar" msgid="5863508437783683902">"تقویم"</string>
+    <string name="permgroupdesc_calendar" msgid="5777534316982184416">"مستقیم به رویدادها و تقویم دسترسی داشته باشید."</string>
+    <string name="permgrouplab_dictionary" msgid="4148597128843641379">"خواندن فرهنگ لغت کاربر"</string>
+    <string name="permgroupdesc_dictionary" msgid="7921166355964764490">"کلمات را در فرهنگ لغت کاربر بخواند."</string>
+    <string name="permgrouplab_writeDictionary" msgid="8090237702432576788">"نوشتن فرهنگ لغت کاربر"</string>
+    <string name="permgroupdesc_writeDictionary" msgid="2711561994497361646">"کلمات را به فرهنگ لغت کاربر اضافه کند."</string>
+    <string name="permgrouplab_bookmarks" msgid="1949519673103968229">"نشانک‌ها و سابقه"</string>
+    <string name="permgroupdesc_bookmarks" msgid="4169771606257963028">"مستقیم به نشانک‌ها و سابقه مرور دسترسی داشته باشید."</string>
+    <string name="permgrouplab_deviceAlarms" msgid="6117704629728824101">"زنگ هشدار"</string>
+    <string name="permgroupdesc_deviceAlarms" msgid="4769356362251641175">"ساعت زنگ دار را تنظیم کنید."</string>
+    <string name="permgrouplab_voicemail" msgid="4162237145027592133">"پست صوتی"</string>
+    <string name="permgroupdesc_voicemail" msgid="2498403969862951393">"به پست صوتی مستقیم دسترسی داشته باشید."</string>
+    <string name="permgrouplab_microphone" msgid="171539900250043464">"میکروفن"</string>
+    <string name="permgroupdesc_microphone" msgid="7106618286905738408">"مستقیم به میکروفن برای ضبط صدا دسترسی داشته باشید."</string>
+    <string name="permgrouplab_camera" msgid="4820372495894586615">"دوربین"</string>
+    <string name="permgroupdesc_camera" msgid="2933667372289567714">"مستقیم به دوربین برای عکس گرفتن یا ضبط فیلم دسترسی داشته باشید."</string>
+    <string name="permgrouplab_appInfo" msgid="8028789762634147725">"اطلاعات برنامه‌های شما"</string>
+    <string name="permgroupdesc_appInfo" msgid="3950378538049625907">"می‌تواند بر عملکرد برنامه‌های دیگر روی دستگاه اثر بگذارد."</string>
+    <string name="permgrouplab_wallpaper" msgid="3850280158041175998">"تصویر زمینه"</string>
+    <string name="permgroupdesc_wallpaper" msgid="5630417854750540154">"تنظیمات تصویر زمینه دستگاه را تغییر دهید."</string>
+    <string name="permgrouplab_systemClock" msgid="406535759236612992">"ساعت"</string>
+    <string name="permgroupdesc_systemClock" msgid="3944359833624094992">"زمان یا منطقه زمانی دستگاه را تغییر دهید."</string>
+    <string name="permgrouplab_statusBar" msgid="2095862568113945398">"نوار وضعیت"</string>
+    <string name="permgroupdesc_statusBar" msgid="6242593432226807171">"تنظیمات نوار وضعیت دستگاه را تغییر دهید."</string>
+    <string name="permgrouplab_syncSettings" msgid="3341990986147826541">"تنظیمات همگام‌سازی"</string>
+    <string name="permgroupdesc_syncSettings" msgid="7603195265129031797">"به تنظیمات همگام‌سازی دسترسی داشته باشید."</string>
     <string name="permgrouplab_accounts" msgid="3359646291125325519">"حساب های شما"</string>
     <string name="permgroupdesc_accounts" msgid="4948732641827091312">"به حساب های موجود دسترسی داشته باشید."</string>
     <string name="permgrouplab_hardwareControls" msgid="7998214968791599326">"کنترل های سخت افزار"</string>
@@ -256,10 +219,8 @@
     <string name="permgroupdesc_systemTools" msgid="8162102602190734305">"دسترسی سطح پایین و کنترل سیستم."</string>
     <string name="permgrouplab_developmentTools" msgid="3446164584710596513">"ابزارهای توسعه"</string>
     <string name="permgroupdesc_developmentTools" msgid="7058828032358142018">"ویژگیهایی که فقط مورد نیاز برنامه نویسان است."</string>
-    <!-- no translation found for permgrouplab_display (4279909676036402636) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_display (6051002031933013714) -->
-    <skip />
+    <string name="permgrouplab_display" msgid="4279909676036402636">"رابط برنامه دیگر"</string>
+    <string name="permgroupdesc_display" msgid="6051002031933013714">"روی رابط برنامه‌های دیگر اثر دارد."</string>
     <string name="permgrouplab_storage" msgid="1971118770546336966">"ذخیره سازی"</string>
     <string name="permgroupdesc_storage" product="nosdcard" msgid="7442318502446874999">"به حافظه USB دسترسی پیدا کنید."</string>
     <string name="permgroupdesc_storage" product="default" msgid="9203302214915355774">"به کارت SD دسترسی داشته باشید."</string>
@@ -600,8 +561,7 @@
     <string name="permdesc_sdcardRead" product="nosdcard" msgid="3530894470637667917">"به برنامه امکان می‌دهد محتویات حافظه USB را بخواند که ممکن است حاوی عکس و رسانه باشد."</string>
     <string name="permdesc_sdcardRead" product="default" msgid="2555811422562526606">"به برنامه اجازه می‌دهد محتویات کارت SD را بخواند که ممکن است حاوی عکس و رسانه باشد."</string>
     <string name="permlab_sdcardWrite" product="nosdcard" msgid="8485979062254666748">"اصلاح یا حذف محتویات حافظه USB شما"</string>
-    <!-- no translation found for permlab_sdcardWrite (8805693630050458763) -->
-    <skip />
+    <string name="permlab_sdcardWrite" product="default" msgid="8805693630050458763">"محتوای کارت SD شما را اصلاح کرده یا تغییر دهد"</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>
@@ -779,8 +739,7 @@
     <string name="lockscreen_missing_sim_message" product="default" msgid="2186920585695169078">"سیم کارت درون تلفن نیست."</string>
     <string name="lockscreen_missing_sim_instructions" msgid="5372787138023272615">"سیم کارت را وارد کنید."</string>
     <string name="lockscreen_missing_sim_instructions_long" msgid="3526573099019319472">"سیم کارت موجود نیست یا قابل خواندن نیست. یک سیم کارت وارد کنید."</string>
-    <!-- no translation found for lockscreen_permanent_disabled_sim_message_short (5096149665138916184) -->
-    <skip />
+    <string name="lockscreen_permanent_disabled_sim_message_short" msgid="5096149665138916184">"سیم کارت غیرقابل استفاده است."</string>
     <string name="lockscreen_permanent_disabled_sim_instructions" msgid="910904643433151371">"سیم کارت شما به طور دائم غیر فعال شده است. "\n"برای داشتن سیم کارت دیگر با ارائه‎دهنده سرویس بی‎سیم خود تماس بگیرید."</string>
     <string name="lockscreen_transport_prev_description" msgid="201594905152746886">"دکمه تراک قبلی"</string>
     <string name="lockscreen_transport_next_description" msgid="6089297650481292363">"دکمه تراک بعدی"</string>
@@ -1122,8 +1081,7 @@
     <string name="date_time_set" msgid="5777075614321087758">"تنظیم"</string>
     <string name="date_time_done" msgid="2507683751759308828">"انجام شد"</string>
     <string name="perms_new_perm_prefix" msgid="8257740710754301407"><font size="12" fgcolor="#ff900000">"جدید: "</font></string>
-    <!-- no translation found for perms_description_app (5139836143293299417) -->
-    <skip />
+    <string name="perms_description_app" msgid="5139836143293299417">"ارائه شده توسط <xliff:g id="APP_NAME">%1$s</xliff:g> ."</string>
     <string name="no_permissions" msgid="7283357728219338112">"مجوزی لازم نیست"</string>
     <string name="usb_storage_activity_title" msgid="4465055157209648641">"حافظه انبوه USB"</string>
     <string name="usb_storage_title" msgid="5901459041398751495">"USB متصل شد"</string>
@@ -1353,8 +1311,7 @@
     <string name="sending" msgid="3245653681008218030">"درحال ارسال..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"مرورگر راه‌اندازی شود؟"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"تماس را می‌پذیرید؟"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
-    <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
-    <skip />
+    <string name="activity_resolver_use_once" msgid="405646673463328329">"فقط یکبار"</string>
 </resources>
diff --git a/core/res/res/values-fi/strings.xml b/core/res/res/values-fi/strings.xml
index ac72b4e..8f244c0 100644
--- a/core/res/res/values-fi/strings.xml
+++ b/core/res/res/values-fi/strings.xml
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Lähetetään…"</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Käynnistetäänkö selain?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Vastataanko puheluun?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-fr/strings.xml b/core/res/res/values-fr/strings.xml
index 1622284..c1c3e84 100644
--- a/core/res/res/values-fr/strings.xml
+++ b/core/res/res/values-fr/strings.xml
@@ -1321,8 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Envoi en cours…"</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Lancer le navigateur ?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Prendre l\'appel ?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
-    <skip />
+    <string name="activity_resolver_use_always" msgid="8017770747801494933">"Toujours"</string>
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
 </resources>
diff --git a/core/res/res/values-h720dp/dimens.xml b/core/res/res/values-h720dp/dimens.xml
index 5a9c777..f726a98 100644
--- a/core/res/res/values-h720dp/dimens.xml
+++ b/core/res/res/values-h720dp/dimens.xml
@@ -19,12 +19,4 @@
 <resources>
     <!-- Dialog button bar height -->
     <dimen name="alert_dialog_button_bar_height">54dip</dimen>
-    <!-- Preference fragment padding, bottom -->
-    <dimen name="preference_fragment_padding_bottom">16dp</dimen>
-
-    <dimen name="preference_screen_header_padding_side">0dip</dimen>
-
-    <integer name="preference_screen_header_scrollbarStyle">0x0</integer> <!-- insideOverlay -->
-    <integer name="preference_fragment_scrollbarStyle">0x02000000</integer> <!-- outsideOverlay -->
-
 </resources>
diff --git a/core/res/res/values-hi/strings.xml b/core/res/res/values-hi/strings.xml
index ea6447f..3726b6c 100644
--- a/core/res/res/values-hi/strings.xml
+++ b/core/res/res/values-hi/strings.xml
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"भेजा जा रहा है…"</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"ब्राउज़र लॉन्च करें?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"कॉल स्वीकार करें?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-hr/strings.xml b/core/res/res/values-hr/strings.xml
index b1c95aa..8e03743 100644
--- a/core/res/res/values-hr/strings.xml
+++ b/core/res/res/values-hr/strings.xml
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Slanje..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Pokrenuti preglednik?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Prihvatiti poziv?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-hu/strings.xml b/core/res/res/values-hu/strings.xml
index 89aedcc..a00ae69 100644
--- a/core/res/res/values-hu/strings.xml
+++ b/core/res/res/values-hu/strings.xml
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Küldés…"</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Böngésző indítása?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Fogadja a hívást?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-in/strings.xml b/core/res/res/values-in/strings.xml
index 7dc51e4..753e7fd 100644
--- a/core/res/res/values-in/strings.xml
+++ b/core/res/res/values-in/strings.xml
@@ -168,12 +168,9 @@
     <string name="permgrouplab_messages" msgid="7521249148445456662">"Pesan Anda"</string>
     <string name="permgroupdesc_messages" msgid="7821999071003699236">"Membaca dan menulis SMS, email, dan pesan Anda lainnya."</string>
     <string name="permgrouplab_personalInfo" msgid="3519163141070533474">"Informasi pribadi Anda"</string>
-    <!-- no translation found for permgroupdesc_personalInfo (8426453129788861338) -->
-    <skip />
-    <!-- no translation found for permgrouplab_socialInfo (5799096623412043791) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_socialInfo (7129842457611643493) -->
-    <skip />
+    <string name="permgroupdesc_personalInfo" msgid="8426453129788861338">"Akses langsung ke informasi tentang Anda, yang tersimpan dalam kartu kontak Anda."</string>
+    <string name="permgrouplab_socialInfo" msgid="5799096623412043791">"Informasi sosial Anda"</string>
+    <string name="permgroupdesc_socialInfo" msgid="7129842457611643493">"Akses langsung ke informasi tentang kontak dan hubungan sosial Anda."</string>
     <string name="permgrouplab_location" msgid="635149742436692049">"Lokasi Anda"</string>
     <string name="permgroupdesc_location" msgid="5704679763124170100">"Memonitor lokasi fisik Anda."</string>
     <string name="permgrouplab_network" msgid="5808983377727109831">"Komunikasi jaringan"</string>
@@ -186,18 +183,12 @@
     <skip />
     <!-- no translation found for permgroupdesc_shortrangeNetwork (1884069062653436007) -->
     <skip />
-    <!-- no translation found for permgrouplab_audioSettings (8329261670151871235) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_audioSettings (2641515403347568130) -->
-    <skip />
-    <!-- no translation found for permgrouplab_affectsBattery (6209246653424798033) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_affectsBattery (6441275320638916947) -->
-    <skip />
-    <!-- no translation found for permgrouplab_calendar (5863508437783683902) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_calendar (5777534316982184416) -->
-    <skip />
+    <string name="permgrouplab_audioSettings" msgid="8329261670151871235">"Setelan Audio"</string>
+    <string name="permgroupdesc_audioSettings" msgid="2641515403347568130">"Mengubah setelan audio."</string>
+    <string name="permgrouplab_affectsBattery" msgid="6209246653424798033">"Memengaruhi Baterai"</string>
+    <string name="permgroupdesc_affectsBattery" msgid="6441275320638916947">"Menggunakan fitur yang dapat menguras baterai dengan cepat."</string>
+    <string name="permgrouplab_calendar" msgid="5863508437783683902">"Kalender"</string>
+    <string name="permgroupdesc_calendar" msgid="5777534316982184416">"Akses langsung ke kalender dan acara."</string>
     <!-- no translation found for permgrouplab_dictionary (4148597128843641379) -->
     <skip />
     <!-- no translation found for permgroupdesc_dictionary (7921166355964764490) -->
@@ -206,46 +197,26 @@
     <skip />
     <!-- no translation found for permgroupdesc_writeDictionary (2711561994497361646) -->
     <skip />
-    <!-- no translation found for permgrouplab_bookmarks (1949519673103968229) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_bookmarks (4169771606257963028) -->
-    <skip />
-    <!-- no translation found for permgrouplab_deviceAlarms (6117704629728824101) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_deviceAlarms (4769356362251641175) -->
-    <skip />
-    <!-- no translation found for permgrouplab_voicemail (4162237145027592133) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_voicemail (2498403969862951393) -->
-    <skip />
-    <!-- no translation found for permgrouplab_microphone (171539900250043464) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_microphone (7106618286905738408) -->
-    <skip />
-    <!-- no translation found for permgrouplab_camera (4820372495894586615) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_camera (2933667372289567714) -->
-    <skip />
-    <!-- no translation found for permgrouplab_appInfo (8028789762634147725) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_appInfo (3950378538049625907) -->
-    <skip />
-    <!-- no translation found for permgrouplab_wallpaper (3850280158041175998) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_wallpaper (5630417854750540154) -->
-    <skip />
-    <!-- no translation found for permgrouplab_systemClock (406535759236612992) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_systemClock (3944359833624094992) -->
-    <skip />
-    <!-- no translation found for permgrouplab_statusBar (2095862568113945398) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_statusBar (6242593432226807171) -->
-    <skip />
-    <!-- no translation found for permgrouplab_syncSettings (3341990986147826541) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_syncSettings (7603195265129031797) -->
-    <skip />
+    <string name="permgrouplab_bookmarks" msgid="1949519673103968229">"Bookmark dan Riwayat"</string>
+    <string name="permgroupdesc_bookmarks" msgid="4169771606257963028">"Akses langsung ke bookmark dan riwayat browser."</string>
+    <string name="permgrouplab_deviceAlarms" msgid="6117704629728824101">"Alarm"</string>
+    <string name="permgroupdesc_deviceAlarms" msgid="4769356362251641175">"Menyetel jam alarm."</string>
+    <string name="permgrouplab_voicemail" msgid="4162237145027592133">"Pesan Suara"</string>
+    <string name="permgroupdesc_voicemail" msgid="2498403969862951393">"Akses langsung ke pesan suara."</string>
+    <string name="permgrouplab_microphone" msgid="171539900250043464">"Mikrofon"</string>
+    <string name="permgroupdesc_microphone" msgid="7106618286905738408">"Akses langsung ke mikrofon untuk merekam audio."</string>
+    <string name="permgrouplab_camera" msgid="4820372495894586615">"Kamera"</string>
+    <string name="permgroupdesc_camera" msgid="2933667372289567714">"Akses langsung ke kamera untuk gambar atau tangkapan video."</string>
+    <string name="permgrouplab_appInfo" msgid="8028789762634147725">"Informasi aplikasi Anda"</string>
+    <string name="permgroupdesc_appInfo" msgid="3950378538049625907">"Kemampuan untuk memengaruhi perilaku aplikasi lain pada perangkat Anda."</string>
+    <string name="permgrouplab_wallpaper" msgid="3850280158041175998">"Wallpaper"</string>
+    <string name="permgroupdesc_wallpaper" msgid="5630417854750540154">"Mengubah setelan wallpaper perangkat."</string>
+    <string name="permgrouplab_systemClock" msgid="406535759236612992">"Jam"</string>
+    <string name="permgroupdesc_systemClock" msgid="3944359833624094992">"Mengubah zona waktu atau waktu perangkat."</string>
+    <string name="permgrouplab_statusBar" msgid="2095862568113945398">"Bilah Status"</string>
+    <string name="permgroupdesc_statusBar" msgid="6242593432226807171">"Mengubah setelan bilah status perangkat."</string>
+    <string name="permgrouplab_syncSettings" msgid="3341990986147826541">"Setelan Sinkronisasi"</string>
+    <string name="permgroupdesc_syncSettings" msgid="7603195265129031797">"Akses ke setelan sinkronisasi."</string>
     <string name="permgrouplab_accounts" msgid="3359646291125325519">"Akun-akun Anda"</string>
     <string name="permgroupdesc_accounts" msgid="4948732641827091312">"Akses akun yang tersedia."</string>
     <string name="permgrouplab_hardwareControls" msgid="7998214968791599326">"Kontrol perangkat keras"</string>
@@ -256,10 +227,8 @@
     <string name="permgroupdesc_systemTools" msgid="8162102602190734305">"Akses tingkat rendah dan kontrol sistem."</string>
     <string name="permgrouplab_developmentTools" msgid="3446164584710596513">"Peralatan pengembangan"</string>
     <string name="permgroupdesc_developmentTools" msgid="7058828032358142018">"Fitur hanya diperlukan oleh pengembang apl."</string>
-    <!-- no translation found for permgrouplab_display (4279909676036402636) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_display (6051002031933013714) -->
-    <skip />
+    <string name="permgrouplab_display" msgid="4279909676036402636">"UI Aplikasi Lainnya"</string>
+    <string name="permgroupdesc_display" msgid="6051002031933013714">"Memengaruhi UI aplikasi lain."</string>
     <string name="permgrouplab_storage" msgid="1971118770546336966">"Penyimpanan"</string>
     <string name="permgroupdesc_storage" product="nosdcard" msgid="7442318502446874999">"Akses penyimpanan USB."</string>
     <string name="permgroupdesc_storage" product="default" msgid="9203302214915355774">"Akses kartu SD."</string>
@@ -779,8 +748,7 @@
     <string name="lockscreen_missing_sim_message" product="default" msgid="2186920585695169078">"Tidak ada Kartu SIM di dalam ponsel."</string>
     <string name="lockscreen_missing_sim_instructions" msgid="5372787138023272615">"Masukkan kartu SIM."</string>
     <string name="lockscreen_missing_sim_instructions_long" msgid="3526573099019319472">"Kartu SIM tidak ada atau tidak dapat dibaca. Masukkan kartu SIM."</string>
-    <!-- no translation found for lockscreen_permanent_disabled_sim_message_short (5096149665138916184) -->
-    <skip />
+    <string name="lockscreen_permanent_disabled_sim_message_short" msgid="5096149665138916184">"Kartu SIM tidak dapat digunakan."</string>
     <string name="lockscreen_permanent_disabled_sim_instructions" msgid="910904643433151371">"Kartu SIM Anda telah dinonaktifkan secara permanen."\n" Hubungi penyedia layanan nirkabel Anda untuk kartu SIM lain."</string>
     <string name="lockscreen_transport_prev_description" msgid="201594905152746886">"Tombol trek sebelumnya"</string>
     <string name="lockscreen_transport_next_description" msgid="6089297650481292363">"Tombol trek berikutnya"</string>
@@ -1353,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Mengirim..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Luncurkan Browser?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Terima panggilan?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-it/strings.xml b/core/res/res/values-it/strings.xml
index ce93389..0764284 100644
--- a/core/res/res/values-it/strings.xml
+++ b/core/res/res/values-it/strings.xml
@@ -175,28 +175,20 @@
     <string name="permgroupdesc_location" msgid="5704679763124170100">"Monitoraggio della posizione fisica dell\'utente."</string>
     <string name="permgrouplab_network" msgid="5808983377727109831">"Comunicazione di rete"</string>
     <string name="permgroupdesc_network" msgid="4478299413241861987">"Accesso a varie funzioni di rete."</string>
-    <!-- no translation found for permgrouplab_bluetoothNetwork (1585403544162128109) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_bluetoothNetwork (5625288577164282391) -->
-    <skip />
-    <!-- no translation found for permgrouplab_shortrangeNetwork (130808676377486118) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_shortrangeNetwork (1884069062653436007) -->
-    <skip />
+    <string name="permgrouplab_bluetoothNetwork" msgid="1585403544162128109">"Bluetooth"</string>
+    <string name="permgroupdesc_bluetoothNetwork" msgid="5625288577164282391">"È possibile accedere a dispositivi e reti tramite Bluetooth."</string>
+    <string name="permgrouplab_shortrangeNetwork" msgid="130808676377486118">"Reti a corto raggio"</string>
+    <string name="permgroupdesc_shortrangeNetwork" msgid="1884069062653436007">"È possibile accedere ai dispositivi tramite reti a corto raggio come le NFC."</string>
     <string name="permgrouplab_audioSettings" msgid="8329261670151871235">"Impostazioni audio"</string>
     <string name="permgroupdesc_audioSettings" msgid="2641515403347568130">"Modifica delle impostazioni audio."</string>
     <string name="permgrouplab_affectsBattery" msgid="6209246653424798033">"Influenza sulla batteria"</string>
     <string name="permgroupdesc_affectsBattery" msgid="6441275320638916947">"Uso di funzioni che possono consumare rapidamente la batteria."</string>
     <string name="permgrouplab_calendar" msgid="5863508437783683902">"Calendario"</string>
     <string name="permgroupdesc_calendar" msgid="5777534316982184416">"Accesso diretto al calendario e agli eventi."</string>
-    <!-- no translation found for permgrouplab_dictionary (4148597128843641379) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_dictionary (7921166355964764490) -->
-    <skip />
-    <!-- no translation found for permgrouplab_writeDictionary (8090237702432576788) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_writeDictionary (2711561994497361646) -->
-    <skip />
+    <string name="permgrouplab_dictionary" msgid="4148597128843641379">"Lettura del dizionario utente"</string>
+    <string name="permgroupdesc_dictionary" msgid="7921166355964764490">"È possibile leggere le parole nel dizionario utente."</string>
+    <string name="permgrouplab_writeDictionary" msgid="8090237702432576788">"Scrittura nel dizionario utente"</string>
+    <string name="permgroupdesc_writeDictionary" msgid="2711561994497361646">"È possibile aggiungere parole al dizionario utente."</string>
     <string name="permgrouplab_bookmarks" msgid="1949519673103968229">"Segnalibri e cronologia"</string>
     <string name="permgroupdesc_bookmarks" msgid="4169771606257963028">"Accesso diretto ai segnalibri e alla cronologia del browser."</string>
     <string name="permgrouplab_deviceAlarms" msgid="6117704629728824101">"Sveglia"</string>
@@ -569,8 +561,7 @@
     <string name="permdesc_sdcardRead" product="nosdcard" msgid="3530894470637667917">"Consente all\'applicazione di leggere i contenuti dell\'archivio USB, che possono includere foto e contenuti multimediali."</string>
     <string name="permdesc_sdcardRead" product="default" msgid="2555811422562526606">"Consente all\'applicazione di leggere i contenuti della scheda SD, che possono includere foto e contenuti multimediali."</string>
     <string name="permlab_sdcardWrite" product="nosdcard" msgid="8485979062254666748">"mod./elimin. cont. archivio USB"</string>
-    <!-- no translation found for permlab_sdcardWrite (8805693630050458763) -->
-    <skip />
+    <string name="permlab_sdcardWrite" product="default" msgid="8805693630050458763">"modifica o eliminazione dei contenuti della scheda SD"</string>
     <string name="permdesc_sdcardWrite" product="nosdcard" msgid="6175406299445710888">"Consente all\'applicazione di scrivere nell\'archivio USB."</string>
     <string name="permdesc_sdcardWrite" product="default" msgid="4337417790936632090">"Consente all\'applicazione di scrivere sulla scheda SD."</string>
     <string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"modifica/eliminaz. contenuti archivio media int."</string>
@@ -1090,8 +1081,7 @@
     <string name="date_time_set" msgid="5777075614321087758">"Imposta"</string>
     <string name="date_time_done" msgid="2507683751759308828">"Fine"</string>
     <string name="perms_new_perm_prefix" msgid="8257740710754301407"><font size="12" fgcolor="#ff900000">"NUOVA: "</font></string>
-    <!-- no translation found for perms_description_app (5139836143293299417) -->
-    <skip />
+    <string name="perms_description_app" msgid="5139836143293299417">"Fornito da <xliff:g id="APP_NAME">%1$s</xliff:g>."</string>
     <string name="no_permissions" msgid="7283357728219338112">"Nessuna autorizzazione richiesta"</string>
     <string name="usb_storage_activity_title" msgid="4465055157209648641">"Archivio di massa USB"</string>
     <string name="usb_storage_title" msgid="5901459041398751495">"USB collegata"</string>
@@ -1321,8 +1311,6 @@
     <string name="sending" msgid="3245653681008218030">"Invio..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Avviare l\'applicazione Browser?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Accettare la chiamata?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
-    <skip />
-    <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
-    <skip />
+    <string name="activity_resolver_use_always" msgid="8017770747801494933">"Sempre"</string>
+    <string name="activity_resolver_use_once" msgid="405646673463328329">"Solo una volta"</string>
 </resources>
diff --git a/core/res/res/values-iw/strings.xml b/core/res/res/values-iw/strings.xml
index 020686e..a111f5a 100644
--- a/core/res/res/values-iw/strings.xml
+++ b/core/res/res/values-iw/strings.xml
@@ -175,28 +175,20 @@
     <string name="permgroupdesc_location" msgid="5704679763124170100">"עקוב אחר המיקום הפיזי שלך."</string>
     <string name="permgrouplab_network" msgid="5808983377727109831">"תקשורת רשת"</string>
     <string name="permgroupdesc_network" msgid="4478299413241861987">"הרשאת גישה לתכונות רשת שונות."</string>
-    <!-- no translation found for permgrouplab_bluetoothNetwork (1585403544162128109) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_bluetoothNetwork (5625288577164282391) -->
-    <skip />
-    <!-- no translation found for permgrouplab_shortrangeNetwork (130808676377486118) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_shortrangeNetwork (1884069062653436007) -->
-    <skip />
+    <string name="permgrouplab_bluetoothNetwork" msgid="1585403544162128109">"Bluetooth"</string>
+    <string name="permgroupdesc_bluetoothNetwork" msgid="5625288577164282391">"גישה למכשירים ולרשתות באמצעות Bluetooth."</string>
+    <string name="permgrouplab_shortrangeNetwork" msgid="130808676377486118">"רשתות לטווח קצר"</string>
+    <string name="permgroupdesc_shortrangeNetwork" msgid="1884069062653436007">"גישה למכשירים באמצעות רשתות קצרות-טווח, כגון רשתות NFC."</string>
     <string name="permgrouplab_audioSettings" msgid="8329261670151871235">"הגדרות אודיו"</string>
     <string name="permgroupdesc_audioSettings" msgid="2641515403347568130">"שינוי הגדרות האודיו."</string>
     <string name="permgrouplab_affectsBattery" msgid="6209246653424798033">"השפעה על הסוללה"</string>
     <string name="permgroupdesc_affectsBattery" msgid="6441275320638916947">"שימוש בתכונות שיכולות לרוקן את הסוללה במהירות."</string>
     <string name="permgrouplab_calendar" msgid="5863508437783683902">"לוח שנה"</string>
     <string name="permgroupdesc_calendar" msgid="5777534316982184416">"גישה ישירה ללוח השנה ולאירועים."</string>
-    <!-- no translation found for permgrouplab_dictionary (4148597128843641379) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_dictionary (7921166355964764490) -->
-    <skip />
-    <!-- no translation found for permgrouplab_writeDictionary (8090237702432576788) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_writeDictionary (2711561994497361646) -->
-    <skip />
+    <string name="permgrouplab_dictionary" msgid="4148597128843641379">"קריאת מילון משתמש"</string>
+    <string name="permgroupdesc_dictionary" msgid="7921166355964764490">"קריאת מילים במילון משתמש."</string>
+    <string name="permgrouplab_writeDictionary" msgid="8090237702432576788">"כתיבת מילון משתמש"</string>
+    <string name="permgroupdesc_writeDictionary" msgid="2711561994497361646">"הוספת מילים למילון משתמש."</string>
     <string name="permgrouplab_bookmarks" msgid="1949519673103968229">"סימניות והיסטוריה"</string>
     <string name="permgroupdesc_bookmarks" msgid="4169771606257963028">"גישה ישירה אל סימניות והיסטוריית דפדפן."</string>
     <string name="permgrouplab_deviceAlarms" msgid="6117704629728824101">"שעון מעורר"</string>
@@ -569,8 +561,7 @@
     <string name="permdesc_sdcardRead" product="nosdcard" msgid="3530894470637667917">"הרשאה זו מאפשרת ליישום לקרוא את התוכן של אחסון USB, העשוי לכלול תמונות ומדיה."</string>
     <string name="permdesc_sdcardRead" product="default" msgid="2555811422562526606">"הרשאה זו מאפשרת ליישום לקרוא תוכן של כרטיס SD, העשוי לכלול תמונות ומדיה."</string>
     <string name="permlab_sdcardWrite" product="nosdcard" msgid="8485979062254666748">"שינוי או מחיקה של תוכן אחסון ה-USB שלך"</string>
-    <!-- no translation found for permlab_sdcardWrite (8805693630050458763) -->
-    <skip />
+    <string name="permlab_sdcardWrite" product="default" msgid="8805693630050458763">"שינוי או מחיקה של תוכן כרטיס ה-SD שלך"</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>
@@ -1090,8 +1081,7 @@
     <string name="date_time_set" msgid="5777075614321087758">"הגדר"</string>
     <string name="date_time_done" msgid="2507683751759308828">"בוצע"</string>
     <string name="perms_new_perm_prefix" msgid="8257740710754301407"><font size="12" fgcolor="#ff900000">"חדש: "</font></string>
-    <!-- no translation found for perms_description_app (5139836143293299417) -->
-    <skip />
+    <string name="perms_description_app" msgid="5139836143293299417">"מטעם <xliff:g id="APP_NAME">%1$s</xliff:g>."</string>
     <string name="no_permissions" msgid="7283357728219338112">"לא דרושים אישורים"</string>
     <string name="usb_storage_activity_title" msgid="4465055157209648641">"אמצעי מסוג USB לאחסון בנפח גדול"</string>
     <string name="usb_storage_title" msgid="5901459041398751495">"USB מחובר"</string>
@@ -1321,8 +1311,6 @@
     <string name="sending" msgid="3245653681008218030">"שולח…"</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"להפעיל את הדפדפן?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"האם לקבל את השיחה?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
-    <skip />
-    <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
-    <skip />
+    <string name="activity_resolver_use_always" msgid="8017770747801494933">"תמיד"</string>
+    <string name="activity_resolver_use_once" msgid="405646673463328329">"רק פעם אחת"</string>
 </resources>
diff --git a/core/res/res/values-ja/strings.xml b/core/res/res/values-ja/strings.xml
index b45d6cb..d05be0c 100644
--- a/core/res/res/values-ja/strings.xml
+++ b/core/res/res/values-ja/strings.xml
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"送信中..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"ブラウザを起動しますか?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"通話を受けますか?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-ko/strings.xml b/core/res/res/values-ko/strings.xml
index adafd25..964816e 100644
--- a/core/res/res/values-ko/strings.xml
+++ b/core/res/res/values-ko/strings.xml
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"전송 중..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"브라우저를 실행하시겠습니까?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"통화를 수락하시겠습니까?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-lt/strings.xml b/core/res/res/values-lt/strings.xml
index 1819172..f90907e 100644
--- a/core/res/res/values-lt/strings.xml
+++ b/core/res/res/values-lt/strings.xml
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Siunčiama…"</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Paleisti naršyklę?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Priimti skambutį?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-lv/strings.xml b/core/res/res/values-lv/strings.xml
index 8231db1..8d0ed36 100644
--- a/core/res/res/values-lv/strings.xml
+++ b/core/res/res/values-lv/strings.xml
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Notiek sūtīšana…"</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Vai palaist pārlūkprogrammu?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Vai atbildēt uz zvanu?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-ms/strings.xml b/core/res/res/values-ms/strings.xml
index 0bc4262..1b479a4 100644
--- a/core/res/res/values-ms/strings.xml
+++ b/core/res/res/values-ms/strings.xml
@@ -168,12 +168,9 @@
     <string name="permgrouplab_messages" msgid="7521249148445456662">"Mesej anda"</string>
     <string name="permgroupdesc_messages" msgid="7821999071003699236">"Membaca dan menulis SMS, e-mel, dan mesej lain."</string>
     <string name="permgrouplab_personalInfo" msgid="3519163141070533474">"Maklumat peribadi anda"</string>
-    <!-- no translation found for permgroupdesc_personalInfo (8426453129788861338) -->
-    <skip />
-    <!-- no translation found for permgrouplab_socialInfo (5799096623412043791) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_socialInfo (7129842457611643493) -->
-    <skip />
+    <string name="permgroupdesc_personalInfo" msgid="8426453129788861338">"Akses langsung ke maklumat tentang anda, yang disimpan pada kad kenalan anda."</string>
+    <string name="permgrouplab_socialInfo" msgid="5799096623412043791">"Maklumat sosial anda"</string>
+    <string name="permgroupdesc_socialInfo" msgid="7129842457611643493">"Akses langsung ke maklumat tentang kenalan anda dan sambungan sosial."</string>
     <string name="permgrouplab_location" msgid="635149742436692049">"Lokasi anda"</string>
     <string name="permgroupdesc_location" msgid="5704679763124170100">"Pantau lokasi fizikal anda."</string>
     <string name="permgrouplab_network" msgid="5808983377727109831">"Komunikasi rangkaian"</string>
@@ -186,18 +183,12 @@
     <skip />
     <!-- no translation found for permgroupdesc_shortrangeNetwork (1884069062653436007) -->
     <skip />
-    <!-- no translation found for permgrouplab_audioSettings (8329261670151871235) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_audioSettings (2641515403347568130) -->
-    <skip />
-    <!-- no translation found for permgrouplab_affectsBattery (6209246653424798033) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_affectsBattery (6441275320638916947) -->
-    <skip />
-    <!-- no translation found for permgrouplab_calendar (5863508437783683902) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_calendar (5777534316982184416) -->
-    <skip />
+    <string name="permgrouplab_audioSettings" msgid="8329261670151871235">"Tetapan Audio"</string>
+    <string name="permgroupdesc_audioSettings" msgid="2641515403347568130">"Tukar tetapan audio."</string>
+    <string name="permgrouplab_affectsBattery" msgid="6209246653424798033">"Menjejaskan Bateri"</string>
+    <string name="permgroupdesc_affectsBattery" msgid="6441275320638916947">"Gunakan ciri yang boleh menghabiskan bateri dengan cepat."</string>
+    <string name="permgrouplab_calendar" msgid="5863508437783683902">"Kalendar"</string>
+    <string name="permgroupdesc_calendar" msgid="5777534316982184416">"Akses langsung ke kalendar dan acara."</string>
     <!-- no translation found for permgrouplab_dictionary (4148597128843641379) -->
     <skip />
     <!-- no translation found for permgroupdesc_dictionary (7921166355964764490) -->
@@ -206,46 +197,26 @@
     <skip />
     <!-- no translation found for permgroupdesc_writeDictionary (2711561994497361646) -->
     <skip />
-    <!-- no translation found for permgrouplab_bookmarks (1949519673103968229) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_bookmarks (4169771606257963028) -->
-    <skip />
-    <!-- no translation found for permgrouplab_deviceAlarms (6117704629728824101) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_deviceAlarms (4769356362251641175) -->
-    <skip />
-    <!-- no translation found for permgrouplab_voicemail (4162237145027592133) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_voicemail (2498403969862951393) -->
-    <skip />
-    <!-- no translation found for permgrouplab_microphone (171539900250043464) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_microphone (7106618286905738408) -->
-    <skip />
-    <!-- no translation found for permgrouplab_camera (4820372495894586615) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_camera (2933667372289567714) -->
-    <skip />
-    <!-- no translation found for permgrouplab_appInfo (8028789762634147725) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_appInfo (3950378538049625907) -->
-    <skip />
-    <!-- no translation found for permgrouplab_wallpaper (3850280158041175998) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_wallpaper (5630417854750540154) -->
-    <skip />
-    <!-- no translation found for permgrouplab_systemClock (406535759236612992) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_systemClock (3944359833624094992) -->
-    <skip />
-    <!-- no translation found for permgrouplab_statusBar (2095862568113945398) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_statusBar (6242593432226807171) -->
-    <skip />
-    <!-- no translation found for permgrouplab_syncSettings (3341990986147826541) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_syncSettings (7603195265129031797) -->
-    <skip />
+    <string name="permgrouplab_bookmarks" msgid="1949519673103968229">"Penanda halaman dan Sejarah"</string>
+    <string name="permgroupdesc_bookmarks" msgid="4169771606257963028">"Akses langsung ke penanda halaman dan sejarah penyemak imbas."</string>
+    <string name="permgrouplab_deviceAlarms" msgid="6117704629728824101">"Penggera"</string>
+    <string name="permgroupdesc_deviceAlarms" msgid="4769356362251641175">"Tetapkan jam penggera."</string>
+    <string name="permgrouplab_voicemail" msgid="4162237145027592133">"Mel suara"</string>
+    <string name="permgroupdesc_voicemail" msgid="2498403969862951393">"Akses langsung ke mel suara."</string>
+    <string name="permgrouplab_microphone" msgid="171539900250043464">"Mikrofon"</string>
+    <string name="permgroupdesc_microphone" msgid="7106618286905738408">"Akses langsung ke mikrofon untuk merakam audio."</string>
+    <string name="permgrouplab_camera" msgid="4820372495894586615">"Kamera"</string>
+    <string name="permgroupdesc_camera" msgid="2933667372289567714">"Akses langsung ke kamera untuk merakam imej atau video."</string>
+    <string name="permgrouplab_appInfo" msgid="8028789762634147725">"Maklumat aplikasi anda"</string>
+    <string name="permgroupdesc_appInfo" msgid="3950378538049625907">"Keupayaan untuk mempengaruhi tingkah laku aplikasi lain pada peranti anda."</string>
+    <string name="permgrouplab_wallpaper" msgid="3850280158041175998">"Kertas dinding"</string>
+    <string name="permgroupdesc_wallpaper" msgid="5630417854750540154">"Tukar tetapan kertas dinding peranti."</string>
+    <string name="permgrouplab_systemClock" msgid="406535759236612992">"Jam"</string>
+    <string name="permgroupdesc_systemClock" msgid="3944359833624094992">"Tukar masa peranti atau zon masa."</string>
+    <string name="permgrouplab_statusBar" msgid="2095862568113945398">"Bar Status"</string>
+    <string name="permgroupdesc_statusBar" msgid="6242593432226807171">"Tukar tetapan bar status peranti."</string>
+    <string name="permgrouplab_syncSettings" msgid="3341990986147826541">"Tetapan Penyegerakan"</string>
+    <string name="permgroupdesc_syncSettings" msgid="7603195265129031797">"Akses ke tetapan segerakan."</string>
     <string name="permgrouplab_accounts" msgid="3359646291125325519">"Akaun anda"</string>
     <string name="permgroupdesc_accounts" msgid="4948732641827091312">"Akses akaun yang tersedia."</string>
     <string name="permgrouplab_hardwareControls" msgid="7998214968791599326">"Kawalan perkakasan"</string>
@@ -256,10 +227,8 @@
     <string name="permgroupdesc_systemTools" msgid="8162102602190734305">"Akses dan kawalan peringkat lebih rendah bagi sistem."</string>
     <string name="permgrouplab_developmentTools" msgid="3446164584710596513">"Alatan pembangunan"</string>
     <string name="permgroupdesc_developmentTools" msgid="7058828032358142018">"Ciri hanya diperlukan untuk pembangun apl."</string>
-    <!-- no translation found for permgrouplab_display (4279909676036402636) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_display (6051002031933013714) -->
-    <skip />
+    <string name="permgrouplab_display" msgid="4279909676036402636">"Aplikasi UI Lain"</string>
+    <string name="permgroupdesc_display" msgid="6051002031933013714">"Mempengaruhi UI aplikasi lain."</string>
     <string name="permgrouplab_storage" msgid="1971118770546336966">"Storan"</string>
     <string name="permgroupdesc_storage" product="nosdcard" msgid="7442318502446874999">"Akses storan USB."</string>
     <string name="permgroupdesc_storage" product="default" msgid="9203302214915355774">"Akses kad SD."</string>
@@ -779,8 +748,7 @@
     <string name="lockscreen_missing_sim_message" product="default" msgid="2186920585695169078">"Kad SIM tiada dalam telefon."</string>
     <string name="lockscreen_missing_sim_instructions" msgid="5372787138023272615">"Masukkan kad SIM."</string>
     <string name="lockscreen_missing_sim_instructions_long" msgid="3526573099019319472">"Kad SIM tiada atau tidak boleh dibaca. Sila masukkan kad SIM."</string>
-    <!-- no translation found for lockscreen_permanent_disabled_sim_message_short (5096149665138916184) -->
-    <skip />
+    <string name="lockscreen_permanent_disabled_sim_message_short" msgid="5096149665138916184">"Kad SIM tidak boleh digunakan."</string>
     <string name="lockscreen_permanent_disabled_sim_instructions" msgid="910904643433151371">"Kad SIM anda telah dilumpuhkan secara kekal."\n" Hubungi pembekal perkhidmatan wayarles anda untuk mendapatkan kad SIM lain."</string>
     <string name="lockscreen_transport_prev_description" msgid="201594905152746886">"Butang lagu sebelumnya"</string>
     <string name="lockscreen_transport_next_description" msgid="6089297650481292363">"Butang lagu seterusnya"</string>
@@ -1353,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Menghantar…"</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Lancarkan Penyemak Imbas?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Terima panggilan?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-nb/strings.xml b/core/res/res/values-nb/strings.xml
index 3427829..88db9f4 100644
--- a/core/res/res/values-nb/strings.xml
+++ b/core/res/res/values-nb/strings.xml
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Sender …"</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Vil du starte nettleseren?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Vil du besvare anropet?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-nl/strings.xml b/core/res/res/values-nl/strings.xml
index ef85ec4..dfd67ff 100644
--- a/core/res/res/values-nl/strings.xml
+++ b/core/res/res/values-nl/strings.xml
@@ -175,28 +175,20 @@
     <string name="permgroupdesc_location" msgid="5704679763124170100">"Uw fysieke locatie bijhouden."</string>
     <string name="permgrouplab_network" msgid="5808983377727109831">"Netwerkcommunicatie"</string>
     <string name="permgroupdesc_network" msgid="4478299413241861987">"Toegang tot verschillende netwerkfuncties."</string>
-    <!-- no translation found for permgrouplab_bluetoothNetwork (1585403544162128109) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_bluetoothNetwork (5625288577164282391) -->
-    <skip />
-    <!-- no translation found for permgrouplab_shortrangeNetwork (130808676377486118) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_shortrangeNetwork (1884069062653436007) -->
-    <skip />
+    <string name="permgrouplab_bluetoothNetwork" msgid="1585403544162128109">"Bluetooth"</string>
+    <string name="permgroupdesc_bluetoothNetwork" msgid="5625288577164282391">"Toegang tot apparaten en netwerken via Bluetooth."</string>
+    <string name="permgrouplab_shortrangeNetwork" msgid="130808676377486118">"Netwerken op korte afstand"</string>
+    <string name="permgroupdesc_shortrangeNetwork" msgid="1884069062653436007">"Toegang tot apparaten via netwerken op korte afstand zoals NFC."</string>
     <string name="permgrouplab_audioSettings" msgid="8329261670151871235">"Audio-instellingen"</string>
     <string name="permgroupdesc_audioSettings" msgid="2641515403347568130">"Audio-instellingen wijzigen."</string>
     <string name="permgrouplab_affectsBattery" msgid="6209246653424798033">"De accu beïnvloeden"</string>
     <string name="permgroupdesc_affectsBattery" msgid="6441275320638916947">"Functies gebruiken waardoor de accu snel leeg kan raken."</string>
     <string name="permgrouplab_calendar" msgid="5863508437783683902">"Agenda"</string>
     <string name="permgroupdesc_calendar" msgid="5777534316982184416">"Rechtstreeks toegang krijgen tot agenda en afspraken."</string>
-    <!-- no translation found for permgrouplab_dictionary (4148597128843641379) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_dictionary (7921166355964764490) -->
-    <skip />
-    <!-- no translation found for permgrouplab_writeDictionary (8090237702432576788) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_writeDictionary (2711561994497361646) -->
-    <skip />
+    <string name="permgrouplab_dictionary" msgid="4148597128843641379">"Gebruikerswoordenboek lezen"</string>
+    <string name="permgroupdesc_dictionary" msgid="7921166355964764490">"Woorden lezen in het gebruikerswoordenboek."</string>
+    <string name="permgrouplab_writeDictionary" msgid="8090237702432576788">"Gebruikerswoordenboek schrijven"</string>
+    <string name="permgroupdesc_writeDictionary" msgid="2711561994497361646">"Woorden toevoegen aan het gebruikerswoordenboek."</string>
     <string name="permgrouplab_bookmarks" msgid="1949519673103968229">"Bladwijzers en geschiedenis"</string>
     <string name="permgroupdesc_bookmarks" msgid="4169771606257963028">"Rechtstreeks toegang krijgen tot bladwijzers en browsergeschiedenis."</string>
     <string name="permgrouplab_deviceAlarms" msgid="6117704629728824101">"Alarm"</string>
@@ -569,8 +561,7 @@
     <string name="permdesc_sdcardRead" product="nosdcard" msgid="3530894470637667917">"Toestaan dat de app inhoud in de USB-opslag, waaronder foto\'s en media, leest."</string>
     <string name="permdesc_sdcardRead" product="default" msgid="2555811422562526606">"Toestaan dat de app inhoud op de SD-kaart, waaronder foto\'s en media, leest."</string>
     <string name="permlab_sdcardWrite" product="nosdcard" msgid="8485979062254666748">"de inhoud van uw USB-opslag aanpassen of verwijderen"</string>
-    <!-- no translation found for permlab_sdcardWrite (8805693630050458763) -->
-    <skip />
+    <string name="permlab_sdcardWrite" product="default" msgid="8805693630050458763">"de inhoud van uw SD-kaart aanpassen of verwijderen"</string>
     <string name="permdesc_sdcardWrite" product="nosdcard" msgid="6175406299445710888">"Hiermee kan de app schrijven naar de USB-opslag."</string>
     <string name="permdesc_sdcardWrite" product="default" msgid="4337417790936632090">"Hiermee kan de app schrijven naar de SD-kaart."</string>
     <string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"inh. mediaopsl. wijz./verw."</string>
@@ -1090,8 +1081,7 @@
     <string name="date_time_set" msgid="5777075614321087758">"Instellen"</string>
     <string name="date_time_done" msgid="2507683751759308828">"Gereed"</string>
     <string name="perms_new_perm_prefix" msgid="8257740710754301407"><font size="12" fgcolor="#ff900000">"NIEUW: "</font></string>
-    <!-- no translation found for perms_description_app (5139836143293299417) -->
-    <skip />
+    <string name="perms_description_app" msgid="5139836143293299417">"Geleverd door <xliff:g id="APP_NAME">%1$s</xliff:g>."</string>
     <string name="no_permissions" msgid="7283357728219338112">"Geen machtigingen vereist"</string>
     <string name="usb_storage_activity_title" msgid="4465055157209648641">"USB-massaopslag"</string>
     <string name="usb_storage_title" msgid="5901459041398751495">"USB-verbinding"</string>
@@ -1321,8 +1311,6 @@
     <string name="sending" msgid="3245653681008218030">"Verzenden..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Browser starten?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Oproep accepteren?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
-    <skip />
-    <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
-    <skip />
+    <string name="activity_resolver_use_always" msgid="8017770747801494933">"Altijd"</string>
+    <string name="activity_resolver_use_once" msgid="405646673463328329">"Alleen nu gebruiken"</string>
 </resources>
diff --git a/core/res/res/values-pl/strings.xml b/core/res/res/values-pl/strings.xml
index 022b8c5..62c839b1 100644
--- a/core/res/res/values-pl/strings.xml
+++ b/core/res/res/values-pl/strings.xml
@@ -168,12 +168,9 @@
     <string name="permgrouplab_messages" msgid="7521249148445456662">"Twoje wiadomości"</string>
     <string name="permgroupdesc_messages" msgid="7821999071003699236">"Czytanie i zapisywanie wiadomości SMS, e-mail i innych"</string>
     <string name="permgrouplab_personalInfo" msgid="3519163141070533474">"Informacje osobiste"</string>
-    <!-- no translation found for permgroupdesc_personalInfo (8426453129788861338) -->
-    <skip />
-    <!-- no translation found for permgrouplab_socialInfo (5799096623412043791) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_socialInfo (7129842457611643493) -->
-    <skip />
+    <string name="permgroupdesc_personalInfo" msgid="8426453129788861338">"Bezpośredni dostęp do informacji o Tobie zapisanych na wizytówce."</string>
+    <string name="permgrouplab_socialInfo" msgid="5799096623412043791">"Twoje informacje społecznościowe"</string>
+    <string name="permgroupdesc_socialInfo" msgid="7129842457611643493">"Bezpośredni dostęp do informacji o Twoich kontaktach i powiązaniach społecznościowych."</string>
     <string name="permgrouplab_location" msgid="635149742436692049">"Twoja lokalizacja"</string>
     <string name="permgroupdesc_location" msgid="5704679763124170100">"Monitorowanie fizycznej lokalizacji"</string>
     <string name="permgrouplab_network" msgid="5808983377727109831">"Połączenia sieciowe"</string>
@@ -186,18 +183,12 @@
     <skip />
     <!-- no translation found for permgroupdesc_shortrangeNetwork (1884069062653436007) -->
     <skip />
-    <!-- no translation found for permgrouplab_audioSettings (8329261670151871235) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_audioSettings (2641515403347568130) -->
-    <skip />
-    <!-- no translation found for permgrouplab_affectsBattery (6209246653424798033) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_affectsBattery (6441275320638916947) -->
-    <skip />
-    <!-- no translation found for permgrouplab_calendar (5863508437783683902) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_calendar (5777534316982184416) -->
-    <skip />
+    <string name="permgrouplab_audioSettings" msgid="8329261670151871235">"Ustawienia dźwięku"</string>
+    <string name="permgroupdesc_audioSettings" msgid="2641515403347568130">"Zmiana ustawień dźwięku."</string>
+    <string name="permgrouplab_affectsBattery" msgid="6209246653424798033">"Użycie baterii"</string>
+    <string name="permgroupdesc_affectsBattery" msgid="6441275320638916947">"Korzystanie z funkcji, które mogą szybko rozładować baterię."</string>
+    <string name="permgrouplab_calendar" msgid="5863508437783683902">"Kalendarz"</string>
+    <string name="permgroupdesc_calendar" msgid="5777534316982184416">"Bezpośredni dostęp do kalendarza i wydarzeń."</string>
     <!-- no translation found for permgrouplab_dictionary (4148597128843641379) -->
     <skip />
     <!-- no translation found for permgroupdesc_dictionary (7921166355964764490) -->
@@ -206,46 +197,26 @@
     <skip />
     <!-- no translation found for permgroupdesc_writeDictionary (2711561994497361646) -->
     <skip />
-    <!-- no translation found for permgrouplab_bookmarks (1949519673103968229) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_bookmarks (4169771606257963028) -->
-    <skip />
-    <!-- no translation found for permgrouplab_deviceAlarms (6117704629728824101) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_deviceAlarms (4769356362251641175) -->
-    <skip />
-    <!-- no translation found for permgrouplab_voicemail (4162237145027592133) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_voicemail (2498403969862951393) -->
-    <skip />
-    <!-- no translation found for permgrouplab_microphone (171539900250043464) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_microphone (7106618286905738408) -->
-    <skip />
-    <!-- no translation found for permgrouplab_camera (4820372495894586615) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_camera (2933667372289567714) -->
-    <skip />
-    <!-- no translation found for permgrouplab_appInfo (8028789762634147725) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_appInfo (3950378538049625907) -->
-    <skip />
-    <!-- no translation found for permgrouplab_wallpaper (3850280158041175998) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_wallpaper (5630417854750540154) -->
-    <skip />
-    <!-- no translation found for permgrouplab_systemClock (406535759236612992) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_systemClock (3944359833624094992) -->
-    <skip />
-    <!-- no translation found for permgrouplab_statusBar (2095862568113945398) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_statusBar (6242593432226807171) -->
-    <skip />
-    <!-- no translation found for permgrouplab_syncSettings (3341990986147826541) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_syncSettings (7603195265129031797) -->
-    <skip />
+    <string name="permgrouplab_bookmarks" msgid="1949519673103968229">"Zakładki i historia"</string>
+    <string name="permgroupdesc_bookmarks" msgid="4169771606257963028">"Bezpośredni dostęp do zakładek i historii przeglądarki."</string>
+    <string name="permgrouplab_deviceAlarms" msgid="6117704629728824101">"Alarm"</string>
+    <string name="permgroupdesc_deviceAlarms" msgid="4769356362251641175">"Ustawianie budzika."</string>
+    <string name="permgrouplab_voicemail" msgid="4162237145027592133">"Poczta głosowa"</string>
+    <string name="permgroupdesc_voicemail" msgid="2498403969862951393">"Bezpośredni dostęp do poczty głosowej."</string>
+    <string name="permgrouplab_microphone" msgid="171539900250043464">"Mikrofon"</string>
+    <string name="permgroupdesc_microphone" msgid="7106618286905738408">"Bezpośredni dostęp do mikrofonu i nagrywanie dźwięku."</string>
+    <string name="permgrouplab_camera" msgid="4820372495894586615">"Aparat"</string>
+    <string name="permgroupdesc_camera" msgid="2933667372289567714">"Bezpośredni dostęp do aparatu – robienie zdjęć i nagrywanie filmów."</string>
+    <string name="permgrouplab_appInfo" msgid="8028789762634147725">"Informacje o aplikacjach"</string>
+    <string name="permgroupdesc_appInfo" msgid="3950378538049625907">"Możliwość zmiany działania innych aplikacji na urządzeniu."</string>
+    <string name="permgrouplab_wallpaper" msgid="3850280158041175998">"Tapeta"</string>
+    <string name="permgroupdesc_wallpaper" msgid="5630417854750540154">"Zmiana ustawień tapety urządzenia."</string>
+    <string name="permgrouplab_systemClock" msgid="406535759236612992">"Zegar"</string>
+    <string name="permgroupdesc_systemClock" msgid="3944359833624094992">"Zmiana czasu i strefy czasowej na urządzeniu."</string>
+    <string name="permgrouplab_statusBar" msgid="2095862568113945398">"Pasek stanu"</string>
+    <string name="permgroupdesc_statusBar" msgid="6242593432226807171">"Zmiana ustawień paska stanu urządzenia."</string>
+    <string name="permgrouplab_syncSettings" msgid="3341990986147826541">"Ustawienia synchronizacji"</string>
+    <string name="permgroupdesc_syncSettings" msgid="7603195265129031797">"Dostęp do ustawień synchronizacji."</string>
     <string name="permgrouplab_accounts" msgid="3359646291125325519">"Twoje konta"</string>
     <string name="permgroupdesc_accounts" msgid="4948732641827091312">"Dostęp do udostępnionych kont."</string>
     <string name="permgrouplab_hardwareControls" msgid="7998214968791599326">"Sterowanie sprzętowe"</string>
@@ -256,10 +227,8 @@
     <string name="permgroupdesc_systemTools" msgid="8162102602190734305">"Dostęp i kontrola systemu niższego poziomu."</string>
     <string name="permgrouplab_developmentTools" msgid="3446164584710596513">"Narzędzia programistyczne"</string>
     <string name="permgroupdesc_developmentTools" msgid="7058828032358142018">"Funkcje potrzebne jedynie programistom."</string>
-    <!-- no translation found for permgrouplab_display (4279909676036402636) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_display (6051002031933013714) -->
-    <skip />
+    <string name="permgrouplab_display" msgid="4279909676036402636">"Interfejsy innych aplikacji"</string>
+    <string name="permgroupdesc_display" msgid="6051002031933013714">"Możliwość wpływania na interfejsy innych aplikacji."</string>
     <string name="permgrouplab_storage" msgid="1971118770546336966">"Pamięć"</string>
     <string name="permgroupdesc_storage" product="nosdcard" msgid="7442318502446874999">"Dostęp do nośnika USB."</string>
     <string name="permgroupdesc_storage" product="default" msgid="9203302214915355774">"Dostęp do karty SD."</string>
@@ -779,8 +748,7 @@
     <string name="lockscreen_missing_sim_message" product="default" msgid="2186920585695169078">"Brak karty SIM w telefonie."</string>
     <string name="lockscreen_missing_sim_instructions" msgid="5372787138023272615">"Włóż kartę SIM."</string>
     <string name="lockscreen_missing_sim_instructions_long" msgid="3526573099019319472">"Brak karty SIM lub nie można jej odczytać. Włóż kartę SIM."</string>
-    <!-- no translation found for lockscreen_permanent_disabled_sim_message_short (5096149665138916184) -->
-    <skip />
+    <string name="lockscreen_permanent_disabled_sim_message_short" msgid="5096149665138916184">"Karta SIM bezużyteczna."</string>
     <string name="lockscreen_permanent_disabled_sim_instructions" msgid="910904643433151371">"Karta SIM jest trwale wyłączona."\n" Skontaktuj się z dostawcą usług bezprzewodowych, aby uzyskać inną kartę SIM."</string>
     <string name="lockscreen_transport_prev_description" msgid="201594905152746886">"Przycisk poprzedniego utworu"</string>
     <string name="lockscreen_transport_next_description" msgid="6089297650481292363">"Przycisk następnego utworu"</string>
@@ -1353,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Wysyłanie..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Uruchomić przeglądarkę?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Odebrać połączenie?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-pt-rPT/strings.xml b/core/res/res/values-pt-rPT/strings.xml
index e785c7c..1825346 100644
--- a/core/res/res/values-pt-rPT/strings.xml
+++ b/core/res/res/values-pt-rPT/strings.xml
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"A enviar..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Iniciar Navegador?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Aceitar chamada?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-pt/strings.xml b/core/res/res/values-pt/strings.xml
index c7b6746..2e00b29 100644
--- a/core/res/res/values-pt/strings.xml
+++ b/core/res/res/values-pt/strings.xml
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Enviando..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Abrir Navegador?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Aceitar chamada?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-rm/strings.xml b/core/res/res/values-rm/strings.xml
index 3ca7f9c..e22bb14 100644
--- a/core/res/res/values-rm/strings.xml
+++ b/core/res/res/values-rm/strings.xml
@@ -2069,7 +2069,7 @@
     <skip />
     <!-- no translation found for SetupCallDefault (5834948469253758575) -->
     <skip />
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-ro/strings.xml b/core/res/res/values-ro/strings.xml
index 963b676..61428cd 100644
--- a/core/res/res/values-ro/strings.xml
+++ b/core/res/res/values-ro/strings.xml
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Se trimite..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Lansaţi browserul?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Acceptaţi apelul?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-ru/strings.xml b/core/res/res/values-ru/strings.xml
index 04163ee..1fcd393 100644
--- a/core/res/res/values-ru/strings.xml
+++ b/core/res/res/values-ru/strings.xml
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Отправка..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Запустить браузер?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Ответить?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-sk/strings.xml b/core/res/res/values-sk/strings.xml
index fff419d..db562c7 100644
--- a/core/res/res/values-sk/strings.xml
+++ b/core/res/res/values-sk/strings.xml
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Odosielanie..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Spustiť prehliadač?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Prijať hovor?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-sl/strings.xml b/core/res/res/values-sl/strings.xml
index df0ddea..570bb59 100644
--- a/core/res/res/values-sl/strings.xml
+++ b/core/res/res/values-sl/strings.xml
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Pošiljanje ..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Ali želite odpreti brskalnik?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Ali želite sprejeti klic?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-sr/strings.xml b/core/res/res/values-sr/strings.xml
index 5573607..11a733d 100644
--- a/core/res/res/values-sr/strings.xml
+++ b/core/res/res/values-sr/strings.xml
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Слање..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Желите ли да покренете прегледач?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Желите ли да прихватите позив?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-sv/strings.xml b/core/res/res/values-sv/strings.xml
index 5bce25a..251d487 100644
--- a/core/res/res/values-sv/strings.xml
+++ b/core/res/res/values-sv/strings.xml
@@ -1321,8 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Skickar ..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Vill du öppna webbläsaren?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Vill du ta emot samtal?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
-    <skip />
+    <string name="activity_resolver_use_always" msgid="8017770747801494933">"Alltid"</string>
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
 </resources>
diff --git a/core/res/res/values-sw/strings.xml b/core/res/res/values-sw/strings.xml
index 05732dc..1904de4 100644
--- a/core/res/res/values-sw/strings.xml
+++ b/core/res/res/values-sw/strings.xml
@@ -175,28 +175,20 @@
     <string name="permgroupdesc_location" msgid="5704679763124170100">"Fuatilia eneo lako halisi."</string>
     <string name="permgrouplab_network" msgid="5808983377727109831">"Mawasiliano ya mtandao"</string>
     <string name="permgroupdesc_network" msgid="4478299413241861987">"Fikia vipengele mbalimbali vya mtandao."</string>
-    <!-- no translation found for permgrouplab_bluetoothNetwork (1585403544162128109) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_bluetoothNetwork (5625288577164282391) -->
-    <skip />
-    <!-- no translation found for permgrouplab_shortrangeNetwork (130808676377486118) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_shortrangeNetwork (1884069062653436007) -->
-    <skip />
+    <string name="permgrouplab_bluetoothNetwork" msgid="1585403544162128109">"Bluetooth"</string>
+    <string name="permgroupdesc_bluetoothNetwork" msgid="5625288577164282391">"Fikia vifaa na mitandao kupitia Bluetooth."</string>
+    <string name="permgrouplab_shortrangeNetwork" msgid="130808676377486118">"Mitandao ya Masafa mafupi"</string>
+    <string name="permgroupdesc_shortrangeNetwork" msgid="1884069062653436007">"Fikia vifaa kupitia mitandao ya masafa mafupi kama vile NFC."</string>
     <string name="permgrouplab_audioSettings" msgid="8329261670151871235">"Mipangilio ya Sauti"</string>
     <string name="permgroupdesc_audioSettings" msgid="2641515403347568130">"Badilisha mipangilio ya sauti."</string>
     <string name="permgrouplab_affectsBattery" msgid="6209246653424798033">"Huathiri Betri"</string>
     <string name="permgroupdesc_affectsBattery" msgid="6441275320638916947">"Tumia vipengele vinaweza kumaliza betri haraka."</string>
     <string name="permgrouplab_calendar" msgid="5863508437783683902">"Kalenda"</string>
     <string name="permgroupdesc_calendar" msgid="5777534316982184416">"Kufikia moja kwa moja kalenda na matukio."</string>
-    <!-- no translation found for permgrouplab_dictionary (4148597128843641379) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_dictionary (7921166355964764490) -->
-    <skip />
-    <!-- no translation found for permgrouplab_writeDictionary (8090237702432576788) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_writeDictionary (2711561994497361646) -->
-    <skip />
+    <string name="permgrouplab_dictionary" msgid="4148597128843641379">"Soma Kamuzi ya Mtumiaji"</string>
+    <string name="permgroupdesc_dictionary" msgid="7921166355964764490">"Soma maneno katika kamusi ya mtumiaji."</string>
+    <string name="permgrouplab_writeDictionary" msgid="8090237702432576788">"Andika Kamusi ya Mtumiaji"</string>
+    <string name="permgroupdesc_writeDictionary" msgid="2711561994497361646">"Ongeza maneno katika kamusi mtumiaji."</string>
     <string name="permgrouplab_bookmarks" msgid="1949519673103968229">"Vialamisho na Historia"</string>
     <string name="permgroupdesc_bookmarks" msgid="4169771606257963028">"Kufikia moja kwa moja vialamisho na historia ya kivinjari"</string>
     <string name="permgrouplab_deviceAlarms" msgid="6117704629728824101">"Kengele"</string>
@@ -569,8 +561,7 @@
     <string name="permdesc_sdcardRead" product="nosdcard" msgid="3530894470637667917">"Huruhusu programu kusoma maudhui ya hifadhi ya USB, ambayo huenda ikajumuisha picha na midia."</string>
     <string name="permdesc_sdcardRead" product="default" msgid="2555811422562526606">"Huruhusu programu kusoma maudhui ya kadi ya SD, ambayo huenda yakajumuisha picha na midia."</string>
     <string name="permlab_sdcardWrite" product="nosdcard" msgid="8485979062254666748">"rekebisha au ufute maudhui ya hifadhi yako ya USB"</string>
-    <!-- no translation found for permlab_sdcardWrite (8805693630050458763) -->
-    <skip />
+    <string name="permlab_sdcardWrite" product="default" msgid="8805693630050458763">"rekebisha au ufute maudhui ya kadi yako ya SD"</string>
     <string name="permdesc_sdcardWrite" product="nosdcard" msgid="6175406299445710888">"Inaruhusu programu kuandikia hifadhi ya USB."</string>
     <string name="permdesc_sdcardWrite" product="default" msgid="4337417790936632090">"Inaruhusu programu kuandikia kadi ya SD."</string>
     <string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"badilisha/futa maudhui ya hifadhi ya media ya ndani."</string>
@@ -1090,8 +1081,7 @@
     <string name="date_time_set" msgid="5777075614321087758">"Weka"</string>
     <string name="date_time_done" msgid="2507683751759308828">"Imekamilika"</string>
     <string name="perms_new_perm_prefix" msgid="8257740710754301407"><font size="12" fgcolor="#ff900000">" MPYA: "</font></string>
-    <!-- no translation found for perms_description_app (5139836143293299417) -->
-    <skip />
+    <string name="perms_description_app" msgid="5139836143293299417">"Zinatolewa na <xliff:g id="APP_NAME">%1$s</xliff:g>."</string>
     <string name="no_permissions" msgid="7283357728219338112">"Hakuna vibali vinavyohitajika"</string>
     <string name="usb_storage_activity_title" msgid="4465055157209648641">"Hifadhi kubwa ya USB"</string>
     <string name="usb_storage_title" msgid="5901459041398751495">"USB imeunganishwa"</string>
@@ -1321,8 +1311,6 @@
     <string name="sending" msgid="3245653681008218030">"Inatuma…"</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Zindua Kivinjari?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Kubali simu?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
-    <skip />
-    <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
-    <skip />
+    <string name="activity_resolver_use_always" msgid="8017770747801494933">"Kila mara"</string>
+    <string name="activity_resolver_use_once" msgid="405646673463328329">"Mara Moja tu"</string>
 </resources>
diff --git a/core/res/res/values-sw600dp-w1024dp/dimens.xml b/core/res/res/values-sw600dp-w1024dp/dimens.xml
deleted file mode 100644
index 4d6a4da..0000000
--- a/core/res/res/values-sw600dp-w1024dp/dimens.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?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>
-    <!-- Increase size (used to be 0 for dual pane -->
-    <!-- Preference activity side margins -->
-    <dimen name="preference_screen_side_margin">48dp</dimen>
-    <!-- Preference activity side margins negative-->
-    <dimen name="preference_screen_side_margin_negative">-52dp</dimen>
-</resources>
diff --git a/tools/localize/testdata/res/values-zz-rZZ/strings.xml b/core/res/res/values-sw600dp-w960dp/dimens.xml
similarity index 71%
rename from tools/localize/testdata/res/values-zz-rZZ/strings.xml
rename to core/res/res/values-sw600dp-w960dp/dimens.xml
index c2a783d..724904e 100644
--- a/tools/localize/testdata/res/values-zz-rZZ/strings.xml
+++ b/core/res/res/values-sw600dp-w960dp/dimens.xml
@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2007 The Android Open Source Project
+<!-- 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.
@@ -14,9 +14,8 @@
      limitations under the License.
 -->
 
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="changed_in_xx">AAAA</string>
-    <string name="previously_translated">CCC</string>
+<resources>
+    <dimen name="preference_screen_header_padding_side">48dp</dimen>
+    <!-- Preference fragment padding, sides -->
+    <dimen name="preference_fragment_padding_side">48dp</dimen>
 </resources>
-
-
diff --git a/core/res/res/values-sw600dp/bools.xml b/core/res/res/values-sw600dp/bools.xml
index 92b6171..b8db31f 100644
--- a/core/res/res/values-sw600dp/bools.xml
+++ b/core/res/res/values-sw600dp/bools.xml
@@ -15,6 +15,5 @@
 -->
 
 <resources>
-    <bool name="preferences_prefer_dual_pane">true</bool>
     <bool name="target_honeycomb_needs_options_menu">false</bool>
 </resources>
diff --git a/core/res/res/values-sw600dp/dimens.xml b/core/res/res/values-sw600dp/dimens.xml
index f8f865e..c5727ea 100644
--- a/core/res/res/values-sw600dp/dimens.xml
+++ b/core/res/res/values-sw600dp/dimens.xml
@@ -18,6 +18,10 @@
 */
 -->
 <resources>
+    <!-- The width that is used when creating thumbnails of applications. -->
+    <dimen name="thumbnail_width">200dp</dimen>
+    <!-- The height that is used when creating thumbnails of applications. -->
+    <dimen name="thumbnail_height">177dp</dimen>
     <!-- The maximum number of action buttons that should be permitted within
          an action bar/action mode. This will be used to determine how many
          showAsAction="ifRoom" items can fit. "always" items can override this. -->
@@ -47,12 +51,6 @@
     <!-- Size of status line font in LockScreen. -->
     <dimen name="keyguard_pattern_unlock_status_line_font_size">14sp</dimen>
 
-    <!-- Preference activity, vertical padding for the header list -->
-    <dimen name="preference_screen_header_vertical_padding">32dp</dimen>
-    <dimen name="preference_screen_side_margin">0dp</dimen>
-    <!-- Compensate for double margin : preference_screen_side_margin + 4 (frame background shadow) = -preference_screen_side_margin_negative -->
-    <dimen name="preference_screen_side_margin_negative">-4dp</dimen>
-
     <!-- Default padding to apply to AppWidgetHostViews containing widgets targeting API level 14 and up. -->
     <dimen name="default_app_widget_padding_left">12dp</dimen>
     <dimen name="default_app_widget_padding_top">4dp</dimen>
@@ -78,5 +76,9 @@
     <!-- Height of the bottom navigation bar in portrait; on sw600dp devices
          this is a bit taller -->
     <dimen name="navigation_bar_height_portrait">56dp</dimen>
+
+    <!-- Preference fragment padding, sides -->
+    <dimen name="preference_fragment_padding_side">24dp</dimen>
+    <dimen name="preference_screen_header_padding_side">24dip</dimen>
 </resources>
 
diff --git a/core/res/res/values-sw600dp/styles.xml b/core/res/res/values-sw600dp/styles.xml
index f9e95b7..7dea9b8 100644
--- a/core/res/res/values-sw600dp/styles.xml
+++ b/core/res/res/values-sw600dp/styles.xml
@@ -25,12 +25,4 @@
         <item name="android:measureWithLargestChild">true</item>
         <item name="android:tabLayout">@android:layout/tab_indicator_holo</item>
     </style>
-
-    <style name="PreferencePanel">
-        <item name="android:layout_marginLeft">@dimen/preference_screen_side_margin</item>
-        <item name="android:layout_marginRight">@dimen/preference_screen_side_margin</item>
-        <item name="android:layout_marginTop">@dimen/preference_screen_top_margin</item>
-        <item name="android:layout_marginBottom">@dimen/preference_screen_bottom_margin</item>
-        <item name="android:background">?attr/detailsElementBackground</item>
-    </style>
 </resources>
diff --git a/core/res/res/values-sw600dp-w1280dp/dimens.xml b/core/res/res/values-sw720dp-w1280dp/dimens.xml
similarity index 100%
rename from core/res/res/values-sw600dp-w1280dp/dimens.xml
rename to core/res/res/values-sw720dp-w1280dp/dimens.xml
diff --git a/tools/localize/testdata/merge_xx_old.xml b/core/res/res/values-sw720dp/bools.xml
similarity index 72%
rename from tools/localize/testdata/merge_xx_old.xml
rename to core/res/res/values-sw720dp/bools.xml
index 9d3a7d8..7d5813f 100644
--- a/tools/localize/testdata/merge_xx_old.xml
+++ b/core/res/res/values-sw720dp/bools.xml
@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
      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.
@@ -14,8 +14,6 @@
      limitations under the License.
 -->
 
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="changed_in_xx">aaa</string>
-    <string name="previously_translated">CCC</string>
+<resources>
+    <bool name="preferences_prefer_dual_pane">true</bool>
 </resources>
-
diff --git a/core/res/res/values-sw720dp/dimens.xml b/core/res/res/values-sw720dp/dimens.xml
index 7b1bc4c5..34c7ea3 100644
--- a/core/res/res/values-sw720dp/dimens.xml
+++ b/core/res/res/values-sw720dp/dimens.xml
@@ -38,6 +38,32 @@
     <dimen name="thumbnail_width">230dp</dimen>
     <!-- The height that is used when creating thumbnails of applications. -->
     <dimen name="thumbnail_height">135dp</dimen>
+
+    <!-- Preference activity, vertical padding for the header list -->
+    <dimen name="preference_screen_header_vertical_padding">32dp</dimen>
+    <dimen name="preference_screen_side_margin">0dp</dimen>
+    <!-- Compensate for double margin : preference_screen_side_margin + 4 (frame background shadow) = -preference_screen_side_margin_negative -->
+    <dimen name="preference_screen_side_margin_negative">-4dp</dimen>
+
+    <!-- Preference fragment padding, bottom -->
+    <dimen name="preference_fragment_padding_bottom">16dp</dimen>
+    <dimen name="preference_screen_header_padding_side">0dip</dimen>
+    <integer name="preference_screen_header_scrollbarStyle">0x0</integer> <!-- insideOverlay -->
+
+    <!-- Preference fragment padding, sides -->
+    <dimen name="preference_fragment_padding_side">32dp</dimen>
+    <!-- Padding to the left of the preference panel breadcrumb -->
+    <dimen name="preference_breadcrumb_paddingLeft">32dp</dimen>
+    <!-- Padding to the right of the preference panel breadcrumb -->
+    <dimen name="preference_breadcrumb_paddingRight">32dp</dimen>
+    <!-- Weight of the left pane in a multi-pane preference layout. -->
+    <integer name="preferences_left_pane_weight">1</integer>
+    <!-- Weight of the right pane in a multi-pane preference layout. So the split is 1:2 -->
+    <integer name="preferences_right_pane_weight">2</integer>
+    <!-- Minimum space to allocate to the left of a preference item for an icon.
+        This helps in aligning titles when some items have icons and some don't. When space is
+        at a premium, we don't pre-allocate any space. -->
+    <dimen name="preference_icon_minWidth">56dp</dimen>
 </resources>
 
 
diff --git a/core/res/res/values-sw720dp/styles.xml b/core/res/res/values-sw720dp/styles.xml
new file mode 100644
index 0000000..640e898
--- /dev/null
+++ b/core/res/res/values-sw720dp/styles.xml
@@ -0,0 +1,25 @@
+<?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>
+    <style name="PreferencePanel">
+        <item name="android:layout_marginLeft">@dimen/preference_screen_side_margin</item>
+        <item name="android:layout_marginRight">@dimen/preference_screen_side_margin</item>
+        <item name="android:layout_marginTop">@dimen/preference_screen_top_margin</item>
+        <item name="android:layout_marginBottom">@dimen/preference_screen_bottom_margin</item>
+        <item name="android:background">?attr/detailsElementBackground</item>
+    </style>
+</resources>
diff --git a/core/res/res/values-th/strings.xml b/core/res/res/values-th/strings.xml
index c47a3ac..46c58e3 100644
--- a/core/res/res/values-th/strings.xml
+++ b/core/res/res/values-th/strings.xml
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"กำลังส่ง…"</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"เปิดเบราว์เซอร์หรือไม่"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"รับสายหรือไม่"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-tl/strings.xml b/core/res/res/values-tl/strings.xml
index 006fa63..946c0e7 100644
--- a/core/res/res/values-tl/strings.xml
+++ b/core/res/res/values-tl/strings.xml
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Ipinapadala..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Ilunsad ang Browser?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Tanggapin ang tawag?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-tr/strings.xml b/core/res/res/values-tr/strings.xml
index c13c520..9aa2df3 100644
--- a/core/res/res/values-tr/strings.xml
+++ b/core/res/res/values-tr/strings.xml
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Gönderiliyor…"</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Tarayıcı Başlatılsın mı?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Çağrı kabul edilsin mi?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-uk/strings.xml b/core/res/res/values-uk/strings.xml
index 0ad2da2..4a1a0bc 100644
--- a/core/res/res/values-uk/strings.xml
+++ b/core/res/res/values-uk/strings.xml
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"Надсилання…"</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Запустити веб-переглядач?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Прийняти виклик?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-vi/strings.xml b/core/res/res/values-vi/strings.xml
index 192c1dc..148713237 100644
--- a/core/res/res/values-vi/strings.xml
+++ b/core/res/res/values-vi/strings.xml
@@ -175,28 +175,20 @@
     <string name="permgroupdesc_location" msgid="5704679763124170100">"Giám sát vị trí thực của bạn."</string>
     <string name="permgrouplab_network" msgid="5808983377727109831">"Kết nối mạng"</string>
     <string name="permgroupdesc_network" msgid="4478299413241861987">"Truy cập các tính năng mạng khác nhau."</string>
-    <!-- no translation found for permgrouplab_bluetoothNetwork (1585403544162128109) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_bluetoothNetwork (5625288577164282391) -->
-    <skip />
-    <!-- no translation found for permgrouplab_shortrangeNetwork (130808676377486118) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_shortrangeNetwork (1884069062653436007) -->
-    <skip />
+    <string name="permgrouplab_bluetoothNetwork" msgid="1585403544162128109">"Bluetooth"</string>
+    <string name="permgroupdesc_bluetoothNetwork" msgid="5625288577164282391">"Truy cập vào các thiết bị và mạng thông qua Bluetooth."</string>
+    <string name="permgrouplab_shortrangeNetwork" msgid="130808676377486118">"Mạng tầm ngắn"</string>
+    <string name="permgroupdesc_shortrangeNetwork" msgid="1884069062653436007">"Truy cập vào các thiết bị thông qua mạng tầm ngắn như NFC."</string>
     <string name="permgrouplab_audioSettings" msgid="8329261670151871235">"Cài đặt âm thanh"</string>
     <string name="permgroupdesc_audioSettings" msgid="2641515403347568130">"Thay đổi cài đặt âm thanh."</string>
     <string name="permgrouplab_affectsBattery" msgid="6209246653424798033">"Ảnh hưởng tới pin"</string>
     <string name="permgroupdesc_affectsBattery" msgid="6441275320638916947">"Sử dụng các tính năng có thể làm nhanh hết pin."</string>
     <string name="permgrouplab_calendar" msgid="5863508437783683902">"Lịch"</string>
     <string name="permgroupdesc_calendar" msgid="5777534316982184416">"Truy cập trực tiếp vào lịch và sự kiện."</string>
-    <!-- no translation found for permgrouplab_dictionary (4148597128843641379) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_dictionary (7921166355964764490) -->
-    <skip />
-    <!-- no translation found for permgrouplab_writeDictionary (8090237702432576788) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_writeDictionary (2711561994497361646) -->
-    <skip />
+    <string name="permgrouplab_dictionary" msgid="4148597128843641379">"Đọc từ điển người dùng"</string>
+    <string name="permgroupdesc_dictionary" msgid="7921166355964764490">"Đọc các từ trong từ điển người dùng."</string>
+    <string name="permgrouplab_writeDictionary" msgid="8090237702432576788">"Ghi từ điển người dùng"</string>
+    <string name="permgroupdesc_writeDictionary" msgid="2711561994497361646">"Thêm từ vào từ điển người dùng."</string>
     <string name="permgrouplab_bookmarks" msgid="1949519673103968229">"Dấu trang và lịch sử"</string>
     <string name="permgroupdesc_bookmarks" msgid="4169771606257963028">"Truy cập trực tiếp vào dấu trang và lịch sử trình duyệt."</string>
     <string name="permgrouplab_deviceAlarms" msgid="6117704629728824101">"Báo thức"</string>
@@ -569,8 +561,7 @@
     <string name="permdesc_sdcardRead" product="nosdcard" msgid="3530894470637667917">"Cho phép ứng dụng đọc nội dung của bộ lưu trữ USB, bộ lưu trữ này có thể bao gồm ảnh và đa phương tiện."</string>
     <string name="permdesc_sdcardRead" product="default" msgid="2555811422562526606">"Cho phép ứng dụng đọc nội dung của thẻ SD, thẻ này có thể bao gồm ảnh và đa phương tiện."</string>
     <string name="permlab_sdcardWrite" product="nosdcard" msgid="8485979062254666748">"sửa đổi hoặc xóa nội dung của bộ lưu trữ USB của bạn"</string>
-    <!-- no translation found for permlab_sdcardWrite (8805693630050458763) -->
-    <skip />
+    <string name="permlab_sdcardWrite" product="default" msgid="8805693630050458763">"sửa đổi hoặc xóa nội dung của thẻ SD của bạn"</string>
     <string name="permdesc_sdcardWrite" product="nosdcard" msgid="6175406299445710888">"Cho phép ứng dụng ghi vào bộ lưu trữ USB."</string>
     <string name="permdesc_sdcardWrite" product="default" msgid="4337417790936632090">"Cho phép ứng dụng ghi vào thẻ SD."</string>
     <string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"sửa đổi/xóa nội dung trên bộ nhớ phương tiện cục bộ"</string>
@@ -1090,8 +1081,7 @@
     <string name="date_time_set" msgid="5777075614321087758">"Đặt"</string>
     <string name="date_time_done" msgid="2507683751759308828">"Xong"</string>
     <string name="perms_new_perm_prefix" msgid="8257740710754301407"><font size="12" fgcolor="#ff900000">"MỚI: "</font></string>
-    <!-- no translation found for perms_description_app (5139836143293299417) -->
-    <skip />
+    <string name="perms_description_app" msgid="5139836143293299417">"Được cung cấp bởi <xliff:g id="APP_NAME">%1$s</xliff:g>."</string>
     <string name="no_permissions" msgid="7283357728219338112">"Không yêu cầu quyền"</string>
     <string name="usb_storage_activity_title" msgid="4465055157209648641">"Bộ nhớ dung lượng lớn USB"</string>
     <string name="usb_storage_title" msgid="5901459041398751495">"USB đã kết nối"</string>
@@ -1321,8 +1311,7 @@
     <string name="sending" msgid="3245653681008218030">"Đang gửi…"</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Khởi chạy trình duyệt?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Chấp nhận cuộc gọi?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
-    <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
-    <skip />
+    <string name="activity_resolver_use_once" msgid="405646673463328329">"Chỉ một lần"</string>
 </resources>
diff --git a/core/res/res/values-w720dp/dimens.xml b/core/res/res/values-w720dp/dimens.xml
deleted file mode 100644
index a37f588..0000000
--- a/core/res/res/values-w720dp/dimens.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?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>
-    <!-- Preference fragment padding, sides -->
-    <dimen name="preference_fragment_padding_side">32dp</dimen>
-    <!-- Padding to the left of the preference panel breadcrumb -->
-    <dimen name="preference_breadcrumb_paddingLeft">32dp</dimen>
-    <!-- Padding to the right of the preference panel breadcrumb -->
-    <dimen name="preference_breadcrumb_paddingRight">32dp</dimen>
-    <!-- Weight of the left pane in a multi-pane preference layout. -->
-    <integer name="preferences_left_pane_weight">1</integer>
-    <!-- Weight of the right pane in a multi-pane preference layout. So the split is 1:2 -->
-    <integer name="preferences_right_pane_weight">2</integer>
-    <!-- Minimum space to allocate to the left of a preference item for an icon.
-        This helps in aligning titles when some items have icons and some don't. When space is
-        at a premium, we don't pre-allocate any space. -->
-    <dimen name="preference_icon_minWidth">56dp</dimen>
-
-    <dimen name="preference_screen_header_padding_side">0dip</dimen>
-
-    <integer name="preference_screen_header_scrollbarStyle">0x0</integer> <!-- insideOverlay -->
-    <integer name="preference_fragment_scrollbarStyle">0x02000000</integer> <!-- outsideOverlay -->
-</resources>
diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml
index d61d513..85f83f7 100644
--- a/core/res/res/values-zh-rCN/strings.xml
+++ b/core/res/res/values-zh-rCN/strings.xml
@@ -168,12 +168,9 @@
     <string name="permgrouplab_messages" msgid="7521249148445456662">"您的信息"</string>
     <string name="permgroupdesc_messages" msgid="7821999071003699236">"读写短信、电子邮件和其他消息。"</string>
     <string name="permgrouplab_personalInfo" msgid="3519163141070533474">"您的个人信息"</string>
-    <!-- no translation found for permgroupdesc_personalInfo (8426453129788861338) -->
-    <skip />
-    <!-- no translation found for permgrouplab_socialInfo (5799096623412043791) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_socialInfo (7129842457611643493) -->
-    <skip />
+    <string name="permgroupdesc_personalInfo" msgid="8426453129788861338">"直接访问您存储在名片上的信息。"</string>
+    <string name="permgrouplab_socialInfo" msgid="5799096623412043791">"您的社交信息"</string>
+    <string name="permgroupdesc_socialInfo" msgid="7129842457611643493">"直接访问与您的联系人和社交关系相关的信息。"</string>
     <string name="permgrouplab_location" msgid="635149742436692049">"您的位置"</string>
     <string name="permgroupdesc_location" msgid="5704679763124170100">"监视您的实际位置。"</string>
     <string name="permgrouplab_network" msgid="5808983377727109831">"网络通信"</string>
@@ -186,18 +183,12 @@
     <skip />
     <!-- no translation found for permgroupdesc_shortrangeNetwork (1884069062653436007) -->
     <skip />
-    <!-- no translation found for permgrouplab_audioSettings (8329261670151871235) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_audioSettings (2641515403347568130) -->
-    <skip />
-    <!-- no translation found for permgrouplab_affectsBattery (6209246653424798033) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_affectsBattery (6441275320638916947) -->
-    <skip />
-    <!-- no translation found for permgrouplab_calendar (5863508437783683902) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_calendar (5777534316982184416) -->
-    <skip />
+    <string name="permgrouplab_audioSettings" msgid="8329261670151871235">"音频设置"</string>
+    <string name="permgroupdesc_audioSettings" msgid="2641515403347568130">"更改音频设置。"</string>
+    <string name="permgrouplab_affectsBattery" msgid="6209246653424798033">"影响电池的使用"</string>
+    <string name="permgroupdesc_affectsBattery" msgid="6441275320638916947">"使用耗电量较大的功能。"</string>
+    <string name="permgrouplab_calendar" msgid="5863508437783683902">"日历"</string>
+    <string name="permgroupdesc_calendar" msgid="5777534316982184416">"直接访问日历和活动。"</string>
     <!-- no translation found for permgrouplab_dictionary (4148597128843641379) -->
     <skip />
     <!-- no translation found for permgroupdesc_dictionary (7921166355964764490) -->
@@ -206,46 +197,26 @@
     <skip />
     <!-- no translation found for permgroupdesc_writeDictionary (2711561994497361646) -->
     <skip />
-    <!-- no translation found for permgrouplab_bookmarks (1949519673103968229) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_bookmarks (4169771606257963028) -->
-    <skip />
-    <!-- no translation found for permgrouplab_deviceAlarms (6117704629728824101) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_deviceAlarms (4769356362251641175) -->
-    <skip />
-    <!-- no translation found for permgrouplab_voicemail (4162237145027592133) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_voicemail (2498403969862951393) -->
-    <skip />
-    <!-- no translation found for permgrouplab_microphone (171539900250043464) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_microphone (7106618286905738408) -->
-    <skip />
-    <!-- no translation found for permgrouplab_camera (4820372495894586615) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_camera (2933667372289567714) -->
-    <skip />
-    <!-- no translation found for permgrouplab_appInfo (8028789762634147725) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_appInfo (3950378538049625907) -->
-    <skip />
-    <!-- no translation found for permgrouplab_wallpaper (3850280158041175998) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_wallpaper (5630417854750540154) -->
-    <skip />
-    <!-- no translation found for permgrouplab_systemClock (406535759236612992) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_systemClock (3944359833624094992) -->
-    <skip />
-    <!-- no translation found for permgrouplab_statusBar (2095862568113945398) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_statusBar (6242593432226807171) -->
-    <skip />
-    <!-- no translation found for permgrouplab_syncSettings (3341990986147826541) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_syncSettings (7603195265129031797) -->
-    <skip />
+    <string name="permgrouplab_bookmarks" msgid="1949519673103968229">"书签和历史记录"</string>
+    <string name="permgroupdesc_bookmarks" msgid="4169771606257963028">"直接访问书签和浏览器历史记录。"</string>
+    <string name="permgrouplab_deviceAlarms" msgid="6117704629728824101">"闹钟"</string>
+    <string name="permgroupdesc_deviceAlarms" msgid="4769356362251641175">"设置闹钟。"</string>
+    <string name="permgrouplab_voicemail" msgid="4162237145027592133">"语音信箱"</string>
+    <string name="permgroupdesc_voicemail" msgid="2498403969862951393">"直接访问语音信箱。"</string>
+    <string name="permgrouplab_microphone" msgid="171539900250043464">"麦克风"</string>
+    <string name="permgroupdesc_microphone" msgid="7106618286905738408">"直接访问麦克风以录制音频。"</string>
+    <string name="permgrouplab_camera" msgid="4820372495894586615">"相机"</string>
+    <string name="permgroupdesc_camera" msgid="2933667372289567714">"直接访问相机以拍摄图片或视频。"</string>
+    <string name="permgrouplab_appInfo" msgid="8028789762634147725">"您的应用信息"</string>
+    <string name="permgroupdesc_appInfo" msgid="3950378538049625907">"能够影响设备上其他应用的行为。"</string>
+    <string name="permgrouplab_wallpaper" msgid="3850280158041175998">"壁纸"</string>
+    <string name="permgroupdesc_wallpaper" msgid="5630417854750540154">"更改设备的壁纸设置。"</string>
+    <string name="permgrouplab_systemClock" msgid="406535759236612992">"时钟"</string>
+    <string name="permgroupdesc_systemClock" msgid="3944359833624094992">"更改设备的时间或时区。"</string>
+    <string name="permgrouplab_statusBar" msgid="2095862568113945398">"状态栏"</string>
+    <string name="permgroupdesc_statusBar" msgid="6242593432226807171">"更改设备的状态栏设置。"</string>
+    <string name="permgrouplab_syncSettings" msgid="3341990986147826541">"同步设置"</string>
+    <string name="permgroupdesc_syncSettings" msgid="7603195265129031797">"访问同步设置。"</string>
     <string name="permgrouplab_accounts" msgid="3359646291125325519">"您的帐户"</string>
     <string name="permgroupdesc_accounts" msgid="4948732641827091312">"访问可用的帐户。"</string>
     <string name="permgrouplab_hardwareControls" msgid="7998214968791599326">"硬件控件"</string>
@@ -256,10 +227,8 @@
     <string name="permgroupdesc_systemTools" msgid="8162102602190734305">"对系统进行低级访问和控制。"</string>
     <string name="permgrouplab_developmentTools" msgid="3446164584710596513">"开发工具"</string>
     <string name="permgroupdesc_developmentTools" msgid="7058828032358142018">"只有应用开发人员才需要的功能。"</string>
-    <!-- no translation found for permgrouplab_display (4279909676036402636) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_display (6051002031933013714) -->
-    <skip />
+    <string name="permgrouplab_display" msgid="4279909676036402636">"其他应用的用户界面"</string>
+    <string name="permgroupdesc_display" msgid="6051002031933013714">"影响其他应用的用户界面。"</string>
     <string name="permgrouplab_storage" msgid="1971118770546336966">"存储"</string>
     <string name="permgroupdesc_storage" product="nosdcard" msgid="7442318502446874999">"访问 USB 存储设备。"</string>
     <string name="permgroupdesc_storage" product="default" msgid="9203302214915355774">"访问 SD 卡。"</string>
@@ -779,8 +748,7 @@
     <string name="lockscreen_missing_sim_message" product="default" msgid="2186920585695169078">"手机中无 SIM 卡"</string>
     <string name="lockscreen_missing_sim_instructions" msgid="5372787138023272615">"请插入 SIM 卡"</string>
     <string name="lockscreen_missing_sim_instructions_long" msgid="3526573099019319472">"SIM 卡缺失或无法读取。请插入 SIM 卡。"</string>
-    <!-- no translation found for lockscreen_permanent_disabled_sim_message_short (5096149665138916184) -->
-    <skip />
+    <string name="lockscreen_permanent_disabled_sim_message_short" msgid="5096149665138916184">"SIM 卡无法使用。"</string>
     <string name="lockscreen_permanent_disabled_sim_instructions" msgid="910904643433151371">"您的 SIM 卡已永久停用。"\n"请与您的无线服务提供商联系,以便重新获取一张 SIM 卡。"</string>
     <string name="lockscreen_transport_prev_description" msgid="201594905152746886">"“上一曲目”按钮"</string>
     <string name="lockscreen_transport_next_description" msgid="6089297650481292363">"“下一曲目”按钮"</string>
@@ -1353,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"正在发送..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"要启动浏览器吗?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"要接听电话吗?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-zh-rTW/strings.xml b/core/res/res/values-zh-rTW/strings.xml
index 28d7cab..8d1a950 100644
--- a/core/res/res/values-zh-rTW/strings.xml
+++ b/core/res/res/values-zh-rTW/strings.xml
@@ -1321,7 +1321,7 @@
     <string name="sending" msgid="3245653681008218030">"傳送中..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"啟動「瀏覽器」嗎?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"接聽電話嗎?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
     <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
     <skip />
diff --git a/core/res/res/values-zu/strings.xml b/core/res/res/values-zu/strings.xml
index 8010962..4edb7b2 100644
--- a/core/res/res/values-zu/strings.xml
+++ b/core/res/res/values-zu/strings.xml
@@ -175,28 +175,20 @@
     <string name="permgroupdesc_location" msgid="5704679763124170100">"Gada indawo yakho yokuhlala"</string>
     <string name="permgrouplab_network" msgid="5808983377727109831">"Uxhumano lwenethiwekhi"</string>
     <string name="permgroupdesc_network" msgid="4478299413241861987">"Finyelela kokuqukethwe inethiwekhi okuhlukahlukee."</string>
-    <!-- no translation found for permgrouplab_bluetoothNetwork (1585403544162128109) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_bluetoothNetwork (5625288577164282391) -->
-    <skip />
-    <!-- no translation found for permgrouplab_shortrangeNetwork (130808676377486118) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_shortrangeNetwork (1884069062653436007) -->
-    <skip />
+    <string name="permgrouplab_bluetoothNetwork" msgid="1585403544162128109">"I-Bluetooth"</string>
+    <string name="permgroupdesc_bluetoothNetwork" msgid="5625288577164282391">"Finyelela amadivayisi namanethiwekhi nge-Bluetooth."</string>
+    <string name="permgrouplab_shortrangeNetwork" msgid="130808676377486118">"Amanethiwekhi ebanga elifushane"</string>
+    <string name="permgroupdesc_shortrangeNetwork" msgid="1884069062653436007">"Finyelela amadivayisi ngamanethiwekhi ebanga elifushane njenge-NFC."</string>
     <string name="permgrouplab_audioSettings" msgid="8329261670151871235">"Izilungiselelo zomsindo"</string>
     <string name="permgroupdesc_audioSettings" msgid="2641515403347568130">"Shintsha izilungiselelo zomsindo."</string>
     <string name="permgrouplab_affectsBattery" msgid="6209246653424798033">"Ithinta ibhethri"</string>
     <string name="permgroupdesc_affectsBattery" msgid="6441275320638916947">"Sebenzisa izici ezingakhipha ngokushesha ibhethri."</string>
     <string name="permgrouplab_calendar" msgid="5863508437783683902">"Ikhalenda"</string>
     <string name="permgroupdesc_calendar" msgid="5777534316982184416">"Ukufinyelela okuqondile kukhalenda nezehlakalo."</string>
-    <!-- no translation found for permgrouplab_dictionary (4148597128843641379) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_dictionary (7921166355964764490) -->
-    <skip />
-    <!-- no translation found for permgrouplab_writeDictionary (8090237702432576788) -->
-    <skip />
-    <!-- no translation found for permgroupdesc_writeDictionary (2711561994497361646) -->
-    <skip />
+    <string name="permgrouplab_dictionary" msgid="4148597128843641379">"Funda isichzamazwi somsebenzisi"</string>
+    <string name="permgroupdesc_dictionary" msgid="7921166355964764490">"Funda amagama kusichazamazwi somsebenzisi."</string>
+    <string name="permgrouplab_writeDictionary" msgid="8090237702432576788">"Bhala isichazamazwi somsebenzisi"</string>
+    <string name="permgroupdesc_writeDictionary" msgid="2711561994497361646">"Engeza amagama kusichazamazwi somsebenzisi."</string>
     <string name="permgrouplab_bookmarks" msgid="1949519673103968229">"Amabhukhimakhi nomlando"</string>
     <string name="permgroupdesc_bookmarks" msgid="4169771606257963028">"Ukufinyelela okuqondile kumlando wamabhukimakhi nesiphequluli."</string>
     <string name="permgrouplab_deviceAlarms" msgid="6117704629728824101">"I-alamu"</string>
@@ -569,8 +561,7 @@
     <string name="permdesc_sdcardRead" product="nosdcard" msgid="3530894470637667917">"Ivumela uhlelo lokusebenza ukuthi lufunde okuqukethwe kwi-USB, okungabandakanya izithombe kanye nezingosi yezindaba."</string>
     <string name="permdesc_sdcardRead" product="default" msgid="2555811422562526606">"Ivumela uhlelo lokusebenza ukuthi lufunde okuqukethwe ikhadi le-SD, okungabandakanya izithombe kanye nengosi yezindaba."</string>
     <string name="permlab_sdcardWrite" product="nosdcard" msgid="8485979062254666748">"guqula noma ususe okuqukethwe kwakho okugciniwe okufinyeleleka nge-USB"</string>
-    <!-- no translation found for permlab_sdcardWrite (8805693630050458763) -->
-    <skip />
+    <string name="permlab_sdcardWrite" product="default" msgid="8805693630050458763">"shintsha noma ususe okuqukethwe ekhadini lakho le-SD"</string>
     <string name="permdesc_sdcardWrite" product="nosdcard" msgid="6175406299445710888">"Ivumela insiza ukuthi ibhalele ekulondolozweni kwe-USB."</string>
     <string name="permdesc_sdcardWrite" product="default" msgid="4337417790936632090">"Ivumela insiza ukuthi ibhalele ekhadini le-SD."</string>
     <string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"guqula/susa okuqukethwe kwisitoreji semidiya yangaphakathi"</string>
@@ -1090,8 +1081,7 @@
     <string name="date_time_set" msgid="5777075614321087758">"Hlela"</string>
     <string name="date_time_done" msgid="2507683751759308828">"Kwenziwe"</string>
     <string name="perms_new_perm_prefix" msgid="8257740710754301407"><font size="12" fgcolor="#ff900000">"OKUSHA: "</font></string>
-    <!-- no translation found for perms_description_app (5139836143293299417) -->
-    <skip />
+    <string name="perms_description_app" msgid="5139836143293299417">"Inikelwe yi-<xliff:g id="APP_NAME">%1$s</xliff:g>."</string>
     <string name="no_permissions" msgid="7283357728219338112">"Ayikho imvume edingekayo"</string>
     <string name="usb_storage_activity_title" msgid="4465055157209648641">"Isitoreji Esikhulu se-USB"</string>
     <string name="usb_storage_title" msgid="5901459041398751495">"I-USB ixhunyiwe"</string>
@@ -1321,8 +1311,7 @@
     <string name="sending" msgid="3245653681008218030">"Iyathumela..."</string>
     <string name="launchBrowserDefault" msgid="2057951947297614725">"Qala Isiphequluli?"</string>
     <string name="SetupCallDefault" msgid="5834948469253758575">"Amukela ucingo?"</string>
-    <!-- no translation found for activity_resolver_use_always (4167356512478150080) -->
+    <!-- no translation found for activity_resolver_use_always (8017770747801494933) -->
     <skip />
-    <!-- no translation found for activity_resolver_use_once (405646673463328329) -->
-    <skip />
+    <string name="activity_resolver_use_once" msgid="405646673463328329">"Kanye nje"</string>
 </resources>
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 484de0d..ad1dff5 100755
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -2461,8 +2461,10 @@
         <attr name="accessibilityFlags">
             <!-- Has flag {@link android.accessibilityservice.AccessibilityServiceInfo#DEFAULT} -->
             <flag name="flagDefault" value="0x00000001" />
-            <!-- Has flag {@link android.accessibilityservice.AccessibilityServiceInfo#INCLUDE_NOT_IMPORTANT_VIEWS} -->
+            <!-- Has flag {@link android.accessibilityservice.AccessibilityServiceInfo#FLAG_INCLUDE_NOT_IMPORTANT_VIEWS} -->
             <flag name="flagIncludeNotImportantViews" value="0x00000002" />
+            <!-- Has flag {@link android.accessibilityservice.AccessibilityServiceInfo#FLAG_REQUEST_TOUCH_EXPLORATION_MODE} -->
+            <flag name="flagRequestTouchExplorationMode" value="0x00000004" />
         </attr>
         <!-- Component name of an activity that allows the user to modify
              the settings for this service. This setting cannot be changed at runtime. -->
@@ -2470,8 +2472,6 @@
         <!-- Flag whether the accessibility service wants to be able to retrieve the
              active window content. This setting cannot be changed at runtime. -->
         <attr name="canRetrieveWindowContent" format="boolean" />
-        <!-- Flag whether the accessibility service can handle gesrures and wants such. -->
-        <attr name="canHandleGestures" format="boolean" />
         <!-- Short description of the accessibility serivce purpose or behavior.-->
         <attr name="description" />
     </declare-styleable>
diff --git a/core/res/res/values/colors.xml b/core/res/res/values/colors.xml
index e23e3c6..41f902f 100644
--- a/core/res/res/values/colors.xml
+++ b/core/res/res/values/colors.xml
@@ -181,5 +181,8 @@
     <!-- A really bright Holo shade of blue -->
     <color name="holo_blue_bright">#ff00ddff</color>
 
+    <drawable name="notification_template_icon_bg">#3333B5E5</drawable>
+    <drawable name="notification_template_icon_low_bg">#0cffffff</drawable>
+
 </resources>
 
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index f812822..734151b 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -19,9 +19,9 @@
 -->
 <resources>
     <!-- The width that is used when creating thumbnails of applications. -->
-    <dimen name="thumbnail_width">120dp</dimen>
+    <dimen name="thumbnail_width">164dp</dimen>
     <!-- The height that is used when creating thumbnails of applications. -->
-    <dimen name="thumbnail_height">120dp</dimen>
+    <dimen name="thumbnail_height">145dp</dimen>
     <!-- The standard size (both width and height) of an application icon that
          will be displayed in the app launcher and elsewhere. -->
     <dimen name="app_icon_size">48dip</dimen>
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 98c19cf..d899a1a 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -208,6 +208,7 @@
   <java-symbol type="id" name="inbox_text2" />
   <java-symbol type="id" name="inbox_text3" />
   <java-symbol type="id" name="inbox_text4" />
+  <java-symbol type="id" name="status_bar_latest_event_content" />
 
   <java-symbol type="attr" name="actionModeShareDrawable" />
   <java-symbol type="attr" name="alertDialogCenterButtons" />
@@ -1004,6 +1005,9 @@
   <java-symbol type="drawable" name="ic_lockscreen_unlock" />
   <java-symbol type="drawable" name="ic_lockscreen_search" />
   <java-symbol type="drawable" name="notification_bg" />
+  <java-symbol type="drawable" name="notification_bg_low" />
+  <java-symbol type="drawable" name="notification_template_icon_bg" />
+  <java-symbol type="drawable" name="notification_template_icon_low_bg" />
 
   <java-symbol type="layout" name="action_bar_home" />
   <java-symbol type="layout" name="action_bar_title_item" />
@@ -1091,6 +1095,7 @@
   <java-symbol type="layout" name="zoom_controls" />
   <java-symbol type="layout" name="zoom_magnify" />
   <java-symbol type="layout" name="notification_action" />
+  <java-symbol type="layout" name="notification_action_tombstone" />
   <java-symbol type="layout" name="notification_intruder_content" />
   <java-symbol type="layout" name="notification_template_base" />
   <java-symbol type="layout" name="notification_template_big_base" />
@@ -3600,7 +3605,6 @@
   <public type="attr" name="parentActivityName" />
 
   <public type="attr" name="importantForAccessibility"/>
-  <public type="attr" name="canHandleGestures"/>
 
   <public type="attr" name="permissionGroupFlags"/>
 
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index e7ad4c2..687a00b 100755
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -3562,7 +3562,7 @@
 
     <!-- Title for a button to choose the currently selected activity
          as the default in the activity resolver. [CHAR LIMIT=25] -->
-    <string name="activity_resolver_use_always">Use Always</string>
+    <string name="activity_resolver_use_always">Always</string>
 
     <!-- Title for a button to choose the currently selected activity
          from the activity resolver to use just this once. [CHAR LIMIT=25] -->
diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java
index 19aa77b..f7b0cd0 100644
--- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java
+++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java
@@ -246,9 +246,7 @@
 
         initializeNetworkStates();
 
-        mWifiManager.setWifiEnabled(true);
         log("Clear Wifi before we start the test.");
-        sleep(SHORT_TIMEOUT);
         removeConfiguredNetworksAndDisableWifi();
         mWifiRegexs = mCM.getTetherableWifiRegexs();
      }
@@ -645,6 +643,11 @@
      */
     public boolean disconnectAP() {
         // remove saved networks
+        if (!mWifiManager.isWifiEnabled()) {
+            log("Enabled wifi before remove configured networks");
+            mWifiManager.setWifiEnabled(true);
+            sleep(SHORT_TIMEOUT);
+        }
         List<WifiConfiguration> wifiConfigList = mWifiManager.getConfiguredNetworks();
         log("size of wifiConfigList: " + wifiConfigList.size());
         for (WifiConfiguration wifiConfig: wifiConfigList) {
diff --git a/core/tests/coretests/src/com/android/internal/util/FileRotatorTest.java b/core/tests/coretests/src/com/android/internal/util/FileRotatorTest.java
index 94d1cb6..95f0e67 100644
--- a/core/tests/coretests/src/com/android/internal/util/FileRotatorTest.java
+++ b/core/tests/coretests/src/com/android/internal/util/FileRotatorTest.java
@@ -187,12 +187,12 @@
             rotate.combineActive(reader, new Writer() {
                 public void write(OutputStream out) throws IOException {
                     new DataOutputStream(out).writeUTF("bar");
-                    throw new ProtocolException("yikes");
+                    throw new NullPointerException("yikes");
                 }
             }, currentTime);
 
             fail("woah, somehow able to write exception");
-        } catch (ProtocolException e) {
+        } catch (IOException e) {
             // expected from above
         }
 
diff --git a/data/fonts/Android.mk b/data/fonts/Android.mk
index 13f2480..16a98d3 100644
--- a/data/fonts/Android.mk
+++ b/data/fonts/Android.mk
@@ -142,6 +142,8 @@
     Roboto-Bold.ttf \
     Roboto-Italic.ttf \
     Roboto-BoldItalic.ttf \
+    Roboto-Light.ttf \
+    Roboto-LightItalic.ttf \
     DroidNaskh-Regular.ttf \
     DroidNaskh-Regular-SystemUI.ttf \
     DroidSansDevanagari-Regular.ttf \
diff --git a/data/fonts/Roboto-Light.ttf b/data/fonts/Roboto-Light.ttf
new file mode 100644
index 0000000..b50399e
--- /dev/null
+++ b/data/fonts/Roboto-Light.ttf
Binary files differ
diff --git a/data/fonts/Roboto-LightItalic.ttf b/data/fonts/Roboto-LightItalic.ttf
new file mode 100644
index 0000000..a1fdc8d
--- /dev/null
+++ b/data/fonts/Roboto-LightItalic.ttf
Binary files differ
diff --git a/data/fonts/fonts.mk b/data/fonts/fonts.mk
index 7a84df6..397ccda 100644
--- a/data/fonts/fonts.mk
+++ b/data/fonts/fonts.mk
@@ -24,6 +24,8 @@
     Roboto-Bold.ttf \
     Roboto-Italic.ttf \
     Roboto-BoldItalic.ttf \
+    Roboto-Light.ttf \
+    Roboto-LightItalic.ttf \
     DroidNaskh-Regular.ttf \
     DroidNaskh-Regular-SystemUI.ttf \
     DroidSansDevanagari-Regular.ttf \
diff --git a/data/fonts/system_fonts.xml b/data/fonts/system_fonts.xml
index d2fe546..95c4f70 100644
--- a/data/fonts/system_fonts.xml
+++ b/data/fonts/system_fonts.xml
@@ -36,6 +36,16 @@
 
     <family>
         <nameset>
+            <name>sans-serif-light</name>
+        </nameset>
+        <fileset>
+            <file>Roboto-Light.ttf</file>
+            <file>Roboto-LightItalic.ttf</file>
+        </fileset>
+    </family>
+
+    <family>
+        <nameset>
             <name>serif</name>
             <name>times</name>
             <name>times new roman</name>
diff --git a/graphics/java/android/graphics/Canvas.java b/graphics/java/android/graphics/Canvas.java
index 7e92973..3949afd 100644
--- a/graphics/java/android/graphics/Canvas.java
+++ b/graphics/java/android/graphics/Canvas.java
@@ -1617,6 +1617,13 @@
      */
     public static native void freeCaches();
 
+    /**
+     * Free up text layout caches
+     *
+     * @hide
+     */
+    public static native void freeTextLayoutCaches();
+
     private static native int initRaster(int nativeBitmapOrZero);
     private static native void native_setBitmap(int nativeCanvas, int bitmap);
     private static native int native_saveLayer(int nativeCanvas, RectF bounds,
diff --git a/graphics/java/android/renderscript/Allocation.java b/graphics/java/android/renderscript/Allocation.java
index 6b1d66f..10ccb87 100644
--- a/graphics/java/android/renderscript/Allocation.java
+++ b/graphics/java/android/renderscript/Allocation.java
@@ -27,7 +27,7 @@
 import android.util.Log;
 import android.util.TypedValue;
 
-/** @deprecated renderscript is deprecated in J
+/**
  * <p>
  * Memory allocation class for renderscript.  An allocation combines a
  * {@link android.renderscript.Type} with the memory to provide storage for user data and objects.
@@ -93,7 +93,7 @@
     int mCurrentCount;
 
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * The usage of the allocation.  These signal to renderscript
      * where to place the allocation in memory.
      *
@@ -102,14 +102,14 @@
      */
     public static final int USAGE_SCRIPT = 0x0001;
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * GRAPHICS_TEXTURE The allocation will be used as a texture
      * source by one or more graphics programs.
      *
      */
     public static final int USAGE_GRAPHICS_TEXTURE = 0x0002;
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * GRAPHICS_VERTEX The allocation will be used as a graphics
      * mesh.
      *
@@ -117,21 +117,21 @@
     public static final int USAGE_GRAPHICS_VERTEX = 0x0004;
 
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * GRAPHICS_CONSTANTS The allocation will be used as the source
      * of shader constants by one or more programs.
      *
      */
     public static final int USAGE_GRAPHICS_CONSTANTS = 0x0008;
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * USAGE_GRAPHICS_RENDER_TARGET The allocation will be used as a
      * target for offscreen rendering
      *
      */
     public static final int USAGE_GRAPHICS_RENDER_TARGET = 0x0010;
 
-    /** @hide renderscript is deprecated in J
+    /**
      * USAGE_IO_INPUT The allocation will be used as SurfaceTexture
      * consumer.  This usage will cause the allocation to be created
      * read only.
@@ -139,7 +139,7 @@
      */
     public static final int USAGE_IO_INPUT = 0x0020;
 
-    /** @hide renderscript is deprecated in J
+    /**
      * USAGE_IO_OUTPUT The allocation will be used as a
      * SurfaceTexture producer.  The dimensions and format of the
      * SurfaceTexture will be forced to those of the allocation.
@@ -147,25 +147,25 @@
      */
     public static final int USAGE_IO_OUTPUT = 0x0040;
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Controls mipmap behavior when using the bitmap creation and
      * update functions.
      */
     public enum MipmapControl {
-        /** @deprecated renderscript is deprecated in J
+        /**
          * No mipmaps will be generated and the type generated from the
          * incoming bitmap will not contain additional LODs.
          */
         MIPMAP_NONE(0),
 
-        /** @deprecated renderscript is deprecated in J
+        /**
          * A Full mipmap chain will be created in script memory.  The
          * type of the allocation will contain a full mipmap chain.  On
          * upload to graphics the full chain will be transfered.
          */
         MIPMAP_FULL(1),
 
-        /** @deprecated renderscript is deprecated in J
+        /**
          * The type of the allocation will be the same as MIPMAP_NONE.
          * It will not contain mipmaps.  On upload to graphics the
          * graphics copy of the allocation data will contain a full
@@ -188,7 +188,7 @@
     }
 
 
-   /** @hide renderscript is deprecated in J
+   /**
      * Get the element of the type of the Allocation.
      *
      * @return Element that describes the structure of data in the
@@ -199,7 +199,7 @@
         return mType.getElement();
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
      * Get the usage flags of the Allocation.
      *
      * @return usage flags associated with the allocation. e.g.
@@ -210,7 +210,7 @@
         return mUsage;
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
      * Get the size of the Allocation in bytes.
      *
      * @return size of the Allocation in bytes.
@@ -326,7 +326,7 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Get the type of the Allocation.
      *
      * @return Type
@@ -336,7 +336,7 @@
         return mType;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Propagate changes from one usage of the allocation to the
      * remaining usages of the allocation.
      *
@@ -355,7 +355,7 @@
         mRS.nAllocationSyncAll(getIDSafe(), srcLocation);
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
      * Send a buffer to the output stream.  The contents of the
      * Allocation will be undefined after this operation.
      *
@@ -369,7 +369,7 @@
         mRS.nAllocationIoSend(getID(mRS));
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Delete once code is updated.
      * @hide
      */
@@ -377,7 +377,7 @@
         ioSend();
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
      * Receive the latest input into the Allocation.
      *
      */
@@ -390,7 +390,7 @@
         mRS.nAllocationIoReceive(getID(mRS));
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy an array of RS objects to the allocation.
      *
      * @param d Source array.
@@ -461,7 +461,7 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy an allocation from an array.  This variant is not type
      * checked which allows an application to fill in structured
      * data from an array.
@@ -472,7 +472,7 @@
         mRS.validate();
         copy1DRangeFromUnchecked(0, mCurrentCount, d);
     }
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy an allocation from an array.  This variant is not type
      * checked which allows an application to fill in structured
      * data from an array.
@@ -483,7 +483,7 @@
         mRS.validate();
         copy1DRangeFromUnchecked(0, mCurrentCount, d);
     }
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy an allocation from an array.  This variant is not type
      * checked which allows an application to fill in structured
      * data from an array.
@@ -494,7 +494,7 @@
         mRS.validate();
         copy1DRangeFromUnchecked(0, mCurrentCount, d);
     }
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy an allocation from an array.  This variant is not type
      * checked which allows an application to fill in structured
      * data from an array.
@@ -506,7 +506,7 @@
         copy1DRangeFromUnchecked(0, mCurrentCount, d);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy an allocation from an array.  This variant is type
      * checked and will generate exceptions if the Allocation type
      * is not a 32 bit integer type.
@@ -518,7 +518,7 @@
         copy1DRangeFrom(0, mCurrentCount, d);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy an allocation from an array.  This variant is type
      * checked and will generate exceptions if the Allocation type
      * is not a 16 bit integer type.
@@ -530,7 +530,7 @@
         copy1DRangeFrom(0, mCurrentCount, d);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy an allocation from an array.  This variant is type
      * checked and will generate exceptions if the Allocation type
      * is not a 8 bit integer type.
@@ -542,7 +542,7 @@
         copy1DRangeFrom(0, mCurrentCount, d);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy an allocation from an array.  This variant is type
      * checked and will generate exceptions if the Allocation type
      * is not a 32 bit float type.
@@ -554,7 +554,7 @@
         copy1DRangeFrom(0, mCurrentCount, d);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy an allocation from a bitmap.  The height, width, and
      * format of the bitmap must match the existing allocation.
      *
@@ -567,7 +567,7 @@
         mRS.nAllocationCopyFromBitmap(getID(mRS), b);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * This is only intended to be used by auto-generate code reflected from the
      * renderscript script files.
      *
@@ -587,7 +587,7 @@
         copy1DRangeFromUnchecked(xoff, count, data);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * This is only intended to be used by auto-generate code reflected from the
      * renderscript script files.
      *
@@ -634,7 +634,7 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Generate a mipmap chain.  Requires the type of the allocation
      * include mipmaps.
      *
@@ -648,7 +648,7 @@
         mRS.nAllocationGenerateMipmaps(getID(mRS));
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy part of an allocation from an array.  This variant is
      * not type checked which allows an application to fill in
      * structured data from an array.
@@ -662,7 +662,7 @@
         data1DChecks(off, count, d.length * 4, dataSize);
         mRS.nAllocationData1D(getIDSafe(), off, mSelectedLOD, count, d, dataSize);
     }
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy part of an allocation from an array.  This variant is
      * not type checked which allows an application to fill in
      * structured data from an array.
@@ -676,7 +676,7 @@
         data1DChecks(off, count, d.length * 2, dataSize);
         mRS.nAllocationData1D(getIDSafe(), off, mSelectedLOD, count, d, dataSize);
     }
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy part of an allocation from an array.  This variant is
      * not type checked which allows an application to fill in
      * structured data from an array.
@@ -690,7 +690,7 @@
         data1DChecks(off, count, d.length, dataSize);
         mRS.nAllocationData1D(getIDSafe(), off, mSelectedLOD, count, d, dataSize);
     }
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy part of an allocation from an array.  This variant is
      * not type checked which allows an application to fill in
      * structured data from an array.
@@ -705,7 +705,7 @@
         mRS.nAllocationData1D(getIDSafe(), off, mSelectedLOD, count, d, dataSize);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy part of an allocation from an array.  This variant is
      * type checked and will generate exceptions if the Allocation
      * type is not a 32 bit integer type.
@@ -719,7 +719,7 @@
         copy1DRangeFromUnchecked(off, count, d);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy part of an allocation from an array.  This variant is
      * type checked and will generate exceptions if the Allocation
      * type is not a 16 bit integer type.
@@ -733,7 +733,7 @@
         copy1DRangeFromUnchecked(off, count, d);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy part of an allocation from an array.  This variant is
      * type checked and will generate exceptions if the Allocation
      * type is not a 8 bit integer type.
@@ -747,7 +747,7 @@
         copy1DRangeFromUnchecked(off, count, d);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy part of an allocation from an array.  This variant is
      * type checked and will generate exceptions if the Allocation
      * type is not a 32 bit float type.
@@ -761,7 +761,7 @@
         copy1DRangeFromUnchecked(off, count, d);
     }
 
-     /** @deprecated renderscript is deprecated in J
+     /**
      * Copy part of an allocation from another allocation.
      *
      * @param off The offset of the first element to be copied.
@@ -794,7 +794,7 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy a rectangular region from the array into the allocation.
      * The incoming array is assumed to be tightly packed.
      *
@@ -811,8 +811,6 @@
                               w, h, data, data.length);
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public void copy2DRangeFrom(int xoff, int yoff, int w, int h, short[] data) {
         mRS.validate();
         validate2DRange(xoff, yoff, w, h);
@@ -820,8 +818,6 @@
                               w, h, data, data.length * 2);
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public void copy2DRangeFrom(int xoff, int yoff, int w, int h, int[] data) {
         mRS.validate();
         validate2DRange(xoff, yoff, w, h);
@@ -829,8 +825,6 @@
                               w, h, data, data.length * 4);
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public void copy2DRangeFrom(int xoff, int yoff, int w, int h, float[] data) {
         mRS.validate();
         validate2DRange(xoff, yoff, w, h);
@@ -838,7 +832,7 @@
                               w, h, data, data.length * 4);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy a rectangular region into the allocation from another
      * allocation.
      *
@@ -860,7 +854,7 @@
                               data.mSelectedLOD, data.mSelectedFace.mID);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy a bitmap into an allocation.  The height and width of
      * the update will use the height and width of the incoming
      * bitmap.
@@ -877,7 +871,7 @@
     }
 
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy from the Allocation into a Bitmap.  The bitmap must
      * match the dimensions of the Allocation.
      *
@@ -890,7 +884,7 @@
         mRS.nAllocationCopyToBitmap(getID(mRS), b);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy from the Allocation into a byte array.  The array must
      * be at least as large as the Allocation.  The allocation must
      * be of an 8 bit elemental type.
@@ -903,7 +897,7 @@
         mRS.nAllocationRead(getID(mRS), d);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy from the Allocation into a short array.  The array must
      * be at least as large as the Allocation.  The allocation must
      * be of an 16 bit elemental type.
@@ -916,7 +910,7 @@
         mRS.nAllocationRead(getID(mRS), d);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy from the Allocation into a int array.  The array must be
      * at least as large as the Allocation.  The allocation must be
      * of an 32 bit elemental type.
@@ -929,7 +923,7 @@
         mRS.nAllocationRead(getID(mRS), d);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Copy from the Allocation into a float array.  The array must
      * be at least as large as the Allocation.  The allocation must
      * be of an 32 bit float elemental type.
@@ -942,7 +936,7 @@
         mRS.nAllocationRead(getID(mRS), d);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Resize a 1D allocation.  The contents of the allocation are
      * preserved.  If new elements are allocated objects are created
      * with null contents and the new region is otherwise undefined.
@@ -967,7 +961,7 @@
         updateCacheInfo(mType);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Resize a 2D allocation.  The contents of the allocation are
      * preserved.  If new elements are allocated objects are created
      * with null contents and the new region is otherwise undefined.
@@ -1008,7 +1002,7 @@
         mBitmapOptions.inScaled = false;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      *
      * @param type renderscript type describing data layout
      * @param mips specifies desired mipmap behaviour for the
@@ -1028,7 +1022,7 @@
         return new Allocation(id, rs, type, usage);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Creates a renderscript allocation with the size specified by
      * the type and no mipmaps generated by default
      *
@@ -1043,7 +1037,7 @@
         return createTyped(rs, type, MipmapControl.MIPMAP_NONE, usage);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Creates a renderscript allocation for use by the script with
      * the size specified by the type and no mipmaps generated by
      * default
@@ -1057,7 +1051,7 @@
         return createTyped(rs, type, MipmapControl.MIPMAP_NONE, USAGE_SCRIPT);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Creates a renderscript allocation with a specified number of
      * given elements
      *
@@ -1083,7 +1077,7 @@
         return new Allocation(id, rs, t, usage);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Creates a renderscript allocation with a specified number of
      * given elements
      *
@@ -1124,7 +1118,7 @@
         return tb.create();
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Creates a renderscript allocation from a bitmap
      *
      * @param rs Context to which the allocation will belong.
@@ -1150,7 +1144,7 @@
         return new Allocation(id, rs, t, usage);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      *
      *
      * @hide
@@ -1168,7 +1162,7 @@
         return st;
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
      * For allocations used with io operations, returns the handle
      * onto a raw buffer that is being managed by the screen
      * compositor.
@@ -1180,7 +1174,7 @@
         return new Surface(getSurfaceTexture());
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
      * Associate a surface for io output with this allocation
      *
      * @param sur Surface to associate with allocation
@@ -1194,7 +1188,7 @@
         mRS.nAllocationSetSurface(getID(mRS), sur);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * @hide
      */
     public void setSurfaceTexture(SurfaceTexture st) {
@@ -1207,7 +1201,7 @@
         mRS.nAllocationSetSurface(getID(mRS), s);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Creates a non-mipmapped renderscript allocation to use as a
      * graphics texture
      *
@@ -1222,7 +1216,7 @@
                                 USAGE_GRAPHICS_TEXTURE);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Creates a cubemap allocation from a bitmap containing the
      * horizontal list of cube faces. Each individual face must be
      * the same size and power of 2
@@ -1270,7 +1264,7 @@
         return new Allocation(id, rs, t, usage);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Creates a non-mipmapped cubemap allocation for use as a
      * graphics texture from a bitmap containing the horizontal list
      * of cube faces. Each individual face must be the same size and
@@ -1289,7 +1283,7 @@
                                        USAGE_GRAPHICS_TEXTURE);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Creates a cubemap allocation from 6 bitmaps containing
      * the cube faces. All the faces must be the same size and
      * power of 2
@@ -1356,7 +1350,7 @@
         return cubemap;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Creates a non-mipmapped cubemap allocation for use as a
      * graphics texture from 6 bitmaps containing
      * the cube faces. All the faces must be the same size and
@@ -1385,7 +1379,7 @@
                                           USAGE_GRAPHICS_TEXTURE);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Creates a renderscript allocation from the bitmap referenced
      * by resource id
      *
@@ -1413,7 +1407,7 @@
         return alloc;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Creates a non-mipmapped renderscript allocation to use as a
      * graphics texture from the bitmap referenced by resource id
      *
@@ -1432,7 +1426,7 @@
                                         USAGE_GRAPHICS_TEXTURE);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Creates a renderscript allocation containing string data
      * encoded in UTF-8 format
      *
diff --git a/graphics/java/android/renderscript/AllocationAdapter.java b/graphics/java/android/renderscript/AllocationAdapter.java
index 3b5993a..85d86e5 100644
--- a/graphics/java/android/renderscript/AllocationAdapter.java
+++ b/graphics/java/android/renderscript/AllocationAdapter.java
@@ -21,7 +21,7 @@
 import android.graphics.BitmapFactory;
 import android.util.TypedValue;
 
-/** @deprecated renderscript is deprecated in J
+/**
  *
  **/
 public class AllocationAdapter extends Allocation {
@@ -129,7 +129,7 @@
         mSelectedZ = 0;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Set the active LOD.  The LOD must be within the range for the
      * type being adapted.  The base allocation must have mipmaps.
      *
@@ -149,7 +149,7 @@
         initLOD(lod);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Set the active Face.  The base allocation must be of a type
      * that includes faces.
      *
@@ -169,7 +169,7 @@
         mSelectedFace = cf;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Set the active Y.  The y value must be within the range for
      * the allocation being adapted.  The base allocation must
      * contain the Y dimension.
@@ -190,7 +190,7 @@
         mSelectedY = y;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Set the active Z.  The z value must be within the range for
      * the allocation being adapted.  The base allocation must
      * contain the Z dimension.
@@ -211,8 +211,6 @@
         mSelectedZ = z;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     static public AllocationAdapter create1D(RenderScript rs, Allocation a) {
         rs.validate();
         AllocationAdapter aa = new AllocationAdapter(0, rs, a);
@@ -224,8 +222,6 @@
         return aa;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     static public AllocationAdapter create2D(RenderScript rs, Allocation a) {
         android.util.Log.e("rs", "create2d " + a);
         rs.validate();
@@ -239,7 +235,7 @@
     }
 
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Override the Allocation resize.  Resizing adapters is not
      * allowed and will throw a RSInvalidStateException.
      *
diff --git a/graphics/java/android/renderscript/BaseObj.java b/graphics/java/android/renderscript/BaseObj.java
index 0d74212..f464f9b 100644
--- a/graphics/java/android/renderscript/BaseObj.java
+++ b/graphics/java/android/renderscript/BaseObj.java
@@ -18,7 +18,7 @@
 
 import android.util.Log;
 
-/** @deprecated renderscript is deprecated in J
+/**
  * BaseObj is the base class for interfacing with native renderscript objects.
  * It primarly contains code for tracking the native object ID and forcably
  * disconecting the object from the native allocation for early cleanup.
@@ -39,7 +39,7 @@
         mID = id;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Lookup the native object ID for this object.  Primarily used by the
      * generated reflected code.
      *
@@ -73,7 +73,7 @@
     private String mName;
     RenderScript mRS;
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * setName assigns a name to an object.  This object can later be looked up
      * by this name.  This name will also be retained if the object is written
      * to an A3D file.
@@ -103,7 +103,7 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * @return name of the renderscript object
      */
     public String getName() {
@@ -124,7 +124,7 @@
         super.finalize();
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * destroy disconnects the object from the native object effectively
      * rendering this java object dead.  The primary use is to force immediate
      * cleanup of resources when it is believed the GC will not respond quickly
@@ -138,7 +138,7 @@
         mRS.nObjDestroy(mID);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * If an object came from an a3d file, java fields need to be
      * created with objects from the native layer
      */
@@ -147,7 +147,7 @@
         mName = mRS.nGetName(getID(mRS));
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Calculates the hash code value for a BaseObj.
      *
      * @return int
@@ -157,7 +157,7 @@
         return mID;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Compare the current BaseObj with another BaseObj for equality.
      *
      * @param obj The object to check equality with.
diff --git a/graphics/java/android/renderscript/Byte2.java b/graphics/java/android/renderscript/Byte2.java
index 163b8bd..7df5f2e 100644
--- a/graphics/java/android/renderscript/Byte2.java
+++ b/graphics/java/android/renderscript/Byte2.java
@@ -20,7 +20,7 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Class for exposing the native Renderscript byte2 type back to the Android system.
  *
  **/
diff --git a/graphics/java/android/renderscript/Byte3.java b/graphics/java/android/renderscript/Byte3.java
index eaa1d5f9..02a01c1 100644
--- a/graphics/java/android/renderscript/Byte3.java
+++ b/graphics/java/android/renderscript/Byte3.java
@@ -20,7 +20,7 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Class for exposing the native Renderscript byte3 type back to the Android system.
  *
  **/
diff --git a/graphics/java/android/renderscript/Byte4.java b/graphics/java/android/renderscript/Byte4.java
index e162f9d..a55a696 100644
--- a/graphics/java/android/renderscript/Byte4.java
+++ b/graphics/java/android/renderscript/Byte4.java
@@ -20,7 +20,7 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Class for exposing the native Renderscript byte4 type back to the Android system.
  *
  **/
diff --git a/graphics/java/android/renderscript/Double2.java b/graphics/java/android/renderscript/Double2.java
index 0ef2f2b..9f4f328 100644
--- a/graphics/java/android/renderscript/Double2.java
+++ b/graphics/java/android/renderscript/Double2.java
@@ -20,7 +20,7 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Class for exposing the native Renderscript double2 type back
  * to the Android system.
  *
diff --git a/graphics/java/android/renderscript/Double3.java b/graphics/java/android/renderscript/Double3.java
index 09aba18..eb55142 100644
--- a/graphics/java/android/renderscript/Double3.java
+++ b/graphics/java/android/renderscript/Double3.java
@@ -20,7 +20,7 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Class for exposing the native Renderscript double3 type back
  * to the Android system.
  *
diff --git a/graphics/java/android/renderscript/Double4.java b/graphics/java/android/renderscript/Double4.java
index c5211be..4755a76 100644
--- a/graphics/java/android/renderscript/Double4.java
+++ b/graphics/java/android/renderscript/Double4.java
@@ -20,7 +20,7 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Class for exposing the native Renderscript double4 type back
  * to the Android system.
  *
diff --git a/graphics/java/android/renderscript/Element.java b/graphics/java/android/renderscript/Element.java
index 6872310..060f526 100644
--- a/graphics/java/android/renderscript/Element.java
+++ b/graphics/java/android/renderscript/Element.java
@@ -19,7 +19,7 @@
 import java.lang.reflect.Field;
 import android.util.Log;
 
-/** @deprecated renderscript is deprecated in J
+/**
  * <p>The most basic data type. An element represents one cell of a memory allocation.
  * Element is the basic data type of Renderscript. An element can be of two forms: Basic elements or Complex forms.
  * Examples of basic elements are:</p>
@@ -84,12 +84,12 @@
         }
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
     * @return element size in bytes
     */
     public int getBytesSize() {return mSize;}
 
-    /** @hide renderscript is deprecated in J
+    /**
     * Returns the number of vector components. 2 for float2, 4 for
     * float4, etc.
     * @return element vector size
@@ -97,7 +97,7 @@
     public int getVectorSize() {return mVectorSize;}
 
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * DataType represents the basic type information for a basic element.  The
      * naming convention follows.  For numeric types it is FLOAT,
      * SIGNED, or UNSIGNED followed by the _BITS where BITS is the
@@ -114,8 +114,6 @@
      * RS_* objects.  32 bit opaque handles.
      */
     public enum DataType {
-        /** @hide
-        */
         NONE (0, 0),
         //FLOAT_16 (1, 2),
         FLOAT_32 (2, 4),
@@ -159,7 +157,7 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * The special interpretation of the data if required.  This is primarly
      * useful for graphical data.  USER indicates no special interpretation is
      * expected.  PIXEL is used in conjunction with the standard data types for
@@ -181,7 +179,7 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Return if a element is too complex for use as a data source for a Mesh or
      * a Program.
      *
@@ -199,7 +197,7 @@
         return false;
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
     * Elements could be simple, such as an int or a float, or a
     * structure with multiple sub elements, such as a collection of
     * floats, float2, float4. This function returns zero for simple
@@ -213,7 +211,7 @@
         return mVisibleElementMap.length;
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
     * For complex elements, this function will return the
     * sub-element at index
     * @param index index of the sub-element to return
@@ -229,7 +227,7 @@
         return mElements[mVisibleElementMap[index]];
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
     * For complex elements, this function will return the
     * sub-element name at index
     * @param index index of the sub-element
@@ -245,7 +243,7 @@
         return mElementNames[mVisibleElementMap[index]];
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
     * For complex elements, some sub-elements could be statically
     * sized arrays. This function will return the array size for
     * sub-element at index
@@ -262,7 +260,7 @@
         return mArraySizes[mVisibleElementMap[index]];
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
     * This function specifies the location of a sub-element within
     * the element
     * @param index index of the sub-element
@@ -278,21 +276,21 @@
         return mOffsetInBytes[mVisibleElementMap[index]];
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
     * @return element data type
     */
     public DataType getDataType() {
         return mType;
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
     * @return element data kind
     */
     public DataKind getDataKind() {
         return mKind;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Utility function for returning an Element containing a single Boolean.
      *
      * @param rs Context to which the element will belong.
@@ -306,7 +304,7 @@
         return rs.mElement_BOOLEAN;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Utility function for returning an Element containing a single UNSIGNED_8.
      *
      * @param rs Context to which the element will belong.
@@ -320,7 +318,7 @@
         return rs.mElement_U8;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Utility function for returning an Element containing a single SIGNED_8.
      *
      * @param rs Context to which the element will belong.
@@ -334,8 +332,6 @@
         return rs.mElement_I8;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element U16(RenderScript rs) {
         if(rs.mElement_U16 == null) {
             rs.mElement_U16 = createUser(rs, DataType.UNSIGNED_16);
@@ -343,8 +339,6 @@
         return rs.mElement_U16;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element I16(RenderScript rs) {
         if(rs.mElement_I16 == null) {
             rs.mElement_I16 = createUser(rs, DataType.SIGNED_16);
@@ -352,8 +346,6 @@
         return rs.mElement_I16;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element U32(RenderScript rs) {
         if(rs.mElement_U32 == null) {
             rs.mElement_U32 = createUser(rs, DataType.UNSIGNED_32);
@@ -361,8 +353,6 @@
         return rs.mElement_U32;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element I32(RenderScript rs) {
         if(rs.mElement_I32 == null) {
             rs.mElement_I32 = createUser(rs, DataType.SIGNED_32);
@@ -370,8 +360,6 @@
         return rs.mElement_I32;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element U64(RenderScript rs) {
         if(rs.mElement_U64 == null) {
             rs.mElement_U64 = createUser(rs, DataType.UNSIGNED_64);
@@ -379,8 +367,6 @@
         return rs.mElement_U64;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element I64(RenderScript rs) {
         if(rs.mElement_I64 == null) {
             rs.mElement_I64 = createUser(rs, DataType.SIGNED_64);
@@ -388,8 +374,6 @@
         return rs.mElement_I64;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element F32(RenderScript rs) {
         if(rs.mElement_F32 == null) {
             rs.mElement_F32 = createUser(rs, DataType.FLOAT_32);
@@ -397,8 +381,6 @@
         return rs.mElement_F32;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element F64(RenderScript rs) {
         if(rs.mElement_F64 == null) {
             rs.mElement_F64 = createUser(rs, DataType.FLOAT_64);
@@ -406,8 +388,6 @@
         return rs.mElement_F64;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element ELEMENT(RenderScript rs) {
         if(rs.mElement_ELEMENT == null) {
             rs.mElement_ELEMENT = createUser(rs, DataType.RS_ELEMENT);
@@ -415,8 +395,6 @@
         return rs.mElement_ELEMENT;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element TYPE(RenderScript rs) {
         if(rs.mElement_TYPE == null) {
             rs.mElement_TYPE = createUser(rs, DataType.RS_TYPE);
@@ -424,8 +402,6 @@
         return rs.mElement_TYPE;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element ALLOCATION(RenderScript rs) {
         if(rs.mElement_ALLOCATION == null) {
             rs.mElement_ALLOCATION = createUser(rs, DataType.RS_ALLOCATION);
@@ -433,8 +409,6 @@
         return rs.mElement_ALLOCATION;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element SAMPLER(RenderScript rs) {
         if(rs.mElement_SAMPLER == null) {
             rs.mElement_SAMPLER = createUser(rs, DataType.RS_SAMPLER);
@@ -442,8 +416,6 @@
         return rs.mElement_SAMPLER;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element SCRIPT(RenderScript rs) {
         if(rs.mElement_SCRIPT == null) {
             rs.mElement_SCRIPT = createUser(rs, DataType.RS_SCRIPT);
@@ -451,8 +423,6 @@
         return rs.mElement_SCRIPT;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element MESH(RenderScript rs) {
         if(rs.mElement_MESH == null) {
             rs.mElement_MESH = createUser(rs, DataType.RS_MESH);
@@ -460,8 +430,6 @@
         return rs.mElement_MESH;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element PROGRAM_FRAGMENT(RenderScript rs) {
         if(rs.mElement_PROGRAM_FRAGMENT == null) {
             rs.mElement_PROGRAM_FRAGMENT = createUser(rs, DataType.RS_PROGRAM_FRAGMENT);
@@ -469,8 +437,6 @@
         return rs.mElement_PROGRAM_FRAGMENT;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element PROGRAM_VERTEX(RenderScript rs) {
         if(rs.mElement_PROGRAM_VERTEX == null) {
             rs.mElement_PROGRAM_VERTEX = createUser(rs, DataType.RS_PROGRAM_VERTEX);
@@ -478,8 +444,6 @@
         return rs.mElement_PROGRAM_VERTEX;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element PROGRAM_RASTER(RenderScript rs) {
         if(rs.mElement_PROGRAM_RASTER == null) {
             rs.mElement_PROGRAM_RASTER = createUser(rs, DataType.RS_PROGRAM_RASTER);
@@ -487,8 +451,6 @@
         return rs.mElement_PROGRAM_RASTER;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element PROGRAM_STORE(RenderScript rs) {
         if(rs.mElement_PROGRAM_STORE == null) {
             rs.mElement_PROGRAM_STORE = createUser(rs, DataType.RS_PROGRAM_STORE);
@@ -496,8 +458,6 @@
         return rs.mElement_PROGRAM_STORE;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element FONT(RenderScript rs) {
         if(rs.mElement_FONT == null) {
             rs.mElement_FONT = createUser(rs, DataType.RS_FONT);
@@ -505,8 +465,7 @@
         return rs.mElement_FONT;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
+
     public static Element A_8(RenderScript rs) {
         if(rs.mElement_A_8 == null) {
             rs.mElement_A_8 = createPixel(rs, DataType.UNSIGNED_8, DataKind.PIXEL_A);
@@ -514,8 +473,6 @@
         return rs.mElement_A_8;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element RGB_565(RenderScript rs) {
         if(rs.mElement_RGB_565 == null) {
             rs.mElement_RGB_565 = createPixel(rs, DataType.UNSIGNED_5_6_5, DataKind.PIXEL_RGB);
@@ -523,8 +480,6 @@
         return rs.mElement_RGB_565;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element RGB_888(RenderScript rs) {
         if(rs.mElement_RGB_888 == null) {
             rs.mElement_RGB_888 = createPixel(rs, DataType.UNSIGNED_8, DataKind.PIXEL_RGB);
@@ -532,8 +487,6 @@
         return rs.mElement_RGB_888;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element RGBA_5551(RenderScript rs) {
         if(rs.mElement_RGBA_5551 == null) {
             rs.mElement_RGBA_5551 = createPixel(rs, DataType.UNSIGNED_5_5_5_1, DataKind.PIXEL_RGBA);
@@ -541,8 +494,6 @@
         return rs.mElement_RGBA_5551;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element RGBA_4444(RenderScript rs) {
         if(rs.mElement_RGBA_4444 == null) {
             rs.mElement_RGBA_4444 = createPixel(rs, DataType.UNSIGNED_4_4_4_4, DataKind.PIXEL_RGBA);
@@ -550,8 +501,6 @@
         return rs.mElement_RGBA_4444;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element RGBA_8888(RenderScript rs) {
         if(rs.mElement_RGBA_8888 == null) {
             rs.mElement_RGBA_8888 = createPixel(rs, DataType.UNSIGNED_8, DataKind.PIXEL_RGBA);
@@ -559,8 +508,6 @@
         return rs.mElement_RGBA_8888;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element F32_2(RenderScript rs) {
         if(rs.mElement_FLOAT_2 == null) {
             rs.mElement_FLOAT_2 = createVector(rs, DataType.FLOAT_32, 2);
@@ -568,8 +515,6 @@
         return rs.mElement_FLOAT_2;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element F32_3(RenderScript rs) {
         if(rs.mElement_FLOAT_3 == null) {
             rs.mElement_FLOAT_3 = createVector(rs, DataType.FLOAT_32, 3);
@@ -577,8 +522,6 @@
         return rs.mElement_FLOAT_3;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element F32_4(RenderScript rs) {
         if(rs.mElement_FLOAT_4 == null) {
             rs.mElement_FLOAT_4 = createVector(rs, DataType.FLOAT_32, 4);
@@ -586,8 +529,6 @@
         return rs.mElement_FLOAT_4;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element F64_2(RenderScript rs) {
         if(rs.mElement_DOUBLE_2 == null) {
             rs.mElement_DOUBLE_2 = createVector(rs, DataType.FLOAT_64, 2);
@@ -595,8 +536,6 @@
         return rs.mElement_DOUBLE_2;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element F64_3(RenderScript rs) {
         if(rs.mElement_DOUBLE_3 == null) {
             rs.mElement_DOUBLE_3 = createVector(rs, DataType.FLOAT_64, 3);
@@ -604,8 +543,6 @@
         return rs.mElement_DOUBLE_3;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element F64_4(RenderScript rs) {
         if(rs.mElement_DOUBLE_4 == null) {
             rs.mElement_DOUBLE_4 = createVector(rs, DataType.FLOAT_64, 4);
@@ -613,8 +550,6 @@
         return rs.mElement_DOUBLE_4;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element U8_2(RenderScript rs) {
         if(rs.mElement_UCHAR_2 == null) {
             rs.mElement_UCHAR_2 = createVector(rs, DataType.UNSIGNED_8, 2);
@@ -622,8 +557,6 @@
         return rs.mElement_UCHAR_2;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element U8_3(RenderScript rs) {
         if(rs.mElement_UCHAR_3 == null) {
             rs.mElement_UCHAR_3 = createVector(rs, DataType.UNSIGNED_8, 3);
@@ -631,8 +564,6 @@
         return rs.mElement_UCHAR_3;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element U8_4(RenderScript rs) {
         if(rs.mElement_UCHAR_4 == null) {
             rs.mElement_UCHAR_4 = createVector(rs, DataType.UNSIGNED_8, 4);
@@ -640,8 +571,6 @@
         return rs.mElement_UCHAR_4;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element I8_2(RenderScript rs) {
         if(rs.mElement_CHAR_2 == null) {
             rs.mElement_CHAR_2 = createVector(rs, DataType.SIGNED_8, 2);
@@ -649,8 +578,6 @@
         return rs.mElement_CHAR_2;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element I8_3(RenderScript rs) {
         if(rs.mElement_CHAR_3 == null) {
             rs.mElement_CHAR_3 = createVector(rs, DataType.SIGNED_8, 3);
@@ -658,8 +585,6 @@
         return rs.mElement_CHAR_3;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element I8_4(RenderScript rs) {
         if(rs.mElement_CHAR_4 == null) {
             rs.mElement_CHAR_4 = createVector(rs, DataType.SIGNED_8, 4);
@@ -667,8 +592,6 @@
         return rs.mElement_CHAR_4;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element U16_2(RenderScript rs) {
         if(rs.mElement_USHORT_2 == null) {
             rs.mElement_USHORT_2 = createVector(rs, DataType.UNSIGNED_16, 2);
@@ -676,8 +599,6 @@
         return rs.mElement_USHORT_2;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element U16_3(RenderScript rs) {
         if(rs.mElement_USHORT_3 == null) {
             rs.mElement_USHORT_3 = createVector(rs, DataType.UNSIGNED_16, 3);
@@ -685,8 +606,6 @@
         return rs.mElement_USHORT_3;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element U16_4(RenderScript rs) {
         if(rs.mElement_USHORT_4 == null) {
             rs.mElement_USHORT_4 = createVector(rs, DataType.UNSIGNED_16, 4);
@@ -694,8 +613,6 @@
         return rs.mElement_USHORT_4;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element I16_2(RenderScript rs) {
         if(rs.mElement_SHORT_2 == null) {
             rs.mElement_SHORT_2 = createVector(rs, DataType.SIGNED_16, 2);
@@ -703,8 +620,6 @@
         return rs.mElement_SHORT_2;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element I16_3(RenderScript rs) {
         if(rs.mElement_SHORT_3 == null) {
             rs.mElement_SHORT_3 = createVector(rs, DataType.SIGNED_16, 3);
@@ -712,8 +627,6 @@
         return rs.mElement_SHORT_3;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element I16_4(RenderScript rs) {
         if(rs.mElement_SHORT_4 == null) {
             rs.mElement_SHORT_4 = createVector(rs, DataType.SIGNED_16, 4);
@@ -721,8 +634,6 @@
         return rs.mElement_SHORT_4;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element U32_2(RenderScript rs) {
         if(rs.mElement_UINT_2 == null) {
             rs.mElement_UINT_2 = createVector(rs, DataType.UNSIGNED_32, 2);
@@ -730,8 +641,6 @@
         return rs.mElement_UINT_2;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element U32_3(RenderScript rs) {
         if(rs.mElement_UINT_3 == null) {
             rs.mElement_UINT_3 = createVector(rs, DataType.UNSIGNED_32, 3);
@@ -739,8 +648,6 @@
         return rs.mElement_UINT_3;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element U32_4(RenderScript rs) {
         if(rs.mElement_UINT_4 == null) {
             rs.mElement_UINT_4 = createVector(rs, DataType.UNSIGNED_32, 4);
@@ -748,8 +655,6 @@
         return rs.mElement_UINT_4;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element I32_2(RenderScript rs) {
         if(rs.mElement_INT_2 == null) {
             rs.mElement_INT_2 = createVector(rs, DataType.SIGNED_32, 2);
@@ -757,8 +662,6 @@
         return rs.mElement_INT_2;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element I32_3(RenderScript rs) {
         if(rs.mElement_INT_3 == null) {
             rs.mElement_INT_3 = createVector(rs, DataType.SIGNED_32, 3);
@@ -766,8 +669,6 @@
         return rs.mElement_INT_3;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element I32_4(RenderScript rs) {
         if(rs.mElement_INT_4 == null) {
             rs.mElement_INT_4 = createVector(rs, DataType.SIGNED_32, 4);
@@ -775,8 +676,6 @@
         return rs.mElement_INT_4;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element U64_2(RenderScript rs) {
         if(rs.mElement_ULONG_2 == null) {
             rs.mElement_ULONG_2 = createVector(rs, DataType.UNSIGNED_64, 2);
@@ -784,8 +683,6 @@
         return rs.mElement_ULONG_2;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element U64_3(RenderScript rs) {
         if(rs.mElement_ULONG_3 == null) {
             rs.mElement_ULONG_3 = createVector(rs, DataType.UNSIGNED_64, 3);
@@ -793,8 +690,6 @@
         return rs.mElement_ULONG_3;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element U64_4(RenderScript rs) {
         if(rs.mElement_ULONG_4 == null) {
             rs.mElement_ULONG_4 = createVector(rs, DataType.UNSIGNED_64, 4);
@@ -802,8 +697,6 @@
         return rs.mElement_ULONG_4;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element I64_2(RenderScript rs) {
         if(rs.mElement_LONG_2 == null) {
             rs.mElement_LONG_2 = createVector(rs, DataType.SIGNED_64, 2);
@@ -811,8 +704,6 @@
         return rs.mElement_LONG_2;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element I64_3(RenderScript rs) {
         if(rs.mElement_LONG_3 == null) {
             rs.mElement_LONG_3 = createVector(rs, DataType.SIGNED_64, 3);
@@ -820,8 +711,6 @@
         return rs.mElement_LONG_3;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element I64_4(RenderScript rs) {
         if(rs.mElement_LONG_4 == null) {
             rs.mElement_LONG_4 = createVector(rs, DataType.SIGNED_64, 4);
@@ -829,22 +718,19 @@
         return rs.mElement_LONG_4;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element MATRIX_4X4(RenderScript rs) {
         if(rs.mElement_MATRIX_4X4 == null) {
             rs.mElement_MATRIX_4X4 = createUser(rs, DataType.MATRIX_4X4);
         }
         return rs.mElement_MATRIX_4X4;
     }
-    /** @deprecated renderscript is deprecated in J
-     */
+
+    /** @deprecated use MATRIX_4X4
+    */
     public static Element MATRIX4X4(RenderScript rs) {
         return MATRIX_4X4(rs);
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element MATRIX_3X3(RenderScript rs) {
         if(rs.mElement_MATRIX_3X3 == null) {
             rs.mElement_MATRIX_3X3 = createUser(rs, DataType.MATRIX_3X3);
@@ -852,8 +738,6 @@
         return rs.mElement_MATRIX_3X3;
     }
 
-    /** @deprecated renderscript is deprecated in J
-     */
     public static Element MATRIX_2X2(RenderScript rs) {
         if(rs.mElement_MATRIX_2X2 == null) {
             rs.mElement_MATRIX_2X2 = createUser(rs, DataType.MATRIX_2X2);
@@ -943,7 +827,7 @@
         updateVisibleSubElements();
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Create a custom Element of the specified DataType.  The DataKind will be
      * set to USER and the vector size to 1 indicating non-vector.
      *
@@ -959,7 +843,7 @@
         return new Element(id, rs, dt, dk, norm, vecSize);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Create a custom vector element of the specified DataType and vector size.
      * DataKind will be set to USER. Only primitive types (FLOAT_32, FLOAT_64,
      * SIGNED_8, SIGNED_16, SIGNED_32, SIGNED_64, UNSIGNED_8, UNSIGNED_16,
@@ -1003,7 +887,7 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Create a new pixel Element type.  A matching DataType and DataKind must
      * be provided.  The DataType and DataKind must contain the same number of
      * components.  Vector size will be set to 1.
@@ -1066,7 +950,7 @@
         return new Element(id, rs, dt, dk, norm, size);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Check if the current Element is compatible with another Element.
      * Primitive Elements are compatible if they share the same underlying
      * size and type (i.e. U8 is compatible with A_8). User-defined Elements
@@ -1093,7 +977,7 @@
                 (mVectorSize == e.mVectorSize));
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Builder class for producing complex elements with matching field and name
      * pairs.  The builder starts empty.  The order in which elements are added
      * is retained for the layout in memory.
@@ -1107,7 +991,7 @@
         int mCount;
         int mSkipPadding;
 
-        /** @deprecated renderscript is deprecated in J
+        /**
          * Create a builder object.
          *
          * @param rs
@@ -1120,7 +1004,7 @@
             mArraySizes = new int[8];
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
          * Add an array of elements to this element.
          *
          * @param element
@@ -1164,7 +1048,7 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
          * Add a single element to this Element.
          *
          * @param element
@@ -1174,7 +1058,7 @@
             return add(element, name, 1);
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
          * Create the element from this builder.
          *
          *
diff --git a/graphics/java/android/renderscript/FieldPacker.java b/graphics/java/android/renderscript/FieldPacker.java
index 9d36e33..a215a57 100644
--- a/graphics/java/android/renderscript/FieldPacker.java
+++ b/graphics/java/android/renderscript/FieldPacker.java
@@ -17,7 +17,7 @@
 package android.renderscript;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Utility class for packing arguments and structures from Android system objects to
  * Renderscript objects.
  *
diff --git a/graphics/java/android/renderscript/FileA3D.java b/graphics/java/android/renderscript/FileA3D.java
index 1158061..42b508b 100644
--- a/graphics/java/android/renderscript/FileA3D.java
+++ b/graphics/java/android/renderscript/FileA3D.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.
@@ -27,7 +27,8 @@
 import android.util.Log;
 import android.util.TypedValue;
 
-/** @deprecated renderscript is deprecated in J
+/**
+ * @deprecated in API 16
  * FileA3D allows users to load Renderscript objects from files
  * or resources stored on disk. It could be used to load items
  * such as 3D geometry data converted to a Renderscript format from
@@ -40,17 +41,20 @@
  **/
 public class FileA3D extends BaseObj {
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+    * @deprecated in API 16
     * Specifies what renderscript object type is contained within
     * the FileA3D IndexEntry
     **/
     public enum EntryType {
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Unknown or or invalid object, nothing will be loaded
         **/
         UNKNOWN (0),
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Renderscript Mesh object
         **/
         MESH (1);
@@ -65,7 +69,8 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+    * @deprecated in API 16
     * IndexEntry contains information about one of the Renderscript
     * objects inside the file's index. It could be used to query the
     * object's type and also name and load the object itself if
@@ -79,7 +84,8 @@
         EntryType mEntryType;
         BaseObj mLoadedObj;
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Returns the name of a renderscript object the index entry
         * describes
         *
@@ -91,7 +97,8 @@
             return mName;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Returns the type of a renderscript object the index entry
         * describes
         * @return type of a renderscript object the index entry
@@ -101,7 +108,8 @@
             return mEntryType;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Used to load the object described by the index entry
         * @return base renderscript object described by the entry
         */
@@ -111,7 +119,8 @@
             return obj;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Used to load the mesh described by the index entry, object
         * described by the index entry must be a renderscript mesh
         *
@@ -181,7 +190,8 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+    * @deprecated in API 16
     * Returns the number of objects stored inside the a3d file
     *
     * @return the number of objects stored inside the a3d file
@@ -193,7 +203,8 @@
         return mFileEntries.length;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+    * @deprecated in API 16
     * Returns an index entry from the list of all objects inside
     * FileA3D
     *
@@ -208,7 +219,8 @@
         return mFileEntries[index];
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+    * @deprecated in API 16
     * Creates a FileA3D object from an asset stored on disk
     *
     * @param rs Context to which the object will belong.
@@ -229,7 +241,8 @@
         return fa3d;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+    * @deprecated in API 16
     * Creates a FileA3D object from a file stored on disk
     *
     * @param rs Context to which the object will belong.
@@ -248,7 +261,8 @@
         return fa3d;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+    * @deprecated in API 16
     * Creates a FileA3D object from a file stored on disk
     *
     * @param rs Context to which the object will belong.
@@ -260,7 +274,8 @@
         return createFromFile(rs, path.getAbsolutePath());
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+    * @deprecated in API 16
     * Creates a FileA3D object from an application resource
     *
     * @param rs Context to which the object will belong.
diff --git a/graphics/java/android/renderscript/Float2.java b/graphics/java/android/renderscript/Float2.java
index a89a5df..1d4ce36 100644
--- a/graphics/java/android/renderscript/Float2.java
+++ b/graphics/java/android/renderscript/Float2.java
@@ -20,7 +20,7 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Class for exposing the native Renderscript float2 type back to the Android system.
  *
  **/
diff --git a/graphics/java/android/renderscript/Float3.java b/graphics/java/android/renderscript/Float3.java
index 909a897..ffd1135 100644
--- a/graphics/java/android/renderscript/Float3.java
+++ b/graphics/java/android/renderscript/Float3.java
@@ -20,7 +20,7 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Class for exposing the native Renderscript float2 type back to the Android system.
  *
  **/
diff --git a/graphics/java/android/renderscript/Float4.java b/graphics/java/android/renderscript/Float4.java
index 3be6dbc..c7cc3ae 100644
--- a/graphics/java/android/renderscript/Float4.java
+++ b/graphics/java/android/renderscript/Float4.java
@@ -20,7 +20,7 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Class for exposing the native Renderscript float2 type back to the Android system.
  *
  **/
diff --git a/graphics/java/android/renderscript/Font.java b/graphics/java/android/renderscript/Font.java
index cd1010c..8a49abb 100644
--- a/graphics/java/android/renderscript/Font.java
+++ b/graphics/java/android/renderscript/Font.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.
@@ -29,8 +29,9 @@
 import android.util.Log;
 import android.util.TypedValue;
 
-/** @deprecated renderscript is deprecated in J
- * <p>This class gives users a simple way to draw hardware accelerated text.
+/**
+ * @deprecated in API 16
+ * <p>This class gives users a simple way to draw hardware accelerated text. 
  * Internally, the glyphs are rendered using the Freetype library and an internal cache of
  * rendered glyph bitmaps is maintained. Each font object represents a combination of a typeface,
  * and point size. You can create multiple font objects to represent styles such as bold or italic text,
@@ -42,7 +43,7 @@
  * render large batches of text in sequence. It is also more efficient to render multiple
  * characters at once instead of one by one to improve draw call batching.</p>
  * <p>Font color and transparency are not part of the font object and you can freely modify
- * them in the script to suit the user's rendering needs. Font colors work as a state machine.
+ * them in the script to suit the user's rendering needs. Font colors work as a state machine. 
  * Every new call to draw text uses the last color set in the script.</p>
  **/
 public class Font extends BaseObj {
@@ -71,20 +72,25 @@
 
     private static Map<String, FontFamily> sFontFamilyMap;
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      */
     public enum Style {
-        /** @deprecated renderscript is deprecated in J
-        */
+        /**
+         * @deprecated in API 16
+         */
         NORMAL,
-        /** @deprecated renderscript is deprecated in J
-        */
+        /**
+         * @deprecated in API 16
+         */
         BOLD,
-        /** @deprecated renderscript is deprecated in J
-        */
+        /**
+         * @deprecated in API 16
+         */
         ITALIC,
-        /** @deprecated renderscript is deprecated in J
-        */
+        /**
+         * @deprecated in API 16
+         */
         BOLD_ITALIC;
     }
 
@@ -148,7 +154,8 @@
         super(id, rs);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Takes a specific file name as an argument
      */
     static public Font createFromFile(RenderScript rs, Resources res, String path, float pointSize) {
@@ -164,13 +171,15 @@
         return rsFont;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      */
     static public Font createFromFile(RenderScript rs, Resources res, File path, float pointSize) {
         return createFromFile(rs, res, path.getAbsolutePath(), pointSize);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      */
     static public Font createFromAsset(RenderScript rs, Resources res, String path, float pointSize) {
         rs.validate();
@@ -185,7 +194,8 @@
         return rsFont;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      */
     static public Font createFromResource(RenderScript rs, Resources res, int id, float pointSize) {
         String name = "R." + Integer.toString(id);
@@ -215,7 +225,8 @@
         return rsFont;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Accepts one of the following family names as an argument
      * and will attempt to produce the best match with a system font:
      *
diff --git a/graphics/java/android/renderscript/Int2.java b/graphics/java/android/renderscript/Int2.java
index 4e2d344..434af21 100644
--- a/graphics/java/android/renderscript/Int2.java
+++ b/graphics/java/android/renderscript/Int2.java
@@ -20,7 +20,7 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Class for exposing the native Renderscript int2 type back to the Android system.
  *
  **/
diff --git a/graphics/java/android/renderscript/Int3.java b/graphics/java/android/renderscript/Int3.java
index 1ffc129..333ccf8 100644
--- a/graphics/java/android/renderscript/Int3.java
+++ b/graphics/java/android/renderscript/Int3.java
@@ -20,7 +20,7 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Class for exposing the native Renderscript int3 type back to the Android system.
  *
  **/
diff --git a/graphics/java/android/renderscript/Int4.java b/graphics/java/android/renderscript/Int4.java
index 555d431..8734c95 100644
--- a/graphics/java/android/renderscript/Int4.java
+++ b/graphics/java/android/renderscript/Int4.java
@@ -20,7 +20,7 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Class for exposing the native Renderscript int4 type back to the Android system.
  *
  **/
diff --git a/graphics/java/android/renderscript/Long2.java b/graphics/java/android/renderscript/Long2.java
index aad6bd6..95ea18c 100644
--- a/graphics/java/android/renderscript/Long2.java
+++ b/graphics/java/android/renderscript/Long2.java
@@ -20,7 +20,7 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Class for exposing the native Renderscript long2 type back to the Android system.
  **/
 public class Long2 {
diff --git a/graphics/java/android/renderscript/Long3.java b/graphics/java/android/renderscript/Long3.java
index 9c03d5c..96ee885 100644
--- a/graphics/java/android/renderscript/Long3.java
+++ b/graphics/java/android/renderscript/Long3.java
@@ -20,7 +20,7 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Class for exposing the native Renderscript long3 type back to the Android system.
  **/
 public class Long3 {
diff --git a/graphics/java/android/renderscript/Long4.java b/graphics/java/android/renderscript/Long4.java
index 6611cdf..50e664c 100644
--- a/graphics/java/android/renderscript/Long4.java
+++ b/graphics/java/android/renderscript/Long4.java
@@ -20,7 +20,7 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Class for exposing the native Renderscript long4 type back to the Android system.
  **/
 public class Long4 {
diff --git a/graphics/java/android/renderscript/Matrix2f.java b/graphics/java/android/renderscript/Matrix2f.java
index 38b5316..acc5bd8 100644
--- a/graphics/java/android/renderscript/Matrix2f.java
+++ b/graphics/java/android/renderscript/Matrix2f.java
@@ -20,13 +20,13 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Class for exposing the native Renderscript rs_matrix2x2 type back to the Android system.
  *
  **/
 public class Matrix2f {
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Creates a new identity 2x2 matrix
     */
     public Matrix2f() {
@@ -34,7 +34,7 @@
         loadIdentity();
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Creates a new matrix and sets its values from the given
     * parameter
     *
@@ -46,7 +46,7 @@
         System.arraycopy(dataArray, 0, mMat, 0, mMat.length);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Return a reference to the internal array representing matrix
     * values. Modifying this array will also change the matrix
     *
@@ -56,7 +56,7 @@
         return mMat;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Returns the value for a given row and column
     *
     * @param i row of the value to return
@@ -68,7 +68,7 @@
         return mMat[i*2 + j];
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets the value for a given row and column
     *
     * @param i row of the value to set
@@ -78,7 +78,7 @@
         mMat[i*2 + j] = v;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets the matrix values to identity
     */
     public void loadIdentity() {
@@ -89,7 +89,7 @@
         mMat[3] = 1;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets the values of the matrix to those of the parameter
     *
     * @param src matrix to load the values from
@@ -98,7 +98,7 @@
         System.arraycopy(src.getArray(), 0, mMat, 0, mMat.length);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets current values to be a rotation matrix of given angle
     *
     * @param rot rotation angle
@@ -114,7 +114,7 @@
         mMat[3] = c;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets current values to be a scale matrix of given dimensions
     *
     * @param x scale component x
@@ -126,7 +126,7 @@
         mMat[3] = y;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets current values to be the result of multiplying two given
     * matrices
     *
@@ -147,7 +147,7 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Post-multiplies the current matrix by a given parameter
     *
     * @param rhs right hand side to multiply by
@@ -157,7 +157,7 @@
         tmp.loadMultiply(this, rhs);
         load(tmp);
     }
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Modifies the current matrix by post-multiplying it with a
     * rotation matrix of given angle
     *
@@ -168,7 +168,7 @@
         tmp.loadRotate(rot);
         multiply(tmp);
     }
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Modifies the current matrix by post-multiplying it with a
     * scale matrix of given dimensions
     *
@@ -180,7 +180,7 @@
         tmp.loadScale(x, y);
         multiply(tmp);
     }
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets the current matrix to its transpose
     */
     public void transpose() {
diff --git a/graphics/java/android/renderscript/Matrix3f.java b/graphics/java/android/renderscript/Matrix3f.java
index b821742..253506d 100644
--- a/graphics/java/android/renderscript/Matrix3f.java
+++ b/graphics/java/android/renderscript/Matrix3f.java
@@ -20,13 +20,13 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Class for exposing the native Renderscript rs_matrix3x3 type back to the Android system.
  *
  **/
 public class Matrix3f {
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Creates a new identity 3x3 matrix
     */
     public Matrix3f() {
@@ -34,7 +34,7 @@
         loadIdentity();
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Creates a new matrix and sets its values from the given
     * parameter
     *
@@ -46,7 +46,7 @@
         System.arraycopy(dataArray, 0, mMat, 0, mMat.length);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Return a reference to the internal array representing matrix
     * values. Modifying this array will also change the matrix
     *
@@ -56,7 +56,7 @@
         return mMat;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Returns the value for a given row and column
     *
     * @param i row of the value to return
@@ -68,7 +68,7 @@
         return mMat[i*3 + j];
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets the value for a given row and column
     *
     * @param i row of the value to set
@@ -78,7 +78,7 @@
         mMat[i*3 + j] = v;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets the matrix values to identity
     */
     public void loadIdentity() {
@@ -95,7 +95,7 @@
         mMat[8] = 1;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets the values of the matrix to those of the parameter
     *
     * @param src matrix to load the values from
@@ -104,7 +104,7 @@
         System.arraycopy(src.getArray(), 0, mMat, 0, mMat.length);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets current values to be a rotation matrix of certain angle
     * about a given axis
     *
@@ -144,7 +144,7 @@
         mMat[8] = z*z*nc +  c;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Makes the upper 2x2 a rotation matrix of the given angle
     *
     * @param rot rotation angle
@@ -161,7 +161,7 @@
         mMat[4] = c;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Makes the upper 2x2 a scale matrix of given dimensions
     *
     * @param x scale component x
@@ -173,7 +173,7 @@
         mMat[4] = y;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets current values to be a scale matrix of given dimensions
     *
     * @param x scale component x
@@ -187,7 +187,7 @@
         mMat[8] = z;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets current values to be a translation matrix of given
     * dimensions
     *
@@ -200,7 +200,7 @@
         mMat[7] = y;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets current values to be the result of multiplying two given
     * matrices
     *
@@ -224,7 +224,7 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Post-multiplies the current matrix by a given parameter
     *
     * @param rhs right hand side to multiply by
@@ -235,7 +235,7 @@
         load(tmp);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Modifies the current matrix by post-multiplying it with a
     * rotation matrix of certain angle about a given axis
     *
@@ -250,7 +250,7 @@
         multiply(tmp);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Modifies the upper 2x2 of the current matrix by
     * post-multiplying it with a rotation matrix of given angle
     *
@@ -262,7 +262,7 @@
         multiply(tmp);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Modifies the upper 2x2 of the current matrix by
     * post-multiplying it with a scale matrix of given dimensions
     *
@@ -275,7 +275,7 @@
         multiply(tmp);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Modifies the current matrix by post-multiplying it with a
     * scale matrix of given dimensions
     *
@@ -289,7 +289,7 @@
         multiply(tmp);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Modifies the current matrix by post-multiplying it with a
     * translation matrix of given dimensions
     *
@@ -302,7 +302,7 @@
         multiply(tmp);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets the current matrix to its transpose
     */
     public void transpose() {
diff --git a/graphics/java/android/renderscript/Matrix4f.java b/graphics/java/android/renderscript/Matrix4f.java
index 8b7a0df..adc1806 100644
--- a/graphics/java/android/renderscript/Matrix4f.java
+++ b/graphics/java/android/renderscript/Matrix4f.java
@@ -20,13 +20,13 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Class for exposing the native Renderscript rs_matrix4x4 type back to the Android system.
  *
  **/
 public class Matrix4f {
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Creates a new identity 4x4 matrix
     */
     public Matrix4f() {
@@ -34,7 +34,7 @@
         loadIdentity();
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Creates a new matrix and sets its values from the given
     * parameter
     *
@@ -46,7 +46,7 @@
         System.arraycopy(dataArray, 0, mMat, 0, mMat.length);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Return a reference to the internal array representing matrix
     * values. Modifying this array will also change the matrix
     *
@@ -56,7 +56,7 @@
         return mMat;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Returns the value for a given row and column
     *
     * @param i row of the value to return
@@ -68,7 +68,7 @@
         return mMat[i*4 + j];
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets the value for a given row and column
     *
     * @param i row of the value to set
@@ -78,7 +78,7 @@
         mMat[i*4 + j] = v;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets the matrix values to identity
     */
     public void loadIdentity() {
@@ -103,7 +103,7 @@
         mMat[15] = 1;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets the values of the matrix to those of the parameter
     *
     * @param src matrix to load the values from
@@ -112,7 +112,7 @@
         System.arraycopy(src.getArray(), 0, mMat, 0, mMat.length);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets current values to be a rotation matrix of certain angle
     * about a given axis
     *
@@ -159,7 +159,7 @@
         mMat[10] = z*z*nc +  c;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets current values to be a scale matrix of given dimensions
     *
     * @param x scale component x
@@ -173,7 +173,7 @@
         mMat[10] = z;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets current values to be a translation matrix of given
     * dimensions
     *
@@ -188,7 +188,7 @@
         mMat[14] = z;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets current values to be the result of multiplying two given
     * matrices
     *
@@ -215,7 +215,7 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Set current values to be an orthographic projection matrix
     *
     * @param l location of the left vertical clipping plane
@@ -235,7 +235,7 @@
         mMat[14]= -(f + n) / (f - n);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Set current values to be an orthographic projection matrix
     * with the right and bottom clipping planes set to the given
     * values. Left and top clipping planes are set to 0. Near and
@@ -249,7 +249,7 @@
         loadOrtho(0,w, h,0, -1,1);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets current values to be a perspective projection matrix
     *
     * @param l location of the left vertical clipping plane
@@ -272,7 +272,7 @@
         mMat[15]= 0;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets current values to be a perspective projection matrix
     *
     * @param fovy vertical field of view angle in degrees
@@ -288,7 +288,7 @@
         loadFrustum(left, right, bottom, top, near, far);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Helper function to set the current values to a perspective
     * projection matrix with aspect ratio defined by the parameters
     * and (near, far), (bottom, top) mapping to (-1, 1) at z = 0
@@ -321,7 +321,7 @@
         load(m1);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Post-multiplies the current matrix by a given parameter
     *
     * @param rhs right hand side to multiply by
@@ -331,7 +331,7 @@
         tmp.loadMultiply(this, rhs);
         load(tmp);
     }
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Modifies the current matrix by post-multiplying it with a
     * rotation matrix of certain angle about a given axis
     *
@@ -346,7 +346,7 @@
         multiply(tmp);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Modifies the current matrix by post-multiplying it with a
     * scale matrix of given dimensions
     *
@@ -360,7 +360,7 @@
         multiply(tmp);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Modifies the current matrix by post-multiplying it with a
     * translation matrix of given dimensions
     *
@@ -392,7 +392,7 @@
         return cofactor;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets the current matrix to its inverse
     */
     public boolean inverse() {
@@ -421,7 +421,7 @@
         return true;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets the current matrix to its inverse transpose
     */
     public boolean inverseTranspose() {
@@ -449,7 +449,7 @@
         return true;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Sets the current matrix to its transpose
     */
     public void transpose() {
diff --git a/graphics/java/android/renderscript/Mesh.java b/graphics/java/android/renderscript/Mesh.java
index bc32038..7210513 100644
--- a/graphics/java/android/renderscript/Mesh.java
+++ b/graphics/java/android/renderscript/Mesh.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.
@@ -20,7 +20,8 @@
 
 import android.util.Log;
 
-/** @deprecated renderscript is deprecated in J
+/**
+ * @deprecated in API 16
  * <p>This class is a container for geometric data displayed with
  * Renderscript. Internally, a mesh is a collection of allocations that
  * represent vertex data (positions, normals, texture
@@ -39,34 +40,41 @@
  **/
 public class Mesh extends BaseObj {
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+    * @deprecated in API 16
     * Describes the way mesh vertex data is interpreted when rendering
     *
     **/
     public enum Primitive {
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Vertex data will be rendered as a series of points
         */
         POINT (0),
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Vertex pairs will be rendered as lines
         */
         LINE (1),
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Vertex data will be rendered as a connected line strip
         */
         LINE_STRIP (2),
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Vertices will be rendered as individual triangles
         */
         TRIANGLE (3),
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Vertices will be rendered as a connected triangle strip
         * defined by the first three vertices with each additional
         * triangle defined by a new vertex
         */
         TRIANGLE_STRIP (4),
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Vertices will be rendered as a sequence of triangles that all
         * share first vertex as the origin
         */
@@ -86,7 +94,8 @@
         super(id, rs);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+    * @deprecated in API 16
     * @return number of allocations containing vertex data
     *
     **/
@@ -96,7 +105,8 @@
         }
         return mVertexBuffers.length;
     }
-    /** @deprecated renderscript is deprecated in J
+    /**
+    * @deprecated in API 16
     * @param slot index in the list of allocations to return
     * @return vertex data allocation at the given index
     *
@@ -105,7 +115,8 @@
         return mVertexBuffers[slot];
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+    * @deprecated in API 16
     * @return number of primitives or index sets in the mesh
     *
     **/
@@ -116,7 +127,8 @@
         return mIndexBuffers.length;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+    * @deprecated in API 16
     * @param slot locaton within the list of index set allocation
     * @return allocation containing primtive index data or null if
     *         the index data is not specified explicitly
@@ -125,7 +137,8 @@
     public Allocation getIndexSetAllocation(int slot) {
         return mIndexBuffers[slot];
     }
-    /** @deprecated renderscript is deprecated in J
+    /**
+    * @deprecated in API 16
     * @param slot locaiton within the list of index set primitives
     * @return index set primitive type
     *
@@ -167,7 +180,8 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+    * @deprecated in API 16
     * Mesh builder object. It starts empty and requires you to
     * add the types necessary to create vertex and index
     * allocations.
@@ -189,7 +203,8 @@
         Entry[] mVertexTypes;
         Vector mIndexTypes;
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Creates builder object
         * @param rs Context to which the mesh will belong.
         * @param usage specifies how the mesh allocations are to be
@@ -204,7 +219,8 @@
             mIndexTypes = new Vector();
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * @return internal index of the last vertex buffer type added to
         *         builder
         **/
@@ -212,7 +228,8 @@
             return mVertexTypeCount - 1;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * @return internal index of the last index set added to the
         *         builder
         **/
@@ -220,7 +237,8 @@
             return mIndexTypes.size() - 1;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Adds a vertex data type to the builder object
         *
         * @param t type of the vertex data allocation to be created
@@ -239,7 +257,8 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Adds a vertex data type to the builder object
         *
         * @param e element describing the vertex data layout
@@ -260,7 +279,8 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Adds an index set data type to the builder object
         *
         * @param t type of the index set data, could be null
@@ -278,7 +298,8 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Adds an index set primitive type to the builder object
         *
         * @param p primitive type
@@ -295,7 +316,8 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Adds an index set data type to the builder object
         *
         * @param e element describing the index set data layout
@@ -320,7 +342,8 @@
             return tb.create();
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Create a Mesh object from the current state of the builder
         *
         **/
@@ -372,7 +395,8 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+    * @deprecated in API 16
     * Mesh builder object. It starts empty and requires the user to
     * add all the vertex and index allocations that comprise the
     * mesh
@@ -391,8 +415,9 @@
 
         Vector mIndexTypes;
 
-        /** @deprecated renderscript is deprecated in J
-        */
+        /**
+        * @deprecated in API 16
+        **/
         public AllocationBuilder(RenderScript rs) {
             mRS = rs;
             mVertexTypeCount = 0;
@@ -400,7 +425,8 @@
             mIndexTypes = new Vector();
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * @return internal index of the last vertex buffer type added to
         *         builder
         **/
@@ -408,7 +434,8 @@
             return mVertexTypeCount - 1;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * @return internal index of the last index set added to the
         *         builder
         **/
@@ -416,7 +443,8 @@
             return mIndexTypes.size() - 1;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Adds an allocation containing vertex buffer data to the
         * builder
         *
@@ -435,7 +463,8 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Adds an allocation containing index buffer data and index type
         * to the builder
         *
@@ -452,7 +481,8 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Adds an index set type to the builder
         *
         * @param p index set primitive type
@@ -467,7 +497,8 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Create a Mesh object from the current state of the builder
         *
         **/
@@ -508,7 +539,8 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+    * @deprecated in API 16
     * Builder that allows creation of a mesh object point by point
     * and triangle by triangle
     *
@@ -535,17 +567,21 @@
         int mVtxSize;
         int mFlags;
 
-        /** @deprecated renderscript is deprecated in J
-        */
+        /**
+        * @deprecated in API 16
+        **/
         public static final int COLOR = 0x0001;
-        /** @deprecated renderscript is deprecated in J
-        */
+        /**
+        * @deprecated in API 16
+        **/
         public static final int NORMAL = 0x0002;
-        /** @deprecated renderscript is deprecated in J
-        */
+        /**
+        * @deprecated in API 16
+        **/
         public static final int TEXTURE_0 = 0x0100;
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * @param rs Context to which the mesh will belong.
         * @param vtxSize specifies whether the vertex is a float2 or
         *                float3
@@ -600,7 +636,8 @@
             mMaxIndex ++;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Adds a float2 vertex to the mesh
         *
         * @param x position x
@@ -620,7 +657,8 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Adds a float3 vertex to the mesh
         *
         * @param x position x
@@ -643,7 +681,8 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Sets the texture coordinate for the vertices that are added after this method call.
         *
         * @param s texture coordinate s
@@ -660,7 +699,8 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Sets the normal vector for the vertices that are added after this method call.
         *
         * @param x normal vector x
@@ -679,7 +719,8 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Sets the color for the vertices that are added after this method call.
         *
         * @param r red component
@@ -700,7 +741,8 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Adds a new triangle to the mesh builder
         *
         * @param idx1 index of the first vertex in the triangle
@@ -726,7 +768,8 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Creates the mesh object from the current state of the builder
         *
         * @param uploadToBufferObject specifies whether the vertex data
diff --git a/graphics/java/android/renderscript/Path.java b/graphics/java/android/renderscript/Path.java
index ec34d7c..9c4d41b 100644
--- a/graphics/java/android/renderscript/Path.java
+++ b/graphics/java/android/renderscript/Path.java
@@ -19,7 +19,7 @@
 import java.util.Vector;
 import android.util.Log;
 
-/** @deprecated renderscript is deprecated in J
+/**
  * @hide
  *
  */
diff --git a/graphics/java/android/renderscript/Program.java b/graphics/java/android/renderscript/Program.java
index 16186fa..d9f64c6 100644
--- a/graphics/java/android/renderscript/Program.java
+++ b/graphics/java/android/renderscript/Program.java
@@ -25,7 +25,7 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  *
  * Program is a base class for all the objects that modify
  * various stages of the graphics pipeline
@@ -37,18 +37,14 @@
     static final int MAX_CONSTANT = 8;
     static final int MAX_TEXTURE = 8;
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      *
      * TextureType specifies what textures are attached to Program
      * objects
      *
      **/
     public enum TextureType {
-        /** @deprecated renderscript is deprecated in J
-        */
         TEXTURE_2D (0),
-        /** @deprecated renderscript is deprecated in J
-        */
         TEXTURE_CUBE (1);
 
         int mID;
@@ -81,7 +77,7 @@
         super(id, rs);
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
      * Program object can have zero or more constant allocations
      * associated with it. This method returns the total count.
      * @return number of constant input types
@@ -90,7 +86,7 @@
         return mConstants != null ? mConstants.length : 0;
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
      * Returns the type of the constant buffer used in the program
      * object. It could be used to query internal elements or create
      * an allocation to store constant data.
@@ -104,7 +100,7 @@
         return mConstants[slot];
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
      * Returns the number of textures used in this program object
      * @return number of texture inputs
      */
@@ -112,7 +108,7 @@
         return mTextureCount;
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
      * Returns the type of texture at a given slot. e.g. 2D or Cube
      * @param slot index of the texture input
      * @return texture input type
@@ -124,7 +120,7 @@
         return mTextures[slot];
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
      * Returns the name of the texture input at a given slot. e.g.
      * tex0, diffuse, spec
      * @param slot index of the texture input
@@ -137,7 +133,7 @@
         return mTextureNames[slot];
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Binds a constant buffer to be used as uniform inputs to the
      * program
      *
@@ -157,7 +153,7 @@
         mRS.nProgramBindConstants(getID(mRS), slot, id);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Binds a texture to be used in the program
      *
      * @param va allocation containing texture data
@@ -179,7 +175,7 @@
         mRS.nProgramBindTexture(getID(mRS), slot, id);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Binds an object that describes how a texture at the
      * corresponding location is sampled
      *
@@ -214,8 +210,7 @@
         int mTextureCount;
         String mShader;
 
-        /** @deprecated renderscript is deprecated in J
-        */
+
         protected BaseProgramBuilder(RenderScript rs) {
             mRS = rs;
             mInputs = new Element[MAX_INPUT];
@@ -229,7 +224,7 @@
             mTextureNames = new String[MAX_TEXTURE];
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
          * Sets the GLSL shader code to be used in the program
          *
          * @param s GLSL shader string
@@ -240,7 +235,7 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
          * Sets the GLSL shader code to be used in the program
          *
          * @param resources application resources
@@ -286,7 +281,7 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
          * Queries the index of the last added constant buffer type
          *
          */
@@ -294,7 +289,7 @@
             return mConstantCount - 1;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
          * Queries the index of the last added texture type
          *
          */
@@ -302,7 +297,7 @@
             return mTextureCount - 1;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
          * Adds constant (uniform) inputs to the program
          *
          * @param t Type that describes the layout of the Allocation
@@ -322,7 +317,7 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
          * Adds a texture input to the Program
          *
          * @param texType describes that the texture to append it (2D,
@@ -334,7 +329,7 @@
             return this;
         }
 
-        /** @hide renderscript is deprecated in J
+        /**
          * Adds a texture input to the Program
          *
          * @param texType describes that the texture to append it (2D,
@@ -354,8 +349,6 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
-        */
         protected void initProgram(Program p) {
             p.mInputs = new Element[mInputCount];
             System.arraycopy(mInputs, 0, p.mInputs, 0, mInputCount);
diff --git a/graphics/java/android/renderscript/ProgramFragment.java b/graphics/java/android/renderscript/ProgramFragment.java
index 0427c19..69968ac 100644
--- a/graphics/java/android/renderscript/ProgramFragment.java
+++ b/graphics/java/android/renderscript/ProgramFragment.java
@@ -20,7 +20,8 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
+ * @deprecated in API 16
  * <p>The Renderscript fragment program, also known as 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
@@ -41,8 +42,12 @@
         super(id, rs);
     }
 
+    /**
+     * @deprecated in API 16
+     */
     public static class Builder extends BaseProgramBuilder {
-        /** @deprecated renderscript is deprecated in J
+        /**
+         * @deprecated in API 16
          * Create a builder object.
          *
          * @param rs Context to which the program will belong.
@@ -51,7 +56,8 @@
             super(rs);
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+         * @deprecated in API 16
          * Creates ProgramFragment from the current state of the builder
          *
          * @return  ProgramFragment
diff --git a/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java b/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java
index 19fca58..848c5a3 100644
--- a/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java
+++ b/graphics/java/android/renderscript/ProgramFragmentFixedFunction.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.
@@ -20,7 +20,8 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
+ * @deprecated in API 16
  * <p>ProgramFragmentFixedFunction is a helper class that provides
  * a way to make a simple fragment shader without writing any
  * GLSL code. This class allows for display of constant color, interpolated
@@ -34,11 +35,15 @@
     }
 
     static class InternalBuilder extends BaseProgramBuilder {
+        /**
+         * @deprecated in API 16
+         */
         public InternalBuilder(RenderScript rs) {
             super(rs);
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+         * @deprecated in API 16
          * Creates ProgramFragmentFixedFunction from the current state
          * of the builder
          *
@@ -75,9 +80,13 @@
         }
     }
 
+    /**
+     * @deprecated in API 16
+     */
     public static class Builder {
-        /** @deprecated renderscript is deprecated in J
-        */
+        /**
+         * @deprecated in API 16
+         */
         public static final int MAX_TEXTURE = 2;
         int mNumTextures;
         boolean mPointSpriteEnable;
@@ -85,20 +94,24 @@
         String mShader;
         RenderScript mRS;
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+         * @deprecated in API 16
          * EnvMode describes how textures are combined with the existing
          * color in the fixed function fragment shader
          *
          **/
         public enum EnvMode {
-            /** @deprecated renderscript is deprecated in J
-            */
+            /**
+             * @deprecated in API 16
+             **/
             REPLACE (1),
-            /** @deprecated renderscript is deprecated in J
-            */
+            /**
+             * @deprecated in API 16
+             **/
             MODULATE (2),
-            /** @deprecated renderscript is deprecated in J
-            */
+            /**
+             * @deprecated in API 16
+             **/
             DECAL (3);
 
             int mID;
@@ -107,23 +120,28 @@
             }
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+         * @deprecated in API 16
          * Format describes the pixel format of textures in the fixed
          * function fragment shader and how they are sampled
          *
          **/
         public enum Format {
-            /** @deprecated renderscript is deprecated in J
-            */
+            /**
+             * @deprecated in API 16
+             **/
             ALPHA (1),
-            /** @deprecated renderscript is deprecated in J
-            */
+            /**
+             * @deprecated in API 16
+             **/
             LUMINANCE_ALPHA (2),
-            /** @deprecated renderscript is deprecated in J
-            */
+            /**
+             * @deprecated in API 16
+             **/
             RGB (3),
-            /** @deprecated renderscript is deprecated in J
-            */
+            /**
+             * @deprecated in API 16
+             **/
             RGBA (4);
 
             int mID;
@@ -206,7 +224,8 @@
             mShader += "}\n";
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+         * @deprecated
          * Creates a builder for fixed function fragment program
          *
          * @param rs Context to which the program will belong.
@@ -217,7 +236,8 @@
             mPointSpriteEnable = false;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+         * @deprecated in API 16
          * Adds a texture to be fetched as part of the fixed function
          * fragment program
          *
@@ -239,7 +259,8 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+         * @deprecated in API 16
          * Specifies whether the texture coordinate passed from the
          * vertex program is replaced with an openGL internal point
          * sprite texture coordinate
@@ -250,7 +271,8 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+         * @deprecated in API 16
          * Specifies whether the varying color passed from the vertex
          * program or the constant color set on the fragment program is
          * used in the final color calculation in the fixed function
@@ -262,7 +284,8 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+         * @deprecated in API 16
         * Creates the fixed function fragment program from the current
         * state of the builder.
         *
diff --git a/graphics/java/android/renderscript/ProgramRaster.java b/graphics/java/android/renderscript/ProgramRaster.java
index 26fcafe..c44521b 100644
--- a/graphics/java/android/renderscript/ProgramRaster.java
+++ b/graphics/java/android/renderscript/ProgramRaster.java
@@ -20,23 +20,28 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
+ * @deprecated in API 16
  * Program raster is primarily used to specify whether point sprites are enabled and to control
  * the culling mode. By default, back faces are culled.
  **/
 public class ProgramRaster extends BaseObj {
 
-    /** @deprecated renderscript is deprecated in J
-     */
+    /**
+     * @deprecated in API 16
+     **/
     public enum CullMode {
-        /** @deprecated renderscript is deprecated in J
-        */
+        /**
+         * @deprecated in API 16
+         **/
         BACK (0),
-        /** @deprecated renderscript is deprecated in J
-        */
+        /**
+         * @deprecated in API 16
+         **/
         FRONT (1),
-        /** @deprecated renderscript is deprecated in J
-        */
+        /**
+         * @deprecated in API 16
+         **/
         NONE (2);
 
         int mID;
@@ -55,7 +60,8 @@
         mCullMode = CullMode.BACK;
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Specifies whether vertices are rendered as screen aligned
      * elements of a specified size
      * @return whether point sprites are enabled
@@ -64,7 +70,8 @@
         return mPointSprite;
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Specifies how triangles are culled based on their orientation
      * @return cull mode
      */
@@ -72,7 +79,8 @@
         return mCullMode;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      */
     public static ProgramRaster CULL_BACK(RenderScript rs) {
         if(rs.mProgramRaster_CULL_BACK == null) {
@@ -83,7 +91,8 @@
         return rs.mProgramRaster_CULL_BACK;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      */
     public static ProgramRaster CULL_FRONT(RenderScript rs) {
         if(rs.mProgramRaster_CULL_FRONT == null) {
@@ -94,7 +103,8 @@
         return rs.mProgramRaster_CULL_FRONT;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      */
     public static ProgramRaster CULL_NONE(RenderScript rs) {
         if(rs.mProgramRaster_CULL_NONE == null) {
@@ -105,37 +115,42 @@
         return rs.mProgramRaster_CULL_NONE;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      */
     public static class Builder {
         RenderScript mRS;
         boolean mPointSprite;
         CullMode mCullMode;
 
-        /** @deprecated renderscript is deprecated in J
-        */
+        /**
+         * @deprecated in API 16
+         */
         public Builder(RenderScript rs) {
             mRS = rs;
             mPointSprite = false;
             mCullMode = CullMode.BACK;
         }
 
-        /** @deprecated renderscript is deprecated in J
-        */
+        /**
+         * @deprecated in API 16
+         */
         public Builder setPointSpriteEnabled(boolean enable) {
             mPointSprite = enable;
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
-        */
+        /**
+         * @deprecated in API 16
+         */
         public Builder setCullMode(CullMode m) {
             mCullMode = m;
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
-        */
+        /**
+         * @deprecated in API 16
+         */
         public ProgramRaster create() {
             mRS.validate();
             int id = mRS.nProgramRasterCreate(mPointSprite, mCullMode.mID);
diff --git a/graphics/java/android/renderscript/ProgramStore.java b/graphics/java/android/renderscript/ProgramStore.java
index 20043f2..d0fd6e5 100644
--- a/graphics/java/android/renderscript/ProgramStore.java
+++ b/graphics/java/android/renderscript/ProgramStore.java
@@ -20,7 +20,7 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * <p>ProgramStore contains a set of parameters that control how
  * the graphics hardware handles writes to the framebuffer.
  * It could be used to:</p>
@@ -35,7 +35,7 @@
  *
  **/
 public class ProgramStore extends BaseObj {
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Specifies the function used to determine whether a fragment
     * will be drawn during the depth testing stage in the rendering
     * pipeline by comparing its value with that already in the depth
@@ -44,36 +44,36 @@
     */
     public enum DepthFunc {
 
-        /** @deprecated renderscript is deprecated in J
+        /**
         * Always drawn
         */
         ALWAYS (0),
-        /** @deprecated renderscript is deprecated in J
+        /**
         * Drawn if the incoming depth value is less than that in the
         * depth buffer
         */
         LESS (1),
-        /** @deprecated renderscript is deprecated in J
+        /**
         * Drawn if the incoming depth value is less or equal to that in
         * the depth buffer
         */
         LESS_OR_EQUAL (2),
-        /** @deprecated renderscript is deprecated in J
+        /**
         * Drawn if the incoming depth value is greater than that in the
         * depth buffer
         */
         GREATER (3),
-        /** @deprecated renderscript is deprecated in J
+        /**
         * Drawn if the incoming depth value is greater or equal to that
         * in the depth buffer
         */
         GREATER_OR_EQUAL (4),
-        /** @deprecated renderscript is deprecated in J
+        /**
         * Drawn if the incoming depth value is equal to that in the
         * depth buffer
         */
         EQUAL (5),
-        /** @deprecated renderscript is deprecated in J
+        /**
         * Drawn if the incoming depth value is not equal to that in the
         * depth buffer
         */
@@ -85,7 +85,7 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Specifies the functions used to combine incoming pixels with
     * those already in the frame buffer.
     *
@@ -94,32 +94,14 @@
     *
     */
     public enum BlendSrcFunc {
-        /** @deprecated renderscript is deprecated in J
-        */
         ZERO (0),
-        /** @deprecated renderscript is deprecated in J
-        */
         ONE (1),
-        /** @deprecated renderscript is deprecated in J
-        */
         DST_COLOR (2),
-        /** @deprecated renderscript is deprecated in J
-        */
         ONE_MINUS_DST_COLOR (3),
-        /** @deprecated renderscript is deprecated in J
-        */
         SRC_ALPHA (4),
-        /** @deprecated renderscript is deprecated in J
-        */
         ONE_MINUS_SRC_ALPHA (5),
-        /** @deprecated renderscript is deprecated in J
-        */
         DST_ALPHA (6),
-        /** @deprecated renderscript is deprecated in J
-        */
         ONE_MINUS_DST_ALPHA (7),
-        /** @deprecated renderscript is deprecated in J
-        */
         SRC_ALPHA_SATURATE (8);
 
         int mID;
@@ -128,7 +110,7 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Specifies the functions used to combine incoming pixels with
     * those already in the frame buffer.
     *
@@ -138,29 +120,13 @@
     *
     */
     public enum BlendDstFunc {
-        /** @deprecated renderscript is deprecated in J
-        */
         ZERO (0),
-        /** @deprecated renderscript is deprecated in J
-        */
         ONE (1),
-        /** @deprecated renderscript is deprecated in J
-        */
         SRC_COLOR (2),
-        /** @deprecated renderscript is deprecated in J
-        */
         ONE_MINUS_SRC_COLOR (3),
-        /** @deprecated renderscript is deprecated in J
-        */
         SRC_ALPHA (4),
-        /** @deprecated renderscript is deprecated in J
-        */
         ONE_MINUS_SRC_ALPHA (5),
-        /** @deprecated renderscript is deprecated in J
-        */
         DST_ALPHA (6),
-        /** @deprecated renderscript is deprecated in J
-        */
         ONE_MINUS_DST_ALPHA (7);
 
         int mID;
@@ -183,7 +149,7 @@
         super(id, rs);
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
     * Returns the function used to test writing into the depth
     * buffer
     * @return depth function
@@ -192,7 +158,7 @@
         return mDepthFunc;
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
     * Queries whether writes are enabled into the depth buffer
     * @return depth mask
     */
@@ -200,7 +166,7 @@
         return mDepthMask;
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
     * Queries whether red channel is written
     * @return red color channel mask
     */
@@ -208,7 +174,7 @@
         return mColorMaskR;
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
     * Queries whether green channel is written
     * @return green color channel mask
     */
@@ -216,7 +182,7 @@
         return mColorMaskG;
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
     * Queries whether blue channel is written
     * @return blue color channel mask
     */
@@ -224,7 +190,7 @@
         return mColorMaskB;
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
     * Queries whether alpha channel is written
     * @return alpha channel mask
     */
@@ -232,7 +198,7 @@
         return mColorMaskA;
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
     * Specifies how the source blending factor is computed
     * @return source blend function
     */
@@ -240,7 +206,7 @@
         return mBlendSrc;
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
     * Specifies how the destination blending factor is computed
     * @return destination blend function
     */
@@ -248,7 +214,7 @@
         return mBlendDst;
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
     * Specifies whether colors are dithered before writing into the
     * framebuffer
     * @return whether dither is enabled
@@ -257,7 +223,7 @@
         return mDither;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Returns a pre-defined program store object with the following
     * characteristics:
     *  - incoming pixels are drawn if their depth value is less than
@@ -279,7 +245,7 @@
         }
         return rs.mProgramStore_BLEND_NONE_DEPTH_TEST;
     }
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Returns a pre-defined program store object with the following
     * characteristics:
     *  - incoming pixels always pass the depth test and their value
@@ -300,7 +266,7 @@
         }
         return rs.mProgramStore_BLEND_NONE_DEPTH_NO_DEPTH;
     }
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Returns a pre-defined program store object with the following
     * characteristics:
     *  - incoming pixels are drawn if their depth value is less than
@@ -324,7 +290,7 @@
         }
         return rs.mProgramStore_BLEND_ALPHA_DEPTH_TEST;
     }
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Returns a pre-defined program store object with the following
     * characteristics:
     *  - incoming pixels always pass the depth test and their value
@@ -347,7 +313,7 @@
         return rs.mProgramStore_BLEND_ALPHA_DEPTH_NO_DEPTH;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
     * Builder class for ProgramStore object. If the builder is left
     * empty, the equivalent of BLEND_NONE_DEPTH_NONE would be
     * returned
@@ -376,7 +342,7 @@
             mBlendDst = BlendDstFunc.ZERO;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
         * Specifies the depth testing behavior
         *
         * @param func function used for depth testing
@@ -388,7 +354,7 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
         * Enables writes into the depth buffer
         *
         * @param enable specifies whether depth writes are
@@ -401,7 +367,7 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
         * Enables writes into the color buffer
         *
         * @param r specifies whether red channel is written
@@ -419,7 +385,7 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
         * Specifies how incoming pixels are combined with the pixels
         * stored in the framebuffer
         *
@@ -436,7 +402,7 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
         * Enables dithering
         *
         * @param enable specifies whether dithering is enabled or
@@ -449,7 +415,7 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
         * Creates a program store from the current state of the builder
         */
         public ProgramStore create() {
diff --git a/graphics/java/android/renderscript/ProgramVertex.java b/graphics/java/android/renderscript/ProgramVertex.java
index c13b9b0..2bd5124 100644
--- a/graphics/java/android/renderscript/ProgramVertex.java
+++ b/graphics/java/android/renderscript/ProgramVertex.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
- /** @deprecated renderscript is deprecated in J
+ /**
  * <p>The Renderscript vertex program, also known as a vertex shader, describes a stage in
  * the graphics pipeline responsible for manipulating geometric data in a user-defined way.
  * The object is constructed by providing the Renderscript system with the following data:</p>
@@ -42,7 +42,8 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
+ * @deprecated in API 16
  * ProgramVertex, also know as a vertex shader, describes a
  * stage in the graphics pipeline responsible for manipulating
  * geometric data in a user-defined way.
@@ -54,14 +55,16 @@
         super(id, rs);
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * @return number of input attribute elements
      */
     public int getInputCount() {
         return mInputs != null ? mInputs.length : 0;
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * @param slot location of the input to return
      * @return input attribute element
      */
@@ -72,7 +75,8 @@
         return mInputs[slot];
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+    * @deprecated in API 16
     * Builder class for creating ProgramVertex objects.
     * The builder starts empty and the user must minimally provide
     * the GLSL shader code, and the varying inputs. Constant, or
@@ -81,7 +85,8 @@
     *
     **/
     public static class Builder extends BaseProgramBuilder {
-        /** @deprecated renderscript is deprecated in J
+        /**
+         * @deprecated in API 16
          * Create a builder object.
          *
          * @param rs Context to which the program will belong.
@@ -90,7 +95,8 @@
             super(rs);
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+         * @deprecated in API 16
          * Add varying inputs to the program
          *
          * @param e element describing the layout of the varying input
@@ -109,7 +115,8 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+         * @deprecated in API 16
          * Creates ProgramVertex from the current state of the builder
          *
          * @return  ProgramVertex
diff --git a/graphics/java/android/renderscript/ProgramVertexFixedFunction.java b/graphics/java/android/renderscript/ProgramVertexFixedFunction.java
index 97444db..88cade4 100644
--- a/graphics/java/android/renderscript/ProgramVertexFixedFunction.java
+++ b/graphics/java/android/renderscript/ProgramVertexFixedFunction.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.
@@ -21,7 +21,8 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
+ * @deprecated in API 16
  * ProgramVertexFixedFunction is a helper class that provides a
  * simple way to create a fixed function emulation vertex shader
  * without writing any GLSL code.
@@ -33,7 +34,8 @@
         super(id, rs);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Binds the constant buffer containing fixed function emulation
      * matrices
      *
@@ -45,10 +47,16 @@
     }
 
     static class InternalBuilder extends BaseProgramBuilder {
+        /**
+         * @deprecated in API 16
+         */
         public InternalBuilder(RenderScript rs) {
             super(rs);
         }
 
+        /**
+         * @deprecated in API 16
+         */
         public InternalBuilder addInput(Element e) throws IllegalStateException {
             // Should check for consistant and non-conflicting names...
             if(mInputCount >= MAX_INPUT) {
@@ -61,7 +69,8 @@
             return this;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+         * @deprecated in API 16
          * Creates ProgramVertexFixedFunction from the current state of
          * the builder
          *
@@ -98,12 +107,16 @@
         }
     }
 
+    /**
+     * @deprecated in API 16
+     */
     public static class Builder {
         boolean mTextureMatrixEnable;
         String mShader;
         RenderScript mRS;
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+         * @deprecated in API 16
          * Creates a builder for fixed function vertex program
          *
          * @param rs Context to which the program will belong.
@@ -112,7 +125,8 @@
             mRS = rs;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+         * @deprecated in API 16
          * Specifies whether texture matrix calculations are to be added
          * to the shader
          *
@@ -152,7 +166,8 @@
             mShader += "}\n";
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+         * @deprecated in API 16
          * Creates ProgramVertexFixedFunction from the current state of
          * the builder
          *
@@ -176,7 +191,8 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Helper class to store modelview, projection and texture
      * matrices for ProgramVertexFixedFunction
      *
@@ -196,7 +212,8 @@
         }
         private FieldPacker mIOBuffer;
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Creates a buffer to store fixed function emulation matrices
         *
         * @param rs Context to which the allocation will belong.
@@ -215,7 +232,8 @@
             setTexture(new Matrix4f());
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Forces deallocation of memory backing the contant matrices.
         * Normally, this is unnecessary and will be garbage collected
         *
@@ -233,7 +251,8 @@
             mAlloc.setFromFieldPacker(0, mIOBuffer);
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Sets the modelview matrix in the fixed function matrix buffer
         *
         * @param m modelview matrix
@@ -243,7 +262,8 @@
             addToBuffer(MODELVIEW_OFFSET*4, m);
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Sets the projection matrix in the fixed function matrix buffer
         *
         * @param m projection matrix
@@ -253,7 +273,8 @@
             addToBuffer(PROJECTION_OFFSET*4, m);
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+        * @deprecated in API 16
         * Sets the texture matrix in the fixed function matrix buffer.
         * Texture matrix must be enabled in the
         * ProgramVertexFixedFunction builder for the shader to utilize
diff --git a/graphics/java/android/renderscript/RSDriverException.java b/graphics/java/android/renderscript/RSDriverException.java
index 1784087..ce85b53 100644
--- a/graphics/java/android/renderscript/RSDriverException.java
+++ b/graphics/java/android/renderscript/RSDriverException.java
@@ -17,7 +17,7 @@
 package android.renderscript;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Base class for all exceptions thrown by the Android
  * Renderscript
  */
diff --git a/graphics/java/android/renderscript/RSIllegalArgumentException.java b/graphics/java/android/renderscript/RSIllegalArgumentException.java
index 039d8f5..954c0e8 100644
--- a/graphics/java/android/renderscript/RSIllegalArgumentException.java
+++ b/graphics/java/android/renderscript/RSIllegalArgumentException.java
@@ -17,13 +17,11 @@
 package android.renderscript;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Base class for all exceptions thrown by the Android
  * Renderscript
  */
 public class RSIllegalArgumentException extends RSRuntimeException {
-    /** @deprecated renderscript is deprecated in J
-    */
     public RSIllegalArgumentException(String string) {
         super(string);
     }
diff --git a/graphics/java/android/renderscript/RSInvalidStateException.java b/graphics/java/android/renderscript/RSInvalidStateException.java
index ccbaea1..691aeba 100644
--- a/graphics/java/android/renderscript/RSInvalidStateException.java
+++ b/graphics/java/android/renderscript/RSInvalidStateException.java
@@ -17,13 +17,11 @@
 package android.renderscript;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Base class for all exceptions thrown by the Android
  * Renderscript
  */
 public class RSInvalidStateException extends RSRuntimeException {
-    /** @deprecated renderscript is deprecated in J
-    */
     public RSInvalidStateException(String string) {
         super(string);
     }
diff --git a/graphics/java/android/renderscript/RSRuntimeException.java b/graphics/java/android/renderscript/RSRuntimeException.java
index 3fb1ea9..5a16478 100644
--- a/graphics/java/android/renderscript/RSRuntimeException.java
+++ b/graphics/java/android/renderscript/RSRuntimeException.java
@@ -17,14 +17,12 @@
 package android.renderscript;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Base class for all exceptions thrown by the Android
  * Renderscript
  */
 public class RSRuntimeException
   extends java.lang.RuntimeException {
-    /** @deprecated renderscript is deprecated in J
-    */
     public RSRuntimeException(String string) {
         super(string);
     }
diff --git a/graphics/java/android/renderscript/RSSurfaceView.java b/graphics/java/android/renderscript/RSSurfaceView.java
index 997b7d0..506f1af 100644
--- a/graphics/java/android/renderscript/RSSurfaceView.java
+++ b/graphics/java/android/renderscript/RSSurfaceView.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.
@@ -29,7 +29,8 @@
 import android.view.SurfaceHolder;
 import android.view.SurfaceView;
 
-/** @deprecated renderscript is deprecated in J
+/**
+ * @deprecated in API 16
  * The Surface View for a graphics renderscript (RenderScriptGL) to draw on.
  *
  * <div class="special reference">
@@ -42,7 +43,8 @@
     private SurfaceHolder mSurfaceHolder;
     private RenderScriptGL mRS;
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Standard View constructor. In order to render something, you
      * must call {@link android.opengl.GLSurfaceView#setRenderer} to
      * register a renderer.
@@ -53,7 +55,8 @@
         //Log.v(RenderScript.LOG_TAG, "RSSurfaceView");
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Standard View constructor. In order to render something, you
      * must call {@link android.opengl.GLSurfaceView#setRenderer} to
      * register a renderer.
@@ -71,7 +74,8 @@
         holder.addCallback(this);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * This method is part of the SurfaceHolder.Callback interface, and is
      * not normally called or subclassed by clients of RSSurfaceView.
      */
@@ -79,7 +83,8 @@
         mSurfaceHolder = holder;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * This method is part of the SurfaceHolder.Callback interface, and is
      * not normally called or subclassed by clients of RSSurfaceView.
      */
@@ -92,7 +97,8 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * This method is part of the SurfaceHolder.Callback interface, and is
      * not normally called or subclassed by clients of RSSurfaceView.
      */
@@ -104,7 +110,8 @@
         }
     }
 
-   /** @deprecated renderscript is deprecated in J
+   /**
+     * @deprecated in API 16
      * Inform the view that the activity is paused. The owner of this view must
      * call this method when the activity is paused. Calling this method will
      * pause the rendering thread.
@@ -116,7 +123,8 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Inform the view that the activity is resumed. The owner of this view must
      * call this method when the activity is resumed. Calling this method will
      * recreate the OpenGL display and resume the rendering
@@ -129,12 +137,18 @@
         }
     }
 
+    /**
+     * @deprecated in API 16
+     **/
     public RenderScriptGL createRenderScriptGL(RenderScriptGL.SurfaceConfig sc) {
       RenderScriptGL rs = new RenderScriptGL(this.getContext(), sc);
         setRenderScriptGL(rs);
         return rs;
     }
 
+    /**
+     * @deprecated in API 16
+     **/
     public void destroyRenderScriptGL() {
         synchronized (this) {
             mRS.destroy();
@@ -142,10 +156,16 @@
         }
     }
 
+    /**
+     * @deprecated in API 16
+     **/
     public void setRenderScriptGL(RenderScriptGL rs) {
         mRS = rs;
     }
 
+    /**
+     * @deprecated in API 16
+     **/
     public RenderScriptGL getRenderScriptGL() {
         return mRS;
     }
diff --git a/graphics/java/android/renderscript/RSTextureView.java b/graphics/java/android/renderscript/RSTextureView.java
index b40f73c..ed04000 100644
--- a/graphics/java/android/renderscript/RSTextureView.java
+++ b/graphics/java/android/renderscript/RSTextureView.java
@@ -28,7 +28,8 @@
 import android.util.Log;
 import android.view.TextureView;
 
-/** @deprecated renderscript is deprecated in J
+/**
+ * @deprecated in API 16
  * The Texture View for a graphics renderscript (RenderScriptGL)
  * to draw on.
  *
@@ -37,7 +38,8 @@
     private RenderScriptGL mRS;
     private SurfaceTexture mSurfaceTexture;
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Standard View constructor. In order to render something, you
      * must call {@link android.opengl.GLSurfaceView#setRenderer} to
      * register a renderer.
@@ -48,7 +50,8 @@
         //Log.v(RenderScript.LOG_TAG, "RSSurfaceView");
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Standard View constructor. In order to render something, you
      * must call {@link android.opengl.GLSurfaceView#setRenderer} to
      * register a renderer.
@@ -64,6 +67,9 @@
         //android.util.Log.e("rs", "getSurfaceTextureListerner " + getSurfaceTextureListener());
     }
 
+    /**
+     * @deprecated in API 16
+     */
     @Override
     public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
         //Log.e(RenderScript.LOG_TAG, "onSurfaceTextureAvailable");
@@ -74,6 +80,9 @@
         }
     }
 
+    /**
+     * @deprecated in API 16
+     */
     @Override
     public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) {
         //Log.e(RenderScript.LOG_TAG, "onSurfaceTextureSizeChanged");
@@ -84,6 +93,9 @@
         }
     }
 
+    /**
+     * @deprecated in API 16
+     */
     @Override
     public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) {
         //Log.e(RenderScript.LOG_TAG, "onSurfaceTextureDestroyed");
@@ -96,13 +108,17 @@
         return true;
     }
 
+    /**
+     * @deprecated in API 16
+     */
     @Override
     public void onSurfaceTextureUpdated(SurfaceTexture surface) {
         //Log.e(RenderScript.LOG_TAG, "onSurfaceTextureUpdated");
         mSurfaceTexture = surface;
     }
 
-   /** @deprecated renderscript is deprecated in J
+   /**
+     * @deprecated in API 16
      * Inform the view that the activity is paused. The owner of this view must
      * call this method when the activity is paused. Calling this method will
      * pause the rendering thread.
@@ -114,7 +130,8 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Inform the view that the activity is resumed. The owner of this view must
      * call this method when the activity is resumed. Calling this method will
      * recreate the OpenGL display and resume the rendering
@@ -127,7 +144,8 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Create a new RenderScriptGL object and attach it to the
      * TextureView if present.
      *
@@ -145,7 +163,8 @@
         return rs;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Destroy the RenderScriptGL object associated with this
      * TextureView.
      */
@@ -154,7 +173,8 @@
         mRS = null;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Set a new RenderScriptGL object.  This also will attach the
      * new object to the TextureView if present.
      *
@@ -167,7 +187,8 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Returns the previously set RenderScriptGL object.
      *
      * @return RenderScriptGL
diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java
index 46ad495..2032f67 100644
--- a/graphics/java/android/renderscript/RenderScript.java
+++ b/graphics/java/android/renderscript/RenderScript.java
@@ -32,7 +32,7 @@
 
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Renderscript base master class.  An instance of this class creates native
  * worker threads for processing commands from this object.  This base class
  * does not provide any extended capabilities beyond simple data processing.
@@ -743,7 +743,7 @@
     ///////////////////////////////////////////////////////////////////////////////////
     //
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Base class application should derive from for handling RS messages
      * coming from their scripts.  When a script calls sendToClient the data
      * fields will be filled in and then the run method called by a message
@@ -758,7 +758,7 @@
         public void run() {
         }
     }
-    /** @deprecated renderscript is deprecated in J
+    /**
      * If an application is expecting messages it should set this field to an
      * instance of RSMessage.  This instance will receive all the user messages
      * sent from sendToClient by scripts from this context.
@@ -773,7 +773,7 @@
         return mMessageCallback;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Runtime error base class.  An application should derive from this class
      * if it wishes to install an error handler.  When errors occur at runtime
      * the fields in this class will be filled and the run method called.
@@ -786,7 +786,7 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Application Error handler.  All runtime errors will be dispatched to the
      * instance of RSAsyncError set here.  If this field is null a
      * RSRuntimeException will instead be thrown with details about the error.
@@ -802,7 +802,7 @@
         return mErrorCallback;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * RenderScript worker threads priority enumeration.  The default value is
      * NORMAL.  Applications wishing to do background processing such as
      * wallpapers should set their priority to LOW to avoid starving forground
@@ -825,7 +825,7 @@
     }
 
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Change the priority of the worker threads for this context.
      *
      * @param p New priority to be set.
@@ -922,7 +922,7 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Gets the application context associated with the RenderScript context.
      *
      * @return The application context.
@@ -931,7 +931,7 @@
         return mApplicationContext;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Create a basic RenderScript context.
      *
      * @hide
@@ -951,7 +951,7 @@
         return rs;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Create a basic RenderScript context.
      *
      * @param ctx The context.
@@ -962,7 +962,7 @@
         return create(ctx, v);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Print the currently available debugging information about the state of
      * the RS context to the log.
      *
@@ -972,7 +972,7 @@
         nContextDump(0);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Wait for any commands in the fifo between the java bindings and native to
      * be processed.
      *
@@ -981,7 +981,7 @@
         nContextFinish();
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Destroy this renderscript context.  Once this function is called its no
      * longer legal to use this or any objects created by this context.
      *
diff --git a/graphics/java/android/renderscript/RenderScriptGL.java b/graphics/java/android/renderscript/RenderScriptGL.java
index ac1a392..12c8102 100644
--- a/graphics/java/android/renderscript/RenderScriptGL.java
+++ b/graphics/java/android/renderscript/RenderScriptGL.java
@@ -28,7 +28,8 @@
 import android.view.SurfaceHolder;
 import android.view.SurfaceView;
 
-/** @deprecated renderscript is deprecated in J
+/**
+ * @deprecated in API 16
  * The Graphics derivitive of Renderscript.  Extends the basic context to add a
  * root script which is the display window for graphical output.  When the
  * system needs to update the display the currently bound root script will be
@@ -45,7 +46,8 @@
     int mWidth;
     int mHeight;
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Class which is used to describe a pixel format for a graphical buffer.
      * This is used to describe the intended format of the display surface.
      *
@@ -66,9 +68,15 @@
         int mSamplesPref    = 1;
         float mSamplesQ     = 1.f;
 
+        /**
+         * @deprecated in API 16
+         */
         public SurfaceConfig() {
         }
 
+        /**
+         * @deprecated in API 16
+         */
         public SurfaceConfig(SurfaceConfig sc) {
             mDepthMin = sc.mDepthMin;
             mDepthPref = sc.mDepthPref;
@@ -92,7 +100,8 @@
             }
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+         * @deprecated in API 16
          * Set the per-component bit depth for color (red, green, blue).  This
          * configures the surface for an unsigned integer buffer type.
          *
@@ -105,7 +114,8 @@
             mColorPref = preferred;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+         * @deprecated in API 16
          * Set the bit depth for alpha. This configures the surface for
          * an unsigned integer buffer type.
          *
@@ -118,7 +128,8 @@
             mAlphaPref = preferred;
         }
 
-         /** @deprecated renderscript is deprecated in J
+         /**
+         * @deprecated in API 16
          * Set the bit depth for the depth buffer. This configures the
          * surface for an unsigned integer buffer type.  If a minimum of 0
          * is specified then its possible no depth buffer will be
@@ -133,7 +144,8 @@
             mDepthPref = preferred;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
+         * @deprecated in API 16
          * Configure the multisample rendering.
          *
          * @param minimum The required number of samples, must be at least 1.
@@ -156,7 +168,8 @@
 
     SurfaceConfig mSurfaceConfig;
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Construct a new RenderScriptGL context.
      *
      * @param ctx The context.
@@ -186,7 +199,8 @@
         mMessageThread.start();
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Bind an os surface
      *
      *
@@ -205,7 +219,8 @@
         nContextSetSurface(w, h, s);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Bind an os surface
      *
      * @param w
@@ -221,7 +236,8 @@
         nContextSetSurfaceTexture(w, h, sur);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * return the height of the last set surface.
      *
      * @return int
@@ -230,7 +246,8 @@
         return mHeight;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * return the width of the last set surface.
      *
      * @return int
@@ -239,7 +256,8 @@
         return mWidth;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Temporarly halt calls to the root rendering script.
      *
      */
@@ -248,7 +266,8 @@
         nContextPause();
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Resume calls to the root rendering script.
      *
      */
@@ -258,7 +277,8 @@
     }
 
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Set the script to handle calls to render the primary surface.
      *
      * @param s Graphics script to process rendering requests.
@@ -268,7 +288,8 @@
         nContextBindRootScript(safeID(s));
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Set the default ProgramStore object seen as the parent state by the root
      * rendering script.
      *
@@ -279,7 +300,8 @@
         nContextBindProgramStore(safeID(p));
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Set the default ProgramFragment object seen as the parent state by the
      * root rendering script.
      *
@@ -290,7 +312,8 @@
         nContextBindProgramFragment(safeID(p));
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Set the default ProgramRaster object seen as the parent state by the
      * root rendering script.
      *
@@ -301,7 +324,8 @@
         nContextBindProgramRaster(safeID(p));
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
+     * @deprecated in API 16
      * Set the default ProgramVertex object seen as the parent state by the
      * root rendering script.
      *
diff --git a/graphics/java/android/renderscript/Sampler.java b/graphics/java/android/renderscript/Sampler.java
index 6b258ab..0df1012 100644
--- a/graphics/java/android/renderscript/Sampler.java
+++ b/graphics/java/android/renderscript/Sampler.java
@@ -27,32 +27,18 @@
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Sampler object which defines how data is extracted from textures. Samplers
  * are attached to Program objects (currently only ProgramFragment) when those objects
  * need to access texture data.
  **/
 public class Sampler extends BaseObj {
-    /** @deprecated renderscript is deprecated in J
-    */
     public enum Value {
-        /** @deprecated renderscript is deprecated in J
-        */
         NEAREST (0),
-        /** @deprecated renderscript is deprecated in J
-        */
         LINEAR (1),
-        /** @deprecated renderscript is deprecated in J
-        */
         LINEAR_MIP_LINEAR (2),
-        /** @deprecated renderscript is deprecated in J
-        */
         LINEAR_MIP_NEAREST (5),
-        /** @deprecated renderscript is deprecated in J
-        */
         WRAP (3),
-        /** @deprecated renderscript is deprecated in J
-        */
         CLAMP (4);
 
         int mID;
@@ -72,42 +58,42 @@
         super(id, rs);
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
      * @return minification setting for the sampler
      */
     public Value getMinification() {
         return mMin;
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
      * @return magnification setting for the sampler
      */
     public Value getMagnification() {
         return mMag;
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
      * @return S wrapping mode for the sampler
      */
     public Value getWrapS() {
         return mWrapS;
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
      * @return T wrapping mode for the sampler
      */
     public Value getWrapT() {
         return mWrapT;
     }
 
-    /** @hide renderscript is deprecated in J
+    /**
      * @return anisotropy setting for the sampler
      */
     public float getAnisotropy() {
         return mAniso;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Retrieve a sampler with min and mag set to nearest and wrap modes set to
      * clamp.
      *
@@ -127,7 +113,7 @@
         return rs.mSampler_CLAMP_NEAREST;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Retrieve a sampler with min and mag set to linear and wrap modes set to
      * clamp.
      *
@@ -147,7 +133,7 @@
         return rs.mSampler_CLAMP_LINEAR;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Retrieve a sampler with ag set to linear, min linear mipmap linear, and
      * to and wrap modes set to clamp.
      *
@@ -167,7 +153,7 @@
         return rs.mSampler_CLAMP_LINEAR_MIP_LINEAR;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Retrieve a sampler with min and mag set to nearest and wrap modes set to
      * wrap.
      *
@@ -187,7 +173,7 @@
         return rs.mSampler_WRAP_NEAREST;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Retrieve a sampler with min and mag set to nearest and wrap modes set to
      * wrap.
      *
@@ -207,7 +193,7 @@
         return rs.mSampler_WRAP_LINEAR;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Retrieve a sampler with ag set to linear, min linear mipmap linear, and
      * to and wrap modes set to wrap.
      *
@@ -228,7 +214,7 @@
     }
 
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Builder for creating non-standard samplers.  Usefull if mix and match of
      * wrap modes is necesary or if anisotropic filtering is desired.
      *
diff --git a/graphics/java/android/renderscript/Script.java b/graphics/java/android/renderscript/Script.java
index 56893ac..bbf5e7e 100644
--- a/graphics/java/android/renderscript/Script.java
+++ b/graphics/java/android/renderscript/Script.java
@@ -16,11 +16,11 @@
 
 package android.renderscript;
 
-/** @deprecated renderscript is deprecated in J
+/**
  *
  **/
 public class Script extends BaseObj {
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Only intended for use by generated reflected code.
      *
      * @param slot
@@ -29,7 +29,7 @@
         mRS.nScriptInvoke(getID(mRS), slot);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Only intended for use by generated reflected code.
      *
      * @param slot
@@ -43,7 +43,7 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Only intended for use by generated reflected code.
      *
      * @param slot
@@ -77,7 +77,7 @@
     }
 
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Only intended for use by generated reflected code.
      *
      * @param va
@@ -92,7 +92,7 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Only intended for use by generated reflected code.
      *
      * @param index
@@ -102,7 +102,7 @@
         mRS.nScriptSetVarF(getID(mRS), index, v);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Only intended for use by generated reflected code.
      *
      * @param index
@@ -112,7 +112,7 @@
         mRS.nScriptSetVarD(getID(mRS), index, v);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Only intended for use by generated reflected code.
      *
      * @param index
@@ -122,7 +122,7 @@
         mRS.nScriptSetVarI(getID(mRS), index, v);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Only intended for use by generated reflected code.
      *
      * @param index
@@ -132,7 +132,7 @@
         mRS.nScriptSetVarJ(getID(mRS), index, v);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Only intended for use by generated reflected code.
      *
      * @param index
@@ -142,7 +142,7 @@
         mRS.nScriptSetVarI(getID(mRS), index, v ? 1 : 0);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Only intended for use by generated reflected code.
      *
      * @param index
@@ -152,7 +152,7 @@
         mRS.nScriptSetVarObj(getID(mRS), index, (o == null) ? 0 : o.getID(mRS));
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Only intended for use by generated reflected code.
      *
      * @param index
@@ -162,7 +162,7 @@
         mRS.nScriptSetVarV(getID(mRS), index, v.getData());
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Only intended for use by generated reflected code.
      *
      * @param index
@@ -174,8 +174,6 @@
         mRS.nScriptSetVarVE(getID(mRS), index, v.getData(), e.getID(mRS), dims);
     }
 
-    /** @deprecated renderscript is deprecated in J
-    */
     public void setTimeZone(String timeZone) {
         mRS.validate();
         try {
diff --git a/graphics/java/android/renderscript/ScriptC.java b/graphics/java/android/renderscript/ScriptC.java
index b1d1fa5..108b230 100644
--- a/graphics/java/android/renderscript/ScriptC.java
+++ b/graphics/java/android/renderscript/ScriptC.java
@@ -29,13 +29,13 @@
 import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
 
-/** @deprecated renderscript is deprecated in J
+/**
  *
  **/
 public class ScriptC extends Script {
     private static final String TAG = "ScriptC";
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Only intended for use by the generated derived classes.
      *
      * @param id
@@ -45,7 +45,7 @@
         super(id, rs);
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Only intended for use by the generated derived classes.
      *
      *
diff --git a/graphics/java/android/renderscript/Short2.java b/graphics/java/android/renderscript/Short2.java
index 21c5f05..617f1f5 100644
--- a/graphics/java/android/renderscript/Short2.java
+++ b/graphics/java/android/renderscript/Short2.java
@@ -20,7 +20,7 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Class for exposing the native Renderscript Short2 type back to the Android system.
  *
  **/
diff --git a/graphics/java/android/renderscript/Short3.java b/graphics/java/android/renderscript/Short3.java
index 81a2954..b9ca49b 100644
--- a/graphics/java/android/renderscript/Short3.java
+++ b/graphics/java/android/renderscript/Short3.java
@@ -20,7 +20,7 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Class for exposing the native Renderscript short3 type back to the Android system.
  *
  **/
diff --git a/graphics/java/android/renderscript/Short4.java b/graphics/java/android/renderscript/Short4.java
index 861c3d7..d5f2db5 100644
--- a/graphics/java/android/renderscript/Short4.java
+++ b/graphics/java/android/renderscript/Short4.java
@@ -20,7 +20,7 @@
 import android.util.Log;
 
 
-/** @deprecated renderscript is deprecated in J
+/**
  * Class for exposing the native Renderscript short4 type back to the Android system.
  *
  **/
diff --git a/graphics/java/android/renderscript/Type.java b/graphics/java/android/renderscript/Type.java
index 9f630e7..a707df2 100644
--- a/graphics/java/android/renderscript/Type.java
+++ b/graphics/java/android/renderscript/Type.java
@@ -20,7 +20,7 @@
 import java.lang.reflect.Field;
 import android.util.Log;
 
-/** @deprecated renderscript is deprecated in J
+/**
  * <p>Type is an allocation template. It consists of an Element and one or more
  * dimensions. It describes only the layout of memory but does not allocate any
  * storage for the data that is described.</p>
@@ -70,7 +70,7 @@
         }
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Return the element associated with this Type.
      *
      * @return Element
@@ -79,7 +79,7 @@
         return mElement;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Return the value of the X dimension.
      *
      * @return int
@@ -88,7 +88,7 @@
         return mDimX;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Return the value of the Y dimension or 0 for a 1D allocation.
      *
      * @return int
@@ -97,7 +97,7 @@
         return mDimY;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Return the value of the Z dimension or 0 for a 1D or 2D allocation.
      *
      * @return int
@@ -106,7 +106,7 @@
         return mDimZ;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Return if the Type has a mipmap chain.
      *
      * @return boolean
@@ -115,7 +115,7 @@
         return mDimMipmaps;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Return if the Type is a cube map.
      *
      * @return boolean
@@ -124,7 +124,7 @@
         return mDimFaces;
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Return the total number of accessable cells in the Type.
      *
      * @return int
@@ -196,7 +196,7 @@
         calcElementCount();
     }
 
-    /** @deprecated renderscript is deprecated in J
+    /**
      * Builder class for Type.
      *
      */
@@ -210,7 +210,7 @@
 
         Element mElement;
 
-        /** @deprecated renderscript is deprecated in J
+        /**
          * Create a new builder object.
          *
          * @param rs
@@ -222,7 +222,7 @@
             mElement = e;
         }
 
-        /** @deprecated renderscript is deprecated in J
+        /**
          * Add a dimension to the Type.
          *
          *
@@ -255,7 +255,7 @@
         }
 
 
-        /** @deprecated renderscript is deprecated in J
+        /**
          * Validate structure and create a new type.
          *
          * @return Type
diff --git a/include/androidfw/Input.h b/include/androidfw/Input.h
index 601a169..6d03fd6 100644
--- a/include/androidfw/Input.h
+++ b/include/androidfw/Input.h
@@ -262,6 +262,8 @@
 
     inline int32_t getFlags() const { return mFlags; }
 
+    inline void setFlags(int32_t flags) { mFlags = flags; }
+
     inline int32_t getKeyCode() const { return mKeyCode; }
 
     inline int32_t getScanCode() const { return mScanCode; }
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 80db693..da2192f 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -247,7 +247,6 @@
 }
 
 void OpenGLRenderer::detachFunctor(Functor* functor) {
-    ALOGD("OGLR %p detachFunctor %p", this, functor);
     mFunctors.remove(functor);
 }
 
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index 2174d06..1892fce 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -55,6 +55,7 @@
 import android.os.RemoteException;
 import android.os.ServiceManager;
 import android.os.SystemProperties;
+import android.os.Vibrator;
 import android.provider.Settings;
 import android.provider.Settings.System;
 import android.telephony.PhoneStateListener;
@@ -119,19 +120,18 @@
     private static final int MSG_PERSIST_VOLUME = 1;
     private static final int MSG_PERSIST_MASTER_VOLUME = 2;
     private static final int MSG_PERSIST_RINGER_MODE = 3;
-    private static final int MSG_PERSIST_VIBRATE_SETTING = 4;
-    private static final int MSG_MEDIA_SERVER_DIED = 5;
-    private static final int MSG_MEDIA_SERVER_STARTED = 6;
-    private static final int MSG_PLAY_SOUND_EFFECT = 7;
-    private static final int MSG_BTA2DP_DOCK_TIMEOUT = 8;
-    private static final int MSG_LOAD_SOUND_EFFECTS = 9;
-    private static final int MSG_SET_FORCE_USE = 10;
-    private static final int MSG_PERSIST_MEDIABUTTONRECEIVER = 11;
-    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;
-    private static final int MSG_PERSIST_MASTER_VOLUME_MUTE = 16;
+    private static final int MSG_MEDIA_SERVER_DIED = 4;
+    private static final int MSG_MEDIA_SERVER_STARTED = 5;
+    private static final int MSG_PLAY_SOUND_EFFECT = 6;
+    private static final int MSG_BTA2DP_DOCK_TIMEOUT = 7;
+    private static final int MSG_LOAD_SOUND_EFFECTS = 8;
+    private static final int MSG_SET_FORCE_USE = 9;
+    private static final int MSG_PERSIST_MEDIABUTTONRECEIVER = 10;
+    private static final int MSG_BT_HEADSET_CNCT_FAILED = 11;
+    private static final int MSG_RCDISPLAY_CLEAR = 12;
+    private static final int MSG_RCDISPLAY_UPDATE = 13;
+    private static final int MSG_SET_ALL_VOLUMES = 14;
+    private static final int MSG_PERSIST_MASTER_VOLUME_MUTE = 15;
 
 
     // flags for MSG_PERSIST_VOLUME indicating if current and/or last audible volume should be
@@ -241,6 +241,20 @@
     };
     private int[] mStreamVolumeAlias;
 
+    // stream names used by dumpStreamStates()
+    private final String[] STREAM_NAMES = new String[] {
+            "STREAM_VOICE_CALL",
+            "STREAM_SYSTEM",
+            "STREAM_RING",
+            "STREAM_MUSIC",
+            "STREAM_ALARM",
+            "STREAM_NOTIFICATION",
+            "STREAM_BLUETOOTH_SCO",
+            "STREAM_SYSTEM_ENFORCED",
+            "STREAM_DTMF",
+            "STREAM_TTS"
+    };
+
     private final AudioSystem.ErrorCallback mAudioSystemCallback = new AudioSystem.ErrorCallback() {
         public void onError(int error) {
             switch (error) {
@@ -282,14 +296,15 @@
     private int mMuteAffectedStreams;
 
     /**
-     * Has multiple bits per vibrate type to indicate the type's vibrate
-     * setting. See {@link #setVibrateSetting(int, int)}.
-     * <p>
-     * NOTE: This is not the final decision of whether vibrate is on/off for the
-     * type since it depends on the ringer mode. See {@link #shouldVibrate(int)}.
+     * NOTE: setVibrateSetting(), getVibrateSetting(), shouldVibrate() are deprecated.
+     * mVibrateSetting is just maintained during deprecation period but vibration policy is
+     * now only controlled by mHasVibrator and mRingerMode
      */
     private int mVibrateSetting;
 
+    // Is there a vibrator
+    private final boolean mHasVibrator;
+
     // Broadcast receiver for device connections intent broadcasts
     private final BroadcastReceiver mReceiver = new AudioServiceBroadcastReceiver();
 
@@ -388,6 +403,9 @@
         PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
         mMediaEventWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "mediaKeyEvent");
 
+        Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
+        mHasVibrator = vibrator == null ? false : vibrator.hasVibrator();
+
        // Intialized volume
         MAX_STREAM_VOLUME[AudioSystem.STREAM_VOICE_CALL] = SystemProperties.getInt(
             "ro.config.vc_call_vol_steps",
@@ -507,6 +525,16 @@
         }
     }
 
+    private void dumpStreamStates(PrintWriter pw) {
+        pw.println("\nStream volumes (device: index)");
+        int numStreamTypes = AudioSystem.getNumStreamTypes();
+        for (int i = 0; i < numStreamTypes; i++) {
+            pw.println("- "+STREAM_NAMES[i]+":");
+            mStreamStates[i].dump(pw);
+            pw.println("");
+        }
+    }
+
 
     private void updateStreamVolumeAlias(boolean updateVolumes) {
         int dtmfStreamAlias;
@@ -538,18 +566,34 @@
     private void readPersistedSettings() {
         final ContentResolver cr = mContentResolver;
 
-        int ringerMode = System.getInt(cr, System.MODE_RINGER, AudioManager.RINGER_MODE_NORMAL);
+        int ringerModeFromSettings =
+                System.getInt(cr, System.MODE_RINGER, AudioManager.RINGER_MODE_NORMAL);
+        int ringerMode = ringerModeFromSettings;
         // sanity check in case the settings are restored from a device with incompatible
         // ringer modes
         if (!AudioManager.isValidRingerMode(ringerMode)) {
             ringerMode = AudioManager.RINGER_MODE_NORMAL;
+        }
+        if ((ringerMode == AudioManager.RINGER_MODE_VIBRATE) && !mHasVibrator) {
+            ringerMode = AudioManager.RINGER_MODE_SILENT;
+        }
+        if (ringerMode != ringerModeFromSettings) {
             System.putInt(cr, System.MODE_RINGER, ringerMode);
         }
         synchronized(mSettingsLock) {
             mRingerMode = ringerMode;
         }
 
-        mVibrateSetting = System.getInt(cr, System.VIBRATE_ON, 0);
+        // System.VIBRATE_ON is not used any more but defaults for mVibrateSetting
+        // are still needed while setVibrateSetting() and getVibrateSetting() are being deprecated.
+        mVibrateSetting = getValueForVibrateSetting(0,
+                                        AudioManager.VIBRATE_TYPE_NOTIFICATION,
+                                        mHasVibrator ? AudioManager.VIBRATE_SETTING_ONLY_SILENT
+                                                        : AudioManager.VIBRATE_SETTING_OFF);
+        mVibrateSetting = getValueForVibrateSetting(mVibrateSetting,
+                                        AudioManager.VIBRATE_TYPE_RINGER,
+                                        mHasVibrator ? AudioManager.VIBRATE_SETTING_ONLY_SILENT
+                                                        : AudioManager.VIBRATE_SETTING_OFF);
 
         // make sure settings for ringer mode are consistent with device type: non voice capable
         // devices (tablets) include media stream in silent mode whereas phones don't.
@@ -639,8 +683,7 @@
         // If either the client forces allowing ringer modes for this adjustment,
         // or the stream type is one that is affected by ringer modes
         if (((flags & AudioManager.FLAG_ALLOW_RINGER_MODES) != 0) ||
-                streamTypeAlias == AudioSystem.STREAM_RING ||
-                (!mVoiceCapable && streamTypeAlias == AudioSystem.STREAM_MUSIC)) {
+                (streamTypeAlias == getMasterStreamType())) {
             int ringerMode = getRingerMode();
             // do not vibrate if already in vibrate mode
             if (ringerMode == AudioManager.RINGER_MODE_VIBRATE) {
@@ -648,7 +691,7 @@
             }
             // Check if the ringer mode changes with this volume adjustment. If
             // it does, it will handle adjusting the volume, so we won't below
-            adjustVolume = checkForRingerModeChange(oldIndex, direction, streamTypeAlias);
+            adjustVolume = checkForRingerModeChange(oldIndex, direction);
         }
 
         // If stream is muted, adjust last audible index only
@@ -724,9 +767,8 @@
                 (mStreamVolumeAlias[streamType] == getMasterStreamType())) {
             int newRingerMode;
             if (index == 0) {
-                newRingerMode = System.getInt(mContentResolver, System.VIBRATE_IN_SILENT, 1) == 1
-                    ? AudioManager.RINGER_MODE_VIBRATE
-                    : AudioManager.RINGER_MODE_SILENT;
+                newRingerMode = mHasVibrator ? AudioManager.RINGER_MODE_VIBRATE
+                                              : AudioManager.RINGER_MODE_SILENT;
                 setStreamVolumeInt(mStreamVolumeAlias[streamType],
                                    index,
                                    device,
@@ -1070,7 +1112,6 @@
                     // on voice capable devices
                     if (mVoiceCapable &&
                             mStreamVolumeAlias[streamType] == AudioSystem.STREAM_RING) {
-
                         Set set = mStreamStates[streamType].mLastAudibleIndex.entrySet();
                         Iterator i = set.iterator();
                         while (i.hasNext()) {
@@ -1111,6 +1152,7 @@
 
     /** @see AudioManager#shouldVibrate(int) */
     public boolean shouldVibrate(int vibrateType) {
+        if (!mHasVibrator) return false;
 
         switch (getVibrateSetting(vibrateType)) {
 
@@ -1131,21 +1173,20 @@
 
     /** @see AudioManager#getVibrateSetting(int) */
     public int getVibrateSetting(int vibrateType) {
+        if (!mHasVibrator) return AudioManager.VIBRATE_SETTING_OFF;
         return (mVibrateSetting >> (vibrateType * 2)) & 3;
     }
 
     /** @see AudioManager#setVibrateSetting(int, int) */
     public void setVibrateSetting(int vibrateType, int vibrateSetting) {
 
+        if (!mHasVibrator) return;
+
         mVibrateSetting = getValueForVibrateSetting(mVibrateSetting, vibrateType, vibrateSetting);
 
         // Broadcast change
         broadcastVibrateSetting(vibrateType);
 
-        // Post message to set ringer mode (it in turn will post a message
-        // to persist)
-        sendMsg(mAudioHandler, MSG_PERSIST_VIBRATE_SETTING, SENDMSG_NOOP, 0, 0,
-                null, 0);
     }
 
     /**
@@ -1967,48 +2008,56 @@
      * adjusting volume. If so, this will set the proper ringer mode and volume
      * indices on the stream states.
      */
-    private boolean checkForRingerModeChange(int oldIndex, int direction, int streamType) {
+    private boolean checkForRingerModeChange(int oldIndex, int direction) {
         boolean adjustVolumeIndex = true;
         int ringerMode = getRingerMode();
-        int newRingerMode = ringerMode;
         int uiIndex = (oldIndex + 5) / 10;
-        boolean vibeInSilent = System.getInt(mContentResolver, System.VIBRATE_IN_SILENT, 1) == 1;
 
-        if (ringerMode == RINGER_MODE_NORMAL) {
-            if ((direction == AudioManager.ADJUST_LOWER) && (uiIndex <= 1)) {
-                // enter silent mode if current index is the last audible one and not repeating a
-                // volume key down
-                if (vibeInSilent || mPrevVolDirection != AudioManager.ADJUST_LOWER) {
-                    // "silent mode", but which one?
-                    newRingerMode = vibeInSilent ? RINGER_MODE_VIBRATE : RINGER_MODE_SILENT;
-                }
-                if (uiIndex == 0 ||
-                        (!vibeInSilent &&
-                         mPrevVolDirection == AudioManager.ADJUST_LOWER &&
-                         mVoiceCapable && streamType == AudioSystem.STREAM_RING)) {
-                    adjustVolumeIndex = false;
+        switch (ringerMode) {
+        case RINGER_MODE_NORMAL:
+            if (direction == AudioManager.ADJUST_LOWER) {
+                if (mHasVibrator) {
+                    if (uiIndex == 1) {
+                        ringerMode = RINGER_MODE_VIBRATE;
+                    }
+                } else {
+                    if (uiIndex == 0 && mPrevVolDirection != AudioManager.ADJUST_LOWER) {
+                        ringerMode = RINGER_MODE_SILENT;
+                    }
                 }
             }
-        } else if (ringerMode == RINGER_MODE_VIBRATE) {
+            break;
+        case RINGER_MODE_VIBRATE:
+            if (!mHasVibrator) {
+                Log.e(TAG, "checkForRingerModeChange() current ringer mode is vibrate" +
+                        "but no vibrator is present");
+                break;
+            }
             if ((direction == AudioManager.ADJUST_LOWER)) {
-                // Set it to silent, if it wasn't a long-press
                 if (mPrevVolDirection != AudioManager.ADJUST_LOWER) {
-                    newRingerMode = RINGER_MODE_SILENT;
+                    ringerMode = RINGER_MODE_SILENT;
                 }
             } else if (direction == AudioManager.ADJUST_RAISE) {
-                newRingerMode = RINGER_MODE_NORMAL;
+                ringerMode = RINGER_MODE_NORMAL;
             }
             adjustVolumeIndex = false;
-        } else {
+            break;
+        case RINGER_MODE_SILENT:
             if (direction == AudioManager.ADJUST_RAISE) {
-                // exiting silent mode
-                // If VIBRATE_IN_SILENT, then go into vibrate mode
-                newRingerMode = vibeInSilent ? RINGER_MODE_VIBRATE : RINGER_MODE_NORMAL;
+                if (mHasVibrator) {
+                    ringerMode = RINGER_MODE_VIBRATE;
+                } else {
+                    ringerMode = RINGER_MODE_NORMAL;
+                }
             }
             adjustVolumeIndex = false;
+            break;
+        default:
+            Log.e(TAG, "checkForRingerModeChange() wrong ringer mode: "+ringerMode);
+            break;
         }
 
-        setRingerMode(newRingerMode);
+        setRingerMode(ringerMode);
 
         mPrevVolDirection = direction;
 
@@ -2217,9 +2266,6 @@
         }
 
         public void readSettings() {
-            boolean checkSilentVolume = (mRingerMode == AudioManager.RINGER_MODE_NORMAL) &&
-                                            isStreamAffectedByRingerMode(mStreamType);
-
             int remainingDevices = AudioSystem.DEVICE_OUT_ALL;
 
             for (int i = 0; remainingDevices != 0; i++) {
@@ -2248,12 +2294,13 @@
                                     index : AudioManager.DEFAULT_STREAM_VOLUME[mStreamType];
                 int lastAudibleIndex = Settings.System.getInt(mContentResolver, name, defaultIndex);
 
-                // a last audible index of 0 is never stored, except on non-voice capable devices
-                // (e.g. tablets) for the music stream type, where the music stream volume can reach
-                // 0 without the device being in silent mode
+                // a last audible index of 0 should never be stored for ring and notification
+                // streams on phones (voice capable devices).
+                // same for system stream on phones and tablets
                 if ((lastAudibleIndex == 0) &&
-                        (mVoiceCapable ||
-                         (mStreamVolumeAlias[mStreamType] != AudioSystem.STREAM_MUSIC))) {
+                        ((mVoiceCapable &&
+                                (mStreamVolumeAlias[mStreamType] == AudioSystem.STREAM_RING)) ||
+                         (mStreamVolumeAlias[mStreamType] == AudioSystem.STREAM_SYSTEM))) {
                     lastAudibleIndex = AudioManager.DEFAULT_STREAM_VOLUME[mStreamType];
                     // Correct the data base
                     sendMsg(mAudioHandler,
@@ -2265,12 +2312,13 @@
                             PERSIST_DELAY);
                 }
                 mLastAudibleIndex.put(device, getValidIndex(10 * lastAudibleIndex));
-                // the initial index should never be 0 for a stream affected by ringer mode if not
-                // in silent or vibrate mode.
-                // this is permitted on tablets for music stream type.
-                if (checkSilentVolume && (index == 0) &&
-                        (mVoiceCapable ||
-                         (mStreamVolumeAlias[mStreamType] != AudioSystem.STREAM_MUSIC))) {
+                // the initial index should never be 0 for ring and notification streams on phones
+                // (voice capable devices) if not in silent or vibrate mode.
+                // same for system stream on phones and tablets
+                if ((index == 0) && (mRingerMode == AudioManager.RINGER_MODE_NORMAL) &&
+                        ((mVoiceCapable &&
+                                (mStreamVolumeAlias[mStreamType] == AudioSystem.STREAM_RING)) ||
+                         (mStreamVolumeAlias[mStreamType] == AudioSystem.STREAM_SYSTEM))) {
                     index = lastAudibleIndex;
                     // Correct the data base
                     sendMsg(mAudioHandler,
@@ -2328,14 +2376,22 @@
                     mLastAudibleIndex.put(device, index);
                 }
                 // Apply change to all streams using this one as alias
+                // if changing volume of current device, also change volume of current
+                // device on aliased stream
+                boolean currentDevice = (device == getDeviceForStream(mStreamType));
                 int numStreamTypes = AudioSystem.getNumStreamTypes();
                 for (int streamType = numStreamTypes - 1; streamType >= 0; streamType--) {
-                    if (streamType != mStreamType && mStreamVolumeAlias[streamType] == mStreamType) {
-                        mStreamStates[streamType].setIndex(rescaleIndex(index,
-                                                                        mStreamType,
-                                                                        streamType),
-                                                           getDeviceForStream(streamType),
+                    if (streamType != mStreamType &&
+                            mStreamVolumeAlias[streamType] == mStreamType) {
+                        int scaledIndex = rescaleIndex(index, mStreamType, streamType);
+                        mStreamStates[streamType].setIndex(scaledIndex,
+                                                           device,
                                                            lastAudible);
+                        if (currentDevice) {
+                            mStreamStates[streamType].setIndex(scaledIndex,
+                                                               getDeviceForStream(streamType),
+                                                               lastAudible);
+                        }
                     }
                 }
                 return true;
@@ -2544,6 +2600,25 @@
                 return handler;
             }
         }
+
+        private void dump(PrintWriter pw) {
+            pw.print("   Current: ");
+            Set set = mIndex.entrySet();
+            Iterator i = set.iterator();
+            while (i.hasNext()) {
+                Map.Entry entry = (Map.Entry)i.next();
+                pw.print(Integer.toHexString(((Integer)entry.getKey()).intValue())
+                             + ": " + ((((Integer)entry.getValue()).intValue() + 5) / 10)+", ");
+            }
+            pw.print("\n   Last audible: ");
+            set = mLastAudibleIndex.entrySet();
+            i = set.iterator();
+            while (i.hasNext()) {
+                Map.Entry entry = (Map.Entry)i.next();
+                pw.print(Integer.toHexString(((Integer)entry.getKey()).intValue())
+                             + ": " + ((((Integer)entry.getValue()).intValue() + 5) / 10)+", ");
+            }
+        }
     }
 
     /** Thread that handles native AudioSystem control. */
@@ -2631,10 +2706,6 @@
             System.putInt(mContentResolver, System.MODE_RINGER, ringerMode);
         }
 
-        private void persistVibrateSetting() {
-            System.putInt(mContentResolver, System.VIBRATE_ON, mVibrateSetting);
-        }
-
         private void playSoundEffect(int effectType, int volume) {
             synchronized (mSoundEffectsLock) {
                 if (mSoundPool == null) {
@@ -2734,10 +2805,6 @@
                     persistRingerMode(getRingerMode());
                     break;
 
-                case MSG_PERSIST_VIBRATE_SETTING:
-                    persistVibrateSetting();
-                    break;
-
                 case MSG_MEDIA_SERVER_DIED:
                     if (!mMediaServerOk) {
                         Log.e(TAG, "Media server died.");
@@ -4366,5 +4433,6 @@
         // TODO probably a lot more to do here than just the audio focus and remote control stacks
         dumpFocusStack(pw);
         dumpRCStack(pw);
+        dumpStreamStates(pw);
     }
 }
diff --git a/media/java/android/media/AudioSystem.java b/media/java/android/media/AudioSystem.java
index 9bafa5c..55071ec 100644
--- a/media/java/android/media/AudioSystem.java
+++ b/media/java/android/media/AudioSystem.java
@@ -260,6 +260,8 @@
     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 final String DEVICE_OUT_USB_ACCESSORY_NAME = "usb_accessory";
+    public static final String DEVICE_OUT_USB_DEVICE_NAME = "usb_device";
 
     public static String getDeviceName(int device)
     {
@@ -290,6 +292,10 @@
             return DEVICE_OUT_ANLG_DOCK_HEADSET_NAME;
         case DEVICE_OUT_DGTL_DOCK_HEADSET:
             return DEVICE_OUT_DGTL_DOCK_HEADSET_NAME;
+        case DEVICE_OUT_USB_ACCESSORY:
+            return DEVICE_OUT_USB_ACCESSORY_NAME;
+        case DEVICE_OUT_USB_DEVICE:
+            return DEVICE_OUT_USB_DEVICE_NAME;
         case DEVICE_IN_DEFAULT:
         default:
             return "";
diff --git a/media/java/android/media/MediaCodec.java b/media/java/android/media/MediaCodec.java
index 1dbd48e..2debd57 100644
--- a/media/java/android/media/MediaCodec.java
+++ b/media/java/android/media/MediaCodec.java
@@ -94,6 +94,11 @@
  * be codec specific data marked as such using the flag {@link #BUFFER_FLAG_CODEC_CONFIG}
  * in a call to {@link #queueInputBuffer}.
  *
+ * Codec specific data included in the format passed to {@link #configure}
+ * (in ByteBuffer entries with keys "csd-0", "csd-1", ...) is automatically
+ * submitted to the codec, this data MUST NOT be submitted explicitly by the
+ * client.
+ *
  * Once the client reaches the end of the input data it signals the end of
  * the input stream by specifying a flag of {@link #BUFFER_FLAG_END_OF_STREAM} in the call to
  * {@link #queueInputBuffer}. The codec will continue to return output buffers
diff --git a/media/java/android/media/MediaExtractor.java b/media/java/android/media/MediaExtractor.java
index 58b30db..d3a00c2 100644
--- a/media/java/android/media/MediaExtractor.java
+++ b/media/java/android/media/MediaExtractor.java
@@ -225,11 +225,6 @@
      * If possible, seek to the sync sample closest to the specified time
      */
     public static final int SEEK_TO_CLOSEST_SYNC        = 2;
-    /**
-     * If possible, seek to a sample closest to the specified time, which may
-     * NOT be a sync sample!
-     */
-    public static final int SEEK_TO_CLOSEST             = 3;
 
     /**
      * All selected tracks seek near the requested time according to the
diff --git a/media/java/android/media/MediaFormat.java b/media/java/android/media/MediaFormat.java
index df77c9e..4414191 100644
--- a/media/java/android/media/MediaFormat.java
+++ b/media/java/android/media/MediaFormat.java
@@ -53,6 +53,7 @@
  * <tr><td>{@link #KEY_IS_ADTS}</td><td>Integer</td><td>optional, if content is AAC audio, setting this key to 1 indicates that each audio frame is prefixed by the ADTS header.</td></tr>
  * <tr><td>{@link #KEY_AAC_PROFILE}</td><td>Integer</td><td><b>encoder-only</b>, optional, if content is AAC audio, specifies the desired profile.</td></tr>
  * <tr><td>{@link #KEY_CHANNEL_MASK}</td><td>Integer</td><td>A mask of audio channel assignments</td></tr>
+ * <tr><td>{@link #KEY_FLAC_COMPRESSION_LEVEL}</td><td>Integer</td><td><b>encoder-only</b>, optional, if content is FLAC audio, specifies the desired compression level.</td></tr>
  * </table>
  *
  */
@@ -155,6 +156,13 @@
      */
     public static final String KEY_AAC_PROFILE = "aac-profile";
 
+    /**
+     * A key describing the FLAC compression level to be used (FLAC audio format only).
+     * The associated value is an integer ranging from 0 (fastest, least compression)
+     * to 8 (slowest, most compression).
+     */
+    public static final String KEY_FLAC_COMPRESSION_LEVEL = "flac-compression-level";
+
     /* package private */ MediaFormat(Map<String, Object> map) {
         mMap = map;
     }
diff --git a/media/java/android/media/MediaPlayer.java b/media/java/android/media/MediaPlayer.java
index 7540c6f..9f0fd48 100644
--- a/media/java/android/media/MediaPlayer.java
+++ b/media/java/android/media/MediaPlayer.java
@@ -743,9 +743,14 @@
         }
         Parcel request = Parcel.obtain();
         Parcel reply = Parcel.obtain();
-        request.writeInterfaceToken(IMEDIA_PLAYER);
-        request.writeInt(INVOKE_ID_SET_VIDEO_SCALE_MODE);
-        invoke(request, reply);
+        try {
+            request.writeInterfaceToken(IMEDIA_PLAYER);
+            request.writeInt(INVOKE_ID_SET_VIDEO_SCALE_MODE);
+            invoke(request, reply);
+        } finally {
+            request.recycle();
+            reply.recycle();
+        }
     }
 
     /**
@@ -1642,11 +1647,16 @@
     public TrackInfo[] getTrackInfo() throws IllegalStateException {
         Parcel request = Parcel.obtain();
         Parcel reply = Parcel.obtain();
-        request.writeInterfaceToken(IMEDIA_PLAYER);
-        request.writeInt(INVOKE_ID_GET_TRACK_INFO);
-        invoke(request, reply);
-        TrackInfo trackInfo[] = reply.createTypedArray(TrackInfo.CREATOR);
-        return trackInfo;
+        try {
+            request.writeInterfaceToken(IMEDIA_PLAYER);
+            request.writeInt(INVOKE_ID_GET_TRACK_INFO);
+            invoke(request, reply);
+            TrackInfo trackInfo[] = reply.createTypedArray(TrackInfo.CREATOR);
+            return trackInfo;
+        } finally {
+            request.recycle();
+            reply.recycle();
+        }
     }
 
     /* Do not change these values without updating their counterparts
@@ -1791,13 +1801,18 @@
 
         Parcel request = Parcel.obtain();
         Parcel reply = Parcel.obtain();
-        request.writeInterfaceToken(IMEDIA_PLAYER);
-        request.writeInt(INVOKE_ID_ADD_EXTERNAL_SOURCE_FD);
-        request.writeFileDescriptor(fd);
-        request.writeLong(offset);
-        request.writeLong(length);
-        request.writeString(mimeType);
-        invoke(request, reply);
+        try {
+            request.writeInterfaceToken(IMEDIA_PLAYER);
+            request.writeInt(INVOKE_ID_ADD_EXTERNAL_SOURCE_FD);
+            request.writeFileDescriptor(fd);
+            request.writeLong(offset);
+            request.writeLong(length);
+            request.writeString(mimeType);
+            invoke(request, reply);
+        } finally {
+            request.recycle();
+            reply.recycle();
+        }
     }
 
     /**
@@ -1854,10 +1869,15 @@
             throws IllegalStateException {
         Parcel request = Parcel.obtain();
         Parcel reply = Parcel.obtain();
-        request.writeInterfaceToken(IMEDIA_PLAYER);
-        request.writeInt(select? INVOKE_ID_SELECT_TRACK: INVOKE_ID_DESELECT_TRACK);
-        request.writeInt(index);
-        invoke(request, reply);
+        try {
+            request.writeInterfaceToken(IMEDIA_PLAYER);
+            request.writeInt(select? INVOKE_ID_SELECT_TRACK: INVOKE_ID_DESELECT_TRACK);
+            request.writeInt(index);
+            invoke(request, reply);
+        } finally {
+            request.recycle();
+            reply.recycle();
+        }
     }
 
 
diff --git a/media/jni/android_media_MediaCodec.cpp b/media/jni/android_media_MediaCodec.cpp
index acd81e1..e43e66e 100644
--- a/media/jni/android_media_MediaCodec.cpp
+++ b/media/jni/android_media_MediaCodec.cpp
@@ -212,6 +212,25 @@
     }
 
     jclass byteBufferClass = env->FindClass("java/nio/ByteBuffer");
+    CHECK(byteBufferClass != NULL);
+
+    jmethodID orderID = env->GetMethodID(
+            byteBufferClass,
+            "order",
+            "(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;");
+
+    CHECK(orderID != NULL);
+
+    jclass byteOrderClass = env->FindClass("java/nio/ByteOrder");
+    CHECK(byteOrderClass != NULL);
+
+    jmethodID nativeOrderID = env->GetStaticMethodID(
+            byteOrderClass, "nativeOrder", "()Ljava/nio/ByteOrder;");
+    CHECK(nativeOrderID != NULL);
+
+    jobject nativeByteOrderObj =
+        env->CallStaticObjectMethod(byteOrderClass, nativeOrderID);
+    CHECK(nativeByteOrderObj != NULL);
 
     *bufArray = (jobjectArray)env->NewObjectArray(
             buffers.size(), byteBufferClass, NULL);
@@ -224,6 +243,11 @@
                 buffer->base(),
                 buffer->capacity());
 
+        jobject me = env->CallObjectMethod(
+                byteBuffer, orderID, nativeByteOrderObj);
+        env->DeleteLocalRef(me);
+        me = NULL;
+
         env->SetObjectArrayElement(
                 *bufArray, i, byteBuffer);
 
@@ -231,6 +255,9 @@
         byteBuffer = NULL;
     }
 
+    env->DeleteLocalRef(nativeByteOrderObj);
+    nativeByteOrderObj = NULL;
+
     return OK;
 }
 
diff --git a/media/jni/android_media_MediaExtractor.cpp b/media/jni/android_media_MediaExtractor.cpp
index c93baf1..351ff04 100644
--- a/media/jni/android_media_MediaExtractor.cpp
+++ b/media/jni/android_media_MediaExtractor.cpp
@@ -313,7 +313,7 @@
     }
 
     if (mode < MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC
-            || mode > MediaSource::ReadOptions::SEEK_CLOSEST) {
+            || mode >= MediaSource::ReadOptions::SEEK_CLOSEST) {
         jniThrowException(env, "java/lang/IllegalArgumentException", NULL);
         return;
     }
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
index abf713b..b0939de 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -63,7 +63,7 @@
     // database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion'
     // is properly propagated through your change.  Not doing so will result in a loss of user
     // settings.
-    private static final int DATABASE_VERSION = 76;
+    private static final int DATABASE_VERSION = 78;
 
     private Context mContext;
 
@@ -657,7 +657,7 @@
 
             upgradeVersion = 53;
         }
-        
+
         if (upgradeVersion == 53) {
             /*
              * New settings for set install location UI no longer initiated here.
@@ -1031,6 +1031,29 @@
             upgradeVersion = 76;
         }
 
+        /************* The following are Jelly Bean changes ************/
+
+        if (upgradeVersion == 76) {
+            // Removed VIBRATE_IN_SILENT setting
+            db.beginTransaction();
+            try {
+                db.execSQL("DELETE FROM system WHERE name='"
+                                + Settings.System.VIBRATE_IN_SILENT + "'");
+                db.setTransactionSuccessful();
+            } finally {
+                db.endTransaction();
+            }
+
+            upgradeVersion = 77;
+        }
+
+        if (upgradeVersion == 77) {
+            // Introduce "vibrate when ringing" setting
+            loadVibrateWhenRingingSetting(db);
+
+            upgradeVersion = 78;
+        }
+
         // *** Remember to update DATABASE_VERSION above!
 
         if (upgradeVersion != currentVersion) {
@@ -1124,7 +1147,7 @@
             try {
                 stmt = db.compileStatement("INSERT OR REPLACE INTO system(name,value)"
                         + " VALUES(?,?);");
-    
+
                 // Set the timeout to 30 minutes in milliseconds
                 loadSetting(stmt, Settings.System.SCREEN_OFF_TIMEOUT,
                         Integer.toString(30 * 60 * 1000));
@@ -1286,7 +1309,7 @@
         try {
             stmt = db.compileStatement("INSERT OR IGNORE INTO system(name,value)"
                     + " VALUES(?,?);");
-    
+
             loadSetting(stmt, Settings.System.VOLUME_MUSIC,
                     AudioManager.DEFAULT_STREAM_VOLUME[AudioManager.STREAM_MUSIC]);
             loadSetting(stmt, Settings.System.VOLUME_RING,
@@ -1307,12 +1330,10 @@
                     stmt,
                     Settings.System.VOLUME_BLUETOOTH_SCO,
                     AudioManager.DEFAULT_STREAM_VOLUME[AudioManager.STREAM_BLUETOOTH_SCO]);
-    
+
             loadSetting(stmt, Settings.System.MODE_RINGER,
                     AudioManager.RINGER_MODE_NORMAL);
-    
-            loadVibrateSetting(db, false);
-    
+
             // By default:
             // - ringtones, notification, system and music streams are affected by ringer mode
             // on non voice capable devices (tablets)
@@ -1337,6 +1358,8 @@
         } finally {
             if (stmt != null) stmt.close();
         }
+
+        loadVibrateWhenRingingSetting(db);
     }
 
     private void loadVibrateSetting(SQLiteDatabase db, boolean deleteOld) {
@@ -1348,7 +1371,7 @@
         try {
             stmt = db.compileStatement("INSERT OR IGNORE INTO system(name,value)"
                     + " VALUES(?,?);");
-    
+
             // Vibrate on by default for ringer, on for notification
             int vibrate = 0;
             vibrate = AudioService.getValueForVibrateSetting(vibrate,
@@ -1362,6 +1385,24 @@
         }
     }
 
+    private void loadVibrateWhenRingingSetting(SQLiteDatabase db) {
+        // The default should be off. VIBRATE_SETTING_ONLY_SILENT should also be ignored here.
+        // Phone app should separately check whether AudioManager#getRingerMode() returns
+        // RINGER_MODE_VIBRATE, with which the device should vibrate anyway.
+        int vibrateSetting = getIntValueFromSystem(db, Settings.System.VIBRATE_ON,
+                AudioManager.VIBRATE_SETTING_OFF);
+        boolean vibrateWhenRinging = ((vibrateSetting & 3) == AudioManager.VIBRATE_SETTING_ON);
+
+        SQLiteStatement stmt = null;
+        try {
+            stmt = db.compileStatement("INSERT OR IGNORE INTO system(name,value)"
+                    + " VALUES(?,?);");
+            loadSetting(stmt, Settings.System.VIBRATE_WHEN_RINGING, vibrateWhenRinging ? 1 : 0);
+        } finally {
+            if (stmt != null) stmt.close();
+        }
+    }
+
     private void loadSettings(SQLiteDatabase db) {
         loadSystemSettings(db);
         loadSecureSettings(db);
@@ -1372,7 +1413,7 @@
         try {
             stmt = db.compileStatement("INSERT OR IGNORE INTO system(name,value)"
                     + " VALUES(?,?);");
-    
+
             loadBooleanSetting(stmt, Settings.System.DIM_SCREEN,
                     R.bool.def_dim_screen);
             loadSetting(stmt, Settings.System.STAY_ON_WHILE_PLUGGED_IN,
@@ -1381,31 +1422,31 @@
                      ? 1 : 0);
             loadIntegerSetting(stmt, Settings.System.SCREEN_OFF_TIMEOUT,
                     R.integer.def_screen_off_timeout);
-    
+
             // Set default cdma emergency tone
             loadSetting(stmt, Settings.System.EMERGENCY_TONE, 0);
-    
+
             // Set default cdma call auto retry
             loadSetting(stmt, Settings.System.CALL_AUTO_RETRY, 0);
-    
+
             // Set default cdma DTMF type
             loadSetting(stmt, Settings.System.DTMF_TONE_TYPE_WHEN_DIALING, 0);
-    
+
             // Set default hearing aid
             loadSetting(stmt, Settings.System.HEARING_AID, 0);
-    
+
             // Set default tty mode
             loadSetting(stmt, Settings.System.TTY_MODE, 0);
-    
+
             loadBooleanSetting(stmt, Settings.System.AIRPLANE_MODE_ON,
                     R.bool.def_airplane_mode_on);
-    
+
             loadStringSetting(stmt, Settings.System.AIRPLANE_MODE_RADIOS,
                     R.string.def_airplane_mode_radios);
-    
+
             loadStringSetting(stmt, Settings.System.AIRPLANE_MODE_TOGGLEABLE_RADIOS,
                     R.string.airplane_mode_toggleable_radios);
-    
+
             loadBooleanSetting(stmt, Settings.System.AUTO_TIME,
                     R.bool.def_auto_time); // Sync time to NITZ
 
@@ -1414,17 +1455,17 @@
 
             loadIntegerSetting(stmt, Settings.System.SCREEN_BRIGHTNESS,
                     R.integer.def_screen_brightness);
-    
+
             loadBooleanSetting(stmt, Settings.System.SCREEN_BRIGHTNESS_MODE,
                     R.bool.def_screen_brightness_automatic_mode);
-    
+
             loadDefaultAnimationSettings(stmt);
-    
+
             loadBooleanSetting(stmt, Settings.System.ACCELEROMETER_ROTATION,
                     R.bool.def_accelerometer_rotation);
-    
+
             loadDefaultHapticSettings(stmt);
-    
+
             loadBooleanSetting(stmt, Settings.System.NOTIFICATION_LIGHT_PULSE,
                     R.bool.def_notification_pulse);
             loadSetting(stmt, Settings.Secure.SET_INSTALL_LOCATION, 0);
@@ -1433,9 +1474,6 @@
 
             loadUISoundEffectsSettings(stmt);
 
-            loadBooleanSetting(stmt, Settings.System.VIBRATE_IN_SILENT,
-                    R.bool.def_vibrate_in_silent);
-
             loadIntegerSetting(stmt, Settings.System.POINTER_SPEED,
                     R.integer.def_pointer_speed);
 
@@ -1492,41 +1530,41 @@
         try {
             stmt = db.compileStatement("INSERT OR IGNORE INTO secure(name,value)"
                     + " VALUES(?,?);");
-    
+
             loadBooleanSetting(stmt, Settings.Secure.BLUETOOTH_ON,
                     R.bool.def_bluetooth_on);
-    
+
             // Data roaming default, based on build
             loadSetting(stmt, Settings.Secure.DATA_ROAMING,
                     "true".equalsIgnoreCase(
                             SystemProperties.get("ro.com.android.dataroaming",
                                     "false")) ? 1 : 0);
-    
+
             loadBooleanSetting(stmt, Settings.Secure.INSTALL_NON_MARKET_APPS,
                     R.bool.def_install_non_market_apps);
-    
+
             loadStringSetting(stmt, Settings.Secure.LOCATION_PROVIDERS_ALLOWED,
                     R.string.def_location_providers_allowed);
-    
+
             loadBooleanSetting(stmt, Settings.Secure.ASSISTED_GPS_ENABLED,
                     R.bool.assisted_gps_enabled);
-    
+
             loadIntegerSetting(stmt, Settings.Secure.NETWORK_PREFERENCE,
                     R.integer.def_network_preference);
-    
+
             loadBooleanSetting(stmt, Settings.Secure.USB_MASS_STORAGE_ENABLED,
                     R.bool.def_usb_mass_storage_enabled);
-    
+
             loadBooleanSetting(stmt, Settings.Secure.WIFI_ON,
                     R.bool.def_wifi_on);
             loadBooleanSetting(stmt, Settings.Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
                     R.bool.def_networks_available_notification_on);
-    
+
             String wifiWatchList = SystemProperties.get("ro.com.android.wifi-watchlist");
             if (!TextUtils.isEmpty(wifiWatchList)) {
                 loadSetting(stmt, Settings.Secure.WIFI_WATCHDOG_WATCH_LIST, wifiWatchList);
             }
-    
+
             // Set the preferred network mode to 0 = Global, CDMA default
             int type;
             if (BaseCommands.getLteOnCdmaModeStatic() == Phone.LTE_ON_CDMA_TRUE) {
@@ -1536,30 +1574,30 @@
                         RILConstants.PREFERRED_NETWORK_MODE);
             }
             loadSetting(stmt, Settings.Secure.PREFERRED_NETWORK_MODE, type);
-    
+
             // Enable or disable Cell Broadcast SMS
             loadSetting(stmt, Settings.Secure.CDMA_CELL_BROADCAST_SMS,
                     RILConstants.CDMA_CELL_BROADCAST_SMS_DISABLED);
-    
+
             // Don't do this.  The SystemServer will initialize ADB_ENABLED from a
             // persistent system property instead.
             //loadSetting(stmt, Settings.Secure.ADB_ENABLED, 0);
-    
+
             // Allow mock locations default, based on build
             loadSetting(stmt, Settings.Secure.ALLOW_MOCK_LOCATION,
                     "1".equals(SystemProperties.get("ro.allow.mock.location")) ? 1 : 0);
-    
+
             loadSecure35Settings(stmt);
-    
+
             loadBooleanSetting(stmt, Settings.Secure.MOUNT_PLAY_NOTIFICATION_SND,
                     R.bool.def_mount_play_notification_snd);
-    
+
             loadBooleanSetting(stmt, Settings.Secure.MOUNT_UMS_AUTOSTART,
                     R.bool.def_mount_ums_autostart);
-    
+
             loadBooleanSetting(stmt, Settings.Secure.MOUNT_UMS_PROMPT,
                     R.bool.def_mount_ums_prompt);
-    
+
             loadBooleanSetting(stmt, Settings.Secure.MOUNT_UMS_NOTIFY_ENABLED,
                     R.bool.def_mount_ums_notify_enabled);
 
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java
index 3e7d86a..18e7faa 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java
@@ -43,9 +43,6 @@
     private IContentService mContentService;
     private IPowerManager mPowerManager;
 
-    private boolean mSilent;
-    private boolean mVibrate;
-
     public SettingsHelper(Context context) {
         mContext = context;
         mAudioManager = (AudioManager) context
@@ -119,18 +116,6 @@
         }
     }
 
-    private void setRingerMode() {
-        if (mSilent) {
-            mAudioManager.setRingerMode(mVibrate ? AudioManager.RINGER_MODE_VIBRATE :
-                AudioManager.RINGER_MODE_SILENT);
-        } else {
-            mAudioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL);
-            mAudioManager.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER,
-                    mVibrate ? AudioManager.VIBRATE_SETTING_ON
-                            : AudioManager.VIBRATE_SETTING_OFF);
-        }
-    }
-
     byte[] getLocaleData() {
         Configuration conf = mContext.getResources().getConfiguration();
         final Locale loc = conf.locale;
diff --git a/packages/SystemUI/res/drawable-hdpi/notification_panel_bg.9.png b/packages/SystemUI/res/drawable-hdpi/notification_panel_bg.9.png
new file mode 100644
index 0000000..8a0a30f
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/notification_panel_bg.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/status_bar_close_off.9.png b/packages/SystemUI/res/drawable-hdpi/status_bar_close_off.9.png
new file mode 100644
index 0000000..bc6462b
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/status_bar_close_off.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/status_bar_close_on.9.png b/packages/SystemUI/res/drawable-hdpi/status_bar_close_on.9.png
index 69f3543..f4e28ae 100644
--- a/packages/SystemUI/res/drawable-hdpi/status_bar_close_on.9.png
+++ b/packages/SystemUI/res/drawable-hdpi/status_bar_close_on.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/notification_panel_bg.9.png b/packages/SystemUI/res/drawable-mdpi/notification_panel_bg.9.png
new file mode 100644
index 0000000..25f15e6
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/notification_panel_bg.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/status_bar_close_off.9.png b/packages/SystemUI/res/drawable-mdpi/status_bar_close_off.9.png
new file mode 100644
index 0000000..4f5bba5
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/status_bar_close_off.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/status_bar_close_on.9.png b/packages/SystemUI/res/drawable-mdpi/status_bar_close_on.9.png
index fb30982..ef7afb8 100644
--- a/packages/SystemUI/res/drawable-mdpi/status_bar_close_on.9.png
+++ b/packages/SystemUI/res/drawable-mdpi/status_bar_close_on.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-hdpi/notification_panel_bg.9.png b/packages/SystemUI/res/drawable-sw600dp-hdpi/notification_panel_bg.9.png
new file mode 100644
index 0000000..2ff93d3
--- /dev/null
+++ b/packages/SystemUI/res/drawable-sw600dp-hdpi/notification_panel_bg.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-mdpi/notification_panel_bg.9.png b/packages/SystemUI/res/drawable-sw600dp-mdpi/notification_panel_bg.9.png
new file mode 100644
index 0000000..430f913
--- /dev/null
+++ b/packages/SystemUI/res/drawable-sw600dp-mdpi/notification_panel_bg.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw600dp-xhdpi/notification_panel_bg.9.png b/packages/SystemUI/res/drawable-sw600dp-xhdpi/notification_panel_bg.9.png
new file mode 100644
index 0000000..807241a
--- /dev/null
+++ b/packages/SystemUI/res/drawable-sw600dp-xhdpi/notification_panel_bg.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw720dp-hdpi/notification_panel_bg.9.png b/packages/SystemUI/res/drawable-sw720dp-hdpi/notification_panel_bg.9.png
new file mode 100644
index 0000000..2ff93d3
--- /dev/null
+++ b/packages/SystemUI/res/drawable-sw720dp-hdpi/notification_panel_bg.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw720dp-mdpi/notification_panel_bg.9.png b/packages/SystemUI/res/drawable-sw720dp-mdpi/notification_panel_bg.9.png
new file mode 100644
index 0000000..430f913
--- /dev/null
+++ b/packages/SystemUI/res/drawable-sw720dp-mdpi/notification_panel_bg.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw720dp-xhdpi/notification_panel_bg.9.png b/packages/SystemUI/res/drawable-sw720dp-xhdpi/notification_panel_bg.9.png
new file mode 100644
index 0000000..807241a
--- /dev/null
+++ b/packages/SystemUI/res/drawable-sw720dp-xhdpi/notification_panel_bg.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/notification_panel_bg.9.png b/packages/SystemUI/res/drawable-xhdpi/notification_panel_bg.9.png
new file mode 100644
index 0000000..60e7418
--- /dev/null
+++ b/packages/SystemUI/res/drawable-xhdpi/notification_panel_bg.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/status_bar_close_off.9.png b/packages/SystemUI/res/drawable-xhdpi/status_bar_close_off.9.png
new file mode 100644
index 0000000..e243e50
--- /dev/null
+++ b/packages/SystemUI/res/drawable-xhdpi/status_bar_close_off.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/status_bar_close_on.9.png b/packages/SystemUI/res/drawable-xhdpi/status_bar_close_on.9.png
index fe2c642..cdad949 100644
--- a/packages/SystemUI/res/drawable-xhdpi/status_bar_close_on.9.png
+++ b/packages/SystemUI/res/drawable-xhdpi/status_bar_close_on.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable/ic_notify_rotation.xml b/packages/SystemUI/res/drawable/ic_notify_rotation.xml
index 213af80..11bc22c 100644
--- a/packages/SystemUI/res/drawable/ic_notify_rotation.xml
+++ b/packages/SystemUI/res/drawable/ic_notify_rotation.xml
@@ -14,14 +14,23 @@
      limitations under the License.
 -->
 
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_checked="true"
-         android:drawable="@drawable/ic_notify_rotation_on_normal" />
-    <item android:state_checked="true" android:state_pressed="true"
-         android:drawable="@drawable/ic_notify_rotation_on_pressed" />
-    <item android:state_pressed="true"
-         android:drawable="@drawable/ic_notify_rotation_off_pressed" />
-    <item
-         android:drawable="@drawable/ic_notify_rotation_off_normal" />
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:constantSize="true">
+    <item android:state_checked="true" android:state_pressed="true">
+        <bitmap android:src="@drawable/ic_notify_rotation_on_pressed"
+                android:gravity="center" />
+    </item>
+    <item android:state_checked="true">
+        <bitmap android:src="@drawable/ic_notify_rotation_on_normal"
+                android:gravity="center" />
+    </item>
+    <item android:state_pressed="true">
+        <bitmap android:src="@drawable/ic_notify_rotation_off_pressed"
+                android:gravity="center" />
+    </item>
+    <item>
+        <bitmap android:src="@drawable/ic_notify_rotation_off_normal"
+                android:gravity="center" />
+    </item>
 </selector>
 
diff --git a/tools/localize/testdata/merge_xx_old.xml b/packages/SystemUI/res/drawable/status_bar_close.xml
similarity index 65%
copy from tools/localize/testdata/merge_xx_old.xml
copy to packages/SystemUI/res/drawable/status_bar_close.xml
index 9d3a7d8..2efc3c3a 100644
--- a/tools/localize/testdata/merge_xx_old.xml
+++ b/packages/SystemUI/res/drawable/status_bar_close.xml
@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
      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.
@@ -14,8 +14,10 @@
      limitations under the License.
 -->
 
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="changed_in_xx">aaa</string>
-    <string name="previously_translated">CCC</string>
-</resources>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true"
+         android:drawable="@drawable/status_bar_close_on" />
+    <item
+         android:drawable="@drawable/status_bar_close_off" />
+</selector>
 
diff --git a/packages/SystemUI/res/layout-land/status_bar_recent_panel.xml b/packages/SystemUI/res/layout-land/status_bar_recent_panel.xml
index fcdd56c..ec2abe0 100644
--- a/packages/SystemUI/res/layout-land/status_bar_recent_panel.xml
+++ b/packages/SystemUI/res/layout-land/status_bar_recent_panel.xml
@@ -45,7 +45,7 @@
             android:fadingEdge="horizontal"
             android:scrollbars="none"
             android:fadingEdgeLength="@dimen/status_bar_recents_scroll_fading_edge_length"
-            android:layout_gravity="bottom|left"
+            android:layout_gravity="bottom|right"
             android:orientation="horizontal"
             android:clipToPadding="false"
             android:clipChildren="false">
diff --git a/packages/SystemUI/res/layout/status_bar_expanded.xml b/packages/SystemUI/res/layout/status_bar_expanded.xml
index 8715a99..f69aac8 100644
--- a/packages/SystemUI/res/layout/status_bar_expanded.xml
+++ b/packages/SystemUI/res/layout/status_bar_expanded.xml
@@ -25,25 +25,24 @@
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:orientation="vertical"
-    android:background="@drawable/notification_tracking_bg"
-    android:paddingTop="@*android:dimen/status_bar_height"
+    android:background="@drawable/notification_panel_bg"
+    android:paddingTop="@dimen/notification_panel_padding_top"
     android:layout_marginLeft="@dimen/notification_panel_margin_left"
     >
 
-    <RelativeLayout
+    <LinearLayout
         android:layout_width="match_parent"
-        android:layout_height="52dp"
-        android:paddingTop="3dp"
-        android:paddingBottom="5dp"
-        android:paddingRight="3dp"
+        android:layout_height="wrap_content"
+        android:paddingTop="@dimen/notification_panel_header_padding_top"
         android:background="@drawable/notification_header_bg"
+        android:orientation="horizontal"
+        android:gravity="center_vertical"
+        android:baselineAligned="false"
         >
         <com.android.systemui.statusbar.policy.Clock
             android:id="@+id/clock"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_alignParentLeft="true"
-            android:layout_centerVertical="true"
             android:layout_marginLeft="8dp"
             android:singleLine="true"
             android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Clock"
@@ -52,64 +51,41 @@
         <com.android.systemui.statusbar.policy.DateView android:id="@+id/date"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_centerVertical="true"
-            android:layout_toRightOf="@id/clock"
             android:layout_marginLeft="8dp"
-            android:paddingLeft="8dp"
+            android:layout_marginRight="8dp"
             android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date"
             />
-        <!--
-        <com.android.systemui.statusbar.phone.CarrierLabel
-            android:layout_width="0dp"
-            android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:layout_marginTop="1dp"
-            android:layout_marginLeft="5dp"
-            android:layout_gravity="center_vertical"
-            android:paddingBottom="1dp"
-            android:paddingLeft="4dp"
-            android:textAppearance="?android:attr/textAppearanceLarge"
-            android:textColor="?android:attr/textColorSecondary"
-            />
-        -->
 
         <com.android.systemui.statusbar.RotationToggle android:id="@+id/rotation_lock_button"
             android:layout_width="32dp"
             android:layout_height="32dp"
-            android:layout_centerVertical="true"
-            android:layout_toRightOf="@id/date"
-            android:layout_marginLeft="12dp"
+            android:layout_margin="8dp"
             android:button="@drawable/ic_notify_rotation"
             android:contentDescription="@string/accessibility_rotation_lock_off"
             />
 
         <ImageView android:id="@+id/settings_button"
-            android:layout_width="32dp"
-            android:layout_height="32dp"
-            android:layout_marginLeft="8dp"
-            android:layout_centerVertical="true"
-            android:layout_toRightOf="@id/rotation_lock_button"
+            android:layout_width="48dp"
+            android:layout_height="48dp"
+            android:scaleType="center"
             android:src="@drawable/ic_notify_quicksettings"
             android:contentDescription="@string/accessibility_settings_button"
             />
 
+        <Space
+            android:layout_width="0dp"
+            android:layout_height="0dp"
+            android:layout_weight="1"
+            />
+
         <ImageView android:id="@+id/clear_all_button"
-            android:layout_width="32dp"
-            android:layout_height="32dp"
-            android:layout_marginLeft="8dp"
-            android:layout_centerVertical="true"
-            android:layout_alignParentRight="true"
+            android:layout_width="48dp"
+            android:layout_height="48dp"
+            android:scaleType="center"
             android:src="@drawable/ic_notify_clear"
             android:contentDescription="@string/accessibility_clear_all"
             />            
-    </RelativeLayout>
-
-    <View
-        android:layout_width="match_parent"
-        android:layout_height="2dp"
-        android:layout_marginTop="52dp"
-        android:background="@drawable/status_bar_hr"
-        />
+    </LinearLayout>
 
     <ScrollView
         android:id="@+id/scroll"
@@ -117,8 +93,8 @@
         android:layout_height="match_parent"
         android:fadingEdge="none"
         android:overScrollMode="ifContentScrolls"
-		android:layout_marginTop="54dp"
-		android:layout_marginBottom="34dp"
+        android:layout_marginTop="@dimen/notification_panel_header_height"
+        android:layout_marginBottom="@dimen/close_handle_underlap"
         >
         <com.android.systemui.statusbar.policy.NotificationRowLayout
             android:id="@+id/latestItems"
@@ -128,14 +104,6 @@
             />
     </ScrollView>
 
-    <ImageView
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:src="@drawable/title_bar_shadow"
-		android:layout_marginTop="54dp"
-        android:scaleType="fitXY"
-    />
-
     <com.android.systemui.statusbar.phone.CloseDragHandle android:id="@+id/close"
         android:layout_width="match_parent"
         android:layout_height="@dimen/close_handle_height"
@@ -144,10 +112,10 @@
         >
         <ImageView
             android:layout_width="match_parent"
-            android:layout_height="34dp"
+            android:layout_height="@dimen/close_handle_height"
             android:layout_gravity="bottom"
             android:scaleType="fitXY"
-            android:src="@drawable/status_bar_close_on"
+            android:src="@drawable/status_bar_close"
             />
 
     </com.android.systemui.statusbar.phone.CloseDragHandle>
diff --git a/packages/SystemUI/res/layout/status_bar_notification_row.xml b/packages/SystemUI/res/layout/status_bar_notification_row.xml
index e69cd8a..7491939 100644
--- a/packages/SystemUI/res/layout/status_bar_notification_row.xml
+++ b/packages/SystemUI/res/layout/status_bar_notification_row.xml
@@ -1,7 +1,6 @@
 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:background="@*android:drawable/notification_bg"
     >
 
     <View
@@ -34,7 +33,6 @@
         >
 
         <com.android.internal.widget.SizeAdaptiveLayout android:id="@+id/adaptive"
-           android:background="@*android:drawable/notification_bg"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
 
diff --git a/packages/SystemUI/res/layout/status_bar_tracking.xml b/packages/SystemUI/res/layout/status_bar_tracking.xml
deleted file mode 100644
index c1b0066..0000000
--- a/packages/SystemUI/res/layout/status_bar_tracking.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-    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.
--->
-
-<com.android.systemui.statusbar.phone.TrackingView
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:visibility="gone"
-    android:focusable="true"
-    android:descendantFocusability="afterDescendants"
-    android:paddingBottom="0px"
-    android:paddingLeft="0px"
-    android:paddingRight="0px"
-    >
-
-    <FrameLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_weight="1"
-        android:background="@drawable/notification_tracking_bg"
-        >
-        <com.android.systemui.statusbar.phone.CarrierLabel
-            android:textAppearance="@style/TextAppearance.StatusBar.Clock"
-            android:layout_height="wrap_content"
-            android:layout_width="match_parent"
-            android:layout_gravity="bottom"
-            android:gravity="center"
-            android:paddingBottom="20dp"
-            />
-    </FrameLayout>
-
-    <com.android.systemui.statusbar.phone.CloseDragHandle android:id="@+id/close"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:orientation="vertical"
-        >
-        <ImageView
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_gravity="bottom"
-            android:scaleType="fitXY"
-            android:src="@drawable/status_bar_close_on"
-            />
-
-    </com.android.systemui.statusbar.phone.CloseDragHandle>
-
-</com.android.systemui.statusbar.phone.TrackingView>
diff --git a/packages/SystemUI/res/values-af/strings.xml b/packages/SystemUI/res/values-af/strings.xml
index 47ac16d..ae520f9 100644
--- a/packages/SystemUI/res/values-af/strings.xml
+++ b/packages/SystemUI/res/values-af/strings.xml
@@ -144,4 +144,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-am/strings.xml b/packages/SystemUI/res/values-am/strings.xml
index ece78dc..d7f4287 100644
--- a/packages/SystemUI/res/values-am/strings.xml
+++ b/packages/SystemUI/res/values-am/strings.xml
@@ -144,4 +144,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-ar/strings.xml b/packages/SystemUI/res/values-ar/strings.xml
index c412d58..b9144a2 100644
--- a/packages/SystemUI/res/values-ar/strings.xml
+++ b/packages/SystemUI/res/values-ar/strings.xml
@@ -140,8 +140,12 @@
     <string name="accessibility_clear_all" msgid="5235938559247164925">"محو جميع الإشعارات."</string>
     <string name="dreams_dock_launcher" msgid="3541196417659166245">"تنشيط شاشة التوقف"</string>
     <string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"معلومات التطبيق"</string>
-    <!-- no translation found for notifications_off_title (8936620513608443224) -->
+    <string name="notifications_off_title" msgid="8936620513608443224">"التنبيهات معطّلة"</string>
+    <string name="notifications_off_text" msgid="2529001315769385273">"انقر هنا لإعادة تشغيل الإشعارات."</string>
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
     <skip />
-    <!-- no translation found for notifications_off_text (2529001315769385273) -->
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
     <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-be/strings.xml b/packages/SystemUI/res/values-be/strings.xml
index 859df39..525137f 100644
--- a/packages/SystemUI/res/values-be/strings.xml
+++ b/packages/SystemUI/res/values-be/strings.xml
@@ -146,4 +146,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-bg/strings.xml b/packages/SystemUI/res/values-bg/strings.xml
index ae1158d..52ee9e1 100644
--- a/packages/SystemUI/res/values-bg/strings.xml
+++ b/packages/SystemUI/res/values-bg/strings.xml
@@ -144,4 +144,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-ca/strings.xml b/packages/SystemUI/res/values-ca/strings.xml
index 8adba08..5a2c9cd 100644
--- a/packages/SystemUI/res/values-ca/strings.xml
+++ b/packages/SystemUI/res/values-ca/strings.xml
@@ -142,8 +142,9 @@
     <string name="accessibility_clear_all" msgid="5235938559247164925">"Esborra totes les notificacions."</string>
     <string name="dreams_dock_launcher" msgid="3541196417659166245">"Activa el protector de pantalla"</string>
     <string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Informació de l\'aplicació"</string>
-    <!-- no translation found for notifications_off_title (8936620513608443224) -->
-    <skip />
-    <!-- no translation found for notifications_off_text (2529001315769385273) -->
-    <skip />
+    <string name="notifications_off_title" msgid="8936620513608443224">"Notificacions desactivades"</string>
+    <string name="notifications_off_text" msgid="2529001315769385273">"Pica aquí per tornar a activar les notificacions."</string>
+    <string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"La pantalla girarà automàticament."</string>
+    <string name="accessibility_rotation_lock_on_landscape" msgid="6731197337665366273">"La pantalla està bloquejada en orientació horitzontal."</string>
+    <string name="accessibility_rotation_lock_on_portrait" msgid="5809367521644012115">"La pantalla està bloquejada en orientació vertical."</string>
 </resources>
diff --git a/packages/SystemUI/res/values-cs/strings.xml b/packages/SystemUI/res/values-cs/strings.xml
index 601869d..1647358 100644
--- a/packages/SystemUI/res/values-cs/strings.xml
+++ b/packages/SystemUI/res/values-cs/strings.xml
@@ -146,4 +146,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-da/strings.xml b/packages/SystemUI/res/values-da/strings.xml
index 32ae3a9..ab68e80 100644
--- a/packages/SystemUI/res/values-da/strings.xml
+++ b/packages/SystemUI/res/values-da/strings.xml
@@ -144,4 +144,7 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Skærmen roterer automatisk."</string>
+    <string name="accessibility_rotation_lock_on_landscape" msgid="6731197337665366273">"Skærmen er nu låst i liggende retning."</string>
+    <string name="accessibility_rotation_lock_on_portrait" msgid="5809367521644012115">"Skærmen er nu låst i stående retning."</string>
 </resources>
diff --git a/packages/SystemUI/res/values-de/strings.xml b/packages/SystemUI/res/values-de/strings.xml
index a365ce2..2b62397 100644
--- a/packages/SystemUI/res/values-de/strings.xml
+++ b/packages/SystemUI/res/values-de/strings.xml
@@ -146,4 +146,7 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Bildschirm wird automatisch gedreht."</string>
+    <string name="accessibility_rotation_lock_on_landscape" msgid="6731197337665366273">"Bildschirm bleibt im Querformat."</string>
+    <string name="accessibility_rotation_lock_on_portrait" msgid="5809367521644012115">"Bildschirm bleibt im Hochformat."</string>
 </resources>
diff --git a/packages/SystemUI/res/values-el/strings.xml b/packages/SystemUI/res/values-el/strings.xml
index 72e8629..0b87777 100644
--- a/packages/SystemUI/res/values-el/strings.xml
+++ b/packages/SystemUI/res/values-el/strings.xml
@@ -142,8 +142,9 @@
     <string name="accessibility_clear_all" msgid="5235938559247164925">"Εκκαθάριση όλων των ειδοποιήσεων."</string>
     <string name="dreams_dock_launcher" msgid="3541196417659166245">"Ενεργοποίηση προφύλαξης οθόνης"</string>
     <string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Πληροφορίες εφαρμογής"</string>
-    <!-- no translation found for notifications_off_title (8936620513608443224) -->
-    <skip />
-    <!-- no translation found for notifications_off_text (2529001315769385273) -->
-    <skip />
+    <string name="notifications_off_title" msgid="8936620513608443224">"Ειδοποιήσεις ανενεργές"</string>
+    <string name="notifications_off_text" msgid="2529001315769385273">"Πατήστε εδώ για να ενεργοποιήσετε ξανά τις ειδοποιήσεις."</string>
+    <string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Θα γίνεται αυτόματη περιστροφή της οθόνης."</string>
+    <string name="accessibility_rotation_lock_on_landscape" msgid="6731197337665366273">"Η οθόνη έχει κλειδωθεί σε οριζόντιο προσανατολισμό."</string>
+    <string name="accessibility_rotation_lock_on_portrait" msgid="5809367521644012115">"Η οθόνη έχει κλειδωθεί σε κατακόρυφο προσανατολισμό."</string>
 </resources>
diff --git a/packages/SystemUI/res/values-en-rGB/strings.xml b/packages/SystemUI/res/values-en-rGB/strings.xml
index 9701ab8..6b40300 100644
--- a/packages/SystemUI/res/values-en-rGB/strings.xml
+++ b/packages/SystemUI/res/values-en-rGB/strings.xml
@@ -140,8 +140,9 @@
     <string name="accessibility_clear_all" msgid="5235938559247164925">"Clear all notifications."</string>
     <string name="dreams_dock_launcher" msgid="3541196417659166245">"Activate screen saver"</string>
     <string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"App info"</string>
-    <!-- no translation found for notifications_off_title (8936620513608443224) -->
-    <skip />
-    <!-- no translation found for notifications_off_text (2529001315769385273) -->
-    <skip />
+    <string name="notifications_off_title" msgid="8936620513608443224">"Notifications off"</string>
+    <string name="notifications_off_text" msgid="2529001315769385273">"Tap here to turn notifications back on."</string>
+    <string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Screen will rotate automatically."</string>
+    <string name="accessibility_rotation_lock_on_landscape" msgid="6731197337665366273">"Screen is locked in landscape orientation."</string>
+    <string name="accessibility_rotation_lock_on_portrait" msgid="5809367521644012115">"Screen is locked in portrait orientation."</string>
 </resources>
diff --git a/packages/SystemUI/res/values-es-rUS/strings.xml b/packages/SystemUI/res/values-es-rUS/strings.xml
index 3bc4077..b103d58 100644
--- a/packages/SystemUI/res/values-es-rUS/strings.xml
+++ b/packages/SystemUI/res/values-es-rUS/strings.xml
@@ -146,4 +146,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-es/strings.xml b/packages/SystemUI/res/values-es/strings.xml
index c6e2604..a11194e 100644
--- a/packages/SystemUI/res/values-es/strings.xml
+++ b/packages/SystemUI/res/values-es/strings.xml
@@ -140,8 +140,9 @@
     <string name="accessibility_clear_all" msgid="5235938559247164925">"Borrar todas las notificaciones"</string>
     <string name="dreams_dock_launcher" msgid="3541196417659166245">"Activar salvapantallas"</string>
     <string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Información de la aplicación"</string>
-    <!-- no translation found for notifications_off_title (8936620513608443224) -->
-    <skip />
-    <!-- no translation found for notifications_off_text (2529001315769385273) -->
-    <skip />
+    <string name="notifications_off_title" msgid="8936620513608443224">"Notificaciones desactivadas"</string>
+    <string name="notifications_off_text" msgid="2529001315769385273">"Toca aquí para volver a activar las notificaciones."</string>
+    <string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"La pantalla girará automáticamente."</string>
+    <string name="accessibility_rotation_lock_on_landscape" msgid="6731197337665366273">"La pantalla está bloqueada en modo horizontal."</string>
+    <string name="accessibility_rotation_lock_on_portrait" msgid="5809367521644012115">"La pantalla está bloqueada en modo vertical."</string>
 </resources>
diff --git a/packages/SystemUI/res/values-et/strings.xml b/packages/SystemUI/res/values-et/strings.xml
index 55ebbad..1ad5358 100644
--- a/packages/SystemUI/res/values-et/strings.xml
+++ b/packages/SystemUI/res/values-et/strings.xml
@@ -144,4 +144,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-fa/strings.xml b/packages/SystemUI/res/values-fa/strings.xml
index c764821..8097367 100644
--- a/packages/SystemUI/res/values-fa/strings.xml
+++ b/packages/SystemUI/res/values-fa/strings.xml
@@ -140,8 +140,12 @@
     <string name="accessibility_clear_all" msgid="5235938559247164925">"پاک کردن تمام اعلان‌ها"</string>
     <string name="dreams_dock_launcher" msgid="3541196417659166245">"فعال کردن محافظ صفحه نمایش"</string>
     <string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"اطلاعات برنامه"</string>
-    <!-- no translation found for notifications_off_title (8936620513608443224) -->
+    <string name="notifications_off_title" msgid="8936620513608443224">"اعلان‌ها خاموش"</string>
+    <string name="notifications_off_text" msgid="2529001315769385273">"برای روشن کردن مجدد اعلان‌ها، اینجا را ضربه بزنید."</string>
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
     <skip />
-    <!-- no translation found for notifications_off_text (2529001315769385273) -->
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
     <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-fi/strings.xml b/packages/SystemUI/res/values-fi/strings.xml
index a68675c..6345555 100644
--- a/packages/SystemUI/res/values-fi/strings.xml
+++ b/packages/SystemUI/res/values-fi/strings.xml
@@ -144,4 +144,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-fr/strings.xml b/packages/SystemUI/res/values-fr/strings.xml
index 52df763..4b3e1d4 100644
--- a/packages/SystemUI/res/values-fr/strings.xml
+++ b/packages/SystemUI/res/values-fr/strings.xml
@@ -146,4 +146,7 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"L\'écran pivote automatiquement."</string>
+    <string name="accessibility_rotation_lock_on_landscape" msgid="6731197337665366273">"L\'écran est verrouillé en mode paysage."</string>
+    <string name="accessibility_rotation_lock_on_portrait" msgid="5809367521644012115">"L\'écran est verrouillé en mode portrait."</string>
 </resources>
diff --git a/packages/SystemUI/res/values-hi/strings.xml b/packages/SystemUI/res/values-hi/strings.xml
index 9220a49..2e5ae61 100644
--- a/packages/SystemUI/res/values-hi/strings.xml
+++ b/packages/SystemUI/res/values-hi/strings.xml
@@ -144,4 +144,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-hr/strings.xml b/packages/SystemUI/res/values-hr/strings.xml
index 2c6c00a..df155dd 100644
--- a/packages/SystemUI/res/values-hr/strings.xml
+++ b/packages/SystemUI/res/values-hr/strings.xml
@@ -144,4 +144,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-hu/strings.xml b/packages/SystemUI/res/values-hu/strings.xml
index d1ac63a5..6526c63 100644
--- a/packages/SystemUI/res/values-hu/strings.xml
+++ b/packages/SystemUI/res/values-hu/strings.xml
@@ -144,4 +144,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-in/strings.xml b/packages/SystemUI/res/values-in/strings.xml
index 981782d..4571066 100644
--- a/packages/SystemUI/res/values-in/strings.xml
+++ b/packages/SystemUI/res/values-in/strings.xml
@@ -144,4 +144,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-it/strings.xml b/packages/SystemUI/res/values-it/strings.xml
index cac4e73..432d984 100644
--- a/packages/SystemUI/res/values-it/strings.xml
+++ b/packages/SystemUI/res/values-it/strings.xml
@@ -142,8 +142,9 @@
     <string name="accessibility_clear_all" msgid="5235938559247164925">"Cancella tutte le notifiche."</string>
     <string name="dreams_dock_launcher" msgid="3541196417659166245">"Attiva screensaver"</string>
     <string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Informazioni applicazione"</string>
-    <!-- no translation found for notifications_off_title (8936620513608443224) -->
-    <skip />
-    <!-- no translation found for notifications_off_text (2529001315769385273) -->
-    <skip />
+    <string name="notifications_off_title" msgid="8936620513608443224">"Notifiche disattivate"</string>
+    <string name="notifications_off_text" msgid="2529001315769385273">"Tocca qui per riattivare le notifiche."</string>
+    <string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Lo schermo ruoterà automaticamente."</string>
+    <string name="accessibility_rotation_lock_on_landscape" msgid="6731197337665366273">"Lo schermo è bloccato in orientamento orizzontale."</string>
+    <string name="accessibility_rotation_lock_on_portrait" msgid="5809367521644012115">"Lo schermo è bloccato in orientamento verticale."</string>
 </resources>
diff --git a/packages/SystemUI/res/values-iw/strings.xml b/packages/SystemUI/res/values-iw/strings.xml
index eeca907..bdc84b6 100644
--- a/packages/SystemUI/res/values-iw/strings.xml
+++ b/packages/SystemUI/res/values-iw/strings.xml
@@ -140,8 +140,9 @@
     <string name="accessibility_clear_all" msgid="5235938559247164925">"נקה את כל ההתראות."</string>
     <string name="dreams_dock_launcher" msgid="3541196417659166245">"הפעלת שומר מסך"</string>
     <string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"פרטי יישום"</string>
-    <!-- no translation found for notifications_off_title (8936620513608443224) -->
-    <skip />
-    <!-- no translation found for notifications_off_text (2529001315769385273) -->
-    <skip />
+    <string name="notifications_off_title" msgid="8936620513608443224">"מצב התראות כבוי"</string>
+    <string name="notifications_off_text" msgid="2529001315769385273">"הקש כאן כדי להפעיל מחדש את ההתראות."</string>
+    <string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"המסך יסתובב באופן אוטומטי."</string>
+    <string name="accessibility_rotation_lock_on_landscape" msgid="6731197337665366273">"המסך נעול כעת לרוחב."</string>
+    <string name="accessibility_rotation_lock_on_portrait" msgid="5809367521644012115">"המסך נעול כעת לאורך."</string>
 </resources>
diff --git a/packages/SystemUI/res/values-ja/strings.xml b/packages/SystemUI/res/values-ja/strings.xml
index 2b1daf8..3912b539 100644
--- a/packages/SystemUI/res/values-ja/strings.xml
+++ b/packages/SystemUI/res/values-ja/strings.xml
@@ -146,4 +146,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-ko/strings.xml b/packages/SystemUI/res/values-ko/strings.xml
index 4cd5778..438cc0d 100644
--- a/packages/SystemUI/res/values-ko/strings.xml
+++ b/packages/SystemUI/res/values-ko/strings.xml
@@ -144,4 +144,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-lt/strings.xml b/packages/SystemUI/res/values-lt/strings.xml
index 54ed00c..6810d7f 100644
--- a/packages/SystemUI/res/values-lt/strings.xml
+++ b/packages/SystemUI/res/values-lt/strings.xml
@@ -144,4 +144,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-lv/strings.xml b/packages/SystemUI/res/values-lv/strings.xml
index afedc72..bf59477 100644
--- a/packages/SystemUI/res/values-lv/strings.xml
+++ b/packages/SystemUI/res/values-lv/strings.xml
@@ -144,4 +144,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-ms/strings.xml b/packages/SystemUI/res/values-ms/strings.xml
index d956d4d..b77df60 100644
--- a/packages/SystemUI/res/values-ms/strings.xml
+++ b/packages/SystemUI/res/values-ms/strings.xml
@@ -144,4 +144,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-nb/strings.xml b/packages/SystemUI/res/values-nb/strings.xml
index aca1f94..b416095 100644
--- a/packages/SystemUI/res/values-nb/strings.xml
+++ b/packages/SystemUI/res/values-nb/strings.xml
@@ -144,4 +144,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-nl/strings.xml b/packages/SystemUI/res/values-nl/strings.xml
index 7d50794..936e0958 100644
--- a/packages/SystemUI/res/values-nl/strings.xml
+++ b/packages/SystemUI/res/values-nl/strings.xml
@@ -140,8 +140,9 @@
     <string name="accessibility_clear_all" msgid="5235938559247164925">"Alle meldingen wissen."</string>
     <string name="dreams_dock_launcher" msgid="3541196417659166245">"Schermbeveiliging inschakelen"</string>
     <string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"App-info"</string>
-    <!-- no translation found for notifications_off_title (8936620513608443224) -->
-    <skip />
-    <!-- no translation found for notifications_off_text (2529001315769385273) -->
-    <skip />
+    <string name="notifications_off_title" msgid="8936620513608443224">"Meldingen uit"</string>
+    <string name="notifications_off_text" msgid="2529001315769385273">"Tik hier om meldingen weer in te schakelen."</string>
+    <string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Scherm wordt automatisch geroteerd."</string>
+    <string name="accessibility_rotation_lock_on_landscape" msgid="6731197337665366273">"Het scherm is nu vergrendeld in liggende stand."</string>
+    <string name="accessibility_rotation_lock_on_portrait" msgid="5809367521644012115">"Het scherm is nu vergrendeld in staande stand."</string>
 </resources>
diff --git a/packages/SystemUI/res/values-pl/strings.xml b/packages/SystemUI/res/values-pl/strings.xml
index 4847e51..3dab389 100644
--- a/packages/SystemUI/res/values-pl/strings.xml
+++ b/packages/SystemUI/res/values-pl/strings.xml
@@ -144,4 +144,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-pt-rPT/strings.xml b/packages/SystemUI/res/values-pt-rPT/strings.xml
index 1d22d2f..30950ba 100644
--- a/packages/SystemUI/res/values-pt-rPT/strings.xml
+++ b/packages/SystemUI/res/values-pt-rPT/strings.xml
@@ -144,4 +144,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-pt/strings.xml b/packages/SystemUI/res/values-pt/strings.xml
index 8b774e6..a66a649 100644
--- a/packages/SystemUI/res/values-pt/strings.xml
+++ b/packages/SystemUI/res/values-pt/strings.xml
@@ -146,4 +146,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-rm/strings.xml b/packages/SystemUI/res/values-rm/strings.xml
index 8d3103b..16e5719 100644
--- a/packages/SystemUI/res/values-rm/strings.xml
+++ b/packages/SystemUI/res/values-rm/strings.xml
@@ -254,4 +254,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-ro/strings.xml b/packages/SystemUI/res/values-ro/strings.xml
index 714ad2d..2896eae 100644
--- a/packages/SystemUI/res/values-ro/strings.xml
+++ b/packages/SystemUI/res/values-ro/strings.xml
@@ -144,4 +144,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-ru/strings.xml b/packages/SystemUI/res/values-ru/strings.xml
index dcfe560..f2d056d 100644
--- a/packages/SystemUI/res/values-ru/strings.xml
+++ b/packages/SystemUI/res/values-ru/strings.xml
@@ -146,4 +146,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-sk/strings.xml b/packages/SystemUI/res/values-sk/strings.xml
index 96cd983..64494b8 100644
--- a/packages/SystemUI/res/values-sk/strings.xml
+++ b/packages/SystemUI/res/values-sk/strings.xml
@@ -146,4 +146,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-sl/strings.xml b/packages/SystemUI/res/values-sl/strings.xml
index b8371ab..73befa6 100644
--- a/packages/SystemUI/res/values-sl/strings.xml
+++ b/packages/SystemUI/res/values-sl/strings.xml
@@ -144,4 +144,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-sr/strings.xml b/packages/SystemUI/res/values-sr/strings.xml
index e29fc0c..6b475d3 100644
--- a/packages/SystemUI/res/values-sr/strings.xml
+++ b/packages/SystemUI/res/values-sr/strings.xml
@@ -144,4 +144,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-sv/strings.xml b/packages/SystemUI/res/values-sv/strings.xml
index 691f89e..36950dc 100644
--- a/packages/SystemUI/res/values-sv/strings.xml
+++ b/packages/SystemUI/res/values-sv/strings.xml
@@ -144,4 +144,7 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Skärmen roteras automatiskt."</string>
+    <string name="accessibility_rotation_lock_on_landscape" msgid="6731197337665366273">"Bildskärmens riktning är nu låst i liggande format."</string>
+    <string name="accessibility_rotation_lock_on_portrait" msgid="5809367521644012115">"Bildskärmens riktning är nu låst i stående format."</string>
 </resources>
diff --git a/packages/SystemUI/res/values-sw/strings.xml b/packages/SystemUI/res/values-sw/strings.xml
index 5803f3c..8ce45ed 100644
--- a/packages/SystemUI/res/values-sw/strings.xml
+++ b/packages/SystemUI/res/values-sw/strings.xml
@@ -138,8 +138,9 @@
     <string name="accessibility_clear_all" msgid="5235938559247164925">"Futa arifa zote."</string>
     <string name="dreams_dock_launcher" msgid="3541196417659166245">"Amilisha hifadhi ya skrini"</string>
     <string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Taarifa ya programu"</string>
-    <!-- no translation found for notifications_off_title (8936620513608443224) -->
-    <skip />
-    <!-- no translation found for notifications_off_text (2529001315769385273) -->
-    <skip />
+    <string name="notifications_off_title" msgid="8936620513608443224">"Arifa zimezimwa"</string>
+    <string name="notifications_off_text" msgid="2529001315769385273">"Gonga hapa ili kuwasha tena arifa."</string>
+    <string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Skrini itazunguka kiotomatiki."</string>
+    <string name="accessibility_rotation_lock_on_landscape" msgid="6731197337665366273">"Skrini imefungwa sasa katika uelekezo wa mandhari."</string>
+    <string name="accessibility_rotation_lock_on_portrait" msgid="5809367521644012115">"Skrini imefungwa katika uelekeo wa picha."</string>
 </resources>
diff --git a/core/java/android/content/ICancellationSignal.aidl b/packages/SystemUI/res/values-sw600dp-land/values-land-sw600dp/dimens.xml
similarity index 62%
copy from core/java/android/content/ICancellationSignal.aidl
copy to packages/SystemUI/res/values-sw600dp-land/values-land-sw600dp/dimens.xml
index cf1c5d3..e440de1 100644
--- a/core/java/android/content/ICancellationSignal.aidl
+++ b/packages/SystemUI/res/values-sw600dp-land/values-land-sw600dp/dimens.xml
@@ -1,24 +1,21 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
+<?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
+ *     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();
-}
+*/
+-->
+<resources>
+    <!-- Recent Applications parameters -->
+    <dimen name="status_bar_recents_app_label_width">190dip</dimen>
+</resources>
diff --git a/core/java/android/content/ICancellationSignal.aidl b/packages/SystemUI/res/values-sw600dp-port/dimens.xml
similarity index 62%
copy from core/java/android/content/ICancellationSignal.aidl
copy to packages/SystemUI/res/values-sw600dp-port/dimens.xml
index cf1c5d3..7dc91d1 100644
--- a/core/java/android/content/ICancellationSignal.aidl
+++ b/packages/SystemUI/res/values-sw600dp-port/dimens.xml
@@ -1,24 +1,21 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
+<?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
+ *     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();
-}
+*/
+-->
+<resources>
+    <!-- Recent Applications parameters -->
+    <dimen name="status_bar_recents_app_label_width">140dip</dimen>
+</resources>
diff --git a/packages/SystemUI/res/values-sw600dp/dimens.xml b/packages/SystemUI/res/values-sw600dp/dimens.xml
index 50a61b1..2cb99ff 100644
--- a/packages/SystemUI/res/values-sw600dp/dimens.xml
+++ b/packages/SystemUI/res/values-sw600dp/dimens.xml
@@ -16,8 +16,8 @@
 */
 -->
 <resources>
-    <!-- The width of the notification panel window -->
-    <dimen name="notification_panel_width">446dp</dimen>
+    <!-- The width of the notification panel window: 446 + 16 + 16 (padding in the bg drawable) -->
+    <dimen name="notification_panel_width">478dp</dimen>
 
     <!-- Layout parameters for the notification panel -->
     <dimen name="notification_panel_margin_bottom">192dp</dimen>
@@ -36,4 +36,10 @@
     <!-- Height of search panel including navigation bar height -->
     <dimen name="navbar_search_panel_height">300dip</dimen>
 
+    <!-- Extra space above the clock in the panel; on this device, zero -->
+    <dimen name="notification_panel_header_padding_top">0dp</dimen>
+
+    <!-- Size of application thumbnail -->
+    <dimen name="status_bar_recents_thumbnail_width">200dp</dimen>
+    <dimen name="status_bar_recents_thumbnail_height">177dp</dimen>
 </resources>
diff --git a/packages/SystemUI/res/values-th/strings.xml b/packages/SystemUI/res/values-th/strings.xml
index 2ead831..dbb8d91 100644
--- a/packages/SystemUI/res/values-th/strings.xml
+++ b/packages/SystemUI/res/values-th/strings.xml
@@ -144,4 +144,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-tl/strings.xml b/packages/SystemUI/res/values-tl/strings.xml
index 9729a17..f20f6af 100644
--- a/packages/SystemUI/res/values-tl/strings.xml
+++ b/packages/SystemUI/res/values-tl/strings.xml
@@ -144,4 +144,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-tr/strings.xml b/packages/SystemUI/res/values-tr/strings.xml
index 7a328b3..d0f08fc 100644
--- a/packages/SystemUI/res/values-tr/strings.xml
+++ b/packages/SystemUI/res/values-tr/strings.xml
@@ -144,4 +144,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-uk/strings.xml b/packages/SystemUI/res/values-uk/strings.xml
index 995f21a..6494fc8 100644
--- a/packages/SystemUI/res/values-uk/strings.xml
+++ b/packages/SystemUI/res/values-uk/strings.xml
@@ -144,4 +144,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-vi/strings.xml b/packages/SystemUI/res/values-vi/strings.xml
index 7c99f6b..0019c7c 100644
--- a/packages/SystemUI/res/values-vi/strings.xml
+++ b/packages/SystemUI/res/values-vi/strings.xml
@@ -140,8 +140,12 @@
     <string name="accessibility_clear_all" msgid="5235938559247164925">"Xóa tất cả thông báo."</string>
     <string name="dreams_dock_launcher" msgid="3541196417659166245">"Kích hoạt trình bảo vệ màn hình"</string>
     <string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Thông tin về ứng dụng"</string>
-    <!-- no translation found for notifications_off_title (8936620513608443224) -->
+    <string name="notifications_off_title" msgid="8936620513608443224">"Tắt thông báo"</string>
+    <string name="notifications_off_text" msgid="2529001315769385273">"Chạm vào đây để bật lại thông báo."</string>
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
     <skip />
-    <!-- no translation found for notifications_off_text (2529001315769385273) -->
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
     <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-zh-rCN/strings.xml b/packages/SystemUI/res/values-zh-rCN/strings.xml
index c6e29555..b45251f 100644
--- a/packages/SystemUI/res/values-zh-rCN/strings.xml
+++ b/packages/SystemUI/res/values-zh-rCN/strings.xml
@@ -146,4 +146,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-zh-rTW/strings.xml b/packages/SystemUI/res/values-zh-rTW/strings.xml
index ad72466..66c834f 100644
--- a/packages/SystemUI/res/values-zh-rTW/strings.xml
+++ b/packages/SystemUI/res/values-zh-rTW/strings.xml
@@ -146,4 +146,10 @@
     <skip />
     <!-- no translation found for notifications_off_text (2529001315769385273) -->
     <skip />
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
+    <skip />
 </resources>
diff --git a/packages/SystemUI/res/values-zu/strings.xml b/packages/SystemUI/res/values-zu/strings.xml
index b2b111d..78b2779 100644
--- a/packages/SystemUI/res/values-zu/strings.xml
+++ b/packages/SystemUI/res/values-zu/strings.xml
@@ -140,8 +140,12 @@
     <string name="accessibility_clear_all" msgid="5235938559247164925">"Susa zonke izaziso."</string>
     <string name="dreams_dock_launcher" msgid="3541196417659166245">"Yenza ukuthi iskrini seyiva sisebenze"</string>
     <string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Ulwazi lohlelo lokusebenza"</string>
-    <!-- no translation found for notifications_off_title (8936620513608443224) -->
+    <string name="notifications_off_title" msgid="8936620513608443224">"Izaziso zivaliwe"</string>
+    <string name="notifications_off_text" msgid="2529001315769385273">"Thepha lapha ukuvula futhi izaziso."</string>
+    <!-- no translation found for accessibility_rotation_lock_off (4062780228931590069) -->
     <skip />
-    <!-- no translation found for notifications_off_text (2529001315769385273) -->
+    <!-- no translation found for accessibility_rotation_lock_on_landscape (6731197337665366273) -->
+    <skip />
+    <!-- no translation found for accessibility_rotation_lock_on_portrait (5809367521644012115) -->
     <skip />
 </resources>
diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml
index 9257195..ac2779f 100644
--- a/packages/SystemUI/res/values/colors.xml
+++ b/packages/SystemUI/res/values/colors.xml
@@ -20,11 +20,11 @@
     <drawable name="notification_number_text_color">#ffffffff</drawable>
     <drawable name="ticker_background_color">#ff1d1d1d</drawable>
     <drawable name="status_bar_background">#ff000000</drawable>
+    <color name="notification_panel_solid_background">#ff000000</color>
     <drawable name="status_bar_recents_app_thumbnail_background">#88000000</drawable>
     <color name="status_bar_recents_app_label_color">#ffffffff</color>
     <drawable name="status_bar_notification_row_background_color">#ff090909</drawable>
     <drawable name="notification_header_bg">#FF000000</drawable>
-    <drawable name="notification_tracking_bg">#66000000</drawable>
     <color name="notification_list_shadow_top">#80000000</color>
     <drawable name="recents_callout_line">#99ffffff</drawable>
     <drawable name="notification_item_background_legacy_color">#ffaaaaaa</drawable>
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 276d74b..2ff0e00 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -49,14 +49,14 @@
          reducing false presses on navbar buttons; approx 2mm -->
     <dimen name="navigation_bar_deadzone_size">12dp</dimen>
 
-    <!-- thickness (height) of each notification row, including any separators or padding -->
-    <dimen name="notification_height">68dp</dimen>
+    <!-- thickness (height) of each 1U notification row plus glow, padding, etc -->
+    <dimen name="notification_height">72dp</dimen>
 
     <!-- Height of notification icons in the status bar -->
     <dimen name="status_bar_icon_size">@*android:dimen/status_bar_icon_size</dimen>
 
-    <!-- Height of a small notification in the status bar -->
-    <dimen name="notification_min_height">@android:dimen/notification_large_icon_height</dimen>
+    <!-- Height of a small notification in the status bar plus glow, padding, etc -->
+    <dimen name="notification_min_height">72dp</dimen>
 
     <!-- Height of a small notification in the status bar -->
     <!-- TODO: change this back to 256dp once we deal with actions. -->
@@ -71,8 +71,8 @@
     <!-- gap on either side of status bar notification icons -->
     <dimen name="status_bar_icon_padding">0dp</dimen>
 
-    <!-- thickness (height) of dividers between each notification row -->
-    <dimen name="notification_divider_height">2dp</dimen>
+    <!-- half the distance between notifications in the panel -->
+    <dimen name="notification_divider_height">4dp</dimen>
 
     <!-- Notification drawer tuning parameters (phone UI) -->
     <!-- Initial velocity of the shade when expanding on its own -->
@@ -125,7 +125,19 @@
     <dimen name="navbar_search_panel_height">230dip</dimen>
 
     <!-- Height of the draggable handle at the bottom of the phone notification panel -->
-    <dimen name="close_handle_height">34dp</dimen>
+    <dimen name="close_handle_height">32dp</dimen>
+
+    <!-- Amount of close_handle that will not overlap the notification list -->
+    <dimen name="close_handle_underlap">18dp</dimen>
+
+    <!-- Height of the notification panel header bar -->
+    <dimen name="notification_panel_header_height">48dp</dimen>
+
+    <!-- Height of the notification panel header bar -->
+    <dimen name="notification_panel_padding_top">@*android:dimen/status_bar_height</dimen>
+
+    <!-- Extra space above the clock in the panel; half of (notification_panel_header_height - 32) -->
+    <dimen name="notification_panel_header_padding_top">0dp</dimen>
 
     <!-- Layout parameters for the notification panel -->
     <dimen name="notification_panel_margin_bottom">0dp</dimen>
diff --git a/packages/SystemUI/src/com/android/systemui/SearchPanelView.java b/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
index 185ca5b..57f15a8 100644
--- a/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
@@ -146,7 +146,7 @@
         }
     }
 
-    public void show(boolean show, boolean animate) {
+    public void show(final boolean show, boolean animate) {
         if (animate) {
             if (mShowing != show) {
                 mShowing = show;
@@ -156,21 +156,24 @@
             mShowing = show;
             onAnimationEnd(null);
         }
-        setVisibility(show ? View.VISIBLE : View.GONE);
-        if (show) {
-            setFocusable(true);
-            setFocusableInTouchMode(true);
-            requestFocus();
-        }
+        postDelayed(new Runnable() {
+            public void run() {
+                setVisibility(show ? View.VISIBLE : View.INVISIBLE);
+                if (show) {
+                    setFocusable(true);
+                    setFocusableInTouchMode(true);
+                    requestFocus();
+                }
+            }
+        }, show ? 0 : 100);
     }
 
     public void hide(boolean animate) {
-        if (!animate) {
-            setVisibility(View.GONE);
-        }
         if (mBar != null) {
             // This will indirectly cause show(false, ...) to get called
             mBar.animateCollapse();
+        } else {
+            setVisibility(View.INVISIBLE);
         }
     }
 
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
index e865b9c..995ee43 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
@@ -91,6 +91,7 @@
     private int mThumbnailWidth;
     private boolean mFitThumbnailToXY;
     private int mRecentItemLayoutId;
+    private boolean mFirstScreenful = true;
 
     public static interface OnRecentsPanelVisibilityChangedListener {
         public void onRecentsPanelVisibilityChanged(boolean visible);
@@ -206,6 +207,22 @@
         }
     }
 
+    public RecentsPanelView(Context context, AttributeSet attrs) {
+        this(context, attrs, 0);
+    }
+
+    public RecentsPanelView(Context context, AttributeSet attrs, int defStyle) {
+        super(context, attrs, defStyle);
+        mContext = context;
+        updateValuesFromResources();
+
+        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.RecentsPanelView,
+                defStyle, 0);
+
+        mRecentItemLayoutId = a.getResourceId(R.styleable.RecentsPanelView_recentItemLayout, 0);
+        a.recycle();
+    }
+
     public int numItemsInOneScreenful() {
         if (mRecentsContainer instanceof RecentsScrollView){
             RecentsScrollView scrollView
@@ -297,6 +314,7 @@
             mRecentTasksDirty = true;
             mWaitingToShow = false;
             mReadyToShow = false;
+            mRecentsNoApps.setVisibility(View.INVISIBLE);
         }
         if (animate) {
             if (mShowing != show) {
@@ -415,21 +433,6 @@
         super.setVisibility(visibility);
     }
 
-    public RecentsPanelView(Context context, AttributeSet attrs) {
-        this(context, attrs, 0);
-    }
-
-    public RecentsPanelView(Context context, AttributeSet attrs, int defStyle) {
-        super(context, attrs, defStyle);
-        mContext = context;
-        updateValuesFromResources();
-
-        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.RecentsPanelView,
-                defStyle, 0);
-
-        mRecentItemLayoutId = a.getResourceId(R.styleable.RecentsPanelView_recentItemLayout, 0);
-    }
-
     public void updateValuesFromResources() {
         final Resources res = mContext.getResources();
         mThumbnailWidth = Math.round(res.getDimension(R.dimen.status_bar_recents_thumbnail_width));
@@ -572,7 +575,7 @@
         showIfReady();
     }
 
-    // additional optimization when we have sofware system buttons - start loading the recent
+    // additional optimization when we have software system buttons - start loading the recent
     // tasks on touch down
     @Override
     public boolean onTouch(View v, MotionEvent ev) {
@@ -631,7 +634,6 @@
         }
     }
 
-    boolean mFirstScreenful;
     public void onTasksLoaded(ArrayList<TaskDescription> tasks) {
         if (!mFirstScreenful && tasks.size() == 0) {
             return;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index f0db2bce..37fb53d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -20,6 +20,7 @@
 
 import android.app.ActivityManagerNative;
 import android.app.KeyguardManager;
+import android.app.Notification;
 import android.app.PendingIntent;
 import android.content.Context;
 import android.content.Intent;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index f6f41b8..f5f2e28 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -106,6 +106,7 @@
             = "com.android.internal.policy.statusbar.START";
 
     private static final boolean ENABLE_INTRUDERS = false;
+    private static final boolean DIM_BEHIND_EXPANDED_PANEL = false;
 
     static final int EXPANDED_LEAVE_ALONE = -10000;
     static final int EXPANDED_FULL_OPEN = -10001;
@@ -212,6 +213,7 @@
 
     Choreographer mChoreographer;
     boolean mAnimating;
+    boolean mClosing; // only valid when mAnimating; indicates the initial acceleration
     float mAnimY;
     float mAnimVel;
     float mAnimAccel;
@@ -311,6 +313,12 @@
             }
         });
 
+        if (!ActivityManager.isHighEndGfx(mDisplay)) {
+            mStatusBarWindow.setBackground(null);
+            mNotificationPanel.setBackgroundColor(context.getResources().getColor(
+                    R.color.notification_panel_solid_background));
+        }
+
         if (ENABLE_INTRUDERS) {
             mIntruderAlertView = (IntruderAlertView) View.inflate(context, R.layout.intruder_alert, null);
             mIntruderAlertView.setVisibility(View.GONE);
@@ -459,6 +467,9 @@
         // .03, the item disappears entirely (as if alpha = 0) and that discontinuity looks
         // a bit jarring
         mRecentsPanel.setMinSwipeAlpha(0.03f);
+        if (mNavigationBarView != null) {
+            mNavigationBarView.getRecentsButton().setOnTouchListener(mRecentsPanel);
+        }
     }
 
     @Override
@@ -474,7 +485,6 @@
         WindowManager.LayoutParams lp =
             (android.view.WindowManager.LayoutParams) mNavigationBarView.getLayoutParams();
         lp.flags &= ~WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
-        lp.flags &= ~WindowManager.LayoutParams.FLAG_SLIPPERY;
         WindowManagerImpl.getDefault().updateViewLayout(mNavigationBarView, lp);
     }
 
@@ -484,7 +494,6 @@
         WindowManager.LayoutParams lp =
             (android.view.WindowManager.LayoutParams) mNavigationBarView.getLayoutParams();
         lp.flags |= WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
-        lp.flags |= WindowManager.LayoutParams.FLAG_SLIPPERY;
         WindowManagerImpl.getDefault().updateViewLayout(mNavigationBarView, lp);
     }
 
@@ -565,8 +574,7 @@
                     | WindowManager.LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING
                     | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
                     | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
-                    | WindowManager.LayoutParams.FLAG_SPLIT_TOUCH
-                    | WindowManager.LayoutParams.FLAG_SLIPPERY,
+                    | WindowManager.LayoutParams.FLAG_SPLIT_TOUCH,
                 PixelFormat.OPAQUE);
         // this will allow the navbar to run in an overlay on devices that support this
         if (ActivityManager.isHighEndGfx(mDisplay)) {
@@ -1270,14 +1278,26 @@
         }
     }
 
+    void resetLastAnimTime() {
+        mAnimLastTimeNanos = System.nanoTime();
+        if (SPEW) {
+            Throwable t = new Throwable();
+            t.fillInStackTrace();
+            Slog.d(TAG, "resetting last anim time=" + mAnimLastTimeNanos, t);
+        }
+    }
+
     void doAnimation(long frameTimeNanos) {
         if (mAnimating) {
-            if (SPEW) Slog.d(TAG, "doAnimation");
+            if (SPEW) Slog.d(TAG, "doAnimation dt=" + (frameTimeNanos - mAnimLastTimeNanos));
             if (SPEW) Slog.d(TAG, "doAnimation before mAnimY=" + mAnimY);
             incrementAnim(frameTimeNanos);
-            if (SPEW) Slog.d(TAG, "doAnimation after  mAnimY=" + mAnimY);
+            if (SPEW) {
+                Slog.d(TAG, "doAnimation after  mAnimY=" + mAnimY);
+                Slog.d(TAG, "doAnimation expandedViewMax=" + getExpandedViewMaxHeight());
+            }
 
-            if (mAnimY >= getExpandedViewMaxHeight()-1) {
+            if (mAnimY >= getExpandedViewMaxHeight()-1 && !mClosing) {
                 if (SPEW) Slog.d(TAG, "Animation completed to expanded state.");
                 mAnimating = false;
                 updateExpandedViewPos(EXPANDED_FULL_OPEN);
@@ -1285,14 +1305,14 @@
                 return;
             }
 
-            if (mAnimY == 0 && mAnimAccel == 0 && mAnimVel == 0) {
+            if (mAnimY == 0 && mAnimAccel == 0 && mClosing) {
                 if (SPEW) Slog.d(TAG, "Animation completed to collapsed state.");
                 mAnimating = false;
                 performCollapse();
                 return;
             }
 
-            if (mAnimY < getStatusBarHeight()) {
+            if (mAnimY < getStatusBarHeight() && mClosing) {
                 // Draw one more frame with the bar positioned at the top of the screen
                 // before ending the animation so that the user sees the bar in
                 // its final position.  The call to performCollapse() causes a window
@@ -1314,6 +1334,7 @@
         mPile.setLayerType(View.LAYER_TYPE_NONE, null);
         mVelocityTracker.recycle();
         mVelocityTracker = null;
+        mCloseView.setPressed(false);
     }
 
     void incrementAnim(long frameTimeNanos) {
@@ -1330,6 +1351,9 @@
     }
     
     void doRevealAnimation(long frameTimeNanos) {
+        if (SPEW) {
+            Slog.d(TAG, "doRevealAnimation: dt=" + (frameTimeNanos - mAnimLastTimeNanos));
+        }
         final int h = getCloseViewHeight() + getStatusBarHeight();
         if (mAnimatingReveal && mAnimating && mAnimY < h) {
             incrementAnim(frameTimeNanos);
@@ -1349,6 +1373,8 @@
             Slog.d(TAG, "panel: beginning to track the user's touch, y=" + y + " opening=" + opening);
         }
 
+        mCloseView.setPressed(true);
+
         mTracking = true;
         mPile.setLayerType(View.LAYER_TYPE_HARDWARE, null);
         mVelocityTracker = VelocityTracker.obtain();
@@ -1359,7 +1385,7 @@
             updateExpandedViewPos((int)mAnimY);
             mAnimating = true;
             mAnimatingReveal = true;
-            mAnimLastTimeNanos = System.nanoTime();
+            resetLastAnimTime();
             mChoreographer.removeCallbacks(Choreographer.CALLBACK_ANIMATION,
                     mAnimationCallback, null);
             mChoreographer.removeCallbacks(Choreographer.CALLBACK_ANIMATION,
@@ -1433,8 +1459,9 @@
         //Slog.d(TAG, "mAnimY=" + mAnimY + " mAnimVel=" + mAnimVel
         //        + " mAnimAccel=" + mAnimAccel);
 
-        mAnimLastTimeNanos = System.nanoTime();
+        resetLastAnimTime();
         mAnimating = true;
+        mClosing = mAnimAccel < 0;
 
         mChoreographer.removeCallbacks(Choreographer.CALLBACK_ANIMATION,
                 mAnimationCallback, null);
@@ -1474,8 +1501,8 @@
             if (!mExpanded) {
                 mViewDelta = statusBarSize - y;
             } else {
-//                mCloseView.getLocationOnScreen(mAbsPos)...?
-//                mViewDelta = mAbsPos[1] + mTrackingView.getHeight() - y;
+                mCloseView.getLocationOnScreen(mAbsPos);
+                mViewDelta = mAbsPos[1] + statusBarSize + getCloseViewHeight() - y; // XXX: not closeViewHeight, but paddingBottom from the 9patch
             }
             if ((!mExpanded && y < hitSize) ||
                     // @@ add taps outside the panel if it's not full-screen
@@ -1987,11 +2014,14 @@
             Slog.v(TAG, "updated cropView height=" + panelh + " grav=" + lp.gravity);
         }
         mNotificationPanel.setLayoutParams(lp);
-        // woo, special effects
-        final int barh = getCloseViewHeight() + getStatusBarHeight();
-        final float frac = saturate((float)(panelh - barh) / (disph - barh));
-        final int color = ((int)(0xB0 * Math.sin(frac * 1.57f))) << 24;
-        mStatusBarWindow.setBackgroundColor(color);
+
+        if (DIM_BEHIND_EXPANDED_PANEL && ActivityManager.isHighEndGfx(mDisplay)) {
+            // woo, special effects
+            final int barh = getCloseViewHeight() + getStatusBarHeight();
+            final float frac = saturate((float)(panelh - barh) / (disph - barh));
+            final int color = ((int)(0xB0 * Math.sin(frac * 1.57f))) << 24;
+            mStatusBarWindow.setBackgroundColor(color);
+        }
     }
 
     void updateDisplaySize() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
index 5f18b5d..374226d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
@@ -122,8 +122,7 @@
                     action.equals(BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED)) {
                 updateBluetooth(intent);
             }
-            else if (action.equals(AudioManager.RINGER_MODE_CHANGED_ACTION) ||
-                    action.equals(AudioManager.VIBRATE_SETTING_CHANGED_ACTION)) {
+            else if (action.equals(AudioManager.RINGER_MODE_CHANGED_ACTION)) {
                 updateVolume();
             }
             else if (action.equals(TelephonyIntents.ACTION_SIM_STATE_CHANGED)) {
@@ -144,7 +143,6 @@
         filter.addAction(Intent.ACTION_ALARM_CHANGED);
         filter.addAction(Intent.ACTION_SYNC_STATE_CHANGED);
         filter.addAction(AudioManager.RINGER_MODE_CHANGED_ACTION);
-        filter.addAction(AudioManager.VIBRATE_SETTING_CHANGED_ACTION);
         filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED);
         filter.addAction(BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED);
         filter.addAction(TelephonyIntents.ACTION_SIM_STATE_CHANGED);
@@ -238,7 +236,7 @@
 
         final int iconId;
         String contentDescription = null;
-        if (audioManager.shouldVibrate(AudioManager.VIBRATE_TYPE_RINGER)) {
+        if (ringerMode == AudioManager.RINGER_MODE_VIBRATE) {
             iconId = R.drawable.stat_sys_ringer_vibrate;
             contentDescription = mContext.getString(R.string.accessibility_ringer_vibrate);
         } else {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/VolumeController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/VolumeController.java
index c9da01a..43cb85e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/VolumeController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/VolumeController.java
@@ -20,6 +20,7 @@
 import android.content.Context;
 import android.os.RemoteException;
 import android.os.ServiceManager;
+import android.os.Vibrator;
 import android.media.AudioManager;
 import android.provider.Settings;
 import android.util.Slog;
@@ -36,10 +37,16 @@
 
     private boolean mMute;
     private int mVolume;
+    // Is there a vibrator
+    private final boolean mHasVibrator;
 
     public VolumeController(Context context, ToggleSlider control) {
         mContext = context;
         mControl = control;
+
+        Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
+        mHasVibrator = vibrator == null ? false : vibrator.hasVibrator();
+
         mAudioManager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
 
         mMute = mAudioManager.getRingerMode() != AudioManager.RINGER_MODE_NORMAL;
@@ -54,10 +61,8 @@
     public void onChanged(ToggleSlider view, boolean tracking, boolean mute, int level) {
         if (!tracking) {
             if (mute) {
-                boolean vibeInSilent = (1 == Settings.System.getInt(mContext.getContentResolver(),
-                        Settings.System.VIBRATE_IN_SILENT, 1));
                 mAudioManager.setRingerMode(
-                        vibeInSilent ? AudioManager.RINGER_MODE_VIBRATE
+                        mHasVibrator ? AudioManager.RINGER_MODE_VIBRATE
                                      : AudioManager.RINGER_MODE_SILENT);
             } else {
                 mAudioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL);
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 a394596..b0830ee 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -704,7 +704,6 @@
         WindowManager.LayoutParams lp =
             (android.view.WindowManager.LayoutParams) mStatusBarView.getLayoutParams();
         lp.flags &= ~WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
-        lp.flags &= ~WindowManager.LayoutParams.FLAG_SLIPPERY;
         WindowManagerImpl.getDefault().updateViewLayout(mStatusBarView, lp);
     }
 
@@ -714,7 +713,6 @@
         WindowManager.LayoutParams lp =
             (android.view.WindowManager.LayoutParams) mStatusBarView.getLayoutParams();
         lp.flags |= WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
-        lp.flags |= WindowManager.LayoutParams.FLAG_SLIPPERY;
         WindowManagerImpl.getDefault().updateViewLayout(mStatusBarView, lp);
     }
 
diff --git a/policy/src/com/android/internal/policy/impl/FaceUnlock.java b/policy/src/com/android/internal/policy/impl/FaceUnlock.java
index 6e09b7f..ffdeeb1 100644
--- a/policy/src/com/android/internal/policy/impl/FaceUnlock.java
+++ b/policy/src/com/android/internal/policy/impl/FaceUnlock.java
@@ -28,6 +28,7 @@
 import android.content.ServiceConnection;
 import android.os.Handler;
 import android.os.IBinder;
+import android.os.Looper;
 import android.os.Message;
 import android.os.RemoteException;
 import android.telephony.TelephonyManager;
@@ -112,10 +113,14 @@
 
     /**
      * Sets the Face Unlock view to visible, hiding it after the specified amount of time.  If
-     * timeoutMillis is 0, no hide is performed.
+     * timeoutMillis is 0, no hide is performed.  Called on the UI thread.
      */
     public void show(long timeoutMillis) {
         if (DEBUG) Log.d(TAG, "show()");
+        if (mHandler.getLooper() != Looper.myLooper()) {
+            Log.e(TAG, "show() called off of the UI thread");
+        }
+
         removeDisplayMessages();
         if (mFaceUnlockView != null) {
             mFaceUnlockView.setVisibility(View.VISIBLE);
@@ -138,9 +143,14 @@
     /**
      * Binds to the Face Unlock service.  Face Unlock will be started when the bind completes.  The
      * Face Unlock view is displayed to hide the backup lock while the service is starting up.
+     * Called on the UI thread.
      */
     public boolean start() {
         if (DEBUG) Log.d(TAG, "start()");
+        if (mHandler.getLooper() != Looper.myLooper()) {
+            Log.e(TAG, "start() called off of the UI thread");
+        }
+
         if (mIsRunning) {
             Log.w(TAG, "start() called when already running");
         }
@@ -160,20 +170,19 @@
             Log.w(TAG, "Attempt to bind to Face Unlock when already bound");
         }
 
-        // When switching between portrait and landscape view while Face Unlock is running, the
-        // screen will eventually go dark unless we poke the wakelock when Face Unlock is
-        // restarted
-        mKeyguardScreenCallback.pokeWakelock();
-
         mIsRunning = true;
         return true;
     }
 
     /**
-     * Stops Face Unlock and unbinds from the service.
+     * Stops Face Unlock and unbinds from the service.  Called on the UI thread.
      */
     public boolean stop() {
         if (DEBUG) Log.d(TAG, "stop()");
+        if (mHandler.getLooper() != Looper.myLooper()) {
+            Log.e(TAG, "stop() called off of the UI thread");
+        }
+
         boolean mWasRunning = mIsRunning;
         stopUi();
 
@@ -254,7 +263,7 @@
                 handleExposeFallback();
                 break;
             case MSG_POKE_WAKELOCK:
-                handlePokeWakelock();
+                handlePokeWakelock(msg.arg1);
                 break;
             default:
                 Log.e(TAG, "Unhandled message");
@@ -306,6 +315,11 @@
         if (mFaceUnlockView != null) {
             IBinder windowToken = mFaceUnlockView.getWindowToken();
             if (windowToken != null) {
+                // When switching between portrait and landscape view while Face Unlock is running,
+                // the screen will eventually go dark unless we poke the wakelock when Face Unlock
+                // is restarted.
+                mKeyguardScreenCallback.pokeWakelock();
+
                 int[] position;
                 position = new int[2];
                 mFaceUnlockView.getLocationInWindow(position);
@@ -352,7 +366,7 @@
 
     /**
      * Stops the Face Unlock service and exposes the backup lock.  Called when the user presses the
-     * cancel button to skip Face Unlock or no face is detected.
+     * cancel button to skip Face Unlock, no face is detected or there is an error.
      */
     void handleCancel() {
         if (DEBUG) Log.d(TAG, "handleCancel()");
@@ -396,10 +410,10 @@
     }
 
     /**
-     * Pokes the wakelock to keep the screen alive and active.
+     * Pokes the wakelock to keep the screen alive and active for a specific amount of time.
      */
-    void handlePokeWakelock() {
-        mKeyguardScreenCallback.pokeWakelock();
+    void handlePokeWakelock(int millis) {
+        mKeyguardScreenCallback.pokeWakelock(millis);
     }
 
     /**
@@ -439,13 +453,27 @@
      * Tells the Face Unlock service to start displaying its UI and start processing.
      */
     private void startUi(IBinder windowToken, int x, int y, int w, int h) {
-        if (DEBUG) Log.d(TAG, "startUi()");
+        Log.d(TAG, "startUi()");
         synchronized (mServiceRunningLock) {
             if (!mServiceRunning) {
                 if (DEBUG) Log.d(TAG, "Starting Face Unlock");
                 try {
+                    // TODO: these checks and logs are for tracking down bug 6409767 and can be
+                    // removed when that bug is fixed.
+                    if (mService == null) {
+                        Log.d(TAG, "mService is null");
+                    }
+                    if (windowToken == null) {
+                        Log.d(TAG, "windowToken is null");
+                    }
+                    if (mLockPatternUtils == null) {
+                        Log.d(TAG, "mLockPatternUtils is null");
+                    }
+                    Log.d(TAG, "x,y,w,h,live: " + x + "," + y + "," + w + "," + h + "," +
+                            (mLockPatternUtils.isBiometricWeakLivelinessEnabled()?"yes":"no"));
                     mService.startUi(windowToken, x, y, w, h,
                             mLockPatternUtils.isBiometricWeakLivelinessEnabled());
+                    Log.d(TAG, "mService.startUi() called");
                 } catch (RemoteException e) {
                     Log.e(TAG, "Caught exception starting Face Unlock: " + e.toString());
                     return;
@@ -497,7 +525,8 @@
         }
 
         /**
-         * Called when the user presses cancel to skip Face Unlock or a face cannot be found.
+         * Called when the user presses cancel to skip Face Unlock, a face cannot be found or
+         * there is an error.
          */
         @Override
         public void cancel() {
@@ -526,12 +555,14 @@
         }
 
         /**
-         * Called when Face Unlock wants to keep the screen alive and active.
+         * Called when Face Unlock wants to keep the screen alive and active for a specific amount
+         * of time.
          */
-        @Override
-        public void pokeWakelock() {
-            if (DEBUG) Log.d(TAG, "pokeWakelock()");
-            mHandler.sendEmptyMessage(MSG_POKE_WAKELOCK);
+        public void pokeWakelock(int millis) {
+            if (DEBUG) Log.d(TAG, "pokeWakelock() for " + millis + "ms");
+            Message message = mHandler.obtainMessage(MSG_POKE_WAKELOCK, millis, -1);
+            mHandler.sendMessage(message);
         }
+
     };
 }
diff --git a/policy/src/com/android/internal/policy/impl/LockScreen.java b/policy/src/com/android/internal/policy/impl/LockScreen.java
index 8b0d858..c7a30e2 100644
--- a/policy/src/com/android/internal/policy/impl/LockScreen.java
+++ b/policy/src/com/android/internal/policy/impl/LockScreen.java
@@ -34,6 +34,7 @@
 import android.content.Intent;
 import android.content.res.Configuration;
 import android.content.res.Resources;
+import android.os.Vibrator;
 import android.view.KeyEvent;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -82,6 +83,8 @@
     private boolean mCameraDisabled;
     private boolean mSearchDisabled;
     private SearchManager mSearchManager;
+    // Is there a vibrator
+    private final boolean mHasVibrator;
 
     InfoCallbackImpl mInfoCallback = new InfoCallbackImpl() {
 
@@ -385,11 +388,7 @@
         // toggle silent mode
         mSilentMode = !mSilentMode;
         if (mSilentMode) {
-            final boolean vibe = (Settings.System.getInt(
-                mContext.getContentResolver(),
-                Settings.System.VIBRATE_IN_SILENT, 1) == 1);
-
-            mAudioManager.setRingerMode(vibe
+            mAudioManager.setRingerMode(mHasVibrator
                 ? AudioManager.RINGER_MODE_VIBRATE
                 : AudioManager.RINGER_MODE_SILENT);
         } else {
@@ -451,6 +450,8 @@
         setFocusableInTouchMode(true);
         setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
 
+        Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
+        mHasVibrator = vibrator == null ? false : vibrator.hasVibrator();
         mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
         mSilentMode = isSilentMode();
         mUnlockWidget = findViewById(R.id.unlock_widget);
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
index 4b91422..cc7050a 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
@@ -2098,7 +2098,6 @@
             if (widthMode == AT_MOST) {
                 final TypedValue tvw = isPortrait ? mFixedWidthMinor : mFixedWidthMajor;
                 if (tvw != null && tvw.type != TypedValue.TYPE_NULL) {
-                    fixedWidth = true;
                     final int w;
                     if (tvw.type == TypedValue.TYPE_DIMENSION) {
                         w = (int) tvw.getDimension(metrics);
@@ -2112,6 +2111,7 @@
                         final int widthSize = MeasureSpec.getSize(widthMeasureSpec);
                         widthMeasureSpec = MeasureSpec.makeMeasureSpec(
                                 Math.min(w, widthSize), EXACTLY);
+                        fixedWidth = true;
                     }
                 }
             }
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 6348d37..794ed15 100755
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -463,8 +463,8 @@
     Intent mHomeIntent;
     Intent mCarDockIntent;
     Intent mDeskDockIntent;
-    int mShortcutKeyPressed = -1;
-    boolean mConsumeShortcutKeyUp;
+    boolean mSearchKeyShortcutPending;
+    boolean mConsumeSearchKeyUp;
 
     // support for activating the lock screen while the screen is on
     boolean mAllowLockscreenWhenOn;
@@ -509,7 +509,9 @@
     ShortcutManager mShortcutManager;
     PowerManager.WakeLock mBroadcastWakeLock;
 
-    final KeyCharacterMap.FallbackAction mFallbackAction = new KeyCharacterMap.FallbackAction();
+    // Fallback actions by key code.
+    private final SparseArray<KeyCharacterMap.FallbackAction> mFallbackActions =
+            new SparseArray<KeyCharacterMap.FallbackAction>();
 
     private static final int MSG_ENABLE_POINTER_LOCATION = 1;
     private static final int MSG_DISABLE_POINTER_LOCATION = 2;
@@ -1709,7 +1711,8 @@
 
         if (false) {
             Log.d(TAG, "interceptKeyTi keyCode=" + keyCode + " down=" + down + " repeatCount="
-                    + repeatCount + " keyguardOn=" + keyguardOn + " mHomePressed=" + mHomePressed);
+                    + repeatCount + " keyguardOn=" + keyguardOn + " mHomePressed=" + mHomePressed
+                    + " canceled=" + canceled);
         }
 
         // If we think we might have a volume down & power key chord on the way
@@ -1842,13 +1845,13 @@
         } else if (keyCode == KeyEvent.KEYCODE_SEARCH) {
             if (down) {
                 if (repeatCount == 0) {
-                    mShortcutKeyPressed = keyCode;
-                    mConsumeShortcutKeyUp = false;
+                    mSearchKeyShortcutPending = true;
+                    mConsumeSearchKeyUp = false;
                 }
-            } else if (keyCode == mShortcutKeyPressed) {
-                mShortcutKeyPressed = -1;
-                if (mConsumeShortcutKeyUp) {
-                    mConsumeShortcutKeyUp = false;
+            } else {
+                mSearchKeyShortcutPending = false;
+                if (mConsumeSearchKeyUp) {
+                    mConsumeSearchKeyUp = false;
                     return -1;
                 }
             }
@@ -1865,10 +1868,11 @@
         // even if no shortcut was invoked.  This prevents text from being
         // inadvertently inserted when using a keyboard that has built-in macro
         // shortcut keys (that emit Search+x) and some of them are not registered.
-        if (mShortcutKeyPressed != -1) {
+        if (mSearchKeyShortcutPending) {
             final KeyCharacterMap kcm = event.getKeyCharacterMap();
             if (kcm.isPrintingKey(keyCode)) {
-                mConsumeShortcutKeyUp = true;
+                mConsumeSearchKeyUp = true;
+                mSearchKeyShortcutPending = false;
                 if (down && repeatCount == 0 && !keyguardOn) {
                     Intent shortcutIntent = mShortcutManager.getIntent(kcm, keyCode, metaState);
                     if (shortcutIntent != null) {
@@ -1878,13 +1882,11 @@
                         } catch (ActivityNotFoundException ex) {
                             Slog.w(TAG, "Dropping shortcut key combination because "
                                     + "the activity to which it is registered was not found: "
-                                    + KeyEvent.keyCodeToString(mShortcutKeyPressed)
-                                    + "+" + KeyEvent.keyCodeToString(keyCode), ex);
+                                    + "SEARCH+" + KeyEvent.keyCodeToString(keyCode), ex);
                         }
                     } else {
                         Slog.i(TAG, "Dropping unregistered shortcut key combination: "
-                                + KeyEvent.keyCodeToString(mShortcutKeyPressed)
-                                + "+" + KeyEvent.keyCodeToString(keyCode));
+                                + "SEARCH+" + KeyEvent.keyCodeToString(keyCode));
                     }
                 }
                 return -1;
@@ -1964,51 +1966,70 @@
                     + ", policyFlags=" + policyFlags);
         }
 
+        KeyEvent fallbackEvent = null;
         if ((event.getFlags() & KeyEvent.FLAG_FALLBACK) == 0) {
             final KeyCharacterMap kcm = event.getKeyCharacterMap();
             final int keyCode = event.getKeyCode();
             final int metaState = event.getMetaState();
+            final boolean initialDown = event.getAction() == KeyEvent.ACTION_DOWN
+                    && event.getRepeatCount() == 0;
 
             // Check for fallback actions specified by the key character map.
-            if (getFallbackAction(kcm, keyCode, metaState, mFallbackAction)) {
+            final FallbackAction fallbackAction;
+            if (initialDown) {
+                fallbackAction = kcm.getFallbackAction(keyCode, metaState);
+            } else {
+                fallbackAction = mFallbackActions.get(keyCode);
+            }
+
+            if (fallbackAction != null) {
                 if (DEBUG_FALLBACK) {
-                    Slog.d(TAG, "Fallback: keyCode=" + mFallbackAction.keyCode
-                            + " metaState=" + Integer.toHexString(mFallbackAction.metaState));
+                    Slog.d(TAG, "Fallback: keyCode=" + fallbackAction.keyCode
+                            + " metaState=" + Integer.toHexString(fallbackAction.metaState));
                 }
 
-                int flags = event.getFlags() | KeyEvent.FLAG_FALLBACK;
-                KeyEvent fallbackEvent = KeyEvent.obtain(
+                final int flags = event.getFlags() | KeyEvent.FLAG_FALLBACK;
+                fallbackEvent = KeyEvent.obtain(
                         event.getDownTime(), event.getEventTime(),
-                        event.getAction(), mFallbackAction.keyCode,
-                        event.getRepeatCount(), mFallbackAction.metaState,
+                        event.getAction(), fallbackAction.keyCode,
+                        event.getRepeatCount(), fallbackAction.metaState,
                         event.getDeviceId(), event.getScanCode(),
                         flags, event.getSource(), null);
-                int actions = interceptKeyBeforeQueueing(fallbackEvent, policyFlags, true);
-                if ((actions & ACTION_PASS_TO_USER) != 0) {
-                    long delayMillis = interceptKeyBeforeDispatching(
-                            win, fallbackEvent, policyFlags);
-                    if (delayMillis == 0) {
-                        if (DEBUG_FALLBACK) {
-                            Slog.d(TAG, "Performing fallback.");
-                        }
-                        return fallbackEvent;
-                    }
+
+                if (!interceptFallback(win, fallbackEvent, policyFlags)) {
+                    fallbackEvent.recycle();
+                    fallbackEvent = null;
                 }
-                fallbackEvent.recycle();
+
+                if (initialDown) {
+                    mFallbackActions.put(keyCode, fallbackAction);
+                } else if (event.getAction() == KeyEvent.ACTION_UP) {
+                    mFallbackActions.remove(keyCode);
+                    fallbackAction.recycle();
+                }
             }
         }
 
         if (DEBUG_FALLBACK) {
-            Slog.d(TAG, "No fallback.");
+            if (fallbackEvent == null) {
+                Slog.d(TAG, "No fallback.");
+            } else {
+                Slog.d(TAG, "Performing fallback: " + fallbackEvent);
+            }
         }
-        return null;
+        return fallbackEvent;
     }
 
-    private boolean getFallbackAction(KeyCharacterMap kcm, int keyCode, int metaState,
-            FallbackAction outFallbackAction) {
-        // Consult the key character map for specific fallback actions.
-        // For example, map NUMPAD_1 to MOVE_HOME when NUMLOCK is not pressed.
-        return kcm.getFallbackAction(keyCode, metaState, outFallbackAction);
+    private boolean interceptFallback(WindowState win, KeyEvent fallbackEvent, int policyFlags) {
+        int actions = interceptKeyBeforeQueueing(fallbackEvent, policyFlags, true);
+        if ((actions & ACTION_PASS_TO_USER) != 0) {
+            long delayMillis = interceptKeyBeforeDispatching(
+                    win, fallbackEvent, policyFlags);
+            if (delayMillis == 0) {
+                return true;
+            }
+        }
+        return false;
     }
 
     /**
diff --git a/services/input/EventHub.cpp b/services/input/EventHub.cpp
index f80ac18..50bfee6 100644
--- a/services/input/EventHub.cpp
+++ b/services/input/EventHub.cpp
@@ -16,7 +16,7 @@
 
 #define LOG_TAG "EventHub"
 
-// #define LOG_NDEBUG 0
+#define LOG_NDEBUG 0
 
 #include "EventHub.h"
 
@@ -767,11 +767,7 @@
                     size_t count = size_t(readSize) / sizeof(struct input_event);
                     for (size_t i = 0; i < count; i++) {
                         const struct input_event& iev = readBuffer[i];
-                        ALOGV("%s got: t0=%d, t1=%d, type=%d, code=%d, value=%d",
-                                device->path.string(),
-                                (int) iev.time.tv_sec, (int) iev.time.tv_usec,
-                                iev.type, iev.code, iev.value);
-
+                        nsecs_t delta = 0; 
 #ifdef HAVE_POSIX_CLOCKS
                         // Use the time specified in the event instead of the current time
                         // so that downstream code can get more accurate estimates of
@@ -786,10 +782,23 @@
                         // system call that also queries ktime_get_ts().
                         event->when = nsecs_t(iev.time.tv_sec) * 1000000000LL
                                 + nsecs_t(iev.time.tv_usec) * 1000LL;
-                        ALOGV("event time %lld, now %lld", event->when, now);
+                        delta = now - event->when;
+
+                        // Only log verbose if events are older that 1ms
+                        if (delta > 1 * 1000000LL) {
+                            ALOGV("event time %lld, now %lld, delta %lldus", event->when, now, delta / 1000LL);
+                        }
 #else
                         event->when = now;
 #endif
+                        if (delta > 1 * 1000000LL) {
+                            ALOGV("%s got: t0=%d, t1=%d, type=%d, code=%d, value=%d",
+                                  device->path.string(),
+                                  (int) iev.time.tv_sec, (int) iev.time.tv_usec,
+                                  iev.type, iev.code, iev.value);
+                        }
+
+
                         event->deviceId = deviceId;
                         event->type = iev.type;
                         event->code = iev.code;
diff --git a/services/input/InputDispatcher.cpp b/services/input/InputDispatcher.cpp
index dad4ef4..1062d68 100644
--- a/services/input/InputDispatcher.cpp
+++ b/services/input/InputDispatcher.cpp
@@ -185,7 +185,7 @@
     mPolicy(policy),
     mPendingEvent(NULL), mAppSwitchSawKeyDown(false), mAppSwitchDueTime(LONG_LONG_MAX),
     mNextUnblockedEvent(NULL),
-    mDispatchEnabled(true), mDispatchFrozen(false), mInputFilterEnabled(false),
+    mDispatchEnabled(false), mDispatchFrozen(false), mInputFilterEnabled(false),
     mInputTargetWaitCause(INPUT_TARGET_WAIT_CAUSE_NONE) {
     mLooper = new Looper(false);
 
@@ -3354,6 +3354,25 @@
             // generated a fallback or if the window is not a foreground window,
             // then cancel the associated fallback key, if any.
             if (fallbackKeyCode != -1) {
+                // Dispatch the unhandled key to the policy with the cancel flag.
+#if DEBUG_OUTBOUND_EVENT_DETAILS
+                ALOGD("Unhandled key event: Asking policy to cancel fallback action.  "
+                        "keyCode=%d, action=%d, repeatCount=%d, policyFlags=0x%08x",
+                        keyEntry->keyCode, keyEntry->action, keyEntry->repeatCount,
+                        keyEntry->policyFlags);
+#endif
+                KeyEvent event;
+                initializeKeyEvent(&event, keyEntry);
+                event.setFlags(event.getFlags() | AKEY_EVENT_FLAG_CANCELED);
+
+                mLock.unlock();
+
+                mPolicy->dispatchUnhandledKey(connection->inputWindowHandle,
+                        &event, keyEntry->policyFlags, &event);
+
+                mLock.lock();
+
+                // Cancel the fallback key.
                 if (fallbackKeyCode != AKEYCODE_UNKNOWN) {
                     CancelationOptions options(CancelationOptions::CANCEL_FALLBACK_EVENTS,
                             "application handled the original non-fallback key "
@@ -3374,8 +3393,9 @@
 #if DEBUG_OUTBOUND_EVENT_DETAILS
                 ALOGD("Unhandled key event: Skipping unhandled key event processing "
                         "since this is not an initial down.  "
-                        "keyCode=%d, action=%d, repeatCount=%d",
-                        originalKeyCode, keyEntry->action, keyEntry->repeatCount);
+                        "keyCode=%d, action=%d, repeatCount=%d, policyFlags=0x%08x",
+                        originalKeyCode, keyEntry->action, keyEntry->repeatCount,
+                        keyEntry->policyFlags);
 #endif
                 return false;
             }
@@ -3383,8 +3403,9 @@
             // Dispatch the unhandled key to the policy.
 #if DEBUG_OUTBOUND_EVENT_DETAILS
             ALOGD("Unhandled key event: Asking policy to perform fallback action.  "
-                    "keyCode=%d, action=%d, repeatCount=%d",
-                    keyEntry->keyCode, keyEntry->action, keyEntry->repeatCount);
+                    "keyCode=%d, action=%d, repeatCount=%d, policyFlags=0x%08x",
+                    keyEntry->keyCode, keyEntry->action, keyEntry->repeatCount,
+                    keyEntry->policyFlags);
 #endif
             KeyEvent event;
             initializeKeyEvent(&event, keyEntry);
@@ -3426,7 +3447,7 @@
                             "to send %d instead.  Fallback canceled.",
                             event.getKeyCode(), originalKeyCode, fallbackKeyCode);
                 } else {
-                    ALOGD("Unhandled key event: Policy did not request fallback for %d,"
+                    ALOGD("Unhandled key event: Policy did not request fallback for %d, "
                             "but on the DOWN it had requested to send %d.  "
                             "Fallback canceled.",
                             originalKeyCode, fallbackKeyCode);
@@ -3903,8 +3924,10 @@
     memento.source = entry->source;
     memento.keyCode = entry->keyCode;
     memento.scanCode = entry->scanCode;
+    memento.metaState = entry->metaState;
     memento.flags = flags;
     memento.downTime = entry->downTime;
+    memento.policyFlags = entry->policyFlags;
 }
 
 void InputDispatcher::InputState::addMotionMemento(const MotionEntry* entry,
@@ -3919,6 +3942,7 @@
     memento.downTime = entry->downTime;
     memento.setPointers(entry);
     memento.hovering = hovering;
+    memento.policyFlags = entry->policyFlags;
 }
 
 void InputDispatcher::InputState::MotionMemento::setPointers(const MotionEntry* entry) {
@@ -3935,9 +3959,9 @@
         const KeyMemento& memento = mKeyMementos.itemAt(i);
         if (shouldCancelKey(memento, options)) {
             outEvents.push(new KeyEntry(currentTime,
-                    memento.deviceId, memento.source, 0,
+                    memento.deviceId, memento.source, memento.policyFlags,
                     AKEY_EVENT_ACTION_UP, memento.flags | AKEY_EVENT_FLAG_CANCELED,
-                    memento.keyCode, memento.scanCode, 0, 0, memento.downTime));
+                    memento.keyCode, memento.scanCode, memento.metaState, 0, memento.downTime));
         }
     }
 
@@ -3945,7 +3969,7 @@
         const MotionMemento& memento = mMotionMementos.itemAt(i);
         if (shouldCancelMotion(memento, options)) {
             outEvents.push(new MotionEntry(currentTime,
-                    memento.deviceId, memento.source, 0,
+                    memento.deviceId, memento.source, memento.policyFlags,
                     memento.hovering
                             ? AMOTION_EVENT_ACTION_HOVER_EXIT
                             : AMOTION_EVENT_ACTION_CANCEL,
diff --git a/services/input/InputDispatcher.h b/services/input/InputDispatcher.h
index 07ca9d5..06b8d64 100644
--- a/services/input/InputDispatcher.h
+++ b/services/input/InputDispatcher.h
@@ -732,8 +732,10 @@
             uint32_t source;
             int32_t keyCode;
             int32_t scanCode;
+            int32_t metaState;
             int32_t flags;
             nsecs_t downTime;
+            uint32_t policyFlags;
         };
 
         struct MotionMemento {
@@ -747,6 +749,7 @@
             PointerProperties pointerProperties[MAX_POINTERS];
             PointerCoords pointerCoords[MAX_POINTERS];
             bool hovering;
+            uint32_t policyFlags;
 
             void setPointers(const MotionEntry* entry);
         };
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java
index 8e3b825..a49ccf7 100644
--- a/services/java/com/android/server/InputMethodManagerService.java
+++ b/services/java/com/android/server/InputMethodManagerService.java
@@ -1142,6 +1142,10 @@
         if (mCurToken != null) {
             try {
                 if (DEBUG) Slog.v(TAG, "Removing window token: " + mCurToken);
+                if ((mImeWindowVis & InputMethodService.IME_ACTIVE) != 0) {
+                    // The current IME is shown. Hence an IME switch (transition) is happening.
+                    mWindowManagerService.saveLastInputMethodWindowForTransition();
+                }
                 mIWindowManager.removeWindowToken(mCurToken);
             } catch (RemoteException e) {
             }
@@ -2410,17 +2414,63 @@
         }
     }
 
-    private static class ImeSubtypeListItem {
+    private static class ImeSubtypeListItem implements Comparable<ImeSubtypeListItem> {
         public final CharSequence mImeName;
         public final CharSequence mSubtypeName;
         public final InputMethodInfo mImi;
         public final int mSubtypeId;
+        private final boolean mIsSystemLocale;
+        private final boolean mIsSystemLanguage;
+
         public ImeSubtypeListItem(CharSequence imeName, CharSequence subtypeName,
-                InputMethodInfo imi, int subtypeId) {
+                InputMethodInfo imi, int subtypeId, String subtypeLocale, String systemLocale) {
             mImeName = imeName;
             mSubtypeName = subtypeName;
             mImi = imi;
             mSubtypeId = subtypeId;
+            if (TextUtils.isEmpty(subtypeLocale)) {
+                mIsSystemLocale = false;
+                mIsSystemLanguage = false;
+            } else {
+                mIsSystemLocale = subtypeLocale.equals(systemLocale);
+                mIsSystemLanguage = mIsSystemLocale
+                        || subtypeLocale.startsWith(systemLocale.substring(0, 2));
+            }
+        }
+
+        @Override
+        public int compareTo(ImeSubtypeListItem other) {
+            if (TextUtils.isEmpty(mImeName)) {
+                return 1;
+            }
+            if (TextUtils.isEmpty(other.mImeName)) {
+                return -1;
+            }
+            if (!TextUtils.equals(mImeName, other.mImeName)) {
+                return mImeName.toString().compareTo(other.mImeName.toString());
+            }
+            if (TextUtils.equals(mSubtypeName, other.mSubtypeName)) {
+                return 0;
+            }
+            if (mIsSystemLocale) {
+                return -1;
+            }
+            if (other.mIsSystemLocale) {
+                return 1;
+            }
+            if (mIsSystemLanguage) {
+                return -1;
+            }
+            if (other.mIsSystemLanguage) {
+                return 1;
+            }
+            if (TextUtils.isEmpty(mSubtypeName)) {
+                return 1;
+            }
+            if (TextUtils.isEmpty(other.mSubtypeName)) {
+                return -1;
+            }
+            return mSubtypeName.toString().compareTo(other.mSubtypeName.toString());
         }
     }
 
@@ -2619,7 +2669,11 @@
         return getSubtypeIdFromHashCode(imi, subtypeId);
     }
 
-    private int getSubtypeIdFromHashCode(InputMethodInfo imi, int subtypeHashCode) {
+    private static boolean isValidSubtypeId(InputMethodInfo imi, int subtypeHashCode) {
+        return getSubtypeIdFromHashCode(imi, subtypeHashCode) != NOT_A_SUBTYPE_ID;
+    }
+
+    private static int getSubtypeIdFromHashCode(InputMethodInfo imi, int subtypeHashCode) {
         if (imi != null) {
             final int subtypeCount = imi.getSubtypeCount();
             for (int i = 0; i < subtypeCount; ++i) {
@@ -2844,6 +2898,9 @@
      */
     @Override
     public InputMethodSubtype getCurrentInputMethodSubtype() {
+        if (mCurMethodId == null) {
+            return null;
+        }
         boolean subtypeIsSelected = false;
         try {
             subtypeIsSelected = Settings.Secure.getInt(mContext.getContentResolver(),
@@ -2851,36 +2908,35 @@
         } catch (SettingNotFoundException e) {
         }
         synchronized (mMethodMap) {
-            if (!subtypeIsSelected || mCurrentSubtype == null) {
-                String lastInputMethodId = Settings.Secure.getString(
-                        mContext.getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD);
-                int subtypeId = getSelectedInputMethodSubtypeId(lastInputMethodId);
+            final InputMethodInfo imi = mMethodMap.get(mCurMethodId);
+            if (imi == null || imi.getSubtypeCount() == 0) {
+                return null;
+            }
+            if (!subtypeIsSelected || mCurrentSubtype == null
+                    || !isValidSubtypeId(imi, mCurrentSubtype.hashCode())) {
+                int subtypeId = getSelectedInputMethodSubtypeId(mCurMethodId);
                 if (subtypeId == NOT_A_SUBTYPE_ID) {
-                    InputMethodInfo imi = mMethodMap.get(lastInputMethodId);
-                    if (imi != null) {
-                        // If there are no selected subtypes, the framework will try to find
-                        // the most applicable subtype from explicitly or implicitly enabled
-                        // subtypes.
-                        List<InputMethodSubtype> explicitlyOrImplicitlyEnabledSubtypes =
-                                getEnabledInputMethodSubtypeList(imi, true);
-                        // If there is only one explicitly or implicitly enabled subtype,
-                        // just returns it.
-                        if (explicitlyOrImplicitlyEnabledSubtypes.size() == 1) {
-                            mCurrentSubtype = explicitlyOrImplicitlyEnabledSubtypes.get(0);
-                        } else if (explicitlyOrImplicitlyEnabledSubtypes.size() > 1) {
+                    // If there are no selected subtypes, the framework will try to find
+                    // the most applicable subtype from explicitly or implicitly enabled
+                    // subtypes.
+                    List<InputMethodSubtype> explicitlyOrImplicitlyEnabledSubtypes =
+                            getEnabledInputMethodSubtypeList(imi, true);
+                    // If there is only one explicitly or implicitly enabled subtype,
+                    // just returns it.
+                    if (explicitlyOrImplicitlyEnabledSubtypes.size() == 1) {
+                        mCurrentSubtype = explicitlyOrImplicitlyEnabledSubtypes.get(0);
+                    } else if (explicitlyOrImplicitlyEnabledSubtypes.size() > 1) {
+                        mCurrentSubtype = findLastResortApplicableSubtypeLocked(
+                                mRes, explicitlyOrImplicitlyEnabledSubtypes,
+                                SUBTYPE_MODE_KEYBOARD, null, true);
+                        if (mCurrentSubtype == null) {
                             mCurrentSubtype = findLastResortApplicableSubtypeLocked(
-                                    mRes, explicitlyOrImplicitlyEnabledSubtypes,
-                                    SUBTYPE_MODE_KEYBOARD, null, true);
-                            if (mCurrentSubtype == null) {
-                                mCurrentSubtype = findLastResortApplicableSubtypeLocked(
-                                        mRes, explicitlyOrImplicitlyEnabledSubtypes, null, null,
-                                        true);
-                            }
+                                    mRes, explicitlyOrImplicitlyEnabledSubtypes, null, null,
+                                    true);
                         }
                     }
                 } else {
-                    mCurrentSubtype =
-                            getSubtypes(mMethodMap.get(lastInputMethodId)).get(subtypeId);
+                    mCurrentSubtype = getSubtypes(imi).get(subtypeId);
                 }
             }
             return mCurrentSubtype;
@@ -2946,10 +3002,13 @@
         private final Context mContext;
         private final PackageManager mPm;
         private final InputMethodManagerService mImms;
+        private final String mSystemLocaleStr;
         public InputMethodAndSubtypeListManager(Context context, InputMethodManagerService imms) {
             mContext = context;
             mPm = context.getPackageManager();
             mImms = imms;
+            mSystemLocaleStr =
+                    imms.mLastSystemLocale != null ? imms.mLastSystemLocale.toString() : "";
         }
 
         private final TreeMap<InputMethodInfo, List<InputMethodSubtype>> mSortedImmis =
@@ -2979,7 +3038,7 @@
             }
             final int N = imList.size();
             final int currentSubtypeId = subtype != null
-                    ? mImms.getSubtypeIdFromHashCode(imi, subtype.hashCode())
+                    ? getSubtypeIdFromHashCode(imi, subtype.hashCode())
                     : NOT_A_SUBTYPE_ID;
             for (int i = 0; i < N; ++i) {
                 final ImeSubtypeListItem isli = imList.get(i);
@@ -3037,7 +3096,8 @@
                                     subtype.overridesImplicitlyEnabledSubtype() ? null
                                             : subtype.getDisplayName(mContext, imi.getPackageName(),
                                                     imi.getServiceInfo().applicationInfo);
-                            imList.add(new ImeSubtypeListItem(imeLabel, subtypeLabel, imi, j));
+                            imList.add(new ImeSubtypeListItem(imeLabel, subtypeLabel, imi, j,
+                                    subtype.getLocale(), mSystemLocaleStr));
 
                             // Removing this subtype from enabledSubtypeSet because we no longer
                             // need to add an entry of this subtype to imList to avoid duplicated
@@ -3046,9 +3106,11 @@
                         }
                     }
                 } else {
-                    imList.add(new ImeSubtypeListItem(imeLabel, null, imi, NOT_A_SUBTYPE_ID));
+                    imList.add(new ImeSubtypeListItem(imeLabel, null, imi, NOT_A_SUBTYPE_ID,
+                            null, mSystemLocaleStr));
                 }
             }
+            Collections.sort(imList);
             return imList;
         }
     }
@@ -3356,10 +3418,10 @@
             for (Pair<String, ArrayList<String>> enabledIme: enabledImes) {
                 if (enabledIme.first.equals(imeId)) {
                     final ArrayList<String> explicitlyEnabledSubtypes = enabledIme.second;
+                    final InputMethodInfo imi = mMethodMap.get(imeId);
                     if (explicitlyEnabledSubtypes.size() == 0) {
                         // If there are no explicitly enabled subtypes, applicable subtypes are
                         // enabled implicitly.
-                        InputMethodInfo imi = mMethodMap.get(imeId);
                         // If IME is enabled and no subtypes are enabled, applicable subtypes
                         // are enabled implicitly, so needs to treat them to be enabled.
                         if (imi != null && imi.getSubtypeCount() > 0) {
@@ -3379,7 +3441,17 @@
                         for (String s: explicitlyEnabledSubtypes) {
                             if (s.equals(subtypeHashCode)) {
                                 // If both imeId and subtypeId are enabled, return subtypeId.
-                                return s;
+                                try {
+                                    final int hashCode = Integer.valueOf(subtypeHashCode);
+                                    // Check whether the subtype id is valid or not
+                                    if (isValidSubtypeId(imi, hashCode)) {
+                                        return s;
+                                    } else {
+                                        return NOT_A_SUBTYPE_ID_STR;
+                                    }
+                                } catch (NumberFormatException e) {
+                                    return NOT_A_SUBTYPE_ID_STR;
+                                }
                             }
                         }
                     }
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java
index 663a031..52ba665 100755
--- a/services/java/com/android/server/NotificationManagerService.java
+++ b/services/java/com/android/server/NotificationManagerService.java
@@ -1046,7 +1046,7 @@
                 final boolean useDefaultVibrate =
                     (notification.defaults & Notification.DEFAULT_VIBRATE) != 0;
                 if ((useDefaultVibrate || notification.vibrate != null)
-                        && audioManager.shouldVibrate(AudioManager.VIBRATE_TYPE_NOTIFICATION)) {
+                        && !(audioManager.getRingerMode() == AudioManager.RINGER_MODE_SILENT)) {
                     mVibrateNotification = r;
 
                     mVibrator.vibrate(useDefaultVibrate ? DEFAULT_VIBRATE_PATTERN
diff --git a/services/java/com/android/server/NsdService.java b/services/java/com/android/server/NsdService.java
index f33bf8b..cc8e6a4 100644
--- a/services/java/com/android/server/NsdService.java
+++ b/services/java/com/android/server/NsdService.java
@@ -20,7 +20,7 @@
 import android.content.ContentResolver;
 import android.content.Intent;
 import android.content.pm.PackageManager;
-import android.net.nsd.DnsSdServiceInfo;
+import android.net.nsd.NsdServiceInfo;
 import android.net.nsd.DnsSdTxtRecord;
 import android.net.nsd.INsdManager;
 import android.net.nsd.NsdManager;
@@ -32,6 +32,7 @@
 import android.os.IBinder;
 import android.provider.Settings;
 import android.util.Slog;
+import android.util.SparseArray;
 
 import java.io.FileDescriptor;
 import java.io.PrintWriter;
@@ -72,13 +73,16 @@
      */
     private HashMap<Messenger, ClientInfo> mClients = new HashMap<Messenger, ClientInfo>();
 
+    /* A map from unique id to client info */
+    private SparseArray<ClientInfo> mIdToClientInfoMap= new SparseArray<ClientInfo>();
+
     private AsyncChannel mReplyChannel = new AsyncChannel();
 
     private int INVALID_ID = 0;
     private int mUniqueId = 1;
 
     private static final int BASE = Protocol.BASE_NSD_MANAGER;
-    private static final int CMD_TO_STRING_COUNT = NsdManager.STOP_RESOLVE - BASE + 1;
+    private static final int CMD_TO_STRING_COUNT = NsdManager.RESOLVE_SERVICE - BASE + 1;
     private static String[] sCmdToString = new String[CMD_TO_STRING_COUNT];
 
     static {
@@ -87,7 +91,6 @@
         sCmdToString[NsdManager.REGISTER_SERVICE - BASE] = "REGISTER";
         sCmdToString[NsdManager.UNREGISTER_SERVICE - BASE] = "UNREGISTER";
         sCmdToString[NsdManager.RESOLVE_SERVICE - BASE] = "RESOLVE";
-        sCmdToString[NsdManager.STOP_RESOLVE - BASE] = "STOP-RESOLVE";
     }
 
     private static String cmdToString(int cmd) {
@@ -101,9 +104,9 @@
 
     private class NsdStateMachine extends StateMachine {
 
-        private DefaultState mDefaultState = new DefaultState();
-        private DisabledState mDisabledState = new DisabledState();
-        private EnabledState mEnabledState = new EnabledState();
+        private final DefaultState mDefaultState = new DefaultState();
+        private final DisabledState mDisabledState = new DisabledState();
+        private final EnabledState mEnabledState = new EnabledState();
 
         @Override
         protected String getMessageInfo(Message msg) {
@@ -151,29 +154,26 @@
                         ac.connect(mContext, getHandler(), msg.replyTo);
                         break;
                     case NsdManager.DISCOVER_SERVICES:
-                        mReplyChannel.replyToMessage(msg, NsdManager.DISCOVER_SERVICES_FAILED,
-                                NsdManager.BUSY);
+                        replyToMessage(msg, NsdManager.DISCOVER_SERVICES_FAILED,
+                                NsdManager.FAILURE_INTERNAL_ERROR);
                        break;
                     case NsdManager.STOP_DISCOVERY:
-                            mReplyChannel.replyToMessage(msg, NsdManager.STOP_DISCOVERY_FAILED,
-                                    NsdManager.ERROR);
+                       replyToMessage(msg, NsdManager.STOP_DISCOVERY_FAILED,
+                               NsdManager.FAILURE_INTERNAL_ERROR);
                         break;
                     case NsdManager.REGISTER_SERVICE:
-                        mReplyChannel.replyToMessage(msg, NsdManager.REGISTER_SERVICE_FAILED,
-                                NsdManager.ERROR);
+                        replyToMessage(msg, NsdManager.REGISTER_SERVICE_FAILED,
+                                NsdManager.FAILURE_INTERNAL_ERROR);
                         break;
                     case NsdManager.UNREGISTER_SERVICE:
-                        mReplyChannel.replyToMessage(msg, NsdManager.UNREGISTER_SERVICE_FAILED,
-                                NsdManager.ERROR);
+                        replyToMessage(msg, NsdManager.UNREGISTER_SERVICE_FAILED,
+                                NsdManager.FAILURE_INTERNAL_ERROR);
                         break;
                     case NsdManager.RESOLVE_SERVICE:
-                        mReplyChannel.replyToMessage(msg, NsdManager.RESOLVE_SERVICE_FAILED,
-                                NsdManager.ERROR);
+                        replyToMessage(msg, NsdManager.RESOLVE_SERVICE_FAILED,
+                                NsdManager.FAILURE_INTERNAL_ERROR);
                         break;
-                    case NsdManager.STOP_RESOLVE:
-                        mReplyChannel.replyToMessage(msg, NsdManager.STOP_RESOLVE_FAILED,
-                                NsdManager.ERROR);
-                        break;
+                    case NsdManager.NATIVE_DAEMON_EVENT:
                     default:
                         Slog.e(TAG, "Unhandled " + msg);
                         return NOT_HANDLED;
@@ -217,11 +217,30 @@
                 }
             }
 
+            private boolean requestLimitReached(ClientInfo clientInfo) {
+                if (clientInfo.mClientIds.size() >= ClientInfo.MAX_LIMIT) {
+                    if (DBG) Slog.d(TAG, "Exceeded max outstanding requests " + clientInfo);
+                    return true;
+                }
+                return false;
+            }
+
+            private void storeRequestMap(int clientId, int globalId, ClientInfo clientInfo) {
+                clientInfo.mClientIds.put(clientId, globalId);
+                mIdToClientInfoMap.put(globalId, clientInfo);
+            }
+
+            private void removeRequestMap(int clientId, int globalId, ClientInfo clientInfo) {
+                clientInfo.mClientIds.remove(clientId);
+                mIdToClientInfoMap.remove(globalId);
+            }
+
             @Override
             public boolean processMessage(Message msg) {
                 ClientInfo clientInfo;
-                DnsSdServiceInfo servInfo;
+                NsdServiceInfo servInfo;
                 boolean result = HANDLED;
+                int id;
                 switch (msg.what) {
                   case AsyncChannel.CMD_CHANNEL_HALF_CONNECTED:
                         //First client
@@ -244,111 +263,112 @@
                         break;
                     case NsdManager.DISCOVER_SERVICES:
                         if (DBG) Slog.d(TAG, "Discover services");
-                        servInfo = (DnsSdServiceInfo) msg.obj;
+                        servInfo = (NsdServiceInfo) msg.obj;
                         clientInfo = mClients.get(msg.replyTo);
-                        if (clientInfo.mDiscoveryId != INVALID_ID) {
-                            //discovery already in progress
-                            if (DBG) Slog.d(TAG, "discovery in progress");
-                            mReplyChannel.replyToMessage(msg, NsdManager.DISCOVER_SERVICES_FAILED,
-                                    NsdManager.ALREADY_ACTIVE);
+
+                        if (requestLimitReached(clientInfo)) {
+                            replyToMessage(msg, NsdManager.DISCOVER_SERVICES_FAILED,
+                                    NsdManager.FAILURE_MAX_LIMIT);
                             break;
                         }
-                        clientInfo.mDiscoveryId = getUniqueId();
-                        if (discoverServices(clientInfo.mDiscoveryId, servInfo.getServiceType())) {
-                            mReplyChannel.replyToMessage(msg, NsdManager.DISCOVER_SERVICES_STARTED);
+
+                        id = getUniqueId();
+                        if (discoverServices(id, servInfo.getServiceType())) {
+                            if (DBG) {
+                                Slog.d(TAG, "Discover " + msg.arg2 + " " + id +
+                                        servInfo.getServiceType());
+                            }
+                            storeRequestMap(msg.arg2, id, clientInfo);
+                            replyToMessage(msg, NsdManager.DISCOVER_SERVICES_STARTED, servInfo);
                         } else {
-                            mReplyChannel.replyToMessage(msg, NsdManager.DISCOVER_SERVICES_FAILED,
-                                    NsdManager.ERROR);
-                            clientInfo.mDiscoveryId = INVALID_ID;
+                            stopServiceDiscovery(id);
+                            replyToMessage(msg, NsdManager.DISCOVER_SERVICES_FAILED,
+                                    NsdManager.FAILURE_INTERNAL_ERROR);
                         }
                         break;
                     case NsdManager.STOP_DISCOVERY:
                         if (DBG) Slog.d(TAG, "Stop service discovery");
                         clientInfo = mClients.get(msg.replyTo);
-                        if (clientInfo.mDiscoveryId == INVALID_ID) {
-                            //already stopped
-                            if (DBG) Slog.d(TAG, "discovery already stopped");
-                            mReplyChannel.replyToMessage(msg, NsdManager.STOP_DISCOVERY_FAILED,
-                                    NsdManager.ALREADY_ACTIVE);
+
+                        try {
+                            id = clientInfo.mClientIds.get(msg.arg2).intValue();
+                        } catch (NullPointerException e) {
+                            replyToMessage(msg, NsdManager.STOP_DISCOVERY_FAILED,
+                                    NsdManager.FAILURE_INTERNAL_ERROR);
                             break;
                         }
-                        if (stopServiceDiscovery(clientInfo.mDiscoveryId)) {
-                            clientInfo.mDiscoveryId = INVALID_ID;
-                            mReplyChannel.replyToMessage(msg, NsdManager.STOP_DISCOVERY_SUCCEEDED);
+                        removeRequestMap(msg.arg2, id, clientInfo);
+                        if (stopServiceDiscovery(id)) {
+                            replyToMessage(msg, NsdManager.STOP_DISCOVERY_SUCCEEDED);
                         } else {
-                            mReplyChannel.replyToMessage(msg, NsdManager.STOP_DISCOVERY_FAILED,
-                                    NsdManager.ERROR);
+                            replyToMessage(msg, NsdManager.STOP_DISCOVERY_FAILED,
+                                    NsdManager.FAILURE_INTERNAL_ERROR);
                         }
                         break;
                     case NsdManager.REGISTER_SERVICE:
                         if (DBG) Slog.d(TAG, "Register service");
                         clientInfo = mClients.get(msg.replyTo);
-                        if (clientInfo.mRegisteredIds.size() >= ClientInfo.MAX_REG) {
-                            if (DBG) Slog.d(TAG, "register service exceeds limit");
-                            mReplyChannel.replyToMessage(msg, NsdManager.REGISTER_SERVICE_FAILED,
-                                    NsdManager.MAX_REGS_REACHED);
+                        if (requestLimitReached(clientInfo)) {
+                            replyToMessage(msg, NsdManager.REGISTER_SERVICE_FAILED,
+                                    NsdManager.FAILURE_MAX_LIMIT);
+                            break;
                         }
 
-                        int id = getUniqueId();
-                        if (registerService(id, (DnsSdServiceInfo) msg.obj)) {
-                            clientInfo.mRegisteredIds.add(id);
+                        id = getUniqueId();
+                        if (registerService(id, (NsdServiceInfo) msg.obj)) {
+                            if (DBG) Slog.d(TAG, "Register " + msg.arg2 + " " + id);
+                            storeRequestMap(msg.arg2, id, clientInfo);
+                            // Return success after mDns reports success
                         } else {
-                            mReplyChannel.replyToMessage(msg, NsdManager.REGISTER_SERVICE_FAILED,
-                                    NsdManager.ERROR);
+                            unregisterService(id);
+                            replyToMessage(msg, NsdManager.REGISTER_SERVICE_FAILED,
+                                    NsdManager.FAILURE_INTERNAL_ERROR);
                         }
                         break;
                     case NsdManager.UNREGISTER_SERVICE:
                         if (DBG) Slog.d(TAG, "unregister service");
                         clientInfo = mClients.get(msg.replyTo);
-                        int regId = msg.arg1;
-                        if (clientInfo.mRegisteredIds.remove(new Integer(regId)) &&
-                                unregisterService(regId)) {
-                            mReplyChannel.replyToMessage(msg,
-                                    NsdManager.UNREGISTER_SERVICE_SUCCEEDED);
-                        } else {
-                            mReplyChannel.replyToMessage(msg, NsdManager.UNREGISTER_SERVICE_FAILED,
-                                    NsdManager.ERROR);
+                        try {
+                            id = clientInfo.mClientIds.get(msg.arg2).intValue();
+                        } catch (NullPointerException e) {
+                            replyToMessage(msg, NsdManager.UNREGISTER_SERVICE_FAILED,
+                                    NsdManager.FAILURE_INTERNAL_ERROR);
+                            break;
                         }
-                        break;
-                    case NsdManager.UPDATE_SERVICE:
-                        if (DBG) Slog.d(TAG, "Update service");
-                        //TODO: implement
-                        mReplyChannel.replyToMessage(msg, NsdManager.UPDATE_SERVICE_FAILED);
+                        removeRequestMap(msg.arg2, id, clientInfo);
+                        if (unregisterService(id)) {
+                            replyToMessage(msg, NsdManager.UNREGISTER_SERVICE_SUCCEEDED);
+                        } else {
+                            replyToMessage(msg, NsdManager.UNREGISTER_SERVICE_FAILED,
+                                    NsdManager.FAILURE_INTERNAL_ERROR);
+                        }
                         break;
                     case NsdManager.RESOLVE_SERVICE:
                         if (DBG) Slog.d(TAG, "Resolve service");
-                        servInfo = (DnsSdServiceInfo) msg.obj;
+                        servInfo = (NsdServiceInfo) msg.obj;
                         clientInfo = mClients.get(msg.replyTo);
-                        if (clientInfo.mResolveId != INVALID_ID) {
-                            //first cancel existing resolve
-                            stopResolveService(clientInfo.mResolveId);
-                        }
 
-                        clientInfo.mResolveId = getUniqueId();
-                        if (!resolveService(clientInfo.mResolveId, servInfo)) {
-                            mReplyChannel.replyToMessage(msg, NsdManager.RESOLVE_SERVICE_FAILED,
-                                    NsdManager.ERROR);
-                            clientInfo.mResolveId = INVALID_ID;
-                        }
-                        break;
-                    case NsdManager.STOP_RESOLVE:
-                        if (DBG) Slog.d(TAG, "Stop resolve");
-                        clientInfo = mClients.get(msg.replyTo);
-                        if (clientInfo.mResolveId == INVALID_ID) {
-                            //already stopped
-                            if (DBG) Slog.d(TAG, "resolve already stopped");
-                            mReplyChannel.replyToMessage(msg, NsdManager.STOP_RESOLVE_FAILED,
-                                    NsdManager.ALREADY_ACTIVE);
+
+                        if (clientInfo.mResolvedService != null) {
+                            replyToMessage(msg, NsdManager.RESOLVE_SERVICE_FAILED,
+                                    NsdManager.FAILURE_ALREADY_ACTIVE);
                             break;
                         }
-                        if (stopResolveService(clientInfo.mResolveId)) {
-                            clientInfo.mResolveId = INVALID_ID;
-                            mReplyChannel.replyToMessage(msg, NsdManager.STOP_RESOLVE_SUCCEEDED);
+
+                        id = getUniqueId();
+                        if (resolveService(id, servInfo)) {
+                            clientInfo.mResolvedService = new NsdServiceInfo();
+                            storeRequestMap(msg.arg2, id, clientInfo);
                         } else {
-                            mReplyChannel.replyToMessage(msg, NsdManager.STOP_RESOLVE_FAILED,
-                                    NsdManager.ERROR);
+                            replyToMessage(msg, NsdManager.RESOLVE_SERVICE_FAILED,
+                                    NsdManager.FAILURE_INTERNAL_ERROR);
                         }
                         break;
+                    case NsdManager.NATIVE_DAEMON_EVENT:
+                        NativeEvent event = (NativeEvent) msg.obj;
+                        handleNativeEvent(event.code, event.raw,
+                                NativeDaemonEvent.unescapeArgs(event.raw));
+                        break;
                     default:
                         result = NOT_HANDLED;
                         break;
@@ -439,121 +459,144 @@
         public static final int SERVICE_GET_ADDR_SUCCESS    =   612;
     }
 
+    private class NativeEvent {
+        int code;
+        String raw;
+
+        NativeEvent(int code, String raw) {
+            this.code = code;
+            this.raw = raw;
+        }
+    }
+
     class NativeCallbackReceiver implements INativeDaemonConnectorCallbacks {
         public void onDaemonConnected() {
             mNativeDaemonConnected.countDown();
         }
 
         public boolean onEvent(int code, String raw, String[] cooked) {
-            ClientInfo clientInfo;
-            DnsSdServiceInfo servInfo;
-            int id = Integer.parseInt(cooked[1]);
-            switch (code) {
-                case NativeResponseCode.SERVICE_FOUND:
-                    /* NNN uniqueId serviceName regType domain */
-                    if (DBG) Slog.d(TAG, "SERVICE_FOUND Raw: " + raw);
-                    clientInfo = getClientByDiscovery(id);
-                    if (clientInfo == null) break;
+            // TODO: NDC translates a message to a callback, we could enhance NDC to
+            // directly interact with a state machine through messages
+            NativeEvent event = new NativeEvent(code, raw);
+            mNsdStateMachine.sendMessage(NsdManager.NATIVE_DAEMON_EVENT, event);
+            return true;
+        }
+    }
 
-                    servInfo = new DnsSdServiceInfo(cooked[2], cooked[3], null);
-                    clientInfo.mChannel.sendMessage(NsdManager.SERVICE_FOUND, servInfo);
+    private void handleNativeEvent(int code, String raw, String[] cooked) {
+        NsdServiceInfo servInfo;
+        int id = Integer.parseInt(cooked[1]);
+        ClientInfo clientInfo = mIdToClientInfoMap.get(id);
+        if (clientInfo == null) {
+            Slog.e(TAG, "Unique id with no client mapping: " + id);
+            return;
+        }
+
+        /* This goes in response as msg.arg2 */
+        int clientId = -1;
+        int keyId = clientInfo.mClientIds.indexOfValue(id);
+        if (keyId != -1) {
+            clientId = clientInfo.mClientIds.keyAt(keyId);
+        }
+        switch (code) {
+            case NativeResponseCode.SERVICE_FOUND:
+                /* NNN uniqueId serviceName regType domain */
+                if (DBG) Slog.d(TAG, "SERVICE_FOUND Raw: " + raw);
+                servInfo = new NsdServiceInfo(cooked[2], cooked[3], null);
+                clientInfo.mChannel.sendMessage(NsdManager.SERVICE_FOUND, 0,
+                        clientId, servInfo);
+                break;
+            case NativeResponseCode.SERVICE_LOST:
+                /* NNN uniqueId serviceName regType domain */
+                if (DBG) Slog.d(TAG, "SERVICE_LOST Raw: " + raw);
+                servInfo = new NsdServiceInfo(cooked[2], cooked[3], null);
+                clientInfo.mChannel.sendMessage(NsdManager.SERVICE_LOST, 0,
+                        clientId, servInfo);
+                break;
+            case NativeResponseCode.SERVICE_DISCOVERY_FAILED:
+                /* NNN uniqueId errorCode */
+                if (DBG) Slog.d(TAG, "SERVICE_DISC_FAILED Raw: " + raw);
+                clientInfo.mChannel.sendMessage(NsdManager.DISCOVER_SERVICES_FAILED,
+                        NsdManager.FAILURE_INTERNAL_ERROR, clientId);
+                break;
+            case NativeResponseCode.SERVICE_REGISTERED:
+                /* NNN regId serviceName regType */
+                if (DBG) Slog.d(TAG, "SERVICE_REGISTERED Raw: " + raw);
+                servInfo = new NsdServiceInfo(cooked[2], null, null);
+                clientInfo.mChannel.sendMessage(NsdManager.REGISTER_SERVICE_SUCCEEDED,
+                        id, clientId, servInfo);
+                break;
+            case NativeResponseCode.SERVICE_REGISTRATION_FAILED:
+                /* NNN regId errorCode */
+                if (DBG) Slog.d(TAG, "SERVICE_REGISTER_FAILED Raw: " + raw);
+                clientInfo.mChannel.sendMessage(NsdManager.REGISTER_SERVICE_FAILED,
+                        NsdManager.FAILURE_INTERNAL_ERROR, clientId);
+                break;
+            case NativeResponseCode.SERVICE_UPDATED:
+                /* NNN regId */
+                break;
+            case NativeResponseCode.SERVICE_UPDATE_FAILED:
+                /* NNN regId errorCode */
+                break;
+            case NativeResponseCode.SERVICE_RESOLVED:
+                /* NNN resolveId fullName hostName port txtlen txtdata */
+                if (DBG) Slog.d(TAG, "SERVICE_RESOLVED Raw: " + raw);
+                int index = cooked[2].indexOf(".");
+                if (index == -1) {
+                    Slog.e(TAG, "Invalid service found " + raw);
                     break;
-                case NativeResponseCode.SERVICE_LOST:
-                    /* NNN uniqueId serviceName regType domain */
-                    if (DBG) Slog.d(TAG, "SERVICE_LOST Raw: " + raw);
-                    clientInfo = getClientByDiscovery(id);
-                    if (clientInfo == null) break;
+                }
+                String name = cooked[2].substring(0, index);
+                String rest = cooked[2].substring(index);
+                String type = rest.replace(".local.", "");
 
-                    servInfo = new DnsSdServiceInfo(cooked[2], cooked[3], null);
-                    clientInfo.mChannel.sendMessage(NsdManager.SERVICE_LOST, servInfo);
-                    break;
-                case NativeResponseCode.SERVICE_DISCOVERY_FAILED:
-                    /* NNN uniqueId errorCode */
-                    if (DBG) Slog.d(TAG, "SERVICE_DISC_FAILED Raw: " + raw);
-                    clientInfo = getClientByDiscovery(id);
-                    if (clientInfo == null) break;
+                clientInfo.mResolvedService.setServiceName(name);
+                clientInfo.mResolvedService.setServiceType(type);
+                clientInfo.mResolvedService.setPort(Integer.parseInt(cooked[4]));
 
-                    clientInfo.mChannel.sendMessage(NsdManager.DISCOVER_SERVICES_FAILED,
-                            NsdManager.ERROR);
-                    break;
-                case NativeResponseCode.SERVICE_REGISTERED:
-                    /* NNN regId serviceName regType */
-                    if (DBG) Slog.d(TAG, "SERVICE_REGISTERED Raw: " + raw);
-                    clientInfo = getClientByRegistration(id);
-                    if (clientInfo == null) break;
-
-                    servInfo = new DnsSdServiceInfo(cooked[2], null, null);
-                    clientInfo.mChannel.sendMessage(NsdManager.REGISTER_SERVICE_SUCCEEDED,
-                            id, 0, servInfo);
-                    break;
-                case NativeResponseCode.SERVICE_REGISTRATION_FAILED:
-                    /* NNN regId errorCode */
-                    if (DBG) Slog.d(TAG, "SERVICE_REGISTER_FAILED Raw: " + raw);
-                    clientInfo = getClientByRegistration(id);
-                    if (clientInfo == null) break;
-
-                    clientInfo.mChannel.sendMessage(NsdManager.REGISTER_SERVICE_FAILED,
-                            NsdManager.ERROR);
-                    break;
-                case NativeResponseCode.SERVICE_UPDATED:
-                    /* NNN regId */
-                    break;
-                case NativeResponseCode.SERVICE_UPDATE_FAILED:
-                    /* NNN regId errorCode */
-                    break;
-                case NativeResponseCode.SERVICE_RESOLVED:
-                    /* NNN resolveId fullName hostName port txtlen txtdata */
-                    if (DBG) Slog.d(TAG, "SERVICE_RESOLVED Raw: " + raw);
-                    clientInfo = getClientByResolve(id);
-                    if (clientInfo == null) break;
-
-                    int index = cooked[2].indexOf(".");
-                    if (index == -1) {
-                        Slog.e(TAG, "Invalid service found " + raw);
-                        break;
-                    }
-                    String name = cooked[2].substring(0, index);
-                    String rest = cooked[2].substring(index);
-                    String type = rest.replace(".local.", "");
-
-                    clientInfo.mResolvedService = new DnsSdServiceInfo(name, type, null);
-                    clientInfo.mResolvedService.setPort(Integer.parseInt(cooked[4]));
-
-                    stopResolveService(id);
-                    getAddrInfo(id, cooked[3]);
-                    break;
-                case NativeResponseCode.SERVICE_RESOLUTION_FAILED:
-                case NativeResponseCode.SERVICE_GET_ADDR_FAILED:
-                    /* NNN resolveId errorCode */
-                    if (DBG) Slog.d(TAG, "SERVICE_RESOLVE_FAILED Raw: " + raw);
-                    clientInfo = getClientByResolve(id);
-                    if (clientInfo == null) break;
-
+                stopResolveService(id);
+                if (!getAddrInfo(id, cooked[3])) {
                     clientInfo.mChannel.sendMessage(NsdManager.RESOLVE_SERVICE_FAILED,
-                            NsdManager.ERROR);
-                    break;
-                case NativeResponseCode.SERVICE_GET_ADDR_SUCCESS:
-                    /* NNN resolveId hostname ttl addr */
-                    if (DBG) Slog.d(TAG, "SERVICE_GET_ADDR_SUCCESS Raw: " + raw);
-                    clientInfo = getClientByResolve(id);
-                    if (clientInfo == null || clientInfo.mResolvedService == null) break;
-
-                    try {
-                        clientInfo.mResolvedService.setHost(InetAddress.getByName(cooked[4]));
-                        clientInfo.mChannel.sendMessage(NsdManager.RESOLVE_SERVICE_SUCCEEDED,
-                                clientInfo.mResolvedService);
-                        clientInfo.mResolvedService = null;
-                        clientInfo.mResolveId = INVALID_ID;
-                    } catch (java.net.UnknownHostException e) {
-                        clientInfo.mChannel.sendMessage(NsdManager.RESOLVE_SERVICE_FAILED,
-                                NsdManager.ERROR);
-                    }
-                    stopGetAddrInfo(id);
-                    break;
-                default:
-                    break;
-            }
-            return false;
+                            NsdManager.FAILURE_INTERNAL_ERROR, clientId);
+                    mIdToClientInfoMap.remove(id);
+                    clientInfo.mResolvedService = null;
+                }
+                break;
+            case NativeResponseCode.SERVICE_RESOLUTION_FAILED:
+                /* NNN resolveId errorCode */
+                if (DBG) Slog.d(TAG, "SERVICE_RESOLVE_FAILED Raw: " + raw);
+                stopResolveService(id);
+                mIdToClientInfoMap.remove(id);
+                clientInfo.mResolvedService = null;
+                clientInfo.mChannel.sendMessage(NsdManager.RESOLVE_SERVICE_FAILED,
+                        NsdManager.FAILURE_INTERNAL_ERROR, clientId);
+                break;
+            case NativeResponseCode.SERVICE_GET_ADDR_FAILED:
+                /* NNN resolveId errorCode */
+                stopGetAddrInfo(id);
+                mIdToClientInfoMap.remove(id);
+                clientInfo.mResolvedService = null;
+                if (DBG) Slog.d(TAG, "SERVICE_RESOLVE_FAILED Raw: " + raw);
+                clientInfo.mChannel.sendMessage(NsdManager.RESOLVE_SERVICE_FAILED,
+                        NsdManager.FAILURE_INTERNAL_ERROR, clientId);
+                break;
+            case NativeResponseCode.SERVICE_GET_ADDR_SUCCESS:
+                /* NNN resolveId hostname ttl addr */
+                if (DBG) Slog.d(TAG, "SERVICE_GET_ADDR_SUCCESS Raw: " + raw);
+                try {
+                    clientInfo.mResolvedService.setHost(InetAddress.getByName(cooked[4]));
+                    clientInfo.mChannel.sendMessage(NsdManager.RESOLVE_SERVICE_SUCCEEDED,
+                            0, clientId, clientInfo.mResolvedService);
+                } catch (java.net.UnknownHostException e) {
+                    clientInfo.mChannel.sendMessage(NsdManager.RESOLVE_SERVICE_FAILED,
+                            NsdManager.FAILURE_INTERNAL_ERROR, clientId);
+                }
+                stopGetAddrInfo(id);
+                mIdToClientInfoMap.remove(id);
+                clientInfo.mResolvedService = null;
+                break;
+            default:
+                break;
         }
     }
 
@@ -579,7 +622,7 @@
         return true;
     }
 
-    private boolean registerService(int regId, DnsSdServiceInfo service) {
+    private boolean registerService(int regId, NsdServiceInfo service) {
         if (DBG) Slog.d(TAG, "registerService: " + regId + " " + service);
         try {
             //Add txtlen and txtdata
@@ -637,7 +680,7 @@
         return true;
     }
 
-    private boolean resolveService(int resolveId, DnsSdServiceInfo service) {
+    private boolean resolveService(int resolveId, NsdServiceInfo service) {
         if (DBG) Slog.d(TAG, "resolveService: " + resolveId + " " + service);
         try {
             mNativeConnector.execute("mdnssd", "resolve", resolveId, service.getServiceName(),
@@ -700,49 +743,52 @@
         mNsdStateMachine.dump(fd, pw, args);
     }
 
-    private ClientInfo getClientByDiscovery(int discoveryId) {
-        for (ClientInfo c: mClients.values()) {
-            if (c.mDiscoveryId == discoveryId) {
-                return c;
-            }
-        }
-        return null;
+    /* arg2 on the source message has an id that needs to be retained in replies
+     * see NsdManager for details */
+    private Message obtainMessage(Message srcMsg) {
+        Message msg = Message.obtain();
+        msg.arg2 = srcMsg.arg2;
+        return msg;
     }
 
-    private ClientInfo getClientByResolve(int resolveId) {
-        for (ClientInfo c: mClients.values()) {
-            if (c.mResolveId == resolveId) {
-                return c;
-            }
-        }
-        return null;
+    private void replyToMessage(Message msg, int what) {
+        if (msg.replyTo == null) return;
+        Message dstMsg = obtainMessage(msg);
+        dstMsg.what = what;
+        mReplyChannel.replyToMessage(msg, dstMsg);
     }
 
-    private ClientInfo getClientByRegistration(int regId) {
-        for (ClientInfo c: mClients.values()) {
-            if (c.mRegisteredIds.contains(regId)) {
-                return c;
-            }
-        }
-        return null;
+    private void replyToMessage(Message msg, int what, int arg1) {
+        if (msg.replyTo == null) return;
+        Message dstMsg = obtainMessage(msg);
+        dstMsg.what = what;
+        dstMsg.arg1 = arg1;
+        mReplyChannel.replyToMessage(msg, dstMsg);
+    }
+
+    private void replyToMessage(Message msg, int what, Object obj) {
+        if (msg.replyTo == null) return;
+        Message dstMsg = obtainMessage(msg);
+        dstMsg.what = what;
+        dstMsg.obj = obj;
+        mReplyChannel.replyToMessage(msg, dstMsg);
     }
 
     /* Information tracked per client */
     private class ClientInfo {
 
-        private static final int MAX_REG = 5;
+        private static final int MAX_LIMIT = 10;
         private AsyncChannel mChannel;
         private Messenger mMessenger;
-        private int mDiscoveryId;
-        private int mResolveId;
         /* Remembers a resolved service until getaddrinfo completes */
-        private DnsSdServiceInfo mResolvedService;
-        private ArrayList<Integer> mRegisteredIds = new ArrayList<Integer>();
+        private NsdServiceInfo mResolvedService;
+
+        /* A map from client id to unique id sent to mDns */
+        private SparseArray<Integer> mClientIds = new SparseArray<Integer>();
 
         private ClientInfo(AsyncChannel c, Messenger m) {
             mChannel = c;
             mMessenger = m;
-            mDiscoveryId = mResolveId = INVALID_ID;
             if (DBG) Slog.d(TAG, "New client, channel: " + c + " messenger: " + m);
         }
 
@@ -751,11 +797,10 @@
             StringBuffer sb = new StringBuffer();
             sb.append("mChannel ").append(mChannel).append("\n");
             sb.append("mMessenger ").append(mMessenger).append("\n");
-            sb.append("mDiscoveryId ").append(mDiscoveryId).append("\n");
-            sb.append("mResolveId ").append(mResolveId).append("\n");
             sb.append("mResolvedService ").append(mResolvedService).append("\n");
-            for(int regId : mRegisteredIds) {
-                sb.append("regId ").append(regId).append("\n");
+            for(int i = 0; i< mClientIds.size(); i++) {
+                sb.append("clientId ").append(mClientIds.keyAt(i));
+                sb.append(" mDnsId ").append(mClientIds.valueAt(i)).append("\n");
             }
             return sb.toString();
         }
diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java
index 5799f2b..289ab2a 100644
--- a/services/java/com/android/server/PowerManagerService.java
+++ b/services/java/com/android/server/PowerManagerService.java
@@ -485,7 +485,7 @@
                 //mDimScreen = getInt(DIM_SCREEN) != 0;
 
                 mScreenBrightnessSetting = getInt(SCREEN_BRIGHTNESS, DEFAULT_SCREEN_BRIGHTNESS);
-                mLightSensorAdjustSetting = getFloat(SCREEN_AUTO_BRIGHTNESS_ADJ, 0);
+                mLightSensorAdjustSetting = 0; //getFloat(SCREEN_AUTO_BRIGHTNESS_ADJ, 0);
 
                 // SCREEN_BRIGHTNESS_MODE, default to manual
                 setScreenBrightnessMode(getInt(SCREEN_BRIGHTNESS_MODE,
@@ -649,7 +649,7 @@
                         + Settings.System.NAME + "=?) or ("
                         + Settings.System.NAME + "=?)",
                 new String[]{STAY_ON_WHILE_PLUGGED_IN, SCREEN_OFF_TIMEOUT, DIM_SCREEN, SCREEN_BRIGHTNESS,
-                        SCREEN_BRIGHTNESS_MODE, SCREEN_AUTO_BRIGHTNESS_ADJ,
+                        SCREEN_BRIGHTNESS_MODE, /*SCREEN_AUTO_BRIGHTNESS_ADJ,*/
                         WINDOW_ANIMATION_SCALE, TRANSITION_ANIMATION_SCALE},
                 null);
         mSettings = new ContentQueryMap(settingsCursor, Settings.System.NAME, true, mHandler);
diff --git a/services/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/java/com/android/server/accessibility/AccessibilityManagerService.java
index fbe4a83..df7bbf2 100644
--- a/services/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -17,7 +17,7 @@
 package com.android.server.accessibility;
 
 import static android.accessibilityservice.AccessibilityServiceInfo.DEFAULT;
-import static android.accessibilityservice.AccessibilityServiceInfo.INCLUDE_NOT_IMPORTANT_VIEWS;
+import static android.accessibilityservice.AccessibilityServiceInfo.FLAG_INCLUDE_NOT_IMPORTANT_VIEWS;
 
 import android.Manifest;
 import android.accessibilityservice.AccessibilityService;
@@ -259,7 +259,7 @@
                         updateInputFilterLocked();
                         sendStateToClientsLocked();
                     }
-                    
+
                     return;
                 }
 
@@ -531,12 +531,12 @@
         //       last record in the enabled services setting. Ideally,
         //       the user should make the call which service handles
         //       gestures. However, only one service should handle
-        //       gestrues to avoid user frustration when different
-        //       bahiour is observed from different combinations of
+        //       gestures to avoid user frustration when different
+        //       behavior is observed from different combinations of
         //       enabled accessibility services.
         for (int i = mServices.size() - 1; i >= 0; i--) {
             Service service = mServices.get(i);
-            if (service.mCanHandleGestures && service.mIsDefault == isDefault) {
+            if (service.mReqeustTouchExplorationMode && service.mIsDefault == isDefault) {
                 mGestureHandler.scheduleHandleGesture(gestureId, service.mServiceInterface);
                 return true;
             }
@@ -1225,7 +1225,7 @@
 
         boolean mCanRetrieveScreenContent;
 
-        boolean mCanHandleGestures;
+        boolean mReqeustTouchExplorationMode;
 
         boolean mIsAutomation;
 
@@ -1243,7 +1243,9 @@
             mIsAutomation = isAutomation;
             if (!isAutomation) {
                 mCanRetrieveScreenContent = accessibilityServiceInfo.getCanRetrieveWindowContent();
-                mCanHandleGestures = accessibilityServiceInfo.getCanHandleGestures();
+                mReqeustTouchExplorationMode =
+                    (accessibilityServiceInfo.flags
+                            & AccessibilityServiceInfo.FLAG_REQUEST_TOUCH_EXPLORATION_MODE) != 0;
                 mIntent = new Intent().setComponent(mComponentName);
                 mIntent.putExtra(Intent.EXTRA_CLIENT_LABEL,
                         com.android.internal.R.string.accessibility_binding_label);
@@ -1251,8 +1253,6 @@
                         mContext, 0, new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS), 0));
             } else {
                 mCanRetrieveScreenContent = true;
-                mIncludeNotImportantViews = true;
-                mCanHandleGestures = true;
             }
             setDynamicallyConfigurableProperties(accessibilityServiceInfo);
         }
@@ -1267,16 +1267,13 @@
             mNotificationTimeout = info.notificationTimeout;
             mIsDefault = (info.flags & DEFAULT) != 0;
 
-            if (!mIsAutomation) {
-                final int targetSdkVersion =
-                    info.getResolveInfo().serviceInfo.applicationInfo.targetSdkVersion;
-                // TODO: Uncomment this line and remove the line below when JellyBean
-                // SDK version is finalized.
-                // if (targetSdkVersion >= Build.VERSION_CODES.JELLY_BEAN) {
-                if (targetSdkVersion > Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
-                    mIncludeNotImportantViews =
-                        (info.flags & INCLUDE_NOT_IMPORTANT_VIEWS) != 0;
-                }
+            if (mIsAutomation || info.getResolveInfo().serviceInfo.applicationInfo.targetSdkVersion
+                    // TODO: Uncomment this line and remove the line below when JellyBean
+                    // SDK version is finalized.
+                    // >= Build.VERSION_CODES.JELLY_BEAN) {
+                    > Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
+                mIncludeNotImportantViews =
+                    (info.flags & FLAG_INCLUDE_NOT_IMPORTANT_VIEWS) != 0;
             }
 
             synchronized (mLock) {
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index 0f8d151..54ef724 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -1567,6 +1567,31 @@
     @Override
     public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
             throws RemoteException {
+        if (code == SYSPROPS_TRANSACTION) {
+            // We need to tell all apps about the system property change.
+            ArrayList<IBinder> procs = new ArrayList<IBinder>();
+            synchronized(this) {
+                for (SparseArray<ProcessRecord> apps : mProcessNames.getMap().values()) {
+                    final int NA = apps.size();
+                    for (int ia=0; ia<NA; ia++) {
+                        ProcessRecord app = apps.valueAt(ia);
+                        if (app.thread != null) {
+                            procs.add(app.thread.asBinder());
+                        }
+                    }
+                }
+            }
+
+            int N = procs.size();
+            for (int i=0; i<N; i++) {
+                Parcel data2 = Parcel.obtain();
+                try {
+                    procs.get(i).transact(IBinder.SYSPROPS_TRANSACTION, data2, null, 0);
+                } catch (RemoteException e) {
+                }
+                data2.recycle();
+            }
+        }
         try {
             return super.onTransact(code, data, reply, flags);
         } catch (RuntimeException e) {
@@ -4098,6 +4123,10 @@
         EventLog.writeEvent(EventLogTags.BOOT_PROGRESS_ENABLE_SCREEN,
                 SystemClock.uptimeMillis());
         mWindowManager.enableScreenAfterBoot();
+
+        synchronized (this) {
+            updateEventDispatchingLocked();
+        }
     }
 
     public void showBootMessage(final CharSequence msg, final boolean always) {
@@ -5331,6 +5360,7 @@
         final long homeAppMem = mProcessList.getMemLevel(ProcessList.HOME_APP_ADJ);
         final long hiddenAppMem = mProcessList.getMemLevel(ProcessList.HIDDEN_APP_MIN_ADJ);
         outInfo.availMem = Process.getFreeMemory();
+        outInfo.totalMem = Process.getTotalMemory();
         outInfo.threshold = homeAppMem;
         outInfo.lowMemory = outInfo.availMem < (homeAppMem + ((hiddenAppMem-homeAppMem)/2));
         outInfo.hiddenAppThreshold = hiddenAppMem;
@@ -6686,7 +6716,7 @@
 
         synchronized(this) {
             mWentToSleep = true;
-            mWindowManager.setEventDispatching(false);
+            updateEventDispatchingLocked();
 
             if (!mSleeping) {
                 mSleeping = true;
@@ -6712,7 +6742,7 @@
         
         synchronized(this) {
             mShuttingDown = true;
-            mWindowManager.setEventDispatching(false);
+            updateEventDispatchingLocked();
 
             if (mMainStack.mResumedActivity != null) {
                 mMainStack.stopIfSleepingLocked();
@@ -6776,11 +6806,15 @@
 
         synchronized(this) {
             mWentToSleep = false;
-            mWindowManager.setEventDispatching(true);
+            updateEventDispatchingLocked();
             comeOutOfSleepIfNeededLocked();
         }
     }
 
+    private void updateEventDispatchingLocked() {
+        mWindowManager.setEventDispatching(mBooted && !mWentToSleep && !mShuttingDown);
+    }
+
     public void setLockScreenShown(boolean shown) {
         if (checkCallingPermission(android.Manifest.permission.DEVICE_POWER)
                 != PackageManager.PERMISSION_GRANTED) {
@@ -11049,7 +11083,7 @@
                     updateOomAdjLocked(r.app);
                 }
                 int flags = 0;
-                if (si.deliveryCount > 0) {
+                if (si.deliveryCount > 1) {
                     flags |= Service.START_FLAG_RETRY;
                 }
                 if (si.doneExecutingCount > 0) {
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java
index 1e14f5b..c300411 100755
--- a/services/java/com/android/server/am/ActivityStack.java
+++ b/services/java/com/android/server/am/ActivityStack.java
@@ -1794,10 +1794,6 @@
                 mService.mWindowManager.prepareAppTransition(
                         WindowManagerPolicy.TRANSIT_NONE, keepCurTransition);
                 mNoAnimActivities.add(r);
-            } else if ((r.intent.getFlags()&Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET) != 0) {
-                mService.mWindowManager.prepareAppTransition(
-                        WindowManagerPolicy.TRANSIT_TASK_OPEN, keepCurTransition);
-                mNoAnimActivities.remove(r);
             } else {
                 mService.mWindowManager.prepareAppTransition(newTask
                         ? WindowManagerPolicy.TRANSIT_TASK_OPEN
diff --git a/services/java/com/android/server/location/GpsLocationProvider.java b/services/java/com/android/server/location/GpsLocationProvider.java
index 65b9627..ce53499 100755
--- a/services/java/com/android/server/location/GpsLocationProvider.java
+++ b/services/java/com/android/server/location/GpsLocationProvider.java
@@ -192,6 +192,11 @@
     // stop trying if we do not receive a fix within 60 seconds
     private static final int NO_FIX_TIMEOUT = 60 * 1000;
 
+    // if the fix interval is below this we leave GPS on,
+    // if above then we cycle the GPS driver.
+    // Typical hot TTTF is ~5 seconds, so 10 seconds seems sane.
+    private static final int GPS_POLLING_THRESHOLD_INTERVAL = 10 * 1000;
+
     // true if we are enabled
     private volatile boolean mEnabled;
     
@@ -842,7 +847,18 @@
     }
 
     public String getInternalState() {
-        return native_get_internal_state();
+        StringBuilder s = new StringBuilder();
+        s.append("  mFixInterval=").append(mFixInterval).append("\n");
+        s.append("  mEngineCapabilities=0x").append(Integer.toHexString(mEngineCapabilities)).append(" (");
+        if (hasCapability(GPS_CAPABILITY_SCHEDULING)) s.append("SCHED ");
+        if (hasCapability(GPS_CAPABILITY_MSB)) s.append("MSB ");
+        if (hasCapability(GPS_CAPABILITY_MSA)) s.append("MSA ");
+        if (hasCapability(GPS_CAPABILITY_SINGLE_SHOT)) s.append("SINGLE_SHOT ");
+        if (hasCapability(GPS_CAPABILITY_ON_DEMAND_TIME)) s.append("ON_DEMAND_TIME ");
+        s.append(")\n");
+
+        s.append(native_get_internal_state());
+        return s.toString();
     }
 
     private final class Listener implements IBinder.DeathRecipient {
@@ -1131,7 +1147,8 @@
             updateStatus(LocationProvider.AVAILABLE, mSvCount);
         }
 
-       if (!hasCapability(GPS_CAPABILITY_SCHEDULING) && mStarted && mFixInterval > 1000) {
+       if (!hasCapability(GPS_CAPABILITY_SCHEDULING) && mStarted &&
+               mFixInterval > GPS_POLLING_THRESHOLD_INTERVAL) {
             if (DEBUG) Log.d(TAG, "got fix, hibernating");
             hibernate();
         }
diff --git a/services/java/com/android/server/net/NetworkStatsRecorder.java b/services/java/com/android/server/net/NetworkStatsRecorder.java
index 2ce7771..c3ecf54 100644
--- a/services/java/com/android/server/net/NetworkStatsRecorder.java
+++ b/services/java/com/android/server/net/NetworkStatsRecorder.java
@@ -26,6 +26,7 @@
 import android.net.NetworkStatsHistory;
 import android.net.NetworkTemplate;
 import android.net.TrafficStats;
+import android.os.DropBoxManager;
 import android.util.Log;
 import android.util.MathUtils;
 import android.util.Slog;
@@ -34,6 +35,7 @@
 import com.android.internal.util.IndentingPrintWriter;
 import com.google.android.collect.Sets;
 
+import java.io.ByteArrayOutputStream;
 import java.io.DataOutputStream;
 import java.io.File;
 import java.io.IOException;
@@ -43,6 +45,8 @@
 import java.util.HashSet;
 import java.util.Map;
 
+import libcore.io.IoUtils;
+
 /**
  * Logic to record deltas between periodic {@link NetworkStats} snapshots into
  * {@link NetworkStatsHistory} that belong to {@link NetworkStatsCollection}.
@@ -56,8 +60,14 @@
     private static final boolean LOGD = false;
     private static final boolean LOGV = false;
 
+    private static final String TAG_NETSTATS_DUMP = "netstats_dump";
+
+    /** Dump before deleting in {@link #recoverFromWtf()}. */
+    private static final boolean DUMP_BEFORE_DELETE = true;
+
     private final FileRotator mRotator;
     private final NonMonotonicObserver<String> mObserver;
+    private final DropBoxManager mDropBox;
     private final String mCookie;
 
     private final long mBucketDuration;
@@ -74,9 +84,10 @@
     private WeakReference<NetworkStatsCollection> mComplete;
 
     public NetworkStatsRecorder(FileRotator rotator, NonMonotonicObserver<String> observer,
-            String cookie, long bucketDuration, boolean onlyTags) {
+            DropBoxManager dropBox, String cookie, long bucketDuration, boolean onlyTags) {
         mRotator = checkNotNull(rotator, "missing FileRotator");
         mObserver = checkNotNull(observer, "missing NonMonotonicObserver");
+        mDropBox = checkNotNull(dropBox, "missing DropBoxManager");
         mCookie = cookie;
 
         mBucketDuration = bucketDuration;
@@ -122,6 +133,7 @@
                 mComplete = new WeakReference<NetworkStatsCollection>(complete);
             } catch (IOException e) {
                 Log.wtf(TAG, "problem completely reading network stats", e);
+                recoverFromWtf();
             }
         }
         return complete;
@@ -212,6 +224,7 @@
                 mPending.reset();
             } catch (IOException e) {
                 Log.wtf(TAG, "problem persisting pending stats", e);
+                recoverFromWtf();
             }
         }
     }
@@ -226,6 +239,7 @@
             mRotator.rewriteAll(new RemoveUidRewriter(mBucketDuration, uid));
         } catch (IOException e) {
             Log.wtf(TAG, "problem removing UID " + uid, e);
+            recoverFromWtf();
         }
 
         // clear UID from current stats snapshot
@@ -355,4 +369,25 @@
             mSinceBoot.dump(pw);
         }
     }
+
+    /**
+     * Recover from {@link FileRotator} failure by dumping state to
+     * {@link DropBoxManager} and deleting contents.
+     */
+    private void recoverFromWtf() {
+        if (DUMP_BEFORE_DELETE) {
+            final ByteArrayOutputStream os = new ByteArrayOutputStream();
+            try {
+                mRotator.dumpAll(os);
+            } catch (IOException e) {
+                // ignore partial contents
+                os.reset();
+            } finally {
+                IoUtils.closeQuietly(os);
+            }
+            mDropBox.addData(TAG_NETSTATS_DUMP, os.toByteArray(), 0);
+        }
+
+        mRotator.deleteAll();
+    }
 }
diff --git a/services/java/com/android/server/net/NetworkStatsService.java b/services/java/com/android/server/net/NetworkStatsService.java
index 1a56b80..e710b33 100644
--- a/services/java/com/android/server/net/NetworkStatsService.java
+++ b/services/java/com/android/server/net/NetworkStatsService.java
@@ -338,9 +338,11 @@
 
     private NetworkStatsRecorder buildRecorder(
             String prefix, NetworkStatsSettings.Config config, boolean includeTags) {
+        final DropBoxManager dropBox = (DropBoxManager) mContext.getSystemService(
+                Context.DROPBOX_SERVICE);
         return new NetworkStatsRecorder(new FileRotator(
                 mBaseDir, prefix, config.rotateAgeMillis, config.deleteAgeMillis),
-                mNonMonotonicObserver, prefix, config.bucketDuration, includeTags);
+                mNonMonotonicObserver, dropBox, prefix, config.bucketDuration, includeTags);
     }
 
     private void shutdownLocked() {
diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java
index b5567d3..d41cd5a 100644
--- a/services/java/com/android/server/pm/PackageManagerService.java
+++ b/services/java/com/android/server/pm/PackageManagerService.java
@@ -1050,7 +1050,7 @@
             mSystemInstallObserver.startWatching();
             scanDirLI(mSystemAppDir, PackageParser.PARSE_IS_SYSTEM
                     | PackageParser.PARSE_IS_SYSTEM_DIR, scanMode, 0);
-            
+
             // Collect all vendor packages.
             mVendorAppDir = new File("/vendor/app");
             mVendorInstallObserver = new AppDirObserver(
@@ -1063,23 +1063,51 @@
             mInstaller.moveFiles();
 
             // Prune any system packages that no longer exist.
+            final List<String> possiblyDeletedSystemApps = new ArrayList<String>();
             if (!mOnlyCore) {
                 Iterator<PackageSetting> psit = mSettings.mPackages.values().iterator();
                 while (psit.hasNext()) {
                     PackageSetting ps = psit.next();
-                    if ((ps.pkgFlags&ApplicationInfo.FLAG_SYSTEM) != 0
-                            && !mPackages.containsKey(ps.name)
-                            && !mSettings.mDisabledSysPackages.containsKey(ps.name)) {
+
+                    /*
+                     * If this is not a system app, it can't be a
+                     * disable system app.
+                     */
+                    if ((ps.pkgFlags & ApplicationInfo.FLAG_SYSTEM) == 0) {
+                        continue;
+                    }
+
+                    /*
+                     * If the package is scanned, it's not erased.
+                     */
+                    if (mPackages.containsKey(ps.name)) {
+                        /*
+                         * If the system app is both scanned and in the
+                         * disabled packages list, then it must have been
+                         * added via OTA. Remove it from the currently
+                         * scanned package so the previously user-installed
+                         * application can be scanned.
+                         */
+                        if (mSettings.isDisabledSystemPackageLPr(ps.name)) {
+                            mPackages.remove(ps.name);
+                        }
+
+                        continue;
+                    }
+
+                    if (!mSettings.isDisabledSystemPackageLPr(ps.name)) {
                         psit.remove();
                         String msg = "System package " + ps.name
                                 + " no longer exists; wiping its data";
                         reportSettingsProblem(Log.WARN, msg);
                         mInstaller.remove(ps.name, 0);
                         sUserManager.removePackageForAllUsers(ps.name);
+                    } else {
+                        possiblyDeletedSystemApps.add(ps.name);
                     }
                 }
             }
-            
+
             mAppInstallDir = new File(dataDir, "app");
             //look for any incomplete package installations
             ArrayList<PackageSetting> deletePkgsList = mSettings.getListOfIncompleteInstallPackagesLPr();
@@ -1104,6 +1132,21 @@
                 mDrmAppInstallObserver.startWatching();
                 scanDirLI(mDrmAppPrivateInstallDir, PackageParser.PARSE_FORWARD_LOCK,
                         scanMode, 0);
+
+                /**
+                 * Remove disable package settings for any system apps
+                 * that were removed via an OTA.
+                 */
+                for (String deletedAppName : possiblyDeletedSystemApps) {
+                    PackageParser.Package deletedPkg = mPackages.get(deletedAppName);
+                    if (deletedPkg != null) {
+                        mSettings.removeDisabledSystemPackageLPw(deletedAppName);
+                        deletedPkg.applicationInfo.flags &= ~ApplicationInfo.FLAG_SYSTEM;
+
+                        PackageSetting deletedPs = mSettings.mPackages.get(deletedAppName);
+                        deletedPs.pkgFlags &= ~ApplicationInfo.FLAG_SYSTEM;
+                    }
+                }
             } else {
                 mAppInstallObserver = null;
                 mDrmAppInstallObserver = null;
@@ -3043,8 +3086,7 @@
             // Check to see if this package could be hiding/updating a system
             // package.  Must look for it either under the original or real
             // package name depending on our state.
-            updatedPkg = mSettings.mDisabledSysPackages.get(
-                    ps != null ? ps.name : pkg.packageName);
+            updatedPkg = mSettings.getDisabledSystemPkgLPr(ps != null ? ps.name : pkg.packageName);
         }
         // First check if this is a system package that may involve an update
         if (updatedPkg != null && (parseFlags&PackageParser.PARSE_IS_SYSTEM) != 0) {
@@ -3076,15 +3118,22 @@
                             + "reverting from " + ps.codePathString
                             + ": new version " + pkg.mVersionCode
                             + " better than installed " + ps.versionCode);
-                    InstallArgs args = new FileInstallArgs(ps.codePathString,
-                            ps.resourcePathString, ps.nativeLibraryPathString);
-                    args.cleanUpResourcesLI();
-                    mSettings.enableSystemPackageLPw(ps.name);
+
+                    InstallArgs args = createInstallArgs(packageFlagsToInstallFlags(ps),
+                            ps.codePathString, ps.resourcePathString, ps.nativeLibraryPathString);
+                    synchronized (mInstaller) {
+                        args.cleanUpResourcesLI();
+                    }
+                    synchronized (mPackages) {
+                        mSettings.enableSystemPackageLPw(ps.name);
+                    }
                 }
             }
         }
+
         if (updatedPkg != null) {
-            // An updated system app will not have the PARSE_IS_SYSTEM flag set initially
+            // An updated system app will not have the PARSE_IS_SYSTEM flag set
+            // initially
             parseFlags |= PackageParser.PARSE_IS_SYSTEM;
         }
         // Verify certificates against what was last scanned
@@ -3092,6 +3141,49 @@
             Slog.w(TAG, "Failed verifying certificates for package:" + pkg.packageName);
             return null;
         }
+
+        /*
+         * A new system app appeared, but we already had a non-system one of the
+         * same name installed earlier.
+         */
+        boolean shouldHideSystemApp = false;
+        if (updatedPkg == null && ps != null
+                && (parseFlags & PackageParser.PARSE_IS_SYSTEM_DIR) != 0 && !isSystemApp(ps)) {
+            /*
+             * Check to make sure the signatures match first. If they don't,
+             * wipe the installed application and its data.
+             */
+            if (compareSignatures(ps.signatures.mSignatures, pkg.mSignatures)
+                    != PackageManager.SIGNATURE_MATCH) {
+                deletePackageLI(pkg.packageName, true, 0, null, false);
+                ps = null;
+            } else {
+                /*
+                 * If the newly-added system app is an older version than the
+                 * already installed version, hide it. It will be scanned later
+                 * and re-added like an update.
+                 */
+                if (pkg.mVersionCode < ps.versionCode) {
+                    shouldHideSystemApp = true;
+                } else {
+                    /*
+                     * The newly found system app is a newer version that the
+                     * one previously installed. Simply remove the
+                     * already-installed application and replace it with our own
+                     * while keeping the application data.
+                     */
+                    Slog.w(TAG, "Package " + ps.name + " at " + scanFile + "reverting from "
+                            + ps.codePathString + ": new version " + pkg.mVersionCode
+                            + " better than installed " + ps.versionCode);
+                    InstallArgs args = createInstallArgs(packageFlagsToInstallFlags(ps),
+                            ps.codePathString, ps.resourcePathString, ps.nativeLibraryPathString);
+                    synchronized (mInstaller) {
+                        args.cleanUpResourcesLI();
+                    }
+                }
+            }
+        }
+
         // The apk is forward locked (not public) if its code and resources
         // are kept in different files.
         // TODO grab this value from PackageSettings
@@ -3115,7 +3207,27 @@
         // Set application objects path explicitly.
         setApplicationInfoPaths(pkg, codePath, resPath);
         // Note that we invoke the following method only if we are about to unpack an application
-        return scanPackageLI(pkg, parseFlags, scanMode | SCAN_UPDATE_SIGNATURE, currentTime);
+        PackageParser.Package scannedPkg = scanPackageLI(pkg, parseFlags, scanMode
+                | SCAN_UPDATE_SIGNATURE, currentTime);
+
+        /*
+         * If the system app should be overridden by a previously installed
+         * data, hide the system app now and let the /data/app scan pick it up
+         * again.
+         */
+        if (shouldHideSystemApp) {
+            synchronized (mPackages) {
+                /*
+                 * We have to grant systems permissions before we hide, because
+                 * grantPermissions will assume the package update is trying to
+                 * expand its permissions.
+                 */
+                grantPermissionsLPw(pkg, true);
+                mSettings.disableSystemPackageLPw(pkg.packageName);
+            }
+        }
+
+        return scannedPkg;
     }
 
     private static void setApplicationInfoPaths(PackageParser.Package pkg, String destCodePath,
@@ -3523,7 +3635,7 @@
                 mTransferedPackages.add(pkg.packageName);
             }
             
-            if (mSettings.mDisabledSysPackages.get(pkg.packageName) != null) {
+            if (mSettings.isDisabledSystemPackageLPr(pkg.packageName)) {
                 pkg.applicationInfo.flags |= ApplicationInfo.FLAG_UPDATED_SYSTEM_APP;
             }
 
@@ -7141,6 +7253,11 @@
         return (pkg.applicationInfo.flags & ApplicationInfo.FLAG_FORWARD_LOCK) != 0;
     }
 
+
+    private boolean isForwardLocked(PackageSetting ps) {
+        return (ps.pkgFlags & ApplicationInfo.FLAG_FORWARD_LOCK) != 0;
+    }
+
     private static boolean isExternal(PackageParser.Package pkg) {
         return (pkg.applicationInfo.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0;
     }
@@ -7157,10 +7274,25 @@
         return (info.flags & ApplicationInfo.FLAG_SYSTEM) != 0;
     }
 
+    private static boolean isSystemApp(PackageSetting ps) {
+        return (ps.pkgFlags & ApplicationInfo.FLAG_SYSTEM) != 0;
+    }
+
     private static boolean isUpdatedSystemApp(PackageParser.Package pkg) {
         return (pkg.applicationInfo.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0;
     }
 
+    private int packageFlagsToInstallFlags(PackageSetting ps) {
+        int installFlags = 0;
+        if (isExternal(ps)) {
+            installFlags |= PackageManager.INSTALL_EXTERNAL;
+        }
+        if (isForwardLocked(ps)) {
+            installFlags |= PackageManager.INSTALL_FORWARD_LOCK;
+        }
+        return installFlags;
+    }
+
     private void deleteTempPackageFiles() {
         FilenameFilter filter = new FilenameFilter() {
             public boolean accept(File dir, String name) {
diff --git a/services/java/com/android/server/pm/Settings.java b/services/java/com/android/server/pm/Settings.java
index d015278..d0eda2d 100644
--- a/services/java/com/android/server/pm/Settings.java
+++ b/services/java/com/android/server/pm/Settings.java
@@ -102,7 +102,7 @@
     final HashMap<String, PackageSetting> mPackages =
             new HashMap<String, PackageSetting>();
     // List of replaced system applications
-    final HashMap<String, PackageSetting> mDisabledSysPackages =
+    private final HashMap<String, PackageSetting> mDisabledSysPackages =
         new HashMap<String, PackageSetting>();
 
     // These are the last platform API version we were using for
@@ -280,6 +280,14 @@
         return ret;
     }
 
+    boolean isDisabledSystemPackageLPr(String name) {
+        return mDisabledSysPackages.containsKey(name);
+    }
+
+    void removeDisabledSystemPackageLPw(String name) {
+        mDisabledSysPackages.remove(name);
+    }
+
     PackageSetting addPackageLPw(String name, String realName, File codePath, File resourcePath,
             String nativeLibraryPathString, int uid, int vc, int pkgFlags) {
         PackageSetting p = mPackages.get(name);
diff --git a/services/java/com/android/server/usb/UsbDeviceManager.java b/services/java/com/android/server/usb/UsbDeviceManager.java
index 33612b0..526c204 100644
--- a/services/java/com/android/server/usb/UsbDeviceManager.java
+++ b/services/java/com/android/server/usb/UsbDeviceManager.java
@@ -686,7 +686,7 @@
                     notification.defaults = 0; // please be quiet
                     notification.sound = null;
                     notification.vibrate = null;
-                    notification.priority = Notification.PRIORITY_MIN;
+                    notification.priority = Notification.PRIORITY_LOW;
 
                     Intent intent = Intent.makeRestartActivityTask(
                             new ComponentName("com.android.settings",
diff --git a/services/java/com/android/server/wm/InputMonitor.java b/services/java/com/android/server/wm/InputMonitor.java
index c28cfa2..c4bb519 100644
--- a/services/java/com/android/server/wm/InputMonitor.java
+++ b/services/java/com/android/server/wm/InputMonitor.java
@@ -41,7 +41,9 @@
     private boolean mInputDispatchFrozen;
     
     // When true, input dispatch proceeds normally.  Otherwise all events are dropped.
-    private boolean mInputDispatchEnabled = true;
+    // Initially false, so that input does not get dispatched until boot is finished at
+    // which point the ActivityManager will enable dispatching.
+    private boolean mInputDispatchEnabled;
 
     // When true, need to call updateInputWindowsLw().
     private boolean mUpdateInputWindowsNeeded = true;
diff --git a/services/java/com/android/server/wm/WindowAnimator.java b/services/java/com/android/server/wm/WindowAnimator.java
index 2e817ca..5536559 100644
--- a/services/java/com/android/server/wm/WindowAnimator.java
+++ b/services/java/com/android/server/wm/WindowAnimator.java
@@ -85,6 +85,15 @@
         mPolicy = policy;
     }
 
+    void hideWallpapersLocked() {
+        for (final WindowToken token : mService.mWallpaperTokens) {
+            for (final WindowState wallpaper : token.windows) {
+                wallpaper.mWinAnimator.hide();
+            }
+            token.hidden = true;
+        }
+    }
+
     private void testWallpaperAndBackgroundLocked() {
         if (mWindowDetachedWallpaper != mDetachedWallpaper) {
             if (WindowManagerService.DEBUG_WALLPAPER) Slog.v(TAG,
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 8eda9ca..8957edf 100755
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -3430,9 +3430,6 @@
         synchronized(mWindowMap) {
             WindowToken wtoken = mTokenMap.remove(token);
             if (wtoken != null) {
-                if (wtoken.windowType == TYPE_INPUT_METHOD && mInputMethodWindow != null) {
-                    mPolicy.setLastInputMethodWindowLw(mInputMethodWindow, mInputMethodTarget);
-                }
                 boolean delayed = false;
                 if (!wtoken.hidden) {
                     wtoken.hidden = true;
@@ -3825,7 +3822,8 @@
         synchronized(mWindowMap) {
             if (DEBUG_APP_TRANSITIONS) Slog.v(
                     TAG, "Prepare app transition: transit=" + transit
-                    + " mNextAppTransition=" + mNextAppTransition);
+                    + " mNextAppTransition=" + mNextAppTransition
+                    + "\nCallers=" + Debug.getCallers(3));
             if (okToDisplay()) {
                 if (mNextAppTransition == WindowManagerPolicy.TRANSIT_UNSET
                         || mNextAppTransition == WindowManagerPolicy.TRANSIT_NONE) {
@@ -4237,7 +4235,7 @@
                     e = new RuntimeException();
                     e.fillInStackTrace();
                 }
-                Slog.v(TAG, "setAppVisibility(" + token + ", " + visible
+                Slog.v(TAG, "setAppVisibility(" + token + ", visible=" + visible
                         + "): mNextAppTransition=" + mNextAppTransition
                         + " hidden=" + wtoken.hidden
                         + " hiddenRequested=" + wtoken.hiddenRequested, e);
@@ -5149,7 +5147,7 @@
                     //Slog.i(TAG, "******* TELLING SURFACE FLINGER WE ARE BOOTED!");
                     Parcel data = Parcel.obtain();
                     data.writeInterfaceToken("android.ui.ISurfaceComposer");
-                    surfaceFlinger.transact(IBinder.FIRST_CALL_TRANSACTION,
+                    surfaceFlinger.transact(IBinder.FIRST_CALL_TRANSACTION, // BOOT_FINISHED
                                             data, null, 0);
                     data.recycle();
                 }
@@ -6673,8 +6671,7 @@
         public static final int SET_TRANSPARENT_REGION = ANIMATOR_WHAT_OFFSET + 1;
         public static final int SET_WALLPAPER_OFFSET = ANIMATOR_WHAT_OFFSET + 2;
         public static final int SET_DIM_PARAMETERS = ANIMATOR_WHAT_OFFSET + 3;
-        public static final int SET_MOVE_ANIMATION = ANIMATOR_WHAT_OFFSET + 4;
-        public static final int CLEAR_PENDING_ACTIONS = ANIMATOR_WHAT_OFFSET + 5;
+        public static final int CLEAR_PENDING_ACTIONS = ANIMATOR_WHAT_OFFSET + 4;
 
         private Session mLastReportedHold;
 
@@ -7158,18 +7155,6 @@
                     break;
                 }
 
-                case SET_MOVE_ANIMATION: {
-                    WindowAnimator.SetAnimationParams params =
-                            (WindowAnimator.SetAnimationParams) msg.obj;
-                    WindowStateAnimator winAnimator = params.mWinAnimator;
-                    winAnimator.setAnimation(params.mAnimation);
-                    winAnimator.mAnimDw = params.mAnimDw;
-                    winAnimator.mAnimDh = params.mAnimDh;
-
-                    scheduleAnimationLocked();
-                    break;
-                }
-
                 case CLEAR_PENDING_ACTIONS: {
                     mAnimator.clearPendingActions();
                     break;
@@ -7866,8 +7851,10 @@
                 mToTopApps.clear();
             }
 
+            // if wallpaper is animating in or out set oldWallpaper to null else to wallpaper
             WindowState oldWallpaper =
                     mWallpaperTarget != null && mWallpaperTarget.mWinAnimator.isAnimating()
+                        && !mWallpaperTarget.mWinAnimator.isDummyAnimation()
                     ? null : mWallpaperTarget;
 
             adjustWallpaperWindowsLocked();
@@ -8415,9 +8402,6 @@
                     winAnimator.setAnimation(a);
                     winAnimator.mAnimDw = w.mLastFrame.left - w.mFrame.left;
                     winAnimator.mAnimDh = w.mLastFrame.top - w.mFrame.top;
-                } else {
-                    winAnimator.mAnimDw = innerDw;
-                    winAnimator.mAnimDh = innerDh;
                 }
 
                 //Slog.i(TAG, "Window " + this + " clearing mContentChanged - done placing");
@@ -9266,6 +9250,15 @@
         }
     }
 
+    // It is assumed that this method is called only by InputMethodManagerService.
+    public void saveLastInputMethodWindowForTransition() {
+        synchronized (mWindowMap) {
+            if (mInputMethodWindow != null) {
+                mPolicy.setLastInputMethodWindowLw(mInputMethodWindow, mInputMethodTarget);
+            }
+        }
+    }
+
     @Override
     public boolean hasNavigationBar() {
         return mPolicy.hasNavigationBar();
diff --git a/services/java/com/android/server/wm/WindowStateAnimator.java b/services/java/com/android/server/wm/WindowStateAnimator.java
index 4f08d92..293d3e8 100644
--- a/services/java/com/android/server/wm/WindowStateAnimator.java
+++ b/services/java/com/android/server/wm/WindowStateAnimator.java
@@ -142,6 +142,8 @@
         mContext = mService.mContext;
         mAttrFlags = win.mAttrs.flags;
         mAttrType = win.mAttrs.type;
+        mAnimDw = service.mAppDisplayWidth;
+        mAnimDh = service.mAppDisplayHeight;
     }
 
     public void setAnimation(Animation anim) {
@@ -177,6 +179,13 @@
                                 || atoken.inPendingTransaction));
     }
 
+    /** Is the window animating the DummyAnimation? */
+    boolean isDummyAnimation() {
+        final AppWindowToken atoken = mWin.mAppToken;
+        return atoken != null
+                && atoken.mAppAnimator.animation == AppWindowAnimator.sDummyAnimation;
+    }
+
     /** Is this window currently animating? */
     boolean isWindowAnimating() {
         return mAnimation != null;
@@ -224,6 +233,8 @@
                         " scale=" + mService.mWindowAnimationScale);
                     mAnimation.initialize(mWin.mFrame.width(), mWin.mFrame.height(),
                             mAnimDw, mAnimDh);
+                    mAnimDw = mService.mAppDisplayWidth;
+                    mAnimDh = mService.mAppDisplayHeight;
                     mAnimation.setStartTime(currentTime);
                     mLocalAnimating = true;
                     mAnimating = true;
@@ -363,19 +374,33 @@
             mWin.mDestroying = true;
             if (WindowState.SHOW_TRANSACTIONS) WindowManagerService.logSurface(
                 mWin, "HIDE (finishExit)", null);
-            mSurfaceShown = false;
-            try {
-                mSurface.hide();
-            } catch (RuntimeException e) {
-                Slog.w(TAG, "Error hiding surface in " + this, e);
-            }
-            mLastHidden = true;
+            hide();
         }
         mWin.mExiting = false;
         if (mWin.mRemoveOnExit) {
             mService.mPendingRemove.add(mWin);
             mWin.mRemoveOnExit = false;
         }
+        if (mService.mWallpaperTarget == mWin && mService.mLowerWallpaperTarget == null) {
+            mAnimator.hideWallpapersLocked();
+        }
+    }
+
+    void hide() {
+        if (!mLastHidden) {
+            //dump();
+            mLastHidden = true;
+            if (WindowManagerService.SHOW_TRANSACTIONS) WindowManagerService.logSurface(mWin,
+                    "HIDE (performLayout)", null);
+            if (mSurface != null) {
+                mSurfaceShown = false;
+                try {
+                    mSurface.hide();
+                } catch (RuntimeException e) {
+                    Slog.w(TAG, "Exception hiding surface in " + mWin);
+                }
+            }
+        }
     }
 
     boolean finishDrawingLocked() {
@@ -987,20 +1012,7 @@
         setSurfaceBoundaries(recoveringMemory);
 
         if (w.mAttachedHidden || !w.isReadyForDisplay()) {
-            if (!mLastHidden) {
-                //dump();
-                mLastHidden = true;
-                if (WindowManagerService.SHOW_TRANSACTIONS) WindowManagerService.logSurface(w,
-                        "HIDE (performLayout)", null);
-                if (mSurface != null) {
-                    mSurfaceShown = false;
-                    try {
-                        mSurface.hide();
-                    } catch (RuntimeException e) {
-                        Slog.w(TAG, "Exception hiding surface in " + w);
-                    }
-                }
-            }
+            hide();
             // 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
diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java
index 5afe56c..f740718 100644
--- a/telephony/java/android/telephony/PhoneNumberUtils.java
+++ b/telephony/java/android/telephony/PhoneNumberUtils.java
@@ -1711,12 +1711,8 @@
             return false;
         }
 
-        // STOPSHIP: remove this after figuring out issue 5914560, 6383850.
         Log.d(LOG_TAG, "System property doesn't provide any emergency numbers."
-                + " Use embedded logic for determining emergency numbers."
-                + " number: " + toLogSafePhoneNumber(number)
-                + ", Iso: " + defaultCountryIso
-                + ", useExactMatch: " + useExactMatch);
+                + " Use embedded logic for determining ones.");
 
         // No ecclist system property, so use our own list.
         if (defaultCountryIso != null) {
@@ -1735,21 +1731,6 @@
         }
     }
 
-    private static String toLogSafePhoneNumber(String number) {
-        // Do exactly same thing as Uri#toSafeString() does, which will enable us to compare
-        // sanitized phone numbers.
-        StringBuilder builder = new StringBuilder();
-        for (int i = 0; i < number.length(); i++) {
-            char c = number.charAt(i);
-            if (c == '-' || c == '@' || c == '.') {
-                builder.append(c);
-            } else {
-                builder.append('x');
-            }
-        }
-        return builder.toString();
-    }
-
     /**
      * Checks if a given number is an emergency number for the country that the user is in. The
      * current country is determined using the CountryDetector.
diff --git a/test-runner/src/android/test/mock/MockContentProvider.java b/test-runner/src/android/test/mock/MockContentProvider.java
index a8c388e..1e41416 100644
--- a/test-runner/src/android/test/mock/MockContentProvider.java
+++ b/test-runner/src/android/test/mock/MockContentProvider.java
@@ -21,7 +21,6 @@
 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;
@@ -31,6 +30,7 @@
 import android.net.Uri;
 import android.os.Bundle;
 import android.os.IBinder;
+import android.os.ICancellationSignal;
 import android.os.ParcelFileDescriptor;
 import android.os.RemoteException;
 
diff --git a/test-runner/src/android/test/mock/MockContentResolver.java b/test-runner/src/android/test/mock/MockContentResolver.java
index 6c91f4e..65eb21b 100644
--- a/test-runner/src/android/test/mock/MockContentResolver.java
+++ b/test-runner/src/android/test/mock/MockContentResolver.java
@@ -106,6 +106,18 @@
         return true;
     }
 
+    /** @hide */
+    @Override
+    protected IContentProvider acquireUnstableProvider(Context c, String name) {
+        return acquireProvider(c, name);
+    }
+
+    /** @hide */
+    @Override
+    public boolean releaseUnstableProvider(IContentProvider icp) {
+        return releaseProvider(icp);
+    }
+
     /**
      * Overrides {@link android.content.ContentResolver#notifyChange(Uri, ContentObserver, boolean)
      * ContentResolver.notifChange(Uri, ContentObserver, boolean)}. All parameters are ignored.
diff --git a/test-runner/src/android/test/mock/MockIContentProvider.java b/test-runner/src/android/test/mock/MockIContentProvider.java
index 1aa0448..9fcfc22 100644
--- a/test-runner/src/android/test/mock/MockIContentProvider.java
+++ b/test-runner/src/android/test/mock/MockIContentProvider.java
@@ -21,12 +21,12 @@
 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;
 import android.os.Bundle;
 import android.os.IBinder;
+import android.os.ICancellationSignal;
 import android.os.ParcelFileDescriptor;
 import android.os.RemoteException;
 
diff --git a/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
index 16f1575..9aed8c8 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
@@ -307,6 +307,11 @@
     }
 
     @LayoutlibDelegate
+    /*package*/ static void freeTextLayoutCaches() {
+        // nothing to be done here yet.
+    }
+
+    @LayoutlibDelegate
     /*package*/ static int initRaster(int nativeBitmapOrZero) {
         if (nativeBitmapOrZero > 0) {
             // get the Bitmap from the int
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 e28866e..f770ccc 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,7 +19,6 @@
 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;
@@ -27,6 +26,7 @@
 import android.net.Uri;
 import android.os.Bundle;
 import android.os.IBinder;
+import android.os.ICancellationSignal;
 import android.os.ParcelFileDescriptor;
 import android.os.RemoteException;
 
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContentResolver.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContentResolver.java
index 0257686..fec2c3f 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContentResolver.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContentResolver.java
@@ -62,6 +62,16 @@
         return false;
     }
 
+    @Override
+    protected IContentProvider acquireUnstableProvider(Context c, String name) {
+        return acquireProvider(c, name);
+    }
+
+    @Override
+    public boolean releaseUnstableProvider(IContentProvider icp) {
+        return releaseProvider(icp);
+    }
+
     /**
      * Stub for the layoutlib bridge content resolver.
      */
diff --git a/tools/localize/Android.mk b/tools/localize/Android.mk
deleted file mode 100644
index 5ec9feb..0000000
--- a/tools/localize/Android.mk
+++ /dev/null
@@ -1,55 +0,0 @@
-# 
-# Copyright 2006 The Android Open Source Project
-#
-# Android Asset Packaging Tool
-#
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
-    file_utils.cpp \
-    localize.cpp \
-    merge_res_and_xliff.cpp \
-    res_check.cpp \
-    xmb.cpp \
-    Configuration.cpp \
-    Perforce.cpp \
-    SourcePos.cpp \
-    Values.cpp \
-    ValuesFile.cpp \
-    XLIFFFile.cpp \
-    XMLHandler.cpp
-
-LOCAL_C_INCLUDES := \
-    external/expat/lib \
-    build/libs/host/include
-
-LOCAL_CFLAGS += -g -O0
-
-LOCAL_STATIC_LIBRARIES := \
-    libexpat \
-    libhost \
-    libutils \
-	libcutils
-    
-ifeq ($(HOST_OS),linux)
-LOCAL_LDLIBS += -lrt -ldl -lpthread
-endif
-
-
-LOCAL_MODULE := localize
-
-ifeq (a,a)
-    LOCAL_CFLAGS += -DLOCALIZE_WITH_TESTS
-    LOCAL_SRC_FILES += \
-        test.cpp \
-        localize_test.cpp \
-        merge_res_and_xliff_test.cpp \
-        Perforce_test.cpp \
-        ValuesFile_test.cpp \
-        XLIFFFile_test.cpp \
-        XMLHandler_test.cpp
-endif
-
-include $(BUILD_HOST_EXECUTABLE)
diff --git a/tools/localize/Configuration.cpp b/tools/localize/Configuration.cpp
deleted file mode 100644
index 56addbd..0000000
--- a/tools/localize/Configuration.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "Configuration.h"
-#include <string.h>
-
-int
-Configuration::Compare(const Configuration& that) const
-{
-    int n;
-
-    n = locale.compare(that.locale);
-    if (n != 0) return n;
-
-    n = vendor.compare(that.vendor);
-    if (n != 0) return n;
-
-    n = orientation.compare(that.orientation);
-    if (n != 0) return n;
-
-    n = density.compare(that.density);
-    if (n != 0) return n;
-
-    n = touchscreen.compare(that.touchscreen);
-    if (n != 0) return n;
-
-    n = keyboard.compare(that.keyboard);
-    if (n != 0) return n;
-
-    n = navigation.compare(that.navigation);
-    if (n != 0) return n;
-
-    n = screenSize.compare(that.screenSize);
-    if (n != 0) return n;
-
-    return 0;
-}
-
-string
-Configuration::ToString() const
-{
-    string s;
-    if (locale.length() > 0) {
-        if (s.length() > 0) {
-            s += "-";
-        }
-        s += locale;
-    }
-    return s;
-}
-
-bool
-split_locale(const string& in, string* language, string* region)
-{
-    const int len = in.length();
-    if (len == 2) {
-        if (isalpha(in[0]) && isalpha(in[1])) {
-            *language = in;
-            region->clear();
-            return true;
-        } else {
-            return false;
-        }
-    }
-    else if (len == 5) {
-        if (isalpha(in[0]) && isalpha(in[1]) && (in[2] == '_' || in[2] == '-')
-                && isalpha(in[3]) && isalpha(in[4])) {
-            language->assign(in.c_str(), 2);
-            region->assign(in.c_str()+3, 2);
-            return true;
-        } else {
-            return false;
-        }
-    }
-    else {
-        return false;
-    }
-}
-
diff --git a/tools/localize/Configuration.h b/tools/localize/Configuration.h
deleted file mode 100644
index f91bf04..0000000
--- a/tools/localize/Configuration.h
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef CONFIGURATION_H
-#define CONFIGURATION_H
-
-#include <string>
-
-using namespace std;
-
-struct Configuration
-{
-    string locale;
-    string vendor;
-    string orientation;
-    string density;
-    string touchscreen;
-    string keyboard;
-    string navigation;
-    string screenSize;
-
-    // Compare two configurations
-    int Compare(const Configuration& that) const;
-
-    inline bool operator<(const Configuration& that) const { return Compare(that) < 0; }
-    inline bool operator<=(const Configuration& that) const { return Compare(that) <= 0; }
-    inline bool operator==(const Configuration& that) const { return Compare(that) == 0; }
-    inline bool operator!=(const Configuration& that) const { return Compare(that) != 0; }
-    inline bool operator>=(const Configuration& that) const { return Compare(that) >= 0; }
-    inline bool operator>(const Configuration& that) const { return Compare(that) > 0; }
-
-    // Parse a directory name, like "values-en-rUS".  Return the first segment in resType.
-    bool ParseDiectoryName(const string& dir, string* resType);
-
-    string ToString() const;
-};
-
-bool split_locale(const string& in, string* language, string* region);
-
-
-#endif // CONFIGURATION_H
diff --git a/tools/localize/Perforce.cpp b/tools/localize/Perforce.cpp
deleted file mode 100644
index ae11231..0000000
--- a/tools/localize/Perforce.cpp
+++ /dev/null
@@ -1,234 +0,0 @@
-#include "Perforce.h"
-#include "log.h"
-#include <string.h>
-#include <cstdio>
-#include <stdlib.h>
-#include <sstream>
-#include <sys/types.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/wait.h>
-#include <cstdio>
-
-using namespace std;
-
-extern char** environ;
-
-int
-Perforce::RunCommand(const string& cmd, string* result, bool printOnFailure)
-{
-    int err;
-    int outPipe[2];
-    int errPipe[2];
-    pid_t pid;
-
-    log_printf("Perforce::RunCommand: %s\n", cmd.c_str());
-
-    err = pipe(outPipe);
-    err |= pipe(errPipe);
-    if (err == -1) {
-        printf("couldn't create pipe. exiting.\n");
-        exit(1);
-        return -1;
-    }
-
-    pid = fork();
-    if (pid == -1) {
-        printf("couldn't fork. eixiting\n");
-        exit(1);
-        return -1;
-    }
-    else if (pid == 0) {
-        char const* args[] = {
-            "/bin/sh",
-            "-c",
-            cmd.c_str(),
-            NULL
-        };
-        close(outPipe[0]);
-        close(errPipe[0]);
-        dup2(outPipe[1], 1);
-        dup2(errPipe[1], 2);
-        execve(args[0], (char* const*)args, environ);
-        // done
-    }
-
-    close(outPipe[1]);
-    close(errPipe[1]);
-
-    result->clear();
-
-    char buf[1024];
-
-    // stdout
-    while (true) {
-        size_t amt = read(outPipe[0], buf, sizeof(buf));
-        result->append(buf, amt);
-        if (amt <= 0) {
-            break;
-        }
-    }
-
-    // stderr -- the messages are short so it ought to just fit in the buffer
-    string error;
-    while (true) {
-        size_t amt = read(errPipe[0], buf, sizeof(buf));
-        error.append(buf, amt);
-        if (amt <= 0) {
-            break;
-        }
-    }
-
-    close(outPipe[0]);
-    close(errPipe[0]);
-
-    waitpid(pid, &err, 0);
-    if (WIFEXITED(err)) {
-        err = WEXITSTATUS(err);
-    } else {
-        err = -1;
-    }
-    if (err != 0 && printOnFailure) {
-        write(2, error.c_str(), error.length());
-    }
-    return err;
-}
-
-int
-Perforce::GetResourceFileNames(const string& version, const string& base,
-                                const vector<string>& apps, vector<string>* results,
-                                bool printOnFailure)
-{
-    int err;
-    string text;
-    stringstream cmd;
-
-    cmd << "p4 files";
-
-    const size_t I = apps.size();
-    for (size_t i=0; i<I; i++) {
-        cmd << " \"" << base << '/' << apps[i] << "/res/values/strings.xml@" << version << '"';
-    }
-
-    err = RunCommand(cmd.str(), &text, printOnFailure);
-
-    const char* str = text.c_str();
-    while (*str) {
-        const char* lineend = strchr(str, '\n');
-        if (lineend == str) {
-            str++;
-            continue;
-        }
-        if (lineend-str > 1023) {
-            fprintf(stderr, "line too long!\n");
-            return 1;
-        }
-
-        string s(str, lineend-str);
-
-        char filename[1024];
-        char edit[1024];
-        int count = sscanf(str, "%[^#]#%*d - %s change %*d %*[^\n]\n", filename, edit);
-
-        if (count == 2 && 0 != strcmp("delete", edit)) {
-            results->push_back(string(filename));
-        }
-
-        str = lineend + 1;
-    }
-
-    return err;
-}
-
-int
-Perforce::GetFile(const string& file, const string& version, string* result,
-        bool printOnFailure)
-{
-    stringstream cmd;
-    cmd << "p4 print -q \"" << file << '@' << version << '"';
-    return RunCommand(cmd.str(), result, printOnFailure);
-}
-
-string
-Perforce::GetCurrentChange(bool printOnFailure)
-{
-    int err;
-    string text;
-
-    err = RunCommand("p4 changes -m 1 \\#have", &text, printOnFailure);
-    if (err != 0) {
-        return "";
-    }
-
-    long long n;
-    int count = sscanf(text.c_str(), "Change %lld on", &n);
-    if (count != 1) {
-        return "";
-    }
-
-    char result[100];
-    sprintf(result, "%lld", n);
-
-    return string(result);
-}
-
-static int
-do_files(const string& op, const vector<string>& files, bool printOnFailure)
-{
-    string text;
-    stringstream cmd;
-
-    cmd << "p4 " << op;
-
-    const size_t I = files.size();
-    for (size_t i=0; i<I; i++) {
-        cmd << " \"" << files[i] << "\"";
-    }
-
-    return Perforce::RunCommand(cmd.str(), &text, printOnFailure);
-}
-
-int
-Perforce::EditFiles(const vector<string>& files, bool printOnFailure)
-{
-    return do_files("edit", files, printOnFailure);
-}
-
-int
-Perforce::AddFiles(const vector<string>& files, bool printOnFailure)
-{
-    return do_files("add", files, printOnFailure);
-}
-
-int
-Perforce::DeleteFiles(const vector<string>& files, bool printOnFailure)
-{
-    return do_files("delete", files, printOnFailure);
-}
-
-string
-Perforce::Where(const string& depotPath, bool printOnFailure)
-{
-    int err;
-    string text;
-    string cmd = "p4 where ";
-    cmd += depotPath;
-
-    err = RunCommand(cmd, &text, printOnFailure);
-    if (err != 0) {
-        return "";
-    }
-
-    size_t index = text.find(' ');
-    if (index == text.npos) {
-        return "";
-    }
-    index = text.find(' ', index+1)+1;
-    if (index == text.npos) {
-        return "";
-    }
-
-    return text.substr(index, text.length()-index-1);
-}
-
diff --git a/tools/localize/Perforce.h b/tools/localize/Perforce.h
deleted file mode 100644
index 522797d..0000000
--- a/tools/localize/Perforce.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef PERFORCE_H
-#define PERFORCE_H
-
-#include <string>
-#include <vector>
-
-using namespace std;
-
-class Perforce
-{
-public:
-    static int RunCommand(const string& cmd, string* result, bool printOnFailure);
-    static int GetResourceFileNames(const string& version, const string& base,
-                                const vector<string>& apps, vector<string>* result,
-                                bool printOnFailure);
-    static int GetFile(const string& file, const string& version, string* result,
-                                bool printOnFailure);
-    static string GetCurrentChange(bool printOnFailure);
-    static int EditFiles(const vector<string>& filename, bool printOnFailure);
-    static int AddFiles(const vector<string>& files, bool printOnFailure);
-    static int DeleteFiles(const vector<string>& files, bool printOnFailure);
-    static string Where(const string& depotPath, bool printOnFailure);
-};
-
-#endif // PERFORCE_H
diff --git a/tools/localize/Perforce_test.cpp b/tools/localize/Perforce_test.cpp
deleted file mode 100644
index 142b20e..0000000
--- a/tools/localize/Perforce_test.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-#include "Perforce.h"
-#include <stdio.h>
-
-static int
-RunCommand_test()
-{
-    string result;
-    int err = Perforce::RunCommand("p4 help csommands", &result, true);
-    printf("err=%d result=[[%s]]\n", err, result.c_str());
-    return 0;
-}
-
-static int
-GetResourceFileNames_test()
-{
-    vector<string> results;
-    vector<string> apps;
-    apps.push_back("apps/common");
-    apps.push_back("apps/Contacts");
-    int err = Perforce::GetResourceFileNames("43019", "//device", apps, &results, true);
-    if (err != 0) {
-        return err;
-    }
-    if (results.size() != 2) {
-        return 1;
-    }
-    if (results[0] != "//device/apps/common/res/values/strings.xml") {
-        return 1;
-    }
-    if (results[1] != "//device/apps/Contacts/res/values/strings.xml") {
-        return 1;
-    }
-    if (false) {
-        for (size_t i=0; i<results.size(); i++) {
-            printf("[%zd] '%s'\n", i, results[i].c_str());
-        }
-    }
-    return 0;
-}
-
-static int
-GetFile_test()
-{
-    string result;
-    int err = Perforce::GetFile("//device/Makefile", "296", &result, true);
-    printf("err=%d result=[[%s]]\n", err, result.c_str());
-    return 0;
-}
-
-int
-Perforce_test()
-{
-    bool all = false;
-    int err = 0;
-
-    if (all) err |= RunCommand_test();
-    if (all) err |= GetResourceFileNames_test();
-    if (all) err |= GetFile_test();
-
-    return err;
-}
-
diff --git a/tools/localize/SourcePos.cpp b/tools/localize/SourcePos.cpp
deleted file mode 100644
index 184bfe0a..0000000
--- a/tools/localize/SourcePos.cpp
+++ /dev/null
@@ -1,168 +0,0 @@
-#include "SourcePos.h"
-
-#include <stdarg.h>
-#include <cstdio>
-#include <set>
-#include <cstdio>
-
-using namespace std;
-
-const SourcePos GENERATED_POS("<generated>", -1);
-
-// ErrorPos
-// =============================================================================
-struct ErrorPos
-{
-    string file;
-    int line;
-    string error;
-
-    ErrorPos();
-    ErrorPos(const ErrorPos& that);
-    ErrorPos(const string& file, int line, const string& error);
-    ~ErrorPos();
-    bool operator<(const ErrorPos& rhs) const;
-    bool operator==(const ErrorPos& rhs) const;
-    ErrorPos& operator=(const ErrorPos& rhs);
-
-    void Print(FILE* to) const;
-};
-
-static set<ErrorPos> g_errors;
-
-ErrorPos::ErrorPos()
-{
-}
-
-ErrorPos::ErrorPos(const ErrorPos& that)
-    :file(that.file),
-     line(that.line),
-     error(that.error)
-{
-}
-
-ErrorPos::ErrorPos(const string& f, int l, const string& e)
-    :file(f),
-     line(l),
-     error(e)
-{
-}
-
-ErrorPos::~ErrorPos()
-{
-}
-
-bool
-ErrorPos::operator<(const ErrorPos& rhs) const
-{
-    if (this->file < rhs.file) return true;
-    if (this->file == rhs.file) {
-        if (this->line < rhs.line) return true;
-        if (this->line == rhs.line) {
-            if (this->error < rhs.error) return true;
-        }
-    }
-    return false;
-}
-
-bool
-ErrorPos::operator==(const ErrorPos& rhs) const
-{
-    return this->file == rhs.file
-            && this->line == rhs.line
-            && this->error == rhs.error;
-}
-
-ErrorPos&
-ErrorPos::operator=(const ErrorPos& rhs)
-{
-    this->file = rhs.file;
-    this->line = rhs.line;
-    this->error = rhs.error;
-    return *this;
-}
-
-void
-ErrorPos::Print(FILE* to) const
-{
-    if (this->line >= 0) {
-        fprintf(to, "%s:%d: %s\n", this->file.c_str(), this->line, this->error.c_str());
-    } else {
-        fprintf(to, "%s: %s\n", this->file.c_str(), this->error.c_str());
-    }
-}
-
-// SourcePos
-// =============================================================================
-SourcePos::SourcePos(const string& f, int l)
-    : file(f), line(l)
-{
-}
-
-SourcePos::SourcePos(const SourcePos& that)
-    : file(that.file), line(that.line)
-{
-}
-
-SourcePos::SourcePos()
-    : file("???", 0)
-{
-}
-
-SourcePos::~SourcePos()
-{
-}
-
-string
-SourcePos::ToString() const
-{
-    char buf[1024];
-    if (this->line >= 0) {
-        snprintf(buf, sizeof(buf)-1, "%s:%d", this->file.c_str(), this->line);
-    } else {
-        snprintf(buf, sizeof(buf)-1, "%s:", this->file.c_str());
-    }
-    buf[sizeof(buf)-1] = '\0';
-    return string(buf);
-}
-
-int
-SourcePos::Error(const char* fmt, ...) const
-{
-    int retval=0;
-    char buf[1024];
-    va_list ap;
-    va_start(ap, fmt);
-    retval = vsnprintf(buf, sizeof(buf), fmt, ap);
-    va_end(ap);
-    char* p = buf + retval - 1;
-    while (p > buf && *p == '\n') {
-        *p = '\0';
-        p--;
-    }
-    ErrorPos err(this->file, this->line, string(buf));
-    if (g_errors.find(err) == g_errors.end()) {
-        err.Print(stderr);
-        g_errors.insert(err);
-    }
-    return retval;
-}
-
-bool
-SourcePos::HasErrors()
-{
-    return g_errors.size() > 0;
-}
-
-void
-SourcePos::PrintErrors(FILE* to)
-{
-    set<ErrorPos>::const_iterator it;
-    for (it=g_errors.begin(); it!=g_errors.end(); it++) {
-        it->Print(to);
-    }
-}
-
-
-
-
diff --git a/tools/localize/SourcePos.h b/tools/localize/SourcePos.h
deleted file mode 100644
index 5027129..0000000
--- a/tools/localize/SourcePos.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef SOURCEPOS_H
-#define SOURCEPOS_H
-
-#include <string>
-
-using namespace std;
-
-class SourcePos
-{
-public:
-    string file;
-    int line;
-
-    SourcePos(const string& f, int l);
-    SourcePos(const SourcePos& that);
-    SourcePos();
-    ~SourcePos();
-
-    string ToString() const;
-    int Error(const char* fmt, ...) const;
-
-    static bool HasErrors();
-    static void PrintErrors(FILE* to);
-};
-
-extern const SourcePos GENERATED_POS;
-
-#endif // SOURCEPOS_H
diff --git a/tools/localize/Values.cpp b/tools/localize/Values.cpp
deleted file mode 100644
index 8623b97..0000000
--- a/tools/localize/Values.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-#include "Values.h"
-#include <stdlib.h>
-#include <cstdio>
-
-
-// =====================================================================================
-StringResource::StringResource(const SourcePos& p, const string& f, const Configuration& c, 
-                    const string& i, int ix, XMLNode* v, const int ve, const string& vs,
-                    const string& cmnt)
-    :pos(p),
-     file(f),
-     config(c),
-     id(i),
-     index(ix),
-     value(v),
-     version(ve),
-     versionString(vs),
-     comment(cmnt)
-{
-}
-
-StringResource::StringResource()
-    :pos(),
-     file(),
-     config(),
-     id(),
-     index(-1),
-     value(NULL),
-     version(),
-     versionString(),
-     comment()
-{
-}
-
-StringResource::StringResource(const StringResource& that)
-    :pos(that.pos),
-     file(that.file),
-     config(that.config),
-     id(that.id),
-     index(that.index),
-     value(that.value),
-     version(that.version),
-     versionString(that.versionString),
-     comment(that.comment)
-{
-}
-
-int
-StringResource::Compare(const StringResource& that) const
-{
-    if (file != that.file) {
-        return file < that.file ? -1 : 1;
-    }
-    if (id != that.id) {
-        return id < that.id ? -1 : 1;
-    }
-    if (index != that.index) {
-        return index - that.index;
-    }
-    if (config != that.config) {
-        return config < that.config ? -1 : 1;
-    }
-    if (version != that.version) {
-        return version < that.version ? -1 : 1;
-    }
-    return 0;
-}
-
-string
-StringResource::TypedID() const
-{
-    string result;
-    if (index < 0) {
-        result = "string:";
-    } else {
-        char n[20];
-        sprintf(n, "%d:", index);
-        result = "array:";
-        result += n;
-    }
-    result += id;
-    return result;
-}
-
-static void
-split(const string& raw, vector<string>*parts)
-{
-    size_t index = 0;
-    while (true) {
-        size_t next = raw.find(':', index);
-        if (next != raw.npos) {
-            parts->push_back(string(raw, index, next-index));
-            index = next + 1;
-        } else {
-            parts->push_back(string(raw, index));
-            break;
-        }
-    }
-}
-
-bool
-StringResource::ParseTypedID(const string& raw, string* id, int* index)
-{
-    vector<string> parts;
-    split(raw, &parts);
-
-    const size_t N = parts.size();
-
-    for (size_t i=0; i<N; i++) {
-        if (parts[i].length() == 0) {
-            return false;
-        }
-    }
-
-    if (N == 2 && parts[0] == "string") {
-        *id = parts[1];
-        *index = -1;
-        return true;
-    }
-    else if (N == 3 && parts[0] == "array") {
-        char* p;
-        int n = (int)strtol(parts[1].c_str(), &p, 0);
-        if (*p == '\0') {
-            *id = parts[2];
-            *index = n;
-            return true;
-        } else {
-            return false;
-        }
-    }
-    else {
-        return false;
-    }
-}
-
diff --git a/tools/localize/Values.h b/tools/localize/Values.h
deleted file mode 100644
index 0a60b6d..0000000
--- a/tools/localize/Values.h
+++ /dev/null
@@ -1,48 +0,0 @@
-#ifndef VALUES_H
-#define VALUES_H
-
-#include "Configuration.h"
-#include "XMLHandler.h"
-
-#include <string>
-
-using namespace std;
-
-enum {
-    CURRENT_VERSION,
-    OLD_VERSION
-};
-
-struct StringResource
-{
-    StringResource();
-    StringResource(const SourcePos& pos, const string& file, const Configuration& config, 
-                    const string& id, int index, XMLNode* value,
-                    int version, const string& versionString, const string& comment = "");
-    StringResource(const StringResource& that);
-
-    // Compare two configurations
-    int Compare(const StringResource& that) const;
-
-    inline bool operator<(const StringResource& that) const { return Compare(that) < 0; }
-    inline bool operator<=(const StringResource& that) const { return Compare(that) <= 0; }
-    inline bool operator==(const StringResource& that) const { return Compare(that) == 0; }
-    inline bool operator!=(const StringResource& that) const { return Compare(that) != 0; }
-    inline bool operator>=(const StringResource& that) const { return Compare(that) >= 0; }
-    inline bool operator>(const StringResource& that) const { return Compare(that) > 0; }
-
-    string TypedID() const;
-    static bool ParseTypedID(const string& typed, string* id, int* index);
-
-    SourcePos pos;
-    string file;
-    Configuration config;
-    string id;
-    int index;
-    XMLNode* value;
-    int version;
-    string versionString;
-    string comment;
-};
-
-#endif // VALUES_H
diff --git a/tools/localize/ValuesFile.cpp b/tools/localize/ValuesFile.cpp
deleted file mode 100644
index bd6f494..0000000
--- a/tools/localize/ValuesFile.cpp
+++ /dev/null
@@ -1,266 +0,0 @@
-#include "ValuesFile.h"
-
-#include "XMLHandler.h"
-
-#include <algorithm>
-#include <fcntl.h>
-#include <expat.h>
-#include <unistd.h>
-#include <errno.h>
-
-using namespace std;
-
-const char* const ANDROID_XMLNS = "http://schemas.android.com/apk/res/android";
-const char* const XLIFF_XMLNS = "urn:oasis:names:tc:xliff:document:1.2";
-
-const char *const NS_MAP[] = {
-    "android", ANDROID_XMLNS,
-    "xliff", XLIFF_XMLNS,
-    NULL, NULL
-};
-
-const XMLNamespaceMap ANDROID_NAMESPACES(NS_MAP);
-
-
-// =====================================================================================
-class ArrayHandler : public XMLHandler
-{
-public:
-    ArrayHandler(ValuesFile* vf, int version, const string& versionString, const string& id);
-
-    virtual int OnStartElement(const SourcePos& pos, const string& ns, const string& name,
-                                const vector<XMLAttribute>& attrs, XMLHandler** next);
-    virtual int OnText(const SourcePos& pos, const string& text);
-    virtual int OnComment(const SourcePos& pos, const string& text);
-
-private:
-    ValuesFile* m_vf;
-    int m_version;
-    int m_index;
-    string m_versionString;
-    string m_id;
-    string m_comment;
-};
-
-ArrayHandler::ArrayHandler(ValuesFile* vf, int version, const string& versionString,
-                            const string& id)
-    :m_vf(vf),
-     m_version(version),
-     m_index(0),
-     m_versionString(versionString),
-     m_id(id)
-{
-}
-
-int
-ArrayHandler::OnStartElement(const SourcePos& pos, const string& ns, const string& name,
-                                const vector<XMLAttribute>& attrs, XMLHandler** next)
-{
-    if (ns == "" && name == "item") {
-        XMLNode* node = XMLNode::NewElement(pos, ns, name, attrs, XMLNode::EXACT);
-        m_vf->AddString(StringResource(pos, pos.file, m_vf->GetConfiguration(),
-                                            m_id, m_index, node, m_version, m_versionString,
-                                            trim_string(m_comment)));
-        *next = new NodeHandler(node, XMLNode::EXACT);
-        m_index++;
-        m_comment = "";
-        return 0;
-    } else {
-        pos.Error("invalid <%s> element inside <array>\n", name.c_str());
-        return 1;
-    }
-}
-
-int
-ArrayHandler::OnText(const SourcePos& pos, const string& text)
-{
-    return 0;
-}
-
-int
-ArrayHandler::OnComment(const SourcePos& pos, const string& text)
-{
-    m_comment += text;
-    return 0;
-}
-
-// =====================================================================================
-class ValuesHandler : public XMLHandler
-{
-public:
-    ValuesHandler(ValuesFile* vf, int version, const string& versionString);
-
-    virtual int OnStartElement(const SourcePos& pos, const string& ns, const string& name,
-                                const vector<XMLAttribute>& attrs, XMLHandler** next);
-    virtual int OnText(const SourcePos& pos, const string& text);
-    virtual int OnComment(const SourcePos& pos, const string& text);
-
-private:
-    ValuesFile* m_vf;
-    int m_version;
-    string m_versionString;
-    string m_comment;
-};
-
-ValuesHandler::ValuesHandler(ValuesFile* vf, int version, const string& versionString)
-    :m_vf(vf),
-     m_version(version),
-     m_versionString(versionString)
-{
-}
-
-int
-ValuesHandler::OnStartElement(const SourcePos& pos, const string& ns, const string& name,
-                                const vector<XMLAttribute>& attrs, XMLHandler** next)
-{
-    if (ns == "" && name == "string") {
-        string id = XMLAttribute::Find(attrs, "", "name", "");
-        XMLNode* node = XMLNode::NewElement(pos, ns, name, attrs, XMLNode::EXACT);
-        m_vf->AddString(StringResource(pos, pos.file, m_vf->GetConfiguration(),
-                                            id, -1, node, m_version, m_versionString,
-                                            trim_string(m_comment)));
-        *next = new NodeHandler(node, XMLNode::EXACT);
-    }
-    else if (ns == "" && name == "array") {
-        string id = XMLAttribute::Find(attrs, "", "name", "");
-        *next = new ArrayHandler(m_vf, m_version, m_versionString, id);
-    }
-    m_comment = "";
-    return 0;
-}
-
-int
-ValuesHandler::OnText(const SourcePos& pos, const string& text)
-{
-    return 0;
-}
-
-int
-ValuesHandler::OnComment(const SourcePos& pos, const string& text)
-{
-    m_comment += text;
-    return 0;
-}
-
-// =====================================================================================
-ValuesFile::ValuesFile(const Configuration& config)
-    :m_config(config),
-     m_strings(),
-     m_arrays()
-{
-}
-
-ValuesFile::~ValuesFile()
-{
-}
-
-ValuesFile*
-ValuesFile::ParseFile(const string& filename, const Configuration& config,
-                    int version, const string& versionString)
-{
-    ValuesFile* result = new ValuesFile(config);
-
-    TopElementHandler top("", "resources", new ValuesHandler(result, version, versionString));
-    XMLHandler::ParseFile(filename, &top);
-
-    return result;
-}
-
-ValuesFile*
-ValuesFile::ParseString(const string& filename, const string& text, const Configuration& config,
-                    int version, const string& versionString)
-{
-    ValuesFile* result = new ValuesFile(config);
-
-    TopElementHandler top("", "resources", new ValuesHandler(result, version, versionString));
-    XMLHandler::ParseString(filename, text, &top);
-
-    return result;
-}
-
-const Configuration&
-ValuesFile::GetConfiguration() const
-{
-    return m_config;
-}
-
-void
-ValuesFile::AddString(const StringResource& str)
-{
-    if (str.index < 0) {
-        m_strings.insert(str);
-    } else {
-        m_arrays[str.id].insert(str);
-    }
-}
-
-set<StringResource>
-ValuesFile::GetStrings() const
-{
-    set<StringResource> result = m_strings;
-
-    for (map<string,set<StringResource> >::const_iterator it = m_arrays.begin();
-            it != m_arrays.end(); it++) {
-        result.insert(it->second.begin(), it->second.end());
-    }
-
-    return result;
-}
-
-XMLNode*
-ValuesFile::ToXMLNode() const
-{
-    XMLNode* root;
-
-    // <resources>
-    {
-        vector<XMLAttribute> attrs;
-        ANDROID_NAMESPACES.AddToAttributes(&attrs);
-        root = XMLNode::NewElement(GENERATED_POS, "", "resources", attrs, XMLNode::PRETTY);
-    }
-
-    // <array>
-    for (map<string,set<StringResource> >::const_iterator it = m_arrays.begin();
-            it != m_arrays.end(); it++) {
-        vector<XMLAttribute> arrayAttrs;
-        arrayAttrs.push_back(XMLAttribute("", "name", it->first));
-        const set<StringResource>& items = it->second;
-        XMLNode* arrayNode = XMLNode::NewElement(items.begin()->pos, "", "array", arrayAttrs,
-                XMLNode::PRETTY);
-        root->EditChildren().push_back(arrayNode);
-
-        // <item>
-        for (set<StringResource>::const_iterator item = items.begin();
-                item != items.end(); item++) {
-            XMLNode* itemNode = item->value->Clone();
-            itemNode->SetName("", "item");
-            itemNode->EditAttributes().clear();
-            arrayNode->EditChildren().push_back(itemNode);
-        }
-    }
-
-    // <string>
-    for (set<StringResource>::const_iterator it=m_strings.begin(); it!=m_strings.end(); it++) {
-        const StringResource& str = *it;
-        vector<XMLAttribute> attrs;
-        XMLNode* strNode = str.value->Clone();
-        strNode->SetName("", "string");
-        strNode->EditAttributes().clear();
-        strNode->EditAttributes().push_back(XMLAttribute("", "name", str.id));
-        root->EditChildren().push_back(strNode);
-    }
-
-    return root;
-}
-
-string
-ValuesFile::ToString() const
-{
-    XMLNode* xml = ToXMLNode();
-    string s = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
-    s += xml->ToString(ANDROID_NAMESPACES);
-    delete xml;
-    s += '\n';
-    return s;
-}
-
diff --git a/tools/localize/ValuesFile.h b/tools/localize/ValuesFile.h
deleted file mode 100644
index 752fd78..0000000
--- a/tools/localize/ValuesFile.h
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef VALUES_FILE_H
-#define VALUES_FILE_H
-
-#include "SourcePos.h"
-#include "Configuration.h"
-#include "XMLHandler.h"
-#include "Values.h"
-
-#include <string>
-#include <set>
-
-using namespace std;
-
-extern const XMLNamespaceMap ANDROID_NAMESPACES;
-
-class ValuesFile
-{
-public:
-    ValuesFile(const Configuration& config);
-
-    static ValuesFile* ParseFile(const string& filename, const Configuration& config,
-                                     int version, const string& versionString);
-    static ValuesFile* ParseString(const string& filename, const string& text,
-                                     const Configuration& config,
-                                     int version, const string& versionString);
-    ~ValuesFile();
-
-    const Configuration& GetConfiguration() const;
-
-    void AddString(const StringResource& str);
-    set<StringResource> GetStrings() const;
-
-    // exports this file as a n XMLNode, you own this object
-    XMLNode* ToXMLNode() const;
-
-    // writes the ValuesFile out to a string in the canonical format (i.e. writes the contents of
-    // ToXMLNode()).
-    string ToString() const;
-
-private:
-    class ParseState;
-    friend class ValuesFile::ParseState;
-    friend class StringHandler;
-
-    ValuesFile();
-
-    Configuration m_config;
-    set<StringResource> m_strings;
-    map<string,set<StringResource> > m_arrays;
-};
-
-#endif // VALUES_FILE_H
diff --git a/tools/localize/ValuesFile_test.cpp b/tools/localize/ValuesFile_test.cpp
deleted file mode 100644
index 56d2ec2..0000000
--- a/tools/localize/ValuesFile_test.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-#include "ValuesFile.h"
-#include <stdio.h>
-
-int
-ValuesFile_test()
-{
-    int err = 0;
-    Configuration config;
-    config.locale = "zz_ZZ";
-    ValuesFile* vf = ValuesFile::ParseFile("testdata/values/strings.xml", config,
-                                        OLD_VERSION, "1");
-
-    const set<StringResource>& strings = vf->GetStrings();
-    string canonical = vf->ToString();
-
-    if (false) {
-        printf("Strings (%zd)\n", strings.size());
-            for (set<StringResource>::const_iterator it=strings.begin();
-                    it!=strings.end(); it++) {
-            const StringResource& str = *it;
-            printf("%s: '%s'[%d]='%s' (%s) <!-- %s -->\n", str.pos.ToString().c_str(),
-                    str.id.c_str(), str.index,
-                    str.value->ContentsToString(ANDROID_NAMESPACES).c_str(),
-                    str.config.ToString().c_str(), str.comment.c_str());
-        }
-
-        printf("XML:[[%s]]\n", canonical.c_str());
-    }
-
-    const char * const EXPECTED =
-        "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
-        "<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n"
-        "    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n"
-        "  <array name=\"emailAddressTypes\">\n"
-        "    <item>Email</item>\n"
-        "    <item>Home</item>\n"
-        "    <item>Work</item>\n"
-        "    <item>Other\\u2026</item>\n"
-        "  </array>\n"
-        "  <string name=\"test1\">Discard</string>\n"
-        "  <string name=\"test2\">a<b>b<i>c</i></b>d</string>\n"
-        "  <string name=\"test3\">a<xliff:g a=\"b\" xliff:a=\"asdf\">bBb</xliff:g>C</string>\n"
-        "</resources>\n";
-
-    if (canonical != EXPECTED) {
-        fprintf(stderr, "ValuesFile_test failed\n");
-        fprintf(stderr, "canonical=[[%s]]\n", canonical.c_str());
-        fprintf(stderr, "EXPECTED=[[%s]]\n", EXPECTED);
-        err = 1;
-    }
-
-    delete vf;
-    return err;
-}
diff --git a/tools/localize/XLIFFFile.cpp b/tools/localize/XLIFFFile.cpp
deleted file mode 100644
index 4e217d9..0000000
--- a/tools/localize/XLIFFFile.cpp
+++ /dev/null
@@ -1,610 +0,0 @@
-#include "XLIFFFile.h"
-
-#include <algorithm>
-#include <sys/time.h>
-#include <time.h>
-#include <cstdio>
-
-const char* const XLIFF_XMLNS = "urn:oasis:names:tc:xliff:document:1.2";
-
-const char *const NS_MAP[] = {
-    "", XLIFF_XMLNS,
-    "xml", XMLNS_XMLNS,
-    NULL, NULL
-};
-
-const XMLNamespaceMap XLIFF_NAMESPACES(NS_MAP);
-
-int
-XLIFFFile::File::Compare(const XLIFFFile::File& that) const
-{
-    if (filename != that.filename) {
-        return filename < that.filename ? -1 : 1;
-    }
-    return 0;
-}
-
-// =====================================================================================
-XLIFFFile::XLIFFFile()
-{
-}
-
-XLIFFFile::~XLIFFFile()
-{
-}
-
-static XMLNode*
-get_unique_node(const XMLNode* parent, const string& ns, const string& name, bool required)
-{
-    size_t count = parent->CountElementsByName(ns, name);
-    if (count == 1) {
-        return parent->GetElementByNameAt(ns, name, 0);
-    } else {
-        if (required) {
-            SourcePos pos = count == 0
-                                ? parent->Position()
-                                : parent->GetElementByNameAt(XLIFF_XMLNS, name, 1)->Position();
-            pos.Error("<%s> elements must contain exactly one <%s> element",
-                                parent->Name().c_str(), name.c_str());
-        }
-        return NULL;
-    }
-}
-
-XLIFFFile*
-XLIFFFile::Parse(const string& filename)
-{
-    XLIFFFile* result = new XLIFFFile();
-
-    XMLNode* root = NodeHandler::ParseFile(filename, XMLNode::PRETTY);
-    if (root == NULL) {
-        return NULL;
-    }
-
-    // <file>
-    vector<XMLNode*> files = root->GetElementsByName(XLIFF_XMLNS, "file");
-    for (size_t i=0; i<files.size(); i++) {
-        XMLNode* file = files[i];
-
-        string datatype = file->GetAttribute("", "datatype", "");
-        string originalFile = file->GetAttribute("", "original", "");
-
-        Configuration sourceConfig;
-        sourceConfig.locale = file->GetAttribute("", "source-language", "");
-        result->m_sourceConfig = sourceConfig;
-
-        Configuration targetConfig;
-        targetConfig.locale = file->GetAttribute("", "target-language", "");
-        result->m_targetConfig = targetConfig;
-
-        result->m_currentVersion = file->GetAttribute("", "build-num", "");
-        result->m_oldVersion = "old";
-
-        // <body>
-        XMLNode* body = get_unique_node(file, XLIFF_XMLNS, "body", true);
-        if (body == NULL) continue;
-
-        // <trans-unit>
-        vector<XMLNode*> transUnits = body->GetElementsByName(XLIFF_XMLNS, "trans-unit");
-        for (size_t j=0; j<transUnits.size(); j++) {
-            XMLNode* transUnit = transUnits[j];
-
-            string rawID = transUnit->GetAttribute("", "id", "");
-            if (rawID == "") {
-                transUnit->Position().Error("<trans-unit> tag requires an id");
-                continue;
-            }
-            string id;
-            int index;
-
-            if (!StringResource::ParseTypedID(rawID, &id, &index)) {
-                transUnit->Position().Error("<trans-unit> has invalid id '%s'\n", rawID.c_str());
-                continue;
-            }
-
-            // <source>
-            XMLNode* source = get_unique_node(transUnit, XLIFF_XMLNS, "source", false);
-            if (source != NULL) {
-                XMLNode* node = source->Clone();
-                node->SetPrettyRecursive(XMLNode::EXACT);
-                result->AddStringResource(StringResource(source->Position(), originalFile,
-                            sourceConfig, id, index, node, CURRENT_VERSION,
-                            result->m_currentVersion));
-            }
-
-            // <target>
-            XMLNode* target = get_unique_node(transUnit, XLIFF_XMLNS, "target", false);
-            if (target != NULL) {
-                XMLNode* node = target->Clone();
-                node->SetPrettyRecursive(XMLNode::EXACT);
-                result->AddStringResource(StringResource(target->Position(), originalFile,
-                            targetConfig, id, index, node, CURRENT_VERSION,
-                            result->m_currentVersion));
-            }
-
-            // <alt-trans>
-            XMLNode* altTrans = get_unique_node(transUnit, XLIFF_XMLNS, "alt-trans", false);
-            if (altTrans != NULL) {
-                // <source>
-                XMLNode* altSource = get_unique_node(altTrans, XLIFF_XMLNS, "source", false);
-                if (altSource != NULL) {
-                    XMLNode* node = altSource->Clone();
-                    node->SetPrettyRecursive(XMLNode::EXACT);
-                    result->AddStringResource(StringResource(altSource->Position(),
-                                originalFile, sourceConfig, id, index, node, OLD_VERSION,
-                                result->m_oldVersion));
-                }
-
-                // <target>
-                XMLNode* altTarget = get_unique_node(altTrans, XLIFF_XMLNS, "target", false);
-                if (altTarget != NULL) {
-                    XMLNode* node = altTarget->Clone();
-                    node->SetPrettyRecursive(XMLNode::EXACT);
-                    result->AddStringResource(StringResource(altTarget->Position(),
-                                originalFile, targetConfig, id, index, node, OLD_VERSION,
-                                result->m_oldVersion));
-                }
-            }
-        }
-    }
-    delete root;
-    return result;
-}
-
-XLIFFFile*
-XLIFFFile::Create(const Configuration& sourceConfig, const Configuration& targetConfig,
-                                const string& currentVersion)
-{
-    XLIFFFile* result = new XLIFFFile();
-        result->m_sourceConfig = sourceConfig;
-        result->m_targetConfig = targetConfig;
-        result->m_currentVersion = currentVersion;
-    return result;
-}
-
-set<string>
-XLIFFFile::Files() const
-{
-    set<string> result;
-    for (vector<File>::const_iterator f = m_files.begin(); f != m_files.end(); f++) {
-        result.insert(f->filename);
-    }
-    return result;
-}
-
-void
-XLIFFFile::AddStringResource(const StringResource& str)
-{
-    string id = str.TypedID();
-
-    File* f = NULL;
-    const size_t I = m_files.size();
-    for (size_t i=0; i<I; i++) {
-        if (m_files[i].filename == str.file) {
-            f = &m_files[i];
-            break;
-        }
-    }
-    if (f == NULL) {
-        File file;
-        file.filename = str.file;
-        m_files.push_back(file);
-        f = &m_files[I];
-    }
-
-    const size_t J = f->transUnits.size();
-    TransUnit* g = NULL;
-    for (size_t j=0; j<J; j++) {
-        if (f->transUnits[j].id == id) {
-            g = &f->transUnits[j];
-        }
-    }
-    if (g == NULL) {
-        TransUnit group;
-        group.id = id;
-        f->transUnits.push_back(group);
-        g = &f->transUnits[J];
-    }
-
-    StringResource* res = find_string_res(*g, str);
-    if (res == NULL) {
-        return ;
-    }
-    if (res->id != "") {
-        str.pos.Error("Duplicate string resource: %s", res->id.c_str());
-        res->pos.Error("Previous definition here");
-        return ;
-    }
-    *res = str;
-
-    m_strings.insert(str);
-}
-
-void
-XLIFFFile::Filter(bool (*func)(const string&,const TransUnit&,void*), void* cookie)
-{
-    const size_t I = m_files.size();
-    for (size_t ix=0, i=I-1; ix<I; ix++, i--) {
-        File& file = m_files[i];
-
-        const size_t J = file.transUnits.size();
-        for (size_t jx=0, j=J-1; jx<J; jx++, j--) {
-            TransUnit& tu = file.transUnits[j];
-
-            bool keep = func(file.filename, tu, cookie);
-            if (!keep) {
-                if (tu.source.id != "") {
-                    m_strings.erase(tu.source);
-                }
-                if (tu.target.id != "") {
-                    m_strings.erase(tu.target);
-                }
-                if (tu.altSource.id != "") {
-                    m_strings.erase(tu.altSource);
-                }
-                if (tu.altTarget.id != "") {
-                    m_strings.erase(tu.altTarget);
-                }
-                file.transUnits.erase(file.transUnits.begin()+j);
-            }
-        }
-        if (file.transUnits.size() == 0) {
-            m_files.erase(m_files.begin()+i);
-        }
-    }
-}
-
-void
-XLIFFFile::Map(void (*func)(const string&,TransUnit*,void*), void* cookie)
-{
-    const size_t I = m_files.size();
-    for (size_t i=0; i<I; i++) {
-        File& file = m_files[i];
-
-        const size_t J = file.transUnits.size();
-        for (size_t j=0; j<J; j++) {
-            func(file.filename, &(file.transUnits[j]), cookie);
-        }
-    }
-}
-
-TransUnit*
-XLIFFFile::EditTransUnit(const string& filename, const string& id)
-{
-    const size_t I = m_files.size();
-    for (size_t ix=0, i=I-1; ix<I; ix++, i--) {
-        File& file = m_files[i];
-        if (file.filename == filename) {
-            const size_t J = file.transUnits.size();
-            for (size_t jx=0, j=J-1; jx<J; jx++, j--) {
-                TransUnit& tu = file.transUnits[j];
-                if (tu.id == id) {
-                    return &tu;
-                }
-            }
-        }
-    }
-    return NULL;
-}
-
-StringResource*
-XLIFFFile::find_string_res(TransUnit& g, const StringResource& str)
-{
-    int index;
-    if (str.version == CURRENT_VERSION) {
-        index = 0;
-    }
-    else if (str.version == OLD_VERSION) {
-        index = 2;
-    }
-    else {
-        str.pos.Error("Internal Error %s:%d\n", __FILE__, __LINE__);
-        return NULL;
-    }
-    if (str.config == m_sourceConfig) {
-        // index += 0;
-    }
-    else if (str.config == m_targetConfig) {
-        index += 1;
-    }
-    else {
-        str.pos.Error("unknown config for string %s: %s", str.id.c_str(),
-                            str.config.ToString().c_str());
-        return NULL;
-    }
-    switch (index) {
-        case 0:
-            return &g.source;
-        case 1:
-            return &g.target;
-        case 2:
-            return &g.altSource;
-        case 3:
-            return &g.altTarget;
-    }
-    str.pos.Error("Internal Error %s:%d\n", __FILE__, __LINE__);
-    return NULL;
-}
-
-int
-convert_html_to_xliff(const XMLNode* original, const string& name, XMLNode* addTo, int* phID)
-{
-    int err = 0;
-    if (original->Type() == XMLNode::TEXT) {
-        addTo->EditChildren().push_back(original->Clone());
-        return 0;
-    } else {
-        string ctype;
-        if (original->Namespace() == "") {
-            if (original->Name() == "b") {
-                ctype = "bold";
-            }
-            else if (original->Name() == "i") {
-                ctype = "italic";
-            }
-            else if (original->Name() == "u") {
-                ctype = "underline";
-            }
-        }
-        if (ctype != "") {
-            vector<XMLAttribute> attrs;
-            attrs.push_back(XMLAttribute(XLIFF_XMLNS, "ctype", ctype));
-            XMLNode* copy = XMLNode::NewElement(original->Position(), XLIFF_XMLNS, "g",
-                                                attrs, XMLNode::EXACT);
-
-            const vector<XMLNode*>& children = original->Children();
-            size_t I = children.size();
-            for (size_t i=0; i<I; i++) {
-                err |= convert_html_to_xliff(children[i], name, copy, phID);
-            }
-            return err;
-        }
-        else {
-            if (original->Namespace() == XLIFF_XMLNS) {
-                addTo->EditChildren().push_back(original->Clone());
-                return 0;
-            } else {
-                if (original->Namespace() == "") {
-                    // flatten out the tag into ph tags -- but only if there is no namespace
-                    // that's still unsupported because propagating the xmlns attribute is hard.
-                    vector<XMLAttribute> attrs;
-                    char idStr[30];
-                    (*phID)++;
-                    sprintf(idStr, "id-%d", *phID);
-                    attrs.push_back(XMLAttribute(XLIFF_XMLNS, "id", idStr));
-
-                    if (original->Children().size() == 0) {
-                        XMLNode* ph = XMLNode::NewElement(original->Position(), XLIFF_XMLNS,
-                                "ph", attrs, XMLNode::EXACT);
-                        ph->EditChildren().push_back(
-                                XMLNode::NewText(original->Position(),
-                                    original->ToString(XLIFF_NAMESPACES),
-                                    XMLNode::EXACT));
-                        addTo->EditChildren().push_back(ph);
-                    } else {
-                        XMLNode* begin = XMLNode::NewElement(original->Position(), XLIFF_XMLNS,
-                                "bpt", attrs, XMLNode::EXACT);
-                        begin->EditChildren().push_back(
-                                XMLNode::NewText(original->Position(),
-                                    original->OpenTagToString(XLIFF_NAMESPACES, XMLNode::EXACT),
-                                    XMLNode::EXACT));
-                        XMLNode* end = XMLNode::NewElement(original->Position(), XLIFF_XMLNS,
-                                "ept", attrs, XMLNode::EXACT);
-                        string endText = "</";
-                            endText += original->Name();
-                            endText += ">";
-                        end->EditChildren().push_back(XMLNode::NewText(original->Position(),
-                                endText, XMLNode::EXACT));
-
-                        addTo->EditChildren().push_back(begin);
-
-                        const vector<XMLNode*>& children = original->Children();
-                        size_t I = children.size();
-                        for (size_t i=0; i<I; i++) {
-                            err |= convert_html_to_xliff(children[i], name, addTo, phID);
-                        }
-
-                        addTo->EditChildren().push_back(end);
-                    }
-                    return err;
-                } else {
-                    original->Position().Error("invalid <%s> element in <%s> tag\n",
-                                                original->Name().c_str(), name.c_str());
-                    return 1;
-                }
-            }
-        }
-    }
-}
-
-XMLNode*
-create_string_node(const StringResource& str, const string& name)
-{
-    vector<XMLAttribute> attrs;
-    attrs.push_back(XMLAttribute(XMLNS_XMLNS, "space", "preserve"));
-    XMLNode* node = XMLNode::NewElement(str.pos, XLIFF_XMLNS, name, attrs, XMLNode::EXACT);
-
-    const vector<XMLNode*>& children = str.value->Children();
-    size_t I = children.size();
-    int err = 0;
-    for (size_t i=0; i<I; i++) {
-        int phID = 0;
-        err |= convert_html_to_xliff(children[i], name, node, &phID);
-    }
-
-    if (err != 0) {
-        delete node;
-    }
-    return node;
-}
-
-static bool
-compare_id(const TransUnit& lhs, const TransUnit& rhs)
-{
-    string lid, rid;
-    int lindex, rindex;
-    StringResource::ParseTypedID(lhs.id, &lid, &lindex);
-    StringResource::ParseTypedID(rhs.id, &rid, &rindex);
-    if (lid < rid) return true;
-    if (lid == rid && lindex < rindex) return true;
-    return false;
-}
-
-XMLNode*
-XLIFFFile::ToXMLNode() const
-{
-    XMLNode* root;
-    size_t N;
-
-    // <xliff>
-    {
-        vector<XMLAttribute> attrs;
-        XLIFF_NAMESPACES.AddToAttributes(&attrs);
-        attrs.push_back(XMLAttribute(XLIFF_XMLNS, "version", "1.2"));
-        root = XMLNode::NewElement(GENERATED_POS, XLIFF_XMLNS, "xliff", attrs, XMLNode::PRETTY);
-    }
-
-    vector<TransUnit> groups;
-
-    // <file>
-    vector<File> files = m_files;
-    sort(files.begin(), files.end());
-    const size_t I = files.size();
-    for (size_t i=0; i<I; i++) {
-        const File& file = files[i];
-
-        vector<XMLAttribute> fileAttrs;
-        fileAttrs.push_back(XMLAttribute(XLIFF_XMLNS, "datatype", "x-android-res"));
-        fileAttrs.push_back(XMLAttribute(XLIFF_XMLNS, "original", file.filename));
-
-        struct timeval tv;
-        struct timezone tz;
-        gettimeofday(&tv, &tz);
-        fileAttrs.push_back(XMLAttribute(XLIFF_XMLNS, "date", trim_string(ctime(&tv.tv_sec))));
-
-        fileAttrs.push_back(XMLAttribute(XLIFF_XMLNS, "source-language", m_sourceConfig.locale));
-        fileAttrs.push_back(XMLAttribute(XLIFF_XMLNS, "target-language", m_targetConfig.locale));
-        fileAttrs.push_back(XMLAttribute(XLIFF_XMLNS, "build-num", m_currentVersion));
-
-        XMLNode* fileNode = XMLNode::NewElement(GENERATED_POS, XLIFF_XMLNS, "file", fileAttrs,
-                                                XMLNode::PRETTY);
-        root->EditChildren().push_back(fileNode);
-
-        // <body>
-        XMLNode* bodyNode = XMLNode::NewElement(GENERATED_POS, XLIFF_XMLNS, "body",
-                                                vector<XMLAttribute>(), XMLNode::PRETTY);
-        fileNode->EditChildren().push_back(bodyNode);
-
-        // <trans-unit>
-        vector<TransUnit> transUnits = file.transUnits;
-        sort(transUnits.begin(), transUnits.end(), compare_id);
-        const size_t J = transUnits.size();
-        for (size_t j=0; j<J; j++) {
-            const TransUnit& transUnit = transUnits[j];
-
-            vector<XMLAttribute> tuAttrs;
-
-            // strings start with string:
-            tuAttrs.push_back(XMLAttribute(XLIFF_XMLNS, "id", transUnit.id));
-            XMLNode* transUnitNode = XMLNode::NewElement(GENERATED_POS, XLIFF_XMLNS, "trans-unit",
-                                                         tuAttrs, XMLNode::PRETTY);
-            bodyNode->EditChildren().push_back(transUnitNode);
-
-            // <extradata>
-            if (transUnit.source.comment != "") {
-                vector<XMLAttribute> extradataAttrs;
-                XMLNode* extraNode = XMLNode::NewElement(GENERATED_POS, XLIFF_XMLNS, "extradata",
-                                                            extradataAttrs, XMLNode::EXACT);
-                transUnitNode->EditChildren().push_back(extraNode);
-                extraNode->EditChildren().push_back(
-                        XMLNode::NewText(GENERATED_POS, transUnit.source.comment,
-                                         XMLNode::PRETTY));
-            }
-
-            // <source>
-            if (transUnit.source.id != "") {
-                transUnitNode->EditChildren().push_back(
-                                    create_string_node(transUnit.source, "source"));
-            }
-            
-            // <target>
-            if (transUnit.target.id != "") {
-                transUnitNode->EditChildren().push_back(
-                                    create_string_node(transUnit.target, "target"));
-            }
-
-            // <alt-trans>
-            if (transUnit.altSource.id != "" || transUnit.altTarget.id != ""
-                    || transUnit.rejectComment != "") {
-                vector<XMLAttribute> altTransAttrs;
-                XMLNode* altTransNode = XMLNode::NewElement(GENERATED_POS, XLIFF_XMLNS, "alt-trans",
-                                                            altTransAttrs, XMLNode::PRETTY);
-                transUnitNode->EditChildren().push_back(altTransNode);
-
-                // <extradata>
-                if (transUnit.rejectComment != "") {
-                    vector<XMLAttribute> extradataAttrs;
-                    XMLNode* extraNode = XMLNode::NewElement(GENERATED_POS, XLIFF_XMLNS,
-                                                                "extradata", extradataAttrs,
-                                                                XMLNode::EXACT);
-                    altTransNode->EditChildren().push_back(extraNode);
-                    extraNode->EditChildren().push_back(
-                            XMLNode::NewText(GENERATED_POS, transUnit.rejectComment,
-                                             XMLNode::PRETTY));
-                }
-                
-                // <source>
-                if (transUnit.altSource.id != "") {
-                    altTransNode->EditChildren().push_back(
-                                        create_string_node(transUnit.altSource, "source"));
-                }
-                
-                // <target>
-                if (transUnit.altTarget.id != "") {
-                    altTransNode->EditChildren().push_back(
-                                        create_string_node(transUnit.altTarget, "target"));
-                }
-            }
-            
-        }
-    }
-
-    return root;
-}
-
-
-string
-XLIFFFile::ToString() const
-{
-    XMLNode* xml = ToXMLNode();
-    string s = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
-    s += xml->ToString(XLIFF_NAMESPACES);
-    delete xml;
-    s += '\n';
-    return s;
-}
-
-Stats
-XLIFFFile::GetStats(const string& config) const
-{
-    Stats stat;
-    stat.config = config;
-    stat.files = m_files.size();
-    stat.toBeTranslated = 0;
-    stat.noComments = 0;
-
-    for (vector<File>::const_iterator file=m_files.begin(); file!=m_files.end(); file++) {
-        stat.toBeTranslated += file->transUnits.size();
-
-        for (vector<TransUnit>::const_iterator tu=file->transUnits.begin();
-                    tu!=file->transUnits.end(); tu++) {
-            if (tu->source.comment == "") {
-                stat.noComments++;
-            }
-        }
-    }
-
-    stat.totalStrings = stat.toBeTranslated;
-
-    return stat;
-}
diff --git a/tools/localize/XLIFFFile.h b/tools/localize/XLIFFFile.h
deleted file mode 100644
index a93d479..0000000
--- a/tools/localize/XLIFFFile.h
+++ /dev/null
@@ -1,98 +0,0 @@
-#ifndef XLIFF_FILE_H
-#define XLIFF_FILE_H
-
-#include "Values.h"
-
-#include "Configuration.h"
-
-#include <set>
-
-using namespace std;
-
-extern const XMLNamespaceMap XLIFF_NAMESPACES;
-
-extern const char*const XLIFF_XMLNS;
-
-struct Stats
-{
-    string config;
-    size_t files;
-    size_t toBeTranslated;
-    size_t noComments;
-    size_t totalStrings;
-};
-
-struct TransUnit {
-    string id;
-    StringResource source;
-    StringResource target;
-    StringResource altSource;
-    StringResource altTarget;
-    string rejectComment;
-};
-
-class XLIFFFile
-{
-public:
-    static XLIFFFile* Parse(const string& filename);
-    static XLIFFFile* Create(const Configuration& sourceConfig, const Configuration& targetConfig,
-                                const string& currentVersion);
-    ~XLIFFFile();
-
-    inline const Configuration& SourceConfig() const                { return m_sourceConfig; }
-    inline const Configuration& TargetConfig() const                { return m_targetConfig; }
-
-    inline const string& CurrentVersion() const                     { return m_currentVersion; }
-    inline const string& OldVersion() const                         { return m_oldVersion; }
-
-    set<string> Files() const;
-
-    void AddStringResource(const StringResource& res);
-    inline set<StringResource> const& GetStringResources() const { return m_strings; }
-    bool FindStringResource(const string& filename, int version, bool source);
-
-    void Filter(bool (*func)(const string&,const TransUnit&,void*), void* cookie);
-    void Map(void (*func)(const string&,TransUnit*,void*), void* cookie);
-
-    TransUnit* EditTransUnit(const string& file, const string& id);
-
-    // exports this file as a n XMLNode, you own this object
-    XMLNode* ToXMLNode() const;
-
-    // writes the ValuesFile out to a string in the canonical format (i.e. writes the contents of
-    // ToXMLNode()).
-    string ToString() const;
-
-    Stats GetStats(const string& config) const;
-
-private:
-    struct File {
-        int Compare(const File& that) const;
-
-        inline bool operator<(const File& that) const { return Compare(that) < 0; }
-        inline bool operator<=(const File& that) const { return Compare(that) <= 0; }
-        inline bool operator==(const File& that) const { return Compare(that) == 0; }
-        inline bool operator!=(const File& that) const { return Compare(that) != 0; }
-        inline bool operator>=(const File& that) const { return Compare(that) >= 0; }
-        inline bool operator>(const File& that) const { return Compare(that) > 0; }
-
-        string filename;
-        vector<TransUnit> transUnits;
-    };
-
-    XLIFFFile();
-    StringResource* find_string_res(TransUnit& g, const StringResource& str);
-    
-    Configuration m_sourceConfig;
-    Configuration m_targetConfig;
-
-    string m_currentVersion;
-    string m_oldVersion;
-
-    set<StringResource> m_strings;
-    vector<File> m_files;
-};
-
-int convert_html_to_xliff(const XMLNode* original, const string& name, XMLNode* addTo, int* phID);
-
-#endif // XLIFF_FILE_H
diff --git a/tools/localize/XLIFFFile_test.cpp b/tools/localize/XLIFFFile_test.cpp
deleted file mode 100644
index 52ed4c3..0000000
--- a/tools/localize/XLIFFFile_test.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-#include "XLIFFFile.h"
-#include <stdio.h>
-#include "ValuesFile.h"
-
-XMLNode* create_string_node(const StringResource& str, const string& name);
-
-static int
-Parse_test()
-{
-    XLIFFFile* xf = XLIFFFile::Parse("testdata/xliff1.xliff");
-    if (xf == NULL) {
-        return 1;
-    }
-
-    set<StringResource> const& strings = xf->GetStringResources();
-
-    if (false) {
-        for (set<StringResource>::iterator it=strings.begin(); it!=strings.end(); it++) {
-            const StringResource& str = *it;
-            printf("STRING!!! id=%s index=%d value='%s' pos=%s file=%s version=%d(%s)\n",
-                    str.id.c_str(), str.index,
-                    str.value->ContentsToString(ANDROID_NAMESPACES).c_str(),
-                    str.pos.ToString().c_str(), str.file.c_str(), str.version,
-                    str.versionString.c_str());
-        }
-        printf("XML:[[%s]]\n", xf->ToString().c_str());
-    }
-
-    delete xf;
-    return 0;
-}
-
-static XMLNode*
-add_html_tag(XMLNode* addTo, const string& tag)
-{
-    vector<XMLAttribute> attrs;
-    XMLNode* node = XMLNode::NewElement(GENERATED_POS, "", tag, attrs, XMLNode::EXACT);
-    addTo->EditChildren().push_back(node);
-    return node;
-}
-
-static int
-create_string_node_test()
-{
-    int err = 0;
-    StringResource res;
-    vector<XMLAttribute> attrs;
-    res.value = XMLNode::NewElement(GENERATED_POS, "", "something", attrs, XMLNode::EXACT);
-    res.value->EditChildren().push_back(XMLNode::NewText(GENERATED_POS, " begin ", XMLNode::EXACT));
-
-    XMLNode* child;
-
-    child = add_html_tag(res.value, "b");
-    child->EditChildren().push_back(XMLNode::NewText(GENERATED_POS, "b", XMLNode::EXACT));
-
-    child = add_html_tag(res.value, "i");
-    child->EditChildren().push_back(XMLNode::NewText(GENERATED_POS, "i", XMLNode::EXACT));
-
-    child = add_html_tag(child, "b");
-    child->EditChildren().push_back(XMLNode::NewText(GENERATED_POS, "b", XMLNode::EXACT));
-
-    child = add_html_tag(res.value, "u");
-    child->EditChildren().push_back(XMLNode::NewText(GENERATED_POS, "u", XMLNode::EXACT));
-
-
-    res.value->EditChildren().push_back(XMLNode::NewText(GENERATED_POS, " end ", XMLNode::EXACT));
-
-    XMLNode* xliff = create_string_node(res, "blah");
-
-    string oldString = res.value->ToString(XLIFF_NAMESPACES);
-    string newString = xliff->ToString(XLIFF_NAMESPACES);
-
-    if (false) {
-        printf("OLD=\"%s\"\n", oldString.c_str());
-        printf("NEW=\"%s\"\n", newString.c_str());
-    }
-
-    const char* const EXPECTED_OLD
-                    = "<something> begin <b>b</b><i>i<b>b</b></i><u>u</u> end </something>";
-    if (oldString != EXPECTED_OLD) {
-        fprintf(stderr, "oldString mismatch:\n");
-        fprintf(stderr, "    expected='%s'\n", EXPECTED_OLD);
-        fprintf(stderr, "      actual='%s'\n", oldString.c_str());
-        err |= 1;
-    }
-
-    const char* const EXPECTED_NEW
-                    = "<blah xml:space=\"preserve\"> begin <g ctype=\"bold\">b</g>"
-                    "<g ctype=\"italic\">i<g ctype=\"bold\">b</g></g><g ctype=\"underline\">u</g>"
-                    " end </blah>";
-    if (newString != EXPECTED_NEW) {
-        fprintf(stderr, "newString mismatch:\n");
-        fprintf(stderr, "    expected='%s'\n", EXPECTED_NEW);
-        fprintf(stderr, "      actual='%s'\n", newString.c_str());
-        err |= 1;
-    }
-
-    if (err != 0) {
-        fprintf(stderr, "create_string_node_test failed\n");
-    }
-    return err;
-}
-
-int
-XLIFFFile_test()
-{
-    bool all = true;
-    int err = 0;
-
-    if (all) err |= Parse_test();
-    if (all) err |= create_string_node_test();
-
-    return err;
-}
-
diff --git a/tools/localize/XMLHandler.cpp b/tools/localize/XMLHandler.cpp
deleted file mode 100644
index 3fab211..0000000
--- a/tools/localize/XMLHandler.cpp
+++ /dev/null
@@ -1,793 +0,0 @@
-#include "XMLHandler.h"
-
-#include <algorithm>
-#include <expat.h>
-#include <stdio.h>
-#include <string.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-
-#define NS_SEPARATOR 1
-#define MORE_INDENT "  "
-
-static string
-xml_text_escape(const string& s)
-{
-    string result;
-    const size_t N = s.length();
-    for (size_t i=0; i<N; i++) {
-        char c = s[i];
-        switch (c) {
-            case '<':
-                result += "&lt;";
-                break;
-            case '>':
-                result += "&gt;";
-                break;
-            case '&':
-                result += "&amp;";
-                break;
-            default:
-                result += c;
-                break;
-        }
-    }
-    return result;
-}
-
-static string
-xml_attr_escape(const string& s)
-{
-    string result;
-    const size_t N = s.length();
-    for (size_t i=0; i<N; i++) {
-        char c = s[i];
-        switch (c) {
-            case '\"':
-                result += "&quot;";
-                break;
-            default:
-                result += c;
-                break;
-        }
-    }
-    return result;
-}
-
-XMLNamespaceMap::XMLNamespaceMap()
-{
-}
-
-XMLNamespaceMap::XMLNamespaceMap(char const*const* nspaces)
-
-{
-    while (*nspaces) {
-        m_map[nspaces[1]] = nspaces[0];
-        nspaces += 2;
-    }
-}
-
-string
-XMLNamespaceMap::Get(const string& ns) const
-{
-    if (ns == "xml") {
-        return ns;
-    }
-    map<string,string>::const_iterator it = m_map.find(ns);
-    if (it == m_map.end()) {
-        return "";
-    } else {
-        return it->second;
-    }
-}
-
-string
-XMLNamespaceMap::GetPrefix(const string& ns) const
-{
-    if (ns == "") {
-        return "";
-    }
-    map<string,string>::const_iterator it = m_map.find(ns);
-    if (it != m_map.end()) {
-        if (it->second == "") {
-            return "";
-        } else {
-            return it->second + ":";
-        }
-    } else {
-        return ":"; // invalid
-    }
-}
-
-void
-XMLNamespaceMap::AddToAttributes(vector<XMLAttribute>* attrs) const
-{
-    map<string,string>::const_iterator it;
-    for (it=m_map.begin(); it!=m_map.end(); it++) {
-        if (it->second == "xml") {
-            continue;
-        }
-        XMLAttribute attr;
-        if (it->second == "") {
-            attr.name = "xmlns";
-        } else {
-            attr.name = "xmlns:";
-            attr.name += it->second;
-        }
-        attr.value = it->first;
-        attrs->push_back(attr);
-    }
-}
-
-XMLAttribute::XMLAttribute()
-{
-}
-
-XMLAttribute::XMLAttribute(const XMLAttribute& that)
-    :ns(that.ns),
-     name(that.name),
-     value(that.value)
-{
-}
-
-XMLAttribute::XMLAttribute(string n, string na, string v)
-    :ns(n),
-     name(na),
-     value(v)
-{
-}
-
-XMLAttribute::~XMLAttribute()
-{
-}
-
-int
-XMLAttribute::Compare(const XMLAttribute& that) const
-{
-    if (ns != that.ns) {
-        return ns < that.ns ? -1 : 1;
-    }
-    if (name != that.name) {
-        return name < that.name ? -1 : 1;
-    }
-    return 0;
-}
-
-string
-XMLAttribute::Find(const vector<XMLAttribute>& list, const string& ns, const string& name,
-                    const string& def)
-{
-    const size_t N = list.size();
-    for (size_t i=0; i<N; i++) {
-        const XMLAttribute& attr = list[i];
-        if (attr.ns == ns && attr.name == name) {
-            return attr.value;
-        }
-    }
-    return def;
-}
-
-struct xml_handler_data {
-    vector<XMLHandler*> stack;
-    XML_Parser parser;
-    vector<vector<XMLAttribute>*> attributes;
-    string filename;
-};
-
-XMLNode::XMLNode()
-{
-}
-
-XMLNode::~XMLNode()
-{
-//    for_each(m_children.begin(), m_children.end(), delete_object<XMLNode>);
-}
-
-XMLNode*
-XMLNode::Clone() const
-{
-    switch (m_type) {
-        case ELEMENT: {
-            XMLNode* e = XMLNode::NewElement(m_pos, m_ns, m_name, m_attrs, m_pretty);
-            const size_t N = m_children.size();
-            for (size_t i=0; i<N; i++) {
-                e->m_children.push_back(m_children[i]->Clone());
-            }
-            return e;
-        }
-        case TEXT: {
-            return XMLNode::NewText(m_pos, m_text, m_pretty);
-        }
-        default:
-            return NULL;
-    }
-}
-
-XMLNode*
-XMLNode::NewElement(const SourcePos& pos, const string& ns, const string& name,
-                        const vector<XMLAttribute>& attrs, int pretty)
-{
-    XMLNode* node = new XMLNode();
-        node->m_type = ELEMENT;
-        node->m_pretty = pretty;
-        node->m_pos = pos;
-        node->m_ns = ns;
-        node->m_name = name;
-        node->m_attrs = attrs;
-    return node;
-}
-
-XMLNode*
-XMLNode::NewText(const SourcePos& pos, const string& text, int pretty)
-{
-    XMLNode* node = new XMLNode();
-        node->m_type = TEXT;
-        node->m_pretty = pretty;
-        node->m_pos = pos;
-        node->m_text = text;
-    return node;
-}
-
-void
-XMLNode::SetPrettyRecursive(int value)
-{
-    m_pretty = value;
-    const size_t N = m_children.size();
-    for (size_t i=0; i<N; i++) {
-        m_children[i]->SetPrettyRecursive(value);
-    }
-}
-
-string
-XMLNode::ContentsToString(const XMLNamespaceMap& nspaces) const
-{
-    return contents_to_string(nspaces, "");
-}
-
-string
-XMLNode::ToString(const XMLNamespaceMap& nspaces) const
-{
-    return to_string(nspaces, "");
-}
-
-string
-XMLNode::OpenTagToString(const XMLNamespaceMap& nspaces, int pretty) const
-{
-    return open_tag_to_string(nspaces, "", pretty);
-}
-
-string
-XMLNode::contents_to_string(const XMLNamespaceMap& nspaces, const string& indent) const
-{
-    string result;
-    const size_t N = m_children.size();
-    for (size_t i=0; i<N; i++) {
-        const XMLNode* child = m_children[i];
-        switch (child->Type()) {
-        case ELEMENT:
-            if (m_pretty == PRETTY) {
-                result += '\n';
-                result += indent;
-            }
-        case TEXT:
-            result += child->to_string(nspaces, indent);
-            break;
-        }
-    }
-    return result;
-}
-
-string
-trim_string(const string& str)
-{
-    const char* p = str.c_str();
-    while (*p && isspace(*p)) {
-        p++;
-    }
-    const char* q = str.c_str() + str.length() - 1;
-    while (q > p && isspace(*q)) {
-        q--;
-    }
-    q++;
-    return string(p, q-p);
-}
-
-string
-XMLNode::open_tag_to_string(const XMLNamespaceMap& nspaces, const string& indent, int pretty) const
-{
-    if (m_type != ELEMENT) {
-        return "";
-    }
-    string result = "<";
-    result += nspaces.GetPrefix(m_ns);
-    result += m_name;
-
-    vector<XMLAttribute> attrs = m_attrs;
-
-    sort(attrs.begin(), attrs.end());
-
-    const size_t N = attrs.size();
-    for (size_t i=0; i<N; i++) {
-        const XMLAttribute& attr = attrs[i];
-        if (i == 0 || m_pretty == EXACT || pretty == EXACT) {
-            result += ' ';
-        }
-        else {
-            result += "\n";
-            result += indent;
-            result += MORE_INDENT;
-            result += MORE_INDENT;
-        }
-        result += nspaces.GetPrefix(attr.ns);
-        result += attr.name;
-        result += "=\"";
-        result += xml_attr_escape(attr.value);
-        result += '\"';
-    }
-
-    if (m_children.size() > 0) {
-        result += '>';
-    } else {
-        result += " />";
-    }
-    return result;
-}
-
-string
-XMLNode::to_string(const XMLNamespaceMap& nspaces, const string& indent) const
-{
-    switch (m_type)
-    {
-        case TEXT: {
-            if (m_pretty == EXACT) {
-                return xml_text_escape(m_text);
-            } else {
-                return xml_text_escape(trim_string(m_text));
-            }
-        }
-        case ELEMENT: {
-            string result = open_tag_to_string(nspaces, indent, PRETTY);
-            
-            if (m_children.size() > 0) {
-                result += contents_to_string(nspaces, indent + MORE_INDENT);
-
-                if (m_pretty == PRETTY && m_children.size() > 0) {
-                    result += '\n';
-                    result += indent;
-                }
-
-                result += "</";
-                result += nspaces.GetPrefix(m_ns);
-                result += m_name;
-                result += '>';
-            }
-            return result;
-        }
-        default:
-            return "";
-    }
-}
-
-string
-XMLNode::CollapseTextContents() const
-{
-    if (m_type == TEXT) {
-        return m_text;
-    }
-    else if (m_type == ELEMENT) {
-        string result;
-
-        const size_t N=m_children.size();
-        for (size_t i=0; i<N; i++) {
-            result += m_children[i]->CollapseTextContents();
-        }
-
-        return result;
-    }
-    else {
-        return "";
-    }
-}
-
-vector<XMLNode*>
-XMLNode::GetElementsByName(const string& ns, const string& name) const
-{
-    vector<XMLNode*> result;
-    const size_t N=m_children.size();
-    for (size_t i=0; i<N; i++) {
-        XMLNode* child = m_children[i];
-        if (child->m_type == ELEMENT && child->m_ns == ns && child->m_name == name) {
-            result.push_back(child);
-        }
-    }
-    return result;
-}
-
-XMLNode*
-XMLNode::GetElementByNameAt(const string& ns, const string& name, size_t index) const
-{
-    vector<XMLNode*> result;
-    const size_t N=m_children.size();
-    for (size_t i=0; i<N; i++) {
-        XMLNode* child = m_children[i];
-        if (child->m_type == ELEMENT && child->m_ns == ns && child->m_name == name) {
-            if (index == 0) {
-                return child;
-            } else {
-                index--;
-            }
-        }
-    }
-    return NULL;
-}
-
-size_t
-XMLNode::CountElementsByName(const string& ns, const string& name) const
-{
-    size_t result = 0;
-    const size_t N=m_children.size();
-    for (size_t i=0; i<N; i++) {
-        XMLNode* child = m_children[i];
-        if (child->m_type == ELEMENT && child->m_ns == ns && child->m_name == name) {
-            result++;
-        }
-    }
-    return result;
-}
-
-string
-XMLNode::GetAttribute(const string& ns, const string& name, const string& def) const
-{
-    return XMLAttribute::Find(m_attrs, ns, name, def);
-}
-
-static void
-parse_namespace(const char* data, string* ns, string* name)
-{
-    const char* p = strchr(data, NS_SEPARATOR);
-    if (p != NULL) {
-        ns->assign(data, p-data);
-        name->assign(p+1);
-    } else {
-        ns->assign("");
-        name->assign(data);
-    }
-}
-
-static void
-convert_attrs(const char** in, vector<XMLAttribute>* out)
-{
-    while (*in) {
-        XMLAttribute attr;
-        parse_namespace(in[0], &attr.ns, &attr.name);
-        attr.value = in[1];
-        out->push_back(attr);
-        in += 2;
-    }
-}
-
-static bool
-list_contains(const vector<XMLHandler*>& stack, XMLHandler* handler)
-{
-    const size_t N = stack.size();
-    for (size_t i=0; i<N; i++) {
-        if (stack[i] == handler) {
-            return true;
-        }
-    }
-    return false;
-}
-
-static void XMLCALL
-start_element_handler(void *userData, const char *name, const char **attrs)
-{
-    xml_handler_data* data = (xml_handler_data*)userData;
-
-    XMLHandler* handler = data->stack[data->stack.size()-1];
-
-    SourcePos pos(data->filename, (int)XML_GetCurrentLineNumber(data->parser));
-    string nsString;
-    string nameString;
-    XMLHandler* next = handler;
-    vector<XMLAttribute> attributes;
-
-    parse_namespace(name, &nsString, &nameString);
-    convert_attrs(attrs, &attributes);
-
-    handler->OnStartElement(pos, nsString, nameString, attributes, &next);
-
-    if (next == NULL) {
-        next = handler;
-    }
-
-    if (next != handler) {
-        next->elementPos = pos;
-        next->elementNamespace = nsString;
-        next->elementName = nameString;
-        next->elementAttributes = attributes;
-    }
-
-    data->stack.push_back(next);
-}
-
-static void XMLCALL
-end_element_handler(void *userData, const char *name)
-{
-    xml_handler_data* data = (xml_handler_data*)userData;
-
-    XMLHandler* handler = data->stack[data->stack.size()-1];
-    data->stack.pop_back();
-
-    SourcePos pos(data->filename, (int)XML_GetCurrentLineNumber(data->parser));
-
-    if (!list_contains(data->stack, handler)) {
-        handler->OnDone(pos);
-        if (data->stack.size() > 1) {
-            // not top one
-            delete handler;
-        }
-    }
-
-    handler = data->stack[data->stack.size()-1];
-
-    string nsString;
-    string nameString;
-
-    parse_namespace(name, &nsString, &nameString);
-
-    handler->OnEndElement(pos, nsString, nameString);
-}
-
-static void XMLCALL
-text_handler(void *userData, const XML_Char *s, int len)
-{
-    xml_handler_data* data = (xml_handler_data*)userData;
-    XMLHandler* handler = data->stack[data->stack.size()-1];
-    SourcePos pos(data->filename, (int)XML_GetCurrentLineNumber(data->parser));
-    handler->OnText(pos, string(s, len));
-}
-
-static void XMLCALL
-comment_handler(void *userData, const char *comment)
-{
-    xml_handler_data* data = (xml_handler_data*)userData;
-    XMLHandler* handler = data->stack[data->stack.size()-1];
-    SourcePos pos(data->filename, (int)XML_GetCurrentLineNumber(data->parser));
-    handler->OnComment(pos, string(comment));
-}
-
-bool
-XMLHandler::ParseFile(const string& filename, XMLHandler* handler)
-{
-    char buf[16384];
-    int fd = open(filename.c_str(), O_RDONLY);
-    if (fd < 0) {
-        SourcePos(filename, -1).Error("Unable to open file for read: %s", strerror(errno));
-        return false;
-    }
-
-    XML_Parser parser = XML_ParserCreateNS(NULL, NS_SEPARATOR);
-    xml_handler_data state;
-    state.stack.push_back(handler);
-    state.parser = parser;
-    state.filename = filename;
-
-    XML_SetUserData(parser, &state);
-    XML_SetElementHandler(parser, start_element_handler, end_element_handler);
-    XML_SetCharacterDataHandler(parser, text_handler);
-    XML_SetCommentHandler(parser, comment_handler);
-
-    ssize_t len;
-    bool done;
-    do {
-        len = read(fd, buf, sizeof(buf));
-        done = len < (ssize_t)sizeof(buf);
-        if (len < 0) {
-            SourcePos(filename, -1).Error("Error reading file: %s\n", strerror(errno));
-            close(fd);
-            return false;
-        }
-        if (XML_Parse(parser, buf, len, done) == XML_STATUS_ERROR) {
-            SourcePos(filename, (int)XML_GetCurrentLineNumber(parser)).Error(
-                    "Error parsing XML: %s\n", XML_ErrorString(XML_GetErrorCode(parser)));
-            close(fd);
-            return false;
-        }
-    } while (!done);
-
-    XML_ParserFree(parser);
-
-    close(fd);
-    
-    return true;
-}
-
-bool
-XMLHandler::ParseString(const string& filename, const string& text, XMLHandler* handler)
-{
-    XML_Parser parser = XML_ParserCreateNS(NULL, NS_SEPARATOR);
-    xml_handler_data state;
-    state.stack.push_back(handler);
-    state.parser = parser;
-    state.filename = filename;
-
-    XML_SetUserData(parser, &state);
-    XML_SetElementHandler(parser, start_element_handler, end_element_handler);
-    XML_SetCharacterDataHandler(parser, text_handler);
-    XML_SetCommentHandler(parser, comment_handler);
-
-    if (XML_Parse(parser, text.c_str(), text.size(), true) == XML_STATUS_ERROR) {
-        SourcePos(filename, (int)XML_GetCurrentLineNumber(parser)).Error(
-                "Error parsing XML: %s\n", XML_ErrorString(XML_GetErrorCode(parser)));
-        return false;
-    }
-
-    XML_ParserFree(parser);
-    
-    return true;
-}
-
-XMLHandler::XMLHandler()
-{
-}
-
-XMLHandler::~XMLHandler()
-{
-}
-
-int
-XMLHandler::OnStartElement(const SourcePos& pos, const string& ns, const string& name,
-                            const vector<XMLAttribute>& attrs, XMLHandler** next)
-{
-    return 0;
-}
-
-int
-XMLHandler::OnEndElement(const SourcePos& pos, const string& ns, const string& name)
-{
-    return 0;
-}
-
-int
-XMLHandler::OnText(const SourcePos& pos, const string& text)
-{
-    return 0;
-}
-
-int
-XMLHandler::OnComment(const SourcePos& pos, const string& text)
-{
-    return 0;
-}
-
-int
-XMLHandler::OnDone(const SourcePos& pos)
-{
-    return 0;
-}
-
-TopElementHandler::TopElementHandler(const string& ns, const string& name, XMLHandler* next)
-    :m_ns(ns),
-     m_name(name),
-     m_next(next)
-{
-}
-
-int
-TopElementHandler::OnStartElement(const SourcePos& pos, const string& ns, const string& name,
-                            const vector<XMLAttribute>& attrs, XMLHandler** next)
-{
-    *next = m_next;
-    return 0;
-}
-
-int
-TopElementHandler::OnEndElement(const SourcePos& pos, const string& ns, const string& name)
-{
-    return 0;
-}
-
-int
-TopElementHandler::OnText(const SourcePos& pos, const string& text)
-{
-    return 0;
-}
-
-int
-TopElementHandler::OnDone(const SourcePos& pos)
-{
-    return 0;
-}
-
-
-NodeHandler::NodeHandler(XMLNode* root, int pretty)
-    :m_root(root),
-     m_pretty(pretty)
-{
-    if (root != NULL) {
-        m_nodes.push_back(root);
-    }
-}
-
-NodeHandler::~NodeHandler()
-{
-}
-
-int
-NodeHandler::OnStartElement(const SourcePos& pos, const string& ns, const string& name,
-                            const vector<XMLAttribute>& attrs, XMLHandler** next)
-{
-    int pretty;
-    if (XMLAttribute::Find(attrs, XMLNS_XMLNS, "space", "") == "preserve") {
-        pretty = XMLNode::EXACT;
-    } else {
-        if (m_root == NULL) {
-            pretty = m_pretty;
-        } else {
-            pretty = m_nodes[m_nodes.size()-1]->Pretty();
-        }
-    }
-    XMLNode* n = XMLNode::NewElement(pos, ns, name, attrs, pretty);
-    if (m_root == NULL) {
-        m_root = n;
-    } else {
-        m_nodes[m_nodes.size()-1]->EditChildren().push_back(n);
-    }
-    m_nodes.push_back(n);
-    return 0;
-}
-
-int
-NodeHandler::OnEndElement(const SourcePos& pos, const string& ns, const string& name)
-{
-    m_nodes.pop_back();
-    return 0;
-}
-
-int
-NodeHandler::OnText(const SourcePos& pos, const string& text)
-{
-    if (m_root == NULL) {
-        return 1;
-    }
-    XMLNode* n = XMLNode::NewText(pos, text, m_nodes[m_nodes.size()-1]->Pretty());
-    m_nodes[m_nodes.size()-1]->EditChildren().push_back(n);
-    return 0;
-}
-
-int
-NodeHandler::OnComment(const SourcePos& pos, const string& text)
-{
-    return 0;
-}
-
-int
-NodeHandler::OnDone(const SourcePos& pos)
-{
-    return 0;
-}
-
-XMLNode*
-NodeHandler::ParseFile(const string& filename, int pretty)
-{
-    NodeHandler handler(NULL, pretty);
-    if (!XMLHandler::ParseFile(filename, &handler)) {
-        fprintf(stderr, "error parsing file: %s\n", filename.c_str());
-        return NULL;
-    }
-    return handler.Root();
-}
-
-XMLNode*
-NodeHandler::ParseString(const string& filename, const string& text, int pretty)
-{
-    NodeHandler handler(NULL, pretty);
-    if (!XMLHandler::ParseString(filename, text, &handler)) {
-        fprintf(stderr, "error parsing file: %s\n", filename.c_str());
-        return NULL;
-    }
-    return handler.Root();
-}
-
-
diff --git a/tools/localize/XMLHandler.h b/tools/localize/XMLHandler.h
deleted file mode 100644
index 324385f..0000000
--- a/tools/localize/XMLHandler.h
+++ /dev/null
@@ -1,198 +0,0 @@
-#ifndef XML_H
-#define XML_H
-
-#include "SourcePos.h"
-
-#include <algorithm>
-#include <string>
-#include <vector>
-#include <map>
-
-#define XMLNS_XMLNS "http://www.w3.org/XML/1998/namespace"
-
-using namespace std;
-
-string trim_string(const string& str);
-
-struct XMLAttribute
-{
-    string ns;
-    string name;
-    string value;
-
-    XMLAttribute();
-    XMLAttribute(const XMLAttribute& that);
-    XMLAttribute(string ns, string name, string value);
-    ~XMLAttribute();
-
-    int Compare(const XMLAttribute& that) const;
-
-    inline bool operator<(const XMLAttribute& that) const { return Compare(that) < 0; }
-    inline bool operator<=(const XMLAttribute& that) const { return Compare(that) <= 0; }
-    inline bool operator==(const XMLAttribute& that) const { return Compare(that) == 0; }
-    inline bool operator!=(const XMLAttribute& that) const { return Compare(that) != 0; }
-    inline bool operator>=(const XMLAttribute& that) const { return Compare(that) >= 0; }
-    inline bool operator>(const XMLAttribute& that) const { return Compare(that) > 0; }
-
-    static string Find(const vector<XMLAttribute>& list,
-                                const string& ns, const string& name, const string& def);
-};
-
-class XMLNamespaceMap
-{
-public:
-    XMLNamespaceMap();
-    XMLNamespaceMap(char const*const* nspaces);
-    string Get(const string& ns) const;
-    string GetPrefix(const string& ns) const;
-    void AddToAttributes(vector<XMLAttribute>* attrs) const;
-private:
-    map<string,string> m_map;
-};
-
-struct XMLNode
-{
-public:
-    enum {
-        EXACT = 0,
-        PRETTY = 1
-    };
-
-    enum {
-        ELEMENT = 0,
-        TEXT = 1
-    };
-
-    static XMLNode* NewElement(const SourcePos& pos, const string& ns, const string& name,
-                        const vector<XMLAttribute>& attrs, int pretty);
-    static XMLNode* NewText(const SourcePos& pos, const string& text, int pretty);
-
-    ~XMLNode();
-
-    // a deep copy
-    XMLNode* Clone() const;
-
-    inline int Type() const                                     { return m_type; }
-    inline int Pretty() const                                   { return m_pretty; }
-    void SetPrettyRecursive(int value);
-    string ContentsToString(const XMLNamespaceMap& nspaces) const;
-    string ToString(const XMLNamespaceMap& nspaces) const;
-    string OpenTagToString(const XMLNamespaceMap& nspaces, int pretty) const;
-
-    string CollapseTextContents() const;
-
-    inline const SourcePos& Position() const                    { return m_pos; }
-
-    // element
-    inline string Namespace() const                             { return m_ns; }
-    inline string Name() const                                  { return m_name; }
-    inline void SetName(const string& ns, const string& n)      { m_ns = ns; m_name = n; }
-    inline const vector<XMLAttribute>& Attributes() const       { return m_attrs; }
-    inline vector<XMLAttribute>& EditAttributes()               { return m_attrs; }
-    inline const vector<XMLNode*>& Children() const             { return m_children; }
-    inline vector<XMLNode*>& EditChildren()                     { return m_children; }
-    vector<XMLNode*> GetElementsByName(const string& ns, const string& name) const;
-    XMLNode* GetElementByNameAt(const string& ns, const string& name, size_t index) const;
-    size_t CountElementsByName(const string& ns, const string& name) const;
-    string GetAttribute(const string& ns, const string& name, const string& def) const;
-
-    // text
-    inline string Text() const                                  { return m_text; }
-
-private:
-    XMLNode();
-    XMLNode(const XMLNode&);
-
-    string contents_to_string(const XMLNamespaceMap& nspaces, const string& indent) const;
-    string to_string(const XMLNamespaceMap& nspaces, const string& indent) const;
-    string open_tag_to_string(const XMLNamespaceMap& nspaces, const string& indent,
-            int pretty) const;
-
-    int m_type;
-    int m_pretty;
-    SourcePos m_pos;
-
-    // element
-    string m_ns;
-    string m_name;
-    vector<XMLAttribute> m_attrs;
-    vector<XMLNode*> m_children;
-
-    // text
-    string m_text;
-};
-
-class XMLHandler
-{
-public:
-    // information about the element that started us
-    SourcePos elementPos;
-    string elementNamespace;
-    string elementName;
-    vector<XMLAttribute> elementAttributes;
-
-    XMLHandler();
-    virtual ~XMLHandler();
-
-    XMLHandler* parent;
-
-    virtual int OnStartElement(const SourcePos& pos, const string& ns, const string& name,
-                                const vector<XMLAttribute>& attrs, XMLHandler** next);
-    virtual int OnEndElement(const SourcePos& pos, const string& ns, const string& name);
-    virtual int OnText(const SourcePos& pos, const string& text);
-    virtual int OnComment(const SourcePos& pos, const string& text);
-    virtual int OnDone(const SourcePos& pos);
-
-    static bool ParseFile(const string& filename, XMLHandler* handler);
-    static bool ParseString(const string& filename, const string& text, XMLHandler* handler);
-};
-
-class TopElementHandler : public XMLHandler
-{
-public:
-    TopElementHandler(const string& ns, const string& name, XMLHandler* next);
-
-    virtual int OnStartElement(const SourcePos& pos, const string& ns, const string& name,
-                                const vector<XMLAttribute>& attrs, XMLHandler** next);
-    virtual int OnEndElement(const SourcePos& pos, const string& ns, const string& name);
-    virtual int OnText(const SourcePos& pos, const string& text);
-    virtual int OnDone(const SourcePos& endPos);
-
-private:
-    string m_ns;
-    string m_name;
-    XMLHandler* m_next;
-};
-
-class NodeHandler : public XMLHandler
-{
-public:
-    // after it's done, you own everything created and added to root
-    NodeHandler(XMLNode* root, int pretty);
-    ~NodeHandler();
-
-    virtual int OnStartElement(const SourcePos& pos, const string& ns, const string& name,
-                                const vector<XMLAttribute>& attrs, XMLHandler** next);
-    virtual int OnEndElement(const SourcePos& pos, const string& ns, const string& name);
-    virtual int OnText(const SourcePos& pos, const string& text);
-    virtual int OnComment(const SourcePos& pos, const string& text);
-    virtual int OnDone(const SourcePos& endPos);
-
-    inline XMLNode* Root() const                { return m_root; }
-
-    static XMLNode* ParseFile(const string& filename, int pretty);
-    static XMLNode* ParseString(const string& filename, const string& text, int pretty);
-
-private:
-    XMLNode* m_root;
-    int m_pretty;
-    vector<XMLNode*> m_nodes;
-};
-
-template <class T>
-static void delete_object(T* obj)
-{
-    delete obj;
-}
-
-#endif // XML_H
diff --git a/tools/localize/XMLHandler_test.cpp b/tools/localize/XMLHandler_test.cpp
deleted file mode 100644
index 1c81c0c..0000000
--- a/tools/localize/XMLHandler_test.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-#include "XMLHandler.h"
-#include <stdio.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-const char *const NS_MAP[] = {
-    "xml", XMLNS_XMLNS,
-    NULL, NULL
-};
-
-const XMLNamespaceMap NO_NAMESPACES(NS_MAP);
-
-char const*const EXPECTED_EXACT = 
-       "<ASDF>\n"
-        "    <a id=\"system\" old-cl=\"1\" new-cl=\"43019\">\n"
-        "        <app dir=\"apps/common\" />\n"
-        "    </a>\n"
-        "    <a id=\"samples\" old-cl=\"1\" new-cl=\"43019\">asdf\n"
-        "        <app dir=\"samples/NotePad\" />\n"
-        "        <app dir=\"samples/LunarLander\" />\n"
-        "        <something>a<b>,</b>b </something>\n"
-        "        <exact xml:space=\"preserve\">a<b>,</b>b </exact>\n"
-        "    </a>\n"
-        "</ASDF>\n";
-
-char const*const EXPECTED_PRETTY =
-        "<ASDF>\n"
-        "  <a id=\"system\"\n"
-        "      old-cl=\"1\"\n"
-        "      new-cl=\"43019\">\n"
-        "    <app dir=\"apps/common\" />\n"
-        "  </a>\n"
-        "  <a id=\"samples\"\n"
-        "      old-cl=\"1\"\n"
-        "      new-cl=\"43019\">asdf\n"
-        "    <app dir=\"samples/NotePad\" />\n"
-        "    <app dir=\"samples/LunarLander\" />\n"
-        "    <something>a\n"
-        "      <b>,\n"
-        "      </b>b \n"
-        "    </something>\n"
-        "    <exact xml:space=\"preserve\">a<b>,</b>b </exact>\n"
-        "  </a>\n"
-        "</ASDF>\n";
-
-static string
-read_file(const string& filename)
-{
-    char buf[1024];
-    int fd = open(filename.c_str(), O_RDONLY);
-    if (fd < 0) {
-        return "";
-    }
-    string result;
-    while (true) {
-        ssize_t len = read(fd, buf, sizeof(buf)-1);
-        buf[len] = '\0';
-        if (len <= 0) {
-            break;
-        }
-        result.append(buf, len);
-    }
-    close(fd);
-    return result;
-}
-
-static int
-ParseFile_EXACT_test()
-{
-    XMLNode* root = NodeHandler::ParseFile("testdata/xml.xml", XMLNode::EXACT);
-    if (root == NULL) {
-        return 1;
-    }
-    string result = root->ToString(NO_NAMESPACES);
-    delete root;
-    //printf("[[%s]]\n", result.c_str());
-    return result == EXPECTED_EXACT;
-}
-
-static int
-ParseFile_PRETTY_test()
-{
-    XMLNode* root = NodeHandler::ParseFile("testdata/xml.xml", XMLNode::PRETTY);
-    if (root == NULL) {
-        return 1;
-    }
-    string result = root->ToString(NO_NAMESPACES);
-    delete root;
-    //printf("[[%s]]\n", result.c_str());
-    return result == EXPECTED_PRETTY;
-}
-
-static int
-ParseString_EXACT_test()
-{
-    string text = read_file("testdata/xml.xml");
-    XMLNode* root = NodeHandler::ParseString("testdata/xml.xml", text, XMLNode::EXACT);
-    if (root == NULL) {
-        return 1;
-    }
-    string result = root->ToString(NO_NAMESPACES);
-    delete root;
-    //printf("[[%s]]\n", result.c_str());
-    return result == EXPECTED_EXACT;
-}
-
-static int
-ParseString_PRETTY_test()
-{
-    string text = read_file("testdata/xml.xml");
-    XMLNode* root = NodeHandler::ParseString("testdata/xml.xml", text, XMLNode::PRETTY);
-    if (root == NULL) {
-        return 1;
-    }
-    string result = root->ToString(NO_NAMESPACES);
-    delete root;
-    //printf("[[%s]]\n", result.c_str());
-    return result == EXPECTED_PRETTY;
-}
-
-int
-XMLHandler_test()
-{
-    int err = 0;
-    bool all = true;
-
-    if (all) err |= ParseFile_EXACT_test();
-    if (all) err |= ParseFile_PRETTY_test();
-    if (all) err |= ParseString_EXACT_test();
-    if (all) err |= ParseString_PRETTY_test();
-
-    return err;
-}
diff --git a/tools/localize/XMLNode.h b/tools/localize/XMLNode.h
deleted file mode 100644
index bfb9f55..0000000
--- a/tools/localize/XMLNode.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef XMLNODE_H
-#define XMLNODE_H
-
-#include <string>
-
-using namespace std;
-
-struct XMLAttribute
-{
-    string ns;
-    string name;
-    string value;
-
-    static string Find(const vector<XMLAttribute>& list,
-                                const string& ns, const string& name, const string& def);
-};
-
-
-#endif // XMLNODE_H
diff --git a/tools/localize/file_utils.cpp b/tools/localize/file_utils.cpp
deleted file mode 100644
index 775ce2f..0000000
--- a/tools/localize/file_utils.cpp
+++ /dev/null
@@ -1,181 +0,0 @@
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include "file_utils.h"
-#include "Perforce.h"
-#include <utils/String8.h>
-#include <sys/fcntl.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <cstdio>
-#include "log.h"
-
-using namespace android;
-using namespace std;
-
-static string
-parent_dir(const string& path)
-{
-    return string(String8(path.c_str()).getPathDir().string());
-}
-
-static int
-mkdirs(const char* last)
-{
-    String8 dest;
-    const char* s = last-1;
-    int err;
-    do {
-        s++;
-        if (s > last && (*s == '.' || *s == 0)) {
-            String8 part(last, s-last);
-            dest.appendPath(part);
-#ifdef HAVE_MS_C_RUNTIME
-            err = _mkdir(dest.string());
-#else                    
-            err = mkdir(dest.string(), S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP);
-#endif                    
-            if (err != 0) {
-                return err;
-            }
-            last = s+1;
-        }
-    } while (*s);
-    return 0;
-}
-
-string
-translated_file_name(const string& file, const string& locale)
-{
-    const char* str = file.c_str();
-    const char* p = str + file.length();
-    const char* rest = NULL;
-    const char* values = p;
-
-    while (p > str) {
-        p--;
-        if (*p == '/') {
-            rest = values;
-            values = p;
-            if (0 == strncmp("values", values+1, rest-values-1)) {
-                break;
-            }
-        }
-    }
-    values++;
-
-    string result(str, values-str);
-    result.append(values, rest-values);
-
-    string language, region;
-    if (locale == "") {
-        language = "";
-        region = "";
-    }
-    else if (!split_locale(locale, &language, &region)) {
-        return "";
-    }
-
-    if (language != "") {
-        result += '-';
-        result += language;
-    }
-    if (region != "") {
-        result += "-r";
-        result += region;
-    }
-
-    result += rest;
-
-    return result;
-}
-
-ValuesFile*
-get_values_file(const string& filename, const Configuration& configuration,
-                int version, const string& versionString, bool printOnFailure)
-{
-    int err;
-    string text;
-
-    log_printf("get_values_file filename=%s\n", filename.c_str());
-    err = Perforce::GetFile(filename, versionString, &text, printOnFailure);
-    if (err != 0 || text == "") {
-        return NULL;
-    }
-
-    ValuesFile* result = ValuesFile::ParseString(filename, text, configuration, version,
-                                                    versionString);
-    if (result == NULL) {
-        fprintf(stderr, "unable to parse file: %s\n", filename.c_str());
-        exit(1);
-    }
-    return result;
-}
-
-ValuesFile*
-get_local_values_file(const string& filename, const Configuration& configuration,
-                int version, const string& versionString, bool printOnFailure)
-{
-    int err;
-    string text;
-    char buf[2049];
-    int fd;
-    ssize_t amt;
-    
-    fd = open(filename.c_str(), O_RDONLY);
-    if (fd == -1) {
-        fprintf(stderr, "unable to open file: %s\n", filename.c_str());
-        return NULL;
-    }
-
-    while ((amt = read(fd, buf, sizeof(buf)-1)) > 0) {
-        text.append(buf, amt);
-    }
-
-    close(fd);
-    
-    if (text == "") {
-        return NULL;
-    }
-        
-    ValuesFile* result = ValuesFile::ParseString(filename, text, configuration, version,
-                                                    versionString);
-    if (result == NULL) {
-        fprintf(stderr, "unable to parse file: %s\n", filename.c_str());
-        exit(1);
-    }
-    return result;
-}
-
-void
-print_file_status(size_t j, size_t J, const string& message)
-{
-    printf("\r%s file %zd of %zd...", message.c_str(), j, J);
-    fflush(stdout);
-}
-
-int
-write_to_file(const string& filename, const string& text)
-{
-    mkdirs(parent_dir(filename).c_str());
-    int fd = open(filename.c_str(), O_RDWR | O_CREAT | O_TRUNC, 0666);
-    if (fd < 0) {
-        fprintf(stderr, "unable to open file for write (%s): %s\n", strerror(errno),
-                filename.c_str());
-        return -1;
-    }
-
-    ssize_t amt = write(fd, text.c_str(), text.length());
-
-    close(fd);
-
-    if (amt < 0) {
-        return amt;
-    }
-    return amt == (ssize_t)text.length() ? 0 : -1;
-}
-
-
diff --git a/tools/localize/file_utils.h b/tools/localize/file_utils.h
deleted file mode 100644
index 7706587..0000000
--- a/tools/localize/file_utils.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef FILE_UTILS_H
-#define FILE_UTILS_H
-
-#include "ValuesFile.h"
-#include "Configuration.h"
-#include <string>
-#include <cstdio>
-
-using namespace std;
-
-string translated_file_name(const string& file, const string& locale);
-
-ValuesFile* get_values_file(const string& filename, const Configuration& configuration,
-                int version, const string& versionString, bool printOnFailure);
-ValuesFile* get_local_values_file(const string& filename, const Configuration& configuration,
-                int version, const string& versionString, bool printOnFailure);
-
-void print_file_status(size_t j, size_t J, const string& message = "Reading");
-int write_to_file(const string& filename, const string& text);
-
-
-#endif // FILE_UTILS_H
diff --git a/tools/localize/localize.cpp b/tools/localize/localize.cpp
deleted file mode 100644
index 68c03b6..0000000
--- a/tools/localize/localize.cpp
+++ /dev/null
@@ -1,768 +0,0 @@
-#include "SourcePos.h"
-#include "ValuesFile.h"
-#include "XLIFFFile.h"
-#include "Perforce.h"
-#include "merge_res_and_xliff.h"
-#include "localize.h"
-#include "file_utils.h"
-#include "res_check.h"
-#include "xmb.h"
-
-#include <host/pseudolocalize.h>
-
-#include <stdlib.h>
-#include <stdarg.h>
-#include <sstream>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-using namespace std;
-
-FILE* g_logFile = NULL;
-
-int test();
-
-int
-read_settings(const string& filename, map<string,Settings>* result, const string& rootDir)
-{
-    XMLNode* root = NodeHandler::ParseFile(filename, XMLNode::PRETTY);
-    if (root == NULL) {
-        SourcePos(filename, -1).Error("Error reading file.");
-        return 1;
-    }
-
-    // <configuration>
-    vector<XMLNode*> configNodes = root->GetElementsByName("", "configuration");
-    const size_t I = configNodes.size();
-    for (size_t i=0; i<I; i++) {
-        const XMLNode* configNode = configNodes[i];
-
-        Settings settings;
-        settings.id = configNode->GetAttribute("", "id", "");
-        if (settings.id == "") {
-            configNode->Position().Error("<configuration> needs an id attribute.");
-            delete root;
-            return 1;
-        }
-
-        settings.oldVersion = configNode->GetAttribute("", "old-cl", "");
-
-        settings.currentVersion = configNode->GetAttribute("", "new-cl", "");
-        if (settings.currentVersion == "") {
-            configNode->Position().Error("<configuration> needs a new-cl attribute.");
-            delete root;
-            return 1;
-        }
-
-        // <app>
-        vector<XMLNode*> appNodes = configNode->GetElementsByName("", "app");
-
-        const size_t J = appNodes.size();
-        for (size_t j=0; j<J; j++) {
-            const XMLNode* appNode = appNodes[j];
-
-            string dir = appNode->GetAttribute("", "dir", "");
-            if (dir == "") {
-                appNode->Position().Error("<app> needs a dir attribute.");
-                delete root;
-                return 1;
-            }
-
-            settings.apps.push_back(dir);
-        }
-
-        // <reject>
-        vector<XMLNode*> rejectNodes = configNode->GetElementsByName("", "reject");
-
-        const size_t K = rejectNodes.size();
-        for (size_t k=0; k<K; k++) {
-            const XMLNode* rejectNode = rejectNodes[k];
-
-            Reject reject;
-
-            reject.file = rejectNode->GetAttribute("", "file", "");
-            if (reject.file == "") {
-                rejectNode->Position().Error("<reject> needs a file attribute.");
-                delete root;
-                return 1;
-            }
-            string f =  reject.file;
-            reject.file = rootDir;
-            reject.file += '/';
-            reject.file += f;
-            
-            reject.name = rejectNode->GetAttribute("", "name", "");
-            if (reject.name == "") {
-                rejectNode->Position().Error("<reject> needs a name attribute.");
-                delete root;
-                return 1;
-            }
-
-            reject.comment = trim_string(rejectNode->CollapseTextContents());
-
-            settings.reject.push_back(reject);
-        }
-
-        (*result)[settings.id] = settings;
-    }
-
-    delete root;
-    return 0;
-}
-
-
-static void
-ValuesFile_to_XLIFFFile(const ValuesFile* values, XLIFFFile* xliff, const string& englishFilename)
-{
-    const set<StringResource>& strings = values->GetStrings();
-    for (set<StringResource>::const_iterator it=strings.begin(); it!=strings.end(); it++) {
-        StringResource res = *it;
-        res.file = englishFilename;
-        xliff->AddStringResource(res);
-    }
-}
-
-static bool
-contains_reject(const Settings& settings, const string& file, const TransUnit& tu)
-{
-    const string name = tu.id;
-    const vector<Reject>& reject = settings.reject;
-    const size_t I = reject.size();
-    for (size_t i=0; i<I; i++) {
-        const Reject& r = reject[i];
-        if (r.file == file && r.name == name) {
-            return true;
-        }
-    }
-    return false;
-}
-
-/**
- * If it's been rejected, then we keep whatever info we have.
- *
- * Implements this truth table:
- *
- *    S   AT   AS     Keep
- *   -----------------------
- *    0    0    0      0    (this case can't happen)
- *    0    0    1      0    (it was there, never translated, and removed)
- *    0    1    0      0    (somehow it got translated, but it was removed)
- *    0    1    1      0    (it was removed after having been translated)
- *
- *    1    0    0      1    (it was just added)
- *    1    0    1      1    (it was added, has been changed, but it never got translated)
- *    1    1    0      1    (somehow it got translated, but we don't know based on what)
- *    1    1    1     0/1   (it's in both.  0 if S=AS b/c there's no need to retranslate if they're
- *                           the same.  1 if S!=AS because S changed, so it should be retranslated)
- *
- * The first four are cases where, whatever happened in the past, the string isn't there
- * now, so it shouldn't be in the XLIFF file.
- *
- * For cases 4 and 5, the string has never been translated, so get it translated.
- *
- * For case 6, it's unclear where the translated version came from, so we're conservative
- * and send it back for them to have another shot at.
- *
- * For case 7, we have some data.  We have two choices.  We could rely on the translator's
- * translation memory or tools to notice that the strings haven't changed, and populate the
- * <target> field themselves.  Or if the string hasn't changed since last time, we can just
- * not even tell them about it.  As the project nears the end, it will be convenient to see
- * the xliff files reducing in size, so we pick the latter.  Obviously, if the string has
- * changed, then we need to get it retranslated.
- */
-bool
-keep_this_trans_unit(const string& file, const TransUnit& unit, void* cookie)
-{
-    const Settings* settings = reinterpret_cast<const Settings*>(cookie);
-
-    if (contains_reject(*settings, file, unit)) {
-        return true;
-    }
-
-    if (unit.source.id == "") {
-        return false;
-    }
-    if (unit.altTarget.id == "" || unit.altSource.id == "") {
-        return true;
-    }
-    return unit.source.value->ContentsToString(XLIFF_NAMESPACES)
-            != unit.altSource.value->ContentsToString(XLIFF_NAMESPACES);
-}
-
-int
-validate_config(const string& settingsFile, const map<string,Settings>& settings,
-        const string& config)
-{
-    if (settings.find(config) == settings.end()) {
-        SourcePos(settingsFile, -1).Error("settings file does not contain setting: %s\n",
-                config.c_str());
-        return 1;
-    }
-    return 0;
-}
-
-int
-validate_configs(const string& settingsFile, const map<string,Settings>& settings,
-        const vector<string>& configs)
-{
-    int err = 0;
-    for (size_t i=0; i<configs.size(); i++) {
-        string config = configs[i];
-        err |= validate_config(settingsFile, settings, config);
-    }
-    return err;
-}
-
-int
-select_files(vector<string> *resFiles, const string& config,
-        const map<string,Settings>& settings, const string& rootDir)
-{
-    int err;
-    vector<vector<string> > allResFiles;
-    vector<string> configs;
-    configs.push_back(config);
-    err = select_files(&allResFiles, configs, settings, rootDir);
-    if (err == 0) {
-        *resFiles = allResFiles[0];
-    }
-    return err;
-}
-
-int
-select_files(vector<vector<string> > *allResFiles, const vector<string>& configs,
-        const map<string,Settings>& settings, const string& rootDir)
-{
-    int err;
-    printf("Selecting files...");
-    fflush(stdout);
-
-    for (size_t i=0; i<configs.size(); i++) {
-        const string& config = configs[i];
-        const Settings& setting = settings.find(config)->second;
-
-        vector<string> resFiles;
-        err = Perforce::GetResourceFileNames(setting.currentVersion, rootDir,
-                                                setting.apps, &resFiles, true);
-        if (err != 0) {
-            fprintf(stderr, "error with perforce.  bailing\n");
-            return err;
-        }
-
-        allResFiles->push_back(resFiles);
-    }
-    return 0;
-}
-
-static int
-do_export(const string& settingsFile, const string& rootDir, const string& outDir,
-            const string& targetLocale, const vector<string>& configs)
-{
-    bool success = true;
-    int err;
-
-    if (false) {
-        printf("settingsFile=%s\n", settingsFile.c_str());
-        printf("rootDir=%s\n", rootDir.c_str());
-        printf("outDir=%s\n", outDir.c_str());
-        for (size_t i=0; i<configs.size(); i++) {
-            printf("config[%zd]=%s\n", i, configs[i].c_str());
-        }
-    }
-
-    map<string,Settings> settings;
-    err = read_settings(settingsFile, &settings, rootDir);
-    if (err != 0) {
-        return err;
-    }
-
-    err = validate_configs(settingsFile, settings, configs);
-    if (err != 0) {
-        return err;
-    }
-
-    vector<vector<string> > allResFiles;
-    err = select_files(&allResFiles, configs, settings, rootDir);
-    if (err != 0) {
-        return err;
-    }
-
-    size_t totalFileCount = 0;
-    for (size_t i=0; i<allResFiles.size(); i++) {
-        totalFileCount += allResFiles[i].size();
-    }
-    totalFileCount *= 3; // we try all 3 versions of the file
-
-    size_t fileProgress = 0;
-    vector<Stats> stats;
-    vector<pair<string,XLIFFFile*> > xliffs;
-
-    for (size_t i=0; i<configs.size(); i++) {
-        const string& config = configs[i];
-        const Settings& setting = settings[config];
-
-        if (false) {
-            fprintf(stderr, "Configuration: %s (%zd of %zd)\n", config.c_str(), i+1,
-                    configs.size());
-            fprintf(stderr, "  Old CL:     %s\n", setting.oldVersion.c_str());
-            fprintf(stderr, "  Current CL: %s\n", setting.currentVersion.c_str());
-        }
-
-        Configuration english;
-            english.locale = "en_US";
-        Configuration translated;
-            translated.locale = targetLocale;
-        XLIFFFile* xliff = XLIFFFile::Create(english, translated, setting.currentVersion);
-
-        const vector<string>& resFiles = allResFiles[i];
-        const size_t J = resFiles.size();
-        for (size_t j=0; j<J; j++) {
-            string resFile = resFiles[j];
-
-            // parse the files into a ValuesFile
-            // pull out the strings and add them to the XLIFFFile
-            
-            // current file
-            print_file_status(++fileProgress, totalFileCount);
-            ValuesFile* currentFile = get_values_file(resFile, english, CURRENT_VERSION,
-                                                        setting.currentVersion, true);
-            if (currentFile != NULL) {
-                ValuesFile_to_XLIFFFile(currentFile, xliff, resFile);
-                //printf("currentFile=[%s]\n", currentFile->ToString().c_str());
-            } else {
-                fprintf(stderr, "error reading file %s@%s\n", resFile.c_str(),
-                            setting.currentVersion.c_str());
-                success = false;
-            }
-
-            // old file
-            print_file_status(++fileProgress, totalFileCount);
-            ValuesFile* oldFile = get_values_file(resFile, english, OLD_VERSION,
-                                                        setting.oldVersion, false);
-            if (oldFile != NULL) {
-                ValuesFile_to_XLIFFFile(oldFile, xliff, resFile);
-                //printf("oldFile=[%s]\n", oldFile->ToString().c_str());
-            }
-
-            // translated version
-            // (get the head of the tree for the most recent translation, but it's considered
-            // the old one because the "current" one hasn't been made yet, and this goes into
-            // the <alt-trans> tag if necessary
-            print_file_status(++fileProgress, totalFileCount);
-            string transFilename = translated_file_name(resFile, targetLocale);
-            ValuesFile* transFile = get_values_file(transFilename, translated, OLD_VERSION,
-                                                        setting.currentVersion, false);
-            if (transFile != NULL) {
-                ValuesFile_to_XLIFFFile(transFile, xliff, resFile);
-            }
-
-            delete currentFile;
-            delete oldFile;
-            delete transFile;
-        }
-
-        Stats beforeFilterStats = xliff->GetStats(config);
-
-        // run through the XLIFFFile and strip out TransUnits that have identical
-        // old and current source values and are not in the reject list, or just
-        // old values and no source values
-        xliff->Filter(keep_this_trans_unit, (void*)&setting);
-
-        Stats afterFilterStats = xliff->GetStats(config);
-        afterFilterStats.totalStrings = beforeFilterStats.totalStrings;
-
-        // add the reject comments
-        for (vector<Reject>::const_iterator reject = setting.reject.begin();
-                reject != setting.reject.end(); reject++) {
-            TransUnit* tu = xliff->EditTransUnit(reject->file, reject->name);
-            tu->rejectComment = reject->comment;
-        }
-
-        // config-locale-current_cl.xliff
-        stringstream filename;
-        if (outDir != "") {
-            filename << outDir << '/';
-        }
-        filename << config << '-' << targetLocale << '-' << setting.currentVersion << ".xliff";
-        xliffs.push_back(pair<string,XLIFFFile*>(filename.str(), xliff));
-
-        stats.push_back(afterFilterStats);
-    }
-
-    // today is a good day to die
-    if (!success || SourcePos::HasErrors()) {
-        return 1;
-    }
-
-    // write the XLIFF files
-    printf("\nWriting %zd file%s...\n", xliffs.size(), xliffs.size() == 1 ? "" : "s");
-    for (vector<pair<string,XLIFFFile*> >::iterator it = xliffs.begin(); it != xliffs.end(); it++) {
-        const string& filename = it->first;
-        XLIFFFile* xliff = it->second;
-        string text = xliff->ToString();
-        write_to_file(filename, text);
-    }
-
-    // the stats
-    printf("\n"
-           "                                  to          without     total\n"
-           " config               files       translate   comments    strings\n"
-           "-----------------------------------------------------------------------\n");
-    Stats totals;
-        totals.config = "total";
-        totals.files = 0;
-        totals.toBeTranslated = 0;
-        totals.noComments = 0;
-        totals.totalStrings = 0;
-    for (vector<Stats>::iterator it=stats.begin(); it!=stats.end(); it++) {
-        string cfg = it->config;
-        if (cfg.length() > 20) {
-            cfg.resize(20);
-        }
-        printf(" %-20s  %-9zd   %-9zd   %-9zd   %-19zd\n", cfg.c_str(), it->files,
-                it->toBeTranslated, it->noComments, it->totalStrings);
-        totals.files += it->files;
-        totals.toBeTranslated += it->toBeTranslated;
-        totals.noComments += it->noComments;
-        totals.totalStrings += it->totalStrings;
-    }
-    if (stats.size() > 1) {
-        printf("-----------------------------------------------------------------------\n"
-               " %-20s  %-9zd   %-9zd   %-9zd   %-19zd\n", totals.config.c_str(), totals.files,
-                    totals.toBeTranslated, totals.noComments, totals.totalStrings);
-    }
-    printf("\n");
-    return 0;
-}
-
-struct PseudolocalizeSettings {
-    XLIFFFile* xliff;
-    bool expand;
-};
-
-
-string
-pseudolocalize_string(const string& source, const PseudolocalizeSettings* settings)
-{
-    return pseudolocalize_string(source);
-}
-
-static XMLNode*
-pseudolocalize_xml_node(const XMLNode* source, const PseudolocalizeSettings* settings)
-{
-    if (source->Type() == XMLNode::TEXT) {
-        return XMLNode::NewText(source->Position(), pseudolocalize_string(source->Text(), settings),
-                                source->Pretty());
-    } else {
-        XMLNode* target;
-        if (source->Namespace() == XLIFF_XMLNS && source->Name() == "g") {
-            // XXX don't translate these
-            target = XMLNode::NewElement(source->Position(), source->Namespace(),
-                                    source->Name(), source->Attributes(), source->Pretty());
-        } else {
-            target = XMLNode::NewElement(source->Position(), source->Namespace(),
-                                    source->Name(), source->Attributes(), source->Pretty());
-        }
-
-        const vector<XMLNode*>& children = source->Children();
-        const size_t I = children.size();
-        for (size_t i=0; i<I; i++) {
-            target->EditChildren().push_back(pseudolocalize_xml_node(children[i], settings));
-        }
-
-        return target;
-    }
-}
-
-void
-pseudolocalize_trans_unit(const string&file, TransUnit* unit, void* cookie)
-{
-    const PseudolocalizeSettings* settings = (PseudolocalizeSettings*)cookie;
-
-    const StringResource& source = unit->source;
-    StringResource* target = &unit->target;
-    *target = source;
-
-    target->config = settings->xliff->TargetConfig();
-
-    delete target->value;
-    target->value = pseudolocalize_xml_node(source.value, settings);
-}
-
-int
-pseudolocalize_xliff(XLIFFFile* xliff, bool expand)
-{
-    PseudolocalizeSettings settings;
-
-    settings.xliff = xliff;
-    settings.expand = expand;
-    xliff->Map(pseudolocalize_trans_unit, &settings);
-    return 0;
-}
-
-static int
-do_pseudo(const string& infile, const string& outfile, bool expand)
-{
-    int err;
-
-    XLIFFFile* xliff = XLIFFFile::Parse(infile);
-    if (xliff == NULL) {
-        return 1;
-    }
-
-    pseudolocalize_xliff(xliff, expand);
-
-    err = write_to_file(outfile, xliff->ToString());
-
-    delete xliff;
-
-    return err;
-}
-
-void
-log_printf(const char *fmt, ...)
-{
-    int ret;
-    va_list ap;
-
-    if (g_logFile != NULL) {
-        va_start(ap, fmt);
-        ret = vfprintf(g_logFile, fmt, ap);
-        va_end(ap);
-        fflush(g_logFile);
-    }
-}
-
-void
-close_log_file()
-{
-    if (g_logFile != NULL) {
-        fclose(g_logFile);
-    }
-}
-
-void
-open_log_file(const char* file)
-{
-    g_logFile = fopen(file, "w");
-    printf("log file: %s -- %p\n", file, g_logFile);
-    atexit(close_log_file);
-}
-
-static int
-usage()
-{
-    fprintf(stderr,
-            "usage: localize export OPTIONS CONFIGS...\n"
-            "   REQUIRED OPTIONS\n"
-            "     --settings SETTINGS   The settings file to use.  See CONFIGS below.\n"
-            "     --root TREE_ROOT      The location in Perforce of the files.  e.g. //device\n"
-            "     --target LOCALE       The target locale.  See LOCALES below.\n"
-            "\n"
-            "   OPTIONAL OPTIONS\n"
-            "      --out DIR            Directory to put the output files.  Defaults to the\n"
-            "                           current directory if not supplied.  Files are\n"
-            "                           named as follows:\n"
-            "                               CONFIG-LOCALE-CURRENT_CL.xliff\n"
-            "\n"
-            "\n"
-            "usage: localize import XLIFF_FILE...\n"
-            "\n"
-            "Import a translated XLIFF file back into the tree.\n"
-            "\n"
-            "\n"
-            "usage: localize xlb XMB_FILE VALUES_FILES...\n"
-            "\n"
-            "Read resource files from the tree file and write the corresponding XLB file\n"
-            "\n"
-            "Supply all of the android resource files (values files) to export after that.\n"
-            "\n"
-            "\n"
-            "\n"
-            "CONFIGS\n"
-            "\n"
-            "LOCALES\n"
-            "Locales are specified in the form en_US  They will be processed correctly\n"
-            "to locate the resouce files in the tree.\n"
-            "\n"
-            "\n"
-            "usage: localize pseudo OPTIONS INFILE [OUTFILE]\n"
-            "   OPTIONAL OPTIONS\n"
-            "     --big                 Pad strings so they get longer.\n"
-            "\n"
-            "Read INFILE, an XLIFF file, and output a pseudotranslated version of that file.  If\n"
-            "OUTFILE is specified, the results are written there; otherwise, the results are\n"
-            "written back to INFILE.\n"
-            "\n"
-            "\n"
-            "usage: localize rescheck FILES...\n"
-            "\n"
-            "Reads the base strings and prints warnings about bad resources from the given files.\n"
-            "\n");
-    return 1;
-}
-
-int
-main(int argc, const char** argv)
-{
-    //open_log_file("log.txt");
-    //g_logFile = stdout;
-
-    if (argc == 2 && 0 == strcmp(argv[1], "--test")) {
-        return test();
-    }
-
-    if (argc < 2) {
-        return usage();
-    }
-
-    int index = 1;
-    
-    if (0 == strcmp("export", argv[index])) {
-        string settingsFile;
-        string rootDir;
-        string outDir;
-        string baseLocale = "en";
-        string targetLocale;
-        string language, region;
-        vector<string> configs;
-
-        index++;
-        while (index < argc) {
-            if (0 == strcmp("--settings", argv[index])) {
-                settingsFile = argv[index+1];
-                index += 2;
-            }
-            else if (0 == strcmp("--root", argv[index])) {
-                rootDir = argv[index+1];
-                index += 2;
-            }
-            else if (0 == strcmp("--out", argv[index])) {
-                outDir = argv[index+1];
-                index += 2;
-            }
-            else if (0 == strcmp("--target", argv[index])) {
-                targetLocale = argv[index+1];
-                index += 2;
-            }
-            else if (argv[index][0] == '-') {
-                fprintf(stderr, "unknown argument %s\n", argv[index]);
-                return usage();
-            }
-            else {
-                break;
-            }
-        }
-        for (; index<argc; index++) {
-            configs.push_back(argv[index]);
-        }
-
-        if (settingsFile == "" || rootDir == "" || configs.size() == 0 || targetLocale == "") {
-            return usage();
-        }
-        if (!split_locale(targetLocale, &language, &region)) {
-            fprintf(stderr, "illegal --target locale: '%s'\n", targetLocale.c_str());
-            return usage();
-        }
-
-
-        return do_export(settingsFile, rootDir, outDir, targetLocale, configs);
-    }
-    else if (0 == strcmp("import", argv[index])) {
-        vector<string> xliffFilenames;
-
-        index++;
-        for (; index<argc; index++) {
-            xliffFilenames.push_back(argv[index]);
-        }
-
-        return do_merge(xliffFilenames);
-    }
-    else if (0 == strcmp("xlb", argv[index])) {
-        string outfile;
-        vector<string> resFiles;
-
-        index++;
-        if (argc < index+1) {
-            return usage();
-        }
-
-        outfile = argv[index];
-
-        index++;
-        for (; index<argc; index++) {
-            resFiles.push_back(argv[index]);
-        }
-
-        return do_xlb_export(outfile, resFiles);
-    }
-    else if (0 == strcmp("pseudo", argv[index])) {
-        string infile;
-        string outfile;
-        bool big = false;
-
-        index++;
-        while (index < argc) {
-            if (0 == strcmp("--big", argv[index])) {
-                big = true;
-                index += 1;
-            }
-            else if (argv[index][0] == '-') {
-                fprintf(stderr, "unknown argument %s\n", argv[index]);
-                return usage();
-            }
-            else {
-                break;
-            }
-        }
-
-        if (index == argc-1) {
-            infile = argv[index];
-            outfile = argv[index];
-        }
-        else if (index == argc-2) {
-            infile = argv[index];
-            outfile = argv[index+1];
-        }
-        else {
-            fprintf(stderr, "unknown argument %s\n", argv[index]);
-            return usage();
-        }
-
-        return do_pseudo(infile, outfile, big);
-    }
-    else if (0 == strcmp("rescheck", argv[index])) {
-        vector<string> files;
-
-        index++;
-        while (index < argc) {
-            if (argv[index][0] == '-') {
-                fprintf(stderr, "unknown argument %s\n", argv[index]);
-                return usage();
-            }
-            else {
-                break;
-            }
-        }
-        for (; index<argc; index++) {
-            files.push_back(argv[index]);
-        }
-
-        if (files.size() == 0) {
-            return usage();
-        }
-
-        return do_rescheck(files);
-    }
-    else {
-        return usage();
-    }
-
-    if (SourcePos::HasErrors()) {
-        SourcePos::PrintErrors(stderr);
-        return 1;
-    }
-
-    return 0;
-}
-
diff --git a/tools/localize/localize.h b/tools/localize/localize.h
deleted file mode 100644
index 615d14e..0000000
--- a/tools/localize/localize.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef LOCALIZE_H
-#define LOCALIZE_H
-
-#include "XLIFFFile.h"
-
-#include <map>
-#include <string>
-
-using namespace std;
-
-struct Reject
-{
-    string file;
-    string name;
-    string comment;
-};
-
-struct Settings
-{
-    string id;
-    string oldVersion;
-    string currentVersion;
-    vector<string> apps;
-    vector<Reject> reject;
-};
-
-int read_settings(const string& filename, map<string,Settings>* result, const string& rootDir);
-string translated_file_name(const string& file, const string& locale);
-bool keep_this_trans_unit(const string& file, const TransUnit& unit, void* cookie);
-int validate_config(const string& settingsFile, const map<string,Settings>& settings,
-        const string& configs);
-int validate_configs(const string& settingsFile, const map<string,Settings>& settings,
-        const vector<string>& configs);
-int select_files(vector<string> *resFiles, const string& config,
-        const map<string,Settings>& settings, const string& rootDir);
-int select_files(vector<vector<string> > *allResFiles, const vector<string>& configs,
-        const map<string,Settings>& settings, const string& rootDir);
-
-
-#endif // LOCALIZE_H
diff --git a/tools/localize/localize_test.cpp b/tools/localize/localize_test.cpp
deleted file mode 100644
index 1d0ac9a..0000000
--- a/tools/localize/localize_test.cpp
+++ /dev/null
@@ -1,221 +0,0 @@
-#include <cstdio>
-#include "XLIFFFile.h"
-#include "ValuesFile.h"
-#include "localize.h"
-#include <stdio.h>
-
-int pseudolocalize_xliff(XLIFFFile* xliff, bool expand);
-
-static int
-test_filename(const string& file, const string& locale, const string& expected)
-{
-    string result = translated_file_name(file, locale);
-    if (result != expected) {
-        fprintf(stderr, "translated_file_name test failed\n");
-        fprintf(stderr, "  locale='%s'\n", locale.c_str());
-        fprintf(stderr, "  expected='%s'\n", expected.c_str());
-        fprintf(stderr, "    result='%s'\n", result.c_str());
-        return 1;
-    } else {
-        if (false) {
-            fprintf(stderr, "translated_file_name test passed\n");
-            fprintf(stderr, "  locale='%s'\n", locale.c_str());
-            fprintf(stderr, "  expected='%s'\n", expected.c_str());
-            fprintf(stderr, "    result='%s'\n", result.c_str());
-        }
-        return 0;
-    }
-}
-
-static int
-translated_file_name_test()
-{
-    bool all = true;
-    int err = 0;
-
-    if (all) err |= test_filename("//device/samples/NotePad/res/values/strings.xml", "zz_ZZ",
-                                  "//device/samples/NotePad/res/values-zz-rZZ/strings.xml");
-
-    if (all) err |= test_filename("//device/samples/NotePad/res/values/strings.xml", "zz",
-                                  "//device/samples/NotePad/res/values-zz/strings.xml");
-
-    if (all) err |= test_filename("//device/samples/NotePad/res/values/strings.xml", "",
-                                  "//device/samples/NotePad/res/values/strings.xml");
-
-    return err;
-}
-
-bool
-return_false(const string&, const TransUnit& unit, void* cookie)
-{
-    return false;
-}
-
-static int
-delete_trans_units()
-{
-    XLIFFFile* xliff = XLIFFFile::Parse("testdata/strip_xliff.xliff");
-    if (xliff == NULL) {
-        printf("couldn't read file\n");
-        return 1;
-    }
-    if (false) {
-        printf("XLIFF was [[%s]]\n", xliff->ToString().c_str());
-    }
-
-    xliff->Filter(return_false, NULL);
-
-    if (false) {
-        printf("XLIFF is [[%s]]\n", xliff->ToString().c_str());
-
-        set<StringResource> const& strings = xliff->GetStringResources();
-        printf("strings.size=%zd\n", strings.size());
-        for (set<StringResource>::iterator it=strings.begin(); it!=strings.end(); it++) {
-            const StringResource& str = *it;
-            printf("STRING!!! id=%s value='%s' pos=%s file=%s version=%d(%s)\n", str.id.c_str(),
-                    str.value->ContentsToString(ANDROID_NAMESPACES).c_str(),
-                    str.pos.ToString().c_str(), str.file.c_str(), str.version,
-                    str.versionString.c_str());
-        }
-    }
- 
-    return 0;
-}
-
-static int
-filter_trans_units()
-{
-    XLIFFFile* xliff = XLIFFFile::Parse("testdata/strip_xliff.xliff");
-    if (xliff == NULL) {
-        printf("couldn't read file\n");
-        return 1;
-    }
-
-    if (false) {
-        printf("XLIFF was [[%s]]\n", xliff->ToString().c_str());
-    }
-
-    Settings setting;
-    xliff->Filter(keep_this_trans_unit, &setting);
-
-    if (false) {
-        printf("XLIFF is [[%s]]\n", xliff->ToString().c_str());
-
-        set<StringResource> const& strings = xliff->GetStringResources();
-        printf("strings.size=%zd\n", strings.size());
-        for (set<StringResource>::iterator it=strings.begin(); it!=strings.end(); it++) {
-            const StringResource& str = *it;
-            printf("STRING!!! id=%s value='%s' pos=%s file=%s version=%d(%s)\n", str.id.c_str(),
-                    str.value->ContentsToString(ANDROID_NAMESPACES).c_str(),
-                    str.pos.ToString().c_str(), str.file.c_str(), str.version,
-                    str.versionString.c_str());
-        }
-    }
- 
-    return 0;
-}
-
-static int
-settings_test()
-{
-    int err;
-    map<string,Settings> settings;
-    map<string,Settings>::iterator it;
-
-    err = read_settings("testdata/config.xml", &settings, "//asdf");
-    if (err != 0) {
-        return err;
-    }
-
-    if (false) {
-        for (it=settings.begin(); it!=settings.end(); it++) {
-            const Settings& setting = it->second;
-            printf("CONFIG:\n");
-            printf("              id='%s'\n", setting.id.c_str());
-            printf("      oldVersion='%s'\n", setting.oldVersion.c_str());
-            printf("  currentVersion='%s'\n", setting.currentVersion.c_str());
-            int i=0;
-            for (vector<string>::const_iterator app=setting.apps.begin();
-                    app!=setting.apps.end(); app++) {
-                printf("        apps[%02d]='%s'\n", i, app->c_str());
-                i++;
-            }
-            i=0;
-            for (vector<Reject>::const_iterator reject=setting.reject.begin();
-                    reject!=setting.reject.end(); reject++) {
-                i++;
-                printf("      reject[%02d]=('%s','%s','%s')\n", i, reject->file.c_str(),
-                        reject->name.c_str(), reject->comment.c_str());
-            }
-        }
-    }
-
-    for (it=settings.begin(); it!=settings.end(); it++) {
-        const Settings& setting = it->second;
-        if (it->first != setting.id) {
-            fprintf(stderr, "it->first='%s' setting.id='%s'\n", it->first.c_str(),
-                    setting.id.c_str());
-            err |= 1;
-        }
-    }
-
-
-    return err;
-}
-
-static int
-test_one_pseudo(bool big, const char* expected)
-{
-    XLIFFFile* xliff = XLIFFFile::Parse("testdata/pseudo.xliff");
-    if (xliff == NULL) {
-        printf("couldn't read file\n");
-        return 1;
-    }
-    if (false) {
-        printf("XLIFF was [[%s]]\n", xliff->ToString().c_str());
-    }
-
-    pseudolocalize_xliff(xliff, big);
-    string newString = xliff->ToString();
-    delete xliff;
-
-    if (false) {
-        printf("XLIFF is [[%s]]\n", newString.c_str());
-    }
-
-    if (false && newString != expected) {
-        fprintf(stderr, "xliff didn't translate as expected\n");
-        fprintf(stderr, "newString=[[%s]]\n", newString.c_str());
-        fprintf(stderr, "expected=[[%s]]\n", expected);
-        return 1;
-    }
-
-    return 0;
-}
-
-static int
-pseudolocalize_test()
-{
-    int err = 0;
-    
-    err |= test_one_pseudo(false, "");
-    //err |= test_one_pseudo(true, "");
-
-    return err;
-}
-
-int
-localize_test()
-{
-    bool all = true;
-    int err = 0;
-
-    if (all) err |= translated_file_name_test();
-    if (all) err |= delete_trans_units();
-    if (all) err |= filter_trans_units();
-    if (all) err |= settings_test();
-    if (all) err |= pseudolocalize_test();
-
-    return err;
-}
-
diff --git a/tools/localize/log.h b/tools/localize/log.h
deleted file mode 100644
index 4a5fa7f..0000000
--- a/tools/localize/log.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef LOG_H
-#define LOG_H
-
-void log_printf(const char* fmt, ...);
-
-#endif // LOG_H
-
diff --git a/tools/localize/merge_res_and_xliff.cpp b/tools/localize/merge_res_and_xliff.cpp
deleted file mode 100644
index 1fdaa0e..0000000
--- a/tools/localize/merge_res_and_xliff.cpp
+++ /dev/null
@@ -1,392 +0,0 @@
-#include "merge_res_and_xliff.h"
-
-#include "file_utils.h"
-#include "Perforce.h"
-#include "log.h"
-#include <stdio.h>
-
-static set<StringResource>::const_iterator
-find_id(const set<StringResource>& s, const string& id, int index)
-{
-    for (set<StringResource>::const_iterator it = s.begin(); it != s.end(); it++) {
-        if (it->id == id && it->index == index) {
-            return it;
-        }
-    }
-    return s.end();
-}
-
-static set<StringResource>::const_iterator
-find_in_xliff(const set<StringResource>& s, const string& filename, const string& id, int index,
-                int version, const Configuration& config)
-{
-    for (set<StringResource>::const_iterator it = s.begin(); it != s.end(); it++) {
-        if (it->file == filename && it->id == id && it->index == index && it->version == version
-                && it->config == config) {
-            return it;
-        }
-    }
-    return s.end();
-}
-
-
-static void
-printit(const set<StringResource>& s, const set<StringResource>::const_iterator& it)
-{
-    if (it == s.end()) {
-        printf("(none)\n");
-    } else {
-        printf("id=%s index=%d config=%s file=%s value='%s'\n", it->id.c_str(), it->index,
-                it->config.ToString().c_str(), it->file.c_str(),
-                it->value->ToString(ANDROID_NAMESPACES).c_str());
-    }
-}
-
-StringResource
-convert_resource(const StringResource& s, const string& file, const Configuration& config,
-                    int version, const string& versionString)
-{
-    return StringResource(s.pos, file, config, s.id, s.index, s.value ? s.value->Clone() : NULL,
-            version, versionString, s.comment);
-}
-
-static bool
-resource_has_contents(const StringResource& res)
-{
-    XMLNode* value = res.value;
-    if (value == NULL) {
-        return false;
-    }
-    string contents = value->ContentsToString(ANDROID_NAMESPACES);
-    return contents != "";
-}
-
-ValuesFile*
-merge_res_and_xliff(const ValuesFile* en_currentFile,
-        const ValuesFile* xx_currentFile, const ValuesFile* xx_oldFile,
-        const string& filename, const XLIFFFile* xliffFile)
-{
-    bool success = true;
-
-    Configuration en_config = xliffFile->SourceConfig();
-    Configuration xx_config = xliffFile->TargetConfig();
-    string currentVersion = xliffFile->CurrentVersion();
-
-    ValuesFile* result = new ValuesFile(xx_config);
-
-    set<StringResource> en_cur = en_currentFile->GetStrings();
-    set<StringResource> xx_cur = xx_currentFile->GetStrings();
-    set<StringResource> xx_old = xx_oldFile->GetStrings();
-    set<StringResource> xliff = xliffFile->GetStringResources();
-
-    // for each string in en_current
-    for (set<StringResource>::const_iterator en_c = en_cur.begin();
-            en_c != en_cur.end(); en_c++) {
-        set<StringResource>::const_iterator xx_c = find_id(xx_cur, en_c->id, en_c->index);
-        set<StringResource>::const_iterator xx_o = find_id(xx_old, en_c->id, en_c->index);
-        set<StringResource>::const_iterator xlf = find_in_xliff(xliff, en_c->file, en_c->id,
-                                                        en_c->index, CURRENT_VERSION, xx_config);
-
-        if (false) {
-            printf("\nen_c: "); printit(en_cur, en_c);
-            printf("xx_c: "); printit(xx_cur, xx_c);
-            printf("xx_o: "); printit(xx_old, xx_o);
-            printf("xlf:  "); printit(xliff, xlf);
-        }
-
-        // if it changed between xx_old and xx_current, use xx_current
-        // (someone changed it by hand)
-        if (xx_o != xx_old.end() && xx_c != xx_cur.end()) {
-            string xx_o_value = xx_o->value->ToString(ANDROID_NAMESPACES);
-            string xx_c_value = xx_c->value->ToString(ANDROID_NAMESPACES);
-            if (xx_o_value != xx_c_value && xx_c_value != "") {
-                StringResource r(convert_resource(*xx_c, filename, xx_config,
-                                                    CURRENT_VERSION, currentVersion));
-                if (resource_has_contents(r)) {
-                    result->AddString(r);
-                }
-                continue;
-            }
-        }
-
-        // if it is present in xliff, use that
-        // (it just got translated)
-        if (xlf != xliff.end() && xlf->value->ToString(ANDROID_NAMESPACES) != "") {
-            StringResource r(convert_resource(*xlf, filename, xx_config,
-                                                CURRENT_VERSION, currentVersion));
-            if (resource_has_contents(r)) {
-                result->AddString(r);
-            }
-        }
-
-        // if it is present in xx_current, use that
-        // (it was already translated, and not retranslated)
-        // don't filter out empty strings if they were added by hand, the above code just
-        // guarantees that this tool never adds an empty one.
-        if (xx_c != xx_cur.end()) {
-            StringResource r(convert_resource(*xx_c, filename, xx_config,
-                                                CURRENT_VERSION, currentVersion));
-            result->AddString(r);
-        }
-
-        // othwerwise, leave it out.  The resource fall-through code will use the English
-        // one at runtime, and the xliff export code will pick it up for translation next time.
-    }
-
-    if (success) {
-        return result;
-    } else {
-        delete result;
-        return NULL;
-    }
-}
-
-
-struct MergedFile {
-    XLIFFFile* xliff;
-    string xliffFilename;
-    string original;
-    string translated;
-    ValuesFile* en_current;
-    ValuesFile* xx_current;
-    ValuesFile* xx_old;
-    ValuesFile* xx_new;
-    string xx_new_text;
-    string xx_new_filename;
-    bool new_file;
-    bool deleted_file;
-
-    MergedFile();
-    MergedFile(const MergedFile&);
-};
-
-struct compare_filenames {
-    bool operator()(const MergedFile& lhs, const MergedFile& rhs) const
-    {
-        return lhs.original < rhs.original;
-    }
-};
-
-MergedFile::MergedFile()
-    :xliff(NULL),
-     xliffFilename(),
-     original(),
-     translated(),
-     en_current(NULL),
-     xx_current(NULL),
-     xx_old(NULL),
-     xx_new(NULL),
-     xx_new_text(),
-     xx_new_filename(),
-     new_file(false),
-     deleted_file(false)
-{
-}
-
-MergedFile::MergedFile(const MergedFile& that)
-    :xliff(that.xliff),
-     xliffFilename(that.xliffFilename),
-     original(that.original),
-     translated(that.translated),
-     en_current(that.en_current),
-     xx_current(that.xx_current),
-     xx_old(that.xx_old),
-     xx_new(that.xx_new),
-     xx_new_text(that.xx_new_text),
-     xx_new_filename(that.xx_new_filename),
-     new_file(that.new_file),
-     deleted_file(that.deleted_file)
-{
-}
-
-
-typedef set<MergedFile, compare_filenames> MergedFileSet;
-
-int
-do_merge(const vector<string>& xliffFilenames)
-{
-    int err = 0;
-    MergedFileSet files;
-
-    printf("\rPreparing..."); fflush(stdout);
-    string currentChange = Perforce::GetCurrentChange(true);
-
-    // for each xliff, make a MergedFile record and do a little error checking
-    for (vector<string>::const_iterator xliffFilename=xliffFilenames.begin();
-            xliffFilename!=xliffFilenames.end(); xliffFilename++) {
-        XLIFFFile* xliff = XLIFFFile::Parse(*xliffFilename);
-        if (xliff == NULL) {
-            fprintf(stderr, "localize import: unable to read file %s\n", xliffFilename->c_str());
-            err = 1;
-            continue;
-        }
-
-        set<string> xf = xliff->Files();
-        for (set<string>::const_iterator f=xf.begin(); f!=xf.end(); f++) {
-            MergedFile mf;
-            mf.xliff = xliff;
-            mf.xliffFilename = *xliffFilename;
-            mf.original = *f;
-            mf.translated = translated_file_name(mf.original, xliff->TargetConfig().locale);
-            log_printf("mf.translated=%s mf.original=%s locale=%s\n", mf.translated.c_str(),
-                    mf.original.c_str(), xliff->TargetConfig().locale.c_str());
-
-            if (files.find(mf) != files.end()) {
-                fprintf(stderr, "%s: duplicate string resources for file %s\n",
-                        xliffFilename->c_str(), f->c_str());
-                fprintf(stderr, "%s: previously defined here.\n",
-                        files.find(mf)->xliffFilename.c_str());
-                err = 1;
-                continue;
-            }
-            files.insert(mf);
-        }
-    }
-
-    size_t deletedFileCount = 0;
-    size_t J = files.size() * 3;
-    size_t j = 1;
-    // Read all of the files from perforce.
-    for (MergedFileSet::iterator mf = files.begin(); mf != files.end(); mf++) {
-        MergedFile* file = const_cast<MergedFile*>(&(*mf));
-        // file->en_current
-        print_file_status(j++, J);
-        file->en_current = get_values_file(file->original, file->xliff->SourceConfig(),
-                                            CURRENT_VERSION, currentChange, true);
-        if (file->en_current == NULL) {
-            // deleted file
-            file->deleted_file = true;
-            deletedFileCount++;
-            continue;
-        }
-
-        // file->xx_current;
-        print_file_status(j++, J);
-        file->xx_current = get_values_file(file->translated, file->xliff->TargetConfig(),
-                                            CURRENT_VERSION, currentChange, false);
-        if (file->xx_current == NULL) {
-            file->xx_current = new ValuesFile(file->xliff->TargetConfig());
-            file->new_file = true;
-        }
-
-        // file->xx_old (note that the xliff's current version is our old version, because that
-        // was the current version when it was exported)
-        print_file_status(j++, J);
-        file->xx_old = get_values_file(file->translated, file->xliff->TargetConfig(),
-                                            OLD_VERSION, file->xliff->CurrentVersion(), false);
-        if (file->xx_old == NULL) {
-            file->xx_old = new ValuesFile(file->xliff->TargetConfig());
-            file->new_file = true;
-        }
-    }
-
-    // merge them
-    for (MergedFileSet::iterator mf = files.begin(); mf != files.end(); mf++) {
-        MergedFile* file = const_cast<MergedFile*>(&(*mf));
-        if (file->deleted_file) {
-            continue;
-        }
-        file->xx_new = merge_res_and_xliff(file->en_current, file->xx_current, file->xx_old,
-                                            file->original, file->xliff);
-    }
-
-    // now is a good time to stop if there was an error
-    if (err != 0) {
-        return err;
-    }
-
-    // locate the files
-    j = 1;
-    for (MergedFileSet::iterator mf = files.begin(); mf != files.end(); mf++) {
-        MergedFile* file = const_cast<MergedFile*>(&(*mf));
-        print_file_status(j++, J, "Locating");
-
-        file->xx_new_filename = Perforce::Where(file->translated, true);
-        if (file->xx_new_filename == "") {
-            fprintf(stderr, "\nWas not able to determine the location of depot file %s\n",
-                    file->translated.c_str());
-            err = 1;
-        }
-    }
-
-    if (err != 0) {
-        return err;
-    }
-
-    // p4 edit the files
-    // only do this if it changed - no need to submit files that haven't changed meaningfully
-    vector<string> filesToEdit;
-    vector<string> filesToAdd;
-    vector<string> filesToDelete;
-    for (MergedFileSet::iterator mf = files.begin(); mf != files.end(); mf++) {
-        MergedFile* file = const_cast<MergedFile*>(&(*mf));
-        if (file->deleted_file) {
-            filesToDelete.push_back(file->xx_new_filename);
-            continue;
-        }
-        string xx_current_text = file->xx_current->ToString();
-        string xx_new_text = file->xx_new->ToString();
-        if (xx_current_text != xx_new_text) {
-            if (file->xx_new->GetStrings().size() == 0) {
-                file->deleted_file = true;
-                filesToDelete.push_back(file->xx_new_filename);
-            } else {
-                file->xx_new_text = xx_new_text;
-                if (file->new_file) {
-                    filesToAdd.push_back(file->xx_new_filename);
-                } else {
-                    filesToEdit.push_back(file->xx_new_filename);
-                }
-            }
-        }
-    }
-    if (filesToAdd.size() == 0 && filesToEdit.size() == 0 && deletedFileCount == 0) {
-        printf("\nAll of the files are the same.  Nothing to change.\n");
-        return 0;
-    }
-    if (filesToEdit.size() > 0) {
-        printf("\np4 editing files...\n");
-        if (0 != Perforce::EditFiles(filesToEdit, true)) {
-            return 1;
-        }
-    }
-
-
-    printf("\n");
-
-    for (MergedFileSet::iterator mf = files.begin(); mf != files.end(); mf++) {
-        MergedFile* file = const_cast<MergedFile*>(&(*mf));
-        if (file->deleted_file) {
-            continue;
-        }
-        if (file->xx_new_text != "" && file->xx_new_filename != "") {
-            if (0 != write_to_file(file->xx_new_filename, file->xx_new_text)) {
-                err = 1;
-            }
-        }
-    }
-
-    if (err != 0) {
-        return err;
-    }
-
-    if (filesToAdd.size() > 0) {
-        printf("p4 adding %zd new files...\n", filesToAdd.size());
-        err = Perforce::AddFiles(filesToAdd, true);
-    }
-
-    if (filesToDelete.size() > 0) {
-        printf("p4 deleting %zd removed files...\n", filesToDelete.size());
-        err = Perforce::DeleteFiles(filesToDelete, true);
-    }
-
-    if (err != 0) {
-        return err;
-    }
-
-    printf("\n"
-           "Theoretically, this merge was successfull.  Next you should\n"
-           "review the diffs, get a code review, and submit it.  Enjoy.\n\n");
-    return 0;
-}
-
diff --git a/tools/localize/merge_res_and_xliff.h b/tools/localize/merge_res_and_xliff.h
deleted file mode 100644
index acf2fff..0000000
--- a/tools/localize/merge_res_and_xliff.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef MERGE_RES_AND_XLIFF_H
-#define MERGE_RES_AND_XLIFF_H
-
-#include "ValuesFile.h"
-#include "XLIFFFile.h"
-
-ValuesFile* merge_res_and_xliff(const ValuesFile* en_current,
-                                const ValuesFile* xx_current, const ValuesFile* xx_old,
-                                const string& filename, const XLIFFFile* xliff);
-
-int do_merge(const vector<string>& xliffFilenames);
-
-#endif // MERGE_RES_AND_XLIFF_H
diff --git a/tools/localize/merge_res_and_xliff_test.cpp b/tools/localize/merge_res_and_xliff_test.cpp
deleted file mode 100644
index 6fe2629..0000000
--- a/tools/localize/merge_res_and_xliff_test.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-#include <cstdio>
-#include "merge_res_and_xliff.h"
-#include <stdio.h>
-
-int
-merge_test()
-{
-    Configuration english;
-        english.locale = "en_US";
-    Configuration translated;
-        translated.locale = "zz_ZZ";
-
-    ValuesFile* en_current = ValuesFile::ParseFile("testdata/merge_en_current.xml", english,
-                                                    CURRENT_VERSION, "3");
-    if (en_current == NULL) {
-        fprintf(stderr, "merge_test: unable to read testdata/merge_en_current.xml\n");
-        return 1;
-    }
-
-    ValuesFile* xx_current = ValuesFile::ParseFile("testdata/merge_xx_current.xml", translated,
-                                                    CURRENT_VERSION, "3");
-    if (xx_current == NULL) {
-        fprintf(stderr, "merge_test: unable to read testdata/merge_xx_current.xml\n");
-        return 1;
-    }
-    ValuesFile* xx_old = ValuesFile::ParseFile("testdata/merge_xx_old.xml", translated,
-                                                    OLD_VERSION, "2");
-    if (xx_old == NULL) {
-        fprintf(stderr, "merge_test: unable to read testdata/merge_xx_old.xml\n");
-        return 1;
-    }
-
-    XLIFFFile* xliff = XLIFFFile::Parse("testdata/merge.xliff");
-
-    ValuesFile* result = merge_res_and_xliff(en_current, xx_current, xx_old,
-                                "//device/tools/localize/testdata/res/values/strings.xml", xliff);
-
-    if (result == NULL) {
-        fprintf(stderr, "merge_test: result is NULL\n");
-        return 1;
-    }
-
-    printf("======= RESULT =======\n%s===============\n", result->ToString().c_str());
-
-    return 0;
-}
-
-
diff --git a/tools/localize/res_check.cpp b/tools/localize/res_check.cpp
deleted file mode 100644
index 0fab98a..0000000
--- a/tools/localize/res_check.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-#include "res_check.h"
-#include "localize.h"
-#include "file_utils.h"
-#include "ValuesFile.h"
-
-#include <stdio.h>
-
-static int check_file(const ValuesFile* file);
-static int check_value(const SourcePos& pos, const XMLNode* value);
-static int scan_for_unguarded_format(const SourcePos& pos, const XMLNode* value, int depth = 0);
-
-int
-do_rescheck(const vector<string>& files)
-{
-    int err;
-
-    Configuration english;
-        english.locale = "en_US";
-
-    for (size_t i=0; i<files.size(); i++) {
-        const string filename = files[i];
-        ValuesFile* valuesFile = get_local_values_file(filename, english, CURRENT_VERSION,
-                "0", true);
-        if (valuesFile != NULL) {
-            err |= check_file(valuesFile);
-            delete valuesFile;
-        } else {
-            err |= 1;
-        }
-    }
-
-    return err;
-}
-
-static int
-check_file(const ValuesFile* file)
-{
-    int err = 0;
-    set<StringResource> strings = file->GetStrings();
-    for (set<StringResource>::iterator it=strings.begin(); it!=strings.end(); it++) {
-        XMLNode* value = it->value;
-        if (value != NULL) {
-            err |= check_value(it->pos, value);
-        }
-    }
-    return err;
-}
-
-static bool
-contains_percent(const string& str)
-{
-    const size_t len = str.length();
-    for (size_t i=0; i<len; i++) {
-        char c = str[i];
-        if (c == '%') {
-            return true;
-        }
-    }
-    return false;
-}
-
-static int
-check_value(const SourcePos& pos, const XMLNode* value)
-{
-    int err = 0;
-    err |= scan_for_unguarded_format(pos, value);
-    return err;
-}
-
-static bool
-is_xliff_block(const string& ns, const string& name)
-{
-    if (ns == XLIFF_XMLNS) {
-        return name == "g";
-    } else {
-        return false;
-    }
-}
-
-static int
-scan_for_unguarded_format(const SourcePos& pos, const string& string)
-{
-    bool containsPercent = contains_percent(string);
-    if (containsPercent) {
-        pos.Error("unguarded percent: '%s'\n", string.c_str());
-    }
-    return 0;
-}
-
-static int
-scan_for_unguarded_format(const SourcePos& pos, const XMLNode* value, int depth)
-{
-    if (value->Type() == XMLNode::ELEMENT) {
-        int err = 0;
-        if (depth == 0 || !is_xliff_block(value->Namespace(), value->Name())) {
-            const vector<XMLNode*>& children = value->Children();
-            for (size_t i=0; i<children.size(); i++) {
-                err |= scan_for_unguarded_format(pos, children[i], depth+1);
-            }
-        }
-        return err;
-    } else {
-        return scan_for_unguarded_format(pos, value->Text());
-    }
-}
-
diff --git a/tools/localize/res_check.h b/tools/localize/res_check.h
deleted file mode 100644
index 86e7ce6..0000000
--- a/tools/localize/res_check.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef RESCHECK_H
-#define RESCHECK_H
-
-#include <map>
-#include <string>
-#include <vector>
-
-using namespace std;
-
-int do_rescheck(const vector<string>& files);
-
-#endif // RESCHECK_H
diff --git a/tools/localize/test.cpp b/tools/localize/test.cpp
deleted file mode 100644
index 5fa2c17..0000000
--- a/tools/localize/test.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-#include "SourcePos.h"
-#include <stdio.h>
-
-int ValuesFile_test();
-int XLIFFFile_test();
-int XMLHandler_test();
-int Perforce_test();
-int localize_test();
-int merge_test();
-
-int
-test()
-{
-    bool all = true;
-    int err = 0;
-
-    if (all) err |= XMLHandler_test();
-    if (all) err |= ValuesFile_test();
-    if (all) err |= XLIFFFile_test();
-    if (all) err |= Perforce_test();
-    if (all) err |= localize_test();
-    if (all) err |= merge_test();
-
-    if (err != 0) {
-        fprintf(stderr, "some tests failed\n");
-    } else {
-        fprintf(stderr, "all tests passed\n");
-    }
-
-    return err;
-}
diff --git a/tools/localize/testdata/config.xml b/tools/localize/testdata/config.xml
deleted file mode 100644
index affa140f..0000000
--- a/tools/localize/testdata/config.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<localize-config>
-    <configuration id="system"
-            old-cl="1"
-            new-cl="43019">
-        <app dir="apps/common" />
-    </configuration>
-    <configuration id="samples"
-            old-cl="24801"
-            new-cl="43019">
-        <app dir="samples/NotePad" />
-        <reject file="samples/NotePad/res/values/strings.xml" name="string:menu_delete">
-            QA says this sounds <b>rude</b>.
-        </reject>
-    </configuration>
-</localize-config>
diff --git a/tools/localize/testdata/import.xliff b/tools/localize/testdata/import.xliff
deleted file mode 100644
index b99b739..0000000
--- a/tools/localize/testdata/import.xliff
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2"
-        version="1.2"
-        >
-    <file datatype="x-android-res"
-            original="//device/tools/localize/testdata/res/values/strings.xml"
-            product-version="1.0"
-            date="08:10:54 12/07/07 PST"
-            source-language="en_US"
-            product-name="kila"
-            target-language="zz_ZZ"
-            build-num="44391"
-            >
-        <body>
-            <trans-unit id="string:changed_in_xx">
-                <source>aaa</source>
-                <target>AAA</target>
-            </trans-unit>
-            <trans-unit id="string:first_translation">
-                <source>bbb</source>
-                <target>BBB</target>
-            </trans-unit>
-            <trans-unit id="string:deleted_string">
-                <source>ddd</source>
-                <target>DDDD</target>
-            </trans-unit>
-            <trans-unit id="array:0:growing_array">
-                <source>1-One</source>
-                <target>1-oNE</target>
-            </trans-unit>
-            <trans-unit id="array:1:growing_array">
-                <source>1-Two</source>
-                <target>1-tWO</target>
-            </trans-unit>
-            <trans-unit id="array:2:growing_array">
-                <source>1-Three</source>
-                <target>1-tHREE</target>
-            </trans-unit>
-            <trans-unit id="array:0:shrinking_array">
-                <source>2-One</source>
-                <target>2-oNE</target>
-            </trans-unit>
-            <trans-unit id="array:1:shrinking_array">
-                <source>2-Two</source>
-                <target>2-tWO</target>
-            </trans-unit>
-            <trans-unit id="array:2:shrinking_array">
-                <source>2-Three</source>
-                <target>2-tHREE</target>
-            </trans-unit>
-            <trans-unit id="array:3:shrinking_array">
-                <source>2-Four</source>
-                <target>2-fOUR</target>
-            </trans-unit>
-            <trans-unit id="array:0:deleted_array">
-                <source>4-One</source>
-                <target>4-oNE</target>
-            </trans-unit>
-            <trans-unit id="array:1:deleted_array">
-                <source>4-Two</source>
-                <target>4-tWO</target>
-            </trans-unit>
-            <trans-unit id="array:2:deleted_array">
-                <source>4-Three</source>
-                <target>4-tHREE</target>
-            </trans-unit>
-
-        </body>
-    </file>
-</xliff>
-
-
diff --git a/tools/localize/testdata/merge.xliff b/tools/localize/testdata/merge.xliff
deleted file mode 100644
index 2b78c45..0000000
--- a/tools/localize/testdata/merge.xliff
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2"
-        version="1.2"
-        >
-    <file datatype="x-android-res"
-            original="testdata/merge_en_current.xml"
-            product-version="1.0"
-            date="08:10:54 12/07/07 PST"
-            source-language="en-US"
-            product-name="kila"
-            target-language="zz-ZZ"
-            build-num="44391"
-            >
-        <body>
-            <trans-unit id="string:changed_in_xx">
-                <source>aaa</source>
-                <target>AAA</target>
-            </trans-unit>
-            <trans-unit id="string:first_translation">
-                <source>bbb</source>
-                <target>BBB</target>
-            </trans-unit>
-            <trans-unit id="string:deleted_string">
-                <source>ddd</source>
-                <target>DDDD</target>
-            </trans-unit>
-            <trans-unit id="array:0:growing_array">
-                <source>1-One</source>
-                <target>1-oNE</target>
-            </trans-unit>
-            <trans-unit id="array:1:growing_array">
-                <source>1-Two</source>
-                <target>1-tWO</target>
-            </trans-unit>
-            <trans-unit id="array:2:growing_array">
-                <source>1-Three</source>
-                <target>1-tHREE</target>
-            </trans-unit>
-            <trans-unit id="array:0:shrinking_array">
-                <source>2-One</source>
-                <target>2-oNE</target>
-            </trans-unit>
-            <trans-unit id="array:1:shrinking_array">
-                <source>2-Two</source>
-                <target>2-tWO</target>
-            </trans-unit>
-            <trans-unit id="array:2:shrinking_array">
-                <source>2-Three</source>
-                <target>2-tHREE</target>
-            </trans-unit>
-            <trans-unit id="array:3:shrinking_array">
-                <source>2-Four</source>
-                <target>2-fOUR</target>
-            </trans-unit>
-            <trans-unit id="array:0:deleted_array">
-                <source>4-One</source>
-                <target>4-oNE</target>
-            </trans-unit>
-            <trans-unit id="array:1:deleted_array">
-                <source>4-Two</source>
-                <target>4-tWO</target>
-            </trans-unit>
-            <trans-unit id="array:2:deleted_array">
-                <source>4-Three</source>
-                <target>4-tHREE</target>
-            </trans-unit>
-
-        </body>
-    </file>
-</xliff>
-
-
diff --git a/tools/localize/testdata/merge_en_current.xml b/tools/localize/testdata/merge_en_current.xml
deleted file mode 100644
index 6a11e68..0000000
--- a/tools/localize/testdata/merge_en_current.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="changed_in_xx">aaa</string>
-    <string name="first_translation">bbb</string>
-    <string name="previously_translated">ccc</string>
-    <string name="new_string">ccc</string>
-
-    <string name="formatted_string"><b>bold</b><i>italic<u>italic_underline</u></i><u>underline</u></string>
-
-    <array name="growing_array">
-        <!-- somebody wrote a comment! -->
-        <item>1-One</item>
-        <item>1-Two</item>
-        <item>1-Three</item>
-        <item>1-Four</item>
-    </array>
-    <array name="shrinking_array">
-        <!-- somebody wrote a comment! -->
-        <item>2-One</item>
-        <item>2-Two</item>
-        <item>2-Three</item>
-    </array>
-    <array name="new_array">
-        <!-- somebody wrote a comment! -->
-        <item>3-One</item>
-        <item>3-Two</item>
-        <item>3-Three</item>
-    </array>
-</resources>
diff --git a/tools/localize/testdata/merge_en_old.xml b/tools/localize/testdata/merge_en_old.xml
deleted file mode 100644
index 933f98e..0000000
--- a/tools/localize/testdata/merge_en_old.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="changed_in_xx">aaa</string>
-    <string name="first_translation">bbb</string>
-    <string name="previously_translated">ccc</string>
-    <string name="deleted_string">ddd</string>
-
-    <string name="formatted_string"><b>bold</b><i>italic<u>italic_underline</u></i><u>underline</u></string>
-
-    <array name="growing_array">
-        <!-- somebody wrote a comment! -->
-        <item>1-One</item>
-        <item>1-Two</item>
-        <item>1-Three</item>
-    </array>
-    <array name="shrinking_array">
-        <!-- somebody wrote a comment! -->
-        <item>2-One</item>
-        <item>2-Two</item>
-        <item>2-Three</item>
-        <item>2-Four</item>
-    </array>
-    <array name="deleted_array">
-        <!-- somebody wrote a comment! -->
-        <item>4-One</item>
-        <item>4-Two</item>
-        <item>4-Three</item>
-    </array>
-</resources>
-
diff --git a/tools/localize/testdata/merge_xx_current.xml b/tools/localize/testdata/merge_xx_current.xml
deleted file mode 100644
index c2a783d..0000000
--- a/tools/localize/testdata/merge_xx_current.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="changed_in_xx">AAAA</string>
-    <string name="previously_translated">CCC</string>
-</resources>
-
-
diff --git a/tools/localize/testdata/pseudo.xliff b/tools/localize/testdata/pseudo.xliff
deleted file mode 100644
index 5b44f86..0000000
--- a/tools/localize/testdata/pseudo.xliff
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2"
-        version="1.2"
-        >
-    <file datatype="x-android-res"
-            original="//device/tools/localization/tests/res/values/strings.xml"
-            product-version="1.0"
-            date="08:10:54 12/07/07 PST"
-            source-language="en-US"
-            product-name="kila"
-            target-language="zz-ZZ"
-            build-num="32138"
-            >
-        <body>
-            <trans-unit id="string:complex">
-                <source>First <g id="string:complex:0" ctype="underline">underline</g>, <g id="string:complex:1" ctype="italic">italic<g id="string:complex:2" ctype="bold">italicbold</g></g> End </source>
-            </trans-unit>
-            <trans-unit id="string:complex-quoted">
-                <source xml:space="preserve">First <g id="string:complex-quoted:0" ctype="underline">underline</g>, <g id="string:complex-quoted:1" ctype="italic">italic<g id="string:complex-quoted:2" ctype="bold">italicbold</g></g> End</source>
-            </trans-unit>
-            <trans-unit id="string:simple">
-                <source>Simple</source>
-            </trans-unit>
-            <trans-unit id="array:0:simple">
-                <source>Simple</source>
-            </trans-unit>
-            <trans-unit id="array:1:simple">
-                <source>Simple</source>
-            </trans-unit>
-            <trans-unit id="string:simple-quoted">
-                <source xml:space="preserve"> Quote</source>
-                <alt-trans>
-                    <source xml:lang="en" xml:space="preserve"> OLD Quote</source>
-                    <target xml:lang="xx"> OLD Ờũỡŧę</target>
-                </alt-trans>
-            </trans-unit>
-        </body>
-    </file>
-</xliff>
-
diff --git a/tools/localize/testdata/res/values/strings.xml b/tools/localize/testdata/res/values/strings.xml
deleted file mode 100644
index 6a11e68..0000000
--- a/tools/localize/testdata/res/values/strings.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="changed_in_xx">aaa</string>
-    <string name="first_translation">bbb</string>
-    <string name="previously_translated">ccc</string>
-    <string name="new_string">ccc</string>
-
-    <string name="formatted_string"><b>bold</b><i>italic<u>italic_underline</u></i><u>underline</u></string>
-
-    <array name="growing_array">
-        <!-- somebody wrote a comment! -->
-        <item>1-One</item>
-        <item>1-Two</item>
-        <item>1-Three</item>
-        <item>1-Four</item>
-    </array>
-    <array name="shrinking_array">
-        <!-- somebody wrote a comment! -->
-        <item>2-One</item>
-        <item>2-Two</item>
-        <item>2-Three</item>
-    </array>
-    <array name="new_array">
-        <!-- somebody wrote a comment! -->
-        <item>3-One</item>
-        <item>3-Two</item>
-        <item>3-Three</item>
-    </array>
-</resources>
diff --git a/tools/localize/testdata/strip_xliff.xliff b/tools/localize/testdata/strip_xliff.xliff
deleted file mode 100644
index 9254cf2..0000000
--- a/tools/localize/testdata/strip_xliff.xliff
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2"
-        version="1.2"
-        >
-    <file datatype="x-android-res"
-            original="//device/tools/localization/tests/res/values/strings.xml"
-            product-version="1.0"
-            date="08:10:54 12/07/07 PST"
-            source-language="en-US"
-            product-name="kila"
-            target-language="zz-ZZ"
-            build-num="32138"
-            >
-        <body>
-
-            <trans-unit id="string:string-000-0">
-            </trans-unit>
-            <trans-unit id="string:string-001-0">
-                <alt-trans>
-                    <source xml:lang="en" xml:space="preserve">source</source>
-                </alt-trans>
-            </trans-unit>
-            <trans-unit id="string:string-010-0">
-                <alt-trans>
-                    <target xml:lang="zz" xml:space="preserve">target</target>
-                </alt-trans>
-            </trans-unit>
-            <trans-unit id="string:string-011-0">
-                <alt-trans>
-                    <source xml:lang="en" xml:space="preserve">source</source>
-                    <target xml:lang="zz" xml:space="preserve">target</target>
-                </alt-trans>
-            </trans-unit>
-
-            <trans-unit id="string:string-100-1">
-                <source xml:space="preserve">source</source>
-            </trans-unit>
-            <trans-unit id="string:string-101-1">
-                <source xml:space="preserve">source</source>
-                <alt-trans>
-                    <source xml:lang="en" xml:space="preserve">source</source>
-                </alt-trans>
-            </trans-unit>
-            <trans-unit id="string:string-110-1">
-                <source xml:space="preserve">source</source>
-                <alt-trans>
-                    <target xml:lang="zz" xml:space="preserve">target</target>
-                </alt-trans>
-            </trans-unit>
-
-            <trans-unit id="string:string-111-0">
-                <source xml:space="preserve">source</source>
-                <alt-trans>
-                    <source xml:lang="en" xml:space="preserve">source</source>
-                    <target xml:lang="zz" xml:space="preserve">target</target>
-                </alt-trans>
-            </trans-unit>
-            <trans-unit id="string:string-111-1">
-                <source xml:space="preserve">source</source>
-                <alt-trans>
-                    <source xml:lang="en" xml:space="preserve">alt-source</source>
-                    <target xml:lang="zz" xml:space="preserve">target</target>
-                </alt-trans>
-            </trans-unit>
-
-        </body>
-    </file>
-</xliff>
-
-
diff --git a/tools/localize/testdata/values/strings.xml b/tools/localize/testdata/values/strings.xml
deleted file mode 100644
index 5e8d43d..0000000
--- a/tools/localize/testdata/values/strings.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<resources
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="test1">Discard</string>
-    <!-- comment -->
-    <string name="test2">a<b>b<i>c</i></b>d</string>
-    <string name="test3">a<xliff:g  a="b" xliff:a="asdf">bBb</xliff:g>C</string>
-
-    <!-- Email address types from android.provider.Contacts -->
-    <array name="emailAddressTypes">
-        <!-- somebody wrote a comment! -->
-        <item>Email</item>
-        <item>Home</item>
-        <item>Work</item>
-        <item>Other\u2026</item>
-    </array>
-</resources>
diff --git a/tools/localize/testdata/xliff1.xliff b/tools/localize/testdata/xliff1.xliff
deleted file mode 100644
index 55a8d8e..0000000
--- a/tools/localize/testdata/xliff1.xliff
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2"
-        version="1.2"
-        >
-    <file datatype="x-android-res"
-            original="//device/tools/localization/tests/res/values/strings.xml"
-            product-version="1.0"
-            date="08:10:54 12/07/07 PST"
-            source-language="en-US"
-            product-name="kila"
-            target-language="zz-ZZ"
-            build-num="32138"
-            >
-        <body>
-            <trans-unit id="string:complex">
-                <source>First <g id="string:complex:0" ctype="underline">underline</g>, <g id="string:complex:1" ctype="italic">italic<g id="string:complex:2" ctype="bold">italicbold</g></g> End </source>
-                <target>Ḟịṙṩŧ ,  Ḛŋḋ </target>
-            </trans-unit>
-            <trans-unit id="string:complex-quoted">
-                <source xml:space="preserve">First <g id="string:complex-quoted:0" ctype="underline">underline</g>, <g id="string:complex-quoted:1" ctype="italic">italic<g id="string:complex-quoted:2" ctype="bold">italicbold</g></g> End</source>
-                <target>Ḟịṙṩŧ ,  Ḛŋḋ</target>
-            </trans-unit>
-            <trans-unit id="string:simple">
-                <source>Simple</source>
-                <target>Ṩịṃṕļę</target>
-            </trans-unit>
-            <trans-unit id="array:0:simple">
-                <source>Simple</source>
-                <target>Ṩịṃṕļę</target>
-            </trans-unit>
-            <trans-unit id="array:1:simple">
-                <source>Simple</source>
-                <target>Ṩịṃṕļę</target>
-            </trans-unit>
-            <trans-unit id="string:simple-quoted">
-                <source xml:space="preserve"> Quote</source>
-                <target> Ờũỡŧę</target>
-                <alt-trans>
-                    <source xml:lang="en" xml:space="preserve"> OLD Quote</source>
-                    <target xml:lang="xx"> OLD Ờũỡŧę</target>
-                </alt-trans>
-            </trans-unit>
-        </body>
-    </file>
-</xliff>
-
diff --git a/tools/localize/testdata/xml.xml b/tools/localize/testdata/xml.xml
deleted file mode 100644
index ef930d0..0000000
--- a/tools/localize/testdata/xml.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<ASDF>
-    <a id="system"
-            old-cl="1"
-            new-cl="43019">
-        <app dir="apps/common" />
-    </a>
-    <a id="samples"
-            old-cl="1"
-            new-cl="43019">asdf
-        <app dir="samples/NotePad" />
-        <app dir="samples/LunarLander" />
-        <something>a<b>,</b>b </something>
-        <exact xml:space="preserve">a<b>,</b>b </exact>
-    </a>
-</ASDF>
-
diff --git a/tools/localize/xmb.cpp b/tools/localize/xmb.cpp
deleted file mode 100644
index d8f6ff0..0000000
--- a/tools/localize/xmb.cpp
+++ /dev/null
@@ -1,182 +0,0 @@
-#include "xmb.h"
-
-#include "file_utils.h"
-#include "localize.h"
-#include "ValuesFile.h"
-#include "XMLHandler.h"
-#include "XLIFFFile.h"
-
-#include <map>
-#include <cstdio>
-
-using namespace std;
-
-const char *const NS_MAP[] = {
-    "xml", XMLNS_XMLNS,
-    NULL, NULL
-};
-
-set<string> g_tags;
-
-static string
-strip_newlines(const string& str)
-{
-    string res;
-    const size_t N = str.length();
-    for (size_t i=0; i<N; i++) {
-        char c = str[i];
-        if (c != '\n' && c != '\r') {
-            res += c;
-        } else {
-            res += ' ';
-        }
-    }
-    return res;
-}
-
-static int
-rename_id_attribute(XMLNode* node)
-{
-    vector<XMLAttribute>& attrs = node->EditAttributes();
-    const size_t I = attrs.size();
-    for (size_t i=0; i<I; i++) {
-        XMLAttribute attr = attrs[i];
-        if (attr.name == "id") {
-            attr.name = "name";
-            attrs.erase(attrs.begin()+i);
-            attrs.push_back(attr);
-            return 0;
-        }
-    }
-    return 1;
-}
-
-static int
-convert_xliff_to_ph(XMLNode* node, int* phID)
-{
-    int err = 0;
-    if (node->Type() == XMLNode::ELEMENT) {
-        if (node->Namespace() == XLIFF_XMLNS) {
-            g_tags.insert(node->Name());
-            node->SetName("", "ph");
-
-            err = rename_id_attribute(node);
-            if (err != 0) {
-                char name[30];
-                (*phID)++;
-                sprintf(name, "id-%d", *phID);
-                node->EditAttributes().push_back(XMLAttribute("", "name", name));
-                err = 0;
-            }
-        }
-        vector<XMLNode*>& children = node->EditChildren();
-        const size_t I = children.size();
-        for (size_t i=0; i<I; i++) {
-            err |= convert_xliff_to_ph(children[i], phID);
-        }
-    }
-    return err;
-}
-
-XMLNode*
-resource_to_xmb_msg(const StringResource& res)
-{
-    // the msg element
-    vector<XMLAttribute> attrs;
-    string name = res.pos.file;
-    name += ":";
-    name += res.TypedID();
-    attrs.push_back(XMLAttribute("", "name", name));
-    attrs.push_back(XMLAttribute("", "desc", strip_newlines(res.comment)));
-    attrs.push_back(XMLAttribute(XMLNS_XMLNS, "space", "preserve"));
-    XMLNode* msg = XMLNode::NewElement(res.pos, "", "msg", attrs, XMLNode::EXACT);
-
-    // the contents are in xliff/html, convert it to xliff
-    int err = 0;
-    XMLNode* value = res.value;
-    string tag = value->Name();
-    int phID = 0;
-    for (vector<XMLNode*>::const_iterator it=value->Children().begin();
-            it!=value->Children().end(); it++) {
-        err |= convert_html_to_xliff(*it, tag, msg, &phID);
-    }
-
-    if (err != 0) {
-        return NULL;
-    }
-
-    // and then convert that to xmb
-    for (vector<XMLNode*>::iterator it=msg->EditChildren().begin();
-            it!=msg->EditChildren().end(); it++) {
-        err |= convert_xliff_to_ph(*it, &phID);
-    }
-
-    if (err == 0) {
-        return msg;
-    } else {
-        return NULL;
-    }
-}
-
-int
-do_xlb_export(const string& outfile, const vector<string>& resFiles)
-{
-    int err = 0;
-
-    size_t totalFileCount = resFiles.size();
-
-    Configuration english;
-        english.locale = "en_US";
-
-    set<StringResource> allResources;
-
-    const size_t J = resFiles.size();
-    for (size_t j=0; j<J; j++) {
-        string resFile = resFiles[j];
-
-        ValuesFile* valuesFile = get_local_values_file(resFile, english, CURRENT_VERSION, "", true);
-        if (valuesFile != NULL) {
-            set<StringResource> resources = valuesFile->GetStrings();
-            allResources.insert(resources.begin(), resources.end());
-        } else {
-            fprintf(stderr, "error reading file %s\n", resFile.c_str());
-        }
-
-        delete valuesFile;
-    }
-
-    // Construct the XLB xml
-    vector<XMLAttribute> attrs;
-    attrs.push_back(XMLAttribute("", "locale", "en"));
-    XMLNode* localizationbundle = XMLNode::NewElement(GENERATED_POS, "", "localizationbundle",
-            attrs, XMLNode::PRETTY);
-
-    for (set<StringResource>::iterator it=allResources.begin(); it!=allResources.end(); it++) {
-        XMLNode* msg = resource_to_xmb_msg(*it);
-        if (msg) {
-            localizationbundle->EditChildren().push_back(msg);
-        } else {
-            err = 1;
-        }
-    }
-
-#if 0
-    for (set<string>::iterator it=g_tags.begin(); it!=g_tags.end(); it++) {
-        printf("tag: %s\n", it->c_str());
-    }
-    printf("err=%d\n", err);
-#endif
-    if (err == 0) {
-        FILE* f = fopen(outfile.c_str(), "wb");
-        if (f == NULL) {
-            fprintf(stderr, "can't open outputfile: %s\n", outfile.c_str());
-            return 1;
-        }
-        fprintf(f, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
-        fprintf(f, "%s\n", localizationbundle->ToString(NS_MAP).c_str());
-        fclose(f);
-    }
-
-    return err;
-}
-
diff --git a/tools/localize/xmb.h b/tools/localize/xmb.h
deleted file mode 100644
index 96492b1..0000000
--- a/tools/localize/xmb.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef XMB_H
-#define XMB_H
-
-#include <string>
-#include <vector>
-
-using namespace std;
-
-int do_xlb_export(const string& outFile, const vector<string>& resFiles);
-
-#endif // XMB_H
diff --git a/wifi/java/android/net/wifi/WifiWatchdogStateMachine.java b/wifi/java/android/net/wifi/WifiWatchdogStateMachine.java
index f31ee68..5220d04 100644
--- a/wifi/java/android/net/wifi/WifiWatchdogStateMachine.java
+++ b/wifi/java/android/net/wifi/WifiWatchdogStateMachine.java
@@ -100,15 +100,11 @@
        Level 1  -88 <= RSSI < -78
        Level 0         RSSI < -88 */
 
-    /* Wi-fi connection is considered poor below this
-       RSSI level threshold and the watchdog report it
-       to the WifiStateMachine */
-    private static final int RSSI_LEVEL_CUTOFF = 0;
     /* Wi-fi connection is monitored actively below this
        threshold */
-    private static final int RSSI_LEVEL_MONITOR = 1;
-    /* RSSI threshold during monitoring below which network is avoided */
-    private static final int RSSI_MONITOR_THRESHOLD = -84;
+    private static final int RSSI_LEVEL_MONITOR = 0;
+    /* Rssi threshold is at level 0 (-88dBm) */
+    private static final int RSSI_MONITOR_THRESHOLD = -88;
     /* Number of times RSSI is measured to be low before being avoided */
     private static final int RSSI_MONITOR_COUNT = 5;
     private int mRssiMonitorCount = 0;
@@ -193,7 +189,7 @@
     private WalledGardenCheckState mWalledGardenCheckState = new WalledGardenCheckState();
     /* Online and watching link connectivity */
     private OnlineWatchState mOnlineWatchState = new OnlineWatchState();
-    /* RSSI level is at RSSI_LEVEL_MONITOR and needs close monitoring */
+    /* RSSI level is below RSSI_LEVEL_MONITOR and needs close monitoring */
     private RssiMonitoringState mRssiMonitoringState = new RssiMonitoringState();
     /* Online and doing nothing */
     private OnlineState mOnlineState = new OnlineState();
@@ -731,9 +727,7 @@
         }
 
         private void handleRssiChange() {
-            if (mCurrentSignalLevel <= RSSI_LEVEL_CUTOFF) {
-                sendPoorLinkDetected();
-            } else if (mCurrentSignalLevel <= RSSI_LEVEL_MONITOR) {
+            if (mCurrentSignalLevel <= RSSI_LEVEL_MONITOR) {
                 transitionTo(mRssiMonitoringState);
             } else {
                 //stay here
@@ -773,9 +767,7 @@
             switch (msg.what) {
                 case EVENT_RSSI_CHANGE:
                     mCurrentSignalLevel = calculateSignalLevel(msg.arg1);
-                    if (mCurrentSignalLevel <= RSSI_LEVEL_CUTOFF) {
-                        sendPoorLinkDetected();
-                    } else if (mCurrentSignalLevel <= RSSI_LEVEL_MONITOR) {
+                    if (mCurrentSignalLevel <= RSSI_LEVEL_MONITOR) {
                         //stay here;
                     } else {
                         //We dont need frequent RSSI monitoring any more
diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pManager.java b/wifi/java/android/net/wifi/p2p/WifiP2pManager.java
index ef77d45..2c25e9d 100644
--- a/wifi/java/android/net/wifi/p2p/WifiP2pManager.java
+++ b/wifi/java/android/net/wifi/p2p/WifiP2pManager.java
@@ -21,7 +21,6 @@
 import android.content.Context;
 import android.net.ConnectivityManager;
 import android.net.IConnectivityManager;
-import android.net.nsd.DnsSdTxtRecord;
 import android.net.wifi.p2p.nsd.WifiP2pDnsSdServiceInfo;
 import android.net.wifi.p2p.nsd.WifiP2pDnsSdServiceResponse;
 import android.net.wifi.p2p.nsd.WifiP2pServiceInfo;
@@ -46,6 +45,7 @@
 
 import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * This class provides the API for managing Wi-Fi peer-to-peer connectivity. This lets an
@@ -585,11 +585,11 @@
          *
          * @param fullDomainName full domain name. <br>
          * e.g) "MyPrinter._ipp._tcp.local.".
-         * @param record txt record.
+         * @param txtRecordMap TXT record data as a map of key/value pairs
          * @param srcDevice source device.
          */
         public void onDnsSdTxtRecordAvailable(String fullDomainName,
-                DnsSdTxtRecord record,
+                Map<String, String> txtRecordMap,
                 WifiP2pDevice srcDevice);
    }
 
diff --git a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceInfo.java b/wifi/java/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceInfo.java
index 54b7ac4..bc1d3c6 100644
--- a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceInfo.java
+++ b/wifi/java/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceInfo.java
@@ -83,19 +83,22 @@
      *  e.g) "MyPrinter"
      * @param serviceType service type.<br>
      *  e.g) "_ipp._tcp"
-     * @param txtRecord TXT record as defined at
+     * @param txtMap TXT record with key/value pair in a map confirming to format defined at
      * http://files.dns-sd.org/draft-cheshire-dnsext-dns-sd.txt
      * @return Bonjour service information object
      */
     public static WifiP2pDnsSdServiceInfo newInstance(String instanceName,
-            String serviceType, DnsSdTxtRecord txtRecord) {
+            String serviceType, Map<String, String> txtMap) {
         if (TextUtils.isEmpty(instanceName) || TextUtils.isEmpty(serviceType)) {
             throw new IllegalArgumentException(
                     "instance name or service type cannot be empty");
         }
 
-        if (txtRecord == null) {
-            txtRecord = new DnsSdTxtRecord();
+        DnsSdTxtRecord txtRecord = new DnsSdTxtRecord();
+        if (txtMap != null) {
+            for (String key : txtMap.keySet()) {
+                txtRecord.set(key, txtMap.get(key));
+            }
         }
 
         ArrayList<String> queries = new ArrayList<String>();
diff --git a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceResponse.java b/wifi/java/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceResponse.java
index c053c8a..ed84a1a 100644
--- a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceResponse.java
+++ b/wifi/java/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceResponse.java
@@ -16,7 +16,6 @@
 
 package android.net.wifi.p2p.nsd;
 
-import android.net.nsd.DnsSdTxtRecord;
 import android.net.wifi.p2p.WifiP2pDevice;
 
 import java.io.ByteArrayInputStream;
@@ -68,7 +67,7 @@
      * This field is only used when the dns type equals to
      * {@link WifiP2pDnsSdServiceInfo#DNS_TYPE_TXT}.
      */
-    private DnsSdTxtRecord mTxtRecord;
+    private final HashMap<String, String> mTxtRecord = new HashMap<String, String>();
 
     /**
      * Virtual memory packet.
@@ -121,7 +120,7 @@
      * Return TXT record data.
      * @return TXT record data.
      */
-    public DnsSdTxtRecord getTxtRecord() {
+    public Map<String, String> getTxtRecord() {
         return mTxtRecord;
     }
 
@@ -133,8 +132,9 @@
         sbuf.append(" srcAddr:").append(mDevice.deviceAddress);
         sbuf.append(" version:").append(String.format("%02x", mVersion));
         sbuf.append(" dnsName:").append(mDnsQueryName);
-        if (mTxtRecord != null) {
-            sbuf.append(" TxtRecord:").append(mTxtRecord);
+        sbuf.append(" TxtRecord:");
+        for (String key : mTxtRecord.keySet()) {
+            sbuf.append(" key:").append(key).append(" value:").append(mTxtRecord.get(key));
         }
         if (mInstanceName != null) {
             sbuf.append(" InsName:").append(mInstanceName);
@@ -205,10 +205,7 @@
             mInstanceName = rData.substring(0,
                     rData.length() - mDnsQueryName.length() -1);
         } else if (mDnsType == WifiP2pDnsSdServiceInfo.DNS_TYPE_TXT) {
-            mTxtRecord = readTxtData(dis);
-            if (mTxtRecord == null) {
-                return false;
-            }
+            return readTxtData(dis);
         } else {
             return false;
         }
@@ -261,10 +258,9 @@
      * Read TXT record data.
      *
      * @param dis
-     * @return TXT record data
+     * @return true if TXT data is valid
      */
-    private DnsSdTxtRecord readTxtData(DataInputStream dis) {
-        DnsSdTxtRecord txtRecord = new DnsSdTxtRecord();
+    private boolean readTxtData(DataInputStream dis) {
         try {
             while (dis.available() > 0) {
                 int len = dis.readUnsignedByte();
@@ -275,15 +271,15 @@
                 dis.readFully(data);
                 String[] keyVal = new String(data).split("=");
                 if (keyVal.length != 2) {
-                    return null;
+                    return false;
                 }
-                txtRecord.set(keyVal[0], keyVal[1]);
+                mTxtRecord.put(keyVal[0], keyVal[1]);
             }
-            return txtRecord;
+            return true;
         } catch (IOException e) {
             e.printStackTrace();
         }
-        return null;
+        return false;
     }
 
     /**